Subversion Repositories SmartDukaan

Rev

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

Rev 37892 Rev 37894
Line 1788... Line 1788...
1788
     *  the shipped monthly-email cron. */
1788
     *  the shipped monthly-email cron. */
1789
    private static final String[] RBM_RANK_PROBE_RECIPIENTS = {
1789
    private static final String[] RBM_RANK_PROBE_RECIPIENTS = {
1790
//            "gaurav.mathur@smartdukaan.com",
1790
//            "gaurav.mathur@smartdukaan.com",
1791
//            "kangan.monga@smartdukaan.com",
1791
//            "kangan.monga@smartdukaan.com",
1792
//            "siddharth.chaturvedi@smartdukaan.com",
1792
//            "siddharth.chaturvedi@smartdukaan.com",
1793
//            "aquil.ahmad@smartdukaan.com",
1793
////            "aquil.ahmad@smartdukaan.com",
1794
//            "charu.sharma@smartdukaan.com",
1794
//            "charu.sharma@smartdukaan.com",
1795
            "ranu.rajput@smartdukaan.com"
1795
            "ranu.rajput@smartdukaan.com"
1796
    };
1796
    };
1797
 
1797
 
1798
    /**
1798
    /**
Line 1881... Line 1881...
1881
                    dm.getAbove1LPct(), dm.getPartnerRating(), ratedPct,
1881
                    dm.getAbove1LPct(), dm.getPartnerRating(), ratedPct,
1882
                    dm.getCompositeScore()));
1882
                    dm.getCompositeScore()));
1883
        }
1883
        }
1884
        LOGGER.info("[RBM-RANK] === End ranking for {} ===", month);
1884
        LOGGER.info("[RBM-RANK] === End ranking for {} ===", month);
1885
 
1885
 
1886
        // Email disabled while verifying data gaps — check logs only.
1886
        // Email the same table so the user can eyeball without tailing logs.
1887
        // try {
1887
        try {
1888
        //     sendRbmRankingProbeEmail(month, from, to, ranked);
1888
            sendRbmRankingProbeEmail(month, from, to, ranked);
1889
        // } catch (Exception e) {
1889
        } catch (Exception e) {
1890
        //     LOGGER.error("[RBM-RANK] Email send FAILED (log-only fallback in place): {}", e.getMessage(), e);
1890
            LOGGER.error("[RBM-RANK] Email send FAILED (log-only fallback in place): {}", e.getMessage(), e);
1891
        // }
1891
        }
1892
    }
1892
    }
1893
 
1893
 
1894
    /** Direct HTML send via googleMailSender — bypasses mail_outbox so dev delivers. */
1894
    /** Direct HTML send via googleMailSender — bypasses mail_outbox so dev delivers. */
