yq il y a 2 ans
Parent
commit
0d1e2f3a19

+ 5 - 3
mhfire-service/src/main/java/com/bizmatics/mhfire/service/mqtt/fire/FireStrategy.java

@@ -70,9 +70,11 @@ public class FireStrategy implements MqttStrategy {
         tbAlarm.setDeviceName(fireAlarmVO.getDeviceName());
         tbAlarm.setAlarmTime(new Date());
         if ("ALARM".equals(fireAlarmVO.getType())){
-            List<FireAlarmProperty> dp = fireAlarmVO.getAlarams().get(0).getDp();
-            if (CollectionUtils.isNotEmpty(dp)){
-                BeanMapperUtils.copy(dp.get(0),tbAlarm);
+            if (CollectionUtils.isNotEmpty(fireAlarmVO.getAlarams())){
+                List<FireAlarmProperty> dp = fireAlarmVO.getAlarams().get(0).getDp();
+                if (CollectionUtils.isNotEmpty(dp)){
+                    BeanMapperUtils.copy(dp.get(0),tbAlarm);
+                }
             }
         }else {
             tbAlarm.setAlarmContent(JsonUtils.toJson(fireAlarmVO));