| Line 6... |
Line 6... |
| 6 |
import com.spice.profitmandi.common.exception.ProfitMandiBusinessException;
|
6 |
import com.spice.profitmandi.common.exception.ProfitMandiBusinessException;
|
| 7 |
import com.spice.profitmandi.common.model.CustomRetailer;
|
7 |
import com.spice.profitmandi.common.model.CustomRetailer;
|
| 8 |
import com.spice.profitmandi.common.model.ProfitMandiConstants;
|
8 |
import com.spice.profitmandi.common.model.ProfitMandiConstants;
|
| 9 |
import com.spice.profitmandi.common.model.SendNotificationModel;
|
9 |
import com.spice.profitmandi.common.model.SendNotificationModel;
|
| 10 |
import com.spice.profitmandi.common.util.FileUtil;
|
10 |
import com.spice.profitmandi.common.util.FileUtil;
|
| - |
|
11 |
import com.spice.profitmandi.common.util.FormattingUtils;
|
| 11 |
import com.spice.profitmandi.common.web.util.ResponseSender;
|
12 |
import com.spice.profitmandi.common.web.util.ResponseSender;
|
| 12 |
import com.spice.profitmandi.dao.entity.auth.AuthUser;
|
13 |
import com.spice.profitmandi.dao.entity.auth.AuthUser;
|
| 13 |
import com.spice.profitmandi.dao.entity.auth.PartnerCollectionPlan;
|
14 |
import com.spice.profitmandi.dao.entity.auth.PartnerCollectionPlan;
|
| 14 |
import com.spice.profitmandi.dao.entity.auth.PartnerCollectionRemark;
|
15 |
import com.spice.profitmandi.dao.entity.auth.PartnerCollectionRemark;
|
| 15 |
import com.spice.profitmandi.dao.entity.auth.PartnerSecondaryPlan;
|
16 |
import com.spice.profitmandi.dao.entity.auth.PartnerSecondaryPlan;
|
| Line 188... |
Line 189... |
| 188 |
LOGGER.info("CreateRefferalRequest - " + createRefferalRequest);
|
189 |
LOGGER.info("CreateRefferalRequest - " + createRefferalRequest);
|
| 189 |
if (createRefferalRequest.getOutletName() == null || createRefferalRequest.getPotential() == 0) {
|
190 |
if (createRefferalRequest.getOutletName() == null || createRefferalRequest.getPotential() == 0) {
|
| 190 |
throw new Exception("Outlet should not be empty and potential shoul be greator > 0");
|
191 |
throw new Exception("Outlet should not be empty and potential shoul be greator > 0");
|
| 191 |
}
|
192 |
}
|
| 192 |
List<Lead> leadDetail = leadRepository.selectByMobileNumber(createRefferalRequest.getMobile());
|
193 |
List<Lead> leadDetail = leadRepository.selectByMobileNumber(createRefferalRequest.getMobile());
|
| - |
|
194 |
AuthUser authUser1 = authRepository.selectById(leadDetail.get(0).getAssignTo());
|
| 193 |
LOGGER.info("Lead Details {}", leadDetail);
|
195 |
LOGGER.info("Lead Details {}", leadDetail);
|
| 194 |
if(!leadDetail.isEmpty()){
|
196 |
if(!leadDetail.isEmpty()){
|
| 195 |
return responseSender.ok("Lead Already created by "+leadDetail.get(0).getCreatedBy());
|
197 |
return responseSender.ok(" Duplicate Entry: Lead already exists, created by "+ leadDetail.get(0).getCreatedBy()+ " on " + FormattingUtils.format(leadDetail.get(0).getCreatedTimestamp())+ "assigned to " + authUser1.getFullName() );
|
| - |
|
198 |
|
| 196 |
}
|
199 |
}
|
| 197 |
|
200 |
|
| 198 |
Lead lead = new Lead();
|
201 |
Lead lead = new Lead();
|
| 199 |
lead.setFirstName(createRefferalRequest.getFirstName());
|
202 |
lead.setFirstName(createRefferalRequest.getFirstName());
|
| 200 |
lead.setLastName(createRefferalRequest.getLastName());
|
203 |
lead.setLastName(createRefferalRequest.getLastName());
|