Commit c90d1a7d by 王祖波

记录是否自动建联

parent f8a7b21f
package com.gic.haoban.manage.api.qdto.contact;
import com.gic.api.base.commons.Constant;
import com.gic.haoban.manage.api.enums.contact.ContactAutoTypeEnum;
import com.gic.haoban.manage.api.enums.contact.ContactBizTypeEnum;
import com.gic.haoban.manage.api.enums.contact.ContactFollowTypeEnum;
......@@ -48,6 +49,11 @@ public class ContactLogQDTO implements Serializable {
private Integer contactAutoType;
/**
* 是否自动建联 1是0否
*/
private Integer autoFlag = Constant.FLAG_FALSE;
/**
* 是否同步建联
*/
private Integer syncContactType;
......@@ -149,6 +155,14 @@ public class ContactLogQDTO implements Serializable {
this.contactAutoType = contactAutoType;
}
public Integer getAutoFlag() {
return autoFlag;
}
public void setAutoFlag(Integer autoFlag) {
this.autoFlag = autoFlag;
}
public Integer getSyncContactType() {
return syncContactType;
}
......
......@@ -90,6 +90,10 @@ public class TabContactLog implements Serializable {
*/
private String followTypes;
/**
* 是否自动建联 1是0否
*/
private Integer autoFlag;
/**
* 企业id
*/
private String enterpriseId;
......@@ -250,6 +254,14 @@ public class TabContactLog implements Serializable {
this.followTypes = followTypes;
}
public Integer getAutoFlag() {
return autoFlag;
}
public void setAutoFlag(Integer autoFlag) {
this.autoFlag = autoFlag;
}
public String getEnterpriseId() {
return enterpriseId;
}
......
......@@ -177,6 +177,7 @@ public class ContactLogServiceImpl implements ContactLogService {
Integer bizType = qdto.getBizType();
Integer sourceType = qdto.getSourceType();
Long sourceLogId = qdto.getSourceLogId();
Integer autoFlag = qdto.getAutoFlag();
Date date = qdto.getSyncContactTime() != null ? qdto.getSyncContactTime() : DateUtil.date();
MemberStoreClerkDTO memberStoreClerk = memberService.getMemberStoreClerk(memberId);
if (memberStoreClerk == null) {
......@@ -252,6 +253,7 @@ public class ContactLogServiceImpl implements ContactLogService {
contactLog.setBizType(bizType);
contactLog.setEnterpriseId(enterpriseId);
contactLog.setSourceLogId(sourceLogId);
contactLog.setAutoFlag(autoFlag);
contactLogMapper.insert(contactLog);
// 刷新es建联时间
Long clerkContactTime = Long.parseLong(DateUtil.format(date, DatePattern.PURE_DATETIME_PATTERN));
......@@ -267,7 +269,7 @@ public class ContactLogServiceImpl implements ContactLogService {
}
// 同步建联
if (!Objects.equals(qdto.getSyncContactType(), Constant.FLAG_TRUE)) {
syncContactSend(contactLog,followRemark);
syncContactSend(contactLog,followRemark,autoFlag);
}
// 冗余机会人群数据
if (Objects.equals(bizType, ContactBizTypeEnum.OPPORTUNITY_CUSTOMER.getType())) {
......@@ -299,7 +301,7 @@ public class ContactLogServiceImpl implements ContactLogService {
}
}
private void syncContactSend(TabContactLog contactLog,String followRemark) {
private void syncContactSend(TabContactLog contactLog,String followRemark,Integer autoFlag) {
// 同步建联
ContactLogQDTO contactLogQDTO = EntityUtil.changeEntityNew(ContactLogQDTO.class, contactLog);
contactLogQDTO.setSyncContactType(Constant.FLAG_TRUE);
......@@ -307,6 +309,7 @@ public class ContactLogServiceImpl implements ContactLogService {
contactLogQDTO.setContactAutoType(null);
contactLogQDTO.setFollowRemark(followRemark);
contactLogQDTO.setSourceLogId(contactLog.getLogId());
contactLogQDTO.setAutoFlag(autoFlag);
String message = JSON.toJSONString(contactLogQDTO);
String routerName = "autoContactLogForMQ";
try {
......@@ -353,6 +356,7 @@ public class ContactLogServiceImpl implements ContactLogService {
qdto.setBizType(bizTypeEnum.getType());
qdto.setFollowType(ContactFollowTypeEnum.AUTO_CONTACT.getCode());
qdto.setFollowRemark("因" + ContactAutoTypeEnum.fromCode(contactAutoType).getDescription() + ",系统自动标记了建联");
qdto.setAutoFlag(Constant.FLAG_TRUE);
saveContactLog(qdto);
} catch (BusinessException e) {
logger.info("自动建联异常:{}", e.getMessage());
......
......@@ -20,6 +20,7 @@
<result property="bizType" column="biz_type" jdbcType="INTEGER" />
<result property="bizData" column="biz_data" jdbcType="VARCHAR" />
<result property="followTypes" column="follow_types" jdbcType="VARCHAR" />
<result property="autoFlag" column="auto_flag" jdbcType="INTEGER" />
<result property="enterpriseId" column="enterprise_id" jdbcType="VARCHAR"/>
<result property="deleteFlag" column="delete_flag" jdbcType="INTEGER"/>
<result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
......@@ -162,6 +163,7 @@
biz_type,
biz_data,
follow_types,
auto_flag,
enterprise_id
)
values (
......@@ -183,6 +185,7 @@
#{bizType},
#{bizData},
#{followTypes},
#{autoFlag},
#{enterpriseId})
</insert>
......@@ -241,6 +244,9 @@
<if test="followTypes != null">
follow_types = #{followTypes},
</if>
<if test="autoFlag != null">
auto_flag = #{autoFlag},
</if>
<if test="enterpriseId != null and enterpriseId != ''">
enterprise_id = #{enterpriseId},
</if>
......
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