| Line 149... |
Line 149... |
| 149 |
}
|
149 |
}
|
| 150 |
|
150 |
|
| 151 |
private Map<String, Object> getInvestments(int fofoId) throws Exception {
|
151 |
private Map<String, Object> getInvestments(int fofoId) throws Exception {
|
| 152 |
Map<String, Object> investments = new LinkedHashMap<>();
|
152 |
Map<String, Object> investments = new LinkedHashMap<>();
|
| 153 |
PartnerDailyInvestment investment = partnerInvestmentService.getInvestment(fofoId, 1);
|
153 |
PartnerDailyInvestment investment = partnerInvestmentService.getInvestment(fofoId, 1);
|
| 154 |
LocalDate currentMonthStart = LocalDate.now().withDayOfMonth(1);
|
- |
|
| 155 |
LocalDate yesterDate = LocalDate.now().minusDays(1);
|
154 |
LocalDate yesterDate = LocalDate.now().minusDays(1);
|
| - |
|
155 |
LocalDate currentMonthStart = yesterDate.withDayOfMonth(1);
|
| 156 |
PartnerDailyInvestment yesterdayInvestment = partnerDailyInvestmentRepository.select(fofoId, yesterDate);
|
156 |
PartnerDailyInvestment yesterdayInvestment = partnerDailyInvestmentRepository.select(fofoId, yesterDate);
|
| 157 |
if (yesterdayInvestment == null) {
|
157 |
if (yesterdayInvestment == null) {
|
| 158 |
yesterdayInvestment = new PartnerDailyInvestment();
|
158 |
yesterdayInvestment = new PartnerDailyInvestment();
|
| 159 |
}
|
159 |
}
|
| 160 |
|
160 |
|
| Line 166... |
Line 166... |
| 166 |
investments.put("today", investment.getTotalInvestment());
|
166 |
investments.put("today", investment.getTotalInvestment());
|
| 167 |
investments.put("investment", investment);
|
167 |
investments.put("investment", investment);
|
| 168 |
investments.put("inStock", investment.getInStockAmount());
|
168 |
investments.put("inStock", investment.getInStockAmount());
|
| 169 |
investments.put("minimum", investment.getMinInvestmentString());
|
169 |
investments.put("minimum", investment.getMinInvestmentString());
|
| 170 |
investments.put("short", investment.getShortPercentage());
|
170 |
investments.put("short", investment.getShortPercentage());
|
| 171 |
investments.put("okDays", okInvestmentDays);
|
171 |
investments.put("okDays", okInvestmentDays + (currentMonthStart.lengthOfMonth() - currentMonthInvestments.size()));
|
| 172 |
return investments;
|
172 |
return investments;
|
| 173 |
}
|
173 |
}
|
| 174 |
|
174 |
|
| 175 |
private Map<String, Object> getSales(int fofoId) {
|
175 |
private Map<String, Object> getSales(int fofoId) {
|
| 176 |
Map<String, Object> salesMap = new LinkedHashMap<>();
|
176 |
Map<String, Object> salesMap = new LinkedHashMap<>();
|