Commit bd2fc031b872d9e3c3b16dffbb2209aa13a6e51b

Authored by 游瑞烽
1 parent d4a5dfb5

线路编辑代码修改

Showing 41 changed files with 2236 additions and 134 deletions
src/main/java/com/bsth/controller/LsSectionRouteController.java 0 → 100644
  1 +package com.bsth.controller;
  2 +
  3 +import com.bsth.entity.LsSectionRoute;
  4 +import com.bsth.service.LsSectionRouteService;
  5 +import org.springframework.beans.factory.annotation.Autowired;
  6 +import org.springframework.web.bind.annotation.RequestMapping;
  7 +import org.springframework.web.bind.annotation.RequestMethod;
  8 +import org.springframework.web.bind.annotation.RequestParam;
  9 +import org.springframework.web.bind.annotation.RestController;
  10 +
  11 +import java.util.Map;
  12 +
  13 +/**
  14 + *
  15 + * @ClassName: SectionRouteController(路段路由控制器)
  16 + *
  17 + * @Extends : BaseController
  18 + *
  19 + * @Description: TODO(路段路由控制层)
  20 + *
  21 + * @Author YRF
  22 + *
  23 + */
  24 +
  25 +@RestController
  26 +@RequestMapping("LsSectionRoute")
  27 +public class LsSectionRouteController extends BaseController<LsSectionRoute, Integer> {
  28 +
  29 + @Autowired
  30 + LsSectionRouteService service;
  31 +
  32 + /**
  33 + * @param map
  34 + * @throws
  35 + * @Description: TODO(批量撤销路段)
  36 + */
  37 + /* @RequestMapping(value = "/batchDestroy", method = RequestMethod.POST)
  38 + public Map<String, Object> updateBatch(@RequestParam Map<String, Object> map) {
  39 + return routeService.updateLsSectionRouteInfoFormId(map);
  40 + }*/
  41 +
  42 + /**
  43 + * @Description :TODO(把路段截取位双路名路段)
  44 + *
  45 + * @return int <sectionCode路段编码>
  46 + */
  47 + @RequestMapping(value="doubleName" , method = RequestMethod.POST)
  48 + public Map<String, Object> doubleName(@RequestParam Map<String, Object> map) {
  49 + return service.doubleName(map);
  50 + }
  51 +
  52 +}
... ...
src/main/java/com/bsth/controller/LsStationRouteController.java 0 → 100644
  1 +package com.bsth.controller;
  2 +
  3 +import com.bsth.entity.LsStationRoute;
  4 +import com.bsth.service.LsStationRouteService;
  5 +import org.springframework.beans.factory.annotation.Autowired;
  6 +import org.springframework.web.bind.annotation.RequestMapping;
  7 +import org.springframework.web.bind.annotation.RequestMethod;
  8 +import org.springframework.web.bind.annotation.RequestParam;
  9 +import org.springframework.web.bind.annotation.RestController;
  10 +
  11 +import java.util.Map;
  12 +
  13 +/**
  14 + *
  15 + * @ClassName: LsStationRouteController(历史站点路由控制器)
  16 + *
  17 + * @Extends : BaseController
  18 + *
  19 + * @Description: TODO(站点路由控制层)
  20 + *
  21 + * @Author YRF
  22 + *
  23 + * @Date 2019年5月14日
  24 + *
  25 + * @Dersion 公交调度系统BS版 0.1
  26 + *
  27 + */
  28 +@RestController
  29 +@RequestMapping("lsStationRoute")
  30 +public class LsStationRouteController extends BaseController<LsStationRoute, Integer> {
  31 +
  32 + @Autowired
  33 + LsStationRouteService service;
  34 +
  35 + /**
  36 + * @param map
  37 + * @throws
  38 + * @Description: TODO(批量撤销站点)
  39 + */
  40 + /*@RequestMapping(value = "/batchDestroy", method = RequestMethod.POST)
  41 + public Map<String, Object> updateBatch(@RequestParam Map<String, Object> map) {
  42 + return service.updateLsStationRouteInfoFormId(map);
  43 + }*/
  44 +
  45 + /**
  46 + *
  47 + * @Title: upddis
  48 + * @Description: TODO(更新站距)
  49 + */
  50 + @RequestMapping(value = "/upddis",method = RequestMethod.POST)
  51 + public Map<String, Object> upddis(@RequestParam Map<String, Object> map) {
  52 + return service.upddis(map);
  53 + }
  54 +}
... ...
src/main/java/com/bsth/controller/geo_data/GeoDataController.java
... ... @@ -26,6 +26,10 @@ public class GeoDataController {
26 26 return geoDataService.findGeoStations(lineCode, version);
27 27 }
28 28  
  29 + @RequestMapping("findGeoStationsDir")
  30 + public Map<String, Object> findGeoStationsDir(@RequestParam String lineCode, Integer version, Integer dir){
  31 + return geoDataService.findGeoStations(lineCode, version, dir);
  32 + }
