diff --git a/README.md b/README.md index ef6723d02..f0cd9bf14 100644 --- a/README.md +++ b/README.md @@ -1,42 +1,23 @@ # 开发和部署方式 -## windows x64 下本地开发 +## 开发环境配置 -当前项目基于 .net 6 sdk,安装 visual studio 2022 时通常会自带 +### 软件安装 -### supervisor 方式开发 +1. visual studio 2022(.net 6 sdk) +1. Docker Desktop(wsl2) -1. 根据项目需求,安装 SQL Server 或 MySQL -2. 使用 build/src/win-x64/publish/ 目录下的 dev.start.cmd 和 dev.stop.cmd 管理非数据库依赖 +### 配置文件 -配置文件: +配置文件存储在build\src\docker\publish\conf 目录下,settings 目录存放程序配置文件,其他目录存放依赖配置文件 -1. supervisor: `build\src\win-x64\publish\supervisord\supervisor.dev.conf` -1. nginx: `build\src\win-x64\publish\nginx\conf\nginx.conf` -1. gateway: `build\src\win-x64\publish\gateway\appsettings.json` -1. config: `build\src\win-x64\publish\gateway\wwwroot\settings\appsettings.json` -1. config: `build\src\win-x64\publish\gateway\wwwroot\settings\appsettings.Development.json` +### 依赖管理 -```mermaid -flowchart LR -nginx --localhost:21093--> gateway--localhost:59092--> api:59092 -api:59092 --localhost:6379--> redis:6379 -api:59092 --localhost:13319--> database:13319 -gateway --localhost:8086--> influxdb:8086 -``` - -### Docker Desktop 方式开发 - -1. 无需按照数据库 -2. 使用 build/src/docker/publish/ 目录下的 dev.start.cmd 和 dev.stop.cmd 管理依赖 +使用 build/src/docker/publish/ 目录下的 dev.start.cmd 和 dev.stop.cmd 管理依赖的停止启动,可以在Docker Desktop中查看和管理启动的服务 ## 部署 -### windows x64 supervisor 方式部署 - -1. 执行: `build\src\win-x64\build.cmd` -2. 上传: `build\dist\win-x64\publish` 目录到服务器 -3. 修改配置,执行 publish 目录下的 start.cmd +Docker 和 Windows 部署两种方式只需要按需修改配置文件中的主机名和端口,windows单机部署时使用localhost作为主机名,docker compose单机部署时使用service name 作为主机名 ### docker compose 方式部署 @@ -44,7 +25,8 @@ gateway --localhost:8086--> influxdb:8086 2. 上传: `build\dist\win-x64\publish` 目录到服务器 3. 修改配置,执行 publish 目录下的 start.sh 或 start.cmd -构建时的处理: +### windows x64 方式部署 -1. 复制并重命名 build\src\win-x64\publish\nginx\conf 到 build\dist\docker\publish\conf\nginx,保持nginx的配置文件统一在 build\src\win-x64\publish\nginx\conf 目录维护 -1. 复制 build\src\win-x64\publish\gateway 到 build\dist\docker\publish\gateway,保持网关的配置和应用的配置统一在 build\src\win-x64\publish\gateway 目录维护 +1. 执行: `build\src\win-x64\build.cmd` +2. 上传: `build\dist\win-x64\publish` 目录到服务器 +3. 修改配置,执行 publish 目录下的 start.cmd diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/EosAgentModule.cs b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/EosAgentModule.cs index 86d84862a..43fc043db 100644 --- a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/EosAgentModule.cs +++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/EosAgentModule.cs @@ -166,7 +166,7 @@ public class EosAgentModule : AbpModule { context.AddBackgroundWorkerAsync(); - // context.AddBackgroundWorkerAsync(); + context.AddBackgroundWorkerAsync(); } } diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/Incoming/EosIncomingBackgroundWorker.cs b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/Incoming/EosIncomingBackgroundWorker.cs index fb385c471..8b13c38dd 100644 --- a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/Incoming/EosIncomingBackgroundWorker.cs +++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/Incoming/EosIncomingBackgroundWorker.cs @@ -43,21 +43,21 @@ public class EosIncomingBackgroundWorker : AsyncPeriodicBackgroundWorkerBase //转换Plan await planConverter.ConvertAsync(plansFromExternalList).ConfigureAwait(false); - // Logger.LogInformation($"Read Ship"); - // var shipHandleService = workerContext.ServiceProvider.GetRequiredService(); - // var shipConverter = workerContext.ServiceProvider.GetRequiredService(); - // //读取并保持Ship - // var shipsFromExternalList = await shipHandleService.ReadAsync().ConfigureAwait(false); - // //转换Ship - // await shipConverter.ConvertAsync(shipsFromExternalList).ConfigureAwait(false); + Logger.LogInformation($"Read Ship"); + var shipHandleService = workerContext.ServiceProvider.GetRequiredService(); + var shipConverter = workerContext.ServiceProvider.GetRequiredService(); + //读取并保持Ship + var shipsFromExternalList = await shipHandleService.ReadAsync().ConfigureAwait(false); + //转换Ship + await shipConverter.ConvertAsync(shipsFromExternalList).ConfigureAwait(false); - // Logger.LogInformation($"Read Product"); - // var productHandleService = workerContext.ServiceProvider.GetRequiredService(); - // var productConverter = workerContext.ServiceProvider.GetRequiredService(); - // //读取并保持Product - // var productsFromExternalList = await productHandleService.ReadAsync().ConfigureAwait(false); - //// 转换Product - // await productConverter.ConvertAsync(productsFromExternalList).ConfigureAwait(false); + Logger.LogInformation($"Read Product"); + var productHandleService = workerContext.ServiceProvider.GetRequiredService(); + var productConverter = workerContext.ServiceProvider.GetRequiredService(); + //读取并保持Product + var productsFromExternalList = await productHandleService.ReadAsync().ConfigureAwait(false); + // 转换Product + await productConverter.ConvertAsync(productsFromExternalList).ConfigureAwait(false); Logger.LogInformation($"Completed: Handling {Incoming}"); } diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/Incoming/ShipConverter.cs b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/Incoming/ShipConverter.cs index 433898ac7..599879719 100644 --- a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/Incoming/ShipConverter.cs +++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/Incoming/ShipConverter.cs @@ -55,13 +55,13 @@ public class ShipConverter : IIncomingConverter var supplierAsnList = await BuildIncomingToWmsOfSupplierAsnAsync(incomingFromExternalList).ConfigureAwait(false); await _incomingToWmsManager.CreateManyAsync(supplierAsnList).ConfigureAwait(false); - var purchaseLabelList = BuildIncomingToWmsOfPurchaseLabelAsync(incomingFromExternalList); + var purchaseLabelList = await BuildIncomingToWmsOfPurchaseLabelAsync(incomingFromExternalList).ConfigureAwait(false); await _incomingToWmsManager.CreateManyAsync(purchaseLabelList).ConfigureAwait(false); //归档 await _incomingFromExternalManager.ArchiveManyAsync(incomingFromExternalList).ConfigureAwait(false); } - private List BuildIncomingToWmsOfPurchaseLabelAsync(List incomingFromExternalList) + private async Task> BuildIncomingToWmsOfPurchaseLabelAsync(List incomingFromExternalList) { var incomingToWmsList = new List(); @@ -76,7 +76,7 @@ public class ShipConverter : IIncomingConverter }; incomingToWms.SetEffectiveDate(incomingFromExternal.EffectiveDate); var exchangeAsn = JsonSerializer.Deserialize(incomingFromExternal.DestinationDataContent); - var purchaseLabel = BuildPurchaseLabelCreateDto(exchangeAsn); + var purchaseLabel = await BuildPurchaseLabelCreateDto(exchangeAsn).ConfigureAwait(false); incomingToWms.DataContent = JsonSerializer.Serialize(purchaseLabel); incomingToWmsList.Add(incomingToWms); @@ -85,11 +85,23 @@ public class ShipConverter : IIncomingConverter return incomingToWmsList; } - private InventoryLabelEditInput BuildPurchaseLabelCreateDto(SupplierAsnExchangeDto exchangeAsn) + private async Task BuildPurchaseLabelCreateDto(SupplierAsnExchangeDto exchangeAsn) { var purchaseLabel = _objectMapper.Map(exchangeAsn.Detail); purchaseLabel.AsnNumber = exchangeAsn.Number; purchaseLabel.RpNumber = ""; + var item = await _itemBasicAppService.GetByCodeAsync(purchaseLabel.ItemCode).ConfigureAwait(false); + if (item != null) + { + purchaseLabel.ItemName = item.Name; + purchaseLabel.ItemDesc1 = item.Desc1; + + } + else + { + purchaseLabel.ItemName = ""; + purchaseLabel.ItemDesc1 = ""; + } return purchaseLabel; } diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/Outgoing/ArriveConverter.cs b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/Outgoing/ArriveConverter.cs index 791c8ae4f..f66228193 100644 --- a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/Outgoing/ArriveConverter.cs +++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/Outgoing/ArriveConverter.cs @@ -6,7 +6,7 @@ using Volo.Abp.ObjectMapping; using Win_in.Sfs.Wms.DataExchange.Domain; using Win_in.Sfs.Wms.DataExchange.Domain.Fawtyg.EOS; using Win_in.Sfs.Wms.DataExchange.Domain.Shared; -using Win_in.Sfs.Wms.DataExchange.WMS.PurchaseReceipt; +using Win_in.Sfs.Wms.DataExchange.WMS.PutawayNote; using Win_in.Sfs.Wms.Store.Application.Contracts; namespace Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent; @@ -18,6 +18,7 @@ public class ArriveConverter : IOutgoingConverter private readonly ISupplierAsnAppService _supplierAsnAppService; private readonly IObjectMapper _objectMapper; + public ArriveConverter( IOutgoingFromWmsManager outgoingFromWmsManager , IOutgoingToExternalManager outgoingToExternalManager @@ -35,11 +36,11 @@ public class ArriveConverter : IOutgoingConverter { var outgoingToExternalList = new List(); - var outgoingFromWmsList = await _outgoingFromWmsManager.GetToBeProcessedListAsync(EnumOutgoingDataType.PurchaseReceipt, EnumSystemType.EOS).ConfigureAwait(false); + var outgoingFromWmsList = await _outgoingFromWmsManager.GetToBeProcessedListAsync(EnumOutgoingDataType.Putaway, EnumSystemType.EOS).ConfigureAwait(false); foreach (var outgoingFromWms in outgoingFromWmsList) { - var wmsReceipt = JsonSerializer.Deserialize(outgoingFromWms.DataContent); + var wmsReceipt = JsonSerializer.Deserialize(outgoingFromWms.DataContent); foreach (var detail in wmsReceipt.Details) { var outgoingToExternal = new OutgoingToExternal() @@ -49,14 +50,14 @@ public class ArriveConverter : IOutgoingConverter SourceSystem = EnumSystemType.WMS.ToString(), SourceDataId = detail.Id.ToString(), SourceDataGroupCode = wmsReceipt.Number, - SourceDataDetailCode = detail.PackingCode, + SourceDataDetailCode = detail.ToPackingCode, Writer = nameof(EosOutgoingBackgroundWorker), - DestinationSystem = EnumSystemType.SCP.ToString(), + DestinationSystem = EnumSystemType.EOS.ToString(), DestinationDataId = "", }; outgoingToExternal.SetEffectiveDate(outgoingFromWms.EffectiveDate); - var exchangeReceipt = await BuildPurchaseReceiptExchangeDtoAsync(wmsReceipt, detail).ConfigureAwait(false); + var exchangeReceipt = await BuildPutawayExchangeDtoAsync(wmsReceipt, detail).ConfigureAwait(false); outgoingToExternal.SourceDataContent = JsonSerializer.Serialize(exchangeReceipt); var arrive = BuildArrive(exchangeReceipt); outgoingToExternal.DestinationDataContent = JsonSerializer.Serialize(arrive); @@ -71,25 +72,30 @@ public class ArriveConverter : IOutgoingConverter return outgoingToExternalList; } - private static ArriveNote BuildArrive(PurchaseReceiptNoteExchangeDto exchangeReceipt) + private ArriveNote BuildArrive(PutawayNoteExchangeDto exchangeReceipt) { var detail = exchangeReceipt.Detail; + var nulltime = Convert.ToDateTime("0001/01/01 00:00:00"); + if (detail.ShipDate == nulltime) + { + detail.ShipDate = null; + } var arrive = new ArriveNote() { - PlanBillNo = exchangeReceipt.PoNumber, - ShipBillNo = exchangeReceipt.AsnNumber, + PlanBillNo = detail.PoNumber, + ShipBillNo = detail.AsnNumber, DocNo = exchangeReceipt.Number, - DetailMatNo = detail.PackingCode, + DetailMatNo = detail.ToPackingCode, ERP = detail.ItemCode, - Qty = detail.Qty, + Qty = detail.ShippedQty, HgQty = detail.Qty, ProductDate = detail.ProduceDate, - ProductBatch = detail.Lot, - Loc = detail.LocationErpCode, - ShipDate = exchangeReceipt.ShipDate, + ProductBatch = detail.ToLot, + Loc = detail.ToLocationErpCode, + ShipDate = detail.ShipDate, ShipBillState = 0, - SupplierCode = exchangeReceipt.SupplierCode, - PlanUserCode = exchangeReceipt.ContactName, + SupplierCode = detail.SupplierCode, + PlanUserCode = detail.PlanUserCode,//筹措员 EosState = 0, // EosDate = DateTime.MinValue, WmsDate = DateTime.Now, @@ -98,14 +104,11 @@ public class ArriveConverter : IOutgoingConverter return arrive; } - private async Task BuildPurchaseReceiptExchangeDtoAsync(PurchaseReceiptNoteDTO wmsReceipt, PurchaseReceiptNoteDetailDTO wmsReceiptDetail) + private Task BuildPutawayExchangeDtoAsync(PutawayNoteDTO wmsReceipt, PutawayNoteDetailDTO wmsReceiptDetail) { - var exchangeReceipt = _objectMapper.Map(wmsReceipt); - var exchangeReceiptDetail = _objectMapper.Map(wmsReceiptDetail); - var asn = await _supplierAsnAppService.GetByNumberAsync(exchangeReceipt.AsnNumber).ConfigureAwait(false); - exchangeReceipt.ShipDate = asn?.ShipDate; - exchangeReceipt.ContactName = asn == null ? "" : asn.ContactName; + var exchangeReceipt = _objectMapper.Map(wmsReceipt); + var exchangeReceiptDetail = _objectMapper.Map(wmsReceiptDetail); exchangeReceipt.Detail = exchangeReceiptDetail; - return exchangeReceipt; + return Task.FromResult(exchangeReceipt); } } diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/appsettings.json b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/appsettings.json index 83cadac0a..87fb22fe9 100644 --- a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/appsettings.json +++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/appsettings.json @@ -1,12 +1,12 @@ { "ConnectionStrings": { - "Default": "Server=dev.ccwin-in.com,21195;Database=DataExchange_Main;uid=sa;pwd=aA123456!;TrustServerCertificate=True", - "DataExchange": "Server=dev.ccwin-in.com,21195;Database=DataExchange_Main;uid=sa;pwd=aA123456!;TrustServerCertificate=True", - "EOS": "Server=61.139.155.47;Database=EOSCC;Uid=wms;Pwd=1;TrustServerCertificate=True" + "Default": "Server=10.164.113.32,1818\\SHDB;Database=Wms_Dy_ShangHai;uid=ShWmsUser;pwd=Faty@Wms_20230413#SH;TrustServerCertificate=True", + "DataExchange": "Server=10.164.113.32,1818\\SHDB;Database=DataExchange_Main;uid=ShWmsUser;pwd=Faty@Wms_20230413#SH;TrustServerCertificate=True", + "EOS": "Server=61.139.155.47;Database=EOSSH;Uid=wms;Pwd=1;TrustServerCertificate=True" }, "AuthServer": { - "Authority": "http://dev.ccwin-in.com:21293/", + "Authority": "http://10.164.113.31:60083/", "RequireHttpsMetadata": "false", "SwaggerClientId": "admin", "SwaggerClientSecret": "1q2w3E*", @@ -25,13 +25,13 @@ "RemoteServices": { "BaseData": { - "BaseUrl": "http://dev.ccwin-in.com:21294/" + "BaseUrl": "http://10.164.113.31:60084/" }, "Store": { - "BaseUrl": "http://dev.ccwin-in.com:21295/" + "BaseUrl": "http://10.164.113.31:60085/" }, "Label": { - "BaseUrl": "http://dev.ccwin-in.com:21292/" + "BaseUrl": "http://10.164.113.31:60082/" } }, "EosOptions": { diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent/Incoming/BackFluReader.cs b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent/Incoming/BackFluReader.cs index 15064ea0d..65ab98fdc 100644 --- a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent/Incoming/BackFluReader.cs +++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent/Incoming/BackFluReader.cs @@ -58,7 +58,7 @@ public class BackFluReader : IReader try { var bm = BuildScrapNoteOrderExchangeMes(backflu); - incomingData.DestinationDataContent = JsonSerializer.Serialize(backflu); + incomingData.DestinationDataContent = JsonSerializer.Serialize(bm); } catch (Exception ex) { @@ -94,7 +94,7 @@ public class BackFluReader : IReader var back = new BackFlushNoteExchangeDto() { - ActiveDate = Convert.ToDateTime(backflu.scmout_dt_w.Substring(0, 4) + "-" + backflu.scmout_dt_w.Substring(4, 2) + "-" + backflu.scmout_dt_w.Substring(6, 2)), + ActiveDate = DateTime.ParseExact(backflu.scmout_dt_w, "yyyyMMdd", System.Globalization.CultureInfo.CurrentCulture), ItemCode = backflu.scmout_part, Number = backflu.scmout_nbr }; diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent/appsettings.json b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent/appsettings.json index 2ea101bee..16f13d97c 100644 --- a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent/appsettings.json +++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent/appsettings.json @@ -1,12 +1,12 @@ { "ConnectionStrings": { - "Default": "Server=dev.ccwin-in.com,21195;Database= WMS;uid=sa;pwd=aA123456!;TrustServerCertificate=True;", - "DataExchange": "Server=dev.ccwin-in.com,21195;Database=DataExchange_Main;uid=sa;pwd=aA123456!;TrustServerCertificate=True;", - "MES": "Server=10.164.1.12;Port=3306;Database=erp;Uid=wms;Pwd=123456;" + "Default": "Server=10.164.113.32,1818\\SHDB;Database=Wms_Dy_ShangHai;uid=ShWmsUser;pwd=Faty@Wms_20230413#SH;TrustServerCertificate=True", + "DataExchange": "Server=10.164.113.32,1818\\SHDB;Database=DataExchange_Main;uid=ShWmsUser;pwd=Faty@Wms_20230413#SH;TrustServerCertificate=True", + "MES": "Server=10.164.113.32,1818\\SHDB;Database=MES_SH;uid=ShWmsUser;pwd=Faty@Wms_20230413#SH;TrustServerCertificate=True" }, "AuthServer": { - "Authority": "http://dev.ccwin-in.com:21293/", + "Authority": "http://dev.ccwin-in.com:60083/", "RequireHttpsMetadata": "false", "SwaggerClientId": "admin", "SwaggerClientSecret": "1q2w3E*", @@ -24,14 +24,15 @@ "RemoteServices": { "BaseData": { - "BaseUrl": "http://dev.ccwin-in.com:21294/" + "BaseUrl": "http://dev.ccwin-in.com:60084/" }, "Store": { - "BaseUrl": "http://dev.ccwin-in.com:21295/" + "BaseUrl": "http://dev.ccwin-in.com:60085/" }, "Label": { - "BaseUrl": "http://dev.ccwin-in.com:21292/" + "BaseUrl": "http://dev.ccwin-in.com:60082/" } + }, "MesOptions": { "IncomingOptions": { diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/FawtygAutoMapperProfile.cs b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/FawtygAutoMapperProfile.cs index 0a7c85483..f8ba7366d 100644 --- a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/FawtygAutoMapperProfile.cs +++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/FawtygAutoMapperProfile.cs @@ -14,13 +14,16 @@ using Win_in.Sfs.Wms.DataExchange.WMS.Deparment; using Win_in.Sfs.Wms.DataExchange.WMS.Dict; using Win_in.Sfs.Wms.DataExchange.WMS.InterfaceCalendar; using Win_in.Sfs.Wms.DataExchange.WMS.ItemBasic; +using Win_in.Sfs.Wms.DataExchange.WMS.ItemTransformNote; using Win_in.Sfs.Wms.DataExchange.WMS.PCK; using Win_in.Sfs.Wms.DataExchange.WMS.ProductionReturnNote; using Win_in.Sfs.Wms.DataExchange.WMS.ProductReceiptNote; +using Win_in.Sfs.Wms.DataExchange.WMS.ProductRecycleNote; using Win_in.Sfs.Wms.DataExchange.WMS.PurchaseOrder; using Win_in.Sfs.Wms.DataExchange.WMS.PurchaseReturn; using Win_in.Sfs.Wms.DataExchange.WMS.PutawayNote; using Win_in.Sfs.Wms.DataExchange.WMS.RecycledMaterialReceiptNote; +using Win_in.Sfs.Wms.DataExchange.WMS.ScrapNote; using Win_in.Sfs.Wms.DataExchange.WMS.Supplier; using Win_in.Sfs.Wms.DataExchange.WMS.TransferNote; using Win_in.Sfs.Wms.DataExchange.WMS.UnplannedIssueNote; @@ -34,6 +37,12 @@ public class FawtygAutoMapperProfile : Profile { public FawtygAutoMapperProfile() { + CreateMap(); + CreateMap(); + CreateMap(); + CreateMap(); + + CreateMap(); CreateMap() .Ignore(x => x.Items); @@ -45,6 +54,9 @@ public class FawtygAutoMapperProfile : Profile CreateMap(); CreateMap(); + CreateMap(); + CreateMap(); + CreateMap(); CreateMap(); @@ -85,16 +97,25 @@ public class FawtygAutoMapperProfile : Profile .Ignore(x => x.Detail); CreateMap(); - CreateMap(); - CreateMap(); - CreateMap(); CreateMap(); + CreateMap(); + CreateMap(); + CreateMap(); + CreateMap(); CreateMap(); CreateMap(); CreateMap(); CreateMap(); CreateMap(); CreateMap(); + + CreateMap() + .Ignore(x => x.Details) + .Ignore(x => x.MaterialDetails); + CreateMap(); + CreateMap(); + CreateMap(); + CreateMap(); } } diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Incoming/BackFluReader.cs b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Incoming/BackFluReader.cs index a8676a368..f3f502241 100644 --- a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Incoming/BackFluReader.cs +++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Incoming/BackFluReader.cs @@ -93,8 +93,8 @@ public class BackFluReader : IReader var back = new BackFlushNoteExchangeDto() { - - ActiveDate = Convert.ToDateTime(backflu.scmout_dt_w.Substring(0, 4) + "-" + backflu.scmout_dt_w.Substring(4, 2) + "-" + backflu.scmout_dt_w.Substring(6, 2)), + ActiveDate = DateTime.ParseExact(backflu.scmout_dt_w, "yyyyMMdd", System.Globalization.CultureInfo.CurrentCulture), + // ActiveDate = Convert.ToDateTime(backflu.scmout_dt_w.Substring(0, 4) + "-" + backflu.scmout_dt_w.Substring(4, 2) + "-" + backflu.scmout_dt_w.Substring(6, 2)), ItemCode = backflu.scmout_part, Number = backflu.scmout_nbr }; diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Incoming/TyrpIncomingBackgroundWorker.cs b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Incoming/TyrpIncomingBackgroundWorker.cs index f2b44243d..3e8197b79 100644 --- a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Incoming/TyrpIncomingBackgroundWorker.cs +++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Incoming/TyrpIncomingBackgroundWorker.cs @@ -59,13 +59,13 @@ public class TyrpIncomingBackgroundWorker : AsyncPeriodicBackgroundWorkerBase common.updatedt = DateTime.Now; common.isupdate = false; - //Logger.LogInformation($"Read ItemBasic");//零件 - //var itemBasicReader = workerContext.ServiceProvider.GetRequiredService(); - //var itemBasicConverter = workerContext.ServiceProvider.GetRequiredService(); - ////读取并保存itemBasic - //var itemBasicOutsFromExternalList = await itemBasicReader.ReadAsync().ConfigureAwait(false); - ////转换itemBasic - //await itemBasicConverter.ConvertAsync(itemBasicOutsFromExternalList).ConfigureAwait(false); + Logger.LogInformation($"Read ItemBasic");//零件 + var itemBasicReader = workerContext.ServiceProvider.GetRequiredService(); + var itemBasicConverter = workerContext.ServiceProvider.GetRequiredService(); + //读取并保存itemBasic + var itemBasicOutsFromExternalList = await itemBasicReader.ReadAsync().ConfigureAwait(false); + //转换itemBasic + await itemBasicConverter.ConvertAsync(itemBasicOutsFromExternalList).ConfigureAwait(false); Logger.LogInformation($"Read User");//用户和部门 var userReader = workerContext.ServiceProvider.GetRequiredService(); @@ -96,13 +96,13 @@ public class TyrpIncomingBackgroundWorker : AsyncPeriodicBackgroundWorkerBase //转换Dict await dictConverter.ConvertAsync(dictOutsFromExternalList).ConfigureAwait(false); - //Logger.LogInformation($"Read Bom"); - //var BomReader = workerContext.ServiceProvider.GetRequiredService(); - //var BomConverter = workerContext.ServiceProvider.GetRequiredService(); - ////读取并保存Bom - //var bomsFromExternalList = await BomReader.ReadAsync().ConfigureAwait(false); - ////转换Bom - //await BomConverter.ConvertAsync(bomsFromExternalList).ConfigureAwait(false); + Logger.LogInformation($"Read Bom"); + var BomReader = workerContext.ServiceProvider.GetRequiredService(); + var BomConverter = workerContext.ServiceProvider.GetRequiredService(); + //读取并保存Bom + var bomsFromExternalList = await BomReader.ReadAsync().ConfigureAwait(false); + //转换Bom + await BomConverter.ConvertAsync(bomsFromExternalList).ConfigureAwait(false); Logger.LogInformation($"Read Supplier");//供应商 var SupplierReader = workerContext.ServiceProvider.GetRequiredService(); @@ -132,6 +132,7 @@ public class TyrpIncomingBackgroundWorker : AsyncPeriodicBackgroundWorkerBase common.isupdate = true; } } + //已经挪至MES接口,tyrp暂不启动这个接口20230424(上海东阳改) //Logger.LogInformation($"Read BackFlush");//耗用单 //var BackFlushReader = workerContext.ServiceProvider.GetRequiredService(); //var BackFlushConverter = workerContext.ServiceProvider.GetRequiredService(); diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Outgoing/CountAdjustNoteConverter.cs b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Outgoing/CountAdjustNoteConverter.cs index 705cf6919..af7d5d81d 100644 --- a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Outgoing/CountAdjustNoteConverter.cs +++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Outgoing/CountAdjustNoteConverter.cs @@ -44,80 +44,72 @@ public class CountAdjustNoteConverter : IOutgoingConverter foreach (var outgoingFromWms in outgoingFromWmsList) { var wmsCountAdjust = JsonSerializer.Deserialize(outgoingFromWms.DataContent); - var department = await _departmentAppService.GetByUsernameAsync(wmsCountAdjust.Worker).ConfigureAwait(false); - var departmentCode = department == null ? "" : department.Code; - - var details = wmsCountAdjust.Details.GroupBy(r => new { r.ItemCode, r.LocationErpCode }).Select(p => new CountAdjustNoteDetailExchangeDto { CountQty = p.Sum(itm => itm.CountQty), ItemCode = p.Key.ItemCode, LocationErpCode = p.Key.LocationErpCode, ReasonCode = String.Join("、", p.Select(x => x.ReasonCode).ToArray()) }); - foreach (var detail in details.Where(r => r.CountQty == 0)) - { - var outgoingToExternal = new OutgoingToExternal() + + var department = await _departmentAppService.GetByUsernameAsync(wmsCountAdjust.Worker).ConfigureAwait(false); + var departmentCode = department == null ? "" : department.Code; + var details = wmsCountAdjust.Details.GroupBy(r => new { r.ItemCode, r.LocationErpCode }).Select(p => new CountAdjustNoteDetailExchangeDto { CountQty = p.Sum(itm => itm.CountQty), InventoryQty = p.Sum(itm => itm.InventoryQty), ItemCode = p.Key.ItemCode, LocationErpCode = p.Key.LocationErpCode, ReasonCode = String.Join("、", p.Select(x => x.ReasonCode).ToArray()) }); + var detal = details.ToList(); + foreach (var detail in detal) { - DataType = outgoingFromWms.DataType, - DataAction = outgoingFromWms.DataAction, - SourceSystem = EnumSystemType.WMS.ToString(), - SourceDataId = wmsCountAdjust.Number, - SourceDataGroupCode = wmsCountAdjust.Number, - SourceDataDetailCode = detail.ItemCode, - Writer = nameof(TyrpOutgoingBackgroundWorker), - DestinationSystem = EnumSystemType.ERP.ToString(), - DestinationDataId = "", - }; - outgoingToExternal.SetEffectiveDate(outgoingFromWms.EffectiveDate); - - var exchangeIssue = await BuildPurchaseReceiptExchangeDtoAsync(wmsCountAdjust, detail).ConfigureAwait(false); - outgoingToExternal.SourceDataContent = JsonSerializer.Serialize(exchangeIssue); - var arrive = BuildIssue(exchangeIssue, departmentCode); - outgoingToExternal.DestinationDataContent = JsonSerializer.Serialize(arrive); + //判断盘点数与库存数是否相等 + if (detail.CountQty != detail.InventoryQty) + { + var outgoingToExternal = new OutgoingToExternal() + { + DataType = outgoingFromWms.DataType, + DataAction = outgoingFromWms.DataAction, + SourceSystem = EnumSystemType.WMS.ToString(), + SourceDataId = wmsCountAdjust.Number, + SourceDataGroupCode = wmsCountAdjust.Number, + SourceDataDetailCode = details.FirstOrDefault().ItemCode, + Writer = nameof(TyrpOutgoingBackgroundWorker), + DestinationSystem = EnumSystemType.ERP.ToString(), + DestinationDataId = "", + }; + outgoingToExternal.SetEffectiveDate(outgoingFromWms.EffectiveDate); + var exchangeIssue = await BuildPurchaseReceiptExchangeDtoAsync(wmsCountAdjust, detail).ConfigureAwait(false); + outgoingToExternal.SourceDataContent = JsonSerializer.Serialize(exchangeIssue); + var arrive = BuildIssue(exchangeIssue, departmentCode); + outgoingToExternal.DestinationDataContent = JsonSerializer.Serialize(arrive); - outgoingToExternalList.Add(outgoingToExternal); - } + outgoingToExternalList.Add(outgoingToExternal); + } + } + } - await _outgoingToExternalManager.CreateManyAsync(outgoingToExternalList).ConfigureAwait(false); + //将outgoingFromWms数据归档 + await _outgoingFromWmsManager.ArchiveManyAsync(outgoingFromWmsList).ConfigureAwait(false); return outgoingToExternalList; + //插入到中间表OutgoingToExternal } - private static CountAdjust BuildIssue(CountAdjustNoteExchangeDto exchangeCountAdjust, string departmentCode) + private CountAdjust BuildIssue(CountAdjustNoteExchangeDto exchangeCountAdjust, string departmentCode) { var detail = exchangeCountAdjust.Detail; - string time = DateTime.Now.ToLongTimeString(); - string time1 = DateTime.Now.ToShortDateString().Replace("/", "").Trim(); - string date = time1 + "" + time; - string asdtype = ""; - - if (Enum.Parse(exchangeCountAdjust.Type) == EnumTransSubType.CountAdjust_WIP) - { - asdtype = "4041"; - } - else if (Enum.Parse(exchangeCountAdjust.Type) == EnumTransSubType.CountAdjust_Warehouse) - { - asdtype = "4003"; - } var counta = new CountAdjust() { mesout_asd_refc = departmentCode, - mesout_asd_dt_w = date, - mesout_asd_type = asdtype, + mesout_asd_dt_w = DateTime.Now.ToString("yyyyMMdd HH:mm:ss"), + mesout_asd_type = "4003", mesout_asd_part = detail.ItemCode, - mesout_asd_date = exchangeCountAdjust.ActiveDate.ToShortDateString().Replace("/", "").Trim(), - mesout_asd_loc = detail.LocationErpCode, + mesout_asd_date = exchangeCountAdjust.ActiveDate.ToString("yyyyMMdd"), + mesout_asd_loc = string.Empty, mesout_asd_code = detail.ReasonCode, - mesout_asd_qty = detail.CountQty, + mesout_asd_qty = detail.CountQty + detail.InventoryQty, mesout_asd_user = exchangeCountAdjust.Worker, mesout_asd_k = string.Empty, mesout_asd_stat = "Y" }; + return counta; + } private async Task BuildPurchaseReceiptExchangeDtoAsync( CountAdjustNoteDTO wmsCountAdjust, CountAdjustNoteDetailExchangeDto wmsCountAdjustDetail) { - await Task.CompletedTask.ConfigureAwait(false); var exchangeCountAdjust = _objectMapper.Map(wmsCountAdjust); - //var exchangeCountAdjustDetail = - // _objectMapper.Map(wmsCountAdjustDetail); - //var userdep = await _supplierAsnAppService.GetByNumberAsync(exchangeCountAdjust.Worker); - //exchangeCountAdjust.DepartmentCode = userdep.DepartmentCode; + exchangeCountAdjust.Detail = wmsCountAdjustDetail; return exchangeCountAdjust; } diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Outgoing/IssueNoteConverter.cs b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Outgoing/IssueNoteConverter.cs index 785aedbce..dd628e54c 100644 --- a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Outgoing/IssueNoteConverter.cs +++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Outgoing/IssueNoteConverter.cs @@ -78,7 +78,7 @@ public class IssueNoteConverter : IOutgoingConverter outgoingDetailToExternal.SetEffectiveDate(outgoingFromWms.EffectiveDate); var exchangeReceiptDetail = _objectMapper.Map(detail); outgoingDetailToExternal.SourceDataContent = JsonSerializer.Serialize(exchangeReceiptDetail); - var putawayNoteDetail = BuildDataInterfaceDetail(exchangeReceipt, exchangeReceiptDetail); + var putawayNoteDetail = BuildDataInterfaceDetail(exchangeReceipt, exchangeReceiptDetail, putawayNote.scontrol_dt_w); outgoingDetailToExternal.DestinationDataContent = JsonSerializer.Serialize(putawayNoteDetail); outgoingToExternalList.Add(outgoingDetailToExternal); } @@ -115,12 +115,12 @@ public class IssueNoteConverter : IOutgoingConverter /// /// /// - private Scmsend BuildDataInterfaceDetail(IssueNoteExchangeDto exchangeOrder, IssueNoteDetailExchangeDto exchangeDetailOrder) + private Scmsend BuildDataInterfaceDetail(IssueNoteExchangeDto exchangeOrder, IssueNoteDetailExchangeDto exchangeDetailOrder, string dt_w) { var ret = new Scmsend() { scmsend_type = billtype, - scmsend_dt_w = DateTime.Now.ToString("yyyyMMdd HH:mm:ss"), + scmsend_dt_w = dt_w, scmsend_nbr = exchangeOrder.Number, scmsend_stat1 = "1", scmsend_part = exchangeDetailOrder.ItemCode, @@ -130,7 +130,7 @@ public class IssueNoteConverter : IOutgoingConverter scmsend_date = exchangeOrder.ActiveDate.ToString("yyyyMMdd"), scmsend_qty = exchangeDetailOrder.Qty, scmsend_wipd_loc = exchangeDetailOrder.ToLocationErpCode, - scmsend_userid = exchangeOrder.Worker + scmsend_userid = string.IsNullOrEmpty(exchangeOrder.Worker) ? "" : exchangeOrder.Worker.Length>6?(exchangeOrder.Worker).Substring(0, 6): exchangeOrder.Worker }; return ret; } diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Outgoing/ItemTransformNoteConverter.cs b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Outgoing/ItemTransformNoteConverter.cs index 8e25bb6a7..bae2a8231 100644 --- a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Outgoing/ItemTransformNoteConverter.cs +++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Outgoing/ItemTransformNoteConverter.cs @@ -46,7 +46,7 @@ namespace Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent.Outgoing; var wmsCountAdjust = JsonSerializer.Deserialize(outgoingFromWms.DataContent); if (Enum.Parse(wmsCountAdjust.Type) == EnumTransSubType.Item_Transform) { - var department = await _departmentAppService.GetByUsernameAsync(wmsCountAdjust.Worker).ConfigureAwait(false); + var department =await _departmentAppService.GetByUsernameAsync(wmsCountAdjust.Worker).ConfigureAwait(false); var departmentCode = department == null ? "" : department.Code; var details = wmsCountAdjust.Details.GroupBy(r => new { r.ItemCode, r.ToItemCode, r.LocationErpCode, r.ToLocationCode }).Select(p => new ItemTransformNoteDetailExchangeDto { ToQty = p.Sum(itm => itm.ToQty), FromQty = p.Sum(itm => itm.FromQty), ItemCode = p.Key.ItemCode, ToItemCode = p.Key.ToItemCode, LocationErpCode = p.Key.LocationErpCode, ReasonCode = String.Join("、", p.Select(x => x.ReasonCode).ToArray()) }); foreach (var detail in details) @@ -100,16 +100,11 @@ namespace Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent.Outgoing; private CountAdjust BuildIssue(ItemTransformNoteExchangeDto exchangeCountAdjust, string departmentCode) { var detail = exchangeCountAdjust.Detail; - string asdtype = ""; - if (Enum.Parse(exchangeCountAdjust.Type) == EnumTransSubType.Item_Transform) - { - asdtype = "4003"; - } var counta = new CountAdjust() { mesout_asd_refc = departmentCode, mesout_asd_dt_w = DateTime.Now.ToString("yyyyMMdd HH:mm:ss"), - mesout_asd_type = asdtype, + mesout_asd_type = "4003", mesout_asd_part = detail.ItemCode, mesout_asd_date = exchangeCountAdjust.ActiveDate.ToString("yyyyMMdd"), mesout_asd_loc = detail.LocationErpCode, diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Outgoing/ProductReceiptNoteConverter.cs b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Outgoing/ProductReceiptNoteConverter.cs index 88aa3f294..9bd4316d2 100644 --- a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Outgoing/ProductReceiptNoteConverter.cs +++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Outgoing/ProductReceiptNoteConverter.cs @@ -27,6 +27,8 @@ public class ProductReceiptNoteConverter : IOutgoingConverter _objectMapper = objectMapper; } + + public virtual async Task> ConvertAsync() { var outgoingToExternalList = new List(); @@ -67,21 +69,21 @@ public class ProductReceiptNoteConverter : IOutgoingConverter return outgoingToExternalList; } - private static ProductReceiptNote BuildProductReceiptNote(ProductReceiptNoteExchangeDto exchangeProductReceiptNote) + private ProductReceiptNote BuildProductReceiptNote(ProductReceiptNoteExchangeDto exchangeProductReceiptNote) { var detail = exchangeProductReceiptNote.Detail; var ret = new ProductReceiptNote() { mesout_ref_nbr = exchangeProductReceiptNote.Number, - mesout_id = detail.RawLocationCode, - mesout_part = detail.ItemCode, + mesout_id = string.IsNullOrEmpty(detail.RawLocationCode)?"": detail.RawLocationCode, + mesout_patr = detail.ItemCode, mesout_date = exchangeProductReceiptNote.ActiveDate.ToString("yyyyMMdd"), mesout_bad = detail.ReturnQty, mesout_move = detail.ReturnQty != 0 ? 0 : detail.Qty, mesout_unable = 0, mesout_loc = detail.LocationErpCode, mesout_dt = exchangeProductReceiptNote.ActiveDate.ToString("yyyyMMdd"), - memo = detail.Remark, + memo = string.IsNullOrEmpty(detail.Remark)?"": detail.Remark, refno = "", }; @@ -90,7 +92,6 @@ public class ProductReceiptNoteConverter : IOutgoingConverter private async Task BuildProductReceiptNoteExchangeDtoAsync(ProductReceiptNoteDTO wmsReceipt, ProductReceiptNoteDetailDTO wmsReceiptDetail) { - await Task.CompletedTask.ConfigureAwait(false); var exchangeReceipt = _objectMapper.Map(wmsReceipt); var exchangeReceiptDetail = _objectMapper.Map(wmsReceiptDetail); exchangeReceipt.Detail = exchangeReceiptDetail; diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Outgoing/ProductRecycleNoteConverter.cs b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Outgoing/ProductRecycleNoteConverter.cs index 18069fd9e..778dad2a5 100644 --- a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Outgoing/ProductRecycleNoteConverter.cs +++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Outgoing/ProductRecycleNoteConverter.cs @@ -87,7 +87,7 @@ public class ProductRecycleNoteConverter : IOutgoingConverter DataAction = outgoingFromWms.DataAction, SourceSystem = EnumSystemType.WMS.ToString(), SourceDataId = materialDetail.Id.ToString(), - SourceDataGroupCode = detail.ItemCode, + SourceDataGroupCode = wmsReceipt.Number, SourceDataDetailCode = materialDetail.ItemCode, Writer = nameof(TyrpOutgoingBackgroundWorker), DestinationSystem = EnumSystemType.ERP.ToString(), @@ -134,7 +134,7 @@ public class ProductRecycleNoteConverter : IOutgoingConverter wmsoutm_stock_stat = "", wmsoutm_open_part = exchangeOrder.ItemCode, wmsoutm_open_loc = exchangeOrder.LocationErpCode, - wmsoutm_open_hours = 0, + wmsoutm_open_hours = 1,//无法取到转移工时 目前默认为1 wmsoutm_tyrp_k = "", wmsoutm_id = 0,//明细中最大scmsend_id wmsoutm_open_qt = exchangeOrderDetail.Qty, @@ -147,7 +147,7 @@ public class ProductRecycleNoteConverter : IOutgoingConverter /// /// /// - private static Wmsoutd BuildDataInterfaceDetail(ProductRecycleNoteExchangeDto exchangeOrder, ProductRecycleMaterialDetailExchangeDto exchangeDetailOrder) + private Wmsoutd BuildDataInterfaceDetail(ProductRecycleNoteExchangeDto exchangeOrder, ProductRecycleMaterialDetailExchangeDto exchangeDetailOrder) { var ret = new Wmsoutd() { diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Outgoing/ProductionReturnNoteConverter.cs b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Outgoing/ProductionReturnNoteConverter.cs index 2711e5c5d..ddbc84b36 100644 --- a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Outgoing/ProductionReturnNoteConverter.cs +++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Outgoing/ProductionReturnNoteConverter.cs @@ -77,7 +77,7 @@ public class ProductionReturnNoteConverter : IOutgoingConverter outgoingDetailToExternal.SetEffectiveDate(outgoingFromWms.EffectiveDate); var exchangeReceiptDetail = _objectMapper.Map(detail); outgoingDetailToExternal.SourceDataContent = JsonSerializer.Serialize(exchangeReceiptDetail); - var putawayNoteDetail = BuildDataInterfaceDetail(exchangeReceipt, exchangeReceiptDetail); + var putawayNoteDetail = BuildDataInterfaceDetail(exchangeReceipt, exchangeReceiptDetail, putawayNote.scontrol_dt_w); outgoingDetailToExternal.DestinationDataContent = JsonSerializer.Serialize(putawayNoteDetail); outgoingToExternalList.Add(outgoingDetailToExternal); } @@ -114,12 +114,12 @@ public class ProductionReturnNoteConverter : IOutgoingConverter /// /// /// - private Scmsend BuildDataInterfaceDetail(ProductionReturnNoteExchangeDto exchangeOrder, ProductionReturnNoteDetailExchangeDto exchangeDetailOrder) + private Scmsend BuildDataInterfaceDetail(ProductionReturnNoteExchangeDto exchangeOrder, ProductionReturnNoteDetailExchangeDto exchangeDetailOrder, string dt_w) { var ret = new Scmsend() { scmsend_type = billtype, - scmsend_dt_w = DateTime.Now.ToString("yyyyMMdd HH:mm:ss"), + scmsend_dt_w = dt_w, scmsend_nbr = exchangeOrder.Number, scmsend_stat1 = "2", scmsend_part = exchangeDetailOrder.ItemCode, @@ -129,7 +129,7 @@ public class ProductionReturnNoteConverter : IOutgoingConverter scmsend_date = exchangeOrder.ActiveDate.ToString("yyyyMMdd"), scmsend_qty = exchangeDetailOrder.Qty, scmsend_wipd_loc = exchangeDetailOrder.FromLocationErpCode, - scmsend_userid = exchangeOrder.Worker + scmsend_userid = string.IsNullOrEmpty(exchangeOrder.Worker) ? "" : exchangeOrder.Worker }; return ret; } diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Outgoing/PurchaseOrderConverter.cs b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Outgoing/PurchaseOrderConverter.cs index a24a2ebd6..8f4f6c1db 100644 --- a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Outgoing/PurchaseOrderConverter.cs +++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Outgoing/PurchaseOrderConverter.cs @@ -85,7 +85,7 @@ public class PurchaseOrderConverter : IOutgoingConverter outgoingDetailToExternal.SetEffectiveDate(outgoingFromWms.EffectiveDate); var exchangeReceiptDetail = _objectMapper.Map(detail); outgoingDetailToExternal.SourceDataContent = JsonSerializer.Serialize(exchangeReceiptDetail); - var purchaseOrderDetail = BuildDataInterfaceDetail(exchangeReceipt, exchangeReceiptDetail); + var purchaseOrderDetail = BuildDataInterfaceDetail(exchangeReceipt, exchangeReceiptDetail, purchaseOrder.scontrol_dt_w); outgoingDetailToExternal.DestinationDataContent = JsonSerializer.Serialize(purchaseOrderDetail); outgoingToExternalList.Add(outgoingDetailToExternal); } @@ -122,12 +122,12 @@ public class PurchaseOrderConverter : IOutgoingConverter /// /// /// - private Scmsend BuildDataInterfaceDetail(PurchaseOrderExchangeDto exchangeOrder, PurchaseOrderDetailExchangeDto exchangeDetailOrder) + private Scmsend BuildDataInterfaceDetail(PurchaseOrderExchangeDto exchangeOrder, PurchaseOrderDetailExchangeDto exchangeDetailOrder, string dt_w) { var ret = new Scmsend() { scmsend_type = billtype, - scmsend_dt_w = DateTime.Now.ToString("yyyyMMdd HH:mm:ss"), + scmsend_dt_w = dt_w, scmsend_nbr = exchangeOrder.Number, scmsend_stat1 = "3", scmsend_part = exchangeDetailOrder.ItemCode, @@ -137,7 +137,7 @@ public class PurchaseOrderConverter : IOutgoingConverter scmsend_date = exchangeOrder.OrderDate.ToString("yyyyMMdd"), scmsend_qty = exchangeDetailOrder.Qty, scmsend_wipd_loc = "", - scmsend_userid = exchangeOrder.ContactName + scmsend_userid = string.IsNullOrEmpty(exchangeOrder.ContactName) ? "" : exchangeOrder.ContactName }; return ret; } diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Outgoing/PurchaseReturnConverter.cs b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Outgoing/PurchaseReturnConverter.cs index 5e718b037..81c5c7571 100644 --- a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Outgoing/PurchaseReturnConverter.cs +++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Outgoing/PurchaseReturnConverter.cs @@ -82,7 +82,7 @@ public class PurchaseReturnConverter : IOutgoingConverter outgoingDetailToExternal.SetEffectiveDate(outgoingFromWms.EffectiveDate); var exchangeReceiptDetail = _objectMapper.Map(detail); outgoingDetailToExternal.SourceDataContent = JsonSerializer.Serialize(exchangeReceiptDetail); - var purchaseReturnDetail = BuildDataInterfaceDetail(exchangeReceipt, exchangeReceiptDetail); + var purchaseReturnDetail = BuildDataInterfaceDetail(exchangeReceipt, exchangeReceiptDetail, purchaseReturn.scontrol_dt_w); outgoingDetailToExternal.DestinationDataContent = JsonSerializer.Serialize(purchaseReturnDetail); outgoingToExternalList.Add(outgoingDetailToExternal); } @@ -119,14 +119,14 @@ public class PurchaseReturnConverter : IOutgoingConverter /// /// /// - private Scmsend BuildDataInterfaceDetail(PurchaseReturnNoteExchangeDto exchangeOrder, PurchaseReturnNoteDetailExchangeDto exchangeDetailOrder) + private Scmsend BuildDataInterfaceDetail(PurchaseReturnNoteExchangeDto exchangeOrder, PurchaseReturnNoteDetailExchangeDto exchangeDetailOrder, string dt_w) { var ret = new Scmsend() { scmsend_type = billtype, - scmsend_dt_w = DateTime.Now.ToString("yyyyMMdd HH:mm:ss"), + scmsend_dt_w = dt_w, scmsend_nbr = exchangeOrder.Number, - scmsend_stat1 = "0", + scmsend_stat1 = "4", scmsend_part = exchangeDetailOrder.ItemCode, scmsend_delv_date = "", scmsend_orderno = exchangeOrder.SupplierCode, @@ -134,7 +134,7 @@ public class PurchaseReturnConverter : IOutgoingConverter scmsend_date = exchangeOrder.ActiveDate.ToString("yyyyMMdd"), scmsend_qty = exchangeDetailOrder.Qty, scmsend_wipd_loc = "", - scmsend_userid = exchangeOrder.ContactName + scmsend_userid = string.IsNullOrEmpty(exchangeOrder.ContactName) ? "" : exchangeOrder.ContactName }; return ret; } diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Outgoing/PutawayNoteConverter.cs b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Outgoing/PutawayNoteConverter.cs index afa25d379..8e98d56a8 100644 --- a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Outgoing/PutawayNoteConverter.cs +++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Outgoing/PutawayNoteConverter.cs @@ -77,7 +77,7 @@ public class PutawayNoteConverter : IOutgoingConverter outgoingDetailToExternal.SetEffectiveDate(outgoingFromWms.EffectiveDate); var exchangeReceiptDetail = _objectMapper.Map(detail); outgoingDetailToExternal.SourceDataContent = JsonSerializer.Serialize(exchangeReceiptDetail); - var putawayNoteDetail = BuildDataInterfaceDetail(exchangeReceipt, exchangeReceiptDetail); + var putawayNoteDetail = BuildDataInterfaceDetail(exchangeReceipt, exchangeReceiptDetail, putawayNote.scontrol_dt_w); outgoingDetailToExternal.DestinationDataContent = JsonSerializer.Serialize(putawayNoteDetail); outgoingToExternalList.Add(outgoingDetailToExternal); } @@ -114,12 +114,12 @@ public class PutawayNoteConverter : IOutgoingConverter /// /// /// - private Scmsend BuildDataInterfaceDetail(PutawayNoteExchangeDto exchangeOrder, PutawayNoteDetailExchangeDto exchangeDetailOrder) + private Scmsend BuildDataInterfaceDetail(PutawayNoteExchangeDto exchangeOrder, PutawayNoteDetailExchangeDto exchangeDetailOrder, string dt_w) { var ret = new Scmsend() { scmsend_type = billtype, - scmsend_dt_w = DateTime.Now.ToString("yyyyMMdd HH:mm:ss"), + scmsend_dt_w = dt_w, scmsend_nbr = exchangeOrder.Number, scmsend_stat1 = "0", scmsend_part = exchangeDetailOrder.ItemCode, @@ -129,7 +129,7 @@ public class PutawayNoteConverter : IOutgoingConverter scmsend_date = exchangeOrder.ActiveDate.ToString("yyyyMMdd"), scmsend_qty = exchangeDetailOrder.Qty, scmsend_wipd_loc = "", - scmsend_userid = exchangeOrder.Worker + scmsend_userid = string.IsNullOrEmpty(exchangeOrder.Worker) ? "" : exchangeOrder.Worker }; return ret; } diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Outgoing/RecycledMaterialReceiptNoteConverter.cs b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Outgoing/RecycledMaterialReceiptNoteConverter.cs index 02d8514ad..dc64e2b06 100644 --- a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Outgoing/RecycledMaterialReceiptNoteConverter.cs +++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Outgoing/RecycledMaterialReceiptNoteConverter.cs @@ -138,7 +138,7 @@ public class RecycledMaterialReceiptNoteConverter : IOutgoingConverter /// /// /// - private static Wmsoutd BuildDataInterfaceDetail(RecycledMaterialReceiptNoteExchangeDto exchangeOrder, RecycledMaterialReceiptNoteDetailExchangeDto exchangeDetailOrder) + private Wmsoutd BuildDataInterfaceDetail(RecycledMaterialReceiptNoteExchangeDto exchangeOrder, RecycledMaterialReceiptNoteDetailExchangeDto exchangeDetailOrder) { var ret = new Wmsoutd() { diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Outgoing/ScontrolWriter.cs b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Outgoing/ScontrolWriter.cs index 6ed8f0f61..d843ae8c3 100644 --- a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Outgoing/ScontrolWriter.cs +++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Outgoing/ScontrolWriter.cs @@ -41,14 +41,24 @@ public class ScontrolWriter : IWriter var receipt = JsonSerializer.Deserialize(entity.DestinationDataContent); dataInterfaceList.Add(receipt); } - else if (entity.TableType == EnumExchangeTableType.DetailTable) // 子表(DetailTable) + else if (entity.TableType == EnumExchangeTableType.DetailTable) // 子表(DetailTable) { var receiptDetail = JsonSerializer.Deserialize(entity.DestinationDataContent); dataInterfaceDetailList.Add(receiptDetail); } } - //dataInterface分主子表分别写入ERP - await _dataInterfaceManager.PostListAsync(dataInterfaceList, dataInterfaceDetailList).ConfigureAwait(false); + try + { + //dataInterface分主子表分别写入ERP + await _dataInterfaceManager.PostListAsync(dataInterfaceList, dataInterfaceDetailList).ConfigureAwait(false); + } + catch (System.Exception ex) + { + foreach (var item in entitys) + { + item.SetError(EnumExchangeDataErrorCode.Exception, ex.Message, ex.ToString()); + } + } } //将数据归档 await _outgoingToExternalManager.ArchiveManyAsync(outgoingDataList).ConfigureAwait(false); diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Outgoing/ScrapNoteConVerter.cs b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Outgoing/ScrapNoteConVerter.cs index 486fecdc3..8a4bb37f9 100644 --- a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Outgoing/ScrapNoteConVerter.cs +++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Outgoing/ScrapNoteConVerter.cs @@ -38,8 +38,7 @@ IOutgoingFromWmsManager outgoingFromWmsManager public virtual async Task> ConvertAsync() { var outgoingToExternalList = new List(); - var outgoingFromWmsList = - await _outgoingFromWmsManager.GetToBeProcessedListAsync(EnumOutgoingDataType.UnplannedIssue, EnumSystemType.ERP).ConfigureAwait(false); + var outgoingFromWmsList = await _outgoingFromWmsManager.GetToBeProcessedListAsync(EnumOutgoingDataType.Scrap, EnumSystemType.ERP).ConfigureAwait(false); foreach (var outgoingFromWms in outgoingFromWmsList) { var wmsCountAdjust = JsonSerializer.Deserialize(outgoingFromWms.DataContent); @@ -69,36 +68,40 @@ IOutgoingFromWmsManager outgoingFromWmsManager outgoingToExternalList.Add(outgoingToExternal); } } - await _outgoingToExternalManager.CreateManyAsync(outgoingToExternalList).ConfigureAwait(false); + //将outgoingFromWms数据归档 + await _outgoingFromWmsManager.ArchiveManyAsync(outgoingFromWmsList).ConfigureAwait(false); return outgoingToExternalList; } - private static CountAdjust BuildIssue(ScrapNoteExchangeDto exchangeScrap, string departmentCode) + private CountAdjust BuildIssue(ScrapNoteExchangeDto exchangeScrap, string departmentCode) { var detail = exchangeScrap.Detail; - string time = DateTime.Now.ToLongTimeString(); - string time1 = DateTime.Now.ToShortDateString().Replace("/", "").Trim(); - //string date = time1 + " " + time; - string date = string.Format("{0} {1}", time, time1); string asdtype = ""; - - if (Enum.Parse(exchangeScrap.Type) == EnumTransSubType.CountAdjust_WIP) + if (exchangeScrap.Type== EnumTransSubType.CountAdjust_WIP.ToString()) { asdtype = "4042"; } - else if (Enum.Parse(exchangeScrap.Type) == EnumTransSubType.CountAdjust_Warehouse) + else if (exchangeScrap.Type == EnumTransSubType.CountAdjust_Warehouse.ToString()) + { + asdtype = "4004"; + } + else if (exchangeScrap.Type == EnumTransSubType.Scrap_Manual.ToString()) { asdtype = "4004"; } + else if (exchangeScrap.Type == EnumTransSubType.Scrap_WIP.ToString()) + { + asdtype = "4042"; + } var counta = new CountAdjust() { mesout_asd_refc = departmentCode, - mesout_asd_dt_w = date, + mesout_asd_dt_w = DateTime.Now.ToString("yyyyMMdd HH:mm:ss"), mesout_asd_type = asdtype, mesout_asd_part = detail.ItemCode, - mesout_asd_date = exchangeScrap.ActiveDate.ToShortDateString().Replace("/", "").Trim(), - mesout_asd_loc = "",//字段不明确 + mesout_asd_date = exchangeScrap.ActiveDate.ToString("yyyyMMdd"), + mesout_asd_loc = detail.FromLocationErpCode, mesout_asd_code = detail.ReasonCode, mesout_asd_qty = detail.Qty, mesout_asd_user = exchangeScrap.Worker, @@ -109,7 +112,6 @@ IOutgoingFromWmsManager outgoingFromWmsManager } private async Task BuildPurchaseReceiptExchangeDtoAsync(ScrapNoteDTO wmsScrap, ScrapNoteDetailDTO wmsScrapDetail) { - await Task.CompletedTask.ConfigureAwait(false); var exchangeScrap = _objectMapper.Map(wmsScrap); var exchangeScrapDetail = _objectMapper.Map(wmsScrapDetail); //var userdep = await _supplierAsnAppService.GetByNumberAsync(exchangeCountAdjust.Worker); diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Outgoing/TransferNoteConverter.cs b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Outgoing/TransferNoteConverter.cs index c3c0e45aa..3fd884c13 100644 --- a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Outgoing/TransferNoteConverter.cs +++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Outgoing/TransferNoteConverter.cs @@ -36,6 +36,7 @@ public class TransferNoteConverter : IOutgoingConverter _objectMapper = objectMapper; } + public virtual async Task> ConvertAsync() { var outgoingToExternalList = new List(); @@ -68,16 +69,17 @@ public class TransferNoteConverter : IOutgoingConverter }; outgoingToExternal.SetEffectiveDate(outgoingFromWms.EffectiveDate); outgoingToExternal.SourceDataContent = JsonSerializer.Serialize(exchangeReceipt); + string dt_w = DateTime.Now.ToString("yyyyMMdd HH:mm:ss"); if (exchangeReceipt.Type != EnumTransSubType.Transfer_Customer.ToString()) { outgoingToExternal.DataType = EnumOutgoingDataType.TransferForErp.ToString(); - var putawayNoteScontrol = BuildScontrolDataInterface(exchangeReceipt); + var putawayNoteScontrol = BuildScontrolDataInterface(exchangeReceipt, dt_w); outgoingToExternal.DestinationDataContent = JsonSerializer.Serialize(putawayNoteScontrol); } else { outgoingToExternal.DataType = EnumOutgoingDataType.TransferForCustom.ToString(); - var putawayNoteWmsoutm = BuildWmsoutmDataInterface(exchangeReceipt, departmentCode); + var putawayNoteWmsoutm = BuildWmsoutmDataInterface(exchangeReceipt, departmentCode, dt_w); outgoingToExternal.DestinationDataContent = JsonSerializer.Serialize(putawayNoteWmsoutm); } @@ -106,7 +108,7 @@ public class TransferNoteConverter : IOutgoingConverter if (exchangeReceipt.Type != EnumTransSubType.Transfer_Customer.ToString()) { - var putawayNoteDetailScmsend = BuildScmsendDataInterfaceDetail(exchangeReceipt, exchangeReceiptDetail); + var putawayNoteDetailScmsend = BuildScmsendDataInterfaceDetail(exchangeReceipt, exchangeReceiptDetail, dt_w); outgoingDetailToExternal.DestinationDataContent = JsonSerializer.Serialize(putawayNoteDetailScmsend); } else @@ -133,12 +135,12 @@ public class TransferNoteConverter : IOutgoingConverter /// /// /// - private Scontrol BuildScontrolDataInterface(TransferNoteExchangeDto exchangeOrder) + private Scontrol BuildScontrolDataInterface(TransferNoteExchangeDto exchangeOrder, string dt_w) { var ret = new Scontrol() { scontrol_nbr = exchangeOrder.Number, - scontrol_dt_w = DateTime.Now.ToString("yyyyMMdd HH:mm:ss"), + scontrol_dt_w = dt_w, scontrol_stat = "Y", scontrol_dt_k = "", scontrol_type = billtype_s, @@ -152,12 +154,12 @@ public class TransferNoteConverter : IOutgoingConverter /// /// /// - private Scmsend BuildScmsendDataInterfaceDetail(TransferNoteExchangeDto exchangeOrder, TransferNoteDetailExchangeDto exchangeDetailOrder) + private Scmsend BuildScmsendDataInterfaceDetail(TransferNoteExchangeDto exchangeOrder, TransferNoteDetailExchangeDto exchangeDetailOrder, string dt_w) { var ret = new Scmsend() { scmsend_type = billtype_s, - scmsend_dt_w = DateTime.Now.ToString("yyyyMMdd HH:mm:ss"), + scmsend_dt_w = dt_w, scmsend_nbr = exchangeOrder.Number, scmsend_stat1 = "0", scmsend_part = exchangeDetailOrder.ItemCode, @@ -177,13 +179,13 @@ public class TransferNoteConverter : IOutgoingConverter /// /// /// - private Wmsoutm BuildWmsoutmDataInterface(TransferNoteExchangeDto exchangeOrder, string departmentCode) + private Wmsoutm BuildWmsoutmDataInterface(TransferNoteExchangeDto exchangeOrder, string departmentCode, string dt_w) { var ret = new Wmsoutm() { wmsoutm_nbr = exchangeOrder.Number, wmsoutm_type = billtype_w, - wmsoutm_dt_w = DateTime.Now.ToString("yyyyMMdd HH:mm:ss"), + wmsoutm_dt_w = dt_w, wmsoutm_stat = "Y", wmsoutm_tyrp_dt = "", wmsoutm_user = exchangeOrder.Worker, @@ -192,7 +194,7 @@ public class TransferNoteConverter : IOutgoingConverter wmsoutm_cust = "", wmsoutm_shm_nbr = "", wmsoutm_cust_loc = "", - wmsoutm_stock_stat = "", + wmsoutm_stock_stat = "1", wmsoutm_open_part = "", wmsoutm_open_loc = "", wmsoutm_open_hours = 0, @@ -208,7 +210,7 @@ public class TransferNoteConverter : IOutgoingConverter /// /// /// - private static Wmsoutd BuildWmsoutdDataInterfaceDetail(TransferNoteExchangeDto exchangeOrder, TransferNoteDetailExchangeDto exchangeDetailOrder) + private Wmsoutd BuildWmsoutdDataInterfaceDetail(TransferNoteExchangeDto exchangeOrder, TransferNoteDetailExchangeDto exchangeDetailOrder) { var ret = new Wmsoutd() { diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Outgoing/TyrpOutgoingBackgroundWorker.cs b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Outgoing/TyrpOutgoingBackgroundWorker.cs index 52ca1123a..7154286ad 100644 --- a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Outgoing/TyrpOutgoingBackgroundWorker.cs +++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Outgoing/TyrpOutgoingBackgroundWorker.cs @@ -30,8 +30,9 @@ public class TyrpOutgoingBackgroundWorker : AsyncPeriodicBackgroundWorkerBase [UnitOfWork] protected override async Task DoWorkAsync(PeriodicBackgroundWorkerContext workerContext) - { + { Logger.LogInformation($"Starting: Handling {Outgoing}"); + if (!_options.Value.IncomingOptions.Active) { Logger.LogInformation($"{Outgoing} is not active!"); @@ -84,10 +85,11 @@ public class TyrpOutgoingBackgroundWorker : AsyncPeriodicBackgroundWorkerBase var deliverNoteList = await deliverNoteConvert.ConvertAsync().ConfigureAwait(false); await wmsoutmWriter.WriteAsync(deliverNoteList).ConfigureAwait(false); - Logger.LogInformation($"Write CustomerReturnNote");//退货单 - var customerReturnNoteConvert = workerContext.ServiceProvider.GetRequiredService(); - var customerReturnNoteList = await customerReturnNoteConvert.ConvertAsync().ConfigureAwait(false); - await wmsoutmWriter.WriteAsync(customerReturnNoteList).ConfigureAwait(false); + //暂无此接口 + //Logger.LogInformation($"Write CustomerReturnNote");//退货单 + //var customerReturnNoteConvert = workerContext.ServiceProvider.GetRequiredService(); + //var customerReturnNoteList = await customerReturnNoteConvert.ConvertAsync().ConfigureAwait(false); + //await wmsoutmWriter.WriteAsync(customerReturnNoteList).ConfigureAwait(false); Logger.LogInformation($"Write UnplannedIssueNote");//非生产领料单 var unplannedIssueNoteConvert = workerContext.ServiceProvider.GetRequiredService(); @@ -109,21 +111,28 @@ public class TyrpOutgoingBackgroundWorker : AsyncPeriodicBackgroundWorkerBase var productRecycleNoteList = await productRecycleNoteConvert.ConvertAsync().ConfigureAwait(false); await wmsoutmWriter.WriteAsync(productRecycleNoteList).ConfigureAwait(false); - Logger.LogInformation($"Write CountAdjusNote");//调整单、线边仓调整单 + Logger.LogInformation($"Write CountAdjusNote");//盘点调整单 var countadjustNoteConvert = workerContext.ServiceProvider.GetRequiredService(); var countadjustNoteList = await countadjustNoteConvert.ConvertAsync().ConfigureAwait(false); var countadjustWriter = workerContext.ServiceProvider.GetRequiredService(); await countadjustWriter.WriteAsync(countadjustNoteList).ConfigureAwait(false); - Logger.LogInformation($"Write ScrapNote");//报废单、线边仓报废单 - var scrapNoteConvert = workerContext.ServiceProvider.GetRequiredService(); - var scrapNoteList = await scrapNoteConvert.ConvertAsync().ConfigureAwait(false); - await countadjustWriter.WriteAsync(scrapNoteList).ConfigureAwait(false); + Logger.LogInformation($"Write WIPAdjusNote");//线边仓调整单 + var wipAdjustNoteConvert = workerContext.ServiceProvider.GetRequiredService(); + var wipAdjustNoteList = await wipAdjustNoteConvert.ConvertAsync().ConfigureAwait(false); + await countadjustWriter.WriteAsync(wipAdjustNoteList).ConfigureAwait(false); Logger.LogInformation($"Write ItemTransformNote");//回收料调整单 var ItemTransformNoteConvert = workerContext.ServiceProvider.GetRequiredService(); var ItemTransformNoteList = await ItemTransformNoteConvert.ConvertAsync().ConfigureAwait(false); await countadjustWriter.WriteAsync(ItemTransformNoteList).ConfigureAwait(false); + + + Logger.LogInformation($"Write ScrapNote");//报废单、线边仓报废单 + var scrapNoteConvert = workerContext.ServiceProvider.GetRequiredService(); + var scrapNoteList = await scrapNoteConvert.ConvertAsync().ConfigureAwait(false); + await countadjustWriter.WriteAsync(scrapNoteList).ConfigureAwait(false); + Logger.LogInformation($"Completed: Handling {Outgoing}"); } diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Outgoing/UnplannedIssueNoteConverter.cs b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Outgoing/UnplannedIssueNoteConverter.cs index d302b0278..8a48b7e26 100644 --- a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Outgoing/UnplannedIssueNoteConverter.cs +++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Outgoing/UnplannedIssueNoteConverter.cs @@ -49,7 +49,7 @@ public class UnplannedIssueNoteConverter : IOutgoingConverter var exchangeReceipt = _objectMapper.Map(wmsReceipt); var department = await _departmentAppService.GetByUsernameAsync(exchangeReceipt.Worker).ConfigureAwait(false); var departmentCode = department == null ? "" : department.Code; - var purchaseOrder = BuildDataInterface(exchangeReceipt, departmentCode); + var purchaseOrder = BuildDataInterface(exchangeReceipt); var outgoingToExternal = new OutgoingToExternal() { DataType = EnumOutgoingDataType.UnplannedIssue.ToString(), @@ -106,7 +106,7 @@ public class UnplannedIssueNoteConverter : IOutgoingConverter /// /// /// - private Wmsoutm BuildDataInterface(UnplannedIssueNoteExchangeDto exchangeOrder, string departmentCode) + private Wmsoutm BuildDataInterface(UnplannedIssueNoteExchangeDto exchangeOrder) { var ret = new Wmsoutm() @@ -138,7 +138,7 @@ public class UnplannedIssueNoteConverter : IOutgoingConverter /// /// /// - private static Wmsoutd BuildDataInterfaceDetail(UnplannedIssueNoteExchangeDto exchangeOrder, UnplannedIssueNoteDetailExchangeDto exchangeDetailOrder) + private Wmsoutd BuildDataInterfaceDetail(UnplannedIssueNoteExchangeDto exchangeOrder, UnplannedIssueNoteDetailExchangeDto exchangeDetailOrder) { var ret = new Wmsoutd() { diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Outgoing/UnplannedReceiptNoteConverter.cs b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Outgoing/UnplannedReceiptNoteConverter.cs index c45eb07b8..bc4f6f856 100644 --- a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Outgoing/UnplannedReceiptNoteConverter.cs +++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Outgoing/UnplannedReceiptNoteConverter.cs @@ -138,7 +138,7 @@ public class UnplannedReceiptNoteConverter : IOutgoingConverter /// /// /// - private static Wmsoutd BuildDataInterfaceDetail(UnplannedReceiptNoteExchangeDto exchangeOrder, UnplannedReceiptNoteDetailExchangeDto exchangeDetailOrder) + private Wmsoutd BuildDataInterfaceDetail(UnplannedReceiptNoteExchangeDto exchangeOrder, UnplannedReceiptNoteDetailExchangeDto exchangeDetailOrder) { var ret = new Wmsoutd() { diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Outgoing/WIPAdjusNoteConverter.cs b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Outgoing/WIPAdjusNoteConverter.cs new file mode 100644 index 000000000..7f3498c07 --- /dev/null +++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Outgoing/WIPAdjusNoteConverter.cs @@ -0,0 +1,112 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text.Json; +using System.Threading.Tasks; +using Volo.Abp.ObjectMapping; +using Win_in.Sfs.Auth.Application.Contracts; +using Win_in.Sfs.Shared.Domain.Shared; +using Win_in.Sfs.Wms.DataExchange.Domain; +using Win_in.Sfs.Wms.DataExchange.Domain.Fawtyg.Tyrp; +using Win_in.Sfs.Wms.DataExchange.Domain.Shared; +using Win_in.Sfs.Wms.DataExchange.WMS.CountAdjustNote; +using Win_in.Sfs.Wms.Store.Application.Contracts; + +namespace Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent.Outgoing; + +public class WIPAdjusNoteConverter : IOutgoingConverter +{ + private readonly IOutgoingFromWmsManager _outgoingFromWmsManager; + private readonly IOutgoingToExternalManager _outgoingToExternalManager; + private readonly ISupplierAsnAppService _supplierAsnAppService; + private readonly IDepartmentAppService _departmentAppService; + private readonly IObjectMapper _objectMapper; + + public WIPAdjusNoteConverter( + IOutgoingFromWmsManager outgoingFromWmsManager + , IOutgoingToExternalManager outgoingToExternalManager + , ISupplierAsnAppService supplierAsnAppService + , IDepartmentAppService departmentAppService + , IObjectMapper objectMapper + ) + { + _outgoingFromWmsManager = outgoingFromWmsManager; + _outgoingToExternalManager = outgoingToExternalManager; + _supplierAsnAppService = supplierAsnAppService; + _departmentAppService = departmentAppService; + _objectMapper = objectMapper; + } + + public virtual async Task> ConvertAsync() + { + var outgoingToExternalList = new List(); + var outgoingFromWmsList = await _outgoingFromWmsManager.GetToBeProcessedListAsync(EnumOutgoingDataType.WIPAdjust, EnumSystemType.ERP).ConfigureAwait(false); + foreach (var outgoingFromWms in outgoingFromWmsList) + { + var wmsCountAdjust = JsonSerializer.Deserialize(outgoingFromWms.DataContent); + var department = await _departmentAppService.GetByUsernameAsync(wmsCountAdjust.Worker).ConfigureAwait(false); + var departmentCode = department == null ? "" : department.Code; + var details = wmsCountAdjust.Details.GroupBy(r => new { r.ItemCode, r.LocationErpCode }).Select(p => new CountAdjustNoteDetailExchangeDto { CountQty = p.Sum(itm => itm.CountQty), InventoryQty = p.Sum(itm => itm.InventoryQty), ItemCode = p.Key.ItemCode, LocationErpCode = p.Key.LocationErpCode, ReasonCode = String.Join("、", p.Select(x => x.ReasonCode).ToArray()) }); + var detal = details.ToList(); + foreach (var detail in detal) + { + //判断盘点数与库存数是否相等 + if (detail.CountQty != detail.InventoryQty) + { + var outgoingToExternal = new OutgoingToExternal() + { + DataType = outgoingFromWms.DataType, + DataAction = outgoingFromWms.DataAction, + SourceSystem = EnumSystemType.WMS.ToString(), + SourceDataId = wmsCountAdjust.Number, + SourceDataGroupCode = wmsCountAdjust.Number, + SourceDataDetailCode = details.FirstOrDefault().ItemCode, + Writer = nameof(TyrpOutgoingBackgroundWorker), + DestinationSystem = EnumSystemType.ERP.ToString(), + DestinationDataId = "", + }; + outgoingToExternal.SetEffectiveDate(outgoingFromWms.EffectiveDate); + var exchangeIssue = await BuildPurchaseReceiptExchangeDtoAsync(wmsCountAdjust, detail).ConfigureAwait(false); + outgoingToExternal.SourceDataContent = JsonSerializer.Serialize(exchangeIssue); + var arrive = BuildIssue(exchangeIssue, departmentCode); + outgoingToExternal.DestinationDataContent = JsonSerializer.Serialize(arrive); + + outgoingToExternalList.Add(outgoingToExternal); + } + } + } + await _outgoingToExternalManager.CreateManyAsync(outgoingToExternalList).ConfigureAwait(false); + //将outgoingFromWms数据归档 + await _outgoingFromWmsManager.ArchiveManyAsync(outgoingFromWmsList).ConfigureAwait(false); + return outgoingToExternalList; + //插入到中间表OutgoingToExternal + } + private CountAdjust BuildIssue(CountAdjustNoteExchangeDto exchangeCountAdjust, string departmentCode) + { + var detail = exchangeCountAdjust.Detail; + var counta = new CountAdjust() + { + mesout_asd_refc = departmentCode, + mesout_asd_dt_w = DateTime.Now.ToString("yyyyMMdd HH:mm:ss"), + mesout_asd_type = "4041", + mesout_asd_part = detail.ItemCode, + mesout_asd_date = exchangeCountAdjust.ActiveDate.ToString("yyyyMMdd"), + mesout_asd_loc = string.Empty, + mesout_asd_code = detail.ReasonCode, + mesout_asd_qty = detail.CountQty + detail.InventoryQty, + mesout_asd_user = exchangeCountAdjust.Worker, + mesout_asd_k = string.Empty, + mesout_asd_stat = "Y" + }; + return counta; + } + + private async Task BuildPurchaseReceiptExchangeDtoAsync( + CountAdjustNoteDTO wmsCountAdjust, CountAdjustNoteDetailExchangeDto wmsCountAdjustDetail) + { + var exchangeCountAdjust = _objectMapper.Map(wmsCountAdjust); + + exchangeCountAdjust.Detail = wmsCountAdjustDetail; + return exchangeCountAdjust; + } +} diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Outgoing/WmsoutmWriter.cs b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Outgoing/WmsoutmWriter.cs index 12fc07dd8..fc86daa52 100644 --- a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Outgoing/WmsoutmWriter.cs +++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Outgoing/WmsoutmWriter.cs @@ -46,9 +46,20 @@ public class WmsoutmWriter : IWriter var receiptDetail = JsonSerializer.Deserialize(entity.DestinationDataContent); dataInterfaceDetailList.Add(receiptDetail); } + } + try + { + //dataInterface分主子表分别写入ERP + await _wmsoutdManager.PostListAsync(dataInterfaceList, dataInterfaceDetailList).ConfigureAwait(false); + } + catch (System.Exception ex) + { + foreach (var item in entitys) + { + item.SetError(EnumExchangeDataErrorCode.Exception, ex.Message, ex.ToString()); + } } - //dataInterface分主子表分别写入ERP - await _wmsoutdManager.PostListAsync(dataInterfaceList, dataInterfaceDetailList).ConfigureAwait(false); + } //将数据归档 await _outgoingToExternalManager.ArchiveManyAsync(outgoingDataList).ConfigureAwait(false); diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/TyrpAgentModule.cs b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/TyrpAgentModule.cs index 7b996e278..7903cbfe5 100644 --- a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/TyrpAgentModule.cs +++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/TyrpAgentModule.cs @@ -172,8 +172,8 @@ public class TyrpAgentModule : AbpModule ApplicationInitializationContext context) { - context.AddBackgroundWorkerAsync(); - // context.AddBackgroundWorkerAsync(); + context.AddBackgroundWorkerAsync(); + context.AddBackgroundWorkerAsync(); } } diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/appsettings.json b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/appsettings.json index 5ae655400..aeba77ac9 100644 --- a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/appsettings.json +++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/appsettings.json @@ -1,13 +1,13 @@ { "ConnectionStrings": { - "Default": "Server=dev.ccwin-in.com,21195;Database=Wms;uid=sa;pwd=aA123456!;TrustServerCertificate=True", - "DataExchange": "Server=dev.ccwin-in.com,21195;Database=DataExchange_Main;uid=sa;pwd=aA123456!;TrustServerCertificate=True", - "TYRP": "Server=dev.ccwin-in.com,21195;Database=TYRP;Uid=sa;Pwd=aA123456!;TrustServerCertificate=True", - "SYBASE_TYRP": "Data Source=10.164.1.11; Port=5000; Database=mesdb; Uid=mesuser; Pwd=mesuser1234;Charset=cp850;" //iso_1 + "Default": "Server=10.164.113.32,1818\\SHDB;Database=Wms_Dy_ShangHai;uid=ShWmsUser;pwd=Faty@Wms_20230413#SH;TrustServerCertificate=True", + "DataExchange": "Server=10.164.113.32,1818\\SHDB;Database=DataExchange_Main;uid=ShWmsUser;pwd=Faty@Wms_20230413#SH;TrustServerCertificate=True", + "TYRP": "Server=10.164.113.32,1818\\SHDB;Database=TYRP;Uid=ShWmsUser;Pwd=Faty@Wms_20230413#SH;TrustServerCertificate=True", + "SYBASE_TYRP": "Data Source=10.164.115.137; Port=5000; Database=mesdb; Uid=mesuser; Pwd=mesuser1234;Charset=cp850;" //iso_1 }, "AuthServer": { - "Authority": "http://dev.ccwin-in.com:21293/", + "Authority": "http://dev.ccwin-in.com:60083/", "RequireHttpsMetadata": "false", "SwaggerClientId": "admin", "SwaggerClientSecret": "1q2w3E*", @@ -26,16 +26,16 @@ "RemoteServices": { "BaseData": { - "BaseUrl": "http://dev.ccwin-in.com:21294/" + "BaseUrl": "http://dev.ccwin-in.com:60084/" }, "Store": { - "BaseUrl": "http://dev.ccwin-in.com:21295/" + "BaseUrl": "http://dev.ccwin-in.com:60085/" }, "Label": { - "BaseUrl": "http://dev.ccwin-in.com:21292/" + "BaseUrl": "http://dev.ccwin-in.com:60082/" }, "Auth": { - "BaseUrl": "http://dev.ccwin-in.com:21293/" + "BaseUrl": "http://dev.ccwin-in.com:60083/" } }, "TyrpOptions": { diff --git a/be/DataExchange/Iac/Win_in.Sfs.Wms.DataExchange.Application.Iac.Mes/Mes/MesProductL7PartsNoteAutoMapperProfile.cs b/be/DataExchange/Iac/Win_in.Sfs.Wms.DataExchange.Application.Iac.Mes/Mes/MesProductL7PartsNoteAutoMapperProfile.cs index 3d08f09ac..ca59169c5 100644 --- a/be/DataExchange/Iac/Win_in.Sfs.Wms.DataExchange.Application.Iac.Mes/Mes/MesProductL7PartsNoteAutoMapperProfile.cs +++ b/be/DataExchange/Iac/Win_in.Sfs.Wms.DataExchange.Application.Iac.Mes/Mes/MesProductL7PartsNoteAutoMapperProfile.cs @@ -11,7 +11,6 @@ public class MesProductL7PartsNoteAutoMapperProfile : Profile public MesProductL7PartsNoteAutoMapperProfile() { CreateMap() - .IgnoreAuditedObjectProperties() .ForMember(x => x.CreationTime, y => y.MapFrom(d => d.CreationTime)) .ReverseMap(); diff --git a/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Agent/AgentModule.cs b/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Agent/AgentModule.cs index 3b5a3402e..31b6599f3 100644 --- a/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Agent/AgentModule.cs +++ b/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Agent/AgentModule.cs @@ -150,6 +150,6 @@ public class AgentModule : AbpModule ApplicationInitializationContext context) { context.AddBackgroundWorkerAsync(); - //context.AddBackgroundWorkerAsync(); + context.AddBackgroundWorkerAsync(); } } diff --git a/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Agent/IncomingToWmsExtensions.cs b/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Agent/IncomingToWmsExtensions.cs index bc9666215..ff543a74f 100644 --- a/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Agent/IncomingToWmsExtensions.cs +++ b/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Agent/IncomingToWmsExtensions.cs @@ -157,6 +157,7 @@ public static class IncomingToWmsExtensions var backFlush = JsonSerializer.Deserialize(incomingConverted.DataContent); var balanceAppService = workerContext.ServiceProvider.GetRequiredService(); + var balanceDtos = await balanceAppService.GetRecommendBalancesAsync(new RecommendBalanceRequestInput() { Qty = backFlush.Qty, diff --git a/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Agent/IncomingToWmsWorker.cs b/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Agent/IncomingToWmsWorker.cs index 9dafc2553..907622f56 100644 --- a/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Agent/IncomingToWmsWorker.cs +++ b/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Agent/IncomingToWmsWorker.cs @@ -79,64 +79,64 @@ public class IncomingToWmsWorker : AsyncPeriodicBackgroundWorkerBase switch (dataType) { case EnumIncomingDataType.Department: - //await incomingToWms.HandleDepartmentsAsync(workerContext).ConfigureAwait(false); + await incomingToWms.HandleDepartmentsAsync(workerContext).ConfigureAwait(false); break; case EnumIncomingDataType.User: - //await incomingToWms.HandleUsersAsync(workerContext).ConfigureAwait(false); + await incomingToWms.HandleUsersAsync(workerContext).ConfigureAwait(false); break; case EnumIncomingDataType.Item: - //await incomingToWms.HandleItemsAsync(workerContext).ConfigureAwait(false); + await incomingToWms.HandleItemsAsync(workerContext).ConfigureAwait(false); break; case EnumIncomingDataType.Location: await incomingToWms.HandleErpLocationsAsync(workerContext).ConfigureAwait(false); break; case EnumIncomingDataType.Bom: - //await incomingToWms.HandleBomsAsync(workerContext).ConfigureAwait(false); + await incomingToWms.HandleBomsAsync(workerContext).ConfigureAwait(false); break; case EnumIncomingDataType.Dict: await incomingToWms.HandleDictsAsync(workerContext).ConfigureAwait(false); break; case EnumIncomingDataType.Supplier: - //await incomingToWms.HandleSuppliersAsync(workerContext).ConfigureAwait(false); + await incomingToWms.HandleSuppliersAsync(workerContext).ConfigureAwait(false); break; case EnumIncomingDataType.SupplierItem: - //await incomingToWms.HandleSupplierItemsAsync(workerContext).ConfigureAwait(false); + await incomingToWms.HandleSupplierItemsAsync(workerContext).ConfigureAwait(false); break; case EnumIncomingDataType.ItemPack: - //await incomingToWms.HandleItemPacksAsync(workerContext).ConfigureAwait(false); + await incomingToWms.HandleItemPacksAsync(workerContext).ConfigureAwait(false); break; case EnumIncomingDataType.Customer: - //await incomingToWms.HandleCustomersAsync(workerContext).ConfigureAwait(false); + await incomingToWms.HandleCustomersAsync(workerContext).ConfigureAwait(false); break; case EnumIncomingDataType.CustomerItem: - //await incomingToWms.HandleCustomerItemsAsync(workerContext).ConfigureAwait(false); + await incomingToWms.HandleCustomerItemsAsync(workerContext).ConfigureAwait(false); break; case EnumIncomingDataType.InterfaceCalendar: - //await incomingToWms.HandleInterfaceCalendarsAsync(workerContext).ConfigureAwait(false); + await incomingToWms.HandleInterfaceCalendarsAsync(workerContext).ConfigureAwait(false); break; case EnumIncomingDataType.PurchaseOrder: - //await incomingToWms.HandlePurchaseOrdersAsync(workerContext).ConfigureAwait(false); + await incomingToWms.HandlePurchaseOrdersAsync(workerContext).ConfigureAwait(false); break; case EnumIncomingDataType.SaleOrder: - //await incomingToWms.HandleSaleOrdersAsync(workerContext).ConfigureAwait(false); + await incomingToWms.HandleSaleOrdersAsync(workerContext).ConfigureAwait(false); break; case EnumIncomingDataType.SupplierAsn: - //await incomingToWms.HandleAsnsAsync(workerContext).ConfigureAwait(false); + await incomingToWms.HandleAsnsAsync(workerContext).ConfigureAwait(false); break; case EnumIncomingDataType.ProductReceipt: - //await incomingToWms.HandleProductReceiptsAsync(workerContext).ConfigureAwait(false); + await incomingToWms.HandleProductReceiptsAsync(workerContext).ConfigureAwait(false); break; case EnumIncomingDataType.MaterialRequest: await incomingToWms.HandleMaterialRequestsAsync(workerContext).ConfigureAwait(false); break; case EnumIncomingDataType.Scrap: - //await incomingToWms.HandleScrapsAsync(workerContext).ConfigureAwait(false); + await incomingToWms.HandleScrapsAsync(workerContext).ConfigureAwait(false); break; case EnumIncomingDataType.IssueConfirm: - //await incomingToWms.HandleIssueNoteConfirmAsync(workerContext).ConfigureAwait(false); + await incomingToWms.HandleIssueNoteConfirmAsync(workerContext).ConfigureAwait(false); break; case EnumIncomingDataType.PurchaseLabel: - //await incomingToWms.HandleInventoryLabelsAsync(workerContext).ConfigureAwait(false); + await incomingToWms.HandleInventoryLabelsAsync(workerContext).ConfigureAwait(false); break; case EnumIncomingDataType.BackFlush: await incomingToWms.HandleBackFlushsAsync(workerContext).ConfigureAwait(false); diff --git a/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Agent/appsettings.json b/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Agent/appsettings.json index b88f61946..f42f6248d 100644 --- a/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Agent/appsettings.json +++ b/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Agent/appsettings.json @@ -1,13 +1,13 @@ { "ConnectionStrings": { - "Default": "Server=dev.ccwin-in.com,21195;Database=DataExchange_Main;uid=sa;pwd=aA123456!;TrustServerCertificate=True", - "DataExchange": "Server=dev.ccwin-in.com,21195;Database=DataExchange_Main;uid=sa;pwd=aA123456!;TrustServerCertificate=True" + "Default": "Server=10.164.113.32,1818\\SHDB;Database=DataExchange_Main;uid=ShWmsUser;pwd=Faty@Wms_20230413#SH;TrustServerCertificate=True", + "DataExchange": "Server=10.164.113.32,1818\\SHDB;Database=DataExchange_Main;uid=ShWmsUser;pwd=Faty@Wms_20230413#SH;TrustServerCertificate=True" }, "AuthServer": { - "Authority": "http://dev.ccwin-in.com:21293/", + "Authority": "http://dev.ccwin-in.com:60083/", "RequireHttpsMetadata": "false", "SwaggerClientId": "admin", "SwaggerClientSecret": "1q2w3E*", @@ -26,16 +26,16 @@ "RemoteServices": { "BaseData": { - "BaseUrl": "http://dev.ccwin-in.com:21294/" + "BaseUrl": "http://dev.ccwin-in.com:60084/" }, "Store": { - "BaseUrl": "http://dev.ccwin-in.com:21295/" + "BaseUrl": "http://dev.ccwin-in.com:60085/" }, "Label": { - "BaseUrl": "http://dev.ccwin-in.com:21292/" + "BaseUrl": "http://dev.ccwin-in.com:60082/" }, "Auth": { - "BaseUrl": "http://dev.ccwin-in.com:21293/" + "BaseUrl": "http://dev.ccwin-in.com:60083/" } }, "DataExchangeOptions": { diff --git a/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Application.Contracts/WMS/CountAdjustNote/CountAdjustNoteDetailExchangeDto.cs b/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Application.Contracts/WMS/CountAdjustNote/CountAdjustNoteDetailExchangeDto.cs index 2b9bde390..2f85e4307 100644 --- a/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Application.Contracts/WMS/CountAdjustNote/CountAdjustNoteDetailExchangeDto.cs +++ b/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Application.Contracts/WMS/CountAdjustNote/CountAdjustNoteDetailExchangeDto.cs @@ -4,7 +4,6 @@ namespace Win_in.Sfs.Wms.DataExchange.WMS.CountAdjustNote; public class CountAdjustNoteDetailExchangeDto { - /// /// 物品代码 /// @@ -21,9 +20,18 @@ public class CountAdjustNoteDetailExchangeDto [Display(Name = "原因代码")] public string ReasonCode { get; set; } /// + /// 库存数量 + /// + [Display(Name = "库存数量")] + public decimal InventoryQty { get; set; } + /// + /// 调整数量 + /// + [Display(Name = "调整数量")] + public decimal AdjustQty { get; set; } + /// /// 盘点数量 /// [Display(Name = "盘点数量")] public decimal CountQty { get; set; } - } diff --git a/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Application.Contracts/WMS/PutawayNote/PutawayNoteDetailExchangeDto.cs b/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Application.Contracts/WMS/PutawayNote/PutawayNoteDetailExchangeDto.cs index 8fed844ed..21b82f5e1 100644 --- a/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Application.Contracts/WMS/PutawayNote/PutawayNoteDetailExchangeDto.cs +++ b/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Application.Contracts/WMS/PutawayNote/PutawayNoteDetailExchangeDto.cs @@ -1,3 +1,4 @@ +using System; using System.ComponentModel.DataAnnotations; namespace Win_in.Sfs.Wms.DataExchange.WMS.PutawayNote; @@ -26,9 +27,58 @@ public class PutawayNoteDetailExchangeDto [Display(Name = "目标ERP库位")] public string ToLocationErpCode { get; set; } + /// + /// 箱标签 + /// + [Display(Name = "箱标签")] + public string ToPackingCode { get; set; } + /// /// 数量 /// [Display(Name = "数量")] public decimal Qty { get; set; } + + /// + /// 数量 + /// + [Display(Name = "订单数量")] + public decimal ShippedQty { get; set; } + + /// + /// 供应商代码 + /// + [Display(Name = "供应商代码")] + public string SupplierCode { get; set; } + /// + /// 批次 + /// + [Display(Name = "批次")] + public string ToLot { get; set; } + /// + /// 生产时间 + /// + [Display(Name = "生产时间")] + public DateTime ProduceDate { get; set; } = DateTime.Now; + /// + /// 发货单号 + /// + [Display(Name = "发货单号")] + public string AsnNumber { get; set; } + /// + /// 发货时间 + /// + + public DateTime? ShipDate { get; set; } + /// + /// 筹措员 + /// + + public string PlanUserCode { get; set; } + + + + + [Display(Name = "备注")] + public string Remark { get; set; } } diff --git a/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Application.Contracts/WMS/PutawayNote/PutawayNoteExchangeDto.cs b/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Application.Contracts/WMS/PutawayNote/PutawayNoteExchangeDto.cs index 74034bbdf..dc0d65103 100644 --- a/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Application.Contracts/WMS/PutawayNote/PutawayNoteExchangeDto.cs +++ b/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Application.Contracts/WMS/PutawayNote/PutawayNoteExchangeDto.cs @@ -27,4 +27,6 @@ public class PutawayNoteExchangeDto [Display(Name = "操作员")] public string Worker { get; set; } + public PutawayNoteDetailExchangeDto Detail { get; set; } = new(); + } diff --git a/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Application.Contracts/Win_in.Sfs.Wms.DataExchange.Application.Contracts.xml b/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Application.Contracts/Win_in.Sfs.Wms.DataExchange.Application.Contracts.xml index b7dad136f..e4bc696cb 100644 --- a/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Application.Contracts/Win_in.Sfs.Wms.DataExchange.Application.Contracts.xml +++ b/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Application.Contracts/Win_in.Sfs.Wms.DataExchange.Application.Contracts.xml @@ -411,6 +411,16 @@ 原因代码 + + + 库存数量 + + + + + 调整数量 + + 盘点数量 @@ -1116,11 +1126,51 @@ 目标ERP库位 + + + 箱标签 + + 数量 + + + 数量 + + + + + 供应商代码 + + + + + 批次 + + + + + 生产时间 + + + + + 发货单号 + + + + + 发货时间 + + + + + 筹措员 + + 上架单号 diff --git a/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Application/OutgoingFromWms/OutgoingFromWmsAutoMapperProfile.cs b/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Application/OutgoingFromWms/OutgoingFromWmsAutoMapperProfile.cs index 489ebfa63..fe7819e86 100644 --- a/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Application/OutgoingFromWms/OutgoingFromWmsAutoMapperProfile.cs +++ b/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Application/OutgoingFromWms/OutgoingFromWmsAutoMapperProfile.cs @@ -10,7 +10,6 @@ public class OutgoingFromWmsAutoMapperProfile : Profile public OutgoingFromWmsAutoMapperProfile() { CreateMap() - .IgnoreAuditedObjectProperties() .ForMember(x => x.CreationTime, y => y.MapFrom(d => d.CreationTime)) .ReverseMap(); diff --git a/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Domain.Shared/Enums/EnumOutgoingDataType.cs b/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Domain.Shared/Enums/EnumOutgoingDataType.cs index cc783226f..74cb9fe37 100644 --- a/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Domain.Shared/Enums/EnumOutgoingDataType.cs +++ b/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Domain.Shared/Enums/EnumOutgoingDataType.cs @@ -24,13 +24,14 @@ public enum EnumOutgoingDataType ProductionReturn = 16, ProductReceipt = 17, Deliver = 18, - CountAdjust = 19, + CountAdjust = 19,//盘点整单 CustomerReturn = 20, UnplannedIssue = 21, RecycledMaterialReceipt = 22, - ScrapNote = 23, + Scrap = 23, ProductRecycle = 24, - Item_Transform = 25 + Item_Transform = 25,//线边仓调整单 + WIPAdjust = 26//回收料调整单 } public enum EnumExchangeTableType { diff --git a/be/Hosts/Auth.Host/src/Win_in.Sfs.Auth.Application/Departments/DepartmentAutoMapperProfile.cs b/be/Hosts/Auth.Host/src/Win_in.Sfs.Auth.Application/Departments/DepartmentAutoMapperProfile.cs index a0407a3c0..e12fb49a2 100644 --- a/be/Hosts/Auth.Host/src/Win_in.Sfs.Auth.Application/Departments/DepartmentAutoMapperProfile.cs +++ b/be/Hosts/Auth.Host/src/Win_in.Sfs.Auth.Application/Departments/DepartmentAutoMapperProfile.cs @@ -10,7 +10,6 @@ public partial class AuthApplicationAutoMapperProfile : Profile private void DepartmentAutoMapperProfile() { CreateMap() - .IgnoreAuditedObjectProperties() .ReverseMap(); CreateMap() .IgnoreAuditedObjectProperties() diff --git a/be/Hosts/Auth.Host/src/Win_in.Sfs.Auth.Application/TokenService.cs b/be/Hosts/Auth.Host/src/Win_in.Sfs.Auth.Application/TokenService.cs index c22fde641..56945a228 100644 --- a/be/Hosts/Auth.Host/src/Win_in.Sfs.Auth.Application/TokenService.cs +++ b/be/Hosts/Auth.Host/src/Win_in.Sfs.Auth.Application/TokenService.cs @@ -1,9 +1,10 @@ -using System; using System.ComponentModel.DataAnnotations; using System.Net.Http; +using System.Net.Http.Headers; using System.Threading.Tasks; using IdentityModel.Client; using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.Logging; @@ -11,35 +12,31 @@ using Volo.Abp.Application.Services; namespace Win_in.Sfs.Auth.Tokens; -[Route($"api/token")] +[Route($"api")] +[Authorize] public class TokenService : ApplicationService { + private readonly IHttpContextAccessor _httpContextAccessor; private readonly IHttpClientFactory _httpClientFactory; private readonly ILogger _logger; private readonly IConfiguration _configuration; - - public TokenService(IHttpClientFactory httpClientFactory, IConfiguration configuration, ILogger logger) + public TokenService(IHttpContextAccessor httpContextAccessor, IHttpClientFactory httpClientFactory, IConfiguration configuration, ILogger logger) { + this._httpContextAccessor = httpContextAccessor; this._httpClientFactory = httpClientFactory; this._configuration = configuration; this._logger = logger; } - [HttpPost] + [HttpPost("token")] [AllowAnonymous] public async Task CreateAsync(LoginModel model) { var address = _configuration["AuthServer:Authority"]; - var request = new DiscoveryDocumentRequest - { - Address = address, - Policy = new DiscoveryPolicy { RequireHttps = false } - }; - var discovery = await _httpClientFactory.CreateClient().GetDiscoveryDocumentAsync(request).ConfigureAwait(false); var clientId = _configuration["AuthServer:ClientId"]; var clientSecret = _configuration["AuthServer:ClientSecret"]; - this._logger.LogInformation($"address:{address},TokenEndpoint:{discovery.TokenEndpoint},clientId:{clientId},clientSecret:{clientSecret}"); + var result = await _httpClientFactory.CreateClient().RequestPasswordTokenAsync(new PasswordTokenRequest { Address = $"{address.TrimEnd('/')}/connect/token", @@ -49,11 +46,6 @@ public class TokenService : ApplicationService UserName = model.UserName, Password = model.Password }).ConfigureAwait(false); - Console.WriteLine($"Result:${(result.IsError ? result.ErrorDescription : result.AccessToken)}"); - //if (result.RefreshToken == null) - //{ - // throw new UserFriendlyException("用户名或密码错误"); - //} return new JsonResult(new { @@ -72,18 +64,26 @@ public class TokenService : ApplicationService }); } - [HttpGet("[action]")] - [AllowAnonymous] - public string Test() + [HttpGet("token/application-configuration")] + public async Task ApplicationConfiguration() { - return "Test"; + var address = _configuration["AuthServer:Authority"]; + var url = $"{address.TrimEnd('/')}/api/abp/application-configuration"; + var httpClient = _httpClientFactory.CreateClient(); + var token = this._httpContextAccessor.HttpContext.Request.Headers.Authorization.ToString(); + httpClient.DefaultRequestHeaders.Authorization = AuthenticationHeaderValue.Parse(token); + var response = await httpClient.GetAsync(url).ConfigureAwait(false); + var result = new ContentResult(); + result.ContentType = "application/json"; + result.Content = await response.Content.ReadAsStringAsync().ConfigureAwait(false); + return result; } - [HttpGet("/token/test")] + [HttpGet("token/test")] [AllowAnonymous] - public string Test1() + public string Test() { - return "Test"; + return "test"; } } diff --git a/be/Hosts/Auth.Host/src/Win_in.Sfs.Auth.Web/appsettings.json b/be/Hosts/Auth.Host/src/Win_in.Sfs.Auth.Web/appsettings.json index 8a93db331..7ec7d8dd5 100644 --- a/be/Hosts/Auth.Host/src/Win_in.Sfs.Auth.Web/appsettings.json +++ b/be/Hosts/Auth.Host/src/Win_in.Sfs.Auth.Web/appsettings.json @@ -1,34 +1,34 @@ { "ConfigServer": "http://localhost:21093", "ConfigServer.Docker": "http://gateway:21093", - "ConnectionStrings": { - "Default": "Server=dev.ccwin-in.com,21195;Database=WmsAuth;uid=ccwin-in;pwd=Microsoft@2022;Packet Size=512;", - "Auth": "Server=dev.ccwin-in.com,21195;Database=WmsAuth;uid=ccwin-in;pwd=Microsoft@2022;Packet Size=512;" - }, - "SwaggerAuthServer": { - "Authority": "http://localhost:59093", - "RequireHttpsMetadata": "false" - }, - "IdentityServer": { - "Clients": { - "Auth_Web": { - "ClientId": "Auth_Web", - "RootUrl": "http://localhost:59093/", - "RequireHttpsMetadata": "false" - }, - "Auth_App": { - "ClientId": "Auth_App", - "ClientSecret": "1q2w3e*", - "RootUrl": "http://localhost:59093", - "RequireHttpsMetadata": "false" - }, - "Auth_Swagger": { - "ClientId": "Auth_Swagger", - "ClientSecret": "1q2w3e*", - "RootUrl": "http://localhost:59093", - "RequireHttpsMetadata": "false" - } - } - } + //"ConnectionStrings": { + // "Default": "Server=dev.ccwin-in.com,21195;Database=WmsAuth;uid=ccwin-in;pwd=Microsoft@2022;Packet Size=512;", + // "Auth": "Server=dev.ccwin-in.com,21195;Database=WmsAuth;uid=ccwin-in;pwd=Microsoft@2022;Packet Size=512;" + //}, + //"SwaggerAuthServer": { + // "Authority": "http://localhost:59093", + // "RequireHttpsMetadata": "false" + //}, + //"IdentityServer": { + // "Clients": { + // "Auth_Web": { + // "ClientId": "Auth_Web", + // "RootUrl": "http://localhost:59093/", + // "RequireHttpsMetadata": "false" + // }, + // "Auth_App": { + // "ClientId": "Auth_App", + // "ClientSecret": "1q2w3e*", + // "RootUrl": "http://localhost:59093", + // "RequireHttpsMetadata": "false" + // }, + // "Auth_Swagger": { + // "ClientId": "Auth_Swagger", + // "ClientSecret": "1q2w3e*", + // "RootUrl": "http://localhost:59093", + // "RequireHttpsMetadata": "false" + // } + // } + //} } diff --git a/be/Hosts/Basedata.Host/Win_in.Sfs.Basedata.HttpApi.Host/BasedataHttpApiHostModule.cs b/be/Hosts/Basedata.Host/Win_in.Sfs.Basedata.HttpApi.Host/BasedataHttpApiHostModule.cs index 1ed8d1002..3f5af902b 100644 --- a/be/Hosts/Basedata.Host/Win_in.Sfs.Basedata.HttpApi.Host/BasedataHttpApiHostModule.cs +++ b/be/Hosts/Basedata.Host/Win_in.Sfs.Basedata.HttpApi.Host/BasedataHttpApiHostModule.cs @@ -67,14 +67,19 @@ public class BasedataHttpApiHostModule : ModuleBase { public override void ConfigureServices(ServiceConfigurationContext context) { + //base.ConfigureServices(context); + //ConfigureAuditing(); + //// + //ConfigureBlobStoring(); + //Configure(options => + //{ + // options.Kind = DateTimeKind.Local; + //}); + base.ConfigureServices(context); ConfigureAuditing(); // ConfigureBlobStoring(); - Configure(options => - { - options.Kind = DateTimeKind.Local; - }); } public override void PostConfigureServices(ServiceConfigurationContext context) diff --git a/be/Hosts/Basedata.Host/Win_in.Sfs.Basedata.HttpApi.Host/appsettings.json b/be/Hosts/Basedata.Host/Win_in.Sfs.Basedata.HttpApi.Host/appsettings.json index fc30b6483..8de8aa776 100644 --- a/be/Hosts/Basedata.Host/Win_in.Sfs.Basedata.HttpApi.Host/appsettings.json +++ b/be/Hosts/Basedata.Host/Win_in.Sfs.Basedata.HttpApi.Host/appsettings.json @@ -1,34 +1,34 @@ { "ConfigServer": "http://localhost:21093", "ConfigServer.Docker": "http://gateway:21093", - "ConnectionStrings": { - "Default": "Server=dev.ccwin-in.com,13319;Database=WmsAuth;uid=ccwin-in;pwd=Microsoft@2022;Packet Size=512;", - "Auth": "Server=dev.ccwin-in.com,13319;Database=WmsAuth;uid=ccwin-in;pwd=Microsoft@2022;Packet Size=512;" - }, - "SwaggerAuthServer": { - "Authority": "http://localhost:59093", - "RequireHttpsMetadata": "false" - }, - "IdentityServer": { - "Clients": { - "Auth_Web": { - "ClientId": "Auth_Web", - "RootUrl": "http://localhost:59093/", - "RequireHttpsMetadata": "false" - }, - "Auth_App": { - "ClientId": "Auth_App", - "ClientSecret": "1q2w3e*", - "RootUrl": "http://localhost:59093", - "RequireHttpsMetadata": "false" - }, - "Auth_Swagger": { - "ClientId": "Auth_Swagger", - "ClientSecret": "1q2w3e*", - "RootUrl": "http://localhost:59093", - "RequireHttpsMetadata": "false" - } - } - } + //"ConnectionStrings": { + // "Default": "Server=dev.ccwin-in.com,13319;Database=WmsAuth;uid=ccwin-in;pwd=Microsoft@2022;Packet Size=512;", + // "Auth": "Server=dev.ccwin-in.com,13319;Database=WmsAuth;uid=ccwin-in;pwd=Microsoft@2022;Packet Size=512;" + //}, + //"SwaggerAuthServer": { + // "Authority": "http://localhost:59093", + // "RequireHttpsMetadata": "false" + //}, + //"IdentityServer": { + // "Clients": { + // "Auth_Web": { + // "ClientId": "Auth_Web", + // "RootUrl": "http://localhost:59093/", + // "RequireHttpsMetadata": "false" + // }, + // "Auth_App": { + // "ClientId": "Auth_App", + // "ClientSecret": "1q2w3e*", + // "RootUrl": "http://localhost:59093", + // "RequireHttpsMetadata": "false" + // }, + // "Auth_Swagger": { + // "ClientId": "Auth_Swagger", + // "ClientSecret": "1q2w3e*", + // "RootUrl": "http://localhost:59093", + // "RequireHttpsMetadata": "false" + // } + // } + //} } diff --git a/be/Hosts/Win_in.Sfs.Wms.Dashboard.Host/Win_in.Sfs.Wms.Dashboard.Host.csproj b/be/Hosts/Win_in.Sfs.Wms.Dashboard.Host/Win_in.Sfs.Wms.Dashboard.Host.csproj index 56115b4ec..f55c19d89 100644 --- a/be/Hosts/Win_in.Sfs.Wms.Dashboard.Host/Win_in.Sfs.Wms.Dashboard.Host.csproj +++ b/be/Hosts/Win_in.Sfs.Wms.Dashboard.Host/Win_in.Sfs.Wms.Dashboard.Host.csproj @@ -48,8 +48,8 @@ - + diff --git a/be/Hosts/Wms.Host/Win_in.Sfs.Wms.Store.HttpApi.Host/appsettings.json b/be/Hosts/Wms.Host/Win_in.Sfs.Wms.Store.HttpApi.Host/appsettings.json index fc30b6483..8de8aa776 100644 --- a/be/Hosts/Wms.Host/Win_in.Sfs.Wms.Store.HttpApi.Host/appsettings.json +++ b/be/Hosts/Wms.Host/Win_in.Sfs.Wms.Store.HttpApi.Host/appsettings.json @@ -1,34 +1,34 @@ { "ConfigServer": "http://localhost:21093", "ConfigServer.Docker": "http://gateway:21093", - "ConnectionStrings": { - "Default": "Server=dev.ccwin-in.com,13319;Database=WmsAuth;uid=ccwin-in;pwd=Microsoft@2022;Packet Size=512;", - "Auth": "Server=dev.ccwin-in.com,13319;Database=WmsAuth;uid=ccwin-in;pwd=Microsoft@2022;Packet Size=512;" - }, - "SwaggerAuthServer": { - "Authority": "http://localhost:59093", - "RequireHttpsMetadata": "false" - }, - "IdentityServer": { - "Clients": { - "Auth_Web": { - "ClientId": "Auth_Web", - "RootUrl": "http://localhost:59093/", - "RequireHttpsMetadata": "false" - }, - "Auth_App": { - "ClientId": "Auth_App", - "ClientSecret": "1q2w3e*", - "RootUrl": "http://localhost:59093", - "RequireHttpsMetadata": "false" - }, - "Auth_Swagger": { - "ClientId": "Auth_Swagger", - "ClientSecret": "1q2w3e*", - "RootUrl": "http://localhost:59093", - "RequireHttpsMetadata": "false" - } - } - } + //"ConnectionStrings": { + // "Default": "Server=dev.ccwin-in.com,13319;Database=WmsAuth;uid=ccwin-in;pwd=Microsoft@2022;Packet Size=512;", + // "Auth": "Server=dev.ccwin-in.com,13319;Database=WmsAuth;uid=ccwin-in;pwd=Microsoft@2022;Packet Size=512;" + //}, + //"SwaggerAuthServer": { + // "Authority": "http://localhost:59093", + // "RequireHttpsMetadata": "false" + //}, + //"IdentityServer": { + // "Clients": { + // "Auth_Web": { + // "ClientId": "Auth_Web", + // "RootUrl": "http://localhost:59093/", + // "RequireHttpsMetadata": "false" + // }, + // "Auth_App": { + // "ClientId": "Auth_App", + // "ClientSecret": "1q2w3e*", + // "RootUrl": "http://localhost:59093", + // "RequireHttpsMetadata": "false" + // }, + // "Auth_Swagger": { + // "ClientId": "Auth_Swagger", + // "ClientSecret": "1q2w3e*", + // "RootUrl": "http://localhost:59093", + // "RequireHttpsMetadata": "false" + // } + // } + //} } diff --git a/be/Hosts/Wms.Host/Win_in.Sfs.Wms.Store.HttpApi.Host/scripts/db.Microsoft.EntityFrameworkCore.SqlServer.StoreDbContext.sql b/be/Hosts/Wms.Host/Win_in.Sfs.Wms.Store.HttpApi.Host/scripts/db.Microsoft.EntityFrameworkCore.SqlServer.StoreDbContext.sql index 9e908aedd..286935fff 100644 --- a/be/Hosts/Wms.Host/Win_in.Sfs.Wms.Store.HttpApi.Host/scripts/db.Microsoft.EntityFrameworkCore.SqlServer.StoreDbContext.sql +++ b/be/Hosts/Wms.Host/Win_in.Sfs.Wms.Store.HttpApi.Host/scripts/db.Microsoft.EntityFrameworkCore.SqlServer.StoreDbContext.sql @@ -2529,6 +2529,9 @@ CREATE TABLE [Job_PutawayJobDetail] ( CREATE TABLE [Job_UnplannedIssueJobDetail] ( [Id] uniqueidentifier NOT NULL, [ReasonCode] nvarchar(max) NULL, + [CaseCode] nvarchar(max) NULL, + [ProjCapacityCode] nvarchar(max) NULL, + [OnceBusiCode] nvarchar(max) NULL, [ExtraProperties] nvarchar(max) NULL, [CreationTime] datetime2 NOT NULL, [CreatorId] uniqueidentifier NULL, @@ -2579,6 +2582,9 @@ CREATE TABLE [Job_UnplannedIssueJobDetail] ( CREATE TABLE [Job_UnplannedReceiptJobDetail] ( [Id] uniqueidentifier NOT NULL, [ReasonCode] nvarchar(max) NULL, + [CaseCode] nvarchar(max) NULL, + [ProjCapacityCode] nvarchar(max) NULL, + [OnceBusiCode] nvarchar(max) NULL, [ExtraProperties] nvarchar(max) NULL, [CreationTime] datetime2 NOT NULL, [CreatorId] uniqueidentifier NULL, @@ -2957,6 +2963,7 @@ CREATE TABLE [Store_DeliverNoteDetail] ( [ItemDesc1] nvarchar(64) NULL, [ItemDesc2] nvarchar(64) NULL, [ItemCode] nvarchar(64) NOT NULL, + [Uom] nvarchar(64) NOT NULL, [Qty] decimal(18,6) NOT NULL, [StdPackQty] decimal(18,6) NOT NULL, [FromPackingCode] nvarchar(64) NOT NULL, @@ -2993,7 +3000,6 @@ CREATE TABLE [Store_DeliverNoteDetail] ( [RecommendFromLocationGroup] nvarchar(64) NULL, [RecommendFromLocationErpCode] nvarchar(64) NULL, [RecommendFromWarehouseCode] nvarchar(64) NULL, - [Uom] nvarchar(64) NOT NULL, [RecommendQty] decimal(18,6) NOT NULL, [HandledContainerCode] nvarchar(64) NULL, [HandledPackingCode] nvarchar(64) NULL, @@ -3411,6 +3417,7 @@ CREATE TABLE [Store_IssueNoteDetail] ( [ItemDesc1] nvarchar(64) NULL, [ItemDesc2] nvarchar(64) NULL, [ItemCode] nvarchar(64) NOT NULL, + [Uom] nvarchar(64) NOT NULL, [Qty] decimal(18,6) NOT NULL, [StdPackQty] decimal(18,6) NOT NULL, [FromPackingCode] nvarchar(450) NULL, @@ -3447,7 +3454,6 @@ CREATE TABLE [Store_IssueNoteDetail] ( [RecommendFromLocationGroup] nvarchar(64) NULL, [RecommendFromLocationErpCode] nvarchar(64) NULL, [RecommendFromWarehouseCode] nvarchar(64) NULL, - [Uom] nvarchar(64) NOT NULL, [RecommendQty] decimal(18,6) NOT NULL, [HandledContainerCode] nvarchar(64) NULL, [HandledPackingCode] nvarchar(64) NULL, @@ -3855,6 +3861,7 @@ CREATE TABLE [Store_ProductionReturnNoteDetail] ( [ItemDesc1] nvarchar(64) NULL, [ItemDesc2] nvarchar(64) NULL, [ItemCode] nvarchar(64) NOT NULL, + [Uom] nvarchar(64) NOT NULL, [Qty] decimal(18,6) NOT NULL, [StdPackQty] decimal(18,6) NOT NULL, [FromPackingCode] nvarchar(450) NULL, @@ -3891,7 +3898,6 @@ CREATE TABLE [Store_ProductionReturnNoteDetail] ( [RecommendToLocationGroup] nvarchar(64) NULL, [RecommendToLocationErpCode] nvarchar(64) NULL, [RecommendToWarehouseCode] nvarchar(64) NULL, - [Uom] nvarchar(64) NOT NULL, [RecommendQty] decimal(18,6) NOT NULL, [HandledContainerCode] nvarchar(64) NULL, [HandledPackingCode] nvarchar(64) NULL, @@ -4021,6 +4027,7 @@ CREATE TABLE [Store_ProductReceiptNoteDetail] ( [LocationErpCode] nvarchar(64) NOT NULL, [WarehouseCode] nvarchar(64) NOT NULL, [Status] nvarchar(64) NOT NULL, + [Uom] nvarchar(64) NOT NULL, [Qty] decimal(18,6) NOT NULL, [StdPackQty] decimal(18,6) NOT NULL, [RecommendContainerCode] nvarchar(64) NULL, @@ -4035,7 +4042,6 @@ CREATE TABLE [Store_ProductReceiptNoteDetail] ( [RecommendToLocationGroup] nvarchar(64) NULL, [RecommendToLocationErpCode] nvarchar(64) NULL, [RecommendToWarehouseCode] nvarchar(64) NULL, - [Uom] nvarchar(64) NOT NULL, [RecommendQty] decimal(18,6) NOT NULL, [HandledContainerCode] nvarchar(64) NULL, [HandledPackingCode] nvarchar(64) NULL, @@ -4279,6 +4285,7 @@ CREATE TABLE [Store_PurchaseReceiptNoteDetail] ( [LocationErpCode] nvarchar(64) NOT NULL, [WarehouseCode] nvarchar(64) NOT NULL, [Status] nvarchar(64) NOT NULL, + [Uom] nvarchar(64) NOT NULL, [Qty] decimal(18,6) NOT NULL, [StdPackQty] decimal(18,6) NOT NULL, [RecommendContainerCode] nvarchar(64) NULL, @@ -4293,7 +4300,6 @@ CREATE TABLE [Store_PurchaseReceiptNoteDetail] ( [RecommendToLocationGroup] nvarchar(64) NULL, [RecommendToLocationErpCode] nvarchar(64) NULL, [RecommendToWarehouseCode] nvarchar(64) NULL, - [Uom] nvarchar(64) NOT NULL, [RecommendQty] decimal(18,6) NOT NULL, [HandledContainerCode] nvarchar(64) NULL, [HandledPackingCode] nvarchar(64) NULL, @@ -4378,6 +4384,7 @@ CREATE TABLE [Store_PurchaseReturnNoteDetail] ( [LocationErpCode] nvarchar(64) NOT NULL, [WarehouseCode] nvarchar(64) NOT NULL, [Status] nvarchar(64) NOT NULL, + [Uom] nvarchar(64) NOT NULL, [Qty] decimal(18,6) NOT NULL, [StdPackQty] decimal(18,6) NOT NULL, [RecommendContainerCode] nvarchar(64) NULL, @@ -4392,7 +4399,6 @@ CREATE TABLE [Store_PurchaseReturnNoteDetail] ( [RecommendFromLocationGroup] nvarchar(64) NULL, [RecommendFromLocationErpCode] nvarchar(64) NULL, [RecommendFromWarehouseCode] nvarchar(64) NULL, - [Uom] nvarchar(64) NOT NULL, [RecommendQty] decimal(18,6) NOT NULL, [HandledContainerCode] nvarchar(64) NULL, [HandledPackingCode] nvarchar(64) NULL, @@ -4466,6 +4472,7 @@ CREATE TABLE [Store_PutawayNoteDetail] ( [ItemDesc1] nvarchar(64) NULL, [ItemDesc2] nvarchar(64) NULL, [ItemCode] nvarchar(64) NOT NULL, + [Uom] nvarchar(64) NOT NULL, [Qty] decimal(18,6) NOT NULL, [StdPackQty] decimal(18,6) NOT NULL, [FromPackingCode] nvarchar(450) NULL, @@ -4502,7 +4509,6 @@ CREATE TABLE [Store_PutawayNoteDetail] ( [RecommendToLocationGroup] nvarchar(64) NULL, [RecommendToLocationErpCode] nvarchar(64) NULL, [RecommendToWarehouseCode] nvarchar(64) NULL, - [Uom] nvarchar(64) NOT NULL, [RecommendQty] decimal(18,6) NOT NULL, [HandledContainerCode] nvarchar(64) NULL, [HandledPackingCode] nvarchar(64) NULL, @@ -4875,6 +4881,9 @@ CREATE TABLE [Store_TransferRequestDetail] ( CREATE TABLE [Store_UnplannedIssueNoteDetail] ( [Id] uniqueidentifier NOT NULL, [ReasonCode] nvarchar(max) NULL, + [CaseCode] nvarchar(max) NULL, + [ProjCapacityCode] nvarchar(max) NULL, + [OnceBusiCode] nvarchar(max) NULL, [ExtraProperties] nvarchar(max) NULL, [CreationTime] datetime2 NOT NULL, [CreatorId] uniqueidentifier NULL, @@ -4901,6 +4910,7 @@ CREATE TABLE [Store_UnplannedIssueNoteDetail] ( [LocationErpCode] nvarchar(64) NOT NULL, [WarehouseCode] nvarchar(64) NOT NULL, [Status] nvarchar(64) NOT NULL, + [Uom] nvarchar(64) NOT NULL, [Qty] decimal(18,6) NOT NULL, [StdPackQty] decimal(18,6) NOT NULL, [RecommendContainerCode] nvarchar(64) NULL, @@ -4915,7 +4925,6 @@ CREATE TABLE [Store_UnplannedIssueNoteDetail] ( [RecommendFromLocationGroup] nvarchar(64) NULL, [RecommendFromLocationErpCode] nvarchar(64) NULL, [RecommendFromWarehouseCode] nvarchar(64) NULL, - [Uom] nvarchar(64) NOT NULL, [RecommendQty] decimal(18,6) NOT NULL, [HandledContainerCode] nvarchar(64) NULL, [HandledPackingCode] nvarchar(64) NULL, @@ -4937,6 +4946,9 @@ CREATE TABLE [Store_UnplannedIssueNoteDetail] ( CREATE TABLE [Store_UnplannedIssueRequestDetail] ( [Id] uniqueidentifier NOT NULL, + [CaseCode] nvarchar(max) NULL, + [ProjCapacityCode] nvarchar(max) NULL, + [OnceBusiCode] nvarchar(max) NULL, [ExtraProperties] nvarchar(max) NULL, [CreationTime] datetime2 NOT NULL, [CreatorId] uniqueidentifier NULL, @@ -4974,6 +4986,9 @@ CREATE TABLE [Store_UnplannedIssueRequestDetail] ( CREATE TABLE [Store_UnplannedReceiptNoteDetail] ( [Id] uniqueidentifier NOT NULL, [ReasonCode] nvarchar(max) NULL, + [CaseCode] nvarchar(max) NULL, + [ProjCapacityCode] nvarchar(max) NULL, + [OnceBusiCode] nvarchar(max) NULL, [ExtraProperties] nvarchar(max) NULL, [CreationTime] datetime2 NOT NULL, [CreatorId] uniqueidentifier NULL, @@ -5000,6 +5015,7 @@ CREATE TABLE [Store_UnplannedReceiptNoteDetail] ( [LocationErpCode] nvarchar(64) NOT NULL, [WarehouseCode] nvarchar(64) NOT NULL, [Status] nvarchar(64) NOT NULL, + [Uom] nvarchar(64) NOT NULL, [Qty] decimal(18,6) NOT NULL, [StdPackQty] decimal(18,6) NOT NULL, [RecommendContainerCode] nvarchar(64) NULL, @@ -5014,7 +5030,6 @@ CREATE TABLE [Store_UnplannedReceiptNoteDetail] ( [RecommendToLocationGroup] nvarchar(64) NULL, [RecommendToLocationErpCode] nvarchar(64) NULL, [RecommendToWarehouseCode] nvarchar(64) NULL, - [Uom] nvarchar(64) NOT NULL, [RecommendQty] decimal(18,6) NOT NULL, [HandledContainerCode] nvarchar(64) NULL, [HandledPackingCode] nvarchar(64) NULL, @@ -5036,6 +5051,10 @@ CREATE TABLE [Store_UnplannedReceiptNoteDetail] ( CREATE TABLE [Store_UnplannedReceiptRequestDetail] ( [Id] uniqueidentifier NOT NULL, + [ReasonCode] nvarchar(max) NULL, + [CaseCode] nvarchar(max) NULL, + [ProjCapacityCode] nvarchar(max) NULL, + [OnceBusiCode] nvarchar(max) NULL, [ExtraProperties] nvarchar(max) NULL, [CreationTime] datetime2 NOT NULL, [CreatorId] uniqueidentifier NULL, diff --git a/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/BaseDatas/DictController.cs b/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/BaseDatas/DictController.cs index eeaf54727..2bb773383 100644 --- a/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/BaseDatas/DictController.cs +++ b/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/BaseDatas/DictController.cs @@ -1,6 +1,9 @@ +using System; using System.Threading.Tasks; using Microsoft.AspNetCore.Mvc; +using Microsoft.Extensions.Options; using Volo.Abp.AspNetCore.Mvc; +using Volo.Abp.Json; using Win_in.Sfs.Basedata.Application.Contracts; namespace Win_in.Sfs.Wms.Pda.Controllers.BaseDatas; @@ -18,9 +21,11 @@ public class DictController : AbpController /// /// /// - public DictController(IDictAppService dictApp) + public DictController(IDictAppService dictApp,IOptions options) { _dictApp = dictApp; + var str = options.Value.DefaultDateTimeFormat; + Console.WriteLine(str); } /// @@ -31,6 +36,8 @@ public class DictController : AbpController [HttpGet("by-code")] public virtual async Task GetByCodeAsync(string code) { - return await _dictApp.GetByCodeAsync(code).ConfigureAwait(false); + var dtos = await _dictApp.GetByCodeAsync(code).ConfigureAwait(false); + + return dtos; } } diff --git a/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Jobs/JobController.cs b/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Jobs/JobController.cs index ead6be2c7..17418503c 100644 --- a/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Jobs/JobController.cs +++ b/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Jobs/JobController.cs @@ -1,4 +1,6 @@ +using System; using System.Collections.Generic; +using System.Linq; using System.Text.Json; using System.Threading.Tasks; using Microsoft.AspNetCore.Mvc; @@ -70,13 +72,13 @@ public class JobController : AbpController /// 获取全部任务数量统计 /// /// - [HttpGet("")] - public virtual async Task> CountAsync() + [HttpGet("get-job-count/{isToday}")] + public virtual async Task> CountAsync(Guid userId ,bool isToday) { - var wlgCodes = await _userWorkGroupAppService.GetCodsOfCurrentUserAsync().ConfigureAwait(false); - var jsonCodes = JsonSerializer.Serialize(wlgCodes); + var wlgCodes = await _userWorkGroupAppService.GetUserWorkGroupAsync(userId).ConfigureAwait(false); + var jsonCodes = JsonSerializer.Serialize(wlgCodes.Select(p=>p.WorkGroupCode)); - var status = new List() { (int)EnumJobStatus.Open, (int)EnumJobStatus.Doing }; + var status = new List() { EnumJobStatus.Open,EnumJobStatus.Doing }; var jsonStatus = JsonSerializer.Serialize(status); var list = new List(); @@ -146,7 +148,7 @@ public class JobController : AbpController }).ConfigureAwait(false); list.Add(new JobCountDto { JobType = EnumJobType.ProductReceiveJob, Count = productReceiveJobs }); - var purchaseReceiptJobs = await _purchaseReceiptJobAppService.GetCountByFilterAsync(new SfsJobRequestInputBase + var purchaseReceiptJobRequest = new SfsJobRequestInputBase { Condition = new Condition { @@ -156,7 +158,13 @@ public class JobController : AbpController new(nameof(PurchaseReceiptJobDTO.JobStatus),jsonStatus,"In") } } - }).ConfigureAwait(false); + }; + if (isToday)//只看当日 + { + purchaseReceiptJobRequest.Condition.Filters.Add(new Filter(nameof(PurchaseReceiptJobDTO.PlanArriveDate), Clock.Now.ToString("yyyy-MM-dd"), ">=", "And")); + purchaseReceiptJobRequest.Condition.Filters.Add(new Filter(nameof(PurchaseReceiptJobDTO.PlanArriveDate), Clock.Now.AddDays(1).ToString("yyyy-MM-dd"), "<=", "And")); + } + var purchaseReceiptJobs = await _purchaseReceiptJobAppService.GetCountByFilterAsync(purchaseReceiptJobRequest).ConfigureAwait(false); list.Add(new JobCountDto { JobType = EnumJobType.PurchaseReceiptJob, Count = purchaseReceiptJobs }); var purchaseReturnJobs = await _purchaseReturnJobAppService.GetCountByFilterAsync(new SfsJobRequestInputBase diff --git a/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/Dicts/DictAutoMapperProfile.cs b/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/Dicts/DictAutoMapperProfile.cs index 05459426f..b64bfb41d 100644 --- a/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/Dicts/DictAutoMapperProfile.cs +++ b/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/Dicts/DictAutoMapperProfile.cs @@ -13,7 +13,7 @@ public partial class BasedataApplicationAutoMapperProfile : Profile ; CreateMap() - .IgnoreAuditedObjectProperties(); + ; CreateMap() .IgnoreAuditedObjectProperties() diff --git a/be/Modules/Inventory/src/Win_in.Sfs.Wms.Inventory.Application/Balances/BalanceAppService.cs b/be/Modules/Inventory/src/Win_in.Sfs.Wms.Inventory.Application/Balances/BalanceAppService.cs index d063a0463..bcfbbed1c 100644 --- a/be/Modules/Inventory/src/Win_in.Sfs.Wms.Inventory.Application/Balances/BalanceAppService.cs +++ b/be/Modules/Inventory/src/Win_in.Sfs.Wms.Inventory.Application/Balances/BalanceAppService.cs @@ -275,6 +275,7 @@ public class BalanceAppService dto.ItemName = item.Name; dto.ItemDesc1 = item.Desc1; dto.ItemDesc2 = item.Desc2; + dto.Uom = item.BasicUom; } return dtos; } diff --git a/be/Modules/Inventory/src/Win_in.Sfs.Wms.Inventory.Application/Containers/ContainerAutoMapperProfile.cs b/be/Modules/Inventory/src/Win_in.Sfs.Wms.Inventory.Application/Containers/ContainerAutoMapperProfile.cs index 5fadf445f..eb1ddb3d3 100644 --- a/be/Modules/Inventory/src/Win_in.Sfs.Wms.Inventory.Application/Containers/ContainerAutoMapperProfile.cs +++ b/be/Modules/Inventory/src/Win_in.Sfs.Wms.Inventory.Application/Containers/ContainerAutoMapperProfile.cs @@ -12,7 +12,8 @@ public partial class InventoryApplicationAutoMapperProfile : Profile CreateMap() .ReverseMap(); - CreateMap().IgnoreAuditedObjectProperties(); + CreateMap() + ; CreateMap() .IgnoreAuditedObjectProperties() diff --git a/be/Modules/Inventory/src/Win_in.Sfs.Wms.Inventory.Domain/Balances/BalanceManager.cs b/be/Modules/Inventory/src/Win_in.Sfs.Wms.Inventory.Domain/Balances/BalanceManager.cs index 37c115932..a7babf41a 100644 --- a/be/Modules/Inventory/src/Win_in.Sfs.Wms.Inventory.Domain/Balances/BalanceManager.cs +++ b/be/Modules/Inventory/src/Win_in.Sfs.Wms.Inventory.Domain/Balances/BalanceManager.cs @@ -105,6 +105,15 @@ public class BalanceManager : DomainService, IBalanceManager } else { + if (existBalance.IsActive == false) + { + throw new UserFriendlyException($"库位在{existBalance.LocationCode}," + + $"物品编号为{existBalance.ItemCode}," + + $"箱码为{existBalance.PackingCode}," + + $"批次为{existBalance.Lot}," + + $"状态为{existBalance.Status.GetDisplayName()}" + + $"的库存是不可用状态"); + } //如果单件管理的库存已存在,报错 transaction.CheckSingleUnitHasExist(); existBalance.IncreaseQty(transaction.Qty); @@ -202,6 +211,16 @@ public class BalanceManager : DomainService, IBalanceManager } else { + if (existBalance.IsActive == false) + { + throw new UserFriendlyException($"库位在{existBalance.LocationCode}," + + $"物品编号为{existBalance.ItemCode}," + + $"箱码为{existBalance.PackingCode}," + + $"批次为{existBalance.Lot}," + + $"状态为{existBalance.Status}" + + $"的库存是不可用状态"); + } + existBalance.IncreaseQty(transaction.Qty); switch (existBalance.Qty) { diff --git a/be/Modules/Inventory/src/Win_in.Sfs.Wms.Inventory.Domain/Transactions/TransactionManager.cs b/be/Modules/Inventory/src/Win_in.Sfs.Wms.Inventory.Domain/Transactions/TransactionManager.cs index 26cf02cbd..fabcb95d3 100644 --- a/be/Modules/Inventory/src/Win_in.Sfs.Wms.Inventory.Domain/Transactions/TransactionManager.cs +++ b/be/Modules/Inventory/src/Win_in.Sfs.Wms.Inventory.Domain/Transactions/TransactionManager.cs @@ -18,7 +18,8 @@ public class TransactionManager : DomainService, ITransactionManager private readonly IBalanceManager _balanceManager; private readonly IItemBasicAclService _itemBasicAclService; private readonly ILocationAclService _locationAclService; - private readonly ITransactionTypeAclService _transactionTypeAclService; + //private readonly ITransactionTypeAclService _transactionTypeAclService; + private readonly ITransactionTypeAppService _transactionTypeAppService; private readonly ITransactionRepository _transactionRepository; private readonly IBalanceRepository _balanceRepository; private readonly ISnowflakeIdGenerator _numberGenerator; @@ -28,20 +29,22 @@ public class TransactionManager : DomainService, ITransactionManager IBalanceManager balanceManager , IItemBasicAclService itemBasicAclService , ILocationAclService locationAclService - , ITransactionTypeAclService transactionTypeAclService + //, ITransactionTypeAclService transactionTypeAclService , ITransactionRepository transactionRepository , IBalanceRepository balanceRepository , ISnowflakeIdGenerator numberGenerator - , ILocationCapacityManager locationCapacityManager) + , ILocationCapacityManager locationCapacityManager + , ITransactionTypeAppService transactionTypeAppService) { _balanceManager = balanceManager; _itemBasicAclService = itemBasicAclService; _locationAclService = locationAclService; - _transactionTypeAclService = transactionTypeAclService; + //_transactionTypeAclService = transactionTypeAclService; _transactionRepository = transactionRepository; _balanceRepository = balanceRepository; _numberGenerator = numberGenerator; _locationCapacityManager = locationCapacityManager; + _transactionTypeAppService = transactionTypeAppService; } public virtual async Task AddAsync(Transaction transaction) @@ -96,7 +99,7 @@ public class TransactionManager : DomainService, ITransactionManager var item = await _itemBasicAclService.GetByCodeAsync(transaction.ItemCode).ConfigureAwait(false); var location = await _locationAclService.GetByCodeAsync(transaction.LocationCode).ConfigureAwait(false); - var transactionType = await _transactionTypeAclService.GetByTransTypeAsync(transaction.TransType, transaction.TransSubType).ConfigureAwait(false); + var transactionType = await _transactionTypeAppService.GetByTransTypeAsync(transaction.TransType, transaction.TransSubType).ConfigureAwait(false); transaction.CheckTransactionType(transactionType, item, location); //执行库存余额的变动 @@ -158,7 +161,7 @@ public class TransactionManager : DomainService, ITransactionManager //库位注意大小写 var location = locations.FirstOrDefault(p => p.Code.ToUpper() == transaction.LocationCode.ToUpper()); - var transactionType = await _transactionTypeAclService.GetByTransTypeAsync(transaction.TransType, transaction.TransSubType).ConfigureAwait(false); + var transactionType = await _transactionTypeAppService.GetByTransTypeAsync(transaction.TransType, transaction.TransSubType).ConfigureAwait(false); transaction.CheckTransactionType(transactionType, item, location); await UpdateBalanceAsync(transaction, item, location).ConfigureAwait(false); diff --git a/be/Modules/Label/src/Win_in.Sfs.Label.Application/CountLabels/CountLabelAutoMapperProfile.cs b/be/Modules/Label/src/Win_in.Sfs.Label.Application/CountLabels/CountLabelAutoMapperProfile.cs index e94bad7dc..6894bb819 100644 --- a/be/Modules/Label/src/Win_in.Sfs.Label.Application/CountLabels/CountLabelAutoMapperProfile.cs +++ b/be/Modules/Label/src/Win_in.Sfs.Label.Application/CountLabels/CountLabelAutoMapperProfile.cs @@ -10,8 +10,7 @@ public class CountLabelAutoMapperProfile : Profile public CountLabelAutoMapperProfile() { CreateMap() - .IgnoreAuditedObjectProperties() - .ReverseMap(); + .ReverseMap(); CreateMap(); } diff --git a/be/Modules/Label/src/Win_in.Sfs.Label.Application/PalletCode/PalletCodeAutoMapperProfile.cs b/be/Modules/Label/src/Win_in.Sfs.Label.Application/PalletCode/PalletCodeAutoMapperProfile.cs index 79b154e49..4c591b486 100644 --- a/be/Modules/Label/src/Win_in.Sfs.Label.Application/PalletCode/PalletCodeAutoMapperProfile.cs +++ b/be/Modules/Label/src/Win_in.Sfs.Label.Application/PalletCode/PalletCodeAutoMapperProfile.cs @@ -10,8 +10,7 @@ public class PalletCodeAutoMapperProfile : Profile public PalletCodeAutoMapperProfile() { CreateMap() - .IgnoreAuditedObjectProperties() - .ReverseMap(); + .ReverseMap(); CreateMap(); } diff --git a/be/Modules/Label/src/Win_in.Sfs.Label.Application/PalletLabels/PalletLabelAutoMapperProfile.cs b/be/Modules/Label/src/Win_in.Sfs.Label.Application/PalletLabels/PalletLabelAutoMapperProfile.cs index b92d2680a..1195131aa 100644 --- a/be/Modules/Label/src/Win_in.Sfs.Label.Application/PalletLabels/PalletLabelAutoMapperProfile.cs +++ b/be/Modules/Label/src/Win_in.Sfs.Label.Application/PalletLabels/PalletLabelAutoMapperProfile.cs @@ -10,7 +10,6 @@ public class PalletLabelAutoMapperProfile : Profile public PalletLabelAutoMapperProfile() { CreateMap() - .IgnoreAuditedObjectProperties() .ForMember(x => x.ItemName, y => y.MapFrom(d => d.Name)) .ForMember(x => x.ItemDesc1, y => y.MapFrom(d => d.Desc1)) .ForMember(x => x.ItemDesc2, y => y.MapFrom(d => d.Desc2)) diff --git a/be/Modules/Label/src/Win_in.Sfs.Label.Application/SaleLabels/SaleLabelAutoMapperProfile.cs b/be/Modules/Label/src/Win_in.Sfs.Label.Application/SaleLabels/SaleLabelAutoMapperProfile.cs index 5c0f94e93..fa931b956 100644 --- a/be/Modules/Label/src/Win_in.Sfs.Label.Application/SaleLabels/SaleLabelAutoMapperProfile.cs +++ b/be/Modules/Label/src/Win_in.Sfs.Label.Application/SaleLabels/SaleLabelAutoMapperProfile.cs @@ -10,7 +10,6 @@ public class SaleLabelAutoMapperProfile : Profile public SaleLabelAutoMapperProfile() { CreateMap() - .IgnoreAuditedObjectProperties() .ReverseMap(); } } diff --git a/be/Modules/Label/src/Win_in.Sfs.Label.Application/SerialCode/SerialCodeAutoMapperProfile.cs b/be/Modules/Label/src/Win_in.Sfs.Label.Application/SerialCode/SerialCodeAutoMapperProfile.cs index 585f112e9..edf57b3de 100644 --- a/be/Modules/Label/src/Win_in.Sfs.Label.Application/SerialCode/SerialCodeAutoMapperProfile.cs +++ b/be/Modules/Label/src/Win_in.Sfs.Label.Application/SerialCode/SerialCodeAutoMapperProfile.cs @@ -10,8 +10,7 @@ public class SerialCodeAutoMapperProfile : Profile public SerialCodeAutoMapperProfile() { CreateMap() - .IgnoreAuditedObjectProperties() - .ReverseMap(); + .ReverseMap(); CreateMap(); } diff --git a/be/Modules/Message/src/Win_in.Sfs.Message.Application/MessageTypeSubscribes/MessageTypeSubscribeAutoMapperProfile.cs b/be/Modules/Message/src/Win_in.Sfs.Message.Application/MessageTypeSubscribes/MessageTypeSubscribeAutoMapperProfile.cs index 7fedb3bf6..547f34e10 100644 --- a/be/Modules/Message/src/Win_in.Sfs.Message.Application/MessageTypeSubscribes/MessageTypeSubscribeAutoMapperProfile.cs +++ b/be/Modules/Message/src/Win_in.Sfs.Message.Application/MessageTypeSubscribes/MessageTypeSubscribeAutoMapperProfile.cs @@ -10,8 +10,7 @@ public partial class MessageApplicationAutoMapperProfile : Profile public void MessageTypeSubscribesAutoMapperProfile() { CreateMap() - .IgnoreAuditedObjectProperties() - .ReverseMap(); + .ReverseMap(); CreateMap() .IgnoreAuditedObjectProperties() diff --git a/be/Modules/Message/src/Win_in.Sfs.Message.Application/MessageTypes/MessageTypeAutoMapperProfile.cs b/be/Modules/Message/src/Win_in.Sfs.Message.Application/MessageTypes/MessageTypeAutoMapperProfile.cs index d602c2108..08dd8ec08 100644 --- a/be/Modules/Message/src/Win_in.Sfs.Message.Application/MessageTypes/MessageTypeAutoMapperProfile.cs +++ b/be/Modules/Message/src/Win_in.Sfs.Message.Application/MessageTypes/MessageTypeAutoMapperProfile.cs @@ -10,7 +10,6 @@ public partial class MessageApplicationAutoMapperProfile : Profile public void MessageTypeAutoMapperProfile() { CreateMap() - .IgnoreAuditedObjectProperties() - .ReverseMap(); + .ReverseMap(); } } diff --git a/be/Modules/Message/src/Win_in.Sfs.Message.Application/NotifyMessages/NotifyMessageAutoMapperProfile.cs b/be/Modules/Message/src/Win_in.Sfs.Message.Application/NotifyMessages/NotifyMessageAutoMapperProfile.cs index cfbf6da69..44e43ddb7 100644 --- a/be/Modules/Message/src/Win_in.Sfs.Message.Application/NotifyMessages/NotifyMessageAutoMapperProfile.cs +++ b/be/Modules/Message/src/Win_in.Sfs.Message.Application/NotifyMessages/NotifyMessageAutoMapperProfile.cs @@ -11,8 +11,7 @@ public partial class MessageApplicationAutoMapperProfile : Profile public void NotifyMessageAutoMapperProfileConfig() { CreateMap() - .IgnoreAuditedObjectProperties() - .ReverseMap(); + .ReverseMap(); CreateMap() .Ignore(x => x.ConcurrencyStamp) diff --git a/be/Modules/Message/src/Win_in.Sfs.Message.Application/PrivateMessages/PrivateMessageAutoMapperProfile.cs b/be/Modules/Message/src/Win_in.Sfs.Message.Application/PrivateMessages/PrivateMessageAutoMapperProfile.cs index 460d3b5ae..f147927eb 100644 --- a/be/Modules/Message/src/Win_in.Sfs.Message.Application/PrivateMessages/PrivateMessageAutoMapperProfile.cs +++ b/be/Modules/Message/src/Win_in.Sfs.Message.Application/PrivateMessages/PrivateMessageAutoMapperProfile.cs @@ -10,7 +10,6 @@ public class PrivateMessageAutoMapperProfile : Profile public PrivateMessageAutoMapperProfile() { CreateMap() - .IgnoreAuditedObjectProperties() - .ReverseMap(); + .ReverseMap(); } } diff --git a/be/Modules/Message/src/Win_in.Sfs.Message.Application/UserNotifyMessages/UserNotifyMessageAutoMapperProfile.cs b/be/Modules/Message/src/Win_in.Sfs.Message.Application/UserNotifyMessages/UserNotifyMessageAutoMapperProfile.cs index c86fc455e..78ba65c1d 100644 --- a/be/Modules/Message/src/Win_in.Sfs.Message.Application/UserNotifyMessages/UserNotifyMessageAutoMapperProfile.cs +++ b/be/Modules/Message/src/Win_in.Sfs.Message.Application/UserNotifyMessages/UserNotifyMessageAutoMapperProfile.cs @@ -11,8 +11,7 @@ public partial class MessageApplicationAutoMapperProfile : Profile public void UserNotifyAutoMapperProfile() { CreateMap() - .IgnoreAuditedObjectProperties() - .BeforeMap((x, y) => y.UserId = x.CreatorId==null?Guid.Empty: x.CreatorId.Value) + .BeforeMap((x, y) => y.UserId = x.CreatorId==null?Guid.Empty: x.CreatorId.Value) .ReverseMap(); CreateMap(); diff --git a/be/Modules/Shared/src/Win_in.Sfs.Shared.Application/CachingExtensions.cs b/be/Modules/Shared/src/Win_in.Sfs.Shared.Application/CachingExtensions.cs index 80952cec2..d2c552f04 100644 --- a/be/Modules/Shared/src/Win_in.Sfs.Shared.Application/CachingExtensions.cs +++ b/be/Modules/Shared/src/Win_in.Sfs.Shared.Application/CachingExtensions.cs @@ -4,6 +4,7 @@ using System.Linq; using System.Threading.Tasks; using Microsoft.Extensions.Caching.Distributed; using Volo.Abp.Caching; +using Volo.Abp.Json; namespace Win_in.Sfs.Shared.Application; @@ -27,6 +28,10 @@ public static class CachingExtensions { TCacheItem cacheItem; + + //return await factory.Invoke().ConfigureAwait(false); + + //todo 有问题 时间转换 坑坑坑 var result = await cache.GetAsync(key).ConfigureAwait(false); if (result == null) { diff --git a/be/Modules/Shared/src/Win_in.Sfs.Shared.Application/SfsCrudWithDetailsAppServiceBase.cs b/be/Modules/Shared/src/Win_in.Sfs.Shared.Application/SfsCrudWithDetailsAppServiceBase.cs index 600523dce..fd6654cd6 100644 --- a/be/Modules/Shared/src/Win_in.Sfs.Shared.Application/SfsCrudWithDetailsAppServiceBase.cs +++ b/be/Modules/Shared/src/Win_in.Sfs.Shared.Application/SfsCrudWithDetailsAppServiceBase.cs @@ -159,8 +159,12 @@ public abstract class SfsCrudWithDetailsAppServiceBase, List>(entities); - var hasDetails = typeof(TEntity) is SfsMasterAggregateRootBase detailEntity; - return ExportImportService.Export(list, detailsProptyName: hasDetails ? nameof(detailEntity.Details) : null); + + //var hasDetails = typeof(TEntity) is SfsMasterAggregateRootBase detailEntity; + var tt = typeof(TEntity).GetBaseClasses(typeof(SfsMasterAggregateRootBase)); + var hasDetails = tt.Length > 0 ? true : false; + + return ExportImportService.Export(list,detailsProptyName: hasDetails ? nameof(TDetail) : null); } /// diff --git a/be/Modules/Shared/src/Win_in.Sfs.Shared.Domain.Shared/Enums/Job/EnumJobStatus.cs b/be/Modules/Shared/src/Win_in.Sfs.Shared.Domain.Shared/Enums/Job/EnumJobStatus.cs index dfe744d20..55467616b 100644 --- a/be/Modules/Shared/src/Win_in.Sfs.Shared.Domain.Shared/Enums/Job/EnumJobStatus.cs +++ b/be/Modules/Shared/src/Win_in.Sfs.Shared.Domain.Shared/Enums/Job/EnumJobStatus.cs @@ -1,3 +1,6 @@ +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; + namespace Win_in.Sfs.Shared.Domain.Shared; public enum EnumJobStatus @@ -5,30 +8,36 @@ public enum EnumJobStatus /// /// 空枚举 /// + [Display(Name = "空枚举")] None = 0, /// /// 待处理 /// + [Display(Name = "待处理")] Open = 1, /// /// 执行中 /// + [Display(Name = "执行中")] Doing = 2, /// /// 完成 /// + [Display(Name = "完成")] Done = 3, /// /// 关闭 /// + [Display(Name = "关闭")] Closed = 8, /// /// 作废 /// + [Display(Name = "作废")] Cancelled = 9 } diff --git a/be/Modules/Shared/src/Win_in.Sfs.Shared.Domain/Entities/SfsMasterAggregateRootBase.cs b/be/Modules/Shared/src/Win_in.Sfs.Shared.Domain/Entities/SfsMasterAggregateRootBase.cs index 02df8fc8c..4cd6d8ee4 100644 --- a/be/Modules/Shared/src/Win_in.Sfs.Shared.Domain/Entities/SfsMasterAggregateRootBase.cs +++ b/be/Modules/Shared/src/Win_in.Sfs.Shared.Domain/Entities/SfsMasterAggregateRootBase.cs @@ -67,7 +67,7 @@ public abstract class SfsMasterAggregateRootBase : SfsAggregateRootBase Details.AddRange(details); } - public void ReplaceDetail(Guid id, TDetail newDetail) + public void ReplaceDetail(Guid id,TDetail newDetail) { var detail = GetDetail(id); @@ -106,7 +106,6 @@ public abstract class SfsMasterAggregateRootBase : SfsAggregateRootBase property.SetValue(detail, newValue); } } - /* ////todo check //var detail = GetDetail(id); diff --git a/be/Modules/Shared/src/Win_in.Sfs.Shared.Host/ModuleBase.cs b/be/Modules/Shared/src/Win_in.Sfs.Shared.Host/ModuleBase.cs index 34c89f1ab..49586cc1f 100644 --- a/be/Modules/Shared/src/Win_in.Sfs.Shared.Host/ModuleBase.cs +++ b/be/Modules/Shared/src/Win_in.Sfs.Shared.Host/ModuleBase.cs @@ -1,10 +1,15 @@ using System; +using System.Configuration; using System.Data; using System.IO; using System.Linq; using System.Reflection; +using System.Runtime.Serialization; +using System.Text.Json; +using System.Text.Json.Serialization; using System.Text.RegularExpressions; using System.Threading.Tasks; +using DocumentFormat.OpenXml.InkML; using Microsoft.AspNetCore.Authentication.JwtBearer; using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.DataProtection; @@ -20,6 +25,7 @@ using Microsoft.Extensions.Hosting; using Microsoft.Extensions.Options; using Microsoft.OpenApi.Models; using NUglify.Helpers; +using Serilog.Formatting.Json; using StackExchange.Redis; using Swashbuckle.AspNetCore.SwaggerGen; using Volo.Abp; @@ -35,8 +41,11 @@ using Volo.Abp.Content; using Volo.Abp.Data; using Volo.Abp.EntityFrameworkCore; using Volo.Abp.Guids; +using Volo.Abp.Json; +using Volo.Abp.Json.SystemTextJson.JsonConverters; using Volo.Abp.Localization; using Volo.Abp.Modularity; +using Volo.Abp.Timing; using Win_in.Sfs.Shared.Application; using Win_in.Sfs.Shared.Application.Contracts.ExportAndImport; using Win_in.Sfs.Shared.Domain.Shared; @@ -70,6 +79,7 @@ public abstract class ModuleBase : AbpModule where T : AbpModule ConfigureAutoApiControllers(); ConfigureSwaggerServices(); ConfigureAddCors(); + Configure(); SetFormLimit(); ConfigureExceptionHanding(); } @@ -238,6 +248,9 @@ public abstract class ModuleBase : AbpModule where T : AbpModule protected virtual void Configure() { + //todo 解决时间 + // ServiceConfigurationContext.Services.AddTransient(); + } protected virtual void ConfigureAddCors() @@ -440,4 +453,35 @@ public abstract class ModuleBase : AbpModule where T : AbpModule options.SendExceptionsDetailsToClients = true; }); } + + /// + /// 为了处理abp的时间存入redis 在win环境读取出来报错 + /// + public class ConvertAbpJson : IJsonSerializer + { + public T Deserialize(string jsonString, bool camelCase = true) + { + return System.Text.Json.JsonSerializer.Deserialize(jsonString, GetOptions(camelCase)); + } + + public object Deserialize(Type type, string jsonString, bool camelCase = true) + { + return System.Text.Json.JsonSerializer.Deserialize(jsonString, type, GetOptions(camelCase)); + } + + public string Serialize(object obj, bool camelCase = true, bool indented = false) + { + return System.Text.Json.JsonSerializer.Serialize(obj, GetOptions(camelCase, indented)); + } + + private System.Text.Json.JsonSerializerOptions GetOptions(bool camelCase = true, bool indented = false) + { + return new System.Text.Json.JsonSerializerOptions + { + PropertyNameCaseInsensitive = camelCase, + WriteIndented = indented, + ReferenceHandler = ReferenceHandler.IgnoreCycles + }; + } + } } diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/IssueJobs/IIssueJobAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/IssueJobs/IIssueJobAppService.cs index f0d2cc33a..1b9ad5f7d 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/IssueJobs/IIssueJobAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/IssueJobs/IIssueJobAppService.cs @@ -14,4 +14,6 @@ public interface IIssueJobAppService Task> GetListByTypeAsync(SfsJobRequestInputBase requestInput, string requestType, bool includeDetails = false, CancellationToken cancellationToken = default); + + Task> GetByRequestNumberAsync(string requestNumber); } diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/UnplannedIssueJobs/DTOs/UnplannedIssueJobDetailDTO.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/UnplannedIssueJobs/DTOs/UnplannedIssueJobDetailDTO.cs index 1d656fd2c..b42d6f039 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/UnplannedIssueJobs/DTOs/UnplannedIssueJobDetailDTO.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/UnplannedIssueJobs/DTOs/UnplannedIssueJobDetailDTO.cs @@ -10,4 +10,22 @@ public class UnplannedIssueJobDetailDTO : SfsJobRecommendFromDetailDTOBase [Display(Name = "原因代码")] public string ReasonCode { get; set; } + /// + /// 专案 + /// + [Display(Name = "专案")] + public string CaseCode { get; set; } + + /// + /// 项目分类 + /// + [Display(Name = "项目分类")] + public string ProjCapacityCode { get; set; } + + /// + /// 次交易码 + /// + [Display(Name = "次交易码")] + public string OnceBusiCode { get; set; } + } diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/UnplannedIssueJobs/Inputs/UnplannedIssueJobDetailInput.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/UnplannedIssueJobs/Inputs/UnplannedIssueJobDetailInput.cs index 9aa5b26de..a0523ab5c 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/UnplannedIssueJobs/Inputs/UnplannedIssueJobDetailInput.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/UnplannedIssueJobs/Inputs/UnplannedIssueJobDetailInput.cs @@ -11,6 +11,24 @@ public class UnplannedIssueJobDetailInput : SfsJobRecommendFromDetailInputBase, [Display(Name = "原因代码")] public string ReasonCode { get; set; } + //// + /// 专案 + /// + [Display(Name = "专案")] + public string CaseCode { get; set; } + + /// + /// 项目分类 + /// + [Display(Name = "项目分类")] + public string ProjCapacityCode { get; set; } + + /// + /// 次交易码 + /// + [Display(Name = "次交易码")] + public string OnceBusiCode { get; set; } + /// /// 扩展属性 /// diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/UnplannedReceiptJobs/DTOs/UnplannedReceiptJobDetailDTO.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/UnplannedReceiptJobs/DTOs/UnplannedReceiptJobDetailDTO.cs index 8e729e1a6..916479a0f 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/UnplannedReceiptJobs/DTOs/UnplannedReceiptJobDetailDTO.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/UnplannedReceiptJobs/DTOs/UnplannedReceiptJobDetailDTO.cs @@ -1,6 +1,38 @@ +using DocumentFormat.OpenXml.Wordprocessing; +using System.ComponentModel.DataAnnotations; +using Volo.Abp.Data; + namespace Win_in.Sfs.Wms.Store.Application.Contracts; public class UnplannedReceiptJobDetailDTO : SfsJobRecommendToDetailDTOBase { + /// + /// 原因代码 + /// + [Display(Name = "原因代码")] + public string ReasonCode { get; set; } + + /// + /// 专案 + /// + [Display(Name = "专案")] + public string CaseCode { get; set; } + + /// + /// 项目分类 + /// + [Display(Name = "项目分类")] + public string ProjCapacityCode { get; set; } + + /// + /// 次交易码 + /// + [Display(Name = "次交易码")] + public string OnceBusiCode { get; set; } + /// + /// 扩展属性 + /// + [Display(Name = "扩展属性")] + public ExtraPropertyDictionary ExtraProperties { get; set; } = new ExtraPropertyDictionary(); } diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/UnplannedReceiptJobs/Inputs/UnplannedReceiptJobDetailInput.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/UnplannedReceiptJobs/Inputs/UnplannedReceiptJobDetailInput.cs index b42869a3f..a3ea7b3e3 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/UnplannedReceiptJobs/Inputs/UnplannedReceiptJobDetailInput.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/UnplannedReceiptJobs/Inputs/UnplannedReceiptJobDetailInput.cs @@ -11,6 +11,24 @@ public class UnplannedReceiptJobDetailInput : SfsJobRecommendToDetailInputBase, [Display(Name = "原因代码")] public string ReasonCode { get; set; } + /// + /// 专案 + /// + [Display(Name = "专案")] + public string CaseCode { get; set; } + + /// + /// 项目分类 + /// + [Display(Name = "项目分类")] + public string ProjCapacityCode { get; set; } + + /// + /// 次交易码 + /// + [Display(Name = "次交易码")] + public string OnceBusiCode { get; set; } + /// /// 扩展属性 /// diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/UnplannedIssueNotes/DTOs/UnplannedIssueNoteDetailDTO.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/UnplannedIssueNotes/DTOs/UnplannedIssueNoteDetailDTO.cs index f93ca2d14..efa949974 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/UnplannedIssueNotes/DTOs/UnplannedIssueNoteDetailDTO.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/UnplannedIssueNotes/DTOs/UnplannedIssueNoteDetailDTO.cs @@ -17,4 +17,22 @@ public class UnplannedIssueNoteDetailDTO : SfsStoreRecommendFromDetailWithLotPac [Display(Name = "原因代码")] public string ReasonCode { get; set; } + /// + /// 专案 + /// + [Display(Name = "专案")] + public string CaseCode { get; set; } + + /// + /// 项目分类 + /// + [Display(Name = "项目分类")] + public string ProjCapacityCode { get; set; } + + /// + /// 次交易码 + /// + [Display(Name = "次交易码")] + public string OnceBusiCode { get; set; } + } diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/UnplannedIssueNotes/Inputs/UnplannedIssueNoteDetailInput.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/UnplannedIssueNotes/Inputs/UnplannedIssueNoteDetailInput.cs index 8f3179cb4..923365b36 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/UnplannedIssueNotes/Inputs/UnplannedIssueNoteDetailInput.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/UnplannedIssueNotes/Inputs/UnplannedIssueNoteDetailInput.cs @@ -13,6 +13,24 @@ public class UnplannedIssueNoteDetailInput : SfsStoreRecommendFromDetailWithLotP [Display(Name = "原因代码")] public string ReasonCode { get; set; } + /// + /// 专案 + /// + [Display(Name = "专案")] + public string CaseCode { get; set; } + + /// + /// 项目分类 + /// + [Display(Name = "项目分类")] + public string ProjCapacityCode { get; set; } + + /// + /// 次交易码 + /// + [Display(Name = "次交易码")] + public string OnceBusiCode { get; set; } + /// /// 扩展属性 /// diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/UnplannedReceiptNotes/DTOs/UnplannedReceiptNoteDetailDTO.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/UnplannedReceiptNotes/DTOs/UnplannedReceiptNoteDetailDTO.cs index ea74d4e34..dbedb405b 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/UnplannedReceiptNotes/DTOs/UnplannedReceiptNoteDetailDTO.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/UnplannedReceiptNotes/DTOs/UnplannedReceiptNoteDetailDTO.cs @@ -16,4 +16,22 @@ public class UnplannedReceiptNoteDetailDTO : SfsStoreRecommendToDetailWithLotPac /// [Display(Name = "原因代码")] public string ReasonCode { get; set; } + + /// + /// 专案 + /// + [Display(Name = "专案")] + public string CaseCode { get; set; } + + /// + /// 项目分类 + /// + [Display(Name = "项目分类")] + public string ProjCapacityCode { get; set; } + + /// + /// 次交易码 + /// + [Display(Name = "次交易码")] + public string OnceBusiCode { get; set; } } diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/UnplannedReceiptNotes/Inputs/UnplannedReceiptNoteDetailInput.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/UnplannedReceiptNotes/Inputs/UnplannedReceiptNoteDetailInput.cs index c03b2db03..327e6af54 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/UnplannedReceiptNotes/Inputs/UnplannedReceiptNoteDetailInput.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/UnplannedReceiptNotes/Inputs/UnplannedReceiptNoteDetailInput.cs @@ -11,6 +11,24 @@ public class UnplannedReceiptNoteDetailInput : SfsStoreRecommendToDetailWithLotP [Display(Name = "原因代码")] public string ReasonCode { get; set; } + /// + /// 专案 + /// + [Display(Name = "专案")] + public string CaseCode { get; set; } + + /// + /// 项目分类 + /// + [Display(Name = "项目分类")] + public string ProjCapacityCode { get; set; } + + /// + /// 次交易码 + /// + [Display(Name = "次交易码")] + public string OnceBusiCode { get; set; } + /// /// 扩展属性 /// diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Orders/PurchaseOrders/IPurchaseOrderAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Orders/PurchaseOrders/IPurchaseOrderAppService.cs index c50180570..034ea1a1b 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Orders/PurchaseOrders/IPurchaseOrderAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Orders/PurchaseOrders/IPurchaseOrderAppService.cs @@ -29,7 +29,7 @@ public interface IPurchaseOrderAppService /// /// /// - Task UpdateDetailsAsync(string number, List input); + Task UpdateDetailsAsync(string number,List input); /// /// 【批量创建】到货通知 (收货单) diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/TransferRequests/Inputs/TransferRequestImportInput.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/TransferRequests/Inputs/TransferRequestImportInput.cs index 4c096c02d..ddd82519b 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/TransferRequests/Inputs/TransferRequestImportInput.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/TransferRequests/Inputs/TransferRequestImportInput.cs @@ -14,6 +14,8 @@ public class TransferRequestImportInput : SfsStoreImportInputBase [Required(ErrorMessage = "{0}是必填项")] [ImporterHeader(Name = "调拨类型")] [ExporterHeader(DisplayName = "调拨类型")] + [ValueMapping("区域间调拨(储位调拨)", EnumTransSubType.Transfer_Area)] + [ValueMapping("线边调拨(线边仓调拨)", EnumTransSubType.Transfer_WIP)] [ValueMapping("客户库位调拨(客户储位调拨)", EnumTransSubType.Transfer_Customer)] public string Type { get; set; } diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/UnplannedIssueRequests/DTOs/UnplannedIssueRequestDetailDTO.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/UnplannedIssueRequests/DTOs/UnplannedIssueRequestDetailDTO.cs index 129aef93c..d5ecf445f 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/UnplannedIssueRequests/DTOs/UnplannedIssueRequestDetailDTO.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/UnplannedIssueRequests/DTOs/UnplannedIssueRequestDetailDTO.cs @@ -12,4 +12,22 @@ public class UnplannedIssueRequestDetailDTO /// [Display(Name = "扩展属性")] public ExtraPropertyDictionary ExtraProperties { set; get; } = new ExtraPropertyDictionary(); + + /// + /// 专案 + /// + [Display(Name = "专案")] + public string CaseCode { get; set; } + + /// + /// 项目分类 + /// + [Display(Name = "项目分类")] + public string ProjCapacityCode { get; set; } + + /// + /// 次交易码 + /// + [Display(Name = "次交易码")] + public string OnceBusiCode { get; set; } } diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/UnplannedIssueRequests/Inputs/UnplannedIssueRequestDetailInput.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/UnplannedIssueRequests/Inputs/UnplannedIssueRequestDetailInput.cs index c5f9138bf..d052b41b3 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/UnplannedIssueRequests/Inputs/UnplannedIssueRequestDetailInput.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/UnplannedIssueRequests/Inputs/UnplannedIssueRequestDetailInput.cs @@ -10,4 +10,22 @@ public class UnplannedIssueRequestDetailInput : SfsStoreDetailWithLotPackingQtyL /// [Display(Name = "扩展属性")] public ExtraPropertyDictionary ExtraProperties { get; set; } = new ExtraPropertyDictionary(); + + /// + /// 专案 + /// + [Display(Name = "专案")] + public string CaseCode { get; set; } + + /// + /// 项目分类 + /// + [Display(Name = "项目分类")] + public string ProjCapacityCode { get; set; } + + /// + /// 次交易码 + /// + [Display(Name = "次交易码")] + public string OnceBusiCode { get; set; } } diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/UnplannedReceiptRequests/DTOs/UnplannedReceiptRequestDetailDTO.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/UnplannedReceiptRequests/DTOs/UnplannedReceiptRequestDetailDTO.cs index aa67eb319..3bedef9ee 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/UnplannedReceiptRequests/DTOs/UnplannedReceiptRequestDetailDTO.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/UnplannedReceiptRequests/DTOs/UnplannedReceiptRequestDetailDTO.cs @@ -7,6 +7,30 @@ public class UnplannedReceiptRequestDetailDTO : SfsStoreDetailWithLotPackingQtyLocationStatusDTOBase , IHasExtraProperties { + /// + /// 原因代码 + /// + [Display(Name = "原因代码")] + public string ReasonCode { get; set; } + + /// + /// 专案 + /// + [Display(Name = "专案")] + public string CaseCode { get; set; } + + /// + /// 项目分类 + /// + [Display(Name = "项目分类")] + public string ProjCapacityCode { get; set; } + + /// + /// 次交易码 + /// + [Display(Name = "次交易码")] + public string OnceBusiCode { get; set; } + /// /// 扩展属性 /// diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/UnplannedReceiptRequests/Inputs/UnplannedReceiptRequestDetailInput.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/UnplannedReceiptRequests/Inputs/UnplannedReceiptRequestDetailInput.cs index 4d527adfd..bf59628f8 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/UnplannedReceiptRequests/Inputs/UnplannedReceiptRequestDetailInput.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/UnplannedReceiptRequests/Inputs/UnplannedReceiptRequestDetailInput.cs @@ -5,6 +5,24 @@ namespace Win_in.Sfs.Wms.Store.Application.Contracts; public class UnplannedReceiptRequestDetailInput : SfsStoreDetailWithLotPackingQtyLocationInputBase, IHasExtraProperties { + /// + /// 专案 + /// + [Display(Name = "专案")] + public string CaseCode { get; set; } + + /// + /// 项目分类 + /// + [Display(Name = "项目分类")] + public string ProjCapacityCode { get; set; } + + /// + /// 次交易码 + /// + [Display(Name = "次交易码")] + public string OnceBusiCode { get; set; } + /// /// 扩展属性 /// diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Bases/SfsJobAppServiceBase.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Bases/SfsJobAppServiceBase.cs index aa9cc4b2c..8aa54abe2 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Bases/SfsJobAppServiceBase.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Bases/SfsJobAppServiceBase.cs @@ -11,6 +11,7 @@ using Volo.Abp.Validation; using Win_in.Sfs.Shared.Application; using Win_in.Sfs.Shared.Application.Contracts; using Win_in.Sfs.Shared.Domain; +using Win_in.Sfs.Shared.Domain.Shared; using Win_in.Sfs.Wms.Store.Application.Contracts; using Win_in.Sfs.Wms.Store.Domain; @@ -153,6 +154,12 @@ public abstract class SfsJobAppServiceBase CompleteAsync(Guid id, TEntityDto dto) { var handleEntity = ObjectMapper.Map(dto); + var job= await _repository.GetAsync(id).ConfigureAwait(false); + if (job.JobStatus is EnumJobStatus.Closed or EnumJobStatus.Cancelled or EnumJobStatus.None or EnumJobStatus.Done)//需要考虑下 多次提交的问题 所以不判断 进行中 + { + throw new UserFriendlyException($"任务状态错误:编号为【{job.Number}】的任务已经【{job.JobStatus.GetDisplayName()}】"); + } + var handleResult = await _jobManager.CompleteAsync(handleEntity, CurrentUser).ConfigureAwait(false); var handleDto = ObjectMapper.Map(handleResult); return handleDto; diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/ExchangeDatas/StoreApplicationAutoMapperProfile.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/ExchangeDatas/StoreApplicationAutoMapperProfile.cs index ab2640e21..0593916fd 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/ExchangeDatas/StoreApplicationAutoMapperProfile.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/ExchangeDatas/StoreApplicationAutoMapperProfile.cs @@ -10,7 +10,6 @@ public partial class StoreApplicationAutoMapperProfile : Profile private void ExchangeDataAutoMapperProfile() { CreateMap() - .IgnoreAuditedObjectProperties() .ReverseMap(); // CreateMap() // .IgnoreAuditedObjectProperties() diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/CheckJobs/CheckJobAutoMapperProfile.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/CheckJobs/CheckJobAutoMapperProfile.cs index b8ae62e62..9bcd74c3a 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/CheckJobs/CheckJobAutoMapperProfile.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/CheckJobs/CheckJobAutoMapperProfile.cs @@ -13,7 +13,6 @@ public partial class StoreApplicationAutoMapperProfile : Profile .ReverseMap(); CreateMap() - .IgnoreAuditedObjectProperties() .ReverseMap(); CreateMap() diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/CountJobs/CountJobAutoMapperProfile.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/CountJobs/CountJobAutoMapperProfile.cs index e1e543e8c..df81e992b 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/CountJobs/CountJobAutoMapperProfile.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/CountJobs/CountJobAutoMapperProfile.cs @@ -73,11 +73,9 @@ public partial class StoreApplicationAutoMapperProfile : Profile .Ignore(x => x.Details); CreateMap() - .IgnoreAuditedObjectProperties() ; CreateMap() - .IgnoreAuditedObjectProperties() ; CreateMap() diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/DeliverJobs/DeliverJobAutoMapperProfile.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/DeliverJobs/DeliverJobAutoMapperProfile.cs index f8bccdeb5..54e4efa4b 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/DeliverJobs/DeliverJobAutoMapperProfile.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/DeliverJobs/DeliverJobAutoMapperProfile.cs @@ -13,10 +13,10 @@ public partial class StoreApplicationAutoMapperProfile : Profile .ReverseMap(); CreateMap() - .IgnoreAuditedObjectProperties(); + ; CreateMap() - .IgnoreAuditedObjectProperties(); + ; CreateMap(); diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/InspectJobs/InspectJobAutoMapperProfile.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/InspectJobs/InspectJobAutoMapperProfile.cs index b12f088ce..b48a352c2 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/InspectJobs/InspectJobAutoMapperProfile.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/InspectJobs/InspectJobAutoMapperProfile.cs @@ -16,11 +16,9 @@ public partial class StoreApplicationAutoMapperProfile : Profile ; CreateMap() - .IgnoreAuditedObjectProperties() ; CreateMap() - .IgnoreAuditedObjectProperties() ; CreateMap() @@ -31,11 +29,9 @@ public partial class StoreApplicationAutoMapperProfile : Profile .Ignore(x => x.Id); CreateMap() - .IgnoreAuditedObjectProperties() ; CreateMap() - .IgnoreAuditedObjectProperties() ; CreateMap() @@ -47,7 +43,6 @@ public partial class StoreApplicationAutoMapperProfile : Profile ; CreateMap() - .IgnoreAuditedObjectProperties() .Ignore(x => x.WarehouseCode) .Ignore(x => x.Details) .Ignore(x => x.SummaryDetails) diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/IssueJobAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/IssueJobAppService.cs index 7515e713f..6ec183a2b 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/IssueJobAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/IssueJobAppService.cs @@ -8,6 +8,7 @@ using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using Volo.Abp; using Volo.Abp.Application.Dtos; +using Volo.Abp.ObjectMapping; using Win_in.Sfs.Shared.Domain; using Win_in.Sfs.Shared.Domain.Shared; using Win_in.Sfs.Wms.Store.Application.Contracts; @@ -151,6 +152,13 @@ public class IssueJobAppService } + [HttpPost("by-request-number/{requestNumber}")] + public virtual async Task> GetByRequestNumberAsync(string requestNumber) + { + var entitys = await _repository.GetListAsync(p => p.MaterialRequestNumber == requestNumber).ConfigureAwait(false); + return ObjectMapper.Map, List>(entitys); + } + /* /// /// diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/IssueJobAutoMapperProfile.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/IssueJobAutoMapperProfile.cs index f382757bc..4758bb65f 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/IssueJobAutoMapperProfile.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/IssueJobAutoMapperProfile.cs @@ -14,11 +14,9 @@ public partial class StoreApplicationAutoMapperProfile : Profile CreateMap(); CreateMap() - .IgnoreAuditedObjectProperties() ; CreateMap() - .IgnoreAuditedObjectProperties() ; CreateMap() diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/JisDeliverJobs/JisDeliverJobAutoMapperProfile.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/JisDeliverJobs/JisDeliverJobAutoMapperProfile.cs index 21a63b0c9..6e0b160b7 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/JisDeliverJobs/JisDeliverJobAutoMapperProfile.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/JisDeliverJobs/JisDeliverJobAutoMapperProfile.cs @@ -13,7 +13,6 @@ public partial class StoreApplicationAutoMapperProfile : Profile .ReverseMap(); CreateMap() - .IgnoreAuditedObjectProperties() .ReverseMap(); CreateMap() diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/ProductReceiveJobs/ProductReceiveJobAutoMapperProfile.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/ProductReceiveJobs/ProductReceiveJobAutoMapperProfile.cs index 817171844..7b9b0543a 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/ProductReceiveJobs/ProductReceiveJobAutoMapperProfile.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/ProductReceiveJobs/ProductReceiveJobAutoMapperProfile.cs @@ -13,8 +13,7 @@ public partial class StoreApplicationAutoMapperProfile : Profile .ReverseMap(); CreateMap() - .IgnoreAuditedObjectProperties() - .ReverseMap(); + .ReverseMap(); CreateMap() .IgnoreAuditedObjectProperties() diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/ProductionReturnJobs/ProductionReturnJobAutoMapperProfile.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/ProductionReturnJobs/ProductionReturnJobAutoMapperProfile.cs index 6eead08ba..2435e9d3b 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/ProductionReturnJobs/ProductionReturnJobAutoMapperProfile.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/ProductionReturnJobs/ProductionReturnJobAutoMapperProfile.cs @@ -13,7 +13,6 @@ public partial class StoreApplicationAutoMapperProfile : Profile .ReverseMap(); CreateMap() - .IgnoreAuditedObjectProperties() ; CreateMap(); @@ -26,7 +25,6 @@ public partial class StoreApplicationAutoMapperProfile : Profile .Ignore(x => x.Id); CreateMap() - .IgnoreAuditedObjectProperties() ; } diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/PurchaseReceiptJobs/PurchaseReceiptJobAutoMapperProfile.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/PurchaseReceiptJobs/PurchaseReceiptJobAutoMapperProfile.cs index 963b4b5b3..0c9469123 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/PurchaseReceiptJobs/PurchaseReceiptJobAutoMapperProfile.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/PurchaseReceiptJobs/PurchaseReceiptJobAutoMapperProfile.cs @@ -16,11 +16,9 @@ public partial class StoreApplicationAutoMapperProfile : Profile ; CreateMap() - .IgnoreAuditedObjectProperties() ; CreateMap() - .IgnoreAuditedObjectProperties() ; CreateMap() diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/PurchaseReturnJobs/PurchaseReturnJobAutoMapperProfile.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/PurchaseReturnJobs/PurchaseReturnJobAutoMapperProfile.cs index f486e014c..2ca4390c6 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/PurchaseReturnJobs/PurchaseReturnJobAutoMapperProfile.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/PurchaseReturnJobs/PurchaseReturnJobAutoMapperProfile.cs @@ -13,7 +13,6 @@ public partial class StoreApplicationAutoMapperProfile : Profile .ReverseMap(); CreateMap() - .IgnoreAuditedObjectProperties() .ReverseMap(); CreateMap() diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/UnplannedIssueJobs/UnplannedIssueJobAutoMapperProfile.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/UnplannedIssueJobs/UnplannedIssueJobAutoMapperProfile.cs index dec115e62..5ecdd3e85 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/UnplannedIssueJobs/UnplannedIssueJobAutoMapperProfile.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/UnplannedIssueJobs/UnplannedIssueJobAutoMapperProfile.cs @@ -13,7 +13,6 @@ public partial class StoreApplicationAutoMapperProfile : Profile .ReverseMap(); CreateMap() - .IgnoreAuditedObjectProperties() .ReverseMap(); CreateMap() diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/UnplannedReceiptJobs/UnplannedReceiptJobAutoMapperProfile.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/UnplannedReceiptJobs/UnplannedReceiptJobAutoMapperProfile.cs index 8591cf74a..1716b485c 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/UnplannedReceiptJobs/UnplannedReceiptJobAutoMapperProfile.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/UnplannedReceiptJobs/UnplannedReceiptJobAutoMapperProfile.cs @@ -13,7 +13,6 @@ public partial class StoreApplicationAutoMapperProfile : Profile .ReverseMap(); CreateMap() - .IgnoreAuditedObjectProperties() .ReverseMap(); CreateMap() diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/BackFlushNotes/BackFlushNoteAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/BackFlushNotes/BackFlushNoteAppService.cs index ff86c9f94..90f9f8fd1 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/BackFlushNotes/BackFlushNoteAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/BackFlushNotes/BackFlushNoteAppService.cs @@ -43,5 +43,4 @@ public class BackFlushNoteAppService : return ObjectMapper.Map, List>(entities); } - } diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/ContainerBindNotes/ContainerBindNoteAutoMapperProfile.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/ContainerBindNotes/ContainerBindNoteAutoMapperProfile.cs index d3969a17c..24c1894f3 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/ContainerBindNotes/ContainerBindNoteAutoMapperProfile.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/ContainerBindNotes/ContainerBindNoteAutoMapperProfile.cs @@ -13,7 +13,6 @@ public partial class StoreApplicationAutoMapperProfile : Profile .ReverseMap(); CreateMap() - .IgnoreAuditedObjectProperties() .ReverseMap(); CreateMap() diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/CountNotes/CountNoteAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/CountNotes/CountNoteAppService.cs index 278f8a52c..47cdf7440 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/CountNotes/CountNoteAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/CountNotes/CountNoteAppService.cs @@ -24,7 +24,14 @@ namespace Win_in.Sfs.Wms.Store.Application; [Route($"{StoreConsts.RootPath}count-note")] public class CountNoteAppService : - SfsStoreWithDetailsAppServiceBase, + SfsStoreWithDetailsAppServiceBase, ICountNoteAppService { private readonly ICountNoteManager _countNoteManager; @@ -35,7 +42,10 @@ public class CountNoteAppService : public CountNoteAppService( ICountNoteRepository repository, - ICountNoteManager countNoteManager, ICountPlanAppService countPlanAppService, ILocationAppService locationAppService, IItemBasicAppService itemBasicAppService) : base(repository) + ICountNoteManager countNoteManager, + ICountPlanAppService countPlanAppService, + ILocationAppService locationAppService, + IItemBasicAppService itemBasicAppService) : base(repository) { _countNoteManager = countNoteManager; _countPlanAppService = countPlanAppService; diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/JisProductReceiptNotes/JisProductReceiptNoteAutoMapperProfile.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/JisProductReceiptNotes/JisProductReceiptNoteAutoMapperProfile.cs index bae5c6578..f4e2446a3 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/JisProductReceiptNotes/JisProductReceiptNoteAutoMapperProfile.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/JisProductReceiptNotes/JisProductReceiptNoteAutoMapperProfile.cs @@ -13,7 +13,6 @@ public partial class StoreApplicationAutoMapperProfile : Profile .ReverseMap(); CreateMap() - .IgnoreAuditedObjectProperties() .Ignore(x => x.ProdLine) .ReverseMap(); diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/ProductReceiptNotes/ProductReceiptNoteAutoMapperProfile.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/ProductReceiptNotes/ProductReceiptNoteAutoMapperProfile.cs index cb730c146..7bfc7fd9f 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/ProductReceiptNotes/ProductReceiptNoteAutoMapperProfile.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/ProductReceiptNotes/ProductReceiptNoteAutoMapperProfile.cs @@ -13,7 +13,6 @@ public partial class StoreApplicationAutoMapperProfile : Profile .ReverseMap(); CreateMap() - .IgnoreAuditedObjectProperties() .Ignore(x => x.ProdLine) .ReverseMap(); diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/PurchaseReceiptNotes/PurchaseReceiptNoteAutoMapperProfile.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/PurchaseReceiptNotes/PurchaseReceiptNoteAutoMapperProfile.cs index cfc41e44f..b4877764b 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/PurchaseReceiptNotes/PurchaseReceiptNoteAutoMapperProfile.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/PurchaseReceiptNotes/PurchaseReceiptNoteAutoMapperProfile.cs @@ -14,7 +14,6 @@ public partial class StoreApplicationAutoMapperProfile : Profile .ReverseMap(); CreateMap() - .IgnoreAuditedObjectProperties() .ReverseMap(); CreateMap() diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/PurchaseReturnNotes/PurchaseReturnNoteAutoMapperProfile.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/PurchaseReturnNotes/PurchaseReturnNoteAutoMapperProfile.cs index bc12055ab..ce58489bc 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/PurchaseReturnNotes/PurchaseReturnNoteAutoMapperProfile.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/PurchaseReturnNotes/PurchaseReturnNoteAutoMapperProfile.cs @@ -13,7 +13,6 @@ public partial class StoreApplicationAutoMapperProfile : Profile .ReverseMap(); CreateMap() - .IgnoreAuditedObjectProperties() .ReverseMap(); CreateMap() diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/ReceiptAbnormalNotes/ReceiptAbnormalNoteAutoMapperProfile.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/ReceiptAbnormalNotes/ReceiptAbnormalNoteAutoMapperProfile.cs index 3532b2ca5..f92e2ca8f 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/ReceiptAbnormalNotes/ReceiptAbnormalNoteAutoMapperProfile.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/ReceiptAbnormalNotes/ReceiptAbnormalNoteAutoMapperProfile.cs @@ -13,7 +13,6 @@ public partial class StoreApplicationAutoMapperProfile : Profile .ReverseMap(); CreateMap() - .IgnoreAuditedObjectProperties() .ReverseMap(); CreateMap() diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/RecycledMaterialReceiptNotes/RecycledMaterialReceiptNoteAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/RecycledMaterialReceiptNotes/RecycledMaterialReceiptNoteAppService.cs index ba42b49cf..3e09d396c 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/RecycledMaterialReceiptNotes/RecycledMaterialReceiptNoteAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/RecycledMaterialReceiptNotes/RecycledMaterialReceiptNoteAppService.cs @@ -49,31 +49,32 @@ public class RecycledMaterialReceiptNoteAppService : [HttpPost("")] public override async Task CreateAsync(RecycledMaterialReceiptNoteEditInput input) { - var entity= ObjectMapper.Map(input); + var entity = ObjectMapper.Map(input); - entity.Number=string.IsNullOrEmpty(input.Number) + entity.Number = string.IsNullOrEmpty(input.Number) ? await GenerateNumberAsync(nameof(RecycledMaterialReceiptNote), input.ActiveDate) .ConfigureAwait(false) : input.Number; + entity.SetId(GuidGenerator.Create()); foreach (var detail in entity.Details) { var detailNumber = await GenerateNumberAsync(nameof(RecycledMaterialReceiptNote), input.ActiveDate) .ConfigureAwait(false); - detail.Number=detailNumber; + detail.SetIdAndNumber(GuidGenerator, entity.Id, detailNumber); var locationDto = await _locationAppService.GetByCodeAsync(detail.LocationCode).ConfigureAwait(false); detail.LocationErpCode = locationDto.ErpLocationCode; detail.LocationArea = locationDto.AreaCode; detail.LocationGroup = locationDto.LocationGroupCode; - detail.WarehouseCode=locationDto.WarehouseCode; - var itemBasicDto=await _itemBasicAppService.GetByCodeAsync(detail.ItemCode).ConfigureAwait(false); + detail.WarehouseCode = locationDto.WarehouseCode; + var itemBasicDto = await _itemBasicAppService.GetByCodeAsync(detail.ItemCode).ConfigureAwait(false); detail.StdPackQty = itemBasicDto.StdPackQty; detail.Uom = itemBasicDto.BasicUom; } - entity=await _repository.InsertAsync(entity).ConfigureAwait(false); + entity = await _repository.InsertAsync(entity).ConfigureAwait(false); - await LocalEventBus.PublishAsync(new SfsCreatedEntityEventData(entity),false).ConfigureAwait(false); + await LocalEventBus.PublishAsync(new SfsCreatedEntityEventData(entity), false).ConfigureAwait(false); return ObjectMapper.Map(entity); } diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/RecycledMaterialReceiptNotes/RecycledMaterialReceiptNoteAutoMapperProfile.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/RecycledMaterialReceiptNotes/RecycledMaterialReceiptNoteAutoMapperProfile.cs index 35ee6a020..4ac78addc 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/RecycledMaterialReceiptNotes/RecycledMaterialReceiptNoteAutoMapperProfile.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/RecycledMaterialReceiptNotes/RecycledMaterialReceiptNoteAutoMapperProfile.cs @@ -13,7 +13,6 @@ public partial class StoreApplicationAutoMapperProfile : Profile .ReverseMap(); CreateMap() - .IgnoreAuditedObjectProperties() .ReverseMap(); CreateMap() diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/ScrapNotes/ScrapNoteAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/ScrapNotes/ScrapNoteAppService.cs index 9407d0b7e..2316a0843 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/ScrapNotes/ScrapNoteAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/ScrapNotes/ScrapNoteAppService.cs @@ -7,6 +7,7 @@ using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using Volo.Abp.Application.Dtos; using Volo.Abp.EventBus; +using Win_in.Sfs.Basedata.Application.Contracts; using Win_in.Sfs.Wms.Store.Application.Contracts; using Win_in.Sfs.Wms.Store.Domain; using Win_in.Sfs.Wms.Store.Domain.Shared; @@ -27,9 +28,14 @@ public class ScrapNoteAppService : ScrapNoteDetail, ScrapNoteDetailDTO, SfsStoreRequestInputBase, ScrapNoteImportInput>, IScrapNoteAppService { + private readonly ILocationAppService _locationAppService; + private readonly IItemBasicAppService _itemBasicAppService; + public ScrapNoteAppService( - IScrapNoteRepository repository) : base(repository) + IScrapNoteRepository repository, ILocationAppService locationAppService, IItemBasicAppService itemBasicAppService) : base(repository) { + _locationAppService = locationAppService; + _itemBasicAppService = itemBasicAppService; } [HttpPost("")] @@ -42,7 +48,24 @@ public class ScrapNoteAppService : foreach (var detail in entity.Details) { + var fromLocation=await _locationAppService.GetByCodeAsync(detail.FromLocationCode).ConfigureAwait(false); + var toLocation =await _locationAppService.GetByCodeAsync(detail.ToLocationCode).ConfigureAwait(false); + var itemBasicDto =await _itemBasicAppService.GetByCodeAsync(detail.ItemCode).ConfigureAwait(false); + detail.SetIdAndNumber(GuidGenerator, entity.Id, entity.Number); + detail.FromLocationArea = fromLocation.AreaCode; + detail.FromLocationErpCode = fromLocation.ErpLocationCode; + detail.FromLocationGroup = fromLocation.LocationGroupCode; + detail.FromWarehouseCode = fromLocation.WarehouseCode; + + detail.ToLocationArea = toLocation.AreaCode; + detail.ToLocationErpCode = toLocation.ErpLocationCode; + detail.ToLocationGroup = toLocation.LocationGroupCode; + detail.ToWarehouseCode = toLocation.WarehouseCode; + + detail.ToStatus = detail.FromStatus; + detail.Uom = itemBasicDto.BasicUom; + detail.StdPackQty = itemBasicDto.StdPackQty; } entity = await _repository.InsertAsync(entity).ConfigureAwait(false); diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Orders/PurchaseOrders/PurchaseOrderAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Orders/PurchaseOrders/PurchaseOrderAppService.cs index 5967d9876..c66e42ebc 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Orders/PurchaseOrders/PurchaseOrderAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Orders/PurchaseOrders/PurchaseOrderAppService.cs @@ -8,6 +8,7 @@ using Microsoft.AspNetCore.Mvc; using Microsoft.EntityFrameworkCore; using Volo.Abp; using Win_in.Sfs.Basedata.Application.Contracts; +using Win_in.Sfs.Shared.Domain; using Win_in.Sfs.Shared.Domain.Shared; using Win_in.Sfs.Wms.Store.Application.Contracts; using Win_in.Sfs.Wms.Store.Domain; @@ -57,7 +58,7 @@ public class PurchaseOrderAppService : foreach (var purchaseOrder in addList) { purchaseOrder.CreatorId = CurrentUser.Id; - purchaseOrder.Worker = CurrentUser.Name; + purchaseOrder.Worker = CurrentUser.GetName(); var supplierDto = await _supplierAppService.GetByCodeAsync(purchaseOrder.SupplierCode).ConfigureAwait(false); diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Orders/PurchaseOrders/PurchaseOrderAutoMapperProfile.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Orders/PurchaseOrders/PurchaseOrderAutoMapperProfile.cs index 2ef9b67b1..bff9c5e7d 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Orders/PurchaseOrders/PurchaseOrderAutoMapperProfile.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Orders/PurchaseOrders/PurchaseOrderAutoMapperProfile.cs @@ -13,7 +13,6 @@ public partial class StoreApplicationAutoMapperProfile : Profile .ReverseMap(); CreateMap() - .IgnoreAuditedObjectProperties() .ReverseMap(); CreateMap() diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Orders/SaleOrders/SaleOrderAutoMapperProfile.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Orders/SaleOrders/SaleOrderAutoMapperProfile.cs index 7006bf3f2..93c75bbf8 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Orders/SaleOrders/SaleOrderAutoMapperProfile.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Orders/SaleOrders/SaleOrderAutoMapperProfile.cs @@ -13,7 +13,6 @@ public partial class StoreApplicationAutoMapperProfile : Profile .ReverseMap(); CreateMap() - .IgnoreAuditedObjectProperties() .ReverseMap(); CreateMap() diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Plans/CountPlans/CountPlanAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Plans/CountPlans/CountPlanAppService.cs index de9cea2ea..cf4254513 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Plans/CountPlans/CountPlanAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Plans/CountPlans/CountPlanAppService.cs @@ -23,7 +23,14 @@ using Win_in.Sfs.Shared.Domain; [Route($"{StoreConsts.RootPath}count-plan")] public class CountPlanAppService : - SfsStoreRequestAppServiceBase, + SfsStoreRequestAppServiceBase, ICountPlanAppService { diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Plans/CountPlans/CountPlanAutoMapperProfile.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Plans/CountPlans/CountPlanAutoMapperProfile.cs index fbac04195..cb7430c66 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Plans/CountPlans/CountPlanAutoMapperProfile.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Plans/CountPlans/CountPlanAutoMapperProfile.cs @@ -29,7 +29,6 @@ public partial class StoreApplicationAutoMapperProfile : Profile .ReverseMap(); CreateMap() - .IgnoreAuditedObjectProperties() .Ignore(x => x.DiffQty) .ReverseMap(); diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Plans/PreparationPlans/PreparationPlanAutoMapperProfile.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Plans/PreparationPlans/PreparationPlanAutoMapperProfile.cs index 90a14f582..bd3697b54 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Plans/PreparationPlans/PreparationPlanAutoMapperProfile.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Plans/PreparationPlans/PreparationPlanAutoMapperProfile.cs @@ -10,7 +10,6 @@ public partial class StoreApplicationAutoMapperProfile : Profile private void PreparationPlanAutoMapperProfile() { CreateMap() - .IgnoreAuditedObjectProperties() .ReverseMap(); CreateMap() diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/DeliverRequests/DeliverRequestFisAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/DeliverRequests/DeliverRequestFisAppService.cs index 484fe8dfb..2a980b30b 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/DeliverRequests/DeliverRequestFisAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/DeliverRequests/DeliverRequestFisAppService.cs @@ -115,7 +115,7 @@ public class DeliverRequestFisAppService : detail.ItemDesc2 = itemBasicDto.Desc2; detail.ItemName = itemBasicDto.Name; detail.Uom = itemBasicDto.BasicUom; - + detail.StdPackQty=itemBasicDto.StdPackQty; } } diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/InspectRequests/InspectRequestAutoMapperProfile.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/InspectRequests/InspectRequestAutoMapperProfile.cs index 2e27bf9ac..239fd3a30 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/InspectRequests/InspectRequestAutoMapperProfile.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/InspectRequests/InspectRequestAutoMapperProfile.cs @@ -14,7 +14,7 @@ public partial class StoreApplicationAutoMapperProfile : Profile .ReverseMap(); CreateMap() - .IgnoreAuditedObjectProperties(); + ; CreateMap() .IgnoreAuditedObjectProperties() diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/ItemTransformRequests/ItemTransformRequestAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/ItemTransformRequests/ItemTransformRequestAppService.cs index 647f38610..c2e79752c 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/ItemTransformRequests/ItemTransformRequestAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/ItemTransformRequests/ItemTransformRequestAppService.cs @@ -75,9 +75,11 @@ public class ItemTransformRequestAppService : { var fromLocationDto= await LocationAclService.GetByCodeAsync(detail.FromLocationCode).ConfigureAwait(false); var toLocationDto= await LocationAclService.GetByCodeAsync(detail.ToLocationCode).ConfigureAwait(false); - var itemBasicDto=await ItemBasicAclService.GetByCodeAsync(detail.ItemCode).ConfigureAwait(false); + var fromItemBasicDto=await ItemBasicAclService.GetByCodeAsync(detail.ItemCode).ConfigureAwait(false); + var toItemBasicDto = await ItemBasicAclService.GetByCodeAsync(detail.ToItemCode).ConfigureAwait(false); var balanceDto= await _balanceAppService.GetByItemLocationAndPackingAsync(detail.FromPackingCode, detail.ItemCode, detail.FromLocationCode).ConfigureAwait(false); + var inventoryLabelDto= await _inventoryLabelAppService.GetByCodeAsync(detail.ToPackingCode).ConfigureAwait(false); detail.FromLocationArea = fromLocationDto.AreaCode; detail.FromLocationErpCode = fromLocationDto.ErpLocationCode; @@ -89,7 +91,7 @@ public class ItemTransformRequestAppService : detail.FromStatus = balanceDto.Status; detail.ToSupplierBatch = string.Empty; - detail.ToLot = balanceDto.Lot; + detail.ToLot = inventoryLabelDto.Lot; detail.ToStatus = balanceDto.Status; detail.ToLocationArea = toLocationDto.AreaCode; @@ -97,10 +99,15 @@ public class ItemTransformRequestAppService : detail.ToLocationGroup = toLocationDto.LocationGroupCode; detail.ToWarehouseCode = toLocationDto.WarehouseCode; - detail.ItemDesc1 = itemBasicDto.Desc1; - detail.ItemDesc2= itemBasicDto.Desc2; - detail.ItemName= itemBasicDto.Name; - detail.Uom = itemBasicDto.BasicUom; + detail.ItemDesc1 = fromItemBasicDto.Desc1; + detail.ItemDesc2= fromItemBasicDto.Desc2; + detail.ItemName= fromItemBasicDto.Name; + detail.Uom = fromItemBasicDto.BasicUom; + + detail.ToItemCode = toItemBasicDto.Code; + detail.ToItemDesc1 = toItemBasicDto.Desc1; + detail.ToItemDesc2 = toItemBasicDto.Desc2; + detail.ToItemName = toItemBasicDto.Name; } } diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/ItemTransformRequests/ItemTransformRequestAutoMapperProfile.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/ItemTransformRequests/ItemTransformRequestAutoMapperProfile.cs index 4e7dd161f..72add1c78 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/ItemTransformRequests/ItemTransformRequestAutoMapperProfile.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/ItemTransformRequests/ItemTransformRequestAutoMapperProfile.cs @@ -13,7 +13,6 @@ public partial class StoreApplicationAutoMapperProfile : Profile .ReverseMap(); CreateMap() - .IgnoreAuditedObjectProperties() .ForMember(x => x.ToItemName, y => y.MapFrom(d => d.ToItemName)) .ForMember(x => x.ToItemDesc1, y => y.MapFrom(d => d.ToItemDesc1)) .ForMember(x => x.ToItemDesc2, y => y.MapFrom(d => d.ToItemDesc2)) diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/MaterialRequests/MaterialRequestAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/MaterialRequests/MaterialRequestAppService.cs index 7a3ddd00b..bf07d2a39 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/MaterialRequests/MaterialRequestAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/MaterialRequests/MaterialRequestAppService.cs @@ -5,6 +5,7 @@ using System.Linq; using System.Linq.Expressions; using System.Threading; using System.Threading.Tasks; +using DocumentFormat.OpenXml.Office.PowerPoint.Y2021.M06.Main; using IdentityModel; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; @@ -43,15 +44,17 @@ public class MaterialRequestAppService : SfsStoreRequestAppServiceBase() - .IgnoreAuditedObjectProperties() .ReverseMap(); CreateMap() diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/ProductionReturnRequests/ProductionReturnRequestAutoMapperProfile.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/ProductionReturnRequests/ProductionReturnRequestAutoMapperProfile.cs index 18c6c170f..c5d12102a 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/ProductionReturnRequests/ProductionReturnRequestAutoMapperProfile.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/ProductionReturnRequests/ProductionReturnRequestAutoMapperProfile.cs @@ -13,7 +13,6 @@ public partial class StoreApplicationAutoMapperProfile : Profile .ReverseMap(); CreateMap() - .IgnoreAuditedObjectProperties() .ReverseMap(); CreateMap(); diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/PurchaseReturnRequests/PurchaseReturnRequestAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/PurchaseReturnRequests/PurchaseReturnRequestAppService.cs index d07e428e6..8adf9ce95 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/PurchaseReturnRequests/PurchaseReturnRequestAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/PurchaseReturnRequests/PurchaseReturnRequestAppService.cs @@ -37,18 +37,20 @@ public class PurchaseReturnRequestAppService : private readonly ILocationAppService _locationAppService; private readonly ITransactionTypeAppService _transactionTypeAppService; private readonly IPurchaseReturnRequestManager _purchaseReturnRequestManager; - + private readonly IPurchaseOrderAppService _purchaseOrderAppService; public PurchaseReturnRequestAppService( IPurchaseReturnRequestRepository repository, IPurchaseReturnRequestManager purchaseReturnRequestManager, IInventoryLabelAppService inventoryLabelApp, ILocationAppService locationAppService, - ITransactionTypeAppService transactionTypeAppService) : base(repository, purchaseReturnRequestManager) + ITransactionTypeAppService transactionTypeAppService, + IPurchaseOrderAppService purchaseOrderAppService) : base(repository, purchaseReturnRequestManager) { _purchaseReturnRequestManager = purchaseReturnRequestManager; _inventoryLabelApp = inventoryLabelApp; _locationAppService = locationAppService; _transactionTypeAppService = transactionTypeAppService; + _purchaseOrderAppService = purchaseOrderAppService; base.CreatePolicyName = PurchaseReturnRequestPermissions.Create; base.UpdatePolicyName = PurchaseReturnRequestPermissions.Update; @@ -97,13 +99,16 @@ public class PurchaseReturnRequestAppService : var labelDto = await _inventoryLabelApp.GetByCodeAsync(detail.PackingCode).ConfigureAwait(false); var balanceDto = await BalanceAclService.GetByPackingCodeAsync(detail.PackingCode).ConfigureAwait(false); var locationDto= await _locationAppService.GetByCodeAsync(balanceDto.LocationCode).ConfigureAwait(false); + var purchaseOrderDto= await _purchaseOrderAppService.GetByNumberAsync(labelDto.PoNumber).ConfigureAwait(false); + purchaseOrderDto = await _purchaseOrderAppService.GetAsync(purchaseOrderDto.Id).ConfigureAwait(false); + purchaseReturnRequest.AsnNumber = labelDto.AsnNumber; purchaseReturnRequest.RpNumber = labelDto.RpNumber; purchaseReturnRequest.ReturnTime=DateTime.Now; purchaseReturnRequest.SupplierCode= labelDto.SupplierCode; purchaseReturnRequest.ReturnType = EnumPurchaseReturnType.AfterPuton; purchaseReturnRequest.PoNumber = labelDto.PoNumber; - await SetDetailPropertiesAsync(detail, labelDto, balanceDto,locationDto).ConfigureAwait(false); + await SetDetailPropertiesAsync(detail, labelDto, balanceDto,locationDto, purchaseOrderDto).ConfigureAwait(false); } } @@ -135,12 +140,15 @@ public class PurchaseReturnRequestAppService : /// /// /// + /// /// private async Task SetDetailPropertiesAsync( PurchaseReturnRequestDetail detail, InventoryLabelDto labelDto, BalanceDTO balanceDto, - LocationDTO locationDto) + LocationDTO locationDto, + PurchaseOrderDTO purchaseOrderDto + ) { if (labelDto != null) { @@ -171,6 +179,12 @@ public class PurchaseReturnRequestAppService : detail.StdPackQty = balanceDto.StdPackQty; detail.Qty = balanceDto.Qty; } + + if (purchaseOrderDto != null) + { + detail.PoLine = + purchaseOrderDto.Details.FirstOrDefault(p => p.ItemCode == balanceDto.ItemCode && p.Lot == balanceDto.Lot).PoLine; + } } #endregion diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/ScrapRequests/ScrapRequestAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/ScrapRequests/ScrapRequestAppService.cs index be7623764..d23d8c20f 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/ScrapRequests/ScrapRequestAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/ScrapRequests/ScrapRequestAppService.cs @@ -70,20 +70,22 @@ public class ScrapRequestAppService : SfsStoreRequestAppServiceBase scrapRequest.Type = scrapRequest.Type; EnumTransSubType enumTransSubType = 0; - if (scrapRequest.Type == "原料报废") { enumTransSubType = EnumTransSubType.Scrap_Manual; + scrapRequest.Type = EnumTransSubType.Scrap_Manual.ToString(); } if (scrapRequest.Type== "线边报废") { enumTransSubType = EnumTransSubType.Scrap_WIP; + scrapRequest.Type = EnumTransSubType.Scrap_WIP.ToString(); } if (scrapRequest.Type == "完工报废") { enumTransSubType = EnumTransSubType.Scrap_Product; + scrapRequest.Type= EnumTransSubType.Scrap_Product.ToString(); } await SetEntityPropertiesAsync(scrapRequest, enumTransSubType).ConfigureAwait(false); diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/TransferRequests/TransferRequestAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/TransferRequests/TransferRequestAppService.cs index 409de9b89..c0b214534 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/TransferRequests/TransferRequestAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/TransferRequests/TransferRequestAppService.cs @@ -64,54 +64,87 @@ public class TransferRequestAppService : SfsStoreRequestAppServiceBase foreach (var transferRequest in addList) { - if (transferRequest.Type == EnumTransSubType.Transfer_Customer.GetDisplayName()) //客户储位调拨 + EnumTransSubType enumTransSubType = EnumTransSubType.None; + + //储位 + if (transferRequest.Type == EnumTransSubType.Transfer_Area.GetDisplayName()) + { + transferRequest.Type = EnumTransSubType.Transfer_Area.ToString(); //重点 需要转换 + enumTransSubType = EnumTransSubType.Transfer_Area; + transferRequest.UseOnTheWayLocation = false; + } + //储位内 + if (transferRequest.Type == EnumTransSubType.Transfer_Inside.GetDisplayName()) + { + transferRequest.Type = EnumTransSubType.Transfer_Inside.ToString(); //重点 需要转换 + enumTransSubType = EnumTransSubType.Transfer_Inside; + transferRequest.UseOnTheWayLocation = false; + } + + //库间 + if (transferRequest.Type == EnumTransSubType.Transfer_Warehouse.GetDisplayName()) + { + transferRequest.Type = EnumTransSubType.Transfer_Warehouse.ToString(); //重点 需要转换 + enumTransSubType = EnumTransSubType.Transfer_Warehouse; + transferRequest.UseOnTheWayLocation = true; + } + //客户储位 + if (transferRequest.Type == EnumTransSubType.Transfer_Customer.GetDisplayName()) { transferRequest.Type = EnumTransSubType.Transfer_Customer.ToString(); //重点 需要转换 + enumTransSubType = EnumTransSubType.Transfer_Customer; + transferRequest.UseOnTheWayLocation = true; + } + //线边调拨 + if (transferRequest.Type == EnumTransSubType.Transfer_WIP.GetDisplayName()) + { + transferRequest.Type = EnumTransSubType.Transfer_WIP.ToString(); //重点 需要转换 + enumTransSubType = EnumTransSubType.Transfer_WIP; transferRequest.UseOnTheWayLocation = true; + } - foreach (var detail in transferRequest.Details) - { - var balanceDto = await _balanceAppService.GetByItemLocationAndPackingAsync(detail.FromPackingCode, - detail.ItemCode, detail.FromLocationCode).ConfigureAwait(false); - var toLocationDto = await _locationAppService.GetByCodeAsync(detail.ToLocationCode) - .ConfigureAwait(false); - - detail.ItemCode = balanceDto.ItemCode; - detail.ArriveDate = balanceDto.ArriveDate; - detail.ItemDesc1 = balanceDto.ItemDesc1; - detail.ItemDesc2 = balanceDto.ItemDesc2; - detail.ItemName = balanceDto.ItemName; - detail.ProduceDate = balanceDto.ProduceDate; - detail.Qty = balanceDto.Qty; - detail.Uom = balanceDto.Uom; - detail.ExpireDate = balanceDto.ExpireDate; - detail.StdPackQty = balanceDto.StdPackQty; - detail.SupplierBatch = balanceDto.SupplierBatch; - - detail.FromLocationArea = balanceDto.LocationArea; - detail.FromContainerCode = balanceDto.ContainerCode; - detail.FromLocationErpCode = balanceDto.LocationErpCode; - detail.FromLocationGroup = balanceDto.LocationGroup; - detail.FromPackingCode = balanceDto.PackingCode; - detail.FromLocationArea = balanceDto.LocationArea; - detail.FromStatus = balanceDto.Status; - detail.FromWarehouseCode = balanceDto.WarehouseCode; - detail.FromLot = balanceDto.Lot; - - detail.ToLocationArea = toLocationDto.AreaCode; - detail.ToLocationErpCode = toLocationDto.LocationGroupCode; - detail.ToLocationGroup = toLocationDto.LocationGroupCode; - detail.ToWarehouseCode = toLocationDto.WarehouseCode; - detail.ToContainerCode = balanceDto.ContainerCode; - detail.ToPackingCode = balanceDto.PackingCode; - detail.ToLocationArea = balanceDto.LocationArea; - detail.ToStatus = balanceDto.Status; - detail.ToLot = balanceDto.Lot; - } - - await SetEntityPropertiesAsync(transferRequest, EnumTransSubType.Transfer_Customer) + foreach (var detail in transferRequest.Details) + { + var balanceDto = await _balanceAppService.GetByItemLocationAndPackingAsync(detail.FromPackingCode, + detail.ItemCode, detail.FromLocationCode).ConfigureAwait(false); + var toLocationDto = await _locationAppService.GetByCodeAsync(detail.ToLocationCode) .ConfigureAwait(false); + + detail.ItemCode = balanceDto.ItemCode; + detail.ArriveDate = balanceDto.ArriveDate; + detail.ItemDesc1 = balanceDto.ItemDesc1; + detail.ItemDesc2 = balanceDto.ItemDesc2; + detail.ItemName = balanceDto.ItemName; + detail.ProduceDate = balanceDto.ProduceDate; + detail.Qty = detail.Qty; + detail.Uom = balanceDto.Uom; + detail.ExpireDate = balanceDto.ExpireDate; + detail.StdPackQty = balanceDto.StdPackQty; + detail.SupplierBatch = balanceDto.SupplierBatch; + + detail.FromLocationArea = balanceDto.LocationArea; + detail.FromContainerCode = balanceDto.ContainerCode; + detail.FromLocationErpCode = balanceDto.LocationErpCode; + detail.FromLocationGroup = balanceDto.LocationGroup; + detail.FromPackingCode = balanceDto.PackingCode; + detail.FromLocationArea = balanceDto.LocationArea; + detail.FromStatus = balanceDto.Status; + detail.FromWarehouseCode = balanceDto.WarehouseCode; + detail.FromLot = balanceDto.Lot; + + detail.ToLocationArea = toLocationDto.AreaCode; + detail.ToLocationErpCode = toLocationDto.LocationGroupCode; + detail.ToLocationGroup = toLocationDto.LocationGroupCode; + detail.ToWarehouseCode = toLocationDto.WarehouseCode; + detail.ToContainerCode = balanceDto.ContainerCode; + detail.ToPackingCode = balanceDto.PackingCode; + detail.ToLocationArea = balanceDto.LocationArea; + detail.ToStatus = balanceDto.Status; + detail.ToLot = balanceDto.Lot; } + + await SetEntityPropertiesAsync(transferRequest, enumTransSubType) + .ConfigureAwait(false); } return dictionary; diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/UnplannedIssueRequests/UnplannedIssueRequestForDongyangAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/UnplannedIssueRequests/UnplannedIssueRequestForDongyangAppService.cs index 630967205..77e876b6f 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/UnplannedIssueRequests/UnplannedIssueRequestForDongyangAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/UnplannedIssueRequests/UnplannedIssueRequestForDongyangAppService.cs @@ -107,7 +107,7 @@ public class UnplannedIssueRequestForDongyangAppService : UnplannedIssueRequestA detail.Lot = balance.Lot; detail.ContainerCode = balance.ContainerCode; detail.PackingCode = balance.PackingCode; - detail.Qty = balance.Qty; + detail.Qty = detail.Qty; detail.Status = balance.Status; } diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/WipWarehouseAdjustRequests/WipWarehouseAdjustRequestAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/WipWarehouseAdjustRequests/WipWarehouseAdjustRequestAppService.cs index 819a11568..5b0d6f098 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/WipWarehouseAdjustRequests/WipWarehouseAdjustRequestAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/WipWarehouseAdjustRequests/WipWarehouseAdjustRequestAppService.cs @@ -134,6 +134,7 @@ public class WipWarehouseAdjustRequestAppService : SfsStoreRequestAppServiceBase /// 新增实体 /// /// CreateInput + [HttpPost("")] public override async Task CreateAsync(WipWarehouseAdjustRequestEditInput input) { var entity = ObjectMapper.Map(input); diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/ExchangeDatas/EnumExchangeDataType.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/ExchangeDatas/EnumExchangeDataType.cs index 4dae593bf..70535ce5f 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/ExchangeDatas/EnumExchangeDataType.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/ExchangeDatas/EnumExchangeDataType.cs @@ -25,4 +25,10 @@ public enum EnumExchangeDataType RecycledMaterialReceipt = 23, ProductRecycle = 24, PurchaseOrder = 25, + //报废 + Scrap = 26, + //线边调整 + WipAdjust = 27, + //回收料调整 + Item_Transform = 28 } diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Jobs/PurchaseReceiptJobs/PurchaseReceiptJobManager.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Jobs/PurchaseReceiptJobs/PurchaseReceiptJobManager.cs index 52e915a56..11d85fc8d 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Jobs/PurchaseReceiptJobs/PurchaseReceiptJobManager.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Jobs/PurchaseReceiptJobs/PurchaseReceiptJobManager.cs @@ -2,6 +2,7 @@ using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.Linq; using System.Threading.Tasks; +using Volo.Abp; using Volo.Abp.Users; using Volo.Abp.Validation; using Win_in.Sfs.Shared.Domain.Shared; @@ -31,9 +32,7 @@ public class PurchaseReceiptJobManager : SfsJobManagerBase CompleteAsync(PurchaseReceiptJob input, ICurrentUser user) { var entity = await Repository.FindAsync(input.Id).ConfigureAwait(false); - BuildDetailHandledAsync(input, entity); - //设置任务为完成 return await base.CompleteAsync(entity, user).ConfigureAwait(false); } @@ -52,6 +51,8 @@ public class PurchaseReceiptJobManager : SfsJobManagerBase public string ReasonCode { get; set; } + /// + /// 专案 + /// + [Display(Name = "专案")] + public string CaseCode { get; set; } + + /// + /// 项目分类 + /// + [Display(Name = "项目分类")] + public string ProjCapacityCode { get; set; } + + /// + /// 次交易码 + /// + [Display(Name = "次交易码")] + public string OnceBusiCode { get; set; } + /// /// 扩展属性 /// diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Jobs/UnplannedReceiptJobs/UnplannedReceiptJobDetail.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Jobs/UnplannedReceiptJobs/UnplannedReceiptJobDetail.cs index a2ba8a699..9d1b62089 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Jobs/UnplannedReceiptJobs/UnplannedReceiptJobDetail.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Jobs/UnplannedReceiptJobs/UnplannedReceiptJobDetail.cs @@ -1,3 +1,4 @@ +using System.ComponentModel.DataAnnotations; using Volo.Abp.Data; namespace Win_in.Sfs.Wms.Store.Domain; @@ -10,6 +11,24 @@ public class UnplannedReceiptJobDetail : SfsJobRecommendToDetailEntityBase, IHas /// public string ReasonCode { get; set; } + /// + /// 专案 + /// + [Display(Name = "专案")] + public string CaseCode { get; set; } + + /// + /// 项目分类 + /// + [Display(Name = "项目分类")] + public string ProjCapacityCode { get; set; } + + /// + /// 次交易码 + /// + [Display(Name = "次交易码")] + public string OnceBusiCode { get; set; } + /// /// 扩展属性 /// diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Notes/UnplannedIssueNotes/UnplannedIssueNoteDetail.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Notes/UnplannedIssueNotes/UnplannedIssueNoteDetail.cs index 8f575b250..ef461133a 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Notes/UnplannedIssueNotes/UnplannedIssueNoteDetail.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Notes/UnplannedIssueNotes/UnplannedIssueNoteDetail.cs @@ -1,3 +1,4 @@ +using System.ComponentModel.DataAnnotations; using Volo.Abp.Data; namespace Win_in.Sfs.Wms.Store.Domain; @@ -9,6 +10,24 @@ public class UnplannedIssueNoteDetail : SfsStoreRecommendFromDetailWithLotPackin /// public string ReasonCode { get; set; } + /// + /// 专案 + /// + [Display(Name = "专案")] + public string CaseCode { get; set; } + + /// + /// 项目分类 + /// + [Display(Name = "项目分类")] + public string ProjCapacityCode { get; set; } + + /// + /// 次交易码 + /// + [Display(Name = "次交易码")] + public string OnceBusiCode { get; set; } + /// /// 扩展属性 /// diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Notes/UnplannedReceiptNotes/UnplannedReceiptNoteDetail.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Notes/UnplannedReceiptNotes/UnplannedReceiptNoteDetail.cs index 138e792de..eb0c1b067 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Notes/UnplannedReceiptNotes/UnplannedReceiptNoteDetail.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Notes/UnplannedReceiptNotes/UnplannedReceiptNoteDetail.cs @@ -1,3 +1,4 @@ +using System.ComponentModel.DataAnnotations; using Volo.Abp.Data; namespace Win_in.Sfs.Wms.Store.Domain; @@ -9,6 +10,24 @@ public class UnplannedReceiptNoteDetail : SfsStoreRecommendToDetailWithLotPackin /// public string ReasonCode { get; set; } + /// + /// 专案 + /// + [Display(Name = "专案")] + public string CaseCode { get; set; } + + /// + /// 项目分类 + /// + [Display(Name = "项目分类")] + public string ProjCapacityCode { get; set; } + + /// + /// 次交易码 + /// + [Display(Name = "次交易码")] + public string OnceBusiCode { get; set; } + /// /// 扩展属性 /// diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Requests/MaterialRequests/MaterialRequestDetail.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Requests/MaterialRequests/MaterialRequestDetail.cs index 2d4e5ba9d..1c59a4fda 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Requests/MaterialRequests/MaterialRequestDetail.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Requests/MaterialRequests/MaterialRequestDetail.cs @@ -74,7 +74,7 @@ public class MaterialRequestDetail : SfsStoreDetailWithQtyEntityBase, IHasToLoca public EnumStatus Status { get; set; } /// - /// 请求未发 + /// 请求未发 还未发送的数量 /// [NotMapped] public decimal ToBeIssuedQty => Qty - IssuedQty; diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Requests/MaterialRequests/MaterialRequestManager.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Requests/MaterialRequests/MaterialRequestManager.cs index 02f0fe835..5d0666e85 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Requests/MaterialRequests/MaterialRequestManager.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Requests/MaterialRequests/MaterialRequestManager.cs @@ -1,6 +1,8 @@ +using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; +using DocumentFormat.OpenXml.Math; using Win_in.Sfs.Shared.Domain.Shared; using Win_in.Sfs.Shared.Event; using static Win_in.Sfs.Wms.Store.Domain.Shared.StoreSettings; @@ -12,12 +14,15 @@ public class MaterialRequestManager , IMaterialRequestManager { private readonly IMaterialRequestRepository _repository; + private readonly IIssueJobRepository _issueJobRepository; public MaterialRequestManager( IMaterialRequestRepository repository + , IIssueJobRepository issueJobRepository ) : base(repository) { _repository = repository; + _issueJobRepository = issueJobRepository; } /// @@ -27,7 +32,7 @@ public class MaterialRequestManager /// public virtual async Task CreateBynNumberAsync(MaterialRequest entity) { - var number = string.IsNullOrEmpty(entity.Number) ? await GenerateNumberAsync(typeof(MaterialRequest).Name, entity.ActiveDate).ConfigureAwait(false) : entity.Number; + var number = string.IsNullOrEmpty(entity.Number) ? await GenerateNumberAsync(nameof(MaterialRequest), entity.ActiveDate).ConfigureAwait(false) : entity.Number; entity.SetIdAndNumberWithDetails(GuidGenerator, number); entity.Submit(); entity.Agree(); @@ -38,6 +43,79 @@ public class MaterialRequestManager return entity; } + public virtual async Task UpdateDetailsAsync(MaterialRequest newEntity) + { + var oldEntity = await Repository.FindAsync(newEntity.Id, true).ConfigureAwait(false); + + foreach (var newDetail in newEntity.Details) + { + oldEntity.ReplaceDetail(newDetail.Id, newDetail); + } + + foreach (var detail in oldEntity.Details) + { + SetMaterialRequestDetailStatus(detail); + } + + await SetMaterialRequestStatus(oldEntity).ConfigureAwait(false); + + await Repository.UpdateAsync(oldEntity).ConfigureAwait(false); + } + + private void SetMaterialRequestDetailStatus(MaterialRequestDetail detail) + { + if (detail.ReceivedQty >= detail.Qty)//执行的时候 实际收料 多余 要料数 + { + detail.Status = EnumStatus.Close; + } + else + { + detail.Status = EnumStatus.Open; + } + } + + private async Task SetMaterialRequestStatus(MaterialRequest materialRequest) + { + if (materialRequest.Details.All(p => p.Status == EnumStatus.Close)) + { + materialRequest.RequestStatus = EnumRequestStatus.Completed; + } + else + { + var issueJobs = await _issueJobRepository.GetListAsync(t => t.MaterialRequestNumber == materialRequest.Number).ConfigureAwait(false); + if (issueJobs.Count > 0) + { + if (issueJobs.All(t => t.JobStatus == EnumJobStatus.Done || t.JobStatus == EnumJobStatus.Closed || t.JobStatus == EnumJobStatus.Cancelled)) + { + if (materialRequest.Details.All(p => p.ReceivedQty >= p.Qty)) + { + materialRequest.RequestStatus = EnumRequestStatus.Completed; + } + else + { + materialRequest.RequestStatus = EnumRequestStatus.Partial; + } + } + else + { + materialRequest.RequestStatus = EnumRequestStatus.Partial; + } + } + else + { + materialRequest.RequestStatus = EnumRequestStatus.Partial; + } + } + } + + public virtual async Task CompleteAsync(string number) + { + var entity = await GetByNumberAsync(number).ConfigureAwait(false); + if (entity != null && !entity.Details.Any(p => p.ToBeIssuedQty > 0)) + { + await CompleteAsync(entity).ConfigureAwait(false); + } + } #region 公有 @@ -119,33 +197,6 @@ public class MaterialRequestManager } */ - public virtual async Task UpdateDetailsAsync(MaterialRequest newEntity) - { - var oldEntity = await Repository.FindAsync(newEntity.Id, true).ConfigureAwait(false); - - foreach (var newDetail in newEntity.Details) - { - oldEntity.ReplaceDetail(newDetail.Id, newDetail); - } - - var flag=oldEntity.Details.Any(p => p.ReceivedQty < p.Qty);//还有补料完 没收到的货 - - if (!flag) - { - oldEntity.Complete(); - } - - await Repository.UpdateAsync(oldEntity).ConfigureAwait(false); - } - - public virtual async Task CompleteAsync(string number) - { - var entity = await GetByNumberAsync(number).ConfigureAwait(false); - if (entity!=null &&!entity.Details.Any(p => p.ToBeIssuedQty > 0)) - { - await CompleteAsync(entity).ConfigureAwait(false); - } - } #endregion diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Requests/UnplannedIssueRequests/UnplannedIssueRequestDetail.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Requests/UnplannedIssueRequests/UnplannedIssueRequestDetail.cs index 2d597734a..a98da6f81 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Requests/UnplannedIssueRequests/UnplannedIssueRequestDetail.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Requests/UnplannedIssueRequests/UnplannedIssueRequestDetail.cs @@ -1,3 +1,4 @@ +using System.ComponentModel.DataAnnotations; using Volo.Abp.Data; namespace Win_in.Sfs.Wms.Store.Domain; @@ -8,6 +9,24 @@ namespace Win_in.Sfs.Wms.Store.Domain; public class UnplannedIssueRequestDetail : SfsStoreDetailWithLotPackingQtyLocationStatusEntityBase , IHasExtraProperties { + /// + /// 专案 + /// + [Display(Name = "专案")] + public string CaseCode { get; set; } + + /// + /// 项目分类 + /// + [Display(Name = "项目分类")] + public string ProjCapacityCode { get; set; } + + /// + /// 次交易码 + /// + [Display(Name = "次交易码")] + public string OnceBusiCode { get; set; } + /// /// 扩展属性 /// diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Requests/UnplannedReceiptRequests/UnplannedReceiptRequestDetail.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Requests/UnplannedReceiptRequests/UnplannedReceiptRequestDetail.cs index ec68fc967..1ac70ec54 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Requests/UnplannedReceiptRequests/UnplannedReceiptRequestDetail.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Requests/UnplannedReceiptRequests/UnplannedReceiptRequestDetail.cs @@ -1,3 +1,4 @@ +using System.ComponentModel.DataAnnotations; using Volo.Abp.Data; namespace Win_in.Sfs.Wms.Store.Domain; @@ -7,6 +8,29 @@ namespace Win_in.Sfs.Wms.Store.Domain; /// public class UnplannedReceiptRequestDetail : SfsStoreDetailWithLotPackingQtyLocationStatusEntityBase, IHasExtraProperties { + /// + /// 原因代码 + /// + public string ReasonCode { get; set; } + + /// + /// 专案 + /// + [Display(Name = "专案")] + public string CaseCode { get; set; } + + /// + /// 项目分类 + /// + [Display(Name = "项目分类")] + public string ProjCapacityCode { get; set; } + + /// + /// 次交易码 + /// + [Display(Name = "次交易码")] + public string OnceBusiCode { get; set; } + /// /// 扩展属性 /// diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/AutoMapperProfiles/Jobs/CountJobAutoMapperProfile.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/AutoMapperProfiles/Jobs/CountJobAutoMapperProfile.cs index a0253c5fa..eb88b8826 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/AutoMapperProfiles/Jobs/CountJobAutoMapperProfile.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/AutoMapperProfiles/Jobs/CountJobAutoMapperProfile.cs @@ -102,8 +102,6 @@ public partial class StoreEventAutoMapperProfile : Profile ; CreateMap() - .IgnoreAuditedObjectProperties() - // .ForMember(x => x.Item, y => y.MapFrom(d => new Item(d.ItemName, d.ItemDesc1, d.ItemDesc2))) // .ForMember(x => x.Batch, y => y.MapFrom(d => new Batch(d.SupplierBatch, d.ArriveDate, d.ProduceDate, d.ExpireDate))) .ForMember(x => x.InventoryLocationCode, y => y.MapFrom(d => d.LocationCode)) diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/AutoMapperProfiles/Notes/RecycledMaterialReceiptNoteAutoMapperProfile.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/AutoMapperProfiles/Notes/RecycledMaterialReceiptNoteAutoMapperProfile.cs index d8e9c64ce..55dbc66b5 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/AutoMapperProfiles/Notes/RecycledMaterialReceiptNoteAutoMapperProfile.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/AutoMapperProfiles/Notes/RecycledMaterialReceiptNoteAutoMapperProfile.cs @@ -24,7 +24,6 @@ public partial class StoreEventAutoMapperProfile : Profile CreateMap() .ReverseMap(); CreateMap() - .IgnoreAuditedObjectProperties() .ReverseMap() ; } diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/AutoMapperProfiles/Notes/TransferNoteAutoMapperProfile.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/AutoMapperProfiles/Notes/TransferNoteAutoMapperProfile.cs index bec022137..eb5563c21 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/AutoMapperProfiles/Notes/TransferNoteAutoMapperProfile.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/AutoMapperProfiles/Notes/TransferNoteAutoMapperProfile.cs @@ -29,6 +29,14 @@ public partial class StoreEventAutoMapperProfile : Profile .Ignore(x => x.WarehouseCode) ; + CreateMap() + .Ignore(x => x.ExtraProperties) + .Ignore(x => x.DocNumber) + .Ignore(x => x.JobNumber) + .Ignore(x => x.Worker) + .Ignore(x => x.TransType) + .Ignore(x => x.TransSubType) + ; } } diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/DataExchanges/ItemTransformNoteEventHandler.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/DataExchanges/ItemTransformNoteEventHandler.cs new file mode 100644 index 000000000..7675ee335 --- /dev/null +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/DataExchanges/ItemTransformNoteEventHandler.cs @@ -0,0 +1,57 @@ +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Volo.Abp.EventBus; +using Volo.Abp.Uow; +using Win_in.Sfs.Basedata.Application.Contracts; +using Win_in.Sfs.Shared.Domain.Shared; +using Win_in.Sfs.Shared.Event; +using Win_in.Sfs.Wms.Store.Application.Contracts; +using Win_in.Sfs.Wms.Store.Domain; + +namespace Win_in.Sfs.Wms.Store.Event.DataExchanges +{ + public class ItemTransformNoteEventHandler + : StoreDataExchangeEventHandlerBase + , ILocalEventHandler> + , ILocalEventHandler>> + { + private const EnumExchangeDataType ExchangeDataType = EnumExchangeDataType.Item_Transform; + private const EnumTransSubType TransSubType = EnumTransSubType.Item_Transform; + private readonly ILocationAppService _locationAppService; + + public ItemTransformNoteEventHandler(ILocationAppService locationAppService) + { + _locationAppService = locationAppService; + } + + [Volo.Abp.Uow.UnitOfWork] + public virtual async Task HandleEventAsync(SfsCreatedEntityEventData eventData) + { + var entity = eventData.Entity; + await AddExchangeDataAsync(entity); + } + + + [Volo.Abp.Uow.UnitOfWork] + public virtual async Task HandleEventAsync(SfsCreatedEntityEventData> eventData) + { + var entities = eventData.Entity; + await AddExchangeDataAsync(entities); + } + + protected override async Task AddExchangeDataAsync(List entities) + { + var dtos = ObjectMapper.Map, List>(entities); + + foreach (var dto in dtos) + { + dto.Type = TransSubType.ToString(); + } + + var exchangeData = await BuildExchangeDataAsync(StoreEventConsts.WMS, StoreEventConsts.ERP, ExchangeDataType, dtos); + await AddManyAsync(exchangeData); + } + + } +} diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/DataExchanges/PurchaseReceiptNoteEventHandler.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/DataExchanges/PurchaseReceiptNoteEventHandler.cs index 5afa1533b..332591e09 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/DataExchanges/PurchaseReceiptNoteEventHandler.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/DataExchanges/PurchaseReceiptNoteEventHandler.cs @@ -40,8 +40,5 @@ public class PurchaseReceiptNoteEventHandler //QAD var exchangeData = await BuildExchangeDataAsync(StoreEventConsts.WMS, StoreEventConsts.ERP, ExchangeDataType, dtos).ConfigureAwait(false); await AddManyAsync(exchangeData).ConfigureAwait(false); - //EOS - var exchangeData_eos = await BuildExchangeDataAsync(StoreEventConsts.WMS, StoreEventConsts.EOS, EnumExchangeDataType.PurchaseReceipt, dtos).ConfigureAwait(false); - await AddManyAsync(exchangeData_eos).ConfigureAwait(false); } } diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/DataExchanges/PutawayNoteEventHandler.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/DataExchanges/PutawayNoteEventHandler.cs index 1031ccca6..da7e53b71 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/DataExchanges/PutawayNoteEventHandler.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/DataExchanges/PutawayNoteEventHandler.cs @@ -39,5 +39,8 @@ public class PutawayNoteEventHandler } var exchangeData = await BuildExchangeDataAsync(StoreEventConsts.WMS, StoreEventConsts.ERP, ExchangeDataType, dtos).ConfigureAwait(false); await AddManyAsync(exchangeData).ConfigureAwait(false); + //EOS + var exchangeData_eos = await BuildExchangeDataAsync(StoreEventConsts.WMS, StoreEventConsts.EOS, ExchangeDataType, dtos).ConfigureAwait(false); + await AddManyAsync(exchangeData_eos).ConfigureAwait(false); } } diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/DataExchanges/ScrapNoteEventHandler.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/DataExchanges/ScrapNoteEventHandler.cs index 44b1939c4..5dcc31266 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/DataExchanges/ScrapNoteEventHandler.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/DataExchanges/ScrapNoteEventHandler.cs @@ -47,7 +47,7 @@ public class ScrapNoteEventHandler } else { - var exchangeData = await BuildExchangeDataAsync(StoreEventConsts.WMS, StoreEventConsts.ERP, EnumExchangeDataType.UnplannedIssue, dtos).ConfigureAwait(false); + var exchangeData = await BuildExchangeDataAsync(StoreEventConsts.WMS, StoreEventConsts.ERP, EnumExchangeDataType.Scrap, dtos).ConfigureAwait(false); await AddManyAsync(exchangeData).ConfigureAwait(false); } } diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/DataExchanges/TransferNoteEventHandler.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/DataExchanges/TransferNoteEventHandler.cs new file mode 100644 index 000000000..290228ac9 --- /dev/null +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/DataExchanges/TransferNoteEventHandler.cs @@ -0,0 +1,48 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Volo.Abp.EventBus; +using Volo.Abp.Uow; +using Win_in.Sfs.Basedata.Application.Contracts; +using Win_in.Sfs.Shared.Event; +using Win_in.Sfs.Wms.Inventory.Domain.Acl.Location; +using Win_in.Sfs.Wms.Store.Application.Contracts; +using Win_in.Sfs.Wms.Store.Domain; +using ILocationAclService = Win_in.Sfs.Wms.Store.Domain.Acl.Location.ILocationAclService; + +namespace Win_in.Sfs.Wms.Store.Event.DataExchanges +{ + public class TransferNoteEventHandler : + StoreDataExchangeEventHandlerBase + , ILocalEventHandler> + { + private readonly Domain.Acl.Location.ILocationAclService _locationAclService; + + public TransferNoteEventHandler(ILocationAclService locationAclService) + { + _locationAclService = locationAclService; + } + + [UnitOfWork] + public virtual async Task HandleEventAsync(SfsCreatedEntityEventData eventData) + { + var entity = eventData.Entity; + await AddExchangeDataAsync(entity).ConfigureAwait(false); + } + + + protected override async Task AddExchangeDataAsync(List entities) + { + var dtos = ObjectMapper.Map, List>(entities); + foreach (var detail in dtos.SelectMany(dto => dto.Details)) + { + await detail.TrySetLocationAsync(_locationAclService).ConfigureAwait(false); + } + var exchangeData = await BuildExchangeDataAsync(StoreEventConsts.WMS, StoreEventConsts.ERP, EnumExchangeDataType.Transfer, dtos).ConfigureAwait(false); + await AddManyAsync(exchangeData).ConfigureAwait(false); + + } + } +} diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/DataExchanges/WipWarehouseAdjustNoteEventHandler.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/DataExchanges/WipWarehouseAdjustNoteEventHandler.cs new file mode 100644 index 000000000..d007e6653 --- /dev/null +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/DataExchanges/WipWarehouseAdjustNoteEventHandler.cs @@ -0,0 +1,56 @@ +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Volo.Abp.EventBus; +using Volo.Abp.Uow; +using Win_in.Sfs.Basedata.Application.Contracts; +using Win_in.Sfs.Shared.Event; +using Win_in.Sfs.Wms.Store.Application.Contracts; +using Win_in.Sfs.Wms.Store.Domain; +using Win_in.Sfs.Wms.Store.Domain.Acl.Location; + +namespace Win_in.Sfs.Wms.Store.Event.DataExchanges +{ + public class WipWarehouseAdjustNoteEventHandler + : StoreDataExchangeEventHandlerBase + , ILocalEventHandler> + , ILocalEventHandler>> + { + private const EnumExchangeDataType ExchangeDataType = EnumExchangeDataType.WipAdjust; + + private ILocationAclService _locationAclService; + + public WipWarehouseAdjustNoteEventHandler(ILocationAclService locationAclService) + { + _locationAclService = locationAclService; + } + + [Volo.Abp.Uow.UnitOfWork] + public virtual async Task HandleEventAsync(SfsCreatedEntityEventData eventData) + { + var entity = eventData.Entity; + await AddExchangeDataAsync(entity); + } + + + + [Volo.Abp.Uow.UnitOfWork] + public virtual async Task HandleEventAsync(SfsCreatedEntityEventData> eventData) + { + var entities = eventData.Entity; + await AddExchangeDataAsync(entities); + } + + protected override async Task AddExchangeDataAsync(List entities) + { + var dtos = ObjectMapper.Map, List>(entities); + foreach (var detail in dtos.SelectMany(dto => dto.Details)) + { + await detail.TrySetLocationAsync(_locationAclService).ConfigureAwait(false); + } + var exchangeData = await BuildExchangeDataAsync(StoreEventConsts.WMS, StoreEventConsts.ERP, ExchangeDataType, dtos).ConfigureAwait(false); + await AddManyAsync(exchangeData).ConfigureAwait(false); + } + + } +} diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/ExpectInOuts/IssueJobEventHandler.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/ExpectInOuts/IssueJobEventHandler.cs index 70d496dfa..f3cb5ca84 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/ExpectInOuts/IssueJobEventHandler.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/ExpectInOuts/IssueJobEventHandler.cs @@ -17,6 +17,13 @@ public class IssueJobEventHandler : , ILocalEventHandler> { + private readonly IBalanceAppService _balanceAppService; + + public IssueJobEventHandler(IBalanceAppService balanceAppService) + { + _balanceAppService = balanceAppService; + } + [UnitOfWork] public virtual async Task HandleEventAsync(SfsCreatedEntityEventData eventData) { diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/IHasLocationDtoExtensions.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/IHasLocationDtoExtensions.cs index 8bfaac66e..3ddb84994 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/IHasLocationDtoExtensions.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/IHasLocationDtoExtensions.cs @@ -16,6 +16,8 @@ public static class IHasLocationExtensions { hasLocation.LocationErpCode = location.ErpLocationCode; hasLocation.WarehouseCode = location.WarehouseCode; + hasLocation.LocationArea = location.AreaCode; + hasLocation.LocationGroup = location.LocationGroupCode; } } } @@ -28,6 +30,9 @@ public static class IHasLocationExtensions if (location != null) { hasFromTolocation.FromLocationErpCode = location.ErpLocationCode; + hasFromTolocation.FromLocationGroup = location.LocationGroupCode; + hasFromTolocation.FromLocationArea = location.AreaCode; + if (string.IsNullOrEmpty(hasFromTolocation.FromWarehouseCode)) { hasFromTolocation.FromWarehouseCode = location.WarehouseCode; @@ -40,6 +45,8 @@ public static class IHasLocationExtensions var location = await locationAclService.GetByCodeAsync(hasFromTolocation.ToLocationCode).ConfigureAwait(false); if (location != null) { + hasFromTolocation.ToLocationArea = location.AreaCode; + hasFromTolocation.ToLocationGroup = location.LocationGroupCode; hasFromTolocation.ToLocationErpCode = location.ErpLocationCode; if (string.IsNullOrEmpty(hasFromTolocation.ToWarehouseCode)) { diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Jobs/ProductionReturnJobEventHandler.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Jobs/ProductionReturnJobEventHandler.cs index b8ac3da2a..4690c9f2d 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Jobs/ProductionReturnJobEventHandler.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Jobs/ProductionReturnJobEventHandler.cs @@ -1,3 +1,4 @@ +using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; @@ -59,6 +60,7 @@ public class ProductionReturnJobEventHandler : { var input = ObjectMapper.Map(entity); + input.ReturnTime=DateTime.Now; input.Details = new List(); foreach (var detail in entity.Details.Where(detail => detail.HandledQty != 0)) diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Jobs/PurchaseReceiptJobEventHandler.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Jobs/PurchaseReceiptJobEventHandler.cs index 331faa759..09821b5db 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Jobs/PurchaseReceiptJobEventHandler.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Jobs/PurchaseReceiptJobEventHandler.cs @@ -35,7 +35,7 @@ public class PurchaseReceiptJobEventHandler : var entity = eventData.Entity; //创建收货记录 - await CreatePurchaseReceiptNoteAsync(entity).ConfigureAwait(false); + await BuildPurchaseReceiptNoteAsync(entity).ConfigureAwait(false); } #region 私有 @@ -44,8 +44,9 @@ public class PurchaseReceiptJobEventHandler : /// 创建收货记录 /// /// - private async Task CreatePurchaseReceiptNoteAsync(PurchaseReceiptJob purchaseReceiptJob) + private async Task BuildPurchaseReceiptNoteAsync(PurchaseReceiptJob purchaseReceiptJob) { + var holdLocation = await LocationAclService.GetFirstByTypeAsync(EnumLocationType.HOLD).ConfigureAwait(false); //隔离库位 var createInput = ObjectMapper.Map(purchaseReceiptJob); //未收货记录 @@ -58,6 +59,16 @@ public class PurchaseReceiptJobEventHandler : detailInput.PurchaseReceiptInspectStatus = EnumPurchaseReceiptInspect.NORECEIPT; } + var noOkNoteDetailInputs = + createInput.Details.Where(p => p.PurchaseReceiptInspectStatus == EnumPurchaseReceiptInspect.NOK); + foreach (var detailInput in noOkNoteDetailInputs) + { + detailInput.HandledToLocationArea = holdLocation.AreaCode; + detailInput.HandledToLocationErpCode = holdLocation.ErpLocationCode; + detailInput.HandledToLocationGroup = holdLocation.LocationGroupCode; + detailInput.HandledToWarehouseCode=holdLocation.WarehouseCode; + } + await _purchaseReceiptNoteAppService.CreateAsync(createInput).ConfigureAwait(false); } diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/DeliverRequestEventHandler.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/DeliverRequestEventHandler.cs index acba1747c..f63574787 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/DeliverRequestEventHandler.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/DeliverRequestEventHandler.cs @@ -9,33 +9,89 @@ using Win_in.Sfs.Basedata.Application.Contracts; using Win_in.Sfs.Shared.Domain.Shared; using Win_in.Sfs.Shared.Event; using Win_in.Sfs.Wms.Inventory.Application.Contracts; +using Win_in.Sfs.Wms.Store.Application.Contracts; using Win_in.Sfs.Wms.Store.Domain; namespace Win_in.Sfs.Wms.Store.Event.BusinessRequest; -using Win_in.Sfs.Wms.Store.Application.Contracts; - public class DeliverRequestEventHandler : StoreEventHandlerBase - , ILocalEventHandler> - , ILocalEventHandler> + , ILocalEventHandler> + , ILocalEventHandler> + , ILocalEventHandler> + , ILocalEventHandler>> { private readonly IDeliverNoteAppService _deliverNoteApp; private readonly IDeliverJobAppService _deliverJobApp; private readonly ICustomerAddressAppService _customerAddressApp; + private readonly IDeliverRequestManager _deliverRequestManager; public DeliverRequestEventHandler( IDeliverJobAppService deliverJobApp , IDeliverNoteAppService deliverNoteApp - , ICustomerAddressAppService customerAddressApp - ) + , ICustomerAddressAppService customerAddressApp, IDeliverRequestManager deliverRequestManager) { _deliverNoteApp = deliverNoteApp; _deliverJobApp = deliverJobApp; _customerAddressApp = customerAddressApp; + _deliverRequestManager = deliverRequestManager; + } + + + /// + /// 创建后 + /// + /// Event data + [UnitOfWork] + public async Task HandleEventAsync(SfsCreatedEntityEventData eventData) + { + var entity = eventData.Entity; + if (entity.AutoSubmit) + { + await _deliverRequestManager.SubmitAsync(entity).ConfigureAwait(false); + } + } + + /// + /// 批量创建后 + /// + /// Event data + [UnitOfWork] + public async Task HandleEventAsync(SfsCreatedEntityEventData> eventData) + { + var entitys = eventData.Entity; + foreach (var entity in entitys) + { + if (entity.AutoSubmit) + { + await _deliverRequestManager.SubmitAsync(entity).ConfigureAwait(false); + } + } } + /// + /// 审批后 + /// + /// + /// + [UnitOfWork] + public virtual async Task HandleEventAsync(SfsAbortedEntityEventData eventData) + { + var entity = eventData.Entity; + + //东阳特殊逻辑 + if (!entity.DirectCreateNote) + { + await _deliverJobApp.CancelByDeliverRequestAsync(entity.Number).ConfigureAwait(false); + } + } + + /// + /// 执行后 + /// + /// + /// [UnitOfWork] public virtual async Task HandleEventAsync(SfsHandledEntityEventData eventData) { @@ -54,26 +110,32 @@ public class DeliverRequestEventHandler } } + + #region 私有 + private async Task BuildDeliverNoteAsync(DeliverRequest request) { - var transactionType = await TransactionTypeAclService.GetByTransTypeAsync(EnumTransType.Deliver, EnumTransSubType.None).ConfigureAwait(false); + var transactionType = await TransactionTypeAclService + .GetByTransTypeAsync(EnumTransType.Deliver, EnumTransSubType.None).ConfigureAwait(false); if (request.DeliverRequestType == EnumDeliverRequestType.Normal) { transactionType = await TransactionTypeAclService.GetByTransTypeAsync( - EnumTransType.Deliver, - EnumTransSubType.Deliver_Standard).ConfigureAwait(false); + EnumTransType.Deliver, + EnumTransSubType.Deliver_Standard).ConfigureAwait(false); } else if (request.DeliverRequestType == EnumDeliverRequestType.FIS) { transactionType = await TransactionTypeAclService.GetByTransTypeAsync( - EnumTransType.Deliver, - EnumTransSubType.Deliver_FIS).ConfigureAwait(false); + EnumTransType.Deliver, + EnumTransSubType.Deliver_FIS).ConfigureAwait(false); } var createInput = ObjectMapper.Map(request); - var customerAddress = (await _customerAddressApp.GetByCustomerCodeAsync(request.CustomerCode).ConfigureAwait(false)).FirstOrDefault(); + var customerAddress = + (await _customerAddressApp.GetByCustomerCodeAsync(request.CustomerCode).ConfigureAwait(false)) + .FirstOrDefault(); LocationDTO toLocation = null; if (customerAddress != null && !string.IsNullOrEmpty(customerAddress.LocationCode)) @@ -88,14 +150,14 @@ public class DeliverRequestEventHandler foreach (var detail in request.Details) { var balances = await BalanceAclService.GetRecommendBalancesAsync( - new RecommendBalanceRequestInput() - { - ItemCode = detail.ItemCode, - Qty = detail.Qty, - LocationTypes = transactionType.OutLocationTypes, - LocationAreas = new List() { detail.AreaCode }, - Statuses = transactionType.OutInventoryStatuses - }).ConfigureAwait(false); + new RecommendBalanceRequestInput + { + ItemCode = detail.ItemCode, + Qty = detail.Qty, + LocationTypes = transactionType.OutLocationTypes, + LocationAreas = new List { detail.AreaCode }, + Statuses = transactionType.OutInventoryStatuses + }).ConfigureAwait(false); var sumQty = balances.Sum(t => t.Qty); @@ -150,9 +212,12 @@ public class DeliverRequestEventHandler throw new ArgumentOutOfRangeException(); } - var transactionType = await TransactionTypeAclService.GetByTransTypeAsync(EnumTransType.Deliver, transSubType).ConfigureAwait(false); + var transactionType = await TransactionTypeAclService.GetByTransTypeAsync(EnumTransType.Deliver, transSubType) + .ConfigureAwait(false); var createInput = ObjectMapper.Map(request); - var customerAddress = (await _customerAddressApp.GetByCustomerCodeAsync(request.CustomerCode).ConfigureAwait(false)).FirstOrDefault(); + var customerAddress = + (await _customerAddressApp.GetByCustomerCodeAsync(request.CustomerCode).ConfigureAwait(false)) + .FirstOrDefault(); LocationDTO toLocation = null; if (customerAddress != null && !string.IsNullOrEmpty(customerAddress.LocationCode)) { @@ -165,14 +230,14 @@ public class DeliverRequestEventHandler foreach (var detail in request.Details) { var balances = await BalanceAclService.GetRecommendBalancesAsync( - new RecommendBalanceRequestInput() - { - ItemCode = detail.ItemCode, - Qty = detail.Qty, - LocationTypes = transactionType.OutLocationTypes, - LocationAreas = new List() { detail.AreaCode }, - Statuses = transactionType.OutInventoryStatuses - }).ConfigureAwait(false); + new RecommendBalanceRequestInput + { + ItemCode = detail.ItemCode, + Qty = detail.Qty, + LocationTypes = transactionType.OutLocationTypes, + LocationAreas = new List { detail.AreaCode }, + Statuses = transactionType.OutInventoryStatuses + }).ConfigureAwait(false); var sumQty = balances.Sum(t => t.Qty); @@ -190,6 +255,7 @@ public class DeliverRequestEventHandler inputDetail.ToLocationErpCode = toLocation.ErpLocationCode; inputDetail.ToWarehouseCode = toLocation.WarehouseCode; } + var item = await ItemBasicAclService.GetByCodeAsync(balance.ItemCode).ConfigureAwait(false); if (item != null) @@ -214,18 +280,8 @@ public class DeliverRequestEventHandler createInput.Priority = PriorityHelper.GetPriority(Clock); createInput.PriorityIncrement = 1; - return new List() { createInput }; + return new List { createInput }; } - [UnitOfWork] - public virtual async Task HandleEventAsync(SfsAbortedEntityEventData eventData) - { - var entity = eventData.Entity; - - //东阳特殊逻辑 - if (!entity.DirectCreateNote) - { - await _deliverJobApp.CancelByDeliverRequestAsync(entity.Number).ConfigureAwait(false); - } - } + #endregion } diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/ItemTransformRequestEventHandler.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/ItemTransformRequestEventHandler.cs index a71aeb6c3..3baf0a20c 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/ItemTransformRequestEventHandler.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/ItemTransformRequestEventHandler.cs @@ -74,9 +74,9 @@ public class ItemTransformRequestEventHandler ReasonCode = detail.ReasonCode, ToArriveDate = detail.ToArriveDate, ToExpireDate = detail.ToExpireDate, - ToItemDesc1 = detail.ItemDesc1, - ToItemDesc2 = detail.ItemDesc2, - ToItemName = detail.ItemName, + ToItemDesc1 = detail.ToItemDesc1, + ToItemDesc2 = detail.ToItemDesc2, + ToItemName = detail.ToItemName, ToLot = detail.ToLot, ToPackingCode = detail.ToPackingCode, ToQty = detail.ToQty, diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/MaterialRequestEventHandler.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/MaterialRequestEventHandler.cs index df7782591..02937f8ff 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/MaterialRequestEventHandler.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/MaterialRequestEventHandler.cs @@ -28,17 +28,20 @@ public class MaterialRequestEventHandler private readonly IProductionLineAppService _productionLineAppService; private readonly IMaterialRequestManager _materialRequestManager; private readonly ILocationAppService _locationAppService; + private readonly IBalanceAppService _balanceAppService; public MaterialRequestEventHandler( IIssueJobAppService issueJobAppService , IProductionLineAppService productionLineAppService , IMaterialRequestManager materialRequestManager - , ILocationAppService locationAppService) + , ILocationAppService locationAppService + , IBalanceAppService balanceAppService) { _issueJobAppService = issueJobAppService; _productionLineAppService = productionLineAppService; _materialRequestManager = materialRequestManager; _locationAppService = locationAppService; + _balanceAppService = balanceAppService; } /// @@ -121,14 +124,18 @@ public class MaterialRequestEventHandler { var jobs = new List(); - var transactionType = await TransactionTypeAclService.GetByTransTypeAsync(EnumTransType.Issue, EnumTransSubType.None).ConfigureAwait(false); - var toLocationCodes = materialRequest.Details.Select(p => p.ToLocationCode).Distinct().ToList(); - var toLocations = await _locationAppService.GetByCodesAsync(toLocationCodes).ConfigureAwait(false); + var transactionType = await TransactionTypeAclService.GetByTransTypeAsync(EnumTransType.Issue, EnumTransSubType.None).ConfigureAwait(false);//库存事务 - foreach (var materialRequestDetail in materialRequest.Details.Where(p => p.ToBeIssuedQty > 0))//如果有还有剩余未叫料的数量 则创建新的任务 + var toLocationCodes = materialRequest.Details.Select(p => p.ToLocationCode).Distinct().ToList();//所有发送库位的集合 + var toLocations = await _locationAppService.GetByCodesAsync(toLocationCodes).ConfigureAwait(false);//所有库位的集合 + + var materialRequestDetails = materialRequest.Details.Where(p => p.ToBeIssuedQty > 0);//所有还没发送物品的集合 + foreach (var materialRequestDetail in materialRequestDetails)//如果有还有剩余未叫料的数量 则创建新的任务 { - var toLocation = toLocations.FirstOrDefault(p => p.Code == materialRequestDetail.ToLocationCode); + var toLocation = toLocations.FirstOrDefault(p => p.Code == materialRequestDetail.ToLocationCode);//判断目标库位是否存在 Check.NotNull(toLocation, "库位代码", $"库位 {materialRequestDetail.ToLocationCode} 不存在"); + + //创建详情 var jobDetails = await BuildIssueJobDetailInputsAsync(materialRequest, materialRequestDetail, transactionType, toLocation.LocationGroupCode).ConfigureAwait(false); if (!jobDetails.Any()) { @@ -144,7 +151,7 @@ public class MaterialRequestEventHandler jobs.Add(job); } job.Details.AddRange(jobDetails); - if (materialRequestDetail.ToBeIssuedQty <= 0) + if (materialRequestDetail.ToBeIssuedQty < 0) { materialRequestDetail.Status = EnumStatus.Close; } @@ -204,7 +211,7 @@ public class MaterialRequestEventHandler Statuses = transactionType.OutInventoryStatuses, }; //获取推荐库存 - var recommendList = await BalanceAclService.GetRecommendBalancesAsync(input).ConfigureAwait(false); + var recommendList = await _balanceAppService.GetRecommendBalancesAsync(input).ConfigureAwait(false); //没有推荐库存时 跳过此明细 不生成任务 if (recommendList.Count != 0) { @@ -215,16 +222,17 @@ public class MaterialRequestEventHandler if (materialRequest.UseOnTheWayLocation) { //获取在途库 - var locationDto= await _locationAppService.GetFirstByTypeAsync(EnumLocationType.TRANSPORT).ConfigureAwait(false); + var locationDto = await _locationAppService.GetFirstByTypeAsync(EnumLocationType.TRANSPORT).ConfigureAwait(false); detail.OnTheWayLocationCode = locationDto.Code; } jobDetails.Add(detail); materialRequestDetail.IssuedQty += recommend.Qty; + await _materialRequestManager.UpdateDetailsAsync(materialRequest).ConfigureAwait(false); + } } - return jobDetails; } @@ -240,21 +248,22 @@ public class MaterialRequestEventHandler detail.RecommendPackingCode = balance.PackingCode; detail.RecommendContainerCode = balance.ContainerCode; detail.RecommendSupplierBatch = balance.SupplierBatch; - detail.RecommendProduceDate= balance.ProduceDate; - detail.RecommendExpireDate= balance.ExpireDate; - detail.RecommendLot= balance.Lot; - detail.RecommendProduceDate=balance.ProduceDate; - detail.RecommendArriveDate= balance.ArriveDate; + detail.RecommendProduceDate = balance.ProduceDate; + detail.RecommendExpireDate = balance.ExpireDate; + detail.RecommendLot = balance.Lot; + detail.RecommendProduceDate = balance.ProduceDate; + detail.RecommendArriveDate = balance.ArriveDate; detail.RecommendFromLocationArea = balance.LocationArea; - detail.RecommendFromLocationCode= balance.LocationCode; - detail.RecommendFromLocationErpCode= balance.LocationErpCode; - detail.RecommendFromLocationGroup= balance.LocationGroup; - detail.RecommendFromWarehouseCode= balance.WarehouseCode; + detail.RecommendFromLocationCode = balance.LocationCode; + detail.RecommendFromLocationErpCode = balance.LocationErpCode; + detail.RecommendFromLocationGroup = balance.LocationGroup; + detail.RecommendFromWarehouseCode = balance.WarehouseCode; + detail.RecommendQty = balance.Qty; detail.Uom = balance.Uom; detail.ToLocationCode = materialRequestDetail.ToLocationCode; detail.ToLocationErpCode = materialRequestDetail.ToLocationErpCode; - detail.ToLocationArea= materialRequestDetail.ToLocationArea; + detail.ToLocationArea = materialRequestDetail.ToLocationArea; detail.ToWarehouseCode = materialRequestDetail.ToWarehouseCode; detail.ToLocationGroup = materialRequestDetail.ToLocationGroup; //detail.Operation = //TODO diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/Note/IssueNoteEventHandler.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/Note/IssueNoteEventHandler.cs index 94d4e8369..8f718fb7e 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/Note/IssueNoteEventHandler.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/Note/IssueNoteEventHandler.cs @@ -6,6 +6,8 @@ using Volo.Abp.Uow; using Win_in.Sfs.Shared.Domain.Shared; using Win_in.Sfs.Shared.Event; using Win_in.Sfs.Wms.Store.Domain; +using static Win_in.Sfs.Wms.Store.Domain.Shared.StoreSettings; +using MaterialRequest = Win_in.Sfs.Wms.Store.Domain.MaterialRequest; namespace Win_in.Sfs.Wms.Store.Event.BusinessRequest; @@ -37,33 +39,6 @@ public class IssueNoteEventHandler await UpdateReceivedQtyMaterialRequestAsync(entity).ConfigureAwait(false); } - private async Task UpdateReceivedQtyMaterialRequestAsync(IssueNote entity) - { - var receiveQtyGroup = entity.Details - .GroupBy(p => new { p.ItemCode, p.ToLocationCode }) - .Select(p => new { p.Key.ItemCode, p.Key.ToLocationCode, Qty = p.Sum(d => d.Qty) }) - .ToList(); - - var materialRequest = await _materialRequestManager.GetByNumberAsync(entity.RequestNumber).ConfigureAwait(false); - - if (entity.RequestType != EnumMaterialRequestType.Issue_Direct.ToString()) - { - //更新叫料请求的已收数量 - foreach (var materialRequestDetail in materialRequest.Details) - { - var receiveQty = receiveQtyGroup.FirstOrDefault(p => - p.ItemCode == materialRequestDetail.ItemCode && - p.ToLocationCode == materialRequestDetail.ToLocationCode)?.Qty; - if (receiveQty != null) - { - materialRequestDetail.ReceivedQty += receiveQty.Value; - } - } - - await _materialRequestManager.UpdateDetailsAsync(materialRequest).ConfigureAwait(false); - } - } - /// /// 当叫料记录创建后 修改请求的值 /// @@ -93,4 +68,31 @@ public class IssueNoteEventHandler await UpdateReceivedQtyMaterialRequestAsync(entity).ConfigureAwait(false); } } + + private async Task UpdateReceivedQtyMaterialRequestAsync(IssueNote entity) + { + var receiveQtyGroup = entity.Details + .GroupBy(p => new { p.ItemCode, p.ToLocationCode }) + .Select(p => new { p.Key.ItemCode, p.Key.ToLocationCode, Qty = p.Sum(d => d.Qty) }) + .ToList(); + + var materialRequest = await _materialRequestManager.GetByNumberAsync(entity.RequestNumber).ConfigureAwait(false); + + if (entity.RequestType != EnumMaterialRequestType.Issue_Direct.ToString()) + { + //更新叫料请求的已收数量 + foreach (var materialRequestDetail in materialRequest.Details) + { + var receiveQty = receiveQtyGroup.FirstOrDefault(p => + p.ItemCode == materialRequestDetail.ItemCode && + p.ToLocationCode == materialRequestDetail.ToLocationCode)?.Qty; + if (receiveQty != null) + { + materialRequestDetail.ReceivedQty += receiveQty.Value; + } + } + + await _materialRequestManager.UpdateDetailsAsync(materialRequest).ConfigureAwait(false); + } + } } diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/ProductRecycleRequestEventHandler.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/ProductRecycleRequestEventHandler.cs index fa0a16a2e..2e0b3a9f8 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/ProductRecycleRequestEventHandler.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/ProductRecycleRequestEventHandler.cs @@ -16,20 +16,55 @@ using Application.Contracts; public class ProductRecycleRequestEventHandler : StoreEventHandlerBase , ILocalEventHandler> + , ILocalEventHandler> + , ILocalEventHandler>> { private readonly IProductRecycleNoteAppService _productRecycleNoteApp; private readonly IBackFlushNoteAppService _backFlushNoteApp; private readonly IBomAppService _bomApp; + private readonly IProductRecycleRequestManager _productRecycleRequestManager; public ProductRecycleRequestEventHandler( IProductRecycleNoteAppService productRecycleNoteApp, IBackFlushNoteAppService backFlushNoteApp, - IBomAppService bomApp - ) + IBomAppService bomApp, IProductRecycleRequestManager + productRecycleRequestManager) { _productRecycleNoteApp = productRecycleNoteApp; _backFlushNoteApp = backFlushNoteApp; _bomApp = bomApp; + _productRecycleRequestManager = productRecycleRequestManager; + } + + /// + /// 创建后 + /// + /// Event data + [UnitOfWork] + public async Task HandleEventAsync(SfsCreatedEntityEventData eventData) + { + var entity = eventData.Entity; + if (entity.AutoSubmit) + { + await _productRecycleRequestManager.SubmitAsync(entity).ConfigureAwait(false); + } + } + + /// + /// 批量创建后 + /// + /// Event data + [UnitOfWork] + public async Task HandleEventAsync(SfsCreatedEntityEventData> eventData) + { + var entitys = eventData.Entity; + foreach (var entity in entitys) + { + if (entity.AutoSubmit) + { + await _productRecycleRequestManager.SubmitAsync(entity).ConfigureAwait(false); + } + } } [UnitOfWork] @@ -49,6 +84,8 @@ public class ProductRecycleRequestEventHandler } } + #region 私有 + private async Task BuildProductRecycleNoteAsync(ProductRecycleRequest request) { var createInput = ObjectMapper.Map(request); @@ -115,6 +152,10 @@ public class ProductRecycleRequestEventHandler return detailInput; } + #endregion + + + /* private async Task> BuildFlushNotesAsync(ProductRecycleRequest request) { diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/UnplannedIssueRequestEventHandler.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/UnplannedIssueRequestEventHandler.cs index 4969e34e8..acfe68f31 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/UnplannedIssueRequestEventHandler.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/UnplannedIssueRequestEventHandler.cs @@ -10,20 +10,58 @@ namespace Win_in.Sfs.Wms.Store.Event.BusinessRequest; public class UnplannedIssueRequestEventHandler : StoreEventHandlerBase - , ILocalEventHandler> + , ILocalEventHandler> + , ILocalEventHandler>> + , ILocalEventHandler> { private readonly IUnplannedIssueJobAppService _unplannedIssueJobApp; private readonly IUnplannedIssueNoteAppService _unplannedIssueNoteAppService; + private readonly IUnplannedIssueRequestManager _unplannedIssueRequestManager; public UnplannedIssueRequestEventHandler( - IUnplannedIssueJobAppService unplannedIssueJobApp - , IUnplannedIssueNoteAppService unplannedIssueNoteAppService - ) + IUnplannedIssueJobAppService unplannedIssueJobApp, + IUnplannedIssueNoteAppService unplannedIssueNoteAppService, + IUnplannedIssueRequestManager unplannedIssueRequestManager) { _unplannedIssueJobApp = unplannedIssueJobApp; _unplannedIssueNoteAppService = unplannedIssueNoteAppService; + _unplannedIssueRequestManager = unplannedIssueRequestManager; } + /// + /// 创建后 + /// + /// Event data + public async Task HandleEventAsync(SfsCreatedEntityEventData eventData) + { + var entity = eventData.Entity; + if (entity.AutoSubmit) + { + await _unplannedIssueRequestManager.SubmitAsync(entity).ConfigureAwait(false); + } + } + + /// + /// 批量创建后 + /// + /// Event data + public async Task HandleEventAsync(SfsCreatedEntityEventData> eventData) + { + var entitys = eventData.Entity; + foreach (var entity in entitys) + { + if (entity.AutoSubmit) + { + await _unplannedIssueRequestManager.SubmitAsync(entity).ConfigureAwait(false); + } + } + } + + /// + /// 执行后 + /// + /// + /// public virtual async Task HandleEventAsync(SfsHandledEntityEventData eventData) { var entity = eventData.Entity; @@ -39,7 +77,10 @@ public class UnplannedIssueRequestEventHandler } } - private async Task BuildUnplannedIssueNoteCreateInputAsync(UnplannedIssueRequest entity) + #region 私有 + + private async Task BuildUnplannedIssueNoteCreateInputAsync( + UnplannedIssueRequest entity) { await Task.CompletedTask.ConfigureAwait(false); var createInput = ObjectMapper.Map(entity); @@ -50,6 +91,8 @@ public class UnplannedIssueRequestEventHandler return createInput; } + #endregion + private async Task BuildUnplannedIssueJobCreateInputAsync(UnplannedIssueRequest entity) { await Task.CompletedTask.ConfigureAwait(false); diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/UnplannedReceiptRequestEventHandler.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/UnplannedReceiptRequestEventHandler.cs index 5e93227dc..dcec7d221 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/UnplannedReceiptRequestEventHandler.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/UnplannedReceiptRequestEventHandler.cs @@ -10,20 +10,58 @@ namespace Win_in.Sfs.Wms.Store.Event.BusinessRequest; public class UnplannedReceiptRequestEventHandler : StoreEventHandlerBase - , ILocalEventHandler> + , ILocalEventHandler> + , ILocalEventHandler>> + , ILocalEventHandler> { private readonly IUnplannedReceiptJobAppService _unplannedReceiptJobApp; private readonly IUnplannedReceiptNoteAppService _unplannedReceiptNoteApp; + private readonly IUnplannedReceiptRequestManager _unplannedReceiptRequestManager; public UnplannedReceiptRequestEventHandler( - IUnplannedReceiptJobAppService unplannedReceiptJobApp - , IUnplannedReceiptNoteAppService unplannedReceiptNoteApp - ) + IUnplannedReceiptJobAppService unplannedReceiptJobApp, + IUnplannedReceiptNoteAppService unplannedReceiptNoteApp, + IUnplannedReceiptRequestManager unplannedReceiptRequestManager) { _unplannedReceiptNoteApp = unplannedReceiptNoteApp; + _unplannedReceiptRequestManager = unplannedReceiptRequestManager; _unplannedReceiptJobApp = unplannedReceiptJobApp; } + /// + /// 创建后 + /// + /// Event data + public async Task HandleEventAsync(SfsCreatedEntityEventData eventData) + { + var entity = eventData.Entity; + if (entity.AutoSubmit) + { + await _unplannedReceiptRequestManager.SubmitAsync(entity).ConfigureAwait(false); + } + } + + /// + /// 批量创建后 + /// + /// Event data + public async Task HandleEventAsync(SfsCreatedEntityEventData> eventData) + { + var entitys = eventData.Entity; + foreach (var entity in entitys) + { + if (entity.AutoSubmit) + { + await _unplannedReceiptRequestManager.SubmitAsync(entity).ConfigureAwait(false); + } + } + } + + /// + /// 执行后 + /// + /// + /// public virtual async Task HandleEventAsync(SfsHandledEntityEventData eventData) { var entity = eventData.Entity; @@ -41,7 +79,10 @@ public class UnplannedReceiptRequestEventHandler } } - private async Task BuildUnplannedReceiptNoteCreateInputAsync(UnplannedReceiptRequest entity) + #region 私有 + + private async Task BuildUnplannedReceiptNoteCreateInputAsync( + UnplannedReceiptRequest entity) { await Task.CompletedTask.ConfigureAwait(false); var createInput = ObjectMapper.Map(entity); @@ -52,7 +93,8 @@ public class UnplannedReceiptRequestEventHandler return createInput; } - private async Task BuildToUnplannedReceiptJobCreateInputAsync(UnplannedReceiptRequest entity) + private async Task BuildToUnplannedReceiptJobCreateInputAsync( + UnplannedReceiptRequest entity) { await Task.CompletedTask.ConfigureAwait(false); var createInput = ObjectMapper.Map(entity); @@ -75,6 +117,8 @@ public class UnplannedReceiptRequestEventHandler return createInput; } + #endregion + /* 改用AutoMapper实现 private void SetUnplannedReceiptJobDetails(UnplannedReceiptJobCreateInput createInput, List details) { @@ -111,5 +155,4 @@ public class UnplannedReceiptRequestEventHandler } } */ - } diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Transactions/PurchaseReceiptNoteEventHandler.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Transactions/PurchaseReceiptNoteEventHandler.cs index 891d194c9..719171fa8 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Transactions/PurchaseReceiptNoteEventHandler.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Transactions/PurchaseReceiptNoteEventHandler.cs @@ -120,7 +120,6 @@ public class PurchaseReceiptNoteEventHandler Dictionary dictionary) { if (entity.Details.Any(p => - p.PurchaseReceiptInspectStatus == EnumPurchaseReceiptInspect.NOK || p.PurchaseReceiptInspectStatus == EnumPurchaseReceiptInspect.OK)) { var inboundTransactions = new List(); diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Transactions/PurchaseReturnNoteEventHandler.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Transactions/PurchaseReturnNoteEventHandler.cs index 4942734d8..0c5f36fa1 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Transactions/PurchaseReturnNoteEventHandler.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Transactions/PurchaseReturnNoteEventHandler.cs @@ -3,6 +3,7 @@ using System.Linq; using System.Threading.Tasks; using Volo.Abp.EventBus; using Volo.Abp.Uow; +using Win_in.Sfs.Label.Application.Contracts; using Win_in.Sfs.Shared.Domain.Shared; using Win_in.Sfs.Shared.Event; using Win_in.Sfs.Wms.Inventory.Application.Contracts; @@ -25,14 +26,16 @@ public class PurchaseReturnNoteEventHandler private readonly IPurchaseReturnRequestAppService _purchaseReturnRequestApp; private readonly IPurchaseOrderAppService _purchaseOrderAppService; + private readonly IInventoryLabelAppService _inventoryLabelAppService; public PurchaseReturnNoteEventHandler( IPurchaseReturnRequestAppService purchaseReturnRequestApp - , IPurchaseOrderAppService purchaseOrderAppService - ) + , IPurchaseOrderAppService purchaseOrderAppService, + IInventoryLabelAppService inventoryLabelAppService) { _purchaseReturnRequestApp = purchaseReturnRequestApp; _purchaseOrderAppService = purchaseOrderAppService; + _inventoryLabelAppService = inventoryLabelAppService; } [UnitOfWork] @@ -53,10 +56,15 @@ public class PurchaseReturnNoteEventHandler private async Task UpdatePurchaseOrderAsync(PurchaseReturnNote entity) { - var purchaseOrderDetailUpdateInputs = entity.Details + foreach (var detail in entity.Details) + { + var inventoryLabelDto=await _inventoryLabelAppService.GetByCodeAsync(detail.PackingCode).ConfigureAwait(false); + + var purchaseOrderDetailUpdateInputs = entity.Details .Select(BuildPurchaseOrderDetailUpdateInput).ToList(); - await _purchaseOrderAppService.UpdateDetailsAsync(entity.PoNumber, purchaseOrderDetailUpdateInputs).ConfigureAwait(false); + await _purchaseOrderAppService.UpdateDetailsAsync(entity.PoNumber, purchaseOrderDetailUpdateInputs).ConfigureAwait(false); + } } private static PurchaseOrderDetailUpdateInput BuildPurchaseOrderDetailUpdateInput(PurchaseReturnNoteDetail purchaseReturnNoteDetail) diff --git a/build/src/docker/publish/conf/nginx/nginx.conf b/build/src/docker/publish/conf/nginx/nginx.conf index ab34c37d0..09667bbbc 100644 --- a/build/src/docker/publish/conf/nginx/nginx.conf +++ b/build/src/docker/publish/conf/nginx/nginx.conf @@ -59,7 +59,7 @@ http { index index.html; } - location ^/api/ { + location ~* ^/api/ { proxy_pass http://proxy; if ($http_upgrade ~* "close") { break; @@ -81,7 +81,7 @@ http { index index.html; } - location ^/api/ { + location ~* ^/api/ { proxy_pass http://proxy; if ($http_upgrade ~* "close") { break; diff --git a/build/src/docker/publish/conf/settings/appsettings.Development.json b/build/src/docker/publish/conf/settings/appsettings.Development.json index 38d969c76..5a4efcb2d 100644 --- a/build/src/docker/publish/conf/settings/appsettings.Development.json +++ b/build/src/docker/publish/conf/settings/appsettings.Development.json @@ -1,5 +1,5 @@ { - "AlwaysAllowAuthorization": "True", + "AlwaysAllowAuthorization": "true", "App": { "CorsOrigins": [ "http://localhost:59080", @@ -45,7 +45,7 @@ }, "AuthServer": { "Audience": "Auth", - "Authority": "http://dev.ccwin-in.com:21293/", + "Authority": "http://dev.ccwin-in.com:60083/", "ClientId": "Auth_App", "ClientSecret": "1q2w3E*", "RequireHttpsMetadata": "false", @@ -74,28 +74,28 @@ // "Store": "Server=localhost,21195;Database=Wms;Uid=sa;Pwd=aA123456!;timeout=6000;" // }, "ConnectionStrings": { - "AbpAuditLogging": "Server=dev.ccwin-in.com,21195;Database=Wms;Uid=sa;Pwd=aA123456!;timeout=6000;", - "AbpBackgroundJobs": "Server=dev.ccwin-in.com,21195;Database=Wms;Uid=sa;Pwd=aA123456!;timeout=6000;", - "AbpBlobStoring": "Server=dev.ccwin-in.com,21195;Database=Wms;Uid=sa;Pwd=aA123456!;timeout=6000;", - "AbpFeatureManagement": "Server=dev.ccwin-in.com,21195;Database=Wms;Uid=sa;Pwd=aA123456!;timeout=6000;", - "AbpIdentity": "Server=dev.ccwin-in.com,21195;Database=Wms;Uid=sa;Pwd=aA123456!;timeout=6000;", - "AbpIdentityServer": "Server=dev.ccwin-in.com,21195;Database=Wms;Uid=sa;Pwd=aA123456!;timeout=6000;", - "AbpPermissionManagement": "Server=dev.ccwin-in.com,21195;Database=Wms;Uid=sa;Pwd=aA123456!;timeout=6000;", - "AbpSettingManagement": "Server=dev.ccwin-in.com,21195;Database=Wms;Uid=sa;Pwd=aA123456!;timeout=6000;", - "AbpTenantManagement": "Server=dev.ccwin-in.com,21195;Database=Wms;Uid=sa;Pwd=aA123456!;timeout=6000;", - "Auth": "Server=dev.ccwin-in.com,21195;Database=Wms;Uid=sa;Pwd=aA123456!;timeout=6000;", - "Basedata": "Server=dev.ccwin-in.com,21195;Database=Wms;Uid=sa;Pwd=aA123456!;timeout=6000;", - "DataExchange": "Server=dev.ccwin-in.com,21195;Database=Wms;Uid=sa;Pwd=aA123456!;timeout=6000;", - "FileStorage": "Server=dev.ccwin-in.com,21195;Database=Wms;Uid=sa;Pwd=aA123456!;timeout=6000;", - "Inventory": "Server=dev.ccwin-in.com,21195;Database=Wms;Uid=sa;Pwd=aA123456!;timeout=6000;", - "Job": "Server=dev.ccwin-in.com,21195;Database=Wms;Uid=sa;Pwd=aA123456!;timeout=6000;", - "Label": "Server=dev.ccwin-in.com,21195;Database=Wms;Uid=sa;Pwd=aA123456!;timeout=6000;", - "Message": "Server=dev.ccwin-in.com,21195;Database=Wms;Uid=sa;Pwd=aA123456!;timeout=6000;", - "Store": "Server=dev.ccwin-in.com,21195;Database=Wms;Uid=sa;Pwd=aA123456!;timeout=6000;" + "AbpAuditLogging": "Server=dev.ccwin-in.com,13319;Database=Wms_Dy_ShangHai;uid=ccwin-in;pwd=Microsoft@2022;timeout=6000;", + "AbpBackgroundJobs": "Server=dev.ccwin-in.com,13319;Database=Wms_Dy_ShangHai;uid=ccwin-in;pwd=Microsoft@2022;timeout=6000;", + "AbpBlobStoring": "Server=dev.ccwin-in.com,13319;Database=Wms_Dy_ShangHai;uid=ccwin-in;pwd=Microsoft@2022;timeout=6000;", + "AbpFeatureManagement": "Server=dev.ccwin-in.com,13319;Database=Wms_Dy_ShangHai;uid=ccwin-in;pwd=Microsoft@2022;timeout=6000;", + "AbpIdentity": "Server=dev.ccwin-in.com,13319;Database=Wms_Dy_ShangHai;uid=ccwin-in;pwd=Microsoft@2022;timeout=6000;", + "AbpIdentityServer": "Server=dev.ccwin-in.com,13319;Database=Wms_Dy_ShangHai;uid=ccwin-in;pwd=Microsoft@2022;timeout=6000;", + "AbpPermissionManagement": "Server=dev.ccwin-in.com,13319;Database=Wms_Dy_ShangHai;uid=ccwin-in;pwd=Microsoft@2022;timeout=6000;", + "AbpSettingManagement": "Server=dev.ccwin-in.com,13319;Database=Wms_Dy_ShangHai;uid=ccwin-in;pwd=Microsoft@2022;timeout=6000;", + "AbpTenantManagement": "Server=dev.ccwin-in.com,13319;Database=Wms_Dy_ShangHai;uid=ccwin-in;pwd=Microsoft@2022;timeout=6000;", + "Auth": "Server=dev.ccwin-in.com,13319;Database=Wms_Dy_ShangHai;uid=ccwin-in;pwd=Microsoft@2022;timeout=6000;", + "Basedata": "Server=dev.ccwin-in.com,13319;Database=Wms_Dy_ShangHai;uid=ccwin-in;pwd=Microsoft@2022;timeout=6000;", + "DataExchange": "Server=dev.ccwin-in.com,13319;Database=Wms_Dy_ShangHai;uid=ccwin-in;pwd=Microsoft@2022;timeout=6000;", + "FileStorage": "Server=dev.ccwin-in.com,13319;Database=Wms_Dy_ShangHai;uid=ccwin-in;pwd=Microsoft@2022;timeout=6000;", + "Inventory": "Server=dev.ccwin-in.com,13319;Database=Wms_Dy_ShangHai;uid=ccwin-in;pwd=Microsoft@2022;timeout=6000;", + "Job": "Server=dev.ccwin-in.com,13319;Database=Wms_Dy_ShangHai;uid=ccwin-in;pwd=Microsoft@2022;timeout=6000;", + "Label": "Server=dev.ccwin-in.com,13319;Database=Wms_Dy_ShangHai;uid=ccwin-in;pwd=Microsoft@2022;timeout=6000;", + "Message": "Server=dev.ccwin-in.com,13319;Database=Wms_Dy_ShangHai;uid=ccwin-in;pwd=Microsoft@2022;timeout=6000;", + "Store": "Server=dev.ccwin-in.com,13319;Database=Wms_Dy_ShangHai;uid=ccwin-in;pwd=Microsoft@2022;timeout=6000;" }, "IdentityClients": { "Default": { - "Authority": "http://dev.ccwin-in.com:21293", + "Authority": "http://dev.ccwin-in.com:60083", "ClientId": "Auth_App", "ClientSecret": "1q2w3E*", "GrantType": "client_credentials", @@ -107,19 +107,20 @@ "Redis": { "Configuration": "localhost:21194", "KeyPrefix": "Wms:" + //"IsEnabled": "false" }, "RemoteServices": { "Auth": { - "BaseUrl": "http://dev.ccwin-in.com:21293/" + "BaseUrl": "http://dev.ccwin-in.com:60083/" }, "BaseData": { - "BaseUrl": "http://dev.ccwin-in.com:21294/" + "BaseUrl": "http://dev.ccwin-in.com:60084/" }, "Default": { - "BaseUrl": "http://dev.ccwin-in.com:21293/" + "BaseUrl": "http://dev.ccwin-in.com:60083/" }, "FileStorage": { - "BaseUrl": "http://dev.ccwin-in.com:21292/" + "BaseUrl": "http://dev.ccwin-in.com:60082/" }, "Inventory": { "BaseUrl": "http://localhost:59095/" @@ -128,10 +129,10 @@ "BaseUrl": "http://localhost:59095/" }, "Label": { - "BaseUrl": "http://dev.ccwin-in.com:21292/" + "BaseUrl": "http://dev.ccwin-in.com:60082/" }, "Message": { - "BaseUrl": "http://dev.ccwin-in.com:21292/" + "BaseUrl": "http://dev.ccwin-in.com:60082/" }, "Store": { "BaseUrl": "http://localhost:59095/" diff --git a/fe/PC/src/api/wms-api.js b/fe/PC/src/api/wms-api.js index 7d96a106d..8f8c59486 100644 --- a/fe/PC/src/api/wms-api.js +++ b/fe/PC/src/api/wms-api.js @@ -2,6 +2,7 @@ import request from '@/utils/request' import store from '@/store' // let baseURL = process.env.VUE_APP_BASE_API + '/' let baseURL = localStorage.getItem('base') + '/api/' +let printURL = localStorage.getItem('print') + '/api/' //新建 export function postCreate(data, url) { if (Object.keys(data).includes('company')) { @@ -242,7 +243,7 @@ export function getPage(data, url) { //打印标签 export function PrintServices(data) { return request({ - url: baseURL + 'reporting/PrintServices', + url: printURL + 'reporting/PrintServices', method: 'post', headers: { 'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8' @@ -408,11 +409,20 @@ export function notifyMessage(params, id) { }) } -// 库存-启用 | 库存余额 -export function inventoryBalanceActive(id) { +// 库存-启用 | 库存余额 +// export function inventoryBalanceActive(id) { +// return request({ +// url: baseURL + 'wms/inventory/inventory-balance/active?id=' + id, +// method: 'post', +// }) +// } + +// 库存-启用 | 库存余额 改 +export function inventoryBalanceActive(params) { return request({ - url: baseURL + 'wms/inventory/inventory-balance/active?id=' + id, + url: baseURL + 'wms/inventory/inventory-balance/' + params.id + '/active', method: 'post', + params: params, }) } @@ -456,8 +466,9 @@ export function createAndHandle(data) { // 人工叫料申请 | 人工发料任务 | 人工发料记录 | 自动叫料申请 | 自动发料任务 | 自动发料记录 | 直接发料记录 // 完工收货缴库申请 | 线边仓缴库申请 | 线边仓缴库记录 | 线边仓报废申请 | 线边仓报废记录 | 原料报废记录 export function materialRequestByType(data, url, params) { + let _type = params.type?params.type:params.requestType return request({ - url: baseURL + url + '/' + params.type, + url: baseURL + url + '/' + _type, method: 'post', params: params, data @@ -499,7 +510,7 @@ export function getPageListWip(data, url) { }) } -// 线边仓调拨确认按钮 | 客户调拨确认按钮 +// 线边仓调拨确认按钮 | 客户调拨确认按钮 | 自动发料记录 export function confirm(id, url) { return request({ url: baseURL + url + '/confirm/' + id, @@ -530,6 +541,22 @@ export function allSupplierByCodes(data) { data }) } + +// 根据code获取当前供应商信息 打印需要获取供应商信息(供应商简称等)相关位置 +export function getOneSupplierInfoByCode(code) { + return request({ + url: baseURL + 'basedata/supplier/by-code/' + code, + method: 'get' + }) +} + +// 根据code获取当前客户信息 打印需要获取供应商信息(客户地址等)相关位置 +export function getOneCustomerInfoByCode(code) { + return request({ + url: baseURL + 'basedata/customer/by-code/' + code, + method: 'get' + }) +} // 根据编号获取字典信息 // export function getDictByCode(code) { // return request({ diff --git a/fe/PC/src/api/wms-core.js b/fe/PC/src/api/wms-core.js index 965aa35c5..40ad301dc 100644 --- a/fe/PC/src/api/wms-core.js +++ b/fe/PC/src/api/wms-core.js @@ -2,6 +2,14 @@ import request from '@/utils/request' // let baseURL = localStorage.getItem('print') + '/api/' let baseURL = localStorage.getItem('base') + '/api/' +// 根据箱码获取标签相关信息 | 补打标签 +export function getOneInventoryLabelByCode(code) { + return request({ + url: baseURL + 'label/inventory-label/by-code/' + code, + method: 'get' + }) +} + // 批量获取箱标签信息 | 到货请求 export function getInventoryLabelByCodes(data) { return request({ diff --git a/fe/PC/src/api/wms-job.js b/fe/PC/src/api/wms-job.js index 6afac7482..62e663b3c 100644 --- a/fe/PC/src/api/wms-job.js +++ b/fe/PC/src/api/wms-job.js @@ -168,8 +168,9 @@ export function InspectJobHandle(data, params, url) { //人工发料任务 | 自动发料任务 export function materialRequestByType(data, url, params) { + let _type = params.type?params.type:params.requestType return request({ - url: baseURL + url + '/' + params.type, + url: baseURL + url + '/' + _type, method: 'post', params: params, data @@ -198,7 +199,7 @@ export function preparationPlanByNumber(params) { //质检——完成质检 export function completeSummaryDetailStatus(params, data) { return request({ - url: baseURL + 'wms/job/inspect-job/complete-summary-detail-status/' + params.id, + url: baseURL + 'wms/store/inspect-job/complete-summary-detail-status/' + params.id, method: 'post', params: params, data @@ -208,7 +209,7 @@ export function completeSummaryDetailStatus(params, data) { //质检——设置默认状态(清除质检) export function setDetailDefaultOkStatus(params, id, data) { return request({ - url: baseURL + 'wms/job/inspect-job/set-detail-default-ok-status/' + id, + url: baseURL + 'wms/store/inspect-job/set-detail-default-ok-status/' + id, method: 'post', params: params, data @@ -218,7 +219,7 @@ export function setDetailDefaultOkStatus(params, id, data) { //质检——设置详情为合格 export function setDetailOkStatus(params, id, data) { return request({ - url: baseURL + 'wms/job/inspect-job/set-detail-ok-status/' + id, + url: baseURL + 'wms/store/inspect-job/set-detail-ok-status/' + id, method: 'post', params: params, data @@ -228,7 +229,7 @@ export function setDetailOkStatus(params, id, data) { //质检——设置详情为不合格 export function setDetailNookStatus(params, id, data) { return request({ - url: baseURL + 'wms/job/inspect-job/set-detail-nook-status/' + id, + url: baseURL + 'wms/store/inspect-job/set-detail-nook-status/' + id, method: 'post', params: params, data diff --git a/fe/PC/src/components/StepsCountPlanForm/index.vue b/fe/PC/src/components/StepsCountPlanForm/index.vue index 46fbf5b54..d786649be 100644 --- a/fe/PC/src/components/StepsCountPlanForm/index.vue +++ b/fe/PC/src/components/StepsCountPlanForm/index.vue @@ -412,6 +412,15 @@ export default { //确定筛选 advancedFilter(url, list, TotalCount, data, oldSkipCount) { return () => { + // 盘点库存 过滤线边仓数据 20230417 + if (data == 'locationData') { + list.condition.filters.push({ + action: "!=", + column: "type", + logic: "And", + value: "5" + }) + } list.SkipCount = (oldSkipCount - 1) * list.MaxResultCount; this.tableLoading = true; getPageList(list, url) diff --git a/fe/PC/src/components/commonTabel-drawer/index.vue b/fe/PC/src/components/commonTabel-drawer/index.vue index c45b70de8..175f20e22 100644 --- a/fe/PC/src/components/commonTabel-drawer/index.vue +++ b/fe/PC/src/components/commonTabel-drawer/index.vue @@ -8,7 +8,6 @@ :with-header="false" :modal="false" size="100%" - style="height:calc(100% - 28px);top: 14px;right:14px" >
@@ -70,6 +69,7 @@