From 6ac6324007c9276dd2310660bac4f28919cb47ba Mon Sep 17 00:00:00 2001 From: "boxu.zheng" Date: Fri, 17 May 2024 14:50:52 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Issue/AssembleIssueJobEventHandler.cs | 3 ++ .../Jobs/Issue/CoatingIssueJobEventHandler.cs | 3 ++ .../Issue/InjectionIssueJobEventHandler.cs | 3 ++ .../Jobs/Issue/KittingIssueJobEventHandler.cs | 3 ++ .../Issue/KittingIssueRequestEventHandler.cs | 44 +++++-------------- .../Requests/Issue/SortBalance.cs | 6 +++ 6 files changed, 29 insertions(+), 33 deletions(-) create mode 100644 be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/Issue/SortBalance.cs diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Jobs/Issue/AssembleIssueJobEventHandler.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Jobs/Issue/AssembleIssueJobEventHandler.cs index dd9e3ea8c..c2ac70396 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Jobs/Issue/AssembleIssueJobEventHandler.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Jobs/Issue/AssembleIssueJobEventHandler.cs @@ -14,6 +14,9 @@ using Win_in.Sfs.Wms.Store.Domain; namespace Win_in.Sfs.Wms.Store.Event.BusinessJob; +/// +/// 装配 +/// public class AssembleIssueJobEventHandler : StoreEventHandlerBase , ILocalEventHandler> diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Jobs/Issue/CoatingIssueJobEventHandler.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Jobs/Issue/CoatingIssueJobEventHandler.cs index 9204bb067..7a445f6db 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Jobs/Issue/CoatingIssueJobEventHandler.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Jobs/Issue/CoatingIssueJobEventHandler.cs @@ -14,6 +14,9 @@ using Win_in.Sfs.Wms.Store.Domain; namespace Win_in.Sfs.Wms.Store.Event.BusinessJob; +/// +/// 喷涂 +/// public class CoatingIssueJobEventHandler : StoreEventHandlerBase , ILocalEventHandler> diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Jobs/Issue/InjectionIssueJobEventHandler.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Jobs/Issue/InjectionIssueJobEventHandler.cs index a0407ec89..b6ccf84ca 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Jobs/Issue/InjectionIssueJobEventHandler.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Jobs/Issue/InjectionIssueJobEventHandler.cs @@ -14,6 +14,9 @@ using Win_in.Sfs.Wms.Store.Domain; namespace Win_in.Sfs.Wms.Store.Event.BusinessJob; +/// +/// 注塑 +/// public class InjectionIssueJobEventHandler : StoreEventHandlerBase , ILocalEventHandler> diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Jobs/Issue/KittingIssueJobEventHandler.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Jobs/Issue/KittingIssueJobEventHandler.cs index f5a2f1bf9..b2f17565f 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Jobs/Issue/KittingIssueJobEventHandler.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Jobs/Issue/KittingIssueJobEventHandler.cs @@ -14,6 +14,9 @@ using Win_in.Sfs.Wms.Store.Domain; namespace Win_in.Sfs.Wms.Store.Event.BusinessJob; +/// +/// Kitting +/// public class KittingIssueJobEventHandler : StoreEventHandlerBase , ILocalEventHandler> diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/Issue/KittingIssueRequestEventHandler.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/Issue/KittingIssueRequestEventHandler.cs index 70d15f0e1..4fea3fc46 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/Issue/KittingIssueRequestEventHandler.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/Issue/KittingIssueRequestEventHandler.cs @@ -12,10 +12,8 @@ using Win_in.Sfs.Shared.Domain.Shared; using Win_in.Sfs.Shared.Domain.Shared.Enums.Store; using Win_in.Sfs.Shared.Event; using Win_in.Sfs.Wms.Inventory.Application.Contracts; -using Win_in.Sfs.Wms.Inventory.Domain; using Win_in.Sfs.Wms.Store.Application.Contracts; using Win_in.Sfs.Wms.Store.Domain; -using static Win_in.Sfs.Wms.Store.Domain.Shared.StoreSettings; namespace Win_in.Sfs.Wms.Store.Event.BusinessRequest; @@ -33,13 +31,11 @@ public class KittingIssueRequestEventHandler private readonly ILocationAppService _locationAppService; private readonly IBalanceAppService _balanceAppService; private IMapper _mapper; - //private readonly IKittingIssueRequestManager _kittingIssueRequestManager; public KittingIssueRequestEventHandler( IKittingIssueJobAppService kittingIssueJobAppService, IProductionLineAppService productionLineAppService, ILocationAppService locationAppService, IBalanceAppService balanceAppService, IProductionLineItemAppService productionLineItemAppService - //, IKittingIssueRequestManager kittingIssueRequestManager ) { _kittingIssueJobAppService = kittingIssueJobAppService; @@ -47,7 +43,6 @@ public class KittingIssueRequestEventHandler _locationAppService = locationAppService; _balanceAppService = balanceAppService; _productionLineItemAppService = productionLineItemAppService; - //_kittingIssueRequestManager = kittingIssueRequestManager; } /// @@ -67,8 +62,6 @@ public class KittingIssueRequestEventHandler /// Event data public virtual async Task HandleEventAsync(SfsCreatedEntityEventData> eventData) { - var entity = eventData.Entity; - await Task.CompletedTask.ConfigureAwait(false); } @@ -179,8 +172,7 @@ public class KittingIssueRequestEventHandler if (kittingIssueJobDetailInputs.Any()) { - var kittingIssueJobEditInput = new KittingIssueJobEditInput(); - kittingIssueJobEditInput = await BuildKittingIssueJobCreateInputWithQtyTypeAsync(kittingIssueRequest, + var kittingIssueJobEditInput = await BuildKittingIssueJobCreateInputWithQtyTypeAsync(kittingIssueRequest, kittingIssueRequestDetails.First()).ConfigureAwait(false); kittingIssueJobEditInput.Details = kittingIssueJobDetailInputs; jobs.Add(kittingIssueJobEditInput); @@ -212,7 +204,6 @@ public class KittingIssueRequestEventHandler return job; } - /// /// 构造注塑任务明细-按数量 /// @@ -339,10 +330,8 @@ public class KittingIssueRequestEventHandler { var inputJobs = new List(); - var jobs = await _kittingIssueJobAppService.GetByRequestNumberAsync(kittingIssueRequest.Number).ConfigureAwait(false); - - //已用的库存的集合 - useBalanceList = useBalanceList; + var jobs = await _kittingIssueJobAppService.GetByRequestNumberAsync(kittingIssueRequest.Number) + .ConfigureAwait(false); foreach (var detail in kittingIssueRequestDetailList) { @@ -354,7 +343,6 @@ public class KittingIssueRequestEventHandler var productionLineDto = await _productionLineAppService .GetByLocationCodeAsync(inputDetails.First().ToLocationCode).ConfigureAwait(false); - var productLineCodeAndItemCode = await _productionLineItemAppService .GetByProductLineCodeAndItemCodeAsync(productionLineDto.Code, detail.ItemCode) .ConfigureAwait(false); @@ -375,7 +363,7 @@ public class KittingIssueRequestEventHandler if (usableList.Any()) { var firstUsable = usableList.First(); - useBalanceList.Add((BalanceDTO)firstUsable); + useBalanceList.Add(firstUsable); usableList.Remove(firstUsable); var kittingIssueJobEditInput = @@ -429,7 +417,6 @@ public class KittingIssueRequestEventHandler /// /// /// - /// /// private async Task BuildKittingIssueJobDetailWithBoxQtyTypeAsync( KittingIssueRequestDetail kittingIssueRequestDetail, BalanceDTO balance) @@ -540,7 +527,7 @@ public class KittingIssueRequestEventHandler IsPackingCode = true }; var usableList = await _balanceAppService.GetUsableListAsync(input).ConfigureAwait(false); - var sortByFifoAsync=await SortByFifoAsync(usableList).ConfigureAwait(false); + var sortByFifoAsync = await SortByFifoAsync(usableList).ConfigureAwait(false); //因为是按箱叫料 先把值赋值给箱数量上 kittingIssueRequestDetail.BoxQty = kittingIssueRequestDetail.Qty; @@ -594,8 +581,6 @@ public class KittingIssueRequestEventHandler } } - usableList = temp; - kittingIssueJobEditInputs.AddRange( await CreateKittingIssueJobWithQtyTypeAsync(kittingIssueRequest, new List { kittingIssueRequestDetail }, temp, @@ -665,18 +650,15 @@ public class KittingIssueRequestEventHandler requestDetail.ReceivedQty = allReceivedQty; } } - - //await _kittingIssueRequestManager.UpdateAsync(kittingIssueRequest).ConfigureAwait(false); } /// - /// 排序规则 1.批次正序 2.底层 3.到货日期正序 4.数量倒序(整箱优先) 5.库位正序 6.箱码正序 + /// 排序规则 1.批次正序 2.底层 3.到货日期正序 4.数量倒序(整箱优先) 5.库位正序 6.箱码正序 /// /// /// public async Task> SortByFifoAsync(List balances) { - var sortBalances = new List(); var config = new MapperConfiguration(cfg => { cfg.CreateMap() @@ -687,15 +669,16 @@ public class KittingIssueRequestEventHandler var resultBalances = _mapper.Map, List>(balances); foreach (var resultBalance in resultBalances) { - var locationDto=await _locationAppService.GetByCodeAsync(resultBalance.LocationCode).ConfigureAwait(false); + var locationDto = + await _locationAppService.GetByCodeAsync(resultBalance.LocationCode).ConfigureAwait(false); resultBalance.LocationRow = locationDto.RowCode; } - resultBalances=resultBalances + resultBalances = resultBalances .OrderBy(p => p.Lot) - .ThenBy(p=>p.LocationRow) + .ThenBy(p => p.LocationRow) .ThenBy(p => p.PutInTime) - .ThenBy(p => p.Qty)//2023-9-14 苑静雯 从小数开始发料 + .ThenBy(p => p.Qty) //2023-9-14 苑静雯 从小数开始发料 .ThenBy(p => p.LocationCode) .ThenBy(p => p.PackingCode) .ToList(); @@ -703,8 +686,3 @@ public class KittingIssueRequestEventHandler return resultBalances; } } - -public class SortBalance: BalanceDTO -{ - public int LocationRow { get; set; } -} diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/Issue/SortBalance.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/Issue/SortBalance.cs new file mode 100644 index 000000000..e2121fa60 --- /dev/null +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/Issue/SortBalance.cs @@ -0,0 +1,6 @@ +using Win_in.Sfs.Wms.Inventory.Application.Contracts; + +public class SortBalance : BalanceDTO +{ + public int LocationRow { get; set; } +}