From 2b25f973bb6d72ce6971d6f9c3cdccf51b7962ab Mon Sep 17 00:00:00 2001
From: wangxinhui <wangxinhui@hnkhzn.com>
Date: 星期六, 06 九月 2025 14:27:08 +0800
Subject: [PATCH] Merge branch 'master' of http://115.159.85.185:8098/r/ZhiHuiQiCe/LongDeLiLiKu

---
 项目代码/WCS/WCSServices/WIDESEAWCS_Tasks/成品仓/ConveyorLineJob_CPB.cs |   51 +++++++++++++++++++++++++++------------------------
 1 files changed, 27 insertions(+), 24 deletions(-)

diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WCSServices/WIDESEAWCS_Tasks/\346\210\220\345\223\201\344\273\223/ConveyorLineJob_CPB.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WCSServices/WIDESEAWCS_Tasks/\346\210\220\345\223\201\344\273\223/ConveyorLineJob_CPB.cs"
index 0810c02..f802375 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WCSServices/WIDESEAWCS_Tasks/\346\210\220\345\223\201\344\273\223/ConveyorLineJob_CPB.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WCSServices/WIDESEAWCS_Tasks/\346\210\220\345\223\201\344\273\223/ConveyorLineJob_CPB.cs"
@@ -77,36 +77,39 @@
                     {
                         R_ConveyorLineCPInfo conveyorLineInfoRead = device.Communicator.ReadCustomer<R_ConveyorLineCPInfo>(deviceProRead.DeviceProAddress);
                         //浜屾ゼ鍏ュ簱鎵爜璇锋眰宸ヤ綅
-                        if (conveyorLineInfoRead != null && conveyorLineInfoRead.Command == 5 && conveyorLineInfoRead.TaskNo > 0 && !string.IsNullOrEmpty(conveyorLineInfoRead.PalletCode))
+                        if (conveyorLineInfoRead != null && conveyorLineInfoRead.Command == 5 && conveyorLineInfoRead.TaskNo > 0)//&& !string.IsNullOrEmpty(conveyorLineInfoRead.PalletCode) todo涓存椂鍒犻櫎鏉′欢闄愬埗
                         {
                             //鏌ユ壘瀵瑰簲浠诲姟
                             Dt_Task task = _taskRepository.QueryFirst(x => x.TaskNum == conveyorLineInfoRead.TaskNo && x.NextAddress == item.StationCode && _taskService.TaskInboundTypes.Contains(x.TaskType) && x.TaskState == TaskStatusEnum.Line_Executing.ObjToInt() && x.DeviceCode == device.DeviceCode);
                             if (task != null)
                             {
                                 //鍒嗛厤宸烽亾 瀛樺叆鎵樼洏鏁版嵁
-                                List<Dt_Router> routers = _routerService.QueryNextRoutes(item.StationCode, "SC02_CP", task.TaskType);
-                                Dt_Router? router = routers.FirstOrDefault();
-                                if (routers == null || routers.Count == 0 || router == null)
-                                {
-                                    WriteError(item.StationName, $"鏈壘鍒板搴旇矾鐢变俊鎭�,璁惧缂栧彿:{item.StationCode},浠诲姟鍙�:{task.TaskNum}");
-                                    continue;
-                                }
-                                if (routers.Count > 1)
-                                {
-                                    WriteError(item.StationName, $"璺敱淇℃伅閰嶇疆閿欒,璁惧缂栧彿:{item.StationCode},浠诲姟鍙�:{task.TaskNum}");
-                                    continue;
-                                }
-                                device.SetValue(W_ConveyorLineCPDB.W_TargetAddress, router.NextPosi, item.StationCode);
-                                device.SetValue(W_ConveyorLineCPDB.W_TaskNo, task.TaskNum, item.StationCode);
-                                device.SetValue(W_ConveyorLineCPDB.W_Command, 1, item.StationCode);
-                                task.CurrentAddress = item.StationCode;
-                                task.NextAddress = router.NextPosi;
-                                task.PalletType = 1;
-                                task.PalletCode = conveyorLineInfoRead.PalletCode;
-                                task.Roadway = "SC02_CP";
-                                task.DeviceCode = router.ChildPosiDeviceCode;
-                                _taskService.UpdateTask(task, TaskStatusEnum.Line_Executing);
-                                WriteInfo(item.StationName, $"浠诲姟鍙穥conveyorLineInfoRead.TaskNo}涓嬩竴姝�");
+                                //string roadWay = _taskService.AssignCPRoadwayNo().Data.ToString();
+                                //if (!string.IsNullOrEmpty(roadWay))
+                                //{
+                                    List<Dt_Router> routers = _routerService.QueryNextRoutes(item.StationCode, "SC01_CP", task.TaskType);
+                                    Dt_Router? router = routers.FirstOrDefault();
+                                    if (routers == null || routers.Count == 0 || router == null)
+                                    {
+                                        WriteError(item.StationName, $"鏈壘鍒板搴旇矾鐢变俊鎭�,璁惧缂栧彿:{item.StationCode},浠诲姟鍙�:{task.TaskNum}");
+                                        continue;
+                                    }
+                                    if (routers.Count > 1)
+                                    {
+                                        WriteError(item.StationName, $"璺敱淇℃伅閰嶇疆閿欒,璁惧缂栧彿:{item.StationCode},浠诲姟鍙�:{task.TaskNum}");
+                                        continue;
+                                    }
+                                    device.SetValue(W_ConveyorLineCPDB.W_TargetAddress, router.NextPosi, item.StationCode);
+                                    device.SetValue(W_ConveyorLineCPDB.W_TaskNo, task.TaskNum, item.StationCode);
+                                    device.SetValue(W_ConveyorLineCPDB.W_Command, 1, item.StationCode);
+                                    task.CurrentAddress = item.StationCode;
+                                    task.NextAddress = router.NextPosi;
+                                    task.PalletCode = DateTime.Now.ToString("yyMMddHHmmss");//todo涓存椂
+                                    task.Roadway = "SC01_CP";
+                                    task.DeviceCode = router.ChildPosiDeviceCode;
+                                    _taskService.UpdateTask(task, TaskStatusEnum.Line_Executing);
+                                    WriteInfo(item.StationName, $"浠诲姟鍙穥conveyorLineInfoRead.TaskNo}涓嬩竴姝�");
+                                //}
                             }
                         }
                     }

--
Gitblit v1.9.3