Commit 2d1523fb authored by tangwei's avatar tangwei

增加网管地址

parent 06bc2867
...@@ -44,5 +44,8 @@ public class PointSystem extends BaseEntity { ...@@ -44,5 +44,8 @@ public class PointSystem extends BaseEntity {
@ApiModelProperty(value = "kks码") @ApiModelProperty(value = "kks码")
@TableField("kks") @TableField("kks")
private String kks; private String kks;
@ApiModelProperty(value = "網管地址")
@TableField("gateway_id")
private String gatewayId;
} }
...@@ -9,6 +9,6 @@ package com.yeejoin.amos.api.alarm.service; ...@@ -9,6 +9,6 @@ package com.yeejoin.amos.api.alarm.service;
public interface IPointSystemService { public interface IPointSystemService {
//触发风险预警 //触发风险预警
public void sendWarning(String address, String value,String valueLabe); public void sendWarning(String address, String value,String valueLabe,String gatewayId);
} }
...@@ -57,7 +57,8 @@ public class PointSystemServiceImpl extends ServiceImpl<PointSystemMapper, Point ...@@ -57,7 +57,8 @@ public class PointSystemServiceImpl extends ServiceImpl<PointSystemMapper, Point
String address= messageObj.get("address").toString(); String address= messageObj.get("address").toString();
String value= messageObj.get("value").toString(); String value= messageObj.get("value").toString();
String valueLabe=messageObj.get("valueLabel").toString(); String valueLabe=messageObj.get("valueLabel").toString();
this.sendWarning(address, value, valueLabe); String gatewayId=messageObj.get("gatewayId").toString();
this.sendWarning(address, value, valueLabe,gatewayId);
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
...@@ -66,12 +67,13 @@ public class PointSystemServiceImpl extends ServiceImpl<PointSystemMapper, Point ...@@ -66,12 +67,13 @@ public class PointSystemServiceImpl extends ServiceImpl<PointSystemMapper, Point
@Override @Override
public void sendWarning(String address, String value,String valueLabe) { public void sendWarning(String address, String value,String valueLabe,String gatewayId) {
try { try {
//通过测点地址获取,和对应值 获取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); pointSystemWrapper.lambda().eq(PointSystem::getValue, value);
pointSystemWrapper.lambda().eq(PointSystem::getGatewayId, gatewayId);
PointSystem pointSystem = pointSystemMapper.selectOne(pointSystemWrapper); PointSystem pointSystem = pointSystemMapper.selectOne(pointSystemWrapper);
if (pointSystem == null) { if (pointSystem == null) {
throw new RuntimeException("获取kks码失败!"); throw new RuntimeException("获取kks码失败!");
......
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