|
|
@ -76,25 +76,31 @@ 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);
|
|
|
|
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)}");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
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);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|