Commit 9ee79c5c by fudahua

会员标签同步-加好友需要同步好友标签

parent 0d39bc32
package com.gic.haoban.manage.service.pojo;
import java.io.Serializable;
import java.util.List;
/**
* Created 2021/7/19.
*
* @author hua
*/
public class QywxTagSyncInfoPojo implements Serializable {
/**
* 任务id
*/
private String taskId;
/**
* 任务类型 0标签同步 1会员标签同步
* #taskTypeEnum
*/
private int taskType;
/**
* 数据id 对应memberId
*/
private String dataId;
/**
* 同步类型
*/
private int syncType;
private Integer times = 0;
private QywxTagFailPojo fail;
/**
* 批量导入时
*/
private List<String> memberIds;
/**
* 非必传
*/
private String wxEnterpriseId;
/**
* 非必传
*/
private String enterpriseId;
public String getWxEnterpriseId() {
return wxEnterpriseId;
}
public void setWxEnterpriseId(String wxEnterpriseId) {
this.wxEnterpriseId = wxEnterpriseId;
}
public String getEnterpriseId() {
return enterpriseId;
}
public void setEnterpriseId(String enterpriseId) {
this.enterpriseId = enterpriseId;
}
public List<String> getMemberIds() {
return memberIds;
}
public void setMemberIds(List<String> memberIds) {
this.memberIds = memberIds;
}
public int getSyncType() {
return syncType;
}
public void setSyncType(int syncType) {
this.syncType = syncType;
}
/**
* 同步的id
*/
private Integer syncLogId;
public Integer getTimes() {
return times;
}
public void setTimes(Integer times) {
this.times = times;
}
public Integer getSyncLogId() {
return syncLogId;
}
public void setSyncLogId(Integer syncLogId) {
this.syncLogId = syncLogId;
}
public QywxTagFailPojo getFail() {
return fail;
}
public void setFail(QywxTagFailPojo fail) {
this.fail = fail;
}
public String getTaskId() {
return taskId;
}
public void setTaskId(String taskId) {
this.taskId = taskId;
}
public int getTaskType() {
return taskType;
}
public void setTaskType(int taskType) {
this.taskType = taskType;
}
public String getDataId() {
return dataId;
}
public void setDataId(String dataId) {
this.dataId = dataId;
}
}
...@@ -36,6 +36,7 @@ import com.gic.haoban.manage.service.entity.*; ...@@ -36,6 +36,7 @@ import com.gic.haoban.manage.service.entity.*;
import com.gic.haoban.manage.service.exception.WxApiLimitException; import com.gic.haoban.manage.service.exception.WxApiLimitException;
import com.gic.haoban.manage.service.pojo.DealQywxExternalUserPojo; import com.gic.haoban.manage.service.pojo.DealQywxExternalUserPojo;
import com.gic.haoban.manage.service.pojo.ExternalUserPojo; import com.gic.haoban.manage.service.pojo.ExternalUserPojo;
import com.gic.haoban.manage.service.pojo.QywxTagSyncInfoPojo;
import com.gic.haoban.manage.service.service.*; import com.gic.haoban.manage.service.service.*;
import com.gic.haoban.manage.service.util.EmojiFilterUtil; import com.gic.haoban.manage.service.util.EmojiFilterUtil;
import com.gic.member.api.dto.MemberDTO; import com.gic.member.api.dto.MemberDTO;
...@@ -527,8 +528,9 @@ public class MemberUnionidRelatedApiServiceImpl implements MemberUnionidRelatedA ...@@ -527,8 +528,9 @@ public class MemberUnionidRelatedApiServiceImpl implements MemberUnionidRelatedA
exsitDTO.setStatusFlag(1); exsitDTO.setStatusFlag(1);
externalClerkRelatedService.update(exsitDTO); externalClerkRelatedService.update(exsitDTO);
} }
sendWelcome(dto, staffClerkRelationDTO, false); sendWelcome(dto, staffClerkRelationDTO, false);
//同步好友标签
pushTagSync(member.getMemberId(), wxEnterpriseId, staffClerkRelationDTO.getEnterpriseId());
} }
} }
...@@ -1557,11 +1559,30 @@ public class MemberUnionidRelatedApiServiceImpl implements MemberUnionidRelatedA ...@@ -1557,11 +1559,30 @@ public class MemberUnionidRelatedApiServiceImpl implements MemberUnionidRelatedA
external.setStatusFlag(1); external.setStatusFlag(1);
externalClerkRelatedService.update(external); externalClerkRelatedService.update(external);
} }
//同步标签
pushTagSync(memberId, wxEnterpriseId, enterpriseId);
return ""; return "";
} }
private void pushTagSync(String memberId, String wxEnterpriseId, String enterpriseId) {
QywxTagSyncInfoPojo pojo = new QywxTagSyncInfoPojo();
pojo.setDataId(memberId);
pojo.setTaskId("-1");
pojo.setTaskType(8);
//单个会员同步
pojo.setSyncType(2);
pojo.setWxEnterpriseId(wxEnterpriseId);
pojo.setEnterpriseId(enterpriseId);
GicMQClient clientInstance = GICMQClientUtil.getClientInstance();
try {
clientInstance.sendMessage("qywxTagSyncDeal", JSONObject.toJSONString(pojo));
} catch (Exception e) {
e.printStackTrace();
log.info("异常:{}", e);
}
}
@Override @Override
public String addFriendExternal(ExternalUserDTO dto) { public String addFriendExternal(ExternalUserDTO dto) {
String wxUserId = dto.getWxUserId(); String wxUserId = dto.getWxUserId();
......
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