|
@@ -47,19 +47,23 @@ public class MaintenanceController {
|
|
|
String objId = "Eq1101060001f00f2ed121f9407783ac0f0a520a9616", alarmItemCode = EnumAlarmItem.EvapAbnormal.getCode();
|
|
|
String lockKey = AlarmConstants.alarmDataLockPrefix + objId + "-" + alarmItemCode;
|
|
|
for (String time : iotDataMap.keySet()) {
|
|
|
- Object isLock = redisUtil.get(lockKey);
|
|
|
- if (null == isLock) {
|
|
|
- long timeLong = System.currentTimeMillis() + (10 * 1000);
|
|
|
- lockUtil.sendDataLock(lockKey, String.valueOf(timeLong));
|
|
|
- JSONArray array = new JSONArray();
|
|
|
- if (iotDataMap.get(time)) {
|
|
|
- array.add(getTriggerData(time, objId, alarmItemCode));
|
|
|
- } else {
|
|
|
- array.add(getNormalData(time, objId, alarmItemCode));
|
|
|
+ while (true){
|
|
|
+ Object isLock = redisUtil.get(lockKey);
|
|
|
+ if (isLock == null){
|
|
|
+ break;
|
|
|
}
|
|
|
-
|
|
|
- rabbitConfig.sendMsg(array);
|
|
|
+ Thread.sleep(100);
|
|
|
}
|
|
|
+ long timeLong = System.currentTimeMillis() + (10 * 1000);
|
|
|
+ lockUtil.sendDataLock(lockKey, String.valueOf(timeLong));
|
|
|
+ JSONArray array = new JSONArray();
|
|
|
+ if (iotDataMap.get(time)) {
|
|
|
+ array.add(getTriggerData(time,objId,alarmItemCode));
|
|
|
+ } else {
|
|
|
+ array.add(getNormalData(time,objId,alarmItemCode));
|
|
|
+ }
|
|
|
+
|
|
|
+ rabbitConfig.sendMsg(array);
|
|
|
}
|
|
|
}
|
|
|
|