| Line 8... |
Line 8... |
| 8 |
import com.spice.profitmandi.common.util.Utils;
|
8 |
import com.spice.profitmandi.common.util.Utils;
|
| 9 |
import com.spice.profitmandi.common.web.util.ResponseSender;
|
9 |
import com.spice.profitmandi.common.web.util.ResponseSender;
|
| 10 |
import com.spice.profitmandi.dao.entity.auth.AuthUser;
|
10 |
import com.spice.profitmandi.dao.entity.auth.AuthUser;
|
| 11 |
import com.spice.profitmandi.dao.entity.dtr.*;
|
11 |
import com.spice.profitmandi.dao.entity.dtr.*;
|
| 12 |
import com.spice.profitmandi.dao.entity.fofo.*;
|
12 |
import com.spice.profitmandi.dao.entity.fofo.*;
|
| - |
|
13 |
import com.spice.profitmandi.dao.entity.onBoarding.LoiForm;
|
| 13 |
import com.spice.profitmandi.dao.entity.user.Location;
|
14 |
import com.spice.profitmandi.dao.entity.user.Location;
|
| 14 |
import com.spice.profitmandi.dao.entity.user.Promoter;
|
15 |
import com.spice.profitmandi.dao.entity.user.Promoter;
|
| 15 |
import com.spice.profitmandi.dao.entity.user.User;
|
16 |
import com.spice.profitmandi.dao.entity.user.User;
|
| 16 |
import com.spice.profitmandi.dao.repository.auth.AuthRepository;
|
17 |
import com.spice.profitmandi.dao.repository.auth.AuthRepository;
|
| 17 |
import com.spice.profitmandi.dao.repository.cs.CsService;
|
18 |
import com.spice.profitmandi.dao.repository.cs.CsService;
|
| Line 19... |
Line 20... |
| 19 |
import com.spice.profitmandi.dao.repository.dtr.*;
|
20 |
import com.spice.profitmandi.dao.repository.dtr.*;
|
| 20 |
import com.spice.profitmandi.dao.repository.fofo.PartnerTypeChangeRepository;
|
21 |
import com.spice.profitmandi.dao.repository.fofo.PartnerTypeChangeRepository;
|
| 21 |
import com.spice.profitmandi.dao.repository.fofo.PartnerTypeChangeService;
|
22 |
import com.spice.profitmandi.dao.repository.fofo.PartnerTypeChangeService;
|
| 22 |
import com.spice.profitmandi.dao.repository.fofo.PincodePartnerRepository;
|
23 |
import com.spice.profitmandi.dao.repository.fofo.PincodePartnerRepository;
|
| 23 |
import com.spice.profitmandi.dao.repository.user.LocationRepository;
|
24 |
import com.spice.profitmandi.dao.repository.user.LocationRepository;
|
| - |
|
25 |
import com.spice.profitmandi.dao.repository.user.LoiFormRepository;
|
| 24 |
import com.spice.profitmandi.dao.repository.user.PromoterRepository;
|
26 |
import com.spice.profitmandi.dao.repository.user.PromoterRepository;
|
| 25 |
import com.spice.profitmandi.dao.repository.user.UserRepository;
|
27 |
import com.spice.profitmandi.dao.repository.user.UserRepository;
|
| 26 |
import com.spice.profitmandi.dao.repository.warehouse.WarehouseSupplierInvoiceRepository;
|
28 |
import com.spice.profitmandi.dao.repository.warehouse.WarehouseSupplierInvoiceRepository;
|
| 27 |
import com.spice.profitmandi.service.PartnerInvestmentService;
|
29 |
import com.spice.profitmandi.service.PartnerInvestmentService;
|
| 28 |
import com.spice.profitmandi.service.authentication.RoleManager;
|
30 |
import com.spice.profitmandi.service.authentication.RoleManager;
|
| Line 149... |
Line 151... |
| 149 |
}
|
151 |
}
|
| 150 |
}
|
152 |
}
|
| 151 |
return "retailer-details";
|
153 |
return "retailer-details";
|
| 152 |
}
|
154 |
}
|
| 153 |
|
155 |
|
| - |
|
156 |
@Autowired
|
| - |
|
157 |
LoiFormRepository loiFormRepository;
|
| - |
|
158 |
|
| 154 |
@RequestMapping(value = "/retailerDetails", method = RequestMethod.PUT)
|
159 |
@RequestMapping(value = "/retailerDetails", method = RequestMethod.PUT)
|
| 155 |
public String updateRetailerDetails(HttpServletRequest request,
|
160 |
public String updateRetailerDetails(HttpServletRequest request,
|
| 156 |
@RequestBody UpdateRetailerRequest updateRetailerRequest, Model model) throws ProfitMandiBusinessException {
|
161 |
@RequestBody UpdateRetailerRequest updateRetailerRequest, Model model) throws ProfitMandiBusinessException {
|
| 157 |
LOGGER.info("Request Received at url {} with body {}", request.getRequestURI(), updateRetailerRequest);
|
162 |
LOGGER.info("Request Received at url {} with body {}", request.getRequestURI(), updateRetailerRequest);
|
| - |
|
163 |
if (!updateRetailerRequest.getFofoType().equals(FofoType.INTERNAL)) {
|
| - |
|
164 |
LoiForm loiForm = null;
|
| - |
|
165 |
loiForm = loiFormRepository.selectByEmailOrMobile(updateRetailerRequest.getUserMobileNumber());
|
| - |
|
166 |
if (loiForm == null) {
|
| - |
|
167 |
loiForm = loiFormRepository.selectByEqualsKeyValue("gstNo", updateRetailerRequest.getGstNumber());
|
| - |
|
168 |
if (loiForm == null) {
|
| - |
|
169 |
throw new ProfitMandiBusinessException("Loi Not Available of this User", "Message - ", "Please fill the LOI_FORM and try again");
|
| - |
|
170 |
}
|
| - |
|
171 |
}
|
| - |
|
172 |
|
| - |
|
173 |
}
|
| 158 |
Map<String, Object> map = retailerService.updateRetailerDetails(updateRetailerRequest);
|
174 |
Map<String, Object> map = retailerService.updateRetailerDetails(updateRetailerRequest);
|
| 159 |
//retailerService.up
|
175 |
//retailerService.up
|
| 160 |
|
176 |
|
| 161 |
model.addAllAttributes(map);
|
177 |
model.addAllAttributes(map);
|
| 162 |
model.addAttribute("counterSizes", CounterSize.values());
|
178 |
model.addAttribute("counterSizes", CounterSize.values());
|