From b6c983ac19c0c80744795e122575f4b9ac145414 Mon Sep 17 00:00:00 2001
From: wanshenmean <cathay_xy@163.com>
Date: 星期日, 19 四月 2026 18:53:40 +0800
Subject: [PATCH] feat: 更新机器人任务处理逻辑和接口配置

---
 Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/RobotJob/Workflow/RobotPrefixCommandHandler.cs     |    1 
 Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/dotnet-tools.json                                 |    5 
 Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/RobotTaskService.cs                      |   44 +++++++
 Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Properties/PublishProfiles/FolderProfile.pubxml   |   10 +
 Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Model/Models/TaskInfo/Dt_RobotTask.cs                    |   16 +-
 Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/RobotJob/RobotMessageHandler.cs                    |    2 
 项目资料/设备协议/上位系统对接/陕西顷刻能源科技MES系统对接接口.pdf                                                         |    0 
 Code/WCS/WIDESEAWCS_Client/src/api/http.js                                                     |    4 
 Code/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Properties/PublishProfiles/FolderProfile.pubxml   |    2 
 Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/RobotJob/Workflow/RobotWorkflowOrchestrator.cs     |    9 
 Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/RobotJob/RobotTaskProcessor.cs                     |   69 ++++++++---
 Code/WCS/WIDESEAWCS_Client/src/views/taskinfo/robotTask.vue                                    |   64 ++++++++++
 Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/HostedService/ApiRouteCacheWarmupHostedService.cs |    4 
 Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_QuartzJob/DeviceBase/DeviceCommand.cs                    |    9 +
 Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineNewJob/CommonConveyorLineNewJob.cs     |   40 ++++++
 Code/.omc/state/last-tool-error.json                                                           |    8 
 Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/RobotJob/Workflow/RobotSimpleCommandHandler.cs     |   14 +-
 Code/.omc/state/subagent-tracking.json                                                         |    2 
 Code/WCS/WIDESEAWCS_Client/.omc/project-memory.json                                            |   15 ++
 19 files changed, 261 insertions(+), 57 deletions(-)

diff --git a/Code/.omc/state/last-tool-error.json b/Code/.omc/state/last-tool-error.json
index 1f18ea3..c9a8df7 100644
--- a/Code/.omc/state/last-tool-error.json
+++ b/Code/.omc/state/last-tool-error.json
@@ -1,7 +1,7 @@
 {
-  "tool_name": "Read",
-  "tool_input_preview": "{\"file_path\":\"D:\\\\Git\\\\ShanMeiXinNengYuan\\\\Code\\\\WMS\\\\WIDESEA_WMSServer\\\\WIDESEA_TaskInfoService\\\\WCS\\\\TaskService.cs\"}",
-  "error": "File does not exist. Note: your current working directory is D:\\Git\\ShanMeiXinNengYuan\\Code.",
-  "timestamp": "2026-04-18T07:45:29.125Z",
+  "tool_name": "Bash",
+  "tool_input_preview": "{\"command\":\"cd D:\\\\Git\\\\ShanMeiXinNengYuan\\\\Code\\\\WCS\\\\WIDESEAWCS_Client && npm run build 2>&1 | head -30\",\"timeout\":120000}",
+  "error": "Exit code 1\n/usr/bin/bash: line 1: cd: D:GitShanMeiXinNengYuanCodeWCSWIDESEAWCS_Client: No such file or directory",
+  "timestamp": "2026-04-19T07:15:17.022Z",
   "retry_count": 1
 }
\ No newline at end of file
diff --git a/Code/.omc/state/subagent-tracking.json b/Code/.omc/state/subagent-tracking.json
index 5ef95e2..27a37ae 100644
--- a/Code/.omc/state/subagent-tracking.json
+++ b/Code/.omc/state/subagent-tracking.json
@@ -772,5 +772,5 @@
   "total_spawned": 83,
   "total_completed": 83,
   "total_failed": 0,
-  "last_updated": "2026-04-18T14:04:59.113Z"
+  "last_updated": "2026-04-18T14:41:25.052Z"
 }
\ No newline at end of file
diff --git a/Code/WCS/WIDESEAWCS_Client/.omc/project-memory.json b/Code/WCS/WIDESEAWCS_Client/.omc/project-memory.json
index bebd8f4..0484b9f 100644
--- a/Code/WCS/WIDESEAWCS_Client/.omc/project-memory.json
+++ b/Code/WCS/WIDESEAWCS_Client/.omc/project-memory.json
@@ -177,6 +177,19 @@
       ]
     }
   },
-  "hotPaths": [],
+  "hotPaths": [
+    {
+      "path": "src\\views\\system\\Sys_User.vue",
+      "accessCount": 1,
+      "lastAccessed": 1776583114779,
+      "type": "file"
+    },
+    {
+      "path": "src\\views\\taskinfo\\robotTask.vue",
+      "accessCount": 1,
+      "lastAccessed": 1776583136953,
+      "type": "file"
+    }
+  ],
   "userDirectives": []
 }
