From 88b8d896a5270b212e71e11f92cb97448559bab4 Mon Sep 17 00:00:00 2001
From: rentaiming <806181062@qq.com>
Date: 星期五, 19 七月 2024 16:49:56 +0800
Subject: [PATCH] 修改bug

---
 ruoyi-modules/ruoyi-auction/src/main/java/com/ruoyi/auction/service/impl/AuctionSalesroomServiceImpl.java |   33 ++++++++++++++++++---------------
 1 files changed, 18 insertions(+), 15 deletions(-)

diff --git a/ruoyi-modules/ruoyi-auction/src/main/java/com/ruoyi/auction/service/impl/AuctionSalesroomServiceImpl.java b/ruoyi-modules/ruoyi-auction/src/main/java/com/ruoyi/auction/service/impl/AuctionSalesroomServiceImpl.java
index 8a9e834..1cbe7a6 100644
--- a/ruoyi-modules/ruoyi-auction/src/main/java/com/ruoyi/auction/service/impl/AuctionSalesroomServiceImpl.java
+++ b/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);

--
Gitblit v1.7.1