预约锁仓的不充电

zw
rszn 6 months ago
parent 221eb378f9
commit 492fc06413

@ -112,7 +112,7 @@ namespace Entity.DbModel.Station
/// Nullable:True
/// </summary>
[SugarColumn(ColumnName = "amt_lock")]
public string AmtLock { get; set; }
public int? AmtLock { get; set; }
/// <summary>
/// Desc:soc

@ -44,7 +44,9 @@ public class ChargerService
return Result<bool>.Fail(@"充电机未连接");
}
return chargerClient.StartCharge();
byte chargeSoc = StaticStationInfo.ChargeSoc;
float chargePower = StaticStationInfo.ChargePower;
return chargerClient.StartCharge(chargeSoc, chargePower);
}
/// <summary>

@ -18,7 +18,6 @@ using Service.Charger.Msg.Charger.Req;
using Service.Charger.Msg.Charger.Resp;
using Service.Charger.Msg.Host.Req;
using Service.Charger.Msg.Host.Req.Bms;
using Service.Init;
namespace Service.Charger.Client;
@ -481,7 +480,7 @@ public class ChargerClient : TcpClient<IBaseHandler, Decoder, Encoder>
/// <summary>
///
/// </summary>
public Result<bool> StartCharge()
public Result<bool> StartCharge(byte chargeSoc, float chargePower)
{
if (string.IsNullOrWhiteSpace(BinNo))
{
@ -505,6 +504,11 @@ public class ChargerClient : TcpClient<IBaseHandler, Decoder, Encoder>
return Result<bool>.Fail($"charger-{BinNo} battery not exist");
}
if (binInfo.AmtLock == 1)
{
return Result<bool>.Fail($"仓-{BinNo} 被锁定");
}
if (binInfo.CanChargeFlag == 0)
{
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));
byte chargeSoc = StaticStationInfo.ChargeSoc;
float chargePower = StaticStationInfo.ChargePower;
Result<string> chargeOrderNo = SendRemoteStartCharging(chargeSoc, chargePower);
if (!chargeOrderNo.IsSuccess)
{

@ -153,8 +153,8 @@ public class AutoChargeTask : ITask
int number = 0;
foreach (var binInfo in canChargeList)
{
Result<string>? result = ClientMgr.GetBySn(binInfo.ChargerNo)
?.SendRemoteStartCharging(chargeSoc, chargePower);
Result<bool>? result = ClientMgr.GetBySn(binInfo.ChargerNo)
?.StartCharge(chargeSoc, chargePower);
if (result is { IsSuccess: true })
{
Log.Info($"auto start charge {binInfo.ChargerNo}");

Loading…
Cancel
Save