From ce1292c9cf37195b6abd2699dfc5d6cb3e143c9b Mon Sep 17 00:00:00 2001
From: wanshenmean <cathay_xy@163.com>
Date: 星期日, 12 四月 2026 23:38:19 +0800
Subject: [PATCH] feat(MES): 添加MES接口相关实体和DTO JS扩展文件至JSX格式并更新配置
---
Code/docs/superpowers/specs/2026-04-12-mes-integration-design.md | 700 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 700 insertions(+), 0 deletions(-)
diff --git a/Code/docs/superpowers/specs/2026-04-12-mes-integration-design.md b/Code/docs/superpowers/specs/2026-04-12-mes-integration-design.md
new file mode 100644
index 0000000..27930b9
--- /dev/null
+++ b/Code/docs/superpowers/specs/2026-04-12-mes-integration-design.md
@@ -0,0 +1,700 @@
+# WMS搴撳瓨椤甸潰MES鎺ュ彛闆嗘垚璁捐鏂囨。
+
+**鏃ユ湡**: 2026-04-12
+**椤圭洰**: WIDESEA WMS
+**浣滆��**: Claude Code
+
+---
+
+## 涓�銆侀渶姹傛杩�
+
+涓篧MS搴撳瓨淇℃伅椤甸潰鍜屽簱瀛樻槑缁嗛〉闈㈡坊鍔犳搷浣滃垪锛岃皟鐢∕ES绯荤粺鐨勫嚭绔�/鍏ョ珯/缁戝畾/瑙g粦/NG涓婃姤鎺ュ彛锛屽疄鐜癢MS涓嶮ES鐨勬暟鎹悓姝ャ��
+
+### 鍔熻兘鑼冨洿
+
+**搴撳瓨淇℃伅椤甸潰锛坰tockInfo.vue锛�- 鎵樼洏绾у埆锛�**
+- 鎵樼洏杩涚珯锛堣皟鐢∕ES InboundInContainer鎺ュ彛锛�
+- 鎵樼洏鍑虹珯锛堣皟鐢∕ES OutboundInContainer鎺ュ彛锛�
+
+**搴撳瓨鏄庣粏椤甸潰锛坰tockInfoDetail.vue锛�- 鐢佃姱绾у埆锛�**
+- 鎵樼洏鐢佃姱缁戝畾锛堣皟鐢∕ES BindContainer鎺ュ彛锛�
+- 鎵樼洏鐢佃姱瑙g粦锛堣皟鐢∕ES UnBindContainer鎺ュ彛锛�
+- 鎵樼洏NG鐢佃姱涓婃姤锛堣皟鐢∕ES ContainerNgReport鎺ュ彛锛�
+
+---
+
+## 浜屻�佹灦鏋勮璁�
+
+### 2.1 绯荤粺鏋舵瀯鍥�
+
+```
+鈹屸攢鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�
+鈹� 鍓嶇 (Vue 3) 鈹�
+鈹� 鈹屸攢鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹� 鈹屸攢鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹� 鈹屸攢鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹� 鈹�
+鈹� 鈹� stockInfo.vue 鈹� 鈹俿tockInfoDetail 鈹� 鈹� MesDialog.vue 鈹� 鈹�
+鈹� 鈹� (搴撳瓨淇℃伅) 鈹� 鈹� .vue(搴撳瓨鏄庣粏) 鈹� 鈹� (纭瀵硅瘽妗�) 鈹� 鈹�
+鈹� 鈹� + 鎿嶄綔鍒� 鈹� 鈹� + 鎿嶄綔鍒� 鈹� 鈹� 鈹� 鈹�
+鈹� 鈹斺攢鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹攢鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹� 鈹斺攢鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹攢鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹� 鈹斺攢鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹攢鈹�鈹�鈹�鈹�鈹�鈹�鈹� 鈹�
+鈹� 鈹� 鈹� 鈹� 鈹�
+鈹� 鈹斺攢鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹粹攢鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹� 鈹�
+鈹� 鈹� 鈹�
+鈹斺攢鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹尖攢鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�
+ 鈹� HTTP API
+鈹屸攢鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹尖攢鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�
+鈹� 鈻� 鍚庣 (.NET) 鈹�
+鈹� 鈹屸攢鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹� 鈹屸攢鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹� 鈹屸攢鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹� 鈹�
+鈹� 鈹� StockController 鈹傗啋 鈹� MesController 鈹� 鈹� MesLogService 鈹� 鈹�
+鈹� 鈹� 鈹� 鈹� 鈹� 鈹� 鈹� 鈹�
+鈹� 鈹斺攢鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹� 鈹斺攢鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹攢鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹� 鈹斺攢鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹� 鈹�
+鈹� 鈹� 鈹�
+鈹� 鈻� 鈹�
+鈹� 鈹屸攢鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹� 鈹屸攢鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹� 鈹屸攢鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹� 鈹�
+鈹� 鈹� IMesService 鈹傗啋 鈹� MesService 鈹� 鈹侱t_MesApiLog 鈹� 鈹�
+鈹� 鈹� (鎺ュ彛瀹氫箟) 鈹� 鈹� (HTTP璋冪敤) 鈹� 鈹� (鏃ュ織琛�) 鈹� 鈹�
+鈹� 鈹斺攢鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹� 鈹斺攢鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹� 鈹斺攢鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹� 鈹�
+鈹斺攢鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�
+ 鈹�
+ 鈻�
+ 鈹屸攢鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�
+ 鈹� MES绯荤粺 鈹�
+ 鈹� (澶栭儴鎺ュ彛) 鈹�
+ 鈹斺攢鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�鈹�
+```
+
+### 2.2 鎶�鏈爤
+
+- **鍓嶇**: Vue 3, Element Plus, Pinia
+- **鍚庣**: .NET 8, ASP.NET Core, SqlSugar ORM
+- **鏁版嵁搴�**: SQL Server
+- **HTTP瀹㈡埛绔�**: HttpClient (鍚庣璋冪敤MES)
+
+---
+
+## 涓夈�佸墠绔璁�
+
+### 3.1 搴撳瓨淇℃伅椤甸潰 (stockInfo.vue)
+
+#### 鎿嶄綔鍒楄璁�
+
+**琛ㄦ牸鍒楅厤缃細**
+```javascript
+{
+ field: "actions",
+ title: "鎿嶄綔",
+ width: 200,
+ fixed: "right",
+ align: "center",
+ formatter: (row) => renderActions(row)
+}
+```
+
+**鎸夐挳瀹氫箟锛�**
+- 杩涚珯鎸夐挳锛氳皟鐢ㄦ墭鐩樿繘绔欐帴鍙�
+- 鍑虹珯鎸夐挳锛氳皟鐢ㄦ墭鐩樺嚭绔欐帴鍙�
+
+**鎸夐挳鏄剧ず瑙勫垯锛�**
+
+| 搴撳瓨鐘舵�� | 杩涚珯 | 鍑虹珯 |
+|---------|:----:|:----:|
+| 寰呭叆搴� (0) | 鉁� | 鉁� |
+| 鍦ㄥ簱 (1) | 鉁� | 鉁� |
+| 鍑哄簱涓� (2) | 鉁� | 鉁� |
+| 閿佸畾 (3) | 鉁� | 鉁� |
+
+### 3.2 搴撳瓨鏄庣粏椤甸潰 (stockInfoDetail.vue)
+
+#### 鎿嶄綔鍒楄璁�
+
+**琛ㄦ牸鍒楅厤缃細**
+```javascript
+{
+ field: "actions",
+ title: "鎿嶄綔",
+ width: 280,
+ fixed: "right",
+ align: "center",
+ formatter: (row) => renderActions(row)
+}
+```
+
+**鎸夐挳瀹氫箟锛�**
+- 缁戝畾鎸夐挳锛氳皟鐢ㄦ墭鐩樼數鑺粦瀹氭帴鍙�
+- 瑙g粦鎸夐挳锛氳皟鐢ㄦ墭鐩樼數鑺В缁戞帴鍙�
+- NG涓婃姤鎸夐挳锛氳皟鐢ㄦ墭鐩楴G鐢佃姱涓婃姤鎺ュ彛
+
+**鎸夐挳鏄剧ず瑙勫垯锛�**
+
+| 鐢佃姱鐘舵�� | 缁戝畾 | 瑙g粦 | NG涓婃姤 |
+|---------|:----:|:----:|:------:|
+| 姝e父 (1) | 鉁� | 鉁� | 鉁� |
+| 寮傚父 (2) | 鉁� | 鉁� | 鉁� |
+| 宸查攣瀹� (99) | 鉁� | 鉁� | 鉁� |
+
+### 3.3 纭瀵硅瘽妗嗙粍浠� (MesConfirmDialog.vue)
+
+**缁勪欢鑱岃矗锛�**
+- 鏄剧ず鍗冲皢鎵ц鐨勬搷浣滀俊鎭�
+- 灞曠ず鍏抽敭鍙傛暟锛堟墭鐩樼爜銆佽澶囩紪鐮佺瓑锛�
+- 鎻愪緵纭/鍙栨秷鎸夐挳
+- 鏄剧ず璋冪敤缁撴灉锛堟垚鍔�/澶辫触锛�
+
+**Props瀹氫箟锛�**
+```typescript
+interface MesConfirmDialogProps {
+ visible: boolean;
+ operationType: 'inbound' | 'outbound' | 'bind' | 'unbind' | 'ngReport';
+ palletCode: string;
+ stockInfo?: any;
+ detailInfo?: any;
+}
+```
+
+### 3.4 浜や簰娴佺▼
+
+```
+鐢ㄦ埛鐐瑰嚮鎿嶄綔鎸夐挳
+ 鈹�
+ 鈻�
+妫�鏌ョ櫥褰曠姸鎬� 鈹�鈹�鈹�鈹�鈹�鈹�鈫� 鏈櫥褰� 鈹�鈹�鈹�鈹�鈫� 鎻愮ず"璇峰厛鐧诲綍"
+ 鈹�
+ 鈻� 宸茬櫥褰�
+妫�鏌ユ搷浣滄潈闄� 鈹�鈹�鈹�鈹�鈹�鈹�鈫� 鏃犳潈闄� 鈹�鈹�鈹�鈹�鈫� 鎻愮ず"鏃犳潈闄愭墽琛屾鎿嶄綔"
+ 鈹�
+ 鈻� 鏈夋潈闄�
+寮瑰嚭纭瀵硅瘽妗�
+ 鈹�
+ 鈻�
+鐢ㄦ埛鐐瑰嚮"纭鎵ц"
+ 鈹�
+ 鈻�
+鏄剧ずloading鐘舵��
+ 鈹�
+ 鈻�
+璋冪敤鍚庣API
+ 鈹�
+ 鈹溾攢鈫� 鎴愬姛 鈹�鈹�鈹�鈹�鈫� 鏄剧ず鎴愬姛鎻愮ず 鈹�鈹�鈹�鈹�鈫� 鍒锋柊鍒楄〃
+ 鈹�
+ 鈹斺攢鈫� 澶辫触 鈹�鈹�鈹�鈹�鈫� 鏄剧ず閿欒鎻愮ず + "閲嶈瘯"鎸夐挳
+```
+
+---
+
+## 鍥涖�佸悗绔璁�
+
+### 4.1 API鎺ュ彛璁捐
+
+#### 4.1.1 搴撳瓨淇℃伅鐩稿叧鎺ュ彛
+
+**鎵樼洏杩涚珯**
+```csharp
+/// <summary>
+/// 鎵樼洏杩涚珯 - 璋冪敤MES鎺ュ彛
+/// </summary>
+[HttpPost("inboundInContainer")]
+public async Task<WebResponseContent> InboundInContainer([FromBody] InboundInContainerRequestDto dto)
+```
+
+**璇锋眰DTO锛�**
+```csharp
+public class InboundInContainerRequestDto
+{
+ /// <summary>
+ /// 鎵樼洏缂栧彿
+ /// </summary>
+ public string PalletCode { get; set; }
+
+ /// <summary>
+ /// 搴撳瓨ID
+ /// </summary>
+ public long StockId { get; set; }
+}
+```
+
+**鎵樼洏鍑虹珯**
+```csharp
+/// <summary>
+/// 鎵樼洏鍑虹珯 - 璋冪敤MES鎺ュ彛
+/// </summary>
+[HttpPost("outboundInContainer")]
+public async Task<WebResponseContent> OutboundInContainer([FromBody] OutboundInContainerRequestDto dto)
+```
+
+**璇锋眰DTO锛�**
+```csharp
+public class OutboundInContainerRequestDto
+{
+ /// <summary>
+ /// 鎵樼洏缂栧彿
+ /// </summary>
+ public string PalletCode { get; set; }
+
+ /// <summary>
+ /// 搴撳瓨ID
+ /// </summary>
+ public long StockId { get; set; }
+
+ /// <summary>
+ /// 浜у搧鍙傛暟鍒楄〃锛堝彲閫夛級
+ /// </summary>
+ public List<ParamItemDto> ParamList { get; set; }
+}
+```
+
+#### 4.1.2 搴撳瓨鏄庣粏鐩稿叧鎺ュ彛
+
+**鎵樼洏鐢佃姱缁戝畾**
+```csharp
+/// <summary>
+/// 鎵樼洏鐢佃姱缁戝畾 - 璋冪敤MES鎺ュ彛
+/// </summary>
+[HttpPost("bindContainer")]
+public async Task<WebResponseContent> BindContainer([FromBody] BindContainerRequestDto dto)
+```
+
+**璇锋眰DTO锛�**
+```csharp
+public class BindContainerRequestDto
+{
+ /// <summary>
+ /// 鎵樼洏缂栧彿
+ /// </summary>
+ public string PalletCode { get; set; }
+
+ /// <summary>
+ /// 鐢佃姱鐮佸垪琛�
+ /// </summary>
+ public List<string> SfcList { get; set; }
+
+ /// <summary>
+ /// 浣嶇疆淇℃伅
+ /// </summary>
+ public string Location { get; set; }
+
+ /// <summary>
+ /// 鎿嶄綔绫诲瀷锛�0-榛樿 1-杩涚珯 2-鍑虹珯 3-杩涘嚭绔�
+ /// </summary>
+ public int OperationType { get; set; } = 1;
+}
+```
+
+**鎵樼洏鐢佃姱瑙g粦**
+```csharp
+/// <summary>
+/// 鎵樼洏鐢佃姱瑙g粦 - 璋冪敤MES鎺ュ彛
+/// </summary>
+[HttpPost("unbindContainer")]
+public async Task<WebResponseContent> UnbindContainer([FromBody] UnbindContainerRequestDto dto)
+```
+
+**璇锋眰DTO锛�**
+```csharp
+public class UnbindContainerRequestDto
+{
+ /// <summary>
+ /// 鎵樼洏缂栧彿
+ /// </summary>
+ public string PalletCode { get; set; }
+
+ /// <summary>
+ /// 鐢佃姱鐮佸垪琛�
+ /// </summary>
+ public List<string> SfcList { get; set; }
+}
+```
+
+**鎵樼洏NG鐢佃姱涓婃姤**
+```csharp
+/// <summary>
+/// 鎵樼洏NG鐢佃姱涓婃姤 - 璋冪敤MES鎺ュ彛
+/// </summary>
+[HttpPost("containerNgReport")]
+public async Task<WebResponseContent> ContainerNgReport([FromBody] ContainerNgReportRequestDto dto)
+```
+
+**璇锋眰DTO锛�**
+```csharp
+public class ContainerNgReportRequestDto
+{
+ /// <summary>
+ /// 鎵樼洏缂栧彿
+ /// </summary>
+ public string PalletCode { get; set; }
+
+ /// <summary>
+ /// NG鐢佃姱鍒楄〃
+ /// </summary>
+ public List<NgSfcItemDto> NgSfcList { get; set; }
+}
+
+public class NgSfcItemDto
+{
+ /// <summary>
+ /// 浜у搧鏉$爜
+ /// </summary>
+ public string Sfc { get; set; }
+
+ /// <summary>
+ /// NG浠g爜
+ /// </summary>
+ public string NgCode { get; set; }
+
+ /// <summary>
+ /// NG璁惧
+ /// </summary>
+ public string NgEquipmentCode { get; set; }
+
+ /// <summary>
+ /// NG璧勬簮
+ /// </summary>
+ public string NgResourceCode { get; set; }
+}
+```
+
+### 4.2 鏁版嵁搴撹璁�
+
+#### 4.2.1 MES鎺ュ彛璋冪敤鏃ュ織琛�
+
+```sql
+CREATE TABLE Dt_MesApiLog (
+ Id BIGINT PRIMARY KEY IDENTITY(1,1),
+ ApiType NVARCHAR(50) NOT NULL, -- 鎺ュ彛绫诲瀷
+ RequestJson NVARCHAR(MAX) NULL, -- 璇锋眰JSON
+ ResponseJson NVARCHAR(MAX) NULL, -- 鍝嶅簲JSON
+ IsSuccess BIT NOT NULL DEFAULT 0, -- 鏄惁鎴愬姛
+ ErrorMessage NVARCHAR(500) NULL, -- 閿欒淇℃伅
+ ElapsedMs INT NOT NULL DEFAULT 0, -- 鑰楁椂(姣)
+ CreateDate DATETIME NOT NULL, -- 鍒涘缓鏃堕棿
+ Creator NVARCHAR(50) NULL, -- 鍒涘缓浜�
+ INDEX IX_MesApiLog_ApiType (ApiType),
+ INDEX IX_MesApiLog_CreateDate (CreateDate)
+);
+```
+
+**瀛楁璇存槑锛�**
+
+| 瀛楁 | 绫诲瀷 | 璇存槑 |
+|------|------|------|
+| Id | bigint | 涓婚敭 |
+| ApiType | string(50) | 鎺ュ彛绫诲瀷锛欼nboundInContainer, OutboundInContainer, BindContainer, UnbindContainer, ContainerNgReport |
+| RequestJson | string(MAX) | MES鎺ュ彛璇锋眰JSON |
+| ResponseJson | string(MAX) | MES鎺ュ彛鍝嶅簲JSON |
+| IsSuccess | bool | 璋冪敤鏄惁鎴愬姛 |
+| ErrorMessage | string(500) | 澶辫触鏃剁殑閿欒淇℃伅 |
+| ElapsedMs | int | 鎺ュ彛璋冪敤鑰楁椂锛堟绉掞級 |
+| CreateDate | datetime | 鍒涘缓鏃堕棿 |
+| Creator | string(50) | 鍒涘缓浜� |
+
+#### 4.2.2 绯荤粺閰嶇疆琛ㄦ墿灞�
+
+```sql
+-- 鍦� Dt_SystemConfig 琛ㄤ腑鏂板MES閰嶇疆椤�
+INSERT INTO Dt_SystemConfig (ConfigKey, ConfigValue, Description, CreateDate)
+VALUES
+('MES_EquipmentCode', 'WCS_001', 'MES璁惧缂栫爜', GETDATE()),
+('MES_ResourceCode', 'RESOURCE_001', 'MES璧勬簮缂栫爜', GETDATE()),
+('MES_ApiBaseUrl', 'http://mes-server/api', 'MES鎺ュ彛鍦板潃', GETDATE()),
+('MES_TimeoutSeconds', '30', 'MES鎺ュ彛瓒呮椂鏃堕棿(绉�)', GETDATE());
+```
+
+### 4.3 鏈嶅姟灞傝璁�
+
+#### 4.3.1 MES鏃ュ織鏈嶅姟鎺ュ彛
+
+```csharp
+/// <summary>
+/// MES鎺ュ彛鏃ュ織鏈嶅姟鎺ュ彛
+/// </summary>
+public interface IMesLogService : IDependency
+{
+ /// <summary>
+ /// 璁板綍MES鎺ュ彛璋冪敤鏃ュ織
+ /// </summary>
+ Task<bool> LogAsync(MesApiLogDto log);
+
+ /// <summary>
+ /// 鑾峰彇鏈�杩戠殑MES鎺ュ彛璋冪敤璁板綍
+ /// </summary>
+ Task<List<MesApiLogDto>> GetRecentLogsAsync(string apiType, int count = 50);
+}
+```
+
+#### 4.3.2 MES鏃ュ織鏈嶅姟瀹炵幇
+
+```csharp
+/// <summary>
+/// MES鎺ュ彛鏃ュ織鏈嶅姟瀹炵幇
+/// </summary>
+public class MesLogService : IMesLogService
+{
+ private readonly ISqlSugarClient _db;
+
+ public async Task<bool> LogAsync(MesApiLogDto log)
+ {
+ var entity = new Dt_MesApiLog
+ {
+ ApiType = log.ApiType,
+ RequestJson = log.RequestJson,
+ ResponseJson = log.ResponseJson,
+ IsSuccess = log.IsSuccess,
+ ErrorMessage = log.ErrorMessage,
+ ElapsedMs = log.ElapsedMs,
+ CreateDate = DateTime.Now,
+ Creator = log.Creator
+ };
+
+ return await _db.Insertable(entity).ExecuteCommandAsync() > 0;
+ }
+
+ public async Task<List<MesApiLogDto>> GetRecentLogsAsync(string apiType, int count = 50)
+ {
+ return await _db.Queryable<Dt_MesApiLog>()
+ .Where(x => x.ApiType == apiType)
+ .OrderByDescending(x => x.CreateDate)
+ .Take(count)
+ .ToListAsync();
+ }
+}
+```
+
+---
+
+## 浜斻�佹帴鍙h皟鐢ㄦ祦绋�
+
+### 5.1 鎵樼洏杩涚珯娴佺▼
+
+```
+鐢ㄦ埛鐐瑰嚮"杩涚珯"鎸夐挳
+ 鈹�
+ 鈻�
+鍓嶇寮瑰嚭纭瀵硅瘽妗嗭紙鏄剧ず鎵樼洏鐮併�佽澶囩紪鐮佺瓑锛�
+ 鈹�
+ 鈻�
+鐢ㄦ埛纭
+ 鈹�
+ 鈻�
+鍓嶇璋冪敤 POST /api/StockInfo/inboundInContainer
+ 鈹�
+ 鈻�
+鍚庣 StockInfoController.InboundInContainer()
+ 鈹�
+ 鈹溾攢鈫� 1. 楠岃瘉搴撳瓨鐘舵�侊紙浠�"寰呭叆搴�"鐘舵�佸厑璁歌繘绔欙級
+ 鈹�
+ 鈹溾攢鈫� 2. 鑾峰彇绯荤粺閰嶇疆锛堣澶囩紪鐮併�佽祫婧愮紪鐮侊級
+ 鈹�
+ 鈹溾攢鈫� 3. 鏋勯�燤ES璇锋眰瀵硅薄
+ 鈹�
+ 鈹溾攢鈫� 4. 璋冪敤 IMesService.InboundInContainer()
+ 鈹� 鈹�
+ 鈹� 鈹溾攢鈫� 璁板綍寮�濮嬫椂闂�
+ 鈹� 鈹溾攢鈫� 鍙戦�丠TTP璇锋眰鍒癕ES
+ 鈹� 鈹溾攢鈫� 璁板綍鍝嶅簲銆佽�楁椂
+ 鈹� 鈹斺攢鈫� 淇濆瓨鏃ュ織鍒� Dt_MesApiLog
+ 鈹�
+ 鈹溾攢鈫� 5. 杩斿洖缁撴灉缁欏墠绔�
+ 鈹�
+ 鈹斺攢鈫� 鍓嶇鏄剧ず鎴愬姛/澶辫触鎻愮ず
+```
+
+### 5.2 鎵樼洏鐢佃姱缁戝畾娴佺▼
+
+```
+鐢ㄦ埛鐐瑰嚮"缁戝畾"鎸夐挳
+ 鈹�
+ 鈻�
+鍓嶇寮瑰嚭纭瀵硅瘽妗嗭紙鏄剧ず鎵樼洏鐮併�佺數鑺爜鍒楄〃锛�
+ 鈹�
+ 鈻�
+鐢ㄦ埛纭
+ 鈹�
+ 鈻�
+鍓嶇璋冪敤 POST /api/StockInfoDetail/bindContainer
+ 鈹�
+ 鈻�
+鍚庣 StockInfoDetailController.BindContainer()
+ 鈹�
+ 鈹溾攢鈫� 1. 楠岃瘉鐢佃姱鐘舵�侊紙闈�"宸查攣瀹�"鐘舵�佸厑璁哥粦瀹氾級
+ 鈹�
+ 鈹溾攢鈫� 2. 鑾峰彇绯荤粺閰嶇疆
+ 鈹�
+ 鈹溾攢鈫� 3. 鏋勯�燤ES璇锋眰瀵硅薄锛堝寘鍚數鑺爜鍒楄〃锛�
+ 鈹�
+ 鈹溾攢鈫� 4. 璋冪敤 IMesService.BindContainer()
+ 鈹� 鈹�
+ 鈹� 鈹溾攢鈫� 璁板綍寮�濮嬫椂闂�
+ 鈹� 鈹溾攢鈫� 鍙戦�丠TTP璇锋眰鍒癕ES
+ 鈹� 鈹溾攢鈫� 璁板綍鍝嶅簲銆佽�楁椂
+ 鈹� 鈹斺攢鈫� 淇濆瓨鏃ュ織鍒� Dt_MesApiLog
+ 鈹�
+ 鈹溾攢鈫� 5. 杩斿洖缁撴灉缁欏墠绔�
+ 鈹�
+ 鈹斺攢鈫� 鍓嶇鏄剧ず鎴愬姛/澶辫触鎻愮ず
+```
+
+---
+
+## 鍏�侀敊璇鐞�
+
+### 6.1 閿欒绫诲瀷
+
+| 閿欒绫诲瀷 | 璇存槑 | 澶勭悊鏂瑰紡 |
+|---------|------|---------|
+| 缃戠粶瓒呮椂 | MES鏈嶅姟鍣ㄦ棤鍝嶅簲鎴栬繛鎺ヨ秴鏃� | 鏄剧ず閿欒鎻愮ず锛屾彁渚�"閲嶈瘯"鎸夐挳 |
+| 涓氬姟鏍¢獙澶辫触 | 鎵樼洏涓嶅瓨鍦ㄣ�佺數鑺凡缁戝畾绛� | 鏄剧ずMES杩斿洖鐨勯敊璇俊鎭� |
+| 璁よ瘉澶辫触 | MES鎺ュ彛璁よ瘉淇℃伅杩囨湡 | 鏄剧ず"MES璁よ瘉澶辫触锛岃鑱旂郴绠$悊鍛�" |
+| 鍙傛暟閿欒 | 璇锋眰鍙傛暟涓嶅畬鏁存垨鏍煎紡閿欒 | 鏄剧ず"鍙傛暟閿欒锛歿鍏蜂綋閿欒}" |
+| 鏈煡閿欒 | MES绯荤粺杩斿洖寮傚父鍝嶅簲 | 鏄剧ず"MES绯荤粺寮傚父锛岃绋嶅悗閲嶈瘯" |
+
+### 6.2 鍓嶇閿欒鎻愮ず
+
+```javascript
+// 鎴愬姛鎻愮ず
+ElMessage.success('鎵樼洏杩涚珯鎴愬姛');
+
+// 澶辫触鎻愮ず
+ElMessage.error({
+ message: 'MES鏈嶅姟鍣ㄨ繛鎺ヨ秴鏃讹紝璇锋鏌ョ綉缁滃悗閲嶈瘯',
+ showRetry: true,
+ onRetry: () => retryOperation()
+});
+```
+
+### 6.3 鍚庣閿欒鏃ュ織
+
+```csharp
+try
+{
+ // 璋冪敤MES鎺ュ彛
+}
+catch (HttpRequestException ex)
+{
+ // 缃戠粶寮傚父
+ await _mesLogService.LogAsync(new MesApiLogDto
+ {
+ ApiType = "InboundInContainer",
+ IsSuccess = false,
+ ErrorMessage = $"缃戠粶寮傚父: {ex.Message}",
+ ElapsedMs = elapsedMs
+ });
+ return ResponseContent.Error("MES鏈嶅姟鍣ㄨ繛鎺ュけ璐ワ紝璇锋鏌ョ綉缁�");
+}
+catch (Exception ex)
+{
+ // 鍏朵粬寮傚父
+ _logger.LogError(ex, "璋冪敤MES鎺ュ彛寮傚父");
+ return ResponseContent.Error($"MES鎺ュ彛璋冪敤澶辫触: {ex.Message}");
+}
+```
+
+---
+
+## 涓冦�佹潈闄愭帶鍒�
+
+### 7.1 鍔熻兘鏉冮檺瀹氫箟
+
+寤鸿鍦ㄧ郴缁熶腑鏂板浠ヤ笅鍔熻兘鏉冮檺锛�
+
+| 鏉冮檺浠g爜 | 鏉冮檺鍚嶇О | 璇存槑 |
+|---------|---------|------|
+| MES_INBOUND | MES杩涚珯鎿嶄綔 | 鍏佽鎵ц鎵樼洏杩涚珯鎿嶄綔 |
+| MES_OUTBOUND | MES鍑虹珯鎿嶄綔 | 鍏佽鎵ц鎵樼洏鍑虹珯鎿嶄綔 |
+| MES_BIND | MES缁戝畾鎿嶄綔 | 鍏佽鎵ц鐢佃姱缁戝畾鎿嶄綔 |
+| MES_UNBIND | MES瑙g粦鎿嶄綔 | 鍏佽鎵ц鐢佃姱瑙g粦鎿嶄綔 |
+| MES_NG_REPORT | MES NG涓婃姤 | 鍏佽鎵цNG涓婃姤鎿嶄綔 |
+
+### 7.2 鏉冮檺楠岃瘉
+
+```csharp
+[HttpPost("inboundInContainer")]
+[Permission("MES_INBOUND")]
+public async Task<WebResponseContent> InboundInContainer([FromBody] InboundInContainerRequestDto dto)
+{
+ // 鎺ュ彛瀹炵幇
+}
+```
+
+---
+
+## 鍏�佹枃浠跺彉鏇存竻鍗�
+
+### 8.1 鍓嶇鏂囦欢
+
+```
+WMS/WIDESEA_WMSClient/src/
+鈹溾攢鈹� views/stock/
+鈹� 鈹溾攢鈹� stockInfo.vue # 淇敼锛氭坊鍔犳搷浣滃垪
+鈹� 鈹斺攢鈹� stockInfoDetail.vue # 淇敼锛氭坊鍔犳搷浣滃垪
+鈹溾攢鈹� components/
+鈹� 鈹斺攢鈹� MesConfirmDialog.vue # 鏂板锛歁ES纭瀵硅瘽妗�
+鈹斺攢鈹� api/
+ 鈹斺攢鈹� mes.js # 鏂板锛歁ES API璋冪敤
+```
+
+### 8.2 鍚庣鏂囦欢
+
+```
+WMS/WIDESEA_WMSServer/
+鈹溾攢鈹� Controllers/
+鈹� 鈹斺攢鈹� Stock/
+鈹� 鈹溾攢鈹� StockInfoController.cs # 淇敼锛氭坊鍔犺繘绔�/鍑虹珯鎺ュ彛
+鈹� 鈹斺攢鈹� StockInfoDetailController.cs # 淇敼锛氭坊鍔犵粦瀹�/瑙g粦/NG涓婃姤鎺ュ彛
+鈹溾攢鈹� Services/
+鈹� 鈹斺攢鈹� Mes/
+鈹� 鈹溾攢鈹� IMesLogService.cs # 鏂板锛氭棩蹇楁湇鍔℃帴鍙�
+鈹� 鈹斺攢鈹� MesLogService.cs # 鏂板锛氭棩蹇楁湇鍔″疄鐜�
+鈹斺攢鈹� DTO/
+ 鈹溾攢鈹� Mes/
+ 鈹� 鈹溾攢鈹� MesApiLogDto.cs # 鏂板锛氭棩蹇桪TO
+ 鈹� 鈹溾攢鈹� InboundInContainerRequestDto.cs # 鏂板锛氳繘绔欒姹侱TO
+ 鈹� 鈹溾攢鈹� OutboundInContainerRequestDto.cs # 鏂板锛氬嚭绔欒姹侱TO
+ 鈹� 鈹溾攢鈹� BindContainerRequestDto.cs # 鏂板锛氱粦瀹氳姹侱TO
+ 鈹� 鈹溾攢鈹� UnbindContainerRequestDto.cs # 鏂板锛氳В缁戣姹侱TO
+ 鈹� 鈹斺攢鈹� ContainerNgReportRequestDto.cs # 鏂板锛歂G涓婃姤璇锋眰DTO
+ 鈹斺攢鈹� Models/
+ 鈹斺攢鈹� Mes/
+ 鈹斺攢鈹� Dt_MesApiLog.cs # 鏂板锛氭棩蹇楀疄浣�
+```
+
+### 8.3 鏁版嵁搴撴枃浠�
+
+```
+Database/
+鈹斺攢鈹� Scripts/
+ 鈹斺攢鈹� 20260412_MesApiLog.sql # 鏂板锛氭棩蹇楄〃鍒涘缓鑴氭湰
+```
+
+---
+
+## 涔濄�佹祴璇曡鐐�
+
+### 9.1 鍔熻兘娴嬭瘯
+
+| 娴嬭瘯鍦烘櫙 | 棰勬湡缁撴灉 |
+|---------|---------|
+| 寰呭叆搴撶姸鎬佹墭鐩樼偣鍑昏繘绔� | 寮瑰嚭纭瀵硅瘽妗嗭紝纭鍚庢垚鍔熻皟鐢� |
+| 鍦ㄥ簱鐘舵�佹墭鐩樼偣鍑昏繘绔� | 杩涚珯鎸夐挳涓嶆樉绀� |
+| 缃戠粶涓柇鏃剁偣鍑绘搷浣� | 鏄剧ず缃戠粶閿欒鎻愮ず锛屾彁渚涢噸璇曟寜閽� |
+| MES杩斿洖涓氬姟閿欒 | 鏄剧ずMES杩斿洖鐨勫叿浣撻敊璇俊鎭� |
+| 鐐瑰嚮鎿嶄綔鍚庡埛鏂伴〉闈� | 鎿嶄綔璁板綍宸蹭繚瀛樺埌鏃ュ織琛� |
+
+### 9.2 鎬ц兘娴嬭瘯
+
+| 鎸囨爣 | 鐩爣鍊� |
+|------|--------|
+| MES鎺ュ彛鍝嶅簲鏃堕棿 | < 2绉� |
+| 鍓嶇鎸夐挳鐐瑰嚮鍝嶅簲 | < 100ms |
+| 鏃ュ織鍐欏叆鑰楁椂 | < 50ms |
+
+---
+
+## 鍗併�佸悗缁紭鍖栧缓璁�
+
+1. **鎵归噺鎿嶄綔**锛氭敮鎸侀�変腑澶氫釜鎵樼洏/鐢佃姱鎵归噺璋冪敤MES鎺ュ彛
+2. **鑷姩閲嶈瘯**锛氬浜庣綉缁滆秴鏃剁瓑涓存椂鏁呴殰锛岃嚜鍔ㄩ噸璇�3娆�
+3. **鎺ュ彛鐩戞帶**锛氬鍔燤ES鎺ュ彛璋冪敤鐨勫疄鏃剁洃鎺у拰鍛婅
+4. **鍙傛暟閰嶇疆鍖�**锛氬皢瓒呮椂鏃堕棿銆侀噸璇曟鏁扮瓑鍙傛暟鍋氭垚鍙厤缃」
+5. **鎿嶄綔瀹¤**锛氬鍔犳搷浣滃璁℃棩蹇楋紝璁板綍璋佸湪浠�涔堟椂闂存墽琛屼簡浠�涔堟搷浣�
+
+---
+
+**鏂囨。鐗堟湰**: 1.0
+**鏈�鍚庢洿鏂�**: 2026-04-12
--
Gitblit v1.9.3