From 4b4afa78f556199e5778d5cac88d3d6de6d8c1da Mon Sep 17 00:00:00 2001
From: Administrator <Administrator@DESKTOP-JIE70N9>
Date: 星期四, 12 六月 2025 10:57:17 +0800
Subject: [PATCH] 修改测试问题

---
 Admin.NET/WCS.Application/PLC/PLCService.cs |   16 +++++++++++-----
 1 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/Admin.NET/WCS.Application/PLC/PLCService.cs b/Admin.NET/WCS.Application/PLC/PLCService.cs
index 0a6df94..0177093 100644
--- a/Admin.NET/WCS.Application/PLC/PLCService.cs
+++ b/Admin.NET/WCS.Application/PLC/PLCService.cs
@@ -9,6 +9,7 @@
 using Furion.Logging;
 using IoTClient;
 using NewLife.Reflection;
+using Newtonsoft.Json;
 using Org.BouncyCastle.Ocsp;
 using SixLabors.ImageSharp.ColorSpaces;
 using WCS.Application.Entity;
@@ -1430,14 +1431,19 @@
             
             if (taskModel.taskType == "DPJRK")
             {
+                //var code = "[{\"type\":\"SITE\",\"code\":\"B100101\"},{\"type\":\"PILE_COUNT\",\"code\":\"8\"}]";
+                var code = new List<object>()
+                {
+                    new {type = "SITE" , code = modTask.StartLocate},
+                    new { type = "PILE_COUNT", code = modTask.Qty }
+                };
+                
                 taskModel.targetRoute.Add(new targetRoute() { 
                     seq = 0,
                     type = "MIX_CONDITION",
-                    code = new List<object>() { 
-                        new { type = "SITE", code = modTask.StartLocate },
-                        new { type = "PILE_COUNT", code = modTask.Qty }
-                    }
-                    
+                    code = JsonConvert.SerializeObject(code) // "[{\"type":\"SITE", code = modTask.StartLocate },new { type = "PILE_COUNT", code = modTask.Qty }]"
+
+
                 });
                 taskModel.targetRoute.Add(new targetRoute() { seq = 1, type = type2, code = modTask.EndLocate });
             }

--
Gitblit v1.8.0