From 2c12375f94e3e900ed14ac01816c434b77c4905c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=91=E6=B8=A4=E6=97=AD=5BIrelia=5D?= <366601522@qq.com> Date: Tue, 15 Aug 2023 15:24:11 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=AE=8C=E5=B7=A5?= =?UTF-8?q?=E5=BA=93=E4=BD=8D=E8=8E=B7=E5=8F=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Transactions/ProductReceiptNoteEventHandler.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Transactions/ProductReceiptNoteEventHandler.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Transactions/ProductReceiptNoteEventHandler.cs index d20477238..51f04c5f1 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Transactions/ProductReceiptNoteEventHandler.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Transactions/ProductReceiptNoteEventHandler.cs @@ -78,8 +78,9 @@ public class ProductReceiptNoteEventHandler var itemBasicDto= await _itemBasicAppService.GetByCodeAsync(detail.ItemCode).ConfigureAwait(false); var locationDtos = await _locationAppService.GetListByTypesAndErpCodeAsync( - new List { EnumLocationType.WIP }, - detail.LocationErpCode).ConfigureAwait(false); + new List { EnumLocationType.WIP,EnumLocationType.FG }, + detail.LocationErpCode, + detail.LocationCode).ConfigureAwait(false); if (locationDtos == null||locationDtos.Count<1) { From 5e3b87dee404bcd8075dd0365897a818357edf09 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=91=E6=B8=A4=E6=97=AD=5BIrelia=5D?= <366601522@qq.com> Date: Tue, 15 Aug 2023 15:28:04 +0800 Subject: [PATCH 2/3] 1 --- .../ProductReceiptNoteEventHandler.cs | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Transactions/ProductReceiptNoteEventHandler.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Transactions/ProductReceiptNoteEventHandler.cs index 51f04c5f1..e000b4e8a 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Transactions/ProductReceiptNoteEventHandler.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Transactions/ProductReceiptNoteEventHandler.cs @@ -77,16 +77,6 @@ public class ProductReceiptNoteEventHandler var transaction = ObjectMapper.Map(detail); var itemBasicDto= await _itemBasicAppService.GetByCodeAsync(detail.ItemCode).ConfigureAwait(false); - var locationDtos = await _locationAppService.GetListByTypesAndErpCodeAsync( - new List { EnumLocationType.WIP,EnumLocationType.FG }, - detail.LocationErpCode, - detail.LocationCode).ConfigureAwait(false); - - if (locationDtos == null||locationDtos.Count<1) - { - throw new UserFriendlyException( - $"Erp储位为【{detail.LocationErpCode}】,库位类型为{EnumLocationType.WIP.GetDisplayName()}的库位不存在。"); - } if (itemBasicDto == null) { @@ -98,11 +88,6 @@ public class ProductReceiptNoteEventHandler detail.ItemDesc2 = itemBasicDto.Desc2; detail.ItemName=itemBasicDto.Name; detail.StdPackQty=itemBasicDto.StdPackQty; - var erpLocationDto = locationDtos.First(); - detail.LocationArea = erpLocationDto.Code; - detail.LocationGroup = erpLocationDto.LocationGroupCode; - detail.LocationErpCode= erpLocationDto.Code; - detail.LocationCode= erpLocationDto.Code; transaction.TransType = TransType; transaction.TransInOut = TransInOut; From 8796f597c1416f28e974a88282bfd0a06be1fe8c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=91=E6=B8=A4=E6=97=AD=5BIrelia=5D?= <366601522@qq.com> Date: Tue, 15 Aug 2023 22:24:56 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=AE=8C=E5=B7=A5?= =?UTF-8?q?=E6=94=B6=E8=B4=A7=E8=B5=8B=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Incoming/MesOutConverter.cs | 33 ++++++++++++++----- 1 file changed, 25 insertions(+), 8 deletions(-) diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent/Incoming/MesOutConverter.cs b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent/Incoming/MesOutConverter.cs index bb7a60b7e..0910e4add 100644 --- a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent/Incoming/MesOutConverter.cs +++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent/Incoming/MesOutConverter.cs @@ -12,6 +12,7 @@ using Win_in.Sfs.Shared.Domain.Shared; using Win_in.Sfs.Wms.DataExchange.Domain; using Win_in.Sfs.Wms.DataExchange.WMS.ProductReceiptNote; using Win_in.Sfs.Wms.Store.Application.Contracts; +using Win_in.Sfs.Wms.Store.Domain; namespace Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent; @@ -96,25 +97,41 @@ public class MesOutConverter : IIncomingConverter wmsProductReceiptNoteDetail.LocationCode = loc[0].Code; wmsProductReceiptNoteDetail.LocationArea = loc[0].AreaCode; wmsProductReceiptNoteDetail.LocationGroup = loc[0].LocationGroupCode; - } + wmsProductReceiptNoteDetail.LocationErpCode = loc[0].ErpLocationCode; + + wmsProductReceiptNoteDetail.HandledToLocationCode = loc[0].Code; + wmsProductReceiptNoteDetail.HandledToLocationArea = loc[0].AreaCode; + wmsProductReceiptNoteDetail.HandledToLocationGroup = loc[0].LocationGroupCode; + wmsProductReceiptNoteDetail.HandledToLocationErpCode = loc[0].ErpLocationCode; + wmsProductReceiptNoteDetail.RecommendToLocationCode = loc[0].Code; + wmsProductReceiptNoteDetail.RecommendToLocationArea = loc[0].AreaCode; + wmsProductReceiptNoteDetail.RecommendToLocationGroup = loc[0].LocationGroupCode; + wmsProductReceiptNoteDetail.RecommendToLocationErpCode = loc[0].ErpLocationCode; + } var item = await _itemBasicAppService.GetByCodeAsync(wmsProductReceiptNoteDetail.ItemCode).ConfigureAwait(false); - if (item != null) - { + if (item != null) + { wmsProductReceiptNoteDetail.ItemName = !string.IsNullOrEmpty(item.Name) ? item.Name : ""; wmsProductReceiptNoteDetail.ItemDesc1 = !string.IsNullOrEmpty(item.Desc1) ? item.Desc1 : ""; wmsProductReceiptNoteDetail.ItemDesc2 = !string.IsNullOrEmpty(item.Desc2) ? item.Desc2 : ""; wmsProductReceiptNoteDetail.Uom = !string.IsNullOrEmpty(item.BasicUom) ? item.BasicUom : ""; - } - else - { + + wmsProductReceiptNoteDetail.ProduceDate = incomingFromExternal.EffectiveDate; + wmsProductReceiptNoteDetail.ArriveDate = incomingFromExternal.EffectiveDate; + wmsProductReceiptNoteDetail.ExpireDate = wmsProductReceiptNoteDetail.ProduceDate.AddDays(item.GetValidateDays()); + + } + else + { + //todo 这里不应该做完工 没有零件 wmsProductReceiptNoteDetail.ItemName = ""; wmsProductReceiptNoteDetail.ItemDesc1 = ""; wmsProductReceiptNoteDetail.ItemDesc2 = ""; wmsProductReceiptNoteDetail.Uom = ""; - } - wmsProductReceiptNote.Details.Add(wmsProductReceiptNoteDetail); + } + wmsProductReceiptNote.Details.Add(wmsProductReceiptNoteDetail); } incomingToWms.DataContent = JsonSerializer.Serialize(wmsProductReceiptNote); incomingToWmsList.Add(incomingToWms);