|
|
@ -26,7 +26,7 @@ public class CarController : ControllerBase
|
|
|
|
{
|
|
|
|
{
|
|
|
|
CarInfoResp carInfoResp = new CarInfoResp()
|
|
|
|
CarInfoResp carInfoResp = new CarInfoResp()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Connected = CarServerMgr.CarServer?.Connected ?? false,
|
|
|
|
Connected = CarServerMgr.CarServer != null && CarServerMgr.CarServer.Connected,
|
|
|
|
CarNo = CarServerMgr.CarServer?.HeartBeatMsg?.CarNo,
|
|
|
|
CarNo = CarServerMgr.CarServer?.HeartBeatMsg?.CarNo,
|
|
|
|
ElecMsg = CarServerMgr.CarServer?.ElecMsg,
|
|
|
|
ElecMsg = CarServerMgr.CarServer?.ElecMsg,
|
|
|
|
HeartBeatMsg = CarServerMgr.CarServer?.HeartBeatMsg
|
|
|
|
HeartBeatMsg = CarServerMgr.CarServer?.HeartBeatMsg
|
|
|
@ -38,55 +38,63 @@ public class CarController : ControllerBase
|
|
|
|
/// 锁车
|
|
|
|
/// 锁车
|
|
|
|
/// </summary>
|
|
|
|
/// </summary>
|
|
|
|
/// <returns>发送结果</returns>
|
|
|
|
/// <returns>发送结果</returns>
|
|
|
|
[HttpGet("/lock")]
|
|
|
|
[HttpGet("/lock/{carNo}")]
|
|
|
|
public bool Lock()
|
|
|
|
public bool Lock(string carNo)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Log.Info("Lock ");
|
|
|
|
Log.Info("Lock ");
|
|
|
|
if (CarServerMgr.CarServer == null || (CarServerMgr.CarServer?.Connected ?? false))
|
|
|
|
if (CarServerMgr.CarServer == null || !CarServerMgr.CarServer.Connected)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
CarServerMgr.CarServer.LockMsgResp = null;
|
|
|
|
CarServerMgr.CarServer.LockMsgResp = null;
|
|
|
|
SessionMgr.Broadcast(new LockMsg());
|
|
|
|
SessionMgr.Broadcast(new LockMsg()
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
CarNo = carNo
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
return true;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// <summary>
|
|
|
|
/// 解锁
|
|
|
|
///
|
|
|
|
/// </summary>
|
|
|
|
/// </summary>
|
|
|
|
/// <returns>发送结果</returns>
|
|
|
|
/// <param name="carNo"></param>
|
|
|
|
[HttpGet("/unLock")]
|
|
|
|
/// <returns></returns>
|
|
|
|
public bool UnLock()
|
|
|
|
[HttpGet("/unLock/{carNo}")]
|
|
|
|
|
|
|
|
public bool UnLock(string carNo)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Log.Info("UnLock ");
|
|
|
|
Log.Info("UnLock ");
|
|
|
|
if (CarServerMgr.CarServer == null || (CarServerMgr.CarServer?.Connected ?? false))
|
|
|
|
if (CarServerMgr.CarServer == null || !CarServerMgr.CarServer.Connected)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
CarServerMgr.CarServer.UnLockMsgResp = null;
|
|
|
|
CarServerMgr.CarServer.UnLockMsgResp = null;
|
|
|
|
SessionMgr.Broadcast(new UnLockMsg());
|
|
|
|
SessionMgr.Broadcast(new UnLockMsg()
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
CarNo = carNo
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
return true;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// <summary>
|
|
|
|
/// 结算
|
|
|
|
///
|
|
|
|
/// </summary>
|
|
|
|
/// </summary>
|
|
|
|
/// <returns>发送结果</returns>
|
|
|
|
/// <param name="carNo"></param>
|
|
|
|
[HttpGet("/SettleConfirm")]
|
|
|
|
/// <returns></returns>
|
|
|
|
public bool SettleConfirm()
|
|
|
|
[HttpGet("/SettleConfirm/{carNo}")]
|
|
|
|
|
|
|
|
public bool SettleConfirm(string carNo)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Log.Info("SettleConfirm ");
|
|
|
|
Log.Info("SettleConfirm ");
|
|
|
|
if (CarServerMgr.CarServer == null || (CarServerMgr.CarServer?.Connected ?? false))
|
|
|
|
if (CarServerMgr.CarServer == null || !CarServerMgr.CarServer.Connected)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
CarServerMgr.CarServer.SettleConfirmMsgResp = null;
|
|
|
|
CarServerMgr.CarServer.SettleConfirmMsgResp = null;
|
|
|
|
SessionMgr.Broadcast(new SettleConfirmMsg());
|
|
|
|
SessionMgr.Broadcast(new SettleConfirmMsg() { CarNo = carNo });
|
|
|
|
|
|
|
|
|
|
|
|
return true;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -99,7 +107,7 @@ public class CarController : ControllerBase
|
|
|
|
public bool SetParam(SetParam setParam)
|
|
|
|
public bool SetParam(SetParam setParam)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Log.Info("SetParam");
|
|
|
|
Log.Info("SetParam");
|
|
|
|
if (CarServerMgr.CarServer == null || (CarServerMgr.CarServer?.Connected ?? false))
|
|
|
|
if (CarServerMgr.CarServer == null || !CarServerMgr.CarServer.Connected)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|