| Line 71... |
Line 71... |
| 71 |
|
71 |
|
| 72 |
@Autowired
|
72 |
@Autowired
|
| 73 |
private TicketAssignedRepository ticketAssignedRepository;
|
73 |
private TicketAssignedRepository ticketAssignedRepository;
|
| 74 |
|
74 |
|
| 75 |
@Autowired
|
75 |
@Autowired
|
| 76 |
private PartnersPositionRepository partnersPositionRepository;
|
76 |
private PartnerPositionRepository partnerPositionRepository;
|
| 77 |
|
77 |
|
| 78 |
@Autowired
|
78 |
@Autowired
|
| 79 |
private FofoStoreRepository fofoStoreRepository;
|
79 |
private FofoStoreRepository fofoStoreRepository;
|
| 80 |
|
80 |
|
| 81 |
@Override
|
81 |
@Override
|
| Line 322... |
Line 322... |
| 322 |
List<Position> positions = positionRepository.selectPositionbyCategoryIdAndEscalationType(categoryId, escalationType);
|
322 |
List<Position> positions = positionRepository.selectPositionbyCategoryIdAndEscalationType(categoryId, escalationType);
|
| 323 |
List<Integer> regionIds = partnerRegionRepository.selectByfofoId(fofoId).stream().map(x -> x.getRegionId()).collect(Collectors.toList());
|
323 |
List<Integer> regionIds = partnerRegionRepository.selectByfofoId(fofoId).stream().map(x -> x.getRegionId()).collect(Collectors.toList());
|
| 324 |
// Add all Partner regions id
|
324 |
// Add all Partner regions id
|
| 325 |
regionIds.add(ALL_PARTNERS_REGION);
|
325 |
regionIds.add(ALL_PARTNERS_REGION);
|
| 326 |
LOGGER.info("Escalation Type {}, Region Ids {}", escalationType, regionIds);
|
326 |
LOGGER.info("Escalation Type {}, Region Ids {}", escalationType, regionIds);
|
| 327 |
List<Integer> partnerPositionsIds = partnersPositionRepository.selectByRegionIdAndPartnerId(regionIds, Arrays.asList(0, fofoId)).stream().map(x -> x.getPositionId()).collect(Collectors.toList());
|
327 |
List<Integer> partnerPositionsIds = partnerPositionRepository.selectByRegionIdAndPartnerId(regionIds, Arrays.asList(0, fofoId)).stream().map(x -> x.getPositionId()).collect(Collectors.toList());
|
| 328 |
List<Position> positionAssignee = positions.stream().filter(x -> x.isTicketAssignee() && partnerPositionsIds.contains(x.getId())).collect(Collectors.toList());
|
328 |
List<Position> positionAssignee = positions.stream().filter(x -> x.isTicketAssignee() && partnerPositionsIds.contains(x.getId())).collect(Collectors.toList());
|
| 329 |
LOGGER.info("User List List {}", positions.stream().map(x -> x.getAuthUserId()).collect(Collectors.toList()));
|
329 |
LOGGER.info("User List List {}", positions.stream().map(x -> x.getAuthUserId()).collect(Collectors.toList()));
|
| 330 |
if (positionAssignee.size() > 0) {
|
330 |
if (positionAssignee.size() > 0) {
|
| 331 |
List<AuthUser> authUsers = authRepository.selectAllAuthUserByIds(
|
331 |
List<AuthUser> authUsers = authRepository.selectAllAuthUserByIds(
|
| 332 |
positions.stream().map(x -> x.getAuthUserId()).collect(Collectors.toList()));
|
332 |
positions.stream().map(x -> x.getAuthUserId()).collect(Collectors.toList()));
|
| Line 473... |
Line 473... |
| 473 |
@Override
|
473 |
@Override
|
| 474 |
public Map<Integer, List<CustomRetailer>> getPositionCustomRetailerMap(List<Position> positions) {
|
474 |
public Map<Integer, List<CustomRetailer>> getPositionCustomRetailerMap(List<Position> positions) {
|
| 475 |
Map<Integer, CustomRetailer> customRetailerMap = retailerService.getAllFofoRetailers();
|
475 |
Map<Integer, CustomRetailer> customRetailerMap = retailerService.getAllFofoRetailers();
|
| 476 |
Map<Integer, List<CustomRetailer>> positionRetailerMap = new HashMap<>();
|
476 |
Map<Integer, List<CustomRetailer>> positionRetailerMap = new HashMap<>();
|
| 477 |
for (Position position : positions) {
|
477 |
for (Position position : positions) {
|
| 478 |
List<Integer> fofoIds = partnersPositionRepository.selectByPositionId(position.getId()).stream().map(x -> x.getFofoId()).collect(Collectors.toList());
|
478 |
List<Integer> fofoIds = partnerPositionRepository.selectByPositionId(position.getId()).stream().map(x -> x.getFofoId()).collect(Collectors.toList());
|
| 479 |
|
479 |
|
| 480 |
LOGGER.info("fofoIds - {}", fofoIds);
|
480 |
LOGGER.info("fofoIds - {}", fofoIds);
|
| 481 |
if (!fofoIds.isEmpty()) {
|
481 |
if (!fofoIds.isEmpty()) {
|
| 482 |
if (fofoIds.contains(0)) {
|
482 |
if (fofoIds.contains(0)) {
|
| 483 |
fofoIds = partnerRegionRepository.selectByRegionId(position.getRegionId()).stream().map(x -> x.getFofoId()).collect(Collectors.toList());
|
483 |
fofoIds = partnerRegionRepository.selectByRegionId(position.getRegionId()).stream().map(x -> x.getFofoId()).collect(Collectors.toList());
|
| Line 605... |
Line 605... |
| 605 |
List<String> emails = new ArrayList<>();
|
605 |
List<String> emails = new ArrayList<>();
|
| 606 |
List<Integer> regionIds = partnerRegionRepository.selectByfofoId(fofoId).stream().map(x -> x.getRegionId()).collect(Collectors.toList());
|
606 |
List<Integer> regionIds = partnerRegionRepository.selectByfofoId(fofoId).stream().map(x -> x.getRegionId()).collect(Collectors.toList());
|
| 607 |
|
607 |
|
| 608 |
regionIds.add(5);// All partners Id;
|
608 |
regionIds.add(5);// All partners Id;
|
| 609 |
|
609 |
|
| 610 |
List<Integer> partnerPositionIds = partnersPositionRepository.selectByRegionIdAndPartnerId(regionIds, Arrays.asList(fofoId, 0)).stream().map(x -> x.getPositionId()).collect(Collectors.toList());
|
610 |
List<Integer> partnerPositionIds = partnerPositionRepository.selectByRegionIdAndPartnerId(regionIds, Arrays.asList(fofoId, 0)).stream().map(x -> x.getPositionId()).collect(Collectors.toList());
|
| 611 |
|
611 |
|
| 612 |
LOGGER.info("partnerPositionIds" + partnerPositionIds);
|
612 |
LOGGER.info("partnerPositionIds" + partnerPositionIds);
|
| 613 |
|
613 |
|
| 614 |
List<Position> positions = positionRepository.selectAll(partnerPositionIds);
|
614 |
List<Position> positions = positionRepository.selectAll(partnerPositionIds);
|
| 615 |
|
615 |
|
| Line 638... |
Line 638... |
| 638 |
List<Integer> fofoIds = new ArrayList<>();
|
638 |
List<Integer> fofoIds = new ArrayList<>();
|
| 639 |
fofoIds.add(fofoId);
|
639 |
fofoIds.add(fofoId);
|
| 640 |
fofoIds.add(0);
|
640 |
fofoIds.add(0);
|
| 641 |
|
641 |
|
| 642 |
LOGGER.info("fofoIds" + fofoIds);
|
642 |
LOGGER.info("fofoIds" + fofoIds);
|
| 643 |
List<Integer> partnerPositionIds = partnersPositionRepository.selectByRegionIdAndPartnerId(regionIds, fofoIds).stream().map(x -> x.getPositionId()).collect(Collectors.toList());
|
643 |
List<Integer> partnerPositionIds = partnerPositionRepository.selectByRegionIdAndPartnerId(regionIds, fofoIds).stream().map(x -> x.getPositionId()).collect(Collectors.toList());
|
| 644 |
|
644 |
|
| 645 |
LOGGER.info("partnerPositionIds" + partnerPositionIds);
|
645 |
LOGGER.info("partnerPositionIds" + partnerPositionIds);
|
| 646 |
|
646 |
|
| 647 |
for (Integer partnerPostionId : partnerPositionIds) {
|
647 |
for (Integer partnerPostionId : partnerPositionIds) {
|
| 648 |
Position position = positionRepository.selectByIdAndCategoryId(partnerPostionId, ProfitMandiConstants.TICKET_CATEGORY_SALES);
|
648 |
Position position = positionRepository.selectByIdAndCategoryId(partnerPostionId, ProfitMandiConstants.TICKET_CATEGORY_SALES);
|
| Line 754... |
Line 754... |
| 754 |
List<Integer> fofoIds = new ArrayList<>();
|
754 |
List<Integer> fofoIds = new ArrayList<>();
|
| 755 |
fofoIds.add(fofoId);
|
755 |
fofoIds.add(fofoId);
|
| 756 |
fofoIds.add(0);
|
756 |
fofoIds.add(0);
|
| 757 |
|
757 |
|
| 758 |
LOGGER.info("fofoIds" + fofoIds);
|
758 |
LOGGER.info("fofoIds" + fofoIds);
|
| 759 |
List<Integer> partnerPositionIds = partnersPositionRepository.selectByRegionIdAndPartnerId(regionIds, fofoIds).stream().map(x -> x.getPositionId()).collect(Collectors.toList());
|
759 |
List<Integer> partnerPositionIds = partnerPositionRepository.selectByRegionIdAndPartnerId(regionIds, fofoIds).stream().map(x -> x.getPositionId()).collect(Collectors.toList());
|
| 760 |
|
760 |
|
| 761 |
LOGGER.info("partnerPositionIds" + partnerPositionIds);
|
761 |
LOGGER.info("partnerPositionIds" + partnerPositionIds);
|
| 762 |
|
762 |
|
| 763 |
for (Integer partnerPostionId : partnerPositionIds) {
|
763 |
for (Integer partnerPostionId : partnerPositionIds) {
|
| 764 |
Position position = positionRepository.selectByIdAndCategoryId(partnerPostionId, ProfitMandiConstants.TICKET_CATEGORY_SALES);
|
764 |
Position position = positionRepository.selectByIdAndCategoryId(partnerPostionId, ProfitMandiConstants.TICKET_CATEGORY_SALES);
|
| Line 786... |
Line 786... |
| 786 |
List<Integer> fofoIds = new ArrayList<>();
|
786 |
List<Integer> fofoIds = new ArrayList<>();
|
| 787 |
fofoIds.add(fofoId);
|
787 |
fofoIds.add(fofoId);
|
| 788 |
fofoIds.add(0);
|
788 |
fofoIds.add(0);
|
| 789 |
|
789 |
|
| 790 |
LOGGER.info("fofoIds" + fofoIds);
|
790 |
LOGGER.info("fofoIds" + fofoIds);
|
| 791 |
List<Integer> partnerPositionIds = partnersPositionRepository.selectByRegionIdAndPartnerId(regionIds, fofoIds).stream().map(x -> x.getPositionId()).collect(Collectors.toList());
|
791 |
List<Integer> partnerPositionIds = partnerPositionRepository.selectByRegionIdAndPartnerId(regionIds, fofoIds).stream().map(x -> x.getPositionId()).collect(Collectors.toList());
|
| 792 |
|
792 |
|
| 793 |
LOGGER.info("partnerPositionIds" + partnerPositionIds);
|
793 |
LOGGER.info("partnerPositionIds" + partnerPositionIds);
|
| 794 |
|
794 |
|
| 795 |
for (Integer partnerPostionId : partnerPositionIds) {
|
795 |
for (Integer partnerPostionId : partnerPositionIds) {
|
| 796 |
Position position = positionRepository.selectByIdAndCategoryId(partnerPostionId, ProfitMandiConstants.TICKET_CATEGORY_SALES);
|
796 |
Position position = positionRepository.selectByIdAndCategoryId(partnerPostionId, ProfitMandiConstants.TICKET_CATEGORY_SALES);
|