|
@@ -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");
|
|
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();
|
|
int latestAlarmId = recordsList.size() == 0 ? 0 : recordsList.get(0).getAlarmId();
|
|
|
|
|
|
- log.info("1号机器人,latestAlarm:" + latestAlarmId);
|
|
|
|
-
|
|
|
|
MachAlarmRecords unrecordedAlarm = new MachAlarmRecords();
|
|
MachAlarmRecords unrecordedAlarm = new MachAlarmRecords();
|
|
List<MachAlarmRecords> unrecordsList = unrecordedAlarm.find(
|
|
List<MachAlarmRecords> unrecordsList = unrecordedAlarm.find(
|
|
"SELECT * FROM (\n" +
|
|
"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" +
|
|
"and a.alarm_date = b.data_date and a.device_tag = c.device_tag) AS temp\n" +
|
|
"where temp.alarm_id > " + latestAlarmId);
|
|
"where temp.alarm_id > " + latestAlarmId);
|
|
|
|
|
|
- log.info("一号机器人,一共有多少条:" + unrecordsList.size());
|
|
|
|
-
|
|
|
|
for (MachAlarmRecords machAlarmRecords : unrecordsList) {
|
|
for (MachAlarmRecords machAlarmRecords : unrecordsList) {
|
|
|
|
|
|
machAlarmRecords.save();
|
|
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");
|
|
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();
|
|
int latestAlarmId = recordsList.size() == 0 ? 0 : recordsList.get(0).getAlarmId();
|
|
|
|
|
|
- log.info("2号机器人,latestAlarm:" + latestAlarmId);
|
|
|
|
-
|
|
|
|
MachAlarmRecords unrecordedAlarm = new MachAlarmRecords();
|
|
MachAlarmRecords unrecordedAlarm = new MachAlarmRecords();
|
|
List<MachAlarmRecords> unrecordsList = unrecordedAlarm.find(
|
|
List<MachAlarmRecords> unrecordsList = unrecordedAlarm.find(
|
|
"SELECT * FROM (\n" +
|
|
"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" +
|
|
"and a.alarm_date = b.data_date and a.device_tag = c.device_tag) AS temp\n" +
|
|
"where temp.alarm_id > " + latestAlarmId);
|
|
"where temp.alarm_id > " + latestAlarmId);
|
|
|
|
|
|
- log.info("二号机器人,一共有多少条:" + unrecordsList.size());
|
|
|
|
-
|
|
|
|
for (MachAlarmRecords machAlarmRecords : unrecordsList) {
|
|
for (MachAlarmRecords machAlarmRecords : unrecordsList) {
|
|
|
|
|
|
machAlarmRecords.save();
|
|
machAlarmRecords.save();
|
|
|
|
|
|
- log.info("二号机器人,保存成功:" + machAlarmRecords.getAlarmId());
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|