Subversion Repositories SmartDukaan

Rev

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

Rev 25318 Rev 25319
Line 705... Line 705...
705
		}
705
		}
706
 
706
 
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[] { 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
		}