| Line 823... |
Line 823... |
| 823 |
}
|
823 |
}
|
| 824 |
|
824 |
|
| 825 |
}
|
825 |
}
|
| 826 |
|
826 |
|
| 827 |
String fileName = "TargetVsSales-" + FormattingUtils.formatDate(LocalDateTime.now()) + ".csv";
|
827 |
String fileName = "TargetVsSales-" + FormattingUtils.formatDate(LocalDateTime.now()) + ".csv";
|
| 828 |
for (Map.Entry<String, Set<String>> storeGuyEntry : csService.getAuthUserPartnerEmailMapping().entrySet()) {
|
828 |
/*for (Map.Entry<String, Set<String>> storeGuyEntry : csService.getAuthUserPartnerEmailMapping().entrySet()) {
|
| 829 |
List<List<? extends Serializable>> filteredRows = storeGuyEntry.getValue().stream()
|
829 |
List<List<? extends Serializable>> filteredRows = storeGuyEntry.getValue().stream()
|
| 830 |
.map(x -> partnerRowMap.get(x)).filter(x -> x != null).collect(Collectors.toList());
|
830 |
.map(x -> partnerRowMap.get(x)).filter(x -> x != null).collect(Collectors.toList());
|
| 831 |
ByteArrayOutputStream baos = FileUtil.getCSVByteStream(headers, filteredRows);
|
831 |
ByteArrayOutputStream baos = FileUtil.getCSVByteStream(headers, filteredRows);
|
| 832 |
String[] sendToArray = new String[] { storeGuyEntry.getKey() };
|
832 |
String[] sendToArray = new String[] { storeGuyEntry.getKey() };
|
| 833 |
Utils.sendMailWithAttachment(googleMailSender, sendToArray, null, "Target vs Sales Summary", "PFA",
|
833 |
Utils.sendMailWithAttachment(googleMailSender, sendToArray, null, "Target vs Sales Summary", "PFA",
|
| 834 |
fileName, new ByteArrayResource(baos.toByteArray()));
|
834 |
fileName, new ByteArrayResource(baos.toByteArray()));
|
| 835 |
}
|
835 |
}*/
|
| 836 |
|
836 |
|
| 837 |
ByteArrayOutputStream baos = FileUtil.getCSVByteStream(headers, rows);
|
837 |
ByteArrayOutputStream baos = FileUtil.getCSVByteStream(headers, rows);
|
| 838 |
String[] sendToArray = sendTo.toArray(new String[sendTo.size()]);
|
838 |
String[] sendToArray = sendTo.toArray(new String[sendTo.size()]);
|
| 839 |
Utils.sendMailWithAttachment(googleMailSender, sendToArray, null, "Target vs Sales Summary", "PFA", fileName,
|
839 |
Utils.sendMailWithAttachment(googleMailSender, sendToArray, null, "Target vs Sales Summary", "PFA", fileName,
|
| 840 |
new ByteArrayResource(baos.toByteArray()));
|
840 |
new ByteArrayResource(baos.toByteArray()));
|