\ No newline at end of file
diff --git a/Code/WCS/WIDESEAWCS_Client/src/api/http.js b/Code/WCS/WIDESEAWCS_Client/src/api/http.js
index 7bd4f6a..714b153 100644
--- a/Code/WCS/WIDESEAWCS_Client/src/api/http.js
+++ b/Code/WCS/WIDESEAWCS_Client/src/api/http.js
@@ -15,11 +15,11 @@
     axios.defaults.baseURL = 'http://127.0.0.1:9292/';
 }
 else if (process.env.NODE_ENV == 'debug') {
-    axios.defaults.baseURL = 'http://127.0.0.1:8098/';
+    axios.defaults.baseURL = 'http://127.0.0.1:9292/';
 }
 
 else if (process.env.NODE_ENV == 'production') {
-    axios.defaults.baseURL = 'http://115.159.85.185:9292/';
+    axios.defaults.baseURL = 'http://192.168.60.30:9292/';
 }
 if (!axios.defaults.baseURL.endsWith('/')) {
     axios.defaults.baseURL+="/";
diff --git a/Code/WCS/WIDESEAWCS_Client/src/views/taskinfo/robotTask.vue b/Code/WCS/WIDESEAWCS_Client/src/views/taskinfo/robotTask.vue
index 8045fb4..eff9af8 100644
--- a/Code/WCS/WIDESEAWCS_Client/src/views/taskinfo/robotTask.vue
+++ b/Code/WCS/WIDESEAWCS_Client/src/views/taskinfo/robotTask.vue
@@ -28,9 +28,67 @@
       sortName: "createDate",       // 榛樿鎺掑簭瀛楁
     });
 
