|
|
|
@ -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);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|