From 05f3f129924bf9478d0bfdf42cf60bb82af2d9a7 Mon Sep 17 00:00:00 2001
From: Pu Zhibing <393733352@qq.com>
Date: 星期一, 30 九月 2024 11:38:38 +0800
Subject: [PATCH] 修改bug

---
 ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/TChargingOrderServiceImpl.java |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 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 7ac0582..30f07fb 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
@@ -1207,6 +1207,12 @@
 		for (ChargingOrderVO chargingOrderVO : list) {
 			TChargingGun data3 = chargingGunClient.getChargingGunById(chargingOrderVO.getChargingGunId()).getData();
 			TChargingPile data2 = chargingPileClient.getChargingPileById(chargingOrderVO.getChargingPileId()).getData();
+			if (chargingOrderVO.getSiteId()!=null){
+				List<Integer> integers = new ArrayList<>();
+				integers.add(chargingOrderVO.getSiteId());
+				List<Site> data = siteClient.getSiteByIds(integers).getData();
+				if (!data.isEmpty())chargingOrderVO.setSiteName(data.get(0).getName());
+			}
 			if (data2!=null && data3!=null){
 				chargingOrderVO.setTerminalName(data2.getName()+"-"+data3.getName());
 
@@ -1222,7 +1228,9 @@
 			// 单个订单累计服务费
 			BigDecimal serviceMoney1 = new BigDecimal("0");
 			UploadRealTimeMonitoringData data5 = uploadRealTimeMonitoringDataClient.chargingOrderInfo(chargingOrderVO.getCode()).getData();
-			chargingOrderVO.setChargingSecond(data5.getTime_remaining()*60L);
+			if (data5!=null){
+				chargingOrderVO.setChargingSecond(data5.getTime_remaining()*60L);
+			}
 			// 总收入
 			if (chargingOrderVO.getRefundStatus() !=null && chargingOrderVO.getRefundStatus() == 2){
 				income = income.add(chargingOrderVO.getPaymentAmount().subtract(chargingOrderVO.getRefundAmount()));

--
Gitblit v1.7.1