| | |
| | | import com.ruoyi.auction.controller.management.dto.MgtAuctionSalesroomDTO; |
| | | import com.ruoyi.auction.controller.management.dto.MgtAuctionSalesroomGoodsDTO; |
| | | import com.ruoyi.auction.controller.management.dto.MgtAuctionSalesroomQuery; |
| | | import com.ruoyi.auction.controller.management.dto.MgtScreenBidPage; |
| | | import com.ruoyi.auction.controller.management.vo.MgtAuctionBidRecordVO; |
| | | import com.ruoyi.auction.controller.management.vo.MgtAuctionSalesroomGoodsVO; |
| | | import com.ruoyi.auction.controller.management.vo.MgtAuctionSalesroomScreenVO; |
| | |
| | | import com.ruoyi.common.core.utils.page.Checker; |
| | | import com.ruoyi.common.core.utils.page.CollUtils; |
| | | import com.ruoyi.common.core.utils.page.PageDTO; |
| | | import com.ruoyi.common.core.web.page.BasePage; |
| | | import com.ruoyi.system.api.domain.AppMiniLoginVO; |
| | | import com.ruoyi.system.api.domain.AuctionGoods; |
| | | import com.ruoyi.system.api.domain.AuctionSalesroom; |
| | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Set; |
| | | import java.util.concurrent.atomic.AtomicReference; |
| | | import java.util.function.Function; |
| | | import java.util.stream.Collectors; |
| | | import javax.annotation.Resource; |
| | |
| | | /** |
| | | * 进入详情 |
| | | * |
| | | * @param id 拍卖会id |
| | | * @param basePage |
| | | * @param id 拍卖会id |
| | | * @return 大屏操作台拍卖场视图对象 |
| | | */ |
| | | @Override |
| | | public MgtAuctionSalesroomScreenVO getAuctionSalesroomDetail(Long id, BasePage basePage) { |
| | | public MgtAuctionSalesroomScreenVO getAuctionSalesroomDetail(Long id) { |
| | | MgtAuctionSalesroomVO mgtAuctionSalesroomVO = this.getAuctionSalesroom(id); |
| | | MgtAuctionSalesroomScreenVO vo = BeanUtils.copyBean( |
| | | mgtAuctionSalesroomVO, MgtAuctionSalesroomScreenVO.class); |
| | |
| | | int index = collect.indexOf(vo.getCurrentAuctionSalesroomGoods()); |
| | | vo.setNextAuctionSalesroomGoods(collect.get(index + 1)); |
| | | // 分页查询当前拍品出价信息 |
| | | Page<AuctionBidRecord> page = auctionBidRecordService.lambdaQuery() |
| | | List<AuctionBidRecord> list = auctionBidRecordService.lambdaQuery() |
| | | .eq(AuctionBidRecord::getTargetId, |
| | | vo.getCurrentAuctionSalesroomGoods().getId()) |
| | | .eq(AuctionBidRecord::getAuctionType, |
| | | AuctionOrderTypeEnum.AUCTION_ITEMS) |
| | | .page(new Page<>(basePage.getPageCurr(), basePage.getPageSize())); |
| | | if (StringUtils.isNotEmpty(page.getRecords())) { |
| | | vo.setMgtAuctionBidRecordVOPageDTO(PageDTO.empty(page)); |
| | | .list(); |
| | | if (StringUtils.isNotEmpty(list)) { |
| | | vo.setMgtAuctionBidRecordVOList(CollUtils.emptyList()); |
| | | } |
| | | vo.setMgtAuctionBidRecordVOPageDTO(PageDTO.of(page, MgtAuctionBidRecordVO.class)); |
| | | vo.setMgtAuctionBidRecordVOList( |
| | | BeanUtils.copyList(list, MgtAuctionBidRecordVO.class)); |
| | | } else { |
| | | vo.setNextAuctionSalesroomGoods(collect.get(0)); |
| | | } |
| | | } |
| | | return vo; |
| | | } |
| | | |
| | | /** |
| | | * 进入详情-出价会员列表 |
| | | * |
| | | * @param mgtScreenBidPage |
| | | * @return PageDTO<MgtAuctionBidRecordVO> |
| | | */ |
| | | @Override |
| | | public PageDTO<MgtAuctionBidRecordVO> getScreenBidRecordList( |
| | | MgtScreenBidPage mgtScreenBidPage) { |
| | | MgtAuctionSalesroomVO mgtAuctionSalesroomVO = this.getAuctionSalesroom( |
| | | mgtScreenBidPage.getId()); |
| | | List<MgtAuctionSalesroomGoodsVO> auctionSalesroomGoodsVOS = mgtAuctionSalesroomVO.getAuctionSalesroomGoodsVOS(); |
| | | if (StringUtils.isEmpty(auctionSalesroomGoodsVOS)) { |
| | | throw new ServiceException("该拍卖会暂无拍卖商品"); |
| | | } |
| | | AtomicReference<Long> currentAuctionGoodsId = new AtomicReference<>(); |
| | | auctionSalesroomGoodsVOS.stream() |
| | | .filter(item -> item.getStatus().equals(AuctionGoodsStatusEnum.IN_PROGRESS)) |
| | | .findFirst().ifPresent(goods -> { |
| | | currentAuctionGoodsId.set(goods.getId()); |
| | | }); |
| | | Page<AuctionBidRecord> page = auctionBidRecordService.lambdaQuery() |
| | | .eq(StringUtils.isNotNull(currentAuctionGoodsId.get()), |
| | | AuctionBidRecord::getTargetId, |
| | | currentAuctionGoodsId.get()) |
| | | .eq(AuctionBidRecord::getAuctionType, |
| | | AuctionOrderTypeEnum.AUCTION_ITEMS) |
| | | .page(new Page<>(mgtScreenBidPage.getPageCurr(), mgtScreenBidPage.getPageSize())); |
| | | if (StringUtils.isNotEmpty(page.getRecords())) { |
| | | return PageDTO.empty(page); |
| | | } |
| | | return PageDTO.of(page, MgtAuctionBidRecordVO.class); |
| | | } |
| | | } |