|
|
|
@ -35,9 +35,10 @@ public class CarController : ControllerBase
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 锁车
|
|
|
|
|
/// 加锁
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns>发送结果</returns>
|
|
|
|
|
/// <param name="carNo">vin码</param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
[HttpGet("/lock/{carNo}")]
|
|
|
|
|
public bool Lock(string carNo)
|
|
|
|
|
{
|
|
|
|
@ -47,19 +48,20 @@ public class CarController : ControllerBase
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
CarServerMgr.CarServer.LockMsgResp = null;
|
|
|
|
|
SessionMgr.Broadcast(new LockMsg()
|
|
|
|
|
var lockMsg = new LockMsg()
|
|
|
|
|
{
|
|
|
|
|
CarNo = carNo
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
CarServerMgr.CarServer.LockMsgPair.Req = lockMsg;
|
|
|
|
|
SessionMgr.Broadcast(lockMsg);
|
|
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
return CarServerMgr.CarServer.LockMsgPair.GetResp(TimeSpan.FromMinutes(1))?.Result == 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
///
|
|
|
|
|
/// 解锁
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="carNo"></param>
|
|
|
|
|
/// <param name="carNo">vin码</param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
[HttpGet("/unLock/{carNo}")]
|
|
|
|
|
public bool UnLock(string carNo)
|
|
|
|
@ -70,19 +72,21 @@ public class CarController : ControllerBase
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
CarServerMgr.CarServer.UnLockMsgResp = null;
|
|
|
|
|
SessionMgr.Broadcast(new UnLockMsg()
|
|
|
|
|
UnLockMsg unLockMsg = new UnLockMsg()
|
|
|
|
|
{
|
|
|
|
|
CarNo = carNo
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
CarServerMgr.CarServer.UnLockMsgPair.Req = unLockMsg;
|
|
|
|
|
SessionMgr.Broadcast(unLockMsg);
|
|
|
|
|
|
|
|
|
|
return CarServerMgr.CarServer.UnLockMsgPair.GetResp(TimeSpan.FromMinutes(1))?.Result == 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
///
|
|
|
|
|
/// 结算
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="carNo"></param>
|
|
|
|
|
/// <param name="carNo">vin码</param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
[HttpGet("/SettleConfirm/{carNo}")]
|
|
|
|
|
public bool SettleConfirm(string carNo)
|
|
|
|
@ -93,10 +97,11 @@ public class CarController : ControllerBase
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
CarServerMgr.CarServer.SettleConfirmMsgResp = null;
|
|
|
|
|
SessionMgr.Broadcast(new SettleConfirmMsg() { CarNo = carNo });
|
|
|
|
|
var settleConfirmMsg = new SettleConfirmMsg() { CarNo = carNo };
|
|
|
|
|
CarServerMgr.CarServer.SettleConfirmMsgPair.Req = settleConfirmMsg;
|
|
|
|
|
SessionMgr.Broadcast(settleConfirmMsg);
|
|
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
return CarServerMgr.CarServer.SettleConfirmMsgPair.GetResp(TimeSpan.FromMinutes(1))?.Result == 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
@ -112,7 +117,6 @@ public class CarController : ControllerBase
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
CarServerMgr.CarServer.SetParamMsgResp = null;
|
|
|
|
|
SetParamMsg setParamMsg = new SetParamMsg()
|
|
|
|
|
{
|
|
|
|
|
AccDischargeCount = setParam.AccDischargeCount,
|
|
|
|
@ -129,9 +133,10 @@ public class CarController : ControllerBase
|
|
|
|
|
LastTimeBalanceKgce = setParam.LastTimeBalanceKgce,
|
|
|
|
|
ElectricityToBeSettled = setParam.ElectricityToBeSettled,
|
|
|
|
|
};
|
|
|
|
|
CarServerMgr.CarServer.SetParamMsgPair.Req = setParamMsg;
|
|
|
|
|
SessionMgr.Broadcast(setParamMsg);
|
|
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
return CarServerMgr.CarServer.SetParamMsgPair.GetResp(TimeSpan.FromMinutes(1))?.Result ==0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|