rentaiming
2024-07-16 31267d9b3a33c8b3fbb1b9f810ab08e01c49b846
ruoyi-modules/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/OrderAuctionBondServiceImpl.java
@@ -8,6 +8,7 @@
import com.ruoyi.common.core.enums.AuctionOrderTypeEnum;
import com.ruoyi.common.core.enums.BondStatusEnum;
import com.ruoyi.common.core.enums.PaymentMethodEnum;
import com.ruoyi.common.core.exception.ServiceException;
import com.ruoyi.common.core.utils.StringUtils;
import com.ruoyi.order.domain.Paylog;
import com.ruoyi.order.mapper.OrderAuctionBondMapper;
@@ -23,6 +24,8 @@
import com.ruoyi.system.api.domain.dto.RefundDTO;
import com.ruoyi.system.api.domain.vo.PayInfoVO;
import com.ruoyi.system.api.feignClient.AuctionClient;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
@@ -130,14 +133,22 @@
        PayInfoVO payInfoVO = new PayInfoVO();
        if (memberAuctionSalesroomBondDTO.getBondType() == 1) {
            AuctionGoods data = auctionClient.getauctionGoodsOne(memberAuctionSalesroomBondDTO, SecurityConstants.INNER).getData();
            if (data.getBond().intValue() == 0) {
            if (LocalDateTime.now().isAfter(data.getEndTime())){
                throw new ServiceException("商品拍卖已结束");
            }
            if (data.getListingStatus().getCode()==1){
                throw new ServiceException("商品拍卖下线");
            }
            if (data.getBond()==null||data.getBond().intValue() == 0) {
                OrderAuctionBond orderAuctionBond = new OrderAuctionBond();
                orderAuctionBond.setOrderNo(OrderUtil.getOrderNoForPrefix("BO"));
                orderAuctionBond.setAuctionGoodsId(memberAuctionSalesroomBondDTO.getAuctionGoodsId());
                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);
@@ -150,22 +161,22 @@
                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 {
                    orderAuctionBond.setPaymentMethod(PaymentMethodEnum.ALIPAY);
                }
                this.save(orderAuctionBond);
                payInfoVO.setOrderNO(orderAuctionBond.getOrderNo());
                if (memberAuctionSalesroomBondDTO.getPaymentMethod() == 1) {
                    payInfoVO.setType(2);
                } else {
                    payInfoVO.setType(1);
                }
                payInfoVO.setOrderNO(orderAuctionBond.getOrderNo());
                payInfoVO.setSubject("保证金");
                payInfoVO.setMemberId(memberAuctionSalesroomBondDTO.getMemberId());
                payInfoVO.setBody("保证金");
@@ -207,6 +218,7 @@
                } else {
                    payInfoVO.setType(1);
                }
                payInfoVO.setOrderNO(orderAuctionBond.getOrderNo());
                payInfoVO.setSubject("保证金");
                payInfoVO.setMemberId(memberAuctionSalesroomBondDTO.getMemberId());
                payInfoVO.setBody("保证金");