Skip to content

Commit e3490e3

Browse files
authored
🎨 #3925 【企业微信】修复HR助手getEmployeeFieldInfo接口getAll参数问题
1 parent 0fb6991 commit e3490e3

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/WxCpHrService.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,18 @@ public interface WxCpHrService {
3838
* 需要配置人事助手的secret,调用接口前需给对应成员赋予人事小助手应用的权限。
3939
*
4040
* @param userid 员工userid
41-
* @param fields 指定字段key列表,不填则返回全部字段
41+
* @param fields 指定字段key列表
4242
* @return 员工档案数据响应 wx cp hr employee field data resp
4343
* @throws WxErrorException the wx error exception
4444
*/
4545
WxCpHrEmployeeFieldDataResp getEmployeeFieldInfo(String userid, List<String> fields) throws WxErrorException;
4646

4747
/**
48+
* 获取员工档案数据.
49+
* <p>
50+
* 请求方式:POST(HTTPS)
51+
* 请求地址:https://qyapi.weixin.qq.com/cgi-bin/hr/get_staff_info?access_token=ACCESS_TOKEN
52+
* 权限说明:
4853
* 更新员工档案数据.
4954
* <p>
5055
* 请求方式:POST(HTTPS)

weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/impl/WxCpHrServiceImpl.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,17 @@ public WxCpHrEmployeeFieldInfoResp getFieldInfo(List<String> fields) throws WxEr
4040

4141
@Override
4242
public WxCpHrEmployeeFieldDataResp getEmployeeFieldInfo(String userid, List<String> fields) throws WxErrorException {
43+
return getEmployeeFieldInfo(userid,false,fields);
44+
}
45+
46+
@Override
47+
public WxCpHrEmployeeFieldDataResp getEmployeeFieldInfo(String userid, boolean getAll, List<String> fields) throws WxErrorException {
4348
if (userid == null || userid.trim().isEmpty()) {
4449
throw new IllegalArgumentException("userid 不能为空");
4550
}
4651
JsonObject jsonObject = new JsonObject();
4752
jsonObject.addProperty("userid", userid);
53+
jsonObject.addProperty("get_all", getAll);
4854
if (fields != null && !fields.isEmpty()) {
4955
jsonObject.add("fields", WxCpGsonBuilder.create().toJsonTree(fields));
5056
}

0 commit comments

Comments
 (0)