Ver código fonte

教师考勤调整,1调整考勤状态判断逻辑,2增加考勤方式和车牌号字段

dzx 5 meses atrás
pai
commit
873a81c709

+ 11 - 1
src/main/java/com/xjrsoft/module/attendance/controller/TeacherStatisticsController.java

@@ -118,7 +118,7 @@ public class TeacherStatisticsController {
 //                outInMap.put(inRecord.getUserId(), inRecord);
 //            }
             for (TeacherStatisticsPageVo record : voIPage.getRecords()) {
-                LocalDateTime startTime, endTime;
+                LocalDateTime startTime, endTime, amEndTime = null;
                 AttendanceRuleDetailsUserVo detailsUserVo = teacherTodyRuleByUserId.get(record.getUserId());
                 if(dto.getTimePeriod() == 1){
                     startTime = queryDate.atTime(5, 0, 0);
@@ -138,6 +138,10 @@ public class TeacherStatisticsController {
                     if(detailsUserVo != null && detailsUserVo.getPmEndTime() != null){
                         endTime = queryDate.atTime(detailsUserVo.getPmEndTime());
                     }
+                    amEndTime  = queryDate.atTime(12, 0, 0);
+                    if(detailsUserVo != null && detailsUserVo.getAmEndTime() != null){
+                        amEndTime = queryDate.atTime(detailsUserVo.getAmEndTime());
+                    }
                 }else{
                     startTime = queryDate.atTime(0, 0, 0);
                     if(detailsUserVo != null && detailsUserVo.getEveningStartTime() != null){
@@ -180,6 +184,7 @@ public class TeacherStatisticsController {
                     if(outInRecord != null){
                         record.setRecordTime(outInRecord.getRecordTime());
                         record.setStatus(outInRecord.getAttendanceStatus());
+                        record.setAttendanceMode("人脸");
                     }
                 }else{
                     //查询该教师是否通过车辆进入
@@ -190,6 +195,7 @@ public class TeacherStatisticsController {
                                     .le(TeacherOutInRecord::getRecordTime, endTime)
                                     .eq("DATE_FORMAT(record_time, '%Y-%m-%d')", endTime.toLocalDate())
                                     .eq(CarMessageApply::getUserId, record.getUserId())
+                                    .ge(dto.getTimePeriod() == 2 && amEndTime != null, TeacherOutInRecord::getRecordTime, amEndTime)
                                     .orderByAsc(CarOutInRecord::getRecordTime)
                     );
                     if(!list.isEmpty()){
@@ -197,9 +203,13 @@ public class TeacherStatisticsController {
                         if(outInRecord != null && outInRecord.getRecordTime().isBefore(startTime)){
                             record.setRecordTime(outInRecord.getRecordTime());
                             record.setStatus("到校");
+                            record.setAttendanceMode("车辆");
+                            record.setCarNumber(outInRecord.getPlanNo());
                         }else if(outInRecord != null && outInRecord.getRecordTime().isAfter(startTime)){
                             record.setRecordTime(outInRecord.getRecordTime());
                             record.setStatus("迟到");
+                            record.setAttendanceMode("车辆");
+                            record.setCarNumber(outInRecord.getPlanNo());
                         }
                     }
                 }

+ 6 - 0
src/main/java/com/xjrsoft/module/attendance/vo/TeacherStatisticsPageVo.java

@@ -31,4 +31,10 @@ public class TeacherStatisticsPageVo {
 
     @ApiModelProperty("考勤时间")
     private LocalDateTime recordTime;
+
+    @ApiModelProperty("考勤方式")
+    private String attendanceMode;
+
+    @ApiModelProperty("车牌号")
+    private String carNumber;
 }