|
@@ -169,10 +169,8 @@ public class PortalOaFlow {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public String testRestfulNoHeader(String address,String api,String jsonParams, String userid){
|
|
public String testRestfulNoHeader(String address,String api,String jsonParams, String userid){
|
|
|
- //ECOLOGY返回的token
|
|
|
|
|
-
|
|
|
|
|
String data = HttpRequest
|
|
String data = HttpRequest
|
|
|
- .post(address + api).disableCookie()
|
|
|
|
|
|
|
+ .post(address + api + "?user="+userid).disableCookie()
|
|
|
.body(jsonParams)
|
|
.body(jsonParams)
|
|
|
.execute().body();
|
|
.execute().body();
|
|
|
System.out.println("testRestful():"+data);
|
|
System.out.println("testRestful():"+data);
|
|
@@ -222,30 +220,30 @@ public class PortalOaFlow {
|
|
|
// }
|
|
// }
|
|
|
|
|
|
|
|
public ImmutableMap<String, Object> getOaTodo(String oaId, Integer pageNo ,Integer pageSize) throws Exception {
|
|
public ImmutableMap<String, Object> getOaTodo(String oaId, Integer pageNo ,Integer pageSize) throws Exception {
|
|
|
- return ImmutableMap.of("todoCount", 0 , "todoList", new ArrayList<>(),"doneCount", 0,"doneList", new ArrayList<>());
|
|
|
|
|
-// Map<String, Object> params = new HashMap<>();
|
|
|
|
|
-// Map<String, Object> map = new HashMap<>();
|
|
|
|
|
-// map.put("root", ImmutableMap.of("createrid", oaId));
|
|
|
|
|
-// params.put("conditions", map);
|
|
|
|
|
-//
|
|
|
|
|
-// String out = testRestful("https://yfoa.keruioil.com", "/api/workflow/paService/getDoingWorkflowRequestCount", JSON.toJSONString(params), oaId);
|
|
|
|
|
-// String done = testRestful("https://yfoa.keruioil.com", "/api/workflow/paService/getHandledWorkflowRequestCount", JSON.toJSONString(params), oaId);
|
|
|
|
|
-// map.put("root", ImmutableMap.of("craterid", oaId,"isdebug", "true"));
|
|
|
|
|
-// params.put("conditions", map);
|
|
|
|
|
-// System.out.println("-----------"+JSON.toJSONString(params));
|
|
|
|
|
-//
|
|
|
|
|
-// String todoList = testRestful("https://yfoa.keruioil.com", "/api/workflow/paService/getDoingWorkflowRequestList?pageNo="+pageNo+"&pageSize="+pageSize, JSON.toJSONString(params), oaId);
|
|
|
|
|
-// List<JSONObject> jsonObjects = new ArrayList<>();
|
|
|
|
|
-// if (todoList != null && !todoList.contains("token不存在或者超时")) {
|
|
|
|
|
-// jsonObjects = JSON.parseArray(todoList, JSONObject.class);
|
|
|
|
|
-// }
|
|
|
|
|
-// //已办明细
|
|
|
|
|
-// String doneList = testRestful("https://yfoa.keruioil.com", "/api/workflow/paService/getHandledWorkflowRequestList?pageNo="+pageNo+"&pageSize="+pageSize, JSON.toJSONString(params), oaId);
|
|
|
|
|
-// List<JSONObject> doneJsonObjects = new ArrayList<>();
|
|
|
|
|
-// if (todoList != null && !todoList.contains("token不存在或者超时")) {
|
|
|
|
|
-// doneJsonObjects = JSON.parseArray(doneList, JSONObject.class);
|
|
|
|
|
-// }
|
|
|
|
|
-// return ImmutableMap.of("todoCount", NumberUtil.isNumber(out)?out:0 , "todoList", jsonObjects,"doneCount", NumberUtil.isNumber(done)?done : 0,"doneList", doneJsonObjects);
|
|
|
|
|
|
|
+// return ImmutableMap.of("todoCount", 0 , "todoList", new ArrayList<>(),"doneCount", 0,"doneList", new ArrayList<>());
|
|
|
|
|
+ Map<String, Object> params = new HashMap<>();
|
|
|
|
|
+ Map<String, Object> map = new HashMap<>();
|
|
|
|
|
+ map.put("root", ImmutableMap.of("createrid", oaId));
|
|
|
|
|
+ params.put("conditions", map);
|
|
|
|
|
+
|
|
|
|
|
+ String out = testRestfulNoHeader("https://yfoa.keruioil.com", "/api/workflow/paService/getDoingWorkflowRequestCountInside", JSON.toJSONString(params), oaId);
|
|
|
|
|
+ String done = testRestfulNoHeader("https://yfoa.keruioil.com", "/api/workflow/paService/getHandledWorkflowRequestCountInside", JSON.toJSONString(params), oaId);
|
|
|
|
|
+ map.put("root", ImmutableMap.of("craterid", oaId,"isdebug", "true"));
|
|
|
|
|
+ params.put("conditions", map);
|
|
|
|
|
+ System.out.println("-----------"+JSON.toJSONString(params));
|
|
|
|
|
+
|
|
|
|
|
+ String todoList = testRestfulNoHeader("https://yfoa.keruioil.com", "/api/workflow/paService/getDoingWorkflowRequestListInside?pageNo="+pageNo+"&pageSize="+pageSize, JSON.toJSONString(params), oaId);
|
|
|
|
|
+ List<JSONObject> jsonObjects = new ArrayList<>();
|
|
|
|
|
+ if (todoList != null && !todoList.contains("token不存在或者超时")) {
|
|
|
|
|
+ jsonObjects = JSON.parseArray(todoList, JSONObject.class);
|
|
|
|
|
+ }
|
|
|
|
|
+ //已办明细
|
|
|
|
|
+ String doneList = testRestfulNoHeader("https://yfoa.keruioil.com", "/api/workflow/paService/getHandledWorkflowRequestListInside?pageNo="+pageNo+"&pageSize="+pageSize, JSON.toJSONString(params), oaId);
|
|
|
|
|
+ List<JSONObject> doneJsonObjects = new ArrayList<>();
|
|
|
|
|
+ if (todoList != null && !todoList.contains("token不存在或者超时")) {
|
|
|
|
|
+ doneJsonObjects = JSON.parseArray(doneList, JSONObject.class);
|
|
|
|
|
+ }
|
|
|
|
|
+ return ImmutableMap.of("todoCount", NumberUtil.isNumber(out)?out:0 , "todoList", jsonObjects,"doneCount", NumberUtil.isNumber(done)?done : 0,"doneList", doneJsonObjects);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public List getOaNotice(String oaId, OaNoticeDO oaNoticeDO, String workcode) throws Exception {
|
|
public List getOaNotice(String oaId, OaNoticeDO oaNoticeDO, String workcode) throws Exception {
|