Subversion Repositories SmartDukaan

Rev

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

Rev 25342 Rev 25344
Line 627... Line 627...
627
		storeGuyMap.remove("");
627
		storeGuyMap.remove("");
628
 
628
 
629
		String fileName = "InvestmentSummary-" + FormattingUtils.formatDate(LocalDateTime.now()) + ".csv";
629
		String fileName = "InvestmentSummary-" + FormattingUtils.formatDate(LocalDateTime.now()) + ".csv";
630
		for (Map.Entry<String, Set<String>> storeGuyEntry : storeGuyMap.entrySet()) {
630
		for (Map.Entry<String, Set<String>> storeGuyEntry : storeGuyMap.entrySet()) {
631
			List<List<? extends Serializable>> filteredRows = storeGuyEntry.getValue().stream()
631
			List<List<? extends Serializable>> filteredRows = storeGuyEntry.getValue().stream()
632
					.map(x -> partnerRow.get(x)).collect(Collectors.toList());
632
					.map(x -> partnerRow.get(x)).filter(x->x!=null).collect(Collectors.toList());
633
			ByteArrayOutputStream baos = FileUtil.getCSVByteStream(headers, filteredRows);
633
			ByteArrayOutputStream baos = FileUtil.getCSVByteStream(headers, filteredRows);
634
			String[] sendToArray = new String[] { nameEmail.get(storeGuyEntry.getKey()) };
634
			String[] sendToArray = new String[] { nameEmail.get(storeGuyEntry.getKey()) };
635
			Utils.sendMailWithAttachment(googleMailSender, sendToArray, null, "Partner Investment Summary", "PFA",
635
			Utils.sendMailWithAttachment(googleMailSender, sendToArray, null, "Partner Investment Summary", "PFA",
636
					fileName, new ByteArrayResource(baos.toByteArray()));
636
					fileName, new ByteArrayResource(baos.toByteArray()));
637
		}
637
		}