Subversion Repositories SmartDukaan

Rev

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

Rev 35702 Rev 35714
Line 1056... Line 1056...
1056
                            || t.getL5AuthUser() == authId)
1056
                            || t.getL5AuthUser() == authId)
1057
                    .map(Ticket::getFofoId)
1057
                    .map(Ticket::getFofoId)
1058
                    .distinct()
1058
                    .distinct()
1059
                    .collect(Collectors.toList());
1059
                    .collect(Collectors.toList());
1060
 
1060
 
1061
            // For L2, all escalated tickets are target
-
 
1062
            Set<Integer> targetFofoIds = new HashSet<>(fofoIdList);
-
 
1063
 
-
 
1064
            // Get today's remarks
1061
            // Get today's remarks created by L2
1065
            List<PartnerCollectionRemark> todayRemarks = partnerCollectionRemarkRepository
1062
            List<PartnerCollectionRemark> todayRemarks = partnerCollectionRemarkRepository
1066
                    .selectAllByAuthIdsOnDate(Collections.singletonList(authId), today);
1063
                    .selectAllByAuthIdsOnDate(Collections.singletonList(authId), today);
1067
 
1064
 
1068
            // Filter to only target partners and deduplicate
1065
            // Deduplicate by fofoId - keep latest remark per partner (list is ordered by id DESC)
1069
            Map<Integer, PartnerCollectionRemark> uniqueRemarksByFofoId = new LinkedHashMap<>();
1066
            Map<Integer, PartnerCollectionRemark> uniqueRemarksByFofoId = new LinkedHashMap<>();
1070
            for (PartnerCollectionRemark remark : todayRemarks) {
1067
            for (PartnerCollectionRemark remark : todayRemarks) {
1071
                if (targetFofoIds.contains(remark.getFofoId())) {
-
 
1072
                    uniqueRemarksByFofoId.putIfAbsent(remark.getFofoId(), remark);
1068
                uniqueRemarksByFofoId.putIfAbsent(remark.getFofoId(), remark);
1073
                }
-
 
1074
            }
1069
            }
1075
 
1070
 
1076
            return buildCalledPartnerResult(uniqueRemarksByFofoId);
1071
            return buildCalledPartnerResult(uniqueRemarksByFofoId);
1077
        }
1072
        }
1078
 
1073
 
Line 1161... Line 1156...
1161
                targetFofoIds.add(fofoId);
1156
                targetFofoIds.add(fofoId);
1162
            }
1157
            }
1163
            // rank 4 (FuturePlan) and rank 5 (Normal) are NOT in target
1158
            // rank 4 (FuturePlan) and rank 5 (Normal) are NOT in target
1164
        }
1159
        }
1165
 
1160
 
1166
        // Get today's remarks
1161
        // Get today's remarks created by L1
1167
        List<PartnerCollectionRemark> todayRemarks = partnerCollectionRemarkRepository
1162
        List<PartnerCollectionRemark> todayRemarks = partnerCollectionRemarkRepository
1168
                .selectAllByAuthIdsOnDate(Collections.singletonList(authId), today);
1163
                .selectAllByAuthIdsOnDate(Collections.singletonList(authId), today);
1169
 
1164
 
1170
        // Filter to only target partners and deduplicate
1165
        // Deduplicate by fofoId - keep latest remark per partner (list is ordered by id DESC)
1171
        Map<Integer, PartnerCollectionRemark> uniqueRemarksByFofoId = new LinkedHashMap<>();
1166
        Map<Integer, PartnerCollectionRemark> uniqueRemarksByFofoId = new LinkedHashMap<>();
1172
        for (PartnerCollectionRemark remark : todayRemarks) {
1167
        for (PartnerCollectionRemark remark : todayRemarks) {
1173
            if (targetFofoIds.contains(remark.getFofoId())) {
-
 
1174
                uniqueRemarksByFofoId.putIfAbsent(remark.getFofoId(), remark);
1168
            uniqueRemarksByFofoId.putIfAbsent(remark.getFofoId(), remark);
1175
            }
-
 
1176
        }
1169
        }
1177
 
1170
 
1178
        return buildCalledPartnerResult(uniqueRemarksByFofoId);
1171
        return buildCalledPartnerResult(uniqueRemarksByFofoId);
1179
    }
1172
    }
1180
 
1173