Subversion Repositories SmartDukaan

Rev

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

Rev 36994 Rev 36996
Line 1861... Line 1861...
1861
            }
1861
            }
1862
        } catch (Exception e) {
1862
        } catch (Exception e) {
1863
            LOGGER.error("Error building latest call status map for all raw data", e);
1863
            LOGGER.error("Error building latest call status map for all raw data", e);
1864
        }
1864
        }
1865
 
1865
 
1866
        // Track processed fofoIds to avoid duplicates (a party assigned to L1 RBM
-
 
1867
        // should not appear again under another RBM who also has it via L2 position)
-
 
1868
        Set<Integer> processedFofoIds = new HashSet<>();
-
 
1869
 
-
 
1870
        // Process each L1 RBM
1866
        // Process each L1 RBM
-
 
1867
        // Note: no cross-RBM dedup — a partner assigned to multiple RBMs appears once per RBM,
-
 
1868
        // matching the UI summary counts so row totals per RBM equal that RBM's "Calling Target".
1871
        for (int rbmAuthId : l1AuthIds) {
1869
        for (int rbmAuthId : l1AuthIds) {
1872
            AuthUser authUser = authUserMap.get(rbmAuthId);
1870
            AuthUser authUser = authUserMap.get(rbmAuthId);
1873
            if (authUser == null || !storeGuyMap.containsKey(authUser.getEmailId())) {
1871
            if (authUser == null || !storeGuyMap.containsKey(authUser.getEmailId())) {
1874
                continue;
1872
                continue;
1875
            }
1873
            }
Line 1913... Line 1911...
1913
                    })
1911
                    })
1914
                    .collect(Collectors.toList());
1912
                    .collect(Collectors.toList());
1915
 
1913
 
1916
            String rbmName = authUser.getFullName();
1914
            String rbmName = authUser.getFullName();
1917
 
1915
 
1918
            // Categorize each partner and add row (skip if already processed under another RBM)
1916
            // Categorize each partner and add a row per RBM assignment.
1919
            for (Integer fofoId : validFofoIds) {
1917
            for (Integer fofoId : validFofoIds) {
1920
                if (processedFofoIds.contains(fofoId)) {
-
 
1921
                    continue; // Already added under another L1 RBM
-
 
1922
                }
-
 
1923
 
-
 
1924
                int rank = allCollectionRankMap.getOrDefault(fofoId, 5);
1918
                int rank = allCollectionRankMap.getOrDefault(fofoId, 5);
1925
                boolean hasZeroBilling = !allMtdBilledFofoIds.contains(fofoId);
1919
                boolean hasZeroBilling = !allMtdBilledFofoIds.contains(fofoId);
1926
 
1920
 
1927
                String status;
1921
                String status;
1928
                if (rank == 1) {
1922
                if (rank == 1) {
Line 1935... Line 1929...
1935
                    status = "Untouched";
1929
                    status = "Untouched";
1936
                } else {
1930
                } else {
1937
                    continue; // Skip Future Plan and Normal — only include calling target parties
1931
                    continue; // Skip Future Plan and Normal — only include calling target parties
1938
                }
1932
                }
1939
 
1933
 
1940
                processedFofoIds.add(fofoId);
-
 
1941
 
-
 
1942
                CustomRetailer retailer = retailerMap.get(fofoId);
1934
                CustomRetailer retailer = retailerMap.get(fofoId);
1943
                String partnerName = retailer != null ? retailer.getBusinessName() : "Unknown (" + fofoId + ")";
1935
                String partnerName = retailer != null ? retailer.getBusinessName() : "Unknown (" + fofoId + ")";
1944
                String partnerCode = retailer != null ? retailer.getCode() : "-";
1936
                String partnerCode = retailer != null ? retailer.getCode() : "-";
1945
 
1937
 
1946
                // "Did Not Try" means the PARTNER has no call log today from anyone — not tied to this RBM.
1938
                // "Did Not Try" means the PARTNER has no call log today from anyone — not tied to this RBM.