关于电池包更新

master
lxw 1 month ago
parent 1ddbb26429
commit 452e5129e9

@ -76,23 +76,29 @@ public class UpdateDownBatteryInfoTask : ITask
continue; continue;
} }
/*if (!info.BatteryNo.Equals(battery.DownBatteryNo))
{
continue;
}*/
battery.DownBatteryNo = info.BatteryNo; battery.DownBatteryNo = info.BatteryNo;
battery.DownBatterySoc = info.Soc; battery.DownBatterySoc = info.Soc;
battery.DownBatterySoe = info.Soe; battery.DownBatterySoe = info.Soe;
battery.DownNominalEnergy = info.NominalEnergy; battery.DownNominalEnergy = info.NominalEnergy;
_swapOrderBatteryRepository.Update(i => new()
updateDbBattery.Add(battery);
}
if (updateDbBattery.Count > 0)
{ {
DownBatteryNo = battery.DownBatteryNo,
DownBatterySoc = battery.DownBatterySoc,
DownBatterySoe = battery.DownBatterySoe,
DownNominalEnergy = battery.DownNominalEnergy
}, i => i.Id == battery.Id);
Log.Info( Log.Info(
$" UpdateDownBatteryInfoTask update DowmBatteryInfo db={JsonConvert.SerializeObject(battery)}"); $" 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