|
@@ -7,6 +7,9 @@ import java.util.List;
|
|
|
import java.util.Map;
|
|
|
import java.util.concurrent.ConcurrentHashMap;
|
|
|
import java.util.concurrent.CopyOnWriteArrayList;
|
|
|
+import java.util.concurrent.ExecutorService;
|
|
|
+import java.util.concurrent.LinkedBlockingQueue;
|
|
|
+import java.util.concurrent.ThreadPoolExecutor;
|
|
|
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
@@ -18,10 +21,14 @@ import com.persagy.ibms.core.data.SceneDataValue;
|
|
|
import com.persagy.ibms.core.util.LogUtil;
|
|
|
import com.persagy.ibms.core.util.RWDUtil;
|
|
|
|
|
|
+import cn.hutool.core.thread.ExecutorBuilder;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
|
|
@Slf4j
|
|
|
public class RWDAlarmUtil {
|
|
|
+ public static ExecutorService executor = ExecutorBuilder.create().setCorePoolSize(1).setMaxPoolSize(1)
|
|
|
+ .setWorkQueue(new LinkedBlockingQueue<>(256)).setHandler(new ThreadPoolExecutor.AbortPolicy()).build();
|
|
|
+
|
|
|
public static JSONArray history_alarm_path = new JSONArray();
|
|
|
static Map<Integer, String> stateMap = new ConcurrentHashMap<Integer, String>();
|
|
|
static Map<Integer, String> statusMap = new ConcurrentHashMap<Integer, String>();
|
|
@@ -694,7 +701,9 @@ public class RWDAlarmUtil {
|
|
|
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");
|
|
|
JSONArray ids = new JSONArray();
|
|
@@ -718,7 +727,9 @@ public class RWDAlarmUtil {
|
|
|
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++) {
|