mirror of
https://gitee.com/binary/weixin-java-tools.git
synced 2025-06-28 13:16:19 +08:00
🎨 #2295 【企业微信】批量获取外部客户详情接口支持多个userId
This commit is contained in:
parent
b06cc90f94
commit
ba99224d13
@ -153,6 +153,7 @@ public interface WxCpExternalContactService {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 企业和服务商可通过此接口,将微信外部联系人的userid转为微信openid,用于调用支付相关接口。暂不支持企业微信外部联系人(ExternalUserid为wo开头)的userid转openid。
|
* 企业和服务商可通过此接口,将微信外部联系人的userid转为微信openid,用于调用支付相关接口。暂不支持企业微信外部联系人(ExternalUserid为wo开头)的userid转openid。
|
||||||
|
*
|
||||||
* @param externalUserid 微信外部联系人的userid
|
* @param externalUserid 微信外部联系人的userid
|
||||||
* @return 该企业的外部联系人openid
|
* @return 该企业的外部联系人openid
|
||||||
* @throws WxErrorException .
|
* @throws WxErrorException .
|
||||||
@ -197,13 +198,13 @@ public interface WxCpExternalContactService {
|
|||||||
* 第三方/自建应用调用时,返回的跟进人follow_user仅包含应用可见范围之内的成员。
|
* 第三方/自建应用调用时,返回的跟进人follow_user仅包含应用可见范围之内的成员。
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
* @param userId 企业成员的userid,注意不是外部联系人的帐号
|
* @param userIdList 企业成员的userid列表,注意不是外部联系人的帐号
|
||||||
* @param cursor the cursor
|
* @param cursor the cursor
|
||||||
* @param limit the limit
|
* @param limit the limit
|
||||||
* @return wx cp user external contact batch info
|
* @return wx cp user external contact batch info
|
||||||
* @throws WxErrorException .
|
* @throws WxErrorException .
|
||||||
*/
|
*/
|
||||||
WxCpExternalContactBatchInfo getContactDetailBatch(String userId, String cursor,
|
WxCpExternalContactBatchInfo getContactDetailBatch(String[] userIdList, String cursor,
|
||||||
Integer limit)
|
Integer limit)
|
||||||
throws WxErrorException;
|
throws WxErrorException;
|
||||||
|
|
||||||
@ -283,7 +284,7 @@ public interface WxCpExternalContactService {
|
|||||||
* <per>
|
* <per>
|
||||||
* external_userid必须是handover_userid的客户(即配置了客户联系功能的成员所添加的联系人)。
|
* external_userid必须是handover_userid的客户(即配置了客户联系功能的成员所添加的联系人)。
|
||||||
* 在职成员的每位客户最多被分配2次。客户被转接成功后,将有90个自然日的服务关系保护期,保护期内的客户无法再次被分配。
|
* 在职成员的每位客户最多被分配2次。客户被转接成功后,将有90个自然日的服务关系保护期,保护期内的客户无法再次被分配。
|
||||||
*
|
* <p>
|
||||||
* 权限说明:
|
* 权限说明:
|
||||||
* * 企业需要使用“客户联系”secret或配置到“可调用应用”列表中的自建应用secret所获取的accesstoken来调用(accesstoken如何获取?)。
|
* * 企业需要使用“客户联系”secret或配置到“可调用应用”列表中的自建应用secret所获取的accesstoken来调用(accesstoken如何获取?)。
|
||||||
* 第三方应用需拥有“企业客户权限->客户联系->在职继承”权限
|
* 第三方应用需拥有“企业客户权限->客户联系->在职继承”权限
|
||||||
@ -291,6 +292,7 @@ public interface WxCpExternalContactService {
|
|||||||
* 接替成员需要配置了客户联系功能。
|
* 接替成员需要配置了客户联系功能。
|
||||||
* 接替成员需要在企业微信激活且已经过实名认证。
|
* 接替成员需要在企业微信激活且已经过实名认证。
|
||||||
* </per>
|
* </per>
|
||||||
|
*
|
||||||
* @param req 转接在职成员的客户给其他成员请求实体
|
* @param req 转接在职成员的客户给其他成员请求实体
|
||||||
* @return wx cp base resp
|
* @return wx cp base resp
|
||||||
* @throws WxErrorException the wx error exception
|
* @throws WxErrorException the wx error exception
|
||||||
@ -301,11 +303,12 @@ public interface WxCpExternalContactService {
|
|||||||
* 企业和第三方可通过此接口查询在职成员的客户转接情况。
|
* 企业和第三方可通过此接口查询在职成员的客户转接情况。
|
||||||
* <per>
|
* <per>
|
||||||
* 权限说明:
|
* 权限说明:
|
||||||
*
|
* <p>
|
||||||
* 企业需要使用“客户联系”secret或配置到“可调用应用”列表中的自建应用secret所获取的accesstoken来调用(accesstoken如何获取?)。
|
* 企业需要使用“客户联系”secret或配置到“可调用应用”列表中的自建应用secret所获取的accesstoken来调用(accesstoken如何获取?)。
|
||||||
* 第三方应用需拥有“企业客户权限->客户联系->在职继承”权限
|
* 第三方应用需拥有“企业客户权限->客户联系->在职继承”权限
|
||||||
* 接替成员必须在此第三方应用或自建应用的可见范围内。
|
* 接替成员必须在此第三方应用或自建应用的可见范围内。
|
||||||
* </per>
|
* </per>
|
||||||
|
*
|
||||||
* @param handOverUserid 原添加成员的userid
|
* @param handOverUserid 原添加成员的userid
|
||||||
* @param takeOverUserid 接替成员的userid
|
* @param takeOverUserid 接替成员的userid
|
||||||
* @param cursor 分页查询的cursor,每个分页返回的数据不会超过1000条;不填或为空表示获取第一个分页;
|
* @param cursor 分页查询的cursor,每个分页返回的数据不会超过1000条;不填或为空表示获取第一个分页;
|
||||||
@ -320,15 +323,16 @@ public interface WxCpExternalContactService {
|
|||||||
* handover_userid必须是已离职用户。
|
* handover_userid必须是已离职用户。
|
||||||
* external_userid必须是handover_userid的客户(即配置了客户联系功能的成员所添加的联系人)。
|
* external_userid必须是handover_userid的客户(即配置了客户联系功能的成员所添加的联系人)。
|
||||||
* 在职成员的每位客户最多被分配2次。客户被转接成功后,将有90个自然日的服务关系保护期,保护期内的客户无法再次被分配。
|
* 在职成员的每位客户最多被分配2次。客户被转接成功后,将有90个自然日的服务关系保护期,保护期内的客户无法再次被分配。
|
||||||
*
|
* <p>
|
||||||
* 权限说明:
|
* 权限说明:
|
||||||
*
|
* <p>
|
||||||
* 企业需要使用“客户联系”secret或配置到“可调用应用”列表中的自建应用secret所获取的accesstoken来调用(accesstoken如何获取?)。
|
* 企业需要使用“客户联系”secret或配置到“可调用应用”列表中的自建应用secret所获取的accesstoken来调用(accesstoken如何获取?)。
|
||||||
* 第三方应用需拥有“企业客户权限->客户联系->离职分配”权限
|
* 第三方应用需拥有“企业客户权限->客户联系->离职分配”权限
|
||||||
* 接替成员必须在此第三方应用或自建应用的可见范围内。
|
* 接替成员必须在此第三方应用或自建应用的可见范围内。
|
||||||
* 接替成员需要配置了客户联系功能。
|
* 接替成员需要配置了客户联系功能。
|
||||||
* 接替成员需要在企业微信激活且已经过实名认证。
|
* 接替成员需要在企业微信激活且已经过实名认证。
|
||||||
* </per>
|
* </per>
|
||||||
|
*
|
||||||
* @param req 转接在职成员的客户给其他成员请求实体
|
* @param req 转接在职成员的客户给其他成员请求实体
|
||||||
* @return wx cp base resp
|
* @return wx cp base resp
|
||||||
* @throws WxErrorException the wx error exception
|
* @throws WxErrorException the wx error exception
|
||||||
@ -339,11 +343,12 @@ public interface WxCpExternalContactService {
|
|||||||
* 企业和第三方可通过此接口查询离职成员的客户分配情况。
|
* 企业和第三方可通过此接口查询离职成员的客户分配情况。
|
||||||
* <per>
|
* <per>
|
||||||
* 权限说明:
|
* 权限说明:
|
||||||
*
|
* <p>
|
||||||
* 企业需要使用“客户联系”secret或配置到“可调用应用”列表中的自建应用secret所获取的accesstoken来调用(accesstoken如何获取?)。
|
* 企业需要使用“客户联系”secret或配置到“可调用应用”列表中的自建应用secret所获取的accesstoken来调用(accesstoken如何获取?)。
|
||||||
* 第三方应用需拥有“企业客户权限->客户联系->在职继承”权限
|
* 第三方应用需拥有“企业客户权限->客户联系->在职继承”权限
|
||||||
* 接替成员必须在此第三方应用或自建应用的可见范围内。
|
* 接替成员必须在此第三方应用或自建应用的可见范围内。
|
||||||
* </per>
|
* </per>
|
||||||
|
*
|
||||||
* @param handOverUserid 原添加成员的userid
|
* @param handOverUserid 原添加成员的userid
|
||||||
* @param takeOverUserid 接替成员的userid
|
* @param takeOverUserid 接替成员的userid
|
||||||
* @param cursor 分页查询的cursor,每个分页返回的数据不会超过1000条;不填或为空表示获取第一个分页;
|
* @param cursor 分页查询的cursor,每个分页返回的数据不会超过1000条;不填或为空表示获取第一个分页;
|
||||||
@ -360,7 +365,6 @@ public interface WxCpExternalContactService {
|
|||||||
* 微信文档:https://work.weixin.qq.com/api/doc/90000/90135/92119
|
* 微信文档:https://work.weixin.qq.com/api/doc/90000/90135/92119
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
* @deprecated 请使用 {@link WxCpExternalContactService#listGroupChat(Integer, String, int, String[])}
|
|
||||||
* @param pageIndex the page index
|
* @param pageIndex the page index
|
||||||
* @param pageSize the page size
|
* @param pageSize the page size
|
||||||
* @param status the status
|
* @param status the status
|
||||||
@ -368,6 +372,7 @@ public interface WxCpExternalContactService {
|
|||||||
* @param partyIds the party ids
|
* @param partyIds the party ids
|
||||||
* @return the wx cp user external group chat list
|
* @return the wx cp user external group chat list
|
||||||
* @throws WxErrorException the wx error exception
|
* @throws WxErrorException the wx error exception
|
||||||
|
* @deprecated 请使用 {@link WxCpExternalContactService#listGroupChat(Integer, String, int, String[])}
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
@Deprecated
|
||||||
WxCpUserExternalGroupChatList listGroupChat(Integer pageIndex, Integer pageSize, int status, String[] userIds, String[] partyIds) throws WxErrorException;
|
WxCpUserExternalGroupChatList listGroupChat(Integer pageIndex, Integer pageSize, int status, String[] userIds, String[] partyIds) throws WxErrorException;
|
||||||
@ -404,24 +409,24 @@ public interface WxCpExternalContactService {
|
|||||||
WxCpUserExternalGroupChatInfo getGroupChat(String chatId, Integer needName) throws WxErrorException;
|
WxCpUserExternalGroupChatInfo getGroupChat(String chatId, Integer needName) throws WxErrorException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* 企业可通过此接口,将已离职成员为群主的群,分配给另一个客服成员。
|
* 企业可通过此接口,将已离职成员为群主的群,分配给另一个客服成员。
|
||||||
*
|
*
|
||||||
* <per>
|
* <per>
|
||||||
* 注意::
|
* 注意::
|
||||||
*
|
* <p>
|
||||||
* 群主离职了的客户群,才可继承
|
* 群主离职了的客户群,才可继承
|
||||||
* 继承给的新群主,必须是配置了客户联系功能的成员
|
* 继承给的新群主,必须是配置了客户联系功能的成员
|
||||||
* 继承给的新群主,必须有设置实名
|
* 继承给的新群主,必须有设置实名
|
||||||
* 继承给的新群主,必须有激活企业微信
|
* 继承给的新群主,必须有激活企业微信
|
||||||
* 同一个人的群,限制每天最多分配300个给新群主
|
* 同一个人的群,限制每天最多分配300个给新群主
|
||||||
*
|
* <p>
|
||||||
* 权限说明:
|
* 权限说明:
|
||||||
*
|
* <p>
|
||||||
* 企业需要使用“客户联系”secret或配置到“可调用应用”列表中的自建应用secret所获取的accesstoken来调用(accesstoken如何获取?)。
|
* 企业需要使用“客户联系”secret或配置到“可调用应用”列表中的自建应用secret所获取的accesstoken来调用(accesstoken如何获取?)。
|
||||||
* 第三方应用需拥有“企业客户权限->客户联系->分配离职成员的客户群”权限
|
* 第三方应用需拥有“企业客户权限->客户联系->分配离职成员的客户群”权限
|
||||||
* 对于第三方/自建应用,群主必须在应用的可见范围。
|
* 对于第三方/自建应用,群主必须在应用的可见范围。
|
||||||
* </per>
|
* </per>
|
||||||
|
*
|
||||||
* @param chatIds 需要转群主的客户群ID列表。取值范围: 1 ~ 100
|
* @param chatIds 需要转群主的客户群ID列表。取值范围: 1 ~ 100
|
||||||
* @param newOwner 新群主ID
|
* @param newOwner 新群主ID
|
||||||
* @return 分配结果,主要是分配失败的群列表
|
* @return 分配结果,主要是分配失败的群列表
|
||||||
|
@ -148,7 +148,7 @@ public class WxCpExternalContactServiceImpl implements WxCpExternalContactServic
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public WxCpExternalContactBatchInfo getContactDetailBatch(String userId,
|
public WxCpExternalContactBatchInfo getContactDetailBatch(String[] userIdList,
|
||||||
String cursor,
|
String cursor,
|
||||||
Integer limit)
|
Integer limit)
|
||||||
throws WxErrorException {
|
throws WxErrorException {
|
||||||
@ -157,7 +157,7 @@ public class WxCpExternalContactServiceImpl implements WxCpExternalContactServic
|
|||||||
.getWxCpConfigStorage()
|
.getWxCpConfigStorage()
|
||||||
.getApiUrl(GET_CONTACT_DETAIL_BATCH);
|
.getApiUrl(GET_CONTACT_DETAIL_BATCH);
|
||||||
JsonObject json = new JsonObject();
|
JsonObject json = new JsonObject();
|
||||||
json.addProperty("userid", userId);
|
json.add("userid_list", new Gson().toJsonTree(userIdList).getAsJsonArray());
|
||||||
if (StringUtils.isNotBlank(cursor)) {
|
if (StringUtils.isNotBlank(cursor)) {
|
||||||
json.addProperty("cursor", cursor);
|
json.addProperty("cursor", cursor);
|
||||||
}
|
}
|
||||||
|
@ -7,6 +7,7 @@ import me.chanjar.weixin.cp.api.ApiTestModule;
|
|||||||
import me.chanjar.weixin.cp.api.WxCpService;
|
import me.chanjar.weixin.cp.api.WxCpService;
|
||||||
import me.chanjar.weixin.cp.bean.WxCpBaseResp;
|
import me.chanjar.weixin.cp.bean.WxCpBaseResp;
|
||||||
import me.chanjar.weixin.cp.bean.external.*;
|
import me.chanjar.weixin.cp.bean.external.*;
|
||||||
|
import me.chanjar.weixin.cp.bean.external.contact.WxCpExternalContactBatchInfo;
|
||||||
import me.chanjar.weixin.cp.bean.external.contact.WxCpExternalContactInfo;
|
import me.chanjar.weixin.cp.bean.external.contact.WxCpExternalContactInfo;
|
||||||
import me.chanjar.weixin.cp.bean.external.msg.Attachment;
|
import me.chanjar.weixin.cp.bean.external.msg.Attachment;
|
||||||
import me.chanjar.weixin.cp.bean.external.msg.Image;
|
import me.chanjar.weixin.cp.bean.external.msg.Image;
|
||||||
@ -115,6 +116,14 @@ public class WxCpExternalContactServiceImplTest {
|
|||||||
assertNotNull(result);
|
assertNotNull(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testGetContactDetailBatch() throws WxErrorException {
|
||||||
|
String userId = this.configStorage.getUserId();
|
||||||
|
WxCpExternalContactBatchInfo result = this.wxCpService.getExternalContactService().getContactDetailBatch(new String[]{userId}, "", 100);
|
||||||
|
System.out.println(result);
|
||||||
|
assertNotNull(result);
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testGetCorpTagList() throws WxErrorException {
|
public void testGetCorpTagList() throws WxErrorException {
|
||||||
String[] tag = {};
|
String[] tag = {};
|
||||||
|
Loading…
Reference in New Issue
Block a user