Browse Source

增删改查首次完善 条件搜索 在售 预售 已过期 藏品详情

zhangyang 2 years ago
parent
commit
8408ad182c

+ 158 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/PoTetherController.java

@@ -0,0 +1,158 @@
+package com.ruoyi.web.controller.system;
+
+import java.util.Date;
+import java.util.List;
+import javax.servlet.http.HttpServletResponse;
+
+import com.ruoyi.system.domain.PoCollection;
+import com.ruoyi.system.domain.vo.TetherVo;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+import com.ruoyi.common.annotation.Log;
+import com.ruoyi.common.core.controller.BaseController;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.enums.BusinessType;
+import com.ruoyi.system.domain.PoTether;
+import com.ruoyi.system.service.IPoTetherService;
+import com.ruoyi.common.utils.poi.ExcelUtil;
+import com.ruoyi.common.core.page.TableDataInfo;
+
+/**
+ * 套系Controller
+ *
+ * @author ruoyi
+ * @date 2023-02-12
+ */
+@RestController
+@RequestMapping("/system/tether")
+public class PoTetherController extends BaseController
+{
+    @Autowired
+    private IPoTetherService poTetherService;
+
+    /**
+     * 标题和时间搜索消息列表
+     */
+    @ApiOperation("标题和时间搜索消息列表")
+    @Log(title = "标题和时间搜索")
+    @PreAuthorize("@ss.hasPermi('system:tether:queryTether')")
+    @GetMapping("/queryTether")
+    public TableDataInfo list(@RequestParam(value="tetherName",required = false)String tetherName,
+                              @RequestParam(value="tetherTimeStart",required = false) Date tetherTimeStart,
+                              @RequestParam(value="tetherTimeEnd",required = false) Date tetherTimeEnd)
+    {
+        startPage();
+        List<PoTether> list= poTetherService.selectListByTitleAndTime(tetherName,tetherTimeStart,tetherTimeEnd);
+        return getDataTable(list);
+    }
+
+    /**
+     * 查询套系列表 在售
+     */
+    @PreAuthorize("@ss.hasPermi('system:tether:sellingList')")
+    @GetMapping("/sellingList")
+    public TableDataInfo sellingList(PoTether poTether)
+    {
+        startPage();
+        List<PoTether> sellingList = poTetherService.selectPoTetherSellingList(poTether);
+        return getDataTable(sellingList);
+    }
+    /**
+     * 查询套系列表 预售
+     */
+    @PreAuthorize("@ss.hasPermi('system:tether:advanceList')")
+    @GetMapping("/advanceList")
+    public TableDataInfo advanceList(PoTether poTether)
+    {
+        startPage();
+        List<PoTether> advanceList = poTetherService.selectPoTetherAdvanceList(poTether);
+        return getDataTable(advanceList);
+    }
+    /**
+     * 查询套系列表 已过期
+     */
+    @PreAuthorize("@ss.hasPermi('system:tether:selledList')")
+    @GetMapping("/selledList")
+    public TableDataInfo selledList(PoTether poTether)
+    {
+        startPage();
+        List<PoTether> selledList = poTetherService.selectPoTetherSelledList(poTether);
+        return getDataTable(selledList);
+    }
+
+    /**
+     * 导出套系列表
+     */
+    @PreAuthorize("@ss.hasPermi('system:tether:export')")
+    @Log(title = "套系", businessType = BusinessType.EXPORT)
+    @PostMapping("/export")
+    public void export(HttpServletResponse response, PoTether poTether)
+    {
+        List<PoTether> list = poTetherService.selectPoTetherList(poTether);
+        ExcelUtil<PoTether> util = new ExcelUtil<PoTether>(PoTether.class);
+        util.exportExcel(response, list, "套系数据");
+    }
+
+
+    /**
+     * 藏品列表
+     */
+    @PreAuthorize("@ss.hasPermi('system:tether:collectionList')")
+    @GetMapping("/collectionList/{tetherId}")
+    public TableDataInfo collectionList( @PathVariable("tetherId") Long tetherId){
+
+        startPage();
+        List<PoCollection> collectionList = poTetherService.selectPoCollectionListById(tetherId);
+        return getDataTable(collectionList);
+    }
+
+    /**
+     * 新增套系
+     */
+    @PreAuthorize("@ss.hasPermi('system:tether:add')")
+    @Log(title = "套系", businessType = BusinessType.INSERT)
+    @PostMapping("/add")
+    public AjaxResult add(@RequestBody TetherVo tetherVo)
+    {
+        return toAjax(poTetherService.insertPoTetherWithCollection(tetherVo));
+    }
+
+    /**
+     * 通过id获取套系详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('system:tether:query')")
+    @GetMapping(value = "/{tetherId}")
+    public AjaxResult getInfo(@PathVariable("tetherId") Long tetherId)
+    {
+       TetherVo byIdWithCollection = poTetherService.selectPoTetherByTetherIdWithCollection(tetherId);
+       return success(byIdWithCollection);
+    }
+
+    /**
+     * 修改套系
+     */
+    @PreAuthorize("@ss.hasPermi('system:tether:edit')")
+    @Log(title = "套系", businessType = BusinessType.UPDATE)
+    @PutMapping("edit")
+    public AjaxResult edit(@RequestBody TetherVo tetherVo)
+    {
+        //清理所有套系的缓存数
+        //因为对于修改操作,用户是可以修改菜品的分类的,如果用户修改了菜品的分类,
+        // 那么原来分类下将少一个菜品,新的分类下将多一个菜品,这样的话,两个分类下的菜品列表数据都发生了变化。
+        return toAjax(poTetherService.updatePoTetherWithCollection(tetherVo));
+    }
+
+    /**
+     * 删除套系
+     */
+    @PreAuthorize("@ss.hasPermi('system:tether:remove')")
+    @Log(title = "套系", businessType = BusinessType.DELETE)
+    @DeleteMapping("/remove/{tetherIds}")
+    public AjaxResult remove(@PathVariable Long[] tetherIds)
+    {
+        return toAjax(poTetherService.deletePoTetherByTetherIdsWithCollection(tetherIds));
+    }
+}
+

