Subversion Repositories SmartDukaan

Rev

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

Rev 26992 Rev 27044
Line 543... Line 543...
543
				.collect(Collectors.toMap(x -> x.getId(), x -> x));
543
				.collect(Collectors.toMap(x -> x.getId(), x -> x));
544
 
544
 
545
		Map<Integer, List<CustomRetailer>> positonPartnerMap = this.getPositionCustomRetailerMap(categoryPositions);
545
		Map<Integer, List<CustomRetailer>> positonPartnerMap = this.getPositionCustomRetailerMap(categoryPositions);
546
		for (Map.Entry<Integer, List<CustomRetailer>> positionPartnerEntry : positonPartnerMap.entrySet()) {
546
		for (Map.Entry<Integer, List<CustomRetailer>> positionPartnerEntry : positonPartnerMap.entrySet()) {
547
			int authUserId = positionsMap.get(positionPartnerEntry.getKey()).getAuthUserId();
547
			int authUserId = positionsMap.get(positionPartnerEntry.getKey()).getAuthUserId();
548
			Set<Integer> partnerEmails = positionPartnerEntry.getValue().stream()
548
			Set<Integer> partnerIds = positionPartnerEntry.getValue().stream()
549
					.filter(x -> activeFofoIds.contains(x.getPartnerId())).map(x -> x.getPartnerId())
549
					.filter(x -> activeFofoIds.contains(x.getPartnerId())).map(x -> x.getPartnerId())
550
					.collect(Collectors.toSet());
550
					.collect(Collectors.toSet());
551
			AuthUser authUser = authRepository.selectById(authUserId);
551
			AuthUser authUser = authRepository.selectById(authUserId);
552
			if (authUser.isActive()) {
552
			if (authUser.isActive()) {
553
				if (!storeGuyMap.containsKey(authUser.getEmailId())) {
553
				if (!storeGuyMap.containsKey(authUser.getEmailId())) {
554
					storeGuyMap.put(authUser.getEmailId(), partnerEmails);
554
					storeGuyMap.put(authUser.getEmailId(), partnerIds);
555
				} else {
555
				} else {
556
					storeGuyMap.get(authUser.getEmailId()).addAll(partnerEmails);
556
					storeGuyMap.get(authUser.getEmailId()).addAll(partnerIds);
557
				}
557
				}
558
			}
558
			}
559
		}
559
		}
560
		return storeGuyMap;
560
		return storeGuyMap;
561
	}
561
	}
Line 646... Line 646...
646
			int authUserId = positionsMap.get(positionPartnerEntry.getKey()).getAuthUserId();
646
			int authUserId = positionsMap.get(positionPartnerEntry.getKey()).getAuthUserId();
647
			List<Integer> partnerIds = positionPartnerEntry.getValue().stream()
647
			List<Integer> partnerIds = positionPartnerEntry.getValue().stream()
648
					.filter(x -> activeFofoIds.contains(x.getPartnerId())).map(x -> x.getPartnerId())
648
					.filter(x -> activeFofoIds.contains(x.getPartnerId())).map(x -> x.getPartnerId())
649
					.collect(Collectors.toList());
649
					.collect(Collectors.toList());
650
			AuthUser authUser = authRepository.selectById(authUserId);
650
			AuthUser authUser = authRepository.selectById(authUserId);
651
			if (authUser.isActive()) {
651
			if (authUser != null && authUser.isActive()) {
652
				if (!storeGuyMap.containsKey(authUserId)) {
652
				if (!storeGuyMap.containsKey(authUserId)) {
653
					storeGuyMap.put(authUserId, partnerIds);
653
					storeGuyMap.put(authUserId, partnerIds);
654
				} else {
654
				} else {
655
					storeGuyMap.get(authUserId).addAll(partnerIds);
655
					storeGuyMap.get(authUserId).addAll(partnerIds);
656
				}
656
				}