Subversion Repositories SmartDukaan

Rev

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

Rev 25319 Rev 25320
Line 707... Line 707...
707
		String fileName = "TargetVsSales-" + FormattingUtils.formatDate(LocalDateTime.now()) + ".csv";
707
		String fileName = "TargetVsSales-" + FormattingUtils.formatDate(LocalDateTime.now()) + ".csv";
708
		for (Map.Entry<String, Set<String>> storeGuyEntry : storeGuyMap.entrySet()) {
708
		for (Map.Entry<String, Set<String>> storeGuyEntry : storeGuyMap.entrySet()) {
709
			List<List<? extends Serializable>> filteredRows = storeGuyEntry.getValue().stream()
709
			List<List<? extends Serializable>> filteredRows = storeGuyEntry.getValue().stream()
710
					.map(x -> partnerRowMap.get(x)).filter(x->x!=null).collect(Collectors.toList());
710
					.map(x -> partnerRowMap.get(x)).filter(x->x!=null).collect(Collectors.toList());
711
			ByteArrayOutputStream baos = FileUtil.getCSVByteStream(headers, filteredRows);
711
			ByteArrayOutputStream baos = FileUtil.getCSVByteStream(headers, filteredRows);
712
			String[] sendToArray = new String[] { storeGuyEntry.getKey() };
712
			String[] sendToArray = new String[] { nameEmail.get(storeGuyEntry.getKey()) };
713
			Utils.sendMailWithAttachment(googleMailSender, sendToArray, null, "Target vs Sales Summary", "PFA",
713
			Utils.sendMailWithAttachment(googleMailSender, sendToArray, null, "Target vs Sales Summary", "PFA",
714
					fileName, new ByteArrayResource(baos.toByteArray()));
714
					fileName, new ByteArrayResource(baos.toByteArray()));
715
		}
715
		}
716
 
716
 
717
		ByteArrayOutputStream baos = FileUtil.getCSVByteStream(headers, rows);
717
		ByteArrayOutputStream baos = FileUtil.getCSVByteStream(headers, rows);