+ 222 - 0
ruoyi-system/src/main/java/com/ruoyi/system/domain/PoCollection.java

@@ -0,0 +1,222 @@
+package com.ruoyi.system.domain;
+
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+import com.ruoyi.common.annotation.Excel;
+import com.ruoyi.common.core.domain.BaseEntity;
+
+/**
+ * 【请填写功能名称】对象 po_collection
+ *
+ * @author ruoyi
+ * @date 2023-02-12
+ */
+public class PoCollection extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** 藏品Id */
+    private Long collectionId;
+
+    private Long tetherId;
+
+    /** 藏品名字 */
+    @Excel(name = "藏品名字")
+    private String collectionTitle;
+
+    /** 藏品状态(0正常 1禁止) */
+    @Excel(name = "藏品状态", readConverterExp = "0=正常,1=禁止")
+    private String status;
+
+    /** 藏品类型(0邮票 1其他) */
+    @Excel(name = "藏品类型", readConverterExp = "0=邮票,1=其他")
+    private Long collectionType;
+
+    /** 是否删除(1删除 0未删除) */
+    private Long delFlag;
+
+    /** 藏品数量 */
+    @Excel(name = "藏品数量")
+    private Long total;
+
+    /** 藏品图片 */
+    @Excel(name = "藏品图片")
+    private String image;
+
+    /** 模版 */
+    @Excel(name = "模版")
+    private String formwork;
+
+    /** 藏品价格 */
+    @Excel(name = "藏品价格")
+    private Long price;
+
+    /** 发行方 */
+    @Excel(name = "发行方")
+    private Long publisherName;
+
+    /** 作者故事 */
+    @Excel(name = "作者故事")
+    private String story;
+
+    /** 是否上架(0上链 1未上链) */
+    @Excel(name = "是否上架", readConverterExp = "0=上链,1=未上链")
+    private Long grounding;
+
+    /** 是否上链(0上链1未上链) */
+    @Excel(name = "是否上链", readConverterExp = "0=上链1未上链")
+    private Long cochain;
+
+
+    public void setTetherId(Long tetherId) {
+        this.tetherId = tetherId;
+    }
+
+    public Long getTetherId() {
+        return tetherId;
+    }
+
+    public void setCollectionId(Long collectionId)
+    {
+        this.collectionId = collectionId;
+    }
+
+    public Long getCollectionId()
+    {
+        return collectionId;
+    }
+    public void setCollectionTitle(String collectionTitle)
+    {
+        this.collectionTitle = collectionTitle;
+    }
+
+    public String getCollectionTitle()
+    {
+        return collectionTitle;
+    }
+    public void setStatus(String status)
+    {
+        this.status = status;
+    }
+
+    public String getStatus()
+    {
+        return status;
+    }
+    public void setCollectionType(Long collectionType)
+    {
+        this.collectionType = collectionType;
+    }
+
+    public Long getCollectionType()
+    {
+        return collectionType;
+    }
+    public void setDelFlag(Long delFlag)
+    {
+        this.delFlag = delFlag;
+    }
+
+    public Long getDelFlag()
+    {
+        return delFlag;
+    }
+    public void setTotal(Long total)
+    {
+        this.total = total;
+    }
+
+    public Long getTotal()
+    {
+        return total;
+    }
+    public void setImage(String image)
+    {
+        this.image = image;
+    }
+
+    public String getImage()
+    {
+        return image;
+    }
+    public void setFormwork(String formwork)
+    {
+        this.formwork = formwork;
+    }
+
+    public String getFormwork()
+    {
+        return formwork;
+    }
+    public void setPrice(Long price)
+    {
+        this.price = price;
+    }
+
+    public Long getPrice()
+    {
+        return price;
+    }
+    public void setPublisherName(Long publisherName)
+    {
+        this.publisherName = publisherName;
+    }
+
+    public Long getPublisherName()
+    {
+        return publisherName;
+    }
+    public void setStory(String story)
+    {
+        this.story = story;
+    }
+
+    public String getStory()
+    {
+        return story;
+    }
+    public void setGrounding(Long grounding)
+    {
+        this.grounding = grounding;
+    }
+
+    public Long getGrounding()
+    {
+        return grounding;
+    }
+    public void setCochain(Long cochain)
+    {
+        this.cochain = cochain;
+    }
+
+    public Long getCochain()
+    {
+        return cochain;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+                .append("collectionId", getCollectionId())
+                .append("collectionTitle", getCollectionTitle())
+                .append("status", getStatus())
+                .append("collectionType", getCollectionType())
+                .append("createTime", getCreateTime())
+                .append("createBy", getCreateBy())
+                .append("updateTime", getUpdateTime())
+                .append("updateBy", getUpdateBy())
+                .append("delFlag", getDelFlag())
+                .append("total", getTotal())
+                .append("remark", getRemark())
+                .append("image", getImage())
+                .append("formwork", getFormwork())
+                .append("price", getPrice())
+                .append("publisherName", getPublisherName())
+                .append("story", getStory())
+                .append("grounding", getGrounding())
+                .append("cochain", getCochain())
+                .append("tetherId",getTetherId())
+                .toString();
+    }
+}
+

