Commit 48c333ed2dc107145c7edfe80b45f0048d644475

Authored by 王通
1 parent 8290dc9d

1.进出场判断是否在规划道路行驶,对此路径的规划工具,与站点编辑在一起

@@ -400,6 +400,12 @@ @@ -400,6 +400,12 @@
400 <version>1.0.0</version> 400 <version>1.0.0</version>
401 </dependency> 401 </dependency>
402 402
  403 + <!-- geotool -->
  404 + <dependency>
  405 + <groupId>org.locationtech.jts</groupId>
  406 + <artifactId>jts-core</artifactId>
  407 + <version>1.16.1</version>
  408 + </dependency>
403 </dependencies> 409 </dependencies>
404 410
405 <dependencyManagement> 411 <dependencyManagement>
src/main/java/com/bsth/controller/InoutCarparkController.java 0 → 100644
  1 +package com.bsth.controller;
  2 +
  3 +import com.bsth.common.ResponseCode;
  4 +import com.bsth.entity.LsInoutSectionRoute;
  5 +import com.bsth.repository.StationRouteCacheRepository;
  6 +import com.bsth.repository.StationRouteRepository;
  7 +import com.bsth.service.InoutCarparkService;
  8 +import com.bsth.service.StationRouteService;
  9 +import com.fasterxml.jackson.core.JsonProcessingException;
  10 +import org.slf4j.Logger;
  11 +import org.slf4j.LoggerFactory;
  12 +import org.springframework.beans.factory.annotation.Autowired;
  13 +import org.springframework.util.StringUtils;
  14 +import org.springframework.web.bind.annotation.*;
  15 +
  16 +import java.util.HashMap;
  17 +import java.util.Map;
  18 +
  19 +@RestController
  20 +@RequestMapping("inout")
  21 +public class InoutCarparkController extends BaseController<LsInoutSectionRoute, Long>{
  22 +
  23 + private final static Logger logger = LoggerFactory.getLogger(InoutCarparkController.class);
  24 +
  25 + @Autowired
  26 + InoutCarparkService inoutCarparkService;
  27 +
  28 + @RequestMapping(value = "/getStartEndByLine", method = RequestMethod.GET)
  29 + public Map<String, Object> getStartEndByLine(@RequestParam("lineId")int lineId, @RequestParam("version")int version) {
  30 + return inoutCarparkService.getStartEndByLine(lineId, version);
  31 + }
  32 +
  33 + @RequestMapping(value = "/getRouteByStartEnd", method = RequestMethod.GET)
  34 + public Map<String, Object> getRouteByStartEnd(@RequestParam("lineId")int lineId, @RequestParam("version")int version, @RequestParam("start")String start, @RequestParam("end")String end) {
  35 + return inoutCarparkService.getRouteByStartEnd(lineId, version, start, end);
  36 + }
  37 +
  38 + /**
  39 + * 新增路段信息
  40 + *
  41 + * @param map:<bsectionVector:折线百度坐标集合;dbType:圆坐标类型;descriptions:描述与说明;destroy:是否撤销;directions:方向;lineId:线路ID
  42 + *
  43 + * lineCode :线路编码;roadCoding:道路编码;sectionCode:路段编码;sectionDistance:路段长度;sectionName:路段名称;sectionTime:路段时长;
  44 + *
  45 + * sectionrouteCode:路段序号;speedLimit:路段限速>
  46 + *
  47 + * @return map<SUCCESS:成功;ERROR:异常>
  48 + */
  49 + @RequestMapping(value="sectionSave" , method = RequestMethod.POST)
  50 + public Map<String, Object> sectionSave(@RequestParam Map<String, Object> map) {
  51 + map.put("createBy", "");
  52 + map.put("updateBy", "");
  53 + return inoutCarparkService.sectionSave(map);
  54 + }
  55 +
  56 + /**
  57 + * @Description :TODO(编辑线路走向)
  58 + *
  59 + * @param map <sectionId:路段ID; sectionJSON:路段信息>
  60 + *
  61 + * @return Map<String, Object> <SUCCESS ; ERROR>
  62 + */
  63 + @RequestMapping(value="sectionUpdate" , method = RequestMethod.POST)
  64 + public Map<String, Object> sectionUpdate(@RequestParam Map<String, Object> map) {
  65 +
  66 + map.put("updateBy", "");
  67 +
  68 + map.put("createBy", "");
  69 +
  70 + map.put("createDate", "");
  71 +
  72 + return inoutCarparkService.sectionUpdate(map);
  73 +
  74 + }
  75 +
  76 + /**
  77 + * @param id //路段路由id
  78 + * @Description: TODO(撤销路段)
  79 + */
  80 + @RequestMapping(value = "/destroy", method = RequestMethod.POST)
  81 + public Map<String, Object> destroy(@RequestParam Map<String, Object> map) {
  82 + return inoutCarparkService.destroy(map);
  83 + }
  84 +
  85 + /**
  86 + * 从历史轨迹做进场路径规划
  87 + * @Description: TODO(撤销路段)
  88 + */
  89 + @RequestMapping(value = "/pathPlaningByHistory", method = RequestMethod.POST)
  90 + public Map<String, Object> pathPlaningByHistory(@RequestParam Map<String, Object> map){
  91 + Map<String, Object> result = new HashMap<>();
  92 + result.put("status", ResponseCode.SUCCESS);
  93 + try {
  94 + String schId = (String)map.get("schId"), version = (String)map.get("version");
  95 + if (StringUtils.isEmpty(schId) || StringUtils.isEmpty(version)) {
  96 + throw new RuntimeException("无效的参数");
  97 + }
  98 + inoutCarparkService.pathPlaningByHistory(Long.parseLong(schId), Integer.parseInt(version));
  99 + } catch (Exception e) {
  100 + result.put("status", ResponseCode.ERROR);
  101 + logger.error("路径规划异常", e);
  102 + }
  103 +
  104 + return result;
  105 + }
  106 +}
