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();