+ 126 - 0
ruoyi-system/src/main/java/com/ruoyi/system/domain/PoTether.java

@@ -0,0 +1,126 @@
+package com.ruoyi.system.domain;
+
+import java.util.Date;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+import com.ruoyi.common.annotation.Excel;
+import com.ruoyi.common.core.domain.BaseEntity;
+
+/**
+ * 套系对象 po_tether
+ *
+ * @author ruoyi
+ * @date 2023-02-12
+ */
+public class PoTether extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** 套系id */
+    private Long tetherId;
+
+    /** 套系名字 */
+    @Excel(name = "套系名字")
+    private String tetherName;
+    /**
+     * 套系售卖状态
+     */
+    private Integer sellStatus;
+
+    /** 展示时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    @Excel(name = "展示时间", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date showTime;
+
+    /** 数量 */
+    @Excel(name = "数量")
+    private Long total;
+
+    /** 状态(0已上架 1未上架 2已上链 3未上链) */
+    @Excel(name = "状态", readConverterExp = "0=已上架,1=未上架,2=已上链,3=未上链")
+    private Integer status;
+
+    private String delFlag;
+
+    public void setDelFlag(String delFlag) {
+        this.delFlag = delFlag;
+    }
+
+    public String getDelFlag() {
+        return delFlag;
+    }
+
+    public void setTetherId(Long tetherId)
+    {
+        this.tetherId = tetherId;
+    }
+
+    public Long getTetherId()
+    {
+        return tetherId;
+    }
+
+    public void setSellStatus(Integer sellStatus) {
+        this.sellStatus = sellStatus;
+    }
+
+    public Integer getSellStatus() {
+        return sellStatus;
+    }
+
+    public void setTetherName(String tetherName)
+    {
+        this.tetherName = tetherName;
+    }
+
+    public String getTetherName()
+    {
+        return tetherName;
+    }
+    public void setShowTime(Date showTime)
+    {
+        this.showTime = showTime;
+    }
+
+    public Date getShowTime()
+    {
+        return showTime;
+    }
+    public void setTotal(Long total)
+    {
+        this.total = total;
+    }
+
+    public Long getTotal()
+    {
+        return total;
+    }
+    public void setStatus(Integer status)
+    {
+        this.status = status;
+    }
+
+    public Integer getStatus()
+    {
+        return status;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+                .append("tetherId", getTetherId())
+                .append("tetherName", getTetherName())
+                .append("showTime", getShowTime())
+                .append("createBy", getCreateBy())
+                .append("createTime", getCreateTime())
+                .append("updateBy", getUpdateBy())
+                .append("updateTime", getUpdateTime())
+                .append("total", getTotal())
+                .append("status", getStatus())
+                .append("remark", getRemark())
+                .append("sellStatus",getSellStatus())
+                .append("delFlag",getDelFlag())
+                .toString();
+    }
+}

