ruoyi-modules/ruoyi-auction/src/main/java/com/ruoyi/auction/controller/forepart/ForepartAuctionBidRecordController.java
@@ -36,8 +36,7 @@ @Resource private IAuctionBidRecordService iAuctionBidRecordService; @Resource private IAuctionSalesroomGoodsService iAuctionSalesroomGoodsService; /** * 拍卖大屏滚动 * @@ -46,36 +45,7 @@ @ResponseBody @ApiOperation(value = "拍卖大屏滚动出价") public R<List<AuctionBidRecord>> getAuctionBidRecordList(@PathVariable("goodsSkuId") Integer goodsSkuId) { AuctionSalesroomGoods auctionSalesroomGoods=iAuctionSalesroomGoodsService.getById(goodsSkuId); List<AuctionBidRecord> auctionBidRecordList=new ArrayList<>(); if (auctionSalesroomGoods.getStatus().getCode()==1){ LambdaQueryWrapper<AuctionBidRecord> wrapper=Wrappers.lambdaQuery(); wrapper.eq(AuctionBidRecord::getGoodsSkuId,goodsSkuId); 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.LEAD); } }else{ 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(); wrapper.eq(AuctionBidRecord::getGoodsSkuId,goodsSkuId); wrapper.eq(AuctionBidRecord::getStatus,2); wrapper.eq(AuctionBidRecord::getDelFlag,0); wrapper.orderByDesc(AuctionBidRecord::getLastBidAmount); auctionBidRecordList=iAuctionBidRecordService.list(wrapper); } return R.ok(auctionBidRecordList); return R.ok(iAuctionBidRecordService.getAuctionBidRecordList(goodsSkuId)); } ruoyi-modules/ruoyi-auction/src/main/java/com/ruoyi/auction/controller/forepart/ForepartAuctionSalesroomController.java
@@ -34,12 +34,6 @@ @Resource private IAuctionSalesroomService iAuctionSalesroomService; @Resource private IAuctionVideoService iAuctionVideoService; @Resource private SysUserClient sysUserClient; /** * 拍卖大屏获取拍卖信息 * @@ -48,11 +42,7 @@ @ResponseBody @ApiOperation(value = "拍卖大屏获取拍卖信息") public R<List<AuctionSalesroom>> getAuctionBidRecordList(@PathVariable("salesroomName") String salesroomName) { LambdaQueryWrapper<AuctionSalesroom> wrapper=Wrappers.lambdaQuery(); wrapper.eq(AuctionSalesroom::getSalesroomName,salesroomName); wrapper.eq(AuctionSalesroom::getDelFlag,0); List<AuctionSalesroom> auctionBidRecordList=iAuctionSalesroomService.list(wrapper); return R.ok(auctionBidRecordList); return R.ok(iAuctionSalesroomService.getAuctionBidRecordList(salesroomName)); } @@ -65,20 +55,7 @@ @ApiOperation(value = " 暖场视频or封面海报") public R<ForepartAuctionSalesroomVO> getBaaner(@PathVariable("salesroomId") Integer SalesroomId) { LambdaQueryWrapper<AuctionVideo> wrapper=Wrappers.lambdaQuery(); wrapper.eq(AuctionVideo::getAuctionSalesroomId,SalesroomId); wrapper.eq(AuctionVideo::getDelFlag,0); AuctionVideo auctionVideo=iAuctionVideoService.getOne(wrapper); ForepartAuctionSalesroomVO forepartAuctionSalesroomVO =new ForepartAuctionSalesroomVO(); AuctionSalesroom auctionSalesroom=iAuctionSalesroomService.getById(SalesroomId); forepartAuctionSalesroomVO.setAuctionSalesroomStatus(auctionSalesroom.getStatus().getCode()); if (auctionVideo!=null){ forepartAuctionSalesroomVO.setUrl(auctionVideo.getPromotionVideoUrl()); }else{ forepartAuctionSalesroomVO.setUrl(auctionSalesroom.getCoverPic()); } return R.ok(forepartAuctionSalesroomVO); return R.ok(iAuctionSalesroomService.getBaaner(SalesroomId)); } @@ -87,28 +64,7 @@ @ApiOperation(value = "扫码二维码获取拍卖场信息") public R<AuctionSalesroom> getAuctionBidRecordOne(@RequestBody ForepartAuctionBidRecordDTO arepartAuctionBidRecordDTO) { R<SysUser> r=sysUserClient.queryUserByPhone(arepartAuctionBidRecordDTO.getPhone()); SysUser sysUser=r.getData(); if (sysUser!=null){ R.fail("手机号未注册"); } if (!sysUser.getPassword().equals(arepartAuctionBidRecordDTO.getPassword())){ R.fail("密码输入错误"); } if (!sysUser.getUserType().equals("2")){ R.fail("该人员不是拍卖师"); } LambdaQueryWrapper<AuctionSalesroom> wrapper=Wrappers.lambdaQuery(); wrapper.eq(AuctionSalesroom::getAuctionSalesroomNo,arepartAuctionBidRecordDTO.getAuctionSalesroomQrcode()); wrapper.eq(AuctionSalesroom::getDelFlag,0); AuctionSalesroom auctionBidRecord=iAuctionSalesroomService.getOne(wrapper); return R.ok(auctionBidRecord); return R.ok(iAuctionSalesroomService.getAuctionBidRecordOne(arepartAuctionBidRecordDTO)); } ruoyi-modules/ruoyi-auction/src/main/java/com/ruoyi/auction/controller/forepart/ForepartAuctionSalesroomGoodsController.java
@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.ruoyi.auction.controller.forepart.DTO.AuctionSalesroomGoodsDTO; import com.ruoyi.auction.controller.forepart.DTO.orderDTO; import com.ruoyi.auction.controller.forepart.VO.AuctionSalesroomVO; import com.ruoyi.auction.controller.forepart.VO.ForepartAuctionSalesroomGoodsVO; import com.ruoyi.auction.domain.pojo.AuctionBidRecord; @@ -45,18 +46,8 @@ public class ForepartAuctionSalesroomGoodsController { @Resource private GoodsSkuClient goodsSkuClient; @Resource private IAuctionSalesroomService iAuctionSalesroomService; @Resource private IAuctionSalesroomGoodsService iAuctionSalesroomGoodsService; @Resource private IAuctionBidRecordService iAuctionBidRecordService; /** * 拍卖大屏的商品介绍 @@ -66,58 +57,8 @@ @ResponseBody @ApiOperation(value = "拍卖大屏的商品介绍") public R<ForepartAuctionSalesroomGoodsVO> getAuctionSalesroomGoods(Integer SalesroomId) { ForepartAuctionSalesroomGoodsVO forepartAuctionSalesroomGoodsVO =new ForepartAuctionSalesroomGoodsVO(); AuctionSalesroom auctionSalesroom=iAuctionSalesroomService.getById(SalesroomId); 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.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,0); wrapper2.eq(AuctionSalesroomGoods::getDelFlag,0); wrapper2.eq(AuctionSalesroomGoods::getAuctionSalesroomId,SalesroomId); wrapper2.orderByAsc(AuctionSalesroomGoods::getSortNum); wrapper2.last("limit 1"); auctionSalesroomGoods=iAuctionSalesroomGoodsService.getOne(wrapper2); } } 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(); 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(forepartAuctionSalesroomGoodsVO); return R.ok(iAuctionSalesroomGoodsService.getAuctionSalesroomGoods(SalesroomId)); } @@ -131,83 +72,7 @@ @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); return R.ok(iAuctionSalesroomGoodsService.getAuctionSalesroominfo(SalesroomId)); } @@ -223,22 +88,7 @@ @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); iAuctionSalesroomGoodsService.auctionSalesroomStart(SalesroomId); return R.ok(); } @@ -251,39 +101,21 @@ @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); } iAuctionSalesroomGoodsService.auctionSalesroomEnd(SalesroomId); 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); return R.ok(iAuctionSalesroomGoodsService.isAuctionSalesroom(SalesroomId)); } @@ -295,13 +127,7 @@ @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); iAuctionSalesroomGoodsService.auctionSalesroomGoodsStart(auctionSalesroomGoodsDTO); return R.ok(); } @@ -315,38 +141,7 @@ @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); } } } iAuctionSalesroomGoodsService.auctionSalesroomGoodsStart(auctionSalesroomGoodsDTO); return R.ok(); } } ruoyi-modules/ruoyi-auction/src/main/java/com/ruoyi/auction/controller/forepart/ForepartAuctionVideoController.java
@@ -37,13 +37,7 @@ @Resource private PromotionClient promotionClient; @Resource private IAuctionVideoService iAuctionVideoService; @Resource private IAuctionSalesroomGoodsService iAuctionSalesroomGoodsService; /** @@ -54,9 +48,7 @@ @ResponseBody @ApiOperation(value = "获取拍卖师端视频列表") public R<List<PromotionVideo>> getVoidList() { R<List<PromotionVideo>> promotionVideoList=promotionClient.getPromotionVideoList(); List<PromotionVideo> promotionVideos=promotionVideoList.getData(); return R.ok(promotionVideos); return R.ok(iAuctionVideoService.getVoidList()); } @@ -65,34 +57,7 @@ @ResponseBody @ApiOperation(value = "拍卖师端添加拍卖会视频播放") public R<T> addVoid(@RequestBody ForepartAuctionVideo orepartAuctionVideo) { LambdaQueryWrapper<AuctionSalesroomGoods> wrapper=Wrappers.lambdaQuery(); wrapper.eq(AuctionSalesroomGoods::getStatus,1); wrapper.eq(AuctionSalesroomGoods::getAuctionSalesroomId,orepartAuctionVideo.getAuctionSalesroomId()); wrapper.eq(AuctionSalesroomGoods::getDelFlag,0); AuctionSalesroomGoods auctionSalesroomGoods=iAuctionSalesroomGoodsService.getOne(wrapper); if (auctionSalesroomGoods!=null){ R.fail("当前有拍卖品正在拍卖中,请结束后再试!"); } LambdaQueryWrapper<AuctionVideo> wrapper1=Wrappers.lambdaQuery(); wrapper1.eq(AuctionVideo::getAuctionSalesroomId,orepartAuctionVideo.getAuctionSalesroomId()); wrapper1.eq(AuctionVideo::getPromotionVideoId,orepartAuctionVideo.getPromotionVideoId()); wrapper1.eq(AuctionVideo::getDelFlag,0); AuctionVideo auctionVideo=iAuctionVideoService.getOne(wrapper1); if (auctionVideo!=null){ iAuctionVideoService.removeById(auctionVideo); } R<PromotionVideo> promotionVideo=promotionClient.getPromotionVideoOne(orepartAuctionVideo.getPromotionVideoId()); PromotionVideo promotionVideo1= promotionVideo.getData(); AuctionVideo auctionVideo1=new AuctionVideo(); auctionVideo1.setPromotionVideoId(orepartAuctionVideo.getPromotionVideoId()); auctionVideo1.setAuctionSalesroomId(orepartAuctionVideo.getAuctionSalesroomId()); auctionVideo1.setPromotionVideoUrl(promotionVideo1.getVideoUrl()); iAuctionVideoService.save(auctionVideo1); iAuctionVideoService.addVoid(orepartAuctionVideo); return R.ok(); } ruoyi-modules/ruoyi-auction/src/main/java/com/ruoyi/auction/service/IAuctionBidRecordService.java
@@ -1,7 +1,19 @@ package com.ruoyi.auction.service; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.ruoyi.auction.domain.pojo.AuctionBidRecord; import com.baomidou.mybatisplus.extension.service.IService; import com.ruoyi.auction.domain.pojo.AuctionSalesroomGoods; import com.ruoyi.common.core.domain.R; import com.ruoyi.common.core.enums.BidStatusEnum; import io.swagger.annotations.ApiOperation; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseBody; import java.util.ArrayList; import java.util.List; /** * <p> @@ -12,5 +24,9 @@ * @since 2024-05-16 */ public interface IAuctionBidRecordService extends IService<AuctionBidRecord> { /** * 拍卖大屏滚动 * */ public List<AuctionBidRecord> getAuctionBidRecordList(@PathVariable("goodsSkuId") Integer goodsSkuId); } ruoyi-modules/ruoyi-auction/src/main/java/com/ruoyi/auction/service/IAuctionSalesroomGoodsService.java
@@ -1,7 +1,31 @@ package com.ruoyi.auction.service; 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.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.baomidou.mybatisplus.extension.service.IService; import com.ruoyi.auction.mapper.AuctionSalesroomGoodsMapper; 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.stereotype.Service; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseBody; import javax.annotation.Resource; import java.time.LocalDateTime; import java.util.ArrayList; import java.util.List; /** * <p> @@ -12,5 +36,40 @@ * @since 2024-05-16 */ public interface IAuctionSalesroomGoodsService extends IService<AuctionSalesroomGoods> { ForepartAuctionSalesroomGoodsVO getAuctionSalesroomGoods(Integer SalesroomId); /** * 拍卖师端拍卖场信息 * */ AuctionSalesroomVO getAuctionSalesroominfo(Integer SalesroomId); /** * 拍卖师端拍卖场立即开始 * */ void auctionSalesroomStart(Integer SalesroomId); /** * 拍卖师端拍卖场立即开始 * */ void auctionSalesroomEnd(Integer SalesroomId); /** * 拍卖师端拍卖场立即开始 * */ List<AuctionSalesroomGoods> isAuctionSalesroom(Integer SalesroomId); /** * 拍卖师端拍卖场下一个立即开始 * */ void auctionSalesroomGoodsStart(AuctionSalesroomGoodsDTO auctionSalesroomGoodsDTO); void auctionSalesroomGoodsEnd(AuctionSalesroomGoodsDTO auctionSalesroomGoodsDTO); } ruoyi-modules/ruoyi-auction/src/main/java/com/ruoyi/auction/service/IAuctionSalesroomService.java
@@ -1,7 +1,21 @@ package com.ruoyi.auction.service; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.ruoyi.auction.controller.forepart.DTO.ForepartAuctionBidRecordDTO; import com.ruoyi.auction.controller.forepart.VO.ForepartAuctionSalesroomVO; import com.ruoyi.auction.domain.pojo.AuctionSalesroom; import com.baomidou.mybatisplus.extension.service.IService; import com.ruoyi.auction.domain.pojo.AuctionVideo; import com.ruoyi.common.core.domain.R; import com.ruoyi.system.api.domain.SysUser; import io.swagger.annotations.ApiOperation; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseBody; import java.util.List; /** * <p> @@ -12,5 +26,18 @@ * @since 2024-05-16 */ public interface IAuctionSalesroomService extends IService<AuctionSalesroom> { /** * 拍卖大屏获取拍卖信息 * */ public List<AuctionSalesroom> getAuctionBidRecordList(String salesroomName); /** * 暖场视频or封面海报 * */ public ForepartAuctionSalesroomVO getBaaner(Integer SalesroomId); public AuctionSalesroom getAuctionBidRecordOne(@RequestBody ForepartAuctionBidRecordDTO arepartAuctionBidRecordDTO); } ruoyi-modules/ruoyi-auction/src/main/java/com/ruoyi/auction/service/IAuctionVideoService.java
@@ -1,7 +1,20 @@ package com.ruoyi.auction.service; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.ruoyi.auction.controller.forepart.DTO.ForepartAuctionVideo; import com.ruoyi.auction.domain.pojo.AuctionSalesroomGoods; import com.ruoyi.auction.domain.pojo.AuctionVideo; import com.baomidou.mybatisplus.extension.service.IService; import com.ruoyi.common.core.domain.R; import com.ruoyi.system.api.domain.PromotionVideo; import io.swagger.annotations.ApiOperation; import org.apache.poi.ss.formula.functions.T; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseBody; import java.util.List; /** * <p> @@ -12,5 +25,16 @@ * @since 2024-05-17 */ public interface IAuctionVideoService extends IService<AuctionVideo> { /** * 暖场视频or封面海报 * */ List<PromotionVideo>getVoidList(); /** * 拍卖师端添加拍卖会视频播放 * */ void addVoid(@RequestBody ForepartAuctionVideo orepartAuctionVideo); } ruoyi-modules/ruoyi-auction/src/main/java/com/ruoyi/auction/service/impl/AuctionBidRecordServiceImpl.java
@@ -1,10 +1,24 @@ package com.ruoyi.auction.service.impl; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.ruoyi.auction.domain.pojo.AuctionBidRecord; import com.ruoyi.auction.domain.pojo.AuctionSalesroomGoods; import com.ruoyi.auction.mapper.AuctionBidRecordMapper; import com.ruoyi.auction.service.IAuctionBidRecordService; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.ruoyi.auction.service.IAuctionSalesroomGoodsService; import com.ruoyi.common.core.domain.R; import com.ruoyi.common.core.enums.BidStatusEnum; import io.swagger.annotations.ApiOperation; import org.springframework.stereotype.Service; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseBody; import javax.annotation.Resource; import java.util.ArrayList; import java.util.List; /** * <p> @@ -16,5 +30,44 @@ */ @Service public class AuctionBidRecordServiceImpl extends ServiceImpl<AuctionBidRecordMapper, AuctionBidRecord> implements IAuctionBidRecordService { @Resource private IAuctionBidRecordService iAuctionBidRecordService; @Resource private IAuctionSalesroomGoodsService iAuctionSalesroomGoodsService; @Override public List<AuctionBidRecord> getAuctionBidRecordList(Integer goodsSkuId) { AuctionSalesroomGoods auctionSalesroomGoods=iAuctionSalesroomGoodsService.getById(goodsSkuId); List<AuctionBidRecord> auctionBidRecordList=new ArrayList<>(); if (auctionSalesroomGoods.getStatus().getCode()==1){ LambdaQueryWrapper<AuctionBidRecord> wrapper=Wrappers.lambdaQuery(); wrapper.eq(AuctionBidRecord::getGoodsSkuId,goodsSkuId); 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.LEAD); } }else{ 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(); wrapper.eq(AuctionBidRecord::getGoodsSkuId,goodsSkuId); wrapper.eq(AuctionBidRecord::getStatus,2); wrapper.eq(AuctionBidRecord::getDelFlag,0); wrapper.orderByDesc(AuctionBidRecord::getLastBidAmount); auctionBidRecordList=iAuctionBidRecordService.list(wrapper); } return auctionBidRecordList; } } ruoyi-modules/ruoyi-auction/src/main/java/com/ruoyi/auction/service/impl/AuctionSalesroomGoodsServiceImpl.java
@@ -1,10 +1,33 @@ package com.ruoyi.auction.service.impl; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.toolkit.Wrappers; 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.mapper.AuctionSalesroomGoodsMapper; import com.ruoyi.auction.service.IAuctionBidRecordService; import com.ruoyi.auction.service.IAuctionSalesroomGoodsService; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; 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.stereotype.Service; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseBody; import javax.annotation.Resource; import java.time.LocalDateTime; import java.util.ArrayList; import java.util.List; /** * <p> @@ -16,5 +39,288 @@ */ @Service public class AuctionSalesroomGoodsServiceImpl extends ServiceImpl<AuctionSalesroomGoodsMapper, AuctionSalesroomGoods> implements IAuctionSalesroomGoodsService { @Resource private GoodsSkuClient goodsSkuClient; @Resource private IAuctionSalesroomService iAuctionSalesroomService; @Resource private IAuctionSalesroomGoodsService iAuctionSalesroomGoodsService; @Resource private IAuctionBidRecordService iAuctionBidRecordService; /** * 拍卖大屏的商品介绍 * */ @Override public ForepartAuctionSalesroomGoodsVO getAuctionSalesroomGoods(Integer SalesroomId) { ForepartAuctionSalesroomGoodsVO forepartAuctionSalesroomGoodsVO =new ForepartAuctionSalesroomGoodsVO(); AuctionSalesroom auctionSalesroom=iAuctionSalesroomService.getById(SalesroomId); 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.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,0); wrapper2.eq(AuctionSalesroomGoods::getDelFlag,0); wrapper2.eq(AuctionSalesroomGoods::getAuctionSalesroomId,SalesroomId); wrapper2.orderByAsc(AuctionSalesroomGoods::getSortNum); wrapper2.last("limit 1"); auctionSalesroomGoods=iAuctionSalesroomGoodsService.getOne(wrapper2); } } 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(); 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 forepartAuctionSalesroomGoodsVO; } /** * 拍卖师端拍卖场信息 * */ @Override public 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 auctionSalesroomVO; } /** * 拍卖师端拍卖场立即开始 * */ @Override public void 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); } /** * 拍卖师端拍卖场立即开始 * */ @Override public void 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); } } /** * 拍卖师端拍卖场立即开始 * */ @Override public 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 auctionSalesroomGoods; } /** * 拍卖师端拍卖场下一个立即开始 * */ @Override public void 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); } /** * 拍卖师端拍卖场下一个立即结束 * */ @Override public void 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); } } } } } ruoyi-modules/ruoyi-auction/src/main/java/com/ruoyi/auction/service/impl/AuctionSalesroomServiceImpl.java
@@ -1,10 +1,22 @@ package com.ruoyi.auction.service.impl; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.ruoyi.auction.controller.forepart.DTO.ForepartAuctionBidRecordDTO; import com.ruoyi.auction.controller.forepart.VO.ForepartAuctionSalesroomVO; import com.ruoyi.auction.domain.pojo.AuctionSalesroom; import com.ruoyi.auction.domain.pojo.AuctionVideo; import com.ruoyi.auction.mapper.AuctionSalesroomMapper; import com.ruoyi.auction.service.IAuctionSalesroomService; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.ruoyi.auction.service.IAuctionVideoService; import com.ruoyi.common.core.domain.R; import com.ruoyi.system.api.domain.SysUser; import com.ruoyi.system.api.feignClient.SysUserClient; import org.springframework.stereotype.Service; import javax.annotation.Resource; import java.util.List; /** * <p> @@ -16,5 +28,63 @@ */ @Service public class AuctionSalesroomServiceImpl extends ServiceImpl<AuctionSalesroomMapper, AuctionSalesroom> implements IAuctionSalesroomService { @Resource private IAuctionSalesroomService iAuctionSalesroomService; @Resource private IAuctionVideoService iAuctionVideoService; @Resource private SysUserClient sysUserClient; @Override public List<AuctionSalesroom> getAuctionBidRecordList(String salesroomName) { LambdaQueryWrapper<AuctionSalesroom> wrapper=Wrappers.lambdaQuery(); wrapper.eq(AuctionSalesroom::getSalesroomName,salesroomName); wrapper.eq(AuctionSalesroom::getDelFlag,0); List<AuctionSalesroom> auctionBidRecordList=iAuctionSalesroomService.list(wrapper); return auctionBidRecordList; } @Override public ForepartAuctionSalesroomVO getBaaner(Integer SalesroomId) { LambdaQueryWrapper<AuctionVideo> wrapper=Wrappers.lambdaQuery(); wrapper.eq(AuctionVideo::getAuctionSalesroomId,SalesroomId); wrapper.eq(AuctionVideo::getDelFlag,0); AuctionVideo auctionVideo=iAuctionVideoService.getOne(wrapper); ForepartAuctionSalesroomVO forepartAuctionSalesroomVO =new ForepartAuctionSalesroomVO(); AuctionSalesroom auctionSalesroom=iAuctionSalesroomService.getById(SalesroomId); forepartAuctionSalesroomVO.setAuctionSalesroomStatus(auctionSalesroom.getStatus().getCode()); if (auctionVideo!=null){ forepartAuctionSalesroomVO.setUrl(auctionVideo.getPromotionVideoUrl()); }else{ forepartAuctionSalesroomVO.setUrl(auctionSalesroom.getCoverPic()); } return forepartAuctionSalesroomVO; } @Override public AuctionSalesroom getAuctionBidRecordOne(ForepartAuctionBidRecordDTO arepartAuctionBidRecordDTO) { R<SysUser> r=sysUserClient.queryUserByPhone(arepartAuctionBidRecordDTO.getPhone()); SysUser sysUser=r.getData(); if (sysUser!=null){ R.fail("手机号未注册"); } if (!sysUser.getPassword().equals(arepartAuctionBidRecordDTO.getPassword())){ R.fail("密码输入错误"); } if (!sysUser.getUserType().equals("2")){ R.fail("该人员不是拍卖师"); } LambdaQueryWrapper<AuctionSalesroom> wrapper=Wrappers.lambdaQuery(); wrapper.eq(AuctionSalesroom::getAuctionSalesroomNo,arepartAuctionBidRecordDTO.getAuctionSalesroomQrcode()); wrapper.eq(AuctionSalesroom::getDelFlag,0); AuctionSalesroom auctionBidRecord=iAuctionSalesroomService.getOne(wrapper); return auctionBidRecord; } } ruoyi-modules/ruoyi-auction/src/main/java/com/ruoyi/auction/service/impl/AuctionVideoServiceImpl.java
@@ -1,10 +1,26 @@ package com.ruoyi.auction.service.impl; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.ruoyi.auction.controller.forepart.DTO.ForepartAuctionVideo; import com.ruoyi.auction.domain.pojo.AuctionSalesroomGoods; import com.ruoyi.auction.domain.pojo.AuctionVideo; import com.ruoyi.auction.mapper.AuctionVideoMapper; import com.ruoyi.auction.service.IAuctionSalesroomGoodsService; import com.ruoyi.auction.service.IAuctionVideoService; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.ruoyi.common.core.domain.R; import com.ruoyi.system.api.domain.PromotionVideo; import com.ruoyi.system.api.feignClient.PromotionClient; import io.swagger.annotations.ApiOperation; import org.apache.poi.ss.formula.functions.T; import org.springframework.stereotype.Service; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseBody; import javax.annotation.Resource; import java.util.List; /** * <p> @@ -16,5 +32,55 @@ */ @Service public class AuctionVideoServiceImpl extends ServiceImpl<AuctionVideoMapper, AuctionVideo> implements IAuctionVideoService { @Resource private PromotionClient promotionClient; @Resource private IAuctionVideoService iAuctionVideoService; @Resource private IAuctionSalesroomGoodsService iAuctionSalesroomGoodsService; /** * 暖场视频or封面海报 * */ @Override public List<PromotionVideo> getVoidList() { R<List<PromotionVideo>> promotionVideoList=promotionClient.getPromotionVideoList(); List<PromotionVideo> promotionVideos=promotionVideoList.getData(); return promotionVideos; } @Override public void addVoid(@RequestBody ForepartAuctionVideo orepartAuctionVideo) { LambdaQueryWrapper<AuctionSalesroomGoods> wrapper=Wrappers.lambdaQuery(); wrapper.eq(AuctionSalesroomGoods::getStatus,1); wrapper.eq(AuctionSalesroomGoods::getAuctionSalesroomId,orepartAuctionVideo.getAuctionSalesroomId()); wrapper.eq(AuctionSalesroomGoods::getDelFlag,0); AuctionSalesroomGoods auctionSalesroomGoods=iAuctionSalesroomGoodsService.getOne(wrapper); if (auctionSalesroomGoods!=null){ R.fail("当前有拍卖品正在拍卖中,请结束后再试!"); } LambdaQueryWrapper<AuctionVideo> wrapper1=Wrappers.lambdaQuery(); wrapper1.eq(AuctionVideo::getAuctionSalesroomId,orepartAuctionVideo.getAuctionSalesroomId()); wrapper1.eq(AuctionVideo::getPromotionVideoId,orepartAuctionVideo.getPromotionVideoId()); wrapper1.eq(AuctionVideo::getDelFlag,0); AuctionVideo auctionVideo=iAuctionVideoService.getOne(wrapper1); if (auctionVideo!=null){ iAuctionVideoService.removeById(auctionVideo); } R<PromotionVideo> promotionVideo=promotionClient.getPromotionVideoOne(orepartAuctionVideo.getPromotionVideoId()); PromotionVideo promotionVideo1= promotionVideo.getData(); AuctionVideo auctionVideo1=new AuctionVideo(); auctionVideo1.setPromotionVideoId(orepartAuctionVideo.getPromotionVideoId()); auctionVideo1.setAuctionSalesroomId(orepartAuctionVideo.getAuctionSalesroomId()); auctionVideo1.setPromotionVideoUrl(promotionVideo1.getVideoUrl()); iAuctionVideoService.save(auctionVideo1); } }