| | |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.google.gson.Gson; |
| | | import com.open.common.util.OpenApiClient; |
| | | import com.open.common.util.SystemParameterNames; |
| | | import com.stylefeng.guns.modular.system.util.qianyuntong.model.*; |
| | |
| | | * @param request |
| | | * @return |
| | | */ |
| | | public static Boolean saveStaffNode(SaveStaffNodeRequest request){ |
| | | public static SaveStaffNode saveStaffNode(SaveStaffNodeRequest request){ |
| | | //请求路径 |
| | | String url = QianYunTongProperties.apiUrl + "/openapi/rest/1.0/saveStaffNode"; |
| | | //私钥文件 |
| | |
| | | contentMap.put(SystemParameterNames.getMessage_id(), messageId); |
| | | contentMap.put(SystemParameterNames.getUserName(), QianYunTongProperties.userName); |
| | | contentMap.put(SystemParameterNames.getStatus(), QianYunTongProperties.status); |
| | | contentMap.put("content", JSON.toJSONString(request)); |
| | | contentMap.put("content", new Gson().toJson(request)); |
| | | log.info("【企业增加员工】请求地址:" + url); |
| | | log.info("【企业增加员工】请求参数:" + JSON.toJSONString(contentMap)); |
| | | String result = OpenApiClient.sendCommonHttpRequst(url, headers, "POST", skprivateKeyFile, timeStamp, contentMap); |
| | |
| | | log.error("【企业增加员工】失败:" + object.toJSONString()); |
| | | throw new RuntimeException("【企业增加员工】失败:" + object.toJSONString()); |
| | | } |
| | | return true; |
| | | SaveStaffNode saveStaffNode = jsonObject.getObject("object", SaveStaffNode.class); |
| | | return saveStaffNode; |
| | | } |
| | | |
| | | |
| | |
| | | contentMap.put(SystemParameterNames.getMessage_id(), messageId); |
| | | contentMap.put(SystemParameterNames.getUserName(), QianYunTongProperties.userName); |
| | | contentMap.put(SystemParameterNames.getStatus(), QianYunTongProperties.status); |
| | | contentMap.put("content", JSON.toJSONString(request)); |
| | | contentMap.put("content", new Gson().toJson(request)); |
| | | log.info("【企业修改员工信息】请求地址:" + url); |
| | | log.info("【企业修改员工信息】请求参数:" + JSON.toJSONString(contentMap)); |
| | | String result = OpenApiClient.sendCommonHttpRequst(url, headers, "POST", skprivateKeyFile, timeStamp, contentMap); |
| | |
| | | contentMap.put(SystemParameterNames.getMessage_id(), messageId); |
| | | contentMap.put(SystemParameterNames.getUserName(), QianYunTongProperties.userName); |
| | | contentMap.put(SystemParameterNames.getStatus(), QianYunTongProperties.status); |
| | | contentMap.put("content", JSON.toJSONString(request)); |
| | | contentMap.put("content", new Gson().toJson(request)); |
| | | log.info("【企业删除人员】请求地址:" + url); |
| | | log.info("【企业删除人员】请求参数:" + JSON.toJSONString(contentMap)); |
| | | String result = OpenApiClient.sendCommonHttpRequst(url, headers, "POST", skprivateKeyFile, timeStamp, contentMap); |
| | |
| | | contentMap.put(SystemParameterNames.getMessage_id(), messageId); |
| | | contentMap.put(SystemParameterNames.getUserName(), QianYunTongProperties.userName); |
| | | contentMap.put(SystemParameterNames.getStatus(), QianYunTongProperties.status); |
| | | contentMap.put("content", JSON.toJSONString(request)); |
| | | contentMap.put("content", new Gson().toJson(request)); |
| | | log.info("【根据员工ID获取人员信息】请求地址:" + url); |
| | | log.info("【根据员工ID获取人员信息】请求参数:" + JSON.toJSONString(contentMap)); |
| | | String result = OpenApiClient.sendCommonHttpRequst(url, headers, "GET", skprivateKeyFile, timeStamp, contentMap); |
| | |
| | | log.error("【根据员工ID获取人员信息】失败:" + object.toJSONString()); |
| | | throw new RuntimeException("【根据员工ID获取人员信息】失败:" + object.toJSONString()); |
| | | } |
| | | StaffNodeInfo staffNodeInfo = jsonObject.getObject("object", StaffNodeInfo.class); |
| | | StaffNodeInfo staffNodeInfo = object.getObject("data", StaffNodeInfo.class); |
| | | return staffNodeInfo; |
| | | } |
| | | } |