ソースを参照

上班打卡时判断是否已打卡,如果打卡后就不再记录。

zhengqiang 5 年 前
コミット
008ac0f46f

+ 7 - 7
common/src/main/java/com/jpsoft/smart/modules/business/service/impl/WorkAttendanceServiceImpl.java

@@ -143,19 +143,19 @@ public class WorkAttendanceServiceImpl implements WorkAttendanceService {
 					if (alarmConfig.getClassifier().equals(1)) {
 						//todo 上班考勤
 
+						//当天是否已经有该时段上班打卡记录,如果有则不记录
+						List<WorkAttendance> workAttendances = workAttendanceDAO.findByPeriod(personId,alarmConfig.getId(),recordTime.toDate());
+
+						if (workAttendances.size()>0){
+							break;
+						}
+
 						//准时上班
 						if (recordTime.compareTo(startTime)>0 && recordTime.compareTo(attendanceTime)<=0){
 							attendanceResult = WorkAttendance.SUCCESS;
 						}
 						else if(recordTime.compareTo(attendanceTime)>0 && recordTime.compareTo(endTime)<=0){
 							attendanceResult = WorkAttendance.LATE;
-
-							//当天是否已经有该时段正常上班打卡记录,如果有则不记录
-							List<WorkAttendance> workAttendances = workAttendanceDAO.findByPeriod(personId,alarmConfig.getId(),recordTime.toDate());
-
-							if (workAttendances.size()>0){
-								break;
-							}
 						}
 					} else {
 						//todo 下班考勤