Commit 68ef9ea3 by 王祖波

机会人群建联校验

parent 09375e00
...@@ -108,30 +108,37 @@ public class ContactLogServiceImpl implements ContactLogService { ...@@ -108,30 +108,37 @@ public class ContactLogServiceImpl implements ContactLogService {
params.setStoreId(storeId); params.setStoreId(storeId);
params.setClerkId(clerkId); params.setClerkId(clerkId);
params.setEnterpriseId(enterpriseId); params.setEnterpriseId(enterpriseId);
if (Objects.equals(bizType, ContactBizTypeEnum.POTENTIAL_CUSTOMER.getType())) { if (bizType!=null) {
return checkPotential(memberId, params); return checkPotential(memberId, params, bizType);
} else if (Objects.equals(bizType, ContactBizTypeEnum.OPPORTUNITY_CUSTOMER.getType())) {
// todo 机会人群是否能建联
} else { } else {
boolean checkPotential = checkPotential(memberId, params); boolean checkPotential = checkPotential(memberId, params, ContactBizTypeEnum.POTENTIAL_CUSTOMER.getType());
if (checkPotential) {
return true;
}
checkPotential = checkPotential(memberId, params, ContactBizTypeEnum.OPPORTUNITY_CUSTOMER.getType());
if (checkPotential) { if (checkPotential) {
return true; return true;
} }
// todo 机会人群是否能建联
} }
return false; return false;
} }
private boolean checkPotential(String memberId, CustomerDTO params) { private boolean checkPotential(String memberId, CustomerDTO params,Integer bizType) {
boolean hasRight = enterpriseAdaptor.checkEnterpriseHasRightByContactBizType(params.getEnterpriseId(), ContactBizTypeEnum.POTENTIAL_CUSTOMER.getType()); boolean hasRight = enterpriseAdaptor.checkEnterpriseHasRightByContactBizType(params.getEnterpriseId(), bizType);
if (!hasRight) { if (!hasRight) {
return false; return false;
} }
ContactParamDTO contact = new ContactParamDTO(); ContactParamDTO contact = new ContactParamDTO();
// 搜索信息 // 搜索信息
MemberInfoListParamsDTO memberInfoListParamsDTO = com.gic.haoban.common.utils.StringUtil.getBean("{}", MemberInfoListParamsDTO.class); MemberInfoListParamsDTO memberInfoListParamsDTO = com.gic.haoban.common.utils.StringUtil.getBean("{}", MemberInfoListParamsDTO.class);
if (Objects.equals(bizType, ContactBizTypeEnum.OPPORTUNITY_CUSTOMER.getType())) {
memberInfoListParamsDTO.setCrowdClerkId(params.getClerkId());
memberInfoListParamsDTO.setCrowdType(-1);
memberInfoListParamsDTO.setMemberType(-1);
}
memberInfoListParamsDTO.setMemberId(memberId); memberInfoListParamsDTO.setMemberId(memberId);
contact.setContactType(0); contact.setContactType(0);
contact.setBizType(bizType);
params.setContactParamDTO(contact); params.setContactParamDTO(contact);
ServiceResponse<ContactSumDTO> noContactResponse = customerApiService.contactMemberSum(new BasePageInfo(), params, memberInfoListParamsDTO); ServiceResponse<ContactSumDTO> noContactResponse = customerApiService.contactMemberSum(new BasePageInfo(), params, memberInfoListParamsDTO);
if (noContactResponse.isSuccess() && noContactResponse.getResult() != null) { if (noContactResponse.isSuccess() && noContactResponse.getResult() != null) {
......
...@@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSON; ...@@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSON;
import com.gic.api.base.commons.BasePageInfo; import com.gic.api.base.commons.BasePageInfo;
import com.gic.api.base.commons.Page; import com.gic.api.base.commons.Page;
import com.gic.api.base.commons.ServiceResponse; import com.gic.api.base.commons.ServiceResponse;
import com.gic.haoban.manage.api.constants.Manage3Constants;
import com.gic.haoban.manage.api.dto.contact.ContactOrderDetailDTO; import com.gic.haoban.manage.api.dto.contact.ContactOrderDetailDTO;
import com.gic.haoban.manage.api.qdto.contact.ContactOrderQDTO; import com.gic.haoban.manage.api.qdto.contact.ContactOrderQDTO;
import com.gic.haoban.manage.api.qdto.contact.ContactOrderSearchQDTO; import com.gic.haoban.manage.api.qdto.contact.ContactOrderSearchQDTO;
...@@ -47,7 +48,7 @@ public class ContactOrderApiServiceImpl implements ContactOrderApiService { ...@@ -47,7 +48,7 @@ public class ContactOrderApiServiceImpl implements ContactOrderApiService {
} }
OrderInfoResp result = serviceResponse.getResult(); OrderInfoResp result = serviceResponse.getResult();
boolean clearFlag = CollectionUtils.isNotEmpty(result.getOrderItems()) && result.getPaidAmount() > 0 boolean clearFlag = CollectionUtils.isNotEmpty(result.getOrderItems()) && result.getPaidAmount() > 0
&& (result.getReceiptsDate() != null && DateUtil.compare(DateUtil.offsetDay(new Date(), -14), result.getReceiptsDate()) <= 0); && (result.getReceiptsDate() != null && DateUtil.compare(DateUtil.offsetDay(new Date(), -Manage3Constants.CONTACT_ORDER_LIMIT_DAY), result.getReceiptsDate()) <= 0);
log.info("获取订单时间,orderId:{},单据时间:{},应收:{}", result.getOrderId(),result.getReceiptsDate(),result.getPaidAmount()); log.info("获取订单时间,orderId:{},单据时间:{},应收:{}", result.getOrderId(),result.getReceiptsDate(),result.getPaidAmount());
boolean contactOrder = contactOrderService.saveContactOrder(result); boolean contactOrder = contactOrderService.saveContactOrder(result);
log.info("clearFlag:{},contactOrder:{}", clearFlag, contactOrder); log.info("clearFlag:{},contactOrder:{}", clearFlag, contactOrder);
......
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