修改节假日排班 问题

This commit is contained in:
furongxin 2024-09-14 09:55:40 +08:00
parent 0d819a8ecc
commit cee01e2323
2 changed files with 10 additions and 2 deletions

View File

@ -281,7 +281,13 @@ public class AttendanceServiceImpl implements AttendanceService {
String lastKey = "holiday_" + (Integer.parseInt(year) - 1);
stringRedisTemplate.delete(lastKey);
}
return (Boolean) stringRedisTemplate.opsForHash().get(key, dateStr);
Object o = stringRedisTemplate.opsForHash().get(key, dateStr);
log.info("返回的对象:{}",o);
if ("true".equals(String.valueOf(o))){
return true;
}else {
return false;
}
}

View File

@ -221,13 +221,14 @@ public class AttendanceFixedServiceImpl implements AttendanceFixedService, Punch
// -- 判断是否根据节假日自动排班 - 如果是的话 - 根据排班的来
Boolean isHolidayFlag = Constants.TRUE.equals(activationGroup.getAutoHolidaysFlag()) ?
attendanceService.isHoliday(dto.getLocalDateTime()) : null;
vo.setTodayNeedAttendance(Constants.TRUE);
// -- 当前是节假日 并且是放假
if (isHolidayFlag != null && isHolidayFlag) {
return vo.setTodayNeedAttendance(Constants.FALSE);
}
//获取到当天是周几
int week = dto.getLocalDateTime().getDayOfWeek().getValue();
AttendanceFixedDO attendanceFixedDO = this.getByGroupIdAndWeek(activationGroup.getId(), week);
AttendanceFixedDO attendanceFixedDO = this.getByGroupIdAndWeek(activationGroup.getId(), week-1);
// -- 当前没有班次 - 不需要考勤
if (attendanceFixedDO == null || attendanceFixedDO.getAttendanceGroupShiftId() == null) {
return vo.setTodayNeedAttendance(Constants.FALSE);
@ -236,6 +237,7 @@ public class AttendanceFixedServiceImpl implements AttendanceFixedService, Punch
attendanceService.calculatePunch(dto, vo);
vo.setAttendanceGroupId(activationGroup.getId());
vo.setUser(dto.getUser());
log.info("考勤页面返回:{}",vo);
return vo;
}