From fd920e21a37b6481ffe580525e43d728897101ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=91=E6=B8=A4=E6=97=AD=5BIrelia=5D?= <366601522@qq.com> Date: Mon, 24 Apr 2023 22:34:30 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=BA=93=E4=BD=8D?= =?UTF-8?q?=E5=AF=BC=E5=85=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Locations/LocationAutoMapperProfile.cs | 32 +++++++++---------- .../SfsCrudWithDetailsAppServiceBase.cs | 7 ++-- 2 files changed, 21 insertions(+), 18 deletions(-) diff --git a/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/Locations/LocationAutoMapperProfile.cs b/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/Locations/LocationAutoMapperProfile.cs index 5bbeca507..492e50342 100644 --- a/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/Locations/LocationAutoMapperProfile.cs +++ b/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/Locations/LocationAutoMapperProfile.cs @@ -17,22 +17,22 @@ public partial class BasedataApplicationAutoMapperProfile : Profile .Ignore(x => x.TenantId) .Ignore(x => x.ExtraProperties) .Ignore(x => x.ConcurrencyStamp) - .Ignore(x => x.EnableMixItem) - .Ignore(x => x.EnableMixLot) - .Ignore(x => x.EnableMixStatus) - .Ignore(x => x.EnableNegative) - .Ignore(x => x.EnableKeepZero) - .Ignore(x => x.EnableOpportunityCount) - .Ignore(x => x.EnablePick) - .Ignore(x => x.EnableOverPick) - .Ignore(x => x.EnableWholeStore) - .Ignore(x => x.EnableBreakStore) - .Ignore(x => x.EnableShip) - .Ignore(x => x.EnableReceive) - .Ignore(x => x.EnableReturnToSupplier) - .Ignore(x => x.EnableReturnFromCustomer) - .Ignore(x => x.EnableSplitPallet) - .Ignore(x => x.EnableSplitBox) + //.Ignore(x => x.EnableMixItem) + //.Ignore(x => x.EnableMixLot) + //.Ignore(x => x.EnableMixStatus) + //.Ignore(x => x.EnableNegative) + //.Ignore(x => x.EnableKeepZero) + //.Ignore(x => x.EnableOpportunityCount) + //.Ignore(x => x.EnablePick) + //.Ignore(x => x.EnableOverPick) + //.Ignore(x => x.EnableWholeStore) + //.Ignore(x => x.EnableBreakStore) + //.Ignore(x => x.EnableShip) + //.Ignore(x => x.EnableReceive) + //.Ignore(x => x.EnableReturnToSupplier) + //.Ignore(x => x.EnableReturnFromCustomer) + //.Ignore(x => x.EnableSplitPallet) + //.Ignore(x => x.EnableSplitBox) ; 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 fd6654cd6..64a9ac7db 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 @@ -772,8 +772,11 @@ public abstract class SfsCrudWithDetailsAppServiceBase p.Name == "Worker"); - first.SetValue(first, CurrentUser.GetUserName()); + if (entity.GetProps().Any(p => p.Name == "Worker")) + { + var first = entity.GetProps().First(p => p.Name == "Worker"); + first.SetValue(first, CurrentUser.GetUserName()); + } } var hasEntity = entity != null; From 9ec043dadfc8c50b304685e1102e93ed7454189b Mon Sep 17 00:00:00 2001 From: "boxu.zheng" Date: Tue, 25 Apr 2023 09:28:13 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E4=BF=AE=E6=94=B9=20bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ProductReceiptNoteManager.cs | 2 +- .../PurchaseOrders/PurchaseOrderManager.cs | 1 - .../Transactions/BackFlushNoteEventHandler.cs | 1 + .../ProductReceiptNoteEventHandler.cs | 31 +++++++++++++++++-- 4 files changed, 30 insertions(+), 5 deletions(-) diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Notes/ProductReceiptNotes/ProductReceiptNoteManager.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Notes/ProductReceiptNotes/ProductReceiptNoteManager.cs index 5b6caa107..855f7519d 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Notes/ProductReceiptNotes/ProductReceiptNoteManager.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Notes/ProductReceiptNotes/ProductReceiptNoteManager.cs @@ -42,7 +42,7 @@ public class ProductReceiptNoteManager : SfsStoreManagerBase CreateAsync(ProductReceiptNote productReceiptNote) { - if (string.IsNullOrEmpty(productReceiptNote.ProductionPlanNumber) == false) + if (string.IsNullOrEmpty(productReceiptNote.ProductionPlanNumber) == false) { //更新生产计划 var productionPlan = await _productionPlanRepository.FindAsync(c => c.Number == productReceiptNote.ProductionPlanNumber, true).ConfigureAwait(false); diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Orders/PurchaseOrders/PurchaseOrderManager.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Orders/PurchaseOrders/PurchaseOrderManager.cs index 721b1c17c..965a025b8 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Orders/PurchaseOrders/PurchaseOrderManager.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Orders/PurchaseOrders/PurchaseOrderManager.cs @@ -54,7 +54,6 @@ public class PurchaseOrderManager : SfsStoreManagerBase eventData) @@ -30,7 +40,7 @@ public class ProductReceiptNoteEventHandler { var inboundTransactions = new List(); - inboundTransactions.AddRange(BuildTransactions(productReceiptNote)); + inboundTransactions.AddRange(await BuildTransactions(productReceiptNote)); await TransactionAppService.AddManyAsync(inboundTransactions).ConfigureAwait(false); @@ -51,13 +61,13 @@ public class ProductReceiptNoteEventHandler //如果要做库存事务汇总,可以修改此处 foreach (var productReceiptNote in productReceiptNotes) { - inboundTransactions.AddRange(BuildTransactions(productReceiptNote)); + inboundTransactions.AddRange(await BuildTransactions(productReceiptNote)); } await TransactionAppService.AddManyAsync(inboundTransactions).ConfigureAwait(false); } - private List BuildTransactions(ProductReceiptNote productReceiptNote) + private async Task> BuildTransactions(ProductReceiptNote productReceiptNote) { var transactionCreateInputs = new List(); //构造库存入库创建Input @@ -65,6 +75,21 @@ public class ProductReceiptNoteEventHandler { var transaction = ObjectMapper.Map(detail); + var itemBasicDto= await _itemBasicAppService.GetByCodeAsync(detail.ItemCode).ConfigureAwait(false); + ; + detail.ItemDesc1 = itemBasicDto.Desc1; + detail.ItemDesc2 = itemBasicDto.Desc2; + detail.ItemName=itemBasicDto.Name; + detail.StdPackQty=itemBasicDto.StdPackQty; + + var erpLocationDtos= await _locationAppService.GetListByTypesAndErpCodeAsync(new List { EnumLocationType.WIP }, + detail.LocationErpCode).ConfigureAwait(false); + var erpLocationDto = erpLocationDtos.First(); + detail.LocationArea = erpLocationDto.Code; + detail.LocationGroup = erpLocationDto.LocationGroupCode; + detail.LocationErpCode= erpLocationDto.Code; + detail.LocationCode= erpLocationDto.Code; + transaction.TransType = TransType; transaction.TransInOut = TransInOut; transaction.WarehouseCode = productReceiptNote.WarehouseCode; From 9a0eb96959b368af561f779ffe1089e4b7d746b2 Mon Sep 17 00:00:00 2001 From: "boxu.zheng" Date: Tue, 25 Apr 2023 11:59:23 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E4=BF=AE=E6=94=B9bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ItemBasics/Inputs/ItemBasicImportInput.cs | 8 ++++---- .../SupplierTimeWindowAutoMapperProfile.cs | 3 +-- .../IPurchaseReceiptRequestAppService.cs | 10 ++++++++++ .../PurchaseReceiptRequestAppService.cs | 18 ++++++++++++++++++ .../Jobs/InspectJobs/InspectJobManager.cs | 7 +++++-- .../PurchaseReceiptNoteEventHandler.cs | 18 +++++++++++++++++- .../PurchaseReturnNoteEventHandler.cs | 12 +++++++++--- 7 files changed, 64 insertions(+), 12 deletions(-) diff --git a/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application.Contracts/ItemBasics/Inputs/ItemBasicImportInput.cs b/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application.Contracts/ItemBasics/Inputs/ItemBasicImportInput.cs index 02db0e15a..3a847cf3d 100644 --- a/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application.Contracts/ItemBasics/Inputs/ItemBasicImportInput.cs +++ b/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application.Contracts/ItemBasics/Inputs/ItemBasicImportInput.cs @@ -79,10 +79,10 @@ public class ItemBasicImportInput : SfsBaseDataImportInputBase /// 类型 /// [Display(Name = "类型")] - [ValueMapping("成品", "成品")] - [ValueMapping("原料", "原料")] - [ValueMapping("物料", "物料")] - [ValueMapping("半成品", "半成品")] + [ValueMapping("10C01", "10C01")] + [ValueMapping("10C02", "10C02")] + [ValueMapping("10C03", "10C03")] + [ValueMapping("10C04", "10C04")] public string Type { get; set; } /// diff --git a/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/SupplierTimeWindows/SupplierTimeWindowAutoMapperProfile.cs b/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/SupplierTimeWindows/SupplierTimeWindowAutoMapperProfile.cs index 8886ae52e..23e93166e 100644 --- a/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/SupplierTimeWindows/SupplierTimeWindowAutoMapperProfile.cs +++ b/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/SupplierTimeWindows/SupplierTimeWindowAutoMapperProfile.cs @@ -17,11 +17,10 @@ public partial class BasedataApplicationAutoMapperProfile : Profile .Ignore(x => x.TenantId) .Ignore(x => x.ExtraProperties) .Ignore(x => x.ConcurrencyStamp) - .Ignore(x => x.SupplierName) ; CreateMap() - .Ignore(x => x.ReportStatus) + .Ignore(x => x.ReportStatus) .Ignore(x => x.ReportReason); } } diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/PurchaseReceiptRequests/IPurchaseReceiptRequestAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/PurchaseReceiptRequests/IPurchaseReceiptRequestAppService.cs index 07a28912f..8cb796843 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/PurchaseReceiptRequests/IPurchaseReceiptRequestAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/PurchaseReceiptRequests/IPurchaseReceiptRequestAppService.cs @@ -1,6 +1,7 @@ using System.Collections.Generic; using System.Threading.Tasks; using Win_in.Sfs.Shared.Application.Contracts; +using Win_in.Sfs.Shared.Domain.Shared; namespace Win_in.Sfs.Wms.Store.Application.Contracts; @@ -29,4 +30,13 @@ public interface IPurchaseReceiptRequestAppService /// Task GetDetailByItemAndPackingAsync(string itemCode, string packingCode); + + /// + /// 修改请求状态 + /// + /// + /// + /// + Task UpdatePurchaseReceiptRequestAsync(string number, + EnumRequestStatus enumRequestStatus); } diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/PurchaseReceiptRequests/PurchaseReceiptRequestAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/PurchaseReceiptRequests/PurchaseReceiptRequestAppService.cs index ded767df5..59210677d 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/PurchaseReceiptRequests/PurchaseReceiptRequestAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/PurchaseReceiptRequests/PurchaseReceiptRequestAppService.cs @@ -4,9 +4,11 @@ using System.Linq; using System.Threading.Tasks; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; +using Volo.Abp.ObjectMapping; using Volo.Abp.Uow; using Win_in.Sfs.Basedata.Application.Contracts; using Win_in.Sfs.Label.Application.Contracts; +using Win_in.Sfs.Shared.Domain.Shared; using Win_in.Sfs.Wms.Store.Application.Contracts; using Win_in.Sfs.Wms.Store.Domain; using Win_in.Sfs.Wms.Store.Domain.Shared; @@ -120,6 +122,22 @@ public class PurchaseReceiptRequestAppService : return ObjectMapper.Map, List>(entity); } + /// + /// 修改请求状态 + /// + /// + /// + /// + [HttpGet("update-request-status")] + public virtual async Task UpdatePurchaseReceiptRequestAsync(string number, + EnumRequestStatus enumRequestStatus) + { + var entity=await _repository.GetAsync(p => p.Number == number).ConfigureAwait(false); + entity.RequestStatus=enumRequestStatus; + entity= await _repository.UpdateAsync(entity).ConfigureAwait(false); + return ObjectMapper.Map(entity); + } + protected override Func GetEntityExpression() { throw new NotImplementedException(); diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Jobs/InspectJobs/InspectJobManager.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Jobs/InspectJobs/InspectJobManager.cs index 68e6f5e97..dd44a42dc 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Jobs/InspectJobs/InspectJobManager.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Jobs/InspectJobs/InspectJobManager.cs @@ -148,8 +148,11 @@ public class InspectJobManager : SfsJobManagerBase }); var goodqty = jobEntity.Details.Where(p => - p.DetailInspectStatus == EnumDetailInspectStatus.DefaultOK || - p.DetailInspectStatus == EnumDetailInspectStatus.OK).Sum(p => p.GoodQty); + (p.DetailInspectStatus == EnumDetailInspectStatus.DefaultOK || + p.DetailInspectStatus == EnumDetailInspectStatus.OK) + && p.ItemCode == input.ItemCode + && p.Lot == input.Lot) + .Sum(p => p.GoodQty); //获取 汇总详情 var summaryDetailEntity = jobEntity.SummaryDetails.Find(p => p.Id == summaryDetailId); 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 719171fa8..4bf33466c 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 @@ -30,6 +30,7 @@ public class PurchaseReceiptNoteEventHandler private readonly IPurchaseOrderAppService _purchaseOrderAppService; private readonly IItemQualityAppService _itemQualityAppService; private readonly ISupplierAsnAppService _supplierAsnAppService; + private readonly IPurchaseReceiptRequestAppService _purchaseReceiptRequestAppService; /// /// 收货记录 @@ -41,12 +42,14 @@ public class PurchaseReceiptNoteEventHandler IInspectRequestAppService inspectRequestAppService, IPurchaseOrderAppService purchaseOrderAppService, IItemQualityAppService itemQualityAppService, - ISupplierAsnAppService supplierAsnAppService) + ISupplierAsnAppService supplierAsnAppService, + IPurchaseReceiptRequestAppService purchaseReceiptRequestAppService) { _inspectRequestAppService = inspectRequestAppService; _purchaseOrderAppService = purchaseOrderAppService; _itemQualityAppService = itemQualityAppService; _supplierAsnAppService = supplierAsnAppService; + _purchaseReceiptRequestAppService = purchaseReceiptRequestAppService; } /// @@ -70,6 +73,9 @@ public class PurchaseReceiptNoteEventHandler //更新订单已收货数量 await UpdatePurchaseOrderAsync(entity).ConfigureAwait(false); + //更新收货请求状态 + await UpdatePurchaseReceiptRequest(entity.PurchaseReceiptRequestNumber).ConfigureAwait(false); + //更新发货单状态 await UpdateSupplierAsnAsync(entity.AsnNumber).ConfigureAwait(false); } @@ -108,6 +114,16 @@ public class PurchaseReceiptNoteEventHandler await _supplierAsnAppService.UpdateStatusAsync(asnNumber,EnumSupplierAsnStatus.Received).ConfigureAwait(false); } + /// + /// 更新发货请求状态 + /// + /// + /// + private async Task UpdatePurchaseReceiptRequest(string purchaseReceiptRequestNumber) + { + await _purchaseReceiptRequestAppService.UpdatePurchaseReceiptRequestAsync(purchaseReceiptRequestNumber,EnumRequestStatus.Completed).ConfigureAwait(false); + } + #region 私有 /// 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 0c5f36fa1..d71e51a92 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.Basedata.Application.Contracts; using Win_in.Sfs.Label.Application.Contracts; using Win_in.Sfs.Shared.Domain.Shared; using Win_in.Sfs.Shared.Event; @@ -27,15 +28,18 @@ public class PurchaseReturnNoteEventHandler private readonly IPurchaseReturnRequestAppService _purchaseReturnRequestApp; private readonly IPurchaseOrderAppService _purchaseOrderAppService; private readonly IInventoryLabelAppService _inventoryLabelAppService; + private readonly IItemBasicAppService _itemBasicAppService; public PurchaseReturnNoteEventHandler( IPurchaseReturnRequestAppService purchaseReturnRequestApp , IPurchaseOrderAppService purchaseOrderAppService, - IInventoryLabelAppService inventoryLabelAppService) + IInventoryLabelAppService inventoryLabelAppService, + IItemBasicAppService itemBasicAppService) { _purchaseReturnRequestApp = purchaseReturnRequestApp; _purchaseOrderAppService = purchaseOrderAppService; _inventoryLabelAppService = inventoryLabelAppService; + _itemBasicAppService = itemBasicAppService; } [UnitOfWork] @@ -81,7 +85,7 @@ public class PurchaseReturnNoteEventHandler { var inboundTransactions = new List(); - inboundTransactions.AddRange(BuildTransactions(purchaseReturnNote)); + inboundTransactions.AddRange(await BuildTransactions(purchaseReturnNote).ConfigureAwait(false)); await TransactionAppService.AddManyAsync(inboundTransactions).ConfigureAwait(false); @@ -118,12 +122,13 @@ public class PurchaseReturnNoteEventHandler } */ - private List BuildTransactions(PurchaseReturnNote purchaseReturnNote) + private async Task> BuildTransactions(PurchaseReturnNote purchaseReturnNote) { var transactions = new List(); //构造库存转移记录创建Input foreach (var detail in purchaseReturnNote.Details.Where(detail => detail.Qty != 0)) { + var itemBasicDto= await _itemBasicAppService.GetByCodeAsync(detail.ItemCode).ConfigureAwait(false); var transaction = ObjectMapper.Map(detail); transaction.TransType = @@ -134,6 +139,7 @@ public class PurchaseReturnNoteEventHandler transaction.Worker = purchaseReturnNote.Worker; transaction.DocNumber = purchaseReturnNote.Number; transaction.JobNumber = purchaseReturnNote.JobNumber; + transaction.ManageType = itemBasicDto.ManageType; //transaction.Status = // detail.Status == EnumInventoryStatus.None // ? InventoryStatus