|
|
@ -18,7 +18,6 @@ using Service.Charger.Msg.Charger.Req;
|
|
|
|
using Service.Charger.Msg.Charger.Resp;
|
|
|
|
using Service.Charger.Msg.Charger.Resp;
|
|
|
|
using Service.Charger.Msg.Host.Req;
|
|
|
|
using Service.Charger.Msg.Host.Req;
|
|
|
|
using Service.Charger.Msg.Host.Req.Bms;
|
|
|
|
using Service.Charger.Msg.Host.Req.Bms;
|
|
|
|
using Service.Init;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
namespace Service.Charger.Client;
|
|
|
|
namespace Service.Charger.Client;
|
|
|
|
|
|
|
|
|
|
|
@ -481,7 +480,7 @@ public class ChargerClient : TcpClient<IBaseHandler, Decoder, Encoder>
|
|
|
|
/// <summary>
|
|
|
|
/// <summary>
|
|
|
|
///
|
|
|
|
///
|
|
|
|
/// </summary>
|
|
|
|
/// </summary>
|
|
|
|
public Result<bool> StartCharge()
|
|
|
|
public Result<bool> StartCharge(byte chargeSoc, float chargePower)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (string.IsNullOrWhiteSpace(BinNo))
|
|
|
|
if (string.IsNullOrWhiteSpace(BinNo))
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -505,7 +504,12 @@ public class ChargerClient : TcpClient<IBaseHandler, Decoder, Encoder>
|
|
|
|
return Result<bool>.Fail($"charger-{BinNo} battery not exist");
|
|
|
|
return Result<bool>.Fail($"charger-{BinNo} battery not exist");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (binInfo.CanChargeFlag == 0)
|
|
|
|
if (binInfo.AmtLock == 1)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
return Result<bool>.Fail($"仓-{BinNo} 被锁定");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (binInfo.CanChargeFlag == 0)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return Result<bool>.Fail($"仓-{BinNo} 被禁用");
|
|
|
|
return Result<bool>.Fail($"仓-{BinNo} 被禁用");
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -520,8 +524,6 @@ public class ChargerClient : TcpClient<IBaseHandler, Decoder, Encoder>
|
|
|
|
|
|
|
|
|
|
|
|
redisHelper.SetKeyValueStr($"chargeNo{BinNo}Start", DateTime.Now.ToString("f"), TimeSpan.FromMinutes(1));
|
|
|
|
redisHelper.SetKeyValueStr($"chargeNo{BinNo}Start", DateTime.Now.ToString("f"), TimeSpan.FromMinutes(1));
|
|
|
|
|
|
|
|
|
|
|
|
byte chargeSoc = StaticStationInfo.ChargeSoc;
|
|
|
|
|
|
|
|
float chargePower = StaticStationInfo.ChargePower;
|
|
|
|
|
|
|
|
Result<string> chargeOrderNo = SendRemoteStartCharging(chargeSoc, chargePower);
|
|
|
|
Result<string> chargeOrderNo = SendRemoteStartCharging(chargeSoc, chargePower);
|
|
|
|
if (!chargeOrderNo.IsSuccess)
|
|
|
|
if (!chargeOrderNo.IsSuccess)
|
|
|
|
{
|
|
|
|
{
|
|
|
|