From 17bca2d690f283ec110c0c327a8508ed8fba9d21 Mon Sep 17 00:00:00 2001
From: wangxinhui <wangxinhui@hnkhzn.com>
Date: 星期四, 05 六月 2025 09:21:19 +0800
Subject: [PATCH] 最新代码提交

---
 代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/干膜仓/ConveyorLineJob_GM.cs |   28 ++++++++++++++++++++++++----
 1 files changed, 24 insertions(+), 4 deletions(-)

diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/\345\271\262\350\206\234\344\273\223/ConveyorLineJob_GM.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/\345\271\262\350\206\234\344\273\223/ConveyorLineJob_GM.cs"
index c50fe36..8e3b890 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/\345\271\262\350\206\234\344\273\223/ConveyorLineJob_GM.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/\345\271\262\350\206\234\344\273\223/ConveyorLineJob_GM.cs"
@@ -1,4 +1,5 @@
-锘縰sing Newtonsoft.Json;
+锘縰sing Microsoft.IdentityModel.Tokens;
+using Newtonsoft.Json;
 using Quartz;
 using System;
 using System.Collections.Generic;
@@ -94,10 +95,28 @@
                         {
                             if (conveyorLineSignalRead.STB && conveyorLineStatus.Online && conveyorLineStatus.Goods && !conveyorLineStatus.Alarm && !conveyorLineSignalWrite.ACK)
                             {
-                                if (!string.IsNullOrEmpty(conveyorLineInfoRead.Barcode))
+                                string boxcode = device.GetValue<R_ConveyorLineDB, string>(R_ConveyorLineDB.Boxcode, item.StationCode);
+                                
+                                if (!string.IsNullOrEmpty(boxcode))
                                 {
+                                    string sc = device.Communicator.Read<string>("DB900.508.0");
+                                    WriteError(device.DeviceName, $"璇诲彇鍊硷細{boxcode},瀵规瘮{sc}");
+                                    string boxEndCode = "";
+                                    if (boxcode.LastIndexOf(",SC:") >=0)
+                                    {
+                                        boxEndCode = "M"+ boxcode.Substring(0,boxcode.LastIndexOf(",SC:")) + sc.Substring(sc.IndexOf(",SC:")).Replace("\0", "");
+                                    }
+                                    else if (boxcode.LastIndexOf(",SC") > 0)
+                                    {
+                                        boxEndCode = "M" + boxcode.Substring(0, boxcode.LastIndexOf(",SC")) + sc.Substring(sc.IndexOf("SC:")).Replace("\0", "");
+                                    }
+                                    else if (boxcode.LastIndexOf(",S") > 0)
+                                    {
+                                        boxEndCode = "M" + boxcode.Substring(0, boxcode.LastIndexOf(",S")) + sc.Substring(sc.IndexOf("SC:")).Replace("\0", "");
+                                    }
+
                                     //鍏ュ簱鐢宠浠诲姟
-                                    WebResponseContent content = _taskService.RequestWMSTask(conveyorLineInfoRead.Barcode, item.StationCode);
+                                    WebResponseContent content = _taskService.RequestWMSTask(conveyorLineInfoRead.Barcode, item.StationCode, boxEndCode);
                                     if (content.Status)
                                     {
                                         device.SetValue(W_ConveyorLineDB.ACK, true, item.StationCode);
@@ -106,7 +125,8 @@
                             }
                             else if (!conveyorLineSignalRead.STB && conveyorLineStatus.Online && conveyorLineStatus.Goods && !conveyorLineStatus.Alarm && conveyorLineSignalWrite.ACK)
                             {
-                                Dt_Task task = _taskRepository.QueryFirst(x => x.CurrentAddress == item.StationCode && x.PalletCode == conveyorLineInfoRead.Barcode && x.DeviceCode == item.StationDeviceCode && x.TaskState == TaskStatusEnum.New.ObjToInt());
+                                string boxcode = device.GetValue<R_ConveyorLineDB, string>(R_ConveyorLineDB.Boxcode, item.StationCode);
+                                Dt_Task task = _taskRepository.QueryFirst(x => x.CurrentAddress == item.StationCode && boxcode.Contains(x.PalletCode) && x.TaskState == TaskStatusEnum.New.ObjToInt());
                                 if (task != null)
                                 {
                                     _taskService.UpdateTask(task, TaskStatusEnum.SC_Execute, currentAddress: item.StackerCraneStationCode, deviceCode: task.Roadway, nextAddress: task.TargetAddress);

--
Gitblit v1.9.3