|
@@ -49,7 +49,7 @@ public class OAService {
|
|
|
@Resource
|
|
@Resource
|
|
|
JdbcClient jdbcClient;
|
|
JdbcClient jdbcClient;
|
|
|
|
|
|
|
|
- public String getGetToken() throws Exception{
|
|
|
|
|
|
|
+ public String getGetToken() throws Exception {
|
|
|
String url = host + getTokenPath;
|
|
String url = host + getTokenPath;
|
|
|
JSONObject object = new JSONObject();
|
|
JSONObject object = new JSONObject();
|
|
|
object.put("userName", username);
|
|
object.put("userName", username);
|
|
@@ -62,7 +62,7 @@ public class OAService {
|
|
|
return resObject.getString("id");
|
|
return resObject.getString("id");
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- public String getUsername(String ticket) throws Exception{
|
|
|
|
|
|
|
+ public String getUsername(String ticket) throws Exception {
|
|
|
String getLoginNameUrl = host + oaUsernamePath + ticket;
|
|
String getLoginNameUrl = host + oaUsernamePath + ticket;
|
|
|
|
|
|
|
|
String uuid = UUID.randomUUID().toString();
|
|
String uuid = UUID.randomUUID().toString();
|
|
@@ -72,7 +72,7 @@ public class OAService {
|
|
|
return username;
|
|
return username;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- public String getTelNumber(String username) throws Exception{
|
|
|
|
|
|
|
+ public String getTelNumber(String username) throws Exception {
|
|
|
String token = getGetToken();
|
|
String token = getGetToken();
|
|
|
String getLoginNameUrl = host + oaUserInfoPath + username;
|
|
String getLoginNameUrl = host + oaUserInfoPath + username;
|
|
|
Map<String, String> header = new HashMap<>();
|
|
Map<String, String> header = new HashMap<>();
|
|
@@ -142,7 +142,7 @@ public class OAService {
|
|
|
return resObj.getBoolean("success");
|
|
return resObj.getBoolean("success");
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- public Boolean sendMessage(String messageId, String sendUserId, String receiveUserId, String message,String url)
|
|
|
|
|
|
|
+ public Boolean sendMessage(String messageId, String sendUserId, String receiveUserId, String message, String url)
|
|
|
throws Exception {
|
|
throws Exception {
|
|
|
SysUser sendUser = new SysUser();
|
|
SysUser sendUser = new SysUser();
|
|
|
sendUser.setUserId(Long.valueOf(sendUserId));
|
|
sendUser.setUserId(Long.valueOf(sendUserId));
|
|
@@ -174,25 +174,26 @@ public class OAService {
|
|
|
return resObj.getBoolean("success");
|
|
return resObj.getBoolean("success");
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-// public static void main(String[] args) throws Exception {
|
|
|
|
|
-// String url = "http://172.16.1.71:8080" + "/seeyon/rest/token";
|
|
|
|
|
-// JSONObject object = new JSONObject();
|
|
|
|
|
-// object.put("userName", "zcxt");
|
|
|
|
|
-// object.put("password", "f87f6334-585d-42dd-95bc-7e7b97c7cfe8");
|
|
|
|
|
-//
|
|
|
|
|
-// String uuid = UUID.randomUUID().toString();
|
|
|
|
|
-// log.info(uuid + "查询OAtoken的req========>" + object.toJSONString() + ",url========>" + url);
|
|
|
|
|
-// JSONObject resObject = HttpClientUtil.sendPOST(url, object.toJSONString());
|
|
|
|
|
-// log.info(uuid + "查询OAtoken的res========>" + resObject.toJSONString());
|
|
|
|
|
-// String token = resObject.getString("id");
|
|
|
|
|
-// String getLoginNameUrl = "http://172.16.1.71:8080" + "/seeyon/rest/orgMember?loginName=" + "huangjx";
|
|
|
|
|
-// Map<String, String> header = new HashMap<>();
|
|
|
|
|
-// header.put("token", token);
|
|
|
|
|
-//
|
|
|
|
|
-// uuid = UUID.randomUUID().toString();
|
|
|
|
|
-// log.info(uuid + "查询OA telNumber的url========>" + getLoginNameUrl);
|
|
|
|
|
-// JSONObject resObj = HttpClientUtil.sendGETWithHeader_Obj(getLoginNameUrl, header);
|
|
|
|
|
-// log.info(uuid + "查询OA telNumber的username======>" + "" + ",res======>" + resObj.toJSONString());
|
|
|
|
|
-// System.out.println(resObj.getString("telNumber"));
|
|
|
|
|
-// }
|
|
|
|
|
|
|
+ /* public static void main(String[] args) throws Exception {
|
|
|
|
|
+ String url = "http://172.16.1.71:8080" + "/seeyon/rest/token";
|
|
|
|
|
+ JSONObject object = new JSONObject();
|
|
|
|
|
+ object.put("userName", "zcxt");
|
|
|
|
|
+ object.put("password", "f87f6334-585d-42dd-95bc-7e7b97c7cfe8");
|
|
|
|
|
+
|
|
|
|
|
+ String uuid = UUID.randomUUID().toString();
|
|
|
|
|
+ log.info(uuid + "查询OAtoken的req========>" + object.toJSONString() + ",url========>" + url);
|
|
|
|
|
+ JSONObject resObject = HttpClientUtil.sendPOST(url, object.toJSONString());
|
|
|
|
|
+ log.info(uuid + "查询OAtoken的res========>" + resObject.toJSONString());
|
|
|
|
|
+ String token = resObject.getString("id");
|
|
|
|
|
+ String getLoginNameUrl = "http://172.16.1.71:8080" + "/seeyon/rest/orgMembers/code/18660267691?pageNo=1&pageSize=1&token=" +
|
|
|
|
|
+ token;
|
|
|
|
|
+ Map<String, String> header = new HashMap<>();
|
|
|
|
|
+ header.put("token", token);
|
|
|
|
|
+
|
|
|
|
|
+ uuid = UUID.randomUUID().toString();
|
|
|
|
|
+ log.info(uuid + "查询OA telNumber的url========>" + getLoginNameUrl);
|
|
|
|
|
+ JSONObject resObj = HttpClientUtil.sendGETWithHeader_Obj(getLoginNameUrl, header);
|
|
|
|
|
+ log.info(uuid + "查询OA telNumber的username======>" + "" + ",res======>" + resObj.toJSONString());
|
|
|
|
|
+ System.out.println(resObj.getString("telNumber"));
|
|
|
|
|
+ }*/
|
|
|
}
|
|
}
|