| Line 3... |
Line 3... |
| 3 |
import com.google.common.collect.Maps;
|
3 |
import com.google.common.collect.Maps;
|
| 4 |
import com.spice.profitmandi.common.model.ProfitMandiConstants;
|
4 |
import com.spice.profitmandi.common.model.ProfitMandiConstants;
|
| 5 |
import com.spice.profitmandi.dao.entity.BrandSalesRewards;
|
5 |
import com.spice.profitmandi.dao.entity.BrandSalesRewards;
|
| 6 |
import com.spice.profitmandi.dao.entity.ModelRewardPoints;
|
6 |
import com.spice.profitmandi.dao.entity.ModelRewardPoints;
|
| 7 |
import com.spice.profitmandi.dao.entity.SaleRewardHistory;
|
7 |
import com.spice.profitmandi.dao.entity.SaleRewardHistory;
|
| - |
|
8 |
import com.spice.profitmandi.dao.entity.StoreSalesTarget;
|
| 8 |
import com.spice.profitmandi.dao.model.EligibleRewardItemsModel;
|
9 |
import com.spice.profitmandi.dao.model.EligibleRewardItemsModel;
|
| - |
|
10 |
import com.spice.profitmandi.dao.repository.GenericRepository;
|
| 9 |
import com.spice.profitmandi.dao.repository.ModelRewardPointsRepository;
|
11 |
import com.spice.profitmandi.dao.repository.ModelRewardPointsRepository;
|
| 10 |
import com.spice.profitmandi.dao.repository.SaleRewardHistoryRepository;
|
12 |
import com.spice.profitmandi.dao.repository.SaleRewardHistoryRepository;
|
| 11 |
import org.apache.logging.log4j.LogManager;
|
13 |
import org.apache.logging.log4j.LogManager;
|
| 12 |
import org.apache.logging.log4j.Logger;
|
14 |
import org.apache.logging.log4j.Logger;
|
| 13 |
import org.hibernate.Session;
|
15 |
import org.hibernate.Session;
|
| Line 33... |
Line 35... |
| 33 |
private ModelRewardPointsRepository modelRewardPointsRepository;
|
35 |
private ModelRewardPointsRepository modelRewardPointsRepository;
|
| 34 |
|
36 |
|
| 35 |
@Autowired
|
37 |
@Autowired
|
| 36 |
private SessionFactory sessionFactory;
|
38 |
private SessionFactory sessionFactory;
|
| 37 |
|
39 |
|
| - |
|
40 |
@Autowired
|
| - |
|
41 |
private GenericRepository genericRepository;
|
| - |
|
42 |
|
| 38 |
@Override
|
43 |
@Override
|
| 39 |
public void disburseRewardsByEligibility() {
|
44 |
public void disburseRewardsByEligibility() {
|
| 40 |
ProfitMandiConstants.BRAND_REWARD_REGION_IDS.forEach(regionId -> {
|
45 |
ProfitMandiConstants.BRAND_REWARD_REGION_IDS.forEach(regionId -> {
|
| 41 |
LocalDateTime startDateTime = ProfitMandiConstants.OPPO_SCHEME_START_DATE;
|
46 |
LocalDateTime startDateTime = ProfitMandiConstants.OPPO_SCHEME_START_DATE;
|
| 42 |
LocalDateTime endDateTime = (regionId == 19) ? ProfitMandiConstants.OPPO_UK_SCHEME_END_DATE : ProfitMandiConstants.OPPO_HR_SCHEME_END_DATE;
|
47 |
LocalDateTime endDateTime = (regionId == 19) ? ProfitMandiConstants.OPPO_UK_SCHEME_END_DATE : ProfitMandiConstants.OPPO_HR_SCHEME_END_DATE;
|
| Line 133... |
Line 138... |
| 133 |
typedQuery.setParameter("regionId", regionId);
|
138 |
typedQuery.setParameter("regionId", regionId);
|
| 134 |
typedQuery.setParameter("orderStartDate", startDateTime);
|
139 |
typedQuery.setParameter("orderStartDate", startDateTime);
|
| 135 |
typedQuery.setParameter("orderEndDate", endDateTime);
|
140 |
typedQuery.setParameter("orderEndDate", endDateTime);
|
| 136 |
return typedQuery.getResultList();
|
141 |
return typedQuery.getResultList();
|
| 137 |
}
|
142 |
}
|
| - |
|
143 |
|
| - |
|
144 |
public StoreSalesTarget findTargetsByFofoId(int fofoId) {
|
| - |
|
145 |
return genericRepository.selectByEqual(StoreSalesTarget.class, "fofoId", fofoId);
|
| - |
|
146 |
}
|
| 138 |
}
|
147 |
}
|