Subversion Repositories SmartDukaan

Rev

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

Rev 25892 Rev 25894
Line 809... Line 809...
809
		Map<Integer, List<? extends Serializable>> partnerRowMap = new HashMap<>();
809
		Map<Integer, List<? extends Serializable>> partnerRowMap = new HashMap<>();
810
		for (Map.Entry<Integer, List<Serializable>> partnerSalesTargetRowEntry : partnerSalesTargetRowsMap.entrySet()) {
810
		for (Map.Entry<Integer, List<Serializable>> partnerSalesTargetRowEntry : partnerSalesTargetRowsMap.entrySet()) {
811
			List<Serializable> row = partnerIdSalesHeadersMap.get(partnerSalesTargetRowEntry.getKey());
811
			List<Serializable> row = partnerIdSalesHeadersMap.get(partnerSalesTargetRowEntry.getKey());
812
			if (row == null) {
812
			if (row == null) {
813
				LOGGER.warn("Could not find headers for partner ID - {}", partnerSalesTargetRowEntry.getKey());
813
				LOGGER.warn("Could not find headers for partner ID - {}", partnerSalesTargetRowEntry.getKey());
814
				continue;
-
 
815
			}
814
			}
816
			row.addAll(partnerSalesTargetRowEntry.getValue());
815
			row.addAll(partnerSalesTargetRowEntry.getValue());
817
			partnerRowMap.put(partnerSalesTargetRowEntry.getKey(), row);
816
			partnerRowMap.put(partnerSalesTargetRowEntry.getKey(), row);
818
			rows.add(row);
817
			rows.add(row);
819
		}
818
		}
820
 
819
 
821
		String fileName = "TargetVsSales-" + FormattingUtils.formatDate(LocalDateTime.now()) + ".csv";
820
		String fileName = "TargetVsSales-" + FormattingUtils.formatDate(LocalDateTime.now()) + ".csv";
822
		Map<String, Set<Integer>> storeGuysMap = csService.getAuthUserPartnerIdMapping();
821
		Map<String, Set<String>> storeGuysMap = csService.getAuthUserPartnerEmailMapping();
823
		for (Map.Entry<String, Set<Integer>> storeGuyEntry : storeGuysMap.entrySet()) {
822
		for (Map.Entry<String, Set<String>> storeGuyEntry : storeGuysMap.entrySet()) {
824
			if (storeGuyEntry.getValue().size() == 0)
823
			if (storeGuyEntry.getValue().size() == 0)
825
				continue;
824
				continue;
826
			List<List<?>> storeGuyRows = storeGuyEntry.getValue().stream().filter(x -> partnerRowMap.containsKey(x)).map(x -> partnerRowMap.get(x))
825
			List<List<?>> storeGuyRows = storeGuyEntry.getValue().stream().filter(x -> partnerRowMap.containsKey(x)).map(x -> partnerRowMap.get(x))
827
					.collect(Collectors.toList());
826
					.collect(Collectors.toList());
828
			ByteArrayOutputStream authUserStream = FileUtil.getCSVByteStream(headers, storeGuyRows);
827
			ByteArrayOutputStream authUserStream = FileUtil.getCSVByteStream(headers, storeGuyRows);