| Line 883... |
Line 883... |
| 883 |
|
883 |
|
| 884 |
// Fetch fofoIds with MTD billing above threshold (20000)
|
884 |
// Fetch fofoIds with MTD billing above threshold (20000)
|
| 885 |
// Optimized: direct query on orders table instead of complex RBM query
|
885 |
// Optimized: direct query on orders table instead of complex RBM query
|
| 886 |
LocalDateTime mtdStartDate = LocalDate.now().withDayOfMonth(1).atStartOfDay();
|
886 |
LocalDateTime mtdStartDate = LocalDate.now().withDayOfMonth(1).atStartOfDay();
|
| 887 |
LocalDateTime mtdEndDate = LocalDate.now().plusDays(1).atStartOfDay();
|
887 |
LocalDateTime mtdEndDate = LocalDate.now().plusDays(1).atStartOfDay();
|
| 888 |
long billingThreshold = 20000L; // Same as RbmWeeklyBillingModel.BILLING_THRESHOLD
|
888 |
long billingThreshold = 1000L; // Same as RbmWeeklyBillingModel.BILLING_THRESHOLD
|
| 889 |
Set<Integer> allMtdBilledFofoIds = orderRepository.selectFofoIdsWithMtdBillingAboveThreshold(
|
889 |
Set<Integer> allMtdBilledFofoIds = orderRepository.selectFofoIdsWithMtdBillingAboveThreshold(
|
| 890 |
fofoIdList, mtdStartDate, mtdEndDate, billingThreshold);
|
890 |
fofoIdList, mtdStartDate, mtdEndDate, billingThreshold);
|
| 891 |
LOGGER.info("PERF: selectFofoIdsWithMtdBillingAboveThreshold took {} ms", System.currentTimeMillis() - lapTime);
|
891 |
LOGGER.info("PERF: selectFofoIdsWithMtdBillingAboveThreshold took {} ms", System.currentTimeMillis() - lapTime);
|
| 892 |
lapTime = System.currentTimeMillis();
|
892 |
lapTime = System.currentTimeMillis();
|
| 893 |
|
893 |
|