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
0d3ca84d
Commit
0d3ca84d
authored
Aug 10, 2021
by
耿迪迪
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
报信息接口修改 gengdidi
parent
6552ef81
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
33 deletions
+25
-33
TDeviceAlarmController.java
...web/controller/dataMonitoring/TDeviceAlarmController.java
+7
-32
TDeviceAlarmServiceImpl.java
...m/zehong/system/service/impl/TDeviceAlarmServiceImpl.java
+18
-1
No files found.
gassafety-admin/src/main/java/com/zehong/web/controller/dataMonitoring/TDeviceAlarmController.java
View file @
0d3ca84d
package
com
.
zehong
.
web
.
controller
.
dataMonitoring
;
import
java.util.List
;
import
com.zehong.common.core.domain.entity.SysDictData
;
import
com.zehong.common.utils.StringUtils
;
import
com.zehong.system.domain.vo.DeviceAlarmVo
;
import
com.zehong.system.service.ISysDictTypeService
;
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
com.zehong.common.utils.poi.ExcelUtil
;
import
com.zehong.common.core.page.TableDataInfo
;
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
...
...
@@ -38,8 +27,6 @@ public class TDeviceAlarmController extends BaseController
@Autowired
private
ITDeviceAlarmService
tDeviceAlarmService
;
@Autowired
private
ISysDictTypeService
iSysDictTypeService
;
/**
* 查询报警信息列表
...
...
@@ -52,18 +39,6 @@ public class TDeviceAlarmController extends BaseController
List
<
DeviceAlarmVo
>
list
=
null
;
try
{
list
=
tDeviceAlarmService
.
selectTDeviceAlarmList
(
tDeviceAlarm
);
List
<
SysDictData
>
sysDictDataList
=
iSysDictTypeService
.
selectDictDataByType
(
"t_alarm_type"
);
for
(
DeviceAlarmVo
deviceAlarmVo
:
list
){
for
(
SysDictData
sysDictData
:
sysDictDataList
){
if
(
StringUtils
.
isNotEmpty
(
deviceAlarmVo
.
getAlarmType
())){
if
(
deviceAlarmVo
.
getAlarmType
().
equals
(
sysDictData
.
getDictValue
())){
deviceAlarmVo
.
setAlarmType
(
sysDictData
.
getDictLabel
());
}
}
}
}
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
throw
new
Exception
(
"查询报警信息列表出错"
);
...
...
gassafety-system/src/main/java/com/zehong/system/service/impl/TDeviceAlarmServiceImpl.java
View file @
0d3ca84d
...
...
@@ -2,12 +2,16 @@ package com.zehong.system.service.impl;
import
java.util.ArrayList
;
import
java.util.List
;
import
com.zehong.common.core.domain.entity.SysDictData
;
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.vo.DeviceAlarmVo
;
import
com.zehong.system.mapper.TDeviceInfoMapper
;
import
com.zehong.system.mapper.TPipeMapper
;
import
com.zehong.system.service.ISysDictTypeService
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
...
...
@@ -31,6 +35,9 @@ public class TDeviceAlarmServiceImpl implements ITDeviceAlarmService
@Autowired
private
TPipeMapper
tPipeMapper
;
@Autowired
private
ISysDictTypeService
iSysDictTypeService
;
/**
* 查询报警信息
*
...
...
@@ -75,7 +82,7 @@ public class TDeviceAlarmServiceImpl implements ITDeviceAlarmService
DeviceAlarmVo
deviceAlarmVo
=
new
DeviceAlarmVo
();
BeanUtils
.
copyProperties
(
alarm
,
deviceAlarmVo
);
if
(
"0"
.
equals
(
tDeviceA
larm
.
getDeviceType
())){
if
(
"0"
.
equals
(
a
larm
.
getDeviceType
())){
TPipe
pipe
=
tPipeMapper
.
selectTPipeById
(
alarm
.
getDeviceId
());
if
(
pipe
!=
null
)
{
deviceAlarmVo
.
setDeviceCode
(
pipe
.
getPipeCode
());
...
...
@@ -89,6 +96,16 @@ public class TDeviceAlarmServiceImpl implements ITDeviceAlarmService
}
}
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
);
}
return
list
;
...
...
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