接口开发.md 13 KB

SDK

文件结构:s-HR-SDK.zip

shr_sso_client.jar:为调用接口sdk

requiredLib.zip:为依赖jar的压缩包

一.获取组织信息接口

服务名:getOrgInfoOsfService

参数:

字段名 类型 必填 说明 示例
layerType String 组织类型,支持逗号分隔多个值(精确匹配) 公司,部门
modifyDate String 最后修改日期(>= 该日期) yyyy-MM-dd
name String 组织名称(左模糊匹配) 业务部
code String 组织编号(精确匹配) 010056
size int 每页条数(默认100,最大1000) 100
page int 页码(默认1) 1

字段:

描述 接口字段 类型 说明
组织名称 name String
组织全称 fullname String 显示名
组织编号 code String
上级组织编号 parent String
组织全编码 fullnumber String 长编码层级路径,根据”!”分割,前一数字是上级组织编号
显示顺序 disporder String 根据”!”分割,前一数字是上级组织排序码
是否启用 status String 1(有效);0(封存)
主键 id String 区分大小写的字符串uuid
备注 description String
修改日期 modifyDate String 当前版本不返回此字段,如需返回请取消注释
组织类型 layerType String 公司 / 部门 / 集团 / 子中心 / 中心 / 公司(新)

返回说明:

字段名 类型 说明
code String 状态码(200:成功, 500:异常)
msg String 提示信息
page int 当前页码
size int 每页条数
data Array 组织列表,结构见”字段”表

使用sdk调用示例(Java)

二.获取岗位信息接口

服务名:getPosInfoOsfService

参数:

OSFWSClient osfwsClient = new OSFWSClient();
String shrAddr = “http://172.16.38.1:6888/shr”;
Map map = new HashMap();
map.put(“modifyDate”, “2025-01-01”);
map.put(“layerType”, “部门”);
map.put(“page”, 1);
map.put(“size”, 100);
String result = osfwsClient.proceedOSF(shrAddr, “getOrgInfoOsfService”, map);
System.out.println(result);
字段名 类型 必填 说明 示例
modifyDate String 修改日期(范围过滤:岗位或人员职位 >= 该日期) yyyy-MM-dd
name String 岗位名称(左模糊匹配) 经理
code String 岗位编号(精确匹配) 010056
size int 每页条数(默认100,最大1000) 100
page int 页码(默认1) 1

字段:

描述 接口字段 类型 说明
是否负责人岗 isrespposition String 1(是),0(否)
岗位名称 name String
岗位编号 code String
显示顺序 disporder String
所属组织编号 department String
上级岗位编号 parent String
部门副职 vice String 1(是),0(否)
备注 description String
主键 id String 区分大小写的字符串uuid

返回说明:

字段名 类型 说明
code String 状态码(200:成功, 500:异常)
msg String 提示信息
page int 当前页码
size int 每页条数
data Array 岗位列表,结构见”字段”表

使用sdk调用示例(Java)

三.人员接口

服务名:getEmpInfoOsfService

参数:

OSFWSClient osfwsClient = new OSFWSClient();
String shrAddr = “http://172.16.38.1:6888/shr”;
Map map = new HashMap();
map.put(“modifyDate”, “2025-01-01”);
map.put(“name”, “经理”);
map.put(“page”, 1);
map.put(“size”, 100);
String result = osfwsClient.proceedOSF(shrAddr, “getPosInfoOsfService”, map);
System.out.println(result);
字段名 类型 必填 说明 示例
modifyDate String 修改日期(范围过滤:员工或联系方式 >= 该日期) yyyy-MM-dd
name String 员工名称(左模糊匹配) 张三
code String 员工编号(精确匹配) 010056
size int 每页条数(默认100,最大1000) 100
page int 页码(默认1) 1

字段:

描述 接口字段 类型 说明
员工ID id String 区分大小写的字符串uuid
员工编码 code String
员工名称 name String
身份证号码 idcardno String
用工关系类型 tyname String
是否在职 inservice String 1或4表示在职,其他值表示不在职
性别 gender String 1:男,2:女
国际区号 globalroaming String
手机号码 ncell String
入司日期 joindate String 格式:yyyy-MM-dd
所属组织编码 orgCode String
主岗位编码 posCode String
上级员工编码列表 leader Array[String] 一个员工可能有多个上级
登录账号 userAccount String
办公电话 officephone String
护照号码 passportno String
顺序码 disporder String 9999999

返回说明:

字段名 类型 说明
code String 状态码(200:成功, 500:异常)
msg String 提示信息
page int 当前页码
size int 每页条数
data Array 人员列表,结构见"字段"表

使用sdk调用示例(Java)

四.分管领导接口

服务名:getRoleSupervisorInfoOsfService

参数:

