1
13693261870
2024-09-30 b2b9e959447664bceb4381630358230a2ee5a1ab
1
已添加1个文件
已删除1个文件
已修改6个文件
101 ■■■■■ 文件已修改
libs/rainfall.jar 补丁 | 查看 | 原始文档 | blame | 历史
libs/simu.jar 补丁 | 查看 | 原始文档 | blame | 历史
pom.xml 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/se/simu/controller/SimuController.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/se/simu/domain/dto/ConfigDto.java 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/se/simu/domain/po/DataPo.java 55 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/se/simu/domain/vo/CreateSimuVo.java 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/se/simu/service/UwService.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
libs/rainfall.jar
Binary files differ
libs/simu.jar
Binary files differ
pom.xml
@@ -120,6 +120,21 @@
            <version>3.5.0</version>
            <!--version>3.2.0</version-->
        </dependency>
        <!--rainfall-->
        <dependency>
            <groupId>com.mathworks.toolbox</groupId>
            <artifactId>javabuilder</artifactId>
            <version>1.0</version>
            <scope>system</scope>
            <systemPath>${project.basedir}/libs/javabuilder.jar</systemPath>
        </dependency>
        <dependency>
            <groupId>com.se.simu</groupId>
            <artifactId>Rainfall</artifactId>
            <version>1.0</version>
            <scope>system</scope>
            <systemPath>${project.basedir}/libs/simu.jar</systemPath>
        </dependency>
    </dependencies>
    <build>
@@ -128,6 +143,7 @@
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <version>2.4.1</version>
                <configuration>
                    <mainClass>com.se.simu.SimuApplication</mainClass>
                    <excludes>
src/main/java/com/se/simu/controller/SimuController.java
@@ -64,6 +64,9 @@
            if (null == vo.getPid() || vo.getPid() < 0) {
                vo.setPid(0);
            }
            if (null == vo.getStartTime()) {
                vo.setStartTime(new Date());
            }
            if (vo.getPid() > 0) {
                SimuPo pp = simuService.getSimuByPid(vo.getPid());
                if (null == pp) {
src/main/java/com/se/simu/domain/dto/ConfigDto.java
@@ -85,7 +85,7 @@
    // 结果保存频率,相对report_step来说,比如save_step=3就表示每间隔2个report_step保存一次结果
    private Integer save_step = 1;
    public void setProperties(String dirName, Integer minutes, PropertiesConfig config) {
    public void setProperties(String dirName, Date startTime, Integer minutes, PropertiesConfig config) {
        this.casedir = dirName;
        this.terrain_file = config.getDemFile();
        this.studyzone_file = config.getZoneName();
@@ -101,10 +101,10 @@
        this.threads = WebHelper.getCpuCores();
        Calendar calendar = Calendar.getInstance();
        calendar.setTime(new Date());
        calendar.set(Calendar.HOUR_OF_DAY, 0);
        calendar.set(Calendar.MINUTE, 0);
        calendar.set(Calendar.SECOND, 0);
        calendar.setTime(startTime);
        //calendar.set(Calendar.HOUR_OF_DAY, 0);
        //calendar.set(Calendar.MINUTE, 0);
        //calendar.set(Calendar.SECOND, 0);
        calendar.set(Calendar.MILLISECOND, 0);
        String start = DATE_FORMAT.format(calendar.getTime());
src/main/java/com/se/simu/domain/po/DataPo.java
@@ -1,6 +1,10 @@
package com.se.simu.domain.po;
import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import java.util.Date;
/**
 * 仿真数据实体类
@@ -20,6 +24,11 @@
    @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;
@@ -82,15 +91,6 @@
        return minx + "," + miny + "," + maxx + "," + maxy;
    }
    public DataPo(String name, String inPath, String outPath, Double total, Integer duration, Integer isFlood) {
        this.name = name;
        this.inPath = inPath;
        this.outPath = outPath;
        this.total = total;
        this.duration = duration;
        this.isFlood = isFlood;
    }
    public DataPo(String name, String inPath, String outPath, Double minx, Double miny, Double maxx, Double maxy, Double total, Integer duration) {
        this.name = name;
        this.inPath = inPath;
@@ -101,35 +101,6 @@
        this.maxy = maxy;
        this.total = total;
        this.duration = duration;
    }
    public boolean setExtent(Double minx, Double miny, Double maxx, Double maxy) {
        this.minx = minx;
        this.miny = miny;
        this.maxx = maxx;
        this.maxy = maxy;
        return true;
    }
    public boolean setFlood(Integer floodStart, Integer floodEnd, Double floodHeight, String floodType) {
        this.isFlood = 1;
        this.floodStart = floodStart;
        this.floodEnd = floodEnd;
        this.floodHeight = floodHeight;
        this.floodType = floodType;
        return true;
    }
    public boolean setFloodExtent(Double floodMinx, Double floodMiny, Double floodMaxx, Double floodMaxy) {
        this.isFlood = 1;
        this.floodMinx = floodMinx;
        this.floodMiny = floodMiny;
        this.floodMaxx = floodMaxx;
        this.floodMaxy = floodMaxy;
        return true;
    }
    public Integer getPid() {
@@ -164,6 +135,14 @@
        this.outPath = outPath;
    }
    public Date getStartTime() {
        return startTime;
    }
    public void setStartTime(Date startTime) {
        this.startTime = startTime;
    }
    public Double getMinx() {
        return minx;
    }
src/main/java/com/se/simu/domain/vo/CreateSimuVo.java
@@ -5,6 +5,8 @@
import lombok.EqualsAndHashCode;
import lombok.ToString;
import java.util.Date;
/**
 * 创建仿真视图类
 *
@@ -39,6 +41,9 @@
    @ApiModelProperty("仿真名称")
    private String name;
    @ApiModelProperty("开始时间")
    private Date startTime;
    @ApiModelProperty("仿真备注")
    private String bak;
@@ -213,4 +218,12 @@
    public void setFloodMaxy(Double floodMaxy) {
        this.floodMaxy = floodMaxy;
    }
    public Date getStartTime() {
        return startTime;
    }
    public void setStartTime(Date startTime) {
        this.startTime = startTime;
    }
}
src/main/java/com/se/simu/service/UwService.java
@@ -7,7 +7,7 @@
import com.se.simu.helper.WebHelper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import rainfall.Rainfall;
import com.se.simu.Rainfall;
import javax.annotation.Resource;
import java.io.*;
@@ -32,7 +32,7 @@
    public void createConfig(DataPo data) throws IOException {
        ConfigDto dto = new ConfigDto();
        dto.setProperties(data.getInPath(), data.getDuration(), config);
        dto.setProperties(data.getInPath(), data.getStartTime(), data.getDuration(), config);
        String json = JSONUtil.toJsonPrettyStr(dto);
        String filePath = config.getInPath() + File.separator + data.getInPath() + ".json";