From 7154cc02c0fa9ef6786a19da0281bf6982fa61bd Mon Sep 17 00:00:00 2001
From: 陈勇 <竞男@ASUNA>
Date: 星期一, 30 三月 2026 16:02:49 +0800
Subject: [PATCH] Merge branch 'master' of http://115.159.85.185:8098/r/RuiShiGe/LingPaoCheShenKu

---
 项目代码/WMS/WMSServer/WIDESEA_StoragIntegrationServices/MES/Partial/PassPoint.cs |   38 ++++++++++++++++++++++++++++----------
 1 files changed, 28 insertions(+), 10 deletions(-)

diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServer/WIDESEA_StoragIntegrationServices/MES/Partial/PassPoint.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServer/WIDESEA_StoragIntegrationServices/MES/Partial/PassPoint.cs"
index b606cbb..bd9320c 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServer/WIDESEA_StoragIntegrationServices/MES/Partial/PassPoint.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServer/WIDESEA_StoragIntegrationServices/MES/Partial/PassPoint.cs"
@@ -4,12 +4,21 @@
 using WIDESEA_Core;
 using WIDESEA_Core.Const;
 using WIDESEA_Core.Helper;
+using WIDESEA_DTO;
+using WIDESEA_StorageBasicRepository;
 
 namespace WIDESEA_StoragIntegrationServices
 {
     public partial class MESService
     {
-        public WebResponseContent PassPoint(string stationCode, string rfid)
+        /// <summary>
+        /// 杞﹁韩杩囩偣
+        /// </summary>
+        /// <param name="stationCode"></param>
+        /// <param name="rfidPrint">鎵簩缁寸爜淇℃伅</param>
+        /// <returns></returns>
+        /// <exception cref="InvalidOperationException"></exception>
+        public WebResponseContent PassPoint(RequestTaskDto json)
         {
             WebResponseContent content = new WebResponseContent();
             try
@@ -23,18 +32,26 @@
                 }
                 var wmsIpAddress = wmsBase + ipAddress;
 
-                var stationInfo = _stationManagerRepository.QueryFirst(x => x.stationChildCode == stationCode);
+                var carBodyInfo = _carBodyRepository.QueryFirst(x => x.RFID == json.PVI);
+                if (carBodyInfo == null) throw new Exception($"鏈壘鍒癙VI{json.PVI}鐨勮溅韬暟鎹�");
+
+                //灏嗙櫧杞﹁韩鏇存柊鎴愬僵杞﹁韩
+                //carBodyInfo.CarType = 2;
+                //_carBodyRepository.UpdateData(carBodyInfo);
+
+                var stationInfo = _stationManagerRepository.QueryFirst(x => x.stationChildCode == json.Position);
+                if (stationInfo == null) throw new Exception($"璇锋眰杞﹁韩杩囩偣澶辫触:鐐逛綅{json.Position}鏈壘鍒�");
 
                 PassPointInfo passPoint = new PassPointInfo()
                 {
                     union_key = Guid.NewGuid().ToString(),
-                    line_code = stationInfo.stationChildCode,
-                    message_time = DateTime.Now,
+                    line_code = stationInfo.stationEquipMES, 
+                    message_time = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"),
                     plant_code = "1052",
-                    pvi = rfid,
-                    station_code = stationInfo.stationChildCode,
+                    pvi = json.PVI,
+                    station_code = stationInfo.stationEquipMES,
                     vin = "",
-                    pass_time = DateTime.Now
+                    pass_time = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")
                 };
 
                 var MESrespon = HttpHelper.PostAsync(wmsIpAddress, passPoint.ToJson(), contentType, headers).Result;
@@ -42,18 +59,19 @@
                 MesResponse responseContent = JsonConvert.DeserializeObject<MesResponse>(MESrespon.ToString());
                 if (responseContent.code != 200)
                 {
+                    //if (!responseContent.message.Contains("閲嶅鎶ュ伐"))
                     throw new Exception($"杞﹁韩杩囩偣寮傚父锛歿responseContent.message}");
                 }
 
                 LogFactory.GetLog("杞﹁韩杩囩偣").Info(true, $"\r\r--------------------------------------");
-                LogFactory.GetLog("杞﹁韩杩囩偣").Info(true, $"宸ヤ綅鍙�:{stationCode},RFID:{rfid}");
+                LogFactory.GetLog("杞﹁韩杩囩偣").Info(true, $"宸ヤ綅鍙�:{json.Position},RFID:{json.PVI},鍝嶅簲淇℃伅:{MESrespon}");
 
-                return content;
+                return content.OK();
             }
             catch (Exception ex)
             {
                 LogFactory.GetLog("杞﹁韩杩囩偣").Info(true, $"\r\r--------------------------------------");
-                LogFactory.GetLog("杞﹁韩杩囩偣").Info(true, $"宸ヤ綅鍙�:{stationCode},RFID:{rfid}");
+                LogFactory.GetLog("杞﹁韩杩囩偣").Info(true, $"宸ヤ綅鍙�:{json.Position},RFID:{json.PVI},寮傚父淇℃伅:{ex.Message}");
                 return content.Error(ex.Message);
             }
         }

--
Gitblit v1.9.3