From 72c0f86c75c8a9a5eb7435d72b6ebece4c5382e8 Mon Sep 17 00:00:00 2001
From: wanshenmean <cathay_xy@163.com>
Date: 星期二, 14 四月 2026 18:21:27 +0800
Subject: [PATCH] feat: 添加vue3-json-viewer并优化日志显示

---
 Code/WMS/WIDESEA_WMSClient/src/extension/system/Sys_Log.jsx                                |   76 +++++------
 Code/WMS/WIDESEA_WMSServer/WIDESEA_Common/LocationEnum/LocationTypeEnum.cs                 |   12 ++
 Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Core/Middlewares/ApiLogMiddleware.cs                 |   12 +-
 Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob/StackerCraneTaskSelector.cs    |    6 
 项目资料/设备协议/高常温堆垛机与输送线/堆垛机与上位机交互信息.xlsx                                                      |    0 
 Code/WMS/WIDESEA_WMSServer/WIDESEA_StockService/StockSerivce.cs                            |    8 +
 Code/WCS/WIDESEAWCS_Client/.omc/state/idle-notif-cooldown.json                             |    2 
 Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/RobotJob/Workflow/RobotWorkflowOrchestrator.cs |    2 
 Code/WMS/WIDESEA_WMSClient/src/extension/system/Mes_Log.jsx                                |   78 ++++++-------
 Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_QuartzJob/StackerCrane/Common/CommonStackerCrane.cs  |    2 
 Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob/StackerCraneTaskCommand.cs     |   22 +-
 Code/WMS/WIDESEA_WMSServer/WIDESEA_Core/Middlewares/ApiLogMiddleware.cs                    |   21 ++-
 Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Common/Constants/StackerCraneConst.cs                |    8 +
 Code/WCS/WIDESEAWCS_Client/src/views/system/Sys_Log.vue                                    |   14 ++
 Code/.omc/state/idle-notif-cooldown.json                                                   |    2 
 Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob/CommonStackerCraneJob.cs       |    6 
 Code/WCS/WIDESEAWCS_Client/vite.config.mjs                                                 |    3 
 Code/WMS/WIDESEA_WMSClient/vite.config.mjs                                                 |    3 
 Code/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService_GradingMachine.cs           |    4 
 Code/WCS/WIDESEAWCS_Client/package.json                                                    |    1 
 Code/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/WCS/TaskService_Tray.cs                 |    3 
 Code/WCS/WIDESEAWCS_Client/src/extension/system/Sys_Log.jsx                                |   69 +++++++++++
 22 files changed, 231 insertions(+), 123 deletions(-)

diff --git a/Code/.omc/state/idle-notif-cooldown.json b/Code/.omc/state/idle-notif-cooldown.json
index 0c94115..d913e16 100644
--- a/Code/.omc/state/idle-notif-cooldown.json
+++ b/Code/.omc/state/idle-notif-cooldown.json
@@ -1,3 +1,3 @@
 {
-  "lastSentAt": "2026-04-13T06:33:17.906Z"
+  "lastSentAt": "2026-04-14T08:08:15.956Z"
 }
\ No newline at end of file
diff --git a/Code/WCS/WIDESEAWCS_Client/.omc/state/idle-notif-cooldown.json b/Code/WCS/WIDESEAWCS_Client/.omc/state/idle-notif-cooldown.json
index e28f074..5552a31 100644
--- a/Code/WCS/WIDESEAWCS_Client/.omc/state/idle-notif-cooldown.json
+++ b/Code/WCS/WIDESEAWCS_Client/.omc/state/idle-notif-cooldown.json
@@ -1,3 +1,3 @@
 {
-  "lastSentAt": "2026-04-12T15:31:49.457Z"
+  "lastSentAt": "2026-04-14T08:55:27.403Z"
 }
\ No newline at end of file
diff --git a/Code/WCS/WIDESEAWCS_Client/package.json b/Code/WCS/WIDESEAWCS_Client/package.json
index a68d9a8..d346149 100644
--- a/Code/WCS/WIDESEAWCS_Client/package.json
+++ b/Code/WCS/WIDESEAWCS_Client/package.json
@@ -21,6 +21,7 @@
     "vue-draggable-next": "^2.0.1",
     "vue-router": "^4.0.0-0",
     "vuex": "^4.0.0-0",
