| | |
| | | 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.security.utils.SecurityUtils; |
| | | import com.ruoyi.system.api.RemoteFileService; |
| | | import com.ruoyi.system.api.constants.NotificationTypeConstant; |
| | | import com.ruoyi.system.api.domain.AppMiniLoginVO; |
| | |
| | | if (sysUser==null){ |
| | | throw new ServiceException("手机号未注册"); |
| | | } |
| | | /* if (!SecurityUtils.matchesPassword(arepartAuctionBidRecordDTO.getPassword(), sysUser.getPassword())){ |
| | | if (sysUser.getStatus().equals(1)){ |
| | | throw new ServiceException("该拍卖师账号停用"); |
| | | } |
| | | |
| | | if (!SecurityUtils.matchesPassword(arepartAuctionBidRecordDTO.getPassword(), sysUser.getPassword())){ |
| | | throw new ServiceException("密码输入错误"); |
| | | }*/ |
| | | } |
| | | |
| | | LambdaQueryWrapper<AuctionSalesroom> wrapper=Wrappers.lambdaQuery(); |
| | | wrapper.eq(AuctionSalesroom::getAuctionSalesroomNo,arepartAuctionBidRecordDTO.getAuctionSalesroomQrcode()); |
| | |
| | | memberAuctionSalesroomInfoVO.setAuthentication(byId.getAuthentication()); |
| | | memberAuctionSalesroomInfoVO.setEndTime(byId.getEndTime()); |
| | | memberAuctionSalesroomInfoVO.setSalesroomName(byId.getSalesroomName()); |
| | | memberAuctionSalesroomInfoVO.setEndTime(byId.getEndTime()); |
| | | memberAuctionSalesroomInfoVO.setType(byId.getType()); |
| | | memberAuctionSalesroomInfoVO.setDescription(byId.getDescription()); |
| | | memberAuctionSalesroomInfoVO.setSharePic(byId.getSharePic()); |
| | |
| | | forepartAuctionSalesroomGoodsVO.setStartingPrice(salesroomGoods.getStartingPrice()); |
| | | forepartAuctionSalesroomGoodsVO.setSalesroomStock(salesroomGoods.getSalesroomStock()); |
| | | forepartAuctionSalesroomGoodsVO.setGoodsSkustatus(salesroomGoods.getStatus().getCode()); |
| | | forepartAuctionSalesroomGoodsVO.setMinimumMarkupAmount(salesroomGoods.getMinimumMarkupAmount()); |
| | | forepartAuctionSalesroomGoodsVO.setStartTime(salesroomGoods.getStartTime()); |
| | | forepartAuctionSalesroomGoodsVO.setYears(String.valueOf(goodsSku.getYears())); |
| | | forepartAuctionSalesroomGoodsVO.setListingDuration(salesroomGoods.getListingDuration()); |
| | | forepartAuctionSalesroomGoodsVO.setSpec(goodsSku.getSpec()); |
| | | forepartAuctionSalesroomGoodsVO.setSpecUnit(goodsSku.getSpecUnit()); |
| | | LambdaQueryWrapper<AuctionBidRecord> wrapper1=Wrappers.lambdaQuery(); |
| | |
| | | forepartAuctionSalesroomGoodsVO.setIsBond(1); |
| | | forepartAuctionSalesroomGoodsVO.setIsStatus(1); |
| | | } |
| | | |
| | | LambdaQueryWrapper<AuctionBidRecord> wrapper2=Wrappers.lambdaQuery(); |
| | | wrapper2.eq(AuctionBidRecord::getAuctionSalesroomId,byId.getId()); |
| | | wrapper2.eq(AuctionBidRecord::getAuctionType,2); |
| | | wrapper2.eq(AuctionBidRecord::getTargetId,salesroomGoods.getId()); |
| | | wrapper2.eq(AuctionBidRecord::getDelFlag,0); |
| | | AuctionBidRecord list2 = auctionBidRecordMapper.selectOne(wrapper1); |
| | | if (list2!=null){ |
| | | forepartAuctionSalesroomGoodsVO.setZgBid(list2.getLastBidAmount()); |
| | | } |
| | | |
| | | LambdaQueryWrapper<AuctionBidRecord> wrapper5=Wrappers.lambdaQuery(); |
| | | wrapper5.eq(AuctionBidRecord::getAuctionSalesroomId,byId.getId()); |
| | | wrapper5.eq(AuctionBidRecord::getAuctionType,2); |
| | | wrapper5.eq(AuctionBidRecord::getTargetId,salesroomGoods.getId()); |
| | | wrapper5.eq(AuctionBidRecord::getMemberId,memberAuctionSalesroomDTO.getMemberId()); |
| | | wrapper5.eq(AuctionBidRecord::getDelFlag,0); |
| | | AuctionBidRecord list5 = auctionBidRecordMapper.selectOne(wrapper1); |
| | | if (list5!=null){ |
| | | forepartAuctionSalesroomGoodsVO.setPresentBid(list5.getLastBidAmount()); |
| | | } |
| | | |
| | | forepartAuctionSalesroomGoodsVOS.add(forepartAuctionSalesroomGoodsVO); |
| | | } |
| | | memberAuctionSalesroomInfoVO.setForepartAuctionSalesroomGoodsVO(forepartAuctionSalesroomGoodsVOS); |
| | |
| | | throw new ServiceException("当前拍卖场中标拍品订单未完成,请完成后再试。"); |
| | | } |
| | | // 远程调用订单服务进行退款 |
| | | Map<String, Object> data = orderClient.refund(refundDTOList, |
| | | SecurityConstants.INNER).getData(); |
| | | orderClient.refund1(refundDTO, SecurityConstants.INNER).getData(); |
| | | // 处理退款返回结果 |
| | | List<String> successfulOrders = new ArrayList<>(); |
| | | List<String> failedOrders = new ArrayList<>(); |
| | | |
| | | data.forEach((key, value) -> { |
| | | if ((boolean) value) { |
| | | successfulOrders.add(key); |
| | | } else { |
| | | failedOrders.add(key); |
| | | } |
| | | }); |
| | | // 退款成功的订单修改状态 |
| | | List<Long> ids = new ArrayList<>(); |
| | | |
| | | List<Long> ids=new ArrayList<>(); |
| | | ids.add(orderAuctionBond.getId()); |
| | | |
| | | // 远程调用订单服务修改订单状态 |
| | | orderClient.updateOrderAuctionBondStatus(ids, BondStatusEnum.REFUNDED,SecurityConstants.INNER); |
| | | |
| | |
| | | RefundDTO refundDTO = new RefundDTO(); |
| | | refundDTO.setOrderNo(orderAuctionBond.getOrderNo()); |
| | | refundDTO.setAmount(orderAuctionBond.getBond()); |
| | | refundDTOList.add(refundDTO); |
| | | |
| | | LambdaQueryWrapper<AuctionBidRecord> wrapper = Wrappers.lambdaQuery(); |
| | | wrapper.eq(AuctionBidRecord::getTargetId, memberAuctionSalesroomBondDTO.getAuctionGoodsId()); |
| | |
| | | } |
| | | |
| | | // 远程调用订单服务进行退款 |
| | | Map<String, Object> data = orderClient.refund(refundDTOList, |
| | | orderClient.refund1(refundDTO, |
| | | SecurityConstants.INNER).getData(); |
| | | // 处理退款返回结果 |
| | | List<String> successfulOrders = new ArrayList<>(); |
| | | List<String> failedOrders = new ArrayList<>(); |
| | | |
| | | data.forEach((key, value) -> { |
| | | if ((boolean) value) { |
| | | successfulOrders.add(key); |
| | | } else { |
| | | failedOrders.add(key); |
| | | } |
| | | }); |
| | | // 退款成功的订单修改状态 |
| | | List<Long> ids = new ArrayList<>(); |
| | | |
| | | List<Long> ids=new ArrayList<>(); |
| | | ids.add(orderAuctionBond.getId()); |
| | | // 远程调用订单服务修改订单状态 |
| | | orderClient.updateOrderAuctionBondStatus(ids,BondStatusEnum.REFUNDED,SecurityConstants.INNER); |
| | |
| | | if (byId.getStartingPrice().doubleValue()>bidVO.getLastBidAmount().doubleValue()){ |
| | | throw new ServiceException("出价不能比起拍价低"); |
| | | } |
| | | |
| | | LambdaQueryWrapper<AuctionBidRecord> wrapper3=Wrappers.lambdaQuery(); |
| | | wrapper3.eq(AuctionBidRecord::getAuctionSalesroomId,bidVO.getAuctionSalesroomId()); |
| | | wrapper3.eq(AuctionBidRecord::getTargetId,bidVO.getTargetId()); |
| | | wrapper3.eq(AuctionBidRecord::getDelFlag,0); |
| | | wrapper3.orderByDesc(AuctionBidRecord::getLastBidAmount); |
| | | wrapper3.last("limit 1"); |
| | | AuctionBidRecord one3 = auctionBidRecordService.getOne(wrapper3); |
| | | if (one3!=null){ |
| | | if (bidVO.getLastBidAmount().doubleValue()<one3.getLastBidAmount().doubleValue()){ |
| | | throw new ServiceException("出价不能比当前最高价低"); |
| | | } |
| | | } |
| | | |
| | | BigDecimal bigDecimal=byId.getStartingPrice().add(byId.getMinimumMarkupAmount()); |
| | | if (bigDecimal.doubleValue()>bidVO.getLastBidAmount().doubleValue()){ |
| | | throw new ServiceException("出价不能比每次最少加价低"); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | LambdaQueryWrapper<AuctionBidRecord> wrapper1=Wrappers.lambdaQuery(); |
| | | wrapper1.eq(AuctionBidRecord::getMemberId,bidVO.getMemberId()); |
| | | wrapper1.eq(AuctionBidRecord::getAuctionSalesroomId,bidVO.getAuctionSalesroomId()); |
| | | wrapper1.eq(AuctionBidRecord::getTargetId,bidVO.getTargetId()); |
| | | wrapper1.eq(AuctionBidRecord::getDelFlag,0); |
| | | |
| | | AuctionBidRecord one = auctionBidRecordService.getOne(wrapper1); |
| | | if (one!=null){ |
| | | BigDecimal bigDecimal1=one.getLastBidAmount().add(byId.getMinimumMarkupAmount()); |
| | |
| | | one.setTargetId(bidVO.getTargetId()); |
| | | one.setMemberId(bidVO.getMemberId()); |
| | | one.setLastBidTime(LocalDateTime.now()); |
| | | one.setNickname(membeOne.getNickname()); |
| | | if(membeOne.getRealName()!=null&&membeOne.getRealName()!=""){ |
| | | one.setNickname(membeOne.getRealName()); |
| | | }else{ |
| | | one.setNickname(membeOne.getNickname()); |
| | | } |
| | | |
| | | one.setPhone(membeOne.getPhone()); |
| | | one.setAuctionType(AuctionOrderTypeEnum.AUCTION_ITEMS); |
| | | one.setStatus(BidStatusEnum.ELIMINATE); |
| | |
| | | |
| | | } |
| | | } |
| | | |
| | | LambdaQueryWrapper<AuctionBidRecord> wrapper3=Wrappers.lambdaQuery(); |
| | | wrapper3.eq(AuctionBidRecord::getTargetId,bidVO.getTargetId()); |
| | | wrapper3.eq(AuctionBidRecord::getDelFlag,0); |
| | |
| | | one3.setAuctionSalesroomId(bidVO.getAuctionSalesroomId()); |
| | | one3.setTargetId(bidVO.getTargetId()); |
| | | one3.setMemberId(bidVO.getMemberId()); |
| | | if(membeOne.getRealName()!=null||membeOne.getRealName()!=""){ |
| | | one3.setNickname(membeOne.getRealName()); |
| | | }else{ |
| | | one3.setNickname(membeOne.getNickname()); |
| | | } |
| | | one3.setPhone(membeOne.getPhone()); |
| | | one3.setLastBidTime(LocalDateTime.now()); |
| | | one3.setAuctionType(AuctionOrderTypeEnum.REGULAR_ITEMS); |
| | | one3.setStatus(BidStatusEnum.ELIMINATE); |
| | |
| | | vo.setAuctionSalesroomGoodsVOS(collect); |
| | | if (StringUtils.isNotNull(vo.getCurrentAuctionSalesroomGoods())) { |
| | | int index = collect.indexOf(vo.getCurrentAuctionSalesroomGoods()); |
| | | vo.setNextAuctionSalesroomGoods(collect.get(index + 1)); |
| | | if (collect.size() > 1) { |
| | | vo.setNextAuctionSalesroomGoods(collect.get(index + 1)); |
| | | } |
| | | // 分页查询当前拍品出价信息 |
| | | List<AuctionBidRecord> list = auctionBidRecordService.lambdaQuery() |
| | | .eq(AuctionBidRecord::getTargetId, |
| | |
| | | Wrappers.<AuctionBidRecord>lambdaQuery() |
| | | .eq(AuctionBidRecord::getAuctionSalesroomId, auctionSalesroomId) |
| | | .eq(AuctionBidRecord::getStatus, BidStatusEnum.ELIMINATE)); |
| | | List<Long> memberIdlist = auctionBidRecordList.stream().map(AuctionBidRecord::getMemberId) |
| | | .collect(Collectors.toList()); |
| | | Set<Long> memberIdlist = auctionBidRecordList.stream().map(AuctionBidRecord::getMemberId) |
| | | .collect(Collectors.toSet()); |
| | | if (StringUtils.isNotEmpty(memberIdlist)) { |
| | | OrderAuctionBondDTO orderAuctionBondDTO = new OrderAuctionBondDTO(); |
| | | orderAuctionBondDTO.setAuctionSalesroomId(auctionSalesroom.getId()); |