From 9868d192968a143d7aded8aad71e04c04aa92c10 Mon Sep 17 00:00:00 2001
From: puzhibing <393733352@qq.com>
Date: 星期五, 01 十一月 2024 17:25:04 +0800
Subject: [PATCH] 合并代码

---
 ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/TChargingOrderServiceImpl.java |   23 ++++++++++++++---------
 1 files changed, 14 insertions(+), 9 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 4dec8c9..8ee4a10 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
@@ -1666,19 +1666,27 @@
 				}
 				if (!data6.isEmpty()){
 					// 第一条数据soc为开始 最后一条数据soc为结束soc
-					chargingOrderListInfoVO.setStartSoc(data6.get(0).getSoc().toString());
-					chargingOrderListInfoVO.setEndSoc(data6.get(data6.size()-1).getSoc().toString());
+					chargingOrderListInfoVO.setStartSoc(data6.get(data6.size()-1).getSoc().toString());
+					chargingOrderListInfoVO.setEndSoc(data6.get(0).getSoc().toString());
 					chargingOrderListInfoVO.setChargingCapacity(data6.get(data6.size()-1).getCharging_degree());
-					chargingOrderListInfoVO.setChargingSecond(data6.get(data6.size()-1).getCumulative_charging_time()*60+"");
+
 					SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
 					for (UploadRealTimeMonitoringData uploadRealTimeMonitoringData : data6) {
 						uploadRealTimeMonitoringData.setCreateTime(simpleDateFormat.format(uploadRealTimeMonitoringData.getCreate_time()));
 					}
 				}
 			}
+
 			chargingOrderListInfoVO.setList(data6);
 		}
+		// 获取充电时间
+		UploadRealTimeMonitoringData data5 = uploadRealTimeMonitoringDataClient.chargingOrderInfo(chargingOrder.getCode()).getData();
+		if (data5!=null){
+			if (data5.getTime_remaining()!=null){
+				chargingOrderListInfoVO.setChargingSecond(data5.getCumulative_charging_time()*60L+"");
 
+			}
+		}
 
 		if (chargingOrder.getAppUserCarId()!=null){
 			List<TAppUserCar> data3 = appUserCarClient.getCarByIds(Collections.singletonList(chargingOrder.getAppUserCarId())).getData();
@@ -2878,8 +2886,8 @@
 	}
 
 	@Override
-	public List<Map<String, Object>> countBySource(List<Integer> siteIds) {
-		return this.baseMapper.countBySource(siteIds);
+	public List<Map<String, Object>> countBySource(List<Integer> siteIds, ChargingStatisticsQueryDto statisticsQueryDto) {
+		return this.baseMapper.countBySource(siteIds,statisticsQueryDto);
 	}
 
 	@Override
@@ -2998,11 +3006,8 @@
 		if(null != order.getAppUserId()){
 			queryWrapper.eq(TChargingOrder::getAppUserId, order.getAppUserId());
 		}
-		if(null != order.getAppUserId()){
-			queryWrapper.eq(TChargingOrder::getAppUserId, order.getAppUserId());
-		}
 		if(null != order.getStatusList()){
-			queryWrapper.in(TChargingOrder::getAppUserId, order.getStatusList());
+			queryWrapper.in(TChargingOrder::getStatus, order.getStatusList());
 		}
 		if(null != order.getEndMode()){
 			queryWrapper.eq(TChargingOrder::getEndMode, order.getEndMode());

--
Gitblit v1.7.1