rentaiming
2024-06-21 0b007e7fe9ef41fbaa13507d2520a5e8e4faeb3c
ruoyi-modules/ruoyi-auction/src/main/java/com/ruoyi/auction/service/impl/AuctionSalesroomServiceImpl.java
@@ -1328,6 +1328,8 @@
        if (StringUtils.isNull(data)) {
            throw new ServiceException("视频不存在");
        }
        iAuctionVideoService.remove(Wrappers.<AuctionVideo>lambdaQuery().eq
                (AuctionVideo::getAuctionSalesroomId, dto.getAuctionSalesroomId()));
        AuctionVideo auctionVideo = new AuctionVideo();
        auctionVideo.setAuctionSalesroomId(dto.getAuctionSalesroomId());
        auctionVideo.setPromotionVideoId(dto.getVideoId());
@@ -1343,7 +1345,7 @@
    @Override
    public void stopPlay(Long auctionSalesroomId) {
        iAuctionVideoService.remove(Wrappers.<AuctionVideo>lambdaQuery().eq
                (AuctionVideo::getAuctionSalesroomId, 1L));
                (AuctionVideo::getAuctionSalesroomId, auctionSalesroomId));
    }
    /**
@@ -1387,17 +1389,24 @@
    @Transactional
    public void stopCurrentAuctionSalesroom(Long auctionSalesroomId)
            throws JsonProcessingException {
        // 修改拍卖场开始状态
        AuctionSalesroom auctionSalesroom = this.getById(auctionSalesroomId);
        auctionSalesroom.setStatus(AuctionStartStatusEnum.ENDED);
        auctionSalesroom.setEndTime(LocalDateTime.now());
        auctionSalesroomMapper.updateById(auctionSalesroom);
        LambdaQueryWrapper<AuctionSalesroomGoods> wrapper = Wrappers.lambdaQuery();
        wrapper.eq(AuctionSalesroomGoods::getStatus, AuctionGoodsStatusEnum.WAITING);
        wrapper.eq(AuctionSalesroomGoods::getAuctionSalesroomId, auctionSalesroomId);
        wrapper.orderByDesc(AuctionSalesroomGoods::getSortNum);
        List<AuctionSalesroomGoods> auctionSalesroomGoods = auctionSalesroomGoodsMapper.selectList(
                wrapper);
        long count = auctionSalesroomGoods.stream()
                .filter(goods -> goods.getStatus().equals(AuctionGoodsStatusEnum.IN_PROGRESS))
                .count();
        if (count > 0) {
            throw new ServiceException("当前拍卖场正在拍卖商品,不能停止");
        }
        // 修改拍卖场开始状态
        AuctionSalesroom auctionSalesroom = this.getById(auctionSalesroomId);
        auctionSalesroom.setStatus(AuctionStartStatusEnum.ENDED);
        auctionSalesroom.setEndTime(LocalDateTime.now());
        auctionSalesroomMapper.updateById(auctionSalesroom);
        if (StringUtils.isNotEmpty(auctionSalesroomGoods)) {
            List<GoodsStockUpdDTO> dtoList = new ArrayList<>();
            for (AuctionSalesroomGoods salesroomGoods : auctionSalesroomGoods) {