Subversion Repositories SmartDukaan

Rev

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

Rev 34276 Rev 34380
Line 992... Line 992...
992
 
992
 
993
        LOGGER.info("authUsers" + authUsers);
993
        LOGGER.info("authUsers" + authUsers);
994
        return authUsers;
994
        return authUsers;
995
    }
995
    }
996
 
996
 
997
    private class SaleRoles {
997
    private class SaleRoles1 {
998
 
998
 
999
        private List<String> l1;
999
        private List<String> l1;
1000
        private List<String> l2;
1000
        private List<String> l2;
1001
        private List<String> l3;
1001
        private List<String> l3;
1002
        private List<String> l4;
1002
        private List<String> l4;
1003
 
1003
 
1004
        public SaleRoles() {
1004
        public SaleRoles1() {
1005
            l1 = new ArrayList<>();
1005
            l1 = new ArrayList<>();
1006
            l2 = new ArrayList<>();
1006
            l2 = new ArrayList<>();
1007
            l3 = new ArrayList<>();
1007
            l3 = new ArrayList<>();
1008
            l4 = new ArrayList<>();
1008
            l4 = new ArrayList<>();
1009
        }
1009
        }
Line 1033... Line 1033...
1033
 
1033
 
1034
 
1034
 
1035
    @Override
1035
    @Override
1036
    @Cacheable(value = "partnerSaleHeader", cacheManager = "oneDayCacheManager")
1036
    @Cacheable(value = "partnerSaleHeader", cacheManager = "oneDayCacheManager")
1037
    public Map<Integer, FofoReportingModel> getPartnerIdSalesHeaders() throws ProfitMandiBusinessException {
1037
    public Map<Integer, FofoReportingModel> getPartnerIdSalesHeaders() throws ProfitMandiBusinessException {
1038
        Map<String, SaleRoles> partnerEmailSalesMap = new HashMap<>();
1038
        Map<String, SaleRoles1> partnerEmailSalesMap = new HashMap<>();
1039
 
1039
 
1040
        List<Position> positions = positionRepository.selectPositionByCategoryId(ProfitMandiConstants.TICKET_CATEGORY_SALES);
1040
        List<Position> positions = positionRepository.selectPositionByCategoryId(ProfitMandiConstants.TICKET_CATEGORY_SALES);
1041
        Map<Integer, AuthUser> authUsersMap = authRepository.selectAllActiveUser().stream().collect(Collectors.toMap(x -> x.getId(), x -> x));
1041
        Map<Integer, AuthUser> authUsersMap = authRepository.selectAllActiveUser().stream().collect(Collectors.toMap(x -> x.getId(), x -> x));
1042
        Map<Integer, List<CustomRetailer>> positionIdRetailerMap = this.getPositionCustomRetailerMap(positions);
1042
        Map<Integer, List<CustomRetailer>> positionIdRetailerMap = this.getPositionCustomRetailerMap(positions);
1043
        for (Position position : positions) {
1043
        for (Position position : positions) {
1044
            List<CustomRetailer> crList = positionIdRetailerMap.get(position.getId());
1044
            List<CustomRetailer> crList = positionIdRetailerMap.get(position.getId());
1045
            if (crList == null)
1045
            if (crList == null)
1046
                continue;
1046
                continue;
1047
            for (CustomRetailer cr : crList) {
1047
            for (CustomRetailer cr : crList) {
1048
                if (!partnerEmailSalesMap.containsKey(cr.getEmail())) {
1048
                if (!partnerEmailSalesMap.containsKey(cr.getEmail())) {
1049
                    partnerEmailSalesMap.put(cr.getEmail(), new SaleRoles());
1049
                    partnerEmailSalesMap.put(cr.getEmail(), new SaleRoles1());
1050
                }
1050
                }
1051
                SaleRoles saleRoles = partnerEmailSalesMap.get(cr.getEmail());
1051
                SaleRoles1 saleRoles1 = partnerEmailSalesMap.get(cr.getEmail());
1052
                AuthUser authUser = authUsersMap.get(position.getAuthUserId());
1052
                AuthUser authUser = authUsersMap.get(position.getAuthUserId());
1053
                if (authUser == null) {
1053
                if (authUser == null) {
1054
                    continue;
1054
                    continue;
1055
                }
1055
                }
1056
                String name = authUser.getFirstName() + " " + authUser.getLastName();
1056
                String name = authUser.getFirstName() + " " + authUser.getLastName();
1057
                if (position.getEscalationType().equals(EscalationType.L1)) {
1057
                if (position.getEscalationType().equals(EscalationType.L1)) {
1058
                    saleRoles.getL1().add(name);
1058
                    saleRoles1.getL1().add(name);
1059
                } else if (position.getEscalationType().equals(EscalationType.L2)) {
1059
                } else if (position.getEscalationType().equals(EscalationType.L2)) {
1060
                    saleRoles.getL2().add(name);
1060
                    saleRoles1.getL2().add(name);
1061
                }
1061
                }
1062
 
1062
 
1063
            }
1063
            }
1064
        }
1064
        }
1065
 
1065