rentaiming
2024-07-19 88b8d896a5270b212e71e11f92cb97448559bab4
ruoyi-modules/ruoyi-auction/src/main/java/com/ruoyi/auction/service/impl/AuctionSalesroomServiceImpl.java
@@ -422,6 +422,10 @@
            wrapper.eq(AuctionSalesroom::getDelFlag,0);
            byId =this.getOne(wrapper);
        }
        if (byId.getType().getCode()==0){
            throw new ServiceException("该拍卖会是线下拍卖会");
        }
        MemberAuctionSalesroomInfoVO memberAuctionSalesroomInfoVO=new MemberAuctionSalesroomInfoVO();
        memberAuctionSalesroomInfoVO.setId(byId.getId());
        memberAuctionSalesroomInfoVO.setBound(byId.getBond());
@@ -538,6 +542,9 @@
        wrapper.eq(AuctionSalesroom::getAuctionSalesroomNo,MemberAuctionSalesroomDTO.getSalesroomNO());
        wrapper.eq(AuctionSalesroom::getDelFlag,0);
        AuctionSalesroom auctionSalesroom = this.getOne(wrapper);
        if (auctionSalesroom.getType().getCode()==0){
            throw new ServiceException("该拍卖会是线下拍卖会");
        }
        MemberAuctionSalesroomVO memberAuctionSalesroomVO=new MemberAuctionSalesroomVO();
        memberAuctionSalesroomVO.setSalesroomName(auctionSalesroom.getSalesroomName());
        memberAuctionSalesroomVO.setStatus(auctionSalesroom.getStatus().getCode());
@@ -631,14 +638,16 @@
            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("出价不能比当前最高价低");
            if (byId.getSalesroomStock()==1){
                if (one3!=null){
                    if (bidVO.getLastBidAmount().doubleValue()<one3.getLastBidAmount().doubleValue()){
                        throw new ServiceException("出价不能比当前最高价低");
                    }
                }
            }
            if (one3!=null){
                if (bidVO.getLastBidAmount().doubleValue()<one3.getLastBidAmount().add(byId.getMinimumMarkupAmount()).doubleValue()){
                    throw new ServiceException("出价不能比当前最高价低加每次加价低");
                if (one3!=null){
                    if (bidVO.getLastBidAmount().doubleValue()<one3.getLastBidAmount().add(byId.getMinimumMarkupAmount()).doubleValue()){
                        throw new ServiceException("出价不能比当前最高价低加每次加价低");
                    }
                }
            }
@@ -646,10 +655,6 @@
            if (bigDecimal.doubleValue()>bidVO.getLastBidAmount().doubleValue()){
                throw new ServiceException("出价不能比每次最少加价低");
            }
            LambdaQueryWrapper<AuctionBidRecord> wrapper1=Wrappers.lambdaQuery();
            wrapper1.eq(AuctionBidRecord::getMemberId,bidVO.getMemberId());
@@ -659,10 +664,6 @@
            AuctionBidRecord one = auctionBidRecordService.getOne(wrapper1);
            if (one!=null){
                BigDecimal bigDecimal1=one.getLastBidAmount().add(byId.getMinimumMarkupAmount());
                if (bigDecimal1.doubleValue()>bidVO.getLastBidAmount().doubleValue()){
                    throw new ServiceException("出价不能比上次出价加每次最少加价低");
                }
                one.setLastBidAmount(bidVO.getLastBidAmount());
                one.setLastBidTime(LocalDateTime.now());
                one.setBidCount(one.getBidCount()+1);
@@ -729,6 +730,7 @@
            wrapper1.orderByDesc(AuctionBidRecord::getLastBidAmount);
            wrapper1.last("limit 1");
            AuctionBidRecord one = auctionBidRecordService.getOne(wrapper1);
            if (byId.getAuctionStock()==1){
                if (one != null) {
                    BigDecimal bigDecimal1 = one.getLastBidAmount().add(byId.getMinimumMarkupAmount());
                    if (bigDecimal1.doubleValue() > bidVO.getLastBidAmount().doubleValue()) {
@@ -736,6 +738,7 @@
                    }
                }
            }
            LambdaQueryWrapper<AuctionBidRecord> wrapper3=Wrappers.lambdaQuery();
            wrapper3.eq(AuctionBidRecord::getTargetId,bidVO.getTargetId());
            wrapper3.eq(AuctionBidRecord::getDelFlag,0);