OSFWSClient osfwsClient = new OSFWSClient();
String shrAddr = "http://172.16.38.1:6888/shr";
Map map = new HashMap();
map.put("modifyDate", "2025-01-01");
map.put("name", "张三");
map.put("page", 1);
map.put("size", 100);
String result = osfwsClient.proceedOSF(shrAddr, "getEmpInfoOsfService", map);
System.out.println(result);
字段名 类型 必填 说明 示例
modifyDate String 修改日期(范围过滤:角色或人员-角色关联 >= 该日期) yyyy-MM-dd
name String 角色名称(左模糊匹配) 分管领导
code String 角色编号(精确匹配) 010056
size int 每页条数(默认100,最大1000) 100
page int 页码(默认1) 1

字段:

描述 接口字段 类型 说明
主键 id String 区分大小写的字符串uuid(人员-角色关联表主键)
角色ID roleid String 区分大小写的字符串uuid(关联 T_WFR_WFROLE.FID)
组织编号 orgCode String
人员编号 personCode String
是否包含下级 isinclude String 1(是),0(否)
是否委托 isdele String 1(是),0(否)
委托操作人编号 deleperson String
角色名称 rolename String
角色编号 rolenumber String
角色描述 roledescribe String
角色类型 roletype String 0 (职员角色),1 (职位角色),2 (组织角色)
角色状态 state String 1 (启用),0(禁用)
组织类型 layerType String 公司 / 部门 / 集团 / 子中心 / 中心 / 公司(新)

返回说明:

字段名 类型 说明
code String 状态码(200:成功, 500:异常)
msg String 提示信息
page int 当前页码
size int 每页条数
data Array 角色成员列表,结构见"字段"表

使用sdk调用示例(Java)

五:人员兼职接口

服务名:getPluralityInfoOsfService

参数:

OSFWSClient osfwsClient = new OSFWSClient();
String shrAddr = "http://172.16.38.1:6888/shr";
Map map = new HashMap();
map.put("modifyDate", "2025-01-01");
map.put("name", "分管领导");
map.put("page", 1);
map.put("size", 100);
String result = osfwsClient.proceedOSF(shrAddr, "getRoleSupervisorInfoOsfService", map);
System.out.println(result);
字段名 类型 必填 说明 示例
modifyDate String 修改日期(范围过滤:加入兼职单或移除兼职单 >= 该日期) yyyy-MM-dd
personCode String 员工编号(精确匹配) 010056
size int 每页条数(默认100,最大1000) 100
page int 页码(默认1) 1

字段:

描述 接口字段 类型 说明
员工ID personid String 区分大小写的字符串uuid
员工编号 personCode String
兼职开始日期 startDate String 格式:yyyy-MM-dd
兼职结束日期 endDate String 格式:yyyy-MM-dd,未结束则为"2199-12-31"
兼职组织编码 orgCode String
兼职岗位编码 posCode String
上级员工编码列表 leader Array[String] 一个员工可能有多个上级
兼职备注 description String 来自加入兼职单分录

返回说明:

字段名 类型 说明
code String 状态码(200:成功, 500:异常)
msg String 提示信息
page int 当前页码
size int 每页条数
data Array 兼职信息列表,结构见"字段"表

使用sdk调用示例(Java)

六.保存打卡记录接口

服务名:savePunchCardRecords

参数:

OSFWSClient osfwsClient = new OSFWSClient();
String shrAddr = "http://172.16.38.1:6888/shr";
Map map = new HashMap();
map.put("modifyDate", "2025-01-01");
map.put("personCode", "010056");
map.put("page", 1);
map.put("size", 100);
String result = osfwsClient.proceedOSF(shrAddr, "getPluralityInfoOsfService", map);
System.out.println(result);
字段名 类型 必填 说明 示例
EquNo String 打卡来源 OA
CardId String 员工工号 904213
RecDate String 打卡日期 2025-11-07
RecTime String 打卡时间 09:00:00
Address String 打卡地点 广东惠州

返回说明:

字段名 类型 说明
recordCtn int 总数
successCtn int 成功数
formatErrorRecords Array 格式化失败打卡记录列表
notExistRecords Array 获取人员信息失败打卡记录列表
duplicateRecords Array 重复打卡记录列表

使用sdk调用示例(Java)

七:单点登录集成

八:待办集成

OSFWSClient osfwsClient = new OSFWSClient();
String shrAddr = "http://172.16.38.1:6888/shr";
Map paramMap = new HashMap();
paramMap.put("EquNo","OA001");
paramMap.put("CardId","980132");
paramMap.put("RecDate","2026-06-15");
paramMap.put("RecTime","09:00");
list.add(paramMap);
Gson gson =new Gson();
param.put("records",gson.toJson(list));
String result = osfwsClient.proceedOSF(shrAddr, "savePunchCardRecords", map);
System.out.println(result);