ÎļþÃû´Ó src/main/java/com/se/nsl/controller/SimuController.java ÐÞ¸Ä |
| | |
| | | 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; |
| | |
| | | @Api(tags = "仿ç管ç") |
| | | @Slf4j |
| | | @RestController |
| | | @RequestMapping("/simu") |
| | | @RequestMapping("/simuPo") |
| | | @SuppressWarnings("ALL") |
| | | public class SimuController extends BaseController { |
| | | public class SimuPoController extends BaseController { |
| | | @Resource |
| | | UwService uwService; |
| | | |
| | |
| | | GedbService gedbService; |
| | | |
| | | @Resource |
| | | SimuService simuService; |
| | | SimuPoService simuPoService; |
| | | |
| | | @Resource |
| | | SimuFilesService simuFilesService; |
| | |
| | | PropertiesConfig config; |
| | | |
| | | @Resource |
| | | SimuMapper simuMapper; |
| | | SimuPoMapper simuPoMapper; |
| | | |
| | | @Value("${simu-app.filePath}") |
| | | private String uploadedFolder; |
| | |
| | | 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); |
| | |
| | | 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ä¸åå¨"); |
| | | } |
| | |
| | | } |
| | | } |
| | | |
| | | boolean flag = simuService.create(vo); |
| | | boolean flag = simuPoService.create(vo); |
| | | |
| | | return success(flag, flag ? "æå" : "失败"); |
| | | } catch (Exception ex) { |
| | |
| | | return fail("æ¥å¿IDä¸è½ä¸ºç©º", null); |
| | | } |
| | | |
| | | int count = simuService.del(ids); |
| | | int count = simuPoService.del(ids); |
| | | |
| | | return success(count); |
| | | } catch (Exception ex) { |
| | |
| | | vo.setPageIndex(1); |
| | | } |
| | | |
| | | IPage<SimuPo> paged = simuService.get(vo); |
| | | IPage<SimuPo> paged = simuPoService.get(vo); |
| | | if (null == paged) { |
| | | return success(null, 0); |
| | | } |
| | |
| | | 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ä¸åå¨"); |
| | | } |
| | |
| | | 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)); |
| | |
| | | @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)); |
| | |
| | | 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 { |