dengjunjie
2025-01-18 bedab5dc5dedf404beb9d60d4f91d52d9aad9d02
代码管理/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,9 +661,12 @@
                    stockInfoDetails.Add(stockInfoDetail);
                    notGroupDetail.ReceiptQuantity = model.Quantity;
                    notGroupDetail.ReceiptQuantity += model.Quantity;
                    if (notGroupDetail.OrderDetailStatus == OrderDetailStatusEnum.New.ObjToInt())
                    {
                    notGroupDetail.OrderDetailStatus = OrderDetailStatusEnum.GroupAndInbound.ObjToInt();
                }
                }
                float totalQuantity = stockInfo.Details.Sum(x => x.StockQuantity);