Commit 5385318b by 王祖波

客户详情建联sourceType

parent a3ecef4e
...@@ -18,7 +18,7 @@ public interface ContactLogService { ...@@ -18,7 +18,7 @@ public interface ContactLogService {
* @param clerkDTO * @param clerkDTO
* @return * @return
*/ */
boolean contactCheck(String enterpriseId, String memberId, ClerkDTO clerkDTO,Integer bizType) ; Integer contactCheck(String enterpriseId, String memberId, ClerkDTO clerkDTO,Integer bizType) ;
/** /**
* 保存建联记录 * 保存建联记录
......
...@@ -90,14 +90,14 @@ public class ContactLogServiceImpl implements ContactLogService { ...@@ -90,14 +90,14 @@ public class ContactLogServiceImpl implements ContactLogService {
private EnterpriseAdaptor enterpriseAdaptor; private EnterpriseAdaptor enterpriseAdaptor;
@Override @Override
public boolean contactCheck(String enterpriseId,String memberId,ClerkDTO clerkDTO,Integer bizType) { public Integer contactCheck(String enterpriseId,String memberId,ClerkDTO clerkDTO,Integer bizType) {
if (clerkDTO == null) { if (clerkDTO == null) {
return false; return null;
} }
CustomerDTO params = new CustomerDTO(); CustomerDTO params = new CustomerDTO();
int clerkType = clerkDTO.getClerkType(); int clerkType = clerkDTO.getClerkType();
if (clerkType >= 2) { if (clerkType >= 2) {
return false; return null;
} }
String clerkId = clerkDTO.getClerkId(); String clerkId = clerkDTO.getClerkId();
String storeId = ""; String storeId = "";
...@@ -110,18 +110,19 @@ public class ContactLogServiceImpl implements ContactLogService { ...@@ -110,18 +110,19 @@ public class ContactLogServiceImpl implements ContactLogService {
params.setClerkId(clerkId); params.setClerkId(clerkId);
params.setEnterpriseId(enterpriseId); params.setEnterpriseId(enterpriseId);
if (bizType!=null) { if (bizType!=null) {
return checkPotential(memberId, params, bizType); boolean checkPotential = checkPotential(memberId, params, bizType);
return !checkPotential ? null : bizType;
} else { } else {
boolean checkPotential = checkPotential(memberId, params, ContactBizTypeEnum.POTENTIAL_CUSTOMER.getType()); boolean checkPotential = checkPotential(memberId, params, ContactBizTypeEnum.POTENTIAL_CUSTOMER.getType());
if (checkPotential) { if (checkPotential) {
return true; return ContactBizTypeEnum.POTENTIAL_CUSTOMER.getType();
} }
checkPotential = checkPotential(memberId, params, ContactBizTypeEnum.OPPORTUNITY_CUSTOMER.getType()); checkPotential = checkPotential(memberId, params, ContactBizTypeEnum.OPPORTUNITY_CUSTOMER.getType());
if (checkPotential) { if (checkPotential) {
return true; return ContactBizTypeEnum.OPPORTUNITY_CUSTOMER.getType();
} }
} }
return false; return null;
} }
private boolean checkPotential(String memberId, CustomerDTO params,Integer bizType) { private boolean checkPotential(String memberId, CustomerDTO params,Integer bizType) {
...@@ -189,11 +190,12 @@ public class ContactLogServiceImpl implements ContactLogService { ...@@ -189,11 +190,12 @@ public class ContactLogServiceImpl implements ContactLogService {
} }
ClerkDTO clerkDTO = clerkService.getClerkByClerkId(clerkId); ClerkDTO clerkDTO = clerkService.getClerkByClerkId(clerkId);
// 建联校验 // 建联校验
boolean contactCheck = contactCheck(enterpriseId, memberId, clerkDTO, bizType); Integer contactCheck = contactCheck(enterpriseId, memberId, clerkDTO, bizType);
logger.info("非未建联或建联未转化:{}",contactCheck); logger.info("非未建联或建联未转化:{}",contactCheck);
if (!contactCheck) { if (contactCheck == null) {
throw new BusinessException("-1", "非未建联或建联未转化,无法建联"); throw new BusinessException("-1", "非未建联或建联未转化,无法建联");
} }
bizType = contactCheck;
// 是否周期内首次建联 同周期内是否有记录 // 是否周期内首次建联 同周期内是否有记录
Integer contactCycle = 1; Integer contactCycle = 1;
// 建联周期 14天内同周期/14天以上周期+1 // 建联周期 14天内同周期/14天以上周期+1
......
...@@ -78,7 +78,7 @@ public class ContactLogApiServiceImpl implements ContactLogApiService { ...@@ -78,7 +78,7 @@ public class ContactLogApiServiceImpl implements ContactLogApiService {
if (clerkDTO == null) { if (clerkDTO == null) {
return ServiceResponse.success(Boolean.FALSE); return ServiceResponse.success(Boolean.FALSE);
} }
boolean check = contactLogService.contactCheck(checkQDTO.getEnterpriseId(), checkQDTO.getMemberId(), clerkDTO,checkQDTO.getBizType()); Integer contactCheck = contactLogService.contactCheck(checkQDTO.getEnterpriseId(), checkQDTO.getMemberId(), clerkDTO, checkQDTO.getBizType());
return ServiceResponse.success(check); return ServiceResponse.success(contactCheck != null);
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment