From a8f4641741af34ffbe5fd565003cc5d55bbec119 Mon Sep 17 00:00:00 2001
From: huangxiaoqiang <1247017146@qq.com>
Date: 星期五, 25 四月 2025 09:49:50 +0800
Subject: [PATCH] 添加火警任务

---
 Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/Task/Dt_TaskService.cs |   37 +++++++++++++++++++++++++++++++++++++
 1 files changed, 37 insertions(+), 0 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 bc5d0c0..274b956 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
@@ -2,6 +2,7 @@
 using Masuit.Tools;
 using SqlSugar;
 using System.Text.RegularExpressions;
+using System.Threading.Tasks;
 using WIDESEA_Cache;
 using WIDESEA_Core.Const;
 using WIDESEA_DTO.MOM;
@@ -280,6 +281,36 @@
     }
 
     #endregion 鍑哄簱浠诲姟瀹屾垚
+
+    #region 鐏浠诲姟瀹屾垚
+    public async Task<WebResponseContent> CompleteOutFireAlarmTaskAsync(Dt_Task task, DtStockInfo stock)
+    {
+        WebResponseContent content = new WebResponseContent();
+        (var loc, var tas) = UpdateStockAndTaskStatus(stock, task);
+        var taskHty = task.Adapt<Dt_Task_Hty>();
+        taskHty.FinishTime = DateTime.Now;
+        taskHty.OperateType = App.User.UserName != null ? (int)OperateTypeEnum.浜哄伐瀹屾垚 : (int)OperateTypeEnum.鑷姩瀹屾垚;
+        taskHty.Creater = App.User.UserName != null ? App.User.UserName : "System";
+
+        DtStockInfo_Hty stockInfo_Hty = stock.Adapt<DtStockInfo_Hty>();
+        stockInfo_Hty.ModifyDate = DateTime.Now;
+
+        // 浜嬪姟澶勭悊
+        await _unitOfWorkManage.UseTranAsync(async () =>
+        {
+            if (task.TaskType != (int)TaskOutboundTypeEnum.OutQuality)
+            {
+                await DeleteStockInfoAsync(stock.Id);
+                await DeleteStockInfoDetailsAsync(stock.StockInfoDetails);
+                await AddStockInfoHtyAsync(stockInfo_Hty);
+                await UpdateLocationAsync(loc); //璐ㄦ浠诲姟闇�瑕佹寔缁攣瀹氬簱浣�
+            }
+            await DeleteTaskAsync(task.TaskId);
+            await AddTaskHtyAsync(taskHty);
+        });
+        return content.OK("浠诲姟瀹屾垚鎴愬姛", task.Remark);
+    }
+    #endregion
 
     #region 绉诲簱浠诲姟瀹屾垚
 
@@ -599,9 +630,15 @@
             case (int)TaskOutboundTypeEnum.OutTray:
             case (int)TaskOutboundTypeEnum.Outbound:
             case (int)TaskOutboundTypeEnum.OutNG:
+            
                 LogFactory.GetLog("浠诲姟瀹屾垚").InfoFormat(true, "鍑哄簱浠诲姟", "");
                 return await CompleteStackTaskAsync(task, stock);
 
+            case (int)TaskOutboundTypeEnum.OutFireAlarm:
+
+                LogFactory.GetLog("浠诲姟瀹屾垚").InfoFormat(true, "鐏浠诲姟", "");
+                return await CompleteOutFireAlarmTaskAsync(task, stock);
+
             case (int)TaskRelocationTypeEnum.Relocation:
                 return await CompleteTransferTaskAsync(task, stock);
 

--
Gitblit v1.9.3