Subversion Repositories SmartDukaan

Rev

Rev 34466 | Rev 34685 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 34466 Rev 34527
Line 144... Line 144...
144
        if (yesterdayInvestment == null) {
144
        if (yesterdayInvestment == null) {
145
            yesterdayInvestment = new PartnerDailyInvestment();
145
            yesterdayInvestment = new PartnerDailyInvestment();
146
        }
146
        }
147
 
147
 
148
        List<PartnerDailyInvestment> currentMonthInvestments = partnerDailyInvestmentRepository.selectAll(fofoId, currentMonthStart, currentMonthStart.withDayOfMonth(currentMonthStart.lengthOfMonth()));
148
        List<PartnerDailyInvestment> currentMonthInvestments = partnerDailyInvestmentRepository.selectAll(fofoId, currentMonthStart, currentMonthStart.withDayOfMonth(currentMonthStart.lengthOfMonth()));
-
 
149
        boolean isInvestmentOk = partnerInvestmentService.isInvestmentOk(fofoId, ProfitMandiConstants.MIN_INVESTMENT_PERCENTAGE, ProfitMandiConstants.CUTOFF_INVESTMENT);
149
 
150
 
150
        long okInvestmentDays = currentMonthInvestments.stream().filter(x -> x.getShortPercentage() <= 10).collect(Collectors.counting());
151
        long okInvestmentDays = currentMonthInvestments.stream().filter(x -> x.getShortPercentage() <= 10).collect(Collectors.counting());
-
 
152
        PartnerType partnerType = partnerTypeChangeService.getTypeOnDate(fofoId, LocalDate.now());
151
        investments.put("today", investment.getTotalInvestment());
153
        investments.put("today", investment.getTotalInvestment());
-
 
154
        investments.put("partnerType", partnerType);
152
        investments.put("investment", investment);
155
        investments.put("investment", investment);
-
 
156
        investments.put("minimumInvestment", investment.getMinInvestment());
-
 
157
        investments.put("totalInvestment", investment.getTotalInvestment());
-
 
158
        investments.put("isInvestmentOk", isInvestmentOk);
153
        investments.put("inStock", investment.getInStockAmount());
159
        investments.put("inStock", investment.getInStockAmount());
154
        investments.put("minimum", investment.getMinInvestmentString());
160
        investments.put("minimum", investment.getMinInvestmentString());
155
        investments.put("short", investment.getShortPercentage());
161
        investments.put("short", investment.getShortPercentage());
156
        investments.put("activated_stock", investment.getActivatedStockAmount());
162
        investments.put("activated_stock", investment.getActivatedStockAmount());
157
        investments.put("okDays", okInvestmentDays);
163
        investments.put("okDays", okInvestmentDays);
-
 
164
        investments.put("cutOf", 100-ProfitMandiConstants.CUTOFF_INVESTMENT);
-
 
165
        investments.put("minInvestment", 100-ProfitMandiConstants.MIN_INVESTMENT_PERCENTAGE);
158
        return investments;
166
        return investments;
159
    }
167
    }
160
 
168
 
161
    public Map<String, Object> getInvestmentsMonths(int fofoId, int month) throws Exception {
169
    public Map<String, Object> getInvestmentsMonths(int fofoId, int month) throws Exception {
162
        Map<String, Object> investments = new LinkedHashMap<>();
170
        Map<String, Object> investments = new LinkedHashMap<>();