Subversion Repositories SmartDukaan

Rev

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

Rev 27274 Rev 27275
Line 2377... Line 2377...
2377
		LocalDate localDate = LocalDate.of(2020, 10, 28);
2377
		LocalDate localDate = LocalDate.of(2020, 10, 28);
2378
		List<UserWalletHistory> uwhList = userWalletHistoryRepository.selectAllByDateType(localDate.atStartOfDay(), localDate.plusDays(1).atStartOfDay(), 
2378
		List<UserWalletHistory> uwhList = userWalletHistoryRepository.selectAllByDateType(localDate.atStartOfDay(), localDate.plusDays(1).atStartOfDay(), 
2379
				Arrays.asList(WalletReferenceType.SCHEME_IN, WalletReferenceType.SCHEME_OUT));
2379
				Arrays.asList(WalletReferenceType.SCHEME_IN, WalletReferenceType.SCHEME_OUT));
2380
		for (UserWalletHistory uwh : uwhList) {
2380
		for (UserWalletHistory uwh : uwhList) {
2381
			if(uwh.getBusinessTimestamp().getMonth().equals(Month.SEPTEMBER)) {
2381
			if(uwh.getBusinessTimestamp().getMonth().equals(Month.SEPTEMBER)) {
-
 
2382
				UserWallet uw = userWalletRepository.selectById(uwh.getWalletId());
2382
				LOGGER.info("UWH - {}", uwh);
2383
				LOGGER.info("UWH - {}", uwh);
2383
				//amount  += uwh.getAmount();
2384
				//amount  += uwh.getAmount();
2384
				//System.out.println("Amount is - " + amount);
2385
				//System.out.println("Amount is - " + amount);
2385
				walletService.rollbackAmountFromWallet(uwh.getFofoId(), uwh.getAmount(), uwh.getReference(), uwh.getReferenceType(), "Margin reversal for error prone run", uwh.getBusinessTimestamp());
2386
				walletService.rollbackAmountFromWallet(uw.getUserId(), uwh.getAmount(), uwh.getReference(), uwh.getReferenceType(), "Margin reversal for error prone run", uwh.getBusinessTimestamp());
2386
			}
2387
			}
2387
		}
2388
		}
2388
		
2389
		
2389
	}
2390
	}
2390
 
2391