| Line 1699... |
Line 1699... |
| 1699 |
Map<Integer, List<?>> partnerRowsMap = new HashMap<>();
|
1699 |
Map<Integer, List<?>> partnerRowsMap = new HashMap<>();
|
| 1700 |
|
1700 |
|
| 1701 |
Map<Integer, FofoReportingModel> partnerIdSalesHeaderMap = this.getPartnerIdSalesHeaders();
|
1701 |
Map<Integer, FofoReportingModel> partnerIdSalesHeaderMap = this.getPartnerIdSalesHeaders();
|
| 1702 |
|
1702 |
|
| 1703 |
Map<Integer, Integer> shortDaysMap = partnerDailyInvestmentRepository.selectAll(LocalDate.now().withDayOfMonth(1), LocalDate.now()).stream().collect(groupingBy(
|
1703 |
Map<Integer, Integer> shortDaysMap = partnerDailyInvestmentRepository.selectAll(LocalDate.now().withDayOfMonth(1), LocalDate.now()).stream().collect(groupingBy(
|
| 1704 |
x -> x.getFofoId(), Collectors.summingInt(x -> x.getShortPercentage() > 10 ? 1 : 0)));
|
1704 |
x -> x.getFofoId(), Collectors.summingInt(x -> x.getShortPercentage() > ProfitMandiConstants.OK_INVESTMENT_SHORT_PERCENTAGE ? 1 : 0)));
|
| 1705 |
|
1705 |
|
| 1706 |
for (FofoStore fofoStore : fofoStores) {
|
1706 |
for (FofoStore fofoStore : fofoStores) {
|
| 1707 |
LOGGER.info("Fofo Store {}, {}", fofoStore.getId(), fofoStore.getCode());
|
1707 |
LOGGER.info("Fofo Store {}, {}", fofoStore.getId(), fofoStore.getCode());
|
| 1708 |
int fofoId = fofoStore.getId();
|
1708 |
int fofoId = fofoStore.getId();
|
| 1709 |
PartnerDailyInvestment partnerDailyInvestment = partnerInvestmentService.getInvestment(fofoId, 1);
|
1709 |
PartnerDailyInvestment partnerDailyInvestment = partnerInvestmentService.getInvestment(fofoId, 1);
|
| 1710 |
partnerDailyInvestment.setDate(yesterDay);
|
1710 |
partnerDailyInvestment.setDate(yesterDay);
|
| 1711 |
|
1711 |
|
| 1712 |
try {
|
1712 |
try {
|
| 1713 |
partnerDailyInvestmentRepository.persist(partnerDailyInvestment);
|
1713 |
partnerDailyInvestmentRepository.persist(partnerDailyInvestment);
|
| 1714 |
shortDaysMap.put(fofoId, shortDaysMap.get(fofoId) + (partnerDailyInvestment.getShortPercentage() > 10 ? 1 : 0));
|
1714 |
shortDaysMap.put(fofoId, shortDaysMap.get(fofoId) + (partnerDailyInvestment.getShortPercentage() > ProfitMandiConstants.OK_INVESTMENT_SHORT_PERCENTAGE ? 1 : 0));
|
| 1715 |
} catch (Exception e) {
|
1715 |
} catch (Exception e) {
|
| 1716 |
// ignore the exceptions during persist
|
1716 |
// ignore the exceptions during persist
|
| 1717 |
}
|
1717 |
}
|
| 1718 |
|
1718 |
|
| 1719 |
CustomRetailer retailer = customRetailerMap.get(fofoStore.getId());
|
1719 |
CustomRetailer retailer = customRetailerMap.get(fofoStore.getId());
|