Commit c90d1a7d by 王祖波

记录是否自动建联

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