Browse Source

首页预警

develop
wangsixiang 3 months ago
parent
commit
9e52621a4f
  1. 9
      zc-business/src/main/java/com/zc/business/controller/DcWarningController.java
  2. 3
      zc-business/src/main/java/com/zc/business/domain/DcNoStakeWarningTable.java
  3. 4
      zc-business/src/main/java/com/zc/business/mapper/DcWarningMapper.java
  4. 4
      zc-business/src/main/java/com/zc/business/service/IDcWarningService.java
  5. 7
      zc-business/src/main/java/com/zc/business/service/impl/DcWarningServiceImpl.java
  6. 12
      zc-business/src/main/resources/mapper/business/DcWarningMapper.xml

9
zc-business/src/main/java/com/zc/business/controller/DcWarningController.java

@ -10,6 +10,7 @@ import com.ruoyi.common.utils.spring.SpringUtils;
import com.ruoyi.common.utils.uuid.IdUtils; import com.ruoyi.common.utils.uuid.IdUtils;
import com.zc.business.domain.DcDevice; import com.zc.business.domain.DcDevice;
import com.zc.business.domain.DcDispatch; import com.zc.business.domain.DcDispatch;
import com.zc.business.domain.DcNoStakeWarningTable;
import com.zc.business.domain.DcWarning; import com.zc.business.domain.DcWarning;
import com.zc.business.domain.DcWarningBatchConvert; import com.zc.business.domain.DcWarningBatchConvert;
import com.zc.business.enums.UniversalEnum; import com.zc.business.enums.UniversalEnum;
@ -232,5 +233,13 @@ public class DcWarningController extends BaseController
return AjaxResult.success(dcWarningService.getRadarIncidentVideo(id)); return AjaxResult.success(dcWarningService.getRadarIncidentVideo(id));
} }
//首页气象预警,最近三天的数据
@PostMapping("/meteorologicalList")
public TableDataInfo selectStakeWarningTable(){
startPage();
List<DcNoStakeWarningTable> list = dcWarningService.selectStakeWarningTable();
return getDataTable(list);
}
} }

3
zc-business/src/main/java/com/zc/business/domain/DcNoStakeWarningTable.java

@ -2,6 +2,7 @@ package com.zc.business.domain;
import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.annotation.Excel; import com.ruoyi.common.annotation.Excel;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
@ -24,9 +25,11 @@ public class DcNoStakeWarningTable {
private String warningType; private String warningType;
@ApiModelProperty("创建时间") @ApiModelProperty("创建时间")
@Excel(name = "创建时间") @Excel(name = "创建时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
private Date createTime; private Date createTime;
@ApiModelProperty("预警时间") @ApiModelProperty("预警时间")
@Excel(name = "预警时间") @Excel(name = "预警时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
private Date warningTime; private Date warningTime;
@ApiModelProperty("其他配置") @ApiModelProperty("其他配置")
@Excel(name = "其他配置") @Excel(name = "其他配置")

4
zc-business/src/main/java/com/zc/business/mapper/DcWarningMapper.java

@ -7,6 +7,7 @@ import java.util.List;
import cn.hutool.core.lang.hash.Hash; import cn.hutool.core.lang.hash.Hash;
import com.zc.business.domain.DcDispatch; import com.zc.business.domain.DcDispatch;
import com.zc.business.domain.DcDispatchResource; import com.zc.business.domain.DcDispatchResource;
import com.zc.business.domain.DcNoStakeWarningTable;
import com.zc.business.domain.DcRoadSection; import com.zc.business.domain.DcRoadSection;
import com.zc.business.domain.DcWaringStrategy; import com.zc.business.domain.DcWaringStrategy;
import com.zc.business.domain.DcWarning; import com.zc.business.domain.DcWarning;
@ -161,4 +162,7 @@ public interface DcWarningMapper
Long selectWarningNum(); Long selectWarningNum();
//事件验证是否存在 //事件验证是否存在
public String selectEventId(@Param("eventId")String eventId); public String selectEventId(@Param("eventId")String eventId);
//首页气象预警列表
public List<DcNoStakeWarningTable> selectStakeWarningTable();
} }

4
zc-business/src/main/java/com/zc/business/service/IDcWarningService.java

@ -6,6 +6,7 @@ import java.util.List;
import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.core.domain.AjaxResult;
import com.zc.business.domain.DcDispatch; import com.zc.business.domain.DcDispatch;
import com.zc.business.domain.DcDispatchResource; import com.zc.business.domain.DcDispatchResource;
import com.zc.business.domain.DcNoStakeWarningTable;
import com.zc.business.domain.DcWarning; import com.zc.business.domain.DcWarning;
import com.zc.business.domain.DcWarningBatchConvert; import com.zc.business.domain.DcWarningBatchConvert;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
@ -112,4 +113,7 @@ public interface IDcWarningService
* 获取雷达事件视频 * 获取雷达事件视频
*/ */
String getRadarIncidentVideo(String id)throws Exception; String getRadarIncidentVideo(String id)throws Exception;
//首页气象预警列表
public List<DcNoStakeWarningTable> selectStakeWarningTable();
} }

7
zc-business/src/main/java/com/zc/business/service/impl/DcWarningServiceImpl.java

@ -1174,6 +1174,7 @@ public class DcWarningServiceImpl implements IDcWarningService {
} }
/** /**
* 雷达关联监控点查询接口 * 雷达关联监控点查询接口
* *
@ -1231,4 +1232,10 @@ public class DcWarningServiceImpl implements IDcWarningService {
return ArtemisHttpUtil.doPostStringArtemis(config, path, body, null, null, "application/json"); return ArtemisHttpUtil.doPostStringArtemis(config, path, body, null, null, "application/json");
} }
//首页气象预警列表
@Override
public List<DcNoStakeWarningTable> selectStakeWarningTable() {
return dcWarningMapper.selectStakeWarningTable();
}
} }

12
zc-business/src/main/resources/mapper/business/DcWarningMapper.xml

@ -447,5 +447,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectEventId" resultType="java.lang.String"> <select id="selectEventId" resultType="java.lang.String">
select id from dc_event where id=#{eventId} select id from dc_event where id=#{eventId}
</select> </select>
<select id="selectStakeWarningTable" resultType="com.zc.business.domain.DcNoStakeWarningTable">
SELECT 'Traffic Flow' AS WarningTypeSource, id, warning_description, warning_type, warning_time, create_time, other_config
FROM dc_no_stake_warning_table
WHERE warning_type = 1
AND warning_time >= DATE_SUB(CURDATE(), INTERVAL 14 DAY)
UNION ALL
SELECT 'Weather Warning' AS WarningTypeSource, id, warning_description, warning_type, warning_time, create_time, other_config
FROM dc_no_stake_warning_table
WHERE warning_type = 2
AND warning_time >= DATE_SUB(CURDATE(), INTERVAL 3 DAY)
ORDER BY warning_time DESC
</select>
</mapper> </mapper>

Loading…
Cancel
Save