|
|
|
@ -153,7 +153,23 @@ public class AutoChargeTask : ITask
|
|
|
|
|
List<BinInfo> chargingList = binInfos.Where(it => it.ChargeStatus == 1).ToList();
|
|
|
|
|
Log.Info(
|
|
|
|
|
$"chargingList={JsonConvert.SerializeObject(chargingList.Select(info => info.Code + "," + info.ChargerNo).ToList())}");
|
|
|
|
|
if (canSwapList.Count <= needBatteryCount)
|
|
|
|
|
|
|
|
|
|
#region 现有电池满足需求 停止正在充电的电池
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (canSwapList.Count >= needBatteryCount)
|
|
|
|
|
{
|
|
|
|
|
Log.Info($"can swap count {canSwapList.Count} > {needBatteryCount}, all stop={JsonConvert.SerializeObject(chargingList.Select(info => info.Code + "," + info.ChargerNo).ToList())}");
|
|
|
|
|
foreach (var t in chargingList)
|
|
|
|
|
{
|
|
|
|
|
Log.Info($"auto stop charge {t.No}");
|
|
|
|
|
ClientMgr.GetBySn(t.ChargerNo)?.SendRemoteStopCharging();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|
if (canSwapList.Count < needBatteryCount)
|
|
|
|
|
{
|
|
|
|
|
List<BinInfo> canChargeList = binInfos.Where(it =>
|
|
|
|
|
it.Soc != null && Convert.ToSingle(it.Soc) < StaticStationInfo.SwapSoc &&
|
|
|
|
|