|
@@ -24,9 +24,7 @@ import org.springframework.web.client.RestTemplate; |
|
@@ -24,9 +24,7 @@ import org.springframework.web.client.RestTemplate; |
24
|
import javax.annotation.Resource;
|
24
|
import javax.annotation.Resource;
|
25
|
import java.io.IOException;
|
25
|
import java.io.IOException;
|
26
|
import java.text.MessageFormat;
|
26
|
import java.text.MessageFormat;
|
27
|
-import java.util.Arrays;
|
|
|
28
|
-import java.util.HashMap;
|
|
|
29
|
-import java.util.List;
|
27
|
+import java.util.*;
|
30
|
import java.util.concurrent.Callable;
|
28
|
import java.util.concurrent.Callable;
|
31
|
|
29
|
|
32
|
/**
|
30
|
/**
|
|
@@ -54,9 +52,9 @@ public class QueueViewJob implements Callable { |
|
@@ -54,9 +52,9 @@ public class QueueViewJob implements Callable { |
54
|
|
52
|
|
55
|
this.rabbitAlertMapper = rabbitAlertMapper;
|
53
|
this.rabbitAlertMapper = rabbitAlertMapper;
|
56
|
|
54
|
|
57
|
- this.moService=imObjectInfoService;
|
55
|
+ this.moService = imObjectInfoService;
|
58
|
|
56
|
|
59
|
- this.alarmMsgComp=alarmMsgComp;
|
57
|
+ this.alarmMsgComp = alarmMsgComp;
|
60
|
}
|
58
|
}
|
61
|
|
59
|
|
62
|
public void doTask() {
|
60
|
public void doTask() {
|
|
@@ -76,6 +74,8 @@ public class QueueViewJob implements Callable { |
|
@@ -76,6 +74,8 @@ public class QueueViewJob implements Callable { |
76
|
try {
|
74
|
try {
|
77
|
oneView.setQueueView(Arrays.asList(InterVar.JSONMAPPER.readValue(respJson, QueueInfo[].class)));
|
75
|
oneView.setQueueView(Arrays.asList(InterVar.JSONMAPPER.readValue(respJson, QueueInfo[].class)));
|
78
|
|
76
|
|
|
|
77
|
+ sortQueue(oneView.getQueueView());
|
|
|
78
|
+
|
79
|
oneView.setMoId(moInfo.getMoId());
|
79
|
oneView.setMoId(moInfo.getMoId());
|
80
|
|
80
|
|
81
|
//fire alarm
|
81
|
//fire alarm
|
|
@@ -120,7 +120,7 @@ public class QueueViewJob implements Callable { |
|
@@ -120,7 +120,7 @@ public class QueueViewJob implements Callable { |
120
|
//alert
|
120
|
//alert
|
121
|
String msg = buildAlarmMsg(queueInfo);
|
121
|
String msg = buildAlarmMsg(queueInfo);
|
122
|
|
122
|
|
123
|
- alarmMsgComp.doAlarm(InterVar.ALARM_QUEUE,msg);
|
123
|
+ alarmMsgComp.doAlarm(InterVar.ALARM_QUEUE, msg);
|
124
|
|
124
|
|
125
|
//ui alert
|
125
|
//ui alert
|
126
|
InterVar.overViewMaps.get(this.moId).setState(0);
|
126
|
InterVar.overViewMaps.get(this.moId).setState(0);
|
|
@@ -175,4 +175,15 @@ public class QueueViewJob implements Callable { |
|
@@ -175,4 +175,15 @@ public class QueueViewJob implements Callable { |
175
|
|
175
|
|
176
|
return builder.toString();
|
176
|
return builder.toString();
|
177
|
}
|
177
|
}
|
|
|
178
|
+
|
|
|
179
|
+
|
|
|
180
|
+ private void sortQueue(List<QueueInfo> queuesList) {
|
|
|
181
|
+ Collections.sort(queuesList, new Comparator<QueueInfo>() {
|
|
|
182
|
+ @Override
|
|
|
183
|
+ public int compare(QueueInfo o1, QueueInfo o2) {
|
|
|
184
|
+
|
|
|
185
|
+ return o1.getMessages() > o2.getMessages() ? -1 : 1;
|
|
|
186
|
+ }
|
|
|
187
|
+ });
|
|
|
188
|
+ }
|
178
|
} |
189
|
} |