Bläddra i källkod

项目模块修改

anderx 2 år sedan
förälder
incheckning
902121806f

+ 33 - 0
ruoyi-system/src/main/java/com/ruoyi/project/bo/ProjectListInput.java

@@ -8,7 +8,40 @@ public class ProjectListInput {
     private Long rolesId;
     private Long headId;
     private Long staffId;
+    private String projectNumber,projectYear;
+    private Integer crossYear,projectStatus;
 
+    public String getProjectNumber() {
+        return projectNumber;
+    }
+
+    public void setProjectNumber(String projectNumber) {
+        this.projectNumber = projectNumber;
+    }
+
+    public String getProjectYear() {
+        return projectYear;
+    }
+
+    public void setProjectYear(String projectYear) {
+        this.projectYear = projectYear;
+    }
+
+    public Integer getCrossYear() {
+        return crossYear;
+    }
+
+    public void setCrossYear(Integer crossYear) {
+        this.crossYear = crossYear;
+    }
+
+    public Integer getProjectStatus() {
+        return projectStatus;
+    }
+
+    public void setProjectStatus(Integer projectStatus) {
+        this.projectStatus = projectStatus;
+    }
 
     public Long getHeadId() {
         return headId;

+ 24 - 25
ruoyi-system/src/main/java/com/ruoyi/project/bo/ProjectTaskListOut.java

@@ -1,47 +1,46 @@
 package com.ruoyi.project.bo;
 
-public class ProjectTaskListOut {
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.ruoyi.project.domain.ProjectTask;
 
-    private Long id;
-    private String name,adminName,staffName,createTime;
+import java.util.Date;
 
-    public Long getId() {
-        return id;
-    }
+public class ProjectTaskListOut extends ProjectTask {
 
-    public void setId(Long id) {
-        this.id = id;
-    }
 
-    public String getName() {
-        return name;
-    }
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date createTime;
 
-    public void setName(String name) {
-        this.name = name;
-    }
+    @JsonFormat(pattern = "yyyy")
+    private Date projectYear;
+
+    @JsonFormat(pattern = "yyyy")
+    private Date createYear;
 
-    public String getAdminName() {
-        return adminName;
+    @Override
+    public Date getProjectYear() {
+        return projectYear;
     }
 
-    public void setAdminName(String adminName) {
-        this.adminName = adminName;
+    public void setProjectYear(Date projectYear) {
+        this.projectYear = projectYear;
     }
 
-    public String getStaffName() {
-        return staffName;
+    @Override
+    public Date getCreateYear() {
+        return createYear;
     }
 
-    public void setStaffName(String staffName) {
-        this.staffName = staffName;
+    @Override
+    public void setCreateYear(Date createYear) {
+        this.createYear = createYear;
     }
 
-    public String getCreateTime() {
+    public Date getCreateTime() {
         return createTime;
     }
 
-    public void setCreateTime(String createTime) {
+    public void setCreateTime(Date createTime) {
         this.createTime = createTime;
     }
 }

+ 54 - 2
ruoyi-system/src/main/java/com/ruoyi/project/domain/ProjectTask.java

@@ -5,7 +5,7 @@ import java.util.Date;
 
 /**
  * project_task
- * @author 
+ * @author
  */
 public class ProjectTask implements Serializable {
     /**
@@ -48,6 +48,26 @@ public class ProjectTask implements Serializable {
      */
     private String staffName;
 
+    /**
+     * 项目编号
+     */
+    private String projectNumber;
+
+    /**
+     * 项目年份
+     */
+    private Date projectYear;
+
+    /**
+     * 创建年份
+     */
+    private Date createYear;
+
+    /**
+     * 0=非跨年,1=跨年
+     */
+    private Integer crossYear;
+
     private static final long serialVersionUID = 1L;
 
     public Long getId() {
@@ -113,4 +133,36 @@ public class ProjectTask implements Serializable {
     public void setStaffName(String staffName) {
         this.staffName = staffName;
     }
-}
+
+    public String getProjectNumber() {
+        return projectNumber;
+    }
+
+    public void setProjectNumber(String projectNumber) {
+        this.projectNumber = projectNumber;
+    }
+
+    public Date getProjectYear() {
+        return projectYear;
+    }
+
+    public void setProjectYear(Date projectYear) {
+        this.projectYear = projectYear;
+    }
+
+    public Date getCreateYear() {
+        return createYear;
+    }
+
+    public void setCreateYear(Date createYear) {
+        this.createYear = createYear;
+    }
+
+    public Integer getCrossYear() {
+        return crossYear;
+    }
+
+    public void setCrossYear(Integer crossYear) {
+        this.crossYear = crossYear;
+    }
+}

+ 89 - 14
ruoyi-system/src/main/resources/mapper/project/ProjectTaskMapper.xml

@@ -10,9 +10,14 @@
     <result column="remark" jdbcType="VARCHAR" property="remark" />
     <result column="admin_name" jdbcType="VARCHAR" property="adminName" />
     <result column="staff_name" jdbcType="VARCHAR" property="staffName" />
+    <result column="project_number" jdbcType="VARCHAR" property="projectNumber" />
+    <result column="project_year" jdbcType="OTHER" property="projectYear" />
+    <result column="create_year" jdbcType="OTHER" property="createYear" />
+    <result column="cross_year" jdbcType="INTEGER" property="crossYear" />
   </resultMap>
   <sql id="Base_Column_List">
-    id, aid, `name`, project_status, create_time, remark, admin_name, staff_name
+    id, aid, `name`, project_status, create_time, remark, admin_name, staff_name, project_number,
+    project_year, create_year, cross_year
   </sql>
   <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
     select
@@ -20,7 +25,6 @@
     from project_task
     where id = #{id,jdbcType=BIGINT}
   </select>
-
   <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
     delete from project_task
     where id = #{id,jdbcType=BIGINT}
@@ -28,10 +32,12 @@
   <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.ruoyi.project.domain.ProjectTask" useGeneratedKeys="true">
     insert into project_task (aid, `name`, project_status,
       create_time, remark, admin_name,
-      staff_name)
+      staff_name, project_number, project_year,
+      create_year, cross_year)
     values (#{aid,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR}, #{projectStatus,jdbcType=INTEGER},
       #{createTime,jdbcType=TIMESTAMP}, #{remark,jdbcType=VARCHAR}, #{adminName,jdbcType=VARCHAR},
-      #{staffName,jdbcType=VARCHAR})
+      #{staffName,jdbcType=VARCHAR}, #{projectNumber,jdbcType=VARCHAR}, #{projectYear,jdbcType=OTHER},
+      #{createYear,jdbcType=OTHER}, #{crossYear,jdbcType=INTEGER})
   </insert>
   <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.ruoyi.project.domain.ProjectTask" useGeneratedKeys="true">
     insert into project_task
@@ -57,6 +63,18 @@
       <if test="staffName != null">
         staff_name,
       </if>
+      <if test="projectNumber != null">
+        project_number,
+      </if>
+      <if test="projectYear != null">
+        project_year,
+      </if>
+      <if test="createYear != null">
+        create_year,
+      </if>
+      <if test="crossYear != null">
+        cross_year,
+      </if>
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides=",">
       <if test="aid != null">
@@ -80,6 +98,18 @@
       <if test="staffName != null">
         #{staffName,jdbcType=VARCHAR},
       </if>
+      <if test="projectNumber != null">
+        #{projectNumber,jdbcType=VARCHAR},
+      </if>
+      <if test="projectYear != null">
+        #{projectYear,jdbcType=OTHER},
+      </if>
+      <if test="createYear != null">
+        #{createYear,jdbcType=OTHER},
+      </if>
+      <if test="crossYear != null">
+        #{crossYear,jdbcType=INTEGER},
+      </if>
     </trim>
   </insert>
   <update id="updateByPrimaryKeySelective" parameterType="com.ruoyi.project.domain.ProjectTask">
@@ -106,6 +136,18 @@
       <if test="staffName != null">
         staff_name = #{staffName,jdbcType=VARCHAR},
       </if>
+      <if test="projectNumber != null">
+        project_number = #{projectNumber,jdbcType=VARCHAR},
+      </if>
+      <if test="projectYear != null">
+        project_year = #{projectYear,jdbcType=OTHER},
+      </if>
+      <if test="createYear != null">
+        create_year = #{createYear,jdbcType=OTHER},
+      </if>
+      <if test="crossYear != null">
+        cross_year = #{crossYear,jdbcType=INTEGER},
+      </if>
     </set>
     where id = #{id,jdbcType=BIGINT}
   </update>
@@ -117,7 +159,11 @@
       create_time = #{createTime,jdbcType=TIMESTAMP},
       remark = #{remark,jdbcType=VARCHAR},
       admin_name = #{adminName,jdbcType=VARCHAR},
-      staff_name = #{staffName,jdbcType=VARCHAR}
+      staff_name = #{staffName,jdbcType=VARCHAR},
+      project_number = #{projectNumber,jdbcType=VARCHAR},
+      project_year = #{projectYear,jdbcType=OTHER},
+      create_year = #{createYear,jdbcType=OTHER},
+      cross_year = #{crossYear,jdbcType=INTEGER}
     where id = #{id,jdbcType=BIGINT}
   </update>
   <update id="updateStaffName">
@@ -126,24 +172,40 @@
     where a.id = #{pid}
   </update>
 
-  <select id="selectList" resultType="com.ruoyi.project.bo.ProjectTaskListOut">
-    select  a.id,a.name ,a.admin_name adminName,a.staff_name staffName ,a.create_time createTime
-    from project_task a left join project_staff b on a.id=b.pid
-    <if test="staffId !=null">
-      left join project_staff c on a.id=c.pid
+
+  <resultMap id="BaseResultOutMap" type="com.ruoyi.project.bo.ProjectTaskListOut">
+    <id column="id" jdbcType="BIGINT" property="id" />
+    <result column="aid" jdbcType="BIGINT" property="aid" />
+    <result column="name" jdbcType="VARCHAR" property="name" />
+    <result column="project_status" jdbcType="INTEGER" property="projectStatus" />
+    <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
+    <result column="remark" jdbcType="VARCHAR" property="remark" />
+    <result column="admin_name" jdbcType="VARCHAR" property="adminName" />
+    <result column="staff_name" jdbcType="VARCHAR" property="staffName" />
+    <result column="project_number" jdbcType="VARCHAR" property="projectNumber" />
+    <result column="project_year" jdbcType="OTHER" property="projectYear" />
+    <result column="create_year" jdbcType="OTHER" property="createYear" />
+    <result column="cross_year" jdbcType="INTEGER" property="crossYear" />
+  </resultMap>
+
+  <select id="selectList" resultMap="BaseResultOutMap">
+    select
+    a.id, a.aid, a.`name`, a.project_status , a.create_time, a.remark, a.admin_name, a.staff_name, a.project_number,
+    a.project_year, a.create_year, a.cross_year
+    from project_task a
+    <if test="rolesId ==2">
+      left join (select pid from project_staff where aid= #{uid}) b on a.id=b.pid
     </if>
     where 1=1
       <if test="rolesId ==3">
         and a.aid = #{uid}
       </if>
-    <if test="rolesId ==2">
-      and b.aid= #{uid}
-    </if>
+
     <if test="headId !=null">
       and a.aid= #{headId}
     </if>
     <if test="staffId !=null">
-      and c.aid= #{staffId}
+      and a.id in (select pid from project_staff where aid= #{staffId})
     </if>
     <if test="name !=null">
       and a.name like concat('%',#{name},'%')
@@ -151,5 +213,18 @@
     <if test="startTime !=null and endTime !=null">
       and a.create_time  between #{startTime} and #{endTime}
     </if>
+    <if test="projectNumber !=null ">
+      and a.project_number like concat('%',#{projectNumber},'%')
+    </if>
+    <if test="projectYear !=null ">
+      and a.project_year =#{projectYear}
+    </if>
+    <if test="crossYear !=null ">
+      and a.cross_year =#{crossYear}
+    </if>
+    <if test="projectStatus !=null ">
+      and a.project_status =#{projectStatus}
+    </if>
+
   </select>
 </mapper>