rentaiming
2024-07-18 c23f48c5ec15476299edadd91fa18f908d710a4f
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("微信退款失败!");
                }
@@ -134,7 +142,7 @@
        if (memberAuctionSalesroomBondDTO.getBondType() == 1) {
            AuctionGoods data = auctionClient.getauctionGoodsOne(memberAuctionSalesroomBondDTO, SecurityConstants.INNER).getData();
            if (data.getEndTime().isAfter(LocalDateTime.now())){
            if (LocalDateTime.now().isAfter(data.getEndTime())){
                throw new ServiceException("商品拍卖已结束");
            }
            if (data.getListingStatus().getCode()==1){
@@ -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);
@@ -163,7 +171,7 @@
                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 {