From fc8b51f40e71aa09bb49f407c1e9f68ac94ceb58 Mon Sep 17 00:00:00 2001
From: mitao <2763622819@qq.com>
Date: 星期一, 29 七月 2024 18:51:32 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 ruoyi-modules/ruoyi-auction/src/main/java/com/ruoyi/auction/service/impl/AuctionBidRecordServiceImpl.java |   17 ++++++++++-------
 1 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/ruoyi-modules/ruoyi-auction/src/main/java/com/ruoyi/auction/service/impl/AuctionBidRecordServiceImpl.java b/ruoyi-modules/ruoyi-auction/src/main/java/com/ruoyi/auction/service/impl/AuctionBidRecordServiceImpl.java
index 679a9a2..012b9fe 100644
--- a/ruoyi-modules/ruoyi-auction/src/main/java/com/ruoyi/auction/service/impl/AuctionBidRecordServiceImpl.java
+++ b/ruoyi-modules/ruoyi-auction/src/main/java/com/ruoyi/auction/service/impl/AuctionBidRecordServiceImpl.java
@@ -3,7 +3,7 @@
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.ruoyi.system.api.domain.dto.AuctionSalesroomGoodsDTO;
+import com.ruoyi.system.api.domain.dto.AuctionSalesroomDTO;
 import com.ruoyi.auction.domain.AuctionBidRecord;
 import com.ruoyi.auction.domain.AuctionSalesroomGoods;
 import com.ruoyi.auction.mapper.AuctionBidRecordMapper;
@@ -31,7 +31,7 @@
     private AuctionSalesroomGoodsMapper auctionSalesroomGoodsMapper;
 
     @Override
-    public List<AuctionBidRecord> getAuctionBidRecordList(AuctionSalesroomGoodsDTO auctionSalesroomGoodsDTO) {
+    public List<AuctionBidRecord> getAuctionBidRecordList(AuctionSalesroomDTO auctionSalesroomGoodsDTO) {
         AuctionSalesroomGoods auctionSalesroomGoods = auctionSalesroomGoodsMapper.selectById(
                 auctionSalesroomGoodsDTO.getGoodsSkuId());
             List<AuctionBidRecord> auctionBidRecordList=new ArrayList<>();
@@ -43,15 +43,18 @@
                 auctionBidRecordList = this.list(wrapper);
                 //判断
                 if (auctionBidRecordList.size()>=auctionSalesroomGoods.getSalesroomStock()){
-                    for (int i=0;i<=auctionSalesroomGoods.getSalesroomStock();i++){
+                    for (int i=0;i<auctionSalesroomGoods.getSalesroomStock();i++){
                         AuctionBidRecord auctionBidRecord= auctionBidRecordList.get(i);
                         auctionBidRecord.setStatus(BidStatusEnum.LEAD);
                     }
                 }else{
-                    for (int i=0;i<=auctionBidRecordList.size();i++){
-                        AuctionBidRecord auctionBidRecord= auctionBidRecordList.get(i);
-                        auctionBidRecord.setStatus(BidStatusEnum.LEAD);
+                    if (auctionBidRecordList.size()>0){
+                        for (int i=0;i<auctionBidRecordList.size();i++){
+                            AuctionBidRecord auctionBidRecord= auctionBidRecordList.get(i);
+                            auctionBidRecord.setStatus(BidStatusEnum.LEAD);
+                        }
                     }
+
                 }
             }if (auctionSalesroomGoods.getStatus().getCode()==2){
                 LambdaQueryWrapper<AuctionBidRecord> wrapper=Wrappers.lambdaQuery();
@@ -59,7 +62,7 @@
                 wrapper.eq(AuctionBidRecord::getStatus,2);
                 wrapper.eq(AuctionBidRecord::getDelFlag,0);
                 wrapper.orderByDesc(AuctionBidRecord::getLastBidAmount);
-            auctionBidRecordList = this.list(wrapper);
+                auctionBidRecordList = this.list(wrapper);
             }
             return auctionBidRecordList;
 

--
Gitblit v1.7.1