-    // 缂栬緫琛ㄥ崟瀛楁锛堝垵濮嬩负绌猴紝鏍规嵁瀹為檯缂栬緫闇�姹傞厤缃級
-    const editFormFields = ref({});
-    const editFormOptions = ref([]);
+    // 缂栬緫琛ㄥ崟瀛楁
+    const editFormFields = ref({
+      robotTaskNum: "",
+      robotRoadway: "",
+      robotTaskType: "",
+      robotTaskState: "",
+      robotTaskTotalNum: "",
+      robotSourceAddress: "",
+      robotTargetAddress: "",
+      robotSourceAddressLineCode: "",
+      robotTargetAddressLineCode: "",
+      robotSourceAddressPalletCode: "",
+      robotTargetAddressPalletCode: "",
+      robotGrade: 2,
+    });
+
+    // 缂栬緫琛ㄥ崟閰嶇疆
+    const editFormOptions = ref([
+      [
+        { title: "浠诲姟缂栧彿", field: "robotTaskNum", type: "int", required: true },
+        { title: "宸烽亾", field: "robotRoadway", type: "string", required: true },
+        { title: "浠诲姟鎬绘暟", field: "robotTaskTotalNum", type: "int", required: true },
+        {
+          title: "浼樺厛绾�",
+          field: "robotGrade",
+          type: "select",
+          data: [
+            { key: 1, value: "浣�" },
+            { key: 2, value: "鏅��" },
+            { key: 3, value: "楂�" },
+            { key: 4, value: "绱ф��" },
+          ],
+        },
+      ],
+      [
+        {
+          title: "浠诲姟绫诲瀷",
+          field: "robotTaskType",
+          type: "select",
+          dataKey: "taskType",
+          data: [],
+          required: true,
+        },
+        {
+          title: "浠诲姟鐘舵��",
+          field: "robotTaskState",
+          type: "select",
+          dataKey: "taskState",
+          data: [],
+          required: true,
+        },
+        { title: "鏉ユ簮鍦板潃", field: "robotSourceAddress", type: "string", required: true },
+        { title: "鐩爣鍦板潃", field: "robotTargetAddress", type: "string", required: true },
+      ],
+      [
+        { title: "鏉ユ簮绾夸唬鐮�", field: "robotSourceAddressLineCode", type: "string" },
+        { title: "鐩爣绾夸唬鐮�", field: "robotTargetAddressLineCode", type: "string" },
+        { title: "鏉ユ簮鎵樼洏浠g爜", field: "robotSourceAddressPalletCode", type: "string" },
+        { title: "鐩爣鎵樼洏浠g爜", field: "robotTargetAddressPalletCode", type: "string" },
+      ],
+    ]);
 
     // 鎼滅储琛ㄥ崟瀛楁
     const searchFormFields = ref({
diff --git a/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Model/Models/TaskInfo/Dt_RobotTask.cs b/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Model/Models/TaskInfo/Dt_RobotTask.cs
index cb2cc60..c5155db 100644
--- a/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Model/Models/TaskInfo/Dt_RobotTask.cs
+++ b/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Model/Models/TaskInfo/Dt_RobotTask.cs
@@ -64,27 +64,27 @@
         public string RobotTargetAddress { get; set; }
 
         /// <summary>
-        /// 鏈哄櫒浜烘潵婧愬湴鍧�绾夸唬鐮�
+        /// 鏈哄櫒浜烘潵婧愬湴鍧�杈撻�佺嚎缂栧彿
         /// </summary>
-        [SugarColumn(Length = 20, ColumnDescription = "鏈哄櫒浜烘潵婧愬湴鍧�绾夸唬鐮�")]
+        [SugarColumn(Length = 20, ColumnDescription = "鏈哄櫒浜烘潵婧愬湴鍧�杈撻�佺嚎缂栧彿")]
         public string RobotSourceAddressLineCode { get; set; }
 
         /// <summary>
-        /// 鏈哄櫒浜虹洰鏍囧湴鍧�绾夸唬鐮�
+        /// 鏈哄櫒浜虹洰鏍囧湴鍧�杈撻�佺嚎缂栧彿
         /// </summary>
-        [SugarColumn(Length = 20, ColumnDescription = "鏈哄櫒浜虹洰鏍囧湴鍧�绾夸唬鐮�")]
+        [SugarColumn(Length = 20, ColumnDescription = "鏈哄櫒浜虹洰鏍囧湴鍧�杈撻�佺嚎缂栧彿")]
         public string RobotTargetAddressLineCode { get; set; }
 
         /// <summary>
-        /// 鏈哄櫒浜烘潵婧愬湴鍧�绾挎墭鐩樹唬鐮�
+        /// 鏈哄櫒浜烘潵婧愬湴鍧�杈撻�佺嚎鎵樼洏鍙�
         /// </summary>
-        [SugarColumn(Length = 20, ColumnDescription = "鏈哄櫒浜烘潵婧愬湴鍧�绾挎墭鐩樹唬鐮�")]
+        [SugarColumn(Length = 20, ColumnDescription = "鏈哄櫒浜烘潵婧愬湴鍧�杈撻�佺嚎鎵樼洏鍙�")]
         public string RobotSourceAddressPalletCode { get; set; }
 
         /// <summary>
-        /// 鏈哄櫒浜虹洰鏍囧湴鍧�绾挎墭鐩樹唬鐮�
+        /// 鏈哄櫒浜虹洰鏍囧湴鍧�绾挎墭鐩樺彿
         /// </summary>
-        [SugarColumn(Length = 20, ColumnDescription = "鏈哄櫒浜虹洰鏍囧湴鍧�绾挎墭鐩樹唬鐮�")]
+        [SugarColumn(Length = 20, ColumnDescription = "鏈哄櫒浜虹洰鏍囧湴鍧�绾挎墭鐩樺彿")]
         public string RobotTargetAddressPalletCode { get; set; }
 
         /// <summary>
diff --git a/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_QuartzJob/DeviceBase/DeviceCommand.cs b/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_QuartzJob/DeviceBase/DeviceCommand.cs
index f81c8e3..61b3377 100644
--- a/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_QuartzJob/DeviceBase/DeviceCommand.cs
+++ b/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_QuartzJob/DeviceBase/DeviceCommand.cs
@@ -166,7 +166,14 @@
                             //throw new Exception($"璇诲彇PLC瀛楃涓插畾涔夐暱搴︺�恵Content[index]}銆戜笌瀵硅薄銆恵GetType().Name}銆戝睘鎬с�恵propertyInfo.Name}銆戠壒鎬у畾涔夊瓧绗︿覆闀垮害銆恵dataLength}銆戜笉涓�鑷�");
                             //QuartzLogger.Debug($"璇诲彇PLC瀛楃涓插畾涔夐暱搴︺�恵Content[index]}銆戜笌瀵硅薄銆恵GetType().Name}銆戝睘鎬с�恵propertyInfo.Name}銆戠壒鎬у畾涔夊瓧绗︿覆闀垮害銆恵dataLength}銆戜笉涓�鑷�");
 
-                            propertyInfo.SetValue(this, Encoding.Default.GetString(Content, index, dataLength).Trim().Replace("\0", "").Replace("\\u000","").Trim());
+                            try
+                            {
+                                propertyInfo.SetValue(this, Encoding.Default.GetString(Content, index + 2, Content[index + 1] > 0 ? Content[index + 1] : dataLength - 2).Trim().Replace("\0", "").Replace("\\u000", "").Trim());
+                            }
+                            catch
+                            {
+                                propertyInfo.SetValue(this, Encoding.Default.GetString(Content, index, dataLength).Trim().Replace("\0", "").Replace("\\u000", "").Trim());
+                            }
                             index += dataLength;
                             break;
                         }
diff --git a/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/HostedService/ApiRouteCacheWarmupHostedService.cs b/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/HostedService/ApiRouteCacheWarmupHostedService.cs
index 7c82c8c..ad18780 100644
--- a/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/HostedService/ApiRouteCacheWarmupHostedService.cs
+++ b/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/HostedService/ApiRouteCacheWarmupHostedService.cs
@@ -46,9 +46,9 @@
 
         public Task StartAsync(CancellationToken cancellationToken)
         {
-            const string cacheKey = $"{RedisPrefix.Code}";
+            //const string cacheKey = $"{RedisPrefix.Code}";
 
-            _cache.RemoveByPrefix($"{cacheKey}");
+            //_cache.RemoveByPrefix($"{cacheKey}");
 
 
 
diff --git a/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Properties/PublishProfiles/FolderProfile.pubxml b/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Properties/PublishProfiles/FolderProfile.pubxml
index 36847ea..72b0ccc 100644
--- a/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Properties/PublishProfiles/FolderProfile.pubxml
+++ b/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Properties/PublishProfiles/FolderProfile.pubxml
@@ -4,14 +4,18 @@
 -->
 <Project>
   <PropertyGroup>
-    <DeleteExistingFiles>false</DeleteExistingFiles>
+    <DeleteExistingFiles>true</DeleteExistingFiles>
     <ExcludeApp_Data>false</ExcludeApp_Data>
     <LaunchSiteAfterPublish>true</LaunchSiteAfterPublish>
-    <LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration>
+    <LastUsedBuildConfiguration>Debug</LastUsedBuildConfiguration>
     <LastUsedPlatform>Any CPU</LastUsedPlatform>
     <PublishProvider>FileSystem</PublishProvider>
-    <PublishUrl>bin\Release\net6.0\publish\</PublishUrl>
+    <PublishUrl>bin\Debug\net6.0\publish\</PublishUrl>
     <WebPublishMethod>FileSystem</WebPublishMethod>
     <_TargetId>Folder</_TargetId>
+    <SiteUrlToLaunchAfterPublish />
+    <TargetFramework>net8.0</TargetFramework>
+    <ProjectGuid>487fa45b-ea1a-4aca-bb5b-0f6708f462c0</ProjectGuid>
+    <SelfContained>false</SelfContained>
   </PropertyGroup>
 </Project>
\ No newline at end of file
diff --git a/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/dotnet-tools.json b/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/dotnet-tools.json
new file mode 100644
index 0000000..b0e38ab
--- /dev/null
+++ b/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/dotnet-tools.json
@@ -0,0 +1,5 @@
+{
+  "version": 1,
+  "isRoot": true,
+  "tools": {}
+}
\ No newline at end of file
diff --git a/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/RobotTaskService.cs b/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/RobotTaskService.cs
index 894b992..494541e 100644
--- a/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/RobotTaskService.cs
+++ b/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/RobotTaskService.cs
@@ -28,6 +28,7 @@
 using WIDESEAWCS_Core;
 using WIDESEAWCS_Core.BaseServices;
 using WIDESEAWCS_Core.Helper;
+using WIDESEAWCS_Core.Utilities;
 using WIDESEAWCS_DTO.Stock;
 using WIDESEAWCS_DTO.TaskInfo;
 using WIDESEAWCS_ITaskInfoRepository;
@@ -234,6 +235,49 @@
             return stock;
         }
 
+        public override WebResponseContent AddData(SaveModel saveModel)
+        {
+            try
+            {
+                if (saveModel == null || saveModel.MainData == null || saveModel.MainData.Count == 0)
+                {
+                    return WebResponseContent.Instance.Error("浼犲弬閿欒,鍙傛暟涓嶈兘涓虹┖");
+                }
+
+                string validResult = typeof(Dt_RobotTask).ValidateDicInEntity(saveModel.MainData, true, TProperties);
+                if (!string.IsNullOrEmpty(validResult))
+                {
+                    return WebResponseContent.Instance.Error(validResult);
+                }
+
+                object? taskNumObj = saveModel.MainData[nameof(Dt_RobotTask.RobotTaskNum)];
+                if (taskNumObj != null)
+                {
+                    int taskNum = Convert.ToInt32(taskNumObj);
+                    if (BaseDal.QueryFirst(x => x.RobotTaskNum == taskNum) != null)
+                    {
+                        return WebResponseContent.Instance.Error($"浠诲姟缂栧彿 {taskNum} 宸插瓨鍦�");
+                    }
+                }
+
+                Dt_RobotTask entity = saveModel.MainData.DicToModel<Dt_RobotTask>();
+                entity.Creater = "鎵嬪姩鍒涘缓";
+                entity.CreateDate = DateTime.Now;
+
+                if (saveModel.DetailData == null || saveModel.DetailData.Count == 0)
+                {
+                    BaseDal.AddData(entity);
+                    return WebResponseContent.Instance.OK("鏂板鎴愬姛", entity);
+                }
+
+                return base.AddData(saveModel);
+            }
+            catch (Exception ex)
+            {
+                return WebResponseContent.Instance.Error($"鏂板澶辫触,閿欒淇℃伅:{ex.Message}");
+            }
+        }
+
         /// <summary>
         /// 鏍规嵁鐩爣鍦板潃鎸夈�岀簿纭� > 鍥為��鍊笺�嶈В鏋愯鍒欏�笺��
         /// </summary>
diff --git a/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineNewJob/CommonConveyorLineNewJob.cs b/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineNewJob/CommonConveyorLineNewJob.cs
index 6834a0e..e9cb3cc 100644
--- a/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineNewJob/CommonConveyorLineNewJob.cs
+++ b/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineNewJob/CommonConveyorLineNewJob.cs
@@ -1,4 +1,5 @@
 using MapsterMapper;
+using Masuit.Tools;
 using Microsoft.Extensions.Configuration;
 using Microsoft.Extensions.Logging;
 using Newtonsoft.Json;
@@ -40,6 +41,12 @@
         /// 浠诲姟鏈嶅姟
         /// </summary>
         private readonly ITaskService _taskService;
+
+
+        /// <summary>
+        /// 鏈哄櫒浜轰换鍔℃湇鍔�
+        /// </summary>
+        private readonly IRobotTaskService _robotTaskService;
 
         /// <summary>
         /// 浠诲姟鎵ц鏄庣粏鏈嶅姟
@@ -93,7 +100,7 @@
         /// <param name="mapper">瀵硅薄鏄犲皠鍣�</param>
         /// <param name="httpClientHelper">HTTP 瀹㈡埛绔府鍔╃被</param>
         /// <param name="logger">鏃ュ織璁板綍鍣�</param>
-        public CommonConveyorLineNewJob(ITaskService taskService, ITaskExecuteDetailService taskExecuteDetailService, IRouterService routerService, IMapper mapper, HttpClientHelper httpClientHelper, ILogger<CommonConveyorLineNewJob> logger)
+        public CommonConveyorLineNewJob(ITaskService taskService, ITaskExecuteDetailService taskExecuteDetailService, IRouterService routerService, IMapper mapper, HttpClientHelper httpClientHelper, ILogger<CommonConveyorLineNewJob> logger, IRobotTaskService robotTaskService)
         {
             _taskService = taskService;
             _taskExecuteDetailService = taskExecuteDetailService;
@@ -101,6 +108,7 @@
             _mapper = mapper;
             _httpClientHelper = httpClientHelper;
             _logger = logger;
+            _robotTaskService = robotTaskService;
 
             // 鍒濆鍖栬皟搴﹀鐞嗗櫒
             _conveyorLineDispatch = new ConveyorLineDispatchHandler(_taskService, _taskExecuteDetailService, _routerService, _mapper, _logger);
@@ -247,6 +255,36 @@
                                     ProcessTaskState(conveyorLine, command, task, childDeviceCode);
                                     return Task.CompletedTask;
                                 }
+                                else if (command.TaskNo == 1 && !command.Barcode.IsNullOrEmpty() && childDeviceCode == "11068")
+                                {
+                                    if (_robotTaskService.Db.Queryable<Dt_RobotTask>().Any(x => x.RobotTargetAddressPalletCode == command.Barcode))
+                                    {
+                                        return Task.CompletedTask;
+                                    }
+
+                                    Random rnd = new Random();
+                                    int num = rnd.StrictNext();//浜х敓鐪熼殢鏈烘暟
+                                                               // 娌℃湁浠诲姟鍙蜂絾鏈夋潯鐮佸苟涓斿湪11068浣嶇疆锛岀洿鎺ユ坊鍔犳満姊版墜缁勭洏浠诲姟
+                                    Dt_RobotTask robotTask = new Dt_RobotTask
+                                    {
+                                        RobotTargetAddressPalletCode = command.Barcode,
+                                        RobotSourceAddress = "1",
+                                        RobotTargetAddress = "2", // 鏈烘鎵嬬洰鏍囧湴鍧�
+                                        RobotTaskType = (int)RobotTaskTypeEnum.GroupPallet, // 缁勭洏浠诲姟
+                                        RobotTaskState = (int)TaskRobotStatusEnum.RobotNew, // 寰呮墽琛�
+                                        RobotTaskTotalNum = 48,
+                                        RobotGrade = 1,
+                                        RobotRoadway = "娉ㄦ恫缁勭洏鏈烘鎵�",
+                                        RobotTargetAddressLineCode = childDeviceCode,
+                                        RobotTaskNum = num, // 鐢熸垚浠诲姟鍙�
+                                        RobotDispatchertime = DateTime.Now,
+
+                                    };
+                                    if (_robotTaskService.AddData(robotTask).Status)
+                                    {
+                                        conveyorLine.SetValue(ConveyorLineDBNameNew.WCS_ACK, (short)1, childDeviceCode);
+                                    }
+                                }
                             }
                         }
                         catch (Exception innerEx)
