Commit baa7c3c1fcc19c7bacf2a7a0b1683a229f8ff883

Authored by 廖磊
2 parents 53cac85c 5330d6cb

Merge branch 'pudong' of http://222.66.0.204:8090/panzhaov5/bsth_control

into pudong
Showing 54 changed files with 1586 additions and 289 deletions
src/main/java/com/bsth/controller/LineController.java
... ... @@ -90,7 +90,7 @@ public class LineController extends BaseController<Line, Integer> {
90 90 lineVersions.setName("原始版本");
91 91 lineVersions.setLine(t);
92 92 lineVersions.setLineCode(t.getLineCode());
93   - lineVersions.setStartDate(t.getCreateDate());
  93 + lineVersions.setStartDate(new java.sql.Date(new Date().getTime()));
94 94 lineVersions.setEndDate(new java.sql.Date(endDate.getTime()));// 2088-8-8 00:00:00
95 95 lineVersions.setVersions(1);
96 96 lineVersions.setStatus(1);
... ...
src/main/java/com/bsth/controller/LineVersionsController.java
... ... @@ -85,4 +85,12 @@ public class LineVersionsController extends BaseController<LineVersions, Integer
85 85 return service.findCurrentVersion(lineId);
86 86 }
87 87  
  88 + /**
  89 + * 根据id发布版本号(修改isupdate字段)
  90 + */
  91 + @RequestMapping(value = "issueVersion", method = RequestMethod.POST)
  92 + public Map<String, Object> issueVersion(@RequestParam(defaultValue = "id") int id) {
  93 + return service.issueVersion(id);
  94 + }
  95 +
88 96 }
... ...
src/main/java/com/bsth/controller/SectionRouteController.java
... ... @@ -10,6 +10,7 @@ import org.springframework.web.bind.annotation.RequestParam;
10 10 import org.springframework.web.bind.annotation.RestController;
11 11  
12 12 import com.bsth.entity.SectionRoute;
  13 +import com.bsth.entity.StationRouteCache;
13 14 import com.bsth.service.SectionRouteService;
14 15  
15 16 /**
... ... @@ -55,6 +56,12 @@ public class SectionRouteController extends BaseController&lt;SectionRoute, Integer
55 56 public Iterable<SectionRoute> list(@RequestParam Map<String, Object> map) {
56 57 return routeService.list(map);
57 58 }
  59 +
  60 + @RequestMapping(value = "/cacheList", method = RequestMethod.GET)
  61 + public List<StationRouteCache> cacheList(@RequestParam Map<String, Object> map) {
  62 +// routeService.cacheList(map)
  63 + return null;
  64 + }
58 65  
59 66 /**
60 67 * @Description :TODO(查询路段信息)
... ... @@ -76,8 +83,8 @@ public class SectionRouteController extends BaseController&lt;SectionRoute, Integer
76 83 *
77 84 * @return Map<String, Object>
78 85 */
79   - @RequestMapping(value = "/findSectionCache" , method = RequestMethod.GET)
80   - public List<Map<String, Object>> findPointsCache(@RequestParam Map<String, Object> map) {
  86 + @RequestMapping(value = "/findCacheSection" , method = RequestMethod.GET)
  87 + public List<Map<String, Object>> getSectionRouteCache(@RequestParam Map<String, Object> map) {
81 88 return routeService.getSectionRouteCache(map);
82 89 }
83 90  
... ... @@ -105,6 +112,11 @@ public class SectionRouteController extends BaseController&lt;SectionRoute, Integer
105 112 return routeService.findUpSectionRouteCode(map);
106 113 }
107 114  
  115 + @RequestMapping(value = "/findCacheUpSectionRouteCode" , method = RequestMethod.GET)
  116 + public List<Map<String, Object>> findCacheUpSectionRouteCode(@RequestParam Map<String, Object> map) {
  117 + return routeService.findCacheUpSectionRouteCode(map);
  118 + }
  119 +
108 120 /**
109 121 * @Description :TODO(引用路段)
110 122 *
... ...
src/main/java/com/bsth/controller/StationController.java
... ... @@ -157,4 +157,15 @@ public class StationController extends BaseController&lt;Station, Integer&gt; {
157 157 return GetUIDAndCode.getStationId();
158 158  
159 159 }
  160 + /**
  161 + * @Description :TODO(查询站点编码)
  162 + *
  163 + * @return int <stationCode站点编码>
  164 + */
  165 + @RequestMapping(value="stationCacheSave" , method = RequestMethod.POST)
  166 + public Map<String, Object> stationCacheSave(@RequestParam Map<String, Object> map) {
  167 + map.put("createBy", "");
  168 + map.put("updateBy", "");
  169 + return service.stationCacheSave(map);
  170 + }
160 171 }
... ...
src/main/java/com/bsth/entity/LineVersions.java
... ... @@ -69,6 +69,12 @@ public class LineVersions{
69 69 */
70 70 private int status;
71 71  
  72 + /**
  73 + * 是否发布 int length(1)
  74 + * 0(没有),1(发布)
  75 + */
  76 + private int isupdate;
  77 +
72 78 public Integer getId() {
73 79 return id;
74 80 }
... ... @@ -156,5 +162,13 @@ public class LineVersions{
156 162 public void setStatus(int status) {
157 163 this.status = status;
158 164 }
  165 +
  166 + public int getIsupdate() {
  167 + return isupdate;
  168 + }
  169 +
  170 + public void setIsupdate(int isupdate) {
  171 + this.isupdate = isupdate;
  172 + }
159 173  
160 174 }
161 175 \ No newline at end of file
... ...
src/main/java/com/bsth/repository/LineVersionsRepository.java
... ... @@ -79,4 +79,12 @@ public interface LineVersionsRepository extends BaseRepository&lt;LineVersions, Int
79 79 */
80 80 @Query(value = " SELECT lv.versions FROM LineVersions lv where lv.line.id = ?1 and lv.status=1")
81 81 public Integer findCurrentVersion(Integer id);
  82 +
  83 + /**
  84 + * 发布版本
  85 + */
  86 + @Transactional
  87 + @Modifying
  88 + @Query(value = "UPDATE LineVersions lv set lv.isupdate=1 where lv.id=?1 ")
  89 + public int issueVersion(int id);
82 90 }
... ...
src/main/java/com/bsth/repository/LsSectionRouteRepository.java
... ... @@ -37,4 +37,11 @@ public interface LsSectionRouteRepository extends BaseRepository&lt;LsSectionRoute,
37 37 @Modifying
38 38 @Query(value="DELETE from bsth_c_ls_sectionroute where line = ?1 and directions = ?2 and versions=?3", nativeQuery=true)
39 39 public void batchDelete(Integer line, Integer dir, Integer versions);
  40 +
  41 + /**
  42 + * 更新路线前撤销线路版本下历史原有路段路由
  43 + */
  44 + @Modifying
  45 + @Query(value="UPDATE bsth_c_ls_sectionroute set destroy = 1 where line = ?1 and directions = ?2 and versions=?3", nativeQuery=true)
  46 + public void batchDestroy(Integer sectionRouteLine, Integer directions, Integer versions);
40 47 }
... ...
src/main/java/com/bsth/repository/LsStationRouteRepository.java
... ... @@ -42,4 +42,14 @@ public interface LsStationRouteRepository extends BaseRepository&lt;LsStationRoute,
42 42 @Modifying
43 43 @Query(value="DELETE from bsth_c_ls_stationroute where line = ?1 and directions = ?2 and versions = ?3", nativeQuery=true)
44 44 public void batchDelete(Integer line,Integer dir, Integer versions);
  45 +
  46 + /**
  47 + * 更新路线前撤销线路版本号历史原有站点路由
  48 + *
  49 + * @param line
  50 + * @param dir
  51 + */
  52 + @Modifying
  53 + @Query(value="UPDATE bsth_c_ls_stationroute set destroy = 1 where line = ?1 and directions = ?2 and versions = ?3", nativeQuery=true)
  54 + public void batchDestroy(Integer sectionRouteLine, Integer directions, Integer versions);
45 55 }
... ...
src/main/java/com/bsth/repository/SectionRouteCacheRepository.java
... ... @@ -139,4 +139,18 @@ public interface SectionRouteCacheRepository extends BaseRepository&lt;SectionRoute
139 139 @Modifying
140 140 @Query(value="delete from bsth_c_sectionroute_cache where line_code = ?1 and directions = ?2", nativeQuery=true)
141 141 public void sectionRouteCacheDel(String lineCode,Integer dir);
142   -}
  142 +
  143 + @Modifying
  144 + @Query(value="delete from bsth_c_sectionroute_cache where line = ?1 and directions = ?2", nativeQuery=true)
  145 + public void sectionRouteCacheDel(Integer lineId,Integer dir);
  146 +
  147 + /**
  148 + * @Description :TODO(查询线路某方向下的上一个路段序号)
  149 + *
  150 + * @param map <lineId:线路ID; direction:方向;sectionRouteCode:路段编码>
  151 + *
  152 + * @return List<Map<String, Object>>
  153 + */
  154 + @Query(value = " select MAX(r.sectionroute_code) as sectionrouteCode from bsth_c_sectionroute_cache r WHERE r.line=?1 and r.directions =?2 and r.sectionroute_code< ?3 and r.destroy = 0", nativeQuery=true)
  155 + List<Object[]> findCacheUpSectionRouteCode(Integer lineId,Integer direction,Integer stationRouteCode);
  156 +}
143 157 \ No newline at end of file
... ...
src/main/java/com/bsth/repository/SectionRouteRepository.java
... ... @@ -202,4 +202,7 @@ public interface SectionRouteRepository extends BaseRepository&lt;SectionRoute, Int
202 202 @Modifying
203 203 @Query(value="delete from SectionRoute sr where sr.line.id = ?1 and sr.lineCode = ?2")
204 204 public void batchDelete(Integer lineId, String lineCode);
  205 +
  206 + @Query("select r from SectionRoute r where r.line.id=?1 and r.directions=?2 and r.destroy=0 order by r.sectionrouteCode")
  207 + public List<SectionRoute> findByLine(Integer lineId, Integer dir);
205 208 }
... ...
src/main/java/com/bsth/repository/StationRouteCacheRepository.java
1 1 package com.bsth.repository;
2 2  
3 3 import java.util.List;
4   -import java.util.Map;
5 4  
6   -import org.springframework.data.domain.Sort;
7   -import org.springframework.data.jpa.domain.Specification;
8 5 import org.springframework.data.jpa.repository.EntityGraph;
9 6 import org.springframework.data.jpa.repository.Modifying;
10 7 import org.springframework.data.jpa.repository.Query;
11 8 import org.springframework.stereotype.Repository;
12 9  
13   -import com.bsth.entity.StationRoute;
14 10 import com.bsth.entity.StationRouteCache;
15   -import com.bsth.entity.search.CustomerSpecs;
16 11  
17 12 /**
18 13 *
... ... @@ -57,12 +52,16 @@ public interface StationRouteCacheRepository extends BaseRepository&lt;StationRoute
57 52 /**
58 53 * 更新路线删除线路缓存站点
59 54 *
60   - * @param line
  55 + * @param lineCode
61 56 * @param dir
62 57 */
63 58 @Modifying
64 59 @Query(value="delete from bsth_c_stationroute_cache where line_code = ?1 and directions = ?2 ", nativeQuery=true)
65 60 public void stationRouteCacheDel(String lineCode,Integer dir);
  61 +
  62 + @Modifying
  63 + @Query(value="delete from bsth_c_stationroute_cache where line = ?1 and directions = ?2 ", nativeQuery=true)
  64 + public void stationRouteCacheDel(Integer lineId,Integer dir);
66 65  
67 66  
68 67 @Query(value = "SELECT a.`stationRoute.id`," +
... ... @@ -137,4 +136,7 @@ public interface StationRouteCacheRepository extends BaseRepository&lt;StationRoute
137 136 "r.line=?1 and r.directions =?2 and station_route_code< ?3 and r.destroy = 0 ) and t.line=?1 and t.directions = ?2 AND t.destroy = 0", nativeQuery=true)
138 137 List<Object[]> findUpStationRouteCode(Integer lineId,Integer direction,Integer stationRouteCode);
139 138  
  139 + @Modifying
  140 + @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 + public void stationUpdStationRouteCode(Integer line,Integer dir,Integer routeCod);
140 142 }
... ...
src/main/java/com/bsth/repository/StationRouteRepository.java
... ... @@ -188,7 +188,7 @@ public interface StationRouteRepository extends BaseRepository&lt;StationRoute, Int
188 188 " a.stationRouteUpdateDate," +
189 189 " b.id AS stationId," +
190 190 " b.station_cod AS stationCode," +
191   - " b.station_name AS stationName," +
  191 + " a.stationRouteName," +
192 192 " b.road_coding AS stationRoadCoding," +
193 193 " b.db_type AS stationDbType," +
194 194 " b.b_jwpoints AS stationJwpoints," +
... ... @@ -211,6 +211,7 @@ public interface StationRouteRepository extends BaseRepository&lt;StationRoute, Int
211 211 " FROM ( SELECT s.id AS stationRouteId," +
212 212 " s.line AS stationRouteLine," +
213 213 " s.station as stationRouteStation," +
  214 + " s.station_name AS stationRouteName," +
214 215 " s.station_route_code as stationRouteCode," +
215 216 " s.line_code AS stationRouteLIneCode," +
216 217 " s.station_mark AS stationRouteStationMark," +
... ... @@ -258,6 +259,9 @@ public interface StationRouteRepository extends BaseRepository&lt;StationRoute, Int
258 259 @Query("select r from StationRoute r where r.lineCode=?1 and r.directions=?2 and r.destroy=0 order by r.stationRouteCode")
259 260 List<StationRoute> findByLine(String lineCode, int updown);
260 261  
  262 + @Query("select r from StationRoute r where r.line.id=?1 and r.directions=?2 and r.destroy=0 order by r.stationRouteCode")
  263 + List<StationRoute> findByLine(Integer lineId, Integer dir);
  264 +
261 265 @EntityGraph(value = "stationRoute_station", type = EntityGraph.EntityGraphType.FETCH)
262 266 @Query("select s from StationRoute s where s.destroy=0 and s.lineCode=?1")
263 267 List<StationRoute> findByLineCode(String lineCode);
... ...
src/main/java/com/bsth/service/LineVersionsService.java
... ... @@ -39,4 +39,6 @@ public interface LineVersionsService extends BaseService&lt;LineVersions, Integer&gt;
39 39  
40 40 Map<String, Object> add(Map<String, Object> map);
41 41  
  42 + Map<String, Object> issueVersion(int id);
  43 +
42 44 }
... ...
src/main/java/com/bsth/service/SectionRouteService.java
... ... @@ -61,8 +61,11 @@ public interface SectionRouteService extends BaseService&lt;SectionRoute, Integer&gt;
61 61 */
62 62 List<Map<String, Object>> findUpSectionRouteCode(Map<String, Object> map);
63 63  
  64 + List<Map<String, Object>> findCacheUpSectionRouteCode(Map<String, Object> map);
  65 +
64 66 Map<String, Object> quoteSection(Map<String, Object> map);
65 67  
66 68 void batchUpdate(Integer lineId, String lineCode);
  69 +
