From 37d02df69d8e9d7c4f30e069a8f6caa3e47a5de7 Mon Sep 17 00:00:00 2001
From: huangxiaoqiang <huangxiaoqiang@hnkhzn.com>
Date: 星期四, 26 六月 2025 10:52:59 +0800
Subject: [PATCH] 1
---
项目代码/WMS/WIDESEA_WMSServer/WIDESEA_StoragIntegrationServices/AGV/AGVService.cs | 40 ++++++++++++++++++++++++++++++++++++++--
1 files changed, 38 insertions(+), 2 deletions(-)
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StoragIntegrationServices/AGV/AGVService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StoragIntegrationServices/AGV/AGVService.cs"
index 61d7523..5e18cd1 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StoragIntegrationServices/AGV/AGVService.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_StoragIntegrationServices/AGV/AGVService.cs"
@@ -33,8 +33,9 @@
private readonly IMapper _mapper;
private readonly IDt_DeviceInfoRepository _deviceInfoRepository;
private readonly IDt_HandAutomaticRepository _handAutomaticRepository;
+ private readonly IDt_ErrorDescriptionRepository _descriptionRepository;
- public AGVService(ILocationInfoRepository locationRepository, IDt_TaskRepository taskRepository, IDt_StationManagerRepository stationManagerRepository, IDt_DeviceInfoRepository deviceInfoRepository, IMapper mapper, SocketClientService socketClientService, IDt_TaskService taskService, IDt_HandAutomaticRepository handAutomaticRepository)
+ public AGVService(ILocationInfoRepository locationRepository, IDt_TaskRepository taskRepository, IDt_StationManagerRepository stationManagerRepository, IDt_DeviceInfoRepository deviceInfoRepository, IMapper mapper, SocketClientService socketClientService, IDt_TaskService taskService, IDt_HandAutomaticRepository handAutomaticRepository, IDt_ErrorDescriptionRepository descriptionRepository)
{
_locationRepository = locationRepository;
BaseDal = taskRepository;
@@ -44,6 +45,7 @@
_Socket = socketClientService;
_taskService = taskService;
_handAutomaticRepository = handAutomaticRepository;
+ _descriptionRepository = descriptionRepository;
}
#region 澶栭儴鎺ュ彛鏂规硶
@@ -492,6 +494,7 @@
WebResponseContent content = new WebResponseContent();
try
{
+ LogFactory.GetLog("AGV寮傚父淇℃伅").InfoFormat(true, $"璇锋眰鍙傛暟锛歿JsonConvert.SerializeObject(aGVDTO)}", "");
var task = BaseDal.QueryFirst(x => x.TaskNum ==Convert.ToInt32( aGVDTO.TaskNum));
if (task != null)
{
@@ -534,11 +537,11 @@
default: break;
}
}
- LogFactory.GetLog("AGV寮傚父淇℃伅").InfoFormat(true, $"璇锋眰鍙傛暟锛歿JsonConvert.SerializeObject(aGVDTO)}", "");
return content.OK();
}
catch (Exception ex)
{
+ LogFactory.GetLog("AGV寮傚父淇℃伅").InfoFormat(true, $"璇锋眰鍙傛暟锛歿JsonConvert.SerializeObject(ex.Message)}", "");
return content.Error(ex.Message);
}
}
@@ -555,6 +558,39 @@
return "";
}
}
+
+ public WebResponseContent DeviceWarning(AGVDTO DTO)
+ {
+ WebResponseContent content = new WebResponseContent();
+ try
+ {
+ LogFactory.GetLog("AG涓婁紶鎶ヨ淇℃伅").InfoFormat(true, $"璇锋眰鍙傛暟锛歿JsonConvert.SerializeObject(DTO)}", "");
+ if (DTO.Message!= null)
+ {
+ Dt_ErrorDescription description=_descriptionRepository.QueryFirst(x => x.Type == DTO.Message);
+ if(description != null)
+ {
+ _Socket.ErrorReport(description.ErrorCode, "A", "00");
+ _Socket.AddErrorMessage(description.ErrorCode, "AGV", "");
+ return content.OK();
+ }
+ else
+ {
+ return content.Error("鏈瘑鍒姤璀︽簮");
+ }
+ }
+ else
+ {
+ return content.Error("鏈帴鏀跺埌寮傚父淇℃伅");
+ }
+ }
+ catch (Exception ex)
+ {
+ LogFactory.GetLog("AG涓婁紶鎶ヨ淇℃伅").InfoFormat(true, $"璇锋眰鍙傛暟锛歿JsonConvert.SerializeObject(ex.Message)}", "");
+ return content.Error(ex.Message);
+ }
+
+ }
#endregion 澶栭儴鎺ュ彛鏂规硶
}
}
--
Gitblit v1.9.3