Compare commits

6 Commits

Author SHA1 Message Date
tianyongbao
3600f89289 fix: prod分支,电话通知不开启。 2026-04-05 00:12:12 +08:00
tianyongbao
7e7ed5ed6d fix: 配置文件加上电话通知报警是否开启。 2026-04-05 00:10:55 +08:00
tianyongbao
5a8344426b fix: 新增电话告警统一配置,是否开启。 2026-04-05 00:10:50 +08:00
tianyongbao
44b2336bd1 fix: 生产环境配置文件修改,TD使用智聪app环境修改。 2026-04-04 23:26:11 +08:00
tianyongbao
98f6ef52d8 fix: 生产环境配置文件修改,redis修改。 2026-04-04 22:29:37 +08:00
tianyongbao
20719de0de fix: 生产环境配置文件修改。 2026-04-04 21:26:07 +08:00
3 changed files with 35 additions and 9 deletions

View File

@@ -51,9 +51,9 @@ spring:
# username: root
# password: root
driverClassName: org.postgresql.Driver
url: jdbc:postgresql://81.70.89.108:15432/fishery_dev?useUnicode=true&characterEncoding=utf8&useSSL=true&autoReconnect=true&reWriteBatchedInserts=true
url: jdbc:postgresql://47.102.210.182:15432/fishery_prod?useUnicode=true&characterEncoding=utf8&useSSL=true&autoReconnect=true&reWriteBatchedInserts=true
username: postgres
password: intc@123987
password: htYkSuRn7Gb*pbFn
# 从库数据源 - TDengine
taos:
lazy: false
@@ -106,13 +106,13 @@ spring:
spring.data:
redis:
# 地址
host: 81.70.89.108
host: 47.102.210.182
# 端口默认为6379
port: 26379
# 数据库索引
database: 9
# redis 密码必须配置
password: bbd4b56e5d3f
password: htYkSuRn7Gb*pbFn
# 连接超时时间
timeout: 10s
# 是否开启ssl
@@ -245,6 +245,8 @@ aliyun:
call-success-suppress-hours: 2
# 设备离线告警延迟触发时间(分钟),设备离线超过此时间后才发送告警
offline-warn-delay-minutes: 6
# 是否启用报警电话通知(全局开关,关闭后所有类型的报警都不会触发电话通知)
call-notice-enabled: false
# AMQP 服务端订阅配置(使用数据同步的 AppKey + AppSecret
amqp:
# 是否启用
@@ -258,7 +260,7 @@ aliyun:
# 消费组 ID按照官方文档应该与数据同步 AppKey 相同)
consumer-group-id: 334224409
# 客户端 ID建议使用机器 UUID、MAC 地址等唯一标识)
client-id: fishery-backend-001
client-id: fishery-backend-prod
# 连接超时时间(毫秒)
connection-timeout: 80000
# 是否自动重连
@@ -418,6 +420,6 @@ wx:
# 支付回调通知配置
pay-notify:
# 支付回调通知URL需根据实际域名配置
notify-url: "https://api.yuceyun.cn/fishery-api/weixin/pay_notify"
notify-url: "https://api.yuceyun.cn/prod-api/weixin/pay_notify"
# 微信商户号与上面wx.pay.mch-id保持一致
mch-id: "1671289865"

View File

@@ -101,6 +101,13 @@ public class AliyunIotProperties {
*/
private int saturabilityWarnHours = 8;
/**
* 是否启用报警电话通知
* 全局开关,关闭后所有类型的报警都不会触发电话通知
* 默认开启
*/
private boolean callNoticeEnabled = true;
@Data
public static class VmsMnsConfig {
/**

View File

@@ -570,7 +570,7 @@ public class DeviceDataHandler {
}
// 仅对开启了电话通知开关的告警触发电话通知MessageWarn 由通知方法内部插入)
if (!callWarnList.isEmpty()) {
if (!callWarnList.isEmpty() && aliyunIotProperties.isCallNoticeEnabled()) {
triggerAlarmNotification(device, alarmMessage.toString(), sensorData, callWarnList);
}
}
@@ -903,6 +903,11 @@ public class DeviceDataHandler {
* @param deviceName 设备名称serialNum
*/
public void triggerOfflineAlarm(String deviceName) {
// 全局电话通知开关检查
if (!aliyunIotProperties.isCallNoticeEnabled()) {
log.debug("[离线告警] 电话通知已全局关闭,跳过: {}", deviceName);
return;
}
try {
Device device = deviceMapper.selectOne(
new com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper<Device>()
@@ -1026,6 +1031,11 @@ public class DeviceDataHandler {
* @param deviceName 设备名称serialNum
*/
public void triggerSaturaHighAlarm(String deviceName) {
// 全局电话通知开关检查
if (!aliyunIotProperties.isCallNoticeEnabled()) {
log.debug("[饱和度告警] 电话通知已全局关闭,跳过: {}", deviceName);
return;
}
try {
Device device = deviceMapper.selectOne(
new com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper<Device>()
@@ -1151,6 +1161,11 @@ public class DeviceDataHandler {
* @param params 事件参数
*/
private void triggerDeviceErrorAlarm(String deviceName, JSONObject params) {
// 全局电话通知开关检查
if (!aliyunIotProperties.isCallNoticeEnabled()) {
log.debug("[设备故障] 电话通知已全局关闭,跳过: {}", deviceName);
return;
}
try {
Device device = deviceMapper.selectOne(
new com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper<Device>()
@@ -1500,10 +1515,12 @@ public class DeviceDataHandler {
if (userId != null) {
MessageWarn warn = createMessageWarn(deviceId, userId, pondName, title, WARN_TYPE_DISSOLVED_OXYGEN, message);
messageWarnMapper.insert(warn);
// 创建电话通知记录
// 创建电话通知记录(全局开关控制)
if (aliyunIotProperties.isCallNoticeEnabled()) {
createCallNotices(device, pondName, warn);
}
}
}
// 写入 DeviceErrorCode 数据库记录
DeviceErrorCode data = new DeviceErrorCode();