Commit 72bbdd0102faa95412f7a054f1bb83136a93b458

Authored by yiming
1 parent c1ff5367

bf2

bsthLineProfiles/src/main/java/com/ruoyi/project/system/line/controller/BsthTLineController.java
@@ -12,6 +12,7 @@ import com.ruoyi.framework.web.domain.AjaxResult; @@ -12,6 +12,7 @@ import com.ruoyi.framework.web.domain.AjaxResult;
12 import com.ruoyi.framework.web.page.TableDataInfo; 12 import com.ruoyi.framework.web.page.TableDataInfo;
13 import com.ruoyi.project.system.dict.domain.DictData; 13 import com.ruoyi.project.system.dict.domain.DictData;
14 import com.ruoyi.project.system.dict.service.IDictDataService; 14 import com.ruoyi.project.system.dict.service.IDictDataService;
  15 +import com.ruoyi.project.system.line.domain.BsthStation;
15 import com.ruoyi.project.system.line.domain.BsthTLine; 16 import com.ruoyi.project.system.line.domain.BsthTLine;
16 import com.ruoyi.project.system.line.domain.BsthTLineKFK; 17 import com.ruoyi.project.system.line.domain.BsthTLineKFK;
17 import com.ruoyi.project.system.line.domain.Company; 18 import com.ruoyi.project.system.line.domain.Company;
@@ -315,12 +316,9 @@ public class BsthTLineController extends BaseController @@ -315,12 +316,9 @@ public class BsthTLineController extends BaseController
315 316
316 @GetMapping("/getStation") 317 @GetMapping("/getStation")
317 @ResponseBody 318 @ResponseBody
318 - public JSONObject getStation(String lng,String lat,String dis) 319 + public AjaxResult getStation(String lng,String lat,String dis)
319 { 320 {
320 - String url="https://180.167.126.126:18991/prod-api/service/interfact/getStation?lng="+lng+"&lat="+lat+"&dis="+dis;  
321 - String s=HttpUtil.get(url);  
322 - System.out.println(s);  
323 - return JSONObject.parseObject(s); 321 + return AjaxResult.success(bsthTLineService.selectBsthStationListByLoc(lng,lat,dis));
324 } 322 }
325 323
326 } 324 }
bsthLineProfiles/src/main/java/com/ruoyi/project/system/line/domain/BsthStation.java 0 → 100644
  1 +package com.ruoyi.project.system.line.domain;
  2 +
  3 +import org.apache.commons.lang3.builder.ToStringBuilder;
  4 +import org.apache.commons.lang3.builder.ToStringStyle;
  5 +
  6 +/**
  7 + * 站点信息 过程或现状的站级信息都引用此站点信息对象 bsth_t_station
  8 + *
  9 + * @author luwu
  10 + * @date 2021-05-28
  11 + */
  12 +public class BsthStation
  13 +{
  14 + private static final long serialVersionUID = 1L;
  15 +
  16 + /** 主键 */
  17 + private Long id;
  18 + private String standardStationCode;
  19 +
  20 + /** 站点编码 */
  21 + private String stationCode;
  22 +
  23 + /** 站点名 */
  24 + private String stationName;
  25 +
  26 + /** 站点地址 */
  27 + private String stationAddress;
  28 +
  29 + /** 站亭类型 站杆/站亭 */
  30 + private String boardType;
  31 +
  32 + /** 站点类型 港湾式/沿路占车道 */
  33 + private String stationType;
  34 +
  35 + /** 环域(内环、内至中环) */
  36 + private String annular;
  37 +
  38 + /** 片区(南北片) */
  39 + private String area;
  40 +
  41 + /** 道路名称 */
  42 + private String roadName;
  43 +
  44 + /** 经度 */
  45 + private Double lonBd;
  46 +
  47 + /** 纬度 */
  48 + private Double latBd;
  49 +
  50 + /** 城建x坐标 */
  51 + private Double lonGps;
  52 +
  53 + /** 城建y坐标 */
  54 + private Double latGps;
  55 +
  56 + /** 区属 浦东新区 */
  57 + private String district;
  58 +
  59 + /** 经过线路 */
  60 + private String lineList;
  61 +
  62 + /** 是否有地铁 */
  63 + private String hasMetro;
  64 +
  65 + private String remark;
  66 +
  67 + public void setId(Long id)
  68 + {
  69 + this.id = id;
  70 + }
  71 +
  72 + public Long getId()
  73 + {
  74 + return id;
  75 + }
  76 + public void setStandardStationCode(String standardStationCode)
  77 + {
  78 + this.standardStationCode = standardStationCode;
  79 + }
  80 +
  81 + public String getStandardStationCode()
  82 + {
  83 + return standardStationCode;
  84 + }
  85 + public void setStationCode(String stationCode)
  86 + {
  87 + this.stationCode = stationCode;
  88 + }
  89 +
  90 + public String getStationCode()
  91 + {
  92 + return stationCode;
  93 + }
  94 + public void setStationName(String stationName)
  95 + {
  96 + this.stationName = stationName;
  97 + }
  98 +
  99 + public String getStationName()
  100 + {
  101 + return stationName;
  102 + }
  103 + public void setStationAddress(String stationAddress)
  104 + {
  105 + this.stationAddress = stationAddress;
  106 + }
  107 +
  108 + public String getStationAddress()
  109 + {
  110 + return stationAddress;
  111 + }
  112 +
  113 + public String getBoardType() {
  114 + return boardType;
  115 + }
  116 +
  117 + public void setBoardType(String boardType) {
  118 + this.boardType = boardType;
  119 + }
  120 +
  121 + public void setStationType(String stationType)
  122 + {
  123 + this.stationType = stationType;
  124 + }
  125 +
  126 + public String getStationType()
  127 + {
  128 + return stationType;
  129 + }
  130 + public void setAnnular(String annular)
  131 + {
  132 + this.annular = annular;
  133 + }
  134 +
  135 + public String getAnnular()
  136 + {
  137 + return annular;
  138 + }
  139 + public void setArea(String area)
  140 + {
  141 + this.area = area;
  142 + }
  143 +
  144 + public String getArea()
  145 + {
  146 + return area;
  147 + }
  148 + public void setRoadName(String roadName)
  149 + {
  150 + this.roadName = roadName;
  151 + }
  152 +
  153 + public String getRoadName()
  154 + {
  155 + return roadName;
  156 + }
  157 + public void setLonBd(Double lonBd)
  158 + {
  159 + this.lonBd = lonBd;
  160 + }
  161 +
  162 + public Double getLonBd()
  163 + {
  164 + return lonBd;
  165 + }
  166 + public void setLatBd(Double latBd)
  167 + {
  168 + this.latBd = latBd;
  169 + }
  170 +
  171 + public Double getLatBd()
  172 + {
  173 + return latBd;
  174 + }
  175 + public void setLonGps(Double lonGps)
  176 + {
  177 + this.lonGps = lonGps;
  178 + }
  179 +
  180 + public Double getLonGps()
  181 + {
  182 + return lonGps;
  183 + }
  184 + public void setLatGps(Double latGps)
  185 + {
  186 + this.latGps = latGps;
  187 + }
  188 +
  189 + public Double getLatGps()
  190 + {
  191 + return latGps;
  192 + }
  193 + public void setDistrict(String district)
  194 + {
  195 + this.district = district;
  196 + }
  197 +
  198 + public String getDistrict()
  199 + {
  200 + return district;
  201 + }
  202 + public void setLineList(String lineList)
  203 + {
  204 + this.lineList = lineList;
  205 + }
  206 +
  207 + public String getLineList()
  208 + {
  209 + return lineList;
  210 + }
  211 + public void setHasMetro(String hasMetro)
  212 + {
  213 + this.hasMetro = hasMetro;
  214 + }
  215 +
  216 + public String getHasMetro()
  217 + {
  218 + return hasMetro;
  219 + }
  220 +
  221 +
  222 + @Override
  223 + public String toString() {
  224 + return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
  225 + .append("id", getId())
  226 + .append("standardStationCode", getStandardStationCode())
  227 + .append("stationCode", getStationCode())
  228 + .append("stationName", getStationName())
  229 + .append("stationAddress", getStationAddress())
  230 + .append("stationType", getStationType())
  231 + .append("annular", getAnnular())
  232 + .append("area", getArea())
  233 + .append("roadName", getRoadName())
  234 + .append("lonBd", getLonBd())
  235 + .append("latBd", getLatBd())
  236 + .append("lonGps", getLonGps())
  237 + .append("latGps", getLatGps())
  238 + .append("district", getDistrict())
  239 + .append("lineList", getLineList())
  240 + .append("hasMetro", getHasMetro())
  241 + .toString();
  242 + }
  243 +}
