陈昶聿
2 天以前 c8eff646eb012b06954c1a6d712c277b3bd9d3cc
【景宁】定时发送异常信息-景宁配置
已修改1个文件
8 ■■■■ 文件已修改
smartor/src/main/java/com/smartor/service/impl/DingTalkServiceImpl.java 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/service/impl/DingTalkServiceImpl.java
@@ -258,12 +258,18 @@
     */
    @Override
    public String getDingTalkUserByMobile(String mobile) throws Exception {
        String userId = "";
        String accessToken = getAccessToken();
        DingTalkClient client = new DefaultDingTalkClient("https://oapi.dingtalk.com/topapi/v2/user/getbymobile");
        OapiV2UserGetbymobileRequest req = new OapiV2UserGetbymobileRequest();
        req.setMobile(mobile);
        OapiV2UserGetbymobileResponse rsp = client.execute(req, accessToken);
        return rsp.getBody();
        String resultBody = rsp.getBody();
        JSONObject json = JSONObject.parseObject(resultBody);
        if("0".equals(json.get("errcode"))){
            userId = json.getJSONObject("result").getString("userid");
        }
        return userId;
    }
}