Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
P
pingshan-ranqi
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
yaqizhang
pingshan-ranqi
Commits
ab729657
Commit
ab729657
authored
Nov 16, 2021
by
王晓倩
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
设备预警信息过滤
parent
d7c554ef
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
56 additions
and
27 deletions
+56
-27
TDetectorInfoController.java
...hong/web/controller/detector/TDetectorInfoController.java
+1
-1
TDetectorReportController.java
...ng/web/controller/detector/TDetectorReportController.java
+48
-21
TDetectorInfo.java
...src/main/java/com/zehong/system/domain/TDetectorInfo.java
+1
-1
TDetectorReportData.java
...in/java/com/zehong/system/domain/TDetectorReportData.java
+1
-0
TDetectorReportDataMapper.java
...a/com/zehong/system/mapper/TDetectorReportDataMapper.java
+1
-1
ITDetectorReportDataService.java
...om/zehong/system/service/ITDetectorReportDataService.java
+1
-1
TDetectorReportDataServiceImpl.java
...g/system/service/impl/TDetectorReportDataServiceImpl.java
+1
-1
TDetectorReportDataMapper.xml
...ain/resources/mapper/system/TDetectorReportDataMapper.xml
+2
-1
No files found.
gassafety-admin/src/main/java/com/zehong/web/controller/detector/TDetectorInfoController.java
View file @
ab729657
...
...
@@ -156,7 +156,7 @@ public class TDetectorInfoController extends BaseController
int
handledNum
=
0
;
for
(
TDetectorReportData
data
:
dataList
){
if
(!
StringUtils
.
isEmpty
(
data
.
getIsCancelAlarm
())
&&
data
.
getIsCancelAlarm
().
equals
(
"1
"
)){
if
(!
StringUtils
.
isEmpty
(
data
.
getIsCancelAlarm
())
&&
!
data
.
getIsCancelAlarm
().
equals
(
"0
"
)){
++
handledNum
;
}
}
...
...
gassafety-admin/src/main/java/com/zehong/web/controller/detector/TDetectorReportController.java
View file @
ab729657
...
...
@@ -371,22 +371,47 @@ public class TDetectorReportController extends BaseController
//报警设备类型,1探测器,2智慧用电 E+原始类型
if
(!
StringUtils
.
isEmpty
(
tDetectorReportDataForm
.
getDeviceType
())
&&
tDetectorReportDataForm
.
getDeviceType
().
equals
(
"1"
)
&&
!
StringUtils
.
isEmpty
(
tDetectorReportDataForm
.
getDeviceStatusId
())
&&
!
tDetectorReportDataForm
.
getDeviceStatusId
().
equals
(
"1"
)){
List
<
TDetectorReportData
>
reportDataList
=
tDetectorReportDataService
.
selectTDetectorReportDataByCode
(
tDetectorReportDataForm
.
getDeviceNo
());
// 有未消警的数据
if
(
reportDataList
.
size
()>
0
){
// 对比未消警数据与新推送数据的状态
if
(!
reportDataList
.
get
(
0
).
getDetectorStatusId
().
equals
(
tDetectorReportDataForm
.
getDeviceStatusId
()))
{
TDetectorReportData
temp
=
reportDataList
.
get
(
0
);
temp
.
setIsCancelAlarm
(
"1"
);
temp
.
setCancelTime
(
new
Date
());
tDetectorReportDataService
.
updateTDetectorReportData
(
temp
);
TDetectorReportData
datas
=
new
TDetectorReportData
();
datas
.
setSourceId
(
tDetectorReportDataForm
.
getSourceId
());
datas
.
setDetectorCode
(
tDetectorReportDataForm
.
getDeviceNo
());
datas
.
setDetectorStatusId
(
tDetectorReportDataForm
.
getDeviceStatusId
());
datas
.
setStatusName
(
tDetectorReportDataForm
.
getStatusName
());
datas
.
setReportValue
(
StringUtils
.
isEmpty
(
tDetectorReportDataForm
.
getReportValue
())
?
null
:
Float
.
parseFloat
(
tDetectorReportDataForm
.
getReportValue
()));
datas
.
setZhHostStatusId
(
StringUtils
.
isEmpty
(
tDetectorReportDataForm
.
getZhHostStatusId
())
?
null
:
Integer
.
parseInt
(
tDetectorReportDataForm
.
getZhHostStatusId
()));
datas
.
setSignalStrength
(
StringUtils
.
isEmpty
(
tDetectorReportDataForm
.
getSignalStrength
())
?
null
:
Integer
.
parseInt
(
tDetectorReportDataForm
.
getSignalStrength
()));
datas
.
setNetPoint
(
StringUtils
.
isEmpty
(
tDetectorReportDataForm
.
getNetPoint
())
?
null
:
Integer
.
parseInt
(
tDetectorReportDataForm
.
getNetPoint
()));
datas
.
setIpAddress
(
StringUtils
.
isEmpty
(
tDetectorReportDataForm
.
getIpAddress
())
?
null
:
tDetectorReportDataForm
.
getIpAddress
());
datas
.
setCreateTime
(
StringUtils
.
isEmpty
(
tDetectorReportDataForm
.
getCreateTime
())
?
null
:
new
Date
());
tDetectorReportDataService
.
insertTDetectorReportData
(
datas
);
}
TDetectorReportData
datas
=
new
TDetectorReportData
();
datas
.
setSourceId
(
tDetectorReportDataForm
.
getSourceId
()
);
datas
.
setDetectorCode
(
tDetectorReportDataForm
.
getDeviceNo
());
datas
.
setDetectorStatusId
(
tDetectorReportDataForm
.
getDeviceStatusId
());
datas
.
setStatusName
(
tDetectorReportDataForm
.
getStatusName
());
datas
.
setReportValue
(
StringUtils
.
isEmpty
(
tDetectorReportDataForm
.
getReportValue
())?
null
:
Float
.
parseFloat
(
tDetectorReportDataForm
.
getReportValue
()));
datas
.
setZhHostStatusId
(
StringUtils
.
isEmpty
(
tDetectorReportDataForm
.
getZhHostStatusId
())?
null
:
Integer
.
parseInt
(
tDetectorReportDataForm
.
getZhHostStatusId
()));
datas
.
setSignalStrength
(
StringUtils
.
isEmpty
(
tDetectorReportDataForm
.
getSignalStrength
())?
null
:
Integer
.
parseInt
(
tDetectorReportDataForm
.
getSignalStrength
()));
datas
.
setNetPoint
(
StringUtils
.
isEmpty
(
tDetectorReportDataForm
.
getNetPoint
())?
null
:
Integer
.
parseInt
(
tDetectorReportDataForm
.
getNetPoint
()));
datas
.
setIpAddress
(
StringUtils
.
isEmpty
(
tDetectorReportDataForm
.
getIpAddress
())?
null
:
tDetectorReportDataForm
.
getIpAddress
());
datas
.
setCreateTime
(
StringUtils
.
isEmpty
(
tDetectorReportDataForm
.
getCreateTime
())?
null
:
new
Date
());
tDetectorReportDataService
.
insertTDetectorReportData
(
datas
);
}
else
{
TDetectorReportData
datas
=
new
TDetectorReportData
(
);
datas
.
setSourceId
(
tDetectorReportDataForm
.
getSourceId
());
datas
.
setDetectorCode
(
tDetectorReportDataForm
.
getDeviceNo
());
datas
.
setDetectorStatusId
(
tDetectorReportDataForm
.
getDeviceStatusId
());
datas
.
setStatusName
(
tDetectorReportDataForm
.
getStatusName
());
datas
.
setReportValue
(
StringUtils
.
isEmpty
(
tDetectorReportDataForm
.
getReportValue
())
?
null
:
Float
.
parseFloat
(
tDetectorReportDataForm
.
getReportValue
()));
datas
.
setZhHostStatusId
(
StringUtils
.
isEmpty
(
tDetectorReportDataForm
.
getZhHostStatusId
())
?
null
:
Integer
.
parseInt
(
tDetectorReportDataForm
.
getZhHostStatusId
()));
datas
.
setSignalStrength
(
StringUtils
.
isEmpty
(
tDetectorReportDataForm
.
getSignalStrength
())
?
null
:
Integer
.
parseInt
(
tDetectorReportDataForm
.
getSignalStrength
()));
datas
.
setNetPoint
(
StringUtils
.
isEmpty
(
tDetectorReportDataForm
.
getNetPoint
())
?
null
:
Integer
.
parseInt
(
tDetectorReportDataForm
.
getNetPoint
()));
datas
.
setIpAddress
(
StringUtils
.
isEmpty
(
tDetectorReportDataForm
.
getIpAddress
())
?
null
:
tDetectorReportDataForm
.
getIpAddress
());
datas
.
setCreateTime
(
StringUtils
.
isEmpty
(
tDetectorReportDataForm
.
getCreateTime
())
?
null
:
new
Date
());
tDetectorReportDataService
.
insertTDetectorReportData
(
datas
);
}
}
// else if(!StringUtils.isEmpty(tDetectorReportDataForm.getDeviceType()) && tDetectorReportDataForm.getDeviceType().equals("2") && !StringUtils.isEmpty(tDetectorReportDataForm.getDeviceStatusId()) && !tDetectorReportDataForm.getDeviceStatusId().equals("E")){
// TDetectorReportData datas = new TDetectorReportData();
...
...
@@ -437,12 +462,14 @@ public class TDetectorReportController extends BaseController
//
// List<ZHDeviceReportDatas> dataList = zHDeviceReportDataService.selectByExample(zhDeviceReportDatasExample);
// 查询该设备最新的一条
TDetectorReportData
data
=
tDetectorReportDataService
.
selectTDetectorReportDataByCode
(
tDetectorReportDataForm
.
getDeviceNo
());
if
(
data
!=
null
){
data
.
setIsCancelAlarm
(
"1"
);
// 1自动消警
data
.
setCancelTime
(
StringUtils
.
isEmpty
(
tDetectorReportDataForm
.
getCreateTime
())?
null
:
new
Date
());
tDetectorReportDataService
.
updateTDetectorReportData
(
data
);
// 查询该设备所有未消警的数据
List
<
TDetectorReportData
>
dataList
=
tDetectorReportDataService
.
selectTDetectorReportDataByCode
(
tDetectorReportDataForm
.
getDeviceNo
());
if
(
dataList
.
size
()
>
0
){
for
(
TDetectorReportData
data
:
dataList
)
{
data
.
setIsCancelAlarm
(
"1"
);
// 1自动消警
data
.
setCancelTime
(
StringUtils
.
isEmpty
(
tDetectorReportDataForm
.
getCreateTime
())
?
null
:
new
Date
());
tDetectorReportDataService
.
updateTDetectorReportData
(
data
);
}
}
}
...
...
gassafety-system/src/main/java/com/zehong/system/domain/TDetectorInfo.java
View file @
ab729657
...
...
@@ -71,7 +71,7 @@ public class TDetectorInfo extends BaseEntity
/** 报警时间 */
private
String
alarmTime
;
/** 设备状态 */
/** 设备状态
(0正常,1离线,2报警)
*/
@Excel
(
name
=
"设备状态"
)
private
String
detectorStatus
;
...
...
gassafety-system/src/main/java/com/zehong/system/domain/TDetectorReportData.java
View file @
ab729657
...
...
@@ -26,6 +26,7 @@ public class TDetectorReportData implements Serializable {
private
Date
createTime
;
// 是否销警,默认0, 1自动销警,2手动销警
private
String
isCancelAlarm
;
private
Date
cancelTime
;
...
...
gassafety-system/src/main/java/com/zehong/system/mapper/TDetectorReportDataMapper.java
View file @
ab729657
...
...
@@ -22,7 +22,7 @@ public interface TDetectorReportDataMapper
public
TDetectorReportData
selectTDetectorReportDataById
(
Long
id
);
public
TDetectorReportData
selectTDetectorReportDataByCode
(
String
detectorCode
);
public
List
<
TDetectorReportData
>
selectTDetectorReportDataByCode
(
String
detectorCode
);
public
List
<
TDetectorReportData
>
countDetector
(
List
<
String
>
list
);
...
...
gassafety-system/src/main/java/com/zehong/system/service/ITDetectorReportDataService.java
View file @
ab729657
...
...
@@ -22,7 +22,7 @@ public interface ITDetectorReportDataService
public
TDetectorReportData
selectTDetectorReportDataById
(
Long
id
);
public
TDetectorReportData
selectTDetectorReportDataByCode
(
String
detectorCode
);
public
List
<
TDetectorReportData
>
selectTDetectorReportDataByCode
(
String
detectorCode
);
public
List
<
TDetectorReportData
>
selectRealtimeDataList
();
...
...
gassafety-system/src/main/java/com/zehong/system/service/impl/TDetectorReportDataServiceImpl.java
View file @
ab729657
...
...
@@ -35,7 +35,7 @@ public class TDetectorReportDataServiceImpl implements ITDetectorReportDataServi
}
@Override
public
TDetectorReportData
selectTDetectorReportDataByCode
(
String
detectorCode
)
public
List
<
TDetectorReportData
>
selectTDetectorReportDataByCode
(
String
detectorCode
)
{
return
tDetectorReportDataMapper
.
selectTDetectorReportDataByCode
(
detectorCode
);
}
...
...
gassafety-system/src/main/resources/mapper/system/TDetectorReportDataMapper.xml
View file @
ab729657
...
...
@@ -49,7 +49,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select
id=
"selectTDetectorReportDataByCode"
parameterType=
"String"
resultMap=
"TDetectorReportDataResult"
>
<include
refid=
"selectTDetectorReportDataVo"
/>
where detector_code = #{detectorCode}
order by create_time DESC LIMIT 1
and is_cancel_alarm = '0'
ORDER BY create_time DESC
</select>
<select
id=
"selectTDetectorAlarm"
resultType=
"TDetectorAlarmInfoVO"
>
...
...
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