Subversion Repositories SmartDukaan

Rev

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

Rev 34654 Rev 34822
Line 419... Line 419...
419
 
419
 
420
    private Map<String, List<MobileInsurancePlan>> getPlans(float sellingPrice, int itemId)
420
    private Map<String, List<MobileInsurancePlan>> getPlans(float sellingPrice, int itemId)
421
            throws ProfitMandiBusinessException {
421
            throws ProfitMandiBusinessException {
422
        try {
422
        try {
423
            Map<String, List<MobileInsurancePlan>> productDurationPlans = insuranceService.getAllPlans(itemId, sellingPrice, true);
423
            Map<String, List<MobileInsurancePlan>> productDurationPlans = insuranceService.getAllPlans(itemId, sellingPrice, true);
-
 
424
            Map<String, List<MobileInsurancePlan>> filteredPlans = productDurationPlans.entrySet()
-
 
425
                    .stream()
-
 
426
                    .collect(Collectors.toMap(
-
 
427
                            Map.Entry::getKey,
-
 
428
                            e -> e.getValue().stream()
-
 
429
                                    .filter(plan -> "6".equals(plan.getProviderId()))
-
 
430
                                    .collect(Collectors.toList())
-
 
431
                    ));
424
            return productDurationPlans;
432
            return filteredPlans;
425
        } catch (Exception e) {
433
        } catch (Exception e) {
426
            logger.info(e, e);
434
            logger.info(e, e);
427
            throw new ProfitMandiBusinessException("Fetch Insurance Plans", "Insurance", "Could not fetch insurance Plans");
435
            throw new ProfitMandiBusinessException("Fetch Insurance Plans", "Insurance", "Could not fetch insurance Plans");
428
        }
436
        }
429
 
437