Преглед изворни кода

修改项目表新增字段,项目新增与列表修改

anderx пре 2 година
родитељ
комит
fcc465d062

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

@@ -14,12 +14,33 @@ public class ProjectListInput extends BaseEntity {
     private String projectYear;
     private Integer crossYear;
     private Integer projectStatus;
+    /**
+     *  0=否,1=是
+     */
+    private Integer myCreate;
+    private Long createAid;
 
     /**
      * 0=我的项目 1=项目负责人审核 2=技术总监审核 3=公司管理,4=总管理
      */
     private Integer roleType;
 
+    public Long getCreateAid() {
+        return createAid;
+    }
+
+    public void setCreateAid(Long createAid) {
+        this.createAid = createAid;
+    }
+
+    public Integer getMyCreate() {
+        return myCreate;
+    }
+
+    public void setMyCreate(Integer myCreate) {
+        this.myCreate = myCreate;
+    }
+
     public Integer getRoleType() {
         return roleType;
     }

+ 13 - 0
ruoyi-system/src/main/java/com/ruoyi/project/domain/ProjectTask.java

@@ -91,6 +91,11 @@ public class ProjectTask implements Serializable {
     @JsonFormat(pattern = "yyyy-MM-dd")
     private Date endTime;
 
+    /**
+     * 项目创建人
+     */
+    private Long createAid;
+
     private String staffObject;
 
     public String getStaffObject() {
@@ -223,4 +228,12 @@ public class ProjectTask implements Serializable {
     public void setEndTime(Date endTime) {
         this.endTime = endTime;
     }
+
+    public Long getCreateAid() {
+        return createAid;
+    }
+
+    public void setCreateAid(Long createAid) {
+        this.createAid = createAid;
+    }
 }

+ 4 - 0
ruoyi-system/src/main/java/com/ruoyi/project/service/impl/ProjectTaskServiceImpl.java

@@ -53,6 +53,7 @@ public class ProjectTaskServiceImpl   implements ProjectTaskService {
     @Override
     public AjaxResult addProjectTask(ProjectTask projectTask) {
         userMapper.updateUserProjectSum(projectTask.getAid(),0);
+        projectTask.setCreateAid(SecurityUtils.getUserId());
         int i = projectTaskMapper.insertSelective(projectTask);
         if (StringUtils.isNotBlank(projectTask.getStaffObject())){
             String[] split = projectTask.getStaffObject().split(",");
@@ -95,6 +96,9 @@ public class ProjectTaskServiceImpl   implements ProjectTaskService {
             Long companyId = deptService.selectCompanyByDeptId();
             if (companyId!=null)in.setCompanyId(companyId);
         }
+        if (in.getMyCreate()!=null&&in.getMyCreate()==1){
+            in.setCreateAid(SecurityUtils.getUserId());
+        }
         if (in.getEndTime()!=null)in.setEndTime(in.getEndTime()+" 23:59:59");
         PageUtils.startPage();
         return projectTaskMapper.selectList(in);

+ 24 - 7
ruoyi-system/src/main/resources/mapper/project/ProjectTaskMapper.xml

@@ -17,10 +17,11 @@
     <result column="duration" jdbcType="DOUBLE" property="duration" />
     <result column="start_time" jdbcType="TIMESTAMP" property="startTime" />
     <result column="end_time" jdbcType="TIMESTAMP" property="endTime" />
+    <result column="create_aid" jdbcType="BIGINT" property="createAid" />
   </resultMap>
   <sql id="Base_Column_List">
     id, aid, `name`, project_status, create_time, remark, admin_name, staff_name, project_number,
-    project_year, create_year, cross_year, duration, start_time, end_time
+    project_year, create_year, cross_year, duration, start_time, end_time, create_aid
   </sql>
   <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
     select
@@ -37,12 +38,14 @@
       create_time, remark, admin_name,
       staff_name, project_number, project_year,
       create_year, cross_year, duration,
-      start_time, end_time)
+      start_time, end_time, create_aid
+      )
     values (#{aid,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR}, #{projectStatus,jdbcType=INTEGER},
       #{createTime,jdbcType=TIMESTAMP}, #{remark,jdbcType=VARCHAR}, #{adminName,jdbcType=VARCHAR},
       #{staffName,jdbcType=VARCHAR}, #{projectNumber,jdbcType=VARCHAR}, #{projectYear,jdbcType=OTHER},
       #{createYear,jdbcType=OTHER}, #{crossYear,jdbcType=INTEGER}, #{duration,jdbcType=DOUBLE},
-      #{startTime,jdbcType=TIMESTAMP}, #{endTime,jdbcType=TIMESTAMP})
+      #{startTime,jdbcType=TIMESTAMP}, #{endTime,jdbcType=TIMESTAMP}, #{createAid,jdbcType=BIGINT}
+      )
   </insert>
   <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.ruoyi.project.domain.ProjectTask" useGeneratedKeys="true">
     insert into project_task
@@ -89,6 +92,9 @@
       <if test="endTime != null">
         end_time,
       </if>
+      <if test="createAid != null">
+        create_aid,
+      </if>
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides=",">
       <if test="aid != null">
@@ -133,6 +139,9 @@
       <if test="endTime != null">
         #{endTime,jdbcType=TIMESTAMP},
       </if>
+      <if test="createAid != null">
+        #{createAid,jdbcType=BIGINT},
+      </if>
     </trim>
   </insert>
   <update id="updateByPrimaryKeySelective" parameterType="com.ruoyi.project.domain.ProjectTask">
@@ -180,6 +189,9 @@
       <if test="endTime != null">
         end_time = #{endTime,jdbcType=TIMESTAMP},
       </if>
+      <if test="createAid != null">
+        create_aid = #{createAid,jdbcType=BIGINT},
+      </if>
     </set>
     where id = #{id,jdbcType=BIGINT}
   </update>
@@ -198,12 +210,14 @@
       cross_year = #{crossYear,jdbcType=INTEGER},
       duration = #{duration,jdbcType=DOUBLE},
       start_time = #{startTime,jdbcType=TIMESTAMP},
-      end_time = #{endTime,jdbcType=TIMESTAMP}
+      end_time = #{endTime,jdbcType=TIMESTAMP},
+      create_aid = #{createAid,jdbcType=BIGINT}
     where id = #{id,jdbcType=BIGINT}
   </update>
+
   <update id="updateStaffName">
     update project_task a left join (select pid ,group_concat(name)name from project_staff
-        where pid = #{pid} group by  pid) b on a.id=b.pid set a.staff_name =b.name
+      where pid = #{pid} group by  pid) b on a.id=b.pid set a.staff_name =b.name
     where a.id = #{pid}
   </update>
   <update id="updateDuration">
@@ -265,6 +279,9 @@
     <if test="staffId !=null">
       and a.id in (select pid from project_staff where aid= #{staffId})
     </if>
+      <if test="createAid !=null">
+        and a.create_aid= #{createAid}
+      </if>
     <if test="name !=null">
       and a.name like concat('%',#{name},'%')
     </if>
@@ -284,7 +301,7 @@
       and a.project_status =#{projectStatus}
     </if>
     <if test="companyId !=null">
-     and (d.dept_id= #{companyId} or find_in_set(#{companyId},d.ancestors))
+      and (d.dept_id= #{companyId} or find_in_set(#{companyId},d.ancestors))
     </if>
   </select>
   <select id="projectAddDuration">
@@ -307,7 +324,7 @@
     <if test="companyId !=null">
       and (d.dept_id= #{companyId} or find_in_set(#{companyId},d.ancestors))
     </if>
-    </select>
+  </select>
   <select id="selectAll" resultMap="BaseResultMap">
     select
     <include refid="Base_Column_List" />