Commit 9191f390 authored by 耿迪迪's avatar 耿迪迪

报警记录 gengdidi

parent f6bb8fc8
...@@ -2,7 +2,10 @@ package com.zehong.web.controller.dataMonitoring; ...@@ -2,7 +2,10 @@ package com.zehong.web.controller.dataMonitoring;
import java.util.List; import java.util.List;
import com.zehong.common.core.domain.entity.SysDictData;
import com.zehong.common.utils.StringUtils;
import com.zehong.system.domain.vo.DeviceAlarmVo; import com.zehong.system.domain.vo.DeviceAlarmVo;
import com.zehong.system.service.ISysDictTypeService;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
...@@ -35,6 +38,9 @@ public class TDeviceAlarmController extends BaseController ...@@ -35,6 +38,9 @@ public class TDeviceAlarmController extends BaseController
@Autowired @Autowired
private ITDeviceAlarmService tDeviceAlarmService; private ITDeviceAlarmService tDeviceAlarmService;
@Autowired
private ISysDictTypeService iSysDictTypeService;
/** /**
* 查询报警信息列表 * 查询报警信息列表
*/ */
...@@ -46,6 +52,18 @@ public class TDeviceAlarmController extends BaseController ...@@ -46,6 +52,18 @@ public class TDeviceAlarmController extends BaseController
List<DeviceAlarmVo> list = null; List<DeviceAlarmVo> list = null;
try { try {
list = tDeviceAlarmService.selectTDeviceAlarmList(tDeviceAlarm); list = tDeviceAlarmService.selectTDeviceAlarmList(tDeviceAlarm);
List<SysDictData> sysDictDataList = iSysDictTypeService.selectDictDataByType("t_alarm_type");
for(DeviceAlarmVo deviceAlarmVo : list){
for(SysDictData sysDictData : sysDictDataList){
if(StringUtils.isNotEmpty(deviceAlarmVo.getAlarmType())){
if(deviceAlarmVo.getAlarmType().equals(sysDictData.getDictValue())){
deviceAlarmVo.setAlarmType(sysDictData.getDictLabel());
}
}
}
}
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
throw new Exception("查询报警信息列表出错"); throw new Exception("查询报警信息列表出错");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment