From 91c924d69b8dc4226f664621d367ab36a77ae959 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=A2=A8=E5=A4=A7=E5=8F=94?= <494979559@qq.com>
Date: Mon, 12 Aug 2024 19:28:30 +0800
Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E7=8E=B0=E7=94=B3=E8=AF=B7=E4=BC=98?=
=?UTF-8?q?=E5=8C=96?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../java/com/ruoyi/common/utils/DateUtils.java | 15 ++++++++++-----
.../service/impl/TransactionBillServiceImpl.java | 1 +
.../ruoyi/ss/transfer/mapper/TransferMapper.xml | 6 +++++-
.../service/impl/TransferServiceImpl.java | 1 +
4 files changed, 17 insertions(+), 6 deletions(-)
diff --git a/smart-switch-ruoyi/smart-switch-common/src/main/java/com/ruoyi/common/utils/DateUtils.java b/smart-switch-ruoyi/smart-switch-common/src/main/java/com/ruoyi/common/utils/DateUtils.java
index 5dfee259..e47b696d 100644
--- a/smart-switch-ruoyi/smart-switch-common/src/main/java/com/ruoyi/common/utils/DateUtils.java
+++ b/smart-switch-ruoyi/smart-switch-common/src/main/java/com/ruoyi/common/utils/DateUtils.java
@@ -3,11 +3,7 @@ package com.ruoyi.common.utils;
import java.lang.management.ManagementFactory;
import java.text.ParseException;
import java.text.SimpleDateFormat;
-import java.time.LocalDate;
-import java.time.LocalDateTime;
-import java.time.LocalTime;
-import java.time.ZoneId;
-import java.time.ZonedDateTime;
+import java.time.*;
import java.time.format.DateTimeFormatter;
import java.util.Calendar;
import java.util.Date;
@@ -283,4 +279,13 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils
DateTimeFormatter formatter = DateTimeFormatter.ISO_ZONED_DATE_TIME;
return LocalDateTime.parse(time, formatter);
}
+
+ /**
+ * RFC3339格式转为Date
+ */
+ public static Date toDateByRfc3339(String str) {
+ DateTimeFormatter formatter = DateTimeFormatter.ISO_OFFSET_DATE_TIME;
+ OffsetDateTime dateTime = OffsetDateTime.parse(str, formatter);
+ return Date.from(dateTime.toInstant());
+ }
}
diff --git a/smart-switch-service/src/main/java/com/ruoyi/ss/transactionBill/service/impl/TransactionBillServiceImpl.java b/smart-switch-service/src/main/java/com/ruoyi/ss/transactionBill/service/impl/TransactionBillServiceImpl.java
index 452500e3..02c7c17b 100644
--- a/smart-switch-service/src/main/java/com/ruoyi/ss/transactionBill/service/impl/TransactionBillServiceImpl.java
+++ b/smart-switch-service/src/main/java/com/ruoyi/ss/transactionBill/service/impl/TransactionBillServiceImpl.java
@@ -1156,6 +1156,7 @@ public class TransactionBillServiceImpl implements TransactionBillService, After
// 修改提现状态
TransactionBill data = new TransactionBill();
data.setStatus(TransactionBillStatus.WITHDRAW_SUCCESS.getStatus());
+ data.setPayTime(transfer.getUpdateTime());
TransactionBillQuery query = new TransactionBillQuery();
query.setStatus(TransactionBillStatus.WITHDRAW_PAYING.getStatus());
query.setBillId(transfer.getBstId());
diff --git a/smart-switch-service/src/main/java/com/ruoyi/ss/transfer/mapper/TransferMapper.xml b/smart-switch-service/src/main/java/com/ruoyi/ss/transfer/mapper/TransferMapper.xml
index 4047baf0..621baa72 100644
--- a/smart-switch-service/src/main/java/com/ruoyi/ss/transfer/mapper/TransferMapper.xml
+++ b/smart-switch-service/src/main/java/com/ruoyi/ss/transfer/mapper/TransferMapper.xml
@@ -18,7 +18,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
st.batch_remark,
st.create_time,
st.total_amount,
- st.close_reason
+ st.close_reason,
+ st.update_time
from ss_transfer st
@@ -66,6 +67,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
create_time,
total_amount,
close_reason,
+ update_time,
#{batchNo},
@@ -78,6 +80,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{createTime},
#{totalAmount},
#{closeReason},
+ #{updateTime},
@@ -100,6 +103,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
create_time = #{data.createTime},
total_amount = #{data.totalAmount},
close_reason = #{data.closeReason},
+ update_time = #{data.updateTime},
diff --git a/smart-switch-service/src/main/java/com/ruoyi/ss/transfer/service/impl/TransferServiceImpl.java b/smart-switch-service/src/main/java/com/ruoyi/ss/transfer/service/impl/TransferServiceImpl.java
index d65497a6..81a128f4 100644
--- a/smart-switch-service/src/main/java/com/ruoyi/ss/transfer/service/impl/TransferServiceImpl.java
+++ b/smart-switch-service/src/main/java/com/ruoyi/ss/transfer/service/impl/TransferServiceImpl.java
@@ -264,6 +264,7 @@ public class TransferServiceImpl implements TransferService
Transfer data = new Transfer();
List detaiList = new ArrayList<>();
+ data.setUpdateTime(DateUtils.toDateByRfc3339(transferBatch.getUpdateTime()));
// 已完成:所有明细都处理完成了
if (WxTransferBatchStatus.FINISHED.getStatus().equals(transferBatch.getBatchStatus())) {
if (transferBatch.getSuccessNum() != null && Objects.equals(transferBatch.getSuccessNum(), transferBatch.getTotalNum())) {