Subversion Repositories SmartDukaan

Rev

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

Rev 35595 Rev 35600
Line 107... Line 107...
107
 
107
 
108
        return String.valueOf(value);
108
        return String.valueOf(value);
109
    }
109
    }
110
 
110
 
111
 
111
 
112
    @Cacheable(value = "brandStockPrices", cacheManager = "redisShortCacheManager")
112
    @Cacheable(value = "brandStockPrices", cacheManager = "redisVeryShortCacheManager")
113
    public List<BrandStockPrice> getBrandStockPrices(int fofoId, boolean allBrands) throws Exception {
113
    public List<BrandStockPrice> getBrandStockPrices(int fofoId, boolean allBrands) throws Exception {
114
        Map<String, BrandStockPrice> brandStockPricesMap = inventoryService.getBrandWiseStockValue(fofoId);
114
        Map<String, BrandStockPrice> brandStockPricesMap = inventoryService.getBrandWiseStockValue(fofoId);
115
        List<BrandStockPrice> brandStockPrices = new ArrayList<>();
115
        List<BrandStockPrice> brandStockPrices = new ArrayList<>();
116
        List<BrandCatalog> mobileBrands = brandsService.getBrandsToDisplay(3);
116
        List<BrandCatalog> mobileBrands = brandsService.getBrandsToDisplay(3);
117
        mobileBrands.stream().forEach(x -> {
117
        mobileBrands.stream().forEach(x -> {
Line 129... Line 129...
129
        }
129
        }
130
 
130
 
131
        return brandStockPrices.stream().filter(x -> x.getTotalQty() > 0).sorted(Comparator.comparingInt(BrandStockPrice::getRank)).collect(Collectors.toList());
131
        return brandStockPrices.stream().filter(x -> x.getTotalQty() > 0).sorted(Comparator.comparingInt(BrandStockPrice::getRank)).collect(Collectors.toList());
132
    }
132
    }
133
 
133
 
134
    @Cacheable(value = "partnerInvestments", cacheManager = "redisShortCacheManager")
134
    @Cacheable(value = "partnerInvestments", cacheManager = "redisVeryShortCacheManager")
135
    public Map<String, Object> getInvestments(int fofoId) throws Exception {
135
    public Map<String, Object> getInvestments(int fofoId) throws Exception {
136
        Map<String, Object> investments = new LinkedHashMap<>();
136
        Map<String, Object> investments = new LinkedHashMap<>();
137
        PartnerDailyInvestment investment = partnerInvestmentService.getInvestment(fofoId, 0);
137
        PartnerDailyInvestment investment = partnerInvestmentService.getInvestment(fofoId, 0);
138
        LocalDate currentMonthStart = LocalDate.now().withDayOfMonth(1);
138
        LocalDate currentMonthStart = LocalDate.now().withDayOfMonth(1);
139
        LocalDate yesterDate = LocalDate.now().minusDays(1);
139
        LocalDate yesterDate = LocalDate.now().minusDays(1);
Line 324... Line 324...
324
 
324
 
325
        return cm;
325
        return cm;
326
 
326
 
327
    }
327
    }
328
 
328
 
329
    @Cacheable(value = "partnerSales", cacheManager = "redisShortCacheManager")
329
    @Cacheable(value = "partnerSales", cacheManager = "redisVeryShortCacheManager")
330
    public Map<String, Object> getSales(int fofoId) throws ProfitMandiBusinessException {
330
    public Map<String, Object> getSales(int fofoId) throws ProfitMandiBusinessException {
331
 
331
 
332
        Map<String, Object> salesMap = new LinkedHashMap<>();
332
        Map<String, Object> salesMap = new LinkedHashMap<>();
333
        LocalDateTime now = LocalDateTime.now();
333
        LocalDateTime now = LocalDateTime.now();
334
        LocalDateTime startOfToday = LocalDate.now().atStartOfDay();
334
        LocalDateTime startOfToday = LocalDate.now().atStartOfDay();