|
|
@ -39,6 +39,7 @@ public class UnplannedIssueRequestForDongyangAppService : UnplannedIssueRequestA |
|
|
|
private readonly ITransactionTypeAclService _transactionTypeAclService; |
|
|
|
private readonly IUnplannedIssueJobAppService _unplannedIssueJobAppService; |
|
|
|
private readonly IUnitOfWorkManager _unitOfWorkManager; |
|
|
|
private readonly ILogger<UnplannedIssueRequestForDongyangAppService> _logger; |
|
|
|
//private readonly IExportImportService _excelService;
|
|
|
|
|
|
|
|
|
|
|
@ -46,6 +47,9 @@ public class UnplannedIssueRequestForDongyangAppService : UnplannedIssueRequestA |
|
|
|
IUnplannedIssueRequestManager unplannedIssueRequestManager, |
|
|
|
IDepartmentAppService departmentApp, IBalanceAppService balanceAppService, ILocationAppService locationAppService, IExportImportService excelService, |
|
|
|
ITransactionTypeAclService transactionTypeAclService, IUnplannedIssueJobAppService unplannedIssueJobAppService, IUnitOfWorkManager unitOfWorkManager |
|
|
|
, ILogger<UnplannedIssueRequestForDongyangAppService> logger |
|
|
|
|
|
|
|
|
|
|
|
) : base( repository, unplannedIssueRequestManager, excelService) |
|
|
|
{ |
|
|
|
_unplannedIssueRequestManager = unplannedIssueRequestManager; |
|
|
@ -55,6 +59,7 @@ public class UnplannedIssueRequestForDongyangAppService : UnplannedIssueRequestA |
|
|
|
_transactionTypeAclService = transactionTypeAclService; |
|
|
|
_unplannedIssueJobAppService = unplannedIssueJobAppService; |
|
|
|
_unitOfWorkManager = unitOfWorkManager; |
|
|
|
_logger = logger; |
|
|
|
} |
|
|
|
/// <summary>
|
|
|
|
/// OA创建计划外出库申请
|
|
|
@ -184,8 +189,18 @@ public class UnplannedIssueRequestForDongyangAppService : UnplannedIssueRequestA |
|
|
|
|
|
|
|
public async Task<UnplannedIssueRequestDTO> CreateByAsync(List<UnplannedIssueRequestImportDto> p_list) |
|
|
|
{ |
|
|
|
UnplannedIssueRequestDTO request = new UnplannedIssueRequestDTO(); |
|
|
|
try |
|
|
|
{ |
|
|
|
return await CreateByDYOAsync(p_list, EnumUnplannedIssueType.OA, true).ConfigureAwait(false); |
|
|
|
} |
|
|
|
catch (Exception e) |
|
|
|
{ |
|
|
|
|
|
|
|
throw new UserFriendlyException(e.Message); |
|
|
|
} |
|
|
|
|
|
|
|
return await CreateByDYOAsync(p_list, EnumUnplannedIssueType.OA, true).ConfigureAwait(false); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -194,6 +209,9 @@ public class UnplannedIssueRequestForDongyangAppService : UnplannedIssueRequestA |
|
|
|
protected async Task<UnplannedIssueRequestDTO> CreateByDYOAsync(List<UnplannedIssueRequestImportDto> p_list, EnumUnplannedIssueType type, bool isAutoSubmit=false) |
|
|
|
{ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
UnplannedIssueRequest request = new UnplannedIssueRequest(); |
|
|
|
if (p_list.Count == 0) |
|
|
|
{ |
|
|
@ -563,7 +581,7 @@ public class UnplannedIssueRequestForDongyangAppService : UnplannedIssueRequestA |
|
|
|
protected override async Task ValidateImportModelAsync(UnplannedIssueRequestImportInput model, List<ValidationResult> validationRresult) |
|
|
|
{ |
|
|
|
_ = await CheckItemBasicAsync(model, validationRresult).ConfigureAwait(false); |
|
|
|
//_ = await CheckLocationAsync(model.LocationErpCode, validationRresult).ConfigureAwait(false);
|
|
|
|
_ = await CheckErpLocationAsync(model.LocationErpCode, validationRresult).ConfigureAwait(false); |
|
|
|
|
|
|
|
await CheckOnceBusiCodeAsync(model, validationRresult).ConfigureAwait(false);//次交易码
|
|
|
|
//await CheckCaseCodeAsync(model, validationRresult).ConfigureAwait(false);//专案代码
|
|
|
@ -586,15 +604,14 @@ public class UnplannedIssueRequestForDongyangAppService : UnplannedIssueRequestA |
|
|
|
return item; |
|
|
|
} |
|
|
|
|
|
|
|
//protected async Task<LocationDTO> CheckLocationAsync(string locationCode, List<ValidationResult> validationRresult)
|
|
|
|
//{
|
|
|
|
// var location = await LocationAclService.GetByCodeAsync(locationCode).ConfigureAwait(false);
|
|
|
|
// if (location == null)
|
|
|
|
// {
|
|
|
|
// validationRresult.Add(new ValidationResult($"调出库位{locationCode}不存在", new string[] { "调出库位" }));
|
|
|
|
// }
|
|
|
|
// return location;
|
|
|
|
//}
|
|
|
|
protected virtual async Task CheckErpLocationAsync(string locationCode, List<ValidationResult> validationRresult) |
|
|
|
{ |
|
|
|
var location = await _locationAppService.GetListByErpLocationCodes(new List<string> { locationCode }).ConfigureAwait(false); |
|
|
|
if (location == null || location.Count == 0) |
|
|
|
{ |
|
|
|
validationRresult.Add("调出储位", $"调入出位{locationCode}不存在"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
protected async Task CheckOnceBusiCodeAsync(UnplannedIssueRequestImportInput importInput, List<ValidationResult> validationRresult) |
|
|
|
{ |
|
|
|