|
@@ -83,54 +83,6 @@ public class AlarmThreadPool implements Callable<String>, Serializable {
|
|
|
values.addAll(templs);
|
|
|
}
|
|
|
|
|
|
-// StringBuilder sb = new StringBuilder();
|
|
|
-//
|
|
|
-//
|
|
|
-// List<AlarmSimpleVo> alarmls = new CopyOnWriteArrayList<>();
|
|
|
-// times = new AtomicInteger(0);
|
|
|
-// for (AlarmTag alarm : alarmVoList) {
|
|
|
-//
|
|
|
-// sb.append("'").append(alarm.getId().toLowerCase()).append("',");
|
|
|
-// times.getAndAdd(1);
|
|
|
-// if (times.get() == 1000) {
|
|
|
-// String ids = sb.substring(0, sb.length() - 1);
|
|
|
-// List<AlarmSimpleVo> templs = new CopyOnWriteArrayList<>();
|
|
|
-// if (alarm.getAlarmType().equals(AlarmTypeValue.BT.getCode())) {
|
|
|
-// templs = alarmTsService.selectLastRowByTbname(AlarmSuperTalbeType.BT.getCode(), ids);
|
|
|
-// } else if (alarm.getAlarmType().equals(AlarmTypeValue.WT.getCode())) {
|
|
|
-// templs = alarmTsService.selectLastRowByTbname(AlarmSuperTalbeType.WT.getCode(), ids);
|
|
|
-// } else if (alarm.getAlarmType().equals(AlarmTypeValue.IN.getCode())) {
|
|
|
-// templs = alarmTsService.selectLastRowByTbname(AlarmSuperTalbeType.WT.getCode(), ids);
|
|
|
-// }
|
|
|
-// alarmls.addAll(templs);
|
|
|
-// sb.setLength(0);
|
|
|
-// times.set(0);
|
|
|
-// }
|
|
|
-// }
|
|
|
-//
|
|
|
-// if (sb.length() > 0) {
|
|
|
-//
|
|
|
-// String ids = sb.substring(0, sb.length() - 1);
|
|
|
-// List<AlarmSimpleVo> templs = new CopyOnWriteArrayList<>();
|
|
|
-// if (alarmVoList.get(0).getAlarmType().equals(AlarmTypeValue.BT.getCode())) {
|
|
|
-// templs = alarmTsService.selectLastRowByTbname(AlarmSuperTalbeType.BT.getCode(), ids);
|
|
|
-// } else if (alarmVoList.get(0).getAlarmType().equals(AlarmTypeValue.WT.getCode())) {
|
|
|
-// templs = alarmTsService.selectLastRowByTbname(AlarmSuperTalbeType.WT.getCode(), ids);
|
|
|
-// } else if (alarmVoList.get(0).getAlarmType().equals(AlarmTypeValue.IN.getCode())) {
|
|
|
-// templs = alarmTsService.selectLastRowByTbname(AlarmSuperTalbeType.WT.getCode(), ids);
|
|
|
-// }
|
|
|
-// alarmls.addAll(templs);
|
|
|
-// }
|
|
|
-//
|
|
|
-// Map<String, AlarmSimpleVo> map = new HashMap<>();
|
|
|
-//
|
|
|
-//
|
|
|
-// if (!alarmls.isEmpty()) {
|
|
|
-// for (AlarmSimpleVo vo : alarmls) {
|
|
|
-// map.put(vo.getTbName().toLowerCase(), vo);
|
|
|
-// }
|
|
|
-// }
|
|
|
-
|
|
|
// System.out.println(values.size()+"____"+ alarmVoList.size());
|
|
|
int alarmNumber = 0;
|
|
|
if (values.size() == alarmVoList.size()) {
|
|
@@ -249,9 +201,19 @@ public class AlarmThreadPool implements Callable<String>, Serializable {
|
|
|
break;
|
|
|
case "bt_alarms":
|
|
|
if (!saveAlarmTags.isEmpty()) {
|
|
|
+
|
|
|
+ for(AlarmTag tag:saveAlarmTags)
|
|
|
+ {
|
|
|
+ logger.info("tagId_"+tag.getTagId()+"_wpId_"+tag.getWpId()+"_ts_"+tag.getTs()+"_val_"+tag.getVal());
|
|
|
+ }
|
|
|
+
|
|
|
alarmService.saveBtTags(saveAlarmTags);
|
|
|
}
|
|
|
if (!updateAlarmTags.isEmpty()) {
|
|
|
+ for(AlarmTag tag:updateAlarmTags)
|
|
|
+ {
|
|
|
+ logger.info("tagId_"+tag.getTagId()+"_wpId_"+tag.getWpId()+"_ts_"+tag.getTs()+"_val_"+tag.getVal());
|
|
|
+ }
|
|
|
alarmService.updateBtTags(updateAlarmTags);
|
|
|
}
|
|
|
|