From 3fa25c0bcb790b64bc206211923099cc330c5086 Mon Sep 17 00:00:00 2001
From: huangxiaoqiang <huangxiaoqiang@hnkhzn.com>
Date: 星期二, 17 三月 2026 16:22:40 +0800
Subject: [PATCH] 1

---
 项目代码/WMS/WMSServer/WIDESEA_StoragIntegrationServices/MES/Partial/PassPoint.cs |   55 ++++++++++++++++++++++++++++++++++++++-----------------
 1 files changed, 38 insertions(+), 17 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 98d7133..f116670 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"
@@ -1,56 +1,77 @@
 锘縰sing Newtonsoft.Json;
 using WIDESEA_Common;
+using WIDESEA_Common.MES;
 using WIDESEA_Core;
 using WIDESEA_Core.Const;
 using WIDESEA_Core.Helper;
+using WIDESEA_DTO;
+using WIDESEA_StorageBasicRepository;
 
 namespace WIDESEA_StoragIntegrationServices
 {
-    /// <summary>
-    /// 杞﹁韩杩囩偣璇锋眰
-    /// </summary>
     public partial class MESService
     {
-        public WebResponseContent PassPoint(string stationCode)
+        /// <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
             {
                 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.PassPoint)?.ConfigValue;
+                var ipAddress = configs.FirstOrDefault(x => x.ConfigKey == SysConfigConst.AVIPASS)?.ConfigValue;
                 if (wmsBase == null || ipAddress == null)
                 {
                     throw new InvalidOperationException("WMS IP 鏈厤缃�");
                 }
                 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,
-                    plant_code = "",
-                    pvi = "",
-                    station_code = stationInfo.stationChildCode,
+                    line_code = stationInfo.stationEquipMES, 
+                    message_time = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"),
+                    plant_code = "1052",
+                    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.Post(wmsIpAddress, passPoint.ToJson());
+                var MESrespon = HttpHelper.PostAsync(wmsIpAddress, passPoint.ToJson(), contentType, headers).Result;
 
-                WebResponseContent responseContent = JsonConvert.DeserializeObject<WebResponseContent>(MESrespon);
-                if (!responseContent.Status)
+                MesResponse responseContent = JsonConvert.DeserializeObject<MesResponse>(MESrespon.ToString());
+                if (responseContent.code != 200)
                 {
-                    throw new Exception($"杞﹁韩杩囩偣寮傚父锛歿responseContent.Message}");
+                    //if (!responseContent.message.Contains("閲嶅鎶ュ伐"))
+                    throw new Exception($"杞﹁韩杩囩偣寮傚父锛歿responseContent.message}");
                 }
 
-                return content;
+                LogFactory.GetLog("杞﹁韩杩囩偣").Info(true, $"\r\r--------------------------------------");
+                LogFactory.GetLog("杞﹁韩杩囩偣").Info(true, $"宸ヤ綅鍙�:{json.Position},RFID:{json.PVI},鍝嶅簲淇℃伅:{responseContent.ToJson}");
+
+                return content.OK();
             }
             catch (Exception ex)
             {
+                LogFactory.GetLog("杞﹁韩杩囩偣").Info(true, $"\r\r--------------------------------------");
+                LogFactory.GetLog("杞﹁韩杩囩偣").Info(true, $"宸ヤ綅鍙�:{json.Position},RFID:{json.PVI},寮傚父淇℃伅:{ex.Message}");
                 return content.Error(ex.Message);
             }
         }

--
Gitblit v1.9.3