67 70  
68 71 }
... ...
src/main/java/com/bsth/service/StationService.java
... ... @@ -52,6 +52,8 @@ public interface StationService extends BaseService&lt;Station, Integer&gt; {
52 52 */
53 53 Map<String, Object> stationSaveMap(Map<String, Object> map);
54 54  
  55 + Map<String, Object> stationCacheSave(Map<String, Object> map);
  56 +
55 57 /**
56 58 * @Description :TODO(更新站点保存)
57 59 *
... ... @@ -83,5 +85,8 @@ public interface StationService extends BaseService&lt;Station, Integer&gt; {
83 85 Map<String, Object> cacheSave(Map<String, Object> map);
84 86  
85 87 Map<String, Object> stationCacheUpdate(Map<String, Object> map);
  88 +
  89 + Map<String, Object> referenceCurrentVersion(Map<String, Object> map);
  90 +
86 91  
87 92 }
... ...
src/main/java/com/bsth/service/impl/LineVersionsServiceImpl.java
... ... @@ -258,5 +258,16 @@ public class LineVersionsServiceImpl extends BaseServiceImpl&lt;LineVersions, Integ
258 258 public Integer findCurrentVersion(int lineId) {
259 259 return repository.findCurrentVersion(lineId);
260 260 }
261   -
  261 +
  262 + @Override
  263 + public Map<String, Object> issueVersion(int id) {
  264 + Map<String, Object> resultMap = new HashMap<>();
  265 +
  266 + int statu = repository.issueVersion(id);
  267 + if (statu == 1)
  268 + resultMap.put("status", ResponseCode.SUCCESS);
  269 + else
  270 + resultMap.put("status", ResponseCode.ERROR);
  271 + return resultMap;
  272 + }
262 273 }
... ...
src/main/java/com/bsth/service/impl/SectionRouteServiceImpl.java
... ... @@ -131,8 +131,8 @@ public class SectionRouteServiceImpl extends BaseServiceImpl&lt;SectionRoute, Integ
131 131 @Transactional
132 132 @Override
133 133 public List<Map<String, Object>> getSectionRouteCache(Map<String, Object> map) {
134   - int lineId = map.get("line.id_eq").equals("") ? 0 : Integer.parseInt(map.get("line.id_eq").toString());
135   - int directions = map.get("directions_eq").equals("") ? 0 : Integer.parseInt(map.get("directions_eq").toString());
  134 + int lineId = map.get("lineId").equals("") ? 0 : Integer.parseInt(map.get("lineId").toString());
  135 + int directions = map.get("dir").equals("") ? 0 : Integer.parseInt(map.get("dir").toString());
136 136 List<Object[]> listObjArray = Cacherepository.getSectionRouteCache(lineId, directions);
137 137 List<Map<String, Object>> resultList = new ArrayList<Map<String,Object>>();
138 138 if(listObjArray.size()>0) {
... ... @@ -297,6 +297,23 @@ public class SectionRouteServiceImpl extends BaseServiceImpl&lt;SectionRoute, Integ
297 297 }
298 298 return list;
299 299 }
  300 +
  301 + @Override
  302 + public List<Map<String, Object>> findCacheUpSectionRouteCode(Map<String, Object> map) {
  303 + Integer lineId = map.get("lineId").equals("") ? null : Integer.parseInt(map.get("lineId").toString());
  304 + Integer direction = map.get("direction").equals("") ? null : Integer.parseInt(map.get("direction").toString());
  305 + Integer stationRouteCode = map.get("sectionRouteCode").equals("") ? null : Integer.parseInt(map.get("sectionRouteCode").toString());
  306 + List<Object[]> reslutList = Cacherepository.findCacheUpSectionRouteCode(lineId, direction, stationRouteCode);
  307 + List<Map<String, Object>> list = new ArrayList<Map<String,Object>>();
  308 + if(reslutList.get(0)!=null) {
  309 + for(int i = 0 ; i <reslutList.size() ;i++){
  310 + Map<String, Object> tempM = new HashMap<String, Object>();
  311 + tempM.put("sectionrouteCode", reslutList.get(i));
  312 + list.add(tempM);
  313 + }
  314 + }
  315 + return list;
  316 + }
300 317  
301 318 @Override
302 319 public Map<String, Object> quoteSection(Map<String, Object> map) {
... ...
src/main/java/com/bsth/service/impl/SectionServiceImpl.java
... ... @@ -7,9 +7,7 @@ import java.util.HashMap;
7 7 import java.util.List;
8 8 import java.util.Map;
9 9  
10   -import org.mozilla.javascript.ObjArray;
11 10 import org.springframework.beans.factory.annotation.Autowired;
12   -import org.springframework.data.jpa.domain.Specification;
13 11 import org.springframework.stereotype.Service;
14 12 import org.springframework.transaction.annotation.Transactional;
15 13  
... ... @@ -17,7 +15,6 @@ import com.alibaba.fastjson.JSONArray;
17 15 import com.alibaba.fastjson.JSONObject;
18 16 import com.bsth.common.ResponseCode;
19 17 import com.bsth.entity.Line;
20   -import com.bsth.entity.LineVersions;
21 18 import com.bsth.entity.LsSectionRoute;
22 19 import com.bsth.entity.LsStationRoute;
23 20 import com.bsth.entity.Section;
... ... @@ -40,7 +37,6 @@ import com.bsth.util.TransGPS;
40 37 import com.bsth.util.TransGPS.Location;
41 38 import com.bsth.util.Geo.GeoUtils;
42 39 import com.bsth.util.Geo.Point;
43   -import com.google.gson.JsonObject;
44 40  
45 41 /**
46 42 *
... ... @@ -171,7 +167,7 @@ public class SectionServiceImpl extends BaseServiceImpl&lt;Section, Integer&gt; implem
171 167 String bsectionVectorS = null;
172 168 if(!sectionsBpoints.equals(""))
173 169 bsectionVectorS = "LINESTRING(" + sectionsBpoints + ")";
174   - repository.systemSave(sectionCode, sectionName, crosesRoad, endNode, startNode, middleNode, gsectionVector, bsectionVectorS, sectionType, csectionVector, roadCoding, sectionDistance, sectionTime, dbType, speedLimit, descriptions, versions, sectionId);
  170 + repository.systemSave(sectionCode, sectionName, crosesRoad, endNode, startNode, middleNode, gsectionVector, bsectionVectorS, sectionType, csectionVector, roadCoding, sectionDistance, sectionTime, dbType, speedLimit, descriptions, 1, sectionId);
175 171 SectionRoute route = new SectionRoute();
176 172 Line line = lineRepository.findOne(sectionRouteLine);
177 173 Section section = repository.findOne(sectionId);
... ... @@ -663,7 +659,8 @@ public class SectionServiceImpl extends BaseServiceImpl&lt;Section, Integer&gt; implem
663 659 // 路段时长
664 660 Double sectionTime = map.get("sectionTime").equals("") ? null : Double.valueOf(map.get("sectionTime").toString());
665 661 // 路段路由
666   - Integer sectionrouteCode = map.get("sectionrouteCode").equals("") ? null : Integer.valueOf(map.get("sectionrouteCode").toString());
  662 +// Integer sectionrouteCode = map.get("sectionrouteCode").equals("") ? null : Integer.valueOf(map.get("sectionrouteCode").toString());
  663 + Integer sectionrouteCode = 100;
667 664 SectionRouteCache resultS = routeCacheRepository.findOne(sectionRouteId);
668 665 int old_code = resultS.getSectionrouteCode();
669 666 if(sectionrouteCode!=null) {
... ...
src/main/java/com/bsth/service/impl/StationRouteServiceImpl.java
... ... @@ -1172,7 +1172,7 @@ public class StationRouteServiceImpl extends BaseServiceImpl&lt;StationRoute, Integ
1172 1172  
1173 1173 tempM.put("stationCode", objects.get(i)[19]);
1174 1174  
1175   - tempM.put("stationName", objects.get(i)[20]);
  1175 + tempM.put("stationRouteName", objects.get(i)[20]);
1176 1176  
1177 1177 tempM.put("stationRoadCoding", objects.get(i)[21]);
1178 1178  
... ...
src/main/java/com/bsth/service/impl/StationServiceImpl.java
... ... @@ -18,7 +18,6 @@ import com.alibaba.fastjson.JSONObject;
18 18 import com.bsth.common.ResponseCode;
19 19 import com.bsth.entity.Line;
20 20 import com.bsth.entity.LineInformation;
21   -import com.bsth.entity.LineVersions;
22 21 import com.bsth.entity.Section;
23 22 import com.bsth.entity.SectionRoute;
24 23 import com.bsth.entity.SectionRouteCache;
... ... @@ -34,7 +33,6 @@ import com.bsth.repository.SectionRouteRepository;
34 33 import com.bsth.repository.StationRepository;
35 34 import com.bsth.repository.StationRouteCacheRepository;
36 35 import com.bsth.repository.StationRouteRepository;
37   -import com.bsth.service.LineVersionsService;
38 36 import com.bsth.service.StationService;
39 37 import com.bsth.util.GetUIDAndCode;
40 38 import com.bsth.util.TransGPS;
... ... @@ -89,8 +87,6 @@ public class StationServiceImpl extends BaseServiceImpl&lt;Station, Integer&gt; implem
89 87 @Autowired
90 88 LineVersionsRepository lineVersionsRepository;
91 89  
92   - private GeoUtils geoUtils;
93   -
94 90 Logger logger = LoggerFactory.getLogger(this.getClass());
95 91  
96 92 /**
... ... @@ -895,6 +891,156 @@ public class StationServiceImpl extends BaseServiceImpl&lt;Station, Integer&gt; implem
895 891 }
896 892  
897 893 /**
  894 + * @Description :TODO(新增缓存站点保存)
  895 + */
  896 + @Transactional
  897 + @Override
  898 + public Map<String, Object> stationCacheSave(Map<String, Object> map) {
  899 + Map<String, Object> resultMap = new HashMap<String, Object>();
  900 + try {
  901 + // 站点编码
  902 + String stationCod = "";
  903 + // 站点ID
  904 + Integer stationId = null;
  905 + // 站点名称
  906 + String zdmc = map.get("zdmc").equals("") ? "" : map.get("zdmc").toString();
  907 + // 方向
  908 + Integer directions = map.get("directions").equals("") ? null : Integer.parseInt(map.get("directions").toString());
  909 + // 原坐标点
  910 + String bJwpoints = map.get("bJwpoints").equals("") ? "" : map.get("bJwpoints").toString();
  911 + String bJwpointsArray[] = null;
  912 + if(bJwpoints!=null) {
  913 + bJwpointsArray = bJwpoints.split(" ");
  914 + }
  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 + // 距离
  988 + Double distances = map.get("distances").equals("") ? 0.0d : Double.parseDouble(map.get("distances").toString());
  989 + // 时间
  990 + Double toTime = map.get("toTime").equals("") ? 0.0d : Double.parseDouble(map.get("toTime").toString());
  991 + // 站点路由名称
  992 + String stationName = map.get("stationName").equals("") ? "" : map.get("stationName").toString();
  993 + // 线路ID
  994 + int line = map.get("lineId").equals("") ? 0 : Integer.parseInt(map.get("lineId").toString());
  995 + // 线路信息
  996 + Line resultLine = lineRepository.findOne(line);
  997 + // 站点路由序号
  998 + String stationRouteCodeStr = map.get("stationRouteCode").equals("") ? "" : map.get("stationRouteCode").toString();
  999 + // 站点类型
  1000 + String stationMark = map.get("stationMark").equals("") ? "" : map.get("stationMark").toString();
  1001 + Integer stationRouteCode = null;
  1002 + if(stationRouteCodeStr!="") {
  1003 + String stationRouteCodeArray [] = stationRouteCodeStr.split("_");
  1004 + stationRouteCode = Integer.parseInt(stationRouteCodeArray[0].toString())+1;
  1005 + }else {
  1006 + stationRouteCode = 100;
  1007 + }
  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);
  1035 + resultMap.put("status", ResponseCode.SUCCESS);
  1036 + } catch (Exception e) {
  1037 + resultMap.put("status", ResponseCode.ERROR);
  1038 + logger.error("save erro.", e);
  1039 + }
  1040 + return resultMap;
  1041 + }
  1042 +
  1043 + /**
898 1044 * @Description :TODO(更新站点保存)
899 1045 *
900 1046 * @param map <bJwpoints:中心点百度坐标;bPolygonGrid:多边形图形百度坐标;dbType:原坐标类型;
... ... @@ -918,7 +1064,7 @@ public class StationServiceImpl extends BaseServiceImpl&lt;Station, Integer&gt; implem
918 1064 String stationCod = map.get("stationCod").equals("") ? "" : map.get("stationCod").toString();
919 1065 String zdmc = map.get("zdmc").equals("") ? "" : map.get("zdmc").toString();
920 1066 // 站点名称
921   - String stationName = map.get("stationName").equals("") ? "" : map.get("stationName").toString();
  1067 + String stationRouteName = map.get("stationName").equals("") ? "" : map.get("stationName").toString();
922 1068 // 所在道路编码
923 1069 String roadCoding = map.get("roadCoding").equals("") ? "" : map.get("roadCoding").toString();
924 1070 // 经纬坐标类型
... ... @@ -1005,7 +1151,7 @@ public class StationServiceImpl extends BaseServiceImpl&lt;Station, Integer&gt; implem
1005 1151 Station station = repository.findOne(stationId);
1006 1152 Line line = lineRepository.findOne(LineId);
1007 1153 StationRoute stationRoute = new StationRoute();
1008   - stationRoute.setStationName(stationName);
  1154 + stationRoute.setStationName(stationRouteName);
1009 1155 stationRoute.setId(stationRouteId);
1010 1156 stationRoute.setStationRouteCode(stationRouteCode);
1011 1157 stationRoute.setStation(station);
... ... @@ -1201,7 +1347,6 @@ public class StationServiceImpl extends BaseServiceImpl&lt;Station, Integer&gt; implem
1201 1347 // 保存路段
1202 1348 sectionRouteRepository.save(sectionRoute);
1203 1349 }
1204   -
1205 1350 }
1206 1351  
1207 1352 /**
... ... @@ -1222,10 +1367,10 @@ public class StationServiceImpl extends BaseServiceImpl&lt;Station, Integer&gt; implem
1222 1367 String libraryPointstr = s.getbJwpoints();
1223 1368 String points[] = libraryPointstr.toString().split(" ");
1224 1369 Point center = new Point(Double.parseDouble(points[0]), Double.parseDouble(points[1]));
1225   - // 在40m内认为是同一个站点
1226   - Circle circle = new Circle(center, 40);
  1370 + // 在60m内认为是同一个站点
  1371 + Circle circle = new Circle(center, 60);
1227 1372 // 匹配到了用数据库中的点替换
1228   - if (geoUtils.isPointInCircle(point, circle)) {
  1373 + if (GeoUtils.isPointInCircle(point, circle)) {
1229 1374 map.put("name", s.getStationName().toString());
1230 1375 map.put("potion_lng", points[0]);
1231 1376 map.put("potion_lat", points[1]);
... ... @@ -1716,4 +1861,36 @@ public class StationServiceImpl extends BaseServiceImpl&lt;Station, Integer&gt; implem
1716 1861 }
1717 1862 return resultMap;
1718 1863 }
  1864 +
  1865 + /**
  1866 + * @Description :TODO(引用当前版本)
  1867 + */
  1868 + @Override
  1869 + @Transactional
  1870 + public Map<String, Object> referenceCurrentVersion(Map<String, Object> map) {
  1871 + Map<String, Object> resultMap = new HashMap<String, Object>();
  1872 + try {
  1873 + Integer lineId = Integer.parseInt(map.get("lineId").toString());
  1874 + Integer dir = Integer.parseInt(map.get("directions").toString());
  1875 + List<StationRoute> stationRoutes = routeRepository.findByLine(lineId, dir);
  1876 + List<SectionRoute> sectionRoutes = sectionRouteRepository.findByLine(lineId, dir);
  1877 + // 删除缓存路由数据
  1878 + routeCacheRepository.stationRouteCacheDel(lineId, dir);
  1879 + sectionRouteCacheRepository.sectionRouteCacheDel(lineId, dir);
  1880 + // 当前版本路由保存到缓存路由
  1881 + List<StationRouteCache> stationRouteCaches = JSONArray.parseArray(JSON.toJSONString(stationRoutes), StationRouteCache.class);
  1882 + List<SectionRouteCache> sectionRouteCaches = JSONArray.parseArray(JSON.toJSONString(sectionRoutes), SectionRouteCache.class);
  1883 + for(StationRouteCache sr:stationRouteCaches) {
  1884 + routeCacheRepository.save(sr);
  1885 + }
  1886 + for(SectionRouteCache sr:sectionRouteCaches) {
  1887 + sectionRouteCacheRepository.save(sr);
  1888 + }
  1889 + resultMap.put("status", ResponseCode.SUCCESS);
  1890 + } catch (Exception e) {
  1891 + resultMap.put("status", ResponseCode.ERROR);
  1892 + logger.error("save erro.", e);
  1893 + }
  1894 + return resultMap;
  1895 + }
