Subversion Repositories SmartDukaan

Rev

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

Rev 27573 Rev 27577
Line 53... Line 53...
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) == null ? 0 : investmentMaintainedDaysMap.get(fofoId);
57
			long investmentMaintainedDays = investmentMaintainedDaysMap.get(fofoId) == null ? 0 : investmentMaintainedDaysMap.get(fofoId);
58
			if(investmentMaintainedDays < 12) {
58
			if(investmentMaintainedDays < 8) {
59
				totalAmount = totalAmount/2;
-
 
60
			} else if(investmentMaintainedDays < 8) {
-
 
61
				totalAmount = 0;
59
				totalAmount = 0;
-
 
60
			} else if(investmentMaintainedDays < 12) {
-
 
61
				totalAmount = totalAmount/2;
62
			}
62
			}
63
			System.out.printf("%d\t%d\t%f%n", fofoId, investmentMaintainedDays, totalAmount);
63
			System.out.printf("%d\t%d\t%f%n", fofoId, investmentMaintainedDays, totalAmount);
64
		}
64
		}
65
	}
65
	}
66
}
66
}
67
67