Subversion Repositories SmartDukaan

Rev

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

Rev 34963 Rev 35083
Line 754... Line 754...
754
    }
754
    }
755
 
755
 
756
    @RequestMapping(value = "/createLead", method = RequestMethod.POST)
756
    @RequestMapping(value = "/createLead", method = RequestMethod.POST)
757
    public String CreateLead(HttpServletRequest request, @RequestBody CreateRefferalRequest createRefferalRequest, Model model) throws Exception {
757
    public String CreateLead(HttpServletRequest request, @RequestBody CreateRefferalRequest createRefferalRequest, Model model) throws Exception {
758
        LoginDetails loginDetails = cookiesProcessor.getCookiesObject(request);
758
        LoginDetails loginDetails = cookiesProcessor.getCookiesObject(request);
759
        List<Lead> leadDetailList = leadRepository.selectByMobileNumber(createRefferalRequest.getMobile());
759
        Lead leadDetails = leadRepository.selectByMobileNumber(createRefferalRequest.getMobile());
760
        LOGGER.info("Lead Details {}", leadDetailList);
760
        LOGGER.info("Lead Details {}", leadDetails);
761
 
761
 
762
        if (!leadDetailList.isEmpty() && leadDetailList.get(0).getStatus() != LeadStatus.notInterested) {
762
        if (leadDetails != null && leadDetails.getStatus() != LeadStatus.notInterested) {
763
            AuthUser authUser1 = authRepository.selectById(leadDetailList.get(0).getAssignTo());
763
            AuthUser authUser1 = authRepository.selectById(leadDetails.getAssignTo());
764
            model.addAttribute("response1", "Lead already exists, created by " + leadDetailList.get(0).getCreatedBy() +
764
            model.addAttribute("response1", "Lead already exists, created by " + leadDetails.getCreatedBy() +
765
                    " on " + FormattingUtils.format(leadDetailList.get(0).getCreatedTimestamp()) +
765
                    " on " + FormattingUtils.format(leadDetails.getCreatedTimestamp()) +
766
                    ", assigned to " + authUser1.getFullName());
766
                    ", assigned to " + authUser1.getFullName());
767
            return "response";
767
            return "response";
768
 
768
 
769
 
769
 
770
        }
770
        }