| Line 29... |
Line 29... |
| 29 |
import com.spice.profitmandi.dao.entity.cs.Ticket;
|
29 |
import com.spice.profitmandi.dao.entity.cs.Ticket;
|
| 30 |
import com.spice.profitmandi.dao.entity.cs.TicketAssigned;
|
30 |
import com.spice.profitmandi.dao.entity.cs.TicketAssigned;
|
| 31 |
import com.spice.profitmandi.dao.entity.cs.TicketCategory;
|
31 |
import com.spice.profitmandi.dao.entity.cs.TicketCategory;
|
| 32 |
import com.spice.profitmandi.dao.entity.cs.TicketSubCategory;
|
32 |
import com.spice.profitmandi.dao.entity.cs.TicketSubCategory;
|
| 33 |
import com.spice.profitmandi.dao.entity.fofo.ActivityType;
|
33 |
import com.spice.profitmandi.dao.entity.fofo.ActivityType;
|
| 34 |
import com.spice.profitmandi.dao.entity.fofo.FofoStore;
|
- |
|
| 35 |
import com.spice.profitmandi.dao.enumuration.cs.EscalationType;
|
34 |
import com.spice.profitmandi.dao.enumuration.cs.EscalationType;
|
| 36 |
import com.spice.profitmandi.dao.repository.auth.AuthRepository;
|
35 |
import com.spice.profitmandi.dao.repository.auth.AuthRepository;
|
| 37 |
import com.spice.profitmandi.dao.repository.dtr.FofoStoreRepository;
|
36 |
import com.spice.profitmandi.dao.repository.dtr.FofoStoreRepository;
|
| 38 |
import com.spice.profitmandi.service.slab.TargetSlabService;
|
- |
|
| 39 |
import com.spice.profitmandi.service.user.RetailerService;
|
37 |
import com.spice.profitmandi.service.user.RetailerService;
|
| 40 |
|
38 |
|
| 41 |
@Component
|
39 |
@Component
|
| 42 |
public class CsServiceImpl implements CsService {
|
40 |
public class CsServiceImpl implements CsService {
|
| 43 |
|
41 |
|
| Line 81... |
Line 79... |
| 81 |
|
79 |
|
| 82 |
@Autowired
|
80 |
@Autowired
|
| 83 |
private PartnersPositionRepository partnersPositionRepository;
|
81 |
private PartnersPositionRepository partnersPositionRepository;
|
| 84 |
|
82 |
|
| 85 |
@Autowired
|
83 |
@Autowired
|
| 86 |
private TargetSlabService targetSlabService;
|
- |
|
| 87 |
|
- |
|
| 88 |
@Autowired
|
- |
|
| 89 |
private FofoStoreRepository fofoStoreRepository;
|
84 |
private FofoStoreRepository fofoStoreRepository;
|
| 90 |
|
85 |
|
| 91 |
@Override
|
86 |
@Override
|
| 92 |
public void createTicket(int fofoId, int categoryId, int subcategoryId, String message)
|
87 |
public void createTicket(int fofoId, int categoryId, int subcategoryId, String message)
|
| 93 |
throws ProfitMandiBusinessException {
|
88 |
throws ProfitMandiBusinessException {
|
| Line 481... |
Line 476... |
| 481 |
|
476 |
|
| 482 |
}
|
477 |
}
|
| 483 |
|
478 |
|
| 484 |
return positionIdAndpartnerRegionMap;
|
479 |
return positionIdAndpartnerRegionMap;
|
| 485 |
}
|
480 |
}
|
| - |
|
481 |
|
| - |
|
482 |
@Override
|
| - |
|
483 |
public Map<String, Set<String>> getAuthUserPartnerEmailMapping() {
|
| - |
|
484 |
Map<String, Set<String>> storeGuyMap = new HashMap<>();
|
| - |
|
485 |
Set<Integer> activeFofoIds = fofoStoreRepository.selectActiveStores().stream().map(x -> x.getId())
|
| - |
|
486 |
.collect(Collectors.toSet());
|
| - |
|
487 |
List<Position> categoryPositions = positionRepository
|
| - |
|
488 |
.selectPositionByCategoryId(ProfitMandiConstants.TICKET_CATEGORY_SALES);
|
| - |
|
489 |
Map<Integer, Position> positionsMap = categoryPositions.stream()
|
| - |
|
490 |
.collect(Collectors.toMap(x -> x.getId(), x -> x));
|
| - |
|
491 |
|
| - |
|
492 |
Map<Integer, List<CustomRetailer>> positonPartnerMap = this
|
| - |
|
493 |
.getPositionCustomRetailerMap(categoryPositions);
|
| - |
|
494 |
for (Map.Entry<Integer, List<CustomRetailer>> positionPartnerEntry : positonPartnerMap.entrySet()) {
|
| - |
|
495 |
int authUserId = positionsMap.get(positionPartnerEntry.getKey()).getAuthUserId();
|
| - |
|
496 |
Set<String> partnerEmails = positionPartnerEntry.getValue().stream()
|
| - |
|
497 |
.filter(x -> activeFofoIds.contains(x.getPartnerId())).map(x -> x.getEmail())
|
| - |
|
498 |
.collect(Collectors.toSet());
|
| - |
|
499 |
AuthUser authUser = authRepository.selectById(authUserId);
|
| - |
|
500 |
if (authUser.isActive()) {
|
| - |
|
501 |
storeGuyMap.put(authUser.getEmailId(), partnerEmails);
|
| - |
|
502 |
}
|
| - |
|
503 |
}
|
| - |
|
504 |
return storeGuyMap;
|
| - |
|
505 |
}
|
| 486 |
}
|
506 |
}
|