Commit e740d23a by 王祖波

跟进记录增加跟进类型

parent 4b6bdede
package com.gic.haoban.manage.api.enums.contact;
import org.apache.commons.lang3.StringUtils;
public enum ContactFollowTypeEnum {
PRIVATE_PHONE(1, "私人电话","私人电话"),
WECHAT_SESSION(2, "企微会话","企微会话"),
PRODUCT(3, "发送商品","商品"),
WECHAT_GROUP_SEND(4, "企微群发","企微群发"),
CONTACT(5, "标记建联","标记了建联");
private final int code;
private final String description;
private final String textMatch;
ContactFollowTypeEnum(int code, String description,String textMatch) {
this.code = code;
this.description = description;
this.textMatch = textMatch;
}
public String getTextMatch() {
return textMatch;
}
public int getCode() {
return code;
}
public String getDescription() {
return description;
}
public static ContactFollowTypeEnum fromCode(int code) {
for (ContactFollowTypeEnum type : values()) {
if (type.code == code) {
return type;
}
}
return null;
}
public static ContactFollowTypeEnum fromTextMatch(String textMatch) {
if (StringUtils.isBlank(textMatch)) {
return null;
}
for (ContactFollowTypeEnum type : values()) {
if (textMatch.contains(type.textMatch)) {
return type;
}
}
return null;
}
}
\ No newline at end of file
......@@ -19,6 +19,12 @@ public class ContactFollowBatchQDTO implements Serializable {
* 导购id
*/
private String clerkId;
/**
* 跟进类型 1私人电话 2企微会话 3发送商品 4企微群发 5标记建联
* @see com.gic.haoban.manage.api.enums.contact.ContactFollowTypeEnum
*/
private Integer followType;
/**
* 跟进记录
*/
......@@ -48,6 +54,14 @@ public class ContactFollowBatchQDTO implements Serializable {
this.clerkId = clerkId;
}
public Integer getFollowType() {
return followType;
}
public void setFollowType(Integer followType) {
this.followType = followType;
}
public String getFollowRemark() {
return followRemark;
}
......
......@@ -19,6 +19,11 @@ public class ContactFollowQDTO implements Serializable {
*/
private String clerkCode;
/**
* 跟进类型 1私人电话 2企微会话 3发送商品 4企微群发 5标记建联
* @see com.gic.haoban.manage.api.enums.contact.ContactFollowTypeEnum
*/
private Integer followType;
/**
* 跟进记录
*/
private String followRemark;
......@@ -63,6 +68,14 @@ public class ContactFollowQDTO implements Serializable {
this.clerkCode = clerkCode;
}
public Integer getFollowType() {
return followType;
}
public void setFollowType(Integer followType) {
this.followType = followType;
}
public String getFollowRemark() {
return followRemark;
}
......
......@@ -28,6 +28,11 @@ public class TabContactFollow implements Serializable {
*/
private String clerkCode;
/**
* 跟进类型 1私人电话 2企微会话 3发送商品 4企微群发 5标记建联
* @see com.gic.haoban.manage.api.enums.contact.ContactFollowTypeEnum
*/
private Integer followType;
/**
* 跟进记录
*/
private String followRemark;
......@@ -92,6 +97,14 @@ public class TabContactFollow implements Serializable {
this.clerkCode = clerkCode;
}
public Integer getFollowType() {
return followType;
}
public void setFollowType(Integer followType) {
this.followType = followType;
}
public String getFollowRemark() {
return followRemark;
}
......
......@@ -12,6 +12,7 @@ import com.gic.commons.util.PageHelperUtils;
import com.gic.commons.util.UniqueIdUtils;
import com.gic.haoban.manage.api.dto.contact.ContactFollowDTO;
import com.gic.haoban.manage.api.dto.contact.ContactFollowGoodsDTO;
import com.gic.haoban.manage.api.enums.contact.ContactFollowTypeEnum;
import com.gic.haoban.manage.api.qdto.contact.ContactFollowQDTO;
import com.gic.haoban.manage.api.qdto.contact.ContactFollowSearchQDTO;
import com.gic.haoban.manage.service.dao.mapper.contact.TabContactFollowMapper;
......@@ -74,6 +75,13 @@ public class ContactFollowServiceImpl implements ContactFollowService {
if (CollectionUtils.isNotEmpty(follow.getGoodsInfoList())) {
contactFollow.setGoodsInfo(JSON.toJSONString(follow.getGoodsInfoList()));
}
// 兼容不传followType的老版本
Integer followType = contactFollow.getFollowType();
if (followType == null) {
ContactFollowTypeEnum followTypeEnum = ContactFollowTypeEnum.fromTextMatch(contactFollow.getFollowRemark());
followType = Optional.ofNullable(followTypeEnum).map(ContactFollowTypeEnum::getCode).orElse(ContactFollowTypeEnum.CONTACT.getCode());
contactFollow.setFollowType(followType);
}
return contactFollow;
}).filter(Objects::nonNull).collect(Collectors.toList());
contactFollowMapper.insertBatch(followList);
......
......@@ -9,6 +9,7 @@ import com.gic.commons.util.UniqueIdUtils;
import com.gic.content.api.utils.MqUtils;
import com.gic.haoban.common.utils.EntityUtil;
import com.gic.haoban.manage.api.dto.send.DealQwSendDTO;
import com.gic.haoban.manage.api.enums.contact.ContactFollowTypeEnum;
import com.gic.haoban.manage.api.qdto.contact.ContactFollowBatchQDTO;
import com.gic.haoban.manage.api.service.MemberUnionidRelatedApiService;
import com.gic.haoban.manage.api.service.MessageApiService;
......@@ -236,6 +237,7 @@ public class QwSendMsgServiceImpl implements QwSendMsgService {
batchQDTO.setEnterpriseId(enterpriseId);
batchQDTO.setMemberList(memberList);
batchQDTO.setClerkId(clerkId);
batchQDTO.setFollowType(ContactFollowTypeEnum.WECHAT_GROUP_SEND.getCode());
batchQDTO.setFollowRemark("通过企微群发向客户发送了消息");
MqUtils.sendMessageToMQ("saveBatchFollowForMQ", JSON.toJSONString(batchQDTO));
}
......
......@@ -18,6 +18,12 @@ public class ContactFollowQO {
private String clerkId;
/**
* 跟进类型 1私人电话 2企微会话 3发送商品 4企微群发 5标记建联
* @see com.gic.haoban.manage.api.enums.contact.ContactFollowTypeEnum
*/
private Integer followType;
/**
* 跟进记录
*/
private String followRemark;
......@@ -50,6 +56,14 @@ public class ContactFollowQO {
this.clerkId = clerkId;
}
public Integer getFollowType() {
return followType;
}
public void setFollowType(Integer followType) {
this.followType = followType;
}
public String getFollowRemark() {
return followRemark;
}
......
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