diff --git a/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/RobotJob/RobotMessageHandler.cs b/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/RobotJob/RobotMessageHandler.cs
index 081bfd4..f8155cc 100644
--- a/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/RobotJob/RobotMessageHandler.cs
+++ b/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/RobotJob/RobotMessageHandler.cs
@@ -135,6 +135,7 @@
             // 濡傛灉缂撳瓨涓笉瀛樺湪鎴栫姸鎬佷负 null锛屽拷鐣ユ娑堟伅
             if (!_cache.TryGetValue(cacheKey, out RobotSocketState? cachedState) || cachedState == null)
             {
+                _logger.LogInformation($"缂撳瓨涓笉瀛樺湪鎴栫姸鎬佷负 null锛屽拷鐣ユ娑堟伅");
                 return null;
             }
 
@@ -150,7 +151,6 @@
             {
                 // 澶勭悊鎴愬姛鍚庯紝灏嗗師娑堟伅鍥炲啓鍒板鎴风锛堜繚鎸佸師鏈夎涓猴級
                 await _socketClientGateway.SendMessageAsync(client, message);
-                _logger.LogInformation($"鍙戦�佹秷鎭�恵message}銆�");
                 QuartzLogger.Info($"鍙戦�佹秷鎭細銆恵message}銆�", state.RobotCrane.DeviceName);
 
                 // 瀹夊叏鏇存柊鐘舵�佸埌 Redis
diff --git a/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/RobotJob/RobotTaskProcessor.cs b/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/RobotJob/RobotTaskProcessor.cs
index b109398..e7edcb1 100644
--- a/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/RobotJob/RobotTaskProcessor.cs
+++ b/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/RobotJob/RobotTaskProcessor.cs
@@ -185,7 +185,7 @@
                 // 灏嗕换鍔″叧鑱斿埌鐘舵�佸璞�
                 state.CurrentTask = task;
 
-                if(isScanNG)
+                if (isScanNG)
                 {
                     state.IsScanNG = true;
                 }
@@ -456,7 +456,7 @@
         /// <param name="state">鏈哄櫒浜哄綋鍓嶇姸鎬�</param>
         /// <param name="useSourceAddress">鏄惁浣跨敤婧愬湴鍧�锛坱rue 琛ㄧず鎷嗙洏/鎹㈢洏鍦烘櫙锛宖alse 琛ㄧず缁勭洏/鎹㈢洏鍦烘櫙锛�</param>
         /// <returns>澶勭悊鏄惁鎴愬姛</returns>
-        public async Task<bool> HandleInboundTaskAsync(RobotSocketState state, bool useSourceAddress)
+        public async Task<bool> HandleInboundTaskAsync(RobotSocketState state, bool useSourceAddress, string isRoadway = null)
         {
             // 鑾峰彇褰撳墠鍏宠仈鐨勪换鍔�
             var currentTask = state.CurrentTask;
@@ -468,18 +468,17 @@
             }
 
             // 鑾峰彇宸烽亾浠g爜
-            string roadway = currentTask.RobotSourceAddressLineCode;
+            string roadway = string.Empty;
 
             // 鏍规嵁宸烽亾鍚嶇О鍒ゆ柇浠撳簱 ID
-            // ZYRB1 -> 1, HPRB001 -> 2, 鍏朵粬 -> 3
-            int warehouseId = currentTask.RobotRoadway == "娉ㄦ恫缁勭洏鏈烘鎵�" ? 1 : currentTask.RobotRoadway == "HPRB001" ? 2 : 3;
-
-            // 浠诲姟绫诲瀷锛�0 琛ㄧず鏈畾涔夛紝绋嶅悗鏍规嵁浠诲姟绫诲瀷璁剧疆锛�
-            int taskType = 0;
+            int warehouseId = 0;
 
             // 婧愬湴鍧�鍜岀洰鏍囧湴鍧�锛堝垵濮嬪寲锛�
             string SourceAddress = currentTask.RobotTargetAddressLineCode;
             string TargetAddress = currentTask.RobotSourceAddressLineCode;
+
+            // 浠诲姟绫诲瀷锛�0 琛ㄧず鏈畾涔夛紝绋嶅悗鏍规嵁浠诲姟绫诲瀷璁剧疆锛�
+            int taskType = 0;
 
             // 鎵樼洏浠g爜锛堝垵濮嬪寲涓虹┖锛�
             string PalletCode = string.Empty;
@@ -494,16 +493,33 @@
                 switch (robotTaskType)
                 {
                     case RobotTaskTypeEnum.GroupPallet:
-                        // 缁勭洏浠诲姟涓嶄娇鐢ㄦ簮鍦板潃锛岀洿鎺ヨ繑鍥� false
-                        _logger.LogDebug("HandleInboundTaskAsync锛氱粍鐩樹换鍔′笉浣跨敤婧愬湴鍧�");
-                        QuartzLogger.Debug($"HandleInboundTaskAsync锛氱粍鐩樹换鍔′笉浣跨敤婧愬湴鍧�", state.RobotCrane?.DeviceName ?? "Unknown");
-                        return false;
+                        warehouseId = 1;
+                        roadway = "GWSC1";
+                        break;
 
                     case RobotTaskTypeEnum.ChangePallet:
+                        // 鎹㈢洏/鎷嗙洏鍦烘櫙锛氭墭鐩橀渶瑕佸叆搴�
+                        taskType = TaskTypeEnum.InEmpty.GetHashCode();  // 绌烘墭鐩樺叆搴�
+                        PalletCode = currentTask.RobotSourceAddressPalletCode;  // 浣跨敤婧愬湴鍧�鐨勬墭鐩樼爜
+                        if (isRoadway == "HWSC1")
+                        {
+                            warehouseId = 2;
+                            roadway = "HWSC1";
+                        }
+                        else if (isRoadway == "GWSC1")
+                        {
+                            warehouseId = 1;
+                            roadway = "GWSC1";
+                        }
+
+                        break;
                     case RobotTaskTypeEnum.SplitPallet:
                         // 鎹㈢洏/鎷嗙洏鍦烘櫙锛氭墭鐩橀渶瑕佸叆搴�
                         taskType = TaskTypeEnum.InEmpty.GetHashCode();  // 绌烘墭鐩樺叆搴�
                         PalletCode = currentTask.RobotSourceAddressPalletCode;  // 浣跨敤婧愬湴鍧�鐨勬墭鐩樼爜
+
+                        warehouseId = 3;
+                        roadway = "CWSC1";
                         break;
                 }
             }
