From fcfafddcbe3748beda400e1ecd21d329b2a25c81 Mon Sep 17 00:00:00 2001
From: 肖洋 <cathay_xy@163.com>
Date: 星期五, 13 十二月 2024 09:52:26 +0800
Subject: [PATCH] 添加定时任务处理高温库存出库逻辑

---
 Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/Task/Dt_TaskService.cs |   15 ++++++++++-----
 1 files changed, 10 insertions(+), 5 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 35417c1..f726190 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
@@ -461,6 +461,10 @@
 
         var result = _agingInOrOutInputService.GetOCVInputAsync(agingInputDto).Result;
         var respone = JsonConvert.DeserializeObject<ResponeAgingInputDto>(result.Data.ToString());
+        if (respone.ProductionLine == null || respone.ParameterInfos == null || respone.SpecialParameterDuration.IsNullOrEmpty())
+        {
+            throw new Exception("MOM鏁版嵁杩斿洖閿欒");
+        }
         stock.LinedProcessFeedbackTime = respone.LinedProcessFeedbackTime;
         stock.SpecialParameterDuration = respone.SpecialParameterDuration;
         //2024骞�11鏈�16鏃ワ細鏂板瀛楁璁$畻搴斿嚭搴撴椂闂�
@@ -980,15 +984,15 @@
     /// <param name="areaCode">鍖哄煙缂栫爜</param>
     /// <param name="roadways">宸烽亾缂栫爜闆嗗悎</param>
     /// <returns>杩斿洖缁撴灉闆�</returns>
-    public async Task<WebResponseContent> RequestTrayOutTaskAsync(string position, int tag, string areaCode, List<string> roadways)
+    public async Task<WebResponseContent> RequestTrayOutTaskAsync(string position, int tag, string areaCode, string productionLine)
     {
         WebResponseContent content = new WebResponseContent();
         try
         {
             // 鏍规嵁鎵樼洏绫诲瀷鏌ヨ搴撳瓨淇℃伅
             DtStockInfo stockInfo = tag == (int)TaskOutboundTypeEnum.Outbound
-                ? QueryStockInfoForRealTrayAsync(areaCode, roadways).Result
-                : QueryStockInfoForEmptyTrayAsync(areaCode, roadways).Result;
+                ? QueryStockInfoForRealTrayAsync(areaCode, productionLine).Result
+                : QueryStockInfoForEmptyTrayAsync(areaCode).Result;
 
             if (stockInfo == null)
             {
@@ -1035,7 +1039,7 @@
     /// <summary>
     /// 鏌ヨ瀹炵洏搴撳瓨淇℃伅
     /// </summary>
-    private async Task<DtStockInfo> QueryStockInfoForRealTrayAsync(string areaCode, List<string> roadways)
+    private async Task<DtStockInfo> QueryStockInfoForRealTrayAsync(string areaCode, string productionLine)
     {
         var area = await _areaInfoRepository.QueryFirstAsync(x => x.AreaCode == areaCode);
 
@@ -1043,6 +1047,7 @@
             .Includes(x => x.LocationInfo) // 棰勫姞杞絃ocationInfo
             .Includes(x => x.StockInfoDetails) // 棰勫姞杞絊tockInfoDetails
             .Where(x => x.AreaCode == areaCode && x.OutboundTime < DateTime.Now && x.IsFull == true) // 杩囨护鏉′欢
+            .WhereIF(!productionLine.IsNullOrEmpty(), x => x.ProductionLine == productionLine)
             .Where(x => x.LocationInfo.LocationStatus == (int)LocationEnum.InStock && x.LocationInfo.AreaId == area.AreaID) // 杩囨护鏉′欢
             .OrderBy(x => x.OutboundTime) // 鎺掑簭
             .FirstAsync(); // 鑾峰彇绗竴涓厓绱�
@@ -1056,7 +1061,7 @@
     /// <summary>
     /// 鏌ヨ绌虹洏搴撳瓨淇℃伅
     /// </summary>
-    private async Task<DtStockInfo> QueryStockInfoForEmptyTrayAsync(string areaCode, List<string> roadways)
+    private async Task<DtStockInfo> QueryStockInfoForEmptyTrayAsync(string areaCode)
     {
         var area = await _areaInfoRepository.QueryFirstAsync(x => x.AreaCode == areaCode);
 

--
Gitblit v1.9.3