From 770ff234ccd1bcca05dd32754911d887a8cef541 Mon Sep 17 00:00:00 2001
From: huanghongfeng <huanghongfeng@hnkhzn.com>
Date: 星期四, 06 十一月 2025 00:04:56 +0800
Subject: [PATCH] 最新

---
 项目代码/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/appsettings.json                                       |    4 
 项目代码/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob/CommonStackerCraneJob.cs                |   42 +++++++------
 项目代码/WCS/WIDESEAWCS_Server/WIDESEAWCS_ITaskInfoService/ITaskService.cs                              |    6 ++
 项目代码/WCS/WIDESEAWCS_Server/WIDESEAWCS_Common/WIDESEAWCS_Common.csproj                               |    4 +
 项目代码/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs                                |   56 ++++++++++--------
 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService.cs                 |   12 ++-
 项目代码/WCS/WIDESEAWCS_Server/WIDESEAWCS_Common/Http/HttpHelperh.cs                                    |    7 --
 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/WIDESEA_TaskInfoService/PartialTaskService_Outbound.cs |    6 +-
 项目代码/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/CommonConveyorLineJob.cs                |   21 ++++--
 9 files changed, 87 insertions(+), 71 deletions(-)

diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_Common/Http/HttpHelperh.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_Common/Http/HttpHelperh.cs"
index b0d69d4..0014d2b 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_Common/Http/HttpHelperh.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_Common/Http/HttpHelperh.cs"
@@ -2,8 +2,6 @@
 using Newtonsoft.Json;
 using System.Net;
 using System.Text;
-using WIDESEA_Common.Log;
-
 namespace WIDESEA_Comm.Http
 {
     public class HttpHelperh
@@ -62,7 +60,6 @@
             }
             catch (Exception ex)
             {
-                WriteLog.Write_Log("System/API璇锋眰", rquestName, "璇锋眰寮傚父", new { 璇锋眰鎶ユ枃 = parm, 鎺ユ敹鎶ユ枃 = responseContent, 閿欒 = ex.Message });
                 throw ex;
             }
         }
@@ -119,7 +116,6 @@
             }
             catch (Exception ex)
             {
-                WriteLog.Write_Log("System/API璇锋眰", rquestName, "璇锋眰寮傚父", new { 璇锋眰鎶ユ枃 = parm, 鎺ユ敹鎶ユ枃 = responseContent, 閿欒 = ex.Message });
                 throw ex;
             }
         }
@@ -183,13 +179,10 @@
                 {
                     throw new Exception("寮傚父锛屽搷搴旂爜锛�" + statsCode.ToString());
                 }
-
-                WriteLog.Write_Log("System/API璇锋眰", rquestName, "璇锋眰鎴愬姛", new { 璇锋眰鎶ユ枃 = parm, 鎺ユ敹鎶ユ枃 = responseContent });
                 return JsonConvert.DeserializeObject<T>(responseContent);
             }
             catch (Exception ex)
             {
-                WriteLog.Write_Log("System/API璇锋眰", rquestName, "璇锋眰寮傚父", new { 璇锋眰鎶ユ枃 = parm, 鎺ユ敹鎶ユ枃 = responseContent, 閿欒 = ex.Message });
                 throw ex;
             }
         }
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_Common/WIDESEAWCS_Common.csproj" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_Common/WIDESEAWCS_Common.csproj"
index 132c02c..f958b97 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_Common/WIDESEAWCS_Common.csproj"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_Common/WIDESEAWCS_Common.csproj"
@@ -6,4 +6,8 @@
     <Nullable>enable</Nullable>
   </PropertyGroup>
 
+  <ItemGroup>
+    <PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
+  </ItemGroup>
+
 </Project>
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_ITaskInfoService/ITaskService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_ITaskInfoService/ITaskService.cs"
index 1781575..81cb776 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_ITaskInfoService/ITaskService.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_ITaskInfoService/ITaskService.cs"
@@ -238,5 +238,11 @@
         /// <param name="sourceAddress">璧峰鍦板潃</param>
         /// <returns></returns>
         Dt_Task RequestWMSTaskMovelibrary(Dt_Task _Task);
