From 4ed084a2203546bdfb4770622eb0c15f54633d0d Mon Sep 17 00:00:00 2001 From: tq <1916474859@qq,com> Date: Fri, 11 Oct 2024 16:57:38 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8D=A2=E7=94=B5=E8=AE=A2=E5=8D=95=E9=87=91?= =?UTF-8?q?=E9=A2=9D=E5=AF=BC=E5=87=BA=E8=BD=AC=E5=85=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- WebStarter/Controllers/SwapOrderController.cs | 77 +++++++++++++++++++ 1 file changed, 77 insertions(+) diff --git a/WebStarter/Controllers/SwapOrderController.cs b/WebStarter/Controllers/SwapOrderController.cs index c90650f..9f0ad34 100644 --- a/WebStarter/Controllers/SwapOrderController.cs +++ b/WebStarter/Controllers/SwapOrderController.cs @@ -65,6 +65,34 @@ public class SwapOrderController : ControllerBase PackageSwapOrder(swapOrderResp); List? list = swapOrderResp.Rows; + + if (list!=null) + { + foreach (var swapOrder in list) + { + if (swapOrder.ServiceTotalFee.HasValue && swapOrder.ServiceTotalFee.Value != 0) + { + swapOrder.ServiceTotalFee = swapOrder.ServiceTotalFee / 100; + } + + if (swapOrder.ElectricityTotalFee.HasValue && swapOrder.ElectricityTotalFee.Value != 0) + { + swapOrder.ElectricityTotalFee = swapOrder.ElectricityTotalFee / 100; + } + + if (swapOrder.AppendTotalFee.HasValue && swapOrder.AppendTotalFee.Value != 0) + { + swapOrder.AppendTotalFee = swapOrder.AppendTotalFee / 100; + } + + if (swapOrder.TotalFee.HasValue && swapOrder.TotalFee.Value != 0) + { + swapOrder.TotalFee = swapOrder.TotalFee / 100; + } + } + } + + List vehicleNoList = list?.Select(resp => resp.VehicleNo).ToList() ?? new List(); // 查询车辆的部门 List vehicleList = await _baseVehicleRepository @@ -140,6 +168,33 @@ public class SwapOrderController : ControllerBase Log.Info($"查询换电订单 SwapOrderController end QueryPage swapOrderService.QuerySwapOrder req={req}"); PackageSwapOrder(swapOrderResp); + List? list = swapOrderResp.Rows; + + if (list!=null) + { + foreach (var swapOrder in list) + { + if (swapOrder.ServiceTotalFee.HasValue && swapOrder.ServiceTotalFee.Value != 0) + { + swapOrder.ServiceTotalFee = swapOrder.ServiceTotalFee / 100; + } + + if (swapOrder.ElectricityTotalFee.HasValue && swapOrder.ElectricityTotalFee.Value != 0) + { + swapOrder.ElectricityTotalFee = swapOrder.ElectricityTotalFee / 100; + } + + if (swapOrder.AppendTotalFee.HasValue && swapOrder.AppendTotalFee.Value != 0) + { + swapOrder.AppendTotalFee = swapOrder.AppendTotalFee / 100; + } + + if (swapOrder.TotalFee.HasValue && swapOrder.TotalFee.Value != 0) + { + swapOrder.TotalFee = swapOrder.TotalFee / 100; + } + } + } return Result>.Success(swapOrderResp); } @@ -411,7 +466,29 @@ public class SwapOrderController : ControllerBase var language = Request.Headers["Accept-Language"].ToString().ToLower(); List orderList = await swapOrderService.QuerySwapOrderListAsync(req); + foreach (var swapOrder in orderList) + { + if (swapOrder.ServiceTotalFee.HasValue && swapOrder.ServiceTotalFee.Value != 0) + { + swapOrder.ServiceTotalFee = swapOrder.ServiceTotalFee / 100; + } + + if (swapOrder.ElectricityTotalFee.HasValue && swapOrder.ElectricityTotalFee.Value != 0) + { + swapOrder.ElectricityTotalFee = swapOrder.ElectricityTotalFee / 100; + } + if (swapOrder.AppendTotalFee.HasValue && swapOrder.AppendTotalFee.Value != 0) + { + swapOrder.AppendTotalFee = swapOrder.AppendTotalFee / 100; + } + + if (swapOrder.TotalFee.HasValue && swapOrder.TotalFee.Value != 0) + { + swapOrder.TotalFee = swapOrder.TotalFee / 100; + } + } + // 获取所有订单号 var orderSns = orderList.Select(row => row.Sn).ToList();