|
|
@ -55,24 +55,6 @@ public class UnplannedReceiptRequestForDongyangAppService : UnplannedReceiptRequ |
|
|
|
return dictionary; |
|
|
|
} |
|
|
|
|
|
|
|
#region 校验
|
|
|
|
private void CheckItemBasic(ItemBasicDTO itemBasicDto, string itemCode) |
|
|
|
{ |
|
|
|
if (itemBasicDto == null) |
|
|
|
{ |
|
|
|
throw new UserFriendlyException($"物品代码为【{itemCode}】不存在"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
private void CheckLocation(LocationDTO locationDto, string locationCode) |
|
|
|
{ |
|
|
|
if (locationDto == null) |
|
|
|
{ |
|
|
|
throw new UserFriendlyException($"库位代码为【{locationCode}】不存在"); |
|
|
|
} |
|
|
|
} |
|
|
|
#endregion
|
|
|
|
|
|
|
|
#region 赋值
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
@ -200,6 +182,21 @@ public class UnplannedReceiptRequestForDongyangAppService : UnplannedReceiptRequ |
|
|
|
|
|
|
|
#region 校验
|
|
|
|
|
|
|
|
private void CheckItemBasic(ItemBasicDTO itemBasicDto, string itemCode) |
|
|
|
{ |
|
|
|
if (itemBasicDto == null) |
|
|
|
{ |
|
|
|
throw new UserFriendlyException($"物品代码为【{itemCode}】不存在"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
private void CheckLocation(LocationDTO locationDto, string locationCode) |
|
|
|
{ |
|
|
|
if (locationDto == null) |
|
|
|
{ |
|
|
|
throw new UserFriendlyException($"库位代码为【{locationCode}】不存在"); |
|
|
|
} |
|
|
|
} |
|
|
|
protected virtual async Task<BalanceDTO> CheckBalanceAsync(UnplannedReceiptRequestImportInput importInput, List<ValidationResult> validationRresult) |
|
|
|
{ |
|
|
|
var balance = await BalanceAclService.GetByItemLocationAndPackingAsync( |
|
|
@ -230,7 +227,7 @@ public class UnplannedReceiptRequestForDongyangAppService : UnplannedReceiptRequ |
|
|
|
|
|
|
|
if (dict == null) |
|
|
|
{ |
|
|
|
validationRresult.Add("字典编码", $"字典编码{nameof(importInput.CaseCode)}不存在"); |
|
|
|
validationRresult.Add(new ValidationResult($"字典编码{nameof(importInput.CaseCode)}不存在", new string[] { "字典编码" })); |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
@ -239,11 +236,19 @@ public class UnplannedReceiptRequestForDongyangAppService : UnplannedReceiptRequ |
|
|
|
var item = dict.Items.FirstOrDefault(t => t.Code == importInput.CaseCode); |
|
|
|
if (item == null) |
|
|
|
{ |
|
|
|
validationRresult.Add("专案代码", $"专案代码{importInput.CaseCode}不存在"); |
|
|
|
validationRresult.Add(new ValidationResult($"专案代码{importInput.CaseCode}不存在", new string[] { "专案代码" })); |
|
|
|
} |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
validationRresult.Add(new ValidationResult($"字典编码{nameof(importInput.CaseCode)}不存在", new string[] { "字典编码" })); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
validationRresult.Add(new ValidationResult($"专案不能为空")); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
protected virtual async Task CheckImportInputBusinessAsync(UnplannedReceiptRequestImportInput importInput, EnumImportMethod importMethod, List<ValidationResult> validationRresult) |
|
|
|