Sfoglia il codice sorgente

导入用户打卡数据开发第二版,导入数据库再做处理

anderx 1 anno fa
parent
commit
4c37e92f33

+ 2 - 3
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysUserController.java

@@ -302,13 +302,12 @@ public class SysUserController extends BaseController
      * 考勤与打卡核对表
      */
     @GetMapping("/selectUserClock")
-    public AjaxResult selectUserClock(Integer status) {
-
+    public AjaxResult selectUserClock(@RequestParam(name = "status", required = false)Integer status) {
         return AjaxResult.success(userService.selectUserClock(status));
     }
 
     /**
-     * 考勤打卡核对表
+     * 考勤对应多打卡核对表
      */
     @GetMapping("/UserClockDetails")
     public AjaxResult UserClockDetails(@RequestParam("id") Long id) {

+ 25 - 3
ruoyi-system/src/main/java/com/ruoyi/system/domain/UserRecord.java

@@ -29,11 +29,16 @@ public class UserRecord implements Serializable {
     private String name;
 
     /**
-     * 状态 0正常 1缺卡 2多打卡  3缺卡+多打卡
+     * 状态 0正常 1缺卡 
      */
     private Integer status;
 
     /**
+     * 打卡状态 0无匹配 1多打卡  2打卡不存在
+     */
+    private Integer clockStatus;
+
+    /**
      * 内容
      */
     private String content;
@@ -127,20 +132,34 @@ public class UserRecord implements Serializable {
     }
 
     /**
-     * 状态 0正常 1缺卡 2多打卡  3缺卡+多打卡
+     * 状态 0正常 1缺卡 
      */
     public Integer getStatus() {
         return status;
     }
 
     /**
-     * 状态 0正常 1缺卡 2多打卡  3缺卡+多打卡
+     * 状态 0正常 1缺卡 
      */
     public void setStatus(Integer status) {
         this.status = status;
     }
 
     /**
+     * 打卡状态 0无匹配 1多打卡  2打卡不存在
+     */
+    public Integer getClockStatus() {
+        return clockStatus;
+    }
+
+    /**
+     * 打卡状态 0无匹配 1多打卡  2打卡不存在
+     */
+    public void setClockStatus(Integer clockStatus) {
+        this.clockStatus = clockStatus;
+    }
+
+    /**
      * 内容
      */
     public String getContent() {
@@ -255,6 +274,7 @@ public class UserRecord implements Serializable {
             && (this.getPsrId() == null ? other.getPsrId() == null : this.getPsrId().equals(other.getPsrId()))
             && (this.getName() == null ? other.getName() == null : this.getName().equals(other.getName()))
             && (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()))
+            && (this.getClockStatus() == null ? other.getClockStatus() == null : this.getClockStatus().equals(other.getClockStatus()))
             && (this.getContent() == null ? other.getContent() == null : this.getContent().equals(other.getContent()))
             && (this.getRecordTime() == null ? other.getRecordTime() == null : this.getRecordTime().equals(other.getRecordTime()))
             && (this.getStartTime() == null ? other.getStartTime() == null : this.getStartTime().equals(other.getStartTime()))
@@ -273,6 +293,7 @@ public class UserRecord implements Serializable {
         result = prime * result + ((getPsrId() == null) ? 0 : getPsrId().hashCode());
         result = prime * result + ((getName() == null) ? 0 : getName().hashCode());
         result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
+        result = prime * result + ((getClockStatus() == null) ? 0 : getClockStatus().hashCode());
         result = prime * result + ((getContent() == null) ? 0 : getContent().hashCode());
         result = prime * result + ((getRecordTime() == null) ? 0 : getRecordTime().hashCode());
         result = prime * result + ((getStartTime() == null) ? 0 : getStartTime().hashCode());
@@ -294,6 +315,7 @@ public class UserRecord implements Serializable {
         sb.append(", psrId=").append(psrId);
         sb.append(", name=").append(name);
         sb.append(", status=").append(status);
+        sb.append(", clockStatus=").append(clockStatus);
         sb.append(", content=").append(content);
         sb.append(", recordTime=").append(recordTime);
         sb.append(", startTime=").append(startTime);

+ 1 - 1
ruoyi-system/src/main/java/com/ruoyi/system/mapper/UserRecordMapper.java

@@ -9,7 +9,7 @@ import java.util.List;
 /**
 * @author Administrator
 * @description 针对表【user_record(用户考勤记录表)】的数据库操作Mapper
-* @createDate 2024-03-19 09:20:43
+* @createDate 2024-03-19 10:43:12
 * @Entity com.ruoyi.system.domain.UserRecord
 */
 public interface UserRecordMapper {

+ 21 - 12
ruoyi-system/src/main/resources/mapper/UserRecordMapper.xml

@@ -10,6 +10,7 @@
             <result property="psrId" column="psr_id" jdbcType="BIGINT"/>
             <result property="name" column="name" jdbcType="VARCHAR"/>
             <result property="status" column="status" jdbcType="INTEGER"/>
+            <result property="clockStatus" column="clock_status" jdbcType="INTEGER"/>
             <result property="content" column="content" jdbcType="VARCHAR"/>
             <result property="recordTime" column="record_time" jdbcType="TIMESTAMP"/>
             <result property="startTime" column="start_time" jdbcType="TIMESTAMP"/>
@@ -21,9 +22,10 @@
 
     <sql id="Base_Column_List">
         id,dd_user_id,psr_id,
-        name,status,content,
-        record_time,start_time,end_time,
-        sum_duration,check_duration,create_id
+        name,status,clock_status,
+        content,record_time,start_time,
+        end_time,sum_duration,check_duration,
+        create_id
     </sql>
 
     <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
@@ -40,15 +42,15 @@
     <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.ruoyi.system.domain.UserRecord" useGeneratedKeys="true">
         insert into user_record
         ( id,dd_user_id,psr_id
-        ,name,status,content
-        ,record_time,start_time,end_time
-        ,sum_duration,check_duration,create_id
-        )
+        ,name,status,clock_status
+        ,content,record_time,start_time
+        ,end_time,sum_duration,check_duration
+        ,create_id)
         values (#{id,jdbcType=BIGINT},#{ddUserId,jdbcType=BIGINT},#{psrId,jdbcType=BIGINT}
-        ,#{name,jdbcType=VARCHAR},#{status,jdbcType=INTEGER},#{content,jdbcType=VARCHAR}
-        ,#{recordTime,jdbcType=TIMESTAMP},#{startTime,jdbcType=TIMESTAMP},#{endTime,jdbcType=TIMESTAMP}
-        ,#{sumDuration,jdbcType=DOUBLE},#{checkDuration,jdbcType=DOUBLE},#{createId,jdbcType=BIGINT}
-        )
+        ,#{name,jdbcType=VARCHAR},#{status,jdbcType=INTEGER},#{clockStatus,jdbcType=INTEGER}
+        ,#{content,jdbcType=VARCHAR},#{recordTime,jdbcType=TIMESTAMP},#{startTime,jdbcType=TIMESTAMP}
+        ,#{endTime,jdbcType=TIMESTAMP},#{sumDuration,jdbcType=DOUBLE},#{checkDuration,jdbcType=DOUBLE}
+        ,#{createId,jdbcType=BIGINT})
     </insert>
     <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.ruoyi.system.domain.UserRecord" useGeneratedKeys="true">
         insert into user_record
@@ -58,6 +60,7 @@
                 <if test="psrId != null">psr_id,</if>
                 <if test="name != null">name,</if>
                 <if test="status != null">status,</if>
+                <if test="clockStatus != null">clock_status,</if>
                 <if test="content != null">content,</if>
                 <if test="recordTime != null">record_time,</if>
                 <if test="startTime != null">start_time,</if>
@@ -72,6 +75,7 @@
                 <if test="psrId != null">#{psrId,jdbcType=BIGINT},</if>
                 <if test="name != null">#{name,jdbcType=VARCHAR},</if>
                 <if test="status != null">#{status,jdbcType=INTEGER},</if>
+                <if test="clockStatus != null">#{clockStatus,jdbcType=INTEGER},</if>
                 <if test="content != null">#{content,jdbcType=VARCHAR},</if>
                 <if test="recordTime != null">#{recordTime,jdbcType=TIMESTAMP},</if>
                 <if test="startTime != null">#{startTime,jdbcType=TIMESTAMP},</if>
@@ -96,6 +100,9 @@
                 <if test="status != null">
                     status = #{status,jdbcType=INTEGER},
                 </if>
+                <if test="clockStatus != null">
+                    clock_status = #{clockStatus,jdbcType=INTEGER},
+                </if>
                 <if test="content != null">
                     content = #{content,jdbcType=VARCHAR},
                 </if>
@@ -127,6 +134,7 @@
             psr_id =  #{psrId,jdbcType=BIGINT},
             name =  #{name,jdbcType=VARCHAR},
             status =  #{status,jdbcType=INTEGER},
+            clock_status =  #{clockStatus,jdbcType=INTEGER},
             content =  #{content,jdbcType=VARCHAR},
             record_time =  #{recordTime,jdbcType=TIMESTAMP},
             start_time =  #{startTime,jdbcType=TIMESTAMP},
@@ -143,6 +151,7 @@
         <result property="psrId" column="psr_id" jdbcType="BIGINT"/>
         <result property="name" column="name" jdbcType="VARCHAR"/>
         <result property="status" column="status" jdbcType="INTEGER"/>
+        <result property="clockStatus" column="clock_status" jdbcType="INTEGER"/>
         <result property="content" column="content" jdbcType="VARCHAR"/>
         <result property="recordTime" column="record_time" jdbcType="TIMESTAMP"/>
         <result property="startTime" column="start_time" jdbcType="TIMESTAMP"/>
@@ -155,7 +164,7 @@
 
     <select id="selectUserClock" resultMap="OutMap">
         select
-        a.id,a.dd_user_id, a.psr_id, a.name, a.status, a.content, a.record_time, a.start_time, a.end_time,
+        a.id,a.dd_user_id, a.psr_id, a.name, a.status,a.clock_status, a.content, a.record_time, a.start_time, a.end_time,
         a.sum_duration, a.check_duration, a.create_id,
         b.duration
         from user_record a left join project_staff_record b on a.psr_id=b.id