浏览代码

监测系统监控分页修改

gao.qiang 1 年之前
父节点
当前提交
28443f7fe5
共有 1 个文件被更改,包括 9 次插入3 次删除
  1. 9 3
      business-service/src/main/java/com/ozs/service/impl/MonitorSystemServiceImpl.java

+ 9 - 3
business-service/src/main/java/com/ozs/service/impl/MonitorSystemServiceImpl.java

@@ -198,7 +198,7 @@ public class MonitorSystemServiceImpl extends ServiceImpl<MonitorSystemMapper, M
                     offlineMonitor++;
                     monitorSystem.setStatus(1);
                 } else {
-                    long timeNow = new Date().getTime();
+                    long timeNow = System.currentTimeMillis();
                     long createTime = alarmHeartbeatLog.getCreateTime().getTime();
                     long thereHourMillis = 60 * 60 * 1000 * 3;
                     long timeNew = timeNow - thereHourMillis;
@@ -237,8 +237,14 @@ public class MonitorSystemServiceImpl extends ServiceImpl<MonitorSystemMapper, M
     public List<MonitorSystem> monitorSystemPage(MonitorSystemVo monitorSystemVo) {
         List<MonitorSystem> monitorSystemList = monitorSystemMapper.monitorSystemPage(monitorSystemVo);
         for (MonitorSystem monitorSystem : monitorSystemList) {
-            if (!ObjectUtils.isEmpty(monitorSystem.getStatus())) {
-                monitorSystem.setStatusName(monitorSystem.getStatus() == 1 ? "已联通" : "未联通");
+            LambdaQueryWrapper<MonitorSystem> queryWrapper=new LambdaQueryWrapper<>();
+            queryWrapper.eq(MonitorSystem::getClientId,monitorSystem.getClientId());
+            MonitorSystem monitorSystem1 = monitorSystemMapper.selectOne(queryWrapper);
+            if (!ObjectUtils.isEmpty(monitorSystem1.getStatus())) {
+                monitorSystem.setStatusName(monitorSystem1.getStatus() == 1 ? "已联通" : "未联通");
+            }
+            if (!ObjectUtils.isEmpty(monitorSystem1.getMonitorSystemName())) {
+                monitorSystem.setMonitorSystemName(monitorSystem1.getMonitorSystemName());
             }
             QueryWrapper<MsgAlarm> wrapper = new QueryWrapper<>();
             wrapper.eq("source",monitorSystem.getClientId());