From 88fa0d0ef9f91906e2521bd80f43a87d39d820da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=A6=20=E8=B5=B5?= <89237069@qq.com> Date: Thu, 26 Dec 2024 10:29:33 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=BA=93=E4=BD=8D=E5=88=A4?= =?UTF-8?q?=E6=96=AD=E5=AE=8C=E5=B7=A5=E8=BD=AC=E5=82=A8=E7=B1=BB=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ProductionLineItemAppService.cs | 1 + .../TransferNotes/TransferNoteAppService.cs | 62 ++++++++++++++----- 2 files changed, 48 insertions(+), 15 deletions(-) diff --git a/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/ProductionLineItems/ProductionLineItemAppService.cs b/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/ProductionLineItems/ProductionLineItemAppService.cs index b2d9b2523..ba125ea30 100644 --- a/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/ProductionLineItems/ProductionLineItemAppService.cs +++ b/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/ProductionLineItems/ProductionLineItemAppService.cs @@ -111,6 +111,7 @@ public class ProductionLineItemAppService : { validationRresult.Add(new ValidationResult("[来源]成品/半成品库位 或 [来源]原材料库位 或 [完工]线边库位 不能都为空")); } + } [HttpPost("get-by-product")] public virtual async Task> GetByProductLineCodeAsync(string productLineCode) { diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/TransferNotes/TransferNoteAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/TransferNotes/TransferNoteAppService.cs index 2bf7ba934..7609a4b4f 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/TransferNotes/TransferNoteAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/TransferNotes/TransferNoteAppService.cs @@ -129,6 +129,7 @@ public class TransferNoteAppService : SfsStoreWithDetailsAppServiceBase CheckLocation(toLocationDto, detail); CheckFromLocation(fromLocationDto, detail); + await CheckPackingCode(detail.FromPackingCode).ConfigureAwait(false); if (toLocationDto.Type != fromLocationDto.Type) { throw new UserFriendlyException($"来源库位与目标库位类型不一致"); @@ -398,7 +399,14 @@ public class TransferNoteAppService : SfsStoreWithDetailsAppServiceBase { var entity = ObjectMapper.Map(input); - entity=await _transferNoteManager.CreateAsync(entity).ConfigureAwait(false); + foreach (var detail in entity.Details) + { + if (!string.IsNullOrEmpty(detail.FromPackingCode)) + { + await CheckPackingCode(detail.FromPackingCode).ConfigureAwait(false); + } + } + entity =await _transferNoteManager.CreateAsync(entity).ConfigureAwait(false); var dto = ObjectMapper.Map(entity); @@ -419,6 +427,13 @@ public class TransferNoteAppService : SfsStoreWithDetailsAppServiceBase foreach (var entity in entitys) { + foreach (var detail in entity.Details) + { + if (!string.IsNullOrEmpty(detail.FromPackingCode)) + { + await CheckPackingCode(detail.FromPackingCode).ConfigureAwait(false); + } + } resultEntity.Add(await _transferNoteManager.CreateAsync(entity).ConfigureAwait(false)); _ = ObjectMapper.Map(entity); } @@ -426,6 +441,24 @@ public class TransferNoteAppService : SfsStoreWithDetailsAppServiceBase return ObjectMapper.Map, List>(resultEntity); } + /// + /// 校验箱码 + /// + /// + /// + /// + private async Task CheckPackingCode(string packingCode) + { + var packingcode = await _expectOutAppService.GetListByPackingCodeAsync(packingCode).ConfigureAwait(false); + if (packingcode != null) + { + throw new UserFriendlyException($"箱码{packingCode}在预计出中已存在!"); + } + } + + + + /// /// 确认对应的记录单 /// @@ -703,7 +736,7 @@ public class TransferNoteAppService : SfsStoreWithDetailsAppServiceBase { TransferNoteEditInput transfer = new TransferNoteEditInput(); transfer.CallJobNumber = detail.OrderNum; - transfer.Type = EnumTransSubType.Agv_Transfer_WIP.ToString(); + transfer.Worker = "Agv"; transfer.UseOnTheWayLocation = false; List transferNoteDetailInputs = new List(); @@ -724,19 +757,18 @@ public class TransferNoteAppService : SfsStoreWithDetailsAppServiceBase { errors.Add($"结束点{detail.EndPosition}库位没查到"); } - -// if(tolocation.WorkGroupCode) - -// tolocation.LocationGroupCode= - - -//APA-KWZ -//PPA-KWZ -//IPA-KWZ - - - - + switch (tolocation.WarehouseCode) + { + case "APA-KWZ":// 装配线边库位组 + transfer.Type = EnumTransSubType.Transfer_Assemble.ToString(); + break; + case "PPA-KWZ"://涂装线边库位组 + transfer.Type = EnumTransSubType.Transfer_Coating.ToString(); + break; + case "IPA-KWZ"://注塑线边库位组 + transfer.Type = EnumTransSubType.Transfer_Injection.ToString(); + break; + } var item = await _itemBasicAppService.GetByCodeAsync(detail.MatCode).ConfigureAwait(false); if (item == null)