Browse Source

报警发数新增批量发送

shaohongbo 3 years ago
parent
commit
93ff771962

+ 3 - 2
src/main/java/com/persagy/apm/diagnose/indicatorrecord/service/impl/MonitorIndicatorRecordServiceImpl.java

@@ -20,6 +20,7 @@ import com.persagy.apm.diagnose.timerecord.service.ICalculateTimeRecordService;
 import com.persagy.apm.diagnose.utils.*;
 import com.persagy.apm.energyalarmstarter.alarmdata.service.AlarmConfigServiceImpl;
 import com.persagy.apm.energyalarmstarter.collectdata.websocket.AlarmWebSocketServer;
+import com.persagy.framework.ems.data.core.enumeration.EMSOrder;
 import com.persagy.framework.ems.data.core.enumeration.SpecialOperator;
 import com.persagy.framework.ems.data.mvc.dao.CoreDao;
 import com.persagy.framework.ems.data.pojo.hbase.MonitorIndicatorRecord;
@@ -369,7 +370,7 @@ public class MonitorIndicatorRecordServiceImpl implements IMonitorIndicatorRecor
             if (timeKeyAndRecordList == null) {
                 continue;
             }
-           Map<String, List<MonitorIndicatorRecord>> sendTimeKeyAndDataList = new HashMap<>();
+           Map<String, List<MonitorIndicatorRecord>> sendTimeKeyAndDataList = new LinkedHashMap<>();
             for (Map.Entry<String, List<MonitorIndicatorRecord>> dateListEntry : timeKeyAndRecordList.entrySet()) {
                 List<MonitorIndicatorRecord> value = dateListEntry.getValue();
                 if (CollectionUtils.isEmpty(value) || value.size() != infCodeList.size()) {
@@ -472,7 +473,7 @@ public class MonitorIndicatorRecordServiceImpl implements IMonitorIndicatorRecor
         monitorIndicatorRecord.setSpecialOperation("monitorIndicatorId", SpecialOperator.$in, infoCodes);
         monitorIndicatorRecord.setSpecialOperation("dataTime", SpecialOperator.$gt, lastSendTime);
         monitorIndicatorRecord.setSpecialOperation("dataTime", SpecialOperator.$lte, endTime);
-
+        monitorIndicatorRecord.setSort("dataTime", EMSOrder.Asc);
         return coredao.query(monitorIndicatorRecord);
     }