mitao
2024-05-17 14f8be1a86a3d852b92665fcf4c767478c3e12d2
ruoyi-modules/ruoyi-auction/src/main/java/com/ruoyi/auction/controller/AuctionSalesroomController.java
@@ -1,9 +1,25 @@
package com.ruoyi.auction.controller;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.ruoyi.auction.VO.AuctionSalesroomVO;
import com.ruoyi.auction.domain.pojo.AuctionBidRecord;
import com.ruoyi.auction.domain.pojo.AuctionSalesroom;
import com.ruoyi.auction.domain.pojo.AuctionVideo;
import com.ruoyi.auction.service.IAuctionSalesroomService;
import com.ruoyi.auction.service.IAuctionVideoService;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import com.baomidou.mybatisplus.core.conditions.*;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.sql.SQLException;
import java.sql.Wrapper;
import java.util.List;
/**
 * <p>
@@ -17,4 +33,53 @@
@RequestMapping("/auction-salesroom")
public class AuctionSalesroomController {
    @Resource
    private IAuctionSalesroomService iAuctionSalesroomService;
    @Resource
    private IAuctionVideoService  iAuctionVideoService;
    /**
     * 拍卖大屏获取拍卖信息
     *
     */
    @RequestMapping("/getAuctionBidRecordList")
    @ResponseBody
    public 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 AuctionBidRecordList;
    }
    /**
     * 暖场视频or封面海报
     *
     */
    @RequestMapping("/getBaaner")
    @ResponseBody
    public AuctionSalesroomVO 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);
        AuctionSalesroomVO auctionSalesroomVO=new AuctionSalesroomVO();
        AuctionSalesroom auctionSalesroom=iAuctionSalesroomService.getById(SalesroomId);
        auctionSalesroomVO.setAuctionSalesroomStatus(auctionSalesroom.getStatus().getCode());
        if (auctionVideo!=null){
            auctionSalesroomVO.setUrl(auctionVideo.getPromotionVideoUrl());
        }else{
            auctionSalesroomVO.setUrl(auctionSalesroom.getCoverPic());
        }
        return auctionSalesroomVO;
    }
}