src/main/java/com/bsth/entity/CarPark.java
@@ -40,7 +40,7 @@ public class CarPark { @@ -40,7 +40,7 @@ public class CarPark {
40 40
41 // 地理位置(百度坐标) 41 // 地理位置(百度坐标)
42 private String bParkPoint; 42 private String bParkPoint;
43 - 43 +
44 // 地理位置中心点(百度坐标) 44 // 地理位置中心点(百度坐标)
45 private String bCenterPoint; 45 private String bCenterPoint;
46 46
@@ -81,7 +81,7 @@ public class CarPark { @@ -81,7 +81,7 @@ public class CarPark {
81 private String brancheCompany; 81 private String brancheCompany;
82 82
83 /** 组合公司分公司编码 */ 83 /** 组合公司分公司编码 */
84 - @Formula(" concat(company, '_', branche_company) ") 84 + @Transient
85 private String cgsbm; 85 private String cgsbm;
86 86
87 // 是否撤销 87 // 是否撤销
@@ -106,14 +106,6 @@ public class CarPark { @@ -106,14 +106,6 @@ public class CarPark {
106 // 修改日期 106 // 修改日期
107 @Column(name = "update_date", columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP") 107 @Column(name = "update_date", columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP")
108 private Date updateDate; 108 private Date updateDate;
109 -  
110 - public String getCgsbm() {  
111 - return cgsbm;  
112 - }  
113 -  
114 - public void setCgsbm(String cgsbm) {  
115 - this.cgsbm = cgsbm;  
116 - }  
117 109
118 public Integer getId() { 110 public Integer getId() {
119 return id; 111 return id;
@@ -219,6 +211,14 @@ public class CarPark { @@ -219,6 +211,14 @@ public class CarPark {
219 this.company = company; 211 this.company = company;
220 } 212 }
221 213
  214 + public String getCgsbm() {
  215 + return this.company + "_" + this.brancheCompany;
  216 + }
  217 +
  218 + public void setCgsbm(String cgsbm) {
  219 + this.cgsbm = cgsbm;
  220 + }
  221 +
222 public Integer getDestroy() { 222 public Integer getDestroy() {
223 return destroy; 223 return destroy;
224 } 224 }
src/main/java/com/bsth/entity/LsInoutSectionRoute.java 0 → 100644
  1 +package com.bsth.entity;
  2 +
  3 +import javax.persistence.*;
  4 +import java.util.Date;
  5 +
  6 +
  7 +/**
  8 + *
  9 + * @ClassName : LsInoutSectionRoute(历史进出场路段路由实体类)
  10 + *
  11 + * @Author : bsth@lq
  12 + *
  13 + * @Description : TODO(历史路段路由)
  14 + *
  15 + * @Version 公交调度系统BS版 0.1
  16 + *
  17 + */
  18 +
  19 +@Entity
  20 +@Table(name = "bsth_c_ls_inout_sectionroute")
  21 +public class LsInoutSectionRoute {
  22 +
  23 + @Id
  24 + @GeneratedValue(strategy = GenerationType.IDENTITY)
  25 + private Long id;
  26 +
  27 + // 路段路由序号
  28 + private Integer sectionrouteCode;
  29 +
  30 + // 线路编号
  31 + private String lineCode;
  32 +
  33 + /**
  34 + * 进出场起点编码
  35 + */
  36 + private String start;
  37 +
  38 + /**
  39 + * 进出场终点编码
  40 + */
  41 + private String end;
  42 +
  43 + // 路段编号
  44 + private String sectionCode;
  45 +
  46 + // 路段路由方向
  47 + private Integer directions;
  48 +
  49 + // 版本号
  50 + private Integer versions;
  51 +
  52 + // 是否撤销
  53 + private Integer destroy;
  54 +
  55 + // 描述
  56 + private String descriptions;
  57 +
  58 + // 创建人
  59 + private Integer createBy;
  60 +
  61 + // 修改人
  62 + private Integer updateBy;
  63 +
  64 + // 创建日期
  65 + @Column(updatable = false, name = "create_date", columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP")
  66 + private Date createDate;
  67 +
  68 + // 修改日期
  69 + @Column(name = "update_date", columnDefinition = "timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP")
  70 + private Date updateDate;
  71 +
  72 + // 路段信息
  73 + @OneToOne
  74 + private Section section;
  75 +
  76 + // 线路信息
  77 + @ManyToOne
  78 + private Line line;
  79 +
  80 + public Long getId() {
  81 + return id;
  82 + }
  83 +
  84 + public void setId(Long id) {
  85 + this.id = id;
  86 + }
  87 +
  88 + public Integer getSectionrouteCode() {
  89 + return sectionrouteCode;
  90 + }
  91 +
  92 + public void setSectionrouteCode(Integer sectionrouteCode) {
  93 + this.sectionrouteCode = sectionrouteCode;
  94 + }
  95 +
  96 + public String getLineCode() {
  97 + return lineCode;
  98 + }
  99 +
  100 + public void setLineCode(String lineCode) {
  101 + this.lineCode = lineCode;
  102 + }
  103 +
  104 + public String getStart() {
  105 + return start;
  106 + }
  107 +
  108 + public void setStart(String start) {
  109 + this.start = start;
  110 + }
  111 +
  112 + public String getEnd() {
  113 + return end;
  114 + }
  115 +
  116 + public void setEnd(String end) {
  117 + this.end = end;
  118 + }
  119 +
  120 + public String getSectionCode() {
  121 + return sectionCode;
  122 + }
  123 +
  124 + public void setSectionCode(String sectionCode) {
  125 + this.sectionCode = sectionCode;
  126 + }
  127 +
  128 + public Integer getDirections() {
  129 + return directions;
  130 + }
  131 +
  132 + public void setDirections(Integer directions) {
  133 + this.directions = directions;
  134 + }
  135 +
  136 + public Integer getVersions() {
  137 + return versions;
  138 + }
  139 +
  140 + public void setVersions(Integer versions) {
  141 + this.versions = versions;
  142 + }
  143 +
  144 + public Integer getDestroy() {
  145 + return destroy;
  146 + }
  147 +
  148 + public void setDestroy(Integer destroy) {
  149 + this.destroy = destroy;
  150 + }
  151 +
  152 + public String getDescriptions() {
  153 + return descriptions;
  154 + }
  155 +
  156 + public void setDescriptions(String descriptions) {
  157 + this.descriptions = descriptions;
  158 + }
  159 +
  160 + public Integer getCreateBy() {
  161 + return createBy;
  162 + }
  163 +
  164 + public void setCreateBy(Integer createBy) {
  165 + this.createBy = createBy;
  166 + }
  167 +
  168 + public Integer getUpdateBy() {
  169 + return updateBy;
  170 + }
  171 +
  172 + public void setUpdateBy(Integer updateBy) {
  173 + this.updateBy = updateBy;
  174 + }
  175 +
  176 + public Date getCreateDate() {
  177 + return createDate;
  178 + }
  179 +
  180 + public void setCreateDate(Date createDate) {
  181 + this.createDate = createDate;
  182 + }
  183 +
  184 + public Date getUpdateDate() {
  185 + return updateDate;
  186 + }
  187 +
  188 + public void setUpdateDate(Date updateDate) {
  189 + this.updateDate = updateDate;
  190 + }
  191 +
  192 + public Section getSection() {
  193 + return section;
  194 + }
  195 +
  196 + public void setSection(Section section) {
  197 + this.section = section;
  198 + }
  199 +
  200 + public Line getLine() {
  201 + return line;
  202 + }
  203 +
  204 + public void setLine(Line line) {
  205 + this.line = line;
  206 + }
  207 +}
src/main/java/com/bsth/entity/Section.java
1 package com.bsth.entity; 1 package com.bsth.entity;
2 2
  3 +import org.hibernate.annotations.Formula;
  4 +
3 import java.util.Date; 5 import java.util.Date;
4 6
5 import javax.persistence.Column; 7 import javax.persistence.Column;
@@ -53,12 +55,15 @@ public class Section{ @@ -53,12 +55,15 @@ public class Section{
53 private String sectionType; 55 private String sectionType;
54 56
55 // 路段矢量(空间坐标点集合)--GPS坐标点 57 // 路段矢量(空间坐标点集合)--GPS坐标点
  58 + @Formula("ST_AsText(gsection_vector)")
56 private String gsectionVector; 59 private String gsectionVector;
57 60
58 // 路段矢量(空间坐标点集合)--百度原始坐标坐标点 61 // 路段矢量(空间坐标点集合)--百度原始坐标坐标点
  62 + @Formula("ST_AsText(bsection_vector)")
59 private String bsectionVector; 63 private String bsectionVector;
60 64
61 // 路段矢量(空间坐标点集合)--城建坐标点 65 // 路段矢量(空间坐标点集合)--城建坐标点
  66 + @Formula("ST_AsText(csection_vector)")
62 private String csectionVector; 67 private String csectionVector;
63 68
64 // 交叉路 69 // 交叉路
src/main/java/com/bsth/entity/Station.java
1 package com.bsth.entity; 1 package com.bsth.entity;
2 2
  3 +import com.bsth.util.Geo.Point;
3 import com.fasterxml.jackson.annotation.JsonIgnoreProperties; 4 import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
  5 +import org.hibernate.annotations.Formula;
  6 +import org.locationtech.jts.geom.Geometry;
  7 +import org.locationtech.jts.io.WKBReader;
4 8
5 -import javax.persistence.Column;  
6 -import javax.persistence.Entity;  
7 -import javax.persistence.GeneratedValue;  
8 -import javax.persistence.GenerationType;  
9 -import javax.persistence.Id;  
10 -import javax.persistence.Table; 9 +import javax.persistence.*;
11 10
12 import java.util.Arrays; 11 import java.util.Arrays;
13 import java.util.Date; 12 import java.util.Date;
  13 +import java.util.List;
14 14
15 15
16 /** 16 /**
@@ -89,6 +89,9 @@ public class Station { @@ -89,6 +89,9 @@ public class Station {
89 89
90 // 多边形空间原坐标坐标点集合 90 // 多边形空间原坐标坐标点集合
91 private byte[] bPolygonGrid; 91 private byte[] bPolygonGrid;
  92 +
  93 + @Transient
  94 + private String bdPolygon;
92 95
93 /** 96 /**
94 * 是否撤销 97 * 是否撤销
@@ -272,6 +275,17 @@ public class Station { @@ -272,6 +275,17 @@ public class Station {
272 this.bPolygonGrid = bPolygonGrid; 275 this.bPolygonGrid = bPolygonGrid;
273 } 276 }
274 277
  278 + public String getBdPolygon() {
  279 + if (bPolygonGrid == null) {
  280 + return null;
  281 + }
  282 + Geometry geometry = getGeometryFromBytes(getbPolygonGrid());
  283 + if (geometry == null) {
  284 + return null;
  285 + }
  286 + return geometry.toString();
  287 + }
  288 +
275 public Integer getDestroy() { 289 public Integer getDestroy() {
276 return destroy; 290 return destroy;
277 } 291 }
@@ -328,6 +342,48 @@ public class Station { @@ -328,6 +342,48 @@ public class Station {
328 this.updateDate = updateDate; 342 this.updateDate = updateDate;
329 } 343 }
330 344
  345 + private static Geometry getGeometryFromBytes(byte[] geometryAsBytes) {
  346 + Geometry geometry = null;
  347 + try {
  348 + // 字节数组小于5,说明geometry有问题
  349 + if (geometryAsBytes.length < 5) {
  350 + throw new Exception("Invalid geometry inputStream - less than five bytes");
  351 + }
  352 +
  353 + //first four bytes of the geometry are the SRID,
  354 + //followed by the actual WKB. Determine the SRID
  355 + //这里是取字节数组的前4个来解析srid
  356 + byte[] sridBytes = new byte[4];
  357 + System.arraycopy(geometryAsBytes, 0, sridBytes, 0, 4);
  358 + boolean bigEndian = (geometryAsBytes[4] == 0x00);
  359 + // 解析srid
  360 + int srid = 0;
  361 + if (bigEndian) {
  362 + for (int i = 0; i < sridBytes.length; i++) {
  363 + srid = (srid << 8) + (sridBytes[i] & 0xff);
  364 + }
  365 + } else {
  366 + for (int i = 0; i < sridBytes.length; i++) {
  367 + srid += (sridBytes[i] & 0xff) << (8 * i);
  368 + }
  369 + }
  370 +
  371 + //use the JTS WKBReader for WKB parsing
  372 + WKBReader wkbReader = new WKBReader();
  373 + // 使用geotool的WKBReader 把字节数组转成geometry对象。
  374 + //copy the byte array, removing the first four
  375 + //SRID bytes
  376 + byte[] wkb = new byte[geometryAsBytes.length - 4];
  377 + System.arraycopy(geometryAsBytes, 4, wkb, 0, wkb.length);
  378 + geometry = wkbReader.read(wkb);
  379 + geometry.setSRID(srid);
  380 + } catch (Exception e) {
  381 + e.printStackTrace();
  382 + }
  383 +
  384 + return geometry;
  385 + }
  386 +
331 @Override 387 @Override
332 public String toString() { 388 public String toString() {
333 return "Station [id=" + id + ", stationCod=" + stationCod + ", stationName=" + stationName + ", roadCoding=" 389 return "Station [id=" + id + ", stationCod=" + stationCod + ", stationName=" + stationName + ", roadCoding="
src/main/java/com/bsth/repository/CarParkRepository.java
1 -package com.bsth.repository;  
2 -  
3 -import java.util.List;  
4 -  
5 -import org.springframework.data.jpa.repository.Modifying;  
6 -import org.springframework.data.jpa.repository.Query;  
7 -import org.springframework.stereotype.Repository;  
8 -import org.springframework.transaction.annotation.Transactional;  
9 -  
10 -import com.bsth.entity.CarPark;  
11 -  
12 -@Repository  
13 -public interface CarParkRepository extends BaseRepository<CarPark, Integer>{  
14 -  
15 - // 查询最大ID  
16 - @Query(value = "SELECT IFNULL(num,0) as maxId from (SELECT MAX(id) as num FROM bsth_c_car_park) k"  
17 - , nativeQuery=true)  
18 - public long carParkMaxId();  
19 -  
20 - @Transactional  
21 - @Modifying  
22 - @Query(value="INSERT INTO bsth_c_car_park (" +  
23 - " area , company , park_code , park_name , branche_company , " +  
24 -  
25 - "create_by , create_date , descriptions , destroy, update_by, " +  
26 -  
27 - "update_date , versions , b_center_point , b_park_point ,db_type, " +  
28 -  
29 - "g_center_point, g_park_point, radius, shapes_type) " +  
30 -  
31 - " VALUES(" +  
32 - "?1 , ?2 , ?3 , ?4 , ?5," +  
33 -  
34 - "?6 , str_to_date(?7,'%Y-%m-%d %H:%i:%s') , ?8 , ?9 , ?10," +  
35 -  
36 - "str_to_date(?11,'%Y-%m-%d %H:%i:%s'), ?12 ,?13,ST_GeomFromText(?14), ?15, " +  
37 -  
38 - "?16, ST_GeomFromText(?17), ?18,?19)", nativeQuery=true)  
39 - public void carParkSave(Double area,String company,String parkCode,String parkName,  
40 -  
41 - String brancheCompany,Integer createBy,String createDate,String descriptions,Integer destroy,  
42 -  
43 - Integer updateBy,String updateDate,Integer versions,String bCenterPoint,String bParkPoint,  
44 -  
45 - String dbType,String gCenterPoint,String gParkPoint,Integer radius,String shapesType);  
46 -  
47 -  
48 - /**  
49 - * @Description :TODO(查询路段信息)  
50 - *  
51 - * @param map <id:路段路由ID>  
52 - *  
53 - * @return List<Object[]>  
54 - */  
55 - @Query(value ="SELECT k.id AS carParkId," +  
56 - "k.area AS carParkArea," +  
57 - "k.company AS carParkCompany," +  
58 - "k.park_code AS carParkCode," +  
59 - "k.park_name AS carParkName," +  
60 - "k.branche_company AS carParkBrancheCompany," +  
61 - "k.create_by AS carParkCreateBy," +  
62 - "k.create_date AS carParkCreateDate," +  
63 - "k.descriptions AS carParkDescriptions," +  
64 - "k.destroy AS carParkDestroy," +  
65 - "k.update_by AS carParkUpdate," +  
66 - "k.update_date AS carParkUpdateDate," +  
67 - "k.versions AS carParkVersions," +  
68 - "k.b_center_point AS carParkBcenterPoint," +  
69 - "ST_AsText(k.b_park_point) AS carParkBparkPoint," +  
70 - "k.g_center_point AS carParkGcenterPoint," +  
71 - "ST_AsText(k.g_park_point) AS carParkGparkPoint, " +  
72 - "k.db_type AS carParkDBtype," +  
73 - "k.radius AS carParkRadius," +  
74 - "k.shapes_type AS carParkShapesType FROM bsth_c_car_park k where k.id = ?1", nativeQuery=true)  
75 - List<Object[]> findCarParkInfoFormId(int id);  
76 -  
77 - @Transactional  
78 - @Modifying  
79 - @Query(value="UPDATE bsth_c_car_park SET " +  
80 - "area = ?1 , " +  
81 - "company = ?2 , " +  
82 - "park_code = ?3 , " +  
83 - "park_name = ?4 , " +  
84 - "branche_company = ?5 , " +  
85 - "create_by = ?6 , " +  
86 - "create_date = str_to_date(?7,'%Y-%m-%d %H:%i:%s') , " +  
87 - "descriptions = ?8 , " +  
88 - "destroy = ?9 , " +  
89 - "update_by = ?10 , " +  
90 - "update_date =str_to_date(?11,'%Y-%m-%d %H:%i:%s') , " +  
91 - "versions = ?12 , " +  
92 - "b_center_point = ?13 , " +  
93 - "g_center_point = ?14 , " +  
94 - "b_park_point = ST_GeomFromText(?15) , " +  
95 - "g_park_point = ST_GeomFromText(?16) , " +  
96 - "db_type = ?17 , " +  
97 - "radius = ?18 , " +  
98 - "shapes_type = ?19 " +  
99 - " WHERE id = ?20 ", nativeQuery=true)  
100 - public void carParkUpdate(double area,String company,String parkCode,String parkName,String brancheCompany,  
101 -  
102 - Integer createBy ,String createDate,String descriptions,Integer destroy,Integer updateBy,  
103 -  
104 - String updateDate,Integer versions,String bCenterPoint,String gCenterPoint,String bParkPoint,  
105 -  
106 - String gParkPoint,String dbType,Integer radius,String shapesType,Integer id );  
107 -  
108 - @Query(value = "select st_astext(g_park_point), shapes_type, g_center_point, radius,park_code,park_name from bsth_c_car_park where park_code=?1", nativeQuery = true)  
109 - public Object[][] bufferAera(String parkCode);  
110 -  
111 - @Query(value ="SELECT p.park_name,p.park_code from bsth_c_car_park p where p.park_code = ?1", nativeQuery=true)  
112 - List<Object[]> selectTccInfoByCode(String parkCode);  
113 -} 1 +package com.bsth.repository;
  2 +
  3 +import java.util.List;
  4 +
  5 +import org.springframework.data.jpa.repository.Modifying;
  6 +import org.springframework.data.jpa.repository.Query;
  7 +import org.springframework.stereotype.Repository;
  8 +import org.springframework.transaction.annotation.Transactional;
  9 +
  10 +import com.bsth.entity.CarPark;
  11 +
  12 +@Repository
  13 +public interface CarParkRepository extends BaseRepository<CarPark, Integer>{
  14 +
  15 + // 查询最大ID
  16 + @Query(value = "SELECT IFNULL(num,0) as maxId from (SELECT MAX(id) as num FROM bsth_c_car_park) k"
  17 + , nativeQuery=true)
  18 + public long carParkMaxId();
  19 +
  20 + @Transactional
  21 + @Modifying
  22 + @Query(value="INSERT INTO bsth_c_car_park (" +
  23 + " area , company , park_code , park_name , branche_company , " +
  24 +
  25 + "create_by , create_date , descriptions , destroy, update_by, " +
  26 +
  27 + "update_date , versions , b_center_point , b_park_point ,db_type, " +
  28 +
  29 + "g_center_point, g_park_point, radius, shapes_type) " +
  30 +
  31 + " VALUES(" +
  32 + "?1 , ?2 , ?3 , ?4 , ?5," +
  33 +
  34 + "?6 , str_to_date(?7,'%Y-%m-%d %H:%i:%s') , ?8 , ?9 , ?10," +
  35 +
  36 + "str_to_date(?11,'%Y-%m-%d %H:%i:%s'), ?12 ,?13,ST_GeomFromText(?14), ?15, " +
  37 +
  38 + "?16, ST_GeomFromText(?17), ?18,?19)", nativeQuery=true)
  39 + public void carParkSave(Double area,String company,String parkCode,String parkName,
  40 +
  41 + String brancheCompany,Integer createBy,String createDate,String descriptions,Integer destroy,
  42 +
  43 + Integer updateBy,String updateDate,Integer versions,String bCenterPoint,String bParkPoint,
  44 +
  45 + String dbType,String gCenterPoint,String gParkPoint,Integer radius,String shapesType);
  46 +
  47 +
  48 + /**
  49 + * @Description :TODO(查询路段信息)
  50 + *
  51 + * @param map <id:路段路由ID>
  52 + *
  53 + * @return List<Object[]>
  54 + */
  55 + @Query(value ="SELECT k.id AS carParkId," +
  56 + "k.area AS carParkArea," +
  57 + "k.company AS carParkCompany," +
  58 + "k.park_code AS carParkCode," +
  59 + "k.park_name AS carParkName," +
  60 + "k.branche_company AS carParkBrancheCompany," +
  61 + "k.create_by AS carParkCreateBy," +
  62 + "k.create_date AS carParkCreateDate," +
  63 + "k.descriptions AS carParkDescriptions," +
  64 + "k.destroy AS carParkDestroy," +
  65 + "k.update_by AS carParkUpdate," +
  66 + "k.update_date AS carParkUpdateDate," +
  67 + "k.versions AS carParkVersions," +
  68 + "k.b_center_point AS carParkBcenterPoint," +
  69 + "ST_AsText(k.b_park_point) AS carParkBparkPoint," +
  70 + "k.g_center_point AS carParkGcenterPoint," +
  71 + "ST_AsText(k.g_park_point) AS carParkGparkPoint, " +
  72 + "k.db_type AS carParkDBtype," +
  73 + "k.radius AS carParkRadius," +
  74 + "k.shapes_type AS carParkShapesType FROM bsth_c_car_park k where k.id = ?1", nativeQuery=true)
  75 + List<Object[]> findCarParkInfoFormId(int id);
  76 +
  77 + @Transactional
  78 + @Modifying
  79 + @Query(value="UPDATE bsth_c_car_park SET " +
  80 + "area = ?1 , " +
  81 + "company = ?2 , " +
  82 + "park_code = ?3 , " +
  83 + "park_name = ?4 , " +
  84 + "branche_company = ?5 , " +
  85 + "create_by = ?6 , " +
  86 + "create_date = str_to_date(?7,'%Y-%m-%d %H:%i:%s') , " +
  87 + "descriptions = ?8 , " +
  88 + "destroy = ?9 , " +
  89 + "update_by = ?10 , " +
  90 + "update_date =str_to_date(?11,'%Y-%m-%d %H:%i:%s') , " +
  91 + "versions = ?12 , " +
  92 + "b_center_point = ?13 , " +
  93 + "g_center_point = ?14 , " +
  94 + "b_park_point = ST_GeomFromText(?15) , " +
  95 + "g_park_point = ST_GeomFromText(?16) , " +
  96 + "db_type = ?17 , " +
  97 + "radius = ?18 , " +
  98 + "shapes_type = ?19 " +
  99 + " WHERE id = ?20 ", nativeQuery=true)
  100 + public void carParkUpdate(double area,String company,String parkCode,String parkName,String brancheCompany,
  101 +
  102 + Integer createBy ,String createDate,String descriptions,Integer destroy,Integer updateBy,
  103 +
  104 + String updateDate,Integer versions,String bCenterPoint,String gCenterPoint,String bParkPoint,
  105 +
  106 + String gParkPoint,String dbType,Integer radius,String shapesType,Integer id );
  107 +
  108 + @Query(value = "select st_astext(g_park_point), shapes_type, g_center_point, radius,park_code,park_name from bsth_c_car_park where park_code=?1", nativeQuery = true)
  109 + public Object[][] bufferAera(String parkCode);
  110 +
  111 + @Query(value ="SELECT p.park_name,p.park_code from bsth_c_car_park p where p.park_code = ?1", nativeQuery=true)
  112 + List<Object[]> selectTccInfoByCode(String parkCode);
  113 +
  114 + @Query(value ="select c.id, c.area,c.company,c.park_code,c.park_name,c.branche_company,c.create_by,c.create_date,c.descriptions,c.destroy,c.update_by,c.update_date,c.versions,c.b_center_point,ST_AsText(c.b_park_point) b_park_point,c.g_center_point,ST_AsText(c.g_park_point) g_park_point,c.db_type,c.radius,c.shapes_type from bsth_c_line_information l left join bsth_c_car_park c on l.car_park = c.park_code where l.line = ?1", nativeQuery=true)
  115 + CarPark findByLineId(int lineId);
  116 +}
src/main/java/com/bsth/repository/LsInoutSectionRouteRepository.java 0 → 100644
  1 +package com.bsth.repository;
  2 +
  3 +import com.bsth.entity.LsInoutSectionRoute;
  4 +import com.bsth.entity.LsSectionRoute;
  5 +import org.springframework.data.jpa.repository.Modifying;
  6 +import org.springframework.data.jpa.repository.Query;
  7 +import org.springframework.stereotype.Repository;
  8 +import org.springframework.transaction.annotation.Transactional;
  9 +
  10 +import java.util.List;
  11 +
  12 +/**
  13 + *
  14 + * @Interface: SectionRouteRepository(路段路由Repository数据持久层接口)
  15 + *
  16 + * @Extends : BaseRepository
  17 + *
  18 + * @Description: TODO(路段路由Repository数据持久层接口)
  19 + *
  20 + * @Author bsth@lq
  21 + *
  22 + * @Version 公交调度系统BS版 0.1
  23 + *
  24 + */
  25 +
  26 +@Repository
  27 +public interface LsInoutSectionRouteRepository extends BaseRepository<LsInoutSectionRoute, Long> {
  28 +
  29 + /**
  30 + * 查询待更新线路的路段路由
  31 + */
  32 + @Query(value = "SELECT sr FROM LsInoutSectionRoute sr where sr.line.id =?1 and sr.versions=?2 and sr.start=?3 and sr.end=?4 and sr.destroy=0")
  33 + List<LsInoutSectionRoute> getRouteByStartEnd(int lineId, int version, String start, String end);
  34 +
  35 + /**
  36 + *
  37 + * @param lineCode
  38 + * @param version
  39 + * @param start
  40 + * @param end
  41 + * @param sectionrouteCode
  42 + */
  43 + @Modifying
  44 + @Query(value="UPDATE bsth_c_ls_inout_sectionroute set sectionroute_code = (sectionroute_code+1) where line_code = ?1 and versions = ?2 and start = ?3 and end = ?4 and sectionroute_code >=?5 and destroy = 0", nativeQuery=true)
  45 + public void sectionUpdSectionRouteCode(String lineCode, int version, String start, String end, Integer sectionrouteCode);
  46 +
  47 + /**
  48 + * 撤销线路某版本进出场
  49 + * @param lineCode
  50 + * @param version
  51 + * @param start
  52 + * @param end
  53 + */
  54 + @Modifying
  55 + @Query(value="UPDATE bsth_c_ls_inout_sectionroute set destroy = 1 where line_code = ?1 and versions = ?2 and start = ?3 and end = ?4", nativeQuery=true)
  56 + public void destroy(String lineCode, int version, String start, String end);
  57 +}
src/main/java/com/bsth/repository/LsStationRouteRepository.java
1 -package com.bsth.repository;  
2 -  
3 -import java.util.List;  
4 -import java.util.Map;  
5 -  
6 -import org.springframework.data.jpa.repository.EntityGraph;  
7 -import org.springframework.data.jpa.repository.Modifying;  
8 -import org.springframework.data.jpa.repository.Query;  
9 -import org.springframework.stereotype.Repository;  
10 -import org.springframework.transaction.annotation.Transactional;  
11 -  
12 -import com.bsth.entity.LsStationRoute;  
13 -  
14 -/**  
15 - *  
16 - * @Interface: StationRouteRepository(站点路由Repository数据持久层接口)  
17 - *  
18 - * @Extends : BaseRepository  
19 - *  
20 - * @Description: TODO(站点路由Repository数据持久层接口)  
21 - *  
22 - * @Author bsth@lq  
23 - *  
24 - * @Version 公交调度系统BS版 0.1  
25 - *  
26 - */  
27 -  
28 -@Repository  
29 -public interface LsStationRouteRepository extends BaseRepository<LsStationRoute, Integer> {  
30 -  
31 - /**  
32 - * 查询待更新线路的站点路由  
33 - */  
34 - @EntityGraph(value = "ls_stationRoute_station", type = EntityGraph.EntityGraphType.FETCH)  
35 - @Query(value = "SELECT DISTINCT sr FROM LsStationRoute sr where sr.line.id =?1 and sr.lineCode=?2 and sr.versions=?3 and sr.destroy=0")  
36 - List<LsStationRoute> findupdated(Integer lineId, String lineCode, Integer versions);  
37 -  
38 - @Query(value = "SELECT a.`stationRoute.id`," +  
39 - "a.`stationRoute.line`," +  
40 - "a.`stationRoute.station`," +  
41 - "a.`stationRoute.stationName`," +  
42 - "a.`stationRoute.stationRouteCode`," +  
43 - "a.`stationRoute.lineCode`," +  
44 - "a.`stationRoute.stationMark`," +  
45 - "a.`stationRoute.outStationNmber`," +  
46 - "a.`stationRoute.directions`," +  
47 - "a.`stationRoute.distances`," +  
48 - "a.`stationRoute.toTime`," +  
49 - "a.`stationRoute.firstTime`," +  
50 - "a.`stationRoute.endTime`," +  
51 - "a.`stationRoute.descriptions`," +  
52 - "a.`stationRoute.versions`," +  
53 - "b.id AS 'station.id'," +  
54 - "b.station_cod AS 'station.stationCod'," +  
55 - "b.station_name AS 'station.stationName'," +  
56 - "b.road_coding AS 'station.roadCoding'," +  
57 - "b.db_type AS 'station.dbType'," +  
58 - "b.b_jwpoints AS 'station.bJwpoints'," +  
59 - "b.g_lonx AS 'station.gLonx'," +  
60 - "b.g_lonx AS 'station.gLaty'," +  
61 - "b.x AS 'station.x'," +  
62 - "b.y AS 'station.y'," +  
63 - "b.shapes_type AS 'station.shapesType'," +  
64 - "b.radius AS 'station.radius'," +  
65 - "ST_AsText(b.g_polygon_grid) AS 'station.gPolygonGrid'," +  
66 - "ST_AsText(b.b_polygon_grid) AS 'station.bPolygonGrid'," +  
67 - "b.destroy AS 'station.destroy'," +  
68 - "b.versions AS 'station.versions'," +  
69 - "b.descriptions AS 'station.descriptions', " +  
70 - "a.`stationRoute.industryCode` " +  
71 - " FROM (" +  
72 - "SELECT r.id AS 'stationRoute.id'," +  
73 - " r.line AS 'stationRoute.line'," +  
74 - "r.station AS 'stationRoute.station'," +  
75 - "r.station_name AS 'stationRoute.stationName'," +  
76 - "r.station_route_code as 'stationRoute.stationRouteCode'," +  
77 - "r.line_code AS 'stationRoute.lineCode'," +  
78 - "r.station_mark AS 'stationRoute.stationMark'," +  
79 - "r.out_station_nmber AS 'stationRoute.outStationNmber'," +  
80 - "r.directions AS 'stationRoute.directions'," +  
81 - "r.distances AS 'stationRoute.distances'," +  
82 - "r.to_time AS 'stationRoute.toTime'," +  
83 - "r.first_time AS 'stationRoute.firstTime'," +  
84 - "r.end_time AS 'stationRoute.endTime'," +  
85 - "r.descriptions AS 'stationRoute.descriptions'," +  
86 - "r.versions AS 'stationRoute.versions', " +  
87 - "r.industry_code AS 'stationRoute.industryCode' " +  
88 - " FROM bsth_c_ls_stationroute r WHERE r.line = ?1 and r.directions = ?2 and r.versions=?3 and r.destroy=0) a " +  
89 - "LEFT JOIN bsth_c_station b " +  
90 - "ON a.`stationRoute.station` = b.id ORDER BY a.`stationRoute.stationRouteCode` ASC", nativeQuery=true)  
91 - List<Object[]> findPoints(Integer lineId, Integer direction, Integer versions);  
92 -  
93 -  
94 - @Query(value = "SELECT a.stationRouteLine," +  
95 - " a.stationRouteStation," +  
96 - " a.stationRouteCode," +  
97 - " a.stationRouteLIneCode," +  
98 - " a.stationRouteStationMark," +  
99 - " a.stationOutStationNmber," +  
100 - " a.stationRoutedirections," +  
101 - " a.stationRouteDistances," +  
102 - " a.stationRouteToTime," +  
103 - " a.staitonRouteFirstTime," +  
104 - " a.stationRouteEndTime," +  
105 - " a.stationRouteDescriptions," +  
106 - " a.stationRouteDestroy," +  
107 - " a.stationRouteVersions," +  
108 - " a.stationRouteCreateBy," +  
109 - " a.stationRouteCreateDate," +  
110 - " a.stationRouteUpdateBy," +  
111 - " a.stationRouteUpdateDate," +  
112 - " b.id AS stationId," +  
113 - " b.station_cod AS stationCode," +  
114 - " a.stationRouteName," +  
115 - " b.road_coding AS stationRoadCoding," +  
116 - " b.db_type AS stationDbType," +  
117 - " b.b_jwpoints AS stationJwpoints," +  
118 - " b.g_lonx AS stationGlonx," +  
119 - " b.g_laty AS stationGlaty," +  
120 - " b.x AS stationX," +  
121 - " b.y AS stationY," +  
122 - " ST_AsText(b.b_polygon_grid) as stationBPolyonGrid," +  
123 - " ST_AsText(b.g_polygon_grid) AS stationGPloyonGrid, " +  
124 - " b.destroy AS stationDestroy," +  
125 - " b.radius AS stationRadius," +  
126 - " b.shapes_type AS stationShapesType," +  
127 - " b.versions AS stationVersions," +  
128 - " b.descriptions AS sttationDescriptions," +  
129 - " b.create_by AS stationCreateBy," +  
130 - " b.create_date AS stationCreateDate," +  
131 - " b.update_by AS stationUpdateBy," +  
132 - " b.update_date AS stationUpdateDate," +  
133 - " a.stationRouteId," +  
134 - "b.station_name as zdmc, "+  
135 - "a.industryCode "+  
136 - " FROM ( SELECT s.id AS stationRouteId," +  
137 - " s.line AS stationRouteLine," +  
138 - " s.station as stationRouteStation," +  
139 - " s.station_name AS stationRouteName," +  
140 - " s.station_route_code as stationRouteCode," +  
141 - " s.industry_code as industryCode," +  
142 - " s.line_code AS stationRouteLIneCode," +  
143 - " s.station_mark AS stationRouteStationMark," +  
144 - " s.out_station_nmber AS stationOutStationNmber," +  
145 - " s.directions AS stationRoutedirections," +  
146 - " s.distances AS stationRouteDistances," +  
147 - " s.to_time AS stationRouteToTime," +  
148 - " s.first_time AS staitonRouteFirstTime," +  
149 - " s.end_time AS stationRouteEndTime," +  
150 - " s.descriptions AS stationRouteDescriptions," +  
151 - " s.destroy AS stationRouteDestroy," +  
152 - " s.versions AS stationRouteVersions," +  
153 - " s.create_by AS stationRouteCreateBy," +  
154 - " s.create_date AS stationRouteCreateDate," +  
155 - " s.update_by AS stationRouteUpdateBy," +  
156 - " s.update_date AS stationRouteUpdateDate FROM bsth_c_ls_stationroute s WHERE s.line = ?1 and s.directions = ?2 and s.versions=?3 and s.destroy = 0) a " +  
157 - " LEFT JOIN bsth_c_station b ON a.stationRouteStation = b.id order by a.stationRouteCode", nativeQuery=true)  
158 - List<Object[]> getStationRouteList(Integer lineId, Integer dir ,Integer version);  
159 - /**  
160 - * 更新路线前删除线路版本号历史原有站点路由  
161 - *  
162 - * @param line  
163 - * @param dir  
164 - */  
165 - @Modifying  
166 - @Transactional  
167 - @Query(value="DELETE from bsth_c_ls_stationroute where line = ?1 and directions = ?2 and versions = ?3", nativeQuery=true)  
168 - public void batchDelete(Integer line,Integer dir, Integer versions);  
169 -  
170 - /**  
171 - * 更新路线前撤销线路版本号历史原有站点路由  
172 - *  
173 - * @param line  
174 - * @param dir  
175 - */  
176 - @Modifying  
177 - @Query(value="UPDATE bsth_c_ls_stationroute set destroy = 1 where line = ?1 and directions = ?2 and versions = ?3", nativeQuery=true)  
178 - public void batchDestroy(Integer sectionRouteLine, Integer directions, Integer versions);  
179 -  
180 - /**  
181 - * 按线路编码查询各站点的顺序号  
182 - * @param lineCode 线路编码  
183 - * @param lineVersion 版本号  
184 - * @return  
185 - */  
186 - @Query("SELECT new map(" +  
187 - "lineCode as lineCode,directions as directions,stationName as stationName,stationCode as stationCode," +  
188 - "line.linePlayType as linePlayType,s.stationMark as stationMark) " +  
189 - "FROM " +  
190 - "LsStationRoute s " +  
191 - "WHERE " +  
192 - "s.destroy = 0 AND s.lineCode = ?1 AND s.versions = ?2 " +  
193 - "ORDER BY " +  
194 - "lineCode,directions,stationRouteCode")  
195 - List<Map<String, String>> findLineWithLineCode4Ygc(String lineCode,Integer lineVersion);  
196 - /**  
197 - * @Description : TODO(根据站点路由Id查询详情)  
198 - *  
199 - * @param id:站点路由ID  
200 - *  
201 - * @return List<Object[]>  
202 - */  
203 - @Query(value = "SELECT a.stationRouteLine," +  
204 - " a.stationRouteStation," +  
205 - " a.stationRouteCode," +  
206 - " a.stationRouteLIneCode," +  
207 - " a.stationRouteStationMark," +  
208 - " a.stationOutStationNmber," +  
209 - " a.stationRoutedirections," +  
210 - " a.stationRouteDistances," +  
211 - " a.stationRouteToTime," +  
212 - " a.staitonRouteFirstTime," +  
213 - " a.stationRouteEndTime," +  
214 - " a.stationRouteDescriptions," +  
215 - " a.stationRouteDestroy," +  
216 - " a.stationRouteVersions," +  
217 - " a.stationRouteCreateBy," +  
218 - " a.stationRouteCreateDate," +  
219 - " a.stationRouteUpdateBy," +  
220 - " a.stationRouteUpdateDate," +  
221 - " b.id AS stationId," +  
222 - " b.station_cod AS stationCode," +  
223 - " a.stationRouteName," +  
224 - " b.road_coding AS stationRoadCoding," +  
225 - " b.db_type AS stationDbType," +  
226 - " b.b_jwpoints AS stationJwpoints," +  
227 - " b.g_lonx AS stationGlonx," +  
228 - " b.g_laty AS stationGlaty," +  
229 - " b.x AS stationX," +  
230 - " b.y AS stationY," +  
231 - " ST_AsText(b.b_polygon_grid) as stationBPolyonGrid," +  
232 - " ST_AsText(b.g_polygon_grid) AS stationGPloyonGrid, " +  
233 - " b.destroy AS stationDestroy," +  
234 - " b.radius AS stationRadius," +  
235 - " b.shapes_type AS stationShapesType," +  
236 - " b.versions AS stationVersions," +  
237 - " b.descriptions AS sttationDescriptions," +  
238 - " b.create_by AS stationCreateBy," +  
239 - " b.create_date AS stationCreateDate," +  
240 - " b.update_by AS stationUpdateBy," +  
241 - " b.update_date AS stationUpdateDate," +  
242 - " a.stationRouteId,b.station_name as zdmc, " +  
243 - " a.industryCode "+  
244 - " FROM " +  
245 - "( SELECT s.id AS stationRouteId," +  
246 - " s.line AS stationRouteLine," +  
247 - " s.station as stationRouteStation," +  
248 - " s.station_name AS stationRouteName," +  
249 - " s.station_route_code as stationRouteCode," +  
250 - " s.industry_code as industryCode," +  
251 - " s.line_code AS stationRouteLIneCode," +  
252 - " s.station_mark AS stationRouteStationMark," +  
253 - " s.out_station_nmber AS stationOutStationNmber," +  
254 - " s.directions AS stationRoutedirections," +  
255 - " s.distances AS stationRouteDistances," +  
256 - " s.to_time AS stationRouteToTime," +  
257 - " s.first_time AS staitonRouteFirstTime," +  
258 - " s.end_time AS stationRouteEndTime," +  
259 - " s.descriptions AS stationRouteDescriptions," +  
260 - " s.destroy AS stationRouteDestroy," +  
261 - " s.versions AS stationRouteVersions," +  
262 - " s.create_by AS stationRouteCreateBy," +  
263 - " s.create_date AS stationRouteCreateDate," +  
264 - " s.update_by AS stationRouteUpdateBy," +  
265 - " s.update_date AS stationRouteUpdateDate FROM bsth_c_ls_stationroute s WHERE s.id = ?1 ) a " +  
266 - " LEFT JOIN bsth_c_station b ON a.stationRouteStation = b.id", nativeQuery=true)  
267 - List<Object[]> findStationRouteInfo(Integer id);  
268 -  
269 - // 批量修改站点行业编码  
270 - @Modifying  
271 - @Query(value="update bsth_c_ls_stationroute set industry_code =?2 where id = ?1 ", nativeQuery=true)  
272 - void updIndustryCode(Integer id, String industryCode);  
273 -  
274 - @Modifying  
275 - @Query(value="UPDATE bsth_c_ls_stationroute set station_route_code = (station_route_code+10) where line = ?1 and directions = ?2 and station_route_code >=?3 and destroy = 0", nativeQuery=true)  
276 - void stationUpdStationRouteCode(Integer line,Integer dir,Integer routeCod);  
277 -  
278 - @Modifying  
279 - @Query(value="update bsth_c_ls_stationroute set directions = case directions when 1 then 0 when 0 then 1 end where line = ?1 ", nativeQuery=true)  
280 - void stationRouteDir(Integer line);  
281 -  
282 - @Query("select r from LsStationRoute r where r.line.id=?1 and r.directions=?2 and r.destroy=0 order by r.stationRouteCode")  
283 - List<LsStationRoute> findByLine(int lineId, int dir);  
284 -  
285 - @Modifying  
286 - @Query(value="update bsth_c_ls_stationroute set distances =?2 where id = ?1 ", nativeQuery=true)  
287 - void upddis(Integer id,Double dis);  
288 -  
289 - @Query(value="select * from bsth_c_ls_stationroute where line_code = ?3 and directions = ?4 and destroy = 0 and versions = ?5 limit ?1,?2", nativeQuery=true)  
290 - Iterable<LsStationRoute> page(int start , int end , int line ,int dir, int version);  
291 -  
292 - @Query(value="select count(*) from bsth_c_ls_stationroute where line_code = ?1 and directions = ?2 and destroy = 0 and versions = ?3 ", nativeQuery=true)  
293 - int count(int line, int dir, int version);  
294 -  
295 - @Query(value = " select r.station_code, r.station_name, r.versions " +  
296 - "from bsth_c_ls_stationroute r where r.line_code = ?1 " +  
297 - "and r.directions=?2 and r.destroy = 0 and r.versions in(" +  
298 - "select v.versions from bsth_c_line_versions v where v.line_code=?1 " +  
299 - "and ((date_format(v.start_date, '%Y-%m-%d') >= ?3 and date_format(v.start_date, '%Y-%m-%d') <= ?4) " +  
300 - " or (date_format(v.start_date, '%Y-%m-%d') <= ?4 and date_format(v.end_date, '%Y-%m-%d') >= ?4) " +  
301 - " or (date_format(v.start_date, '%Y-%m-%d') >= ?3 and date_format(v.end_date, '%Y-%m-%d') <= ?4))" +  
302 - ") order by r.versions desc, r.station_route_code asc ", nativeQuery = true)  
303 - List<Object[]> findHistory(String lineCode, Integer updown, String date1, String date2);  
304 -} 1 +package com.bsth.repository;
  2 +
  3 +import java.util.List;
  4 +import java.util.Map;
  5 +
  6 +import org.springframework.data.jpa.repository.EntityGraph;
  7 +import org.springframework.data.jpa.repository.Modifying;
  8 +import org.springframework.data.jpa.repository.Query;
  9 +import org.springframework.stereotype.Repository;
  10 +import org.springframework.transaction.annotation.Transactional;
  11 +
  12 +import com.bsth.entity.LsStationRoute;
  13 +
  14 +/**
  15 + *
  16 + * @Interface: StationRouteRepository(站点路由Repository数据持久层接口)
  17 + *
  18 + * @Extends : BaseRepository
  19 + *
  20 + * @Description: TODO(站点路由Repository数据持久层接口)
  21 + *
  22 + * @Author bsth@lq
  23 + *
  24 + * @Version 公交调度系统BS版 0.1
  25 + *
  26 + */
  27 +
  28 +@Repository
  29 +public interface LsStationRouteRepository extends BaseRepository<LsStationRoute, Integer> {
  30 +
  31 + /**
  32 + * 查询待更新线路的站点路由
  33 + */
  34 + @EntityGraph(value = "ls_stationRoute_station", type = EntityGraph.EntityGraphType.FETCH)
  35 + @Query(value = "SELECT DISTINCT sr FROM LsStationRoute sr where sr.line.id =?1 and sr.lineCode=?2 and sr.versions=?3 and sr.destroy=0")
  36 + List<LsStationRoute> findupdated(Integer lineId, String lineCode, Integer versions);
  37 +
  38 + @Query(value = "SELECT a.`stationRoute.id`," +
  39 + "a.`stationRoute.line`," +
  40 + "a.`stationRoute.station`," +
  41 + "a.`stationRoute.stationName`," +
  42 + "a.`stationRoute.stationRouteCode`," +
  43 + "a.`stationRoute.lineCode`," +
  44 + "a.`stationRoute.stationMark`," +
  45 + "a.`stationRoute.outStationNmber`," +
  46 + "a.`stationRoute.directions`," +
  47 + "a.`stationRoute.distances`," +
  48 + "a.`stationRoute.toTime`," +
  49 + "a.`stationRoute.firstTime`," +
  50 + "a.`stationRoute.endTime`," +
  51 + "a.`stationRoute.descriptions`," +
  52 + "a.`stationRoute.versions`," +
  53 + "b.id AS 'station.id'," +
  54 + "b.station_cod AS 'station.stationCod'," +
  55 + "b.station_name AS 'station.stationName'," +
  56 + "b.road_coding AS 'station.roadCoding'," +
  57 + "b.db_type AS 'station.dbType'," +
  58 + "b.b_jwpoints AS 'station.bJwpoints'," +
  59 + "b.g_lonx AS 'station.gLonx'," +
  60 + "b.g_lonx AS 'station.gLaty'," +
  61 + "b.x AS 'station.x'," +
  62 + "b.y AS 'station.y'," +
  63 + "b.shapes_type AS 'station.shapesType'," +
  64 + "b.radius AS 'station.radius'," +
  65 + "ST_AsText(b.g_polygon_grid) AS 'station.gPolygonGrid'," +
  66 + "ST_AsText(b.b_polygon_grid) AS 'station.bPolygonGrid'," +
  67 + "b.destroy AS 'station.destroy'," +
  68 + "b.versions AS 'station.versions'," +
  69 + "b.descriptions AS 'station.descriptions', " +
  70 + "a.`stationRoute.industryCode` " +
  71 + " FROM (" +
  72 + "SELECT r.id AS 'stationRoute.id'," +
  73 + " r.line AS 'stationRoute.line'," +
  74 + "r.station AS 'stationRoute.station'," +
  75 + "r.station_name AS 'stationRoute.stationName'," +
  76 + "r.station_route_code as 'stationRoute.stationRouteCode'," +
  77 + "r.line_code AS 'stationRoute.lineCode'," +
  78 + "r.station_mark AS 'stationRoute.stationMark'," +
  79 + "r.out_station_nmber AS 'stationRoute.outStationNmber'," +
  80 + "r.directions AS 'stationRoute.directions'," +
  81 + "r.distances AS 'stationRoute.distances'," +
  82 + "r.to_time AS 'stationRoute.toTime'," +
  83 + "r.first_time AS 'stationRoute.firstTime'," +
  84 + "r.end_time AS 'stationRoute.endTime'," +
  85 + "r.descriptions AS 'stationRoute.descriptions'," +
  86 + "r.versions AS 'stationRoute.versions', " +
  87 + "r.industry_code AS 'stationRoute.industryCode' " +
  88 + " FROM bsth_c_ls_stationroute r WHERE r.line = ?1 and r.directions = ?2 and r.versions=?3 and r.destroy=0) a " +
  89 + "LEFT JOIN bsth_c_station b " +
  90 + "ON a.`stationRoute.station` = b.id ORDER BY a.`stationRoute.stationRouteCode` ASC", nativeQuery=true)
  91 + List<Object[]> findPoints(Integer lineId, Integer direction, Integer versions);
  92 +
  93 +
  94 + @Query(value = "SELECT a.stationRouteLine," +
  95 + " a.stationRouteStation," +
  96 + " a.stationRouteCode," +
  97 + " a.stationRouteLIneCode," +
  98 + " a.stationRouteStationMark," +
  99 + " a.stationOutStationNmber," +
  100 + " a.stationRoutedirections," +
  101 + " a.stationRouteDistances," +
  102 + " a.stationRouteToTime," +
  103 + " a.staitonRouteFirstTime," +
  104 + " a.stationRouteEndTime," +
  105 + " a.stationRouteDescriptions," +
  106 + " a.stationRouteDestroy," +
  107 + " a.stationRouteVersions," +
  108 + " a.stationRouteCreateBy," +
  109 + " a.stationRouteCreateDate," +
  110 + " a.stationRouteUpdateBy," +
  111 + " a.stationRouteUpdateDate," +
  112 + " b.id AS stationId," +
  113 + " b.station_cod AS stationCode," +
  114 + " a.stationRouteName," +
  115 + " b.road_coding AS stationRoadCoding," +
  116 + " b.db_type AS stationDbType," +
  117 + " b.b_jwpoints AS stationJwpoints," +
  118 + " b.g_lonx AS stationGlonx," +
  119 + " b.g_laty AS stationGlaty," +
  120 + " b.x AS stationX," +
  121 + " b.y AS stationY," +
  122 + " ST_AsText(b.b_polygon_grid) as stationBPolyonGrid," +
  123 + " ST_AsText(b.g_polygon_grid) AS stationGPloyonGrid, " +
  124 + " b.destroy AS stationDestroy," +
  125 + " b.radius AS stationRadius," +
  126 + " b.shapes_type AS stationShapesType," +
  127 + " b.versions AS stationVersions," +
  128 + " b.descriptions AS sttationDescriptions," +
  129 + " b.create_by AS stationCreateBy," +
  130 + " b.create_date AS stationCreateDate," +
  131 + " b.update_by AS stationUpdateBy," +
  132 + " b.update_date AS stationUpdateDate," +
  133 + " a.stationRouteId," +
  134 + "b.station_name as zdmc, "+
  135 + "a.industryCode "+
  136 + " FROM ( SELECT s.id AS stationRouteId," +
  137 + " s.line AS stationRouteLine," +
  138 + " s.station as stationRouteStation," +
  139 + " s.station_name AS stationRouteName," +
  140 + " s.station_route_code as stationRouteCode," +
  141 + " s.industry_code as industryCode," +
  142 + " s.line_code AS stationRouteLIneCode," +
  143 + " s.station_mark AS stationRouteStationMark," +
  144 + " s.out_station_nmber AS stationOutStationNmber," +
  145 + " s.directions AS stationRoutedirections," +
  146 + " s.distances AS stationRouteDistances," +
  147 + " s.to_time AS stationRouteToTime," +
  148 + " s.first_time AS staitonRouteFirstTime," +
  149 + " s.end_time AS stationRouteEndTime," +
  150 + " s.descriptions AS stationRouteDescriptions," +
  151 + " s.destroy AS stationRouteDestroy," +
  152 + " s.versions AS stationRouteVersions," +
  153 + " s.create_by AS stationRouteCreateBy," +
  154 + " s.create_date AS stationRouteCreateDate," +
  155 + " s.update_by AS stationRouteUpdateBy," +
  156 + " s.update_date AS stationRouteUpdateDate FROM bsth_c_ls_stationroute s WHERE s.line = ?1 and s.directions = ?2 and s.versions=?3 and s.destroy = 0) a " +
  157 + " LEFT JOIN bsth_c_station b ON a.stationRouteStation = b.id order by a.stationRouteCode", nativeQuery=true)
  158 + List<Object[]> getStationRouteList(Integer lineId, Integer dir ,Integer version);
  159 + /**
  160 + * 更新路线前删除线路版本号历史原有站点路由
  161 + *
  162 + * @param line
  163 + * @param dir
  164 + */
  165 + @Modifying
  166 + @Transactional
  167 + @Query(value="DELETE from bsth_c_ls_stationroute where line = ?1 and directions = ?2 and versions = ?3", nativeQuery=true)
  168 + public void batchDelete(Integer line,Integer dir, Integer versions);
  169 +
  170 + /**
  171 + * 更新路线前撤销线路版本号历史原有站点路由
  172 + *
  173 + * @param line
  174 + * @param dir
  175 + */
  176 + @Modifying
  177 + @Query(value="UPDATE bsth_c_ls_stationroute set destroy = 1 where line = ?1 and directions = ?2 and versions = ?3", nativeQuery=true)
  178 + public void batchDestroy(Integer sectionRouteLine, Integer directions, Integer versions);
  179 +
  180 + /**
  181 + * 按线路编码查询各站点的顺序号
  182 + * @param lineCode 线路编码
  183 + * @param lineVersion 版本号
  184 + * @return
  185 + */
  186 + @Query("SELECT new map(" +
  187 + "lineCode as lineCode,directions as directions,stationName as stationName,stationCode as stationCode," +
  188 + "line.linePlayType as linePlayType,s.stationMark as stationMark) " +
  189 + "FROM " +
  190 + "LsStationRoute s " +
  191 + "WHERE " +
  192 + "s.destroy = 0 AND s.lineCode = ?1 AND s.versions = ?2 " +
  193 + "ORDER BY " +
  194 + "lineCode,directions,stationRouteCode")
  195 + List<Map<String, String>> findLineWithLineCode4Ygc(String lineCode,Integer lineVersion);
  196 + /**
  197 + * @Description : TODO(根据站点路由Id查询详情)
  198 + *
  199 + * @param id:站点路由ID
  200 + *
  201 + * @return List<Object[]>
  202 + */
  203 + @Query(value = "SELECT a.stationRouteLine," +
  204 + " a.stationRouteStation," +
  205 + " a.stationRouteCode," +
  206 + " a.stationRouteLIneCode," +
  207 + " a.stationRouteStationMark," +
  208 + " a.stationOutStationNmber," +
  209 + " a.stationRoutedirections," +
  210 + " a.stationRouteDistances," +
  211 + " a.stationRouteToTime," +
  212 + " a.staitonRouteFirstTime," +
  213 + " a.stationRouteEndTime," +
  214 + " a.stationRouteDescriptions," +
  215 + " a.stationRouteDestroy," +
  216 + " a.stationRouteVersions," +
  217 + " a.stationRouteCreateBy," +
  218 + " a.stationRouteCreateDate," +
  219 + " a.stationRouteUpdateBy," +
  220 + " a.stationRouteUpdateDate," +
  221 + " b.id AS stationId," +
  222 + " b.station_cod AS stationCode," +
  223 + " a.stationRouteName," +
  224 + " b.road_coding AS stationRoadCoding," +
  225 + " b.db_type AS stationDbType," +
  226 + " b.b_jwpoints AS stationJwpoints," +
  227 + " b.g_lonx AS stationGlonx," +
  228 + " b.g_laty AS stationGlaty," +
  229 + " b.x AS stationX," +
  230 + " b.y AS stationY," +
  231 + " ST_AsText(b.b_polygon_grid) as stationBPolyonGrid," +
  232 + " ST_AsText(b.g_polygon_grid) AS stationGPloyonGrid, " +
  233 + " b.destroy AS stationDestroy," +
  234 + " b.radius AS stationRadius," +
  235 + " b.shapes_type AS stationShapesType," +
  236 + " b.versions AS stationVersions," +
  237 + " b.descriptions AS sttationDescriptions," +
  238 + " b.create_by AS stationCreateBy," +
  239 + " b.create_date AS stationCreateDate," +
  240 + " b.update_by AS stationUpdateBy," +
  241 + " b.update_date AS stationUpdateDate," +
  242 + " a.stationRouteId,b.station_name as zdmc, " +
  243 + " a.industryCode "+
  244 + " FROM " +
  245 + "( SELECT s.id AS stationRouteId," +
  246 + " s.line AS stationRouteLine," +
  247 + " s.station as stationRouteStation," +
  248 + " s.station_name AS stationRouteName," +
  249 + " s.station_route_code as stationRouteCode," +
  250 + " s.industry_code as industryCode," +
  251 + " s.line_code AS stationRouteLIneCode," +
  252 + " s.station_mark AS stationRouteStationMark," +
  253 + " s.out_station_nmber AS stationOutStationNmber," +
  254 + " s.directions AS stationRoutedirections," +
  255 + " s.distances AS stationRouteDistances," +
  256 + " s.to_time AS stationRouteToTime," +
  257 + " s.first_time AS staitonRouteFirstTime," +
  258 + " s.end_time AS stationRouteEndTime," +
  259 + " s.descriptions AS stationRouteDescriptions," +
  260 + " s.destroy AS stationRouteDestroy," +
  261 + " s.versions AS stationRouteVersions," +
  262 + " s.create_by AS stationRouteCreateBy," +
  263 + " s.create_date AS stationRouteCreateDate," +
  264 + " s.update_by AS stationRouteUpdateBy," +
  265 + " s.update_date AS stationRouteUpdateDate FROM bsth_c_ls_stationroute s WHERE s.id = ?1 ) a " +
  266 + " LEFT JOIN bsth_c_station b ON a.stationRouteStation = b.id", nativeQuery=true)
  267 + List<Object[]> findStationRouteInfo(Integer id);
  268 +
  269 + // 批量修改站点行业编码
  270 + @Modifying
  271 + @Query(value="update bsth_c_ls_stationroute set industry_code =?2 where id = ?1 ", nativeQuery=true)
  272 + void updIndustryCode(Integer id, String industryCode);
  273 +
  274 + @Modifying
  275 + @Query(value="UPDATE bsth_c_ls_stationroute set station_route_code = (station_route_code+10) where line = ?1 and directions = ?2 and station_route_code >=?3 and destroy = 0", nativeQuery=true)
  276 + void stationUpdStationRouteCode(Integer line,Integer dir,Integer routeCod);
  277 +
  278 + @Modifying
  279 + @Query(value="update bsth_c_ls_stationroute set directions = case directions when 1 then 0 when 0 then 1 end where line = ?1 ", nativeQuery=true)
  280 + void stationRouteDir(Integer line);
  281 +
  282 + @Query("select r from LsStationRoute r where r.line.id=?1 and r.directions=?2 and r.destroy=0 order by r.stationRouteCode")
  283 + List<LsStationRoute> findByLine(int lineId, int dir);
  284 +
  285 + @Modifying
  286 + @Query(value="update bsth_c_ls_stationroute set distances =?2 where id = ?1 ", nativeQuery=true)
  287 + void upddis(Integer id,Double dis);
  288 +
  289 + @Query(value="select * from bsth_c_ls_stationroute where line_code = ?3 and directions = ?4 and destroy = 0 and versions = ?5 limit ?1,?2", nativeQuery=true)
  290 + Iterable<LsStationRoute> page(int start , int end , int line ,int dir, int version);
  291 +
  292 + @Query(value="select count(*) from bsth_c_ls_stationroute where line_code = ?1 and directions = ?2 and destroy = 0 and versions = ?3 ", nativeQuery=true)
  293 + int count(int line, int dir, int version);
  294 +
  295 + @Query(value = " select r.station_code, r.station_name, r.versions " +
  296 + "from bsth_c_ls_stationroute r where r.line_code = ?1 " +
  297 + "and r.directions=?2 and r.destroy = 0 and r.versions in(" +
  298 + "select v.versions from bsth_c_line_versions v where v.line_code=?1 " +
  299 + "and ((date_format(v.start_date, '%Y-%m-%d') >= ?3 and date_format(v.start_date, '%Y-%m-%d') <= ?4) " +
  300 + " or (date_format(v.start_date, '%Y-%m-%d') <= ?4 and date_format(v.end_date, '%Y-%m-%d') >= ?4) " +
  301 + " or (date_format(v.start_date, '%Y-%m-%d') >= ?3 and date_format(v.end_date, '%Y-%m-%d') <= ?4))" +
  302 + ") order by r.versions desc, r.station_route_code asc ", nativeQuery = true)
  303 + List<Object[]> findHistory(String lineCode, Integer updown, String date1, String date2);
  304 +
  305 + @Query("select r from LsStationRoute r where r.line.id=?1 and r.versions=?2 and r.directions=?3 and r.destroy=0 order by r.stationRouteCode")
  306 + List<LsStationRoute> findByLineVersion(int lineId, int version, int dir);
  307 +}
src/main/java/com/bsth/service/InoutCarparkService.java 0 → 100644
  1 +package com.bsth.service;
  2 +
  3 +import com.bsth.entity.LsStationRoute;
  4 +import com.bsth.entity.StationRoute;
  5 +import com.bsth.entity.StationRouteCache;
  6 +import com.fasterxml.jackson.core.JsonProcessingException;
  7 +
  8 +import javax.servlet.http.HttpServletResponse;
  9 +import java.util.List;
  10 +import java.util.Map;
  11 +
  12 +public interface InoutCarparkService {
  13 +
  14 + Map<String, Object> getStartEndByLine(int lineId, int version);
  15 +
  16 + Map<String, Object> getRouteByStartEnd(int lineId, int version, String start, String end);
  17 +
  18 + Map<String, Object> sectionSave(Map<String, Object> map);
  19 +
  20 + Map<String, Object> sectionUpdate(Map<String, Object> map);
  21 +
  22 + Map<String, Object> destroy(Map<String, Object> map);
  23 +
  24 + void pathPlaningByHistory(long schId, int versions) throws JsonProcessingException;
  25 +}
src/main/java/com/bsth/service/impl/InoutCarparkServiceImpl.java 0 → 100644
  1 +package com.bsth.service.impl;
  2 +
  3 +import com.alibaba.fastjson.JSONArray;
  4 +import com.bsth.common.ResponseCode;
  5 +import com.bsth.data.BasicData;
  6 +import com.bsth.entity.*;
  7 +import com.bsth.entity.realcontrol.ScheduleRealInfo;
  8 +import com.bsth.repository.*;
  9 +import com.bsth.repository.realcontrol.ScheduleRealInfoRepository;
  10 +import com.bsth.service.InoutCarparkService;
  11 +import com.bsth.service.gps.GpsService;
  12 +import com.bsth.util.TransGPS;
  13 +import com.fasterxml.jackson.core.JsonProcessingException;
  14 +import com.fasterxml.jackson.databind.ObjectMapper;
  15 +import org.joda.time.DateTime;
  16 +import org.joda.time.format.DateTimeFormat;
  17 +import org.joda.time.format.DateTimeFormatter;
  18 +import org.slf4j.Logger;
  19 +import org.slf4j.LoggerFactory;
  20 +import org.springframework.beans.factory.annotation.Autowired;
  21 +import org.springframework.stereotype.Service;
  22 +import org.springframework.transaction.annotation.Transactional;
  23 +
  24 +import javax.persistence.EntityManager;
  25 +import java.text.SimpleDateFormat;
  26 +import java.util.*;
  27 +
  28 +/**
  29 + * @author Hill
  30 + */
  31 +@Service
  32 +public class InoutCarparkServiceImpl extends BaseServiceImpl<LsInoutSectionRoute, Long> implements InoutCarparkService {
  33 +
  34 + private final static Logger logger = LoggerFactory.getLogger(InoutCarparkServiceImpl.class);
  35 +
  36 + @Autowired
  37 + private LsStationRouteRepository lsStationRouteRepository;
  38 +
  39 + @Autowired
  40 + private CarParkRepository carParkRepository;
  41 +
  42 + @Autowired
  43 + private LsInoutSectionRouteRepository lsInoutSectionRouteRepository;
  44 +
  45 + @Autowired
  46 + private SectionRepository sectionRepository;
  47 +
  48 + @Autowired
  49 + LineRepository lineRepository;
  50 +
  51 + @Autowired
  52 + private ScheduleRealInfoRepository scheduleRealInfoRepository;
  53 +
  54 + @Autowired
  55 + private GpsService gpsService;
  56 +
  57 + @Override
  58 + public Map<String, Object> getStartEndByLine(int lineId, int version) {
  59 + Map<String, Object> result = new HashMap<>(), data = new HashMap<>();
  60 + result.put("code", 0);
  61 + result.put("msg", "");
  62 + result.put("data", data);
  63 +
  64 + List<LsStationRoute> upRoutes = lsStationRouteRepository.findByLineVersion(lineId, version, 0), downRoutes = lsStationRouteRepository.findByLineVersion(lineId, version, 1);
  65 + CarPark carPark = carParkRepository.findByLineId(lineId);
  66 + if (carPark == null) {
  67 + result.put("code", 500);
  68 + result.put("msg", "线路标准信息中无相应的停车场信息");
  69 +
  70 + return result;
  71 + }
  72 + if (upRoutes.size() < 2) {
  73 + result.put("code", 500);
  74 + result.put("msg", "线路上行站级少于2");
  75 +
  76 + return result;
  77 + }
  78 + LsStationRoute upFirst = upRoutes.get(0), upLast = upRoutes.get(upRoutes.size() - 1);
  79 + LsStationRoute downFirst = downRoutes.get(0), downLast = downRoutes.get(downRoutes.size() - 1);
  80 + // 环线或双环线只需提取一个起点站
  81 + if (upFirst.getStationCode().equals(upLast.getStationCode())) {
  82 + data.put("start", new LsStationRoute[]{ upFirst });
  83 + data.put("end", new LsStationRoute[]{ upFirst });
  84 + } else {
  85 + if (downRoutes.size() < 2) {
  86 + result.put("code", 500);
  87 + result.put("msg", "非环线线路下行站级少于2");
  88 +
  89 + return result;
  90 + }
  91 + data.put("start", new LsStationRoute[]{ upFirst, downFirst });
  92 + data.put("end", new LsStationRoute[]{ upLast, downLast });
  93 + }
  94 + data.put("carpark", carPark);
  95 +
  96 + return result;
  97 + }
  98 +
  99 + @Override
  100 + public Map<String, Object> getRouteByStartEnd(int lineId, int version, String start, String end) {
  101 + Map<String, Object> result = new HashMap<>(), data = new HashMap<>();
  102 + result.put("code", 0);
  103 + result.put("msg", "");
  104 + result.put("data", data);
  105 + data.put("routes", lsInoutSectionRouteRepository.getRouteByStartEnd(lineId, version, start, end));
  106 +
  107 + return result;
  108 + }
  109 +
  110 + /**
  111 + * 新增路段信息
  112 + *
  113 + * @param map:<bsectionVector:折线百度坐标集合;dbType:圆坐标类型;descriptions:描述与说明;destroy:是否撤销;directions:方向;lineId:线路ID
  114 + *
  115 + * lineCode :线路编码;roadCoding:道路编码;sectionCode:路段编码;sectionDistance:路段长度;sectionName:路段名称;sectionTime:路段时长;
  116 + *
  117 + * sectionrouteCode:路段序号;speedLimit:路段限速>
  118 + *
  119 + * @return map<SUCCESS:成功;ERROR:异常>
  120 + */
  121 + @Override
  122 + @Transactional
  123 + public Map<String, Object> sectionSave(Map<String, Object> map) {
  124 + Map<String, Object> resultMap = new HashMap<String, Object>();
  125 + try {
  126 + // 线路ID.
  127 + Integer lineId = map.get("lineId").equals("") ? null : Integer.valueOf(map.get("lineId").toString());
  128 + // 线路编码.
  129 + String lineCode = map.get("lineCode").equals("") ? "" : map.get("lineCode").toString();
  130 + // 路段名称.
  131 + String sectionName = map.get("sectionName").equals("") ? "" : map.get("sectionName").toString();
  132 + // 路段编码.
  133 + String sectionCode = map.get("sectionCode").equals("") ? "" : map.get("sectionCode").toString();
  134 + // 道路编码.
  135 + String roadCoding = map.get("roadCoding").equals("") ? "" : map.get("roadCoding").toString();
  136 + // 原始坐标类型.
  137 + String dbType = map.get("dbType").equals("") ? "" :map.get("dbType").toString();
  138 + // 路段几何图形坐标.
  139 + String sectionJSON = map.get("bsectionVector").equals("") ? "" : map.get("bsectionVector").toString();
  140 + // 路段序号
  141 + String sectionrouteCode = map.get("sectionrouteCode").equals("") ? "" : map.get("sectionrouteCode").toString();
  142 + // 路段时长.
  143 + Double sectionTime = map.get("sectionTime").equals("") ? 0.0d : Double.valueOf(map.get("sectionTime").toString());
  144 + // 路段距离.
  145 + Double sectionDistance = map.get("sectionDistance").equals("") ? 0.0d : Double.valueOf(map.get("sectionDistance").toString());
  146 + // 路段限速.
  147 + Double speedLimit = map.get("speedLimit").equals("") ? 0.0d : Double.valueOf(map.get("speedLimit").toString());
  148 + // 版本.
  149 + Integer versions = map.get("versions").equals("") ? 1 : Integer.valueOf(map.get("versions").toString());
  150 + // 是否撤销.
  151 + Integer destroy = map.get("destroy").equals("") ? 0 : Integer.valueOf(map.get("destroy").toString());
  152 + // 路段方向.
  153 + Integer directions = map.get("directions").equals("") ? 0 : Integer.valueOf(map.get("directions").toString());
  154 + // 描述与说明.
  155 + String descriptions = map.get("descriptions").equals("")? "" : map.get("descriptions").toString();
  156 + // 起始
  157 + String start = map.get("start").equals("")? "" : map.get("start").toString();
  158 + // 结束
  159 + String end = map.get("end").equals("")? "" : map.get("end").toString();
  160 + // 原始线状图形坐标集合
  161 + String sectionsBpoints = "";
  162 + // WGS线状图形坐标集合
  163 + String sectionsWJPpoints = "";
  164 + if(!sectionJSON.equals("")) {
  165 + // 转换成JSON数组
  166 + JSONArray sectionsArray = JSONArray.parseArray(sectionJSON);
  167 + // 遍历
  168 + for(int s = 0 ;s<sectionsArray.size();s++) {
  169 + String pointsLngStr = sectionsArray.getJSONObject(s).get("lng").toString();
  170 + String pointsLatStr = sectionsArray.getJSONObject(s).get("lat").toString();
  171 + String WGSLngStr = "";
  172 + String WGSLatStr = "";
  173 + TransGPS.Location resultPoint = FromBDPointToWGSPoint(pointsLngStr,pointsLatStr);
  174 + WGSLngStr = String.valueOf(resultPoint.getLng());
  175 + WGSLatStr = String.valueOf(resultPoint.getLat());
  176 + if(s==0) {
  177 + sectionsBpoints = pointsLngStr + " " + pointsLatStr;
  178 + sectionsWJPpoints = WGSLngStr + " " + WGSLatStr;
  179 + }else {
  180 + sectionsBpoints = sectionsBpoints + "," + pointsLngStr + " " + pointsLatStr;
  181 + sectionsWJPpoints = sectionsWJPpoints + "," + WGSLngStr + " " + WGSLatStr;
  182 + }
  183 + }
  184 + }
  185 + // WGS坐标点集合
  186 + String gsectionVector = "LINESTRING(" + sectionsWJPpoints +")";
  187 + // 原坐标点集合
  188 + String bsectionVector = "LINESTRING(" + sectionsBpoints + ")";
  189 + String crosesRoad="";
  190 + String endNode ="";
  191 + String startNode="";
  192 + String middleNode="";
  193 + String sectionType="";
  194 + String csectionVector=null;
  195 + Integer id = Integer.valueOf(sectionCode);
  196 + sectionRepository.systemSave(sectionCode, sectionName, crosesRoad, endNode, startNode, middleNode, gsectionVector, bsectionVector, sectionType, csectionVector, roadCoding, sectionDistance, sectionTime, dbType, speedLimit, descriptions, versions, id);
  197 + Section section = sectionRepository.findById(id).get();
  198 +
  199 + Line line = lineRepository.findById(lineId).get();
  200 +
  201 +
  202 + if (map.get("status") == null || Integer.parseInt(map.get("status").toString()) != 0) {
  203 +
  204 + LsInoutSectionRoute sectionRoute = new LsInoutSectionRoute();
  205 + Integer routeCode = null;
  206 + if(!sectionrouteCode.equals("")){
  207 + String sectionrouteCodeArray[] = sectionrouteCode.split("_");
  208 + routeCode = Integer.valueOf(sectionrouteCodeArray[0])+1;
  209 + }else {
  210 + routeCode = 1;
  211 + }
  212 + sectionRoute.setSectionrouteCode(routeCode);
  213 + sectionRoute.setLineCode(lineCode);
  214 + sectionRoute.setSection(section);
  215 + sectionRoute.setSectionCode(sectionCode);
  216 + sectionRoute.setDirections(directions);
  217 + sectionRoute.setDescriptions(descriptions);
  218 + sectionRoute.setDestroy(destroy);
  219 + sectionRoute.setVersions(versions);
  220 + sectionRoute.setLine(line);
  221 + sectionRoute.setStart(start);
  222 + sectionRoute.setEnd(end);
  223 + lsInoutSectionRouteRepository.save(sectionRoute);
  224 + }
  225 +
  226 +
  227 + resultMap.put("status", ResponseCode.SUCCESS);
  228 + } catch (Exception e) {
  229 + resultMap.put("status", ResponseCode.ERROR);
  230 + logger.error("save erro.", e);
  231 + }
  232 + return resultMap;
  233 + }
  234 +
  235 + /** 百度坐标转WGS坐标 */
  236 + public TransGPS.Location FromBDPointToWGSPoint(String bLonx, String bLatx) {
  237 +
  238 + double lng = Double.parseDouble(bLonx);
  239 +
  240 + double lat = Double.parseDouble(bLatx);
  241 +
  242 + TransGPS.Location bdLoc = TransGPS.LocationMake(lng, lat);
  243 +
  244 + TransGPS.Location location = TransGPS.bd_decrypt(bdLoc);
  245 +
  246 + TransGPS.Location WGSPoint = TransGPS.transformFromGCJToWGS(location);
  247 +
  248 + return WGSPoint;
  249 +
  250 + }
  251 +
  252 + /**
  253 + * @Description :TODO(编辑线路走向)
  254 + *
  255 + * @param map <sectionId:路段ID; sectionJSON:路段信息>
  256 + *
  257 + * @return Map<String, Object> <SUCCESS ; ERROR>
  258 + */
  259 + @Override
  260 + @Transactional
  261 + public Map<String, Object> sectionUpdate(Map<String, Object> map) {
  262 + Map<String, Object> resultMap = new HashMap<String, Object>();
  263 + try {
  264 + String bsectionVector = map.get("bsectionVector").equals("") ? "" :map.get("bsectionVector").toString();
  265 + // 原始线状图形坐标集合
  266 + String sectionsBpoints = "";
  267 + // WGS线状图形坐标集合
  268 + String sectionsWJPpoints = "";
  269 + if(!bsectionVector.equals("")) {
  270 + // 转换成JSON数组
  271 + JSONArray sectionsArray = JSONArray.parseArray(bsectionVector);
  272 + // 遍历
  273 + for(int s = 0 ;s<sectionsArray.size();s++) {
  274 + String pointsLngStr = sectionsArray.getJSONObject(s).get("lng").toString();
  275 + String pointsLatStr = sectionsArray.getJSONObject(s).get("lat").toString();
  276 + /** to WGS坐标 */
  277 + TransGPS.Location resultPoint = FromBDPointToWGSPoint(pointsLngStr,pointsLatStr);
  278 + String WGSLngStr = String.valueOf(resultPoint.getLng());
  279 + String WGSLatStr = String.valueOf(resultPoint.getLat());
  280 + if(s==0) {
  281 + sectionsBpoints = pointsLngStr + " " + pointsLatStr;
  282 + sectionsWJPpoints = WGSLngStr + " " + WGSLatStr;
  283 + }else {
  284 + sectionsBpoints = sectionsBpoints + "," + pointsLngStr + " " + pointsLatStr;
  285 + sectionsWJPpoints = sectionsWJPpoints + "," + WGSLngStr + " " + WGSLatStr;
  286 + }
  287 + }
  288 + }
  289 + // 原坐标类型
  290 + String dbType = map.get("dbType").equals("") ? "" : map.get("dbType").toString();
  291 + // 说明
  292 + String descriptions = "";
  293 + // 是否撤销
  294 + Integer destroy = map.get("destroy").equals("") ? null : Integer.parseInt(map.get("destroy").toString());
  295 + // 方向
  296 + Integer directions = map.get("directions").equals("") ? null : Integer.parseInt(map.get("directions").toString());
  297 + // 线路ID
  298 + Integer sectionRouteLine = map.get("sectionRouteLine").equals("") ? null : Integer.parseInt(map.get("sectionRouteLine").toString());
  299 + // 道路编码
  300 + String roadCoding = map.get("roadCoding").equals("") ? "" : map.get("roadCoding").toString();
  301 + // 路段编码
  302 + String sectionCode = map.get("sectionCode").equals("") ? "" : map.get("sectionCode").toString();
  303 + // 路段长度
  304 + Double sectionDistance = map.get("sectionDistance").equals("") ? null : Double.valueOf(map.get("sectionDistance").toString());
  305 + // 路段ID
  306 + Integer sectionId = map.get("sectionId").equals("") ? 0 : Integer.parseInt(map.get("sectionId").toString());
  307 + // 路段名称
  308 + String sectionName = map.get("sectionName").equals("") ? "" : map.get("sectionName").toString();
  309 + // 路段路由Id
  310 + Long sectionRouteId = map.get("sectionRouteId").equals("") ? null : Long.valueOf(map.get("sectionRouteId").toString());
  311 + // 线路编码
  312 + String lineCode =map.get("lineCode").equals("") ? "" : map.get("lineCode").toString();
  313 + // 路段时长
  314 + Double sectionTime = map.get("sectionTime").equals("") ? null : Double.valueOf(map.get("sectionTime").toString());
  315 + // 路段路由
  316 + Integer sectionrouteCode = "".equals(map.get("sectionrouteCode")) ? null : Integer.valueOf(map.get("sectionrouteCode").toString());
  317 + // 限速
  318 + Double speedLimit = map.get("speedLimit").equals("") ? null : Double.valueOf(map.get("speedLimit").toString());
  319 + // 版本
  320 + Integer version = map.get("versions").equals("") ? null : Integer.valueOf(map.get("versions").toString());
  321 + // 起始
  322 + String start = map.get("start").equals("")? "" : map.get("start").toString();
  323 + // 结束
  324 + String end = map.get("end").equals("")? "" : map.get("end").toString();
  325 + // WGS坐标点集合
  326 + String gsectionVector = null;
  327 + if(!sectionsWJPpoints.equals("")) {
  328 + gsectionVector = "LINESTRING(" + sectionsWJPpoints +")";
  329 + }
  330 + // 原坐标点集合
  331 + String bsectionVectorS = null;
  332 + if(!sectionsBpoints.equals("")) {
  333 + bsectionVectorS = "LINESTRING(" + sectionsBpoints + ")";
  334 + }
  335 + Integer createBy = map.get("createBy").equals("") ? null : Integer.valueOf(map.get("createBy").toString());
  336 + String createDate = map.get("createDate").equals("") ? null : map.get("createDate").toString();
  337 + Integer updateBy = map.get("updateBy").equals("") ?null : Integer.valueOf(map.get("updateBy").toString());
  338 + SimpleDateFormat formatter = new SimpleDateFormat ("yyyy-MM-dd HH:mm:ss");
  339 + Date date = new Date();
  340 + // 修改日期
  341 + String updateDate = formatter.format(date);
  342 + String crosesRoad="";
  343 + String endNode="";
  344 + String startNode="";
  345 + String middleNode="";
  346 + String sectionType="";
  347 + // 更新
  348 + sectionRepository.sectionUpdate(sectionId, gsectionVector, bsectionVectorS, sectionCode, sectionName, crosesRoad, endNode, startNode, middleNode, sectionType, roadCoding, sectionDistance, sectionTime, dbType, speedLimit, descriptions, version, createBy, createDate, updateBy, updateDate);
  349 +
  350 + Line line = lineRepository.findById(sectionRouteLine).get();
  351 + Section section = sectionRepository.findById(sectionId).get();
  352 +
  353 + if(map.get("status") == null || Integer.parseInt(map.get("status").toString()) != 0) {
  354 +
  355 + LsInoutSectionRoute resultS = lsInoutSectionRouteRepository.findById(sectionRouteId).get();
  356 + int old_code = resultS.getSectionrouteCode();
  357 + // 是否修改路段序号标记
  358 + boolean type = false;
  359 + if(sectionrouteCode!=null) {
  360 + if(++sectionrouteCode == old_code) {
  361 + type = true;
  362 + }
  363 + // 默认是最前面路段
  364 + }else {
  365 + sectionrouteCode = 1;
  366 + }
  367 + if(!type)
  368 + lsInoutSectionRouteRepository.sectionUpdSectionRouteCode(lineCode, version, start, end,sectionrouteCode);
  369 + LsInoutSectionRoute route = new LsInoutSectionRoute();
  370 + route.setId(sectionRouteId);
  371 + route.setSectionrouteCode(sectionrouteCode);
  372 + route.setLineCode(lineCode);
  373 + route.setSectionCode(sectionCode);
  374 + route.setDirections(directions);
  375 + route.setVersions(version);
  376 + route.setDestroy(destroy);
  377 + route.setCreateBy(createBy);
  378 + route.setUpdateBy(updateBy);
  379 + route.setSection(section);
  380 + route.setLine(line);
  381 + route.setStart(start);
  382 + route.setEnd(end);
  383 + lsInoutSectionRouteRepository.save(route);
  384 + }
  385 + resultMap.put("status", ResponseCode.SUCCESS);
  386 + } catch (Exception e) {
  387 + resultMap.put("status", ResponseCode.ERROR);
  388 + logger.error("save erro.", e);
  389 + }
  390 + return resultMap;
  391 + }
  392 +
  393 + @Override
  394 + public Map<String, Object> destroy(Map<String, Object> map) {
  395 + Map<String, Object> resultMap = new HashMap<String, Object>();
  396 + try {
  397 + long id = Long.parseLong(map.get("id").toString());
  398 +
  399 + if(map.get("status") == null || Integer.parseInt(map.get("status").toString()) != 0) {
  400 + lsInoutSectionRouteRepository.deleteById(id);
  401 + }
  402 + resultMap.put("status", ResponseCode.SUCCESS);
  403 + } catch (Exception e) {
  404 + resultMap.put("status", ResponseCode.ERROR);
  405 + logger.error("destroy erro.", e);
  406 + }
  407 + return resultMap;
  408 + }
  409 +
  410 + @Override
  411 + @Transactional
  412 + public void pathPlaningByHistory(long schId, int versions) throws JsonProcessingException {
  413 + ScheduleRealInfo scheduleRealInfo = scheduleRealInfoRepository.findById(schId).get();
  414 + DateTimeFormatter formatter = DateTimeFormat.forPattern("yyyy-MM-ddHH:mm");
  415 + DateTime start = formatter.parseDateTime(scheduleRealInfo.getRealExecDate() + scheduleRealInfo.getFcsjActual());
  416 + DateTime end = formatter.parseDateTime(scheduleRealInfo.getRealExecDate() + scheduleRealInfo.getZdsjActual());
  417 + if (start.isAfter(end)) {
  418 + end = end.plusDays(1);
  419 + }
  420 + Map<String, Object> map = gpsService.history(new String[]{ scheduleRealInfo.getClZbh() }, start.getMillis() / 1000 - 20, end.getMillis() / 1000 + 20);
  421 + List<Map<String, Object>> list = (List<Map<String, Object>>)map.get("list");
  422 + List<Map<String, Object>> bsectionVector = new ArrayList<>();
  423 + for (Map<String, Object> m : list) {
  424 + Map<String, Object> m1 = new HashMap<>();
  425 + Float lng = (Float)m.get("lon"), lat = (Float)m.get("lat");
  426 + if (lng == 0 || lat == 0) {
  427 + continue;
  428 + }
  429 + m1.put("lng", m.get("bd_lon"));
  430 + m1.put("lat", m.get("bd_lat"));
  431 + bsectionVector.add(m1);
  432 + }
  433 + map.clear();
  434 + map.put("lineId", scheduleRealInfo.getXlBm());
  435 + map.put("lineCode", scheduleRealInfo.getXlBm());
  436 + map.put("sectionName", scheduleRealInfo.getQdzName() + "-" + scheduleRealInfo.getZdzName());
  437 + map.put("sectionCode", sectionRepository.sectionMaxId() + 1);
  438 + map.put("roadCoding", "");
  439 + map.put("dbType", "b");
  440 + map.put("sectionrouteCode", "1");
  441 + map.put("sectionTime", "");
  442 + map.put("sectionDistance", "");
  443 + map.put("speedLimit", "60");
  444 + map.put("versions", versions);
  445 + map.put("destroy", 0);
  446 + map.put("directions", 3);
  447 + map.put("descriptions", "");
  448 + map.put("start", scheduleRealInfo.getQdzCode());
  449 + map.put("end", scheduleRealInfo.getZdzCode());
  450 + map.put("bsectionVector", new ObjectMapper().writeValueAsString(bsectionVector));
  451 +
  452 + lsInoutSectionRouteRepository.destroy(scheduleRealInfo.getXlBm(), versions, scheduleRealInfo.getQdzCode(), scheduleRealInfo.getZdzCode());
  453 + sectionSave(map);
  454 + }
  455 +}
src/main/resources/logback.xml
@@ -359,6 +359,10 @@ @@ -359,6 +359,10 @@
359 <level value="INFO" /> 359 <level value="INFO" />
360 <appender-ref ref="STDOUT" /> 360 <appender-ref ref="STDOUT" />
361 </logger> 361 </logger>
  362 + <!--<logger name="org.hibernate.type.descriptor.sql.BasicBinder" additivity="true">
  363 + <level value="TRACE" />
  364 + <appender-ref ref="STDOUT" />
  365 + </logger>-->
362 366
363 <!-- 日志输出级别 --> 367 <!-- 日志输出级别 -->
364 <root level="info"> 368 <root level="info">
src/main/resources/static/pages/base/stationroute/editsection_inout.html 0 → 100644
  1 +<!-- 编辑路段 -->
  2 +<div class="modal fade" id="edit_section_mobal" role="basic" aria-hidden="true">
  3 + <div class="modal-dialog">
  4 + <div class="modal-content">
  5 + <div class="modal-header">
  6 + <button type="button" class="close" data-dismiss="modal" aria-hidden="true"></button>
  7 + <h4 class="modal-title">路段修改</h4>
  8 + </div>
  9 + <div class="modal-body">
  10 + <form class="form-horizontal" role="form" id="edit_section_form" action="/module" method="post">
  11 + <div class="alert alert-danger display-hide"> <button class="close" data-close="alert"></button>
  12 + 您的输入有误,请检查下面的输入项
  13 + </div>
  14 + <!-- 线路ID -->
  15 + <input type="hidden" name="sectionId" id="section.id">
  16 + <input type="hidden" name="sectionRouteId" id="id">
  17 + <input type="hidden" name="sectionCode" id="section.sectionCode">
  18 + <input type="hidden" name="sectionRouteLine" id="lineId">
  19 + <input type="hidden" name="lineCode" id="lineCode">
  20 + <input type="hidden" name="bsectionVector" id="bsectionVector" />
  21 + <input type="hidden" name="csectionVector" id="csectionVector" value=""/>
  22 + <input type="hidden" name="dbType" id="dbType" value="b"/>
  23 + <input type="hidden" name="directions" id="dir">
  24 + <input type="hidden" name="speedLimit" id="speedLimit" >
  25 + <input type="hidden" name="roadCoding" id="roadCoding"/>
  26 + <input type="hidden" name="versions" id="versions"/>
  27 + <input type="hidden" name="start" id="start"/>
  28 + <input type="hidden" name="end" id="end"/>
  29 + <!-- 路段名称 -->
  30 + <div class="form-body">
  31 + <div class="form-group">
  32 + <label class="control-label col-md-3">
  33 + <span class="required"> * </span> 路段名称:
  34 + </label>
  35 + <div class="col-md-6">
  36 + <input type="text" class="form-control" name="sectionName" id="sectionName" placeholder="路段名称">
  37 + </div>
  38 + </div>
  39 + </div>
  40 + <!-- 路段序号 -->
  41 + <div class="form-body">
  42 + <div class="form-group">
  43 + <label class="control-label col-md-3">
  44 + 上一路段:
  45 + </label>
  46 + <div class="col-md-6">
  47 + <select name="sectionrouteCode" class="form-control" id="sectionrouteCode" style="width:100%"></select>
  48 + <span class="help-block">说明:选择的路段将作为本站序号的参考,成为选择路段的下一个路段。 </span>
  49 + </div>
  50 + </div>
  51 + </div>
  52 + </form>
  53 + </div>
  54 + <div class="modal-footer">
  55 + <button type="button" class="btn btn-primary" id="editSectionButton">提交数据</button>
  56 + <button type="button" class="btn default" data-dismiss="modal">取消</button>
  57 + </div>
  58 + </div>
  59 + </div>
  60 +</div>
  61 +<script type="text/javascript">
  62 +debugger;
  63 +$('#edit_section_mobal').on('editSectionMobal_show', function(e, map_,ajaxd,p,fun){
  64 + function setSectionFormValue(section) {
  65 + $('#edit_section_form input').each(function() {
  66 + $(this).val(eval('section.' + this.id));
  67 + });
  68 + }
  69 + let section = p.data;
  70 + let lineId = section.lineCode, version = section.versions, start = section.start, end = section.end;
  71 + setSectionFormValue(section);
  72 + // 获取路段号元素,并添加下拉属性值
  73 + ajaxd.getRouteByStartEnd(lineId,version,start, end,function(result) {
  74 + let routes = result.data.routes,paramsD =new Array();
  75 + var eq_scetionRouteCode = section.sectionrouteCode;
  76 + paramsD.push({'id':'请选择...','text':'将此路段设置位第一个路段'});
  77 + // 遍历
  78 + $.each(routes, function(i, g){
  79 + // 判断.
  80 + if(g.section.sectionName) {
  81 + let ptions_v = g.sectionrouteCode;
  82 + if(eq_scetionRouteCode != ptions_v) {
  83 + // 添加拼音检索下拉框格式数据数组.
  84 + paramsD.push({'id':ptions_v,
  85 + 'text':g.section.sectionName + '(' + ptions_v + ')'});
  86 + }
  87 + }
  88 + });
  89 + // 初始化上一个路段拼音检索下拉框.
  90 + initPinYinSelect2($('#sectionrouteCode'),paramsD,function(selector) {
  91 + if(paramsD.length > 0) {
  92 + var upStationRouteCode = paramsD[paramsD.length - 1].sectionrouteCode;
  93 + $('#sectionrouteCode').select2('val',upStationRouteCode);
  94 + }else {
  95 + $('#sectionrouteCode').select2('val','请选择...');
  96 + }
  97 + });
  98 + });
  99 + // 显示mobal
  100 + $('#edit_section_mobal').modal({show : true,backdrop: 'static',keyboard: false});//
  101 + // 当调用 hide 实例方法时触发
  102 + $('#edit_section_mobal').on('hide.bs.modal', function () {
  103 + closeMobleSetClean();
  104 + });
  105 + function closeMobleSetClean() {
  106 + // 清除地图覆盖物
  107 + map_.clearMarkAndOverlays();
  108 + $('#inoutSearch').click();
  109 + fun.editAChangeCssRemoveDisabled();
  110 + //ajaxd.getSectionRouteInfo(lineId,dir,$("#versions").val(),function(data) {
  111 + // fun.linePanlThree(lineId,data,dir);
  112 + //});
  113 + setTimeout(function () {
  114 + map_.openSectionInfoWin_inout(p);
  115 + },1000);
  116 + }
  117 + // 编辑表单元素
  118 + var form = $('#edit_section_form');
  119 + // 获取错误提示元素
  120 + var error = $('.alert-danger', form);
  121 + // 提交数据按钮事件
  122 + $('#editSectionButton').on('click', function() {
  123 + // 表单提交
  124 + form.submit();
  125 + });
  126 + // 表单验证
  127 + form.validate({
  128 + errorElement : 'span',
  129 + errorClass : 'help-block help-block-error',
  130 + focusInvalid : false,
  131 + rules : {
  132 + 'sectionName' : {required : true,maxlength:50}
  133 + },
  134 + invalidHandler : function(event, validator) {
  135 + error.show();
  136 + App.scrollTo(error, -200);
  137 + },
  138 + highlight : function(element) {
  139 + $(element).closest('.form-group').addClass('has-error');
  140 + },
  141 + unhighlight : function(element) {
  142 + $(element).closest('.form-group').removeClass('has-error');
  143 + },
  144 + success : function(label) {
  145 + label.closest('.form-group').removeClass('has-error');
  146 + },
  147 + submitHandler : function(f) {
  148 + // 获取折线坐标集合
  149 + var editPloyLineArray = p.getPath();
  150 + // 折线坐标集合
  151 + $('#bsectionVector').val(JSON.stringify(editPloyLineArray));
  152 + var params = form.serializeJSON();
  153 + params.destroy=0;
  154 + params.sectionDistance=0;
  155 + params.sectionTime=0;
  156 + params.status=$($("#versions").find("option:selected")[0]).attr("status");
  157 + error.hide();
  158 + debugger
  159 + if(params.sectionrouteCode=='请选择...')
  160 + params.sectionrouteCode='';
  161 + ajaxd.inoutSectionUpdate(params,function(resuntDate) {
  162 + if(resuntDate.status=='SUCCESS') {
  163 + // 弹出添加成功提示消息
  164 + layer.msg('修改成功...');
  165 + }else {
  166 + // 弹出添加失败提示消息
  167 + layer.msg('修改失败...');
  168 + }
  169 + $('#edit_section_mobal').modal('hide');
  170 + var dir = params.directions
  171 + closeMobleSetClean();
  172 + });
  173 + }
  174 + });
  175 +});
  176 +</script>
0 \ No newline at end of file 177 \ No newline at end of file
src/main/resources/static/pages/base/stationroute/js/stationroute-ajax-getdata.js
@@ -196,6 +196,41 @@ var GetAjaxData = function(){ @@ -196,6 +196,41 @@ var GetAjaxData = function(){
196 196
197 }); 197 });
198 198
  199 + },
  200 +
  201 + // 编辑线路走向保存
  202 + inoutSectionUpdate:function(section,callback) {
  203 + $post('/inout/sectionUpdate',section,function(data) {
  204 + callback && callback(data);
  205 + })
  206 + },
  207 +
  208 + // 生成线路走向
  209 + inoutSectionSave:function(section,callback){
  210 + $post('/inout/sectionSave',section,function(data) {
  211 + callback && callback(data);
  212 + })
  213 + },
  214 +
  215 + // 根据线路查找进出场的起终点信息
  216 + getStartEndByLine: function (lineId, version, cb) {
  217 + $get('/inout/getStartEndByLine', {lineId : lineId, version : version}, function (r) {
  218 + return cb && cb(r);
  219 + });
  220 + },
  221 +
  222 + // 根据起终点查找对应的路段信息
  223 + getRouteByStartEnd: function (lineId, version, start, end, cb) {
  224 + $get('/inout/getRouteByStartEnd', {lineId : lineId, version : version, start : start, end : end}, function (r) {
  225 + return cb && cb(r);
  226 + });
  227 + },
  228 +
  229 + // 根据ID查询路段信息.
  230 + getRouteInfoById : function(sectionRouteId,callback){
  231 + $get('/inout/' + sectionRouteId,{},function(r) {
  232 + return callback && callback(r);
  233 + });
199 } 234 }
200 }; 235 };
201 return ajaxData; 236 return ajaxData;
src/main/resources/static/pages/base/stationroute/js/stationroute-list-events.js
1 -$(function(){  
2 -  
3 - // 上行方向(0:上行;1:下行)  
4 - var directionUpValue = $('#stationUp').data('direction');  
5 -  
6 - // 下行方向 (0:上行;1:下行)  
7 - var directionDownValue = $('.downSystem').data('direction');  
8 -  
9 -  
10 -  
11 - // 系统规划上行站点点击事件  
12 - $('.upSystem').on('click',function() {  
13 - // 隐藏上行规划  
14 - $('#upToolsMobal').hide();  
15 - // 弹出正在加载层  
16 - var i = layer.load(0,{offset:['200px', '280px']});  
17 - /** 修正线路名称 @param:<directionUpValue:方向(上行)> */  
18 - PublicFunctions.lineNameIsHaveInterval(directionUpValue);  
19 -  
20 - });  
21 -  
22 - // 上行站点其它规划点击事件  
23 - $('.upManual').on('click',function() {  
24 - // 加载模板手动添加站点页面  
25 - $.get('addstationstemplate.html', function(m){  
26 - $(pjaxContainer).append(m);  
27 - $('#add_station_template_mobal').trigger('AddStationTempMobal.show', [WorldsBMap,GetAjaxData,directionUpValue,LineObj,PublicFunctions]);  
28 - });  
29 - /*// 加载其它规划选择弹出层mobal页面  
30 - $.get('add_manual_select.html', function(m){  
31 - $(pjaxContainer).append(m);  
32 - $('#add_manual_mobal').trigger('AddManualMobal.show', [WorldsBMap,GetAjaxData,directionUpValue,LineObj,PublicFunctions]);  
33 - });*/  
34 -  
35 - });  
36 - $('.gpsRoute').on('click',function() {  
37 - var Line = LineObj.getLineObj();  
38 - // 加载其它规划选择弹出层mobal页面  
39 - $.get('editRoute.html', function(m){  
40 - $(pjaxContainer).append(m);  
41 - $('#edit_route_mobal').trigger('editRouteMobal.show', [WorldsBMap,GetAjaxData,Line,PublicFunctions]);  
42 - });  
43 - });  
44 -  
45 - // 上行站点新增事件  
46 - $('.module_tools #addUpStation').on('click', function() {  
47 - /** 设置新增站点对象方向属性值 @param:<directionUpValue:方向(0:上行;1:下行)> */  
48 - AddStationObj.setAddStationDiraction(directionUpValue);  
49 - // 加载选择新增方式mobal  
50 - $.get('add_select.html', function(m){  
51 - $(pjaxContainer).append(m);  
52 - $('#add_select_mobal').trigger('AddSelectMobal.show', [WorldsBMap,DrawingManagerObj,GetAjaxData,AddStationObj,LineObj,PublicFunctions]);  
53 - });  
54 - });  
55 -  
56 - // 修改上行站点mobal页面  
57 - $('.module_tools #editUpStation').on('click', function(){  
58 - var sel = PublicFunctions.getCurrSelNode(directionUpValue);  
59 - if(sel.length==0 || sel[0].original.chaildredType !='station'){  
60 - layer.msg('请先选择要编辑的上行站点!');  
61 - return;  
62 - }  
63 - $.get('edit_select.html', function(m){  
64 - $(pjaxContainer).append(m);  
65 - $('#edit_select_mobal').trigger('editSelectMobal_show', [WorldsBMap,DrawingManagerObj,GetAjaxData,EditStationObj,LineObj,PublicFunctions,directionUpValue]);  
66 - });  
67 - });  
68 -  
69 - // 撤销上行站点  
70 - $('.module_tools #deleteUpStation').on('click', function() {  
71 - PublicFunctions.stationRevoke(directionUpValue);  
72 - });  
73 -  
74 - // 上行批量撤销事件  
75 - $('.module_tools #batchUpDelete').on('click', function() {  
76 - var Line = LineObj.getLineObj();  
77 - /** 设置批量删除的线路方向 @param:<directionUpValue:方向(0:上行;1:下行)> */  
78 - DeleteBatchObj.setDeteleBatchDiraction(directionUpValue);  
79 - // 加载选择新增方式mobal  
80 - $.get('delete_select.html', function(m){  
81 - $(pjaxContainer).append(m);  
82 - $('#delete_select_mobal').trigger('deleteSelectMobal.show',[GetAjaxData,Line,PublicFunctions,DeleteBatchObj]);  
83 - });  
84 - });  
85 -  
86 - // 切换上下行.  
87 - $('.retweet').on('click',function() {  
88 - layer.confirm('您是否确定将【上、下】行站点和路段进行对换!', {  
89 - btn : [ '确认提示并提交', '取消' ]  
90 - },function () {  
91 - // 关闭所有提示弹出层.  
92 - layer.closeAll();  
93 - // 弹出提示层.  
94 - var index = layer.load(1, {  
95 - shade: [0.1,'#fff'] // 透明度的白色背景  
96 - });  
97 - var Line = LineObj.getLineObj();  
98 - $post('/stationroute/updSwitchDir?lineIds='+ Line.id + "&status=" + $($("#versions").find("option:selected")[0]).attr("status") ,null,function(data) {  
99 - layer.close(index);  
100 - if(data.status=='SUCCESS') {  
101 - // 弹出操作成功提示消息  
102 - layer.msg('操作成功...');  
103 - }else {  
104 - // 弹出操作失败提示消息  
105 - layer.msg('操作成功...');  
106 - }  
107 - WorldsBMap.clearMarkAndOverlays();  
108 - $('#stationDown').removeClass('active');  
109 - $('#stationDown').removeClass('in');  
110 - $('#stationDown').addClass('fade');  
111 - $('#stationUp').addClass('active in');  
112 - $('#downLine').parent().removeClass('active');  
113 - $('#upLine').parent().addClass('active');  
114 - // 刷新左边树  
115 - PublicFunctions.resjtreeDate(Line.id,0,$("#versions").val());  
116 - /** 查询上行路段信息 @param:<Line.id:线路Id;0:上行> @return:data:路段数据 */  
117 -// GetAjaxData.getSectionRouteInfo(Line.id,0,function(data) {  
118 -// /** 在地图上画出线路走向 @param:<Line.id:线路Id;0:上行;data:路段数据> */  
119 -// PublicFunctions.linePanlThree(Line.id,data,0);  
120 -// });  
121 - });  
122 - });  
123 - });  
124 -  
125 - $('#wrenchUpDis').on('click',function() {  
126 - var Line = LineObj.getLineObj();  
127 - GetAjaxData.getStation(Line.id,directionUpValue,$("#versions").val(),function(rd) {  
128 - // 加载其它规划选择弹出层mobal页面  
129 - $.get('tzzj.html', function(m){  
130 - $(pjaxContainer).append(m);  
131 - $('#tzzj_mobal').trigger('tzzjMobal.show', [WorldsBMap,GetAjaxData,0,Line.id,PublicFunctions,rd[0].children[0].children]);  
132 - });  
133 - });  
134 - })  
135 -  
136 - $('#wrenchDownDis').on('click',function() {  
137 - var Line = LineObj.getLineObj();  
138 - GetAjaxData.getStation(Line.id,directionDownValue,$("#versions").val(),function(rd) {  
139 - // 加载其它规划选择弹出层mobal页面  
140 - $.get('tzzj.html', function(m){  
141 - $(pjaxContainer).append(m);  
142 - $('#tzzj_mobal').trigger('tzzjMobal.show', [WorldsBMap,GetAjaxData,1,Line.id,PublicFunctions,rd[0].children[0].children]);  
143 - });  
144 - });  
145 - });  
146 -  
147 - $('#quoteDown').on('click',function() {  
148 - // 弹出提示层.  
149 - var index = layer.load(1, {  
150 - shade: [0.1,'#fff'] // 透明度的白色背景  
151 - });  
152 - var Line = LineObj.getLineObj();  
153 - var params = {'lineId':Line.id ,'dir':1,'toDir':0,status:$($("#versions").find("option:selected")[0]).attr("status")} ;  
154 - quote(params,index);  
155 - });  
156 -  
157 - $('#quoteUp').on('click',function() {  
158 - // 弹出提示层.  
159 - var index = layer.load(1, {  
160 - shade: [0.1,'#fff'] // 透明度的白色背景  
161 - });  
162 - var Line = LineObj.getLineObj();  
163 - console.log($($("#versions").find("option:selected")[0]).attr("status"));  
164 - var params = {'lineId':Line.id ,'dir':0,'toDir':1,status:$($("#versions").find("option:selected")[0]).attr("status")};  
165 - quote(params,index);  
166 - });  
167 -  
168 - $('#batchUpdateIndustryCode').on('click',function() {  
169 - var Line = LineObj.getLineObj();  
170 - // 加载其它规划选择弹出层mobal页面  
171 - $.get('batch_update_industryCode.html', function(m){  
172 - $(pjaxContainer).append(m);  
173 - $('#batch_update_industryCode_mobal').trigger('batch_update_industryCodeMobal.show', [WorldsBMap,GetAjaxData,0,Line.id,PublicFunctions]);  
174 - });  
175 - });  
176 - $('#batchDowndateIndustryCode').on('click',function() {  
177 - var Line = LineObj.getLineObj();  
178 - // 加载其它规划选择弹出层mobal页面  
179 - $.get('batch_update_industryCode.html', function(m){  
180 - $(pjaxContainer).append(m);  
181 - $('#batch_update_industryCode_mobal').trigger('batch_update_industryCodeMobal.show', [WorldsBMap,GetAjaxData,1,Line.id,PublicFunctions]);  
182 - });  
183 - });  
184 -  
185 - function quote(params,index) {  
186 - $post('/sectionroute/quoteSection',params,function(data) {  
187 - layer.close(index);  
188 - if(data.status=='SUCCESS') {  
189 - // 弹出操作成功提示消息  
190 - layer.msg('操作成功...');  
191 - }else {  
192 - // 弹出操作失败提示消息  
193 - layer.msg('操作成功...');  
194 - }  
195 - WorldsBMap.clearMarkAndOverlays();  
196 -  
197 - var dir = params.dir;  
198 - if(dir == 0){  
199 - dir = 1;  
200 - }else{  
201 - dir = 0;  
202 - }  
203 - // 刷新左边树  
204 - PublicFunctions.resjtreeDate(params.lineId,dir,$("#versions").val());  
205 - /** 查询上行路段信息 @param:<Line.id:线路Id;0:上行> @return:data:路段数据 */  
206 -// GetAjaxData.getSectionRouteInfo(params.lineId,params.dir,function(data) {  
207 -// /** 在地图上画出线路走向 @param:<Line.id:线路Id;0:上行;data:路段数据> */  
208 -// PublicFunctions.linePanlThree(params.lineId,data,params.dir);  
209 -// });  
210 - });  
211 - }  
212 - // 编辑线路上行走向  
213 - $('.module_tools #editUplineTrend').on('click', function() {PublicFunctions.editLinePlan(directionUpValue);});  
214 -  
215 - // 线路上行  
216 - $('#leftUpOrDown #upLine').on('click', function(){  
217 - var lineIdEvents = LineObj.getLineObj();  
218 -  
219 - var val = $("#versions").val();  
220 -  
221 - /** 初始化上行树 @param:<Line.id:线路Id;0:上行> */  
222 - PublicFunctions.resjtreeDate(lineIdEvents.id,'0',val);  
223 -  
224 - });  
225 -  
226 - // 系统规划下行站点  
227 - $('.downSystem').on('click',function() {  
228 - // 隐藏下行规划  
229 - $('#downToolsMobal').hide();  
230 - // 弹出正在加载层  
231 - var i = layer.load(0,{offset:['200px', '280px']});  
232 - /** 修正线路名称 @param:<directionUpValue:方向(上行)> */  
233 - PublicFunctions.lineNameIsHaveInterval(directionDownValue);  
234 - });  
235 -  
236 - // 下行站点其它规划点击事件  
237 - $('.downManual').on('click',function() {  
238 - // 加载模板手动添加站点页面  
239 - $.get('addstationstemplate.html', function(m){  
240 - $(pjaxContainer).append(m);  
241 - $('#add_station_template_mobal').trigger('AddStationTempMobal.show', [WorldsBMap,GetAjaxData,directionDownValue,LineObj,PublicFunctions]);  
242 - });  
243 - /*// 加载其它规划选择弹出层mobal页面  
244 - $.get('add_manual_select.html', function(m){  
245 - $(pjaxContainer).append(m);  
246 - $('#add_manual_mobal').trigger('AddManualMobal.show', [WorldsBMap,GetAjaxData,directionDownValue,LineObj,PublicFunctions]);  
247 - });*/  
248 - });  
249 -  
250 - // 下行站点新增事件  
251 - $('.module_tools #addDownStation').on('click', function() {  
252 - /** 设置新增站点对象方向属性值 @param:<directionUpValue:方向(0:上行;1:下行)> */  
253 - AddStationObj.setAddStationDiraction(directionDownValue);  
254 - // 加载选择新增方式mobal  
255 - $.get('add_select.html', function(m){  
256 - $(pjaxContainer).append(m);  
257 - $('#add_select_mobal').trigger('AddSelectMobal.show', [WorldsBMap,DrawingManagerObj,GetAjaxData,AddStationObj,LineObj,PublicFunctions]);  
258 - });  
259 - });  
260 -  
261 - // 修改下行站点mobal页面  
262 - $('.module_tools #editDownStation').on('click', function(){  
263 - var sel = PublicFunctions.getCurrSelNode(directionDownValue);  
264 - if(sel.length==0 || sel[0].original.chaildredType !='station'){  
265 - layer.msg('请先选择要编辑的下行站点!');  
266 - return;  
267 - }  
268 - $.get('edit_select.html', function(m){  
269 - $(pjaxContainer).append(m);  
270 - $('#edit_select_mobal').trigger('editSelectMobal_show', [WorldsBMap,DrawingManagerObj,GetAjaxData,EditStationObj,LineObj,PublicFunctions,directionDownValue]);  
271 - });  
272 - });  
273 -  
274 - // 撤销下行站点  
275 - $('.module_tools #deleteDownStation').on('click', function() {  
276 - PublicFunctions.stationRevoke(directionDownValue);  
277 - });  
278 -  
279 - // 下行批量撤销事件  
280 - $('.module_tools #batchDownDelete').on('click', function() {  
281 - var Line = LineObj.getLineObj();  
282 - /** 设置批量删除的线路方向 @param:<directionDownValue:方向(0:上行;1:下行)> */  
283 - DeleteBatchObj.setDeteleBatchDiraction(directionDownValue);  
284 - // 加载选择新增方式mobal  
285 - $.get('delete_select.html', function(m){  
286 - $(pjaxContainer).append(m);  
287 - $('#delete_select_mobal').trigger('deleteSelectMobal.show',[GetAjaxData,Line,PublicFunctions,DeleteBatchObj]);  
288 - });  
289 - });  
290 -  
291 - // 编辑线路下行走向  
292 - $('.module_tools #editDownlineTrend').on('click', function() {  
293 - PublicFunctions.editLinePlan(directionDownValue);  
294 - });  
295 -  
296 - // 线路下行  
297 - $('#leftUpOrDown #downLine').on('click', function(){  
298 - var lineIdEvents = LineObj.getLineObj();  
299 -  
300 -  
301 - var val = $("#versions").val();  
302 - /** 初始化下行树 @param:<Line.id:线路Id;1:下行> */  
303 - PublicFunctions.resjtreeDate(lineIdEvents.id,'1',val);  
304 - });  
305 -  
306 - // 生成行单  
307 - $('.module_tools #createUsingSingle').on('click', function() {  
308 - var lineIdEvents = LineObj.getLineObj();  
309 - var params = {lineId:lineIdEvents.id};  
310 - GetAjaxData.createUsingSingle(params,function(data) {  
311 - if(data.status=='SUCCESS') {  
312 - // 弹出生成成功提示消息  
313 - layer.msg('生成成功...');  
314 - }else {  
315 - // 弹出生成失败提示消息  
316 - layer.msg('生成失败...');  
317 - }  
318 - });  
319 - });  
320 - $('#scrllmouseEvent').on('mousemove',function() {  
321 - $('.defeat-scroll').css('overflow','auto');  
322 - }).on('mouseleave',function() {  
323 - $('.defeat-scroll').css('overflow','hidden');  
324 - });  
325 -  
326 - $(".match_station_bnt").on("click",function () {  
327 - var index = layer.open({  
328 - title: '提示',  
329 - content:'是否匹配外部上下行站点行业编码!',  
330 - // type: 1,  
331 - // area: ['600px', '360px'],  
332 - // scrollbar: false,  
333 -  
334 - btn:['确定','取消'],  
335 - yes: function(index){  
336 - var lineId = LineObj.getLineObj().id;  
337 - GetAjaxData.matchIndustryCode(lineId,function (rs) {  
338 - // $post("/stationroute/matchIndustryCode",{"lineId":lineId},function (rs) {  
339 - if(rs.status == "SUCCESS"){  
340 - var map = new Map();  
341 - var upMatch = rs.upMatch, downMatch = rs.downMatch;  
342 - if(upMatch !=null && upMatch.length>0){  
343 - map.set("up",upMatch);  
344 - }  
345 - if(downMatch !=null && downMatch.length>0){  
346 - map.set("down",downMatch);  
347 - }  
348 - if(map.size>0){  
349 - $('.portlet-title .match_station').addClass('hidden');  
350 - PublicFunctions.resjtreeDate(lineId,0,$("#versions").val());  
351 - /** 查询上行路段信息 @param:<Line.id:线路Id;0:上行> @return:data:路段数据 */  
352 -// GetAjaxData.getSectionRouteInfo(lineId,0,function(data) {  
353 -// /** 在地图上画出线路走向 @param:<Line.id:线路Id;0:上行;data:路段数据> */  
354 -// PublicFunctions.linePanlThree(lineId,data,0);  
355 -// });  
356 - $('#stationDown').removeClass('active');  
357 - $('#stationDown').removeClass('in');  
358 - $('#stationDown').addClass('fade');  
359 - $('#stationUp').addClass('active in');  
360 - $('#downLine').parent().removeClass('active');  
361 - $('#upLine').parent().addClass('active');  
362 - $.get('match_station_industryCode.html', function(m){  
363 - $(pjaxContainer).append(m);  
364 - $('#match_station_industryCode_mobal').trigger('match_station_industryCodeMobal.show', map);  
365 - });  
366 - } else {  
367 - layer.msg("没有匹配到外部站点数据,请手动添加!")  
368 - }  
369 - } else  
370 - layer.msg("匹配出错,请手动添加!")  
371 - });  
372 - layer.close(index);  
373 - },  
374 - btn2:function(){  
375 - layer.closeAll(index); //关闭当前窗口  
376 - }  
377 - });  
378 - }) 1 +$(function(){
  2 +
  3 + // 上行方向(0:上行;1:下行)
  4 + var directionUpValue = $('#stationUp').data('direction');
  5 +
  6 + // 下行方向 (0:上行;1:下行)
  7 + var directionDownValue = $('.downSystem').data('direction');
  8 +
  9 +
  10 +
  11 + // 系统规划上行站点点击事件
  12 + $('.upSystem').on('click',function() {
  13 + // 隐藏上行规划
  14 + $('#upToolsMobal').hide();
  15 + // 弹出正在加载层
  16 + var i = layer.load(0,{offset:['200px', '280px']});
  17 + /** 修正线路名称 @param:<directionUpValue:方向(上行)> */
  18 + PublicFunctions.lineNameIsHaveInterval(directionUpValue);
  19 +
  20 + });
  21 +
  22 + // 上行站点其它规划点击事件
  23 + $('.upManual').on('click',function() {
  24 + // 加载模板手动添加站点页面
  25 + $.get('addstationstemplate.html', function(m){
  26 + $(pjaxContainer).append(m);
  27 + $('#add_station_template_mobal').trigger('AddStationTempMobal.show', [WorldsBMap,GetAjaxData,directionUpValue,LineObj,PublicFunctions]);
  28 + });
  29 + /*// 加载其它规划选择弹出层mobal页面
  30 + $.get('add_manual_select.html', function(m){
  31 + $(pjaxContainer).append(m);
  32 + $('#add_manual_mobal').trigger('AddManualMobal.show', [WorldsBMap,GetAjaxData,directionUpValue,LineObj,PublicFunctions]);
  33 + });*/
  34 +
  35 + });
  36 + $('.gpsRoute').on('click',function() {
  37 + var Line = LineObj.getLineObj();
  38 + // 加载其它规划选择弹出层mobal页面
  39 + $.get('editRoute.html', function(m){
  40 + $(pjaxContainer).append(m);
  41 + $('#edit_route_mobal').trigger('editRouteMobal.show', [WorldsBMap,GetAjaxData,Line,PublicFunctions]);
  42 + });
  43 + });
  44 +
  45 + // 上行站点新增事件
  46 + $('.module_tools #addUpStation').on('click', function() {
  47 + /** 设置新增站点对象方向属性值 @param:<directionUpValue:方向(0:上行;1:下行)> */
  48 + AddStationObj.setAddStationDiraction(directionUpValue);
  49 + // 加载选择新增方式mobal
  50 + $.get('add_select.html', function(m){
  51 + $(pjaxContainer).append(m);
  52 + $('#add_select_mobal').trigger('AddSelectMobal.show', [WorldsBMap,DrawingManagerObj,GetAjaxData,AddStationObj,LineObj,PublicFunctions]);
  53 + });
  54 + });
  55 +
  56 + // 修改上行站点mobal页面
  57 + $('.module_tools #editUpStation').on('click', function(){
  58 + var sel = PublicFunctions.getCurrSelNode(directionUpValue);
  59 + if(sel.length==0 || sel[0].original.chaildredType !='station'){
  60 + layer.msg('请先选择要编辑的上行站点!');
  61 + return;
  62 + }
  63 + $.get('edit_select.html', function(m){
  64 + $(pjaxContainer).append(m);
  65 + $('#edit_select_mobal').trigger('editSelectMobal_show', [WorldsBMap,DrawingManagerObj,GetAjaxData,EditStationObj,LineObj,PublicFunctions,directionUpValue]);
  66 + });
  67 + });
  68 +
  69 + // 撤销上行站点
  70 + $('.module_tools #deleteUpStation').on('click', function() {
  71 + PublicFunctions.stationRevoke(directionUpValue);
  72 + });
  73 +
  74 + // 上行批量撤销事件
  75 + $('.module_tools #batchUpDelete').on('click', function() {
  76 + var Line = LineObj.getLineObj();
  77 + /** 设置批量删除的线路方向 @param:<directionUpValue:方向(0:上行;1:下行)> */
  78 + DeleteBatchObj.setDeteleBatchDiraction(directionUpValue);
  79 + // 加载选择新增方式mobal
  80 + $.get('delete_select.html', function(m){
  81 + $(pjaxContainer).append(m);
  82 + $('#delete_select_mobal').trigger('deleteSelectMobal.show',[GetAjaxData,Line,PublicFunctions,DeleteBatchObj]);
  83 + });
  84 + });
  85 +
  86 + // 切换上下行.
  87 + $('.retweet').on('click',function() {
  88 + layer.confirm('您是否确定将【上、下】行站点和路段进行对换!', {
  89 + btn : [ '确认提示并提交', '取消' ]
  90 + },function () {
  91 + // 关闭所有提示弹出层.
  92 + layer.closeAll();
  93 + // 弹出提示层.
  94 + var index = layer.load(1, {
  95 + shade: [0.1,'#fff'] // 透明度的白色背景
  96 + });
  97 + var Line = LineObj.getLineObj();
  98 + $post('/stationroute/updSwitchDir?lineIds='+ Line.id + "&status=" + $($("#versions").find("option:selected")[0]).attr("status") ,null,function(data) {
  99 + layer.close(index);
  100 + if(data.status=='SUCCESS') {
  101 + // 弹出操作成功提示消息
  102 + layer.msg('操作成功...');
  103 + }else {
  104 + // 弹出操作失败提示消息
  105 + layer.msg('操作成功...');
  106 + }
  107 + WorldsBMap.clearMarkAndOverlays();
  108 + $('#stationDown').removeClass('active');
  109 + $('#stationDown').removeClass('in');
  110 + $('#stationDown').addClass('fade');
  111 + $('#stationUp').addClass('active in');
  112 + $('#downLine').parent().removeClass('active');
  113 + $('#upLine').parent().addClass('active');
  114 + // 刷新左边树
  115 + PublicFunctions.resjtreeDate(Line.id,0,$("#versions").val());
  116 + /** 查询上行路段信息 @param:<Line.id:线路Id;0:上行> @return:data:路段数据 */
  117 +// GetAjaxData.getSectionRouteInfo(Line.id,0,function(data) {
  118 +// /** 在地图上画出线路走向 @param:<Line.id:线路Id;0:上行;data:路段数据> */
  119 +// PublicFunctions.linePanlThree(Line.id,data,0);
  120 +// });
  121 + });
  122 + });
  123 + });
  124 +
  125 + $('#wrenchUpDis').on('click',function() {
  126 + var Line = LineObj.getLineObj();
  127 + GetAjaxData.getStation(Line.id,directionUpValue,$("#versions").val(),function(rd) {
  128 + // 加载其它规划选择弹出层mobal页面
  129 + $.get('tzzj.html', function(m){
  130 + $(pjaxContainer).append(m);
  131 + $('#tzzj_mobal').trigger('tzzjMobal.show', [WorldsBMap,GetAjaxData,0,Line.id,PublicFunctions,rd[0].children[0].children]);
  132 + });
  133 + });
  134 + })
  135 +
  136 + $('#wrenchDownDis').on('click',function() {
  137 + var Line = LineObj.getLineObj();
  138 + GetAjaxData.getStation(Line.id,directionDownValue,$("#versions").val(),function(rd) {
  139 + // 加载其它规划选择弹出层mobal页面
  140 + $.get('tzzj.html', function(m){
  141 + $(pjaxContainer).append(m);
  142 + $('#tzzj_mobal').trigger('tzzjMobal.show', [WorldsBMap,GetAjaxData,1,Line.id,PublicFunctions,rd[0].children[0].children]);
  143 + });
  144 + });
  145 + });
  146 +
  147 + $('#quoteDown').on('click',function() {
  148 + // 弹出提示层.
  149 + var index = layer.load(1, {
  150 + shade: [0.1,'#fff'] // 透明度的白色背景
  151 + });
  152 + var Line = LineObj.getLineObj();
  153 + var params = {'lineId':Line.id ,'dir':1,'toDir':0,status:$($("#versions").find("option:selected")[0]).attr("status")} ;
  154 + quote(params,index);
  155 + });
  156 +
  157 + $('#quoteUp').on('click',function() {
  158 + // 弹出提示层.
  159 + var index = layer.load(1, {
  160 + shade: [0.1,'#fff'] // 透明度的白色背景
  161 + });
  162 + var Line = LineObj.getLineObj();
  163 + console.log($($("#versions").find("option:selected")[0]).attr("status"));
  164 + var params = {'lineId':Line.id ,'dir':0,'toDir':1,status:$($("#versions").find("option:selected")[0]).attr("status")};
  165 + quote(params,index);
  166 + });
  167 +
  168 + $('#batchUpdateIndustryCode').on('click',function() {
  169 + var Line = LineObj.getLineObj();
  170 + // 加载其它规划选择弹出层mobal页面
  171 + $.get('batch_update_industryCode.html', function(m){
  172 + $(pjaxContainer).append(m);
  173 + $('#batch_update_industryCode_mobal').trigger('batch_update_industryCodeMobal.show', [WorldsBMap,GetAjaxData,0,Line.id,PublicFunctions]);
  174 + });
  175 + });
  176 + $('#batchDowndateIndustryCode').on('click',function() {
  177 + var Line = LineObj.getLineObj();
  178 + // 加载其它规划选择弹出层mobal页面
  179 + $.get('batch_update_industryCode.html', function(m){
  180 + $(pjaxContainer).append(m);
  181 + $('#batch_update_industryCode_mobal').trigger('batch_update_industryCodeMobal.show', [WorldsBMap,GetAjaxData,1,Line.id,PublicFunctions]);
  182 + });
  183 + });
  184 +
  185 + function quote(params,index) {
  186 + $post('/sectionroute/quoteSection',params,function(data) {
  187 + layer.close(index);
  188 + if(data.status=='SUCCESS') {
  189 + // 弹出操作成功提示消息
  190 + layer.msg('操作成功...');
  191 + }else {
  192 + // 弹出操作失败提示消息
  193 + layer.msg('操作成功...');
  194 + }
  195 + WorldsBMap.clearMarkAndOverlays();
  196 +
  197 + var dir = params.dir;
  198 + if(dir == 0){
  199 + dir = 1;
  200 + }else{
  201 + dir = 0;
  202 + }
  203 + // 刷新左边树
  204 + PublicFunctions.resjtreeDate(params.lineId,dir,$("#versions").val());
  205 + /** 查询上行路段信息 @param:<Line.id:线路Id;0:上行> @return:data:路段数据 */
  206 +// GetAjaxData.getSectionRouteInfo(params.lineId,params.dir,function(data) {
  207 +// /** 在地图上画出线路走向 @param:<Line.id:线路Id;0:上行;data:路段数据> */
  208 +// PublicFunctions.linePanlThree(params.lineId,data,params.dir);
  209 +// });
  210 + });
  211 + }
  212 + // 编辑线路上行走向
  213 + $('.module_tools #editUplineTrend').on('click', function() {PublicFunctions.editLinePlan(directionUpValue);});
  214 +
  215 + // 线路上行
  216 + $('#leftUpOrDown #upLine').on('click', function(){
  217 + var lineIdEvents = LineObj.getLineObj();
  218 +
  219 + var val = $("#versions").val();
  220 +
  221 + /** 初始化上行树 @param:<Line.id:线路Id;0:上行> */
  222 + PublicFunctions.resjtreeDate(lineIdEvents.id,'0',val);
  223 +
  224 + });
  225 +
  226 + // 系统规划下行站点
  227 + $('.downSystem').on('click',function() {
  228 + // 隐藏下行规划
  229 + $('#downToolsMobal').hide();
  230 + // 弹出正在加载层
  231 + var i = layer.load(0,{offset:['200px', '280px']});
  232 + /** 修正线路名称 @param:<directionUpValue:方向(上行)> */
  233 + PublicFunctions.lineNameIsHaveInterval(directionDownValue);
  234 + });
  235 +
  236 + // 下行站点其它规划点击事件
  237 + $('.downManual').on('click',function() {
  238 + // 加载模板手动添加站点页面
  239 + $.get('addstationstemplate.html', function(m){
  240 + $(pjaxContainer).append(m);
  241 + $('#add_station_template_mobal').trigger('AddStationTempMobal.show', [WorldsBMap,GetAjaxData,directionDownValue,LineObj,PublicFunctions]);
  242 + });
  243 + /*// 加载其它规划选择弹出层mobal页面
  244 + $.get('add_manual_select.html', function(m){
  245 + $(pjaxContainer).append(m);
  246 + $('#add_manual_mobal').trigger('AddManualMobal.show', [WorldsBMap,GetAjaxData,directionDownValue,LineObj,PublicFunctions]);
  247 + });*/
  248 + });
  249 +
  250 + // 下行站点新增事件
  251 + $('.module_tools #addDownStation').on('click', function() {
  252 + /** 设置新增站点对象方向属性值 @param:<directionUpValue:方向(0:上行;1:下行)> */
  253 + AddStationObj.setAddStationDiraction(directionDownValue);
  254 + // 加载选择新增方式mobal
  255 + $.get('add_select.html', function(m){
  256 + $(pjaxContainer).append(m);
  257 + $('#add_select_mobal').trigger('AddSelectMobal.show', [WorldsBMap,DrawingManagerObj,GetAjaxData,AddStationObj,LineObj,PublicFunctions]);
  258 + });
  259 + });
  260 +
  261 + // 修改下行站点mobal页面
  262 + $('.module_tools #editDownStation').on('click', function(){
  263 + var sel = PublicFunctions.getCurrSelNode(directionDownValue);
  264 + if(sel.length==0 || sel[0].original.chaildredType !='station'){
  265 + layer.msg('请先选择要编辑的下行站点!');
  266 + return;
  267 + }
  268 + $.get('edit_select.html', function(m){
  269 + $(pjaxContainer).append(m);
  270 + $('#edit_select_mobal').trigger('editSelectMobal_show', [WorldsBMap,DrawingManagerObj,GetAjaxData,EditStationObj,LineObj,PublicFunctions,directionDownValue]);
  271 + });
  272 + });
  273 +
  274 + // 撤销下行站点
  275 + $('.module_tools #deleteDownStation').on('click', function() {
  276 + PublicFunctions.stationRevoke(directionDownValue);
  277 + });
  278 +
  279 + // 下行批量撤销事件
  280 + $('.module_tools #batchDownDelete').on('click', function() {
  281 + var Line = LineObj.getLineObj();
  282 + /** 设置批量删除的线路方向 @param:<directionDownValue:方向(0:上行;1:下行)> */
  283 + DeleteBatchObj.setDeteleBatchDiraction(directionDownValue);
  284 + // 加载选择新增方式mobal
  285 + $.get('delete_select.html', function(m){
  286 + $(pjaxContainer).append(m);
  287 + $('#delete_select_mobal').trigger('deleteSelectMobal.show',[GetAjaxData,Line,PublicFunctions,DeleteBatchObj]);
  288 + });
  289 + });
  290 +
  291 + // 编辑线路下行走向
  292 + $('.module_tools #editDownlineTrend').on('click', function() {
  293 + PublicFunctions.editLinePlan(directionDownValue);
  294 + });
  295 +
  296 + // 线路下行
  297 + $('#leftUpOrDown #downLine').on('click', function(){
  298 + var lineIdEvents = LineObj.getLineObj();
  299 +
  300 +
  301 + var val = $("#versions").val();
  302 + /** 初始化下行树 @param:<Line.id:线路Id;1:下行> */
  303 + PublicFunctions.resjtreeDate(lineIdEvents.id,'1',val);
  304 + });
  305 +
  306 + // 生成行单
  307 + $('.module_tools #createUsingSingle').on('click', function() {
  308 + var lineIdEvents = LineObj.getLineObj();
  309 + var params = {lineId:lineIdEvents.id};
  310 + GetAjaxData.createUsingSingle(params,function(data) {
  311 + if(data.status=='SUCCESS') {
  312 + // 弹出生成成功提示消息
  313 + layer.msg('生成成功...');
  314 + }else {
  315 + // 弹出生成失败提示消息
  316 + layer.msg('生成失败...');
  317 + }
  318 + });
  319 + });
  320 + $('#scrllmouseEvent').on('mousemove',function() {
  321 + $('.defeat-scroll').css('overflow','auto');
  322 + }).on('mouseleave',function() {
  323 + $('.defeat-scroll').css('overflow','hidden');
  324 + });
  325 +
  326 + $(".match_station_bnt").on("click",function () {
  327 + var index = layer.open({
  328 + title: '提示',
  329 + content:'是否匹配外部上下行站点行业编码!',
  330 + // type: 1,
  331 + // area: ['600px', '360px'],
  332 + // scrollbar: false,
  333 +
  334 + btn:['确定','取消'],
  335 + yes: function(index){
  336 + var lineId = LineObj.getLineObj().id;
  337 + GetAjaxData.matchIndustryCode(lineId,function (rs) {
  338 + // $post("/stationroute/matchIndustryCode",{"lineId":lineId},function (rs) {
  339 + if(rs.status == "SUCCESS"){
  340 + var map = new Map();
  341 + var upMatch = rs.upMatch, downMatch = rs.downMatch;
  342 + if(upMatch !=null && upMatch.length>0){
  343 + map.set("up",upMatch);
  344 + }
  345 + if(downMatch !=null && downMatch.length>0){
  346 + map.set("down",downMatch);
  347 + }
  348 + if(map.size>0){
  349 + $('.portlet-title .match_station').addClass('hidden');
  350 + PublicFunctions.resjtreeDate(lineId,0,$("#versions").val());
  351 + /** 查询上行路段信息 @param:<Line.id:线路Id;0:上行> @return:data:路段数据 */
  352 +// GetAjaxData.getSectionRouteInfo(lineId,0,function(data) {
  353 +// /** 在地图上画出线路走向 @param:<Line.id:线路Id;0:上行;data:路段数据> */
  354 +// PublicFunctions.linePanlThree(lineId,data,0);
  355 +// });
  356 + $('#stationDown').removeClass('active');
  357 + $('#stationDown').removeClass('in');
  358 + $('#stationDown').addClass('fade');
  359 + $('#stationUp').addClass('active in');
  360 + $('#downLine').parent().removeClass('active');
  361 + $('#upLine').parent().addClass('active');
  362 + $.get('match_station_industryCode.html', function(m){
  363 + $(pjaxContainer).append(m);
  364 + $('#match_station_industryCode_mobal').trigger('match_station_industryCodeMobal.show', map);
  365 + });
  366 + } else {
  367 + layer.msg("没有匹配到外部站点数据,请手动添加!")
  368 + }
  369 + } else
  370 + layer.msg("匹配出错,请手动添加!")
  371 + });
  372 + layer.close(index);
  373 + },
  374 + btn2:function(){
  375 + layer.closeAll(index); //关闭当前窗口
  376 + }
  377 + });
  378 + })
  379 +
  380 + // 进出场规划
  381 + $('#leftUpOrDown #inoutLine').on('click', function(){
  382 + var lineIdEvents = LineObj.getLineObj();
  383 +
  384 + var val = $("#versions").val();
  385 +
  386 + /** 初始化上行树 @param:<Line.id:线路Id;0:上行> */
  387 + PublicFunctions.resjtreeDate(lineIdEvents.id,'3',val);
  388 +
  389 + });
379 }); 390 });
380 \ No newline at end of file 391 \ No newline at end of file
src/main/resources/static/pages/base/stationroute/js/stationroute-list-function.js
@@ -25,6 +25,7 @@ @@ -25,6 +25,7 @@
25 */ 25 */
26 26
27 var PublicFunctions = function () { 27 var PublicFunctions = function () {
  28 + var mapData = {};
28 var PubFun = { 29 var PubFun = {
29 /** 初始化线路标题与ID */ 30 /** 初始化线路标题与ID */
30 setTiteText : function(lineId) { 31 setTiteText : function(lineId) {
@@ -55,12 +56,125 @@ var PublicFunctions = function () { @@ -55,12 +56,125 @@ var PublicFunctions = function () {
55 // 返回Obj 56 // 返回Obj
56 return array; 57 return array;
57 }, 58 },
  59 + startOrEndPoint: function(points, carpark) {
  60 + var harr = new Array, i = 0;
  61 + for (i = 0;i < points.length;i++) {
  62 + harr.push('<option value="', points[i].stationCode, '_station">', points[i].stationName, '</option>');
  63 + points[i].bdPoint = points[i].station.bJwpoints;
  64 + points[i].bdPoints = points[i].station.bdPolygon;
  65 + points[i].shapesType = points[i].station.shapesType;
  66 + points[i].radius = points[i].station.radius;
  67 + mapData[points[i].stationCode + '_station'] = points[i];
  68 + }
  69 + harr.push('<option value="', carpark.parkCode, '_park">', carpark.parkName, '</option>');
  70 + carpark.bdPoint = carpark.bCenterPoint;
  71 + carpark.bdPoints = carpark.bParkPoint;
  72 + carpark.stationName = carpark.parkName;
  73 + mapData[carpark.parkCode + '_park'] = carpark;
  74 +
  75 + return harr.join('');
  76 + },
58 /** @param id:线路ID ;directionData:方向 */ 77 /** @param id:线路ID ;directionData:方向 */
59 resjtreeDate : function(id,directionData,version){ 78 resjtreeDate : function(id,directionData,version){
60 79
61 if(!version){ 80 if(!version){
62 version = $("#versions").val(); 81 version = $("#versions").val();
63 } 82 }
  83 +
  84 + if (directionData == 3) {
  85 + // 隐藏上行规划
  86 + $('#upToolsMobal').hide();
  87 + // 隐藏上行树
  88 + $('#uptreeMobal').hide();
  89 + // 隐藏下行规划
  90 + $('#downToolsMobal').hide();
  91 + // 隐藏下行树
  92 + $('#DowntreeMobal').hide();
  93 + //
  94 + $('#InoutCarparktreeMobal .table-toolbar').hide();
  95 +
  96 + GetAjaxData.getStartEndByLine(id, version, function (result) {
  97 + if (result.data) {
  98 + var formHtml = template('inout-carpark-search-form');
  99 + $('.inout-search').html(formHtml);
  100 +
  101 + $('#startPoint').html(PubFun.startOrEndPoint(result.data.start, result.data.carpark));
  102 + $('#endPoint').html(PubFun.startOrEndPoint(result.data.end, result.data.carpark));
  103 + $('#startPoint').on('change', function () {
  104 + $('#InoutCarparktreeMobal .table-toolbar').hide();
  105 + });
  106 + $('#endPoint').on('change', function () {
  107 + $('#InoutCarparktreeMobal .table-toolbar').hide();
  108 + });
  109 + $('#inoutSearch').on('click', function () {
  110 + var start = $('#startPoint').val().split('_'), end = $('#endPoint').val().split('_');
  111 + if (start[1] == end[1]) {
  112 + layer.msg('进出场的站点不可能同时为站点或停车场');
  113 + return;
  114 + }
  115 +
  116 + $('#InoutCarparktreeMobal .table-toolbar').show();
  117 +
  118 + GetAjaxData.getRouteByStartEnd(id, version, start[0], end[0], (result1) => {
  119 + var routes = result1.data.routes, rootNode;
  120 + WorldsBMap.clearMarkAndOverlays();
  121 + var startPoint = mapData[start.join('_')], endPoint = mapData[end.join('_')], point, points;
  122 + if (startPoint.shapesType === 'r') {
  123 + point = startPoint.bdPoint.split(' ');
  124 + WorldsBMap.drawCircle({lng : point[0], lat : point[1]}, startPoint.radius, startPoint.stationName, true);
  125 + } else if (startPoint.shapesType === 'd') {
  126 + points = startPoint.bdPoints;
  127 + points = points.replace('POLYGON ((', '').replace('POLYGON((', '').replaceAll(', ', ',').replace('))', '');
  128 + points = points.split(',')
  129 + WorldsBMap.drawPolygon(points, startPoint.stationName, true);
  130 + }
  131 +
  132 + if (endPoint.shapesType === 'r') {
  133 + point = endPoint.bdPoint.split(' ');
  134 + WorldsBMap.drawCircle({lng : point[0], lat : point[1]}, endPoint.radius, endPoint.stationName, true);
  135 + } else if (endPoint.shapesType === 'd') {
  136 + points = endPoint.bdPoints;
  137 + points = points.replace('POLYGON ((', '').replace('POLYGON((', '').replaceAll(', ', ',').replace('))', '');
  138 + points = points.split(',')
  139 + WorldsBMap.drawPolygon(points, endPoint.stationName, true);
  140 + }
  141 +
  142 + rootNode = {id: -1, pId: null, name: '路段', text: '路段', icon: null, groupType: 2, container : 'pjax-container', enable : true, children: routes};
  143 + if (routes.length > 0) {
  144 + for (let i = 0,route;i < routes.length;i++) {
  145 + route = routes[i];
  146 + route.pId = 1;
  147 + route.name = route.section.sectionName;
  148 + route.text = route.section.sectionName;
  149 + route.icon = null;
  150 + route.groupType = 3;
  151 + route.chaildredType = 'section';
  152 + route.enable = true;
  153 + route.lineId = id;
  154 + route.lineCode = id;
  155 + route.versions = version;
  156 + route.dir = 3;
  157 + route.start = start[0];
  158 + route.end = end[0];
  159 + route.sectionrouteId = route.id;
  160 + route.sectionName = route.section.sectionName;
  161 + route.sectionBsectionVector = route.section.bsectionVector;
  162 + points = route.section.bsectionVector.replace('LINESTRING(', '').replace(')', '');
  163 + points = points.split(',');
  164 + WorldsBMap.drawPolyLine(points, route, start[0], end[0]);
  165 + }
  166 + } else {
  167 + rootNode.children = [{id: 0, pId: -1, name: '添加路段', text: '添加路段', lineId: id, lineCode: id, versions: version, dir: 3, start: start[0], end: end[0], icon: null, groupType: 3, container : 'pjax-container', enable : true, chaildredType: 'addSection', sectionBsectionVector: 'LINESTRING(' + startPoint.bdPoint + ')'}];
  168 + }
  169 + StationTreeData.inoutInit([rootNode]);
  170 + StationTreeData.inoutreloadeTree([rootNode]);
  171 + });
  172 + });
  173 + } else {
  174 + layer.msg(result.msg);
  175 + }
  176 + });
  177 + }
64 178
65 // 获取树数据 179 // 获取树数据
66 GetAjaxData.getStation(id,directionData,version,function(treeDateJson) { 180 GetAjaxData.getStation(id,directionData,version,function(treeDateJson) {
@@ -461,6 +575,7 @@ var PublicFunctions = function () { @@ -461,6 +575,7 @@ var PublicFunctions = function () {
461 /** 在地图上画出线路走向 @param:<Line.id:线路Id;0:上行;data:路段数据> */ 575 /** 在地图上画出线路走向 @param:<Line.id:线路Id;0:上行;data:路段数据> */
462 linePanlThree : function(lineId,data,direction,version,callback) { 576 linePanlThree : function(lineId,data,direction,version,callback) {
463 /** 获取站点路由信息 @param:<Line.id:线路Id;0:上行> @return:<resultdata:站点路由数据> */ 577 /** 获取站点路由信息 @param:<Line.id:线路Id;0:上行> @return:<resultdata:站点路由数据> */
  578 + debugger
464 var polyline_center; 579 var polyline_center;
465 GetAjaxData.getStationRoutePoint(lineId,direction,version,function(resultdata) { 580 GetAjaxData.getStationRoutePoint(lineId,direction,version,function(resultdata) {
466 WorldsBMap.clearMarkAndOverlays(); 581 WorldsBMap.clearMarkAndOverlays();
@@ -536,6 +651,7 @@ var PublicFunctions = function () { @@ -536,6 +651,7 @@ var PublicFunctions = function () {
536 }, 651 },
537 // 地图处于编辑状态 652 // 地图处于编辑状态
538 editMapStatus : function (dir) { 653 editMapStatus : function (dir) {
  654 + debugger
539 WorldsBMap.setMap_status(1); 655 WorldsBMap.setMap_status(1);
540 // 有方向就显示退出编辑模式按钮 656 // 有方向就显示退出编辑模式按钮
541 if(dir!=null && dir!='null'){ 657 if(dir!=null && dir!='null'){
src/main/resources/static/pages/base/stationroute/js/stationroute-list-map.js
@@ -31,6 +31,8 @@ window.WorldsBMap = function () { @@ -31,6 +31,8 @@ window.WorldsBMap = function () {
31 sectionArray = [], stationArray = new Map(), 31 sectionArray = [], stationArray = new Map(),
32 map_status = 0,drawingManager,topOverlay; 32 map_status = 0,drawingManager,topOverlay;
33 33
  34 + let currentSection = {};
  35 +
34 /** 36 /**
35 * 编辑缓冲区 37 * 编辑缓冲区
36 * stationMarkers: 站点图标集合 38 * stationMarkers: 站点图标集合
@@ -533,7 +535,7 @@ window.WorldsBMap = function () { @@ -533,7 +535,7 @@ window.WorldsBMap = function () {
533 }, 535 },
534 536
535 /** 在地图上画点 @param:<point_center:中心坐标点> */ 537 /** 在地图上画点 @param:<point_center:中心坐标点> */
536 - drawingUpStationPoint: function (station, s) { 538 + drawingUpStationPoint: function (station, s, isView) {
537 // 中心点坐标字符串 539 // 中心点坐标字符串
538 var bJwpointsStr = station.stationJwpoints; 540 var bJwpointsStr = station.stationJwpoints;
539 var stationName = station.stationRouteName; 541 var stationName = station.stationRouteName;
@@ -558,7 +560,7 @@ window.WorldsBMap = function () { @@ -558,7 +560,7 @@ window.WorldsBMap = function () {
558 myRichMarker1.ct_source = '1'; 560 myRichMarker1.ct_source = '1';
559 mapBValue.addOverlay(myRichMarker1); 561 mapBValue.addOverlay(myRichMarker1);
560 myRichMarker1.addEventListener('click', function () { 562 myRichMarker1.addEventListener('click', function () {
561 - if(map_status != 1) 563 + if(map_status != 1 && !isView)
562 WorldsBMap.openStationInfoWin(station); 564 WorldsBMap.openStationInfoWin(station);
563 }); 565 });
564 stationArray[station.stationRouteId] = station; 566 stationArray[station.stationRouteId] = station;
@@ -922,8 +924,15 @@ window.WorldsBMap = function () { @@ -922,8 +924,15 @@ window.WorldsBMap = function () {
922 focusSection: function(sectionRoudId) { 924 focusSection: function(sectionRoudId) {
923 for (var i = 0, p; p = sectionArray[i++];) { 925 for (var i = 0, p; p = sectionArray[i++];) {
924 if (p.data.sectionrouteId == sectionRoudId) { 926 if (p.data.sectionrouteId == sectionRoudId) {
925 - WorldsBMap.openSectionInfoWin(p);  
926 - break; 927 + switch (p.data.dir) {
  928 + case 3:
  929 + WorldsBMap.openSectionInfoWin_inout(p);
  930 + break;
  931 + default:
  932 + WorldsBMap.openSectionInfoWin(p);
  933 + break;
  934 + }
  935 +
927 } 936 }
928 } 937 }
929 }, 938 },
@@ -1026,23 +1035,44 @@ window.WorldsBMap = function () { @@ -1026,23 +1035,44 @@ window.WorldsBMap = function () {
1026 params.destroy = 0; 1035 params.destroy = 0;
1027 params.directions = dir; 1036 params.directions = dir;
1028 params.descriptions = ''; 1037 params.descriptions = '';
  1038 + params.start = stecion.start;
  1039 + params.end = stecion.end;
1029 1040
1030 params.status=$($("#versions").find("option:selected")[0]).attr("status"); 1041 params.status=$($("#versions").find("option:selected")[0]).attr("status");
1031 - GetAjaxData.sectionSave(params, function (result) {  
1032 - if(result.status =="SUCCESS"){  
1033 - $('.main_left_panel_m_layer').hide();  
1034 - $(btn).parents('.buffer_edit_body').parent().remove();  
1035 - PublicFunctions.editMapStatusRemove();  
1036 - PublicFunctions.resjtreeDate(lineId,dir,$("#versions").val());  
1037 - PublicFunctions.editAChangeCssRemoveDisabled(); 1042 + if (dir == 3) {
  1043 + GetAjaxData.inoutSectionSave(params, function (result) {
  1044 + if(result.status =="SUCCESS"){
  1045 + $('.main_left_panel_m_layer').hide();
  1046 + $(btn).parents('.buffer_edit_body').parent().remove();
  1047 + PublicFunctions.editMapStatusRemove();
  1048 + //PublicFunctions.resjtreeDate(lineId,dir,$("#versions").val());
  1049 + $('#inoutSearch').click();
  1050 + PublicFunctions.editAChangeCssRemoveDisabled();
1038 // GetAjaxData.getSectionRouteInfo(lineId,dir,function(data) { 1051 // GetAjaxData.getSectionRouteInfo(lineId,dir,function(data) {
1039 // PublicFunctions.linePanlThree(lineId,data,dir); 1052 // PublicFunctions.linePanlThree(lineId,data,dir);
1040 // }); 1053 // });
1041 - layer.msg("添加成功!");  
1042 - } else if(result.status =="ERROR") {  
1043 - layer.msg("添加失败!");  
1044 - }  
1045 - }); 1054 + layer.msg("添加成功!");
  1055 + } else if(result.status =="ERROR") {
  1056 + layer.msg("添加失败!");
  1057 + }
  1058 + });
  1059 + } else {
  1060 + GetAjaxData.sectionSave(params, function (result) {
  1061 + if(result.status =="SUCCESS"){
  1062 + $('.main_left_panel_m_layer').hide();
  1063 + $(btn).parents('.buffer_edit_body').parent().remove();
  1064 + PublicFunctions.editMapStatusRemove();
  1065 + PublicFunctions.resjtreeDate(lineId,dir,$("#versions").val());
  1066 + PublicFunctions.editAChangeCssRemoveDisabled();
  1067 +// GetAjaxData.getSectionRouteInfo(lineId,dir,function(data) {
  1068 +// PublicFunctions.linePanlThree(lineId,data,dir);
  1069 +// });
  1070 + layer.msg("添加成功!");
  1071 + } else if(result.status =="ERROR") {
  1072 + layer.msg("添加失败!");
  1073 + }
  1074 + });
  1075 + }
1046 }); 1076 });
1047 } else if(!sectionName){ 1077 } else if(!sectionName){
1048 layer.msg('请填写路段名字!'); 1078 layer.msg('请填写路段名字!');
@@ -1322,6 +1352,7 @@ window.WorldsBMap = function () { @@ -1322,6 +1352,7 @@ window.WorldsBMap = function () {
1322 // 清楚地图覆盖物 1352 // 清楚地图覆盖物
1323 mapBValue.clearOverlays(); 1353 mapBValue.clearOverlays();
1324 mapBValue.removeOverlay(); 1354 mapBValue.removeOverlay();
  1355 + sectionArray = [];
1325 }, 1356 },
1326 clearMark: function () { 1357 clearMark: function () {
1327 // 清楚地图覆盖物 1358 // 清楚地图覆盖物
@@ -1458,6 +1489,338 @@ window.WorldsBMap = function () { @@ -1458,6 +1489,338 @@ window.WorldsBMap = function () {
1458 })(); 1489 })();
1459 1490
1460 }, 1491 },
  1492 +
  1493 + /**
  1494 + * 画圆
  1495 + * point(lng,lat) 中心点
  1496 + * radius 半径(m)
  1497 + * isMark 是否加站名
  1498 + */
  1499 + drawCircle: function (point, radius, stationName, isMark) {
  1500 + let center = new BMap.Point(point.lng, point.lat);
  1501 + let circle = new BMap.Circle(center, radius ,{strokeColor:"blue", strokeWeight:2, strokeOpacity:0.5});
  1502 + mapBValue.addOverlay(circle);
  1503 + if (isMark) {
  1504 + let html = '<div style="position: absolute; margin: 0pt; padding: 0pt; width: 160px; height: 26px; left: -3px; top: -30px; overflow: hidden;">'
  1505 + + '<img class="rm3_image" style="border:none;left:0px; top:0px; position:absolute;" src="/pages/base/stationroute/css/img/back160.png">'
  1506 + + '</div>'
  1507 + + '<label class=" BMapLabel" unselectable="on" style="position: absolute; -moz-user-select: none; display: inline; cursor: inherit; border: 0px none; padding: 2px 1px 1px; white-space: nowrap; font: 12px arial,simsun; z-index: 80; color: rgb(255, 102, 0); left: 20px; top: -30px;">' + stationName + '</label>';
  1508 +
  1509 + let myRichMarker = new BMapLib.RichMarker(html, center, {
  1510 + "title": stationName,
  1511 + "anchor": new BMap.Size(-10, 8),
  1512 + "enableDragging": true
  1513 + });
  1514 + myRichMarker.disableDragging();
  1515 + myRichMarker.ct_source = '1';
  1516 + mapBValue.addOverlay(myRichMarker);
  1517 + }
  1518 + },
  1519 +
  1520 + /**
  1521 + * 画多边形
  1522 + * points 点数组
  1523 + */
  1524 + drawPolygon: function (points, stationName, isMark) {
  1525 + let bdPoints = new Array(), i = 0, point;
  1526 + for (i = 0;i < points.length;i++) {
  1527 + point = points[i].split(' ');
  1528 + bdPoints.push(new BMap.Point(point[0], point[1]));
  1529 + }
  1530 + let polygon = new BMap.Polygon(bdPoints), center = bdPoints[0];
  1531 + mapBValue.addOverlay(polygon);
  1532 + if (isMark) {
  1533 + let html = '<div style="position: absolute; margin: 0pt; padding: 0pt; width: 160px; height: 26px; left: -3px; top: -30px; overflow: hidden;">'
  1534 + + '<img class="rm3_image" style="border:none;left:0px; top:0px; position:absolute;" src="/pages/base/stationroute/css/img/back160.png">'
  1535 + + '</div>'
  1536 + + '<label class=" BMapLabel" unselectable="on" style="position: absolute; -moz-user-select: none; display: inline; cursor: inherit; border: 0px none; padding: 2px 1px 1px; white-space: nowrap; font: 12px arial,simsun; z-index: 80; color: rgb(255, 102, 0); left: 20px; top: -30px;">' + stationName + '</label>';
  1537 +
  1538 + let myRichMarker = new BMapLib.RichMarker(html, center, {
  1539 + "title": stationName,
  1540 + "anchor": new BMap.Size(-10, 8),
  1541 + "enableDragging": true
  1542 + });
  1543 + myRichMarker.disableDragging();
  1544 + myRichMarker.ct_source = '1';
  1545 + mapBValue.addOverlay(myRichMarker);
  1546 + }
  1547 + },
  1548 +
  1549 + drawPolyLine: function (points, data, start, end) {
  1550 + debugger
  1551 + let bdPoints = new Array(), i = 0, point, polyline;
  1552 + for (i = 0;i < points.length;i++) {
  1553 + point = points[i].split(' ');
  1554 + bdPoints.push(new BMap.Point(point[0], point[1]));
  1555 + }
  1556 + // 创建线路走向
  1557 + polyline = new BMap.Polyline(bdPoints, {
  1558 + strokeColor: 'red',
  1559 + strokeWeight: 6,
  1560 + strokeOpacity: 0.7
  1561 + });
  1562 +
  1563 + polyline.data = data;
  1564 + polyline.start = start;
  1565 + polyline.end = end;
  1566 + polyline.ct_source = '1';
  1567 + // 把折线添加到地图上
  1568 + mapBValue.addOverlay(polyline);
  1569 + // 聚焦事件
  1570 + polyline.addEventListener('mousemove', function (e) {
  1571 + if (this != editPolyline)
  1572 + this.setStrokeColor("#20bd26");
  1573 + });
  1574 + // 失去焦点
  1575 + polyline.addEventListener('mouseout', function (e) {
  1576 + if (this != editPolyline && this != road_win_show_p)
  1577 + this.setStrokeColor("red");
  1578 + });
  1579 + // 添加单击事件
  1580 + polyline.addEventListener('onclick', function (e) {
  1581 + // 打开信息窗口
  1582 + if (map_status != 1)
  1583 + WorldsBMap.openSectionInfoWin_inout(this);
  1584 + });
  1585 + // 添加右击事件
  1586 + polyline.addEventListener('rightclick', function (e) {
  1587 + if (currentSection.enableEditing) {
  1588 + this.disableEditing();
  1589 + WorldsBMap.saveSection_inout(this);
  1590 + }
  1591 + });
  1592 + sectionArray.push(polyline);
  1593 + },
  1594 +
  1595 + // 打开路段信息窗口
  1596 + openSectionInfoWin_inout: function(p) {
  1597 + var section = p.data;
  1598 + var dir = section.sectionrouteDirections;
  1599 + var width = WorldsBMap.strGetLength(section.sectionName) * 10;
  1600 + // 信息窗口参数属性
  1601 + var opts = {
  1602 + // 信息窗口宽度
  1603 + width: (width < 200 ? 200 : width),
  1604 + // 信息窗口高度
  1605 + height: 150,
  1606 + //设置不允许信窗发送短息
  1607 + enableMessage: false,
  1608 + //是否开启点击地图关闭信息窗口
  1609 + enableCloseOnClick: false,
  1610 + // 是否开启信息窗口打开时地图自动移动(默认开启)。(自 1.1 新增)
  1611 + enableAutoPan: false
  1612 + };
  1613 + var htm = '<span style="color: #ff8355;font-size: 18px;">' + section.sectionName + '</span>' +
  1614 + '<span class="help-block" >路段编码:' + section.sectionCode + '</span>' +
  1615 + '<span class="help-block" >路段序号:' + section.sectionrouteCode + '</span>' +
  1616 + '<span class="help-block" >版本号&nbsp&nbsp:' + section.versions + '</span>' +
  1617 + '<div >';
  1618 +
  1619 + if($($("#versions").find("option:selected")[0]).attr("status") > 0){
  1620 + htm += '<button class="info_win_btn" id="editStation" onclick="WorldsBMap.editSection_inout(' + section.sectionrouteId +','+dir+ ')">修改</button>' +
  1621 + '<button class="info_win_btn" id="addBetweenStationRoad" onclick="WorldsBMap.destroySection_inout('+ section.sectionrouteId + ','+section.sectionrouteLine+','+section.sectionrouteDirections+')">撤销</button>' +
  1622 + '<button class="info_win_btn" id="addSectionAfter" onclick="WorldsBMap.addSectionAfter_inout('+section.sectionrouteId+')">添加路段(之后)</button>' +
  1623 + '</div>';
  1624 + }
  1625 +
  1626 + // 创建信息窗口
  1627 + var infoWindow_target = new BMap.InfoWindow(htm, opts);
  1628 + // 切割段折线坐标字符串
  1629 + var sectionStr = section.sectionBsectionVector.substring(11, section.sectionBsectionVector.length - 1);
  1630 + // 分割折线坐标字符串
  1631 + var lineArray = sectionStr.split(',');
  1632 + var sectionArray = [];
  1633 + for (var i = 0; i < lineArray.length; i++) {
  1634 + sectionArray.push(new BMap.Point(lineArray[i].split(' ')[0], lineArray[i].split(' ')[1]));
  1635 + }
  1636 + // 计算中间点
  1637 + var index = parseInt(sectionArray.length / 2);
  1638 + var centerPoint = sectionArray[index];
  1639 + //close event
  1640 + infoWindow_target.addEventListener('close', function (e) {
  1641 + p.setStrokeColor("red");
  1642 + road_win_show_p = null;
  1643 + });
  1644 + //open event
  1645 + infoWindow_target.addEventListener('open', function (e) {
  1646 + p.setStrokeColor("#20bd26");
  1647 + road_win_show_p = p;
  1648 + });
  1649 + //开启信息窗口
  1650 + mapBValue.openInfoWindow(infoWindow_target, centerPoint);
  1651 + mapBValue.panTo(centerPoint);
  1652 + },
  1653 +
  1654 + /**
  1655 + * 进出场路段设置为编辑状态
  1656 + */
  1657 + editSection_inout: function(sectionRoudId) {
  1658 + layer.confirm('进入编辑状态', {
  1659 + btn : [ '确定','返回' ], icon: 3, title:'提示'
  1660 + }, function() {
  1661 + PublicFunctions.editMapStatus(dir);
  1662 + layer.msg('双击保存路段');
  1663 + var p;
  1664 + for (var i = 0; p = sectionArray[i++];) {
  1665 + if (p.data.sectionrouteId == sectionRoudId) {
  1666 + mapBValue.closeInfoWindow();//关闭infoWindow
  1667 + p.enableEditing();
  1668 + p.setStrokeColor('blue');
  1669 + editPolyline = p;
  1670 + break;
  1671 + }
  1672 + }
  1673 + // 路段中间点为中心
  1674 + var section = p.data;
  1675 + var sectionStr = section.sectionBsectionVector.substring(11, section.sectionBsectionVector.length - 1);
  1676 + // 分割折线坐标字符串
  1677 + var lineArray = sectionStr.split(',');
  1678 + var sectionPointArray = [];
  1679 + for (var i = 0; i < lineArray.length; i++) {
  1680 + sectionPointArray.push(new BMap.Point(lineArray[i].split(' ')[0], lineArray[i].split(' ')[1]));
  1681 + }
  1682 + // 计算中间点
  1683 + var index = parseInt(sectionPointArray.length / 2);
  1684 + var centerPoint = sectionPointArray[index];
  1685 + mapBValue.centerAndZoom(centerPoint, 17);
  1686 + // var c = p.ia[Math.floor(p.ia.length/2)];
  1687 + // mapBValue.centerAndZoom(new BMap.Point(c.lng, c.lat), 18);
  1688 + p.addEventListener('dblclick', function () {
  1689 + /** 设置修改路段集合对象为空 */
  1690 + editPolyline = '';
  1691 + PublicFunctions.editMapStatusRemove();
  1692 + $.get('editsection_inout.html', function(m){
  1693 + $('body').append(m);
  1694 + $('#edit_section_mobal').trigger('editSectionMobal_show', [WorldsBMap,GetAjaxData,p,PublicFunctions]);
  1695 + });
  1696 + });
  1697 + });
  1698 + },
  1699 +
  1700 + // 撤销路段
  1701 + destroySection_inout : function(sectionRoudId) {
  1702 + layer.confirm('你确定要撤销此路段吗?', {
  1703 + btn : [ '撤销','返回' ], icon: 3, title:'提示'
  1704 + }, function(){
  1705 + var status = $($("#versions").find("option:selected")[0]).attr("status");
  1706 + $.post('/inout/destroy',{'id': sectionRoudId,status:status},function(resuntDate) {
  1707 + if (resuntDate.status == 'SUCCESS') {
  1708 + // 弹出添加成功提示消息
  1709 + layer.msg('撤销成功!');
  1710 + } else {
  1711 + // 弹出添加失败提示消息
  1712 + layer.msg('撤销失败!');
  1713 + }
  1714 + // 刷新左边树
  1715 + $('#inoutSearch').click();
  1716 + /** 查询路段信息 @param:<Line.id:线路Id;delBatch.dir:方向> @return:data:路段数据 */
  1717 +// GetAjaxData.getSectionRouteInfo(lineId,dir,function(data) {
  1718 +// /** 在地图上画出线路走向 @param:<Line.id:线路Id;delBatch.dir:方向;data:路段数据> */
  1719 +// PublicFunctions.linePanlThree(lineId,data,dir);
  1720 +// });
  1721 + });
  1722 + });
  1723 + },
  1724 +
  1725 + // 添加在路段之后
  1726 + addSectionAfter_inout : function(sectionRoudId) {
  1727 + //order = after before;
  1728 + var beforeSection;
  1729 + // 关闭信息窗口
  1730 + mapBValue.closeInfoWindow();
  1731 + PublicFunctions.editMapStatus();
  1732 + // 把数据填充到模版中
  1733 + var addSectionHTML = template('add_draw_polyline-temp',{ 'id': sectionRoudId});
  1734 + $('body .mian-portlet-body').append(addSectionHTML);
  1735 + //暂停和开始绘制
  1736 + $('.draw_polyline_switch>a').on('click', function () {
  1737 + var t = $(this).text();
  1738 + if(t=='暂停绘制'){
  1739 + WorldsBMap.exitDrawStatus();
  1740 + $(this).text('开始绘制');
  1741 + }
  1742 + else{
  1743 + WorldsBMap.openDrawStatus();
  1744 + $(this).text('暂停绘制');
  1745 + }
  1746 + });
  1747 +
  1748 + //取消
  1749 + $('#addSectionCancelBtn').on('click', function () {
  1750 + $('.main_left_panel_m_layer').hide();
  1751 + $(this).parents('.buffer_edit_body').parent().remove();
  1752 + WorldsBMap.exitDrawStatus();
  1753 + PublicFunctions.editMapStatusRemove();
  1754 + });
  1755 + GetAjaxData.getRouteInfoById(sectionRoudId, function(data){
  1756 + beforeSection = data;
  1757 + beforeSection.sectionBsectionVector = beforeSection.section.bsectionVector;
  1758 + WorldsBMap.showAddSectionPanel(beforeSection);
  1759 + });
  1760 +
  1761 + //确定
  1762 + $('#addSectionSbmintBtn').on('click', function () {
  1763 + var btn = this;
  1764 + $('#addSectionSbmintBtn').addClass("disabled");
  1765 + var sectionName = $('#sectionNameInput').val();
  1766 + var bsectionVector = $('#bsectionVectorInput').val();
  1767 + var params = {};
  1768 + if(sectionName && bsectionVector) {
  1769 + WorldsBMap.exitDrawStatus();
  1770 + GetAjaxData.getSectionCode(function(sectionCode) {
  1771 + params.lineId = beforeSection.line.id;
  1772 + params.lineCode = beforeSection.lineCode;
  1773 + params.sectionCode = sectionCode;// 设值路段编码.
  1774 + params.sectionName = sectionName;
  1775 + params.roadCoding = '';
  1776 + params.dbType = 'b';
  1777 + params.bsectionVector = bsectionVector;
  1778 + params.sectionrouteCode = beforeSection.sectionrouteCode+"_0";
  1779 + params.sectionTime = 0;
  1780 + params.sectionDistance = 60;
  1781 + params.speedLimit = 0;
  1782 + params.versions = beforeSection.versions;
  1783 + params.destroy = 0;
  1784 + params.directions = beforeSection.directions;
  1785 + params.descriptions = '';
  1786 + params.start = beforeSection.start;
  1787 + params.end = beforeSection.end;
  1788 + params.status=$($("#versions").find("option:selected")[0]).attr("status");
  1789 +
  1790 + GetAjaxData.inoutSectionSave(params, function (result) {
  1791 + if(result.status =="SUCCESS"){
  1792 + $('.main_left_panel_m_layer').hide();
  1793 + $(btn).parents('.buffer_edit_body').parent().remove();
  1794 + PublicFunctions.editMapStatusRemove();
  1795 + $('#inoutSearch').click();
  1796 + PublicFunctions.editAChangeCssRemoveDisabled();
  1797 +// GetAjaxData.getSectionRouteInfo(lineId,dir,function(data) {
  1798 +// PublicFunctions.linePanlThree(lineId,data,dir);
  1799 +// });
  1800 + layer.msg("添加成功!");
  1801 + } else if(result.status =="ERROR") {
  1802 + layer.msg("添加失败!");
  1803 + }
  1804 + });
  1805 + });
  1806 + } else if(!sectionName){
  1807 + layer.msg('请填写路段名字!');
  1808 + } else if(!bsectionVector)
  1809 + layer.msg('请先绘制路段!');
  1810 + setTimeout(function () {
  1811 + $("#addSectionSbmintBtn").removeClass("disabled");
  1812 + },1000);
  1813 + });
  1814 + },
  1815 + /**
  1816 + * 保存进出场路段
  1817 + */
  1818 + saveSection_inout: function () {
  1819 + $.get('editsection_inout.html', function(m){
  1820 + $('body').append(m);
  1821 + $('#edit_section_mobal').trigger('editSectionMobal_show', [WorldsBMap,GetAjaxData,currentSection,PublicFunctions]);
  1822 + });
  1823 + },
1461 }; 1824 };
1462 1825
1463 return Bmap; 1826 return Bmap;
src/main/resources/static/pages/base/stationroute/js/stationroute-list-treedata.js
1 -/**  
2 - *  
3 - * 左边树Obj : StationTreeData  
4 - *  
5 - * - - - - - - 》 upInit : 初始化上行树  
6 - *  
7 - * - - - - - - 》 downInit : 初始化下行树  
8 - *  
9 - * - - - - - - 》 upreloadeTree : 刷行上行树  
10 - *  
11 - * - - - - - - 》 dwonreloadeTree : 刷行下行树  
12 - */  
13 -  
14 -var StationTreeData = function(){  
15 -  
16 - function parmasObj() {  
17 -  
18 - AddStationObj.setAddStation({});  
19 -  
20 - EditStationObj.setEitdStation({});  
21 -  
22 - EditSectionObj.setEitdSection({});  
23 -  
24 - }  
25 -  
26 - function TreeOnclickEvent(treeOjb) {  
27 - if(treeOjb==null)  
28 - return;  
29 - // 节点个数  
30 - var len = treeOjb.length;  
31 - if(len<0) {  
32 - return;  
33 - }  
34 -  
35 - // 获取数据  
36 - var stationData = treeOjb[0].original;  
37 - // 选中的节点类型  
38 - var chaildredType_ = stationData.chaildredType;  
39 -  
40 - if(chaildredType_ == "section") {  
41 - WorldsBMap.focusSection(stationData.sectionrouteId);  
42 - } else if(chaildredType_ == "station") {  
43 - WorldsBMap.openStationInfoWin(stationData);  
44 - } else if(chaildredType_ == "addSection") {  
45 - WorldsBMap.addSection(stationData);  
46 - }  
47 - }  
48 - var stationTree = {  
49 - upInit : function(treeDateJson) {  
50 - // 如果不为空  
51 - if(treeDateJson) {  
52 - // 加载树load事件  
53 - $('#station_Up_tree').on('loaded.jstree', function(e, data){  
54 - // 展开树  
55 - $.jstree.reference("#station_Up_tree").open_all();  
56 - }).jstree({  
57 - 'core' : {  
58 - 'themes' : {  
59 - 'responsive': false  
60 - },  
61 -  
62 - 'data': treeDateJson,  
63 -  
64 - 'multiple':false  
65 -  
66 - },  
67 -  
68 - 'types' : {  
69 -  
70 - "default" : {  
71 -  
72 - "icon" : false  
73 -  
74 - },  
75 -  
76 - 'enable_true' : {  
77 -  
78 - "icon" : 'fa fa-check icon-lg'  
79 -  
80 - },  
81 -  
82 - 'enable_false' : {  
83 -  
84 - 'icon' : 'fa fa-close icon-lg'  
85 -  
86 - },  
87 -  
88 - 'group':{  
89 -  
90 - 'icon' : 'fa fa-object-group icon-lg'  
91 -  
92 - }  
93 - },  
94 -  
95 - 'plugins': ['types']  
96 -  
97 - // 树节点单击事件  
98 - }).bind('click.jstree', function(event) {  
99 - // 获取上行选中树节点  
100 - var treeOjb = $.jstree.reference("#station_Up_tree").get_selected(true);  
101 - TreeOnclickEvent(treeOjb);  
102 -  
103 - });  
104 - }  
105 - },  
106 - downInit : function(treeDateJson) {  
107 - // 如果不为空  
108 - if(treeDateJson) {  
109 - // 树初始化load事件  
110 - $('#station_Down_tree').on('loaded.jstree', function(e, data){  
111 - // 展开树  
112 - $.jstree.reference("#station_Down_tree").open_all();  
113 - }).jstree({  
114 - 'core' : {  
115 - 'themes' : {  
116 -  
117 - 'responsive': false  
118 -  
119 - },  
120 -  
121 - 'data': treeDateJson,  
122 -  
123 - 'multiple':false  
124 -  
125 - },  
126 -  
127 - 'types' : {  
128 -  
129 - "default" : {  
130 -  
131 - "icon" : false  
132 -  
133 - },  
134 -  
135 - 'enable_true' : {  
136 -  
137 - "icon" : 'fa fa-check icon-lg'  
138 -  
139 - },  
140 -  
141 - 'enable_false' : {  
142 -  
143 - 'icon' : 'fa fa-close icon-lg'  
144 -  
145 - },  
146 -  
147 - 'group':{  
148 -  
149 - 'icon' : 'fa fa-object-group icon-lg'  
150 -  
151 - }  
152 - },  
153 - 'plugins': ['types']  
154 - // 树节点单击事件  
155 - }).bind('click.jstree', function(event) {  
156 - // 获取下行选中树节点  
157 - var treeOjb = $.jstree.reference("#station_Down_tree").get_selected(true);  
158 - TreeOnclickEvent(treeOjb);  
159 - });  
160 - }  
161 - },  
162 - upreloadeTree : function (treeDateJson) {  
163 - // 获取上行树  
164 - var tree = $.jstree.reference('#station_Up_tree');  
165 - // 赋值数据  
166 - tree.settings.core.data = treeDateJson;  
167 - // 刷新上行树  
168 - tree.refresh();  
169 - // 展开树  
170 - setTimeout(function () {  
171 - tree.open_all();  
172 - },500);  
173 - },  
174 - dwonreloadeTree : function (treeDateJson) {  
175 - // 获取下行树  
176 - var tree = $.jstree.reference('#station_Down_tree');  
177 - // 赋值数据  
178 - tree.settings.core.data = treeDateJson;  
179 - // 刷行下行树  
180 - tree.refresh();  
181 - // 展开树  
182 - setTimeout(function () {  
183 - tree.open_all();  
184 - },500);  
185 - }  
186 - }  
187 -  
188 - return stationTree;  
189 - 1 +/**
  2 + *
  3 + * 左边树Obj : StationTreeData
  4 + *
  5 + * - - - - - - 》 upInit : 初始化上行树
  6 + *
  7 + * - - - - - - 》 downInit : 初始化下行树
  8 + *
  9 + * - - - - - - 》 upreloadeTree : 刷行上行树
  10 + *
  11 + * - - - - - - 》 dwonreloadeTree : 刷行下行树
  12 + */
  13 +
  14 +var StationTreeData = function(){
  15 +
  16 + function parmasObj() {
  17 +
  18 + AddStationObj.setAddStation({});
  19 +
  20 + EditStationObj.setEitdStation({});
  21 +
  22 + EditSectionObj.setEitdSection({});
  23 +
  24 + }
  25 +
  26 + function TreeOnclickEvent(treeOjb) {
  27 + if(treeOjb==null)
  28 + return;
  29 + // 节点个数
  30 + var len = treeOjb.length;
  31 + if(len<0) {
  32 + return;
  33 + }
  34 +
  35 + // 获取数据
  36 + var stationData = treeOjb[0].original;
  37 + // 选中的节点类型
  38 + var chaildredType_ = stationData.chaildredType;
  39 +
  40 + if(chaildredType_ == "section") {
  41 + WorldsBMap.focusSection(stationData.sectionrouteId);
  42 + } else if(chaildredType_ == "station") {
  43 + WorldsBMap.openStationInfoWin(stationData);
  44 + } else if(chaildredType_ == "addSection") {
  45 + WorldsBMap.addSection(stationData);
  46 + }
  47 + }
  48 + var stationTree = {
  49 + upInit : function(treeDateJson) {
  50 + // 如果不为空
  51 + if(treeDateJson) {
  52 + // 加载树load事件
  53 + $('#station_Up_tree').on('loaded.jstree', function(e, data){
  54 + // 展开树
  55 + $.jstree.reference("#station_Up_tree").open_all();
  56 + }).jstree({
  57 + 'core' : {
  58 + 'themes' : {
  59 + 'responsive': false
  60 + },
  61 +
  62 + 'data': treeDateJson,
  63 +
  64 + 'multiple':false
  65 +
  66 + },
  67 +
  68 + 'types' : {
  69 +
  70 + "default" : {
  71 +
  72 + "icon" : false
  73 +
  74 + },
  75 +
  76 + 'enable_true' : {
  77 +
  78 + "icon" : 'fa fa-check icon-lg'
  79 +
  80 + },
  81 +
  82 + 'enable_false' : {
  83 +
  84 + 'icon' : 'fa fa-close icon-lg'
  85 +
  86 + },
  87 +
  88 + 'group':{
  89 +
  90 + 'icon' : 'fa fa-object-group icon-lg'
  91 +
  92 + }
  93 + },
  94 +
  95 + 'plugins': ['types']
  96 +
  97 + // 树节点单击事件
  98 + }).bind('click.jstree', function(event) {
  99 + // 获取上行选中树节点
  100 + var treeOjb = $.jstree.reference("#station_Up_tree").get_selected(true);
  101 + TreeOnclickEvent(treeOjb);
  102 +
  103 + });
  104 + }
  105 + },
  106 + downInit : function(treeDateJson) {
  107 + // 如果不为空
  108 + if(treeDateJson) {
  109 + // 树初始化load事件
  110 + $('#station_Down_tree').on('loaded.jstree', function(e, data){
  111 + // 展开树
  112 + $.jstree.reference("#station_Down_tree").open_all();
  113 + }).jstree({
  114 + 'core' : {
  115 + 'themes' : {
  116 +
  117 + 'responsive': false
  118 +
  119 + },
  120 +
  121 + 'data': treeDateJson,
  122 +
  123 + 'multiple':false
  124 +
  125 + },
  126 +
  127 + 'types' : {
  128 +
  129 + "default" : {
  130 +
  131 + "icon" : false
  132 +
  133 + },
  134 +
  135 + 'enable_true' : {
  136 +
  137 + "icon" : 'fa fa-check icon-lg'
  138 +
  139 + },
  140 +
  141 + 'enable_false' : {
  142 +
  143 + 'icon' : 'fa fa-close icon-lg'
  144 +
  145 + },
  146 +
  147 + 'group':{
  148 +
  149 + 'icon' : 'fa fa-object-group icon-lg'
  150 +
  151 + }
  152 + },
  153 + 'plugins': ['types']
  154 + // 树节点单击事件
  155 + }).bind('click.jstree', function(event) {
  156 + // 获取下行选中树节点
  157 + var treeOjb = $.jstree.reference("#station_Down_tree").get_selected(true);
  158 + TreeOnclickEvent(treeOjb);
  159 + });
  160 + }
  161 + },
  162 + inoutInit : function(treeDateJson) {
  163 + // 如果不为空
  164 + if(treeDateJson) {
  165 + // 树初始化load事件
  166 + $('#inout_carpark_tree').on('loaded.jstree', function(e, data){
  167 + // 展开树
  168 + $.jstree.reference("#inout_carpark_tree").open_all();
  169 + }).jstree({
  170 + 'core' : {
  171 + 'themes' : {
  172 + 'responsive': false
  173 + },
  174 + 'data': treeDateJson,
  175 + 'multiple':false
  176 + },
  177 + 'types' : {
  178 + "default" : {
  179 + "icon" : false
  180 + },
  181 + 'enable_true' : {
  182 + "icon" : 'fa fa-check icon-lg'
  183 + },
  184 + 'enable_false' : {
  185 + 'icon' : 'fa fa-close icon-lg'
  186 + },
  187 + 'group':{
  188 + 'icon' : 'fa fa-object-group icon-lg'
  189 + }
  190 + },
  191 + 'plugins': ['types']
  192 + // 树节点单击事件
  193 + }).bind('click.jstree', function(event) {
  194 + // 获取下行选中树节点
  195 + var treeOjb = $.jstree.reference("#inout_carpark_tree").get_selected(true);
  196 + TreeOnclickEvent(treeOjb);
  197 + });
  198 + }
  199 + },
  200 + upreloadeTree : function (treeDateJson) {
  201 + // 获取上行树
  202 + var tree = $.jstree.reference('#station_Up_tree');
  203 + // 赋值数据
  204 + tree.settings.core.data = treeDateJson;
  205 + // 刷新上行树
  206 + tree.refresh();
  207 + // 展开树
  208 + setTimeout(function () {
  209 + tree.open_all();
  210 + },500);
  211 + },
  212 + dwonreloadeTree : function (treeDateJson) {
  213 + // 获取下行树
  214 + var tree = $.jstree.reference('#station_Down_tree');
  215 + // 赋值数据
  216 + tree.settings.core.data = treeDateJson;
  217 + // 刷行下行树
  218 + tree.refresh();
  219 + // 展开树
  220 + setTimeout(function () {
  221 + tree.open_all();
  222 + },500);
  223 + },
  224 + inoutreloadeTree : function (treeDateJson) {
  225 + // 获取下行树
  226 + var tree = $.jstree.reference('#inout_carpark_tree');
  227 + // 赋值数据
  228 + tree.settings.core.data = treeDateJson;
  229 + // 刷行下行树
  230 + tree.refresh();
  231 + // 展开树
  232 + setTimeout(function () {
  233 + tree.open_all();
  234 + },500);
  235 + }
  236 + }
  237 +
  238 + return stationTree;
  239 +
190 }(); 240 }();
191 \ No newline at end of file 241 \ No newline at end of file
src/main/resources/static/pages/base/stationroute/list.html
1 -<link href="/pages/base/stationroute/css/bmap_base.css" rel="stylesheet" type="text/css" />  
2 -<link rel="stylesheet" href="/assets/plugins/layer-v2.4/layer/skin/layer.css">  
3 -  
4 -<div class="mian-portlet-body">  
5 - <!-- 地图 -->  
6 - <div id="bmap_basic" class="bmaps"></div>  
7 - <!-- 搜索框 -->  
8 -  
9 - <div class="search_panel">  
10 - <div class="search_input_panel">  
11 - <input class="search_input" type="text" placeholder="输入位置搜索" id="searchInput">  
12 - <span class="fa fa-close fa-lg clear hide" aria-hidden="true"></span >  
13 - </div>  
14 - <div class="search_button_panel">  
15 - <button class="fa fa-search fa-lg search_button" >  
16 - </button >  
17 - </div>  
18 - </div>  
19 - <div class="esc_edit_div" id="esc_edit_div" style="display: none">  
20 - <button class="esc_edit_btn" >退出编辑模式  
21 - </button >  
22 - </div>  
23 - <!-- 搜索下拉框-->  
24 - <div id="searchResultPanel" style="border:1px solid #C0C0C0;width:150px;height:auto; display:none;z-index: 199;"></div>  
25 - <!-- 路径规划路段 -->  
26 - <input class="hand" id="routePlanning" />  
27 - <div class="portlet box protlet-box">  
28 - <div class="protlet-box-layer"></div>  
29 - <!-- 左边标题栏 -->  
30 - <div class="portlet-title">  
31 - <div class="caption">  
32 - <!-- 途径站点 -->  
33 - </div>  
34 -  
35 - <div class="versions" style="float:right;">  
36 - <select id="versions" style="height:30px;width:200px;margin-top:5px;"> </select>  
37 - </div>  
38 -  
39 -  
40 - <div class="match_station hidden">  
41 - <!--<div class="match_station hidden">-->  
42 - <a class="match_station_bnt ">检测到外部站点行业编码有更新</a>  
43 - </div>  
44 -  
45 - <!--<div class="tools">  
46 - <a href="javascript:;" class="collapse" data-original-title="" title=""> </a>  
47 - </div>-->  
48 - </div>  
49 - <!-- 左边栏 -->  
50 - <div class="portlet-body" id="scrllmouseEvent" style="border: 1px solid rgb(255, 255, 255); display: block;min-height: 520px;">  
51 - <div class="row">  
52 - <!-- 上下行栏 -->  
53 - <div class="col-md-3 col-sm-3 col-xs-3">  
54 - <ul class="nav nav-tabs tabs-left" id="leftUpOrDown">  
55 - <li class="active">  
56 - <a href="#stationUp" data-toggle="tab" id="upLine" aria-expanded="true"> 上行 </a>  
57 - </li>  
58 - <li class="">  
59 - <a href="#stationDown" data-toggle="tab" id="downLine" aria-expanded="false"> 下行 </a>  
60 - </li>  
61 - </ul>  
62 - </div>  
63 - <div class="col-md-9 col-sm-9 col-xs-9">  
64 - <div class="tab-content">  
65 - <!-- 左边栏上行 -->  
66 - <div class="tab-pane active in" id="stationUp" data-direction="0">  
67 - <div class="portlet-body" id="uptreeMobal" style="display: none">  
68 - <div class="table-toolbar">  
69 - <div class="row">  
70 -  
71 - <div class="col-md-6" style="float: right;">  
72 - <div class="btn-group" style="float: right;">  
73 - <div class="actions module_tools">  
74 - <div class="btn-group">  
75 - <!-- <a class="btn green-haze btn-outline btn-circle btn-sm" style="background-color:#3B3F51;border-color:#FFFFFF;color:#FFFFFF" href="javascript:;" data-toggle="dropdown" data-hover="dropdown" data-close-others="true" aria-expanded="true"> 工具  
76 - <i class="fa fa-angle-down"></i>  
77 - </a> -->  
78 - <a href="javascript:" class="btn white btn-outline btn-circle" style="border-color: #3B3F51;color: #3B3F51;" data-toggle="dropdown" aria-expanded="false">  
79 - <i class="fa fa-share"></i>  
80 - <span>上行操作</span>  
81 - <i class="fa fa-angle-down"></i>  
82 - </a>  
83 - <ul class="dropdown-menu pull-right" style="min-width:100px">  
84 - <li>  
85 - <a href="javascript:;" id="addUpStation"><i class="fa fa-plus"></i> 添加站点</a>  
86 - </li>  
87 - <li class="divider"> </li>  
88 - <!--<li>  
89 - <a href="javascript:;" id="editUpStation"><i class="fa fa-pencil"></i> 修改站点</a>  
90 - </li>  
91 - <li class="divider"> </li>  
92 - <li>  
93 - <a href="javascript:;" id="deleteUpStation"><i class="fa fa-close"></i> 撤销站点</a>  
94 - </li>  
95 - <li class="divider"> </li>  
96 - <li>  
97 - <a href="javascript:;" id="addUpSection"><i class="fa fa-plus"></i> 添加路段</a>  
98 - </li>  
99 - <li class="divider"> </li>-->  
100 - <li>  
101 - <a href="javascript:;" id="batchUpDelete"><i class="fa fa-trash-o"></i> 批量撤销</a>  
102 - </li>  
103 - <li class="divider"> </li>  
104 - <li>  
105 - <a href="javascript:;" class="retweet"><i class="fa fa-retweet"></i> 切换上下行</a>  
106 - </li>  
107 - <li class="divider"> </li>  
108 - <li>  
109 - <a href="javascript:;" id="wrenchUpDis"><i class="fa fa-wrench"></i> 设置上行站距</a>  
110 - </li>  
111 - <li class="divider"> </li>  
112 - <li>  
113 - <a href="javascript:;" id="batchUpdateIndustryCode"><i class="fa fa-wrench"></i> 设置站点行业编码</a>  
114 - </li>  
115 - <li class="divider"> </li>  
116 - <li>  
117 - <a href="javascript:;" id="quoteDown"><i class="fa fa-long-arrow-down"></i> 引用下行路段</a>  
118 - </li>  
119 - <!-- <li class="divider"> </li>  
120 - <!-- <li>  
121 - <a href="javascript:;" id="editUplineTrend"><i class="fa fa-edit"></i> 编辑走向</a>  
122 - </li> -->  
123 - <!-- <li>  
124 - <a href="javascript:;" id="createUsingSingle"><i class="fa fa-edit"></i> 生成行单</a>  
125 - </li> -->  
126 - </ul>  
127 - </div>  
128 - </div>  
129 - </div>  
130 - </div>  
131 - </div>  
132 - </div>  
133 - <!-- 树 -->  
134 - <div class="portlet-body" >  
135 - <div id="station_Up_tree" class="defeat-scroll" style="height: auto;max-height: 500px;"></div>  
136 - </div>  
137 - </div>  
138 - <!-- 无上行站点添加方式 -->  
139 - <div id="upToolsMobal" class="portlet-body" style="display:none">  
140 - <div class="row">  
141 - <div class="col-md-6" style="float: right;">  
142 - <div class="btn-group" style="float: right;">  
143 - <div class="actions">  
144 - <a href="javascript:" class="btn white btn-outline btn-circle" style="border-color: #3B3F51;color: #3B3F51;" data-toggle="dropdown" aria-expanded="false">  
145 - <i class="fa fa-share"></i>  
146 - <span>上行规划选择</span>  
147 - <i class="fa fa-angle-down"></i>  
148 - </a>  
149 - <ul class="dropdown-menu pull-right" style="min-width:100px">  
150 - <li>  
151 - <a class="upManual" href="javascript:;" data-direction="0" data-pjax><i class="fa fa-pencil"></i> 手动添加站点</a>  
152 - </li>  
153 - <li class="divider"> </li>  
154 - <li>  
155 - <a class="upSystem" href="javascript:;" data-direction="0" data-pjax><i class="fa fa-wrench"></i> 系统规划</a>  
156 - </li>  
157 - <li class="divider"> </li>  
158 - <li>  
159 - <a class="gpsRoute" href="javascript:;" data-direction="0" data-pjax><i class="fa fa-wrench"></i> 测点生成</a>  
160 - </li>  
161 - </ul>  
162 - </div>  
163 - </div>  
164 - </div>  
165 - </div>  
166 - <div class="row" style="margin-top: 10px;">  
167 - <div class="col-md-12">  
168 - <!-- 提示 -->  
169 - <div class="alert alert-warning" style="background-color: #3b3f51;border-color: #FFFFFF;color: #ffffff;border-radius: 6px !important;">  
170 - <strong>系统未初始化该线路上行站点!</strong> 请从上方【上行规划选择】里选择任意一种方式规划该线路上行站点.  
171 - </div>  
172 - </div>  
173 - </div>  
174 - </div>  
175 -  
176 - </div>  
177 -  
178 - <!-- 下行 -->  
179 - <div class="tab-pane fade" id="stationDown" data-direction="1">  
180 - <div class="portlet-body" id="DowntreeMobal" style="display: none">  
181 - <div class="table-toolbar">  
182 - <div class="row">  
183 - <div class="col-md-6" style="float: right;">  
184 - <div class="btn-group" style="float: right;">  
185 - <div class="actions module_tools">  
186 - <div class="btn-group">  
187 - <!-- <a class="btn green-haze btn-outline btn-circle btn-sm" style="background-color:#3B3F51;border-color:#FFFFFF;color:#FFFFFF" href="javascript:;" data-toggle="dropdown" data-hover="dropdown" data-close-others="true" aria-expanded="true"> 工具  
188 - <i class="fa fa-angle-down"></i>  
189 - </a> -->  
190 - <a href="javascript:" class="btn white btn-outline btn-circle" style="border-color: #3B3F51;color: #3B3F51;" data-toggle="dropdown" aria-expanded="false">  
191 - <i class="fa fa-share"></i>  
192 - <span>下行操作</span>  
193 - <i class="fa fa-angle-down"></i>  
194 - </a>  
195 - <ul class="dropdown-menu pull-right" style="min-width:100px">  
196 - <li>  
197 - <a href="javascript:;" id="addDownStation"><i class="fa fa-plus"></i> 添加站点</a>  
198 - </li>  
199 - <li class="divider"> </li>  
200 - <!--<li>  
201 - <a href="javascript:;" id="editDownStation"><i class="fa fa-pencil"></i> 修改站点</a>  
202 - </li>  
203 - <li class="divider"> </li>  
204 - <li>  
205 - <a href="javascript:;" id="deleteDownStation"><i class="fa fa-close"></i> 撤销站点</a>  
206 - </li>  
207 - <li class="divider"> </li>  
208 - <li>  
209 - <a href="javascript:;" id="addDownSection"><i class="fa fa-plus"></i> 添加路段</a>  
210 - </li>  
211 - <li class="divider"> </li>-->  
212 - <li>  
213 - <a href="javascript:;" id="batchDownDelete"><i class="fa fa-trash-o"></i> 批量撤销</a>  
214 - </li>  
215 - <li class="divider"> </li>  
216 - <li>  
217 - <a href="javascript:;" class="retweet"><i class="fa fa-retweet"></i> 切换上下行</a>  
218 - </li>  
219 - <li class="divider"> </li>  
220 - <li>  
221 - <a href="javascript:;" id="wrenchDownDis"><i class="fa fa-wrench"></i> 设置下行站距</a>  
222 - </li>  
223 - <li class="divider"> </li>  
224 - <li>  
225 - <a href="javascript:;" id="batchDowndateIndustryCode"><i class="fa fa-wrench"></i> 设置站点行业编码</a>  
226 - </li>  
227 - <li class="divider"> </li>  
228 - <li>  
229 - <a href="javascript:;" id="quoteUp"><i class="fa fa-long-arrow-up"></i> 引用上行路段</a>  
230 - </li>  
231 - <!-- <li>  
232 - <a href="javascript:;" id="editDownlineTrend"><i class="fa fa-close"></i> 编辑走向</a>  
233 - </li> -->  
234 - </ul>  
235 - </div>  
236 - </div>  
237 - </div>  
238 - </div>  
239 - </div>  
240 - </div>  
241 - <!-- 树 -->  
242 - <div class="portlet-body">  
243 - <div id="station_Down_tree" class="defeat-scroll" style="height: auto;max-height: 500px;"></div>  
244 - </div>  
245 - </div>  
246 - <!-- 无上行站点添加方式 -->  
247 - <div id="downToolsMobal" class="portlet-body" style="display:none">  
248 - <div class="row">  
249 - <div class="col-md-6" style="float: right;">  
250 - <div class="btn-group" style="float: right;">  
251 - <div class="actions">  
252 - <a href="javascript:" class="btn white btn-outline btn-circle" style="border-color: #3B3F51;color: #3B3F51;" data-toggle="dropdown" aria-expanded="false">  
253 - <i class="fa fa-share"></i>  
254 - <span>下行规划选择</span>  
255 - <i class="fa fa-angle-down"></i>  
256 - </a>  
257 - <ul class="dropdown-menu pull-right" style="min-width:100px">  
258 - <li>  
259 - <a class="downManual" href="javascript:;" data-direction="1" data-pjax><i class="fa fa-pencil"></i> 手动添加站点</a>  
260 - </li>  
261 - <li class="divider"> </li>  
262 - <li>  
263 - <a class="downSystem" href="javascript:;" data-direction="1" data-pjax><i class="fa fa-wrench"></i> 系统规划</a>  
264 - </li>  
265 - <li class="divider"> </li>  
266 - <li>  
267 - <a class="gpsRoute" href="javascript:;" data-direction="1" data-pjax><i class="fa fa-wrench"></i> 测点生成</a>  
268 - </li>  
269 - </ul>  
270 - </div>  
271 - </div>  
272 - </div>  
273 - </div>  
274 - <div class="row" style="margin-top: 10px;">  
275 - <div class="col-md-12">  
276 - <!-- 提示 -->  
277 - <div class="alert alert-warning" style="background-color: #3b3f51;border-color: #FFFFFF;color: #ffffff;border-radius: 6px !important;">  
278 - <strong>系统未初始化该线路下行站点!</strong> 请从上方【下行规划选择】里选择任意一种方式规划该线路下行站点.  
279 - </div>  
280 - </div>  
281 - </div>  
282 - </div>  
283 - </div>  
284 - </div>  
285 - </div>  
286 - </div>  
287 - </div>  
288 - </div>  
289 -</div>  
290 -<!-- 线路类 -->  
291 -<script src="/pages/base/stationroute/js/line.js"></script>  
292 -<!-- 新增站点对象类 -->  
293 -<script src="/pages/base/stationroute/js/addstationobj.js"></script>  
294 -<!-- 修改站点对象类 -->  
295 -<script src="/pages/base/stationroute/js/editstationobj.js"></script>  
296 -<!-- 修改路段对象类 -->  
297 -<script src="/pages/base/stationroute/js/editsection.js"></script>  
298 -<!-- 批量撤销对象类 -->  
299 -<script src="/pages/base/stationroute/js/deletebatch.js"></script>  
300 -<!-- 绘图类 -->  
301 -<script src="/pages/base/stationroute/js/drawingManager.js"></script>  
302 -<!-- 地图类 -->  
303 -<script src="/pages/base/stationroute/js/stationroute-list-map.js"></script>  
304 -<!-- 函数与方法 -->  
305 -<script src="/pages/base/stationroute/js/stationroute-list-function.js"></script>  
306 -<!-- ajax请求类 -->  
307 -<script src="/pages/base/stationroute/js/stationroute-ajax-getdata.js"></script>  
308 -<!-- 树对类 -->  
309 -<script src="/pages/base/stationroute/js/stationroute-list-treedata.js"></script>  
310 -<!-- reload事件 -->  
311 -<script src="/pages/base/stationroute/js/stationroute-list-reload.js"></script>  
312 -<!-- 事件监听 -->  
313 -<script src="/pages/base/stationroute/js/stationroute-list-events.js"></script>  
314 -  
315 -<script id="add_draw_polyline-temp" type="text/html">  
316 - <div class="add_road_search_point_wrap ">  
317 - <div class="buffer_edit_body" >  
318 - <div class="_title">绘制路段</div>  
319 - <div class="form-horizontal" id="add_station_form">  
320 - <input type="hidden" value="{{id}}" name="id">  
321 - <input type="hidden" id="bsectionVectorInput"> <!--路段-->  
322 -  
323 - <div class="form-group">  
324 - <div class="col-md-12">  
325 - <input type="text" class="input-medium" name="sectionName" id="sectionNameInput" placeholder="路段名">  
326 - </div>  
327 - </div>  
328 -  
329 - <div class="form-group">  
330 - <div class="col-md-5">  
331 - <span class="draw_polyline_switch"><a>暂停绘制</a></span>  
332 - </div>  
333 - <div class="col-md-6 btns">  
334 - <button class="sbmint-btn btn-sm" id="addSectionSbmintBtn">确定</button>  
335 - <button class="cancel-btn btn-sm" id="addSectionCancelBtn">取消</button>  
336 - </div>  
337 - </div>  
338 - </div>  
339 - </div>  
340 - </div>  
341 -</script>  
342 -  
343 -<script type="text/javascript">  
344 - setTimeout(function () {  
345 - // 百度地图API功能  
346 - function G(id) {  
347 - return document.getElementById(id);  
348 - }  
349 -  
350 - var myMap = WorldsBMap.getmapBValue();  
351 -  
352 - var ac = new BMap.Autocomplete( //建立一个自动完成的对象  
353 - {"input" : "searchInput"  
354 - ,"location" : myMap  
355 - });  
356 -  
357 - ac.addEventListener("onhighlight", function(e) { //鼠标放在下拉列表上的事件  
358 - var str = "";  
359 - var _value = e.fromitem.value;  
360 - var value = "";  
361 - if (e.fromitem.index > -1) {  
362 - value = _value.province + _value.city + _value.district + _value.street + _value.business;  
363 - }  
364 - str = "FromItem<br />index = " + e.fromitem.index + "<br />value = " + value;  
365 -  
366 - value = "";  
367 - if (e.toitem.index > -1) {  
368 - _value = e.toitem.value;  
369 - value = _value.province + _value.city + _value.district + _value.street + _value.business;  
370 - }  
371 - str += "<br />ToItem<br />index = " + e.toitem.index + "<br />value = " + value;  
372 - G("searchResultPanel").innerHTML = str;  
373 - });  
374 -  
375 - var myValue;  
376 - ac.addEventListener("onconfirm", function(e) { //鼠标点击下拉列表后的事件  
377 - var _value = e.item.value;  
378 - myValue = _value.province + _value.city + _value.district + _value.street + _value.business;  
379 - G("searchResultPanel").innerHTML ="onconfirm<br />index = " + e.item.index + "<br />myValue = " + myValue;  
380 -  
381 - setPlace();  
382 - });  
383 -  
384 - function setPlace(){  
385 - // myMap.clearOverlays(); //清除地图上所有覆盖物  
386 - var local = new BMap.LocalSearch(myMap, { //智能搜索  
387 - onSearchComplete: myFun  
388 - });  
389 - function myFun(){  
390 - var pp = local.getResults().getPoi(0) == undefined? null:local.getResults().getPoi(0).point;  
391 - if(pp) {  
392 - myMap.centerAndZoom(pp, 20);  
393 - myMap.addOverlay(new BMap.Marker(pp)); //添加标注  
394 - } else {  
395 - layer.msg('找不到您输入的位置!')  
396 - }  
397 - }  
398 - local.search(myValue);  
399 - }  
400 - $("#searchInput").on('input propertychange change', function () {  
401 - if($("#searchInput").val() != null && $("#searchInput").val() != "")  
402 - $('.search_panel .clear').removeClass('hide');  
403 - else {  
404 - // WorldsBMap.clearOtherOverlay();  
405 - $('.search_panel .clear').addClass('hide');  
406 - }  
407 - });  
408 -  
409 - $('.search_panel .clear').on('click',function () {  
410 - // WorldsBMap.clearOtherOverlay();  
411 - $("#searchInput").val('');  
412 - $("#searchInput").change();  
413 - });  
414 - $('.search_panel .search_button').on('click',function () {  
415 - myValue = $("#searchInput").val();  
416 - setPlace();  
417 - });  
418 - },1000); 1 +<link href="/pages/base/stationroute/css/bmap_base.css" rel="stylesheet" type="text/css" />
  2 +<link rel="stylesheet" href="/assets/plugins/layer-v2.4/layer/skin/layer.css">
  3 +
  4 +<div class="mian-portlet-body">
  5 + <!-- 地图 -->
  6 + <div id="bmap_basic" class="bmaps"></div>
  7 + <!-- 搜索框 -->
  8 +
  9 + <div class="search_panel">
  10 + <div class="search_input_panel">
  11 + <input class="search_input" type="text" placeholder="输入位置搜索" id="searchInput">
  12 + <span class="fa fa-close fa-lg clear hide" aria-hidden="true"></span >
  13 + </div>
  14 + <div class="search_button_panel">
  15 + <button class="fa fa-search fa-lg search_button" >
  16 + </button >
  17 + </div>
  18 + </div>
  19 + <div class="esc_edit_div" id="esc_edit_div" style="display: none">
  20 + <button class="esc_edit_btn" >退出编辑模式
  21 + </button >
  22 + </div>
  23 + <!-- 搜索下拉框-->
  24 + <div id="searchResultPanel" style="border:1px solid #C0C0C0;width:150px;height:auto; display:none;z-index: 199;"></div>
  25 + <!-- 路径规划路段 -->
  26 + <input class="hand" id="routePlanning" />
  27 + <div class="portlet box protlet-box">
  28 + <div class="protlet-box-layer"></div>
  29 + <!-- 左边标题栏 -->
  30 + <div class="portlet-title">
  31 + <div class="caption">
  32 + <!-- 途径站点 -->
  33 + </div>
  34 +
  35 + <div class="versions" style="float:right;">
  36 + <select id="versions" style="height:30px;width:200px;margin-top:5px;"> </select>
  37 + </div>
  38 +
  39 +
  40 + <div class="match_station hidden">
  41 + <!--<div class="match_station hidden">-->
  42 + <a class="match_station_bnt ">检测到外部站点行业编码有更新</a>
  43 + </div>
  44 +
  45 + <!--<div class="tools">
  46 + <a href="javascript:;" class="collapse" data-original-title="" title=""> </a>
  47 + </div>-->
  48 + </div>
  49 + <!-- 左边栏 -->
  50 + <div class="portlet-body" id="scrllmouseEvent" style="border: 1px solid rgb(255, 255, 255); display: block;min-height: 520px;">
  51 + <div class="row">
  52 + <!-- 上下行栏 -->
  53 + <div class="col-md-3 col-sm-3 col-xs-3">
  54 + <ul class="nav nav-tabs tabs-left" id="leftUpOrDown">
  55 + <li class="active">
  56 + <a href="#stationUp" data-toggle="tab" id="upLine" aria-expanded="true"> 上行 </a>
  57 + </li>
  58 + <li class="">
  59 + <a href="#stationDown" data-toggle="tab" id="downLine" aria-expanded="false"> 下行 </a>
  60 + </li>
  61 + <li class="">
  62 + <a href="#inoutCarpark" data-toggle="tab" id="inoutLine" aria-expanded="false"> 进出场路径 </a>
  63 + </li>
  64 + </ul>
  65 + </div>
  66 + <div class="col-md-9 col-sm-9 col-xs-9">
  67 + <div class="tab-content">
  68 + <!-- 左边栏上行 -->
  69 + <div class="tab-pane active in" id="stationUp" data-direction="0">
  70 + <div class="portlet-body" id="uptreeMobal" style="display: none">
  71 + <div class="table-toolbar">
  72 + <div class="row">
  73 +
  74 + <div class="col-md-6" style="float: right;">
  75 + <div class="btn-group" style="float: right;">
  76 + <div class="actions module_tools">
  77 + <div class="btn-group">
  78 + <!-- <a class="btn green-haze btn-outline btn-circle btn-sm" style="background-color:#3B3F51;border-color:#FFFFFF;color:#FFFFFF" href="javascript:;" data-toggle="dropdown" data-hover="dropdown" data-close-others="true" aria-expanded="true"> 工具
  79 + <i class="fa fa-angle-down"></i>
  80 + </a> -->
  81 + <a href="javascript:" class="btn white btn-outline btn-circle" style="border-color: #3B3F51;color: #3B3F51;" data-toggle="dropdown" aria-expanded="false">
  82 + <i class="fa fa-share"></i>
  83 + <span>上行操作</span>
  84 + <i class="fa fa-angle-down"></i>
  85 + </a>
  86 + <ul class="dropdown-menu pull-right" style="min-width:100px">
  87 + <li>
  88 + <a href="javascript:;" id="addUpStation"><i class="fa fa-plus"></i> 添加站点</a>
  89 + </li>
  90 + <li class="divider"> </li>
  91 + <!--<li>
  92 + <a href="javascript:;" id="editUpStation"><i class="fa fa-pencil"></i> 修改站点</a>
  93 + </li>
  94 + <li class="divider"> </li>
  95 + <li>
  96 + <a href="javascript:;" id="deleteUpStation"><i class="fa fa-close"></i> 撤销站点</a>
  97 + </li>
  98 + <li class="divider"> </li>
  99 + <li>
  100 + <a href="javascript:;" id="addUpSection"><i class="fa fa-plus"></i> 添加路段</a>
  101 + </li>
  102 + <li class="divider"> </li>-->
  103 + <li>
  104 + <a href="javascript:;" id="batchUpDelete"><i class="fa fa-trash-o"></i> 批量撤销</a>
  105 + </li>
  106 + <li class="divider"> </li>
  107 + <li>
  108 + <a href="javascript:;" class="retweet"><i class="fa fa-retweet"></i> 切换上下行</a>
  109 + </li>
  110 + <li class="divider"> </li>
  111 + <li>
  112 + <a href="javascript:;" id="wrenchUpDis"><i class="fa fa-wrench"></i> 设置上行站距</a>
  113 + </li>
  114 + <li class="divider"> </li>
  115 + <li>
  116 + <a href="javascript:;" id="batchUpdateIndustryCode"><i class="fa fa-wrench"></i> 设置站点行业编码</a>
  117 + </li>
  118 + <li class="divider"> </li>
  119 + <li>
  120 + <a href="javascript:;" id="quoteDown"><i class="fa fa-long-arrow-down"></i> 引用下行路段</a>
  121 + </li>
  122 + <!-- <li class="divider"> </li>
  123 + <!-- <li>
  124 + <a href="javascript:;" id="editUplineTrend"><i class="fa fa-edit"></i> 编辑走向</a>
  125 + </li> -->
  126 + <!-- <li>
  127 + <a href="javascript:;" id="createUsingSingle"><i class="fa fa-edit"></i> 生成行单</a>
  128 + </li> -->
  129 + </ul>
  130 + </div>
  131 + </div>
  132 + </div>
  133 + </div>
  134 + </div>
  135 + </div>
  136 + <!-- 树 -->
  137 + <div class="portlet-body" >
  138 + <div id="station_Up_tree" class="defeat-scroll" style="height: auto;max-height: 500px;"></div>
  139 + </div>
  140 + </div>
  141 + <!-- 无上行站点添加方式 -->
  142 + <div id="upToolsMobal" class="portlet-body" style="display:none">
  143 + <div class="row">
  144 + <div class="col-md-6" style="float: right;">
  145 + <div class="btn-group" style="float: right;">
  146 + <div class="actions">
  147 + <a href="javascript:" class="btn white btn-outline btn-circle" style="border-color: #3B3F51;color: #3B3F51;" data-toggle="dropdown" aria-expanded="false">
  148 + <i class="fa fa-share"></i>
  149 + <span>上行规划选择</span>
  150 + <i class="fa fa-angle-down"></i>
  151 + </a>
  152 + <ul class="dropdown-menu pull-right" style="min-width:100px">
  153 + <li>
  154 + <a class="upManual" href="javascript:;" data-direction="0" data-pjax><i class="fa fa-pencil"></i> 手动添加站点</a>
  155 + </li>
  156 + <li class="divider"> </li>
  157 + <li>
  158 + <a class="upSystem" href="javascript:;" data-direction="0" data-pjax><i class="fa fa-wrench"></i> 系统规划</a>
  159 + </li>
  160 + <li class="divider"> </li>
  161 + <li>
  162 + <a class="gpsRoute" href="javascript:;" data-direction="0" data-pjax><i class="fa fa-wrench"></i> 测点生成</a>
  163 + </li>
  164 + </ul>
  165 + </div>
  166 + </div>
  167 + </div>
  168 + </div>
  169 + <div class="row" style="margin-top: 10px;">
  170 + <div class="col-md-12">
  171 + <!-- 提示 -->
  172 + <div class="alert alert-warning" style="background-color: #3b3f51;border-color: #FFFFFF;color: #ffffff;border-radius: 6px !important;">
  173 + <strong>系统未初始化该线路上行站点!</strong> 请从上方【上行规划选择】里选择任意一种方式规划该线路上行站点.
  174 + </div>
  175 + </div>
  176 + </div>
  177 + </div>
  178 +
  179 + </div>
  180 +
  181 + <!-- 下行 -->
  182 + <div class="tab-pane fade" id="stationDown" data-direction="1">
  183 + <div class="portlet-body" id="DowntreeMobal" style="display: none">
  184 + <div class="table-toolbar">
  185 + <div class="row">
  186 + <div class="col-md-6" style="float: right;">
  187 + <div class="btn-group" style="float: right;">
  188 + <div class="actions module_tools">
  189 + <div class="btn-group">
  190 + <!-- <a class="btn green-haze btn-outline btn-circle btn-sm" style="background-color:#3B3F51;border-color:#FFFFFF;color:#FFFFFF" href="javascript:;" data-toggle="dropdown" data-hover="dropdown" data-close-others="true" aria-expanded="true"> 工具
  191 + <i class="fa fa-angle-down"></i>
  192 + </a> -->
  193 + <a href="javascript:" class="btn white btn-outline btn-circle" style="border-color: #3B3F51;color: #3B3F51;" data-toggle="dropdown" aria-expanded="false">
  194 + <i class="fa fa-share"></i>
  195 + <span>下行操作</span>
  196 + <i class="fa fa-angle-down"></i>
  197 + </a>
  198 + <ul class="dropdown-menu pull-right" style="min-width:100px">
  199 + <li>
  200 + <a href="javascript:;" id="addDownStation"><i class="fa fa-plus"></i> 添加站点</a>
  201 + </li>
  202 + <li class="divider"> </li>
  203 + <!--<li>
  204 + <a href="javascript:;" id="editDownStation"><i class="fa fa-pencil"></i> 修改站点</a>
  205 + </li>
  206 + <li class="divider"> </li>
  207 + <li>
  208 + <a href="javascript:;" id="deleteDownStation"><i class="fa fa-close"></i> 撤销站点</a>
  209 + </li>
  210 + <li class="divider"> </li>
  211 + <li>
  212 + <a href="javascript:;" id="addDownSection"><i class="fa fa-plus"></i> 添加路段</a>
  213 + </li>
  214 + <li class="divider"> </li>-->
  215 + <li>
  216 + <a href="javascript:;" id="batchDownDelete"><i class="fa fa-trash-o"></i> 批量撤销</a>
  217 + </li>
  218 + <li class="divider"> </li>
  219 + <li>
  220 + <a href="javascript:;" class="retweet"><i class="fa fa-retweet"></i> 切换上下行</a>
  221 + </li>
  222 + <li class="divider"> </li>
  223 + <li>
  224 + <a href="javascript:;" id="wrenchDownDis"><i class="fa fa-wrench"></i> 设置下行站距</a>
  225 + </li>
  226 + <li class="divider"> </li>
  227 + <li>
  228 + <a href="javascript:;" id="batchDowndateIndustryCode"><i class="fa fa-wrench"></i> 设置站点行业编码</a>
  229 + </li>
  230 + <li class="divider"> </li>
  231 + <li>
  232 + <a href="javascript:;" id="quoteUp"><i class="fa fa-long-arrow-up"></i> 引用上行路段</a>
  233 + </li>
  234 + <!-- <li>
  235 + <a href="javascript:;" id="editDownlineTrend"><i class="fa fa-close"></i> 编辑走向</a>
  236 + </li> -->
  237 + </ul>
  238 + </div>
  239 + </div>
  240 + </div>
  241 + </div>
  242 + </div>
  243 + </div>
  244 + <!-- 树 -->
  245 + <div class="portlet-body">
  246 + <div id="station_Down_tree" class="defeat-scroll" style="height: auto;max-height: 500px;"></div>
  247 + </div>
  248 + </div>
  249 + <!-- 无上行站点添加方式 -->
  250 + <div id="downToolsMobal" class="portlet-body" style="display:none">
  251 + <div class="row">
  252 + <div class="col-md-6" style="float: right;">
  253 + <div class="btn-group" style="float: right;">
  254 + <div class="actions">
  255 + <a href="javascript:" class="btn white btn-outline btn-circle" style="border-color: #3B3F51;color: #3B3F51;" data-toggle="dropdown" aria-expanded="false">
  256 + <i class="fa fa-share"></i>
  257 + <span>下行规划选择</span>
  258 + <i class="fa fa-angle-down"></i>
  259 + </a>
  260 + <ul class="dropdown-menu pull-right" style="min-width:100px">
  261 + <li>
  262 + <a class="downManual" href="javascript:;" data-direction="1" data-pjax><i class="fa fa-pencil"></i> 手动添加站点</a>
  263 + </li>
  264 + <li class="divider"> </li>
  265 + <li>
  266 + <a class="downSystem" href="javascript:;" data-direction="1" data-pjax><i class="fa fa-wrench"></i> 系统规划</a>
  267 + </li>
  268 + <li class="divider"> </li>
  269 + <li>
  270 + <a class="gpsRoute" href="javascript:;" data-direction="1" data-pjax><i class="fa fa-wrench"></i> 测点生成</a>
  271 + </li>
  272 + </ul>
  273 + </div>
  274 + </div>
  275 + </div>
  276 + </div>
  277 + <div class="row" style="margin-top: 10px;">
  278 + <div class="col-md-12">
  279 + <!-- 提示 -->
  280 + <div class="alert alert-warning" style="background-color: #3b3f51;border-color: #FFFFFF;color: #ffffff;border-radius: 6px !important;">
  281 + <strong>系统未初始化该线路下行站点!</strong> 请从上方【下行规划选择】里选择任意一种方式规划该线路下行站点.
  282 + </div>
  283 + </div>
  284 + </div>
  285 + </div>
  286 + </div>
  287 +
  288 + <!-- 进出场路径 -->
  289 + <div class="tab-pane fade" id="inoutCarpark" data-direction="3">
  290 + <div class="portlet-body" id="InoutCarparktreeMobal">
  291 + <div class="table-toolbar">
  292 + <div class="row">
  293 + <div class="col-md-6" style="float: right;">
  294 + <div class="btn-group" style="float: right;">
  295 + <div class="actions module_tools">
  296 + <div class="btn-group">
  297 + <!-- <a class="btn green-haze btn-outline btn-circle btn-sm" style="background-color:#3B3F51;border-color:#FFFFFF;color:#FFFFFF" href="javascript:;" data-toggle="dropdown" data-hover="dropdown" data-close-others="true" aria-expanded="true"> 工具
  298 + <i class="fa fa-angle-down"></i>
  299 + </a> -->
  300 + <a href="javascript:" class="btn white btn-outline btn-circle" style="border-color: #3B3F51;color: #3B3F51;" data-toggle="dropdown" aria-expanded="false">
  301 + <i class="fa fa-share"></i>
  302 + <span>进出场路径规划</span>
  303 + <i class="fa fa-angle-down"></i>
  304 + </a>
  305 + <ul class="dropdown-menu pull-right" style="min-width:100px">
  306 + <li>
  307 + <a href="javascript:;" id="historyGps"><i class="fa fa-wrench"></i> 历史GPS路径规划</a>
  308 + </li>
  309 + </ul>
  310 + </div>
  311 + </div>
  312 + </div>
  313 + </div>
  314 + </div>
  315 + </div>
  316 + <!-- 树 -->
  317 + <div class="portlet-body inout-search"></div>
  318 + <div class="portlet-body">
  319 + <div id="inout_carpark_tree" class="defeat-scroll" style="height: auto;max-height: 500px;"></div>
  320 + </div>
  321 + </div>
  322 + </div>
  323 + </div>
  324 + </div>
  325 + </div>
  326 + </div>
  327 + </div>
  328 +</div>
  329 +<!-- 线路类 -->
  330 +<script src="/pages/base/stationroute/js/line.js"></script>
  331 +<!-- 新增站点对象类 -->
  332 +<script src="/pages/base/stationroute/js/addstationobj.js"></script>
  333 +<!-- 修改站点对象类 -->
  334 +<script src="/pages/base/stationroute/js/editstationobj.js"></script>
  335 +<!-- 修改路段对象类 -->
  336 +<script src="/pages/base/stationroute/js/editsection.js"></script>
  337 +<!-- 批量撤销对象类 -->
  338 +<script src="/pages/base/stationroute/js/deletebatch.js"></script>
  339 +<!-- 绘图类 -->
  340 +<script src="/pages/base/stationroute/js/drawingManager.js"></script>
  341 +<!-- 地图类 -->
  342 +<script src="/pages/base/stationroute/js/stationroute-list-map.js"></script>
  343 +<!-- 函数与方法 -->
  344 +<script src="/pages/base/stationroute/js/stationroute-list-function.js"></script>
  345 +<!-- ajax请求类 -->
  346 +<script src="/pages/base/stationroute/js/stationroute-ajax-getdata.js"></script>
  347 +<!-- 树对类 -->
  348 +<script src="/pages/base/stationroute/js/stationroute-list-treedata.js"></script>
  349 +<!-- reload事件 -->
  350 +<script src="/pages/base/stationroute/js/stationroute-list-reload.js"></script>
  351 +<!-- 事件监听 -->
  352 +<script src="/pages/base/stationroute/js/stationroute-list-events.js"></script>
  353 +
  354 +<script id="add_draw_polyline-temp" type="text/html">
  355 + <div class="add_road_search_point_wrap ">
  356 + <div class="buffer_edit_body" >
  357 + <div class="_title">绘制路段</div>
  358 + <div class="form-horizontal" id="add_station_form">
  359 + <input type="hidden" value="{{id}}" name="id">
  360 + <input type="hidden" id="bsectionVectorInput"> <!--路段-->
  361 +
  362 + <div class="form-group">
  363 + <div class="col-md-12">
  364 + <input type="text" class="input-medium" name="sectionName" id="sectionNameInput" placeholder="路段名">
  365 + </div>
  366 + </div>
  367 +
  368 + <div class="form-group">
  369 + <div class="col-md-5">
  370 + <span class="draw_polyline_switch"><a>暂停绘制</a></span>
  371 + </div>
  372 + <div class="col-md-6 btns">
  373 + <button class="sbmint-btn btn-sm" id="addSectionSbmintBtn">确定</button>
  374 + <button class="cancel-btn btn-sm" id="addSectionCancelBtn">取消</button>
  375 + </div>
  376 + </div>
  377 + </div>
  378 + </div>
  379 + </div>
  380 +</script>
  381 +
  382 +<script id="inout-carpark-search-form" type="text/html">
  383 + <div class="form-horizontal">
  384 + <div class="form-group">
  385 + <div class="col-md-3 col-sm-3 col-xs-3">
  386 + <label class="uk-form-label">起点</label>
  387 + </div>
  388 + <div class="col-md-9 col-sm-9 col-xs-9">
  389 + <select class="form-control" name="startPoint" id="startPoint"></select>
  390 + </div>
  391 + </div>
  392 + <div class="form-group">
  393 + <div class="col-md-3 col-sm-3 col-xs-3">
  394 + <label class="uk-form-label">终点</label>
  395 + </div>
  396 + <div class="col-md-9 col-sm-9 col-xs-9">
  397 + <select class="form-control" name="endPoint" id="endPoint"></select>
  398 + </div>
  399 + </div>
  400 + <div class="form-group">
  401 + <div class="col-md-6"></div>
  402 + <div class="col-md-6 btns">
  403 + <button class="btn-sm" style="float: right;" id="inoutSearch">搜索</button>
  404 + </div>
  405 + </div>
  406 + </div>
  407 +</script>
  408 +
  409 +<script type="text/javascript">
  410 + setTimeout(function () {
  411 + // 百度地图API功能
  412 + function G(id) {
  413 + return document.getElementById(id);
  414 + }
  415 +
  416 + var myMap = WorldsBMap.getmapBValue();
  417 +
  418 + var ac = new BMap.Autocomplete( //建立一个自动完成的对象
  419 + {"input" : "searchInput"
  420 + ,"location" : myMap
  421 + });
  422 +
  423 + ac.addEventListener("onhighlight", function(e) { //鼠标放在下拉列表上的事件
  424 + var str = "";
  425 + var _value = e.fromitem.value;
  426 + var value = "";
  427 + if (e.fromitem.index > -1) {
  428 + value = _value.province + _value.city + _value.district + _value.street + _value.business;
  429 + }
  430 + str = "FromItem<br />index = " + e.fromitem.index + "<br />value = " + value;
  431 +
  432 + value = "";
  433 + if (e.toitem.index > -1) {
  434 + _value = e.toitem.value;
  435 + value = _value.province + _value.city + _value.district + _value.street + _value.business;
  436 + }
  437 + str += "<br />ToItem<br />index = " + e.toitem.index + "<br />value = " + value;
  438 + G("searchResultPanel").innerHTML = str;
  439 + });
  440 +
  441 + var myValue;
  442 + ac.addEventListener("onconfirm", function(e) { //鼠标点击下拉列表后的事件
  443 + var _value = e.item.value;
  444 + myValue = _value.province + _value.city + _value.district + _value.street + _value.business;
  445 + G("searchResultPanel").innerHTML ="onconfirm<br />index = " + e.item.index + "<br />myValue = " + myValue;
  446 +
  447 + setPlace();
  448 + });
  449 +
  450 + function setPlace(){
  451 + // myMap.clearOverlays(); //清除地图上所有覆盖物
  452 + var local = new BMap.LocalSearch(myMap, { //智能搜索
  453 + onSearchComplete: myFun
  454 + });
  455 + function myFun(){
  456 + var pp = local.getResults().getPoi(0) == undefined? null:local.getResults().getPoi(0).point;
  457 + if(pp) {
  458 + myMap.centerAndZoom(pp, 20);
  459 + myMap.addOverlay(new BMap.Marker(pp)); //添加标注
  460 + } else {
  461 + layer.msg('找不到您输入的位置!')
  462 + }
  463 + }
  464 + local.search(myValue);
  465 + }
  466 + $("#searchInput").on('input propertychange change', function () {
  467 + if($("#searchInput").val() != null && $("#searchInput").val() != "")
  468 + $('.search_panel .clear').removeClass('hide');
  469 + else {
  470 + // WorldsBMap.clearOtherOverlay();
  471 + $('.search_panel .clear').addClass('hide');
  472 + }
  473 + });
  474 +
  475 + $('.search_panel .clear').on('click',function () {
  476 + // WorldsBMap.clearOtherOverlay();
  477 + $("#searchInput").val('');
  478 + $("#searchInput").change();
  479 + });
  480 + $('.search_panel .search_button').on('click',function () {
  481 + myValue = $("#searchInput").val();
  482 + setPlace();
  483 + });
  484 +
  485 + $('#historyGps').on('click', function() {
  486 + $.get('/pages/base/stationroute/list_template.html', function (content) {
  487 + window.layerIdx = layer.open({
  488 + type: 1,
  489 + move: false,
  490 + area: ['800px', '600px'],
  491 + content: content,
  492 + title: '选择班次',
  493 + shift: 5,
  494 + scrollbar: false,
  495 + success: function () {
  496 + }
  497 + });
  498 + });
  499 + });
  500 + },1000);
419 </script> 501 </script>
420 \ No newline at end of file 502 \ No newline at end of file
src/main/resources/static/pages/base/stationroute/list_template.html 0 → 100644
  1 +<div className="row">
  2 + <div className="col-md-12">
  3 + <!-- BEGIN VALIDATION STATES-->
  4 + <div className="portlet light portlet-fit portlet-form bordered">
  5 + <div className="portlet-body">
  6 + <div class="table-container" style="margin-top: 10px">
  7 + <table class="table table-striped table-bordered table-hover table-checkable" id="datatable_waybill_choose">
  8 + <thead>
  9 + <tr role="row" class="heading">
  10 + <th width="10%">序号</th>
  11 + <th width="18%">线路名称</th>
  12 + <th width="18%">起点</th>
  13 + <th width="18%">终点</th>
  14 + <th width="18%">发车时间</th>
  15 + <th width="18%">到达时间</th>
  16 + </tr>
  17 + </thead>
  18 + <tbody></tbody>
  19 + </table>
  20 + </div>
  21 + </div>
  22 + </div>
  23 + </div>
  24 +</div>
  25 +<script type="text/html" id="waybill_choose_template">
  26 + {{each list as obj i }}
  27 + <tr>
  28 + <td style="vertical-align: middle;">
  29 + <input type="radio" class="group-checkable icheck" name="waybillRadio" data-id="{{obj.id}}">
  30 + </td>
  31 + <td style="vertical-align: middle;">
  32 + {{obj.xlName}}
  33 + </td>
  34 + <td>
  35 + {{obj.qdzName}}
  36 + </td>
  37 + <td>
  38 + {{obj.zdzName}}
  39 + </td>
  40 + <td>
  41 + {{obj.fcsjActual}}
  42 + </td>
  43 + <td>
  44 + {{obj.zdsjActual}}
  45 + </td>
  46 + </tr>
  47 + {{/each}}
  48 + {{if list.length == 0}}
  49 + <tr>
  50 + <td colspan="6"><h6 class="muted">没有找到相关数据</h6></td>
  51 + </tr>
  52 + {{/if}}
  53 +</script>
  54 +<script>
  55 + $(function () {
  56 + // 异步请求获取表格数据
  57 + var params = {};
  58 + params.qdzCode_eq = $('#startPoint').val().split('_')[0];
  59 + params.zdzCode_eq = $('#endPoint').val().split('_')[0];
  60 + params.xlBm_eq = LineObj.getLineObj().id;
  61 + $.ajax({
  62 + url: "/real_control_v2/assets/imgs/time.gif",
  63 + type: "HEAD",
  64 + async: false,
  65 + success: function(result,status,xhr) {
  66 + params.scheduleDateStr_eq = moment(xhr.getResponseHeader("Date")).add(-1, 'days').format('YYYY-MM-DD');
  67 + }
  68 + })
  69 + $.get('/realSchedule/all',params,function(result){
  70 + // 把数据填充到模版中
  71 + var tbodyHtml = template('waybill_choose_template',{list:result});
  72 + // 把渲染好的模版html文本追加到表格中
  73 + $('#datatable_waybill_choose tbody').html(tbodyHtml);
  74 + $("input[name='waybillRadio']").change(function () {
  75 + $.post('/inout/pathPlaningByHistory', {schId: $(this).data('id'), version: $("#versions").val()}, function (result1) {
  76 + layer.msg('路径规划已完成');
  77 + // 刷新左边树
  78 + $('#inoutSearch').click();
  79 + layer.close(window.layerIdx);
  80 + });
  81 + });
  82 + });
  83 + });
  84 +</script>
0 \ No newline at end of file 85 \ No newline at end of file