+ 29 - 0
ruoyi-system/src/main/java/com/ruoyi/system/domain/vo/TetherVo.java

@@ -0,0 +1,29 @@
+package com.ruoyi.system.domain.vo;
+
+import com.ruoyi.system.domain.PoCollection;
+import com.ruoyi.system.domain.PoTether;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class TetherVo extends PoTether {
+
+    private List<PoCollection> poCollections = new ArrayList<>(); //套系对应的藏品信息
+
+    public void setPoCollections(List<PoCollection> poCollections) {
+        this.poCollections = poCollections;
+    }
+
+    public List<PoCollection> getPoCollections() {
+        return poCollections;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
+                .append("poCollections", getPoCollections())
+                .toString();
+    }
+}

+ 105 - 0
ruoyi-system/src/main/java/com/ruoyi/system/mapper/PoTetherMapper.java

@@ -0,0 +1,105 @@
+package com.ruoyi.system.mapper;
+
+import java.util.Date;
+import java.util.List;
+
+import com.ruoyi.system.domain.PoCollection;
+import com.ruoyi.system.domain.PoTether;
+import org.apache.ibatis.annotations.Param;
+
+/**
+ * 套系Mapper接口
+ *
+ * @author ruoyi
+ * @date 2023-02-12
+ */
+public interface PoTetherMapper
+{
+    /**
+     * 查询套系
+     *
+     * @param tetherId 套系主键
+     * @return 套系
+     */
+    public PoTether selectPoTetherByTetherId(Long tetherId);
+
+    /**
+     * 查询套系列表
+     *
+     * @param poTether 套系
+     * @return 套系集合
+     */
+    public List<PoTether> selectPoTetherSellingList(PoTether poTether);
+
+    /**
+     * 新增套系
+     *
+     * @param poTether 套系
+     * @return 结果
+     */
+    public int insertPoTether(PoTether poTether);
+
+    /**
+     * 修改套系
+     *
+     * @param poTether 套系
+     * @return 结果
+     */
+    public int updatePoTether(PoTether poTether);
+
+    /**
+     * 删除套系
+     *
+     * @param tetherId 套系主键
+     * @return 结果
+     */
+    public int deletePoTetherByTetherId(Long tetherId);
+
+    /**
+     * 批量删除套系
+     *
+     * @param tetherIds 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deletePoTetherByTetherIds(Long[] tetherIds);
+
+    /**
+     * 按照标题和时间搜索
+     * @param title
+     * @param tetherTimeStart
+     * @param tetherTimeEnd
+     * @return
+     */
+    List<PoTether> selectPoTetherListByTitleAndTetherTimeStartAndTetherTimeEnd(@Param("tetherName") String title,
+                                                                               @Param("tetherTimeStart") Date tetherTimeStart,
+                                                                               @Param("tetherTimeEnd") Date tetherTimeEnd);
+
+    /**
+     * 预售
+     * @param poTether
+     * @return
+     */
+    List<PoTether> selectPoTetherAdvanceList(PoTether poTether);
+
+    /**
+     * 已过期
+     * @param poTether
+     * @return
+     */
+    List<PoTether> selectPoTetherSelledList(PoTether poTether);
+
+    /**
+     * 在售
+     * @param poTether
+     * @return
+     */
+    List<PoTether> selectPoTetherList(PoTether poTether);
+
+
+    /**
+     * 通过id查询藏品详细信息
+     * @param tetherId
+     * @return
+     */
+    List<PoCollection> selectPoCollectionListById(Long tetherId);
+}