+
+        /// <summary>
+        /// 鍑哄簱鍙h幏鍙栧綋鍓嶅爢鍨涙満瀹屾垚浠诲姟
+        /// </summary>
+        /// <returns></returns>
+        Dt_Task GetOutTaskInfo(string PLCaddress);
     }
 }
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/appsettings.json" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/appsettings.json"
index 7df8dc4..6cb4726 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/appsettings.json"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/appsettings.json"
@@ -8,8 +8,8 @@
   },
   "dics": "deviceType,devicePlcType,jobAssembly,jobClassName,deviceStatus,taskType,taskState,inOutType",
 
-  "urlWMSMovelibraryTask": "http://10.50.11.65:8098/api/Task/IsRelocations", //璇锋眰绉诲簱鎺ュ彛
-  "urlTaskCompleted": "http://10.50.11.65:8098/api/Task/TaskCompleted", //浠诲姟鍙嶉
+  "urlWMSMovelibraryTask": "http://127.0.0.1:9290/api/Task/IsRelocations", //璇锋眰绉诲簱鎺ュ彛
+  "urlTaskCompleted": "http://127.0.0.1:9290/api/Task/TaskCompleted", //浠诲姟鍙嶉
 
   "AllowedHosts": "*",
   "ConnectionStringsEncryption": false,
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs"
index ef564b2..5df3716 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs"
@@ -16,6 +16,7 @@
 #endregion << 鐗� 鏈� 娉� 閲� >>
 
 using AutoMapper;
+using HslCommunication.Enthernet;
 using Newtonsoft.Json;
 using OfficeOpenXml.FormulaParsing.Excel.Functions.RefAndLookup;
 using SqlSugar;
@@ -397,34 +398,36 @@
             try
             {
                 int oldState = task.TaskState;
-                if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.OutbondGroup)
+                if (task.TaskType == (int)TaskOutboundTypeEnum.Outbound)
                 {
                     if (task.TaskState >= (int)TaskOutStatusEnum.OutFinish)
                     {
                         return content = WebResponseContent.Instance.Error($"璇ヤ换鍔$姸鎬佷笉鍙烦杞埌涓嬩竴姝�,浠诲姟鍙�:銆恵task.TaskNum}銆�,浠诲姟鐘舵��:銆恵task.TaskState}銆�");
                     }
 
-                    int nextStatus = task.TaskState.GetNextNotCompletedStatus<TaskOutStatusEnum>();
+                    //int nextStatus = task.TaskState.GetNextNotCompletedStatus<TaskOutStatusEnum>();
 
-                    task.TaskState = nextStatus;
+                    task.TaskState = (int)TaskOutStatusEnum.SC_OutExecuting;
+                    task.Dispatchertime = DateTime.Now;
                 }
