| | |
| | | } |
| | | } |
| | | List<GridDto> dtos = new ArrayList<>(); |
| | | dtos.add(new GridDto(vo.getMinx(), vo.getMiny())); |
| | | dtos.add(new GridDto(vo.getMinx(), vo.getMaxy())); |
| | | dtos.add(new GridDto(vo.getMaxx(), vo.getMaxy())); |
| | | dtos.add(new GridDto(vo.getMaxx(), vo.getMiny())); |
| | | dtos.add(new GridDto( vo.getMiny(),vo.getMinx())); |
| | | dtos.add(new GridDto(vo.getMaxy(),vo.getMinx())); |
| | | dtos.add(new GridDto(vo.getMaxy(),vo.getMaxx())); |
| | | dtos.add(new GridDto(vo.getMiny(),vo.getMaxx())); |
| | | createSem(tableName, dtos); |
| | | // 开始模拟计算 |
| | | boolean flag = simuFilesService.createByfiles(vo); |
| | |
| | | public R<Boolean> createSem(String tableName, List<GridDto> dtos) throws Exception { |
| | | //降雨文件生成 |
| | | saveZarr(tableName); |
| | | String token = EntityLibraryUtils.login(); |
| | | //管点生成 |
| | | pointTosem(dtos); |
| | | pointTosem(dtos,token); |
| | | //管线生成 |
| | | lineToSem(dtos); |
| | | lineToSem(dtos,token); |
| | | //地形生成 |
| | | terrainToSem(dtos); |
| | | //范围生成 |
| | |
| | | return success(filePatn + "raingage.sem"); |
| | | } |
| | | |
| | | @ApiOperation(value = "管点转sem") |
| | | @PostMapping(value = "/pointTosem", produces = "application/json; charset=UTF-8") |
| | | public R<String> pointTosem(@RequestBody List<GridDto> dtos) throws Exception { |
| | | public R<String> pointTosem(List<GridDto> dtos,String token) throws Exception { |
| | | String path = outPath + "\\point\\"; |
| | | String publicKey = EntityLibraryUtils.getPublicKey(); |
| | | String token = EntityLibraryUtils.login(); |
| | | JSONArray jsonArrayList = EntityLibraryUtils.getPointInfo(dtos, token); |
| | | JSONObject jsonObject = getModule("pointmodule.json"); |
| | | for (int s = 0; s < jsonArrayList.size(); s++) { |
| | |
| | | return success(filePatn + "node.sem"); |
| | | } |
| | | |
| | | @ApiOperation(value = "管线sem生成") |
| | | @PostMapping(value = "/lineToSem", produces = "application/json; charset=UTF-8") |
| | | public R<String> lineToSem(@RequestBody List<GridDto> dtos) throws Exception { |
| | | public R<String> lineToSem(List<GridDto> dtos,String token) throws Exception { |
| | | String path = outPath + "\\line\\"; |
| | | String publicKey = EntityLibraryUtils.getPublicKey(); |
| | | String token = EntityLibraryUtils.login(); |
| | | JSONArray jsonArrayList = EntityLibraryUtils.getLineInfo(dtos, token); |
| | | if (jsonArrayList.size() == 0) { |
| | | return fail("该区域不存在管线!"); |