wuww
2025-04-16 24e92a5d5b068f24efa6c8cb2f06a50480185b5f
添加SimuData类
已添加2个文件
已修改2个文件
263 ■■■■■ 文件已修改
data/init.sql 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
pom.xml 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/se/nsl/domain/po/RainGauge.java 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/se/nsl/domain/po/SimuData.java 237 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
data/init.sql
@@ -12,6 +12,7 @@
      service_name varchar(200),
    type smallint default 1,
    area_type smallint default 0,
    area_name varchar(200),
    data varchar(8000),
    status smallint default 0,
    result varchar(8000),
@@ -31,6 +32,7 @@
comment on column nsl.simu.service_name is '服务名称';
comment on column nsl.simu.type is '类别:1-预测模拟,2-实时模拟,3-历史模拟';
comment on column nsl.simu.area_type is '区域类别:0-自定义,1-行政区划,2-重点区域,3-重点沟';
comment on column nsl.simu.area_name is '区域名称';
comment on column nsl.simu.data is '数据(JSON)';
comment on column nsl.simu.status is '状态:0-创建仿真,1-预处理,2-分析中,10-完成,20-出错';
comment on column nsl.simu.result is '结果(JSON)';
@@ -41,7 +43,7 @@
comment on column nsl.simu.bak is '备注';
comment on column nsl.simu.geom is '空间位置';
-- insert into nsl.simu (name, service_name, type, area_type, status, geom) values ('预测模拟-0416', '20250416100000', 1, 1, 0, ST_GeomFromText('MULTIPOLYGON(((116.666748 39.639859,116.659403 39.626287,116.665956 39.654698,116.666748 39.639859)))'));
-- insert into nsl.simu (name, service_name, type, area_type, area_name, status, geom) values ('预测模拟-0416', '20250416100000', 1, 1, '大兴区', 0, ST_GeomFromText('MULTIPOLYGON(((116.666748 39.639859,116.659403 39.626287,116.665956 39.654698,116.666748 39.639859)))'));
select *, st_astext(geom) geom from nsl.simu;
---------------------------------------------- 2.推演区域
pom.xml
@@ -45,6 +45,7 @@
        <dependency>
            <groupId>com.baomidou</groupId>
            <artifactId>mybatis-plus-boot-starter</artifactId>
            <!--<version>3.5.7</version>-->
            <version>3.5.1</version>
        </dependency>
        <!--redis-->
