| Line 722... |
Line 722... |
| 722 |
String fileName = "TargetVsSales-" + FormattingUtils.formatDate(LocalDateTime.now()) + ".csv";
|
722 |
String fileName = "TargetVsSales-" + FormattingUtils.formatDate(LocalDateTime.now()) + ".csv";
|
| 723 |
for (Map.Entry<String, Set<String>> storeGuyEntry : getStoreGuyMap().entrySet()) {
|
723 |
for (Map.Entry<String, Set<String>> storeGuyEntry : getStoreGuyMap().entrySet()) {
|
| 724 |
List<List<? extends Serializable>> filteredRows = storeGuyEntry.getValue().stream()
|
724 |
List<List<? extends Serializable>> filteredRows = storeGuyEntry.getValue().stream()
|
| 725 |
.map(x -> partnerRowMap.get(x)).filter(x -> x != null).collect(Collectors.toList());
|
725 |
.map(x -> partnerRowMap.get(x)).filter(x -> x != null).collect(Collectors.toList());
|
| 726 |
ByteArrayOutputStream baos = FileUtil.getCSVByteStream(headers, filteredRows);
|
726 |
ByteArrayOutputStream baos = FileUtil.getCSVByteStream(headers, filteredRows);
|
| 727 |
String[] sendToArray = new String[] { nameEmail.get(storeGuyEntry.getKey()) };
|
727 |
String[] sendToArray = new String[] { storeGuyEntry.getKey() };
|
| 728 |
Utils.sendMailWithAttachment(googleMailSender, sendToArray, null, "Target vs Sales Summary", "PFA",
|
728 |
Utils.sendMailWithAttachment(googleMailSender, sendToArray, null, "Target vs Sales Summary", "PFA",
|
| 729 |
fileName, new ByteArrayResource(baos.toByteArray()));
|
729 |
fileName, new ByteArrayResource(baos.toByteArray()));
|
| 730 |
}
|
730 |
}
|
| 731 |
|
731 |
|
| 732 |
ByteArrayOutputStream baos = FileUtil.getCSVByteStream(headers, rows);
|
732 |
ByteArrayOutputStream baos = FileUtil.getCSVByteStream(headers, rows);
|