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