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
de190d1b
Commit
de190d1b
authored
Jan 04, 2022
by
王晓倩
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
地图查询报警器用户的历史报警数量逻辑修改
parent
6b5d3c51
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
26 additions
and
31 deletions
+26
-31
SysJobServiceImpl.java
...ava/com/zehong/quartz/service/impl/SysJobServiceImpl.java
+5
-5
TDetectorReportDataMapper.java
...a/com/zehong/system/mapper/TDetectorReportDataMapper.java
+2
-1
ITDetectorReportDataService.java
...om/zehong/system/service/ITDetectorReportDataService.java
+3
-1
TDetectorReportDataServiceImpl.java
...g/system/service/impl/TDetectorReportDataServiceImpl.java
+3
-2
TDetectorUserServiceImpl.java
.../zehong/system/service/impl/TDetectorUserServiceImpl.java
+8
-16
TDetectorReportDataMapper.xml
...ain/resources/mapper/system/TDetectorReportDataMapper.xml
+5
-6
No files found.
gassafety-quartz/src/main/java/com/zehong/quartz/service/impl/SysJobServiceImpl.java
View file @
de190d1b
...
@@ -38,11 +38,11 @@ public class SysJobServiceImpl implements ISysJobService
...
@@ -38,11 +38,11 @@ public class SysJobServiceImpl implements ISysJobService
public
void
init
()
throws
SchedulerException
,
TaskException
public
void
init
()
throws
SchedulerException
,
TaskException
{
{
scheduler
.
clear
();
scheduler
.
clear
();
List
<
SysJob
>
jobList
=
jobMapper
.
selectJobAll
();
//
List<SysJob> jobList = jobMapper.selectJobAll();
for
(
SysJob
job
:
jobList
)
//
for (SysJob job : jobList)
{
//
{
ScheduleUtils
.
createScheduleJob
(
scheduler
,
job
);
//
ScheduleUtils.createScheduleJob(scheduler, job);
}
//
}
}
}
/**
/**
...
...
gassafety-system/src/main/java/com/zehong/system/mapper/TDetectorReportDataMapper.java
View file @
de190d1b
...
@@ -2,6 +2,7 @@ package com.zehong.system.mapper;
...
@@ -2,6 +2,7 @@ package com.zehong.system.mapper;
import
java.util.List
;
import
java.util.List
;
import
com.zehong.system.domain.TDetectorInfo
;
import
com.zehong.system.domain.TDetectorReportData
;
import
com.zehong.system.domain.TDetectorReportData
;
import
com.zehong.system.domain.vo.TDetectorAlarmInfoVO
;
import
com.zehong.system.domain.vo.TDetectorAlarmInfoVO
;
...
@@ -24,7 +25,7 @@ public interface TDetectorReportDataMapper
...
@@ -24,7 +25,7 @@ public interface TDetectorReportDataMapper
public
List
<
TDetectorReportData
>
selectTDetectorReportDataByCode
(
String
detectorCode
);
public
List
<
TDetectorReportData
>
selectTDetectorReportDataByCode
(
String
detectorCode
);
public
List
<
TDetectorReportData
>
countDetector
(
List
<
String
>
list
);
public
List
<
TDetectorReportData
>
countDetector
ByUserId
(
TDetectorInfo
tDetectorInfo
);
public
List
<
TDetectorAlarmInfoVO
>
selectTDetectorAlarm
();
public
List
<
TDetectorAlarmInfoVO
>
selectTDetectorAlarm
();
...
...
gassafety-system/src/main/java/com/zehong/system/service/ITDetectorReportDataService.java
View file @
de190d1b
package
com
.
zehong
.
system
.
service
;
package
com
.
zehong
.
system
.
service
;
import
java.util.List
;
import
java.util.List
;
import
com.zehong.system.domain.TDetectorInfo
;
import
com.zehong.system.domain.TDetectorReportData
;
import
com.zehong.system.domain.TDetectorReportData
;
import
com.github.pagehelper.PageInfo
;
import
com.github.pagehelper.PageInfo
;
import
com.zehong.system.domain.vo.TDetectorAlarmInfoVO
;
import
com.zehong.system.domain.vo.TDetectorAlarmInfoVO
;
...
@@ -28,7 +30,7 @@ public interface ITDetectorReportDataService
...
@@ -28,7 +30,7 @@ public interface ITDetectorReportDataService
public
List
<
TDetectorAlarmInfoVO
>
selectTDetectorAlarm
();
public
List
<
TDetectorAlarmInfoVO
>
selectTDetectorAlarm
();
public
List
<
TDetectorReportData
>
countDetector
(
List
<
String
>
list
);
public
List
<
TDetectorReportData
>
countDetector
ByUserId
(
TDetectorInfo
tDetectorInfo
);
/**
/**
* 查询设备上报的数据列表
* 查询设备上报的数据列表
...
...
gassafety-system/src/main/java/com/zehong/system/service/impl/TDetectorReportDataServiceImpl.java
View file @
de190d1b
...
@@ -3,6 +3,7 @@ package com.zehong.system.service.impl;
...
@@ -3,6 +3,7 @@ package com.zehong.system.service.impl;
import
java.util.List
;
import
java.util.List
;
import
com.github.pagehelper.PageInfo
;
import
com.github.pagehelper.PageInfo
;
import
com.zehong.common.utils.DateUtils
;
import
com.zehong.common.utils.DateUtils
;
import
com.zehong.system.domain.TDetectorInfo
;
import
com.zehong.system.domain.vo.TDetectorAlarmInfoVO
;
import
com.zehong.system.domain.vo.TDetectorAlarmInfoVO
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
...
@@ -53,8 +54,8 @@ public class TDetectorReportDataServiceImpl implements ITDetectorReportDataServi
...
@@ -53,8 +54,8 @@ public class TDetectorReportDataServiceImpl implements ITDetectorReportDataServi
}
}
@Override
@Override
public
List
<
TDetectorReportData
>
countDetector
(
List
<
String
>
list
){
public
List
<
TDetectorReportData
>
countDetector
ByUserId
(
TDetectorInfo
tDetectorInfo
){
return
tDetectorReportDataMapper
.
countDetector
(
list
);
return
tDetectorReportDataMapper
.
countDetector
ByUserId
(
tDetectorInfo
);
}
}
/**
/**
...
...
gassafety-system/src/main/java/com/zehong/system/service/impl/TDetectorUserServiceImpl.java
View file @
de190d1b
...
@@ -71,26 +71,18 @@ public class TDetectorUserServiceImpl implements ITDetectorUserService
...
@@ -71,26 +71,18 @@ public class TDetectorUserServiceImpl implements ITDetectorUserService
int
cancelAlarmNum
=
0
;
int
cancelAlarmNum
=
0
;
int
historyAlarmNum
=
0
;
int
historyAlarmNum
=
0
;
List
<
String
>
strList
=
new
ArrayList
<>();
if
(
tDetectorInfoList
.
size
()
>
0
){
for
(
TDetectorInfo
info
:
tDetectorInfoList
){
for
(
TDetectorInfo
info
:
tDetectorInfoList
){
if
(!
StringUtils
.
isEmpty
(
info
.
getDetectorStatus
())
&&
info
.
getDetectorStatus
().
equals
(
"0"
)
){
if
(!
StringUtils
.
isEmpty
(
info
.
getDetectorStatus
())
&&
info
.
getDetectorStatus
().
equals
(
"0"
)){
++
onLineNum
;
++
onLineNum
;
}
else
{
}
else
{
++
offLineNum
;
++
offLineNum
;
}
}
}
strList
.
add
(
info
.
getDetectorCode
());
List
<
TDetectorReportData
>
dataList
=
tDetectorReportDataMapper
.
countDetectorByUserId
(
detector
);
}
if
(
strList
.
size
()
>
0
){
// ZHDeviceReportDatasExample zhDeviceReportDatasExample = new ZHDeviceReportDatasExample();
// zhDeviceReportDatasExample.createCriteria().andDeviceNoIn(strList);
List
<
TDetectorReportData
>
dataList
=
tDetectorReportDataMapper
.
countDetector
(
strList
);
historyAlarmNum
=
dataList
.
size
();
historyAlarmNum
=
dataList
.
size
();
// zhDeviceReportDatasExample.clear();
// zhDeviceReportDatasExample.createCriteria().andDeviceNoIn(strList).andIsCancelAlarmEqualTo("1");
for
(
TDetectorReportData
data
:
dataList
){
for
(
TDetectorReportData
data
:
dataList
){
if
(!
StringUtils
.
isEmpty
(
data
.
getIsCancelAlarm
())
&&
data
.
getIsCancelAlarm
().
equals
(
"1"
)){
if
(!
StringUtils
.
isEmpty
(
data
.
getIsCancelAlarm
())
&&
data
.
getIsCancelAlarm
().
equals
(
"1"
)){
++
cancelAlarmNum
;
++
cancelAlarmNum
;
...
...
gassafety-system/src/main/resources/mapper/system/TDetectorReportDataMapper.xml
View file @
de190d1b
...
@@ -103,12 +103,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
...
@@ -103,12 +103,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
GROUP BY data.detector_id LIMIT 50
GROUP BY data.detector_id LIMIT 50
</select>
</select>
<select
id=
"countDetector"
parameterType=
"List"
resultMap=
"TDetectorReportDataResult"
>
<select
id=
"countDetectorByUserId"
parameterType=
"TDetectorInfo"
resultMap=
"TDetectorReportDataResult"
>
<include
refid=
"selectTDetectorReportDataVo"
/>
select r.id, r.source_id, r.detector_code, r.detector_status_id, r.is_cancel_alarm, r.cancel_time
where detector_status_id != '1' and detector_code in
from t_detector_report_data r
<foreach
collection=
"list"
item=
"detectorCode"
index=
"index"
open=
"("
close=
")"
separator=
","
>
left join t_detector_info d on r.detector_code = d.detector_code
#{detectorCode}
where r.detector_status_id != '1' and d.user_id = #{userId} and d.is_del = #{isDel}
</foreach>
</select>
</select>
<insert
id=
"insertTDetectorReportData"
parameterType=
"TDetectorReportData"
useGeneratedKeys=
"true"
keyProperty=
"id"
>
<insert
id=
"insertTDetectorReportData"
parameterType=
"TDetectorReportData"
useGeneratedKeys=
"true"
keyProperty=
"id"
>
...
...
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