From a8f0bac0c2f11c5d5d2a9d5510b27c35cce66cc9 Mon Sep 17 00:00:00 2001
From: puzhibing <393733352@qq.com>
Date: 星期一, 10 八月 2026 16:35:54 +0800
Subject: [PATCH] 修改会员发送优惠券功能 优化充电发起支付前的状态校验
---
ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/TChargingOrderServiceImpl.java | 19 +++++++++++++++++--
1 files changed, 17 insertions(+), 2 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 0f149b6..e753096 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
@@ -610,6 +610,21 @@
Integer payMethod = addChargingOrder.getPayMethod() == null ? 3 : addChargingOrder.getPayMethod();
BigDecimal rechargeAmount = money(addChargingOrder.getPaymentAmount());
TChargingGun tChargingGun = chargingGunClient.getChargingGunById(addChargingOrder.getId()).getData();
+ if(tChargingGun == null){
+ return AjaxResult.error("发起支付失败,请联系管理员!");
+ }
+ if(tChargingGun.getStatus() == 1){
+ return AjaxResult.error("充电枪已离线,请更换其他设备!");
+ }
+ if(tChargingGun.getStatus() == 2){
+ return AjaxResult.error("请先将充电枪连接车辆充电口!");
+ }
+ if(Arrays.asList(4, 5, 6).contains(tChargingGun.getStatus())){
+ return AjaxResult.error("设备正在充电中,请更换其他设备!");
+ }
+ if(tChargingGun.getStatus() == 7){
+ return AjaxResult.error("设备发生故障,请更换其他设备!");
+ }
TChargingPile chargingPile = chargingPileClient.getChargingPileById(tChargingGun.getChargingPileId()).getData();
AppUserWhitelistMatchVO whitelist = appUserWhitelistClient.matchWhitelist(userId, tChargingGun.getSiteId()).getData();
boolean whitelistMatched = whitelist != null && Boolean.TRUE.equals(whitelist.getMatched());
@@ -942,8 +957,8 @@
list.addAll(list);
boolean sta = false;
for (AccountingStrategyDetailOrder accountingStrategyDetailOrder : list) {
- Integer start = Integer.valueOf(accountingStrategyDetailOrder.getStartTime().replaceAll(":", ""));
- Integer end = Integer.valueOf(accountingStrategyDetailOrder.getEndTime().replaceAll(":", ""));
+ int start = Integer.parseInt(accountingStrategyDetailOrder.getStartTime().replaceAll(":", ""));
+ int end = Integer.parseInt(accountingStrategyDetailOrder.getEndTime().replaceAll(":", ""));
String[] split = accountingStrategyDetailOrder.getEndTime().split(":");
if (sta || (now >= start && now < end)) {
sta = true;
--
Gitblit v1.7.1