diff --git a/Service/Charger/MyTask/AutoChargeTask.cs b/Service/Charger/MyTask/AutoChargeTask.cs index c4b8f2c..488b17c 100644 --- a/Service/Charger/MyTask/AutoChargeTask.cs +++ b/Service/Charger/MyTask/AutoChargeTask.cs @@ -182,18 +182,22 @@ public class AutoChargeTask : ITask { float? chargePower = EquipInfoRepository.QueryPowerByCode(binInfo.ChargerNo); float? power = chargePower == null ? StaticStationInfo.ChargePower : chargePower; - Result? result = ClientMgr.GetBySn(binInfo.ChargerNo) - ?.StartCharge(chargeSoc, (float)power); - if (result is { IsSuccess: true }) + if (binInfo.ChargeStatus != 1) { - Log.Info($"auto start charge {binInfo.ChargerNo}"); - number++; - } - - if (count == number) - { - Log.Info($"auto start charge count {count}"); - break; + //没有充电时候在充电 + Result? result = ClientMgr.GetBySn(binInfo.ChargerNo) + ?.StartCharge(chargeSoc, (float)power); + if (result is { IsSuccess: true }) + { + Log.Info($"auto start charge {binInfo.ChargerNo}"); + number++; + } + + if (count == number) + { + Log.Info($"auto start charge count {count}"); + break; + } } } } @@ -202,12 +206,11 @@ public class AutoChargeTask : ITask foreach (var VARIABLE in chargingList) { - if (StaticStationInfo.ChargeSoc != 100) - if (VARIABLE.Soc >= (StaticStationInfo.ChargeSoc + 1)) - { - Log.Info($"auto stop charge {VARIABLE.No} soc>=chaegeSoc+1 soc:{VARIABLE.Soc}"); - ClientMgr.GetBySn(VARIABLE.No)?.SendRemoteStopCharging(); - } + if (VARIABLE.Soc >= (StaticStationInfo.ChargeSoc + 1)) + { + Log.Info($"auto stop charge {VARIABLE.No} soc>=chaegeSoc+1 soc:{VARIABLE.Soc}"); + ClientMgr.GetBySn(VARIABLE.No)?.SendRemoteStopCharging(); + } } #endregion