From 0c40a5d4cf5115cd93b1fc692e3fbe010c610785 Mon Sep 17 00:00:00 2001 From: lvzb <35200379@qq.com> Date: Fri, 31 May 2024 13:44:41 +0800 Subject: [PATCH] =?UTF-8?q?bug=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Incoming/MesOutConverter.cs | 2 +- .../TyrpAgentModule.cs | 2 +- .../appsettings.json | 2 +- .../Properties/launchSettings.json | 3 ++ .../PurchasePriceSheetAutoMapperProfile.cs | 4 +++ .../SalePriceSheetAutoMapperProfile.cs | 4 +++ .../StdCostPriceSheetAutoMapperProfile.cs | 4 +++ .../RecycledMaterialReceiptNoteAppService.cs | 3 +- .../PurchaseOrders/PurchaseOrderAppService.cs | 32 +++++++++++++++++-- ...RecycledMaterialReceiptNoteEventHandler.cs | 8 ++--- .../ItemTransformNoteEventHandler.cs | 2 +- .../settings/appsettings.Development.json | 4 +-- 12 files changed, 56 insertions(+), 14 deletions(-) diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent/Incoming/MesOutConverter.cs b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent/Incoming/MesOutConverter.cs index 5ede235e6..55f019b5b 100644 --- a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent/Incoming/MesOutConverter.cs +++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent/Incoming/MesOutConverter.cs @@ -108,7 +108,7 @@ public class MesOutConverter : IIncomingConverter wmsProductReceiptNoteDetail.Lot = ""; //排序批次 wmsProductReceiptNoteDetail.PackingCode = "";//箱标签 wmsProductReceiptNoteDetail.Status = EnumInventoryStatus.OK; - wmsProductReceiptNoteDetail.WarehouseCode = "T8"; + wmsProductReceiptNoteDetail.WarehouseCode = "T9"; wmsProductReceiptNoteDetail.LocationArea = ""; wmsProductReceiptNoteDetail.LocationGroup = ""; if (wmsProductReceiptNoteDetail.MesQuality=="1")//质量补 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 ab6456637..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,7 +172,7 @@ public class TyrpAgentModule : AbpModule ApplicationInitializationContext context) { - // 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 34e4e7d63..5fc6279cf 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 @@ -3,7 +3,7 @@ "Default": "Server=dev.ccwin-in.com,13319;Database=WMS_DongYang_Main_CC;uid=ccwin-in;pwd=Microsoft@2022;TrustServerCertificate=True;Encrypt=false", "DataExchange": "Server=dev.ccwin-in.com,13319;Database=WMS_DongYang_DataExchange_CC;uid=ccwin-in;pwd=Microsoft@2022;TrustServerCertificate=True;Encrypt=false", "TYRP": "Server=dev.ccwin-in.com,13319;Database=TYRP_CC;Uid=ccwin-in;Pwd=Microsoft@2022;TrustServerCertificate=True", - "SYBASE_TYRP": "Data Source=10.164.115.137; Port=5000; Database=mesdb; Uid=sa; Pwd=dawning;Charset=cp850;" //iso_1 + "SYBASE_TYRP": "Data Source=10.164.233.4; Port=5000; Database=mesdb; Uid=sa; Pwd=dawning;Charset=cp850;" //iso_1 }, "AuthServer": { diff --git a/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Agent/Properties/launchSettings.json b/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Agent/Properties/launchSettings.json index 33504c948..f465bfc2b 100644 --- a/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Agent/Properties/launchSettings.json +++ b/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Agent/Properties/launchSettings.json @@ -3,6 +3,9 @@ "WSL": { "commandName": "WSL2", "distributionName": "" + }, + "Win_in.Sfs.Wms.DataExchange.Agent": { + "commandName": "Project" } } } \ No newline at end of file diff --git a/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/PurchasePrices/PurchasePriceSheetAutoMapperProfile.cs b/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/PurchasePrices/PurchasePriceSheetAutoMapperProfile.cs index 10326b686..e464881e4 100644 --- a/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/PurchasePrices/PurchasePriceSheetAutoMapperProfile.cs +++ b/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/PurchasePrices/PurchasePriceSheetAutoMapperProfile.cs @@ -11,5 +11,9 @@ public partial class BasedataApplicationAutoMapperProfile : Profile { CreateMap() .ReverseMap(); + CreateMap() +.IgnoreAuditedObjectProperties() +.Ignore(x => x.ConcurrencyStamp) +.Ignore(x => x.Id); } } diff --git a/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/SalePrices/SalePriceSheetAutoMapperProfile.cs b/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/SalePrices/SalePriceSheetAutoMapperProfile.cs index 840a4f415..e11d9d291 100644 --- a/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/SalePrices/SalePriceSheetAutoMapperProfile.cs +++ b/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/SalePrices/SalePriceSheetAutoMapperProfile.cs @@ -11,5 +11,9 @@ public partial class BasedataApplicationAutoMapperProfile : Profile { CreateMap() .ReverseMap(); + CreateMap() + .IgnoreAuditedObjectProperties() + .Ignore(x => x.ConcurrencyStamp) + .Ignore(x => x.Id); } } diff --git a/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/StdCostPrices/StdCostPriceSheetAutoMapperProfile.cs b/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/StdCostPrices/StdCostPriceSheetAutoMapperProfile.cs index f99988470..abee52c1b 100644 --- a/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/StdCostPrices/StdCostPriceSheetAutoMapperProfile.cs +++ b/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/StdCostPrices/StdCostPriceSheetAutoMapperProfile.cs @@ -11,5 +11,9 @@ public partial class BasedataApplicationAutoMapperProfile : Profile { CreateMap() .ReverseMap(); + CreateMap() + .IgnoreAuditedObjectProperties() + .Ignore(x => x.ConcurrencyStamp) + .Ignore(x => x.Id); } } 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 c66029c60..71210b82b 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 @@ -75,7 +75,7 @@ public class RecycledMaterialReceiptNoteAppService : entity = await _repository.InsertAsync(entity).ConfigureAwait(false); await LocalEventBus.PublishAsync(new SfsCreatedEntityEventData(entity), false).ConfigureAwait(false); - + await LocalEventBus.PublishAsync(new SfsCompletedEntityEventData(entity), false).ConfigureAwait(false); return ObjectMapper.Map(entity); } @@ -110,6 +110,7 @@ public class RecycledMaterialReceiptNoteAppService : } entity = await _repository.InsertAsync(entity).ConfigureAwait(false); + await LocalEventBus.PublishAsync(new SfsCompletedEntityEventData(entity), false).ConfigureAwait(false); return ObjectMapper.Map(entity); } } 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 b170280e8..46c284ca6 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 @@ -9,6 +9,7 @@ using Microsoft.EntityFrameworkCore; using Volo.Abp; using Volo.Abp.Domain.Entities; using Volo.Abp.Domain.Repositories; +using Win_in.Sfs.Basedata.Application; using Win_in.Sfs.Basedata.Application.Contracts; using Win_in.Sfs.Shared.Domain; using Win_in.Sfs.Shared.Domain.Shared; @@ -30,13 +31,15 @@ public class PurchaseOrderAppService : private readonly ISupplierAppService _supplierAppService; private readonly IItemBasicAppService _itemBasicAppService; private readonly ILocationAppService _locationAppService; + public readonly IPurchasePriceSheetAppService _purchasePriceSheetAppService; public PurchaseOrderAppService( IPurchaseOrderRepository repository, IPurchaseOrderManager purchaseOrderManager, ISupplierAppService supplierAppService, IItemBasicAppService itemBasicAppService - , ILocationAppService locationAppService) : base(repository) + , ILocationAppService locationAppService, +IPurchasePriceSheetAppService purchasePriceSheetAppService) : base(repository) { _repository = repository; _purchaseOrderManager = purchaseOrderManager; @@ -46,6 +49,7 @@ public class PurchaseOrderAppService : base.CreatePolicyName = PurchaseOrderPermissions.Create; base.UpdatePolicyName = PurchaseOrderPermissions.Update; base.DeletePolicyName = PurchaseOrderPermissions.Delete; + _purchasePriceSheetAppService = purchasePriceSheetAppService; } #region 东阳使用 @@ -60,7 +64,6 @@ public class PurchaseOrderAppService : { var ImportData = dictionary.Select(p => p.Key); - #region 校验ERP库位是否存在 var allTempErpLocationCode = ImportData.Select(p => p.Details.Select(p => p.LocationErpCode).ToList()).ToList(); var allErpLocationCode = new List(); @@ -87,6 +90,7 @@ public class PurchaseOrderAppService : #endregion + foreach (var purchaseOrder in ImportData) { purchaseOrder.CreatorId = CurrentUser.Id; @@ -98,10 +102,18 @@ public class PurchaseOrderAppService : purchaseOrder.SupplierName = supplierDto.Name; if (purchaseOrder.OrderStatus == EnumOrderStatus.Close) { - throw new UserFriendlyException($"不允许导入关闭订单状态的订单"); + throw new UserFriendlyException($"不允许导入关闭订单状态的订单!"); + } + #region 校验行号是否有重复的 + var polineCount = purchaseOrder.Details.GroupBy(r => r.PoLine).Count(); + if (polineCount != purchaseOrder.Details.Count) + { + throw new UserFriendlyException($"同一订单号内行号不允许重复!"); } + #endregion foreach (var detail in purchaseOrder.Details) { + await CheckItemPrice(purchaseOrder.SupplierCode,detail.ItemCode).ConfigureAwait(false); detail.LineStatus = EnumOrderStatus.Open; var itemBasicDto = itemBasicDtos.First(p => p.Code == detail.ItemCode); @@ -115,6 +127,8 @@ public class PurchaseOrderAppService : return dictionary; } + + /// /// 【创建】采购订单 /// @@ -209,6 +223,18 @@ public class PurchaseOrderAppService : return result; } + /// + /// 校验采购价格 + /// + /// + private async Task CheckItemPrice(string supplierCode, string itemCode ) + { + var isprice = await _purchasePriceSheetAppService.CheckPurPriceAsync(supplierCode, itemCode).ConfigureAwait(false); + if (isprice) + { + throw new UserFriendlyException($"供应商【{supplierCode}】零件名称【{itemCode}】无采购价格无法执行采购上架!"); + } + } private async Task> CheckErpLocationCodeAsync(List erpLocationCodes) { erpLocationCodes = erpLocationCodes.Distinct().ToList(); diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/DataExchanges/RecycledMaterialReceiptNoteEventHandler.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/DataExchanges/RecycledMaterialReceiptNoteEventHandler.cs index 2d4c787df..7967fb11a 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/DataExchanges/RecycledMaterialReceiptNoteEventHandler.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/DataExchanges/RecycledMaterialReceiptNoteEventHandler.cs @@ -11,20 +11,20 @@ namespace Win_in.Sfs.Wms.Store.Event.DataExchanges; public class RecycledMaterialReceiptNoteEventHandler : StoreDataExchangeEventHandlerBase -, ILocalEventHandler> -, ILocalEventHandler>> +, ILocalEventHandler> +, ILocalEventHandler>> { private const EnumExchangeDataType ExchangeDataType = EnumExchangeDataType.RecycledMaterialReceipt; [UnitOfWork] - public virtual async Task HandleEventAsync(SfsCreatedEntityEventData eventData) + public virtual async Task HandleEventAsync(SfsCompletedEntityEventData eventData) { var entity = eventData.Entity; await AddExchangeDataAsync(entity).ConfigureAwait(false); } [UnitOfWork] - public virtual async Task HandleEventAsync(SfsCreatedEntityEventData> eventData) + public virtual async Task HandleEventAsync(SfsCompletedEntityEventData> eventData) { var entities = eventData.Entity; await AddExchangeDataAsync(entities).ConfigureAwait(false); diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Transactions/ItemTransformNoteEventHandler.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Transactions/ItemTransformNoteEventHandler.cs index 601b86bbd..c21888889 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Transactions/ItemTransformNoteEventHandler.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Transactions/ItemTransformNoteEventHandler.cs @@ -256,7 +256,7 @@ public class ItemTransformNoteEventHandler JobNumber = note.JobNumber, DocNumber = note.Number, TransType = Type, - TransSubType = SubType, + TransSubType = EnumTransSubType.UnplannedReceipt_RecycledMaterialReceipt, TransInOut = EnumTransInOut.In, LocationArea = detail.FromLocationArea, LocationGroup = detail.FromLocationGroup, diff --git a/build/src/docker/publish/conf/settings/appsettings.Development.json b/build/src/docker/publish/conf/settings/appsettings.Development.json index c9e77bfc5..f41838a40 100644 --- a/build/src/docker/publish/conf/settings/appsettings.Development.json +++ b/build/src/docker/publish/conf/settings/appsettings.Development.json @@ -117,8 +117,8 @@ //"BaseUrl": "http://localhost:59093/" }, "BaseData": { - "BaseUrl": "http://dev.ccwin-in.com:60084/" - //"BaseUrl": "http://localhost:59094/" + // "BaseUrl": "http://dev.ccwin-in.com:60084/" + "BaseUrl": "http://localhost:59094/" }, "Default": { "BaseUrl": "http://dev.ccwin-in.com:60083/"