mitao
2025-03-10 9c0c919a8016153bc3879ee233c74437a6823570
ruoyi-modules/ruoyi-auction/src/main/java/com/ruoyi/auction/service/impl/AuctionSalesroomServiceImpl.java
@@ -698,8 +698,19 @@
            if (bidVO.getAuctionType() == 2) {
                AuctionSalesroomGoods byId = auctionSalesroomGoodsMapper.selectById(
                        bidVO.getTargetId());
                // 判断否大于最高价
                if (byId.getMaxAmount().compareTo(bidVO.getLastBidAmount()) < 0) {
                    throw new ServiceException("出价不能高出最高价");
                }
                // 查询用户出价记录判断是否第一次出价 首次出价,可以只出起拍价,而不是需要比起拍价高。
                Long count = auctionBidRecordService.lambdaQuery()
                        .eq(AuctionBidRecord::getAuctionSalesroomId, bidVO.getAuctionSalesroomId())
                        .eq(AuctionBidRecord::getTargetId, bidVO.getTargetId())
                        .eq(AuctionBidRecord::getAuctionType, bidVO.getAuctionType())
                        .eq(AuctionBidRecord::getMemberId, bidVO.getMemberId()).count();
                if (byId.getStartingPrice().doubleValue() > bidVO.getLastBidAmount()
                        .doubleValue()) {
                        .doubleValue() && count > 0) {
                    throw new ServiceException("出价不能比起拍价低");
                }
                AuctionSalesroom byId1 = this.getById(bidVO.getAuctionSalesroomId());
@@ -795,8 +806,13 @@
                        .clientType(ClientTypeEnum.MEMBER).build(), SecurityConstants.INNER);
            } else {
                AuctionGoods byId = auctionGoodsService.getById(bidVO.getTargetId());
                // 查询用户出价记录判断是否第一次出价 首次出价,可以只出起拍价,而不是需要比起拍价高。
                Long count = auctionBidRecordService.lambdaQuery()
                        .eq(AuctionBidRecord::getTargetId, bidVO.getTargetId())
                        .eq(AuctionBidRecord::getAuctionType, bidVO.getAuctionType())
                        .eq(AuctionBidRecord::getMemberId, bidVO.getMemberId()).count();
                if (byId.getStartingPrice().doubleValue() > bidVO.getLastBidAmount()
                        .doubleValue()) {
                        .doubleValue() && count > 0) {
                    throw new ServiceException("出价不能比起拍价低");
                }
                BigDecimal bigDecimal = byId.getStartingPrice().add(byId.getMinimumMarkupAmount());