| Line 176... |
Line 176... |
| 176 |
Map<String, Object> responseMap = new HashMap<>();
|
176 |
Map<String, Object> responseMap = new HashMap<>();
|
| 177 |
UserInfo userInfo = (UserInfo) request.getAttribute("userInfo");
|
177 |
UserInfo userInfo = (UserInfo) request.getAttribute("userInfo");
|
| 178 |
User user = null;
|
178 |
User user = null;
|
| 179 |
if (userInfo.getUserId() > -1) {
|
179 |
if (userInfo.getUserId() > -1) {
|
| 180 |
user = userRepository.selectById(userInfo.getUserId());
|
180 |
user = userRepository.selectById(userInfo.getUserId());
|
| - |
|
181 |
|
| - |
|
182 |
String city = user.getCity();
|
| 181 |
if (!(userInfo.getEmail() == null || user.getEmailId().equalsIgnoreCase(userInfo.getEmail()))) {
|
183 |
if (!(userInfo.getEmail() == null || user.getEmailId().equalsIgnoreCase(userInfo.getEmail()))) {
|
| 182 |
String userName = null;
|
184 |
String userName = null;
|
| 183 |
if (user.getSecondryEmailId() != null && user.getSecondryEmailId().equals(userInfo.getEmail())) {
|
185 |
if (user.getSecondryEmailId() != null && user.getSecondryEmailId().equals(userInfo.getEmail())) {
|
| 184 |
userName = user.getFirstName() + " " + user.getLastName();
|
186 |
userName = user.getFirstName() + " " + user.getLastName();
|
| 185 |
} else {
|
187 |
} else {
|
| Line 187... |
Line 189... |
| 187 |
}
|
189 |
}
|
| 188 |
responseMap.put(ProfitMandiConstants.USER_ID, userInfo.getUserId());
|
190 |
responseMap.put(ProfitMandiConstants.USER_ID, userInfo.getUserId());
|
| 189 |
responseMap.put(ProfitMandiConstants.USER_NAME, userName);
|
191 |
responseMap.put(ProfitMandiConstants.USER_NAME, userName);
|
| 190 |
responseMap.put(ProfitMandiConstants.USER_STATUS, "fofoAssociate");
|
192 |
responseMap.put(ProfitMandiConstants.USER_STATUS, "fofoAssociate");
|
| 191 |
responseMap.put(ProfitMandiConstants.EMAIL_ID, userInfo.getEmail());
|
193 |
responseMap.put(ProfitMandiConstants.EMAIL_ID, userInfo.getEmail());
|
| - |
|
194 |
UserCart uc = userAccountRepository.getUserCart(userInfo.getUserId());
|
| - |
|
195 |
responseMap.put("storeUrl", retailerService.getAllFofoRetailerIdUrlMap().get(uc.getUserId()));
|
| 192 |
return responseSender.ok(responseMap);
|
196 |
return responseSender.ok(responseMap);
|
| 193 |
}
|
197 |
}
|
| 194 |
} else {
|
198 |
} else {
|
| 195 |
try {
|
199 |
try {
|
| 196 |
user = userRepository.selectByEmailId(userInfo.getEmail());
|
200 |
user = userRepository.selectByEmailId(userInfo.getEmail());
|
| Line 238... |
Line 242... |
| 238 |
// is verified retailer
|
242 |
// is verified retailer
|
| 239 |
// else retailer is not verifed
|
243 |
// else retailer is not verifed
|
| 240 |
if (retailer.isActive() || user.isActivated()) {
|
244 |
if (retailer.isActive() || user.isActivated()) {
|
| 241 |
if (roleManager.isPartner(roleIdsSet)) {
|
245 |
if (roleManager.isPartner(roleIdsSet)) {
|
| 242 |
responseMap.put(ProfitMandiConstants.USER_STATUS, UserStatus.FOFO.getValue());
|
246 |
responseMap.put(ProfitMandiConstants.USER_STATUS, UserStatus.FOFO.getValue());
|
| - |
|
247 |
responseMap.put("storeUrl", retailerService.getAllFofoRetailerIdUrlMap().get(uc.getUserId()));
|
| 243 |
} else {
|
248 |
} else {
|
| 244 |
responseMap.put(ProfitMandiConstants.USER_STATUS, UserStatus.VERIFIED_RETAILER.getValue());
|
249 |
responseMap.put(ProfitMandiConstants.USER_STATUS, UserStatus.VERIFIED_RETAILER.getValue());
|
| 245 |
}
|
250 |
}
|
| 246 |
} else if (retailer.isMigrated()) {
|
251 |
} else if (retailer.isMigrated()) {
|
| 247 |
responseMap.put(ProfitMandiConstants.USER_STATUS, UserStatus.RETAILER.getValue());
|
252 |
responseMap.put(ProfitMandiConstants.USER_STATUS, UserStatus.RETAILER.getValue());
|
| Line 721... |
Line 726... |
| 721 |
int retailerId = userAccountRepository.selectRetailerIdByUserId(userId);
|
726 |
int retailerId = userAccountRepository.selectRetailerIdByUserId(userId);
|
| 722 |
PartnerType partnerType = partnerTypeChangeService.getTypeOnDate(retailerId, LocalDate.now());
|
727 |
PartnerType partnerType = partnerTypeChangeService.getTypeOnDate(retailerId, LocalDate.now());
|
| 723 |
|
728 |
|
| 724 |
return responseSender.ok(partnerType);
|
729 |
return responseSender.ok(partnerType);
|
| 725 |
}
|
730 |
}
|
| 726 |
|
- |
|
| 727 |
}
|
731 |
}
|