Commit 8de0c153 authored by 王晓倩's avatar 王晓倩

报警信息详情展示设备或管道详情

parent b651ddc3
......@@ -2,7 +2,9 @@ package com.zehong.system.domain.vo;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.zehong.common.core.domain.BaseEntity;
import com.zehong.system.domain.TDeviceInfo;
import com.zehong.system.domain.TDeviceReportData;
import com.zehong.system.domain.TPipe;
import java.math.BigDecimal;
import java.util.Date;
......@@ -33,21 +35,15 @@ public class DeviceAlarmVo extends BaseEntity
/** 设备编号 */
private String deviceCode;
/** 经度 */
private BigDecimal longitude;
/** 纬度 */
private BigDecimal latitude;
/** 坐标 */
private String coordinates;
/** 物联网编号 */
private String iotNo;
/** 设备监控数据列表(用于详情折线图) */
private List<TDeviceReportData> deviceReportDataList;
/** 设备列表(用于展示设备详情) */
private List<TDeviceInfo> deviceList;
/** 管道列表(用于展示管道详情) */
private List<TPipe> pipeList;
/** 工单id */
private String orderId;
......@@ -112,44 +108,28 @@ public class DeviceAlarmVo extends BaseEntity
this.deviceCode = deviceCode;
}
public BigDecimal getLongitude() {
return longitude;
}
public void setLongitude(BigDecimal longitude) {
this.longitude = longitude;
}
public BigDecimal getLatitude() {
return latitude;
}
public void setLatitude(BigDecimal latitude) {
this.latitude = latitude;
}
public String getCoordinates() {
return coordinates;
public List<TDeviceReportData> getDeviceReportDataList() {
return deviceReportDataList;
}
public void setCoordinates(String coordinates) {
this.coordinates = coordinates;
public void setDeviceReportDataList(List<TDeviceReportData> deviceReportDataList) {
this.deviceReportDataList = deviceReportDataList;
}
public String getIotNo() {
return iotNo;
public List<TDeviceInfo> getDeviceList() {
return deviceList;
}
public void setIotNo(String iotNo) {
this.iotNo = iotNo;
public void setDeviceList(List<TDeviceInfo> deviceList) {
this.deviceList = deviceList;
}
public List<TDeviceReportData> getDeviceReportDataList() {
return deviceReportDataList;
public List<TPipe> getPipeList() {
return pipeList;
}
public void setDeviceReportDataList(List<TDeviceReportData> deviceReportDataList) {
this.deviceReportDataList = deviceReportDataList;
public void setPipeList(List<TPipe> pipeList) {
this.pipeList = pipeList;
}
public void setOrderId(String orderId)
......@@ -218,9 +198,6 @@ public class DeviceAlarmVo extends BaseEntity
"alarmId=" + alarmId +
", deviceId=" + deviceId +
", deviceType='" + deviceType + '\'' +
", deviceName='" + deviceName + '\'' +
", deviceCode='" + deviceCode + '\'' +
", iotNo='" + iotNo + '\'' +
", orderId='" + orderId + '\'' +
", alarmType='" + alarmType + '\'' +
", alarmValue='" + alarmValue + '\'' +
......
......@@ -76,16 +76,24 @@ public class TDeviceAlarmServiceImpl implements ITDeviceAlarmService
if("0".equals(tDeviceAlarm.getDeviceType())){
TPipe pipe = tPipeMapper.selectTPipeById(tDeviceAlarm.getDeviceId());
if(pipe != null) {
deviceAlarmVo.setDeviceCode(pipe.getPipeCode());
deviceAlarmVo.setDeviceName(pipe.getPipeName());
deviceAlarmVo.setCoordinates(pipe.getCoordinates());
List<TPipe> pipeList = new ArrayList<>();
pipeList.add(pipe);
deviceAlarmVo.setPipeList(pipeList);
}
} else {
TDeviceInfo deviceInfo = tDeviceInfoMapper.selectTDeviceInfoById(tDeviceAlarm.getDeviceId());
if(deviceInfo != null){
deviceAlarmVo.setDeviceCode(deviceInfo.getDeviceCode());
deviceAlarmVo.setDeviceName(deviceInfo.getDeviceName());
deviceAlarmVo.setIotNo(deviceInfo.getIotNo());
deviceAlarmVo.setLongitude(deviceInfo.getLongitude());
deviceAlarmVo.setLatitude(deviceInfo.getLatitude());
List<TDeviceInfo> deviceList = new ArrayList<>();
deviceList.add(deviceInfo);
deviceAlarmVo.setDeviceList(deviceList);
}
// 查询当前设备开始报警时间前后一小时的数据
TDeviceReportData tDeviceReportData = new TDeviceReportData();
......@@ -136,12 +144,20 @@ public class TDeviceAlarmServiceImpl implements ITDeviceAlarmService
if (pipe != null) {
deviceAlarmVo.setDeviceCode(pipe.getPipeCode());
deviceAlarmVo.setDeviceName(pipe.getPipeName());
List<TPipe> pipeList = new ArrayList<>();
pipeList.add(pipe);
deviceAlarmVo.setPipeList(pipeList);
}
} else {
TDeviceInfo deviceInfo = tDeviceInfoMapper.selectTDeviceInfoById(alarm.getDeviceId());
if (deviceInfo != null) {
deviceAlarmVo.setDeviceCode(deviceInfo.getDeviceCode());
deviceAlarmVo.setDeviceName(deviceInfo.getDeviceName());
List<TDeviceInfo> deviceList = new ArrayList<>();
deviceList.add(deviceInfo);
deviceAlarmVo.setDeviceList(deviceList);
}
}
......
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