From 81f3d2205ff6ee8d173f6d30f57ad510ad86e0bf Mon Sep 17 00:00:00 2001
From: duyongjia <adu_555@163.com>
Date: 星期三, 20 十一月 2024 16:04:07 +0800
Subject: [PATCH] 1

---
 代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob/CommonStackerCraneJob.cs |   21 ++++++++++++++-------
 1 files changed, 14 insertions(+), 7 deletions(-)

diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob/CommonStackerCraneJob.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob/CommonStackerCraneJob.cs"
index 3e63582..4102b58 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob/CommonStackerCraneJob.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob/CommonStackerCraneJob.cs"
@@ -1,5 +1,6 @@
 锘縰sing HslCommunication;
 using Microsoft.AspNetCore.Components.Routing;
+using Newtonsoft.Json;
 using Quartz;
 using System;
 using System.Collections.Generic;
@@ -7,6 +8,7 @@
 using System.Linq;
 using System.Text;
 using System.Threading.Tasks;
+using WIDESEAWCS_Common.ServiceLog;
 using WIDESEAWCS_Common.TaskEnum;
 using WIDESEAWCS_Communicator;
 using WIDESEAWCS_Core.Enums;
@@ -47,7 +49,8 @@
 
         public Task Execute(IJobExecutionContext context)
         {
-            CommonStackerCrane commonStackerCrane = (CommonStackerCrane)context.JobDetail.JobDataMap.Get("JobParams");
+            //CommonStackerCrane commonStackerCrane = (CommonStackerCrane)context.JobDetail.JobDataMap.Get("JobParams");
+            CommonStackerCrane commonStackerCrane = Storage.Devices.FirstOrDefault(x => x.DeviceCode == "SC01") as CommonStackerCrane;
             try
             {  
                 if (commonStackerCrane != null)
@@ -102,8 +105,8 @@
 
 
             //鏌ヨ鎻愬崌鏈�/缁勭珛鏈轰俊鍙�
-            //Task.Run(delegate
-            //{
+            Task.Run(delegate
+            {
                 try
                 {
                    
@@ -145,11 +148,11 @@
                                 if(IsWriteOne == 0) 
                                 {
                                   
-                                    commonStackerCrane.Communicator.Write<short>("DB1.0.0", 1);
+                                   var d= commonStackerCrane.Communicator.Write<short>("DB1.0.0", 1);
                                 }
                                 //璇诲彇鎻愬崌鏈轰俊鍙凤紝纭畾鏄惁鎻愬崌瀹屾垚
                                
-                                commonStackerCrane.Communicator.Read<short>("DB2.2.0");
+                              IsFinish=  commonStackerCrane.Communicator.Read<short>("DB2.2.0");
                             }
                             else if (task3001.SourceAddress == "SC01-002-000-002")//WMS 1002绔欑偣
                             {
@@ -166,10 +169,14 @@
                             {
                                 MESSendCMD sendcmd = new MESSendCMD { cmd = 2002, task_id = task3001.TaskNum, status = 6 };
                                 MESResponse res = ApiInvoke.SendTaskCMD(sendcmd);
+                                string inparam = JsonConvert.SerializeObject(sendcmd);
+                                WriteDebug(nameof(CommonStackerCraneJob), $"鎻愬崌鏈烘彁鍗囧畬鎴愶紝鍥炰紶WMS,鍏ュ弬锛歿inparam}");
+
                                 if (res != null && res.code != 0)
                                 {
                                     WriteDebug(nameof(CommonStackerCraneJob), $"鎻愬崌鏈烘彁鍗囧畬鎴愶紝鍥炰紶WMS澶辫触锛佷换鍔″彿{task3001.TaskNum}");
                                 }
+
 
                             }
                         }
@@ -239,9 +246,9 @@
                 {
                     WriteError(nameof(CommonStackerCraneJob), "鏌ヨ鎴栧啓鍏LC鐘舵�佸け璐ワ紒", ex);
                 }
-             
 
-            //});
+
+            });
 
 
 

--
Gitblit v1.9.3