...
|
...
|
@@ -24,9 +24,7 @@ import org.springframework.web.client.RestTemplate; |
|
|
import javax.annotation.Resource;
|
|
|
import java.io.IOException;
|
|
|
import java.text.MessageFormat;
|
|
|
import java.util.Arrays;
|
|
|
import java.util.HashMap;
|
|
|
import java.util.List;
|
|
|
import java.util.*;
|
|
|
import java.util.concurrent.Callable;
|
|
|
|
|
|
/**
|
...
|
...
|
@@ -54,9 +52,9 @@ public class QueueViewJob implements Callable { |
|
|
|
|
|
this.rabbitAlertMapper = rabbitAlertMapper;
|
|
|
|
|
|
this.moService=imObjectInfoService;
|
|
|
this.moService = imObjectInfoService;
|
|
|
|
|
|
this.alarmMsgComp=alarmMsgComp;
|
|
|
this.alarmMsgComp = alarmMsgComp;
|
|
|
}
|
|
|
|
|
|
public void doTask() {
|
...
|
...
|
@@ -76,6 +74,8 @@ public class QueueViewJob implements Callable { |
|
|
try {
|
|
|
oneView.setQueueView(Arrays.asList(InterVar.JSONMAPPER.readValue(respJson, QueueInfo[].class)));
|
|
|
|
|
|
sortQueue(oneView.getQueueView());
|
|
|
|
|
|
oneView.setMoId(moInfo.getMoId());
|
|
|
|
|
|
//fire alarm
|
...
|
...
|
@@ -120,7 +120,7 @@ public class QueueViewJob implements Callable { |
|
|
//alert
|
|
|
String msg = buildAlarmMsg(queueInfo);
|
|
|
|
|
|
alarmMsgComp.doAlarm(InterVar.ALARM_QUEUE,msg);
|
|
|
alarmMsgComp.doAlarm(InterVar.ALARM_QUEUE, msg);
|
|
|
|
|
|
//ui alert
|
|
|
InterVar.overViewMaps.get(this.moId).setState(0);
|
...
|
...
|
@@ -175,4 +175,15 @@ public class QueueViewJob implements Callable { |
|
|
|
|
|
return builder.toString();
|
|
|
}
|
|
|
|
|
|
|
|
|
private void sortQueue(List<QueueInfo> queuesList) {
|
|
|
Collections.sort(queuesList, new Comparator<QueueInfo>() {
|
|
|
@Override
|
|
|
public int compare(QueueInfo o1, QueueInfo o2) {
|
|
|
|
|
|
return o1.getMessages() > o2.getMessages() ? -1 : 1;
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
} |
...
|
...
|
|