| Line 99... |
Line 99... |
| 99 |
return typedQuerySimilar.getResultList();
|
99 |
return typedQuerySimilar.getResultList();
|
| 100 |
|
100 |
|
| 101 |
}
|
101 |
}
|
| 102 |
|
102 |
|
| 103 |
@Override
|
103 |
@Override
|
| - |
|
104 |
public List<WarehouseRbmTargetModel> getWarehouseWiseRbmMonthlyTarget(LocalDate monthStart) {
|
| - |
|
105 |
Session session = sessionFactory.getCurrentSession();
|
| - |
|
106 |
final TypedQuery<WarehouseRbmTargetModel> typedQuery = session.createNamedQuery("RbmTarget.getWarehouseWiseMonthlyTargetForMonth", WarehouseRbmTargetModel.class);
|
| - |
|
107 |
typedQuery.setParameter("targetMonthStart", monthStart);
|
| - |
|
108 |
typedQuery.setParameter("targetMonthEnd", monthStart.plusMonths(1));
|
| - |
|
109 |
return typedQuery.getResultList();
|
| - |
|
110 |
}
|
| - |
|
111 |
|
| - |
|
112 |
@Override
|
| 104 |
public List<MTDAchievedTargetModel> getDateWiseAchievedTargetOfRbm(LocalDate startDate, LocalDate endDate) {
|
113 |
public List<MTDAchievedTargetModel> getDateWiseAchievedTargetOfRbm(LocalDate startDate, LocalDate endDate) {
|
| - |
|
114 |
return getDateWiseAchievedTargetOfRbm(startDate, endDate, LocalDate.now().withDayOfMonth(1));
|
| - |
|
115 |
}
|
| - |
|
116 |
|
| - |
|
117 |
@Override
|
| - |
|
118 |
public List<MTDAchievedTargetModel> getDateWiseAchievedTargetOfRbm(LocalDate startDate, LocalDate endDate, LocalDate targetMonthStart) {
|
| 105 |
Session session = sessionFactory.getCurrentSession();
|
119 |
Session session = sessionFactory.getCurrentSession();
|
| 106 |
final TypedQuery<MTDAchievedTargetModel> typedQuerySimilar = session.createNamedQuery("RbmTarget.getRbmAchievedMonthlyTarget", MTDAchievedTargetModel.class);
|
120 |
final TypedQuery<MTDAchievedTargetModel> typedQuerySimilar = session.createNamedQuery("RbmTarget.getRbmAchievedMonthlyTarget", MTDAchievedTargetModel.class);
|
| 107 |
typedQuerySimilar.setParameter("startDate", startDate);
|
121 |
typedQuerySimilar.setParameter("startDate", startDate);
|
| 108 |
typedQuerySimilar.setParameter("endDate", endDate);
|
122 |
typedQuerySimilar.setParameter("endDate", endDate);
|
| - |
|
123 |
typedQuerySimilar.setParameter("targetMonthStart", targetMonthStart);
|
| - |
|
124 |
typedQuerySimilar.setParameter("targetMonthEnd", targetMonthStart.plusMonths(1));
|
| 109 |
return typedQuerySimilar.getResultList();
|
125 |
return typedQuerySimilar.getResultList();
|
| 110 |
|
- |
|
| 111 |
}
|
126 |
}
|
| 112 |
|
127 |
|
| 113 |
@Override
|
128 |
@Override
|
| 114 |
public List<TodayAchievedMovementModel> getMovementWiseAchievementByDate(LocalDate startDate, LocalDate endDate) {
|
129 |
public List<TodayAchievedMovementModel> getMovementWiseAchievementByDate(LocalDate startDate, LocalDate endDate) {
|
| 115 |
LOGGER.info("start date {}, end date {}", startDate, endDate);
|
130 |
LOGGER.info("start date {}, end date {}", startDate, endDate);
|
| Line 887... |
Line 902... |
| 887 |
typedQuerySimilar.setParameter("startDate", startDate);
|
902 |
typedQuerySimilar.setParameter("startDate", startDate);
|
| 888 |
typedQuerySimilar.setParameter("endDate", endDate);
|
903 |
typedQuerySimilar.setParameter("endDate", endDate);
|
| 889 |
return typedQuerySimilar.getResultList();
|
904 |
return typedQuerySimilar.getResultList();
|
| 890 |
}
|
905 |
}
|
| 891 |
|
906 |
|
| - |
|
907 |
// 2-arg form keeps its own @Cacheable because Spring's proxy-based caching
|
| - |
|
908 |
// is bypassed by in-class self-calls. Without this annotation, external
|
| - |
|
909 |
// callers of the 2-arg method (e.g. MonitorController.java:746 for the
|
| - |
|
910 |
// today_po_rbm page) would re-run the query on every request. Cache key
|
| - |
|
911 |
// uses (monthStart, monthEnd); targetMonthStart is always current-month
|
| - |
|
912 |
// for this path, so correctness matches the pre-refactor behavior.
|
| 892 |
@Override
|
913 |
@Override
|
| 893 |
@Cacheable(value = "rbmWeeklyBilling",
|
914 |
@Cacheable(value = "rbmWeeklyBilling",
|
| 894 |
cacheManager = "fiveMintimeoutCacheManager",
|
915 |
cacheManager = "fiveMintimeoutCacheManager",
|
| 895 |
sync = true)
|
916 |
sync = true)
|
| 896 |
public List<RbmWeeklyBillingModel> getWeeklyBillingDataForMonth(LocalDate monthStart, LocalDate monthEnd) {
|
917 |
public List<RbmWeeklyBillingModel> getWeeklyBillingDataForMonth(LocalDate monthStart, LocalDate monthEnd) {
|
| - |
|
918 |
return getWeeklyBillingDataForMonth(monthStart, monthEnd, LocalDate.now().withDayOfMonth(1));
|
| - |
|
919 |
}
|
| - |
|
920 |
|
| - |
|
921 |
@Override
|
| - |
|
922 |
@Cacheable(value = "rbmWeeklyBilling",
|
| - |
|
923 |
cacheManager = "fiveMintimeoutCacheManager",
|
| - |
|
924 |
sync = true)
|
| - |
|
925 |
public List<RbmWeeklyBillingModel> getWeeklyBillingDataForMonth(LocalDate monthStart, LocalDate monthEnd, LocalDate targetMonthStart) {
|
| 897 |
Session session = sessionFactory.getCurrentSession();
|
926 |
Session session = sessionFactory.getCurrentSession();
|
| 898 |
final TypedQuery<RbmWeeklyBillingModel> typedQuery = session.createNamedQuery("RBM.WeeklyBilling", RbmWeeklyBillingModel.class);
|
927 |
final TypedQuery<RbmWeeklyBillingModel> typedQuery = session.createNamedQuery("RBM.WeeklyBilling", RbmWeeklyBillingModel.class);
|
| 899 |
typedQuery.setParameter("startDate", monthStart);
|
928 |
typedQuery.setParameter("startDate", monthStart);
|
| 900 |
typedQuery.setParameter("endDate", monthEnd);
|
929 |
typedQuery.setParameter("endDate", monthEnd);
|
| - |
|
930 |
typedQuery.setParameter("targetMonthStart", targetMonthStart);
|
| - |
|
931 |
typedQuery.setParameter("targetMonthEnd", targetMonthStart.plusMonths(1));
|
| 901 |
return typedQuery.getResultList();
|
932 |
return typedQuery.getResultList();
|
| 902 |
}
|
933 |
}
|
| 903 |
|
934 |
|
| 904 |
public List<Our15DaysOldAgingStock> our15DaysAgingStock() {
|
935 |
public List<Our15DaysOldAgingStock> our15DaysAgingStock() {
|
| 905 |
Session session = sessionFactory.getCurrentSession();
|
936 |
Session session = sessionFactory.getCurrentSession();
|