Commit 47d9311a authored by 王晓倩's avatar 王晓倩

实时数据、历史数据接口调整,设备巡检详情接口调整

parent ea9efa47
package com.zehong.web.controller.dataMonitoring; package com.zehong.web.controller.dataMonitoring;
import java.util.List; import java.util.List;
import com.zehong.system.domain.form.DeviceReportDataForm;
import com.zehong.system.domain.vo.DeviceReportDataVo;
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;
...@@ -38,10 +41,10 @@ public class TDeviceReportDataController extends BaseController ...@@ -38,10 +41,10 @@ public class TDeviceReportDataController extends BaseController
*/ */
@PreAuthorize("@ss.hasPermi('dataMonitoring:reportData:list')") @PreAuthorize("@ss.hasPermi('dataMonitoring:reportData:list')")
@GetMapping("/list") @GetMapping("/list")
public TableDataInfo list(TDeviceReportData tDeviceReportData) public TableDataInfo list(DeviceReportDataForm deviceReportDataForm)
{ {
startPage(); startPage();
List<TDeviceReportData> list = tDeviceReportDataService.selectTDeviceReportDataList(tDeviceReportData); List<DeviceReportDataVo> list = tDeviceReportDataService.selectTDeviceReportDataList(deviceReportDataForm);
return getDataTable(list); return getDataTable(list);
} }
...@@ -50,10 +53,10 @@ public class TDeviceReportDataController extends BaseController ...@@ -50,10 +53,10 @@ public class TDeviceReportDataController extends BaseController
*/ */
@PreAuthorize("@ss.hasPermi('dataMonitoring:reportData:realtimeList')") @PreAuthorize("@ss.hasPermi('dataMonitoring:reportData:realtimeList')")
@GetMapping("/realtimeList") @GetMapping("/realtimeList")
public TableDataInfo realtimeList(TDeviceReportData tDeviceReportData) public TableDataInfo realtimeList(DeviceReportDataForm deviceReportDataForm)
{ {
startPage(); startPage();
List<TDeviceReportData> list = tDeviceReportDataService.selectTDeviceReportDataList(tDeviceReportData); List<DeviceReportDataVo> list = tDeviceReportDataService.selectRealtimeDataList(deviceReportDataForm);
return getDataTable(list); return getDataTable(list);
} }
...@@ -63,10 +66,10 @@ public class TDeviceReportDataController extends BaseController ...@@ -63,10 +66,10 @@ public class TDeviceReportDataController extends BaseController
@PreAuthorize("@ss.hasPermi('dataMonitoring:reportData:export')") @PreAuthorize("@ss.hasPermi('dataMonitoring:reportData:export')")
@Log(title = "设备监控", businessType = BusinessType.EXPORT) @Log(title = "设备监控", businessType = BusinessType.EXPORT)
@GetMapping("/export") @GetMapping("/export")
public AjaxResult export(TDeviceReportData tDeviceReportData) public AjaxResult export(DeviceReportDataForm deviceReportDataForm)
{ {
List<TDeviceReportData> list = tDeviceReportDataService.selectTDeviceReportDataList(tDeviceReportData); List<DeviceReportDataVo> list = tDeviceReportDataService.selectTDeviceReportDataList(deviceReportDataForm);
ExcelUtil<TDeviceReportData> util = new ExcelUtil<TDeviceReportData>(TDeviceReportData.class); ExcelUtil<DeviceReportDataVo> util = new ExcelUtil<DeviceReportDataVo>(DeviceReportDataVo.class);
return util.exportExcel(list, "设备监控数据"); return util.exportExcel(list, "设备监控数据");
} }
......
...@@ -68,7 +68,7 @@ public class TInspectionPlanController extends BaseController ...@@ -68,7 +68,7 @@ public class TInspectionPlanController extends BaseController
@GetMapping(value = "/{planId}") @GetMapping(value = "/{planId}")
public AjaxResult getInfo(@PathVariable("planId") int planId) throws Exception public AjaxResult getInfo(@PathVariable("planId") int planId) throws Exception
{ {
TInspectionPlan plan = null; InspectionPlanVo plan = null;
try { try {
plan = tInspectionPlanService.selectTInspectionPlanById(planId); plan = tInspectionPlanService.selectTInspectionPlanById(planId);
} catch (Exception e) { } catch (Exception e) {
......
...@@ -23,7 +23,7 @@ public class TDeviceReportData extends BaseEntity ...@@ -23,7 +23,7 @@ public class TDeviceReportData extends BaseEntity
/** 设备id */ /** 设备id */
@Excel(name = "设备id") @Excel(name = "设备id")
private Long deviceNum; private String deviceNum;
/** 标况累计量 */ /** 标况累计量 */
@Excel(name = "标况累计量") @Excel(name = "标况累计量")
...@@ -54,8 +54,8 @@ public class TDeviceReportData extends BaseEntity ...@@ -54,8 +54,8 @@ public class TDeviceReportData extends BaseEntity
private BigDecimal pressure; private BigDecimal pressure;
/** 上报时间 */ /** 上报时间 */
@JsonFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "上报时间", width = 30, dateFormat = "yyyy-MM-dd") @Excel(name = "上报时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date reportTime; private Date reportTime;
/** 通讯状态 */ /** 通讯状态 */
...@@ -75,12 +75,12 @@ public class TDeviceReportData extends BaseEntity ...@@ -75,12 +75,12 @@ public class TDeviceReportData extends BaseEntity
{ {
return deviceReportDataId; return deviceReportDataId;
} }
public void setDeviceNum(Long deviceNum) public void setDeviceNum(String deviceNum)
{ {
this.deviceNum = deviceNum; this.deviceNum = deviceNum;
} }
public Long getDeviceNum() public String getDeviceNum()
{ {
return deviceNum; return deviceNum;
} }
......
package com.zehong.system.domain.form;
import com.fasterxml.jackson.annotation.JsonFormat;
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;
import java.util.Date;
/**
* 报警信息对象 t_device_alarm
*
* @author zehong
* @date 2021-07-21
*/
public class DeviceAlarmForm extends BaseEntity
{
/** 设备编号 */
private String deviceCode;
/** 管道编号 */
private String pipeCode;
/** 报警类型 */
private String alarmType;
/** 报警开始时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date startTime1;
/** 报警结束时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date endTime1;
/** 处理状态(1不需处理,2已处理完成,3未处理完成) */
private String dealStatus;
public String getDeviceCode() {
return deviceCode;
}
public void setDeviceCode(String deviceCode) {
this.deviceCode = deviceCode;
}
public String getPipeCode() {
return pipeCode;
}
public void setPipeCode(String pipeCode) {
this.pipeCode = pipeCode;
}
public void setAlarmType(String alarmType)
{
this.alarmType = alarmType;
}
public String getAlarmType()
{
return alarmType;
}
public void setStartTime1(Date startTime1)
{
this.startTime1 = startTime1;
}
public Date getStartTime1()
{
return startTime1;
}
public void setEndTime1(Date endTime1)
{
this.endTime1 = endTime1;
}
public Date getEndTime1()
{
return endTime1;
}
public void setDealStatus(String dealStatus)
{
this.dealStatus = dealStatus;
}
public String getDealStatus()
{
return dealStatus;
}
}
package com.zehong.system.domain.form;
import com.fasterxml.jackson.annotation.JsonFormat;
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;
import java.math.BigDecimal;
import java.util.Date;
/**
* 设备监控对象 t_device_report_data
*
* @author zehong
* @date 2021-08-09
*/
public class DeviceReportDataForm extends BaseEntity
{
/** 设备编号 */
private String deviceCode;
/** 设备类型 */
private String deviceType;
/** 开始上报时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date startReportTime;
/** 结束上报时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date endReportTime;
/** 通讯状态 */
private String communicationStatus;
/** 设备状态 */
private String deviceStatus;
public String getDeviceCode() {
return deviceCode;
}
public void setDeviceCode(String deviceCode) {
this.deviceCode = deviceCode;
}
public String getDeviceType() {
return deviceType;
}
public void setDeviceType(String deviceType) {
this.deviceType = deviceType;
}
public Date getStartReportTime() {
return startReportTime;
}
public void setStartReportTime(Date startReportTime) {
this.startReportTime = startReportTime;
}
public Date getEndReportTime() {
return endReportTime;
}
public void setEndReportTime(Date endReportTime) {
this.endReportTime = endReportTime;
}
public void setCommunicationStatus(String communicationStatus)
{
this.communicationStatus = communicationStatus;
}
public String getCommunicationStatus()
{
return communicationStatus;
}
public void setDeviceStatus(String deviceStatus)
{
this.deviceStatus = deviceStatus;
}
public String getDeviceStatus()
{
return deviceStatus;
}
}
\ No newline at end of file
package com.zehong.system.domain.vo;
import com.fasterxml.jackson.annotation.JsonFormat;
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;
import java.math.BigDecimal;
import java.util.Date;
/**
* 设备监控对象 t_device_report_data
*
* @author zehong
* @date 2021-08-09
*/
public class DeviceReportDataVo extends BaseEntity
{
/** 设备上报id */
private Long deviceReportDataId;
/** 设备物联网编号 */
@Excel(name = "设备物联网编号")
private String deviceNum;
/** 设备编号 */
@Excel(name = "设备编号")
private String deviceCode;
/** 设备名称 */
@Excel(name = "设备名称")
private String deviceName;
/** 设备类型 */
@Excel(name = "设备类型")
private String deviceType;
/** 设备型号 */
@Excel(name = "设备型号")
private String deviceModel;
/** 标况累计量 */
@Excel(name = "标况累计量")
private BigDecimal standardConditionAccumulation;
/** 工况累计量 */
@Excel(name = "工况累计量")
private BigDecimal workingConditionAccumulation;
/** 剩余量 */
@Excel(name = "剩余量")
private BigDecimal residualQuantity;
/** 标况流量 */
@Excel(name = "标况流量")
private BigDecimal standardConditionFlow;
/** 工况流量 */
@Excel(name = "工况流量")
private BigDecimal workingConditionFlow;
/** 温度 */
@Excel(name = "温度")
private BigDecimal temperature;
/** 压力 */
@Excel(name = "压力")
private BigDecimal pressure;
/** 上报时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "上报时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date reportTime;
/** 通讯状态 */
@Excel(name = "通讯状态")
private String communicationStatus;
/** 设备状态 */
@Excel(name = "设备状态")
private String deviceStatus;
public void setDeviceReportDataId(Long deviceReportDataId)
{
this.deviceReportDataId = deviceReportDataId;
}
public Long getDeviceReportDataId()
{
return deviceReportDataId;
}
public void setDeviceNum(String deviceNum)
{
this.deviceNum = deviceNum;
}
public String getDeviceNum()
{
return deviceNum;
}
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 String getDeviceModel() {
return deviceModel;
}
public void setDeviceModel(String deviceModel) {
this.deviceModel = deviceModel;
}
public void setStandardConditionAccumulation(BigDecimal standardConditionAccumulation)
{
this.standardConditionAccumulation = standardConditionAccumulation;
}
public BigDecimal getStandardConditionAccumulation()
{
return standardConditionAccumulation;
}
public void setWorkingConditionAccumulation(BigDecimal workingConditionAccumulation)
{
this.workingConditionAccumulation = workingConditionAccumulation;
}
public BigDecimal getWorkingConditionAccumulation()
{
return workingConditionAccumulation;
}
public void setResidualQuantity(BigDecimal residualQuantity)
{
this.residualQuantity = residualQuantity;
}
public BigDecimal getResidualQuantity()
{
return residualQuantity;
}
public void setStandardConditionFlow(BigDecimal standardConditionFlow)
{
this.standardConditionFlow = standardConditionFlow;
}
public BigDecimal getStandardConditionFlow()
{
return standardConditionFlow;
}
public void setWorkingConditionFlow(BigDecimal workingConditionFlow)
{
this.workingConditionFlow = workingConditionFlow;
}
public BigDecimal getWorkingConditionFlow()
{
return workingConditionFlow;
}
public void setTemperature(BigDecimal temperature)
{
this.temperature = temperature;
}
public BigDecimal getTemperature()
{
return temperature;
}
public void setPressure(BigDecimal pressure)
{
this.pressure = pressure;
}
public BigDecimal getPressure()
{
return pressure;
}
public void setReportTime(Date reportTime)
{
this.reportTime = reportTime;
}
public Date getReportTime()
{
return reportTime;
}
public void setCommunicationStatus(String communicationStatus)
{
this.communicationStatus = communicationStatus;
}
public String getCommunicationStatus()
{
return communicationStatus;
}
public void setDeviceStatus(String deviceStatus)
{
this.deviceStatus = deviceStatus;
}
public String getDeviceStatus()
{
return deviceStatus;
}
}
...@@ -40,6 +40,13 @@ public class InspectionPlanVo extends BaseEntity ...@@ -40,6 +40,13 @@ public class InspectionPlanVo extends BaseEntity
/** 工单id */ /** 工单id */
private String orderId; private String orderId;
/** 指定执行人员姓名 */
private String appointInspectorName;
/** 下发时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date allotTime;
/** 开始时间 */ /** 开始时间 */
@JsonFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd")
private Date startTime; private Date startTime;
...@@ -122,6 +129,22 @@ public class InspectionPlanVo extends BaseEntity ...@@ -122,6 +129,22 @@ public class InspectionPlanVo extends BaseEntity
return orderId; return orderId;
} }
public String getAppointInspectorName() {
return appointInspectorName;
}
public void setAppointInspectorName(String appointInspectorName) {
this.appointInspectorName = appointInspectorName;
}
public Date getAllotTime() {
return allotTime;
}
public void setAllotTime(Date allotTime) {
this.allotTime = allotTime;
}
public void setStartTime(Date startTime) public void setStartTime(Date startTime)
{ {
this.startTime = startTime; this.startTime = startTime;
......
...@@ -2,6 +2,8 @@ package com.zehong.system.mapper; ...@@ -2,6 +2,8 @@ package com.zehong.system.mapper;
import java.util.List; import java.util.List;
import com.zehong.system.domain.TDeviceReportData; import com.zehong.system.domain.TDeviceReportData;
import com.zehong.system.domain.form.DeviceReportDataForm;
import com.zehong.system.domain.vo.DeviceReportDataVo;
/** /**
* 设备监控Mapper接口 * 设备监控Mapper接口
...@@ -17,15 +19,23 @@ public interface TDeviceReportDataMapper ...@@ -17,15 +19,23 @@ public interface TDeviceReportDataMapper
* @param deviceReportDataId 设备监控ID * @param deviceReportDataId 设备监控ID
* @return 设备监控 * @return 设备监控
*/ */
public TDeviceReportData selectTDeviceReportDataById(Long deviceReportDataId); public DeviceReportDataVo selectTDeviceReportDataById(Long deviceReportDataId);
/** /**
* 查询设备监控列表 * 查询设备监控列表
* *
* @param tDeviceReportData 设备监控 * @param deviceReportDataForm 设备监控
* @return 设备监控集合
*/
public List<DeviceReportDataVo> selectTDeviceReportDataList(DeviceReportDataForm deviceReportDataForm);
/**
* 查询设备监控实时数据
*
* @param deviceReportDataForm 设备监控
* @return 设备监控集合 * @return 设备监控集合
*/ */
public List<TDeviceReportData> selectTDeviceReportDataList(TDeviceReportData tDeviceReportData); public List<DeviceReportDataVo> selectRealtimeDataList(DeviceReportDataForm deviceReportDataForm);
/** /**
* 新增设备监控 * 新增设备监控
......
...@@ -2,6 +2,8 @@ package com.zehong.system.service; ...@@ -2,6 +2,8 @@ package com.zehong.system.service;
import java.util.List; import java.util.List;
import com.zehong.system.domain.TDeviceReportData; import com.zehong.system.domain.TDeviceReportData;
import com.zehong.system.domain.form.DeviceReportDataForm;
import com.zehong.system.domain.vo.DeviceReportDataVo;
/** /**
* 设备监控Service接口 * 设备监控Service接口
...@@ -17,15 +19,23 @@ public interface ITDeviceReportDataService ...@@ -17,15 +19,23 @@ public interface ITDeviceReportDataService
* @param deviceReportDataId 设备监控ID * @param deviceReportDataId 设备监控ID
* @return 设备监控 * @return 设备监控
*/ */
public TDeviceReportData selectTDeviceReportDataById(Long deviceReportDataId); public DeviceReportDataVo selectTDeviceReportDataById(Long deviceReportDataId);
/** /**
* 查询设备监控列表 * 查询设备监控列表
* *
* @param tDeviceReportData 设备监控 * @param deviceReportDataForm 设备监控
* @return 设备监控集合
*/
public List<DeviceReportDataVo> selectTDeviceReportDataList(DeviceReportDataForm deviceReportDataForm);
/**
* 查询设备监控实时数据
*
* @param deviceReportDataForm 设备监控
* @return 设备监控集合 * @return 设备监控集合
*/ */
public List<TDeviceReportData> selectTDeviceReportDataList(TDeviceReportData tDeviceReportData); public List<DeviceReportDataVo> selectRealtimeDataList(DeviceReportDataForm deviceReportDataForm);
/** /**
* 新增设备监控 * 新增设备监控
......
...@@ -3,6 +3,7 @@ package com.zehong.system.service; ...@@ -3,6 +3,7 @@ package com.zehong.system.service;
import java.util.List; import java.util.List;
import com.zehong.system.domain.TInspectionPlan; import com.zehong.system.domain.TInspectionPlan;
import com.zehong.system.domain.form.InspectionPlanForm; import com.zehong.system.domain.form.InspectionPlanForm;
import com.zehong.system.domain.vo.InspectionPlanVo;
/** /**
* 巡检计划Service接口 * 巡检计划Service接口
...@@ -18,7 +19,7 @@ public interface ITInspectionPlanService ...@@ -18,7 +19,7 @@ public interface ITInspectionPlanService
* @param planId 巡检计划ID * @param planId 巡检计划ID
* @return 巡检计划 * @return 巡检计划
*/ */
public TInspectionPlan selectTInspectionPlanById(int planId) throws Exception; public InspectionPlanVo selectTInspectionPlanById(int planId) throws Exception;
/** /**
* 查询巡检计划列表 * 查询巡检计划列表
......
...@@ -2,6 +2,8 @@ package com.zehong.system.service.impl; ...@@ -2,6 +2,8 @@ package com.zehong.system.service.impl;
import java.util.List; import java.util.List;
import com.zehong.common.utils.DateUtils; import com.zehong.common.utils.DateUtils;
import com.zehong.system.domain.form.DeviceReportDataForm;
import com.zehong.system.domain.vo.DeviceReportDataVo;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.zehong.system.mapper.TDeviceReportDataMapper; import com.zehong.system.mapper.TDeviceReportDataMapper;
...@@ -27,7 +29,7 @@ public class TDeviceReportDataServiceImpl implements ITDeviceReportDataService ...@@ -27,7 +29,7 @@ public class TDeviceReportDataServiceImpl implements ITDeviceReportDataService
* @return 设备监控 * @return 设备监控
*/ */
@Override @Override
public TDeviceReportData selectTDeviceReportDataById(Long deviceReportDataId) public DeviceReportDataVo selectTDeviceReportDataById(Long deviceReportDataId)
{ {
return tDeviceReportDataMapper.selectTDeviceReportDataById(deviceReportDataId); return tDeviceReportDataMapper.selectTDeviceReportDataById(deviceReportDataId);
} }
...@@ -35,13 +37,25 @@ public class TDeviceReportDataServiceImpl implements ITDeviceReportDataService ...@@ -35,13 +37,25 @@ public class TDeviceReportDataServiceImpl implements ITDeviceReportDataService
/** /**
* 查询设备监控列表 * 查询设备监控列表
* *
* @param tDeviceReportData 设备监控 * @param deviceReportDataForm 设备监控
* @return 设备监控
*/
@Override
public List<DeviceReportDataVo> selectTDeviceReportDataList(DeviceReportDataForm deviceReportDataForm)
{
return tDeviceReportDataMapper.selectTDeviceReportDataList(deviceReportDataForm);
}
/**
* 查询设备监控实时数据
*
* @param deviceReportDataForm 设备监控
* @return 设备监控 * @return 设备监控
*/ */
@Override @Override
public List<TDeviceReportData> selectTDeviceReportDataList(TDeviceReportData tDeviceReportData) public List<DeviceReportDataVo> selectRealtimeDataList(DeviceReportDataForm deviceReportDataForm)
{ {
return tDeviceReportDataMapper.selectTDeviceReportDataList(tDeviceReportData); return tDeviceReportDataMapper.selectTDeviceReportDataList(deviceReportDataForm);
} }
/** /**
......
package com.zehong.system.service.impl; package com.zehong.system.service.impl;
import java.util.ArrayList;
import java.util.List; 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.SysUser;
import com.zehong.common.utils.DateUtils; import com.zehong.common.utils.DateUtils;
import com.zehong.system.domain.TInspectionData; 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.InspectionPlanVo; import com.zehong.system.domain.vo.InspectionPlanVo;
import com.zehong.system.mapper.TInspectionDataMapper; import com.zehong.system.mapper.*;
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;
import com.zehong.system.mapper.TInspectionPlanMapper;
import com.zehong.system.domain.TInspectionPlan;
import com.zehong.system.service.ITInspectionPlanService; import com.zehong.system.service.ITInspectionPlanService;
/** /**
...@@ -28,6 +29,14 @@ public class TInspectionPlanServiceImpl implements ITInspectionPlanService ...@@ -28,6 +29,14 @@ public class TInspectionPlanServiceImpl implements ITInspectionPlanService
private TInspectionPlanMapper tInspectionPlanMapper; private TInspectionPlanMapper tInspectionPlanMapper;
@Autowired @Autowired
private TInspectionDataMapper tInspectionDataMapper; private TInspectionDataMapper tInspectionDataMapper;
@Autowired
private SysUserMapper sysUserMapper;
@Autowired
private TWorkOrderMapper tWorkOrderMapper;
@Autowired
private TPipeMapper tPipeMapper;
@Autowired
private TDeviceInfoMapper tDeviceInfoMapper;
/** /**
* 查询巡检计划 * 查询巡检计划
...@@ -36,9 +45,48 @@ public class TInspectionPlanServiceImpl implements ITInspectionPlanService ...@@ -36,9 +45,48 @@ public class TInspectionPlanServiceImpl implements ITInspectionPlanService
* @return 巡检计划 * @return 巡检计划
*/ */
@Override @Override
public TInspectionPlan selectTInspectionPlanById(int planId) throws Exception public InspectionPlanVo selectTInspectionPlanById(int planId) throws Exception
{ {
return tInspectionPlanMapper.selectTInspectionPlanById(planId); InspectionPlanVo inspectionPlanVo = new InspectionPlanVo();
TInspectionPlan tInspectionPlan = tInspectionPlanMapper.selectTInspectionPlanById(planId);
BeanUtils.copyProperties(tInspectionPlan, inspectionPlanVo);
if(tInspectionPlan.getOrderId() != null && "".equals(tInspectionPlan.getOrderId())) {
TWorkOrder tWorkOrder = tWorkOrderMapper.selectTWorkOrderById(tInspectionPlan.getOrderId());
inspectionPlanVo.setAllotTime(tWorkOrder.getAllotTime());
// 获取巡检员姓名
SysUser appointInspector = sysUserMapper.selectUserById(tWorkOrder.getAppointInspector());
inspectionPlanVo.setAppointInspectorName(appointInspector.getNickName());
}
List<TDeviceInfo> deviceInfoList = new ArrayList<>();
List<TPipe> pipeList = new ArrayList<>();
TInspectionData tInspectionData = new TInspectionData();
tInspectionData.setPlanId(planId);
List<TInspectionData> dataList = tInspectionDataMapper.selectTInspectionDataList(tInspectionData);
if(dataList.size() != 0) {
TDeviceInfo deviceInfo = null;
TPipe pipe = null;
for (TInspectionData temp : dataList) {
if (!"0".equals(temp.getDeviceType())) {
deviceInfo = tDeviceInfoMapper.selectTDeviceInfoById(temp.getDeviceId());
if (deviceInfo != null) {
deviceInfoList.add(deviceInfo);
}
} else {
pipe = tPipeMapper.selectTPipeById(temp.getDeviceId());
if (pipe != null) {
pipeList.add(pipe);
}
}
}
}
inspectionPlanVo.setPipeList(pipeList);
inspectionPlanVo.setDeviceList(deviceInfoList);
return inspectionPlanVo;
} }
/** /**
......
...@@ -4,9 +4,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -4,9 +4,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.zehong.system.mapper.TDeviceReportDataMapper"> <mapper namespace="com.zehong.system.mapper.TDeviceReportDataMapper">
<resultMap type="TDeviceReportData" id="TDeviceReportDataResult"> <resultMap type="DeviceReportDataVo" id="TDeviceReportDataResult">
<result property="deviceReportDataId" column="device_report_data_id" /> <result property="deviceReportDataId" column="device_report_data_id" />
<result property="deviceNum" column="device_num" /> <result property="deviceNum" column="device_num" />
<result property="deviceCode" column="device_code" />
<result property="deviceType" column="device_type" />
<result property="deviceName" column="device_name" />
<result property="deviceModel" column="device_model" />
<result property="standardConditionAccumulation" column="standard_condition_accumulation" /> <result property="standardConditionAccumulation" column="standard_condition_accumulation" />
<result property="workingConditionAccumulation" column="working_condition_accumulation" /> <result property="workingConditionAccumulation" column="working_condition_accumulation" />
<result property="residualQuantity" column="residual_quantity" /> <result property="residualQuantity" column="residual_quantity" />
...@@ -22,28 +26,46 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -22,28 +26,46 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap> </resultMap>
<sql id="selectTDeviceReportDataVo"> <sql id="selectTDeviceReportDataVo">
select device_report_data_id, device_num, standard_condition_accumulation, working_condition_accumulation, residual_quantity, standard_condition_flow, working_condition_flow, temperature, pressure, report_time, communication_status, device_status, create_time, update_time from t_device_report_data select device_report_data_id, device_num, standard_condition_accumulation, working_condition_accumulation, residual_quantity, standard_condition_flow, working_condition_flow, temperature, pressure, report_time, communication_status, device_status, create_time, update_time
from t_device_report_data
</sql> </sql>
<select id="selectTDeviceReportDataList" parameterType="TDeviceReportData" resultMap="TDeviceReportDataResult"> <select id="selectTDeviceReportDataList" parameterType="DeviceReportDataForm" resultMap="TDeviceReportDataResult">
<include refid="selectTDeviceReportDataVo"/> select t.report_time, t.device_report_data_id, t.device_num, t.standard_condition_accumulation, t.working_condition_accumulation, t.residual_quantity, t.standard_condition_flow, t.working_condition_flow, t.temperature, t.pressure, t.communication_status, t.device_status, t.create_time, t.update_time,
d.device_name, d.device_code, d.device_type, d.device_model
from t_device_report_data t
left join t_device_info d on t.device_num = d.iot_no
<where> <where>
<if test="deviceNum != null "> and device_num = #{deviceNum}</if> <if test="deviceCode != null "> and d.device_code like concat('%',#{deviceCode},'%')</if>
<if test="standardConditionAccumulation != null "> and standard_condition_accumulation = #{standardConditionAccumulation}</if> <if test="deviceType != null "> and d.device_type = #{deviceType}</if>
<if test="workingConditionAccumulation != null "> and working_condition_accumulation = #{workingConditionAccumulation}</if> <if test="startReportTime != null "> and report_time &gt;= #{startReportTime}</if>
<if test="residualQuantity != null "> and residual_quantity = #{residualQuantity}</if> <if test="endReportTime != null "> and report_time &lt;= #{endReportTime}</if>
<if test="standardConditionFlow != null "> and standard_condition_flow = #{standardConditionFlow}</if>
<if test="workingConditionFlow != null "> and working_condition_flow = #{workingConditionFlow}</if>
<if test="temperature != null "> and temperature = #{temperature}</if>
<if test="pressure != null "> and pressure = #{pressure}</if>
<if test="reportTime != null "> and report_time = #{reportTime}</if>
<if test="communicationStatus != null and communicationStatus != ''"> and communication_status = #{communicationStatus}</if> <if test="communicationStatus != null and communicationStatus != ''"> and communication_status = #{communicationStatus}</if>
<if test="deviceStatus != null and deviceStatus != ''"> and device_status = #{deviceStatus}</if> <if test="deviceStatus != null and deviceStatus != ''"> and device_status = #{deviceStatus}</if>
</where> </where>
</select> </select>
<select id="selectRealtimeDataList" parameterType="DeviceReportDataForm" resultMap="TDeviceReportDataResult">
select max(t.report_time), t.device_report_data_id, t.device_num, t.standard_condition_accumulation, t.working_condition_accumulation, t.residual_quantity, t.standard_condition_flow, t.working_condition_flow, t.temperature, t.pressure, t.communication_status, t.device_status, t.create_time, t.update_time,
d.device_name, d.device_code, d.device_type, d.device_model
from t_device_report_data t
left join t_device_info d on t.device_num = d.iot_no
<where>
<if test="deviceCode != null "> and d.device_code like concat('%',#{deviceCode},'%')</if>
<if test="deviceType != null "> and d.device_type = #{deviceType}</if>
<if test="startReportTime != null "> and report_time &gt;= #{startReportTime}</if>
<if test="endReportTime != null "> and report_time &lt;= #{endReportTime}</if>
<if test="communicationStatus != null and communicationStatus != ''"> and communication_status = #{communicationStatus}</if>
<if test="deviceStatus != null and deviceStatus != ''"> and device_status = #{deviceStatus}</if>
</where>
group by device_num
</select>
<select id="selectTDeviceReportDataById" parameterType="Long" resultMap="TDeviceReportDataResult"> <select id="selectTDeviceReportDataById" parameterType="Long" resultMap="TDeviceReportDataResult">
<include refid="selectTDeviceReportDataVo"/> select t.report_time, t.device_report_data_id, t.device_num, t.standard_condition_accumulation, t.working_condition_accumulation, t.residual_quantity, t.standard_condition_flow, t.working_condition_flow, t.temperature, t.pressure, t.communication_status, t.device_status, t.create_time, t.update_time,
d.device_name, d.device_code, d.device_type, d.device_model
from t_device_report_data t
left join t_device_info d on t.device_num = d.iot_no
where device_report_data_id = #{deviceReportDataId} where device_report_data_id = #{deviceReportDataId}
</select> </select>
......
...@@ -89,8 +89,8 @@ ...@@ -89,8 +89,8 @@
<el-table-column label="计划描述" align="center" prop="remarks"/> <el-table-column label="计划描述" align="center" prop="remarks"/>
<el-table-column label="状态" align="center" prop="planStatus"> <el-table-column label="状态" align="center" prop="planStatus">
<template slot-scope="scope"> <template slot-scope="scope">
<span v-if="scope.row.planStatus == 0">下发</span> <span v-if="scope.row.planStatus == 0">生成工单</span>
<span v-if="scope.row.planStatus == 1">下发</span> <span v-if="scope.row.planStatus == 1">生成工单</span>
<span v-if="scope.row.planStatus == 2">进行中</span> <span v-if="scope.row.planStatus == 2">进行中</span>
<span v-if="scope.row.planStatus == 3">已完成</span> <span v-if="scope.row.planStatus == 3">已完成</span>
</template> </template>
......
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