Commit 6728a876 authored by zhangsen's avatar zhangsen

bug修改

parent 9cce7838
...@@ -71,14 +71,14 @@ public class WarningRecordStatusMessage extends EmqxListener { ...@@ -71,14 +71,14 @@ public class WarningRecordStatusMessage extends EmqxListener {
public void jxIopUpdate(JSONObject analysisResult) { public void jxIopUpdate(JSONObject analysisResult) {
log.info("修改预警状态信息:{}", analysisResult); log.info("修改预警状态信息:{}", analysisResult);
if (ObjectUtils.isNotEmpty(analysisResult) && analysisResult.get("warningObjectType").toString().equals("pv")) { if (ObjectUtils.isNotEmpty(analysisResult) && analysisResult.get("warningObjectType").toString().equals("fan")) {
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.eq(IdxBizFanWarningRecord::getSequenceNbr, analysisResult.get("objectId")); lambda.eq(IdxBizFanWarningRecord::getSequenceNbr, analysisResult.get("objectId"));
idxBizFanWarningRecordService.update(lambda); idxBizFanWarningRecordService.update(lambda);
} else if (ObjectUtils.isNotEmpty(analysisResult) && analysisResult.get("warningObjectType").toString().equals("fan")) { } else if (ObjectUtils.isNotEmpty(analysisResult) && analysisResult.get("warningObjectType").toString().equals("pv")) {
LambdaUpdateWrapper<IdxBizPvWarningRecord> lambda = new LambdaUpdateWrapper<>(); LambdaUpdateWrapper<IdxBizPvWarningRecord> lambda = new LambdaUpdateWrapper<>();
lambda.set(IdxBizPvWarningRecord::getDisposotionState, "已处置"); lambda.set(IdxBizPvWarningRecord::getDisposotionState, "已处置");
lambda.set(IdxBizPvWarningRecord::getStatus, "1"); lambda.set(IdxBizPvWarningRecord::getStatus, "1");
......
...@@ -77,7 +77,7 @@ public class WarningRecordStatusMessage2 extends EmqxListener { ...@@ -77,7 +77,7 @@ public class WarningRecordStatusMessage2 extends EmqxListener {
public void jxIopUpdate(JSONObject analysisResult) { public void jxIopUpdate(JSONObject analysisResult) {
log.info("修改预警状态信息:{}", analysisResult); log.info("修改预警状态信息:{}", analysisResult);
if (ObjectUtils.isNotEmpty(analysisResult) && analysisResult.get("warningObjectType").toString().equals("pv")) { if (ObjectUtils.isNotEmpty(analysisResult) && analysisResult.get("warningObjectType").toString().equals("fan")) {
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");
...@@ -85,13 +85,13 @@ public class WarningRecordStatusMessage2 extends EmqxListener { ...@@ -85,13 +85,13 @@ public class WarningRecordStatusMessage2 extends EmqxListener {
List<String> traceIds = (List<String>) analysisResult.get("traceIds"); List<String> traceIds = (List<String>) analysisResult.get("traceIds");
lambda.in(IdxBizFanWarningRecord::getSequenceNbr, traceIds); lambda.in(IdxBizFanWarningRecord::getSequenceNbr, traceIds);
idxBizFanWarningRecordService.update(lambda); idxBizFanWarningRecordService.update(lambda);
} else if (ObjectUtils.isNotEmpty(analysisResult) && analysisResult.get("warningObjectType").toString().equals("fan")) { } else if (ObjectUtils.isNotEmpty(analysisResult) && analysisResult.get("warningObjectType").toString().equals("pv")) {
LambdaUpdateWrapper<IdxBizPvWarningRecord> lambda = new LambdaUpdateWrapper<>(); LambdaUpdateWrapper<IdxBizPvWarningRecord> lambda = new LambdaUpdateWrapper<>();
lambda.set(IdxBizPvWarningRecord::getDisposotionState, "已处置"); lambda.set(IdxBizPvWarningRecord::getDisposotionState, "已处置");
lambda.set(IdxBizPvWarningRecord::getStatus, "1"); lambda.set(IdxBizPvWarningRecord::getStatus, "1");
lambda.set(IdxBizPvWarningRecord::getDisposotionDate, new Date()); lambda.set(IdxBizPvWarningRecord::getDisposotionDate, new Date());
List<String> traceIds = (List<String>) analysisResult.get("traceIds"); List<String> traceIds = (List<String>) analysisResult.get("traceIds");
lambda.eq(IdxBizPvWarningRecord::getSequenceNbr, traceIds); lambda.in(IdxBizPvWarningRecord::getSequenceNbr, traceIds);
idxBizPvWarningRecordService.update(lambda); idxBizPvWarningRecordService.update(lambda);
} }
} }
......
...@@ -12,6 +12,7 @@ import com.yeejoin.amos.boot.module.jxiop.api.mapper.StationBasicMapper; ...@@ -12,6 +12,7 @@ import com.yeejoin.amos.boot.module.jxiop.api.mapper.StationBasicMapper;
import com.yeejoin.amos.boot.module.jxiop.biz.Enum.WarningNameEnum; import com.yeejoin.amos.boot.module.jxiop.biz.Enum.WarningNameEnum;
import com.yeejoin.amos.boot.module.jxiop.biz.entity.*; import com.yeejoin.amos.boot.module.jxiop.biz.entity.*;
import com.yeejoin.amos.boot.module.jxiop.biz.mapper2.*; import com.yeejoin.amos.boot.module.jxiop.biz.mapper2.*;
import lombok.extern.slf4j.Slf4j;
import org.eclipse.paho.client.mqttv3.MqttException; import org.eclipse.paho.client.mqttv3.MqttException;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
...@@ -28,6 +29,7 @@ import java.util.*; ...@@ -28,6 +29,7 @@ import java.util.*;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@EnableScheduling @EnableScheduling
@Service @Service
@Slf4j
public class HealthStatusIndicatorServiceImpl { public class HealthStatusIndicatorServiceImpl {
// @Value("${healthValue_Warn}") // @Value("${healthValue_Warn}")
...@@ -893,6 +895,7 @@ public class HealthStatusIndicatorServiceImpl { ...@@ -893,6 +895,7 @@ public class HealthStatusIndicatorServiceImpl {
*/ */
@Async @Async
public void fetchDataPv(List<IdxBizPvWarningRecord> idxBizPvWarningRecords) { public void fetchDataPv(List<IdxBizPvWarningRecord> idxBizPvWarningRecords) {
log.info("===开始触发风险预警模型===数量为:{}", idxBizPvWarningRecords.size());
idxBizPvWarningRecords.stream().forEach(idxBizPvWarningRecord -> { idxBizPvWarningRecords.stream().forEach(idxBizPvWarningRecord -> {
BizMessage bizMessage = new BizMessage(); BizMessage bizMessage = new BizMessage();
bizMessage.setIndexKey(INDEX_KEY_PV); bizMessage.setIndexKey(INDEX_KEY_PV);
...@@ -930,6 +933,7 @@ public class HealthStatusIndicatorServiceImpl { ...@@ -930,6 +933,7 @@ public class HealthStatusIndicatorServiceImpl {
*/ */
@Async @Async
public void fetchDataFan(List<IdxBizFanWarningRecord> idxBizFanWarningRecords) { public void fetchDataFan(List<IdxBizFanWarningRecord> idxBizFanWarningRecords) {
log.info("===开始触发风险预警模型===数量为:{}", idxBizFanWarningRecords.size());
idxBizFanWarningRecords.stream().forEach(idxBizFanWarningRecord -> { idxBizFanWarningRecords.stream().forEach(idxBizFanWarningRecord -> {
BizMessage bizMessage = new BizMessage(); BizMessage bizMessage = new BizMessage();
bizMessage.setIndexKey(String.format(INDEX_KEY_FAN, idxBizFanWarningRecord.getNumber())); bizMessage.setIndexKey(String.format(INDEX_KEY_FAN, idxBizFanWarningRecord.getNumber()));
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<select id="getHealthScoreInfo" resultType="java.math.BigDecimal"> <select id="getHealthScoreInfo" resultType="java.math.BigDecimal">
SELECT SELECT
avg( a.avgHealthIndex ) AS healthIndex round(avg( a.avgHealthIndex ), 2) AS healthIndex
FROM FROM
( (
SELECT SELECT
...@@ -57,7 +57,7 @@ ...@@ -57,7 +57,7 @@
<select id="getHealthScoreInfoByStation" resultType="java.math.BigDecimal"> <select id="getHealthScoreInfoByStation" resultType="java.math.BigDecimal">
SELECT SELECT
IFNULL( HEALTH_INDEX , 100 ) AS healthIndex round(IFNULL( HEALTH_INDEX , 100 ), 2) AS healthIndex
FROM FROM
${tableName} ${tableName}
<where> <where>
...@@ -211,7 +211,7 @@ ...@@ -211,7 +211,7 @@
WARNING_NAME WARNING_NAME
) a ) a
ORDER BY ORDER BY
a.allNum DESC a.allNum desc
</select> </select>
...@@ -307,7 +307,7 @@ ...@@ -307,7 +307,7 @@
warningName warningName
having pointName IS NOT NULL having pointName IS NOT NULL
AND pointName != '' AND pointName != ''
order by num desc order by num asc
</select> </select>
<select id="getAllEquipAlarmInfoAnalysisByArea" resultType="java.util.Map"> <select id="getAllEquipAlarmInfoAnalysisByArea" resultType="java.util.Map">
...@@ -349,7 +349,7 @@ ...@@ -349,7 +349,7 @@
WHERE WHERE
a.pointName IS NOT NULL a.pointName IS NOT NULL
AND a.pointName != '' AND a.pointName != ''
order by a.num desc order by a.num ASC
</select> </select>
<select id="getSubSystemInfo" resultType="java.util.Map"> <select id="getSubSystemInfo" resultType="java.util.Map">
......
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