Subversion Repositories SmartDukaan

Rev

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

Rev 27568 Rev 27569
Line 46... Line 46...
46
				.collect(Collectors.groupingBy(x->x.getFofoId(), Collectors.mapping(x->x.getId(), Collectors.toList())));
46
				.collect(Collectors.groupingBy(x->x.getFofoId(), Collectors.mapping(x->x.getId(), Collectors.toList())));
47
		System.out.println("fofoId\tInvestment Short Days\tEligible payout");
47
		System.out.println("fofoId\tInvestment Short Days\tEligible payout");
48
		for(Map.Entry<Integer, 	List<Integer>> retailerEntry : retailerInventoryItemIdMap.entrySet()) {
48
		for(Map.Entry<Integer, 	List<Integer>> retailerEntry : retailerInventoryItemIdMap.entrySet()) {
49
			int fofoId = retailerEntry.getKey();
49
			int fofoId = retailerEntry.getKey();
50
			List<SchemeInOut> schemeInouts = retailerEntry.getValue().stream().map(x->inventoryItemIdSchemeMap.get(x)).flatMap(List::stream).collect(Collectors.toList());
50
			List<SchemeInOut> schemeInouts = retailerEntry.getValue().stream().map(x->inventoryItemIdSchemeMap.get(x)).flatMap(List::stream).collect(Collectors.toList());
51
			double totalAmount = schemeInouts.stream().filter(x->x.getRolledBackTimestamp()!=null).collect(Collectors.summingDouble(x->x.getAmount()));
51
			double totalAmount = schemeInouts.stream().filter(x->x.getRolledBackTimestamp()==null).collect(Collectors.summingDouble(x->x.getAmount()));
52
			long investmentMaintainedDays = investmentMaintainedDaysMap.get(fofoId);
52
			long investmentMaintainedDays = investmentMaintainedDaysMap.get(fofoId);
53
			if(investmentMaintainedDays < 12) {
53
			if(investmentMaintainedDays < 12) {
54
				totalAmount = totalAmount/2;
54
				totalAmount = totalAmount/2;
55
			} else if(investmentMaintainedDays < 8) {
55
			} else if(investmentMaintainedDays < 8) {
56
				totalAmount = 0;
56
				totalAmount = 0;