From 02a4fdd78cef9c7d2a26bfb9aa187179cf0baac3 Mon Sep 17 00:00:00 2001
From: huangxiaoqiang <huangxiaoqiang@hnkhzn.com>
Date: 星期三, 25 二月 2026 17:44:26 +0800
Subject: [PATCH] 1

---
 Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob_NewCW/CommonConveyorLine_NewCWJob.cs |   95 ++++++++++++-----------------------------------
 1 files changed, 25 insertions(+), 70 deletions(-)

diff --git a/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob_NewCW/CommonConveyorLine_NewCWJob.cs b/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob_NewCW/CommonConveyorLine_NewCWJob.cs
index 993d276..d8df41f 100644
--- a/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob_NewCW/CommonConveyorLine_NewCWJob.cs
+++ b/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob_NewCW/CommonConveyorLine_NewCWJob.cs
@@ -94,30 +94,14 @@
                 CommonConveyorLine_NewCW conveyorLine = (CommonConveyorLine_NewCW)context.JobDetail.JobDataMap.Get("JobParams");
                 if (conveyorLine != null)
                 {
-                    #region 绔欏彴鏂瑰紡
-
-                    //List<Dt_StationManager> stationManagers = _stationManagerService.GetAllStationByDeviceCode(conveyorLine.DeviceCode);
-
-                    //foreach (var station in stationManagers)
-                    //{
-                    //    ConveyorLineTaskCommand_After command = conveyorLine.ReadCustomer<ConveyorLineTaskCommand_After>(station.stationChildCode);
-
-                    //    DeviceProtocolDetailDTO? deviceProtocolDetails = conveyorLine.DeviceProtocolDetailDTOs.FirstOrDefault(x => x.DeviceProParamName == nameof(ConveyorLineTaskCommand_After.InteractiveSignal) && x.ProtocalDetailValue == command.InteractiveSignal.ToString());
-                    //    if (deviceProtocolDetails != null)
-                    //    {
-                    //        MethodInfo? method = GetType().GetMethod(deviceProtocolDetails.ProtocolDetailType);
-                    //        if (method != null)
-                    //        {
-                    //            method.Invoke(this, new object[] { conveyorLine, command, station });
-                    //        }
-                    //    }
-                    //}
-
-                    #endregion 绔欏彴鏂瑰紡
-
                     #region 璺敱鏂瑰紡
                     List<string> childDeviceCodes = _routerService.QueryAllPositions(conveyorLine.DeviceCode);
-                    
+
+                    if (conveyorLine.DeviceCode == "1024")
+                    {
+                        childDeviceCodes.Add("4000");
+                    }
+
                     foreach (string childDeviceCode in childDeviceCodes)
                     {
                         
@@ -137,22 +121,22 @@
                             }
                         }
 
-                        if (childDeviceCode == "1670" || childDeviceCode == "1666" || childDeviceCode == "1548" || childDeviceCode == "1448")
-                        {
-                            Platform platform = _platFormRepository.QueryFirst(x => x.DeviceCode == conveyorLine.DeviceCode && x.PlatCode == childDeviceCode && x.Status == "Active");
-                            if (platform != null)
-                            {
-                                if (command.HasPallet != 1)
-                                {
-                                    MethodInfo? method = GetType().GetMethod(platform.ExecutionMethod);
-                                    if (method != null)
-                                    {
-                                        int count = 1;
-                                        method.Invoke(this, new object[] { conveyorLine, command, childDeviceCode, count, platform });
-                                    }
-                                }
-                            }
-                        }
+                        //if (childDeviceCode == "1670" || childDeviceCode == "1666" || childDeviceCode == "1548" || childDeviceCode == "1448")
+                        //{
+                        //    Platform platform = _platFormRepository.QueryFirst(x => x.DeviceCode == conveyorLine.DeviceCode && x.PlatCode == childDeviceCode && x.Status == "Active");
+                        //    if (platform != null)
+                        //    {
+                        //        if (command.HasPallet != 1)
+                        //        {
+                        //            MethodInfo? method = GetType().GetMethod(platform.ExecutionMethod);
+                        //            if (method != null)
+                        //            {
+                        //                int count = 1;
+                        //                method.Invoke(this, new object[] { conveyorLine, command, childDeviceCode, count, platform });
+                        //            }
+                        //        }
+                        //    }
+                        //}
 
 
                         #region 璋冪敤浜嬩欢鎬荤嚎閫氱煡鍓嶇
