| | |
| | | LambdaQueryWrapper<AuctionBrowseRecord> wrapper3=Wrappers.lambdaQuery(); |
| | | wrapper3.eq(AuctionBrowseRecord::getDelFlag,0); |
| | | wrapper3.eq(AuctionBrowseRecord::getTargetId,memberAuctionSalesroomDTO.getAuctionSalesroomId()); |
| | | wrapper3.eq(AuctionBrowseRecord::getBrowseType,AuctionOrderTypeEnum.AUCTION_ITEMS); |
| | | wrapper3.eq(AuctionBrowseRecord::getMemberId,memberAuctionSalesroomDTO.getMemberId()); |
| | | wrapper3.ge(AuctionBrowseRecord::getCreateTime, now) |
| | | .le(AuctionBrowseRecord::getCreateTime, newTime7); |
| | |
| | | query.getEndTime()), AuctionSalesroom::getStartTime, |
| | | query.getStartTime(), |
| | | query.getEndTime()) |
| | | .orderByDesc(AuctionSalesroom::getCreateTime) |
| | | .page(new Page<>(query.getPageCurr(), query.getPageSize())); |
| | | |
| | | List<AuctionSalesroom> records = page.getRecords(); |
| | | if (StringUtils.isNull(records)) { |
| | | return PageDTO.empty(page); |
| | |
| | | .between(StringUtils.isNotNull(query.getStartTime()) && StringUtils.isNotNull( |
| | | query.getEndTime()), AuctionSalesroom::getStartTime, query.getStartTime(), |
| | | query.getEndTime()) |
| | | .orderByAsc(AuctionSalesroom::getStartTime) |
| | | .page(new Page<>(query.getPageCurr(), query.getPageSize())); |
| | | List<AuctionSalesroom> records = page.getRecords(); |
| | | if (StringUtils.isNull(records)) { |
| | |
| | | * @param id 拍卖场商品id |
| | | */ |
| | | @Override |
| | | public void stopCurrentGoods(Long id) { |
| | | public void stopCurrentGoods(Long id) throws JsonProcessingException { |
| | | AuctionSalesroomGoods auctionSalesroomGoods = auctionSalesroomGoodsMapper.selectById(id); |
| | | if (StringUtils.isNull(auctionSalesroomGoods)) { |
| | | throw new ServiceException("拍卖商品不存在"); |
| | | } |
| | | auctionSalesroomGoods.setStatus(AuctionGoodsStatusEnum.ENDED); |
| | | auctionSalesroomGoodsMapper.updateById(auctionSalesroomGoods); |
| | | Map<String, Object> map = new ConcurrentHashMap<>(); |
| | | map.put("notification_type", NotificationTypeConstant.AUCTION_SALESROOM_GOODS); |
| | | map.put("auctionSalesroomId", auctionSalesroomGoods.getAuctionSalesroomId().toString()); |
| | | map.put("auctionSalesroomGoodsId", auctionSalesroomGoods.getId().toString()); |
| | | map.put("AuctionTypeEnum", auctionSalesroomGoods.getStatus()); |
| | | map.put("message_type", "stop"); |
| | | map.put("type", "2"); |
| | | String msg = objectMapper.writeValueAsString(map); |
| | | sysUserClient.pushAll(msg, SecurityConstants.INNER); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @param id 拍卖场商品id |
| | | */ |
| | | @Override |
| | | public void startNextGoods(Long id) { |
| | | public void startNextGoods(Long id) throws JsonProcessingException { |
| | | AuctionSalesroomGoods auctionSalesroomGoods = auctionSalesroomGoodsMapper.selectById(id); |
| | | if (StringUtils.isNull(auctionSalesroomGoods)) { |
| | | throw new ServiceException("拍卖商品不存在"); |
| | | } |
| | | auctionSalesroomGoods.setStatus(AuctionGoodsStatusEnum.IN_PROGRESS); |
| | | auctionSalesroomGoodsMapper.updateById(auctionSalesroomGoods); |
| | | Map<String, Object> map = new ConcurrentHashMap<>(); |
| | | map.put("notification_type", NotificationTypeConstant.AUCTION_SALESROOM_GOODS); |
| | | map.put("auctionSalesroomId", auctionSalesroomGoods.getAuctionSalesroomId().toString()); |
| | | map.put("auctionSalesroomGoodsId", auctionSalesroomGoods.getId().toString()); |
| | | map.put("AuctionTypeEnum", auctionSalesroomGoods.getStatus()); |
| | | map.put("message_type", "start"); |
| | | map.put("type", "2"); |
| | | String msg = objectMapper.writeValueAsString(map); |
| | | sysUserClient.pushAll(msg, SecurityConstants.INNER); |
| | | } |
| | | |
| | | /** |
| | |
| | | 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()); |
| | |
| | | @Override |
| | | public void stopPlay(Long auctionSalesroomId) { |
| | | iAuctionVideoService.remove(Wrappers.<AuctionVideo>lambdaQuery().eq |
| | | (AuctionVideo::getAuctionSalesroomId, 1L)); |
| | | (AuctionVideo::getAuctionSalesroomId, auctionSalesroomId)); |
| | | } |
| | | |
| | | /** |
| | |
| | | |
| | | Map<String, Object> map = new ConcurrentHashMap<>(); |
| | | map.put("notification_type", NotificationTypeConstant.AUCTION_SALESROOM); |
| | | map.put("auctionSalesroomId", auctionSalesroom.getId()); |
| | | map.put("AuctionTypeEnum",auctionSalesroom.getStatus()); |
| | | map.put("auctionSalesroomId", auctionSalesroom.getId().toString()); |
| | | map.put("AuctionTypeEnum", auctionSalesroom.getStatus()); |
| | | map.put("message_type", "start"); |
| | | map.put("type", "1"); |
| | | String msg = objectMapper.writeValueAsString(map); |
| | |
| | | @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) { |
| | |
| | | } |
| | | Map<String, Object> map = new ConcurrentHashMap<>(); |
| | | map.put("notification_type", NotificationTypeConstant.AUCTION_SALESROOM); |
| | | map.put("auctionSalesroomId", auctionSalesroom.getId()); |
| | | map.put("auctionSalesroomId", auctionSalesroom.getId().toString()); |
| | | map.put("AuctionTypeEnum",auctionSalesroom.getStatus()); |
| | | map.put("message_type", "end"); |
| | | map.put("type", "1"); |