1719 1896 }
1720 1897 \ No newline at end of file
... ...
src/main/resources/static/pages/base/line/addstation.html 0 → 100644
  1 +<!-- 新增站点 -->
  2 +<div class="modal fade" id="add_station_mobal" role="basic" aria-hidden="true">
  3 + <div class="modal-dialog">
  4 + <div class="modal-content">
  5 + <div class="modal-header">
  6 + <button type="button" class="close" data-dismiss="modal" aria-hidden="true"></button>
  7 + <h4 class="modal-title">新增站点</h4>
  8 + </div>
  9 + <div class="modal-body">
  10 + <form class="form-horizontal" role="form" id="add_station_form" action="/module" method="post">
  11 + <div class="alert alert-danger display-hide"> <button class="close" data-close="alert"></button>
  12 + 您的输入有误,请检查下面的输入项
  13 + </div>
  14 + <!-- 线路ID -->
  15 + <input type="hidden" name="lineId" id="lineIdInput" value="" />
  16 + <input type="hidden" name="bPolygonGrid" id="bPolygonGridInput" value="" />
  17 + <input type="hidden" name="gPolygonGrid" id="gPolygonGridInput" value="" />
  18 + <input type="hidden" name="gJwpoints" id="gJwpointsInput">
  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 + <!-- 站点路由名称 -->
  34 + <div class="form-body">
  35 + <div class="form-group">
  36 + <label class="control-label col-md-3">
  37 + <span class="required"> * </span> 站点路由名称:
  38 + </label>
  39 + <div class="col-md-6">
  40 + <input type="text" class="form-control" name="stationName" id="stationNameInput" placeholder="站点路由名称">
  41 + </div>
  42 + </div>
  43 + </div>
  44 + <!-- 站点编码 -->
  45 + <div class="form-body">
  46 + <div class="form-group">
  47 + <label class="control-label col-md-3">
  48 + <span class="required"> * </span>站点编码&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:
  49 + </label>
  50 + <div class="col-md-6">
  51 + <input type="text" class="form-control" name="stationCod" id="stationCodInput" readonly="readonly">
  52 + </div>
  53 + </div>
  54 + </div>
  55 + <!-- 站点方向 -->
  56 + <div class="form-body">
  57 + <div class="form-group">
  58 + <label class="control-label col-md-3">
  59 + <span class="required"> * </span>站点方向&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:
  60 + </label>
  61 + <div class="col-md-6">
  62 + <select name="directions" class="form-control" id="stationdirSelect">
  63 + <option value="">-- 请选择站点类型 --</option>
  64 + <option value="0">上行</option>
  65 + <option value="1">下行</option>
  66 + </select>
  67 + </div>
  68 + </div>
  69 + </div>
  70 +
  71 + <!-- 站点序号 -->
  72 + <div class="form-body">
  73 + <div class="form-group">
  74 + <label class="control-label col-md-3">
  75 + <span class="required"> * </span>站点序号&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:
  76 + </label>
  77 + <div class="col-md-6">
  78 + <select name="stationRouteCode" class="form-control" id="stationrouteSelect" style="width:100%"></select>
  79 + <span class="help-block">说明:选择的站点将作为本站序号的参考,成为选择站点的下一站。 </span>
  80 + </div>
  81 + </div>
  82 + </div>
  83 +
  84 + <!-- 站点类型 -->
  85 + <div class="form-body">
  86 + <div class="form-group">
  87 + <label class="control-label col-md-3">
  88 + <span class="required"> * </span>站点类型&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:
  89 + </label>
  90 + <div class="col-md-6">
  91 + <select name="stationMark" class="form-control" id="stationMarkSelect">
  92 + <option value="">-- 请选择站点类型 --</option>
  93 + <option value="B">起点站</option>
  94 + <option value="Z">中途站</option>
  95 + <option value="E">终点站</option>
  96 + <option value="T">停车场</option>
  97 + </select>
  98 + </div>
  99 + </div>
  100 + </div>
  101 + <!-- 中心位置坐标点 -->
  102 + <div class="form-body">
  103 + <div class="form-group">
  104 + <label class="col-md-3 control-label"><span class="required"> * </span>经纬度坐标点:</label>
  105 + <div class="col-md-6">
  106 + <input type="text" class="form-control" name="bJwpoints" id="bJwpointsInput">
  107 + </div>
  108 + </div>
  109 + </div>
  110 + <!-- 几何图形类型 -->
  111 + <div class="form-body">
  112 + <div class="form-group">
  113 + <label class="col-md-3 control-label"><span class="required"> * </span>几何图形类型:</label>
  114 + <div class="col-md-6">
  115 + <input type="text" class="form-control" name="shapesType" id="shapesTypeSelect" placeholder="几何图形类型" readonly="readonly">
  116 + </div>
  117 + </div>
  118 + </div>
  119 + <!-- 圆形半径 -->
  120 + <div class="form-body" id="radiusGroup">
  121 + <div class="form-group">
  122 + <label class="col-md-3 control-label"><span class="required"> * </span>圆形半径&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</label>
  123 + <div class="col-md-6">
  124 + <input type="text" class="form-control" name="radius" id="radiusInput" placeholder="圆形半径">
  125 + </div>
  126 + </div>
  127 + </div>
  128 + <!-- 是否撤销 -->
  129 + <div class="form-body">
  130 + <div class="form-group">
  131 + <label class="col-md-3 control-label"><span class="required"> * </span>是否撤销&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</label>
  132 + <div class="col-md-6">
  133 + <select name="destroy" class="form-control" id="destroySelect">
  134 + <option value="">-- 请选择撤销类型 --</option>
  135 + <option value="0">否</option>
  136 + <option value="1">是</option>
  137 + </select>
  138 + </div>
  139 + </div>
  140 + </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 + <!-- 到站时间 -->
  152 + <div class="form-body">
  153 + <div class="form-group">
  154 + <label class="col-md-3 control-label">到站时间&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</label>
  155 + <div class="col-md-6">
  156 + <input type="text" class="form-control" name="toTime" id="toTimeInput" >
  157 + <span class="help-block">单位:分钟(min)</span>
  158 + </div>
  159 + </div>
  160 + </div>
  161 + <!-- 到站距离 -->
  162 + <div class="form-body">
  163 + <div class="form-group">
  164 + <label class="col-md-3 control-label">到站距离&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</label>
  165 + <div class="col-md-6">
  166 + <input type="text" class="form-control" name="distances" id="distancesInput" >
  167 + <span class="help-block">单位:公里(km)</span>
  168 + </div>
  169 + </div>
  170 + </div>
  171 + <!-- 版本号 -->
  172 + <div class="form-body">
  173 + <div class="form-group">
  174 + <label class="col-md-3 control-label">版本号&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</label>
  175 + <div class="col-md-6">
  176 + <input type="text" class="form-control" name="versions" id='versionsInput' Readonly>
  177 + </div>
  178 + </div>
  179 + </div>
  180 +
  181 + <!-- 描述/说明 -->
  182 + <div class="form-group">
  183 + <label class="control-label col-md-3"> 描述/说明&nbsp;&nbsp;&nbsp;&nbsp;: </label>
  184 + <div class="col-md-6">
  185 + <textarea class="form-control" rows="3" name="descriptions" id="descriptionsTextarea" placeholder="描述/说明"></textarea>
  186 + </div>
  187 + </div>
  188 + </form>
  189 + </div>
  190 + <div class="modal-footer">
  191 + <button type="button" class="btn default" data-dismiss="modal" id="addMobalHiden">取消</button>
  192 + <button type="button" class="btn btn-primary" id="addStationButton">提交数据</button>
  193 + </div>
  194 + </div>
  195 + </div>
  196 +</div>
  197 +<script type="text/javascript">
  198 +$('#add_station_mobal').on('AddStationMobal.show', function(e, addMap,ajaxd,staobj,editRoute,fun){
  199 + var Station = staobj;
  200 + var Line = editRoute.getLineObj();
  201 + // 延迟加载
  202 + setTimeout(function(){
  203 + // 显示mobal
  204 + $('#add_station_mobal').modal({show : true,backdrop: 'static', keyboard: false});
  205 + },200);
  206 + // 当调用 hide 实例方法时触发
  207 + $('#add_station_mobal').on('hide.bs.modal', function () {
  208 + closeMobleSetClean();
  209 + });
  210 + // 当模态框对用户可见时触发(将等待 CSS 过渡效果完成)。
  211 + $('#add_station_mobal').on('show.bs.modal', function () {
  212 + // 获取站点编码元素,添加站点编码值
  213 + ajaxd.getStationCode(function(stationCode) {
  214 + // 线路ID.
  215 + $('#lineIdInput').val(Line.id);
  216 + // 获取站点名称元素设值.
  217 + $('#zdmcInput').val(Station.stationNamebootbox);
  218 + // 获取站点路由名称元素设值.
  219 + $('#stationNameInput').val(Station.stationNamebootbox);
  220 + // 站点编码.
  221 + $('#stationCodInput').val(stationCode).attr('Readonly','Readonly');
  222 + // 获取方向元素,并添加值.
  223 + $('#stationdirSelect').val(Line.dir).attr('Readonly','Readonly');
  224 + // 百度地图经纬度坐标中心点.
  225 + $('#bJwpointsInput').val(Station.bJwpoints).attr('Readonly','Readonly');
  226 + // 百度坐标点图形集合.
  227 + $('#bPolygonGridInput').val(Station.bPolygonGrid);
  228 + // 获取图形类型元素,并添加值
  229 + if(Station.shapesType=='r')
  230 + $('#shapesTypeSelect').val('圆形');
  231 + else if(Station.shapesType=='d') {
  232 + $('#radiusGroup').hide();
  233 + $('#shapesTypeSelect').val('多边形');
  234 + }
  235 + // 获取圆形半径元素,并添加值
  236 + $('#radiusInput').val(Station.radius);
  237 + // 是否撤销
  238 + $('#destroySelect').val(0);
  239 +
  240 + var initzdlyP = {'lineId':Line.id,'destroy':0,'direction':Line.dir};
  241 + initSelect(initzdlyP);
  242 + });
  243 + });
  244 + // 站点序号值改变事件
  245 + $('#stationrouteSelect').on('change',function() {
  246 + var stationRValue = $('#stationrouteSelect').val();
  247 + if(stationRValue=='请选择...') {
  248 + $('#stationMarkSelect').val('B');
  249 + }else {
  250 + var tempStr = stationRValue.split('_');
  251 + if(tempStr[1] == 'E') {
  252 + $('#stationMarkSelect').val('E');
  253 + }else {
  254 + $('#stationMarkSelect').val('Z');
  255 + }
  256 + }
  257 + });
  258 + // 获取表单元素
  259 + var form = $('#add_station_form');
  260 + // 获取错误提示信息元素
  261 + var error = $('.alert-danger', form);
  262 + //提交
  263 + $('#addStationButton').on('click', function() {
  264 + // 表单提交
  265 + form.submit();
  266 + });
  267 + // 表单验证
  268 + form.validate({
  269 + errorElement : 'span',
  270 + errorClass : 'help-block help-block-error',
  271 + focusInvalid : true,
  272 + rules : {
  273 + 'stationName' : {required : true,maxlength : 50,},// 站点名称 必填项
  274 + 'stationCod': {required : true,},// 站点编码 必填项 必须输入合法的数字(负数,小数)。
  275 + 'directions' : {required : true,dirIs : true},// 站点方向 必填项 必填项
  276 + 'stationRouteCode' : {isStart : true},// 站点序号
  277 + 'stationMark' : {required : true,},// 站点类型 必填项.
  278 + 'bJwpoints' : {required : true,},// 经纬度坐标点 必填项.
  279 + 'shapesType' : {required : true,},// 几何图形类型 必填项.
  280 + 'radius' : {required : true,},// 几何图形类型 必填项.
  281 + 'destroy' : {required : true,},// 是否撤销 必填项.
  282 + 'toTime' : {number : true},// 到站时间 必须输入合法的数字(负数,小数)。
  283 + 'distances' : {number : true},// 到站距离 必须输入合法的数字(负数,小数)。
  284 + 'descriptions' : {maxlength: 150}// 描述与说明 // 描述与说明
  285 +
  286 + },
  287 + invalidHandler : function(event, validator) {
  288 + error.show();
  289 + App.scrollTo(error, -200);
  290 + },
  291 + highlight : function(element) {
  292 + $(element).closest('.form-group').addClass('has-error');
  293 + },
  294 + unhighlight : function(element) {
  295 + $(element).closest('.form-group').removeClass('has-error');
  296 + },
  297 + success : function(label) {
  298 + label.closest('.form-group').removeClass('has-error');
  299 + },
  300 + submitHandler : function(f) {
  301 + var params = form.serializeJSON();
  302 + error.hide();
  303 + if(params.shapesType=='圆形')
  304 + params.shapesType='r';
  305 + else if(params.shapesType=='多边形')
  306 + params.shapesType='d';
  307 + if(params.stationRouteCode=='请选择...')
  308 + params.stationRouteCode='';
  309 + // 保存
  310 + ajaxd.stationCacheSave(params,function(data) {
  311 + if(data.status=='SUCCESS') {
  312 + // 弹出添加成功提示消息
  313 + layer.msg('添加成功...');
  314 + }else {
  315 + // 弹出添加失败提示消息
  316 + layer.msg('添加失败...');
  317 + }
  318 + closeMobleSetClean();
  319 + // 隐藏moble
  320 + hideMoble();
  321 + });
  322 + }
  323 + });
  324 + function initSelect(p){
  325 + ajaxd.getzdlyInfo(p,function(array) {
  326 + // 定义路段路由长度、渲染拼音检索下拉框格式数据.
  327 + var len_ = array.length,paramsD = new Array();
  328 + if(len_>0) {
  329 + paramsD.push({'id':'请选择...','text':'请选择...'});
  330 + // 遍历.
  331 + $.each(array, function(i, g){
  332 + // 判断.
  333 + if(g.name!='' || g.name != null) {
  334 + // 添加拼音检索下拉框格式数据数组.
  335 + paramsD.push({'id':g.stationRouteCode + '_' + g.stationMark + '_' + g.directions,
  336 + 'text':g.stationName + ' (' + g.stationRouteCode + ')' + ' --' + fun.dirdmToName(g.directions)});
  337 + }
  338 + });
  339 + $('#stationrouteSelect').empty();
  340 + // 初始化上一个路段拼音检索下拉框.
  341 + initPinYinSelect2($('#stationrouteSelect'),paramsD,function(selector) {
  342 + });
  343 + }
  344 + });
  345 + }
  346 + function closeMobleSetClean() {
  347 + // 清除地图覆盖物
  348 + addMap.clearMarkAndOverlays();
  349 + // 刷新站点列表
  350 + $('#station').click();
  351 + }
  352 + function hideMoble() {
  353 + // 隐藏mobal
  354 + $('#add_station_mobal').modal('hide');
  355 + }
  356 + // 当站点类型为中途站或者终点站时,上一站点为必填项!
  357 + $.validator.addMethod("isStart", function(value,element) {
  358 + var tel = false;
  359 + var stationMarkV = $('#stationMarkSelect').val();
  360 + var stationrouteSelectV = $('#stationrouteSelect').val();
  361 + if(stationMarkV =='B'){
  362 + tel = true;
  363 + return tel;
  364 + }else if(stationMarkV =='Z' || stationMarkV =='E'){
  365 + if(stationrouteSelectV!='' && stationrouteSelectV!='请选择...' && stationrouteSelectV!=null){
  366 + tel = true;
  367 + return tel;
  368 + }
  369 + }
  370 + return tel;
  371 + }, '当站点类型为中途站或者终点站时,上一站点为必填项!');
  372 + // 方向
  373 + $.validator.addMethod("dirIs", function(value,element) {
  374 + var tel = true;
  375 + var stationMarkV = $('#stationdirSelect').val();
  376 + if(stationMarkV!=Line.dir){
  377 + tel = false;
  378 + }
  379 + return tel;
  380 + }, '方向必须一致!');
  381 +});
  382 +</script>
0 383 \ No newline at end of file
... ...
src/main/resources/static/pages/base/line/addstation_select.html 0 → 100644
  1 +<!-- 选择站点新增方式 -->
  2 +<div class="modal fade" id="addstation_select_mobal" tabindex="-1" role="basic" aria-hidden="true">
  3 + <div class="modal-dialog">
  4 + <div class="modal-content">
  5 + <div class="modal-header">
  6 + <button type="button" class="close" data-dismiss="modal" aria-hidden="true"></button>
  7 + <h4 class="modal-title">站点新增方式
  8 + <i class="fa fa-question-circle tipso-animation" style="color: rgba(158, 158, 158, 0.49);"></i>
  9 + </h4>
  10 + </div>
  11 + <div class="modal-body">
  12 + <form class="form-horizontal" action="/" method="post" id="formBootbox" role="form">
  13 + <div class="alert alert-danger display-hide" id="requiredname">
  14 + <button class="close" data-close="alert"></button>
  15 + 站点名称为必填项
  16 + </div>
  17 + <!-- 站点名称 -->
  18 + <div class="form-group" id="formRequ">
  19 + <label class="col-md-3 control-label"><span class="required"> * </span>站点名称:</label>
  20 + <div class="col-md-9">
  21 + <input type="text" class="form-control input-medium" id="stationNamebootboxInput" name="stationNamebootbox">
  22 + </div>
  23 + </div>
  24 + <!-- 新增方式 -->
  25 + <div class="form-group">
  26 + <label class="col-md-3 control-label">新增方式:</label>
  27 + <div class="col-md-9">
  28 + <div class="icheck-list">
  29 + <label>
  30 + <input type="radio" class="icheck" name="baseRes" value=0 checked> 系统生成
  31 + </label>
  32 + <label >
  33 + <input type="radio" class="icheck" name="baseRes" value=1 > 手动添加
  34 + </label>
  35 + </div>
  36 + </div>
  37 + </div>
  38 + </form>
  39 + </div>
  40 + <div class="modal-footer">
  41 + <button type="button" class="btn default" data-dismiss="modal">取消</button>
  42 + <button type="button" class="btn btn-primary" id="addSelectnextButton">下一步</button>
  43 + </div>
  44 + </div>
  45 + </div>
  46 +</div>
  47 +<script type="text/javascript">
  48 +$('#addstation_select_mobal').on('AddSelectMobal.show', function(e,map_,drw,ajaxd_,editRoute,fun){
  49 + var stationObj = {};
  50 + // 加载显示mobal
  51 + $('#addstation_select_mobal').modal({show : true,backdrop: 'static', keyboard: false});
  52 + setTimeout(function(){
  53 + var offsetY = $('.modal-dialog').offset().top-3 ,
  54 + offsetX = $('.modal-dialog').offset().left-10 ;
  55 + $('.tipso-animation').tipso({
  56 + speed : 100,
  57 + background : '#0ed0e8',
  58 + color : '#ffffff',
  59 + position :'right',
  60 + width : 390,
  61 + delay : 400,
  62 + animationIn : 'bounceIn',
  63 + animationOut : 'bounceOut',
  64 + offsetX : -(offsetX),
  65 + offsetY : -(offsetY),
  66 + content :'<span style="display:block; float:left;font-size:x-small;line-height:10px">A)系统生成:根据站点名称自动生成以150米为半径范围的圆.</span></br>'+
  67 + '<span style="display:block; float:left;font-size:x-small">B)手动添加:手动在地图上画出站点范围,然后双击鼠标右键保存.</span>',
  68 +
  69 + });
  70 + $('.tipso-animation').tipso('show');
  71 + setTimeout(function(){$('.tipso-animation').tipso('hide');},4000);
  72 + },500);
  73 + // 获取表单元素
  74 + var form = $('#formBootbox');
  75 + // 错误提示元素
  76 + var requiredname = $('#requiredname', form);
  77 + // 下一步点击事件
  78 + $('#addSelectnextButton').on('click', function() {
  79 + // 表单提交
  80 + form.submit();
  81 + });
  82 + // 表单验证
  83 + form.validate({
  84 + errorElement : 'span',
  85 + errorClass : 'help-block help-block-error',
  86 + focusInvalid : false,
  87 + rules : {
  88 + 'stationNamebootbox' : {required : true,maxlength : 50}// 必填项 最大长度为50
  89 + },
  90 + invalidHandler : function(event, validator) {
  91 + requiredname.show();
  92 + App.scrollTo(requiredname, -200);
  93 + },
  94 + highlight : function(element) {
  95 + $(element).closest('.form-group').addClass('has-error');
  96 + },
  97 + unhighlight : function(element) {
  98 + $(element).closest('.form-group').removeClass('has-error');
  99 + },
  100 + success : function(label) {
  101 + label.closest('.form-group').removeClass('has-error');
  102 + },
  103 + submitHandler : function(f) {
  104 + // 隐藏错误提示
  105 + requiredname.hide();
  106 + // 表单序列化
  107 + var params = form.serializeJSON();
  108 + var stationName = params.stationNamebootbox;
  109 + // 获取新增站点方式
  110 + var baseRes = params.baseRes;
  111 + /** 设置新增站点对象站点名称属性值 @param:<stationName:站点名称)> */
  112 + stationObj.stationNamebootbox = stationName;
  113 + // 系统生成
  114 + if(baseRes == 0) {
  115 + /** 根据站点位置获取坐标 @parma:<stationName:站点名称;callback:返回函数> */
  116 + map_.localSearchFromAdreesToPoint(stationName,function(Points) {
  117 + if(Points) {
  118 + /** 设置新增站点集合对象站点中心点百度坐标属性值 @param:<bJwpoints:中心点百度坐标) */
  119 + stationObj.bJwpoints = Points;
  120 + /** 设置新增站点集合对象范围图形类型属性值 @param:<shapesType:范围图形类型) */
  121 + stationObj.shapesType = 'r';
  122 + /** 设置新增站点集合对象圆形半径属性值 @param:<radius:圆形半径) */
  123 + stationObj.radius = 100;
  124 + /** 设置新增站点集合对象图形百度坐标集合属性值 @param:<bPolygonGrid:图形百度坐标集合) */
  125 + stationObj.bPolygonGrid = '';
  126 + // 以藏站点新增方式mobal
  127 + $('#addstation_select_mobal').modal('hide');
  128 + // 加载add页面
  129 + $.get('addstation.html', function(m){
  130 + $(pjaxContainer).append(m);
  131 + $('#add_station_mobal').trigger('AddStationMobal.show', [map_,ajaxd_,stationObj,editRoute,fun]);
  132 + });
  133 + }else {
  134 + // 返回坐标为空
  135 + layer.confirm('【系统无法生成,请选择其他方式新增】', {btn : [ '返回' ],icon: 3, title:'提示' }, function(index){
  136 + layer.close(index);
  137 + });
  138 + }
  139 + });
  140 + }else if(baseRes==1) {
  141 + // 关闭按钮事件
  142 + fun.addAChangeCssAddDisabled();
  143 + map_.clearMarkAndOverlays();
  144 + // 以藏站点新增方式mobal
  145 + $('#addstation_select_mobal').modal('hide');
  146 + // 打开绘制工具
  147 + $('.leftUtils').removeClass('hidden');
  148 + drw.openPointDrawingManager(stationObj,'add');
  149 + drw.drawingManagerClose();
  150 + map_.localtionPoint(stationName);
  151 + }
  152 + }
  153 + });
  154 +});
  155 +</script>
