소스 검색

教师考勤记录增加部门查询

dzx 1 개월 전
부모
커밋
3ca229dea1

+ 7 - 2
src/main/resources/mapper/attendance/TeacherAttendanceRecordMapper.xml

@@ -5,13 +5,18 @@
 <mapper namespace="com.xjrsoft.module.attendance.mapper.TeacherAttendanceRecordMapper">
     <select id="getPage" parameterType="com.xjrsoft.module.attendance.dto.TeacherDetailsDto" resultType="com.xjrsoft.module.attendance.vo.TeacherStatisticsPageVo">
         SELECT t2.name AS teacher_name,t2.mobile,t1.attendance_status AS STATUS,t1.record_time,
-        replace(replace(t1.attendance_mode,1, '人脸'),2,'车辆') as attendance_mode,t1.car_number,t1.user_id FROM teacher_attendance_record t1
+        replace(replace(t1.attendance_mode,1, '人脸'),2,'车辆') as attendance_mode,t1.car_number,t1.user_id,
+        (
+            select group_concat(c1.name) from xjr_department c1
+            inner join xjr_user_dept_relation c2 on c1.id = c2.dept_id
+            where c1.delete_mark = 0 and c2.user_id = t1.user_id
+        ) as dept_name
+        FROM teacher_attendance_record t1
         INNER JOIN xjr_user t2 ON t1.user_id = t2.id
         <if test="dto.deptId != null">
             inner join xjr_user_dept_relation t3 on t2.id = t3.user_id
             and t3.dept_id = #{dto.deptId}
         </if>
-
         WHERE t1.delete_mark = 0
         AND DATE_FORMAT(t1.attendance_date,'%Y-%m-%d') = #{dto.date}
         AND t1.time_interval = #{dto.timePeriod}

+ 3 - 0
src/test/java/com/xjrsoft/module/job/AttendanceRecordTaskTest.java

@@ -150,6 +150,9 @@ class AttendanceRecordTaskTest {
                 }
             }
 
+            record.setStartTime(startTime);
+            record.setEndTime(endTime);
+
             WfTeacherleave studentLeave = wfTeacherleaveService.getLeaveByUserId(startTime, endTime, user.getId());
             if(studentLeave != null){
                 record.setAttendanceStatus(studentLeave.getLeaveType());

+ 2 - 2
src/test/java/com/xjrsoft/module/liteflow/node/WfTeacherleaveNodeTest.java

@@ -23,10 +23,10 @@ class WfTeacherleaveNodeTest {
     @Test
     public void process() throws Exception {
         // 获取表单中数据编号
-        Long formId = 1792820336026759168L;
+        Long formId = 1848561918628917248L;
         if (formId != null) {
             // 数据处理
-            wfTeacherleaveService.hikvisionLeave(formId);
+            wfTeacherleaveService.updateAttendancestatus(formId);
         }
     }
 }