Browse Source

- 报警等级翻译;

Gizmo 1 year ago
parent
commit
b832b4949d

+ 32 - 1
src/main/java/com/warewms/service/impl/HeXunDataServiceImpl.java

@@ -50,7 +50,38 @@ public class HeXunDataServiceImpl implements HeXunDataService {
             heXunAlarmData.setAddTime(machAlarmRecords.getTimestamp());
             heXunAlarmData.setVideoAddress(machAlarmRecords.getVideoUrl());
             heXunAlarmData.setAlarmType(machAlarmRecords.getDeviceType());
-            heXunAlarmData.setAlarmLevel(machAlarmRecords.getAlarmLevel());
+            switch (machAlarmRecords.getAlarmLevel()) {
+                case "3":
+                    heXunAlarmData.setAlarmLevel("三相温差报警");
+                    break;
+                case "5":
+                    heXunAlarmData.setAlarmLevel("设备识别异常报警");
+                    break;
+                case "6":
+                    heXunAlarmData.setAlarmLevel("高限报警");
+                    break;
+                case "7":
+                    heXunAlarmData.setAlarmLevel("低限报警");
+                    break;
+                case "8":
+                    heXunAlarmData.setAlarmLevel("高高限报警");
+                    break;
+                case "9":
+                    heXunAlarmData.setAlarmLevel("低低限报警");
+                    break;
+                case "10":
+                    heXunAlarmData.setAlarmLevel("高三限报警");
+                    break;
+                case "11":
+                    heXunAlarmData.setAlarmLevel("低三限报警");
+                    break;
+                case "12":
+                    heXunAlarmData.setAlarmLevel("状态报警");
+                    break;
+                case "13":
+                    heXunAlarmData.setAlarmLevel("OFF状态报警");
+                    break;
+            }
             heXunAlarmData.setAlarmContent(machAlarmRecords.getAlarmMsg());
             heXunAlarmData.setSystemType(machAlarmRecords.getSysType());
             heXunAlarmData.setDeviceCode(machAlarmRecords.getDeviceName());

+ 0 - 11
src/main/java/com/warewms/service/impl/MachAlarmRecordsServiceImpl.java

@@ -19,8 +19,6 @@ public class MachAlarmRecordsServiceImpl extends BaseServiceImpl<MachAlarmRecord
         List<MachAlarmRecords> recordsList = latestRecord.find("select * from warewms_message.mach_alarm_records where mach_no = 'x521_1' order by alarm_id desc limit 1");
         int latestAlarmId = recordsList.size() == 0 ? 0 : recordsList.get(0).getAlarmId();
 
-        log.info("1号机器人,latestAlarm:" + latestAlarmId);
-
         MachAlarmRecords unrecordedAlarm = new MachAlarmRecords();
         List<MachAlarmRecords> unrecordsList = unrecordedAlarm.find(
                 "SELECT * FROM (\n" +
@@ -61,13 +59,9 @@ public class MachAlarmRecordsServiceImpl extends BaseServiceImpl<MachAlarmRecord
                         "and a.alarm_date = b.data_date and a.device_tag = c.device_tag) AS temp\n" +
                         "where temp.alarm_id > " + latestAlarmId);
 
-        log.info("一号机器人,一共有多少条:" + unrecordsList.size());
-
         for (MachAlarmRecords machAlarmRecords : unrecordsList) {
 
             machAlarmRecords.save();
-
-            log.info("一号机器人,保存成功:" + machAlarmRecords.getAlarmId());
         }
     }
 
@@ -78,8 +72,6 @@ public class MachAlarmRecordsServiceImpl extends BaseServiceImpl<MachAlarmRecord
         List<MachAlarmRecords> recordsList = latestRecord.find("select * from warewms_message.mach_alarm_records where mach_no = 'x521_2' order by alarm_id desc limit 1");
         int latestAlarmId = recordsList.size() == 0 ? 0 : recordsList.get(0).getAlarmId();
 
-        log.info("2号机器人,latestAlarm:" + latestAlarmId);
-
         MachAlarmRecords unrecordedAlarm = new MachAlarmRecords();
         List<MachAlarmRecords> unrecordsList = unrecordedAlarm.find(
                 "SELECT * FROM (\n" +
@@ -120,13 +112,10 @@ public class MachAlarmRecordsServiceImpl extends BaseServiceImpl<MachAlarmRecord
                         "and a.alarm_date = b.data_date and a.device_tag = c.device_tag) AS temp\n" +
                         "where temp.alarm_id > " + latestAlarmId);
 
-        log.info("二号机器人,一共有多少条:" + unrecordsList.size());
-
         for (MachAlarmRecords machAlarmRecords : unrecordsList) {
 
             machAlarmRecords.save();
 
-            log.info("二号机器人,保存成功:" + machAlarmRecords.getAlarmId());
         }
     }
 }