Commit 5385318b by 王祖波

客户详情建联sourceType

parent a3ecef4e
......@@ -18,7 +18,7 @@ public interface ContactLogService {
* @param clerkDTO
* @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 {
private EnterpriseAdaptor enterpriseAdaptor;
@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) {
return false;
return null;
}
CustomerDTO params = new CustomerDTO();
int clerkType = clerkDTO.getClerkType();
if (clerkType >= 2) {
return false;
return null;
}
String clerkId = clerkDTO.getClerkId();
String storeId = "";
......@@ -110,18 +110,19 @@ public class ContactLogServiceImpl implements ContactLogService {
params.setClerkId(clerkId);
params.setEnterpriseId(enterpriseId);
if (bizType!=null) {
return checkPotential(memberId, params, bizType);
boolean checkPotential = checkPotential(memberId, params, bizType);
return !checkPotential ? null : bizType;
} else {
boolean checkPotential = checkPotential(memberId, params, ContactBizTypeEnum.POTENTIAL_CUSTOMER.getType());
if (checkPotential) {
return true;
return ContactBizTypeEnum.POTENTIAL_CUSTOMER.getType();
}
checkPotential = checkPotential(memberId, params, ContactBizTypeEnum.OPPORTUNITY_CUSTOMER.getType());
if (checkPotential) {
return true;
return ContactBizTypeEnum.OPPORTUNITY_CUSTOMER.getType();
}
}
return false;
return null;
}
private boolean checkPotential(String memberId, CustomerDTO params,Integer bizType) {
......@@ -189,11 +190,12 @@ public class ContactLogServiceImpl implements ContactLogService {
}
ClerkDTO clerkDTO = clerkService.getClerkByClerkId(clerkId);
// 建联校验
boolean contactCheck = contactCheck(enterpriseId, memberId, clerkDTO, bizType);
Integer contactCheck = contactCheck(enterpriseId, memberId, clerkDTO, bizType);
logger.info("非未建联或建联未转化:{}",contactCheck);
if (!contactCheck) {
if (contactCheck == null) {
throw new BusinessException("-1", "非未建联或建联未转化,无法建联");
}
bizType = contactCheck;
// 是否周期内首次建联 同周期内是否有记录
Integer contactCycle = 1;
// 建联周期 14天内同周期/14天以上周期+1
......
......@@ -78,7 +78,7 @@ public class ContactLogApiServiceImpl implements ContactLogApiService {
if (clerkDTO == null) {
return ServiceResponse.success(Boolean.FALSE);
}
boolean check = contactLogService.contactCheck(checkQDTO.getEnterpriseId(), checkQDTO.getMemberId(), clerkDTO,checkQDTO.getBizType());
return ServiceResponse.success(check);
Integer contactCheck = contactLogService.contactCheck(checkQDTO.getEnterpriseId(), checkQDTO.getMemberId(), clerkDTO, checkQDTO.getBizType());
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