From 4a984867b6c28da14ae94191161f2ce95c8d5c1c Mon Sep 17 00:00:00 2001
From: Pu Zhibing <393733352@qq.com>
Date: 星期五, 01 十一月 2024 18:20:20 +0800
Subject: [PATCH] 合并代码

---
 ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/TChargingOrderServiceImpl.java             |   18 +++++++++++++-----
 ruoyi-service/ruoyi-integration/src/main/java/com/ruoyi/integration/barrierGate/server/ParkingOrderService.java |    8 ++++----
 2 files changed, 17 insertions(+), 9 deletions(-)

diff --git a/ruoyi-service/ruoyi-integration/src/main/java/com/ruoyi/integration/barrierGate/server/ParkingOrderService.java b/ruoyi-service/ruoyi-integration/src/main/java/com/ruoyi/integration/barrierGate/server/ParkingOrderService.java
index 42bb861..55169f6 100644
--- a/ruoyi-service/ruoyi-integration/src/main/java/com/ruoyi/integration/barrierGate/server/ParkingOrderService.java
+++ b/ruoyi-service/ruoyi-integration/src/main/java/com/ruoyi/integration/barrierGate/server/ParkingOrderService.java
@@ -53,7 +53,7 @@
 		TParkingLot data = parkingLotClient.getParkingLotByAppKey(order.getAppkey()).getData();
 		parkingRecord.setName(data.getName());
 		parkingRecord.setParkingLotId(data.getId());
-		LocalDateTime parse = LocalDateTime.parse(order.getEnterDateTime(), DateTimeFormatter.ofPattern("yyyy-MM-ddTHH:mm:ss.SSSZ"));
+		LocalDateTime parse = LocalDateTime.parse(order.getEnterDateTime(), DateTimeFormatter.ISO_INSTANT);
 		parse.plusDays(8);
 		parkingRecord.setInParkingTime(parse);
 		parkingRecord.setStatus(1);
@@ -72,7 +72,7 @@
 		query.setLicensePlate(order.getPlate());
 		query.setStatus(1);
 		TParkingRecord parkingRecord = parkingRecordClient.getParkingRecord(query).getData();
-		LocalDateTime parse = LocalDateTime.parse(order.getLeaveDateTime(), DateTimeFormatter.ofPattern("yyyy-MM-ddTHH:mm:ss.SSSZ"));
+		LocalDateTime parse = LocalDateTime.parse(order.getLeaveDateTime(), DateTimeFormatter.ISO_INSTANT);
 		parse.plusDays(8);
 		parkingRecord.setOutParkingTime(parse);
 		parkingRecord.setParkingDuration(Integer.valueOf(order.getLongTime()));
@@ -108,7 +108,7 @@
 		TParkingLot data = parkingLotClient.getParkingLotByAppKey(order.getAppkey()).getData();
 		parkingRecord.setName(data.getName());
 		parkingRecord.setParkingLotId(data.getId());
-		LocalDateTime parse = LocalDateTime.parse(order.getEntertime(), DateTimeFormatter.ofPattern("yyyy-MM-ddTHH:mm:ss.SSSZ"));
+		LocalDateTime parse = LocalDateTime.parse(order.getEntertime(), DateTimeFormatter.ISO_INSTANT);
 		parse.plusDays(8);
 		parkingRecord.setInParkingTime(parse);
 		parkingRecord.setStatus(1);
@@ -127,7 +127,7 @@
 		query.setLicensePlate(order.getPlatenumber());
 		query.setStatus(1);
 		TParkingRecord parkingRecord = parkingRecordClient.getParkingRecord(query).getData();
-		LocalDateTime parse = LocalDateTime.parse(order.getLeavetime(), DateTimeFormatter.ofPattern("yyyy-MM-ddTHH:mm:ss.SSSZ"));
+		LocalDateTime parse = LocalDateTime.parse(order.getLeavetime(), DateTimeFormatter.ISO_INSTANT);
 		parse.plusDays(8);
 		parkingRecord.setOutParkingTime(parse);
 		parkingRecord.setParkingDuration(Integer.valueOf(order.getLongTime()));
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 12127e4..a19fda8 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
@@ -284,9 +284,17 @@
 		if(null != dataList){
 			//在MongoDB中获取数据
 			SimpleDateFormat sdf = new SimpleDateFormat("HH:mm");
-			List<String> time = dataList.stream().map(s -> sdf.format(s.getCreate_time())).collect(Collectors.toList());
-			List<BigDecimal> outputVoltage = dataList.stream().map(UploadRealTimeMonitoringData::getOutput_voltage).collect(Collectors.toList());
-			List<BigDecimal> outputCurrent = dataList.stream().map(UploadRealTimeMonitoringData::getOutput_current).collect(Collectors.toList());
+			List<UploadRealTimeMonitoringData> dataLists = new ArrayList<>();
+			String t = "";
+			for (UploadRealTimeMonitoringData uploadRealTimeMonitoringData : dataList) {
+				if(!sdf.format(uploadRealTimeMonitoringData.getCreate_time()).equals(t)){
+					dataLists.add(uploadRealTimeMonitoringData);
+				}
+			}
+			
+			List<String> time = dataLists.stream().map(s -> sdf.format(s.getCreate_time())).collect(Collectors.toList());
+			List<BigDecimal> outputVoltage = dataLists.stream().map(UploadRealTimeMonitoringData::getOutput_voltage).collect(Collectors.toList());
+			List<BigDecimal> outputCurrent = dataLists.stream().map(UploadRealTimeMonitoringData::getOutput_current).collect(Collectors.toList());
 			List<Map<String, Object>> currentAndVoltage = new ArrayList<>();
 			for (int i = 0; i < time.size(); i++) {
 				Map<String, Object> map = new HashMap<>();
@@ -299,8 +307,8 @@
 			}
 			myChargingOrderInfo.setCurrentAndVoltage(currentAndVoltage);
 			//在MongoDB中获取数据
-			List<Integer> soc = dataList.stream().map(UploadRealTimeMonitoringData::getSoc).collect(Collectors.toList());
-			List<BigDecimal> po = dataList.stream().map(s -> s.getOutput_current().multiply(s.getOutput_voltage()).divide(new BigDecimal(1000),2, RoundingMode.HALF_DOWN)).collect(Collectors.toList());
+			List<Integer> soc = dataLists.stream().map(UploadRealTimeMonitoringData::getSoc).collect(Collectors.toList());
+			List<BigDecimal> po = dataLists.stream().map(s -> s.getOutput_current().multiply(s.getOutput_voltage()).divide(new BigDecimal(1000),2, RoundingMode.HALF_DOWN)).collect(Collectors.toList());
 			List<Map<String, Object>> power = new ArrayList<>();
 			for (int i = 0; i < time.size(); i++) {
 				Map<String, Object> map = new HashMap<>();

--
Gitblit v1.7.1