Przeglądaj źródła

任务来源:机场

任务描述:运行日志、告警通知添加租户字段
develop
wubin 1 rok temu
rodzic
commit
69230169af
8 zmienionych plików z 26 dodań i 0 usunięć
  1. +1
    -0
      tuoheng-admin/sql/V2/tuoheng_airport_platform_DDL.sql
  2. +4
    -0
      tuoheng-admin/src/main/java/com/tuoheng/admin/controller/airportlog/AirportLogController.java
  3. +4
    -0
      tuoheng-admin/src/main/java/com/tuoheng/admin/controller/alarmLog/AlarmLogController.java
  4. +5
    -0
      tuoheng-admin/src/main/java/com/tuoheng/admin/pojo/request/AirportLogQuery.java
  5. +5
    -0
      tuoheng-admin/src/main/java/com/tuoheng/admin/pojo/request/AlarmLogQuery.java
  6. +1
    -0
      tuoheng-admin/src/main/java/com/tuoheng/admin/service/mqttService/consumer/topicHandle/alarm/AlarmTopicHandleService.java
  7. +3
    -0
      tuoheng-admin/src/main/resources/mapper/AirportLogMapper.xml
  8. +3
    -0
      tuoheng-admin/src/main/resources/mapper/AlarmLogMapper.xml

+ 1
- 0
tuoheng-admin/sql/V2/tuoheng_airport_platform_DDL.sql Wyświetl plik

@@ -1,6 +1,7 @@
DROP TABLE IF EXISTS `th_alarm_log`;
CREATE TABLE `th_alarm_log` (
`id` int(0) UNSIGNED NOT NULL DEFAULT 1,
`tenant_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',
`timestamp` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '时间戳,日志发送的时间 (单位: S)',

+ 4
- 0
tuoheng-admin/src/main/java/com/tuoheng/admin/controller/airportlog/AirportLogController.java Wyświetl plik

@@ -39,6 +39,8 @@ public class AirportLogController extends BaseController {
*/
@GetMapping("/index")
public JsonResult index(@Valid AirportLogQuery airportlogQuery) {
//TODO 获取当前登录用户所在的租户
airportlogQuery.setTenantId(null);
return iAirportlogService.getList(airportlogQuery);
}

@@ -50,6 +52,8 @@ public class AirportLogController extends BaseController {
*/
@GetMapping("/exportExcel")
public JsonResult exportExcel(@Valid AirportLogQuery airportlogQuery) {
//TODO 获取当前登录用户所在的租户
airportlogQuery.setTenantId(null);
JsonResult<IPage<AirportLogVo>> iPageJsonResult = iAirportlogService.getList(airportlogQuery);
if(ObjectUtil.isEmpty(iPageJsonResult) || iPageJsonResult.getCode() != JsonResult.SUCCESS || ObjectUtil.isEmpty(iPageJsonResult.getData())){
return JsonResult.error("未查询到数据,请确认查询条件!");

+ 4
- 0
tuoheng-admin/src/main/java/com/tuoheng/admin/controller/alarmLog/AlarmLogController.java Wyświetl plik

@@ -38,6 +38,8 @@ public class AlarmLogController extends BaseController {
*/
@GetMapping("/index")
public JsonResult index(@Valid AlarmLogQuery alarmLogQuery) {
//TODO 获取当前登录用户所在的租户
alarmLogQuery.setTenantId(null);
return alarmLogService.queryAlarmLog(alarmLogQuery);
}

@@ -49,6 +51,8 @@ public class AlarmLogController extends BaseController {
*/
@GetMapping("/exportExcel")
public JsonResult exportExcel(@Valid AlarmLogQuery alarmLogQuery) {
//TODO 获取当前登录用户所在的租户
alarmLogQuery.setTenantId(null);
JsonResult<IPage<AlarmLogVo>> iPageJsonResult = alarmLogService.queryAlarmLog(alarmLogQuery);
if(ObjectUtil.isEmpty(iPageJsonResult) || iPageJsonResult.getCode() != JsonResult.SUCCESS || ObjectUtil.isEmpty(iPageJsonResult.getData())){
return JsonResult.error("未查询到数据,请确认查询条件!");

+ 5
- 0
tuoheng-admin/src/main/java/com/tuoheng/admin/pojo/request/AirportLogQuery.java Wyświetl plik

@@ -45,4 +45,9 @@ public class AirportLogQuery extends BaseQuery {
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date endTime;

/**
* 租户id
*/
private Integer tenantId;

}

+ 5
- 0
tuoheng-admin/src/main/java/com/tuoheng/admin/pojo/request/AlarmLogQuery.java Wyświetl plik

@@ -35,4 +35,9 @@ public class AlarmLogQuery extends BaseQuery {
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date endTime;

/**
* 租户id
*/
private Integer tenantId;

}

+ 1
- 0
tuoheng-admin/src/main/java/com/tuoheng/admin/service/mqttService/consumer/topicHandle/alarm/AlarmTopicHandleService.java Wyświetl plik

@@ -128,6 +128,7 @@ public class AlarmTopicHandleService implements ITopicHandleService {
Date createDate = new Date(Long.valueOf(time) * 1000L);//注意硬件传过来的时间戳是10位的,故需要乘以1000
alarmLog.setCreateTime(createDate);
alarmLog.setUpdateTime(createDate);
alarmLog.setTenantId(airports.get(0).getTenantId());

if (AlarmTypeEnum.ALARM_ERROR.getType().equals(jsonObject.get("type").toString())) {
/**

+ 3
- 0
tuoheng-admin/src/main/resources/mapper/AirportLogMapper.xml Wyświetl plik

@@ -29,6 +29,9 @@
airport_log al
LEFT JOIN sys_user su ON al.create_user = su.id
WHERE al.mark = 1
<if test="airportlogQuery.tenantId != null and airportlogQuery.tenantId != ''">
and al.tenant_id = #{airportlogQuery.tenantId}
</if>
<if test="airportlogQuery.airportId != null and airportlogQuery.airportId != ''">
and al.airport_id = #{airportlogQuery.airportId}
</if>

+ 3
- 0
tuoheng-admin/src/main/resources/mapper/AlarmLogMapper.xml Wyświetl plik

@@ -29,6 +29,9 @@
th_alarm_log tal
LEFT JOIN th_airport ta ON tal.airport_id = ta.id
WHERE tal.mark = 1
<if test="alarmLogQuery.tenantId != null and alarmLogQuery.tenantId != ''">
and tal.tenant_id = #{alarmLogQuery.tenantId}
</if>
<if test="alarmLogQuery.airportId != null and alarmLogQuery.airportId != ''">
and tal.airport_id = #{alarmLogQuery.airportId}
</if>

Ładowanie…
Anuluj
Zapisz