From e345544f0a1b9f7d7f7d5f584207090c971ae51a Mon Sep 17 00:00:00 2001
From: 无关风月 <443237572@qq.com>
Date: 星期六, 02 十一月 2024 09:44:58 +0800
Subject: [PATCH] bug修改

---
 ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/TChargingOrderServiceImpl.java |   17 ++++++++++++++---
 1 files changed, 14 insertions(+), 3 deletions(-)

diff --git a/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/TChargingOrderServiceImpl.java b/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/TChargingOrderServiceImpl.java
index b38ba84..5a5c02a 100644
--- a/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/TChargingOrderServiceImpl.java
+++ b/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/TChargingOrderServiceImpl.java
@@ -1413,7 +1413,7 @@
 			chargingOrderListVO.setChargingCapacity(chargingOrderListVO.getElectricity());
 			BigDecimal bigDecimal = new BigDecimal("0.006");
 			if (chargingOrderListVO.getOrderAmount()!=null){
-				chargingOrderListVO.setCommissionAmount(chargingOrderListVO.getOrderAmount().multiply(bigDecimal));
+				chargingOrderListVO.setCommissionAmount(chargingOrderListVO.getPaymentAmount().multiply(bigDecimal));
 			}
 			chargingOrderListVO.setPaymentAmount(chargingOrderListVO.getPaymentAmount());
 			chargingOrderListVO.setUid(chargingOrderListVO.getId()+"");
@@ -1441,9 +1441,20 @@
 			// 获取开始SOC 结束soc
 			if (chargingOrderListVO.getCode()!=null){
 				List<UploadRealTimeMonitoringData> data6 = uploadRealTimeMonitoringDataClient.getDataByOrderCode(chargingOrderListVO.getCode()).getData();
+
 			if (data6!=null && !data6.isEmpty()){
-					chargingOrderListVO.setEndSoc(data6.get(0).getSoc().toString());
-					chargingOrderListVO.setStartSoc(data6.get(data6.size()-1).getSoc().toString());
+				int min = 100;
+				int max = 0;
+				for (UploadRealTimeMonitoringData uploadRealTimeMonitoringData : data6) {
+					if (uploadRealTimeMonitoringData.getSoc()>max){
+						max = uploadRealTimeMonitoringData.getSoc();
+					}
+					if (uploadRealTimeMonitoringData.getSoc()!=0 &&uploadRealTimeMonitoringData.getSoc()<min){
+						min = uploadRealTimeMonitoringData.getSoc();
+					}
+				}
+					chargingOrderListVO.setEndSoc(max+"");
+					chargingOrderListVO.setStartSoc(min+"");
 				}
 			}
 

--
Gitblit v1.7.1