From e6d92f5b598527e75d05399b7e1948b614a681e6 Mon Sep 17 00:00:00 2001
From: rentaiming <806181062@qq.com>
Date: 星期一, 20 五月 2024 18:22:24 +0800
Subject: [PATCH] 拍卖大屏展示

---
 ruoyi-modules/ruoyi-auction/src/main/java/com/ruoyi/auction/controller/forepart/ForepartAuctionSalesroomGoodsController.java |  306 ++++++++++++++++++++++++++++++++++++++++++++++----
 1 files changed, 278 insertions(+), 28 deletions(-)

diff --git a/ruoyi-modules/ruoyi-auction/src/main/java/com/ruoyi/auction/controller/forepart/ForepartAuctionSalesroomGoodsController.java b/ruoyi-modules/ruoyi-auction/src/main/java/com/ruoyi/auction/controller/forepart/ForepartAuctionSalesroomGoodsController.java
index 6dbcef6..66de6e7 100644
--- a/ruoyi-modules/ruoyi-auction/src/main/java/com/ruoyi/auction/controller/forepart/ForepartAuctionSalesroomGoodsController.java
+++ b/ruoyi-modules/ruoyi-auction/src/main/java/com/ruoyi/auction/controller/forepart/ForepartAuctionSalesroomGoodsController.java
@@ -3,21 +3,34 @@
 
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
-import com.ruoyi.auction.controller.forepart.VO.AuctionSalesroomGoodsVO;
+import com.ruoyi.auction.controller.forepart.DTO.AuctionSalesroomGoodsDTO;
+import com.ruoyi.auction.controller.forepart.VO.AuctionSalesroomVO;
+import com.ruoyi.auction.controller.forepart.VO.ForepartAuctionSalesroomGoodsVO;
+import com.ruoyi.auction.domain.pojo.AuctionBidRecord;
 import com.ruoyi.auction.domain.pojo.AuctionSalesroom;
 import com.ruoyi.auction.domain.pojo.AuctionSalesroomGoods;
+import com.ruoyi.auction.service.IAuctionBidRecordService;
 import com.ruoyi.auction.service.IAuctionSalesroomGoodsService;
 import com.ruoyi.auction.service.IAuctionSalesroomService;
 import com.ruoyi.common.core.domain.R;
+import com.ruoyi.common.core.enums.AuctionStartStatusEnum;
+import com.ruoyi.common.core.enums.BidStatusEnum;
 import com.ruoyi.system.api.domain.GoodsSku;
 import com.ruoyi.system.api.feignClient.GoodsSkuClient;
 import io.swagger.annotations.ApiOperation;
+import org.apache.poi.ss.formula.functions.T;
 import org.springframework.web.bind.annotation.RequestMapping;
 
 import org.springframework.web.bind.annotation.ResponseBody;
 import org.springframework.web.bind.annotation.RestController;
 
 import javax.annotation.Resource;
+import java.lang.reflect.Array;
+import java.time.LocalDateTime;
+import java.time.LocalTime;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
 
 /**
  * <p>
@@ -42,61 +55,298 @@
     @Resource
     private IAuctionSalesroomGoodsService iAuctionSalesroomGoodsService;
 
+    @Resource
+    private IAuctionBidRecordService iAuctionBidRecordService;
+
     /**
      * 拍卖大屏的商品介绍
      *
      */
     @RequestMapping("/getAuctionSalesroomGoods")
