From ae1471f378f399f76518539ec8992e64a3673436 Mon Sep 17 00:00:00 2001
From: 陶杰 <1378534974@qq.com>
Date: 星期三, 08 一月 2025 15:26:06 +0800
Subject: [PATCH] 1.订单提交:订单最小金额配置

---
 src/main/java/com/mzl/flower/service/payment/UserPaymentSybService.java |   17 ++++++++++++++++-
 1 files changed, 16 insertions(+), 1 deletions(-)

diff --git a/src/main/java/com/mzl/flower/service/payment/UserPaymentSybService.java b/src/main/java/com/mzl/flower/service/payment/UserPaymentSybService.java
index 39da81a..ea8f878 100644
--- a/src/main/java/com/mzl/flower/service/payment/UserPaymentSybService.java
+++ b/src/main/java/com/mzl/flower/service/payment/UserPaymentSybService.java
@@ -28,7 +28,9 @@
 import javax.servlet.http.HttpServletRequest;
 import java.math.BigDecimal;
 import java.math.RoundingMode;
+import java.time.LocalDate;
 import java.time.LocalDateTime;
+import java.time.LocalTime;
 import java.util.List;
 import java.util.Map;
 import java.util.TreeMap;
@@ -227,6 +229,19 @@
                     order.setPaymentAmount(order.getTotalAmount());
                 }
                 order.setPaymentTime(up.getPaymentTimeCallback());
+
+                if(null!=order.getPaymentTime()){
+                    LocalDateTime paymentTime = order.getPaymentTime();
+                    LocalDate paymentDate = paymentTime.toLocalDate();
+                    LocalDateTime today1700 = paymentTime.with(LocalTime.of(17, 0));
+                    // 比较时间是否大于当天的 17:00
+                    if (paymentTime.isAfter(today1700)) {
+                        // 如果大于 17:00,设置为下一天的日期
+                        paymentDate = paymentDate.plusDays(1);
+                    }
+                    order.setPaymentDateSta(paymentDate);
+                }
+
                 order.setStatus(Constants.ORDER_STATUS.SEND.name());
             } else if (Constants.ORDER_STATUS_BACKEND.CANCEL.name().equals(orderStatus)){
                 order.setStatus(Constants.ORDER_STATUS.CANCEL.name());
@@ -568,7 +583,7 @@
                 new QueryWrapper<UserPayment>().eq("order_id", o.getId()));
 
         long trxamt = refund;
-        String reqsn = o.getId();
+        String reqsn = re.getId();//退款单的id
         String oldtrxid = up.getTransactionId();
         String oldreqsn = null;
 

--
Gitblit v1.9.3