From 5f75a12d74d353470381c0d6a39affb0a61e0ad1 Mon Sep 17 00:00:00 2001
From: WINDOWS-F96JH03\Kain <MrTianDeLe@163.com>
Date: 星期二, 17 三月 2026 14:39:10 +0800
Subject: [PATCH] 1
---
项目代码/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..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"
@@ -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},鍝嶅簲淇℃伅:{responseContent.ToJson}");
- 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