Commit 9dcc751c authored by zhengjiangtao's avatar zhengjiangtao

fix bug

parent 3e5d6f74
......@@ -32,6 +32,11 @@ public class DeviceListener extends EmqxListener implements InitializingBean {
private static ObjectMapper mapper = new ObjectMapper();
//临界温度
private static final double CRITICAL_TEMPERATURE = 35;
@Autowired
private EmqKeeper emqKeeper;
......@@ -104,7 +109,8 @@ public class DeviceListener extends EmqxListener implements InitializingBean {
System.out.println("----shudu equipmentsPointId : "+ equipmentsPointId);
List<Long> riskFactorId = equipmentMapper.judgeEquipmentExists(equipmentsPointId);
Integer value = 0;
if ("35".equals(statusName)) {
if (Double.valueOf(statusName) >= CRITICAL_TEMPERATURE) {
value = DevicePointEnum.getValue("异常");
equipmentMapper.updateEquipmentPointStatus(value, queryEquipmentPoint.getId());
} else {
......@@ -112,6 +118,10 @@ public class DeviceListener extends EmqxListener implements InitializingBean {
equipmentMapper.updateEquipmentPointStatus(value, queryEquipmentPoint.getId());
}
System.out.println("----shudu riskFactorId : "+ riskFactorId);
for (int j = 0; j < riskFactorId.size(); j++) {
try {
riskModelRemoteClient.updateEquipmentAlarmData(riskFactorId.get(j),eqpName,value);
......
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