src/main/java/com/se/simu/controller/SimuController.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/main/java/com/se/simu/service/UwService.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/main/resources/application.yml | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
src/main/java/com/se/simu/controller/SimuController.java
@@ -155,6 +155,21 @@ return System.currentTimeMillis(); } @ApiOperation(value = "testCallExe *") @GetMapping("/testCallExe") public R<Object> testCallExe() { try { DataPo data = new DataPo(); data.setInPath("20241010095328"); String str = uwService.callExe(data); return success(str); } catch (Exception ex) { return fail(ex, null); } } @ApiOperation(value = "testResuslt *") @GetMapping("/testResuslt") public R<Object> testResuslt() { src/main/java/com/se/simu/service/UwService.java
@@ -26,6 +26,16 @@ @Resource PropertiesConfig config; static Rainfall _rainfall = null; public static Rainfall getTainfall() throws Exception { if (null == _rainfall) { _rainfall = new Rainfall(); } return _rainfall; } /** * 创建降雨文件 * <p> @@ -40,7 +50,7 @@ //MWCharArray station = new MWCharArray(config.getRainStation()); //MWCharArray time = new MWCharArray(startTime); Rainfall rainfall = new Rainfall(); Rainfall rainfall = getTainfall(); //rainfall('D:\simu\in\RainGage.dat','Tongzhou','2024-09-29 00:00:00',60,0.5,10) Object[] rs = rainfall.rainfall(filePath, config.getRainStation(), startTime, Double.valueOf(data.getDuration()), 0.5, config.getRainPeriod()); @@ -80,17 +90,17 @@ nr = new BufferedReader(new InputStreamReader(process.getInputStream(), "GBK")); er = new BufferedReader(new InputStreamReader(process.getErrorStream(), "GBK")); String errorLine; while ((errorLine = er.readLine()) != null) { log.warn(errorLine); } String line; StringBuilder sb = new StringBuilder(); while ((line = nr.readLine()) != null) { sb.append(line); } String errorLine; while ((errorLine = er.readLine()) != null) { log.warn(errorLine); } // 等待程序执行结束并输出状态 int exitCode = process.waitFor(); src/main/resources/application.yml
@@ -98,10 +98,13 @@ #inPath: D:\simu\in inPath: D:\simu\uwsolver outPath: D:\simu\out host: http://106.120.22.26:8013/ user: WUWEIWEI pwd: WUWEIWEI dbName: 通州水利仿真 host: http://106.120.22.26:8024/ user: admin pwd: admin # host: http://106.120.22.26:8013/ # user: WUWEIWEI # pwd: WUWEIWEI dbName: 通州水利 pageSize: 2000 layerNames: 管点,管线,建筑物 shpNames: