学 赵
1 year ago
13 changed files with 393 additions and 58 deletions
@ -0,0 +1,97 @@ |
|||
using Hangfire.Annotations; |
|||
using SettleAccount.Bases; |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Linq; |
|||
using System.Text; |
|||
using System.Threading.Tasks; |
|||
using Volo.Abp; |
|||
using Volo.Abp.Domain.Entities; |
|||
using Volo.Abp.Domain.Services; |
|||
using Volo.Abp.Guids; |
|||
using Volo.Abp.ObjectMapping; |
|||
using Win.Sfs.SettleAccount.Bases.DomainServices; |
|||
using Win.Sfs.SettleAccount.Boms; |
|||
using Win.Sfs.SettleAccount.Entities.Materials; |
|||
using Win.Sfs.SettleAccount.MaterialRelationships; |
|||
using Win.Sfs.Shared.RepositoryBase; |
|||
|
|||
namespace Win.Sfs.SettleAccount.Entities.Managers |
|||
{ |
|||
public class CAN_SA_MNG<TEntity,TEntityDetail> : DomainService |
|||
where TEntity : SA_CAN_BASE_MAIN |
|||
where TEntityDetail : SA_CAN_BASE |
|||
{ |
|||
private readonly INormalEfCoreRepository<TEntity, Guid> _repository; |
|||
private readonly INormalEfCoreRepository<TEntityDetail, Guid> _detailRepository; |
|||
public CAN_SA_MNG |
|||
( |
|||
INormalEfCoreRepository<TEntity, Guid> repository, |
|||
INormalEfCoreRepository<TEntityDetail, Guid> detailRepository |
|||
) |
|||
{ |
|||
_repository= repository; |
|||
_detailRepository= detailRepository; |
|||
} |
|||
public virtual async Task<bool> SetState(TEntity p_entiy,SettleBillState state) |
|||
{ |
|||
switch (p_entiy.State) |
|||
{ |
|||
case SettleBillState.财务已审核: |
|||
if (state == SettleBillState.商务已审核) |
|||
{ |
|||
p_entiy.State = state; |
|||
} |
|||
else |
|||
{ |
|||
throw new BusinessException("8989", "当前状态不是【商务已审核】,无法设置成【财务已审核】状态"); |
|||
} |
|||
break; |
|||
case SettleBillState.商务已审核: |
|||
if (state == SettleBillState.已开票) |
|||
{ |
|||
p_entiy.State = state; |
|||
} |
|||
else |
|||
{ |
|||
throw new BusinessException("8989", "当前状态不是【已开票】状态,无法设置成【商务已审核】"); |
|||
} |
|||
break; |
|||
case SettleBillState.已开票: |
|||
if (state == SettleBillState.未结状态) |
|||
{ |
|||
p_entiy.State = state; |
|||
} |
|||
else |
|||
{ |
|||
throw new BusinessException("8989", "当前状态不是【未结状态】状态,无法设置成【已开票】"); |
|||
} |
|||
break; |
|||
case SettleBillState.已扣减: |
|||
if (state == SettleBillState.财务已审核) |
|||
{ |
|||
p_entiy.State = state; |
|||
} |
|||
else |
|||
{ |
|||
throw new BusinessException("8989", "当前状态不是【商务已审核】,无法设置成【财务已审核】状态"); |
|||
} |
|||
break; |
|||
} |
|||
await _repository.UpdateAsync(p_entiy); |
|||
return true; |
|||
} |
|||
|
|||
|
|||
} |
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
} |
@ -0,0 +1,42 @@ |
|||
using SettleAccount.Bases; |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Linq; |
|||
using System.Text; |
|||
using System.Threading.Tasks; |
|||
using Volo.Abp.Domain.Services; |
|||
using Volo.Abp; |
|||
using Win.Sfs.Shared.RepositoryBase; |
|||
|
|||
namespace Win.Sfs.SettleAccount.Entities.Managers |
|||
{ |
|||
/// <summary>
|
|||
/// 不能結算管理
|
|||
/// </summary>
|
|||
/// <typeparam name="TEntity"></typeparam>
|
|||
/// <typeparam name="TEntityDetail"></typeparam>
|
|||
/// <typeparam name="TNOTDetail"></typeparam>
|
|||
public class NOT_SA_MNG<TEntity,TEntityDetail, TNOTDetail> : DomainService |
|||
where TEntity : SA_CAN_BASE_MAIN |
|||
where TEntityDetail : SA_CAN_BASE |
|||
where TNOTDetail:SA_NOT_BASE |
|||
{ |
|||
private readonly INormalEfCoreRepository<TEntity, Guid> _repository; |
|||
private readonly INormalEfCoreRepository<TEntityDetail, Guid> _detailRepository; |
|||
public NOT_SA_MNG |
|||
( |
|||
INormalEfCoreRepository<TEntity, Guid> repository, |
|||
INormalEfCoreRepository<TEntityDetail, Guid> detailRepository |
|||
) |
|||
{ |
|||
_repository = repository; |
|||
_detailRepository = detailRepository; |
|||
} |
|||
public virtual async Task<bool> GenerateSettlementOrder(List<TNOTDetail> p_list) |
|||
{ |
|||
return true; |
|||
} |
|||
|
|||
|
|||
} |
|||
} |
Loading…
Reference in new issue