From 4a468d137fc9b89a6f56678773460a9bcb63c980 Mon Sep 17 00:00:00 2001 From: tq <1916474859@qq,com> Date: Tue, 22 Oct 2024 11:37:17 +0800 Subject: [PATCH] =?UTF-8?q?=E7=94=B5=E9=87=8F=E5=B7=AE=E5=80=BC=E8=AE=A1?= =?UTF-8?q?=E7=AE=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- WebStarter/Controllers/SwapOrderController.cs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) 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(); } }