@@ -513,17 +529,34 @@
                 switch (robotTaskType)
                 {
                     case RobotTaskTypeEnum.ChangePallet:
+                        // 鎹㈢洏/缁勭洏鍦烘櫙锛氳揣鐗╅渶瑕佸叆搴�
+                        taskType = TaskTypeEnum.Inbound.GetHashCode();  // 鎴愬搧鍏ュ簱
+                        PalletCode = currentTask.RobotTargetAddressPalletCode;  // 浣跨敤鐩爣鍦板潃鐨勬墭鐩樼爜
+
+                        if (isRoadway == "HWSC1")
+                        {
+                            warehouseId = 2;
+                            roadway = "HWSC1";
+                        }
+                        else if (isRoadway == "GWSC1")
+                        {
+                            warehouseId = 1;
+                            roadway = "GWSC1";
+                        }
+
+                        break;
                     case RobotTaskTypeEnum.GroupPallet:
                         // 鎹㈢洏/缁勭洏鍦烘櫙锛氳揣鐗╅渶瑕佸叆搴�
                         taskType = TaskTypeEnum.Inbound.GetHashCode();  // 鎴愬搧鍏ュ簱
                         PalletCode = currentTask.RobotTargetAddressPalletCode;  // 浣跨敤鐩爣鍦板潃鐨勬墭鐩樼爜
+
+                        warehouseId = 1;
+                        roadway = "GWSC1";
                         break;
 
                     case RobotTaskTypeEnum.SplitPallet:
-                        // 鎷嗙洏浠诲姟涓嶄娇鐢ㄧ洰鏍囧湴鍧�
-                        _logger.LogDebug("HandleInboundTaskAsync锛氭媶鐩樹换鍔′笉浣跨敤鐩爣鍦板潃");
-                        QuartzLogger.Debug($"HandleInboundTaskAsync锛氭媶鐩樹换鍔′笉浣跨敤鐩爣鍦板潃", state.RobotCrane?.DeviceName ?? "Unknown");
-                        return true;
+
+                        break;
                 }
             }
 
