From cee01e23237dffbac5b9e326d03bb996a6d2df48 Mon Sep 17 00:00:00 2001 From: furongxin <419481438@qq.com> Date: Sat, 14 Sep 2024 09:55:40 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=8A=82=E5=81=87=E6=97=A5?= =?UTF-8?q?=E6=8E=92=E7=8F=AD=20=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../system/service/attendance/AttendanceServiceImpl.java | 8 +++++++- .../attendance/fixed/AttendanceFixedServiceImpl.java | 4 +++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/attendance/AttendanceServiceImpl.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/attendance/AttendanceServiceImpl.java index 6084308a..e1f312ab 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/attendance/AttendanceServiceImpl.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/attendance/AttendanceServiceImpl.java @@ -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; + } } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/attendance/fixed/AttendanceFixedServiceImpl.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/attendance/fixed/AttendanceFixedServiceImpl.java index 232fa45c..94e0fee7 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/attendance/fixed/AttendanceFixedServiceImpl.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/attendance/fixed/AttendanceFixedServiceImpl.java @@ -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; }