Subversion Repositories SmartDukaan

Rev

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

Rev 22550 Rev 22730
Line 28... Line 28...
28
	UserWalletHistoryRepository userWalletHistoryRepository;
28
	UserWalletHistoryRepository userWalletHistoryRepository;
29
	
29
	
30
	@Override
30
	@Override
31
	public UserWallet getUserWalletByUserId(int userId) throws ProfitMandiBusinessException {
31
	public UserWallet getUserWalletByUserId(int userId) throws ProfitMandiBusinessException {
32
		UserAccounts userAccount = userAccountRepository.getUserAccountByType(userId, AccountType.saholic);
32
		UserAccounts userAccount = userAccountRepository.getUserAccountByType(userId, AccountType.saholic);
33
		return userWalletRepository.selectByRetailerId(Integer.valueOf(userAccount.getAccount_key()));
33
		Integer retailerId = Integer.valueOf(userAccount.getAccount_key());
-
 
34
		try {
-
 
35
			return userWalletRepository.selectByRetailerId(retailerId);
-
 
36
		} catch (ProfitMandiBusinessException pbe) {
-
 
37
			UserWallet uw  = new UserWallet();
-
 
38
			uw.setAmount(0);
-
 
39
			uw.setRefundableAmount(0);
-
 
40
			uw.setUserId(retailerId);
-
 
41
			return uw;
-
 
42
		}
34
	}
43
	}
35
 
44
 
36
	@Override
45
	@Override
37
	public List<UserWalletHistory> getUserWalletHistoryByUserId(int userId) throws ProfitMandiBusinessException {
46
	public List<UserWalletHistory> getUserWalletHistoryByUserId(int userId) throws ProfitMandiBusinessException {
38
		UserWallet userWallet = this.getUserWalletByUserId(userId);
47
		UserWallet userWallet = this.getUserWalletByUserId(userId);