lihui001 3 年 前
コミット
6df4c731ab

+ 4 - 5
zoniot-water/zoniot-water-web/src/main/java/com/bz/zoneiot/water/web/service/impl/AlarmTypeDetailsServiceImpl.java

@@ -130,16 +130,15 @@ public class AlarmTypeDetailsServiceImpl implements AlarmTypeDetailsService {
     * @return java.util.List<AlarmDetailsEntity>
     **/
     private List<AlarmDetailsEntity> convert(AlarmDetailsAddDto dto){
-        List<AlarmDetailsEntity> result;
+        BigDecimal value;
+        String deviceName;
+        String attrName = null;
         AlarmType alarmType = alarmTypeService.findByIotAlarmId(dto.getAlarmTypeId());
         if (alarmType == null) {
             log.error("【接收告警信息失败】:告警信息为空 ,请求参数:{}", dto.toString());
             return null;
         }
-        result = new ArrayList<>();
-        BigDecimal value;
-        String attrName = null;
-        String deviceName = null;
+        List<AlarmDetailsEntity> result = new ArrayList<>();
         // 离线告警
         if (alarmType.getAlarmCategory() == 2 || alarmType.getAttributeId() == null) {
             value = new BigDecimal("0");