Commit 2d1523fb authored by tangwei's avatar tangwei

增加网管地址

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