| | |
| | | import com.ruoyi.system.api.feignClient.OrderClient; |
| | | import com.ruoyi.system.api.feignClient.SysUserClient; |
| | | import java.math.BigDecimal; |
| | | import java.math.RoundingMode; |
| | | import java.time.LocalDateTime; |
| | | import java.util.*; |
| | | import java.util.concurrent.ConcurrentHashMap; |
| | |
| | | wrapper1.eq(AuctionSalesroomGoods::getStatus,2); |
| | | wrapper1.eq(AuctionSalesroomGoods::getDelFlag,0); |
| | | wrapper1.eq(AuctionSalesroomGoods::getAuctionSalesroomId,ationSalesroomGoodsDTO.getAuctionSalesroomId()); |
| | | wrapper1.orderByDesc(AuctionSalesroomGoods::getSortNum); |
| | | wrapper1.orderByDesc(AuctionSalesroomGoods::getEndTime); |
| | | wrapper1.last("limit 1"); |
| | | auctionSalesroomGoods = this.getOne(wrapper1); |
| | | if (auctionSalesroomGoods==null){ |
| | |
| | | LambdaQueryWrapper<AuctionSalesroomGoods> wrapper=Wrappers.lambdaQuery(); |
| | | wrapper.eq(AuctionSalesroomGoods::getStatus,0); |
| | | wrapper.eq(AuctionSalesroomGoods::getDelFlag,0); |
| | | wrapper.eq(AuctionSalesroomGoods::getBackupStatus,false); |
| | | wrapper.eq(AuctionSalesroomGoods::getAuctionSalesroomId,ationSalesroomGoodsDTO.getAuctionSalesroomId()); |
| | | wrapper.orderByAsc(AuctionSalesroomGoods::getSortNum); |
| | | List<AuctionSalesroomGoods> auctionSalesroomGoods = this.list(wrapper); |
| | |
| | | LambdaQueryWrapper<AuctionSalesroomGoods> wrapper=Wrappers.lambdaQuery(); |
| | | wrapper.eq(AuctionSalesroomGoods::getStatus,1); |
| | | wrapper.eq(AuctionSalesroomGoods::getDelFlag,0); |
| | | wrapper.eq(AuctionSalesroomGoods::getBackupStatus,false); |
| | | wrapper.eq(AuctionSalesroomGoods::getAuctionSalesroomId,ationSalesroomGoodsDTO.getAuctionSalesroomId()); |
| | | wrapper.last("limit 1"); |
| | | AuctionSalesroomGoods auctionSalesroomGoods = this.getOne(wrapper); |
| | |
| | | currentAuctionSalesroomGoods.setGoodsSkustatus(auctionSalesroomGoods.getStatus().getCode()); |
| | | currentAuctionSalesroomGoods.setListingDuration(auctionSalesroomGoods.getListingDuration()); |
| | | auctionSalesroomVO.setCurrentAuctionSalesroomGoods(currentAuctionSalesroomGoods); |
| | | list.add(auctionSalesroomGoods.getSortNum()); |
| | | list.add(auctionSalesroomGoods.getId()); |
| | | } |
| | | LambdaQueryWrapper<AuctionSalesroomGoods> wrapper1=Wrappers.lambdaQuery(); |
| | | wrapper1.eq(AuctionSalesroomGoods::getDelFlag,0); |
| | | wrapper1.eq(AuctionSalesroomGoods::getStatus,0); |
| | | wrapper1.eq(AuctionSalesroomGoods::getBackupStatus,false); |
| | | wrapper1.eq(AuctionSalesroomGoods::getAuctionSalesroomId,ationSalesroomGoodsDTO.getAuctionSalesroomId()); |
| | | if (auctionSalesroomGoods!=null) { |
| | | wrapper1.eq(AuctionSalesroomGoods::getSortNum, auctionSalesroomGoods.getSortNum() + 1); |
| | | list.add(auctionSalesroomGoods.getSortNum()+1); |
| | | |
| | | }else{ |
| | | LambdaQueryWrapper<AuctionSalesroomGoods> wrappers=Wrappers.lambdaQuery(); |
| | | wrappers.eq(AuctionSalesroomGoods::getStatus,0); |
| | | wrappers.eq(AuctionSalesroomGoods::getDelFlag,0); |
| | | wrappers.eq(AuctionSalesroomGoods::getBackupStatus,false); |
| | | wrappers.eq(AuctionSalesroomGoods::getAuctionSalesroomId,ationSalesroomGoodsDTO.getAuctionSalesroomId()); |
| | | wrappers.orderByAsc(AuctionSalesroomGoods::getSortNum); |
| | | wrappers.last("limit 1"); |
| | |
| | | currentAuctionSalesroomGoods.setListingDuration(auctionSalesroomGoodss.getListingDuration()); |
| | | auctionSalesroomVO.setCurrentAuctionSalesroomGoods(currentAuctionSalesroomGoods); |
| | | wrappers.eq(AuctionSalesroomGoods::getSortNum, auctionSalesroomGoodss.getSortNum()); |
| | | list.add(auctionSalesroomGoodss.getSortNum()); |
| | | list.add(auctionSalesroomGoodss.getId()); |
| | | } |
| | | |
| | | |
| | |
| | | nextAuctionSalesroomGoods.setGoodsSkustatus(auctionSalesroomGoods1.getStatus().getCode()); |
| | | nextAuctionSalesroomGoods.setGoodsSkuId(auctionSalesroomGoods1.getId()); |
| | | auctionSalesroomVO.setNextAuctionSalesroomGoods(nextAuctionSalesroomGoods); |
| | | list.add(auctionSalesroomGoods1.getId()); |
| | | } |
| | | LambdaQueryWrapper<AuctionSalesroomGoods> wrapper2=Wrappers.lambdaQuery(); |
| | | if(list.size()>0){ |
| | | wrapper2.notIn(AuctionSalesroomGoods::getSortNum,list); |
| | | wrapper2.notIn(AuctionSalesroomGoods::getId,list); |
| | | } |
| | | wrapper2.eq(AuctionSalesroomGoods::getAuctionSalesroomId,ationSalesroomGoodsDTO.getAuctionSalesroomId()); |
| | | wrapper2.orderByAsc(AuctionSalesroomGoods::getSortNum); |
| | | wrapper2.orderByAsc(AuctionSalesroomGoods::getStatus); |
| | | wrapper2.orderByAsc(AuctionSalesroomGoods::getSortNum); |
| | | wrapper2.eq(AuctionSalesroomGoods::getBackupStatus,false); |
| | | List<AuctionSalesroomGoods> auctionSalesroomGoods2 = this.list(wrapper2); |
| | | for (AuctionSalesroomGoods salesroomGoods:auctionSalesroomGoods2){ |
| | | ForepartAuctionSalesroomGoodsVO forepartAuctionSalesroomGoodsVO1=new ForepartAuctionSalesroomGoodsVO(); |
| | |
| | | wrapper2.orderByAsc(AuctionSalesroomGoods::getSortNum); |
| | | wrapper2.last("limit 1"); |
| | | AuctionSalesroomGoods auctionSalesroomGoods = this.getOne(wrapper2); |
| | | |
| | | if (auctionSalesroomGoods==null){ |
| | | throw new ServiceException("以没有待拍卖商品"); |
| | | } |
| | | |
| | | if(auctionSalesroomGoods!=null){ |
| | | auctionSalesroomGoods.setStatus(AuctionGoodsStatusEnum.IN_PROGRESS); |
| | | auctionSalesroomGoods.setStartTime(LocalDateTime.now()); |
| | |
| | | } |
| | | |
| | | } |
| | | List<Long> list=new ArrayList<>(); |
| | | Set<Long> list=new HashSet<>(); |
| | | LambdaQueryWrapper<AuctionBidRecord> wrapper = Wrappers.lambdaQuery(); |
| | | wrapper.eq(AuctionBidRecord::getAuctionSalesroomId, ationSalesroomGoodsDTO.getAuctionSalesroomId()); |
| | | wrapper.eq(AuctionBidRecord::getDelFlag, 0); |
| | | wrapper.eq(AuctionBidRecord::getStatus,0); |
| | | wrapper.eq(AuctionBidRecord::getStatus,2); |
| | | List<AuctionBidRecord> auctionBidRecordList = auctionBidRecordMapper.selectList(wrapper); |
| | | for (AuctionBidRecord auctionBidRecord:auctionBidRecordList){ |
| | | list.add(auctionBidRecord.getMemberId()); |
| | | } |
| | | if (list.size()>0){ |
| | | OrderAuctionBondDTO orderAuctionBondDTO=new OrderAuctionBondDTO(); |
| | | orderAuctionBondDTO.setAuctionSalesroomId(auctionSalesroom.getId()); |
| | | orderAuctionBondDTO.setUserList(list); |
| | | orderClient.getOrderAuctionBond(orderAuctionBondDTO, |
| | | SecurityConstants.INNER); |
| | | }else{ |
| | | OrderAuctionBondDTO orderAuctionBondDTO=new OrderAuctionBondDTO(); |
| | | orderAuctionBondDTO.setAuctionSalesroomId(auctionSalesroom.getId()); |
| | | orderAuctionBondDTO.setUserList(list); |
| | |
| | | wrapper2.eq(AuctionSalesroomGoods::getDelFlag,0); |
| | | wrapper2.eq(AuctionSalesroomGoods::getId,auctionSalesroomGoodsDTO.getGoodsSkuId()); |
| | | AuctionSalesroomGoods auctionSalesroomGoods=this.getOne(wrapper2); |
| | | if (auctionSalesroomGoods==null){ |
| | | throw new ServiceException("拍卖会已没有待开始拍卖商品"); |
| | | } |
| | | auctionSalesroomGoods.setStatus(AuctionGoodsStatusEnum.IN_PROGRESS); |
| | | auctionSalesroomGoods.setStartTime(LocalDateTime.now()); |
| | | if (auctionSalesroomGoods.getBackupStatus()){ |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | auctionSalesroomGoods.setEndTime(LocalDateTime.now()); |
| | | auctionSalesroomGoods.setStatus(AuctionGoodsStatusEnum.ENDED); |
| | | this.updateById(auctionSalesroomGoods); |
| | | |
| | |
| | | @Override |
| | | public AuctionSalesroomGoodsInfoVO getAuctionSalesroomGoodsInfo(AuctionSalesroomGoodsInfoDTO auctionSalesroomGoodsInfoDTO) { |
| | | AuctionSalesroom byId = auctionSalesroomMapper.selectById(auctionSalesroomGoodsInfoDTO.getAuctionSalesroomId()); |
| | | if (byId==null){ |
| | | LambdaQueryWrapper<AuctionSalesroom> wrapper=Wrappers.lambdaQuery(); |
| | | wrapper.eq(AuctionSalesroom::getAuctionSalesroomNo,auctionSalesroomGoodsInfoDTO.getAuctionSalesroomId()); |
| | | wrapper.eq(AuctionSalesroom::getDelFlag,0); |
| | | byId =auctionSalesroomMapper.selectOne(wrapper); |
| | | } |
| | | AuctionSalesroomGoods byId1 = this.getById(auctionSalesroomGoodsInfoDTO.getGoodsSkuId()); |
| | | GoodsSku goodsSku = goodsSkuClient.getGoodsSkuOne(byId1.getGoodsSkuId(), SecurityConstants.INNER).getData(); |
| | | AuctionSalesroomGoodsInfoVO AuctionSalesroomGoodsInfoVO=new AuctionSalesroomGoodsInfoVO(); |
| | |
| | | wrapper2.eq(AuctionBidRecord::getAuctionType,2); |
| | | wrapper2.eq(AuctionBidRecord::getTargetId,byId1.getId()); |
| | | wrapper2.eq(AuctionBidRecord::getDelFlag,0); |
| | | AuctionBidRecord list2 = auctionBidRecordMapper.selectOne(wrapper1); |
| | | wrapper2.orderByDesc(AuctionBidRecord::getLastBidAmount); |
| | | wrapper2.last("limit 1"); |
| | | AuctionBidRecord list2 = auctionBidRecordMapper.selectOne(wrapper2); |
| | | if (list2!=null){ |
| | | AuctionSalesroomGoodsInfoVO.setZgBid(list2.getLastBidAmount()); |
| | | } |
| | | List<getHomeGoodsSkuXxiVO> homeGoodsSkuXxiVOS=new ArrayList<>(); |
| | | List<GoodsInfoTitleValueVO> goodsInfoTitleValueVOList = goodsSkuClient.getlistByGoodsId(goodsSku.getId(), SecurityConstants.INNER).getData(); |
| | | Collections.sort(goodsInfoTitleValueVOList, Comparator.comparingInt(GoodsInfoTitleValueVO::getSortNum)); |
| | | for (GoodsInfoTitleValueVO goodsInfoTitleValueVO:goodsInfoTitleValueVOList){ |
| | | getHomeGoodsSkuXxiVO getHomeGoodsSkuXxiVOs=new getHomeGoodsSkuXxiVO(); |
| | | getHomeGoodsSkuXxiVOs.setContent(goodsInfoTitleValueVO.getContent()); |
| | | getHomeGoodsSkuXxiVOs.setTitleName(goodsInfoTitleValueVO.getTitleName()); |
| | | homeGoodsSkuXxiVOS.add(getHomeGoodsSkuXxiVOs); |
| | | } |
| | | if (goodsInfoTitleValueVOList!=null){ |
| | | Collections.sort(goodsInfoTitleValueVOList, Comparator.comparingInt(GoodsInfoTitleValueVO::getSortNum)); |
| | | for (GoodsInfoTitleValueVO goodsInfoTitleValueVO:goodsInfoTitleValueVOList){ |
| | | getHomeGoodsSkuXxiVO getHomeGoodsSkuXxiVOs=new getHomeGoodsSkuXxiVO(); |
| | | getHomeGoodsSkuXxiVOs.setContent(goodsInfoTitleValueVO.getContent()); |
| | | getHomeGoodsSkuXxiVOs.setTitleName(goodsInfoTitleValueVO.getTitleName()); |
| | | homeGoodsSkuXxiVOS.add(getHomeGoodsSkuXxiVOs); |
| | | } |
| | | } |
| | | |
| | | AuctionSalesroomGoodsInfoVO.setXxiVOS(homeGoodsSkuXxiVOS); |
| | | |
| | | return AuctionSalesroomGoodsInfoVO; |
| | |
| | | @Override |
| | | public List<AuctionBidRecordVO> getAuctionBidRecord(AuctionSalesroomGoodsInfoDTO auctionSalesroomGoodsInfoDTO) { |
| | | LambdaQueryWrapper<AuctionBidRecord> wrapper=Wrappers.lambdaQuery(); |
| | | wrapper.eq(AuctionBidRecord::getAuctionSalesroomId,auctionSalesroomGoodsInfoDTO.getAuctionSalesroomId()); |
| | | |
| | | AuctionSalesroom byId = auctionSalesroomMapper.selectById(auctionSalesroomGoodsInfoDTO.getAuctionSalesroomId()); |
| | | if (byId==null){ |
| | | LambdaQueryWrapper<AuctionSalesroom> wrapper1=Wrappers.lambdaQuery(); |
| | | wrapper1.eq(AuctionSalesroom::getAuctionSalesroomNo,auctionSalesroomGoodsInfoDTO.getAuctionSalesroomId()); |
| | | wrapper1.eq(AuctionSalesroom::getDelFlag,0); |
| | | byId =auctionSalesroomMapper.selectOne(wrapper1); |
| | | } |
| | | |
| | | if (auctionSalesroomGoodsInfoDTO.getAuctionSalesroomId()!=null){ |
| | | wrapper.eq(AuctionBidRecord::getAuctionSalesroomId,byId.getId()); |
| | | } |
| | | wrapper.eq(AuctionBidRecord::getDelFlag,0); |
| | | wrapper.eq(AuctionBidRecord::getTargetId,auctionSalesroomGoodsInfoDTO.getGoodsSkuId()); |
| | | wrapper.orderByDesc(AuctionBidRecord::getLastBidAmount); |
| | |
| | | auctionBidRecordVOList.add(auctionBidRecordVO); |
| | | } |
| | | LambdaQueryWrapper<AuctionBidRecord> wrapper1=Wrappers.lambdaQuery(); |
| | | wrapper1.eq(AuctionBidRecord::getAuctionSalesroomId,auctionSalesroomGoodsInfoDTO.getAuctionSalesroomId()); |
| | | if (auctionSalesroomGoodsInfoDTO.getAuctionSalesroomId()!=null){ |
| | | wrapper1.eq(AuctionBidRecord::getAuctionSalesroomId,auctionSalesroomGoodsInfoDTO.getAuctionSalesroomId()); |
| | | } |
| | | wrapper1.eq(AuctionBidRecord::getDelFlag,0); |
| | | wrapper1.eq(AuctionBidRecord::getTargetId,auctionSalesroomGoodsInfoDTO.getGoodsSkuId()); |
| | | wrapper1.eq(AuctionBidRecord::getMemberId,auctionSalesroomGoodsInfoDTO.getMemberId()); |
| | | wrapper.last("limit 1"); |
| | | AuctionBidRecord auctionBidRecord = auctionBidRecordMapper.selectOne(wrapper); |
| | | wrapper1.last("limit 1"); |
| | | AuctionBidRecord auctionBidRecord = auctionBidRecordMapper.selectOne(wrapper1); |
| | | if (auctionBidRecord!=null){ |
| | | LambdaQueryWrapper<AuctionBidRecord> wrapper3=Wrappers.lambdaQuery(); |
| | | wrapper3.eq(AuctionBidRecord::getAuctionSalesroomId,auctionSalesroomGoodsInfoDTO.getAuctionSalesroomId()); |
| | |
| | | auctionBidRecordVO.setLastBidTime(auctionBidRecord.getLastBidTime()); |
| | | Member data = emberClient.getMembeOne(auctionBidRecord.getMemberId(), |
| | | SecurityConstants.INNER).getData(); |
| | | auctionBidRecordVO.setMemberName(data.getNickname()); |
| | | auctionBidRecordVO.setMemberId(data.getId()); |
| | | auctionBidRecordVOList.add(auctionBidRecordVO); |
| | | if (data!=null){ |
| | | auctionBidRecordVO.setMemberName(data.getNickname()); |
| | | auctionBidRecordVO.setMemberId(data.getId()); |
| | | } |
| | | if (data!=null){ |
| | | Boolean b=false; |
| | | for (AuctionBidRecordVO auctionBidRecordVOs:auctionBidRecordVOList){ |
| | | if (auctionBidRecordVOs.getMemberId().equals(data.getId())){ |
| | | b=true; |
| | | break; |
| | | } |
| | | } |
| | | if (!b){ |
| | | auctionBidRecordVOList.add(auctionBidRecordVO); |
| | | } |
| | | }else{ |
| | | auctionBidRecordVOList.add(auctionBidRecordVO); |
| | | } |
| | | |
| | | } |
| | | } |
| | | |
| | |
| | | SecurityConstants.INNER); |
| | | MemberAddress memberAddress=memberAddressR.getData(); |
| | | |
| | | |
| | | CustomConfig memberPointsMoney = sysUserClient.getconfig("MEMBER_POINTS_MONEY").getData(); |
| | | CustomConfig memberPointsPoints = sysUserClient.getconfig("MEMBER_POINTS_POINTS").getData(); |
| | | Double aDouble= Double.valueOf(memberPointsMoney.getConfigValue()) * Double.valueOf(memberPointsPoints.getConfigValue()); |
| | | BigDecimal pi=lastBidAmount.multiply(new BigDecimal(aDouble)); |
| | | order.setPoints(pi.intValue()); |
| | | |
| | | if (lastBidAmount.intValue()>0){ |
| | | BigDecimal divide = lastBidAmount.divide(new BigDecimal(memberPointsMoney.getConfigValue())); |
| | | BigDecimal roundedDown = divide.setScale(0, RoundingMode.DOWN); |
| | | BigDecimal aDouble= roundedDown.multiply(new BigDecimal(memberPointsPoints.getConfigValue())); |
| | | order.setPoints(aDouble.intValue()); |
| | | }else{ |
| | | order.setPoints(0); |
| | | } |
| | | |
| | | |
| | | if (memberAddress!=null){ |
| | | order.setReceiverCity(memberAddress.getCity()); |
| | | order.setReceiverDetailAddress(memberAddress.getDetailedAddress()); |