|
@@ -514,6 +514,51 @@ public class RWDDownloadUtil {
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
+ private static JSONArray post_by_page(String url, JSONObject criteria_base, int page_size) throws Exception {
|
|
|
+ JSONArray result;
|
|
|
+ while (true) {
|
|
|
+ Integer Count = null;
|
|
|
+ int page_current = 1;
|
|
|
+ boolean success = true;
|
|
|
+ JSONArray Content_this_time = new JSONArray();
|
|
|
+ while (true) {
|
|
|
+ JSONObject criteria = new JSONObject();
|
|
|
+ for (String key : criteria_base.keySet()) {
|
|
|
+ criteria.put(key, criteria_base.get(key));
|
|
|
+ }
|
|
|
+ criteria.put("size", page_size);
|
|
|
+ criteria.put("page", page_current);
|
|
|
+ String post_result = HttpClientUtil.post(url, criteria.toJSONString());
|
|
|
+ JSONObject resultJSON = JSON.parseObject(post_result);
|
|
|
+ JSONArray ContentInner = (JSONArray) resultJSON.get("Content");
|
|
|
+ Content_this_time.addAll(ContentInner);
|
|
|
+
|
|
|
+ // 检查数量
|
|
|
+ int CountInner = resultJSON.getInteger("Count");
|
|
|
+ if (page_current == 1) {
|
|
|
+ Count = CountInner;
|
|
|
+ } else {
|
|
|
+ if (CountInner != Count) {
|
|
|
+ success = false;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (page_current * page_size >= Count) {
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ if (Content_this_time.size() >= Count) {
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ page_current++;
|
|
|
+ }
|
|
|
+ if (success) {
|
|
|
+ result = Content_this_time;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+
|
|
|
public static void LoadIBMSPhysicalWorld(String path) throws Exception {
|
|
|
log.debug("Download ibms physical world refresh dir");
|
|
|
FileUtil.deleteRecursive(new File(path));
|
|
@@ -524,6 +569,7 @@ public class RWDDownloadUtil {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ int page_size = 500;
|
|
|
log.debug("Download ibms physical world begin " + path);
|
|
|
JSONArray classArray;
|
|
|
{
|
|
@@ -531,10 +577,8 @@ public class RWDDownloadUtil {
|
|
|
criteria.put("userId", "systemId");
|
|
|
criteria.put("projectId", RepositoryContainer.RepositoryProject.projectId);
|
|
|
criteria.put("groupCode", RepositoryContainer.RepositoryProject.groupCode);
|
|
|
- String post_result = HttpClientUtil.post(Constant.zkt_monitor_url + "/logicalGrouping/list", criteria.toJSONString());
|
|
|
- JSONObject resultJSON = JSON.parseObject(post_result);
|
|
|
- classArray = resultJSON.getJSONArray("Content");
|
|
|
- classArray = classArray == null ? new JSONArray() : classArray;
|
|
|
+ String url = Constant.zkt_monitor_url + "/logicalGrouping/list";
|
|
|
+ classArray = post_by_page(url, criteria, page_size);
|
|
|
FileUtil.Save(path + Constant.getSeperator() + "groupArray.json", FastJsonUtil.toFormatString(classArray));
|
|
|
}
|
|
|
Map<String, Map<String, List<String>>> idListMapMap = new ConcurrentHashMap<String, Map<String, List<String>>>();
|
|
@@ -568,9 +612,7 @@ public class RWDDownloadUtil {
|
|
|
criteria.put("projectId", RepositoryContainer.RepositoryProject.projectId);
|
|
|
criteria.put("groupCode", RepositoryContainer.RepositoryProject.groupCode);
|
|
|
criteria.put("logicalGroupingId", logicalGroupingId);
|
|
|
- String post_result = HttpClientUtil.post(Constant.zkt_monitor_url + "/logicalObject/listPage", criteria.toJSONString());
|
|
|
- JSONObject resultJSON = JSON.parseObject(post_result);
|
|
|
- JSONArray Content = resultJSON.getJSONArray("Content");
|
|
|
+ JSONArray Content = post_by_page(Constant.zkt_monitor_url + "/logicalObject/listPage", criteria, page_size);
|
|
|
for (int i = 0; i < Content.size(); i++) {
|
|
|
JSONObject ContentItem = (JSONObject) Content.get(i);
|
|
|
ContentItem.put("logicalGroupingId", logicalGroupingId);
|