From 486cd6ce0541b09a8d88c08ed51c75c844090972 Mon Sep 17 00:00:00 2001
From: 无关风月 <443237572@qq.com>
Date: 星期二, 18 二月 2025 17:10:22 +0800
Subject: [PATCH] 对账

---
 ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/TChargingOrderServiceImpl.java |   13 +++++++++----
 1 files changed, 9 insertions(+), 4 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 bc67496..228f069 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
@@ -859,7 +859,7 @@
 			chargingGun.setStatus(4);
 			chargingGunClient.updateChargingGunById(chargingGun);
 			//推送状态给三方平台
-			tcecClient.pushChargingGunStatus(chargingGun.getId(), chargingGun.getStatus());
+			tcecClient.pushChargingGunStatus(chargingGun.getFullNumber(), chargingGun.getStatus());
 		}
 		redisService.setCacheObject("AQJC_" + order.getChargingGunId(), preChargeCheck1, 24L, TimeUnit.HOURS);
 		this.updateById(order);
@@ -1378,7 +1378,7 @@
 
 		for (ChargingOrderVO chargingOrderVO : list1) {
 			paymentMoney= paymentMoney.add(chargingOrderVO.getPaymentAmount()!=null?chargingOrderVO.getPaymentAmount():new BigDecimal("0"));
-			commissionMoney = commissionMoney.add(chargingOrderVO.getRechargeAmount()!=null?chargingOrderVO.getRechargeAmount().multiply(new BigDecimal("0.006")):new BigDecimal("0"));
+			commissionMoney = commissionMoney.add(chargingOrderVO.getRechargeAmount()!=null?chargingOrderVO.getRechargeAmount().multiply(new BigDecimal("0.006")).setScale(2,BigDecimal.ROUND_DOWN):new BigDecimal("0"));
 			if (chargingOrderVO.getChargingCapacity()!=null){
 				total = total.add(chargingOrderVO.getElectricity()!=null?chargingOrderVO.getElectricity():new BigDecimal("0"));
 			}
@@ -1399,7 +1399,9 @@
 		}
 		tCharingOrderVO.setTotal(total);
 		tCharingOrderVO.setTime(time);
-		tCharingOrderVO.setIncome(paymentMoney.subtract(commissionMoney));
+		// todo 临时只累加
+//		tCharingOrderVO.setIncome(paymentMoney.subtract(commissionMoney));
+		tCharingOrderVO.setIncome(paymentMoney);
 		tCharingOrderVO.setElectronicMoney(electronicMoney);
 		tCharingOrderVO.setServiceMoney(serviceMoney);
 		pageInfo.setRecords(list);
@@ -2007,6 +2009,9 @@
 	@GlobalTransactional(rollbackFor = Exception.class)
 	public R endChargeBillingCharge(TransactionRecordMessageVO vo) {
 		TChargingOrder chargingOrder = this.getOne(new LambdaQueryWrapper<TChargingOrder>().eq(TChargingOrder::getCode, vo.getTransaction_serial_number()));
+		if(null == chargingOrder){
+			return R.ok();
+		}
 		Integer status = chargingOrder.getStatus();
 		if(status == 5){
 			return R.ok();
@@ -2358,7 +2363,7 @@
 		chargingGunClient.updateChargingGunById(chargingGun);
 		//推送状态给三方平台
 		if(2 == chargingOrder.getOrderSource()){
-			tcecClient.pushChargingGunStatus(chargingGun.getId(), chargingGun.getStatus());
+			tcecClient.pushChargingGunStatus(chargingGun.getFullNumber(), chargingGun.getStatus());
 		}
 		
 		//添加积分

--
Gitblit v1.7.1