Browse Source

研发打卡修改

anderx 2 years ago
parent
commit
6695484359

+ 44 - 2
ruoyi-system/src/main/java/com/ruoyi/project/bo/ProjectTaskListOut.java

@@ -50,6 +50,9 @@ public class ProjectTaskListOut extends ProjectTask {
      */
     @Excel(name = "项目状态",readConverterExp = "0=未启动,1=进行中")
     private Integer projectStatus;
+
+    @Excel(name = "累计工时")
+    private Double duration;
     /**
      * 创建年份
      */
@@ -60,10 +63,49 @@ public class ProjectTaskListOut extends ProjectTask {
     /**
      * 创建时间
      */
-    @Excel(name = "创建时间",dateFormat = "yyyy-MM-dd HH:mm:ss")
-    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+
     private Date createTime;
+    @Excel(name = "开始时间",dateFormat = "yyyy-MM-dd")
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    private Date startTime;
+
+    /**
+     * 结束时间
+     */
+    @Excel(name = "结束时间",dateFormat = "yyyy-MM-dd")
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    private Date endTime;
+
+
+    @Override
+    public Double getDuration() {
+        return duration;
+    }
+
+    @Override
+    public void setDuration(Double duration) {
+        this.duration = duration;
+    }
 
+    @Override
+    public Date getStartTime() {
+        return startTime;
+    }
+
+    @Override
+    public void setStartTime(Date startTime) {
+        this.startTime = startTime;
+    }
+
+    @Override
+    public Date getEndTime() {
+        return endTime;
+    }
+
+    @Override
+    public void setEndTime(Date endTime) {
+        this.endTime = endTime;
+    }
 
     @Override
     public Long getId() {

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

@@ -78,6 +78,16 @@ public class ProjectTask implements Serializable {
      */
     private Double duration;
 
+    /**
+     * 开始时间
+     */
+    private Date startTime;
+
+    /**
+     * 结束时间
+     */
+    private Date endTime;
+
     private static final long serialVersionUID = 1L;
 
     public Long getId() {
@@ -183,4 +193,20 @@ public class ProjectTask implements Serializable {
     public void setDuration(Double duration) {
         this.duration = duration;
     }
+
+    public Date getStartTime() {
+        return startTime;
+    }
+
+    public void setStartTime(Date startTime) {
+        this.startTime = startTime;
+    }
+
+    public Date getEndTime() {
+        return endTime;
+    }
+
+    public void setEndTime(Date endTime) {
+        this.endTime = endTime;
+    }
 }

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

@@ -15,10 +15,12 @@
     <result column="create_year" jdbcType="OTHER" property="createYear" />
     <result column="cross_year" jdbcType="INTEGER" property="crossYear" />
     <result column="duration" jdbcType="DOUBLE" property="duration" />
+    <result column="start_time" jdbcType="TIMESTAMP" property="startTime" />
+    <result column="end_time" jdbcType="TIMESTAMP" property="endTime" />
   </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
+    project_year, create_year, cross_year, duration, start_time, end_time
   </sql>
   <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
     select
@@ -34,13 +36,13 @@
     insert into project_task (aid, `name`, project_status,
       create_time, remark, admin_name,
       staff_name, project_number, project_year,
-      create_year, cross_year, duration
-      )
+      create_year, cross_year, duration,
+      start_time, end_time)
     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}
-      )
+      #{createYear,jdbcType=OTHER}, #{crossYear,jdbcType=INTEGER}, #{duration,jdbcType=DOUBLE},
+      #{startTime,jdbcType=TIMESTAMP}, #{endTime,jdbcType=TIMESTAMP})
   </insert>
   <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.ruoyi.project.domain.ProjectTask" useGeneratedKeys="true">
     insert into project_task
@@ -81,6 +83,12 @@
       <if test="duration != null">
         duration,
       </if>
+      <if test="startTime != null">
+        start_time,
+      </if>
+      <if test="endTime != null">
+        end_time,
+      </if>
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides=",">
       <if test="aid != null">
@@ -119,6 +127,12 @@
       <if test="duration != null">
         #{duration,jdbcType=DOUBLE},
       </if>
+      <if test="startTime != null">
+        #{startTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="endTime != null">
+        #{endTime,jdbcType=TIMESTAMP},
+      </if>
     </trim>
   </insert>
   <update id="updateByPrimaryKeySelective" parameterType="com.ruoyi.project.domain.ProjectTask">
@@ -160,6 +174,12 @@
       <if test="duration != null">
         duration = #{duration,jdbcType=DOUBLE},
       </if>
+      <if test="startTime != null">
+        start_time = #{startTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="endTime != null">
+        end_time = #{endTime,jdbcType=TIMESTAMP},
+      </if>
     </set>
     where id = #{id,jdbcType=BIGINT}
   </update>
@@ -176,7 +196,9 @@
       project_year = #{projectYear,jdbcType=OTHER},
       create_year = #{createYear,jdbcType=OTHER},
       cross_year = #{crossYear,jdbcType=INTEGER},
-      duration = #{duration,jdbcType=DOUBLE}
+      duration = #{duration,jdbcType=DOUBLE},
+      start_time = #{startTime,jdbcType=TIMESTAMP},
+      end_time = #{endTime,jdbcType=TIMESTAMP}
     where id = #{id,jdbcType=BIGINT}
   </update>
   <update id="updateStaffName">
@@ -199,12 +221,15 @@
     <result column="project_year" jdbcType="OTHER" property="projectYear" />
     <result column="create_year" jdbcType="OTHER" property="createYear" />
     <result column="cross_year" jdbcType="INTEGER" property="crossYear" />
+    <result column="cross_year" jdbcType="INTEGER" property="crossYear" />
+    <result column="start_time" jdbcType="TIMESTAMP" property="startTime" />
+    <result column="end_time" jdbcType="TIMESTAMP" property="endTime" />
   </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,a.duration
+    a.project_year, a.create_year, a.cross_year,a.duration,a.start_time,a.end_time
     from project_task a
     <if test="companyId !=null">
       left join sys_user c on a.aid=c.user_id

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

@@ -304,6 +304,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 		<if test="type==1">
 			project_quantity = project_quantity-1
 		</if>
-		where user_id = #{userId}
+		where user_id = #{aid}
 	</update>
 </mapper>