From 9de6c7c6d835ba5161d64114d154bfc7676244a1 Mon Sep 17 00:00:00 2001
From: 陈勇 <竞男@ASUNA>
Date: 星期一, 06 四月 2026 12:44:43 +0800
Subject: [PATCH] 同步
---
项目代码/WMS/WMSServer/WIDESEA_StoragIntegrationServices/MES/Partial/lock.cs | 38 ++++++++++++++++++++++++++++++++++++--
1 files changed, 36 insertions(+), 2 deletions(-)
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServer/WIDESEA_StoragIntegrationServices/MES/Partial/lock.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServer/WIDESEA_StoragIntegrationServices/MES/Partial/lock.cs"
index 5ffc548..008f2a5 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServer/WIDESEA_StoragIntegrationServices/MES/Partial/lock.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServer/WIDESEA_StoragIntegrationServices/MES/Partial/lock.cs"
@@ -27,12 +27,46 @@
WebResponseContent content = new WebResponseContent();
try
{
-
+ var configs = _configService.GetConfigsByCategory(CateGoryConst.CONFIG_SYS_MESIPAddress);
+ var wmsBase = configs.FirstOrDefault(x => x.ConfigKey == SysConfigConst.MESIPAddress)?.ConfigValue;
+ var ipAddress = configs.FirstOrDefault(x => x.ConfigKey == SysConfigConst.bindWorkOrder)?.ConfigValue;
+ if (wmsBase == null || ipAddress == null)
+ {
+ throw new InvalidOperationException("WMS IP 鏈厤缃�");
+ }
+ var wmsIpAddress = wmsBase + ipAddress;
+
+ var carBodyInfo = _carBodyRepository.QueryFirst(x => x.RFID == "");
+
+ if (carBodyInfo == null) throw new Exception($"鏈壘鍒癙VI鐨勮溅韬暟鎹�");
+
+ BindWorkOrder bindOrder = new BindWorkOrder()
+ {
+ unionKey = Guid.NewGuid().ToString(),
+ stationCode = "",
+ messageTime = DateTime.Now.ToString(),
+ plantCode = "1052",
+ pvi = carBodyInfo.PVI,
+ };
+
+ var MESrespon = HttpHelper.PostAsync(wmsIpAddress, bindOrder.ToJson(), contentType, headers).Result;
+
+ Console.WriteLine(MESrespon);
+ WebResponseContent webResponse = JsonConvert.DeserializeObject<WebResponseContent>(MESrespon.ToString());
+ if (webResponse.Code != 200)
+ {
+ throw new Exception($"{webResponse.msg}");
+ }
+
+ BindWorkOrderRespon characterRespon = JsonConvert.DeserializeObject<BindWorkOrderRespon>(webResponse.Data.ToJson());
+
+ _unitOfWorkManage.BeginTran();
LogFactory.GetLog("閿佽溅涓婃姤").Info(true, $"\r\r--------------------------------------");
LogFactory.GetLog("閿佽溅涓婃姤").Info(true, jsondata.ToJsonString());
- return content;
+ _unitOfWorkManage.CommitTran();
+ return content.OK();
}
catch (Exception ex)
{
--
Gitblit v1.9.3