public class WxCpUserServiceImpl extends Object implements WxCpUserService
Created by BinaryWang on 2017/6/24.
| 构造器和说明 |
|---|
WxCpUserServiceImpl(WxCpService mainService) |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
authenticate(String userId)
用在二次验证的时候
企业在员工验证成功后,调用本方法告诉企业号平台该员工关注成功。
|
void |
create(WxCpUser user)
新建用户
|
void |
delete(String... userIds)
删除用户/批量删除成员
http://qydev.weixin.qq.com/wiki/index.php?
|
WxCpUser |
getById(String userid)
获取用户
|
int |
invite(String userId,
String inviteTips)
已过时。
|
List<WxCpUser> |
listByDepartment(Integer departId,
Boolean fetchChild,
Integer status)
获取部门成员(详情)
http://qydev.weixin.qq.com/wiki/index.php?
|
List<WxCpUser> |
listSimpleByDepartment(Integer departId,
Boolean fetchChild,
Integer status)
获取部门成员
http://qydev.weixin.qq.com/wiki/index.php?
|
String |
openid2UserId(String openid)
openid转userid
该接口主要应用于使用微信支付、微信红包和企业转账之后的结果查询。
|
void |
update(WxCpUser user)
更新用户
|
Map<String,String> |
userId2Openid(String userId,
Integer agentId)
userid转openid.
|
public WxCpUserServiceImpl(WxCpService mainService)
public void authenticate(String userId) throws WxErrorException
WxCpUserService用在二次验证的时候 企业在员工验证成功后,调用本方法告诉企业号平台该员工关注成功。
authenticate 在接口中 WxCpUserServiceuserId - 用户idWxErrorExceptionpublic void create(WxCpUser user) throws WxErrorException
WxCpUserServicecreate 在接口中 WxCpUserServiceuser - 用户对象WxErrorExceptionpublic void update(WxCpUser user) throws WxErrorException
WxCpUserServiceupdate 在接口中 WxCpUserServiceuser - 用户对象WxErrorExceptionpublic void delete(String... userIds) throws WxErrorException
WxCpUserService删除用户/批量删除成员 http://qydev.weixin.qq.com/wiki/index.php?title=管理成员#.E6.89.B9.E9.87.8F.E5.88.A0.E9.99.A4.E6.88.90.E5.91.98
delete 在接口中 WxCpUserServiceuserIds - 员工UserID列表。对应管理端的帐号WxErrorExceptionpublic WxCpUser getById(String userid) throws WxErrorException
WxCpUserServicegetById 在接口中 WxCpUserServiceuserid - 用户idWxErrorExceptionpublic List<WxCpUser> listByDepartment(Integer departId, Boolean fetchChild, Integer status) throws WxErrorException
WxCpUserService获取部门成员(详情) http://qydev.weixin.qq.com/wiki/index.php?title=管理成员#.E8.8E.B7.E5.8F.96.E9.83.A8.E9.97.A8.E6.88.90.E5.91.98.28.E8.AF.A6.E6.83.85.29
listByDepartment 在接口中 WxCpUserServicedepartId - 必填。部门idfetchChild - 非必填。1/0:是否递归获取子部门下面的成员status - 非必填。0获取全部员工,1获取已关注成员列表,2获取禁用成员列表,4获取未关注成员列表。status可叠加WxErrorExceptionpublic List<WxCpUser> listSimpleByDepartment(Integer departId, Boolean fetchChild, Integer status) throws WxErrorException
WxCpUserService获取部门成员 http://qydev.weixin.qq.com/wiki/index.php?title=管理成员#.E8.8E.B7.E5.8F.96.E9.83.A8.E9.97.A8.E6.88.90.E5.91.98
listSimpleByDepartment 在接口中 WxCpUserServicedepartId - 必填。部门idfetchChild - 非必填。1/0:是否递归获取子部门下面的成员status - 非必填。0获取全部员工,1获取已关注成员列表,2获取禁用成员列表,4获取未关注成员列表。status可叠加WxErrorException@Deprecated public int invite(String userId, String inviteTips) throws WxErrorException
WxCpUserService邀请成员关注 http://qydev.weixin.qq.com/wiki/index.php?title=管理成员#.E9.82.80.E8.AF.B7.E6.88.90.E5.91.98.E5.85.B3.E6.B3.A8
invite 在接口中 WxCpUserServiceuserId - 用户的useridinviteTips - 推送到微信上的提示语(只有认证号可以使用)。当使用微信推送时,该字段默认为“请关注XXX企业号”,邮件邀请时,该字段无效。WxErrorExceptionpublic Map<String,String> userId2Openid(String userId, Integer agentId) throws WxErrorException
WxCpUserServiceuserid转openid. 该接口使用场景为微信支付、微信红包和企业转账。 在使用微信支付的功能时,需要自行将企业微信的userid转成openid。 在使用微信红包功能时,需要将应用id和userid转成appid和openid才能使用。 注:需要成员使用微信登录企业微信或者关注微信插件才能转成openid 文档地址:https://work.weixin.qq.com/api/doc#11279
userId2Openid 在接口中 WxCpUserServiceuserId - 企业内的成员idagentId - 非必填,整型,仅用于发红包。其它场景该参数不要填,如微信支付、企业转账、电子发票WxErrorExceptionpublic String openid2UserId(String openid) throws WxErrorException
WxCpUserServiceopenid转userid 该接口主要应用于使用微信支付、微信红包和企业转账之后的结果查询。 开发者需要知道某个结果事件的openid对应企业微信内成员的信息时,可以通过调用该接口进行转换查询。 权限说明: 管理组需对openid对应的企业微信成员有查看权限。 文档地址:https://work.weixin.qq.com/api/doc#11279
openid2UserId 在接口中 WxCpUserServiceopenid - 在使用微信支付、微信红包和企业转账之后,返回结果的openidWxErrorExceptionCopyright © 2018. All rights reserved.