+ 94 - 0
ruoyi-system/src/main/java/com/ruoyi/system/service/IPoTetherService.java

@@ -0,0 +1,94 @@
+package com.ruoyi.system.service;
+
+import java.util.Date;
+import java.util.List;
+
+import com.ruoyi.system.domain.PoCollection;
+import com.ruoyi.system.domain.PoTether;
+import com.ruoyi.system.domain.vo.TetherVo;
+
+/**
+ * 套系Service接口
+ *
+ * @author ruoyi
+ * @date 2023-02-12
+ */
+public interface IPoTetherService
+{
+
+    /**
+     * 查询套系列表
+     *
+     * @param poTether 套系 在售
+     * @return 套系集合
+     */
+    public List<PoTether> selectPoTetherSellingList(PoTether poTether);
+
+
+    /**
+     * 按照标题和时间查询
+     * @param tetherName
+     * @param tetherTimeStart
+     * @param tetherTimeEnd
+     * @return
+     */
+    List<PoTether> selectListByTitleAndTime(String tetherName, Date tetherTimeStart, Date tetherTimeEnd);
+
+    /**
+     * 预售
+     * @param poTether
+     * @return
+     */
+    List<PoTether> selectPoTetherAdvanceList(PoTether poTether);
+
+    /**
+     * 已过期
+     * @param poTether
+     * @return
+     */
+    List<PoTether> selectPoTetherSelledList(PoTether poTether);
+
+    /**
+     * 在售
+     * @param poTether
+     * @return
+     */
+    List<PoTether> selectPoTetherList(PoTether poTether);
+
+    /**
+     * 藏品按钮
+     * @param
+     * @return
+     */
+    List<PoCollection> selectPoCollectionListById(Long tetherId);
+
+    /**
+     * 新增套系
+     * @param tetherVo
+     * @return
+     */
+    boolean insertPoTetherWithCollection(TetherVo tetherVo);
+
+    /**
+     * 通过id查询套系信息和对应的藏品信息
+     * @param tetherId
+     * @return
+     */
+    TetherVo selectPoTetherByTetherIdWithCollection(Long tetherId);
+
+    /**
+     * 修改套系
+     * @param tetherVo
+     * @return
+     */
+
+    boolean updatePoTetherWithCollection(TetherVo tetherVo);
+
+    /**
+     * 同时删除套系和藏品的关联关系
+     * @param tetherIds
+     * @return
+     */
+    boolean deletePoTetherByTetherIdsWithCollection(Long[] tetherIds);
+}
+

+ 197 - 0
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/PoTetherServiceImpl.java

