| Line 146... |
Line 146... |
| 146 |
return new ResponseEntity(errorMsg, HttpStatus.INTERNAL_SERVER_ERROR);
|
146 |
return new ResponseEntity(errorMsg, HttpStatus.INTERNAL_SERVER_ERROR);
|
| 147 |
}
|
147 |
}
|
| 148 |
}
|
148 |
}
|
| 149 |
|
149 |
|
| 150 |
// bind the form data and save in fofo.Onboarding_form table
|
150 |
// bind the form data and save in fofo.Onboarding_form table
|
| 151 |
@RequestMapping(value = "/submitOnboardingForm", method = RequestMethod.POST)
|
151 |
@RequestMapping(value = "/submitLoiForm", method = RequestMethod.POST)
|
| 152 |
public String submitLoiForm(HttpServletRequest request, @RequestBody LoiFormData loiFormData, Model model) throws Exception {
|
152 |
public String submitLoiForm(HttpServletRequest request, @RequestBody LoiFormData loiFormData, Model model) throws Exception {
|
| 153 |
LoginDetails loginDetails = cookiesProcessor.getCookiesObject(request);
|
153 |
LoginDetails loginDetails = cookiesProcessor.getCookiesObject(request);
|
| - |
|
154 |
LOGGER.info("filledBy - " + loginDetails.getEmailId());
|
| 154 |
boolean isDataCreated = loiFormService.createLoiForm(loiFormData);
|
155 |
boolean isDataCreated = loiFormService.createLoiForm(loiFormData, loginDetails.getEmailId());
|
| 155 |
List<LoiFormModel> formList = loiFormService.pendingFormList(loginDetails.getEmailId());
|
156 |
List<LoiFormModel> formList = loiFormService.pendingFormList(loginDetails.getEmailId());
|
| 156 |
model.addAttribute("formList", formList);
|
157 |
model.addAttribute("formList", formList);
|
| 157 |
if (isDataCreated) {
|
158 |
if (isDataCreated) {
|
| 158 |
model.addAttribute("response1", mvcResponseSender.createResponseString(true));
|
159 |
model.addAttribute("response1", mvcResponseSender.createResponseString(true));
|
| 159 |
return "response";
|
160 |
return "response";
|
| Line 203... |
Line 204... |
| 203 |
model.addAttribute("pod", loiForm);
|
204 |
model.addAttribute("pod", loiForm);
|
| 204 |
return "auto-Loi";
|
205 |
return "auto-Loi";
|
| 205 |
|
206 |
|
| 206 |
}
|
207 |
}
|
| 207 |
|
208 |
|
| 208 |
@RequestMapping("saveLoiDoc")
|
209 |
@RequestMapping("/saveLoiDoc")
|
| 209 |
public String saveLoiDoc(@RequestParam int loiId, @RequestParam int loiDocId, Model model) throws Exception {
|
210 |
public String saveLoiDoc(@RequestParam int loiId, @RequestParam int loiDocId, Model model) throws Exception {
|
| 210 |
LOGGER.info("loi_docId-" + loiDocId);
|
211 |
LOGGER.info("loi_docId-" + loiDocId);
|
| 211 |
LoiForm loiForm = loiFormRepository.selectById(loiId);
|
212 |
LoiForm loiForm = loiFormRepository.selectById(loiId);
|
| 212 |
LOGGER.info("loiForm - " + loiForm);
|
213 |
LOGGER.info("loiForm - " + loiForm);
|
| 213 |
int loiDoc = loiForm.getLoiDoc();
|
214 |
int loiDoc = loiForm.getLoiDoc();
|
| Line 241... |
Line 242... |
| 241 |
model.addAttribute("authUsersList", salesAuthList);
|
242 |
model.addAttribute("authUsersList", salesAuthList);
|
| 242 |
model.addAttribute("onBoardingData", loiForm);
|
243 |
model.addAttribute("onBoardingData", loiForm);
|
| 243 |
return "partner-onboarding-form";
|
244 |
return "partner-onboarding-form";
|
| 244 |
}
|
245 |
}
|
| 245 |
|
246 |
|
| 246 |
@RequestMapping(value = "/updateOnboardingFormData", method = RequestMethod.POST)
|
247 |
@RequestMapping(value = "/updateLoiFormData", method = RequestMethod.POST)
|
| 247 |
public String UpdateLoiFormDetail(HttpServletRequest request,
|
248 |
public String UpdateLoiFormDetail(HttpServletRequest request,
|
| 248 |
@RequestParam int loiId,
|
249 |
@RequestParam int loiId,
|
| 249 |
@RequestBody LoiFormData partnerOnBoardingFormData,
|
250 |
@RequestBody LoiFormData partnerOnBoardingFormData,
|
| 250 |
Model model) throws Exception {
|
251 |
Model model) throws Exception {
|
| 251 |
LoginDetails loginDetails = cookiesProcessor.getCookiesObject(request);
|
252 |
LoginDetails loginDetails = cookiesProcessor.getCookiesObject(request);
|
| Line 403... |
Line 404... |
| 403 |
String mobile = String.valueOf(pod.getMobile());
|
404 |
String mobile = String.valueOf(pod.getMobile());
|
| 404 |
Otp otp = otpRepository.selectAllByMobileWithTime(mobile).get(0);
|
405 |
Otp otp = otpRepository.selectAllByMobileWithTime(mobile).get(0);
|
| 405 |
LOGGER.info("otp-" + otp);
|
406 |
LOGGER.info("otp-" + otp);
|
| 406 |
OTPResponse otpResponse = otpProcessor.validateOtp(otp.getId(), mobile, provideOtp);
|
407 |
OTPResponse otpResponse = otpProcessor.validateOtp(otp.getId(), mobile, provideOtp);
|
| 407 |
if (!otpResponse.isResult()) {
|
408 |
if (!otpResponse.isResult()) {
|
| 408 |
model.addAttribute("response1", mvcResponseSender.createResponseString(false));
|
- |
|
| 409 |
throw new ProfitMandiBusinessException("Your given OTP ", provideOtp, " is wrong.");
|
409 |
throw new ProfitMandiBusinessException("Wrong OTP", provideOtp, "Your given Otp ->" + provideOtp + " is wrong , please check OTP and try again");
|
| 410 |
}
|
410 |
}
|
| 411 |
if (otpResponse.isResult()) {
|
411 |
if (otpResponse.isResult()) {
|
| 412 |
pod.setLoiSignOtp(provideOtp);
|
412 |
pod.setLoiSignOtp(provideOtp);
|
| 413 |
pod.setLoiSignedOn(LocalDateTime.now());
|
413 |
pod.setLoiSignedOn(LocalDateTime.now());
|
| 414 |
if (brandFee == totalCollectfee && pod.getLoiSignOtp() != null) {
|
414 |
if (brandFee == totalCollectfee && pod.getLoiSignOtp() != null) {
|