获取用户考勤组调整/获取打卡页面调整

This commit is contained in:
aikai 2024-06-11 15:30:12 +08:00
parent cecbe3fc74
commit e23d46b585
2 changed files with 5 additions and 3 deletions

View File

@ -272,8 +272,8 @@ public class AttendanceServiceImpl implements AttendanceService {
LocalDateTime time = LocalDateTime.ofInstant(DateUtils.buildHHmmTime(attendanceOnTheDayDTO.getTime()).toInstant(), ZoneId.systemDefault()); LocalDateTime time = LocalDateTime.ofInstant(DateUtils.buildHHmmTime(attendanceOnTheDayDTO.getTime()).toInstant(), ZoneId.systemDefault());
LocalDateTime lastTime = time.minusMinutes(attendanceOnTheDayDTO.getBeforePunchTime()); LocalDateTime lastTime = time.minusMinutes(attendanceOnTheDayDTO.getBeforePunchTime());
LocalDateTime endTime = time.plusMinutes(attendanceOnTheDayDTO.getAfterPunchTime()); LocalDateTime endTime = time.plusMinutes(attendanceOnTheDayDTO.getAfterPunchTime());
// 确保beforePunchTime/AfterPunchTime是正数 // 确保beforePunchTime/AfterPunchTime是正数 - 判断当前时间与最早打卡时间 如果没到时间则跳过
if (attendanceOnTheDayDTO.getBeforePunchTime() <= Constants.ZERO || attendanceOnTheDayDTO.getAfterPunchTime() <= Constants.ZERO) { if (attendanceOnTheDayDTO.getBeforePunchTime() < Constants.ZERO || attendanceOnTheDayDTO.getAfterPunchTime() < Constants.ZERO || localDateTime.isBefore(lastTime)) {
continue; // 跳过当前循环避免错误 - 如果所有的都错了话 那么返回默认的 未到打卡时间 continue; // 跳过当前循环避免错误 - 如果所有的都错了话 那么返回默认的 未到打卡时间
} }
if (LocalDateTimeUtil.isIn(localDateTime, lastTime, endTime)) { if (LocalDateTimeUtil.isIn(localDateTime, lastTime, endTime)) {

View File

@ -14,6 +14,8 @@
select a.* select a.*
from kq_attendance_group as a from kq_attendance_group as a
left join kq_attendance_group_user as b on a.id = b.attendance_group_id left join kq_attendance_group_user as b on a.id = b.attendance_group_id
where b.user_id = #{userId} where
b.deleted = 0
and b.user_id = #{userId}
</select> </select>
</mapper> </mapper>