Subversion Repositories SmartDukaan

Rev

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

Rev 23203 Rev 23271
Line 24... Line 24...
24
 
24
 
25
import com.spice.profitmandi.common.exception.ProfitMandiBusinessException;
25
import com.spice.profitmandi.common.exception.ProfitMandiBusinessException;
26
import com.spice.profitmandi.common.model.ProfitMandiConstants;
26
import com.spice.profitmandi.common.model.ProfitMandiConstants;
27
import com.spice.profitmandi.dao.entity.dtr.Retailer;
27
import com.spice.profitmandi.dao.entity.dtr.Retailer;
28
import com.spice.profitmandi.dao.entity.dtr.User;
28
import com.spice.profitmandi.dao.entity.dtr.User;
29
import com.spice.profitmandi.dao.entity.dtr.UserAccounts;
29
import com.spice.profitmandi.dao.entity.dtr.UserAccount;
30
import com.spice.profitmandi.dao.entity.dtr.UserRole;
30
import com.spice.profitmandi.dao.entity.dtr.UserRole;
31
import com.spice.profitmandi.dao.enumuration.dtr.AccountType;
31
import com.spice.profitmandi.dao.enumuration.dtr.AccountType;
32
import com.spice.profitmandi.dao.enumuration.dtr.RoleType;
32
import com.spice.profitmandi.dao.enumuration.dtr.RoleType;
33
import com.spice.profitmandi.dao.repository.dtr.RetailerRepository;
33
import com.spice.profitmandi.dao.repository.dtr.RetailerRepository;
34
import com.spice.profitmandi.dao.repository.dtr.UserAccountRepository;
34
import com.spice.profitmandi.dao.repository.dtr.UserAccountRepository;
Line 120... Line 120...
120
					List<UserRole> userRoles = userRoleRepository.selectByUserId(user.getId());
120
					List<UserRole> userRoles = userRoleRepository.selectByUserId(user.getId());
121
					for(int index = 0; index < userRoles.size(); index++){
121
					for(int index = 0; index < userRoles.size(); index++){
122
						roleTypes.add(userRoles.get(index).getRoleType());
122
						roleTypes.add(userRoles.get(index).getRoleType());
123
					}
123
					}
124
					if(roleTypes.contains(RoleType.RETAILER)) {
124
					if(roleTypes.contains(RoleType.RETAILER)) {
125
						UserAccounts userAccounts = userAccountRepository.getUserAccountByType(user.getId(), AccountType.saholic);
125
						UserAccount userAccounts = userAccountRepository.selectByUserIdType(user.getId(), AccountType.saholic);
126
						Retailer retailer = retailerRepository.selectById(Integer.parseInt(userAccounts.getAccount_key()));
126
						Retailer retailer = retailerRepository.selectById(userAccounts.getAccountKey());
127
						fofoDetails.setFofoId(retailer.getId());
127
						fofoDetails.setFofoId(retailer.getId());
128
						//fofoDetails.setFofo(retailer.isFofo());
128
						//fofoDetails.setFofo(retailer.isFofo());
129
					}
129
					}
130
				} catch(ProfitMandiBusinessException pmbe) {
130
				} catch(ProfitMandiBusinessException pmbe) {
131
					LOGGER.error("Data Inconsistent", pmbe);
131
					LOGGER.error("Data Inconsistent", pmbe);