Subversion Repositories SmartDukaan

Rev

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

Rev 24545 Rev 24546
Line 671... Line 671...
671
	}
671
	}
672
 
672
 
673
	public void walletmismatch() throws Exception {
673
	public void walletmismatch() throws Exception {
674
		LocalDate curDate = LocalDate.now();
674
		LocalDate curDate = LocalDate.now();
675
		List<Integer> mismatched = new ArrayList<>();
675
		List<Integer> mismatched = new ArrayList<>();
676
		List<PartnerDailyInvestment> pdis = partnerDailyInvestmentRepository.selectAll(curDate);
676
		List<PartnerDailyInvestment> pdis = partnerDailyInvestmentRepository.selectAll(curDate.minusDays(1));
677
		for (PartnerDailyInvestment pdi : pdis) {
677
		for (PartnerDailyInvestment pdi : pdis) {
-
 
678
			LOGGER.info("PartnerDaily", pdi.getFofoId());
678
			if (pdi.getWalletAmount() != walletService.getOpeningTill(pdi.getFofoId(), curDate.atStartOfDay())) {
679
			if (pdi.getWalletAmount() != walletService.getOpeningTill(pdi.getFofoId(), curDate.atStartOfDay())) {
679
				mismatched.add(pdi.getFofoId());
680
				mismatched.add(pdi.getFofoId());
680
				LOGGER.info("Added mistmatch for partnerId {}", pdi.getFofoId());
681
				LOGGER.info("Added mistmatch for partnerId {}", pdi.getFofoId());
681
			}
682
			}
682
		}
683
		}
683
 
684
 
684
		for (Integer fofoId : mismatched) {
685
		for (Integer fofoId : mismatched) {
685
			for (PartnerDailyInvestment investment : Lists
686
			for (PartnerDailyInvestment investment : Lists
686
					.reverse(partnerDailyInvestmentRepository.selectAll(fofoId, null, null))) {
687
					.reverse(partnerDailyInvestmentRepository.selectAll(fofoId, null, null))) {
687
				float statementAmount = walletService.getOpeningTill(fofoId, investment.getDate().atStartOfDay());
688
				float statementAmount = walletService.getOpeningTill(fofoId, investment.getDate().plusDays(1).atStartOfDay());
688
				if (investment.getWalletAmount() != statementAmount) {
689
				if (investment.getWalletAmount() != statementAmount) {
689
					LOGGER.info("{}\t{}\t{}\t{}", fofoId, investment.getDate(), investment.getWalletAmount(),
690
					LOGGER.info("{}\t{}\t{}\t{}", fofoId, investment.getDate(), investment.getWalletAmount(),
690
							statementAmount);
691
							statementAmount);
691
				}
692
				}
692
			}
693
			}