From bedab5dc5dedf404beb9d60d4f91d52d9aad9d02 Mon Sep 17 00:00:00 2001 From: dengjunjie <dengjunjie@hnkhzn.com> Date: 星期六, 18 一月 2025 17:56:40 +0800 Subject: [PATCH] Merge branch 'master' of http://115.159.85.185:8098/r/MeiRuiAn/HuaiAn --- 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_InboundService/InboundOrderService.cs | 11 ++++++----- 1 files changed, 6 insertions(+), 5 deletions(-) diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_InboundService/InboundOrderService.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_InboundService/InboundOrderService.cs" index ecc901e..20e9990 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_InboundService/InboundOrderService.cs" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_InboundService/InboundOrderService.cs" @@ -624,7 +624,6 @@ } List<Dt_StockInfoDetail> stockInfoDetails = new List<Dt_StockInfoDetail>(); - List<int> detailKeys = new List<int>(); foreach (var model in models) { if (purchaseOrderNos.FirstOrDefault(x => x == model.PurchaseOrderNo) == null) @@ -632,13 +631,12 @@ return WebResponseContent.Instance.Error($"鏈湪鏀惰揣鍗曟槑缁嗕腑鎵惧埌璇ラ噰璐崟"); } - Dt_InboundOrderDetail? notGroupDetail = inboundOrderDetails.Where(x => x.OrderDetailStatus == OrderDetailStatusEnum.New.ObjToInt() && x.OrderQuantity == model.Quantity && !detailKeys.Contains(x.Id) && x.OrderQuantity > x.ReceiptQuantity).FirstOrDefault(); + Dt_InboundOrderDetail? notGroupDetail = inboundOrderDetails.Where(x => x.OrderDetailStatus < OrderDetailStatusEnum.Inbounding.ObjToInt() && x.MaterielCode==model.MaterielCode && x.BatchNo==model.LotNo && x.OrderQuantity > x.ReceiptQuantity).FirstOrDefault(); if (notGroupDetail == null) { return WebResponseContent.Instance.Error($"璇ョ墿鏂欏湪璇ュ叆搴撳崟涓凡鍏ㄩ儴缁勭洏瀹屾垚"); } - detailKeys.Add(notGroupDetail.Id); Dt_StockInfoDetail stockInfoDetail = new Dt_StockInfoDetail() { BatchNo = model.LotNo, @@ -663,8 +661,11 @@ stockInfoDetails.Add(stockInfoDetail); - notGroupDetail.ReceiptQuantity = model.Quantity; - notGroupDetail.OrderDetailStatus = OrderDetailStatusEnum.GroupAndInbound.ObjToInt(); + notGroupDetail.ReceiptQuantity += model.Quantity; + if (notGroupDetail.OrderDetailStatus == OrderDetailStatusEnum.New.ObjToInt()) + { + notGroupDetail.OrderDetailStatus = OrderDetailStatusEnum.GroupAndInbound.ObjToInt(); + } } float totalQuantity = stockInfo.Details.Sum(x => x.StockQuantity); -- Gitblit v1.9.3