|
@@ -116,10 +116,8 @@ public class RWDAlarmUtil {
|
|
|
if (params.containsKey("报警级别")) {
|
|
|
sb.append("&level=" + params.get("报警级别"));
|
|
|
}
|
|
|
- if (params.containsKey("报警处理状态")) {
|
|
|
- sb.append("&treatState=" + params.get("报警处理状态"));
|
|
|
- } else {
|
|
|
- sb.append("&treatState=" + 3);
|
|
|
+ {
|
|
|
+ sb.append("&dealType=1");
|
|
|
}
|
|
|
if (params.containsKey("报警类型")) {
|
|
|
sb.append("&itemName=" + URLEncoder.encode(params.getString("报警类型"), "utf-8"));
|
|
@@ -521,48 +519,45 @@ public class RWDAlarmUtil {
|
|
|
JSONArray Content;
|
|
|
if (Constant.alarm_service_name.equalsIgnoreCase("ibms-alarm")) {
|
|
|
Content = new JSONArray();
|
|
|
- int[] treatState_array = { 1, 2 };
|
|
|
- for (int treatState : treatState_array) {
|
|
|
- String get_url = Constant.alarm_url + "/alarm-record/page" + "?appId=" + "0" + "&userId=" + "systemId" + "&projectId="
|
|
|
- + RepositoryContainer.RepositoryBase.projectId + "&groupCode=" + RepositoryContainer.RepositoryBase.groupCode
|
|
|
- + "&size=65535¤t=1&treatState=" + treatState;
|
|
|
- String getResultString = HttpClientUtil.get(get_url);
|
|
|
- JSONObject getResult = JSON.parseObject(getResultString);
|
|
|
- JSONArray ContentInner = (JSONArray) getResult.get("Content");
|
|
|
- JSONArray ids = new JSONArray();
|
|
|
- Map<String, JSONObject> alarmMap = new HashMap<String, JSONObject>();
|
|
|
- for (int i = 0; i < ContentInner.size(); i++) {
|
|
|
- JSONObject alarm = ContentInner.getJSONObject(i);
|
|
|
- if (alarm.containsKey("treatMode")) {
|
|
|
- String id = (String) alarm.get("id");
|
|
|
- int treatMode = alarm.getIntValue("treatMode");
|
|
|
- if (treatMode == 2) {
|
|
|
- ids.add(id);
|
|
|
- alarmMap.put(id, alarm);
|
|
|
- }
|
|
|
+ String get_url = Constant.alarm_url + "/alarm-record/page" + "?appId=" + "0" + "&userId=" + "systemId" + "&projectId="
|
|
|
+ + RepositoryContainer.RepositoryBase.projectId + "&groupCode=" + RepositoryContainer.RepositoryBase.groupCode
|
|
|
+ + "&size=65535¤t=1&dealType=0";
|
|
|
+ String getResultString = HttpClientUtil.get(get_url);
|
|
|
+ JSONObject getResult = JSON.parseObject(getResultString);
|
|
|
+ JSONArray ContentInner = (JSONArray) getResult.get("Content");
|
|
|
+ JSONArray ids = new JSONArray();
|
|
|
+ Map<String, JSONObject> alarmMap = new HashMap<String, JSONObject>();
|
|
|
+ for (int i = 0; i < ContentInner.size(); i++) {
|
|
|
+ JSONObject alarm = ContentInner.getJSONObject(i);
|
|
|
+ if (alarm.containsKey("treatMode")) {
|
|
|
+ String id = (String) alarm.get("id");
|
|
|
+ int treatMode = alarm.getIntValue("treatMode");
|
|
|
+ if (treatMode == 2) {
|
|
|
+ ids.add(id);
|
|
|
+ alarmMap.put(id, alarm);
|
|
|
}
|
|
|
}
|
|
|
- if (ids.size() > 0) {
|
|
|
- JSONObject postParamInner = new JSONObject();
|
|
|
- postParamInner.put("appId", "0");
|
|
|
- postParamInner.put("userId", "systemId");
|
|
|
- postParamInner.put("projectId", RepositoryContainer.RepositoryBase.projectId);
|
|
|
- postParamInner.put("groupCode", RepositoryContainer.RepositoryBase.groupCode);
|
|
|
- postParamInner.put("ids", ids);
|
|
|
- String post_url = Constant.alarm_url + "/alarmToWorkOrder/queryOrderStateByAlarmIds";
|
|
|
- String postResultString = HttpClientUtil.post(post_url, postParamInner.toJSONString());
|
|
|
- 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.RepositoryBase.projectId);
|
|
|
+ postParamInner.put("groupCode", RepositoryContainer.RepositoryBase.groupCode);
|
|
|
+ postParamInner.put("ids", ids);
|
|
|
+ String post_url = Constant.alarm_url + "/alarmToWorkOrder/queryOrderStateByAlarmIds";
|
|
|
+ String postResultString = HttpClientUtil.post(post_url, postParamInner.toJSONString());
|
|
|
+ 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.addAll(ContentInner);
|
|
|
}
|
|
|
+ Content.addAll(ContentInner);
|
|
|
} else {
|
|
|
String post_url = Constant.alarm_url + "/alarm/queryAlarmList";
|
|
|
JSONObject postParam = new JSONObject();
|