ソースを参照

首页拍卖会轮播图及拍卖会详情

linhui.li 2 週間 前
コミット
cfa8de4648

+ 53 - 0
bid/src/main/java/cn/hobbystocks/auc/web/AuctionController.java

@@ -0,0 +1,53 @@
+package cn.hobbystocks.auc.web;
+
+import cn.hobbystocks.auc.common.core.controller.BaseController;
+import cn.hobbystocks.auc.common.core.domain.AjaxResult;
+import cn.hobbystocks.auc.domain.Auction;
+import cn.hobbystocks.auc.domain.Lot;
+import cn.hobbystocks.auc.service.IAuctionService;
+import cn.hobbystocks.auc.service.ILotService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.List;
+
+/**
+ * 首页拍卖会banner查询
+ */
+@RestController
+@RequestMapping("/auction")
+@Api(tags = "移动端拍卖会")
+public class AuctionController extends BaseController {
+
+    @Autowired
+    private IAuctionService auctionService;
+    @Autowired
+    private ILotService lotService;
+
+    @PostMapping("/banner/list")
+    @ApiOperation("首页banner列表查询")
+    public AjaxResult bannerList(){
+        //查询已发布的拍卖会banner、状态,开始时间
+        List<Auction> list = auctionService.selectBannerList();
+        return AjaxResult.success(list);
+    }
+
+    /**
+     * 根据拍卖会id查询详情
+     * @param auction
+     * @return
+     */
+    @PostMapping("/details")
+    @ApiOperation(value = "拍卖会详情查询",notes = "根据拍卖会id,查询拍品列表")
+    public AjaxResult details(@RequestBody Auction auction){
+        startPage(auction);
+        List<Lot> lots = lotService.selectLotListByAucId(auction.getId());
+        //查询拍卖会下拍品列表
+        return AjaxResult.success(lots);
+    }
+}

+ 31 - 0
bid/src/main/java/cn/hobbystocks/auc/web/LotNoticeController.java

@@ -0,0 +1,31 @@
+package cn.hobbystocks.auc.web;
+
+import cn.hobbystocks.auc.common.core.domain.AjaxResult;
+import cn.hobbystocks.auc.domain.LotNotice;
+import cn.hobbystocks.auc.service.LotNoticeService;
+import cn.hobbystocks.auc.vo.LotNoticeVO;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+@RestController
+@Api(tags = "拍卖公告")
+@RequestMapping("/lot/notice")
+public class LotNoticeController {
+
+    @Autowired
+    LotNoticeService lotNoticeService;
+
+    @PostMapping("/list")
+    @ApiOperation(value = "拍卖公告查询",notes = "根据拍卖类型分页查询拍卖公告")
+    public AjaxResult getNoticeByType(@RequestBody LotNotice lotNotice){
+        Page<LotNoticeVO> lotNoticePage = lotNoticeService.selectLotNoticeByType(lotNotice);
+        return AjaxResult.success(lotNoticePage);
+    }
+
+}

+ 2 - 0
lot/src/main/java/cn/hobbystocks/auc/mapper/AuctionMapper.java

@@ -34,4 +34,6 @@ public interface AuctionMapper extends BaseMapper<Auction> {
 
     List<Auction> selectActiveAuction();
 
+    List<Auction> selectAucBannerList();
+
 }

+ 10 - 0
lot/src/main/java/cn/hobbystocks/auc/mapper/LotNoticeMapper.java

@@ -1,7 +1,17 @@
 package cn.hobbystocks.auc.mapper;
 
 import cn.hobbystocks.auc.domain.LotNotice;
+import cn.hobbystocks.auc.vo.LotNoticeVO;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import org.apache.ibatis.annotations.Param;
 
 public interface LotNoticeMapper extends BaseMapper<LotNotice> {
+
+    //根据分类查询拍卖公告列表
+    Page<LotNoticeVO>  selectNoticeByType(Page<LotNoticeVO> page, @Param("type") String type);
+
+
+
+
 }

+ 2 - 0
lot/src/main/java/cn/hobbystocks/auc/service/IAuctionService.java

@@ -28,4 +28,6 @@ public interface IAuctionService extends IService<Auction>
 
     List<Auction> live();
 
+    List<Auction> selectBannerList();
+
 }

+ 1 - 1
lot/src/main/java/cn/hobbystocks/auc/service/ILotService.java

@@ -106,5 +106,5 @@ public interface ILotService extends IService<Lot> {
 
     void updateSoldAndPaid(LotFans fans, Long groupId);
 
-
+    List<Lot> selectLotListByAucId(Long aucId);
 }

+ 4 - 0
lot/src/main/java/cn/hobbystocks/auc/service/LotNoticeService.java

