diff --git a/WebStarter/Controllers/SwapOrderController.cs b/WebStarter/Controllers/SwapOrderController.cs index 9bb109c..5678d9c 100644 --- a/WebStarter/Controllers/SwapOrderController.cs +++ b/WebStarter/Controllers/SwapOrderController.cs @@ -104,10 +104,13 @@ public class SwapOrderController : ControllerBase swapOrder.DownBatteryElectricQuantity = ((double)swapOrder.DownBatterySoc * 3.75).ToString(); swapOrder.UpBatteryElectricQuantity = ((double)swapOrder.UpBatterySoc * 3.75).ToString(); - if (swapOrderBatteryResp.DownNominalEnergy!=null&&swapOrderBatteryResp.UpNominalEnergy!=null) + if (swapOrderBatteryResp.DownNominalEnergy!=null&&swapOrderBatteryResp.UpNominalEnergy!=null + &&swapOrderBatteryResp.UpBatterySoc!=null + &&swapOrderBatteryResp.DownBatterySoc!=null + ) { - swapOrder.ElectricQuantity = (swapOrderBatteryResp.UpNominalEnergy - - swapOrderBatteryResp.DownNominalEnergy).ToString(); + swapOrder.ElectricQuantity = (swapOrderBatteryResp.UpNominalEnergy* swapOrderBatteryResp.UpBatterySoc- + swapOrderBatteryResp.DownNominalEnergy*swapOrderBatteryResp.DownBatterySoc).ToString(); } }