Commit d4a5dfb53dfb6ad0d4331ff7ffca7016352e91bb

Authored by 游瑞烽
1 parent e57115b7

Merge branch 'pudong' of 192.168.168.201:panzhaov5/bsth_control into pudong

# Conflicts:
#	src/main/resources/static/pages/base/timesmodel/add.html
#	src/main/resources/static/pages/base/timesmodel/fragments/addbc.html
#	src/main/resources/static/pages/base/timesmodel/fragments/deletelp.html
#	src/main/resources/static/pages/base/timesmodel/fragments/editbc.html
#	src/main/resources/static/pages/base/timesmodel/js/add-form-wizard.js
#	src/main/resources/static/pages/base/timesmodel/js/dateTimeTool.js
#	src/main/resources/static/pages/base/timesmodel/js/echartsDrawGanTT.js
#	src/main/resources/static/pages/base/timesmodel/js/gantt.js
#	src/main/resources/static/pages/base/timesmodel/js/systemTools.js
#	src/main/resources/static/pages/base/timesmodel/js/v1/AdjustTrip.js
#	src/main/resources/static/pages/base/timesmodel/js/v1/bcFun.js
#	src/main/resources/static/pages/base/timesmodel/js/v1/lpFun.js
#	src/main/resources/static/pages/base/timesmodel/js/v1/scheduleInitialize.js
Showing 43 changed files with 1810 additions and 2626 deletions
src/main/java/com/bsth/controller/StationRouteController.java
... ... @@ -120,7 +120,7 @@ public class StationRouteController extends BaseController<StationRoute, Integer
120 120 * @Description :TODO(查询站点的下一个缓存站点)
121 121 */
122 122 @RequestMapping(value = "/findDownStationRoute" , method = RequestMethod.GET)
123   - public List<Map<String, Object>> findDownStationRoute(@RequestParam Map<String, Object> map) {
  123 + public Map<String, Object> findDownStationRoute(@RequestParam Map<String, Object> map) {
124 124 return service.findDownStationRoute(map);
125 125 }
126 126  
... ...
src/main/java/com/bsth/data/gpsdata_v2/cache/GeoCacheData.java
... ... @@ -94,7 +94,7 @@ public class GeoCacheData {
94 94 }
95 95  
96 96 private void loadStationRoutesData(){
97   - String sql = "select r.LINE_CODE,r.DIRECTIONS,r.STATION_CODE,r.STATION_MARK,s.SHAPES_TYPE,s.G_LONX,s.G_LATY,ST_AsText(s.G_POLYGON_GRID) as G_POLYGON_GRID,s.RADIUS, r.STATION_ROUTE_CODE,s.STATION_NAME from bsth_c_stationroute r left join bsth_c_station s on r.station=s.id where r.destroy=0 order by r.station_route_code";
  97 + String sql = "select r.LINE_CODE,r.DIRECTIONS,r.STATION_CODE,r.STATION_MARK,r.SHAPES_TYPE,s.G_LONX,s.G_LATY,ST_AsText(r.G_POLYGON_GRID) as G_POLYGON_GRID,r.RADIUS, r.STATION_ROUTE_CODE,r.STATION_NAME from bsth_c_stationroute r left join bsth_c_station s on r.station=s.id where r.destroy=0 order by r.station_route_code";
98 98 List<StationRoute> routeList = jdbcTemplate.query(sql, new RowMapper<StationRoute>() {
99 99  
100 100 @Override
... ...
src/main/java/com/bsth/entity/Station.java
... ... @@ -6,8 +6,6 @@ import javax.persistence.Column;
6 6 import javax.persistence.Entity;
7 7 import javax.persistence.Id;
8 8 import javax.persistence.Table;
9   -
10   -import java.util.Arrays;
11 9 import java.util.Date;
12 10  
13 11  
... ... @@ -35,17 +33,8 @@ public class Station {
35 33 private Integer id;
36 34  
37 35 // 站点编码
38   - private String stationCod;
39   -
40   - // 站点名称
41   - private String stationName;
42   -
43   - // 所在道路编码
44   - private String roadCoding;
45   -
46   - // 站点的具体地址
47   - private String addr;
48   -
  36 + private String code;
  37 +
49 38 /**
50 39 * 经纬坐标类型
51 40 *
... ... @@ -63,43 +52,7 @@ public class Station {
63 52  
64 53 // 站点地理位置WGS坐标纬度
65 54 private Float gLaty;
66   -
67   - // 城建坐标 x
68   - private Float x;
69   -
70   - // 城建坐标 y
71   - private Float y;
72   -
73   - /**
74   - * 图形类型
75   - *
76   - * ------ r:圆形
77   - *
78   - * ------ p:多边形
79   - */
80   - private String shapesType;
81   -
82   - // 圆形半径
83   - private Integer radius;
84   -
85   - // 多边形空间WGS坐标点集合
86   - private byte[] gPolygonGrid;
87   -
88   - // 多边形空间原坐标坐标点集合
89   - private byte[] bPolygonGrid;
90   -
91   - /**
92   - * 是否撤销
93   - *
94   - * ------ 1:撤销
95   - *
96   - * ------ 0:不撤销
97   - */
98   - private Integer destroy;
99   -
100   - // 版本号
101   - private Integer versions;
102   -
  55 +
103 56 /** 是否有电子站牌 这里是老调度系统的原始字段,暂时保留该字段。 */
104 57 private Integer isHaveLed;
105 58  
... ... @@ -150,14 +103,6 @@ public class Station {
150 103 this.isHarbourStation = isHarbourStation;
151 104 }
152 105  
153   - public String getAddr() {
154   - return addr;
155   - }
156   -
157   - public void setAddr(String addr) {
158   - this.addr = addr;
159   - }
160   -
161 106 public Integer getId() {
162 107 return id;
163 108 }
... ... @@ -166,28 +111,12 @@ public class Station {
166 111 this.id = id;
167 112 }
168 113  
169   - public String getStationCod() {
170   - return stationCod;
171   - }
172   -
173   - public void setStationCod(String stationCod) {
174   - this.stationCod = stationCod;
175   - }
176   -
177   - public String getStationName() {
178   - return stationName;
179   - }
180   -
181   - public void setStationName(String stationName) {
182   - this.stationName = stationName;
  114 + public String getCode() {
  115 + return code;
183 116 }
184 117  
185   - public String getRoadCoding() {
186   - return roadCoding;
187   - }
188   -
189   - public void setRoadCoding(String roadCoding) {
190   - this.roadCoding = roadCoding;
  118 + public void setCode(String code) {
  119 + this.code = code;
191 120 }
192 121  
193 122 public String getDbType() {
... ... @@ -222,70 +151,6 @@ public class Station {
222 151 this.gLaty = gLaty;
223 152 }
224 153  
225   - public Float getX() {
226   - return x;
227   - }
228   -
229   - public void setX(Float x) {
230   - this.x = x;
231   - }
232   -
233   - public Float getY() {
234   - return y;
235   - }
236   -
237   - public void setY(Float y) {
238   - this.y = y;
239   - }
240   -
241   - public String getShapesType() {
242   - return shapesType;
243   - }
244   -
245   - public void setShapesType(String shapesType) {
246   - this.shapesType = shapesType;
247   - }
248   -
249   - public Integer getRadius() {
250   - return radius;
251   - }
252   -
253   - public void setRadius(Integer radius) {
254   - this.radius = radius;
255   - }
256   -
257   - public byte[] getgPolygonGrid() {
258   - return gPolygonGrid;
259   - }
260   -
261   - public void setgPolygonGrid(byte[] gPolygonGrid) {
262   - this.gPolygonGrid = gPolygonGrid;
263   - }
264   -
265   - public byte[] getbPolygonGrid() {
266   - return bPolygonGrid;
267   - }
268   -
269   - public void setbPolygonGrid(byte[] bPolygonGrid) {
270   - this.bPolygonGrid = bPolygonGrid;
271   - }
272   -
273   - public Integer getDestroy() {
274   - return destroy;
275   - }
276   -
277   - public void setDestroy(Integer destroy) {
278   - this.destroy = destroy;
279   - }
280   -
281   - public Integer getVersions() {
282   - return versions;
283   - }
284   -
285   - public void setVersions(Integer versions) {
286   - this.versions = versions;
287   - }
288   -
289 154 public String getDescriptions() {
290 155 return descriptions;
291 156 }
... ... @@ -328,11 +193,8 @@ public class Station {
328 193  
329 194 @Override
330 195 public String toString() {
331   - return "Station [id=" + id + ", stationCod=" + stationCod + ", stationName=" + stationName + ", roadCoding="
332   - + roadCoding + ", addr=" + addr + ", dbType=" + dbType + ", bJwpoints=" + bJwpoints + ", gLonx=" + gLonx
333   - + ", gLaty=" + gLaty + ", x=" + x + ", y=" + y + ", shapesType=" + shapesType + ", radius=" + radius
334   - + ", gPolygonGrid=" + Arrays.toString(gPolygonGrid) + ", bPolygonGrid=" + Arrays.toString(bPolygonGrid)
335   - + ", destroy=" + destroy + ", versions=" + versions + ", isHaveLed=" + isHaveLed + ", isHaveShelter="
  196 + return "Station [id=" + id + ", code=" + code + ", dbType=" + dbType + ", bJwpoints=" + bJwpoints + ", gLonx=" + gLonx
  197 + + ", gLaty=" + gLaty + ", isHaveLed=" + isHaveLed + ", isHaveShelter="
336 198 + isHaveShelter + ", isHarbourStation=" + isHarbourStation + ", descriptions=" + descriptions
337 199 + ", createBy=" + createBy + ", updateBy=" + updateBy + ", createDate=" + createDate + ", updateDate="
338 200 + updateDate + "]";
... ...
src/main/java/com/bsth/entity/StationRoute.java
... ... @@ -43,10 +43,27 @@ public class StationRoute {
43 43  
44 44 // 线路编码
45 45 private String lineCode;
46   -
  46 +
47 47 /**
48   - * 站点类型
49   - *
  48 + * 图形类型
  49 + *
  50 + * ------ r:圆形
  51 + *
  52 + * ------ p:多边形
  53 + */
  54 + private String shapesType;
  55 +
  56 + // 圆形半径
  57 + private Integer radius;
  58 +
  59 + // 多边形空间WGS坐标点集合
  60 + private byte[] gPolygonGrid;
  61 +
  62 + // 多边形空间原坐标坐标点集合
  63 + private byte[] bPolygonGrid;
  64 +
  65 + /*** 站点类型
  66 + *
50 67 * ------ B:起点站
51 68 *
52 69 * ------ Z:中途站
... ... @@ -147,6 +164,38 @@ public class StationRoute {
147 164 this.lineCode = lineCode;
148 165 }
149 166  
  167 + public String getShapesType() {
  168 + return shapesType;
  169 + }
  170 +
  171 + public void setShapesType(String shapesType) {
  172 + this.shapesType = shapesType;
  173 + }
  174 +
  175 + public Integer getRadius() {
  176 + return radius;
  177 + }
  178 +
  179 + public void setRadius(Integer radius) {
  180 + this.radius = radius;
  181 + }
  182 +
  183 + public byte[] getgPolygonGrid() {
  184 + return gPolygonGrid;
  185 + }
  186 +
  187 + public void setgPolygonGrid(byte[] gPolygonGrid) {
  188 + this.gPolygonGrid = gPolygonGrid;
  189 + }
  190 +
  191 + public byte[] getbPolygonGrid() {
  192 + return bPolygonGrid;
  193 + }
  194 +
  195 + public void setbPolygonGrid(byte[] bPolygonGrid) {
  196 + this.bPolygonGrid = bPolygonGrid;
  197 + }
  198 +
150 199 public String getStationMark() {
151 200 return stationMark;
152 201 }
... ...
src/main/java/com/bsth/entity/StationRouteCache.java
... ... @@ -27,83 +27,100 @@ import java.util.Date;
27 27 })
28 28 })
29 29 public class StationRouteCache {
30   -
  30 +
31 31 //站点路由ID
32 32 @Id
33 33 @GeneratedValue(strategy = GenerationType.IDENTITY)
34 34 private Integer id;
35   -
  35 +
36 36 // 站点路由序号
37 37 private Integer stationRouteCode;
38   -
  38 +
39 39 // 站点编码
40 40 private String stationCode;
41   -
  41 +
42 42 // 站点名称
43 43 private String stationName;
44   -
  44 +
45 45 // 线路编码
46 46 private String lineCode;
47   -
  47 +
48 48 /**
49   - * 站点类型
50   - *
  49 + * 图形类型
  50 + *
  51 + * ------ r:圆形
  52 + *
  53 + * ------ p:多边形
  54 + */
  55 + private String shapesType;
  56 +
  57 + // 圆形半径
  58 + private Integer radius;
  59 +
  60 + // 多边形空间WGS坐标点集合
  61 + private String gPolygonGrid;
  62 +
  63 + // 多边形空间原坐标坐标点集合
  64 + private String bPolygonGrid;
  65 +
  66 + /*** 站点类型
  67 + *
51 68 * ------ B:起点站
52   - *
  69 + *
53 70 * ------ Z:中途站
54   - *
  71 + *
55 72 * ------ E:终点站
56   - *
  73 + *
57 74 * ------ T:停车场
58   - *
  75 + *
59 76 */
60 77 private String stationMark;
61   -
  78 +
62 79 // 站点路由出站序号
63 80 private Integer outStationNmber;
64   -
  81 +
65 82 // 站点路由到站距离
66 83 private Double distances;
67   -
  84 +
68 85 // 站点路由到站时间
69 86 private Double toTime;
70   -
  87 +
71 88 // 首班时间
72 89 private String firstTime;
73   -
  90 +
74 91 // 末班时间
75 92 private String endTime;
76   -
  93 +
77 94 // 站点路由方向
78 95 private Integer directions;
79   -
  96 +
80 97 // 版本号
81 98 private Integer versions;
82   -
  99 +
83 100 // 是否撤销
84 101 private Integer destroy;
85   -
  102 +
86 103 // 描述
87 104 private String descriptions;
88   -
  105 +
89 106 // 创建人
90 107 private Integer createBy;
91   -
  108 +
92 109 // 修改人
93 110 private Integer updateBy;
94   -
  111 +
95 112 // 创建日期
96 113 @Column(updatable = false, name = "create_date", columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP")
97 114 private Date createDate;
98   -
  115 +
99 116 // 修改日期
100 117 @Column(name = "update_date", columnDefinition = "timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP")
101 118 private Date updateDate;
102   -
  119 +
103 120 // 站点信息
104 121 @ManyToOne(fetch = FetchType.LAZY)
105 122 private Station station;
106   -
  123 +
107 124 // 线路信息
108 125 @ManyToOne
109 126 private Line line;
... ... @@ -148,6 +165,38 @@ public class StationRouteCache {
148 165 this.lineCode = lineCode;
149 166 }
150 167  
  168 + public String getShapesType() {
  169 + return shapesType;
  170 + }
  171 +
  172 + public void setShapesType(String shapesType) {
  173 + this.shapesType = shapesType;
  174 + }
  175 +
  176 + public Integer getRadius() {
  177 + return radius;
  178 + }
  179 +
  180 + public void setRadius(Integer radius) {
  181 + this.radius = radius;
  182 + }
  183 +
  184 + public String getgPolygonGrid() {
  185 + return gPolygonGrid;
  186 + }
  187 +
  188 + public void setgPolygonGrid(String gPolygonGrid) {
  189 + this.gPolygonGrid = gPolygonGrid;
  190 + }
  191 +
  192 + public String getbPolygonGrid() {
  193 + return bPolygonGrid;
  194 + }
  195 +
  196 + public void setbPolygonGrid(String bPolygonGrid) {
  197 + this.bPolygonGrid = bPolygonGrid;
  198 + }
  199 +
151 200 public String getStationMark() {
152 201 return stationMark;
153 202 }
... ... @@ -203,7 +252,7 @@ public class StationRouteCache {
203 252 public void setDirections(Integer directions) {
204 253 this.directions = directions;
205 254 }
206   -
  255 +
207 256 public Integer getVersions() {
208 257 return versions;
209 258 }
... ... @@ -211,7 +260,7 @@ public class StationRouteCache {
211 260 public void setVersions(Integer versions) {
212 261 this.versions = versions;
213 262 }
214   -
  263 +
215 264 public Integer getDestroy() {
216 265 return destroy;
217 266 }
... ...
src/main/java/com/bsth/repository/StationRepository.java
... ... @@ -41,7 +41,7 @@ public interface StationRepository extends BaseRepository&lt;Station, Integer&gt; {
41 41 , nativeQuery=true)
42 42 List<Object[]> findStationName(String stationName);*/
43 43 @Query(value = " SELECT t.b_jwpoints,t.id FROM (" +
44   - " SELECT b.id,b.b_jwpoints,b.station_name,a.directions FROM (" +
  44 + " SELECT b.id,b.b_jwpoints,a.station_name,a.directions FROM (" +
45 45 " SELECT s.station,s.station_name,s.directions FROM bsth_c_stationroute s where s.destroy = 0 and s.directions = ?1) a " +
46 46 " LEFT JOIN bsth_c_station b on a.station = b. id) t where t.station_name LIKE ?2"
47 47 , nativeQuery=true)
... ... @@ -52,68 +52,40 @@ public interface StationRepository extends BaseRepository&lt;Station, Integer&gt; {
52 52 *
53 53 * @param map <stationCode:站点编码;stationName:站点名称;roadCoding:道路编码;dbType:原坐标类型;bJwpoints:中心点百度坐标
54 54 *
55   - * gLonx:中心点WGS坐标经度;gLaty:中心点WGS坐标纬度;x:城建x;y:城建坐标y;gPloygonGrid:多变形WGS坐标;
56   - *
57   - * bPloygonGrid:多边形百度坐标;destroy:是否撤销;radius:圆半径;shapesType:图形类型;versions:版本号;
58   - *
59   - * descriptions:说明;createBy:创建人;updateBy:更新人>
  55 + * gLonx:中心点WGS坐标经度;gLaty:中心点WGS坐标纬度;descriptions:说明;createBy:创建人;updateBy:更新人>
60 56 */
61   - @Transactional
62 57 @Modifying
63 58 @Query(value="INSERT INTO bsth_c_station (" +
64   - "station_cod , station_name , road_coding , db_type , b_jwpoints , " +
65   - "g_lonx , g_laty , x , y , g_polygon_grid,b_polygon_grid, " +
66   - "destroy , radius , shapes_type , versions , descriptions," +
67   - "create_by,update_by,id) " +
  59 + "id, code , db_type , b_jwpoints , " +
  60 + "g_lonx , g_laty , create_by, update_by) " +
68 61 " VALUES(" +
69 62 "?1 , ?2 , ?3 , ?4 , ?5," +
70   - "?6 , ?7 , ?8 , ?9 , ST_GeomFromText(?10),ST_GeomFromText(?11)," +
71   - "?12 ,?13, ?14, ?15, ?16," +
72   - "?17,?18,?19)", nativeQuery=true)
73   - public void stationSave(String stationCode,String stationName,String roadCoding,String dbType,String bJwpoints,
  63 + "?6 , ?7 , ?8)", nativeQuery=true)
  64 + public void stationSave(int id, String stationCode,String dbType,String bJwpoints,
74 65  
75   - Float gLonx, Float gLaty, Float x,Float y, String gPloygonGrid, String bPloygonGrid,
76   -
77   - Integer destroy,Integer radius,String shapesType,Integer versions,String descriptions,Integer createBy,Integer updateBy,int id);
  66 + Float gLonx, Float gLaty,Integer createBy,Integer updateBy);
78 67  
79 68 /**
80 69 * @Description :TODO(站点更新)
81 70 *
82   - * @param map <stationCode:站点编码;stationName:站点名称;roadCoding:道路编码;dbType:原坐标类型;bJwpoints:中心点百度坐标
83   - *
84   - * gLonx:中心点WGS坐标经度;gLaty:中心点WGS坐标纬度;x:城建x;y:城建坐标y;gPloygonGrid:多变形WGS坐标;
85   - *
86   - * bPloygonGrid:多边形百度坐标;destroy:是否撤销;radius:圆半径;shapesType:图形类型;versions:版本号;
  71 + * @param map <dbType:原坐标类型;bJwpoints:中心点百度坐标
87 72 *
88   - * descriptions:说明;createBy:创建人;updateBy:更新人>
  73 + * gLonx:中心点WGS坐标经度;gLaty:中心点WGS坐标纬度;updateBy:更新人>
89 74 */
90 75 @Transactional
91 76 @Modifying
92 77 @Query(value="UPDATE bsth_c_station SET " +
93   - "station_cod = ?1 , " +
94   - "station_name = ?2 , " +
95   - "road_coding = ?3 , " +
96   - "db_type = ?4 , " +
97   - "b_jwpoints = ?5 , " +
98   - "g_lonx = ?6 , " +
99   - "g_laty = ?7 , " +
100   - "x = ?8 , " +
101   - "y = ?9 , " +
102   - "b_polygon_grid = ST_GeomFromText(?10) , " +
103   - "g_polygon_grid = ST_GeomFromText(?11) , " +
104   - "destroy = ?12 , " +
105   - "radius = ?13 , " +
106   - "shapes_type = ?14 , " +
107   - "versions = ?15 , " +
108   - "descriptions = ?16 " +
109   - " WHERE id = ?17 ", nativeQuery=true)
110   - public void stationUpdate(String stationCod,String stationName,String roadCoding,String dbType,String bJwpoints,
111   -
112   - Float gLonx,Float gLaty,Float x,Float y, String bPolygonGrid,String gPolygonGrid,
113   -
114   - Integer destroy, Integer radius,String shapesType, Integer versions,String descriptions,Integer stationId);
  78 + "db_type = ?1, " +
  79 + "b_jwpoints = ?2, " +
  80 + "g_lonx = ?3, " +
  81 + "g_laty = ?4, " +
  82 + "update_by = ?5" +
  83 + " WHERE id = ?6 ", nativeQuery=true)
  84 + public void stationUpdate(String dbType,String bJwpoints,Float gLonx,Float gLaty,Integer updateBy,Integer stationId);
115 85  
116 86  
117   - @Query(value = "select st_astext(g_polygon_grid) as g_polygon_grid, shapes_type,concat(g_lonx, ' ', g_laty) as g_center_point ,radius, station_cod,station_name from bsth_c_station where station_cod=?1", nativeQuery = true)
  87 + @Query(value = "select st_astext(g_polygon_grid) as g_polygon_grid, shapes_type,concat(g_lonx, ' ', g_laty) as g_center_point ,radius, code,station_name from bsth_c_station where code=?1", nativeQuery = true)
  88 + /*@Query(value = "select st_astext(r.g_polygon_grid) as g_polygon_grid, r.shapes_type,concat(s.g_lonx, ' ', s.g_laty) as g_center_point ,r.radius, code,station_name " +
  89 + "from bsth_c_station s, bsth_c_stationroute r where s.id=r.station code=?1", nativeQuery = true)*/
118 90 public Object[][] bufferAera(String stationCode);
119 91 }
... ...
src/main/java/com/bsth/repository/StationRouteCacheRepository.java
1 1 package com.bsth.repository;
2 2  
3   -import java.util.List;
4   -
  3 +import com.bsth.entity.StationRouteCache;
5 4 import org.springframework.data.jpa.repository.EntityGraph;
6 5 import org.springframework.data.jpa.repository.Modifying;
7 6 import org.springframework.data.jpa.repository.Query;
8 7 import org.springframework.stereotype.Repository;
  8 +import org.springframework.transaction.annotation.Transactional;
9 9  
10   -import com.bsth.entity.StationRouteCache;
  10 +import java.util.List;
11 11  
12 12 /**
13 13 *
... ... @@ -64,55 +64,32 @@ public interface StationRouteCacheRepository extends BaseRepository&lt;StationRoute
64 64 public void stationRouteCacheDel(Integer lineId,Integer dir);
65 65  
66 66  
67   - @Query(value = "SELECT a.`stationRoute.id`," +
68   - "a.`stationRoute.line`," +
69   - "a.`stationRoute.station`," +
70   - "a.`stationRoute.stationName`," +
71   - "a.`stationRoute.stationRouteCode`," +
72   - "a.`stationRoute.lineCode`," +
73   - "a.`stationRoute.stationMark`," +
74   - "a.`stationRoute.outStationNmber`," +
75   - "a.`stationRoute.directions`," +
76   - "a.`stationRoute.distances`," +
77   - "a.`stationRoute.toTime`," +
78   - "a.`stationRoute.firstTime`," +
79   - "a.`stationRoute.endTime`," +
80   - "a.`stationRoute.descriptions`," +
81   - "a.`stationRoute.versions`," +
  67 + @Query(value = "SELECT r.id AS 'stationRoute.id'," +
  68 + "r.line AS 'stationRoute.line'," +
  69 + "r.station AS 'stationRoute.station'," +
  70 + "r.station_name AS 'stationRoute.stationName'," +
  71 + "r.station_route_code as 'stationRoute.stationRouteCode'," +
  72 + "r.line_code AS 'stationRoute.lineCode'," +
  73 + "r.station_mark AS 'stationRoute.stationMark'," +
  74 + "r.directions AS 'stationRoute.directions'," +
  75 + "r.distances AS 'stationRoute.distances'," +
  76 + "r.to_time AS 'stationRoute.toTime'," +
  77 + "r.descriptions AS 'stationRoute.descriptions'," +
  78 + "r.versions AS 'stationRoute.versions'," +
  79 + "r.shapes_type AS stationShapesType,"+
  80 + "r.radius AS stationRadius," +
  81 + "ST_AsText(r.g_polygon_grid) AS stationGPloyonGrid," +
  82 + "ST_AsText(r.b_polygon_grid) AS stationBPolyonGrid," +
82 83 "b.id AS 'station.id'," +
83   - "b.station_cod AS 'station.stationCod'," +
84   - "b.station_name AS 'station.stationName'," +
85   - "b.road_coding AS 'station.roadCoding'," +
  84 + "b.code AS 'station.stationCod'," +
86 85 "b.db_type AS 'station.dbType'," +
87 86 "b.b_jwpoints AS 'station.bJwpoints'," +
88 87 "b.g_lonx AS 'station.gLonx'," +
89   - "b.g_lonx AS 'station.gLaty'," +
90   - "b.x AS 'station.x'," +
91   - "b.y AS 'station.y'," +
92   - "b.shapes_type AS 'station.shapesType'," +
93   - "b.radius AS 'station.radius'," +
94   - "ST_AsText(b.g_polygon_grid) AS 'station.gPolygonGrid'," +
95   - "ST_AsText(b.b_polygon_grid) AS 'station.bPolygonGrid'," +
96   - "b.destroy AS 'station.destroy'," +
97   - "b.versions AS 'station.versions'," +
98   - "b.descriptions AS 'station.descriptions' FROM (" +
99   - "SELECT r.id AS 'stationRoute.id'," +
100   - " r.line AS 'stationRoute.line'," +
101   - "r.station AS 'stationRoute.station'," +
102   - "r.station_name AS 'stationRoute.stationName'," +
103   - "r.station_route_code as 'stationRoute.stationRouteCode'," +
104   - "r.line_code AS 'stationRoute.lineCode'," +
105   - "r.station_mark AS 'stationRoute.stationMark'," +
106   - "r.out_station_nmber AS 'stationRoute.outStationNmber'," +
107   - "r.directions AS 'stationRoute.directions'," +
108   - "r.distances AS 'stationRoute.distances'," +
109   - "r.to_time AS 'stationRoute.toTime'," +
110   - "r.first_time AS 'stationRoute.firstTime'," +
111   - "r.end_time AS 'stationRoute.endTime'," +
112   - "r.descriptions AS 'stationRoute.descriptions'," +
113   - "r.versions AS 'stationRoute.versions' FROM bsth_c_stationroute_cache r WHERE r.line = ?1 and r.directions = ?2 and r.destroy=0) a " +
  88 + "b.g_lonx AS 'station.gLaty', " +
  89 + "r.destroy AS destroy " +
  90 + "FROM bsth_c_stationroute_cache r " +
114 91 "LEFT JOIN bsth_c_station b " +
115   - "ON a.`stationRoute.station` = b.id ORDER BY a.`stationRoute.stationRouteCode` ASC", nativeQuery=true)
  92 + "ON r.station = b.id WHERE r.line = ?1 and r.directions = ?2 and r.destroy=0 ORDER BY r.station_route_code ASC", nativeQuery=true)
116 93 List<Object[]> findCachePoint(int lineId, int dir);
117 94  
118 95  
... ... @@ -139,4 +116,47 @@ public interface StationRouteCacheRepository extends BaseRepository&lt;StationRoute
139 116 @Modifying
140 117 @Query(value="UPDATE bsth_c_stationroute_cache set station_route_code = (station_route_code+10) where line = ?1 and directions = ?2 and station_route_code >=?3 and destroy = 0", nativeQuery=true)
141 118 public void stationUpdStationRouteCode(Integer line,Integer dir,Integer routeCod);
  119 +
  120 + /**
  121 + * @Description :TODO(站点添加)
  122 + */
  123 + @Transactional
  124 + @Modifying
  125 + @Query(value="INSERT INTO bsth_c_stationroute_cache (line, line_code, station, station_code, station_name, station_route_code," +
  126 + " b_polygon_grid, g_polygon_grid, radius, shapes_type, station_mark, directions, distances, to_time, destroy, versions) " +
  127 + " VALUES(?1,?2,?3,?4,?5,?6,ST_GeomFromText(?7),ST_GeomFromText(?8),?9,?10,?11,?12,?13,?14,?15,?16)", nativeQuery=true)
  128 + public void stationRouteCacheAdd(Integer line, String line_code, Integer station, String station_code, String station_name, Integer station_route_code,
  129 +
  130 + String b_polygon_grid, String g_polygon_grid, Integer radius, String shapes_type,
  131 +
  132 + String station_mark ,Integer directions, double distances,double to_time, Integer destroy, Integer versions);
  133 +
  134 + /**
  135 + * @Description :TODO(站点更新)
  136 + */
  137 + @Transactional
  138 + @Modifying
  139 + @Query(value="UPDATE bsth_c_stationroute SET " +
  140 + "line = ?1 , " +
  141 + "station = ?2 , " +
  142 + "station_code = ?3 , " +
  143 + "station_name = ?4 , " +
  144 + "line_code = ?5 , " +
  145 + "b_polygon_grid = ST_GeomFromText(?6) , " +
  146 + "g_polygon_grid = ST_GeomFromText(?7) , " +
  147 + "radius = ?8 , " +
  148 + "shapes_type = ?9 , " +
  149 + "station_route_code = ?10 , " +
  150 + "station_mark = ?11 , " +
  151 + "destroy = ?12 , " +
  152 + "directions = ?13 , " +
  153 + "distances = ?14 , " +
  154 + "to_time = ?15 , " +
  155 + "versions = ?16 " +
  156 + " WHERE id = ?17 ", nativeQuery=true)
  157 + public void stationRouteCacheUpdate(Integer line, Integer station, String station_code, String station_name, String line_code,
  158 +
  159 + String b_polygon_grid, String g_polygon_grid, Integer radius, String shapes_type, Integer station_route_code,
  160 +
  161 + String station_mark, Integer destroy ,Integer directions, double distances,double to_time, Integer versions, Integer id);
142 162 }
... ...
src/main/java/com/bsth/repository/StationRouteRepository.java
... ... @@ -50,24 +50,24 @@ public interface StationRouteRepository extends BaseRepository&lt;StationRoute, Int
50 50 "a.`stationRoute.endTime`," +
51 51 "a.`stationRoute.descriptions`," +
52 52 "a.`stationRoute.versions`," +
  53 + "a.stationShapesType," +
  54 + "a.stationRadius," +
  55 + "a.stationGPloyonGrid, " +
  56 + "a.stationBPolyonGrid," +
53 57 "b.id AS 'station.id'," +
54   - "b.station_cod AS 'station.stationCod'," +
55   - "b.station_name AS 'station.stationName'," +
56   - "b.road_coding AS 'station.roadCoding'," +
  58 + "b.code AS 'station.stationCod'," +
57 59 "b.db_type AS 'station.dbType'," +
58 60 "b.b_jwpoints AS 'station.bJwpoints'," +
59 61 "b.g_lonx AS 'station.gLonx'," +
60 62 "b.g_lonx AS 'station.gLaty'," +
61   - "b.x AS 'station.x'," +
62   - "b.y AS 'station.y'," +
63   - "b.shapes_type AS 'station.shapesType'," +
64   - "b.radius AS 'station.radius'," +
65   - "ST_AsText(b.g_polygon_grid) AS 'station.gPolygonGrid'," +
66   - "ST_AsText(b.b_polygon_grid) AS 'station.bPolygonGrid'," +
67   - "b.destroy AS 'station.destroy'," +
68   - "b.versions AS 'station.versions'," +
69 63 "b.descriptions AS 'station.descriptions' FROM (" +
70 64 "SELECT r.id AS 'stationRoute.id'," +
  65 +
  66 + " ST_AsText(r.b_polygon_grid) as stationBPolyonGrid," +
  67 + " ST_AsText(r.g_polygon_grid) AS stationGPloyonGrid, " +
  68 + " r.radius AS stationRadius," +
  69 + " r.shapes_type AS stationShapesType," +
  70 +
71 71 " r.line AS 'stationRoute.line'," +
72 72 "r.station AS 'stationRoute.station'," +
73 73 "r.station_name AS 'stationRoute.stationName'," +
... ... @@ -110,66 +110,14 @@ public interface StationRouteRepository extends BaseRepository&lt;StationRoute, Int
110 110 *
111 111 * @return List<Map<String, Object>>
112 112 */
113   - @Query(value = "SELECT a.stationRouteLine," +
114   - " a.stationRouteStation," +
115   - " a.stationRouteCode," +
116   - " a.stationRouteLIneCode," +
117   - " a.stationRouteStationMark," +
118   - " a.stationOutStationNmber," +
119   - " a.stationRoutedirections," +
120   - " a.stationRouteDistances," +
121   - " a.stationRouteToTime," +
122   - " a.staitonRouteFirstTime," +
123   - " a.stationRouteEndTime," +
124   - " a.stationRouteDescriptions," +
125   - " a.stationRouteDestroy," +
126   - " a.stationRouteVersions," +
127   - " a.stationRouteCreateBy," +
128   - " a.stationRouteCreateDate," +
129   - " a.stationRouteUpdateBy," +
130   - " a.stationRouteUpdateDate," +
131   - " b.id AS stationId," +
132   - " b.station_cod AS stationCode," +
133   - " a.stationRouteName," +
134   - " b.road_coding AS stationRoadCoding," +
135   - " b.db_type AS stationDbType," +
  113 + @Query(value = "SELECT a.stationRouteName," +
  114 + " a.stationRouteId, "+
  115 + " b.code AS stationCode," +
136 116 " b.b_jwpoints AS stationJwpoints," +
137 117 " b.g_lonx AS stationGlonx," +
138   - " b.g_laty AS stationGlaty," +
139   - " b.x AS stationX," +
140   - " b.y AS stationY," +
141   - " ST_AsText(b.b_polygon_grid) as stationBPolyonGrid," +
142   - " ST_AsText(b.g_polygon_grid) AS stationGPloyonGrid, " +
143   - " b.destroy AS stationDestroy," +
144   - " b.radius AS stationRadius," +
145   - " b.shapes_type AS stationShapesType," +
146   - " b.versions AS stationVersions," +
147   - " b.descriptions AS sttationDescriptions," +
148   - " b.create_by AS stationCreateBy," +
149   - " b.create_date AS stationCreateDate," +
150   - " b.update_by AS stationUpdateBy," +
151   - " b.update_date AS stationUpdateDate," +
152   - " a.stationRouteId,b.station_name as zdmc "+
  118 + " b.g_laty AS stationGlaty" +
153 119 " FROM ( SELECT s.id AS stationRouteId," +
154   - " s.line AS stationRouteLine," +
155   - " s.station as stationRouteStation," +
156   - " s.station_name AS stationRouteName," +
157   - " s.station_route_code as stationRouteCode," +
158   - " s.line_code AS stationRouteLIneCode," +
159   - " s.station_mark AS stationRouteStationMark," +
160   - " s.out_station_nmber AS stationOutStationNmber," +
161   - " s.directions AS stationRoutedirections," +
162   - " s.distances AS stationRouteDistances," +
163   - " s.to_time AS stationRouteToTime," +
164   - " s.first_time AS staitonRouteFirstTime," +
165   - " s.end_time AS stationRouteEndTime," +
166   - " s.descriptions AS stationRouteDescriptions," +
167   - " s.destroy AS stationRouteDestroy," +
168   - " s.versions AS stationRouteVersions," +
169   - " s.create_by AS stationRouteCreateBy," +
170   - " s.create_date AS stationRouteCreateDate," +
171   - " s.update_by AS stationRouteUpdateBy," +
172   - " s.update_date AS stationRouteUpdateDate FROM bsth_c_stationroute s WHERE s.station_route_code =(" +
  120 + " s.station_name AS stationRouteName FROM bsth_c_stationroute s WHERE s.station_route_code =(" +
173 121 "select MIN(station_route_code) as stationRouteCode from bsth_c_stationroute r WHERE " +
174 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 " +
175 123 " LEFT JOIN bsth_c_station b ON a.stationRouteStation = b.id", nativeQuery=true)
... ... @@ -177,32 +125,28 @@ public interface StationRouteRepository extends BaseRepository&lt;StationRoute, Int
177 125  
178 126 /**
179 127 * @Description :TODO(站点中心点坐标查询)
180   - *
  128 + *
181 129 * @param map <lineId:线路ID; direction:方向>
182   - *
  130 + *
183 131 * @return List<Object[]>
184 132 */
185   - /*@Query(value = "SELECT s.b_jwpoints,s.station_name FROM (" +
186   - "SELECT b.station FROM bsth_c_stationroute b where b.line =?1 and b.directions = ?2 and b.destroy=0) r " +
187   - "LEFT JOIN bsth_c_station s on r.station = s.id", nativeQuery=true)*/
  133 +
188 134 @Query(value = "SELECT s.b_jwpoints,r.station_name,r.station_route_code FROM (" +
189 135 "SELECT b.station,b.station_route_code,b.station_name FROM bsth_c_stationroute b where b.line =?1 and b.directions = ?2 and b.destroy=0) r " +
190   - "LEFT JOIN bsth_c_station s on r.station = s.id order by r.station_route_code asc", nativeQuery=true)
  136 + "LEFT JOIN bsth_c_station s on r.station = s.id order by r.station_route_code asc", nativeQuery=true)
191 137 List<Object[]> getSelectStationRouteCenterPoints(Integer lineId,Integer direction);
192   -
  138 +
193 139 /**
194 140 * @Description :TODO(撤销站点)
195   - *
  141 + *
196 142 * @param map <lineId:线路ID; destroy:是否撤销(0:否;1:是)>
197   - *
198 143 */
199 144 @Transactional
200 145 @Modifying
201 146 @Query(value="UPDATE bsth_c_stationroute SET " +
202 147 "destroy = ?2 WHERE id = ?1", nativeQuery=true)
203 148 public void stationRouteIsDestroyUpd(Integer stationRouteId, Integer destroy);
204   -
205   -
  149 +
206 150 /**
207 151 * @Description : TODO(根据线路ID生成行单)
208 152 *
... ... @@ -210,7 +154,7 @@ public interface StationRouteRepository extends BaseRepository&lt;StationRoute, Int
210 154 *
211 155 * @return List<Object[]>:{[0]:g_lonx(GPS经度);[1]:g_laty(GPS纬度);[2]:b_jwpoints(百度经纬度坐标)
212 156 *
213   - * [3]:station_mark(站点类型);[4]:station_route_code(站点序号);[5]:station_cod(站点编码);
  157 + * [3]:station_mark(站点类型);[4]:station_route_code(站点序号);[5]:code(站点编码);
214 158 *
215 159 * [6]:distances(站点距离);[7]:station_name(站点名称);[8]:directions(方向)}
216 160 */
... ... @@ -219,7 +163,7 @@ public interface StationRouteRepository extends BaseRepository&lt;StationRoute, Int
219 163 "b.g_laty,b.b_jwpoints," +
220 164 "a.station_mark," +
221 165 "a.station_route_code," +
222   - "b.station_cod," +
  166 + "b.code," +
223 167 "a.distances,"+
224 168 "b.station_name," +
225 169 "a.directions FROM (SELECT " +
... ... @@ -253,33 +197,23 @@ public interface StationRouteRepository extends BaseRepository&lt;StationRoute, Int
253 197 " a.stationRouteDescriptions," +
254 198 " a.stationRouteDestroy," +
255 199 " a.stationRouteVersions," +
256   - " a.stationRouteCreateBy," +
257   - " a.stationRouteCreateDate," +
258   - " a.stationRouteUpdateBy," +
259   - " a.stationRouteUpdateDate," +
260   - " b.id AS stationId," +
261   - " b.station_cod AS stationCode," +
262 200 " a.stationRouteName," +
263   - " b.road_coding AS stationRoadCoding," +
  201 + " a.stationBPolyonGrid," +
  202 + " a.stationGPloyonGrid, " +
  203 + " a.stationRadius," +
  204 + " a.stationShapesType," +
  205 + " b.id AS stationId," +
  206 + " b.code AS stationCode," +
264 207 " b.db_type AS stationDbType," +
265 208 " b.b_jwpoints AS stationJwpoints," +
266 209 " b.g_lonx AS stationGlonx," +
267 210 " b.g_laty AS stationGlaty," +
268   - " b.x AS stationX," +
269   - " b.y AS stationY," +
270   - " ST_AsText(b.b_polygon_grid) as stationBPolyonGrid," +
271   - " ST_AsText(b.g_polygon_grid) AS stationGPloyonGrid, " +
272   - " b.destroy AS stationDestroy," +
273   - " b.radius AS stationRadius," +
274   - " b.shapes_type AS stationShapesType," +
275   - " b.versions AS stationVersions," +
276   - " b.descriptions AS sttationDescriptions," +
277   - " b.create_by AS stationCreateBy," +
278   - " b.create_date AS stationCreateDate," +
279   - " b.update_by AS stationUpdateBy," +
280   - " b.update_date AS stationUpdateDate," +
281   - " a.stationRouteId,b.station_name as zdmc "+
  211 + " a.stationRouteId " +
282 212 " FROM ( SELECT s.id AS stationRouteId," +
  213 + " ST_AsText(s.b_polygon_grid) as stationBPolyonGrid," +
  214 + " ST_AsText(s.g_polygon_grid) AS stationGPloyonGrid, " +
  215 + " s.radius AS stationRadius," +
  216 + " s.shapes_type AS stationShapesType," +
283 217 " s.line AS stationRouteLine," +
284 218 " s.station as stationRouteStation," +
285 219 " s.station_name AS stationRouteName," +
... ... @@ -294,11 +228,7 @@ public interface StationRouteRepository extends BaseRepository&lt;StationRoute, Int
294 228 " s.end_time AS stationRouteEndTime," +
295 229 " s.descriptions AS stationRouteDescriptions," +
296 230 " s.destroy AS stationRouteDestroy," +
297   - " s.versions AS stationRouteVersions," +
298   - " s.create_by AS stationRouteCreateBy," +
299   - " s.create_date AS stationRouteCreateDate," +
300   - " s.update_by AS stationRouteUpdateBy," +
301   - " s.update_date AS stationRouteUpdateDate FROM bsth_c_stationroute s WHERE s.id = ?1 ) a " +
  231 + " s.versions AS stationRouteVersions FROM bsth_c_stationroute s WHERE s.id = ?1 ) a " +
302 232 " LEFT JOIN bsth_c_station b ON a.stationRouteStation = b.id", nativeQuery=true)
303 233 List<Object[]> findStationRouteInfo(Integer id);
304 234  
... ... @@ -323,33 +253,23 @@ public interface StationRouteRepository extends BaseRepository&lt;StationRoute, Int
323 253 " a.stationRouteDescriptions," +
324 254 " a.stationRouteDestroy," +
325 255 " a.stationRouteVersions," +
326   - " a.stationRouteCreateBy," +
327   - " a.stationRouteCreateDate," +
328   - " a.stationRouteUpdateBy," +
329   - " a.stationRouteUpdateDate," +
330   - " b.id AS stationId," +
331   - " b.station_cod AS stationCode," +
332 256 " a.stationRouteName," +
333   - " b.road_coding AS stationRoadCoding," +
  257 + " a.stationBPolyonGrid," +
  258 + " a.stationGPloyonGrid, " +
  259 + " a.stationRadius," +
  260 + " a.stationShapesType," +
  261 + " b.id AS stationId," +
  262 + " b.code AS stationCode," +
334 263 " b.db_type AS stationDbType," +
335 264 " b.b_jwpoints AS stationJwpoints," +
336 265 " b.g_lonx AS stationGlonx," +
337 266 " b.g_laty AS stationGlaty," +
338   - " b.x AS stationX," +
339   - " b.y AS stationY," +
340   - " ST_AsText(b.b_polygon_grid) as stationBPolyonGrid," +
341   - " ST_AsText(b.g_polygon_grid) AS stationGPloyonGrid, " +
342   - " b.destroy AS stationDestroy," +
343   - " b.radius AS stationRadius," +
344   - " b.shapes_type AS stationShapesType," +
345   - " b.versions AS stationVersions," +
346   - " b.descriptions AS sttationDescriptions," +
347   - " b.create_by AS stationCreateBy," +
348   - " b.create_date AS stationCreateDate," +
349   - " b.update_by AS stationUpdateBy," +
350   - " b.update_date AS stationUpdateDate," +
351   - " a.stationRouteId,b.station_name as zdmc "+
  267 + " a.stationRouteId" +
352 268 " FROM ( SELECT s.id AS stationRouteId," +
  269 + " ST_AsText(s.b_polygon_grid) as stationBPolyonGrid," +
  270 + " ST_AsText(s.g_polygon_grid) AS stationGPloyonGrid, " +
  271 + " s.radius AS stationRadius," +
  272 + " s.shapes_type AS stationShapesType," +
353 273 " s.line AS stationRouteLine," +
354 274 " s.station as stationRouteStation," +
355 275 " s.station_name AS stationRouteName," +
... ... @@ -364,11 +284,7 @@ public interface StationRouteRepository extends BaseRepository&lt;StationRoute, Int
364 284 " s.end_time AS stationRouteEndTime," +
365 285 " s.descriptions AS stationRouteDescriptions," +
366 286 " s.destroy AS stationRouteDestroy," +
367   - " s.versions AS stationRouteVersions," +
368   - " s.create_by AS stationRouteCreateBy," +
369   - " s.create_date AS stationRouteCreateDate," +
370   - " s.update_by AS stationRouteUpdateBy," +
371   - " s.update_date AS stationRouteUpdateDate FROM bsth_c_stationroute s WHERE s.line = ?1 and s.directions = ?2 and s.destroy = 0) a " +
  287 + " s.versions AS stationRouteVersions FROM bsth_c_stationroute s WHERE s.line = ?1 and s.directions = ?2 and s.destroy = 0) a " +
372 288 " LEFT JOIN bsth_c_station b ON a.stationRouteStation = b.id order by a.stationRouteCode", nativeQuery=true)
373 289 List<Object[]> getStationRouteList(Integer lineId, Integer dir);
374 290  
... ... @@ -395,7 +311,7 @@ public interface StationRouteRepository extends BaseRepository&lt;StationRoute, Int
395 311 @Query(value = "select r from StationRoute r where r.destroy=0")
396 312 List<StationRoute> findAll();
397 313  
398   - @Query("select new map(sr.station.id as stationid, sr.stationName as stationname) from StationRoute sr where sr.line.id=?1 and sr.directions=?2")
  314 + @Query("select sr.station.id as stationid, sr.stationName as stationname from StationRoute sr where sr.line.id=?1 and sr.directions=?2")
399 315 List<Map<String, Object>> findStations(Integer xlid, Integer xldir);
400 316  
401 317 @Query("select r from StationRoute r where r.lineCode=?1 and r.directions=?2 and r.destroy=0 order by r.stationRouteCode")
... ... @@ -476,7 +392,7 @@ public interface StationRouteRepository extends BaseRepository&lt;StationRoute, Int
476 392 */
477 393 @Modifying
478 394 @Query(value="insert into (select * from bsth_c_stationroute_cache where line = ?1 and directions = ?2) bsth_c_stationroute", nativeQuery=true)
479   - public void stationRouteUpdate(Integer line,Integer dir);
  395 + public void batchAddStationRoute(Integer line,Integer dir);
480 396  
481 397 // 更具线路批量撤销
482 398 @Modifying
... ... @@ -487,4 +403,47 @@ public interface StationRouteRepository extends BaseRepository&lt;StationRoute, Int
487 403 @Modifying
488 404 @Query(value="delete from StationRoute sr where sr.line.id = ?1 and sr.lineCode = ?2")
489 405 void batchDelete(Integer lineId, String lineCode);
  406 +
  407 + /**
  408 + * @Description :TODO(站点添加)
  409 + */
  410 + @Transactional
  411 + @Modifying
  412 + @Query(value="INSERT INTO bsth_c_stationroute (line, line_code, station, station_code, station_name, station_route_code, b_polygon_grid, g_polygon_grid, radius, shapes_type, station_mark, directions, distances, to_time, destroy, versions) " +
  413 + " VALUES(?1,?2,?3,?4,?5,?6,ST_GeomFromText(?7),ST_GeomFromText(?8),?9,?10,?11,?12,?13,?14,?15,?16)", nativeQuery=true)
  414 + public void stationRouteAdd(Integer line, String line_code, Integer station, String station_code, String station_name, Integer station_route_code,
  415 +
  416 + String b_polygon_grid, String g_polygon_grid, Integer radius, String shapes_type,
  417 +
  418 + String station_mark ,Integer directions, double distances,double to_time, Integer destroy, Integer versions);
  419 +
  420 + /**
  421 + * @Description :TODO(站点更新)
  422 + */
  423 + @Transactional
  424 + @Modifying
  425 + @Query(value="UPDATE bsth_c_stationroute SET " +
  426 + "line = ?1 , " +
  427 + "station = ?2 , " +
  428 + "station_code = ?3 , " +
  429 + "station_name = ?4 , " +
  430 + "line_code = ?5 , " +
  431 + "b_polygon_grid = ST_GeomFromText(?6) , " +
  432 + "g_polygon_grid = ST_GeomFromText(?7) , " +
  433 + "radius = ?8 , " +
  434 + "shapes_type = ?9 , " +
  435 + "station_route_code = ?10 , " +
  436 + "station_mark = ?11 , " +
  437 + "destroy = ?12 , " +
  438 + "directions = ?13 , " +
  439 + "distances = ?14 , " +
  440 + "to_time = ?15 , " +
  441 + "versions = ?16 " +
  442 + " WHERE id = ?17 ", nativeQuery=true)
  443 + public void stationRouteUpdate(Integer line, Integer station, String station_code, String station_name, String line_code,
  444 +
  445 + String b_polygon_grid, String g_polygon_grid, Integer radius, String shapes_type, Integer station_route_code,
  446 +
  447 + String station_mark, Integer destroy ,Integer directions, double distances,double to_time, Integer versions, Integer id);
  448 +
490 449 }
... ...
src/main/java/com/bsth/service/StationRouteService.java
... ... @@ -82,7 +82,7 @@ public interface StationRouteService extends BaseService&lt;StationRoute, Integer&gt;
82 82 *
83 83 * @return List<Map<String, Object>>
84 84 */
85   - List<Map<String, Object>> findDownStationRoute(Map<String, Object> map);
  85 + Map<String, Object> findDownStationRoute(Map<String, Object> map);
86 86  
87 87 /**
88 88 * @Description :TODO(查询线路某方向下所有站点的中心百度坐标)
... ...
src/main/java/com/bsth/service/geo_data/impl/GeoDataServiceImpl.java
... ... @@ -55,7 +55,7 @@ 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.station_cod";
  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";
59 59  
60 60  
61 61 List<GeoStation> list = jdbcTemplate.query(sql, BeanPropertyRowMapper.newInstance(GeoStation.class));
... ... @@ -129,13 +129,13 @@ public class GeoDataServiceImpl implements GeoDataService {
129 129 String shapesType = station.getShapesType();
130 130 int rsCount = -1;
131 131 if (shapesType.equals("r")) {
132   - sql = "update bsth_c_station set g_lonx=?, g_laty=?, radius=?,shapes_type='r' where station_cod=?";
  132 + sql = "update bsth_c_station set g_lonx=?, g_laty=?, radius=?,shapes_type='r' where code=?";
133 133 rsCount = jdbcTemplate.update(sql, station.getgLonx(), station.getgLaty(), station.getRadius(), station.getStationCode());
134 134 } else if (shapesType.equals("d")) {
135 135 //多边形坐标转换
136 136 String bdPolygon = "POLYGON((" + station.getgPolygonGrid() + "))";
137 137 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 station_cod=?";
  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=?";
139 139  
140 140 rsCount = jdbcTemplate.update(sql, station.getgLonx(), station.getgLaty(), station.getStationCode());
141 141 }
... ... @@ -180,7 +180,7 @@ public class GeoDataServiceImpl implements GeoDataService {
180 180 //更新历史站点路由
181 181 jdbcTemplate.update("update bsth_c_ls_stationroute set station_name=? where id=?", name, id);
182 182 //更新站点
183   - jdbcTemplate.update("update bsth_c_station set station_name=? where station_cod=?", name, code);
  183 + jdbcTemplate.update("update bsth_c_station set station_name=? where code=?", name, code);
184 184  
185 185 //写一条走向变更记录
186 186 jdbcTemplate.update("insert into logger_route_synchro(t, line_code, version) values(?, ?, ?)", System.currentTimeMillis(), lineCode, versions);
... ... @@ -385,7 +385,7 @@ public class GeoDataServiceImpl implements GeoDataService {
385 385  
386 386 if (extendsVersion != -1) {
387 387 //复制站点信息
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.station_cod where t1.destroy=0 and t1.line_code='" + lineCode + "' and t1.versions="+extendsVersion+" order by t1.directions, t1.station_route_code";
  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";
389 389 List<CascadeSaveStation> cssList = jdbcTemplate.query(sql, BeanPropertyRowMapper.newInstance(CascadeSaveStation.class));
390 390  
391 391 //新的站点编码
... ... @@ -592,7 +592,7 @@ public class GeoDataServiceImpl implements GeoDataService {
592 592 */
593 593 private void batchInsertStation(final List<CascadeSaveStation> cssList, final int version) {
594 594 //站点
595   - jdbcTemplate.batchUpdate("insert into bsth_c_station(id, station_cod, station_name, db_type, b_jwpoints, g_lonx, g_laty, destroy, radius, shapes_type, versions, g_polygon_grid) " +
  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) " +
596 596 " values(?,?,?,?,?,?,?,?,?,?,?,ST_GeomFromText(?))", new BatchPreparedStatementSetter() {
597 597 @Override
598 598 public void setValues(PreparedStatement ps, int i) throws SQLException {
... ... @@ -679,8 +679,8 @@ public class GeoDataServiceImpl implements GeoDataService {
679 679  
680 680 //insert 站点
681 681 long sCode = GetUIDAndCode.getStationId();
682   - jdbcTemplate.update("insert into bsth_c_station(id, station_cod, station_name, db_type, b_jwpoints, g_lonx, g_laty, destroy, radius, shapes_type, versions) " +
683   - " values(?,?,?,?,?,?,?,?,?,?,?)", sCode, sCode, stationName, "b", lng + " " + lat, wgsLoc.getLng(), wgsLoc.getLat(), 0, 88, "r", 1);
  682 + jdbcTemplate.update("insert into bsth_c_station(id, code, db_type, b_jwpoints, g_lonx, g_laty) " +
  683 + " values(?,?,?,?,?,?)", sCode, sCode, "b", lng + " " + lat, wgsLoc.getLng(), wgsLoc.getLat());
684 684  
685 685  
686 686 SaveStationRouteDTO sr;
... ... @@ -794,7 +794,7 @@ public class GeoDataServiceImpl implements GeoDataService {
794 794  
795 795 private List<GeoStation> findByUpdown(String lineCode, int upDown, int versions) {
796 796 //返回更新之后的数据
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.station_cod";
  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";
798 798 List<GeoStation> list = jdbcTemplate.query(sql, BeanPropertyRowMapper.newInstance(GeoStation.class));
799 799  
800 800 for (GeoStation station : list) {
... ... @@ -959,7 +959,7 @@ public class GeoDataServiceImpl implements GeoDataService {
959 959 * @return
960 960 */
961 961 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.station_cod";
  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";
963 963 List<GeoStation> list = jdbcTemplate.query(sql, BeanPropertyRowMapper.newInstance(GeoStation.class));
964 964  
965 965 GeoStation s = list.get(0);
... ...
src/main/java/com/bsth/service/impl/StationRouteServiceImpl.java
... ... @@ -241,40 +241,28 @@ public class StationRouteServiceImpl extends BaseServiceImpl&lt;StationRoute, Integ
241 241 tempM.put("stationRouteDescriptions", stationList.get(i)[13]);
242 242 // 站点路由版本
243 243 tempM.put("stationRouteVersions", stationList.get(i)[14]);
  244 + // 站点图形类型
  245 + tempM.put("stationShapesType", stationList.get(i)[15]);
  246 + // 站点圆半径
  247 + tempM.put("stationRadius", stationList.get(i)[16]);
  248 + // 站点图形WGS坐标
  249 + tempM.put("stationGPolygonGrid", stationList.get(i)[17]);
  250 + // 站点图形百度坐标
  251 + tempM.put("stationBPolygonGrid", stationList.get(i)[18]);
244 252 // 站点ID
245   - tempM.put("stationId", stationList.get(i)[15]);
  253 + tempM.put("stationId", stationList.get(i)[19]);
246 254 // 站点编码
247   - tempM.put("stationCode", stationList.get(i)[16]);
248   - // 站点名称
249   - tempM.put("stationStationName", stationList.get(i)[17]);
250   - // 路段编码
251   - tempM.put("stationRoadCoding", stationList.get(i)[18]);
  255 + tempM.put("stationCode", stationList.get(i)[20]);
252 256 // 原坐标类型
253   - tempM.put("stationDbType", stationList.get(i)[19]);
  257 + tempM.put("stationDbType", stationList.get(i)[21]);
254 258 // 中心点(百度坐标)
255   - tempM.put("stationJwpoints", stationList.get(i)[20]);
  259 + tempM.put("stationJwpoints", stationList.get(i)[22]);
256 260 // 中心点(WGS经度)
257   - tempM.put("stationGLonx", stationList.get(i)[21]);
  261 + tempM.put("stationGLonx", stationList.get(i)[23]);
258 262 // 中心点(WGS纬度)
259   - tempM.put("stationGLaty", stationList.get(i)[22]);
260   - // 城建坐标x
261   - tempM.put("stationx", stationList.get(i)[23]);
262   - // 城建坐标y
263   - tempM.put("stationy", stationList.get(i)[24]);
264   - // 站点图形类型
265   - tempM.put("stationShapesType", stationList.get(i)[25]);
266   - // 站点圆半径
267   - tempM.put("stationRadius", stationList.get(i)[26]);
268   - // 站点图形WGS坐标
269   - tempM.put("stationGPolygonGrid", stationList.get(i)[27]);
270   - // 站点图形百度坐标
271   - tempM.put("stationBPolygonGrid", stationList.get(i)[28]);
272   - // 是否撤销
273   - tempM.put("stationDestroy", stationList.get(i)[29]);
274   - // 站点版本
275   - tempM.put("stationVersions", stationList.get(i)[30]);
  263 + tempM.put("stationGLaty", stationList.get(i)[24]);
276 264 // 站点说明
277   - tempM.put("stationDescriptions", stationList.get(i)[31]);
  265 + tempM.put("stationDescriptions", stationList.get(i)[25]);
278 266 tempM.put("zdmc", stationList.get(i)[3]);
279 267 tempM.put("text", stationList.get(i)[3]);
280 268 tempM.put("icon", "fa fa-bus");
... ... @@ -503,18 +491,22 @@ public class StationRouteServiceImpl extends BaseServiceImpl&lt;StationRoute, Integ
503 491 * @return List<Map<String, Object>>
504 492 */
505 493 @Override
506   - public List<Map<String, Object>> findDownStationRoute(Map<String, Object> map) {
  494 + public Map<String, Object> findDownStationRoute(Map<String, Object> map) {
507 495 Integer lineId = map.get("lineId").equals("") ? null : Integer.parseInt(map.get("lineId").toString());
508 496 Integer direction = map.get("direction").equals("") ? null : Integer.parseInt(map.get("direction").toString());
509 497 Integer stationRouteCode = map.get("stationRouteCode").equals("") ? null : Integer.parseInt(map.get("stationRouteCode").toString());
510 498 List<Object[]> objects = repository.findDownStationRoute(lineId, direction, stationRouteCode);
511   - List<Map<String, Object>> resultList = new ArrayList<Map<String,Object>>();
  499 + Map<String, Object> resultList = new HashMap<String,Object>();
512 500  
513 501 int len = objects.size();
514 502  
515 503 if(objects.size()>0) {
516   - // 遍历站点
517   - traversalStation(objects, resultList, len);
  504 + for(int i = 0 ; i < len; i++) {
  505 + resultList.put("stationRouteName", objects.get(i)[0]);
  506 + resultList.put("stationRouteId", objects.get(i)[1]);
  507 + resultList.put("stationRouteCode", objects.get(i)[2]);
  508 + resultList.put("stationJwpoints", objects.get(i)[3]);
  509 + }
518 510 }
519 511 return resultList;
520 512 }
... ... @@ -524,85 +516,31 @@ public class StationRouteServiceImpl extends BaseServiceImpl&lt;StationRoute, Integ
524 516 Map<String, Object> tempM = new HashMap<String,Object>();
525 517  
526 518 tempM.put("stationRouteLine", objects.get(i)[0]);
527   -
528 519 tempM.put("stationRouteStation", objects.get(i)[1]);
529   -
530 520 tempM.put("stationRouteCode", objects.get(i)[2]);
531   -
532 521 tempM.put("stationRouteLIneCode", objects.get(i)[3]);
533   -
534 522 tempM.put("stationRouteStationMark", objects.get(i)[4]);
535   -
536 523 tempM.put("stationOutStationNmber", objects.get(i)[5]);
537   -
538 524 tempM.put("stationRoutedirections", objects.get(i)[6]);
539   -
540 525 tempM.put("stationRouteDistances", objects.get(i)[7]);
541   -
542 526 tempM.put("stationRouteToTime", objects.get(i)[8]);
543   -
544 527 tempM.put("staitonRouteFirstTime", objects.get(i)[9]);
545   -
546 528 tempM.put("stationRouteEndTime", objects.get(i)[10]);
547   -
548 529 tempM.put("stationRouteDescriptions", objects.get(i)[11]);
549   -
550 530 tempM.put("stationRouteDestroy", objects.get(i)[12]);
551   -
552 531 tempM.put("stationRouteVersions", objects.get(i)[13]);
553   -
554   - tempM.put("stationRouteCreateBy", objects.get(i)[14]);
555   -
556   - tempM.put("stationRouteCreateDate", objects.get(i)[15]);
557   -
558   - tempM.put("stationRouteUpdateBy", objects.get(i)[16]);
559   -
560   - tempM.put("stationRouteUpdateDate", objects.get(i)[17]);
561   -
562   - tempM.put("stationId", objects.get(i)[18]);
563   -
564   - tempM.put("stationCode", objects.get(i)[19]);
565   -
566   - tempM.put("stationRouteName", objects.get(i)[20]);
567   -
568   - tempM.put("stationRoadCoding", objects.get(i)[21]);
569   -
570   - tempM.put("stationDbType", objects.get(i)[22]);
571   -
572   - tempM.put("stationJwpoints", objects.get(i)[23]);
573   -
574   - tempM.put("stationGlonx", objects.get(i)[24]);
575   -
576   - tempM.put("stationGlaty", objects.get(i)[25]);
577   -
578   - tempM.put("stationX", objects.get(i)[26]);
579   -
580   - tempM.put("stationY", objects.get(i)[27]);
581   -
582   - tempM.put("stationBPolyonGrid", objects.get(i)[28]);
583   -
584   - tempM.put("stationGPloyonGrid", objects.get(i)[29]);
585   -
586   - tempM.put("stationDestroy", objects.get(i)[30]);
587   -
588   - tempM.put("stationRadius", objects.get(i)[31]);
589   -
590   - tempM.put("stationShapesType", objects.get(i)[32]);
591   -
592   - tempM.put("stationVersions", objects.get(i)[33]);
593   -
594   - tempM.put("sttationDescriptions", objects.get(i)[34]);
595   -
596   - tempM.put("stationCreateBy", objects.get(i)[35]);
597   -
598   - tempM.put("stationCreateDate", objects.get(i)[36]);
599   -
600   - tempM.put("stationUpdateBy", objects.get(i)[37]);
601   -
602   - tempM.put("stationUpdateDate", objects.get(i)[38]);
603   -
604   - tempM.put("stationRouteId", objects.get(i)[39]);
605   - tempM.put("zdmc", objects.get(i)[40]);
  532 + tempM.put("stationRouteName", objects.get(i)[14]);
  533 + tempM.put("stationBPolyonGrid", objects.get(i)[15]);
  534 + tempM.put("stationGPloyonGrid", objects.get(i)[16]);
  535 + tempM.put("stationRadius", objects.get(i)[17]);
  536 + tempM.put("stationShapesType", objects.get(i)[18]);
  537 + tempM.put("stationId", objects.get(i)[19]);
  538 + tempM.put("stationCode", objects.get(i)[20]);
  539 + tempM.put("stationDbType", objects.get(i)[21]);
  540 + tempM.put("stationJwpoints", objects.get(i)[22]);
  541 + tempM.put("stationGlonx", objects.get(i)[23]);
  542 + tempM.put("stationGlaty", objects.get(i)[24]);
  543 + tempM.put("stationRouteId", objects.get(i)[25]);
606 544  
607 545 resultList.add(tempM);
608 546 }
... ... @@ -844,7 +782,7 @@ public class StationRouteServiceImpl extends BaseServiceImpl&lt;StationRoute, Integ
844 782 *
845 783 * {[0]:g_lonx(GPS经度);[1]:g_laty(GPS纬度);[2]:b_jwpoints(百度经纬度坐标)
846 784 *
847   - * [3]:station_mark(站点类型);[4]:station_route_code(站点序号);[5]:station_cod(站点编码);
  785 + * [3]:station_mark(站点类型);[4]:station_route_code(站点序号);[5]:code(站点编码);
848 786 *
849 787 * [6]:distances(站点距离);[7]:station_name(站点名称);[8]:directions(方向)}
850 788 *
... ... @@ -1301,103 +1239,52 @@ public class StationRouteServiceImpl extends BaseServiceImpl&lt;StationRoute, Integ
1301 1239 for(int i = 0 ; i < stationList.size(); i++) {
1302 1240  
1303 1241 Map<String, Object> tempM = new HashMap<String, Object>();
1304   -
1305 1242 // 站点路由ID
1306 1243 tempM.put("stationRouteId", stationList.get(i)[0]);
1307   -
1308 1244 // 站点路由线路ID
1309 1245 tempM.put("stationRouteLine", stationList.get(i)[1]);
1310   -
1311 1246 // 站点路由站点ID
1312 1247 tempM.put("stationRouteStation", stationList.get(i)[2]);
1313   -
1314 1248 // 站点路由名称
1315 1249 tempM.put("stationRouteStationName", stationList.get(i)[3]);
1316   -
1317 1250 // 站点路由站点序号
1318 1251 tempM.put("stationRouteStationRouteCode", stationList.get(i)[4]);
1319   -
1320 1252 // 站点路由线路编码
1321 1253 tempM.put("stationRouteLineCode", stationList.get(i)[5]);
1322   -
1323 1254 // 站点路由站点类型
1324 1255 tempM.put("stationRouteStationMark", stationList.get(i)[6]);
1325   -
1326   - // 站点路由出站的序号
1327   - tempM.put("stationRouteOutStationNmber", stationList.get(i)[7]);
1328   -
1329 1256 // 站点路由站点方向
1330   - tempM.put("stationRouteDirections", stationList.get(i)[8]);
1331   -
  1257 + tempM.put("stationRouteDirections", stationList.get(i)[7]);
1332 1258 // 站点路由站点到站距离
1333   - tempM.put("stationRouteDistances", stationList.get(i)[9]);
1334   -
  1259 + tempM.put("stationRouteDistances", stationList.get(i)[8]);
1335 1260 // 站点路由到站时间
1336   - tempM.put("stationRouteToTime", stationList.get(i)[10]);
1337   -
1338   - // 站点路由站点首班时间
1339   - tempM.put("stationRouteFirstTime", stationList.get(i)[11]);
1340   -
1341   - // 站点路由站点末班时间
1342   - tempM.put("stationRouteEndTime", stationList.get(i)[12]);
1343   -
  1261 + tempM.put("stationRouteToTime", stationList.get(i)[9]);
1344 1262 // 站点路由站点说明
1345   - tempM.put("stationRouteDescriptions", stationList.get(i)[13]);
1346   -
  1263 + tempM.put("stationRouteDescriptions", stationList.get(i)[10]);
1347 1264 // 站点路由版本
1348   - tempM.put("stationRouteVersions", stationList.get(i)[14]);
1349   -
  1265 + tempM.put("stationRouteVersions", stationList.get(i)[11]);
  1266 + // 站点图形类型
  1267 + tempM.put("stationShapesType", stationList.get(i)[12]);
  1268 + // 站点圆半径
  1269 + tempM.put("stationRadius", stationList.get(i)[13]);
  1270 + // 站点图形WGS坐标
  1271 + tempM.put("stationGPolygonGrid", stationList.get(i)[14]);
  1272 + // 站点图形百度坐标
  1273 + tempM.put("stationBPolygonGrid", stationList.get(i)[15]);
1350 1274 // 站点ID
1351   - tempM.put("stationId", stationList.get(i)[15]);
1352   -
  1275 + tempM.put("stationId", stationList.get(i)[16]);
1353 1276 // 站点编码
1354   - tempM.put("stationStationCod", stationList.get(i)[16]);
1355   -
1356   - // 站点名称
1357   - tempM.put("stationStationName", stationList.get(i)[17]);
1358   -
1359   - // 路段编码
1360   - tempM.put("stationRoadCoding", stationList.get(i)[18]);
1361   -
  1277 + tempM.put("stationStationCod", stationList.get(i)[17]);
1362 1278 // 原坐标类型
1363   - tempM.put("stationDbType", stationList.get(i)[19]);
1364   -
  1279 + tempM.put("stationDbType", stationList.get(i)[18]);
1365 1280 // 中心点(百度坐标)
1366   - tempM.put("stationBJwpoints", stationList.get(i)[20]);
1367   -
  1281 + tempM.put("stationBJwpoints", stationList.get(i)[19]);
1368 1282 // 中心点(WGS经度)
1369   - tempM.put("stationGLonx", stationList.get(i)[21]);
1370   -
  1283 + tempM.put("stationGLonx", stationList.get(i)[20]);
1371 1284 // 中心点(WGS纬度)
1372   - tempM.put("stationGLaty", stationList.get(i)[22]);
1373   -
1374   - // 城建坐标x
1375   - tempM.put("stationx", stationList.get(i)[23]);
1376   -
1377   - // 城建坐标y
1378   - tempM.put("stationy", stationList.get(i)[24]);
1379   -
1380   - // 站点图形类型
1381   - tempM.put("stationShapesType", stationList.get(i)[25]);
1382   -
1383   - // 站点圆半径
1384   - tempM.put("stationRadius", stationList.get(i)[26]);
1385   -
1386   - // 站点图形WGS坐标
1387   - tempM.put("stationGPolygonGrid", stationList.get(i)[27]);
1388   -
1389   - // 站点图形百度坐标
1390   - tempM.put("stationBPolygonGrid", stationList.get(i)[28]);
1391   -
1392   - // 是否撤销
1393   - tempM.put("stationDestroy", stationList.get(i)[29]);
1394   -
1395   - // 站点版本
1396   - tempM.put("stationVersions", stationList.get(i)[30]);
1397   -
1398   - // 站点说明
1399   - tempM.put("stationDescriptions", stationList.get(i)[31]);
1400   -
  1285 + tempM.put("stationGLaty", stationList.get(i)[21]);
  1286 + tempM.put("destroy", stationList.get(i)[22]);
  1287 +
1401 1288 staitonRouteList.add(tempM);
1402 1289 }
1403 1290 }
... ...
src/main/java/com/bsth/service/impl/StationServiceImpl.java
1 1 package com.bsth.service.impl;
2 2  
3   -import java.math.BigDecimal;
4   -import java.util.ArrayList;
5   -import java.util.HashMap;
6   -import java.util.List;
7   -import java.util.Map;
8   -
9   -import org.slf4j.Logger;
10   -import org.slf4j.LoggerFactory;
11   -import org.springframework.beans.factory.annotation.Autowired;
12   -import org.springframework.stereotype.Service;
13   -import org.springframework.transaction.annotation.Transactional;
14   -
15 3 import com.alibaba.fastjson.JSON;
16 4 import com.alibaba.fastjson.JSONArray;
17 5 import com.alibaba.fastjson.JSONObject;
... ... @@ -34,12 +22,22 @@ import com.bsth.repository.StationRepository;
34 22 import com.bsth.repository.StationRouteCacheRepository;
35 23 import com.bsth.repository.StationRouteRepository;
36 24 import com.bsth.service.StationService;
37   -import com.bsth.util.GetUIDAndCode;
38   -import com.bsth.util.TransGPS;
39   -import com.bsth.util.TransGPS.Location;
40 25 import com.bsth.util.Geo.Circle;
41 26 import com.bsth.util.Geo.GeoUtils;
42 27 import com.bsth.util.Geo.Point;
  28 +import com.bsth.util.GetUIDAndCode;
  29 +import com.bsth.util.TransGPS;
  30 +import com.bsth.util.TransGPS.Location;
  31 +import org.slf4j.Logger;
  32 +import org.slf4j.LoggerFactory;
  33 +import org.springframework.beans.factory.annotation.Autowired;
  34 +import org.springframework.stereotype.Service;
  35 +import org.springframework.transaction.annotation.Transactional;
  36 +
  37 +import java.math.BigDecimal;
  38 +import java.util.HashMap;
  39 +import java.util.List;
  40 +import java.util.Map;
43 41  
44 42 /**
45 43 *
... ... @@ -262,7 +260,7 @@ public class StationServiceImpl extends BaseServiceImpl&lt;Station, Integer&gt; implem
262 260 Map<String, Object> paramsMeleageAndDistncDura = new HashMap<String,Object>();
263 261 JSONArray stationsArray = JSONArray.parseArray(stationJSON);
264 262 if(stationsArray.size()>0) {
265   - Station loopStartStation = new Station();
  263 + StationRoute loopStartStation = new StationRoute();
266 264 for(int i = 0;i <stationsArray.size();i++) {
267 265 // 站点名称
268 266 String stationName = stationsArray.getJSONObject(i).equals("") ? "" : stationsArray.getJSONObject(i).get("name").toString();
... ... @@ -287,146 +285,134 @@ public class StationServiceImpl extends BaseServiceImpl&lt;Station, Integer&gt; implem
287 285 String bLatx = JSONObject.parseObject(stationsArray.getJSONObject(i).get("potion").toString()).get("lat").toString();
288 286 bLatx = bLatx==null || bLatx.equals("") ? "0" : bLatx;
289 287 List<Object[]> stationNameList = repository.findStationName(directions,stationName);
290   - Map<String, Object> isHaveMap = isHaveStationname(bLonx,bLatx,stationNameList);
291   - // 初始化站点对象
292   - Station arg0 = new Station();
  288 +// Map<String, Object> isHaveMap = isHaveStationname(bLonx,bLatx,stationNameList);
  289 + String gLonxStr = JSONObject.parseObject(stationsArray.getJSONObject(i).get("wgs").toString()).get("x").equals("") ? null : JSONObject.parseObject(stationsArray.getJSONObject(i).get("wgs").toString()).get("x").toString();
  290 + String gLatyStr = JSONObject.parseObject(stationsArray.getJSONObject(i).get("wgs").toString()).get("y").equals("") ? null : JSONObject.parseObject(stationsArray.getJSONObject(i).get("wgs").toString()).get("y").toString();
  291 + // 站点编码
  292 + long stationCode = GetUIDAndCode.getStationId();
  293 +
  294 + if(baseRes.equals("GCJ02")){
  295 + Location bdLoc = TransGPS.LocationMake(Double.valueOf(gLonxStr), Double.valueOf(gLatyStr));
  296 + Location location = TransGPS.bd_encrypt(bdLoc);
  297 + String GCJLng = String.valueOf(location.getLng());
  298 + String GCJLat = String.valueOf(location.getLat());
  299 + bJwpoints = GCJLng + " " +GCJLat;
  300 + }else if(baseRes.equals("BD09")){
  301 + bJwpoints = gLonxStr+ " " + gLatyStr;
  302 + }else if(baseRes.equals("WGS84")){
  303 + Location bdLoc = TransGPS.LocationMake(Double.valueOf(gLonxStr), Double.valueOf(gLatyStr));
  304 + Location gcjLoc = TransGPS.transformFromWGSToGCJ(bdLoc);
  305 + Location bdEn = TransGPS.bd_encrypt(gcjLoc);
  306 + bJwpoints = String.valueOf(bdEn.getLng()) + " " + String.valueOf(bdEn.getLat());
  307 + }
  308 +
  309 + // 非环线终点都去添加新站点
  310 + if (resultLine.getLinePlayType() != 1 || i!=stationsArray.size()-1){
  311 + repository.stationSave((int)stationCode, String.valueOf(stationCode), dbType, bJwpoints, Float.valueOf(gLonxStr), Float.valueOf(gLatyStr),
  312 + null, null);
  313 + }
  314 + // 站点名称
  315 + if(i==stationsArray.size()-1 && resultLine.getLinePlayType() == 1)
  316 + stationName = loopStartStation.getStationName();
  317 +
  318 + sumUpOrDownMileage = sumUpOrDownMileage + distance;
  319 + String stationMark = "Z";
  320 + // 站点类型
  321 + if(i==0) {
  322 + // 起始站
  323 + stationMark = "B";
  324 + }else if(i==stationsArray.size()-1) {
  325 + // 终点站
  326 + stationMark = "E";
  327 + }else {
  328 + // 中途站
  329 + stationMark = "Z";
  330 + }
  331 + // 版本号(获取线路当前版本)
  332 + Integer version = lineVersionsRepository.findCurrentVersion(resultLine.getId());
  333 +
  334 + // 环线起终点引用同一个站点
  335 + if (resultLine.getLinePlayType() == 1 && i==0) {// 环线终点和起点引用同一个站
  336 + loopStartStation.setLine(resultLine);
  337 + loopStartStation.setLineCode(resultLine.getLineCode());
  338 + loopStartStation.setStation(repository.findOne((int)stationCode));
  339 + loopStartStation.setStationCode(String.valueOf(stationCode));
  340 + loopStartStation.setStationName(stationName);
  341 + loopStartStation.setRadius(80);
  342 + loopStartStation.setShapesType("r");
  343 + loopStartStation.setStationMark(stationMark);
  344 + loopStartStation.setDirections(directions);
  345 + loopStartStation.setDestroy(0);
  346 + loopStartStation.setVersions(version);
  347 + loopStartStation.setToTime(0d);
  348 + loopStartStation.setDistances(0d);
  349 + routeRepository.stationRouteAdd(resultLine.getId(), resultLine.getLineCode(), (int)stationCode, String.valueOf(stationCode), stationName,
  350 + (i+1)*100, null, null, 80, "r", stationMark,
  351 + directions, distance, duration, 0, version);
  352 + } else if (resultLine.getLinePlayType() == 1 && i==stationsArray.size()-1) {// 环线终点和起点引用同一个站
  353 + loopStartStation.setStationRouteCode((i+1)*100);
  354 + loopStartStation.setStationMark(stationMark);
  355 + routeRepository.save(loopStartStation);
  356 + } else {
  357 + // 插入站点路由信息
  358 + routeRepository.stationRouteAdd(resultLine.getId(), resultLine.getLineCode(), (int)stationCode, String.valueOf(stationCode), stationName,
  359 + (i+1)*100, null, null, 80, "r", stationMark,
  360 + directions, distance, duration, 0, version);
  361 + }
  362 +
  363 + }
  364 + paramsMeleageAndDistncDura.put("sumUpOrDownMileage", sumUpOrDownMileage);
  365 + paramsMeleageAndDistncDura.put("sectionDistance", sectionDistance);
  366 + paramsMeleageAndDistncDura.put("sectionDuration", sectionDuration);
  367 + paramsMeleageAndDistncDura.put("stationdata",stationsArray);
  368 +
  369 +
  370 + /* TODO: 以后合并站点时开启这个判断,把站点表里的id和code传到站点路由
293 371 if(Boolean.parseBoolean(isHaveMap.get("isHave").toString())) {
294   - /*Integer stationId = Integer.parseInt(stationNameList.get(0)[1].toString());*/
295 372 Integer stationId = Integer.parseInt(isHaveMap.get("id").toString());
296 373 arg0 = repository.findOne(stationId);
297   -
  374 +
298 375 if (i==stationsArray.size()-1 && resultLine.getLinePlayType() == 1) {// 环线终点和起点引用同一个站
299 376 arg0 = loopStartStation;
300 377 } else {
301 378 List<Station> list = new ArrayList<>();
302 379 list.add(arg0);
303 380 List<Station> stationlist = JSONArray.parseArray(JSON.toJSONString(list), Station.class);
304   - Station station = stationlist.get(0);
  381 + Station station = stationlist.get(0);
305 382 // 站点编码
306   - long stationCode = GetUIDAndCode.getStationId();
307   - station.setStationCod(String.valueOf(stationCode));
  383 + stationCode = GetUIDAndCode.getStationId();
  384 + station.setCode(String.valueOf(stationCode));
308 385 station.setId((int)stationCode);
309 386 station.setCreateDate(null);
310 387 station.setUpdateDate(null);
311 388 repository.save(station);
312   - arg0 = station;
  389 + arg0 = station;
313 390 if (i==0 && resultLine.getLinePlayType() == 1) {// 环线终点和起点引用同一个站
314 391 loopStartStation = arg0;
315 392 }
316 393 }
317   - }else {
318   - // 站点编码
319   - long stationCode = GetUIDAndCode.getStationId();
320   - arg0.setStationCod(String.valueOf(stationCode));
321   - arg0.setId((int)stationCode);
322   - arg0.setStationName(stationName);
323   - // 原坐标类型
324   - arg0.setDbType(dbType);
325   - String gLonxStr = JSONObject.parseObject(stationsArray.getJSONObject(i).get("wgs").toString()).get("x").equals("") ? null : JSONObject.parseObject(stationsArray.getJSONObject(i).get("wgs").toString()).get("x").toString();
326   - String gLatyStr = JSONObject.parseObject(stationsArray.getJSONObject(i).get("wgs").toString()).get("y").equals("") ? null : JSONObject.parseObject(stationsArray.getJSONObject(i).get("wgs").toString()).get("y").toString();
327   - float gLonx = 0.0f;
328   - float gLaty = 0.0f;
329   - Location resultPoint = null;
330   - if(baseRes.equals("No")){
331   - /** BD to WGS坐标 */
332   - resultPoint = FromBDPointToWGSPoint(bLonx,bLatx);
333   - if(gLonxStr==null)
334   - gLonx = (float)resultPoint.getLng();
335   - else
336   - gLonx = Float.valueOf(gLonxStr);
337   - if(gLatyStr==null)
338   - gLaty = (float)resultPoint.getLat();
339   - else
340   - gLaty = Float.valueOf(gLatyStr);
341   - arg0.setgLonx(gLonx);
342   - arg0.setgLaty(gLaty);
343   - // 百度经纬度
344   - bJwpoints = bLonx + " " + bLatx;
345   - arg0.setbJwpoints(bJwpoints);
346   - }else if(baseRes.equals("GCJ02")){
347   - Location bdLoc = TransGPS.LocationMake(Double.valueOf(gLonxStr), Double.valueOf(gLatyStr));
348   - Location location = TransGPS.bd_encrypt(bdLoc);
349   - String GCJLng = String.valueOf(location.getLng());
350   - String GCJLat = String.valueOf(location.getLat());
351   - resultPoint = FromBDPointToWGSPoint(GCJLng,GCJLat);
352   - bJwpoints = GCJLng + " " +GCJLat;
353   - arg0.setgLonx((float)location.getLng());
354   - arg0.setgLaty((float)location.getLat());
355   - arg0.setbJwpoints(bJwpoints);
356   - }else if(baseRes.equals("BD09")){
357   - resultPoint = FromBDPointToWGSPoint(gLonxStr, gLatyStr);
358   - bJwpoints = gLonxStr+ " " + gLatyStr;
359   - arg0.setgLonx((float)resultPoint.getLng());
360   - arg0.setgLaty((float)resultPoint.getLat());
361   - }else if(baseRes.equals("WGS84")){
362   - Location bdLoc = TransGPS.LocationMake(Double.valueOf(gLonxStr), Double.valueOf(gLatyStr));
363   - Location gcjLoc = TransGPS.transformFromWGSToGCJ(bdLoc);
364   - Location bdEn = TransGPS.bd_encrypt(gcjLoc);
365   - bJwpoints = String.valueOf(bdEn.getLng()) + " " + String.valueOf(bdEn.getLat());
366   - arg0.setbJwpoints(bJwpoints);
367   - arg0.setgLonx(Float.valueOf(gLonxStr));
368   - arg0.setgLaty(Float.valueOf(gLatyStr));
369   - }
370   - arg0.setRadius(radius);
371   - arg0.setShapesType(shapesType);
372   - // 是否想撤销
373   - arg0.setDestroy(destroy);
374   - // 版本号
375   - arg0.setVersions(versions);
376   - arg0.setbJwpoints(bJwpoints);
377   - // 插入站点信息
378   - if (i==0 && resultLine.getLinePlayType() == 1) {// 环线终点和起点引用同一个站
379   - loopStartStation = arg0;
380   - repository.save(arg0);
381   - } else if (i==stationsArray.size()-1 && resultLine.getLinePlayType() == 1) {// 环线终点和起点引用同一个站
382   - arg0 = loopStartStation;
383   - } else {
384   - repository.save(arg0);
385   - }
386   -
387   - }
388   - // 站点路由对象
389   - StationRoute route = new StationRoute();
390   - // 站点名称
391   - route.setStationName(stationName);
392   - route.setDistances(distance);
393   - sumUpOrDownMileage = sumUpOrDownMileage + distance;
394   - route.setToTime(duration);
395   - // 站点编码
396   - route.setStationCode(arg0.getStationCod());
397   - // 站点序号
398   - route.setStationRouteCode((i+1)*100);
399   - // 站点类型
400   - if(i==0) {
401   - // 起始站
402   - route.setStationMark("B");
403   - }else if(i==stationsArray.size()-1) {
404   - // 终点站
405   - route.setStationMark("E");
406   - }else {
407   - // 中途站
408   - route.setStationMark("Z");
  394 + }else
  395 + }*/
  396 + /* No坐标转百度
  397 + float gLonx = 0.0f;
  398 + float gLaty = 0.0f;
  399 + if(baseRes.equals("No")){
  400 + // BD to WGS坐标
  401 + resultPoint = FromBDPointToWGSPoint(bLonx,bLatx);
  402 + if(gLonxStr==null)
  403 + gLonx = (float)resultPoint.getLng();
  404 + else
  405 + gLonx = Float.valueOf(gLonxStr);
  406 + if(gLatyStr==null)
  407 + gLaty = (float)resultPoint.getLat();
  408 + else
  409 + gLaty = Float.valueOf(gLatyStr);
  410 + arg0.setgLonx(gLonx);
  411 + arg0.setgLaty(gLaty);
  412 + // 百度经纬度
  413 + bJwpoints = bLonx + " " + bLatx;
409 414 }
410   - // 版本号(获取线路当前版本)
411   - Integer version = lineVersionsRepository.findCurrentVersion(resultLine.getId());
412   - route.setVersions(version);
413   - // 站点ID
414   - route.setStation(arg0);
415   - // 方向
416   - route.setDirections(directions);
417   - // 线路ID
418   - route.setLine(resultLine);
419   - // 线路编码
420   - route.setLineCode(resultLine.getLineCode());
421   - route.setDestroy(destroy);
422   - // 插入站点路由信息
423   - routeRepository.save(route);
424   -
425   - }
426   - paramsMeleageAndDistncDura.put("sumUpOrDownMileage", sumUpOrDownMileage);
427   - paramsMeleageAndDistncDura.put("sectionDistance", sectionDistance);
428   - paramsMeleageAndDistncDura.put("sectionDuration", sectionDuration);
429   - paramsMeleageAndDistncDura.put("stationdata",stationsArray);
  415 + */
430 416 }
431 417 return paramsMeleageAndDistncDura;
432 418 }
... ... @@ -549,6 +535,7 @@ public class StationServiceImpl extends BaseServiceImpl&lt;Station, Integer&gt; implem
549 535 * @param destroy:是否撤销
550 536 *
551 537 */
  538 + @Transactional
552 539 public void saveSectionAndSectionRouteInfo(String sectionJSON,int directions,Line resultLine,String speedLimitStr,
553 540  
554 541 double sectionDistance,double sectionDuration,String dbType,int versions,int destroy) throws Exception{
... ... @@ -706,6 +693,7 @@ public class StationServiceImpl extends BaseServiceImpl&lt;Station, Integer&gt; implem
706 693 sectionRouteRepository.save(sectionRoute);
707 694  
708 695 }
  696 +
709 697 public Map<String, Object> isHaveStationname(String jd,String wd,List<Object[]> stationNameList) {
710 698 Map<String, Object> rsM = new HashMap<String ,Object>();
711 699 boolean temp = false;
... ... @@ -738,11 +726,11 @@ public class StationServiceImpl extends BaseServiceImpl&lt;Station, Integer&gt; implem
738 726 *
739 727 * descriptions:说明;destroy:是否撤销;directions:方向;distances:到站距离;gJwpoints:中心点WGS坐标;
740 728 *
741   - * gPolygonGrid:多边形图形WGS坐标;lineId:线路ID;radius:圆半径;roadCoding:道路编码;shapesType:图形类型;
  729 + * gPolygonGrid:多边形图形WGS坐标;lineId:线路ID;radius:圆半径;shapesType:图形类型;
742 730 *
743 731 * stationCod:站点编码;stationMark:站点类型;stationName:站点名称;stationRouteCode:站点序号;toTime:到站时间
744 732 *
745   - * versions:版本号;x:城建坐标x;y:城建坐标y>
  733 + * versions:版本号>
746 734 *
747 735 * @return Map<String, Object> <SUCCESS ; ERROR>
748 736 */
... ... @@ -755,8 +743,6 @@ public class StationServiceImpl extends BaseServiceImpl&lt;Station, Integer&gt; implem
755 743 String stationCod = "";
756 744 // 站点ID
757 745 Integer stationId = null;
758   - // 站点名称
759   - String zdmc = map.get("zdmc").equals("") ? "" : map.get("zdmc").toString();
760 746 // 方向
761 747 Integer directions = map.get("directions").equals("") ? null : Integer.parseInt(map.get("directions").toString());
762 748 // 原坐标点
... ... @@ -765,14 +751,12 @@ public class StationServiceImpl extends BaseServiceImpl&lt;Station, Integer&gt; implem
765 751 if(bJwpoints!=null) {
766 752 bJwpointsArray = bJwpoints.split(" ");
767 753 }
768   - List<Object[]> stationNameList = repository.findStationName(directions,zdmc);
769   - Map<String, Object> isHaveMap = isHaveStationname(bJwpointsArray[0],bJwpointsArray[1],stationNameList);
770 754 // 是否撤销
771 755 Integer destroy = map.get("destroy").equals("") ? null : Integer.parseInt(map.get("destroy").toString());
772 756 // 版本
773 757 Integer versions = map.get("versions").equals("") ? null : Integer.parseInt(map.get("versions").toString());
774 758 // 说明
775   - String descriptions = map.get("descriptions").equals("") ? "" : map.get("descriptions").toString();
  759 +// String descriptions = map.get("descriptions").equals("") ? "" : map.get("descriptions").toString();
776 760 // 站点编码
777 761 stationCod = map.get("stationCod").equals("") ? "" : map.get("stationCod").toString();
778 762 // 站点ID
... ... @@ -785,12 +769,6 @@ public class StationServiceImpl extends BaseServiceImpl&lt;Station, Integer&gt; implem
785 769 Integer createBy = map.get("createBy").equals("") ? null : Integer.parseInt(map.get("createBy").toString());
786 770 // 修改人
787 771 Integer updateBy = map.get("updateBy").equals("") ? null : Integer.parseInt(map.get("updateBy").toString());
788   - // 城建坐标经度
789   - Float x = map.get("x").equals("") ? null : Float.parseFloat(map.get("x").toString());
790   - // 城建坐标纬度
791   - Float y = map.get("y").equals("") ? null : Float.parseFloat(map.get("y").toString());
792   - // 道路编码
793   - String roadCoding = map.get("roadCoding").equals("") ? "" : map.get("roadCoding").toString();
794 772 // 原坐标类型
795 773 String dbType = map.get("dbType").equals("") ? "" : map.get("dbType").toString();
796 774 // WGS经纬度
... ... @@ -828,9 +806,7 @@ public class StationServiceImpl extends BaseServiceImpl&lt;Station, Integer&gt; implem
828 806 else
829 807 gPloygonGrid = "POLYGON((" + gPloygonGrid +"))";
830 808 // 保存站点
831   - repository.stationSave(stationCod, zdmc, roadCoding, dbType, bJwpoints,
832   - gLonx, gLaty, x, y, gPloygonGrid,bPloygonGrid, destroy, radius,
833   - shapesType, versions, descriptions, createBy, updateBy,stationId);
  809 + repository.stationSave(stationId, stationCod, dbType, bJwpoints, gLonx, gLaty, createBy, updateBy);
834 810  
835 811 Station station = repository.findOne(stationId);
836 812 StationRoute arg0 = new StationRoute();
... ... @@ -855,33 +831,9 @@ public class StationServiceImpl extends BaseServiceImpl&lt;Station, Integer&gt; implem
855 831 }else {
856 832 stationRouteCode = 100;
857 833 }
858   - // 线路
859   - arg0.setLine(resultLine);
860   - arg0.setLineCode(resultLine.getLineCode());
861   - // 站点
862   - arg0.setStation(station);
863   - // 站点路由名称
864   - arg0.setStationName(stationName);
865   - // 站点路由编码
866   - arg0.setStationCode(station.getStationCod());
867   - // 站点路由序号
868   - arg0.setStationRouteCode(stationRouteCode);
869   - // 站点路由类型
870   - arg0.setStationMark(stationMark);
871   - // 站点路由站点方向
872   - arg0.setDirections(directions);
873   - // 站点路由到站距离
874   - arg0.setDistances(distances);
875   - // 站点路由到站时间
876   - arg0.setToTime(toTime);
877   - // 站点版本号
878   - arg0.setVersions(versions);
879   - // 是否撤销
880   - arg0.setDestroy(destroy);
881   - // 站点路由说明
882   - arg0.setDescriptions(descriptions);
883 834 routeRepository.stationUpdStationRouteCode(line, directions, stationRouteCode);
884   - routeRepository.save(arg0);
  835 + routeRepository.stationRouteAdd(resultLine.getId(), resultLine.getLineCode(), station.getId(), stationCod, stationName, stationRouteCode, bPloygonGrid, gPloygonGrid, radius, shapesType, stationMark,
  836 + directions, distances, toTime, destroy, versions);
885 837 resultMap.put("status", ResponseCode.SUCCESS);
886 838 } catch (Exception e) {
887 839 resultMap.put("status", ResponseCode.ERROR);
... ... @@ -902,88 +854,18 @@ public class StationServiceImpl extends BaseServiceImpl&lt;Station, Integer&gt; implem
902 854 String stationCod = "";
903 855 // 站点ID
904 856 Integer stationId = null;
905   - // 站点名称
906   - String zdmc = map.get("zdmc").equals("") ? "" : map.get("zdmc").toString();
907 857 // 方向
908 858 Integer directions = map.get("directions").equals("") ? null : Integer.parseInt(map.get("directions").toString());
  859 + // 圆半径
  860 + Integer radius = map.get("radius").equals("") ? null : Integer.parseInt(map.get("radius").toString());
  861 + // 图形类型
  862 + String shapesType = map.get("shapesType").equals("") ? "" : map.get("shapesType").toString();
909 863 // 原坐标点
910 864 String bJwpoints = map.get("bJwpoints").equals("") ? "" : map.get("bJwpoints").toString();
911 865 String bJwpointsArray[] = null;
912 866 if(bJwpoints!=null) {
913 867 bJwpointsArray = bJwpoints.split(" ");
914 868 }
915   - List<Object[]> stationNameList = repository.findStationName(directions,zdmc);
916   - Map<String, Object> isHaveMap = isHaveStationname(bJwpointsArray[0],bJwpointsArray[1],stationNameList);
917   - // 是否撤销
918   - Integer destroy = map.get("destroy").equals("") ? null : Integer.parseInt(map.get("destroy").toString());
919   - // 版本
920   - Integer versions = map.get("versions").equals("") ? null : Integer.parseInt(map.get("versions").toString());
921   - // 说明
922   - String descriptions = map.get("descriptions").equals("") ? "" : map.get("descriptions").toString();
923   - if(Boolean.parseBoolean(isHaveMap.get("isHave").toString())) {
924   - stationId = Integer.parseInt(isHaveMap.get("id").toString());
925   - }else {
926   - // 站点编码
927   - stationCod = map.get("stationCod").equals("") ? "" : map.get("stationCod").toString();
928   - // 站点ID
929   - stationId = Integer.valueOf(stationCod);
930   - // 圆半径
931   - Integer radius = map.get("radius").equals("") ? null : Integer.parseInt(map.get("radius").toString());
932   - // 图形类型
933   - String shapesType = map.get("shapesType").equals("") ? "" : map.get("shapesType").toString();
934   - // 创建人
935   - Integer createBy = map.get("createBy").equals("") ? null : Integer.parseInt(map.get("createBy").toString());
936   - // 修改人
937   - Integer updateBy = map.get("updateBy").equals("") ? null : Integer.parseInt(map.get("updateBy").toString());
938   - // 城建坐标经度
939   - Float x = map.get("x").equals("") ? null : Float.parseFloat(map.get("x").toString());
940   - // 城建坐标纬度
941   - Float y = map.get("y").equals("") ? null : Float.parseFloat(map.get("y").toString());
942   - // 道路编码
943   - String roadCoding = map.get("roadCoding").equals("") ? "" : map.get("roadCoding").toString();
944   - // 原坐标类型
945   - String dbType = map.get("dbType").equals("") ? "" : map.get("dbType").toString();
946   - // WGS经纬度
947   - Float gLonx = null;
948   - // WGS纬度
949   - Float gLaty = null;
950   - if(bJwpointsArray.length>0) {
951   - Location resultPoint = FromBDPointToWGSPoint(bJwpointsArray[0],bJwpointsArray[1]);
952   - gLonx = (float)resultPoint.getLng();
953   - gLaty = (float)resultPoint.getLat();
954   - }
955   - // 多边形原坐标点集合
956   - String bPloygonGrid = map.get("bPolygonGrid").equals("") ? "" : map.get("bPolygonGrid").toString();
957   - // 多边形WGS坐标点集合
958   - String gPloygonGrid ="";
959   - if(!bPloygonGrid.equals("")) {
960   - String bPloygonGridArray[] = bPloygonGrid.split(",");
961   - int bLen_ = bPloygonGridArray.length;
962   - for(int b = 0 ;b<bLen_;b++) {
963   - String tempArray[]= bPloygonGridArray[b].split(" ");
964   - Location resultPoint = FromBDPointToWGSPoint(tempArray[0],tempArray[1]);
965   - if(b==0) {
966   - gPloygonGrid = String.valueOf(resultPoint.getLng()) + " " + String.valueOf(resultPoint.getLat());
967   - }else {
968   - gPloygonGrid = gPloygonGrid + ',' + String.valueOf(resultPoint.getLng()) + " " + String.valueOf(resultPoint.getLat());
969   - }
970   - }
971   - }
972   - if(bPloygonGrid.equals(""))
973   - bPloygonGrid = null;
974   - else
975   - bPloygonGrid = "POLYGON((" + bPloygonGrid +"))";
976   - if(gPloygonGrid.equals(""))
977   - gPloygonGrid = null;
978   - else
979   - gPloygonGrid = "POLYGON((" + gPloygonGrid +"))";
980   - // 保存站点
981   - repository.stationSave(stationCod, zdmc, roadCoding, dbType, bJwpoints,
982   - gLonx, gLaty, x, y, gPloygonGrid,bPloygonGrid, destroy, radius,
983   - shapesType, versions, descriptions, createBy, updateBy,stationId);
984   - }
985   - Station station = repository.findOne(stationId);
986   - StationRouteCache arg0 = new StationRouteCache();
987 869 // 距离
988 870 Double distances = map.get("distances").equals("") ? 0.0d : Double.parseDouble(map.get("distances").toString());
989 871 // 时间
... ... @@ -994,6 +876,67 @@ public class StationServiceImpl extends BaseServiceImpl&lt;Station, Integer&gt; implem
994 876 int line = map.get("lineId").equals("") ? 0 : Integer.parseInt(map.get("lineId").toString());
995 877 // 线路信息
996 878 Line resultLine = lineRepository.findOne(line);
  879 + // 多边形原坐标点集合
  880 + String bPloygonGrid = map.get("bPolygonGrid").equals("") ? "" : map.get("bPolygonGrid").toString();
  881 + // 多边形WGS坐标点集合
  882 + String gPloygonGrid ="";
  883 + if(!bPloygonGrid.equals("")) {
  884 + String bPloygonGridArray[] = bPloygonGrid.split(",");
  885 + int bLen_ = bPloygonGridArray.length;
  886 + for(int b = 0 ;b<bLen_;b++) {
  887 + String tempArray[]= bPloygonGridArray[b].split(" ");
  888 + Location resultPoint = FromBDPointToWGSPoint(tempArray[0],tempArray[1]);
  889 + if(b==0) {
  890 + gPloygonGrid = String.valueOf(resultPoint.getLng()) + " " + String.valueOf(resultPoint.getLat());
  891 + }else {
  892 + gPloygonGrid = gPloygonGrid + ',' + String.valueOf(resultPoint.getLng()) + " " + String.valueOf(resultPoint.getLat());
  893 + }
  894 + }
  895 + }
  896 + if(bPloygonGrid.equals(""))
  897 + bPloygonGrid = null;
  898 + else
  899 + bPloygonGrid = "POLYGON((" + bPloygonGrid +"))";
  900 + if(gPloygonGrid.equals(""))
  901 + gPloygonGrid = null;
  902 + else
  903 + gPloygonGrid = "POLYGON((" + gPloygonGrid +"))";
  904 +
  905 +// List<Object[]> stationNameList = repository.findStationName(directions,stationName);
  906 +// Map<String, Object> isHaveMap = isHaveStationname(bJwpointsArray[0],bJwpointsArray[1],stationNameList);
  907 + // 是否撤销
  908 + Integer destroy = map.get("destroy").equals("") ? null : Integer.parseInt(map.get("destroy").toString());
  909 + // 版本
  910 + Integer versions = map.get("versions").equals("") ? null : Integer.parseInt(map.get("versions").toString());
  911 + // 说明
  912 +// String descriptions = map.get("descriptions").equals("") ? "" : map.get("descriptions").toString();
  913 + /*if(Boolean.parseBoolean(isHaveMap.get("isHave").toString())) {
  914 + stationId = Integer.parseInt(isHaveMap.get("id").toString());
  915 + }else {
  916 +
  917 + }*/
  918 + // 站点编码
  919 + stationCod = map.get("stationCod").equals("") ? "" : map.get("stationCod").toString();
  920 + // 站点ID
  921 + stationId = Integer.valueOf(stationCod);
  922 + // 创建人
  923 + Integer createBy = map.get("createBy").equals("") ? null : Integer.parseInt(map.get("createBy").toString());
  924 + // 修改人
  925 + Integer updateBy = map.get("updateBy").equals("") ? null : Integer.parseInt(map.get("updateBy").toString());
  926 + // 原坐标类型
  927 + String dbType = map.get("dbType").equals("") ? "" : map.get("dbType").toString();
  928 + // WGS经纬度
  929 + Float gLonx = null;
  930 + // WGS纬度
  931 + Float gLaty = null;
  932 + if(bJwpointsArray.length>0) {
  933 + Location resultPoint = FromBDPointToWGSPoint(bJwpointsArray[0],bJwpointsArray[1]);
  934 + gLonx = (float)resultPoint.getLng();
  935 + gLaty = (float)resultPoint.getLat();
  936 + }
  937 + // 保存站点
  938 + repository.stationSave(stationId, stationCod, dbType, bJwpoints, gLonx, gLaty, createBy, updateBy);
  939 + Station station = repository.findOne(stationId);
997 940 // 站点路由序号
998 941 String stationRouteCodeStr = map.get("stationRouteCode").equals("") ? "" : map.get("stationRouteCode").toString();
999 942 // 站点类型
... ... @@ -1005,33 +948,8 @@ public class StationServiceImpl extends BaseServiceImpl&lt;Station, Integer&gt; implem
1005 948 }else {
1006 949 stationRouteCode = 100;
1007 950 }
1008   - // 线路
1009   - arg0.setLine(resultLine);
1010   - arg0.setLineCode(resultLine.getLineCode());
1011   - // 站点
1012   - arg0.setStation(station);
1013   - // 站点路由名称
1014   - arg0.setStationName(stationName);
1015   - // 站点路由编码
1016   - arg0.setStationCode(station.getStationCod());
1017   - // 站点路由序号
1018   - arg0.setStationRouteCode(stationRouteCode);
1019   - // 站点路由类型
1020   - arg0.setStationMark(stationMark);
1021   - // 站点路由站点方向
1022   - arg0.setDirections(directions);
1023   - // 站点路由到站距离
1024   - arg0.setDistances(distances);
1025   - // 站点路由到站时间
1026   - arg0.setToTime(toTime);
1027   - // 站点版本号
1028   - arg0.setVersions(versions);
1029   - // 是否撤销
1030   - arg0.setDestroy(destroy);
1031   - // 站点路由说明
1032   - arg0.setDescriptions(descriptions);
1033   - routeCacheRepository.stationUpdStationRouteCode(line, directions, stationRouteCode);
1034   - routeCacheRepository.save(arg0);
  951 + routeCacheRepository.stationRouteCacheAdd(resultLine.getId(), resultLine.getLineCode(), station.getId(), stationCod, stationName, stationRouteCode, bPloygonGrid, gPloygonGrid, radius, shapesType, stationMark,
  952 + directions, distances, toTime, destroy, versions);
1035 953 resultMap.put("status", ResponseCode.SUCCESS);
1036 954 } catch (Exception e) {
1037 955 resultMap.put("status", ResponseCode.ERROR);
... ... @@ -1055,6 +973,7 @@ public class StationServiceImpl extends BaseServiceImpl&lt;Station, Integer&gt; implem
1055 973 *
1056 974 * @return Map<String, Object> <SUCCESS ; ERROR>
1057 975 */
  976 + @Transactional
1058 977 @Override
1059 978 public Map<String, Object> stationUpdate(Map<String, Object> map) {
1060 979 Map<String, Object> resultMap = new HashMap<String, Object>();
... ... @@ -1062,11 +981,8 @@ public class StationServiceImpl extends BaseServiceImpl&lt;Station, Integer&gt; implem
1062 981 // 站点Id
1063 982 Integer stationId = map.get("stationId").equals("") ? null : Integer.parseInt(map.get("stationId").toString());
1064 983 String stationCod = map.get("stationCod").equals("") ? "" : map.get("stationCod").toString();
1065   - String zdmc = map.get("zdmc").equals("") ? "" : map.get("zdmc").toString();
1066 984 // 站点名称
1067 985 String stationRouteName = map.get("stationName").equals("") ? "" : map.get("stationName").toString();
1068   - // 所在道路编码
1069   - String roadCoding = map.get("roadCoding").equals("") ? "" : map.get("roadCoding").toString();
1070 986 // 经纬坐标类型
1071 987 String dbType = map.get("dbType").equals("") ? "" : map.get("dbType").toString();
1072 988 // 百度经纬度坐标
... ... @@ -1119,11 +1035,9 @@ public class StationServiceImpl extends BaseServiceImpl&lt;Station, Integer&gt; implem
1119 1035 // 版本号
1120 1036 Integer versions = map.get("versions").equals("") ? null : Integer.parseInt(map.get("versions").toString());
1121 1037 // 描述与说明
1122   - String descriptions = map.get("descriptions").equals("") ? "" : map.get("descriptions").toString();
1123   - Float x = map.get("x").equals("") ? null : Float.parseFloat(map.get("x").toString());
1124   - Float y = map.get("y").equals("") ? null : Float.parseFloat(map.get("y").toString());
  1038 +// String descriptions = map.get("descriptions").equals("") ? "" : map.get("descriptions").toString();
1125 1039 // 更新
1126   - repository.stationUpdate(stationCod, zdmc, roadCoding, dbType, bJwpoints, gLonx, gLaty, x, y, bPloygonGrid, gPloygonGrid, destroy, radius, shapesType, versions, descriptions, stationId);
  1040 + repository.stationUpdate(dbType, bJwpoints, gLonx, gLaty, null, stationId);
1127 1041 // 站点路由Id
1128 1042 Integer stationRouteId = map.get("stationRouteId").equals("") ? null : Integer.parseInt(map.get("stationRouteId").toString());
1129 1043 StationRoute resultS = routeRepository.findOne(stationRouteId);
... ... @@ -1150,22 +1064,9 @@ public class StationServiceImpl extends BaseServiceImpl&lt;Station, Integer&gt; implem
1150 1064 Integer directions = map.get("directions").equals("") ? null : Integer.parseInt(map.get("directions").toString());
1151 1065 Station station = repository.findOne(stationId);
1152 1066 Line line = lineRepository.findOne(LineId);
1153   - StationRoute stationRoute = new StationRoute();
1154   - stationRoute.setStationName(stationRouteName);
1155   - stationRoute.setId(stationRouteId);
1156   - stationRoute.setStationRouteCode(stationRouteCode);
1157   - stationRoute.setStation(station);
1158   - stationRoute.setStationCode(station.getStationCod());
1159   - stationRoute.setLine(line);
1160   - stationRoute.setLineCode(line.getLineCode());
1161   - stationRoute.setStationMark(stationMark);
1162   - stationRoute.setDistances(distances);
1163   - stationRoute.setToTime(toTime);
1164   - stationRoute.setDirections(directions);
1165   - stationRoute.setVersions(versions);
1166   - stationRoute.setDestroy(destroy);
1167   - stationRoute.setDescriptions(descriptions);
1168   - routeRepository.save(stationRoute);
  1067 + routeRepository.stationRouteUpdate(line.getId(), station.getId(), stationCod, stationRouteName, line.getLineCode(), bPloygonGrid, gPloygonGrid,
  1068 + radius, shapesType, stationRouteCode, stationMark, destroy, directions, distances, toTime, versions, stationRouteId);
  1069 +
1169 1070 resultMap.put("status", ResponseCode.SUCCESS);
1170 1071 } catch (Exception e) {
1171 1072 resultMap.put("status", ResponseCode.ERROR);
... ... @@ -1371,7 +1272,6 @@ public class StationServiceImpl extends BaseServiceImpl&lt;Station, Integer&gt; implem
1371 1272 Circle circle = new Circle(center, 60);
1372 1273 // 匹配到了用数据库中的点替换
1373 1274 if (GeoUtils.isPointInCircle(point, circle)) {
1374   - map.put("name", s.getStationName().toString());
1375 1275 // 匹配到站点后用这个站点的名字,但是使用gps点作为中心点
1376 1276 // map.put("potion_lng", points[0]);
1377 1277 // map.put("potion_lat", points[1]);
... ... @@ -1478,7 +1378,7 @@ public class StationServiceImpl extends BaseServiceImpl&lt;Station, Integer&gt; implem
1478 1378 JSONArray stationsArray = JSONArray.parseArray(stationJSON);
1479 1379 if(stationsArray.size()>0) {
1480 1380 // 环线起点站
1481   - Station loopStartStation = new Station();
  1381 + StationRouteCache loopStartStation = new StationRouteCache();
1482 1382 // 更新路线前删除线路缓存站点
1483 1383 routeCacheRepository.stationRouteCacheDel(resultLine.getLineCode(),directions);
1484 1384 for(int i = 0;i <stationsArray.size();i++) {
... ... @@ -1504,144 +1404,81 @@ public class StationServiceImpl extends BaseServiceImpl&lt;Station, Integer&gt; implem
1504 1404 // 百度坐标纬度
1505 1405 String bLatx = JSONObject.parseObject(stationsArray.getJSONObject(i).get("potion").toString()).get("lat").toString();
1506 1406 bLatx = bLatx==null || bLatx.equals("") ? "0" : bLatx;
1507   -// List<Object[]> stationNameList = repository.findStationName(directions,stationName);
1508   - //Map<String, Object> isHaveMap = isHaveStationname(bLonx,bLatx,stationNameList);
1509   - // 初始化站点对象
1510   - Station arg0 = new Station();
1511   - // 存在的点就不添加到数据库(起终点站重新添加站点)
1512   - if(Boolean.parseBoolean(stationsArray.getJSONObject(i).get("isHave").toString())) {
1513   - Integer stationId = Integer.parseInt(stationsArray.getJSONObject(i).get("id").toString());
1514   - arg0 = repository.findOne(stationId);
1515   -
1516   - if (i==stationsArray.size()-1 && resultLine.getLinePlayType() == 1) {// 环线终点和起点引用同一个站
1517   - arg0 = loopStartStation;
1518   - } else {
1519   - List<Station> list = new ArrayList<>();
1520   - list.add(arg0);
1521   - List<Station> stationlist = JSONArray.parseArray(JSON.toJSONString(list), Station.class);
1522   - Station station = stationlist.get(0);
1523   - // 站点编码
1524   - long stationCode = GetUIDAndCode.getStationId();
1525   - station.setStationCod(String.valueOf(stationCode));
1526   - station.setId((int)stationCode);
1527   - station.setCreateDate(null);
1528   - station.setUpdateDate(null);
1529   - repository.save(station);
1530   - arg0 = station;
1531   - if (i==0 && resultLine.getLinePlayType() == 1) {// 环线终点和起点引用同一个站
1532   - loopStartStation = arg0;
1533   - }
1534   - }
1535   - }else {
1536   - // 站点编码
1537   - long stationCode = GetUIDAndCode.getStationId();
1538   - arg0.setStationCod(String.valueOf(stationCode));
1539   - arg0.setId((int)stationCode);
1540   - arg0.setStationName(stationName);
1541   - // 原坐标类型
1542   - arg0.setDbType(dbType);
1543   - String gLonxStr = JSONObject.parseObject(stationsArray.getJSONObject(i).get("wgs").toString()).get("x").equals("") ? null : JSONObject.parseObject(stationsArray.getJSONObject(i).get("wgs").toString()).get("x").toString();
1544   - String gLatyStr = JSONObject.parseObject(stationsArray.getJSONObject(i).get("wgs").toString()).get("y").equals("") ? null : JSONObject.parseObject(stationsArray.getJSONObject(i).get("wgs").toString()).get("y").toString();
1545   - float gLonx = 0.0f;
1546   - float gLaty = 0.0f;
1547   - Location resultPoint = null;
1548   - if(baseRes.equals("No")){
1549   - /** BD to WGS坐标 */
1550   - resultPoint = FromBDPointToWGSPoint(bLonx,bLatx);
1551   - if(gLonxStr==null)
1552   - gLonx = (float)resultPoint.getLng();
1553   - else
1554   - gLonx = Float.valueOf(gLonxStr);
1555   - if(gLatyStr==null)
1556   - gLaty = (float)resultPoint.getLat();
1557   - else
1558   - gLaty = Float.valueOf(gLatyStr);
1559   - arg0.setgLonx(gLonx);
1560   - arg0.setgLaty(gLaty);
1561   - // 百度经纬度
1562   - bJwpoints = bLonx + " " + bLatx;
1563   - arg0.setbJwpoints(bJwpoints);
1564   - }else if(baseRes.equals("GCJ02")){
1565   - Location bdLoc = TransGPS.LocationMake(Double.valueOf(gLonxStr), Double.valueOf(gLatyStr));
1566   - Location location = TransGPS.bd_encrypt(bdLoc);
1567   - String GCJLng = String.valueOf(location.getLng());
1568   - String GCJLat = String.valueOf(location.getLat());
1569   - resultPoint = FromBDPointToWGSPoint(GCJLng,GCJLat);
1570   - bJwpoints = GCJLng + " " +GCJLat;
1571   - arg0.setgLonx((float)location.getLng());
1572   - arg0.setgLaty((float)location.getLat());
1573   - arg0.setbJwpoints(bJwpoints);
1574   - }else if(baseRes.equals("BD09")){
1575   - resultPoint = FromBDPointToWGSPoint(gLonxStr, gLatyStr);
1576   - bJwpoints = gLonxStr+ " " + gLatyStr;
1577   - arg0.setgLonx((float)resultPoint.getLng());
1578   - arg0.setgLaty((float)resultPoint.getLat());
1579   - }else if(baseRes.equals("WGS84")){
1580   - Location bdLoc = TransGPS.LocationMake(Double.valueOf(gLonxStr), Double.valueOf(gLatyStr));
1581   - Location gcjLoc = TransGPS.transformFromWGSToGCJ(bdLoc);
1582   - Location bdEn = TransGPS.bd_encrypt(gcjLoc);
1583   - bJwpoints = String.valueOf(bdEn.getLng()) + " " + String.valueOf(bdEn.getLat());
1584   - arg0.setbJwpoints(bJwpoints);
1585   - arg0.setgLonx(Float.valueOf(gLonxStr));
1586   - arg0.setgLaty(Float.valueOf(gLatyStr));
1587   - }
1588   - arg0.setRadius(radius);
1589   - arg0.setShapesType(shapesType);
1590   - // 是否想撤销
1591   - arg0.setDestroy(destroy);
1592   - // 版本号
1593   - arg0.setVersions(versions);
1594   - arg0.setbJwpoints(bJwpoints);
1595   - // 插入站点信息
1596   - if (i==0 && resultLine.getLinePlayType() == 1) {// 环线终点和起点引用同一个站
1597   - loopStartStation = arg0;
1598   - repository.save(arg0);
1599   - } else if (i==stationsArray.size()-1 && resultLine.getLinePlayType() == 1) {// 环线终点和起点引用同一个站
1600   - arg0 = loopStartStation;
1601   - } else {
1602   - repository.save(arg0);
1603   - }
1604   -
  1407 + List<Object[]> stationNameList = repository.findStationName(directions,stationName);
  1408 + // Map<String, Object> isHaveMap = isHaveStationname(bLonx,bLatx,stationNameList);
  1409 + String gLonxStr = JSONObject.parseObject(stationsArray.getJSONObject(i).get("wgs").toString()).get("x").equals("") ? null : JSONObject.parseObject(stationsArray.getJSONObject(i).get("wgs").toString()).get("x").toString();
  1410 + String gLatyStr = JSONObject.parseObject(stationsArray.getJSONObject(i).get("wgs").toString()).get("y").equals("") ? null : JSONObject.parseObject(stationsArray.getJSONObject(i).get("wgs").toString()).get("y").toString();
  1411 + // 站点编码
  1412 + long stationCode = GetUIDAndCode.getStationId();
  1413 +
  1414 + if(baseRes.equals("GCJ02")){
  1415 + Location bdLoc = TransGPS.LocationMake(Double.valueOf(gLonxStr), Double.valueOf(gLatyStr));
  1416 + Location location = TransGPS.bd_encrypt(bdLoc);
  1417 + String GCJLng = String.valueOf(location.getLng());
  1418 + String GCJLat = String.valueOf(location.getLat());
  1419 + bJwpoints = GCJLng + " " +GCJLat;
  1420 + }else if(baseRes.equals("BD09")){
  1421 + bJwpoints = gLonxStr+ " " + gLatyStr;
  1422 + }else if(baseRes.equals("WGS84")){
  1423 + Location bdLoc = TransGPS.LocationMake(Double.valueOf(gLonxStr), Double.valueOf(gLatyStr));
  1424 + Location gcjLoc = TransGPS.transformFromWGSToGCJ(bdLoc);
  1425 + Location bdEn = TransGPS.bd_encrypt(gcjLoc);
  1426 + bJwpoints = String.valueOf(bdEn.getLng()) + " " + String.valueOf(bdEn.getLat());
  1427 + }
  1428 +
  1429 + // 非环线终点都去添加新站点
  1430 + if (resultLine.getLinePlayType() != 1 || i!=stationsArray.size()-1){
  1431 + repository.stationSave((int)stationCode, String.valueOf(stationCode), dbType, bJwpoints, Float.valueOf(gLonxStr), Float.valueOf(gLatyStr),
  1432 + null, null);
1605 1433 }
1606   - // 站点路由对象
1607   - StationRouteCache route = new StationRouteCache();
1608 1434 // 站点名称
1609 1435 if(i==stationsArray.size()-1 && resultLine.getLinePlayType() == 1)
1610   - route.setStationName(loopStartStation.getStationName());
1611   - else
1612   - route.setStationName(stationName);
1613   - route.setDistances(distance);
  1436 + stationName = loopStartStation.getStationName();
  1437 +
1614 1438 sumUpOrDownMileage = sumUpOrDownMileage + distance;
1615   - route.setToTime(duration);
1616   - // 站点编码
1617   - route.setStationCode(arg0.getStationCod());
1618   - // 站点序号
1619   - route.setStationRouteCode((i+1)*100);
  1439 + String stationMark = "Z";
1620 1440 // 站点类型
1621 1441 if(i==0) {
1622 1442 // 起始站
1623   - route.setStationMark("B");
  1443 + stationMark = "B";
1624 1444 }else if(i==stationsArray.size()-1) {
1625 1445 // 终点站
1626   - route.setStationMark("E");
  1446 + stationMark = "E";
1627 1447 }else {
1628 1448 // 中途站
1629   - route.setStationMark("Z");
  1449 + stationMark = "Z";
1630 1450 }
1631   - // 版本号
1632   - route.setVersions(versions);
1633   - // 站点ID
1634   - route.setStation(arg0);
1635   - // 方向
1636   - route.setDirections(directions);
1637   - // 线路ID
1638   - route.setLine(resultLine);
1639   - // 线路编码
1640   - route.setLineCode(resultLine.getLineCode());
1641   - route.setDestroy(destroy);
1642   - // 插入站点路由信息
1643   - routeCacheRepository.save(route);
1644   -
  1451 + // 版本号(获取线路当前版本)
  1452 + Integer version = lineVersionsRepository.findCurrentVersion(resultLine.getId());
  1453 +
  1454 + // 环线起终点引用同一个站点
  1455 + if (resultLine.getLinePlayType() == 1 && i==0) {// 环线终点和起点引用同一个站
  1456 + loopStartStation.setLine(resultLine);
  1457 + loopStartStation.setLineCode(resultLine.getLineCode());
  1458 + loopStartStation.setStation(repository.findOne((int)stationCode));
  1459 + loopStartStation.setStationCode(String.valueOf(stationCode));
  1460 + loopStartStation.setStationName(stationName);
  1461 + loopStartStation.setRadius(80);
  1462 + loopStartStation.setShapesType("r");
  1463 + loopStartStation.setDirections(directions);
  1464 + loopStartStation.setDestroy(0);
  1465 + loopStartStation.setVersions(version);
  1466 + loopStartStation.setToTime(0d);
  1467 + loopStartStation.setDistances(0d);
  1468 + routeCacheRepository.stationRouteCacheAdd(resultLine.getId(), resultLine.getLineCode(), (int)stationCode, String.valueOf(stationCode), stationName,
  1469 + (i+1)*100, null, null, 80, "r", stationMark,
  1470 + directions, distance, duration, 0, version);
  1471 + } else if (resultLine.getLinePlayType() == 1 && i==stationsArray.size()-1) {// 环线终点和起点引用同一个站
  1472 + loopStartStation.setStationRouteCode((i+1)*100);
  1473 + loopStartStation.setStationMark(stationMark);
  1474 + routeCacheRepository.save(loopStartStation);
  1475 + } else {
  1476 + // 插入站点路由信息
  1477 + routeCacheRepository.stationRouteCacheAdd(resultLine.getId(), resultLine.getLineCode(), (int)stationCode, String.valueOf(stationCode), stationName,
  1478 + (i+1)*100, null, null, 80, "r", stationMark,
  1479 + directions, distance, duration, 0, version);
  1480 + }
  1481 +
1645 1482 }
1646 1483 paramsMeleageAndDistncDura.put("sumUpOrDownMileage", sumUpOrDownMileage);
1647 1484 paramsMeleageAndDistncDura.put("sectionDistance", sectionDistance);
... ... @@ -1746,6 +1583,7 @@ public class StationServiceImpl extends BaseServiceImpl&lt;Station, Integer&gt; implem
1746 1583 /**
1747 1584 * @Description :TODO(更新缓存站点路由)
1748 1585 */
  1586 + @Transactional
1749 1587 @Override
1750 1588 public Map<String, Object> stationCacheUpdate(Map<String, Object> map) {
1751 1589 Map<String, Object> resultMap = new HashMap<String, Object>();
... ... @@ -1753,11 +1591,8 @@ public class StationServiceImpl extends BaseServiceImpl&lt;Station, Integer&gt; implem
1753 1591 // 站点Id
1754 1592 Integer stationId = map.get("stationId").equals("") ? null : Integer.parseInt(map.get("stationId").toString());
1755 1593 String stationCod = map.get("stationCod").equals("") ? "" : map.get("stationCod").toString();
1756   - String zdmc = map.get("zdmc").equals("") ? "" : map.get("zdmc").toString();
1757 1594 // 站点路由名称
1758 1595 String stationName = map.get("stationName").equals("") ? "" : map.get("stationName").toString();
1759   - // 所在道路编码
1760   - String roadCoding = map.get("roadCoding").equals("") ? "" : map.get("roadCoding").toString();
1761 1596 // 经纬坐标类型
1762 1597 String dbType = map.get("dbType").equals("") ? "" : map.get("dbType").toString();
1763 1598 // 百度经纬度坐标
... ... @@ -1810,11 +1645,9 @@ public class StationServiceImpl extends BaseServiceImpl&lt;Station, Integer&gt; implem
1810 1645 // 版本号
1811 1646 Integer versions = map.get("versions").equals("") ? null : Integer.parseInt(map.get("versions").toString());
1812 1647 // 描述与说明
1813   - String descriptions = map.get("descriptions").equals("") ? "" : map.get("descriptions").toString();
1814   - Float x = map.get("x").equals("") ? null : Float.parseFloat(map.get("x").toString());
1815   - Float y = map.get("y").equals("") ? null : Float.parseFloat(map.get("y").toString());
  1648 +// String descriptions = map.get("descriptions").equals("") ? "" : map.get("descriptions").toString();
1816 1649 // 更新
1817   - repository.stationUpdate(stationCod, zdmc, roadCoding, dbType, bJwpoints, gLonx, gLaty, x, y, bPloygonGrid, gPloygonGrid, destroy, radius, shapesType, versions, descriptions, stationId);
  1650 + repository.stationUpdate(dbType, bJwpoints, gLonx, gLaty, null, stationId);
1818 1651 // 站点路由Id
1819 1652 Integer stationRouteId = map.get("stationRouteId").equals("") ? null : Integer.parseInt(map.get("stationRouteId").toString());
1820 1653 StationRouteCache resultS = routeCacheRepository.findOne(stationRouteId);
... ... @@ -1841,22 +1674,9 @@ public class StationServiceImpl extends BaseServiceImpl&lt;Station, Integer&gt; implem
1841 1674 Integer directions = map.get("directions").equals("") ? null : Integer.parseInt(map.get("directions").toString());
1842 1675 Station station = repository.findOne(stationId);
1843 1676 Line line = lineRepository.findOne(LineId);
1844   - StationRouteCache stationRoute = new StationRouteCache();
1845   - stationRoute.setStationName(stationName);
1846   - stationRoute.setId(stationRouteId);
1847   - stationRoute.setStationRouteCode(stationRouteCode);
1848   - stationRoute.setStation(station);
1849   - stationRoute.setStationCode(station.getStationCod());
1850   - stationRoute.setLine(line);
1851   - stationRoute.setLineCode(line.getLineCode());
1852   - stationRoute.setStationMark(stationMark);
1853   - stationRoute.setDistances(distances);
1854   - stationRoute.setToTime(toTime);
1855   - stationRoute.setDirections(directions);
1856   - stationRoute.setVersions(versions);
1857   - stationRoute.setDestroy(destroy);
1858   - stationRoute.setDescriptions(descriptions);
1859   - routeCacheRepository.save(stationRoute);
  1677 + routeCacheRepository.stationRouteCacheUpdate(line.getId(), station.getId(), stationCod, stationName, line.getLineCode(), bPloygonGrid, gPloygonGrid,
  1678 + radius, shapesType, stationRouteCode, stationMark, destroy, directions, distances, toTime, versions, stationRouteId);
  1679 +
1860 1680 resultMap.put("status", ResponseCode.SUCCESS);
1861 1681 } catch (Exception e) {
1862 1682 resultMap.put("status", ResponseCode.ERROR);
... ...
src/main/java/com/bsth/service/impl/TrafficManageServiceImpl.java
... ... @@ -1451,7 +1451,7 @@ public class TrafficManageServiceImpl implements TrafficManageService{
1451 1451 sBuffer.append("<ZDBM>").append(srRoute.getStationCode()).append("</ZDBM>");
1452 1452 sBuffer.append("<ZDJD>").append(srRoute.getStation().getgLonx()).append("</ZDJD>");
1453 1453 sBuffer.append("<ZDWD>").append(srRoute.getStation().getgLaty()).append("</ZDWD>");
1454   - sBuffer.append("<ZZ>").append(srRoute.getStation().getAddr() == null ? "" : srRoute.getStation().getAddr()).append("</ZZ>");
  1454 +// sBuffer.append("<ZZ>").append(srRoute.getStation().getAddr() == null ? "" : srRoute.getStation().getAddr()).append("</ZZ>");
1455 1455 sBuffer.append("<ZDLX>").append(zdlx).append("</ZDLX>");
1456 1456 sBuffer.append("<ZJLC>").append(srRoute.getDistances()).append("</ZJLC>");
1457 1457 sBuffer.append("</Station>");
... ...
src/main/resources/static/pages/base/carpark/js/add-form-wizard.js
... ... @@ -39,7 +39,7 @@ var FormWizard = function() {
39 39 'radius' : {required : true,digits:true},// 圆形半径 必填项
40 40 'destroy' : {required : true,},// 是否撤销 必填项
41 41 'area' : {number:true,},// 面积 数字
42   - 'descriptions' : {maxlength: 200,},// 描述/说明 最大长度200
  42 + 'descriptions' : {maxlength: 200,}// 描述/说明 最大长度200
43 43 },
44 44 messages:{
45 45 'parkCode':{remote:'停车场编码系统已存在,请您重新输入!',
... ... @@ -122,7 +122,6 @@ var FormWizard = function() {
122 122  
123 123 /*$.validator.addMethod("isHave", function(value, element) {
124 124 PublicFunctions.isHaveParkCode({'parkCode':value},function(d) {
125   - debugger;
126 125 console.log(d);
127 126 if(d.length>0)
128 127 return false;
... ...
src/main/resources/static/pages/base/geo_data_edit/fragments/versions.html
... ... @@ -30,6 +30,7 @@
30 30 <h2 class="uk-modal-title">添加走向版本</h2>
31 31  
32 32 <form class="uk-form-horizontal uk-margin-large">
  33 + <span class="reminder_span" style="color: #ff2f2f;visibility: hidden;">请填写启用时间和版本名称!</span>
33 34 <div class="uk-margin">
34 35 <label class="uk-form-label" >变更走向原因</label>
35 36 <div class="uk-form-controls">
... ... @@ -86,6 +87,7 @@
86 87 <h2 class="uk-modal-title">启用版本({{name}})</h2>
87 88  
88 89 <form class="uk-form-horizontal uk-margin-large">
  90 + <span class="reminder_span" style="color: #ff2f2f;visibility: hidden;">请填写启用时间和版本名称!</span>
89 91 <div class="uk-margin">
90 92 <label class="uk-form-label" >版本名称</label>
91 93 <div class="uk-form-controls">
... ...
src/main/resources/static/pages/base/geo_data_edit/js/submit.js
... ... @@ -168,6 +168,12 @@ var gb_data_submit = function () {
168 168 var f = $('form', '#add_line_versions_modal');
169 169 var data = f.serializeJSON();
170 170 data.lineCode = g_line_code;
  171 + if(!data.startdate || !data.name){
  172 + document.getElementsByClassName('reminder_span')[0].style.visibility = 'visible';
  173 + return;
  174 + }
  175 +
  176 + $('[name=startDate]', modal).on('input',document.getElementsByClassName('reminder_span')[0].style.visibility = 'hidden');
171 177  
172 178 UIkit.modal.confirm('确定线路版本【'+data.name+'】?').then(function() {
173 179 $loadPanel.show();
... ...
src/main/resources/static/pages/base/geo_data_edit/js/version_manage.js
... ... @@ -82,7 +82,7 @@ var gb_version_manage = function () {
82 82 if(!futureInfo)
83 83 return;
84 84  
85   - futureInfo.start_date_str = moment(futureInfo['start_date']).format('YYYY-MM-DD HH:mm');
  85 + futureInfo.start_date_str = moment(futureInfo['start_date']).format('YYYY-MM-DD HH:mm:ss');
86 86  
87 87 var htmlStr = '<span class="t_t_str">?</span> 后启用('+futureInfo.name+')';
88 88 $('.clock_enable_version').append(htmlStr);
... ... @@ -176,6 +176,7 @@ var gb_version_manage = function () {
176 176 var reSetName = function () {
177 177 var remark = $('[name=remark]', modal).val();
178 178 var rq = $('[name=startDate]', modal).val();
  179 + document.getElementsByClassName('reminder_span')[0].style.visibility = 'hidden';
179 180  
180 181 $('[name=name]', modal).val(rq.substr(0, 10).replace(/-/g,'') + remark);
181 182 };
... ... @@ -209,13 +210,38 @@ var gb_version_manage = function () {
209 210 $('.flatpickr-calendar').remove();
210 211 });
211 212  
  213 + function StringBuffer() {
  214 + this.__strings__ = new Array();
  215 + };
  216 + StringBuffer.prototype.append = function (str) {
  217 + this.__strings__.push(str);
  218 + return this; //方便链式操作
  219 + };
  220 + StringBuffer.prototype.toString = function () {
  221 + return this.__strings__.join("");
  222 + };
  223 +
212 224 function getUseTime(nowDate, startDate) {
213 225 var hour = nowDate.getHours();
214 226 var min = nowDate.getMinutes();
  227 + var tdoa = nowDate.getTime() - startDate.getTime();
215 228 var sec = "";
216 229 var showMin = "";
217 230 var showHour = "";
  231 + var showYear = Math.floor(tdoa/ 1000 / 60 / 60 / 24 / 365);
  232 + var showMonth = Math.floor(tdoa/ 1000 / 60 / 60 / 24 / 30);
  233 + var showDay = Math.floor(tdoa/ 1000 / 60 / 60 / 24);
  234 + var dateStr = new StringBuffer();
218 235  
  236 + if(showYear >= 1) {
  237 + dateStr.append(showYear+"年");
  238 + }
  239 + if(showMonth >= 1) {
  240 + dateStr.append(showMonth+"月");
  241 + }
  242 + if(showDay >= 1) {
  243 + dateStr.append(showDay+"天");
  244 + }
219 245 if (nowDate.getSeconds() < startDate.getSeconds()) {
220 246 min = min - 1;
221 247 var sec_int = (nowDate.getSeconds() + 60) - startDate.getSeconds();
... ... @@ -239,7 +265,8 @@ var gb_version_manage = function () {
239 265 var hour_int = hour - startDate.getHours();
240 266 showHour = hour_int >= 10 ? hour_int + "" : "0" + hour_int;
241 267 }
242   - return showHour + "时" + showMin + "分" + sec;
  268 + debugger;
  269 + return dateStr+showHour + "时" + showMin + "分" + sec;
243 270 }
244 271  
245 272 /**
... ... @@ -254,11 +281,20 @@ var gb_version_manage = function () {
254 281 var conf = {minDate: gb_second_timer.now()};
255 282 $.extend(conf, gb_common.flatpickrDateTimeConfig);
256 283 flatpickr('#enable_line_versions_modal input._flatpickr', conf);
  284 +
  285 + var modal = '#enable_line_versions_modal';
  286 + $('[name=startDate]', modal).on('input',function(){
  287 + document.getElementsByClassName('reminder_span')[0].style.visibility = 'hidden';
  288 + });
257 289 });
258 290 $(document).on('click', '#enable_line_versions_modal button._submit', function () {
259 291 var f = $('form', '#enable_line_versions_modal');
260 292 var data = f.serializeJSON();
261 293 data.lineCode = g_line_code;
  294 + if(!data.startdate || !data.name){
  295 + document.getElementsByClassName('reminder_span')[0].style.visibility = 'visible';
  296 + return;
  297 + }
262 298  
263 299 gb_common.$post('/_geo_data/addEnableInfo', data, function () {
264 300 UIkit.modal('#enable_line_versions_modal').hide();
... ...
src/main/resources/static/pages/base/line/addstation.html
... ... @@ -17,27 +17,14 @@
17 17 <input type="hidden" name="gPolygonGrid" id="gPolygonGridInput" value="" />
18 18 <input type="hidden" name="gJwpoints" id="gJwpointsInput">
19 19 <input type="hidden" name="dbType" id="dbTypeInput" value="b"/>
20   - <input type="hidden" name="x" id="xInput" value=""/>
21   - <input type="hidden" name="y" id="yInput" value=""/>
22   - <!-- 站点名称 -->
23   - <div class="form-body">
24   - <div class="form-group">
25   - <label class="control-label col-md-3">
26   - <span class="required"> * </span> 站点名称&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:
27   - </label>
28   - <div class="col-md-6">
29   - <input type="text" class="form-control" name="zdmc" id="zdmcInput" placeholder="站点名称" readonly="readonly">
30   - </div>
31   - </div>
32   - </div>
33 20 <!-- 站点路由名称 -->
34 21 <div class="form-body">
35 22 <div class="form-group">
36 23 <label class="control-label col-md-3">
37   - <span class="required"> * </span> 站点路由名称:
  24 + <span class="required"> * </span> 站点名称&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:
38 25 </label>
39 26 <div class="col-md-6">
40   - <input type="text" class="form-control" name="stationName" id="stationNameInput" placeholder="站点路由名称">
  27 + <input type="text" class="form-control" name="stationName" id="stationNameInput" placeholder="站点名称">
41 28 </div>
42 29 </div>
43 30 </div>
... ... @@ -138,16 +125,6 @@
138 125 </div>
139 126 </div>
140 127 </div>
141   -
142   - <!-- 道路编码-->
143   - <div class="form-body">
144   - <div class="form-group">
145   - <label class="control-label col-md-3">道路编码&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</label>
146   - <div class="col-md-6">
147   - <input type="text" class="form-control" name="roadCoding" id="roadCodingCodInput">
148   - </div>
149   - </div>
150   - </div>
151 128 <!-- 到站时间 -->
152 129 <div class="form-body">
153 130 <div class="form-group">
... ... @@ -179,12 +156,12 @@
179 156 </div>
180 157  
181 158 <!-- 描述/说明 -->
182   - <div class="form-group">
  159 + <!--<div class="form-group">
183 160 <label class="control-label col-md-3"> 描述/说明&nbsp;&nbsp;&nbsp;&nbsp;: </label>
184 161 <div class="col-md-6">
185 162 <textarea class="form-control" rows="3" name="descriptions" id="descriptionsTextarea" placeholder="描述/说明"></textarea>
186 163 </div>
187   - </div>
  164 + </div>-->
188 165 </form>
189 166 </div>
190 167 <div class="modal-footer">
... ... @@ -214,8 +191,6 @@ $(&#39;#add_station_mobal&#39;).on(&#39;AddStationMobal.show&#39;, function(e, addMap,ajaxd,stao
214 191 // 线路ID.
215 192 $('#lineIdInput').val(Line.id);
216 193 // 获取站点名称元素设值.
217   - $('#zdmcInput').val(Station.stationNamebootbox);
218   - // 获取站点路由名称元素设值.
219 194 $('#stationNameInput').val(Station.stationNamebootbox);
220 195 // 站点编码.
221 196 $('#stationCodInput').val(stationCode).attr('Readonly','Readonly');
... ... @@ -235,7 +210,12 @@ $(&#39;#add_station_mobal&#39;).on(&#39;AddStationMobal.show&#39;, function(e, addMap,ajaxd,stao
235 210 // 获取圆形半径元素,并添加值
236 211 $('#radiusInput').val(Station.radius);
237 212 // 是否撤销
238   - $('#destroySelect').val(0);
  213 + $('#destroySelect').val(0);
  214 + // 版本号
  215 + $.get('/lineVersions/findCurrentVersion',{'lineId':Line.id},function(versions){
  216 + $('#versionsInput').val(versions);
  217 + });
  218 +
239 219  
240 220 var initzdlyP = {'lineId':Line.id,'destroy':0,'direction':Line.dir};
241 221 initSelect(initzdlyP);
... ...
src/main/resources/static/pages/base/line/css/bmap_base.css
1 1 #bmap_basic{
2 2 min-width: 100%;
3   - width: calc(100% + 26px);
4   - margin-top: -28px;
5   - border: 2px solid #fdfdfd;
6   - min-height: 1200px;
  3 + margin-top: -10px;
7 4 height:100%;
8 5 overflow: hidden;
9 6 }
10 7  
  8 +.portlet-body{
  9 + height: 100%;
  10 +}
  11 +
11 12 html,body{
12 13 overflow:hidden;
  14 + height: calc(100% - 10px);
13 15 }
14 16  
15 17 /* 绘画工具栏 */
... ... @@ -84,48 +86,6 @@ html,body{
84 86 box-shadow: 0 12px 15px 0 rgba(204, 204, 204, 0.33),0 17px 50px 0 rgba(204, 204, 204, 0.33);
85 87 }
86 88  
87   -.BMap_pop div:nth-child(1) ,
88   -.BMap_pop div:nth-child(2) ,
89   -.BMap_pop div:nth-child(3) ,
90   -.BMap_pop div:nth-child(4) ,
91   -.BMap_pop div:nth-child(5) ,
92   -.BMap_pop div:nth-child(6) ,
93   -.BMap_pop div:nth-child(7) {
94   -
95   - border:0px solid rgb(255, 255, 255) !important;
96   - background-color:#3B3F51 !important;
97   -
98   -}
99   -
100   -.BMap_pop div:nth-child(3){
101   -
102   - width:23px !important;
103   -
104   -}
105   -
106   -.BMap_pop div:nth-child(7) {
107   -
108   - width:23px !important;
109   -
110   - height:24px !important;
111   -
112   -}
113   -
114   -.BMap_pop div:nth-child(5) {
115   -
116   - height:24px !important;
117   -
118   -}
119   -
120   -/* 图片以后在弄,先隐藏div */
121   -.BMap_pop div:nth-child(8) {
122   -
123   - height:0px !important;
124   - /* background:url('/pages/base/stationroute/css/img/iw3-1.png') no-repeat !important; */
125   - /* background-image:url('/pages/base/stationroute/css/img/windowinfo_b.jpg') !important; */
126   -
127   -}
128   -
129 89 .BMap_pop {
130 90  
131 91 box-shadow: 0 12px 15px 0 rgba(204, 204, 204, 0.33),0 17px 50px 0 rgba(204, 204, 204, 0.33)!important;
... ...
src/main/resources/static/pages/base/line/editRoute.html
... ... @@ -155,8 +155,9 @@ $(&#39;#edit_route_mobal&#39;).on(&#39;editRouteMobal.show&#39;, function(e,transGPS,editRoute,m
155 155 // 设置线路对象生成方式
156 156 editRoute.setLineGenerationType('uploadGPS');
157 157 // 弹出正在加载层
158   - var i = layer.load(2);
159   - // 表单序列化
  158 + var indix = layer.load(2, {time: 100*1000,
  159 + shade: [0.8, '#000']});
  160 + // 表单序列化
160 161 var paramsForm = form.serializeJSON();
161 162 // 切割坐标点
162 163 var array = paramsForm.points.split('\r\n');
... ... @@ -186,8 +187,6 @@ $(&#39;#edit_route_mobal&#39;).on(&#39;editRouteMobal.show&#39;, function(e,transGPS,editRoute,m
186 187 // 参数集合
187 188 var params = {};
188 189 params.baseRes = baseRes;
189   - // 是否添加该站点
190   -
191 190 // 站点信息JSON字符串
192 191 params.stationJSON = stationJSON;
193 192 // 线路ID
... ... @@ -211,9 +210,9 @@ $(&#39;#edit_route_mobal&#39;).on(&#39;editRouteMobal.show&#39;, function(e,transGPS,editRoute,m
211 210 // 路段信息JSON字符串
212 211 params.sectionJSON = sectionJSON;
213 212 addSave(params,line.id,directionData);
214   - });
215   -
216   - });
  213 + layer.close(indix);
  214 + });
  215 + });
217 216 },
218 217  
219 218 });
... ...
src/main/resources/static/pages/base/line/editstation.html
... ... @@ -19,27 +19,14 @@
19 19 <input type="hidden" name="bPolygonGrid" id="bPolygonGridInput" />
20 20 <input type="hidden" name="gPolygonGrid" id="gPolygonGridInput" />
21 21 <input type="hidden" name="dbType" id="dbTypeInput" value="b"/>
22   - <input type="hidden" name="x" id="xInput" value=""/>
23   - <input type="hidden" name="y" id="yInput" value=""/>
24   - <!-- 站点名称 -->
25   - <div class="form-body">
26   - <div class="form-group">
27   - <label class="control-label col-md-3">
28   - <span class="required"> * </span> 站点名称&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:
29   - </label>
30   - <div class="col-md-6">
31   - <input type="text" class="form-control" name="zdmc" id="zdmcInput" placeholder="站点名称" readonly="readonly">
32   - </div>
33   - </div>
34   - </div>
35 22 <!-- 站点路由名称 -->
36 23 <div class="form-body">
37 24 <div class="form-group">
38 25 <label class="control-label col-md-3">
39   - <span class="required"> * </span> 站点路由名称:
  26 + <span class="required"> * </span> 站点名称:
40 27 </label>
41 28 <div class="col-md-6">
42   - <input type="text" class="form-control" name="stationName" id="stationNameInput" placeholder="站点路由名称">
  29 + <input type="text" class="form-control" name="stationName" id="stationNameInput" placeholder="站点名称">
43 30 </div>
44 31 </div>
45 32 </div>
... ... @@ -137,15 +124,6 @@
137 124 </div>
138 125 </div>
139 126 </div>
140   - <!-- 道路编码-->
141   - <div class="form-body">
142   - <div class="form-group">
143   - <label class="control-label col-md-3">道路编码&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</label>
144   - <div class="col-md-6">
145   - <input type="text" class="form-control" name="roadCoding" id="roadCodingCodInput" placeholder="道路编码">
146   - </div>
147   - </div>
148   - </div>
149 127 <!-- 到站时间 -->
150 128 <div class="form-body">
151 129 <div class="form-group">
... ... @@ -175,13 +153,6 @@
175 153 </div>
176 154 </div>
177 155 </div>
178   - <!-- 描述/说明 -->
179   - <div class="form-group">
180   - <label class="control-label col-md-3"> 描述/说明&nbsp;&nbsp;&nbsp;: </label>
181   - <div class="col-md-6">
182   - <textarea class="form-control" rows="3" name="descriptions" id="descriptionsTextarea" placeholder="描述/说明"></textarea>
183   - </div>
184   - </div>
185 156 </form>
186 157 </div>
187 158 <div class="modal-footer">
... ... @@ -225,7 +196,6 @@ $(&#39;#edit_station_mobal&#39;).on(&#39;editSelectMobal_show&#39;, function(e, map_,ajaxd,fun,s
225 196 errorClass : 'help-block help-block-error',
226 197 focusInvalid : false,
227 198 rules : {
228   - 'zdmc' : { required : true,maxlength : 50,},// 站点名称 必填项
229 199 'stationName' : { required : true,maxlength : 50,},// 站点名称 必填项
230 200 'stationCod': {required : true,},// 站点编码 必填项
231 201 'directions' : {required : true,dirIs : true},// 站点方向 必填项 必填项
... ... @@ -236,8 +206,8 @@ $(&#39;#edit_station_mobal&#39;).on(&#39;editSelectMobal_show&#39;, function(e, map_,ajaxd,fun,s
236 206 'radius' : {required : true,number : true},// 圆形半径 必填项
237 207 'destroy' : {required : true},// 是否撤销 必填项
238 208 'toTime' : {number : true},// 到站时间 必须输入合法的数字(负数,小数)。
239   - 'distances' : {number : true},// 到站距离 必须输入合法的数字(负数,小数)。
240   - 'descriptions' : { maxlength: 150}// 描述与说明 最大长度
  209 + 'distances' : {number : true}// 到站距离 必须输入合法的数字(负数,小数)。
  210 + // 'descriptions' : { maxlength: 150}// 描述与说明 最大长度
241 211 },
242 212 invalidHandler : function(event, validator) {
243 213 error.show();
... ... @@ -363,5 +333,5 @@ $(&#39;#edit_station_mobal&#39;).on(&#39;editSelectMobal_show&#39;, function(e, map_,ajaxd,fun,s
363 333 }
364 334 return tel;
365 335 }, '方向必须一致!');
366   -});
  336 +});
367 337 </script>
368 338 \ No newline at end of file
... ...
src/main/resources/static/pages/base/line/editstation_select.html
... ... @@ -10,20 +10,6 @@
10 10 </div>
11 11 <div class="modal-body">
12 12 <form class="form-horizontal" action="/" method="post" id="edit_select" role="form">
13   - <div class="alert alert-danger display-hide" id="editSelectrequired">
14   - <button class="close" data-close="alert"></button>
15   - 站点名称为必填项
16   - </div>
17   - <div class="alert alert-danger display-hide" id="serchrname">
18   - <button class="close" data-close="alert"></button>
19   - 系统无法生成,请选择其他方式新增
20   - </div>
21   - <div class="form-group" id="formRequ">
22   - <label class="col-md-3 control-label"><span class="required"> * </span>站点名称:</label>
23   - <div class="col-md-9" id="errorInfo">
24   - <input type="text" class="form-control input-medium" id="stationNamebootbox" name="stationNamebootbox">
25   - </div>
26   - </div>
27 13 <div class="form-group">
28 14 <label class="col-md-3 control-label"><span class="required"> * </span>修改方式:</label>
29 15 <div class="col-md-9">
... ... @@ -77,8 +63,6 @@ $(&#39;#editstation_select_mobal&#39;).on(&#39;editStationSelectMobal_show&#39;, function(e, map
77 63 $('#stationNamebootbox').val(stationRoute.stationStationName);
78 64 // 获取表单元素
79 65 var form = $('#edit_select');
80   - // 获取错误提示元素
81   - var editSelectrequired = $('#editSelectrequired', form);
82 66 // 下一步操作事件
83 67 $('#editselectStationNextButton').on('click', function() {
84 68 // 表单提交
... ... @@ -90,10 +74,9 @@ $(&#39;#editstation_select_mobal&#39;).on(&#39;editStationSelectMobal_show&#39;, function(e, map
90 74 errorClass : 'help-block help-block-error',
91 75 focusInvalid : false,
92 76 rules : {
93   - 'stationNamebootbox' : {required : true,maxlength : 50,}
  77 + 'stationNamebootbox' : {required : true,maxlength : 50}
94 78 },
95   - invalidHandler : function(event, validator) {
96   - editSelectrequired.show();
  79 + invalidHandler : function(event, validator) {
97 80 App.scrollTo(requiredname, -200);
98 81 },
99 82 highlight : function(element) {
... ... @@ -110,8 +93,6 @@ $(&#39;#editstation_select_mobal&#39;).on(&#39;editStationSelectMobal_show&#39;, function(e, map
110 93 $('#editstation_select_mobal').modal('hide');
111 94 // 表单序列
112 95 var params = form.serializeJSON();
113   - // 站点名称
114   - stationRoute.zdmc = params.stationNamebootbox;
115 96 // 关闭按钮事件
116 97 fun.addAChangeCssAddDisabled();
117 98 if(params.editselect==0){
... ... @@ -124,7 +105,6 @@ $(&#39;#editstation_select_mobal&#39;).on(&#39;editStationSelectMobal_show&#39;, function(e, map
124 105 $('.leftUtils').removeClass('hidden');
125 106 $('.leftUtils').addClass('active');
126 107 drw.drawingManagerClose();
127   - map_.localtionPoint(stationRoute.zdmc);
128 108 layer.close(index);
129 109 }else if(params.editselect==1){
130 110 // 弹出添加失败提示消息,2秒关闭(如果不配置,默认是3秒)
... ...
src/main/resources/static/pages/base/line/js/map-function.js
... ... @@ -55,8 +55,6 @@ var PublicFunctions = function () {
55 55 $('#lineCodeInput').val(editStationParmas.stationRouteLineCode);
56 56 // 百度坐标点图形集合
57 57 $('#bPolygonGridInput').val(editStationParmas.stationBPolygonGrid);
58   - // 获取站点名称元素设值
59   - $('#zdmcInput').val(editStationParmas.stationStationName);
60 58 // 获取站点路由名称元素设值
61 59 $('#stationNameInput').val(editStationParmas.stationRouteStationName);
62 60 // 获取站点编码元素设值
... ... @@ -65,8 +63,6 @@ var PublicFunctions = function () {
65 63 // $('#stationMarkSelect').val(editStationParmas.stationRouteStationMark);
66 64 // 获取站点方向元素设值
67 65 $('#stationdirSelect').val(editStationParmas.stationRouteDirections);
68   - // 获取站点道路编码元素设值
69   - $('#roadCodingCodInput').val(editStationParmas.stationRoadCoding);
70 66 // 百度地图经纬度坐标中心点
71 67 $('#bJwpointsInput').val(editStationParmas.stationBJwpoints);
72 68 if(editStationParmas.stationShapesType=='r') {
... ... @@ -79,7 +75,7 @@ var PublicFunctions = function () {
79 75 // 获取半径元素,并添加值
80 76 $('#radiusInput').val(editStationParmas.stationRadius);
81 77 // 是否撤销
82   - $('#destroySelect').val(editStationParmas.stationDestroy);
  78 + $('#destroySelect').val(editStationParmas.destroy);
83 79 // 到站时间
84 80 $('#toTimeInput').val(editStationParmas.stationRouteToTime);
85 81 // 到站距离
... ... @@ -87,7 +83,7 @@ var PublicFunctions = function () {
87 83 // 线路版本号
88 84 $('#versionsInput').val(editStationParmas.stationRouteVersions);
89 85 // 描述/说明
90   - $('#descriptionsTextarea').val(editStationParmas.stationRouteDescriptions);
  86 + // $('#descriptionsTextarea').val(editStationParmas.stationRouteDescriptions);
91 87 },
92 88 /** 在地图上画出线路走向 @param:<Line.id:线路Id;0:上行;data:路段数据> */
93 89 linePanlThree : function(lineId,data,direction) {
... ...
src/main/resources/static/pages/base/line/js/map.js
... ... @@ -17,980 +17,709 @@ var WorldsBMapLine = function () {
17 17 var mapBValue = '', polyUpline='', sectionList = [], pointIndex = 0, iseditStatus = false, firstPoint = null, isCutSection = false;
18 18  
19 19 var Bmap = {
20   -
21   - init : function() {
22   -
23   - // 设置中心点,
24   - var CENTER_POINT = {lng : 121.528733,lat : 31.237425};
25   -
26   - // 百度API Key
27   - var bdKey = 'IGGrr4UjwIYzatoCRFKEL8sT';
28   -
29   - // 初始化百度地图
30   - mapBValue = new BMap.Map("bmap_basic");
31   -
32   - //中心点和缩放级别
33   - mapBValue.centerAndZoom(new BMap.Point(CENTER_POINT.lng,CENTER_POINT.lat), 20);
34   -
35   - //启用地图拖拽事件,默认启用(可不写)
36   - mapBValue.enableDragging();
37   -
38   - //启用地图滚轮放大缩小
39   - mapBValue.enableScrollWheelZoom();
40   -
41   - //禁用鼠标双击放大
42   - mapBValue.disableDoubleClickZoom();
43   -
44   - //启用键盘上下左右键移动地图
45   - mapBValue.enableKeyboard();
46   -
47   - return mapBValue;
48   - },
49   - /** 获取第一个切路段的点 @return Point*/
50   - getFirstPoint : function() {
51   - return firstPoint;
52   - },
53   - /** 第一个切路段的点 */
54   - setFirstPoint : function(Point) {
55   - firstPoint = Point;
56   - },
57   - /** 获取地图对象 @return 地图对象map */
58   - getmapBValue : function() {
59   -
60   - return mapBValue;
61   -
62   - },
63   -
64   - getPolyUpline : function() {
65   -
66   - return polyUpline;
67   - },
68   -
69   - /** 获取截取过的路段 @return 路段对象List */
70   - getSectionList : function() {
71   -
72   - return sectionList;
73   -
74   - },
75   - setSectionList : function(list) {
76   -
77   - sectionList = list;
78   - },
79   - initCutSectionPoint : function() {
  20 + init : function() {
  21 + // 设置中心点,
  22 + var CENTER_POINT = {lng : 121.528733,lat : 31.237425};
  23 + // 百度API Key
  24 + var bdKey = 'IGGrr4UjwIYzatoCRFKEL8sT';
  25 + // 初始化百度地图
  26 + mapBValue = new BMap.Map("bmap_basic");
  27 + //中心点和缩放级别
  28 + mapBValue.centerAndZoom(new BMap.Point(CENTER_POINT.lng,CENTER_POINT.lat), 20);
  29 + //启用地图拖拽事件,默认启用(可不写)
  30 + mapBValue.enableDragging();
  31 + //启用地图滚轮放大缩小
  32 + mapBValue.enableScrollWheelZoom();
  33 + //禁用鼠标双击放大
  34 + mapBValue.disableDoubleClickZoom();
  35 + //启用键盘上下左右键移动地图
  36 + mapBValue.enableKeyboard();
  37 + return mapBValue;
  38 + },
  39 +
  40 + /** 获取第一个切路段的点 @return Point*/
  41 + getFirstPoint : function() {
  42 + return firstPoint;
  43 + },
  44 + /** 第一个切路段的点 */
  45 + setFirstPoint : function(Point) {
  46 + firstPoint = Point;
  47 + },
  48 + /** 获取地图对象 @return 地图对象map */
  49 + getmapBValue : function() {
  50 + return mapBValue;
  51 + },
  52 + getPolyUpline : function() {
  53 + return polyUpline;
  54 + },
  55 +
  56 + /** 获取截取过的路段 @return 路段对象List */
  57 + getSectionList : function() {
  58 + return sectionList;
  59 + },
  60 + setSectionList : function(list) {
  61 + sectionList = list;
  62 + },
  63 + initCutSectionPoint : function() {
  64 + sectionList = [];
  65 + var tbodyHtml = template('section_list',{list : sectionList});
  66 + $('#section_table tbody').html(tbodyHtml);
  67 + },
  68 + /** 获取切路段的点下标 @return int*/
  69 + setPointIndex : function(index) {
  70 + pointIndex = index;
  71 + },
  72 + getPointIndex : function() {
  73 + return pointIndex;
  74 + },
  75 + /** 获取路段是否在编辑状态 @return boolean*/
  76 + getIsEditStatus : function() {
  77 + return iseditStatus;
  78 + },
  79 + setIsEditStatus : function(v) {
  80 + iseditStatus = v ;
  81 + },
  82 +
  83 + /** 获取路段是否在截取状态 @return boolean*/
  84 + getIsCutSection : function() {
  85 + return isCutSection;
  86 + },
  87 + setIsCutSection : function(v) {
  88 + isCutSection = v ;
  89 + },
  90 +
  91 + /** 获取距离与时间 @param <points:坐标点集合> */
  92 + getDistanceAndDuration : function(points,callback){
  93 + // 获取长度
  94 + var len = points.length;
  95 + (function(){
  96 + if (!arguments.callee.count) {
  97 + arguments.callee.count = 0;
  98 + }
  99 + arguments.callee.count++;
  100 + var index = parseInt(arguments.callee.count) - 1;
  101 + if (index >= len-1) {
  102 + callback && callback(points);
  103 + return;
  104 + }
  105 + // 当函数被调用时,它的arguments.callee对象就会指向自身,也就是一个对自己的引用。(当前正在执行的函数。)
  106 + var f = arguments.callee;
  107 + // 起点坐标 <坐标格式:40.056878,116.30815>
  108 + var origin = points[index].potion.lat + ',' + points[index].potion.lng;
  109 + // 终点坐标 <坐标格式:40.056878,116.30815>
  110 + var destination = points[index+1].potion.lat + ',' + points[index+1].potion.lng;
  111 + var region = '上海';
  112 + var origin_region = '上海';
  113 + var destination_region = '上海';
  114 + var output = 'json';
  115 + var ak_My = 'wjlITmXeCek5MxyU3ZUBkTeU8B0o0npk';
  116 + /**
  117 + * origin:起点名称或经纬度;
  118 + *
  119 + * destination:终点名称或经纬度;
  120 + *
  121 + * origin_region:起始点所在城市,驾车导航时必填。
  122 + *
  123 + * destination_region:终点所在城市,驾车导航时必填。
  124 + *
  125 + * output :表示输出类型,可设置为xml或json,默认为xml。
  126 + *
  127 + **/
  128 + var paramsB = {origin:origin,destination:destination,region:region,origin_region:origin_region,destination_region:destination_region,output:output,ak:ak_My};
  129 + /** @description :未认证开发者默认配额为:2000次/天。 */
  130 + $.ajax({
  131 + // 百度地图根据坐标获取两点之间的时间与距离
  132 + url: 'http://api.map.baidu.com/direction/v1?mode=transit',
  133 + data: paramsB,
  134 + dataType: 'jsonp',
  135 + success: function(r){
  136 + if(r) {
  137 + if(r.message=='ok') {
  138 + if(r.result.taxi==null) {
  139 + // 获取距离(单位:米)
  140 + points[index+1].distance = 0;
  141 + // 获取时间(单位:秒)
  142 + points[index+1].duration = 0;
  143 + }else {
  144 + // 获取距离(单位:米)
  145 + points[index+1].distance = r.result.taxi.distance;
  146 + // 获取时间(单位:秒)
  147 + points[index+1].duration = r.result.taxi.duration;
  148 + }
  149 + }
  150 + }
  151 + f();
  152 + }
  153 + });
  154 + })();
  155 + },
  156 + drawingSection: function(data){
  157 + /** 获取站点路由信息 @param:<Line.id:线路Id;0:上行> @return:<resultdata:站点路由数据> */
  158 + WorldsBMapLine.clearMarkAndOverlays();
  159 + // 编辑路段数据
  160 + if(data) {
  161 + // 地图折线坐标点集合
  162 + var polylineArray = [];
  163 + // 获取路段折线坐标字符串
  164 + var sectionBsectionVectorStr = data.sectionBsectionVector;
  165 + if(sectionBsectionVectorStr==null) {
  166 + return;
  167 + }
  168 + // 切割段折线坐标字符串
  169 + var tempStr = sectionBsectionVectorStr.substring(11,sectionBsectionVectorStr.length-1);
  170 + // 分割折线坐标字符串
  171 + var lineArray = tempStr.split(',');
  172 + for(var i = 0;i<lineArray.length;i++) {
  173 + polylineArray.push(new BMap.Point(lineArray[i].split(' ')[0],lineArray[i].split(' ')[1]));
  174 + }
  175 + var index = parseInt(polylineArray.length/2);
  176 + var center = polylineArray[index];
  177 + /** 在地图上画出线路走向 @param:<polylineArray:地图折线坐标点集合;resultdata:站点路由数据> */
  178 + WorldsBMapLine.drawingUpline(polylineArray,center);
  179 + /** 在地图上画点 @param:<point_center:中心坐标点> */
  180 + WorldsBMapLine.drawingUpStationPoint(center,data.sectionName,1);
  181 + }
  182 + },
  183 + // 在地图上画出上行线路走向(单路段)
  184 + drawingUpline : function (polylineArray,polyline_center,data) {
  185 + /*WorldsBMap.clearMarkAndOverlays();*/
  186 + polyUpline = '';
  187 + // 创建线路走向
  188 + polyUpline = new BMap.Polyline(polylineArray, {strokeColor : "blue",strokeWeight : 6,strokeOpacity : 0.5});
  189 + // polyUpline.data = data;
  190 + // 把折线添加到地图上
  191 + mapBValue.addOverlay(polyUpline);
  192 + mapBValue.reset();
  193 + mapBValue.panTo(polyline_center);
  194 + mapBValue.setZoom(15);
  195 + },
  196 +
  197 + // 在地图上画出上行线路走向(多路段)
  198 + drawingUpline01 : function (polylineArray,polyline_center,data) {
  199 + var polyUpline01 = 'polyline' + '_' + data.sectionrouteId;
  200 + // 创建线路走向
  201 + polyUpline01 = new BMap.Polyline(polylineArray, {strokeColor : "blue",strokeWeight : 6,strokeOpacity : 0.5});
  202 + polyUpline01.data = data;
  203 + // 把折线添加到地图上
  204 + mapBValue.addOverlay(polyUpline01);
  205 + var sectionPoint = [];
  206 + // 线路单击事件
  207 + polyUpline01.addEventListener('click',function(e) {
  208 + if(WorldsBMapLine.getIsEditStatus()) {
  209 + layer.msg('请先保存正在编辑的路段信息...');
  210 + return false;
  211 + }
  212 + if(WorldsBMapLine.getIsCutSection()) {
  213 + layer.msg('请先撤销所有切路段的点...');
  214 + return false;
  215 + }
  216 + polyUpline01.enableEditing();
  217 + WorldsBMapLine.setIsEditStatus(true);
  218 + // 关闭按钮事件
  219 + PublicFunctions.addAChangeCssAddDisabled();
  220 + });
  221 +
  222 + // 添加路段双击事件
  223 + polyUpline01.addEventListener("dblclick",function(e){
  224 + if(WorldsBMapLine.getIsCutSection()) {
  225 + layer.msg('请先撤销所有切路段的点...');
  226 + return false;
  227 + }
  228 + WorldsBMapLine.setIsEditStatus(false);
  229 + // 关闭
  230 + layer.closeAll();
  231 + polyUpline01.disableEditing();
  232 + EditSectionObj.setEitdSection(polyUpline01.data);
  233 + // 获取折线坐标集合
  234 + var editPloyLineArray = polyUpline01.getPath();
  235 + EditSectionObj.setEitdBsectionVector(JSON.stringify(editPloyLineArray));
80 236 sectionList = [];
81 237 var tbodyHtml = template('section_list',{list : sectionList});
  238 + // 截取路段
82 239 $('#section_table tbody').html(tbodyHtml);
83   - },
84   - /** 获取切路段的点下标 @return int*/
85   - setPointIndex : function(index) {
86   - pointIndex = index;
87   - },
88   - getPointIndex : function() {
89   -
90   - return pointIndex;
91   -
92   - },
93   - /** 获取路段是否在编辑状态 @return boolean*/
94   - getIsEditStatus : function() {
95   - return iseditStatus;
96   - },
97   - setIsEditStatus : function(v) {
98   - iseditStatus = v ;
99   - },
100   -
101   - /** 获取路段是否在截取状态 @return boolean*/
102   - getIsCutSection : function() {
103   - return isCutSection;
104   - },
105   - setIsCutSection : function(v) {
106   - isCutSection = v ;
107   - },
108   -
109   - /** 获取距离与时间 @param <points:坐标点集合> */
110   - getDistanceAndDuration : function(points,callback){
111   -
112   - // 获取长度
113   - var len = points.length;
114   - (function(){
115   -
116   - if (!arguments.callee.count) {
117   -
118   - arguments.callee.count = 0;
119   -
120   - }
121   -
122   - arguments.callee.count++;
123   -
124   - var index = parseInt(arguments.callee.count) - 1;
125   -
126   - if (index >= len-1) {
127   - callback && callback(points);
128   -
129   - return;
130   - }
131   -
132   - // 当函数被调用时,它的arguments.callee对象就会指向自身,也就是一个对自己的引用。(当前正在执行的函数。)
133   - var f = arguments.callee;
134   - // 起点坐标 <坐标格式:40.056878,116.30815>
135   - var origin = points[index].potion.lat + ',' + points[index].potion.lng;
136   -
137   - // 终点坐标 <坐标格式:40.056878,116.30815>
138   - var destination = points[index+1].potion.lat + ',' + points[index+1].potion.lng;
139   - var region = '上海';
140   -
141   - var origin_region = '上海';
142   -
143   - var destination_region = '上海';
144   -
145   - var output = 'json';
146   -
147   - var ak_My = 'wjlITmXeCek5MxyU3ZUBkTeU8B0o0npk';
148   -
149   - /**
150   - * origin:起点名称或经纬度;
151   - *
152   - * destination:终点名称或经纬度;
153   - *
154   - * origin_region:起始点所在城市,驾车导航时必填。
155   - *
156   - * destination_region:终点所在城市,驾车导航时必填。
157   - *
158   - * output :表示输出类型,可设置为xml或json,默认为xml。
159   - *
160   - **/
161   - var paramsB = {origin:origin,destination:destination,region:region,origin_region:origin_region,destination_region:destination_region,output:output,ak:ak_My};
162   -
163   - /** @description :未认证开发者默认配额为:2000次/天。 */
164   - $.ajax({
165   -
166   - // 百度地图根据坐标获取两点之间的时间与距离
167   - url: 'http://api.map.baidu.com/direction/v1?mode=transit',
168   -
169   - data: paramsB,
170   -
171   - dataType: 'jsonp',
172   -
173   - success: function(r){
174   -
175   - if(r) {
176   -
177   - if(r.message=='ok') {
178   -
179   - if(r.result.taxi==null) {
180   -
181   - // 获取距离(单位:米)
182   - points[index+1].distance = 0;
183   -
184   - // 获取时间(单位:秒)
185   - points[index+1].duration = 0;
186   -
187   - }else {
188   -
189   - // 获取距离(单位:米)
190   - points[index+1].distance = r.result.taxi.distance;
191   -
192   - // 获取时间(单位:秒)
193   - points[index+1].duration = r.result.taxi.duration;
194   -
195   - }
196   -
197   -
198   - }
199   -
200   - }
201   -
202   - f();
203   - }
204   - });
205   -
206   - })();
207   -
208   - },
209   - drawingSection: function(data){
210   - /** 获取站点路由信息 @param:<Line.id:线路Id;0:上行> @return:<resultdata:站点路由数据> */
211   - WorldsBMapLine.clearMarkAndOverlays();
212   - // 编辑路段数据
213   - if(data) {
214   - // 地图折线坐标点集合
215   - var polylineArray = [];
216   - // 获取路段折线坐标字符串
217   - var sectionBsectionVectorStr = data.sectionBsectionVector;
218   - if(sectionBsectionVectorStr==null) {
219   - return;
220   - }
221   - // 切割段折线坐标字符串
222   - var tempStr = sectionBsectionVectorStr.substring(11,sectionBsectionVectorStr.length-1);
223   - // 分割折线坐标字符串
224   - var lineArray = tempStr.split(',');
225   - for(var i = 0;i<lineArray.length;i++) {
226   - polylineArray.push(new BMap.Point(lineArray[i].split(' ')[0],lineArray[i].split(' ')[1]));
227   - }
228   - var index = parseInt(polylineArray.length/2);
229   - var center = polylineArray[index];
230   - /** 在地图上画出线路走向 @param:<polylineArray:地图折线坐标点集合;resultdata:站点路由数据> */
231   - WorldsBMapLine.drawingUpline(polylineArray,center);
232   - /** 在地图上画点 @param:<point_center:中心坐标点> */
233   - WorldsBMapLine.drawingUpStationPoint(center,data.sectionName,1);
234   - }
235   - },
236   - // 在地图上画出上行线路走向(单路段)
237   - drawingUpline : function (polylineArray,polyline_center,data) {
238   - /*WorldsBMap.clearMarkAndOverlays();*/
239   - polyUpline = '';
240   - // 创建线路走向
241   - polyUpline = new BMap.Polyline(polylineArray, {strokeColor : "blue",strokeWeight : 6,strokeOpacity : 0.5});
242   - // polyUpline.data = data;
243   - // 把折线添加到地图上
244   - mapBValue.addOverlay(polyUpline);
245   - var PanOptions_ ={noAnimation :true};
246   - mapBValue.reset();
247   - mapBValue.panTo(polyline_center,PanOptions_);
248   - mapBValue.panBy(500,-510,PanOptions_);
249   - mapBValue.setZoom(14);
250   - },
251   -
252   - // 在地图上画出上行线路走向(多路段)
253   - drawingUpline01 : function (polylineArray,polyline_center,data) {
254   - var polyUpline01 = 'polyline' + '_' + data.sectionrouteId;
255   - // 创建线路走向
256   - polyUpline01 = new BMap.Polyline(polylineArray, {strokeColor : "blue",strokeWeight : 6,strokeOpacity : 0.5});
257   - polyUpline01.data = data;
258   - // 把折线添加到地图上
259   - mapBValue.addOverlay(polyUpline01);
260   - var sectionPoint = [];
261   - // 线路单击事件
262   - polyUpline01.addEventListener('click',function(e) {
263   - if(WorldsBMapLine.getIsEditStatus()) {
264   - layer.msg('请先保存正在编辑的路段信息...');
265   - return false;
266   - }
267   - if(WorldsBMapLine.getIsCutSection()) {
268   - layer.msg('请先撤销所有切路段的点...');
269   - return false;
270   - }
271   - polyUpline01.enableEditing();
272   - WorldsBMapLine.setIsEditStatus(true);
273   - // 关闭按钮事件
274   - PublicFunctions.addAChangeCssAddDisabled();
  240 + // 加载修改路段弹出层mobal页面
  241 + $.get('editsection.html', function(m){
  242 + $(pjaxContainer).append(m);
  243 + $('#edit_section_mobal_cache').trigger('editSectionMobalCache_show', [WorldsBMapLine,MapGetAjaxData,EditSectionObj,PublicFunctions]);
275 244 });
276   -
277   - // 添加路段双击事件
278   - polyUpline01.addEventListener("dblclick",function(e){
279   - if(WorldsBMapLine.getIsCutSection()) {
280   - layer.msg('请先撤销所有切路段的点...');
281   - return false;
282   - }
283   - WorldsBMapLine.setIsEditStatus(false);
284   - // 关闭
285   - layer.closeAll();
286   - polyUpline01.disableEditing();
  245 + // 打开按钮事件
  246 + PublicFunctions.editAChangeCssRemoveDisabled();
  247 + });
  248 +
  249 + // 路段右击事件
  250 + var editSection = function(e,ee,marker){
  251 + if(WorldsBMapLine.getIsEditStatus()) {
  252 + layer.msg('请先保存正在编辑的路段信息...');
  253 + return false;
  254 + }
  255 + var lng = e.lng;
  256 + var lat = e.lat;
  257 + var sectionName = null;
  258 + var marker = new BMap.Marker(new BMap.Point(lng, lat)); // 创建点
  259 + var label = new BMap.Label(pointIndex+1,{offset:new BMap.Size(pointIndex>8?0:4,0)});
  260 + label.setStyle({border :"0", color : "white",backgroundColor:"rgba(0,0,0,0)"});
  261 + marker.setLabel(label);
  262 + marker.isFlag = true;
  263 + if(pointIndex == 0) {
  264 + sectionPoint[pointIndex] = {lng:lng , lat:lat};
  265 + layer.msg('进入切路段状态,请选择本路段的终点!');
  266 + mapBValue.addOverlay(marker);// 添加覆盖物
  267 + firstPoint = {lng:lng, lat:lat};
  268 + pointIndex++;
287 269 EditSectionObj.setEitdSection(polyUpline01.data);
288 270 // 获取折线坐标集合
289 271 var editPloyLineArray = polyUpline01.getPath();
290 272 EditSectionObj.setEitdBsectionVector(JSON.stringify(editPloyLineArray));
291   - sectionList = [];
292   - var tbodyHtml = template('section_list',{list : sectionList});
293   - // 截取路段
294   - $('#section_table tbody').html(tbodyHtml);
295   - // 加载修改路段弹出层mobal页面
296   - $.get('editsection.html', function(m){
297   - $(pjaxContainer).append(m);
298   - $('#edit_section_mobal_cache').trigger('editSectionMobalCache_show', [WorldsBMapLine,MapGetAjaxData,EditSectionObj,PublicFunctions]);
299   - });
300   - // 打开按钮事件
301   - PublicFunctions.editAChangeCssRemoveDisabled();
302   - });
303   -
304   - // 路段右击事件
305   - var editSection = function(e,ee,marker){
306   - if(WorldsBMapLine.getIsEditStatus()) {
307   - layer.msg('请先保存正在编辑的路段信息...');
308   - return false;
309   - }
310   - var lng = e.lng;
311   - var lat = e.lat;
312   - var sectionName = null;
313   - var marker = new BMap.Marker(new BMap.Point(lng, lat)); // 创建点
314   - var label = new BMap.Label(pointIndex+1,{offset:new BMap.Size(pointIndex>8?0:4,0)});
315   - label.setStyle({border :"0", color : "white",backgroundColor:"rgba(0,0,0,0)"});
316   - marker.setLabel(label);
317   - marker.isFlag = true;
318   - if(pointIndex == 0) {
  273 + } else if (pointIndex > 0) {
  274 + $('#search_input').bind('keyup', function(event) {
  275 + if (event.keyCode == "13") {
  276 + //回车执行查询
  277 + $('#search_button').click();
  278 + }
  279 + });
  280 + layer.prompt({title: '请输入路段名!'}, function(sectionName, index){
  281 + pointList = [];
319 282 sectionPoint[pointIndex] = {lng:lng , lat:lat};
320   - layer.msg('进入切路段状态,请选择本路段的终点!');
  283 + pointList[0] = sectionPoint[pointIndex-1];
  284 + pointList[1] = sectionPoint[pointIndex];
  285 + sectionList.push({name:sectionName, section:pointList});
  286 + layer.close(index);
  287 + layer.msg('路段截取成功,请选择下一个路段的终点');
321 288 mapBValue.addOverlay(marker);// 添加覆盖物
322   - firstPoint = {lng:lng, lat:lat};
  289 + var tbodyHtml = template('section_list',{list : sectionList});
  290 + // 截取路段
  291 + $('#section_table tbody').html(tbodyHtml);
323 292 pointIndex++;
324   - EditSectionObj.setEitdSection(polyUpline01.data);
325   - // 获取折线坐标集合
326   - var editPloyLineArray = polyUpline01.getPath();
327   - EditSectionObj.setEitdBsectionVector(JSON.stringify(editPloyLineArray));
328   - } else if (pointIndex > 0) {
329   - layer.prompt({title: '请输入路段名!'}, function(sectionName, index){
330   - pointList = [];
331   - sectionPoint[pointIndex] = {lng:lng , lat:lat};
332   - pointList[0] = sectionPoint[pointIndex-1];
333   - pointList[1] = sectionPoint[pointIndex];
334   - sectionList.push({name:sectionName, section:pointList});
335   - layer.close(index);
336   - layer.msg('路段截取成功,请选择下一个路段的终点');
337   - mapBValue.addOverlay(marker);// 添加覆盖物
338   - var tbodyHtml = template('section_list',{list : sectionList});
339   - // 截取路段
340   - $('#section_table tbody').html(tbodyHtml);
341   - pointIndex++;
342   - });
  293 + });
  294 + }
  295 + WorldsBMapLine.setIsCutSection(true);
  296 + }
  297 + var markerMenu=new BMap.ContextMenu();
  298 + markerMenu.addItem(new BMap.MenuItem('切路段',editSection.bind(polyUpline01)));
  299 + polyUpline01.addContextMenu(markerMenu);
  300 + // 路段生成类型位gps上传时才开启右击事件
  301 + /*if(EditRoute.getLineGenerationType() == 'uploadGPS') {
  302 +
  303 + }*/
  304 +
  305 +
  306 + mapBValue.reset();
  307 + mapBValue.panTo(polyline_center);
  308 + mapBValue.setZoom(15);
  309 + },
  310 + // 删除点刷新cutSectionTable
  311 + refreshCutSectionTable : function() {
  312 + var tbodyHtml = template('section_list',{list : sectionList});
  313 + $('#section_table tbody').html(tbodyHtml);
  314 + },
  315 + // 删除点刷新覆盖物
  316 + deleteCutSectionPoint : function(point) {
  317 + var lng = point.lng;
  318 + var lat = point.lat;
  319 + var allOverlay = mapBValue.getOverlays();
  320 + // 删除最后一个点
  321 + for (var i = 0; i < allOverlay.length -1; i++){
  322 + if(allOverlay[i].isFlag) {
  323 + if(allOverlay[i].point.lng == lng && allOverlay[i].point.lat == lat){
  324 + mapBValue.removeOverlay(allOverlay[i]);
  325 + break;
343 326 }
344   - WorldsBMapLine.setIsCutSection(true);
345 327 }
346   - // 路段生成类型位gps上传时才开启右击事件
347   - if(EditRoute.getLineGenerationType() == 'uploadGPS') {
348   - var markerMenu=new BMap.ContextMenu();
349   - markerMenu.addItem(new BMap.MenuItem('切路段',editSection.bind(polyUpline01)));
350   - polyUpline01.addContextMenu(markerMenu);
  328 + }
  329 + },
  330 + // 批量画点
  331 + batchPaintingPoint : function() {
  332 + // 画第一个点
  333 + var Point = WorldsBMapLine.getFirstPoint();
  334 + if(Point){
  335 + var marker = new BMap.Marker(new BMap.Point(Point.lng, Point.lat)); // 创建点
  336 + var label = new BMap.Label(1,{offset:new BMap.Size(4,0)});
  337 + label.setStyle({border :"0", color : "white",backgroundColor:"rgba(0,0,0,0)"});
  338 + marker.setLabel(label);
  339 + marker.isFlag = true;
  340 + mapBValue.addOverlay(marker);// 添加覆盖物
  341 +
  342 + WorldsBMapLine.getFirstPoint();
  343 + }
  344 + $.each(sectionList, function(index, value) {
  345 + var section = value.section;
  346 +
  347 + var marker = new BMap.Marker(new BMap.Point(section[1].lng, section[1].lat)); // 创建点
  348 + var label = new BMap.Label(index+2,{offset:new BMap.Size(index>7?0:4,0)});
  349 + label.setStyle({border :"0", color : "white",backgroundColor:"rgba(0,0,0,0)"});
  350 + marker.setLabel(label);
  351 + marker.isFlag = true;
  352 + mapBValue.addOverlay(marker);// 添加覆盖物
  353 + });
  354 +
  355 + },
  356 + /** 在地图上画点 @param:<point_center:中心坐标点> */
  357 + drawingUpStationPoint : function(point_center,stationName,s) {
  358 +
  359 + // 自定义标注物图片
  360 + var icon_target = new BMap.Icon('/pages/base/stationroute/css/img/gjzd.png',new BMap.Size(10, 10));
  361 +
  362 + var html2 = '<div style="position: absolute; margin: 0pt; padding: 0pt; width: 160px; height: 26px; left: -10px; top: -35px; overflow: hidden;">'
  363 + + '<img class="rm3_image" style="border:none;left:0px; top:0px; position:absolute;" src="/pages/base/stationroute/css/img/back160.png">'
  364 + + '</div>'
  365 + + '<label class=" BMapLabel" unselectable="on" style="position: absolute; -moz-user-select: none; display: inline; cursor: inherit; border: 0px none; padding: 2px 1px 1px; white-space: nowrap; font: 12px arial,simsun; z-index: 80; color: rgb(255, 102, 0); left: 15px; top: -35px;"><span style="float: left; color: #fdfdfd; margin-left: -22px; font-size: 6px;">'+ s+'</span>'+ stationName+'</label>';
  366 +
  367 + var myRichMarker1 = new BMapLib.RichMarker(html2, point_center,{
  368 + "anchor" : new BMap.Size(-10,8),
  369 + "enableDragging" : true});
  370 + myRichMarker1.disableDragging();
  371 + mapBValue.addOverlay(myRichMarker1);
  372 + // 创建标注物
  373 + marker = new BMap.Marker(point_center,{icon : icon_target});
  374 + // 允许覆盖物在map.clearOverlays方法中被清除。
  375 + marker.enableMassClear();
  376 + mapBValue.addOverlay(marker);
  377 + },
  378 +
  379 + // 根据站点坐标匹配库中的公交站点
  380 + stationsPointsToLibraryPoint : function(arra,callback) {
  381 + // 获取长度
  382 + var len = arra.length;
  383 + var station = {};
  384 + var stationList = [];
  385 + (function(){
  386 + if (!arguments.callee.count) {
  387 + arguments.callee.count = 0;
351 388 }
352   -
353   -
354   - var PanOptions_ ={noAnimation :true};
355   - mapBValue.reset();
356   - mapBValue.panTo(polyline_center,PanOptions_);
357   - mapBValue.panBy(500,-510,PanOptions_);
358   - mapBValue.setZoom(14);
359   - },
360   - // 删除点刷新cutSectionTable
361   - refreshCutSectionTable : function() {
362   - var tbodyHtml = template('section_list',{list : sectionList});
363   - $('#section_table tbody').html(tbodyHtml);
364   - },
365   - // 删除点刷新覆盖物
366   - deleteCutSectionPoint : function(point) {
367   - var lng = point.lng;
368   - var lat = point.lat;
369   - var allOverlay = mapBValue.getOverlays();
370   - // 删除最后一个点
371   - for (var i = 0; i < allOverlay.length -1; i++){
372   - if(allOverlay[i].isFlag) {
373   - if(allOverlay[i].point.lng == lng && allOverlay[i].point.lat == lat){
374   - mapBValue.removeOverlay(allOverlay[i]);
375   - break;
376   - }
377   - }
378   - }
379   - },
380   - // 批量画点
381   - batchPaintingPoint : function() {
382   - // 画第一个点
383   - var Point = WorldsBMapLine.getFirstPoint();
384   - if(Point){
385   - var marker = new BMap.Marker(new BMap.Point(Point.lng, Point.lat)); // 创建点
386   - var label = new BMap.Label(1,{offset:new BMap.Size(4,0)});
387   - label.setStyle({border :"0", color : "white",backgroundColor:"rgba(0,0,0,0)"});
388   - marker.setLabel(label);
389   - marker.isFlag = true;
390   - mapBValue.addOverlay(marker);// 添加覆盖物
391   -
392   - WorldsBMapLine.getFirstPoint();
  389 + arguments.callee.count++;
  390 + var index = parseInt(arguments.callee.count) - 1;
  391 + if (index >= len) {
  392 + callback && callback(stationList);
  393 + return ;
393 394 }
394   - $.each(sectionList, function(index, value) {
395   - var section = value.section;
396   -
397   - var marker = new BMap.Marker(new BMap.Point(section[1].lng, section[1].lat)); // 创建点
398   - var label = new BMap.Label(index+2,{offset:new BMap.Size(index>7?0:4,0)});
399   - label.setStyle({border :"0", color : "white",backgroundColor:"rgba(0,0,0,0)"});
400   - marker.setLabel(label);
401   - marker.isFlag = true;
402   - mapBValue.addOverlay(marker);// 添加覆盖物
  395 + var f = arguments.callee;
  396 + station = arra[index];
  397 + if(arra[index].name!=''){
  398 +
  399 + $.get('/station/matchStation',station,function(resultStation) {
  400 + stationList.push({name:resultStation.name ,wgs:arra[index].wgs,potion:{lng:resultStation.potion_lng, lat:resultStation.potion_lat}, isHave:resultStation.isHave , id:resultStation.id});
  401 + f();
  402 + });
  403 + }else {
  404 + f();
  405 + }
  406 + })()
  407 + },
  408 + infoWin : function (objStation) {
  409 + if (objStation) {
  410 + // 站点形状
  411 + var shapes = objStation.stationShapesType;
  412 + // 获取中心坐标点字符串分割
  413 + var BJwpoints = objStation.stationBJwpoints.split(' ');
  414 + var width = Bmap.strGetLength(objStation.stationRouteStationName) * 11;
  415 + // 信息窗口参数属性
  416 + var opts = {
  417 + // 信息窗口宽度
  418 + width: (width < 240 ? 240 : width),
  419 + // 信息窗口高度
  420 + height: shapes == "r" ? 300 : 270,
  421 + // 信息窗位置偏移值。
  422 + // offset: new mapBValue.Size(10, -20),
  423 + //设置不允许信窗发送短息
  424 + enableMessage: false,
  425 + //是否开启点击地图关闭信息窗口
  426 + enableCloseOnClick: false,
  427 + // 是否开启信息窗口打开时地图自动移动(默认开启)。(自 1.1 新增)
  428 + enableAutoPan: false
  429 + };
  430 +
  431 + var markTypeStr = '';
  432 + if (objStation.stationRouteStationMark == 'B') {
  433 + markTypeStr = '起点站';
  434 + } else if (objStation.stationRouteStationMark == 'Z') {
  435 + markTypeStr = '中途站';
  436 + } else if (objStation.stationRouteStationMark == 'E') {
  437 + markTypeStr = '终点站';
  438 + }
  439 + 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.stationRouteStationName + '</span>' +
  440 + '<span class="help-block" >站点编码:' + objStation.stationStationCod + '</span>' +
  441 + '<span class="help-block" >站点序号:' + objStation.stationRouteStationRouteCode + '</span>' +
  442 + '<span class="help-block" >站点类型:' + markTypeStr + '</span>' +
  443 + '<span class="help-block" >经度:&nbsp&nbsp' + BJwpoints[0] + '</span>' +
  444 + '<span class="help-block" >纬度:&nbsp&nbsp' + BJwpoints[1] + '</span>' +
  445 + '<span class="help-block" >到站时间:' + objStation.stationRouteToTime + '&nbsp;分钟</span>' +
  446 + '<span class="help-block" >到站距离:' + objStation.stationRouteDistances + '&nbsp;公里</span>' +
  447 + '<span class="help-block" >缓冲区形状:' + (shapes != "d" ? "圆形" : "多边形") + '</span>' +
  448 + (shapes == "r" ? ("<span class='help-block' >半径&nbsp&nbsp:" + objStation.stationRadius + "</span>") : " ") +
  449 + '<span class="help-block" >版本号&nbsp&nbsp:' + objStation.stationRouteVersions + '</span>';
  450 +
  451 + // 创建信息窗口
  452 + return new BMap.InfoWindow(htm, opts);
  453 + }
  454 + },
  455 + // 地图画多边形
  456 + pointsPolygon : function(objStation) {
  457 + mapBValue.setZoom(17);
  458 + // 如果不为空
  459 + if(objStation) {
  460 + // 清除地图覆盖物
  461 + mapBValue.clearOverlays();
  462 + // 获取中心点坐标字符串
  463 + var testpointStr = objStation.stationBJwpoints;
  464 + // 按空格切割中心点坐标字符串
  465 + var BJwpointsPolygon = testpointStr.split(' ');
  466 + // 中心点坐标
  467 + var pointPolygon = new BMap.Point(BJwpointsPolygon[0], BJwpointsPolygon[1]);
  468 + // 获取多边形坐标字符串
  469 + var stationBPolygonGrid = objStation.stationBPolygonGrid;
  470 + // 截取多边形坐标字符串
  471 + var stationBPolygonGridStr = stationBPolygonGrid.substring(9,stationBPolygonGrid.length-2);
  472 + // 按逗号切割
  473 + var pointPolygonArray = stationBPolygonGridStr.split(',');
  474 + // 多边形坐标集合
  475 + var polygonP = [];
  476 + for(var v = 0;v<pointPolygonArray.length;v++) {
  477 + polygonP.push(new BMap.Point(pointPolygonArray[v].split(" ")[0],pointPolygonArray[v].split(" ")[1]));
  478 + }
  479 + // 画多边形
  480 + polygon = new BMap.Polygon(polygonP, {
  481 + // 线条显色
  482 + strokeColor : "blue",
  483 + // 边线的宽度,以像素为单位。
  484 + strokeWeight : 2,
  485 + // 边线透明度,取值范围0 - 1。
  486 + strokeOpacity : 0.5
403 487 });
  488 + // 增加地图覆盖物多边形
  489 + mapBValue.addOverlay(polygon);
404 490  
405   - },
406   - /** 在地图上画点 @param:<point_center:中心坐标点> */
407   - drawingUpStationPoint : function(point_center,stationName,s) {
408   -
  491 + // 创建信息窗口
  492 + var infoWindow_target = Bmap.infoWin(objStation);
409 493 // 自定义标注物图片
410   - var icon_target = new BMap.Icon('/pages/base/stationroute/css/img/gjzd.png',new BMap.Size(10, 10));
411   -
412   - var html2 = '<div style="position: absolute; margin: 0pt; padding: 0pt; width: 160px; height: 26px; left: -10px; top: -35px; overflow: hidden;">'
413   - + '<img class="rm3_image" style="border:none;left:0px; top:0px; position:absolute;" src="/pages/base/stationroute/css/img/back160.png">'
414   - + '</div>'
415   - + '<label class=" BMapLabel" unselectable="on" style="position: absolute; -moz-user-select: none; display: inline; cursor: inherit; border: 0px none; padding: 2px 1px 1px; white-space: nowrap; font: 12px arial,simsun; z-index: 80; color: rgb(255, 102, 0); left: 15px; top: -35px;"><span style="float: left; color: #fdfdfd; margin-left: -22px; font-size: 6px;">'+ s+'</span>'+ stationName+'</label>';
416   -
417   -
418   - var myRichMarker1 = new BMapLib.RichMarker(html2, point_center,{
419   - "anchor" : new BMap.Size(-10,8),
420   - "enableDragging" : true});
421   -
422   -
423   - myRichMarker1.disableDragging();
424   - mapBValue.addOverlay(myRichMarker1);
425   -
426   -
427   - // 创建标注物
428   - marker = new BMap.Marker(point_center,{icon : icon_target});
429   -
430   - // 允许覆盖物在map.clearOverlays方法中被清除。
431   - marker.enableMassClear();
432   -
433   - mapBValue.addOverlay(marker);
434   - },
435   -
436   - // 根据站点坐标匹配库中的公交站点
437   - stationsPointsToLibraryPoint : function(arra,callback) {
438   - // 获取长度
439   - var len = arra.length;
440   - var station = {};
441   - var stationList = [];
442   - (function(){
443   - if (!arguments.callee.count) {
444   - arguments.callee.count = 0;
445   - }
446   - arguments.callee.count++;
447   - var index = parseInt(arguments.callee.count) - 1;
448   - if (index >= len) {
449   - callback && callback(stationList);
450   - return ;
451   - }
452   - var f = arguments.callee;
453   - station = arra[index];
454   - if(arra[index].name!=''){
455   -
456   - $.get('/station/matchStation',station,function(resultStation) {
457   - stationList.push({name:resultStation.name ,wgs:arra[index].wgs,potion:{lng:resultStation.potion_lng, lat:resultStation.potion_lat}, isHave:resultStation.isHave , id:resultStation.id});
458   - f();
459   - });
460   - }else {
461   - f();
462   - }
463   - })()
464   - },
465   - // 地图画多边形
466   - pointsPolygon : function(objStation) {
467   -
  494 + var icon_target = new BMap.Icon('/pages/base/stationroute/css/img/cz.png',new BMap.Size(20, 20));
  495 + // 创建点
  496 + marker = new BMap.Marker(pointPolygon,{icon : icon_target});
  497 + // 把标注添物加到地图上
  498 + mapBValue.addOverlay(marker);
  499 + // 将地图的中心点更改为给定的点。
  500 + mapBValue.panTo(pointPolygon);
  501 + //开启信息窗口
  502 + mapBValue.openInfoWindow(infoWindow_target,pointPolygon);
  503 + }
  504 +
  505 + },
  506 +
  507 + // 画圆
  508 + pointsCircle : function(objStation) {
  509 + // 将视图切换到指定的缩放等级,中心点坐标不变。注意:当有信息窗口在地图上打开时,地图缩放将保证信息窗口所在的坐标位置不动。(自1.2新增)
  510 + mapBValue.setZoom(17);
  511 + if(objStation) {
  512 + // 清除地图覆盖物
  513 + mapBValue.clearOverlays();
  514 + // 获取中心坐标点字符串分割
  515 + var BJwpoints = objStation.stationBJwpoints.split(' ');
  516 + // 中心坐标点
  517 + var point = new BMap.Point(BJwpoints[0], BJwpoints[1]);
  518 + //创建圆
  519 + circle = new BMap.Circle(point,objStation.stationRadius,{strokeColor:"blue", strokeWeight:2, strokeOpacity:0.5});
  520 + // 允许覆盖物在map.clearOverlays方法中被清除
  521 + circle.enableMassClear();
  522 + // 百度地图添加覆盖物圆
  523 + mapBValue.addOverlay(circle);
  524 +
  525 + // 创建信息窗口
  526 + var infoWindow_target = Bmap.infoWin(objStation);
  527 + // 自定义标注物图片
  528 + var icon_target = new BMap.Icon('/pages/base/stationroute/css/img/cz.png',new BMap.Size(20, 20));
  529 + // 创建点
  530 + marker = new BMap.Marker(point,{icon : icon_target});
  531 + // 把标注添物加到地图上
  532 + mapBValue.addOverlay(marker);
  533 + setTimeout(function(){
  534 + //开启信息窗口
  535 + marker.openInfoWindow(infoWindow_target,point);
  536 + },100);
  537 + // mapBValue.panBy(PanOptions_);
  538 + // 添加标志物监听事件
  539 + marker.addEventListener("click",function() {
  540 + //开启信息窗口
  541 + marker.openInfoWindow(infoWindow_target,point);
  542 + });
  543 +
  544 + // 将地图的中心点更改为给定的点。
  545 + mapBValue.panTo(point);
  546 + }
  547 + },
  548 + // 编辑图形
  549 + editShapes : function(objStation) {
  550 + // 清空地图
  551 + WorldsBMapLine.clearMarkAndOverlays();
  552 + // 站点对象不为空
  553 + if(objStation) {
  554 + var stationShapesType = objStation.stationShapesType;
468 555 // 将视图切换到指定的缩放等级,中心点坐标不变。注意:当有信息窗口在地图上打开时,地图缩放将保证信息窗口所在的坐标位置不动。(自1.2新增)
469   - mapBValue.setZoom(15);
470   -
471   - // 如果不为空
472   - if(objStation) {
473   -
  556 + mapBValue.setZoom(18);
  557 + // 编辑圆
  558 + if(stationShapesType =='r') {
  559 + // 获取中心坐标点字符串分割
  560 + var BJwpoints = objStation.stationBJwpoints.split(' ');
  561 + // 中心坐标点
  562 + var point = new BMap.Point(BJwpoints[0], BJwpoints[1]);
  563 + //创建圆
  564 + circle = new BMap.Circle(point,objStation.stationRadius,{strokeColor:"blue", strokeWeight:2, strokeOpacity:0.5});
  565 + // 允许覆盖物在map.clearOverlays方法中被清除
  566 + circle.enableMassClear();
  567 + // 百度地图添加覆盖物圆
  568 + mapBValue.addOverlay(circle);
  569 + // 开启编辑功能
  570 + circle.enableEditing();
  571 + // 将地图的中心点更改为给定的点。
  572 + mapBValue.panTo(point);
  573 + // 编辑圆监听事件
  574 + circle.addEventListener('dblclick',function() {
  575 + // 返回圆形的半径,单位为米。
  576 + var newRadius = circle.getRadius();
  577 + // 返回圆形的中心点坐标。
  578 + var newCenter = circle.getCenter().lng + ' ' + circle.getCenter().lat;
  579 + /** 设置修改站点集合对象站点中心点百度坐标属性值 @param:<bJwpoints:中心点百度坐标) */
  580 + objStation.stationBJwpoints = newCenter;
  581 + /** 设置修改站点集合对象范围图形类型属性值 @param:<shapesType:范围图形类型) */
  582 +// objStation.stationBJwpoints = 'r';
  583 + /** 设置修改站点集合对象圆形半径属性值 @param:<radius:圆形半径) */
  584 + objStation.stationRadius = Math.round(newRadius);
  585 + /** 设置修改站点集合对象图形百度坐标集合属性值 @param:<bPolygonGrid:图形百度坐标集合) */
  586 + objStation.stationBPolygonGrid = '';
  587 + // 加载编辑页面
  588 + $.get('editstation.html', function(m){
  589 + $(pjaxContainer).append(m);
  590 + $('#edit_station_mobal').trigger('editSelectMobal_show', [WorldsBMapLine,MapGetAjaxData,PublicFunctions,objStation]);
  591 + });
  592 + // 打开按钮事件
  593 + PublicFunctions.editAChangeCssRemoveDisabled();
  594 + });
  595 + // 编辑多边行
  596 + }else if(stationShapesType =='d') {
474 597 // 清除地图覆盖物
475 598 mapBValue.clearOverlays();
476   -
477 599 // 获取中心点坐标字符串
478 600 var testpointStr = objStation.stationBJwpoints;
479   -
480 601 // 按空格切割中心点坐标字符串
481 602 var BJwpointsPolygon = testpointStr.split(' ');
482   -
483 603 // 中心点坐标
484 604 var pointPolygon = new BMap.Point(BJwpointsPolygon[0], BJwpointsPolygon[1]);
485   -
486 605 // 获取多边形坐标字符串
487 606 var stationBPolygonGrid = objStation.stationBPolygonGrid;
488   -
489 607 // 截取多边形坐标字符串
490 608 var stationBPolygonGridStr = stationBPolygonGrid.substring(9,stationBPolygonGrid.length-2);
491   -
492 609 // 按逗号切割
493 610 var pointPolygonArray = stationBPolygonGridStr.split(',');
494   -
495 611 // 多边形坐标集合
496 612 var polygonP = [];
497   -
498 613 for(var v = 0;v<pointPolygonArray.length;v++) {
499   -
500 614 polygonP.push(new BMap.Point(pointPolygonArray[v].split(" ")[0],pointPolygonArray[v].split(" ")[1]));
501   -
502 615 }
503   -
504 616 // 画多边形
505 617 polygon = new BMap.Polygon(polygonP, {
506   -
507 618 // 线条显色
508   - strokeColor : "blue",
509   -
510   - // 边线的宽度,以像素为单位。
511   - strokeWeight : 2,
512   -
513   - // 边线透明度,取值范围0 - 1。
514   - strokeOpacity : 0.5
515   - });
516   -
  619 + strokeColor : "blue",
  620 + // 边线的宽度,以像素为单位。
  621 + strokeWeight : 2,
  622 + // 边线透明度,取值范围0 - 1。
  623 + strokeOpacity : 0.5
  624 + });
  625 +
517 626 // 增加地图覆盖物多边形
518   - mapBValue.addOverlay(polygon);
519   -
520   - // 信息窗口属性
521   - var opts_polygon = {
522   -
523   - // 信息窗口宽度
524   - width : 200,
525   -
526   - // 信息窗口高度
527   - height : 400,
528   -
529   - // 信息窗位置偏移值。
530   - offset: new BMap.Size(500,20),
531   -
532   - //标题
533   - title : '<h4 style="color:#FFFFFF">'+objStation.stationStationName+'站详情</h4>',
534   -
535   - //设置不允许信窗发送短息
536   - enableMessage : false,
537   -
538   - //是否开启点击地图关闭信息窗口
539   - enableCloseOnClick : false
540   - };
541   -
542   - var markTypeStr = '';
543   -
544   - if(objStation.stationRouteStationMark=='B') {
545   -
546   - markTypeStr='起点站';
547   -
548   - }else if(objStation.stationRouteStationMark=='Z') {
549   -
550   - markTypeStr ='中途站';
551   -
552   -
553   - }else if(objStation.stationRouteStationMark=='E') {
554   -
555   - markTypeStr='终点站';
556   -
557   - }
558   -
559   - var htm = '<HR style="border:1 dashed #987cb9" width="100%" color=#987cb9 SIZE=1>'+
560   - '<span style="color:#DDD;font-size: 15px;">站点名称:' + objStation.stationStationName + '</span>' +
561   - '<span class="help-block" style="color:#DDD;font-size: 15px;">站点编码:' + objStation.stationStationCod + '</span>' +
562   - '<span class="help-block" style="color:#DDD;font-size: 15px;">站点序号:' + objStation.stationRouteStationRouteCode + '</span>' +
563   - '<span class="help-block" style="color:#DDD;font-size: 15px;">站点类型:' + markTypeStr + '</span>' +
564   - '<span class="help-block" style="color:#DDD;font-size: 15px;">纬度坐标:' + objStation.stationBJwpoints + '</span>' +
565   - '<span class="help-block" style="color:#DDD;font-size: 15px;">到站时间:' + objStation.stationRouteToTime + '&nbsp;分钟</span>' +
566   - '<span class="help-block" style="color:#DDD;font-size: 15px;">到站距离:' + objStation.stationRouteDistances + '&nbsp;公里</span>' +
567   - '<span class="help-block" style="color:#DDD;font-size: 15px;">范围半径:' + objStation.stationRadius + '</span>' +
568   - '<span class="help-block" style="color:#DDD;font-size: 15px;">版本号&nbsp&nbsp:' + objStation.stationRouteVersions + '</span>' +
569   - '<span class="help-block" style="width: 100%;font-size: 15px;;color:#DDD;'+
570   - 'overflow: hidden; white-space: nowrap; text-overflow: ellipsis; " title="'+
571   - objStation.stationRouteDescriptions +'" >说明/描述:' + objStation.stationRouteDescriptions + '</span>' ;
572   -
573   - // 创建信息窗口
574   - var infoWindow_target = new BMap.InfoWindow(htm, opts_polygon);
575   - // 自定义标注物图片
576   - var icon_target = new BMap.Icon('/pages/base/stationroute/css/img/cz.png',new BMap.Size(20, 20));
577   -
578   - // 创建点
579   - marker = new BMap.Marker(pointPolygon,{icon : icon_target});
580   -
581   - // 把标注添物加到地图上
582   - mapBValue.addOverlay(marker);
583   -
584   - // 是否在平移过程中禁止动画。(自1.2新增)
585   - var PanOptions_ ={noAnimation :true};
586   -
587   - // 将地图的中心点更改为给定的点。
588   - mapBValue.panTo(pointPolygon,PanOptions_);
589   -
590   - // 将地图在水平位置上移动x像素,垂直位置上移动y像素。
591   - mapBValue.panBy(10,-150,PanOptions_);
592   -
593   - //开启信息窗口
594   - mapBValue.openInfoWindow(infoWindow_target,pointPolygon);
595   -
596   - }
597   -
598   - },
599   -
600   - // 画圆
601   - pointsCircle : function(objStation) {
602   -
603   - // 将视图切换到指定的缩放等级,中心点坐标不变。注意:当有信息窗口在地图上打开时,地图缩放将保证信息窗口所在的坐标位置不动。(自1.2新增)
604   - mapBValue.setZoom(16);
605   -
606   - if(objStation) {
607   -
608   - // 清除地图覆盖物
609   - mapBValue.clearOverlays();
610   -
611   - // 获取中心坐标点字符串分割
612   - var BJwpoints = objStation.stationBJwpoints.split(' ');
613   -
614   - // 中心坐标点
615   - var point = new BMap.Point(BJwpoints[0], BJwpoints[1]);
616   -
617   - //创建圆
618   - circle = new BMap.Circle(point,objStation.stationRadius,{strokeColor:"blue", strokeWeight:2, strokeOpacity:0.5});
619   -
620   - // 允许覆盖物在map.clearOverlays方法中被清除
621   - circle.enableMassClear();
622   -
623   - // 百度地图添加覆盖物圆
624   - mapBValue.addOverlay(circle);
625   -
626   - // 信息窗口参数属性
627   - var opts = {
628   -
629   - // 信息窗口宽度
630   - width : 200,
631   -
632   - // 信息窗口高度
633   - height : 450,
634   -
635   - // 信息窗位置偏移值。
636   - offset: new BMap.Size(500,120),
637   -
638   - //标题
639   - title : '<h4 style="color:#FFFFFF">'+objStation.stationStationName+'站详情</h4>',
640   -
641   - //设置不允许信窗发送短息
642   - enableMessage : false,
643   -
644   - //是否开启点击地图关闭信息窗口
645   - enableCloseOnClick : false,
646   -
647   - // 是否开启信息窗口打开时地图自动移动(默认开启)。(自 1.1 新增)
648   - enableAutoPan:false
649   - };
650   -
651   - var markTypeStr = '';
652   -
653   - if(objStation.stationRouteStationMark=='B') {
654   -
655   - markTypeStr='起点站';
656   -
657   - }else if(objStation.stationRouteStationMark=='Z') {
658   -
659   - markTypeStr ='中途站';
660   -
661   -
662   - }else if(objStation.stationRouteStationMark=='E') {
663   -
664   - markTypeStr='终点站';
665   -
666   - }
667   -
668   - var htm = '<HR style="border:1 dashed #987cb9" width="100%" color=#987cb9 SIZE=1>'+
669   - '<span style="color:#DDD;font-size: 15px;">站点名称:' + objStation.stationStationName + '</span>' +
670   - '<span class="help-block" style="color:#DDD;font-size: 15px;">站点编码:' + objStation.stationStationCod + '</span>' +
671   - '<span class="help-block" style="color:#DDD;font-size: 15px;">站点序号:' + objStation.stationRouteStationRouteCode + '</span>' +
672   - '<span class="help-block" style="color:#DDD;font-size: 15px;">站点类型:' + markTypeStr + '</span>' +
673   - '<span class="help-block" style="color:#DDD;font-size: 15px;">纬度坐标:' + objStation.stationBJwpoints + '</span>' +
674   - '<span class="help-block" style="color:#DDD;font-size: 15px;">到站时间:' + objStation.stationRouteToTime + '&nbsp;分钟</span>' +
675   - '<span class="help-block" style="color:#DDD;font-size: 15px;">到站距离:' + objStation.stationRouteDistances + '&nbsp;公里</span>' +
676   - '<span class="help-block" style="color:#DDD;font-size: 15px;">范围半径:' + objStation.stationRadius + '</span>' +
677   - '<span class="help-block" style="color:#DDD;font-size: 15px;">版本号&nbsp&nbsp:' + objStation.stationRouteVersions + '</span>' +
678   - '<span class="help-block" style="width: 100%;font-size: 15px;;color:#DDD;'+
679   - 'overflow: hidden; white-space: nowrap; text-overflow: ellipsis; " title="'+
680   - objStation.stationRouteDescriptions +'" >说明/描述:' + objStation.stationRouteDescriptions + '</span>' ;
681   -
682   - // 创建信息窗口
683   - var infoWindow_target = new BMap.InfoWindow(htm, opts);
684   - // 自定义标注物图片
685   - var icon_target = new BMap.Icon('/pages/base/stationroute/css/img/cz.png',new BMap.Size(20, 20));
686   -
687   - // 创建点
688   - marker = new BMap.Marker(point,{icon : icon_target});
689   -
690   - // 把标注添物加到地图上
691   - mapBValue.addOverlay(marker);
692   -
693   - setTimeout(function(){
694   - //开启信息窗口
695   - marker.openInfoWindow(infoWindow_target,point);
696   -
697   - },100);
698   -
699   - // 是否在平移过程中禁止动画。(自1.2新增)
700   - var PanOptions_ ={noAnimation :true};
701   -
702   - // 将地图的中心点更改为给定的点。
703   - mapBValue.panTo(point,PanOptions_);
704   -
705   - mapBValue.panBy(10,-200,PanOptions_);
706   -
707   - // 添加标志物监听事件
708   - marker.addEventListener("click",function() {
709   -
710   - //开启信息窗口
711   - marker.openInfoWindow(infoWindow_target,point);
712   -
713   - });
714   -
715   - }
716   -
717   - },
718   - // 编辑图形
719   - editShapes : function(objStation) {
720   -
721   - // 清空地图
722   - WorldsBMapLine.clearMarkAndOverlays();
723   -
724   - // 站点对象不为空
725   - if(objStation) {
726   - var stationShapesType = objStation.stationShapesType;
727   -
728   - // 将视图切换到指定的缩放等级,中心点坐标不变。注意:当有信息窗口在地图上打开时,地图缩放将保证信息窗口所在的坐标位置不动。(自1.2新增)
729   - mapBValue.setZoom(16);
730   -
731   - // 编辑圆
732   - if(stationShapesType =='r') {
733   -
734   - // 获取中心坐标点字符串分割
735   - var BJwpoints = objStation.stationBJwpoints.split(' ');
736   -
737   - // 中心坐标点
738   - var point = new BMap.Point(BJwpoints[0], BJwpoints[1]);
739   -
740   - //创建圆
741   - circle = new BMap.Circle(point,objStation.stationRadius,{strokeColor:"blue", strokeWeight:2, strokeOpacity:0.5});
742   -
743   - // 允许覆盖物在map.clearOverlays方法中被清除
744   - circle.enableMassClear();
745   -
746   - // 百度地图添加覆盖物圆
747   - mapBValue.addOverlay(circle);
748   -
749   - // 开启编辑功能
750   - circle.enableEditing();
751   -
752   - // 是否在平移过程中禁止动画。(自1.2新增)
753   - var PanOptions_ ={noAnimation :true};
754   -
755   - // 将地图的中心点更改为给定的点。
756   - mapBValue.panTo(point,PanOptions_);
757   -
758   - mapBValue.panBy(10,-200,PanOptions_);
759   -
760   - // 编辑圆监听事件
761   - circle.addEventListener('dblclick',function() {
762   -
763   - // 返回圆形的半径,单位为米。
764   - var newRadius = circle.getRadius();
765   -
766   - // 返回圆形的中心点坐标。
767   - var newCenter = circle.getCenter().lng + ' ' + circle.getCenter().lat;
768   -
769   - /** 设置修改站点集合对象站点中心点百度坐标属性值 @param:<bJwpoints:中心点百度坐标) */
770   - objStation.stationBJwpoints = newCenter;
771   -
772   - /** 设置修改站点集合对象范围图形类型属性值 @param:<shapesType:范围图形类型) */
773   -// objStation.stationBJwpoints = 'r';
774   -
775   - /** 设置修改站点集合对象圆形半径属性值 @param:<radius:圆形半径) */
776   - objStation.stationRadius = Math.round(newRadius);
777   -
778   - /** 设置修改站点集合对象图形百度坐标集合属性值 @param:<bPolygonGrid:图形百度坐标集合) */
779   - objStation.stationBPolygonGrid = '';
780   -
781   - // 加载编辑页面
782   - $.get('editstation.html', function(m){
783   -
784   - $(pjaxContainer).append(m);
785   -
786   - $('#edit_station_mobal').trigger('editSelectMobal_show', [WorldsBMapLine,MapGetAjaxData,PublicFunctions,objStation]);
787   -
788   - });
789   -
790   - // 打开按钮事件
791   - PublicFunctions.editAChangeCssRemoveDisabled();
792   - });
793   -
794   - // 编辑多边行
795   - }else if(stationShapesType =='d') {
796   -
797   - // 清除地图覆盖物
798   - mapBValue.clearOverlays();
799   -
800   - // 获取中心点坐标字符串
801   - var testpointStr = objStation.stationBJwpoints;
802   -
803   - // 按空格切割中心点坐标字符串
804   - var BJwpointsPolygon = testpointStr.split(' ');
805   -
806   - // 中心点坐标
807   - var pointPolygon = new BMap.Point(BJwpointsPolygon[0], BJwpointsPolygon[1]);
808   -
809   - // 获取多边形坐标字符串
810   - var stationBPolygonGrid = objStation.stationBPolygonGrid;
811   -
812   - // 截取多边形坐标字符串
813   - var stationBPolygonGridStr = stationBPolygonGrid.substring(9,stationBPolygonGrid.length-2);
814   -
815   - // 按逗号切割
816   - var pointPolygonArray = stationBPolygonGridStr.split(',');
817   -
818   - // 多边形坐标集合
819   - var polygonP = [];
820   -
821   - for(var v = 0;v<pointPolygonArray.length;v++) {
822   -
823   - polygonP.push(new BMap.Point(pointPolygonArray[v].split(" ")[0],pointPolygonArray[v].split(" ")[1]));
824   -
825   - }
826   -
827   - // 画多边形
828   - polygon = new BMap.Polygon(polygonP, {
829   -
830   - // 线条显色
831   - strokeColor : "blue",
832   -
833   - // 边线的宽度,以像素为单位。
834   - strokeWeight : 2,
835   -
836   - // 边线透明度,取值范围0 - 1。
837   - strokeOpacity : 0.5
838   - });
839   -
840   - // 增加地图覆盖物多边形
841   - mapBValue.addOverlay(polygon);
842   -
843   - // 开启编辑功能(自 1.1 新增)
844   - polygon.enableEditing();
845   -
846   - // 是否在平移过程中禁止动画。(自1.2新增)
847   - var PanOptions_ ={noAnimation :true};
848   -
849   - // 将地图的中心点更改为给定的点。
850   - mapBValue.panTo(pointPolygon,PanOptions_);
851   -
852   - // 将地图在水平位置上移动x像素,垂直位置上移动y像素。
853   - mapBValue.panBy(10,-150,PanOptions_);
854   -
855   - // 添加多变行编辑事件
856   - polygon.addEventListener('dblclick',function(e) {
857   -
858   - // 获取编辑的多边形对象
859   - var edit_pointE = polygon;
860   -
861   - var edit_bPloygonGrid = "";
862   -
863   - var editPolyGonLen_ = edit_pointE.getPath().length;
864   -
865   - for(var k =0;k<editPolyGonLen_;k++) {
866   -
867   - if(k==0) {
868   -
869   - edit_bPloygonGrid = edit_pointE.getPath()[k].lng + ' ' + edit_pointE.getPath()[k].lat;
870   -
871   - }else {
872   -
873   - edit_bPloygonGrid = edit_bPloygonGrid + ',' + edit_pointE.getPath()[k].lng + ' ' + edit_pointE.getPath()[k].lat;
874   -
875   - }
876   -
  627 + mapBValue.addOverlay(polygon);
  628 + // 开启编辑功能(自 1.1 新增)
  629 + polygon.enableEditing();
  630 + // 将地图的中心点更改为给定的点。
  631 + mapBValue.panTo(pointPolygon);
  632 +
  633 + // 添加多变行编辑事件
  634 + polygon.addEventListener('dblclick',function(e) {
  635 + // 获取编辑的多边形对象
  636 + var edit_pointE = polygon;
  637 + var edit_bPloygonGrid = "";
  638 + var editPolyGonLen_ = edit_pointE.getPath().length;
  639 + for(var k =0;k<editPolyGonLen_;k++) {
  640 + if(k==0) {
  641 + edit_bPloygonGrid = edit_pointE.getPath()[k].lng + ' ' + edit_pointE.getPath()[k].lat;
  642 + }else {
  643 + edit_bPloygonGrid = edit_bPloygonGrid + ',' + edit_pointE.getPath()[k].lng + ' ' + edit_pointE.getPath()[k].lat;
877 644 }
878   -
879   - edit_bPloygonGrid = edit_bPloygonGrid + ',' + edit_pointE.getPath()[0].lng + ' ' + edit_pointE.getPath()[0].lat;
880   -
881   - // 多边形中心点
882   - var centre_points = edit_pointE.getBounds().getCenter().lng + ' ' + edit_pointE.getBounds().getCenter().lat;
883   -
884   - /** 设置修改站点集合对象站点中心点百度坐标属性值 @param:<bJwpoints:中心点百度坐标) */
885   - objStation.stationBJwpoints = centre_points;
886   -
887   - /** 设置修改站点集合对象范围图形类型属性值 @param:<shapesType:范围图形类型) */
888   - objStation.stationShapesType = 'd';;
889   -
890   - /** 设置修改站点集合对象圆形半径属性值 @param:<radius:圆形半径) */
891   - objStation.stationRadius = '';
892   -
893   - /** 设置修改站点集合对象图形百度坐标集合属性值 @param:<bPolygonGrid:图形百度坐标集合) */
894   - objStation.stationBPolygonGrid = edit_bPloygonGrid;
895   -
896   - $.get('editstation.html', function(m){
897   -
898   - $(pjaxContainer).append(m);
899   -
900   - $('#edit_station_mobal').trigger('editSelectMobal_show', [WorldsBMapLine,MapGetAjaxData,PublicFunctions,objStation]);
901   -
902   - });
903   -
904   - // 打开按钮事件
905   - PublicFunctions.editAChangeCssRemoveDisabled();
906   - });
907   -
908   - }
  645 + }
  646 + edit_bPloygonGrid = edit_bPloygonGrid + ',' + edit_pointE.getPath()[0].lng + ' ' + edit_pointE.getPath()[0].lat;
  647 + // 多边形中心点
  648 + var centre_points = edit_pointE.getBounds().getCenter().lng + ' ' + edit_pointE.getBounds().getCenter().lat;
  649 + /** 设置修改站点集合对象站点中心点百度坐标属性值 @param:<bJwpoints:中心点百度坐标) */
  650 + objStation.stationBJwpoints = centre_points;
  651 + /** 设置修改站点集合对象范围图形类型属性值 @param:<shapesType:范围图形类型) */
  652 + objStation.stationShapesType = 'd';;
  653 + /** 设置修改站点集合对象圆形半径属性值 @param:<radius:圆形半径) */
  654 + objStation.stationRadius = '';
  655 + /** 设置修改站点集合对象图形百度坐标集合属性值 @param:<bPolygonGrid:图形百度坐标集合) */
  656 + objStation.stationBPolygonGrid = edit_bPloygonGrid;
  657 +
  658 + $.get('editstation.html', function(m){
  659 + $(pjaxContainer).append(m);
  660 + $('#edit_station_mobal').trigger('editSelectMobal_show', [WorldsBMapLine,MapGetAjaxData,PublicFunctions,objStation]);
  661 + });
  662 +
  663 + // 打开按钮事件
  664 + PublicFunctions.editAChangeCssRemoveDisabled();
  665 + });
909 666 }
910   - },
911   -
912   - localtionPoint : function(stationNameV) {
913   -
914   - WorldsBMapLine.localSearchFromAdreesToPoint(stationNameV,function(Points) {
915   -
916   - if(Points) {
917   -
918   - var BJwpointsArray = Points.split(' ');
919   -
920   - var stationNameChangePoint = new BMap.Point(BJwpointsArray[0], BJwpointsArray[1]);
921   -
922   - var marker_stargt2 = new BMap.Marker(stationNameChangePoint);
923   -
924   - var PanOptions ={noAnimation :true};
925   -
926   - mapBValue.panTo(stationNameChangePoint,PanOptions);
927   -
928   - mapBValue.panBy(0,-100);
929   -
930   - // 将标注添加到地图中
931   - mapBValue.addOverlay(marker_stargt2);
932   -
933   - //跳动的动画
934   - marker_stargt2.setAnimation(BMAP_ANIMATION_BOUNCE);
935   -
936   - }
937   -
938   - });
939   -
940   - },
941   -
942   - // 根据地理名称获取百度经纬度坐标
943   - localSearchFromAdreesToPoint: function(Address,callback) {
944   -
945   - // 创建一个搜索类实例
946   - var localSearch = new BMap.LocalSearch(mapBValue);
947   -
948   - // 检索完成后的回调函数。
949   - localSearch.setSearchCompleteCallback(function (searchResult) {
950   -
951   - var resultPoints = '';
952   -
953   - if(searchResult) {
954   -
955   - // 返回索引指定的结果。索引0表示第1条结果
956   - var poi = searchResult.getPoi(0);
957   -
958   - if(poi) {
959   -
960   - //获取经度和纬度
961   - resultPoints = poi.point.lng + ' ' + poi.point.lat;
962   -
963   - callback && callback(resultPoints);
964   -
965   - }else {
966   -
967   - callback && callback(false);
968   -
969   - }
970   -
  667 + }
  668 + },
  669 +
  670 + localtionPoint : function(stationNameV) {
  671 + WorldsBMapLine.localSearchFromAdreesToPoint(stationNameV,function(Points) {
  672 + if(Points) {
  673 + var BJwpointsArray = Points.split(' ');
  674 + var stationNameChangePoint = new BMap.Point(BJwpointsArray[0], BJwpointsArray[1]);
  675 + var marker_stargt2 = new BMap.Marker(stationNameChangePoint);
  676 + var PanOptions ={noAnimation :true};
  677 + mapBValue.panTo(stationNameChangePoint,PanOptions);
  678 + mapBValue.panBy(0,-100);
  679 + // 将标注添加到地图中
  680 + mapBValue.addOverlay(marker_stargt2);
  681 + //跳动的动画
  682 + marker_stargt2.setAnimation(BMAP_ANIMATION_BOUNCE);
  683 + }
  684 + });
  685 + },
  686 +
  687 + // 根据地理名称获取百度经纬度坐标
  688 + localSearchFromAdreesToPoint: function(Address,callback) {
  689 + // 创建一个搜索类实例
  690 + var localSearch = new BMap.LocalSearch(mapBValue);
  691 + // 检索完成后的回调函数。
  692 + localSearch.setSearchCompleteCallback(function (searchResult) {
  693 + var resultPoints = '';
  694 + if(searchResult) {
  695 + // 返回索引指定的结果。索引0表示第1条结果
  696 + var poi = searchResult.getPoi(0);
  697 + if(poi) {
  698 + //获取经度和纬度
  699 + resultPoints = poi.point.lng + ' ' + poi.point.lat;
  700 + callback && callback(resultPoints);
971 701 }else {
972   -
973 702 callback && callback(false);
974 703 }
975   -
976   - });
977   -
978   - // 根据检索词发起检索。
979   - localSearch.search(Address);
980   -
981   - },
982   -
983   - clearMarkAndOverlays : function() {
984   -
985   - // 清楚地图覆盖物
986   - mapBValue.clearOverlays();
987   -
988   - mapBValue.removeOverlay();
989   -
990   - }
991   -
992   - }
993   -
  704 + }else {
  705 +
  706 + callback && callback(false);
  707 + }
  708 + });
  709 +
  710 + // 根据检索词发起检索。
  711 + localSearch.search(Address);
  712 +
  713 + },
  714 + strGetLength: function (str) {
  715 + return str.replace(/[\u0391-\uFFE5]/g, "aa").length; //先把中文替换成两个字节的英文,在计算长度
  716 + },
  717 + clearMarkAndOverlays : function() {
  718 + // 清楚地图覆盖物
  719 + mapBValue.clearOverlays();
  720 + mapBValue.removeOverlay();
  721 + }
  722 + };
  723 +
994 724 return Bmap;
995   -
996 725 }();
997 726 \ No newline at end of file
... ...
src/main/resources/static/pages/base/line/list.html
... ... @@ -298,7 +298,7 @@
298 298 </td>
299 299 <td>
300 300 <a href="/pages/base/stationroute/list.html?no={{obj.id}}" class="btn default blue-stripe btn-sm" data-pjax> 查看</a>
301   - <!--<a href="javascript:window.localStorage.setItem('geo_data_edit_line_code' , '{{obj.lineCode}}');window.localStorage.removeItem('geo_data_edit_line_version');window.location.href='/pages/base/geo_data_edit/uk3_wrap.html';" class="btn default blue-stripe btn-sm" data-pjax> 查看 </a>-->
  301 + <a href="javascript:window.localStorage.setItem('geo_data_edit_line_code' , '{{obj.lineCode}}');window.localStorage.removeItem('geo_data_edit_line_version');window.location.href='/pages/base/geo_data_edit/uk3_wrap.html';" class="btn default blue-stripe btn-sm" data-pjax> 查看 </a>
302 302 </td>
303 303 <td>
304 304 <a href="details.html?no={{obj.id}}" class="btn default blue-stripe btn-sm" data-pjax> 详细 </a>
... ...
src/main/resources/static/pages/base/line/map.html
... ... @@ -63,7 +63,7 @@
63 63 </div>
64 64 </div>
65 65 <!-- 引用当前版本路段div -->
66   - <div id="citeSection">
  66 + <!--<div id="citeSection">
67 67 <div class="defeat-scroll"
68 68 style="height: 400px; overflow-y: auto; ">
69 69 </div>
... ... @@ -72,7 +72,7 @@
72 72 <a class="btn btn-circle blue" id="addSection">添加路段</a>
73 73 <a class="btn btn-circle blue" id="submitOptions">提交选项</a>
74 74 </div>
75   - </div>
  75 + </div>-->
76 76 </div>
77 77 <div id="station_list_div" class="hidden">
78 78 <div class="defeat-scroll"
... ... @@ -96,7 +96,7 @@
96 96 {{obj.name}}
97 97 </td>
98 98 {{/each}}
99   - {{if list.length == 0}}
  99 + {{if list.length < 0}}
100 100 <tr>
101 101 <td colspan=13><h6 class="muted">沒有相关数据</h6></td>
102 102 </tr>
... ... @@ -115,6 +115,38 @@ $(function(){
115 115 var stationRouteMap = new Map();
116 116 // 路段Map
117 117 var sectionRouteMap = new Map();
  118 +
  119 + var upIs = false,downIs = false;
  120 + // 查询上行路段信息
  121 + $get('/sectionroute/findCacheSection',{'lineId':id, 'dir':0},function(data) {
  122 + if(data.length>0){upIs = true;}
  123 + });
  124 + // 查询下行路段信息
  125 + $get('/sectionroute/findCacheSection',{'lineId':id, 'dir':1},function(data) {
  126 + if(data.length>0){downIs = true;}
  127 + });
  128 + // 刷新页面初始化数据
  129 + var refreshPage = function (lineId,dir){
  130 + // 清除地图覆盖物
  131 + WorldsBMapLine.clearMarkAndOverlays();
  132 + var params = {};
  133 + params.lineId = lineId;
  134 + params.dir = dir;
  135 + // 查询路段信息
  136 + $get('/sectionroute/findCacheSection',params,function(data) {
  137 + // 在地图上画出线路走向
  138 + PublicFunctions.linePanlThree(lineId,data,dir);
  139 + });
  140 + $('#route_show').removeClass('hidden');
  141 + $('#generationRoute_div').addClass('hidden');
  142 + EditRoute.setLineId(id);
  143 + EditRoute.setLineDir(dir);
  144 + // 刷新路段列表
  145 + $('#section').click();
  146 + layer.open({title: '友情提示'
  147 + ,content: '生成路线成功,生成的线路可能会有误差。请先单击路段,拖动编辑、然后双击保存!'});
  148 + };
  149 +
118 150 // 如果线路ID不为空
119 151 if(id) {
120 152 var styleOptions = {
... ... @@ -137,9 +169,33 @@ $(function(){
137 169  
138 170 /** 初始化绘图工具类 @param:<map_:map对象;styleOptions:绘图样式对象> @return:DrawingManager对象 */
139 171 DrawingManagerObj.init(map_,styleOptions);
140   -
141   - layer.msg('请生成路线!!!');
142   -
  172 + if(upIs || downIs){
  173 + var index = layer.confirm('回到上次上传修改的路线?', {
  174 + btn: ['上行','下行',"重新生成"], //按钮
  175 + time: 0, //不自动关闭
  176 + // shade: false //不显示遮罩
  177 + btn1 : function(){
  178 + if(upIs){
  179 + refreshPage(id,0);
  180 + layer.close(index);
  181 + } else {
  182 + layer.msg('没有上行记录,请刷新后选择下行!!!');
  183 + }
  184 + },btn2 : function(){
  185 + if(downIs){
  186 + refreshPage(id,1);
  187 + layer.close(index);
  188 + } else {
  189 + layer.msg('没有下行记录,请刷新后选择上行!!!');
  190 + }
  191 + },btn3 : function(){
  192 + //关闭提示框
  193 + // layer.close(index);
  194 + $("#generationRoute").click();
  195 + // layer.msg('请生成路线!!!');
  196 + }});
  197 + } else
  198 + layer.msg('请生成路线!!!');
143 199 },500);
144 200 }else {
145 201  
... ... @@ -258,7 +314,7 @@ $(function(){
258 314 params.dir = line.dir;
259 315 // 查询路段信息
260 316 $get('/sectionroute/findCacheSection',params,function(data) {
261   - var section_radio_html = '<div id="section_radio">';
  317 + /*var section_radio_html = '<div id="section_radio">';
262 318 var cont = 1;
263 319 var check = 'checked="checked"';
264 320 $.each(data,function(){
... ... @@ -267,7 +323,7 @@ $(function(){
267 323 cont++;
268 324 });
269 325 section_radio_html += '</div>';
270   - $("#section_list_div #citeSection .defeat-scroll").html(section_radio_html);
  326 + $("#section_list_div #citeSection .defeat-scroll").html(section_radio_html);*/
271 327 // 在地图上画出线路走向
272 328 PublicFunctions.linePanlThree(line.id,data,line.dir);
273 329 });
... ... @@ -332,7 +388,7 @@ $(function(){
332 388 var shapesType = stationRoute.stationShapesType;
333 389 // 如果是圆
334 390 if(shapesType =='r') {
335   -
  391 +
336 392 // 百度地图画圆
337 393 WorldsBMapLine.pointsCircle(stationRoute);
338 394  
... ...
src/main/resources/static/pages/base/lineinformation/js/lineinformation-add-form.js
... ... @@ -202,16 +202,16 @@ $(function(){
202 202 $("#submintBtn").addClass("disabled");
203 203  
204 204 if (params.line) {
205   -
  205 +
  206 + var layerLoad = layer.load();
206 207 // 添加数据
207 208 $post('/lineInformation', params, function(result) {
208   -
  209 +
209 210 // 如果返回结果不为空
210 211 if(result){
211   -
  212 + layer.close(layerLoad);
212 213 // 返回状态码为"SUCCESS" ,则添加成功;返回状态码为"ERROR" ,则添加失败
213 214 if(result.status=='SUCCESS') {
214   -
215 215 // 弹出添加成功提示消息
216 216 layer.msg('添加成功...');
217 217  
... ...
src/main/resources/static/pages/base/sectionspeed/js/function.js
... ... @@ -109,8 +109,7 @@ var PublicFunctions = function () {
109 109  
110 110 // 中心点坐标字符串
111 111 var bJwpointsStr = resultdata[s].bJwpoints;
112   -
113   - var stationName = resultdata[s].stationName;
  112 + var stationName = resultdata[s].stationRouteName;
114 113  
115 114 // 起个中心点坐标字符串
116 115 var bJwpointsArray = bJwpointsStr.split(' ');
... ...
src/main/resources/static/pages/base/station/css/addmap.css
... ... @@ -28,7 +28,7 @@
28 28 display: none;
29 29 }
30 30  
31   -.BMap_pop div:nth-child(1) ,
  31 +/*.BMap_pop div:nth-child(1) ,
32 32 .BMap_pop div:nth-child(2) ,
33 33 .BMap_pop div:nth-child(3) ,
34 34 .BMap_pop div:nth-child(4) ,
... ... @@ -61,17 +61,18 @@
61 61  
62 62 }
63 63  
64   -/* 图片以后在弄,先隐藏div */
  64 +!* 图片以后在弄,先隐藏div *!
65 65 .BMap_pop div:nth-child(8) {
66 66  
67 67 height:0px !important;
68   - /* background:url('/pages/base/stationroute/css/img/iw3-1.png') no-repeat !important; */
69   - /* background-image:url('/pages/base/stationroute/css/img/windowinfo_b.jpg') !important; */
  68 + !* background:url('/pages/base/stationroute/css/img/iw3-1.png') no-repeat !important; *!
  69 + !* background-image:url('/pages/base/stationroute/css/img/windowinfo_b.jpg') !important; *!
70 70  
71   -}
  71 +}*/
72 72  
  73 +/*
73 74 .BMap_pop {
74 75  
75 76 box-shadow: 0 12px 15px 0 rgba(204, 204, 204, 0.33),0 17px 50px 0 rgba(204, 204, 204, 0.33)!important;
76 77  
77   -}
78 78 \ No newline at end of file
  79 +}*/
... ...
src/main/resources/static/pages/base/station/css/positions.css
1 1 #positionBmap_basic{
2 2 min-width: 100%;
3   - width: calc(100% + 26px);
4   - margin-top: -28px;
5   - border: 2px solid #fdfdfd;
6   - min-height: 1200px;
  3 + margin-top: -10px;
7 4 height:100%;
8   - overflow: hidden;
  5 +}
  6 +.mian-portlet-body{
  7 + height: 100%;
9 8 }
10 9  
11 10 html,body{
12 11 overflow:hidden;
  12 + height: calc(100% - 10px);
13 13 }
14 14  
15 15 /* 隐藏百度地图logo */
... ... @@ -23,58 +23,19 @@ html,body{
23 23  
24 24 .leftUtils{
25 25 position: absolute;
26   - padding-right: 100px;
  26 + padding-right: 50px;
  27 + top: 50px;
27 28 width: 100%;
28 29 height: 40px;
29 30 z-index: 9999;
30   - padding-top: 7px;
31   - top: 20px;
32   -}
33   -
34   -.BMap_pop div:nth-child(1) ,
35   -.BMap_pop div:nth-child(2) ,
36   -.BMap_pop div:nth-child(3) ,
37   -.BMap_pop div:nth-child(4) ,
38   -.BMap_pop div:nth-child(5) ,
39   -.BMap_pop div:nth-child(6) ,
40   -.BMap_pop div:nth-child(7) {
41   -
42   - border:0px solid rgb(255, 255, 255) !important;
43   - background-color:#3B3F51 !important;
44   -
45   -}
46   -
47   -.BMap_pop div:nth-child(3){
48   -
49   - width:23px !important;
50   -
51   -}
52   -
53   -.BMap_pop div:nth-child(7) {
54   -
55   - width:23px !important;
56   -
57   - height:24px !important;
58   -
59   -}
60   -
61   -.BMap_pop div:nth-child(5) {
62   -
63   - height:24px !important;
64   -
  31 + /*padding-top: 7px;*/
65 32 }
66 33  
67   -/* 图片以后在弄,先隐藏div */
68   -.BMap_pop div:nth-child(8) {
69   -
70   - height:0px !important;
71   - /* background:url('/pages/base/stationroute/css/img/iw3-1.png') no-repeat !important; */
72   - /* background-image:url('/pages/base/stationroute/css/img/windowinfo_b.jpg') !important; */
73   -
  34 +.help-block{
  35 + color:#000;
  36 + font-size: 15px;
74 37 }
75   -
76 38 .BMap_pop {
77   -
78 39 box-shadow: 0 12px 15px 0 rgba(204, 204, 204, 0.33),0 17px 50px 0 rgba(204, 204, 204, 0.33)!important;
79   -
  40 +
80 41 }
81 42 \ No newline at end of file
... ...
src/main/resources/static/pages/base/station/edit_select.html
... ... @@ -18,13 +18,6 @@
18 18 <button class="close" data-close="alert"></button>
19 19 站点名称为必填项
20 20 </div>
21   - <!-- 站点名称容器 -->
22   - <div class="form-group" id="formRequ">
23   - <label class="col-md-3 control-label"><span class="required"> * </span>站点名称:</label>
24   - <div class="col-md-9" id="errorInfo">
25   - <input type="text" class="form-control input-medium" id="stationNamebootboxInput" name="stationNamebootbox" readonly="readonly">
26   - </div>
27   - </div>
28 21 <!-- 修改方式容器 -->
29 22 <div class="form-group">
30 23 <label class="col-md-3 control-label"><span class="required"> * </span>修改方式:</label>
... ... @@ -96,8 +89,6 @@ $(&#39;#editPositions_select_mobal&#39;).on(&#39;editSelectMobal_show&#39;, function(e, map,drm,
96 89 $('.tipso-animation').tipso('show');
97 90 setTimeout(function(){$('.tipso-animation').tipso('hide');},4000);
98 91 },500);
99   - // 获取站点名称元素并赋值
100   - $('#stationNamebootboxInput').val(EditStation.zdmc);
101 92 // 定义站点图形类型
102 93 var stationShapesTypeV = EditStation.stationShapesType;
103 94 // 获取表单元素
... ... @@ -115,7 +106,7 @@ $(&#39;#editPositions_select_mobal&#39;).on(&#39;editSelectMobal_show&#39;, function(e, map,drm,
115 106 errorClass : 'help-block help-block-error',
116 107 focusInvalid : false,
117 108 rules : {
118   - 'stationNamebootbox' : {required : true,maxlength : 50}// 站点名称 必填项 最大长度50
  109 + 'editselect' : {required : true}
119 110 },
120 111 invalidHandler : function(event, validator) {
121 112 editSelectrequired.show();
... ... @@ -137,18 +128,12 @@ $(&#39;#editPositions_select_mobal&#39;).on(&#39;editSelectMobal_show&#39;, function(e, map,drm,
137 128 $('#eidt').addClass('btn disabled');
138 129 // 表单序列
139 130 var params = form.serializeJSON();
140   - // 站点名称
141   - var editStationName = params.stationNamebootbox;
142   - // 设置站点名称
143   - statn.setEitdStationName(editStationName);
144 131 var eidtselect_ = params.editselect;
145 132 if(eidtselect_==0){
146 133 // 清除地图覆盖物
147 134 map.clearMarkAndOverlays();
148 135 // 打开绘制工具
149 136 drm.openDrawingManager();
150   - // 根据站点位置在地图定位
151   - map.localtionPoint(editStationName);
152 137 }else if(eidtselect_==1){
153 138 // 弹出添加失败提示消息,2秒关闭(如果不配置,默认是3秒)
154 139 var mindex = layer.msg('编辑完图形后,请双击图形区域保存',{ offset: '126px',
... ...
src/main/resources/static/pages/base/station/js/station-list-edit.js
... ... @@ -16,7 +16,10 @@
16 16 $('#lineNameInput').val(no[1]);
17 17 // 获取站点对象信息
18 18 var editStation = {};
19   - $.ajax({
  19 + PositionsPublicFunctions.getStationRouteInfo(id, function (data) {
  20 + editStation = data[0];
  21 + });
  22 + /*$.ajax({
20 23 url: "/stationroute/findStationRouteInfo", //请求地址
21 24 type: "Get",
22 25 async:false,
... ... @@ -25,7 +28,7 @@
25 28 success: function (result) {
26 29 editStation = result[0];
27 30 }
28   - });
  31 + });*/
29 32 setTimeout(function(){
30 33 // 初始化表单值
31 34 PositionsPublicFunctions.setListEditFrom(editStation);
... ... @@ -57,8 +60,8 @@
57 60 'radius' : {number : true},// 圆形半径 必填项
58 61 'destroy' : {required : true},// 是否撤销 必填项
59 62 'toTime' : {number : true},// 到站时间 必须输入合法的数字(负数,小数)。
60   - 'distances' : {number : true},// 到站距离 // 到站距离
61   - 'descriptions' : {maxlength: 150}// 描述与说明 最大长度
  63 + 'distances' : {number : true}// 到站距离 // 到站距离
  64 + // 'descriptions' : {maxlength: 150}// 描述与说明 最大长度
62 65 },
63 66 invalidHandler : function(event, validator) {
64 67 error.show();
... ...
src/main/resources/static/pages/base/station/js/station-list-table.js
... ... @@ -69,7 +69,7 @@
69 69 },200);
70 70 }
71 71  
72   - function getlineSectionRoute(params,cb) {
  72 + function getlineStstionRoute(params,cb) {
73 73 $get('/stationroute/all',params, function(array){
74 74 return cb && cb(array);
75 75 });
... ... @@ -88,7 +88,7 @@
88 88 return ;
89 89 }
90 90 params.directions_eq = dirInfo;
91   - getlineSectionRoute(params,function(stationD) {
  91 + getlineStstionRoute(params,function(stationD) {
92 92 var sLen = stationD.length,initSD = new Array();
93 93 if(sLen>0) {
94 94 $.each(stationD, function(m, n){
... ...
src/main/resources/static/pages/base/station/js/station-positions-function.js
... ... @@ -4,254 +4,249 @@
4 4  
5 5 var PositionsPublicFunctions = function () {
6 6  
7   - var PubFun = {
8   - initStationInfo : function(id) {
9   - PositionsPublicFunctions.getStationRouteInfo(id,function(r) {
10   - StationPositionsWorldsBMap.clearMarkAndOverlays();
11   - var Station = r[0];
12   - PositionsStationObj.setAddStation(Station);
13   - var len = r.length;
14   - if(len>0) {
15   - var markTypeStr = '';
16   - if(r[0].stationRouteStationMark=='B') {
17   - markTypeStr='起点站';
18   - }else if(r[0].stationRouteStationMark=='Z') {
19   - markTypeStr ='中途站';
20   - }else if(r[0].stationRouteStationMark=='E') {
21   - markTypeStr='终点站';
22   - }
23   - var stationShapesType = r[0].stationShapesType;
24   - // 获取中心坐标点字符串分割
25   - var BJwpoints = r[0].stationJwpoints.split(' ');
26   - // 中心坐标点
27   - var point = new BMap.Point(BJwpoints[0], BJwpoints[1]);
28   - var htm = '<HR style="border:1 dashed #987cb9" width="100%" color=#987cb9 SIZE=1>'+
29   - '<span style="color:#DDD;font-size: 15px;">站点名称:' + r[0].zdmc + '</span>' +
30   - '<span class="help-block" style="color:#DDD;font-size: 15px;">站点编码:' + r[0].stationCode + '</span>' +
31   - '<span class="help-block" style="color:#DDD;font-size: 15px;">站点序号:' + r[0].stationRouteCode + '</span>' +
32   - '<span class="help-block" style="color:#DDD;font-size: 15px;">站点类型:' + markTypeStr + '</span>' +
33   - '<span class="help-block" style="color:#DDD;font-size: 15px;">纬度坐标:' + r[0].stationJwpoints + '</span>' +
34   - '<span class="help-block" style="color:#DDD;font-size: 15px;">到站时间:' + r[0].stationRouteToTime + '&nbsp;分钟</span>' +
35   - '<span class="help-block" style="color:#DDD;font-size: 15px;">到站距离:' + r[0].stationRouteDistances + '&nbsp;公里</span>' +
36   - '<span class="help-block" style="color:#DDD;font-size: 15px;">范围半径:' + r[0].stationRadius + '</span>' +
37   - '<span class="help-block" style="color:#DDD;font-size: 15px;">版本 号:' + r[0].stationRouteVersions + '</span>' +
38   - '<span class="help-block" style="width: 100%;font-size: 15px;;color:#DDD;'+
39   - 'overflow: hidden; white-space: nowrap; text-overflow: ellipsis; " title="'+
40   - r[0].stationRouteDescriptions +'" >说明/描述:' + r[0].stationRouteDescriptions + '</span>' ;
41   - // 信息窗口参数属性
42   - var opts = {
43   - // 信息窗口宽度
44   - width : 200,
45   - // 信息窗口高度
46   - height : 450,
47   - // 信息窗位置偏移值。
48   - offset: new BMap.Size(500,80),
49   - //标题
50   - title : '<h4 style="color:#FFFFFF">'+r[0].zdmc+'站详情</h4>',
51   - //设置不允许信窗发送短息
52   - enableMessage : false,
53   - //是否开启点击地图关闭信息窗口
54   - enableCloseOnClick : false,
55   - // 是否开启信息窗口打开时地图自动移动(默认开启)。(自 1.1 新增)
56   - enableAutoPan:true
57   - };
58   - if(stationShapesType == 'r') {
59   - // 画圆
60   - StationPositionsWorldsBMap.pointsCircle(r,point,htm,opts);
61   - }else if(stationShapesType == 'd'){
62   - // 画多边形
63   - StationPositionsWorldsBMap.pointsPolygon(r,point,htm,opts);
64   - }
  7 +var PubFun = {
  8 + initStationInfo : function(id) {
  9 + PositionsPublicFunctions.getStationRouteInfo(id,function(r) {
  10 + StationPositionsWorldsBMap.clearMarkAndOverlays();
  11 + var Station = r[0];
  12 + PositionsStationObj.setAddStation(Station);
  13 + var len = r.length;
  14 + if(len>0) {
  15 + // 站点形状
  16 + var shapes = r[0].stationShapesType;
  17 + // 获取中心坐标点字符串分割
  18 + var BJwpoints = r[0].stationJwpoints.split(' ');
  19 + // 中心坐标点
  20 + var point = new BMap.Point(BJwpoints[0], BJwpoints[1]);
  21 + var width = PubFun.strGetLength(r[0].stationRouteName) * 11;
  22 + // 信息窗口参数属性
  23 + var opts = {
  24 + // 信息窗口宽度
  25 + width: (width < 240 ? 240 : width),
  26 + // 信息窗口高度
  27 + height: shapes=="r" ?300:270,
  28 + // 信息窗位置偏移值。
  29 + // offset: new BMap.Size(10,-20),
  30 + //设置不允许信窗发送短息
  31 + enableMessage: false,
  32 + //是否开启点击地图关闭信息窗口
  33 + enableCloseOnClick: false,
  34 + // 是否开启信息窗口打开时地图自动移动(默认开启)。(自 1.1 新增)
  35 + enableAutoPan: false
  36 + };
  37 +
  38 + var markTypeStr = '';
  39 + if (r[0].stationRouteStationMark == 'B') {
  40 + markTypeStr = '起点站';
  41 + } else if (r[0].stationRouteStationMark == 'Z') {
  42 + markTypeStr = '中途站';
  43 + } else if (r[0].stationRouteStationMark == 'E') {
  44 + markTypeStr = '终点站';
65 45 }
66   - });
67   - },
68   - editSeteditStationParmasValue : function(points,gLonx,gLaty,bPolygonGridValue,gPolygonGridVlaue,shapesTypeValue,radiusValue) {
69   - // 百度地图经纬度坐标中心点
70   - stationObj[0].stationJwpoints = points;
71   - // WGS经度
72   - stationObj[0].stationGlonx = gLonx;
73   - // WGS经度
74   - stationObj[0].stationGlaty = gLaty;
75   - // 百度坐标点图形集合
76   - stationObj[0].stationGPloyonGrid = gPolygonGridVlaue;
77   - // WGS坐标点图形集合
78   - stationObj[0].stationBPolyonGrid = bPolygonGridValue;
79   - // 图形类型
80   - stationObj[0].stationShapesType = shapesTypeValue;
81   - // 圆形半径
82   - stationObj[0].stationRadius = radiusValue;
83   - },
84   - // 原百度坐标转WGS坐标
85   - getFormPointEToWGS: function(points,callback) {
86   - // 获取长度
87   - var len = points.length;
88   - (function(){
89   - if (!arguments.callee.count) {
90   - arguments.callee.count = 0;
91   - }
92   - arguments.callee.count++;
93   - var index = parseInt(arguments.callee.count) - 1;
94   - if (index >= len) {
95   - callback && callback(points);
96   - return;
97   - }
98   - var f = arguments.callee;
99   - $.ajax({
100   - url: 'http://api.zdoz.net/bd2wgs.aspx',
101   - data: {lat: points[index].potion.lat , lng: points[index].potion.lng},
102   - dataType: 'jsonp',
103   - success: function(r){
104   - if(r) {
105   - points[index].WGSpotion = r;
106   - }
107   - f();
108   - }
109   - });
110   - })();
111   - },
112   - setFormValue : function(stationObj) {
113   - // 站点ID
114   - $('#stationIdInput').val(stationObj.stationId);
115   - // 站点路由ID
116   - $('#stationRouteIdInput').val(stationObj.stationRouteId);
117   - // 站点路由线路Id
118   - $('#stationRouteLineInput').val(stationObj.stationRouteLine);
119   - // 线路编码
120   - $('#lineCodeInput').val(stationObj.stationRouteLIneCode);
121   - // WGS坐标点图形集合
122   - $('#bPolygonGridInput').val(stationObj.stationBPolyonGrid);
123   - // 获取站点名称元素设值
124   - $('#zdmcInput').val(stationObj.zdmc);
125   - // 获取站点名称元素设值
126   - $('#stationRouteNameInput').val(stationObj.stationRouteName);
127   - // 获取站点编码元素设值
128   - $('#stationCodInput').val(stationObj.stationCode);
129   - // 获取站点类型元素设值
130   - $('#stationMarkSelect').val(stationObj.stationRouteStationMark);
131   - // 获取站点方向元素设值
132   - $('#stationdirSelect').val(stationObj.stationRoutedirections);
133   - // 获取站点道路编码元素设值
134   - $('#roadCodingCodInput').val(stationObj.stationRoadCoding);
135   - // 百度地图经纬度坐标中心点
136   - $('#bJwpointsInput').val(stationObj.stationJwpoints);
137   - // 获取图形类型元素,并添加值
138   - if(stationObj.stationShapesType=='r') {
139   - $('#shapesTypeSelect').val('圆形');
140   - }else if(stationObj.stationShapesType=='d'){
141   - $('#shapesTypeSelect').val('多边形');
142   - $('#radiusGroup').hide();
  46 + var htm = '<span style="color: #ff8355;font-size: 20px; overflow: hidden; white-space: nowrap; text-overflow:ellipsis;display: -webkit-box; -webkit-box-orient: vertical;">' + r[0].stationRouteName + '</span>' +
  47 + '<span class="help-block" >站点编码:' + r[0].stationCode + '</span>' +
  48 + '<span class="help-block" >站点序号:' + r[0].stationRouteCode + '</span>' +
  49 + '<span class="help-block" >站点类型:' + markTypeStr + '</span>' +
  50 + '<span class="help-block" >经度:&nbsp&nbsp' + BJwpoints[0] + '</span>' +
  51 + '<span class="help-block" >纬度:&nbsp&nbsp' + BJwpoints[1] + '</span>' +
  52 + '<span class="help-block" >到站时间:' + r[0].stationRouteToTime + '&nbsp;分钟</span>' +
  53 + '<span class="help-block" >到站距离:' + r[0].stationRouteDistances + '&nbsp;公里</span>' +
  54 + '<span class="help-block" >缓冲区形状:' + (shapes != "d" ? "圆形" : "多边形") + '</span>' +
  55 + (shapes=="r" ? ("<span class='help-block' >半径&nbsp&nbsp:" + r[0].stationRadius + "</span>") : " ")+
  56 + '<span class="help-block" >版本号&nbsp&nbsp:' + r[0].stationRouteVersions + '</span>' ;
  57 +
  58 + if(shapes == 'r') {
  59 + // 画圆
  60 + StationPositionsWorldsBMap.pointsCircle(r,point,htm,opts);
  61 + }else if(shapes == 'd'){
  62 + // 画多边形
  63 + StationPositionsWorldsBMap.pointsPolygon(r,point,htm,opts);
  64 + }
143 65 }
144   - /*$('#shapesTypeSelect').val(stationObj.stationShapesType);*/
145   - // 获取半径元素,并添加值
146   - $('#radiusInput').val(stationObj.stationRadius);
147   - // 是否撤销
148   - $('#destroySelect').val(stationObj.stationRouteDestroy);
149   - // 到站时间
150   - $('#toTimeInput').val(stationObj.stationRouteToTime);
151   - // 到站距离
152   - $('#distancesInput').val(stationObj.stationRouteDistances);
153   - // 版本号
154   - $('#versionsInput').val(stationObj.stationRouteVersions);
155   - // 描述/说明
156   - $('#descriptionsTextarea').val(stationObj.stationRouteDescriptions);
157   - },
158   - setListEditFrom : function(stationObj) {
159   - // WGS坐标点图形集合
160   - var stationBPolyonGrid = null;
161   - if(stationObj.stationBPolyonGrid)
162   - stationBPolyonGrid = stationObj.stationBPolyonGrid.substring(9, stationObj.stationBPolyonGrid.length -2);
163   - $('#bPolygonGridInput').val(stationBPolyonGrid);
164   - // 百度地图经纬度坐标中心点
165   - $('#bJwpointsInput').val(stationObj.stationJwpoints);
166   - // 城建坐标x
167   - $('#xInput').val(stationObj.stationGlonx);
168   - // 城建坐标y
169   - $('#yInput').val(stationObj.stationGlony);
170   - // 获取图形类型元素,并添加值
171   - $('#shapesTypeSelect').val(stationObj.stationShapesType);
172   - // 获取半径元素,并添加值
173   - $('#radiusInput').val(stationObj.stationRadius);
174   - // 线路ID
175   - $('#stationRouteLineInput').val(stationObj.stationRouteLine);
176   - // 站点编码
177   - $('#stationCodInput').val(stationObj.stationCode);
178   - // 线路编码
179   - $('#lineCodeInput').val(stationObj.stationRouteLIneCode);
180   - // 站点ID
181   - $('#StationCodeInput').val(stationObj.stationRouteStation);
182   - // 站点路由ID
183   - $('#stationRouteIdInput').val(stationObj.stationRouteId);
184   - // 站点名称
185   - $('#zdmcInput').val(stationObj.zdmc);
186   - // 站点路由线路名称
187   - $('#stationNameInput').val(stationObj.stationRouteName);
188   - // 获取站点类型元素设值
189   - $('#stationMarkSelect').val(stationObj.stationRouteStationMark);
190   - // 获取站点方向元素设值
191   - $('#stationdirSelect').val(stationObj.stationRoutedirections);
192   - // 获取站点道路编码元素设值
193   - $('#roadCodingCodInput').val(stationObj.stationRoadCoding);
194   - // 是否撤销
195   - $('#destroySelect').val(stationObj.stationRouteDestroy);
196   - // 到站时间
197   - $('#toTimeInput').val(stationObj.stationRouteToTime);
198   - // 到站距离
199   - $('#distancesInput').val(stationObj.stationRouteDistances);
200   - // 版本号
201   - $('#versionsInput').val(stationObj.stationRouteVersions);
202   - // 描述/说明
203   - $('#descriptionsTextarea').val(stationObj.stationRouteDescriptions);
204   - },
205   - // 获取站点路由.
206   - getzdlyInfo : function(params,callback) {
207   - $get('/stationroute/all',params,function(result) {
208   - callback && callback(result);
209   - });
210   - },
211   - // 方向代码转名称.
212   - dirdmToName : function(value){
213   - var srStr = '';
214   - if(value=='0')
215   - srStr = '上行';
216   - else if(value=='1')
217   - srStr = '下行';
218   - return srStr;
219   - },
220   - findUpStationRouteCode : function(lineId,diraction,stationRouteCode,callback) {
221   - $get('/stationroute/findUpStationRouteCode',{lineId:lineId,direction:diraction,stationRouteCode:stationRouteCode},function(result) {
222   - callback && callback(result);
223   - });
224   - },
225   - getStationRouteInfo : function(stationId,callback){
226   - $get('/stationroute/findStationRouteInfo',{id:stationId},function(r) {
227   - callback && callback(r);
228   - });
229   - },
230   - // 站点更新
231   - stationUpdate : function(station,callback) {
232   - $post('/station/stationUpdate',station,function(data) {
233   - callback && callback(data);
234   - });
235   - },
236   - getstationObjData : function(){
237   - return stationObj;
238   - },
239   - getStationIdValue : function() {
240   - return stationId;
241   - },
242   - setStationNameValue : function(editStationName) {
243   - stationObj[0].stationName = editStationName;
244   - return stationObj;
245   - },
246   - getPolygonObj : function() {
247   - return polygon;
248   - },
249   - getMarkerObj : function() {
250   - return marker;
251   - },
252   - getCircleObj : function() {
253   - return circle;
  66 + });
  67 + },
  68 + editSeteditStationParmasValue : function(points,gLonx,gLaty,bPolygonGridValue,gPolygonGridVlaue,shapesTypeValue,radiusValue) {
  69 + // 百度地图经纬度坐标中心点
  70 + stationObj[0].stationJwpoints = points;
  71 + // WGS经度
  72 + stationObj[0].stationGlonx = gLonx;
  73 + // WGS经度
  74 + stationObj[0].stationGlaty = gLaty;
  75 + // 百度坐标点图形集合
  76 + stationObj[0].stationGPloyonGrid = gPolygonGridVlaue;
  77 + // WGS坐标点图形集合
  78 + stationObj[0].stationBPolyonGrid = bPolygonGridValue;
  79 + // 图形类型
  80 + stationObj[0].stationShapesType = shapesTypeValue;
  81 + // 圆形半径
  82 + stationObj[0].stationRadius = radiusValue;
  83 + },
  84 + // 原百度坐标转WGS坐标
  85 + getFormPointEToWGS: function(points,callback) {
  86 + // 获取长度
  87 + var len = points.length;
  88 + (function(){
  89 + if (!arguments.callee.count) {
  90 + arguments.callee.count = 0;
  91 + }
  92 + arguments.callee.count++;
  93 + var index = parseInt(arguments.callee.count) - 1;
  94 + if (index >= len) {
  95 + callback && callback(points);
  96 + return;
  97 + }
  98 + var f = arguments.callee;
  99 + $.ajax({
  100 + url: 'http://api.zdoz.net/bd2wgs.aspx',
  101 + data: {lat: points[index].potion.lat , lng: points[index].potion.lng},
  102 + dataType: 'jsonp',
  103 + success: function(r){
  104 + if(r) {
  105 + points[index].WGSpotion = r;
  106 + }
  107 + f();
  108 + }
  109 + });
  110 + })();
  111 + },
  112 + setFormValue : function(stationObj) {
  113 + // 站点ID
  114 + $('#stationIdInput').val(stationObj.stationId);
  115 + // 站点路由ID
  116 + $('#stationRouteIdInput').val(stationObj.stationRouteId);
  117 + // 站点路由线路Id
  118 + $('#stationRouteLineInput').val(stationObj.stationRouteLine);
  119 + // 线路编码
  120 + $('#lineCodeInput').val(stationObj.stationRouteLIneCode);
  121 + // WGS坐标点图形集合
  122 + $('#bPolygonGridInput').val(stationObj.stationBPolyonGrid);
  123 + // 获取站点名称元素设值
  124 + $('#zdmcInput').val(stationObj.zdmc);
  125 + // 获取站点名称元素设值
  126 + $('#stationRouteNameInput').val(stationObj.stationRouteName);
  127 + // 获取站点编码元素设值
  128 + $('#stationCodInput').val(stationObj.stationCode);
  129 + // 获取站点类型元素设值
  130 + $('#stationMarkSelect').val(stationObj.stationRouteStationMark);
  131 + // 获取站点方向元素设值
  132 + $('#stationdirSelect').val(stationObj.stationRoutedirections);
  133 + // 获取站点道路编码元素设值
  134 + $('#roadCodingCodInput').val(stationObj.stationRoadCoding);
  135 + // 百度地图经纬度坐标中心点
  136 + $('#bJwpointsInput').val(stationObj.stationJwpoints);
  137 + // 获取图形类型元素,并添加值
  138 + if(stationObj.stationShapesType=='r') {
  139 + $('#shapesTypeSelect').val('圆形');
  140 + }else if(stationObj.stationShapesType=='d'){
  141 + $('#shapesTypeSelect').val('多边形');
  142 + $('#radiusGroup').hide();
254 143 }
255   - }
  144 + /*$('#shapesTypeSelect').val(stationObj.stationShapesType);*/
  145 + // 获取半径元素,并添加值
  146 + $('#radiusInput').val(stationObj.stationRadius);
  147 + // 是否撤销
  148 + $('#destroySelect').val(stationObj.stationRouteDestroy);
  149 + // 到站时间
  150 + $('#toTimeInput').val(stationObj.stationRouteToTime);
  151 + // 到站距离
  152 + $('#distancesInput').val(stationObj.stationRouteDistances);
  153 + // 版本号
  154 + $('#versionsInput').val(stationObj.stationRouteVersions);
  155 + // 描述/说明
  156 + // $('#descriptionsTextarea').val(stationObj.stationRouteDescriptions);
  157 + },
  158 + setListEditFrom : function(stationObj) {
  159 + // WGS坐标点图形集合
  160 + var stationBPolyonGrid = null;
  161 + if(stationObj.stationBPolyonGrid)
  162 + stationBPolyonGrid = stationObj.stationBPolyonGrid.substring(9, stationObj.stationBPolyonGrid.length -2);
  163 + $('#bPolygonGridInput').val(stationBPolyonGrid);
  164 + // 百度地图经纬度坐标中心点
  165 + $('#bJwpointsInput').val(stationObj.stationJwpoints);
  166 + // 获取图形类型元素,并添加值
  167 + $('#shapesTypeSelect').val(stationObj.stationShapesType);
  168 + // 获取半径元素,并添加值
  169 + $('#radiusInput').val(stationObj.stationRadius);
  170 + // 线路ID
  171 + $('#stationRouteLineInput').val(stationObj.stationRouteLine);
  172 + // 站点编码
  173 + $('#stationCodInput').val(stationObj.stationCode);
  174 + // 线路编码
  175 + $('#lineCodeInput').val(stationObj.stationRouteLIneCode);
  176 + // 站点ID
  177 + $('#StationCodeInput').val(stationObj.stationRouteStation);
  178 + // 站点路由ID
  179 + $('#stationRouteIdInput').val(stationObj.stationRouteId);
  180 + // 站点路由线路名称
  181 + $('#stationNameInput').val(stationObj.stationRouteName);
  182 + // 获取站点类型元素设值
  183 + $('#stationMarkSelect').val(stationObj.stationRouteStationMark);
  184 + // 获取站点方向元素设值
  185 + $('#stationdirSelect').val(stationObj.stationRoutedirections);
  186 + // 是否撤销
  187 + $('#destroySelect').val(stationObj.stationRouteDestroy);
  188 + // 到站时间
  189 + $('#toTimeInput').val(stationObj.stationRouteToTime);
  190 + // 到站距离
  191 + $('#distancesInput').val(stationObj.stationRouteDistances);
  192 + // 版本号
  193 + $('#versionsInput').val(stationObj.stationRouteVersions);
  194 + // 描述/说明
  195 + $('#descriptionsTextarea').val(stationObj.stationRouteDescriptions);
  196 + },
  197 + // 获取站点路由.
  198 + getzdlyInfo : function(params,callback) {
  199 + $get('/stationroute/all',params,function(result) {
  200 + callback && callback(result);
  201 + });
  202 + },
  203 + // 方向代码转名称.
  204 + dirdmToName : function(value){
  205 + var srStr = '';
  206 + if(value=='0')
  207 + srStr = '上行';
  208 + else if(value=='1')
  209 + srStr = '下行';
  210 + return srStr;
  211 + },
  212 + findUpStationRouteCode : function(lineId,diraction,stationRouteCode,callback) {
  213 + $get('/stationroute/findUpStationRouteCode',{lineId:lineId,direction:diraction,stationRouteCode:stationRouteCode},function(result) {
  214 + callback && callback(result);
  215 + });
  216 + },
  217 + getStationRouteInfo : function(stationId,callback){
  218 + $get('/stationroute/findStationRouteInfo',{id:stationId},function(r) {
  219 + callback && callback(r);
  220 + });
  221 + },
  222 + // 站点更新
  223 + stationUpdate : function(station,callback) {
  224 + $post('/station/stationUpdate',station,function(data) {
  225 + callback && callback(data);
  226 + });
  227 + },
  228 + strGetLength: function (str) {
  229 + return str.replace(/[\u0391-\uFFE5]/g, "aa").length; //先把中文替换成两个字节的英文,在计算长度
  230 + },
  231 + getstationObjData : function(){
  232 + return stationObj;
  233 + },
  234 + getStationIdValue : function() {
  235 + return stationId;
  236 + },
  237 + setStationNameValue : function(editStationName) {
  238 + stationObj[0].stationName = editStationName;
  239 + return stationObj;
  240 + },
  241 + getPolygonObj : function() {
  242 + return polygon;
  243 + },
  244 + getMarkerObj : function() {
  245 + return marker;
  246 + },
  247 + getCircleObj : function() {
  248 + return circle;
  249 + }
  250 + };
256 251 return PubFun ;
257 252 }();
258 253 \ No newline at end of file
... ...
src/main/resources/static/pages/base/station/js/station-positions-map.js
... ... @@ -16,7 +16,7 @@ var StationPositionsWorldsBMap = function () {
16 16 // 初始化百度地图
17 17 mapBValue = new BMap.Map("positionBmap_basic");
18 18 //中心点和缩放级别
19   - mapBValue.centerAndZoom(new BMap.Point(CENTER_POINT.lng,CENTER_POINT.lat), 15);
  19 + mapBValue.centerAndZoom(new BMap.Point(CENTER_POINT.lng,CENTER_POINT.lat), 18);
20 20 //启用地图拖拽事件,默认启用(可不写)
21 21 mapBValue.enableDragging();
22 22 //启用地图滚轮放大缩小
... ... @@ -33,7 +33,7 @@ var StationPositionsWorldsBMap = function () {
33 33 },
34 34 pointsCircle : function(r,point,htm,opts) {
35 35 // 将视图切换到指定的缩放等级,中心点坐标不变。注意:当有信息窗口在地图上打开时,地图缩放将保证信息窗口所在的坐标位置不动。(自1.2新增)
36   - mapBValue.setZoom(17);
  36 + mapBValue.setZoom(18);
37 37 //创建圆
38 38 circle = new BMap.Circle(point,r[0].stationRadius,{strokeColor:"blue", strokeWeight:2, strokeOpacity:0.5});
39 39 // 允许覆盖物在map.clearOverlays方法中被清除
... ... @@ -52,11 +52,8 @@ var StationPositionsWorldsBMap = function () {
52 52 //开启信息窗口
53 53 marker.openInfoWindow(infoWindow,point);
54 54 },100);
55   - // 是否在平移过程中禁止动画。(自1.2新增)
56   - var PanOptions_ ={noAnimation :true};
57 55 // 将地图的中心点更改为给定的点。
58   - mapBValue.panTo(point,PanOptions_);
59   - mapBValue.panBy(10,-250,PanOptions_);
  56 + mapBValue.panTo(point);
60 57 // 添加标志物监听事件
61 58 marker.addEventListener("click",function() {
62 59 //开启信息窗口
... ... @@ -99,7 +96,7 @@ var StationPositionsWorldsBMap = function () {
99 96 // 将地图的中心点更改为给定的点。
100 97 mapBValue.panTo(pointPolygon,PanOptions_);
101 98 // 将地图在水平位置上移动x像素,垂直位置上移动y像素。
102   - mapBValue.panBy(10,-510,PanOptions_);
  99 + // mapBValue.panBy(10,-510,PanOptions_);
103 100 //开启信息窗口
104 101 marker.openInfoWindow(infoWindow,pointPolygon);
105 102 },
... ...
src/main/resources/static/pages/base/station/list_edit.html
... ... @@ -42,6 +42,8 @@
42 42  
43 43 <!-- 表单分组组件 form-group START -->
44 44 <div class="form-group">
  45 + <!-- 站点路由编码 -->
  46 + <input type="hidden" name="stationRouteId" id="stationRouteIdInput" />
45 47 <!-- 图形坐标点集合(百度坐标) -->
46 48 <input type="hidden" name="bPolygonGrid" id="bPolygonGridInput" />
47 49 <!-- 经纬度坐标点 -->
... ... @@ -50,10 +52,6 @@
50 52 <input type="hidden" name="gPolygonGrid" id="gPolygonGridInput" />
51 53 <!-- 原始坐标类型 -->
52 54 <input type="hidden" name="dbType" id="dbTypeInput" value="b"/>
53   - <!-- 城建坐标x -->
54   - <input type="hidden" name="x" id="xInput" />
55   - <!-- 城建坐标y -->
56   - <input type="hidden" name="y" id="yInput" />
57 55 <!-- 几何图形类型 -->
58 56 <input type="hidden" name="shapesType" id="shapesTypeSelect">
59 57 <!-- 圆形半径 -->
... ... @@ -99,31 +97,6 @@
99 97 </div>
100 98 </div>
101 99 <!-- 站点编号 (* 必填项) END -->
102   -
103   - <!-- 站点名称 (* 必填项) START -->
104   - <div class="col-md-6">
105   - <label class="control-label col-md-5">
106   - <span class="required"> * </span>站点名称&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:
107   - </label>
108   - <div class="col-md-4">
109   - <input type="text" class="form-control" name="zdmc" id="zdmcInput" placeholder="站点名称" readonly="readonly">
110   - </div>
111   - </div>
112   - <!-- 站点名称 (* 必填项) END -->
113   - </div>
114   - <!-- 表单分组组件 form-group END -->
115   -
116   - <!-- 表单分组组件 form-group START -->
117   - <div class="form-group">
118   - <!-- 站点路由编码 -->
119   - <div class="col-md-6">
120   - <label class="control-label col-md-5">
121   - <span class="required"> * </span>站点路由编码&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:
122   - </label>
123   - <div class="col-md-4">
124   - <input type="text" class="form-control" name="stationRouteId" id="stationRouteIdInput" placeholder="站点路由编码" readonly="readonly">
125   - </div>
126   - </div>
127 100  
128 101 <!-- 站点路由名称 -->
129 102 <div class="col-md-6">
... ... @@ -202,16 +175,16 @@
202 175  
203 176 <!-- 表单分组组件 form-group START -->
204 177 <div class="form-group">
205   - <!-- 道路编码-->
206   - <div class="col-md-6">
207   - <label class="control-label col-md-5"><span class="required"> </span>
208   - 道路编码&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:
209   - </label>
210   - <div class="col-md-4">
211   - <input type="text" class="form-control" name="roadCoding" id="roadCodingCodInput" placeholder="道路编码">
212   - </div>
213   - </div>
214   -
  178 + <!-- 到站距离 -->
  179 + <div class="col-md-6">
  180 + <label class="control-label col-md-5"><span class="required"> </span>
  181 + 到站距离&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</label>
  182 + <div class="col-md-4">
  183 + <input type="text" class="form-control" name="distances" id="distancesInput" placeholder="到站距离">
  184 + <span class="help-block">单位:公里(km)</span>
  185 + </div>
  186 + </div>
  187 +
215 188 <!-- 到站时间 -->
216 189 <div class="col-md-6">
217 190 <label class="control-label col-md-5"><span class="required"></span>
... ... @@ -226,16 +199,6 @@
226 199  
227 200 <!-- 表单分组组件 form-group START -->
228 201 <div class="form-group">
229   - <!-- 到站距离 -->
230   - <div class="col-md-6">
231   - <label class="control-label col-md-5"><span class="required"> </span>
232   - 到站距离&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</label>
233   - <div class="col-md-4">
234   - <input type="text" class="form-control" name="distances" id="distancesInput" placeholder="到站距离">
235   - <span class="help-block">单位:公里(km)</span>
236   - </div>
237   - </div>
238   -
239 202 <!-- 版本号 -->
240 203 <div class="col-md-6">
241 204 <label class="control-label col-md-5"><span class="required"> </span> 版本号&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:
... ... @@ -246,10 +209,10 @@
246 209 </div>
247 210 </div>
248 211 <!-- 表单分组组件 form-group END -->
249   -
  212 +
250 213 <!-- 表单分组组件 form-group START -->
251   - <div class="form-group">
252   - <!-- 描述/说明 -->
  214 + <!--<div class="form-group">
  215 + &lt;!&ndash; 描述/说明 &ndash;&gt;
253 216 <div class="col-md-6">
254 217 <label class="control-label col-md-5"><span class="required"></span>描述/说明&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:
255 218 </label>
... ... @@ -257,9 +220,9 @@
257 220 <textarea class="form-control" rows="3" name="descriptions" id="descriptionsTextarea" placeholder="描述/说明"></textarea>
258 221 </div>
259 222 </div>
260   -
261   -
262   - </div>
  223 +
  224 +
  225 + </div>-->
263 226 <!-- 表单分组组件 form-group END -->
264 227  
265 228 <!-- 表单按钮组件 START -->
... ...
src/main/resources/static/pages/base/station/positions.html
1 1 <link href="/pages/base/station/css/positions.css" rel="stylesheet" type="text/css" />
2   -<!-- 地图容器 -->
3   -<div id="positionBmap_basic"></div>
4   -<!-- 操作工具容器disabled -->
5   -<div class="leftUtils">
6   - <div class="btn-group" style="left: 100px;">
7   - <a class="btn btn-sm green-seagreen dropdown-toggle" style="width: 98px;" href="javascript:;" data-toggle="dropdown" aria-expanded="false"> 操作工具
8   - <i class="fa fa-angle-down"></i>
9   - </a>
10   - <ul class="dropdown-menu pull-right" style="min-width:100px">
11   - <li>
12   - <a href="javascript:;" class="btn" id="eidt"><i class="fa fa-pencil"></i> 修改 </a>
13   - </li>
14   - <li>
15   - <a href="javascript:;" class="btn" id = "backUp"> <i class="fa fa-reply"></i> 返回 </a>
16   - </li>
17   -
18   - </ul>
  2 +<div class="mian-portlet-body">
  3 + <!-- 地图容器 -->
  4 + <div id="positionBmap_basic"></div>
  5 + <!-- 操作工具容器disabled -->
  6 + <div class="leftUtils">
  7 + <div class="btn-group" style="left: 100px;">
  8 + <a class="btn btn-sm green-seagreen dropdown-toggle" style="width: 98px;" href="javascript:;" data-toggle="dropdown" aria-expanded="false"> 操作工具
  9 + <i class="fa fa-angle-down"></i>
  10 + </a>
  11 + <ul class="dropdown-menu pull-right" style="min-width:100px">
  12 + <li>
  13 + <a href="javascript:;" class="btn" id="eidt"><i class="fa fa-pencil"></i> 修改 </a>
  14 + </li>
  15 + <li>
  16 + <a href="javascript:;" class="btn" id = "backUp"> <i class="fa fa-reply"></i> 返回 </a>
  17 + </li>
  18 +
  19 + </ul>
  20 + </div>
19 21 </div>
20 22 </div>
21 23 <!-- 站点对象类 -->
22 24 <script src="/pages/base/station/js/positionstation.js"></script>
  25 +<!-- 方法函数JS类库 -->
  26 +<script src="/pages/base/station/js/station-positions-function.js"></script>
23 27 <!-- 地图JS类库 -->
24 28 <script src="/pages/base/station/js/station-positions-map.js"></script>
25 29 <!-- 绘制工具类 -->
26 30 <script src="/pages/base/station/js/positionsdrwmager.js"></script>
27   -<!-- 方法函数JS类库 -->
28   -<script src="/pages/base/station/js/station-positions-function.js"></script>
29 31 <!-- reloadJS类库 -->
30 32 <script src="/pages/base/station/js/station-positions-reload.js"></script>
31 33 <!-- 事件JS类库 -->
... ...
src/main/resources/static/pages/base/stationroute/add.html
... ... @@ -17,27 +17,14 @@
17 17 <input type="hidden" name="gPolygonGrid" id="gPolygonGridInput" value="" />
18 18 <input type="hidden" name="gJwpoints" id="gJwpointsInput">
19 19 <input type="hidden" name="dbType" id="dbTypeInput" value="b"/>
20   - <input type="hidden" name="x" id="xInput" value=""/>
21   - <input type="hidden" name="y" id="yInput" value=""/>
22   - <!-- 站点名称 -->
23   - <div class="form-body">
24   - <div class="form-group">
25   - <label class="control-label col-md-3">
26   - <span class="required"> * </span> 站点名称&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:
27   - </label>
28   - <div class="col-md-6">
29   - <input type="text" class="form-control" name="zdmc" id="zdmcInput" placeholder="站点名称" readonly="readonly">
30   - </div>
31   - </div>
32   - </div>
33 20 <!-- 站点路由名称 -->
34 21 <div class="form-body">
35 22 <div class="form-group">
36 23 <label class="control-label col-md-3">
37   - <span class="required"> * </span> 站点路由名称:
  24 + <span class="required"> * </span> 站点名称&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:
38 25 </label>
39 26 <div class="col-md-6">
40   - <input type="text" class="form-control" name="stationName" id="stationNameInput" placeholder="站点路由名称">
  27 + <input type="text" class="form-control" name="stationName" id="stationNameInput" placeholder="站点名称">
41 28 </div>
42 29 </div>
43 30 </div>
... ... @@ -138,16 +125,6 @@
138 125 </div>
139 126 </div>
140 127 </div>
141   -
142   - <!-- 道路编码-->
143   - <div class="form-body">
144   - <div class="form-group">
145   - <label class="control-label col-md-3">道路编码&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</label>
146   - <div class="col-md-6">
147   - <input type="text" class="form-control" name="roadCoding" id="roadCodingCodInput">
148   - </div>
149   - </div>
150   - </div>
151 128 <!-- 到站时间 -->
152 129 <div class="form-body">
153 130 <div class="form-group">
... ... @@ -179,12 +156,12 @@
179 156 </div>
180 157  
181 158 <!-- 描述/说明 -->
182   - <div class="form-group">
  159 + <!--<div class="form-group">
183 160 <label class="control-label col-md-3"> 描述/说明&nbsp;&nbsp;&nbsp;&nbsp;: </label>
184 161 <div class="col-md-6">
185 162 <textarea class="form-control" rows="3" name="descriptions" id="descriptionsTextarea" placeholder="描述/说明"></textarea>
186 163 </div>
187   - </div>
  164 + </div>-->
188 165 </form>
189 166 </div>
190 167 <div class="modal-footer">
... ... @@ -213,8 +190,6 @@ $(&#39;#add_station_mobal&#39;).on(&#39;AddStationMobal.show&#39;, function(e, addMap,ajaxd,stao
213 190 ajaxd.getStationCode(function(stationCode) {
214 191 // 线路ID.
215 192 $('#lineIdInput').val(Line.id);
216   - // 获取站点名称元素设值.
217   - $('#zdmcInput').val(Station.stationNamebootbox);
218 193 // 获取站点路由名称元素设值.
219 194 $('#stationNameInput').val(Station.stationNamebootbox);
220 195 // 站点编码.
... ...
src/main/resources/static/pages/base/stationroute/edit.html
... ... @@ -19,9 +19,6 @@
19 19 <input type="hidden" name="bPolygonGrid" id="bPolygonGridInput" />
20 20 <input type="hidden" name="gPolygonGrid" id="gPolygonGridInput" />
21 21 <input type="hidden" name="dbType" id="dbTypeInput" value="b"/>
22   - <input type="hidden" name="x" id="xInput" value=""/>
23   - <input type="hidden" name="y" id="yInput" value=""/>
24   - <input type="hidden" name="zdmc" id="zdmcInput"/>
25 22 <input type="hidden" name="descriptions" id="descriptionsTextarea" />
26 23 <input type="hidden" name="directions" id="stationdirSelect" />
27 24  
... ... @@ -33,7 +30,7 @@
33 30 <span class="required"> * </span> 站点名称:
34 31 </label>
35 32 <div class="col-md-6">
36   - <input type="text" class="form-control" name="stationName" id="stationNameInput" placeholder="站点名称" readonly="readonly">
  33 + <input type="text" class="form-control" name="stationName" id="stationNameInput" placeholder="站点名称">
37 34 </div>
38 35 </div>
39 36 </div>
... ... @@ -116,15 +113,6 @@
116 113 </div>
117 114 </div>
118 115 </div>
119   - <!-- 道路编码-->
120   - <div class="form-body">
121   - <div class="form-group">
122   - <label class="control-label col-md-3">道路编码&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</label>
123   - <div class="col-md-6">
124   - <input type="text" class="form-control" name="roadCoding" id="roadCodingCodInput" placeholder="道路编码">
125   - </div>
126   - </div>
127   - </div>
128 116 <!-- 到站时间 -->
129 117 <div class="form-body">
130 118 <div class="form-group">
... ... @@ -210,7 +198,6 @@ $(&#39;#edit_station_mobal&#39;).on(&#39;editSelectMobal_show&#39;, function(e, map_,ajaxd,stati
210 198 errorClass : 'help-block help-block-error',
211 199 focusInvalid : false,
212 200 rules : {
213   - 'zdmc' : { required : true,maxlength : 50},// 站点名称 必填项
214 201 'stationName' : { required : true,maxlength : 50},// 站点名称 必填项
215 202 'stationCod': {required : true},// 站点编码 必填项
216 203 'directions' : {required : true,dirIs : true},// 站点方向 必填项 必填项
... ...
src/main/resources/static/pages/base/stationroute/edit_select.html
... ... @@ -10,16 +10,6 @@
10 10 </div>
11 11 <div class="modal-body">
12 12 <form class="form-horizontal" action="/" method="post" id="edit_select" role="form">
13   - <div class="alert alert-danger display-hide" id="editSelectrequired">
14   - <button class="close" data-close="alert"></button>
15   - 站点名称为必填项
16   - </div>
17   - <div class="form-group" id="formRequ">
18   - <label class="col-md-3 control-label"><span class="required"> * </span>站点名称:</label>
19   - <div class="col-md-9" id="errorInfo">
20   - <input type="text" class="form-control input-medium" id="stationNamebootbox" name="stationNamebootbox">
21   - </div>
22   - </div>
23 13 <div class="form-group">
24 14 <label class="col-md-3 control-label"><span class="required"> * </span>修改方式:</label>
25 15 <div class="col-md-9">
... ... @@ -70,8 +60,6 @@ $(&#39;#edit_select_mobal&#39;).on(&#39;editSelectMobal_show&#39;, function(e, map_,drw,ajaxd,ed
70 60 $('.tipso-animation').tipso('show');
71 61 setTimeout(function(){$('.tipso-animation').tipso('hide');},4000);
72 62 },500);
73   - // 获取站点名称元素并赋值
74   - $('#stationNamebootbox').val(Station.stationRouteName);
75 63 // 定义站点图形
76 64 var stationShapesTypeV = Station.stationShapesType;
77 65 // 获取表单元素
... ... @@ -89,7 +77,7 @@ $(&#39;#edit_select_mobal&#39;).on(&#39;editSelectMobal_show&#39;, function(e, map_,drw,ajaxd,ed
89 77 errorClass : 'help-block help-block-error',
90 78 focusInvalid : false,
91 79 rules : {
92   - 'stationNamebootbox' : {required : true,maxlength : 50,}
  80 + 'editselect' : {required : true}
93 81 },
94 82 invalidHandler : function(event, validator) {
95 83 editSelectrequired.show();
... ... @@ -111,16 +99,17 @@ $(&#39;#edit_select_mobal&#39;).on(&#39;editSelectMobal_show&#39;, function(e, map_,drw,ajaxd,ed
111 99 // 表单序列
112 100 var params = form.serializeJSON();
113 101 // 站点名称
114   - var editStationName = params.stationNamebootbox;
  102 + debugger;
  103 + var editStationName = Station.stationRouteName;
115 104 // TODO(点击查询位置后绘画效果失败,待修改)
116 105 if(params.editselect==0){
117 106 editStationObj.setEitdStation(Station);
118   - editStationObj.setEitdStationName(editStationName);
  107 + // editStationObj.setEitdStationName(editStationName);
119 108  
120 109 // map_.clearMarkAndOverlays();
121 110 // 打开绘制工具
122 111 drw.openDrawingManager();
123   - map_.localtionPoint(editStationName+"公交站点");
  112 + // map_.localtionPoint(editStationName+"公交站点");
124 113 fun.editMapStatus();
125 114 }else if(params.editselect==1){
126 115 WorldsBMap.localSearchFromAdreesToPoint(editStationName+"公交站点", function (Points) {
... ... @@ -129,7 +118,7 @@ $(&#39;#edit_select_mobal&#39;).on(&#39;editSelectMobal_show&#39;, function(e, map_,drw,ajaxd,ed
129 118 }
130 119 Station.stationShapesType = 'r';
131 120 Station.stationGPloyonGrid = null;
132   - Station.stationRadius = 100;
  121 + Station.stationRadius = 80;
133 122 editStationObj.setEitdStation(Station);
134 123 editStationObj.setEitdStationName(editStationName);
135 124 map_.editShapes(editStationObj);
... ... @@ -137,7 +126,7 @@ $(&#39;#edit_select_mobal&#39;).on(&#39;editSelectMobal_show&#39;, function(e, map_,drw,ajaxd,ed
137 126 fun.editMapStatus();
138 127 }else if(params.editselect==2){
139 128 editStationObj.setEitdStation(Station);
140   - editStationObj.setEitdStationName(editStationName);
  129 + // editStationObj.setEitdStationName(editStationName);
141 130 map_.clearMark();
142 131 // 弹出添加失败提示消息,2秒关闭(如果不配置,默认是3秒)
143 132 var mindex = layer.msg('编辑完图形后,请双击图形区域保存',{ offset: '126px',
... ...
src/main/resources/static/pages/base/stationroute/js/stationroute-list-function.js
... ... @@ -361,18 +361,14 @@ var PublicFunctions = function () {
361 361 $('#lineCodeInput').val(editStationParmas.stationRouteLIneCode);
362 362 // 百度坐标点图形集合
363 363 $('#bPolygonGridInput').val(editStationParmas.stationBPolygonGrid);
364   - // 获取站点名称元素设值
365   - $('#zdmcInput').val(editStationParmas.stationStationName);
366 364 // 获取站点路由名称元素设值
367   - $('#stationNameInput').val(editStationParmas.stationStationName);
  365 + $('#stationNameInput').val(editStationParmas.stationRouteName);
368 366 // 获取站点编码元素设值
369 367 $('#stationCodInput').val(editStationParmas.stationCode);
370 368 // 获取站点类型元素设值
371 369 // $('#stationMarkSelect').val(editStationParmas.stationRouteStationMark);
372 370 // 获取站点方向元素设值
373 371 $('#stationdirSelect').val(editStationParmas.stationRoutedirections);
374   - // 获取站点道路编码元素设值
375   - $('#roadCodingCodInput').val(editStationParmas.stationRoadCoding);
376 372 // 百度地图经纬度坐标中心点
377 373 $('#bJwpointsInput').val(editStationParmas.stationJwpoints);
378 374 if(editStationParmas.stationShapesType=='r') {
... ... @@ -385,7 +381,7 @@ var PublicFunctions = function () {
385 381 // 获取半径元素,并添加值
386 382 $('#radiusInput').val(editStationParmas.stationRadius);
387 383 // 是否撤销
388   - $('#destroySelect').val(editStationParmas.stationDestroy);
  384 + $('#destroySelect').val(editStationParmas.stationRouteDestroy);
389 385 // 到站时间
390 386 $('#toTimeInput').val(editStationParmas.stationRouteToTime);
391 387 // 到站距离
... ...
src/main/resources/static/pages/base/stationroute/js/stationroute-list-map.js
... ... @@ -96,7 +96,7 @@ window.WorldsBMap = function () {
96 96 //启用地图滚轮放大缩小
97 97 mapBValue.enableScrollWheelZoom();
98 98 //禁用鼠标双击放大
99   - mapBValue.disableDoubleClickZoom();
  99 + // mapBValue.disableDoubleClickZoom();
100 100 //启用键盘上下左右键移动地图
101 101 mapBValue.enableKeyboard();
102 102 return mapBValue;
... ... @@ -209,7 +209,7 @@ window.WorldsBMap = function () {
209 209 })();
210 210 },
211 211  
212   - // 打开站点信息窗口
  212 + // 查看站点
213 213 openStationInfoWin : function (objStation) {
214 214 // 将视图切换到指定的缩放等级,中心点坐标不变。注意:当有信息窗口在地图上打开时,地图缩放将保证信息窗口所在的坐标位置不动。(自1.2新增)
215 215 if (objStation) {
... ... @@ -252,11 +252,11 @@ window.WorldsBMap = function () {
252 252 '<span class="help-block" >纬度:&nbsp&nbsp' + BJwpoints[1] + '</span>' +
253 253 '<span class="help-block" >到站时间:' + objStation.stationRouteToTime + '&nbsp;分钟</span>' +
254 254 '<span class="help-block" >到站距离:' + objStation.stationRouteDistances + '&nbsp;公里</span>' +
255   - '<span class="help-block" >缓冲区形状:' + (shapes == "r" ? "圆形" : "多边形") + '</span>' +
  255 + '<span class="help-block" >缓冲区形状:' + (shapes != "d" ? "圆形" : "多边形") + '</span>' +
256 256 (shapes=="r" ? ("<span class='help-block' >半径&nbsp&nbsp:" + objStation.stationRadius + "</span>") : " ")+
257 257 '<span class="help-block" >版本号&nbsp&nbsp:' + objStation.stationRouteVersions + '</span>' +
258 258 '<div>' +
259   - '<button class="info_win_btn" id="editStation" onclick="WorldsBMap.editStation(' + objStation.stationRouteId+','+objStation.stationRoutedirections + ')">修改</button>' +
  259 + '<button class="info_win_btn" id="editStation" onclick="WorldsBMap.editStation(' + objStation.stationRouteId+')">修改</button>' +/* +','+objStation.stationRoutedirections */
260 260 '<button class="info_win_btn" onclick="WorldsBMap.destroyStation('+ objStation.stationRouteId + ','+objStation.stationRouteLine+','+objStation.stationRoutedirections+')">撤销</button>' +
261 261 '<button class="info_win_btn" id="addBetweenStationRoad" onclick="WorldsBMap.addBetweenStationRoad(' + objStation.stationRouteId + ')">添加站点间路段</button>' +
262 262 '</div>';
... ... @@ -634,6 +634,7 @@ window.WorldsBMap = function () {
634 634 })();
635 635 },
636 636  
  637 + // 搜索点位
637 638 localtionPoint: function (stationNameV) {
638 639 // 关闭信息窗口
639 640 mapBValue.closeInfoWindow();
... ... @@ -696,7 +697,7 @@ window.WorldsBMap = function () {
696 697 "direction": stationRouteBegin.stationRoutedirections,
697 698 "stationRouteCode": stationRouteBegin.stationRouteCode
698 699 }, function (stationRoute) {
699   - var stationRouteFinish = stationRoute[0];
  700 + var stationRouteFinish = stationRoute;
700 701  
701 702 if (stationRouteFinish) {
702 703 var pointBegin = stationRouteBegin.stationJwpoints.split(" ");
... ... @@ -1038,7 +1039,7 @@ window.WorldsBMap = function () {
1038 1039 });
1039 1040 });
1040 1041 },
1041   - // 打开路段信息窗口
  1042 + // 查看路段
1042 1043 openSectionInfoWin : function(p) {
1043 1044 var section = p.data;
1044 1045 var width = WorldsBMap.strGetLength(section.sectionName) * 10;
... ...
src/main/resources/static/pages/base/stationroute/js/stationroute-list-treedata.js
... ... @@ -32,16 +32,15 @@ var StationTreeData = function(){
32 32 return;
33 33 }
34 34 // 获取数据
35   - var stationData = treeOjb[0].original;
  35 + var data = treeOjb[0].original;
36 36 // 选中的节点类型
37   - var chaildredType_ = stationData.chaildredType;
38   -
  37 + var chaildredType_ = data.chaildredType;
39 38 if(chaildredType_ == "section") {
40   - WorldsBMap.focusSection(stationData.sectionrouteId);
  39 + WorldsBMap.focusSection(data.sectionrouteId);
41 40 } else if(chaildredType_ == "station") {
42   - WorldsBMap.openStationInfoWin(stationData);
  41 + WorldsBMap.openStationInfoWin(data);
43 42 } else if(chaildredType_ == "addSection") {
44   - WorldsBMap.addSection(stationData);
  43 + WorldsBMap.addSection(data);
45 44 }
46 45 }
47 46 var stationTree = {
... ... @@ -182,7 +181,7 @@ var StationTreeData = function(){
182 181 tree.open_all();
183 182 },500);
184 183 }
185   - }
  184 + };
186 185  
187 186 return stationTree;
188 187  
... ...