Commit 0e514a00 authored by chenzhao's avatar chenzhao

修改point_system查询规则

parent 2c773676
...@@ -22,15 +22,21 @@ public class AlarmKafkaConsumer { ...@@ -22,15 +22,21 @@ public class AlarmKafkaConsumer {
PointSystemServiceImpl pointSystemServiceImpl; PointSystemServiceImpl pointSystemServiceImpl;
//消费者来处理消息 //消费者来处理消息
@KafkaListener(id="user1" , topics ={"${kafka.equipment.alarm}"}) @KafkaListener(id="alarmInfo" , topics ={"${kafka.equipment.alarm}"})
public void message1( String record, Acknowledgment ack){ public void message1( String record, Acknowledgment ack){
// 处理业务 // 处理业务
String date=record; String date=record;
System.out.println("消息进来了" +record);
//异步触发预警 //异步触发预警
pointSystemServiceImpl.sendWarningAsync(date); pointSystemServiceImpl.sendWarningAsync(date);
//手动提交 //手动提交
ack.acknowledge(); ack.acknowledge();
}
@KafkaListener(id="user2" , topics ={"${kafka.equipment.test}"})
public void message2( String record, Acknowledgment ack){
String date=record;
System.out.println("消息进来了 8888888888888888888888");
} }
......
...@@ -99,12 +99,18 @@ public class PointSystemServiceImpl extends ServiceImpl<PointSystemMapper, Point ...@@ -99,12 +99,18 @@ public class PointSystemServiceImpl extends ServiceImpl<PointSystemMapper, Point
//通过测点地址获取,和对应值 获取kks //通过测点地址获取,和对应值 获取kks
QueryWrapper<PointSystem> pointSystemWrapper = new QueryWrapper<>(); QueryWrapper<PointSystem> pointSystemWrapper = new QueryWrapper<>();
pointSystemWrapper.lambda().eq(PointSystem::getAddress, address); pointSystemWrapper.lambda().eq(PointSystem::getAddress, address);
pointSystemWrapper.lambda().eq(PointSystem::getValue, value); if(!value.equals("false") && !value.equals("true")){
pointSystemWrapper.lambda().eq(PointSystem::getValue, value);
}
pointSystemWrapper.lambda().eq(PointSystem::getGatewayId, gatewayId); pointSystemWrapper.lambda().eq(PointSystem::getGatewayId, gatewayId);
PointSystem pointSystem = pointSystemMapper.selectOne(pointSystemWrapper); List<PointSystem> pointSystems = pointSystemMapper.selectList(pointSystemWrapper);
if (pointSystem == null) { if (pointSystems == null || pointSystems.size() < 1 ) {
throw new RuntimeException("获取kks码失败!"); throw new RuntimeException("获取kks码失败!");
} }
PointSystem pointSystem = pointSystems.get(0);
if (pointSystem.getType().equals("遥信")){
return;
}
//调用获取设备相关信息 //调用获取设备相关信息
Map<String, String> maps = new HashMap<>(); Map<String, String> maps = new HashMap<>();
maps.put("type", "equipinfo"); maps.put("type", "equipinfo");
......
...@@ -53,7 +53,8 @@ spring.kafka.producer.value-serializer=org.apache.kafka.common.serialization.Str ...@@ -53,7 +53,8 @@ spring.kafka.producer.value-serializer=org.apache.kafka.common.serialization.Str
kafka.equipment.alarm=EQUIPMENT_ALARM88 kafka.equipment.alarm=EQUIPMENT_ALARM
kafka.equipment.test=test88888
#电站对接第三方查询设备kks码 #电站对接第三方查询设备kks码
power.station.url=http://139.9.169.123:5024/prod-api/fdgl/process/DataInterface power.station.url=http://139.9.169.123:5024/prod-api/fdgl/process/DataInterface
......
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