+    "vue3-json-viewer": "^2.4.1",
     "wangeditor": "^4.7.6"
   },
   "devDependencies": {
diff --git a/Code/WCS/WIDESEAWCS_Client/src/extension/system/Sys_Log.jsx b/Code/WCS/WIDESEAWCS_Client/src/extension/system/Sys_Log.jsx
index 5b05c40..06e24fa 100644
--- a/Code/WCS/WIDESEAWCS_Client/src/extension/system/Sys_Log.jsx
+++ b/Code/WCS/WIDESEAWCS_Client/src/extension/system/Sys_Log.jsx
@@ -1,4 +1,8 @@
-import { h, resolveComponent } from 'vue';
+import { createApp } from 'vue';
+import { ElDrawer } from 'element-plus';
+import { JsonViewer } from 'vue3-json-viewer';
+import 'vue3-json-viewer/dist/vue3-json-viewer.css';
+
 let extension = {
   components: {
     //鍔ㄦ�佹墿鍏呯粍浠舵垨缁勪欢璺緞
@@ -20,6 +24,69 @@
     },
     onInited() {
       this.height = this.height - 170;
+    },
+
+    // 琛岀偣鍑讳簨浠� - 鏄剧ず鍙傛暟璇︽儏鎶藉眽
+    rowClick({ row, column }) {
+      if (column.property === 'requestParam' && row.requestParam) {
+        this.showJsonDetail(row, 'request');
+      } else if (column.property === 'responseParam' && row.responseParam) {
+        this.showJsonDetail(row, 'response');
+      }
+    },
+
+    // 鏄剧ず JSON 璇︽儏鎶藉眽
+    showJsonDetail(row, type = 'request') {
+      const content = type === 'request' ? row.requestParam : row.responseParam;
+      const title = type === 'request' ? '馃搵 璇锋眰鍙傛暟' : '馃摜 鍝嶅簲鍙傛暟';
+
+      // 瑙f瀽 JSON 瀵硅薄锛岃В鏋愬け璐ュ垯淇濈暀鍘熷瀛楃涓�
+      let jsonData;
+      try {
+        jsonData = typeof content === 'string' ? JSON.parse(content) : content;
+      } catch (e) {
+        jsonData = String(content);
+      }
+
+      // 鍒涘缓涓存椂瀹瑰櫒娓叉煋鎶藉眽
+      const container = document.createElement('div');
+      document.body.appendChild(container);
+
+      const app = createApp({
+        render() {
+          const onClose = (val) => {
+            if (!val) {
+              app.unmount();
+              document.body.removeChild(container);
+            }
+          };
+          return (
+            <div>
+              <ElDrawer
+                modelValue={true}
+                onUpdate:modelValue={onClose}
+                title={title}
+                size="40%"
+                destroyOnClose={true}
+                closeOnClickModal={true}
+              >
+                <JsonViewer
+                  value={jsonData}
+                  expanded={true}
+                  expandDepth={5}
+                  copyable={true}
+                  sort={false}
+                  theme="light"
+                />
+              </ElDrawer>
+            </div>
+          );
+        }
+      });
+
+      app.use(window.ElementPlus);
+      app.component('JsonViewer', JsonViewer);
+      app.mount(container);
     }
   }
 };
diff --git a/Code/WCS/WIDESEAWCS_Client/src/views/system/Sys_Log.vue b/Code/WCS/WIDESEAWCS_Client/src/views/system/Sys_Log.vue
index 03f4341..fde37f0 100644
--- a/Code/WCS/WIDESEAWCS_Client/src/views/system/Sys_Log.vue
+++ b/Code/WCS/WIDESEAWCS_Client/src/views/system/Sys_Log.vue
@@ -138,6 +138,13 @@
         type: "string",
         width: 120,
         align: "left",
+        formatter: (row) => {
+          if (!row.requestParam) return '-';
+          const preview = row.requestParam.length > 50
+            ? row.requestParam.substring(0, 50) + '...'
+            : row.requestParam;
+          return `<span style="color: #409EFF; cursor: pointer;">${preview}</span>`;
+        }
       },
       {
         field: "responseParam",
@@ -145,6 +152,13 @@
         type: "string",
         width: 120,
         align: "left",
+        formatter: (row) => {
+          if (!row.responseParam) return '-';
+          const preview = row.responseParam.length > 50
+            ? row.responseParam.substring(0, 50) + '...'
+            : row.responseParam;
+          return `<span style="color: #409EFF; cursor: pointer;">${preview}</span>`;
+        }
       },
       {
         field: "exceptionInfo",
diff --git a/Code/WCS/WIDESEAWCS_Client/vite.config.mjs b/Code/WCS/WIDESEAWCS_Client/vite.config.mjs
index 11364ec..f075d93 100644
--- a/Code/WCS/WIDESEAWCS_Client/vite.config.mjs
+++ b/Code/WCS/WIDESEAWCS_Client/vite.config.mjs
@@ -16,6 +16,9 @@
       overlay: false
     }
   },
