| | |
| | | public void getWeComAttendanceListOfNoon(String attendDate, List attUser) throws Exception { |
| | | try { |
| | | // 获取企业微信Token |
| | | wxCpService.getAccessToken(); |
| | | wxCpService.getAccessToken(true); |
| | | |
| | | // 获取参数日期类 |
| | | Calendar calAttendDate = Calendar.getInstance(); |
| | |
| | | for (User user : userList) { |
| | | // 考勤记录:根据用户和日期查询 |
| | | Attendance attendance = attendanceRepository.findAllByUserIdAndAttendanceDate(user.getId(), startAttendDate); |
| | | // TODO:20250801修改 当天新建用户没有经过0点的考勤信息创建会空指针,需要创建记录 |
| | | if (attendance == null || attendance.getId().equals(null)) { |
| | | getWeComAttendanceList(Timestamp.valueOf(startAttendDate + " 00:00:00"), Arrays.asList(user)); |
| | | attendance = attendanceRepository.findAllByUserIdAndAttendanceDate(user.getId(), startAttendDate); |
| | | } |
| | | |
| | | Boolean isHoliday = false; |
| | | if (calAttendDate.get(Calendar.DAY_OF_WEEK) == Calendar.SATURDAY || calAttendDate.get(Calendar.DAY_OF_WEEK) == Calendar.SUNDAY || attendance.getDateType().equals(Constant.DATE_TYPE_LEGAL_HOLIDAYS) || attendance.getDateType().equals(Constant.DATE_TYPE_HOLIDAYS) || attendance.getDateType().equals(Constant.DATE_TYPE_WEEKEND)) { |
| | | isHoliday = true; |
| | |
| | | public void getWeComAttendanceListOfNight(String attendDate, List attUser) throws Exception { |
| | | try { |
| | | // 获取企业微信Token |
| | | wxCpService.getAccessToken(); |
| | | wxCpService.getAccessToken(true); |
| | | |
| | | // 获取参数日期类 |
| | | Calendar calAttendDate = Calendar.getInstance(); |
| | |
| | | for (User user : userList) { |
| | | // 考勤记录:根据用户和日期查询 |
| | | Attendance attendance = attendanceRepository.findAllByUserIdAndAttendanceDate(user.getId(), startAttendDate); |
| | | // TODO:20250801修改 当天新建用户没有经过0点的考勤信息创建会空指针,需要创建记录 |
| | | if (attendance == null || attendance.getId().equals(null)) { |
| | | getWeComAttendanceList(Timestamp.valueOf(startAttendDate + " 00:00:00"), Arrays.asList(user)); |
| | | attendance = attendanceRepository.findAllByUserIdAndAttendanceDate(user.getId(), startAttendDate); |
| | | } |
| | | |
| | | Boolean isHoliday = false; |
| | | if (calAttendDate.get(Calendar.DAY_OF_WEEK) == Calendar.SATURDAY || calAttendDate.get(Calendar.DAY_OF_WEEK) == Calendar.SUNDAY || attendance.getDateType().equals(Constant.DATE_TYPE_LEGAL_HOLIDAYS) || attendance.getDateType().equals(Constant.DATE_TYPE_HOLIDAYS) || attendance.getDateType().equals(Constant.DATE_TYPE_WEEKEND)) { |
| | | isHoliday = true; |
| | |
| | | if (userWeComIdList.size() > 0) { |
| | | try { |
| | | // 获取企业微信Token |
| | | wxCpService.getAccessToken(); |
| | | wxCpService.getAccessToken(true); |
| | | |
| | | // 编辑消息 |
| | | WxCpMessage wxCpMessage = new WxCpMessage(); |
| | |
| | | |
| | | try { |
| | | // 获取企业微信Token |
| | | wxCpService.getAccessToken(); |
| | | wxCpService.getAccessToken(true); |
| | | |
| | | // 查询现有子表信息 |
| | | WxCpSheetQueryRequest sheetQueryRequest = new WxCpSheetQueryRequest(); |
| | |
| | | |
| | | try { |
| | | // 获取企业微信Token |
| | | wxCpService.getAccessToken(); |
| | | wxCpService.getAccessToken(true); |
| | | |
| | | // 查询现有子表信息 |
| | | WxCpSheetQueryRequest sheetQueryRequest = new WxCpSheetQueryRequest(); |