Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gassafety
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
耿迪迪
gassafety
Commits
45986835
Commit
45986835
authored
Aug 12, 2021
by
王晓倩
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
实时数据详情
parent
7550f64f
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
134 additions
and
26 deletions
+134
-26
TDeviceReportDataController.java
...ontroller/dataMonitoring/TDeviceReportDataController.java
+11
-4
DeviceReportDataVo.java
.../java/com/zehong/system/domain/vo/DeviceReportDataVo.java
+48
-0
TDeviceReportDataMapper.java
...ava/com/zehong/system/mapper/TDeviceReportDataMapper.java
+10
-2
ITDeviceReportDataService.java
.../com/zehong/system/service/ITDeviceReportDataService.java
+2
-2
TDeviceAlarmServiceImpl.java
...m/zehong/system/service/impl/TDeviceAlarmServiceImpl.java
+1
-2
TDeviceReportDataServiceImpl.java
...ong/system/service/impl/TDeviceReportDataServiceImpl.java
+27
-3
TDeviceReportDataMapper.xml
.../main/resources/mapper/system/TDeviceReportDataMapper.xml
+34
-12
index.vue
gassafety-web/src/views/dataMonitoring/deviceAlarm/index.vue
+1
-1
No files found.
gassafety-admin/src/main/java/com/zehong/web/controller/dataMonitoring/TDeviceReportDataController.java
View file @
45986835
...
...
@@ -74,13 +74,20 @@ public class TDeviceReportDataController extends BaseController
}
/**
* 获取设备监控详细信息
* 获取设备监控
数据
详细信息
*/
@PreAuthorize
(
"@ss.hasPermi('dataMonitoring:reportData:query')"
)
@GetMapping
(
value
=
"/{device
ReportData
Id}"
)
public
AjaxResult
getInfo
(
@PathVariable
(
"device
ReportDataId"
)
Long
deviceReportDataId
)
@GetMapping
(
value
=
"/{deviceId}"
)
public
AjaxResult
getInfo
(
@PathVariable
(
"device
Id"
)
int
deviceId
)
throws
Exception
{
return
AjaxResult
.
success
(
tDeviceReportDataService
.
selectTDeviceReportDataById
(
deviceReportDataId
));
DeviceReportDataVo
deviceReportDataVo
=
null
;
try
{
deviceReportDataVo
=
tDeviceReportDataService
.
selectTDeviceReportDataByDeviceId
(
deviceId
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
throw
new
Exception
(
"获取设备监控数据详细信息失败"
);
}
return
AjaxResult
.
success
(
deviceReportDataVo
);
}
/**
...
...
gassafety-system/src/main/java/com/zehong/system/domain/vo/DeviceReportDataVo.java
View file @
45986835
...
...
@@ -3,11 +3,13 @@ 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
com.zehong.system.domain.TDeviceReportData
;
import
org.apache.commons.lang3.builder.ToStringBuilder
;
import
org.apache.commons.lang3.builder.ToStringStyle
;
import
java.math.BigDecimal
;
import
java.util.Date
;
import
java.util.List
;
/**
* 设备监控对象 t_device_report_data
...
...
@@ -24,6 +26,10 @@ public class DeviceReportDataVo extends BaseEntity
@Excel
(
name
=
"设备物联网编号"
)
private
String
deviceNum
;
/** 设备id */
@Excel
(
name
=
"设备id"
)
private
Integer
deviceId
;
/** 设备编号 */
@Excel
(
name
=
"设备编号"
)
private
String
deviceCode
;
...
...
@@ -40,6 +46,15 @@ public class DeviceReportDataVo extends BaseEntity
@Excel
(
name
=
"设备型号"
)
private
String
deviceModel
;
/** 经度 */
private
BigDecimal
longitude
;
/** 纬度 */
private
BigDecimal
latitude
;
/** 设备监控数据列表(用于详情折线图) */
private
List
<
TDeviceReportData
>
deviceReportDataList
;
/** 标况累计量 */
@Excel
(
name
=
"标况累计量"
)
private
BigDecimal
standardConditionAccumulation
;
...
...
@@ -90,6 +105,7 @@ public class DeviceReportDataVo extends BaseEntity
{
return
deviceReportDataId
;
}
public
void
setDeviceNum
(
String
deviceNum
)
{
this
.
deviceNum
=
deviceNum
;
...
...
@@ -100,6 +116,14 @@ public class DeviceReportDataVo extends BaseEntity
return
deviceNum
;
}
public
Integer
getDeviceId
()
{
return
deviceId
;
}
public
void
setDeviceId
(
Integer
deviceId
)
{
this
.
deviceId
=
deviceId
;
}
public
String
getDeviceCode
()
{
return
deviceCode
;
}
...
...
@@ -132,6 +156,30 @@ public class DeviceReportDataVo extends BaseEntity
this
.
deviceModel
=
deviceModel
;
}
public
BigDecimal
getLongitude
()
{
return
longitude
;
}
public
void
setLongitude
(
BigDecimal
longitude
)
{
this
.
longitude
=
longitude
;
}
public
BigDecimal
getLatitude
()
{
return
latitude
;
}
public
void
setLatitude
(
BigDecimal
latitude
)
{
this
.
latitude
=
latitude
;
}
public
List
<
TDeviceReportData
>
getDeviceReportDataList
()
{
return
deviceReportDataList
;
}
public
void
setDeviceReportDataList
(
List
<
TDeviceReportData
>
deviceReportDataList
)
{
this
.
deviceReportDataList
=
deviceReportDataList
;
}
public
void
setStandardConditionAccumulation
(
BigDecimal
standardConditionAccumulation
)
{
this
.
standardConditionAccumulation
=
standardConditionAccumulation
;
...
...
gassafety-system/src/main/java/com/zehong/system/mapper/TDeviceReportDataMapper.java
View file @
45986835
...
...
@@ -16,10 +16,18 @@ public interface TDeviceReportDataMapper
/**
* 查询设备监控
*
* @param device
ReportDataId 设备监控ID
* @param device
Num 物联网编号
* @return 设备监控
*/
public
DeviceReportDataVo
selectTDeviceReportDataById
(
Long
deviceReportDataId
);
public
TDeviceReportData
selectTDeviceReportDataByDeviceNum
(
String
deviceNum
);
/**
* 查询设备监控列表
*
* @param deviceNum 物联网编号
* @return 设备监控集合
*/
public
List
<
TDeviceReportData
>
getTDeviceReportDataList
(
String
deviceNum
);
/**
* 查询设备监控列表
...
...
gassafety-system/src/main/java/com/zehong/system/service/ITDeviceReportDataService.java
View file @
45986835
...
...
@@ -16,10 +16,10 @@ public interface ITDeviceReportDataService
/**
* 查询设备监控
*
* @param device
ReportDataId 设备监控
ID
* @param device
Id 设备
ID
* @return 设备监控
*/
public
DeviceReportDataVo
selectTDeviceReportDataBy
Id
(
Long
deviceReportDataId
)
;
public
DeviceReportDataVo
selectTDeviceReportDataBy
DeviceId
(
int
deviceId
)
throws
Exception
;
/**
* 查询设备监控列表
...
...
gassafety-system/src/main/java/com/zehong/system/service/impl/TDeviceAlarmServiceImpl.java
View file @
45986835
...
...
@@ -50,6 +50,7 @@ public class TDeviceAlarmServiceImpl implements ITDeviceAlarmService
{
DeviceAlarmVo
deviceAlarmVo
=
new
DeviceAlarmVo
();
TDeviceAlarm
tDeviceAlarm
=
tDeviceAlarmMapper
.
selectTDeviceAlarmById
(
alarmId
);
BeanUtils
.
copyProperties
(
tDeviceAlarm
,
deviceAlarmVo
);
if
(
StringUtils
.
isNotEmpty
(
tDeviceAlarm
.
getAlarmType
()))
{
List
<
SysDictData
>
sysDictDataList
=
iSysDictTypeService
.
selectDictDataByType
(
"t_alarm_type"
);
...
...
@@ -60,8 +61,6 @@ public class TDeviceAlarmServiceImpl implements ITDeviceAlarmService
}
}
BeanUtils
.
copyProperties
(
tDeviceAlarm
,
deviceAlarmVo
);
if
(
"0"
.
equals
(
tDeviceAlarm
.
getDeviceType
())){
TPipe
pipe
=
tPipeMapper
.
selectTPipeById
(
tDeviceAlarm
.
getDeviceId
());
deviceAlarmVo
.
setDeviceCode
(
pipe
.
getPipeCode
());
...
...
gassafety-system/src/main/java/com/zehong/system/service/impl/TDeviceReportDataServiceImpl.java
View file @
45986835
...
...
@@ -2,8 +2,11 @@ package com.zehong.system.service.impl;
import
java.util.List
;
import
com.zehong.common.utils.DateUtils
;
import
com.zehong.system.domain.TDeviceInfo
;
import
com.zehong.system.domain.form.DeviceReportDataForm
;
import
com.zehong.system.domain.vo.DeviceReportDataVo
;
import
com.zehong.system.mapper.TDeviceInfoMapper
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
com.zehong.system.mapper.TDeviceReportDataMapper
;
...
...
@@ -21,17 +24,38 @@ public class TDeviceReportDataServiceImpl implements ITDeviceReportDataService
{
@Autowired
private
TDeviceReportDataMapper
tDeviceReportDataMapper
;
@Autowired
private
TDeviceInfoMapper
tDeviceInfoMapper
;
/**
* 查询设备监控
*
* @param device
ReportDataId 设备监控
ID
* @param device
Id 设备
ID
* @return 设备监控
*/
@Override
public
DeviceReportDataVo
selectTDeviceReportDataBy
Id
(
Long
deviceReportDataId
)
public
DeviceReportDataVo
selectTDeviceReportDataBy
DeviceId
(
int
deviceId
)
throws
Exception
{
return
tDeviceReportDataMapper
.
selectTDeviceReportDataById
(
deviceReportDataId
);
DeviceReportDataVo
deviceReportDataVo
=
new
DeviceReportDataVo
();
TDeviceInfo
tDeviceInfo
=
tDeviceInfoMapper
.
selectTDeviceInfoById
(
deviceId
);
TDeviceReportData
tDeviceReportData
=
tDeviceReportDataMapper
.
selectTDeviceReportDataByDeviceNum
(
tDeviceInfo
.
getIotNo
());
BeanUtils
.
copyProperties
(
tDeviceReportData
,
deviceReportDataVo
);
deviceReportDataVo
.
setDeviceId
(
tDeviceInfo
.
getDeviceId
());
deviceReportDataVo
.
setDeviceCode
(
tDeviceInfo
.
getDeviceCode
());
deviceReportDataVo
.
setDeviceName
(
tDeviceInfo
.
getDeviceName
());
deviceReportDataVo
.
setDeviceType
(
tDeviceInfo
.
getDeviceType
());
deviceReportDataVo
.
setDeviceModel
(
tDeviceInfo
.
getDeviceModel
());
deviceReportDataVo
.
setLongitude
(
tDeviceInfo
.
getLongitude
());
deviceReportDataVo
.
setLatitude
(
tDeviceInfo
.
getLatitude
());
// 查询当前设备两小时内的数据
List
<
TDeviceReportData
>
deviceReportDataList
=
tDeviceReportDataMapper
.
getTDeviceReportDataList
(
tDeviceInfo
.
getIotNo
());
if
(
deviceReportDataList
.
size
()
!=
0
)
{
deviceReportDataVo
.
setDeviceReportDataList
(
deviceReportDataList
);
}
return
deviceReportDataVo
;
}
/**
...
...
gassafety-system/src/main/resources/mapper/system/TDeviceReportDataMapper.xml
View file @
45986835
...
...
@@ -4,9 +4,27 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.zehong.system.mapper.TDeviceReportDataMapper"
>
<resultMap
type=
"
DeviceReportDataVo
"
id=
"TDeviceReportDataResult"
>
<resultMap
type=
"
TDeviceReportData
"
id=
"TDeviceReportDataResult"
>
<result
property=
"deviceReportDataId"
column=
"device_report_data_id"
/>
<result
property=
"deviceNum"
column=
"device_num"
/>
<result
property=
"standardConditionAccumulation"
column=
"standard_condition_accumulation"
/>
<result
property=
"workingConditionAccumulation"
column=
"working_condition_accumulation"
/>
<result
property=
"residualQuantity"
column=
"residual_quantity"
/>
<result
property=
"standardConditionFlow"
column=
"standard_condition_flow"
/>
<result
property=
"workingConditionFlow"
column=
"working_condition_flow"
/>
<result
property=
"temperature"
column=
"temperature"
/>
<result
property=
"pressure"
column=
"pressure"
/>
<result
property=
"reportTime"
column=
"report_time"
/>
<result
property=
"communicationStatus"
column=
"communication_status"
/>
<result
property=
"deviceStatus"
column=
"device_status"
/>
<result
property=
"createTime"
column=
"create_time"
/>
<result
property=
"updateTime"
column=
"update_time"
/>
</resultMap>
<resultMap
type=
"DeviceReportDataVo"
id=
"TDeviceReportDataResultVo"
>
<result
property=
"deviceReportDataId"
column=
"device_report_data_id"
/>
<result
property=
"deviceNum"
column=
"device_num"
/>
<result
property=
"deviceId"
column=
"device_id"
/>
<result
property=
"deviceCode"
column=
"device_code"
/>
<result
property=
"deviceType"
column=
"device_type"
/>
<result
property=
"deviceName"
column=
"device_name"
/>
...
...
@@ -30,7 +48,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
from t_device_report_data
</sql>
<select
id=
"selectTDeviceReportDataList"
parameterType=
"DeviceReportDataForm"
resultMap=
"TDeviceReportDataResult"
>
<select
id=
"selectTDeviceReportDataList"
parameterType=
"DeviceReportDataForm"
resultMap=
"TDeviceReportDataResult
Vo
"
>
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
...
...
@@ -45,11 +63,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</where>
</select>
<select
id=
"selectRealtimeDataList"
parameterType=
"DeviceReportDataForm"
resultMap=
"TDeviceReportDataResult"
>
<select
id=
"selectRealtimeDataList"
parameterType=
"DeviceReportDataForm"
resultMap=
"TDeviceReportDataResult
Vo
"
>
select max(t.report_time) 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
lef
t join t_device_info d on t.device_num = d.iot_no
righ
t 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>
...
...
@@ -58,15 +76,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if
test=
"communicationStatus != null and communicationStatus != ''"
>
and t.communication_status = #{communicationStatus}
</if>
<if
test=
"deviceStatus != null and deviceStatus != ''"
>
and t.device_status = #{deviceStatus}
</if>
</where>
group by
t.device_num
group by
d.device_id
</select>
<select
id=
"selectTDeviceReportDataById"
parameterType=
"Long"
resultMap=
"TDeviceReportDataResult"
>
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 t.device_report_data_id = #{deviceReportDataId}
<select
id=
"selectTDeviceReportDataByDeviceNum"
parameterType=
"String"
resultMap=
"TDeviceReportDataResult"
>
select max(report_time) report_time, device_report_data_id, device_num, standard_condition_accumulation, working_condition_accumulation, residual_quantity, standard_condition_flow, working_condition_flow, temperature, pressure, communication_status, device_status, create_time, update_time
from t_device_report_data
where device_num = #{deviceNum}
</select>
<select
id=
"getTDeviceReportDataList"
parameterType=
"String"
resultMap=
"TDeviceReportDataResult"
>
select report_time, device_report_data_id, device_num, standard_condition_accumulation, working_condition_accumulation, residual_quantity, standard_condition_flow, working_condition_flow, temperature, pressure, communication_status, device_status, create_time, update_time
from t_device_report_data
where device_num = #{deviceNum} and report_time
>
= DATE_SUB(NOW(),INTERVAL 2 HOUR)
</select>
<insert
id=
"insertTDeviceReportData"
parameterType=
"TDeviceReportData"
useGeneratedKeys=
"true"
keyProperty=
"deviceReportDataId"
>
...
...
gassafety-web/src/views/dataMonitoring/deviceAlarm/index.vue
View file @
45986835
...
...
@@ -26,7 +26,7 @@
ref=
"queryForm"
:inline=
"true"
v-show=
"showSearch"
label-width=
"100"
label-width=
"100
px
"
>
<el-form-item
label=
"设备编号"
prop=
"deviceCode"
>
<el-input
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment