From 52ac08a4f296567c016f36f2a690665544757c05 Mon Sep 17 00:00:00 2001 From: lau572 <1010031226@qq.com> Date: Fri, 12 Jun 2026 11:02:44 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B0=94=E8=B1=A1=E9=A2=84=E8=AD=A6=E5=8E=86?= =?UTF-8?q?=E5=8F=B2=E8=AE=B0=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/WeatherForecastController.java | 26 ++++ .../domain/export/MeteorologicalWarning.java | 125 ++++++++++++++++++ .../mapper/DcNoStakeWarningTableMapper.java | 5 + .../IDcNoStakeWarningTableService.java | 9 ++ .../DcNoStakeWarningTableServiceImpl.java | 20 +++ .../business/DcNoStakeWarningTableMapper.xml | 28 ++++ 6 files changed, 213 insertions(+) create mode 100644 zc-business/src/main/java/com/zc/business/domain/export/MeteorologicalWarning.java create mode 100644 zc-business/src/main/resources/mapper/business/DcNoStakeWarningTableMapper.xml diff --git a/zc-business/src/main/java/com/zc/business/controller/WeatherForecastController.java b/zc-business/src/main/java/com/zc/business/controller/WeatherForecastController.java index b1047cc6..905c5aa6 100644 --- a/zc-business/src/main/java/com/zc/business/controller/WeatherForecastController.java +++ b/zc-business/src/main/java/com/zc/business/controller/WeatherForecastController.java @@ -3,12 +3,20 @@ package com.zc.business.controller; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; +import com.ruoyi.common.annotation.Log; import com.ruoyi.common.core.controller.BaseController; import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.core.page.TableDataInfo; import com.ruoyi.common.core.redis.RedisCache; +import com.ruoyi.common.enums.BusinessType; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.system.domain.SysConfig; +import com.ruoyi.system.domain.SysLogininfor; import com.ruoyi.system.service.ISysConfigService; import com.zc.business.domain.DcNoStakeWarningTable; import com.zc.business.domain.DcRegion; +import com.zc.business.domain.Status; +import com.zc.business.domain.export.MeteorologicalWarning; import com.zc.business.enums.UniversalEnum; import com.zc.business.service.IDcWarningService; import com.zc.business.service.impl.DcNoStakeWarningTableServiceImpl; @@ -23,9 +31,11 @@ import io.swagger.annotations.ApiOperation; import okhttp3.Response; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.scheduling.annotation.Scheduled; +import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; +import javax.servlet.http.HttpServletResponse; import java.io.IOException; import java.util.*; import java.util.concurrent.TimeUnit; @@ -927,4 +937,20 @@ public class WeatherForecastController extends BaseController { return AjaxResult.success(jsonObject); } + @ApiOperation("查询气象预警历史记录") + @GetMapping("/getHistory") + public TableDataInfo getHistory(MeteorologicalWarning meteorologicalWarning) { + startPage(); + List list = noStakeWarningTableService.selectMeteorologicalWarningList(meteorologicalWarning); + return getDataTable(list); + } + + @PostMapping("/export") + public void export(HttpServletResponse response, MeteorologicalWarning meteorologicalWarning) + { + List list = noStakeWarningTableService.selectMeteorologicalWarningList(meteorologicalWarning); + ExcelUtil util = new ExcelUtil<>(MeteorologicalWarning.class); + util.exportExcel(response, list, "气象预警记录"); + } + } diff --git a/zc-business/src/main/java/com/zc/business/domain/export/MeteorologicalWarning.java b/zc-business/src/main/java/com/zc/business/domain/export/MeteorologicalWarning.java new file mode 100644 index 00000000..8f0cb6a6 --- /dev/null +++ b/zc-business/src/main/java/com/zc/business/domain/export/MeteorologicalWarning.java @@ -0,0 +1,125 @@ +package com.zc.business.domain.export; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.core.domain.BaseEntity; +import org.apache.commons.lang3.builder.ToStringBuilder; + +import java.util.Date; + +/** + * 气象预警对象 + * + * @author liuwenge + * @date 2026-06-11 + */ +public class MeteorologicalWarning extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + + /** id */ + private Long id; + + /** 预警标题 */ + @Excel(name = "预警标题") + private String earlyWorningTitle; + + /** 站点名称 */ + @Excel(name = "站点名称") + private String stationName; + + /** 预警发布时间 */ + @Excel(name = "预警发布时间", dateFormat = "yyyy-MM-dd HH:mm:ss") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8") + private Date warningTime; + + /** 预警内容 */ + @Excel(name = "预警内容",width = 150) + private String earlyWorningContent; + + /** 预警类型 1-交通流预警 2-气象预警 3=交通流异常预警4-光纤告警 */ + private String warningType; + + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8") + private Date startTime; + + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8") + private Date endTime; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getEarlyWorningTitle() { + return earlyWorningTitle; + } + + public void setEarlyWorningTitle(String earlyWorningTitle) { + this.earlyWorningTitle = earlyWorningTitle; + } + + public String getStationName() { + return stationName; + } + + public void setStationName(String stationName) { + this.stationName = stationName; + } + + public Date getWarningTime() { + return warningTime; + } + + public void setWarningTime(Date warningTime) { + this.warningTime = warningTime; + } + + public String getEarlyWorningContent() { + return earlyWorningContent; + } + + public void setEarlyWorningContent(String earlyWorningContent) { + this.earlyWorningContent = earlyWorningContent; + } + + public String getWarningType() { + return warningType; + } + + public void setWarningType(String warningType) { + this.warningType = warningType; + } + + public Date getStartTime() { + return startTime; + } + + public void setStartTime(Date startTime) { + this.startTime = startTime; + } + + public Date getEndTime() { + return endTime; + } + + public void setEndTime(Date endTime) { + this.endTime = endTime; + } + + @Override + public String toString() { + return new ToStringBuilder(this) + .append("id", id) + .append("earlyWorningTitle", earlyWorningTitle) + .append("stationName", stationName) + .append("earlyWorningIssueDate", warningTime) + .append("earlyWorningContent", earlyWorningContent) + .append("warningType", warningType) + .toString(); + } +} diff --git a/zc-business/src/main/java/com/zc/business/mapper/DcNoStakeWarningTableMapper.java b/zc-business/src/main/java/com/zc/business/mapper/DcNoStakeWarningTableMapper.java index a892dd5b..8b606f56 100644 --- a/zc-business/src/main/java/com/zc/business/mapper/DcNoStakeWarningTableMapper.java +++ b/zc-business/src/main/java/com/zc/business/mapper/DcNoStakeWarningTableMapper.java @@ -2,8 +2,11 @@ package com.zc.business.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.zc.business.domain.DcNoStakeWarningTable; +import com.zc.business.domain.export.MeteorologicalWarning; import org.apache.ibatis.annotations.Mapper; +import java.util.List; + /** * 无桩号预警Mapper接口 * @@ -11,4 +14,6 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface DcNoStakeWarningTableMapper extends BaseMapper { + + List selectNoStakeWarningTableList(MeteorologicalWarning meteorologicalWarning); } diff --git a/zc-business/src/main/java/com/zc/business/service/IDcNoStakeWarningTableService.java b/zc-business/src/main/java/com/zc/business/service/IDcNoStakeWarningTableService.java index 08694f0a..f453eb59 100644 --- a/zc-business/src/main/java/com/zc/business/service/IDcNoStakeWarningTableService.java +++ b/zc-business/src/main/java/com/zc/business/service/IDcNoStakeWarningTableService.java @@ -3,6 +3,7 @@ package com.zc.business.service; import com.baomidou.mybatisplus.extension.service.IService; import com.zc.business.domain.DcNoStakeWarningTable; +import com.zc.business.domain.export.MeteorologicalWarning; import java.util.Date; import java.util.List; @@ -61,4 +62,12 @@ public interface IDcNoStakeWarningTableService extends IService selectMeteorologicalWarningList(MeteorologicalWarning meteorologicalWarning); } diff --git a/zc-business/src/main/java/com/zc/business/service/impl/DcNoStakeWarningTableServiceImpl.java b/zc-business/src/main/java/com/zc/business/service/impl/DcNoStakeWarningTableServiceImpl.java index 15a7f420..ae3243ff 100644 --- a/zc-business/src/main/java/com/zc/business/service/impl/DcNoStakeWarningTableServiceImpl.java +++ b/zc-business/src/main/java/com/zc/business/service/impl/DcNoStakeWarningTableServiceImpl.java @@ -1,5 +1,6 @@ package com.zc.business.service.impl; +import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONObject; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; @@ -7,12 +8,16 @@ import com.ruoyi.common.constant.HttpStatus; import com.ruoyi.common.exception.ServiceException; import com.ruoyi.common.utils.PageUtils; import com.zc.business.domain.DcNoStakeWarningTable; +import com.zc.business.domain.export.MeteorologicalWarning; import com.zc.business.enums.UniversalEnum; +import com.zc.business.mapper.DcInfoBoardTemplateMapper; import com.zc.business.mapper.DcNoStakeWarningTableMapper; import com.zc.business.service.IDcNoStakeWarningTableService; import com.zc.business.utils.WeatherTrafficProposeUtil; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import java.util.ArrayList; import java.util.Date; import java.util.List; import java.util.Objects; @@ -26,6 +31,9 @@ import java.util.stream.Collectors; @Service public class DcNoStakeWarningTableServiceImpl extends ServiceImpl implements IDcNoStakeWarningTableService { + @Autowired + private DcNoStakeWarningTableMapper dcNoStakeWarningTableMapper; + public LambdaQueryWrapper noStakeWarningTableQueryWrapper(DcNoStakeWarningTable dcNoStakeWarningTable, Date endTime, Date startTime) { LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); @@ -142,5 +150,17 @@ public class DcNoStakeWarningTableServiceImpl extends ServiceImpl selectMeteorologicalWarningList(MeteorologicalWarning meteorologicalWarning){ + + return dcNoStakeWarningTableMapper.selectNoStakeWarningTableList(meteorologicalWarning); + } + } diff --git a/zc-business/src/main/resources/mapper/business/DcNoStakeWarningTableMapper.xml b/zc-business/src/main/resources/mapper/business/DcNoStakeWarningTableMapper.xml new file mode 100644 index 00000000..d666e059 --- /dev/null +++ b/zc-business/src/main/resources/mapper/business/DcNoStakeWarningTableMapper.xml @@ -0,0 +1,28 @@ + + + + + + +