-                else if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.InboundGroup)
+                else if (task.TaskType == (int)TaskInboundTypeEnum.Inbound)
                 {
                     if (task.TaskState >= (int)TaskInStatusEnum.InFinish)
                     {
                         return content = WebResponseContent.Instance.Error($"璇ヤ换鍔$姸鎬佷笉鍙烦杞埌涓嬩竴姝�,浠诲姟鍙�:銆恵task.TaskNum}銆�,浠诲姟鐘舵��:銆恵task.TaskState}銆�");
                     }
 
-                    int nextStatus = task.TaskState.GetNextNotCompletedStatus<TaskInStatusEnum>();
-                    task.TaskState = nextStatus;
-
-                    if (task.TaskState == (int)TaskInStatusEnum.Line_InFinish)
+                    //int nextStatus = task.TaskState.GetNextNotCompletedStatus<TaskInStatusEnum>();
+                    task.TaskState = (int)TaskInStatusEnum.SC_InExecuting;
+                    task.Dispatchertime = DateTime.Now;
+                }
+                else if (task.TaskType == (int)TaskRelocationTypeEnum.Relocation)
+                {
+                    if (task.TaskState != (int)TaskRelocationStatusEnum.RelocationNew)
                     {
-                        Random random = new Random();
-                        task.CurrentAddress = task.NextAddress;
-                        task.NextAddress = $"{random.Next(1, 100).ToString().PadLeft(3, '0')}-{random.Next(1, 100).ToString().PadLeft(3, '0')}-{random.Next(1, 100).ToString().PadLeft(3, '0')}";
-                        task.TargetAddress = task.NextAddress;
+                        return content = WebResponseContent.Instance.Error($"璇ヤ换鍔$姸鎬佷笉鍙烦杞埌涓嬩竴姝�,浠诲姟鍙�:銆恵task.TaskNum}銆�,浠诲姟鐘舵��:銆恵task.TaskState}銆�");
                     }
+                    task.TaskState = (int)TaskRelocationStatusEnum.SC_RelocationExecuting;    //涓嬪彂绉诲簱浠诲姟
                 }
                 else
                 {
@@ -435,6 +438,7 @@
                 {
                     return content = WebResponseContent.Instance.Error($"璇ヤ换鍔$姸鎬佷笉鍙烦杞埌涓嬩竴姝�,浠诲姟鍙�:銆恵task.TaskNum}銆�,浠诲姟鐘舵��:銆恵task.TaskState}銆�");
                 }
+
 
                 task.ModifyDate = DateTime.Now;
                 task.Modifier = "System";
@@ -503,28 +507,22 @@
 
                 if (task.TaskType == (int)TaskOutboundTypeEnum.Outbound && task.TaskState == (int)TaskOutStatusEnum.SC_OutExecuting)
                 {
-                    /*List<Dt_Router> routers = _routerService.QueryNextRoutes(task.NextAddress, task.TargetAddress);
-                    if (!routers.Any()) return WebResponseContent.Instance.Error($"鏈壘鍒拌澶囪矾鐢变俊鎭�");*/
-                    task.TaskState = (int)TaskOutStatusEnum.OutFinish;
-                    BaseDal.UpdateData(task);
-
-
-                    content = HttpHelperh.Get<WebResponseContent>($"{urlTaskCompleted}?TaskNum={task.TaskNum}&HowWorks=2");
-
+                    task.TaskState = (int)TaskOutStatusEnum.SC_OutFinish;
                     task.ModifyDate = DateTime.Now;
-                    BaseDal.DeleteData(task);
+                    BaseDal.UpdateData(task);
+                    content = HttpHelperh.Get<WebResponseContent>($"{urlTaskCompleted}?TaskNum={task.TaskNum}");
+                    Console.WriteLine("浠诲姟瀹屾垚");
+                    //BaseDal.DeleteData(task);
                     // _task_HtyService.AddTaskHty(task); 闇�瑕佹坊鍔犵Щ鍏ュ巻鍙�
-                    _taskExecuteDetailService.AddTaskExecuteDetail(task.TaskId, $"鍑哄簱瀹屾垚");
-                    //todo 鍚屾鍒癢MS
+                    //_taskExecuteDetailService.AddTaskExecuteDetail(task.TaskId, $"鍑哄簱瀹屾垚");
 
-                    //鏆備笉鑰冭檻澶氫釜鍑哄簱鍙�
                 }
                 else if (task.TaskType == (int)TaskInboundTypeEnum.Inbound && task.TaskState == (int)TaskInStatusEnum.SC_InExecuting)
                 {
                     task.TaskState = (int)TaskInStatusEnum.InFinish;
                     BaseDal.UpdateData(task);
 
-                    content = HttpHelperh.Get<WebResponseContent>($"{urlTaskCompleted}?TaskNum={task.TaskNum}&HowWorks=2");
+                    content = HttpHelperh.Get<WebResponseContent>($"{urlTaskCompleted}?TaskNum={task.TaskNum}");
 
                     task.ModifyDate = DateTime.Now;
                     task.Modifier = "System";
@@ -538,7 +536,7 @@
                     task.TaskState = (int)TaskRelocationStatusEnum.SC_RelocationFinish;
                     BaseDal.UpdateData(task);
 
-                    content = HttpHelperh.Get<WebResponseContent>($"{urlTaskCompleted}?TaskNum={task.TaskNum}&HowWorks=2");
+                    content = HttpHelperh.Get<WebResponseContent>($"{urlTaskCompleted}?TaskNum={task.TaskNum}");
 
                   
                     task.ModifyDate = DateTime.Now;
@@ -714,5 +712,11 @@
             return null;
 
         }
+
+
+        public Dt_Task GetOutTaskInfo(string PLCaddress)
+        {
+            return BaseDal.QueryFirst(x => x.TargetAddress== PLCaddress && x.TaskState == (int)TaskOutStatusEnum.SC_OutFinish, TaskOrderBy);
+        }
     }
 }
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/CommonConveyorLineJob.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/CommonConveyorLineJob.cs"
index 040e69b..ea1a40c 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/CommonConveyorLineJob.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/CommonConveyorLineJob.cs"
@@ -146,17 +146,20 @@
                                         }
                                     }
                                 }
