| | |
| | | from lf.sys_user a inner join lf.sys_role_user b on a.id = b.userid inner join lf.sys_role c on b.roleid = c.id |
| | | where c.id = 15 |
| | | |
| | | select *, st_astext(geom) as wkt from bs.m_pipesegment; |
| | | select * from bs.m_pipesegment; |
| | | select gid, pipename, segname from bs.m_pipesegment order by pipename, segname; |
| | | |
| | | select * from bd.dlg_25w_hydl; |
| | | select * from bd.dlg_25w_lrdl; |
| | | select * from bd.dlg_25w_lrrl; |
| | | select * from bd.dlg_25w_hyda; |
| | | |
| | | SELECT a.name as acrossName, |
| | | b.segname as segName, |
| | | b.remarks, |
| | | b.pipename as pipeName, |
| | | st_length( st_geographyfromtext( st_astext( st_intersection( ST_MakeValid(a.geom), ST_MakeValid(b.geom) ) ) ) ) AS acrossLength, |
| | | st_astext(b.geom) as wkt |
| | | FROM bd.dlg_25w_hyda AS a, |
| | | (SELECT * |
| | | FROM bs.m_pipesegment |
| | | WHERE segname = 'DD' ) AS b |
| | | WHERE ST_Intersects(a.geom, b.geom) |
| | | |
| | | select a.name as acrossName, b.segname as segName, b.remarks, b.pipename as pipeName, |
| | | cast( st_length( st_geographyfromtext( st_astext( st_intersection(ST_MakeValid(a.geom), ST_MakeValid(b.geom) ) ) ) ) as decimal(12, 3) ) AS acrossLength, |
| | | st_astext( st_intersection( ST_MakeValid(a.geom), ST_MakeValid(b.geom) ) ) as wkt |
| | | from bd.dlg_25w_hyda as a, (select segname, remarks, pipename, geom from bs.m_pipesegment where gid = 24) as b |
| | | where ST_Intersects(a.geom, b.geom) |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | |
| | | * æ°æ®ç³è¯· |
| | | * @author WWW |
| | | */ |
| | | @Api(tags = "è¿ç»´ç®¡ç\\æ°æ®ç³è¯·") |
| | | @Api(tags = "综åå±ç¤º\\æ°æ®ç³è¯·") |
| | | @RestController |
| | | @RequestMapping("/apply") |
| | | public class ApplyController extends BaseController { |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.lf.server.controller.show; |
| | | |
| | | import com.lf.server.annotation.SysLog; |
| | | import com.lf.server.controller.all.BaseController; |
| | | import com.lf.server.entity.all.ResponseMsg; |
| | | import com.lf.server.entity.all.StaticData; |
| | | import com.lf.server.entity.show.PipelineEntity; |
| | | import com.lf.server.service.show.PipelineService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.*; |
| | | |
| | | /** |
| | | * 管éåæ |
| | | * @author WWW |
| | | */ |
| | | @Api(tags = "综åå±ç¤º\\管éåæ") |
| | | @RestController |
| | | @RequestMapping("/pipeline") |
| | | public class PipelineController extends BaseController { |
| | | @Autowired |
| | | PipelineService pipelineService; |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ¥è¯¢ç®¡æ®µ") |
| | | @GetMapping(value = "/selectSegNames") |
| | | public ResponseMsg<Object> selectSegNames() { |
| | | try { |
| | | List<PipelineEntity> rs = pipelineService.selectSegNames(); |
| | | |
| | | return success(rs); |
| | | } catch (Exception ex) { |
| | | return fail(ex.getMessage(), null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æ¥è¯¢ç®¡çº¿åæ") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "pe", value = "管éåæå®ä½ç±»", dataType = "PipelineEntity", paramType = "body") |
| | | }) |
| | | @ResponseBody |
| | | @PostMapping(value = "/selectPipeAnalysis") |
| | | public ResponseMsg<Object> selectPipeAnalysis(@RequestBody PipelineEntity pe) { |
| | | try { |
| | | if (null == pe.getGid() || pe.getGid() < 1) { |
| | | return fail("请è¾å
¥ç®¡æ®µID"); |
| | | } |
| | | if (null == pe.getTabs() || 0 == pe.getTabs().size()) { |
| | | return fail("请è¾å
¥è¡¨å"); |
| | | } |
| | | if (!checkTabs(pe.getTabs())) { |
| | | return fail("åå¨éæ³è¡¨å"); |
| | | } |
| | | |
| | | Map<String, Object> map = new HashMap<>(); |
| | | for (String tab : pe.getTabs()) { |
| | | List<PipelineEntity> rs = pipelineService.selectPipeAnalysis(tab, pe.getGid()); |
| | | map.put(tab, rs); |
| | | } |
| | | |
| | | return success(map); |
| | | } catch (Exception ex) { |
| | | return fail(ex.getMessage(), null); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * æ£æ¥è¡¨å |
| | | */ |
| | | private boolean checkTabs(List<String> tabs) { |
| | | for (String tab : tabs) { |
| | | if (!StaticData.PIPE_ANALYSIS_TABS.contains(tab)) { |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | return true; |
| | | } |
| | | } |
| | |
| | | * GDBæé¤å段 |
| | | */ |
| | | public final static List<String> GDB_EXCLUDE_FIELDS = new ArrayList<>(Arrays.asList("geom", "objectid", "shape_leng", "shape_area", "serialVersionUID", "dirName", "depName", "verName", "createName", "updateName")); |
| | | |
| | | /** |
| | | * 管线åæè¡¨åéå |
| | | */ |
| | | public final static List<String> PIPE_ANALYSIS_TABS = new ArrayList<>(Arrays.asList("bd.dlg_25w_hydl", "bd.dlg_25w_lrdl", "bd.dlg_25w_lrrl", "bd.dlg_25w_hyda")); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.lf.server.entity.show; |
| | | |
| | | import com.alibaba.fastjson.annotation.JSONField; |
| | | import com.fasterxml.jackson.annotation.JsonInclude; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 管éåæå®ä½ç±» |
| | | * |
| | | * @author xingjinshuang@smartearth.cn |
| | | * @date 2022/12/26 |
| | | */ |
| | | public class PipelineEntity implements Serializable { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * 表å |
| | | */ |
| | | @JSONField(serialize = false) |
| | | @JsonInclude(JsonInclude.Include.NON_NULL) |
| | | private List<String> tabs; |
| | | |
| | | /** |
| | | * 主é®ID |
| | | */ |
| | | private Integer gid; |
| | | |
| | | /** |
| | | * 管线 |
| | | */ |
| | | private String pipeName; |
| | | |
| | | /** |
| | | * 管段 |
| | | */ |
| | | private String segName; |
| | | |
| | | /** |
| | | * ç©¿è¶åç§° |
| | | */ |
| | | private String acrossName; |
| | | |
| | | /** |
| | | * ç©¿è¶é¿åº¦ |
| | | */ |
| | | private double acrossLength; |
| | | |
| | | /** |
| | | * 夿³¨ |
| | | */ |
| | | private String remarks; |
| | | |
| | | /** |
| | | * wkt |
| | | */ |
| | | private String wkt; |
| | | |
| | | public Integer getGid() { |
| | | return gid; |
| | | } |
| | | |
| | | public void setGid(Integer gid) { |
| | | this.gid = gid; |
| | | } |
| | | |
| | | public List<String> getTabs() { |
| | | return tabs; |
| | | } |
| | | |
| | | public void setTabs(List<String> tabs) { |
| | | this.tabs = tabs; |
| | | } |
| | | |
| | | public String getPipeName() { |
| | | return pipeName; |
| | | } |
| | | |
| | | public void setPipeName(String pipeName) { |
| | | this.pipeName = pipeName; |
| | | } |
| | | |
| | | public String getSegName() { |
| | | return segName; |
| | | } |
| | | |
| | | public void setSegName(String segName) { |
| | | this.segName = segName; |
| | | } |
| | | |
| | | public String getAcrossName() { |
| | | return acrossName; |
| | | } |
| | | |
| | | public void setAcrossName(String acrossName) { |
| | | this.acrossName = acrossName; |
| | | } |
| | | |
| | | public double getAcrossLength() { |
| | | return acrossLength; |
| | | } |
| | | |
| | | public void setAcrossLength(double acrossLength) { |
| | | this.acrossLength = acrossLength; |
| | | } |
| | | |
| | | public String getRemarks() { |
| | | return remarks; |
| | | } |
| | | |
| | | public void setRemarks(String remarks) { |
| | | this.remarks = remarks; |
| | | } |
| | | |
| | | public String getWkt() { |
| | | return wkt; |
| | | } |
| | | |
| | | public void setWkt(String wkt) { |
| | | this.wkt = wkt; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.lf.server.mapper.show; |
| | | |
| | | import com.lf.server.entity.show.PipelineEntity; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.springframework.stereotype.Repository; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 管éåææ å°ç±» |
| | | * @author WWW |
| | | */ |
| | | @Mapper |
| | | @Repository |
| | | public interface PipelineMapper { |
| | | /** |
| | | * æ¥è¯¢ç®¡æ®µ |
| | | * |
| | | * @return 管线å®ä½ç±»éå |
| | | */ |
| | | public List<PipelineEntity> selectSegNames(); |
| | | |
| | | /** |
| | | * æ¥è¯¢ç®¡çº¿åæ |
| | | * |
| | | * @param tab 表å |
| | | * @param gid ID |
| | | * @return 管线å®ä½ç±»éå |
| | | */ |
| | | public List<PipelineEntity> selectPipeAnalysis(String tab, Integer gid); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.lf.server.service.show; |
| | | |
| | | import com.lf.server.entity.show.PipelineEntity; |
| | | import com.lf.server.mapper.show.PipelineMapper; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 管éåææå¡ç±» |
| | | * @author WWW |
| | | */ |
| | | @Service |
| | | public class PipelineService implements PipelineMapper { |
| | | @Autowired |
| | | PipelineMapper pipelineMapper; |
| | | |
| | | @Override |
| | | public List<PipelineEntity> selectSegNames() { |
| | | return pipelineMapper.selectSegNames(); |
| | | } |
| | | |
| | | @Override |
| | | public List<PipelineEntity> selectPipeAnalysis(String tab, Integer gid) { |
| | | return pipelineMapper.selectPipeAnalysis(tab, gid); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <?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.lf.server.mapper.show.PipelineMapper"> |
| | | <select id="selectSegNames" resultType="com.lf.server.entity.show.PipelineEntity"> |
| | | select gid, pipename, segname from bs.m_pipesegment order by pipename, segname; |
| | | </select> |
| | | |
| | | <select id="selectPipeAnalysis" resultType="com.lf.server.entity.show.PipelineEntity"> |
| | | select a.name as acrossName, b.segname as segName, b.remarks, b.pipename as pipeName, |
| | | cast( st_length( st_geographyfromtext( st_astext( st_intersection(ST_MakeValid(a.geom), ST_MakeValid(b.geom) ) ) ) ) as decimal(12, 2) ) AS acrossLength, |
| | | st_astext( st_intersection( ST_MakeValid(a.geom), ST_MakeValid(b.geom) ) ) as wkt |
| | | from ${tab} as a, (select segname, remarks, pipename, geom from bs.m_pipesegment where gid = #{gid} ) as b |
| | | where ST_Intersects(a.geom, b.geom) |
| | | </select> |
| | | </mapper> |
| | |
| | | http://192.168.20.39:12306/ |
| | | http://192.168.20.39:12315/ |
| | | http://192.168.20.39:12316/ |
| | | http://192.168.20.39:12316/server/druid/sql.html |
| | | ------------------------------------------------------------------------------- |
| | | String path = System.getProperty("user.dir"); |
| | | String uid = RsaHelper.decrypt(user.getUid()); |