+  optimizeDeps: {
+    include: ['vue3-json-viewer']
+  },
   build: {
     sourcemap: false,
     chunkSizeWarningLimit: 1200,
diff --git a/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Common/Constants/StackerCraneConst.cs b/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Common/Constants/StackerCraneConst.cs
index a9d0e40..468f2ae 100644
--- a/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Common/Constants/StackerCraneConst.cs
+++ b/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Common/Constants/StackerCraneConst.cs
@@ -37,5 +37,13 @@
         /// 鏍囪瘑浠诲姟涓哄叆搴撲綔涓氱被鍨嬨��
         /// </remarks>
         public const short WorkTypeInbound = 1;
+
+        /// <summary>
+        /// 浣滀笟绫诲瀷 - 鍑哄簱
+        /// </summary>
+        /// <remarks>
+        /// 鏍囪瘑浠诲姟涓哄嚭搴撲綔涓氱被鍨嬨��
+        /// </remarks>
+        public const short WorkTypeOutbound = 2;
     }
 }
diff --git a/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Core/Middlewares/ApiLogMiddleware.cs b/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Core/Middlewares/ApiLogMiddleware.cs
index 35fa518..97f862a 100644
--- a/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Core/Middlewares/ApiLogMiddleware.cs
+++ b/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Core/Middlewares/ApiLogMiddleware.cs
@@ -74,7 +74,7 @@
                     try
                     {
                         // 瀛樺偍璇锋眰鏁版嵁
-                        requestParam = RequestDataLog(context);
+                        requestParam = await RequestDataLog(context);
                         context.Request.Body.Position = 0;
                     }
                     catch { }
@@ -86,7 +86,7 @@
                     try
                     {
                         // 瀛樺偍鍝嶅簲鏁版嵁
-                        responseParam = ResponseDataLog(context.Response);
+                        responseParam = await ResponseDataLog(context.Response);
                     }
                     catch { }
 
@@ -114,7 +114,7 @@
             }
         }
 
-        private string RequestDataLog(HttpContext context)
+        private async Task<string> RequestDataLog(HttpContext context)
         {
             var request = context.Request;
             var sr = new StreamReader(request.Body);
@@ -122,7 +122,7 @@
             object obj = new
             {
                 QueryString = request.QueryString.ToString(),
-                BodyData = sr.ReadToEndAsync().Result
+                BodyData = JsonConvert.DeserializeObject( await sr.ReadToEndAsync())
             };
 
             string data = JsonConvert.SerializeObject(obj);
@@ -132,11 +132,11 @@
             return data;
         }
 
-        private string ResponseDataLog(HttpResponse response)
+        private async Task<string> ResponseDataLog(HttpResponse response)
         {
             response.Body.Position = 0;
             using StreamReader stream = new StreamReader(response.Body, leaveOpen: true);
-            string body = stream.ReadToEnd();
+            string body = await stream.ReadToEndAsync();
             response.Body.Position = 0;
             return body;
         }
