| Line 36... |
Line 36... |
| 36 |
import com.spice.profitmandi.service.user.RetailerService;
|
36 |
import com.spice.profitmandi.service.user.RetailerService;
|
| 37 |
import org.apache.logging.log4j.LogManager;
|
37 |
import org.apache.logging.log4j.LogManager;
|
| 38 |
import org.apache.logging.log4j.Logger;
|
38 |
import org.apache.logging.log4j.Logger;
|
| 39 |
import org.hibernate.Session;
|
39 |
import org.hibernate.Session;
|
| 40 |
import org.hibernate.SessionFactory;
|
40 |
import org.hibernate.SessionFactory;
|
| - |
|
41 |
import org.springframework.cache.annotation.Cacheable;
|
| 41 |
import org.hibernate.query.NativeQuery;
|
42 |
import org.hibernate.query.NativeQuery;
|
| 42 |
import org.springframework.beans.factory.annotation.Autowired;
|
43 |
import org.springframework.beans.factory.annotation.Autowired;
|
| 43 |
import org.springframework.stereotype.Component;
|
44 |
import org.springframework.stereotype.Component;
|
| 44 |
|
45 |
|
| 45 |
import javax.persistence.TypedQuery;
|
46 |
import javax.persistence.TypedQuery;
|
| Line 497... |
Line 498... |
| 497 |
typedQuerySimilar.setParameter("endDate", endDate);
|
498 |
typedQuerySimilar.setParameter("endDate", endDate);
|
| 498 |
return typedQuerySimilar.getResultList();
|
499 |
return typedQuerySimilar.getResultList();
|
| 499 |
}
|
500 |
}
|
| 500 |
|
501 |
|
| 501 |
@Override
|
502 |
@Override
|
| - |
|
503 |
@Cacheable(value = "rbmWeeklyBilling",
|
| - |
|
504 |
cacheManager = "twoMintimeoutCacheManager",
|
| - |
|
505 |
unless = "#result == null or #result.isEmpty()")
|
| 502 |
public List<RbmWeeklyBillingModel> getWeeklyBillingDataForMonth(LocalDate monthStart, LocalDate monthEnd) {
|
506 |
public List<RbmWeeklyBillingModel> getWeeklyBillingDataForMonth(LocalDate monthStart, LocalDate monthEnd) {
|
| 503 |
Session session = sessionFactory.getCurrentSession();
|
507 |
Session session = sessionFactory.getCurrentSession();
|
| 504 |
final TypedQuery<RbmWeeklyBillingModel> typedQuery = session.createNamedQuery("RBM.WeeklyBilling", RbmWeeklyBillingModel.class);
|
508 |
final TypedQuery<RbmWeeklyBillingModel> typedQuery = session.createNamedQuery("RBM.WeeklyBilling", RbmWeeklyBillingModel.class);
|
| 505 |
typedQuery.setParameter("startDate", monthStart);
|
509 |
typedQuery.setParameter("startDate", monthStart);
|
| 506 |
typedQuery.setParameter("endDate", monthEnd);
|
510 |
typedQuery.setParameter("endDate", monthEnd);
|