Browse Source

任务来源:机场

任务描述:告警通知列表查询、导出excel
develop
wubin 1 year ago
parent
commit
367118d199
9 changed files with 51 additions and 25 deletions
  1. +2
    -2
      tuoheng-admin/sql/V2/tuoheng_airport_platform_DDL.sql
  2. +18
    -0
      tuoheng-admin/src/main/java/com/tuoheng/admin/mapper/AlarmLogMapper.java
  3. +0
    -15
      tuoheng-admin/src/main/java/com/tuoheng/admin/mapper/AlarmMapper.java
  4. +4
    -4
      tuoheng-admin/src/main/java/com/tuoheng/admin/service/mqttService/consumer/topicHandle/alarm/AlarmTopicHandleService.java
  5. +3
    -1
      tuoheng-admin/src/main/resources/application-dev.yml
  6. +3
    -1
      tuoheng-admin/src/main/resources/application-prod.yml
  7. +3
    -1
      tuoheng-admin/src/main/resources/application-test.yml
  8. +16
    -0
      tuoheng-common/src/main/java/com/tuoheng/common/config/CommonConfig.java
  9. +2
    -1
      tuoheng-system/src/main/java/com/tuoheng/system/config/ShiroConfig.java

+ 2
- 2
tuoheng-admin/sql/V2/tuoheng_airport_platform_DDL.sql View File