bsthLineProfiles/src/main/java/com/ruoyi/project/system/line/mapper/BsthStationMapper.java 0 → 100644
  1 +package com.ruoyi.project.system.line.mapper;
  2 +
  3 +
  4 +import com.ruoyi.project.system.line.domain.BsthStation;
  5 +import org.apache.ibatis.annotations.Mapper;
  6 +import org.apache.ibatis.annotations.Param;
  7 +import java.util.List;
  8 +
  9 +@Mapper
  10 +public interface BsthStationMapper
  11 +{
  12 + List<BsthStation> selectBsthStationListByLoc(@Param("lng")String lng, @Param("lat")String lat, @Param("dis")String dis);
  13 +}
bsthLineProfiles/src/main/java/com/ruoyi/project/system/line/service/IBsthTLineService.java
@@ -3,10 +3,7 @@ package com.ruoyi.project.system.line.service; @@ -3,10 +3,7 @@ package com.ruoyi.project.system.line.service;
3 import java.util.List; 3 import java.util.List;
4 import java.util.Map; 4 import java.util.Map;
5 5
6 -import com.ruoyi.project.system.line.domain.BsthTLine;  
7 -import com.ruoyi.project.system.line.domain.BsthTLineKFK;  
8 -import com.ruoyi.project.system.line.domain.Company;  
9 -import com.ruoyi.project.system.line.domain.LineHistoryReport; 6 +import com.ruoyi.project.system.line.domain.*;
10 7
11 /** 8 /**
12 * 【请填写功能名称】Service接口 9 * 【请填写功能名称】Service接口
@@ -77,4 +74,6 @@ public interface IBsthTLineService @@ -77,4 +74,6 @@ public interface IBsthTLineService
77 void getCarPlate(); 74 void getCarPlate();
78 75
79 void getDeptId(BsthTLine bsthTLine); 76 void getDeptId(BsthTLine bsthTLine);
  77 +
  78 + List<BsthStation> selectBsthStationListByLoc(String lng,String lat,String dis);
80 } 79 }
bsthLineProfiles/src/main/java/com/ruoyi/project/system/line/service/impl/BsthTLineServiceImpl.java
@@ -13,9 +13,8 @@ import com.ruoyi.common.utils.security.ShiroUtils; @@ -13,9 +13,8 @@ import com.ruoyi.common.utils.security.ShiroUtils;
13 import com.ruoyi.framework.aspectj.lang.annotation.DataScope; 13 import com.ruoyi.framework.aspectj.lang.annotation.DataScope;
14 import com.ruoyi.project.system.dict.domain.DictData; 14 import com.ruoyi.project.system.dict.domain.DictData;
15 import com.ruoyi.project.system.dict.service.IDictDataService; 15 import com.ruoyi.project.system.dict.service.IDictDataService;
16 -import com.ruoyi.project.system.line.domain.BsthTLineKFK;  
17 -import com.ruoyi.project.system.line.domain.Company;  
18 -import com.ruoyi.project.system.line.domain.LineHistoryReport; 16 +import com.ruoyi.project.system.line.domain.*;
  17 +import com.ruoyi.project.system.line.mapper.BsthStationMapper;
19 import com.ruoyi.project.system.user.domain.User; 18 import com.ruoyi.project.system.user.domain.User;
20 import org.slf4j.Logger; 19 import org.slf4j.Logger;
21 import org.slf4j.LoggerFactory; 20 import org.slf4j.LoggerFactory;
@@ -26,7 +25,6 @@ import org.springframework.stereotype.Service; @@ -26,7 +25,6 @@ import org.springframework.stereotype.Service;
26 import org.springframework.transaction.annotation.Transactional; 25 import org.springframework.transaction.annotation.Transactional;
27 26
28 import com.ruoyi.project.system.line.mapper.BsthTLineMapper; 27 import com.ruoyi.project.system.line.mapper.BsthTLineMapper;
29 -import com.ruoyi.project.system.line.domain.BsthTLine;  
30 import com.ruoyi.project.system.line.service.IBsthTLineService; 28 import com.ruoyi.project.system.line.service.IBsthTLineService;
31 import com.ruoyi.common.utils.text.Convert; 29 import com.ruoyi.common.utils.text.Convert;
32 import org.springframework.util.concurrent.ListenableFuture; 30 import org.springframework.util.concurrent.ListenableFuture;
@@ -52,6 +50,9 @@ public class BsthTLineServiceImpl implements IBsthTLineService @@ -52,6 +50,9 @@ public class BsthTLineServiceImpl implements IBsthTLineService
52 @Autowired 50 @Autowired
53 IDictDataService dictDataService; 51 IDictDataService dictDataService;
54 52
  53 + @Autowired
  54 + BsthStationMapper bsthStationMapper;
  55 +
55 /** 56 /**
56 * 查询【请填写功能名称】 57 * 查询【请填写功能名称】
57 * 58 *
@@ -488,4 +489,9 @@ public class BsthTLineServiceImpl implements IBsthTLineService @@ -488,4 +489,9 @@ public class BsthTLineServiceImpl implements IBsthTLineService
488 long deptId= bsthTLineMapper.getDeptId(company); 489 long deptId= bsthTLineMapper.getDeptId(company);
489 bsthTLine.setDeptId(deptId); 490 bsthTLine.setDeptId(deptId);
490 } 491 }
  492 +
  493 + @Override
  494 + public List<BsthStation> selectBsthStationListByLoc(String lng, String lat, String dis) {
  495 + return bsthStationMapper.selectBsthStationListByLoc(lng,lat,dis);
  496 + }
491 } 497 }
bsthLineProfiles/src/main/resources/mybatis/mybatis/system/BsthStationMapper.xml 0 → 100644
  1 +<?xml version="1.0" encoding="UTF-8" ?>
  2 +<!DOCTYPE mapper
  3 +PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  4 +"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  5 +<mapper namespace="com.ruoyi.project.system.line.mapper.BsthStationMapper">
  6 +
  7 +
  8 + <resultMap type="com.ruoyi.project.system.line.domain.BsthStation" id="BsthStationResult">
  9 + <result property="id" column="id" />
  10 + <result property="standardStationCode" column="standard_station_code" />
  11 + <result property="stationCode" column="station_code" />
  12 + <result property="stationName" column="station_name" />
  13 + <result property="stationAddress" column="station_address" />
  14 + <result property="stationType" column="station_type" />
  15 + <result property="boardType" column="board_type" />
  16 + <result property="annular" column="annular" />
  17 + <result property="area" column="area" />
  18 + <result property="roadName" column="road_name" />
  19 + <result property="lonBd" column="lon_bd" />
  20 + <result property="latBd" column="lat_bd" />
  21 + <result property="lonGps" column="lon_gps" />
  22 + <result property="latGps" column="lat_gps" />
  23 + <result property="district" column="district" />
  24 + <result property="lineList" column="line_list" />
  25 + <result property="hasMetro" column="has_metro" />
  26 + <result property="remark" column="remark" />
  27 + </resultMap>
  28 +
  29 + <select id="selectBsthStationListByLoc" resultMap="BsthStationResult">
  30 + select id, standard_station_code, station_code, station_name, station_address, station_type, board_type, annular, area, road_name, lon_bd, lat_bd, lon_gps, lat_gps, district, line_list, has_metro, remark from bsth_t_station
  31 + where sqrt(
  32 + (((${lng}-lon_bd)*PI()*12656*COS(((${lat}+lat_bd)/2)*PI()/180)/180)
  33 + *
  34 + ((${lng}-lon_bd)*PI()*12656*COS (((${lat}+lat_bd)/2)*PI()/180)/180))
  35 + +
  36 + (((${lat}-lat_bd)*PI()*12656/180)*((${lat}-lat_bd)*PI()*12656/180))
  37 + ) &lt; ${dis}
  38 + </select>
  39 +
  40 +
  41 +</mapper>
0 \ No newline at end of file 42 \ No newline at end of file
bsthLineProfiles/src/main/resources/templates/system/line/map.html
@@ -84,7 +84,7 @@ body, html, #container { @@ -84,7 +84,7 @@ body, html, #container {
84 </div> 84 </div>
85 <div class="row"> 85 <div class="row">
86 <h4></h4> 86 <h4></h4>
87 - <label class="col-sm-3"><h4 class="lf">范围</h4></label> 87 + <label class="col-sm-3"><h4 class="lf">范围(米)</h4></label>
88 <div class="col-sm-9"> 88 <div class="col-sm-9">
89 <input id="distance" class="form-control" type="text" placeholder="单位米"> 89 <input id="distance" class="form-control" type="text" placeholder="单位米">
90 </div> 90 </div>
@@ -147,7 +147,7 @@ body, html, #container { @@ -147,7 +147,7 @@ body, html, #container {
147 <form id="area" style="display: none"> 147 <form id="area" style="display: none">
148 <div class="row"> 148 <div class="row">
149 <h4></h4> 149 <h4></h4>
150 - <label class="col-sm-3"><h4 class="lf">范围</h4></label> 150 + <label class="col-sm-3"><h4 class="lf">范围(米)</h4></label>
151 <div class="col-sm-9"> 151 <div class="col-sm-9">
152 <input id="distance2" class="form-control" type="text" placeholder="单位米"> 152 <input id="distance2" class="form-control" type="text" placeholder="单位米">
153 </div> 153 </div>
@@ -250,7 +250,7 @@ body, html, #container { @@ -250,7 +250,7 @@ body, html, #container {
250 $.get("../line/getStation?lng=" 250 $.get("../line/getStation?lng="
251 +lng + "&lat=" + lat + "&dis=" 251 +lng + "&lat=" + lat + "&dis="
252 + distance / 1000, function(data) { 252 + distance / 1000, function(data) {
253 - if (data.code == "200") { 253 + if (data.code == "0") {
254 var bus=new Array(); 254 var bus=new Array();
255 for ( var i in data.data) { 255 for ( var i in data.data) {
256 (function(){ 256 (function(){
@@ -314,7 +314,7 @@ body, html, #container { @@ -314,7 +314,7 @@ body, html, #container {
314 $.get("../line/getStation?lng=" 314 $.get("../line/getStation?lng="
315 +lng + "&lat=" + lat + "&dis=" 315 +lng + "&lat=" + lat + "&dis="
316 + distance / 1000, function(data) { 316 + distance / 1000, function(data) {
317 - if (data.code == "200") { 317 + if (data.code == "0") {
318 var bus=new Array(); 318 var bus=new Array();
319 var c=0; 319 var c=0;
320 for ( var i in data.data) { 320 for ( var i in data.data) {