| | |
| | | import com.ruoyi.auction.controller.management.vo.MgtAuctionSalesroomGoodsVO; |
| | | import com.ruoyi.auction.controller.management.vo.MgtAuctionSalesroomScreenVO; |
| | | import com.ruoyi.auction.controller.management.vo.MgtAuctionSalesroomVO; |
| | | import com.ruoyi.auction.domain.AuctionBidRecord; |
| | | import com.ruoyi.auction.domain.AuctionBrowseRecord; |
| | | import com.ruoyi.auction.domain.AuctionSalesroomGoods; |
| | | import com.ruoyi.auction.domain.AuctionVideo; |
| | | import com.ruoyi.auction.domain.*; |
| | | import com.ruoyi.auction.mapper.AuctionBidRecordMapper; |
| | | import com.ruoyi.auction.mapper.AuctionBondJlMapper; |
| | | import com.ruoyi.auction.mapper.AuctionSalesroomGoodsMapper; |
| | | import com.ruoyi.auction.mapper.AuctionSalesroomMapper; |
| | | import com.ruoyi.auction.service.IAuctionBidRecordService; |
| | |
| | | private AuctionBidRecordMapper auctionBidRecordMapper; |
| | | |
| | | @Resource |
| | | private AuctionBondJlMapper auctionBondJlMapper; |
| | | |
| | | @Resource |
| | | private RemoteFileService remoteFileService; |
| | | public static RequestConfig config = RequestConfig.custom().setConnectTimeout(5000).setSocketTimeout(5000).build(); |
| | | // 配置您申请的KEY,在个人中心->我的数据,接口名称上方查看 |
| | |
| | | |
| | | @Override |
| | | public AuctionSalesroom getAuctionBidRecordOne(ForepartAuctionBidRecordDTO arepartAuctionBidRecordDTO) { |
| | | R<SysUser> r=sysUserClient.queryUserByPhone(arepartAuctionBidRecordDTO.getPhone()); |
| | | R<SysUser> r=sysUserClient.queryUserByPhone1(arepartAuctionBidRecordDTO.getPhone()); |
| | | SysUser sysUser=r.getData(); |
| | | if (sysUser==null){ |
| | | throw new ServiceException("手机号未注册"); |
| | | } |
| | | if (sysUser.getStatus().equals(1)){ |
| | | if (sysUser.getStatus().equals("1")){ |
| | | throw new ServiceException("该拍卖师账号停用"); |
| | | } |
| | | |
| | |
| | | memberAuctionSalesroomVO.setBond(auctionSalesroom.getBond()); |
| | | memberAuctionSalesroomVO.setAuthentication(auctionSalesroom.getAuthentication()); |
| | | memberAuctionSalesroomDTO.setAuctionSalesroomId(auctionSalesroom.getId()); |
| | | List<OrderAuctionBond> data = orderClient.getOrderAuctionBondList1(memberAuctionSalesroomDTO, SecurityConstants.INNER).getData(); |
| | | if (data!=null&&data.size()>0){ |
| | | |
| | | LambdaQueryWrapper<AuctionBondJl> wrapper=Wrappers.lambdaQuery(); |
| | | wrapper.eq(AuctionBondJl::getAuctionSalesroomId,auctionSalesroom.getId()); |
| | | wrapper.eq(AuctionBondJl::getMemberId,memberAuctionSalesroomDTO.getMemberId()); |
| | | wrapper.eq(AuctionBondJl::getIsState,0); |
| | | AuctionBondJl auctionBondJl = auctionBondJlMapper.selectOne(wrapper); |
| | | |
| | | if (auctionBondJl!=null){ |
| | | memberAuctionSalesroomVO.setIsApply(2); |
| | | }else{ |
| | | memberAuctionSalesroomVO.setIsApply(1); |
| | |
| | | memberAuctionSalesroomInfoVO.setStatus(byId.getStatus()); |
| | | memberAuctionSalesroomInfoVO.setCoverPic(byId.getCoverPic()); |
| | | |
| | | List<OrderAuctionBond> data = orderClient.getOrderAuctionBondList1(memberAuctionSalesroomDTO, SecurityConstants.INNER).getData(); |
| | | if (data.size()>0){ |
| | | LambdaQueryWrapper<AuctionBondJl> wrapper=Wrappers.lambdaQuery(); |
| | | wrapper.eq(AuctionBondJl::getAuctionSalesroomId,byId.getId()); |
| | | wrapper.eq(AuctionBondJl::getMemberId,memberAuctionSalesroomDTO.getMemberId()); |
| | | wrapper.eq(AuctionBondJl::getIsState,0); |
| | | AuctionBondJl auctionBondJl = auctionBondJlMapper.selectOne(wrapper); |
| | | if (auctionBondJl!=null){ |
| | | memberAuctionSalesroomInfoVO.setIsApply(2); |
| | | }else{ |
| | | memberAuctionSalesroomInfoVO.setIsApply(1); |
| | |
| | | Set<Long> goodsSkuIdList = null; |
| | | goodsSkuIdList = data.stream().map(OrderAuctionBond::getAuctionSalesroomId) |
| | | .collect(Collectors.toSet()); |
| | | Page<AuctionSalesroom> page = new Page<>(); |
| | | page.setSize(memberAuctionSalesroomDTO.getPageSize()); |
| | | page.setCurrent(memberAuctionSalesroomDTO.getPageCurr()); |
| | | |
| | | /* MemberAuctionSalesroomWdDTO memberAuctionSalesroomWdDTO=new MemberAuctionSalesroomWdDTO(); |
| | | if (goodsSkuIdList.size()>0){ |
| | | memberAuctionSalesroomWdDTO.setGoodsSkuIdList(goodsSkuIdList); |
| | |
| | | |
| | | }*/ |
| | | |
| | | Page<AuctionSalesroom> page = new Page<>(); |
| | | page.setSize(memberAuctionSalesroomDTO.getPageSize()); |
| | | page.setCurrent(memberAuctionSalesroomDTO.getPageCurr()); |
| | | LambdaQueryWrapper<AuctionSalesroom> wrapper1=Wrappers.lambdaQuery(); |
| | | if (goodsSkuIdList.size()>0){ |
| | | wrapper1.in(AuctionSalesroom::getId,goodsSkuIdList); |
| | |
| | | " WHEN status = 2 THEN 3\n" + |
| | | " END,status"); |
| | | |
| | | Page<AuctionSalesroom> auctionSalesroomList=this.page(page,wrapper1); |
| | | Page<AuctionSalesroom> auctionSalesroomList=this.page(Page.of(memberAuctionSalesroomDTO.getPageCurr(),memberAuctionSalesroomDTO.getPageSize()),wrapper1); |
| | | PageDTO<WdMemberAuctionSalesroomVO> wdMemberAuctionSalesroomVOPageDTO = PageDTO.of(auctionSalesroomList, WdMemberAuctionSalesroomVO.class); |
| | | List<WdMemberAuctionSalesroomVO> list = wdMemberAuctionSalesroomVOPageDTO.getList(); |
| | | for (WdMemberAuctionSalesroomVO auctionSalesroom:list){ |
| | |
| | | .between(StringUtils.isNotNull(query.getStartTime()) && StringUtils.isNotNull( |
| | | query.getEndTime()), AuctionSalesroom::getStartTime, query.getStartTime(), |
| | | query.getEndTime()) |
| | | .orderByAsc(AuctionSalesroom::getCreateTime) |
| | | .orderByDesc(AuctionSalesroom::getCreateTime) |
| | | .page(new Page<>(query.getPageCurr(), query.getPageSize())); |
| | | List<AuctionSalesroom> records = page.getRecords(); |
| | | if (StringUtils.isNull(records)) { |
| | |
| | | vo.setAuctionSalesroomGoodsVOS(collect); |
| | | if (StringUtils.isNotNull(vo.getCurrentAuctionSalesroomGoods())) { |
| | | int index = collect.indexOf(vo.getCurrentAuctionSalesroomGoods()); |
| | | if (collect.size() > 1) { |
| | | if (collect.size() > 1 && index < collect.size() - 1) { |
| | | vo.setNextAuctionSalesroomGoods(collect.get(index + 1)); |
| | | } |
| | | // 分页查询当前拍品出价信息 |
| | |
| | | public PageDTO<MgtAuctionSalesroomGoodsVO> backupGoods(MgtAuctionSalesroomGoodsQuery query) { |
| | | Page<AuctionSalesroomGoods> page = new Page<>(query.getPageCurr(), query.getPageSize()); |
| | | Set<Long> goodsSkuIdSet = null; |
| | | if (StringUtils.isNotBlank(query.getGoodsName())) { |
| | | List<GoodsSku> data = goodsSkuClient.getGoodsByName(query.getGoodsName(), |
| | | if (StringUtils.isNotBlank(query.getGoodsSkuName())) { |
| | | List<GoodsSku> data = goodsSkuClient.getGoodsByName(query.getGoodsSkuName(), |
| | | SecurityConstants.INNER).getData(); |
| | | if (StringUtils.isNotEmpty(data)) { |
| | | goodsSkuIdSet = data.stream().map(GoodsSku::getId) |
| | |
| | | Wrappers.lambdaQuery(AuctionBidRecord.class) |
| | | .eq(AuctionBidRecord::getAuctionSalesroomId, |
| | | auctionSalesroomGoods.getAuctionSalesroomId()) |
| | | .eq(AuctionBidRecord::getTargetId, auctionSalesroomGoods.getGoodsSkuId()) |
| | | .eq(AuctionBidRecord::getTargetId, auctionSalesroomGoods.getId()) |
| | | .eq(AuctionBidRecord::getAuctionType, AuctionOrderTypeEnum.AUCTION_ITEMS) |
| | | .orderByDesc(AuctionBidRecord::getLastBidAmount)); |
| | | if (CollUtils.isNotEmpty(auctionBidRecordList)) { |
| | |
| | | auctionBidRecords.add(auctionBidRecord); |
| | | } |
| | | } else { |
| | | for (int i = 0; i < auctionSalesroomGoods.getSalesroomStock(); i++) { |
| | | for (int i = 0; i < auctionBidRecordList.size(); i++) { |
| | | AuctionBidRecord auctionBidRecord = auctionBidRecordList.get(i); |
| | | auctionBidRecord.setStatus(BidStatusEnum.SUCCESSFUL); |
| | | auctionBidRecordMapper.updateById(auctionBidRecord); |
| | |
| | | public void stopCurrentAuctionSalesroom(Long auctionSalesroomId) |
| | | throws JsonProcessingException { |
| | | 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( |
| | |
| | | auctionSalesroom.setStatus(AuctionStartStatusEnum.ENDED); |
| | | auctionSalesroom.setEndTime(LocalDateTime.now()); |
| | | auctionSalesroomMapper.updateById(auctionSalesroom); |
| | | |
| | | auctionSalesroomGoods = auctionSalesroomGoods.stream() |
| | | .filter(goods -> goods.getStatus().equals(AuctionGoodsStatusEnum.WAITING)).collect( |
| | | Collectors.toList()); |
| | | if (StringUtils.isNotEmpty(auctionSalesroomGoods)) { |
| | | List<GoodsStockUpdDTO> dtoList = new ArrayList<>(); |
| | | for (AuctionSalesroomGoods salesroomGoods : auctionSalesroomGoods) { |
| | | salesroomGoods.setStatus(AuctionGoodsStatusEnum.ENDED); |
| | | // 等待中的商品退库存 |
| | | if (salesroomGoods.getStatus().equals(AuctionGoodsStatusEnum.WAITING)) { |
| | | GoodsStockUpdDTO goodsStockUpdDTO = new GoodsStockUpdDTO(); |
| | | goodsStockUpdDTO.setGoodsSkuId(salesroomGoods.getGoodsSkuId()); |
| | | goodsStockUpdDTO.setAuctionStock(salesroomGoods.getSalesroomStock()); |
| | | dtoList.add(goodsStockUpdDTO); |
| | | } |
| | | |
| | | GoodsStockUpdDTO goodsStockUpdDTO = new GoodsStockUpdDTO(); |
| | | goodsStockUpdDTO.setGoodsSkuId(salesroomGoods.getGoodsSkuId()); |
| | | goodsStockUpdDTO.setAuctionStock(salesroomGoods.getSalesroomStock()); |
| | | dtoList.add(goodsStockUpdDTO); |
| | | } |
| | | // 批量更新商品库存 |
| | | auctionSalesroomGoodsMapper.updateBatchById(auctionSalesroomGoods); |