From a23691d54a0142ba9a0668788d366638bd82349e Mon Sep 17 00:00:00 2001
From: wangxinhui <wangxinhui@hnkhzn.com>
Date: 星期二, 26 八月 2025 08:25:41 +0800
Subject: [PATCH] 更新最新代码,码垛,伸缩货叉等

---
 项目代码/WCS/WCSServices/WIDESEAWCS_Tasks/成品仓/ConveyorLineJob_CPH.cs |   40 ++++++++++++++++++++++++++--------------
 1 files changed, 26 insertions(+), 14 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_CPH.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_CPH.cs"
index 742eb6b..2f9369c 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_CPH.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_CPH.cs"
@@ -1,5 +1,6 @@
 锘縰sing Microsoft.AspNetCore.Components.Routing;
 using Newtonsoft.Json;
+using OfficeOpenXml.FormulaParsing.Excel.Functions.DateTime;
 using Quartz;
 using SqlSugar.Extensions;
 using System;
@@ -80,11 +81,24 @@
                         //鐮佸灈鐜嚎璇锋眰浠诲姟 
                         if (conveyorLineInfoRead != null && (conveyorLineInfoRead.R_State == 2 || conveyorLineInfoRead.R_State == 3) && conveyorLineInfoRead.R_TaskNo <= 0 && !string.IsNullOrEmpty(conveyorLineInfoRead.R_BoxCode) && conveyorLineInfoRead.R_Request==1)
                         {
-                            WebResponseContent content = _taskService.RequestWMSTaskSimple(conveyorLineInfoRead.R_BoxCode, item.StationCode);
-                            //鍚慦MS璇锋眰浠诲姟
-                            if (true)
-                            {
+                            //WebResponseContent content = _taskService.RequestWMSTaskSimple(conveyorLineInfoRead.R_BoxCode, item.StationCode);
+                            ////鍚慦MS璇锋眰浠诲姟
+                            //if (true)
+                            //{
 
+                            //}
+                            if (conveyorLineInfoRead.R_BoxCode=="1")
+                            {
+                                int taskNum = Convert.ToInt32(DateTime.Now.ToString("ddHHmmss"));
+                                WebResponseContent content = _taskService.RequestWMSTaskSimple(taskNum.ToString(), item.StationCode,taskType:TaskTypeEnum.ProductMD.ObjToInt(),taskNum: taskNum, targetAddress:"2554");
+                                //璇锋眰浠诲姟
+                                if (content.Status)
+                                {
+                                    //鍐欏叆鍑哄簱绾夸綋鍦板潃
+                                    device.SetValue(W_CLineCPHDB.W_TaskNo, 5, item.StationCode);
+                                    device.SetValue(W_CLineCPHDB.W_TaskNo, taskNum, item.StationCode);
+                                    device.SetValue(W_ConveyorLineCPDB.W_Command, 1, item.StationCode);
+                                }
                             }
                         }
                     }
@@ -94,16 +108,14 @@
                         //鑾峰彇鐮佸灈鍙d换鍔℃洿鏂颁换鍔$姸鎬�
                         if (conveyorLineInfoRead != null && (conveyorLineInfoRead.R_State == 2 || conveyorLineInfoRead.R_State == 3) && conveyorLineInfoRead.R_TaskNo > 0)
                         {
-
-                        }
-                    }
-                    else if (item.StationType == StationTypeEnum.StationType_InboundAndOutbound.ObjToInt() && deviceProRead != null)
-                    {
-                        R_CLineCPHInfo conveyorLineInfoRead = device.Communicator.ReadCustomer<R_CLineCPHInfo>(deviceProRead.DeviceProAddress);
-                        //鐮佸灈鐜嚎鎺掑嚭鍙h姹傚彇娑堜换鍔�
-                        if (conveyorLineInfoRead != null && (conveyorLineInfoRead.R_State == 2 || conveyorLineInfoRead.R_State == 3) && conveyorLineInfoRead.R_TaskNo > 0 && conveyorLineInfoRead.R_Request == 2)
-                        {
-
+                            Dt_Task task = _taskRepository.QueryFirst(x => x.TaskNum == conveyorLineInfoRead.R_TaskNo && x.NextAddress==item.StationCode && x.TaskState == TaskStatusEnum.Line_Executing.ObjToInt());
+                            if (task != null)
+                            {
+                                task.CurrentAddress = item.StationCode;
+                                task.NextAddress = task.TargetAddress;
+                                task.DeviceCode = item.StackerCraneCode;
+                                _taskService.UpdateTask(task, TaskStatusEnum.MD_Executing);
+                            }
                         }
                     }
                     else

--
Gitblit v1.9.3