@@ -532,8 +565,8 @@
             {
                 PalletCode = PalletCode,                    // 鎵樼洏鏉$爜
                 SourceAddress = SourceAddress ?? string.Empty,  // 婧愬湴鍧�
-                TargetAddress = TargetAddress ?? string.Empty,  // 鐩爣鍦板潃
-                Roadway = roadway,                          // 宸烽亾
+                TargetAddress = roadway ?? string.Empty,  // 鐩爣鍦板潃
+                Roadway = roadway ?? string.Empty,             // 宸烽亾
                 WarehouseId = warehouseId,                   // 浠撳簱 ID
                 PalletType = 1,                             // 鎵樼洏绫诲瀷锛堥粯璁や负1锛�
                 TaskType = taskType                         // 浠诲姟绫诲瀷锛堝叆搴�/绌烘墭鐩樺叆搴擄級
diff --git a/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/RobotJob/Workflow/RobotPrefixCommandHandler.cs b/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/RobotJob/Workflow/RobotPrefixCommandHandler.cs
index fe8979f..10c82be 100644
--- a/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/RobotJob/Workflow/RobotPrefixCommandHandler.cs
+++ b/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/RobotJob/Workflow/RobotPrefixCommandHandler.cs
@@ -1,6 +1,7 @@
 using System.Net.Sockets;
 using WIDESEAWCS_Common.HttpEnum;
 using WIDESEAWCS_Common.TaskEnum;
+using WIDESEAWCS_Core.Helper;
 using WIDESEAWCS_ITaskInfoService;
 using WIDESEAWCS_Model.Models;
 using WIDESEAWCS_Tasks.Workflow.Abstractions;
diff --git a/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/RobotJob/Workflow/RobotSimpleCommandHandler.cs b/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/RobotJob/Workflow/RobotSimpleCommandHandler.cs
index 34f3e9f..6f7515c 100644
--- a/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/RobotJob/Workflow/RobotSimpleCommandHandler.cs
+++ b/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/RobotJob/Workflow/RobotSimpleCommandHandler.cs
@@ -158,7 +158,7 @@
                             if (state.ChangePalletPhase == 5)
                             {
                                 // FlowB 鏈�缁堥樁娈碉細鍋囩數鑺彇瀹岋紝婧愮┖鎵樼洏鍥炲簱 HCSC1
-                                if (!await _taskProcessor.HandleInboundTaskAsync(state, useSourceAddress: true))
+                                if (!await _taskProcessor.HandleInboundTaskAsync(state, useSourceAddress: true, isRoadway: "HCSC1"))
                                 {
                                     return false;
                                 }
@@ -184,15 +184,16 @@
                             {
                                 // FlowA 涓棿闃舵锛氭甯哥數鑺彇瀹岋紝婧愮┖鎵樼洏鍥炲簱 GWSC1
                                 // 涓嶅垹闄や换鍔★紝涓嶉噸缃姸鎬侊紝缁х画 Phase 3-4 鍋囩數鑺祦绋�
-                                if (!await _taskProcessor.HandleInboundTaskAsync(state, useSourceAddress: true))
+                                if (!await _taskProcessor.HandleInboundTaskAsync(state, useSourceAddress: true, isRoadway: "GWSC1"))
                                 {
                                     return false;
                                 }
                                 return true;
                             }
 
+                            List<string> str = new List<string>() { "11001", "11010" };
                             // Phase == 0: 闈炴壒娆℃ā寮忥紙鐩爣鎬绘暟==48锛�
-                            if (!await _taskProcessor.HandleInboundTaskAsync(state, useSourceAddress: true))
+                            if (!await _taskProcessor.HandleInboundTaskAsync(state, useSourceAddress: true, isRoadway: str.Contains(currentTask.RobotSourceAddressLineCode) ? "GWSC1" : "HCSC1"))
                             {
                                 return false;
                             }
@@ -274,7 +275,7 @@
                             if (state.ChangePalletPhase == 5)
                             {
                                 // FlowA 鏈�缁堥樁娈碉細鍋囩數鑺斁瀹岋紝鐩爣鎵樼洏婊�48鍏ュ簱 HCSC1
-                                if (!await _taskProcessor.HandleInboundTaskAsync(state, useSourceAddress: false))
+                                if (!await _taskProcessor.HandleInboundTaskAsync(state, useSourceAddress: false, isRoadway: "HCSC1"))
                                 {
                                     return false;
                                 }
@@ -301,15 +302,16 @@
                             {
                                 // FlowB 涓棿闃舵锛氭甯哥數鑺斁瀹岋紝鏈夎揣鎵樼洏缁勭洏鍏ュ簱 GWSC1
                                 // 涓嶅垹闄や换鍔★紝涓嶉噸缃姸鎬侊紝缁х画 Phase 3-4 鍋囩數鑺祦绋�
-                                if (!await _taskProcessor.HandleInboundTaskAsync(state, useSourceAddress: false))
+                                if (!await _taskProcessor.HandleInboundTaskAsync(state, useSourceAddress: false, isRoadway: "GWSC1"))
                                 {
                                     return false;
                                 }
                                 return true;
                             }
 
+                            List<string> str = new List<string>() { "11001", "11010" };
                             // Phase == 0: 闈炴壒娆℃ā寮忥紙鐩爣鎬绘暟==48锛�
-                            if (!await _taskProcessor.HandleInboundTaskAsync(state, useSourceAddress: false))
+                            if (!await _taskProcessor.HandleInboundTaskAsync(state, useSourceAddress: false, str.Contains(currentTask.RobotTargetAddressLineCode) ? "GWSC1" : "HCSC1"))
                             {
                                 return false;
                             }
diff --git a/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/RobotJob/Workflow/RobotWorkflowOrchestrator.cs b/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/RobotJob/Workflow/RobotWorkflowOrchestrator.cs
index 978f7ee..0ac900b 100644
--- a/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/RobotJob/Workflow/RobotWorkflowOrchestrator.cs
+++ b/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/RobotJob/Workflow/RobotWorkflowOrchestrator.cs
@@ -352,7 +352,7 @@
                         // 鏉$爜閲嶅锛岃褰曢敊璇棩蹇楀苟鍋滄鍚庣画鎿嶄綔(鍚庣画鏀捐揣鏃朵細鐢ㄥ埌杩欎簺鏉$爜淇℃伅锛屼緵鍚庣画鏀捐揣鏃朵娇鐢紝璋冭瘯鍚庡彲鑳戒細鍙栨秷姝ら�昏緫)
 
                         // 鍙戦�佸彇璐ф寚浠� 鏍囪鎵爜NG锛屾斁璐ф椂涓嶄娇鐢ㄨ繖浜涙潯鐮侊紝骞舵斁鍏G鍙�
-                        await _taskProcessor.SendSocketRobotPickAsync(task, stateForUpdate, true);
+                        //await _taskProcessor.SendSocketRobotPickAsync(task, stateForUpdate, true);
                         return;
                     }
                     else
@@ -367,7 +367,6 @@
                         };
                     }
 
