关于电池包更新

master
lxw 1 month ago
parent 1ddbb26429
commit 452e5129e9

@ -76,25 +76,31 @@ public class UpdateDownBatteryInfoTask : ITask
continue;
}
/*if (!info.BatteryNo.Equals(battery.DownBatteryNo))
{
continue;
}*/
battery.DownBatteryNo = info.BatteryNo;
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)}");
foreach (var swapOrderBattery in updateDbBattery)
{
_swapOrderBatteryRepository.Update(i => new()
{
DownBatteryNo = swapOrderBattery.DownBatteryNo,
DownBatterySoc = swapOrderBattery.DownBatterySoc,
DownBatterySoe = swapOrderBattery.DownBatterySoe,
DownNominalEnergy = swapOrderBattery.DownNominalEnergy
}, i => i.Id == swapOrderBattery.Id);
}
}
}

Loading…
Cancel
Save