mitao
2024-07-29 2a97ecf8833f24dfbd5bf251e1fc1bdb632bbefb
ruoyi-modules/ruoyi-auction/src/main/java/com/ruoyi/auction/service/impl/AuctionSalesroomGoodsServiceImpl.java
@@ -321,6 +321,11 @@
        wrapper2.orderByAsc(AuctionSalesroomGoods::getSortNum);
        wrapper2.last("limit 1");
        AuctionSalesroomGoods auctionSalesroomGoods = this.getOne(wrapper2);
        if (auctionSalesroomGoods==null){
            throw new ServiceException("以没有待拍卖商品");
        }
        if(auctionSalesroomGoods!=null){
            auctionSalesroomGoods.setStatus(AuctionGoodsStatusEnum.IN_PROGRESS);
            auctionSalesroomGoods.setStartTime(LocalDateTime.now());
@@ -377,12 +382,18 @@
        LambdaQueryWrapper<AuctionBidRecord> wrapper = Wrappers.lambdaQuery();
        wrapper.eq(AuctionBidRecord::getAuctionSalesroomId, ationSalesroomGoodsDTO.getAuctionSalesroomId());
        wrapper.eq(AuctionBidRecord::getDelFlag, 0);
        wrapper.eq(AuctionBidRecord::getStatus,0);
        wrapper.eq(AuctionBidRecord::getStatus,2);
        List<AuctionBidRecord> auctionBidRecordList = auctionBidRecordMapper.selectList(wrapper);
        for (AuctionBidRecord auctionBidRecord:auctionBidRecordList){
            list.add(auctionBidRecord.getMemberId());
        }
        if (list.size()>0){
            OrderAuctionBondDTO orderAuctionBondDTO=new OrderAuctionBondDTO();
            orderAuctionBondDTO.setAuctionSalesroomId(auctionSalesroom.getId());
            orderAuctionBondDTO.setUserList(list);
            orderClient.getOrderAuctionBond(orderAuctionBondDTO,
                    SecurityConstants.INNER);
        }else{
            OrderAuctionBondDTO orderAuctionBondDTO=new OrderAuctionBondDTO();
            orderAuctionBondDTO.setAuctionSalesroomId(auctionSalesroom.getId());
            orderAuctionBondDTO.setUserList(list);
@@ -535,6 +546,12 @@
    @Override
    public AuctionSalesroomGoodsInfoVO getAuctionSalesroomGoodsInfo(AuctionSalesroomGoodsInfoDTO auctionSalesroomGoodsInfoDTO) {
        AuctionSalesroom byId = auctionSalesroomMapper.selectById(auctionSalesroomGoodsInfoDTO.getAuctionSalesroomId());
        if (byId==null){
            LambdaQueryWrapper<AuctionSalesroom> wrapper=Wrappers.lambdaQuery();
            wrapper.eq(AuctionSalesroom::getAuctionSalesroomNo,auctionSalesroomGoodsInfoDTO.getAuctionSalesroomId());
            wrapper.eq(AuctionSalesroom::getDelFlag,0);
            byId =auctionSalesroomMapper.selectOne(wrapper);
        }
        AuctionSalesroomGoods byId1 = this.getById(auctionSalesroomGoodsInfoDTO.getGoodsSkuId());
        GoodsSku goodsSku = goodsSkuClient.getGoodsSkuOne(byId1.getGoodsSkuId(), SecurityConstants.INNER).getData();
        AuctionSalesroomGoodsInfoVO AuctionSalesroomGoodsInfoVO=new AuctionSalesroomGoodsInfoVO();
@@ -620,13 +637,16 @@
        }
        List<getHomeGoodsSkuXxiVO> homeGoodsSkuXxiVOS=new ArrayList<>();
       List<GoodsInfoTitleValueVO> goodsInfoTitleValueVOList = goodsSkuClient.getlistByGoodsId(goodsSku.getId(), SecurityConstants.INNER).getData();
        Collections.sort(goodsInfoTitleValueVOList, Comparator.comparingInt(GoodsInfoTitleValueVO::getSortNum));
        for (GoodsInfoTitleValueVO goodsInfoTitleValueVO:goodsInfoTitleValueVOList){
            getHomeGoodsSkuXxiVO getHomeGoodsSkuXxiVOs=new getHomeGoodsSkuXxiVO();
            getHomeGoodsSkuXxiVOs.setContent(goodsInfoTitleValueVO.getContent());
            getHomeGoodsSkuXxiVOs.setTitleName(goodsInfoTitleValueVO.getTitleName());
            homeGoodsSkuXxiVOS.add(getHomeGoodsSkuXxiVOs);
        }
       if (goodsInfoTitleValueVOList!=null){
           Collections.sort(goodsInfoTitleValueVOList, Comparator.comparingInt(GoodsInfoTitleValueVO::getSortNum));
           for (GoodsInfoTitleValueVO goodsInfoTitleValueVO:goodsInfoTitleValueVOList){
               getHomeGoodsSkuXxiVO getHomeGoodsSkuXxiVOs=new getHomeGoodsSkuXxiVO();
               getHomeGoodsSkuXxiVOs.setContent(goodsInfoTitleValueVO.getContent());
               getHomeGoodsSkuXxiVOs.setTitleName(goodsInfoTitleValueVO.getTitleName());
               homeGoodsSkuXxiVOS.add(getHomeGoodsSkuXxiVOs);
           }
       }
        AuctionSalesroomGoodsInfoVO.setXxiVOS(homeGoodsSkuXxiVOS);
        return AuctionSalesroomGoodsInfoVO;
@@ -635,8 +655,17 @@
    @Override
    public List<AuctionBidRecordVO> getAuctionBidRecord(AuctionSalesroomGoodsInfoDTO auctionSalesroomGoodsInfoDTO) {
        LambdaQueryWrapper<AuctionBidRecord> wrapper=Wrappers.lambdaQuery();
        AuctionSalesroom byId = auctionSalesroomMapper.selectById(auctionSalesroomGoodsInfoDTO.getAuctionSalesroomId());
        if (byId==null){
            LambdaQueryWrapper<AuctionSalesroom> wrapper1=Wrappers.lambdaQuery();
            wrapper1.eq(AuctionSalesroom::getAuctionSalesroomNo,auctionSalesroomGoodsInfoDTO.getAuctionSalesroomId());
            wrapper1.eq(AuctionSalesroom::getDelFlag,0);
            byId =auctionSalesroomMapper.selectOne(wrapper1);
        }
        if (auctionSalesroomGoodsInfoDTO.getAuctionSalesroomId()!=null){
            wrapper.eq(AuctionBidRecord::getAuctionSalesroomId,auctionSalesroomGoodsInfoDTO.getAuctionSalesroomId());
            wrapper.eq(AuctionBidRecord::getAuctionSalesroomId,byId.getId());
        }
        wrapper.eq(AuctionBidRecord::getDelFlag,0);
        wrapper.eq(AuctionBidRecord::getTargetId,auctionSalesroomGoodsInfoDTO.getGoodsSkuId());
@@ -655,13 +684,13 @@
        }
        LambdaQueryWrapper<AuctionBidRecord> wrapper1=Wrappers.lambdaQuery();
        if (auctionSalesroomGoodsInfoDTO.getAuctionSalesroomId()!=null){
            wrapper.eq(AuctionBidRecord::getAuctionSalesroomId,auctionSalesroomGoodsInfoDTO.getAuctionSalesroomId());
            wrapper1.eq(AuctionBidRecord::getAuctionSalesroomId,auctionSalesroomGoodsInfoDTO.getAuctionSalesroomId());
        }
        wrapper1.eq(AuctionBidRecord::getDelFlag,0);
        wrapper1.eq(AuctionBidRecord::getTargetId,auctionSalesroomGoodsInfoDTO.getGoodsSkuId());
        wrapper1.eq(AuctionBidRecord::getMemberId,auctionSalesroomGoodsInfoDTO.getMemberId());
        wrapper.last("limit 1");
        AuctionBidRecord auctionBidRecord = auctionBidRecordMapper.selectOne(wrapper);
        wrapper1.last("limit 1");
        AuctionBidRecord auctionBidRecord = auctionBidRecordMapper.selectOne(wrapper1);
        if (auctionBidRecord!=null){
            LambdaQueryWrapper<AuctionBidRecord> wrapper3=Wrappers.lambdaQuery();
            wrapper3.eq(AuctionBidRecord::getAuctionSalesroomId,auctionSalesroomGoodsInfoDTO.getAuctionSalesroomId());