libs/simu.jar | 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/main/java/com/se/simu/controller/SimuController.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/main/java/com/se/simu/controller/TestController.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/main/java/com/se/simu/service/ResultService.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
libs/simu.jarBinary files differ
src/main/java/com/se/simu/controller/SimuController.java
@@ -9,7 +9,6 @@ import com.se.simu.domain.vo.CreateSimuVo; import com.se.simu.domain.vo.R; import com.se.simu.domain.vo.SimuVo; import com.se.simu.helper.StringHelper; import com.se.simu.service.GedbService; import com.se.simu.service.ResultService; import com.se.simu.service.SimuService; @@ -57,8 +56,8 @@ if (null == vo.getTotal() || vo.getTotal() < 1 || vo.getTotal() > 1000) { return fail("éé¨éä¸è½ä¸ºç©ºï¼ä¸åå¼å¨1~1000ä¹é´"); } if (null == vo.getDuration() || vo.getDuration() < 1 || vo.getDuration() > 120) { return fail("ä»¿çæ¶é¿ä¸è½ä¸ºç©ºï¼ä¸åå¼å¨1~120ä¹é´"); if (null == vo.getDuration() || vo.getDuration() < 1 || vo.getDuration() > 10080) { return fail("ä»¿çæ¶é¿ä¸è½ä¸ºç©ºï¼ä¸åå¼å¨1~10080ä¹é´"); } if (null == vo.getMinx() || null == vo.getMiny() || null == vo.getMaxx() || null == vo.getMaxy()) { return fail("éæ©èå´ä¸è½ä¸ºç©º", false); @@ -144,61 +143,6 @@ } return success(paged.getRecords(), paged.getTotal()); } catch (Exception ex) { return fail(ex, null); } } @ApiOperation(value = "å½åæ¶é´ *") @GetMapping("/getTime") public Object getTime() { 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() { try { DataPo data = new DataPo(); data.setEpsg(4548); data.setInPath("20241010095328"); data.setStartTime(StringHelper.YMDHMS_FORMAT.parse("2024-09-30 00:00:00")); resultService.process(data); return success("ok"); } catch (Exception ex) { return fail(ex, null); } } @ApiOperation(value = "testSww2Tif *") @GetMapping("/testSww2Tif") public R<Object> testSww2Tif() { try { DataPo data = new DataPo(); data.setEpsg(4548); data.setInPath("20241010095328"); data.setStartTime(StringHelper.YMDHMS_FORMAT.parse("2024-09-30 00:00:00")); Object rs = uwService.copeDrainFiles(data); return success(rs); } catch (Exception ex) { return fail(ex, null); } src/main/java/com/se/simu/controller/TestController.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,115 @@ package com.se.simu.controller; import com.se.simu.domain.po.DataPo; import com.se.simu.domain.vo.R; import com.se.simu.helper.StringHelper; import com.se.simu.service.GedbService; import com.se.simu.service.ResultService; import com.se.simu.service.SimuService; import com.se.simu.service.UwService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import lombok.extern.slf4j.Slf4j; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import javax.annotation.Resource; /** * Testæ§å¶å¨ * * @author WWW * @date 2024-10-30 */ @Api(tags = "Test") @Slf4j @RestController @RequestMapping("/test") @SuppressWarnings("ALL") public class TestController extends BaseController { @Resource UwService uwService; @Resource GedbService gedbService; @Resource SimuService simuService; @Resource ResultService resultService; @ApiOperation(value = "å½åæ¶é´ *") @GetMapping("/getTime") public Object getTime() { 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() { try { DataPo data = new DataPo(); data.setEpsg(4548); data.setInPath("20241010095328"); data.setStartTime(StringHelper.YMDHMS_FORMAT.parse("2024-09-30 00:00:00")); resultService.process(data); return success("ok"); } catch (Exception ex) { return fail(ex, null); } } @ApiOperation(value = "testSww2Tif *") @GetMapping("/testSww2Tif") public R<Object> testSww2Tif() { try { DataPo data = new DataPo(); data.setEpsg(4548); data.setInPath("20241010095328"); data.setStartTime(StringHelper.YMDHMS_FORMAT.parse("2024-09-30 00:00:00")); Object rs = uwService.copeDrainFiles(data); return success(rs); } catch (Exception ex) { return fail(ex, null); } } @ApiOperation(value = "testRainfall *") @GetMapping("/testRainfall") public R<Object> testRainfall() { try { DataPo data = new DataPo(); data.setEpsg(4548); data.setInPath("20241010095328"); data.setStartTime(StringHelper.YMDHMS_FORMAT.parse("2024-09-30 00:00:00")); Object rs = uwService.copeDrainFiles(data); return success(rs); } catch (Exception ex) { return fail(ex, null); } } } src/main/java/com/se/simu/service/ResultService.java
@@ -532,30 +532,30 @@ } /** * å¤çéæ°´æ²çº¿æä»¶æ²çº¿å¾ * å¤çéæ°´æ²çº¿æä»¶æ²çº¿å¾ */ public void copeRainFallJson(ResultDto dto, LayerDto layer) throws IOException, ParseException { String rainGageFilePath = config.getInPath() + File.separator + dto.getServiceName() + File.separator + "RainGage.dat"; String filePath = dto.getOutPath() + File.separator + "rainfall.json"; String line; Map<Long,Double> rainFallJsons = new LinkedHashMap<>(); Map<String, Double> rainFallJsons = new LinkedHashMap<>(); SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm"); BufferedReader br = new BufferedReader(new FileReader(rainGageFilePath)); //å¤ç第ä¸è¡æ°æ® if ((line = br.readLine()) != null) { while ((line = br.readLine()) != null) { // å¤çæ¯ä¸è¡æ°æ® String[] rainFall = line.split(" "); // å¤ç第ä¸è¡æ°æ® if ((line = br.readLine()) != null) { while ((line = br.readLine()) != null) { // å¤çæ¯ä¸è¡æ°æ® String[] rainFall = line.split(" "); if (rainFall.length < 7) continue; if (rainFall.length < 7) continue; String sdt = rainFall[1]+"-"+rainFall[2]+"-"+rainFall[3]+" "+rainFall[4]+":"+rainFall[5]; BigDecimal num = new BigDecimal(rainFall[6]); rainFallJsons.put(sdf.parse(sdt).getTime()/1000,num.setScale(2, RoundingMode.HALF_UP).doubleValue()); } String sdt = rainFall[1] + "-" + rainFall[2] + "-" + rainFall[3] + " " + rainFall[4] + ":" + rainFall[5]; BigDecimal num = new BigDecimal(rainFall[6]); rainFallJsons.put("" + sdf.parse(sdt).getTime(), num.setScale(2, RoundingMode.HALF_UP).doubleValue()); } } FileWriter fw = new FileWriter(filePath); BufferedWriter bw = new BufferedWriter(fw);