jin пре 6 месеци
родитељ
комит
f880a1835a

+ 104 - 0
ruoyi-framework/src/main/java/com/ruoyi/framework/recovery/controller/RecSaleInfoController.java

@@ -0,0 +1,104 @@
+package com.ruoyi.framework.recovery.controller;
+
+import java.util.List;
+import jakarta.servlet.http.HttpServletResponse;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+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.framework.recovery.domain.RecSaleInfo;
+import com.ruoyi.framework.recovery.service.IRecSaleInfoService;
+import com.ruoyi.common.utils.poi.ExcelUtil;
+import com.ruoyi.common.core.page.TableDataInfo;
+
+/**
+ * 发售信息详情Controller
+ * 
+ * @author jin
+ * @date 2024-11-18
+ */
+@RestController
+@RequestMapping("/recovery/info")
+public class RecSaleInfoController extends BaseController
+{
+    @Autowired
+    private IRecSaleInfoService recSaleInfoService;
+
+    /**
+     * 查询发售信息详情列表
+     */
+    @PreAuthorize("@ss.hasPermi('recovery:info:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(RecSaleInfo recSaleInfo)
+    {
+        startPage();
+        List<RecSaleInfo> list = recSaleInfoService.selectRecSaleInfoList(recSaleInfo);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出发售信息详情列表
+     */
+    @PreAuthorize("@ss.hasPermi('recovery:info:export')")
+    @Log(title = "发售信息详情", businessType = BusinessType.EXPORT)
+    @PostMapping("/export")
+    public void export(HttpServletResponse response, RecSaleInfo recSaleInfo)
+    {
+        List<RecSaleInfo> list = recSaleInfoService.selectRecSaleInfoList(recSaleInfo);
+        ExcelUtil<RecSaleInfo> util = new ExcelUtil<RecSaleInfo>(RecSaleInfo.class);
+        util.exportExcel(response, list, "发售信息详情数据");
+    }
+
+    /**
+     * 获取发售信息详情详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('recovery:info:query')")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id)
+    {
+        return success(recSaleInfoService.selectRecSaleInfoById(id));
+    }
+
+    /**
+     * 新增发售信息详情
+     */
+    @PreAuthorize("@ss.hasPermi('recovery:info:add')")
+    @Log(title = "发售信息详情", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody RecSaleInfo recSaleInfo)
+    {
+        return toAjax(recSaleInfoService.insertRecSaleInfo(recSaleInfo));
+    }
+
+    /**
+     * 修改发售信息详情
+     */
+    @PreAuthorize("@ss.hasPermi('recovery:info:edit')")
+    @Log(title = "发售信息详情", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody RecSaleInfo recSaleInfo)
+    {
+        return toAjax(recSaleInfoService.updateRecSaleInfo(recSaleInfo));
+    }
+
+    /**
+     * 删除发售信息详情
+     */
+    @PreAuthorize("@ss.hasPermi('recovery:info:remove')")
+    @Log(title = "发售信息详情", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids)
+    {
+        return toAjax(recSaleInfoService.deleteRecSaleInfoByIds(ids));
+    }
+}

+ 127 - 0
ruoyi-framework/src/main/java/com/ruoyi/framework/recovery/domain/RecSaleInfo.java

@@ -0,0 +1,127 @@
+package com.ruoyi.framework.recovery.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;
+
+/**
+ * 发售信息详情对象 rec_sale_info
+ * 
+ * @author jin
+ * @date 2024-11-18
+ */
+public class RecSaleInfo extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** 发售信息id */
+    private Long id;
+
+    /** 发售名称 */
+    @Excel(name = "发售名称")
+    private String saleName;
+
+    /** 发售价格 */
+    @Excel(name = "发售价格")
+    private String salePrice;
+
+    /** 市场价格 */
+    @Excel(name = "市场价格")
+    private String market;
+
+    /** 商品id */
+    @Excel(name = "商品id")
+    private String commodityId;
+
+    /** 创建时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    @Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date createDate;
+
+    /** 更新时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    @Excel(name = "更新时间", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date updateDate;
+
+    public void setId(Long id) 
+    {
+        this.id = id;
+    }
+
+    public Long getId() 
+    {
+        return id;
+    }
+    public void setSaleName(String saleName) 
+    {
+        this.saleName = saleName;
+    }
+
+    public String getSaleName() 
+    {
+        return saleName;
+    }
+    public void setSalePrice(String salePrice) 
+    {
+        this.salePrice = salePrice;
+    }
+
+    public String getSalePrice() 
+    {
+        return salePrice;
+    }
+    public void setMarket(String market) 
+    {
+        this.market = market;
+    }
+
+    public String getMarket() 
+    {
+        return market;
+    }
+    public void setCommodityId(String commodityId) 
+    {
+        this.commodityId = commodityId;
+    }
+
+    public String getCommodityId() 
+    {
+        return commodityId;
+    }
+    public void setCreateDate(Date createDate) 
+    {
+        this.createDate = createDate;
+    }
+
+    public Date getCreateDate() 
+    {
+        return createDate;
+    }
+    public void setUpdateDate(Date updateDate) 
+    {
+        this.updateDate = updateDate;
+    }
+
+    public Date getUpdateDate() 
+    {
+        return updateDate;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+            .append("id", getId())
+            .append("saleName", getSaleName())
+            .append("salePrice", getSalePrice())
+            .append("market", getMarket())
+            .append("commodityId", getCommodityId())
+            .append("createBy", getCreateBy())
+            .append("createDate", getCreateDate())
+            .append("updateBy", getUpdateBy())
+            .append("updateDate", getUpdateDate())
+            .toString();
+    }
+}

+ 16 - 1
ruoyi-framework/src/main/java/com/ruoyi/framework/recovery/domain/RecStores.java

@@ -73,6 +73,12 @@ public class RecStores extends BaseEntity
     @Excel(name = "是否通知")
     private String notice;
 
+    /**
+     * 发售数量
+     */
+    @Excel(name = "发售数量")
+    private Long saleNum;
+
     public void setId(Long id)
     {
         this.id = id;
@@ -190,6 +196,14 @@ public class RecStores extends BaseEntity
         this.notice = notice;
     }
 
+    public Long getSaleNum() {
+        return saleNum;
+    }
+
+    public void setSaleNum(Long saleNum) {
+        this.saleNum = saleNum;
+    }
+
     @Override
     public String toString() {
         final StringBuffer sb = new StringBuffer("RecStores{");
@@ -203,9 +217,10 @@ public class RecStores extends BaseEntity
         sb.append(", saleLink='").append(saleLink).append('\'');
         sb.append(", createDate=").append(createDate);
         sb.append(", updateDate=").append(updateDate);
-        sb.append(", commondityId=").append(commondityId);
+        sb.append(", commondityId='").append(commondityId).append('\'');
         sb.append(", storesAddress='").append(storesAddress).append('\'');
         sb.append(", notice='").append(notice).append('\'');
+        sb.append(", saleNum=").append(saleNum);
         sb.append('}');
         return sb.toString();
     }

+ 61 - 0
ruoyi-framework/src/main/java/com/ruoyi/framework/recovery/mapper/RecSaleInfoMapper.java

@@ -0,0 +1,61 @@
+package com.ruoyi.framework.recovery.mapper;
+
+import java.util.List;
+import com.ruoyi.framework.recovery.domain.RecSaleInfo;
+
+/**
+ * 发售信息详情Mapper接口
+ * 
+ * @author jin
+ * @date 2024-11-18
+ */
+public interface RecSaleInfoMapper 
+{
+    /**
+     * 查询发售信息详情
+     * 
+     * @param id 发售信息详情主键
+     * @return 发售信息详情
+     */
+    public RecSaleInfo selectRecSaleInfoById(Long id);
+
+    /**
+     * 查询发售信息详情列表
+     * 
+     * @param recSaleInfo 发售信息详情
+     * @return 发售信息详情集合
+     */
+    public List<RecSaleInfo> selectRecSaleInfoList(RecSaleInfo recSaleInfo);
+
+    /**
+     * 新增发售信息详情
+     * 
+     * @param recSaleInfo 发售信息详情
+     * @return 结果
+     */
+    public int insertRecSaleInfo(RecSaleInfo recSaleInfo);
+
+    /**
+     * 修改发售信息详情
+     * 
+     * @param recSaleInfo 发售信息详情
+     * @return 结果
+     */
+    public int updateRecSaleInfo(RecSaleInfo recSaleInfo);
+
+    /**
+     * 删除发售信息详情
+     * 
+     * @param id 发售信息详情主键
+     * @return 结果
+     */
+    public int deleteRecSaleInfoById(Long id);
+
+    /**
+     * 批量删除发售信息详情
+     * 
+     * @param ids 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deleteRecSaleInfoByIds(Long[] ids);
+}

+ 61 - 0
ruoyi-framework/src/main/java/com/ruoyi/framework/recovery/service/IRecSaleInfoService.java

@@ -0,0 +1,61 @@
+package com.ruoyi.framework.recovery.service;
+
+import java.util.List;
+import com.ruoyi.framework.recovery.domain.RecSaleInfo;
+
+/**
+ * 发售信息详情Service接口
+ * 
+ * @author jin
+ * @date 2024-11-18
+ */
+public interface IRecSaleInfoService 
+{
+    /**
+     * 查询发售信息详情
+     * 
+     * @param id 发售信息详情主键
+     * @return 发售信息详情
+     */
+    public RecSaleInfo selectRecSaleInfoById(Long id);
+
+    /**
+     * 查询发售信息详情列表
+     * 
+     * @param recSaleInfo 发售信息详情
+     * @return 发售信息详情集合
+     */
+    public List<RecSaleInfo> selectRecSaleInfoList(RecSaleInfo recSaleInfo);
+
+    /**
+     * 新增发售信息详情
+     * 
+     * @param recSaleInfo 发售信息详情
+     * @return 结果
+     */
+    public int insertRecSaleInfo(RecSaleInfo recSaleInfo);
+
+    /**
+     * 修改发售信息详情
+     * 
+     * @param recSaleInfo 发售信息详情
+     * @return 结果
+     */
+    public int updateRecSaleInfo(RecSaleInfo recSaleInfo);
+
+    /**
+     * 批量删除发售信息详情
+     * 
+     * @param ids 需要删除的发售信息详情主键集合
+     * @return 结果
+     */
+    public int deleteRecSaleInfoByIds(Long[] ids);
+
+    /**
+     * 删除发售信息详情信息
+     * 
+     * @param id 发售信息详情主键
+     * @return 结果
+     */
+    public int deleteRecSaleInfoById(Long id);
+}

+ 93 - 0
ruoyi-framework/src/main/java/com/ruoyi/framework/recovery/service/impl/RecSaleInfoServiceImpl.java

@@ -0,0 +1,93 @@
+package com.ruoyi.framework.recovery.service.impl;
+
+import java.util.List;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.ruoyi.framework.recovery.mapper.RecSaleInfoMapper;
+import com.ruoyi.framework.recovery.domain.RecSaleInfo;
+import com.ruoyi.framework.recovery.service.IRecSaleInfoService;
+
+/**
+ * 发售信息详情Service业务层处理
+ * 
+ * @author jin
+ * @date 2024-11-18
+ */
+@Service
+public class RecSaleInfoServiceImpl implements IRecSaleInfoService 
+{
+    @Autowired
+    private RecSaleInfoMapper recSaleInfoMapper;
+
+    /**
+     * 查询发售信息详情
+     * 
+     * @param id 发售信息详情主键
+     * @return 发售信息详情
+     */
+    @Override
+    public RecSaleInfo selectRecSaleInfoById(Long id)
+    {
+        return recSaleInfoMapper.selectRecSaleInfoById(id);
+    }
+
+    /**
+     * 查询发售信息详情列表
+     * 
+     * @param recSaleInfo 发售信息详情
+     * @return 发售信息详情
+     */
+    @Override
+    public List<RecSaleInfo> selectRecSaleInfoList(RecSaleInfo recSaleInfo)
+    {
+        return recSaleInfoMapper.selectRecSaleInfoList(recSaleInfo);
+    }
+
+    /**
+     * 新增发售信息详情
+     * 
+     * @param recSaleInfo 发售信息详情
+     * @return 结果
+     */
+    @Override
+    public int insertRecSaleInfo(RecSaleInfo recSaleInfo)
+    {
+        return recSaleInfoMapper.insertRecSaleInfo(recSaleInfo);
+    }
+
+    /**
+     * 修改发售信息详情
+     * 
+     * @param recSaleInfo 发售信息详情
+     * @return 结果
+     */
+    @Override
+    public int updateRecSaleInfo(RecSaleInfo recSaleInfo)
+    {
+        return recSaleInfoMapper.updateRecSaleInfo(recSaleInfo);
+    }
+
+    /**
+     * 批量删除发售信息详情
+     * 
+     * @param ids 需要删除的发售信息详情主键
+     * @return 结果
+     */
+    @Override
+    public int deleteRecSaleInfoByIds(Long[] ids)
+    {
+        return recSaleInfoMapper.deleteRecSaleInfoByIds(ids);
+    }
+
+    /**
+     * 删除发售信息详情信息
+     * 
+     * @param id 发售信息详情主键
+     * @return 结果
+     */
+    @Override
+    public int deleteRecSaleInfoById(Long id)
+    {
+        return recSaleInfoMapper.deleteRecSaleInfoById(id);
+    }
+}

+ 91 - 0
ruoyi-system/src/main/resources/mapper/system/RecSaleInfoMapper.xml

@@ -0,0 +1,91 @@
+<?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.framework.recovery.mapper.RecSaleInfoMapper">
+    
+    <resultMap type="RecSaleInfo" id="RecSaleInfoResult">
+        <result property="id"    column="id"    />
+        <result property="saleName"    column="sale_name"    />
+        <result property="salePrice"    column="sale_price"    />
+        <result property="market"    column="market"    />
+        <result property="commodityId"    column="commodity_id"    />
+        <result property="createBy"    column="create_by"    />
+        <result property="createDate"    column="create_date"    />
+        <result property="updateBy"    column="update_by"    />
+        <result property="updateDate"    column="update_date"    />
+    </resultMap>
+
+    <sql id="selectRecSaleInfoVo">
+        select id, sale_name, sale_price, market, commodity_id, create_by, create_date, update_by, update_date from rec_sale_info
+    </sql>
+
+    <select id="selectRecSaleInfoList" parameterType="RecSaleInfo" resultMap="RecSaleInfoResult">
+        <include refid="selectRecSaleInfoVo"/>
+        <where>  
+            <if test="saleName != null  and saleName != ''"> and sale_name like concat('%', #{saleName}, '%')</if>
+            <if test="salePrice != null  and salePrice != ''"> and sale_price = #{salePrice}</if>
+            <if test="market != null  and market != ''"> and market = #{market}</if>
+            <if test="commodityId != null  and commodityId != ''"> and commodity_id = #{commodityId}</if>
+            <if test="createDate != null "> and create_date = #{createDate}</if>
+            <if test="updateDate != null "> and update_date = #{updateDate}</if>
+        </where>
+    </select>
+    
+    <select id="selectRecSaleInfoById" parameterType="Long" resultMap="RecSaleInfoResult">
+        <include refid="selectRecSaleInfoVo"/>
+        where id = #{id}
+    </select>
+
+    <insert id="insertRecSaleInfo" parameterType="RecSaleInfo">
+        insert into rec_sale_info
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="id != null">id,</if>
+            <if test="saleName != null">sale_name,</if>
+            <if test="salePrice != null">sale_price,</if>
+            <if test="market != null">market,</if>
+            <if test="commodityId != null">commodity_id,</if>
+            <if test="createBy != null">create_by,</if>
+            <if test="createDate != null">create_date,</if>
+            <if test="updateBy != null">update_by,</if>
+            <if test="updateDate != null">update_date,</if>
+         </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="id != null">#{id},</if>
+            <if test="saleName != null">#{saleName},</if>
+            <if test="salePrice != null">#{salePrice},</if>
+            <if test="market != null">#{market},</if>
+            <if test="commodityId != null">#{commodityId},</if>
+            <if test="createBy != null">#{createBy},</if>
+            <if test="createDate != null">#{createDate},</if>
+            <if test="updateBy != null">#{updateBy},</if>
+            <if test="updateDate != null">#{updateDate},</if>
+         </trim>
+    </insert>
+
+    <update id="updateRecSaleInfo" parameterType="RecSaleInfo">
+        update rec_sale_info
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="saleName != null">sale_name = #{saleName},</if>
+            <if test="salePrice != null">sale_price = #{salePrice},</if>
+            <if test="market != null">market = #{market},</if>
+            <if test="commodityId != null">commodity_id = #{commodityId},</if>
+            <if test="createBy != null">create_by = #{createBy},</if>
+            <if test="createDate != null">create_date = #{createDate},</if>
+            <if test="updateBy != null">update_by = #{updateBy},</if>
+            <if test="updateDate != null">update_date = #{updateDate},</if>
+        </trim>
+        where id = #{id}
+    </update>
+
+    <delete id="deleteRecSaleInfoById" parameterType="Long">
+        delete from rec_sale_info where id = #{id}
+    </delete>
+
+    <delete id="deleteRecSaleInfoByIds" parameterType="String">
+        delete from rec_sale_info where id in 
+        <foreach item="id" collection="array" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </delete>
+</mapper>

+ 6 - 1
ruoyi-system/src/main/resources/mapper/system/RecStoresMapper.xml

@@ -20,11 +20,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="commondityId"    column="commondity_id"    />
         <result property="storesAddress"    column="stores_address"    />
         <result property="notice" column="notice" />
+        <result property="saleNum" column="sale_num" />
     </resultMap>
 
     <sql id="selectRecStoresVo">
         select id, stores_name, sale_type, sale_time, check_time, check_type, buy_time, sale_link, create_by,
-               create_date, update_by, update_date, commondity_id, stores_address, notice
+               create_date, update_by, update_date, commondity_id, stores_address, notice, sale_num
         from rec_stores
     </sql>
 
@@ -43,6 +44,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="commondityId != null "> and commondity_id = #{commondityId}</if>
             <if test="storesAddress != null  and storesAddress != ''"> and stores_address = #{storesAddress}</if>
             <if test="notice != null  and notice != ''"> and notice = #{notice}</if>
+            <if test="saleNum != null  and saleNum != ''"> and sale_num = #{saleNum}</if>
         </where>
     </select>
 
@@ -69,6 +71,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="commondityId != null">commondity_id,</if>
             <if test="storesAddress != null">stores_address,</if>
             <if test="notice != null">notice,</if>
+            <if test="saleNum != null">sale_num,</if>
          </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="id != null">#{id},</if>
@@ -86,6 +89,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="commondityId != null">#{commondityId},</if>
             <if test="storesAddress != null">#{storesAddress},</if>
             <if test="notice != null">#{notice},</if>
+            <if test="saleNum != null">#{saleNum},</if>
          </trim>
     </insert>
 
@@ -106,6 +110,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="commondityId != null">commondity_id = #{commondityId},</if>
             <if test="storesAddress != null">stores_address = #{storesAddress},</if>
             <if test="notice != null">notice = #{notice},</if>
+            <if test="saleNum != null">sale_num = #{saleNum},</if>
         </trim>
         where id = #{id}
     </update>