Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
amos-boot-biz
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
项目统一框架
amos-boot-biz
Commits
2103ab89
Commit
2103ab89
authored
Dec 14, 2023
by
zhangsen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug修改
parent
d67c2bba
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
115 additions
and
80 deletions
+115
-80
WarningRecordStatusMessage.java
...oot/module/jxiop/biz/emqx/WarningRecordStatusMessage.java
+3
-3
HealthStatusIndicatorServiceImpl.java
...op/biz/service/impl/HealthStatusIndicatorServiceImpl.java
+6
-6
IdxBizFanHealthIndexMapper.xml
...n/resources/mapper/cluster/IdxBizFanHealthIndexMapper.xml
+30
-30
IdxBizFanWarningRecordMapper.xml
...resources/mapper/cluster/IdxBizFanWarningRecordMapper.xml
+2
-2
FanHealthIndex.xml
...iz/src/main/resources/mapper/tdengine2/FanHealthIndex.xml
+7
-7
FanWarningRecord.xml
.../src/main/resources/mapper/tdengine2/FanWarningRecord.xml
+9
-9
PvWarningRecord.xml
...z/src/main/resources/mapper/tdengine2/PvWarningRecord.xml
+2
-2
PersonBasicServiceImpl.java
...module/jxiop/biz/service/impl/PersonBasicServiceImpl.java
+5
-1
PersonYardTimeTask.java
...oot/module/jxiop/biz/service/impl/PersonYardTimeTask.java
+51
-20
No files found.
amos-boot-system-jxiop/amos-boot-module-jxiop-analyse-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/emqx/WarningRecordStatusMessage.java
View file @
2103ab89
...
...
@@ -73,7 +73,7 @@ public class WarningRecordStatusMessage extends EmqxListener {
List
<
JSONObject
>
taskList
=
JSONObject
.
parseArray
(
analysisResult
.
toJSONString
(),
JSONObject
.
class
);
List
<
String
>
traceIds
=
taskList
.
stream
().
map
(
t
->
t
.
get
(
"extAttr1"
).
toString
()).
collect
(
Collectors
.
toList
());
// LambdaUpdateWrapper<IdxBizFanWarningRecord> lambda = new LambdaUpdateWrapper<>();
// lambda.set(IdxBizFanWarningRecord::getDisposotionState, "已
处置
");
// lambda.set(IdxBizFanWarningRecord::getDisposotionState, "已
确认
");
// lambda.set(IdxBizFanWarningRecord::getStatus, "1");
// lambda.set(IdxBizFanWarningRecord::getDisposotionDate, new Date());
// lambda.in(IdxBizFanWarningRecord::getSequenceNbr, traceIds);
...
...
@@ -85,7 +85,7 @@ public class WarningRecordStatusMessage extends EmqxListener {
fanWarningRecord
.
setTs
(
Long
.
valueOf
(
traceId
));
fanWarningRecord
.
setDisposotionDate
(
DateUtil
.
now
());
fanWarningRecord
.
setStatus
(
"1"
);
fanWarningRecord
.
setDisposotionState
(
"已
处置
"
);
fanWarningRecord
.
setDisposotionState
(
"已
确认
"
);
list
.
add
(
fanWarningRecord
);
}
fanWaringRecordMapper
.
updateStatusByTs
(
list
);
...
...
@@ -110,7 +110,7 @@ public class WarningRecordStatusMessage extends EmqxListener {
pvWarningRecord
.
setTs
(
Long
.
valueOf
(
traceId
));
pvWarningRecord
.
setDisposotionDate
(
DateUtil
.
now
());
pvWarningRecord
.
setStatus
(
"1"
);
pvWarningRecord
.
setDisposotionState
(
"已
处置
"
);
pvWarningRecord
.
setDisposotionState
(
"已
确认
"
);
list
.
add
(
pvWarningRecord
);
}
pvWaringRecordMapper
.
updateStatusByTs
(
list
);
...
...
amos-boot-system-jxiop/amos-boot-module-jxiop-analyse-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/service/impl/HealthStatusIndicatorServiceImpl.java
View file @
2103ab89
...
...
@@ -281,7 +281,7 @@ public class HealthStatusIndicatorServiceImpl {
idxBizPvWarningRecord
.
setIndexAddress
(
address
);
idxBizPvWarningRecord
.
setEquipmentName
(
idxBizPvHealthIndices
.
get
(
0
).
getEquipmentName
());
idxBizPvWarningRecord
.
setAnalysisPointId
(
idxBizPvHealthIndices
.
get
(
0
).
getAnalysisObjSeq
());
idxBizPvWarningRecord
.
setDisposotionState
(
"
未处置
"
);
idxBizPvWarningRecord
.
setDisposotionState
(
"
待确认
"
);
idxBizPvWarningRecord
.
setStatus
(
"0"
);
idxBizPvWarningRecord
.
setWarningName
(
level
);
idxBizPvWarningRecord
.
setCONTENT
(
idxBizPvHealthIndices
.
get
(
0
).
getPointName
()
+
"连续"
+
content
+
"健康指数<"
+
num
);
...
...
@@ -448,7 +448,7 @@ public class HealthStatusIndicatorServiceImpl {
idxBizPvWarningRecord
.
setIndexAddress
(
address
);
idxBizPvWarningRecord
.
setEquipmentName
(
idxBizPvHealthIndices
.
get
(
0
).
getEquipmentName
());
idxBizPvWarningRecord
.
setAnalysisPointId
(
idxBizPvHealthIndices
.
get
(
0
).
getAnalysisObjSeq
());
idxBizPvWarningRecord
.
setDisposotionState
(
"
未处置
"
);
idxBizPvWarningRecord
.
setDisposotionState
(
"
待确认
"
);
idxBizPvWarningRecord
.
setStatus
(
"0"
);
idxBizPvWarningRecord
.
setWarningName
(
level
);
idxBizPvWarningRecord
.
setCONTENT
(
idxBizPvHealthIndices
.
get
(
0
).
getPointName
()
+
"连续"
+
content
+
"健康指数<"
+
num
);
...
...
@@ -613,7 +613,7 @@ public class HealthStatusIndicatorServiceImpl {
idxBizPvWarningRecord
.
setIndexAddress
(
address
);
idxBizPvWarningRecord
.
setEquipmentName
(
idxBizPvHealthIndices
.
get
(
0
).
getEquipmentName
());
idxBizPvWarningRecord
.
setAnalysisPointId
(
idxBizPvHealthIndices
.
get
(
0
).
getAnalysisObjSeq
());
idxBizPvWarningRecord
.
setDisposotionState
(
"
未处置
"
);
idxBizPvWarningRecord
.
setDisposotionState
(
"
待确认
"
);
idxBizPvWarningRecord
.
setStatus
(
"0"
);
idxBizPvWarningRecord
.
setWarningName
(
level
);
idxBizPvWarningRecord
.
setCONTENT
(
idxBizPvHealthIndices
.
get
(
0
).
getPointName
()
+
"连续"
+
content
+
"健康指数<"
+
num
);
...
...
@@ -782,7 +782,7 @@ public class HealthStatusIndicatorServiceImpl {
idxBizFanWarningRecord
.
setIndexAddress
(
address
);
idxBizFanWarningRecord
.
setEquipmentName
(
idxBizFanHealthIndices
.
get
(
0
).
getEquipmentName
());
idxBizFanWarningRecord
.
setAnalysisPointId
(
idxBizFanHealthIndices
.
get
(
0
).
getAnalysisObjSeq
());
idxBizFanWarningRecord
.
setDisposotionState
(
"
未处置
"
);
idxBizFanWarningRecord
.
setDisposotionState
(
"
待确认
"
);
idxBizFanWarningRecord
.
setStatus
(
"0"
);
idxBizFanWarningRecord
.
setWarningName
(
level
);
idxBizFanWarningRecord
.
setCONTENT
(
idxBizFanHealthIndices
.
get
(
0
).
getPointName
()
+
"连续"
+
content
+
"健康指数<"
+
num
);
...
...
@@ -950,7 +950,7 @@ public class HealthStatusIndicatorServiceImpl {
idxBizFanWarningRecord
.
setIndexAddress
(
address
);
idxBizFanWarningRecord
.
setEquipmentName
(
idxBizFanHealthIndices
.
get
(
0
).
getEquipmentName
());
idxBizFanWarningRecord
.
setAnalysisPointId
(
idxBizFanHealthIndices
.
get
(
0
).
getAnalysisObjSeq
());
idxBizFanWarningRecord
.
setDisposotionState
(
"
未处置
"
);
idxBizFanWarningRecord
.
setDisposotionState
(
"
待确认
"
);
idxBizFanWarningRecord
.
setStatus
(
"0"
);
idxBizFanWarningRecord
.
setWarningName
(
level
);
idxBizFanWarningRecord
.
setCONTENT
(
idxBizFanHealthIndices
.
get
(
0
).
getPointName
()
+
"连续"
+
content
+
"健康指数<"
+
num
);
...
...
@@ -1121,7 +1121,7 @@ public class HealthStatusIndicatorServiceImpl {
idxBizFanWarningRecord
.
setIndexAddress
(
address
);
idxBizFanWarningRecord
.
setEquipmentName
(
idxBizFanHealthIndices
.
get
(
0
).
getEquipmentName
());
idxBizFanWarningRecord
.
setAnalysisPointId
(
idxBizFanHealthIndices
.
get
(
0
).
getAnalysisObjSeq
());
idxBizFanWarningRecord
.
setDisposotionState
(
"
未处置
"
);
idxBizFanWarningRecord
.
setDisposotionState
(
"
待确认
"
);
idxBizFanWarningRecord
.
setStatus
(
"0"
);
idxBizFanWarningRecord
.
setWarningName
(
level
);
idxBizFanWarningRecord
.
setCONTENT
(
idxBizFanHealthIndices
.
get
(
0
).
getPointName
()
+
"连续"
+
content
+
"健康指数<"
+
num
);
...
...
amos-boot-system-jxiop/amos-boot-module-jxiop-analyse-biz/src/main/resources/mapper/cluster/IdxBizFanHealthIndexMapper.xml
View file @
2103ab89
...
...
@@ -198,8 +198,8 @@
WARNING_NAME as warningName,
count(1) as num
FROM ${tableName} a
where (a.DISPOSOTION_STATE = '
未处置
')
or (a.DISPOSOTION_STATE = '已
处置
' and a.DISPOSOTION_DATE > DATE_ADD(now(), INTERVAL - 3 DAY ))
where (a.DISPOSOTION_STATE = '
待确认
')
or (a.DISPOSOTION_STATE = '已
确认
' and a.DISPOSOTION_DATE > DATE_ADD(now(), INTERVAL - 3 DAY ))
group by ARAE,
WARNING_NAME
</select>
...
...
@@ -235,14 +235,14 @@
count(1) AS num,
(SELECT count(1)
FROM idx_biz_fan_warning_record wr
WHERE ((wr.DISPOSOTION_STATE = '
未处置
')
or (wr.DISPOSOTION_STATE = '已
处置
' and
WHERE ((wr.DISPOSOTION_STATE = '
待确认
')
or (wr.DISPOSOTION_STATE = '已
确认
' and
wr.DISPOSOTION_DATE > DATE_ADD(now(), INTERVAL - 3 DAY )))
AND wr.STATION = STATION
) AS allNum
FROM idx_biz_fan_warning_record
WHERE ((DISPOSOTION_STATE = '
未处置
')
or (DISPOSOTION_STATE = '已
处置
' and DISPOSOTION_DATE > DATE_ADD(now(), INTERVAL - 3 DAY )))
WHERE ((DISPOSOTION_STATE = '
待确认
')
or (DISPOSOTION_STATE = '已
确认
' and DISPOSOTION_DATE > DATE_ADD(now(), INTERVAL - 3 DAY )))
GROUP BY STATION,
WARNING_NAME
UNION ALL
...
...
@@ -251,14 +251,14 @@
count(1) AS num,
(SELECT count(1)
FROM idx_biz_pv_warning_record wr
WHERE ((wr.DISPOSOTION_STATE = '
未处置
')
or (wr.DISPOSOTION_STATE = '已
处置
' and
WHERE ((wr.DISPOSOTION_STATE = '
待确认
')
or (wr.DISPOSOTION_STATE = '已
确认
' and
wr.DISPOSOTION_DATE > DATE_ADD(now(), INTERVAL - 3 DAY )))
AND wr.STATION = STATION
) AS allNum
FROM idx_biz_pv_warning_record
WHERE ((DISPOSOTION_STATE = '
未处置
')
or (DISPOSOTION_STATE = '已
处置
' and DISPOSOTION_DATE > DATE_ADD(now(), INTERVAL - 3 DAY )))
WHERE ((DISPOSOTION_STATE = '
待确认
')
or (DISPOSOTION_STATE = '已
确认
' and DISPOSOTION_DATE > DATE_ADD(now(), INTERVAL - 3 DAY )))
GROUP BY STATION,
WARNING_NAME
) a
...
...
@@ -317,8 +317,8 @@
FROM
idx_biz_fan_warning_record
<where>
((DISPOSOTION_STATE = '
未处置
')
or (DISPOSOTION_STATE = '已
处置
' and DISPOSOTION_DATE > DATE_ADD( now(), INTERVAL - 3 DAY ) ))
((DISPOSOTION_STATE = '
待确认
')
or (DISPOSOTION_STATE = '已
确认
' and DISPOSOTION_DATE > DATE_ADD( now(), INTERVAL - 3 DAY ) ))
<if
test=
"stationCode != null and stationCode != ''"
>
and GATEWAY_ID = #{stationCode}
</if>
...
...
@@ -329,8 +329,8 @@
FROM
idx_biz_pv_warning_record
<where>
((DISPOSOTION_STATE = '
未处置
')
or (DISPOSOTION_STATE = '已
处置
' and DISPOSOTION_DATE > DATE_ADD( now(), INTERVAL - 3 DAY ) ))
((DISPOSOTION_STATE = '
待确认
')
or (DISPOSOTION_STATE = '已
确认
' and DISPOSOTION_DATE > DATE_ADD( now(), INTERVAL - 3 DAY ) ))
<if
test=
"stationCode != null and stationCode != ''"
>
and GATEWAY_ID = #{stationCode}
</if>
...
...
@@ -346,8 +346,8 @@
count(1) as num,
(select count(1) from ${tableName} as tb
<where>
((tb.DISPOSOTION_STATE = '
未处置
')
or (tb.DISPOSOTION_STATE = '已
处置
' and tb.DISPOSOTION_DATE > DATE_ADD( now(), INTERVAL - 3 DAY ) ))
((tb.DISPOSOTION_STATE = '
待确认
')
or (tb.DISPOSOTION_STATE = '已
确认
' and tb.DISPOSOTION_DATE > DATE_ADD( now(), INTERVAL - 3 DAY ) ))
and tb.POINT_NAME = a.POINT_NAME
<if
test=
"areaCode != null and areaCode != ''"
>
and tb.ARAE like concat('%', #{areaCode}, '%')
...
...
@@ -357,8 +357,8 @@
FROM
${tableName} a
<where>
((a.DISPOSOTION_STATE = '
未处置
')
or (a.DISPOSOTION_STATE = '已
处置
' and a.DISPOSOTION_DATE > DATE_ADD( now(), INTERVAL - 3 DAY ) ))
((a.DISPOSOTION_STATE = '
待确认
')
or (a.DISPOSOTION_STATE = '已
确认
' and a.DISPOSOTION_DATE > DATE_ADD( now(), INTERVAL - 3 DAY ) ))
<if
test=
"areaCode != null and areaCode != ''"
>
and a.ARAE like concat('%', #{areaCode}, '%')
</if>
...
...
@@ -380,8 +380,8 @@
count( 1 ) AS num,
( SELECT count( 1 ) FROM idx_biz_pv_warning_record
<where>
((DISPOSOTION_STATE = '
未处置
')
or (DISPOSOTION_STATE = '已
处置
' and DISPOSOTION_DATE > DATE_ADD( now(), INTERVAL - 3 DAY ) ))
((DISPOSOTION_STATE = '
待确认
')
or (DISPOSOTION_STATE = '已
确认
' and DISPOSOTION_DATE > DATE_ADD( now(), INTERVAL - 3 DAY ) ))
AND wr.POINT_NAME = POINT_NAME
<if
test=
"areaCode != null and areaCode != ''"
>
and ARAE like concat('%', #{areaCode}, '%')
...
...
@@ -391,8 +391,8 @@
FROM
idx_biz_pv_warning_record wr
<where>
((wr.DISPOSOTION_STATE = '
未处置
')
or (wr.DISPOSOTION_STATE = '已
处置
' and wr.DISPOSOTION_DATE > DATE_ADD( now(), INTERVAL - 3 DAY ) ))
((wr.DISPOSOTION_STATE = '
待确认
')
or (wr.DISPOSOTION_STATE = '已
确认
' and wr.DISPOSOTION_DATE > DATE_ADD( now(), INTERVAL - 3 DAY ) ))
<if
test=
"areaCode != null and areaCode != ''"
>
and wr.ARAE like concat('%', #{areaCode}, '%')
</if>
...
...
@@ -406,8 +406,8 @@
count( 1 ) AS num,
( SELECT count( 1 ) FROM idx_biz_fan_warning_record
<where>
((DISPOSOTION_STATE = '
未处置
')
or (DISPOSOTION_STATE = '已
处置
' and DISPOSOTION_DATE > DATE_ADD( now(), INTERVAL - 3 DAY ) ))
((DISPOSOTION_STATE = '
待确认
')
or (DISPOSOTION_STATE = '已
确认
' and DISPOSOTION_DATE > DATE_ADD( now(), INTERVAL - 3 DAY ) ))
AND wr.POINT_NAME = POINT_NAME
<if
test=
"areaCode != null and areaCode != ''"
>
and ARAE like concat('%', #{areaCode}, '%')
...
...
@@ -417,8 +417,8 @@
FROM
idx_biz_fan_warning_record wr
<where>
((wr.DISPOSOTION_STATE = '
未处置
')
or (wr.DISPOSOTION_STATE = '已
处置
' and wr.DISPOSOTION_DATE > DATE_ADD( now(), INTERVAL - 3 DAY ) ))
((wr.DISPOSOTION_STATE = '
待确认
')
or (wr.DISPOSOTION_STATE = '已
确认
' and wr.DISPOSOTION_DATE > DATE_ADD( now(), INTERVAL - 3 DAY ) ))
<if
test=
"areaCode != null and areaCode != ''"
>
and wr.ARAE like concat('%', #{areaCode}, '%')
</if>
...
...
@@ -558,7 +558,7 @@
FROM
idx_biz_fan_warning_record
<where>
DISPOSOTION_STATE = '
未处置
'
DISPOSOTION_STATE = '
待确认
'
<if
test=
"subSystem != null and subSystem != ''"
>
AND SUB_SYSTEM = #{subSystem}
</if>
...
...
@@ -670,7 +670,7 @@
FROM
idx_biz_pv_warning_record
<where>
DISPOSOTION_STATE = '
未处置
'
DISPOSOTION_STATE = '
待确认
'
<if
test=
"equipmentName != null and equipmentName != ''"
>
AND EQUIPMENT_NAME = #{equipmentName}
</if>
...
...
@@ -1273,7 +1273,7 @@
${tableName}
WHERE
INDEX_ADDRESS = #{indexAddress}
AND DISPOSOTION_STATE = '
未处置
'
AND DISPOSOTION_STATE = '
待确认
'
and GATEWAY_ID = #{fanGatewayId}
ORDER BY
sort DESC,
...
...
@@ -1298,7 +1298,7 @@
select count(1) from ${tableName}
where INDEX_ADDRESS = #{indexAddress}
AND GATEWAY_ID = #{fanGatewayId}
and DISPOSOTION_STATE = '
未处置
'
and DISPOSOTION_STATE = '
待确认
'
</select>
<select
id=
"getStationIndexInfoByParam"
resultType=
"java.util.Map"
>
SELECT a.STATION AS station,
...
...
amos-boot-system-jxiop/amos-boot-module-jxiop-analyse-biz/src/main/resources/mapper/cluster/IdxBizFanWarningRecordMapper.xml
View file @
2103ab89
...
...
@@ -46,7 +46,7 @@
idx_biz_fan_warning_record
) a
<where>
((a.disposotionState = '
未处置') or (a.disposotionState = '已处置
' AND a.disposotionDate > DATE_ADD( now(), INTERVAL - 3 DAY )))
((a.disposotionState = '
待确认') or (a.disposotionState = '已确认
' AND a.disposotionDate > DATE_ADD( now(), INTERVAL - 3 DAY )))
<if
test=
"arae != '' and arae != null"
>
AND a.arae like concat('%', #{arae}, '%')
</if>
...
...
@@ -107,7 +107,7 @@
idx_biz_fan_warning_record
) a
<where>
((a.disposotionState = '
未处置') or (a.disposotionState = '已处置
' AND a.disposotionDate > DATE_ADD( now(), INTERVAL - 3 DAY )))
((a.disposotionState = '
待确认') or (a.disposotionState = '已确认
' AND a.disposotionDate > DATE_ADD( now(), INTERVAL - 3 DAY )))
<if
test=
"arae != '' and arae != null"
>
AND a.arae like concat('%', #{arae}, '%')
</if>
...
...
amos-boot-system-jxiop/amos-boot-module-jxiop-analyse-biz/src/main/resources/mapper/tdengine2/FanHealthIndex.xml
View file @
2103ab89
...
...
@@ -244,8 +244,8 @@
from
analysis_data.fan_warning_record
<where>
((disposotion_state = '
未处置
')
or (disposotion_state = '已
处置
'
((disposotion_state = '
待确认
')
or (disposotion_state = '已
确认
'
and ts > now - 3d - 8h))
<if
test=
"stationCode != null and stationCode != ''"
>
and gateway_id = #{stationCode}
...
...
@@ -256,9 +256,9 @@
warning_name as warningName
from
analysis_data.pv_warning_record
<where>
((disposotion_state = '
未处置
')
<where>
((disposotion_state = '
待确认
')
or (
disposotion_state = '已
处置
'
disposotion_state = '已
确认
'
and ts > now - 3d - 8h ))
<if
test=
"stationCode != null and stationCode != ''"
>
and gateway_id = #{stationCode}
...
...
@@ -277,7 +277,7 @@
FROM
fan_warning_record
<where>
disposotion_state = '
未处置
'
disposotion_state = '
待确认
'
<if
test=
"subSystem != null and subSystem != ''"
>
AND sub_system = #{subSystem}
</if>
...
...
@@ -299,7 +299,7 @@
${tableName}
WHERE
index_address = #{indexAddress}
AND disposotion_state = '
未处置
'
AND disposotion_state = '
待确认
'
and gateway_id = #{fanGatewayId}
ORDER BY
ts DESC
...
...
@@ -329,7 +329,7 @@
FROM
pv_warning_record
<where>
disposotion_state = '
未处置
'
disposotion_state = '
待确认
'
<if
test=
"equipmentName != null and equipmentName != ''"
>
AND equipment_name = #{equipmentName}
</if>
...
...
amos-boot-system-jxiop/amos-boot-module-jxiop-analyse-biz/src/main/resources/mapper/tdengine2/FanWarningRecord.xml
View file @
2103ab89
...
...
@@ -273,8 +273,8 @@
warning_name as warningName,
count(1) as num
from analysis_data.fan_warning_record a
where (a.disposotion_state = '
未处置
')
or (a.disposotion_state = '已
处置
' and a.ts >(now()-3d -8h ))
where (a.disposotion_state = '
待确认
')
or (a.disposotion_state = '已
确认
' and a.ts >(now()-3d -8h ))
group by arae,
warning_name
...
...
@@ -325,7 +325,7 @@
analysis_data.fan_warning_record
) a
<where>
( (a.disposotionstate = '
未处置') or (a.disposotionstate = '已处置
' and a.ts >( now()- 3d - 8h )))
( (a.disposotionstate = '
待确认') or (a.disposotionstate = '已确认
' and a.ts >( now()- 3d - 8h )))
<if
test=
"arae != '' and arae != null"
>
and a.arae like #{arae}
</if>
...
...
@@ -389,8 +389,8 @@
analysis_data.fan_warning_record
) a
<where>
( a.disposotionState = '
未处置
'
or (a.disposotionState = '已
处置
' and a.ts > ( now() - 3D - 8h )))
( a.disposotionState = '
待确认
'
or (a.disposotionState = '已
确认
' and a.ts > ( now() - 3D - 8h )))
<if
test=
"arae != '' and arae != null"
>
and a.arae like #{arae}
</if>
...
...
@@ -540,8 +540,8 @@
count(1) as num,
station
from analysis_data.fan_warning_record a
where (a.disposotion_state = '
未处置
')
or (a.disposotion_state = '已
处置
' and a.ts >(now()-3d -8h ))
where (a.disposotion_state = '
待确认
')
or (a.disposotion_state = '已
确认
' and a.ts >(now()-3d -8h ))
group by arae,
warning_name,station
union all
...
...
@@ -550,8 +550,8 @@
count(1) as num,
station
from analysis_data.pv_warning_record a
where (a.disposotion_state = '
未处置
')
or (a.disposotion_state = '已
处置
' and a.ts >(now()-3d -8h ))
where (a.disposotion_state = '
待确认
')
or (a.disposotion_state = '已
确认
' and a.ts >(now()-3d -8h ))
group by arae,
warning_name,station ) b
<where>
...
...
amos-boot-system-jxiop/amos-boot-module-jxiop-analyse-biz/src/main/resources/mapper/tdengine2/PvWarningRecord.xml
View file @
2103ab89
...
...
@@ -291,8 +291,8 @@
warning_name as warningName,
count(1) as num
from analysis_data.pv_warning_record a
where (a.disposotion_state = '
未处置
')
or (a.disposotion_state = '已
处置
' and a.ts >(now()-3d -8h ))
where (a.disposotion_state = '
待确认
')
or (a.disposotion_state = '已
确认
' and a.ts >(now()-3d -8h ))
group by arae,
warning_name
...
...
amos-boot-system-jxiop/amos-boot-module-jxiop-bigscreen-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/service/impl/PersonBasicServiceImpl.java
View file @
2103ab89
...
...
@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import
com.yeejoin.amos.boot.biz.common.feign.AmosFeignService
;
import
com.yeejoin.amos.boot.biz.common.utils.RedisUtils
;
import
com.yeejoin.amos.boot.module.jxiop.api.Enum.QrcodeColorEnum
;
import
com.yeejoin.amos.boot.module.jxiop.api.dto.CustomizeItems
;
import
com.yeejoin.amos.boot.module.jxiop.api.dto.PersonBasicDto
;
import
com.yeejoin.amos.boot.module.jxiop.api.dto.RiskBizInfoVo
;
import
com.yeejoin.amos.boot.module.jxiop.api.dto.RiskDynamicDetailsVo
;
...
...
@@ -79,7 +80,7 @@ public class PersonBasicServiceImpl extends BaseService<PersonBasicDto, PersonBa
PersonAccountFedMapper
personAccountFedMapper
;
public
RiskBizInfoVo
fetchData
(
PersonBasic
personBasic
,
PersonAccount
personAccount
)
{
public
RiskBizInfoVo
fetchData
(
PersonBasic
personBasic
,
PersonAccount
personAccount
,
String
content
)
{
RiskBizInfoVo
riskBizInfoVo
=
new
RiskBizInfoVo
();
riskBizInfoVo
.
setWarningObjectName
(
personAccount
.
getProjectName
()
+
personBasic
.
getPostName
()
+
personAccount
.
getName
());
riskBizInfoVo
.
setWarningObjectCode
(
String
.
valueOf
(
personBasic
.
getSequenceNbr
()));
...
...
@@ -91,6 +92,9 @@ public class PersonBasicServiceImpl extends BaseService<PersonBasicDto, PersonBa
dynamicDetailsVo
.
setTabName
(
"预警详情"
);
detailsVos
.
add
(
dynamicDetailsVo
);
riskBizInfoVo
.
setDynamicDetails
(
detailsVos
);
CustomizeItems
customizeItems
=
new
CustomizeItems
();
customizeItems
.
setWarningContent
(
content
);
riskBizInfoVo
.
setCustomizeItems
(
customizeItems
);
return
riskBizInfoVo
;
}
...
...
amos-boot-system-jxiop/amos-boot-module-jxiop-bigscreen-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/service/impl/PersonYardTimeTask.java
View file @
2103ab89
...
...
@@ -66,8 +66,7 @@ public class PersonYardTimeTask {
private
StationBasicMapper
stationBasicMapper
;
@Scheduled
(
cron
=
"0 0 0 1/1 * ? "
)
@Scheduled
(
cron
=
"${person.yard.cron:0 0 0 1/1 * ?}"
)
public
void
timeYardTimeTask
()
{
if
(!
redisUtils
.
hasKey
(
Constants
.
JXIOP_DICT_POST
)
||
!
redisUtils
.
hasKey
(
Constants
.
JXIOP_DICT_CERTIFICATES
))
{
personBasicService
.
addRedisPostAndCerInfo
();
...
...
@@ -103,7 +102,10 @@ public class PersonYardTimeTask {
//人员资质信息
Integer
isInMonth
=
0
;
Integer
isOver
=
0
;
// 过期的证书
List
<
String
>
overCertificateList
=
new
ArrayList
<>();
// 临期证书
List
<
String
>
inMonthCertificateList
=
new
ArrayList
<>();
if
(
CollectionUtils
.
isNotEmpty
(
personCertificateList
))
{
for
(
PersonCertificate
item
:
personCertificateList
)
{
int
validPeriod
=
StringUtils
.
isEmpty
(
item
.
getValidPeriod
())
?
3
:
Integer
.
parseInt
(
item
.
getValidPeriod
());
...
...
@@ -111,12 +113,14 @@ public class PersonYardTimeTask {
if
(
list
.
contains
(
item
.
getCertificateName
())
&&
DateUtils
.
dateCompare
(
date
,
new
Date
())
==
-
1
)
{
isOver
=
1
;
overCertificateList
.
add
(
item
.
getCertificateName
());
}
try
{
if
(
list
.
contains
(
item
.
getCertificateName
())
&&
DateUtils
.
dateBetweenIncludeToday
(
new
Date
(),
date
)
<
Integer
.
valueOf
(
certificatesMap
.
get
(
item
.
getCertificateName
()))
&&
DateUtils
.
dateCompare
(
date
,
new
Date
())
==
1
)
{
isInMonth
=
1
;
inMonthCertificateList
.
add
(
item
.
getCertificateName
());
}
}
catch
(
ParseException
e
)
{
e
.
printStackTrace
();
...
...
@@ -124,44 +128,71 @@ public class PersonYardTimeTask {
list
.
remove
(
item
.
getCertificateName
());
}
}
String
qrcodeDescOld
=
personBasic
.
getQrcodeDesc
();
// 缺证
List
<
String
>
noCertificateList
=
new
ArrayList
<>(
list
);
List
<
String
>
strings
=
new
ArrayList
<>();
if
(
CollectionUtils
.
isNotEmpty
(
overCertificateList
))
{
strings
.
add
(
"过期证书:"
+
String
.
join
(
","
,
overCertificateList
));
}
if
(
CollectionUtils
.
isNotEmpty
(
inMonthCertificateList
))
{
strings
.
add
(
"临期证书:"
+
String
.
join
(
","
,
inMonthCertificateList
));
}
if
(
CollectionUtils
.
isNotEmpty
(
noCertificateList
))
{
strings
.
add
(
"缺少证书:"
+
String
.
join
(
","
,
noCertificateList
));
}
String
join
=
""
;
if
(
CollectionUtils
.
isNotEmpty
(
strings
))
{
join
=
String
.
join
(
";"
,
strings
);
}
String
missingCertificateOld
=
personBasic
.
getMissingCertificate
();
personBasic
.
setMissingCertificate
(
join
);
String
qrcodeColorOld
=
personBasic
.
getQrcodeColor
();
if
(
CollectionUtils
.
isEmpty
(
list
)
&&
isInMonth
==
0
&&
isOver
==
0
)
{
personBasic
.
setQrcodeColor
(
QrcodeColorEnum
.
GREEN
.
getCode
());
personBasic
.
setQrcodeDesc
(
"证书齐全"
);
}
else
if
(
CollectionUtils
.
isEmpty
(
list
)
&&
isOver
==
1
)
{
personBasic
.
setQrcodeDate
(
new
Date
());
}
else
if
((
CollectionUtils
.
isEmpty
(
list
)
&&
isOver
==
1
)
||
(
CollectionUtils
.
isNotEmpty
(
list
)))
{
personBasic
.
setQrcodeColor
(
QrcodeColorEnum
.
RED
.
getCode
());
personBasic
.
setQrcodeDesc
(
"证书不全"
);
personBasic
.
setQrcodeDate
(
new
Date
());
}
else
if
(
CollectionUtils
.
isEmpty
(
list
)
&&
isOver
==
0
&&
isInMonth
==
1
)
{
personBasic
.
setQrcodeColor
(
QrcodeColorEnum
.
YELLOW
.
getCode
());
personBasic
.
setQrcodeDesc
(
"证书临期"
);
personBasic
.
setQrcodeDate
(
new
Date
());
}
if
(
StringUtils
.
isEmpty
(
qrcodeDescOld
)
||
!
qrcodeDescOld
.
equals
(
personBasic
.
getQrcodeDesc
()
))
{
if
(
!
join
.
equals
(
missingCertificateOld
))
{
personBasic
.
setRecDate
(
new
Date
());
personBasicService
.
updateById
(
personBasic
);
this
.
personBasicMapper
.
updateById
(
personBasic
);
if
((
"证书不全"
.
equals
(
personBasic
.
getQrcodeDesc
())
||
"证书临期"
.
equals
(
personBasic
.
getQrcodeDesc
())))
{
BizMessage
bizMessage
=
new
BizMessage
();
bizMessage
.
setIndexKey
(
"RYFM"
);
bizMessage
.
setIndexValue
(
personBasic
.
getPostName
()
+
personBasic
.
getQrcodeDesc
());
RiskBizInfoVo
riskBizInfoVo
=
personBasicService
.
fetchData
(
personBasic
,
personAccount
);
RiskBizInfoVo
riskBizInfoVo
=
personBasicService
.
fetchData
(
personBasic
,
personAccount
,
join
);
bizMessage
.
setBizInfo
(
riskBizInfoVo
);
bizMessage
.
setDataSource
(
"人员赋码"
);
try
{
emqKeeper
.
getMqttClient
().
publish
(
PersonBasicServiceImpl
.
RYFM_DATA_MQTT_TOPIC
,
JSON
.
toJSONString
(
bizMessage
).
getBytes
(
StandardCharsets
.
UTF_8
),
2
,
false
);
}
catch
(
MqttException
e
)
{
e
.
printStackTrace
();
}
}
}
else
if
(
"证书齐全"
.
equals
(
personBasic
.
getQrcodeDesc
()))
{
HashMap
<
String
,
String
>
personMap
=
new
HashMap
<>();
personMap
.
put
(
"objectId"
,
String
.
valueOf
(
personBasic
.
getSequenceNbr
()));
personMap
.
put
(
"qrCodeColor"
,
qrcodeColorOld
);
personMap
.
put
(
"warningObjectType"
,
"RYFM"
);
personMap
.
put
(
"sourceAttribution"
,
personBasic
.
getProjectOrgCode
());
personMap
.
put
(
"sourceAttributionDesc"
,
personAccount
.
getProjectName
());
try
{
emqKeeper
.
getMqttClient
().
publish
(
PersonBasicServiceImpl
.
RYFM_GREEN
,
JSON
.
toJSONString
(
personMap
).
getBytes
(
StandardCharsets
.
UTF_8
),
2
,
false
);
}
catch
(
MqttException
e
)
{
e
.
printStackTrace
();
}
else
if
(
"证书齐全"
.
equals
(
personBasic
.
getQrcodeDesc
()))
{
HashMap
<
String
,
String
>
personMap
=
new
HashMap
<>();
personMap
.
put
(
"objectId"
,
String
.
valueOf
(
personBasic
.
getSequenceNbr
()));
personMap
.
put
(
"qrCodeColor"
,
qrcodeColorOld
);
personMap
.
put
(
"warningObjectType"
,
"RYFM"
);
personMap
.
put
(
"sourceAttribution"
,
personBasic
.
getProjectOrgCode
());
personMap
.
put
(
"sourceAttributionDesc"
,
personAccount
.
getProjectName
());
personMap
.
put
(
"warningSourceType"
,
"人员赋码"
);
try
{
emqKeeper
.
getMqttClient
().
publish
(
PersonBasicServiceImpl
.
RYFM_GREEN
,
JSON
.
toJSONString
(
personMap
).
getBytes
(
StandardCharsets
.
UTF_8
),
2
,
false
);
}
catch
(
MqttException
e
)
{
e
.
printStackTrace
();
}
}
}
});
...
...
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