Commit ecf04911 authored by wujiang's avatar wujiang

提交代码

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