Commit 33fe7e4f authored by 王晓倩's avatar 王晓倩

实时数据sql修改,巡检计划详情接口

parent cd8bfa85
package com.zehong.system.domain.vo;
import com.zehong.common.annotation.Excel;
import com.zehong.common.core.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
/**
* 巡检记录对象 t_inspection_data
*
* @author zehong
* @date 2021-07-21
*/
public class InspectionDataVo extends BaseEntity
{
/** 巡检记录id */
private Integer dataId;
/** 巡检计划id */
private Integer planId;
/** 设备id */
private Integer deviceId;
/** 设备编号 */
private String deviceCode;
/** 设备名称 */
private String deviceName;
/** 设备类型(0管道,1调压阀,2阀门井,3流量计,4压力表) */
private String deviceType;
/** 处理状态(1不需处理,2已处理完成,3未处理完成) */
private String dealStatus;
/** 是否存在隐患 */
private String isHiddenDanger;
/** 备注 */
private String remarks;
public void setDataId(Integer dataId)
{
this.dataId = dataId;
}
public Integer getDataId()
{
return dataId;
}
public void setPlanId(Integer planId)
{
this.planId = planId;
}
public Integer getPlanId()
{
return planId;
}
public void setDeviceId(Integer deviceId)
{
this.deviceId = deviceId;
}
public Integer getDeviceId()
{
return deviceId;
}
public String getDeviceCode() {
return deviceCode;
}
public void setDeviceCode(String deviceCode) {
this.deviceCode = deviceCode;
}
public String getDeviceName() {
return deviceName;
}
public void setDeviceName(String deviceName) {
this.deviceName = deviceName;
}
public String getDeviceType() {
return deviceType;
}
public void setDeviceType(String deviceType) {
this.deviceType = deviceType;
}
public void setDealStatus(String dealStatus)
{
this.dealStatus = dealStatus;
}
public String getDealStatus()
{
return dealStatus;
}
public String getIsHiddenDanger() {
return isHiddenDanger;
}
public void setIsHiddenDanger(String isHiddenDanger) {
this.isHiddenDanger = isHiddenDanger;
}
public void setRemarks(String remarks)
{
this.remarks = remarks;
}
public String getRemarks()
{
return remarks;
}
}
...@@ -29,7 +29,7 @@ public class InspectionPlanVo extends BaseEntity ...@@ -29,7 +29,7 @@ public class InspectionPlanVo extends BaseEntity
private String deviceIds; private String deviceIds;
/** 设备列表 */ /** 设备列表 */
private List<TInspectionData> inspectionDataList; private List<InspectionDataVo> inspectionDataList;
/** 设备列表 */ /** 设备列表 */
private List<TDeviceInfo> deviceList; private List<TDeviceInfo> deviceList;
...@@ -95,11 +95,11 @@ public class InspectionPlanVo extends BaseEntity ...@@ -95,11 +95,11 @@ public class InspectionPlanVo extends BaseEntity
this.deviceIds = deviceIds; this.deviceIds = deviceIds;
} }
public List<TInspectionData> getInspectionDataList() { public List<InspectionDataVo> getInspectionDataList() {
return inspectionDataList; return inspectionDataList;
} }
public void setInspectionDataList(List<TInspectionData> inspectionDataList) { public void setInspectionDataList(List<InspectionDataVo> inspectionDataList) {
this.inspectionDataList = inspectionDataList; this.inspectionDataList = inspectionDataList;
} }
......
...@@ -65,6 +65,15 @@ public class TDeviceAlarmServiceImpl implements ITDeviceAlarmService ...@@ -65,6 +65,15 @@ public class TDeviceAlarmServiceImpl implements ITDeviceAlarmService
} }
} }
if (StringUtils.isNotEmpty(tDeviceAlarm.getDeviceType())) {
List<SysDictData> sysDictDataList = iSysDictTypeService.selectDictDataByType("t_trouble_device_type");
for (SysDictData sysDictData : sysDictDataList) {
if (tDeviceAlarm.getDeviceType().equals(sysDictData.getDictValue())) {
deviceAlarmVo.setDeviceType(sysDictData.getDictLabel());
}
}
}
if("0".equals(tDeviceAlarm.getDeviceType())){ if("0".equals(tDeviceAlarm.getDeviceType())){
TPipe pipe = tPipeMapper.selectTPipeById(tDeviceAlarm.getDeviceId()); TPipe pipe = tPipeMapper.selectTPipeById(tDeviceAlarm.getDeviceId());
deviceAlarmVo.setDeviceCode(pipe.getPipeCode()); deviceAlarmVo.setDeviceCode(pipe.getPipeCode());
...@@ -142,6 +151,15 @@ public class TDeviceAlarmServiceImpl implements ITDeviceAlarmService ...@@ -142,6 +151,15 @@ public class TDeviceAlarmServiceImpl implements ITDeviceAlarmService
} }
} }
if (StringUtils.isNotEmpty(alarm.getDeviceType())) {
List<SysDictData> sysDictDataList = iSysDictTypeService.selectDictDataByType("t_trouble_device_type");
for (SysDictData sysDictData : sysDictDataList) {
if (alarm.getDeviceType().equals(sysDictData.getDictValue())) {
deviceAlarmVo.setDeviceType(sysDictData.getDictLabel());
}
}
}
list.add(deviceAlarmVo); list.add(deviceAlarmVo);
} }
} }
......
...@@ -5,12 +5,16 @@ import java.util.List; ...@@ -5,12 +5,16 @@ import java.util.List;
import java.util.regex.Matcher; import java.util.regex.Matcher;
import java.util.regex.Pattern; import java.util.regex.Pattern;
import com.zehong.common.core.domain.entity.SysDictData;
import com.zehong.common.core.domain.entity.SysUser; import com.zehong.common.core.domain.entity.SysUser;
import com.zehong.common.utils.DateUtils; import com.zehong.common.utils.DateUtils;
import com.zehong.common.utils.StringUtils;
import com.zehong.system.domain.*; import com.zehong.system.domain.*;
import com.zehong.system.domain.form.InspectionPlanForm; import com.zehong.system.domain.form.InspectionPlanForm;
import com.zehong.system.domain.vo.InspectionDataVo;
import com.zehong.system.domain.vo.InspectionPlanVo; import com.zehong.system.domain.vo.InspectionPlanVo;
import com.zehong.system.mapper.*; import com.zehong.system.mapper.*;
import com.zehong.system.service.ISysDictTypeService;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -37,6 +41,8 @@ public class TInspectionPlanServiceImpl implements ITInspectionPlanService ...@@ -37,6 +41,8 @@ public class TInspectionPlanServiceImpl implements ITInspectionPlanService
private TPipeMapper tPipeMapper; private TPipeMapper tPipeMapper;
@Autowired @Autowired
private TDeviceInfoMapper tDeviceInfoMapper; private TDeviceInfoMapper tDeviceInfoMapper;
@Autowired
private ISysDictTypeService iSysDictTypeService;
/** /**
* 查询巡检计划 * 查询巡检计划
...@@ -61,31 +67,55 @@ public class TInspectionPlanServiceImpl implements ITInspectionPlanService ...@@ -61,31 +67,55 @@ public class TInspectionPlanServiceImpl implements ITInspectionPlanService
List<TDeviceInfo> deviceInfoList = new ArrayList<>(); List<TDeviceInfo> deviceInfoList = new ArrayList<>();
List<TPipe> pipeList = new ArrayList<>(); List<TPipe> pipeList = new ArrayList<>();
List<InspectionDataVo> inspectionDataList = new ArrayList<>();
TInspectionData tInspectionData = new TInspectionData(); TInspectionData tInspectionData = new TInspectionData();
tInspectionData.setPlanId(planId); tInspectionData.setPlanId(planId);
List<TInspectionData> dataList = tInspectionDataMapper.selectTInspectionDataList(tInspectionData); List<TInspectionData> dataList = tInspectionDataMapper.selectTInspectionDataList(tInspectionData);
if(dataList.size() != 0) { if(dataList.size() != 0) {
InspectionDataVo inspectionDataVo = new InspectionDataVo();
TDeviceInfo deviceInfo = null; TDeviceInfo deviceInfo = null;
TPipe pipe = null; TPipe pipe = null;
for (TInspectionData temp : dataList) { for (TInspectionData temp : dataList) {
BeanUtils.copyProperties(temp, inspectionDataVo);
if (!"0".equals(temp.getDeviceType())) { if (!"0".equals(temp.getDeviceType())) {
deviceInfo = tDeviceInfoMapper.selectTDeviceInfoById(temp.getDeviceId()); deviceInfo = tDeviceInfoMapper.selectTDeviceInfoById(temp.getDeviceId());
if (deviceInfo != null) { if (deviceInfo != null) {
deviceInfoList.add(deviceInfo); deviceInfoList.add(deviceInfo);
inspectionDataVo.setDeviceCode(deviceInfo.getDeviceCode());
inspectionDataVo.setDeviceName(deviceInfo.getDeviceName());
} }
} else { } else {
pipe = tPipeMapper.selectTPipeById(temp.getDeviceId()); pipe = tPipeMapper.selectTPipeById(temp.getDeviceId());
if (pipe != null) { if (pipe != null) {
pipeList.add(pipe); pipeList.add(pipe);
inspectionDataVo.setDeviceCode(pipe.getPipeCode());
inspectionDataVo.setDeviceName(pipe.getPipeName());
} }
} }
if (StringUtils.isNotEmpty(temp.getDeviceType())) {
List<SysDictData> sysDictDataList = iSysDictTypeService.selectDictDataByType("t_trouble_device_type");
for (SysDictData sysDictData : sysDictDataList) {
if (temp.getDeviceType().equals(sysDictData.getDictValue())) {
inspectionDataVo.setDeviceType(sysDictData.getDictLabel());
}
}
}
inspectionDataList.add(inspectionDataVo);
} }
} }
inspectionPlanVo.setPipeList(pipeList); inspectionPlanVo.setPipeList(pipeList);
inspectionPlanVo.setDeviceList(deviceInfoList); inspectionPlanVo.setDeviceList(deviceInfoList);
inspectionPlanVo.setInspectionDataList(inspectionDataList);
return inspectionPlanVo; return inspectionPlanVo;
} }
......
...@@ -71,6 +71,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -71,6 +71,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<where> <where>
<if test="deviceCode != null "> and d.device_code like concat('%',#{deviceCode},'%')</if> <if test="deviceCode != null "> and d.device_code like concat('%',#{deviceCode},'%')</if>
<if test="deviceType != null "> and d.device_type = #{deviceType}</if> <if test="deviceType != null "> and d.device_type = #{deviceType}</if>
<if test="deviceType == null "> and (d.device_type = '3' or d.device_type = '4')</if>
<if test="startReportTime != null "> and t.report_time &gt;= #{startReportTime}</if> <if test="startReportTime != null "> and t.report_time &gt;= #{startReportTime}</if>
<if test="endReportTime != null "> and t.report_time &lt;= #{endReportTime}</if> <if test="endReportTime != null "> and t.report_time &lt;= #{endReportTime}</if>
<if test="communicationStatus != null and communicationStatus != ''"> and t.communication_status = #{communicationStatus}</if> <if test="communicationStatus != null and communicationStatus != ''"> and t.communication_status = #{communicationStatus}</if>
......
...@@ -95,6 +95,7 @@ ...@@ -95,6 +95,7 @@
<!-- <el-table-column type="selection" width="55" align="center" />--> <!-- <el-table-column type="selection" width="55" align="center" />-->
<el-table-column label="设备名称" align="center" prop="deviceName" /> <el-table-column label="设备名称" align="center" prop="deviceName" />
<el-table-column label="设备编号" align="center" prop="deviceCode" /> <el-table-column label="设备编号" align="center" prop="deviceCode" />
<el-table-column label="设备类型" align="center" prop="deviceType" />
<el-table-column label="报警类型" align="center" prop="alarmType" /> <el-table-column label="报警类型" align="center" prop="alarmType" />
<el-table-column label="报警值" align="center" prop="alarmValue" /> <el-table-column label="报警值" align="center" prop="alarmValue" />
<el-table-column label="报警开始时间" align="center" prop="startTime" /> <el-table-column label="报警开始时间" align="center" prop="startTime" />
......
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