Browse Source

新增流转记录

zjc 1 year ago
parent
commit
c08b66cc8f

+ 106 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/invest/TProjectCirculationController.java

@@ -0,0 +1,106 @@
+package com.ruoyi.web.controller.invest;
+
+import java.util.List;
+import javax.servlet.http.HttpServletResponse;
+
+import com.ruoyi.invest.domain.TProjectCirculation;
+import com.ruoyi.invest.service.ITProjectCirculationService;
+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.common.utils.poi.ExcelUtil;
+import com.ruoyi.common.core.page.TableDataInfo;
+
+/**
+ * 项目流转记录Controller
+ * 
+ * @author ruoyi
+ * @date 2024-03-04
+ */
+@RestController
+@RequestMapping("/system/circulation")
+public class TProjectCirculationController extends BaseController
+{
+    @Autowired
+    private ITProjectCirculationService tProjectCirculationService;
+
+    /**
+     * 查询项目流转记录列表
+     */
+    @PreAuthorize("@ss.hasPermi('system:circulation:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(TProjectCirculation tProjectCirculation)
+    {
+        startPage();
+        List<TProjectCirculation> list = tProjectCirculationService.selectTProjectCirculationList(tProjectCirculation);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出项目流转记录列表
+     */
+    @PreAuthorize("@ss.hasPermi('system:circulation:export')")
+    @Log(title = "项目流转记录", businessType = BusinessType.EXPORT)
+    @PostMapping("/export")
+    public void export(HttpServletResponse response, TProjectCirculation tProjectCirculation)
+    {
+        List<TProjectCirculation> list = tProjectCirculationService.selectTProjectCirculationList(tProjectCirculation);
+        ExcelUtil<TProjectCirculation> util = new ExcelUtil<TProjectCirculation>(TProjectCirculation.class);
+        util.exportExcel(response, list, "项目流转记录数据");
+    }
+
+    /**
+     * 获取项目流转记录详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('system:circulation:query')")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") String id)
+    {
+        return success(tProjectCirculationService.selectTProjectCirculationById(id));
+    }
+
+    /**
+     * 新增项目流转记录
+     */
+    @PreAuthorize("@ss.hasPermi('system:circulation:add')")
+    @Log(title = "项目流转记录", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody TProjectCirculation tProjectCirculation)
+    {
+        
+        return toAjax(tProjectCirculationService.insertTProjectCirculation(tProjectCirculation));
+    }
+
+    /**
+     * 修改项目流转记录
+     */
+    @PreAuthorize("@ss.hasPermi('system:circulation:edit')")
+    @Log(title = "项目流转记录", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody TProjectCirculation tProjectCirculation)
+    {
+        return toAjax(tProjectCirculationService.updateTProjectCirculation(tProjectCirculation));
+    }
+
+    /**
+     * 删除项目流转记录
+     */
+    @PreAuthorize("@ss.hasPermi('system:circulation:remove')")
+    @Log(title = "项目流转记录", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable String[] ids)
+    {
+        return toAjax(tProjectCirculationService.deleteTProjectCirculationByIds(ids));
+    }
+}

+ 67 - 0
ruoyi-system/src/main/java/com/ruoyi/invest/domain/TProjectCirculation.java

@@ -0,0 +1,67 @@
+package com.ruoyi.invest.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;
+
+/**
+ * 项目流转记录对象 t_project_circulation
+ * 
+ * @author ruoyi
+ * @date 2024-03-04
+ */
+public class TProjectCirculation extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** 主键id */
+    private String id;
+
+    /** 阶段名称 */
+    @Excel(name = "阶段名称")
+    private String stageName;
+
+    /** 项目ID */
+    @Excel(name = "项目ID")
+    private String projectPoolId;
+
+    public void setId(String id) 
+    {
+        this.id = id;
+    }
+
+    public String getId() 
+    {
+        return id;
+    }
+    public void setStageName(String stageName) 
+    {
+        this.stageName = stageName;
+    }
+
+    public String getStageName() 
+    {
+        return stageName;
+    }
+    public void setProjectPoolId(String projectPoolId) 
+    {
+        this.projectPoolId = projectPoolId;
+    }
+
+    public String getProjectPoolId() 
+    {
+        return projectPoolId;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+            .append("id", getId())
+            .append("stageName", getStageName())
+            .append("projectPoolId", getProjectPoolId())
+            .append("createBy", getCreateBy())
+            .append("createTime", getCreateTime())
+            .toString();
+    }
+}

+ 62 - 0
ruoyi-system/src/main/java/com/ruoyi/invest/mapper/TProjectCirculationMapper.java

@@ -0,0 +1,62 @@
+package com.ruoyi.invest.mapper;
+
+import com.ruoyi.invest.domain.TProjectCirculation;
+
+import java.util.List;
+
+/**
+ * 项目流转记录Mapper接口
+ * 
+ * @author ruoyi
+ * @date 2024-03-04
+ */
+public interface TProjectCirculationMapper 
+{
+    /**
+     * 查询项目流转记录
+     * 
+     * @param id 项目流转记录主键
+     * @return 项目流转记录
+     */
+    public TProjectCirculation selectTProjectCirculationById(String id);
+
+    /**
+     * 查询项目流转记录列表
+     * 
+     * @param tProjectCirculation 项目流转记录
+     * @return 项目流转记录集合
+     */
+    public List<TProjectCirculation> selectTProjectCirculationList(TProjectCirculation tProjectCirculation);
+
+    /**
+     * 新增项目流转记录
+     * 
+     * @param tProjectCirculation 项目流转记录
+     * @return 结果
+     */
+    public int insertTProjectCirculation(TProjectCirculation tProjectCirculation);
+
+    /**
+     * 修改项目流转记录
+     * 
+     * @param tProjectCirculation 项目流转记录
+     * @return 结果
+     */
+    public int updateTProjectCirculation(TProjectCirculation tProjectCirculation);
+
+    /**
+     * 删除项目流转记录
+     * 
+     * @param id 项目流转记录主键
+     * @return 结果
+     */
+    public int deleteTProjectCirculationById(String id);
+
+    /**
+     * 批量删除项目流转记录
+     * 
+     * @param ids 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deleteTProjectCirculationByIds(String[] ids);
+}

+ 62 - 0
ruoyi-system/src/main/java/com/ruoyi/invest/service/ITProjectCirculationService.java

@@ -0,0 +1,62 @@
+package com.ruoyi.invest.service;
+
+import com.ruoyi.invest.domain.TProjectCirculation;
+
+import java.util.List;
+
+/**
+ * 项目流转记录Service接口
+ * 
+ * @author ruoyi
+ * @date 2024-03-04
+ */
+public interface ITProjectCirculationService 
+{
+    /**
+     * 查询项目流转记录
+     * 
+     * @param id 项目流转记录主键
+     * @return 项目流转记录
+     */
+    public TProjectCirculation selectTProjectCirculationById(String id);
+
+    /**
+     * 查询项目流转记录列表
+     * 
+     * @param tProjectCirculation 项目流转记录
+     * @return 项目流转记录集合
+     */
+    public List<TProjectCirculation> selectTProjectCirculationList(TProjectCirculation tProjectCirculation);
+
+    /**
+     * 新增项目流转记录
+     * 
+     * @param tProjectCirculation 项目流转记录
+     * @return 结果
+     */
+    public int insertTProjectCirculation(TProjectCirculation tProjectCirculation);
+
+    /**
+     * 修改项目流转记录
+     * 
+     * @param tProjectCirculation 项目流转记录
+     * @return 结果
+     */
+    public int updateTProjectCirculation(TProjectCirculation tProjectCirculation);
+
+    /**
+     * 批量删除项目流转记录
+     * 
+     * @param ids 需要删除的项目流转记录主键集合
+     * @return 结果
+     */
+    public int deleteTProjectCirculationByIds(String[] ids);
+
+    /**
+     * 删除项目流转记录信息
+     * 
+     * @param id 项目流转记录主键
+     * @return 结果
+     */
+    public int deleteTProjectCirculationById(String id);
+}

+ 97 - 0
ruoyi-system/src/main/java/com/ruoyi/invest/service/impl/TProjectCirculationServiceImpl.java

@@ -0,0 +1,97 @@
+package com.ruoyi.invest.service.impl;
+
+import java.util.List;
+import com.ruoyi.common.utils.DateUtils;
+import com.ruoyi.common.utils.uuid.IdUtils;
+import com.ruoyi.invest.domain.TProjectCirculation;
+import com.ruoyi.invest.mapper.TProjectCirculationMapper;
+import com.ruoyi.invest.service.ITProjectCirculationService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+/**
+ * 项目流转记录Service业务层处理
+ * 
+ * @author ruoyi
+ * @date 2024-03-04
+ */
+@Service
+public class TProjectCirculationServiceImpl implements ITProjectCirculationService
+{
+    @Autowired
+    private TProjectCirculationMapper tProjectCirculationMapper;
+
+    /**
+     * 查询项目流转记录
+     * 
+     * @param id 项目流转记录主键
+     * @return 项目流转记录
+     */
+    @Override
+    public TProjectCirculation selectTProjectCirculationById(String id)
+    {
+        return tProjectCirculationMapper.selectTProjectCirculationById(id);
+    }
+
+    /**
+     * 查询项目流转记录列表
+     * 
+     * @param tProjectCirculation 项目流转记录
+     * @return 项目流转记录
+     */
+    @Override
+    public List<TProjectCirculation> selectTProjectCirculationList(TProjectCirculation tProjectCirculation)
+    {
+        return tProjectCirculationMapper.selectTProjectCirculationList(tProjectCirculation);
+    }
+
+    /**
+     * 新增项目流转记录
+     * 
+     * @param tProjectCirculation 项目流转记录
+     * @return 结果
+     */
+    @Override
+    public int insertTProjectCirculation(TProjectCirculation tProjectCirculation)
+    {
+        tProjectCirculation.setCreateTime(DateUtils.getNowDate());
+        tProjectCirculation.setId(IdUtils.fastSimpleUUID());
+        return tProjectCirculationMapper.insertTProjectCirculation(tProjectCirculation);
+    }
+
+    /**
+     * 修改项目流转记录
+     * 
+     * @param tProjectCirculation 项目流转记录
+     * @return 结果
+     */
+    @Override
+    public int updateTProjectCirculation(TProjectCirculation tProjectCirculation)
+    {
+        return tProjectCirculationMapper.updateTProjectCirculation(tProjectCirculation);
+    }
+
+    /**
+     * 批量删除项目流转记录
+     * 
+     * @param ids 需要删除的项目流转记录主键
+     * @return 结果
+     */
+    @Override
+    public int deleteTProjectCirculationByIds(String[] ids)
+    {
+        return tProjectCirculationMapper.deleteTProjectCirculationByIds(ids);
+    }
+
+    /**
+     * 删除项目流转记录信息
+     * 
+     * @param id 项目流转记录主键
+     * @return 结果
+     */
+    @Override
+    public int deleteTProjectCirculationById(String id)
+    {
+        return tProjectCirculationMapper.deleteTProjectCirculationById(id);
+    }
+}

+ 71 - 0
ruoyi-system/src/main/resources/mapper/invest/TProjectCirculationMapper.xml

@@ -0,0 +1,71 @@
+<?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.TProjectCirculationMapper">
+    
+    <resultMap type="TProjectCirculation" id="TProjectCirculationResult">
+        <result property="id"    column="id"    />
+        <result property="stageName"    column="stage_name"    />
+        <result property="projectPoolId"    column="project_pool_id"    />
+        <result property="createBy"    column="create_by"    />
+        <result property="createTime"    column="create_time"    />
+    </resultMap>
+
+    <sql id="selectTProjectCirculationVo">
+        select id, stage_name, project_pool_id, create_by, create_time from t_project_circulation
+    </sql>
+
+    <select id="selectTProjectCirculationList" parameterType="TProjectCirculation" resultMap="TProjectCirculationResult">
+        <include refid="selectTProjectCirculationVo"/>
+        <where>  
+            <if test="stageName != null  and stageName != ''"> and stage_name like concat('%', #{stageName}, '%')</if>
+            <if test="projectPoolId != null  and projectPoolId != ''"> and project_pool_id = #{projectPoolId}</if>
+        </where>
+    </select>
+    
+    <select id="selectTProjectCirculationById" parameterType="String" resultMap="TProjectCirculationResult">
+        <include refid="selectTProjectCirculationVo"/>
+        where id = #{id}
+    </select>
+        
+    <insert id="insertTProjectCirculation" parameterType="TProjectCirculation">
+        insert into t_project_circulation
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="id != null">id,</if>
+            <if test="stageName != null">stage_name,</if>
+            <if test="projectPoolId != null">project_pool_id,</if>
+            <if test="createBy != null">create_by,</if>
+            <if test="createTime != null">create_time,</if>
+         </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="id != null">#{id},</if>
+            <if test="stageName != null">#{stageName},</if>
+            <if test="projectPoolId != null">#{projectPoolId},</if>
+            <if test="createBy != null">#{createBy},</if>
+            <if test="createTime != null">#{createTime},</if>
+         </trim>
+    </insert>
+
+    <update id="updateTProjectCirculation" parameterType="TProjectCirculation">
+        update t_project_circulation
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="stageName != null">stage_name = #{stageName},</if>
+            <if test="projectPoolId != null">project_pool_id = #{projectPoolId},</if>
+            <if test="createBy != null">create_by = #{createBy},</if>
+            <if test="createTime != null">create_time = #{createTime},</if>
+        </trim>
+        where id = #{id}
+    </update>
+
+    <delete id="deleteTProjectCirculationById" parameterType="String">
+        delete from t_project_circulation where id = #{id}
+    </delete>
+
+    <delete id="deleteTProjectCirculationByIds" parameterType="String">
+        delete from t_project_circulation where id in 
+        <foreach item="id" collection="array" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </delete>
+</mapper>