From 9862ba85bd0b88d75378e2895b5abf4ad989f77a Mon Sep 17 00:00:00 2001 From: liuyunfeng Date: Wed, 22 May 2024 17:11:02 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E6=8B=86=E7=AE=B1=E8=AE=B0=E5=BD=95?= =?UTF-8?q?=E8=A1=A8=E6=B2=A1=E6=9C=89=E5=8D=95=E5=8F=B7=E3=80=81=E5=88=9B?= =?UTF-8?q?=E5=BB=BAlabel=E6=B2=A1=E6=9C=89=E5=90=8C=E6=AD=A5=E6=8B=86?= =?UTF-8?q?=E7=AE=B1=E8=AE=B0=E5=BD=95=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../SplitPackings/SplitPackingRecManager.cs | 30 ++++++++++++--- .../InventoryLabelAppService.cs | 38 +++++++++++++------ 2 files changed, 51 insertions(+), 17 deletions(-) diff --git a/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Domain/SplitPackings/SplitPackingRecManager.cs b/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Domain/SplitPackings/SplitPackingRecManager.cs index fec61d5b1..4624bb1a2 100644 --- a/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Domain/SplitPackings/SplitPackingRecManager.cs +++ b/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Domain/SplitPackings/SplitPackingRecManager.cs @@ -175,12 +175,30 @@ public class SplitPackingRecManager : DomainService, ISplitPackingRecManager var historyRec = historyQuery.Where(itm => itm.FromPackingCode == obj.FromPackingCode).OrderBy(itm => itm.CreationTime).FirstOrDefault(); if (historyRec != null) { - obj.PurchaseInfo_PoNumber = historyRec.PurchaseInfo_PoNumber; //采购订单 - obj.PurchaseInfo_AsnNumber = historyRec.PurchaseInfo_AsnNumber; //供应商发货单 - obj.ArrivalNoticNumber = historyRec.ArrivalNoticNumber; //到货通知 - obj.TaskOrderNumber = historyRec.TaskOrderNumber; //任务单 - obj.ReceiptRecNumber = historyRec.ReceiptRecNumber; //收货记录单 - obj.PutOnShelfNumber = historyRec.PutOnShelfNumber; //上架单 + if (historyRec.PurchaseInfo_PoNumber.HasValue()) + { + obj.PurchaseInfo_PoNumber = historyRec.PurchaseInfo_PoNumber; //采购订单 + } + if (historyRec.PurchaseInfo_AsnNumber.HasValue()) + { + obj.PurchaseInfo_AsnNumber = historyRec.PurchaseInfo_AsnNumber; //供应商发货单 + } + if (historyRec.ArrivalNoticNumber.HasValue()) + { + obj.ArrivalNoticNumber = historyRec.ArrivalNoticNumber; //到货通知 + } + if (historyRec.TaskOrderNumber.HasValue()) + { + obj.TaskOrderNumber = historyRec.TaskOrderNumber; //任务单 + } + if (historyRec.ReceiptRecNumber.HasValue()) + { + obj.ReceiptRecNumber = historyRec.ReceiptRecNumber; //收货记录单 + } + if (historyRec.PutOnShelfNumber.HasValue()) + { + obj.PutOnShelfNumber = historyRec.PutOnShelfNumber; //上架单 + } } //else //{ diff --git a/be/Modules/Label/src/Win_in.Sfs.Label.Application/InventoryLabels/InventoryLabelAppService.cs b/be/Modules/Label/src/Win_in.Sfs.Label.Application/InventoryLabels/InventoryLabelAppService.cs index 4e503bc23..2d950e7c6 100644 --- a/be/Modules/Label/src/Win_in.Sfs.Label.Application/InventoryLabels/InventoryLabelAppService.cs +++ b/be/Modules/Label/src/Win_in.Sfs.Label.Application/InventoryLabels/InventoryLabelAppService.cs @@ -133,6 +133,8 @@ public class InventoryLabelAppService [UnitOfWork] public virtual async Task> CreateManyByNoCodeAsync(List inputs) { + await InsertSplitBoxRecAsync(inputs).ConfigureAwait(false); //插入拆箱记录表 + var entitys = ObjectMapper.Map, List>(inputs); await _repository.InsertManyAsync(entitys).ConfigureAwait(false); return ObjectMapper.Map, List>(entitys); @@ -149,10 +151,24 @@ public class InventoryLabelAppService [UnitOfWork] public virtual async Task> CreateManyByNoCode_NewAsync(List inputs) { - #region 插入拆箱记录表 + await InsertSplitBoxRecAsync(inputs).ConfigureAwait(false); //插入拆箱记录表 + + var entitys = ObjectMapper.Map, List>(inputs); + await _repository.InsertManyAsync(entitys).ConfigureAwait(false); + return ObjectMapper.Map, List>(entitys); + } + + /// + /// 插入拆箱记录表 + /// + /// InventoryLabelEditInput列表 + /// + /// + private async Task InsertSplitBoxRecAsync(List inputs) + { + List recLst = new List(); foreach (var inputObj in inputs) { - List recLst = new List(); SplitPackingRecEditInput packRec = new SplitPackingRecEditInput(); packRec.OprType = OprTypeEnum.Other; packRec.FromPackingCode = inputObj.Code; @@ -178,17 +194,13 @@ public class InventoryLabelAppService packRec.ReceiptRecNumber = null; //收货记录单 packRec.PutOnShelfNumber = null; //上架单 recLst.Add(packRec); - bool bo = await _splitPackingRecAppService.BatchInsertAsync(recLst).ConfigureAwait(false); - if (bo == false) - { - throw new UserFriendlyException("调用插入拆箱记录表方法时返回假!"); - } } - #endregion + bool bo = await _splitPackingRecAppService.BatchInsertAsync(recLst).ConfigureAwait(false); + if (bo == false) + { + throw new UserFriendlyException("调用插入拆箱记录表方法时返回假!"); + } - var entitys = ObjectMapper.Map, List>(inputs); - await _repository.InsertManyAsync(entitys).ConfigureAwait(false); - return ObjectMapper.Map, List>(entitys); } @@ -233,6 +245,10 @@ public class InventoryLabelAppService var createInput = ObjectMapper.Map(input); createInput.Code = numbers[i]; + var lst = new List(); + lst.Add(createInput); + await InsertSplitBoxRecAsync(lst).ConfigureAwait(false); //插入拆箱记录表 + await CheckCreatePolicyAsync().ConfigureAwait(continueOnCapturedContext: false); var createEntity=ObjectMapper.Map(createInput);