From 31eba6a8c6261adf5bfef4dafad4dc8efc1f66a2 Mon Sep 17 00:00:00 2001
From: huangxiaoqiang <huangxiaoqiang@hnkhzn.com>
Date: 星期二, 18 二月 2025 18:57:54 +0800
Subject: [PATCH] 1

---
 Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/Task/Partial/Dt_TaskService.cs |  105 ++++++++++++++++++++++++++++++++++++++++++++++++++--
 1 files changed, 100 insertions(+), 5 deletions(-)

diff --git a/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/Task/Partial/Dt_TaskService.cs b/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/Task/Partial/Dt_TaskService.cs
index 48f30ad..dbd804c 100644
--- a/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/Task/Partial/Dt_TaskService.cs
+++ b/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/Task/Partial/Dt_TaskService.cs
@@ -200,7 +200,8 @@
                     TaskType = (int)TaskOutboundTypeEnum.InToOut,
                     TaskNum = await BaseDal.GetTaskNo(),
                     Creater = "Systeam",
-                    ProductionLine = result.ProductionLine
+                    ProductionLine = result.ProductionLine,
+                    ProcessCode = result.ProcessCode,
                 };
                 return taskNG;
             }
@@ -258,7 +259,8 @@
                         TaskType = (int)TaskOutboundTypeEnum.InToOut,
                         TaskNum = await BaseDal.GetTaskNo(),
                         Creater = "Systeam",
-                        ProductionLine = result.ProductionLine
+                        ProductionLine = result.ProductionLine,
+                        ProcessCode = result.ProcessCode,
                     };
                     return taskNG;
                 }
@@ -291,7 +293,8 @@
                 TaskType = (int)TaskOutboundTypeEnum.InToOut,
                 TaskNum = await BaseDal.GetTaskNo(),
                 Creater = "Systeam",
-                ProductionLine = result.ProductionLine
+                ProductionLine = result.ProductionLine,
+                ProcessCode = result.ProcessCode,
             };
             return task;
         }
@@ -368,7 +371,8 @@
                     TaskType = (int)TaskOutboundTypeEnum.InToOut,
                     TaskNum = await BaseDal.GetTaskNo(),
                     Creater = "Systeam",
-                    ProductionLine = result.ProductionLine
+                    ProductionLine = result.ProductionLine,
+                    ProcessCode = result.ProcessCode,
                 };
                 return taskNG;
             }
@@ -418,6 +422,7 @@
             TaskNum = await BaseDal.GetTaskNo(),
             Creater = "Systeam",
             ProductionLine = result.ProductionLine,
+            ProcessCode = result.ProcessCode,
         };
         int lastStatus = locationInfo.LocationStatus;
         ConsoleHelper.WriteSuccessLine($"淇敼鍓嶏細" + lastStatus.ToString());
@@ -653,6 +658,7 @@
                     TaskNum = await BaseDal.GetTaskNo(),
                     Creater = "Systeam",
                     ProductionLine = result.ProductionLine,
+                    ProcessCode = result.ProcessCode,
                 };
                 return Epmtytask;
             }
@@ -714,6 +720,7 @@
                 TaskNum = await BaseDal.GetTaskNo(),
                 Creater = "Systeam",
                 ProductionLine = result.ProductionLine,
+                ProcessCode = result.ProcessCode,
             };
 
             var isBox = await _boxingInfoRepository.AddDataNavAsync(boxing);
@@ -872,7 +879,7 @@
         WebResponseContent content = new WebResponseContent();
         try
         {
-            var station = _stationManagerRepository.QueryFirst(x => x.stationChildCode == taskDTO.Position);
+            var station = _stationManagerRepository.QueryFirst(x => x.stationChildCode == taskDTO.Position && x.stationStatus == "1");
             var locations = _locationRepository.QueryData(x => x.RoadwayNo == station.Roadway && x.LocationStatus == (int)LocationEnum.Free && x.LocationType == 1);
 
             if (locations.Count > 10)
@@ -1002,6 +1009,7 @@
                 TaskNum = await BaseDal.GetTaskNo(),
                 Creater = "Systeam",
                 ProductionLine = stockInfo.ProductionLine,
+                ProcessCode = stockInfo.ProcessCode,
             };
 
             WMSTaskDTO taskDTO = CreateTaskDTO(task);
@@ -1145,4 +1153,91 @@
     }
 
     #endregion