diff --git a/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_QuartzJob/StackerCrane/Common/CommonStackerCrane.cs b/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_QuartzJob/StackerCrane/Common/CommonStackerCrane.cs
index d940fb7..4e70c2f 100644
--- a/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_QuartzJob/StackerCrane/Common/CommonStackerCrane.cs
+++ b/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_QuartzJob/StackerCrane/Common/CommonStackerCrane.cs
@@ -359,7 +359,7 @@
             if (Communicator is SiemensS7)
             {
                 if (!IsConnected) throw new Exception($"閫氳杩炴帴閿欒锛岃妫�鏌ョ綉缁�");
-                DeviceProDTO? devicePro = _deviceProDTOs.Where(x => x.DeviceProParamType == nameof(DeviceCommand)).OrderBy(x => x.DeviceProOffset).FirstOrDefault();
+                DeviceProDTO? devicePro = _deviceProDTOs.Where(x => x.DeviceProParamType == nameof(DeviceCommand) && x.DeviceProParamName == "InputTaskNum")/*.OrderBy(x=>x.DeviceProOffset)*/.FirstOrDefault();
                 if (devicePro == null)
                 {
                     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 5556a62..f5c193d 100644
--- a/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/RobotJob/Workflow/RobotWorkflowOrchestrator.cs
+++ b/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/RobotJob/Workflow/RobotWorkflowOrchestrator.cs
@@ -119,7 +119,7 @@
                 // - 鎵嬭噦涓婃湁鐗╂枡锛圧obotArmObject == 1锛�
                 // - 浠诲姟鐘舵�佷负 RobotPickFinish锛堝凡璁板綍鍙栬揣瀹屾垚锛�
                 if ((latestState.CurrentAction == "PickFinished" || latestState.CurrentAction == "AllPickFinished")
-                    && latestState.RobotArmObject == 0
+                    && latestState.RobotArmObject == 1
                     && task.RobotTaskState == TaskRobotStatusEnum.RobotPickFinish.GetHashCode())
                 {
                     _logger.LogInformation("ExecuteAsync锛氭弧瓒虫斁璐ф潯浠讹紝寮�濮嬪鐞嗗彇璐у畬鎴愶紝浠诲姟鍙�: {TaskNum}", task.RobotTaskNum);
diff --git a/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob/CommonStackerCraneJob.cs b/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob/CommonStackerCraneJob.cs
index 69ec861..8060907 100644
--- a/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob/CommonStackerCraneJob.cs
+++ b/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob/CommonStackerCraneJob.cs
@@ -197,11 +197,11 @@
 
                 // ========== 妫�鏌ユ槸鍚﹀彲浠ュ彂閫佹柊浠诲姟 ==========
                 //if (!commonStackerCrane.IsCanSendTask(commonStackerCrane.Communicator, commonStackerCrane.DeviceProDTOs, commonStackerCrane.DeviceProtocolDetailDTOs))
-                if (commonStackerCrane.StackerCraneStatusValue != StackerCraneStatus.Normal)
+                if (commonStackerCrane.StackerCraneStatusValue != StackerCraneStatus.Normal /*&& commonStackerCrane.StackerCraneAutoStatusValue != StackerCraneAutoStatus.Automatic && commonStackerCrane.StackerCraneWorkStatusValue != StackerCraneWorkStatus.Standby*/)
                 {
                     // 鍫嗗灈鏈轰笉鍙敤锛堝姝e湪鎵ц涓婁竴浠诲姟锛夛紝鐩存帴杩斿洖
-                    _logger.LogDebug("Execute锛氬爢鍨涙満涓嶅彲鐢紝璁惧: {DeviceCode}", _deviceCode);
-                    QuartzLogger.Debug($"鍫嗗灈鏈轰笉鍙敤锛岃澶�: {_deviceCode}", _deviceCode);
+                    //_logger.LogDebug("Execute锛氬爢鍨涙満涓嶅彲鐢紝璁惧: {DeviceCode}", _deviceCode);
+                    //QuartzLogger.Debug($"鍫嗗灈鏈轰笉鍙敤锛岃澶�: {_deviceCode}", _deviceCode);
                     return Task.CompletedTask;
                 }
 
diff --git a/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob/StackerCraneTaskCommand.cs b/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob/StackerCraneTaskCommand.cs
index 9c1ad18..c680125 100644
--- a/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob/StackerCraneTaskCommand.cs
+++ b/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob/StackerCraneTaskCommand.cs
@@ -14,17 +14,6 @@
     public class StackerCraneTaskCommand : DeviceCommand
     {
         /// <summary>
-        /// 浣滀笟鍛戒护
-        /// </summary>
-        /// <remarks>
-        /// 鎺у埗鍫嗗灈鏈虹殑鍔ㄤ綔锛�
-        /// - 1: 寮�濮嬫墽琛屼换鍔�
-        /// - 2: 浠诲姟瀹屾垚/鍋滄
-        /// - 3: 娑堥槻浠诲姟寮�濮�
-        /// </remarks>
-        public short WorkAction { get; set; }
-
-        /// <summary>
         /// 浠诲姟鍙�
         /// </summary>
         /// <remarks>
@@ -105,5 +94,16 @@
         /// 鍑哄簱鏃惰〃绀鸿揣鐗╀粠鍝釜浣嶇疆鍙栧嚭銆�
         /// </remarks>
         public short EndLayer { get; set; }
+
+        /// <summary>
+        /// 浣滀笟鍛戒护
+        /// </summary>
+        /// <remarks>
+        /// 鎺у埗鍫嗗灈鏈虹殑鍔ㄤ綔锛�
+        /// - 1: 寮�濮嬫墽琛屼换鍔�
+        /// - 2: 浠诲姟瀹屾垚/鍋滄
+        /// - 3: 娑堥槻浠诲姟寮�濮�
+        /// </remarks>
+        public short WorkAction { get; set; }
     }
 }
diff --git a/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob/StackerCraneTaskSelector.cs b/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob/StackerCraneTaskSelector.cs
index c52343a..b92261d 100644
--- a/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob/StackerCraneTaskSelector.cs
+++ b/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob/StackerCraneTaskSelector.cs
@@ -105,7 +105,7 @@
             //QuartzLogger.Info($"寮�濮嬮�夋嫨浠诲姟锛岃澶�: {deviceCode}锛屼笂涓�浠诲姟绫诲瀷: {commonStackerCrane.LastTaskType}", deviceCode);
 
             // 鏍规嵁涓婁竴浠诲姟绫诲瀷鍐冲畾鏌ヨ绛栫暐
-            if (commonStackerCrane.LastTaskType == null)
+            if (commonStackerCrane.LastTaskType == null || commonStackerCrane.LastTaskType == TaskRelocationTypeEnum.Relocation.GetHashCode())
             {
                 // 娌℃湁涓婁竴浠诲姟绫诲瀷锛屾煡璇㈡櫘閫氫换鍔�
                 candidateTask = _taskService.QueryStackerCraneTask(deviceCode);
@@ -321,8 +321,8 @@
 
             // 妫�鏌ョ珯鍙版槸鍚﹁鍗犵敤
             bool isOccupied = conveyorLine.IsOccupied(router.ChildPosi);
-            _logger.LogInformation("IsOutTaskStationAvailable锛氱珯鍙� {ChildPosi}锛屾槸鍚﹁鍗犵敤: {IsOccupied}锛屼换鍔″彿: {TaskNum}", router.ChildPosi, isOccupied, task.TaskNum);
-            QuartzLogger.Info($"IsOutTaskStationAvailable锛氱珯鍙� {router.ChildPosi}锛屾槸鍚﹁鍗犵敤: {isOccupied}", task.Roadway);
+            _logger.LogInformation("IsOutTaskStationAvailable锛氱珯鍙� {ChildPosi}锛屾槸鍚﹁鍗犵敤: {IsOccupied}锛屼换鍔″彿: {TaskNum}", router.ChildPosi, !isOccupied, task.TaskNum);
+            QuartzLogger.Info($"IsOutTaskStationAvailable锛氱珯鍙� {router.ChildPosi}锛屾槸鍚﹁鍗犵敤: {!isOccupied}", task.Roadway);
 
             return isOccupied;
         }
diff --git a/Code/WMS/WIDESEA_WMSClient/src/extension/system/Mes_Log.jsx b/Code/WMS/WIDESEA_WMSClient/src/extension/system/Mes_Log.jsx
index be25098..560c165 100644
--- a/Code/WMS/WIDESEA_WMSClient/src/extension/system/Mes_Log.jsx
+++ b/Code/WMS/WIDESEA_WMSClient/src/extension/system/Mes_Log.jsx
@@ -1,5 +1,7 @@
-import { h, createApp } from 'vue';
-import { ElDrawer, ElIcon } from 'element-plus';
+import { createApp } from 'vue';
+import { ElDrawer } from 'element-plus';
+import { JsonViewer } from 'vue3-json-viewer';
+import 'vue3-json-viewer/dist/vue3-json-viewer.css';
 
 let extension = {
   components: {
@@ -54,13 +56,12 @@
       const jsonContent = type === 'request' ? row.requestJson : row.responseJson;
       const title = type === 'request' ? '馃搵 璇锋眰 JSON' : '馃摜 鍝嶅簲 JSON';
 
-      // 鏍煎紡鍖� JSON
-      let formattedJson = '';
+      // 瑙f瀽 JSON 瀵硅薄锛岃В鏋愬け璐ュ垯淇濈暀鍘熷瀛楃涓�
+      let jsonData;
       try {
-        const obj = typeof jsonContent === 'string' ? JSON.parse(jsonContent) : jsonContent;
-        formattedJson = JSON.stringify(obj, null, 2);
+        jsonData = typeof jsonContent === 'string' ? JSON.parse(jsonContent) : jsonContent;
       } catch (e) {
-        formattedJson = String(jsonContent);
+        jsonData = String(jsonContent);
       }
 
       // 鍒涘缓涓存椂瀹瑰櫒娓叉煋鎶藉眽
@@ -69,45 +70,38 @@
 
       const app = createApp({
         render() {
-          return h('div', [
-            h(ElDrawer, {
-              modelValue: true,
-              'onUpdate:modelValue': (val) => {
-                if (!val) {
-                  app.unmount();
-                  document.body.removeChild(container);
-                }
-              },
-              title: title,
-              size: '30%',
-              destroyOnClose: true,
-              closeOnClickModal: true
-            }, {
-              default: () => h('div', {
-                style: {
-                  height: '100%',
-                  backgroundColor: '#f5f5f5',
-                  padding: '16px',
-                  borderRadius: '4px'
-                }
-              }, [
-                h('pre', {
-                  style: {
-                    margin: '0',
-                    fontSize: '14px',
-                    lineHeight: '1.5',
-                    fontFamily: 'Consolas, Monaco, "Courier New", monospace',
-                    whiteSpace: 'pre-wrap',
-                    wordBreak: 'break-all'
-                  }
-                }, formattedJson)
-              ])
-            })
-          ]);
+          const onClose = (val) => {
+            if (!val) {
+              app.unmount();
+              document.body.removeChild(container);
+            }
+          };
+          return (
+            <div>
+              <ElDrawer
+                modelValue={true}
+                onUpdate:modelValue={onClose}
+                title={title}
+                size="30%"
+                destroyOnClose={true}
+                closeOnClickModal={true}
+              >
+                <JsonViewer
+                  value={jsonData}
+                  expanded={true}
+                  expandDepth={5}
+                  copyable={true}
+                  sort={false}
+                  theme="light"
+                />
+              </ElDrawer>
+            </div>
+          );
         }
       });
 
       app.use(window.ElementPlus);
+      app.component('JsonViewer', JsonViewer);
       app.mount(container);
     },
   }
diff --git a/Code/WMS/WIDESEA_WMSClient/src/extension/system/Sys_Log.jsx b/Code/WMS/WIDESEA_WMSClient/src/extension/system/Sys_Log.jsx
index 96340be..43c918c 100644
--- a/Code/WMS/WIDESEA_WMSClient/src/extension/system/Sys_Log.jsx
+++ b/Code/WMS/WIDESEA_WMSClient/src/extension/system/Sys_Log.jsx
@@ -1,5 +1,7 @@
-import { h, createApp } from 'vue';
+import { createApp } from 'vue';
 import { ElDrawer } from 'element-plus';
+import { JsonViewer } from 'vue3-json-viewer';
+import 'vue3-json-viewer/dist/vue3-json-viewer.css';
 
 let extension = {
   components: {
@@ -39,13 +41,12 @@
       const content = type === 'request' ? row.requestParam : row.responseParam;
       const title = type === 'request' ? '馃搵 璇锋眰鍙傛暟' : '馃摜 鍝嶅簲鍙傛暟';
 
-      // 鏍煎紡鍖� JSON
-      let formattedJson = '';
+      // 瑙f瀽 JSON 瀵硅薄锛岃В鏋愬け璐ュ垯淇濈暀鍘熷瀛楃涓�
+      let jsonData;
       try {
-        const obj = typeof content === 'string' ? JSON.parse(content) : content;
-        formattedJson = JSON.stringify(obj, null, 2);
+        jsonData = typeof content === 'string' ? JSON.parse(content) : content;
       } catch (e) {
-        formattedJson = String(content);
+        jsonData = String(content);
       }
 
       // 鍒涘缓涓存椂瀹瑰櫒娓叉煋鎶藉眽
@@ -54,45 +55,38 @@
 
       const app = createApp({
         render() {
-          return h('div', [
-            h(ElDrawer, {
-              modelValue: true,
-              'onUpdate:modelValue': (val) => {
-                if (!val) {
-                  app.unmount();
-                  document.body.removeChild(container);
-                }
-              },
-              title: title,
-              size: '30%',
-              destroyOnClose: true,
-              closeOnClickModal: true
-            }, {
-              default: () => h('div', {
-                style: {
-                  height: '30%',
-                  backgroundColor: '#f5f5f5',
-                  padding: '16px',
-                  borderRadius: '4px'
-                }
-              }, [
-                h('pre', {
-                  style: {
-                    margin: '0',
-                    fontSize: '14px',
-                    lineHeight: '1.5',
-                    fontFamily: 'Consolas, Monaco, "Courier New", monospace',
-                    whiteSpace: 'pre-wrap',
-                    wordBreak: 'break-all'
-                  }
-                }, formattedJson)
-              ])
-            })
-          ]);
+          const onClose = (val) => {
+            if (!val) {
+              app.unmount();
+              document.body.removeChild(container);
+            }
+          };
+          return (
+            <div>
+              <ElDrawer
+                modelValue={true}
+                onUpdate:modelValue={onClose}
+                title={title}
+                size="30%"
+                destroyOnClose={true}
+                closeOnClickModal={true}
+              >
+                <JsonViewer
+                  value={jsonData}
+                  expanded={true}
+                  expandDepth={5}
+                  copyable={true}
+                  sort={false}
+                  theme="light"
+                />
+              </ElDrawer>
+            </div>
+          );
         }
       });
 
       app.use(window.ElementPlus);
+      app.component('JsonViewer', JsonViewer);
       app.mount(container);
     }
   }
diff --git a/Code/WMS/WIDESEA_WMSClient/vite.config.mjs b/Code/WMS/WIDESEA_WMSClient/vite.config.mjs
index bea34dd..86f2b7e 100644
--- a/Code/WMS/WIDESEA_WMSClient/vite.config.mjs
+++ b/Code/WMS/WIDESEA_WMSClient/vite.config.mjs
@@ -17,6 +17,9 @@
     port: 8080,
     open: false
   },
+  optimizeDeps: {
+    include: ['vue3-json-viewer']
+  },
   build: {
     sourcemap: false
   }
diff --git a/Code/WMS/WIDESEA_WMSServer/WIDESEA_Common/LocationEnum/LocationTypeEnum.cs b/Code/WMS/WIDESEA_WMSServer/WIDESEA_Common/LocationEnum/LocationTypeEnum.cs
index e8e8a64..6916e59 100644
--- a/Code/WMS/WIDESEA_WMSServer/WIDESEA_Common/LocationEnum/LocationTypeEnum.cs
+++ b/Code/WMS/WIDESEA_WMSServer/WIDESEA_Common/LocationEnum/LocationTypeEnum.cs
@@ -41,5 +41,17 @@
         /// </summary>
         [Description("鐗瑰ぇ鎵樼洏")]
         ExtraPallet = 4,
+
+        /// <summary>
+        /// 鍖栨垚绌烘墭鐩�
+        /// </summary>
+        [Description("鍖栨垚绌烘墭鐩�")]
+        HCTrayPallet = 5,
+
+        /// <summary>
+        /// 鍖栨垚鍒嗗鎵樼洏
+        /// </summary>
+        [Description("鍖栨垚鍒嗗鎵樼洏")]
+        HCFRPallet = 6,
     }
 }
