| | |
| | | import me.zhengjie.modules.system.repository.SysConfigHolidayRepository; |
| | | import me.zhengjie.modules.system.repository.SysRosteringRepository; |
| | | import me.zhengjie.modules.system.repository.UserRepository; |
| | | import me.zhengjie.modules.system.service.DictDetailService; |
| | | import me.zhengjie.utils.StringUtils; |
| | | import org.apache.commons.lang3.ObjectUtils; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | private final AttendanceLeaveRepository attendanceLeaveRepository; |
| | | private final AttendanceBusinessTravelRepository attendanceBusinessTravelRepository; |
| | | private final AttendanceGoOutRepository attendanceGoOutRepository; |
| | | private final DictDetailService dictDetailService; |
| | | |
| | | /** |
| | | * 凌晨0点执行,新增用户考勤信息 |
| | |
| | | if (ObjectUtils.isEmpty(attendDate) || attendDate.compareTo(Timestamp.valueOf(strTodayDate + " 00:00:00")) <= 0) { |
| | | // 用户列表 |
| | | List<User> userList = new ArrayList<>(); |
| | | // 获取企业微信考勤白名单 |
| | | List<String> excludeList = dictDetailService.getDictByName("wecom_exclude_list").stream().map(i -> i.getValue()).collect(Collectors.toList()); |
| | | // 参数用户不为空(考勤按钮调用) |
| | | if (ObjectUtils.isNotEmpty(attUser)) { |
| | | // 用户列表 |
| | | userList = attUser; |
| | | userList = userList.stream().filter(i -> StringUtils.isNotBlank(i.getWeComId())).collect(Collectors.toList()); |
| | | userList = userList.stream().filter(i -> StringUtils.isNotBlank(i.getWeComId()) && !excludeList.contains(i.getWeComId())).collect(Collectors.toList()); |
| | | } else { |
| | | // 用户列表:查询状态正常的员工 |
| | | userList = getUserList().stream().filter(i -> StringUtils.isNotBlank(i.getWeComId())).collect(Collectors.toList()); |
| | | userList = getUserList().stream().filter(i -> StringUtils.isNotBlank(i.getWeComId()) && !excludeList.contains(i.getWeComId())).collect(Collectors.toList()); |
| | | } |
| | | // 参数日期 |
| | | String strAttendDate = ""; |
| | |
| | | calAttendDate.setTime(Timestamp.valueOf(strAttendDate + " 00:00:00")); |
| | | // 用户列表 |
| | | List<User> userList; |
| | | // 获取企业微信考勤白名单 |
| | | List<String> excludeList = dictDetailService.getDictByName("wecom_exclude_list").stream().map(i -> i.getValue()).collect(Collectors.toList()); |
| | | // 参数用户不为空(考勤按钮调用) |
| | | if (ObjectUtils.isNotEmpty(attUser)) { |
| | | // 用户列表 |
| | | userList = attUser; |
| | | userList = userList.stream().filter(i -> StringUtils.isNotBlank(i.getWeComId())).collect(Collectors.toList()); |
| | | userList = userList.stream().filter(i -> StringUtils.isNotBlank(i.getWeComId()) && !excludeList.contains(i.getWeComId())).collect(Collectors.toList()); |
| | | } else { |
| | | // 用户列表:查询状态正常的员工 |
| | | userList = getUserList().stream().filter(i -> StringUtils.isNotBlank(i.getWeComId())).collect(Collectors.toList()); |
| | | userList = getUserList().stream().filter(i -> StringUtils.isNotBlank(i.getWeComId()) && !excludeList.contains(i.getWeComId())).collect(Collectors.toList()); |
| | | } |
| | | // 遍历用户列表 |
| | | for (User user : userList) { |
| | |
| | | calAttendDate.setTime(Timestamp.valueOf(strAttendDate + " 00:00:00")); |
| | | // 用户列表 |
| | | List<User> userList; |
| | | // 获取企业微信考勤白名单 |
| | | List<String> excludeList = dictDetailService.getDictByName("wecom_exclude_list").stream().map(i -> i.getValue()).collect(Collectors.toList()); |
| | | // 参数用户不为空(考勤按钮调用) |
| | | if (ObjectUtils.isNotEmpty(attUser)) { |
| | | // 用户列表 |
| | | userList = attUser; |
| | | userList = userList.stream().filter(i -> StringUtils.isNotBlank(i.getWeComId())).collect(Collectors.toList()); |
| | | userList = userList.stream().filter(i -> StringUtils.isNotBlank(i.getWeComId()) && !excludeList.contains(i.getWeComId())).collect(Collectors.toList()); |
| | | } else { |
| | | // 用户列表:查询状态正常的员工 |
| | | userList = getUserList().stream().filter(i -> StringUtils.isNotBlank(i.getWeComId())).collect(Collectors.toList()); |
| | | userList = getUserList().stream().filter(i -> StringUtils.isNotBlank(i.getWeComId()) && !excludeList.contains(i.getWeComId())).collect(Collectors.toList()); |
| | | } |
| | | // 遍历用户列表 |
| | | for (User user : userList) { |