-
                     // 璁板綍鏃ュ織锛氳鍙栨墭鐩樻潯鐮佹垚鍔�
                     _logger.LogInformation("HandlePutFinishedStateAsync锛氳鍙栨墭鐩樻潯鐮佹垚鍔�: {Barcode1}+{Barcode2}锛屼换鍔″彿: {TaskNum}", trayBarcode1, trayBarcode2, task.RobotTaskNum);
                     QuartzLogger.Info($"璇诲彇鎵樼洏鏉$爜鎴愬姛: {trayBarcode1}+{trayBarcode2}", stateForUpdate.RobotCrane.DeviceName);
@@ -378,12 +377,12 @@
                 else
                 {
                     // 鏉$爜璇诲彇澶辫触锛岃褰曢敊璇棩蹇�
-                    _logger.LogError("HandlePutFinishedStateAsync锛氳鍙栨墭鐩樻潯鐮佸け璐ワ紝浠诲姟鍙�: {TaskNum}", task.RobotTaskNum);
-                    QuartzLogger.Error($"璇诲彇鎵樼洏鏉$爜澶辫触", stateForUpdate.RobotCrane.DeviceName);
+                    _logger.LogError("HandlePutFinishedStateAsync锛氳鍙栨墭鐩樻潯鐮佸け璐ワ紝浠诲姟鍙�: {TaskNum}锛屼竴鍙蜂綅: {trayBarcode1}锛屼簩鍙蜂綅: {trayBarcode2}", task.RobotTaskNum,trayBarcode1,trayBarcode2);
+                    QuartzLogger.Error($"璇诲彇鎵樼洏鏉$爜澶辫触,涓�鍙蜂綅锛歿trayBarcode1},浜屽彿浣嶏細{trayBarcode2}", stateForUpdate.RobotCrane.DeviceName);
 
 
                     // 鍙戦�佸彇璐ф寚浠� 鏍囪鎵爜NG锛屾斁璐ф椂涓嶄娇鐢ㄨ繖浜涙潯鐮侊紝骞舵斁鍏G鍙�
-                    await _taskProcessor.SendSocketRobotPickAsync(task, stateForUpdate, true);
+                    //await _taskProcessor.SendSocketRobotPickAsync(task, stateForUpdate, true);
                     return;
                 }
             }