@@ -205,7 +189,6 @@
                 var log = $"鏃堕棿锛氥�恵DateTime.Now}銆戙�恵conveyorLine.DeviceName}銆戞墭鐩樺彿锛氥�恵command.ConveyorLineBarcode}銆戜换鍔″彿锛氥�恵command.ConveyorLineTaskNum}銆戣澶囩紪鐮侊細銆恵childDeviceCode}銆�";
                 ConsoleHelper.WriteSuccessLine(log);
 
-                //_noticeService.Logs(userTokenIds, new { conveyorLine.DeviceName, log = log, time = DateTime.Now.ToString("G"), color = "red" });
                 WriteInfo(conveyorLine.DeviceName, log);
 
                 if (task == null)
@@ -214,16 +197,6 @@
                 }
                 else
                 {
-                    if (childDeviceCode == "1039")
-                    {
-                        var GWTask = _taskRepository.QueryData(x => x.Roadway.Contains("GWSC2") && x.SourceAddress == "1039" && (x.TaskState == (int)TaskInStatusEnum.Line_InExecuting || x.TaskState == (int)TaskInStatusEnum.Line_InFinish)).ToList();
-                        if (GWTask.Count >= 2 && childDeviceCode == "1039" && task.Roadway.Contains("GWSC2"))
-                        {
-                            ConsoleHelper.WriteErrorLine($"鏃堕棿锛氥�恵DateTime.Now}銆戞墭鐩樺彿锛氥�恵command.ConveyorLineBarcode}銆戦珮娓╀簩宸插瓨鍦ㄣ�恵GWTask.Count}銆戜釜浠诲姟澶т簬2涓换鍔′笉鍙笅鍙�");
-                            return;
-                        }
-                    }
-
                     ConveyorLineTaskCommand_After taskCommand = _mapper.Map<ConveyorLineTaskCommand_After>(task);
 
                     bool sendFlag = SendCommand(taskCommand, conveyorLine, childDeviceCode);
@@ -261,7 +234,6 @@
                 if (newTask != null)
                 {
                     ConveyorLineTaskCommand_After taskCommand = _mapper.Map<ConveyorLineTaskCommand_After>(newTask);
-                    //conveyorLine.SendCommand(taskCommand, childDeviceCode);
 
                     bool sendFlag = SendCommand(taskCommand, conveyorLine, childDeviceCode);
                     if (sendFlag)
@@ -271,15 +243,6 @@
                     }
                 }
             }
-            //else
-            //{
-            //    //褰撳墠鍦板潃璇锋眰 瀵绘壘褰撳墠鍦板潃鐨勬墭鐩樺彿 浠诲姟鍙风殑浠诲姟锛屽瀛樺湪浠诲姟鍒欓噸鏂板啀娆″啓鍏ユ柊鐩爣鍦板潃
-            //    Dt_Task currentTask = _taskService.QueryExecutingCurrentConveyorLineTask(command.ConveyorLineTaskNum, childDeviceCode, command.ConveyorLineBarcode);
-            //    if (currentTask != null)
-            //    {
-            //        conveyorLine.SetValue(ConveyorLineDBName_After.ConveyorLineTargetAddress, Convert.ToInt16(currentTask.TargetAddress), childDeviceCode);
-            //    }
-            //}
         }
 
         /// <summary>
@@ -365,9 +328,9 @@
                 };
 
                 var MOMIpAddress = wmsBase + ipAddress;
