Commit 2103ab89 authored by zhangsen's avatar zhangsen

bug修改

parent d67c2bba
...@@ -73,7 +73,7 @@ public class WarningRecordStatusMessage extends EmqxListener { ...@@ -73,7 +73,7 @@ public class WarningRecordStatusMessage extends EmqxListener {
List<JSONObject> taskList = JSONObject.parseArray(analysisResult.toJSONString(), JSONObject.class); List<JSONObject> taskList = JSONObject.parseArray(analysisResult.toJSONString(), JSONObject.class);
List<String> traceIds = taskList.stream().map(t -> t.get("extAttr1").toString()).collect(Collectors.toList()); List<String> traceIds = taskList.stream().map(t -> t.get("extAttr1").toString()).collect(Collectors.toList());
// LambdaUpdateWrapper<IdxBizFanWarningRecord> lambda = new LambdaUpdateWrapper<>(); // LambdaUpdateWrapper<IdxBizFanWarningRecord> lambda = new LambdaUpdateWrapper<>();
// lambda.set(IdxBizFanWarningRecord::getDisposotionState, "已处置"); // lambda.set(IdxBizFanWarningRecord::getDisposotionState, "已确认");
// lambda.set(IdxBizFanWarningRecord::getStatus, "1"); // lambda.set(IdxBizFanWarningRecord::getStatus, "1");
// lambda.set(IdxBizFanWarningRecord::getDisposotionDate, new Date()); // lambda.set(IdxBizFanWarningRecord::getDisposotionDate, new Date());
// lambda.in(IdxBizFanWarningRecord::getSequenceNbr, traceIds); // lambda.in(IdxBizFanWarningRecord::getSequenceNbr, traceIds);
...@@ -85,7 +85,7 @@ public class WarningRecordStatusMessage extends EmqxListener { ...@@ -85,7 +85,7 @@ public class WarningRecordStatusMessage extends EmqxListener {
fanWarningRecord.setTs(Long.valueOf(traceId)); fanWarningRecord.setTs(Long.valueOf(traceId));
fanWarningRecord.setDisposotionDate(DateUtil.now()); fanWarningRecord.setDisposotionDate(DateUtil.now());
fanWarningRecord.setStatus("1"); fanWarningRecord.setStatus("1");
fanWarningRecord.setDisposotionState("已处置"); fanWarningRecord.setDisposotionState("已确认");
list.add(fanWarningRecord); list.add(fanWarningRecord);
} }
fanWaringRecordMapper.updateStatusByTs(list); fanWaringRecordMapper.updateStatusByTs(list);
...@@ -110,7 +110,7 @@ public class WarningRecordStatusMessage extends EmqxListener { ...@@ -110,7 +110,7 @@ public class WarningRecordStatusMessage extends EmqxListener {
pvWarningRecord.setTs(Long.valueOf(traceId)); pvWarningRecord.setTs(Long.valueOf(traceId));
pvWarningRecord.setDisposotionDate(DateUtil.now()); pvWarningRecord.setDisposotionDate(DateUtil.now());
pvWarningRecord.setStatus("1"); pvWarningRecord.setStatus("1");
pvWarningRecord.setDisposotionState("已处置"); pvWarningRecord.setDisposotionState("已确认");
list.add(pvWarningRecord); list.add(pvWarningRecord);
} }
pvWaringRecordMapper.updateStatusByTs(list); pvWaringRecordMapper.updateStatusByTs(list);
......
...@@ -281,7 +281,7 @@ public class HealthStatusIndicatorServiceImpl { ...@@ -281,7 +281,7 @@ public class HealthStatusIndicatorServiceImpl {
idxBizPvWarningRecord.setIndexAddress(address); idxBizPvWarningRecord.setIndexAddress(address);
idxBizPvWarningRecord.setEquipmentName(idxBizPvHealthIndices.get(0).getEquipmentName()); idxBizPvWarningRecord.setEquipmentName(idxBizPvHealthIndices.get(0).getEquipmentName());
idxBizPvWarningRecord.setAnalysisPointId(idxBizPvHealthIndices.get(0).getAnalysisObjSeq()); idxBizPvWarningRecord.setAnalysisPointId(idxBizPvHealthIndices.get(0).getAnalysisObjSeq());
idxBizPvWarningRecord.setDisposotionState("未处置"); idxBizPvWarningRecord.setDisposotionState("待确认");
idxBizPvWarningRecord.setStatus("0"); idxBizPvWarningRecord.setStatus("0");
idxBizPvWarningRecord.setWarningName(level); idxBizPvWarningRecord.setWarningName(level);
idxBizPvWarningRecord.setCONTENT(idxBizPvHealthIndices.get(0).getPointName() + "连续"+content+"健康指数<"+num ); idxBizPvWarningRecord.setCONTENT(idxBizPvHealthIndices.get(0).getPointName() + "连续"+content+"健康指数<"+num );
...@@ -448,7 +448,7 @@ public class HealthStatusIndicatorServiceImpl { ...@@ -448,7 +448,7 @@ public class HealthStatusIndicatorServiceImpl {
idxBizPvWarningRecord.setIndexAddress(address); idxBizPvWarningRecord.setIndexAddress(address);
idxBizPvWarningRecord.setEquipmentName(idxBizPvHealthIndices.get(0).getEquipmentName()); idxBizPvWarningRecord.setEquipmentName(idxBizPvHealthIndices.get(0).getEquipmentName());
idxBizPvWarningRecord.setAnalysisPointId(idxBizPvHealthIndices.get(0).getAnalysisObjSeq()); idxBizPvWarningRecord.setAnalysisPointId(idxBizPvHealthIndices.get(0).getAnalysisObjSeq());
idxBizPvWarningRecord.setDisposotionState("未处置"); idxBizPvWarningRecord.setDisposotionState("待确认");
idxBizPvWarningRecord.setStatus("0"); idxBizPvWarningRecord.setStatus("0");
idxBizPvWarningRecord.setWarningName(level); idxBizPvWarningRecord.setWarningName(level);
idxBizPvWarningRecord.setCONTENT(idxBizPvHealthIndices.get(0).getPointName() + "连续"+content+"健康指数<"+num ); idxBizPvWarningRecord.setCONTENT(idxBizPvHealthIndices.get(0).getPointName() + "连续"+content+"健康指数<"+num );
...@@ -613,7 +613,7 @@ public class HealthStatusIndicatorServiceImpl { ...@@ -613,7 +613,7 @@ public class HealthStatusIndicatorServiceImpl {
idxBizPvWarningRecord.setIndexAddress(address); idxBizPvWarningRecord.setIndexAddress(address);
idxBizPvWarningRecord.setEquipmentName(idxBizPvHealthIndices.get(0).getEquipmentName()); idxBizPvWarningRecord.setEquipmentName(idxBizPvHealthIndices.get(0).getEquipmentName());
idxBizPvWarningRecord.setAnalysisPointId(idxBizPvHealthIndices.get(0).getAnalysisObjSeq()); idxBizPvWarningRecord.setAnalysisPointId(idxBizPvHealthIndices.get(0).getAnalysisObjSeq());
idxBizPvWarningRecord.setDisposotionState("未处置"); idxBizPvWarningRecord.setDisposotionState("待确认");
idxBizPvWarningRecord.setStatus("0"); idxBizPvWarningRecord.setStatus("0");
idxBizPvWarningRecord.setWarningName(level); idxBizPvWarningRecord.setWarningName(level);
idxBizPvWarningRecord.setCONTENT(idxBizPvHealthIndices.get(0).getPointName() + "连续"+content+"健康指数<"+num ); idxBizPvWarningRecord.setCONTENT(idxBizPvHealthIndices.get(0).getPointName() + "连续"+content+"健康指数<"+num );
...@@ -782,7 +782,7 @@ public class HealthStatusIndicatorServiceImpl { ...@@ -782,7 +782,7 @@ public class HealthStatusIndicatorServiceImpl {
idxBizFanWarningRecord.setIndexAddress(address); idxBizFanWarningRecord.setIndexAddress(address);
idxBizFanWarningRecord.setEquipmentName(idxBizFanHealthIndices.get(0).getEquipmentName()); idxBizFanWarningRecord.setEquipmentName(idxBizFanHealthIndices.get(0).getEquipmentName());
idxBizFanWarningRecord.setAnalysisPointId(idxBizFanHealthIndices.get(0).getAnalysisObjSeq()); idxBizFanWarningRecord.setAnalysisPointId(idxBizFanHealthIndices.get(0).getAnalysisObjSeq());
idxBizFanWarningRecord.setDisposotionState("未处置"); idxBizFanWarningRecord.setDisposotionState("待确认");
idxBizFanWarningRecord.setStatus("0"); idxBizFanWarningRecord.setStatus("0");
idxBizFanWarningRecord.setWarningName(level); idxBizFanWarningRecord.setWarningName(level);
idxBizFanWarningRecord.setCONTENT(idxBizFanHealthIndices.get(0).getPointName() + "连续"+content+"健康指数<"+num ); idxBizFanWarningRecord.setCONTENT(idxBizFanHealthIndices.get(0).getPointName() + "连续"+content+"健康指数<"+num );
...@@ -950,7 +950,7 @@ public class HealthStatusIndicatorServiceImpl { ...@@ -950,7 +950,7 @@ public class HealthStatusIndicatorServiceImpl {
idxBizFanWarningRecord.setIndexAddress(address); idxBizFanWarningRecord.setIndexAddress(address);
idxBizFanWarningRecord.setEquipmentName(idxBizFanHealthIndices.get(0).getEquipmentName()); idxBizFanWarningRecord.setEquipmentName(idxBizFanHealthIndices.get(0).getEquipmentName());
idxBizFanWarningRecord.setAnalysisPointId(idxBizFanHealthIndices.get(0).getAnalysisObjSeq()); idxBizFanWarningRecord.setAnalysisPointId(idxBizFanHealthIndices.get(0).getAnalysisObjSeq());
idxBizFanWarningRecord.setDisposotionState("未处置"); idxBizFanWarningRecord.setDisposotionState("待确认");
idxBizFanWarningRecord.setStatus("0"); idxBizFanWarningRecord.setStatus("0");
idxBizFanWarningRecord.setWarningName(level); idxBizFanWarningRecord.setWarningName(level);
idxBizFanWarningRecord.setCONTENT(idxBizFanHealthIndices.get(0).getPointName() + "连续"+content+"健康指数<"+num ); idxBizFanWarningRecord.setCONTENT(idxBizFanHealthIndices.get(0).getPointName() + "连续"+content+"健康指数<"+num );
...@@ -1121,7 +1121,7 @@ public class HealthStatusIndicatorServiceImpl { ...@@ -1121,7 +1121,7 @@ public class HealthStatusIndicatorServiceImpl {
idxBizFanWarningRecord.setIndexAddress(address); idxBizFanWarningRecord.setIndexAddress(address);
idxBizFanWarningRecord.setEquipmentName(idxBizFanHealthIndices.get(0).getEquipmentName()); idxBizFanWarningRecord.setEquipmentName(idxBizFanHealthIndices.get(0).getEquipmentName());
idxBizFanWarningRecord.setAnalysisPointId(idxBizFanHealthIndices.get(0).getAnalysisObjSeq()); idxBizFanWarningRecord.setAnalysisPointId(idxBizFanHealthIndices.get(0).getAnalysisObjSeq());
idxBizFanWarningRecord.setDisposotionState("未处置"); idxBizFanWarningRecord.setDisposotionState("待确认");
idxBizFanWarningRecord.setStatus("0"); idxBizFanWarningRecord.setStatus("0");
idxBizFanWarningRecord.setWarningName(level); idxBizFanWarningRecord.setWarningName(level);
idxBizFanWarningRecord.setCONTENT(idxBizFanHealthIndices.get(0).getPointName() + "连续"+content+"健康指数<"+num ); idxBizFanWarningRecord.setCONTENT(idxBizFanHealthIndices.get(0).getPointName() + "连续"+content+"健康指数<"+num );
......
...@@ -198,8 +198,8 @@ ...@@ -198,8 +198,8 @@
WARNING_NAME as warningName, WARNING_NAME as warningName,
count(1) as num count(1) as num
FROM ${tableName} a FROM ${tableName} a
where (a.DISPOSOTION_STATE = '未处置') where (a.DISPOSOTION_STATE = '待确认')
or (a.DISPOSOTION_STATE = '已处置' and a.DISPOSOTION_DATE > DATE_ADD(now(), INTERVAL - 3 DAY )) or (a.DISPOSOTION_STATE = '已确认' and a.DISPOSOTION_DATE > DATE_ADD(now(), INTERVAL - 3 DAY ))
group by ARAE, group by ARAE,
WARNING_NAME WARNING_NAME
</select> </select>
...@@ -235,14 +235,14 @@ ...@@ -235,14 +235,14 @@
count(1) AS num, count(1) AS num,
(SELECT count(1) (SELECT count(1)
FROM idx_biz_fan_warning_record wr FROM idx_biz_fan_warning_record wr
WHERE ((wr.DISPOSOTION_STATE = '未处置') WHERE ((wr.DISPOSOTION_STATE = '待确认')
or (wr.DISPOSOTION_STATE = '已处置' and or (wr.DISPOSOTION_STATE = '已确认' and
wr.DISPOSOTION_DATE > DATE_ADD(now(), INTERVAL - 3 DAY ))) wr.DISPOSOTION_DATE > DATE_ADD(now(), INTERVAL - 3 DAY )))
AND wr.STATION = STATION AND wr.STATION = STATION
) AS allNum ) AS allNum
FROM idx_biz_fan_warning_record FROM idx_biz_fan_warning_record
WHERE ((DISPOSOTION_STATE = '未处置') WHERE ((DISPOSOTION_STATE = '待确认')
or (DISPOSOTION_STATE = '已处置' and DISPOSOTION_DATE > DATE_ADD(now(), INTERVAL - 3 DAY ))) or (DISPOSOTION_STATE = '已确认' and DISPOSOTION_DATE > DATE_ADD(now(), INTERVAL - 3 DAY )))
GROUP BY STATION, GROUP BY STATION,
WARNING_NAME WARNING_NAME
UNION ALL UNION ALL
...@@ -251,14 +251,14 @@ ...@@ -251,14 +251,14 @@
count(1) AS num, count(1) AS num,
(SELECT count(1) (SELECT count(1)
FROM idx_biz_pv_warning_record wr FROM idx_biz_pv_warning_record wr
WHERE ((wr.DISPOSOTION_STATE = '未处置') WHERE ((wr.DISPOSOTION_STATE = '待确认')
or (wr.DISPOSOTION_STATE = '已处置' and or (wr.DISPOSOTION_STATE = '已确认' and
wr.DISPOSOTION_DATE > DATE_ADD(now(), INTERVAL - 3 DAY ))) wr.DISPOSOTION_DATE > DATE_ADD(now(), INTERVAL - 3 DAY )))
AND wr.STATION = STATION AND wr.STATION = STATION
) AS allNum ) AS allNum
FROM idx_biz_pv_warning_record FROM idx_biz_pv_warning_record
WHERE ((DISPOSOTION_STATE = '未处置') WHERE ((DISPOSOTION_STATE = '待确认')
or (DISPOSOTION_STATE = '已处置' and DISPOSOTION_DATE > DATE_ADD(now(), INTERVAL - 3 DAY ))) or (DISPOSOTION_STATE = '已确认' and DISPOSOTION_DATE > DATE_ADD(now(), INTERVAL - 3 DAY )))
GROUP BY STATION, GROUP BY STATION,
WARNING_NAME WARNING_NAME
) a ) a
...@@ -317,8 +317,8 @@ ...@@ -317,8 +317,8 @@
FROM FROM
idx_biz_fan_warning_record idx_biz_fan_warning_record
<where> <where>
((DISPOSOTION_STATE = '未处置') ((DISPOSOTION_STATE = '待确认')
or (DISPOSOTION_STATE = '已处置' and DISPOSOTION_DATE > DATE_ADD( now(), INTERVAL - 3 DAY ) )) or (DISPOSOTION_STATE = '已确认' and DISPOSOTION_DATE > DATE_ADD( now(), INTERVAL - 3 DAY ) ))
<if test="stationCode != null and stationCode != ''"> <if test="stationCode != null and stationCode != ''">
and GATEWAY_ID = #{stationCode} and GATEWAY_ID = #{stationCode}
</if> </if>
...@@ -329,8 +329,8 @@ ...@@ -329,8 +329,8 @@
FROM FROM
idx_biz_pv_warning_record idx_biz_pv_warning_record
<where> <where>
((DISPOSOTION_STATE = '未处置') ((DISPOSOTION_STATE = '待确认')
or (DISPOSOTION_STATE = '已处置' and DISPOSOTION_DATE > DATE_ADD( now(), INTERVAL - 3 DAY ) )) or (DISPOSOTION_STATE = '已确认' and DISPOSOTION_DATE > DATE_ADD( now(), INTERVAL - 3 DAY ) ))
<if test="stationCode != null and stationCode != ''"> <if test="stationCode != null and stationCode != ''">
and GATEWAY_ID = #{stationCode} and GATEWAY_ID = #{stationCode}
</if> </if>
...@@ -346,8 +346,8 @@ ...@@ -346,8 +346,8 @@
count(1) as num, count(1) as num,
(select count(1) from ${tableName} as tb (select count(1) from ${tableName} as tb
<where> <where>
((tb.DISPOSOTION_STATE = '未处置') ((tb.DISPOSOTION_STATE = '待确认')
or (tb.DISPOSOTION_STATE = '已处置' and tb.DISPOSOTION_DATE > DATE_ADD( now(), INTERVAL - 3 DAY ) )) or (tb.DISPOSOTION_STATE = '已确认' and tb.DISPOSOTION_DATE > DATE_ADD( now(), INTERVAL - 3 DAY ) ))
and tb.POINT_NAME = a.POINT_NAME and tb.POINT_NAME = a.POINT_NAME
<if test="areaCode != null and areaCode != ''"> <if test="areaCode != null and areaCode != ''">
and tb.ARAE like concat('%', #{areaCode}, '%') and tb.ARAE like concat('%', #{areaCode}, '%')
...@@ -357,8 +357,8 @@ ...@@ -357,8 +357,8 @@
FROM FROM
${tableName} a ${tableName} a
<where> <where>
((a.DISPOSOTION_STATE = '未处置') ((a.DISPOSOTION_STATE = '待确认')
or (a.DISPOSOTION_STATE = '已处置' and a.DISPOSOTION_DATE > DATE_ADD( now(), INTERVAL - 3 DAY ) )) or (a.DISPOSOTION_STATE = '已确认' and a.DISPOSOTION_DATE > DATE_ADD( now(), INTERVAL - 3 DAY ) ))
<if test="areaCode != null and areaCode != ''"> <if test="areaCode != null and areaCode != ''">
and a.ARAE like concat('%', #{areaCode}, '%') and a.ARAE like concat('%', #{areaCode}, '%')
</if> </if>
...@@ -380,8 +380,8 @@ ...@@ -380,8 +380,8 @@
count( 1 ) AS num, count( 1 ) AS num,
( SELECT count( 1 ) FROM idx_biz_pv_warning_record ( SELECT count( 1 ) FROM idx_biz_pv_warning_record
<where> <where>
((DISPOSOTION_STATE = '未处置') ((DISPOSOTION_STATE = '待确认')
or (DISPOSOTION_STATE = '已处置' and DISPOSOTION_DATE > DATE_ADD( now(), INTERVAL - 3 DAY ) )) or (DISPOSOTION_STATE = '已确认' and DISPOSOTION_DATE > DATE_ADD( now(), INTERVAL - 3 DAY ) ))
AND wr.POINT_NAME = POINT_NAME AND wr.POINT_NAME = POINT_NAME
<if test="areaCode != null and areaCode != ''"> <if test="areaCode != null and areaCode != ''">
and ARAE like concat('%', #{areaCode}, '%') and ARAE like concat('%', #{areaCode}, '%')
...@@ -391,8 +391,8 @@ ...@@ -391,8 +391,8 @@
FROM FROM
idx_biz_pv_warning_record wr idx_biz_pv_warning_record wr
<where> <where>
((wr.DISPOSOTION_STATE = '未处置') ((wr.DISPOSOTION_STATE = '待确认')
or (wr.DISPOSOTION_STATE = '已处置' and wr.DISPOSOTION_DATE > DATE_ADD( now(), INTERVAL - 3 DAY ) )) or (wr.DISPOSOTION_STATE = '已确认' and wr.DISPOSOTION_DATE > DATE_ADD( now(), INTERVAL - 3 DAY ) ))
<if test="areaCode != null and areaCode != ''"> <if test="areaCode != null and areaCode != ''">
and wr.ARAE like concat('%', #{areaCode}, '%') and wr.ARAE like concat('%', #{areaCode}, '%')
</if> </if>
...@@ -406,8 +406,8 @@ ...@@ -406,8 +406,8 @@
count( 1 ) AS num, count( 1 ) AS num,
( SELECT count( 1 ) FROM idx_biz_fan_warning_record ( SELECT count( 1 ) FROM idx_biz_fan_warning_record
<where> <where>
((DISPOSOTION_STATE = '未处置') ((DISPOSOTION_STATE = '待确认')
or (DISPOSOTION_STATE = '已处置' and DISPOSOTION_DATE > DATE_ADD( now(), INTERVAL - 3 DAY ) )) or (DISPOSOTION_STATE = '已确认' and DISPOSOTION_DATE > DATE_ADD( now(), INTERVAL - 3 DAY ) ))
AND wr.POINT_NAME = POINT_NAME AND wr.POINT_NAME = POINT_NAME
<if test="areaCode != null and areaCode != ''"> <if test="areaCode != null and areaCode != ''">
and ARAE like concat('%', #{areaCode}, '%') and ARAE like concat('%', #{areaCode}, '%')
...@@ -417,8 +417,8 @@ ...@@ -417,8 +417,8 @@
FROM FROM
idx_biz_fan_warning_record wr idx_biz_fan_warning_record wr
<where> <where>
((wr.DISPOSOTION_STATE = '未处置') ((wr.DISPOSOTION_STATE = '待确认')
or (wr.DISPOSOTION_STATE = '已处置' and wr.DISPOSOTION_DATE > DATE_ADD( now(), INTERVAL - 3 DAY ) )) or (wr.DISPOSOTION_STATE = '已确认' and wr.DISPOSOTION_DATE > DATE_ADD( now(), INTERVAL - 3 DAY ) ))
<if test="areaCode != null and areaCode != ''"> <if test="areaCode != null and areaCode != ''">
and wr.ARAE like concat('%', #{areaCode}, '%') and wr.ARAE like concat('%', #{areaCode}, '%')
</if> </if>
...@@ -558,7 +558,7 @@ ...@@ -558,7 +558,7 @@
FROM FROM
idx_biz_fan_warning_record idx_biz_fan_warning_record
<where> <where>
DISPOSOTION_STATE = '未处置' DISPOSOTION_STATE = '待确认'
<if test="subSystem != null and subSystem != ''"> <if test="subSystem != null and subSystem != ''">
AND SUB_SYSTEM = #{subSystem} AND SUB_SYSTEM = #{subSystem}
</if> </if>
...@@ -670,7 +670,7 @@ ...@@ -670,7 +670,7 @@
FROM FROM
idx_biz_pv_warning_record idx_biz_pv_warning_record
<where> <where>
DISPOSOTION_STATE = '未处置' DISPOSOTION_STATE = '待确认'
<if test="equipmentName != null and equipmentName != ''"> <if test="equipmentName != null and equipmentName != ''">
AND EQUIPMENT_NAME = #{equipmentName} AND EQUIPMENT_NAME = #{equipmentName}
</if> </if>
...@@ -1273,7 +1273,7 @@ ...@@ -1273,7 +1273,7 @@
${tableName} ${tableName}
WHERE WHERE
INDEX_ADDRESS = #{indexAddress} INDEX_ADDRESS = #{indexAddress}
AND DISPOSOTION_STATE = '未处置' AND DISPOSOTION_STATE = '待确认'
and GATEWAY_ID = #{fanGatewayId} and GATEWAY_ID = #{fanGatewayId}
ORDER BY ORDER BY
sort DESC, sort DESC,
...@@ -1298,7 +1298,7 @@ ...@@ -1298,7 +1298,7 @@
select count(1) from ${tableName} select count(1) from ${tableName}
where INDEX_ADDRESS = #{indexAddress} where INDEX_ADDRESS = #{indexAddress}
AND GATEWAY_ID = #{fanGatewayId} AND GATEWAY_ID = #{fanGatewayId}
and DISPOSOTION_STATE = '未处置' and DISPOSOTION_STATE = '待确认'
</select> </select>
<select id="getStationIndexInfoByParam" resultType="java.util.Map"> <select id="getStationIndexInfoByParam" resultType="java.util.Map">
SELECT a.STATION AS station, SELECT a.STATION AS station,
......
...@@ -46,7 +46,7 @@ ...@@ -46,7 +46,7 @@
idx_biz_fan_warning_record idx_biz_fan_warning_record
) a ) a
<where> <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"> <if test="arae != '' and arae != null">
AND a.arae like concat('%', #{arae}, '%') AND a.arae like concat('%', #{arae}, '%')
</if> </if>
...@@ -107,7 +107,7 @@ ...@@ -107,7 +107,7 @@
idx_biz_fan_warning_record idx_biz_fan_warning_record
) a ) a
<where> <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"> <if test="arae != '' and arae != null">
AND a.arae like concat('%', #{arae}, '%') AND a.arae like concat('%', #{arae}, '%')
</if> </if>
......
...@@ -244,8 +244,8 @@ ...@@ -244,8 +244,8 @@
from from
analysis_data.fan_warning_record analysis_data.fan_warning_record
<where> <where>
((disposotion_state = '未处置') ((disposotion_state = '待确认')
or (disposotion_state = '已处置' or (disposotion_state = '已确认'
and ts > now - 3d - 8h)) and ts > now - 3d - 8h))
<if test="stationCode != null and stationCode != ''"> <if test="stationCode != null and stationCode != ''">
and gateway_id = #{stationCode} and gateway_id = #{stationCode}
...@@ -256,9 +256,9 @@ ...@@ -256,9 +256,9 @@
warning_name as warningName warning_name as warningName
from from
analysis_data.pv_warning_record analysis_data.pv_warning_record
<where>((disposotion_state = '未处置') <where>((disposotion_state = '待确认')
or ( or (
disposotion_state = '已处置' disposotion_state = '已确认'
and ts > now - 3d - 8h )) and ts > now - 3d - 8h ))
<if test="stationCode != null and stationCode != ''"> <if test="stationCode != null and stationCode != ''">
and gateway_id = #{stationCode} and gateway_id = #{stationCode}
...@@ -277,7 +277,7 @@ ...@@ -277,7 +277,7 @@
FROM FROM
fan_warning_record fan_warning_record
<where> <where>
disposotion_state = '未处置' disposotion_state = '待确认'
<if test="subSystem != null and subSystem != ''"> <if test="subSystem != null and subSystem != ''">
AND sub_system = #{subSystem} AND sub_system = #{subSystem}
</if> </if>
...@@ -299,7 +299,7 @@ ...@@ -299,7 +299,7 @@
${tableName} ${tableName}
WHERE WHERE
index_address = #{indexAddress} index_address = #{indexAddress}
AND disposotion_state = '未处置' AND disposotion_state = '待确认'
and gateway_id = #{fanGatewayId} and gateway_id = #{fanGatewayId}
ORDER BY ORDER BY
ts DESC ts DESC
...@@ -329,7 +329,7 @@ ...@@ -329,7 +329,7 @@
FROM FROM
pv_warning_record pv_warning_record
<where> <where>
disposotion_state = '未处置' disposotion_state = '待确认'
<if test="equipmentName != null and equipmentName != ''"> <if test="equipmentName != null and equipmentName != ''">
AND equipment_name = #{equipmentName} AND equipment_name = #{equipmentName}
</if> </if>
......
...@@ -273,8 +273,8 @@ ...@@ -273,8 +273,8 @@
warning_name as warningName, warning_name as warningName,
count(1) as num count(1) as num
from analysis_data.fan_warning_record a from analysis_data.fan_warning_record a
where (a.disposotion_state = '未处置') where (a.disposotion_state = '待确认')
or (a.disposotion_state = '已处置' and a.ts >(now()-3d -8h )) or (a.disposotion_state = '已确认' and a.ts >(now()-3d -8h ))
group by arae, group by arae,
warning_name warning_name
...@@ -325,7 +325,7 @@ ...@@ -325,7 +325,7 @@
analysis_data.fan_warning_record analysis_data.fan_warning_record
) a ) a
<where> <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"> <if test="arae != '' and arae != null">
and a.arae like #{arae} and a.arae like #{arae}
</if> </if>
...@@ -389,8 +389,8 @@ ...@@ -389,8 +389,8 @@
analysis_data.fan_warning_record analysis_data.fan_warning_record
) a ) a
<where> <where>
( a.disposotionState = '未处置' ( a.disposotionState = '待确认'
or (a.disposotionState = '已处置' and a.ts > ( now() - 3D - 8h ))) or (a.disposotionState = '已确认' and a.ts > ( now() - 3D - 8h )))
<if test="arae != '' and arae != null"> <if test="arae != '' and arae != null">
and a.arae like #{arae} and a.arae like #{arae}
</if> </if>
...@@ -540,8 +540,8 @@ ...@@ -540,8 +540,8 @@
count(1) as num, count(1) as num,
station station
from analysis_data.fan_warning_record a from analysis_data.fan_warning_record a
where (a.disposotion_state = '未处置') where (a.disposotion_state = '待确认')
or (a.disposotion_state = '已处置' and a.ts >(now()-3d -8h )) or (a.disposotion_state = '已确认' and a.ts >(now()-3d -8h ))
group by arae, group by arae,
warning_name,station warning_name,station
union all union all
...@@ -550,8 +550,8 @@ ...@@ -550,8 +550,8 @@
count(1) as num, count(1) as num,
station station
from analysis_data.pv_warning_record a from analysis_data.pv_warning_record a
where (a.disposotion_state = '未处置') where (a.disposotion_state = '待确认')
or (a.disposotion_state = '已处置' and a.ts >(now()-3d -8h )) or (a.disposotion_state = '已确认' and a.ts >(now()-3d -8h ))
group by arae, group by arae,
warning_name,station ) b warning_name,station ) b
<where> <where>
......
...@@ -291,8 +291,8 @@ ...@@ -291,8 +291,8 @@
warning_name as warningName, warning_name as warningName,
count(1) as num count(1) as num
from analysis_data.pv_warning_record a from analysis_data.pv_warning_record a
where (a.disposotion_state = '未处置') where (a.disposotion_state = '待确认')
or (a.disposotion_state = '已处置' and a.ts >(now()-3d -8h )) or (a.disposotion_state = '已确认' and a.ts >(now()-3d -8h ))
group by arae, group by arae,
warning_name warning_name
......
...@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; ...@@ -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.feign.AmosFeignService;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils; 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.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.PersonBasicDto;
import com.yeejoin.amos.boot.module.jxiop.api.dto.RiskBizInfoVo; import com.yeejoin.amos.boot.module.jxiop.api.dto.RiskBizInfoVo;
import com.yeejoin.amos.boot.module.jxiop.api.dto.RiskDynamicDetailsVo; import com.yeejoin.amos.boot.module.jxiop.api.dto.RiskDynamicDetailsVo;
...@@ -79,7 +80,7 @@ public class PersonBasicServiceImpl extends BaseService<PersonBasicDto, PersonBa ...@@ -79,7 +80,7 @@ public class PersonBasicServiceImpl extends BaseService<PersonBasicDto, PersonBa
PersonAccountFedMapper personAccountFedMapper; PersonAccountFedMapper personAccountFedMapper;
public RiskBizInfoVo fetchData(PersonBasic personBasic, PersonAccount personAccount) { public RiskBizInfoVo fetchData(PersonBasic personBasic, PersonAccount personAccount, String content) {
RiskBizInfoVo riskBizInfoVo = new RiskBizInfoVo(); RiskBizInfoVo riskBizInfoVo = new RiskBizInfoVo();
riskBizInfoVo.setWarningObjectName(personAccount.getProjectName() + personBasic.getPostName() + personAccount.getName()); riskBizInfoVo.setWarningObjectName(personAccount.getProjectName() + personBasic.getPostName() + personAccount.getName());
riskBizInfoVo.setWarningObjectCode(String.valueOf(personBasic.getSequenceNbr())); riskBizInfoVo.setWarningObjectCode(String.valueOf(personBasic.getSequenceNbr()));
...@@ -91,6 +92,9 @@ public class PersonBasicServiceImpl extends BaseService<PersonBasicDto, PersonBa ...@@ -91,6 +92,9 @@ public class PersonBasicServiceImpl extends BaseService<PersonBasicDto, PersonBa
dynamicDetailsVo.setTabName("预警详情"); dynamicDetailsVo.setTabName("预警详情");
detailsVos.add(dynamicDetailsVo); detailsVos.add(dynamicDetailsVo);
riskBizInfoVo.setDynamicDetails(detailsVos); riskBizInfoVo.setDynamicDetails(detailsVos);
CustomizeItems customizeItems = new CustomizeItems();
customizeItems.setWarningContent(content);
riskBizInfoVo.setCustomizeItems(customizeItems);
return riskBizInfoVo; return riskBizInfoVo;
} }
......
...@@ -66,8 +66,7 @@ public class PersonYardTimeTask { ...@@ -66,8 +66,7 @@ public class PersonYardTimeTask {
private StationBasicMapper stationBasicMapper; private StationBasicMapper stationBasicMapper;
@Scheduled(cron = "${person.yard.cron:0 0 0 1/1 * ?}")
@Scheduled(cron = "0 0 0 1/1 * ? ")
public void timeYardTimeTask() { public void timeYardTimeTask() {
if (!redisUtils.hasKey(Constants.JXIOP_DICT_POST) || !redisUtils.hasKey(Constants.JXIOP_DICT_CERTIFICATES)) { if (!redisUtils.hasKey(Constants.JXIOP_DICT_POST) || !redisUtils.hasKey(Constants.JXIOP_DICT_CERTIFICATES)) {
personBasicService.addRedisPostAndCerInfo(); personBasicService.addRedisPostAndCerInfo();
...@@ -103,7 +102,10 @@ public class PersonYardTimeTask { ...@@ -103,7 +102,10 @@ public class PersonYardTimeTask {
//人员资质信息 //人员资质信息
Integer isInMonth = 0; Integer isInMonth = 0;
Integer isOver = 0; Integer isOver = 0;
// 过期的证书
List<String> overCertificateList = new ArrayList<>();
// 临期证书
List<String> inMonthCertificateList = new ArrayList<>();
if (CollectionUtils.isNotEmpty(personCertificateList)) { if (CollectionUtils.isNotEmpty(personCertificateList)) {
for (PersonCertificate item : personCertificateList) { for (PersonCertificate item : personCertificateList) {
int validPeriod = StringUtils.isEmpty(item.getValidPeriod()) ? 3 : Integer.parseInt(item.getValidPeriod()); int validPeriod = StringUtils.isEmpty(item.getValidPeriod()) ? 3 : Integer.parseInt(item.getValidPeriod());
...@@ -111,12 +113,14 @@ public class PersonYardTimeTask { ...@@ -111,12 +113,14 @@ public class PersonYardTimeTask {
if (list.contains(item.getCertificateName()) && if (list.contains(item.getCertificateName()) &&
DateUtils.dateCompare(date, new Date()) == -1) { DateUtils.dateCompare(date, new Date()) == -1) {
isOver = 1; isOver = 1;
overCertificateList.add(item.getCertificateName());
} }
try { try {
if (list.contains(item.getCertificateName()) && if (list.contains(item.getCertificateName()) &&
DateUtils.dateBetweenIncludeToday(new Date(), date) < Integer.valueOf(certificatesMap.get(item.getCertificateName())) && DateUtils.dateBetweenIncludeToday(new Date(), date) < Integer.valueOf(certificatesMap.get(item.getCertificateName())) &&
DateUtils.dateCompare(date, new Date()) == 1) { DateUtils.dateCompare(date, new Date()) == 1) {
isInMonth = 1; isInMonth = 1;
inMonthCertificateList.add(item.getCertificateName());
} }
} catch (ParseException e) { } catch (ParseException e) {
e.printStackTrace(); e.printStackTrace();
...@@ -124,44 +128,71 @@ public class PersonYardTimeTask { ...@@ -124,44 +128,71 @@ public class PersonYardTimeTask {
list.remove(item.getCertificateName()); 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(); String qrcodeColorOld = personBasic.getQrcodeColor();
if (CollectionUtils.isEmpty(list) && isInMonth == 0 && isOver == 0) { if (CollectionUtils.isEmpty(list) && isInMonth == 0 && isOver == 0) {
personBasic.setQrcodeColor(QrcodeColorEnum.GREEN.getCode()); personBasic.setQrcodeColor(QrcodeColorEnum.GREEN.getCode());
personBasic.setQrcodeDesc("证书齐全"); 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.setQrcodeDesc("证书不全");
personBasic.setQrcodeDate(new Date());
} else if (CollectionUtils.isEmpty(list) && isOver == 0 && isInMonth == 1) { } else if (CollectionUtils.isEmpty(list) && isOver == 0 && isInMonth == 1) {
personBasic.setQrcodeColor(QrcodeColorEnum.YELLOW.getCode());
personBasic.setQrcodeDesc("证书临期"); personBasic.setQrcodeDesc("证书临期");
personBasic.setQrcodeDate(new Date());
} }
if (StringUtils.isEmpty(qrcodeDescOld) || !qrcodeDescOld.equals(personBasic.getQrcodeDesc())) { if (!join.equals(missingCertificateOld)) {
personBasic.setRecDate(new Date()); personBasic.setRecDate(new Date());
personBasicService.updateById(personBasic); this.personBasicMapper.updateById(personBasic);
if (("证书不全".equals(personBasic.getQrcodeDesc()) || if (("证书不全".equals(personBasic.getQrcodeDesc()) ||
"证书临期".equals(personBasic.getQrcodeDesc()))) { "证书临期".equals(personBasic.getQrcodeDesc()))) {
BizMessage bizMessage = new BizMessage(); BizMessage bizMessage = new BizMessage();
bizMessage.setIndexKey("RYFM"); bizMessage.setIndexKey("RYFM");
bizMessage.setIndexValue(personBasic.getPostName() + personBasic.getQrcodeDesc()); bizMessage.setIndexValue(personBasic.getPostName() + personBasic.getQrcodeDesc());
RiskBizInfoVo riskBizInfoVo = personBasicService.fetchData(personBasic, personAccount); RiskBizInfoVo riskBizInfoVo = personBasicService.fetchData(personBasic, personAccount, join);
bizMessage.setBizInfo(riskBizInfoVo); bizMessage.setBizInfo(riskBizInfoVo);
bizMessage.setDataSource("人员赋码");
try { try {
emqKeeper.getMqttClient().publish(PersonBasicServiceImpl.RYFM_DATA_MQTT_TOPIC, JSON.toJSONString(bizMessage).getBytes(StandardCharsets.UTF_8), 2, false); emqKeeper.getMqttClient().publish(PersonBasicServiceImpl.RYFM_DATA_MQTT_TOPIC, JSON.toJSONString(bizMessage).getBytes(StandardCharsets.UTF_8), 2, false);
} catch (MqttException e) { } catch (MqttException e) {
e.printStackTrace(); e.printStackTrace();
} }
} } else if ("证书齐全".equals(personBasic.getQrcodeDesc())) {
} else if ("证书齐全".equals(personBasic.getQrcodeDesc())) { HashMap<String, String> personMap = new HashMap<>();
HashMap<String, String> personMap = new HashMap<>(); personMap.put("objectId", String.valueOf(personBasic.getSequenceNbr()));
personMap.put("objectId", String.valueOf(personBasic.getSequenceNbr())); personMap.put("qrCodeColor", qrcodeColorOld);
personMap.put("qrCodeColor", qrcodeColorOld); personMap.put("warningObjectType", "RYFM");
personMap.put("warningObjectType", "RYFM"); personMap.put("sourceAttribution", personBasic.getProjectOrgCode());
personMap.put("sourceAttribution", personBasic.getProjectOrgCode()); personMap.put("sourceAttributionDesc", personAccount.getProjectName());
personMap.put("sourceAttributionDesc", personAccount.getProjectName()); personMap.put("warningSourceType", "人员赋码");
try { try {
emqKeeper.getMqttClient().publish(PersonBasicServiceImpl.RYFM_GREEN, JSON.toJSONString(personMap).getBytes(StandardCharsets.UTF_8), 2, false); emqKeeper.getMqttClient().publish(PersonBasicServiceImpl.RYFM_GREEN, JSON.toJSONString(personMap).getBytes(StandardCharsets.UTF_8), 2, false);
} catch (MqttException e) { } catch (MqttException e) {
e.printStackTrace(); e.printStackTrace();
}
} }
} }
}); });
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment