|
@@ -303,7 +303,7 @@ namespace centralController.WebServer
|
|
|
returnMsg = new MessageUTF8();
|
|
|
int id = 0;
|
|
|
int countdown = 2;
|
|
|
- bool success = true;
|
|
|
+ int resultCode = 8;
|
|
|
//根据号牌寻找对应号牌机编号,找不到则返回失败信息
|
|
|
if (msg.context != "" && msg.userID != "")
|
|
|
{
|
|
@@ -322,21 +322,43 @@ namespace centralController.WebServer
|
|
|
{
|
|
|
try
|
|
|
{
|
|
|
- success = TerminalSimul.ParkTermOper(id, msg.context);
|
|
|
+ resultCode = TerminalSimul.ParkTermOper(id, msg.context);
|
|
|
}
|
|
|
- catch { success = false; }
|
|
|
+ catch { resultCode = 8; }
|
|
|
}
|
|
|
- else { success = false; }
|
|
|
+ else { resultCode = 1; }
|
|
|
Thread.Sleep(1500);
|
|
|
- if (success)
|
|
|
+ switch (resultCode)
|
|
|
{
|
|
|
- returnMsg.cmd = "PARKOK";
|
|
|
- Monitor.Monitor.SetNotification("车辆" + msg.context.Split('.')[2] + "正在进行停车", parkMonitor.model.TextColor.Info);
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- returnMsg.cmd = "PARKFAILED";
|
|
|
- Monitor.Monitor.SetNotification("未识别到车辆" + msg.context.Split('.')[2] + "停放位置,请确认车辆已入场", parkMonitor.model.TextColor.Warning);
|
|
|
+ case 0:
|
|
|
+ returnMsg.cmd = "PARKOK";
|
|
|
+ Monitor.Monitor.SetNotification("车辆" + msg.context.Split('.')[2] + ",终端" + id + "正在进行停车", parkMonitor.model.TextColor.Info); break;
|
|
|
+ case 1:
|
|
|
+ returnMsg.cmd = "PARKFAILED";
|
|
|
+ Monitor.Monitor.SetNotification("未识别到车辆" + msg.context.Split('.')[2] + ",终端" + id + "停放位置,请确认车辆已入场", parkMonitor.model.TextColor.Warning); break;
|
|
|
+ case 2:
|
|
|
+ returnMsg.cmd = "PARKFAILED";
|
|
|
+ Monitor.Monitor.SetNotification("车辆" + msg.context.Split('.')[2] + ",终端" + id + "生成凭证号失败", parkMonitor.model.TextColor.Warning); break;
|
|
|
+ case 3:
|
|
|
+ returnMsg.cmd = "PARKFAILED";
|
|
|
+ Monitor.Monitor.SetNotification("车辆" + msg.context.Split('.')[2] + ",终端" + id + "凭证转换异常", parkMonitor.model.TextColor.Warning); break;
|
|
|
+ case 4:
|
|
|
+ returnMsg.cmd = "PARKFAILED";
|
|
|
+ Monitor.Monitor.SetNotification("车辆" + msg.context.Split('.')[2] + ",终端" + id + "停车码解析异常", parkMonitor.model.TextColor.Warning); break;
|
|
|
+ case 5:
|
|
|
+ returnMsg.cmd = "PARKFAILED";
|
|
|
+ Monitor.Monitor.SetNotification("车辆" + msg.context.Split('.')[2] + ",终端" + id + "地感异常,当前位置无地感", parkMonitor.model.TextColor.Warning); break;
|
|
|
+ case 6:
|
|
|
+ returnMsg.cmd = "PARKFAILED";
|
|
|
+ Monitor.Monitor.SetNotification("车辆" + msg.context.Split('.')[2] + ",终端" + id + "状态异常,非停车终端", parkMonitor.model.TextColor.Warning); break;
|
|
|
+ case 7:
|
|
|
+ returnMsg.cmd = "PARKFAILED";
|
|
|
+ Monitor.Monitor.SetNotification("车辆" + msg.context.Split('.')[2] + ",终端" + id + "状态异常,已有停车指令在处理中", parkMonitor.model.TextColor.Warning); break;
|
|
|
+ case 8:
|
|
|
+ returnMsg.cmd = "PARKFAILED";
|
|
|
+ Monitor.Monitor.SetNotification("车辆" + msg.context.Split('.')[2] + ",终端" + id + "其他异常", parkMonitor.model.TextColor.Warning);
|
|
|
+ Log.WriteLog(LogType.process, LogFile.ERROR, "凭证号" + msg.context + "出现未知异常,无法停车"); break;
|
|
|
+
|
|
|
}
|
|
|
returnMsg.userID = msg.userID;
|
|
|
returnMsg.garageID = Monitor.Monitor.garageID;
|
|
@@ -349,17 +371,29 @@ namespace centralController.WebServer
|
|
|
lock (fetchLock)
|
|
|
{
|
|
|
returnMsg = new MessageUTF8();
|
|
|
- bool success = TerminalSimul.FetchTermOper(msg.context);
|
|
|
+ int resultCode = TerminalSimul.FetchTermOper(msg.context);
|
|
|
Thread.Sleep(1500);
|
|
|
- if (success)
|
|
|
- {
|
|
|
- returnMsg.cmd = "FETCHOK";
|
|
|
- Monitor.Monitor.SetNotification("凭证号" + msg.context + "正在取车", parkMonitor.model.TextColor.Info);
|
|
|
- }
|
|
|
- else
|
|
|
+ switch (resultCode)
|
|
|
{
|
|
|
- returnMsg.cmd = "FETCHFAILED";
|
|
|
- Monitor.Monitor.SetNotification("凭证号" + msg.context + "异常,无法解析", parkMonitor.model.TextColor.Warning);
|
|
|
+ case 0:
|
|
|
+ returnMsg.cmd = "FETCHOK";
|
|
|
+ Monitor.Monitor.SetNotification("凭证号" + msg.context + "正在取车", parkMonitor.model.TextColor.Info); break;
|
|
|
+ case 1:
|
|
|
+ returnMsg.cmd = "FETCHFAILED";
|
|
|
+ Monitor.Monitor.SetNotification("凭证号" + msg.context + "地感异常,有地感时无法取车", parkMonitor.model.TextColor.Warning); break;
|
|
|
+ case 2:
|
|
|
+ returnMsg.cmd = "FETCHFAILED";
|
|
|
+ Monitor.Monitor.SetNotification("凭证号" + msg.context + "终端状态异常,当前非取车终端", parkMonitor.model.TextColor.Warning); break;
|
|
|
+ case 3:
|
|
|
+ returnMsg.cmd = "FETCHFAILED";
|
|
|
+ Monitor.Monitor.SetNotification("凭证号" + msg.context + "指令占用异常,已有取车指令在处理中", parkMonitor.model.TextColor.Warning); break;
|
|
|
+ case 4:
|
|
|
+ returnMsg.cmd = "FETCHFAILED";
|
|
|
+ Monitor.Monitor.SetNotification("凭证号" + msg.context + "凭证解析异常,无法解析该凭证号", parkMonitor.model.TextColor.Warning); break;
|
|
|
+ case 5:
|
|
|
+ returnMsg.cmd = "FETCHFAILED";
|
|
|
+ Monitor.Monitor.SetNotification("凭证号" + msg.context + "其他异常", parkMonitor.model.TextColor.Warning);
|
|
|
+ Log.WriteLog(LogType.process, LogFile.ERROR, "凭证号" + msg.context + "出现未知异常,无法取车"); break;
|
|
|
}
|
|
|
returnMsg.userID = msg.userID;
|
|
|
returnMsg.garageID = Monitor.Monitor.garageID;
|