Subversion Repositories SmartDukaan

Rev

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

Rev 27271 Rev 27273
Line 2375... Line 2375...
2375
 
2375
 
2376
	public void reverseWallet() throws Exception {
2376
	public void reverseWallet() throws Exception {
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
		int amount = 0;
2380
		for (UserWalletHistory uwh : uwhList) {
2381
		for (UserWalletHistory uwh : uwhList) {
2381
			if(uwh.getBusinessTimestamp().getMonth().equals(Month.SEPTEMBER)) {
2382
			if(uwh.getBusinessTimestamp().getMonth().equals(Month.SEPTEMBER)) {
2382
				LOGGER.info("UWH - {}", uwh);
2383
				LOGGER.info("UWH - {}", uwh);
-
 
2384
				amount  += uwh.getAmount();
-
 
2385
				System.out.println("Amount is - " + amount);
2383
				//walletService.rollbackAmountFromWallet(uwh.getFofoId(), uwh.getAmount(), uwh.getReference(), uwh.getReferenceType(), "Margin reversal for error prone run", uwh.getBusinessTimestamp());
2386
				//walletService.rollbackAmountFromWallet(uwh.getFofoId(), uwh.getAmount(), uwh.getReference(), uwh.getReferenceType(), "Margin reversal for error prone run", uwh.getBusinessTimestamp());
2384
			}
2387
			}
2385
		}
2388
		}
2386
		
2389
		
2387
	}
2390
	}