| Line 505... |
Line 505... |
| 505 |
}
|
505 |
}
|
| 506 |
return storeGuyMap;
|
506 |
return storeGuyMap;
|
| 507 |
}
|
507 |
}
|
| 508 |
|
508 |
|
| 509 |
@Override
|
509 |
@Override
|
| - |
|
510 |
@Cacheable(value = "authUserEmailPartnerIdMapping", cacheManager = "thirtyMinsTimeOutCacheManager")
|
| 510 |
public Map<String, Set<Integer>> getAuthUserPartnerIdMapping() {
|
511 |
public Map<String, Set<Integer>> getAuthUserPartnerIdMapping() {
|
| 511 |
Map<String, Set<Integer>> storeGuyMap = new HashMap<>();
|
512 |
Map<String, Set<Integer>> storeGuyMap = new HashMap<>();
|
| 512 |
|
- |
|
| - |
|
513 |
Set<Integer> activeFofoIds = fofoStoreRepository.selectActiveStores().stream().map(x -> x.getId())
|
| - |
|
514 |
.collect(Collectors.toSet());
|
| 513 |
List<Position> categoryPositions = positionRepository
|
515 |
List<Position> categoryPositions = positionRepository
|
| 514 |
.selectPositionByCategoryId(ProfitMandiConstants.TICKET_CATEGORY_SALES);
|
516 |
.selectPositionByCategoryId(ProfitMandiConstants.TICKET_CATEGORY_SALES);
|
| 515 |
Map<Integer, Position> positionsMap = categoryPositions.stream()
|
517 |
Map<Integer, Position> positionsMap = categoryPositions.stream()
|
| 516 |
.collect(Collectors.toMap(x -> x.getId(), x -> x));
|
518 |
.collect(Collectors.toMap(x -> x.getId(), x -> x));
|
| 517 |
|
519 |
|
| 518 |
Map<Integer, List<CustomRetailer>> positonPartnerMap = this.getPositionCustomRetailerMap(categoryPositions);
|
520 |
Map<Integer, List<CustomRetailer>> positonPartnerMap = this.getPositionCustomRetailerMap(categoryPositions);
|
| 519 |
for (Map.Entry<Integer, List<CustomRetailer>> positionPartnerEntry : positonPartnerMap.entrySet()) {
|
521 |
for (Map.Entry<Integer, List<CustomRetailer>> positionPartnerEntry : positonPartnerMap.entrySet()) {
|
| 520 |
int authUserId = positionsMap.get(positionPartnerEntry.getKey()).getAuthUserId();
|
522 |
int authUserId = positionsMap.get(positionPartnerEntry.getKey()).getAuthUserId();
|
| 521 |
|
- |
|
| - |
|
523 |
Set<Integer> partnerEmails = positionPartnerEntry.getValue().stream()
|
| 522 |
Set<Integer> activeFofoIds = fofoStoreRepository.selectActiveStores().stream().map(x -> x.getId())
|
524 |
.filter(x -> activeFofoIds.contains(x.getPartnerId())).map(x -> x.getPartnerId())
|
| 523 |
.collect(Collectors.toSet());
|
525 |
.collect(Collectors.toSet());
|
| 524 |
/*
|
- |
|
| 525 |
* Set<String> partnerEmails = positionPartnerEntry.getValue().stream()
|
- |
|
| 526 |
* .filter(x -> activeFofoIds.contains(x.getPartnerId())).map(x -> x.getEmail())
|
- |
|
| 527 |
* .collect(Collectors.toSet());
|
- |
|
| 528 |
*/
|
- |
|
| 529 |
AuthUser authUser = authRepository.selectById(authUserId);
|
526 |
AuthUser authUser = authRepository.selectById(authUserId);
|
| 530 |
if (authUser.isActive()) {
|
527 |
if (authUser.isActive()) {
|
| 531 |
storeGuyMap.put(authUser.getEmailId(), activeFofoIds);
|
528 |
storeGuyMap.put(authUser.getEmailId(), partnerEmails);
|
| 532 |
}
|
529 |
}
|
| 533 |
}
|
530 |
}
|
| 534 |
return storeGuyMap;
|
531 |
return storeGuyMap;
|
| 535 |
}
|
532 |
}
|
| 536 |
|
533 |
|