|
@@ -710,14 +710,27 @@ public class RWDAlarmUtil {
|
|
|
boolean success = true;
|
|
|
JSONArray Content_this_time = new JSONArray();
|
|
|
while (true) {
|
|
|
- String get_url = Constant.alarm_url + "/alarm-record/page" + "?appId=" + "0" + "&userId=" + "systemId" + "&projectId="
|
|
|
- + RepositoryContainer.RepositoryProject.projectId + "&groupCode=" + RepositoryContainer.RepositoryProject.groupCode
|
|
|
- + "&dealType=0&size=" + page_size + "¤t=" + page_current;
|
|
|
- log.warn("onOpen refresh get start: " + get_url);
|
|
|
- String getResultString = HttpClientUtil.instance("alarm").get(get_url);
|
|
|
- log.warn("onOpen refresh get end: " + get_url);
|
|
|
- JSONObject getResult = JSON.parseObject(getResultString);
|
|
|
- JSONArray ContentInner = (JSONArray) getResult.get("Content");
|
|
|
+ JSONObject postParam = new JSONObject();
|
|
|
+ postParam.put("appId", "0");
|
|
|
+ postParam.put("userId", "systemId");
|
|
|
+ postParam.put("groupCode", RepositoryContainer.RepositoryProject.groupCode);
|
|
|
+ postParam.put("projectId", RepositoryContainer.RepositoryProject.projectId);
|
|
|
+ postParam.put("dealType", "0");
|
|
|
+ postParam.put("size", page_size);
|
|
|
+ postParam.put("current", page_current);
|
|
|
+// String get_url = Constant.alarm_url + "/alarm-record/page" + "?appId=" + "0" + "&userId=" + "systemId" + "&projectId="
|
|
|
+// + RepositoryContainer.RepositoryProject.projectId + "&groupCode=" + RepositoryContainer.RepositoryProject.groupCode
|
|
|
+// + "&dealType=0&size=" + page_size + "¤t=" + page_current;
|
|
|
+// log.warn("onOpen refresh get start: " + get_url);
|
|
|
+// String getResultString = HttpClientUtil.instance("alarm").get(get_url);
|
|
|
+// log.warn("onOpen refresh get end: " + get_url);
|
|
|
+// JSONObject getResult = JSON.parseObject(getResultString);
|
|
|
+ String post_url = Constant.alarm_url + "/alarm-record/page";
|
|
|
+ log.warn("onOpen refresh post start: " + post_url + "\n" + postParam.toJSONString());
|
|
|
+ String postResultString = HttpClientUtil.instance("alarm").post(post_url, postParam.toJSONString());
|
|
|
+ log.warn("onOpen refresh post end: " + post_url + "\n" + postParam.toJSONString());
|
|
|
+ JSONObject postResult = JSON.parseObject(postResultString);
|
|
|
+ JSONArray ContentInner = (JSONArray) postResult.get("Content");
|
|
|
JSONArray ids = new JSONArray();
|
|
|
Map<String, JSONObject> alarmMap = new ConcurrentHashMap<String, JSONObject>();
|
|
|
for (int i = 0; i < ContentInner.size(); i++) {
|
|
@@ -731,31 +744,30 @@ public class RWDAlarmUtil {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- if (ids.size() > 0) {
|
|
|
- JSONObject postParamInner = new JSONObject();
|
|
|
- postParamInner.put("appId", "0");
|
|
|
- postParamInner.put("userId", "systemId");
|
|
|
- postParamInner.put("projectId", RepositoryContainer.RepositoryProject.projectId);
|
|
|
- postParamInner.put("groupCode", RepositoryContainer.RepositoryProject.groupCode);
|
|
|
- postParamInner.put("ids", ids);
|
|
|
- String post_url = Constant.alarm_url + "/alarmToWorkOrder/queryOrderStateByAlarmIds";
|
|
|
- log.warn("onOpen refresh post start: " + post_url + "\t" + "ids: " + ids.size());
|
|
|
- String postResultString = HttpClientUtil.instance("alarm").post(post_url, postParamInner.toJSONString());
|
|
|
- log.warn("onOpen refresh post end: " + post_url + "\t" + "ids: " + ids.size());
|
|
|
- JSONObject postResult = JSON.parseObject(postResultString);
|
|
|
- JSONArray ContentOrderState = (JSONArray) postResult.get("Content");
|
|
|
- for (int i = 0; i < ContentOrderState.size(); i++) {
|
|
|
- JSONObject orderStateItem = ContentOrderState.getJSONObject(i);
|
|
|
- String alarmId = (String) orderStateItem.get("alarmId");
|
|
|
- JSONObject alarm = alarmMap.get(alarmId);
|
|
|
- alarm.put("orderId", orderStateItem.get("orderId"));
|
|
|
- alarm.put("orderStateDesc", orderStateItem.get("orderStateDesc"));
|
|
|
- }
|
|
|
- }
|
|
|
+// if (ids.size() > 0) {
|
|
|
+// JSONObject postParamInner = new JSONObject();
|
|
|
+// postParamInner.put("appId", "0");
|
|
|
+// postParamInner.put("userId", "systemId");
|
|
|
+// postParamInner.put("projectId", RepositoryContainer.RepositoryProject.projectId);
|
|
|
+// postParamInner.put("groupCode", RepositoryContainer.RepositoryProject.groupCode);
|
|
|
+// postParamInner.put("ids", ids);
|
|
|
+// String post_url = Constant.alarm_url + "/alarmToWorkOrder/queryOrderStateByAlarmIds";
|
|
|
+// log.warn("onOpen refresh post start: " + post_url + "\t" + "ids: " + ids.size());
|
|
|
+// String postResultString = HttpClientUtil.instance("alarm").post(post_url, postParamInner.toJSONString());
|
|
|
+// log.warn("onOpen refresh post end: " + post_url + "\t" + "ids: " + ids.size());
|
|
|
+// JSONObject postResult = JSON.parseObject(postResultString);
|
|
|
+// JSONArray ContentOrderState = (JSONArray) postResult.get("Content");
|
|
|
+// for (int i = 0; i < ContentOrderState.size(); i++) {
|
|
|
+// JSONObject orderStateItem = ContentOrderState.getJSONObject(i);
|
|
|
+// String alarmId = (String) orderStateItem.get("alarmId");
|
|
|
+// JSONObject alarm = alarmMap.get(alarmId);
|
|
|
+// alarm.put("orderId", orderStateItem.get("orderId"));
|
|
|
+// alarm.put("orderStateDesc", orderStateItem.get("orderStateDesc"));
|
|
|
+// }
|
|
|
+// }
|
|
|
Content_this_time.addAll(ContentInner);
|
|
|
-
|
|
|
// 检查数量
|
|
|
- int CountInner = getResult.getInteger("Count");
|
|
|
+ int CountInner = postResult.getInteger("Count");
|
|
|
if (page_current == 1) {
|
|
|
Count = CountInner;
|
|
|
} else {
|