| Line 24... |
Line 24... |
| 24 |
import com.spice.profitmandi.dao.enumuration.fofo.ScanType;
|
24 |
import com.spice.profitmandi.dao.enumuration.fofo.ScanType;
|
| 25 |
import com.spice.profitmandi.dao.enumuration.transaction.SchemePayoutStatus;
|
25 |
import com.spice.profitmandi.dao.enumuration.transaction.SchemePayoutStatus;
|
| 26 |
import com.spice.profitmandi.dao.model.AmountModel;
|
26 |
import com.spice.profitmandi.dao.model.AmountModel;
|
| 27 |
import com.spice.profitmandi.dao.model.CreateSchemeRequest;
|
27 |
import com.spice.profitmandi.dao.model.CreateSchemeRequest;
|
| 28 |
import com.spice.profitmandi.dao.repository.catalog.*;
|
28 |
import com.spice.profitmandi.dao.repository.catalog.*;
|
| - |
|
29 |
import com.spice.profitmandi.dao.repository.dtr.FofoStoreRepository;
|
| 29 |
import com.spice.profitmandi.dao.repository.dtr.RetailerRepository;
|
30 |
import com.spice.profitmandi.dao.repository.dtr.RetailerRepository;
|
| 30 |
import com.spice.profitmandi.dao.repository.fofo.*;
|
31 |
import com.spice.profitmandi.dao.repository.fofo.*;
|
| 31 |
import com.spice.profitmandi.dao.repository.transaction.PriceDropRepository;
|
32 |
import com.spice.profitmandi.dao.repository.transaction.PriceDropRepository;
|
| 32 |
import com.spice.profitmandi.dao.repository.transaction.UserWalletHistoryRepository;
|
33 |
import com.spice.profitmandi.dao.repository.transaction.UserWalletHistoryRepository;
|
| 33 |
import com.spice.profitmandi.dao.repository.transaction.UserWalletRepository;
|
34 |
import com.spice.profitmandi.dao.repository.transaction.UserWalletRepository;
|
| Line 56... |
Line 57... |
| 56 |
import javax.persistence.criteria.Predicate;
|
57 |
import javax.persistence.criteria.Predicate;
|
| 57 |
import javax.persistence.criteria.Root;
|
58 |
import javax.persistence.criteria.Root;
|
| 58 |
import java.text.MessageFormat;
|
59 |
import java.text.MessageFormat;
|
| 59 |
import java.time.LocalDate;
|
60 |
import java.time.LocalDate;
|
| 60 |
import java.time.LocalDateTime;
|
61 |
import java.time.LocalDateTime;
|
| - |
|
62 |
import java.time.LocalTime;
|
| 61 |
import java.time.YearMonth;
|
63 |
import java.time.YearMonth;
|
| 62 |
import java.util.*;
|
64 |
import java.util.*;
|
| 63 |
import java.util.stream.Collectors;
|
65 |
import java.util.stream.Collectors;
|
| 64 |
|
66 |
|
| 65 |
@Component
|
67 |
@Component
|
| Line 1097... |
Line 1099... |
| 1097 |
typedQuery.setMaxResults(limit);
|
1099 |
typedQuery.setMaxResults(limit);
|
| 1098 |
}
|
1100 |
}
|
| 1099 |
return typedQuery.getResultList();
|
1101 |
return typedQuery.getResultList();
|
| 1100 |
}
|
1102 |
}
|
| 1101 |
|
1103 |
|
| - |
|
1104 |
@Autowired
|
| - |
|
1105 |
FofoStoreRepository fofoStoreRepository;
|
| - |
|
1106 |
|
| - |
|
1107 |
|
| - |
|
1108 |
@Override
|
| - |
|
1109 |
@Cacheable(value = "staticscheme", cacheManager = "oneDayCacheManager")
|
| - |
|
1110 |
public Scheme getStaticScheme(int fofoId) throws ProfitMandiBusinessException {
|
| - |
|
1111 |
Scheme scheme = new Scheme();
|
| - |
|
1112 |
scheme.setName("Super Retailer Club");
|
| - |
|
1113 |
scheme.setStartDateTime(LocalDate.of(2023, 7, 1).atStartOfDay());
|
| - |
|
1114 |
scheme.setEndDateTime(LocalDate.of(2023, 11, 30).atTime(LocalTime.MAX));
|
| - |
|
1115 |
FofoStore fofoStore = fofoStoreRepository.selectByRetailerId(fofoId);
|
| - |
|
1116 |
scheme.setTarget(fofoStore.getTarget());
|
| - |
|
1117 |
return scheme;
|
| - |
|
1118 |
}
|
| - |
|
1119 |
|
| 1102 |
@Override
|
1120 |
@Override
|
| 1103 |
public List<Scheme> selectSchemeByPartnerType(PartnerType partnerType, LocalDate onDate, int catalogId,
|
1121 |
public List<Scheme> selectSchemeByPartnerType(PartnerType partnerType, LocalDate onDate, int catalogId,
|
| 1104 |
boolean isAdmin, int offset, int limit) throws ProfitMandiBusinessException {
|
1122 |
boolean isAdmin, int offset, int limit) throws ProfitMandiBusinessException {
|
| 1105 |
Session session = sessionFactory.getCurrentSession();
|
1123 |
Session session = sessionFactory.getCurrentSession();
|
| 1106 |
List<Predicate> andPredicates = new ArrayList<>();
|
1124 |
List<Predicate> andPredicates = new ArrayList<>();
|