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
29d969ef
Commit
29d969ef
authored
Aug 11, 2021
by
王晓倩
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
报警信息搜索
parent
b0f0ffea
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
116 additions
and
59 deletions
+116
-59
TDeviceAlarmController.java
...web/controller/dataMonitoring/TDeviceAlarmController.java
+16
-8
WorkOrderVo.java
...rc/main/java/com/zehong/system/domain/vo/WorkOrderVo.java
+3
-3
TDeviceAlarmMapper.java
...ain/java/com/zehong/system/mapper/TDeviceAlarmMapper.java
+19
-2
ITDeviceAlarmService.java
.../java/com/zehong/system/service/ITDeviceAlarmService.java
+3
-2
TDeviceAlarmServiceImpl.java
...m/zehong/system/service/impl/TDeviceAlarmServiceImpl.java
+41
-25
TDeviceAlarmMapper.xml
...m/src/main/resources/mapper/system/TDeviceAlarmMapper.xml
+33
-9
index.vue
gassafety-web/src/views/dataMonitoring/deviceAlarm/index.vue
+1
-10
No files found.
gassafety-admin/src/main/java/com/zehong/web/controller/dataMonitoring/TDeviceAlarmController.java
View file @
29d969ef
package
com
.
zehong
.
web
.
controller
.
dataMonitoring
;
import
java.util.List
;
import
com.zehong.system.domain.form.DeviceAlarmForm
;
import
com.zehong.system.domain.vo.DeviceAlarmVo
;
import
org.springframework.security.access.prepost.PreAuthorize
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.PutMapping
;
import
org.springframework.web.bind.annotation.DeleteMapping
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
com.zehong.common.annotation.Log
;
import
com.zehong.common.core.controller.BaseController
;
import
com.zehong.common.core.domain.AjaxResult
;
import
com.zehong.common.core.page.TableDataInfo
;
import
com.zehong.common.enums.BusinessType
;
import
com.zehong.system.domain.TDeviceAlarm
;
import
com.zehong.system.domain.vo.DeviceAlarmVo
;
import
com.zehong.system.service.ITDeviceAlarmService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.security.access.prepost.PreAuthorize
;
import
org.springframework.web.bind.annotation.*
;
import
java.util.List
;
/**
* 报警信息Controller
...
...
@@ -33,12 +41,12 @@ public class TDeviceAlarmController extends BaseController
*/
@PreAuthorize
(
"@ss.hasPermi('dataMonitoring:deviceAlarm:list')"
)
@GetMapping
(
"/list"
)
public
TableDataInfo
list
(
TDeviceAlarm
tDeviceAla
rm
)
throws
Exception
public
TableDataInfo
list
(
DeviceAlarmForm
deviceAlarmFo
rm
)
throws
Exception
{
startPage
();
List
<
DeviceAlarmVo
>
list
=
null
;
try
{
list
=
tDeviceAlarmService
.
selectTDeviceAlarmList
(
tDeviceAla
rm
);
list
=
tDeviceAlarmService
.
selectTDeviceAlarmList
(
deviceAlarmFo
rm
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
throw
new
Exception
(
"查询报警信息列表出错"
);
...
...
gassafety-system/src/main/java/com/zehong/system/domain/vo/WorkOrderVo.java
View file @
29d969ef
...
...
@@ -28,7 +28,7 @@ public class WorkOrderVo extends BaseEntity
private
String
orderType
;
/** 源id */
private
int
resourceId
;
private
Integer
resourceId
;
/** 工单名称 */
private
String
orderName
;
...
...
@@ -117,11 +117,11 @@ public class WorkOrderVo extends BaseEntity
return
orderType
;
}
public
int
getResourceId
()
{
public
Integer
getResourceId
()
{
return
resourceId
;
}
public
void
setResourceId
(
int
resourceId
)
{
public
void
setResourceId
(
Integer
resourceId
)
{
this
.
resourceId
=
resourceId
;
}
...
...
gassafety-system/src/main/java/com/zehong/system/mapper/TDeviceAlarmMapper.java
View file @
29d969ef
...
...
@@ -2,6 +2,7 @@ package com.zehong.system.mapper;
import
java.util.List
;
import
com.zehong.system.domain.TDeviceAlarm
;
import
com.zehong.system.domain.form.DeviceAlarmForm
;
/**
* 报警信息Mapper接口
...
...
@@ -22,10 +23,26 @@ public interface TDeviceAlarmMapper
/**
* 查询报警信息列表
*
* @param tDeviceAlarm 报警信息
* @param deviceAlarmForm 报警信息
* @return 报警信息集合
*/
public
List
<
TDeviceAlarm
>
selectTDeviceAlarmList
(
DeviceAlarmForm
deviceAlarmForm
);
/**
* 查询报警信息列表
*
* @param deviceAlarmForm 报警信息
* @return 报警信息集合
*/
public
List
<
TDeviceAlarm
>
selectTDeviceAlarmByPipeCode
(
DeviceAlarmForm
deviceAlarmForm
);
/**
* 查询报警信息列表
*
* @param deviceAlarmForm 报警信息
* @return 报警信息集合
*/
public
List
<
TDeviceAlarm
>
selectTDeviceAlarm
List
(
TDeviceAlarm
tDeviceAla
rm
);
public
List
<
TDeviceAlarm
>
selectTDeviceAlarm
ByDeviceCode
(
DeviceAlarmForm
deviceAlarmFo
rm
);
/**
* 新增报警信息
...
...
gassafety-system/src/main/java/com/zehong/system/service/ITDeviceAlarmService.java
View file @
29d969ef
...
...
@@ -2,6 +2,7 @@ package com.zehong.system.service;
import
java.util.List
;
import
com.zehong.system.domain.TDeviceAlarm
;
import
com.zehong.system.domain.form.DeviceAlarmForm
;
import
com.zehong.system.domain.vo.DeviceAlarmVo
;
/**
...
...
@@ -23,10 +24,10 @@ public interface ITDeviceAlarmService
/**
* 查询报警信息列表
*
* @param
tDeviceAla
rm 报警信息
* @param
deviceAlarmFo
rm 报警信息
* @return 报警信息集合
*/
public
List
<
DeviceAlarmVo
>
selectTDeviceAlarmList
(
TDeviceAlarm
tDeviceAla
rm
)
throws
Exception
;
public
List
<
DeviceAlarmVo
>
selectTDeviceAlarmList
(
DeviceAlarmForm
deviceAlarmFo
rm
)
throws
Exception
;
/**
* 新增报警信息
...
...
gassafety-system/src/main/java/com/zehong/system/service/impl/TDeviceAlarmServiceImpl.java
View file @
29d969ef
...
...
@@ -8,6 +8,7 @@ import com.zehong.common.utils.DateUtils;
import
com.zehong.common.utils.StringUtils
;
import
com.zehong.system.domain.TDeviceInfo
;
import
com.zehong.system.domain.TPipe
;
import
com.zehong.system.domain.form.DeviceAlarmForm
;
import
com.zehong.system.domain.vo.DeviceAlarmVo
;
import
com.zehong.system.mapper.TDeviceInfoMapper
;
import
com.zehong.system.mapper.TPipeMapper
;
...
...
@@ -69,45 +70,60 @@ public class TDeviceAlarmServiceImpl implements ITDeviceAlarmService
/**
* 查询报警信息列表
*
* @param
tDeviceAla
rm 报警信息
* @param
deviceAlarmFo
rm 报警信息
* @return 报警信息
*/
@Override
public
List
<
DeviceAlarmVo
>
selectTDeviceAlarmList
(
TDeviceAlarm
tDeviceAla
rm
)
throws
Exception
public
List
<
DeviceAlarmVo
>
selectTDeviceAlarmList
(
DeviceAlarmForm
deviceAlarmFo
rm
)
throws
Exception
{
List
<
DeviceAlarmVo
>
list
=
new
ArrayList
<>();
List
<
TDeviceAlarm
>
deviceAlarmList
=
tDeviceAlarmMapper
.
selectTDeviceAlarmList
(
tDeviceAlarm
);
List
<
TDeviceAlarm
>
deviceAlarmList
=
new
ArrayList
<>(
);
for
(
TDeviceAlarm
alarm
:
deviceAlarmList
){
DeviceAlarmVo
deviceAlarmVo
=
new
DeviceAlarmVo
();
BeanUtils
.
copyProperties
(
alarm
,
deviceAlarmVo
);
if
(
deviceAlarmForm
.
getDeviceCode
()
!=
null
){
List
<
TDeviceAlarm
>
pipeList
=
tDeviceAlarmMapper
.
selectTDeviceAlarmByPipeCode
(
deviceAlarmForm
);
List
<
TDeviceAlarm
>
deviceList
=
tDeviceAlarmMapper
.
selectTDeviceAlarmByDeviceCode
(
deviceAlarmForm
);
if
(
pipeList
.
size
()
!=
0
){
deviceAlarmList
.
addAll
(
pipeList
);
}
if
(
deviceList
.
size
()
!=
0
){
deviceAlarmList
.
addAll
(
deviceList
);
}
}
else
{
deviceAlarmList
=
tDeviceAlarmMapper
.
selectTDeviceAlarmList
(
deviceAlarmForm
);
}
if
(
"0"
.
equals
(
alarm
.
getDeviceType
())){
TPipe
pipe
=
tPipeMapper
.
selectTPipeById
(
alarm
.
getDeviceId
());
if
(
pipe
!=
null
)
{
deviceAlarmVo
.
setDeviceCode
(
pipe
.
getPipeCode
());
deviceAlarmVo
.
setDeviceName
(
pipe
.
getPipeName
());
}
}
else
{
TDeviceInfo
deviceInfo
=
tDeviceInfoMapper
.
selectTDeviceInfoById
(
alarm
.
getDeviceId
());
if
(
deviceInfo
!=
null
)
{
deviceAlarmVo
.
setDeviceCode
(
deviceInfo
.
getDeviceCode
());
deviceAlarmVo
.
setDeviceName
(
deviceInfo
.
getDeviceName
());
if
(
deviceAlarmList
.
size
()
!=
0
)
{
for
(
TDeviceAlarm
alarm
:
deviceAlarmList
)
{
DeviceAlarmVo
deviceAlarmVo
=
new
DeviceAlarmVo
();
BeanUtils
.
copyProperties
(
alarm
,
deviceAlarmVo
);
if
(
"0"
.
equals
(
alarm
.
getDeviceType
()))
{
TPipe
pipe
=
tPipeMapper
.
selectTPipeById
(
alarm
.
getDeviceId
());
if
(
pipe
!=
null
)
{
deviceAlarmVo
.
setDeviceCode
(
pipe
.
getPipeCode
());
deviceAlarmVo
.
setDeviceName
(
pipe
.
getPipeName
());
}
}
else
{
TDeviceInfo
deviceInfo
=
tDeviceInfoMapper
.
selectTDeviceInfoById
(
alarm
.
getDeviceId
());
if
(
deviceInfo
!=
null
)
{
deviceAlarmVo
.
setDeviceCode
(
deviceInfo
.
getDeviceCode
());
deviceAlarmVo
.
setDeviceName
(
deviceInfo
.
getDeviceName
());
}
}
}
List
<
SysDictData
>
sysDictDataList
=
iSysDictTypeService
.
selectDictDataByType
(
"t_alarm_type"
);
for
(
SysDictData
sysDictData
:
sysDictDataList
){
if
(
StringUtils
.
isNotEmpty
(
alarm
.
getAlarmType
())){
if
(
alarm
.
getAlarmType
().
equals
(
sysDictData
.
getDictValue
())){
deviceAlarmVo
.
setAlarmType
(
sysDictData
.
getDictLabel
());
List
<
SysDictData
>
sysDictDataList
=
iSysDictTypeService
.
selectDictDataByType
(
"t_alarm_type"
);
for
(
SysDictData
sysDictData
:
sysDictDataList
)
{
if
(
StringUtils
.
isNotEmpty
(
alarm
.
getAlarmType
()))
{
if
(
alarm
.
getAlarmType
().
equals
(
sysDictData
.
getDictValue
()))
{
deviceAlarmVo
.
setAlarmType
(
sysDictData
.
getDictLabel
());
}
}
}
list
.
add
(
deviceAlarmVo
);
}
list
.
add
(
deviceAlarmVo
);
}
return
list
;
}
...
...
gassafety-system/src/main/resources/mapper/system/TDeviceAlarmMapper.xml
View file @
29d969ef
...
...
@@ -22,21 +22,45 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
select alarm_id, device_id, device_type, order_id, alarm_type, alarm_value, start_time, end_time, deal_status, update_time, create_time from t_device_alarm
</sql>
<select
id=
"selectTDeviceAlarmList"
parameterType=
"
TDeviceAla
rm"
resultMap=
"TDeviceAlarmResult"
>
<select
id=
"selectTDeviceAlarmList"
parameterType=
"
DeviceAlarmFo
rm"
resultMap=
"TDeviceAlarmResult"
>
<include
refid=
"selectTDeviceAlarmVo"
/>
<where>
<if
test=
"deviceId != null "
>
and device_id = #{deviceId}
</if>
<if
test=
"deviceType != null "
>
and device_type = #{deviceType}
</if>
<if
test=
"orderId != null and orderId != ''"
>
and order_id = #{orderId}
</if>
<where>
<if
test=
"startTime1 != null "
>
and start_time
>
= #{startTime1}
</if>
<if
test=
"endTime1 != null "
>
and start_time
<
= #{endTime1}
</if>
<if
test=
"alarmType != null and alarmType != ''"
>
and alarm_type = #{alarmType}
</if>
<if
test=
"alarmValue != null and alarmValue != ''"
>
and alarm_value = #{alarmValue}
</if>
<if
test=
"startTime != null "
>
and start_time = #{startTime}
</if>
<if
test=
"endTime != null "
>
and end_time = #{endTime}
</if>
<if
test=
"dealStatus != null and dealStatus != ''"
>
and deal_status = #{dealStatus}
</if>
</where>
ORDER BY create_time DESC
</select>
<select
id=
"selectTDeviceAlarmByPipeCode"
parameterType=
"DeviceAlarmForm"
resultMap=
"TDeviceAlarmResult"
>
select t.alarm_id, t.device_id, t.device_type, t.order_id, t.alarm_type, t.alarm_value, t.start_time, t.end_time, t.deal_status, t.update_time, t.create_time
from t_device_alarm t
left join t_pipe p on t.device_id = p.pipe_id
<where>
<if
test=
"deviceCode != null "
>
and p.pipe_code like concat('%',#{deviceCode},'%')
</if>
<if
test=
"startTime1 != null "
>
and t.start_time
>
= #{startTime1}
</if>
<if
test=
"endTime1 != null "
>
and t.start_time
<
= #{endTime1}
</if>
<if
test=
"alarmType != null and alarmType != ''"
>
and t.alarm_type = #{alarmType}
</if>
<if
test=
"dealStatus != null and dealStatus != ''"
>
and t.deal_status = #{dealStatus}
</if>
</where>
ORDER BY create_time DESC
</select>
<select
id=
"selectTDeviceAlarmByDeviceCode"
parameterType=
"DeviceAlarmForm"
resultMap=
"TDeviceAlarmResult"
>
select t.alarm_id, t.device_id, t.device_type, t.order_id, t.alarm_type, t.alarm_value, t.start_time, t.end_time, t.deal_status, t.update_time, t.create_time
from t_device_alarm t
left join t_device_info d on t.device_id = d.device_id
<where>
<if
test=
"deviceCode != null "
>
and d.device_code like concat('%',#{deviceCode},'%')
</if>
<if
test=
"startTime1 != null "
>
and t.start_time
>
= #{startTime1}
</if>
<if
test=
"endTime1 != null "
>
and t.start_time
<
= #{endTime1}
</if>
<if
test=
"alarmType != null and alarmType != ''"
>
and t.alarm_type = #{alarmType}
</if>
<if
test=
"dealStatus != null and dealStatus != ''"
>
and t.deal_status = #{dealStatus}
</if>
</where>
ORDER BY create_time DESC
</select>
<select
id=
"selectTDeviceAlarmById"
parameterType=
"int"
resultMap=
"TDeviceAlarmResult"
>
<include
refid=
"selectTDeviceAlarmVo"
/>
where alarm_id = #{alarmId}
...
...
gassafety-web/src/views/dataMonitoring/deviceAlarm/index.vue
View file @
29d969ef
<
template
>
<div
class=
"app-container"
>
<el-form
:model=
"queryParams"
ref=
"queryForm"
:inline=
"true"
v-show=
"showSearch"
label-width=
"100"
>
<el-form
:model=
"queryParams"
ref=
"queryForm"
:inline=
"true"
v-show=
"showSearch"
label-width=
"100
px
"
>
<el-form-item
label=
"设备编号"
prop=
"deviceCode"
>
<el-input
v-model=
"queryParams.deviceCode"
...
...
@@ -10,15 +10,6 @@
@
keyup
.
enter
.
native=
"handleQuery"
/>
</el-form-item>
<el-form-item
label=
"管道编号"
prop=
"pipeCode"
>
<el-input
v-model=
"queryParams.pipeCode"
placeholder=
"请输入管道编号"
clearable
size=
"small"
@
keyup
.
enter
.
native=
"handleQuery"
/>
</el-form-item>
<el-form-item
label=
"报警类型"
prop=
"alarmType"
>
<el-select
v-model=
"queryParams.alarmType"
placeholder=
"请选择报警类型"
clearable
size=
"small"
>
<el-option
...
...
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