| | |
| | | import com.ruoyi.auction.VO.AuctionSalesroomGoodsVO; |
| | | import com.ruoyi.auction.domain.pojo.AuctionSalesroom; |
| | | import com.ruoyi.auction.domain.pojo.AuctionSalesroomGoods; |
| | | import com.ruoyi.auction.service.IAuctionSalesroomGoodsService; |
| | | import com.ruoyi.auction.service.IAuctionSalesroomService; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.system.api.domain.GoodsSku; |
| | | import com.ruoyi.system.api.feignClient.GoodsSkuClient; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | |
| | | |
| | | |
| | | |
| | | @Autowired |
| | | @Resource |
| | | private GoodsSkuClient goodsSkuClient; |
| | | |
| | | @Resource |
| | | private IAuctionSalesroomService iAuctionSalesroomService; |
| | | |
| | | @Resource |
| | | private IAuctionSalesroomGoodsService iAuctionSalesroomGoodsService; |
| | | |
| | | /** |
| | | * 拍卖大屏的商品介绍 |
| | |
| | | public AuctionSalesroomGoodsVO getAuctionSalesroomGoods(String SalesroomId) { |
| | | AuctionSalesroomGoodsVO auctionSalesroomGoodsVO=new AuctionSalesroomGoodsVO(); |
| | | AuctionSalesroom auctionSalesroom=iAuctionSalesroomService.getById(SalesroomId); |
| | | auctionSalesroomGoodsVO.setAuctionSalesroomId(auctionSalesroom.getId()); |
| | | auctionSalesroomGoodsVO.setSalesroomId(auctionSalesroom.getId()); |
| | | auctionSalesroomGoodsVO.setSalesroomName(auctionSalesroom.getSalesroomName()); |
| | | auctionSalesroomGoodsVO.setSalesroomType(auctionSalesroom.getType().getCode()); |
| | | LambdaQueryWrapper<AuctionSalesroomGoods> wrapper=Wrappers.lambdaQuery(); |
| | | wrapper.eq(AuctionSalesroomGoods::getStatus,1); |
| | | 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"); |
| | | auctionSalesroomGoods=auctionSalesroomGoods=iAuctionSalesroomGoodsService.getOne(wrapper1); |
| | | if (auctionSalesroomGoods==null){ |
| | | LambdaQueryWrapper<AuctionSalesroomGoods> wrapper2=Wrappers.lambdaQuery(); |
| | | wrapper2.eq(AuctionSalesroomGoods::getStatus,1); |
| | | wrapper2.eq(AuctionSalesroomGoods::getDelFlag,0); |
| | | wrapper2.orderByAsc(AuctionSalesroomGoods::getSortNum); |
| | | wrapper2.last("limit 1"); |
| | | auctionSalesroomGoods=auctionSalesroomGoods=iAuctionSalesroomGoodsService.getOne(wrapper2); |
| | | } |
| | | } |
| | | |
| | | |
| | | return auctionSalesroomGoodsVO; |
| | | 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()); |
| | | R<GoodsSku> goodsSkuOne = goodsSkuClient.getGoodsSkuOne(auctionSalesroomGoods.getGoodsSkuId()); |
| | | GoodsSku goodsSku=goodsSkuOne.getData(); |
| | | auctionSalesroomGoodsVO.setCoverPic(goodsSku.getCoverPic()); |
| | | auctionSalesroomGoodsVO.setDescription(goodsSku.getDescription()); |
| | | auctionSalesroomGoodsVO.setUnit(goodsSku.getUnit()); |
| | | return auctionSalesroomGoodsVO; |
| | | } |
| | | |
| | | } |