From 082b9ab8643bc5e81f2e70b8e9400fdaba62e686 Mon Sep 17 00:00:00 2001
From: Pu Zhibing <393733352@qq.com>
Date: 星期三, 03 九月 2025 17:19:18 +0800
Subject: [PATCH] 修改小程序首页查询重复bug
---
ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/util/task/TaskUtil.java | 14 ++++++++++++++
1 files changed, 14 insertions(+), 0 deletions(-)
diff --git a/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/util/task/TaskUtil.java b/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/util/task/TaskUtil.java
index 8db8d05..ab5da09 100644
--- a/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/util/task/TaskUtil.java
+++ b/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/util/task/TaskUtil.java
@@ -121,6 +121,13 @@
TransactionRecord one = transactionRecordService.findOne(order.getCode());
if(null != one){
log.info("定时任务执行,查询到停止中的订单账单数据:{}", JSON.toJSONString(one));
+ if(null == order.getStartTime()){
+ order.setStartTime(LocalDateTime.parse(one.getStart_time(), DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss.SS").withZone(ZoneId.systemDefault())));
+ }
+ if(null == order.getEndTime()){
+ order.setEndTime(LocalDateTime.parse(one.getEnd_time(), DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss.SS").withZone(ZoneId.systemDefault())));
+ }
+ chargingOrderService.updateById(order);
TransactionRecordMessageVO vo = new TransactionRecordMessageVO();
BeanUtils.copyProperties(one, vo);
R r = chargingOrderService.endChargeBillingCharge(vo);
@@ -135,6 +142,13 @@
TransactionRecord one = transactionRecordService.findOne(order.getCode());
if(null != one && StringUtils.isNotEmpty(one.getResult())){
log.info("定时任务执行,查询到充电中的订单账单数据:{}", JSON.toJSONString(one));
+ if(null == order.getStartTime()){
+ order.setStartTime(LocalDateTime.parse(one.getStart_time(), DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss.SS").withZone(ZoneId.systemDefault())));
+ }
+ if(null == order.getEndTime()){
+ order.setEndTime(LocalDateTime.parse(one.getEnd_time(), DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss.SS").withZone(ZoneId.systemDefault())));
+ }
+ chargingOrderService.updateById(order);
TransactionRecordMessageVO vo = new TransactionRecordMessageVO();
BeanUtils.copyProperties(one, vo);
R r = chargingOrderService.endChargeBillingCharge(vo);
--
Gitblit v1.7.1