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)