| Line 7... |
Line 7... |
| 7 |
import org.apache.logging.log4j.Logger;
|
7 |
import org.apache.logging.log4j.Logger;
|
| 8 |
import org.springframework.beans.factory.annotation.Autowired;
|
8 |
import org.springframework.beans.factory.annotation.Autowired;
|
| 9 |
import org.springframework.mail.javamail.JavaMailSender;
|
9 |
import org.springframework.mail.javamail.JavaMailSender;
|
| 10 |
import org.springframework.mail.javamail.MimeMessageHelper;
|
10 |
import org.springframework.mail.javamail.MimeMessageHelper;
|
| 11 |
import org.springframework.stereotype.Service;
|
11 |
import org.springframework.stereotype.Service;
|
| - |
|
12 |
import org.springframework.transaction.annotation.Transactional;
|
| 12 |
|
13 |
|
| 13 |
import javax.mail.MessagingException;
|
14 |
import javax.mail.MessagingException;
|
| 14 |
import javax.mail.internet.InternetAddress;
|
15 |
import javax.mail.internet.InternetAddress;
|
| 15 |
import javax.mail.internet.MimeMessage;
|
16 |
import javax.mail.internet.MimeMessage;
|
| 16 |
import java.io.UnsupportedEncodingException;
|
17 |
import java.io.UnsupportedEncodingException;
|
| 17 |
import java.time.LocalDateTime;
|
18 |
import java.time.LocalDateTime;
|
| 18 |
import java.util.List;
|
19 |
import java.util.List;
|
| 19 |
import java.util.stream.Collectors;
|
20 |
import java.util.stream.Collectors;
|
| 20 |
|
21 |
|
| 21 |
@Service
|
22 |
@Service
|
| - |
|
23 |
@Transactional(rollbackFor = Throwable.class)
|
| 22 |
public class PurSaleServiceImpl implements PurSaleService {
|
24 |
public class PurSaleServiceImpl implements PurSaleService {
|
| 23 |
|
25 |
|
| 24 |
private static final Logger LOGGER = LogManager.getLogger(PurSaleServiceImpl.class);
|
26 |
private static final Logger LOGGER = LogManager.getLogger(PurSaleServiceImpl.class);
|
| 25 |
|
27 |
|
| 26 |
|
28 |
|
| Line 67... |
Line 69... |
| 67 |
String subject = "Age more than 10 days Stock Report";
|
69 |
String subject = "Age more than 10 days Stock Report";
|
| 68 |
String messageText = sb.toString();
|
70 |
String messageText = sb.toString();
|
| 69 |
MimeMessage message = mailSender.createMimeMessage();
|
71 |
MimeMessage message = mailSender.createMimeMessage();
|
| 70 |
MimeMessageHelper helper = new MimeMessageHelper(message, true);
|
72 |
MimeMessageHelper helper = new MimeMessageHelper(message, true);
|
| 71 |
String[] emailTo = {
|
73 |
String[] emailTo = {
|
| 72 |
"sm@smartdukaan.com",
|
74 |
// "sm@smartdukaan.com",
|
| 73 |
"tarun.verma@smartdukaan.com",
|
75 |
// "tarun.verma@smartdukaan.com",
|
| 74 |
"mohit.gulati@smartdukaan.com",
|
76 |
// "mohit.gulati@smartdukaan.com",
|
| 75 |
"tejus.lohani@smartdukaan.com"
|
77 |
"tejus.lohani@smartdukaan.com",
|
| - |
|
78 |
"tejuslohanibrb@gmail.com"
|
| 76 |
};
|
79 |
};
|
| 77 |
helper.setSubject(subject);
|
80 |
helper.setSubject(subject);
|
| 78 |
helper.setText(messageText, true);
|
81 |
helper.setText(messageText, true);
|
| 79 |
helper.setTo(emailTo);
|
82 |
helper.setTo(emailTo);
|
| 80 |
InternetAddress senderAddress = new InternetAddress("noreply@smartdukaan.com", "Smartdukaan Alerts");
|
83 |
InternetAddress senderAddress = new InternetAddress("noreply@smartdukaan.com", "Smartdukaan Alerts");
|