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>
......
<template> <template>
<div class="app-container"> <div class="app-container">
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px"> <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="100px">
<el-form-item label="设备id" prop="deviceNum"> <el-form-item label="设备编号" prop="deviceCode">
<el-input <el-input
v-model="queryParams.deviceNum" v-model="queryParams.deviceCode"
placeholder="请输入设备id" placeholder="请输入设备编号"
clearable clearable
size="small" size="small"
@keyup.enter.native="handleQuery" @keyup.enter.native="handleQuery"
/> />
</el-form-item> </el-form-item>
<el-form-item label="标况累计量" prop="standardConditionAccumulation"> <el-form-item label="设备类型" prop="deviceType">
<el-input <el-select v-model="queryParams.deviceType" placeholder="请选择设备类型" clearable size="small">
v-model="queryParams.standardConditionAccumulation" <el-option label="流量计" value="3" />
placeholder="请输入标况累计量" <el-option label="压力表" value="4" />
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="工况累计量" prop="workingConditionAccumulation">
<el-input
v-model="queryParams.workingConditionAccumulation"
placeholder="请输入工况累计量"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="剩余量" prop="residualQuantity">
<el-input
v-model="queryParams.residualQuantity"
placeholder="请输入剩余量"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="标况流量" prop="standardConditionFlow">
<el-input
v-model="queryParams.standardConditionFlow"
placeholder="请输入标况流量"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="工况流量" prop="workingConditionFlow">
<el-input
v-model="queryParams.workingConditionFlow"
placeholder="请输入工况流量"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="温度" prop="temperature">
<el-input
v-model="queryParams.temperature"
placeholder="请输入温度"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="压力" prop="pressure">
<el-input
v-model="queryParams.pressure"
placeholder="请输入压力"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="上报时间" prop="reportTime">
<el-date-picker clearable size="small"
v-model="queryParams.reportTime"
type="date"
value-format="yyyy-MM-dd"
placeholder="选择上报时间">
</el-date-picker>
</el-form-item>
<el-form-item label="通讯状态" prop="communicationStatus">
<el-select v-model="queryParams.communicationStatus" placeholder="请选择通讯状态" clearable size="small">
<el-option label="请选择字典生成" value="" />
</el-select>
</el-form-item>
<el-form-item label="设备状态" prop="deviceStatus">
<el-select v-model="queryParams.deviceStatus" placeholder="请选择设备状态" clearable size="small">
<el-option label="请选择字典生成" value="" />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
...@@ -97,57 +22,16 @@ ...@@ -97,57 +22,16 @@
</el-form-item> </el-form-item>
</el-form> </el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['system:data:add']"
>新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['system:data:edit']"
>修改</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['system:data:remove']"
>删除</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
:loading="exportLoading"
@click="handleExport"
v-hasPermi="['system:data:export']"
>导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="dataList" @selection-change="handleSelectionChange"> <el-table v-loading="loading" :data="dataList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" /> <el-table-column type="selection" width="55" align="center" />
<el-table-column label="设备上报id" align="center" prop="deviceReportDataId" /> <el-table-column label="设备名称" align="center" prop="deviceName" />
<el-table-column label="设备id" align="center" prop="deviceNum" /> <el-table-column label="设备编号" align="center" prop="deviceCode" />
<el-table-column label="设备类型" align="center" prop="deviceType" >
<template slot-scope="scope">
<span v-if="scope.row.deviceType == '3'">流量计</span>
<span v-if="scope.row.deviceType == '4'">压力表</span>
</template>
</el-table-column>
<el-table-column label="标况累计量" align="center" prop="standardConditionAccumulation" /> <el-table-column label="标况累计量" align="center" prop="standardConditionAccumulation" />
<el-table-column label="工况累计量" align="center" prop="workingConditionAccumulation" /> <el-table-column label="工况累计量" align="center" prop="workingConditionAccumulation" />
<el-table-column label="剩余量" align="center" prop="residualQuantity" /> <el-table-column label="剩余量" align="center" prop="residualQuantity" />
...@@ -155,29 +39,11 @@ ...@@ -155,29 +39,11 @@
<el-table-column label="工况流量" align="center" prop="workingConditionFlow" /> <el-table-column label="工况流量" align="center" prop="workingConditionFlow" />
<el-table-column label="温度" align="center" prop="temperature" /> <el-table-column label="温度" align="center" prop="temperature" />
<el-table-column label="压力" align="center" prop="pressure" /> <el-table-column label="压力" align="center" prop="pressure" />
<el-table-column label="上报时间" align="center" prop="reportTime" width="180"> <el-table-column label="上报时间" align="center" prop="reportTime" />
<template slot-scope="scope"> <el-table-column label="设备状态" align="center" prop="deviceStatus" >
<span>{{ parseTime(scope.row.reportTime, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column> </el-table-column>
<el-table-column label="通讯状态" align="center" prop="communicationStatus" />
<el-table-column label="设备状态" align="center" prop="deviceStatus" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width"> <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['system:data:edit']"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['system:data:remove']"
>删除</el-button>
<el-button <el-button
size="mini" size="mini"
type="text" type="text"
...@@ -197,65 +63,14 @@ ...@@ -197,65 +63,14 @@
@pagination="getList" @pagination="getList"
/> />
<!-- 添加或修改设备监控对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="设备id" prop="deviceNum">
<el-input v-model="form.deviceNum" placeholder="请输入设备id" />
</el-form-item>
<el-form-item label="标况累计量" prop="standardConditionAccumulation">
<el-input v-model="form.standardConditionAccumulation" placeholder="请输入标况累计量" />
</el-form-item>
<el-form-item label="工况累计量" prop="workingConditionAccumulation">
<el-input v-model="form.workingConditionAccumulation" placeholder="请输入工况累计量" />
</el-form-item>
<el-form-item label="剩余量" prop="residualQuantity">
<el-input v-model="form.residualQuantity" placeholder="请输入剩余量" />
</el-form-item>
<el-form-item label="标况流量" prop="standardConditionFlow">
<el-input v-model="form.standardConditionFlow" placeholder="请输入标况流量" />
</el-form-item>
<el-form-item label="工况流量" prop="workingConditionFlow">
<el-input v-model="form.workingConditionFlow" placeholder="请输入工况流量" />
</el-form-item>
<el-form-item label="温度" prop="temperature">
<el-input v-model="form.temperature" placeholder="请输入温度" />
</el-form-item>
<el-form-item label="压力" prop="pressure">
<el-input v-model="form.pressure" placeholder="请输入压力" />
</el-form-item>
<el-form-item label="上报时间" prop="reportTime">
<el-date-picker clearable size="small"
v-model="form.reportTime"
type="date"
value-format="yyyy-MM-dd"
placeholder="选择上报时间">
</el-date-picker>
</el-form-item>
<el-form-item label="通讯状态">
<el-radio-group v-model="form.communicationStatus">
<el-radio label="1">请选择字典生成</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="设备状态">
<el-radio-group v-model="form.deviceStatus">
<el-radio label="1">请选择字典生成</el-radio>
</el-radio-group>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div> </div>
</template> </template>
<script> <script>
import { realtimeData, getData, delData, addData, updateData, exportData } from "@/api/dataMonitoring/reportData"; import { realtimeData } from "@/api/dataMonitoring/reportData";
export default { export default {
name: "Data", name: "RealtimeData",
components: { components: {
}, },
data() { data() {
...@@ -357,42 +172,6 @@ export default { ...@@ -357,42 +172,6 @@ export default {
this.single = selection.length!==1 this.single = selection.length!==1
this.multiple = !selection.length this.multiple = !selection.length
}, },
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加设备监控";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const deviceReportDataId = row.deviceReportDataId || this.ids
getData(deviceReportDataId).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改设备监控";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.deviceReportDataId != null) {
updateData(this.form).then(response => {
this.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addData(this.form).then(response => {
this.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
//详情按钮 //详情按钮
showDetail(row) { showDetail(row) {
this.$router.push({ this.$router.push({
...@@ -402,35 +181,6 @@ export default { ...@@ -402,35 +181,6 @@ export default {
} }
}) //带参跳转 }) //带参跳转
}, },
/** 删除按钮操作 */
handleDelete(row) {
const deviceReportDataIds = row.deviceReportDataId || this.ids;
this.$confirm('是否确认删除设备监控编号为"' + deviceReportDataIds + '"的数据项?', "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(function() {
return delData(deviceReportDataIds);
}).then(() => {
this.getList();
this.msgSuccess("删除成功");
}).catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
const queryParams = this.queryParams;
this.$confirm('是否确认导出所有设备监控数据项?', "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(() => {
this.exportLoading = true;
return exportData(queryParams);
}).then(response => {
this.download(response.msg);
this.exportLoading = false;
}).catch(() => {});
}
} }
}; };
</script> </script>
<template> <template>
<div class="app-container"> <div class="app-container">
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px"> <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="100px">
<el-form-item label="设备id" prop="deviceNum"> <el-form-item label="设备编号" prop="deviceCode">
<el-input <el-input
v-model="queryParams.deviceNum" v-model="queryParams.deviceCode"
placeholder="请输入设备id" placeholder="请输入设备编号"
clearable clearable
size="small" size="small"
@keyup.enter.native="handleQuery" @keyup.enter.native="handleQuery"
/> />
</el-form-item> </el-form-item>
<el-form-item label="标况累计量" prop="standardConditionAccumulation"> <el-form-item label="设备类型" prop="deviceType">
<el-input <el-select v-model="queryParams.deviceType" placeholder="请选择设备类型" clearable size="small">
v-model="queryParams.standardConditionAccumulation" <el-option label="流量计" value="3" />
placeholder="请输入标况累计量" <el-option label="压力表" value="4" />
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="工况累计量" prop="workingConditionAccumulation">
<el-input
v-model="queryParams.workingConditionAccumulation"
placeholder="请输入工况累计量"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="剩余量" prop="residualQuantity">
<el-input
v-model="queryParams.residualQuantity"
placeholder="请输入剩余量"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="标况流量" prop="standardConditionFlow">
<el-input
v-model="queryParams.standardConditionFlow"
placeholder="请输入标况流量"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="工况流量" prop="workingConditionFlow">
<el-input
v-model="queryParams.workingConditionFlow"
placeholder="请输入工况流量"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="温度" prop="temperature">
<el-input
v-model="queryParams.temperature"
placeholder="请输入温度"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="压力" prop="pressure">
<el-input
v-model="queryParams.pressure"
placeholder="请输入压力"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="上报时间" prop="reportTime">
<el-date-picker clearable size="small"
v-model="queryParams.reportTime"
type="date"
value-format="yyyy-MM-dd"
placeholder="选择上报时间">
</el-date-picker>
</el-form-item>
<el-form-item label="通讯状态" prop="communicationStatus">
<el-select v-model="queryParams.communicationStatus" placeholder="请选择通讯状态" clearable size="small">
<el-option label="请选择字典生成" value="" />
</el-select>
</el-form-item>
<el-form-item label="设备状态" prop="deviceStatus">
<el-select v-model="queryParams.deviceStatus" placeholder="请选择设备状态" clearable size="small">
<el-option label="请选择字典生成" value="" />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
...@@ -97,57 +22,16 @@ ...@@ -97,57 +22,16 @@
</el-form-item> </el-form-item>
</el-form> </el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['system:data:add']"
>新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['system:data:edit']"
>修改</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['system:data:remove']"
>删除</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
:loading="exportLoading"
@click="handleExport"
v-hasPermi="['system:data:export']"
>导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="dataList" @selection-change="handleSelectionChange"> <el-table v-loading="loading" :data="dataList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" /> <el-table-column type="selection" width="55" align="center" />
<el-table-column label="设备上报id" align="center" prop="deviceReportDataId" /> <el-table-column label="设备名称" align="center" prop="deviceName" />
<el-table-column label="设备id" align="center" prop="deviceNum" /> <el-table-column label="设备编号" align="center" prop="deviceCode" />
<el-table-column label="设备类型" align="center" prop="deviceType" >
<template slot-scope="scope">
<span v-if="scope.row.deviceType == '3'">流量计</span>
<span v-if="scope.row.deviceType == '4'">压力表</span>
</template>
</el-table-column>
<el-table-column label="标况累计量" align="center" prop="standardConditionAccumulation" /> <el-table-column label="标况累计量" align="center" prop="standardConditionAccumulation" />
<el-table-column label="工况累计量" align="center" prop="workingConditionAccumulation" /> <el-table-column label="工况累计量" align="center" prop="workingConditionAccumulation" />
<el-table-column label="剩余量" align="center" prop="residualQuantity" /> <el-table-column label="剩余量" align="center" prop="residualQuantity" />
...@@ -155,37 +39,20 @@ ...@@ -155,37 +39,20 @@
<el-table-column label="工况流量" align="center" prop="workingConditionFlow" /> <el-table-column label="工况流量" align="center" prop="workingConditionFlow" />
<el-table-column label="温度" align="center" prop="temperature" /> <el-table-column label="温度" align="center" prop="temperature" />
<el-table-column label="压力" align="center" prop="pressure" /> <el-table-column label="压力" align="center" prop="pressure" />
<el-table-column label="上报时间" align="center" prop="reportTime" width="180"> <el-table-column label="上报时间" align="center" prop="reportTime" />
<template slot-scope="scope"> <el-table-column label="设备状态" align="center" prop="deviceStatus" >
<span>{{ parseTime(scope.row.reportTime, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column> </el-table-column>
<el-table-column label="通讯状态" align="center" prop="communicationStatus" /> <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<el-table-column label="设备状态" align="center" prop="deviceStatus" />
<!-- <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['system:data:edit']"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['system:data:remove']"
>删除</el-button>
<el-button <el-button
size="mini" size="mini"
type="text" type="text"
icon="el-icon-edit" icon="el-icon-edit"
@click="showDetail(scope.row)" @click="showDetail(scope.row)"
v-hasPermi="['system:data:export']"
>详情</el-button> >详情</el-button>
</template> </template>
</el-table-column> --> </el-table-column>
</el-table> </el-table>
<pagination <pagination
...@@ -196,65 +63,14 @@ ...@@ -196,65 +63,14 @@
@pagination="getList" @pagination="getList"
/> />
<!-- 添加或修改设备监控对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="设备id" prop="deviceNum">
<el-input v-model="form.deviceNum" placeholder="请输入设备id" />
</el-form-item>
<el-form-item label="标况累计量" prop="standardConditionAccumulation">
<el-input v-model="form.standardConditionAccumulation" placeholder="请输入标况累计量" />
</el-form-item>
<el-form-item label="工况累计量" prop="workingConditionAccumulation">
<el-input v-model="form.workingConditionAccumulation" placeholder="请输入工况累计量" />
</el-form-item>
<el-form-item label="剩余量" prop="residualQuantity">
<el-input v-model="form.residualQuantity" placeholder="请输入剩余量" />
</el-form-item>
<el-form-item label="标况流量" prop="standardConditionFlow">
<el-input v-model="form.standardConditionFlow" placeholder="请输入标况流量" />
</el-form-item>
<el-form-item label="工况流量" prop="workingConditionFlow">
<el-input v-model="form.workingConditionFlow" placeholder="请输入工况流量" />
</el-form-item>
<el-form-item label="温度" prop="temperature">
<el-input v-model="form.temperature" placeholder="请输入温度" />
</el-form-item>
<el-form-item label="压力" prop="pressure">
<el-input v-model="form.pressure" placeholder="请输入压力" />
</el-form-item>
<el-form-item label="上报时间" prop="reportTime">
<el-date-picker clearable size="small"
v-model="form.reportTime"
type="date"
value-format="yyyy-MM-dd"
placeholder="选择上报时间">
</el-date-picker>
</el-form-item>
<el-form-item label="通讯状态">
<el-radio-group v-model="form.communicationStatus">
<el-radio label="1">请选择字典生成</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="设备状态">
<el-radio-group v-model="form.deviceStatus">
<el-radio label="1">请选择字典生成</el-radio>
</el-radio-group>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div> </div>
</template> </template>
<script> <script>
import { listData, getData, delData, addData, updateData, exportData } from "@/api/dataMonitoring/reportData"; import { listData } from "@/api/dataMonitoring/reportData";
export default { export default {
name: "Data", name: "ReportData",
components: { components: {
}, },
data() { data() {
...@@ -356,22 +172,6 @@ export default { ...@@ -356,22 +172,6 @@ export default {
this.single = selection.length!==1 this.single = selection.length!==1
this.multiple = !selection.length this.multiple = !selection.length
}, },
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加设备监控";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const deviceReportDataId = row.deviceReportDataId || this.ids
getData(deviceReportDataId).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改设备监控";
});
},
/** 工单详细信息跳转 */ /** 工单详细信息跳转 */
showDetail(row) { showDetail(row) {
this.$router.push({ this.$router.push({
...@@ -381,55 +181,6 @@ export default { ...@@ -381,55 +181,6 @@ export default {
} }
}) //带参跳转 }) //带参跳转
}, },
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.deviceReportDataId != null) {
updateData(this.form).then(response => {
this.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addData(this.form).then(response => {
this.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const deviceReportDataIds = row.deviceReportDataId || this.ids;
this.$confirm('是否确认删除设备监控编号为"' + deviceReportDataIds + '"的数据项?', "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(function() {
return delData(deviceReportDataIds);
}).then(() => {
this.getList();
this.msgSuccess("删除成功");
}).catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
const queryParams = this.queryParams;
this.$confirm('是否确认导出所有设备监控数据项?', "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(() => {
this.exportLoading = true;
return exportData(queryParams);
}).then(response => {
this.download(response.msg);
this.exportLoading = false;
}).catch(() => {});
}
} }
}; };
</script> </script>
...@@ -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