| | |
| | | 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> |
| | |
| | | */ |
| | | @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); |
| | | } |
| | | } |