@@ -0,0 +1,197 @@
+package com.ruoyi.system.service.impl;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+import java.util.stream.Collectors;
+
+import com.ruoyi.common.utils.DateUtils;
+import com.ruoyi.common.utils.bean.BeanUtils;
+import com.ruoyi.system.domain.PoCollection;
+import com.ruoyi.system.domain.vo.TetherVo;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.ruoyi.system.mapper.PoTetherMapper;
+import com.ruoyi.system.domain.PoTether;
+import com.ruoyi.system.service.IPoTetherService;
+
+/**
+ * 套系Service业务层处理
+ *
+ * @author ruoyi
+ * @date 2023-02-12
+ */
+@Service
+public class PoTetherServiceImpl implements IPoTetherService
+{
+    @Autowired
+    private PoTetherMapper poTetherMapper;
+
+    /**
+     * 在售
+     * @param poTether 套系 在售
+     * @return
+     */
+    @Override
+    public List<PoTether> selectPoTetherSellingList(PoTether poTether)
+    {
+        return poTetherMapper.selectPoTetherSellingList(poTether);
+    }
+
+    /**
+     * 按照标题和时间搜索
+     * @param tetherName
+     * @param tetherTimeStart
+     * @param tetherTimeEnd
+     * @return
+     */
+    @Override
+    public List<PoTether> selectListByTitleAndTime(String tetherName, Date tetherTimeStart, Date tetherTimeEnd) {
+
+        if (tetherName != null) {
+            //标题不为空且开始时间和结束时间都不为空
+            if (tetherTimeStart != null && tetherTimeEnd != null) {
+
+                if (DateUtils.getNowDate().before(tetherTimeEnd)){
+                    tetherTimeEnd = DateUtils.getNowDate();
+                }
+                if (tetherTimeStart.before(tetherTimeEnd)) {
+                    return poTetherMapper.selectPoTetherListByTitleAndTetherTimeStartAndTetherTimeEnd(tetherName, tetherTimeStart, tetherTimeEnd);
+                } else{
+                    //有一个时间不为空返回提示信息
+                    List list = new ArrayList();
+                    list.add("请选择正确的时间段");
+                    return list;
+                }
+            } else {//时间都为空
+                return poTetherMapper.selectPoTetherListByTitleAndTetherTimeStartAndTetherTimeEnd(tetherName,tetherTimeStart,tetherTimeEnd);
+            }
+        }
+        //标题为空
+        else {
+            //时间不为空
+            if (tetherTimeStart != null && tetherTimeEnd != null) {
+                if (tetherTimeStart.before(tetherTimeEnd)){
+                    return poTetherMapper.selectPoTetherListByTitleAndTetherTimeStartAndTetherTimeEnd(tetherName,tetherTimeStart,tetherTimeEnd);
+                }else{
+                    //有一个时间不为空返回提示信息
+                    List list = new ArrayList();
+                    list.add("请选择正确的时间段");
+                    return list;
+                }
+            }
+        }
+        //都为空执行分页查询
+        PoTether poTether = new PoTether();
+        return poTetherMapper.selectPoTetherList(poTether);
+    }
+
+    /**
+     * 预售
+     * @param poTether
+     * @return
+     */
+    @Override
+    public List<PoTether> selectPoTetherAdvanceList(PoTether poTether) {
+        return poTetherMapper.selectPoTetherAdvanceList(poTether);
+
+    }
+
+    /**
+     * 已过期
+     * @param poTether
+     * @return
+     */
+    @Override
+    public List<PoTether> selectPoTetherSelledList(PoTether poTether) {
+        return poTetherMapper.selectPoTetherSelledList(poTether);
+    }
+
+    /**
+     * 查询套系列表
+     * @param poTether
+     * @return
+     */
+    @Override
+    public List<PoTether> selectPoTetherList(PoTether poTether) {
+        return poTetherMapper.selectPoTetherList(poTether);
+    }
+
+    /**
+     * 藏品按钮
+     * @param
+     * @return
+     */
+    @Override
+    public List<PoCollection> selectPoCollectionListById(Long tetherId) {
+
+        return poTetherMapper.selectPoCollectionListById(tetherId);
+    }
+
+    /**
+     * 新增套系 同时保存对应的藏品数据
+     *
+     * @param tetherVo
+     * @return
+     */
+    @Override
+    public boolean insertPoTetherWithCollection(TetherVo tetherVo) {
+        //保存套系的基本数据到套系表tether
+        this.poTetherMapper.insertPoTether(tetherVo);
+        Long tetherId = tetherVo.getTetherId();
+        //套系包含藏品
+        List<PoCollection> poCollections = tetherVo.getPoCollections();
+        poCollections.stream().map((item)->{
+            item.setTetherId(tetherId);
+            return item;
+        }).collect(Collectors.toList());
+        //保存藏品数据到藏品表 po_collection
+        //后续添加代码
+       return true;
+    }
+
+    /**
+     * 通过id查询套系信息和对应的藏品信息
+     * @param tetherId
+     * @return
+     */
+    @Override
+    public TetherVo selectPoTetherByTetherIdWithCollection(Long tetherId) {
+        //查询套系基本信息 po_tether
+        PoTether poTether = this.poTetherMapper.selectPoTetherByTetherId(tetherId);
+        TetherVo tetherVo = new TetherVo();
+        BeanUtils.copyProperties(poTether,tetherVo);
+        //查询当前套系对应的藏品信息
+        //后续添加代码
+        return  tetherVo;
+    }
+
+    /**
+     * 修改套系信息
+     * @param tetherVo
+     * @return
+     */
+    @Override
+    public boolean updatePoTetherWithCollection(TetherVo tetherVo) {
+        //更新po_tether表基本信息
+        this.poTetherMapper.updatePoTether(tetherVo);
+        //清理po_collection表数据
+        //添加当前提交过来的藏品数据--po_tether表的insert操作
+        return true;
+    }
+
+    /**
+     * 同时删除套系和藏品的关联关系
+     * @param tetherIds
+     * @return
+     */
+    @Override
+    public boolean deletePoTetherByTetherIdsWithCollection(Long[] tetherIds) {
+        //查询藏品状态确认是否可以删除
+        //如果可以删除 先删除套系po_tether表中的数据
+        this.poTetherMapper.deletePoTetherByTetherIds(tetherIds);
+        //删除po_collection表中的数据
+        return true;
+    }
+}
+