-                                else if (!conveyorLineSignalRead.STB && !conveyorLineSignalRead.ACK && conveyorLineStatus.Online && conveyorLineStatus.Goods && !conveyorLineStatus.Alarm && !STB && !ACK && conveyorLineInfoRead.TaskNo == 0)//鍑哄簱
+                                else if (!conveyorLineSignalRead.STB && !conveyorLineSignalRead.ACK && conveyorLineStatus.Online && conveyorLineStatus.Goods && !conveyorLineStatus.Alarm && !STB && !ACK)//鍑哄簱
                                 {
-                                    Dt_Task task = _taskRepository.QueryFirst(x => x.CurrentAddress == item.StationCode && _taskService.TaskOutboundTypes.Contains(x.TaskType) && x.DeviceCode == item.StationDeviceCode && x.TaskState == TaskStatusEnum.Line_Execute.ObjToInt());
-                                    if (task != null)
+                                    
+                                    Dt_Task dt_Ta = _taskService.GetOutTaskInfo(item.StationCode);
+                                    if (dt_Ta != null)
                                     {
+                                        Dt_Router dt_Router = _routerRepository.QueryFirst(x => x.StartPosi == dt_Ta.TargetAddress);
                                         //鍫嗗灈鏈轰换鍔″畬鎴愪笅涓�鍦板潃鏀规垚杈撻�佺嚎涓嬩竴鍦板潃锛岃澶囩紪鍙锋敼鎴愯緭閫佺嚎
-                                        _taskService.UpdateTask(task, TaskStatusEnum.Line_Executing);
-
-                                        device.SetValue(W_ConveyorLineDB.TaskNo, task.TaskNum, item.StationCode);
-                                        device.SetValue(W_ConveyorLineDB.EndPos, task.NextAddress, item.StationCode);
+                                        _taskService.UpdateTaskStatusToNext(dt_Ta.TaskNum);
+                                        device.SetValue(W_ConveyorLineDB.TaskNo, dt_Ta.TaskNum, item.StationCode);
+                                        device.SetValue(W_ConveyorLineDB.EndPos, dt_Router.NextPosi, item.StationCode);
                                         device.SetValue(W_ConveyorLineDB.STB, true, item.StationCode);
+                                        //鍒犻櫎浠诲姟
+                                        _taskRepository.DeleteData(dt_Ta);
                                     }
 
                                 }
@@ -177,10 +180,12 @@
                                         Dt_Task dt_Ta = _taskService.GetTaskIninfo(conveyorLineInfoRead.Barcode);
                                         if(dt_Ta != null)
                                         {
-                                            device.SetValue(W_ConveyorLineDB.ACK, true, item.StationCode);
+                                            
                                             device.SetValue(W_ConveyorLineDB.EndPos, dt_Ta.SourceAddress, item.StationCode);
                                             device.SetValue(W_ConveyorLineDB.TaskNo, dt_Ta.TaskNum, item.StationCode);
+                                            device.SetValue(W_ConveyorLineDB.ACK, true, item.StationCode);
                                         }
+                                       
                                     }
 
 
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob/CommonStackerCraneJob.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob/CommonStackerCraneJob.cs"
index 88114f3..0969294 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob/CommonStackerCraneJob.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob/CommonStackerCraneJob.cs"
@@ -60,6 +60,7 @@
         {
             try
             {
+
                 SpeStackerCrane speStackerCrane = (SpeStackerCrane)context.JobDetail.JobDataMap.Get("JobParams");
                 if (speStackerCrane != null)
                 {
@@ -89,7 +90,7 @@
                                         speStackerCrane.LastTaskType = task.TaskType;
                                         task.Dispatchertime = DateTime.Now;
                                         task.ExceptionMessage = "";
-                                        _taskService.UpdateTask(task, TaskStatusEnum.SC_Executing);
+                                        WebResponseContent webResponseContent = _taskService.UpdateTaskStatusToNext(task.TaskNum);
                                         //寤舵椂1s
                                         Thread.Sleep(1000);
                                     }
@@ -123,7 +124,7 @@
                 }
             }
         }
-        
+
         /// <summary>
         /// 鑾峰彇浠诲姟
         /// </summary>