-    @ResponseBody @ApiOperation(value = "拍卖大屏的商品介绍")
-
-    public R<AuctionSalesroomGoodsVO> getAuctionSalesroomGoods(String SalesroomId) {
-        AuctionSalesroomGoodsVO auctionSalesroomGoodsVO=new AuctionSalesroomGoodsVO();
+    @ResponseBody
+    @ApiOperation(value = "拍卖大屏的商品介绍")
+    public R<ForepartAuctionSalesroomGoodsVO> getAuctionSalesroomGoods(Integer SalesroomId) {
+        ForepartAuctionSalesroomGoodsVO forepartAuctionSalesroomGoodsVO =new ForepartAuctionSalesroomGoodsVO();
         AuctionSalesroom auctionSalesroom=iAuctionSalesroomService.getById(SalesroomId);
-        auctionSalesroomGoodsVO.setSalesroomId(auctionSalesroom.getId());
-        auctionSalesroomGoodsVO.setSalesroomName(auctionSalesroom.getSalesroomName());
-        auctionSalesroomGoodsVO.setSalesroomType(auctionSalesroom.getType().getCode());
+        forepartAuctionSalesroomGoodsVO.setSalesroomId(auctionSalesroom.getId());
+        forepartAuctionSalesroomGoodsVO.setSalesroomName(auctionSalesroom.getSalesroomName());
+        forepartAuctionSalesroomGoodsVO.setSalesroomType(auctionSalesroom.getType().getCode());
         LambdaQueryWrapper<AuctionSalesroomGoods> wrapper=Wrappers.lambdaQuery();
         wrapper.eq(AuctionSalesroomGoods::getStatus,1);
+        wrapper.eq(AuctionSalesroomGoods::getAuctionSalesroomId,SalesroomId);
         wrapper.eq(AuctionSalesroomGoods::getDelFlag,0);
         AuctionSalesroomGoods auctionSalesroomGoods=iAuctionSalesroomGoodsService.getOne(wrapper);
         if (auctionSalesroomGoods==null){
             LambdaQueryWrapper<AuctionSalesroomGoods> wrapper1=Wrappers.lambdaQuery();
             wrapper1.eq(AuctionSalesroomGoods::getStatus,2);
             wrapper1.eq(AuctionSalesroomGoods::getDelFlag,0);
-            wrapper1.orderByDesc(AuctionSalesroomGoods::getSortNum);
-            wrapper.last("limit 1");
+            wrapper1.eq(AuctionSalesroomGoods::getAuctionSalesroomId,SalesroomId);
+            wrapper1.orderByAsc(AuctionSalesroomGoods::getSortNum);
+            wrapper1.last("limit 1");
             auctionSalesroomGoods=iAuctionSalesroomGoodsService.getOne(wrapper1);
             if (auctionSalesroomGoods==null){
                 LambdaQueryWrapper<AuctionSalesroomGoods> wrapper2=Wrappers.lambdaQuery();
-                wrapper2.eq(AuctionSalesroomGoods::getStatus,1);
+                wrapper2.eq(AuctionSalesroomGoods::getStatus,0);
                 wrapper2.eq(AuctionSalesroomGoods::getDelFlag,0);
+                wrapper2.eq(AuctionSalesroomGoods::getAuctionSalesroomId,SalesroomId);
                 wrapper2.orderByAsc(AuctionSalesroomGoods::getSortNum);
                 wrapper2.last("limit 1");
                 auctionSalesroomGoods=iAuctionSalesroomGoodsService.getOne(wrapper2);
             }
         }
 
-        auctionSalesroomGoodsVO.setGoodsSkuId(auctionSalesroomGoods.getGoodsSkuId());
-        auctionSalesroomGoodsVO.setGoodsSkuName(auctionSalesroomGoods.getGoodsSkuName());
-        auctionSalesroomGoodsVO.setGoodsSkustatus(auctionSalesroomGoods.getStatus().getCode());
-        auctionSalesroomGoodsVO.setStartingPrice(auctionSalesroomGoods.getStartingPrice());
-        auctionSalesroomGoodsVO.setItemQuantity(auctionSalesroomGoods.getItemQuantity());
-        auctionSalesroomGoodsVO.setListingDuration(auctionSalesroomGoods.getListingDuration());
-        auctionSalesroomGoodsVO.setStartTime(auctionSalesroomGoods.getStartTime());
+        forepartAuctionSalesroomGoodsVO.setGoodsSkuId(auctionSalesroomGoods.getGoodsSkuId());
+        forepartAuctionSalesroomGoodsVO.setGoodsSkuName(auctionSalesroomGoods.getGoodsSkuName());
+        forepartAuctionSalesroomGoodsVO.setGoodsSkustatus(auctionSalesroomGoods.getStatus().getCode());
+        forepartAuctionSalesroomGoodsVO.setStartingPrice(auctionSalesroomGoods.getStartingPrice());
+        forepartAuctionSalesroomGoodsVO.setItemQuantity(auctionSalesroomGoods.getItemQuantity());
+        forepartAuctionSalesroomGoodsVO.setListingDuration(auctionSalesroomGoods.getListingDuration());
+        forepartAuctionSalesroomGoodsVO.setStartTime(auctionSalesroomGoods.getStartTime());
         R<GoodsSku> goodsSkuOne = goodsSkuClient.getGoodsSkuOne(auctionSalesroomGoods.getGoodsSkuId());
         GoodsSku goodsSku=goodsSkuOne.getData();
-        auctionSalesroomGoodsVO.setCoverPic(goodsSku.getCoverPic());
-        auctionSalesroomGoodsVO.setDescription(goodsSku.getDescription());
-        auctionSalesroomGoodsVO.setUnit(goodsSku.getUnit());
-        if (auctionSalesroomGoods.getStatus().getCode()==0){
-            auctionSalesroomGoodsVO.setNextGoodsSkuName(auctionSalesroomGoods.getGoodsSkuName());
-        }if (auctionSalesroomGoods.getStatus().getCode()==2){
-            AuctionSalesroomGoods auctionSalesroomGoodsOne= iAuctionSalesroomGoodsService.getById(auctionSalesroomGoods.getGoodsSkuId()+1);
-            if (auctionSalesroomGoodsOne!=null){
-                auctionSalesroomGoodsVO.setNextGoodsSkuName(auctionSalesroomGoods.getGoodsSkuName());
+        forepartAuctionSalesroomGoodsVO.setCoverPic(goodsSku.getCoverPic());
+        forepartAuctionSalesroomGoodsVO.setDescription(goodsSku.getDescription());
+        forepartAuctionSalesroomGoodsVO.setUnit(goodsSku.getUnit());
+        if (auctionSalesroomGoods.getStatus().getCode()==0 || auctionSalesroomGoods.getStatus().getCode()==2){
+            LambdaQueryWrapper<AuctionSalesroomGoods> wrapper1=Wrappers.lambdaQuery();
+            wrapper1.eq(AuctionSalesroomGoods::getDelFlag,0);
+            wrapper1.eq(AuctionSalesroomGoods::getSortNum,auctionSalesroomGoods.getSortNum()+1);
+            wrapper1.last("limit 1");
+            AuctionSalesroomGoods auctionSalesroomGoods1=iAuctionSalesroomGoodsService.getOne(wrapper1);
+            if (auctionSalesroomGoods1!=null){
+            forepartAuctionSalesroomGoodsVO.setNextGoodsSkuName(auctionSalesroomGoods1.getGoodsSkuName());
             }
         }
-        return R.ok(auctionSalesroomGoodsVO);
+        return R.ok(forepartAuctionSalesroomGoodsVO);
     }
 
+
+
+
+    /**
+     * 拍卖师端拍卖场信息
+     *
+     */
+    @RequestMapping("/getAuctionSalesroominfo")
+    @ResponseBody
+    @ApiOperation(value = "拍卖师端拍卖场信息")
+    public R<AuctionSalesroomVO> getAuctionSalesroominfo(Integer SalesroomId) {
+        ForepartAuctionSalesroomGoodsVO forepartAuctionSalesroomGoodsVO =new ForepartAuctionSalesroomGoodsVO();
+        AuctionSalesroom auctionSalesroom=iAuctionSalesroomService.getById(SalesroomId);
+        AuctionSalesroomVO auctionSalesroomVO=new AuctionSalesroomVO();
+        auctionSalesroomVO.setCoverPic(auctionSalesroom.getCoverPic());
+        auctionSalesroomVO.setDescription(auctionSalesroom.getDescription());
+        auctionSalesroomVO.setSalesroomName(auctionSalesroom.getSalesroomName());
+        auctionSalesroomVO.setSalesroomId(auctionSalesroom.getId());
+        auctionSalesroomVO.setStartTime(auctionSalesroom.getStartTime());
+        auctionSalesroomVO.setEndTime(auctionSalesroom.getEndTime());
+        auctionSalesroomVO.setStatus(auctionSalesroom.getStatus().getCode());
+        List<ForepartAuctionSalesroomGoodsVO> auctionSalesroomGoodsVOS=new ArrayList<>();
+        if (auctionSalesroom.getStatus().getCode()==0){
+            LambdaQueryWrapper<AuctionSalesroomGoods> wrapper=Wrappers.lambdaQuery();
+            wrapper.eq(AuctionSalesroomGoods::getStatus,0);
+            wrapper.eq(AuctionSalesroomGoods::getDelFlag,0);
+            wrapper.eq(AuctionSalesroomGoods::getAuctionSalesroomId,SalesroomId);
+            wrapper.orderByAsc(AuctionSalesroomGoods::getSortNum);
+            List<AuctionSalesroomGoods> auctionSalesroomGoods=iAuctionSalesroomGoodsService.list(wrapper);
+            for (AuctionSalesroomGoods salesroomGoods:auctionSalesroomGoods){
+                ForepartAuctionSalesroomGoodsVO forepartAuctionSalesroomGoodsVO1=new ForepartAuctionSalesroomGoodsVO();
+                R<GoodsSku> goodsSkuOne = goodsSkuClient.getGoodsSkuOne(salesroomGoods.getGoodsSkuId());
+                GoodsSku goodsSku=goodsSkuOne.getData();
+                forepartAuctionSalesroomGoodsVO1.setGoodsSkuName(salesroomGoods.getGoodsSkuName());
+                forepartAuctionSalesroomGoodsVO1.setCoverPic(goodsSku.getCoverPic());
+                auctionSalesroomGoodsVOS.add(forepartAuctionSalesroomGoodsVO1);
+            }
+        }if (auctionSalesroom.getStatus().getCode()==2){
+            List list =new ArrayList();
+            LambdaQueryWrapper<AuctionSalesroomGoods> wrapper=Wrappers.lambdaQuery();
+            wrapper.eq(AuctionSalesroomGoods::getStatus,1);
+            wrapper.eq(AuctionSalesroomGoods::getDelFlag,0);
+            wrapper.eq(AuctionSalesroomGoods::getAuctionSalesroomId,SalesroomId);
+            wrapper.last("limit 1");
+            AuctionSalesroomGoods auctionSalesroomGoods= iAuctionSalesroomGoodsService.getOne(wrapper);
+            ForepartAuctionSalesroomGoodsVO currentAuctionSalesroomGoods=  new ForepartAuctionSalesroomGoodsVO();
+            currentAuctionSalesroomGoods.setGoodsSkuName(auctionSalesroomGoods.getGoodsSkuName());
+            R<GoodsSku> goodsSkuOne = goodsSkuClient.getGoodsSkuOne(auctionSalesroomGoods.getGoodsSkuId());
+            GoodsSku goodsSku=goodsSkuOne.getData();
+            currentAuctionSalesroomGoods.setCoverPic(goodsSku.getCoverPic());
+            auctionSalesroomVO.setCurrentAuctionSalesroomGoods(currentAuctionSalesroomGoods);
+
+            list.add(auctionSalesroomGoods.getSortNum());
+
+            LambdaQueryWrapper<AuctionSalesroomGoods> wrapper1=Wrappers.lambdaQuery();
+            wrapper1.eq(AuctionSalesroomGoods::getDelFlag,0);
+            wrapper1.eq(AuctionSalesroomGoods::getSortNum,auctionSalesroomGoods.getSortNum()+1);
+            wrapper1.last("limit 1");
+            AuctionSalesroomGoods auctionSalesroomGoods1=iAuctionSalesroomGoodsService.getOne(wrapper1);
+            ForepartAuctionSalesroomGoodsVO nextAuctionSalesroomGoods=  new ForepartAuctionSalesroomGoodsVO();
+            if (auctionSalesroomGoods1!=null){
+                list.add(auctionSalesroomGoods.getSortNum()+1);
+                nextAuctionSalesroomGoods.setNextGoodsSkuName(auctionSalesroomGoods1.getGoodsSkuName());
+                R<GoodsSku> goodsSkuOne1 = goodsSkuClient.getGoodsSkuOne(auctionSalesroomGoods.getGoodsSkuId());
+                GoodsSku goodsSku1=goodsSkuOne1.getData();
+                nextAuctionSalesroomGoods.setCoverPic(goodsSku1.getCoverPic());
+                auctionSalesroomVO.setNextAuctionSalesroomGoods(nextAuctionSalesroomGoods);
+            }
+            LambdaQueryWrapper<AuctionSalesroomGoods> wrapper2=Wrappers.lambdaQuery();
+            wrapper2.in(AuctionSalesroomGoods::getSortNum,list);
+            wrapper2.eq(AuctionSalesroomGoods::getDelFlag,0);
+            wrapper2.eq(AuctionSalesroomGoods::getAuctionSalesroomId,SalesroomId);
+            wrapper2.orderByAsc(AuctionSalesroomGoods::getSortNum);
+            wrapper2.orderByAsc(AuctionSalesroomGoods::getStatus);
+            List<AuctionSalesroomGoods> auctionSalesroomGoods2=iAuctionSalesroomGoodsService.list(wrapper2);
+            for (AuctionSalesroomGoods salesroomGoods:auctionSalesroomGoods2){
+                ForepartAuctionSalesroomGoodsVO forepartAuctionSalesroomGoodsVO1=new ForepartAuctionSalesroomGoodsVO();
+                R<GoodsSku> goodsSkuOne2 = goodsSkuClient.getGoodsSkuOne(salesroomGoods.getGoodsSkuId());
+                GoodsSku goodsSku2=goodsSkuOne2.getData();
+                forepartAuctionSalesroomGoodsVO1.setGoodsSkuName(salesroomGoods.getGoodsSkuName());
+                forepartAuctionSalesroomGoodsVO1.setCoverPic(goodsSku.getCoverPic());
+                auctionSalesroomGoodsVOS.add(forepartAuctionSalesroomGoodsVO1);
+            }
+
+
+        }
+        auctionSalesroomVO.setElseAuctionSalesroomGoods(auctionSalesroomGoodsVOS);
+        return R.ok(auctionSalesroomVO);
+    }
+
+
+
+
+
+
+    /**
+     * 拍卖师端拍卖场立即开始
+     *
+     */
+    @RequestMapping("/auctionSalesroomStart")
+    @ResponseBody
+    @ApiOperation(value = "拍卖师端拍卖场立即开始")
+    public R<T> auctionSalesroomStart(Integer SalesroomId) {
+        ForepartAuctionSalesroomGoodsVO forepartAuctionSalesroomGoodsVO =new ForepartAuctionSalesroomGoodsVO();
+        AuctionSalesroom auctionSalesroom=iAuctionSalesroomService.getById(SalesroomId);
+        auctionSalesroom.setStatus(AuctionStartStatusEnum.IN_AUCTION);
+        auctionSalesroom.setStartTime(LocalDateTime.now());
+        iAuctionSalesroomService.updateById(auctionSalesroom);
+
+        LambdaQueryWrapper<AuctionSalesroomGoods> wrapper2=Wrappers.lambdaQuery();
+        wrapper2.eq(AuctionSalesroomGoods::getStatus,0);
+        wrapper2.eq(AuctionSalesroomGoods::getDelFlag,0);
+        wrapper2.eq(AuctionSalesroomGoods::getAuctionSalesroomId,SalesroomId);
+        wrapper2.orderByAsc(AuctionSalesroomGoods::getSortNum);
+        wrapper2.last("limit 1");
+        AuctionSalesroomGoods auctionSalesroomGoods=iAuctionSalesroomGoodsService.getOne(wrapper2);
+        auctionSalesroomGoods.setStatus(AuctionStartStatusEnum.IN_AUCTION);
+        iAuctionSalesroomGoodsService.updateById(auctionSalesroomGoods);
+
+        return R.ok();
+    }
+
+
+    /**
+     * 拍卖师端拍卖场立即开始
+     *
+     */
+    @RequestMapping("/auctionSalesroomEnd")
+    @ResponseBody
+    @ApiOperation(value = "拍卖师端拍卖场立即结束")
+    public R<T> auctionSalesroomEnd(Integer SalesroomId) {
+        ForepartAuctionSalesroomGoodsVO forepartAuctionSalesroomGoodsVO =new ForepartAuctionSalesroomGoodsVO();
+        AuctionSalesroom auctionSalesroom=iAuctionSalesroomService.getById(SalesroomId);
+        auctionSalesroom.setStatus(AuctionStartStatusEnum.ENDED);
+        auctionSalesroom.setEndTime(LocalDateTime.now());
+        iAuctionSalesroomService.updateById(auctionSalesroom);
+
+        LambdaQueryWrapper<AuctionSalesroomGoods> wrapper2=Wrappers.lambdaQuery();
+        wrapper2.eq(AuctionSalesroomGoods::getStatus,0);
+        wrapper2.eq(AuctionSalesroomGoods::getDelFlag,0);
+        wrapper2.eq(AuctionSalesroomGoods::getAuctionSalesroomId,SalesroomId);
+        List<AuctionSalesroomGoods> auctionSalesroomGoods=iAuctionSalesroomGoodsService.list(wrapper2);
+        for (AuctionSalesroomGoods salesroomGoods:auctionSalesroomGoods){
+            salesroomGoods.setStatus(AuctionStartStatusEnum.ENDED);
+            iAuctionSalesroomGoodsService.updateById(salesroomGoods);
+        }
+        return R.ok();
+    }
+
+
+    /**
+     * 拍卖师端拍卖场立即开始
+     *
+     */
+    @RequestMapping("/isAuctionSalesroom")
+    @ResponseBody
+    @ApiOperation(value = "判断拍卖师端是否还有未拍卖商品")
+    public R<List<AuctionSalesroomGoods>> isAuctionSalesroom(Integer SalesroomId) {
+        LambdaQueryWrapper<AuctionSalesroomGoods> wrapper2=Wrappers.lambdaQuery();
+        wrapper2.eq(AuctionSalesroomGoods::getStatus,0);
+        wrapper2.eq(AuctionSalesroomGoods::getDelFlag,0);
+        wrapper2.eq(AuctionSalesroomGoods::getAuctionSalesroomId,SalesroomId);
+        List<AuctionSalesroomGoods> auctionSalesroomGoods=iAuctionSalesroomGoodsService.list(wrapper2);
+        return R.ok(auctionSalesroomGoods);
+    }
+
+
+    /**
+     * 拍卖师端拍卖场下一个立即开始
+     *
+     */
+    @RequestMapping("/auctionSalesroomGoodsStart")
+    @ResponseBody
+    @ApiOperation(value = "拍卖师端拍卖场下一个立即开始")
+    public R<T> auctionSalesroomGoodsStart(AuctionSalesroomGoodsDTO auctionSalesroomGoodsDTO) {
+        LambdaQueryWrapper<AuctionSalesroomGoods> wrapper2=Wrappers.lambdaQuery();
+        wrapper2.eq(AuctionSalesroomGoods::getAuctionSalesroomId,auctionSalesroomGoodsDTO.getAuctionSalesroomId());
+        wrapper2.eq(AuctionSalesroomGoods::getDelFlag,0);
+        wrapper2.eq(AuctionSalesroomGoods::getGoodsSkuId,auctionSalesroomGoodsDTO.getGoodsSkuId());
+        AuctionSalesroomGoods auctionSalesroomGoods=iAuctionSalesroomGoodsService.getOne(wrapper2);
+        auctionSalesroomGoods.setStatus(AuctionStartStatusEnum.IN_AUCTION);
+        iAuctionSalesroomGoodsService.updateById(auctionSalesroomGoods);
+        return R.ok();
+    }
+
+
+
+    /**
+     * 拍卖师端拍卖场下一个立即结束
+     *
+     */
+    @RequestMapping("/auctionSalesroomGoodsEnd")
+    @ResponseBody
+    @ApiOperation(value = "拍卖师端拍卖商品立即结束")
+    public R<T> auctionSalesroomGoodsEnd(AuctionSalesroomGoodsDTO auctionSalesroomGoodsDTO) {
+        LambdaQueryWrapper<AuctionSalesroomGoods> wrapper2=Wrappers.lambdaQuery();
+        wrapper2.eq(AuctionSalesroomGoods::getAuctionSalesroomId,auctionSalesroomGoodsDTO.getAuctionSalesroomId());
+        wrapper2.eq(AuctionSalesroomGoods::getDelFlag,0);
+        wrapper2.eq(AuctionSalesroomGoods::getGoodsSkuId,auctionSalesroomGoodsDTO.getGoodsSkuId());
+        AuctionSalesroomGoods auctionSalesroomGood=iAuctionSalesroomGoodsService.getOne(wrapper2);
+        auctionSalesroomGood.setStatus(AuctionStartStatusEnum.ENDED);
+        iAuctionSalesroomGoodsService.updateById(auctionSalesroomGood);
+
+
+        AuctionSalesroomGoods auctionSalesroomGoods=iAuctionSalesroomGoodsService.getById(auctionSalesroomGoodsDTO.getGoodsSkuId());
+        List<AuctionBidRecord> auctionBidRecordList=new ArrayList<>();
+        if (auctionSalesroomGoods.getStatus().getCode()==1) {
+            LambdaQueryWrapper<AuctionBidRecord> wrapper = Wrappers.lambdaQuery();
+            wrapper.eq(AuctionBidRecord::getGoodsSkuId, auctionSalesroomGoodsDTO.getGoodsSkuId());
+            wrapper.eq(AuctionBidRecord::getDelFlag, 0);
+            wrapper.orderByDesc(AuctionBidRecord::getLastBidAmount);
+            auctionBidRecordList = iAuctionBidRecordService.list(wrapper);
+            //判断
+            if (auctionBidRecordList.size() >= auctionSalesroomGoods.getItemQuantity()) {
+                for (int i = 0; i <= auctionSalesroomGoods.getItemQuantity(); i++) {
+                    AuctionBidRecord auctionBidRecord = auctionBidRecordList.get(i);
+                    auctionBidRecord.setStatus(BidStatusEnum.SUCCESSFUL);
+
+
+                }
+            } else {
+                for (int i = 0; i <= auctionBidRecordList.size(); i++) {
+                    AuctionBidRecord auctionBidRecord = auctionBidRecordList.get(i);
+                    auctionBidRecord.setStatus(BidStatusEnum.SUCCESSFUL);
+                }
+            }
+        }
+        return R.ok();
+    }
 }

--
Gitblit v1.7.1