| Line 118... |
Line 118... |
| 118 |
public String retailerInfoByEmailIdOrMobileNumber(HttpServletRequest request,
|
118 |
public String retailerInfoByEmailIdOrMobileNumber(HttpServletRequest request,
|
| 119 |
@RequestParam(name = ProfitMandiConstants.EMAIL_ID_OR_MOBILE_NUMBER) String emailIdOrMobileNumber,
|
119 |
@RequestParam(name = ProfitMandiConstants.EMAIL_ID_OR_MOBILE_NUMBER) String emailIdOrMobileNumber,
|
| 120 |
Model model) throws ProfitMandiBusinessException {
|
120 |
Model model) throws ProfitMandiBusinessException {
|
| 121 |
LOGGER.info("Request Received at url {} with emailIdOrMobileNumber {}", request.getRequestURI(),
|
121 |
LOGGER.info("Request Received at url {} with emailIdOrMobileNumber {}", request.getRequestURI(),
|
| 122 |
emailIdOrMobileNumber);
|
122 |
emailIdOrMobileNumber);
|
| 123 |
try {
|
- |
|
| 124 |
|
- |
|
| 125 |
Map<String, Object> map = retailerService.getByEmailIdOrMobileNumber(emailIdOrMobileNumber);
|
123 |
Map<String, Object> map = retailerService.getByEmailIdOrMobileNumber(emailIdOrMobileNumber);
|
| 126 |
model.addAllAttributes(map);
|
124 |
model.addAllAttributes(map);
|
| 127 |
if (map.containsKey("retailer")) {
|
- |
|
| 128 |
Retailer retailer = (Retailer) map.get("retailer");
|
- |
|
| 129 |
User user = userRepository.selectById(retailer.getId());
|
- |
|
| 130 |
if (user.getLocation() != null) {
|
- |
|
| 131 |
Location location = locationRepository.selectById(user.getLocation());
|
- |
|
| 132 |
model.addAttribute("locationdetail", location);
|
- |
|
| 133 |
LOGGER.info("location" + location);
|
- |
|
| 134 |
}
|
- |
|
| 135 |
}
|
- |
|
| 136 |
} catch(Exception e) {
|
- |
|
| 137 |
//Do nothing
|
- |
|
| 138 |
}
|
- |
|
| 139 |
model.addAttribute("counterSizes", CounterSize.values());
|
125 |
model.addAttribute("counterSizes", CounterSize.values());
|
| 140 |
Map<Integer, String> warehouseMap = ProfitMandiConstants.WAREHOUSE_MAP;
|
126 |
Map<Integer, String> warehouseMap = ProfitMandiConstants.WAREHOUSE_MAP;
|
| 141 |
LOGGER.info("warehouseMap", warehouseMap);
|
127 |
LOGGER.info("warehouseMap", warehouseMap);
|
| 142 |
model.addAttribute("warehouses", warehouseMap);
|
128 |
model.addAttribute("warehouses", warehouseMap);
|
| - |
|
129 |
if (map.containsKey("retailer")) {
|
| - |
|
130 |
Retailer retailer = (Retailer) map.get("retailer");
|
| - |
|
131 |
User user = userRepository.selectById(retailer.getId());
|
| - |
|
132 |
if (user.getLocation() != null) {
|
| - |
|
133 |
Location location = locationRepository.selectById(user.getLocation());
|
| - |
|
134 |
model.addAttribute("locationdetail", location);
|
| - |
|
135 |
LOGGER.info("location" + location);
|
| - |
|
136 |
}
|
| - |
|
137 |
}
|
| 143 |
return "retailer-details";
|
138 |
return "retailer-details";
|
| 144 |
}
|
139 |
}
|
| 145 |
|
140 |
|
| 146 |
@RequestMapping(value = "/retailerDetails", method = RequestMethod.PUT)
|
141 |
@RequestMapping(value = "/retailerDetails", method = RequestMethod.PUT)
|
| 147 |
public String updateRetailerDetails(HttpServletRequest request,
|
142 |
public String updateRetailerDetails(HttpServletRequest request,
|