0 156 \ No newline at end of file
... ...
src/main/resources/static/pages/base/line/css/bmap_base.css
... ... @@ -12,6 +12,17 @@ html,body{
12 12 overflow:hidden;
13 13 }
14 14  
  15 +/* 绘画工具栏 */
  16 +.leftUtils{
  17 + position: absolute;
  18 + padding-right: 100px;
  19 + width: 100%;
  20 + height: 40px;
  21 + z-index: 9999;
  22 + padding-top: 7px;
  23 + top: 40px;
  24 +}
  25 +
15 26 .caption {
16 27 color: white;
17 28 font-size: 18px;
... ...
src/main/resources/static/pages/base/line/editRoute.html
... ... @@ -4,7 +4,7 @@
4 4  
5 5 <div class="modal-dialog">
6 6  
7   - <div class="modal-content">
  7 + <div class="modal-content" >
8 8  
9 9 <div class="modal-header">
10 10 <button type="button" class="close" data-dismiss="modal"
... ... @@ -74,6 +74,7 @@
74 74 <div class="modal-footer">
75 75 <button type="button" class="btn default" data-dismiss="modal"
76 76 id="addMobalHiden">取消</button>
  77 +<!-- <button type="button" class="btn btn-primary hidden" id="referenceCurrentVersion">引用当前版本</button> -->
77 78 <button type="button" class="btn btn-primary" id="templateSaveData">提交数据</button>
78 79 </div>
79 80 </div>
... ... @@ -139,7 +140,7 @@ $(&#39;#edit_route_mobal&#39;).on(&#39;editRouteMobal.show&#39;, function(e,transGPS,editRoute,m
139 140  
140 141 },
141 142 submitHandler : function(f) {
142   - // 隐藏手动规划弹出层
  143 + // 隐藏弹出层
143 144 $('#edit_route_mobal').modal('hide');
144 145 // 获取线路对象
145 146 var line = editRoute.getLineObj();
... ... @@ -151,6 +152,8 @@ $(&#39;#edit_route_mobal&#39;).on(&#39;editRouteMobal.show&#39;, function(e,transGPS,editRoute,m
151 152 // 路线方向
152 153 var directionData = $("input[name='dirCheck']:checked").val();
153 154 editRoute.setLineDir(directionData);
  155 + // 设置线路对象生成方式
  156 + editRoute.setLineGenerationType('uploadGPS');
154 157 // 弹出正在加载层
155 158 var i = layer.load(2);
156 159 // 表单序列化
... ... @@ -256,6 +259,44 @@ $(&#39;#edit_route_mobal&#39;).on(&#39;editRouteMobal.show&#39;, function(e,transGPS,editRoute,m
256 259 return bdEn;
257 260 }
258 261  
  262 + /** 引用当前版本站点和走向*/
  263 + /* $("#referenceCurrentVersion").on('click',function() {
  264 + // 获取线路对象
  265 + var line = editRoute.getLineObj();
  266 + // 路线方向
  267 + var direction = $("input[name='dirCheck']:checked").val();
  268 + // 设置线路对象方向
  269 + editRoute.setLineDir(direction);
  270 + // 设置线路对象生成方式
  271 + editRoute.setLineGenerationType('cite');
  272 + $.post("/station/referenceCurrentVersion",{'lineId' : line.id , 'directions' : direction},function(rd){
  273 + // 隐藏弹出层
  274 + $('#edit_route_mobal').modal('hide');
  275 + // 关闭弹出层
  276 + layer.closeAll();
  277 + if(rd.status='SUCCESS') {
  278 + // 清除地图覆盖物
  279 + map.clearMarkAndOverlays();
  280 + // 查询路段信息
  281 + var params = {};
  282 + params.lineId=line.id;
  283 + params.dir = direction;
  284 + // 查询路段信息
  285 + $get('/sectionroute/findCacheSection',params,function(data) {
  286 + // 在地图上画出线路走向
  287 + fun.linePanlThree(line.id,data,direction);
  288 + });
  289 + $('#route_show').removeClass('hidden');
  290 + $('#generationRoute_div').addClass('hidden');
  291 + // 刷新路段列表
  292 + $('#section').click();
  293 + layer.msg('引用当前版本成功!');
  294 + }else {
  295 + layer.msg('引用当前版本失败,请重新引用或选择其他方式!');
  296 + }
  297 + })
  298 + }); */
  299 +
259 300 function addSave(params,lineid,directionData) {
260 301 // 保存
261 302 $post("/station/cacheSave",params,function(rd) {
... ... @@ -276,14 +317,20 @@ $(&#39;#edit_route_mobal&#39;).on(&#39;editRouteMobal.show&#39;, function(e,transGPS,editRoute,m
276 317 }
277 318 // 清除地图覆盖物
278 319 map.clearMarkAndOverlays();
  320 + var params = {};
  321 + params.lineId = lineid;
  322 + params.dir = directionData;
279 323 // 查询路段信息
280   - $get('/sectionroute/findSectionCache',{'line.id_eq' : lineid , 'directions_eq' : directionData},function(data) {
  324 + $get('/sectionroute/findCacheSection',params,function(data) {
281 325 // 在地图上画出线路走向
282 326 fun.linePanlThree(lineid,data,directionData);
283 327 });
284   - $('#upload_show').removeClass('hidden');
285   - $('#upload').addClass('hidden');
286   - layer.msg('请先编辑路段,并保存!!!');
  328 + $('#route_show').removeClass('hidden');
  329 + $('#generationRoute_div').addClass('hidden');
  330 + // 刷新路段列表
  331 + $('#section').click();
  332 + layer.open({title: '友情提示'
  333 + ,content: '生成路线成功,生成的线路可能会有误差。请先单击路段,拖动编辑、然后双击保存!'});
287 334 }else {
288 335 layer.msg('生成路线失败!');
289 336 }
... ...
src/main/resources/static/pages/base/line/editsection.html
... ... @@ -156,8 +156,8 @@ $(&#39;#edit_section_mobal_cache&#39;).on(&#39;editSectionMobalCache_show&#39;, function(e, map_
156 156 var dir = Section.sectionrouteDirections;
157 157 var lineId = Section.sectionrouteLine;
158 158 // 获取路段号元素,并添加下拉属性值
159   - ajaxd.getStation(lineId,dir,function(treeData) {
160   - var array = treeData[0].children[1].children,paramsD =new Array();
  159 + ajaxd.getSectionCacheList(lineId,dir,function(array) {
  160 + paramsD =new Array();
161 161 var eq_scetionRouteCode = Section.sectionrouteCode;
162 162 paramsD.push({'id':'请选择...','text':'请选择...'});
163 163 // 遍历.
... ... @@ -175,7 +175,7 @@ $(&#39;#edit_section_mobal_cache&#39;).on(&#39;editSectionMobalCache_show&#39;, function(e, map_
175 175 // 初始化上一个路段拼音检索下拉框.
176 176 initPinYinSelect2($('#sectionrouteCodeSelect'),paramsD,function(selector) {
177 177 $('#sectionDirSelect').val('');// 设值方向.
178   - ajaxd.findUpSectionRouteCode(lineId,dir,eq_scetionRouteCode,function(str) {
  178 + ajaxd.findCacheUpSectionRouteCode(lineId,dir,eq_scetionRouteCode,function(str) {
179 179 if(str.length>0){
180 180 var upStationRouteCode = str[0].sectionrouteCode;
181 181 $('#sectionrouteCodeSelect').select2('val',upStationRouteCode);
... ... @@ -196,10 +196,11 @@ $(&#39;#edit_section_mobal_cache&#39;).on(&#39;editSectionMobalCache_show&#39;, function(e, map_
196 196 map_.clearMarkAndOverlays();
197 197 /** 设置修改路段集合对象为空 */
198 198 section.setEitdSection({});
199   - // fun.editAChangeCssRemoveDisabled();
200   - $get('/sectionroute/findSectionCache',{'line.id_eq' : lineId , 'directions_eq' : dir},function(data) {
  199 + ajaxd.getSectionCacheList(lineId,dir,function(data) {
201 200 fun.linePanlThree(lineId,data,dir);
202 201 });
  202 + // 刷新路段列表
  203 + $('#section').click();
203 204 }
204 205  
205 206 // 编辑表单元素
... ... @@ -249,7 +250,7 @@ $(&#39;#edit_section_mobal_cache&#39;).on(&#39;editSectionMobalCache_show&#39;, function(e, map_
249 250 $post('/section/sectionCacheUpdate',params,function(resuntDate) {
250 251 if(resuntDate.status=='SUCCESS') {
251 252 // 弹出添加成功提示消息
252   - layer.msg('路段保存成功,将地图放到最大,用右击路段进行截取,确认截取完毕后提交!!!');
  253 + layer.msg('路段保存成功!');
253 254 }else {
254 255 // 弹出添加失败提示消息
255 256 layer.msg('路段保存失败,请重新编辑路段!!!');
... ...
src/main/resources/static/pages/base/line/editstation.html
... ... @@ -193,7 +193,7 @@
193 193 </div>
194 194 <script type="text/javascript">
195 195  
196   -$('#edit_station_mobal').on('editSelectMobal_show', function(e, map_,station,fun){
  196 +$('#edit_station_mobal').on('editSelectMobal_show', function(e, map_,ajaxd,fun,station){
197 197 layer.closeAll();
198 198 fun.setFormValue(station);
199 199 var initzdlyP = {'lineId':station.stationRouteLine,'destroy':0,'direction':station.stationRouteDirections};
... ... @@ -228,7 +228,7 @@ $(&#39;#edit_station_mobal&#39;).on(&#39;editSelectMobal_show&#39;, function(e, map_,station,fun
228 228 'zdmc' : { required : true,maxlength : 50,},// 站点名称 必填项
229 229 'stationName' : { required : true,maxlength : 50,},// 站点名称 必填项
230 230 'stationCod': {required : true,},// 站点编码 必填项
231   - 'directions' : {required : true,dirIs : true},// 站点方向 必填项 必填项
  231 + 'directions' : {required : true,dirIs : true},// 站点方向 必填项 必填项
232 232 'stationRouteCode' : {isStart : true},// 站点序号
233 233 'stationMark' : {required : true},// 站点类型 必填项
234 234 'bJwpoints' : {required : true},// 经纬度坐标点 必填项
... ... @@ -265,8 +265,6 @@ $(&#39;#edit_station_mobal&#39;).on(&#39;editSelectMobal_show&#39;, function(e, map_,station,fun
265 265 if(resuntDate.status=='SUCCESS') {
266 266 // 弹出添加成功提示消息
267 267 layer.msg('修改成功...');
268   - /** 通知更新缓存区 */
269   - $.post('http://192.168.168.171:8800/transport_server/basic/refresh',function(rs){console.log(rs)})
270 268 }else {
271 269 // 弹出添加失败提示消息
272 270 layer.msg('修改失败...');
... ... @@ -279,7 +277,6 @@ $(&#39;#edit_station_mobal&#39;).on(&#39;editSelectMobal_show&#39;, function(e, map_,station,fun
279 277 // 站点序号值改变事件
280 278 $('#stationrouteSelect').on('change',function() {
281 279 var stationRValue = $('#stationrouteSelect').val();
282   - debugger
283 280 if(stationRValue=='请选择...') {
284 281 $('#stationMarkSelect').val('B');
285 282 }else {
... ... @@ -292,7 +289,7 @@ $(&#39;#edit_station_mobal&#39;).on(&#39;editSelectMobal_show&#39;, function(e, map_,station,fun
292 289 }
293 290 });
294 291 function initSelect(p){
295   - $get('/stationroute/cacheList',p,function(array) {
  292 + ajaxd.getzdlyInfo(p,function(array) {
296 293 // 定义路段路由长度、渲染拼音检索下拉框格式数据.
297 294 var len_ = array.length,paramsD = new Array();
298 295 if(len_>0) {
... ... @@ -326,10 +323,14 @@ $(&#39;#edit_station_mobal&#39;).on(&#39;editSelectMobal_show&#39;, function(e, map_,station,fun
326 323 params.lineId = station.stationRouteLine;
327 324 params.direction = station.stationRouteDirections;
328 325 params.stationRouteCode = station.stationRouteStationRouteCode;
329   - $get('/stationroute/findCacheUpStationRouteCode',params , function(str) {
330   - debugger
  326 + ajaxd.findCacheUpStationRouteCode(params, function(str) {
331 327 if(str.length>0){
332   - var upStationRouteCode = str[0].stationRouteCode + '_' + str[0].stationRouteMarke + '_' + station.stationRouteDirections;
  328 + var upStationRouteCode;
  329 + if (station.stationRouteStationMark == 'E') {
  330 + upStationRouteCode = str[0].stationRouteCode + '_' + 'E' + '_' + station.stationRouteDirections;
  331 + } else{
  332 + upStationRouteCode = str[0].stationRouteCode + '_' + str[0].stationRouteMarke + '_' + station.stationRouteDirections;
  333 + }
333 334 $('#stationrouteSelect').select2('val',upStationRouteCode);
334 335 }else {
335 336 $('#stationrouteSelect').select2('val','请选择...');
... ...
src/main/resources/static/pages/base/line/editstation_select.html
... ... @@ -47,7 +47,7 @@
47 47 </div>
48 48 </div>
49 49 <script type="text/javascript">
50   -$('#editstation_select_mobal').on('editStationSelectMobal_show', function(e, map_,drw,stationRoute){
  50 +$('#editstation_select_mobal').on('editStationSelectMobal_show', function(e, map_,fun,drw,stationRoute){
51 51 // var sel = fun.getCurrSelNode(dir_);
52 52 // var Station = sel[0].original;
53 53 // 显示选择修改方式弹出层
... ... @@ -112,20 +112,20 @@ $(&#39;#editstation_select_mobal&#39;).on(&#39;editStationSelectMobal_show&#39;, function(e, map
112 112 var params = form.serializeJSON();
113 113 // 站点名称
114 114 stationRoute.zdmc = params.stationNamebootbox;
115   -
  115 + // 关闭按钮事件
  116 + fun.addAChangeCssAddDisabled();
116 117 if(params.editselect==0){
117   - layer.confirm('重绘站点,会修改站点编码,影响已做好的排班和线路文件。请谨慎使用,谢谢!', {
118   - btn: ['绘制','取消'] //按钮
119   - }, function(index){
120   - // 站点形状
121   - stationRoute.stationShapesType = 'd';
122   -
123   - map_.clearMarkAndOverlays();
124   - // 打开绘制工具
125   - drw.openPointDrawingManager(stationRoute);
126   - map_.localtionPoint(stationRoute.zdmc);
127   - layer.close(index);
128   - });
  118 + // 站点形状
  119 + stationRoute.stationShapesType = 'd';
  120 +
  121 + map_.clearMarkAndOverlays();
  122 + // 打开绘制工具
  123 + drw.openPointDrawingManager(stationRoute,'edit');
  124 + $('.leftUtils').removeClass('hidden');
  125 + $('.leftUtils').addClass('active');
  126 + drw.drawingManagerClose();
  127 + map_.localtionPoint(stationRoute.zdmc);
  128 + layer.close(index);
129 129 }else if(params.editselect==1){
130 130 // 弹出添加失败提示消息,2秒关闭(如果不配置,默认是3秒)
131 131 var mindex = layer.msg('编辑完图形后,请双击图形区域保存',{ offset: '126px',
... ...
src/main/resources/static/pages/base/line/js/drawingManager.js
... ... @@ -40,87 +40,97 @@ var DrawingManagerObj = function () {
40 40  
41 41 },
42 42  
43   - openPointDrawingManager : function(objStation) {
  43 + openPointDrawingManager : function(objStation, type) {
44 44  
45 45 // 打开鼠标绘画工具
46   - drawingManager.open();
47   -
48   - // 设置属性
49   - drawingManager.setDrawingMode(BMAP_DRAWING_POLYGON);
  46 + DrawingManagerObj.drawingManagerOpen();
50 47  
51 48 // 添加绘画完成事件
52 49 drawingManager.addEventListener('polygoncomplete', function(e) {
53   -
54   - drawingManager.close;
  50 + // 关闭绘画
  51 + DrawingManagerObj.drawingManagerClose();
  52 + // 隐藏绘画工具栏
  53 + $('.leftUtils').addClass('hidden');
55 54  
56 55 if (e.getPath().length <= 2) {
57   -
58 56 WorldsBMapLine.clearMarkAndOverlays();
59   - openPointDrawingManager();
60 57  
61 58 // 弹出提示消息
62   - layer.msg('坐标点不能小于等于两个,请重新绘画!');
63   -
64   - return;
65   -
66   - }else {
  59 + layer.msg('坐标点不能小于三个,请重新操作!');
67 60  
  61 + }else {
68 62 // 获取编辑的多边形对象
69   - var edit_pointE = e;
  63 + var pointE = e;
70 64  
71   - var edit_bPloygonGrid = "";
  65 + var bPloygonGrid = "";
72 66  
73   - var editPolyGonLen_ = edit_pointE.getPath().length;
  67 + var editPolyGonLen_ = pointE.getPath().length;
74 68  
75 69 for(var k =0;k<editPolyGonLen_;k++) {
76 70  
77 71 if(k==0) {
78 72  
79   - edit_bPloygonGrid = edit_pointE.getPath()[k].lng + ' ' + edit_pointE.getPath()[k].lat;
  73 + bPloygonGrid = pointE.getPath()[k].lng + ' ' + pointE.getPath()[k].lat;
80 74  
81 75 }else {
82 76  
83   - edit_bPloygonGrid = edit_bPloygonGrid + ',' + edit_pointE.getPath()[k].lng + ' ' + edit_pointE.getPath()[k].lat;
  77 + bPloygonGrid = bPloygonGrid + ',' + pointE.getPath()[k].lng + ' ' + pointE.getPath()[k].lat;
84 78  
85 79 }
86 80  
87 81 }
88 82  
89   - edit_bPloygonGrid = edit_bPloygonGrid + ',' + edit_pointE.getPath()[0].lng + ' ' + edit_pointE.getPath()[0].lat;
90   -
  83 + bPloygonGrid = bPloygonGrid + ',' + pointE.getPath()[0].lng + ' ' + pointE.getPath()[0].lat;
91 84 // 多边形中心点
92   - var centre_points = edit_pointE.getBounds().getCenter().lng + ' ' + edit_pointE.getBounds().getCenter().lat;
93   -
94   - /** 设置修改站点集合对象站点中心点百度坐标属性值 @param:<bJwpoints:中心点百度坐标) */
95   - objStation.stationBJwpoints = centre_points;
96   -
97   - /** 设置修改站点集合对象范围图形类型属性值 @param:<shapesType:范围图形类型) */
98   - objStation.stationShapesType = 'd';;
99   -
100   - /** 设置修改站点集合对象圆形半径属性值 @param:<radius:圆形半径) */
101   - objStation.stationRadius = '';
102   -
103   - /** 设置修改站点集合对象图形百度坐标集合属性值 @param:<bPolygonGrid:图形百度坐标集合) */
104   - objStation.stationBPolygonGrid = edit_bPloygonGrid;
105   -
106   - $.get('editstation.html', function(m){
107   -
108   - $(pjaxContainer).append(m);
109   -
110   - $('#edit_station_mobal').trigger('editSelectMobal_show', [WorldsBMapLine,objStation,PublicFunctions]);
111   -
112   - });
  85 + var centre_points = pointE.getBounds().getCenter().lng + ' ' + pointE.getBounds().getCenter().lat;
  86 + if(type == 'edit') {
  87 + /** 设置修改站点集合对象站点中心点百度坐标属性值 @param:<bJwpoints:中心点百度坐标) */
  88 + objStation.stationBJwpoints = centre_points;
  89 + /** 设置修改站点集合对象范围图形类型属性值 @param:<shapesType:范围图形类型) */
  90 + objStation.stationShapesType = 'd';;
  91 + /** 设置修改站点集合对象圆形半径属性值 @param:<radius:圆形半径) */
  92 + objStation.stationRadius = '';
  93 + /** 设置修改站点集合对象图形百度坐标集合属性值 @param:<bPolygonGrid:图形百度坐标集合) */
  94 + objStation.stationBPolygonGrid = bPloygonGrid;
  95 + $.get('editstation.html', function(m){
  96 +
  97 + $(pjaxContainer).append(m);
  98 +
  99 + $('#edit_station_mobal').trigger('editSelectMobal_show', [WorldsBMapLine, MapGetAjaxData, PublicFunctions, objStation]);
  100 +
  101 + });
  102 + } else if(type == 'add') {
  103 + /** 设置新增站点集合对象站点中心点百度坐标属性值 @param:<bJwpoints:中心点百度坐标) */
  104 + objStation.bJwpoints = centre_points;
  105 + /** 设置新增站点集合对象范围图形类型属性值 @param:<shapesType:范围图形类型) */
  106 + objStation.shapesType = 'd';
  107 + /** 设置新增站点集合对象圆形半径属性值 @param:<radius:圆形半径) */
  108 + objStation.radius = '';
  109 + /** 设置新增站点集合对象图形百度坐标集合属性值 @param:<bPolygonGrid:图形百度坐标集合) */
  110 + objStation.bPolygonGrid = bPloygonGrid;
  111 + // 加载add页面
  112 + $.get('addstation.html', function(m){
  113 + $(pjaxContainer).append(m);
  114 + $('#add_station_mobal').trigger('AddStationMobal.show', [WorldsBMapLine, MapGetAjaxData, objStation, EditRoute, PublicFunctions]);
  115 + });
  116 + }
113 117  
114 118 }
115   -
  119 + // 打开按钮事件
  120 + PublicFunctions.editAChangeCssRemoveDisabled();
116 121 });
117 122  
118 123 },
119   -
120   - closeDrawingManager : function() {
121   -
  124 + // 打开绘画工具
  125 + drawingManagerOpen : function() {
  126 + // 打开鼠标绘画工具
  127 + drawingManager.open();
  128 + // 设置属性
  129 + drawingManager.setDrawingMode(BMAP_DRAWING_POLYGON);
  130 + },
  131 + drawingManagerClose : function() {
122 132 drawingManager.close();
123   - }
  133 + },
124 134 }
125 135  
126 136 return draMangerObj;
... ...
src/main/resources/static/pages/base/line/js/editRoute.js
... ... @@ -12,10 +12,23 @@ var EditRoute = function(){
12 12 setLineId : function(id) {
13 13 line.id = id;
14 14 },
  15 + getLineId : function() {
  16 + return line.id;
  17 + },
15 18 setLineDir : function(dir) {
16 19  
17 20 line.dir = dir;
18 21 },
  22 + getLineDir : function() {
  23 +
  24 + return line.dir;
  25 + },
  26 + setLineGenerationType : function(generationType) {// 生成类型(uploadGPS:上传gps/cite:引用当前版本)
  27 + line.generationType = generationType;
  28 + },
  29 + getLineGenerationType : function() {// 生成类型(uploadGPS:上传gps/cite:引用当前版本)
  30 + return line.generationType;
  31 + },
19 32 };
20 33  
21 34 return editRoute;
... ...
src/main/resources/static/pages/base/line/js/line-add-form.js
... ... @@ -246,7 +246,7 @@ $(function(){
246 246 if(result.status=='SUCCESS') {
247 247  
248 248 // 弹出添加成功提示消息
249   - layer.msg('添加成功...');
  249 + layer.msg('添加成功,并已自动为您生成线路原始版本,可以在线路版本信息下查看!', {time: 7000});
250 250  
251 251 } else if(result.status=='ERROR') {
252 252  
... ...
src/main/resources/static/pages/base/line/js/map-ajax-getdata.js 0 → 100644
  1 +/**
  2 + * MapGetAjaxData :ajax异步请求
  3 + *
  4 + * - - - - - -》 getSectionCacheList :获取路段列表
  5 + *
  6 + * - - - - - -》 getzdlyInfo :获取站点列表
  7 + *
  8 + * - - - - - -》 getLikeStationName :查询是否有已存在站点名称
  9 + *
  10 + * - - - - - -》 getStationCode:查询站点编码
  11 + *
  12 + * - - - - - -》 findCacheUpStationRouteCode:查询上一个缓存站点的序号
  13 + *
  14 + * - - - - - -》 findCacheUpSectionRouteCode:查询上一个缓存路段的序号
  15 + *
  16 + * - - - - - -》 stationCacheSave:新增缓存站点保存
  17 + *
  18 + * - - - - - -》 stationCacheUpdate:站点缓存更新
  19 + *
  20 + * - - - - - -》 sectionUpdate : 编辑线路走向保存
  21 + *
  22 + * - - - - - -》 getIdLineName:获取线路名称
  23 + */
  24 +
  25 +var MapGetAjaxData = function(){
  26 +
  27 + var ajaxData = {
  28 + // 获取路段列表
  29 + getSectionCacheList : function(lineId,dir,callback) {
  30 + $get('/sectionroute/findCacheSection',{'lineId' : lineId , 'dir' : dir},function(resultdata) {
  31 + callback && callback(resultdata);
  32 + });
  33 + },
  34 + getzdlyInfo : function(params,callback) {
  35 + $get('/stationroute/cacheList',params,function(array) {
  36 + callback && callback(array);
  37 + });
  38 + },
  39 + // 查询是否有已存在站点名称
  40 + getLikeStationName : function (stationName,callback) {
  41 + $get('/station/all', {stationName_eq: stationName}, function(array){
  42 + callback && callback(array);
  43 + });
  44 + },
  45 + // 查询站点编码
  46 + getStationCode : function(callback) {
  47 + $get('/station/getStationCode',null,function(stationCode) {
  48 + if(stationCode>0) {
  49 + callback && callback(stationCode);
  50 + }
  51 + });
  52 + },
  53 + findCacheUpStationRouteCode : function(params,callback) {
  54 + $get('/stationroute/findCacheUpStationRouteCode',params,function(result) {
  55 + callback && callback(result);
  56 + });
  57 + },
  58 + findCacheUpSectionRouteCode : function(lineId,dir,sectionRouteCode,callback) {
  59 + $get('/sectionroute/findCacheUpSectionRouteCode',{'lineId' : lineId , 'direction' : dir, 'sectionRouteCode':sectionRouteCode},function(result) {
  60 + callback && callback(result);
  61 + });
  62 + },
  63 + // 新增缓存站点保存
  64 + stationCacheSave : function(station,callback) {
  65 + $post('/station/stationCacheSave',station,function(data) {
  66 + debugger
  67 + callback && callback(data);
  68 + });
  69 + },
  70 + // 缓存站点更新
  71 + stationCacheUpdate : function(station,callback) {
  72 + $post('/station/stationCacheUpdate',station,function(data) {
  73 + callback && callback(data);
  74 + });
  75 + },
  76 + // 获取线路名称
  77 + getIdLineName : function (id,callback) {
  78 +
  79 + $get('/line/' + id ,null, function(result){
  80 +
  81 + callback && callback(result);
  82 +
  83 + });
  84 +
  85 + },
  86 + }
  87 + return ajaxData;
  88 +}();
0 89 \ No newline at end of file
... ...
src/main/resources/static/pages/base/line/js/line-map-function.js renamed to src/main/resources/static/pages/base/line/js/map-function.js
... ... @@ -3,7 +3,7 @@ var PublicFunctions = function () {
3 3 /** 初始化线路标题与ID */
4 4 setTiteText : function(lineId) {
5 5 // 根据线路ID获取线路名称
6   - GetAjaxData.getIdLineName(lineId,function(data) {
  6 + MapGetAjaxData.getIdLineName(lineId,function(data) {
7 7 // 定义线路名称
8 8 var lineNameV = data.name;
9 9 $('.portlet-title .caption').text(lineNameV);
... ... @@ -40,7 +40,7 @@ var PublicFunctions = function () {
40 40 // 版本号
41 41 $('#versionsInput').val(Section.versions);
42 42 // 是否撤销
43   - $('#destroySelect').val(Section.destroy);
  43 + $('#destroySelect').val(0);
44 44 // 描述/说明
45 45 $('#descriptionsTextarea').val(Section.descriptions);
46 46 },
... ... @@ -113,7 +113,6 @@ var PublicFunctions = function () {
113 113 /** 在地图上画点 @param:<point_center:中心坐标点> */
114 114 WorldsBMapLine.drawingUpStationPoint(point_center,stationName,s+1);
115 115 }
116   -
117 116 }
118 117 // 路段数据长度
119 118 var dataLen = data.length;
... ...
src/main/resources/static/pages/base/line/js/map.js
... ... @@ -206,7 +206,50 @@ var WorldsBMapLine = function () {
206 206 })();
207 207  
208 208 },
209   - // 在地图上画出上行线路走向
  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 + // 在地图上画出上行线路走向(多路段)
210 253 drawingUpline01 : function (polylineArray,polyline_center,data) {
211 254 var polyUpline01 = 'polyline' + '_' + data.sectionrouteId;
212 255 // 创建线路走向
... ... @@ -252,7 +295,7 @@ var WorldsBMapLine = function () {
252 295 // 加载修改路段弹出层mobal页面
253 296 $.get('editsection.html', function(m){
254 297 $(pjaxContainer).append(m);
255   - $('#edit_section_mobal_cache').trigger('editSectionMobalCache_show', [WorldsBMapLine,GetAjaxData,EditSectionObj,PublicFunctions]);
  298 + $('#edit_section_mobal_cache').trigger('editSectionMobalCache_show', [WorldsBMapLine,MapGetAjaxData,EditSectionObj,PublicFunctions]);
256 299 });
257 300 // 打开按钮事件
258 301 PublicFunctions.editAChangeCssRemoveDisabled();
... ... @@ -300,9 +343,12 @@ var WorldsBMapLine = function () {
300 343 }
301 344 WorldsBMapLine.setIsCutSection(true);
302 345 }
303   - var markerMenu=new BMap.ContextMenu();
304   - markerMenu.addItem(new BMap.MenuItem('切路段',editSection.bind(polyUpline01)));
305   - polyUpline01.addContextMenu(markerMenu);
  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);
  351 + }
306 352  
307 353  
308 354 var PanOptions_ ={noAnimation :true};
... ... @@ -387,7 +433,7 @@ var WorldsBMapLine = function () {
387 433 mapBValue.addOverlay(marker);
388 434 },
389 435  
390   - // 根据站点坐标匹配库中的公交站点(手动规划)
  436 + // 根据站点坐标匹配库中的公交站点
391 437 stationsPointsToLibraryPoint : function(arra,callback) {
392 438 // 获取长度
393 439 var len = arra.length;
... ... @@ -710,9 +756,6 @@ var WorldsBMapLine = function () {
710 756 mapBValue.panTo(point,PanOptions_);
711 757  
712 758 mapBValue.panBy(10,-200,PanOptions_);
713   -
714   - // 关闭按钮事件
715   - PublicFunctions.addAChangeCssAddDisabled();
716 759  
717 760 // 编辑圆监听事件
718 761 circle.addEventListener('dblclick',function() {
... ... @@ -740,7 +783,7 @@ var WorldsBMapLine = function () {
740 783  
741 784 $(pjaxContainer).append(m);
742 785  
743   - $('#edit_station_mobal').trigger('editSelectMobal_show', [WorldsBMapLine,objStation,PublicFunctions]);
  786 + $('#edit_station_mobal').trigger('editSelectMobal_show', [WorldsBMapLine,MapGetAjaxData,PublicFunctions,objStation]);
744 787  
745 788 });
746 789  
... ... @@ -748,7 +791,7 @@ var WorldsBMapLine = function () {
748 791 PublicFunctions.editAChangeCssRemoveDisabled();
749 792 });
750 793  
751   - // 编辑多
  794 + // 编辑多
752 795 }else if(stationShapesType =='d') {
753 796  
754 797 // 清除地图覆盖物
... ... @@ -808,9 +851,6 @@ var WorldsBMapLine = function () {
808 851  
809 852 // 将地图在水平位置上移动x像素,垂直位置上移动y像素。
810 853 mapBValue.panBy(10,-150,PanOptions_);
811   -
812   - // 关闭按钮事件(图形编辑中)
813   - PublicFunctions.addAChangeCssAddDisabled();
814 854  
815 855 // 添加多变行编辑事件
816 856 polygon.addEventListener('dblclick',function(e) {
... ... @@ -857,14 +897,14 @@ var WorldsBMapLine = function () {
857 897  
858 898 $(pjaxContainer).append(m);
859 899  
860   - $('#edit_station_mobal').trigger('editSelectMobal_show', [WorldsBMapLine,objStation,PublicFunctions]);
  900 + $('#edit_station_mobal').trigger('editSelectMobal_show', [WorldsBMapLine,MapGetAjaxData,PublicFunctions,objStation]);
861 901  
862 902 });
863 903  
  904 + // 打开按钮事件
  905 + PublicFunctions.editAChangeCssRemoveDisabled();
864 906 });
865 907  
866   - // 打开按钮事件
867   - PublicFunctions.editAChangeCssRemoveDisabled();
868 908 }
869 909 }
870 910 },
... ...
src/main/resources/static/pages/base/line/list.html
... ... @@ -244,7 +244,7 @@
244 244 闵行公司
245 245 {{/if}}
246 246 </td>
247   -<td>
  247 + <td>
248 248 {{if obj.company == '55'}}
249 249  
250 250 {{if obj.brancheCompany == '1'}}
... ... @@ -295,6 +295,8 @@
295 295 南汇维修公司
296 296 {{else if obj.brancheCompany == '5'}}
297 297 南汇公司
  298 + {{else if obj.brancheCompany == '6'}}
  299 + 航头枢纽站
298 300 {{/if}}
299 301  
300 302 {{/if}}
... ...
src/main/resources/static/pages/base/line/map.html
... ... @@ -3,44 +3,75 @@
3 3 <div class="portlet-body">
4 4 <!-- 地图 -->
5 5 <div id="bmap_basic" class="bmaps"></div>
  6 + <!-- 绘画工具栏 -->
  7 + <div class="leftUtils hidden">
  8 + <div class="btn-group" style="left: 100px;">
  9 + <a class="btn btn-sm green-seagreen dropdown-toggle" style="width: 98px;" href="javascript:;" data-toggle="dropdown" aria-expanded="false"> 绘制工具
  10 + <i class="fa fa-angle-down"></i>
  11 + </a>
  12 + <ul class="dropdown-menu pull-right" style="min-width:100px">
  13 + <li>
  14 + <a href="javascript:;" id="oppenDrawingManager"><i class="fa fa-pencil"></i> 打开 </a>
  15 + </li>
  16 + <li>
  17 + <a href="javascript:;" id = "closeDrawingManager"> <i class="fa fa-reply"></i> 关闭 </a>
  18 + </li>
  19 + </ul>
  20 + </div>
  21 + </div>
6 22 <!-- 右边显示栏 -->
7 23 <div class="cut-section" id="scrllmouseEvent_div">
8 24 <div class="portlet-title">
9 25 <div class="caption">途径站点</div>
10 26 </div>
11 27 <div class="portlet-body">
12   - <div class="table-toolbar" style="text-align: center;" id="upload">
13   - <button class="btn btn-circle blue" id="uploadRoute">
  28 + <div class="table-toolbar" style="text-align: center;" id="generationRoute_div">
  29 + <button class="btn btn-circle blue" id="generationRoute">
14 30 <i class="fa fa-plus"></i> 生成路线
15 31 </button>
16 32 </div>
17   - <div class="portlet-body hidden" id="upload_show">
  33 + <!-- 生成走向跳转的div -->
  34 + <div class="portlet-body hidden" id="route_show">
18 35 <div>
19 36 <ul class="nav nav-pills nav-justified steps">
20 37 <li class="active">
21 38 <a id="section"><span>路段</span></a>
22 39 </li>
23 40 <li>
24   - <a id="station"><span>站点</span></a>
  41 + <a class="station" id="station"><span>站点</span></a>
25 42 </li>
26 43 </ul>
27 44 </div>
28 45 <div id="section_list_div" class="active" style="margin: 5px;">
29   - <div class="defeat-scroll"
30   - style="height: 400px; overflow-y: auto; ">
31   - <table class="table table-bordered table-hover table-checkable "
32   - id="section_table" style="color: white;">
33   - <thead>
34   - <tr role="row" class="heading">
35   - <th>截取路段的名称</th>
36   - </tr>
37   - </thead>
38   - <tbody></tbody>
39   - </table>
  46 + <!-- 上传gps生成路段div -->
  47 + <div id="gpsSection">
  48 + <div class="defeat-scroll"
  49 + style="height: 400px; overflow-y: auto; ">
  50 + <table class="table table-bordered table-hover table-checkable "
  51 + id="section_table" style="color: white;">
  52 + <thead>
  53 + <tr role="row" class="heading">
  54 + <th>截取路段的名称</th>
  55 + </tr>
  56 + </thead>
  57 + <tbody></tbody>
  58 + </table>
  59 + </div>
  60 + <div class="table-toolbar">
  61 + <a class="btn btn-circle blue" id="Undo">撤销切点</a>
  62 + <a class="btn btn-circle blue" id="cutSection">提交选项</a>
  63 + </div>
40 64 </div>
41   - <div class="table-toolbar">
42   - <a class="btn btn-circle blue" id="Undo">撤销切点</a>
43   - <a class="btn btn-circle blue" id="cutSection">提交选项</a>
  65 + <!-- 引用当前版本路段div -->
  66 + <div id="citeSection">
  67 + <div class="defeat-scroll"
  68 + style="height: 400px; overflow-y: auto; ">
  69 + </div>
  70 + <div class="table-toolbar">
  71 + <a class="btn btn-circle blue" id="findSection">查看路段</a>
  72 + <a class="btn btn-circle blue" id="addSection">添加路段</a>
  73 + <a class="btn btn-circle blue" id="submitOptions">提交选项</a>
  74 + </div>
44 75 </div>
45 76 </div>
46 77 <div id="station_list_div" class="hidden">
... ... @@ -48,6 +79,7 @@
48 79 style="height: 400px; overflow-y: auto; ">
49 80 </div>
50 81 <div class="table-toolbar">
  82 + <a class="btn btn-circle blue" id="addStation">添加站点</a>
51 83 <a class="btn btn-circle blue" id="findStation">查看站点</a>
52 84 <a class="btn btn-circle blue" id="updateStation">修改站点</a>
53 85 </div>
... ... @@ -81,6 +113,8 @@ $(function(){
81 113 var direction = 0;
82 114 // 站点Map
83 115 var stationRouteMap = new Map();
  116 + // 路段Map
  117 + var sectionRouteMap = new Map();
84 118 // 如果线路ID不为空
85 119 if(id) {
86 120 var styleOptions = {
... ... @@ -102,7 +136,7 @@ $(function(){
102 136 var map_ = WorldsBMapLine.init();
103 137  
104 138 /** 初始化绘图工具类 @param:<map_:map对象;styleOptions:绘图样式对象> @return:DrawingManager对象 */
105   -// DrawingManagerObj.init(map_,styleOptions);
  139 + DrawingManagerObj.init(map_,styleOptions);
106 140  
107 141 layer.msg('请生成路线!!!');
108 142  
... ... @@ -123,12 +157,12 @@ $(function(){
123 157 }
124 158  
125 159 // 上传GPS坐标生成路线事件
126   - $('#uploadRoute').on('click', function() {
  160 + $('#generationRoute').on('click', function() {
127 161 EditRoute.setLineId(id);
128   - EditRoute.setLineDir(direction);
  162 +// EditRoute.setLineDir(direction);
129 163 $.get('editRoute.html', function(m){
130 164 $(pjaxContainer).append(m);
131   - $('#edit_route_mobal').trigger('editRouteMobal.show',[TransGPS,EditRoute,WorldsBMapLine,DrawingManagerObj,GetAjaxData,PublicFunctions]);
  165 + $('#edit_route_mobal').trigger('editRouteMobal.show',[TransGPS,EditRoute,WorldsBMapLine,DrawingManagerObj,MapGetAjaxData,PublicFunctions]);
132 166 });
133 167 // 更新section_table 和缓存中的切点
134 168 WorldsBMapLine.initCutSectionPoint();
... ... @@ -144,10 +178,29 @@ $(function(){
144 178 var section = EditSectionObj.getEitdSection();
145 179 var josnSectionList = JSON.stringify(sectionList);
146 180 section.cutSectionList = josnSectionList;
147   - $.get('submit_select.html', function(m){
148   - $(pjaxContainer).append(m);
149   - $('#submit_select_mobal').trigger('submitSelectMobal.show',[section,EditRoute]);
  181 + // 版本号
  182 + $.get('/lineVersions/findCurrentVersion',{'lineId':id},function(versions){
  183 + section.versions = versions;
  184 + layer.confirm('提交马上会把原有的站点和路段覆盖,您确定要提交吗?', {
  185 + btn: ['提交','取消'] //按钮
  186 + }, function(index){
  187 + layer.close(index);
  188 + $.post('/section/sectionCut', section, function(resuntDate){
  189 + if(resuntDate.status=='SUCCESS') {
  190 + // 弹出添加成功提示消息
  191 + layer.msg('提交成功,跳转到线路详情页面!');
  192 + window.location.href = "/pages/base/stationroute/list.html?no="+section.sectionrouteLine+","+section.sectionrouteDirections;
  193 + }else {
  194 + // 弹出添加失败提示消息
  195 + layer.msg('提交失败...');
  196 + }
  197 + });
  198 + });
150 199 });
  200 +// $.get('submit_select.html', function(m){
  201 +// $(pjaxContainer).append(m);
  202 +// $('#submit_select_mobal').trigger('submitSelectMobal.show',[section,EditRoute]);
  203 +// });
151 204 } else {
152 205 layer.msg("请先截取路段!!!");
153 206 }
... ... @@ -179,7 +232,47 @@ $(function(){
179 232 } else {
180 233 layer.msg("没有截取路段,不可以撤销!!!");
181 234 }
182   - });
  235 + });
  236 +
  237 + // 监听右侧悬浮框导航栏事件
  238 + $('#section').on('click',function(){
  239 + $('#station').parent().removeClass('active');
  240 + $('#section').parent().addClass('active');
  241 + $('#station_list_div').removeClass('active');
  242 + $('#station_list_div').addClass('hidden');
  243 + $('#section_list_div').removeClass('hidden');
  244 + $('#section_list_div').addClass('active');
  245 + var generationType = EditRoute.getLineGenerationType();
  246 + // 更具生成类型展示不同页面
  247 + if(generationType == 'cite'){
  248 + $('#gpsSection').addClass('hidden');
  249 +
  250 + } else if(generationType == 'uploadGPS') {
  251 + $('#citeSection').addClass('hidden');
  252 + }
  253 + // 清除地图覆盖物
  254 + WorldsBMapLine.clearMarkAndOverlays();
  255 + var params = {};
  256 + var line = EditRoute.getLineObj();
  257 + params.lineId=line.id;
  258 + params.dir = line.dir;
  259 + // 查询路段信息
  260 + $get('/sectionroute/findCacheSection',params,function(data) {
  261 + var section_radio_html = '<div id="section_radio">';
  262 + var cont = 1;
  263 + var check = 'checked="checked"';
  264 + $.each(data,function(){
  265 + sectionRouteMap[this.sectionrouteId] = this;
  266 + section_radio_html += '<div class="radio"><label class="radio_label section"><input name="sectionRadio" type="radio" class="radioclass" value="'+this.sectionrouteId+'" '+(cont==1?check:"")+' />'+this.sectionName+"</label></div>";
  267 + cont++;
  268 + });
  269 + section_radio_html += '</div>';
  270 + $("#section_list_div #citeSection .defeat-scroll").html(section_radio_html);
  271 + // 在地图上画出线路走向
  272 + PublicFunctions.linePanlThree(line.id,data,line.dir);
  273 + });
  274 + });
  275 +
183 276 // 监听右侧悬浮框导航栏事件
184 277 $('#station').on('click',function(){
185 278 $('#section').parent().removeClass('active');
... ... @@ -196,12 +289,12 @@ $(function(){
196 289 params.lineId=line.id;
197 290 params.dir = line.dir;
198 291 $.get('/stationroute/findCachePoint',params,function(data){
199   - var station_radio_html = '<div id="station_radio" >';
  292 + var station_radio_html = '<div id="station_radio">';
200 293 var cont = 1;
201 294 var check = 'checked="checked"';
202 295 $.each(data,function(){
203 296 stationRouteMap[this.stationRouteId] = this;
204   - station_radio_html += '<div class="radio" ><label class="radio_label on"><input name="stationRadio" type="radio" class="radioclass" value="'+this.stationRouteId+'" '+(cont==1?check:"")+' />'+this.stationRouteStationName+"</label></div>";
  297 + station_radio_html += '<div class="radio"><label class="radio_label station"><input name="stationRadio" type="radio" class="radioclass" value="'+this.stationRouteId+'" '+(cont==1?check:"")+' />'+this.stationRouteStationName+"</label></div>";
205 298 cont++;
206 299 });
207 300 station_radio_html += '</div>';
... ... @@ -209,33 +302,61 @@ $(function(){
209 302 });
210 303 });
211 304  
  305 + // 查询路段
  306 + $('#findSection').on('click', function(){
  307 + var id = $(".section input[type='radio']:checked").val();
  308 + var sectionRoute = sectionRouteMap[id];
  309 + if(id && sectionRoute){
  310 + WorldsBMapLine.drawingSection(sectionRoute);
  311 + } else if(id && !sectionRoute){
  312 + layer.msg('您选择的路段不存在,请重新选择!');
  313 + }else{
  314 + layer.msg('请先选择要查看的路段!');
  315 + }
  316 + });
  317 +
  318 + // 添加站点
  319 + $('#addStation').on('click', function(){
  320 + $.get('addstation_select.html', function(m){
  321 + $(pjaxContainer).append(m);
  322 + $('#addstation_select_mobal').trigger('AddSelectMobal.show', [WorldsBMapLine, DrawingManagerObj, MapGetAjaxData, EditRoute, PublicFunctions]);
  323 + });
  324 + });
  325 +
  326 + // 查询站点
212 327 $('#findStation').on('click', function(){
213   - var id = $("input[type='radio']:checked").val();
  328 + var id = $(".station input[type='radio']:checked").val();
214 329 var stationRoute = stationRouteMap[id];
215   - // 站点形状
216   - var shapesType = stationRoute.stationShapesType;
217   - // 如果是圆
218   - if(shapesType =='r') {
219   -
220   - // 百度地图画圆
221   - WorldsBMapLine.pointsCircle(stationRoute);
222   -
223   - // 如果是多变行
224   - }else if(shapesType == 'd') {
225   -
226   - // 百度地图画多边形
227   - WorldsBMapLine.pointsPolygon(stationRoute);
228   - }
  330 + if(id && stationRoute){
  331 + // 站点形状
  332 + var shapesType = stationRoute.stationShapesType;
  333 + // 如果是圆
  334 + if(shapesType =='r') {
  335 +
  336 + // 百度地图画圆
  337 + WorldsBMapLine.pointsCircle(stationRoute);
229 338  
  339 + // 如果是多变行
  340 + }else if(shapesType == 'd') {
  341 +
  342 + // 百度地图画多边形
  343 + WorldsBMapLine.pointsPolygon(stationRoute);
  344 + }
  345 + } else if(id && !stationRoute){
  346 + layer.msg('您选择的站点不存在,请重新选择!');
  347 + }else{
  348 + layer.msg('请先选择要查看的站点!');
  349 + }
230 350 });
  351 +
  352 + // 修改站点
231 353 $('#updateStation').on('click', function(){
232   - var id = $("input[type='radio']:checked").val();
  354 + var id = $(".station input[type='radio']:checked").val();
233 355 var stationRoute = stationRouteMap[id];
234   -
235 356 if(id && stationRoute){
236 357 $.get('editstation_select.html', function(m){
237 358 $(pjaxContainer).append(m);
238   - $('#editstation_select_mobal').trigger('editStationSelectMobal_show', [WorldsBMapLine, DrawingManagerObj, stationRoute]);
  359 + $('#editstation_select_mobal').trigger('editStationSelectMobal_show', [WorldsBMapLine, PublicFunctions, DrawingManagerObj, stationRoute]);
239 360 });
240 361 } else if(id && !stationRoute){
241 362 layer.msg('您选择的站点不存在,请重新选择!');
... ... @@ -243,25 +364,16 @@ $(function(){
243 364 layer.msg('请先选择要编辑的站点!');
244 365 }
245 366 });
246   - $('#section').on('click',function(){
247   - $('#station').parent().removeClass('active');
248   - $('#section').parent().addClass('active');
249   - $('#section_list_div').removeClass('hidden');
250   - $('#section_list_div').addClass('active');
251   - $('#station_list_div').removeClass('active');
252   - $('#station_list_div').addClass('hidden');
253   - // 清除地图覆盖物
254   - WorldsBMapLine.clearMarkAndOverlays();
255   -
256   - var line = EditRoute.getLineObj();
257   - lineid=line.id;
258   - directions = line.dir;
259   - // 查询路段信息
260   - $get('/sectionroute/findSectionCache',{'line.id_eq' : lineid , 'directions_eq' : directions},function(data) {
261   - // 在地图上画出线路走向
262   - PublicFunctions.linePanlThree(lineid,data,directions);
263   - });
  367 +
  368 + // 监听打开鼠标绘制工具按钮事件.
  369 + $('#oppenDrawingManager').on('click',function() {
  370 + DrawingManagerObj.drawingManagerOpen();
  371 + });
  372 + // 监听关闭鼠标绘制工具按钮事件.
  373 + $('#closeDrawingManager').on('click',function() {
  374 + DrawingManagerObj.drawingManagerClose();
264 375 });
  376 +
265 377 // 滚动轴监听事件
266 378 $('#scrllmouseEvent_div').on('mousemove',function() {
267 379 $('.defeat-scroll').css('overflow','auto');
... ... @@ -277,10 +389,12 @@ $(function(){
277 389 <!-- 地图类 -->
278 390 <script src="/pages/base/line/js/map.js"></script>
279 391 <!-- 函数与方法 -->
280   -<script src="/pages/base/line/js/line-map-function.js"></script>
  392 +<script src="/pages/base/line/js/map-function.js"></script>
281 393 <!-- 修改路段对象类 -->
282 394 <script src="/pages/base/stationroute/js/editsection.js"></script>
283 395 <!-- 绘图类 -->
284 396 <script src="/pages/base/line/js/drawingManager.js"></script>
285 397 <!-- ajax请求类 -->
286   -<script src="/pages/base/stationroute/js/stationroute-ajax-getdata.js"></script>
287 398 \ No newline at end of file
  399 +<!-- <script src="/pages/base/stationroute/js/stationroute-ajax-getdata.js"></script> -->
  400 +<!-- ajax请求类 -->
  401 +<script src="/pages/base/line/js/map-ajax-getdata.js"></script>
288 402 \ No newline at end of file
... ...
src/main/resources/static/pages/base/lineversions/add.html
... ... @@ -44,6 +44,7 @@
44 44 <div class="form-body">
45 45 <input type="hidden" name="lineId" id="lineIdInput" />
46 46 <input type="hidden" name="lineCode" id="lineCodeInput" />
  47 + <input type="hidden" name="lineCode" id="statusInput" />
47 48  
48 49 <!-- 表单分组组件 form-group START -->
49 50 <div class="form-group">
... ... @@ -100,7 +101,7 @@
100 101 </div>
101 102 <!-- 表单分组组件 form-group END -->
102 103  
103   - <div class="form-group">
  104 + <!-- <div class="form-group">
104 105 <label class="control-label col-md-5">
105 106 <span class="required"> * </span>线路版本状态&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:
106 107 </label>
... ... @@ -112,7 +113,7 @@
112 113 <option value="0">历史版本</option>
113 114 </select>
114 115 </div>
115   - </div>
  116 + </div> -->
116 117  
117 118 <!-- 表单分组组件 form-group START -->
118 119 <div class="form-group">
... ...
src/main/resources/static/pages/base/lineversions/edit.html
... ... @@ -44,6 +44,7 @@
44 44 <div class="form-body">
45 45 <input type="hidden" name="lineId" id="lineIdInput" />
46 46 <input type="hidden" name="lineCode" id="lineCodeInput" />
  47 + <input type="hidden" name="lineCode" id="statusInput" />
47 48  
48 49 <!-- 表单分组组件 form-group START -->
49 50 <div class="form-group">
... ... @@ -100,7 +101,7 @@
100 101 </div>
101 102 <!-- 表单分组组件 form-group END -->
102 103  
103   - <div class="form-group">
  104 + <!-- <div class="form-group">
104 105 <label class="control-label col-md-5">
105 106 <span class="required"> * </span>线路版本状态&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:
106 107 </label>
... ... @@ -112,7 +113,7 @@
112 113 <option value="0">历史版本</option>
113 114 </select>
114 115 </div>
115   - </div>
  116 + </div> -->
116 117  
117 118 <!-- 表单分组组件 form-group START -->
118 119 <div class="form-group">
... ...
src/main/resources/static/pages/base/lineversions/js/lineversions-add-from.js
... ... @@ -37,13 +37,14 @@
37 37 });
38 38 }
39 39  
40   - // 填充公司下拉框选择值
  40 + // 填充线路下拉框选择值
41 41 function lineAllInfo(){
42 42 getComp(function(params) {
43 43 $get('/line/all', params, function(array){
44 44 // get请求获取公司
45 45 $get('/business/all', {upCode_eq: '88'}, function(compD){
46 46 var len_ = array.length,paramsD = new Array();
  47 + paramsD.push({'id':'请选择...','text':'请选择...'});
47 48 if(len_>0) {
48 49 $.each(array, function(i, g){
49 50 if(g.name!='' || g.name != null) {
... ... @@ -54,7 +55,7 @@
54 55 if($('span').hasClass('select2-selection'))
55 56 $('span .select2-selection').remove();
56 57 initPinYinSelect2($('#lineSelect'),paramsD,function(selector) {
57   - selector.select2("val", splitxlName(window.localStorage.xlName_AgursData));
  58 + selector.select2("val", "请选择...");
58 59 });
59 60 }
60 61 });
... ... @@ -65,16 +66,30 @@
65 66 // 监听线路名称下拉框值改变事件.
66 67 $('#lineSelect').on("change", function (e) {
67 68 var lineSelectValue = $('#lineSelect').val();// 获取线路名称值.
68   - if(lineSelectValue=='' || lineSelectValue==null) {
  69 + if(lineSelectValue=='' || lineSelectValue==null || lineSelectValue=="请选择...") {
69 70 $('#lineCodeInput').val('');// 设值线路编码.
70 71 $('#lineIdInput').val('');// 设值线路ID.
71 72 }else {
72 73 var lineSelectValueArray = lineSelectValue.split('_');// 切割线路名称值.
73   - $.get('/lineVersions/findLineVersionsMax',{'lineId':lineSelectValueArray[1]}, function(lineVersionsMax){
74   - $('#versionsInput').val(++lineVersionsMax.versions);// 设值线路编码.
75   - });
76   - $('#lineIdInput').val(lineSelectValueArray[0]);// 设值线路编码.
77   - $('#lineCodeInput').val(lineSelectValueArray[1]);// 设值线路ID.
  74 + $.get('/lineVersions/findByLineId',{'lineId':lineSelectValueArray[1]}, function(array){
  75 + var type = true;
  76 + $.each(array, function(){
  77 + if(this.status == 2) {
  78 + type = false;
  79 + return;
  80 + }
  81 + });
  82 + if(type) {
  83 + $.get('/lineVersions/findLineVersionsMax',{'lineId':lineSelectValueArray[1]}, function(lineVersionsMax){
  84 + $('#versionsInput').val(++lineVersionsMax.versions);// 设值线路编码.
  85 + });
  86 + $('#lineIdInput').val(lineSelectValueArray[0]);// 设值线路编码.
  87 + $('#lineCodeInput').val(lineSelectValueArray[1]);// 设值线路ID.
  88 + } else {
  89 + swal("每条线路只能有一个待更新版本,你选择的线路已有待更新版本,版本多了忙不过来,快去选择其他线路吧!");
  90 + $('#lineSelect').select2("val", "请选择...");
  91 + }
  92 + });
78 93 }
79 94 });
80 95  
... ... @@ -118,7 +133,7 @@
118 133 'startDate' : {required : true},// 启用时间 不为空.
119 134 'endDate' : {required : true},// 结束时间.
120 135 'versions' : {required : true, digits : true, maxlength: 10},// 版本号 必填项、数字、最大长度10.
121   - 'status' : {required : true, digits : true, maxlength: 10},// 版本状态 必填项、数字、最大长度10.
  136 +// 'status' : {required : true, digits : true, maxlength: 10},// 版本状态 必填项、数字、最大长度10.
122 137 },
123 138  
124 139 /**
... ...
src/main/resources/static/pages/base/lineversions/js/lineversions-edit-from.js
... ... @@ -37,7 +37,7 @@
37 37 });
38 38 }
39 39  
40   - // 填充公司下拉框选择值
  40 + // 填充线路下拉框选择值
41 41 function lineAllInfo(){
42 42 getComp(function(params) {
43 43 $get('/line/all', params, function(array){
... ...
src/main/resources/static/pages/base/lineversions/js/lineversions-list-table.js
... ... @@ -4,7 +4,7 @@
4 4 * @Description : TOOD(线路信息list.html页面js)
5 5 */
6 6  
7   -(function(){
  7 +
8 8 // 关闭左侧栏
9 9 if (!$('body').hasClass('page-sidebar-closed')) {$('.menu-toggler.sidebar-toggler').click();}
10 10 // 定义 page : 当前页;initPag ; icheckOptions:选择框
... ... @@ -269,6 +269,7 @@
269 269 return rsStr;
270 270 }
271 271  
  272 +
272 273 /** 搜索按钮事件 */
273 274 $('tr.filter .filter-submit').on('click',function(){
274 275 var params = getParams();
... ... @@ -280,5 +281,54 @@
280 281 /** 表格数据分页加载 @param:<params:搜索参数;true:是否重新分页> */
281 282 loadTableDate(params,true);
282 283 });
283   -
284   -})();
285 284 \ No newline at end of file
  285 +
  286 +
  287 +function updateVersionsRoute(obj){
  288 + var lineId = obj.dataset.lineid;
  289 + swal({
  290 + title: "操作须知",
  291 + text: "每周会更新数据,请在本周内做完线路走向并发布,不然您做的走向有可能会被覆盖!",
  292 + type: "warning",
  293 + showCancelButton: true,
  294 + confirmButtonColor: "#DD6B55",
  295 + confirmButtonText: "知道了!",
  296 + cancelButtonText: "不懂!",
  297 + closeOnConfirm: false },
  298 + function(isConfirm){
  299 + if(isConfirm){
  300 + var win1 = window.open("http://114.80.178.12:29088/login2.html","线路信息编辑","false");
  301 + setTimeout(function(){
  302 + window.open("http://114.80.178.12:29088/pages/base/stationroute/list.html?no="+lineId,"线路信息编辑","false");
  303 + },1500);
  304 + swal.close();
  305 + }
  306 + });
  307 +}
  308 +
  309 +function issueBnt(id){
  310 + swal({
  311 + title: "发布说明",
  312 + text: "重复发布会覆盖已有的数据,请确认线路信息正确后发布,发布后需要几分钟后才能再次发布!",
  313 + type: "warning",
  314 + showCancelButton: true,
  315 + confirmButtonColor: "#DD6B55",
  316 + confirmButtonText: "确定发布!",
  317 + cancelButtonText: "取消发布!",
  318 + closeOnConfirm: false },
  319 + function(){
  320 + $.post('/lineVersions/issueVersion',{'id':id},function(result){
  321 + if(result.status=='SUCCESS') {
  322 + // 弹出添加成功提示消息
  323 + swal("发布!", "线路站点及走向已发布至历史库,待到版本启用时间自动更新。", "success");
  324 + } else if(result.status=='ERROR') {
  325 + // 弹出添加失败提示消息
  326 + swal("发布失败!", "您发布的信息可能有误,请检查!", "ERROR");
  327 + }
  328 +// loadPage('list.html');
  329 + // 发布后刷新页面
  330 + var pData = getParams();
  331 + pData['line.name_like'] = splitxlName(pData['line.name_like']);
  332 + loadTableDate(pData, false);
  333 + });
  334 + });
  335 +}
286 336 \ No newline at end of file
... ...
src/main/resources/static/pages/base/lineversions/list.html
... ... @@ -26,7 +26,7 @@
26 26 </div>
27 27 <div class="actions">
28 28 <div class="btn-group btn-group-devided" data-toggle="buttons">
29   - <a class="btn btn-circle blue" href="add.html" data-pjax><i class="fa fa-plus"></i> 添加线路版本</a>
  29 + <a class="btn btn-circle blue" href="add.html" data-pjax><i class="fa fa-plus"></i> 添加待更新版本</a>
30 30 </div>
31 31 </div>
32 32 </div>
... ... @@ -37,9 +37,9 @@
37 37 <tr role="row" class="heading">
38 38 <th width="4%">序号</th>
39 39 <th width="5%">线路编码</th>
40   - <th width="8%">线路名称</th>
41   - <th width="8%">所属公司</th>
42   - <th width="9%">所属分公司</th>
  40 + <th width="6%">线路名称</th>
  41 + <th width="6%">所属公司</th>
  42 + <th width="6%">所属分公司</th>
43 43 <th width="8%">启用时间</th>
44 44 <th width="8%">终止时间</th>
45 45 <th width="6%">版本号</th>
... ... @@ -181,6 +181,8 @@
181 181 南汇维修公司
182 182 {{else if obj.line.brancheCompany == '5'}}
183 183 南汇公司
  184 + {{else if obj.brancheCompany == '6'}}
  185 + 航头枢纽站
184 186 {{/if}}
185 187  
186 188 {{/if}}
... ... @@ -208,6 +210,14 @@
208 210 </td>
209 211 <td>
210 212 <a href="edit.html?no={{obj.id}}" class="btn default blue-stripe btn-sm" data-pjax> 修改 </a>
  213 + {{if obj.status == '2'}}
  214 + <a class="btn default blue-stripe btn-sm" data-lineid="{{obj.line.id}}" onclick="updateVersionsRoute(this)" data-pjax> 编辑版本路线 </a>
  215 + {{/if}}
  216 + {{if obj.status == '2' && obj.isupdate!=1}}
  217 + <a class="btn btn-danger btn-sm" onclick = "issueBnt({{obj.id}})" data-pjax>发布</a>
  218 + {{else if obj.status == '2' && obj.isupdate==1}}
  219 + <a class="btn btn-danger btn-sm disabled">数据同步中</a>
  220 + {{/if}}
211 221 </td>
212 222 </tr>
213 223 {{/each}}
... ...
src/main/resources/static/pages/base/station/edit.html
... ... @@ -52,7 +52,7 @@
52 52 <span class="required"> * </span> 站点路由名称:
53 53 </label>
54 54 <div class="col-md-6">
55   - <input type="text" class="form-control" name="stationName" id="stationNameInput" placeholder="站点路由名称">
  55 + <input type="text" class="form-control" name="stationRouteName" id="stationRouteNameInput" placeholder="站点路由名称">
56 56 </div>
57 57 </div>
58 58 </div>
... ... @@ -246,7 +246,7 @@ $(&#39;#editPoitsions_station_mobal&#39;).on(&#39;editStationMobal_show&#39;, function(e, map,fu
246 246 errorClass : 'help-block help-block-error',
247 247 focusInvalid : false,
248 248 rules : {
249   - 'stationName' : {required : true},// 站点路由名称 必填项
  249 + 'stationRouteName' : {required : true},// 站点路由名称 必填项
250 250 'stationCod': {required : true,},// 站点编码 必填项
251 251 'directions' : {required : true,dirIs : true},// 站点方向 必填项 必填项
252 252 'stationRouteCode' : {isStart : true},// 站点序号
... ...
src/main/resources/static/pages/base/station/js/add-vmap-world.js
... ... @@ -140,7 +140,7 @@ var StationPVmapWorlds = function() {
140 140 });
141 141 },
142 142 // 打开绘画工具
143   - drawingManagerOpen : function(map) {
  143 + drawingManagerOpen : function() {
144 144 // 打开鼠标绘画工具
145 145 drawingManager.open();
146 146 // 设置属性
... ...
src/main/resources/static/pages/base/station/js/station-positions-function.js
... ... @@ -26,7 +26,7 @@ var PositionsPublicFunctions = function () {
26 26 // 中心坐标点
27 27 var point = new BMap.Point(BJwpoints[0], BJwpoints[1]);
28 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].stationName + '</span>' +
  29 + '<span style="color:#DDD;font-size: 15px;">站点名称:' + r[0].zdmc + '</span>' +
30 30 '<span class="help-block" style="color:#DDD;font-size: 15px;">站点编码:' + r[0].stationCode + '</span>' +
31 31 '<span class="help-block" style="color:#DDD;font-size: 15px;">站点序号:' + r[0].stationRouteCode + '</span>' +
32 32 '<span class="help-block" style="color:#DDD;font-size: 15px;">站点类型:' + markTypeStr + '</span>' +
... ... @@ -47,7 +47,7 @@ var PositionsPublicFunctions = function () {
47 47 // 信息窗位置偏移值。
48 48 offset: new BMap.Size(500,80),
49 49 //标题
50   - title : '<h4 style="color:#FFFFFF">'+r[0].stationName+'站详情</h4>',
  50 + title : '<h4 style="color:#FFFFFF">'+r[0].zdmc+'站详情</h4>',
51 51 //设置不允许信窗发送短息
52 52 enableMessage : false,
53 53 //是否开启点击地图关闭信息窗口
... ... @@ -123,7 +123,7 @@ var PositionsPublicFunctions = function () {
123 123 // 获取站点名称元素设值
124 124 $('#zdmcInput').val(stationObj.zdmc);
125 125 // 获取站点名称元素设值
126   - $('#stationNameInput').val(stationObj.stationName);
  126 + $('#stationRouteNameInput').val(stationObj.stationRouteName);
127 127 // 获取站点编码元素设值
128 128 $('#stationCodInput').val(stationObj.stationCode);
129 129 // 获取站点类型元素设值
... ... @@ -183,7 +183,7 @@ var PositionsPublicFunctions = function () {
183 183 // 站点名称
184 184 $('#zdmcInput').val(stationObj.zdmc);
185 185 // 站点路由线路名称
186   - $('#stationNameInput').val(stationObj.stationName);
  186 + $('#stationRouteNameInput').val(stationObj.stationRouteName);
187 187 // 获取站点类型元素设值
188 188 $('#stationMarkSelect').val(stationObj.stationRouteStationMark);
189 189 // 获取站点方向元素设值
... ...
src/main/resources/static/pages/base/station/js/station-positions-map.js
... ... @@ -136,11 +136,11 @@ var StationPositionsWorldsBMap = function () {
136 136 $('#editPoitsions_station_mobal').trigger('editStationMobal_show', [StationPositionsWorldsBMap,PositionsPublicFunctions,PositionsStationObj]);
137 137 });
138 138 });
139   - // 编辑多
  139 + // 编辑多
140 140 }else if(stationShapesTypeV =='d') {
141 141 // 开启编辑功能(自 1.1 新增)
142 142 polygon.enableEditing();
143   - // 添加多行编辑事件
  143 + // 添加多行编辑事件
144 144 polygon.addEventListener('dblclick',function(e) {
145 145 // 获取编辑的多边形对象
146 146 var edit_pointE = polygon;
... ...
src/main/resources/static/pages/base/station/list_edit.html
... ... @@ -278,7 +278,5 @@
278 278 <!-- 表单组件 END -->
279 279 </div>
280 280 <!-- 信息容器组件 END -->
281   -
282   -<script src="/pages/base/station/js/positionstation.js"></script>
283 281 <script src="/pages/base/station/js/station-positions-function.js"></script>
284 282 <script src="/pages/base/station/js/station-list-edit.js"></script>
285 283 \ No newline at end of file
... ...
src/main/resources/static/pages/base/stationroute/edit.html
... ... @@ -197,7 +197,6 @@ $(&#39;#edit_station_mobal&#39;).on(&#39;editSelectMobal_show&#39;, function(e, map_,ajaxd,stati
197 197 layer.closeAll();
198 198 var editStationParmasObj = station_.getEitdStation();
199 199 var addLine = Line_.getLineObj();
200   - debugger
201 200 fun.setFormValue(editStationParmasObj);
202 201 var initzdlyP = {'lineCode_eq':editStationParmasObj.stationRouteLineCode,'destroy_eq':0,'directions_eq':editStationParmasObj.stationRouteDirections};
203 202 initSelect(initzdlyP);
... ... @@ -336,8 +335,12 @@ $(&#39;#edit_station_mobal&#39;).on(&#39;editSelectMobal_show&#39;, function(e, map_,ajaxd,stati
336 335 function setZdlyValue() {
337 336 ajaxd.findUpStationRouteCode(editStationParmasObj.stationRouteLine,editStationParmasObj.stationRouteDirections,editStationParmasObj.stationRouteStationRouteCode,function(str) {
338 337 if(str.length>0){
339   - /* var upStationRouteCode = str[0].stationRouteCode + '_' + str[0].stationRouteMarke + '_' + editStationParmasObj.stationRouteDirections; */
340   - var upStationRouteCode = str[0].stationRouteCode + '_' + editStationParmasObj.stationRouteStationMark + '_' + editStationParmasObj.stationRouteDirections;
  338 + var upStationRouteCode;
  339 + if (editStationParmasObj.stationRouteStationMark == 'E') {
  340 + upStationRouteCode = str[0].stationRouteCode + '_' + 'E' + '_' + editStationParmasObj.stationRouteDirections;
  341 + } else{
  342 + upStationRouteCode = str[0].stationRouteCode + '_' + str[0].stationRouteMarke + '_' + editStationParmasObj.stationRouteDirections;
  343 + }
341 344 $('#stationrouteSelect').select2('val',upStationRouteCode);
342 345 }else {
343 346 $('#stationrouteSelect').select2('val','请选择...');
... ...
src/main/resources/static/pages/base/stationroute/js/stationroute-ajax-getdata.js
... ... @@ -130,7 +130,7 @@ var GetAjaxData = function(){
130 130  
131 131 },
132 132  
133   - // 查询路段信息
  133 + // 查询站点信息
134 134 getStationRouteInfo : function(lineId,direction,callback) {
135 135 $get('/stationroute/all',{'line.id_eq' : lineId , 'directions_eq' : direction},function(resultdata) {
136 136 callback && callback(resultdata);
... ...
src/main/resources/static/pages/base/stationroute/js/stationroute-list-events.js
... ... @@ -83,10 +83,10 @@ $(function(){
83 83 $post('/stationroute/updSwitchDir?lineIds='+ Line.id,null,function(data) {
84 84 layer.close(index);
85 85 if(data.status=='SUCCESS') {
86   - // 弹出添加成功提示消息
  86 + // 弹出操作成功提示消息
87 87 layer.msg('操作成功...');
88 88 }else {
89   - // 弹出添加失败提示消息
  89 + // 弹出操作失败提示消息
90 90 layer.msg('操作成功...');
91 91 }
92 92 WorldsBMap.clearMarkAndOverlays();
... ... @@ -148,10 +148,10 @@ $(function(){
148 148 $post('/sectionroute/quoteSection',params,function(data) {
149 149 layer.close(index);
150 150 if(data.status=='SUCCESS') {
151   - // 弹出添加成功提示消息
  151 + // 弹出操作成功提示消息
152 152 layer.msg('操作成功...');
153 153 }else {
154   - // 弹出添加失败提示消息
  154 + // 弹出操作失败提示消息
155 155 layer.msg('操作成功...');
156 156 }
157 157 WorldsBMap.clearMarkAndOverlays();
... ... @@ -254,10 +254,10 @@ $(function(){
254 254 var params = {lineId:lineIdEvents.id};
255 255 GetAjaxData.createUsingSingle(params,function(data) {
256 256 if(data.status=='SUCCESS') {
257   - // 弹出添加成功提示消息
  257 + // 弹出生成成功提示消息
258 258 layer.msg('生成成功...');
259 259 }else {
260   - // 弹出添加失败提示消息
  260 + // 弹出生成失败提示消息
261 261 layer.msg('生成失败...');
262 262 }
263 263 });
... ...
src/main/resources/static/pages/base/stationroute/js/stationroute-list-function.js
... ... @@ -244,32 +244,41 @@ var PublicFunctions = function () {
244 244 params.shapesType = 'r';
245 245 // destroy:是否撤销
246 246 params.destroy = '0';
247   - // versions:版本号
248   - params.versions = '1';
  247 +
249 248 // 路段信息JSON字符串
250 249 params.sectionJSON = sectionJSON;
251 250 // 限速
252 251 params.speedLimit = '60';
253 252 params.baseRes = 'No';
254   - // 保存
255   - GetAjaxData.collectionSave(params,function(rd) {
256   - if(rd.status='SUCCESS') {
257   - // 关闭弹出层
258   - layer.closeAll();
259   - layer.msg('保存成功!');
260   - }else {
261   - // 保存失败
262   - layer.msg('保存失败!');
263   - }
264   - // 刷新树
265   - PublicFunctions.resjtreeDate(addLine.id,directionData);
266   - /** 查询上行路段信息 @param:<Line.id:线路Id;0:上行> @return:data:路段数据 */
267   - GetAjaxData.getSectionRouteInfo(addLine.id,directionData,function(data) {
268   - /** 在地图上画出线路走向 @param:<Line.id:线路Id;0:上行;data:路段数据> */
269   - PublicFunctions.linePanlThree(addLine.id,data,directionData);
270   - });
  253 + // 获取版本号后提交添加
  254 + $.get('/lineVersions/findByLineId',{'lineId':addLine.id},function(lineVersions){
  255 + $.each(lineVersions,function(){
  256 + if (this.status == 1) {
  257 + // versions:版本号
  258 + params.versions = this.versions;
  259 + // 保存
  260 + GetAjaxData.collectionSave(params,function(rd) {
  261 + if(rd.status='SUCCESS') {
  262 + // 关闭弹出层
  263 + layer.closeAll();
  264 + layer.msg('保存成功!');
  265 + }else {
  266 + // 保存失败
  267 + layer.msg('保存失败!');
  268 + }
  269 + // 刷新树
  270 + PublicFunctions.resjtreeDate(addLine.id,directionData);
  271 + /** 查询上行路段信息 @param:<Line.id:线路Id;0:上行> @return:data:路段数据 */
  272 + GetAjaxData.getSectionRouteInfo(addLine.id,directionData,function(data) {
  273 + /** 在地图上画出线路走向 @param:<Line.id:线路Id;0:上行;data:路段数据> */
  274 + PublicFunctions.linePanlThree(addLine.id,data,directionData);
  275 + });
  276 + });
  277 + }
  278 + })
271 279 });
272 280  
  281 +
273 282 });
274 283 }
275 284 });
... ...
src/main/resources/static/pages/base/stationroute/list.html
... ... @@ -13,7 +13,7 @@
13 13 </div>
14 14 </div>
15 15 <!-- 左边栏 -->
16   - <div class="portlet-body" id="scrllmouseEvent" style="border: 1px solid rgb(255, 255, 255); display: block;min-height: 380px;">
  16 + <div class="portlet-body" id="scrllmouseEvent" style="border: 1px solid rgb(255, 255, 255); display: block;min-height: 420px;">
17 17 <div class="row">
18 18 <!-- 上下行栏 -->
19 19 <div class="col-md-3 col-sm-3 col-xs-3">
... ...
src/main/resources/static/pages/base/timesmodel/js/v2/core/InternalBcObj.js
... ... @@ -42,10 +42,28 @@ var InternalBcObj = function(
42 42 // 标记参数,这个班次用于计算,最后必须删除
43 43 this._$_bDelFlag = false;
44 44  
  45 + // 是否首末站
  46 + this._$_bIsFirstBc = false;
  47 + this._$_bIsLastBc = false;
  48 +
45 49 };
46 50  
47 51 //------------------- get/set 方法 -------------------//
48 52  
  53 +InternalBcObj.prototype.fnSetIsFirstBc = function(bFlag) {
  54 + this._$_bIsFirstBc = true;
  55 +};
  56 +InternalBcObj.prototype.fnIsFirstBc = function() {
  57 + return this._$_bIsFirstBc;
  58 +};
  59 +
  60 +InternalBcObj.prototype.fnSetIsLastBc = function(bFlag) {
  61 + this._$_bIsLastBc = bFlag;
  62 +};
  63 +InternalBcObj.prototype.fnIsLastBc = function() {
  64 + return this._$_bIsLastBc;
  65 +};
  66 +
49 67 InternalBcObj.prototype.fnSetEatTime = function(iTime) {
50 68 this._$_iEatTime = iTime;
51 69 };
... ...
src/main/resources/static/pages/base/timesmodel/js/v2/core/InternalLpObj.js
... ... @@ -455,7 +455,7 @@ InternalLpObj.prototype.removeBc = function(qIndex, bcIndex) {
455 455 * @param hasDown boolean 计算下行班次
456 456 * @returns [{第几圈},{第几个班次}]
457 457 */
458   -InternalLpObj.prototype.getgetQBcIndexWithFcTimeFromGroupArray = function(
  458 +InternalLpObj.prototype.fnGetQBcIndexWithFcTimeFromGroupArray = function(
459 459 fctime, groupArray, hasUp, hasDown
460 460 ) {
461 461 var i;
... ... @@ -468,11 +468,15 @@ InternalLpObj.prototype.getgetQBcIndexWithFcTimeFromGroupArray = function(
468 468 var bc2time;
469 469  
470 470 var tempdiff;
  471 +
  472 + console.log("比较时间=" + fctime.format("HH:mm"));
  473 +
471 474 for (i = 0; i < this._$_qCount; i++) {
472 475 group = groupArray[i];
473 476 if (group) {
474 477 if (group.getBc1() && hasUp) {
475 478 bc1time = group.getBc1().getFcTimeObj();
  479 + console.log("bc1time=" + bc1time.format("HH:mm") + " tempdiff=" + tempdiff);
476 480 tempdiff = Math.abs(bc1time.diff(fctime));
477 481  
478 482 if (!timediff) {
... ... @@ -485,7 +489,7 @@ InternalLpObj.prototype.getgetQBcIndexWithFcTimeFromGroupArray = function(
485 489 qIndex = i;
486 490 bcIndex = 0;
487 491 } if (Math.abs(tempdiff) == timediff) {
488   - if (bc1time.isBefore(fctime)) {
  492 + if (bc1time.isAfter(fctime)) {
489 493 timediff = tempdiff;
490 494 qIndex = i;
491 495 bcIndex = 0;
... ... @@ -497,6 +501,7 @@ InternalLpObj.prototype.getgetQBcIndexWithFcTimeFromGroupArray = function(
497 501  
498 502 if (group.getBc2() && hasDown) {
499 503 bc2time = group.getBc2().getFcTimeObj();
  504 + console.log("bc2time=" + bc2time.format("HH:mm") + " tempdiff=" + tempdiff);
500 505 tempdiff = Math.abs(bc2time.diff(fctime));
501 506  
502 507 if (!timediff) {
... ... @@ -521,6 +526,8 @@ InternalLpObj.prototype.getgetQBcIndexWithFcTimeFromGroupArray = function(
521 526 }
522 527 }
523 528  
  529 + console.log("中标线对应数组索引=" + qIndex);
  530 +
524 531 var rst = [];
525 532 rst.push(qIndex);
526 533 rst.push(bcIndex);
... ... @@ -540,7 +547,7 @@ InternalLpObj.prototype.getgetQBcIndexWithFcTimeFromGroupArray = function(
540 547 InternalLpObj.prototype.getQBcIndexWithFcTime = function(
541 548 fctime, hasUp, hasDown
542 549 ) {
543   - return this.getgetQBcIndexWithFcTimeFromGroupArray(fctime, this._$_groupBcArray, hasUp, hasDown);
  550 + return this.fnGetQBcIndexWithFcTimeFromGroupArray(fctime, this._$_groupBcArray, hasUp, hasDown);
544 551 };
545 552  
546 553 //---------------------- 内部数据初始化方法(不同于构造函数)---------------------//
... ... @@ -794,6 +801,10 @@ InternalLpObj.prototype.fnAdjustBcInterval = function(iPeakAverStopTime, iTrough
794 801 iBcIndex == 0 ? iQIndex : iQIndex + 1,
795 802 iBcIndex == 0 ? 1 : 0);
796 803  
  804 + if (oNextBc.fnIsFirstBc()) { // 如果同一路牌连续2个方向首站班次,都不做处理
  805 + continue;
  806 + }
  807 +
797 808 // 不改变当前班次的行驶时间,修正停站时间和下一个班次的发车时间
798 809 iBcStopTime = oNextBc.getFcTimeObj().diff(oBc.getArrTimeObj(), "m");
799 810 if (iBcStopTime < 0) {
... ...
src/main/resources/static/pages/base/timesmodel/js/v2/core/InternalScheduleObj.js
... ... @@ -116,6 +116,8 @@ var InternalScheduleObj = function(paramObj, lpArray, factory) {
116 116  
117 117 // 以上标线为基础,计算各种班型工时对应的圈数、班次数
118 118 var aBcArray = _internalLpArray[0].getBcArray();
  119 + aBcArray[0].fnSetIsFirstBc(true); // 设置首班班次标识
  120 +
119 121 if (aBcArray.length % 2 != 0) { // 不能整除2,去除一个班次计算
120 122 aBcArray.splice(aBcArray.length - 1, 1);
121 123 }
... ... @@ -487,6 +489,7 @@ var InternalScheduleObj = function(paramObj, lpArray, factory) {
487 489 //------------------------ 2、找出中标线的早高峰班次,计算应该插在当前路牌数组的那个位置 ----------------//
488 490 // 找出中标线对应的早高峰的班次对象
489 491 var oZb_gf_bc = oTempLp.getBc(_approximate_zgfQIndex, _approximate_zgfBIndex);
  492 + //alert(oZb_gf_bc.getFcTimeObj().format("HH:mm"));
490 493  
491 494 // 把所有连班路牌高峰班次重新构造成一个一个的圈数组,计算对应中标线最近的是第几个路牌
492 495 // 中标线和上标线一样在连班路牌上
... ... @@ -516,38 +519,44 @@ var InternalScheduleObj = function(paramObj, lpArray, factory) {
516 519  
517 520 }
518 521  
519   - var aTtindex = oTempLp.getgetQBcIndexWithFcTimeFromGroupArray(
  522 + var aTtindex = oTempLp.fnGetQBcIndexWithFcTimeFromGroupArray( // 找出最接近中标线的路牌索引
520 523 oZb_gf_bc.getFcTimeObj(),
521 524 aTempq,
522 525 true,
523 526 true
524 527 );
525 528  
526   - // 注意:如果中标线和上标线同一个路牌,需要把中标线移到下一个路牌
527   - if (aTtindex[0] == 0) { // 0是上标线路牌索引
528   - aTtindex[0] = aLbIndexes[1]; // 选择下一个连班路牌索引
529   - }
  529 + _iZbx_lpIndex = aLbIndexes[aTtindex[0]]; // 中标线放在第几个路牌
530 530  
531   - _iZbx_lpIndex = aTtindex[0]; // 中标线放在第几个路牌
532   - oTempLp.setLp(_lpArray[_iZbx_lpIndex]); // 设置原始路牌对象
533   - oTempLp._$_aVerticalIntervalTime = _internalLpArray[_iZbx_lpIndex]._$_aVerticalIntervalTime; // 设置纵向最小发车间隔
534   - oTempLp.setBxLb(_internalLpArray[_iZbx_lpIndex].isBxLb());
535   - oTempLp.setBxFb(_internalLpArray[_iZbx_lpIndex].isBxFb());
536   - oTempLp.setBxFb5_2(_internalLpArray[_iZbx_lpIndex].isBxFb5_2());
537   -
538   - // 修正除了第一个班次外,其余其他班次
539   - var iBcindex = 0;
540   - for (i = 1; i < _qCount; i++) {
541   - while (iBcindex <= 1) {
542   - if (oTempLp.getBc(i, iBcindex)) { // 替换存在的班次
543   - oTempLp.setBc(i, iBcindex, _fnGenerateBc(_iZbx_lpIndex, i, iBcindex));
  531 + oTempLp.getMinBcObj().fnSetIsFirstBc(true); // 设置首班班次标识
  532 +
  533 + if (_iZbx_lpIndex == 0) { // 如果中标线和上标线一致
  534 + var oFirstBcIndexes = oTempLp.getMinBcObjPosition();
  535 + var oFirstBc = oTempLp.getMinBcObj();
  536 + oFirstBc.setLp(_internalLpArray[_iZbx_lpIndex]);
  537 + oFirstBc.fnSetDelFlag(false);
  538 + _internalLpArray[_iZbx_lpIndex].setBc(oFirstBcIndexes[0], oFirstBcIndexes[1], oFirstBc);
  539 + } else {
  540 + oTempLp.setLp(_lpArray[_iZbx_lpIndex]); // 设置原始路牌对象
  541 + oTempLp._$_aVerticalIntervalTime = _internalLpArray[_iZbx_lpIndex]._$_aVerticalIntervalTime; // 设置纵向最小发车间隔
  542 + oTempLp.setBxLb(_internalLpArray[_iZbx_lpIndex].isBxLb());
  543 + oTempLp.setBxFb(_internalLpArray[_iZbx_lpIndex].isBxFb());
  544 + oTempLp.setBxFb5_2(_internalLpArray[_iZbx_lpIndex].isBxFb5_2());
  545 +
  546 + // 修正除了第一个班次外,其余其他班次
  547 + var iBcindex = 0;
  548 + for (i = 1; i < _qCount; i++) {
  549 + while (iBcindex <= 1) {
  550 + if (oTempLp.getBc(i, iBcindex)) { // 替换存在的班次
  551 + oTempLp.setBc(i, iBcindex, _fnGenerateBc(_iZbx_lpIndex, i, iBcindex));
  552 + }
  553 + iBcindex ++;
544 554 }
545   - iBcindex ++;
  555 + iBcindex = 0;
546 556 }
547   - iBcindex = 0;
548   - }
549 557  
550   - _internalLpArray[_iZbx_lpIndex] = oTempLp;
  558 + _internalLpArray[_iZbx_lpIndex] = oTempLp;
  559 + }
551 560  
552 561 console.log("中标线对应第" + (_iZbx_lpIndex + 1) + "个路牌");
553 562  
... ... @@ -1288,6 +1297,7 @@ var InternalScheduleObj = function(paramObj, lpArray, factory) {
1288 1297 }
1289 1298 aBc[iModifyIndex].addMinuteToFcsj(iTimeDiff); // 替换成末班车时间
1290 1299 aBc[iModifyIndex].fnSetDelFlag(false);
  1300 + aBc[iModifyIndex].fnSetIsLastBc(true);
1291 1301 for (i = iModifyIndex + 1; i < aBc.length; i++) { // 删除多余班次
1292 1302 _qIsUp == oLastBcIsUp ?
1293 1303 aBc[i]._$$_internal_group_obj.setBc1(undefined) :
... ... @@ -1334,6 +1344,7 @@ var InternalScheduleObj = function(paramObj, lpArray, factory) {
1334 1344 }
1335 1345 aBc[iModifyIndex].addMinuteToFcsj(iTimeDiff); // 替换成末班车时间
1336 1346 aBc[iModifyIndex].fnSetDelFlag(false);
  1347 + aBc[iModifyIndex].fnSetIsLastBc(true);
1337 1348 for (i = iModifyIndex + 1; i < aBc.length; i++) { // 删除多余班次
1338 1349 _qIsUp == oLastBcIsUp ?
1339 1350 aBc[i]._$$_internal_group_obj.setBc1(undefined) :
... ... @@ -1607,7 +1618,9 @@ var InternalScheduleObj = function(paramObj, lpArray, factory) {
1607 1618 fnRemoveDelFirstFlagBc: function() {
1608 1619 var oLp = _internalLpArray[0];
1609 1620 var aMinBcIndex = oLp.getMinBcObjPosition();
1610   - oLp.removeBc(aMinBcIndex[0], aMinBcIndex[1]);
  1621 + if (oLp.getBc(aMinBcIndex[0], aMinBcIndex[1]).fnIsDelFlag()) {
  1622 + oLp.removeBc(aMinBcIndex[0], aMinBcIndex[1]);
  1623 + }
1611 1624 },
1612 1625 /**
1613 1626 * 祛除上标线结尾的删除标记的班次。
... ...