Subversion Repositories SmartDukaan

Rev

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

Rev 22015 Rev 22017
Line 6... Line 6...
6
import java.util.List;
6
import java.util.List;
7
import java.util.Map;
7
import java.util.Map;
8
 
8
 
9
import javax.servlet.http.HttpServletRequest;
9
import javax.servlet.http.HttpServletRequest;
10
 
10
 
-
 
11
import org.apache.xmlbeans.impl.xb.xsdschema.Attribute.Use;
11
import org.slf4j.Logger;
12
import org.slf4j.Logger;
12
import org.slf4j.LoggerFactory;
13
import org.slf4j.LoggerFactory;
13
import org.springframework.beans.factory.annotation.Autowired;
14
import org.springframework.beans.factory.annotation.Autowired;
14
import org.springframework.beans.factory.annotation.Value;
15
import org.springframework.beans.factory.annotation.Value;
15
import org.springframework.http.HttpStatus;
16
import org.springframework.http.HttpStatus;
Line 147... Line 148...
147
			}
148
			}
148
		}
149
		}
149
		if (user != null) {
150
		if (user != null) {
150
			responseMap.put(ProfitMandiConstants.EMAIL_ID, user.getEmailId());
151
			responseMap.put(ProfitMandiConstants.EMAIL_ID, user.getEmailId());
151
			responseMap.put(ProfitMandiConstants.USER_ID, user.getId());
152
			responseMap.put(ProfitMandiConstants.USER_ID, user.getId());
-
 
153
			responseMap.put(ProfitMandiConstants.USER_NAME, user.getFirstName() + " " + user.getLastName());
152
			
154
			
153
			List<UserRole> userRoles = userRoleRepository.selectByUserId(user.getId());
155
			List<UserRole> userRoles = userRoleRepository.selectByUserId(user.getId());
154
			String[] roleTypes = new String[userRoles.size()];
156
			String[] roleTypes = new String[userRoles.size()];
155
			
157
			
156
			
158
			
Line 168... Line 170...
168
			}
170
			}
169
			
171
			
170
			// if user is retailer
172
			// if user is retailer
171
			UserCart uc  = userAccountRepository.getUserCart(userInfo.getUserId());
173
			UserCart uc  = userAccountRepository.getUserCart(userInfo.getUserId());
172
				Retailer retailer  = retailerRepository.selectById(uc.getUserId());
174
				Retailer retailer  = retailerRepository.selectById(uc.getUserId());
-
 
175
				responseMap.put(ProfitMandiConstants.RETAILER_NAME, retailer.getName());
-
 
176
				responseMap.put(ProfitMandiConstants.SELF_PICKUP, retailer.isSelfPickup());
173
				// if retailer is activated 1 then verified retailer
177
				// if retailer is activated 1 then verified retailer
174
				// else if migrated is 1 then old retailer
178
				// else if migrated is 1 then old retailer
175
				// else retailer is not verifed
179
				// else retailer is not verifed
176
				if (retailer.isActive()) {
180
				if (retailer.isActive()) {
-
 
181
					if(retailer.isFofo()){
-
 
182
						responseMap.put(ProfitMandiConstants.USER_STATUS, UserStatus.FOFO.getValue());
-
 
183
					} else {
177
					responseMap.put(ProfitMandiConstants.USER_STATUS, UserStatus.VERIFIED_RETAILER.getValue());
184
						responseMap.put(ProfitMandiConstants.USER_STATUS, UserStatus.VERIFIED_RETAILER.getValue());
-
 
185
					}
178
				} else if (retailer.isMigrated()){
186
				} else if (retailer.isMigrated()){
179
					responseMap.put(ProfitMandiConstants.USER_STATUS, UserStatus.RETAILER.getValue());
187
					responseMap.put(ProfitMandiConstants.USER_STATUS, UserStatus.RETAILER.getValue());
180
				} else {
188
				} else {
181
					responseMap.put(ProfitMandiConstants.USER_STATUS, UserStatus.NOT_VERIFIED_RETAILER.getValue());
189
					responseMap.put(ProfitMandiConstants.USER_STATUS, UserStatus.NOT_VERIFIED_RETAILER.getValue());
182
				}
190
				}