Commit 3dcf3e19 authored by zhengjiangtao's avatar zhengjiangtao

增加调用风险接口的eqName

parent b3b0d42a
......@@ -74,6 +74,7 @@ public class BlueprintListener extends EmqxListener implements InitializingBean
logger.error(">>>>>>>>>>>>>>>>>jsonStr",jsonStr);
JSONObject parseObject = JSON.parseObject(jsonStr);
Long eqpId = parseObject.getLong("eqpId");
String eqpName = parseObject.getString("eqpName");
JSONArray jsonArray = parseObject.getJSONArray("metricDatas");
if (ObjectUtils.isEmpty(jsonArray)) {
return;
......@@ -103,7 +104,7 @@ public class BlueprintListener extends EmqxListener implements InitializingBean
equipmentMapper.updateEquipmentPointStatus(value, queryEquipmentPoint.getId());
try {
for (int j = 0; j < riskFactorId.size(); j++) {
riskModelRemoteClient.updateEquipmentAlarmData(riskFactorId.get(j));
riskModelRemoteClient.updateEquipmentAlarmData(riskFactorId.get(j),eqpName);
}
} catch (InnerInvokException e1) {
logger.error("update rpn fail " + e1.getMessage());
......
......@@ -77,6 +77,7 @@ public class DeviceListener extends EmqxListener implements InitializingBean {
//logger.info("----shidumqtt received sucess",parseObject);
System.out.println("----shidumqtt received sucess :"+ parseObject);
Long eqpId = parseObject.getLong("eqpId");
String eqpName = parseObject.getString("eqpName");
JSONArray jsonArray = parseObject.getJSONArray("metricDatas");
if (ObjectUtils.isEmpty(jsonArray)) {
return;
......@@ -112,7 +113,7 @@ public class DeviceListener extends EmqxListener implements InitializingBean {
System.out.println("----shudu riskFactorId : "+ riskFactorId);
for (int j = 0; j < riskFactorId.size(); j++) {
try {
riskModelRemoteClient.updateEquipmentAlarmData(riskFactorId.get(j));
riskModelRemoteClient.updateEquipmentAlarmData(riskFactorId.get(j),eqpName);
System.out.println("----udpate riskFactor sucess");
} catch (InnerInvokException e1) {
logger.error("update rpn fail " + e1.getMessage());
......@@ -135,7 +136,7 @@ public class DeviceListener extends EmqxListener implements InitializingBean {
try {
for (int j = 0; j < riskFactorId.size(); j++) {
System.out.println("----shudu riskFactorId : "+ riskFactorId);
riskModelRemoteClient.updateEquipmentAlarmData(riskFactorId.get(j));
riskModelRemoteClient.updateEquipmentAlarmData(riskFactorId.get(j),eqpName);
System.out.println("----udpate riskFactor sucess");
}
} catch (InnerInvokException e1) {
......
......@@ -191,7 +191,7 @@ public class EquipmentListener extends EmqxListener implements InitializingBean
//拓扑闪烁
topographyAlarm(sourceId, statusByName);
// 触发风险合格不合格
riskAlarm(eqpId, remark, statusName);
riskAlarm(eqpId, remark, statusName,eqpName);
}
}
}
......@@ -213,7 +213,7 @@ public class EquipmentListener extends EmqxListener implements InitializingBean
}
}
private Integer riskAlarm(Long eqpId, String remark, String statusName) {
private Integer riskAlarm(Long eqpId, String remark, String statusName,String eqpName) {
int statusByName = 0;
EquipmentQualityVo queryEquipmentPoint = equipmentMapper.queryEquipmentPoint(eqpId, remark);
if (!ObjectUtils.isEmpty(queryEquipmentPoint)) {
......@@ -231,7 +231,7 @@ public class EquipmentListener extends EmqxListener implements InitializingBean
// 修改rpn值
for (int j = 0; j < riskFactorId.size(); j++) {
try {
riskModelRemoteClient.updateEquipmentAlarmData(riskFactorId.get(j));
riskModelRemoteClient.updateEquipmentAlarmData(riskFactorId.get(j),eqpName);
System.out.println("----udpate riskFactor sucess");
} catch (InnerInvokException e1) {
logger.error("update rpn fail " + e1.getMessage());
......
......@@ -188,7 +188,7 @@ public class SelfSupportListener extends EmqxListener implements InitializingBea
//修改rpn值
for (int j = 0; j < riskFactorId.size(); j++) {
try {
riskModelRemoteClient.updateEquipmentAlarmData(riskFactorId.get(j));
riskModelRemoteClient.updateEquipmentAlarmData(riskFactorId.get(j),eqpName);
System.out.println("----udpate riskFactor sucess");
} catch (InnerInvokException e1) {
logger.error("update rpn fail " + e1.getMessage());
......
......@@ -16,11 +16,11 @@ import org.springframework.web.bind.annotation.RequestParam;
public interface RiskModelRemoteClient {
/**
* 修改rpn值
*/
@RequestMapping(value = "api/risksource/update/fireqeuiment/sod", method = RequestMethod.GET, consumes="application/json" )
CommonResponse updateEquipmentAlarmData(@RequestParam(value = "riskFactorID") Long riskFactorID) throws InnerInvokException;
* 修改rpn值
*/
@RequestMapping(value = "api/risksource/update/fireqeuiment/sod", method = RequestMethod.GET, consumes = "application/json")
CommonResponse updateEquipmentAlarmData(@RequestParam(value = "riskFactorID") Long riskFactorID,
@RequestParam("equipmentName") String equipmentName) throws InnerInvokException;
/**
* 根据风险因素id查询巡检点和指标项目列表
......
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