Commit ecf04911 authored by wujiang's avatar wujiang

提交代码

parent 562dacfa
...@@ -85,6 +85,6 @@ public class EquipmentSpecificIndex { ...@@ -85,6 +85,6 @@ public class EquipmentSpecificIndex {
@TableField("topic") @TableField("topic")
private String topic; private String topic;
@TableField("group") @TableField("`group`")
private String group; private String group;
} }
...@@ -38,11 +38,11 @@ public class AlarmKafkaConsumer { ...@@ -38,11 +38,11 @@ public class AlarmKafkaConsumer {
ack.acknowledge(); ack.acknowledge();
} }
@KafkaListener(id = "alarmInfo2", topics = { "${kafka.equipment.test}" }) // @KafkaListener(id = "alarmInfo2", topics = { "${kafka.equipment.test}" })
public void message2(String record, Acknowledgment ack) { // public void message2(String record, Acknowledgment ack) {
String date = record; // String date = record;
System.out.println("收到告警信息" + date); // System.out.println("收到告警信息" + date);
} // }
// public void message1( ConsumerRecord<?, ?> record, Acknowledgment ack){ // public void message1( ConsumerRecord<?, ?> record, Acknowledgment ack){
// // 消费的哪个topic、partition的消息,打印出消息内容 // // 消费的哪个topic、partition的消息,打印出消息内容
......
...@@ -138,7 +138,7 @@ public class PointSystemServiceImpl extends ServiceImpl<PointSystemMapper, Point ...@@ -138,7 +138,7 @@ public class PointSystemServiceImpl extends ServiceImpl<PointSystemMapper, Point
@Override @Override
public void sendWarning(String address, String value, String valueLabe, String gatewayId, String isAlarm) { public void sendWarning(String address, String value, String valueLabe, String gatewayId, String isAlarm) {
// 对应 equipment库的wl_equipment_specific_index_alarm_dic表 // 对应 equipment库的wl_equipment_specific_index_alarm_dic表
String[] s = { "1", "7", "9" }; String[] s = { "1", "7", "9"};
// 如果不满足择返回 // 如果不满足择返回
if (!Arrays.asList(s).contains(isAlarm)) { if (!Arrays.asList(s).contains(isAlarm)) {
//System.out.println("不满足告警类型: " + isAlarm); //System.out.println("不满足告警类型: " + isAlarm);
...@@ -155,6 +155,10 @@ public class PointSystemServiceImpl extends ServiceImpl<PointSystemMapper, Point ...@@ -155,6 +155,10 @@ public class PointSystemServiceImpl extends ServiceImpl<PointSystemMapper, Point
if (!value.equals("false") && !value.equals("true")) { if (!value.equals("false") && !value.equals("true")) {
pointSystemWrapper.lambda().eq(PointSystem::getValue, value); pointSystemWrapper.lambda().eq(PointSystem::getValue, value);
} }
// if(!gatewayId.equals("1668801435891929089"))
// {
// System.out.println(1);
// }
pointSystemWrapper.lambda().eq(PointSystem::getGatewayId, gatewayId); pointSystemWrapper.lambda().eq(PointSystem::getGatewayId, gatewayId);
List<PointSystem> pointSystems = pointSystemMapper.selectList(pointSystemWrapper); List<PointSystem> pointSystems = pointSystemMapper.selectList(pointSystemWrapper);
if (pointSystems == null || pointSystems.size() < 1) { if (pointSystems == null || pointSystems.size() < 1) {
...@@ -214,7 +218,7 @@ public class PointSystemServiceImpl extends ServiceImpl<PointSystemMapper, Point ...@@ -214,7 +218,7 @@ public class PointSystemServiceImpl extends ServiceImpl<PointSystemMapper, Point
if (warningDto != null) { if (warningDto != null) {
emqKeeper.getMqttClient().publish(STATIONWARNING, JSON.toJSONString(warningDto).getBytes(), 0, false); emqKeeper.getMqttClient().publish(STATIONWARNING, JSON.toJSONString(warningDto).getBytes(), 0, false);
//System.out.println("发送预警成功: " + JSON.toJSONString(warningDto)); //System.out.println("发送预警成功: " + JSON.toJSONString(warningDto));
logger.info("发送预警成功"); System.out.println("发送预警成功");
} }
} catch (Exception e) { } catch (Exception e) {
//e.printStackTrace(); //e.printStackTrace();
...@@ -240,10 +244,21 @@ public class PointSystemServiceImpl extends ServiceImpl<PointSystemMapper, Point ...@@ -240,10 +244,21 @@ public class PointSystemServiceImpl extends ServiceImpl<PointSystemMapper, Point
.append(pointSystem.getFunctionNum()); .append(pointSystem.getFunctionNum());
} }
EquipmentSpecificIndex esi= null;
if(redisUtil.get(pointSystem.getGatewayId()+"#"+pointSystem.getAddress())!=null)
{
String s = (String) redisUtil.get(pointSystem.getGatewayId()+"#"+pointSystem.getAddress());
esi = JSONObject.parseObject(s,EquipmentSpecificIndex.class);
}
else
{
QueryWrapper<EquipmentSpecificIndex> indexWrapper = new QueryWrapper<>(); QueryWrapper<EquipmentSpecificIndex> indexWrapper = new QueryWrapper<>();
indexWrapper.lambda().eq(EquipmentSpecificIndex::getIndexAddress, pointSystem.getAddress()); indexWrapper.lambda().eq(EquipmentSpecificIndex::getIndexAddress, pointSystem.getAddress());
indexWrapper.lambda().eq(EquipmentSpecificIndex::getGatewayId, pointSystem.getGatewayId()); indexWrapper.lambda().eq(EquipmentSpecificIndex::getGatewayId, pointSystem.getGatewayId());
EquipmentSpecificIndex esi = equipmentSpecificIndexMapper.selectOne(indexWrapper); esi = equipmentSpecificIndexMapper.selectOne(indexWrapper);
redisUtil.set(pointSystem.getGatewayId()+"#"+pointSystem.getAddress(),JSONObject.toJSONString(esi));
}
String indexValue = null; String indexValue = null;
// 获取告警值 // 获取告警值
if ("遥信".equals(pointSystem.getType())) { if ("遥信".equals(pointSystem.getType())) {
......
...@@ -40,8 +40,8 @@ power.station.warning=104/data/analysis ...@@ -40,8 +40,8 @@ power.station.warning=104/data/analysis
#104发送告警间隔时间 #104发送告警间隔时间
warning.wait.time=100 warning.wait.time=100
#104缓存预警过滤 #104缓存预警过滤
warning.redis.use=false warning.redis.use=true
#104缓存预警过滤过期时间单位秒 #104缓存预警过滤过期时间单位秒
warning.redis.limit.time=3600 warning.redis.limit.time=3600
#104升压站预警发送 #104升压站预警发送
warning.SYZ=false warning.SYZ=true
\ No newline at end of file \ No newline at end of file
...@@ -231,7 +231,6 @@ public class MonitorServiceImpl implements MonitorService { ...@@ -231,7 +231,6 @@ public class MonitorServiceImpl implements MonitorService {
} }
public Map<String, Object> gettimedateyfd() { public Map<String, Object> gettimedateyfd() {
String requestUrl = budunBaseURL + "?" + Constants.get_month_generation_trend_url; String requestUrl = budunBaseURL + "?" + Constants.get_month_generation_trend_url;
List<String> list = new ArrayList<>(); List<String> list = new ArrayList<>();
List<Double> listData = new ArrayList<>(); List<Double> listData = new ArrayList<>();
......
...@@ -16,6 +16,11 @@ ...@@ -16,6 +16,11 @@
</properties> </properties>
<dependencies> <dependencies>
<dependency> <dependency>
<groupId>com.icbc.tool</groupId>
<artifactId>SM2</artifactId>
<version>1.0</version>
</dependency>
<dependency>
<groupId>com.amosframework.boot</groupId> <groupId>com.amosframework.boot</groupId>
<artifactId>amos-boot-module-common-biz</artifactId> <artifactId>amos-boot-module-common-biz</artifactId>
<version>${amos-biz-boot.version}</version> <version>${amos-biz-boot.version}</version>
...@@ -49,11 +54,11 @@ ...@@ -49,11 +54,11 @@
<version>5.7.22</version> <version>5.7.22</version>
</dependency> </dependency>
<!-- <dependency> <dependency>
<groupId>org.bouncycastle</groupId> <groupId>org.bouncycastle</groupId>
<artifactId>bcprov-jdk15to18</artifactId> <artifactId>bcprov-jdk15to18</artifactId>
<version>1.69</version> <version>1.69</version>
</dependency>--> </dependency>
<!-- <dependency>--> <!-- <dependency>-->
<!-- <groupId>org.influxdb</groupId>--> <!-- <groupId>org.influxdb</groupId>-->
<!-- <artifactId>influxdb-java</artifactId>--> <!-- <artifactId>influxdb-java</artifactId>-->
...@@ -71,7 +76,27 @@ ...@@ -71,7 +76,27 @@
<artifactId>taos-jdbcdriver</artifactId> <artifactId>taos-jdbcdriver</artifactId>
<version>3.2.4</version> <version>3.2.4</version>
</dependency> </dependency>
<!--<dependency>
<groupId>com.icbc.tool</groupId>
<artifactId>SM2</artifactId>
<version>1.0</version>
<scope>compile</scope>
</dependency>-->
</dependencies>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcprov-jdk15on</artifactId>
<version>1.70</version>
</dependency>
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcpkix-jdk15on</artifactId>
<version>1.70</version>
</dependency>
</dependencies> </dependencies>
</dependencyManagement>
<build> <build>
<plugins> <plugins>
<plugin> <plugin>
......
...@@ -168,4 +168,4 @@ amos.system.user.product=AMOS_STUDIO_WEB ...@@ -168,4 +168,4 @@ amos.system.user.product=AMOS_STUDIO_WEB
core.feign.url=http://192.168.0.46:10005 core.feign.url=http://192.168.0.46:10005
budun.baseurl=http://192.168.0.50:8000/screen_api budun.baseurl=https://jcxt.ruioutech.com:8030/screen_api
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