Commit 31c45a806ee5b7b08216cde2c2645de40d701a92
1 parent
fe5a4f47
1.安全加固
Showing
37 changed files
with
2259 additions
and
622 deletions
src/main/java/com/bsth/controller/LineRegionController.java
0 → 100644
| 1 | +package com.bsth.controller; | |
| 2 | + | |
| 3 | +import com.bsth.common.ResponseCode; | |
| 4 | +import com.bsth.entity.LineRegion; | |
| 5 | +import com.bsth.entity.LsStationRoute; | |
| 6 | +import com.bsth.service.LineRegionService; | |
| 7 | +import org.slf4j.Logger; | |
| 8 | +import org.slf4j.LoggerFactory; | |
| 9 | +import org.springframework.beans.factory.annotation.Autowired; | |
| 10 | +import org.springframework.web.bind.annotation.RequestMapping; | |
| 11 | +import org.springframework.web.bind.annotation.RequestMethod; | |
| 12 | +import org.springframework.web.bind.annotation.RequestParam; | |
| 13 | +import org.springframework.web.bind.annotation.RestController; | |
| 14 | + | |
| 15 | +import java.util.HashMap; | |
| 16 | +import java.util.List; | |
| 17 | +import java.util.Map; | |
| 18 | + | |
| 19 | +/** | |
| 20 | + * @Author Hill | |
| 21 | + */ | |
| 22 | +@RestController | |
| 23 | +@RequestMapping("/api/lineregion") | |
| 24 | +public class LineRegionController extends BaseController<LineRegion, Integer> { | |
| 25 | + | |
| 26 | + private Logger log = LoggerFactory.getLogger(LineRegionController.class); | |
| 27 | + | |
| 28 | + @Autowired | |
| 29 | + private LineRegionService lineRegionService; | |
| 30 | + | |
| 31 | + @RequestMapping(path = "findStationRoutes") | |
| 32 | + public List<LsStationRoute> findStationRoutes(@RequestParam(defaultValue = "id") Integer regionId) { | |
| 33 | + return lineRegionService.findStationRoutes(regionId); | |
| 34 | + } | |
| 35 | + | |
| 36 | + @RequestMapping(path = "add", method = RequestMethod.POST) | |
| 37 | + public Map<String, Object> add(LineRegion lineRegion) { | |
| 38 | + Map<String, Object> result = new HashMap<>(); | |
| 39 | + try { | |
| 40 | + lineRegionService.add(lineRegion); | |
| 41 | + result.put("status", ResponseCode.SUCCESS); | |
| 42 | + } catch (Exception e) { | |
| 43 | + log.error("添加线路区间异常", e); | |
| 44 | + result.put("status", ResponseCode.ERROR); | |
| 45 | + } | |
| 46 | + | |
| 47 | + return result; | |
| 48 | + } | |
| 49 | + | |
| 50 | + @RequestMapping(path = "modify", method = RequestMethod.POST) | |
| 51 | + public Map<String, Object> modify(LineRegion lineRegion) { | |
| 52 | + Map<String, Object> result = new HashMap<>(); | |
| 53 | + try { | |
| 54 | + lineRegionService.save(lineRegion); | |
| 55 | + result.put("status", ResponseCode.SUCCESS); | |
| 56 | + } catch (Exception e) { | |
| 57 | + log.error("变更线路区间异常", e); | |
| 58 | + result.put("status", ResponseCode.ERROR); | |
| 59 | + } | |
| 60 | + | |
| 61 | + return result; | |
| 62 | + } | |
| 63 | +} | ... | ... |
src/main/java/com/bsth/controller/LsSectionRouteController.java
| ... | ... | @@ -44,6 +44,16 @@ public class LsSectionRouteController extends BaseController<LsSectionRoute, Int |
| 44 | 44 | @Autowired |
| 45 | 45 | private LsSectionRouteService lsSectionRouteService; |
| 46 | 46 | |
| 47 | + @RequestMapping(value = "/findSectionRoutes" , method = RequestMethod.GET) | |
| 48 | + public List<LsSectionRoute> findSectionRoutes(@RequestParam Map<String, Object> map) { | |
| 49 | + map.put("destroy_eq", 0); | |
| 50 | + if (map.get("line.id_eq") == null || map.get("versions_eq") == null) { | |
| 51 | + throw new IllegalArgumentException("需正确传入线路、版本参数"); | |
| 52 | + } | |
| 53 | + | |
| 54 | + return lsSectionRouteService.findSectionRoutes(map); | |
| 55 | + } | |
| 56 | + | |
| 47 | 57 | @RequestMapping(value = "/findPageByParams", method = RequestMethod.GET) |
| 48 | 58 | public Page<LsSectionRoute> findPageByParams(@RequestParam Map<String, Object> params) { |
| 49 | 59 | int page = params.get("page") == null ? 0 : Integer.parseInt(params.get("page").toString()); |
| ... | ... | @@ -92,6 +102,26 @@ public class LsSectionRouteController extends BaseController<LsSectionRoute, Int |
| 92 | 102 | } |
| 93 | 103 | |
| 94 | 104 | /** |
| 105 | + * @param ids | |
| 106 | + * @throws | |
| 107 | + * @Description: TODO(批量恢复撤销站点) | |
| 108 | + */ | |
| 109 | + @RequestMapping(value = "/batchRecover", method = RequestMethod.POST) | |
| 110 | + public Map<String, Object> batchRecover(@RequestParam(value = "ids[]") List<Integer> ids) { | |
| 111 | + Map<String, Object> result = new HashMap<>(); | |
| 112 | + try { | |
| 113 | + lsSectionRouteService.batchRecover(ids); | |
| 114 | + result.put("status", ResponseCode.SUCCESS); | |
| 115 | + } catch (Exception e) { | |
| 116 | + result.put("status", ResponseCode.ERROR); | |
| 117 | + result.put("msg", e.getMessage()); | |
| 118 | + log.error("", e); | |
| 119 | + } | |
| 120 | + | |
| 121 | + return result; | |
| 122 | + } | |
| 123 | + | |
| 124 | + /** | |
| 95 | 125 | * @param lineId |
| 96 | 126 | * @param version |
| 97 | 127 | * @param direction | ... | ... |
src/main/java/com/bsth/controller/LsStationRouteController.java
| ... | ... | @@ -42,6 +42,26 @@ public class LsStationRouteController extends BaseController<LsStationRoute, Int |
| 42 | 42 | return super.list(params, page, size, order, direction); |
| 43 | 43 | } |
| 44 | 44 | |
| 45 | + @RequestMapping(value = "/findRoutes" , method = RequestMethod.GET) | |
| 46 | + public Map<String, Object> findRoutes(@RequestParam Map<String, Object> map) { | |
| 47 | + map.put("destroy_eq", 0); | |
| 48 | + if (map.get("line.id_eq") == null || map.get("versions_eq") == null) { | |
| 49 | + throw new IllegalArgumentException("需正确传入线路、版本参数"); | |
| 50 | + } | |
| 51 | + | |
| 52 | + return lsStationRouteService.findRoutes(map); | |
| 53 | + } | |
| 54 | + | |
| 55 | + @RequestMapping(value = "/findStationRoutes" , method = RequestMethod.GET) | |
| 56 | + public List<LsStationRoute> findStationRoutes(@RequestParam Map<String, Object> map) { | |
| 57 | + map.put("destroy_eq", 0); | |
| 58 | + if (map.get("line.id_eq") == null || map.get("versions_eq") == null) { | |
| 59 | + throw new IllegalArgumentException("需正确传入线路、版本参数"); | |
| 60 | + } | |
| 61 | + | |
| 62 | + return lsStationRouteService.findStationRoutes(map); | |
| 63 | + } | |
| 64 | + | |
| 45 | 65 | /** |
| 46 | 66 | * @Description :TODO(查询站点的下一个缓存站点) |
| 47 | 67 | */ |
| ... | ... | @@ -91,6 +111,26 @@ public class LsStationRouteController extends BaseController<LsStationRoute, Int |
| 91 | 111 | } |
| 92 | 112 | |
| 93 | 113 | /** |
| 114 | + * @param ids | |
| 115 | + * @throws | |
| 116 | + * @Description: TODO(批量恢复撤销站点) | |
| 117 | + */ | |
| 118 | + @RequestMapping(value = "/batchRecover", method = RequestMethod.POST) | |
| 119 | + public Map<String, Object> batchRecover(@RequestParam(value = "ids[]") List<Integer> ids) { | |
| 120 | + Map<String, Object> result = new HashMap<>(); | |
| 121 | + try { | |
| 122 | + lsStationRouteService.batchRecover(ids); | |
| 123 | + result.put("status", ResponseCode.SUCCESS); | |
| 124 | + } catch (Exception e) { | |
| 125 | + result.put("status", ResponseCode.ERROR); | |
| 126 | + result.put("msg", e.getMessage()); | |
| 127 | + log.error("", e); | |
| 128 | + } | |
| 129 | + | |
| 130 | + return result; | |
| 131 | + } | |
| 132 | + | |
| 133 | + /** | |
| 94 | 134 | * 保存线路某个版本下单行的站点和路段路由 |
| 95 | 135 | * 常规使用在根据百度地图生成数据或者模板导入的批量保存 |
| 96 | 136 | * @param map | ... | ... |
src/main/java/com/bsth/controller/StationRouteController.java
| ... | ... | @@ -55,23 +55,6 @@ public class StationRouteController extends BaseController<StationRoute, Integer |
| 55 | 55 | public Map<String, Object> export(@RequestParam Integer id, HttpServletResponse resp) { |
| 56 | 56 | return stationRouteService.getSectionRouteExport(id, resp); |
| 57 | 57 | } |
| 58 | - | |
| 59 | - /** | |
| 60 | - * @Description :TODO(查询树站点与路段数据) | |
| 61 | - * | |
| 62 | - * @param map <line.id_eq:线路ID; directions_eq:方向> | |
| 63 | - * | |
| 64 | - * @return List<Map<String, Object>> | |
| 65 | - */ | |
| 66 | - @RequestMapping(value = "/findStations" , method = RequestMethod.GET) | |
| 67 | - public Map<String, Object> findStations(@RequestParam Map<String, Object> map) { | |
| 68 | - map.put("destroy_eq", 0); | |
| 69 | - if (map.get("line.id_eq") == null || map.get("directions_eq") == null || map.get("versions_eq") == null) { | |
| 70 | - throw new IllegalArgumentException("需正确传入线路、方向、版本参数"); | |
| 71 | - } | |
| 72 | - | |
| 73 | - return stationRouteService.findPoints(map); | |
| 74 | - } | |
| 75 | 58 | |
| 76 | 59 | @RequestMapping(value = "/systemQuote" , method = RequestMethod.POST) |
| 77 | 60 | public Map<String, Object> systemQuote(@RequestParam Map<String, Object> map) { | ... | ... |
src/main/java/com/bsth/controller/test/GpsTestController.java
src/main/java/com/bsth/entity/LineRegion.java
0 → 100644
| 1 | +package com.bsth.entity; | |
| 2 | + | |
| 3 | +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; | |
| 4 | + | |
| 5 | +import javax.persistence.*; | |
| 6 | +import java.util.List; | |
| 7 | +import java.util.Set; | |
| 8 | + | |
| 9 | +@Entity | |
| 10 | +@Table(name = "bsth_c_line_region") | |
| 11 | +@JsonIgnoreProperties(value={"hibernateLazyInitializer","handler","fieldHandler"}) | |
| 12 | +public class LineRegion { | |
| 13 | + | |
| 14 | + @Id | |
| 15 | + @GeneratedValue(strategy = GenerationType.IDENTITY) | |
| 16 | + private Integer id; | |
| 17 | + | |
| 18 | + private Integer line; | |
| 19 | + | |
| 20 | + private Integer version; | |
| 21 | + | |
| 22 | + private Integer direction; | |
| 23 | + | |
| 24 | + private String regionAlias; | |
| 25 | + | |
| 26 | + private Integer seq; | |
| 27 | + | |
| 28 | + @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY) | |
| 29 | + @JoinTable(name = "bsth_c_line_region_stationroute", | |
| 30 | + joinColumns = @JoinColumn(name = "region_id"), | |
| 31 | + inverseJoinColumns = @JoinColumn(name = "station_route_id")) | |
| 32 | + private List<LsStationRoute> stationRoutes; | |
| 33 | + | |
| 34 | + public Integer getId() { | |
| 35 | + return id; | |
| 36 | + } | |
| 37 | + | |
| 38 | + public void setId(Integer id) { | |
| 39 | + this.id = id; | |
| 40 | + } | |
| 41 | + | |
| 42 | + public Integer getLine() { | |
| 43 | + return line; | |
| 44 | + } | |
| 45 | + | |
| 46 | + public void setLine(Integer line) { | |
| 47 | + this.line = line; | |
| 48 | + } | |
| 49 | + | |
| 50 | + public Integer getVersion() { | |
| 51 | + return version; | |
| 52 | + } | |
| 53 | + | |
| 54 | + public void setVersion(Integer version) { | |
| 55 | + this.version = version; | |
| 56 | + } | |
| 57 | + | |
| 58 | + public Integer getDirection() { | |
| 59 | + return direction; | |
| 60 | + } | |
| 61 | + | |
| 62 | + public void setDirection(Integer direction) { | |
| 63 | + this.direction = direction; | |
| 64 | + } | |
| 65 | + | |
| 66 | + public String getRegionAlias() { | |
| 67 | + return regionAlias; | |
| 68 | + } | |
| 69 | + | |
| 70 | + public void setRegionAlias(String regionAlias) { | |
| 71 | + this.regionAlias = regionAlias; | |
| 72 | + } | |
| 73 | + | |
| 74 | + public Integer getSeq() { | |
| 75 | + return seq; | |
| 76 | + } | |
| 77 | + | |
| 78 | + public void setSeq(Integer seq) { | |
| 79 | + this.seq = seq; | |
| 80 | + } | |
| 81 | + | |
| 82 | + public List<LsStationRoute> getStationRoutes() { | |
| 83 | + return stationRoutes; | |
| 84 | + } | |
| 85 | + | |
| 86 | + public void setStationRoutes(List<LsStationRoute> stationRoutes) { | |
| 87 | + this.stationRoutes = stationRoutes; | |
| 88 | + } | |
| 89 | +} | ... | ... |
src/main/java/com/bsth/repository/LineRegionRepository.java
0 → 100644
| 1 | +package com.bsth.repository; | |
| 2 | + | |
| 3 | +import com.bsth.entity.LineRegion; | |
| 4 | +import com.bsth.entity.LsStationRoute; | |
| 5 | +import org.springframework.data.jpa.repository.Query; | |
| 6 | +import org.springframework.stereotype.Repository; | |
| 7 | + | |
| 8 | +import java.util.List; | |
| 9 | + | |
| 10 | +/** | |
| 11 | + * @Author Hill | |
| 12 | + */ | |
| 13 | +@Repository | |
| 14 | +public interface LineRegionRepository extends BaseRepository<LineRegion, Integer> { | |
| 15 | + | |
| 16 | + /** | |
| 17 | + * 获取线路区间的站点路由 | |
| 18 | + * @param regionId | |
| 19 | + * @return | |
| 20 | + */ | |
| 21 | + @Query(value = "SELECT b.* FROM bsth_c_line_region_stationroute a LEFT JOIN bsth_c_ls_stationroute b ON a.station_route_id = b.id WHERE a.region_id = ?1", nativeQuery = true) | |
| 22 | + List<LsStationRoute> findStationRoutes(Integer regionId); | |
| 23 | + | |
| 24 | + /** | |
| 25 | + * 获取线路版本最大线路区间序号 | |
| 26 | + * @param lineId | |
| 27 | + * @param version | |
| 28 | + * @return | |
| 29 | + */ | |
| 30 | + @Query(value = "SELECT IFNULL(MAX(seq), 0) FROM bsth_c_line_region lr where lr.line = ?1 and lr.version = ?2", nativeQuery = true) | |
| 31 | + Integer getLatestSeq(Integer lineId, Integer version); | |
| 32 | +} | ... | ... |
src/main/java/com/bsth/repository/LsSectionRouteRepository.java
| ... | ... | @@ -35,6 +35,14 @@ public interface LsSectionRouteRepository extends BaseRepository<LsSectionRoute, |
| 35 | 35 | @Modifying |
| 36 | 36 | @Query(value = "UPDATE LsSectionRoute lsr set lsr.destroy = 1 where lsr.id in (?1)") |
| 37 | 37 | void batchDestroy(List<Integer> ids); |
| 38 | + | |
| 39 | + /** | |
| 40 | + * 批量恢复撤销站点路由 | |
| 41 | + * @param ids | |
| 42 | + */ | |
| 43 | + @Modifying | |
| 44 | + @Query(value = "UPDATE LsSectionRoute lsr set lsr.destroy = 0 where lsr.id in (?1)") | |
| 45 | + void batchRecover(List<Integer> ids); | |
| 38 | 46 | |
| 39 | 47 | @Query(value ="SELECT a.sectionrouteId," + |
| 40 | 48 | "a.sectionrouteLine," + | ... | ... |
src/main/java/com/bsth/repository/LsStationRouteRepository.java
| ... | ... | @@ -37,6 +37,14 @@ public interface LsStationRouteRepository extends BaseRepository<LsStationRoute, |
| 37 | 37 | void batchDestroy(List<Integer> ids); |
| 38 | 38 | |
| 39 | 39 | /** |
| 40 | + * 批量恢复撤销站点路由 | |
| 41 | + * @param ids | |
| 42 | + */ | |
| 43 | + @Modifying | |
| 44 | + @Query(value = "UPDATE LsStationRoute lsr set lsr.destroy = 0 where lsr.id in (?1)") | |
| 45 | + void batchRecover(List<Integer> ids); | |
| 46 | + | |
| 47 | + /** | |
| 40 | 48 | * 查询待更新线路的站点路由 |
| 41 | 49 | */ |
| 42 | 50 | @EntityGraph(value = "ls_stationRoute_station", type = EntityGraph.EntityGraphType.FETCH) | ... | ... |
src/main/java/com/bsth/repository/SectionRouteRepository.java
| ... | ... | @@ -112,7 +112,7 @@ public interface SectionRouteRepository extends BaseRepository<SectionRoute, Int |
| 112 | 112 | */ |
| 113 | 113 | @Modifying |
| 114 | 114 | @Query(value="delete from SectionRoute sr where sr.line.id = ?1") |
| 115 | - void deleteByLineAndVersion(Integer lineId); | |
| 115 | + void deleteByLine(Integer lineId); | |
| 116 | 116 | |
| 117 | 117 | /** |
| 118 | 118 | * 历史路由表变更之后从历史表批量更新当前版本至当前表 | ... | ... |
src/main/java/com/bsth/repository/StationRouteRepository.java
| ... | ... | @@ -214,7 +214,7 @@ public interface StationRouteRepository extends BaseRepository<StationRoute, Int |
| 214 | 214 | */ |
| 215 | 215 | @Modifying |
| 216 | 216 | @Query(value="delete from StationRoute sr where sr.line.id = ?1") |
| 217 | - void deleteByLineAndVersion(Integer lineId); | |
| 217 | + void deleteByLine(Integer lineId); | |
| 218 | 218 | |
| 219 | 219 | /** |
| 220 | 220 | * 历史路由表变更之后从历史表批量更新当前版本至当前表 | ... | ... |
src/main/java/com/bsth/service/LineRegionService.java
0 → 100644
| 1 | +package com.bsth.service; | |
| 2 | + | |
| 3 | +import com.bsth.entity.LineRegion; | |
| 4 | +import com.bsth.entity.LsStationRoute; | |
| 5 | + | |
| 6 | +import java.util.List; | |
| 7 | +import java.util.Map; | |
| 8 | + | |
| 9 | +/** | |
| 10 | + * @Author Hill | |
| 11 | + */ | |
| 12 | +public interface LineRegionService extends BaseService<LineRegion, Integer> { | |
| 13 | + | |
| 14 | + /** | |
| 15 | + * 获取线路区间的站点路由 | |
| 16 | + * @param regionId | |
| 17 | + * @return | |
| 18 | + */ | |
| 19 | + List<LsStationRoute> findStationRoutes(Integer regionId); | |
| 20 | + | |
| 21 | + /** | |
| 22 | + * 添加线路区间 | |
| 23 | + * @param lineRegion | |
| 24 | + * @return | |
| 25 | + */ | |
| 26 | + Map<String, Object> add(LineRegion lineRegion); | |
| 27 | +} | ... | ... |
src/main/java/com/bsth/service/LsSectionRouteService.java
| ... | ... | @@ -11,12 +11,25 @@ import java.util.Map; |
| 11 | 11 | public interface LsSectionRouteService extends BaseService<LsSectionRoute, Integer> { |
| 12 | 12 | |
| 13 | 13 | /** |
| 14 | + * 获取历史路段路由 | |
| 15 | + * @param map | |
| 16 | + * @return | |
| 17 | + */ | |
| 18 | + List<LsSectionRoute> findSectionRoutes(Map<String, Object> map); | |
| 19 | + | |
| 20 | + /** | |
| 14 | 21 | * 批量撤销路段路由 |
| 15 | 22 | * @param ids |
| 16 | 23 | */ |
| 17 | 24 | void batchDestroy(List<Integer> ids); |
| 18 | 25 | |
| 19 | 26 | /** |
| 27 | + * 批量恢复撤销的站点路由 | |
| 28 | + * @param ids | |
| 29 | + */ | |
| 30 | + void batchRecover(List<Integer> ids); | |
| 31 | + | |
| 32 | + /** | |
| 20 | 33 | * 引用另一上下行路段 |
| 21 | 34 | * @param lineId |
| 22 | 35 | * @param version | ... | ... |
src/main/java/com/bsth/service/LsStationRouteService.java
| ... | ... | @@ -19,6 +19,20 @@ public interface LsStationRouteService extends BaseService<LsStationRoute, Integ |
| 19 | 19 | Iterable<LsStationRoute> findAllByParams(Map<String, Object> map); |
| 20 | 20 | |
| 21 | 21 | /** |
| 22 | + * 获取历史站点和路段路由 | |
| 23 | + * @param map | |
| 24 | + * @return | |
| 25 | + */ | |
| 26 | + Map<String, Object> findRoutes(Map<String, Object> map); | |
| 27 | + | |
| 28 | + /** | |
| 29 | + * 获取历史站点路由 | |
| 30 | + * @param map | |
| 31 | + * @return | |
| 32 | + */ | |
| 33 | + List<LsStationRoute> findStationRoutes(Map<String, Object> map); | |
| 34 | + | |
| 35 | + /** | |
| 22 | 36 | * 获取当前站点以及下一站点路由 |
| 23 | 37 | * @param id |
| 24 | 38 | * @return |
| ... | ... | @@ -32,6 +46,12 @@ public interface LsStationRouteService extends BaseService<LsStationRoute, Integ |
| 32 | 46 | void batchDestroy(List<Integer> ids); |
| 33 | 47 | |
| 34 | 48 | /** |
| 49 | + * 批量恢复撤销的站点路由 | |
| 50 | + * @param ids | |
| 51 | + */ | |
| 52 | + void batchRecover(List<Integer> ids); | |
| 53 | + | |
| 54 | + /** | |
| 35 | 55 | * 保存线路某个版本下单行的站点和路段路由 |
| 36 | 56 | * 常规使用在根据百度地图生成数据或者模板导入的批量保存 |
| 37 | 57 | * @param lineId | ... | ... |
src/main/java/com/bsth/service/StationRouteService.java
| ... | ... | @@ -40,7 +40,7 @@ public interface StationRouteService extends BaseService<StationRoute, Integer> |
| 40 | 40 | * |
| 41 | 41 | * @return List<Map<String, Object>> |
| 42 | 42 | */ |
| 43 | - Map<String, Object> findPoints(Map<String, Object> map); | |
| 43 | + Map<String, Object> findRoutes(Map<String, Object> map); | |
| 44 | 44 | |
| 45 | 45 | Map<String, Object> systemQuote(Map<String, Object> map); |
| 46 | 46 | ... | ... |
src/main/java/com/bsth/service/impl/LineRegionServiceImpl.java
0 → 100644
| 1 | +package com.bsth.service.impl; | |
| 2 | + | |
| 3 | +import com.bsth.entity.LineRegion; | |
| 4 | +import com.bsth.entity.LsStationRoute; | |
| 5 | +import com.bsth.repository.LineRegionRepository; | |
| 6 | +import com.bsth.service.LineRegionService; | |
| 7 | +import org.springframework.beans.factory.annotation.Autowired; | |
| 8 | +import org.springframework.stereotype.Service; | |
| 9 | +import org.springframework.transaction.annotation.Transactional; | |
| 10 | + | |
| 11 | +import java.util.Collections; | |
| 12 | +import java.util.List; | |
| 13 | +import java.util.Map; | |
| 14 | + | |
| 15 | +/** | |
| 16 | + * @Author Hill | |
| 17 | + */ | |
| 18 | +@Service | |
| 19 | +public class LineRegionServiceImpl extends BaseServiceImpl<LineRegion, Integer> implements LineRegionService { | |
| 20 | + | |
| 21 | + @Autowired | |
| 22 | + private LineRegionRepository lineRegionRepository; | |
| 23 | + | |
| 24 | + @Override | |
| 25 | + public List<LsStationRoute> findStationRoutes(Integer regionId) { | |
| 26 | + return lineRegionRepository.findStationRoutes(regionId); | |
| 27 | + } | |
| 28 | + | |
| 29 | + @Transactional | |
| 30 | + @Override | |
| 31 | + public Map<String, Object> add(LineRegion lineRegion) { | |
| 32 | + Integer seq = lineRegionRepository.getLatestSeq(lineRegion.getLine(), lineRegion.getVersion()) + 1; | |
| 33 | + lineRegion.setSeq(seq); | |
| 34 | + lineRegionRepository.save(lineRegion); | |
| 35 | + | |
| 36 | + return Collections.emptyMap(); | |
| 37 | + } | |
| 38 | +} | ... | ... |
src/main/java/com/bsth/service/impl/LineVersionsServiceImpl.java
| ... | ... | @@ -52,8 +52,7 @@ public class LineVersionsServiceImpl extends BaseServiceImpl<LineVersions, Integ |
| 52 | 52 | |
| 53 | 53 | @Autowired |
| 54 | 54 | SectionRepository sectionRepository; |
| 55 | - | |
| 56 | - | |
| 55 | + | |
| 57 | 56 | @Autowired |
| 58 | 57 | com.bsth.repository.SectionRouteRepository sectionRouteRepository ; |
| 59 | 58 | |
| ... | ... | @@ -123,9 +122,9 @@ public class LineVersionsServiceImpl extends BaseServiceImpl<LineVersions, Integ |
| 123 | 122 | String lineCode = lineVersions.getLineCode(); |
| 124 | 123 | Integer versions = lineVersions.getVersions(); |
| 125 | 124 | |
| 126 | - stationRouteRepository.deleteByLineAndVersion(lineId); | |
| 125 | + stationRouteRepository.deleteByLine(lineId); | |
| 127 | 126 | stationRouteRepository.updateFromHistory(lineId, versions); |
| 128 | - sectionRouteRepository.deleteByLineAndVersion(lineId); | |
| 127 | + sectionRouteRepository.deleteByLine(lineId); | |
| 129 | 128 | sectionRouteRepository.updateFromHistory(lineId, versions); |
| 130 | 129 | // 更新线路版本 |
| 131 | 130 | repository.updateOdlVersions(lineId, lineCode); | ... | ... |
src/main/java/com/bsth/service/impl/LsSectionRouteServiceImpl.java
| 1 | 1 | package com.bsth.service.impl; |
| 2 | 2 | |
| 3 | 3 | import com.bsth.entity.*; |
| 4 | +import com.bsth.entity.search.CustomerSpecs; | |
| 4 | 5 | import com.bsth.repository.*; |
| 5 | 6 | import com.bsth.service.LsSectionRouteService; |
| 6 | 7 | import com.bsth.util.CoordinateConverter; |
| ... | ... | @@ -10,6 +11,7 @@ import org.geolatte.geom.Point; |
| 10 | 11 | import org.geolatte.geom.Polygon; |
| 11 | 12 | import org.geolatte.geom.codec.Wkt; |
| 12 | 13 | import org.springframework.beans.factory.annotation.Autowired; |
| 14 | +import org.springframework.data.domain.Sort; | |
| 13 | 15 | import org.springframework.stereotype.Service; |
| 14 | 16 | import org.springframework.transaction.annotation.Transactional; |
| 15 | 17 | |
| ... | ... | @@ -39,6 +41,15 @@ public class LsSectionRouteServiceImpl extends BaseServiceImpl<LsSectionRoute, I |
| 39 | 41 | private SectionRepository sectionRepository; |
| 40 | 42 | |
| 41 | 43 | /** |
| 44 | + * 获取历史路段路由 | |
| 45 | + * @param map | |
| 46 | + * @return | |
| 47 | + */ | |
| 48 | + public List<LsSectionRoute> findSectionRoutes(Map<String, Object> map) { | |
| 49 | + return lsSectionRouteRepository.findAll(new CustomerSpecs<>(map), Sort.by(Sort.Direction.ASC, "directions", "sectionrouteCode")); | |
| 50 | + } | |
| 51 | + | |
| 52 | + /** | |
| 42 | 53 | * 批量撤销路段路由 |
| 43 | 54 | * @param ids |
| 44 | 55 | */ |
| ... | ... | @@ -56,6 +67,24 @@ public class LsSectionRouteServiceImpl extends BaseServiceImpl<LsSectionRoute, I |
| 56 | 67 | } |
| 57 | 68 | } |
| 58 | 69 | |
| 70 | + /** | |
| 71 | + * 批量恢复撤销路段路由 | |
| 72 | + * @param ids | |
| 73 | + */ | |
| 74 | + @Override | |
| 75 | + @Transactional(rollbackFor = RuntimeException.class) | |
| 76 | + public void batchRecover(List<Integer> ids) { | |
| 77 | + LsSectionRoute lsSectionRoute = lsSectionRouteRepository.findById(ids.get(0)).get(); | |
| 78 | + Integer currentVersion = lineVersionsRepository.findCurrentVersion(lsSectionRoute.getLine().getId()); | |
| 79 | + if (lsSectionRoute.getVersions() < currentVersion) { | |
| 80 | + throw new IllegalArgumentException("历史版本不可变更"); | |
| 81 | + } | |
| 82 | + lsSectionRouteRepository.batchRecover(ids); | |
| 83 | + if (lsSectionRoute.getVersions().equals(currentVersion)) { | |
| 84 | + refreshCurrent(lsSectionRoute.getLine().getId(), currentVersion); | |
| 85 | + } | |
| 86 | + } | |
| 87 | + | |
| 59 | 88 | @Override |
| 60 | 89 | @Transactional(rollbackFor = RuntimeException.class) |
| 61 | 90 | public Map<String, Object> quoteOtherSide(int lineId, int version, int direction, int otherDirection) { |
| ... | ... | @@ -116,7 +145,7 @@ public class LsSectionRouteServiceImpl extends BaseServiceImpl<LsSectionRoute, I |
| 116 | 145 | } |
| 117 | 146 | |
| 118 | 147 | protected void refreshCurrent(int lineId, int version) { |
| 119 | - sectionRouteRepository.deleteByLineAndVersion(lineId); | |
| 148 | + sectionRouteRepository.deleteByLine(lineId); | |
| 120 | 149 | sectionRouteRepository.updateFromHistory(lineId, version); |
| 121 | 150 | } |
| 122 | 151 | } |
| 123 | 152 | \ No newline at end of file | ... | ... |
src/main/java/com/bsth/service/impl/LsStationRouteServiceImpl.java
| ... | ... | @@ -72,6 +72,32 @@ public class LsStationRouteServiceImpl extends BaseServiceImpl<LsStationRoute, I |
| 72 | 72 | } |
| 73 | 73 | |
| 74 | 74 | /** |
| 75 | + * 获取历史站点和路段路由 | |
| 76 | + * @param map | |
| 77 | + * @return | |
| 78 | + */ | |
| 79 | + @Override | |
| 80 | + public Map<String, Object> findRoutes(Map<String, Object> map) { | |
| 81 | + Map<String, Object> result = new HashMap<>(); | |
| 82 | + List<LsStationRoute> stationList = lsStationRouteRepository.findAll(new CustomerSpecs<>(map), Sort.by(Sort.Direction.ASC, "directions", "stationRouteCode")); | |
| 83 | + List<LsSectionRoute> sectionList = lsSectionRouteRepository.findAll(new CustomerSpecs<>(map), Sort.by(Sort.Direction.ASC, "directions", "sectionrouteCode")); | |
| 84 | + | |
| 85 | + result.put("stationRoutes", stationList); | |
| 86 | + result.put("sectionRoutes", sectionList); | |
| 87 | + | |
| 88 | + return result; | |
| 89 | + } | |
| 90 | + | |
| 91 | + /** | |
| 92 | + * 获取历史站点路由 | |
| 93 | + * @param map | |
| 94 | + * @return | |
| 95 | + */ | |
| 96 | + public List<LsStationRoute> findStationRoutes(Map<String, Object> map) { | |
| 97 | + return lsStationRouteRepository.findAll(new CustomerSpecs<>(map), Sort.by(Sort.Direction.ASC, "directions", "stationRouteCode")); | |
| 98 | + } | |
| 99 | + | |
| 100 | + /** | |
| 75 | 101 | * 获取当前站点以及下一站点路由 |
| 76 | 102 | * @param id |
| 77 | 103 | * @return |
| ... | ... | @@ -123,6 +149,31 @@ public class LsStationRouteServiceImpl extends BaseServiceImpl<LsStationRoute, I |
| 123 | 149 | } |
| 124 | 150 | } |
| 125 | 151 | |
| 152 | + /** | |
| 153 | + * 批量恢复撤销站点路由 | |
| 154 | + * @param ids | |
| 155 | + */ | |
| 156 | + @BusinessDescription(value = "批量恢复撤销站点路由") | |
| 157 | + @Transactional(rollbackFor = RuntimeException.class) | |
| 158 | + @Override | |
| 159 | + public void batchRecover(List<Integer> ids) { | |
| 160 | + if (ids.size() > 0) { | |
| 161 | + Integer id = ids.get(0); | |
| 162 | + LsStationRoute stationRoute = lsStationRouteRepository.findById(id).get(); | |
| 163 | + Integer lineId = stationRoute.getLine().getId(); | |
| 164 | + Integer currentVersion = lineVersionsRepository.findCurrentVersion(lineId); | |
| 165 | + if (stationRoute.getVersions() < currentVersion) { | |
| 166 | + throw new IllegalArgumentException("历史版本不可变更"); | |
| 167 | + } | |
| 168 | + | |
| 169 | + lsStationRouteRepository.batchRecover(ids); | |
| 170 | + remark(stationRoute); | |
| 171 | + if (stationRoute.getVersions().equals(currentVersion)) { | |
| 172 | + refreshCurrent(lineId, currentVersion); | |
| 173 | + } | |
| 174 | + } | |
| 175 | + } | |
| 176 | + | |
| 126 | 177 | @Transactional |
| 127 | 178 | @Override |
| 128 | 179 | public Map<String, Object> addRoutes(Integer lineId, Integer versions, Integer directions, List<LsStationRoute> stationRoutes, List<LsSectionRoute> sectionRoutes) { |
| ... | ... | @@ -372,7 +423,7 @@ public class LsStationRouteServiceImpl extends BaseServiceImpl<LsStationRoute, I |
| 372 | 423 | } |
| 373 | 424 | |
| 374 | 425 | protected void refreshCurrent(int lineId, int version) { |
| 375 | - stationRouteRepository.deleteByLineAndVersion(lineId); | |
| 426 | + stationRouteRepository.deleteByLine(lineId); | |
| 376 | 427 | stationRouteRepository.updateFromHistory(lineId, version); |
| 377 | 428 | } |
| 378 | 429 | } | ... | ... |
src/main/java/com/bsth/service/impl/StationRouteServiceImpl.java
| ... | ... | @@ -136,10 +136,10 @@ public class StationRouteServiceImpl extends BaseServiceImpl<StationRoute, Integ |
| 136 | 136 | * @return List<Map<String, Object>> |
| 137 | 137 | */ |
| 138 | 138 | @Override |
| 139 | - public Map<String, Object> findPoints(Map<String, Object> map) { | |
| 139 | + public Map<String, Object> findRoutes(Map<String, Object> map) { | |
| 140 | 140 | Map<String, Object> result = new HashMap<>(); |
| 141 | - List<LsStationRoute> stationList = lsStationRouteRepository.findAll(new CustomerSpecs<>(map), Sort.by(Direction.ASC, "stationRouteCode")); | |
| 142 | - List<LsSectionRoute> sectionList = lsSectionRouteRepository.findAll(new CustomerSpecs<>(map), Sort.by(Direction.ASC, "sectionrouteCode")); | |
| 141 | + List<StationRoute> stationList = stationRouteRepository.findAll(new CustomerSpecs<>(map), Sort.by(Direction.ASC, "directions", "stationRouteCode")); | |
| 142 | + List<SectionRoute> sectionList = sectionRouteRepository.findAll(new CustomerSpecs<>(map), Sort.by(Direction.ASC, "directions", "sectionrouteCode")); | |
| 143 | 143 | |
| 144 | 144 | result.put("stationRoutes", stationList); |
| 145 | 145 | result.put("sectionRoutes", sectionList); |
| ... | ... | @@ -147,230 +147,6 @@ public class StationRouteServiceImpl extends BaseServiceImpl<StationRoute, Integ |
| 147 | 147 | return result; |
| 148 | 148 | } |
| 149 | 149 | |
| 150 | - public List<Map<String, Object>> treeListMap(List<LsStationRoute> stationList,List<LsSectionRoute> sectionList) { | |
| 151 | - | |
| 152 | - List<Map<String, Object>> resultList= new ArrayList<Map<String, Object>>(); | |
| 153 | - | |
| 154 | - // 站点孩子节点 | |
| 155 | - List<Map<String, Object>> staitonChildren= new ArrayList<Map<String, Object>>(); | |
| 156 | - | |
| 157 | - if(stationList.size()>0) { | |
| 158 | - for(int i = 0 ; i < stationList.size(); i++) { | |
| 159 | - LsStationRoute stationRoute = stationList.get(i); | |
| 160 | - Map<String, Object> tempM = new HashMap<String, Object>(); | |
| 161 | - // 站点路由ID | |
| 162 | - tempM.put("stationRouteId", stationRoute.getId()); | |
| 163 | - // 站点路由线路ID | |
| 164 | - tempM.put("stationRouteLine", stationRoute.getLine().getId()); | |
| 165 | - // 站点路由站点ID | |
| 166 | - tempM.put("stationRouteStation", stationRoute.getStation().getId()); | |
| 167 | - // 站点路由名称 | |
| 168 | - tempM.put("stationRouteName", stationRoute.getStationName()); | |
| 169 | - // 站点路由站点序号 | |
| 170 | - tempM.put("stationRouteCode", stationRoute.getStationRouteCode()); | |
| 171 | - // 站点路由线路编码 | |
| 172 | - tempM.put("stationRouteLineCode", stationRoute.getLineCode()); | |
| 173 | - // 站点路由站点类型 | |
| 174 | - tempM.put("stationRouteStationMark", stationRoute.getStationMark()); | |
| 175 | - // 站点路由出站的序号 | |
| 176 | - tempM.put("stationRouteOutStationNmber", stationRoute.getOutStationNmber()); | |
| 177 | - // 站点路由站点方向 | |
| 178 | - tempM.put("stationRoutedirections", stationRoute.getDirections()); | |
| 179 | - // 站点路由站点到站距离 | |
| 180 | - tempM.put("stationRouteDistances", stationRoute.getDistances()); | |
| 181 | - // 站点路由到站时间 | |
| 182 | - tempM.put("stationRouteToTime", stationRoute.getToTime()); | |
| 183 | - // 站点路由站点首班时间 | |
| 184 | - tempM.put("stationRouteFirstTime", stationRoute.getFirstTime()); | |
| 185 | - // 站点路由站点末班时间 | |
| 186 | - tempM.put("stationRouteEndTime", stationRoute.getEndTime()); | |
| 187 | - // 站点路由站点说明 | |
| 188 | - tempM.put("stationRouteDescriptions", stationRoute.getDescriptions()); | |
| 189 | - // 站点路由版本 | |
| 190 | - tempM.put("stationRouteVersions", stationRoute.getVersions()); | |
| 191 | - // 站点ID | |
| 192 | - tempM.put("stationId", stationRoute.getStation().getId()); | |
| 193 | - // 站点编码 | |
| 194 | - tempM.put("stationCode", stationRoute.getStation().getStationCode()); | |
| 195 | - // 站点名称 | |
| 196 | - tempM.put("stationStationName", stationRoute.getStation().getStationName()); | |
| 197 | - // 路段编码 | |
| 198 | - tempM.put("stationRoadCoding", stationRoute.getStation().getRoadCoding()); | |
| 199 | - // 中心点(百度坐标) | |
| 200 | - tempM.put("stationJwpoints", stationRoute.getStation().getCenterPoint().toString()); | |
| 201 | - CoordinateConverter.Location location = CoordinateConverter.LocationMake(stationRoute.getStation().getCenterPointWgs().toString()); | |
| 202 | - // 中心点(WGS经度) | |
| 203 | - tempM.put("stationGLonx", location.getLng()); | |
| 204 | - // 中心点(WGS纬度) | |
| 205 | - tempM.put("stationGLaty", location.getLat()); | |
| 206 | - // 站点图形类型 | |
| 207 | - tempM.put("stationShapesType", stationRoute.getShapedType()); | |
| 208 | - // 站点圆半径 | |
| 209 | - tempM.put("stationRadius", stationRoute.getRadius()); | |
| 210 | - // 站点图形WGS坐标 | |
| 211 | - Polygon polygon = stationRoute.getBufferPolygon(), polygonWgs = stationRoute.getBufferPolygonWgs(); | |
| 212 | - tempM.put("stationGPolygonGrid", polygonWgs == null ? "" : polygonWgs.toString()); | |
| 213 | - // 站点图形百度坐标 | |
| 214 | - tempM.put("stationBPolygonGrid", polygon == null ? "" : polygon.toString()); | |
| 215 | - // 是否撤销 | |
| 216 | - tempM.put("stationDestroy", stationRoute.getStation().getDestroy()); | |
| 217 | - // 站点版本 | |
| 218 | - tempM.put("stationVersions", stationRoute.getStation().getVersions()); | |
| 219 | - // 站点说明 | |
| 220 | - tempM.put("stationDescriptions", stationRoute.getStation().getDescriptions()); | |
| 221 | - // 行业标准 | |
| 222 | - tempM.put("industryCode", stationRoute.getIndustryCode()); | |
| 223 | - tempM.put("stationNameEn", stationRoute.getStationNameEn()); | |
| 224 | - tempM.put("zdmc", stationRoute.getStationName()); | |
| 225 | - tempM.put("text", stationRoute.getStationName()); | |
| 226 | - tempM.put("icon", "fa fa-bus"); | |
| 227 | - tempM.put("pId", 200); | |
| 228 | - tempM.put("id", i+1); | |
| 229 | - tempM.put("groupType", "3"); | |
| 230 | - tempM.put("chaildredType", "station"); | |
| 231 | - tempM.put("enable", true); | |
| 232 | - staitonChildren.add(tempM); | |
| 233 | - } | |
| 234 | - } | |
| 235 | - | |
| 236 | - // 路段孩子节点 | |
| 237 | - List<Map<String, Object>> sectionChildren = new ArrayList<Map<String, Object>>(); | |
| 238 | - | |
| 239 | - if(sectionList.size()>0) { | |
| 240 | - for(int i = 0 ; i<sectionList.size() ; i++){ | |
| 241 | - LsSectionRoute sectionRoute = sectionList.get(i); | |
| 242 | - Map<String, Object> tempM = new HashMap<String, Object>(); | |
| 243 | - // 路段路由ID | |
| 244 | - tempM.put("sectionrouteId",sectionRoute.getId()); | |
| 245 | - // 路段路由线路ID | |
| 246 | - tempM.put("sectionrouteLine",sectionRoute.getLine().getId()); | |
| 247 | - // 路段路由线路编码 | |
| 248 | - tempM.put("sectionrouteLineCode",sectionRoute.getLineCode()); | |
| 249 | - // 路段路由路段ID | |
| 250 | - tempM.put("sectionrouteSection",sectionRoute.getSection().getId()); | |
| 251 | - // 路段路由路段编码 | |
| 252 | - tempM.put("sectionrouteSectionCode",sectionRoute.getSectionCode()); | |
| 253 | - tempM.put("sectionrouteCode",sectionRoute.getSectionrouteCode()); | |
| 254 | - tempM.put("sectionrouteDirections",sectionRoute.getDirections()); | |
| 255 | - // 路段ID | |
| 256 | - tempM.put("sectionId",sectionRoute.getSection().getId()); | |
| 257 | - // 路段编码 | |
| 258 | - tempM.put("sectionCode",sectionRoute.getSection().getSectionCode()); | |
| 259 | - // 路段名称 | |
| 260 | - tempM.put("sectionName",sectionRoute.getSection().getSectionName()); | |
| 261 | - // 道路编码 | |
| 262 | - tempM.put("sectionCrosesRoad",sectionRoute.getSection().getCrosesRoad()); | |
| 263 | - // 终点站 | |
| 264 | - tempM.put("sectionEndNode",sectionRoute.getSection().getEndNode()); | |
| 265 | - // 起始节点 | |
| 266 | - tempM.put("sectionStartNode",sectionRoute.getSection().getStartNode()); | |
| 267 | - // 中间节点 | |
| 268 | - tempM.put("sectionMiddleNode",sectionRoute.getSection().getMiddleNode()); | |
| 269 | - // 路段类型 | |
| 270 | - tempM.put("sectionType",sectionRoute.getSection().getSectionType()); | |
| 271 | - // 路段折线图形城建坐标 | |
| 272 | - tempM.put("sectionCsectionVector",sectionRoute.getSection().getCsectionVectorWkt()); | |
| 273 | - // 路段折线图形百度坐标 | |
| 274 | - tempM.put("sectionBsectionVector",sectionRoute.getSection().getBsectionVectorWkt()); | |
| 275 | - // 路段折线图形WGS坐标 | |
| 276 | - tempM.put("sectionGsectionVector",sectionRoute.getSection().getGsectionVectorWkt()); | |
| 277 | - // 道路编码 | |
| 278 | - tempM.put("sectionRoadCoding",sectionRoute.getSection().getRoadCoding()); | |
| 279 | - // 路段距离 | |
| 280 | - tempM.put("sectionDistance",sectionRoute.getSection().getSectionDistance()); | |
| 281 | - // 路段时间 | |
| 282 | - tempM.put("sectionTime",sectionRoute.getSection().getSectionTime()); | |
| 283 | - // 路段原坐标类型 | |
| 284 | - tempM.put("sectiondbType",sectionRoute.getSection().getDbType()); | |
| 285 | - // 限速 | |
| 286 | - tempM.put("sectionSpeedLimit",sectionRoute.getSection().getSpeedLimit()); | |
| 287 | - // 是否撤销 | |
| 288 | - tempM.put("destroy",sectionRoute.getDestroy()); | |
| 289 | - // 版本号 | |
| 290 | - tempM.put("versions",sectionRoute.getVersions()); | |
| 291 | - // 说明 | |
| 292 | - tempM.put("descriptions",sectionRoute.getDescriptions()); | |
| 293 | - // 说明 | |
| 294 | - tempM.put("isRoadeSpeed",sectionRoute.getIsRoadeSpeed()); | |
| 295 | - tempM.put("name", sectionRoute.getSection().getSectionName()); | |
| 296 | - tempM.put("text", sectionRoute.getSection().getSectionName()); | |
| 297 | - tempM.put("icon", null); | |
| 298 | - tempM.put("pId", 300); | |
| 299 | - tempM.put("id", (i+1)*1000); | |
| 300 | - tempM.put("groupType", "3"); | |
| 301 | - tempM.put("chaildredType", "section"); | |
| 302 | - tempM.put("enable", true); | |
| 303 | - sectionChildren.add(tempM); | |
| 304 | - } | |
| 305 | - } else { | |
| 306 | - if(stationList.size()>0) { | |
| 307 | - Map<String, Object> tempM = new HashMap<String, Object>(); | |
| 308 | - tempM.put("name", "添加路段"); | |
| 309 | - tempM.put("text", "添加路段"); | |
| 310 | - tempM.put("lineId", stationList.get(0).getLine().getId()); | |
| 311 | - tempM.put("lineCode", stationList.get(0).getLine().getLineCode()); | |
| 312 | - tempM.put("dir", stationList.get(0).getDirections()); | |
| 313 | - tempM.put("versions", stationList.get(0).getVersions()); | |
| 314 | - tempM.put("icon", null); | |
| 315 | - tempM.put("pId", 300); | |
| 316 | - tempM.put("id", 1000); | |
| 317 | - tempM.put("groupType", "3"); | |
| 318 | - tempM.put("chaildredType", "addSection"); | |
| 319 | - tempM.put("sectionBsectionVector", sectionList.size() > 0 ? sectionList.get(0).getSection().getBsectionVector() : ""); | |
| 320 | - tempM.put("enable", true); | |
| 321 | - sectionChildren.add(tempM); | |
| 322 | - } | |
| 323 | - } | |
| 324 | - | |
| 325 | - // 站点与路段孩子节点 | |
| 326 | - List<Map<String, Object>> childrenTwo = new ArrayList<Map<String, Object>>(); | |
| 327 | - | |
| 328 | - // 站点节点 | |
| 329 | - Map<String, Object> childrenStationMap = new HashMap<String, Object>(); | |
| 330 | - childrenStationMap.put("children", staitonChildren); | |
| 331 | - childrenStationMap.put("container", "pjax-container"); | |
| 332 | - childrenStationMap.put("enable", true); | |
| 333 | - childrenStationMap.put("groupType", "2"); | |
| 334 | - childrenStationMap.put("chaildredType", null); | |
| 335 | - | |
| 336 | - childrenStationMap.put("icon", null); | |
| 337 | - childrenStationMap.put("id", 200); | |
| 338 | - childrenStationMap.put("name", "站点"); | |
| 339 | - childrenStationMap.put("pId", 100); | |
| 340 | - childrenStationMap.put("text", "站点"); | |
| 341 | - childrenTwo.add(childrenStationMap); | |
| 342 | - | |
| 343 | - // 路段节点 | |
| 344 | - Map<String, Object> childrenSectionMap = new HashMap<String, Object>(); | |
| 345 | - childrenSectionMap.put("children", sectionChildren); | |
| 346 | - childrenSectionMap.put("container", "pjax-container"); | |
| 347 | - childrenSectionMap.put("enable", true); | |
| 348 | - childrenSectionMap.put("groupType", "2"); | |
| 349 | - childrenSectionMap.put("chaildredType", null); | |
| 350 | - childrenSectionMap.put("icon", null); | |
| 351 | - childrenSectionMap.put("id", 300); | |
| 352 | - childrenSectionMap.put("name", "路段"); | |
| 353 | - childrenSectionMap.put("pId", 100); | |
| 354 | - childrenSectionMap.put("text", "路段"); | |
| 355 | - childrenTwo.add(childrenSectionMap); | |
| 356 | - | |
| 357 | - // 站点与路段 | |
| 358 | - Map<String, Object> resultMap = new HashMap<String, Object>(); | |
| 359 | - resultMap.put("children", childrenTwo); | |
| 360 | - resultMap.put("container", "pjax-container"); | |
| 361 | - resultMap.put("enable", true); | |
| 362 | - resultMap.put("groupType", "1"); | |
| 363 | - resultMap.put("chaildredType", null); | |
| 364 | - resultMap.put("icon", null); | |
| 365 | - resultMap.put("id", 100); | |
| 366 | - resultMap.put("name", "站点与路段"); | |
| 367 | - resultMap.put("pId", null); | |
| 368 | - resultMap.put("text", "站点与路段"); | |
| 369 | - resultList.add(resultMap); | |
| 370 | - | |
| 371 | - return resultList; | |
| 372 | - } | |
| 373 | - | |
| 374 | 150 | @Override |
| 375 | 151 | public Map<String, Object> systemQuote(Map<String, Object> map) { |
| 376 | 152 | Map<String, Object> resultmap = new HashMap<>(); | ... | ... |
src/main/resources/datatools/config-test.properties
src/main/resources/static/pages/base/lineversions/list.html
| 1 | -<!-- 片段标题 START --> | |
| 2 | -<div class="page-head"> | |
| 3 | - <div class="page-title"> | |
| 4 | - <h1>线路版本信息</h1> | |
| 5 | - </div> | |
| 6 | -</div> | |
| 7 | -<!-- 片段标题 END --> | |
| 8 | - | |
| 9 | -<!-- 线路信息导航栏组件 START --> | |
| 10 | -<ul class="page-breadcrumb breadcrumb"> | |
| 11 | - <li><a href="/pages/home.html" data-pjax>首页</a> <i class="fa fa-circle"></i></li> | |
| 12 | - <li><span class="active">基础信息</span> <i class="fa fa-circle"></i></li> | |
| 13 | - <li><span class="active">线路版本信息</span></li> | |
| 14 | -</ul> | |
| 15 | -<!-- 线路信息导航栏组件 END --> | |
| 16 | - | |
| 17 | -<div class="row"> | |
| 18 | - <div class="col-md-12"> | |
| 19 | - <div class="portlet light porttlet-fit bordered"> | |
| 20 | - <div class="portlet-title"> | |
| 21 | - <div class="tipso-animation"> | |
| 22 | - </div> | |
| 23 | - <div class="caption"> | |
| 24 | - <i class="fa fa-info-circle font-dark"></i> | |
| 25 | - <span class="caption-subject font-dark sbold uppercase">线路版本信息</span> | |
| 26 | - </div> | |
| 27 | - <div class="actions"> | |
| 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> | |
| 30 | - </div> | |
| 31 | - </div> | |
| 32 | - </div> | |
| 33 | - <div class="portlet-body"> | |
| 34 | - <div class="table-container" style="margin-top: 10px"> | |
| 35 | - <table class="table table-striped table-bordered table-hover table-checkable" id="datatable_lineversions"> | |
| 36 | - <thead> | |
| 37 | - <tr role="row" class="heading"> | |
| 38 | - <th width="4%">序号</th> | |
| 39 | - <th width="5%">线路编码</th> | |
| 40 | - <th width="6%">线路名称</th> | |
| 41 | - <th width="6%">所属公司</th> | |
| 42 | - <th width="6%">所属分公司</th> | |
| 43 | - <th width="8%">启用时间</th> | |
| 44 | - <th width="8%">终止时间</th> | |
| 45 | - <th width="6%">版本号</th> | |
| 46 | - <th width="6%">版本状态</th> | |
| 47 | - <th width="6%">描述</th> | |
| 48 | - <th width="12%">操作</th> | |
| 49 | - </tr> | |
| 50 | - <tr role="row" class="filter"> | |
| 51 | - <td>#</td> | |
| 52 | - <td> | |
| 53 | - <input type="text" class="form-control form-filter input-sm" name="lineCode_eq" id="lineCodeInput"> | |
| 54 | - </td> | |
| 55 | - <td> | |
| 56 | - <select name="line.name_like" class="form-control" style="width:100%" id="lineSelect"></select> | |
| 57 | - <!-- <input type="text" class="form-control form-filter input-sm" name="name_like"> --> | |
| 58 | - </td> | |
| 59 | - <td> | |
| 60 | - <!-- 公司这里没使用字典表,暂时查的公司表 --> | |
| 61 | - <select name="line.company_eq" class="form-control" id="companySelect"></select> | |
| 62 | - </td> | |
| 63 | - <!-- 闵行没有下属公司,这里暂时注释掉 --> | |
| 64 | - <td> | |
| 65 | - <select name="line.brancheCompany_eq" class="form-control" id="brancheCompanySelect"></select> | |
| 66 | - </td> | |
| 67 | - <td> | |
| 68 | -<!-- <input type="text" class="form-control form-filter input-sm" name="shanghaiLinecode_eq"> --> | |
| 69 | - </td> | |
| 70 | - <td> | |
| 71 | -<!-- <input type="text" class="form-control form-filter input-sm" name="shanghaiLinecode_eq"> --> | |
| 72 | - </td> | |
| 73 | - <td> | |
| 74 | - <input type="text" class="form-control form-filter input-sm" name="versions_eq"> | |
| 75 | - | |
| 76 | - </td> | |
| 77 | - <td> | |
| 78 | - <select name="status_eq" class="form-control" id="statusSelect"> | |
| 79 | - <option value="">请选择...</option> | |
| 80 | - <option value="1">当前版本</option> | |
| 81 | - <option value="2">待更新版本</option> | |
| 82 | - <option value="0">历史版本</option> | |
| 83 | - </select> | |
| 84 | - </td> | |
| 85 | - <td></td> | |
| 86 | - <td> | |
| 87 | - <button class="btn btn-sm green btn-outline filter-submit margin-bottom" > | |
| 88 | - <i class="fa fa-search"></i> 搜索 | |
| 89 | - </button> | |
| 90 | - | |
| 91 | - <button class="btn btn-sm red btn-outline filter-cancel" id="notification-trigger"> | |
| 92 | - <i class="fa fa-times"></i> 重置 | |
| 93 | - </button> | |
| 94 | - </td> | |
| 95 | - </tr> | |
| 96 | - </thead> | |
| 97 | - <tbody></tbody> | |
| 98 | - </table> | |
| 99 | - <div style="text-align: right;"> | |
| 100 | - <ul id="pagination" class="pagination"></ul> | |
| 101 | - </div> | |
| 102 | - </div> | |
| 103 | - </div> | |
| 104 | - </div> | |
| 105 | - </div> | |
| 106 | -</div> | |
| 107 | - | |
| 108 | -<script type="text/html" id="lineversions_list_temp"> | |
| 109 | - {{each list as obj i }} | |
| 110 | - <tr> | |
| 111 | - <td style="vertical-align: middle;"> | |
| 112 | - {{(list.page*10)+(i+1)}} | |
| 113 | - </td> | |
| 114 | - <td> | |
| 115 | - {{obj.lineCode}} | |
| 116 | - </td> | |
| 117 | - <td> | |
| 118 | - {{obj.line.name}} | |
| 119 | - </td> | |
| 120 | - <td> | |
| 121 | - {{obj.gsmc}} | |
| 122 | - </td> | |
| 123 | - <td> | |
| 124 | - {{obj.fgsmc}} | |
| 125 | - </td> | |
| 126 | - <td> | |
| 127 | - {{obj.startDateStr}} | |
| 128 | - </td> | |
| 129 | - <td> | |
| 130 | - {{obj.endDateStr}} | |
| 131 | - </td> | |
| 132 | - <td> | |
| 133 | - {{obj.versions}} | |
| 134 | - </td> | |
| 135 | - <td> | |
| 136 | - {{if obj.status == '0'}} | |
| 137 | - 历史版本 | |
| 138 | - {{else if obj.status == '1'}} | |
| 139 | - 当前版本 | |
| 140 | - {{else if obj.status == '2'}} | |
| 141 | - 待更新版本 | |
| 142 | - {{/if}} | |
| 143 | - </td> | |
| 144 | - <td> | |
| 145 | - {{obj.remark}} | |
| 146 | - </td> | |
| 147 | - <td> | |
| 148 | - {{if obj.status != '0'}} | |
| 149 | - <a href="edit.html?no={{obj.id}}" class="btn btn-info btn-sm" data-pjax> 修改 </a> | |
| 150 | - {{/if}} | |
| 151 | - {{if obj.status == '2'}} | |
| 152 | - <a class="update_delete_btn btn btn-danger btn-sm" data-id="{{obj.id}}" data-pjax> 删除 </a> | |
| 153 | - <a class="update_versions_route_btn btn btn-info btn-sm" data-lineid="{{obj.line.id}}" data-pjax> 编辑版本路线 </a> | |
| 154 | - {{/if}} | |
| 155 | - {{if obj.status == '2' && obj.isupdate!=1}} | |
| 156 | - <a class="issue_btn btn btn-danger btn-sm" data-id="{{obj.id}}" data-pjax>发布</a> | |
| 157 | - {{else if obj.status == '2' && obj.isupdate==1}} | |
| 158 | - <a class="btn btn-danger btn-sm disabled">数据同步中</a> | |
| 159 | - {{/if}} | |
| 160 | - </td> | |
| 161 | - </tr> | |
| 162 | - {{/each}} | |
| 163 | - {{if list.length == 0}} | |
| 164 | - <tr> | |
| 165 | - <td colspan=13><h6 class="muted">没有找到相关数据</h6></td> | |
| 166 | - </tr> | |
| 167 | - {{/if}} | |
| 168 | -</script> | |
| 169 | -<!-- 线路信息片段JS模块 --> | |
| 1 | +<!-- 片段标题 START --> | |
| 2 | +<div class="page-head"> | |
| 3 | + <div class="page-title"> | |
| 4 | + <h1>线路版本信息</h1> | |
| 5 | + </div> | |
| 6 | +</div> | |
| 7 | +<!-- 片段标题 END --> | |
| 8 | + | |
| 9 | +<!-- 线路信息导航栏组件 START --> | |
| 10 | +<ul class="page-breadcrumb breadcrumb"> | |
| 11 | + <li><a href="/pages/home.html" data-pjax>首页</a> <i class="fa fa-circle"></i></li> | |
| 12 | + <li><span class="active">基础信息</span> <i class="fa fa-circle"></i></li> | |
| 13 | + <li><span class="active">线路版本信息</span></li> | |
| 14 | +</ul> | |
| 15 | +<!-- 线路信息导航栏组件 END --> | |
| 16 | + | |
| 17 | +<div class="row"> | |
| 18 | + <div class="col-md-12"> | |
| 19 | + <div class="portlet light porttlet-fit bordered"> | |
| 20 | + <div class="portlet-title"> | |
| 21 | + <div class="tipso-animation"> | |
| 22 | + </div> | |
| 23 | + <div class="caption"> | |
| 24 | + <i class="fa fa-info-circle font-dark"></i> | |
| 25 | + <span class="caption-subject font-dark sbold uppercase">线路版本信息</span> | |
| 26 | + </div> | |
| 27 | + <div class="actions"> | |
| 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> | |
| 30 | + </div> | |
| 31 | + </div> | |
| 32 | + </div> | |
| 33 | + <div class="portlet-body"> | |
| 34 | + <div class="table-container" style="margin-top: 10px"> | |
| 35 | + <table class="table table-striped table-bordered table-hover table-checkable" id="datatable_lineversions"> | |
| 36 | + <thead> | |
| 37 | + <tr role="row" class="heading"> | |
| 38 | + <th width="4%">序号</th> | |
| 39 | + <th width="5%">线路编码</th> | |
| 40 | + <th width="6%">线路名称</th> | |
| 41 | + <th width="6%">所属公司</th> | |
| 42 | + <th width="6%">所属分公司</th> | |
| 43 | + <th width="8%">启用时间</th> | |
| 44 | + <th width="8%">终止时间</th> | |
| 45 | + <th width="6%">版本号</th> | |
| 46 | + <th width="6%">版本状态</th> | |
| 47 | + <th width="6%">描述</th> | |
| 48 | + <th width="12%">操作</th> | |
| 49 | + </tr> | |
| 50 | + <tr role="row" class="filter"> | |
| 51 | + <td>#</td> | |
| 52 | + <td> | |
| 53 | + <input type="text" class="form-control form-filter input-sm" name="lineCode_eq" id="lineCodeInput"> | |
| 54 | + </td> | |
| 55 | + <td> | |
| 56 | + <select name="line.name_like" class="form-control" style="width:100%" id="lineSelect"></select> | |
| 57 | + <!-- <input type="text" class="form-control form-filter input-sm" name="name_like"> --> | |
| 58 | + </td> | |
| 59 | + <td> | |
| 60 | + <!-- 公司这里没使用字典表,暂时查的公司表 --> | |
| 61 | + <select name="line.company_eq" class="form-control" id="companySelect"></select> | |
| 62 | + </td> | |
| 63 | + <!-- 闵行没有下属公司,这里暂时注释掉 --> | |
| 64 | + <td> | |
| 65 | + <select name="line.brancheCompany_eq" class="form-control" id="brancheCompanySelect"></select> | |
| 66 | + </td> | |
| 67 | + <td> | |
| 68 | +<!-- <input type="text" class="form-control form-filter input-sm" name="shanghaiLinecode_eq"> --> | |
| 69 | + </td> | |
| 70 | + <td> | |
| 71 | +<!-- <input type="text" class="form-control form-filter input-sm" name="shanghaiLinecode_eq"> --> | |
| 72 | + </td> | |
| 73 | + <td> | |
| 74 | + <input type="text" class="form-control form-filter input-sm" name="versions_eq"> | |
| 75 | + | |
| 76 | + </td> | |
| 77 | + <td> | |
| 78 | + <select name="status_eq" class="form-control" id="statusSelect"> | |
| 79 | + <option value="">请选择...</option> | |
| 80 | + <option value="1">当前版本</option> | |
| 81 | + <option value="2">待更新版本</option> | |
| 82 | + <option value="0">历史版本</option> | |
| 83 | + </select> | |
| 84 | + </td> | |
| 85 | + <td></td> | |
| 86 | + <td> | |
| 87 | + <button class="btn btn-sm green btn-outline filter-submit margin-bottom" > | |
| 88 | + <i class="fa fa-search"></i> 搜索 | |
| 89 | + </button> | |
| 90 | + | |
| 91 | + <button class="btn btn-sm red btn-outline filter-cancel" id="notification-trigger"> | |
| 92 | + <i class="fa fa-times"></i> 重置 | |
| 93 | + </button> | |
| 94 | + </td> | |
| 95 | + </tr> | |
| 96 | + </thead> | |
| 97 | + <tbody></tbody> | |
| 98 | + </table> | |
| 99 | + <div style="text-align: right;"> | |
| 100 | + <ul id="pagination" class="pagination"></ul> | |
| 101 | + </div> | |
| 102 | + </div> | |
| 103 | + </div> | |
| 104 | + </div> | |
| 105 | + </div> | |
| 106 | +</div> | |
| 107 | + | |
| 108 | +<script type="text/html" id="lineversions_list_temp"> | |
| 109 | + {{each list as obj i }} | |
| 110 | + <tr> | |
| 111 | + <td style="vertical-align: middle;"> | |
| 112 | + {{(list.page*10)+(i+1)}} | |
| 113 | + </td> | |
| 114 | + <td> | |
| 115 | + {{obj.lineCode}} | |
| 116 | + </td> | |
| 117 | + <td> | |
| 118 | + {{obj.line.name}} | |
| 119 | + </td> | |
| 120 | + <td> | |
| 121 | + {{obj.gsmc}} | |
| 122 | + </td> | |
| 123 | + <td> | |
| 124 | + {{obj.fgsmc}} | |
| 125 | + </td> | |
| 126 | + <td> | |
| 127 | + {{obj.startDateStr}} | |
| 128 | + </td> | |
| 129 | + <td> | |
| 130 | + {{obj.endDateStr}} | |
| 131 | + </td> | |
| 132 | + <td> | |
| 133 | + {{obj.versions}} | |
| 134 | + </td> | |
| 135 | + <td> | |
| 136 | + {{if obj.status == '0'}} | |
| 137 | + 历史版本 | |
| 138 | + {{else if obj.status == '1'}} | |
| 139 | + 当前版本 | |
| 140 | + {{else if obj.status == '2'}} | |
| 141 | + 待更新版本 | |
| 142 | + {{/if}} | |
| 143 | + </td> | |
| 144 | + <td> | |
| 145 | + {{obj.remark}} | |
| 146 | + </td> | |
| 147 | + <td> | |
| 148 | + {{if obj.status != '0'}} | |
| 149 | + <a href="edit.html?no={{obj.id}}" class="btn btn-info btn-sm" data-pjax> 修改 </a> | |
| 150 | + {{/if}} | |
| 151 | + {{if obj.status == '2'}} | |
| 152 | + <a class="update_delete_btn btn btn-danger btn-sm" data-id="{{obj.id}}" data-pjax> 删除 </a> | |
| 153 | + <!--<a class="update_versions_route_btn btn btn-info btn-sm" data-lineid="{{obj.line.id}}" data-pjax> 编辑版本路线 </a>--> | |
| 154 | + {{/if}} | |
| 155 | + <!--{{if obj.status == '2' && obj.isupdate!=1}} | |
| 156 | + <a class="issue_btn btn btn-danger btn-sm" data-id="{{obj.id}}" data-pjax>发布</a> | |
| 157 | + {{else if obj.status == '2' && obj.isupdate==1}} | |
| 158 | + <a class="btn btn-danger btn-sm disabled">数据同步中</a> | |
| 159 | + {{/if}}--> | |
| 160 | + </td> | |
| 161 | + </tr> | |
| 162 | + {{/each}} | |
| 163 | + {{if list.length == 0}} | |
| 164 | + <tr> | |
| 165 | + <td colspan=13><h6 class="muted">没有找到相关数据</h6></td> | |
| 166 | + </tr> | |
| 167 | + {{/if}} | |
| 168 | +</script> | |
| 169 | +<!-- 线路信息片段JS模块 --> | |
| 170 | 170 | <script src="/pages/base/lineversions/js/lineversions-list-table.js"></script> |
| 171 | 171 | \ No newline at end of file | ... | ... |
src/main/resources/static/pages/base/stationroute/add_line_region.html
0 → 100644
| 1 | +<style> | |
| 2 | + .tab_station { | |
| 3 | + background-color: #ffffff; | |
| 4 | + height: 300px; | |
| 5 | + padding-left: 3px; | |
| 6 | + padding-right: 3px; | |
| 7 | + } | |
| 8 | + | |
| 9 | + .tab_station .center { | |
| 10 | + color: #3f444a; | |
| 11 | + padding-top: 10px; | |
| 12 | + } | |
| 13 | + | |
| 14 | + .tab_station .panel-wrap { | |
| 15 | + height: 100%; | |
| 16 | + padding-left: 3px; | |
| 17 | + padding-right: 3px; | |
| 18 | + } | |
| 19 | + | |
| 20 | + .tab_station .panel-wrap ._panel { | |
| 21 | + border: 1px solid #ddd; | |
| 22 | + box-shadow: 0 2px 5px 0 rgba(221, 221, 221, 0.32), 0 2px 10px 0 | |
| 23 | + rgba(221, 221, 221, 0.32); | |
| 24 | + width: 100%; | |
| 25 | + height: 100%; | |
| 26 | + position: relative; | |
| 27 | + } | |
| 28 | + | |
| 29 | + .tab_station .panel-wrap ._panel ._head { | |
| 30 | + height: 42px; | |
| 31 | + line-height: 42px; | |
| 32 | + padding-left: 15px; | |
| 33 | + font-size: 16px; | |
| 34 | + font-family: 微软雅黑; | |
| 35 | + color: #2765A7; | |
| 36 | + border-bottom: 1px solid #dddddd; | |
| 37 | + } | |
| 38 | + | |
| 39 | + .table-body { | |
| 40 | + height: 228px; | |
| 41 | + overflow-y: auto; | |
| 42 | + position: relative; | |
| 43 | + } | |
| 44 | + | |
| 45 | + .center { | |
| 46 | + line-height: 3; | |
| 47 | + position: absolute; | |
| 48 | + padding-left: initial; | |
| 49 | + top: 50%; | |
| 50 | + left: 50%; | |
| 51 | + width: 50%; | |
| 52 | + -webkit-transform: translateX(-50%) translateY(-50%); | |
| 53 | + text-align: center; | |
| 54 | + } | |
| 55 | + .center li { | |
| 56 | + list-style-type: none; | |
| 57 | + } | |
| 58 | + dl { | |
| 59 | + display: block; | |
| 60 | + margin: 0px; | |
| 61 | + height: 30px; | |
| 62 | + border-bottom: 1px solid #dddddd; | |
| 63 | + } | |
| 64 | + dl dt { | |
| 65 | + display: inline-block; | |
| 66 | + font-size: 14px; | |
| 67 | + white-space: nowrap; | |
| 68 | + overflow: hidden; | |
| 69 | + text-overflow: ellipsis; | |
| 70 | + border-left: 1px solid #dddddd; | |
| 71 | + text-indent: 5px; | |
| 72 | + text-align: center; | |
| 73 | + height: 30px; | |
| 74 | + } | |
| 75 | + dl dd { | |
| 76 | + display: inline-block; | |
| 77 | + font-size: 14px; | |
| 78 | + white-space: nowrap; | |
| 79 | + overflow: hidden; | |
| 80 | + text-overflow: ellipsis; | |
| 81 | + border-left: 1px solid #dddddd; | |
| 82 | + text-indent: 5px; | |
| 83 | + text-align: center; | |
| 84 | + height: 30px; | |
| 85 | + line-height: 30px; | |
| 86 | + } | |
| 87 | + dt:nth-of-type(1), dd:nth-of-type(1){ | |
| 88 | + width: 10%; | |
| 89 | + } | |
| 90 | + dt:nth-of-type(2), dd:nth-of-type(2){ | |
| 91 | + width: 60%; | |
| 92 | + } | |
| 93 | + dt:nth-of-type(3), dd:nth-of-type(3){ | |
| 94 | + width: 25%; | |
| 95 | + } | |
| 96 | +</style> | |
| 97 | +<div class="modal fade" id="add_line_region_modal" tabindex="-1" role="basic" aria-hidden="true" style="min-width: 800px;"> | |
| 98 | + <div class="modal-dialog"> | |
| 99 | + <div class="modal-content" > | |
| 100 | + | |
| 101 | + <div class="modal-header"> | |
| 102 | + <button type="button" class="close" data-dismiss="modal" aria-hidden="true"></button> | |
| 103 | + <h4 class="modal-title">选择站点</h4> | |
| 104 | + </div> | |
| 105 | + | |
| 106 | + <div class="modal-body"> | |
| 107 | + <form class="form-horizontal" role="form" id="add_line_region_form" action="" method=""> | |
| 108 | + <div class="alert alert-danger display-hide"> | |
| 109 | + <button class="close" data-close="alert"></button> | |
| 110 | + 您的输入有误,请检查下面的输入项 | |
| 111 | + </div> | |
| 112 | + <!-- 站点名称 --> | |
| 113 | + <div class="form-body"> | |
| 114 | + <div class="form-group"> | |
| 115 | + <label class="control-label col-md-2"> | |
| 116 | + <span class="required"> * </span> 区间别名 | |
| 117 | + </label> | |
| 118 | + <div class="col-md-4"> | |
| 119 | + <input class="form-control" name="regionAlias" placeholder="输入区间别名"/> | |
| 120 | + </div> | |
| 121 | + <label class="control-label col-md-2"> | |
| 122 | + 上下行 | |
| 123 | + </label> | |
| 124 | + <div class="col-md-4"> | |
| 125 | + <select class="form-control" name="direction" id="directionSelect"> | |
| 126 | + <option value="0">上行</option> | |
| 127 | + <option value="1">下行</option> | |
| 128 | + <!--<option value="">上行+下行</option>--> | |
| 129 | + </select> | |
| 130 | + </div> | |
| 131 | + </div> | |
| 132 | + <div class="form-group tab_station"> | |
| 133 | + <div class="col-md-5 panel-wrap" style="height: 100%;"> | |
| 134 | + <div class="_panel"> | |
| 135 | + <div class="_head">待选站点列表</div> | |
| 136 | + <div class="table-container" id="left"> | |
| 137 | + <dl> | |
| 138 | + <dt>#</dt> | |
| 139 | + <dt>站点</dt> | |
| 140 | + <dt title="上下行">上下行</dt> | |
| 141 | + </dl> | |
| 142 | + <div class="table-body"></div> | |
| 143 | + </div> | |
| 144 | + </div> | |
| 145 | + </div> | |
| 146 | + <div class="col-md-2" style="height: 100%;"> | |
| 147 | + <ul class="center"> | |
| 148 | + <li><a class="btn btn-circle blue btn-outline" id="toRight">>></a></li> | |
| 149 | + <li><a class="btn btn-circle blue btn-outline" id="toLeft"><<</a></li> | |
| 150 | + </ul> | |
| 151 | + </div> | |
| 152 | + <div class="col-md-5 panel-wrap" style="height: 100%;"> | |
| 153 | + <div class="_panel"> | |
| 154 | + <div class="_head" style="color: #2765A7;">已选站点列表</div> | |
| 155 | + <div class="table-container" id="right"> | |
| 156 | + <dl> | |
| 157 | + <dt>#</dt> | |
| 158 | + <dt>站点</dt> | |
| 159 | + <dt title="上下行">上下行</dt> | |
| 160 | + </dl> | |
| 161 | + <div class="table-body"></div> | |
| 162 | + </div> | |
| 163 | + </div> | |
| 164 | + </div> | |
| 165 | + </div> | |
| 166 | + </div> | |
| 167 | + </form> | |
| 168 | + </div> | |
| 169 | + <div class="modal-footer"> | |
| 170 | + <button type="button" class="btn btn-primary" id="regionSaveBtn">提交</button> | |
| 171 | + <button type="button" class="btn default" data-dismiss="modal">取消</button> | |
| 172 | + </div> | |
| 173 | + </div> | |
| 174 | + </div> | |
| 175 | +</div> | |
| 176 | +<script id="add_line_region_station_table_template" type="text/html"> | |
| 177 | + {{each list as obj i}} | |
| 178 | + <dl data-idx="{{i}}"> | |
| 179 | + <dd class="seq"> | |
| 180 | + {{i+1}} | |
| 181 | + </dd> | |
| 182 | + <dd> | |
| 183 | + {{obj.stationName}} | |
| 184 | + </dd> | |
| 185 | + <dd> | |
| 186 | + {{if obj.directions == 0}} | |
| 187 | + 上行 | |
| 188 | + {{else}} | |
| 189 | + 下行 | |
| 190 | + {{/if}} | |
| 191 | + </dd> | |
| 192 | + </dl> | |
| 193 | + {{/each}} | |
| 194 | +</script> | |
| 195 | +<script type="text/javascript"> | |
| 196 | + var stationRoutes = [], properties = RoutesOperation.getProperties(); | |
| 197 | + | |
| 198 | + function render() { | |
| 199 | + var html = template('add_line_region_station_table_template', {list : stationRoutes}); | |
| 200 | + $('#left .table-body').html(html); | |
| 201 | + $('#right .table-body').html(''); | |
| 202 | + $('#left .table-body dl').on('click', left2right); | |
| 203 | + $('#left .table-body').perfectScrollbar({suppressScrollX: true}) | |
| 204 | + $('#right .table-body').perfectScrollbar({suppressScrollX: true}) | |
| 205 | + } | |
| 206 | + | |
| 207 | + function left2right() { | |
| 208 | + $(this).remove(); | |
| 209 | + var idx = $(this).data('idx'); | |
| 210 | + $('#right .table-body').append($(this).prop('outerHTML')); | |
| 211 | + $('#right .table-body dl[data-idx=' + idx + ']').on('click', right2left); | |
| 212 | + $('#left .table-body').perfectScrollbar("update"); | |
| 213 | + $('#right .table-body').perfectScrollbar("update") | |
| 214 | + } | |
| 215 | + | |
| 216 | + function right2left() { | |
| 217 | + $(this).remove(); | |
| 218 | + var idx = $(this).data('idx'), first = $('#left .table-body dl').first(); | |
| 219 | + if (!first[0] || first.data('idx') > idx) { | |
| 220 | + $('#left .table-body').prepend($(this).prop('outerHTML')); | |
| 221 | + } else { | |
| 222 | + while (first.data('idx') < idx) { | |
| 223 | + var next = first.next(); | |
| 224 | + if (!next[0] || next.prop('tagName') != 'DL' || next.data('idx') > idx) { | |
| 225 | + first.after($(this).prop('outerHTML')); | |
| 226 | + break; | |
| 227 | + } else { | |
| 228 | + first = next; | |
| 229 | + } | |
| 230 | + } | |
| 231 | + } | |
| 232 | + $('#left .table-body dl[data-idx=' + idx + ']').on('click', left2right); | |
| 233 | + $('#left .table-body').perfectScrollbar("update"); | |
| 234 | + $('#right .table-body').perfectScrollbar("update") | |
| 235 | + } | |
| 236 | + | |
| 237 | + function all2right() { | |
| 238 | + $('#left .table-body dl').each(function() { | |
| 239 | + $(this).click(); | |
| 240 | + }) | |
| 241 | + } | |
| 242 | + | |
| 243 | + function all2left() { | |
| 244 | + $('#right .table-body dl').each(function() { | |
| 245 | + $(this).click(); | |
| 246 | + }) | |
| 247 | + } | |
| 248 | + | |
| 249 | + $('#add_line_region_modal').on('modal.show', function(event) { | |
| 250 | + $('#add_line_region_modal').modal({show: true, backdrop: 'static', keyboard: false}); | |
| 251 | + }) | |
| 252 | + | |
| 253 | + $('#add_line_region_modal').on('show.bs.modal', function () { | |
| 254 | + RoutesService.findStationRoutes(properties.lineId, $('#directionSelect').val(), properties.versions, function (data) { | |
| 255 | + stationRoutes = data; | |
| 256 | + render(); | |
| 257 | + }) | |
| 258 | + }) | |
| 259 | + | |
| 260 | + $('#directionSelect').on('change', function () { | |
| 261 | + RoutesService.findStationRoutes(properties.lineId, $(this).val(), properties.versions, function (data) { | |
| 262 | + stationRoutes = data; | |
| 263 | + render(); | |
| 264 | + }) | |
| 265 | + }) | |
| 266 | + | |
| 267 | + $('#toRight').on('click', all2right); | |
| 268 | + | |
| 269 | + $('#toLeft').on('click', all2left); | |
| 270 | + | |
| 271 | + var form = $('#add_line_region_form'); | |
| 272 | + var error = $('.alert-danger', form); | |
| 273 | + $('#regionSaveBtn').on('click', function() { | |
| 274 | + form.submit(); | |
| 275 | + }); | |
| 276 | + form.validate({ | |
| 277 | + errorElement : 'span', | |
| 278 | + errorClass : 'help-block help-block-error', | |
| 279 | + focusInvalid : false, | |
| 280 | + rules : { | |
| 281 | + 'regionAlias': {required: true, maxlength: 50} | |
| 282 | + }, | |
| 283 | + invalidHandler : function(event, validator) { | |
| 284 | + error.show(); | |
| 285 | + App.scrollTo(error, -200); | |
| 286 | + }, | |
| 287 | + highlight : function(element) { | |
| 288 | + $(element).closest('.form-group').addClass('has-error'); | |
| 289 | + }, | |
| 290 | + unhighlight : function(element) { | |
| 291 | + $(element).closest('.form-group').removeClass('has-error'); | |
| 292 | + }, | |
| 293 | + success : function(label) { | |
| 294 | + label.closest('.form-group').removeClass('has-error'); | |
| 295 | + }, | |
| 296 | + submitHandler : function(f) { | |
| 297 | + error.hide(); | |
| 298 | + var params = form.serializeJSON(), stationRouteIds = []; | |
| 299 | + $('#right .table-body dl').each(function() { | |
| 300 | + stationRouteIds.push(stationRoutes[$(this).data('idx')].id); | |
| 301 | + }) | |
| 302 | + params.stationRoutes = stationRouteIds.join(','); | |
| 303 | + params.line = properties.lineId; | |
| 304 | + params.version = properties.versions; | |
| 305 | + RoutesService.addLineRegion(params, function(res) { | |
| 306 | + if(res.status == 'SUCCESS') { | |
| 307 | + layer.msg('操作成功...'); | |
| 308 | + $('#regionDesign').click(); | |
| 309 | + }else { | |
| 310 | + layer.msg('操作失败...'); | |
| 311 | + } | |
| 312 | + $('#add_line_region_modal').modal('hide'); | |
| 313 | + }); | |
| 314 | + } | |
| 315 | + }); | |
| 316 | +</script> | |
| 0 | 317 | \ No newline at end of file | ... | ... |
src/main/resources/static/pages/base/stationroute/add_routes_template.html
| ... | ... | @@ -236,7 +236,10 @@ $('#add_routes_template_modal').on('modal.show', function(event){ |
| 236 | 236 | RoutesOperation.stationsPointsToLibraryPoint(stationList,function(resultJson) { |
| 237 | 237 | // 根据坐标点获取两点之间的时间与距离 |
| 238 | 238 | RoutesOperation.getDistanceAndDuration(resultJson,function(stationDataList) { |
| 239 | - // 参数集合 | |
| 239 | + stationDataList.forEach(function(item) { | |
| 240 | + item.shapedType = 'r'; | |
| 241 | + item.radius = 80; | |
| 242 | + }) | |
| 240 | 243 | let params = {lineId: properties.lineId, directions: properties.directions, versions: properties.versions, stationRoutes: stationDataList, sectionRoutes: sectionListFinal}; |
| 241 | 244 | if (!params.versions) { |
| 242 | 245 | params.versions = '1'; | ... | ... |
src/main/resources/static/pages/base/stationroute/addstationstemplate.html
| 1 | 1 | <!-- 手动添加站点 --> |
| 2 | -<div class="modal fade" id="add_station_template_mobal" tabindex="-1" role="basic" aria-hidden="true"> | |
| 2 | +<div class="modal fade" id="add_station_template_modal" tabindex="-1" role="basic" aria-hidden="true"> | |
| 3 | 3 | |
| 4 | 4 | <div class="modal-dialog"> |
| 5 | 5 | |
| ... | ... | @@ -23,10 +23,10 @@ |
| 23 | 23 | |
| 24 | 24 | <div class="form-group"> |
| 25 | 25 | <label class="control-label col-md-3"> |
| 26 | - <span class="required"> * </span> 站点名称: | |
| 26 | + <span class="required"> * </span> 站点信息: | |
| 27 | 27 | </label> |
| 28 | 28 | <div class="col-md-9"> |
| 29 | - <textarea class="form-control" rows="12" name="stations" id="stationsInput" placeholder="站点名称"></textarea> | |
| 29 | + <textarea class="form-control" rows="12" name="stations" id="stationsInput" placeholder="站点信息"></textarea> | |
| 30 | 30 | </div> |
| 31 | 31 | </div> |
| 32 | 32 | |
| ... | ... | @@ -36,16 +36,16 @@ |
| 36 | 36 | <label class="col-md-3 control-label">坐标系类型:</label> |
| 37 | 37 | <div class="col-md-9"> |
| 38 | 38 | <div class="icheck-list"> |
| 39 | - <label> | |
| 40 | - <input type="radio" class="icheck" name="baseRes" value='No'> 暂无坐标系 | |
| 39 | + <!--<label> | |
| 40 | + <input type="radio" class="icheck" name="baseRes" value='No'> 暂无坐标系 | |
| 41 | 41 | </label> |
| 42 | 42 | <label> |
| 43 | 43 | <input type="radio" class="icheck" name="baseRes" value='GCJ02' > 火星坐标系 |
| 44 | 44 | </label> |
| 45 | - <label > | |
| 45 | + <label> | |
| 46 | 46 | <input type="radio" class="icheck" name="baseRes" value='BD09'> 百度坐标系 |
| 47 | - </label> | |
| 48 | - <label > | |
| 47 | + </label>--> | |
| 48 | + <label> | |
| 49 | 49 | <input type="radio" class="icheck" name="baseRes" value='WGS84' checked> WGS84坐标系 |
| 50 | 50 | </label> |
| 51 | 51 | </div> |
| ... | ... | @@ -85,229 +85,136 @@ |
| 85 | 85 | </div> |
| 86 | 86 | <script type="text/javascript"> |
| 87 | 87 | |
| 88 | -$('#add_station_template_mobal').on('AddStationTempMobal.show', function(e,map,ajaxd,dir,line,fun){ | |
| 89 | - | |
| 90 | - | |
| 91 | - | |
| 92 | - // 延迟加载显示mobal | |
| 93 | - setTimeout(function(){$('#add_station_template_mobal').modal({show : true,backdrop: 'static', keyboard: false});},200); | |
| 94 | - | |
| 95 | - // 获取表单元素 | |
| 88 | +$('#add_station_template_modal').on('modal.show', function(event) { | |
| 89 | + var properties = RoutesOperation.getProperties(); | |
| 90 | + setTimeout(function(){$('#add_station_template_modal').modal({show : true,backdrop: 'static', keyboard: false});},200); | |
| 91 | + | |
| 96 | 92 | var form = $('#save_station_template_form'); |
| 97 | - | |
| 98 | - $('#versionsInput').val($("#versions").val()); | |
| 99 | - | |
| 100 | - // 获取错误提示信息元素 | |
| 101 | 93 | var error = $('.alert-danger', form); |
| 102 | - | |
| 103 | - // 提交数据点击事件 | |
| 94 | + $('#versionsInput').val(properties.versions); | |
| 95 | + | |
| 104 | 96 | $('.modal-footer #templateSaveData').on('click',function() { |
| 105 | - | |
| 106 | - // 表单提交 | |
| 107 | 97 | form.submit(); |
| 108 | - | |
| 109 | 98 | }); |
| 110 | - | |
| 111 | - // 表单验证 | |
| 99 | + | |
| 112 | 100 | form.validate({ |
| 113 | - | |
| 114 | - errorElement : 'span', | |
| 115 | - | |
| 116 | - errorClass : 'help-block help-block-error', | |
| 117 | - | |
| 118 | - focusInvalid : false, | |
| 119 | - | |
| 120 | - rules : { | |
| 121 | - | |
| 122 | - 'stations' : { | |
| 123 | - | |
| 124 | - required : true, | |
| 125 | - | |
| 126 | - } | |
| 127 | - | |
| 101 | + errorElement: 'span', | |
| 102 | + errorClass: 'help-block help-block-error', | |
| 103 | + focusInvalid: false, | |
| 104 | + rules: { | |
| 105 | + 'stations': {required: true} | |
| 128 | 106 | }, |
| 129 | - | |
| 130 | - invalidHandler : function(event, validator) { | |
| 131 | - | |
| 107 | + invalidHandler: function(event, validator) { | |
| 132 | 108 | error.show(); |
| 133 | - | |
| 134 | 109 | App.scrollTo(error, -200); |
| 135 | - | |
| 136 | 110 | }, |
| 137 | - | |
| 138 | - highlight : function(element) { | |
| 139 | - | |
| 140 | - $(element).closest('.form-group').addClass('has-error'); | |
| 141 | - | |
| 111 | + highlight: function(element) { | |
| 112 | + $(element).closest('.form-group').addClass('has-error'); | |
| 142 | 113 | }, |
| 143 | - | |
| 144 | - unhighlight : function(element) { | |
| 145 | - | |
| 146 | - $(element).closest('.form-group').removeClass('has-error'); | |
| 147 | - | |
| 114 | + unhighlight: function(element) { | |
| 115 | + $(element).closest('.form-group').removeClass('has-error'); | |
| 148 | 116 | }, |
| 149 | - | |
| 150 | - success : function(label) { | |
| 151 | - | |
| 152 | - label.closest('.form-group').removeClass('has-error'); | |
| 153 | - | |
| 117 | + success: function(label) { | |
| 118 | + label.closest('.form-group').removeClass('has-error'); | |
| 154 | 119 | }, |
| 155 | - | |
| 156 | - submitHandler : function(f) { | |
| 157 | - // 隐藏手动规划弹出层 | |
| 158 | - $('#add_station_template_mobal').modal('hide'); | |
| 159 | - var directionData = dir; | |
| 160 | - // 定义线路名称 | |
| 120 | + submitHandler: function(f) { | |
| 121 | + $('#add_station_template_modal').modal('hide'); | |
| 122 | + var directionData = properties.directions; | |
| 161 | 123 | var lineNameV = $('.portlet-title .caption').text(); |
| 162 | 124 | var dirStr = ''; |
| 163 | - // 上行 | |
| 164 | - if(directionData==0){ | |
| 125 | + if (directionData == 0) { | |
| 165 | 126 | dirStr = '上行路段'; |
| 166 | - // 隐藏上行规划 | |
| 167 | 127 | $('#upToolsMobal').hide(); |
| 168 | - // 下行 | |
| 169 | - }else if(directionData==1){ | |
| 128 | + } else if (directionData == 1) { | |
| 170 | 129 | dirStr = '下行路段'; |
| 171 | - // 隐藏上行规划 | |
| 172 | 130 | $('#downToolsMobal').hide(); |
| 173 | 131 | } |
| 174 | - // 弹出正在加载层 | |
| 175 | 132 | var i = layer.load(0,{offset:['200px', '280px']}); |
| 176 | - // 表单序列化 | |
| 177 | 133 | var paramsForm = form.serializeJSON(); |
| 178 | 134 | var baseResValue = paramsForm.baseRes; |
| 179 | - // 站点名称字符串切割 | |
| 180 | 135 | var array = paramsForm.stations.split('\r\n'); |
| 181 | 136 | var arrayFormat = inputStationValueFormat(array); |
| 182 | 137 | // 根据站点名称获取百度坐标 |
| 183 | - map.stationsNameToPoints(arrayFormat,function(resultJson) { | |
| 138 | + RoutesOperation.stationsNameToPoints(arrayFormat, function(resultJson) { | |
| 184 | 139 | // 根据坐标点获取两点之间的时间与距离 |
| 185 | - map.getDistanceAndDuration(resultJson,function(stationdataList) { | |
| 186 | - // 设置第一个站的距离 | |
| 187 | - stationdataList[0].distance = ''; | |
| 188 | - // 设置第一个站的时间 | |
| 189 | - stationdataList[0].duration = ''; | |
| 190 | - // 定义站点信息JSON字符串 | |
| 191 | - var stationJSON = JSON.stringify(stationdataList); | |
| 192 | - var addLine = line.getLineObj(); | |
| 193 | - // 参数集合 | |
| 140 | + RoutesOperation.getDistanceAndTotime(resultJson, function(stationdataList) { | |
| 194 | 141 | var params = {}; |
| 195 | - params.baseRes = baseResValue; | |
| 196 | - // 站点信息JSON字符串 | |
| 197 | - params.stationJSON = stationJSON; | |
| 198 | - // 线路ID | |
| 199 | - params.lineId = addLine.id; | |
| 200 | - // 方向 | |
| 201 | - params.directions = directionData; | |
| 202 | - // 原始坐标类型 | |
| 203 | - params.dbType = 'b'; | |
| 204 | - // 圆形半径 | |
| 205 | - params.radius = '100'; | |
| 206 | - // 限速 | |
| 207 | - params.speedLimit = '60'; | |
| 208 | - // 图形类型(r:圆形;p:多边形) | |
| 209 | - params.shapesType = 'r'; | |
| 210 | - // destroy:是否撤销 | |
| 211 | - params.destroy = '0'; | |
| 212 | - // versions:版本号 | |
| 213 | - params.versions = '1'; | |
| 214 | - map.lineInfoPanl(lineNameV,directionData,function(BusLine){ | |
| 215 | - // 如果线路信息不为空 | |
| 216 | - if(BusLine && Polygon){ | |
| 217 | - // 获取公交线几何对象, 仅当结果自动添加到地图上时有效 | |
| 142 | + params.lineId = properties.lineId; | |
| 143 | + params.versions = properties.versions; | |
| 144 | + params.directions = properties.directions; | |
| 145 | + params.stationJSON = resultJson; | |
| 146 | + RoutesOperation.lineInfoPanl(lineNameV, directionData, function(BusLine) { | |
| 147 | + if (BusLine && Polygon){ | |
| 218 | 148 | var Polygon = BusLine.getPolyline(); |
| 219 | - // 返回多边型的点数组(自1.2新增) | |
| 220 | 149 | var polyGonArray = Polygon.getPath(); |
| 221 | - var jsonArray = [{sectionName:lineNameV+dirStr,points:polyGonArray}]; | |
| 222 | - // 定义路段信息字符串 | |
| 223 | - var sectionJSON = JSON.stringify(jsonArray); | |
| 224 | - // 路段信息JSON字符串 | |
| 225 | - // if(sectionJSON != null && sectionJSON != "") { | |
| 226 | - params.sectionJSON = sectionJSON; | |
| 227 | - addSave(params,addLine.id,directionData); | |
| 228 | - /* } else { | |
| 229 | - layer.msg('百度地图上没有此线路的相应路段,请更换方式规划!!!'); | |
| 230 | - } */ | |
| 231 | - }else { | |
| 232 | - // 根据坐标点获取两点之间的折线路段 | |
| 233 | - map.getSectionListPlonly(stationdataList,function(sectiondata) { | |
| 234 | - // 定义路段信息字符串 | |
| 235 | - var sectionJSON = JSON.stringify(sectiondata); | |
| 236 | - // 路段信息JSON字符串 | |
| 237 | - //if(sectionJSON != null && sectionJSON != "") { | |
| 238 | - params.sectionJSON = sectionJSON; | |
| 239 | - addSave(params,addLine.id,directionData); | |
| 240 | - /* } else { | |
| 241 | - layer.msg('无法生成路段,请重试!'); | |
| 242 | - return; | |
| 243 | - } */ | |
| 150 | + var jsonArray = [{sectionName: lineNameV+dirStr, points: polyGonArray}]; | |
| 151 | + params.sectionJSON = jsonArray; | |
| 152 | + addSave(params, properties.lineId, directionData); | |
| 153 | + } else { | |
| 154 | + RoutesOperation.getSectionListPlonly(stationdataList,function(sectiondata) { | |
| 155 | + params.sectionJSON = sectiondata; | |
| 156 | + addSave(params, properties.lineId, directionData); | |
| 244 | 157 | }); |
| 245 | 158 | } |
| 246 | 159 | }); |
| 247 | - | |
| 248 | 160 | }); |
| 249 | - | |
| 250 | 161 | }); |
| 251 | - | |
| 252 | 162 | } |
| 253 | - | |
| 254 | 163 | }); |
| 255 | 164 | |
| 256 | 165 | function inputStationValueFormat(paramsStationsArray) { |
| 257 | 166 | var stationList = []; |
| 258 | 167 | var len = paramsStationsArray.length; |
| 259 | - for(var k =0;k<len;k++) { | |
| 260 | - if(paramsStationsArray[k]=="") | |
| 168 | + for (var k = 0;k < len;k++) { | |
| 169 | + if (paramsStationsArray[k] == "") { | |
| 261 | 170 | continue; |
| 171 | + } | |
| 262 | 172 | var tempStr = paramsStationsArray[k].split('\t'); |
| 263 | - if(tempStr.length<2){ | |
| 264 | - stationList.push({name:paramsStationsArray[k]+"公交车站",wgs:{x:'',y:''}}); | |
| 265 | - }else { | |
| 266 | - stationList.push({name:tempStr[0]+"公交车站",wgs:{x:tempStr[1], y:tempStr[2]}}); | |
| 173 | + if (tempStr.length < 2) { | |
| 174 | + stationList.push({name: paramsStationsArray[k]+"公交车站", wgs: {x: '',y: ''}}); | |
| 175 | + } else { | |
| 176 | + stationList.push({name: tempStr[0]+"公交车站", wgs: {x: tempStr[1], y: tempStr[2]}}); | |
| 267 | 177 | } |
| 268 | 178 | } |
| 179 | + | |
| 269 | 180 | return stationList; |
| 270 | 181 | } |
| 271 | 182 | |
| 272 | - function addSave(params,lineid,directionData) { | |
| 273 | - | |
| 274 | - | |
| 275 | - var version = $("#versions").val(); | |
| 276 | - params.versions = version; | |
| 277 | - // 保存 | |
| 278 | - ajaxd.manualSave(params,function(rd) { | |
| 279 | - // 关闭弹出层 | |
| 183 | + function addSave(params, lineId, directionData) { | |
| 184 | + debugger; | |
| 185 | + // 参数集合 | |
| 186 | + if (!params.versions) { | |
| 187 | + params.versions = '1'; | |
| 188 | + } | |
| 189 | + formatRoutes(params); | |
| 190 | + //return; | |
| 191 | + RoutesService.manualSave(params, function(res) { | |
| 280 | 192 | layer.closeAll(); |
| 281 | - if(rd.status='SUCCESS') { | |
| 193 | + if (res.status == 'SUCCESS') { | |
| 282 | 194 | layer.msg('保存成功!'); |
| 283 | - var stationD = rd.stationData,isNullStr = ''; | |
| 284 | - for(var t = 0 ;t<stationD.length;t++) { | |
| 285 | - if(stationD[t].potion.lat =='' || stationD[t].potion.lat ==null || | |
| 286 | - stationD[t].potion.lng =='' || stationD[t].potion.lng ==null) | |
| 287 | - isNullStr = isNullStr + stationD[t].name + ' , '; | |
| 288 | - } | |
| 289 | - if(isNullStr!='') { | |
| 290 | - layer.open({ | |
| 291 | - title: '提示', | |
| 292 | - content:'【' + isNullStr + '】' + '地址系统无法解析!,请手动调整位置!' | |
| 293 | - }); | |
| 294 | - } | |
| 295 | - }else { | |
| 195 | + } else { | |
| 296 | 196 | layer.msg('保存失败!'); |
| 297 | 197 | } |
| 298 | - // 清除地图覆盖物 | |
| 299 | - map.clearMarkAndOverlays(); | |
| 300 | - // 刷新树 | |
| 301 | - fun.resjtreeDate(lineid,directionData,version); | |
| 302 | - | |
| 303 | - | |
| 304 | - //PublicFunctions.resjtreeDate(lineid,directionData,version); | |
| 305 | - // 查询上行路段信息 | |
| 306 | - //ajaxd.getSectionRouteInfo(lineid,directionData,version,function(data) { | |
| 307 | - // // 在地图上画出线路走向 | |
| 308 | - // fun.linePanlThree(lineid,data,directionData,version); | |
| 309 | - //}); | |
| 198 | + RoutesOperation.clearMarkAndOverlays(); | |
| 199 | + RoutesOperation.resjtreeDate(lineId, directionData, params.versions); | |
| 310 | 200 | }); |
| 311 | 201 | } |
| 202 | + | |
| 203 | + function formatRoutes(params) { | |
| 204 | + var stationRoutes = [], sectionRoutes = [], sectionRouteCode = 100; | |
| 205 | + params.stationJSON.forEach(function(item) { | |
| 206 | + stationRoutes.push({stationName: item.name, shapedType: 'r', radius: 80, destroy: 0, distances: 0, toTime: 0, station: {stationName: item.name, centerPointWkt: 'POINT(' + item.potion.lng + ' ' + item.potion.lat + ')'}}); | |
| 207 | + }) | |
| 208 | + params.sectionJSON.forEach(function(item) { | |
| 209 | + var centerPointWkt = []; | |
| 210 | + item.points.forEach(function(item1) { | |
| 211 | + centerPointWkt.push(item1.lng + ' ' + item1.lat); | |
| 212 | + }) | |
| 213 | + sectionRoutes.push({sectionrouteCode: sectionRouteCode, destroy: 0, section: {sectionName: item.sectionName, bsectionVectorWkt: 'LINESTRING(' + centerPointWkt.join(',') + ')'}}); | |
| 214 | + sectionRouteCode++; | |
| 215 | + }) | |
| 216 | + params.stationRoutes = stationRoutes; | |
| 217 | + params.sectionRoutes = sectionRoutes; | |
| 218 | + } | |
| 312 | 219 | }); |
| 313 | 220 | </script> |
| 314 | 221 | \ No newline at end of file | ... | ... |
src/main/resources/static/pages/base/stationroute/destroy_sectionroute.html
| ... | ... | @@ -174,6 +174,7 @@ $('#delete_section_modal').on('modal.show',function(event) { |
| 174 | 174 | var params = {}; |
| 175 | 175 | params['line.id_eq'] = properties.lineId; |
| 176 | 176 | params.directions_eq = properties.directions; |
| 177 | + params.versions_eq = properties.versions; | |
| 177 | 178 | params.destroy_eq = 0; |
| 178 | 179 | |
| 179 | 180 | return params; |
| ... | ... | @@ -200,8 +201,6 @@ $('#delete_section_modal').on('modal.show',function(event) { |
| 200 | 201 | // 记录当前页数 |
| 201 | 202 | params['page'] = page; |
| 202 | 203 | |
| 203 | - params.versions_eq = properties.versions; | |
| 204 | - | |
| 205 | 204 | // 弹出正在加载层 |
| 206 | 205 | var i = layer.load(2); |
| 207 | 206 | // 异步请求获取表格数据 | ... | ... |
src/main/resources/static/pages/base/stationroute/destroy_stationroute.html
| ... | ... | @@ -175,6 +175,7 @@ $('#delete_station_modal').on('modal.show',function(event) { |
| 175 | 175 | var params = {}; |
| 176 | 176 | params['line.id_eq'] = properties.lineId; |
| 177 | 177 | params.directions_eq = properties.directions; |
| 178 | + params.versions_eq = properties.versions; | |
| 178 | 179 | params.destroy_eq = 0; |
| 179 | 180 | |
| 180 | 181 | return params; |
| ... | ... | @@ -200,8 +201,7 @@ $('#delete_station_modal').on('modal.show',function(event) { |
| 200 | 201 | params['direction'] = 'ASC,ASC'; |
| 201 | 202 | // 记录当前页数 |
| 202 | 203 | params['page'] = page; |
| 203 | - | |
| 204 | - params.versions_eq = properties.versions; | |
| 204 | + | |
| 205 | 205 | // 弹出正在加载层 |
| 206 | 206 | var i = layer.load(2); |
| 207 | 207 | // 异步请求获取表格数据 | ... | ... |
src/main/resources/static/pages/base/stationroute/doublename_road.html
| ... | ... | @@ -41,7 +41,7 @@ |
| 41 | 41 | <script type="text/javascript"> |
| 42 | 42 | $('#doublename_road_modal').on('modal.show', function(event, params){ |
| 43 | 43 | var properties = RoutesOperation.getProperties(); |
| 44 | - RoutesService.getStation(properties.lineId, properties.directions, properties.versions, function(routes) { | |
| 44 | + RoutesService.findRoutes(properties.lineId, properties.directions, properties.versions, function(routes) { | |
| 45 | 45 | var array = routes.sectionRoutes, paramsD = new Array(); |
| 46 | 46 | paramsD.push({'id':'启始路段(默认在所有路段的前面)','text':'启始路段(默认在所有路段的前面)'}); |
| 47 | 47 | var endRoad = 0; | ... | ... |
src/main/resources/static/pages/base/stationroute/edit_line_region.html
0 → 100644
| 1 | +<style> | |
| 2 | + .tab_station { | |
| 3 | + background-color: #ffffff; | |
| 4 | + height: 300px; | |
| 5 | + padding-left: 3px; | |
| 6 | + padding-right: 3px; | |
| 7 | + } | |
| 8 | + | |
| 9 | + .tab_station .center { | |
| 10 | + color: #3f444a; | |
| 11 | + padding-top: 10px; | |
| 12 | + } | |
| 13 | + | |
| 14 | + .tab_station .panel-wrap { | |
| 15 | + height: 100%; | |
| 16 | + padding-left: 3px; | |
| 17 | + padding-right: 3px; | |
| 18 | + } | |
| 19 | + | |
| 20 | + .tab_station .panel-wrap ._panel { | |
| 21 | + border: 1px solid #ddd; | |
| 22 | + box-shadow: 0 2px 5px 0 rgba(221, 221, 221, 0.32), 0 2px 10px 0 | |
| 23 | + rgba(221, 221, 221, 0.32); | |
| 24 | + width: 100%; | |
| 25 | + height: 100%; | |
| 26 | + position: relative; | |
| 27 | + } | |
| 28 | + | |
| 29 | + .tab_station .panel-wrap ._panel ._head { | |
| 30 | + height: 42px; | |
| 31 | + line-height: 42px; | |
| 32 | + padding-left: 15px; | |
| 33 | + font-size: 16px; | |
| 34 | + font-family: 微软雅黑; | |
| 35 | + color: #2765A7; | |
| 36 | + border-bottom: 1px solid #dddddd; | |
| 37 | + } | |
| 38 | + | |
| 39 | + .table-body { | |
| 40 | + height: 228px; | |
| 41 | + overflow-y: auto; | |
| 42 | + position: relative; | |
| 43 | + } | |
| 44 | + | |
| 45 | + .center { | |
| 46 | + line-height: 3; | |
| 47 | + position: absolute; | |
| 48 | + padding-left: initial; | |
| 49 | + top: 50%; | |
| 50 | + left: 50%; | |
| 51 | + width: 50%; | |
| 52 | + -webkit-transform: translateX(-50%) translateY(-50%); | |
| 53 | + text-align: center; | |
| 54 | + } | |
| 55 | + .center li { | |
| 56 | + list-style-type: none; | |
| 57 | + } | |
| 58 | + dl { | |
| 59 | + display: block; | |
| 60 | + margin: 0px; | |
| 61 | + height: 30px; | |
| 62 | + border-bottom: 1px solid #dddddd; | |
| 63 | + } | |
| 64 | + dl dt { | |
| 65 | + display: inline-block; | |
| 66 | + font-size: 14px; | |
| 67 | + white-space: nowrap; | |
| 68 | + overflow: hidden; | |
| 69 | + text-overflow: ellipsis; | |
| 70 | + border-left: 1px solid #dddddd; | |
| 71 | + text-indent: 5px; | |
| 72 | + text-align: center; | |
| 73 | + height: 30px; | |
| 74 | + } | |
| 75 | + dl dd { | |
| 76 | + display: inline-block; | |
| 77 | + font-size: 14px; | |
| 78 | + white-space: nowrap; | |
| 79 | + overflow: hidden; | |
| 80 | + text-overflow: ellipsis; | |
| 81 | + border-left: 1px solid #dddddd; | |
| 82 | + text-indent: 5px; | |
| 83 | + text-align: center; | |
| 84 | + height: 30px; | |
| 85 | + line-height: 30px; | |
| 86 | + } | |
| 87 | + dt:nth-of-type(1), dd:nth-of-type(1){ | |
| 88 | + width: 10%; | |
| 89 | + } | |
| 90 | + dt:nth-of-type(2), dd:nth-of-type(2){ | |
| 91 | + width: 60%; | |
| 92 | + } | |
| 93 | + dt:nth-of-type(3), dd:nth-of-type(3){ | |
| 94 | + width: 25%; | |
| 95 | + } | |
| 96 | + | |
| 97 | + | |
| 98 | +</style> | |
| 99 | +<div class="modal fade" id="edit_line_region_modal" tabindex="-1" role="basic" aria-hidden="true" style="min-width: 800px;"> | |
| 100 | + <div class="modal-dialog"> | |
| 101 | + <div class="modal-content" > | |
| 102 | + | |
| 103 | + <div class="modal-header"> | |
| 104 | + <button type="button" class="close" data-dismiss="modal" aria-hidden="true"></button> | |
| 105 | + <h4 class="modal-title">选择站点</h4> | |
| 106 | + </div> | |
| 107 | + | |
| 108 | + <div class="modal-body"> | |
| 109 | + <form class="form-horizontal" role="form" id="edit_line_region_form" action="" method=""> | |
| 110 | + <input type="hidden" name="id"/> | |
| 111 | + <input type="hidden" name="seq"/> | |
| 112 | + <div class="alert alert-danger display-hide"> | |
| 113 | + <button class="close" data-close="alert"></button> | |
| 114 | + 您的输入有误,请检查下面的输入项 | |
| 115 | + </div> | |
| 116 | + <!-- 站点名称 --> | |
| 117 | + <div class="form-body"> | |
| 118 | + <div class="form-group"> | |
| 119 | + <label class="control-label col-md-2"> | |
| 120 | + <span class="required"> * </span> 区间别名 | |
| 121 | + </label> | |
| 122 | + <div class="col-md-4"> | |
| 123 | + <input class="form-control" name="regionAlias" id="regionAliasInput" placeholder="输入区间别名"/> | |
| 124 | + </div> | |
| 125 | + <label class="control-label col-md-2"> | |
| 126 | + 上下行 | |
| 127 | + </label> | |
| 128 | + <div class="col-md-4"> | |
| 129 | + <select class="form-control" name="direction" id="directionSelect"> | |
| 130 | + <option value="0">上行</option> | |
| 131 | + <option value="1">下行</option> | |
| 132 | + <!--<option value="">上行+下行</option>--> | |
| 133 | + </select> | |
| 134 | + </div> | |
| 135 | + </div> | |
| 136 | + <div class="form-group tab_station"> | |
| 137 | + <div class="col-md-5 panel-wrap" style="height: 100%;"> | |
| 138 | + <div class="_panel"> | |
| 139 | + <div class="_head">待选站点列表</div> | |
| 140 | + <div class="table-container" id="left"> | |
| 141 | + <dl> | |
| 142 | + <dt>#</dt> | |
| 143 | + <dt>站点</dt> | |
| 144 | + <dt title="上下行">上下行</dt> | |
| 145 | + </dl> | |
| 146 | + <div class="table-body"></div> | |
| 147 | + </div> | |
| 148 | + </div> | |
| 149 | + </div> | |
| 150 | + <div class="col-md-2" style="height: 100%;"> | |
| 151 | + <ul class="center"> | |
| 152 | + <li><a class="btn btn-circle blue btn-outline" id="toRight">>></a></li> | |
| 153 | + <li><a class="btn btn-circle blue btn-outline" id="toLeft"><<</a></li> | |
| 154 | + </ul> | |
| 155 | + </div> | |
| 156 | + <div class="col-md-5 panel-wrap" style="height: 100%;"> | |
| 157 | + <div class="_panel"> | |
| 158 | + <div class="_head" style="color: #2765A7;">已选站点列表</div> | |
| 159 | + <div class="table-container" id="right"> | |
| 160 | + <dl> | |
| 161 | + <dt>#</dt> | |
| 162 | + <dt>站点</dt> | |
| 163 | + <dt title="上下行">上下行</dt> | |
| 164 | + </dl> | |
| 165 | + <div class="table-body"></div> | |
| 166 | + </div> | |
| 167 | + </div> | |
| 168 | + </div> | |
| 169 | + </div> | |
| 170 | + </div> | |
| 171 | + </form> | |
| 172 | + </div> | |
| 173 | + <div class="modal-footer"> | |
| 174 | + <button type="button" class="btn btn-primary" id="regionSaveBtn">提交</button> | |
| 175 | + <button type="button" class="btn default" data-dismiss="modal">取消</button> | |
| 176 | + </div> | |
| 177 | + </div> | |
| 178 | + </div> | |
| 179 | +</div> | |
| 180 | +<script id="edit_line_region_station_table_template" type="text/html"> | |
| 181 | + {{each list as obj i}} | |
| 182 | + <dl data-idx="{{i}}" data-id="{{obj.id}}"> | |
| 183 | + <dd class="seq"> | |
| 184 | + {{i+1}} | |
| 185 | + </dd> | |
| 186 | + <dd> | |
| 187 | + {{obj.stationName}} | |
| 188 | + </dd> | |
| 189 | + <dd> | |
| 190 | + {{if obj.directions == 0}} | |
| 191 | + 上行 | |
| 192 | + {{else}} | |
| 193 | + 下行 | |
| 194 | + {{/if}} | |
| 195 | + </dd> | |
| 196 | + </dl> | |
| 197 | + {{/each}} | |
| 198 | +</script> | |
| 199 | +<script type="text/javascript"> | |
| 200 | + var stationRoutes = [], lineRegion = {}, properties = RoutesOperation.getProperties(); | |
| 201 | + | |
| 202 | + function setForm() { | |
| 203 | + $('input[name=id]').val(lineRegion.id); | |
| 204 | + $('input[name=seq]').val(lineRegion.seq); | |
| 205 | + $('#regionAliasInput').val(lineRegion.regionAlias); | |
| 206 | + $('#left .table-body dl').each(function() { | |
| 207 | + var dl = $(this), id = dl.data('id'); | |
| 208 | + lineRegion.stationRoutes.forEach(function (item) { | |
| 209 | + if (id == item.id) { | |
| 210 | + dl.click(); | |
| 211 | + } | |
| 212 | + }) | |
| 213 | + }) | |
| 214 | + } | |
| 215 | + | |
| 216 | + function render() { | |
| 217 | + var html = template('edit_line_region_station_table_template', {list : stationRoutes}); | |
| 218 | + $('#left .table-body').html(html); | |
| 219 | + $('#right .table-body').html(''); | |
| 220 | + $('#left .table-body dl').on('click', left2right); | |
| 221 | + $('#left .table-body').perfectScrollbar({suppressScrollX: true}) | |
| 222 | + $('#right .table-body').perfectScrollbar({suppressScrollX: true}) | |
| 223 | + } | |
| 224 | + | |
| 225 | + function left2right() { | |
| 226 | + $(this).remove(); | |
| 227 | + var idx = $(this).data('idx'); | |
| 228 | + $('#right .table-body').append($(this).prop('outerHTML')); | |
| 229 | + $('#right .table-body dl[data-idx=' + idx + ']').on('click', right2left); | |
| 230 | + $('#left .table-body').perfectScrollbar("update"); | |
| 231 | + $('#right .table-body').perfectScrollbar("update") | |
| 232 | + } | |
| 233 | + | |
| 234 | + function right2left() { | |
| 235 | + $(this).remove(); | |
| 236 | + var idx = $(this).data('idx'), first = $('#left .table-body dl').first(); | |
| 237 | + if (!first[0] || first.data('idx') > idx) { | |
| 238 | + $('#left .table-body').prepend($(this).prop('outerHTML')); | |
| 239 | + } else { | |
| 240 | + while (first.data('idx') < idx) { | |
| 241 | + var next = first.next(); | |
| 242 | + if (!next[0] || next.prop('tagName') != 'DL' || next.data('idx') > idx) { | |
| 243 | + first.after($(this).prop('outerHTML')); | |
| 244 | + break; | |
| 245 | + } else { | |
| 246 | + first = next; | |
| 247 | + } | |
| 248 | + } | |
| 249 | + } | |
| 250 | + $('#left .table-body dl[data-idx=' + idx + ']').on('click', left2right); | |
| 251 | + $('#left .table-body').perfectScrollbar("update"); | |
| 252 | + $('#right .table-body').perfectScrollbar("update") | |
| 253 | + } | |
| 254 | + | |
| 255 | + function all2right() { | |
| 256 | + $('#left .table-body dl').each(function() { | |
| 257 | + $(this).click(); | |
| 258 | + }) | |
| 259 | + } | |
| 260 | + | |
| 261 | + function all2left() { | |
| 262 | + $('#right .table-body dl').each(function() { | |
| 263 | + $(this).click(); | |
| 264 | + }) | |
| 265 | + } | |
| 266 | + | |
| 267 | + $('#edit_line_region_modal').on('modal.show', function(event, lr) { | |
| 268 | + lineRegion = lr; | |
| 269 | + $('#edit_line_region_modal').modal({show: true, backdrop: 'static', keyboard: false}); | |
| 270 | + }) | |
| 271 | + | |
| 272 | + $('#edit_line_region_modal').on('show.bs.modal', function () { | |
| 273 | + $('#directionSelect').val(lineRegion.direction); | |
| 274 | + RoutesService.findStationRoutes(RoutesOperation.getProperties().lineId, $('#directionSelect').val(), RoutesOperation.getProperties().versions, function (data) { | |
| 275 | + stationRoutes = data; | |
| 276 | + render(); | |
| 277 | + setForm(); | |
| 278 | + }) | |
| 279 | + }) | |
| 280 | + | |
| 281 | + $('#directionSelect').on('change', function () { | |
| 282 | + RoutesService.findStationRoutes(RoutesOperation.getProperties().lineId, $(this).val(), RoutesOperation.getProperties().versions, function (data) { | |
| 283 | + stationRoutes = data; | |
| 284 | + render(); | |
| 285 | + }) | |
| 286 | + }) | |
| 287 | + | |
| 288 | + $('#toRight').on('click', all2right); | |
| 289 | + | |
| 290 | + $('#toLeft').on('click', all2left); | |
| 291 | + | |
| 292 | + var form = $('#edit_line_region_form'); | |
| 293 | + var error = $('.alert-danger', form); | |
| 294 | + $('#regionSaveBtn').on('click', function() { | |
| 295 | + form.submit(); | |
| 296 | + }); | |
| 297 | + form.validate({ | |
| 298 | + errorElement : 'span', | |
| 299 | + errorClass : 'help-block help-block-error', | |
| 300 | + focusInvalid : false, | |
| 301 | + rules : { | |
| 302 | + 'regionAlias': {required: true, maxlength: 50} | |
| 303 | + }, | |
| 304 | + invalidHandler : function(event, validator) { | |
| 305 | + error.show(); | |
| 306 | + App.scrollTo(error, -200); | |
| 307 | + }, | |
| 308 | + highlight : function(element) { | |
| 309 | + $(element).closest('.form-group').addClass('has-error'); | |
| 310 | + }, | |
| 311 | + unhighlight : function(element) { | |
| 312 | + $(element).closest('.form-group').removeClass('has-error'); | |
| 313 | + }, | |
| 314 | + success : function(label) { | |
| 315 | + label.closest('.form-group').removeClass('has-error'); | |
| 316 | + }, | |
| 317 | + submitHandler : function(f) { | |
| 318 | + error.hide(); | |
| 319 | + var params = form.serializeJSON(), stationRouteIds = []; | |
| 320 | + $('#right .table-body dl').each(function() { | |
| 321 | + stationRouteIds.push(stationRoutes[$(this).data('idx')].id); | |
| 322 | + }) | |
| 323 | + params.stationRoutes = stationRouteIds.join(','); | |
| 324 | + params.line = properties.lineId; | |
| 325 | + params.version = properties.versions; | |
| 326 | + RoutesService.modifyLineRegion(params, function(res) { | |
| 327 | + if(res.status == 'SUCCESS') { | |
| 328 | + layer.msg('修改成功...'); | |
| 329 | + $('#regionDesign').click(); | |
| 330 | + }else { | |
| 331 | + layer.msg('修改失败...'); | |
| 332 | + } | |
| 333 | + $('#edit_line_region_modal').modal('hide'); | |
| 334 | + }); | |
| 335 | + } | |
| 336 | + }); | |
| 337 | +</script> | |
| 0 | 338 | \ No newline at end of file | ... | ... |
src/main/resources/static/pages/base/stationroute/edit_sectionroute.html
| ... | ... | @@ -59,7 +59,7 @@ $('#edit_sectionroute_modal').on('modal.show', function(e, polyline){ |
| 59 | 59 | var properties = RoutesOperation.getProperties(); |
| 60 | 60 | var sectionRoute = polyline.data; |
| 61 | 61 | RoutesOperation.setSectionFormValue(sectionRoute); |
| 62 | - RoutesService.getStation(properties.lineId, properties.directions, properties.versions, function(routes) { | |
| 62 | + RoutesService.findRoutes(properties.lineId, properties.directions, properties.versions, function(routes) { | |
| 63 | 63 | var array = routes.sectionRoutes, paramsD =new Array(); |
| 64 | 64 | var eq_scetionRouteCode = sectionRoute.sectionrouteCode; |
| 65 | 65 | var previous = '请选择...', last; | ... | ... |
src/main/resources/static/pages/base/stationroute/js/routes-operation.js
| 1 | 1 | var RoutesOperation = (function () { |
| 2 | 2 | var lineId, versions, directions = 0, status; |
| 3 | + var lineRegions = []; | |
| 3 | 4 | // 百度地图对象 |
| 4 | 5 | var baiduMap; |
| 5 | 6 | // 进出场路段编辑时当前选中的路段 |
| ... | ... | @@ -93,6 +94,8 @@ var RoutesOperation = (function () { |
| 93 | 94 | if (selected === 1) { |
| 94 | 95 | operation.TreeUpOrDown(lineId, '0', lineVersion.versions); |
| 95 | 96 | operation.TreeUpOrDown(lineId, '1', lineVersion.versions); |
| 97 | + versions = lineVersion.versions; | |
| 98 | + status = lineVersion.status; | |
| 96 | 99 | } |
| 97 | 100 | } |
| 98 | 101 | operation.setTiteText(lineId); |
| ... | ... | @@ -128,7 +131,8 @@ var RoutesOperation = (function () { |
| 128 | 131 | }); |
| 129 | 132 | }) |
| 130 | 133 | |
| 131 | - $("#versions").on('change', function() { | |
| 134 | + $('#versions').on('change', function() { | |
| 135 | + debugger | |
| 132 | 136 | versions = $(this).val(); |
| 133 | 137 | status = $('option:selected', $(this)).attr('status'); |
| 134 | 138 | $('#upLine').click(); |
| ... | ... | @@ -145,6 +149,14 @@ var RoutesOperation = (function () { |
| 145 | 149 | }); |
| 146 | 150 | |
| 147 | 151 | // 系统规划上行站点点击事件 |
| 152 | + $('.upManual').on('click',function() { | |
| 153 | + $.get('addstationstemplate.html', function(m){ | |
| 154 | + $(pjaxContainer).append(m); | |
| 155 | + $('#add_station_template_modal').trigger('modal.show'); | |
| 156 | + }); | |
| 157 | + }); | |
| 158 | + | |
| 159 | + // 系统规划上行站点点击事件 | |
| 148 | 160 | $('.upSystem').on('click',function() { |
| 149 | 161 | $('#upToolsMobal').hide(); |
| 150 | 162 | layer.load(0,{offset:['200px', '280px']}); |
| ... | ... | @@ -195,6 +207,14 @@ var RoutesOperation = (function () { |
| 195 | 207 | }); |
| 196 | 208 | }); |
| 197 | 209 | |
| 210 | + // 上行批量恢复事件 | |
| 211 | + $('.module_tools #upBatchRecover').on('click', function() { | |
| 212 | + $.get('recover_routes.html', function(m){ | |
| 213 | + $(pjaxContainer).append(m); | |
| 214 | + $('#recover_select_modal').trigger('modal.show'); | |
| 215 | + }); | |
| 216 | + }); | |
| 217 | + | |
| 198 | 218 | // 交换上下行站点和路段路由 |
| 199 | 219 | $('.retweet').on('click', function() { |
| 200 | 220 | layer.confirm('您是否确定将【上、下】行站点和路段进行对换!', { |
| ... | ... | @@ -218,7 +238,7 @@ var RoutesOperation = (function () { |
| 218 | 238 | }); |
| 219 | 239 | |
| 220 | 240 | $('#wrenchUpDis').on('click',function() { |
| 221 | - RoutesService.getStation(lineId, directions, versions, function(routes) { | |
| 241 | + RoutesService.findRoutes(lineId, directions, versions, function(routes) { | |
| 222 | 242 | $.get('tzzj.html', function(m){ |
| 223 | 243 | $(pjaxContainer).append(m); |
| 224 | 244 | $('#tzzj_mobal').trigger('modal.show', [routes.stationRoutes]); |
| ... | ... | @@ -227,7 +247,7 @@ var RoutesOperation = (function () { |
| 227 | 247 | }) |
| 228 | 248 | |
| 229 | 249 | $('#wrenchDownDis').on('click',function() { |
| 230 | - RoutesService.getStation(lineId, directions, versions, function(routes) { | |
| 250 | + RoutesService.findRoutes(lineId, directions, versions, function(routes) { | |
| 231 | 251 | $.get('tzzj.html', function(m){ |
| 232 | 252 | $(pjaxContainer).append(m); |
| 233 | 253 | $('#tzzj_mobal').trigger('modal.show', [routes.stationRoutes]); |
| ... | ... | @@ -275,6 +295,14 @@ var RoutesOperation = (function () { |
| 275 | 295 | operation.resjtreeDate(lineId, directions, versions); |
| 276 | 296 | }); |
| 277 | 297 | |
| 298 | + // 系统规划上行站点点击事件 | |
| 299 | + $('.downManual').on('click',function() { | |
| 300 | + $.get('addstationstemplate.html', function(m){ | |
| 301 | + $(pjaxContainer).append(m); | |
| 302 | + $('#add_station_template_modal').trigger('modal.show'); | |
| 303 | + }); | |
| 304 | + }); | |
| 305 | + | |
| 278 | 306 | // 系统规划下行站点 |
| 279 | 307 | $('.downSystem').on('click',function() { |
| 280 | 308 | $('#downToolsMobal').hide(); |
| ... | ... | @@ -318,6 +346,14 @@ var RoutesOperation = (function () { |
| 318 | 346 | }); |
| 319 | 347 | }); |
| 320 | 348 | |
| 349 | + // 下行批量恢复事件 | |
| 350 | + $('.module_tools #downBatchRecover').on('click', function() { | |
| 351 | + $.get('recover_routes.html', function(m){ | |
| 352 | + $(pjaxContainer).append(m); | |
| 353 | + $('#recover_select_modal').trigger('modal.show'); | |
| 354 | + }); | |
| 355 | + }); | |
| 356 | + | |
| 321 | 357 | // 编辑线路下行走向 @弃用 |
| 322 | 358 | /*$('.module_tools #editDownlineTrend').on('click', function() { |
| 323 | 359 | PublicFunctions.editLinePlan(directionDownValue); |
| ... | ... | @@ -363,6 +399,46 @@ var RoutesOperation = (function () { |
| 363 | 399 | operation.resjtreeDate(lineId, directions, versions); |
| 364 | 400 | }) |
| 365 | 401 | }) |
| 402 | + | |
| 403 | + $('#regionDesign').on('click', function() { | |
| 404 | + operation.loadLineRegion(); | |
| 405 | + }) | |
| 406 | + | |
| 407 | + $('#regionSelect').on('change', function() { | |
| 408 | + var stationRoutes = lineRegions[$(this).val()].stationRoutes; | |
| 409 | + $('#region-station-body-table').html(template('line-region-station-template', {list: stationRoutes})); | |
| 410 | + RoutesService.findSectionRoutes(lineId, directions, versions, function(sectionRoutes) { | |
| 411 | + operation.clearMarkAndOverlays(); | |
| 412 | + if (stationRoutes.length > 0) { | |
| 413 | + var centerPointWkt = stationRoutes[0].station.centerPointWkt; | |
| 414 | + centerPointWkt = centerPointWkt.substring(6, centerPointWkt.length - 1); | |
| 415 | + var coordinates = centerPointWkt.split(' '); | |
| 416 | + //center = new BMap.Point(coordinates[0], coordinates[1]); | |
| 417 | + for (var i = 0;i < stationRoutes.length;i++) { | |
| 418 | + operation.drawingUpStationPoint(stationRoutes[i], i + 1); | |
| 419 | + } | |
| 420 | + } | |
| 421 | + if (sectionRoutes.length > 0) { | |
| 422 | + operation.drawingUpline01(sectionRoutes); | |
| 423 | + } | |
| 424 | + }) | |
| 425 | + }) | |
| 426 | + | |
| 427 | + // 区间添加 | |
| 428 | + $('#regionAddBtn').on('click', function () { | |
| 429 | + $.get('add_line_region.html', function (m) { | |
| 430 | + $(pjaxContainer).append(m); | |
| 431 | + $('#add_line_region_modal').trigger('modal.show'); | |
| 432 | + }); | |
| 433 | + }) | |
| 434 | + | |
| 435 | + // 区间编辑 | |
| 436 | + $('#regionEditBtn').on('click', function () { | |
| 437 | + $.get('edit_line_region.html', function (m) { | |
| 438 | + $(pjaxContainer).append(m); | |
| 439 | + $('#edit_line_region_modal').trigger('modal.show', lineRegions[$('#regionSelect').val()]); | |
| 440 | + }); | |
| 441 | + }) | |
| 366 | 442 | }, |
| 367 | 443 | |
| 368 | 444 | /***************************************************map*******************************************************/ |
| ... | ... | @@ -710,11 +786,11 @@ var RoutesOperation = (function () { |
| 710 | 786 | function searchComplete(results) { |
| 711 | 787 | var plan = results.getPlan(0); |
| 712 | 788 | if (transit.getStatus() != BMAP_STATUS_SUCCESS) { |
| 713 | - stationList[index + 1].distance = ''; | |
| 714 | - stationList[index + 1].duration = ''; | |
| 789 | + stationList[index + 1].distance = 0; | |
| 790 | + stationList[index + 1].duration = 0; | |
| 715 | 791 | } else { |
| 716 | - stationList[index + 1].distance = plan.getDistance(true); | |
| 717 | - stationList[index + 1].duration = plan.getDuration(true); | |
| 792 | + stationList[index + 1].distance = 0;//plan.getDistance(true); | |
| 793 | + stationList[index + 1].duration = 0;//plan.getDuration(true); | |
| 718 | 794 | } |
| 719 | 795 | f(); |
| 720 | 796 | } |
| ... | ... | @@ -1591,6 +1667,16 @@ var RoutesOperation = (function () { |
| 1591 | 1667 | } |
| 1592 | 1668 | }); |
| 1593 | 1669 | }, |
| 1670 | + /** | |
| 1671 | + * 从百度地图抓去站点与路段数据 | |
| 1672 | + */ | |
| 1673 | + lineInfoPanl : function(lineNameValue,i,cb) { | |
| 1674 | + /** 根据线路名称与方向从百度地图获取站点与路段 @param lineNameValue:线路名称;i:方向<0:上行;1:下行> */ | |
| 1675 | + operation.getBmapStationNames(lineNameValue,i,function(BusLine){ | |
| 1676 | + return cb && cb(BusLine); | |
| 1677 | + }); | |
| 1678 | + | |
| 1679 | + }, | |
| 1594 | 1680 | /** 获取距离与时间 @param <points:坐标点集合> */ |
| 1595 | 1681 | getDistanceAndDuration : function(stations,callback){ |
| 1596 | 1682 | var stationRoutes = new Array(); |
| ... | ... | @@ -2124,7 +2210,7 @@ var RoutesOperation = (function () { |
| 2124 | 2210 | } |
| 2125 | 2211 | |
| 2126 | 2212 | // 获取树数据 |
| 2127 | - RoutesService.getStation(id, direction, version, function(routes) { | |
| 2213 | + RoutesService.findRoutes(id, direction, version, function(routes) { | |
| 2128 | 2214 | // 获取数据长度 |
| 2129 | 2215 | var len = routes.stationRoutes.length; |
| 2130 | 2216 | // 上行 |
| ... | ... | @@ -2372,7 +2458,7 @@ var RoutesOperation = (function () { |
| 2372 | 2458 | /** 加载树 @param:<lineId:线路ID;direction:方向(0:上行;1:下行)> */ |
| 2373 | 2459 | TreeUpOrDown : function(lineId,direction,version) { |
| 2374 | 2460 | /** 获取树结果数据 @param:<lineId:线路ID;direction:方向;callback:回调函数> */ |
| 2375 | - RoutesService.getStation(lineId,direction,version,function(result) { | |
| 2461 | + RoutesService.findRoutes(lineId,direction,version,function(result) { | |
| 2376 | 2462 | var len = result.stationRoutes.length; |
| 2377 | 2463 | if(direction == 0) { |
| 2378 | 2464 | operation.upInit(result); |
| ... | ... | @@ -2447,6 +2533,23 @@ var RoutesOperation = (function () { |
| 2447 | 2533 | return srStr; |
| 2448 | 2534 | }, |
| 2449 | 2535 | |
| 2536 | + /** | |
| 2537 | + * 加载线路区间 | |
| 2538 | + */ | |
| 2539 | + loadLineRegion: function() { | |
| 2540 | + RoutesService.findLineRegion(lineId, versions, function(res) { | |
| 2541 | + lineRegions = res; | |
| 2542 | + var html = []; | |
| 2543 | + if (lineRegions.length > 0) { | |
| 2544 | + lineRegions.forEach(function (item, idx) { | |
| 2545 | + html.push('<option value="', idx, '">', item.regionAlias, '(', item.seq, ')</option>'); | |
| 2546 | + }) | |
| 2547 | + $('#regionSelect').html(html.join('')); | |
| 2548 | + $('#regionSelect').trigger('change'); | |
| 2549 | + } | |
| 2550 | + }) | |
| 2551 | + }, | |
| 2552 | + | |
| 2450 | 2553 | /***************************************************drawingmanager*******************************************************/ |
| 2451 | 2554 | initStationDrawingManager: function() { |
| 2452 | 2555 | stationDrawingManager = new BMapLib.DrawingManager(baiduMap, polygonDmOptions); | ... | ... |
src/main/resources/static/pages/base/stationroute/js/routes-service.js
| ... | ... | @@ -24,14 +24,40 @@ var RoutesService = (function(){ |
| 24 | 24 | * @param version |
| 25 | 25 | * @param callback |
| 26 | 26 | */ |
| 27 | - getStation: function(id_,dir_,version,callback) { | |
| 28 | - $get('/stationroute/findStations', {'line.id_eq': id_ , 'directions_eq': dir_, 'versions_eq': version}, function(result) { | |
| 27 | + findRoutes: function(id_,dir_,version,callback) { | |
| 28 | + $get('/api/lsstationroute/findRoutes', {'line.id_eq': id_ , 'directions_eq': dir_, 'versions_eq': version}, function(result) { | |
| 29 | 29 | callback && callback(result); |
| 30 | 30 | }); |
| 31 | 31 | }, |
| 32 | 32 | |
| 33 | 33 | /** |
| 34 | 34 | * 获取站点路由信息 |
| 35 | + * @param id_ | |
| 36 | + * @param dir_ | |
| 37 | + * @param version | |
| 38 | + * @param callback | |
| 39 | + */ | |
| 40 | + findStationRoutes: function(id_,dir_,version,callback) { | |
| 41 | + $get('/api/lsstationroute/findStationRoutes', {'line.id_eq': id_ , 'directions_eq': dir_, 'versions_eq': version}, function(result) { | |
| 42 | + callback && callback(result); | |
| 43 | + }); | |
| 44 | + }, | |
| 45 | + | |
| 46 | + /** | |
| 47 | + * 获取路段路由信息 | |
| 48 | + * @param id_ | |
| 49 | + * @param dir_ | |
| 50 | + * @param version | |
| 51 | + * @param callback | |
| 52 | + */ | |
| 53 | + findSectionRoutes: function(id_,dir_,version,callback) { | |
| 54 | + $get('/api/lssectionroute/findSectionRoutes', {'line.id_eq': id_ , 'directions_eq': dir_, 'versions_eq': version}, function(result) { | |
| 55 | + callback && callback(result); | |
| 56 | + }); | |
| 57 | + }, | |
| 58 | + | |
| 59 | + /** | |
| 60 | + * 获取站点路由信息 | |
| 35 | 61 | * @param params |
| 36 | 62 | * @param callback |
| 37 | 63 | */ |
| ... | ... | @@ -354,7 +380,34 @@ var RoutesService = (function(){ |
| 354 | 380 | * @param callback |
| 355 | 381 | */ |
| 356 | 382 | saveGeoPremise: function (params, callback) { |
| 357 | - $post('/api/geopremise/', params, function(res) { | |
| 383 | + $post('/api/geopremise/', params, function (res) { | |
| 384 | + }) | |
| 385 | + }, | |
| 386 | + | |
| 387 | + findLineRegion: function(lineId, version, callback) { | |
| 388 | + $get('/api/lineregion/all', {line_eq: lineId, version_eq: version}, function(res) { | |
| 389 | + callback && callback(res); | |
| 390 | + }) | |
| 391 | + }, | |
| 392 | + | |
| 393 | + /** | |
| 394 | + * 添加线路区间 | |
| 395 | + * @param params | |
| 396 | + * @param callback | |
| 397 | + */ | |
| 398 | + addLineRegion: function(params, callback) { | |
| 399 | + $post('/api/lineregion/add', params, function(res) { | |
| 400 | + callback && callback(res); | |
| 401 | + }) | |
| 402 | + }, | |
| 403 | + | |
| 404 | + /** | |
| 405 | + * 变更线路区间 | |
| 406 | + * @param params | |
| 407 | + * @param callback | |
| 408 | + */ | |
| 409 | + modifyLineRegion: function(params, callback) { | |
| 410 | + $post('/api/lineregion/modify', params, function(res) { | |
| 358 | 411 | callback && callback(res); |
| 359 | 412 | }) |
| 360 | 413 | } | ... | ... |
src/main/resources/static/pages/base/stationroute/list.html
| 1 | 1 | <link href="/pages/base/stationroute/css/bmap_base.css" rel="stylesheet" type="text/css" /> |
| 2 | 2 | <link rel="stylesheet" href="/assets/plugins/layer-v2.4/layer/skin/layer.css"> |
| 3 | +<style> | |
| 4 | + .region-station-head td { | |
| 5 | + height: 42px; | |
| 6 | + line-height: 42px; | |
| 7 | + font-size: 16px; | |
| 8 | + white-space: nowrap; | |
| 9 | + overflow: hidden; | |
| 10 | + text-overflow: ellipsis; | |
| 11 | + font-family: 微软雅黑; | |
| 12 | + color: #2765A7; | |
| 13 | + text-align: center; | |
| 14 | + } | |
| 15 | + | |
| 16 | + .region-station-body td { | |
| 17 | + display: inline-block; | |
| 18 | + font-size: 14px; | |
| 19 | + white-space: nowrap; | |
| 20 | + overflow: hidden; | |
| 21 | + text-overflow: ellipsis; | |
| 22 | + border-bottom: 1px solid #dddddd; | |
| 23 | + text-indent: 5px; | |
| 24 | + text-align: center; | |
| 25 | + height: 30px; | |
| 26 | + line-height: 30px; | |
| 27 | + } | |
| 28 | + | |
| 29 | + .region-station-body::-webkit-scrollbar { /*滚动条整体样式*/ | |
| 30 | + width: 1px; | |
| 31 | + } | |
| 32 | + .region-station-body::-webkit-scrollbar-button{ | |
| 33 | + display: none; | |
| 34 | + } | |
| 35 | + .region-station-body::-webkit-scrollbar-thumb{ | |
| 36 | + border-radius: 20px; | |
| 37 | + background: rgba(0,0,0,0.3); | |
| 38 | + } | |
| 39 | + .region-station-body::-webkit-scrollbar-track{ | |
| 40 | + background: #edca95; | |
| 41 | + } | |
| 42 | +</style> | |
| 3 | 43 | |
| 4 | 44 | <div class="mian-portlet-body"> |
| 5 | 45 | <!-- 地图 --> |
| ... | ... | @@ -54,6 +94,9 @@ |
| 54 | 94 | <!--<li class=""> |
| 55 | 95 | <a href="#inoutCarpark" data-toggle="tab" id="inoutLine" aria-expanded="false"> 进出场路径 </a> |
| 56 | 96 | </li>--> |
| 97 | + <!--<li class=""> | |
| 98 | + <a href="#regionDesignTab" data-toggle="tab" id="regionDesign" aria-expanded="false"> 线路区间规划 </a> | |
| 99 | + </li>--> | |
| 57 | 100 | </ul> |
| 58 | 101 | </div> |
| 59 | 102 | <div class="col-md-9 col-sm-9 col-xs-9"> |
| ... | ... | @@ -98,6 +141,10 @@ |
| 98 | 141 | </li> |
| 99 | 142 | <li class="divider"> </li> |
| 100 | 143 | <li> |
| 144 | + <a href="javascript:;" id="upBatchRecover"><i class="fa fa-recycle"></i> 批量恢复</a> | |
| 145 | + </li> | |
| 146 | + <li class="divider"> </li> | |
| 147 | + <li> | |
| 101 | 148 | <a href="javascript:;" class="retweet"><i class="fa fa-retweet"></i> 切换上下行</a> |
| 102 | 149 | </li> |
| 103 | 150 | <li class="divider"> </li> |
| ... | ... | @@ -144,6 +191,10 @@ |
| 144 | 191 | </a> |
| 145 | 192 | <ul class="dropdown-menu pull-right" style="min-width:100px"> |
| 146 | 193 | <li> |
| 194 | + <a class="upManual" href="javascript:;" data-direction="0" data-pjax><i class="fa fa-pencil"></i> 手动添加站点</a> | |
| 195 | + </li> | |
| 196 | + <li class="divider"> </li> | |
| 197 | + <li> | |
| 147 | 198 | <a class="upSystem" href="javascript:;" data-direction="0" data-pjax><i class="fa fa-wrench"></i> 系统规划</a> |
| 148 | 199 | </li> |
| 149 | 200 | <li class="divider"> </li> |
| ... | ... | @@ -206,6 +257,10 @@ |
| 206 | 257 | </li> |
| 207 | 258 | <li class="divider"> </li> |
| 208 | 259 | <li> |
| 260 | + <a href="javascript:;" id="downBatchRecover"><i class="fa fa-recycle"></i> 批量恢复</a> | |
| 261 | + </li> | |
| 262 | + <li class="divider"> </li> | |
| 263 | + <li> | |
| 209 | 264 | <a href="javascript:;" class="retweet"><i class="fa fa-retweet"></i> 切换上下行</a> |
| 210 | 265 | </li> |
| 211 | 266 | <li class="divider"> </li> |
| ... | ... | @@ -243,6 +298,9 @@ |
| 243 | 298 | <i class="fa fa-angle-down"></i> |
| 244 | 299 | </a> |
| 245 | 300 | <ul class="dropdown-menu pull-right" style="min-width:100px"> |
| 301 | + <li> | |
| 302 | + <a class="downManual" href="javascript:;" data-direction="1" data-pjax><i class="fa fa-pencil"></i> 手动添加站点</a> | |
| 303 | + </li> | |
| 246 | 304 | <li class="divider"> </li> |
| 247 | 305 | <li> |
| 248 | 306 | <a class="downSystem" href="javascript:;" data-direction="1" data-pjax><i class="fa fa-wrench"></i> 系统规划</a> |
| ... | ... | @@ -302,6 +360,48 @@ |
| 302 | 360 | </div> |
| 303 | 361 | </div> |
| 304 | 362 | </div> |
| 363 | + <div class="tab-pane fade" id="regionDesignTab" data-direction="4"> | |
| 364 | + <div class="portlet-body" id="regionDesignTool"> | |
| 365 | + <!-- 树 --> | |
| 366 | + <div class="portlet-body"> | |
| 367 | + <div class="form-horizontal"> | |
| 368 | + <div class="form-group"> | |
| 369 | + <div class="col-md-7 col-sm-6 col-xs-7"> | |
| 370 | + <select id="regionSelect" style="height:30px;width:150px;"> | |
| 371 | + <option>无线路区间</option> | |
| 372 | + </select> | |
| 373 | + </div> | |
| 374 | + <div class="col-md-2 col-sm-2 col-xs-2"> | |
| 375 | + <input type="button" value="编辑" id="regionEditBtn"/> | |
| 376 | + </div> | |
| 377 | + <div class="col-md-2 col-sm-2 col-xs-2"> | |
| 378 | + <input type="button" value="新增" id="regionAddBtn"/> | |
| 379 | + </div> | |
| 380 | + </div> | |
| 381 | + </div> | |
| 382 | + </div> | |
| 383 | + <div class="portlet-body"> | |
| 384 | + <div id="regionDesignContent" style="height: auto;max-height: 500px;"> | |
| 385 | + <div> | |
| 386 | + <table style="width: 100%;"> | |
| 387 | + <thead> | |
| 388 | + <tr class="region-station-head"> | |
| 389 | + <td style="width: 10%;">#</td> | |
| 390 | + <td style="width: 60%;">站点</td> | |
| 391 | + <td style="width: 30%;white-space: nowrap">上下行</td> | |
| 392 | + </tr> | |
| 393 | + </thead> | |
| 394 | + </table> | |
| 395 | + </div> | |
| 396 | + | |
| 397 | + <div class="region-station-body" style="overflow-y: auto; height: 450px;"> | |
| 398 | + <table id="region-station-body-table" style="width: 100%; border: 1px solid #dddddd;"> | |
| 399 | + </table> | |
| 400 | + </div> | |
| 401 | + </div> | |
| 402 | + </div> | |
| 403 | + </div> | |
| 404 | + </div> | |
| 305 | 405 | </div> |
| 306 | 406 | </div> |
| 307 | 407 | </div> |
| ... | ... | @@ -366,6 +466,30 @@ |
| 366 | 466 | </div> |
| 367 | 467 | </div> |
| 368 | 468 | </script> |
| 469 | +<script id="line-region-station-template" type="text/html"> | |
| 470 | + {{each list as obj i}} | |
| 471 | + <tr data-idx="{{i}}"> | |
| 472 | + <td style="width: 10%;"> | |
| 473 | + {{i+1}} | |
| 474 | + </td> | |
| 475 | + <td style="width: 60%;" title="{{obj.stationName}}"> | |
| 476 | + {{obj.stationName}} | |
| 477 | + </td> | |
| 478 | + <td style="width: 30%;"> | |
| 479 | + {{if obj.directions == 0}} | |
| 480 | + 上行 | |
| 481 | + {{else}} | |
| 482 | + 下行 | |
| 483 | + {{/if}} | |
| 484 | + </td> | |
| 485 | + </tr> | |
| 486 | + {{/each}} | |
| 487 | + {{if list.length == 0}} | |
| 488 | + <tr> | |
| 489 | + <td style="width: 100%;" colspan="3">无站点信息</td> | |
| 490 | + </tr> | |
| 491 | + {{/if}} | |
| 492 | +</script> | |
| 369 | 493 | <script type="text/javascript"> |
| 370 | 494 | var proxy = EventProxy.create('routes-operation-loaded', 'routes-service-loaded', function() { |
| 371 | 495 | RoutesOperation.initPage(); | ... | ... |
src/main/resources/static/pages/base/stationroute/recover_routes.html
0 → 100644
| 1 | +<!-- 批量恢复选项 --> | |
| 2 | +<div class="modal fade" id="recover_select_modal" tabindex="-1" | |
| 3 | + role="basic" aria-hidden="true"> | |
| 4 | + <div class="modal-dialog"> | |
| 5 | + <div class="modal-content"> | |
| 6 | + <div class="modal-header"> | |
| 7 | + <button type="button" class="close" data-dismiss="modal" | |
| 8 | + aria-hidden="true"></button> | |
| 9 | + <h4 class="modal-title"> | |
| 10 | + 批量恢复选项 | |
| 11 | + </h4> | |
| 12 | + </div> | |
| 13 | + <div class="modal-body"> | |
| 14 | + <form class="form-horizontal" action="/" method="post" | |
| 15 | + id="formBootbox" role="form"> | |
| 16 | + <div class="form-group"> | |
| 17 | + <label class="col-md-3 control-label">恢复选项:</label> | |
| 18 | + <div class="col-md-9"> | |
| 19 | + <div class="icheck-list"> | |
| 20 | + <label> | |
| 21 | + <input type="radio" name="deleteOptions" value="0" checked> 批量恢复站点 | |
| 22 | + </label> | |
| 23 | + <label > | |
| 24 | + <input type="radio" name="deleteOptions" value="1" > 批量恢复路段 | |
| 25 | + </label> | |
| 26 | + </div> | |
| 27 | + </div> | |
| 28 | + </div> | |
| 29 | + </form> | |
| 30 | + </div> | |
| 31 | + <div class="modal-footer"> | |
| 32 | + <button type="button" class="btn btn-primary" | |
| 33 | + id="deleteSelectnextButton">下一步</button> | |
| 34 | + <button type="button" class="btn default" data-dismiss="modal">取消</button> | |
| 35 | + </div> | |
| 36 | + </div> | |
| 37 | + </div> | |
| 38 | +</div> | |
| 39 | +<script type="text/javascript"> | |
| 40 | + $('#recover_select_modal').on('modal.show',function(event) { | |
| 41 | + $('#recover_select_modal').modal({ | |
| 42 | + show : true, | |
| 43 | + backdrop : 'static', | |
| 44 | + keyboard : false | |
| 45 | + }); | |
| 46 | + var form = $('#formBootbox'); | |
| 47 | + $('#deleteSelectnextButton').on('click', function() { | |
| 48 | + deleteOptions = $("input[name='deleteOptions']:checked").val(); | |
| 49 | + form.submit(); | |
| 50 | + }); | |
| 51 | + form.validate({ | |
| 52 | + submitHandler : function(f) { | |
| 53 | + if(deleteOptions == 0) { | |
| 54 | + // 恢复站点路由 | |
| 55 | + $('#recover_select_modal').modal('hide'); | |
| 56 | + $.get('recover_stationroute.html', function(m){ | |
| 57 | + $(pjaxContainer).append(m); | |
| 58 | + $('#recover_station_modal').trigger('modal.show'); | |
| 59 | + }); | |
| 60 | + } else if(deleteOptions == 1) { | |
| 61 | + // 恢复路段路由 | |
| 62 | + $('#recover_select_modal').modal('hide'); | |
| 63 | + $.get('recover_sectionroute.html', function(m){ | |
| 64 | + $(pjaxContainer).append(m); | |
| 65 | + $('#recover_section_modal').trigger('modal.show'); | |
| 66 | + }); | |
| 67 | + } | |
| 68 | + | |
| 69 | + } | |
| 70 | + }); | |
| 71 | + }); | |
| 72 | +</script> | |
| 0 | 73 | \ No newline at end of file | ... | ... |
src/main/resources/static/pages/base/stationroute/recover_sectionroute.html
0 → 100644
| 1 | +<!-- 编辑路段 --> | |
| 2 | +<div class="modal fade" id="recover_section_modal" role="basic" | |
| 3 | + aria-hidden="true"> | |
| 4 | + <div style="margin:5% auto"> | |
| 5 | + <div class="modal-content"> | |
| 6 | + <div class="col-md-12"> | |
| 7 | + <div class="portlet light porttlet-fit bordered"> | |
| 8 | + <div class="portlet-title"> | |
| 9 | + <div class="tipso-animation"> | |
| 10 | + </div> | |
| 11 | + <div class="caption"> | |
| 12 | + <i class="fa fa-info-circle font-dark"></i> <span | |
| 13 | + class="caption-subject font-dark sbold uppercase">路段信息</span> | |
| 14 | + </div> | |
| 15 | + <div class="actions"> | |
| 16 | + <div class="modal-footer-left"> | |
| 17 | + <button type="button" class="btn btn-primary" id="batchDeleteSectionButton">批量恢复路段</button> | |
| 18 | + <button type="button" class="btn default" data-dismiss="modal">取消</button> | |
| 19 | + </div> | |
| 20 | + </div> | |
| 21 | + </div> | |
| 22 | + <div class="portlet-body"> | |
| 23 | + <div class="table-container" style="margin-top: 10px"> | |
| 24 | + <from class="form-horizontal" role="form" | |
| 25 | + id="batch_delete_section_form"> | |
| 26 | + <table | |
| 27 | + class="table table-striped table-bordered table-hover table-checkable" | |
| 28 | + id="sectionroute_datatable"> | |
| 29 | + <thead> | |
| 30 | + <tr role="row" class="heading"> | |
| 31 | + <th width="2%"><input type="checkbox" name="sectionCheckItems" | |
| 32 | + id="sectionCheckItems"></input></th> | |
| 33 | + <th width="2%">序号</th> | |
| 34 | + <th width="5%">路段路由编号</th> | |
| 35 | + <th width="5%">线路编号</th> | |
| 36 | + <th width="11%">线路名称</th> | |
| 37 | + <th width="7%">线路方向</th> | |
| 38 | + <th width="11%">路段名称</th> | |
| 39 | + <th width="5%">路段编码</th> | |
| 40 | + <th width="5%">路段序号</th> | |
| 41 | + <th width="5%">路段限速</th> | |
| 42 | + <th width="5%">路段长度</th> | |
| 43 | + <th width="5%">路段历时</th> | |
| 44 | + <th width="5%">版本号</th> | |
| 45 | + <!-- <th width="6%">是否撤销</th> | |
| 46 | + <th width="9%">操作</th> --> | |
| 47 | + </tr> | |
| 48 | + </thead> | |
| 49 | + <tbody></tbody> | |
| 50 | + </table> | |
| 51 | + </from> | |
| 52 | + <div class="actions"> | |
| 53 | + <div style="text-align: right"> | |
| 54 | + <ul id="pagination" class="pagination"></ul> | |
| 55 | + </div> | |
| 56 | + </div> | |
| 57 | + </div> | |
| 58 | + </div> | |
| 59 | + </div> | |
| 60 | + </div> | |
| 61 | + </div> | |
| 62 | + </div> | |
| 63 | +</div> | |
| 64 | + | |
| 65 | +<script type="text/html" id="sectionroute_datatable_template"> | |
| 66 | + {{each list as obj i }} | |
| 67 | + <tr> | |
| 68 | + <td style="vertical-align: middle;"> | |
| 69 | + <input type="checkbox" class="group-checkable icheck" name="items" value="{{obj.id}}" id="{{obj.id}}" > | |
| 70 | + </td> | |
| 71 | + <td style="vertical-align: middle;"> | |
| 72 | + {{(list.page*10)+(i+1)}} | |
| 73 | + </td> | |
| 74 | + <td style="vertical-align: middle;"> | |
| 75 | + {{obj.id}} | |
| 76 | + </td> | |
| 77 | + <td style="vertical-align: middle;"> | |
| 78 | + {{obj.lineCode}} | |
| 79 | + </td> | |
| 80 | + <td style="vertical-align: middle;"> | |
| 81 | + {{obj.line.name}} | |
| 82 | + </td> | |
| 83 | + <td style="vertical-align: middle;"> | |
| 84 | + {{if obj.directions == '0'}} | |
| 85 | + 上行 | |
| 86 | + {{else if obj.directions == '1'}} | |
| 87 | + 下行 | |
| 88 | + {{/if}} | |
| 89 | + </td> | |
| 90 | + <td style="vertical-align: middle;"> | |
| 91 | + {{obj.section.sectionName}} | |
| 92 | + </td> | |
| 93 | + <td style="vertical-align: middle;"> | |
| 94 | + {{obj.sectionCode}} | |
| 95 | + </td> | |
| 96 | + <td style="vertical-align: middle;"> | |
| 97 | + {{obj.sectionrouteCode}} | |
| 98 | + </td> | |
| 99 | + <td style="vertical-align: middle;"> | |
| 100 | + {{obj.speedLimit}} | |
| 101 | + </td> | |
| 102 | + <td style="vertical-align: middle;"> | |
| 103 | + {{obj.sectionDistance}} | |
| 104 | + </td> | |
| 105 | + <td style="vertical-align: middle;"> | |
| 106 | + {{obj.sectionTime}} | |
| 107 | + </td> | |
| 108 | + <td style="vertical-align: middle;"> | |
| 109 | + {{obj.versions}} | |
| 110 | + </td> | |
| 111 | + </tr> | |
| 112 | + {{/each}} | |
| 113 | + {{if list.length == 0}} | |
| 114 | + <tr> | |
| 115 | + <td colspan=13><h6 class="muted">没有找到相关数据</h6></td> | |
| 116 | + </tr> | |
| 117 | + {{/if}} | |
| 118 | +</script> | |
| 119 | +<script type="text/javascript"> | |
| 120 | +$('#recover_section_modal').on('modal.show',function(event) { | |
| 121 | + var properties = RoutesOperation.getProperties(); | |
| 122 | + layer.closeAll(); | |
| 123 | + // 显示mobal | |
| 124 | + $('#recover_section_modal').modal({ | |
| 125 | + show : true, | |
| 126 | + backdrop : 'static', | |
| 127 | + keyboard : false | |
| 128 | + }); | |
| 129 | + // 提交数据按钮事件 | |
| 130 | + $('#batchDeleteSectionButton').on('click', function() { | |
| 131 | + let checked = $("[name=items]:checked"); | |
| 132 | + let ids = new Array(); | |
| 133 | + checked.each(function() { | |
| 134 | + ids.push($(this).val()); | |
| 135 | + }); | |
| 136 | + if (ids.length > 0) { | |
| 137 | + var params = {}; | |
| 138 | + params.ids = ids; | |
| 139 | + params.status = properties.status; | |
| 140 | + $.post('/api/lssectionroute/batchRecover', params, function(res) { | |
| 141 | + if (res.status == 'SUCCESS') { | |
| 142 | + layer.msg('恢复成功...'); | |
| 143 | + } else { | |
| 144 | + layer.msg('恢复失败...'); | |
| 145 | + } | |
| 146 | + initSearch(); | |
| 147 | + RoutesOperation.resjtreeDate(properties.lineId, properties.directions, properties.versions); | |
| 148 | + }); | |
| 149 | + } else { | |
| 150 | + layer.msg('请选择要恢复的路段!!!'); | |
| 151 | + } | |
| 152 | + }); | |
| 153 | + | |
| 154 | + /** 全选框 */ | |
| 155 | + $('#sectionCheckItems').on('click', function() { | |
| 156 | + $('input[name=items]').prop('checked', $(this).prop("checked")); | |
| 157 | + }); | |
| 158 | + | |
| 159 | + /** 页面加载完显示数据 */ | |
| 160 | + window.onload = initSearch(); | |
| 161 | + | |
| 162 | + /** | |
| 163 | + * @description : (TODO) 页面加载事件 | |
| 164 | + * | |
| 165 | + */ | |
| 166 | + var page = 0; | |
| 167 | + function initSearch() { | |
| 168 | + var params = new getParams(); | |
| 169 | + page = 0; | |
| 170 | + loadTableDate(params, true); | |
| 171 | + } | |
| 172 | + function getParams() { | |
| 173 | + // 搜索参数集合 | |
| 174 | + var params = {}; | |
| 175 | + params['line.id_eq'] = properties.lineId; | |
| 176 | + params.directions_eq = properties.directions; | |
| 177 | + params.versions_eq = properties.versions; | |
| 178 | + params.destroy_eq = 1; | |
| 179 | + | |
| 180 | + return params; | |
| 181 | + } | |
| 182 | + /** | |
| 183 | + * @description : (TODO) 表格数据分页加载事件 | |
| 184 | + * | |
| 185 | + * ------@param : 查询参数 | |
| 186 | + * | |
| 187 | + * ------@isPon : 是否重新分页 | |
| 188 | + * | |
| 189 | + */ | |
| 190 | + function loadTableDate(param, isPon) { | |
| 191 | + // 初始化全选按钮 | |
| 192 | + $('#sectionCheckItems').prop('checked', false); | |
| 193 | + // 搜索参数 | |
| 194 | + var params = {}; | |
| 195 | + if (param) | |
| 196 | + params = param; | |
| 197 | + // 排序(按方向与序号) | |
| 198 | + params['order'] = 'directions,sectionrouteCode'; | |
| 199 | + // 排序方向. | |
| 200 | + params['direction'] = 'ASC,ASC'; | |
| 201 | + // 记录当前页数 | |
| 202 | + params['page'] = page; | |
| 203 | + | |
| 204 | + // 弹出正在加载层 | |
| 205 | + var i = layer.load(2); | |
| 206 | + // 异步请求获取表格数据 | |
| 207 | + $.get('/api/lssectionroute/findPageByParams', params, function(result) { | |
| 208 | + // 添加序号 | |
| 209 | + if (!result.content) { | |
| 210 | + result.content = new Array(); | |
| 211 | + } | |
| 212 | + result.content.page = page; | |
| 213 | + // 把数据填充到模版中 | |
| 214 | + var tbodyHtml = template('sectionroute_datatable_template',{list : result.content}); | |
| 215 | + // 把渲染好的模版html文本追加到表格中 | |
| 216 | + $('#sectionroute_datatable tbody').html(tbodyHtml); | |
| 217 | + // 是重新分页且返回数据长度大于0 | |
| 218 | + if (isPon && result.content.length > 0) { | |
| 219 | + // 重新分页 | |
| 220 | + initPag = true; | |
| 221 | + // 分页栏 | |
| 222 | + showPagination(result); | |
| 223 | + } | |
| 224 | + // 关闭弹出加载层 | |
| 225 | + layer.close(i); | |
| 226 | + }); | |
| 227 | + } | |
| 228 | + /** | |
| 229 | + * @description : (TODO) 分页栏组件 | |
| 230 | + * | |
| 231 | + */ | |
| 232 | + function showPagination(data) { | |
| 233 | + // 分页组件 | |
| 234 | + $('#pagination').jqPaginator({ | |
| 235 | + // 总页数 | |
| 236 | + totalPages: data.totalPages, | |
| 237 | + // 中间显示页数 | |
| 238 | + visiblePages: 6, | |
| 239 | + // 当前页 | |
| 240 | + currentPage: page + 1, | |
| 241 | + first: '<li class="first"><a href="javascript:void(0);">首页<\/a><\/li>', | |
| 242 | + prev: '<li class="prev"><a href="javascript:void(0);">上一页<\/a><\/li>', | |
| 243 | + next: '<li class="next"><a href="javascript:void(0);">下一页<\/a><\/li>', | |
| 244 | + last: '<li class="last"><a href="javascript:void(0);">尾页<\/a><\/li>', | |
| 245 | + page: '<li class="page"><a href="javascript:void(0);">{{page}}<\/a><\/li>', | |
| 246 | + onPageChange: function(num, type) { | |
| 247 | + if (initPag) { | |
| 248 | + initPag = false; | |
| 249 | + return; | |
| 250 | + } | |
| 251 | + var pData = getParams(); | |
| 252 | + page = num - 1; | |
| 253 | + loadTableDate(pData, false); | |
| 254 | + } | |
| 255 | + }); | |
| 256 | + } | |
| 257 | +}); | |
| 258 | +</script> | |
| 0 | 259 | \ No newline at end of file | ... | ... |
src/main/resources/static/pages/base/stationroute/recover_stationroute.html
0 → 100644
| 1 | +<!-- 编辑路段 --> | |
| 2 | +<div class="modal fade" id="recover_station_modal" role="basic" | |
| 3 | + aria-hidden="true"> | |
| 4 | + <div style="margin:5% auto"> | |
| 5 | + <div class="modal-content"> | |
| 6 | + <div class="col-md-12"> | |
| 7 | + <div class="portlet light porttlet-fit bordered"> | |
| 8 | + <div class="portlet-title"> | |
| 9 | + <div class="tipso-animation"> | |
| 10 | + </div> | |
| 11 | + <div class="caption"> | |
| 12 | + <i class="fa fa-info-circle font-dark"></i> | |
| 13 | + <span class="caption-subject font-dark sbold uppercase">站点信息</span> | |
| 14 | + </div> | |
| 15 | + <div class="actions"> | |
| 16 | + <div class="btn-group btn-group-devided" data-toggle="buttons"> | |
| 17 | + <button type="button" class="btn btn-primary" id="batchDeleteStationButton">批量恢复站点</button> | |
| 18 | + <button type="button" class="btn default" data-dismiss="modal">取消</button> | |
| 19 | + </div> | |
| 20 | + </div> | |
| 21 | + </div> | |
| 22 | + <div class="portlet-body"> | |
| 23 | + <div class="table-container" style="margin-top: 10px"> | |
| 24 | + <from class="form-horizontal" role="form" id="batch_delete_station_form"> | |
| 25 | + <table class="table table-striped table-bordered table-hover table-checkable" id="stationroute_datatable"> | |
| 26 | + <thead> | |
| 27 | + <tr role="row" class="heading"> | |
| 28 | + <th width="2%"><input type="checkbox" name="checkItems" | |
| 29 | + id="stationCheckItems"></input></th> | |
| 30 | + <th width="2%">序号</th> | |
| 31 | + <th width="5%">站点路由编号</th> | |
| 32 | + <th width="5%">线路编号</th> | |
| 33 | + <th width="8%">线路名称</th> | |
| 34 | + <th width="5%">线路方向</th> | |
| 35 | + <th width="8%">站点路由名称</th> | |
| 36 | + <th width="4%">站点编码</th> | |
| 37 | + <th width="4%">站点序号</th> | |
| 38 | + <th width="4%">站点类型</th> | |
| 39 | + <th width="6%">站点距离(km)</th> | |
| 40 | + <th width="6%">站点时长(min)</th> | |
| 41 | + <th width="4%">版本号</th> | |
| 42 | + </tr> | |
| 43 | + </thead> | |
| 44 | + <tbody></tbody> | |
| 45 | + </table> | |
| 46 | + </from> | |
| 47 | + <div class="actions"> | |
| 48 | + <div style="text-align: right"> | |
| 49 | + <ul id="pagination" class="pagination"></ul> | |
| 50 | + </div> | |
| 51 | + </div> | |
| 52 | + </div> | |
| 53 | + </div> | |
| 54 | + </div> | |
| 55 | + </div> | |
| 56 | + </div> | |
| 57 | + </div> | |
| 58 | +</div> | |
| 59 | + | |
| 60 | +<script type="text/html" id="stationroute_datatable_template"> | |
| 61 | + {{each list as obj i }} | |
| 62 | + <tr> | |
| 63 | + <td style="vertical-align: middle;"> | |
| 64 | + <input type="checkbox" class="group-checkable icheck" name="items" value="{{obj.id}}" id="{{obj.id}}" > | |
| 65 | + </td> | |
| 66 | + <td style="vertical-align: middle;"> | |
| 67 | + {{(list.page*10)+(i+1)}} | |
| 68 | + </td> | |
| 69 | + <td style="vertical-align: middle;"> | |
| 70 | + {{obj.id}} | |
| 71 | + </td> | |
| 72 | + <td> | |
| 73 | + {{obj.lineCode}} | |
| 74 | + </td> | |
| 75 | + <td> | |
| 76 | + {{obj.line.name}} | |
| 77 | + </td> | |
| 78 | + <td> | |
| 79 | + {{if obj.directions == '0'}} | |
| 80 | + 上行 | |
| 81 | + {{else if obj.directions == '1'}} | |
| 82 | + 下行 | |
| 83 | + {{/if}} | |
| 84 | + </td> | |
| 85 | + <td> | |
| 86 | + {{obj.stationName}} | |
| 87 | + </td> | |
| 88 | + <td> | |
| 89 | + {{obj.stationCode}} | |
| 90 | + </td> | |
| 91 | + <td> | |
| 92 | + {{obj.stationRouteCode}} | |
| 93 | + </td> | |
| 94 | + <td> | |
| 95 | + {{if obj.stationMark == 'B'}} | |
| 96 | + 起始站 | |
| 97 | + {{else if obj.stationMark == 'Z'}} | |
| 98 | + 中途站 | |
| 99 | + {{else if obj.stationMark== 'E'}} | |
| 100 | + 终点站 | |
| 101 | + {{/if}} | |
| 102 | + </td> | |
| 103 | + <td> | |
| 104 | + {{obj.distances}} | |
| 105 | + </td> | |
| 106 | + <td> | |
| 107 | + {{obj.toTime}} | |
| 108 | + </td> | |
| 109 | + <td> | |
| 110 | + {{obj.versions}} | |
| 111 | + </td> | |
| 112 | + </tr> | |
| 113 | + {{/each}} | |
| 114 | + {{if list.length == 0}} | |
| 115 | + <tr> | |
| 116 | + <td colspan=13><h6 class="muted">没有找到相关数据</h6></td> | |
| 117 | + </tr> | |
| 118 | + {{/if}} | |
| 119 | +</script> | |
| 120 | +<script type="text/javascript"> | |
| 121 | +$('#recover_station_modal').on('modal.show',function(event) { | |
| 122 | + var properties = RoutesOperation.getProperties(); | |
| 123 | + layer.closeAll(); | |
| 124 | + // 显示mobal | |
| 125 | + $('#recover_station_modal').modal({ | |
| 126 | + show : true, | |
| 127 | + backdrop : 'static', | |
| 128 | + keyboard : false | |
| 129 | + }); | |
| 130 | + // 提交数据按钮事件 | |
| 131 | + $('#batchDeleteStationButton').on('click', function() { | |
| 132 | + let checked = $("[name=items]:checked"); | |
| 133 | + let ids = new Array(); | |
| 134 | + checked.each(function() { | |
| 135 | + ids.push($(this).val()); | |
| 136 | + }); | |
| 137 | + if (ids.length > 0) { | |
| 138 | + let params = {}; | |
| 139 | + params.ids = ids; | |
| 140 | + params.status = properties.status; | |
| 141 | + $.post('/api/lsstationroute/batchRecover',params,function(res) { | |
| 142 | + if (res.status == 'SUCCESS') { | |
| 143 | + layer.msg('恢复成功...'); | |
| 144 | + } else { | |
| 145 | + layer.msg('恢复失败...'); | |
| 146 | + } | |
| 147 | + initSearch(); | |
| 148 | + // 刷新左边树 | |
| 149 | + RoutesOperation.resjtreeDate(properties.lineId, properties.directions, properties.versions); | |
| 150 | + }); | |
| 151 | + } else { | |
| 152 | + layer.msg('请选择要恢复的站点!!!'); | |
| 153 | + } | |
| 154 | + }); | |
| 155 | + | |
| 156 | + /** 全选框 */ | |
| 157 | + $('#stationCheckItems').on('click', function() { | |
| 158 | + $('input[name=items]').prop('checked', $(this).prop("checked")); | |
| 159 | + }); | |
| 160 | + | |
| 161 | + /** 页面加载完显示数据 */ | |
| 162 | + window.onload = initSearch(); | |
| 163 | + | |
| 164 | + /** | |
| 165 | + * @description : (TODO) 页面加载事件 | |
| 166 | + * | |
| 167 | + */ | |
| 168 | + var page = 0; | |
| 169 | + function initSearch() { | |
| 170 | + var params = new getParams(); | |
| 171 | + page = 0; | |
| 172 | + loadTableDate(params, true); | |
| 173 | + } | |
| 174 | + function getParams() { | |
| 175 | + var params = {}; | |
| 176 | + params['line.id_eq'] = properties.lineId; | |
| 177 | + params.directions_eq = properties.directions; | |
| 178 | + params.versions_eq = properties.versions; | |
| 179 | + params.destroy_eq = 1; | |
| 180 | + | |
| 181 | + return params; | |
| 182 | + } | |
| 183 | + /** | |
| 184 | + * @description : (TODO) 表格数据分页加载事件 | |
| 185 | + * | |
| 186 | + * ------@param : 查询参数 | |
| 187 | + * | |
| 188 | + * ------@isPon : 是否重新分页 | |
| 189 | + * | |
| 190 | + */ | |
| 191 | + function loadTableDate(param, isPon) { | |
| 192 | + // 初始化全选按钮 | |
| 193 | + $('#stationCheckItems').prop('checked', false); | |
| 194 | + // 搜索参数 | |
| 195 | + var params = {}; | |
| 196 | + if (param) | |
| 197 | + params = param; | |
| 198 | + // 排序(按方向与序号) | |
| 199 | + params['order'] = 'directions,stationRouteCode'; | |
| 200 | + // 排序方向. | |
| 201 | + params['direction'] = 'ASC,ASC'; | |
| 202 | + // 记录当前页数 | |
| 203 | + params['page'] = page; | |
| 204 | + | |
| 205 | + // 弹出正在加载层 | |
| 206 | + var i = layer.load(2); | |
| 207 | + // 异步请求获取表格数据 | |
| 208 | + $.get('/api/lsstationroute/findPageByParams', params, function(result) { | |
| 209 | + // 添加序号 | |
| 210 | + if (!result.content) { | |
| 211 | + result.content = new Array(); | |
| 212 | + } | |
| 213 | + result.content.page = page; | |
| 214 | + // 把数据填充到模版中 | |
| 215 | + var tbodyHtml = template('stationroute_datatable_template',{list : result.content}); | |
| 216 | + // 把渲染好的模版html文本追加到表格中 | |
| 217 | + $('#stationroute_datatable tbody').html(tbodyHtml); | |
| 218 | + // 是重新分页且返回数据长度大于0 | |
| 219 | + if (isPon && result.content.length > 0) { | |
| 220 | + // 重新分页 | |
| 221 | + initPag = true; | |
| 222 | + // 分页栏 | |
| 223 | + showPagination(result); | |
| 224 | + } | |
| 225 | + // 关闭弹出加载层 | |
| 226 | + layer.close(i); | |
| 227 | + }); | |
| 228 | + } | |
| 229 | + /** | |
| 230 | + * @description : (TODO) 分页栏组件 | |
| 231 | + * | |
| 232 | + */ | |
| 233 | + function showPagination(data) { | |
| 234 | + // 分页组件 | |
| 235 | + $('#pagination').jqPaginator({ | |
| 236 | + // 总页数 | |
| 237 | + totalPages: data.totalPages, | |
| 238 | + // 中间显示页数 | |
| 239 | + visiblePages: 6, | |
| 240 | + // 当前页 | |
| 241 | + currentPage: page + 1, | |
| 242 | + first: '<li class="first"><a href="javascript:void(0);">首页<\/a><\/li>', | |
| 243 | + prev: '<li class="prev"><a href="javascript:void(0);">上一页<\/a><\/li>', | |
| 244 | + next: '<li class="next"><a href="javascript:void(0);">下一页<\/a><\/li>', | |
| 245 | + last: '<li class="last"><a href="javascript:void(0);">尾页<\/a><\/li>', | |
| 246 | + page: '<li class="page"><a href="javascript:void(0);">{{page}}<\/a><\/li>', | |
| 247 | + onPageChange : function(num, type) { | |
| 248 | + if (initPag) { | |
| 249 | + initPag = false; | |
| 250 | + return; | |
| 251 | + } | |
| 252 | + var pData = getParams(); | |
| 253 | + page = num - 1; | |
| 254 | + loadTableDate(pData, false); | |
| 255 | + } | |
| 256 | + }); | |
| 257 | + } | |
| 258 | +}); | |
| 259 | +</script> | |
| 0 | 260 | \ No newline at end of file | ... | ... |
src/main/resources/static/real_control_v2/mapmonitor/fragments/map_infowindow.html
| ... | ... | @@ -40,7 +40,7 @@ |
| 40 | 40 | {{/if}} |
| 41 | 41 | <a href="javascript:;" style="float: left;" onclick="javascript:window.open('http://58.34.52.130:4490/transport_server/dvr_monitor2.html?userid=4&zbh={{nbbm}}');">DVR</a> |
| 42 | 42 | <a href="W9:1@139.196.29.203@?method=call&1111:{{dvrcode}}" style="margin-left: 50px;" >拨打电话</a> |
| 43 | - <a href="javascript:;" style="float: right;" onclick="javascript:gb_map_play_back.initParams('{{deviceId}}', '{{nbbm}}');">轨迹回放</a> | |
| 43 | + <a href="javascript:;" style="float: right;" onclick="javascript:gb_map_play_back.initParams({deviceId: '{{deviceId}}', nbbm: '{{nbbm}}'});">轨迹回放</a> | |
| 44 | 44 | </div> |
| 45 | 45 | </script> |
| 46 | 46 | ... | ... |