Browse Source

新增评估考察记录代码

zjc 1 year ago
parent
commit
6a6df2c2f6

+ 117 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/invest/TProjectReviewController.java

@@ -0,0 +1,117 @@
+package com.ruoyi.web.controller.invest;
+
+import java.util.List;
+import javax.servlet.http.HttpServletResponse;
+
+import io.swagger.annotations.Api;
+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.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.invest.domain.TProjectReview;
+import com.ruoyi.invest.service.ITProjectReviewService;
+import com.ruoyi.common.utils.poi.ExcelUtil;
+import com.ruoyi.common.core.page.TableDataInfo;
+
+/**
+ * 评审记录Controller
+ * 
+ * @author zjc
+ * @date 2024-04-02
+ */
+@Api(tags = "评审记录")
+@RestController
+@RequestMapping("/invest/review")
+public class TProjectReviewController extends BaseController
+{
+    @Autowired
+    private ITProjectReviewService tProjectReviewService;
+
+    /**
+     * 查询评审记录列表
+     */
+    @ApiOperation("查询评审记录列表")
+    @PreAuthorize("@ss.hasPermi('invest:review:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(TProjectReview tProjectReview)
+    {
+        startPage();
+        List<TProjectReview> list = tProjectReviewService.selectTProjectReviewList(tProjectReview);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出评审记录列表
+     */
+    @ApiOperation("导出评审记录列表")
+    @PreAuthorize("@ss.hasPermi('invest:review:export')")
+    @Log(title = "评审记录", businessType = BusinessType.EXPORT)
+    @PostMapping("/export")
+    public void export(HttpServletResponse response, TProjectReview tProjectReview)
+    {
+        List<TProjectReview> list = tProjectReviewService.selectTProjectReviewList(tProjectReview);
+        ExcelUtil<TProjectReview> util = new ExcelUtil<TProjectReview>(TProjectReview.class);
+        util.exportExcel(response, list, "评审记录数据");
+    }
+
+    /**
+     * 获取评审记录详细信息
+     */
+    @ApiOperation("获取评审记录详细信息")
+    @PreAuthorize("@ss.hasPermi('invest:review:query')")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") String id)
+    {
+        return success(tProjectReviewService.selectTProjectReviewById(id));
+    }
+
+    /**
+     * 新增评审记录
+     */
+    @ApiOperation("新增评审记录")
+    @PreAuthorize("@ss.hasPermi('invest:review:add')")
+    @Log(title = "评审记录", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody TProjectReview tProjectReview)
+    {
+        tProjectReview.setCreateBy(getNickName());
+        tProjectReview.setReviewPerson(getNickName());
+        tProjectReview.setReviewPersonId(getUserId().toString());
+        return toAjax(tProjectReviewService.insertTProjectReview(tProjectReview));
+    }
+
+    /**
+     * 修改评审记录
+     */
+    @ApiOperation("修改评审记录")
+    @PreAuthorize("@ss.hasPermi('invest:review:edit')")
+    @Log(title = "评审记录", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody TProjectReview tProjectReview)
+    {
+        return toAjax(tProjectReviewService.updateTProjectReview(tProjectReview));
+    }
+
+    /**
+     * 删除评审记录
+     */
+    @ApiOperation("删除评审记录")
+    @PreAuthorize("@ss.hasPermi('invest:review:remove')")
+    @Log(title = "评审记录", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable String[] ids)
+    {
+        return toAjax(tProjectReviewService.deleteTProjectReviewByIds(ids));
+    }
+}

+ 97 - 0
ruoyi-system/src/main/java/com/ruoyi/invest/domain/TProjectReview.java

@@ -0,0 +1,97 @@
+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_review
+ * 
+ * @author zjc
+ * @date 2024-04-02
+ */
+public class TProjectReview extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** ID */
+    private String id;
+
+    /** 项目ID */
+    @Excel(name = "项目ID")
+    private String projectPoolId;
+
+    /** 内容 */
+    @Excel(name = "内容")
+    private String context;
+
+    /** 评审人 */
+    @Excel(name = "评审人")
+    private String reviewPerson;
+
+    /** 评审人ID */
+    @Excel(name = "评审人ID")
+    private String reviewPersonId;
+
+    public void setId(String id) 
+    {
+        this.id = id;
+    }
+
+    public String getId() 
+    {
+        return id;
+    }
+    public void setProjectPoolId(String projectPoolId) 
+    {
+        this.projectPoolId = projectPoolId;
+    }
+
+    public String getProjectPoolId() 
+    {
+        return projectPoolId;
+    }
+    public void setContext(String context) 
+    {
+        this.context = context;
+    }
+
+    public String getContext() 
+    {
+        return context;
+    }
+    public void setReviewPerson(String reviewPerson) 
+    {
+        this.reviewPerson = reviewPerson;
+    }
+
+    public String getReviewPerson() 
+    {
+        return reviewPerson;
+    }
+    public void setReviewPersonId(String reviewPersonId) 
+    {
+        this.reviewPersonId = reviewPersonId;
+    }
+
+    public String getReviewPersonId() 
+    {
+        return reviewPersonId;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+            .append("id", getId())
+            .append("projectPoolId", getProjectPoolId())
+            .append("context", getContext())
+            .append("reviewPerson", getReviewPerson())
+            .append("reviewPersonId", getReviewPersonId())
+            .append("createBy", getCreateBy())
+            .append("createTime", getCreateTime())
+            .append("updateBy", getUpdateBy())
+            .append("updateTime", getUpdateTime())
+            .toString();
+    }
+}

+ 61 - 0
ruoyi-system/src/main/java/com/ruoyi/invest/mapper/TProjectReviewMapper.java

@@ -0,0 +1,61 @@
+package com.ruoyi.invest.mapper;
+
+import java.util.List;
+import com.ruoyi.invest.domain.TProjectReview;
+
+/**
+ * 评审记录Mapper接口
+ * 
+ * @author zjc
+ * @date 2024-04-02
+ */
+public interface TProjectReviewMapper 
+{
+    /**
+     * 查询评审记录
+     * 
+     * @param id 评审记录主键
+     * @return 评审记录
+     */
+    public TProjectReview selectTProjectReviewById(String id);
+
+    /**
+     * 查询评审记录列表
+     * 
+     * @param tProjectReview 评审记录
+     * @return 评审记录集合
+     */
+    public List<TProjectReview> selectTProjectReviewList(TProjectReview tProjectReview);
+
+    /**
+     * 新增评审记录
+     * 
+     * @param tProjectReview 评审记录
+     * @return 结果
+     */
+    public int insertTProjectReview(TProjectReview tProjectReview);
+
+    /**
+     * 修改评审记录
+     * 
+     * @param tProjectReview 评审记录
+     * @return 结果
+     */
+    public int updateTProjectReview(TProjectReview tProjectReview);
+
+    /**
+     * 删除评审记录
+     * 
+     * @param id 评审记录主键
+     * @return 结果
+     */
+    public int deleteTProjectReviewById(String id);
+
+    /**
+     * 批量删除评审记录
+     * 
+     * @param ids 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deleteTProjectReviewByIds(String[] ids);
+}

+ 61 - 0
ruoyi-system/src/main/java/com/ruoyi/invest/service/ITProjectReviewService.java

@@ -0,0 +1,61 @@
+package com.ruoyi.invest.service;
+
+import java.util.List;
+import com.ruoyi.invest.domain.TProjectReview;
+
+/**
+ * 评审记录Service接口
+ * 
+ * @author zjc
+ * @date 2024-04-02
+ */
+public interface ITProjectReviewService 
+{
+    /**
+     * 查询评审记录
+     * 
+     * @param id 评审记录主键
+     * @return 评审记录
+     */
+    public TProjectReview selectTProjectReviewById(String id);
+
+    /**
+     * 查询评审记录列表
+     * 
+     * @param tProjectReview 评审记录
+     * @return 评审记录集合
+     */
+    public List<TProjectReview> selectTProjectReviewList(TProjectReview tProjectReview);
+
+    /**
+     * 新增评审记录
+     * 
+     * @param tProjectReview 评审记录
+     * @return 结果
+     */
+    public int insertTProjectReview(TProjectReview tProjectReview);
+
+    /**
+     * 修改评审记录
+     * 
+     * @param tProjectReview 评审记录
+     * @return 结果
+     */
+    public int updateTProjectReview(TProjectReview tProjectReview);
+
+    /**
+     * 批量删除评审记录
+     * 
+     * @param ids 需要删除的评审记录主键集合
+     * @return 结果
+     */
+    public int deleteTProjectReviewByIds(String[] ids);
+
+    /**
+     * 删除评审记录信息
+     * 
+     * @param id 评审记录主键
+     * @return 结果
+     */
+    public int deleteTProjectReviewById(String id);
+}

+ 98 - 0
ruoyi-system/src/main/java/com/ruoyi/invest/service/impl/TProjectReviewServiceImpl.java

@@ -0,0 +1,98 @@
+package com.ruoyi.invest.service.impl;
+
+import java.util.List;
+import com.ruoyi.common.utils.DateUtils;
+import com.ruoyi.common.utils.uuid.IdUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.ruoyi.invest.mapper.TProjectReviewMapper;
+import com.ruoyi.invest.domain.TProjectReview;
+import com.ruoyi.invest.service.ITProjectReviewService;
+
+/**
+ * 评审记录Service业务层处理
+ * 
+ * @author zjc
+ * @date 2024-04-02
+ */
+@Service
+public class TProjectReviewServiceImpl implements ITProjectReviewService 
+{
+    @Autowired
+    private TProjectReviewMapper tProjectReviewMapper;
+
+    /**
+     * 查询评审记录
+     * 
+     * @param id 评审记录主键
+     * @return 评审记录
+     */
+    @Override
+    public TProjectReview selectTProjectReviewById(String id)
+    {
+        return tProjectReviewMapper.selectTProjectReviewById(id);
+    }
+
+    /**
+     * 查询评审记录列表
+     * 
+     * @param tProjectReview 评审记录
+     * @return 评审记录
+     */
+    @Override
+    public List<TProjectReview> selectTProjectReviewList(TProjectReview tProjectReview)
+    {
+        return tProjectReviewMapper.selectTProjectReviewList(tProjectReview);
+    }
+
+    /**
+     * 新增评审记录
+     * 
+     * @param tProjectReview 评审记录
+     * @return 结果
+     */
+    @Override
+    public int insertTProjectReview(TProjectReview tProjectReview)
+    {
+        tProjectReview.setCreateTime(DateUtils.getNowDate());
+        tProjectReview.setId(IdUtils.fastSimpleUUID());
+        return tProjectReviewMapper.insertTProjectReview(tProjectReview);
+    }
+
+    /**
+     * 修改评审记录
+     * 
+     * @param tProjectReview 评审记录
+     * @return 结果
+     */
+    @Override
+    public int updateTProjectReview(TProjectReview tProjectReview)
+    {
+        tProjectReview.setUpdateTime(DateUtils.getNowDate());
+        return tProjectReviewMapper.updateTProjectReview(tProjectReview);
+    }
+
+    /**
+     * 批量删除评审记录
+     * 
+     * @param ids 需要删除的评审记录主键
+     * @return 结果
+     */
+    @Override
+    public int deleteTProjectReviewByIds(String[] ids)
+    {
+        return tProjectReviewMapper.deleteTProjectReviewByIds(ids);
+    }
+
+    /**
+     * 删除评审记录信息
+     * 
+     * @param id 评审记录主键
+     * @return 结果
+     */
+    @Override
+    public int deleteTProjectReviewById(String id)
+    {
+        return tProjectReviewMapper.deleteTProjectReviewById(id);
+    }
+}

+ 89 - 0
ruoyi-system/src/main/resources/mapper/invest/TProjectReviewMapper.xml

@@ -0,0 +1,89 @@
+<?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.invest.mapper.TProjectReviewMapper">
+    
+    <resultMap type="TProjectReview" id="TProjectReviewResult">
+        <result property="id"    column="id"    />
+        <result property="projectPoolId"    column="project_pool_id"    />
+        <result property="context"    column="context"    />
+        <result property="reviewPerson"    column="review_person"    />
+        <result property="reviewPersonId"    column="review_person_id"    />
+        <result property="createBy"    column="create_by"    />
+        <result property="createTime"    column="create_time"    />
+        <result property="updateBy"    column="update_by"    />
+        <result property="updateTime"    column="update_time"    />
+    </resultMap>
+
+    <sql id="selectTProjectReviewVo">
+        select id, project_pool_id, context, review_person, review_person_id, create_by, create_time, update_by, update_time from t_project_review
+    </sql>
+
+    <select id="selectTProjectReviewList" parameterType="TProjectReview" resultMap="TProjectReviewResult">
+        <include refid="selectTProjectReviewVo"/>
+        <where>  
+            <if test="projectPoolId != null  and projectPoolId != ''"> and project_pool_id = #{projectPoolId}</if>
+            <if test="context != null  and context != ''"> and context = #{context}</if>
+            <if test="reviewPerson != null  and reviewPerson != ''"> and review_person = #{reviewPerson}</if>
+            <if test="reviewPersonId != null  and reviewPersonId != ''"> and review_person_id = #{reviewPersonId}</if>
+        </where>
+    </select>
+    
+    <select id="selectTProjectReviewById" parameterType="String" resultMap="TProjectReviewResult">
+        <include refid="selectTProjectReviewVo"/>
+        where id = #{id}
+    </select>
+        
+    <insert id="insertTProjectReview" parameterType="TProjectReview">
+        insert into t_project_review
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="id != null">id,</if>
+            <if test="projectPoolId != null">project_pool_id,</if>
+            <if test="context != null">context,</if>
+            <if test="reviewPerson != null">review_person,</if>
+            <if test="reviewPersonId != null">review_person_id,</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>
+         </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="id != null">#{id},</if>
+            <if test="projectPoolId != null">#{projectPoolId},</if>
+            <if test="context != null">#{context},</if>
+            <if test="reviewPerson != null">#{reviewPerson},</if>
+            <if test="reviewPersonId != null">#{reviewPersonId},</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>
+         </trim>
+    </insert>
+
+    <update id="updateTProjectReview" parameterType="TProjectReview">
+        update t_project_review
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="projectPoolId != null">project_pool_id = #{projectPoolId},</if>
+            <if test="context != null">context = #{context},</if>
+            <if test="reviewPerson != null">review_person = #{reviewPerson},</if>
+            <if test="reviewPersonId != null">review_person_id = #{reviewPersonId},</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>
+        </trim>
+        where id = #{id}
+    </update>
+
+    <delete id="deleteTProjectReviewById" parameterType="String">
+        delete from t_project_review where id = #{id}
+    </delete>
+
+    <delete id="deleteTProjectReviewByIds" parameterType="String">
+        delete from t_project_review where id in 
+        <foreach item="id" collection="array" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </delete>
+</mapper>