From d9c99e0480b4910cdb134778dd5c314b35ec4cf2 Mon Sep 17 00:00:00 2001
From: dengjunjie <dengjunjie@hnkhzn.com>
Date: 星期一, 29 九月 2025 10:05:23 +0800
Subject: [PATCH] 1

---
 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/PartialTaskService_Inbound.cs |   14 ++++++++++++--
 1 files changed, 12 insertions(+), 2 deletions(-)

diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/PartialTaskService_Inbound.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/PartialTaskService_Inbound.cs"
index 40f37d5..3734081 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/PartialTaskService_Inbound.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/PartialTaskService_Inbound.cs"
@@ -196,16 +196,25 @@
                 }
                 else
                 {
-                    Dt_InventoryInfo? _InventoryInfo = _stockService.InventoryInfoService.Repository.QueryData(x => x.BatchNo == inventoryInfo.BatchNo && (x.StockStatus == StockStatusEmun.鍏ュ簱涓�.ObjToInt() || x.StockStatus == StockStatusEmun.宸插叆搴�.ObjToInt())).OrderByDescending(x => x.ModifyDate).FirstOrDefault();
+                    Dt_InventoryInfo? _InventoryInfo = _stockService.InventoryInfoService.Repository.QueryData(x => x.BatchNo == inventoryInfo.BatchNo && x.StockStatus == StockStatusEmun.鍏ュ簱涓�.ObjToInt()).OrderByDescending(x => x.ModifyDate).FirstOrDefault();
 
                     if (_InventoryInfo != null)
                     {
                         locationInfo = _basicService.LocationInfoService.GetLocation(_InventoryInfo.LocationCode);
                         if (locationInfo?.MaxQty <= locationInfo?.CurrentQty) locationInfo = null;
                     }
+                    if (locationInfo == null)
+                    {
+                        _InventoryInfo = _stockService.InventoryInfoService.Repository.QueryData(x => x.BatchNo == inventoryInfo.BatchNo && x.StockStatus == StockStatusEmun.宸插叆搴�.ObjToInt()).OrderByDescending(x => x.InDate).FirstOrDefault();
+                        if (_InventoryInfo != null)
+                        {
+                            locationInfo = _basicService.LocationInfoService.GetLocation(_InventoryInfo.LocationCode);
+                            if (locationInfo?.MaxQty <= locationInfo?.CurrentQty) locationInfo = null;
+                        }
+                    }
                     if (locationInfo == null)//鍒嗛厤鏂拌揣浣�
                     {
-                        var Qty = Convert.ToInt32(inboundOrderDetail.OrderQuantity - inboundOrderDetail.OverInQuantity);
+                        var Qty = Convert.ToInt32(inboundOrderDetail.OrderQuantity - inboundOrderDetail.ReceiptQuantity);
                         var ts = Qty / 320;
                         if (Qty % 320 > 0) ts++;
                         int inboundOrderCount = ts > 12 ? 2 : 1;
@@ -223,6 +232,7 @@
                 task.SourceIsPickPlace = false;
                 inventoryInfo.LocationCode = locationInfo.LocationCode;
                 inventoryInfo.StockStatus = StockStatusEmun.鍏ュ簱涓�.ObjToInt();
+                inventoryInfo.ModifyDate = DateTime.Now;
                 locationInfo.CurrentQty++;
                 if (locationInfo.MaxQty < locationInfo.CurrentQty) locationInfo.CurrentQty = locationInfo.MaxQty;
                 inventoryInfo.SerialNumber = locationInfo.CurrentQty;

--
Gitblit v1.9.3