From b04cbd531a75c620d82b4b09dd3d4d2be927198f Mon Sep 17 00:00:00 2001
From: xxyy <cathay_xy@163.com>
Date: 星期六, 01 三月 2025 13:23:17 +0800
Subject: [PATCH] 更新 .gitignore 和 Dt_TaskService.cs 文件

---
 Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/Task/Dt_TaskService.cs |   17 +++++++++++++++--
 1 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/Task/Dt_TaskService.cs b/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/Task/Dt_TaskService.cs
index d185ef3..efea336 100644
--- a/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/Task/Dt_TaskService.cs
+++ b/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/Task/Dt_TaskService.cs
@@ -2105,19 +2105,32 @@
 
             if (stock.IsFull)
             {
+                // 鏌ヨ绗﹀悎鏉′欢鐨勫簱瀛樹俊鎭�
                 var stocks = _stockInfoRepository.QueryData(x => x.AreaCode == stock.AreaCode && x.ProductionLine == stock.ProductionLine && x.SpecialParameterDuration != stock.SpecialParameterDuration);
+
+                // 鏌ヨ浠诲姟淇℃伅
+                var tasks = BaseDal.QueryData(x => x.PalletCode != stock.PalletCode && x.ProductionLine == stock.ProductionLine).Select(x => x.PalletCode).ToList();
+
                 if (stocks != null && stocks.Count > 0)
                 {
-                    foreach (var item in stocks)
+                    // 杩囨护鍑洪渶瑕佹洿鏂扮殑搴撳瓨淇℃伅
+                    var stocksToUpdate = stocks.Where(item => !tasks.Contains(item.PalletCode)).ToList();
+                    foreach (var item in stocksToUpdate)
                     {
+                        // 鏇存柊搴撳瓨淇℃伅鐨勭壒瀹氬弬鏁�
                         item.SpecialParameterDuration = stock.SpecialParameterDuration;
                         item.ParameterInfos = stock.ParameterInfos;
                         item.OutboundTime = Convert.ToDateTime(item.LinedProcessFeedbackTime == null ? item.CreateDate : item.LinedProcessFeedbackTime).AddHours(Convert.ToDouble(stock.SpecialParameterDuration));
                     }
-                    var isUpdates = await _stockInfoRepository.UpdateDataAsync(stocks);
+                    if (stocksToUpdate.Count > 0)
+                    {
+                        // 寮傛鏇存柊搴撳瓨淇℃伅
+                        var isUpdates = await _stockInfoRepository.UpdateDataAsync(stocksToUpdate);
+                    }
                 }
             }
 
+
             // 娣诲姞鍘嗗彶浠诲姟
             var isTaskHtyAdd = await _task_HtyRepository.AddDataAsync(taskHty) > 0;
 

--
Gitblit v1.9.3