From 2de09bec5cc05bf875543fa8956167ca7db73021 Mon Sep 17 00:00:00 2001
From: 刘磊 <1161824510@qq.com>
Date: 星期三, 25 六月 2025 11:36:44 +0800
Subject: [PATCH] 合并

---
 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/Task/Dt_Task_HtyService.cs |   64 +++++++++++++++++++++++++++----
 1 files changed, 55 insertions(+), 9 deletions(-)

diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/Task/Dt_Task_HtyService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/Task/Dt_Task_HtyService.cs"
index 1b9ee8f..42cca4d 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/Task/Dt_Task_HtyService.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/Task/Dt_Task_HtyService.cs"
@@ -1,25 +1,71 @@
-锘縩amespace WIDESEA_StorageTaskServices;
+锘縰sing Autofac.Core;
+using Microsoft.AspNetCore.Authorization;
+using Microsoft.AspNetCore.Mvc;
+using WIDESEA_DTO.WMS;
+using WIDESEA_StorageBasicRepository;
+
+namespace WIDESEA_StorageTaskServices;
 
 public class Dt_Task_HtyService : ServiceBase<Dt_Task_Hty, IDt_Task_HtyRepository>, IDt_Task_HtyService
 {
     private readonly IUnitOfWorkManage _unitOfWorkManage;
     private readonly IDt_OutOrderService _outOrderService;
+    private readonly IDt_TaskService _taskService;
 
     public Dt_Task_HtyService(IDt_Task_HtyRepository BaseDal,
                                     IUnitOfWorkManage unitOfWorkManage,
-                                    IDt_OutOrderService outOrderService) : base(BaseDal)
+                                    IDt_OutOrderService outOrderService,
+                                    IDt_TaskService taskService) : base(BaseDal)
     {
         _unitOfWorkManage = unitOfWorkManage;
         _outOrderService = outOrderService;
+        _taskService = taskService;
     }
 
-    /// <summary>
-    /// 娣诲姞鍘嗗彶浠诲姟
-    /// </summary>
-    /// <param name="task">鍘嗗彶浠诲姟Model</param>
-    /// <returns>鎴愬姛/澶辫触</returns>
-    public bool InsertTask(Dt_Task_Hty task)
+
+    public WebResponseContent TaskRollback(int input)
     {
-        return BaseDal.InsertTask(task);
+        WebResponseContent content = new WebResponseContent();
+        try
+        {
+            Dt_Task_Hty dt_Task_ = BaseDal.QueryFirst(x => x.TaskId == input);
+
+            if(dt_Task_ == null)
+            {
+                return content.Error("鏈煡鎵惧埌鏁版嵁");
+            }
+            // 鍒涘缓WMS浠诲姟
+            Dt_Task taskDTO = new Dt_Task()
+            {
+                TaskNum = dt_Task_.TaskNum.Value,
+                Grade = dt_Task_.Grade.Value,
+                PalletCode = dt_Task_.PalletCode,
+                Roadway = dt_Task_.Roadway,
+                SourceAddress = dt_Task_.SourceAddress,
+                TargetAddress = dt_Task_.TargetAddress,
+                CurrentAddress=dt_Task_.CurrentAddress,
+                NextAddress = dt_Task_.NextAddress,
+                TaskState = 999,
+                TaskType = dt_Task_.TaskType,
+                wheels_mttype = dt_Task_.wheels_mttype,
+                CarType = dt_Task_.CarType,
+                wheels_gkcc = dt_Task_.wheels_gkcc,
+                WheelsNewOrOld = dt_Task_.WheelsNewOrOld,
+                IsCheck = dt_Task_.IsCheck,
+                WheelsLX = dt_Task_.WheelsLX,
+                CreateDate = DateTime.Now,
+                Dispatchertime=dt_Task_.Dispatchertime,
+                Creater ="浠诲姟鍥炴粴"
+            };
+            _taskService.AddData(taskDTO);
+
+            return content.OK("鎴愬姛");
+        }
+        catch (Exception ex)
+        {
+            return content.Error(ex.Message);
+            throw;
+        }
     }
+
 }
\ No newline at end of file

--
Gitblit v1.9.3