Subversion Repositories SmartDukaan

Rev

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

Rev 33525 Rev 33568
Line 147... Line 147...
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 = "/submitOnboardingForm", method = RequestMethod.POST)
152
    public String submitLoiForm(HttpServletRequest request, @RequestBody LoiFormData formData, 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
        boolean isDataCreated = loiFormService.createLoiForm(formData);
154
        boolean isDataCreated = loiFormService.createLoiForm(loiFormData);
155
        List<LoiFormModel> formList = loiFormService.pendingFormList(loginDetails.getEmailId());
155
        List<LoiFormModel> formList = loiFormService.pendingFormList(loginDetails.getEmailId());
156
        model.addAttribute("formList", formList);
156
        model.addAttribute("formList", formList);
157
        if (isDataCreated) {
157
        if (isDataCreated) {
158
            model.addAttribute("response1", mvcResponseSender.createResponseString(true));
158
            model.addAttribute("response1", mvcResponseSender.createResponseString(true));
159
            return "response";
159
            return "response";
Line 381... Line 381...
381
    public String sentLoiAcceptanceOtp(@RequestParam int loiId, Model model) throws Exception {
381
    public String sentLoiAcceptanceOtp(@RequestParam int loiId, Model model) throws Exception {
382
        LoiForm pod = loiFormRepository.selectById(loiId);
382
        LoiForm pod = loiFormRepository.selectById(loiId);
383
        String mobile = String.valueOf(pod.getMobile());
383
        String mobile = String.valueOf(pod.getMobile());
384
        OTPResponse otpResponse = otpProcessor.generateOtp(mobile, OtpType.LOI_ACCEPTANCE);
384
        OTPResponse otpResponse = otpProcessor.generateOtp(mobile, OtpType.LOI_ACCEPTANCE);
385
        String message = "OTP send to your register mobile number -";
385
        String message = "OTP send to your register mobile number -";
386
        if (otpResponse.getMessage().equals("OTP generated successfully") && otpResponse.getMessage().equals("OTP generated less than 2 minutes ago")) {
386
        LOGGER.info("OTPResponse Message - " + otpResponse.getMessage());
-
 
387
        if (otpResponse.isResult()) {
387
            model.addAttribute("response1", mvcResponseSender.createResponseString(message + mobile));
388
            model.addAttribute("response1", mvcResponseSender.createResponseString(message + mobile));
-
 
389
            return "response";
388
        } else {
390
        } else {
389
            model.addAttribute("response1", mvcResponseSender.createResponseString("Something went wrong.."));
391
            model.addAttribute("response1", mvcResponseSender.createResponseString("Something went wrong.."));
-
 
392
            return "response";
390
        }
393
        }
391
        return "response";
-
 
392
    }
394
    }
393
 
395
 
394
    @RequestMapping(value = "/validateLoiOtp", method = RequestMethod.PUT)
396
    @RequestMapping(value = "/validateLoiOtp", method = RequestMethod.PUT)
395
    public String validateLoiAcceptanceOtp(@RequestParam int loiId, @RequestParam String provideOtp, Model model) throws Exception {
397
    public String validateLoiAcceptanceOtp(@RequestParam int loiId, @RequestParam String provideOtp, Model model) throws Exception {
396
        LOGGER.info("loiId -" + loiId);
398
        LOGGER.info("loiId -" + loiId);