diff --git a/Code/WMS/WIDESEA_WMSServer/WIDESEA_Core/Middlewares/ApiLogMiddleware.cs b/Code/WMS/WIDESEA_WMSServer/WIDESEA_Core/Middlewares/ApiLogMiddleware.cs
index d047780..3b36860 100644
--- a/Code/WMS/WIDESEA_WMSServer/WIDESEA_Core/Middlewares/ApiLogMiddleware.cs
+++ b/Code/WMS/WIDESEA_WMSServer/WIDESEA_Core/Middlewares/ApiLogMiddleware.cs
@@ -74,7 +74,7 @@
                     try
                     {
                         // 瀛樺偍璇锋眰鏁版嵁
-                        requestParam = RequestDataLog(context);
+                        requestParam = await RequestDataLogAsync(context);
                         context.Request.Body.Position = 0;
                     }
                     catch { }
@@ -86,7 +86,7 @@
                     try
                     {
                         // 瀛樺偍鍝嶅簲鏁版嵁
-                        responseParam = ResponseDataLog(context.Response);
+                        responseParam = await ResponseDataLogAsync(context.Response);
                     }
                     catch { }
 
@@ -114,20 +114,23 @@
             }
         }
 
-        private string RequestDataLog(HttpContext context)
+        private async Task<string> RequestDataLogAsync(HttpContext context)
         {
             var request = context.Request;
+            //request.EnableBuffering();
+            //request.Body.Position = 0;
 
-            var sr = new StreamReader(request.Body);
+            var sr = new StreamReader(request.Body, Encoding.UTF8);
 
             object obj;
-            string bodyData = sr.ReadToEndAsync().Result;
+            string bodyData = await sr.ReadToEndAsync();
             if (request.ContentLength <= 100000)
             {
                 obj = new
                 {
                     QueryString = request.QueryString.ToString(),
-                    BodyData = bodyData
+                    BodyData = JsonConvert.DeserializeObject(bodyData)
+                    //BodyData = bodyData
                 };
             }
             else
@@ -145,13 +148,13 @@
             return data; ;
         }
 
