wuww
2025-04-12 dc57a3e8d8d6a603fdff1a8028284fc9f8655a52
test
已添加1个文件
已修改2个文件
91 ■■■■■ 文件已修改
src/main/java/com/se/nsl/controller/TestController.java 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/se/nsl/service/TestService.java 57 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/application-dev.yml 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/se/nsl/controller/TestController.java
@@ -26,6 +26,9 @@
    UwService uwService;
    @Resource
    TestService testService;
    @Resource
    GedbService gedbService;
    @Resource
@@ -158,4 +161,21 @@
            return fail(ex, null);
        }
    }
    @ApiOperation(value = "testNsl *")
    @GetMapping("/testNsl")
    public R<Object> testNsl() {
        try {
            DataPo data = new DataPo();
            data.setEpsg(4548);
            data.setInPath("20250412");
            data.setStartTime(StringHelper.YMDHMS_FORMAT.parse("2025-04-12 00:00:00"));
            testService.test(data);
            return success("ok");
        } catch (Exception ex) {
            return fail(ex, null);
        }
    }
}
src/main/java/com/se/nsl/service/TestService.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,57 @@
package com.se.nsl.service;
import cn.hutool.core.io.FileUtil;
import com.se.nsl.config.PropertiesConfig;
import com.se.nsl.domain.dto.LayerDto;
import com.se.nsl.domain.dto.ResultDto;
import com.se.nsl.domain.po.DataPo;
import com.se.nsl.domain.vo.BuildingDepthVo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.io.File;
import java.util.List;
@Slf4j
@Service
@SuppressWarnings("ALL")
public class TestService {
    @Resource
    PropertiesConfig config;
    @Resource
    ResultService resultService;
    public void test(DataPo data) {
        String basePath = config.getInPath() + File.separator + data.getInPath() + File.separator;
        ResultDto dto = new ResultDto(
                data.getInPath(),
                basePath + config.getTerrainFile(),
                basePath + config.getBuildingFile(),
                basePath + config.getWaterPath(),
                basePath + config.getFlowPath(),
                config.getInPath(),
                config.getOutPath(),
                data.getEpsg());
        LayerDto layer = new LayerDto(config.getVer(), data.getEpsg(), config.getSizes());
        process(dto, layer);
    }
    private void process(ResultDto dto, LayerDto layer) {
        try {
//            copeTerrain(dto, layer);
//            copeBuilding(dto, layer);
//            List<BuildingDepthVo> buildings = copeWater(dto, layer);
//            copeFlow(dto, layer);
//            copeLayerJson(dto, layer);
//            copeRainFallJson(dto, layer);
//            copeBuildingDepthJson(dto, buildings);
        } finally {
            File dir = new File(dto.getTemp());
            if (dir.exists()) {
                FileUtil.del(dir);
            }
        }
    }
}
src/main/resources/application-dev.yml
@@ -105,16 +105,16 @@
# æ¨¡æ‹Ÿé¡¹ç›®
simu-app:
  # é¡¹ç›®æ¨¡æ‹Ÿæ–‡ä»¶ä¸Šä¼ å­˜æ”¾çš„位置
  filePath: D:\simu\files
  filePath: D:\other\simu\files
config:
  ver: 0.2
  cacheTime: 60
  # Gdal驱动目录
  gdalPath: D:\gdal\release-1928-x64-dev\release-1928-x64\bin
  gdalPath: D:\soft\release-1928-x64-dev\release-1928-x64\bin
  #inPath: D:\simu\in
  inPath: D:\uwsolver
  outPath: D:\out
  inPath: D:\other\simu\uwsolver
  outPath: D:\other\simu\out
  host: http://106.120.22.26:8024/
  user: admin
  pwd: admin
@@ -138,8 +138,8 @@
  rainPeriod: 10
  # æµé‡å•位,LPS(升/秒)、CMS(立方米/秒)、CFS(立方英尺/秒)
  flowUnits: CMS
  solverBat: D:\uwsolver\run_solver.bat
  sww2tifBat: D:\uwsolver\sww2tif.bat
  solverBat: D:\other\simu\uwsolver\run_solver.bat
  sww2tifBat: D:\other\simu\uwsolver\sww2tif.bat
  sizes: 64,128,256,512,1024,2048
  # è¾“出文件
  terrainFile: DEM.tif
@@ -149,4 +149,4 @@
  waterPath: depth
  flowPath: velocity
  copyTif: false
  tifPath: D:\城市内涝\sem\tongzhou_1m_tif\tongzhou_raster_4548_1m_clip_river_fill.tif
  tifPath: D:\other\simu\uwsolver\5ca43c87cd8e48c5a9c5399a5da46dbc\tongzhou_raster_4548_1m_clip_river_fill.tif