1895
    private void sendRbmRankingProbeEmail(java.time.YearMonth month, LocalDate from, LocalDate to,
1895
    private void sendRbmRankingProbeEmail(java.time.YearMonth month, LocalDate from, LocalDate to,
1896
                                          List<RbmPerformanceDashboardModel> ranked) throws Exception {
1896
                                          List<RbmPerformanceDashboardModel> ranked) throws Exception {
Line 1904... Line 1904...
1904
        body.append("<p style='color:#555;font-size:12px'>Score formula: Talk(10%) + DRR(55%) + Aging(2%) + &gt;1L(29%) + Rating(2%) + Rated(2%).</p>");
1904
        body.append("<p style='color:#555;font-size:12px'>Score formula: Talk(10%) + DRR(55%) + Aging(2%) + &gt;1L(29%) + Rating(2%) + Rated(2%).</p>");
1905
        body.append("<table border='1' cellpadding='6' cellspacing='0' style='border-collapse:collapse;font-size:12px'>");
1905
        body.append("<table border='1' cellpadding='6' cellspacing='0' style='border-collapse:collapse;font-size:12px'>");
1906
        body.append("<thead><tr style='background:#343a40;color:#fff'>")
1906
        body.append("<thead><tr style='background:#343a40;color:#fff'>")
1907
            .append("<th>Rank</th><th style='text-align:left'>RBM</th><th>Partners</th>")
1907
            .append("<th>Rank</th><th style='text-align:left'>RBM</th><th>Partners</th>")
1908
            .append("<th style='background:#28a745'>Talk%<br><small>(10%)</small></th>")
1908
            .append("<th style='background:#28a745'>Talk%<br><small>(10%)</small></th>")
-
 
1909
            .append("<th style='background:#20c997'>Target<br><small>(Lakh)</small></th>")
-
 
1910
            .append("<th style='background:#0dcaf0;color:#000'>Secondary<br><small>(Lakh)</small></th>")
1909
            .append("<th style='background:#17a2b8'>DRR%<br><small>(55%)</small></th>")
1911
            .append("<th style='background:#17a2b8'>DRR%<br><small>(55%)</small></th>")
1910
            .append("<th style='background:#fd7e14'>Aging%<br><small>(2%)</small></th>")
1912
            .append("<th style='background:#fd7e14'>Aging%<br><small>(2%)</small></th>")
1911
            .append("<th style='background:#6f42c1'>&gt;1L%<br><small>(29%)</small></th>")
1913
            .append("<th style='background:#6f42c1'>&gt;1L%<br><small>(29%)</small></th>")
1912
            .append("<th style='background:#ffc107;color:#000'>Rating<br><small>(2%)</small></th>")
1914
            .append("<th style='background:#ffc107;color:#000'>Rating<br><small>(2%)</small></th>")
1913
            .append("<th style='background:#e67e22'>Rated%<br><small>(2%)</small></th>")
1915
            .append("<th style='background:#e67e22'>Rated%<br><small>(2%)</small></th>")
Line 1922... Line 1924...
1922
            body.append("<tr style='").append(rowStyle).append("'>")
1924
            body.append("<tr style='").append(rowStyle).append("'>")
1923
                .append("<td style='text-align:center'>").append(dm.getRank()).append("</td>")
1925
                .append("<td style='text-align:center'>").append(dm.getRank()).append("</td>")
1924
                .append("<td>").append(escapeHtml(dm.getRbmName())).append("</td>")
1926
                .append("<td>").append(escapeHtml(dm.getRbmName())).append("</td>")
1925
                .append("<td style='text-align:center'>").append(dm.getPartnerCount()).append("</td>")
1927
                .append("<td style='text-align:center'>").append(dm.getPartnerCount()).append("</td>")
1926
                .append("<td style='text-align:right'>").append(String.format("%.1f%%", dm.getTalkPct())).append("</td>")
1928
                .append("<td style='text-align:right'>").append(String.format("%.1f%%", dm.getTalkPct())).append("</td>")
-
 
1929
                .append("<td style='text-align:right'>").append(String.format("%.1fL", dm.getMonthlyTarget() / 100000.0)).append("</td>")
-
 
1930
                .append("<td style='text-align:right'>").append(String.format("%.1fL", dm.getMtdAchieved()   / 100000.0)).append("</td>")
1927
                .append("<td style='text-align:right'>").append(String.format("%.1f%%", dm.getDrrAchvPct())).append("</td>")
1931
                .append("<td style='text-align:right'>").append(String.format("%.1f%%", dm.getDrrAchvPct())).append("</td>")
1928
                .append("<td style='text-align:right'>").append(String.format("%.1f%%", dm.getAgingPct())).append("</td>")
1932
                .append("<td style='text-align:right'>").append(String.format("%.1f%%", dm.getAgingPct())).append("</td>")
1929
                .append("<td style='text-align:right'>").append(String.format("%.1f%%", dm.getAbove1LPct())).append("</td>")
1933
                .append("<td style='text-align:right'>").append(String.format("%.1f%%", dm.getAbove1LPct())).append("</td>")
1930
                .append("<td style='text-align:center'>").append(String.format("%.2f", dm.getPartnerRating())).append(" ★</td>")
1934
                .append("<td style='text-align:center'>").append(String.format("%.2f", dm.getPartnerRating())).append(" ★</td>")
1931
                .append("<td style='text-align:right'>").append(String.format("%.1f%%", ratedPct)).append("</td>")
1935
                .append("<td style='text-align:right'>").append(String.format("%.1f%%", ratedPct)).append("</td>")