From efe9744eb6651298be9f48b84a5f17c58d7b64eb Mon Sep 17 00:00:00 2001
From: rentaiming <806181062@qq.com>
Date: 星期五, 19 七月 2024 14:10:26 +0800
Subject: [PATCH] 修改bug

---
 ruoyi-modules/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/OrderAuctionBondServiceImpl.java |   22 +++++++++++++++-------
 1 files changed, 15 insertions(+), 7 deletions(-)

diff --git a/ruoyi-modules/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/OrderAuctionBondServiceImpl.java b/ruoyi-modules/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/OrderAuctionBondServiceImpl.java
index f6c8267..99e9b74 100644
--- a/ruoyi-modules/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/OrderAuctionBondServiceImpl.java
+++ b/ruoyi-modules/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/OrderAuctionBondServiceImpl.java
@@ -31,6 +31,8 @@
 import java.util.Map;
 import java.util.Objects;
 import java.util.Set;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
 import java.util.stream.Collectors;
 import javax.annotation.Resource;
 import lombok.extern.slf4j.Slf4j;
@@ -66,7 +68,7 @@
     public R<T> getOrderAuctionBond(OrderAuctionBondDTO orderAuctionBondDTO) {
 
         LambdaQueryWrapper<OrderAuctionBond> wrapper = Wrappers.lambdaQuery();
-        wrapper.notIn(OrderAuctionBond::getMemberId, orderAuctionBondDTO.getUserList());
+        wrapper.in(OrderAuctionBond::getMemberId, orderAuctionBondDTO.getUserList());
         wrapper.eq(OrderAuctionBond::getDelFlag, 0);
         wrapper.eq(OrderAuctionBond::getAuctionSalesroomId, orderAuctionBondDTO.getAuctionSalesroomId());
         List<OrderAuctionBond> orderAuctionBondList = this.list(wrapper);
@@ -81,11 +83,17 @@
                     return R.fail("支付宝退款失败!");
                 }
             } else {//微信
-                String refundMoney = SinataUtil.doubleRetainTwo(orderAuctionBond.getBond().doubleValue() * 100d);
+                String refundMoney = SinataUtil.doubleRetainTwo(paylog.getPayMoney() * 100d);
                 Integer refundFee = Integer.parseInt(refundMoney.substring(0, refundMoney.length() - 3));
                 String money = SinataUtil.doubleRetainTwo(paylog.getPayMoney() * 100d);
                 Integer totalFee = Integer.parseInt(money.substring(0, money.length() - 3));
-                boolean bo = paylogServiceImpl.refundForWxpay(1, paylog.getTradeNo(), paylog.getOutTradeNo(), orderAuctionBond.getOrderNo(), totalFee, refundFee, "2");
+                refundFee = Integer.parseInt(money.substring(0, money.length() - 3));
+
+                String regEx = "[^0-9]";
+                Pattern p = Pattern.compile(regEx);
+                Matcher m = p.matcher(paylog.getOutTradeNo());
+                String ma = m.replaceAll("").trim();
+                boolean bo = paylogServiceImpl.refundForWxpay(4, paylog.getTradeNo(), paylog.getOutTradeNo(), "R" + ma, totalFee, refundFee, "2");
                 if (!bo) {
                     return R.fail("微信退款失败!");
                 }
@@ -148,7 +156,7 @@
                 orderAuctionBond.setMemberId(memberAuctionSalesroomBondDTO.getMemberId());
                 orderAuctionBond.setBond(data.getBond());
                 orderAuctionBond.setBoundStatus(BondStatusEnum.PAID);
-                orderAuctionBond.setBondType(AuctionOrderTypeEnum.AUCTION_ITEMS);
+                orderAuctionBond.setBoundStatus(BondStatusEnum.TO_PLAY);
                 this.save(orderAuctionBond);
                 payInfoVO.setOrderNO(orderAuctionBond.getOrderNo());
                 payInfoVO.setType(0);
@@ -161,8 +169,9 @@
                 orderAuctionBond.setAuctionGoodsId(memberAuctionSalesroomBondDTO.getAuctionGoodsId());
                 orderAuctionBond.setMemberId(memberAuctionSalesroomBondDTO.getMemberId());
                 orderAuctionBond.setBond(data.getBond());
+                orderAuctionBond.setOrderTimeSx(data.getEndTime());
                 orderAuctionBond.setBoundStatus(BondStatusEnum.TO_PLAY);
-                orderAuctionBond.setBondType(AuctionOrderTypeEnum.AUCTION_ITEMS);
+                orderAuctionBond.setBondType(AuctionOrderTypeEnum.REGULAR_ITEMS);
                 if (memberAuctionSalesroomBondDTO.getPaymentMethod() == 1) {
                     orderAuctionBond.setPaymentMethod(PaymentMethodEnum.WECHAT);
                 } else {
@@ -182,8 +191,7 @@
             }
         } else {
             AuctionSalesroom data = auctionClient.getauctionSalesroomOne(memberAuctionSalesroomBondDTO, SecurityConstants.INNER).getData();
-
-            if (data.getBond().intValue() == 0) {
+            if (data.getBond()==null||data.getBond().intValue() == 0) {
                 OrderAuctionBond orderAuctionBond = new OrderAuctionBond();
                 orderAuctionBond.setOrderNo(OrderUtil.getOrderNoForPrefix("BO"));
                 orderAuctionBond.setAuctionSalesroomId(memberAuctionSalesroomBondDTO.getAuctionSalesroomId());

--
Gitblit v1.7.1