|
|
@ -4,6 +4,8 @@ using System.ComponentModel.DataAnnotations; |
|
|
|
using System.IO; |
|
|
|
using System.Linq; |
|
|
|
using System.Threading.Tasks; |
|
|
|
using DocumentFormat.OpenXml.Bibliography; |
|
|
|
using DocumentFormat.OpenXml.Office2016.Excel; |
|
|
|
using Microsoft.AspNetCore.Http; |
|
|
|
using Microsoft.AspNetCore.Mvc; |
|
|
|
using Microsoft.EntityFrameworkCore; |
|
|
@ -118,7 +120,7 @@ public class UnplannedIssueRequestForDongyangAppService : UnplannedIssueRequestA |
|
|
|
|| string.IsNullOrEmpty(itm.ItemCode) |
|
|
|
|| itm.Qty == 0 |
|
|
|
|| string.IsNullOrEmpty(itm.ProjCapacityCode) |
|
|
|
|| string.IsNullOrEmpty(itm.LocationErpCode) |
|
|
|
|| string.IsNullOrEmpty(itm.FromLocationErpCode) |
|
|
|
|
|
|
|
) |
|
|
|
{ |
|
|
@ -232,7 +234,7 @@ public class UnplannedIssueRequestForDongyangAppService : UnplannedIssueRequestA |
|
|
|
detail.ItemCode = itm.ItemCode; |
|
|
|
detail.Qty = itm.Qty; |
|
|
|
|
|
|
|
detail.LocationErpCode = itm.LocationErpCode; |
|
|
|
detail.LocationErpCode = itm.FromLocationErpCode; |
|
|
|
detail.LocationCode = "Random"; |
|
|
|
detail.WarehouseCode ="Random"; |
|
|
|
detail.LocationGroup ="Random"; |
|
|
@ -314,11 +316,34 @@ public class UnplannedIssueRequestForDongyangAppService : UnplannedIssueRequestA |
|
|
|
// $"不是{EnumUnplannedReceiptType.Wip.GetDisplayName()}" +
|
|
|
|
// $"或{EnumUnplannedReceiptType.Raw.GetDisplayName()}】");
|
|
|
|
//}
|
|
|
|
//unplannedReceiptRequest.UnplannedIssueType = type;
|
|
|
|
unplannedReceiptRequest.SetId(GuidGenerator.Create()); |
|
|
|
unplannedReceiptRequest.AutoCompleteJob = false; |
|
|
|
unplannedReceiptRequest.AutoSubmit = true; |
|
|
|
unplannedReceiptRequest.AutoAgree = false; |
|
|
|
unplannedReceiptRequest.AutoHandle = false; |
|
|
|
unplannedReceiptRequest.DirectCreateNote = false; |
|
|
|
|
|
|
|
unplannedReceiptRequest.BuildDate = DateTime.Now; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
await SetRequestAutoPropertiesAsync(unplannedReceiptRequest).ConfigureAwait(false); |
|
|
|
await SetEntityPropertiesAsync(unplannedReceiptRequest).ConfigureAwait(false); |
|
|
|
|
|
|
|
foreach (var detail in unplannedReceiptRequest.Details) |
|
|
|
{ |
|
|
|
detail.LocationErpCode = unplannedReceiptRequest.FromErpLocationCode; |
|
|
|
detail.LocationCode = "Random"; |
|
|
|
detail.WarehouseCode = "Random"; |
|
|
|
detail.LocationGroup = "Random"; |
|
|
|
detail.LocationArea = "Random"; |
|
|
|
//detail.CaseCode = unplannedReceiptRequest.CaseCode;
|
|
|
|
//detail.ProjCapacityCode = first.ProjCapacityCode;
|
|
|
|
//detail.OnceBusiCode = first.OnceBusiCode;
|
|
|
|
//detail.Explain = first.Explain;
|
|
|
|
await SetDetailPropertiesAsync(detail).ConfigureAwait(false); |
|
|
|
} |
|
|
|
} |
|
|
@ -511,16 +536,19 @@ public class UnplannedIssueRequestForDongyangAppService : UnplannedIssueRequestA |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
protected async Task<BalanceDTO> CheckBalanceAsync(UnplannedIssueRequestImportInput importInput, List<ValidationResult> validationRresult) |
|
|
|
{ |
|
|
|
var balance = await BalanceAclService.GetByItemLocationAndPackingAsync( |
|
|
|
string.Empty, |
|
|
|
importInput.ItemCode, |
|
|
|
importInput.LocationErpCode).ConfigureAwait(false); |
|
|
|
importInput.FromErpLocationCode).ConfigureAwait(false); |
|
|
|
|
|
|
|
if (balance == null) |
|
|
|
{ |
|
|
|
validationRresult.Add(new ValidationResult($"ERP料号{importInput.ItemCode}在库位{importInput.LocationErpCode}没有库存记录", new string[] { "库存余额" })); |
|
|
|
validationRresult.Add(new ValidationResult($"ERP料号{importInput.ItemCode}在库位{importInput.FromErpLocationCode}没有库存记录", new string[] { "库存余额" })); |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
@ -568,7 +596,7 @@ public class UnplannedIssueRequestForDongyangAppService : UnplannedIssueRequestA |
|
|
|
protected override async Task ValidateImportModelAsync(UnplannedIssueRequestImportInput model, List<ValidationResult> validationRresult) |
|
|
|
{ |
|
|
|
_ = await CheckItemBasicAsync(model, validationRresult).ConfigureAwait(false); |
|
|
|
await CheckErpLocationAsync(model.LocationErpCode, validationRresult).ConfigureAwait(false); |
|
|
|
await CheckErpLocationAsync(model.FromErpLocationCode, validationRresult).ConfigureAwait(false); |
|
|
|
|
|
|
|
await CheckOnceBusiCodeAsync(model, validationRresult).ConfigureAwait(false);//次交易码
|
|
|
|
//await CheckCaseCodeAsync(model, validationRresult).ConfigureAwait(false);//专案代码
|
|
|
|