Subversion Repositories SmartDukaan

Rev

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

Rev 25317 Rev 25318
Line 702... Line 702...
702
				}
702
				}
703
				storeGuyMap.get(storeGuy).add(storeEmail);
703
				storeGuyMap.get(storeGuy).add(storeEmail);
704
			}
704
			}
705
		}
705
		}
706
 
706
 
707
		String fileName = "InvestmentSummary-" + 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)).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
		}