@@ -1,6 +1,8 @@
 package cn.hobbystocks.auc.service;
 
 import cn.hobbystocks.auc.domain.LotNotice;
+import cn.hobbystocks.auc.vo.LotNoticeVO;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.IService;
 
 import java.util.List;
@@ -26,4 +28,6 @@ public interface LotNoticeService extends IService<LotNotice> {
      *上线下线
      */
     int pubLotNotice(LotNotice lotNotice);
+
+    Page<LotNoticeVO> selectLotNoticeByType(LotNotice lotNotice);
 }

+ 5 - 0
lot/src/main/java/cn/hobbystocks/auc/service/impl/AuctionServiceImpl.java

@@ -145,4 +145,9 @@ public class AuctionServiceImpl extends ServiceImpl<AuctionMapper,Auction> imple
             }
         }
     }
+
+    @Override
+    public List<Auction> selectBannerList() {
+        return getBaseMapper().selectAucBannerList();
+    }
 }

+ 7 - 0
lot/src/main/java/cn/hobbystocks/auc/service/impl/LotNoticeServiceImpl.java

@@ -4,6 +4,7 @@ import cn.hobbystocks.auc.common.utils.StringUtils;
 import cn.hobbystocks.auc.domain.LotNotice;
 import cn.hobbystocks.auc.mapper.LotNoticeMapper;
 import cn.hobbystocks.auc.service.LotNoticeService;
+import cn.hobbystocks.auc.vo.LotNoticeVO;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@@ -38,4 +39,10 @@ public class LotNoticeServiceImpl extends ServiceImpl<LotNoticeMapper, LotNotice
             updateWrapper.set(LotNotice::getPubTime,new Date());
         return getBaseMapper().update(updateWrapper);
     }
+
+    @Override
+    public Page<LotNoticeVO> selectLotNoticeByType(LotNotice lotNotice) {
+        Page<LotNoticeVO> lotNoticePage = new Page<>(lotNotice.getPageNum(), lotNotice.getPageSize());
+        return getBaseMapper().selectNoticeByType(lotNoticePage,lotNotice.getType());
+    }
 }

+ 4 - 0
lot/src/main/java/cn/hobbystocks/auc/service/impl/LotServiceImpl.java

@@ -602,4 +602,8 @@ public class LotServiceImpl extends ServiceImpl<LotMapper,Lot> implements ILotSe
         }
     }
 
+    @Override
+    public List<Lot> selectLotListByAucId(Long aucId) {
+        return getBaseMapper().selectLotByAucId(aucId);
+    }
 }

+ 30 - 0
lot/src/main/java/cn/hobbystocks/auc/vo/LotNoticeVO.java

@@ -0,0 +1,30 @@
+package cn.hobbystocks.auc.vo;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.util.Date;
+
+@Data
+@ApiModel("公告信息")
+public class LotNoticeVO {
+    @ApiModelProperty("公告id")
+    private Long id;
+    @ApiModelProperty("公告标题")
+    private String title;
+    @ApiModelProperty("公告内容")
+    private String content;
+    @ApiModelProperty("公告类型")
+    private String type;
+    @ApiModelProperty("公告状态")
+    private Integer status;
+    @ApiModelProperty("创建时间")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    private Date createTime;
+    @ApiModelProperty("发布时间")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    private Date pubTime;
+    private Integer isNew;
+}

+ 4 - 1
lot/src/main/resources/mapper/AuctionMapper.xml

@@ -8,7 +8,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="id"    column="id"    />
         <result property="no"    column="no"    />
         <result property="name"    column="name"    />
-        <result property="site"    column="site"    />
         <result property="imgs"    column="imgs"    />
         <result property="banner"    column="banner"    />
         <result property="deposit"    column="deposit"    />
@@ -191,4 +190,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         </foreach>
     </delete>
 
+    <select id="selectAucBannerList" resultType="cn.hobbystocks.auc.domain.Auction">
+        select id,name,banner,imgs,description,start_time startTime,status from auction
+        where pub_status=1 order by sort desc
+    </select>
 </mapper>

+ 15 - 0
lot/src/main/resources/mapper/LotNoticeMapper.xml

@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="cn.hobbystocks.auc.mapper.LotNoticeMapper">
+    <select id="selectNoticeByType" resultType="cn.hobbystocks.auc.vo.LotNoticeVO">
+        select id,title,content,type,create_time createTime,case when create_time + INTERVAL '7 day'>now() then 1 else 0 end as isNew from lot_notice
+        <where>
+            <if test="type!=null and type!=''">
+                and type=#{type}
+            </if>
+           and status=1
+        </where>
+    </select>
+</mapper>