@@ -140,7 +141,7 @@
             }
 
             task = _taskService.QueryStackerCraneInTask(commonStackerCrane.DeviceCode);         //鑾峰彇鍏ュ簱浠诲姟
-            if(task != null)
+            if (task != null)
             {
                 return task;    //濡傛灉鏈変换鍔″垯鐩存帴涓嬪彂缁欏爢鍨涙満
             }
@@ -152,11 +153,11 @@
                 {
                     if (OutTaskStationIsOccupied(item) != null)
                     {
-                        if(item.Roadway== "SC01")
+                        if (item.Roadway == "SC01")
                         {
                             if (item.Depth == 1) return item;
                             //璋冨彇WMS鎺ュ彛杩涜鍒ゆ柇鏄惁闇�瑕佽繘琛岀Щ搴�
-                            Dt_Task dt_Task= OutTaskMovelibrary(item);
+                            Dt_Task dt_Task = OutTaskMovelibrary(item);
                             if (dt_Task != null) return dt_Task;
 
                         }
@@ -187,7 +188,7 @@
             string SourceAddress = string.Join("-", targetCodes); //缁勮娴呭簱浣嶅湴鍧�
             Dt_Task? tasks = _taskService.QueryStationIsOccupiedOutTasks(task.Roadway, SourceAddress); //鎵炬祬搴撲綅鏄惁鏈変换鍔�
             if (tasks != null) return tasks;
-        //鍚憌ms鐢宠鍒ゆ柇娴呭簱浣嶆槸鍚︽湁璐э紝鏄惁闇�瑕佽繘琛岀Щ搴�
+            //鍚憌ms鐢宠鍒ゆ柇娴呭簱浣嶆槸鍚︽湁璐э紝鏄惁闇�瑕佽繘琛岀Щ搴�
             Dt_Task? taskst = _taskService.RequestWMSTaskMovelibrary(task);
             if (taskst != null) return taskst;
             return null;
@@ -203,26 +204,27 @@
         /// <returns>濡傛灉鏈鍗犵敤锛岃繑鍥炰紶鍏ョ殑浠诲姟淇℃伅锛屽惁鍒欙紝杩斿洖null</returns>
         private Dt_Task? OutTaskStationIsOccupied([NotNull] Dt_Task task)
         {
-            Dt_Router? router = _routerService.QueryNextRoutes(task.Roadway, task.NextAddress).FirstOrDefault();
-            if (router != null)
+            try
             {
-                IDevice? device = Storage.Devices.FirstOrDefault(x => x.DeviceCode == router.ChildPosiDeviceCode);
+                IDevice? device = Storage.Devices.FirstOrDefault(x => x.DeviceCode == "CL01");
                 if (device != null)
                 {
-                    CommonConveyorLine conveyorLine = (CommonConveyorLine)device;
-                    if (conveyorLine.IsOccupied(router.ChildPosi))//鍑哄簱绔欏彴鏈鍗犵敤
+                    OtherDevice conveyorLine = (OtherDevice)device;
+                    DeviceProDTO? deviceProDTO = conveyorLine.DeviceProDTOs.FirstOrDefault(x => x.DeviceChildCode == task.NextAddress && x.DeviceProParamName == "IsOccupied");    //鏍规嵁鍫嗗灈鏈哄湴鍧�锛屽湴鍧�鍚嶇О鎵惧崗璁�
+                    if (deviceProDTO != null)
                     {
-                        return task;
+                        bool B_Event_Test = conveyorLine.Communicator.Read<bool>(deviceProDTO.DeviceProAddress);        //鍒ゆ柇杈撻�佺嚎鏄惁鍏佽鏀捐揣淇″彿
+                        if (!B_Event_Test)
+                        {
+                            return task;
+                        }
                     }
                 }
-                else
-                {
-                    _taskService.UpdateTaskExceptionMessage(task.TaskNum, $"鏈壘鍒板嚭搴撶珯鍙般�恵router.ChildPosiDeviceCode}銆戝搴旂殑閫氳瀵硅薄锛屾棤娉曞垽鏂嚭搴撶珯鍙版槸鍚﹁鍗犵敤");
-                }
             }
-            else
+            catch (Exception ex)
             {
-                _taskService.UpdateTaskExceptionMessage(task.TaskNum, $"鏈壘鍒扮珯鍙般�恵task.NextAddress}銆戜俊鎭紝鏃犳硶鏍¢獙绔欏彴");
+
+                throw;
             }
             return null;
         }
@@ -241,10 +243,10 @@
             stackerCraneTaskCommand.TaskNum = task.TaskNum;
             stackerCraneTaskCommand.WorkType = 1;
             stackerCraneTaskCommand.TrayType = 1;
-            if (task.TaskType==(int)TaskInboundTypeEnum.Inbound)//鍒ゆ柇鏄惁鏄叆搴撲换鍔�
+            if (task.TaskType == (int)TaskInboundTypeEnum.Inbound)//鍒ゆ柇鏄惁鏄叆搴撲换鍔�
             {
 
-                Dt_StationManger dt_StationManger=_stationMangerRepository.QueryFirst(x=>x.StationCode==task.SourceAddress);
+                Dt_StationManger dt_StationManger = _stationMangerRepository.QueryFirst(x => x.StationCode == task.SourceAddress);
 
 
                 string[] startCodes = dt_StationManger.StackerCraneStationCode.Split("-");
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/WIDESEA_TaskInfoService/PartialTaskService_Outbound.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/WIDESEA_TaskInfoService/PartialTaskService_Outbound.cs"
index 10af9a3..fb978c5 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/WIDESEA_TaskInfoService/PartialTaskService_Outbound.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/WIDESEA_TaskInfoService/PartialTaskService_Outbound.cs"
@@ -96,9 +96,9 @@
                         _unitOfWorkManage.BeginTran();
 
 
-                        _stockRepository.AddData(Adddtstockt);
-                        _locationInfoRepository.AddData(Addlocations);
-                        BaseDal.AddData(Addtaskdt);
+                        _stockRepository.DeleteData(Adddtstockt);
+                        _locationInfoRepository.UpdateData(Addlocations);
+                        BaseDal.DeleteData(Addtaskdt);
 
                         var respon = PushTasksToWCS(Addtaskdt,"");
                         if (respon.Status)
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService.cs"
index fecb1ee..428f449 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService.cs"
@@ -323,12 +323,13 @@
                 //鍒犻櫎浠诲姟娣诲姞鍘嗗彶
                 BaseDal.DeleteAndMoveIntoHty(task, App.User.UserId > 0 ? OperateTypeEnum.浜哄伐瀹屾垚 : OperateTypeEnum.鑷姩瀹屾垚);
 
-                WebResponseContent content = TaskCompletionFeedback(task);
+
+                /*WebResponseContent content = TaskCompletionFeedback(task);
                 if (!content.Status)
                 {
                     _unitOfWorkManage.RollbackTran();
                     return content;
-                }
+                }*/
 
                 _unitOfWorkManage.CommitTran();
             }
@@ -359,20 +360,21 @@
                 stockInfo.StockStatus = StockStatusEmun.鍑哄簱瀹屾垚.ObjToInt();
                 
                 int beforeStatus = locationInfo.LocationStatus;
-                locationInfo.LocationStatus = LocationStatusEnum.Free.ObjToInt();
+                locationInfo.LocationStatus =(int)LocationStatusEnum.Free;
                 task.TaskStatus = TaskOutStatusEnum.OutFinish.ObjToInt();
 
                 _unitOfWorkManage.BeginTran();
                 _stockRepository.DeleteData(stockInfo);
                 _locationInfoRepository.UpdateData(locationInfo);   //淇敼鎴愮┖璐т綅
+
                 BaseDal.DeleteAndMoveIntoHty(task, App.User.UserId == 0 ? OperateTypeEnum.鑷姩瀹屾垚 : OperateTypeEnum.浜哄伐瀹屾垚);
                 _locationStatusChangeRecordService.AddLocationStatusChangeRecord(locationInfo, beforeStatus, StockStatusEmun.鍑哄簱瀹屾垚.ObjToInt(), stockInfo.Details.FirstOrDefault()?.OrderNo ?? "", task.TaskNum);
-                WebResponseContent content = TaskCompletionFeedback(task);
+                /*WebResponseContent content = TaskCompletionFeedback(task);
                 if (!content.Status)
                 {
                     _unitOfWorkManage.RollbackTran();
                     return content;
-                }
+                }*/
 
                 _unitOfWorkManage.CommitTran();
                 return webResponse.OK();

--
Gitblit v1.9.3