Subversion Repositories SmartDukaan

Rev

Rev 28778 | Rev 28782 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 28778 Rev 28780
Line 1123... Line 1123...
1123
			User user = userMap.get(authUser.getEmailId());
1123
			User user = userMap.get(authUser.getEmailId());
1124
			Optional<EmployeeAttendance> employeeAttendanceOptional = employeeMorningAttendance.get(user.getId());
1124
			Optional<EmployeeAttendance> employeeAttendanceOptional = employeeMorningAttendance.get(user.getId());
1125
			if(employeeAttendanceOptional==null 
1125
			if(employeeAttendanceOptional==null 
1126
					|| employeeAttendanceOptional.orElseGet(null)==null 
1126
					|| employeeAttendanceOptional.orElseGet(null)==null 
1127
					|| employeeAttendanceOptional.get().getCreateTimestamp().isAfter(moriningTime)) {
1127
					|| employeeAttendanceOptional.get().getCreateTimestamp().isAfter(moriningTime)) {
1128
				String body = String.format("Dear %s,\n Pls note that you haven't punched your attendance by 10:45am. You have been marked absent for half the day. You may contact your manager and get it regularise.\nRegards\nHR Team", authUser.getFullName());
1128
				String body = String.format("Dear %s,\n Pls note that you haven't punched your attendance by 10:45am. You have been marked absent for half the day. You may contact your manager and get it regularise.\n\nRegards\nHR Team", authUser.getFullName());
1129
				Utils.sendMailWithAttachments(googleMailSender, new String[] { "amit.gupta@shop2020.in" }, new String[] { "jyoti.rawat@smartdukaan.com" }, "Attendance Alert", 
1129
				Utils.sendMailWithAttachments(googleMailSender, new String[] { "amit.gupta@shop2020.in" }, new String[] { "jyoti.rawat@smartdukaan.com" }, "Attendance Alert", 
1130
						body);
1130
						body);
1131
				break;
1131
				break;
1132
			}
1132
			}
1133
		}
1133
		}
Line 1154... Line 1154...
1154
			User user = userMap.get(authUser.getEmailId());
1154
			User user = userMap.get(authUser.getEmailId());
1155
			Optional<EmployeeAttendance> employeeAttendanceOptional = employeeEveningAttendanceMap.get(user.getId());
1155
			Optional<EmployeeAttendance> employeeAttendanceOptional = employeeEveningAttendanceMap.get(user.getId());
1156
			if(employeeAttendanceOptional!=null 
1156
			if(employeeAttendanceOptional!=null 
1157
					&& employeeAttendanceOptional.orElseGet(null)!=null 
1157
					&& employeeAttendanceOptional.orElseGet(null)!=null 
1158
					&& employeeAttendanceOptional.get().getCreateTimestamp().isBefore(eveningTime)) {
1158
					&& employeeAttendanceOptional.get().getCreateTimestamp().isBefore(eveningTime)) {
1159
				String body = String.format("Dear %s,\n Pls note that you have punched your attendance before 6pm. You have been marked absent for half the day. You may contact your manager and get it regularise.\nRegards\nHR Team", authUser.getFullName());
1159
				String body = String.format("Dear %s,\n Pls note that you have punched your attendance before 6pm. You have been marked absent for half the day. You may contact your manager and get it regularise.\n\nRegards\nHR Team", authUser.getFullName());
1160
				Utils.sendMailWithAttachments(googleMailSender, new String[] { "amit.gupta@shop2020.in" }, new String[] { "jyoti.rawat@smartdukaan.com" }, "Attendance Alert", 
1160
				Utils.sendMailWithAttachments(googleMailSender, new String[] { "amit.gupta@shop2020.in" }, new String[] { "jyoti.rawat@smartdukaan.com" }, "Attendance Alert", 
1161
						body);
1161
						body);
1162
				break;
1162
				break;
1163
			}
1163
			}
1164
		}
1164
		}