29 33  
30 34 @RequestMapping("findGeoRoad")
31 35 public Map<String, Object> findGeoRoad(@RequestParam String lineCode,Integer version){
... ... @@ -93,4 +97,14 @@ public class GeoDataController {
93 97 public Map<String, Object> addEnableInfo(@RequestParam String lineCode,@RequestParam int versions, @RequestParam String startDate){
94 98 return geoDataService.addEnableInfo(lineCode, versions, startDate);
95 99 }
  100 +
  101 + @RequestMapping(value = "batchDestroyLsStationRout", method = RequestMethod.POST)
  102 + public Map<String, Object> batchDestroyLsStationRout(@RequestParam String ids,@RequestParam String lineCode,@RequestParam int upDown,@RequestParam int versions) {
  103 + return geoDataService.batchDestroyLsStationRout(ids,lineCode,upDown,versions);
  104 + }
  105 +
  106 + @RequestMapping(value = "batchDestroyLsSectionRout", method = RequestMethod.POST)
  107 + public Map<String, Object> batchDestroyLsSectionRout(@RequestParam String ids,@RequestParam String lineCode,@RequestParam int upDown,@RequestParam int versions) {
  108 + return geoDataService.batchDestroyLsSectionRout(ids,lineCode,upDown,versions);
  109 + }
96 110 }
97 111 \ No newline at end of file
... ...
src/main/java/com/bsth/entity/Station.java
... ... @@ -33,7 +33,7 @@ public class Station {
33 33 private Integer id;
34 34  
35 35 // 站点编码
36   - private String code;
  36 + private String stationCode;
37 37  
38 38 /**
39 39 * 经纬坐标类型
... ... @@ -111,12 +111,12 @@ public class Station {
111 111 this.id = id;
112 112 }
113 113  
114   - public String getCode() {
115   - return code;
  114 + public String getStationCode() {
  115 + return stationCode;
116 116 }
117 117  
118   - public void setCode(String code) {
119   - this.code = code;
  118 + public void setStationCode(String stationCode) {
  119 + this.stationCode = stationCode;
120 120 }
121 121  
122 122 public String getDbType() {
... ... @@ -193,7 +193,7 @@ public class Station {
193 193  
194 194 @Override
195 195 public String toString() {
196   - return "Station [id=" + id + ", code=" + code + ", dbType=" + dbType + ", bJwpoints=" + bJwpoints + ", gLonx=" + gLonx
  196 + return "Station [id=" + id + ", stationCode=" + stationCode + ", dbType=" + dbType + ", bJwpoints=" + bJwpoints + ", gLonx=" + gLonx
197 197 + ", gLaty=" + gLaty + ", isHaveLed=" + isHaveLed + ", isHaveShelter="
198 198 + isHaveShelter + ", isHarbourStation=" + isHarbourStation + ", descriptions=" + descriptions
199 199 + ", createBy=" + createBy + ", updateBy=" + updateBy + ", createDate=" + createDate + ", updateDate="
... ...
src/main/java/com/bsth/entity/geo_data/GeoStation.java
... ... @@ -25,6 +25,10 @@ public class GeoStation {
25 25  
26 26 private Integer versions;
27 27  
  28 + private String distances;
  29 +
  30 + private Integer to_time;
  31 +
28 32 private Float gLonx;
29 33  
30 34 private Float gLaty;
... ... @@ -149,4 +153,21 @@ public class GeoStation {
149 153 public void setVersions(Integer versions) {
150 154 this.versions = versions;
151 155 }
  156 +
  157 +
  158 + public void setDistances(String distances) {
  159 + this.distances = distances;
  160 + }
  161 +
  162 + public void setTo_time(Integer to_time) {
  163 + this.to_time = to_time;
  164 + }
  165 +
  166 + public String getDistances() {
  167 + return distances;
  168 + }
  169 +
  170 + public Integer getTo_time() {
  171 + return to_time;
  172 + }
152 173 }
153 174 \ No newline at end of file
... ...
src/main/java/com/bsth/repository/LsSectionRouteRepository.java
1 1 package com.bsth.repository;
2 2  
3   -import java.util.List;
4   -
  3 +import com.bsth.entity.LsSectionRoute;
5 4 import org.springframework.data.jpa.repository.Modifying;
6 5 import org.springframework.data.jpa.repository.Query;
7 6 import org.springframework.stereotype.Repository;
8 7  
9   -import com.bsth.entity.LsSectionRoute;
  8 +import java.util.List;
10 9  
11 10 /**
12 11 *
... ... @@ -44,4 +43,8 @@ public interface LsSectionRouteRepository extends BaseRepository&lt;LsSectionRoute,
44 43 @Modifying
45 44 @Query(value="UPDATE bsth_c_ls_sectionroute set destroy = 1 where line = ?1 and directions = ?2 and versions=?3", nativeQuery=true)
46 45 public void batchDestroy(Integer sectionRouteLine, Integer directions, Integer versions);
  46 +
  47 + @Modifying
  48 + @Query(value="UPDATE bsth_c_ls_sectionroute set sectionroute_code = (sectionroute_code+100) where line_code = ?1 and directions = ?2 and sectionroute_code >=?3 and destroy = 0", nativeQuery=true)
  49 + public void sectionUpdSectionRouteCode(String lineCode,Integer dir,Integer routeCod);
47 50 }
... ...
src/main/java/com/bsth/repository/LsStationRouteRepository.java
... ... @@ -70,4 +70,9 @@ public interface LsStationRouteRepository extends BaseRepository&lt;LsStationRoute,
70 70 "ORDER BY " +
71 71 "lineCode,directions,stationRouteCode")
72 72 List<Map<String, String>> findLineWithLineCode4Ygc(String lineCode,Integer lineVersion);
  73 +
  74 +
  75 + @Modifying
  76 + @Query(value="update bsth_c_ls_stationroute set distances =?2 where id = ?1 ", nativeQuery=true)
  77 + public void upddis(Integer id,Double dis);
73 78 }
... ...
src/main/java/com/bsth/repository/StationRouteCacheRepository.java
... ... @@ -81,7 +81,7 @@ public interface StationRouteCacheRepository extends BaseRepository&lt;StationRoute
81 81 "ST_AsText(r.g_polygon_grid) AS stationGPloyonGrid," +
82 82 "ST_AsText(r.b_polygon_grid) AS stationBPolyonGrid," +
83 83 "b.id AS 'station.id'," +
84   - "b.code AS 'station.stationCod'," +
  84 + "b.station_code AS 'station.stationCod'," +
85 85 "b.db_type AS 'station.dbType'," +
86 86 "b.b_jwpoints AS 'station.bJwpoints'," +
87 87 "b.g_lonx AS 'station.gLonx'," +
... ...
src/main/java/com/bsth/repository/StationRouteRepository.java
... ... @@ -55,7 +55,7 @@ public interface StationRouteRepository extends BaseRepository&lt;StationRoute, Int
55 55 "a.stationGPloyonGrid, " +
56 56 "a.stationBPolyonGrid," +
57 57 "b.id AS 'station.id'," +
58   - "b.code AS 'station.stationCod'," +
  58 + "b.station_code AS 'station.stationCod'," +
59 59 "b.db_type AS 'station.dbType'," +
60 60 "b.b_jwpoints AS 'station.bJwpoints'," +
61 61 "b.g_lonx AS 'station.gLonx'," +
... ... @@ -106,22 +106,22 @@ public interface StationRouteRepository extends BaseRepository&lt;StationRoute, Int
106 106 /**
107 107 * @Description :TODO(查询下个站点)
108 108 *
109   - * @param map <lineId:线路ID; direction:方向;stationRouteCode:站点编码>
  109 + * @param map <lineCode:线路编码; direction:方向;stationRouteCode:站点编码>
110 110 *
111 111 * @return List<Map<String, Object>>
112 112 */
113 113 @Query(value = "SELECT a.stationRouteName," +
114 114 " a.stationRouteId, "+
115   - " b.code AS stationCode," +
  115 + " b.station_code AS stationCode," +
116 116 " b.b_jwpoints AS stationJwpoints," +
117 117 " b.g_lonx AS stationGlonx," +
118 118 " b.g_laty AS stationGlaty" +
119 119 " FROM ( SELECT s.id AS stationRouteId," +
120   - " s.station_name AS stationRouteName FROM bsth_c_stationroute s WHERE s.station_route_code =(" +
121   - "select MIN(station_route_code) as stationRouteCode from bsth_c_stationroute r WHERE " +
122   - "r.line=?1 and r.directions =?2 and station_route_code > ?3 and r.destroy = 0 ) and s.line=?1 and s.directions = ?2 AND s.destroy = 0) a " +
123   - " LEFT JOIN bsth_c_station b ON a.stationRouteStation = b.id", nativeQuery=true)
124   - List<Object[]> findDownStationRoute(Integer id,Integer direction,Integer stationRouteCode);
  120 + " s.station_name AS stationRouteName, s.station AS stationId FROM bsth_c_ls_stationroute s WHERE s.station_route_code =(" +
  121 + "select MIN(station_route_code) as stationRouteCode from bsth_c_ls_stationroute r WHERE " +
  122 + "r.line_code=?1 and r.directions =?2 and station_route_code > ?3 and r.destroy = 0 ) and s.line_code=?1 and s.directions = ?2 AND s.destroy = 0) a " +
  123 + " LEFT JOIN bsth_c_station b ON a.stationId = b.id", nativeQuery=true)
  124 + List<Object[]> findDownStationRoute(String lineCode,Integer direction,Integer stationRouteCode);
125 125  
126 126 /**
127 127 * @Description :TODO(站点中心点坐标查询)
... ... @@ -163,7 +163,7 @@ public interface StationRouteRepository extends BaseRepository&lt;StationRoute, Int
163 163 "b.g_laty,b.b_jwpoints," +
164 164 "a.station_mark," +
165 165 "a.station_route_code," +
166   - "b.code," +
  166 + "b.station_code," +
167 167 "a.distances,"+
168 168 "b.station_name," +
169 169 "a.directions FROM (SELECT " +
... ... @@ -203,7 +203,7 @@ public interface StationRouteRepository extends BaseRepository&lt;StationRoute, Int
203 203 " a.stationRadius," +
204 204 " a.stationShapesType," +
205 205 " b.id AS stationId," +
206   - " b.code AS stationCode," +
  206 + " b.station_code AS stationCode," +
207 207 " b.db_type AS stationDbType," +
208 208 " b.b_jwpoints AS stationJwpoints," +
209 209 " b.g_lonx AS stationGlonx," +
... ... @@ -259,7 +259,7 @@ public interface StationRouteRepository extends BaseRepository&lt;StationRoute, Int
259 259 " a.stationRadius," +
260 260 " a.stationShapesType," +
261 261 " b.id AS stationId," +
262   - " b.code AS stationCode," +
  262 + " b.station_code AS stationCode," +
263 263 " b.db_type AS stationDbType," +
264 264 " b.b_jwpoints AS stationJwpoints," +
265 265 " b.g_lonx AS stationGlonx," +
... ...
src/main/java/com/bsth/service/LsSectionRouteService.java 0 → 100644
  1 +package com.bsth.service;
  2 +
  3 +import com.bsth.entity.LsSectionRoute;
  4 +
  5 +import java.util.Map;
  6 +
  7 +/**
  8 + *
  9 + * @Interface: SectionRouteService(路段路由service业务层实现接口)
  10 + *
  11 + * @extends : BaseService
  12 + *
  13 + * @Description: TODO(路段路由service业务层实现接口)
  14 + *
  15 + * @Author YRF
  16 + *
  17 + */
  18 +public interface LsSectionRouteService extends BaseService<LsSectionRoute, Integer> {
  19 +
  20 + Map<String,Object> doubleName(Map<String, Object> map);
  21 +}
... ...
src/main/java/com/bsth/service/LsStationRouteService.java 0 → 100644
  1 +package com.bsth.service;
  2 +
  3 +import com.bsth.entity.LsStationRoute;
  4 +
  5 +import java.util.Map;
  6 +
  7 +/**
  8 + *
  9 + * @Interface: StationRouteService(站点路由service业务层实现接口)
  10 + *
  11 + * @Extends : BaseService
  12 + *
  13 + * @Description: TODO(站点路由service业务层实现接口)
  14 + *
  15 + * @Author YRF
  16 + *
  17 + */
  18 +public interface LsStationRouteService extends BaseService<LsStationRoute, Integer> {
  19 +
  20 + Map<String, Object> upddis(Map<String, Object> map);
  21 +}
... ...
src/main/java/com/bsth/service/geo_data/GeoDataService.java
... ... @@ -13,6 +13,7 @@ public interface GeoDataService {
13 13  
14 14 Map<String, Object> findGeoStations(String lineCode, Integer version);
15 15  
  16 + Map<String, Object> findGeoStations(String lineCode, Integer version, Integer dir);
16 17  
17 18 Map<String, Object> findGeoRoad(String lineCode,Integer version);
18 19  
... ... @@ -39,4 +40,8 @@ public interface GeoDataService {
39 40 Map<String,Object> findFutureVersion(String lineCode);
40 41  
41 42 Map<String,Object> addEnableInfo(String lineCode, int version, String enableTime);
  43 +
  44 + Map<String,Object> batchDestroyLsStationRout(String ids, String lineCode, int upDown, int versions);
  45 +
  46 + Map<String,Object> batchDestroyLsSectionRout(String ids, String lineCode, int upDown, int versions);
42 47 }
... ...
src/main/java/com/bsth/service/geo_data/impl/GeoDataServiceImpl.java
... ... @@ -55,7 +55,48 @@ public class GeoDataServiceImpl implements GeoDataService {
55 55 if(null == version)
56 56 version = currentVersion;
57 57  
58   - sql = "select t1.*,t2.g_lonx,g_laty,ST_AsText(g_polygon_grid) as g_polygon_grid,radius,shapes_type from (select id,station_name,station_route_code,line_code,station_code,station_mark,versions,directions from bsth_c_ls_stationroute where line=" + lineCode + " and destroy=0 and versions="+version+") t1 LEFT JOIN bsth_c_station t2 on t1.station_code=t2.code";
  58 + sql = "select t1.*,t2.g_lonx,g_laty from " +
  59 + "(select id,station_name,station_route_code,line_code,station_code,station_mark,versions,directions,to_time,distances,ST_AsText(g_polygon_grid) as g_polygon_grid,radius,shapes_type from " +
  60 + "bsth_c_ls_stationroute where line=" + lineCode + " and destroy=0 and versions="+version+") t1 LEFT JOIN " +
  61 + "bsth_c_station t2 on t1.station_code=t2.station_code order by t1.directions, t1.station_route_code";
  62 +
  63 +
  64 + List<GeoStation> list = jdbcTemplate.query(sql, BeanPropertyRowMapper.newInstance(GeoStation.class));
  65 +
  66 + for (GeoStation station : list) {
  67 + if (station.getShapesType().equals("d"))
  68 + station.setBdCoords(multiWgsToBd(station.getgPolygonGrid(), 9, 3));
  69 + }
  70 + map.put("status", ResponseCode.SUCCESS);
  71 + map.put("list", list);
  72 + map.put("currentVersion", currentVersion);
  73 + map.put("editVersion", version);
  74 + } catch (Exception e) {
  75 + logger.error("", e);
  76 + map.put("status", ResponseCode.ERROR);
  77 + map.put("msg", "服务器出现异常");
  78 + }
  79 + return map;
  80 + }
  81 +
  82 + @Override
  83 + public Map<String, Object> findGeoStations(String lineCode, Integer version, Integer dir) {
  84 +
  85 + Map<String, Object> map = new HashMap();
  86 + try {
  87 +
  88 + String sql = "select versions from bsth_c_line_versions where line='"+lineCode+"' and status=1";
  89 + //当前使用的线路版本
  90 + Integer currentVersion = jdbcTemplate.queryForObject(sql, Integer.class);
  91 +
  92 +
  93 + if(null == version)
  94 + version = currentVersion;
  95 +
  96 + sql = "select t1.*,t2.g_lonx,g_laty from " +
  97 + "(select id,station_name,station_route_code,line_code,station_code,station_mark,versions,directions,distances,to_time,ST_AsText(g_polygon_grid) as g_polygon_grid,radius,shapes_type from " +
  98 + "bsth_c_ls_stationroute where line=" + lineCode + " and destroy=0 and versions="+version+" and directions="+dir+") t1 LEFT JOIN " +
  99 + "bsth_c_station t2 on t1.station_code=t2.station_code order by t1.station_route_code";
59 100  
60 101  
61 102 List<GeoStation> list = jdbcTemplate.query(sql, BeanPropertyRowMapper.newInstance(GeoStation.class));
... ... @@ -127,17 +168,17 @@ public class GeoDataServiceImpl implements GeoDataService {
127 168  
128 169 String sql;
129 170 String shapesType = station.getShapesType();
130   - int rsCount = -1;
  171 + int rsCount = -1,rsCount2 =-1;
131 172 if (shapesType.equals("r")) {
132   - sql = "update bsth_c_station set g_lonx=?, g_laty=?, radius=?,shapes_type='r' where code=?";
133   - rsCount = jdbcTemplate.update(sql, station.getgLonx(), station.getgLaty(), station.getRadius(), station.getStationCode());
  173 + sql = "update bsth_c_station s, bsth_c_ls_stationroute r set s.g_lonx=?, s.g_laty=?,r.shapes_type='r', r.radius=? where s.id = r.station and r.id=?";
  174 + rsCount = jdbcTemplate.update(sql, station.getgLonx(), station.getgLaty(), station.getRadius(), station.getId());
134 175 } else if (shapesType.equals("d")) {
135 176 //多边形坐标转换
136 177 String bdPolygon = "POLYGON((" + station.getgPolygonGrid() + "))";
137 178 String wgsPolygon = "POLYGON((" + bdPolygon2Wgs(station.getgPolygonGrid()) + "))";
138   - sql = "update bsth_c_station set g_lonx=?, g_laty=?,shapes_type='d', radius=null,b_polygon_grid=ST_GeomFromText('" + bdPolygon + "'),g_polygon_grid=ST_GeomFromText('" + wgsPolygon + "') where code=?";
  179 + sql = "update bsth_c_station s, bsth_c_ls_stationroute r set s.g_lonx=?, s.g_laty=?,r.shapes_type='d', r.radius=null,r.b_polygon_grid=ST_GeomFromText('" + bdPolygon + "'),g_polygon_grid=ST_GeomFromText('" + wgsPolygon + "') where s.id = r.station and r.id=?";
139 180  
140   - rsCount = jdbcTemplate.update(sql, station.getgLonx(), station.getgLaty(), station.getStationCode());
  181 + rsCount = jdbcTemplate.update(sql, station.getgLonx(), station.getgLaty(), station.getId());
141 182 }
142 183  
143 184 //从数据库里重新查询对象
... ... @@ -211,7 +252,7 @@ public class GeoDataServiceImpl implements GeoDataService {
211 252 //根据线路编码,查询线路ID
212 253 int lineId = jdbcTemplate.queryForObject("select id from bsth_c_line where line_code=" + lineCode, Integer.class);
213 254  
214   - String sql = "select * from bsth_c_ls_sectionroute where line_code='" + lineCode + "' and line=" + lineId + " and directions=" + upDown + " and destroy=0 and versions=" + versions;
  255 + String sql = "select * from bsth_c_ls_sectionroute where line_code='" + lineCode + "' and line=" + lineId + " and directions=" + upDown + " and destroy=0 and versions=" + versions+ " order by sectionroute_code";
215 256 List<SaveRoadRouteDTO> routes = jdbcTemplate.query(sql, BeanPropertyRowMapper.newInstance(SaveRoadRouteDTO.class));
216 257  
217 258 Collections.sort(routes, new RoadRouteComp());
... ... @@ -261,11 +302,14 @@ public class GeoDataServiceImpl implements GeoDataService {
261 302 srr.setCreateDate(d);
262 303 srr.setUpdateDate(d);
263 304  
264   - final List<SaveRoadRouteDTO> saveList = routes;
265 305 //insert 新路由 (ID自增)
266 306 jdbcTemplate.update("insert into bsth_c_ls_sectionroute(line_code, section_code, sectionroute_code, directions, line, section, create_date,update_date,versions,destroy,is_roade_speed)" +
267 307 " values(?,?,?,?,?,?,?,?,?,?,?)", srr.getLineCode(), srr.getSectionCode(), srr.getSectionrouteCode(), srr.getDirections(), srr.getLine(), srr.getSection(), srr.getCreateDate(), srr.getUpdateDate(), versions, srr.getDestroy(), srr.getIsRoadeSpeed());
268 308  
  309 + // 插入数据之后再查询一次
  310 +// routes = jdbcTemplate.query(sql, BeanPropertyRowMapper.newInstance(SaveRoadRouteDTO.class));
  311 + final List<SaveRoadRouteDTO> saveList = routes;
  312 +
269 313 // update 原路由
270 314 jdbcTemplate.batchUpdate("update bsth_c_ls_sectionroute set sectionroute_code=? where id=?"
271 315 , new BatchPreparedStatementSetter() {
... ... @@ -284,8 +328,7 @@ public class GeoDataServiceImpl implements GeoDataService {
284 328  
285 329  
286 330 //写一条走向变更记录
287   - jdbcTemplate.update("insert into logger_route_synchro(t, line_code, version) values(?, ?, ?)", System.currentTimeMillis(), lineCode, versions);
288   -
  331 +// jdbcTemplate.update("insert into logger_route_synchro(t, line_code, version) values(?, ?, ?)", System.currentTimeMillis(), lineCode, versions);
289 332 tran.commit(status);
290 333  
291 334 //返回更新之后的数据
... ... @@ -385,7 +428,7 @@ public class GeoDataServiceImpl implements GeoDataService {
385 428  
386 429 if (extendsVersion != -1) {
387 430 //复制站点信息
388   - String sql = "SELECT t1.id AS route_id,t1.line,t1.directions,t1.station,t1.station_name,t1.station_route_code,t1.line_code,t1.station_code,t1.station_mark,t1.distances,t1.to_time,t2.id AS station_id,t2.db_type,t2.b_jwpoints,t2.g_lonx,t2.g_laty,t2.radius,ST_AsText(t2.g_polygon_grid) as g_polygon_grid,t2.shapes_type FROM bsth_c_ls_stationroute t1 LEFT JOIN bsth_c_station t2 ON t1.station_code = t2.code where t1.destroy=0 and t1.line_code='" + lineCode + "' and t1.versions="+extendsVersion+" order by t1.directions, t1.station_route_code";
  431 + String sql = "SELECT t1.id AS route_id,t1.line,t1.directions,t1.station,t1.station_name,t1.station_route_code,t1.line_code,t1.station_code,t1.station_mark,t1.distances,t1.to_time,t2.id AS station_id,t2.db_type,t2.b_jwpoints,t2.g_lonx,t2.g_laty,t1.radius,ST_AsText(t1.g_polygon_grid) as g_polygon_grid,t1.shapes_type FROM bsth_c_ls_stationroute t1 LEFT JOIN bsth_c_station t2 ON t1.station_code = t2.station_code where t1.destroy=0 and t1.line_code='" + lineCode + "' and t1.versions="+extendsVersion+" order by t1.directions, t1.station_route_code";
389 432 List<CascadeSaveStation> cssList = jdbcTemplate.query(sql, BeanPropertyRowMapper.newInstance(CascadeSaveStation.class));
390 433  
391 434 //新的站点编码
... ... @@ -592,23 +635,17 @@ public class GeoDataServiceImpl implements GeoDataService {
592 635 */
593 636 private void batchInsertStation(final List<CascadeSaveStation> cssList, final int version) {
594 637 //站点
595   - jdbcTemplate.batchUpdate("insert into bsth_c_station(id, code, station_name, db_type, b_jwpoints, g_lonx, g_laty, destroy, radius, shapes_type, versions, g_polygon_grid) " +
  638 + jdbcTemplate.batchUpdate("insert into bsth_c_station(id, code, db_type, b_jwpoints, g_lonx, g_laty) " +
596 639 " values(?,?,?,?,?,?,?,?,?,?,?,ST_GeomFromText(?))", new BatchPreparedStatementSetter() {
597 640 @Override
598 641 public void setValues(PreparedStatement ps, int i) throws SQLException {
599 642 CascadeSaveStation ss = cssList.get(i);
600 643 ps.setInt(1, ss.getStation());
601 644 ps.setString(2, ss.getStationCode());
602   - ps.setString(3, ss.getStationName());
603   - ps.setString(4, "b");
604   - ps.setString(5, ss.getbJwpoints());
605   - ps.setDouble(6, ss.getgLonx());
606   - ps.setDouble(7, ss.getgLaty());
607   - ps.setInt(8, 0);
608   - ps.setInt(9, ss.getRadius()==null?0:ss.getRadius());
609   - ps.setString(10, ss.getShapesType());
610   - ps.setInt(11, version);
611   - ps.setString(12, ss.getgPolygonGrid());
  645 + ps.setString(3, "b");
  646 + ps.setString(4, ss.getbJwpoints());
  647 + ps.setDouble(5, ss.getgLonx());
  648 + ps.setDouble(6, ss.getgLaty());
612 649 }
613 650  
614 651 @Override
... ... @@ -619,7 +656,7 @@ public class GeoDataServiceImpl implements GeoDataService {
619 656  
620 657 final Date d = new Date();
621 658 //站点路由
622   - jdbcTemplate.batchUpdate("insert into bsth_c_ls_stationroute(line, station, station_name, station_route_code, line_code, station_code, station_mark, distances, to_time, destroy, versions, create_date, update_date,directions) " +
  659 + jdbcTemplate.batchUpdate("insert into bsth_c_ls_stationroute(line, station, station_name, station_route_code, line_code, station_code, station_mark, distances, to_time, destroy, versions, create_date, update_date,directions, radius, shapes_type, g_polygon_grid) " +
623 660 " values(?,?,?,?,?,?,?,?,?,?,?,?,?,?)", new BatchPreparedStatementSetter() {
624 661 @Override
625 662 public void setValues(PreparedStatement ps, int i) throws SQLException {
... ... @@ -638,6 +675,9 @@ public class GeoDataServiceImpl implements GeoDataService {
638 675 ps.setTimestamp(12, new java.sql.Timestamp(d.getTime()));
639 676 ps.setTimestamp(13, new java.sql.Timestamp(d.getTime()));
640 677 ps.setInt(14, ss.getDirections());
  678 + ps.setInt(15, ss.getRadius()==null?0:ss.getRadius());
  679 + ps.setString(16, ss.getShapesType());
  680 + ps.setString(17, ss.getgPolygonGrid());
641 681 }
642 682  
643 683 @Override
... ... @@ -660,7 +700,7 @@ public class GeoDataServiceImpl implements GeoDataService {
660 700 //根据线路编码,查询线路ID
661 701 int lineId = jdbcTemplate.queryForObject("select id from bsth_c_line where line_code=" + lineCode, Integer.class);
662 702  
663   - String sql = "select * from bsth_c_ls_stationroute where line_code='" + lineCode + "' and line=" + lineId + " and directions=" + upDown + " and destroy=0 and versions=" + versions;
  703 + String sql = "select * from bsth_c_ls_stationroute where line_code='" + lineCode + "' and line=" + lineId + " and directions=" + upDown + " and destroy=0 and versions=" + versions +" order by station_route_code";
664 704 List<SaveStationRouteDTO> routes = jdbcTemplate.query(sql, BeanPropertyRowMapper.newInstance(SaveStationRouteDTO.class));
665 705  
666 706 for (SaveStationRouteDTO s : routes) {
... ... @@ -735,12 +775,13 @@ public class GeoDataServiceImpl implements GeoDataService {
735 775 if(routes.size() > 1)
736 776 routes.get(routes.size() - 1).setStationMark("E");
737 777  
738   - final List<SaveStationRouteDTO> saveList = routes;
739 778 //insert 新路由 (ID自增)
740   - jdbcTemplate.update("insert into bsth_c_ls_stationroute(line, station, station_name, station_route_code, line_code, station_code, station_mark, distances, to_time, destroy, versions, create_date, update_date,directions) values(?,?,?,?,?,?,?,?,?,?,?,?,?,?)"
741   - , nsr.getLine(), nsr.getStation(), nsr.getStationName(), nsr.getStationRouteCode(), nsr.getLineCode(), nsr.getStationCode(), nsr.getStationMark()
742   - , nsr.getDistances(), nsr.getToTime(), nsr.getDestroy(), nsr.getVersions(), nsr.getCreateDate(), nsr.getUpdateDate(), nsr.getDirections());
  779 + jdbcTemplate.update("insert into bsth_c_ls_stationroute(line, station, station_name, station_route_code, line_code, station_code, station_mark, distances, to_time, destroy, versions, create_date, update_date,directions, radius, shapes_type) values(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)"
  780 + , nsr.getLine(), nsr.getStation(), nsr.getStationName(), nsr.getStationRouteCode(), nsr.getLineCode(), nsr.getStationCode(), "Z"
  781 + , nsr.getDistances(), nsr.getToTime(), nsr.getDestroy(), nsr.getVersions(), nsr.getCreateDate(), nsr.getUpdateDate(), nsr.getDirections(),80,"r");
  782 +
743 783  
  784 + final List<SaveStationRouteDTO> saveList = jdbcTemplate.query(sql, BeanPropertyRowMapper.newInstance(SaveStationRouteDTO.class));
744 785 // update 原路由
745 786 jdbcTemplate.batchUpdate("update bsth_c_ls_stationroute set line=?,station=?,station_name=?,station_route_code=?," +
746 787 "line_code=?,station_code=?,station_mark=?,distances=?,to_time=?,destroy=?,versions=?,create_date=?,update_date=?,directions=?" +
... ... @@ -749,13 +790,19 @@ public class GeoDataServiceImpl implements GeoDataService {
749 790 @Override
750 791 public void setValues(PreparedStatement ps, int i) throws SQLException {
751 792 SaveStationRouteDTO sr = saveList.get(i);
  793 + String stationMark = "Z";
  794 + if(i == 0) {
  795 + stationMark = "B";
  796 + } else if(i == saveList.size()-1) {
  797 + stationMark = "E";
  798 + }
752 799 ps.setInt(1, sr.getLine());
753 800 ps.setLong(2, sr.getStation());
754 801 ps.setString(3, sr.getStationName());
755 802 ps.setInt(4, sr.getStationRouteCode());
756 803 ps.setString(5, sr.getLineCode());
757 804 ps.setString(6, sr.getStationCode());
758   - ps.setString(7, sr.getStationMark());
  805 + ps.setString(7, stationMark);
759 806 ps.setDouble(8, sr.getDistances());
760 807 ps.setDouble(9, sr.getToTime());
761 808 ps.setInt(10, sr.getDestroy());
... ... @@ -794,7 +841,7 @@ public class GeoDataServiceImpl implements GeoDataService {
794 841  
795 842 private List<GeoStation> findByUpdown(String lineCode, int upDown, int versions) {
796 843 //返回更新之后的数据
797   - String sql = "select t1.*,t2.g_lonx,g_laty,ST_AsText(g_polygon_grid) as g_polygon_grid,radius,shapes_type from (select id,station_name,station_route_code,line_code,station_code,station_mark,versions,directions from bsth_c_ls_stationroute where line=" + lineCode + " and directions=" + upDown + " and destroy=0 and versions=" + versions + ") t1 LEFT JOIN bsth_c_station t2 on t1.station_code=t2.code";
  844 + String sql = "select t1.*,t2.g_lonx,g_laty from (select id,station_name,station_route_code,line_code,station_code,station_mark,versions,directions,ST_AsText(g_polygon_grid) as g_polygon_grid,radius,shapes_type from bsth_c_ls_stationroute where line=" + lineCode + " and directions=" + upDown + " and destroy=0 and versions=" + versions + ") t1 LEFT JOIN bsth_c_station t2 on t1.station_code=t2.station_code";
798 845 List<GeoStation> list = jdbcTemplate.query(sql, BeanPropertyRowMapper.newInstance(GeoStation.class));
799 846  
800 847 for (GeoStation station : list) {
... ... @@ -804,11 +851,38 @@ public class GeoDataServiceImpl implements GeoDataService {
804 851 return list;
805 852 }
806 853  
807   - private List<GeoRoad> findRoadByUpdown(String lineCode, int upDown, int versions) {
  854 + public List<GeoRoad> findRoadByUpdown(String lineCode, int upDown, int versions) {
  855 +
  856 + String sql = "select * from bsth_c_ls_sectionroute where line_code='" + lineCode + "' and directions=" + upDown + " and destroy=0 and versions=" + versions+ " order by sectionroute_code";
  857 + final List<SaveRoadRouteDTO> saveList = jdbcTemplate.query(sql, BeanPropertyRowMapper.newInstance(SaveRoadRouteDTO.class));
  858 +
  859 +// final List<SaveRoadRouteDTO> saveList = section;
  860 + // update 原路由
  861 + jdbcTemplate.batchUpdate("update bsth_c_ls_sectionroute set sectionroute_code=? where id=?"
  862 + , new BatchPreparedStatementSetter() {
  863 + @Override
  864 + public void setValues(PreparedStatement ps, int i) throws SQLException {
  865 + SaveRoadRouteDTO srr = saveList.get(i);
  866 + ps.setInt(1, (i+1)*100);
  867 + ps.setInt(2, srr.getId());
  868 + }
  869 +
  870 + @Override
  871 + public int getBatchSize() {
  872 + return saveList.size();
  873 + }
  874 + });
  875 +
  876 +
  877 + //写一条走向变更记录
  878 + jdbcTemplate.update("insert into logger_route_synchro(t, line_code, version) values(?, ?, ?)", System.currentTimeMillis(), lineCode, versions);
  879 +
  880 +
808 881 //返回更新之后的数据
809   - String sql = "select t1.*,t2.section_name,t2.croses_road,ST_AsText(t2.gsection_vector) as gsection_vector from (select id,sectionroute_code,directions,line_code,section_code,versions from bsth_c_ls_sectionroute where line='" + lineCode + "' and directions=" + upDown + " and destroy=0 and versions=" + versions + ") t1 LEFT JOIN bsth_c_section t2 on t1.section_code=t2.section_code";
  882 + sql = "select t1.*,t2.section_name,t2.croses_road,ST_AsText(t2.gsection_vector) as gsection_vector from (select id,sectionroute_code,directions,line_code,section_code,versions from bsth_c_ls_sectionroute where line='" + lineCode + "' and directions=" + upDown + " and destroy=0 and versions=" + versions + ") t1 LEFT JOIN bsth_c_section t2 on t1.section_code=t2.section_code";
810 883 List<GeoRoad> list = jdbcTemplate.query(sql, BeanPropertyRowMapper.newInstance(GeoRoad.class));
811 884  
  885 +
812 886 for (GeoRoad road : list) {
813 887 road.setBdCoords(multiWgsToBd(road.getGsectionVector(), 11, 2));
814 888 }
... ... @@ -861,13 +935,19 @@ public class GeoDataServiceImpl implements GeoDataService {
861 935 @Override
862 936 public void setValues(PreparedStatement ps, int i) throws SQLException {
863 937 SaveStationRouteDTO sr = saveList.get(i);
  938 + String stationMark = "Z";
  939 + if(i == 0) {
  940 + stationMark = "B";
  941 + } else if(i == saveList.size()-1) {
  942 + stationMark = "E";
  943 + }
864 944 ps.setInt(1, sr.getLine());
865 945 ps.setLong(2, sr.getStation());
866 946 ps.setString(3, sr.getStationName());
867 947 ps.setInt(4, sr.getStationRouteCode());
868 948 ps.setString(5, sr.getLineCode());
869 949 ps.setString(6, sr.getStationCode());
870   - ps.setString(7, sr.getStationMark());
  950 + ps.setString(7, stationMark);
871 951 ps.setDouble(8, sr.getDistances());
872 952 ps.setDouble(9, sr.getToTime());
873 953 ps.setInt(10, sr.getDestroy());
... ... @@ -951,6 +1031,156 @@ public class GeoDataServiceImpl implements GeoDataService {
951 1031 return rs;
952 1032 }
953 1033  
  1034 + /**
  1035 + * 批量撤销历史站点路由
  1036 + * @param ids 历史站点路由Id字符串
  1037 + * @return
  1038 + */
  1039 + @Override
  1040 + public Map<String,Object> batchDestroyLsStationRout(String ids, String lineCode, int upDown, int versions){
  1041 + Map<String, Object> rs = new HashMap<>();
  1042 +
  1043 + //编程式事务
  1044 + DataSourceTransactionManager tran = new DataSourceTransactionManager(jdbcTemplate.getDataSource());
  1045 + DefaultTransactionDefinition def = new DefaultTransactionDefinition();
  1046 + def.setPropagationBehavior(TransactionDefinition.PROPAGATION_REQUIRED);
  1047 + TransactionStatus status = tran.getTransaction(def);
  1048 +
  1049 + try {
  1050 + final String id[] = ids.split(",");
  1051 + jdbcTemplate.batchUpdate("update bsth_c_ls_stationroute set destroy=1 where id=?"
  1052 + , new BatchPreparedStatementSetter() {
  1053 + @Override
  1054 + public void setValues(PreparedStatement ps, int i) throws SQLException {
  1055 + ps.setInt(1, Integer.parseInt(id[i]));
  1056 + }
  1057 +
  1058 + @Override
  1059 + public int getBatchSize() {
  1060 + return id.length;
  1061 + }
  1062 + });
  1063 +
  1064 + /**
  1065 + * ########## 重新排序路由,标记mark #########
  1066 + */
  1067 + String sql = "select * from bsth_c_ls_stationroute where line_code='" + lineCode + "' and directions=" + upDown + " and destroy=0 and versions=" + versions;
  1068 + List<SaveStationRouteDTO> routes = jdbcTemplate.query(sql, BeanPropertyRowMapper.newInstance(SaveStationRouteDTO.class));
  1069 + Collections.sort(routes, new StationRouteComp());
  1070 +
  1071 + int no = 0,
  1072 + step = 100;
  1073 + SaveStationRouteDTO sr;
  1074 + //重新排序路由
  1075 + for (int i = 0, size = routes.size(); i < size; i++) {
  1076 + sr = routes.get(i);
  1077 + sr.setStationRouteCode(no += step);
  1078 + }
  1079 +
  1080 + for (int i = 0, size = routes.size(); i < size; i++) {
  1081 + routes.get(i).setStationMark("Z");
  1082 + }
  1083 + if(routes.size() > 0)
  1084 + routes.get(0).setStationMark("B");
  1085 + if(routes.size() > 1)
  1086 + routes.get(routes.size() - 1).setStationMark("E");
  1087 +
  1088 + final List<SaveStationRouteDTO> saveList = routes;
  1089 + // update 原路由
  1090 + jdbcTemplate.batchUpdate("update bsth_c_ls_stationroute set line=?,station=?,station_name=?,station_route_code=?," +
  1091 + "line_code=?,station_code=?,station_mark=?,distances=?,to_time=?,destroy=?,versions=?,create_date=?,update_date=?,directions=?" +
  1092 + " where id=?"
  1093 + , new BatchPreparedStatementSetter() {
  1094 + @Override
  1095 + public void setValues(PreparedStatement ps, int i) throws SQLException {
  1096 + SaveStationRouteDTO sr = saveList.get(i);
  1097 + String stationMark = "Z";
  1098 + if(i == 0) {
  1099 + stationMark = "B";
  1100 + } else if(i == saveList.size()-1) {
  1101 + stationMark = "E";
  1102 + }
  1103 + ps.setInt(1, sr.getLine());
  1104 + ps.setLong(2, sr.getStation());
  1105 + ps.setString(3, sr.getStationName());
  1106 + ps.setInt(4, sr.getStationRouteCode());
  1107 + ps.setString(5, sr.getLineCode());
  1108 + ps.setString(6, sr.getStationCode());
  1109 + ps.setString(7, stationMark);
  1110 + ps.setDouble(8, sr.getDistances());
  1111 + ps.setDouble(9, sr.getToTime());
  1112 + ps.setInt(10, sr.getDestroy());
  1113 + ps.setInt(11, sr.getVersions());
  1114 + ps.setTimestamp(12, new java.sql.Timestamp(sr.getCreateDate().getTime()));
  1115 + ps.setTimestamp(13, new java.sql.Timestamp(sr.getUpdateDate().getTime()));
  1116 + ps.setInt(14, sr.getDirections());
  1117 + ps.setInt(15, sr.getId());
  1118 + }
  1119 +
  1120 + @Override
  1121 + public int getBatchSize() {
  1122 + return saveList.size();
  1123 + }
  1124 + });
  1125 +
  1126 + //写一条走向变更记录
  1127 + jdbcTemplate.update("insert into logger_route_synchro(t, line_code, version) values(?, ?, ?)", System.currentTimeMillis(), lineCode, versions);
  1128 +
  1129 + tran.commit(status);
  1130 +
  1131 + //返回更新之后的数据
  1132 + List<GeoStation> list = findByUpdown(lineCode, upDown, versions);
  1133 + rs.put("list", list);
  1134 + rs.put("status", ResponseCode.SUCCESS);
  1135 + } catch (Exception e) {
  1136 + tran.rollback(status);
  1137 + logger.error("", e);
  1138 + rs.put("status", ResponseCode.ERROR);
  1139 + rs.put("msg", "服务器出现异常");
  1140 + }
  1141 + return rs;
  1142 + }
  1143 +
  1144 + /**
  1145 + * 批量撤销历史路段路由
  1146 + * @param ids 历史路段路由Id字符串
  1147 + * @return
  1148 + */
  1149 + @Override
  1150 + public Map<String,Object> batchDestroyLsSectionRout(String ids, String lineCode, int upDown, int versions){
  1151 + Map<String, Object> rs = new HashMap<>();
  1152 + try {
  1153 + final String id[] = ids.split(",");
  1154 + jdbcTemplate.batchUpdate("update bsth_c_ls_sectionroute set destroy=1 where id=?"
  1155 + , new BatchPreparedStatementSetter() {
  1156 + @Override
  1157 + public void setValues(PreparedStatement ps, int i) throws SQLException {
  1158 + ps.setInt(1, Integer.parseInt(id[i]));
  1159 + }
  1160 +
  1161 + @Override
  1162 + public int getBatchSize() {
  1163 + return id.length;
  1164 + }
  1165 + });
  1166 +
  1167 +// String sql = "update bsth_c_ls_sectionroute set destroy=1 where id in (?)";
  1168 +// jdbcTemplate.update(sql, ids);
  1169 +
  1170 + //写一条走向变更记录
  1171 + jdbcTemplate.update("insert into logger_route_synchro(t, line_code, version) values(?, ?, ?)", System.currentTimeMillis(), lineCode, versions);
  1172 +
  1173 + //返回更新之后的数据
  1174 + List<GeoRoad> list = findRoadByUpdown(lineCode, upDown, versions);
  1175 + rs.put("list", list);
  1176 + rs.put("status", ResponseCode.SUCCESS);
  1177 + } catch (Exception e) {
  1178 + logger.error("", e);
  1179 + rs.put("status", ResponseCode.ERROR);
  1180 + rs.put("msg", "服务器出现异常");
  1181 + }
  1182 + return rs;
  1183 + }
954 1184  
955 1185 /**
956 1186 * 根据路由ID 获取站点
... ... @@ -959,7 +1189,7 @@ public class GeoDataServiceImpl implements GeoDataService {
959 1189 * @return
960 1190 */
961 1191 private GeoStation findOne(int id) {
962   - String sql = "SELECT t1.*, t2.g_lonx,g_laty,ST_AsText (g_polygon_grid) AS g_polygon_grid,radius,shapes_type FROM (SELECT id,station_name,station_route_code,line_code,station_code,station_mark,versions,directions FROM bsth_c_ls_stationroute WHERE id=" + id + " AND destroy = 0) t1 LEFT JOIN bsth_c_station t2 ON t1.station_code = t2.code";
  1192 + String sql = "SELECT t1.*, t2.g_lonx,g_laty FROM (SELECT id,station_name,station_route_code,line_code,station_code,station_mark,versions,directions,ST_AsText(g_polygon_grid) as g_polygon_grid,radius,shapes_type FROM bsth_c_ls_stationroute WHERE id=" + id + " AND destroy = 0) t1 LEFT JOIN bsth_c_station t2 ON t1.station_code = t2.station_code";
963 1193 List<GeoStation> list = jdbcTemplate.query(sql, BeanPropertyRowMapper.newInstance(GeoStation.class));
964 1194  
965 1195 GeoStation s = list.get(0);
... ...
src/main/java/com/bsth/service/impl/LsSectionRouteServiceImpl.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.entity.Line;
  6 +import com.bsth.entity.LsSectionRoute;
  7 +import com.bsth.entity.Section;
  8 +import com.bsth.entity.geo_data.GeoRoad;
  9 +import com.bsth.repository.LineRepository;
  10 +import com.bsth.repository.LsSectionRouteRepository;
  11 +import com.bsth.repository.SectionRepository;
  12 +import com.bsth.service.LsSectionRouteService;
  13 +import com.bsth.service.geo_data.impl.GeoDataServiceImpl;
  14 +import com.bsth.util.Geo.Point;
  15 +import com.bsth.util.GetUIDAndCode;
  16 +import com.bsth.util.RoadCutDoubleName;
  17 +import com.bsth.util.TransGPS;
  18 +import com.bsth.util.TransGPS.Location;
  19 +import org.springframework.beans.factory.annotation.Autowired;
  20 +import org.springframework.stereotype.Service;
  21 +import org.springframework.transaction.annotation.Transactional;
  22 +
  23 +import java.util.ArrayList;
  24 +import java.util.HashMap;
  25 +import java.util.List;
  26 +import java.util.Map;
  27 +
  28 +/**
  29 + *
  30 + * @ClassName: SectionRouteServiceImpl(路段路由service业务层实现类)
  31 + *
  32 + * @Extends : BaseService
  33 + *
  34 + * @Description: TODO(路段路由service业务层)
  35 + *
  36 + * @Author YRF
  37 + *
  38 + */
  39 +
  40 +@Service
  41 +public class LsSectionRouteServiceImpl extends BaseServiceImpl<LsSectionRoute, Integer> implements LsSectionRouteService {
  42 +
  43 + @Autowired
  44 + SectionRepository repository;
  45 +
  46 + @Autowired
  47 + LineRepository lineRepository;
  48 +
  49 + @Autowired
  50 + LsSectionRouteRepository lsRouteRepository;
  51 +
  52 + @Autowired
  53 + GeoDataServiceImpl geoDataServiceImpl;
  54 +
  55 + /**
  56 + * @Description :TODO(生成双路名路段)
  57 + * @param map <lineId:线路ID; route:路段信息>
  58 + * @return
  59 + */
  60 + @Override
  61 + @Transactional
  62 + public Map<String, Object> doubleName(Map<String, Object> map) {
  63 + Map<String, Object> resultMap = new HashMap<String, Object>();
  64 + try {
  65 + // 路段点List
  66 + List<Point> bPointsList = new ArrayList<>();
  67 + // 截取后的路段
  68 + List<Map<String, String>> sectionArrayList = new ArrayList<>();
  69 +// Integer lineId = Integer.parseInt(map.get("lineId").equals("") ? "" :map.get("lineId").toString());
  70 + String lineCode = map.get("lineCode").equals("") ? "" :map.get("lineCode").toString();
  71 + Integer directions = Integer.parseInt(map.get("directions").equals("") ? "" :map.get("directions").toString());
  72 + String sectionrouteCode = map.get("sectionrouteCode").equals("") ? "" :map.get("sectionrouteCode").toString();
  73 + Integer versions = Integer.parseInt(map.get("versions").equals("") ? "" :map.get("versions").toString());
  74 +// String stationRouteBegin = map.get("stationBegin").equals("") ? "" :map.get("stationBegin").toString();
  75 +// String stationRouteFinish = map.get("stationFinish").equals("") ? "" :map.get("stationFinish").toString();
  76 + String routes = map.get("route").equals("") ? "" :map.get("route").toString();
  77 + if(!routes.equals("")) {
  78 + String sectionStr = "";
  79 + // 转换成JSON数组
  80 + JSONArray sectionsArray = JSONArray.parseArray(routes);
  81 + // 遍历
  82 + for(int s = 0 ;s<sectionsArray.size();s++) {
  83 + String pointsLngStr = sectionsArray.getJSONObject(s).get("lng").toString();
  84 + String pointsLatStr = sectionsArray.getJSONObject(s).get("lat").toString();
  85 + if(s == sectionsArray.size()-1){
  86 + sectionStr += pointsLngStr+","+pointsLatStr;
  87 + } else {
  88 + sectionStr += pointsLngStr+","+pointsLatStr+";";
  89 + }
  90 + }
  91 + Map<String, Object> roads = RoadCutDoubleName.start(sectionStr);
  92 + if (!roads.isEmpty()) {
  93 + List bSectionList = (List) roads.get("bSections");
  94 + List roadName = (List) roads.get("roadName");
  95 + // 路段序号
  96 + Integer routeCode = 0;
  97 + if(!sectionrouteCode.equals("")){
  98 + String sectionrouteCodeArray[] = sectionrouteCode.split("_");
  99 + routeCode = Integer.valueOf(sectionrouteCodeArray[0])+1;
  100 + }else {
  101 + routeCode = 1;
  102 + }
  103 + // 增加路段序号
  104 +
  105 + for(int i = 0; i < bSectionList.size(); i++){
  106 + List<TransGPS.Location> bSection = new ArrayList<>();
  107 + bSectionList.get(i);
  108 + bSection = (List<TransGPS.Location>) bSectionList.get(i);
  109 +
  110 + String sectionsBpoints = "";
  111 + // WGS线状图形坐标集合
  112 + String sectionsWJPpoints = "";
  113 + for (int j = 0; j < bSection.size(); j++) {
  114 + bSection.get(j);
  115 + TransGPS.Location point = bSection.get(j);
  116 + String pointsLngStr = String.valueOf(point.getLng());
  117 + String pointsLatStr = String.valueOf(point.getLat());
  118 + /** to WGS坐标 */
  119 + TransGPS.Location resultPoint = FromBDPointToWGSPoint(pointsLngStr,pointsLatStr);
  120 + String WGSLngStr = String.valueOf(resultPoint.getLng());
  121 + String WGSLatStr = String.valueOf(resultPoint.getLat());
  122 + if(j == 0) {
  123 + sectionsBpoints = pointsLngStr + " " + pointsLatStr;
  124 + sectionsWJPpoints = WGSLngStr + " " + WGSLatStr;
  125 + }else {
  126 + sectionsBpoints = sectionsBpoints + "," + pointsLngStr + " " + pointsLatStr;
  127 + sectionsWJPpoints = sectionsWJPpoints + "," + WGSLngStr + " " + WGSLatStr;
  128 + }
  129 + }
  130 + // 获取当前最大Id
  131 + long sectionMaxId = GetUIDAndCode.getSectionId();
  132 + // 路段编码
  133 + String sectionCode = String.valueOf(sectionMaxId);
  134 + // 路段ID
  135 + int sectionId = (int)sectionMaxId;
  136 + String sectionName = roadName.get(i).toString();
  137 + // WGS坐标点集合
  138 + String gsectionVector = null;
  139 + if(!sectionsWJPpoints.equals("")) {
  140 + gsectionVector = "LINESTRING(" + sectionsWJPpoints +")";
  141 + }
  142 + // 原坐标点集合
  143 + String bsectionVectorS = null;
  144 + if(!sectionsBpoints.equals("")) {
  145 + bsectionVectorS = "LINESTRING(" + sectionsBpoints + ")";
  146 + }
  147 + repository.systemSave(sectionCode, sectionName, null, "", "", "", gsectionVector, bsectionVectorS, "", null, "", 0, 0, "", 0, "", versions, sectionId);
  148 +
  149 + lsRouteRepository.sectionUpdSectionRouteCode(lineCode, directions,routeCode);
  150 + LsSectionRoute route = new LsSectionRoute();
  151 + List<Line> line = lineRepository.findLineByCode(lineCode);
  152 + Section section = repository.findOne(sectionId);
  153 + route.setSectionrouteCode(routeCode+i*100);
  154 + route.setLineCode(lineCode);
  155 + route.setSectionCode(sectionCode);
  156 + route.setDirections(directions);
  157 + route.setVersions(versions);
  158 + route.setDestroy(0);
  159 + route.setLine(line.get(0));
  160 + route.setSection(section);
  161 + route.setIsRoadeSpeed(0);
  162 + lsRouteRepository.save(route);
  163 + }
  164 + resultMap.put("status", ResponseCode.SUCCESS);
  165 + } else {
  166 + resultMap.put("status", "Failure");
  167 + }
  168 + }
  169 + //返回更新之后的数据
  170 + List<GeoRoad> list = geoDataServiceImpl.findRoadByUpdown(lineCode, directions, versions);
  171 + resultMap.put("list", list);
  172 +// resultMap.put("status", ResponseCode.SUCCESS);
  173 + } catch (Exception e) {
  174 + logger.error("", e);
  175 + resultMap.put("status", ResponseCode.ERROR);
  176 + resultMap.put("msg", "服务器出现异常");
  177 + }
  178 + return resultMap;
  179 + }
  180 +
  181 + /** 百度坐标转WGS坐标 */
  182 + public TransGPS.Location FromBDPointToWGSPoint(String bLonx, String bLatx) {
  183 +
  184 + double lng = Double.parseDouble(bLonx);
  185 +
  186 + double lat = Double.parseDouble(bLatx);
  187 +
  188 + Location bdLoc = TransGPS.LocationMake(lng, lat);
  189 +
  190 + Location location = TransGPS.bd_decrypt(bdLoc);
  191 +
  192 + Location WGSPoint = TransGPS.transformFromGCJToWGS(location);
  193 +
  194 + return WGSPoint;
  195 +
  196 + }
  197 +}
0 198 \ No newline at end of file
... ...
src/main/java/com/bsth/service/impl/LsStationRouteServiceImpl.java 0 → 100644
  1 +package com.bsth.service.impl;
  2 +
  3 +import com.bsth.common.ResponseCode;
  4 +import com.bsth.entity.LsStationRoute;
  5 +import com.bsth.repository.LsStationRouteRepository;
  6 +import com.bsth.service.LsStationRouteService;
  7 +import org.springframework.beans.factory.annotation.Autowired;
  8 +import org.springframework.stereotype.Service;
  9 +import org.springframework.transaction.annotation.Transactional;
  10 +
  11 +import java.util.HashMap;
  12 +import java.util.Iterator;
  13 +import java.util.Map;
  14 +
  15 +/**
  16 + *
  17 + * @ClassName: StationRouteServiceImpl(站点路由service业务层实现类)
  18 + *
  19 + * @Extends : BaseService
  20 + *
  21 + * @Description: TODO(站点路由service业务层)
  22 + *
  23 + * @Author YRF
  24 + *
  25 + */
  26 +
  27 +@Service
  28 +public class LsStationRouteServiceImpl extends BaseServiceImpl<LsStationRoute, Integer> implements LsStationRouteService {
  29 +
  30 + @Autowired
  31 + LsStationRouteRepository repository;
  32 +
  33 + @Override
  34 + @Transactional
  35 + public Map<String, Object> upddis(Map<String, Object> map) {
  36 + Map<String, Object> rs = new HashMap<>();
  37 + try{
  38 + Iterator it = map.entrySet().iterator();
  39 + while(it.hasNext()){
  40 + java.util.Map.Entry entry = (java.util.Map.Entry)it.next();
  41 + Integer id = Integer.parseInt(entry.getKey().toString().split("_")[1]); //返回对应的键
  42 + Double dis = Double.parseDouble(entry.getValue().toString()) / 1000; //返回对应的值
  43 + repository.upddis(id, dis);
  44 + }
  45 + rs.put("status", ResponseCode.SUCCESS);
  46 + }catch(Exception e){
  47 + logger.error("", e);
  48 + rs.put("status", ResponseCode.ERROR);
  49 + }
  50 + return rs;
  51 + }
  52 +}
  53 +
  54 +
  55 +
  56 +
  57 +
  58 +
  59 +
  60 +
  61 +
  62 +
  63 +
  64 +
  65 +
  66 +
  67 +
  68 +
  69 +
  70 +
  71 +
  72 +
  73 +
  74 +
  75 +
  76 +
  77 +
  78 +
  79 +
  80 +
  81 +
  82 +
  83 +
  84 +
  85 +
  86 +
  87 +
  88 +
  89 +
  90 +
  91 +
  92 +
  93 +
  94 +
  95 +
  96 +
  97 +
  98 +
  99 +
  100 +
  101 +
  102 +
  103 +
  104 +
  105 +
  106 +
  107 +
  108 +
  109 +
  110 +
  111 +
  112 +
  113 +
  114 +
  115 +
  116 +
  117 +
  118 +
  119 +
  120 +
  121 +
  122 +
  123 +
  124 +
  125 +
  126 +
  127 +
  128 +
  129 +
  130 +
  131 +
  132 +
  133 +
  134 +
  135 +
  136 +
  137 +
  138 +
  139 +
  140 +
  141 +
  142 +
  143 +
  144 +
  145 +
  146 +
  147 +
  148 +
  149 +
  150 +
  151 +
  152 +
  153 +
  154 +
  155 +
... ...
src/main/java/com/bsth/service/impl/StationRouteServiceImpl.java
... ... @@ -492,10 +492,10 @@ public class StationRouteServiceImpl extends BaseServiceImpl&lt;StationRoute, Integ
492 492 */
493 493 @Override
494 494 public Map<String, Object> findDownStationRoute(Map<String, Object> map) {
495   - Integer lineId = map.get("lineId").equals("") ? null : Integer.parseInt(map.get("lineId").toString());
  495 + String lineCode = map.get("lineCode").equals("") ? null : map.get("lineCode").toString();
496 496 Integer direction = map.get("direction").equals("") ? null : Integer.parseInt(map.get("direction").toString());
497 497 Integer stationRouteCode = map.get("stationRouteCode").equals("") ? null : Integer.parseInt(map.get("stationRouteCode").toString());
498   - List<Object[]> objects = repository.findDownStationRoute(lineId, direction, stationRouteCode);
  498 + List<Object[]> objects = repository.findDownStationRoute(lineCode, direction, stationRouteCode);
499 499 Map<String, Object> resultList = new HashMap<String,Object>();
500 500  
501 501 int len = objects.size();
... ... @@ -504,7 +504,7 @@ public class StationRouteServiceImpl extends BaseServiceImpl&lt;StationRoute, Integ
504 504 for(int i = 0 ; i < len; i++) {
505 505 resultList.put("stationRouteName", objects.get(i)[0]);
506 506 resultList.put("stationRouteId", objects.get(i)[1]);
507   - resultList.put("stationRouteCode", objects.get(i)[2]);
  507 + resultList.put("stationCode", objects.get(i)[2]);
508 508 resultList.put("stationJwpoints", objects.get(i)[3]);
509 509 }
510 510 }
... ... @@ -1291,3 +1291,106 @@ public class StationRouteServiceImpl extends BaseServiceImpl&lt;StationRoute, Integ
1291 1291 return staitonRouteList;
1292 1292 }
1293 1293 }
  1294 +
  1295 +
  1296 +
  1297 +
  1298 +
  1299 +
  1300 +
  1301 +
  1302 +
  1303 +
  1304 +
  1305 +
  1306 +
  1307 +
  1308 +
  1309 +
  1310 +
  1311 +
  1312 +
  1313 +
  1314 +
  1315 +
  1316 +
  1317 +
  1318 +
  1319 +
  1320 +
  1321 +
  1322 +
  1323 +
  1324 +
  1325 +
  1326 +
  1327 +
  1328 +
  1329 +
  1330 +
  1331 +
  1332 +
  1333 +
  1334 +
  1335 +
  1336 +
  1337 +
  1338 +
  1339 +
  1340 +
  1341 +
  1342 +
  1343 +
  1344 +
  1345 +
  1346 +
  1347 +
  1348 +
  1349 +
  1350 +
  1351 +
  1352 +
  1353 +
  1354 +
  1355 +
  1356 +
  1357 +
  1358 +
  1359 +
  1360 +
  1361 +
  1362 +
  1363 +
  1364 +
  1365 +
  1366 +
  1367 +
  1368 +
  1369 +
  1370 +
  1371 +
  1372 +
  1373 +
  1374 +
  1375 +
  1376 +
  1377 +
  1378 +
  1379 +
  1380 +
  1381 +
  1382 +
  1383 +
  1384 +
  1385 +
  1386 +
  1387 +
  1388 +
  1389 +
  1390 +
  1391 +
  1392 +
  1393 +
  1394 +
  1395 +
  1396 +
... ...
src/main/java/com/bsth/service/impl/StationServiceImpl.java
... ... @@ -381,7 +381,7 @@ public class StationServiceImpl extends BaseServiceImpl&lt;Station, Integer&gt; implem
381 381 Station station = stationlist.get(0);
382 382 // 站点编码
383 383 stationCode = GetUIDAndCode.getStationId();
384   - station.setCode(String.valueOf(stationCode));
  384 + station.setStationCode(String.valueOf(stationCode));
385 385 station.setId((int)stationCode);
386 386 station.setCreateDate(null);
387 387 station.setUpdateDate(null);
... ...
src/main/java/com/bsth/util/RoadCutDoubleName.java
... ... @@ -5,10 +5,13 @@ import com.alibaba.fastjson.JSONArray;
5 5 import com.alibaba.fastjson.JSONObject;
6 6 import com.bsth.entity.LonLatName;
7 7 import com.bsth.util.TransGPS.Location;
8   -import com.bsth.util.TransGPS;
9 8  
10 9 import java.net.URLEncoder;
11   -import java.util.*;
  10 +import java.util.ArrayList;
  11 +import java.util.Arrays;
  12 +import java.util.HashMap;
  13 +import java.util.List;
  14 +import java.util.Map;
12 15  
13 16 public class RoadCutDoubleName {
14 17  
... ... @@ -203,7 +206,7 @@ public class RoadCutDoubleName {
203 206 maxOne += 4;
204 207 maxTwo += 4;
205 208 d = maxTwo;
206   - roadName.add(theMainRoad + "(" + theFirstRoad + "-" + theSecondRoad + ")");
  209 + roadName.add(theMainRoad + "(" + theFirstRoad + "-" + theSecondRoad + ")");
207 210 }
208 211 // 将所有经纬度列表进行重复过滤
209 212 for (int i = 0; i < el.size() - 1; i++) {
... ...
src/main/resources/static/pages/base/geo_data_edit/css/mian.css
... ... @@ -40,8 +40,9 @@ div#map_wrap{
40 40 box-shadow: -5px 4px 15px rgba(90, 90, 90, 0.48);
41 41 padding: 0 12px;
42 42 text-align: center;
43   - border-radius: 7px;
  43 + border-radius: 7px !important;
44 44 height: 28px;
  45 + line-height: 2;
45 46 }
46 47  
47 48 .main_rt_tools_panel>._icon{
... ... @@ -59,7 +60,7 @@ div#map_wrap{
59 60  
60 61 ._line_info{
61 62 width: 100%;
62   - height: 80px;
  63 + height: 70px;
63 64 background: white;
64 65 box-shadow: 0px -2px 15px rgba(90, 90, 90, 0.48);
65 66 }
... ... @@ -129,6 +130,23 @@ a.clock_enable_version:focus{
129 130 vertical-align: top;
130 131 margin-top: 5px;
131 132 }
  133 +
  134 +._batch_operation_text{
  135 + font-size: 16px;
  136 +}
  137 +
  138 +._batch_operation_wrap {
  139 + position: relative;
  140 + left: 230px;
  141 + top: 30px;
  142 + width: 80px;
  143 + z-index: 999;
  144 +}
  145 +
  146 +.batch_operation_list>li{
  147 + font-size: 16px;
  148 +}
  149 +
132 150 ._route_info_wrap{
133 151 height: calc(100% - 90px);
134 152 padding-top: 10px;
... ... @@ -137,6 +155,7 @@ a.clock_enable_version:focus{
137 155  
138 156 ._route_info_wrap .uk-tab>li>a{
139 157 padding: 9px 5px;
  158 + font-size: 14px;
140 159 }
141 160 ._route_info_wrap>ul.uk-tab{
142 161 padding-left: 10px;
... ... @@ -156,7 +175,7 @@ a.clock_enable_version:focus{
156 175 padding: 5px 8px;
157 176 }
158 177 .station_route>ul{
159   - padding: 0 0 0 30px;
  178 + padding: 0 0 20px 30px;
160 179 font-size: 14px;
161 180 width: calc(100% - 38px);
162 181 }
... ... @@ -179,7 +198,7 @@ a.clock_enable_version:focus{
179 198 .ct_route_badge{
180 199 font-size: 11px;
181 200 height: 18px;
182   - border-radius: 5px;
  201 + border-radius: 5px !important;
183 202 vertical-align: top;
184 203 margin-top: 1px;
185 204 padding: 0 4px;
... ... @@ -348,6 +367,10 @@ ul.context-menu-list.station-route-ct-menu.context-menu-root {
348 367 margin-right: 7px;
349 368 }
350 369  
  370 +.buffer_edit_body .ct_row .section-input{
  371 + width: 350px !important;
  372 +}
  373 +
351 374 .buffer_edit_body .ct_row{
352 375 margin-top: 12px;
353 376 }
... ... @@ -677,7 +700,7 @@ ul.context-menu-list.station-route-ct-menu.context-menu-root {
677 700 }
678 701  
679 702 .s_future_version_info ._line_info{
680   - height: 95px;
  703 + height: 95px!important;
681 704 }
682 705  
683 706 .s_future_version_info ._route_info_wrap{
... ...
src/main/resources/static/pages/base/geo_data_edit/fragments/destroy_section.html 0 → 100644
  1 +<!-- 编辑路段 -->
  2 +<div class="modal fade" id="destroy_section_mobal" role="basic"
  3 + aria-hidden="true">
  4 + <div style="margin:5% auto">
  5 + <div class="modal-content">
  6 + <div class="col-md-12">
  7 + <div class="portlet light porttlet-fit bordered">
  8 + <div class="portlet-title">
  9 + <div class="tipso-animation">
  10 + </div>
  11 + <div class="caption">
  12 + <i class="fa fa-info-circle font-dark"></i> <span
  13 + class="caption-subject font-dark sbold uppercase">路段信息</span>
  14 + </div>
  15 + <div class="actions">
  16 + <div class="modal-footer-left">
  17 + <button type="button" class="btn btn-primary" id="batchDestroySectionButton">批量撤销路段</button>
  18 + <button type="button" class="btn default" data-dismiss="modal">取消</button>
  19 + </div>
  20 + </div>
  21 + </div>
  22 + <div class="portlet-body">
  23 + <div class="table-container" style="margin-top: 10px">
  24 + <from class="form-horizontal" role="form"
  25 + id="batch_destroy_section_form">
  26 + <table
  27 + class="table table-striped table-bordered table-hover table-checkable"
  28 + id="datatable_section_destroy">
  29 + <thead>
  30 + <tr role="row" class="heading">
  31 + <th width="2%"><input type="checkbox" name="scetionCheckItems"
  32 + id="scetionCheckItems"></input></th>
  33 + <th width="2%">序号</th>
  34 + <th width="5%">路段路由编号</th>
  35 + <th width="5%">线路编号</th>
  36 + <th width="11%">线路名称</th>
  37 + <th width="7%">线路方向</th>
  38 + <th width="11%">路段名称</th>
  39 + <th width="5%">路段编码</th>
  40 + <th width="5%">路段序号</th>
  41 + <th width="5%">路段限速</th>
  42 + <th width="5%">路段长度</th>
  43 + <th width="5%">路段历时</th>
  44 + <th width="5%">版本号</th>
  45 + <!-- <th width="6%">是否撤销</th>
  46 + <th width="9%">操作</th> -->
  47 + </tr>
  48 + </thead>
  49 + <tbody></tbody>
  50 + </table>
  51 + </from>
  52 + <div class="actions">
  53 + <div style="text-align: right">
  54 + <ul id="pagination" class="pagination"></ul>
  55 + </div>
  56 + </div>
  57 + </div>
  58 + </div>
  59 + </div>
  60 + </div>
  61 + </div>
  62 + </div>
  63 +</div>
  64 +
  65 +<script type="text/html" id="sectionInfo_list_table_temp_destroy">
  66 + {{each list as obj i }}
  67 + <tr>
  68 + <td style="vertical-align: middle;">
  69 + <input type="checkbox" class="group-checkable icheck" name="items" value="{{obj.id}}" id="{{obj.id}}" >
  70 + </td>
  71 + <td style="vertical-align: middle;">
  72 + {{(list.page*10)+(i+1)}}
  73 + </td>
  74 + <td style="vertical-align: middle;">
  75 + {{obj.id}}
  76 + </td>
  77 + <td style="vertical-align: middle;">
  78 + {{obj.lineCode}}
  79 + </td>
  80 + <td style="vertical-align: middle;">
  81 + {{obj.line.name}}
  82 + </td>
  83 + <td style="vertical-align: middle;">
  84 + {{if obj.directions == '0'}}
  85 + 上行
  86 + {{else if obj.directions == '1'}}
  87 + 下行
  88 + {{/if}}
  89 + </td>
  90 + <td style="vertical-align: middle;">
  91 + {{obj.section.sectionName}}
  92 + </td>
  93 + <td style="vertical-align: middle;">
  94 + {{obj.sectionCode}}
  95 + </td>
  96 + <td style="vertical-align: middle;">
  97 + {{obj.sectionrouteCode}}
  98 + </td>
  99 + <td style="vertical-align: middle;">
  100 + {{obj.speedLimit}}
  101 + </td>
  102 + <td style="vertical-align: middle;">
  103 + {{obj.sectionDistance}}
  104 + </td>
  105 + <td style="vertical-align: middle;">
  106 + {{obj.sectionTime}}
  107 + </td>
  108 + <td style="vertical-align: middle;">
  109 + {{obj.versions}}
  110 + </td>
  111 + </tr>
  112 + {{/each}}
  113 + {{if list.length == 0}}
  114 + <tr>
  115 + <td colspan=13><h6 class="muted">没有找到相关数据</h6></td>
  116 + </tr>
  117 + {{/if}}
  118 +</script>
  119 +<script type="text/javascript">
  120 +$('#destroy_section_mobal').on('destroySectionMobal.show',function(e, line_code, updown, versions) {
  121 + layer.closeAll();
  122 + // 显示mobal
  123 + $('#destroy_section_mobal').modal({
  124 + show : true,
  125 + backdrop : 'static',
  126 + keyboard : false
  127 + });
  128 + // 编辑表单元素
  129 + var form = $('#batch_destroy_section_form');
  130 + // 提交数据按钮事件
  131 + $('#batchDestroySectionButton').on('click', function() {
  132 + var checked = $("[name=items]:checked");
  133 + var ids = "";
  134 + checked.each(function() {
  135 + ids = ids + "," + $(this).val();
  136 + //ids.push($(this).val());
  137 + });
  138 + if (ids != "" && ids != null && ids != undefined) {
  139 + ids = ids.substr(1, ids.length - 1);
  140 + // var params = {};
  141 + // params.ids = ids;
  142 + layer.confirm('确定撤销所选路段吗?', {
  143 + btn: ['确定','取消'] //按钮
  144 + }, function(index){
  145 + gb_common.$post('/_geo_data/batchDestroyLsSectionRout',{'ids':ids, 'lineCode':line_code, 'upDown':updown, 'versions':versions },function(resuntDate) {
  146 + if (resuntDate.status == 'SUCCESS') {
  147 + // 弹出添加成功提示消息
  148 + // UIkit.notification("撤销成功!", {status: 'success'});
  149 + var destroyID = ids.split(",");
  150 + var Section = {'id':destroyID[0]};
  151 + gb_road_route.updateList(resuntDate.list, Section);
  152 + layer.msg('撤销成功!');
  153 + } else {
  154 + // 弹出添加失败提示消息
  155 + layer.msg('撤销失败!');
  156 + }
  157 + initSearch();
  158 + });
  159 + });
  160 + } else {
  161 + layer.msg('请选择要撤销的路段!!!');
  162 + }
  163 + });
  164 +
  165 + /** 全选框 */
  166 + document.getElementById('scetionCheckItems').onclick = function() {
  167 + // 获取所有的复选框
  168 + var checkElements = document.getElementsByName('items');
  169 + if (this.checked) {
  170 + for ( var i = 0; i < checkElements.length; i++) {
  171 + var checkElement = checkElements[i];
  172 + checkElement.checked = "checked";
  173 + }
  174 + } else {
  175 + for ( var i = 0; i < checkElements.length; i++) {
  176 + var checkElement = checkElements[i];
  177 + checkElement.checked = null;
  178 + }
  179 + }
  180 + }
  181 +
  182 + /** 页面加载完显示数据 */
  183 + window.onload = initSearch();
  184 +
  185 + /**
  186 + * @description : (TODO) 页面加载事件
  187 + *
  188 + */
  189 + function initSearch() {
  190 + var params = new getParams();
  191 + page = 0;
  192 + loadTableDate(params, true);
  193 + }
  194 + function getParams() {
  195 + // 搜索参数集合
  196 + params = {};
  197 + params.lineCode_eq = line_code;
  198 + params.directions_eq = updown;
  199 + params.versions_eq = versions;
  200 + params.destroy_eq = "0"; //默认查没有撤销的路段
  201 + return params;
  202 + }
  203 + /**
  204 + * @description : (TODO) 表格数据分页加载事件
  205 + *
  206 + * ------@param : 查询参数
  207 + *
  208 + * ------@isPon : 是否重新分页
  209 + *
  210 + */
  211 + function loadTableDate(param, isPon) {
  212 + // 初始化全选按钮
  213 + document.getElementById('scetionCheckItems').checked = null;
  214 + // 搜索参数
  215 + var params = {};
  216 + if (param)
  217 + params = param;
  218 + // 排序(按方向与序号)
  219 + params['order'] = 'directions,sectionrouteCode';
  220 + // 排序方向.
  221 + params['direction'] = 'ASC,ASC';
  222 + // 记录当前页数
  223 + params['page'] = page;
  224 + // 弹出正在加载层
  225 + var i = layer.load(2);
  226 + // 异步请求获取表格数据
  227 + $.get('/LsSectionRoute',params,function(result) {
  228 + // 添加序号
  229 + result.content.page = page;
  230 + // 把数据填充到模版中
  231 + var tbodyHtml = template('sectionInfo_list_table_temp_destroy',{list : result.content});
  232 + // 把渲染好的模版html文本追加到表格中
  233 + $('#datatable_section_destroy tbody').html(tbodyHtml);
  234 + // 是重新分页且返回数据长度大于0
  235 + if (isPon && result.content.length > 0) {
  236 + // 重新分页
  237 + initPag = true;
  238 + // 分页栏
  239 + showPagination(result);
  240 + }
  241 + // 关闭弹出加载层
  242 + layer.close(i);
  243 + });
  244 + }
  245 + /**
  246 + * @description : (TODO) 分页栏组件
  247 + *
  248 + */
  249 + function showPagination(data) {
  250 + // 分页组件
  251 + $('#pagination').jqPaginator({
  252 + // 总页数
  253 + totalPages : data.totalPages,
  254 + // 中间显示页数
  255 + visiblePages : 6,
  256 + // 当前页
  257 + urrentPage : page + 1,
  258 + first : '<li class="first"><a href="javascript:void(0);">首页<\/a><\/li>',
  259 + prev : '<li class="prev"><a href="javascript:void(0);">上一页<\/a><\/li>',
  260 + next : '<li class="next"><a href="javascript:void(0);">下一页<\/a><\/li>',
  261 + last : '<li class="last"><a href="javascript:void(0);">尾页<\/a><\/li>',
  262 + page : '<li class="page"><a href="javascript:void(0);">{{page}}<\/a><\/li>',
  263 + onPageChange : function(num, type) {
  264 + if (initPag) {
  265 + initPag = false;
  266 + return;
  267 + }
  268 + var pData = getParams();
  269 + page = num - 1;
  270 + loadTableDate(pData, false);
  271 + }
  272 + });
  273 + }
  274 +});
  275 +</script>
0 276 \ No newline at end of file
... ...
src/main/resources/static/pages/base/geo_data_edit/fragments/destroy_station.html 0 → 100644
  1 +<!-- 编辑路段 -->
  2 +<div class="modal fade" id="destroy_station_mobal" role="basic"
  3 + aria-hidden="true">
  4 + <div style="margin:5% auto">
  5 + <div class="modal-content">
  6 + <div class="col-md-12">
  7 + <div class="portlet light porttlet-fit bordered">
  8 + <div class="portlet-title">
  9 + <div class="tipso-animation">
  10 + </div>
  11 + <div class="caption">
  12 + <i class="fa fa-info-circle font-dark"></i>
  13 + <span class="caption-subject font-dark sbold uppercase">站点信息</span>
  14 + </div>
  15 + <div class="actions">
  16 + <div class="btn-group btn-group-devided" data-toggle="buttons">
  17 + <button type="button" class="btn btn-primary batch_destroy_button" id="batchdestroyStationButton">批量撤销站点</button>
  18 + <button type="button" class="btn default" data-dismiss="modal">取消</button>
  19 + </div>
  20 + </div>
  21 + </div>
  22 + <div class="portlet-body">
  23 + <div class="table-container" style="margin-top: 10px">
  24 + <from class="form-horizontal" role="form" id="batch_destroy_station_form">
  25 + <table class="table table-striped table-bordered table-hover table-checkable" id="datatable_station_destroy">
  26 + <thead>
  27 + <tr role="row" class="heading">
  28 + <th width="2%"><input type="checkbox" name="checkItems"
  29 + id="stationCheckItems"></input></th>
  30 + <th width="2%">序号</th>
  31 + <th width="5%">站点路由编号</th>
  32 + <th width="5%">线路编号</th>
  33 + <th width="8%">线路名称</th>
  34 + <th width="5%">线路方向</th>
  35 + <th width="8%">站点路由名称</th>
  36 + <th width="4%">站点编码</th>
  37 + <th width="4%">站点序号</th>
  38 + <th width="4%">站点类型</th>
  39 + <th width="6%">站点距离(km)</th>
  40 + <th width="6%">站点时长(min)</th>
  41 + <th width="4%">版本号</th>
  42 + </tr>
  43 + </thead>
  44 + <tbody></tbody>
  45 + </table>
  46 + </from>
  47 + <div class="actions">
  48 + <div style="text-align: right">
  49 + <ul id="pagination" class="pagination"></ul>
  50 + </div>
  51 + </div>
  52 + </div>
  53 + </div>
  54 + </div>
  55 + </div>
  56 + </div>
  57 + </div>
  58 +</div>
  59 +
  60 +<script type="text/html" id="stationInfo_list_table_temp_destroy">
  61 + {{each list as obj i }}
  62 + <tr>
  63 + <td style="vertical-align: middle;">
  64 + <input type="checkbox" class="group-checkable icheck" name="items" value="{{obj.id}}" id="{{obj.id}}" >
  65 + </td>
  66 + <td style="vertical-align: middle;">
  67 + {{(list.page*10)+(i+1)}}
  68 + </td>
  69 + <td style="vertical-align: middle;">
  70 + {{obj.id}}
  71 + </td>
  72 + <td>
  73 + {{obj.lineCode}}
  74 + </td>
  75 + <td>
  76 + {{obj.line.name}}
  77 + </td>
  78 + <td>
  79 + {{if obj.directions == '0'}}
  80 + 上行
  81 + {{else if obj.directions == '1'}}
  82 + 下行
  83 + {{/if}}
  84 + </td>
  85 + <td>
  86 + {{obj.stationName}}
  87 + </td>
  88 + <td>
  89 + {{obj.stationCode}}
  90 + </td>
  91 + <td>
  92 + {{obj.stationRouteCode}}
  93 + </td>
  94 + <td>
  95 + {{if obj.stationMark == 'B'}}
  96 + 起始站
  97 + {{else if obj.stationMark == 'Z'}}
  98 + 中途站
  99 + {{else if obj.stationMark== 'E'}}
  100 + 终点站
  101 + {{/if}}
  102 + </td>
  103 + <td>
  104 + {{obj.distances}}
  105 + </td>
  106 + <td>
  107 + {{obj.toTime}}
  108 + </td>
  109 + <td>
  110 + {{obj.versions}}
  111 + </td>
  112 + </tr>
  113 + {{/each}}
  114 + {{if list.length == 0}}
  115 + <tr>
  116 + <td colspan=13><h6 class="muted">没有找到相关数据</h6></td>
  117 + </tr>
  118 + {{/if}}
  119 +</script>
  120 +<script type="text/javascript">
  121 +$('#destroy_station_mobal').on('destroyStationMobal.show',function(e, line_code, updown, versions) {
  122 + // layer.closeAll();
  123 + // 显示mobal
  124 + $('#destroy_station_mobal').modal({
  125 + show : true,
  126 + backdrop : 'static',
  127 + keyboard : false
  128 + });
  129 + // 编辑表单元素
  130 + var form = $('#batch_destroy_station_form');
  131 + // 提交数据按钮事件
  132 + $('#batchdestroyStationButton').on('click', function() {
  133 + var checked = $("[name=items]:checked");
  134 + var ids = "";
  135 + checked.each(function() {
  136 + ids = ids + "," + $(this).val();
  137 + //ids.push($(this).val());
  138 + });
  139 + if (ids != "" && ids != null && ids != undefined) {
  140 + console.log("ids:" + ids);
  141 + ids = ids.substr(1, ids.length - 1);
  142 + // var params = {};
  143 + // params.ids = ids;
  144 + layer.confirm('确定撤销所选站点吗?', {
  145 + btn: ['确定','取消'] //按钮
  146 + }, function(index){
  147 + layer.close(index);
  148 + gb_common.$post('/_geo_data/batchDestroyLsStationRout',{'ids':ids, 'lineCode':line_code, 'upDown':updown, 'versions':versions },function(resuntDate) {
  149 + if (resuntDate.status == 'SUCCESS') {
  150 + // 弹出添加成功提示消息
  151 + // UIkit.notification("撤销成功!", {status: 'success'});
  152 + var destroyID = ids.split(",");
  153 + $.each(destroyID, function () {
  154 + var Station = {'id':this};
  155 + gb_station_route.destroyEnd(resuntDate.list, Station);
  156 + gb_data_submit.hide_run_text();
  157 + });
  158 + layer.msg('撤销成功!');
  159 + } else {
  160 + // 弹出添加失败提示消息
  161 + layer.msg('撤销失败!');
  162 + }
  163 + initSearch();
  164 + });
  165 + });
  166 + } else {
  167 + layer.msg('请选择要撤销的站点!!!');
  168 + }
  169 + });
  170 +
  171 + /** 全选框 */
  172 + document.getElementById('stationCheckItems').onclick = function() {
  173 + // 获取所有的复选框
  174 + var checkElements = document.getElementsByName('items');
  175 + if (this.checked) {
  176 + for ( var i = 0; i < checkElements.length; i++) {
  177 + var checkElement = checkElements[i];
  178 + checkElement.checked = "checked";
  179 + }
  180 + } else {
  181 + for ( var i = 0; i < checkElements.length; i++) {
  182 + var checkElement = checkElements[i];
  183 + checkElement.checked = null;
  184 + }
  185 + }
  186 + };
  187 +
  188 + /** 页面加载完显示数据 */
  189 + window.onload = initSearch();
  190 +
  191 + /**
  192 + * @description : (TODO) 页面加载事件
  193 + *
  194 + */
  195 + function initSearch() {
  196 + var params = new getParams();
  197 + page = 0;
  198 + loadTableDate(params, true);
  199 + }
  200 + function getParams() {
  201 + // 搜索参数集合
  202 + params = {};
  203 + params.lineCode_eq = line_code;
  204 + params.directions_eq = updown;
  205 + params.versions_eq = versions;
  206 + params.destroy_eq = "0"; //默认查没有撤销的站点
  207 + return params;
  208 + }
  209 + /**
  210 + * @description : (TODO) 表格数据分页加载事件
  211 + *
  212 + * ------@param : 查询参数
  213 + *
  214 + * ------@isPon : 是否重新分页
  215 + *
  216 + */
  217 + function loadTableDate(param, isPon) {
  218 + // 初始化全选按钮
  219 + document.getElementById('stationCheckItems').checked = null;
  220 + // 搜索参数
  221 + var params = {};
  222 + if (param)
  223 + params = param;
  224 + // 排序(按方向与序号)
  225 + params['order'] = 'directions,stationRouteCode';
  226 + // 排序方向.
  227 + params['direction'] = 'ASC,ASC';
  228 + // 记录当前页数
  229 + params['page'] = page;
  230 + // 弹出正在加载层
  231 + var i = layer.load(2);
  232 + // 异步请求获取表格数据
  233 + $.get('/lsStationRoute',params,function(result) {
  234 + // 添加序号
  235 + result.content.page = page;
  236 + // 把数据填充到模版中
  237 + var tbodyHtml = template('stationInfo_list_table_temp_destroy',{list : result.content});
  238 + // 把渲染好的模版html文本追加到表格中
  239 + $('#datatable_station_destroy tbody').html(tbodyHtml);
  240 + // 是重新分页且返回数据长度大于0
  241 + if (isPon && result.content.length > 0) {
  242 + // 重新分页
  243 + initPag = true;
  244 + // 分页栏
  245 + showPagination(result);
  246 + }
  247 + // 关闭弹出加载层
  248 + layer.close(i);
  249 + });
  250 + }
  251 + /**
  252 + * @description : (TODO) 分页栏组件
  253 + *
  254 + */
  255 + function showPagination(data) {
  256 + // 分页组件
  257 + $('#pagination').jqPaginator({
  258 + // 总页数
  259 + totalPages : data.totalPages,
  260 + // 中间显示页数
  261 + visiblePages : 6,
  262 + // 当前页
  263 + urrentPage : page + 1,
  264 + first : '<li class="first"><a href="javascript:void(0);">首页<\/a><\/li>',
  265 + prev : '<li class="prev"><a href="javascript:void(0);">上一页<\/a><\/li>',
  266 + next : '<li class="next"><a href="javascript:void(0);">下一页<\/a><\/li>',
  267 + last : '<li class="last"><a href="javascript:void(0);">尾页<\/a><\/li>',
  268 + page : '<li class="page"><a href="javascript:void(0);">{{page}}<\/a><\/li>',
  269 + onPageChange : function(num, type) {
  270 + if (initPag) {
  271 + initPag = false;
  272 + return;
  273 + }
  274 + var pData = getParams();
  275 + page = num - 1;
  276 + loadTableDate(pData, false);
  277 + }
  278 + });
  279 + }
  280 +});
  281 +</script>
0 282 \ No newline at end of file
... ...
src/main/resources/static/pages/base/geo_data_edit/fragments/doublename_road.html 0 → 100644
  1 +<!-- 生成双路名路段路段 -->
  2 +<div class="modal fade" id="doublename_road_mobal" role="basic" aria-hidden="true" style="margin-top:10%">
  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="add_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 + <input type="hidden" name="versions" id="versionsInput">
  15 + <input type="hidden" name="directions" id="directionsSection">
  16 + <input type="hidden" name="lineId" id="lineId">
  17 + <input type="hidden" name="lineCode" id="lineCodeInput">
  18 + <input type="hidden" name="bsectionVector" id="bsectionVectorInput" />
  19 + <input type="hidden" name="dbType" id="dbTypeInput" value="b"/>
  20 + <!-- 路段序号 -->
  21 + <div class="form-body">
  22 + <div class="form-group">
  23 + <label class="control-label col-md-3">
  24 + 上一路段:
  25 + </label>
  26 + <div class="col-md-8">
  27 + <select name="sectionrouteCode" id="sectionrouteCodeSelect"></select>
  28 + <span class="help-block">说明:选择的路段将作为本站序号的参考,成为选择路段的下一个路段。 </span>
  29 + </div>
  30 + </div>
  31 + </div>
  32 + </form>
  33 + </div>
  34 + <div class="modal-footer">
  35 + <button type="button" class="btn btn-primary" id="editSectionButton">提交数据</button>
  36 + <button type="button" class="btn default" data-dismiss="modal">取消</button>
  37 + </div>
  38 + </div>
  39 + </div>
  40 +</div>
  41 +<script type="text/javascript">
  42 +
  43 + $('#doublename_road_mobal').on('doubleNameRoadMobal.show', function(e,params){
  44 + // 方向
  45 + var dir = params.directions;
  46 + var lineId = params.lineId;
  47 + var versions = params.versions;
  48 + var array = gb_ct_map.roadPolylines[dir];
  49 + // 记录最后一个路段
  50 + var endRoad = 0,paramsD =new Array();
  51 + paramsD.push({'id':'启始路段(默认在所有路段的前面)','text':'启始路段(默认在所有路段的前面)'});
  52 + for (var i = 0, p; p = array[i++];) {
  53 + /*if (p.ct_data.sectionCode == code) {
  54 + polyline = p;
  55 + break;
  56 + }*/
  57 + var section = p.ct_data;
  58 + if(section.sectionName!='' || section.sectionName != null) {
  59 + var ptions_v = section.sectionrouteCode;
  60 + if(endRoad < ptions_v)
  61 + endRoad = ptions_v;
  62 + // 添加拼音检索下拉框格式数据数组.
  63 + paramsD.push({'id':ptions_v,
  64 + 'text':section.sectionName + '(' + ptions_v + ')' + ' --' + gb_ct_map.dirdmToName(section.upDown)});
  65 + }
  66 + }
  67 + // 初始化上一个路段拼音检索下拉框.
  68 + initPinYinSelect2($('#sectionrouteCodeSelect'),paramsD,function(selector) {
  69 + if(endRoad != 0)
  70 + $('#sectionrouteCodeSelect').select2('val',endRoad);
  71 + else
  72 + $('#sectionrouteCodeSelect').select2('val','启始路段(默认在所有路段的前面)');
  73 + });
  74 + // 显示mobal
  75 + $('#doublename_road_mobal').modal({show : true,backdrop: 'static',keyboard: false});
  76 + // 当调用 hide 实例方法时触发
  77 + $('#doublename_road_mobal').on('hide.bs.modal', function () {
  78 + closeMobleSetClean();
  79 + });
  80 + function closeMobleSetClean() {
  81 + // 清除地图覆盖物
  82 + $('.main_left_panel_m_layer').hide();
  83 + $(this).parents('.buffer_edit_body').parent().remove();
  84 + gb_ct_map.resetMapStatus();
  85 + }
  86 + // 编辑表单元素
  87 + var form = $('#add_section_form');
  88 + // 获取错误提示元素
  89 + var error = $('.alert-danger', form);
  90 + // 提交数据按钮事件
  91 + $('#editSectionButton').on('click', function() {
  92 + // 表单提交
  93 + form.submit();
  94 + });
  95 + // 表单验证
  96 + form.validate({
  97 + errorElement : 'span',
  98 + errorClass : 'help-block help-block-error',
  99 + focusInvalid : false,
  100 + /* rules : {
  101 + 'sectionrouteCode': {required : true}// 路由序号 必填项
  102 + },*/
  103 + invalidHandler : function(event, validator) {
  104 + error.show();
  105 + App.scrollTo(error, -200);
  106 + },
  107 + highlight : function(element) {
  108 + $(element).closest('.form-group').addClass('has-error');
  109 + },
  110 + unhighlight : function(element) {
  111 + $(element).closest('.form-group').removeClass('has-error');
  112 + },
  113 + success : function(label) {
  114 + label.closest('.form-group').removeClass('has-error');
  115 + },
  116 + submitHandler : function(f) {
  117 + var data = form.serializeJSON();
  118 + if(data.sectionrouteCode=='启始路段(默认在所有路段的前面)') {
  119 + params.sectionrouteCode = '';
  120 + } else {
  121 + params.sectionrouteCode = data.sectionrouteCode;
  122 + }
  123 + // 生成路段
  124 + gb_common.$post('/LsSectionRoute/doubleName',params,function (resuntDate) {
  125 + if(resuntDate.status=='SUCCESS') {
  126 + // 弹出添加成功提示消息
  127 + layer.msg('生成成功...');
  128 + gb_road_route.updateList(resuntDate.list);
  129 + // hide_run_text();
  130 + // gb_road_route.init();
  131 + } else if (resuntDate.status=='Failure') {
  132 + layer.msg('抱歉,您选取的路段基于高德地图的数据无法生成双路段!');
  133 + } else {
  134 + // 弹出添加失败提示消息
  135 + layer.msg('生成失败...');
  136 + }
  137 + $('#doublename_road_mobal').modal('hide');
  138 + closeMobleSetClean();
  139 + });
  140 + }
  141 + });
  142 + });
  143 +</script>
0 144 \ No newline at end of file
... ...
src/main/resources/static/pages/base/geo_data_edit/fragments/f_road_route.html
... ... @@ -54,14 +54,14 @@
54 54 <input type="hidden" value="{{sectionCode}}" name="sectionCode">
55 55  
56 56 <div class="ct_row">
57   - <div class="uk-inline">
  57 + <div class="uk-inline section-input">
58 58 <span class="uk-form-icon uk-form-icon-flip" >路段名</span>
59 59 <input class="uk-input" name="sectionName" type="text" value="{{sectionName}}" >
60 60 </div>
61   - <div class="uk-inline">
  61 + <!--<div class="uk-inline">
62 62 <span class="uk-form-icon uk-form-icon-flip" >交叉路</span>
63 63 <input class="uk-input" name="crosesRoad" type="text" value="{{crosesRoad}}" style="font-size: 13px;">
64   - </div>
  64 + </div>-->
65 65 </div>
66 66  
67 67 <div class="ct_row">
... ... @@ -101,14 +101,14 @@
101 101 <input type="hidden" value="{{sectionCode}}" name="sectionCode">
102 102  
103 103 <div class="ct_row">
104   - <div class="uk-inline">
  104 + <div class="uk-inline section-input">
105 105 <span class="uk-form-icon uk-form-icon-flip" >路段名</span>
106 106 <input class="uk-input" name="sectionName" type="text" value="{{name}}" >
107 107 </div>
108   - <div class="uk-inline">
  108 + <!--<div class="uk-inline">
109 109 <span class="uk-form-icon uk-form-icon-flip" >交叉路</span>
110 110 <input class="uk-input" name="crosesRoad" type="text" value="{{cName}}" style="font-size: 13px;">
111   - </div>
  111 + </div>-->
112 112 </div>
113 113  
114 114 <div class="ct_row">
... ...
src/main/resources/static/pages/base/geo_data_edit/fragments/f_station_route.html
... ... @@ -7,7 +7,7 @@
7 7 <span class="uk-badge ct_route_badge {{if s.stationMark=='B'}}start{{else if s.stationMark=='E'}}end{{/if}} {{if s.shapesType=='d'}}polygon{{/if}}">
8 8 {{if s.stationMark=='B'}}起点站{{else if s.stationMark=='E'}}终点站{{else}}{{i + 1}}{{/if}}</span>
9 9 </div>
10   - <a data-code="{{s.stationCode}}" data-updown="{{s.directions}}">{{s.stationName}}</a>
  10 + <a data-code="{{s.stationCode}}" data-id="{{s.id}}" data-updown="{{s.directions}}">{{s.stationName}}</a>
11 11 </li>
12 12 {{/each}}
13 13  
... ... @@ -28,7 +28,7 @@
28 28 <span class="uk-badge ct_route_badge {{if stationMark=='B'}}start{{else if stationMark=='E'}}end{{/if}} {{if shapesType=='d'}}polygon{{/if}}">
29 29 {{if stationMark=='B'}}起点站{{else if stationMark=='E'}}终点站{{else}}{{index}}{{/if}}</span>
30 30 </div>
31   - <a class="uk-animation-shake" data-code="{{stationCode}}" data-updown="{{directions}}">{{stationName}}</a>
  31 + <a class="uk-animation-shake" data-code="{{stationCode}}" data-id="{{id}}" data-updown="{{directions}}">{{stationName}}</a>
32 32 </li>
33 33 </script>
34 34  
... ...
src/main/resources/static/pages/base/geo_data_edit/fragments/tzzj.html 0 → 100644
  1 +<!-- 调整站距 -->
  2 +<div class="modal fade" id="tzzj_mobal" tabindex="-1" 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" action="/" method="post" id="tzbcForm" role="form">
  11 + <!-- alert-danger 组件START -->
  12 + <div class="alert alert-danger display-hide" id="tzbcAlert">
  13 + <button class="close" data-close="alert"></button>
  14 + 您的输入有误,请检查下面的输入项
  15 + </div>
  16 + <div class="portlet-body">
  17 + <div class="table-container" style="margin-top: 10px">
  18 + <table class="table table-striped table-bordered table-hover table-checkable" id="datatable_bctz">
  19 + <thead>
  20 + <tr role="row" class="heading">
  21 + <th width="33%">站点序号</th>
  22 + <th width="33%">站点路由</th>
  23 + <th width="33%">站距(米/单位)</th>
  24 + </tr>
  25 + </thead>
  26 + <tbody></tbody>
  27 + </table>
  28 + </div>
  29 + </div>
  30 + </form>
  31 + </div>
  32 + <div class="modal-footer">
  33 + <button type="button" class="btn default" data-dismiss="modal">取消</button>
  34 + <button type="button" class="btn btn-primary" id="tzbcnext">保存</button>
  35 + </div>
  36 + </div>
  37 + </div>
  38 +</div>
  39 +<script type="text/html" id="tzzj_temp">
  40 +{{each list as obj i }}
  41 + <tr role="row" class="filter">
  42 + <td>
  43 + <!--<input type="text" readonly class="form-control form-filter input-sm" value="{{i+1}}">-->
  44 + {{i+1}}
  45 + </td>
  46 + <td>
  47 + <!-- <input type="text" readonly class="form-control form-filter input-sm" name="station_{{i+1}}" value="{{obj.name}}">-->
  48 + {{obj.stationName}}
  49 + </td>
  50 + <td>
  51 + <input type="text" class="form-control form-filter input-sm" name="dis_{{obj.id}}" value="{{obj.distances * 1000}}">
  52 + </td>
  53 + </tr>
  54 +{{/each}}
  55 +{{if list.length == 0}}
  56 + <tr>
  57 + <td colspan=4><h6 class="muted">没有找到相关数据</h6></td>
  58 + </tr>
  59 + {{/if}}
  60 +</script>
  61 +<script type="text/javascript">
  62 +$('#tzzj_mobal').on('tzzjMobal.show', function(e,rd){
  63 + setTimeout(function(){
  64 + // 加载延迟200毫秒显示mobal
  65 + $('#tzzj_mobal').modal({show : true,backdrop: 'static', keyboard: false});
  66 + },200);
  67 + // 当模态框对用户可见时触发(将等待 CSS 过渡效果完成)。
  68 + $('#tzzj_mobal').on('show.bs.modal', function () {
  69 + console.log(rd);
  70 + // 把数据填充到模版中
  71 + var tbodyHtml = template('tzzj_temp',{list:rd.list});
  72 + // 把渲染好的模版html文本追加到表格中
  73 + $('#datatable_bctz tbody').html(tbodyHtml);
  74 + });
  75 + // 获取表单元素
  76 + var form = $('#tzbcForm');
  77 + // 错误提示元素
  78 + var tzbcAlert = $('#tzbcAlert', form);
  79 + // 下一步点击事件
  80 + $('#tzbcnext').on('click', function() {
  81 + form.submit();// 表单提交
  82 + });
  83 + // 表单验证
  84 + form.validate({
  85 + errorElement : 'span',
  86 + errorClass : 'help-block help-block-error',
  87 + focusInvalid : false,
  88 + rules : {
  89 + },
  90 + invalidHandler : function(event, validator) {
  91 + tzbcAlert.show();
  92 + App.scrollTo(reladplusname, -200);
  93 + },
  94 + highlight : function(element) {
  95 + $(element).closest('.form-group').addClass('has-error');
  96 + },
  97 + unhighlight : function(element) {
  98 + $(element).closest('.form-group').removeClass('has-error');
  99 + },
  100 + success : function(label) {
  101 + label.closest('.form-group').removeClass('has-error');
  102 + },
  103 + submitHandler : function(f) {
  104 + // 获取表单内容,并序列化
  105 + var params = form.serializeJSON();
  106 + gb_common.$post('/lsStationRoute/upddis',params,function(data) {
  107 + // 隐藏错误提示
  108 + tzbcAlert.hide();
  109 + // 隐藏 reladplus_mobal 弹出层
  110 + $('#tzzj_mobal').modal('hide');
  111 + if(data.status=='SUCCESS') {
  112 + // 弹出添加成功提示消息
  113 + layer.msg('修改成功...');
  114 + }else {
  115 + // 弹出添加失败提示消息
  116 + layer.msg('修改失败...');
  117 + }
  118 + });
  119 + }
  120 + });
  121 +});
  122 +</script>
0 123 \ No newline at end of file
... ...
src/main/resources/static/pages/base/geo_data_edit/js/batch_operation.js 0 → 100644
  1 +$("#batch_destroy_station").on('click',function () {
  2 + $.get('fragments/destroy_station.html', function(m){
  3 + $('body .ct_page').append(m);
  4 + $('#destroy_station_mobal').trigger('destroyStationMobal.show', [g_line_code,getUpDown(),g_version]);
  5 + });
  6 +});
  7 +$("#batch_destroy_section").on('click',function () {
  8 + // 加载destroysection页面
  9 + $.get('fragments/destroy_section.html', function(m){
  10 + $('body .ct_page').append(m);
  11 + $('#destroy_section_mobal').trigger('destroySectionMobal.show', [g_line_code,getUpDown(),g_version]);
  12 + });
  13 +});
  14 +$('#wrench_down_dis').on('click',function() {
  15 + gb_common.$get('/_geo_data/findGeoStationsDir', {lineCode: g_line_code, version: g_version, dir: getUpDown()}, function (rs) {
  16 + // 加载其它规划选择弹出层mobal页面
  17 + $.get('fragments/tzzj.html', function(m){
  18 + $('body .ct_page').append(m);
  19 + $('#tzzj_mobal').trigger('tzzjMobal.show', [rs]);
  20 + });
  21 + });
  22 +});
  23 +
  24 +// 切换上下行.
  25 +$('#retweet').on('click',function() {
  26 + layer.confirm('您是否确定将【上、下】行站点和路段进行对换!', {
  27 + btn : [ '确定', '取消' ]
  28 + },function () {
  29 + // 关闭所有提示弹出层.
  30 + layer.closeAll();
  31 + // 弹出提示层.
  32 + var index = layer.load(1, {
  33 + shade: [0.1,'#fff'] // 透明度的白色背景
  34 + });
  35 + var Line = LineObj.getLineObj();
  36 + $post('/stationroute/updSwitchDir?lineIds='+ Line.id,null,function(data) {
  37 + layer.close(index);
  38 + if(data.status=='SUCCESS') {
  39 + // 弹出操作成功提示消息
  40 + layer.msg('操作成功...');
  41 + }else {
  42 + // 弹出操作失败提示消息
  43 + layer.msg('操作成功...');
  44 + }
  45 + WorldsBMap.clearMarkAndOverlays();
  46 + // 刷新左边树
  47 + PublicFunctions.resjtreeDate(Line.id,0);
  48 + /** 查询上行路段信息 @param:<Line.id:线路Id;0:上行> @return:data:路段数据 */
  49 + GetAjaxData.getSectionRouteInfo(Line.id,0,function(data) {
  50 + /** 在地图上画出线路走向 @param:<Line.id:线路Id;0:上行;data:路段数据> */
  51 + PublicFunctions.linePanlThree(Line.id,data,0);
  52 + });
  53 + });
  54 + });
  55 +});
0 56 \ No newline at end of file
... ...
src/main/resources/static/pages/base/geo_data_edit/js/map.js
... ... @@ -91,6 +91,7 @@ var gb_ct_map = function () {
91 91 $.each(routes, function (i) {
92 92 transCoord(this);
93 93 marker = createStationMark(this);
  94 + marker.stationId = this.id;
94 95 marker.stationCode = this.stationCode;
95 96 marker.ct_data = this;
96 97 marker.ct_source = '1';
... ... @@ -196,7 +197,7 @@ var gb_ct_map = function () {
196 197 return marker;
197 198 }
198 199  
199   - var openStationInfoWin = function (m) {
  200 + var openStationInfoWin = function (m) {debugger;
200 201 //ct_data
201 202 var win = new BMap.InfoWindow(gb_station_route.getTemps()['geo_d_e_station_info_win-temp'](m.ct_data), {offset: new BMap.Size(0, -13)});
202 203 //close event
... ... @@ -283,10 +284,10 @@ var gb_ct_map = function () {
283 284  
284 285 /**
285 286 * 定位到站点
286   - * @param code
  287 + * @param id
287 288 */
288   - var focusStation = function (code, updown) {
289   - var marker = getStationMarker(code, updown);
  289 + var focusStation = function (id, updown) {
  290 + var marker = getStationMarker(id, updown);
290 291 if (marker) {
291 292 openStationInfoWin(marker);
292 293 }
... ... @@ -294,11 +295,11 @@ var gb_ct_map = function () {
294 295 map.setCenter(marker.point);
295 296 };
296 297  
297   - var getStationMarker = function (code, updown) {
  298 + var getStationMarker = function (id, updown) {
298 299 var array = stationMarkers[updown],
299 300 marker;
300 301 for (var i = 0, m; m = array[i++];) {
301   - if (m.stationCode == code) {
  302 + if (m.stationId == id) {
302 303 marker = m;
303 304 break;
304 305 }
... ... @@ -339,7 +340,7 @@ var gb_ct_map = function () {
339 340 clearEditBuffer();
340 341 //map.removeOverlay(editCircle);
341 342  
342   - openStationInfoWin(getStationMarker(s.stationCode, s.directions));
  343 + openStationInfoWin(getStationMarker(s.id, s.directions));
343 344 };
344 345  
345 346 /**
... ... @@ -347,6 +348,7 @@ var gb_ct_map = function () {
347 348 * @param station
348 349 */
349 350 var editStationBuffer = function (s) {
  351 + debugger;
350 352 map_status = 1;
351 353 map.closeInfoWindow();//关闭infoWindow
352 354 gb_station_route.clearFocus();
... ... @@ -354,7 +356,7 @@ var gb_ct_map = function () {
354 356 disabledOtherElem();
355 357 gb_station_route.showEditPanel(s);
356 358  
357   - var marker = getStationMarker(s.stationCode, s.directions);
  359 + var marker = getStationMarker(s.id, s.directions);
358 360 setDragMarker(marker);//站点 点位可拖拽
359 361  
360 362 map.centerAndZoom(marker.point, 18);
... ... @@ -373,6 +375,113 @@ var gb_ct_map = function () {
373 375 }
374 376 };
375 377  
  378 + /**
  379 + * 添加站点间路段
  380 + */
  381 + var insert_between_station_road = function (station) {
  382 + var stationBegin = station;
  383 + // 查询下一个站点
  384 + gb_common.$get("/stationroute/findDownStationRoute", {
  385 + "lineCode": stationBegin.lineCode,
  386 + "direction": stationBegin.directions,
  387 + "stationRouteCode": stationBegin.stationRouteCode
  388 + }, function (stationFinish) {
  389 + if (!$.isEmptyObject(stationFinish)) {
  390 + var pointFinish = stationFinish.stationJwpoints.split(" ");
  391 + var sectionList = [];
  392 + // 两个站点的坐标
  393 + var poiOne = new BMap.Point(stationBegin.bd_lon, stationBegin.bd_lat);
  394 + var poiTwo = new BMap.Point(pointFinish[0], pointFinish[1]);
  395 + // 路径规划保存按钮
  396 + var label = new BMap.Label("保存路段", {
  397 + offset: new BMap.Size(13, -53)
  398 + });
  399 + label.setStyle({
  400 + color: '#fff',
  401 + background: "url(/pages/base/stationroute/css/img/bg.png)",
  402 + border: '0px solid',
  403 + textAlign: "center",
  404 + height: "28px",
  405 + lineHeight: "26px",
  406 + width: "80px",
  407 + maxWidth: "none"
  408 + });
  409 + label.addEventListener('click', function () {
  410 + var params = {};
  411 + params.lineCode = stationBegin.lineCode;
  412 + params.directions = stationBegin.directions;
  413 + params.versions = stationBegin.versions;
  414 + params.stationBegin = stationBegin.stationName;
  415 + params.stationFinish = stationFinish.stationRouteName;
  416 + layer.confirm('确定保存', {
  417 + btn : [ '路段调整好了','继续调整','退出'], icon: 3, title:'提示'
  418 + ,btn3: function(index, layero){
  419 + layer.close(index);
  420 + map.removeOverlay(transit);
  421 + $('.main_left_panel_m_layer').hide();
  422 + $(this).parents('.buffer_edit_body').parent().remove();
  423 + gb_ct_map.resetMapStatus();
  424 + // gb_ct_map.exitEditBufferStatus(station);
  425 + }
  426 + }, function(index, layero){
  427 + layer.close(index);
  428 + params.route = $("#routePlanning").val();
  429 + if(params.route){
  430 + $.get('fragments/doublename_road.html', function (m) {
  431 + $('body .ct_page').append(m);
  432 + $('#doublename_road_mobal').trigger('doubleNameRoadMobal.show', [params]);
  433 + });
  434 + } else {
  435 + layer.msg("抱歉没有获取到你提交的路段,请重新操作!");
  436 + $('.main_left_panel_m_layer').hide();
  437 + $(this).parents('.buffer_edit_body').parent().remove();
  438 + gb_ct_map.resetMapStatus();
  439 + }
  440 + });
  441 + });
  442 + // 路径规划
  443 + var transit = new BMap.DrivingRoute(map, {
  444 + renderOptions: {
  445 + map: map,
  446 + enableDragging: true
  447 + },
  448 + onPolylinesSet: searchPolylinesSet
  449 + });
  450 +
  451 + function searchPolylinesSet(results) {
  452 + if (transit.getStatus() == BMAP_STATUS_SUCCESS) {
  453 + var sectionArrayList = [];
  454 + for (i = 0; i < results.length; i++) {
  455 + var polyline = results[i].getPolyline();
  456 + // 规划路段设置颜色
  457 + polyline.setStrokeColor('#E91E63');
  458 + sectionArrayList = sectionArrayList.concat(polyline.getPath());
  459 + }
  460 + sectionList = sectionArrayList;//JSON.stringify()
  461 + $("#routePlanning").val(JSON.stringify(sectionArrayList));
  462 + var pointMap = new Map();
  463 + pointMap = sectionArrayList[sectionArrayList.length - 1];
  464 + var pointLabel = new BMap.Point(pointMap.lng, pointMap.lat);
  465 + label.enableMassClear();
  466 + label.setPosition(pointLabel);
  467 + map.addOverlay(label);
  468 + }
  469 + }
  470 + transit.search(poiOne, poiTwo);
  471 + transit.disableAutoViewport();
  472 +
  473 + map.centerAndZoom(poiTwo, 17);
  474 + map_status = 1;
  475 + map.closeInfoWindow();//关闭infoWindow
  476 + gb_station_route.clearFocus();
  477 + // gb_station_route.focus(station);
  478 + disabledOtherElem();
  479 + } else {
  480 + layer.msg("您选择的站点后没有站点了,不能生成站点间路段!")
  481 + }
  482 + });
  483 + };
  484 +
376 485 var setDragMarker = function (marker) {
377 486 marker.enableDragging();
378 487 dragMarker = marker;
... ... @@ -447,7 +556,7 @@ var gb_ct_map = function () {
447 556 * @param s
448 557 */
449 558 function updateStation(s) {
450   - var m = getStationMarker(s.stationCode, s.directions);
  559 + var m = getStationMarker(s.id, s.directions);
451 560 //更新位置
452 561 transCoord(s);
453 562 m.ct_data = s;
... ... @@ -516,7 +625,7 @@ var gb_ct_map = function () {
516 625 var s = gb_station_route.getRealEditStation();
517 626  
518 627 //以站点为中心,生成一个默认的圆
519   - var marker = getStationMarker(s.stationCode, s.directions);
  628 + var marker = getStationMarker(s.id, s.directions);
520 629 var circle = new BMap.Circle(marker.point, s.radius ? s.radius : 80, {strokeColor: '#E91E63'});
521 630  
522 631 setTimeout(function () {
... ... @@ -836,6 +945,7 @@ var gb_ct_map = function () {
836 945 focusStation: focusStation,
837 946 focusRoad: focusRoad,
838 947 editStationBuffer: editStationBuffer,
  948 + insert_between_station_road: insert_between_station_road,
839 949 updateStation: updateStation,
840 950 exitEditBufferStatus: exitEditBufferStatus,
841 951 changeShapeType: changeShapeType,
... ... @@ -862,6 +972,7 @@ var gb_ct_map = function () {
862 972 exitEditRoadStatus: exitEditRoadStatus,
863 973 showAddRoadPanel: showAddRoadPanel,
864 974 map: map,
  975 + roadPolylines: roadPolylines,
865 976 focus: focusPoint,
866 977 clearfocus: clearfocus,
867 978 clearAll: function () {
... ... @@ -875,6 +986,15 @@ var gb_ct_map = function () {
875 986  
876 987 map.clearOverlays();
877 988  
  989 + },
  990 + // 方向代码转名称.
  991 + dirdmToName : function(value){
  992 + var srStr = '';
  993 + if(value=='0')
  994 + srStr = '上行';
  995 + else if(value=='1')
  996 + srStr = '下行';
  997 + return srStr;
878 998 }
879 999 };
880 1000 }();
881 1001 \ No newline at end of file
... ...
src/main/resources/static/pages/base/geo_data_edit/js/road_route.js
... ... @@ -126,7 +126,6 @@ var gb_road_route = function () {
126 126 $('.main_left_panel_m_layer').hide();
127 127 $(this).parents('.buffer_edit_body').parent().remove();
128 128 gb_ct_map.resetMapStatus();
129   - //debugger
130 129 gb_ct_map.exitEditRoadStatus(road);
131 130 });
132 131 };
... ... @@ -367,7 +366,6 @@ var gb_road_route = function () {
367 366 $('.main_left_panel_m_layer').hide();
368 367 $(this).parents('.buffer_edit_body').parent().remove();
369 368 gb_ct_map.resetMapStatus();
370   - //debugger
371 369 //gb_ct_map.exitEditRoadStatus(road);
372 370 });
373 371  
... ...
src/main/resources/static/pages/base/geo_data_edit/js/station_route.js
... ... @@ -31,7 +31,6 @@ var gb_station_route = function () {
31 31 rs.list.sort(function (a, b) {
32 32 return parseInt(a.stationRouteCode) - parseInt(b.stationRouteCode);
33 33 });
34   -
35 34 //线路当前启用的线路版本
36 35 storage.setItem("geo_data_enable_version" , rs['currentVersion']);
37 36 //当前编辑的线路版本
... ... @@ -69,11 +68,11 @@ var gb_station_route = function () {
69 68  
70 69 //站点单击
71 70 $('.up_down_route_list>li>.station_route').on('click', 'a[data-code]', function () {
72   - var code = $(this).data('code'),
  71 + var id = $(this).data('id'),
73 72 updown = $(this).data('updown');
74 73  
75 74 clearFocus();
76   - gb_ct_map.focusStation(code, updown);
  75 + gb_ct_map.focusStation(id, updown);
77 76 });
78 77  
79 78 var clearFocus = function () {
... ... @@ -81,9 +80,10 @@ var gb_station_route = function () {
81 80 };
82 81  
83 82 var focus = function (s) {
84   - var elem = $('.up_down_route_list>li>.station_route .s_r_item[data-code='+s.stationCode+']');
  83 + // var elem = $('.up_down_route_list>li>.station_route .s_r_item[data-code='+s.stationCode+']');
  84 + var elem = $('.up_down_route_list>li>.station_route .s_r_item[data-id='+s.id+']');
85 85 elem.addClass('ct_active');
86   -
  86 +debugger;
87 87 if (!isShow(elem)) {
88 88 //定位滚动条
89 89 var cont = $('.up_down_route_list'),
... ... @@ -99,10 +99,10 @@ var gb_station_route = function () {
99 99 return elem.offset().top < wrap.height() + 122 && elem.offset().top > 122;
100 100 };
101 101  
102   - var getStation = function (code, updown) {
  102 + var getStation = function (id, code, updown) {
103 103 var array = station_maps[updown];
104 104 for(var i=0,s;s=array[i++];){
105   - if(s.stationCode==code)
  105 + if(s.id==id && s.stationCode==code)
106 106 return s;
107 107 }
108 108 return null;
... ... @@ -127,7 +127,8 @@ var gb_station_route = function () {
127 127 };
128 128  
129 129 var getStationLI = function (s) {
130   - return $('.up_down_route_list>li:eq('+s.directions+')>.station_route .s_r_item[data-code='+s.stationCode+']');
  130 + // return $('.up_down_route_list>li:eq('+s.directions+')>.station_route .s_r_item[data-code='+s.stationCode+']');
  131 + return $('.up_down_route_list>li:eq('+s.directions+')>.station_route .s_r_item[data-id='+s.id+']');
131 132 };
132 133  
133 134 var addPrevId;//添加站点路由的上一个站点ID
... ... @@ -233,6 +234,9 @@ var gb_station_route = function () {
233 234 edit_buffer: function (station) {
234 235 gb_ct_map.editStationBuffer(station);
235 236 },
  237 + insert_road: function (station) {
  238 + gb_ct_map.insert_between_station_road(station);
  239 + },
236 240 edit_name: station_edit_name,
237 241 insert_before: insert_station_before,
238 242 insert_after: insert_station_after,
... ... @@ -246,9 +250,10 @@ var gb_station_route = function () {
246 250 className: 'station-route-ct-menu',
247 251 callback: function (key, options) {
248 252 var aLink = options.$trigger;
249   - var code = aLink.data('code'),
  253 + var id = aLink.data('id'),
  254 + code = aLink.data('code'),
250 255 updown = aLink.data('updown');
251   - var station = getStation(code, updown);
  256 + var station = getStation(id, code, updown);
252 257 realEditStation = station;
253 258 callbackHandler[key] && callbackHandler[key](station);
254 259 },
... ... @@ -266,6 +271,9 @@ var gb_station_route = function () {
266 271 'insert_before': {
267 272 name: '新增站点(之前)'
268 273 },
  274 + 'insert_road': {
  275 + name: '新增站点间路段'
  276 + },
269 277 'destroy': {
270 278 name: '撤销站点'
271 279 }
... ... @@ -385,7 +393,7 @@ var gb_station_route = function () {
385 393 var update = function (s) {
386 394 var array = station_maps[s.directions];
387 395 for(var i=0,item; item=array[i++];){
388   - if(item.stationCode==s.stationCode){
  396 + if(item.id==s.id){
389 397 s.index = i;
390 398 array.splice(i - 1, 1, s);
391 399 break;
... ... @@ -461,7 +469,7 @@ var gb_station_route = function () {
461 469 */
462 470 var addEnd = function (list, _newRCode) {
463 471 updateStationRouteData(list);
464   -
  472 +debugger;
465 473 var upDown = list[0].directions;
466 474 var wrap = $('.up_down_route_list>li:eq('+upDown+')>.station_route');
467 475 //新增的站点路由
... ...
src/main/resources/static/pages/base/geo_data_edit/js/submit.js
... ... @@ -14,6 +14,7 @@ var gb_data_submit = function () {
14 14 var f = $(this).parents('form');
15 15 var data = f.serializeJSON();
16 16 UIkit.modal.confirm('确定保存【'+data.stationName+'】的缓冲区信息?').then(function() {
  17 + debugger;
17 18 if(data.shapesType=='d'){
18 19 var polygon = gb_ct_map.getDrawPolygon();
19 20 if(null == polygon){
... ... @@ -103,10 +104,12 @@ var gb_data_submit = function () {
103 104 var f = $(this).parents('form');
104 105 var data = f.serializeJSON();
105 106  
106   - UIkit.modal.confirm('确定新增路段【'+data.sectionName+'('+data.crosesRoad+')】?').then(function() {
  107 + // UIkit.modal.confirm('确定新增路段【'+data.sectionName+'('+data.crosesRoad+')】?').then(function() {
  108 + UIkit.modal.confirm('确定新增路段【'+data.sectionName+')】?').then(function() {
107 109 data.lineCode = g_line_code;
108 110 data.versions = g_version;
109 111 data.upDown = getUpDown();
  112 + data.crosesRoad = null;
110 113  
111 114 data.prevRouteId = gb_road_route.getAddPrevId();
112 115  
... ... @@ -240,6 +243,7 @@ var gb_data_submit = function () {
240 243 }
241 244 return {
242 245 destroyStation: destroyStation,
243   - destroyRoad: destroyRoad
  246 + destroyRoad: destroyRoad,
  247 + hide_run_text: hide_run_text
244 248 };
245 249 }();
246 250 \ No newline at end of file
... ...
src/main/resources/static/pages/base/geo_data_edit/js/version_manage.js
... ... @@ -265,7 +265,6 @@ var gb_version_manage = function () {
265 265 var hour_int = hour - startDate.getHours();
266 266 showHour = hour_int >= 10 ? hour_int + "" : "0" + hour_int;
267 267 }
268   - debugger;
269 268 return dateStr+showHour + "时" + showMin + "分" + sec;
270 269 }
271 270  
... ...
src/main/resources/static/pages/base/geo_data_edit/main.html
... ... @@ -4,15 +4,23 @@
4 4 <head>
5 5 <meta charset="UTF-8">
6 6 <link rel="stylesheet" href="/assets/plugins/uk3.0/uikit.min.css"/>
7   - <link rel="stylesheet" href="/real_control_v2/assets/plugins/perfect-scrollbar/perfect-scrollbar.css" />
  7 + <link rel="stylesheet" href="/real_control_v2/assets/plugins/perfect-scrollbar/perfect-scrollbar.css"/>
8 8 <!-- jquery contextMenu style -->
9   - <link rel="stylesheet" href="/real_control_v2/assets/css/jquery.contextMenu.min.css" />
10   - <link rel="stylesheet"
11   - href="http://api.map.baidu.com/library/DrawingManager/1.4/src/DrawingManager_min.css"
12   - type="text/css" />
  9 + <link rel="stylesheet" href="/real_control_v2/assets/css/jquery.contextMenu.min.css"/>
  10 + <link rel="stylesheet" href="http://api.map.baidu.com/library/DrawingManager/1.4/src/DrawingManager_min.css"/>
13 11 <!-- main css -->
14   - <link rel="stylesheet" href="/pages/base/geo_data_edit/css/mian.css" />
15   - <link rel="stylesheet" href="/real_control_v2/assets/plugins/flatpickr/flatpickr.min.css">
  12 + <link rel="stylesheet" href="/pages/base/geo_data_edit/css/mian.css"/>
  13 + <link rel="stylesheet" href="/real_control_v2/assets/plugins/flatpickr/flatpickr.min.css"/>
  14 +
  15 + <!-- Bootstrap style -->
  16 + <link rel="stylesheet" href="/metronic_v4.5.4/plugins/bootstrap/css/bootstrap.min.css"/>
  17 + <!-- METRONIC style -->
  18 + <link rel="stylesheet" href="/metronic_v4.5.4/css/components.css"/>
  19 + <!-- Font Awesome 图标字体 -->
  20 + <link rel="stylesheet" href="/metronic_v4.5.4/plugins/font-awesome/css/font-awesome.min.css"/>
  21 + <!-- select2 下拉框插件 -->
  22 + <link rel="stylesheet" href="/metronic_v4.5.4/plugins/select2/css/select2.min.css" />
  23 + <!--<link rel="stylesheet" href="/metronic_v4.5.4/plugins/select2/css/select2-bootstrap.min.css" />-->
16 24 </head>
17 25  
18 26 <body>
... ... @@ -60,6 +68,18 @@
60 68 </div>
61 69 </div>
62 70 <a class="clock_enable_version"></a>
  71 + <div class="_batch_operation_wrap">
  72 + <a class="_batch_operation_text">批量操作</a>
  73 + <div uk-dropdown>
  74 + <ul class="uk-nav uk-dropdown-nav batch_operation_list">
  75 + <li><a href="javascript:;" id="batch_destroy_station" ><i class="fa fa-trash-o"></i> 撤销站点</a></li>
  76 + <li><a href="javascript:;" id="batch_destroy_section" ><i class="fa fa-trash-o"></i> 撤销路段</a></li>
  77 + <li><a href="javascript:;" id="wrench_down_dis"><i class="fa fa-wrench"></i> 设置站距</a></li>
  78 + <li><a href="javascript:;" id="retweet"><i class="fa fa-retweet"></i> 切换上下行走向</a></li>
  79 + <li><a href="javascript:;" id="quote_reverse_section"><i class="fa fa-long-arrow-down"></i> 引用反方向路段</a></li>
  80 + </ul>
  81 + </div>
  82 + </div>
63 83 </div>
64 84  
65 85 <div class="_route_info_wrap">
... ... @@ -97,6 +117,9 @@
97 117 <a uk-icon="icon: bookmark;ratio: .9" class="_icon" title="走向版本变更记录" uk-tooltip="pos:bottom"></a>
98 118 <a uk-icon="icon: expand;ratio: .9" class="_icon full_screen_icon"></a>
99 119 </div>
  120 +
  121 + <!-- 路径规划路段 -->
  122 + <input id="routePlanning" style="display:none;"/>
100 123 </div>
101 124  
102 125 <script id="geo_d_e_search_result-temp" type="text/html">
... ... @@ -126,7 +149,7 @@
126 149 {{/if}}
127 150 </script>
128 151 <!-- 百度 -->
129   -<script src="http://api.map.baidu.com/api?v=2.0&ak=IGGrr4UjwIYzatoCRFKEL8sT"></script>
  152 +<script src="http://api.map.baidu.com/api?v=2.0&ak=ciUonlrOyfIwIYc0z5V8cG4s"></script>
130 153 <script src="/metronic_v4.5.4/plugins/jquery.min.js"></script>
131 154 <script src="/assets/plugins/uk3.0/uikit.min.js"></script>
132 155 <script src="/assets/plugins/uk3.0/uikit-icons.min.js"></script>
... ... @@ -151,6 +174,31 @@
151 174 <script src="/real_control_v2/assets/plugins/flatpickr/l10n/zh.js" ></script>
152 175 <script src="/assets/plugins/pinyin.js"></script>
153 176  
  177 +
  178 +<!-- layer 弹层 -->
  179 +<script src="/assets/plugins/layer-v2.4/layer/layer.js" data-exclude=1></script>
  180 +<!-- bootstrap -->
  181 +<script src="/metronic_v4.5.4/plugins/bootstrap/js/bootstrap.min.js" data-exclude=1></script>
  182 +<!-- editable.js -->
  183 +<script src="/metronic_v4.5.4/plugins/bootstrap-editable/bootstrap-editable/js/bootstrap-editable.min.js"></script>
  184 +<script src="/metronic_v4.5.4//plugins/bootstrap-wizard/jquery.bootstrap.wizard.min.js"></script>
  185 +<!--表单验证-->
  186 +<script src="/metronic_v4.5.4//plugins/bootstrap-wizard/jquery.bootstrap.wizard.min.js"></script>
  187 +<!-- jquery.serializejson JSON序列化插件 -->
  188 +<script src="/assets/plugins/jquery.serializejson.js"></script>
  189 +<!-- art-template 模版引擎 -->
  190 +<script src="/assets/plugins/template.js"></script>
  191 +<!-- jquery.pageinator 分页 -->
  192 +<script src="/assets/plugins/jqPaginator.min.js"></script>
  193 +<!-- select2 下拉框 -->
  194 +<script src="/metronic_v4.5.4/plugins/select2/js/select2.full.min.js"></script>
  195 +<script src="/assets/js/common.js"></script>
  196 +<!-- jquery.validate 表单验证 -->
  197 +<script src="/metronic_v4.5.4/plugins/jquery-validation/js/jquery.validate.min.js"></script>
  198 +
  199 +
  200 +<script src="/pages/base/geo_data_edit/js/change_line.js" ></script>
  201 +
154 202 <script>
155 203 var $loadPanel = $('body>.loading');
156 204 //___________________________________
... ... @@ -275,7 +323,7 @@
275 323 <script src="/pages/base/geo_data_edit/js/map.js" ></script>
276 324 <script src="/pages/base/geo_data_edit/js/submit.js" ></script>
277 325 <script src="/pages/base/geo_data_edit/js/search.js" ></script>
278   -<script src="/pages/base/geo_data_edit/js/change_line.js" ></script>
  326 +<script src="/pages/base/geo_data_edit/js/batch_operation.js" ></script>
279 327  
280 328 <script type="text/javascript"
281 329 src="http://api.map.baidu.com/library/DrawingManager/1.4/src/DrawingManager_min.js"></script>
... ...
src/main/resources/static/pages/base/stationroute/css/bmap_base.css
... ... @@ -33,7 +33,7 @@ html,body{
33 33 z-index: 99;
34 34 height: 41px;
35 35 top: 30px;
36   - left: 500px;
  36 + margin-left: 420px;
37 37 background: #fff1f0;
38 38 padding: 0px;
39 39 box-shadow: 5px 1px 5px rgba(90, 90, 90, 0.48);
... ... @@ -97,21 +97,88 @@ html,body{
97 97 }
98 98  
99 99 .protlet-box .portlet-title {
100   - background-color:#fff1f0;
101   - font-weight: 600;
102   - color: #000 !important;
103   - padding: 0 0 0 15px;
  100 + width: 100%;
  101 + background-color:#fff;
  102 + height: 5rem;
  103 +}
  104 +
  105 +
  106 +.caption{
  107 + padding: 10px 8px;
  108 + font-weight: 600;
  109 + font-family: 微软雅黑;
  110 + font-size: 20px;
  111 + color: #484848 !important;
  112 + position: relative;
  113 +}
  114 +
  115 +._version_dropdown_wrap{
  116 + padding: 10px 8px;
  117 +}
  118 +._version_text{
  119 + font-size: 14px;
  120 + color: #0aae0a;
104 121 }
105 122  
  123 +a._version_text:hover{
  124 + color: #0aae0a;
  125 +}
  126 +
  127 +._version_dropdown_wrap li.uk-active>a{
  128 + color: blue;
  129 +}
  130 +.uk-nav-header:not(:first-child) {
  131 + margin-top: 10px;
  132 +}
  133 +.add_line_version_icon{
  134 + position: absolute;
  135 + right: 21px;
  136 + top: 20px;
  137 +}
  138 +
  139 +.remove_line_version_icon{
  140 + position: absolute;
  141 + right: 55px;
  142 + top: 20px;
  143 +}
  144 +
  145 +a.clock_enable_version,
  146 +a.clock_enable_version:hover,
  147 +a.clock_enable_version:active,
  148 +a.clock_enable_version:focus{
  149 + color: #ef4f4f;
  150 +}
  151 +
  152 +.clock_enable_version{
  153 + padding: 6px 0 0 13px;
  154 + font-size: 12px;
  155 + color: #ef4f4f;
  156 + overflow: hidden;
  157 + text-overflow: ellipsis;
  158 + white-space: nowrap;
  159 + display: block;
  160 +}
  161 +
  162 +.clock_enable_version .t_t_str{
  163 + font-size: 15px;
  164 + color: #ef4f4f;
  165 +}
  166 +
  167 +.clock_enable_version>a.uk-icon{
  168 + vertical-align: top;
  169 + margin-top: 5px;
  170 +}
  171 +
  172 +
106 173 .help-block{
107 174 color:#000;
108   - font-size: 15px;
  175 + font-size: 1.5rem;
109 176 }
110 177  
111 178 .info_win_btn {
112 179 background: #ff8355;
113 180 color: #fff;
114   - font-size: 12px;
  181 + font-size: 1rem;
115 182 margin: 0 5px 0 0;
116 183 border: 1px solid transparent;
117 184 }
... ...
src/main/resources/static/pages/base/stationroute/js/stationroute-list-function.js
... ... @@ -496,7 +496,7 @@ var PublicFunctions = function () {
496 496 WorldsBMap.setMap_status(1);
497 497 $('.protlet-box-layer').show();
498 498 },
499   - // 地图处于编辑状态
  499 + // 解除地图编辑状态
500 500 editMapStatusRemove : function () {
501 501 WorldsBMap.setMap_status(0);
502 502 $('.protlet-box-layer').hide();
... ...
src/main/resources/static/pages/base/stationroute/js/stationroute-list-map.js
... ... @@ -223,9 +223,9 @@ window.WorldsBMap = function () {
223 223 // 信息窗口参数属性
224 224 var opts = {
225 225 // 信息窗口宽度
226   - width: (width < 240 ? 240 : width),
  226 + width: (width < 248 ? 248 : width),
227 227 // 信息窗口高度
228   - height: shapes=="r" ?330:300,
  228 + height: shapes=="r" ?340:310,
229 229 // 信息窗位置偏移值。
230 230 offset: new BMap.Size(10,-20),
231 231 //设置不允许信窗发送短息
... ... @@ -244,7 +244,7 @@ window.WorldsBMap = function () {
244 244 } else if (objStation.stationRouteStationMark == 'E') {
245 245 markTypeStr = '终点站';
246 246 }
247   - var htm = '<span style="color: #ff8355;font-size: 20px; overflow: hidden; white-space: nowrap; text-overflow:ellipsis;display: -webkit-box; -webkit-box-orient: vertical;">' + objStation.stationRouteName + '</span>' +
  247 + var htm = '<span style="color: #ff8355;font-size: 2rem; overflow: hidden; white-space: nowrap; text-overflow:ellipsis;display: -webkit-box; -webkit-box-orient: vertical;">' + objStation.stationRouteName + '</span>' +
248 248 '<span class="help-block" >站点编码:' + objStation.stationCode + '</span>' +
249 249 '<span class="help-block" >站点序号:' + objStation.stationRouteCode + '</span>' +
250 250 '<span class="help-block" >站点类型:' + markTypeStr + '</span>' +
... ... @@ -693,7 +693,7 @@ window.WorldsBMap = function () {
693 693 var stationRouteBegin = route[0];
694 694 // 查询下一个站点
695 695 $.get("/stationroute/findDownStationRoute", {
696   - "lineId": stationRouteBegin.stationRouteLine,
  696 + "lineCode": stationRouteBegin.stationRouteLIneCode,
697 697 "direction": stationRouteBegin.stationRoutedirections,
698 698 "stationRouteCode": stationRouteBegin.stationRouteCode
699 699 }, function (stationRoute) {
... ... @@ -1046,7 +1046,7 @@ window.WorldsBMap = function () {
1046 1046 // 信息窗口参数属性
1047 1047 var opts = {
1048 1048 // 信息窗口宽度
1049   - width: (width < 200 ? 200 : width),
  1049 + width: (width < 240 ? 240 : width),
1050 1050 // 信息窗口高度
1051 1051 height: 150,
1052 1052 //设置不允许信窗发送短息
... ...
src/main/resources/static/pages/base/stationroute/js/stationroute-list-reload.js
... ... @@ -83,4 +83,64 @@ $(function(){
83 83 $('.green-seagreen dropdown-toggle').click(function(){
84 84 $('.dropdown-menu').css("display", "block");
85 85 });
  86 +
  87 + /**
  88 + * 展现的不是启用的版本,现在启用icon
  89 + */
  90 + $('.main_rt_tools_panel .t2_enable_icon').remove();
  91 + $('.remove_line_version_icon').hide();
  92 + var v_enable = storage.getItem('geo_data_enable_version');
  93 + var v_edit = storage.getItem('geo_data_edit_line_version');
  94 + if(v_enable != v_edit){
  95 + $('.remove_line_version_icon').show();
  96 + $('.main_rt_tools_panel')
  97 + .prepend('<a data-version="'+v_edit+'" uk-icon="icon: future;ratio: .9" class="_icon t2_enable_icon uk-animation-slide-right-small" title="启用这个走向版本" uk-tooltip="pos:bottom"></a>');
  98 + }
  99 +
  100 + /**
  101 + * 删除
  102 + */
  103 + $('.remove_line_version_icon').on('click', function () {
  104 + var version = storage.getItem('geo_data_edit_line_version');
  105 + var obj = findOne(version);
  106 +
  107 + var txt = '<span style="color:#ff4444;">你确定要删除 【'+obj.lineName+'】【'+obj.name+'】走向版本?</span>';
  108 + UIkit.modal.confirm(txt).then(function() {
  109 + $loadPanel.show();
  110 + gb_common.$post('/_geo_data/deleteLineVersion', {lineCode: obj.lineCode, version: obj.versions}, function (rs) {
  111 + storage.removeItem("geo_data_edit_line_version");
  112 + clearAll();
  113 + startup();
  114 + });
  115 + });
  116 + });
  117 +
  118 + /**
  119 + * 新增
  120 + */
  121 + $('.add_line_version_icon').on('click', function () {
  122 + var htmlStr = temps['geo_d_e_version_add-temp']({array: array});
  123 +
  124 + $(document.body).append(htmlStr);
  125 + UIkit.modal('#add_line_versions_modal').show();
  126 +
  127 + var conf = {minDate: gb_second_timer.now()};
  128 + $.extend(conf, gb_common.flatpickrDateTimeConfig);
  129 + flatpickr('#add_line_versions_modal input._flatpickr', conf);
  130 +
  131 +
  132 + var modal = '#add_line_versions_modal';
  133 + var reSetName = function () {
  134 + var remark = $('[name=remark]', modal).val();
  135 + var rq = $('[name=startDate]', modal).val();
  136 + document.getElementsByClassName('reminder_span')[0].style.visibility = 'hidden';
  137 +
  138 + $('[name=name]', modal).val(rq.substr(0, 10).replace(/-/g,'') + remark);
  139 + };
  140 + //自动填充版本名称
  141 + $('[name=remark]', modal).on('change', reSetName);
  142 + $('[name=startDate]', modal).on('input', reSetName);
  143 +
  144 + //console.log('时间aaa', gb_second_timer.now().getTime());
  145 + });
86 146 });
87 147 \ No newline at end of file
... ...
src/main/resources/static/pages/base/stationroute/list.html
... ... @@ -24,13 +24,24 @@
24 24 <div class="protlet-box-layer"></div>
25 25 <!-- 左边标题栏 -->
26 26 <div class="portlet-title">
27   - <div class="caption">
28   - <!-- 途径站点 -->
  27 + <div>
  28 + <div class="caption">
  29 + <!-- 途径站点 -->
  30 + </div>
  31 + <a class="remove_line_version_icon" title="删除线路版本" style="display: none; color: #484848"><i class="fa fa-trash-o fa-2x"></i></a>
  32 + <a class="add_line_version_icon" title="新增一个线路版本" style="color: #484848"><i class="fa fa-plus fa-2x"></i></a>
29 33 </div>
30   - <!--<div class="tools">
31   - <a href="javascript:;" class="collapse" data-original-title="" title=""> </a>
32   - </div>-->
  34 + <div class="_version_dropdown_wrap">
  35 + <a class="_version_text"></a>
  36 + <div uk-dropdown>
  37 + <ul class="uk-nav uk-dropdown-nav all_version_list">
  38 + </ul>
  39 + </div>
  40 + </div>
  41 + <a class="clock_enable_version"></a>
33 42 </div>
  43 +
  44 +
34 45 <!-- 左边栏 -->
35 46 <div class="portlet-body" id="scrllmouseEvent" style="border: 1px solid rgb(255, 255, 255); display: block;min-height: 520px;">
36 47 <div class="row">
... ... @@ -255,6 +266,15 @@
255 266 </div>
256 267 </div>
257 268 </div>
  269 +
  270 +<script>
  271 + var $loadPanel = $('body>.loading');
  272 + //___________________________________
  273 + var storage = window.localStorage;
  274 + //___________________________________
  275 +</script>
  276 +
  277 +
258 278 <!-- 线路类 -->
259 279 <script src="/pages/base/stationroute/js/line.js"></script>
260 280 <!-- 新增站点对象类 -->
... ...
src/main/resources/static/pages/base/timesmodel/edit-detail.html
... ... @@ -232,7 +232,6 @@
232 232 * @params [obj--甘特图对象;d--当前修改班次对象数据]
233 233 */
234 234 $('#editDetail_mobal').on('editDetailMobal.show', function(e,obj,nodeContext,bf,map){
235   - debugger;
236 235 // 定义当前班次数据.
237 236 var dqbcData = nodeContext.dqbcData;
238 237 var ddbcminztjx = isUpdsgbctzsj(dqbcData.bcType) || isUpdsgbctzsj(nodeContext.nextData.bcType) ? dqbcData.STOPTIME : obj.configuration.dataMap.minztjx,lastminztjx = 0;
... ...
src/main/resources/static/pages/base/timesmodel/js/base-fun.js
... ... @@ -1504,7 +1504,6 @@ var BaseFun = function() {
1504 1504 bxrcgs[r].sjgsV = gsv;
1505 1505 bxrcgs[r].bczs = bczs;
1506 1506 }
1507   - //debugger;
1508 1507 var jar3 = baseF.dqbcsAndgs(bxrcgs,jar,dataMap,cara.length);
1509 1508 // return {'json':jar3,'bxrcgs':bxrcgs};
1510 1509 /*var jar4 = baseF.tzsmbcsj01(
... ... @@ -1574,7 +1573,6 @@ var BaseFun = function() {
1574 1573 }
1575 1574 /*gs = gs + lpbcar[g].bcsj + lpbcar[g].STOPTIME;
1576 1575 if(lpbcar[g].STOPTIME==0 && g>0 && g<(lpbcar.length-1)) {
1577   - debugger;
1578 1576 lpbcar[g].isfb = 1;
1579 1577 sicftag = false;
1580 1578 }*/
... ...
src/main/resources/static/pages/base/timesmodel/js/d3.relationshipgraph.js
... ... @@ -3042,7 +3042,6 @@ var RelationshipGraph = function () {
3042 3042 /****************************************** update 当前的班次数据以及相关元素对象属性值. END ************************************/
3043 3043  
3044 3044 //console.log(nodeContext);
3045   - //debugger;
3046 3045 // 10、计算与上个班次的停站时间.
3047 3046 var dxMinues = parseInt((BaseFun.getDateTime(d.fcsj) - BaseFun.getDateTime(nodeContext.lastData.ARRIVALTIME)) / 60000);
3048 3047  
... ...
src/main/resources/static/pages/base/timesmodel/paramadd.html
... ... @@ -992,7 +992,6 @@
992 992 var hours=Math.floor(leave1/(3600*1000));
993 993 DXHOURS = days*24+hours;
994 994 WIDTH = DXHOURS*MINUTE*MULTIPLE;
995   - // debugger;
996 995 var lpsplitA = getylp(CSMap.maxCar);
997 996  
998 997 var sxsj = parseInt(map.upTravelTime);// 上行时间.
... ...