+ 180 - 0
ruoyi-system/src/main/resources/mapper/system/PoTetherMapper.xml

@@ -0,0 +1,180 @@
+<?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="com.ruoyi.system.mapper.PoTetherMapper">
+
+    <resultMap type="PoTether" id="PoTetherResult">
+        <result property="tetherId"    column="tether_id"    />
+        <result property="tetherName"    column="tether_name"    />
+        <result property="showTime"    column="show_time"    />
+        <result property="createBy"    column="create_by"    />
+        <result property="createTime"    column="create_time"    />
+        <result property="updateBy"    column="update_by"    />
+        <result property="updateTime"    column="update_time"    />
+        <result property="total"    column="total"    />
+        <result property="status"    column="status"    />
+        <result property="remark"    column="remark"    />
+        <result property="sellStatus" column="sell_status"/>
+        <result property="delFlag" column="del_flag"/>
+    </resultMap>
+
+    <resultMap type="PoCollection" id="PoCollectionResult">
+        <result property="collectionId"    column="collection_id"    />
+        <result property="collectionTitle"    column="collection_title"    />
+        <result property="status"    column="status"    />
+        <result property="collectionType"    column="collection_type"    />
+        <result property="createTime"    column="create_time"    />
+        <result property="createBy"    column="create_by"    />
+        <result property="updateTime"    column="update_time"    />
+        <result property="updateBy"    column="update_by"    />
+        <result property="delFlag"    column="del_flag"    />
+        <result property="total"    column="total"    />
+        <result property="remark"    column="remark"    />
+        <result property="image"    column="image"    />
+        <result property="formwork"    column="formwork"    />
+        <result property="price"    column="price"    />
+        <result property="publisherName"    column="publisher_name"    />
+        <result property="story"    column="story"    />
+        <result property="grounding"    column="grounding"    />
+        <result property="cochain"    column="cochain"    />
+    </resultMap>
+
+    <sql id="selectPoTetherVo">
+        select tether_id, tether_name, show_time, create_by, create_time, update_by, update_time, total, status, remark ,sell_status,del_flag from po_tether
+    </sql>
+
+<!--在售-->
+    <select id="selectPoTetherSellingList" parameterType="PoTether" resultMap="PoTetherResult">
+        <include refid="selectPoTetherVo"/>
+        <where>
+            <if test="tetherName != null  and tetherName != ''"> and tether_name like concat('%', #{tetherName}, '%')</if>
+            <if test="showTime != null "> and show_time = #{showTime}</if>
+            <if test="total != null "> and total = #{total}</if>
+            <if test="status != null  and status != ''"> and status = #{status}</if>
+            and del_flag = '0'
+            and sell_status = 0
+        </where>
+    </select>
+
+<!--获取详细信息-->
+    <select id="selectPoTetherByTetherId" parameterType="Long" resultMap="PoTetherResult">
+        <include refid="selectPoTetherVo"/>
+        where tether_id = #{tetherId}
+    </select>
+
+    <!--    标题时间都不为空-->
+    <select id="selectPoTetherListByTitleAndTetherTimeStartAndTetherTimeEnd"
+            resultType="PoTether" resultMap="PoTetherResult">
+        <include refid="selectPoTetherVo"></include>
+        <where>
+            <if test="tetherName != null  and tetherName != ''"> and tether_name like concat('%', #{tetherName}, '%')</if>
+            <if test="tetherTimeStart != null and tetherTimeEnd != null "> and show_time between #{tetherTimeStart} and #{tetherTimeEnd}</if>
+        </where>
+    </select>
+
+<!--预售-->
+    <select id="selectPoTetherAdvanceList" resultType="PoTether" resultMap="PoTetherResult">
+        <include refid="selectPoTetherVo"/>
+        <where>
+            <if test="tetherName != null  and tetherName != ''"> and tether_name like concat('%', #{tetherName}, '%')</if>
+            <if test="showTime != null "> and show_time = #{showTime}</if>
+            <if test="total != null "> and total = #{total}</if>
+            <if test="status != null  and status != ''"> and status = #{status}</if>
+            and del_flag = '0'
+            and sell_status = 1
+        </where>
+    </select>
+
+<!--已过期-->
+    <select id="selectPoTetherSelledList" resultType="PoTether" resultMap="PoTetherResult">
+        <include refid="selectPoTetherVo"/>
+        <where>
+            <if test="tetherName != null  and tetherName != ''"> and tether_name like concat('%', #{tetherName}, '%')</if>
+            <if test="showTime != null "> and show_time = #{showTime}</if>
+            <if test="total != null "> and total = #{total}</if>
+            <if test="status != null  and status != ''"> and status = #{status}</if>
+            and del_flag = '0'
+            and sell_status = 2
+        </where>
+    </select>
+
+<!--全为空时-->
+    <select id="selectPoTetherList" resultType="PoTether" resultMap="PoTetherResult">
+        <include refid="selectPoTetherVo"/>
+        <where>
+            <if test="tetherName != null  and tetherName != ''"> and tether_name like concat('%', #{tetherName}, '%')</if>
+            <if test="showTime != null "> and show_time = #{showTime}</if>
+            <if test="total != null "> and total = #{total}</if>
+            <if test="status != null  and status != ''"> and status = #{status}</if>
+            and del_flag = '0'
+        </where>
+
+    </select>
+
+<!--    根据套系id 查询对应藏品按钮里面的藏品信息-->
+    <select id="selectPoCollectionListById" resultMap="PoCollectionResult" >
+        select c.collection_title , c.image , c.collection_type , c.create_time , c.create_by
+             , c.total , c.status , c.price , c.story , c.grounding , c.cochain from po_collection c
+             left join po_tether t on t.tether_id = c.tether_id where t.tether_id = #{tetherId}
+
+    </select>
+
+<!--新增-->
+    <insert id="insertPoTether" parameterType="PoTether" useGeneratedKeys="true" keyProperty="tetherId">
+        insert into po_tether
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="tetherName != null">tether_name,</if>
+            <if test="showTime != null">show_time,</if>
+            <if test="createBy != null">create_by,</if>
+            <if test="createTime != null">create_time,</if>
+            <if test="updateBy != null">update_by,</if>
+            <if test="updateTime != null">update_time,</if>
+            <if test="total != null">total,</if>
+            <if test="status != null">status,</if>
+            <if test="remark != null">remark,</if>
+            <if test="sellStatus != null">sell_status,</if>
+        </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="tetherName != null">#{tetherName},</if>
+            <if test="showTime != null">#{showTime},</if>
+            <if test="createBy != null">#{createBy},</if>
+            <if test="createTime != null">#{createTime},</if>
+            <if test="updateBy != null">#{updateBy},</if>
+            <if test="updateTime != null">#{updateTime},</if>
+            <if test="total != null">#{total},</if>
+            <if test="status != null">#{status},</if>
+            <if test="remark != null">#{remark},</if>
+            <if test="sellStatus != null">#{sellStatus},</if>
+        </trim>
+    </insert>
+
+    <update id="updatePoTether" parameterType="PoTether">
+        update po_tether
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="tetherName != null">tether_name = #{tetherName},</if>
+            <if test="showTime != null">show_time = #{showTime},</if>
+            <if test="createBy != null">create_by = #{createBy},</if>
+            <if test="createTime != null">create_time = #{createTime},</if>
+            <if test="updateBy != null">update_by = #{updateBy},</if>
+            <if test="updateTime != null">update_time = #{updateTime},</if>
+            <if test="total != null">total = #{total},</if>
+            <if test="status != null">status = #{status},</if>
+            <if test="remark != null">remark = #{remark},</if>
+            <if test="sellStatus != null">sell_status = #{sellStatus},</if>
+        </trim>
+        where tether_id = #{tetherId}
+    </update>
+
+    <delete id="deletePoTetherByTetherId" parameterType="Long">
+        delete from po_tether where tether_id = #{tetherId}
+    </delete>
+
+    <delete id="deletePoTetherByTetherIds" parameterType="String">
+        delete from po_tether where tether_id in
+        <foreach item="tetherId" collection="array" open="(" separator="," close=")">
+            #{tetherId}
+        </foreach>
+    </delete>
+</mapper>
+