Commit c389e2c48e5f54b795a2f68df94b04cb199321db
1 parent
12665bca
更新线路版本
Showing
51 changed files
with
1535 additions
and
263 deletions
src/main/java/com/bsth/controller/LineController.java
| @@ -90,7 +90,7 @@ public class LineController extends BaseController<Line, Integer> { | @@ -90,7 +90,7 @@ public class LineController extends BaseController<Line, Integer> { | ||
| 90 | lineVersions.setName("原始版本"); | 90 | lineVersions.setName("原始版本"); |
| 91 | lineVersions.setLine(t); | 91 | lineVersions.setLine(t); |
| 92 | lineVersions.setLineCode(t.getLineCode()); | 92 | lineVersions.setLineCode(t.getLineCode()); |
| 93 | - lineVersions.setStartDate(t.getCreateDate()); | 93 | + lineVersions.setStartDate(new java.sql.Date(new Date().getTime())); |
| 94 | lineVersions.setEndDate(new java.sql.Date(endDate.getTime()));// 2088-8-8 00:00:00 | 94 | lineVersions.setEndDate(new java.sql.Date(endDate.getTime()));// 2088-8-8 00:00:00 |
| 95 | lineVersions.setVersions(1); | 95 | lineVersions.setVersions(1); |
| 96 | lineVersions.setStatus(1); | 96 | lineVersions.setStatus(1); |
src/main/java/com/bsth/controller/LineVersionsController.java
| @@ -85,4 +85,12 @@ public class LineVersionsController extends BaseController<LineVersions, Integer | @@ -85,4 +85,12 @@ public class LineVersionsController extends BaseController<LineVersions, Integer | ||
| 85 | return service.findCurrentVersion(lineId); | 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,6 +10,7 @@ import org.springframework.web.bind.annotation.RequestParam; | ||
| 10 | import org.springframework.web.bind.annotation.RestController; | 10 | import org.springframework.web.bind.annotation.RestController; |
| 11 | 11 | ||
| 12 | import com.bsth.entity.SectionRoute; | 12 | import com.bsth.entity.SectionRoute; |
| 13 | +import com.bsth.entity.StationRouteCache; | ||
| 13 | import com.bsth.service.SectionRouteService; | 14 | import com.bsth.service.SectionRouteService; |
| 14 | 15 | ||
| 15 | /** | 16 | /** |
| @@ -55,6 +56,12 @@ public class SectionRouteController extends BaseController<SectionRoute, Integer | @@ -55,6 +56,12 @@ public class SectionRouteController extends BaseController<SectionRoute, Integer | ||
| 55 | public Iterable<SectionRoute> list(@RequestParam Map<String, Object> map) { | 56 | public Iterable<SectionRoute> list(@RequestParam Map<String, Object> map) { |
| 56 | return routeService.list(map); | 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 | * @Description :TODO(查询路段信息) | 67 | * @Description :TODO(查询路段信息) |
| @@ -76,8 +83,8 @@ public class SectionRouteController extends BaseController<SectionRoute, Integer | @@ -76,8 +83,8 @@ public class SectionRouteController extends BaseController<SectionRoute, Integer | ||
| 76 | * | 83 | * |
| 77 | * @return Map<String, Object> | 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 | return routeService.getSectionRouteCache(map); | 88 | return routeService.getSectionRouteCache(map); |
| 82 | } | 89 | } |
| 83 | 90 | ||
| @@ -105,6 +112,11 @@ public class SectionRouteController extends BaseController<SectionRoute, Integer | @@ -105,6 +112,11 @@ public class SectionRouteController extends BaseController<SectionRoute, Integer | ||
| 105 | return routeService.findUpSectionRouteCode(map); | 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 | * @Description :TODO(引用路段) | 121 | * @Description :TODO(引用路段) |
| 110 | * | 122 | * |
src/main/java/com/bsth/controller/StationController.java
| @@ -157,4 +157,15 @@ public class StationController extends BaseController<Station, Integer> { | @@ -157,4 +157,15 @@ public class StationController extends BaseController<Station, Integer> { | ||
| 157 | return GetUIDAndCode.getStationId(); | 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,6 +69,12 @@ public class LineVersions{ | ||
| 69 | */ | 69 | */ |
| 70 | private int status; | 70 | private int status; |
| 71 | 71 | ||
| 72 | + /** | ||
| 73 | + * 是否发布 int length(1) | ||
| 74 | + * 0(没有),1(发布) | ||
| 75 | + */ | ||
| 76 | + private int isupdate; | ||
| 77 | + | ||
| 72 | public Integer getId() { | 78 | public Integer getId() { |
| 73 | return id; | 79 | return id; |
| 74 | } | 80 | } |
| @@ -156,5 +162,13 @@ public class LineVersions{ | @@ -156,5 +162,13 @@ public class LineVersions{ | ||
| 156 | public void setStatus(int status) { | 162 | public void setStatus(int status) { |
| 157 | this.status = status; | 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 | \ No newline at end of file | 175 | \ No newline at end of file |
src/main/java/com/bsth/repository/LineVersionsRepository.java
| @@ -79,4 +79,12 @@ public interface LineVersionsRepository extends BaseRepository<LineVersions, Int | @@ -79,4 +79,12 @@ public interface LineVersionsRepository extends BaseRepository<LineVersions, Int | ||
| 79 | */ | 79 | */ |
| 80 | @Query(value = " SELECT lv.versions FROM LineVersions lv where lv.line.id = ?1 and lv.status=1") | 80 | @Query(value = " SELECT lv.versions FROM LineVersions lv where lv.line.id = ?1 and lv.status=1") |
| 81 | public Integer findCurrentVersion(Integer id); | 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<LsSectionRoute, | @@ -37,4 +37,11 @@ public interface LsSectionRouteRepository extends BaseRepository<LsSectionRoute, | ||
| 37 | @Modifying | 37 | @Modifying |
| 38 | @Query(value="DELETE from bsth_c_ls_sectionroute where line = ?1 and directions = ?2 and versions=?3", nativeQuery=true) | 38 | @Query(value="DELETE from bsth_c_ls_sectionroute where line = ?1 and directions = ?2 and versions=?3", nativeQuery=true) |
| 39 | public void batchDelete(Integer line, Integer dir, Integer versions); | 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<LsStationRoute, | @@ -42,4 +42,14 @@ public interface LsStationRouteRepository extends BaseRepository<LsStationRoute, | ||
| 42 | @Modifying | 42 | @Modifying |
| 43 | @Query(value="DELETE from bsth_c_ls_stationroute where line = ?1 and directions = ?2 and versions = ?3", nativeQuery=true) | 43 | @Query(value="DELETE from bsth_c_ls_stationroute where line = ?1 and directions = ?2 and versions = ?3", nativeQuery=true) |
| 44 | public void batchDelete(Integer line,Integer dir, Integer versions); | 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<SectionRoute | @@ -139,4 +139,18 @@ public interface SectionRouteCacheRepository extends BaseRepository<SectionRoute | ||
| 139 | @Modifying | 139 | @Modifying |
| 140 | @Query(value="delete from bsth_c_sectionroute_cache where line_code = ?1 and directions = ?2", nativeQuery=true) | 140 | @Query(value="delete from bsth_c_sectionroute_cache where line_code = ?1 and directions = ?2", nativeQuery=true) |
| 141 | public void sectionRouteCacheDel(String lineCode,Integer dir); | 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 | \ No newline at end of file | 157 | \ No newline at end of file |
src/main/java/com/bsth/repository/SectionRouteRepository.java
| @@ -202,4 +202,7 @@ public interface SectionRouteRepository extends BaseRepository<SectionRoute, Int | @@ -202,4 +202,7 @@ public interface SectionRouteRepository extends BaseRepository<SectionRoute, Int | ||
| 202 | @Modifying | 202 | @Modifying |
| 203 | @Query(value="delete from SectionRoute sr where sr.line.id = ?1 and sr.lineCode = ?2") | 203 | @Query(value="delete from SectionRoute sr where sr.line.id = ?1 and sr.lineCode = ?2") |
| 204 | public void batchDelete(Integer lineId, String lineCode); | 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 | package com.bsth.repository; | 1 | package com.bsth.repository; |
| 2 | 2 | ||
| 3 | import java.util.List; | 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 | import org.springframework.data.jpa.repository.EntityGraph; | 5 | import org.springframework.data.jpa.repository.EntityGraph; |
| 9 | import org.springframework.data.jpa.repository.Modifying; | 6 | import org.springframework.data.jpa.repository.Modifying; |
| 10 | import org.springframework.data.jpa.repository.Query; | 7 | import org.springframework.data.jpa.repository.Query; |
| 11 | import org.springframework.stereotype.Repository; | 8 | import org.springframework.stereotype.Repository; |
| 12 | 9 | ||
| 13 | -import com.bsth.entity.StationRoute; | ||
| 14 | import com.bsth.entity.StationRouteCache; | 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<StationRoute | @@ -57,12 +52,16 @@ public interface StationRouteCacheRepository extends BaseRepository<StationRoute | ||
| 57 | /** | 52 | /** |
| 58 | * 更新路线删除线路缓存站点 | 53 | * 更新路线删除线路缓存站点 |
| 59 | * | 54 | * |
| 60 | - * @param line | 55 | + * @param lineCode |
| 61 | * @param dir | 56 | * @param dir |
| 62 | */ | 57 | */ |
| 63 | @Modifying | 58 | @Modifying |
| 64 | @Query(value="delete from bsth_c_stationroute_cache where line_code = ?1 and directions = ?2 ", nativeQuery=true) | 59 | @Query(value="delete from bsth_c_stationroute_cache where line_code = ?1 and directions = ?2 ", nativeQuery=true) |
| 65 | public void stationRouteCacheDel(String lineCode,Integer dir); | 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 | @Query(value = "SELECT a.`stationRoute.id`," + | 67 | @Query(value = "SELECT a.`stationRoute.id`," + |
| @@ -137,4 +136,7 @@ public interface StationRouteCacheRepository extends BaseRepository<StationRoute | @@ -137,4 +136,7 @@ public interface StationRouteCacheRepository extends BaseRepository<StationRoute | ||
| 137 | "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) | 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 | List<Object[]> findUpStationRouteCode(Integer lineId,Integer direction,Integer stationRouteCode); | 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<StationRoute, Int | @@ -188,7 +188,7 @@ public interface StationRouteRepository extends BaseRepository<StationRoute, Int | ||
| 188 | " a.stationRouteUpdateDate," + | 188 | " a.stationRouteUpdateDate," + |
| 189 | " b.id AS stationId," + | 189 | " b.id AS stationId," + |
| 190 | " b.station_cod AS stationCode," + | 190 | " b.station_cod AS stationCode," + |
| 191 | - " b.station_name AS stationName," + | 191 | + " a.stationRouteName," + |
| 192 | " b.road_coding AS stationRoadCoding," + | 192 | " b.road_coding AS stationRoadCoding," + |
| 193 | " b.db_type AS stationDbType," + | 193 | " b.db_type AS stationDbType," + |
| 194 | " b.b_jwpoints AS stationJwpoints," + | 194 | " b.b_jwpoints AS stationJwpoints," + |
| @@ -211,6 +211,7 @@ public interface StationRouteRepository extends BaseRepository<StationRoute, Int | @@ -211,6 +211,7 @@ public interface StationRouteRepository extends BaseRepository<StationRoute, Int | ||
| 211 | " FROM ( SELECT s.id AS stationRouteId," + | 211 | " FROM ( SELECT s.id AS stationRouteId," + |
| 212 | " s.line AS stationRouteLine," + | 212 | " s.line AS stationRouteLine," + |
| 213 | " s.station as stationRouteStation," + | 213 | " s.station as stationRouteStation," + |
| 214 | + " s.station_name AS stationRouteName," + | ||
| 214 | " s.station_route_code as stationRouteCode," + | 215 | " s.station_route_code as stationRouteCode," + |
| 215 | " s.line_code AS stationRouteLIneCode," + | 216 | " s.line_code AS stationRouteLIneCode," + |
| 216 | " s.station_mark AS stationRouteStationMark," + | 217 | " s.station_mark AS stationRouteStationMark," + |
| @@ -258,6 +259,9 @@ public interface StationRouteRepository extends BaseRepository<StationRoute, Int | @@ -258,6 +259,9 @@ public interface StationRouteRepository extends BaseRepository<StationRoute, Int | ||
| 258 | @Query("select r from StationRoute r where r.lineCode=?1 and r.directions=?2 and r.destroy=0 order by r.stationRouteCode") | 259 | @Query("select r from StationRoute r where r.lineCode=?1 and r.directions=?2 and r.destroy=0 order by r.stationRouteCode") |
| 259 | List<StationRoute> findByLine(String lineCode, int updown); | 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 | @EntityGraph(value = "stationRoute_station", type = EntityGraph.EntityGraphType.FETCH) | 265 | @EntityGraph(value = "stationRoute_station", type = EntityGraph.EntityGraphType.FETCH) |
| 262 | @Query("select s from StationRoute s where s.destroy=0 and s.lineCode=?1") | 266 | @Query("select s from StationRoute s where s.destroy=0 and s.lineCode=?1") |
| 263 | List<StationRoute> findByLineCode(String lineCode); | 267 | List<StationRoute> findByLineCode(String lineCode); |
src/main/java/com/bsth/service/LineVersionsService.java
| @@ -39,4 +39,6 @@ public interface LineVersionsService extends BaseService<LineVersions, Integer> | @@ -39,4 +39,6 @@ public interface LineVersionsService extends BaseService<LineVersions, Integer> | ||
| 39 | 39 | ||
| 40 | Map<String, Object> add(Map<String, Object> map); | 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<SectionRoute, Integer> | @@ -61,8 +61,11 @@ public interface SectionRouteService extends BaseService<SectionRoute, Integer> | ||
| 61 | */ | 61 | */ |
| 62 | List<Map<String, Object>> findUpSectionRouteCode(Map<String, Object> map); | 62 | List<Map<String, Object>> findUpSectionRouteCode(Map<String, Object> map); |
| 63 | 63 | ||
| 64 | + List<Map<String, Object>> findCacheUpSectionRouteCode(Map<String, Object> map); | ||
| 65 | + | ||
| 64 | Map<String, Object> quoteSection(Map<String, Object> map); | 66 | Map<String, Object> quoteSection(Map<String, Object> map); |
| 65 | 67 | ||
| 66 | void batchUpdate(Integer lineId, String lineCode); | 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<Station, Integer> { | @@ -52,6 +52,8 @@ public interface StationService extends BaseService<Station, Integer> { | ||
| 52 | */ | 52 | */ |
| 53 | Map<String, Object> stationSaveMap(Map<String, Object> map); | 53 | Map<String, Object> stationSaveMap(Map<String, Object> map); |
| 54 | 54 | ||
| 55 | + Map<String, Object> stationCacheSave(Map<String, Object> map); | ||
| 56 | + | ||
| 55 | /** | 57 | /** |
| 56 | * @Description :TODO(更新站点保存) | 58 | * @Description :TODO(更新站点保存) |
| 57 | * | 59 | * |
| @@ -83,5 +85,8 @@ public interface StationService extends BaseService<Station, Integer> { | @@ -83,5 +85,8 @@ public interface StationService extends BaseService<Station, Integer> { | ||
| 83 | Map<String, Object> cacheSave(Map<String, Object> map); | 85 | Map<String, Object> cacheSave(Map<String, Object> map); |
| 84 | 86 | ||
| 85 | Map<String, Object> stationCacheUpdate(Map<String, Object> map); | 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<LineVersions, Integ | @@ -258,5 +258,16 @@ public class LineVersionsServiceImpl extends BaseServiceImpl<LineVersions, Integ | ||
| 258 | public Integer findCurrentVersion(int lineId) { | 258 | public Integer findCurrentVersion(int lineId) { |
| 259 | return repository.findCurrentVersion(lineId); | 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<SectionRoute, Integ | @@ -131,8 +131,8 @@ public class SectionRouteServiceImpl extends BaseServiceImpl<SectionRoute, Integ | ||
| 131 | @Transactional | 131 | @Transactional |
| 132 | @Override | 132 | @Override |
| 133 | public List<Map<String, Object>> getSectionRouteCache(Map<String, Object> map) { | 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 | List<Object[]> listObjArray = Cacherepository.getSectionRouteCache(lineId, directions); | 136 | List<Object[]> listObjArray = Cacherepository.getSectionRouteCache(lineId, directions); |
| 137 | List<Map<String, Object>> resultList = new ArrayList<Map<String,Object>>(); | 137 | List<Map<String, Object>> resultList = new ArrayList<Map<String,Object>>(); |
| 138 | if(listObjArray.size()>0) { | 138 | if(listObjArray.size()>0) { |
| @@ -297,6 +297,23 @@ public class SectionRouteServiceImpl extends BaseServiceImpl<SectionRoute, Integ | @@ -297,6 +297,23 @@ public class SectionRouteServiceImpl extends BaseServiceImpl<SectionRoute, Integ | ||
| 297 | } | 297 | } |
| 298 | return list; | 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 | @Override | 318 | @Override |
| 302 | public Map<String, Object> quoteSection(Map<String, Object> map) { | 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,9 +7,7 @@ import java.util.HashMap; | ||
| 7 | import java.util.List; | 7 | import java.util.List; |
| 8 | import java.util.Map; | 8 | import java.util.Map; |
| 9 | 9 | ||
| 10 | -import org.mozilla.javascript.ObjArray; | ||
| 11 | import org.springframework.beans.factory.annotation.Autowired; | 10 | import org.springframework.beans.factory.annotation.Autowired; |
| 12 | -import org.springframework.data.jpa.domain.Specification; | ||
| 13 | import org.springframework.stereotype.Service; | 11 | import org.springframework.stereotype.Service; |
| 14 | import org.springframework.transaction.annotation.Transactional; | 12 | import org.springframework.transaction.annotation.Transactional; |
| 15 | 13 | ||
| @@ -17,7 +15,6 @@ import com.alibaba.fastjson.JSONArray; | @@ -17,7 +15,6 @@ import com.alibaba.fastjson.JSONArray; | ||
| 17 | import com.alibaba.fastjson.JSONObject; | 15 | import com.alibaba.fastjson.JSONObject; |
| 18 | import com.bsth.common.ResponseCode; | 16 | import com.bsth.common.ResponseCode; |
| 19 | import com.bsth.entity.Line; | 17 | import com.bsth.entity.Line; |
| 20 | -import com.bsth.entity.LineVersions; | ||
| 21 | import com.bsth.entity.LsSectionRoute; | 18 | import com.bsth.entity.LsSectionRoute; |
| 22 | import com.bsth.entity.LsStationRoute; | 19 | import com.bsth.entity.LsStationRoute; |
| 23 | import com.bsth.entity.Section; | 20 | import com.bsth.entity.Section; |
| @@ -40,7 +37,6 @@ import com.bsth.util.TransGPS; | @@ -40,7 +37,6 @@ import com.bsth.util.TransGPS; | ||
| 40 | import com.bsth.util.TransGPS.Location; | 37 | import com.bsth.util.TransGPS.Location; |
| 41 | import com.bsth.util.Geo.GeoUtils; | 38 | import com.bsth.util.Geo.GeoUtils; |
| 42 | import com.bsth.util.Geo.Point; | 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<Section, Integer> implem | @@ -171,7 +167,7 @@ public class SectionServiceImpl extends BaseServiceImpl<Section, Integer> implem | ||
| 171 | String bsectionVectorS = null; | 167 | String bsectionVectorS = null; |
| 172 | if(!sectionsBpoints.equals("")) | 168 | if(!sectionsBpoints.equals("")) |
| 173 | bsectionVectorS = "LINESTRING(" + sectionsBpoints + ")"; | 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 | SectionRoute route = new SectionRoute(); | 171 | SectionRoute route = new SectionRoute(); |
| 176 | Line line = lineRepository.findOne(sectionRouteLine); | 172 | Line line = lineRepository.findOne(sectionRouteLine); |
| 177 | Section section = repository.findOne(sectionId); | 173 | Section section = repository.findOne(sectionId); |
| @@ -663,7 +659,8 @@ public class SectionServiceImpl extends BaseServiceImpl<Section, Integer> implem | @@ -663,7 +659,8 @@ public class SectionServiceImpl extends BaseServiceImpl<Section, Integer> implem | ||
| 663 | // 路段时长 | 659 | // 路段时长 |
| 664 | Double sectionTime = map.get("sectionTime").equals("") ? null : Double.valueOf(map.get("sectionTime").toString()); | 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 | SectionRouteCache resultS = routeCacheRepository.findOne(sectionRouteId); | 664 | SectionRouteCache resultS = routeCacheRepository.findOne(sectionRouteId); |
| 668 | int old_code = resultS.getSectionrouteCode(); | 665 | int old_code = resultS.getSectionrouteCode(); |
| 669 | if(sectionrouteCode!=null) { | 666 | if(sectionrouteCode!=null) { |
src/main/java/com/bsth/service/impl/StationRouteServiceImpl.java
| @@ -1172,7 +1172,7 @@ public class StationRouteServiceImpl extends BaseServiceImpl<StationRoute, Integ | @@ -1172,7 +1172,7 @@ public class StationRouteServiceImpl extends BaseServiceImpl<StationRoute, Integ | ||
| 1172 | 1172 | ||
| 1173 | tempM.put("stationCode", objects.get(i)[19]); | 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 | tempM.put("stationRoadCoding", objects.get(i)[21]); | 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,7 +18,6 @@ import com.alibaba.fastjson.JSONObject; | ||
| 18 | import com.bsth.common.ResponseCode; | 18 | import com.bsth.common.ResponseCode; |
| 19 | import com.bsth.entity.Line; | 19 | import com.bsth.entity.Line; |
| 20 | import com.bsth.entity.LineInformation; | 20 | import com.bsth.entity.LineInformation; |
| 21 | -import com.bsth.entity.LineVersions; | ||
| 22 | import com.bsth.entity.Section; | 21 | import com.bsth.entity.Section; |
| 23 | import com.bsth.entity.SectionRoute; | 22 | import com.bsth.entity.SectionRoute; |
| 24 | import com.bsth.entity.SectionRouteCache; | 23 | import com.bsth.entity.SectionRouteCache; |
| @@ -34,7 +33,6 @@ import com.bsth.repository.SectionRouteRepository; | @@ -34,7 +33,6 @@ import com.bsth.repository.SectionRouteRepository; | ||
| 34 | import com.bsth.repository.StationRepository; | 33 | import com.bsth.repository.StationRepository; |
| 35 | import com.bsth.repository.StationRouteCacheRepository; | 34 | import com.bsth.repository.StationRouteCacheRepository; |
| 36 | import com.bsth.repository.StationRouteRepository; | 35 | import com.bsth.repository.StationRouteRepository; |
| 37 | -import com.bsth.service.LineVersionsService; | ||
| 38 | import com.bsth.service.StationService; | 36 | import com.bsth.service.StationService; |
| 39 | import com.bsth.util.GetUIDAndCode; | 37 | import com.bsth.util.GetUIDAndCode; |
| 40 | import com.bsth.util.TransGPS; | 38 | import com.bsth.util.TransGPS; |
| @@ -89,8 +87,6 @@ public class StationServiceImpl extends BaseServiceImpl<Station, Integer> implem | @@ -89,8 +87,6 @@ public class StationServiceImpl extends BaseServiceImpl<Station, Integer> implem | ||
| 89 | @Autowired | 87 | @Autowired |
| 90 | LineVersionsRepository lineVersionsRepository; | 88 | LineVersionsRepository lineVersionsRepository; |
| 91 | 89 | ||
| 92 | - private GeoUtils geoUtils; | ||
| 93 | - | ||
| 94 | Logger logger = LoggerFactory.getLogger(this.getClass()); | 90 | Logger logger = LoggerFactory.getLogger(this.getClass()); |
| 95 | 91 | ||
| 96 | /** | 92 | /** |
| @@ -895,6 +891,156 @@ public class StationServiceImpl extends BaseServiceImpl<Station, Integer> implem | @@ -895,6 +891,156 @@ public class StationServiceImpl extends BaseServiceImpl<Station, Integer> 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 | * @Description :TODO(更新站点保存) | 1044 | * @Description :TODO(更新站点保存) |
| 899 | * | 1045 | * |
| 900 | * @param map <bJwpoints:中心点百度坐标;bPolygonGrid:多边形图形百度坐标;dbType:原坐标类型; | 1046 | * @param map <bJwpoints:中心点百度坐标;bPolygonGrid:多边形图形百度坐标;dbType:原坐标类型; |
| @@ -918,7 +1064,7 @@ public class StationServiceImpl extends BaseServiceImpl<Station, Integer> implem | @@ -918,7 +1064,7 @@ public class StationServiceImpl extends BaseServiceImpl<Station, Integer> implem | ||
| 918 | String stationCod = map.get("stationCod").equals("") ? "" : map.get("stationCod").toString(); | 1064 | String stationCod = map.get("stationCod").equals("") ? "" : map.get("stationCod").toString(); |
| 919 | String zdmc = map.get("zdmc").equals("") ? "" : map.get("zdmc").toString(); | 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 | String roadCoding = map.get("roadCoding").equals("") ? "" : map.get("roadCoding").toString(); | 1069 | String roadCoding = map.get("roadCoding").equals("") ? "" : map.get("roadCoding").toString(); |
| 924 | // 经纬坐标类型 | 1070 | // 经纬坐标类型 |
| @@ -1005,7 +1151,7 @@ public class StationServiceImpl extends BaseServiceImpl<Station, Integer> implem | @@ -1005,7 +1151,7 @@ public class StationServiceImpl extends BaseServiceImpl<Station, Integer> implem | ||
| 1005 | Station station = repository.findOne(stationId); | 1151 | Station station = repository.findOne(stationId); |
| 1006 | Line line = lineRepository.findOne(LineId); | 1152 | Line line = lineRepository.findOne(LineId); |
| 1007 | StationRoute stationRoute = new StationRoute(); | 1153 | StationRoute stationRoute = new StationRoute(); |
| 1008 | - stationRoute.setStationName(stationName); | 1154 | + stationRoute.setStationName(stationRouteName); |
| 1009 | stationRoute.setId(stationRouteId); | 1155 | stationRoute.setId(stationRouteId); |
| 1010 | stationRoute.setStationRouteCode(stationRouteCode); | 1156 | stationRoute.setStationRouteCode(stationRouteCode); |
| 1011 | stationRoute.setStation(station); | 1157 | stationRoute.setStation(station); |
| @@ -1201,7 +1347,6 @@ public class StationServiceImpl extends BaseServiceImpl<Station, Integer> implem | @@ -1201,7 +1347,6 @@ public class StationServiceImpl extends BaseServiceImpl<Station, Integer> implem | ||
| 1201 | // 保存路段 | 1347 | // 保存路段 |
| 1202 | sectionRouteRepository.save(sectionRoute); | 1348 | sectionRouteRepository.save(sectionRoute); |
| 1203 | } | 1349 | } |
| 1204 | - | ||
| 1205 | } | 1350 | } |
| 1206 | 1351 | ||
| 1207 | /** | 1352 | /** |
| @@ -1222,10 +1367,10 @@ public class StationServiceImpl extends BaseServiceImpl<Station, Integer> implem | @@ -1222,10 +1367,10 @@ public class StationServiceImpl extends BaseServiceImpl<Station, Integer> implem | ||
| 1222 | String libraryPointstr = s.getbJwpoints(); | 1367 | String libraryPointstr = s.getbJwpoints(); |
| 1223 | String points[] = libraryPointstr.toString().split(" "); | 1368 | String points[] = libraryPointstr.toString().split(" "); |
| 1224 | Point center = new Point(Double.parseDouble(points[0]), Double.parseDouble(points[1])); | 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 | map.put("name", s.getStationName().toString()); | 1374 | map.put("name", s.getStationName().toString()); |
| 1230 | map.put("potion_lng", points[0]); | 1375 | map.put("potion_lng", points[0]); |
| 1231 | map.put("potion_lat", points[1]); | 1376 | map.put("potion_lat", points[1]); |
| @@ -1716,4 +1861,36 @@ public class StationServiceImpl extends BaseServiceImpl<Station, Integer> implem | @@ -1716,4 +1861,36 @@ public class StationServiceImpl extends BaseServiceImpl<Station, Integer> implem | ||
| 1716 | } | 1861 | } |
| 1717 | return resultMap; | 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 | \ No newline at end of file | 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> 站点名称 : | ||
| 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>站点编码 : | ||
| 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>站点方向 : | ||
| 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>站点序号 : | ||
| 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>站点类型 : | ||
| 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>圆形半径 :</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>是否撤销 :</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">道路编码 :</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">到站时间 :</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">到站距离 :</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">版本号 :</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"> 描述/说明 : </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 | \ No newline at end of file | 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 | \ No newline at end of file | 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,6 +12,17 @@ html,body{ | ||
| 12 | overflow:hidden; | 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 | .caption { | 26 | .caption { |
| 16 | color: white; | 27 | color: white; |
| 17 | font-size: 18px; | 28 | font-size: 18px; |
src/main/resources/static/pages/base/line/editRoute.html
| @@ -4,7 +4,7 @@ | @@ -4,7 +4,7 @@ | ||
| 4 | 4 | ||
| 5 | <div class="modal-dialog"> | 5 | <div class="modal-dialog"> |
| 6 | 6 | ||
| 7 | - <div class="modal-content"> | 7 | + <div class="modal-content" > |
| 8 | 8 | ||
| 9 | <div class="modal-header"> | 9 | <div class="modal-header"> |
| 10 | <button type="button" class="close" data-dismiss="modal" | 10 | <button type="button" class="close" data-dismiss="modal" |
| @@ -74,6 +74,7 @@ | @@ -74,6 +74,7 @@ | ||
| 74 | <div class="modal-footer"> | 74 | <div class="modal-footer"> |
| 75 | <button type="button" class="btn default" data-dismiss="modal" | 75 | <button type="button" class="btn default" data-dismiss="modal" |
| 76 | id="addMobalHiden">取消</button> | 76 | id="addMobalHiden">取消</button> |
| 77 | +<!-- <button type="button" class="btn btn-primary hidden" id="referenceCurrentVersion">引用当前版本</button> --> | ||
| 77 | <button type="button" class="btn btn-primary" id="templateSaveData">提交数据</button> | 78 | <button type="button" class="btn btn-primary" id="templateSaveData">提交数据</button> |
| 78 | </div> | 79 | </div> |
| 79 | </div> | 80 | </div> |
| @@ -139,7 +140,7 @@ $('#edit_route_mobal').on('editRouteMobal.show', function(e,transGPS,editRoute,m | @@ -139,7 +140,7 @@ $('#edit_route_mobal').on('editRouteMobal.show', function(e,transGPS,editRoute,m | ||
| 139 | 140 | ||
| 140 | }, | 141 | }, |
| 141 | submitHandler : function(f) { | 142 | submitHandler : function(f) { |
| 142 | - // 隐藏手动规划弹出层 | 143 | + // 隐藏弹出层 |
| 143 | $('#edit_route_mobal').modal('hide'); | 144 | $('#edit_route_mobal').modal('hide'); |
| 144 | // 获取线路对象 | 145 | // 获取线路对象 |
| 145 | var line = editRoute.getLineObj(); | 146 | var line = editRoute.getLineObj(); |
| @@ -151,6 +152,8 @@ $('#edit_route_mobal').on('editRouteMobal.show', function(e,transGPS,editRoute,m | @@ -151,6 +152,8 @@ $('#edit_route_mobal').on('editRouteMobal.show', function(e,transGPS,editRoute,m | ||
| 151 | // 路线方向 | 152 | // 路线方向 |
| 152 | var directionData = $("input[name='dirCheck']:checked").val(); | 153 | var directionData = $("input[name='dirCheck']:checked").val(); |
| 153 | editRoute.setLineDir(directionData); | 154 | editRoute.setLineDir(directionData); |
| 155 | + // 设置线路对象生成方式 | ||
| 156 | + editRoute.setLineGenerationType('uploadGPS'); | ||
| 154 | // 弹出正在加载层 | 157 | // 弹出正在加载层 |
| 155 | var i = layer.load(2); | 158 | var i = layer.load(2); |
| 156 | // 表单序列化 | 159 | // 表单序列化 |
| @@ -256,6 +259,44 @@ $('#edit_route_mobal').on('editRouteMobal.show', function(e,transGPS,editRoute,m | @@ -256,6 +259,44 @@ $('#edit_route_mobal').on('editRouteMobal.show', function(e,transGPS,editRoute,m | ||
| 256 | return bdEn; | 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 | function addSave(params,lineid,directionData) { | 300 | function addSave(params,lineid,directionData) { |
| 260 | // 保存 | 301 | // 保存 |
| 261 | $post("/station/cacheSave",params,function(rd) { | 302 | $post("/station/cacheSave",params,function(rd) { |
| @@ -276,14 +317,20 @@ $('#edit_route_mobal').on('editRouteMobal.show', function(e,transGPS,editRoute,m | @@ -276,14 +317,20 @@ $('#edit_route_mobal').on('editRouteMobal.show', function(e,transGPS,editRoute,m | ||
| 276 | } | 317 | } |
| 277 | // 清除地图覆盖物 | 318 | // 清除地图覆盖物 |
| 278 | map.clearMarkAndOverlays(); | 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 | fun.linePanlThree(lineid,data,directionData); | 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 | }else { | 334 | }else { |
| 288 | layer.msg('生成路线失败!'); | 335 | layer.msg('生成路线失败!'); |
| 289 | } | 336 | } |
src/main/resources/static/pages/base/line/editsection.html
| @@ -156,8 +156,8 @@ $('#edit_section_mobal_cache').on('editSectionMobalCache_show', function(e, map_ | @@ -156,8 +156,8 @@ $('#edit_section_mobal_cache').on('editSectionMobalCache_show', function(e, map_ | ||
| 156 | var dir = Section.sectionrouteDirections; | 156 | var dir = Section.sectionrouteDirections; |
| 157 | var lineId = Section.sectionrouteLine; | 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 | var eq_scetionRouteCode = Section.sectionrouteCode; | 161 | var eq_scetionRouteCode = Section.sectionrouteCode; |
| 162 | paramsD.push({'id':'请选择...','text':'请选择...'}); | 162 | paramsD.push({'id':'请选择...','text':'请选择...'}); |
| 163 | // 遍历. | 163 | // 遍历. |
| @@ -175,7 +175,7 @@ $('#edit_section_mobal_cache').on('editSectionMobalCache_show', function(e, map_ | @@ -175,7 +175,7 @@ $('#edit_section_mobal_cache').on('editSectionMobalCache_show', function(e, map_ | ||
| 175 | // 初始化上一个路段拼音检索下拉框. | 175 | // 初始化上一个路段拼音检索下拉框. |
| 176 | initPinYinSelect2($('#sectionrouteCodeSelect'),paramsD,function(selector) { | 176 | initPinYinSelect2($('#sectionrouteCodeSelect'),paramsD,function(selector) { |
| 177 | $('#sectionDirSelect').val('');// 设值方向. | 177 | $('#sectionDirSelect').val('');// 设值方向. |
| 178 | - ajaxd.findUpSectionRouteCode(lineId,dir,eq_scetionRouteCode,function(str) { | 178 | + ajaxd.findCacheUpSectionRouteCode(lineId,dir,eq_scetionRouteCode,function(str) { |
| 179 | if(str.length>0){ | 179 | if(str.length>0){ |
| 180 | var upStationRouteCode = str[0].sectionrouteCode; | 180 | var upStationRouteCode = str[0].sectionrouteCode; |
| 181 | $('#sectionrouteCodeSelect').select2('val',upStationRouteCode); | 181 | $('#sectionrouteCodeSelect').select2('val',upStationRouteCode); |
| @@ -196,10 +196,11 @@ $('#edit_section_mobal_cache').on('editSectionMobalCache_show', function(e, map_ | @@ -196,10 +196,11 @@ $('#edit_section_mobal_cache').on('editSectionMobalCache_show', function(e, map_ | ||
| 196 | map_.clearMarkAndOverlays(); | 196 | map_.clearMarkAndOverlays(); |
| 197 | /** 设置修改路段集合对象为空 */ | 197 | /** 设置修改路段集合对象为空 */ |
| 198 | section.setEitdSection({}); | 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 | fun.linePanlThree(lineId,data,dir); | 200 | fun.linePanlThree(lineId,data,dir); |
| 202 | }); | 201 | }); |
| 202 | + // 刷新路段列表 | ||
| 203 | + $('#section').click(); | ||
| 203 | } | 204 | } |
| 204 | 205 | ||
| 205 | // 编辑表单元素 | 206 | // 编辑表单元素 |
| @@ -249,7 +250,7 @@ $('#edit_section_mobal_cache').on('editSectionMobalCache_show', function(e, map_ | @@ -249,7 +250,7 @@ $('#edit_section_mobal_cache').on('editSectionMobalCache_show', function(e, map_ | ||
| 249 | $post('/section/sectionCacheUpdate',params,function(resuntDate) { | 250 | $post('/section/sectionCacheUpdate',params,function(resuntDate) { |
| 250 | if(resuntDate.status=='SUCCESS') { | 251 | if(resuntDate.status=='SUCCESS') { |
| 251 | // 弹出添加成功提示消息 | 252 | // 弹出添加成功提示消息 |
| 252 | - layer.msg('路段保存成功,将地图放到最大,用右击路段进行截取,确认截取完毕后提交!!!'); | 253 | + layer.msg('路段保存成功!'); |
| 253 | }else { | 254 | }else { |
| 254 | // 弹出添加失败提示消息 | 255 | // 弹出添加失败提示消息 |
| 255 | layer.msg('路段保存失败,请重新编辑路段!!!'); | 256 | layer.msg('路段保存失败,请重新编辑路段!!!'); |
src/main/resources/static/pages/base/line/editstation.html
| @@ -193,7 +193,7 @@ | @@ -193,7 +193,7 @@ | ||
| 193 | </div> | 193 | </div> |
| 194 | <script type="text/javascript"> | 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 | layer.closeAll(); | 197 | layer.closeAll(); |
| 198 | fun.setFormValue(station); | 198 | fun.setFormValue(station); |
| 199 | var initzdlyP = {'lineId':station.stationRouteLine,'destroy':0,'direction':station.stationRouteDirections}; | 199 | var initzdlyP = {'lineId':station.stationRouteLine,'destroy':0,'direction':station.stationRouteDirections}; |
| @@ -228,7 +228,7 @@ $('#edit_station_mobal').on('editSelectMobal_show', function(e, map_,station,fun | @@ -228,7 +228,7 @@ $('#edit_station_mobal').on('editSelectMobal_show', function(e, map_,station,fun | ||
| 228 | 'zdmc' : { required : true,maxlength : 50,},// 站点名称 必填项 | 228 | 'zdmc' : { required : true,maxlength : 50,},// 站点名称 必填项 |
| 229 | 'stationName' : { required : true,maxlength : 50,},// 站点名称 必填项 | 229 | 'stationName' : { required : true,maxlength : 50,},// 站点名称 必填项 |
| 230 | 'stationCod': {required : true,},// 站点编码 必填项 | 230 | 'stationCod': {required : true,},// 站点编码 必填项 |
| 231 | - 'directions' : {required : true,dirIs : true},// 站点方向 必填项 必填项 | 231 | + 'directions' : {required : true,dirIs : true},// 站点方向 必填项 必填项 |
| 232 | 'stationRouteCode' : {isStart : true},// 站点序号 | 232 | 'stationRouteCode' : {isStart : true},// 站点序号 |
| 233 | 'stationMark' : {required : true},// 站点类型 必填项 | 233 | 'stationMark' : {required : true},// 站点类型 必填项 |
| 234 | 'bJwpoints' : {required : true},// 经纬度坐标点 必填项 | 234 | 'bJwpoints' : {required : true},// 经纬度坐标点 必填项 |
| @@ -265,8 +265,6 @@ $('#edit_station_mobal').on('editSelectMobal_show', function(e, map_,station,fun | @@ -265,8 +265,6 @@ $('#edit_station_mobal').on('editSelectMobal_show', function(e, map_,station,fun | ||
| 265 | if(resuntDate.status=='SUCCESS') { | 265 | if(resuntDate.status=='SUCCESS') { |
| 266 | // 弹出添加成功提示消息 | 266 | // 弹出添加成功提示消息 |
| 267 | layer.msg('修改成功...'); | 267 | layer.msg('修改成功...'); |
| 268 | - /** 通知更新缓存区 */ | ||
| 269 | - $.post('http://192.168.168.171:8800/transport_server/basic/refresh',function(rs){console.log(rs)}) | ||
| 270 | }else { | 268 | }else { |
| 271 | // 弹出添加失败提示消息 | 269 | // 弹出添加失败提示消息 |
| 272 | layer.msg('修改失败...'); | 270 | layer.msg('修改失败...'); |
| @@ -279,7 +277,6 @@ $('#edit_station_mobal').on('editSelectMobal_show', function(e, map_,station,fun | @@ -279,7 +277,6 @@ $('#edit_station_mobal').on('editSelectMobal_show', function(e, map_,station,fun | ||
| 279 | // 站点序号值改变事件 | 277 | // 站点序号值改变事件 |
| 280 | $('#stationrouteSelect').on('change',function() { | 278 | $('#stationrouteSelect').on('change',function() { |
| 281 | var stationRValue = $('#stationrouteSelect').val(); | 279 | var stationRValue = $('#stationrouteSelect').val(); |
| 282 | - debugger | ||
| 283 | if(stationRValue=='请选择...') { | 280 | if(stationRValue=='请选择...') { |
| 284 | $('#stationMarkSelect').val('B'); | 281 | $('#stationMarkSelect').val('B'); |
| 285 | }else { | 282 | }else { |
| @@ -292,7 +289,7 @@ $('#edit_station_mobal').on('editSelectMobal_show', function(e, map_,station,fun | @@ -292,7 +289,7 @@ $('#edit_station_mobal').on('editSelectMobal_show', function(e, map_,station,fun | ||
| 292 | } | 289 | } |
| 293 | }); | 290 | }); |
| 294 | function initSelect(p){ | 291 | function initSelect(p){ |
| 295 | - $get('/stationroute/cacheList',p,function(array) { | 292 | + ajaxd.getzdlyInfo(p,function(array) { |
| 296 | // 定义路段路由长度、渲染拼音检索下拉框格式数据. | 293 | // 定义路段路由长度、渲染拼音检索下拉框格式数据. |
| 297 | var len_ = array.length,paramsD = new Array(); | 294 | var len_ = array.length,paramsD = new Array(); |
| 298 | if(len_>0) { | 295 | if(len_>0) { |
| @@ -326,10 +323,14 @@ $('#edit_station_mobal').on('editSelectMobal_show', function(e, map_,station,fun | @@ -326,10 +323,14 @@ $('#edit_station_mobal').on('editSelectMobal_show', function(e, map_,station,fun | ||
| 326 | params.lineId = station.stationRouteLine; | 323 | params.lineId = station.stationRouteLine; |
| 327 | params.direction = station.stationRouteDirections; | 324 | params.direction = station.stationRouteDirections; |
| 328 | params.stationRouteCode = station.stationRouteStationRouteCode; | 325 | params.stationRouteCode = station.stationRouteStationRouteCode; |
| 329 | - $get('/stationroute/findCacheUpStationRouteCode',params , function(str) { | ||
| 330 | - debugger | 326 | + ajaxd.findCacheUpStationRouteCode(params, function(str) { |
| 331 | if(str.length>0){ | 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 | $('#stationrouteSelect').select2('val',upStationRouteCode); | 334 | $('#stationrouteSelect').select2('val',upStationRouteCode); |
| 334 | }else { | 335 | }else { |
| 335 | $('#stationrouteSelect').select2('val','请选择...'); | 336 | $('#stationrouteSelect').select2('val','请选择...'); |
src/main/resources/static/pages/base/line/editstation_select.html
| @@ -47,7 +47,7 @@ | @@ -47,7 +47,7 @@ | ||
| 47 | </div> | 47 | </div> |
| 48 | </div> | 48 | </div> |
| 49 | <script type="text/javascript"> | 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 | // var sel = fun.getCurrSelNode(dir_); | 51 | // var sel = fun.getCurrSelNode(dir_); |
| 52 | // var Station = sel[0].original; | 52 | // var Station = sel[0].original; |
| 53 | // 显示选择修改方式弹出层 | 53 | // 显示选择修改方式弹出层 |
| @@ -112,20 +112,20 @@ $('#editstation_select_mobal').on('editStationSelectMobal_show', function(e, map | @@ -112,20 +112,20 @@ $('#editstation_select_mobal').on('editStationSelectMobal_show', function(e, map | ||
| 112 | var params = form.serializeJSON(); | 112 | var params = form.serializeJSON(); |
| 113 | // 站点名称 | 113 | // 站点名称 |
| 114 | stationRoute.zdmc = params.stationNamebootbox; | 114 | stationRoute.zdmc = params.stationNamebootbox; |
| 115 | - | 115 | + // 关闭按钮事件 |
| 116 | + fun.addAChangeCssAddDisabled(); | ||
| 116 | if(params.editselect==0){ | 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 | }else if(params.editselect==1){ | 129 | }else if(params.editselect==1){ |
| 130 | // 弹出添加失败提示消息,2秒关闭(如果不配置,默认是3秒) | 130 | // 弹出添加失败提示消息,2秒关闭(如果不配置,默认是3秒) |
| 131 | var mindex = layer.msg('编辑完图形后,请双击图形区域保存',{ offset: '126px', | 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,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 | drawingManager.addEventListener('polygoncomplete', function(e) { | 49 | drawingManager.addEventListener('polygoncomplete', function(e) { |
| 53 | - | ||
| 54 | - drawingManager.close; | 50 | + // 关闭绘画 |
| 51 | + DrawingManagerObj.drawingManagerClose(); | ||
| 52 | + // 隐藏绘画工具栏 | ||
| 53 | + $('.leftUtils').addClass('hidden'); | ||
| 55 | 54 | ||
| 56 | if (e.getPath().length <= 2) { | 55 | if (e.getPath().length <= 2) { |
| 57 | - | ||
| 58 | WorldsBMapLine.clearMarkAndOverlays(); | 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 | for(var k =0;k<editPolyGonLen_;k++) { | 69 | for(var k =0;k<editPolyGonLen_;k++) { |
| 76 | 70 | ||
| 77 | if(k==0) { | 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 | }else { | 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 | drawingManager.close(); | 132 | drawingManager.close(); |
| 123 | - } | 133 | + }, |
| 124 | } | 134 | } |
| 125 | 135 | ||
| 126 | return draMangerObj; | 136 | return draMangerObj; |
src/main/resources/static/pages/base/line/js/editRoute.js
| @@ -12,10 +12,23 @@ var EditRoute = function(){ | @@ -12,10 +12,23 @@ var EditRoute = function(){ | ||
| 12 | setLineId : function(id) { | 12 | setLineId : function(id) { |
| 13 | line.id = id; | 13 | line.id = id; |
| 14 | }, | 14 | }, |
| 15 | + getLineId : function() { | ||
| 16 | + return line.id; | ||
| 17 | + }, | ||
| 15 | setLineDir : function(dir) { | 18 | setLineDir : function(dir) { |
| 16 | 19 | ||
| 17 | line.dir = dir; | 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 | return editRoute; | 34 | return editRoute; |
src/main/resources/static/pages/base/line/js/line-add-form.js
| @@ -246,7 +246,7 @@ $(function(){ | @@ -246,7 +246,7 @@ $(function(){ | ||
| 246 | if(result.status=='SUCCESS') { | 246 | if(result.status=='SUCCESS') { |
| 247 | 247 | ||
| 248 | // 弹出添加成功提示消息 | 248 | // 弹出添加成功提示消息 |
| 249 | - layer.msg('添加成功...'); | 249 | + layer.msg('添加成功,并已自动为您生成线路原始版本,可以在线路版本信息下查看!', {time: 7000}); |
| 250 | 250 | ||
| 251 | } else if(result.status=='ERROR') { | 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 | \ No newline at end of file | 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,7 +3,7 @@ var PublicFunctions = function () { | ||
| 3 | /** 初始化线路标题与ID */ | 3 | /** 初始化线路标题与ID */ |
| 4 | setTiteText : function(lineId) { | 4 | setTiteText : function(lineId) { |
| 5 | // 根据线路ID获取线路名称 | 5 | // 根据线路ID获取线路名称 |
| 6 | - GetAjaxData.getIdLineName(lineId,function(data) { | 6 | + MapGetAjaxData.getIdLineName(lineId,function(data) { |
| 7 | // 定义线路名称 | 7 | // 定义线路名称 |
| 8 | var lineNameV = data.name; | 8 | var lineNameV = data.name; |
| 9 | $('.portlet-title .caption').text(lineNameV); | 9 | $('.portlet-title .caption').text(lineNameV); |
| @@ -40,7 +40,7 @@ var PublicFunctions = function () { | @@ -40,7 +40,7 @@ var PublicFunctions = function () { | ||
| 40 | // 版本号 | 40 | // 版本号 |
| 41 | $('#versionsInput').val(Section.versions); | 41 | $('#versionsInput').val(Section.versions); |
| 42 | // 是否撤销 | 42 | // 是否撤销 |
| 43 | - $('#destroySelect').val(Section.destroy); | 43 | + $('#destroySelect').val(0); |
| 44 | // 描述/说明 | 44 | // 描述/说明 |
| 45 | $('#descriptionsTextarea').val(Section.descriptions); | 45 | $('#descriptionsTextarea').val(Section.descriptions); |
| 46 | }, | 46 | }, |
| @@ -113,7 +113,6 @@ var PublicFunctions = function () { | @@ -113,7 +113,6 @@ var PublicFunctions = function () { | ||
| 113 | /** 在地图上画点 @param:<point_center:中心坐标点> */ | 113 | /** 在地图上画点 @param:<point_center:中心坐标点> */ |
| 114 | WorldsBMapLine.drawingUpStationPoint(point_center,stationName,s+1); | 114 | WorldsBMapLine.drawingUpStationPoint(point_center,stationName,s+1); |
| 115 | } | 115 | } |
| 116 | - | ||
| 117 | } | 116 | } |
| 118 | // 路段数据长度 | 117 | // 路段数据长度 |
| 119 | var dataLen = data.length; | 118 | var dataLen = data.length; |
src/main/resources/static/pages/base/line/js/map.js
| @@ -44,6 +44,22 @@ var WorldsBMapLine = function () { | @@ -44,6 +44,22 @@ var WorldsBMapLine = function () { | ||
| 44 | //启用键盘上下左右键移动地图 | 44 | //启用键盘上下左右键移动地图 |
| 45 | mapBValue.enableKeyboard(); | 45 | mapBValue.enableKeyboard(); |
| 46 | 46 | ||
| 47 | + var transit = new BMap.DrivingRoute(mapBValue, { | ||
| 48 | + renderOptions: { | ||
| 49 | + map: mapBValue, | ||
| 50 | + panel: "r-result", | ||
| 51 | + enableDragging : true //起终点可进行拖拽 | ||
| 52 | + },opts:{ | ||
| 53 | + onSearchComplete (){ | ||
| 54 | + | ||
| 55 | + } | ||
| 56 | + } | ||
| 57 | + }); | ||
| 58 | + transit.search("唐镇","唐陆路"); | ||
| 59 | + var a = transit.getResults(); | ||
| 60 | + debugger | ||
| 61 | + var b = mapBValue.onSearchComplete(); | ||
| 62 | + | ||
| 47 | return mapBValue; | 63 | return mapBValue; |
| 48 | }, | 64 | }, |
| 49 | /** 获取第一个切路段的点 @return Point*/ | 65 | /** 获取第一个切路段的点 @return Point*/ |
| @@ -206,7 +222,50 @@ var WorldsBMapLine = function () { | @@ -206,7 +222,50 @@ var WorldsBMapLine = function () { | ||
| 206 | })(); | 222 | })(); |
| 207 | 223 | ||
| 208 | }, | 224 | }, |
| 209 | - // 在地图上画出上行线路走向 | 225 | + drawingSection: function(data){ |
| 226 | + /** 获取站点路由信息 @param:<Line.id:线路Id;0:上行> @return:<resultdata:站点路由数据> */ | ||
| 227 | + WorldsBMapLine.clearMarkAndOverlays(); | ||
| 228 | + // 编辑路段数据 | ||
| 229 | + if(data) { | ||
| 230 | + // 地图折线坐标点集合 | ||
| 231 | + var polylineArray = []; | ||
| 232 | + // 获取路段折线坐标字符串 | ||
| 233 | + var sectionBsectionVectorStr = data.sectionBsectionVector; | ||
| 234 | + if(sectionBsectionVectorStr==null) { | ||
| 235 | + return; | ||
| 236 | + } | ||
| 237 | + // 切割段折线坐标字符串 | ||
| 238 | + var tempStr = sectionBsectionVectorStr.substring(11,sectionBsectionVectorStr.length-1); | ||
| 239 | + // 分割折线坐标字符串 | ||
| 240 | + var lineArray = tempStr.split(','); | ||
| 241 | + for(var i = 0;i<lineArray.length;i++) { | ||
| 242 | + polylineArray.push(new BMap.Point(lineArray[i].split(' ')[0],lineArray[i].split(' ')[1])); | ||
| 243 | + } | ||
| 244 | + var index = parseInt(polylineArray.length/2); | ||
| 245 | + var center = polylineArray[index]; | ||
| 246 | + /** 在地图上画出线路走向 @param:<polylineArray:地图折线坐标点集合;resultdata:站点路由数据> */ | ||
| 247 | + WorldsBMapLine.drawingUpline(polylineArray,center); | ||
| 248 | + /** 在地图上画点 @param:<point_center:中心坐标点> */ | ||
| 249 | + WorldsBMapLine.drawingUpStationPoint(center,data.sectionName,1); | ||
| 250 | + } | ||
| 251 | + }, | ||
| 252 | + // 在地图上画出上行线路走向(单路段) | ||
| 253 | + drawingUpline : function (polylineArray,polyline_center,data) { | ||
| 254 | + /*WorldsBMap.clearMarkAndOverlays();*/ | ||
| 255 | + polyUpline = ''; | ||
| 256 | + // 创建线路走向 | ||
| 257 | + polyUpline = new BMap.Polyline(polylineArray, {strokeColor : "blue",strokeWeight : 6,strokeOpacity : 0.5}); | ||
| 258 | + // polyUpline.data = data; | ||
| 259 | + // 把折线添加到地图上 | ||
| 260 | + mapBValue.addOverlay(polyUpline); | ||
| 261 | + var PanOptions_ ={noAnimation :true}; | ||
| 262 | + mapBValue.reset(); | ||
| 263 | + mapBValue.panTo(polyline_center,PanOptions_); | ||
| 264 | + mapBValue.panBy(500,-510,PanOptions_); | ||
| 265 | + mapBValue.setZoom(14); | ||
| 266 | + }, | ||
| 267 | + | ||
| 268 | + // 在地图上画出上行线路走向(多路段) | ||
| 210 | drawingUpline01 : function (polylineArray,polyline_center,data) { | 269 | drawingUpline01 : function (polylineArray,polyline_center,data) { |
| 211 | var polyUpline01 = 'polyline' + '_' + data.sectionrouteId; | 270 | var polyUpline01 = 'polyline' + '_' + data.sectionrouteId; |
| 212 | // 创建线路走向 | 271 | // 创建线路走向 |
| @@ -252,7 +311,7 @@ var WorldsBMapLine = function () { | @@ -252,7 +311,7 @@ var WorldsBMapLine = function () { | ||
| 252 | // 加载修改路段弹出层mobal页面 | 311 | // 加载修改路段弹出层mobal页面 |
| 253 | $.get('editsection.html', function(m){ | 312 | $.get('editsection.html', function(m){ |
| 254 | $(pjaxContainer).append(m); | 313 | $(pjaxContainer).append(m); |
| 255 | - $('#edit_section_mobal_cache').trigger('editSectionMobalCache_show', [WorldsBMapLine,GetAjaxData,EditSectionObj,PublicFunctions]); | 314 | + $('#edit_section_mobal_cache').trigger('editSectionMobalCache_show', [WorldsBMapLine,MapGetAjaxData,EditSectionObj,PublicFunctions]); |
| 256 | }); | 315 | }); |
| 257 | // 打开按钮事件 | 316 | // 打开按钮事件 |
| 258 | PublicFunctions.editAChangeCssRemoveDisabled(); | 317 | PublicFunctions.editAChangeCssRemoveDisabled(); |
| @@ -300,9 +359,12 @@ var WorldsBMapLine = function () { | @@ -300,9 +359,12 @@ var WorldsBMapLine = function () { | ||
| 300 | } | 359 | } |
| 301 | WorldsBMapLine.setIsCutSection(true); | 360 | WorldsBMapLine.setIsCutSection(true); |
| 302 | } | 361 | } |
| 303 | - var markerMenu=new BMap.ContextMenu(); | ||
| 304 | - markerMenu.addItem(new BMap.MenuItem('切路段',editSection.bind(polyUpline01))); | ||
| 305 | - polyUpline01.addContextMenu(markerMenu); | 362 | + // 路段生成类型位gps上传时才开启右击事件 |
| 363 | + if(EditRoute.getLineGenerationType() == 'uploadGPS') { | ||
| 364 | + var markerMenu=new BMap.ContextMenu(); | ||
| 365 | + markerMenu.addItem(new BMap.MenuItem('切路段',editSection.bind(polyUpline01))); | ||
| 366 | + polyUpline01.addContextMenu(markerMenu); | ||
| 367 | + } | ||
| 306 | 368 | ||
| 307 | 369 | ||
| 308 | var PanOptions_ ={noAnimation :true}; | 370 | var PanOptions_ ={noAnimation :true}; |
| @@ -387,7 +449,7 @@ var WorldsBMapLine = function () { | @@ -387,7 +449,7 @@ var WorldsBMapLine = function () { | ||
| 387 | mapBValue.addOverlay(marker); | 449 | mapBValue.addOverlay(marker); |
| 388 | }, | 450 | }, |
| 389 | 451 | ||
| 390 | - // 根据站点坐标匹配库中的公交站点(手动规划) | 452 | + // 根据站点坐标匹配库中的公交站点 |
| 391 | stationsPointsToLibraryPoint : function(arra,callback) { | 453 | stationsPointsToLibraryPoint : function(arra,callback) { |
| 392 | // 获取长度 | 454 | // 获取长度 |
| 393 | var len = arra.length; | 455 | var len = arra.length; |
| @@ -710,9 +772,6 @@ var WorldsBMapLine = function () { | @@ -710,9 +772,6 @@ var WorldsBMapLine = function () { | ||
| 710 | mapBValue.panTo(point,PanOptions_); | 772 | mapBValue.panTo(point,PanOptions_); |
| 711 | 773 | ||
| 712 | mapBValue.panBy(10,-200,PanOptions_); | 774 | mapBValue.panBy(10,-200,PanOptions_); |
| 713 | - | ||
| 714 | - // 关闭按钮事件 | ||
| 715 | - PublicFunctions.addAChangeCssAddDisabled(); | ||
| 716 | 775 | ||
| 717 | // 编辑圆监听事件 | 776 | // 编辑圆监听事件 |
| 718 | circle.addEventListener('dblclick',function() { | 777 | circle.addEventListener('dblclick',function() { |
| @@ -740,7 +799,7 @@ var WorldsBMapLine = function () { | @@ -740,7 +799,7 @@ var WorldsBMapLine = function () { | ||
| 740 | 799 | ||
| 741 | $(pjaxContainer).append(m); | 800 | $(pjaxContainer).append(m); |
| 742 | 801 | ||
| 743 | - $('#edit_station_mobal').trigger('editSelectMobal_show', [WorldsBMapLine,objStation,PublicFunctions]); | 802 | + $('#edit_station_mobal').trigger('editSelectMobal_show', [WorldsBMapLine,MapGetAjaxData,PublicFunctions,objStation]); |
| 744 | 803 | ||
| 745 | }); | 804 | }); |
| 746 | 805 | ||
| @@ -748,7 +807,7 @@ var WorldsBMapLine = function () { | @@ -748,7 +807,7 @@ var WorldsBMapLine = function () { | ||
| 748 | PublicFunctions.editAChangeCssRemoveDisabled(); | 807 | PublicFunctions.editAChangeCssRemoveDisabled(); |
| 749 | }); | 808 | }); |
| 750 | 809 | ||
| 751 | - // 编辑多变行 | 810 | + // 编辑多边行 |
| 752 | }else if(stationShapesType =='d') { | 811 | }else if(stationShapesType =='d') { |
| 753 | 812 | ||
| 754 | // 清除地图覆盖物 | 813 | // 清除地图覆盖物 |
| @@ -808,9 +867,6 @@ var WorldsBMapLine = function () { | @@ -808,9 +867,6 @@ var WorldsBMapLine = function () { | ||
| 808 | 867 | ||
| 809 | // 将地图在水平位置上移动x像素,垂直位置上移动y像素。 | 868 | // 将地图在水平位置上移动x像素,垂直位置上移动y像素。 |
| 810 | mapBValue.panBy(10,-150,PanOptions_); | 869 | mapBValue.panBy(10,-150,PanOptions_); |
| 811 | - | ||
| 812 | - // 关闭按钮事件(图形编辑中) | ||
| 813 | - PublicFunctions.addAChangeCssAddDisabled(); | ||
| 814 | 870 | ||
| 815 | // 添加多变行编辑事件 | 871 | // 添加多变行编辑事件 |
| 816 | polygon.addEventListener('dblclick',function(e) { | 872 | polygon.addEventListener('dblclick',function(e) { |
| @@ -857,14 +913,14 @@ var WorldsBMapLine = function () { | @@ -857,14 +913,14 @@ var WorldsBMapLine = function () { | ||
| 857 | 913 | ||
| 858 | $(pjaxContainer).append(m); | 914 | $(pjaxContainer).append(m); |
| 859 | 915 | ||
| 860 | - $('#edit_station_mobal').trigger('editSelectMobal_show', [WorldsBMapLine,objStation,PublicFunctions]); | 916 | + $('#edit_station_mobal').trigger('editSelectMobal_show', [WorldsBMapLine,MapGetAjaxData,PublicFunctions,objStation]); |
| 861 | 917 | ||
| 862 | }); | 918 | }); |
| 863 | 919 | ||
| 920 | + // 打开按钮事件 | ||
| 921 | + PublicFunctions.editAChangeCssRemoveDisabled(); | ||
| 864 | }); | 922 | }); |
| 865 | 923 | ||
| 866 | - // 打开按钮事件 | ||
| 867 | - PublicFunctions.editAChangeCssRemoveDisabled(); | ||
| 868 | } | 924 | } |
| 869 | } | 925 | } |
| 870 | }, | 926 | }, |
src/main/resources/static/pages/base/line/list.html
| @@ -244,7 +244,7 @@ | @@ -244,7 +244,7 @@ | ||
| 244 | 闵行公司 | 244 | 闵行公司 |
| 245 | {{/if}} | 245 | {{/if}} |
| 246 | </td> | 246 | </td> |
| 247 | -<td> | 247 | + <td> |
| 248 | {{if obj.company == '55'}} | 248 | {{if obj.company == '55'}} |
| 249 | 249 | ||
| 250 | {{if obj.brancheCompany == '1'}} | 250 | {{if obj.brancheCompany == '1'}} |
| @@ -295,6 +295,8 @@ | @@ -295,6 +295,8 @@ | ||
| 295 | 南汇维修公司 | 295 | 南汇维修公司 |
| 296 | {{else if obj.brancheCompany == '5'}} | 296 | {{else if obj.brancheCompany == '5'}} |
| 297 | 南汇公司 | 297 | 南汇公司 |
| 298 | + {{else if obj.brancheCompany == '6'}} | ||
| 299 | + 航头枢纽站 | ||
| 298 | {{/if}} | 300 | {{/if}} |
| 299 | 301 | ||
| 300 | {{/if}} | 302 | {{/if}} |
src/main/resources/static/pages/base/line/map.html
| @@ -3,44 +3,75 @@ | @@ -3,44 +3,75 @@ | ||
| 3 | <div class="portlet-body"> | 3 | <div class="portlet-body"> |
| 4 | <!-- 地图 --> | 4 | <!-- 地图 --> |
| 5 | <div id="bmap_basic" class="bmaps"></div> | 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 | <div class="cut-section" id="scrllmouseEvent_div"> | 23 | <div class="cut-section" id="scrllmouseEvent_div"> |
| 8 | <div class="portlet-title"> | 24 | <div class="portlet-title"> |
| 9 | <div class="caption">途径站点</div> | 25 | <div class="caption">途径站点</div> |
| 10 | </div> | 26 | </div> |
| 11 | <div class="portlet-body"> | 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 | <i class="fa fa-plus"></i> 生成路线 | 30 | <i class="fa fa-plus"></i> 生成路线 |
| 15 | </button> | 31 | </button> |
| 16 | </div> | 32 | </div> |
| 17 | - <div class="portlet-body hidden" id="upload_show"> | 33 | + <!-- 生成走向跳转的div --> |
| 34 | + <div class="portlet-body hidden" id="route_show"> | ||
| 18 | <div> | 35 | <div> |
| 19 | <ul class="nav nav-pills nav-justified steps"> | 36 | <ul class="nav nav-pills nav-justified steps"> |
| 20 | <li class="active"> | 37 | <li class="active"> |
| 21 | <a id="section"><span>路段</span></a> | 38 | <a id="section"><span>路段</span></a> |
| 22 | </li> | 39 | </li> |
| 23 | <li> | 40 | <li> |
| 24 | - <a id="station"><span>站点</span></a> | 41 | + <a class="station" id="station"><span>站点</span></a> |
| 25 | </li> | 42 | </li> |
| 26 | </ul> | 43 | </ul> |
| 27 | </div> | 44 | </div> |
| 28 | <div id="section_list_div" class="active" style="margin: 5px;"> | 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 | </div> | 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 | </div> | 75 | </div> |
| 45 | </div> | 76 | </div> |
| 46 | <div id="station_list_div" class="hidden"> | 77 | <div id="station_list_div" class="hidden"> |
| @@ -48,6 +79,7 @@ | @@ -48,6 +79,7 @@ | ||
| 48 | style="height: 400px; overflow-y: auto; "> | 79 | style="height: 400px; overflow-y: auto; "> |
| 49 | </div> | 80 | </div> |
| 50 | <div class="table-toolbar"> | 81 | <div class="table-toolbar"> |
| 82 | + <a class="btn btn-circle blue" id="addStation">添加站点</a> | ||
| 51 | <a class="btn btn-circle blue" id="findStation">查看站点</a> | 83 | <a class="btn btn-circle blue" id="findStation">查看站点</a> |
| 52 | <a class="btn btn-circle blue" id="updateStation">修改站点</a> | 84 | <a class="btn btn-circle blue" id="updateStation">修改站点</a> |
| 53 | </div> | 85 | </div> |
| @@ -81,6 +113,8 @@ $(function(){ | @@ -81,6 +113,8 @@ $(function(){ | ||
| 81 | var direction = 0; | 113 | var direction = 0; |
| 82 | // 站点Map | 114 | // 站点Map |
| 83 | var stationRouteMap = new Map(); | 115 | var stationRouteMap = new Map(); |
| 116 | + // 路段Map | ||
| 117 | + var sectionRouteMap = new Map(); | ||
| 84 | // 如果线路ID不为空 | 118 | // 如果线路ID不为空 |
| 85 | if(id) { | 119 | if(id) { |
| 86 | var styleOptions = { | 120 | var styleOptions = { |
| @@ -102,7 +136,7 @@ $(function(){ | @@ -102,7 +136,7 @@ $(function(){ | ||
| 102 | var map_ = WorldsBMapLine.init(); | 136 | var map_ = WorldsBMapLine.init(); |
| 103 | 137 | ||
| 104 | /** 初始化绘图工具类 @param:<map_:map对象;styleOptions:绘图样式对象> @return:DrawingManager对象 */ | 138 | /** 初始化绘图工具类 @param:<map_:map对象;styleOptions:绘图样式对象> @return:DrawingManager对象 */ |
| 105 | -// DrawingManagerObj.init(map_,styleOptions); | 139 | + DrawingManagerObj.init(map_,styleOptions); |
| 106 | 140 | ||
| 107 | layer.msg('请生成路线!!!'); | 141 | layer.msg('请生成路线!!!'); |
| 108 | 142 | ||
| @@ -123,12 +157,12 @@ $(function(){ | @@ -123,12 +157,12 @@ $(function(){ | ||
| 123 | } | 157 | } |
| 124 | 158 | ||
| 125 | // 上传GPS坐标生成路线事件 | 159 | // 上传GPS坐标生成路线事件 |
| 126 | - $('#uploadRoute').on('click', function() { | 160 | + $('#generationRoute').on('click', function() { |
| 127 | EditRoute.setLineId(id); | 161 | EditRoute.setLineId(id); |
| 128 | - EditRoute.setLineDir(direction); | 162 | +// EditRoute.setLineDir(direction); |
| 129 | $.get('editRoute.html', function(m){ | 163 | $.get('editRoute.html', function(m){ |
| 130 | $(pjaxContainer).append(m); | 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 | // 更新section_table 和缓存中的切点 | 167 | // 更新section_table 和缓存中的切点 |
| 134 | WorldsBMapLine.initCutSectionPoint(); | 168 | WorldsBMapLine.initCutSectionPoint(); |
| @@ -144,10 +178,30 @@ $(function(){ | @@ -144,10 +178,30 @@ $(function(){ | ||
| 144 | var section = EditSectionObj.getEitdSection(); | 178 | var section = EditSectionObj.getEitdSection(); |
| 145 | var josnSectionList = JSON.stringify(sectionList); | 179 | var josnSectionList = JSON.stringify(sectionList); |
| 146 | section.cutSectionList = josnSectionList; | 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 | + debugger | ||
| 185 | + layer.confirm('提交马上会把原有的站点和路段覆盖,您确定要提交吗?', { | ||
| 186 | + btn: ['提交','取消'] //按钮 | ||
| 187 | + }, function(index){ | ||
| 188 | + layer.close(index); | ||
| 189 | + $.post('/section/sectionCut', section, function(resuntDate){ | ||
| 190 | + if(resuntDate.status=='SUCCESS') { | ||
| 191 | + // 弹出添加成功提示消息 | ||
| 192 | + layer.msg('提交成功,跳转到线路详情页面!'); | ||
| 193 | + window.location.href = "/pages/base/stationroute/list.html?no="+section.sectionrouteLine+","+section.sectionrouteDirections; | ||
| 194 | + }else { | ||
| 195 | + // 弹出添加失败提示消息 | ||
| 196 | + layer.msg('提交失败...'); | ||
| 197 | + } | ||
| 198 | + }); | ||
| 199 | + }); | ||
| 150 | }); | 200 | }); |
| 201 | +// $.get('submit_select.html', function(m){ | ||
| 202 | +// $(pjaxContainer).append(m); | ||
| 203 | +// $('#submit_select_mobal').trigger('submitSelectMobal.show',[section,EditRoute]); | ||
| 204 | +// }); | ||
| 151 | } else { | 205 | } else { |
| 152 | layer.msg("请先截取路段!!!"); | 206 | layer.msg("请先截取路段!!!"); |
| 153 | } | 207 | } |
| @@ -179,7 +233,47 @@ $(function(){ | @@ -179,7 +233,47 @@ $(function(){ | ||
| 179 | } else { | 233 | } else { |
| 180 | layer.msg("没有截取路段,不可以撤销!!!"); | 234 | layer.msg("没有截取路段,不可以撤销!!!"); |
| 181 | } | 235 | } |
| 182 | - }); | 236 | + }); |
| 237 | + | ||
| 238 | + // 监听右侧悬浮框导航栏事件 | ||
| 239 | + $('#section').on('click',function(){ | ||
| 240 | + $('#station').parent().removeClass('active'); | ||
| 241 | + $('#section').parent().addClass('active'); | ||
| 242 | + $('#station_list_div').removeClass('active'); | ||
| 243 | + $('#station_list_div').addClass('hidden'); | ||
| 244 | + $('#section_list_div').removeClass('hidden'); | ||
| 245 | + $('#section_list_div').addClass('active'); | ||
| 246 | + var generationType = EditRoute.getLineGenerationType(); | ||
| 247 | + // 更具生成类型展示不同页面 | ||
| 248 | + if(generationType == 'cite'){ | ||
| 249 | + $('#gpsSection').addClass('hidden'); | ||
| 250 | + | ||
| 251 | + } else if(generationType == 'uploadGPS') { | ||
| 252 | + $('#citeSection').addClass('hidden'); | ||
| 253 | + } | ||
| 254 | + // 清除地图覆盖物 | ||
| 255 | + WorldsBMapLine.clearMarkAndOverlays(); | ||
| 256 | + var params = {}; | ||
| 257 | + var line = EditRoute.getLineObj(); | ||
| 258 | + params.lineId=line.id; | ||
| 259 | + params.dir = line.dir; | ||
| 260 | + // 查询路段信息 | ||
| 261 | + $get('/sectionroute/findCacheSection',params,function(data) { | ||
| 262 | + var section_radio_html = '<div id="section_radio">'; | ||
| 263 | + var cont = 1; | ||
| 264 | + var check = 'checked="checked"'; | ||
| 265 | + $.each(data,function(){ | ||
| 266 | + sectionRouteMap[this.sectionrouteId] = this; | ||
| 267 | + 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>"; | ||
| 268 | + cont++; | ||
| 269 | + }); | ||
| 270 | + section_radio_html += '</div>'; | ||
| 271 | + $("#section_list_div #citeSection .defeat-scroll").html(section_radio_html); | ||
| 272 | + // 在地图上画出线路走向 | ||
| 273 | + PublicFunctions.linePanlThree(line.id,data,line.dir); | ||
| 274 | + }); | ||
| 275 | + }); | ||
| 276 | + | ||
| 183 | // 监听右侧悬浮框导航栏事件 | 277 | // 监听右侧悬浮框导航栏事件 |
| 184 | $('#station').on('click',function(){ | 278 | $('#station').on('click',function(){ |
| 185 | $('#section').parent().removeClass('active'); | 279 | $('#section').parent().removeClass('active'); |
| @@ -196,12 +290,12 @@ $(function(){ | @@ -196,12 +290,12 @@ $(function(){ | ||
| 196 | params.lineId=line.id; | 290 | params.lineId=line.id; |
| 197 | params.dir = line.dir; | 291 | params.dir = line.dir; |
| 198 | $.get('/stationroute/findCachePoint',params,function(data){ | 292 | $.get('/stationroute/findCachePoint',params,function(data){ |
| 199 | - var station_radio_html = '<div id="station_radio" >'; | 293 | + var station_radio_html = '<div id="station_radio">'; |
| 200 | var cont = 1; | 294 | var cont = 1; |
| 201 | var check = 'checked="checked"'; | 295 | var check = 'checked="checked"'; |
| 202 | $.each(data,function(){ | 296 | $.each(data,function(){ |
| 203 | stationRouteMap[this.stationRouteId] = this; | 297 | 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>"; | 298 | + 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 | cont++; | 299 | cont++; |
| 206 | }); | 300 | }); |
| 207 | station_radio_html += '</div>'; | 301 | station_radio_html += '</div>'; |
| @@ -209,33 +303,61 @@ $(function(){ | @@ -209,33 +303,61 @@ $(function(){ | ||
| 209 | }); | 303 | }); |
| 210 | }); | 304 | }); |
| 211 | 305 | ||
| 306 | + // 查询路段 | ||
| 307 | + $('#findSection').on('click', function(){ | ||
| 308 | + var id = $(".section input[type='radio']:checked").val(); | ||
| 309 | + var sectionRoute = sectionRouteMap[id]; | ||
| 310 | + if(id && sectionRoute){ | ||
| 311 | + WorldsBMapLine.drawingSection(sectionRoute); | ||
| 312 | + } else if(id && !sectionRoute){ | ||
| 313 | + layer.msg('您选择的路段不存在,请重新选择!'); | ||
| 314 | + }else{ | ||
| 315 | + layer.msg('请先选择要查看的路段!'); | ||
| 316 | + } | ||
| 317 | + }); | ||
| 318 | + | ||
| 319 | + // 添加站点 | ||
| 320 | + $('#addStation').on('click', function(){ | ||
| 321 | + $.get('addstation_select.html', function(m){ | ||
| 322 | + $(pjaxContainer).append(m); | ||
| 323 | + $('#addstation_select_mobal').trigger('AddSelectMobal.show', [WorldsBMapLine, DrawingManagerObj, MapGetAjaxData, EditRoute, PublicFunctions]); | ||
| 324 | + }); | ||
| 325 | + }); | ||
| 326 | + | ||
| 327 | + // 查询站点 | ||
| 212 | $('#findStation').on('click', function(){ | 328 | $('#findStation').on('click', function(){ |
| 213 | - var id = $("input[type='radio']:checked").val(); | 329 | + var id = $(".station input[type='radio']:checked").val(); |
| 214 | var stationRoute = stationRouteMap[id]; | 330 | 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 | - } | 331 | + if(id && stationRoute){ |
| 332 | + // 站点形状 | ||
| 333 | + var shapesType = stationRoute.stationShapesType; | ||
| 334 | + // 如果是圆 | ||
| 335 | + if(shapesType =='r') { | ||
| 336 | + | ||
| 337 | + // 百度地图画圆 | ||
| 338 | + WorldsBMapLine.pointsCircle(stationRoute); | ||
| 229 | 339 | ||
| 340 | + // 如果是多变行 | ||
| 341 | + }else if(shapesType == 'd') { | ||
| 342 | + | ||
| 343 | + // 百度地图画多边形 | ||
| 344 | + WorldsBMapLine.pointsPolygon(stationRoute); | ||
| 345 | + } | ||
| 346 | + } else if(id && !stationRoute){ | ||
| 347 | + layer.msg('您选择的站点不存在,请重新选择!'); | ||
| 348 | + }else{ | ||
| 349 | + layer.msg('请先选择要查看的站点!'); | ||
| 350 | + } | ||
| 230 | }); | 351 | }); |
| 352 | + | ||
| 353 | + // 修改站点 | ||
| 231 | $('#updateStation').on('click', function(){ | 354 | $('#updateStation').on('click', function(){ |
| 232 | - var id = $("input[type='radio']:checked").val(); | 355 | + var id = $(".station input[type='radio']:checked").val(); |
| 233 | var stationRoute = stationRouteMap[id]; | 356 | var stationRoute = stationRouteMap[id]; |
| 234 | - | ||
| 235 | if(id && stationRoute){ | 357 | if(id && stationRoute){ |
| 236 | $.get('editstation_select.html', function(m){ | 358 | $.get('editstation_select.html', function(m){ |
| 237 | $(pjaxContainer).append(m); | 359 | $(pjaxContainer).append(m); |
| 238 | - $('#editstation_select_mobal').trigger('editStationSelectMobal_show', [WorldsBMapLine, DrawingManagerObj, stationRoute]); | 360 | + $('#editstation_select_mobal').trigger('editStationSelectMobal_show', [WorldsBMapLine, PublicFunctions, DrawingManagerObj, stationRoute]); |
| 239 | }); | 361 | }); |
| 240 | } else if(id && !stationRoute){ | 362 | } else if(id && !stationRoute){ |
| 241 | layer.msg('您选择的站点不存在,请重新选择!'); | 363 | layer.msg('您选择的站点不存在,请重新选择!'); |
| @@ -243,25 +365,16 @@ $(function(){ | @@ -243,25 +365,16 @@ $(function(){ | ||
| 243 | layer.msg('请先选择要编辑的站点!'); | 365 | layer.msg('请先选择要编辑的站点!'); |
| 244 | } | 366 | } |
| 245 | }); | 367 | }); |
| 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 | - }); | 368 | + |
| 369 | + // 监听打开鼠标绘制工具按钮事件. | ||
| 370 | + $('#oppenDrawingManager').on('click',function() { | ||
| 371 | + DrawingManagerObj.drawingManagerOpen(); | ||
| 372 | + }); | ||
| 373 | + // 监听关闭鼠标绘制工具按钮事件. | ||
| 374 | + $('#closeDrawingManager').on('click',function() { | ||
| 375 | + DrawingManagerObj.drawingManagerClose(); | ||
| 264 | }); | 376 | }); |
| 377 | + | ||
| 265 | // 滚动轴监听事件 | 378 | // 滚动轴监听事件 |
| 266 | $('#scrllmouseEvent_div').on('mousemove',function() { | 379 | $('#scrllmouseEvent_div').on('mousemove',function() { |
| 267 | $('.defeat-scroll').css('overflow','auto'); | 380 | $('.defeat-scroll').css('overflow','auto'); |
| @@ -277,10 +390,12 @@ $(function(){ | @@ -277,10 +390,12 @@ $(function(){ | ||
| 277 | <!-- 地图类 --> | 390 | <!-- 地图类 --> |
| 278 | <script src="/pages/base/line/js/map.js"></script> | 391 | <script src="/pages/base/line/js/map.js"></script> |
| 279 | <!-- 函数与方法 --> | 392 | <!-- 函数与方法 --> |
| 280 | -<script src="/pages/base/line/js/line-map-function.js"></script> | 393 | +<script src="/pages/base/line/js/map-function.js"></script> |
| 281 | <!-- 修改路段对象类 --> | 394 | <!-- 修改路段对象类 --> |
| 282 | <script src="/pages/base/stationroute/js/editsection.js"></script> | 395 | <script src="/pages/base/stationroute/js/editsection.js"></script> |
| 283 | <!-- 绘图类 --> | 396 | <!-- 绘图类 --> |
| 284 | <script src="/pages/base/line/js/drawingManager.js"></script> | 397 | <script src="/pages/base/line/js/drawingManager.js"></script> |
| 285 | <!-- ajax请求类 --> | 398 | <!-- ajax请求类 --> |
| 286 | -<script src="/pages/base/stationroute/js/stationroute-ajax-getdata.js"></script> | ||
| 287 | \ No newline at end of file | 399 | \ No newline at end of file |
| 400 | +<!-- <script src="/pages/base/stationroute/js/stationroute-ajax-getdata.js"></script> --> | ||
| 401 | +<!-- ajax请求类 --> | ||
| 402 | +<script src="/pages/base/line/js/map-ajax-getdata.js"></script> | ||
| 288 | \ No newline at end of file | 403 | \ No newline at end of file |
src/main/resources/static/pages/base/lineversions/add.html
| @@ -44,6 +44,7 @@ | @@ -44,6 +44,7 @@ | ||
| 44 | <div class="form-body"> | 44 | <div class="form-body"> |
| 45 | <input type="hidden" name="lineId" id="lineIdInput" /> | 45 | <input type="hidden" name="lineId" id="lineIdInput" /> |
| 46 | <input type="hidden" name="lineCode" id="lineCodeInput" /> | 46 | <input type="hidden" name="lineCode" id="lineCodeInput" /> |
| 47 | + <input type="hidden" name="lineCode" id="statusInput" /> | ||
| 47 | 48 | ||
| 48 | <!-- 表单分组组件 form-group START --> | 49 | <!-- 表单分组组件 form-group START --> |
| 49 | <div class="form-group"> | 50 | <div class="form-group"> |
| @@ -100,7 +101,7 @@ | @@ -100,7 +101,7 @@ | ||
| 100 | </div> | 101 | </div> |
| 101 | <!-- 表单分组组件 form-group END --> | 102 | <!-- 表单分组组件 form-group END --> |
| 102 | 103 | ||
| 103 | - <div class="form-group"> | 104 | + <!-- <div class="form-group"> |
| 104 | <label class="control-label col-md-5"> | 105 | <label class="control-label col-md-5"> |
| 105 | <span class="required"> * </span>线路版本状态 : | 106 | <span class="required"> * </span>线路版本状态 : |
| 106 | </label> | 107 | </label> |
| @@ -112,7 +113,7 @@ | @@ -112,7 +113,7 @@ | ||
| 112 | <option value="0">历史版本</option> | 113 | <option value="0">历史版本</option> |
| 113 | </select> | 114 | </select> |
| 114 | </div> | 115 | </div> |
| 115 | - </div> | 116 | + </div> --> |
| 116 | 117 | ||
| 117 | <!-- 表单分组组件 form-group START --> | 118 | <!-- 表单分组组件 form-group START --> |
| 118 | <div class="form-group"> | 119 | <div class="form-group"> |
src/main/resources/static/pages/base/lineversions/edit.html
| @@ -44,6 +44,7 @@ | @@ -44,6 +44,7 @@ | ||
| 44 | <div class="form-body"> | 44 | <div class="form-body"> |
| 45 | <input type="hidden" name="lineId" id="lineIdInput" /> | 45 | <input type="hidden" name="lineId" id="lineIdInput" /> |
| 46 | <input type="hidden" name="lineCode" id="lineCodeInput" /> | 46 | <input type="hidden" name="lineCode" id="lineCodeInput" /> |
| 47 | + <input type="hidden" name="lineCode" id="statusInput" /> | ||
| 47 | 48 | ||
| 48 | <!-- 表单分组组件 form-group START --> | 49 | <!-- 表单分组组件 form-group START --> |
| 49 | <div class="form-group"> | 50 | <div class="form-group"> |
| @@ -100,7 +101,7 @@ | @@ -100,7 +101,7 @@ | ||
| 100 | </div> | 101 | </div> |
| 101 | <!-- 表单分组组件 form-group END --> | 102 | <!-- 表单分组组件 form-group END --> |
| 102 | 103 | ||
| 103 | - <div class="form-group"> | 104 | + <!-- <div class="form-group"> |
| 104 | <label class="control-label col-md-5"> | 105 | <label class="control-label col-md-5"> |
| 105 | <span class="required"> * </span>线路版本状态 : | 106 | <span class="required"> * </span>线路版本状态 : |
| 106 | </label> | 107 | </label> |
| @@ -112,7 +113,7 @@ | @@ -112,7 +113,7 @@ | ||
| 112 | <option value="0">历史版本</option> | 113 | <option value="0">历史版本</option> |
| 113 | </select> | 114 | </select> |
| 114 | </div> | 115 | </div> |
| 115 | - </div> | 116 | + </div> --> |
| 116 | 117 | ||
| 117 | <!-- 表单分组组件 form-group START --> | 118 | <!-- 表单分组组件 form-group START --> |
| 118 | <div class="form-group"> | 119 | <div class="form-group"> |
src/main/resources/static/pages/base/lineversions/js/lineversions-add-from.js
| @@ -37,13 +37,14 @@ | @@ -37,13 +37,14 @@ | ||
| 37 | }); | 37 | }); |
| 38 | } | 38 | } |
| 39 | 39 | ||
| 40 | - // 填充公司下拉框选择值 | 40 | + // 填充线路下拉框选择值 |
| 41 | function lineAllInfo(){ | 41 | function lineAllInfo(){ |
| 42 | getComp(function(params) { | 42 | getComp(function(params) { |
| 43 | $get('/line/all', params, function(array){ | 43 | $get('/line/all', params, function(array){ |
| 44 | // get请求获取公司 | 44 | // get请求获取公司 |
| 45 | $get('/business/all', {upCode_eq: '88'}, function(compD){ | 45 | $get('/business/all', {upCode_eq: '88'}, function(compD){ |
| 46 | var len_ = array.length,paramsD = new Array(); | 46 | var len_ = array.length,paramsD = new Array(); |
| 47 | + paramsD.push({'id':'请选择...','text':'请选择...'}); | ||
| 47 | if(len_>0) { | 48 | if(len_>0) { |
| 48 | $.each(array, function(i, g){ | 49 | $.each(array, function(i, g){ |
| 49 | if(g.name!='' || g.name != null) { | 50 | if(g.name!='' || g.name != null) { |
| @@ -54,7 +55,7 @@ | @@ -54,7 +55,7 @@ | ||
| 54 | if($('span').hasClass('select2-selection')) | 55 | if($('span').hasClass('select2-selection')) |
| 55 | $('span .select2-selection').remove(); | 56 | $('span .select2-selection').remove(); |
| 56 | initPinYinSelect2($('#lineSelect'),paramsD,function(selector) { | 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,16 +66,30 @@ | ||
| 65 | // 监听线路名称下拉框值改变事件. | 66 | // 监听线路名称下拉框值改变事件. |
| 66 | $('#lineSelect').on("change", function (e) { | 67 | $('#lineSelect').on("change", function (e) { |
| 67 | var lineSelectValue = $('#lineSelect').val();// 获取线路名称值. | 68 | var lineSelectValue = $('#lineSelect').val();// 获取线路名称值. |
| 68 | - if(lineSelectValue=='' || lineSelectValue==null) { | 69 | + if(lineSelectValue=='' || lineSelectValue==null || lineSelectValue=="请选择...") { |
| 69 | $('#lineCodeInput').val('');// 设值线路编码. | 70 | $('#lineCodeInput').val('');// 设值线路编码. |
| 70 | $('#lineIdInput').val('');// 设值线路ID. | 71 | $('#lineIdInput').val('');// 设值线路ID. |
| 71 | }else { | 72 | }else { |
| 72 | var lineSelectValueArray = lineSelectValue.split('_');// 切割线路名称值. | 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,7 +133,7 @@ | ||
| 118 | 'startDate' : {required : true},// 启用时间 不为空. | 133 | 'startDate' : {required : true},// 启用时间 不为空. |
| 119 | 'endDate' : {required : true},// 结束时间. | 134 | 'endDate' : {required : true},// 结束时间. |
| 120 | 'versions' : {required : true, digits : true, maxlength: 10},// 版本号 必填项、数字、最大长度10. | 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,7 +37,7 @@ | ||
| 37 | }); | 37 | }); |
| 38 | } | 38 | } |
| 39 | 39 | ||
| 40 | - // 填充公司下拉框选择值 | 40 | + // 填充线路下拉框选择值 |
| 41 | function lineAllInfo(){ | 41 | function lineAllInfo(){ |
| 42 | getComp(function(params) { | 42 | getComp(function(params) { |
| 43 | $get('/line/all', params, function(array){ | 43 | $get('/line/all', params, function(array){ |
src/main/resources/static/pages/base/lineversions/js/lineversions-list-table.js
| @@ -4,7 +4,7 @@ | @@ -4,7 +4,7 @@ | ||
| 4 | * @Description : TOOD(线路信息list.html页面js) | 4 | * @Description : TOOD(线路信息list.html页面js) |
| 5 | */ | 5 | */ |
| 6 | 6 | ||
| 7 | -(function(){ | 7 | + |
| 8 | // 关闭左侧栏 | 8 | // 关闭左侧栏 |
| 9 | if (!$('body').hasClass('page-sidebar-closed')) {$('.menu-toggler.sidebar-toggler').click();} | 9 | if (!$('body').hasClass('page-sidebar-closed')) {$('.menu-toggler.sidebar-toggler').click();} |
| 10 | // 定义 page : 当前页;initPag ; icheckOptions:选择框 | 10 | // 定义 page : 当前页;initPag ; icheckOptions:选择框 |
| @@ -269,6 +269,7 @@ | @@ -269,6 +269,7 @@ | ||
| 269 | return rsStr; | 269 | return rsStr; |
| 270 | } | 270 | } |
| 271 | 271 | ||
| 272 | + | ||
| 272 | /** 搜索按钮事件 */ | 273 | /** 搜索按钮事件 */ |
| 273 | $('tr.filter .filter-submit').on('click',function(){ | 274 | $('tr.filter .filter-submit').on('click',function(){ |
| 274 | var params = getParams(); | 275 | var params = getParams(); |
| @@ -280,5 +281,54 @@ | @@ -280,5 +281,54 @@ | ||
| 280 | /** 表格数据分页加载 @param:<params:搜索参数;true:是否重新分页> */ | 281 | /** 表格数据分页加载 @param:<params:搜索参数;true:是否重新分页> */ |
| 281 | loadTableDate(params,true); | 282 | loadTableDate(params,true); |
| 282 | }); | 283 | }); |
| 283 | - | ||
| 284 | -})(); | ||
| 285 | \ No newline at end of file | 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 | \ No newline at end of file | 336 | \ No newline at end of file |
src/main/resources/static/pages/base/lineversions/list.html
| @@ -26,7 +26,7 @@ | @@ -26,7 +26,7 @@ | ||
| 26 | </div> | 26 | </div> |
| 27 | <div class="actions"> | 27 | <div class="actions"> |
| 28 | <div class="btn-group btn-group-devided" data-toggle="buttons"> | 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 | </div> | 30 | </div> |
| 31 | </div> | 31 | </div> |
| 32 | </div> | 32 | </div> |
| @@ -37,9 +37,9 @@ | @@ -37,9 +37,9 @@ | ||
| 37 | <tr role="row" class="heading"> | 37 | <tr role="row" class="heading"> |
| 38 | <th width="4%">序号</th> | 38 | <th width="4%">序号</th> |
| 39 | <th width="5%">线路编码</th> | 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 | <th width="8%">启用时间</th> | 43 | <th width="8%">启用时间</th> |
| 44 | <th width="8%">终止时间</th> | 44 | <th width="8%">终止时间</th> |
| 45 | <th width="6%">版本号</th> | 45 | <th width="6%">版本号</th> |
| @@ -181,6 +181,8 @@ | @@ -181,6 +181,8 @@ | ||
| 181 | 南汇维修公司 | 181 | 南汇维修公司 |
| 182 | {{else if obj.line.brancheCompany == '5'}} | 182 | {{else if obj.line.brancheCompany == '5'}} |
| 183 | 南汇公司 | 183 | 南汇公司 |
| 184 | + {{else if obj.brancheCompany == '6'}} | ||
| 185 | + 航头枢纽站 | ||
| 184 | {{/if}} | 186 | {{/if}} |
| 185 | 187 | ||
| 186 | {{/if}} | 188 | {{/if}} |
| @@ -208,6 +210,14 @@ | @@ -208,6 +210,14 @@ | ||
| 208 | </td> | 210 | </td> |
| 209 | <td> | 211 | <td> |
| 210 | <a href="edit.html?no={{obj.id}}" class="btn default blue-stripe btn-sm" data-pjax> 修改 </a> | 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 | </td> | 221 | </td> |
| 212 | </tr> | 222 | </tr> |
| 213 | {{/each}} | 223 | {{/each}} |
src/main/resources/static/pages/base/station/edit.html
| @@ -52,7 +52,7 @@ | @@ -52,7 +52,7 @@ | ||
| 52 | <span class="required"> * </span> 站点路由名称: | 52 | <span class="required"> * </span> 站点路由名称: |
| 53 | </label> | 53 | </label> |
| 54 | <div class="col-md-6"> | 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 | </div> | 56 | </div> |
| 57 | </div> | 57 | </div> |
| 58 | </div> | 58 | </div> |
| @@ -246,7 +246,7 @@ $('#editPoitsions_station_mobal').on('editStationMobal_show', function(e, map,fu | @@ -246,7 +246,7 @@ $('#editPoitsions_station_mobal').on('editStationMobal_show', function(e, map,fu | ||
| 246 | errorClass : 'help-block help-block-error', | 246 | errorClass : 'help-block help-block-error', |
| 247 | focusInvalid : false, | 247 | focusInvalid : false, |
| 248 | rules : { | 248 | rules : { |
| 249 | - 'stationName' : {required : true},// 站点路由名称 必填项 | 249 | + 'stationRouteName' : {required : true},// 站点路由名称 必填项 |
| 250 | 'stationCod': {required : true,},// 站点编码 必填项 | 250 | 'stationCod': {required : true,},// 站点编码 必填项 |
| 251 | 'directions' : {required : true,dirIs : true},// 站点方向 必填项 必填项 | 251 | 'directions' : {required : true,dirIs : true},// 站点方向 必填项 必填项 |
| 252 | 'stationRouteCode' : {isStart : true},// 站点序号 | 252 | 'stationRouteCode' : {isStart : true},// 站点序号 |
src/main/resources/static/pages/base/station/js/add-vmap-world.js
| @@ -140,7 +140,7 @@ var StationPVmapWorlds = function() { | @@ -140,7 +140,7 @@ var StationPVmapWorlds = function() { | ||
| 140 | }); | 140 | }); |
| 141 | }, | 141 | }, |
| 142 | // 打开绘画工具 | 142 | // 打开绘画工具 |
| 143 | - drawingManagerOpen : function(map) { | 143 | + drawingManagerOpen : function() { |
| 144 | // 打开鼠标绘画工具 | 144 | // 打开鼠标绘画工具 |
| 145 | drawingManager.open(); | 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,7 +26,7 @@ var PositionsPublicFunctions = function () { | ||
| 26 | // 中心坐标点 | 26 | // 中心坐标点 |
| 27 | var point = new BMap.Point(BJwpoints[0], BJwpoints[1]); | 27 | var point = new BMap.Point(BJwpoints[0], BJwpoints[1]); |
| 28 | var htm = '<HR style="border:1 dashed #987cb9" width="100%" color=#987cb9 SIZE=1>'+ | 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 | '<span class="help-block" style="color:#DDD;font-size: 15px;">站点编码:' + r[0].stationCode + '</span>' + | 30 | '<span class="help-block" style="color:#DDD;font-size: 15px;">站点编码:' + r[0].stationCode + '</span>' + |
| 31 | '<span class="help-block" style="color:#DDD;font-size: 15px;">站点序号:' + r[0].stationRouteCode + '</span>' + | 31 | '<span class="help-block" style="color:#DDD;font-size: 15px;">站点序号:' + r[0].stationRouteCode + '</span>' + |
| 32 | '<span class="help-block" style="color:#DDD;font-size: 15px;">站点类型:' + markTypeStr + '</span>' + | 32 | '<span class="help-block" style="color:#DDD;font-size: 15px;">站点类型:' + markTypeStr + '</span>' + |
| @@ -47,7 +47,7 @@ var PositionsPublicFunctions = function () { | @@ -47,7 +47,7 @@ var PositionsPublicFunctions = function () { | ||
| 47 | // 信息窗位置偏移值。 | 47 | // 信息窗位置偏移值。 |
| 48 | offset: new BMap.Size(500,80), | 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 | enableMessage : false, | 52 | enableMessage : false, |
| 53 | //是否开启点击地图关闭信息窗口 | 53 | //是否开启点击地图关闭信息窗口 |
| @@ -123,7 +123,7 @@ var PositionsPublicFunctions = function () { | @@ -123,7 +123,7 @@ var PositionsPublicFunctions = function () { | ||
| 123 | // 获取站点名称元素设值 | 123 | // 获取站点名称元素设值 |
| 124 | $('#zdmcInput').val(stationObj.zdmc); | 124 | $('#zdmcInput').val(stationObj.zdmc); |
| 125 | // 获取站点名称元素设值 | 125 | // 获取站点名称元素设值 |
| 126 | - $('#stationNameInput').val(stationObj.stationName); | 126 | + $('#stationRouteNameInput').val(stationObj.stationRouteName); |
| 127 | // 获取站点编码元素设值 | 127 | // 获取站点编码元素设值 |
| 128 | $('#stationCodInput').val(stationObj.stationCode); | 128 | $('#stationCodInput').val(stationObj.stationCode); |
| 129 | // 获取站点类型元素设值 | 129 | // 获取站点类型元素设值 |
| @@ -183,7 +183,7 @@ var PositionsPublicFunctions = function () { | @@ -183,7 +183,7 @@ var PositionsPublicFunctions = function () { | ||
| 183 | // 站点名称 | 183 | // 站点名称 |
| 184 | $('#zdmcInput').val(stationObj.zdmc); | 184 | $('#zdmcInput').val(stationObj.zdmc); |
| 185 | // 站点路由线路名称 | 185 | // 站点路由线路名称 |
| 186 | - $('#stationNameInput').val(stationObj.stationName); | 186 | + $('#stationRouteNameInput').val(stationObj.stationRouteName); |
| 187 | // 获取站点类型元素设值 | 187 | // 获取站点类型元素设值 |
| 188 | $('#stationMarkSelect').val(stationObj.stationRouteStationMark); | 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,11 +136,11 @@ var StationPositionsWorldsBMap = function () { | ||
| 136 | $('#editPoitsions_station_mobal').trigger('editStationMobal_show', [StationPositionsWorldsBMap,PositionsPublicFunctions,PositionsStationObj]); | 136 | $('#editPoitsions_station_mobal').trigger('editStationMobal_show', [StationPositionsWorldsBMap,PositionsPublicFunctions,PositionsStationObj]); |
| 137 | }); | 137 | }); |
| 138 | }); | 138 | }); |
| 139 | - // 编辑多变行 | 139 | + // 编辑多边行 |
| 140 | }else if(stationShapesTypeV =='d') { | 140 | }else if(stationShapesTypeV =='d') { |
| 141 | // 开启编辑功能(自 1.1 新增) | 141 | // 开启编辑功能(自 1.1 新增) |
| 142 | polygon.enableEditing(); | 142 | polygon.enableEditing(); |
| 143 | - // 添加多变行编辑事件 | 143 | + // 添加多边行编辑事件 |
| 144 | polygon.addEventListener('dblclick',function(e) { | 144 | polygon.addEventListener('dblclick',function(e) { |
| 145 | // 获取编辑的多边形对象 | 145 | // 获取编辑的多边形对象 |
| 146 | var edit_pointE = polygon; | 146 | var edit_pointE = polygon; |
src/main/resources/static/pages/base/station/list_edit.html
| @@ -278,7 +278,5 @@ | @@ -278,7 +278,5 @@ | ||
| 278 | <!-- 表单组件 END --> | 278 | <!-- 表单组件 END --> |
| 279 | </div> | 279 | </div> |
| 280 | <!-- 信息容器组件 END --> | 280 | <!-- 信息容器组件 END --> |
| 281 | - | ||
| 282 | -<script src="/pages/base/station/js/positionstation.js"></script> | ||
| 283 | <script src="/pages/base/station/js/station-positions-function.js"></script> | 281 | <script src="/pages/base/station/js/station-positions-function.js"></script> |
| 284 | <script src="/pages/base/station/js/station-list-edit.js"></script> | 282 | <script src="/pages/base/station/js/station-list-edit.js"></script> |
| 285 | \ No newline at end of file | 283 | \ No newline at end of file |
src/main/resources/static/pages/base/stationroute/edit.html
| @@ -197,7 +197,6 @@ $('#edit_station_mobal').on('editSelectMobal_show', function(e, map_,ajaxd,stati | @@ -197,7 +197,6 @@ $('#edit_station_mobal').on('editSelectMobal_show', function(e, map_,ajaxd,stati | ||
| 197 | layer.closeAll(); | 197 | layer.closeAll(); |
| 198 | var editStationParmasObj = station_.getEitdStation(); | 198 | var editStationParmasObj = station_.getEitdStation(); |
| 199 | var addLine = Line_.getLineObj(); | 199 | var addLine = Line_.getLineObj(); |
| 200 | - debugger | ||
| 201 | fun.setFormValue(editStationParmasObj); | 200 | fun.setFormValue(editStationParmasObj); |
| 202 | var initzdlyP = {'lineCode_eq':editStationParmasObj.stationRouteLineCode,'destroy_eq':0,'directions_eq':editStationParmasObj.stationRouteDirections}; | 201 | var initzdlyP = {'lineCode_eq':editStationParmasObj.stationRouteLineCode,'destroy_eq':0,'directions_eq':editStationParmasObj.stationRouteDirections}; |
| 203 | initSelect(initzdlyP); | 202 | initSelect(initzdlyP); |
| @@ -336,8 +335,12 @@ $('#edit_station_mobal').on('editSelectMobal_show', function(e, map_,ajaxd,stati | @@ -336,8 +335,12 @@ $('#edit_station_mobal').on('editSelectMobal_show', function(e, map_,ajaxd,stati | ||
| 336 | function setZdlyValue() { | 335 | function setZdlyValue() { |
| 337 | ajaxd.findUpStationRouteCode(editStationParmasObj.stationRouteLine,editStationParmasObj.stationRouteDirections,editStationParmasObj.stationRouteStationRouteCode,function(str) { | 336 | ajaxd.findUpStationRouteCode(editStationParmasObj.stationRouteLine,editStationParmasObj.stationRouteDirections,editStationParmasObj.stationRouteStationRouteCode,function(str) { |
| 338 | if(str.length>0){ | 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 | $('#stationrouteSelect').select2('val',upStationRouteCode); | 344 | $('#stationrouteSelect').select2('val',upStationRouteCode); |
| 342 | }else { | 345 | }else { |
| 343 | $('#stationrouteSelect').select2('val','请选择...'); | 346 | $('#stationrouteSelect').select2('val','请选择...'); |
src/main/resources/static/pages/base/stationroute/js/stationroute-ajax-getdata.js
| @@ -130,7 +130,7 @@ var GetAjaxData = function(){ | @@ -130,7 +130,7 @@ var GetAjaxData = function(){ | ||
| 130 | 130 | ||
| 131 | }, | 131 | }, |
| 132 | 132 | ||
| 133 | - // 查询路段信息 | 133 | + // 查询站点信息 |
| 134 | getStationRouteInfo : function(lineId,direction,callback) { | 134 | getStationRouteInfo : function(lineId,direction,callback) { |
| 135 | $get('/stationroute/all',{'line.id_eq' : lineId , 'directions_eq' : direction},function(resultdata) { | 135 | $get('/stationroute/all',{'line.id_eq' : lineId , 'directions_eq' : direction},function(resultdata) { |
| 136 | callback && callback(resultdata); | 136 | callback && callback(resultdata); |
src/main/resources/static/pages/base/stationroute/js/stationroute-list-events.js
| @@ -83,10 +83,10 @@ $(function(){ | @@ -83,10 +83,10 @@ $(function(){ | ||
| 83 | $post('/stationroute/updSwitchDir?lineIds='+ Line.id,null,function(data) { | 83 | $post('/stationroute/updSwitchDir?lineIds='+ Line.id,null,function(data) { |
| 84 | layer.close(index); | 84 | layer.close(index); |
| 85 | if(data.status=='SUCCESS') { | 85 | if(data.status=='SUCCESS') { |
| 86 | - // 弹出添加成功提示消息 | 86 | + // 弹出操作成功提示消息 |
| 87 | layer.msg('操作成功...'); | 87 | layer.msg('操作成功...'); |
| 88 | }else { | 88 | }else { |
| 89 | - // 弹出添加失败提示消息 | 89 | + // 弹出操作失败提示消息 |
| 90 | layer.msg('操作成功...'); | 90 | layer.msg('操作成功...'); |
| 91 | } | 91 | } |
| 92 | WorldsBMap.clearMarkAndOverlays(); | 92 | WorldsBMap.clearMarkAndOverlays(); |
| @@ -148,10 +148,10 @@ $(function(){ | @@ -148,10 +148,10 @@ $(function(){ | ||
| 148 | $post('/sectionroute/quoteSection',params,function(data) { | 148 | $post('/sectionroute/quoteSection',params,function(data) { |
| 149 | layer.close(index); | 149 | layer.close(index); |
| 150 | if(data.status=='SUCCESS') { | 150 | if(data.status=='SUCCESS') { |
| 151 | - // 弹出添加成功提示消息 | 151 | + // 弹出操作成功提示消息 |
| 152 | layer.msg('操作成功...'); | 152 | layer.msg('操作成功...'); |
| 153 | }else { | 153 | }else { |
| 154 | - // 弹出添加失败提示消息 | 154 | + // 弹出操作失败提示消息 |
| 155 | layer.msg('操作成功...'); | 155 | layer.msg('操作成功...'); |
| 156 | } | 156 | } |
| 157 | WorldsBMap.clearMarkAndOverlays(); | 157 | WorldsBMap.clearMarkAndOverlays(); |
| @@ -254,10 +254,10 @@ $(function(){ | @@ -254,10 +254,10 @@ $(function(){ | ||
| 254 | var params = {lineId:lineIdEvents.id}; | 254 | var params = {lineId:lineIdEvents.id}; |
| 255 | GetAjaxData.createUsingSingle(params,function(data) { | 255 | GetAjaxData.createUsingSingle(params,function(data) { |
| 256 | if(data.status=='SUCCESS') { | 256 | if(data.status=='SUCCESS') { |
| 257 | - // 弹出添加成功提示消息 | 257 | + // 弹出生成成功提示消息 |
| 258 | layer.msg('生成成功...'); | 258 | layer.msg('生成成功...'); |
| 259 | }else { | 259 | }else { |
| 260 | - // 弹出添加失败提示消息 | 260 | + // 弹出生成失败提示消息 |
| 261 | layer.msg('生成失败...'); | 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,32 +244,41 @@ var PublicFunctions = function () { | ||
| 244 | params.shapesType = 'r'; | 244 | params.shapesType = 'r'; |
| 245 | // destroy:是否撤销 | 245 | // destroy:是否撤销 |
| 246 | params.destroy = '0'; | 246 | params.destroy = '0'; |
| 247 | - // versions:版本号 | ||
| 248 | - params.versions = '1'; | 247 | + |
| 249 | // 路段信息JSON字符串 | 248 | // 路段信息JSON字符串 |
| 250 | params.sectionJSON = sectionJSON; | 249 | params.sectionJSON = sectionJSON; |
| 251 | // 限速 | 250 | // 限速 |
| 252 | params.speedLimit = '60'; | 251 | params.speedLimit = '60'; |
| 253 | params.baseRes = 'No'; | 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,7 +13,7 @@ | ||
| 13 | </div> | 13 | </div> |
| 14 | </div> | 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 | <div class="row"> | 17 | <div class="row"> |
| 18 | <!-- 上下行栏 --> | 18 | <!-- 上下行栏 --> |
| 19 | <div class="col-md-3 col-sm-3 col-xs-3"> | 19 | <div class="col-md-3 col-sm-3 col-xs-3"> |