From dbad90ca9edcb5be2c5b5447e4fc2b7448b33d85 Mon Sep 17 00:00:00 2001 From: tongfei <244188119@qq.com> Date: Fri, 15 Mar 2024 17:20:31 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/WMS.Web.Domain/Services/InStockService.cs | 26 ++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/src/WMS.Web.Domain/Services/InStockService.cs b/src/WMS.Web.Domain/Services/InStockService.cs index ce3c1036..bf88c90d 100644 --- a/src/WMS.Web.Domain/Services/InStockService.cs +++ b/src/WMS.Web.Domain/Services/InStockService.cs @@ -256,6 +256,13 @@ namespace WMS.Web.Domain.Services /// private async Task> ShelfSave(PurchaseShelfRequest dto, InstockType type, LoginInDto loginInfo, bool isTransaction = true) { + _logger.LogInformation($"采购上架-保存:{JsonConvert.SerializeObject(dto)} 操作人:{loginInfo.UserInfo.StaffId}"); + //入库的时候:不能扫同样的箱 + if (dto.Details != null && dto.Details.Count != 0) + { + if (dto.Details.Select(x => x.BoxId).Distinct().Count() != dto.Details.Select(x => x.BoxId).Count()) + return Result.ReFailure(ResultCodes.BoxOutStockTaskBoxError); + } //1.获取来源单 var taskIds = dto.Details.GroupBy(x => x.TaskId).Select(x => x.Key).ToList(); @@ -379,6 +386,15 @@ namespace WMS.Web.Domain.Services /// private async Task ShelfNoPurchaseSave(NoPurchaseShelfRequest dto, LoginInDto loginInfo, bool isTransaction = true) { + _logger.LogInformation($"非采购上架-保存:{JsonConvert.SerializeObject(dto)} 操作人:{loginInfo.UserInfo.StaffId}"); + + //非采购入库的时候:不能扫同样的箱,按箱入库时候 + if (dto.Boxs != null && dto.Boxs.Count != 0 && dto.ShelfMethod==(int)ShelfMethod.Box) + { + if (dto.Boxs.Select(x => x.BoxId).Distinct().Count() != dto.Boxs.Select(x => x.BoxId).Count()) + return Result.ReFailure(ResultCodes.BoxOutStockTaskBoxError); + } + //1.1过滤的明细:0数量入库的明细要过滤掉 dto.Boxs.ForEach(x => { @@ -596,7 +612,13 @@ namespace WMS.Web.Domain.Services /// public async Task> Receive(UpdateInStockTaskRequest dto, int staffId, bool isTransaction) { - + _logger.LogInformation($"收货:{JsonConvert.SerializeObject(dto)} 操作人:{staffId}"); + //收货的时候:不能扫同样的箱 + if (dto.Boxs != null && dto.Boxs.Count != 0) + { + if (dto.Boxs.Select(x => x.BoxId).Distinct().Count() != dto.Boxs.Select(x => x.BoxId).Count()) + return Result.ReFailure(ResultCodes.BoxOutStockTaskBoxError); + } //1.修改任务单的数据 var entity = await _inStockTaskRepositories.Get(dto.Id); if (entity == null) @@ -677,6 +699,7 @@ namespace WMS.Web.Domain.Services /// public async Task> Contrast(ContrastMaterialsRequest dto) { + _logger.LogInformation($"采购订单明细和箱物料明细-对比:{JsonConvert.SerializeObject(dto)}"); //1.找到任务单的明细信息 var task = await _inStockTaskRepositories.Get(dto.TaskId); if (task == null) @@ -761,6 +784,7 @@ namespace WMS.Web.Domain.Services /// private async Task PurchaseInStock(InStock entity, LoginInDto loginInfo) { + _logger.LogInformation($"采购下推-同步:{JsonConvert.SerializeObject(entity)} 操作人:{loginInfo.UserInfo.StaffId}"); var scope = _serviceScopeFactory.CreateScope(); var sc_InStockRepositories = scope.ServiceProvider.GetRequiredService();