Subversion Repositories SmartDukaan

Rev

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

Rev 27571 Rev 27572
Line 52... Line 52...
52
		System.out.println("Fofo Id\tInvestment Short Days\tEligible payout");
52
		System.out.println("Fofo Id\tInvestment Short Days\tEligible payout");
53
		for(Map.Entry<Integer, 	List<Integer>> retailerEntry : retailerInventoryItemIdMap.entrySet()) {
53
		for(Map.Entry<Integer, 	List<Integer>> retailerEntry : retailerInventoryItemIdMap.entrySet()) {
54
			int fofoId = retailerEntry.getKey();
54
			int fofoId = retailerEntry.getKey();
55
			List<SchemeInOut> schemeInouts = retailerEntry.getValue().stream().map(x->inventoryItemIdSchemeMap.get(x)).flatMap(List::stream).collect(Collectors.toList());
55
			List<SchemeInOut> schemeInouts = retailerEntry.getValue().stream().map(x->inventoryItemIdSchemeMap.get(x)).flatMap(List::stream).collect(Collectors.toList());
56
			double totalAmount = schemeInouts.stream().filter(x->x.getRolledBackTimestamp()!=null).collect(Collectors.summingDouble(x->x.getAmount()));
56
			double totalAmount = schemeInouts.stream().filter(x->x.getRolledBackTimestamp()!=null).collect(Collectors.summingDouble(x->x.getAmount()));
57
			long investmentMaintainedDays = investmentMaintainedDaysMap.get(fofoId);
57
			long investmentMaintainedDays = investmentMaintainedDaysMap.get(fofoId) == null ? 0 : investmentMaintainedDaysMap.get(fofoId);
58
			if(investmentMaintainedDays < 12) {
58
			if(investmentMaintainedDays < 12) {
59
				totalAmount = totalAmount/2;
59
				totalAmount = totalAmount/2;
60
			} else if(investmentMaintainedDays < 8) {
60
			} else if(investmentMaintainedDays < 8) {
61
				totalAmount = 0;
61
				totalAmount = 0;
62
			}
62
			}