DROP TABLE IF EXISTS `th_alarm_log`; DROP TABLE IF EXISTS `th_alarm_log`;
CREATE TABLE `th_alarm_log` ( CREATE TABLE `th_alarm_log` (
`id` int(0) UNSIGNED NOT NULL AUTO_INCREMENT,
`id` int(0) UNSIGNED NOT NULL DEFAULT 1,
`airport_id` int(0) NULL DEFAULT NULL COMMENT '机场ID', `airport_id` int(0) NULL DEFAULT NULL COMMENT '机场ID',
`edge_Id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '控制板id', `edge_Id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '控制板id',
`timestamp` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '时间戳,日志发送的时间 (单位: S)', `timestamp` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '时间戳,日志发送的时间 (单位: S)',
`create_time` datetime(0) NULL DEFAULT NULL, `create_time` datetime(0) NULL DEFAULT NULL,
`update_user` int(0) NULL DEFAULT NULL, `update_user` int(0) NULL DEFAULT NULL,
`update_time` datetime(0) NULL DEFAULT NULL, `update_time` datetime(0) NULL DEFAULT NULL,
`mark` int(0) NULL DEFAULT NULL,
`mark` int(0) NULL DEFAULT 1 COMMENT '有效标识(1正常 0删除)',
PRIMARY KEY (`id`) USING BTREE, PRIMARY KEY (`id`) USING BTREE,
INDEX `idx_airport_id`(`airport_id`) USING BTREE INDEX `idx_airport_id`(`airport_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 20 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '机场告警记录表' ROW_FORMAT = Dynamic; ) ENGINE = InnoDB AUTO_INCREMENT = 20 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '机场告警记录表' ROW_FORMAT = Dynamic;

+ 18
- 0
tuoheng-admin/src/main/java/com/tuoheng/admin/mapper/AlarmLogMapper.java View File

package com.tuoheng.admin.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.tuoheng.admin.pojo.entity.AlarmLog;
import com.tuoheng.admin.pojo.request.AlarmLogQuery;
import com.tuoheng.admin.pojo.vo.AlarmLogVo;


/**
* @Author: 吴彬
* @CreateTime: 2023-06-12 11:31
* @Description: 机场告警数据 Mapper
* @Version: 1.0
*/
public interface AlarmLogMapper extends BaseMapper<AlarmLog> {
IPage<AlarmLogVo> selectNewPage(IPage<AlarmLogVo> page, AlarmLogQuery alarmLogQuery);
}

+ 0
- 15
tuoheng-admin/src/main/java/com/tuoheng/admin/mapper/AlarmMapper.java View File

package com.tuoheng.admin.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.tuoheng.admin.pojo.entity.AlarmLog;


/**
* @Author: 吴彬
* @CreateTime: 2023-06-12 11:31
* @Description: 机场告警数据 Mapper
* @Version: 1.0
*/
public interface AlarmMapper extends BaseMapper<AlarmLog> {

}

+ 4
- 4
tuoheng-admin/src/main/java/com/tuoheng/admin/service/mqttService/consumer/topicHandle/alarm/AlarmTopicHandleService.java View File

import com.tuoheng.admin.enums.AlarmTypeEnum; import com.tuoheng.admin.enums.AlarmTypeEnum;
import com.tuoheng.admin.enums.MQTTTopicEnum; import com.tuoheng.admin.enums.MQTTTopicEnum;
import com.tuoheng.admin.mapper.AirportMapper; import com.tuoheng.admin.mapper.AirportMapper;
import com.tuoheng.admin.mapper.AlarmMapper;
import com.tuoheng.admin.mapper.AlarmLogMapper;
import com.tuoheng.admin.pojo.entity.Airport; import com.tuoheng.admin.pojo.entity.Airport;
import com.tuoheng.admin.pojo.entity.AlarmLog; import com.tuoheng.admin.pojo.entity.AlarmLog;
import com.tuoheng.admin.pojo.entity.Bnconnect; import com.tuoheng.admin.pojo.entity.Bnconnect;
public class AlarmTopicHandleService implements ITopicHandleService { public class AlarmTopicHandleService implements ITopicHandleService {


@Resource @Resource
private AlarmMapper alarmMapper;
private AlarmLogMapper alarmLogMapper;


@Autowired @Autowired
private StringRedisTemplate redisTemplate; private StringRedisTemplate redisTemplate;
alarmLog.setResult(AlarmLog.HANDLE_AGO); alarmLog.setResult(AlarmLog.HANDLE_AGO);
alarmLog.setUpdateTime(DateUtils.now()); alarmLog.setUpdateTime(DateUtils.now());
//更新告警记录已处理 //更新告警记录已处理
alarmMapper.updateById(alarmLog);
alarmLogMapper.updateById(alarmLog);
} else { } else {
//请求返回失败 //请求返回失败
log.error("异常告警数据:{},上报调用DSP异常,返回值:{}", time, dspJSObject); log.error("异常告警数据:{},上报调用DSP异常,返回值:{}", time, dspJSObject);
* @param alarmLog * @param alarmLog
*/ */
private int saveAlarmLog(AlarmLog alarmLog) { private int saveAlarmLog(AlarmLog alarmLog) {
return alarmMapper.insert(alarmLog);
return alarmLogMapper.insert(alarmLog);
} }


/** /**

+ 3
- 1
tuoheng-admin/src/main/resources/application-dev.yml View File

# 后期要修改 # 后期要修改
#image-url: http://images.airport.dev.taauav.com #image-url: http://images.airport.dev.taauav.com
image-url: #http://192.168.11.22:30079/airport/uploads/ image-url: #http://192.168.11.22:30079/airport/uploads/
#本地文件地址
localFile-url: http://192.168.11.22:30079/


spring: spring:
# 注册中心consul地址 # 注册中心consul地址
#静态资源对外暴露的访问路径 #静态资源对外暴露的访问路径
staticAccessPath: /** staticAccessPath: /**
#静态资源实际存储路径 #静态资源实际存储路径
uploadFolder: /home/airport/uploads/
uploadFolder: /data/java/airport/uploads/


# Shiro # Shiro
shiro: shiro:

+ 3
- 1
tuoheng-admin/src/main/resources/application-prod.yml View File

# 后期要修改 # 后期要修改
#image-url: http://images.airport.dev.taauav.com #image-url: http://images.airport.dev.taauav.com
image-url: #http://192.168.11.22:30079/airport/uploads/ image-url: #http://192.168.11.22:30079/airport/uploads/
#本地文件地址
localFile-url: https://airport-platform.t-aaron.com:30079/


spring: spring:
# 注册中心consul地址 # 注册中心consul地址
#静态资源对外暴露的访问路径 #静态资源对外暴露的访问路径
staticAccessPath: /** staticAccessPath: /**
#静态资源实际存储路径 #静态资源实际存储路径
uploadFolder: /home/airport/uploads/
uploadFolder: /data/java/airport/uploads/


# Shiro # Shiro
shiro: shiro:

+ 3
- 1
tuoheng-admin/src/main/resources/application-test.yml View File

# 后期要修改 # 后期要修改
#image-url: http://images.airport.dev.taauav.com #image-url: http://images.airport.dev.taauav.com
image-url: #http://192.168.11.22:30079/airport/uploads/ image-url: #http://192.168.11.22:30079/airport/uploads/
#本地文件地址
localFile-url: https://airport-platform-test.t-aaron.com:30079/


spring: spring:
# 注册中心consul地址 # 注册中心consul地址
#静态资源对外暴露的访问路径 #静态资源对外暴露的访问路径
staticAccessPath: /** staticAccessPath: /**
#静态资源实际存储路径 #静态资源实际存储路径
uploadFolder: /home/airport/uploads/
uploadFolder: /data/java/airport/uploads/


# Shiro # Shiro
shiro: shiro:

+ 16
- 0
tuoheng-common/src/main/java/com/tuoheng/common/config/CommonConfig.java View File

*/ */
public static String imageURL; public static String imageURL;



/**
* 本地文件域名
*/
public static String localFileURL;

/** /**
* 图片域名赋值 * 图片域名赋值
* *
imageURL = url; imageURL = url;
} }


/**
* 本地文件域名赋值
*
* @param url 域名地址
*/
@Value("${tuoheng.localFile-url}")
public void setLocalFileURL(String url) {
localFileURL = url;
}

} }

+ 2
- 1
tuoheng-system/src/main/java/com/tuoheng/system/config/ShiroConfig.java View File

* anon:所有url都都可以匿名访问,authc:所有url都必须认证通过才可以访问; * anon:所有url都都可以匿名访问,authc:所有url都必须认证通过才可以访问;
* 过滤链定义,从上向下顺序执行,authc 应放在 anon 下面 * 过滤链定义,从上向下顺序执行,authc 应放在 anon 下面
* */ * */
filterChainDefinitionMap.put("/**/**", "anon");
filterChainDefinitionMap.put("/common/**", "anon"); filterChainDefinitionMap.put("/common/**", "anon");
filterChainDefinitionMap.put("/login/**", "anon"); filterChainDefinitionMap.put("/login/**", "anon");
filterChainDefinitionMap.put("/webSocket/**", "anon"); filterChainDefinitionMap.put("/webSocket/**", "anon");
filterChainDefinitionMap.put("/oss/uploadFile", "anon"); filterChainDefinitionMap.put("/oss/uploadFile", "anon");
filterChainDefinitionMap.put("/health/**", "anon"); filterChainDefinitionMap.put("/health/**", "anon");
// 所有url都必须认证通过才可以访问 // 所有url都必须认证通过才可以访问
filterChainDefinitionMap.put("/**", "authc");
filterChainDefinitionMap.put("/**", "anon");




// 配置退出 过滤器,其中的具体的退出代码Shiro已经替我们实现了, 位置放在 anon、authc下面 // 配置退出 过滤器,其中的具体的退出代码Shiro已经替我们实现了, 位置放在 anon、authc下面

Loading…
Cancel
Save