|
|
|
@ -61,17 +61,17 @@ public class UpdateDownBatteryInfoTask : ITask
|
|
|
|
|
//更新换下电池包
|
|
|
|
|
binInfosMap.TryGetValue(battery.DownBatteryBinNo.ToString(), out BinInfo info);
|
|
|
|
|
|
|
|
|
|
if (info==null)
|
|
|
|
|
if (info == null)
|
|
|
|
|
{
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (info.BatteryNo == null || "".Equals(info.BatteryNo )|| "-1".Equals(info.BatteryNo))
|
|
|
|
|
if (info.BatteryNo == null || "".Equals(info.BatteryNo) || "-1".Equals(info.BatteryNo))
|
|
|
|
|
{
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (info.Soc == null || info.Soc <= 0 || info.Soc > 100 || info.NominalEnergy<=0)
|
|
|
|
|
if (info.Soc == null || info.Soc <= 0 || info.Soc > 100 || info.NominalEnergy <= 0)
|
|
|
|
|
{
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
@ -84,16 +84,19 @@ public class UpdateDownBatteryInfoTask : ITask
|
|
|
|
|
battery.DownBatterySoc = info.Soc;
|
|
|
|
|
battery.DownBatterySoe = info.Soe;
|
|
|
|
|
battery.DownNominalEnergy = info.NominalEnergy;
|
|
|
|
|
_swapOrderBatteryRepository.Update(i => new()
|
|
|
|
|
{
|
|
|
|
|
DownBatteryNo = battery.DownBatteryNo,
|
|
|
|
|
DownBatterySoc = battery.DownBatterySoc,
|
|
|
|
|
DownBatterySoe = battery.DownBatterySoe,
|
|
|
|
|
DownNominalEnergy = battery.DownNominalEnergy
|
|
|
|
|
}, i => i.Id == battery.Id);
|
|
|
|
|
Log.Info(
|
|
|
|
|
$" UpdateDownBatteryInfoTask update DowmBatteryInfo db={JsonConvert.SerializeObject(battery)}");
|
|
|
|
|
|
|
|
|
|
updateDbBattery.Add(battery);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (updateDbBattery.Count > 0)
|
|
|
|
|
{
|
|
|
|
|
Log.Info(
|
|
|
|
|
$" UpdateDownBatteryInfoTask update DowmBatteryInfo db={JsonConvert.SerializeObject(updateDbBattery)}");
|
|
|
|
|
_swapOrderBatteryRepository.Update(updateDbBattery);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
catch (Exception e)
|
|
|
|
|
{
|
|
|
|
|