|
@@ -189,7 +189,9 @@ namespace Terminal
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
+ //Log.WriteLog(LogType.database, "update, query: \n");
|
|
|
reader = Monitor.Monitor.remoteDBOper.Query(checkVehicleState);
|
|
|
+ //Log.WriteLog(LogType.database, "update, query: \n" + checkVehicleState);
|
|
|
}
|
|
|
if (reader != null)
|
|
|
{
|
|
@@ -232,8 +234,10 @@ namespace Terminal
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
+ //Log.WriteLog(LogType.database, "update, update: \n");
|
|
|
list.Add(updateRemoteVehicleState);
|
|
|
Monitor.Monitor.remoteDBOper.UpdateTransaction(list);
|
|
|
+ //Log.WriteLog(LogType.database, "update, update: \n" + updateRemoteVehicleState);
|
|
|
}
|
|
|
}
|
|
|
else
|
|
@@ -384,7 +388,7 @@ namespace Terminal
|
|
|
readerTest.Dispose();
|
|
|
}
|
|
|
catch { }
|
|
|
- string userInfoCheckSql = "select * from usercarrelation where userID = '" + userID + "'and numberPlate = '" + license + "';";
|
|
|
+ string userInfoCheckSql = "select * from usercarrelation where userID = '" + userID + "' and numberPlate = '" + license + "';";
|
|
|
MySqlDataReader reader = Monitor.Monitor.remoteDBOper.Query(userInfoCheckSql);
|
|
|
if (reader != null && reader.Read() && reader.HasRows && userID != 0 && license != "")
|
|
|
{
|
|
@@ -545,7 +549,7 @@ namespace Terminal
|
|
|
}
|
|
|
}
|
|
|
catch (Exception e) { Log.WriteLog(LogType.process, LogFile.ERROR, "号牌" + license + "记录号牌异常\n" + e.StackTrace); }
|
|
|
-
|
|
|
+
|
|
|
}
|
|
|
Log.WriteLog(LogType.process, LogFile.INFO, "号牌" + license + "已记录");
|
|
|
////未获得号牌,告知PLC终止,告诉终端提示用户重新操作
|
|
@@ -739,6 +743,12 @@ namespace Terminal
|
|
|
Monitor.Monitor.SetNotification("无车位或凭证号,车位:" + parkingSpaceID + ",凭证号:" + receipt, parkMonitor.model.TextColor.Warning);
|
|
|
return;
|
|
|
}
|
|
|
+
|
|
|
+ //中控清除车牌、凭证号、号牌验证等信息
|
|
|
+ ClearTerminal(term.terminalID, false);
|
|
|
+ //停车流程确保已清除中控块完成信号
|
|
|
+ ResetCompleteSignal();
|
|
|
+
|
|
|
UpdateVehicle(license, 0, 0, true, false, 0);
|
|
|
UpdateVehicle(license, 0, 0, true, true, 0);
|
|
|
//插入停车记录
|
|
@@ -762,8 +772,8 @@ namespace Terminal
|
|
|
int parkingRecordsID = 0;
|
|
|
int remoteParkingRecordsID = 0;
|
|
|
Monitor.Monitor.localDBOper.Insert(list, out parkingRecordsID);
|
|
|
- Monitor.Monitor.remoteDBOper.Insert(list, out remoteParkingRecordsID);
|
|
|
-
|
|
|
+ bool remote_insert_record = Monitor.Monitor.remoteDBOper.Insert(list, out remoteParkingRecordsID);
|
|
|
+ //Log.WriteLog(LogType.database, "insert, record: \n" + parkingRecordsSql);
|
|
|
//查询记录ID号
|
|
|
//string findRecordSql = "select parkingRecordsID from parkingrecords where receiptNum = " + term.receiptNum + ";";
|
|
|
//QueryParkingRecordsID(findRecordSql, out parkingRecordsID, false);
|
|
@@ -785,11 +795,8 @@ namespace Terminal
|
|
|
//{
|
|
|
// Thread.Sleep(1000);
|
|
|
//}
|
|
|
- //中控清除车牌、凭证号、号牌验证等信息
|
|
|
- ClearTerminal(term.terminalID, false);
|
|
|
- //停车流程确保已清除中控块完成信号
|
|
|
+
|
|
|
Thread.Sleep(500);
|
|
|
- ResetCompleteSignal();
|
|
|
try { idLicMap.Remove(currentTerm); }
|
|
|
catch { }
|
|
|
Monitor.Monitor.SetNotification(license + " 数据库已更新,停车流程结束", parkMonitor.model.TextColor.Info);
|
|
@@ -821,8 +828,9 @@ namespace Terminal
|
|
|
lockList[i] = true;
|
|
|
Action<int> reserveAction = new Action<int>(ReservedOper);
|
|
|
reserveAction(i);
|
|
|
- //找到停车终端,且无地感有按钮数据,空闲状态,清除按钮状态
|
|
|
- }else if(terminalInfo[i].terminalStatus == 1 && terminalInfo[i].groundStatus == 0 && terminalInfo[i].btnStatus != 0 && terminalInfo[i].cmd == 0)
|
|
|
+ //找到停车终端,且无地感有按钮数据,空闲状态,清除按钮状态
|
|
|
+ }
|
|
|
+ else if (terminalInfo[i].terminalStatus == 1 && terminalInfo[i].groundStatus == 0 && terminalInfo[i].btnStatus != 0 && terminalInfo[i].cmd == 0)
|
|
|
{
|
|
|
TerminalStru ts = new TerminalStru
|
|
|
{
|
|
@@ -925,8 +933,8 @@ namespace Terminal
|
|
|
Log.WriteLog(LogType.process, LogFile.ERROR, "收到地感后,尝试5次未拍到号牌。");
|
|
|
Thread.Sleep(200);
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
});
|
|
|
}
|
|
|
/// <summary>
|
|
@@ -968,7 +976,7 @@ namespace Terminal
|
|
|
Thread.Sleep(Monitor.Monitor.plcRefreshInterval * 5);
|
|
|
}
|
|
|
}
|
|
|
- catch(Exception e) { Log.WriteLog(LogType.process, LogFile.ERROR, "预约异常,"+e.Message+", "+e.StackTrace); }
|
|
|
+ catch (Exception e) { Log.WriteLog(LogType.process, LogFile.ERROR, "预约异常," + e.Message + ", " + e.StackTrace); }
|
|
|
Log.WriteLog(LogType.process, LogFile.ERROR, "预约线程退出");
|
|
|
});
|
|
|
}
|
|
@@ -1033,7 +1041,9 @@ namespace Terminal
|
|
|
recordID = 0;
|
|
|
bool result = false;
|
|
|
string remoteParkRecordsSql = "select parkingRecordsID from parkingrecords where receiptNum = " + receipt + ";";
|
|
|
+ //Log.WriteLog(LogType.database, "find record: \n");
|
|
|
MySqlDataReader reader = Monitor.Monitor.remoteDBOper.Query(remoteParkRecordsSql);
|
|
|
+ //Log.WriteLog(LogType.database, "find record: \n" + remoteParkRecordsSql);
|
|
|
try
|
|
|
{
|
|
|
if (reader != null && reader.Read())
|
|
@@ -1289,7 +1299,8 @@ namespace Terminal
|
|
|
TimeSpan orderTimeLength = new TimeSpan(0);
|
|
|
if (license != "")
|
|
|
{
|
|
|
- FindVipInfo(license, ref orderRecordsID, ref monthCardType, ref monthCardTimeLength, ref orderTimeLength);
|
|
|
+ bool getVIP = FindVipInfo(license, ref orderRecordsID, ref monthCardType, ref monthCardTimeLength, ref orderTimeLength);
|
|
|
+ //Log.WriteLog(LogType.database, "get vip: " + getVIP);
|
|
|
}
|
|
|
if (monthCardType == -1) monthCardType = 0;
|
|
|
//3.获取停车时刻,根据用户类型计费发送给PLC,暂认为无预约
|
|
@@ -1407,11 +1418,11 @@ namespace Terminal
|
|
|
}
|
|
|
//Log.WriteLog(LogType.process, LogFile.INFO, "检测到凭证号已被清除");
|
|
|
FetchInfo fi = null;
|
|
|
- UpdateAllParkingSpace(false);
|
|
|
ClearTerminal(termID, false);
|
|
|
//停车流程确保已清除中控块完成信号
|
|
|
Thread.Sleep(500);
|
|
|
ResetCompleteSignal();
|
|
|
+ UpdateAllParkingSpace(false);
|
|
|
if (fetchInfoMap.ContainsKey(termID))
|
|
|
{
|
|
|
fi = fetchInfoMap[termID];
|
|
@@ -1445,6 +1456,7 @@ namespace Terminal
|
|
|
}
|
|
|
lock (Monitor.Monitor.remoteDBOper)
|
|
|
{
|
|
|
+ //Log.WriteLog(LogType.database, "update fetch record: " + updateParkingRecordsSql);
|
|
|
Monitor.Monitor.remoteDBOper.UpdateTransaction(list);
|
|
|
UpdateVehicle(fi.license, 0, fi.remoteParkingRecordsID, false, true, 0);
|
|
|
}
|