rentaiming
2024-06-21 b2ab426275d80c0c1a4972906f1b37b051aec2b1
ruoyi-modules/ruoyi-auction/src/main/java/com/ruoyi/auction/service/impl/AuctionGoodsServiceImpl.java
@@ -33,15 +33,7 @@
import com.ruoyi.common.core.utils.page.BeanUtils;
import com.ruoyi.common.core.utils.page.PageDTO;
import com.ruoyi.system.api.constants.NotificationTypeConstant;
import com.ruoyi.system.api.domain.AuctionGoods;
import com.ruoyi.system.api.domain.GoodsBrand;
import com.ruoyi.system.api.domain.GoodsCategory;
import com.ruoyi.system.api.domain.GoodsFlavorType;
import com.ruoyi.system.api.domain.GoodsSeries;
import com.ruoyi.system.api.domain.GoodsSku;
import com.ruoyi.system.api.domain.Member;
import com.ruoyi.system.api.domain.MemberAddress;
import com.ruoyi.system.api.domain.OrderAuctionBond;
import com.ruoyi.system.api.domain.*;
import com.ruoyi.system.api.domain.dto.AuctionGoodsListDTO;
import com.ruoyi.system.api.domain.dto.AuctionGoodsListPageDTO;
import com.ruoyi.system.api.domain.dto.GoodsStockUpdDTO;
@@ -51,10 +43,7 @@
import com.ruoyi.system.api.domain.dto.RefundDTO;
import com.ruoyi.system.api.domain.vo.AuctionGoodsListVO;
import com.ruoyi.system.api.domain.vo.AuctionGoodsinfoVO;
import com.ruoyi.system.api.feignClient.AuctionClient;
import com.ruoyi.system.api.feignClient.GoodsSkuClient;
import com.ruoyi.system.api.feignClient.MemberClient;
import com.ruoyi.system.api.feignClient.OrderClient;
import com.ruoyi.system.api.feignClient.*;
import com.ruoyi.system.api.util.WebSocketUsers;
import io.seata.spring.annotation.GlobalTransactional;
import java.time.LocalDateTime;
@@ -89,6 +78,7 @@
    private final GoodsSkuClient goodsSkuClient;
    private final MemberClient memberClient;
    private final OrderClient orderClient;
    private final SysUserClient sysUserClient;
    private final AuctionClient auctionClient;
    private final IAuctionBidRecordService auctionBidRecordService;
@@ -428,8 +418,9 @@
        auctionGoodsinfoVO.setStartTime(byId.getStartTime());
        auctionGoodsinfoVO.setEndTime(byId.getEndTime());
        auctionGoodsinfoVO.setUnit(goodsSkuOne.getUnit());
        auctionGoodsinfoVO.setBond(byId.getBond());
        auctionGoodsinfoVO.setDescription(goodsSkuOne.getDescription());
        auctionGoodsinfoVO.setYears(String.valueOf(goodsSkuOne.getYears()));
        auctionGoodsinfoVO.setYears(goodsSkuOne.getYears());
        GoodsBrand data = goodsSkuClient.getBrandOne(goodsSkuOne.getBrandId(), SecurityConstants.INNER).getData();
        GoodsCategory data1 = goodsSkuClient.getCategoryOne(goodsSkuOne.getCategoryId(), SecurityConstants.INNER).getData();
        GoodsSeries data2 = goodsSkuClient.getSeriesOne(goodsSkuOne.getSeriesId(), SecurityConstants.INNER).getData();
@@ -447,7 +438,10 @@
        auctionGoodsinfoVO.setShareTitle(goodsSkuOne.getShareTitle());
        auctionGoodsinfoVO.setSpecUnit(goodsSkuOne.getSpecUnit());
        auctionGoodsinfoVO.setDetail(goodsSkuOne.getDetail());
        auctionGoodsinfoVO.setYears(String.valueOf(goodsSkuOne.getYears()));
        auctionGoodsinfoVO.setBond(byId.getBond());
        auctionGoodsinfoVO.setYears(goodsSkuOne.getYears());
        auctionGoodsinfoVO.setSharePic(goodsSkuOne.getSharePic());
        auctionGoodsinfoVO.setShareTitle(goodsSkuOne.getShareTitle());
        LambdaQueryWrapper<AuctionBidRecord> wrapper1= Wrappers.lambdaQuery();
        wrapper1.eq(AuctionBidRecord::getMemberId,auctionGoodsListDTO.getMemberId());
        wrapper1.eq(AuctionBidRecord::getAuctionType,1);
@@ -459,6 +453,15 @@
            auctionGoodsinfoVO.setPresentBid(list1.getLastBidAmount());
            if (list1.getStatus().getCode()==2){
                auctionGoodsinfoVO.setIsStatus(2);
                OrderDTO orderDTO =new OrderDTO();
                orderDTO.setMemberId(auctionGoodsListDTO.getMemberId());
                orderDTO.setGoodsSkuId(byId.getId());
                Order data4 = orderClient.getOrderOne1(orderDTO, SecurityConstants.INNER).getData();
                if (data4!=null){
                    auctionGoodsinfoVO.setOrderId(data4.getId());
                    auctionGoodsinfoVO.setOrderNo(data4.getOrderNo());
                }
            }else{
                auctionGoodsinfoVO.setIsStatus(1);
            }
@@ -484,19 +487,14 @@
        }
        LocalDateTime now = LocalDateTime.now();
        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
        String formattedDate = now.format(formatter);
        LocalDateTime parseTime = LocalDateTime.parse(formattedDate, formatter);
        LocalDateTime newTime7 = now.minusDays(7);
        String formattedDate7 = newTime7.format(formatter);
        LocalDateTime parseTime7 = LocalDateTime.parse(formattedDate7, formatter);
        LambdaQueryWrapper<AuctionBrowseRecord> wrapper3=Wrappers.lambdaQuery();
        wrapper3.eq(AuctionBrowseRecord::getDelFlag,0);
        wrapper3.eq(AuctionBrowseRecord::getTargetId,auctionGoodsListDTO.getGoodsSkuId());
        wrapper3.eq(AuctionBrowseRecord::getMemberId,auctionGoodsListDTO.getMemberId());
        wrapper3.ge(AuctionBrowseRecord::getCreateTime, parseTime7)
                .le(AuctionBrowseRecord::getCreateTime, parseTime);
        wrapper3.ge(AuctionBrowseRecord::getCreateTime, newTime7)
                .le(AuctionBrowseRecord::getCreateTime, now);
        List<AuctionBrowseRecord> list = iAuctionBrowseRecordService.list(wrapper3);
        if (list.size()==0){
            AuctionBrowseRecord auctionBrowseRecord=new AuctionBrowseRecord();
@@ -507,7 +505,8 @@
        }
        CustomConfig returnAddressUserName = sysUserClient.getconfig("MALL_ORDER_DESCRIPTION").getData();
        auctionGoodsinfoVO.setExplain(returnAddressUserName.getConfigValue());
        return auctionGoodsinfoVO;
    }