Subversion Repositories SmartDukaan

Rev

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

Rev 22160 Rev 22166
Line 104... Line 104...
104
			User user = null;
104
			User user = null;
105
			try{
105
			try{
106
				user = userRepository.selectByEmailId(emailId);
106
				user = userRepository.selectByEmailId(emailId);
107
				fofoDetails.setFofoId(user.getId());
107
				fofoDetails.setFofoId(user.getId());
108
				try {
108
				try {
109
					UserAccounts userAccounts = userAccountRepository.getUserAccountByType(user.getId(), AccountType.saholic);
-
 
110
					Retailer retailer = retailerRepository.selectById(Integer.parseInt(userAccounts.getAccount_key()));
-
 
111
					fofoDetails.setFofoId(retailer.getId());
-
 
112
					List<UserRole> userRoles = userRoleRepository.selectByUserId(user.getId());
109
					List<UserRole> userRoles = userRoleRepository.selectByUserId(user.getId());
113
					for(int index = 0; index < userRoles.size(); index++){
110
					for(int index = 0; index < userRoles.size(); index++){
114
						roleTypes.add(userRoles.get(index).getRoleType());
111
						roleTypes.add(userRoles.get(index).getRoleType());
115
					}
112
					}
-
 
113
					if(roleTypes.contains(RoleType.RETAILER)) {
-
 
114
						UserAccounts userAccounts = userAccountRepository.getUserAccountByType(user.getId(), AccountType.saholic);
-
 
115
						Retailer retailer = retailerRepository.selectById(Integer.parseInt(userAccounts.getAccount_key()));
-
 
116
						fofoDetails.setFofoId(retailer.getId());
116
					fofoDetails.setFofo(retailer.isFofo());
117
						fofoDetails.setFofo(retailer.isFofo());
-
 
118
					}
117
				} catch(ProfitMandiBusinessException pmbe) {
119
				} catch(ProfitMandiBusinessException pmbe) {
118
					LOGGER.error("Data Inconsistent", pmbe);
120
					LOGGER.error("Data Inconsistent", pmbe);
119
				}
121
				}
120
			}catch(ProfitMandiBusinessException profitMandiBusinessException){
122
			}catch(ProfitMandiBusinessException profitMandiBusinessException){
121
				LOGGER.error("User not found with given emailId", profitMandiBusinessException);
123
				LOGGER.error("User not found with given emailId", profitMandiBusinessException);