Commit 648e8cd4 by fudahua

导购刷新好友

parent eedc80c3
...@@ -17,6 +17,13 @@ public interface MemberUnionidRelatedApiService { ...@@ -17,6 +17,13 @@ public interface MemberUnionidRelatedApiService {
void delMemberUnionidRelated(MemberUnionidRelatedDTO dto); void delMemberUnionidRelated(MemberUnionidRelatedDTO dto);
/**
* 处理外部联系人异步
*
* @param params
*/
void dealQywxExternalUser(String params);
ExternalClerkRelatedDTO getByMemberId(String staffId, String memberId); ExternalClerkRelatedDTO getByMemberId(String staffId, String memberId);
List<MemberUnionidRelatedDTO> getByWxUserIdAndWxEnterpriseId(String wxUserId, String wxEnterpriseId); List<MemberUnionidRelatedDTO> getByWxUserIdAndWxEnterpriseId(String wxUserId, String wxEnterpriseId);
......
package com.gic.haoban.manage.service.pojo;
import com.gic.haoban.manage.api.dto.MemberUnionidRelatedDTO;
import java.io.Serializable;
/**
* Created 2021/4/2.
*
* @author hua
*/
public class DealQywxExternalUserPojo implements Serializable {
public enum DealType {
//删除
del(0),
//新增
add(1);
private int type;
DealType(int type) {
this.type = type;
}
public int getType() {
return type;
}
public void setType(int type) {
this.type = type;
}
}
// 0 删除 1新增
private int type;
private MemberUnionidRelatedDTO data;
public int getType() {
return type;
}
public void setType(int type) {
this.type = type;
}
public MemberUnionidRelatedDTO getData() {
return data;
}
public void setData(MemberUnionidRelatedDTO data) {
this.data = data;
}
}
...@@ -6,11 +6,14 @@ import cn.hutool.core.collection.CollectionUtil; ...@@ -6,11 +6,14 @@ import cn.hutool.core.collection.CollectionUtil;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.gic.commons.util.*;
import com.gic.haoban.base.api.common.ServiceResponse; import com.gic.haoban.base.api.common.ServiceResponse;
import com.gic.haoban.manage.api.dto.*; import com.gic.haoban.manage.api.dto.*;
import com.gic.haoban.manage.api.enums.SecretTypeEnum; import com.gic.haoban.manage.api.enums.SecretTypeEnum;
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.service.*; import com.gic.haoban.manage.service.service.*;
import com.gic.mq.sdk.GicMQClient;
import com.gic.wechat.api.dto.qywx.QywxIinkExternalMessageDTO; import com.gic.wechat.api.dto.qywx.QywxIinkExternalMessageDTO;
import com.gic.wechat.api.dto.qywx.QywxImageExternalMessageDTO; import com.gic.wechat.api.dto.qywx.QywxImageExternalMessageDTO;
import com.gic.wechat.api.dto.qywx.QywxTextExternalMessageDTO; import com.gic.wechat.api.dto.qywx.QywxTextExternalMessageDTO;
...@@ -34,11 +37,6 @@ import com.gic.api.base.commons.Page; ...@@ -34,11 +37,6 @@ import com.gic.api.base.commons.Page;
import com.gic.clerk.api.dto.ClerkDTO; import com.gic.clerk.api.dto.ClerkDTO;
import com.gic.clerk.api.service.ClerkService; import com.gic.clerk.api.service.ClerkService;
import com.gic.clerk.api.service.PowerService; import com.gic.clerk.api.service.PowerService;
import com.gic.commons.util.DateUtil;
import com.gic.commons.util.EntityUtil;
import com.gic.commons.util.MD5Utils;
import com.gic.commons.util.Md5Util;
import com.gic.commons.util.StringUtil;
import com.gic.enterprise.api.dto.StoreDTO; import com.gic.enterprise.api.dto.StoreDTO;
import com.gic.enterprise.api.service.StoreService; import com.gic.enterprise.api.service.StoreService;
import com.gic.haoban.base.api.common.BasePageInfo; import com.gic.haoban.base.api.common.BasePageInfo;
...@@ -130,6 +128,18 @@ public class MemberUnionidRelatedApiServiceImpl implements MemberUnionidRelatedA ...@@ -130,6 +128,18 @@ public class MemberUnionidRelatedApiServiceImpl implements MemberUnionidRelatedA
private PowerService powerService; private PowerService powerService;
@Override @Override
public void dealQywxExternalUser(String params) {
log.info("回调:{}", params);
DealQywxExternalUserPojo externalUserPojo = JSONObject.parseObject(params, DealQywxExternalUserPojo.class);
if (externalUserPojo.getType() == DealQywxExternalUserPojo.DealType.del.getType()) {
this.delMemberUnionidRelatedProcess(externalUserPojo.getData());
} else if (externalUserPojo.getType() == DealQywxExternalUserPojo.DealType.add.getType()) {
this.addMemberUnionidRelatedNew(externalUserPojo.getData());
}
}
@Override
public List<MemberStoreDTO> listByExTernalUseridAndWxUserId(String externalUserid, String wxUserId) { public List<MemberStoreDTO> listByExTernalUseridAndWxUserId(String externalUserid, String wxUserId) {
List<TabHaobanExternalClerkRelated> list = externalClerkRelatedService.listByExTernalUseridAndWxUserId(externalUserid, wxUserId); List<TabHaobanExternalClerkRelated> list = externalClerkRelatedService.listByExTernalUseridAndWxUserId(externalUserid, wxUserId);
List<MemberStoreDTO> result = new ArrayList<>(); List<MemberStoreDTO> result = new ArrayList<>();
...@@ -239,7 +249,17 @@ public class MemberUnionidRelatedApiServiceImpl implements MemberUnionidRelatedA ...@@ -239,7 +249,17 @@ public class MemberUnionidRelatedApiServiceImpl implements MemberUnionidRelatedA
} }
@Override @Override
public String addMemberUnionidRelated(MemberUnionidRelatedDTO dto) { public String addMemberUnionidRelated(MemberUnionidRelatedDTO dto) {
return addMemberUnionidRelatedNew(dto); DealQywxExternalUserPojo dealQywxExternalUserPojo = new DealQywxExternalUserPojo();
dealQywxExternalUserPojo.setType(DealQywxExternalUserPojo.DealType.add.getType());
dealQywxExternalUserPojo.setData(dto);
GicMQClient instance = GICMQClientUtil.getClientInstance();
try {
instance.sendMessage("dealQywxExternalUserMq", JSONObject.toJSONString(dealQywxExternalUserPojo));
} catch (Exception e) {
log.info("异步处理异常:{}", e);
}
return null;
} }
...@@ -738,6 +758,20 @@ public class MemberUnionidRelatedApiServiceImpl implements MemberUnionidRelatedA ...@@ -738,6 +758,20 @@ public class MemberUnionidRelatedApiServiceImpl implements MemberUnionidRelatedA
} }
@Override @Override
public void delMemberUnionidRelated(MemberUnionidRelatedDTO dto) { public void delMemberUnionidRelated(MemberUnionidRelatedDTO dto) {
DealQywxExternalUserPojo dealQywxExternalUserPojo = new DealQywxExternalUserPojo();
dealQywxExternalUserPojo.setType(DealQywxExternalUserPojo.DealType.del.getType());
dealQywxExternalUserPojo.setData(dto);
GicMQClient instance = GICMQClientUtil.getClientInstance();
try {
instance.sendMessage("dealQywxExternalUserMq", JSONObject.toJSONString(dealQywxExternalUserPojo));
} catch (Exception e) {
log.info("异步处理异常:{}", e);
}
}
private void delMemberUnionidRelatedProcess(MemberUnionidRelatedDTO dto) {
externalClerkRelatedService.delByUserIdAndExternalUserId(dto); externalClerkRelatedService.delByUserIdAndExternalUserId(dto);
memberUnionRelatedService.delMemberUnionidRelated(dto); memberUnionRelatedService.delMemberUnionidRelated(dto);
......
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