diff --git a/Code/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Properties/PublishProfiles/FolderProfile.pubxml b/Code/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Properties/PublishProfiles/FolderProfile.pubxml
index 86bb19c..2ee4c24 100644
--- a/Code/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Properties/PublishProfiles/FolderProfile.pubxml
+++ b/Code/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Properties/PublishProfiles/FolderProfile.pubxml
@@ -14,7 +14,7 @@
     <WebPublishMethod>FileSystem</WebPublishMethod>
     <_TargetId>Folder</_TargetId>
     <SiteUrlToLaunchAfterPublish />
-    <TargetFramework>net6.0</TargetFramework>
+    <TargetFramework>net8.0</TargetFramework>
     <ProjectGuid>d81a65b5-47d1-40c1-8fde-7d24ff003f51</ProjectGuid>
     <SelfContained>false</SelfContained>
   </PropertyGroup>
diff --git "a/\351\241\271\347\233\256\350\265\204\346\226\231/\350\256\276\345\244\207\345\215\217\350\256\256/\344\270\212\344\275\215\347\263\273\347\273\237\345\257\271\346\216\245/\351\231\225\350\245\277\351\241\267\345\210\273\350\203\275\346\272\220\347\247\221\346\212\200MES\347\263\273\347\273\237\345\257\271\346\216\245\346\216\245\345\217\243.pdf" "b/\351\241\271\347\233\256\350\265\204\346\226\231/\350\256\276\345\244\207\345\215\217\350\256\256/\344\270\212\344\275\215\347\263\273\347\273\237\345\257\271\346\216\245/\351\231\225\350\245\277\351\241\267\345\210\273\350\203\275\346\272\220\347\247\221\346\212\200MES\347\263\273\347\273\237\345\257\271\346\216\245\346\216\245\345\217\243.pdf"
new file mode 100644
index 0000000..4b95d90
--- /dev/null
+++ "b/\351\241\271\347\233\256\350\265\204\346\226\231/\350\256\276\345\244\207\345\215\217\350\256\256/\344\270\212\344\275\215\347\263\273\347\273\237\345\257\271\346\216\245/\351\231\225\350\245\277\351\241\267\345\210\273\350\203\275\346\272\220\347\247\221\346\212\200MES\347\263\273\347\273\237\345\257\271\346\216\245\346\216\245\345\217\243.pdf"
Binary files differ

--
Gitblit v1.9.3