src/main/java/com/se/nsl/controller/SimuPoController.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/main/java/com/se/nsl/controller/TestController.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/main/java/com/se/nsl/controller/WaterController.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/main/java/com/se/nsl/mapper/RegionMapper.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/main/java/com/se/nsl/mapper/SimuMapper.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/main/java/com/se/nsl/mapper/SimuPoMapper.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/main/java/com/se/nsl/service/SimuFilesService.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/main/java/com/se/nsl/service/SimuPoService.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/main/resources/mapper/SimuMapper.xml | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/test/java/com/se/nsl/AppTest.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
src/main/java/com/se/nsl/controller/SimuPoController.java
ÎļþÃû´Ó src/main/java/com/se/nsl/controller/SimuController.java ÐÞ¸Ä @@ -19,7 +19,7 @@ import com.se.nsl.enums.SemErrorEnums; import com.se.nsl.helper.StringHelper; import com.se.nsl.helper.WebHelper; import com.se.nsl.mapper.SimuMapper; import com.se.nsl.mapper.SimuPoMapper; import io.swagger.annotations.*; import lombok.SneakyThrows; import lombok.extern.slf4j.Slf4j; @@ -43,9 +43,9 @@ @Api(tags = "仿ç管ç") @Slf4j @RestController @RequestMapping("/simu") @RequestMapping("/simuPo") @SuppressWarnings("ALL") public class SimuController extends BaseController { public class SimuPoController extends BaseController { @Resource UwService uwService; @@ -53,7 +53,7 @@ GedbService gedbService; @Resource SimuService simuService; SimuPoService simuPoService; @Resource SimuFilesService simuFilesService; @@ -62,7 +62,7 @@ PropertiesConfig config; @Resource SimuMapper simuMapper; SimuPoMapper simuPoMapper; @Value("${simu-app.filePath}") private String uploadedFolder; @@ -96,7 +96,7 @@ vo.setPid(0); } if (null == vo.getNum() || vo.getNum() < 1) { vo.setNum(simuService.getMaxId() + 1); vo.setNum(simuPoService.getMaxId() + 1); } if (null == vo.getPid() || vo.getPid() < 0) { vo.setPid(0); @@ -105,7 +105,7 @@ vo.setStartTime(new Date()); } if (vo.getPid() > 0) { SimuPo pp = simuService.getSimuByPid(vo.getPid()); SimuPo pp = simuPoService.getSimuByPid(vo.getPid()); if (null == pp) { return fail("pidä¸åå¨"); } @@ -126,7 +126,7 @@ } } boolean flag = simuService.create(vo); boolean flag = simuPoService.create(vo); return success(flag, flag ? "æå" : "失败"); } catch (Exception ex) { @@ -145,7 +145,7 @@ return fail("æ¥å¿IDä¸è½ä¸ºç©º", null); } int count = simuService.del(ids); int count = simuPoService.del(ids); return success(count); } catch (Exception ex) { @@ -167,7 +167,7 @@ vo.setPageIndex(1); } IPage<SimuPo> paged = simuService.get(vo); IPage<SimuPo> paged = simuPoService.get(vo); if (null == paged) { return success(null, 0); } @@ -350,14 +350,14 @@ vo.setPid(0); } if (null == vo.getNum() || vo.getNum() < 1) { vo.setNum(simuService.getMaxId() + 1); vo.setNum(simuPoService.getMaxId() + 1); } if (null == vo.getStartTime()) { vo.setStartTime(new Date()); } // 鲿±ä½ä¸ if (vo.getPid() > 0) { SimuPo pp = simuService.getSimuByPid(vo.getPid()); SimuPo pp = simuPoService.getSimuByPid(vo.getPid()); if (null == pp) { return fail("pidä¸åå¨"); } @@ -427,14 +427,14 @@ simu.setPointUrl(vo.getPointName()); simu.setLinkUrl(vo.getLinkName()); simu.setSemUrl(inPath + "\\" + vo.getSemUrl()); int rows = simuMapper.insert(simu); int rows = simuPoMapper.insert(simu); return simu; } @ApiOperation(value = "è·åç¹è·¯å¾") @GetMapping("/getPointUrl") public R<String> getPointUrl(@RequestParam("id") Integer id) throws Exception { SimuPo po = simuService.getSimuById(id); SimuPo po = simuPoService.getSimuById(id); String token = EntityLibraryUtils.login(); if (po != null) { return success(po.getPointUrl().replace("{token}", token)); @@ -445,7 +445,7 @@ @ApiOperation(value = "è·å线路å¾") @GetMapping("/getLineUrl") public R<String> getLineUrl(@RequestParam("id") Integer id) throws Exception { SimuPo po = simuService.getSimuById(id); SimuPo po = simuPoService.getSimuById(id); String token = EntityLibraryUtils.login(); if (po != null) { return success(po.getLinkUrl().replace("{token}", token)); @@ -522,7 +522,7 @@ if (null != rs) simu.setResult(rs); simu.setUpdateTime(WebHelper.getCurrentTimestamp()); simuMapper.updateById(simu); simuPoMapper.updateById(simu); } public String assemble(String name, String layerid, String bbox, String token) throws Exception { src/main/java/com/se/nsl/controller/TestController.java
@@ -32,7 +32,7 @@ GedbService gedbService; @Resource SimuService simuService; SimuPoService simuPoService; @Resource Hdf5Service hdf5Service; src/main/java/com/se/nsl/controller/WaterController.java
@@ -5,7 +5,7 @@ import com.se.nsl.domain.vo.R; import com.se.nsl.helper.StringHelper; import com.se.nsl.helper.WebHelper; import com.se.nsl.service.SimuService; import com.se.nsl.service.SimuPoService; import com.se.nsl.service.WaterService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiImplicitParam; @@ -29,7 +29,7 @@ @RequestMapping("/waterlogging") public class WaterController extends BaseController { @Resource SimuService simuService; SimuPoService simuPoService; @Resource WaterService waterService; @@ -169,7 +169,7 @@ @GetMapping("/{serviceName}/getWaterHeight") public R<Object> getWaterHeight(@PathVariable String serviceName, double x, double y, long timestamp, HttpServletResponse res) { try { SimuPo simu = simuService.getSimuByServiceName(serviceName); SimuPo simu = simuPoService.getSimuByServiceName(serviceName); if (null == simu) { return null; } src/main/java/com/se/nsl/mapper/RegionMapper.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,12 @@ package com.se.nsl.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.se.nsl.domain.po.Region; import org.apache.ibatis.annotations.Mapper; import org.springframework.stereotype.Repository; @Mapper @Repository @SuppressWarnings("ALL") public interface RegionMapper extends BaseMapper<Region> { } src/main/java/com/se/nsl/mapper/SimuMapper.java
@@ -1,13 +1,13 @@ package com.se.nsl.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.se.nsl.domain.po.SimuPo; import com.se.nsl.domain.po.Simu; import org.apache.ibatis.annotations.Mapper; import org.springframework.stereotype.Repository; @Mapper @Repository @SuppressWarnings("ALL") public interface SimuMapper extends BaseMapper<SimuPo> { Integer selectMaxId(); public interface SimuMapper extends BaseMapper<Simu> { } src/main/java/com/se/nsl/mapper/SimuPoMapper.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,13 @@ package com.se.nsl.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.se.nsl.domain.po.SimuPo; import org.apache.ibatis.annotations.Mapper; import org.springframework.stereotype.Repository; @Mapper @Repository @SuppressWarnings("ALL") public interface SimuPoMapper extends BaseMapper<SimuPo> { Integer selectMaxId(); } src/main/java/com/se/nsl/service/SimuFilesService.java
@@ -16,7 +16,7 @@ import com.se.nsl.domain.vo.SimuVo; import com.se.nsl.helper.StringHelper; import com.se.nsl.helper.WebHelper; import com.se.nsl.mapper.SimuMapper; import com.se.nsl.mapper.SimuPoMapper; import lombok.SneakyThrows; import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Service; @@ -40,7 +40,7 @@ public class SimuFilesService { @Resource SimuMapper simuMapper; SimuPoMapper simuPoMapper; @Resource PropertiesConfig config; @@ -60,7 +60,7 @@ Page<SimuPo> page = new Page<>(vo.getPageIndex(), vo.getPageSize()); page.addOrder(OrderItem.desc("id")); IPage<SimuPo> paged = simuMapper.selectPage(page, wrapper); IPage<SimuPo> paged = simuPoMapper.selectPage(page, wrapper); return paged; } @@ -129,7 +129,7 @@ simu.setSemUrl(vo.getSemUrl()); simu.setPointUrl(vo.getPointName()); simu.setLinkUrl(vo.getLinkName()); int rows = simuMapper.insert(simu); int rows = simuPoMapper.insert(simu); if (rows > 0) { asyncCall(simu,token); } @@ -224,6 +224,6 @@ if (null != rs) simu.setResult(rs); simu.setUpdateTime(WebHelper.getCurrentTimestamp()); simuMapper.updateById(simu); simuPoMapper.updateById(simu); } } src/main/java/com/se/nsl/service/SimuPoService.java
ÎļþÃû´Ó src/main/java/com/se/nsl/service/SimuService.java ÐÞ¸Ä @@ -16,7 +16,7 @@ import com.se.nsl.domain.vo.SimuVo; import com.se.nsl.helper.StringHelper; import com.se.nsl.helper.WebHelper; import com.se.nsl.mapper.SimuMapper; import com.se.nsl.mapper.SimuPoMapper; import lombok.SneakyThrows; import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Service; @@ -32,9 +32,9 @@ @Slf4j @Service @SuppressWarnings("ALL") public class SimuService { public class SimuPoService { @Resource SimuMapper simuMapper; SimuPoMapper simuPoMapper; @Resource PropertiesConfig config; @@ -54,7 +54,7 @@ Page<SimuPo> page = new Page<>(vo.getPageIndex(), vo.getPageSize()); page.addOrder(OrderItem.desc("id")); IPage<SimuPo> paged = simuMapper.selectPage(page, wrapper); IPage<SimuPo> paged = simuPoMapper.selectPage(page, wrapper); return paged; } @@ -81,7 +81,7 @@ } public int del(List<Integer> ids) { List<SimuPo> list = simuMapper.selectBatchIds(ids); List<SimuPo> list = simuPoMapper.selectBatchIds(ids); if (null != list && list.size() > 0) { for (SimuPo po : list) { try { @@ -99,7 +99,7 @@ } } return simuMapper.deleteBatchIds(ids); return simuPoMapper.deleteBatchIds(ids); } private boolean delDir(String dir) { @@ -112,7 +112,7 @@ } public Integer getMaxId() { return simuMapper.selectMaxId(); return simuPoMapper.selectMaxId(); } public SimuPo getSimuByPid(Integer pid) { @@ -120,10 +120,10 @@ wrapper.eq("id", pid); wrapper.last("limit 1"); return simuMapper.selectOne(wrapper); return simuPoMapper.selectOne(wrapper); } public SimuPo getSimuById(Integer id) { return simuMapper.selectById(id); return simuPoMapper.selectById(id); } public SimuPo getSimuByServiceName(String serviceName) { @@ -135,7 +135,7 @@ wrapper.eq("service_name", serviceName); wrapper.last("limit 1"); return simuMapper.selectOne(wrapper); return simuPoMapper.selectOne(wrapper); } public boolean create(CreateSimuVo vo) { @@ -153,7 +153,7 @@ simu.setServiceName(date); simu.setCreateTime(new Timestamp(now.getTime())); int rows = simuMapper.insert(simu); int rows = simuPoMapper.insert(simu); if (rows > 0) { asyncCall(simu); } @@ -231,6 +231,6 @@ if (null != rs) simu.setResult(rs); simu.setUpdateTime(WebHelper.getCurrentTimestamp()); simuMapper.updateById(simu); simuPoMapper.updateById(simu); } } src/main/resources/mapper/SimuMapper.xml
@@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <mapper namespace="com.se.nsl.mapper.SimuMapper"> <mapper namespace="com.se.nsl.mapper.SimuPoMapper"> <select id="selectMaxId" resultType="java.lang.Integer"> select coalesce(max(id), 0) from bs.simu; </select> src/test/java/com/se/nsl/AppTest.java
@@ -30,7 +30,7 @@ @SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.DEFINED_PORT) public class AppTest { @Test //@Test public void procDepthFiles() { String path = "D:\\other\\simu\\uwsolver\\20250412\\depth"; /*for (File file : new File(path).listFiles()) { @@ -66,7 +66,7 @@ } } @Test //@Test public void collectPngToList() { System.out.println("------------------------------------------- start"); int size = 1024;