-        private string ResponseDataLog(HttpResponse response)
+        private async Task<string> ResponseDataLogAsync(HttpResponse response)
         {
             if (response.ContentLength <= 100000)
             {
                 response.Body.Position = 0;
-                using StreamReader stream = new StreamReader(response.Body, leaveOpen: true);
-                string body = stream.ReadToEnd();
+                using StreamReader stream = new StreamReader(response.Body, Encoding.UTF8, leaveOpen: true);
+                string body = await stream.ReadToEndAsync();
                 response.Body.Position = 0;
                 return body;
             }
diff --git a/Code/WMS/WIDESEA_WMSServer/WIDESEA_StockService/StockSerivce.cs b/Code/WMS/WIDESEA_WMSServer/WIDESEA_StockService/StockSerivce.cs
index 0b87683..6b13364 100644
--- a/Code/WMS/WIDESEA_WMSServer/WIDESEA_StockService/StockSerivce.cs
+++ b/Code/WMS/WIDESEA_WMSServer/WIDESEA_StockService/StockSerivce.cs
@@ -162,10 +162,16 @@
                         return result ? content.OK("缁勭洏鎴愬姛") : content.Error("缁勭洏澶辫触");
                     }
 
+                    int WarehouseId = stock.Roadway switch
+                    {
+                        "娉ㄦ恫缁勭洏鏈烘鎵�" => (await _warehouseService.Db.Queryable<Dt_Warehouse>().FirstAsync(w => w.WarehouseCode == "GWSC1")).WarehouseId,
+                        "鎹㈢洏鏈烘鎵�" => (await _warehouseService.Db.Queryable<Dt_Warehouse>().FirstAsync(w => w.WarehouseCode == "HCSC1")).WarehouseId
+                    };
+
                     var entity = new Dt_StockInfo
                     {
                         PalletCode = stock.TargetPalletNo,
-                        WarehouseId = stock.Roadway == "娉ㄦ恫缁勭洏鏈烘鎵�" ? (await _warehouseService.Db.Queryable<Dt_Warehouse>().FirstAsync(w => w.WarehouseCode == "GW1")).WarehouseId : 0,
+                        WarehouseId = WarehouseId,
                         StockStatus = StockStatusEmun.缁勭洏鏆傚瓨.GetHashCode(),
                         Creater = StockConstants.SYSTEM_USER,
                         Details = details
diff --git a/Code/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService_GradingMachine.cs b/Code/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService_GradingMachine.cs
index 89fae08..29ecd75 100644
--- a/Code/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService_GradingMachine.cs
+++ b/Code/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService_GradingMachine.cs
@@ -141,8 +141,8 @@
                         NextAddress = TaskAddressConstants.DEFAULT_ADDRESS,
                         TargetAddress = TaskAddressConstants.GRADING_OUTBOUND_ADDRESS,
                         Roadway = stock.LocationDetails.RoadwayNo,
-                        TaskType = TaskTypeEnum.Outbound.GetHashCode(),
-                        TaskStatus = TaskStatusEnum.New.GetHashCode(),
+                        TaskType = TaskOutboundTypeEnum.Outbound.GetHashCode(),
+                        TaskStatus = TaskOutStatusEnum.OutNew.GetHashCode(),
                         Grade = 1,
                         TaskNum = await BaseDal.GetTaskNo(),
                         Creater = "system",
diff --git a/Code/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/WCS/TaskService_Tray.cs b/Code/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/WCS/TaskService_Tray.cs
index 51d6888..0a64c28 100644
--- a/Code/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/WCS/TaskService_Tray.cs
+++ b/Code/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/WCS/TaskService_Tray.cs
@@ -117,6 +117,7 @@
                     TaskType = TaskOutboundTypeEnum.OutEmpty.GetHashCode(),
                     TaskStatus = TaskStatusEnum.New.GetHashCode(),
                     Grade = 1,
+                    Dispatchertime = DateTime.Now,
                     TaskNum = await BaseDal.GetTaskNo(),
                     Creater = "system",
                 };