+
+    #region 鍒嗗绌烘鍏ュ簱鏀逛负鐩存帴鍑哄簱
+
+    public async Task<WebResponseContent> SetEmptyOutbyInToOutAsync(RequestTaskDto request)
+    {
+        WebResponseContent content = new WebResponseContent();
+        var task = await BaseDal.QueryFirstAsync(x => x.PalletCode == request.PalletCode);
+        if (!task.IsNullOrEmpty())
+        {
+            var fromStation = await _stationManagerRepository.QueryFirstAsync(x => x.stationChildCode == request.Position);
+            var toStation = await _stationManagerRepository.QueryFirstAsync(x => x.stationType == 7 && x.productLine == fromStation.productLine && x.stationArea == fromStation.stationArea);
+            if (!toStation.IsNullOrEmpty())
+            {
+                var location = await _locationRepository.QueryFirstAsync(x => x.LocationCode == task.TargetAddress && x.AreaId == int.Parse(fromStation.stationArea));
+                task.TargetAddress = toStation.stationLocation;
+                task.NextAddress = toStation.stationChildCode;
+                task.Grade = 3;
+                task.TaskType = (int)TaskOutboundTypeEnum.InToOut;
+                task.TaskState = (int)TaskOutStatusEnum.OutNew;
+
+                location.LocationStatus = (int)LocationEnum.Free;
+
+                await _locationRepository.UpdateDataAsync(location);
+                await BaseDal.UpdateDataAsync(task);
+                return content.OK("鎴愬姛");
+            }
+            else
+            {
+                ConsoleHelper.WriteErrorLine("鍒嗗绌烘鍏ュ簱鏀逛负鐩存帴鍑哄簱:鏈壘鍒板搴旂珯鍙�");
+                content.Error("鏈壘鍒板搴旂珯鍙�");
+            }
+        }
+        else
+        {
+            ConsoleHelper.WriteErrorLine("鍒嗗绌烘鍏ュ簱鏀逛负鐩存帴鍑哄簱:鏈壘鍒颁换鍔�");
+            content.Error("鏈壘鍒颁换鍔�");
+        }
+        return content;
+    }
+
+    #endregion
+
+    #region 鍒嗗绌烘鍑哄簱鏀逛负鐩存帴鍑哄簱
+
+    /// <summary>
+    /// 鍒嗗绌烘鍑哄簱鏀逛负鐩存帴鍑哄簱
+    /// </summary>
+    /// <param name="request"></param>
+    /// <returns></returns>
+    public async Task<WebResponseContent> SetEmptyOutbyInToOutOneAsync(RequestTaskDto request)
+    {
+        WebResponseContent content = new WebResponseContent();
+        var task = await BaseDal.QueryFirstAsync(x => x.PalletCode == request.PalletCode);
+        if (!task.IsNullOrEmpty())
+        {
+            var toStation = await _stationManagerRepository.QueryFirstAsync(x => x.stationChildCode == request.Position);
+            var fromStation = await _stationManagerRepository.QueryFirstAsync(x => x.stationType == 6 && x.productLine == toStation.productLine && x.stationArea == toStation.stationArea);
+            if (!fromStation.IsNullOrEmpty())
+            {
+                //var location = await _locationRepository.QueryFirstAsync(x => x.LocationCode == task.TargetAddress && x.AreaId == int.Parse(fromStation.stationArea));
+                task.SourceAddress = toStation.stationLocation;
+                task.CurrentAddress = toStation.stationChildCode;
+                task.Grade = 3;
+                task.TaskType = (int)TaskOutboundTypeEnum.InToOut;
+                task.TaskState = (int)TaskOutStatusEnum.OutNew;
+
+                //location.LocationStatus = (int)LocationEnum.Free;
+
+                //await _locationRepository.UpdateDataAsync(location);
+                await BaseDal.UpdateDataAsync(task);
+                return content.OK("鎴愬姛");
+            }
+            else
+            {
+                ConsoleHelper.WriteErrorLine("鍒嗗绌烘鍑哄簱鏀逛负鐩存帴鍑哄簱:鏈壘鍒板搴旂珯鍙�");
+                content.Error("鏈壘鍒板搴旂珯鍙�");
+            }
+        }
+        else
+        {
+            ConsoleHelper.WriteErrorLine("鍒嗗绌烘鍑哄簱鏀逛负鐩存帴鍑哄簱:鏈壘鍒颁换鍔�");
+            content.Error("鏈壘鍒颁换鍔�");
+        }
+        return content;
+    }
+
+    #endregion
 }
\ No newline at end of file

--
Gitblit v1.9.3