Subversion Repositories SmartDukaan

Rev

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

Rev 28790 Rev 28791
Line 20... Line 20...
20
import java.util.Map;
20
import java.util.Map;
21
import java.util.Map.Entry;
21
import java.util.Map.Entry;
22
import java.util.Optional;
22
import java.util.Optional;
23
import java.util.Set;
23
import java.util.Set;
24
import java.util.stream.Collectors;
24
import java.util.stream.Collectors;
25
import java.util.stream.IntStream;
-
 
26
 
25
 
27
import javax.mail.MessagingException;
26
import javax.mail.MessagingException;
28
import javax.mail.internet.InternetAddress;
27
import javax.mail.internet.InternetAddress;
29
import javax.mail.internet.MimeMessage;
28
import javax.mail.internet.MimeMessage;
30
 
29
 
Line 111... Line 110...
111
import com.spice.profitmandi.dao.entity.user.FranchiseeVisit;
110
import com.spice.profitmandi.dao.entity.user.FranchiseeVisit;
112
import com.spice.profitmandi.dao.entity.user.Lead;
111
import com.spice.profitmandi.dao.entity.user.Lead;
113
import com.spice.profitmandi.dao.entity.user.Refferal;
112
import com.spice.profitmandi.dao.entity.user.Refferal;
114
import com.spice.profitmandi.dao.enumuration.catalog.SchemeType;
113
import com.spice.profitmandi.dao.enumuration.catalog.SchemeType;
115
import com.spice.profitmandi.dao.enumuration.cs.EscalationType;
114
import com.spice.profitmandi.dao.enumuration.cs.EscalationType;
116
import com.spice.profitmandi.dao.enumuration.dtr.PunchType;
-
 
117
import com.spice.profitmandi.dao.enumuration.dtr.RefferalStatus;
115
import com.spice.profitmandi.dao.enumuration.dtr.RefferalStatus;
118
import com.spice.profitmandi.dao.enumuration.fofo.ScanType;
116
import com.spice.profitmandi.dao.enumuration.fofo.ScanType;
119
import com.spice.profitmandi.dao.enumuration.transaction.PriceDropImeiStatus;
117
import com.spice.profitmandi.dao.enumuration.transaction.PriceDropImeiStatus;
120
import com.spice.profitmandi.dao.model.SimpleCampaign;
118
import com.spice.profitmandi.dao.model.SimpleCampaign;
121
import com.spice.profitmandi.dao.model.SimpleCampaignParams;
119
import com.spice.profitmandi.dao.model.SimpleCampaignParams;
Line 1128... Line 1126...
1128
			User user = userMap.get(authUser.getEmailId());
1126
			User user = userMap.get(authUser.getEmailId());
1129
			Optional<EmployeeAttendance> employeeAttendanceOptional = employeeMorningAttendance.get(user.getId());
1127
			Optional<EmployeeAttendance> employeeAttendanceOptional = employeeMorningAttendance.get(user.getId());
1130
			if (employeeAttendanceOptional == null || employeeAttendanceOptional.orElse(null) == null
1128
			if (employeeAttendanceOptional == null || employeeAttendanceOptional.orElse(null) == null
1131
					|| employeeAttendanceOptional.get().getCreateTimestamp().isAfter(moriningTime)) {
1129
					|| employeeAttendanceOptional.get().getCreateTimestamp().isAfter(moriningTime)) {
1132
				String body = String.format(
1130
				String body = String.format(
1133
						"Dear %s,\n Pls note that you haven't punched your attendance by 10:30am. You have been marked absent for half the day. You may contact your manager and get it regularise.\n\nRegards\nHR Team",
1131
						"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. You may contact your manager and get it regularise.\n\nRegards\nHR Team",
1134
						authUser.getFullName());
1132
						authUser.getFullName(), (employeeAttendanceOptional == null || employeeAttendanceOptional.orElse(null) == null) ? "" 
-
 
1133
								: "(Punched at " + FormattingUtils.format(employeeAttendanceOptional.get().getCreateTimestamp()) +")" );
1135
				// Utils.sendMailWithAttachments(googleMailSender, new String[] {
1134
				// Utils.sendMailWithAttachments(googleMailSender, new String[] {
1136
				// authUser.getEmailId() }, new String[] { "jyoti.rawat@smartdukaan.com" },
1135
				// authUser.getEmailId() }, new String[] { "jyoti.rawat@smartdukaan.com" },
1137
				// "Attendance Alert",
1136
				// "Attendance Alert",
1138
				Utils.sendMailWithAttachments(googleMailSender, new String[] { "amit.gupta@shop2020.in" },
1137
				Utils.sendMailWithAttachments(googleMailSender, new String[] { "amit.gupta@shop2020.in" },
1139
						new String[] { "jyoti.rawat@smartdukaan.com" }, "Attendance Alert", body);
1138
						new String[] { "jyoti.rawat@smartdukaan.com" }, "Attendance Alert", body);