src/main/java/com/se/nsl/domain/po/RainGauge.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,21 @@
package com.se.nsl.domain.po;
import io.swagger.annotations.ApiModelProperty;
@SuppressWarnings("ALL")
public class RainGauge {
    @ApiModelProperty("雨量计ID")
    private String id;
    @ApiModelProperty("雨量计名称")
    private String name;
    @ApiModelProperty("X坐标")
    private Double x;
    @ApiModelProperty("Y坐标")
    private Double y;
    @ApiModelProperty("影响半径")
    private Double r;
}
src/main/java/com/se/nsl/domain/po/SimuData.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,237 @@
package com.se.nsl.domain.po;
import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.se.nsl.helper.GdalHelper;
import io.swagger.annotations.ApiModelProperty;
import org.gdal.osr.SpatialReference;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
@SuppressWarnings("ALL")
public class SimuData {
    @ApiModelProperty("输入路径")
    private String inPath;
    @ApiModelProperty("输出路径")
    private String outPath;
    @ApiModelProperty("开始时间")
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date startTime;
    @ApiModelProperty("最小X")
    private Double minx;
    @ApiModelProperty("最小Y")
    private Double miny;
    @ApiModelProperty("最大X")
    private Double maxx;
    @ApiModelProperty("最大Y")
    private Double maxy;
    @ApiModelProperty("坐标系ID")
    private Integer epsg;
    @ApiModelProperty("类别:1-预测模拟,2-实时模拟,3-历史模拟")
    private Integer type;
    @ApiModelProperty("降雨模式:正态分布|平均分布|波动平均分布|持续上升")
    private String mode;
    @ApiModelProperty("降雨总量(mm)")
    private Double total;
    @ApiModelProperty("降雨时长(h)")
    private Integer duration;
    @ApiModelProperty("降雨强度(mm/h)")
    private Double intensity;
    @ApiModelProperty("历史雨情:XXå¹´50mm降雨|XXå¹´75mm降雨|XXå¹´100mm降雨|新增降雨历史数据")
    private String history;
    @ApiModelProperty("预测数据:降雨场次|气象数据|逐小时预报数据|自定义参数")
    private String prediction;
    @ApiModelProperty("雨量类别:雨量计实时数据|气象实时数据")
    private String category;
    @ApiModelProperty("雨量计列表")
    private List<RainGauge> gauges;
    public SimuData() {
        gauges = new ArrayList<>();
    }
    public SimuData(String inPath, String outPath, Date startTime, Double minx, Double miny, Double maxx, Double maxy, Integer epsg, Integer type, Double total, Integer duration, Double intensity) {
        this();
        this.inPath = inPath;
        this.outPath = outPath;
        this.startTime = startTime;
        this.minx = minx;
        this.miny = miny;
        this.maxx = maxx;
        this.maxy = maxy;
        this.epsg = epsg;
        this.type = type;
        this.total = total;
        this.duration = duration;
        this.intensity = intensity;
    }
    public void setPath(String inPath, String outPath) {
        this.inPath = inPath;
        this.outPath = outPath;
    }
    public String getBbox() {
        // "116.64388473935195,39.884315914604464,116.64754729082588,39.887069143903496";
        return minx + "," + miny + "," + maxx + "," + maxy;
    }
    public SpatialReference getSpatialReference() {
        return GdalHelper.createSpatialReference(this.getEpsg());
    }
    public String getInPath() {
        return inPath;
    }
    public void setInPath(String inPath) {
        this.inPath = inPath;
    }
    public String getOutPath() {
        return outPath;
    }
    public void setOutPath(String outPath) {
        this.outPath = outPath;
    }
    public Date getStartTime() {
        return startTime;
    }
    public void setStartTime(Date startTime) {
        this.startTime = startTime;
    }
    public Double getMinx() {
        return minx;
    }
    public void setMinx(Double minx) {
        this.minx = minx;
    }
    public Double getMiny() {
        return miny;
    }
    public void setMiny(Double miny) {
        this.miny = miny;
    }
    public Double getMaxx() {
        return maxx;
    }
    public void setMaxx(Double maxx) {
        this.maxx = maxx;
    }
    public Double getMaxy() {
        return maxy;
    }
    public void setMaxy(Double maxy) {
        this.maxy = maxy;
    }
    public Integer getEpsg() {
        return epsg;
    }
    public void setEpsg(Integer epsg) {
        this.epsg = epsg;
    }
    public Integer getType() {
        return type;
    }
    public void setType(Integer type) {
        this.type = type;
    }
    public String getMode() {
        return mode;
    }
    public void setMode(String mode) {
        this.mode = mode;
    }
    public Double getTotal() {
        return total;
    }
    public void setTotal(Double total) {
        this.total = total;
    }
    public Integer getDuration() {
        return duration;
    }
    public void setDuration(Integer duration) {
        this.duration = duration;
    }
    public Double getIntensity() {
        return intensity;
    }
    public void setIntensity(Double intensity) {
        this.intensity = intensity;
    }
    public String getHistory() {
        return history;
    }
    public void setHistory(String history) {
        this.history = history;
    }
    public String getPrediction() {
        return prediction;
    }
    public void setPrediction(String prediction) {
        this.prediction = prediction;
    }
    public String getCategory() {
        return category;
    }
    public void setCategory(String category) {
        this.category = category;
    }
    public List<RainGauge> getGauges() {
        return gauges;
    }
    public void setGauges(List<RainGauge> gauges) {
        this.gauges = gauges;
    }
}