Commit 5c934314 authored by 吴俊凯's avatar 吴俊凯

RPN值bug修改

parent 8790c862
...@@ -6,7 +6,6 @@ import com.google.common.collect.Lists; ...@@ -6,7 +6,6 @@ import com.google.common.collect.Lists;
import com.google.common.collect.Sets; import com.google.common.collect.Sets;
import com.yeejoin.amos.component.rule.RuleTrigger; import com.yeejoin.amos.component.rule.RuleTrigger;
import com.yeejoin.amos.fas.business.action.model.ContingencyRo; import com.yeejoin.amos.fas.business.action.model.ContingencyRo;
import com.yeejoin.amos.fas.business.action.model.FireEquimentDataRo;
import com.yeejoin.amos.fas.business.action.mq.WebMqttComponent; import com.yeejoin.amos.fas.business.action.mq.WebMqttComponent;
import com.yeejoin.amos.fas.business.action.mq.WebMqttSubscribe; import com.yeejoin.amos.fas.business.action.mq.WebMqttSubscribe;
import com.yeejoin.amos.fas.business.dao.mapper.*; import com.yeejoin.amos.fas.business.dao.mapper.*;
...@@ -27,7 +26,6 @@ import com.yeejoin.amos.fas.business.vo.Toke; ...@@ -27,7 +26,6 @@ import com.yeejoin.amos.fas.business.vo.Toke;
import com.yeejoin.amos.fas.business.vo.TopicEntityVo; import com.yeejoin.amos.fas.business.vo.TopicEntityVo;
import com.yeejoin.amos.fas.client.invoke.RsDataQueue; import com.yeejoin.amos.fas.client.invoke.RsDataQueue;
import com.yeejoin.amos.fas.common.enums.EquipmentRiskTypeEnum; import com.yeejoin.amos.fas.common.enums.EquipmentRiskTypeEnum;
import com.yeejoin.amos.fas.common.enums.View3dRefreshAreaEum;
import com.yeejoin.amos.fas.core.util.StringUtil; import com.yeejoin.amos.fas.core.util.StringUtil;
import com.yeejoin.amos.fas.dao.entity.*; import com.yeejoin.amos.fas.dao.entity.*;
import org.apache.commons.lang3.ArrayUtils; import org.apache.commons.lang3.ArrayUtils;
...@@ -42,6 +40,7 @@ import org.springframework.stereotype.Service; ...@@ -42,6 +40,7 @@ import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils; import org.springframework.util.CollectionUtils;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
import org.typroject.tyboot.core.foundation.context.RequestContext; import org.typroject.tyboot.core.foundation.context.RequestContext;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.*; import java.util.*;
import java.util.stream.Collectors; import java.util.stream.Collectors;
...@@ -113,7 +112,7 @@ public class HandlerMqttMessageImpl implements IEquipmentHandlerService { ...@@ -113,7 +112,7 @@ public class HandlerMqttMessageImpl implements IEquipmentHandlerService {
@Autowired @Autowired
private IEvaluationModelDao iEvaluationModelDao; private IEvaluationModelDao iEvaluationModelDao;
@Autowired @Autowired
private FmeaMapper fmeaMapper; private FmeaMapper fmeaMapper;
...@@ -140,6 +139,8 @@ public class HandlerMqttMessageImpl implements IEquipmentHandlerService { ...@@ -140,6 +139,8 @@ public class HandlerMqttMessageImpl implements IEquipmentHandlerService {
EquipmentSpecificForRiskVo equipmentSpecific = equipmentSpecificMapper.getOneById(eqSpecId); EquipmentSpecificForRiskVo equipmentSpecific = equipmentSpecificMapper.getOneById(eqSpecId);
// 三维屏指标状态推送 // 三维屏指标状态推送
String specificIndexType = equipmentSpecificIndex.getType(); String specificIndexType = equipmentSpecificIndex.getType();
//
String typeCode = equipmentSpecificIndex.getTypeCode();
if (nameKey !=null && nameKeys.contains(nameKey)) { if (nameKey !=null && nameKeys.contains(nameKey)) {
if (equipmentSpecific != null) { if (equipmentSpecific != null) {
equipmentSpecificIndex.setId(equipmentSpecific.getId()); equipmentSpecificIndex.setId(equipmentSpecific.getId());
...@@ -157,8 +158,8 @@ public class HandlerMqttMessageImpl implements IEquipmentHandlerService { ...@@ -157,8 +158,8 @@ public class HandlerMqttMessageImpl implements IEquipmentHandlerService {
deviceData.setId(String.valueOf(equipmentSpecific.getId())); deviceData.setId(String.valueOf(equipmentSpecific.getId()));
deviceData.setCode(equipmentSpecific.getCode()); deviceData.setCode(equipmentSpecific.getCode());
//设备告警处理逻辑 //设备告警处理逻辑
if (EquipmentRiskTypeEnum.HZGJ.getCode().equals(specificIndexType)) { if (EquipmentRiskTypeEnum.HZGJ.getCode().equals(typeCode)) {
log.info("(报警)Message type is: " + specificIndexType); log.info("(报警)Message typeCode is: " + typeCode);
/** /**
* 推送告警数据 * 推送告警数据
* 影响区域:消防安全=>火灾告警 * 影响区域:消防安全=>火灾告警
...@@ -168,9 +169,9 @@ public class HandlerMqttMessageImpl implements IEquipmentHandlerService { ...@@ -168,9 +169,9 @@ public class HandlerMqttMessageImpl implements IEquipmentHandlerService {
// 报警触发调用规则服务 // 报警触发调用规则服务
//注释自动触发预案 //注释自动触发预案
//executeDynamicPlan(deviceData, equipment, equipmentSpecific, toke,topicEntity.getRecordId()); //executeDynamicPlan(deviceData, equipment, equipmentSpecific, toke,topicEntity.getRecordId());
} else if (EquipmentRiskTypeEnum.GZ.getCode().equals(specificIndexType)) { } else if (EquipmentRiskTypeEnum.GZ.getCode().equals(typeCode)) {
// 设备故障处理逻辑 // 设备故障处理逻辑
log.info("(故障)Message type is: " +specificIndexType); log.info("(故障)Message typeCode is: " +typeCode);
final String stateTrue = "true"; final String stateTrue = "true";
final String stateFalse = "false"; final String stateFalse = "false";
String state = equipmentSpecificIndex.getValue(); String state = equipmentSpecificIndex.getValue();
...@@ -197,7 +198,7 @@ public class HandlerMqttMessageImpl implements IEquipmentHandlerService { ...@@ -197,7 +198,7 @@ public class HandlerMqttMessageImpl implements IEquipmentHandlerService {
fireEquipRuleMessagePush(deviceData, toke); fireEquipRuleMessagePush(deviceData, toke);
} }
} }
} else { } else {
// 监测数据逻辑 // 监测数据逻辑
log.info("(监测)Message type is: " + specificIndexType); log.info("(监测)Message type is: " + specificIndexType);
...@@ -255,7 +256,7 @@ public class HandlerMqttMessageImpl implements IEquipmentHandlerService { ...@@ -255,7 +256,7 @@ public class HandlerMqttMessageImpl implements IEquipmentHandlerService {
} }
@Override @Override
public void subscribeTopic() { public void subscribeTopic() {
// 若登录系统则订阅装备数据 // 若登录系统则订阅装备数据
...@@ -305,7 +306,7 @@ public class HandlerMqttMessageImpl implements IEquipmentHandlerService { ...@@ -305,7 +306,7 @@ public class HandlerMqttMessageImpl implements IEquipmentHandlerService {
* @Date 2020/11/16 15:25 * @Date 2020/11/16 15:25
*/ */
private void notifyAlarm(EquipmentSpecificIndexVo equipmentSpecificIndex, int state) { private void notifyAlarm(EquipmentSpecificIndexVo equipmentSpecificIndex, int state) {
List<FmeaEquipmentPoint> fmeaEquipmentPoints = fmeaEquipmentPointMapper.listByEquipmentPointId(equipmentSpecificIndex.getId()); List<FmeaEquipmentPoint> fmeaEquipmentPoints = fmeaEquipmentPointMapper.listByEquipmentPointId(equipmentSpecificIndex.getEquipmentIndexId());
Set<Long> fmeaIds = Sets.newHashSet(); Set<Long> fmeaIds = Sets.newHashSet();
List<Long> ids = Lists.newArrayList(); List<Long> ids = Lists.newArrayList();
fmeaEquipmentPoints.forEach(fmeaEquipmentPoint -> { fmeaEquipmentPoints.forEach(fmeaEquipmentPoint -> {
...@@ -432,7 +433,7 @@ public class HandlerMqttMessageImpl implements IEquipmentHandlerService { ...@@ -432,7 +433,7 @@ public class HandlerMqttMessageImpl implements IEquipmentHandlerService {
} }
contingencyRo.setTelemetryMap(telemetryMap); contingencyRo.setTelemetryMap(telemetryMap);
log.debug("开始调用规则"); log.debug("开始调用规则 参数 contingencyRo{},reservePlan{},equipmentNames"+contingencyRo.toString()+","+equipment.getReservePlan()+","+ ArrayUtils.toArray(equipment.getName()));
Object result = ruleTrigger.publish(contingencyRo, equipment.getReservePlan(), ArrayUtils.toArray(equipment.getName())); Object result = ruleTrigger.publish(contingencyRo, equipment.getReservePlan(), ArrayUtils.toArray(equipment.getName()));
log.debug("规则调用返回==",result); log.debug("规则调用返回==",result);
......
...@@ -28,7 +28,7 @@ public class EquipmentSpecificIndexVo { ...@@ -28,7 +28,7 @@ public class EquipmentSpecificIndexVo {
private String name; private String name;
private String equipmentIndexName; private String equipmentIndexName;
private String equipmentIndexUnitName; private String equipmentIndexUnitName;
// 性能指标name key // 性能指标name key
...@@ -43,6 +43,16 @@ public class EquipmentSpecificIndexVo { ...@@ -43,6 +43,16 @@ public class EquipmentSpecificIndexVo {
// 订阅类型 // 订阅类型
private String type; private String type;
private String typeCode;
public String getTypeCode() {
return typeCode;
}
public void setTypeCode(String typeCode) {
this.typeCode = typeCode;
}
public void setId(long id) { public void setId(long id) {
this.id = id; this.id = id;
} }
......
...@@ -101,12 +101,16 @@ ...@@ -101,12 +101,16 @@
</select> </select>
<select id="listByEquipmentPointId" resultType="com.yeejoin.amos.fas.dao.entity.FmeaEquipmentPoint"> <select id="listByEquipmentPointId" resultType="com.yeejoin.amos.fas.dao.entity.FmeaEquipmentPoint">
select SELECT
id,fmea_id as fmeaId,equipment_point_id as equipmentPointId,state point.id,
from point.fmea_id AS fmeaId,
f_fmea_equipment_point point.equipment_point_id AS equipmentPointId,
where point.state
equipment_point_id = #{equipmentPointId} FROM
f_fmea_equipment_point point
LEFT JOIN wl_equipment_specific_index equipment ON equipment.id = point.equipment_point_id
where
equipment.equipment_index_id = #{equipmentPointId}
</select> </select>
<select id="listEquipmentPoint" resultType="java.util.Map"> <select id="listEquipmentPoint" 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