|
@ -65,36 +65,42 @@ public class CountPlanAppService : |
|
|
var entity = ObjectMapper.Map<CountPlanCreateRequestInput, CountPlan>(input); |
|
|
var entity = ObjectMapper.Map<CountPlanCreateRequestInput, CountPlan>(input); |
|
|
|
|
|
|
|
|
entity.Worker = CurrentUser.GetUserName(); |
|
|
entity.Worker = CurrentUser.GetUserName(); |
|
|
|
|
|
TransactionTypeDTO tranTypeDto = await _transactionTypeAppService.GetByTransTypeAsync(EnumTransType.CountPlan, |
|
|
TransactionTypeDTO tranTypeDto = null; |
|
|
EnumTransSubType.None).ConfigureAwait(false); |
|
|
switch (input.RequestType) |
|
|
if (tranTypeDto == null) |
|
|
{ |
|
|
{ |
|
|
case CountPlanRequestType.Manual: |
|
|
throw new UserFriendlyException( |
|
|
tranTypeDto = await _transactionTypeAppService.GetByTransTypeAsync(EnumTransType.CountPlan, |
|
|
$"没有设置库存事务类型。主事务类型{EnumTransType.CountPlan}," + |
|
|
EnumTransSubType.ArtificialCountPlan).ConfigureAwait(false); |
|
|
$"子事务类型{EnumTransSubType.None}"); |
|
|
if (tranTypeDto == null) |
|
|
|
|
|
{ |
|
|
|
|
|
throw new UserFriendlyException( |
|
|
|
|
|
$"盘点方式 {input.RequestType} 没有设置库存事务类型。主事务类型{EnumTransType.CountPlan}," + |
|
|
|
|
|
$"子事务类型{EnumTransSubType.ArtificialCountPlan}"); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
break; |
|
|
|
|
|
case CountPlanRequestType.Import: |
|
|
|
|
|
tranTypeDto = await _transactionTypeAppService.GetByTransTypeAsync(EnumTransType.CountPlan, |
|
|
|
|
|
EnumTransSubType.ExcelInCountPlan).ConfigureAwait(false); |
|
|
|
|
|
if (tranTypeDto == null) |
|
|
|
|
|
{ |
|
|
|
|
|
throw new UserFriendlyException( |
|
|
|
|
|
$"盘点方式 {input.RequestType} 没有设置库存事务类型。主事务类型{EnumTransType.CountPlan}," + |
|
|
|
|
|
$"子事务类型{EnumTransSubType.ExcelInCountPlan}"); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
break; |
|
|
|
|
|
case CountPlanRequestType.None: |
|
|
|
|
|
default: |
|
|
|
|
|
throw new UserFriendlyException($"{input.RequestType}盘点方式设置错误"); |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
//switch (input.RequestType)
|
|
|
|
|
|
//{
|
|
|
|
|
|
// case CountPlanRequestType.Manual:
|
|
|
|
|
|
// tranTypeDto = await _transactionTypeAppService.GetByTransTypeAsync(EnumTransType.CountPlan,
|
|
|
|
|
|
// EnumTransSubType.ArtificialCountPlan).ConfigureAwait(false);
|
|
|
|
|
|
// if (tranTypeDto == null)
|
|
|
|
|
|
// {
|
|
|
|
|
|
// throw new UserFriendlyException(
|
|
|
|
|
|
// $"盘点方式 {input.RequestType} 没有设置库存事务类型。主事务类型{EnumTransType.CountPlan}," +
|
|
|
|
|
|
// $"子事务类型{EnumTransSubType.ArtificialCountPlan}");
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
// break;
|
|
|
|
|
|
// case CountPlanRequestType.Import:
|
|
|
|
|
|
// tranTypeDto = await _transactionTypeAppService.GetByTransTypeAsync(EnumTransType.CountPlan,
|
|
|
|
|
|
// EnumTransSubType.ExcelInCountPlan).ConfigureAwait(false);
|
|
|
|
|
|
// if (tranTypeDto == null)
|
|
|
|
|
|
// {
|
|
|
|
|
|
// throw new UserFriendlyException(
|
|
|
|
|
|
// $"盘点方式 {input.RequestType} 没有设置库存事务类型。主事务类型{EnumTransType.CountPlan}," +
|
|
|
|
|
|
// $"子事务类型{EnumTransSubType.ExcelInCountPlan}");
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
// break;
|
|
|
|
|
|
// case CountPlanRequestType.None:
|
|
|
|
|
|
// default:
|
|
|
|
|
|
// throw new UserFriendlyException($"{input.RequestType}盘点方式设置错误");
|
|
|
|
|
|
//}
|
|
|
|
|
|
|
|
|
entity.AutoCompleteJob = tranTypeDto.AutoCompleteJob; |
|
|
entity.AutoCompleteJob = tranTypeDto.AutoCompleteJob; |
|
|
entity.AutoSubmit = tranTypeDto.AutoSubmitRequest; |
|
|
entity.AutoSubmit = tranTypeDto.AutoSubmitRequest; |
|
|