| Line 1124... |
Line 1124... |
| 1124 |
.collect(Collectors.groupingBy(EmployeeAttendance::getUserId,
|
1124 |
.collect(Collectors.groupingBy(EmployeeAttendance::getUserId,
|
| 1125 |
Collectors.minBy(Comparator.comparing(EmployeeAttendance::getCreateTimestamp))));
|
1125 |
Collectors.minBy(Comparator.comparing(EmployeeAttendance::getCreateTimestamp))));
|
| 1126 |
for (AuthUser authUser : authUsers) {
|
1126 |
for (AuthUser authUser : authUsers) {
|
| 1127 |
User user = userMap.get(authUser.getEmailId());
|
1127 |
User user = userMap.get(authUser.getEmailId());
|
| 1128 |
Optional<EmployeeAttendance> employeeAttendanceOptional = employeeMorningAttendance.get(user.getId());
|
1128 |
Optional<EmployeeAttendance> employeeAttendanceOptional = employeeMorningAttendance.get(user.getId());
|
| - |
|
1129 |
LOGGER.info("employeeAttendanceOptional {}", employeeAttendanceOptional);
|
| - |
|
1130 |
LOGGER.info("employeeAttendanceOptional.orElse {}", employeeAttendanceOptional.orElse(null));
|
| 1129 |
if (employeeAttendanceOptional == null || employeeAttendanceOptional.orElse(null) == null
|
1131 |
if (employeeAttendanceOptional == null || employeeAttendanceOptional.orElse(null) == null
|
| 1130 |
|| employeeAttendanceOptional.get().getCreateTimestamp().isAfter(moriningTime)) {
|
1132 |
|| employeeAttendanceOptional.get().getCreateTimestamp().isAfter(moriningTime)) {
|
| - |
|
1133 |
LOGGER.info("Email {}, employeeAttendanceOptional.get().getCreateTimestamp() {}", authUser.getFullName(), employeeAttendanceOptional.get().getCreateTimestamp());
|
| 1131 |
String body = String.format(
|
1134 |
String body = String.format(
|
| 1132 |
"Dear %s,\n Pls note that you haven't punched your attendance by 10:30am%s. You have been marked absent for half the day.\n\nRegards\nHR Team",
|
1135 |
"Dear %s,\n Pls note that you haven't punched your attendance by 10:30am%s. You have been marked absent for half the day.\n\nRegards\nHR Team",
|
| 1133 |
authUser.getFullName(), (employeeAttendanceOptional == null || employeeAttendanceOptional.orElse(null) == null) ? ""
|
1136 |
authUser.getFullName(), (employeeAttendanceOptional == null || employeeAttendanceOptional.orElse(null) == null) ? ""
|
| 1134 |
: "(Punched at " + FormattingUtils.format(employeeAttendanceOptional.get().getCreateTimestamp()) +")" );
|
1137 |
: "(Punched at " + FormattingUtils.format(employeeAttendanceOptional.get().getCreateTimestamp()) +")" );
|
| - |
|
1138 |
/*
|
| 1135 |
Utils.sendMailWithAttachments(googleMailSender, new String[] {
|
1139 |
* Utils.sendMailWithAttachments(googleMailSender, new String[] {
|
| 1136 |
authUser.getEmailId() }, new String[] { "jyoti.rawat@smartdukaan.com" },
|
1140 |
* authUser.getEmailId() }, new String[] { "jyoti.rawat@smartdukaan.com" },
|
| 1137 |
"Attendance Alert", body);
|
1141 |
* "Attendance Alert", body);
|
| - |
|
1142 |
*/
|
| 1138 |
}
|
1143 |
}
|
| 1139 |
}
|
1144 |
}
|
| 1140 |
|
1145 |
|
| 1141 |
}
|
1146 |
}
|
| 1142 |
|
1147 |
|