@@ -167,6 +168,8 @@
 
                     location.LocationStatus = LocationStatusEnum.Free.GetHashCode();
 
+                    task.TaskStatus = TaskOutStatusEnum.OutFinish.GetHashCode();
+
                     var updateLocationResult = await _locationInfoService.UpdateLocationInfoAsync(location);
                     var updateStockResult = await _stockInfoService.UpdateStockAsync(stockInfo);
                     if (!updateLocationResult || !updateStockResult)
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/\351\253\230\345\270\270\346\270\251\345\240\206\345\236\233\346\234\272\344\270\216\350\276\223\351\200\201\347\272\277/\345\240\206\345\236\233\346\234\272\344\270\216\344\270\212\344\275\215\346\234\272\344\272\244\344\272\222\344\277\241\346\201\257.xlsx" "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/\351\253\230\345\270\270\346\270\251\345\240\206\345\236\233\346\234\272\344\270\216\350\276\223\351\200\201\347\272\277/\345\240\206\345\236\233\346\234\272\344\270\216\344\270\212\344\275\215\346\234\272\344\272\244\344\272\222\344\277\241\346\201\257.xlsx"
index dae9f06..7b04dd1 100644
--- "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/\351\253\230\345\270\270\346\270\251\345\240\206\345\236\233\346\234\272\344\270\216\350\276\223\351\200\201\347\272\277/\345\240\206\345\236\233\346\234\272\344\270\216\344\270\212\344\275\215\346\234\272\344\272\244\344\272\222\344\277\241\346\201\257.xlsx"
+++ "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/\351\253\230\345\270\270\346\270\251\345\240\206\345\236\233\346\234\272\344\270\216\350\276\223\351\200\201\347\272\277/\345\240\206\345\236\233\346\234\272\344\270\216\344\270\212\344\275\215\346\234\272\344\272\244\344\272\222\344\277\241\346\201\257.xlsx"
Binary files differ

--
Gitblit v1.9.3