-
-                var result = HttpHelper.PostAsync(MOMIpAddress, trayCells.Serialize()).Result;
                 WriteInfo("鍏ョ珯鏍¢獙", $"銆恵childDeviceCode}銆戝叆绔欐牎楠岃姹傚弬鏁般�恵trayCells.Serialize()}銆�");
+                var result = HttpHelper.PostAsync(MOMIpAddress, trayCells.Serialize()).Result;
+                
                 WriteInfo("鍏ョ珯鏍¢獙", "");
                 WriteInfo("鍏ョ珯鏍¢獙", $"銆恵childDeviceCode}銆戝叆绔欐牎楠岃繑鍥炲弬鏁般�恵result}銆�");
                 ResultTrayCellsStatus result1 = JsonConvert.DeserializeObject<ResultTrayCellsStatus>(result);
@@ -377,7 +340,6 @@
                     if (newTask != null)
                     {
                         ConveyorLineTaskCommand_After taskCommand = _mapper.Map<ConveyorLineTaskCommand_After>(newTask);
-                        //conveyorLine.SendCommand(taskCommand, childDeviceCode);
 
                         bool sendFlag = SendCommand(taskCommand, conveyorLine, childDeviceCode);
                         if (sendFlag)
@@ -391,7 +353,6 @@
                 {
                     ConveyorLineTaskCommand_After taskCommand = _mapper.Map<ConveyorLineTaskCommand_After>(task);
                     taskCommand.ConveyorLineTargetAddress = Convert.ToInt16(stationManager.stationNGChildCode);
-                    //conveyorLine.SendCommand(taskCommand, childDeviceCode);
 
                     bool sendFlag = SendCommand(taskCommand, conveyorLine, childDeviceCode);
                     if (sendFlag)
@@ -414,9 +375,7 @@
             var log = $"鏃堕棿锛氥�恵DateTime.Now}銆戙�恵conveyorLine.DeviceName}銆戞墭鐩樺彿锛氥�恵command.ConveyorLineBarcode}銆戜换鍔″彿锛氥�恵command.ConveyorLineTaskNum}銆戣澶囩紪鐮侊細銆恵childDeviceCode}銆�";
             ConsoleHelper.WriteSuccessLine(log);
 
-            //_noticeService.Logs(userTokenIds, new { conveyorLine.DeviceName, log = log, time = DateTime.Now.ToString("G"), color = "red" });
             WriteInfo(conveyorLine.DeviceName, log);
-
 
             var task = _taskService.QueryExecutingConveyorLineTask(command.ConveyorLineTaskNum, childDeviceCode, command.ConveyorLineBarcode);
             if (task != null)
@@ -445,7 +404,6 @@
                     }
                 }
 
-                //conveyorLine.SendCommand(taskCommand, childDeviceCode);
                 bool sendFlag = SendCommand(taskCommand, conveyorLine, childDeviceCode);
                 if (sendFlag)
                 {
@@ -571,11 +529,8 @@
                 
                 List<string> strings = platform.Location.Split(',').ToList();
 
-                WriteInfo("璋冨害鎵ц鏃堕棿璁板綍", "銆愯皟鍙朩MS鍑哄簱鎺ュ彛寮�濮嬫椂闂达細銆�" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff"));
-
                 var result = await HttpHelper.PostAsync(wmsIpAddress, new { Position = childDeviceCode, Tag = (int)taskType, AreaCdoe = platform.Stacker, AreaCdoes = strings, platform.ProductionLine }.Serialize());
-
-                WriteInfo("璋冨害鎵ц鏃堕棿璁板綍", "銆愯皟鍙朩MS鍑哄簱鎺ュ彛缁撴潫鏃堕棿锛氥��" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff"));
+                WriteInfo("OCV璇锋眰杩斿洖鍙傛暟", $"鏃堕棿锛氥�恵DateTime.Now}銆戣姹傜偣浣嶃�恵childDeviceCode}銆戣繑鍥炲弬鏁般�恵JsonConvert.SerializeObject(result)}銆�");
 
                 WebResponseContent content = JsonConvert.DeserializeObject<WebResponseContent>(result);
 

--
Gitblit v1.9.3