| Line 3... |
Line 3... |
| 3 |
import com.google.gson.Gson;
|
3 |
import com.google.gson.Gson;
|
| 4 |
import com.mongodb.DBObject;
|
4 |
import com.mongodb.DBObject;
|
| 5 |
import com.spice.profitmandi.common.exception.ProfitMandiBusinessException;
|
5 |
import com.spice.profitmandi.common.exception.ProfitMandiBusinessException;
|
| 6 |
import com.spice.profitmandi.common.model.*;
|
6 |
import com.spice.profitmandi.common.model.*;
|
| 7 |
import com.spice.profitmandi.common.util.FileUtil;
|
7 |
import com.spice.profitmandi.common.util.FileUtil;
|
| - |
|
8 |
import com.spice.profitmandi.common.util.FormattingUtils;
|
| 8 |
import com.spice.profitmandi.common.web.util.ResponseSender;
|
9 |
import com.spice.profitmandi.common.web.util.ResponseSender;
|
| 9 |
import com.spice.profitmandi.dao.entity.auth.AuthUser;
|
10 |
import com.spice.profitmandi.dao.entity.auth.AuthUser;
|
| 10 |
import com.spice.profitmandi.dao.entity.catalog.BrandCatalog;
|
11 |
import com.spice.profitmandi.dao.entity.catalog.BrandCatalog;
|
| 11 |
import com.spice.profitmandi.dao.entity.fofo.PartnerDailyInvestment;
|
12 |
import com.spice.profitmandi.dao.entity.fofo.PartnerDailyInvestment;
|
| 12 |
import com.spice.profitmandi.dao.entity.user.*;
|
13 |
import com.spice.profitmandi.dao.entity.user.*;
|
| Line 616... |
Line 617... |
| 616 |
}
|
617 |
}
|
| 617 |
|
618 |
|
| 618 |
@RequestMapping(value = "/createLead", method = RequestMethod.POST)
|
619 |
@RequestMapping(value = "/createLead", method = RequestMethod.POST)
|
| 619 |
public String CreateLead(HttpServletRequest request, @RequestBody CreateRefferalRequest createRefferalRequest, Model model) throws Exception {
|
620 |
public String CreateLead(HttpServletRequest request, @RequestBody CreateRefferalRequest createRefferalRequest, Model model) throws Exception {
|
| 620 |
LoginDetails loginDetails = cookiesProcessor.getCookiesObject(request);
|
621 |
LoginDetails loginDetails = cookiesProcessor.getCookiesObject(request);
|
| - |
|
622 |
List<Lead> leadDetailList = leadRepository.selectByMobileNumber(createRefferalRequest.getMobile());
|
| - |
|
623 |
LOGGER.info("Lead Details {}", leadDetailList);
|
| - |
|
624 |
|
| - |
|
625 |
if (!leadDetailList.isEmpty()) {
|
| - |
|
626 |
AuthUser authUser1 = authRepository.selectById(leadDetailList.get(0).getAssignTo());
|
| - |
|
627 |
throw new ProfitMandiBusinessException("Duplicate Entry",
|
| - |
|
628 |
"Lead already exists, created by " + leadDetailList.get(0).getCreatedBy() +
|
| - |
|
629 |
" on " + FormattingUtils.format(leadDetailList.get(0).getCreatedTimestamp()) +
|
| - |
|
630 |
", assigned to " + authUser1.getFullName(), "400");
|
| - |
|
631 |
|
| - |
|
632 |
}
|
| 621 |
|
633 |
|
| 622 |
LOGGER.info("createRefferalRequest" + createRefferalRequest.getSchelduleTimestamp());
|
634 |
LOGGER.info("createRefferalRequest" + createRefferalRequest.getSchelduleTimestamp());
|
| 623 |
Lead lead = new Lead();
|
635 |
Lead lead = new Lead();
|
| 624 |
lead.setFirstName(createRefferalRequest.getFirstName());
|
636 |
lead.setFirstName(createRefferalRequest.getFirstName());
|
| 625 |
lead.setLastName(createRefferalRequest.getLastName());
|
637 |
lead.setLastName(createRefferalRequest.getLastName());
|