| | |
| | | import com.ruoyi.system.api.domain.dto.MemberAuctionSalesroomBondDTO; |
| | | import com.ruoyi.system.api.domain.dto.MemberAuctionSalesroomDTO; |
| | | import com.ruoyi.system.api.domain.dto.MemberAuctionSalesroomWdDTO; |
| | | import com.ruoyi.system.api.domain.dto.OrderAuctionBondDTO; |
| | | import com.ruoyi.system.api.domain.dto.RefundDTO; |
| | | import com.ruoyi.system.api.domain.vo.ForepartAuctionSalesroomGoodsVO; |
| | | import com.ruoyi.system.api.domain.vo.ForepartAuctionSalesroomVO; |
| | |
| | | MgtAuctionSalesroomVO.class); |
| | | List<AuctionSalesroomGoods> list; |
| | | if (isScreen) { |
| | | list = getAuctionSalesroomGoods(id, Boolean.TRUE); |
| | | list = getAuctionSalesroomGoods(id, Boolean.FALSE); |
| | | } else { |
| | | list = getAuctionSalesroomGoods(id, null); |
| | | } |
| | |
| | | iAuctionVideoService.save(auctionVideo); |
| | | } |
| | | |
| | | /** |
| | | * 结束播放 |
| | | * |
| | | * @param auctionSalesroomId 拍卖场id |
| | | */ |
| | | @Override |
| | | public void stopPlay(Long auctionSalesroomId) { |
| | | iAuctionVideoService.remove(Wrappers.<AuctionVideo>lambdaQuery().eq |
| | | (AuctionVideo::getAuctionSalesroomId, 1L)); |
| | | } |
| | | |
| | | /** |
| | | * 开始当前拍卖场 |
| | | * |
| | | * @param auctionSalesroomId 拍卖场id |
| | | */ |
| | | @Override |
| | | public void startCurrentAuctionSalesroom(Long auctionSalesroomId) { |
| | | // 修改拍卖场开始状态 |
| | | AuctionSalesroom auctionSalesroom = this.getById(auctionSalesroomId); |
| | | auctionSalesroom.setStatus(AuctionStartStatusEnum.IN_AUCTION); |
| | | auctionSalesroom.setStartTime(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); |
| | | wrapper.last("limit 1"); |
| | | AuctionSalesroomGoods auctionSalesroomGoods = auctionSalesroomGoodsMapper.selectOne( |
| | | wrapper); |
| | | auctionSalesroomGoods.setStatus(AuctionGoodsStatusEnum.IN_PROGRESS); |
| | | auctionSalesroomGoods.setStartTime(LocalDateTime.now()); |
| | | auctionSalesroomGoodsMapper.updateById(auctionSalesroomGoods); |
| | | } |
| | | |
| | | @Override |
| | | @GlobalTransactional(rollbackFor = Exception.class) |
| | | @Transactional |
| | | public void stopCurrentAuctionSalesroom(Long auctionSalesroomId) { |
| | | // 修改拍卖场开始状态 |
| | | 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); |
| | | if (StringUtils.isNotEmpty(auctionSalesroomGoods)) { |
| | | List<GoodsStockUpdDTO> dtoList = new ArrayList<>(); |
| | | for (AuctionSalesroomGoods salesroomGoods : auctionSalesroomGoods) { |
| | | salesroomGoods.setStatus(AuctionGoodsStatusEnum.ENDED); |
| | | GoodsStockUpdDTO goodsStockUpdDTO = new GoodsStockUpdDTO(); |
| | | goodsStockUpdDTO.setGoodsSkuId(salesroomGoods.getGoodsSkuId()); |
| | | goodsStockUpdDTO.setAuctionStock(salesroomGoods.getSalesroomStock()); |
| | | dtoList.add(goodsStockUpdDTO); |
| | | } |
| | | // 批量更新商品库存 |
| | | auctionSalesroomGoodsMapper.updateBatchById(auctionSalesroomGoods); |
| | | goodsSkuClient.updGoodsStock(dtoList, SecurityConstants.INNER); |
| | | } |
| | | // 退保证金 |
| | | List<AuctionBidRecord> auctionBidRecordList = auctionBidRecordMapper.selectList( |
| | | Wrappers.<AuctionBidRecord>lambdaQuery() |
| | | .eq(AuctionBidRecord::getAuctionSalesroomId, auctionSalesroomId) |
| | | .eq(AuctionBidRecord::getStatus, BidStatusEnum.ELIMINATE)); |
| | | List<Long> memberIdlist = auctionBidRecordList.stream().map(AuctionBidRecord::getMemberId) |
| | | .collect(Collectors.toList()); |
| | | if (StringUtils.isNotEmpty(memberIdlist)) { |
| | | OrderAuctionBondDTO orderAuctionBondDTO = new OrderAuctionBondDTO(); |
| | | orderAuctionBondDTO.setAuctionSalesroomId(auctionSalesroom.getId()); |
| | | orderAuctionBondDTO.setUserList(memberIdlist); |
| | | orderClient.getOrderAuctionBond(orderAuctionBondDTO, SecurityConstants.INNER); |
| | | } |
| | | } |
| | | } |