From f2a48f88620a8eefcc1513005f3e49fab60ba77e Mon Sep 17 00:00:00 2001 From: lvzb <35200379@qq.com> Date: Thu, 18 Jan 2024 14:25:25 +0800 Subject: [PATCH 1/4] =?UTF-8?q?1.=E9=9D=9E=E7=94=9F=E4=BA=A7=E9=A2=86?= =?UTF-8?q?=E9=80=80=E6=96=99=E5=8E=9F=E6=9D=A5=E5=85=81=E8=AE=B8=E5=AF=BC?= =?UTF-8?q?=E5=85=A5=E6=88=90=E5=93=81=E5=BA=93=E6=95=B0=E6=8D=AE=202.?= =?UTF-8?q?=E9=9D=9E=E7=94=9F=E4=BA=A7=E9=A2=86=E6=96=99=E5=8E=9F=E6=96=99?= =?UTF-8?q?=E5=BA=93=E5=AD=98=E6=8E=A8=E8=8D=90=E5=8A=A0=E5=8F=82=E6=95=B0?= =?UTF-8?q?=E6=8E=A7=E5=88=B6=E6=98=AF=E5=90=A6=E4=B8=8D=E6=8E=A8=E8=8D=90?= =?UTF-8?q?=E6=97=A0=E7=AE=B1=E7=A0=81=E5=BA=93=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Balances/Inputs/RecommendBalanceRequestInput.cs | 6 ++++++ .../Balances/BalanceAppService.cs | 2 +- .../Balances/BalanceManager.cs | 8 +++++++- .../Balances/IBalanceManager.cs | 2 +- .../UnplannedIssueRequestForDongyangAppService.cs | 11 +++++++---- .../UnplannedReceiptRequestForDongyangAppService.cs | 5 +++-- 6 files changed, 25 insertions(+), 9 deletions(-) diff --git a/be/Modules/Inventory/src/Win_in.Sfs.Wms.Inventory.Application.Contracts/Balances/Inputs/RecommendBalanceRequestInput.cs b/be/Modules/Inventory/src/Win_in.Sfs.Wms.Inventory.Application.Contracts/Balances/Inputs/RecommendBalanceRequestInput.cs index f6c401c70..be818e97f 100644 --- a/be/Modules/Inventory/src/Win_in.Sfs.Wms.Inventory.Application.Contracts/Balances/Inputs/RecommendBalanceRequestInput.cs +++ b/be/Modules/Inventory/src/Win_in.Sfs.Wms.Inventory.Application.Contracts/Balances/Inputs/RecommendBalanceRequestInput.cs @@ -38,6 +38,12 @@ public class RecommendBalanceRequestInput [Display(Name = "库存状态")] public List Statuses { get; set; } + /// + /// 是否必须有箱码 + /// + [Display(Name = "是否必须有箱码")] + public bool IsPackingCode { get; set; } = false; + public override string ToString() { var locationTypes = LocationTypes.Aggregate("", (current, locationType) => current + (locationType.GetDisplayName() + ",")); 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 608c7fb97..08efeb97e 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 @@ -498,7 +498,7 @@ public class BalanceAppService } Logger.LogDebug(traceId + "|Input:" + input); - var balances = await _balanceManager.GetRecommendBalancesByLocationAsync(traceId, itemCode, qty, locations, statuses).ConfigureAwait(false); + var balances = await _balanceManager.GetRecommendBalancesByLocationAsync(traceId, itemCode, qty, locations, statuses, input.IsPackingCode).ConfigureAwait(false); var dtos = ObjectMapper.Map, List>(balances); 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 98cbe245c..cf9b64ad2 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 @@ -450,7 +450,7 @@ public class BalanceManager : DomainService, IBalanceManager /// public virtual async Task> GetRecommendBalancesByLocationAsync(Guid traceId, string itemCode, decimal requestQty, List validLocations, - List validStatuses) + List validStatuses,bool ispackingcode) { var recommendBalances = new List();//返回可使用的推荐库存余额 @@ -465,11 +465,17 @@ public class BalanceManager : DomainService, IBalanceManager Expression> expression = p => p.ItemCode == itemCode; expression = expression.And(p => validStatuses.Contains(p.Status)); expression = expression.And(p => p.IsActive); + //如果物品的有效期不是无限的, 要过滤掉过期库存 if (item.ValidityUnit != EnumValidityUnit.Infinite) { expression = expression.And(p => p.ExpireDate > DateTime.Now); } + //排除无箱码库存 + if (ispackingcode) + { + expression = expression.And(p => !string.IsNullOrEmpty(p.PackingCode)); + } //筛选有效库区 2023-6-29 李智慧 王旭 袁静雯 确认不需要做区域校验 //if (validLocationAreas.Any()) //{ diff --git a/be/Modules/Inventory/src/Win_in.Sfs.Wms.Inventory.Domain/Balances/IBalanceManager.cs b/be/Modules/Inventory/src/Win_in.Sfs.Wms.Inventory.Domain/Balances/IBalanceManager.cs index 17d16cb80..2b6f3d945 100644 --- a/be/Modules/Inventory/src/Win_in.Sfs.Wms.Inventory.Domain/Balances/IBalanceManager.cs +++ b/be/Modules/Inventory/src/Win_in.Sfs.Wms.Inventory.Domain/Balances/IBalanceManager.cs @@ -33,5 +33,5 @@ public interface IBalanceManager : IDomainService Task> GetItemCodesOfLocationAsync(string locationCode); Task ModifyAsync(Balance balance); Task> GetListByLocationTypeAndInventoryStatusAsync(string itemCode, EnumInventoryStatus enumInventoryStatus, List enumLocationTypes); - Task> GetRecommendBalancesByLocationAsync(Guid traceId, string itemCode, decimal requestQty, List validLocations, List validStatuses); + Task> GetRecommendBalancesByLocationAsync(Guid traceId, string itemCode, decimal requestQty, List validLocations, List validStatuses,bool ispackingcode); } 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 48db37e3f..a4c20f257 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 @@ -96,16 +96,20 @@ public class UnplannedIssueRequestForDongyangAppService : UnplannedIssueRequestA List newDetails = new List(); foreach (var detail in unplannedIssueRequest.Details) { + //需要复制一个这个方法 去掉区域参数 换成库位参数 + RecommendBalanceRequestInput input = new RecommendBalanceRequestInput(); if (unplannedIssueRequest.UnplannedIssueType == EnumUnplannedIssueType.Raw) { var locationDto = await _locationAppService.GetByCodeAsync(detail.LocationCode).ConfigureAwait(false); - if (locationDto.Type != EnumLocationType.RAW && locationDto.Type != EnumLocationType.SEMI) + if (locationDto.Type != EnumLocationType.RAW && locationDto.Type != EnumLocationType.SEMI && locationDto.Type != EnumLocationType.FG) { throw new UserFriendlyException($"【{detail.LocationCode}】库位类型错误," + $"不是{EnumLocationType.RAW.GetDisplayName()}" + - $"或{EnumLocationType.SEMI.GetDisplayName()}】"); + $"或{EnumLocationType.SEMI.GetDisplayName()}" + + $"或{EnumLocationType.FG.GetDisplayName()}】"); } unplannedIssueRequest.DirectCreateNote = false; + input.IsPackingCode = true;//只查询带箱码的推荐 } if (unplannedIssueRequest.UnplannedIssueType == EnumUnplannedIssueType.Wip) { @@ -116,8 +120,7 @@ public class UnplannedIssueRequestForDongyangAppService : UnplannedIssueRequestA $"不是{EnumLocationType.WIP.GetDisplayName()}】"); } } - //需要复制一个这个方法 去掉区域参数 换成库位参数 - RecommendBalanceRequestInput input = new RecommendBalanceRequestInput(); + input.ItemCode = detail.ItemCode; input.Locations = new List() { detail.LocationCode }; input.Qty = detail.Qty; diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/UnplannedReceiptRequests/UnplannedReceiptRequestForDongyangAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/UnplannedReceiptRequests/UnplannedReceiptRequestForDongyangAppService.cs index 31f50bae5..eb193e7f8 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/UnplannedReceiptRequests/UnplannedReceiptRequestForDongyangAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/UnplannedReceiptRequests/UnplannedReceiptRequestForDongyangAppService.cs @@ -103,11 +103,12 @@ public class UnplannedReceiptRequestForDongyangAppService : UnplannedReceiptRequ if (unplannedReceiptRequest.UnplannedReceiptType == EnumUnplannedReceiptType.Raw) { var locationDto = await _locationAppService.GetByCodeAsync(detail.LocationCode).ConfigureAwait(false); - if (locationDto.Type != EnumLocationType.RAW && locationDto.Type != EnumLocationType.SEMI) + if (locationDto.Type != EnumLocationType.RAW && locationDto.Type != EnumLocationType.SEMI && locationDto.Type != EnumLocationType.FG) { throw new UserFriendlyException($"【{detail.LocationCode}】库位类型错误," + $"不是{EnumLocationType.RAW.GetDisplayName()}" + - $"或{EnumLocationType.SEMI.GetDisplayName()}】"); + $"或{EnumLocationType.SEMI.GetDisplayName()}】" + + $"或{EnumLocationType.FG.GetDisplayName()}】"); } unplannedReceiptRequest.DirectCreateNote = false; //需要复制一个这个方法 去掉区域参数 换成库位参数 From 0ae59f03fa6ab417464f061309ad09d7d9b2f609 Mon Sep 17 00:00:00 2001 From: lvzb <35200379@qq.com> Date: Fri, 19 Jan 2024 11:32:01 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E9=9D=9E=E7=94=9F=E4=BA=A7=E9=80=80?= =?UTF-8?q?=E6=96=99=E4=BB=BB=E5=8A=A1dto=E6=B7=BB=E5=8A=A0=E5=AD=97?= =?UTF-8?q?=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DTOs/UnplannedReceiptJobDTO.cs | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/UnplannedReceiptJobs/DTOs/UnplannedReceiptJobDTO.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/UnplannedReceiptJobs/DTOs/UnplannedReceiptJobDTO.cs index ae7d5bcd4..b45beb94e 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/UnplannedReceiptJobs/DTOs/UnplannedReceiptJobDTO.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/UnplannedReceiptJobs/DTOs/UnplannedReceiptJobDTO.cs @@ -1,3 +1,4 @@ +using System; using System.ComponentModel.DataAnnotations; using Win_in.Sfs.Shared.Domain; using Win_in.Sfs.Shared.Domain.Shared.Enums.Store; @@ -19,7 +20,26 @@ public class UnplannedReceiptJobDTO : SfsJobDTOBase + /// 部门代码 + /// + [Display(Name = "部门代码")] + [StringLength(SfsEfCorePropertyConst.CodeLength, ErrorMessage = "{0}最多输入{1}个字符")] + public string DeptCode { get; set; } + + /// + /// 部门名称 + /// + [Display(Name = "部门名称")] + [StringLength(SfsEfCorePropertyConst.NameLength, ErrorMessage = "{0}最多输入{1}个字符")] + public string DeptName { get; set; } + + /// + /// 建档日 + /// + [Display(Name = "建档日")] + public DateTime BuildDate { get; set; } /// /// OA单据号 /// From 194a481a872750bfdacfc3010bd03ce6c76678f9 Mon Sep 17 00:00:00 2001 From: lvzb <35200379@qq.com> Date: Mon, 22 Jan 2024 09:54:09 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Outgoing/TyrpOutgoingBackgroundWorker.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 24f0af035..8a8ec9951 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 @@ -227,7 +227,7 @@ public class TyrpOutgoingBackgroundWorker : AsyncPeriodicBackgroundWorkerBase #endregion #region 线边仓调整单 WIPAdjust mesout_asd - Logger.LogInformation($"Write WIPAdjusNote");//线边仓调整单 + Logger.LogInformation($"Write WIPAdjusNote");//线边仓调整单(汇总) var wipAdjustNoteConvert = workerContext.ServiceProvider.GetRequiredService(); var wipAdjustNoteList = await wipAdjustNoteConvert.ConvertAsync().ConfigureAwait(false); await countadjustWriter.WriteAsync(wipAdjustNoteList).ConfigureAwait(false); @@ -239,7 +239,7 @@ public class TyrpOutgoingBackgroundWorker : AsyncPeriodicBackgroundWorkerBase #endregion #region 回收料调整单 Item_Transform mesout_asd - Logger.LogInformation($"Write ItemTransformNote");//回收料调整单 + Logger.LogInformation($"Write ItemTransformNote");//回收料调整单(汇总) var ItemTransformNoteConvert = workerContext.ServiceProvider.GetRequiredService(); var ItemTransformNoteList = await ItemTransformNoteConvert.ConvertAsync().ConfigureAwait(false); await countadjustWriter.WriteAsync(ItemTransformNoteList).ConfigureAwait(false); From a36cf8ac1d8f299ce9e2e8596ab76bc6385ffc64 Mon Sep 17 00:00:00 2001 From: lvzb <35200379@qq.com> Date: Mon, 22 Jan 2024 10:46:47 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E7=BA=BF=E8=BE=B9=E4=BB=93=E9=80=80?= =?UTF-8?q?=E6=96=99=E6=B1=87=E6=80=BB=E4=BC=A0=E7=BB=99tyrp?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Outgoing/ProductionReturnNoteConverter.cs | 5 +++-- .../Outgoing/TyrpOutgoingBackgroundWorker.cs | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) 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 1aaa970a7..97af4196f 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 @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.Linq; using System.Text.Json; using System.Threading.Tasks; using Volo.Abp.ObjectMapping; @@ -59,9 +60,9 @@ public class ProductionReturnNoteConverter : IOutgoingConverter outgoingToExternal.DestinationDataContent = JsonSerializer.Serialize(putawayNote); outgoingToExternalList.Add(outgoingToExternal); #endregion - + var sumDetails = wmsReceipt.Details.GroupBy(r => new { r.ItemCode, r.FromLocationErpCode, r.ToLocationErpCode }).Select(p => new ProductionReturnNoteDetailDTO { ItemCode = p.Key.ItemCode, FromLocationErpCode = p.Key.FromLocationErpCode, ToLocationErpCode = p.Key.ToLocationErpCode, Qty = p.Sum(x => x.Qty) }).ToList(); #region 明细 - foreach (var detail in wmsReceipt.Details) + foreach (var detail in sumDetails) { var outgoingDetailToExternal = new OutgoingToExternal() { 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 8a8ec9951..a8b6552dd 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 @@ -95,7 +95,7 @@ public class TyrpOutgoingBackgroundWorker : AsyncPeriodicBackgroundWorkerBase #endregion #region 线边仓退料单 ProductionReturn scontrol - Logger.LogInformation($"Write ProductionReturnNote");//线边仓退料单 + Logger.LogInformation($"Write ProductionReturnNote");//线边仓退料单(汇总) var productionReturnNoteConvert = workerContext.ServiceProvider.GetRequiredService(); var productionReturnNoteList = await productionReturnNoteConvert.ConvertAsync().ConfigureAwait(false); await scontrolWriter.WriteAsync(productionReturnNoteList).ConfigureAwait(false);