Commit ad04f28b57b2bec25a58f6c21abb98cfa28ec3f2
Merge branch 'pudong' of http://222.66.0.204:8090/panzhaov5/bsth_control into pudong
Showing
40 changed files
with
4547 additions
and
4100 deletions
src/main/java/com/bsth/controller/geo_data/GeoDataController.java
| 1 | -package com.bsth.controller.geo_data; | |
| 2 | - | |
| 3 | -import com.bsth.entity.geo_data.GeoRoad; | |
| 4 | -import com.bsth.entity.geo_data.GeoStation; | |
| 5 | -import com.bsth.service.geo_data.GeoDataService; | |
| 6 | -import org.springframework.beans.factory.annotation.Autowired; | |
| 7 | -import org.springframework.web.bind.annotation.RequestMapping; | |
| 8 | -import org.springframework.web.bind.annotation.RequestMethod; | |
| 9 | -import org.springframework.web.bind.annotation.RequestParam; | |
| 10 | -import org.springframework.web.bind.annotation.RestController; | |
| 11 | - | |
| 12 | -import java.util.Map; | |
| 13 | - | |
| 14 | -/** | |
| 15 | - * Created by panzhao on 2017/12/7. | |
| 16 | - */ | |
| 17 | -@RestController | |
| 18 | -@RequestMapping("/_geo_data") | |
| 19 | -public class GeoDataController { | |
| 20 | - | |
| 21 | - @Autowired | |
| 22 | - GeoDataService geoDataService; | |
| 23 | - | |
| 24 | - @RequestMapping("findGeoStations") | |
| 25 | - public Map<String, Object> findGeoStations(@RequestParam String lineCode){ | |
| 26 | - return geoDataService.findGeoStations(lineCode); | |
| 27 | - } | |
| 28 | - | |
| 29 | - | |
| 30 | - @RequestMapping("findGeoRoad") | |
| 31 | - public Map<String, Object> findGeoRoad(@RequestParam String lineCode){ | |
| 32 | - return geoDataService.findGeoRoad(lineCode); | |
| 33 | - } | |
| 34 | - | |
| 35 | - @RequestMapping(value = "updateBufferInfo",method = RequestMethod.POST) | |
| 36 | - public Map<String, Object> updateBufferInfo(GeoStation station){ | |
| 37 | - return geoDataService.updateBufferInfo(station); | |
| 38 | - } | |
| 39 | - | |
| 40 | - @RequestMapping(value = "updateStationName",method = RequestMethod.POST) | |
| 41 | - public Map<String, Object> updateStationName(@RequestParam Map<String, Object> map){ | |
| 42 | - return geoDataService.updateStationName(map); | |
| 43 | - } | |
| 44 | - | |
| 45 | - @RequestMapping(value = "addNewStationRoute",method = RequestMethod.POST) | |
| 46 | - public Map<String, Object> addNewStationRoute(@RequestParam String lineCode,@RequestParam int versions,@RequestParam int upDown | |
| 47 | - ,@RequestParam String stationName,@RequestParam Float lat,@RequestParam Float lng,@RequestParam int prevRouteId){ | |
| 48 | - return geoDataService.addNewStationRoute(lineCode, upDown, versions, stationName, lat, lng, prevRouteId); | |
| 49 | - } | |
| 50 | - | |
| 51 | - @RequestMapping(value = "addNewRoadRoute",method = RequestMethod.POST) | |
| 52 | - public Map<String, Object> addNewRoadRoute(@RequestParam String lineCode,@RequestParam int versions,@RequestParam int upDown | |
| 53 | - ,@RequestParam String sectionName,@RequestParam String crosesRoad,@RequestParam String coords,@RequestParam int prevRouteId){ | |
| 54 | - return geoDataService.addNewRoadRoute(lineCode, upDown, versions, sectionName, crosesRoad, coords, prevRouteId); | |
| 55 | - } | |
| 56 | - | |
| 57 | - @RequestMapping(value = "destroyStation",method = RequestMethod.POST) | |
| 58 | - public Map<String, Object> destroyStation(GeoStation station){ | |
| 59 | - return geoDataService.destroyStation(station); | |
| 60 | - } | |
| 61 | - | |
| 62 | - @RequestMapping(value = "updateRoadInfo",method = RequestMethod.POST) | |
| 63 | - public Map<String, Object> updateRoadInfo(GeoRoad road){ | |
| 64 | - return geoDataService.updateRoadInfo(road); | |
| 65 | - } | |
| 66 | - | |
| 67 | - @RequestMapping(value = "destroyRoad",method = RequestMethod.POST) | |
| 68 | - public Map<String, Object> destroyRoad(GeoRoad road){ | |
| 69 | - return geoDataService.destroyRoad(road); | |
| 70 | - } | |
| 71 | - | |
| 72 | - @RequestMapping("findVersionInfo") | |
| 73 | - public Map<String, Object> findVersionInfo(@RequestParam String lineCode){ | |
| 74 | - return geoDataService.findVersionInfo(lineCode); | |
| 75 | - } | |
| 1 | +package com.bsth.controller.geo_data; | |
| 2 | + | |
| 3 | +import com.bsth.entity.geo_data.GeoRoad; | |
| 4 | +import com.bsth.entity.geo_data.GeoStation; | |
| 5 | +import com.bsth.service.geo_data.GeoDataService; | |
| 6 | +import org.springframework.beans.factory.annotation.Autowired; | |
| 7 | +import org.springframework.web.bind.annotation.RequestMapping; | |
| 8 | +import org.springframework.web.bind.annotation.RequestMethod; | |
| 9 | +import org.springframework.web.bind.annotation.RequestParam; | |
| 10 | +import org.springframework.web.bind.annotation.RestController; | |
| 11 | + | |
| 12 | +import java.util.Map; | |
| 13 | + | |
| 14 | +/** | |
| 15 | + * Created by panzhao on 2017/12/7. | |
| 16 | + */ | |
| 17 | +@RestController | |
| 18 | +@RequestMapping("/_geo_data") | |
| 19 | +public class GeoDataController { | |
| 20 | + | |
| 21 | + @Autowired | |
| 22 | + GeoDataService geoDataService; | |
| 23 | + | |
| 24 | + @RequestMapping("findGeoStations") | |
| 25 | + public Map<String, Object> findGeoStations(@RequestParam String lineCode){ | |
| 26 | + return geoDataService.findGeoStations(lineCode); | |
| 27 | + } | |
| 28 | + | |
| 29 | + | |
| 30 | + @RequestMapping("findGeoRoad") | |
| 31 | + public Map<String, Object> findGeoRoad(@RequestParam String lineCode){ | |
| 32 | + return geoDataService.findGeoRoad(lineCode); | |
| 33 | + } | |
| 34 | + | |
| 35 | + @RequestMapping(value = "updateBufferInfo",method = RequestMethod.POST) | |
| 36 | + public Map<String, Object> updateBufferInfo(GeoStation station){ | |
| 37 | + return geoDataService.updateBufferInfo(station); | |
| 38 | + } | |
| 39 | + | |
| 40 | + @RequestMapping(value = "updateStationName",method = RequestMethod.POST) | |
| 41 | + public Map<String, Object> updateStationName(@RequestParam Map<String, Object> map){ | |
| 42 | + return geoDataService.updateStationName(map); | |
| 43 | + } | |
| 44 | + | |
| 45 | + @RequestMapping(value = "addNewStationRoute",method = RequestMethod.POST) | |
| 46 | + public Map<String, Object> addNewStationRoute(@RequestParam String lineCode,@RequestParam int versions,@RequestParam int upDown | |
| 47 | + ,@RequestParam String stationName,@RequestParam Float lat,@RequestParam Float lng,@RequestParam int prevRouteId){ | |
| 48 | + return geoDataService.addNewStationRoute(lineCode, upDown, versions, stationName, lat, lng, prevRouteId); | |
| 49 | + } | |
| 50 | + | |
| 51 | + @RequestMapping(value = "addNewRoadRoute",method = RequestMethod.POST) | |
| 52 | + public Map<String, Object> addNewRoadRoute(@RequestParam String lineCode,@RequestParam int versions,@RequestParam int upDown | |
| 53 | + ,@RequestParam String sectionName,@RequestParam String crosesRoad,@RequestParam String coords,@RequestParam int prevRouteId){ | |
| 54 | + return geoDataService.addNewRoadRoute(lineCode, upDown, versions, sectionName, crosesRoad, coords, prevRouteId); | |
| 55 | + } | |
| 56 | + | |
| 57 | + @RequestMapping(value = "destroyStation",method = RequestMethod.POST) | |
| 58 | + public Map<String, Object> destroyStation(GeoStation station){ | |
| 59 | + return geoDataService.destroyStation(station); | |
| 60 | + } | |
| 61 | + | |
| 62 | + @RequestMapping(value = "updateRoadInfo",method = RequestMethod.POST) | |
| 63 | + public Map<String, Object> updateRoadInfo(GeoRoad road){ | |
| 64 | + return geoDataService.updateRoadInfo(road); | |
| 65 | + } | |
| 66 | + | |
| 67 | + @RequestMapping(value = "destroyRoad",method = RequestMethod.POST) | |
| 68 | + public Map<String, Object> destroyRoad(GeoRoad road){ | |
| 69 | + return geoDataService.destroyRoad(road); | |
| 70 | + } | |
| 71 | + | |
| 72 | + @RequestMapping("findVersionInfo") | |
| 73 | + public Map<String, Object> findVersionInfo(@RequestParam String lineCode){ | |
| 74 | + return geoDataService.findVersionInfo(lineCode); | |
| 75 | + } | |
| 76 | 76 | } |
| 77 | 77 | \ No newline at end of file | ... | ... |
src/main/java/com/bsth/controller/schedule/core/TTInfoController.java
| ... | ... | @@ -2,16 +2,14 @@ package com.bsth.controller.schedule.core; |
| 2 | 2 | |
| 3 | 3 | import com.bsth.common.ResponseCode; |
| 4 | 4 | import com.bsth.controller.schedule.BController; |
| 5 | -import com.bsth.entity.LineVersions; | |
| 6 | 5 | import com.bsth.entity.schedule.TTInfo; |
| 7 | -import com.bsth.service.LineVersionsService; | |
| 8 | 6 | import com.bsth.service.schedule.TTInfoService; |
| 9 | 7 | import com.bsth.service.schedule.exception.ScheduleException; |
| 10 | -import org.joda.time.DateTime; | |
| 11 | 8 | import org.springframework.beans.factory.annotation.Autowired; |
| 12 | 9 | import org.springframework.web.bind.annotation.*; |
| 13 | 10 | |
| 14 | -import java.util.*; | |
| 11 | +import java.util.HashMap; | |
| 12 | +import java.util.Map; | |
| 15 | 13 | |
| 16 | 14 | /** |
| 17 | 15 | * Created by xu on 16/12/20. |
| ... | ... | @@ -21,47 +19,13 @@ import java.util.*; |
| 21 | 19 | public class TTInfoController extends BController<TTInfo, Long> { |
| 22 | 20 | @Autowired |
| 23 | 21 | private TTInfoService ttInfoService; |
| 24 | - @Autowired | |
| 25 | - private LineVersionsService lineVersionsService; | |
| 26 | 22 | |
| 27 | 23 | @RequestMapping(value = "/stationroute/{lineid}", method = RequestMethod.GET) |
| 28 | 24 | public Map<String, Object> getLineStationRouteVersions(@PathVariable(value = "lineid") Integer lineid) { |
| 29 | 25 | Map<String, Object> rtn = new HashMap<>(); |
| 30 | 26 | try { |
| 31 | - List<LineVersions> lineVersionses = lineVersionsService.findByLineCode(lineid); | |
| 32 | - Collections.sort(lineVersionses, new Comparator<LineVersions>() { | |
| 33 | - @Override | |
| 34 | - public int compare(LineVersions o1, LineVersions o2) { | |
| 35 | - if (o1.getVersions() > o2.getVersions()) { | |
| 36 | - return -1; | |
| 37 | - } else if (o1.getVersions() < o2.getVersions()) { | |
| 38 | - return 1; | |
| 39 | - } else { | |
| 40 | - return 0; | |
| 41 | - } | |
| 42 | - } | |
| 43 | - }); | |
| 44 | - | |
| 45 | - // 取最近2条记录 | |
| 46 | - List<Map<String, Object>> mapList = new ArrayList<>(); | |
| 47 | - for (LineVersions lv: lineVersionses) { | |
| 48 | - String vname = lv.getName(); | |
| 49 | - String rq = lv.getStartDate() == null ? "未知启用日期" : new DateTime(lv.getStartDate()).toString("YYYY年MM月dd日"); | |
| 50 | - String sdesc = lv.getStatus() == 0 ? "历史" : (lv.getStatus() == 1 ? "当前" : "待更新"); | |
| 51 | - | |
| 52 | - Map<String, Object> value = new HashMap<>(); | |
| 53 | - value.put("desc", vname + "-" + rq + "-" + sdesc); | |
| 54 | - value.put("version", lv.getVersions()); | |
| 55 | - | |
| 56 | - mapList.add(value); | |
| 57 | - | |
| 58 | - if (mapList.size() == 2) { | |
| 59 | - break; | |
| 60 | - } | |
| 61 | - } | |
| 62 | - | |
| 63 | 27 | rtn.put("status", ResponseCode.SUCCESS); |
| 64 | - rtn.put("data", mapList); | |
| 28 | + rtn.put("data", ttInfoService.getLineStationRouteVersions(lineid)); | |
| 65 | 29 | |
| 66 | 30 | } catch (Exception exp) { |
| 67 | 31 | rtn.put("status", ResponseCode.ERROR); |
| ... | ... | @@ -72,6 +36,25 @@ public class TTInfoController extends BController<TTInfo, Long> { |
| 72 | 36 | |
| 73 | 37 | } |
| 74 | 38 | |
| 39 | + @RequestMapping(value = "/versiondesc/{lineid}/{version}") | |
| 40 | + public Map<String, Object> getLineVersionDesc( | |
| 41 | + @PathVariable(value = "lineid") Integer lineid, | |
| 42 | + @PathVariable(value = "version") Integer version) { | |
| 43 | + Map<String, Object> rtn = new HashMap<>(); | |
| 44 | + try { | |
| 45 | + Map<String, String> desc = new HashMap<>(); | |
| 46 | + desc.put("desc", ttInfoService.getLineVersionDesc(lineid, version)); | |
| 47 | + rtn.put("status", ResponseCode.SUCCESS); | |
| 48 | + rtn.put("data", desc); | |
| 49 | + | |
| 50 | + } catch (Exception exp) { | |
| 51 | + rtn.put("status", ResponseCode.ERROR); | |
| 52 | + rtn.put("msg", exp.getMessage()); | |
| 53 | + } | |
| 54 | + | |
| 55 | + return rtn; | |
| 56 | + } | |
| 57 | + | |
| 75 | 58 | @RequestMapping(value = "/validate_name", method = RequestMethod.GET) |
| 76 | 59 | public Map<String, Object> validate_name(@RequestParam Map<String, Object> param) { |
| 77 | 60 | Map<String, Object> rtn = new HashMap<>(); | ... | ... |
src/main/java/com/bsth/controller/schedule/core/TTInfoDetailController.java
| ... | ... | @@ -108,10 +108,10 @@ public class TTInfoDetailController extends BController<TTInfoDetail, Long> { |
| 108 | 108 | } |
| 109 | 109 | |
| 110 | 110 | @RequestMapping(value = "/zd_tcc", method = RequestMethod.GET) |
| 111 | - public Map<String, Object> getZdAndTccInfo(Integer lineid, Integer xldir) { | |
| 111 | + public Map<String, Object> getZdAndTccInfo(Integer lineid, Integer xldir, Integer lineversion) { | |
| 112 | 112 | Map<String, Object> rtn = new HashMap<>(); |
| 113 | 113 | try { |
| 114 | - List<Map<String, Object>> list = ttInfoDetailService.findZdAndTcc(lineid, xldir); | |
| 114 | + List<Map<String, Object>> list = ttInfoDetailService.findZdAndTcc(lineid, xldir, lineversion); | |
| 115 | 115 | rtn.put("status", ResponseCode.SUCCESS); |
| 116 | 116 | rtn.put("data", list); |
| 117 | 117 | } catch (Exception exp) { | ... | ... |
src/main/java/com/bsth/entity/geo_data/GeoLineVersionInfo.java
| 1 | -package com.bsth.entity.geo_data; | |
| 2 | - | |
| 3 | -import java.util.Date; | |
| 4 | - | |
| 5 | -/** | |
| 6 | - * 线路版本信息 | |
| 7 | - * Created by panzhao on 2017/12/18. | |
| 8 | - */ | |
| 9 | -public class GeoLineVersionInfo { | |
| 10 | - /** ID 主键(唯一标识符) int length(11) */ | |
| 11 | - private Integer id; | |
| 12 | - | |
| 13 | - /** 线路版本名字 varchar length(50) | |
| 14 | - * 给排版人员选版本使用 | |
| 15 | - * */ | |
| 16 | - private String name; | |
| 17 | - | |
| 18 | - /** 线路ID int length(11) */ | |
| 19 | - private Integer line; | |
| 20 | - | |
| 21 | - /** 线路编码 varchar length(50) */ | |
| 22 | - private String lineCode; | |
| 23 | - | |
| 24 | - /** 版本号 int length(11) */ | |
| 25 | - private int versions; | |
| 26 | - | |
| 27 | - /** 启用日期 timestamp */ | |
| 28 | - private Date startDate; | |
| 29 | - | |
| 30 | - /** 终止日期 timestamp */ | |
| 31 | - private Date endDate; | |
| 32 | - | |
| 33 | - /** 创建日期 timestamp */ | |
| 34 | - private Date createDate; | |
| 35 | - | |
| 36 | - /** 修改日期 timestamp */ | |
| 37 | - private Date updateDate; | |
| 38 | - | |
| 39 | - /** 备注 varchar length(50) */ | |
| 40 | - private String remark; | |
| 41 | - | |
| 42 | - /** 版本状态 int length(11) | |
| 43 | - * 0(历史版本),1(当前版本),2(待更新版本) | |
| 44 | - */ | |
| 45 | - private int status; | |
| 46 | - | |
| 47 | - /** | |
| 48 | - * 是否发布 int length(1) | |
| 49 | - * 0(没有),1(发布) | |
| 50 | - */ | |
| 51 | - private int isupdate; | |
| 52 | - | |
| 53 | - private String lineName; | |
| 54 | - | |
| 55 | - public Integer getId() { | |
| 56 | - return id; | |
| 57 | - } | |
| 58 | - | |
| 59 | - public void setId(Integer id) { | |
| 60 | - this.id = id; | |
| 61 | - } | |
| 62 | - | |
| 63 | - public String getName() { | |
| 64 | - return name; | |
| 65 | - } | |
| 66 | - | |
| 67 | - public void setName(String name) { | |
| 68 | - this.name = name; | |
| 69 | - } | |
| 70 | - | |
| 71 | - public String getLineCode() { | |
| 72 | - return lineCode; | |
| 73 | - } | |
| 74 | - | |
| 75 | - public void setLineCode(String lineCode) { | |
| 76 | - this.lineCode = lineCode; | |
| 77 | - } | |
| 78 | - | |
| 79 | - public int getVersions() { | |
| 80 | - return versions; | |
| 81 | - } | |
| 82 | - | |
| 83 | - public void setVersions(int versions) { | |
| 84 | - this.versions = versions; | |
| 85 | - } | |
| 86 | - | |
| 87 | - public Date getStartDate() { | |
| 88 | - return startDate; | |
| 89 | - } | |
| 90 | - | |
| 91 | - public void setStartDate(Date startDate) { | |
| 92 | - this.startDate = startDate; | |
| 93 | - } | |
| 94 | - | |
| 95 | - public Date getEndDate() { | |
| 96 | - return endDate; | |
| 97 | - } | |
| 98 | - | |
| 99 | - public void setEndDate(Date endDate) { | |
| 100 | - this.endDate = endDate; | |
| 101 | - } | |
| 102 | - | |
| 103 | - public Date getCreateDate() { | |
| 104 | - return createDate; | |
| 105 | - } | |
| 106 | - | |
| 107 | - public void setCreateDate(Date createDate) { | |
| 108 | - this.createDate = createDate; | |
| 109 | - } | |
| 110 | - | |
| 111 | - public Date getUpdateDate() { | |
| 112 | - return updateDate; | |
| 113 | - } | |
| 114 | - | |
| 115 | - public void setUpdateDate(Date updateDate) { | |
| 116 | - this.updateDate = updateDate; | |
| 117 | - } | |
| 118 | - | |
| 119 | - public String getRemark() { | |
| 120 | - return remark; | |
| 121 | - } | |
| 122 | - | |
| 123 | - public void setRemark(String remark) { | |
| 124 | - this.remark = remark; | |
| 125 | - } | |
| 126 | - | |
| 127 | - public int getStatus() { | |
| 128 | - return status; | |
| 129 | - } | |
| 130 | - | |
| 131 | - public void setStatus(int status) { | |
| 132 | - this.status = status; | |
| 133 | - } | |
| 134 | - | |
| 135 | - public int getIsupdate() { | |
| 136 | - return isupdate; | |
| 137 | - } | |
| 138 | - | |
| 139 | - public void setIsupdate(int isupdate) { | |
| 140 | - this.isupdate = isupdate; | |
| 141 | - } | |
| 142 | - | |
| 143 | - public String getLineName() { | |
| 144 | - return lineName; | |
| 145 | - } | |
| 146 | - | |
| 147 | - public void setLineName(String lineName) { | |
| 148 | - this.lineName = lineName; | |
| 149 | - } | |
| 150 | - | |
| 151 | - public Integer getLine() { | |
| 152 | - return line; | |
| 153 | - } | |
| 154 | - | |
| 155 | - public void setLine(Integer line) { | |
| 156 | - this.line = line; | |
| 157 | - } | |
| 158 | -} | |
| 1 | +package com.bsth.entity.geo_data; | |
| 2 | + | |
| 3 | +import java.util.Date; | |
| 4 | + | |
| 5 | +/** | |
| 6 | + * 线路版本信息 | |
| 7 | + * Created by panzhao on 2017/12/18. | |
| 8 | + */ | |
| 9 | +public class GeoLineVersionInfo { | |
| 10 | + /** ID 主键(唯一标识符) int length(11) */ | |
| 11 | + private Integer id; | |
| 12 | + | |
| 13 | + /** 线路版本名字 varchar length(50) | |
| 14 | + * 给排版人员选版本使用 | |
| 15 | + * */ | |
| 16 | + private String name; | |
| 17 | + | |
| 18 | + /** 线路ID int length(11) */ | |
| 19 | + private Integer line; | |
| 20 | + | |
| 21 | + /** 线路编码 varchar length(50) */ | |
| 22 | + private String lineCode; | |
| 23 | + | |
| 24 | + /** 版本号 int length(11) */ | |
| 25 | + private int versions; | |
| 26 | + | |
| 27 | + /** 启用日期 timestamp */ | |
| 28 | + private Date startDate; | |
| 29 | + | |
| 30 | + /** 终止日期 timestamp */ | |
| 31 | + private Date endDate; | |
| 32 | + | |
| 33 | + /** 创建日期 timestamp */ | |
| 34 | + private Date createDate; | |
| 35 | + | |
| 36 | + /** 修改日期 timestamp */ | |
| 37 | + private Date updateDate; | |
| 38 | + | |
| 39 | + /** 备注 varchar length(50) */ | |
| 40 | + private String remark; | |
| 41 | + | |
| 42 | + /** 版本状态 int length(11) | |
| 43 | + * 0(历史版本),1(当前版本),2(待更新版本) | |
| 44 | + */ | |
| 45 | + private int status; | |
| 46 | + | |
| 47 | + /** | |
| 48 | + * 是否发布 int length(1) | |
| 49 | + * 0(没有),1(发布) | |
| 50 | + */ | |
| 51 | + private int isupdate; | |
| 52 | + | |
| 53 | + private String lineName; | |
| 54 | + | |
| 55 | + public Integer getId() { | |
| 56 | + return id; | |
| 57 | + } | |
| 58 | + | |
| 59 | + public void setId(Integer id) { | |
| 60 | + this.id = id; | |
| 61 | + } | |
| 62 | + | |
| 63 | + public String getName() { | |
| 64 | + return name; | |
| 65 | + } | |
| 66 | + | |
| 67 | + public void setName(String name) { | |
| 68 | + this.name = name; | |
| 69 | + } | |
| 70 | + | |
| 71 | + public String getLineCode() { | |
| 72 | + return lineCode; | |
| 73 | + } | |
| 74 | + | |
| 75 | + public void setLineCode(String lineCode) { | |
| 76 | + this.lineCode = lineCode; | |
| 77 | + } | |
| 78 | + | |
| 79 | + public int getVersions() { | |
| 80 | + return versions; | |
| 81 | + } | |
| 82 | + | |
| 83 | + public void setVersions(int versions) { | |
| 84 | + this.versions = versions; | |
| 85 | + } | |
| 86 | + | |
| 87 | + public Date getStartDate() { | |
| 88 | + return startDate; | |
| 89 | + } | |
| 90 | + | |
| 91 | + public void setStartDate(Date startDate) { | |
| 92 | + this.startDate = startDate; | |
| 93 | + } | |
| 94 | + | |
| 95 | + public Date getEndDate() { | |
| 96 | + return endDate; | |
| 97 | + } | |
| 98 | + | |
| 99 | + public void setEndDate(Date endDate) { | |
| 100 | + this.endDate = endDate; | |
| 101 | + } | |
| 102 | + | |
| 103 | + public Date getCreateDate() { | |
| 104 | + return createDate; | |
| 105 | + } | |
| 106 | + | |
| 107 | + public void setCreateDate(Date createDate) { | |
| 108 | + this.createDate = createDate; | |
| 109 | + } | |
| 110 | + | |
| 111 | + public Date getUpdateDate() { | |
| 112 | + return updateDate; | |
| 113 | + } | |
| 114 | + | |
| 115 | + public void setUpdateDate(Date updateDate) { | |
| 116 | + this.updateDate = updateDate; | |
| 117 | + } | |
| 118 | + | |
| 119 | + public String getRemark() { | |
| 120 | + return remark; | |
| 121 | + } | |
| 122 | + | |
| 123 | + public void setRemark(String remark) { | |
| 124 | + this.remark = remark; | |
| 125 | + } | |
| 126 | + | |
| 127 | + public int getStatus() { | |
| 128 | + return status; | |
| 129 | + } | |
| 130 | + | |
| 131 | + public void setStatus(int status) { | |
| 132 | + this.status = status; | |
| 133 | + } | |
| 134 | + | |
| 135 | + public int getIsupdate() { | |
| 136 | + return isupdate; | |
| 137 | + } | |
| 138 | + | |
| 139 | + public void setIsupdate(int isupdate) { | |
| 140 | + this.isupdate = isupdate; | |
| 141 | + } | |
| 142 | + | |
| 143 | + public String getLineName() { | |
| 144 | + return lineName; | |
| 145 | + } | |
| 146 | + | |
| 147 | + public void setLineName(String lineName) { | |
| 148 | + this.lineName = lineName; | |
| 149 | + } | |
| 150 | + | |
| 151 | + public Integer getLine() { | |
| 152 | + return line; | |
| 153 | + } | |
| 154 | + | |
| 155 | + public void setLine(Integer line) { | |
| 156 | + this.line = line; | |
| 157 | + } | |
| 158 | +} | ... | ... |
src/main/java/com/bsth/entity/geo_data/GeoStation.java
| 1 | -package com.bsth.entity.geo_data; | |
| 2 | - | |
| 3 | -import com.fasterxml.jackson.annotation.JsonIgnore; | |
| 4 | - | |
| 5 | -import java.util.List; | |
| 6 | - | |
| 7 | -/** | |
| 8 | - * Created by panzhao on 2017/12/7. | |
| 9 | - */ | |
| 10 | -public class GeoStation { | |
| 11 | - | |
| 12 | - private int id; | |
| 13 | - | |
| 14 | - private String stationName; | |
| 15 | - | |
| 16 | - private String stationRouteCode; | |
| 17 | - | |
| 18 | - private String lineCode; | |
| 19 | - | |
| 20 | - private Integer directions; | |
| 21 | - | |
| 22 | - private String stationCode; | |
| 23 | - | |
| 24 | - private String stationMark; | |
| 25 | - | |
| 26 | - private Integer versions; | |
| 27 | - | |
| 28 | - private Float gLonx; | |
| 29 | - | |
| 30 | - private Float gLaty; | |
| 31 | - | |
| 32 | - @JsonIgnore | |
| 33 | - private String gPolygonGrid; | |
| 34 | - | |
| 35 | - private List<String> bdCoords; | |
| 36 | - | |
| 37 | - private Integer radius; | |
| 38 | - | |
| 39 | - private String shapesType; | |
| 40 | - | |
| 41 | - public int getId() { | |
| 42 | - return id; | |
| 43 | - } | |
| 44 | - | |
| 45 | - public void setId(int id) { | |
| 46 | - this.id = id; | |
| 47 | - } | |
| 48 | - | |
| 49 | - public String getStationName() { | |
| 50 | - return stationName; | |
| 51 | - } | |
| 52 | - | |
| 53 | - public void setStationName(String stationName) { | |
| 54 | - this.stationName = stationName; | |
| 55 | - } | |
| 56 | - | |
| 57 | - public String getStationRouteCode() { | |
| 58 | - return stationRouteCode; | |
| 59 | - } | |
| 60 | - | |
| 61 | - public void setStationRouteCode(String stationRouteCode) { | |
| 62 | - this.stationRouteCode = stationRouteCode; | |
| 63 | - } | |
| 64 | - | |
| 65 | - public String getLineCode() { | |
| 66 | - return lineCode; | |
| 67 | - } | |
| 68 | - | |
| 69 | - public void setLineCode(String lineCode) { | |
| 70 | - this.lineCode = lineCode; | |
| 71 | - } | |
| 72 | - | |
| 73 | - public Integer getDirections() { | |
| 74 | - return directions; | |
| 75 | - } | |
| 76 | - | |
| 77 | - public void setDirections(Integer directions) { | |
| 78 | - this.directions = directions; | |
| 79 | - } | |
| 80 | - | |
| 81 | - public String getStationCode() { | |
| 82 | - return stationCode; | |
| 83 | - } | |
| 84 | - | |
| 85 | - public void setStationCode(String stationCode) { | |
| 86 | - this.stationCode = stationCode; | |
| 87 | - } | |
| 88 | - | |
| 89 | - public String getStationMark() { | |
| 90 | - return stationMark; | |
| 91 | - } | |
| 92 | - | |
| 93 | - public void setStationMark(String stationMark) { | |
| 94 | - this.stationMark = stationMark; | |
| 95 | - } | |
| 96 | - | |
| 97 | - public Float getgLonx() { | |
| 98 | - return gLonx; | |
| 99 | - } | |
| 100 | - | |
| 101 | - public void setgLonx(Float gLonx) { | |
| 102 | - this.gLonx = gLonx; | |
| 103 | - } | |
| 104 | - | |
| 105 | - public Float getgLaty() { | |
| 106 | - return gLaty; | |
| 107 | - } | |
| 108 | - | |
| 109 | - public void setgLaty(Float gLaty) { | |
| 110 | - this.gLaty = gLaty; | |
| 111 | - } | |
| 112 | - | |
| 113 | - public String getgPolygonGrid() { | |
| 114 | - return gPolygonGrid; | |
| 115 | - } | |
| 116 | - | |
| 117 | - public void setgPolygonGrid(String gPolygonGrid) { | |
| 118 | - this.gPolygonGrid = gPolygonGrid; | |
| 119 | - } | |
| 120 | - | |
| 121 | - public Integer getRadius() { | |
| 122 | - return radius; | |
| 123 | - } | |
| 124 | - | |
| 125 | - public void setRadius(Integer radius) { | |
| 126 | - this.radius = radius; | |
| 127 | - } | |
| 128 | - | |
| 129 | - public String getShapesType() { | |
| 130 | - return shapesType; | |
| 131 | - } | |
| 132 | - | |
| 133 | - public void setShapesType(String shapesType) { | |
| 134 | - this.shapesType = shapesType; | |
| 135 | - } | |
| 136 | - | |
| 137 | - public List<String> getBdCoords() { | |
| 138 | - return bdCoords; | |
| 139 | - } | |
| 140 | - | |
| 141 | - public void setBdCoords(List<String> bdCoords) { | |
| 142 | - this.bdCoords = bdCoords; | |
| 143 | - } | |
| 144 | - | |
| 145 | - public Integer getVersions() { | |
| 146 | - return versions; | |
| 147 | - } | |
| 148 | - | |
| 149 | - public void setVersions(Integer versions) { | |
| 150 | - this.versions = versions; | |
| 151 | - } | |
| 1 | +package com.bsth.entity.geo_data; | |
| 2 | + | |
| 3 | +import com.fasterxml.jackson.annotation.JsonIgnore; | |
| 4 | + | |
| 5 | +import java.util.List; | |
| 6 | + | |
| 7 | +/** | |
| 8 | + * Created by panzhao on 2017/12/7. | |
| 9 | + */ | |
| 10 | +public class GeoStation { | |
| 11 | + | |
| 12 | + private int id; | |
| 13 | + | |
| 14 | + private String stationName; | |
| 15 | + | |
| 16 | + private String stationRouteCode; | |
| 17 | + | |
| 18 | + private String lineCode; | |
| 19 | + | |
| 20 | + private Integer directions; | |
| 21 | + | |
| 22 | + private String stationCode; | |
| 23 | + | |
| 24 | + private String stationMark; | |
| 25 | + | |
| 26 | + private Integer versions; | |
| 27 | + | |
| 28 | + private Float gLonx; | |
| 29 | + | |
| 30 | + private Float gLaty; | |
| 31 | + | |
| 32 | + @JsonIgnore | |
| 33 | + private String gPolygonGrid; | |
| 34 | + | |
| 35 | + private List<String> bdCoords; | |
| 36 | + | |
| 37 | + private Integer radius; | |
| 38 | + | |
| 39 | + private String shapesType; | |
| 40 | + | |
| 41 | + public int getId() { | |
| 42 | + return id; | |
| 43 | + } | |
| 44 | + | |
| 45 | + public void setId(int id) { | |
| 46 | + this.id = id; | |
| 47 | + } | |
| 48 | + | |
| 49 | + public String getStationName() { | |
| 50 | + return stationName; | |
| 51 | + } | |
| 52 | + | |
| 53 | + public void setStationName(String stationName) { | |
| 54 | + this.stationName = stationName; | |
| 55 | + } | |
| 56 | + | |
| 57 | + public String getStationRouteCode() { | |
| 58 | + return stationRouteCode; | |
| 59 | + } | |
| 60 | + | |
| 61 | + public void setStationRouteCode(String stationRouteCode) { | |
| 62 | + this.stationRouteCode = stationRouteCode; | |
| 63 | + } | |
| 64 | + | |
| 65 | + public String getLineCode() { | |
| 66 | + return lineCode; | |
| 67 | + } | |
| 68 | + | |
| 69 | + public void setLineCode(String lineCode) { | |
| 70 | + this.lineCode = lineCode; | |
| 71 | + } | |
| 72 | + | |
| 73 | + public Integer getDirections() { | |
| 74 | + return directions; | |
| 75 | + } | |
| 76 | + | |
| 77 | + public void setDirections(Integer directions) { | |
| 78 | + this.directions = directions; | |
| 79 | + } | |
| 80 | + | |
| 81 | + public String getStationCode() { | |
| 82 | + return stationCode; | |
| 83 | + } | |
| 84 | + | |
| 85 | + public void setStationCode(String stationCode) { | |
| 86 | + this.stationCode = stationCode; | |
| 87 | + } | |
| 88 | + | |
| 89 | + public String getStationMark() { | |
| 90 | + return stationMark; | |
| 91 | + } | |
| 92 | + | |
| 93 | + public void setStationMark(String stationMark) { | |
| 94 | + this.stationMark = stationMark; | |
| 95 | + } | |
| 96 | + | |
| 97 | + public Float getgLonx() { | |
| 98 | + return gLonx; | |
| 99 | + } | |
| 100 | + | |
| 101 | + public void setgLonx(Float gLonx) { | |
| 102 | + this.gLonx = gLonx; | |
| 103 | + } | |
| 104 | + | |
| 105 | + public Float getgLaty() { | |
| 106 | + return gLaty; | |
| 107 | + } | |
| 108 | + | |
| 109 | + public void setgLaty(Float gLaty) { | |
| 110 | + this.gLaty = gLaty; | |
| 111 | + } | |
| 112 | + | |
| 113 | + public String getgPolygonGrid() { | |
| 114 | + return gPolygonGrid; | |
| 115 | + } | |
| 116 | + | |
| 117 | + public void setgPolygonGrid(String gPolygonGrid) { | |
| 118 | + this.gPolygonGrid = gPolygonGrid; | |
| 119 | + } | |
| 120 | + | |
| 121 | + public Integer getRadius() { | |
| 122 | + return radius; | |
| 123 | + } | |
| 124 | + | |
| 125 | + public void setRadius(Integer radius) { | |
| 126 | + this.radius = radius; | |
| 127 | + } | |
| 128 | + | |
| 129 | + public String getShapesType() { | |
| 130 | + return shapesType; | |
| 131 | + } | |
| 132 | + | |
| 133 | + public void setShapesType(String shapesType) { | |
| 134 | + this.shapesType = shapesType; | |
| 135 | + } | |
| 136 | + | |
| 137 | + public List<String> getBdCoords() { | |
| 138 | + return bdCoords; | |
| 139 | + } | |
| 140 | + | |
| 141 | + public void setBdCoords(List<String> bdCoords) { | |
| 142 | + this.bdCoords = bdCoords; | |
| 143 | + } | |
| 144 | + | |
| 145 | + public Integer getVersions() { | |
| 146 | + return versions; | |
| 147 | + } | |
| 148 | + | |
| 149 | + public void setVersions(Integer versions) { | |
| 150 | + this.versions = versions; | |
| 151 | + } | |
| 152 | 152 | } |
| 153 | 153 | \ No newline at end of file | ... | ... |
src/main/java/com/bsth/entity/schedule/TTInfo.java
| ... | ... | @@ -67,6 +67,10 @@ public class TTInfo extends BEntity { |
| 67 | 67 | /** 最近备份日期 */ |
| 68 | 68 | private Date lastBackUpDate; |
| 69 | 69 | |
| 70 | + /** 线路版本(bsth_c_line_versions表对应字段) */ | |
| 71 | + @Column(nullable = false) | |
| 72 | + private int lineVersion; | |
| 73 | + | |
| 70 | 74 | public TTInfo() {} |
| 71 | 75 | public TTInfo(Object id, Object xlid, Object name, Object nds, Object sds) { |
| 72 | 76 | if (id != null) { |
| ... | ... | @@ -109,7 +113,9 @@ public class TTInfo extends BEntity { |
| 109 | 113 | .setUpdateUser(getUpdateBy() == null ? 0 : getUpdateBy().getId()) |
| 110 | 114 | .setUpdateUserName(getUpdateBy() == null ? "" : getUpdateBy().getUserName()) |
| 111 | 115 | .setCreateDate(getCreateDate() == null ? 0l : getCreateDate().getTime()) |
| 112 | - .setUpdateDate(getUpdateDate() == null ? 0l : getUpdateDate().getTime()); | |
| 116 | + .setUpdateDate(getUpdateDate() == null ? 0l : getUpdateDate().getTime()) | |
| 117 | + .setLineVersion(lineVersion) | |
| 118 | + ; | |
| 113 | 119 | |
| 114 | 120 | } |
| 115 | 121 | |
| ... | ... | @@ -216,4 +222,12 @@ public class TTInfo extends BEntity { |
| 216 | 222 | public void setLastBackUpDate(Date lastBackUpDate) { |
| 217 | 223 | this.lastBackUpDate = lastBackUpDate; |
| 218 | 224 | } |
| 225 | + | |
| 226 | + public int getLineVersion() { | |
| 227 | + return lineVersion; | |
| 228 | + } | |
| 229 | + | |
| 230 | + public void setLineVersion(int lineVersion) { | |
| 231 | + this.lineVersion = lineVersion; | |
| 232 | + } | |
| 219 | 233 | } | ... | ... |
src/main/java/com/bsth/entity/schedule/TTInfoBackup.java
| ... | ... | @@ -36,6 +36,10 @@ public class TTInfoBackup { |
| 36 | 36 | @Lob |
| 37 | 37 | private byte[] backUpInfo; |
| 38 | 38 | |
| 39 | + /** 线路版本(bsth_c_line_versions表对应字段) */ | |
| 40 | + @Column(nullable = false) | |
| 41 | + private int lineVersion; | |
| 42 | + | |
| 39 | 43 | public Long getId() { |
| 40 | 44 | return id; |
| 41 | 45 | } |
| ... | ... | @@ -91,4 +95,12 @@ public class TTInfoBackup { |
| 91 | 95 | public void setBackUpInfo(byte[] backUpInfo) { |
| 92 | 96 | this.backUpInfo = backUpInfo; |
| 93 | 97 | } |
| 98 | + | |
| 99 | + public int getLineVersion() { | |
| 100 | + return lineVersion; | |
| 101 | + } | |
| 102 | + | |
| 103 | + public void setLineVersion(int lineVersion) { | |
| 104 | + this.lineVersion = lineVersion; | |
| 105 | + } | |
| 94 | 106 | } | ... | ... |
src/main/java/com/bsth/entity/schedule/TTInfoDetail.java
| ... | ... | @@ -100,6 +100,10 @@ public class TTInfoDetail extends BEntity { |
| 100 | 100 | /** 备注 */ |
| 101 | 101 | private String remark; |
| 102 | 102 | |
| 103 | + /** 线路版本(bsth_c_line_versions表对应字段) */ | |
| 104 | + @Column(nullable = false) | |
| 105 | + private int lineVersion; | |
| 106 | + | |
| 103 | 107 | /** |
| 104 | 108 | * 输出proto生成的builder |
| 105 | 109 | * @return |
| ... | ... | @@ -126,6 +130,7 @@ public class TTInfoDetail extends BEntity { |
| 126 | 130 | .setIsFB(isFB == null ? false : isFB) |
| 127 | 131 | .setIsTS(isTS == null ? false : isTS) |
| 128 | 132 | .setRemark(remark == null ? "" : remark) |
| 133 | + .setLineVersion(lineVersion) | |
| 129 | 134 | ; |
| 130 | 135 | } |
| 131 | 136 | |
| ... | ... | @@ -320,4 +325,12 @@ public class TTInfoDetail extends BEntity { |
| 320 | 325 | public void setIsTS(Boolean isTS) { |
| 321 | 326 | this.isTS = isTS; |
| 322 | 327 | } |
| 328 | + | |
| 329 | + public int getLineVersion() { | |
| 330 | + return lineVersion; | |
| 331 | + } | |
| 332 | + | |
| 333 | + public void setLineVersion(int lineVersion) { | |
| 334 | + this.lineVersion = lineVersion; | |
| 335 | + } | |
| 323 | 336 | } | ... | ... |
src/main/java/com/bsth/service/geo_data/GeoDataService.java
| 1 | -package com.bsth.service.geo_data; | |
| 2 | - | |
| 3 | -import com.bsth.entity.geo_data.GeoRoad; | |
| 4 | -import com.bsth.entity.geo_data.GeoStation; | |
| 5 | - | |
| 6 | -import java.util.Map; | |
| 7 | - | |
| 8 | -/** | |
| 9 | - * Created by panzhao on 2017/12/7. | |
| 10 | - */ | |
| 11 | -public interface GeoDataService { | |
| 12 | - | |
| 13 | - | |
| 14 | - Map<String, Object> findGeoStations(String lineCode); | |
| 15 | - | |
| 16 | - | |
| 17 | - Map<String, Object> findGeoRoad(String lineCode); | |
| 18 | - | |
| 19 | - Map<String, Object> updateBufferInfo(GeoStation station); | |
| 20 | - | |
| 21 | - Map<String, Object> updateStationName(Map<String, Object> map); | |
| 22 | - | |
| 23 | - Map<String,Object> addNewStationRoute(String lineCode, int upDown,int versions, String stationName, Float lat, Float lng, int prevRouteId); | |
| 24 | - | |
| 25 | - Map<String,Object> destroyStation(GeoStation station); | |
| 26 | - | |
| 27 | - Map<String,Object> updateRoadInfo(GeoRoad road); | |
| 28 | - | |
| 29 | - Map<String,Object> destroyRoad(GeoRoad road); | |
| 30 | - | |
| 31 | - Map<String,Object> addNewRoadRoute(String lineCode, int upDown, int versions, String sectionName,String crosesRoad, String coords, int prevRouteId); | |
| 32 | - | |
| 33 | - Map<String,Object> findVersionInfo(String lineCode); | |
| 34 | -} | |
| 1 | +package com.bsth.service.geo_data; | |
| 2 | + | |
| 3 | +import com.bsth.entity.geo_data.GeoRoad; | |
| 4 | +import com.bsth.entity.geo_data.GeoStation; | |
| 5 | + | |
| 6 | +import java.util.Map; | |
| 7 | + | |
| 8 | +/** | |
| 9 | + * Created by panzhao on 2017/12/7. | |
| 10 | + */ | |
| 11 | +public interface GeoDataService { | |
| 12 | + | |
| 13 | + | |
| 14 | + Map<String, Object> findGeoStations(String lineCode); | |
| 15 | + | |
| 16 | + | |
| 17 | + Map<String, Object> findGeoRoad(String lineCode); | |
| 18 | + | |
| 19 | + Map<String, Object> updateBufferInfo(GeoStation station); | |
| 20 | + | |
| 21 | + Map<String, Object> updateStationName(Map<String, Object> map); | |
| 22 | + | |
| 23 | + Map<String,Object> addNewStationRoute(String lineCode, int upDown,int versions, String stationName, Float lat, Float lng, int prevRouteId); | |
| 24 | + | |
| 25 | + Map<String,Object> destroyStation(GeoStation station); | |
| 26 | + | |
| 27 | + Map<String,Object> updateRoadInfo(GeoRoad road); | |
| 28 | + | |
| 29 | + Map<String,Object> destroyRoad(GeoRoad road); | |
| 30 | + | |
| 31 | + Map<String,Object> addNewRoadRoute(String lineCode, int upDown, int versions, String sectionName,String crosesRoad, String coords, int prevRouteId); | |
| 32 | + | |
| 33 | + Map<String,Object> findVersionInfo(String lineCode); | |
| 34 | +} | ... | ... |
src/main/java/com/bsth/service/geo_data/impl/GeoDataServiceImpl.java
| 1 | -package com.bsth.service.geo_data.impl; | |
| 2 | - | |
| 3 | -import com.bsth.common.ResponseCode; | |
| 4 | -import com.bsth.entity.geo_data.GeoLineVersionInfo; | |
| 5 | -import com.bsth.entity.geo_data.GeoRoad; | |
| 6 | -import com.bsth.entity.geo_data.GeoStation; | |
| 7 | -import com.bsth.service.geo_data.GeoDataService; | |
| 8 | -import com.bsth.util.GetUIDAndCode; | |
| 9 | -import com.bsth.util.TransGPS; | |
| 10 | -import com.google.common.base.Splitter; | |
| 11 | -import org.slf4j.Logger; | |
| 12 | -import org.slf4j.LoggerFactory; | |
| 13 | -import org.springframework.beans.factory.annotation.Autowired; | |
| 14 | -import org.springframework.jdbc.core.BatchPreparedStatementSetter; | |
| 15 | -import org.springframework.jdbc.core.BeanPropertyRowMapper; | |
| 16 | -import org.springframework.jdbc.core.JdbcTemplate; | |
| 17 | -import org.springframework.jdbc.datasource.DataSourceTransactionManager; | |
| 18 | -import org.springframework.stereotype.Service; | |
| 19 | -import org.springframework.transaction.TransactionDefinition; | |
| 20 | -import org.springframework.transaction.TransactionStatus; | |
| 21 | -import org.springframework.transaction.support.DefaultTransactionDefinition; | |
| 22 | - | |
| 23 | -import java.sql.PreparedStatement; | |
| 24 | -import java.sql.SQLException; | |
| 25 | -import java.util.*; | |
| 26 | - | |
| 27 | -/** | |
| 28 | - * Created by panzhao on 2017/12/8. | |
| 29 | - */ | |
| 30 | -@Service | |
| 31 | -public class GeoDataServiceImpl implements GeoDataService { | |
| 32 | - | |
| 33 | - @Autowired | |
| 34 | - JdbcTemplate jdbcTemplate; | |
| 35 | - | |
| 36 | - Logger logger = LoggerFactory.getLogger(this.getClass()); | |
| 37 | - | |
| 38 | - @Override | |
| 39 | - public Map<String, Object> findGeoStations(String lineCode) { | |
| 40 | - | |
| 41 | - Map<String, Object> map = new HashMap(); | |
| 42 | - try { | |
| 43 | - String sql = "select t1.*,t2.g_lonx,g_laty,ST_AsText(g_polygon_grid) as g_polygon_grid,radius,shapes_type from (select id,station_name,station_route_code,line_code,station_code,station_mark,versions,directions from bsth_c_ls_stationroute where line=" + lineCode + " and destroy=0 and versions in (select DISTINCT versions from bsth_c_stationroute where line=" + lineCode + " and destroy=0)) t1 LEFT JOIN bsth_c_station t2 on t1.station_code=t2.station_cod"; | |
| 44 | - | |
| 45 | - | |
| 46 | - List<GeoStation> list = jdbcTemplate.query(sql, BeanPropertyRowMapper.newInstance(GeoStation.class)); | |
| 47 | - | |
| 48 | - for (GeoStation station : list) { | |
| 49 | - if (station.getShapesType().equals("d")) | |
| 50 | - station.setBdCoords(multiWgsToBd(station.getgPolygonGrid(), 9, 3)); | |
| 51 | - } | |
| 52 | - map.put("status", ResponseCode.SUCCESS); | |
| 53 | - map.put("list", list); | |
| 54 | - } catch (Exception e) { | |
| 55 | - logger.error("", e); | |
| 56 | - map.put("status", ResponseCode.ERROR); | |
| 57 | - map.put("msg", "服务器出现异常"); | |
| 58 | - } | |
| 59 | - return map; | |
| 60 | - } | |
| 61 | - | |
| 62 | - @Override | |
| 63 | - public Map<String, Object> findGeoRoad(String lineCode) { | |
| 64 | - Map<String, Object> map = new HashMap(); | |
| 65 | - try { | |
| 66 | - String sql = "select t1.*,t2.section_name,t2.croses_road,ST_AsText(t2.gsection_vector) as gsection_vector from (select id,sectionroute_code,directions,line_code,section_code,versions from bsth_c_ls_sectionroute where line=" + lineCode + " and destroy=0 and versions in (select DISTINCT versions from bsth_c_sectionroute where line=" + lineCode + " and destroy=0)) t1 LEFT JOIN bsth_c_section t2 on t1.section_code=t2.section_code"; | |
| 67 | - | |
| 68 | - | |
| 69 | - List<GeoRoad> list = jdbcTemplate.query(sql, BeanPropertyRowMapper.newInstance(GeoRoad.class)); | |
| 70 | - | |
| 71 | - for (GeoRoad road : list) { | |
| 72 | - road.setBdCoords(multiWgsToBd(road.getGsectionVector(), 11, 2)); | |
| 73 | - } | |
| 74 | - map.put("status", ResponseCode.SUCCESS); | |
| 75 | - map.put("list", list); | |
| 76 | - } catch (Exception e) { | |
| 77 | - logger.error("", e); | |
| 78 | - map.put("status", ResponseCode.ERROR); | |
| 79 | - map.put("msg", "服务器出现异常"); | |
| 80 | - } | |
| 81 | - return map; | |
| 82 | - } | |
| 83 | - | |
| 84 | - /** | |
| 85 | - * 编辑缓冲区信息 | |
| 86 | - * | |
| 87 | - * @param station | |
| 88 | - * @return | |
| 89 | - */ | |
| 90 | - @Override | |
| 91 | - public Map<String, Object> updateBufferInfo(GeoStation station) { | |
| 92 | - Map<String, Object> rs = new HashMap<>(); | |
| 93 | - try { | |
| 94 | - //坐标转换 | |
| 95 | - TransGPS.Location loc = TransGPS.LocationMake(station.getgLonx(), station.getgLaty()); | |
| 96 | - loc = TransGPS.bd_decrypt(loc); | |
| 97 | - loc = TransGPS.transformFromGCJToWGS(loc); | |
| 98 | - station.setgLaty(Float.parseFloat(String.valueOf(loc.getLat()))); | |
| 99 | - station.setgLonx(Float.parseFloat(String.valueOf(loc.getLng()))); | |
| 100 | - | |
| 101 | - String sql; | |
| 102 | - String shapesType = station.getShapesType(); | |
| 103 | - int rsCount = -1; | |
| 104 | - if (shapesType.equals("r")) { | |
| 105 | - sql = "update bsth_c_station set g_lonx=?, g_laty=?, radius=?,shapes_type='r' where station_cod=?"; | |
| 106 | - rsCount = jdbcTemplate.update(sql, station.getgLonx(), station.getgLaty(), station.getRadius(), station.getStationCode()); | |
| 107 | - } else if (shapesType.equals("d")) { | |
| 108 | - //多边形坐标转换 | |
| 109 | - String bdPolygon = "POLYGON((" + station.getgPolygonGrid() + "))"; | |
| 110 | - String wgsPolygon = "POLYGON((" + bdPolygon2Wgs(station.getgPolygonGrid()) + "))"; | |
| 111 | - sql = "update bsth_c_station set g_lonx=?, g_laty=?,shapes_type='d', radius=null,b_polygon_grid=ST_GeomFromText('" + bdPolygon + "'),g_polygon_grid=ST_GeomFromText('" + wgsPolygon + "') where station_cod=?"; | |
| 112 | - | |
| 113 | - rsCount = jdbcTemplate.update(sql, station.getgLonx(), station.getgLaty(), station.getStationCode()); | |
| 114 | - } | |
| 115 | - | |
| 116 | - //从数据库里重新查询对象 | |
| 117 | - if (rsCount > 0) { | |
| 118 | - rs.put("station", findOne(station.getId())); | |
| 119 | - rs.put("status", ResponseCode.SUCCESS); | |
| 120 | - } | |
| 121 | - | |
| 122 | - } catch (Exception e) { | |
| 123 | - logger.error("", e); | |
| 124 | - rs.put("status", ResponseCode.ERROR); | |
| 125 | - rs.put("msg", "服务器出现异常"); | |
| 126 | - } | |
| 127 | - return rs; | |
| 128 | - } | |
| 129 | - | |
| 130 | - /** | |
| 131 | - * 修改站点路由和站点名称 | |
| 132 | - * | |
| 133 | - * @param map | |
| 134 | - * @return | |
| 135 | - */ | |
| 136 | - @Override | |
| 137 | - public Map<String, Object> updateStationName(Map<String, Object> map) { | |
| 138 | - Map<String, Object> rs = new HashMap<>(); | |
| 139 | - | |
| 140 | - //编程式事务 | |
| 141 | - DataSourceTransactionManager tran = new DataSourceTransactionManager(jdbcTemplate.getDataSource()); | |
| 142 | - DefaultTransactionDefinition def = new DefaultTransactionDefinition(); | |
| 143 | - def.setPropagationBehavior(TransactionDefinition.PROPAGATION_REQUIRED); | |
| 144 | - TransactionStatus status = tran.getTransaction(def); | |
| 145 | - try { | |
| 146 | - | |
| 147 | - int id = Integer.parseInt(map.get("id").toString()); | |
| 148 | - String name = map.get("stationName").toString(); | |
| 149 | - String code = map.get("stationCode").toString(); | |
| 150 | - //String lineCode = map.get("lineCode").toString(); | |
| 151 | - //String stationMark = map.get("stationMark").toString(); | |
| 152 | - | |
| 153 | - //更新历史站点路由 | |
| 154 | - jdbcTemplate.update("update bsth_c_ls_stationroute set station_name=? where id=?", name, id); | |
| 155 | - //更新站点 | |
| 156 | - jdbcTemplate.update("update bsth_c_station set station_name=? where station_cod=?", name, code); | |
| 157 | - | |
| 158 | - tran.commit(status); | |
| 159 | - | |
| 160 | - rs.put("station", findOne(id)); | |
| 161 | - rs.put("status", ResponseCode.SUCCESS); | |
| 162 | - } catch (Exception e) { | |
| 163 | - tran.rollback(status); | |
| 164 | - logger.error("", e); | |
| 165 | - rs.put("status", ResponseCode.ERROR); | |
| 166 | - rs.put("msg", "服务器出现异常"); | |
| 167 | - } | |
| 168 | - return rs; | |
| 169 | - } | |
| 170 | - | |
| 171 | - @Override | |
| 172 | - public Map<String, Object> addNewRoadRoute(String lineCode, int upDown, int versions, String sectionName,String crosesRoad, String coords, int prevRouteId) { | |
| 173 | - Map<String, Object> rs = new HashMap<>(); | |
| 174 | - | |
| 175 | - //编程式事务 | |
| 176 | - DataSourceTransactionManager tran = new DataSourceTransactionManager(jdbcTemplate.getDataSource()); | |
| 177 | - DefaultTransactionDefinition def = new DefaultTransactionDefinition(); | |
| 178 | - def.setPropagationBehavior(TransactionDefinition.PROPAGATION_REQUIRED); | |
| 179 | - TransactionStatus status = tran.getTransaction(def); | |
| 180 | - try { | |
| 181 | - //根据站点编码,查询站点ID | |
| 182 | - int lineId = jdbcTemplate.queryForObject("select id from bsth_c_line where line_code=" + lineCode, Integer.class); | |
| 183 | - | |
| 184 | - String sql = "select * from bsth_c_ls_sectionroute where line_code='" + lineCode + "' and line=" + lineId + " and directions=" + upDown + " and destroy=0 and versions=" + versions; | |
| 185 | - List<SaveRoadRouteDTO> routes = jdbcTemplate.query(sql, BeanPropertyRowMapper.newInstance(SaveRoadRouteDTO.class)); | |
| 186 | - | |
| 187 | - Collections.sort(routes, new RoadRouteComp()); | |
| 188 | - | |
| 189 | - long sCode = GetUIDAndCode.getSectionId(); | |
| 190 | - //转wgs | |
| 191 | - String wgsCoord = "LINESTRING(" + bdPolygon2Wgs(coords) + ")"; | |
| 192 | - String bdCooed = "LINESTRING(" + coords + ")"; | |
| 193 | - //insert 路段 | |
| 194 | - sql = "insert into bsth_c_section(id, section_code, section_name, croses_road, bsection_vector, gsection_vector, create_date, update_date, versions) " + | |
| 195 | - " values(?,?,?,?,ST_GeomFromText('"+bdCooed+"'),ST_GeomFromText('"+wgsCoord+"'),sysdate(),sysdate(),?)"; | |
| 196 | - | |
| 197 | - jdbcTemplate.update(sql, sCode, sCode, sectionName, crosesRoad, 1); | |
| 198 | - | |
| 199 | - | |
| 200 | - SaveRoadRouteDTO srr; | |
| 201 | - int currentNo = -1, | |
| 202 | - no = 100, step = 100; | |
| 203 | - | |
| 204 | - if (prevRouteId == -1) { | |
| 205 | - //起点站 | |
| 206 | - currentNo = no; | |
| 207 | - no += step; | |
| 208 | - } | |
| 209 | - //重新排序路由 | |
| 210 | - for (int i = 0, size = routes.size(); i < size; i++) { | |
| 211 | - srr = routes.get(i); | |
| 212 | - srr.setSectionrouteCode(no += step); | |
| 213 | - if (srr.getId().intValue() == prevRouteId) { | |
| 214 | - no += step; | |
| 215 | - currentNo = no; | |
| 216 | - } | |
| 217 | - } | |
| 218 | - | |
| 219 | - srr = new SaveRoadRouteDTO(); | |
| 220 | - srr.setLine(lineId); | |
| 221 | - srr.setLineCode(lineCode); | |
| 222 | - srr.setDirections(upDown); | |
| 223 | - srr.setVersions(versions); | |
| 224 | - | |
| 225 | - srr.setSectionrouteCode(currentNo); | |
| 226 | - srr.setSection(sCode); | |
| 227 | - srr.setSectionCode(sCode + ""); | |
| 228 | - srr.setIsRoadeSpeed(0); | |
| 229 | - srr.setDestroy(0); | |
| 230 | - Date d = new Date(); | |
| 231 | - srr.setCreateDate(d); | |
| 232 | - srr.setUpdateDate(d); | |
| 233 | - | |
| 234 | - final List<SaveRoadRouteDTO> saveList = routes; | |
| 235 | - //insert 新路由 (ID自增) | |
| 236 | - jdbcTemplate.update("insert into bsth_c_ls_sectionroute(line_code, section_code, sectionroute_code, directions, line, section, create_date,update_date,versions,destroy,is_roade_speed)" + | |
| 237 | - " values(?,?,?,?,?,?,?,?,?,?,?)", srr.getLineCode(), srr.getSectionCode(), srr.getSectionrouteCode(), srr.getDirections(), srr.getLine(), srr.getSection(), srr.getCreateDate(), srr.getUpdateDate(), versions, srr.getDestroy(), srr.getIsRoadeSpeed()); | |
| 238 | - | |
| 239 | - // update 原路由 | |
| 240 | - jdbcTemplate.batchUpdate("update bsth_c_ls_sectionroute set sectionroute_code=? where id=?" | |
| 241 | - , new BatchPreparedStatementSetter() { | |
| 242 | - @Override | |
| 243 | - public void setValues(PreparedStatement ps, int i) throws SQLException { | |
| 244 | - SaveRoadRouteDTO srr = saveList.get(i); | |
| 245 | - ps.setInt(1, srr.getSectionrouteCode()); | |
| 246 | - ps.setInt(2, srr.getId()); | |
| 247 | - } | |
| 248 | - | |
| 249 | - @Override | |
| 250 | - public int getBatchSize() { | |
| 251 | - return saveList.size(); | |
| 252 | - } | |
| 253 | - }); | |
| 254 | - | |
| 255 | - tran.commit(status); | |
| 256 | - | |
| 257 | - //返回更新之后的数据 | |
| 258 | - List<GeoRoad> list = findRoadByUpdown(lineCode, upDown, versions); | |
| 259 | - rs.put("list", list); | |
| 260 | - rs.put("status", ResponseCode.SUCCESS); | |
| 261 | - } catch (Exception e) { | |
| 262 | - tran.rollback(status); | |
| 263 | - logger.error("", e); | |
| 264 | - rs.put("status", ResponseCode.ERROR); | |
| 265 | - rs.put("msg", "服务器出现异常"); | |
| 266 | - } | |
| 267 | - return rs; | |
| 268 | - } | |
| 269 | - | |
| 270 | - /** | |
| 271 | - * 获取线路版本信息 | |
| 272 | - * @param lineCode | |
| 273 | - * @return | |
| 274 | - */ | |
| 275 | - @Override | |
| 276 | - public Map<String, Object> findVersionInfo(String lineCode) { | |
| 277 | - Map<String, Object> rs = new HashMap<>(); | |
| 278 | - | |
| 279 | - try { | |
| 280 | - String sql = "select t1.*,t2.name as line_name from bsth_c_line_versions t1 LEFT JOIN bsth_c_line t2 on t1.line_code=t2.line_code where t1.line_code='"+lineCode+"'"; | |
| 281 | - | |
| 282 | - List<GeoLineVersionInfo> list = | |
| 283 | - jdbcTemplate.query(sql, BeanPropertyRowMapper.newInstance(GeoLineVersionInfo.class)); | |
| 284 | - | |
| 285 | - rs.put("list", list); | |
| 286 | - rs.put("status", ResponseCode.SUCCESS); | |
| 287 | - } catch (Exception e) { | |
| 288 | - logger.error("", e); | |
| 289 | - rs.put("status", ResponseCode.ERROR); | |
| 290 | - rs.put("msg", "服务器出现异常"); | |
| 291 | - } | |
| 292 | - return rs; | |
| 293 | - } | |
| 294 | - | |
| 295 | - @Override | |
| 296 | - public Map<String, Object> addNewStationRoute(String lineCode, int upDown, int versions, String stationName, Float lat, Float lng, int prevRouteId) { | |
| 297 | - Map<String, Object> rs = new HashMap<>(); | |
| 298 | - | |
| 299 | - //编程式事务 | |
| 300 | - DataSourceTransactionManager tran = new DataSourceTransactionManager(jdbcTemplate.getDataSource()); | |
| 301 | - DefaultTransactionDefinition def = new DefaultTransactionDefinition(); | |
| 302 | - def.setPropagationBehavior(TransactionDefinition.PROPAGATION_REQUIRED); | |
| 303 | - TransactionStatus status = tran.getTransaction(def); | |
| 304 | - try { | |
| 305 | - //根据线路编码,查询线路ID | |
| 306 | - int lineId = jdbcTemplate.queryForObject("select id from bsth_c_line where line_code=" + lineCode, Integer.class); | |
| 307 | - | |
| 308 | - String sql = "select * from bsth_c_ls_stationroute where line_code='" + lineCode + "' and line=" + lineId + " and directions=" + upDown + " and destroy=0 and versions=" + versions; | |
| 309 | - List<SaveStationRouteDTO> routes = jdbcTemplate.query(sql, BeanPropertyRowMapper.newInstance(SaveStationRouteDTO.class)); | |
| 310 | - | |
| 311 | - for (SaveStationRouteDTO s : routes) { | |
| 312 | - if (s.getStationName().equals(stationName)) { | |
| 313 | - | |
| 314 | - rs.put("status", ResponseCode.ERROR); | |
| 315 | - rs.put("msg", "重复的站点路由名称!"); | |
| 316 | - return rs; | |
| 317 | - } | |
| 318 | - } | |
| 319 | - //按路由顺序排列 | |
| 320 | - Collections.sort(routes, new StationRouteComp()); | |
| 321 | - | |
| 322 | - //转WGS | |
| 323 | - TransGPS.Location wgsLoc = TransGPS.transformFromGCJToWGS(TransGPS.bd_decrypt(TransGPS.LocationMake(Double.parseDouble(String.valueOf(lng)), Double.parseDouble(String.valueOf(lat))))); | |
| 324 | - | |
| 325 | - //insert 站点 | |
| 326 | - long sCode = GetUIDAndCode.getStationId(); | |
| 327 | - jdbcTemplate.update("insert into bsth_c_station(id, station_cod, station_name, db_type, b_jwpoints, g_lonx, g_laty, destroy, radius, shapes_type, versions) " + | |
| 328 | - " values(?,?,?,?,?,?,?,?,?,?,?)", sCode, sCode, stationName, "b", lng + " " + lat, wgsLoc.getLng(), wgsLoc.getLat(), 0, 88, "r", 1); | |
| 329 | - | |
| 330 | - | |
| 331 | - SaveStationRouteDTO sr; | |
| 332 | - int currentNo = -1, | |
| 333 | - no = 100, step = 100; | |
| 334 | - | |
| 335 | - if (prevRouteId == -1) { | |
| 336 | - //起点站 | |
| 337 | - currentNo = no; | |
| 338 | - no += step; | |
| 339 | - } | |
| 340 | - //重新排序路由 | |
| 341 | - for (int i = 0, size = routes.size(); i < size; i++) { | |
| 342 | - sr = routes.get(i); | |
| 343 | - sr.setStationRouteCode(no += step); | |
| 344 | - if (sr.getId().intValue() == prevRouteId) { | |
| 345 | - no += step; | |
| 346 | - currentNo = no; | |
| 347 | - } | |
| 348 | - } | |
| 349 | - | |
| 350 | - SaveStationRouteDTO nsr = new SaveStationRouteDTO(); | |
| 351 | - nsr.setLine(lineId); | |
| 352 | - nsr.setLineCode(lineCode); | |
| 353 | - nsr.setDirections(upDown); | |
| 354 | - nsr.setVersions(versions); | |
| 355 | - nsr.setStationRouteCode(currentNo); | |
| 356 | - nsr.setStation(sCode); | |
| 357 | - nsr.setStationCode(sCode + ""); | |
| 358 | - nsr.setStationName(stationName); | |
| 359 | - nsr.setDistances(0d); | |
| 360 | - nsr.setToTime(0d); | |
| 361 | - Date d = new Date(); | |
| 362 | - nsr.setCreateDate(d); | |
| 363 | - nsr.setUpdateDate(d); | |
| 364 | - nsr.setDestroy(0); | |
| 365 | - | |
| 366 | - //routes.add(sr); | |
| 367 | - | |
| 368 | - //重新标记mark | |
| 369 | - Collections.sort(routes, new StationRouteComp()); | |
| 370 | - for (int i = 0, size = routes.size(); i < size; i++) { | |
| 371 | - routes.get(i).setStationMark("Z"); | |
| 372 | - } | |
| 373 | - routes.get(0).setStationMark("B"); | |
| 374 | - routes.get(routes.size() - 1).setStationMark("E"); | |
| 375 | - | |
| 376 | - final List<SaveStationRouteDTO> saveList = routes; | |
| 377 | - //insert 新路由 (ID自增) | |
| 378 | - jdbcTemplate.update("insert into bsth_c_ls_stationroute(line, station, station_name, station_route_code, line_code, station_code, station_mark, distances, to_time, destroy, versions, create_date, update_date,directions) values(?,?,?,?,?,?,?,?,?,?,?,?,?,?)" | |
| 379 | - , nsr.getLine(), nsr.getStation(), nsr.getStationName(), nsr.getStationRouteCode(), nsr.getLineCode(), nsr.getStationCode(), nsr.getStationMark() | |
| 380 | - , nsr.getDistances(), nsr.getToTime(), nsr.getDestroy(), nsr.getVersions(), nsr.getCreateDate(), nsr.getUpdateDate(), nsr.getDirections()); | |
| 381 | - | |
| 382 | - // update 原路由 | |
| 383 | - jdbcTemplate.batchUpdate("update bsth_c_ls_stationroute set line=?,station=?,station_name=?,station_route_code=?," + | |
| 384 | - "line_code=?,station_code=?,station_mark=?,distances=?,to_time=?,destroy=?,versions=?,create_date=?,update_date=?,directions=?" + | |
| 385 | - " where id=?" | |
| 386 | - , new BatchPreparedStatementSetter() { | |
| 387 | - @Override | |
| 388 | - public void setValues(PreparedStatement ps, int i) throws SQLException { | |
| 389 | - SaveStationRouteDTO sr = saveList.get(i); | |
| 390 | - ps.setInt(1, sr.getLine()); | |
| 391 | - ps.setLong(2, sr.getStation()); | |
| 392 | - ps.setString(3, sr.getStationName()); | |
| 393 | - ps.setInt(4, sr.getStationRouteCode()); | |
| 394 | - ps.setString(5, sr.getLineCode()); | |
| 395 | - ps.setString(6, sr.getStationCode()); | |
| 396 | - ps.setString(7, sr.getStationMark()); | |
| 397 | - ps.setDouble(8, sr.getDistances()); | |
| 398 | - ps.setDouble(9, sr.getToTime()); | |
| 399 | - ps.setInt(10, sr.getDestroy()); | |
| 400 | - ps.setInt(11, sr.getVersions()); | |
| 401 | - ps.setTimestamp(12, new java.sql.Timestamp(sr.getCreateDate().getTime())); | |
| 402 | - ps.setTimestamp(13, new java.sql.Timestamp(sr.getUpdateDate().getTime())); | |
| 403 | - ps.setInt(14, sr.getDirections()); | |
| 404 | - ps.setInt(15, sr.getId()); | |
| 405 | - } | |
| 406 | - | |
| 407 | - @Override | |
| 408 | - public int getBatchSize() { | |
| 409 | - return saveList.size(); | |
| 410 | - } | |
| 411 | - }); | |
| 412 | - | |
| 413 | - tran.commit(status); | |
| 414 | - | |
| 415 | - //返回更新之后的数据 | |
| 416 | - List<GeoStation> list = findByUpdown(lineCode, upDown, versions); | |
| 417 | - | |
| 418 | - rs.put("list", list); | |
| 419 | - rs.put("newStationRouteCode", currentNo); | |
| 420 | - rs.put("status", ResponseCode.SUCCESS); | |
| 421 | - } catch (Exception e) { | |
| 422 | - tran.rollback(status); | |
| 423 | - logger.error("", e); | |
| 424 | - rs.put("status", ResponseCode.ERROR); | |
| 425 | - rs.put("msg", "服务器出现异常"); | |
| 426 | - } | |
| 427 | - return rs; | |
| 428 | - } | |
| 429 | - | |
| 430 | - private List<GeoStation> findByUpdown(String lineCode, int upDown, int versions) { | |
| 431 | - //返回更新之后的数据 | |
| 432 | - String sql = "select t1.*,t2.g_lonx,g_laty,ST_AsText(g_polygon_grid) as g_polygon_grid,radius,shapes_type from (select id,station_name,station_route_code,line_code,station_code,station_mark,versions,directions from bsth_c_ls_stationroute where line=" + lineCode + " and directions=" + upDown + " and destroy=0 and versions=" + versions + ") t1 LEFT JOIN bsth_c_station t2 on t1.station_code=t2.station_cod"; | |
| 433 | - List<GeoStation> list = jdbcTemplate.query(sql, BeanPropertyRowMapper.newInstance(GeoStation.class)); | |
| 434 | - | |
| 435 | - for (GeoStation station : list) { | |
| 436 | - if (station.getShapesType().equals("d")) | |
| 437 | - station.setBdCoords(multiWgsToBd(station.getgPolygonGrid(), 9, 3)); | |
| 438 | - } | |
| 439 | - return list; | |
| 440 | - } | |
| 441 | - | |
| 442 | - private List<GeoRoad> findRoadByUpdown(String lineCode, int upDown, int versions) { | |
| 443 | - //返回更新之后的数据 | |
| 444 | - String sql = "select t1.*,t2.section_name,t2.croses_road,ST_AsText(t2.gsection_vector) as gsection_vector from (select id,sectionroute_code,directions,line_code,section_code,versions from bsth_c_ls_sectionroute where line='" + lineCode + "' and directions=" + upDown + " and destroy=0 and versions=" + versions + ") t1 LEFT JOIN bsth_c_section t2 on t1.section_code=t2.section_code"; | |
| 445 | - List<GeoRoad> list = jdbcTemplate.query(sql, BeanPropertyRowMapper.newInstance(GeoRoad.class)); | |
| 446 | - | |
| 447 | - for (GeoRoad road : list) { | |
| 448 | - road.setBdCoords(multiWgsToBd(road.getGsectionVector(), 11, 2)); | |
| 449 | - } | |
| 450 | - return list; | |
| 451 | - } | |
| 452 | - | |
| 453 | - @Override | |
| 454 | - public Map<String, Object> destroyStation(GeoStation station) { | |
| 455 | - Map<String, Object> rs = new HashMap<>(); | |
| 456 | - | |
| 457 | - try { | |
| 458 | - String sql = "update bsth_c_ls_stationroute set destroy=1 where id=?"; | |
| 459 | - jdbcTemplate.update(sql, station.getId()); | |
| 460 | - | |
| 461 | - //返回更新之后的数据 | |
| 462 | - List<GeoStation> list = findByUpdown(station.getLineCode(), station.getDirections(), station.getVersions()); | |
| 463 | - rs.put("list", list); | |
| 464 | - rs.put("status", ResponseCode.SUCCESS); | |
| 465 | - } catch (Exception e) { | |
| 466 | - logger.error("", e); | |
| 467 | - rs.put("status", ResponseCode.ERROR); | |
| 468 | - rs.put("msg", "服务器出现异常"); | |
| 469 | - } | |
| 470 | - return rs; | |
| 471 | - } | |
| 472 | - | |
| 473 | - @Override | |
| 474 | - public Map<String, Object> destroyRoad(GeoRoad road) { | |
| 475 | - Map<String, Object> rs = new HashMap<>(); | |
| 476 | - | |
| 477 | - try { | |
| 478 | - String sql = "update bsth_c_ls_sectionroute set destroy=1 where id=?"; | |
| 479 | - jdbcTemplate.update(sql, road.getId()); | |
| 480 | - | |
| 481 | - //返回更新之后的数据 | |
| 482 | - List<GeoRoad> list = findRoadByUpdown(road.getLineCode(), road.getDirections(), road.getVersions()); | |
| 483 | - rs.put("list", list); | |
| 484 | - rs.put("status", ResponseCode.SUCCESS); | |
| 485 | - } catch (Exception e) { | |
| 486 | - logger.error("", e); | |
| 487 | - rs.put("status", ResponseCode.ERROR); | |
| 488 | - rs.put("msg", "服务器出现异常"); | |
| 489 | - } | |
| 490 | - return rs; | |
| 491 | - } | |
| 492 | - | |
| 493 | - @Override | |
| 494 | - public Map<String, Object> updateRoadInfo(GeoRoad road) { | |
| 495 | - Map<String, Object> rs = new HashMap<>(); | |
| 496 | - | |
| 497 | - try { | |
| 498 | - //坐标转换 | |
| 499 | - String bdPolyline = "LINESTRING(" + road.getGsectionVector() + ")"; | |
| 500 | - String wgsPolyline = "LINESTRING(" + bdPolygon2Wgs(road.getGsectionVector()) + ")"; | |
| 501 | - | |
| 502 | - String sql = "update bsth_c_section set section_name=?, croses_road=?, bsection_vector=ST_GeomFromText('" + bdPolyline + "'),gsection_vector=ST_GeomFromText('" + wgsPolyline + "'),update_date=sysdate() where section_code=?"; | |
| 503 | - | |
| 504 | - int rsCount = jdbcTemplate.update(sql, road.getSectionName(), road.getCrosesRoad(), road.getSectionCode()); | |
| 505 | - | |
| 506 | - //从数据库里重新查询对象 | |
| 507 | - if (rsCount > 0) { | |
| 508 | - rs.put("road", findOneRoad(road.getId())); | |
| 509 | - rs.put("status", ResponseCode.SUCCESS); | |
| 510 | - } | |
| 511 | - } catch (Exception e) { | |
| 512 | - logger.error("", e); | |
| 513 | - rs.put("status", ResponseCode.ERROR); | |
| 514 | - rs.put("msg", "服务器出现异常"); | |
| 515 | - } | |
| 516 | - return rs; | |
| 517 | - } | |
| 518 | - | |
| 519 | - | |
| 520 | - /** | |
| 521 | - * 根据路由ID 获取站点 | |
| 522 | - * | |
| 523 | - * @param id | |
| 524 | - * @return | |
| 525 | - */ | |
| 526 | - private GeoStation findOne(int id) { | |
| 527 | - String sql = "SELECT t1.*, t2.g_lonx,g_laty,ST_AsText (g_polygon_grid) AS g_polygon_grid,radius,shapes_type FROM (SELECT id,station_name,station_route_code,line_code,station_code,station_mark,versions,directions FROM bsth_c_ls_stationroute WHERE id=" + id + " AND destroy = 0) t1 LEFT JOIN bsth_c_station t2 ON t1.station_code = t2.station_cod"; | |
| 528 | - List<GeoStation> list = jdbcTemplate.query(sql, BeanPropertyRowMapper.newInstance(GeoStation.class)); | |
| 529 | - | |
| 530 | - GeoStation s = list.get(0); | |
| 531 | - if (s.getShapesType().equals("d")) | |
| 532 | - s.setBdCoords(multiWgsToBd(s.getgPolygonGrid(), 9, 3)); | |
| 533 | - | |
| 534 | - return s; | |
| 535 | - } | |
| 536 | - | |
| 537 | - private GeoRoad findOneRoad(int id) { | |
| 538 | - String sql = "SELECT t1.*, t2.section_name,t2.croses_road,ST_AsText (t2.gsection_vector) AS gsection_vector FROM (SELECT id,sectionroute_code,directions,line_code,section_code,versions FROM bsth_c_ls_sectionroute WHERE id=" + id + ") t1 LEFT JOIN bsth_c_section t2 ON t1.section_code = t2.section_code"; | |
| 539 | - List<GeoRoad> list = jdbcTemplate.query(sql, BeanPropertyRowMapper.newInstance(GeoRoad.class)); | |
| 540 | - | |
| 541 | - for (GeoRoad road : list) { | |
| 542 | - road.setBdCoords(multiWgsToBd(road.getGsectionVector(), 11, 2)); | |
| 543 | - } | |
| 544 | - return list.size() > 0 ? list.get(0) : null; | |
| 545 | - } | |
| 546 | - | |
| 547 | - private String bdPolygon2Wgs(String bdPolygon) { | |
| 548 | - StringBuilder wgsPolygon = new StringBuilder(); | |
| 549 | - List<String> list = Splitter.on(",").splitToList(bdPolygon); | |
| 550 | - String[] array; | |
| 551 | - | |
| 552 | - TransGPS.Location location; | |
| 553 | - for (String p : list) { | |
| 554 | - array = p.split(" "); | |
| 555 | - location = TransGPS.transformFromGCJToWGS(TransGPS.bd_decrypt(TransGPS.LocationMake(Double.parseDouble(array[0]), Double.parseDouble(array[1])))); | |
| 556 | - | |
| 557 | - wgsPolygon.append(location.getLng() + " " + location.getLat() + ","); | |
| 558 | - } | |
| 559 | - | |
| 560 | - if (wgsPolygon.length() > 0) { | |
| 561 | - wgsPolygon.deleteCharAt(wgsPolygon.length() - 1); | |
| 562 | - } | |
| 563 | - return wgsPolygon.toString(); | |
| 564 | - } | |
| 565 | - | |
| 566 | - /** | |
| 567 | - * wgs 坐标数组转 百度 | |
| 568 | - * | |
| 569 | - * @return | |
| 570 | - */ | |
| 571 | - private List<String> multiWgsToBd(String crdStr, int si, int ei) { | |
| 572 | - List<String> bdList = new ArrayList<>(); | |
| 573 | - | |
| 574 | - List<String> gList = Splitter.on(",").splitToList(crdStr.substring(si, crdStr.length() - ei)); | |
| 575 | - TransGPS.Location location; | |
| 576 | - String[] cds; | |
| 577 | - for (String gs : gList) { | |
| 578 | - cds = gs.split(" "); | |
| 579 | - location = TransGPS.bd_encrypt(TransGPS.transformFromWGSToGCJ(TransGPS.LocationMake(Double.parseDouble(cds[0]), Double.parseDouble(cds[1])))); | |
| 580 | - | |
| 581 | - bdList.add(location.getLng() + " " + location.getLat()); | |
| 582 | - } | |
| 583 | - return bdList; | |
| 584 | - } | |
| 585 | - | |
| 586 | - private static class StationRouteComp implements Comparator<SaveStationRouteDTO> { | |
| 587 | - | |
| 588 | - @Override | |
| 589 | - public int compare(SaveStationRouteDTO s1, SaveStationRouteDTO s2) { | |
| 590 | - return s1.getStationRouteCode() - s2.getStationRouteCode(); | |
| 591 | - } | |
| 592 | - } | |
| 593 | - | |
| 594 | - private static class RoadRouteComp implements Comparator<SaveRoadRouteDTO> { | |
| 595 | - | |
| 596 | - @Override | |
| 597 | - public int compare(SaveRoadRouteDTO s1, SaveRoadRouteDTO s2) { | |
| 598 | - return s1.getSectionrouteCode() - s2.getSectionrouteCode(); | |
| 599 | - } | |
| 600 | - } | |
| 1 | +package com.bsth.service.geo_data.impl; | |
| 2 | + | |
| 3 | +import com.bsth.common.ResponseCode; | |
| 4 | +import com.bsth.entity.geo_data.GeoLineVersionInfo; | |
| 5 | +import com.bsth.entity.geo_data.GeoRoad; | |
| 6 | +import com.bsth.entity.geo_data.GeoStation; | |
| 7 | +import com.bsth.service.geo_data.GeoDataService; | |
| 8 | +import com.bsth.util.GetUIDAndCode; | |
| 9 | +import com.bsth.util.TransGPS; | |
| 10 | +import com.google.common.base.Splitter; | |
| 11 | +import org.slf4j.Logger; | |
| 12 | +import org.slf4j.LoggerFactory; | |
| 13 | +import org.springframework.beans.factory.annotation.Autowired; | |
| 14 | +import org.springframework.jdbc.core.BatchPreparedStatementSetter; | |
| 15 | +import org.springframework.jdbc.core.BeanPropertyRowMapper; | |
| 16 | +import org.springframework.jdbc.core.JdbcTemplate; | |
| 17 | +import org.springframework.jdbc.datasource.DataSourceTransactionManager; | |
| 18 | +import org.springframework.stereotype.Service; | |
| 19 | +import org.springframework.transaction.TransactionDefinition; | |
| 20 | +import org.springframework.transaction.TransactionStatus; | |
| 21 | +import org.springframework.transaction.support.DefaultTransactionDefinition; | |
| 22 | + | |
| 23 | +import java.sql.PreparedStatement; | |
| 24 | +import java.sql.SQLException; | |
| 25 | +import java.util.*; | |
| 26 | + | |
| 27 | +/** | |
| 28 | + * Created by panzhao on 2017/12/8. | |
| 29 | + */ | |
| 30 | +@Service | |
| 31 | +public class GeoDataServiceImpl implements GeoDataService { | |
| 32 | + | |
| 33 | + @Autowired | |
| 34 | + JdbcTemplate jdbcTemplate; | |
| 35 | + | |
| 36 | + Logger logger = LoggerFactory.getLogger(this.getClass()); | |
| 37 | + | |
| 38 | + @Override | |
| 39 | + public Map<String, Object> findGeoStations(String lineCode) { | |
| 40 | + | |
| 41 | + Map<String, Object> map = new HashMap(); | |
| 42 | + try { | |
| 43 | + String sql = "select t1.*,t2.g_lonx,g_laty,ST_AsText(g_polygon_grid) as g_polygon_grid,radius,shapes_type from (select id,station_name,station_route_code,line_code,station_code,station_mark,versions,directions from bsth_c_ls_stationroute where line=" + lineCode + " and destroy=0 and versions in (select DISTINCT versions from bsth_c_stationroute where line=" + lineCode + " and destroy=0)) t1 LEFT JOIN bsth_c_station t2 on t1.station_code=t2.station_cod"; | |
| 44 | + | |
| 45 | + | |
| 46 | + List<GeoStation> list = jdbcTemplate.query(sql, BeanPropertyRowMapper.newInstance(GeoStation.class)); | |
| 47 | + | |
| 48 | + for (GeoStation station : list) { | |
| 49 | + if (station.getShapesType().equals("d")) | |
| 50 | + station.setBdCoords(multiWgsToBd(station.getgPolygonGrid(), 9, 3)); | |
| 51 | + } | |
| 52 | + map.put("status", ResponseCode.SUCCESS); | |
| 53 | + map.put("list", list); | |
| 54 | + } catch (Exception e) { | |
| 55 | + logger.error("", e); | |
| 56 | + map.put("status", ResponseCode.ERROR); | |
| 57 | + map.put("msg", "服务器出现异常"); | |
| 58 | + } | |
| 59 | + return map; | |
| 60 | + } | |
| 61 | + | |
| 62 | + @Override | |
| 63 | + public Map<String, Object> findGeoRoad(String lineCode) { | |
| 64 | + Map<String, Object> map = new HashMap(); | |
| 65 | + try { | |
| 66 | + String sql = "select t1.*,t2.section_name,t2.croses_road,ST_AsText(t2.gsection_vector) as gsection_vector from (select id,sectionroute_code,directions,line_code,section_code,versions from bsth_c_ls_sectionroute where line=" + lineCode + " and destroy=0 and versions in (select DISTINCT versions from bsth_c_sectionroute where line=" + lineCode + " and destroy=0)) t1 LEFT JOIN bsth_c_section t2 on t1.section_code=t2.section_code"; | |
| 67 | + | |
| 68 | + | |
| 69 | + List<GeoRoad> list = jdbcTemplate.query(sql, BeanPropertyRowMapper.newInstance(GeoRoad.class)); | |
| 70 | + | |
| 71 | + for (GeoRoad road : list) { | |
| 72 | + road.setBdCoords(multiWgsToBd(road.getGsectionVector(), 11, 2)); | |
| 73 | + } | |
| 74 | + map.put("status", ResponseCode.SUCCESS); | |
| 75 | + map.put("list", list); | |
| 76 | + } catch (Exception e) { | |
| 77 | + logger.error("", e); | |
| 78 | + map.put("status", ResponseCode.ERROR); | |
| 79 | + map.put("msg", "服务器出现异常"); | |
| 80 | + } | |
| 81 | + return map; | |
| 82 | + } | |
| 83 | + | |
| 84 | + /** | |
| 85 | + * 编辑缓冲区信息 | |
| 86 | + * | |
| 87 | + * @param station | |
| 88 | + * @return | |
| 89 | + */ | |
| 90 | + @Override | |
| 91 | + public Map<String, Object> updateBufferInfo(GeoStation station) { | |
| 92 | + Map<String, Object> rs = new HashMap<>(); | |
| 93 | + try { | |
| 94 | + //坐标转换 | |
| 95 | + TransGPS.Location loc = TransGPS.LocationMake(station.getgLonx(), station.getgLaty()); | |
| 96 | + loc = TransGPS.bd_decrypt(loc); | |
| 97 | + loc = TransGPS.transformFromGCJToWGS(loc); | |
| 98 | + station.setgLaty(Float.parseFloat(String.valueOf(loc.getLat()))); | |
| 99 | + station.setgLonx(Float.parseFloat(String.valueOf(loc.getLng()))); | |
| 100 | + | |
| 101 | + String sql; | |
| 102 | + String shapesType = station.getShapesType(); | |
| 103 | + int rsCount = -1; | |
| 104 | + if (shapesType.equals("r")) { | |
| 105 | + sql = "update bsth_c_station set g_lonx=?, g_laty=?, radius=?,shapes_type='r' where station_cod=?"; | |
| 106 | + rsCount = jdbcTemplate.update(sql, station.getgLonx(), station.getgLaty(), station.getRadius(), station.getStationCode()); | |
| 107 | + } else if (shapesType.equals("d")) { | |
| 108 | + //多边形坐标转换 | |
| 109 | + String bdPolygon = "POLYGON((" + station.getgPolygonGrid() + "))"; | |
| 110 | + String wgsPolygon = "POLYGON((" + bdPolygon2Wgs(station.getgPolygonGrid()) + "))"; | |
| 111 | + sql = "update bsth_c_station set g_lonx=?, g_laty=?,shapes_type='d', radius=null,b_polygon_grid=ST_GeomFromText('" + bdPolygon + "'),g_polygon_grid=ST_GeomFromText('" + wgsPolygon + "') where station_cod=?"; | |
| 112 | + | |
| 113 | + rsCount = jdbcTemplate.update(sql, station.getgLonx(), station.getgLaty(), station.getStationCode()); | |
| 114 | + } | |
| 115 | + | |
| 116 | + //从数据库里重新查询对象 | |
| 117 | + if (rsCount > 0) { | |
| 118 | + rs.put("station", findOne(station.getId())); | |
| 119 | + rs.put("status", ResponseCode.SUCCESS); | |
| 120 | + } | |
| 121 | + | |
| 122 | + } catch (Exception e) { | |
| 123 | + logger.error("", e); | |
| 124 | + rs.put("status", ResponseCode.ERROR); | |
| 125 | + rs.put("msg", "服务器出现异常"); | |
| 126 | + } | |
| 127 | + return rs; | |
| 128 | + } | |
| 129 | + | |
| 130 | + /** | |
| 131 | + * 修改站点路由和站点名称 | |
| 132 | + * | |
| 133 | + * @param map | |
| 134 | + * @return | |
| 135 | + */ | |
| 136 | + @Override | |
| 137 | + public Map<String, Object> updateStationName(Map<String, Object> map) { | |
| 138 | + Map<String, Object> rs = new HashMap<>(); | |
| 139 | + | |
| 140 | + //编程式事务 | |
| 141 | + DataSourceTransactionManager tran = new DataSourceTransactionManager(jdbcTemplate.getDataSource()); | |
| 142 | + DefaultTransactionDefinition def = new DefaultTransactionDefinition(); | |
| 143 | + def.setPropagationBehavior(TransactionDefinition.PROPAGATION_REQUIRED); | |
| 144 | + TransactionStatus status = tran.getTransaction(def); | |
| 145 | + try { | |
| 146 | + | |
| 147 | + int id = Integer.parseInt(map.get("id").toString()); | |
| 148 | + String name = map.get("stationName").toString(); | |
| 149 | + String code = map.get("stationCode").toString(); | |
| 150 | + //String lineCode = map.get("lineCode").toString(); | |
| 151 | + //String stationMark = map.get("stationMark").toString(); | |
| 152 | + | |
| 153 | + //更新历史站点路由 | |
| 154 | + jdbcTemplate.update("update bsth_c_ls_stationroute set station_name=? where id=?", name, id); | |
| 155 | + //更新站点 | |
| 156 | + jdbcTemplate.update("update bsth_c_station set station_name=? where station_cod=?", name, code); | |
| 157 | + | |
| 158 | + tran.commit(status); | |
| 159 | + | |
| 160 | + rs.put("station", findOne(id)); | |
| 161 | + rs.put("status", ResponseCode.SUCCESS); | |
| 162 | + } catch (Exception e) { | |
| 163 | + tran.rollback(status); | |
| 164 | + logger.error("", e); | |
| 165 | + rs.put("status", ResponseCode.ERROR); | |
| 166 | + rs.put("msg", "服务器出现异常"); | |
| 167 | + } | |
| 168 | + return rs; | |
| 169 | + } | |
| 170 | + | |
| 171 | + @Override | |
| 172 | + public Map<String, Object> addNewRoadRoute(String lineCode, int upDown, int versions, String sectionName,String crosesRoad, String coords, int prevRouteId) { | |
| 173 | + Map<String, Object> rs = new HashMap<>(); | |
| 174 | + | |
| 175 | + //编程式事务 | |
| 176 | + DataSourceTransactionManager tran = new DataSourceTransactionManager(jdbcTemplate.getDataSource()); | |
| 177 | + DefaultTransactionDefinition def = new DefaultTransactionDefinition(); | |
| 178 | + def.setPropagationBehavior(TransactionDefinition.PROPAGATION_REQUIRED); | |
| 179 | + TransactionStatus status = tran.getTransaction(def); | |
| 180 | + try { | |
| 181 | + //根据站点编码,查询站点ID | |
| 182 | + int lineId = jdbcTemplate.queryForObject("select id from bsth_c_line where line_code=" + lineCode, Integer.class); | |
| 183 | + | |
| 184 | + String sql = "select * from bsth_c_ls_sectionroute where line_code='" + lineCode + "' and line=" + lineId + " and directions=" + upDown + " and destroy=0 and versions=" + versions; | |
| 185 | + List<SaveRoadRouteDTO> routes = jdbcTemplate.query(sql, BeanPropertyRowMapper.newInstance(SaveRoadRouteDTO.class)); | |
| 186 | + | |
| 187 | + Collections.sort(routes, new RoadRouteComp()); | |
| 188 | + | |
| 189 | + long sCode = GetUIDAndCode.getSectionId(); | |
| 190 | + //转wgs | |
| 191 | + String wgsCoord = "LINESTRING(" + bdPolygon2Wgs(coords) + ")"; | |
| 192 | + String bdCooed = "LINESTRING(" + coords + ")"; | |
| 193 | + //insert 路段 | |
| 194 | + sql = "insert into bsth_c_section(id, section_code, section_name, croses_road, bsection_vector, gsection_vector, create_date, update_date, versions) " + | |
| 195 | + " values(?,?,?,?,ST_GeomFromText('"+bdCooed+"'),ST_GeomFromText('"+wgsCoord+"'),sysdate(),sysdate(),?)"; | |
| 196 | + | |
| 197 | + jdbcTemplate.update(sql, sCode, sCode, sectionName, crosesRoad, 1); | |
| 198 | + | |
| 199 | + | |
| 200 | + SaveRoadRouteDTO srr; | |
| 201 | + int currentNo = -1, | |
| 202 | + no = 100, step = 100; | |
| 203 | + | |
| 204 | + if (prevRouteId == -1) { | |
| 205 | + //起点站 | |
| 206 | + currentNo = no; | |
| 207 | + no += step; | |
| 208 | + } | |
| 209 | + //重新排序路由 | |
| 210 | + for (int i = 0, size = routes.size(); i < size; i++) { | |
| 211 | + srr = routes.get(i); | |
| 212 | + srr.setSectionrouteCode(no += step); | |
| 213 | + if (srr.getId().intValue() == prevRouteId) { | |
| 214 | + no += step; | |
| 215 | + currentNo = no; | |
| 216 | + } | |
| 217 | + } | |
| 218 | + | |
| 219 | + srr = new SaveRoadRouteDTO(); | |
| 220 | + srr.setLine(lineId); | |
| 221 | + srr.setLineCode(lineCode); | |
| 222 | + srr.setDirections(upDown); | |
| 223 | + srr.setVersions(versions); | |
| 224 | + | |
| 225 | + srr.setSectionrouteCode(currentNo); | |
| 226 | + srr.setSection(sCode); | |
| 227 | + srr.setSectionCode(sCode + ""); | |
| 228 | + srr.setIsRoadeSpeed(0); | |
| 229 | + srr.setDestroy(0); | |
| 230 | + Date d = new Date(); | |
| 231 | + srr.setCreateDate(d); | |
| 232 | + srr.setUpdateDate(d); | |
| 233 | + | |
| 234 | + final List<SaveRoadRouteDTO> saveList = routes; | |
| 235 | + //insert 新路由 (ID自增) | |
| 236 | + jdbcTemplate.update("insert into bsth_c_ls_sectionroute(line_code, section_code, sectionroute_code, directions, line, section, create_date,update_date,versions,destroy,is_roade_speed)" + | |
| 237 | + " values(?,?,?,?,?,?,?,?,?,?,?)", srr.getLineCode(), srr.getSectionCode(), srr.getSectionrouteCode(), srr.getDirections(), srr.getLine(), srr.getSection(), srr.getCreateDate(), srr.getUpdateDate(), versions, srr.getDestroy(), srr.getIsRoadeSpeed()); | |
| 238 | + | |
| 239 | + // update 原路由 | |
| 240 | + jdbcTemplate.batchUpdate("update bsth_c_ls_sectionroute set sectionroute_code=? where id=?" | |
| 241 | + , new BatchPreparedStatementSetter() { | |
| 242 | + @Override | |
| 243 | + public void setValues(PreparedStatement ps, int i) throws SQLException { | |
| 244 | + SaveRoadRouteDTO srr = saveList.get(i); | |
| 245 | + ps.setInt(1, srr.getSectionrouteCode()); | |
| 246 | + ps.setInt(2, srr.getId()); | |
| 247 | + } | |
| 248 | + | |
| 249 | + @Override | |
| 250 | + public int getBatchSize() { | |
| 251 | + return saveList.size(); | |
| 252 | + } | |
| 253 | + }); | |
| 254 | + | |
| 255 | + tran.commit(status); | |
| 256 | + | |
| 257 | + //返回更新之后的数据 | |
| 258 | + List<GeoRoad> list = findRoadByUpdown(lineCode, upDown, versions); | |
| 259 | + rs.put("list", list); | |
| 260 | + rs.put("status", ResponseCode.SUCCESS); | |
| 261 | + } catch (Exception e) { | |
| 262 | + tran.rollback(status); | |
| 263 | + logger.error("", e); | |
| 264 | + rs.put("status", ResponseCode.ERROR); | |
| 265 | + rs.put("msg", "服务器出现异常"); | |
| 266 | + } | |
| 267 | + return rs; | |
| 268 | + } | |
| 269 | + | |
| 270 | + /** | |
| 271 | + * 获取线路版本信息 | |
| 272 | + * @param lineCode | |
| 273 | + * @return | |
| 274 | + */ | |
| 275 | + @Override | |
| 276 | + public Map<String, Object> findVersionInfo(String lineCode) { | |
| 277 | + Map<String, Object> rs = new HashMap<>(); | |
| 278 | + | |
| 279 | + try { | |
| 280 | + String sql = "select t1.*,t2.name as line_name from bsth_c_line_versions t1 LEFT JOIN bsth_c_line t2 on t1.line_code=t2.line_code where t1.line_code='"+lineCode+"'"; | |
| 281 | + | |
| 282 | + List<GeoLineVersionInfo> list = | |
| 283 | + jdbcTemplate.query(sql, BeanPropertyRowMapper.newInstance(GeoLineVersionInfo.class)); | |
| 284 | + | |
| 285 | + rs.put("list", list); | |
| 286 | + rs.put("status", ResponseCode.SUCCESS); | |
| 287 | + } catch (Exception e) { | |
| 288 | + logger.error("", e); | |
| 289 | + rs.put("status", ResponseCode.ERROR); | |
| 290 | + rs.put("msg", "服务器出现异常"); | |
| 291 | + } | |
| 292 | + return rs; | |
| 293 | + } | |
| 294 | + | |
| 295 | + @Override | |
| 296 | + public Map<String, Object> addNewStationRoute(String lineCode, int upDown, int versions, String stationName, Float lat, Float lng, int prevRouteId) { | |
| 297 | + Map<String, Object> rs = new HashMap<>(); | |
| 298 | + | |
| 299 | + //编程式事务 | |
| 300 | + DataSourceTransactionManager tran = new DataSourceTransactionManager(jdbcTemplate.getDataSource()); | |
| 301 | + DefaultTransactionDefinition def = new DefaultTransactionDefinition(); | |
| 302 | + def.setPropagationBehavior(TransactionDefinition.PROPAGATION_REQUIRED); | |
| 303 | + TransactionStatus status = tran.getTransaction(def); | |
| 304 | + try { | |
| 305 | + //根据线路编码,查询线路ID | |
| 306 | + int lineId = jdbcTemplate.queryForObject("select id from bsth_c_line where line_code=" + lineCode, Integer.class); | |
| 307 | + | |
| 308 | + String sql = "select * from bsth_c_ls_stationroute where line_code='" + lineCode + "' and line=" + lineId + " and directions=" + upDown + " and destroy=0 and versions=" + versions; | |
| 309 | + List<SaveStationRouteDTO> routes = jdbcTemplate.query(sql, BeanPropertyRowMapper.newInstance(SaveStationRouteDTO.class)); | |
| 310 | + | |
| 311 | + for (SaveStationRouteDTO s : routes) { | |
| 312 | + if (s.getStationName().equals(stationName)) { | |
| 313 | + | |
| 314 | + rs.put("status", ResponseCode.ERROR); | |
| 315 | + rs.put("msg", "重复的站点路由名称!"); | |
| 316 | + return rs; | |
| 317 | + } | |
| 318 | + } | |
| 319 | + //按路由顺序排列 | |
| 320 | + Collections.sort(routes, new StationRouteComp()); | |
| 321 | + | |
| 322 | + //转WGS | |
| 323 | + TransGPS.Location wgsLoc = TransGPS.transformFromGCJToWGS(TransGPS.bd_decrypt(TransGPS.LocationMake(Double.parseDouble(String.valueOf(lng)), Double.parseDouble(String.valueOf(lat))))); | |
| 324 | + | |
| 325 | + //insert 站点 | |
| 326 | + long sCode = GetUIDAndCode.getStationId(); | |
| 327 | + jdbcTemplate.update("insert into bsth_c_station(id, station_cod, station_name, db_type, b_jwpoints, g_lonx, g_laty, destroy, radius, shapes_type, versions) " + | |
| 328 | + " values(?,?,?,?,?,?,?,?,?,?,?)", sCode, sCode, stationName, "b", lng + " " + lat, wgsLoc.getLng(), wgsLoc.getLat(), 0, 88, "r", 1); | |
| 329 | + | |
| 330 | + | |
| 331 | + SaveStationRouteDTO sr; | |
| 332 | + int currentNo = -1, | |
| 333 | + no = 100, step = 100; | |
| 334 | + | |
| 335 | + if (prevRouteId == -1) { | |
| 336 | + //起点站 | |
| 337 | + currentNo = no; | |
| 338 | + no += step; | |
| 339 | + } | |
| 340 | + //重新排序路由 | |
| 341 | + for (int i = 0, size = routes.size(); i < size; i++) { | |
| 342 | + sr = routes.get(i); | |
| 343 | + sr.setStationRouteCode(no += step); | |
| 344 | + if (sr.getId().intValue() == prevRouteId) { | |
| 345 | + no += step; | |
| 346 | + currentNo = no; | |
| 347 | + } | |
| 348 | + } | |
| 349 | + | |
| 350 | + SaveStationRouteDTO nsr = new SaveStationRouteDTO(); | |
| 351 | + nsr.setLine(lineId); | |
| 352 | + nsr.setLineCode(lineCode); | |
| 353 | + nsr.setDirections(upDown); | |
| 354 | + nsr.setVersions(versions); | |
| 355 | + nsr.setStationRouteCode(currentNo); | |
| 356 | + nsr.setStation(sCode); | |
| 357 | + nsr.setStationCode(sCode + ""); | |
| 358 | + nsr.setStationName(stationName); | |
| 359 | + nsr.setDistances(0d); | |
| 360 | + nsr.setToTime(0d); | |
| 361 | + Date d = new Date(); | |
| 362 | + nsr.setCreateDate(d); | |
| 363 | + nsr.setUpdateDate(d); | |
| 364 | + nsr.setDestroy(0); | |
| 365 | + | |
| 366 | + //routes.add(sr); | |
| 367 | + | |
| 368 | + //重新标记mark | |
| 369 | + Collections.sort(routes, new StationRouteComp()); | |
| 370 | + for (int i = 0, size = routes.size(); i < size; i++) { | |
| 371 | + routes.get(i).setStationMark("Z"); | |
| 372 | + } | |
| 373 | + routes.get(0).setStationMark("B"); | |
| 374 | + routes.get(routes.size() - 1).setStationMark("E"); | |
| 375 | + | |
| 376 | + final List<SaveStationRouteDTO> saveList = routes; | |
| 377 | + //insert 新路由 (ID自增) | |
| 378 | + jdbcTemplate.update("insert into bsth_c_ls_stationroute(line, station, station_name, station_route_code, line_code, station_code, station_mark, distances, to_time, destroy, versions, create_date, update_date,directions) values(?,?,?,?,?,?,?,?,?,?,?,?,?,?)" | |
| 379 | + , nsr.getLine(), nsr.getStation(), nsr.getStationName(), nsr.getStationRouteCode(), nsr.getLineCode(), nsr.getStationCode(), nsr.getStationMark() | |
| 380 | + , nsr.getDistances(), nsr.getToTime(), nsr.getDestroy(), nsr.getVersions(), nsr.getCreateDate(), nsr.getUpdateDate(), nsr.getDirections()); | |
| 381 | + | |
| 382 | + // update 原路由 | |
| 383 | + jdbcTemplate.batchUpdate("update bsth_c_ls_stationroute set line=?,station=?,station_name=?,station_route_code=?," + | |
| 384 | + "line_code=?,station_code=?,station_mark=?,distances=?,to_time=?,destroy=?,versions=?,create_date=?,update_date=?,directions=?" + | |
| 385 | + " where id=?" | |
| 386 | + , new BatchPreparedStatementSetter() { | |
| 387 | + @Override | |
| 388 | + public void setValues(PreparedStatement ps, int i) throws SQLException { | |
| 389 | + SaveStationRouteDTO sr = saveList.get(i); | |
| 390 | + ps.setInt(1, sr.getLine()); | |
| 391 | + ps.setLong(2, sr.getStation()); | |
| 392 | + ps.setString(3, sr.getStationName()); | |
| 393 | + ps.setInt(4, sr.getStationRouteCode()); | |
| 394 | + ps.setString(5, sr.getLineCode()); | |
| 395 | + ps.setString(6, sr.getStationCode()); | |
| 396 | + ps.setString(7, sr.getStationMark()); | |
| 397 | + ps.setDouble(8, sr.getDistances()); | |
| 398 | + ps.setDouble(9, sr.getToTime()); | |
| 399 | + ps.setInt(10, sr.getDestroy()); | |
| 400 | + ps.setInt(11, sr.getVersions()); | |
| 401 | + ps.setTimestamp(12, new java.sql.Timestamp(sr.getCreateDate().getTime())); | |
| 402 | + ps.setTimestamp(13, new java.sql.Timestamp(sr.getUpdateDate().getTime())); | |
| 403 | + ps.setInt(14, sr.getDirections()); | |
| 404 | + ps.setInt(15, sr.getId()); | |
| 405 | + } | |
| 406 | + | |
| 407 | + @Override | |
| 408 | + public int getBatchSize() { | |
| 409 | + return saveList.size(); | |
| 410 | + } | |
| 411 | + }); | |
| 412 | + | |
| 413 | + tran.commit(status); | |
| 414 | + | |
| 415 | + //返回更新之后的数据 | |
| 416 | + List<GeoStation> list = findByUpdown(lineCode, upDown, versions); | |
| 417 | + | |
| 418 | + rs.put("list", list); | |
| 419 | + rs.put("newStationRouteCode", currentNo); | |
| 420 | + rs.put("status", ResponseCode.SUCCESS); | |
| 421 | + } catch (Exception e) { | |
| 422 | + tran.rollback(status); | |
| 423 | + logger.error("", e); | |
| 424 | + rs.put("status", ResponseCode.ERROR); | |
| 425 | + rs.put("msg", "服务器出现异常"); | |
| 426 | + } | |
| 427 | + return rs; | |
| 428 | + } | |
| 429 | + | |
| 430 | + private List<GeoStation> findByUpdown(String lineCode, int upDown, int versions) { | |
| 431 | + //返回更新之后的数据 | |
| 432 | + String sql = "select t1.*,t2.g_lonx,g_laty,ST_AsText(g_polygon_grid) as g_polygon_grid,radius,shapes_type from (select id,station_name,station_route_code,line_code,station_code,station_mark,versions,directions from bsth_c_ls_stationroute where line=" + lineCode + " and directions=" + upDown + " and destroy=0 and versions=" + versions + ") t1 LEFT JOIN bsth_c_station t2 on t1.station_code=t2.station_cod"; | |
| 433 | + List<GeoStation> list = jdbcTemplate.query(sql, BeanPropertyRowMapper.newInstance(GeoStation.class)); | |
| 434 | + | |
| 435 | + for (GeoStation station : list) { | |
| 436 | + if (station.getShapesType().equals("d")) | |
| 437 | + station.setBdCoords(multiWgsToBd(station.getgPolygonGrid(), 9, 3)); | |
| 438 | + } | |
| 439 | + return list; | |
| 440 | + } | |
| 441 | + | |
| 442 | + private List<GeoRoad> findRoadByUpdown(String lineCode, int upDown, int versions) { | |
| 443 | + //返回更新之后的数据 | |
| 444 | + String sql = "select t1.*,t2.section_name,t2.croses_road,ST_AsText(t2.gsection_vector) as gsection_vector from (select id,sectionroute_code,directions,line_code,section_code,versions from bsth_c_ls_sectionroute where line='" + lineCode + "' and directions=" + upDown + " and destroy=0 and versions=" + versions + ") t1 LEFT JOIN bsth_c_section t2 on t1.section_code=t2.section_code"; | |
| 445 | + List<GeoRoad> list = jdbcTemplate.query(sql, BeanPropertyRowMapper.newInstance(GeoRoad.class)); | |
| 446 | + | |
| 447 | + for (GeoRoad road : list) { | |
| 448 | + road.setBdCoords(multiWgsToBd(road.getGsectionVector(), 11, 2)); | |
| 449 | + } | |
| 450 | + return list; | |
| 451 | + } | |
| 452 | + | |
| 453 | + @Override | |
| 454 | + public Map<String, Object> destroyStation(GeoStation station) { | |
| 455 | + Map<String, Object> rs = new HashMap<>(); | |
| 456 | + | |
| 457 | + try { | |
| 458 | + String sql = "update bsth_c_ls_stationroute set destroy=1 where id=?"; | |
| 459 | + jdbcTemplate.update(sql, station.getId()); | |
| 460 | + | |
| 461 | + //返回更新之后的数据 | |
| 462 | + List<GeoStation> list = findByUpdown(station.getLineCode(), station.getDirections(), station.getVersions()); | |
| 463 | + rs.put("list", list); | |
| 464 | + rs.put("status", ResponseCode.SUCCESS); | |
| 465 | + } catch (Exception e) { | |
| 466 | + logger.error("", e); | |
| 467 | + rs.put("status", ResponseCode.ERROR); | |
| 468 | + rs.put("msg", "服务器出现异常"); | |
| 469 | + } | |
| 470 | + return rs; | |
| 471 | + } | |
| 472 | + | |
| 473 | + @Override | |
| 474 | + public Map<String, Object> destroyRoad(GeoRoad road) { | |
| 475 | + Map<String, Object> rs = new HashMap<>(); | |
| 476 | + | |
| 477 | + try { | |
| 478 | + String sql = "update bsth_c_ls_sectionroute set destroy=1 where id=?"; | |
| 479 | + jdbcTemplate.update(sql, road.getId()); | |
| 480 | + | |
| 481 | + //返回更新之后的数据 | |
| 482 | + List<GeoRoad> list = findRoadByUpdown(road.getLineCode(), road.getDirections(), road.getVersions()); | |
| 483 | + rs.put("list", list); | |
| 484 | + rs.put("status", ResponseCode.SUCCESS); | |
| 485 | + } catch (Exception e) { | |
| 486 | + logger.error("", e); | |
| 487 | + rs.put("status", ResponseCode.ERROR); | |
| 488 | + rs.put("msg", "服务器出现异常"); | |
| 489 | + } | |
| 490 | + return rs; | |
| 491 | + } | |
| 492 | + | |
| 493 | + @Override | |
| 494 | + public Map<String, Object> updateRoadInfo(GeoRoad road) { | |
| 495 | + Map<String, Object> rs = new HashMap<>(); | |
| 496 | + | |
| 497 | + try { | |
| 498 | + //坐标转换 | |
| 499 | + String bdPolyline = "LINESTRING(" + road.getGsectionVector() + ")"; | |
| 500 | + String wgsPolyline = "LINESTRING(" + bdPolygon2Wgs(road.getGsectionVector()) + ")"; | |
| 501 | + | |
| 502 | + String sql = "update bsth_c_section set section_name=?, croses_road=?, bsection_vector=ST_GeomFromText('" + bdPolyline + "'),gsection_vector=ST_GeomFromText('" + wgsPolyline + "'),update_date=sysdate() where section_code=?"; | |
| 503 | + | |
| 504 | + int rsCount = jdbcTemplate.update(sql, road.getSectionName(), road.getCrosesRoad(), road.getSectionCode()); | |
| 505 | + | |
| 506 | + //从数据库里重新查询对象 | |
| 507 | + if (rsCount > 0) { | |
| 508 | + rs.put("road", findOneRoad(road.getId())); | |
| 509 | + rs.put("status", ResponseCode.SUCCESS); | |
| 510 | + } | |
| 511 | + } catch (Exception e) { | |
| 512 | + logger.error("", e); | |
| 513 | + rs.put("status", ResponseCode.ERROR); | |
| 514 | + rs.put("msg", "服务器出现异常"); | |
| 515 | + } | |
| 516 | + return rs; | |
| 517 | + } | |
| 518 | + | |
| 519 | + | |
| 520 | + /** | |
| 521 | + * 根据路由ID 获取站点 | |
| 522 | + * | |
| 523 | + * @param id | |
| 524 | + * @return | |
| 525 | + */ | |
| 526 | + private GeoStation findOne(int id) { | |
| 527 | + String sql = "SELECT t1.*, t2.g_lonx,g_laty,ST_AsText (g_polygon_grid) AS g_polygon_grid,radius,shapes_type FROM (SELECT id,station_name,station_route_code,line_code,station_code,station_mark,versions,directions FROM bsth_c_ls_stationroute WHERE id=" + id + " AND destroy = 0) t1 LEFT JOIN bsth_c_station t2 ON t1.station_code = t2.station_cod"; | |
| 528 | + List<GeoStation> list = jdbcTemplate.query(sql, BeanPropertyRowMapper.newInstance(GeoStation.class)); | |
| 529 | + | |
| 530 | + GeoStation s = list.get(0); | |
| 531 | + if (s.getShapesType().equals("d")) | |
| 532 | + s.setBdCoords(multiWgsToBd(s.getgPolygonGrid(), 9, 3)); | |
| 533 | + | |
| 534 | + return s; | |
| 535 | + } | |
| 536 | + | |
| 537 | + private GeoRoad findOneRoad(int id) { | |
| 538 | + String sql = "SELECT t1.*, t2.section_name,t2.croses_road,ST_AsText (t2.gsection_vector) AS gsection_vector FROM (SELECT id,sectionroute_code,directions,line_code,section_code,versions FROM bsth_c_ls_sectionroute WHERE id=" + id + ") t1 LEFT JOIN bsth_c_section t2 ON t1.section_code = t2.section_code"; | |
| 539 | + List<GeoRoad> list = jdbcTemplate.query(sql, BeanPropertyRowMapper.newInstance(GeoRoad.class)); | |
| 540 | + | |
| 541 | + for (GeoRoad road : list) { | |
| 542 | + road.setBdCoords(multiWgsToBd(road.getGsectionVector(), 11, 2)); | |
| 543 | + } | |
| 544 | + return list.size() > 0 ? list.get(0) : null; | |
| 545 | + } | |
| 546 | + | |
| 547 | + private String bdPolygon2Wgs(String bdPolygon) { | |
| 548 | + StringBuilder wgsPolygon = new StringBuilder(); | |
| 549 | + List<String> list = Splitter.on(",").splitToList(bdPolygon); | |
| 550 | + String[] array; | |
| 551 | + | |
| 552 | + TransGPS.Location location; | |
| 553 | + for (String p : list) { | |
| 554 | + array = p.split(" "); | |
| 555 | + location = TransGPS.transformFromGCJToWGS(TransGPS.bd_decrypt(TransGPS.LocationMake(Double.parseDouble(array[0]), Double.parseDouble(array[1])))); | |
| 556 | + | |
| 557 | + wgsPolygon.append(location.getLng() + " " + location.getLat() + ","); | |
| 558 | + } | |
| 559 | + | |
| 560 | + if (wgsPolygon.length() > 0) { | |
| 561 | + wgsPolygon.deleteCharAt(wgsPolygon.length() - 1); | |
| 562 | + } | |
| 563 | + return wgsPolygon.toString(); | |
| 564 | + } | |
| 565 | + | |
| 566 | + /** | |
| 567 | + * wgs 坐标数组转 百度 | |
| 568 | + * | |
| 569 | + * @return | |
| 570 | + */ | |
| 571 | + private List<String> multiWgsToBd(String crdStr, int si, int ei) { | |
| 572 | + List<String> bdList = new ArrayList<>(); | |
| 573 | + | |
| 574 | + List<String> gList = Splitter.on(",").splitToList(crdStr.substring(si, crdStr.length() - ei)); | |
| 575 | + TransGPS.Location location; | |
| 576 | + String[] cds; | |
| 577 | + for (String gs : gList) { | |
| 578 | + cds = gs.split(" "); | |
| 579 | + location = TransGPS.bd_encrypt(TransGPS.transformFromWGSToGCJ(TransGPS.LocationMake(Double.parseDouble(cds[0]), Double.parseDouble(cds[1])))); | |
| 580 | + | |
| 581 | + bdList.add(location.getLng() + " " + location.getLat()); | |
| 582 | + } | |
| 583 | + return bdList; | |
| 584 | + } | |
| 585 | + | |
| 586 | + private static class StationRouteComp implements Comparator<SaveStationRouteDTO> { | |
| 587 | + | |
| 588 | + @Override | |
| 589 | + public int compare(SaveStationRouteDTO s1, SaveStationRouteDTO s2) { | |
| 590 | + return s1.getStationRouteCode() - s2.getStationRouteCode(); | |
| 591 | + } | |
| 592 | + } | |
| 593 | + | |
| 594 | + private static class RoadRouteComp implements Comparator<SaveRoadRouteDTO> { | |
| 595 | + | |
| 596 | + @Override | |
| 597 | + public int compare(SaveRoadRouteDTO s1, SaveRoadRouteDTO s2) { | |
| 598 | + return s1.getSectionrouteCode() - s2.getSectionrouteCode(); | |
| 599 | + } | |
| 600 | + } | |
| 601 | 601 | } |
| 602 | 602 | \ No newline at end of file | ... | ... |
src/main/java/com/bsth/service/geo_data/impl/SaveRoadRouteDTO.java
| 1 | -package com.bsth.service.geo_data.impl; | |
| 2 | - | |
| 3 | -import java.util.Date; | |
| 4 | - | |
| 5 | -/** | |
| 6 | - * Created by panzhao on 2017/12/17. | |
| 7 | - */ | |
| 8 | -public class SaveRoadRouteDTO { | |
| 9 | - | |
| 10 | - private Integer id; | |
| 11 | - | |
| 12 | - // 路段路由序号 | |
| 13 | - private Integer sectionrouteCode; | |
| 14 | - | |
| 15 | - // 线路编号 | |
| 16 | - private String lineCode; | |
| 17 | - | |
| 18 | - // 路段编号 | |
| 19 | - private String sectionCode; | |
| 20 | - | |
| 21 | - // 路段路由方向 | |
| 22 | - private Integer directions; | |
| 23 | - | |
| 24 | - // 版本号 | |
| 25 | - private Integer versions; | |
| 26 | - | |
| 27 | - // 是否撤销 | |
| 28 | - private Integer destroy; | |
| 29 | - | |
| 30 | - /** 是否有路段限速数据 <0:分段;1:未分段>*/ | |
| 31 | - private Integer isRoadeSpeed; | |
| 32 | - | |
| 33 | - // 描述 | |
| 34 | - private String descriptions; | |
| 35 | - | |
| 36 | - // 创建人 | |
| 37 | - private Integer createBy; | |
| 38 | - | |
| 39 | - // 修改人 | |
| 40 | - private Integer updateBy; | |
| 41 | - | |
| 42 | - // 创建日期 | |
| 43 | - private Date createDate; | |
| 44 | - | |
| 45 | - // 修改日期 | |
| 46 | - private Date updateDate; | |
| 47 | - | |
| 48 | - // 路段信息 | |
| 49 | - private long section; | |
| 50 | - | |
| 51 | - // 线路ID | |
| 52 | - private int line; | |
| 53 | - | |
| 54 | - public Integer getId() { | |
| 55 | - return id; | |
| 56 | - } | |
| 57 | - | |
| 58 | - public void setId(Integer id) { | |
| 59 | - this.id = id; | |
| 60 | - } | |
| 61 | - | |
| 62 | - public Integer getSectionrouteCode() { | |
| 63 | - return sectionrouteCode; | |
| 64 | - } | |
| 65 | - | |
| 66 | - public void setSectionrouteCode(Integer sectionrouteCode) { | |
| 67 | - this.sectionrouteCode = sectionrouteCode; | |
| 68 | - } | |
| 69 | - | |
| 70 | - public String getLineCode() { | |
| 71 | - return lineCode; | |
| 72 | - } | |
| 73 | - | |
| 74 | - public void setLineCode(String lineCode) { | |
| 75 | - this.lineCode = lineCode; | |
| 76 | - } | |
| 77 | - | |
| 78 | - public String getSectionCode() { | |
| 79 | - return sectionCode; | |
| 80 | - } | |
| 81 | - | |
| 82 | - public void setSectionCode(String sectionCode) { | |
| 83 | - this.sectionCode = sectionCode; | |
| 84 | - } | |
| 85 | - | |
| 86 | - public Integer getDirections() { | |
| 87 | - return directions; | |
| 88 | - } | |
| 89 | - | |
| 90 | - public void setDirections(Integer directions) { | |
| 91 | - this.directions = directions; | |
| 92 | - } | |
| 93 | - | |
| 94 | - public Integer getVersions() { | |
| 95 | - return versions; | |
| 96 | - } | |
| 97 | - | |
| 98 | - public void setVersions(Integer versions) { | |
| 99 | - this.versions = versions; | |
| 100 | - } | |
| 101 | - | |
| 102 | - public Integer getDestroy() { | |
| 103 | - return destroy; | |
| 104 | - } | |
| 105 | - | |
| 106 | - public void setDestroy(Integer destroy) { | |
| 107 | - this.destroy = destroy; | |
| 108 | - } | |
| 109 | - | |
| 110 | - public Integer getIsRoadeSpeed() { | |
| 111 | - return isRoadeSpeed; | |
| 112 | - } | |
| 113 | - | |
| 114 | - public void setIsRoadeSpeed(Integer isRoadeSpeed) { | |
| 115 | - this.isRoadeSpeed = isRoadeSpeed; | |
| 116 | - } | |
| 117 | - | |
| 118 | - public String getDescriptions() { | |
| 119 | - return descriptions; | |
| 120 | - } | |
| 121 | - | |
| 122 | - public void setDescriptions(String descriptions) { | |
| 123 | - this.descriptions = descriptions; | |
| 124 | - } | |
| 125 | - | |
| 126 | - public Integer getCreateBy() { | |
| 127 | - return createBy; | |
| 128 | - } | |
| 129 | - | |
| 130 | - public void setCreateBy(Integer createBy) { | |
| 131 | - this.createBy = createBy; | |
| 132 | - } | |
| 133 | - | |
| 134 | - public Integer getUpdateBy() { | |
| 135 | - return updateBy; | |
| 136 | - } | |
| 137 | - | |
| 138 | - public void setUpdateBy(Integer updateBy) { | |
| 139 | - this.updateBy = updateBy; | |
| 140 | - } | |
| 141 | - | |
| 142 | - public Date getCreateDate() { | |
| 143 | - return createDate; | |
| 144 | - } | |
| 145 | - | |
| 146 | - public void setCreateDate(Date createDate) { | |
| 147 | - this.createDate = createDate; | |
| 148 | - } | |
| 149 | - | |
| 150 | - public Date getUpdateDate() { | |
| 151 | - return updateDate; | |
| 152 | - } | |
| 153 | - | |
| 154 | - public void setUpdateDate(Date updateDate) { | |
| 155 | - this.updateDate = updateDate; | |
| 156 | - } | |
| 157 | - | |
| 158 | - public long getSection() { | |
| 159 | - return section; | |
| 160 | - } | |
| 161 | - | |
| 162 | - public void setSection(long section) { | |
| 163 | - this.section = section; | |
| 164 | - } | |
| 165 | - | |
| 166 | - public int getLine() { | |
| 167 | - return line; | |
| 168 | - } | |
| 169 | - | |
| 170 | - public void setLine(int line) { | |
| 171 | - this.line = line; | |
| 172 | - } | |
| 173 | -} | |
| 1 | +package com.bsth.service.geo_data.impl; | |
| 2 | + | |
| 3 | +import java.util.Date; | |
| 4 | + | |
| 5 | +/** | |
| 6 | + * Created by panzhao on 2017/12/17. | |
| 7 | + */ | |
| 8 | +public class SaveRoadRouteDTO { | |
| 9 | + | |
| 10 | + private Integer id; | |
| 11 | + | |
| 12 | + // 路段路由序号 | |
| 13 | + private Integer sectionrouteCode; | |
| 14 | + | |
| 15 | + // 线路编号 | |
| 16 | + private String lineCode; | |
| 17 | + | |
| 18 | + // 路段编号 | |
| 19 | + private String sectionCode; | |
| 20 | + | |
| 21 | + // 路段路由方向 | |
| 22 | + private Integer directions; | |
| 23 | + | |
| 24 | + // 版本号 | |
| 25 | + private Integer versions; | |
| 26 | + | |
| 27 | + // 是否撤销 | |
| 28 | + private Integer destroy; | |
| 29 | + | |
| 30 | + /** 是否有路段限速数据 <0:分段;1:未分段>*/ | |
| 31 | + private Integer isRoadeSpeed; | |
| 32 | + | |
| 33 | + // 描述 | |
| 34 | + private String descriptions; | |
| 35 | + | |
| 36 | + // 创建人 | |
| 37 | + private Integer createBy; | |
| 38 | + | |
| 39 | + // 修改人 | |
| 40 | + private Integer updateBy; | |
| 41 | + | |
| 42 | + // 创建日期 | |
| 43 | + private Date createDate; | |
| 44 | + | |
| 45 | + // 修改日期 | |
| 46 | + private Date updateDate; | |
| 47 | + | |
| 48 | + // 路段信息 | |
| 49 | + private long section; | |
| 50 | + | |
| 51 | + // 线路ID | |
| 52 | + private int line; | |
| 53 | + | |
| 54 | + public Integer getId() { | |
| 55 | + return id; | |
| 56 | + } | |
| 57 | + | |
| 58 | + public void setId(Integer id) { | |
| 59 | + this.id = id; | |
| 60 | + } | |
| 61 | + | |
| 62 | + public Integer getSectionrouteCode() { | |
| 63 | + return sectionrouteCode; | |
| 64 | + } | |
| 65 | + | |
| 66 | + public void setSectionrouteCode(Integer sectionrouteCode) { | |
| 67 | + this.sectionrouteCode = sectionrouteCode; | |
| 68 | + } | |
| 69 | + | |
| 70 | + public String getLineCode() { | |
| 71 | + return lineCode; | |
| 72 | + } | |
| 73 | + | |
| 74 | + public void setLineCode(String lineCode) { | |
| 75 | + this.lineCode = lineCode; | |
| 76 | + } | |
| 77 | + | |
| 78 | + public String getSectionCode() { | |
| 79 | + return sectionCode; | |
| 80 | + } | |
| 81 | + | |
| 82 | + public void setSectionCode(String sectionCode) { | |
| 83 | + this.sectionCode = sectionCode; | |
| 84 | + } | |
| 85 | + | |
| 86 | + public Integer getDirections() { | |
| 87 | + return directions; | |
| 88 | + } | |
| 89 | + | |
| 90 | + public void setDirections(Integer directions) { | |
| 91 | + this.directions = directions; | |
| 92 | + } | |
| 93 | + | |
| 94 | + public Integer getVersions() { | |
| 95 | + return versions; | |
| 96 | + } | |
| 97 | + | |
| 98 | + public void setVersions(Integer versions) { | |
| 99 | + this.versions = versions; | |
| 100 | + } | |
| 101 | + | |
| 102 | + public Integer getDestroy() { | |
| 103 | + return destroy; | |
| 104 | + } | |
| 105 | + | |
| 106 | + public void setDestroy(Integer destroy) { | |
| 107 | + this.destroy = destroy; | |
| 108 | + } | |
| 109 | + | |
| 110 | + public Integer getIsRoadeSpeed() { | |
| 111 | + return isRoadeSpeed; | |
| 112 | + } | |
| 113 | + | |
| 114 | + public void setIsRoadeSpeed(Integer isRoadeSpeed) { | |
| 115 | + this.isRoadeSpeed = isRoadeSpeed; | |
| 116 | + } | |
| 117 | + | |
| 118 | + public String getDescriptions() { | |
| 119 | + return descriptions; | |
| 120 | + } | |
| 121 | + | |
| 122 | + public void setDescriptions(String descriptions) { | |
| 123 | + this.descriptions = descriptions; | |
| 124 | + } | |
| 125 | + | |
| 126 | + public Integer getCreateBy() { | |
| 127 | + return createBy; | |
| 128 | + } | |
| 129 | + | |
| 130 | + public void setCreateBy(Integer createBy) { | |
| 131 | + this.createBy = createBy; | |
| 132 | + } | |
| 133 | + | |
| 134 | + public Integer getUpdateBy() { | |
| 135 | + return updateBy; | |
| 136 | + } | |
| 137 | + | |
| 138 | + public void setUpdateBy(Integer updateBy) { | |
| 139 | + this.updateBy = updateBy; | |
| 140 | + } | |
| 141 | + | |
| 142 | + public Date getCreateDate() { | |
| 143 | + return createDate; | |
| 144 | + } | |
| 145 | + | |
| 146 | + public void setCreateDate(Date createDate) { | |
| 147 | + this.createDate = createDate; | |
| 148 | + } | |
| 149 | + | |
| 150 | + public Date getUpdateDate() { | |
| 151 | + return updateDate; | |
| 152 | + } | |
| 153 | + | |
| 154 | + public void setUpdateDate(Date updateDate) { | |
| 155 | + this.updateDate = updateDate; | |
| 156 | + } | |
| 157 | + | |
| 158 | + public long getSection() { | |
| 159 | + return section; | |
| 160 | + } | |
| 161 | + | |
| 162 | + public void setSection(long section) { | |
| 163 | + this.section = section; | |
| 164 | + } | |
| 165 | + | |
| 166 | + public int getLine() { | |
| 167 | + return line; | |
| 168 | + } | |
| 169 | + | |
| 170 | + public void setLine(int line) { | |
| 171 | + this.line = line; | |
| 172 | + } | |
| 173 | +} | ... | ... |
src/main/java/com/bsth/service/geo_data/impl/SaveStationRouteDTO.java
| 1 | -package com.bsth.service.geo_data.impl; | |
| 2 | - | |
| 3 | -import java.util.Date; | |
| 4 | - | |
| 5 | -/** | |
| 6 | - * 站点路由 jdbc 入库数据 | |
| 7 | - * Created by panzhao on 2017/12/14. | |
| 8 | - */ | |
| 9 | -public class SaveStationRouteDTO { | |
| 10 | - | |
| 11 | - //站点路由ID | |
| 12 | - private Integer id; | |
| 13 | - | |
| 14 | - // 站点路由序号 | |
| 15 | - private Integer stationRouteCode; | |
| 16 | - | |
| 17 | - // 站点编码 | |
| 18 | - private String stationCode; | |
| 19 | - | |
| 20 | - // 站点名称 | |
| 21 | - private String stationName; | |
| 22 | - | |
| 23 | - // 线路编码 | |
| 24 | - private String lineCode; | |
| 25 | - | |
| 26 | - /** | |
| 27 | - * 站点类型 | |
| 28 | - * | |
| 29 | - * ------ B:起点站 | |
| 30 | - * | |
| 31 | - * ------ Z:中途站 | |
| 32 | - * | |
| 33 | - * ------ E:终点站 | |
| 34 | - * | |
| 35 | - * ------ T:停车场 | |
| 36 | - * | |
| 37 | - */ | |
| 38 | - private String stationMark; | |
| 39 | - | |
| 40 | - // 站点路由出站序号 | |
| 41 | - private Integer outStationNmber; | |
| 42 | - | |
| 43 | - // 站点路由到站距离 | |
| 44 | - private Double distances; | |
| 45 | - | |
| 46 | - // 站点路由到站时间 | |
| 47 | - private Double toTime; | |
| 48 | - | |
| 49 | - // 首班时间 | |
| 50 | - private String firstTime; | |
| 51 | - | |
| 52 | - // 末班时间 | |
| 53 | - private String endTime; | |
| 54 | - | |
| 55 | - // 站点路由方向 | |
| 56 | - private Integer directions; | |
| 57 | - | |
| 58 | - // 版本号 | |
| 59 | - private Integer versions; | |
| 60 | - | |
| 61 | - // 是否撤销 | |
| 62 | - private Integer destroy; | |
| 63 | - | |
| 64 | - // 描述 | |
| 65 | - private String descriptions; | |
| 66 | - | |
| 67 | - // 创建人 | |
| 68 | - private Integer createBy; | |
| 69 | - | |
| 70 | - // 修改人 | |
| 71 | - private Integer updateBy; | |
| 72 | - | |
| 73 | - // 创建日期 | |
| 74 | - private Date createDate; | |
| 75 | - | |
| 76 | - // 修改日期 | |
| 77 | - private Date updateDate; | |
| 78 | - | |
| 79 | - // 站点ID | |
| 80 | - private long station; | |
| 81 | - | |
| 82 | - // 线路ID | |
| 83 | - private int line; | |
| 84 | - | |
| 85 | - public Integer getId() { | |
| 86 | - return id; | |
| 87 | - } | |
| 88 | - | |
| 89 | - public void setId(Integer id) { | |
| 90 | - this.id = id; | |
| 91 | - } | |
| 92 | - | |
| 93 | - public Integer getStationRouteCode() { | |
| 94 | - return stationRouteCode; | |
| 95 | - } | |
| 96 | - | |
| 97 | - public void setStationRouteCode(Integer stationRouteCode) { | |
| 98 | - this.stationRouteCode = stationRouteCode; | |
| 99 | - } | |
| 100 | - | |
| 101 | - public String getStationCode() { | |
| 102 | - return stationCode; | |
| 103 | - } | |
| 104 | - | |
| 105 | - public void setStationCode(String stationCode) { | |
| 106 | - this.stationCode = stationCode; | |
| 107 | - } | |
| 108 | - | |
| 109 | - public String getStationName() { | |
| 110 | - return stationName; | |
| 111 | - } | |
| 112 | - | |
| 113 | - public void setStationName(String stationName) { | |
| 114 | - this.stationName = stationName; | |
| 115 | - } | |
| 116 | - | |
| 117 | - public String getLineCode() { | |
| 118 | - return lineCode; | |
| 119 | - } | |
| 120 | - | |
| 121 | - public void setLineCode(String lineCode) { | |
| 122 | - this.lineCode = lineCode; | |
| 123 | - } | |
| 124 | - | |
| 125 | - public String getStationMark() { | |
| 126 | - return stationMark; | |
| 127 | - } | |
| 128 | - | |
| 129 | - public void setStationMark(String stationMark) { | |
| 130 | - this.stationMark = stationMark; | |
| 131 | - } | |
| 132 | - | |
| 133 | - public Integer getOutStationNmber() { | |
| 134 | - return outStationNmber; | |
| 135 | - } | |
| 136 | - | |
| 137 | - public void setOutStationNmber(Integer outStationNmber) { | |
| 138 | - this.outStationNmber = outStationNmber; | |
| 139 | - } | |
| 140 | - | |
| 141 | - public Double getDistances() { | |
| 142 | - return distances; | |
| 143 | - } | |
| 144 | - | |
| 145 | - public void setDistances(Double distances) { | |
| 146 | - this.distances = distances; | |
| 147 | - } | |
| 148 | - | |
| 149 | - public Double getToTime() { | |
| 150 | - return toTime; | |
| 151 | - } | |
| 152 | - | |
| 153 | - public void setToTime(Double toTime) { | |
| 154 | - this.toTime = toTime; | |
| 155 | - } | |
| 156 | - | |
| 157 | - public String getFirstTime() { | |
| 158 | - return firstTime; | |
| 159 | - } | |
| 160 | - | |
| 161 | - public void setFirstTime(String firstTime) { | |
| 162 | - this.firstTime = firstTime; | |
| 163 | - } | |
| 164 | - | |
| 165 | - public String getEndTime() { | |
| 166 | - return endTime; | |
| 167 | - } | |
| 168 | - | |
| 169 | - public void setEndTime(String endTime) { | |
| 170 | - this.endTime = endTime; | |
| 171 | - } | |
| 172 | - | |
| 173 | - public Integer getDirections() { | |
| 174 | - return directions; | |
| 175 | - } | |
| 176 | - | |
| 177 | - public void setDirections(Integer directions) { | |
| 178 | - this.directions = directions; | |
| 179 | - } | |
| 180 | - | |
| 181 | - public Integer getVersions() { | |
| 182 | - return versions; | |
| 183 | - } | |
| 184 | - | |
| 185 | - public void setVersions(Integer versions) { | |
| 186 | - this.versions = versions; | |
| 187 | - } | |
| 188 | - | |
| 189 | - public Integer getDestroy() { | |
| 190 | - return destroy; | |
| 191 | - } | |
| 192 | - | |
| 193 | - public void setDestroy(Integer destroy) { | |
| 194 | - this.destroy = destroy; | |
| 195 | - } | |
| 196 | - | |
| 197 | - public String getDescriptions() { | |
| 198 | - return descriptions; | |
| 199 | - } | |
| 200 | - | |
| 201 | - public void setDescriptions(String descriptions) { | |
| 202 | - this.descriptions = descriptions; | |
| 203 | - } | |
| 204 | - | |
| 205 | - public Integer getCreateBy() { | |
| 206 | - return createBy; | |
| 207 | - } | |
| 208 | - | |
| 209 | - public void setCreateBy(Integer createBy) { | |
| 210 | - this.createBy = createBy; | |
| 211 | - } | |
| 212 | - | |
| 213 | - public Integer getUpdateBy() { | |
| 214 | - return updateBy; | |
| 215 | - } | |
| 216 | - | |
| 217 | - public void setUpdateBy(Integer updateBy) { | |
| 218 | - this.updateBy = updateBy; | |
| 219 | - } | |
| 220 | - | |
| 221 | - public Date getCreateDate() { | |
| 222 | - return createDate; | |
| 223 | - } | |
| 224 | - | |
| 225 | - public void setCreateDate(Date createDate) { | |
| 226 | - this.createDate = createDate; | |
| 227 | - } | |
| 228 | - | |
| 229 | - public Date getUpdateDate() { | |
| 230 | - return updateDate; | |
| 231 | - } | |
| 232 | - | |
| 233 | - public void setUpdateDate(Date updateDate) { | |
| 234 | - this.updateDate = updateDate; | |
| 235 | - } | |
| 236 | - | |
| 237 | - public long getStation() { | |
| 238 | - return station; | |
| 239 | - } | |
| 240 | - | |
| 241 | - public void setStation(long station) { | |
| 242 | - this.station = station; | |
| 243 | - } | |
| 244 | - | |
| 245 | - public int getLine() { | |
| 246 | - return line; | |
| 247 | - } | |
| 248 | - | |
| 249 | - public void setLine(int line) { | |
| 250 | - this.line = line; | |
| 251 | - } | |
| 252 | -} | |
| 1 | +package com.bsth.service.geo_data.impl; | |
| 2 | + | |
| 3 | +import java.util.Date; | |
| 4 | + | |
| 5 | +/** | |
| 6 | + * 站点路由 jdbc 入库数据 | |
| 7 | + * Created by panzhao on 2017/12/14. | |
| 8 | + */ | |
| 9 | +public class SaveStationRouteDTO { | |
| 10 | + | |
| 11 | + //站点路由ID | |
| 12 | + private Integer id; | |
| 13 | + | |
| 14 | + // 站点路由序号 | |
| 15 | + private Integer stationRouteCode; | |
| 16 | + | |
| 17 | + // 站点编码 | |
| 18 | + private String stationCode; | |
| 19 | + | |
| 20 | + // 站点名称 | |
| 21 | + private String stationName; | |
| 22 | + | |
| 23 | + // 线路编码 | |
| 24 | + private String lineCode; | |
| 25 | + | |
| 26 | + /** | |
| 27 | + * 站点类型 | |
| 28 | + * | |
| 29 | + * ------ B:起点站 | |
| 30 | + * | |
| 31 | + * ------ Z:中途站 | |
| 32 | + * | |
| 33 | + * ------ E:终点站 | |
| 34 | + * | |
| 35 | + * ------ T:停车场 | |
| 36 | + * | |
| 37 | + */ | |
| 38 | + private String stationMark; | |
| 39 | + | |
| 40 | + // 站点路由出站序号 | |
| 41 | + private Integer outStationNmber; | |
| 42 | + | |
| 43 | + // 站点路由到站距离 | |
| 44 | + private Double distances; | |
| 45 | + | |
| 46 | + // 站点路由到站时间 | |
| 47 | + private Double toTime; | |
| 48 | + | |
| 49 | + // 首班时间 | |
| 50 | + private String firstTime; | |
| 51 | + | |
| 52 | + // 末班时间 | |
| 53 | + private String endTime; | |
| 54 | + | |
| 55 | + // 站点路由方向 | |
| 56 | + private Integer directions; | |
| 57 | + | |
| 58 | + // 版本号 | |
| 59 | + private Integer versions; | |
| 60 | + | |
| 61 | + // 是否撤销 | |
| 62 | + private Integer destroy; | |
| 63 | + | |
| 64 | + // 描述 | |
| 65 | + private String descriptions; | |
| 66 | + | |
| 67 | + // 创建人 | |
| 68 | + private Integer createBy; | |
| 69 | + | |
| 70 | + // 修改人 | |
| 71 | + private Integer updateBy; | |
| 72 | + | |
| 73 | + // 创建日期 | |
| 74 | + private Date createDate; | |
| 75 | + | |
| 76 | + // 修改日期 | |
| 77 | + private Date updateDate; | |
| 78 | + | |
| 79 | + // 站点ID | |
| 80 | + private long station; | |
| 81 | + | |
| 82 | + // 线路ID | |
| 83 | + private int line; | |
| 84 | + | |
| 85 | + public Integer getId() { | |
| 86 | + return id; | |
| 87 | + } | |
| 88 | + | |
| 89 | + public void setId(Integer id) { | |
| 90 | + this.id = id; | |
| 91 | + } | |
| 92 | + | |
| 93 | + public Integer getStationRouteCode() { | |
| 94 | + return stationRouteCode; | |
| 95 | + } | |
| 96 | + | |
| 97 | + public void setStationRouteCode(Integer stationRouteCode) { | |
| 98 | + this.stationRouteCode = stationRouteCode; | |
| 99 | + } | |
| 100 | + | |
| 101 | + public String getStationCode() { | |
| 102 | + return stationCode; | |
| 103 | + } | |
| 104 | + | |
| 105 | + public void setStationCode(String stationCode) { | |
| 106 | + this.stationCode = stationCode; | |
| 107 | + } | |
| 108 | + | |
| 109 | + public String getStationName() { | |
| 110 | + return stationName; | |
| 111 | + } | |
| 112 | + | |
| 113 | + public void setStationName(String stationName) { | |
| 114 | + this.stationName = stationName; | |
| 115 | + } | |
| 116 | + | |
| 117 | + public String getLineCode() { | |
| 118 | + return lineCode; | |
| 119 | + } | |
| 120 | + | |
| 121 | + public void setLineCode(String lineCode) { | |
| 122 | + this.lineCode = lineCode; | |
| 123 | + } | |
| 124 | + | |
| 125 | + public String getStationMark() { | |
| 126 | + return stationMark; | |
| 127 | + } | |
| 128 | + | |
| 129 | + public void setStationMark(String stationMark) { | |
| 130 | + this.stationMark = stationMark; | |
| 131 | + } | |
| 132 | + | |
| 133 | + public Integer getOutStationNmber() { | |
| 134 | + return outStationNmber; | |
| 135 | + } | |
| 136 | + | |
| 137 | + public void setOutStationNmber(Integer outStationNmber) { | |
| 138 | + this.outStationNmber = outStationNmber; | |
| 139 | + } | |
| 140 | + | |
| 141 | + public Double getDistances() { | |
| 142 | + return distances; | |
| 143 | + } | |
| 144 | + | |
| 145 | + public void setDistances(Double distances) { | |
| 146 | + this.distances = distances; | |
| 147 | + } | |
| 148 | + | |
| 149 | + public Double getToTime() { | |
| 150 | + return toTime; | |
| 151 | + } | |
| 152 | + | |
| 153 | + public void setToTime(Double toTime) { | |
| 154 | + this.toTime = toTime; | |
| 155 | + } | |
| 156 | + | |
| 157 | + public String getFirstTime() { | |
| 158 | + return firstTime; | |
| 159 | + } | |
| 160 | + | |
| 161 | + public void setFirstTime(String firstTime) { | |
| 162 | + this.firstTime = firstTime; | |
| 163 | + } | |
| 164 | + | |
| 165 | + public String getEndTime() { | |
| 166 | + return endTime; | |
| 167 | + } | |
| 168 | + | |
| 169 | + public void setEndTime(String endTime) { | |
| 170 | + this.endTime = endTime; | |
| 171 | + } | |
| 172 | + | |
| 173 | + public Integer getDirections() { | |
| 174 | + return directions; | |
| 175 | + } | |
| 176 | + | |
| 177 | + public void setDirections(Integer directions) { | |
| 178 | + this.directions = directions; | |
| 179 | + } | |
| 180 | + | |
| 181 | + public Integer getVersions() { | |
| 182 | + return versions; | |
| 183 | + } | |
| 184 | + | |
| 185 | + public void setVersions(Integer versions) { | |
| 186 | + this.versions = versions; | |
| 187 | + } | |
| 188 | + | |
| 189 | + public Integer getDestroy() { | |
| 190 | + return destroy; | |
| 191 | + } | |
| 192 | + | |
| 193 | + public void setDestroy(Integer destroy) { | |
| 194 | + this.destroy = destroy; | |
| 195 | + } | |
| 196 | + | |
| 197 | + public String getDescriptions() { | |
| 198 | + return descriptions; | |
| 199 | + } | |
| 200 | + | |
| 201 | + public void setDescriptions(String descriptions) { | |
| 202 | + this.descriptions = descriptions; | |
| 203 | + } | |
| 204 | + | |
| 205 | + public Integer getCreateBy() { | |
| 206 | + return createBy; | |
| 207 | + } | |
| 208 | + | |
| 209 | + public void setCreateBy(Integer createBy) { | |
| 210 | + this.createBy = createBy; | |
| 211 | + } | |
| 212 | + | |
| 213 | + public Integer getUpdateBy() { | |
| 214 | + return updateBy; | |
| 215 | + } | |
| 216 | + | |
| 217 | + public void setUpdateBy(Integer updateBy) { | |
| 218 | + this.updateBy = updateBy; | |
| 219 | + } | |
| 220 | + | |
| 221 | + public Date getCreateDate() { | |
| 222 | + return createDate; | |
| 223 | + } | |
| 224 | + | |
| 225 | + public void setCreateDate(Date createDate) { | |
| 226 | + this.createDate = createDate; | |
| 227 | + } | |
| 228 | + | |
| 229 | + public Date getUpdateDate() { | |
| 230 | + return updateDate; | |
| 231 | + } | |
| 232 | + | |
| 233 | + public void setUpdateDate(Date updateDate) { | |
| 234 | + this.updateDate = updateDate; | |
| 235 | + } | |
| 236 | + | |
| 237 | + public long getStation() { | |
| 238 | + return station; | |
| 239 | + } | |
| 240 | + | |
| 241 | + public void setStation(long station) { | |
| 242 | + this.station = station; | |
| 243 | + } | |
| 244 | + | |
| 245 | + public int getLine() { | |
| 246 | + return line; | |
| 247 | + } | |
| 248 | + | |
| 249 | + public void setLine(int line) { | |
| 250 | + this.line = line; | |
| 251 | + } | |
| 252 | +} | ... | ... |
src/main/java/com/bsth/service/report/impl/CulateMileageServiceImpl.java
| ... | ... | @@ -867,15 +867,17 @@ public class CulateMileageServiceImpl implements CulateMileageService{ |
| 867 | 867 | if (cts != null && cts.size() > 0) { |
| 868 | 868 | for(ChildTaskPlan c : cts){ |
| 869 | 869 | if(c.getCcId()==null){ |
| 870 | - if(item.equals("其他")){ | |
| 871 | - if(c.isDestroy() && | |
| 872 | - ((c.getDestroyReason()==null?"": c.getDestroyReason()).equals(item)|| | |
| 873 | - (c.getDestroyReason()==null?"": c.getDestroyReason()).equals(""))) | |
| 874 | - sum = Arith.add(sum, c.getMileage()); | |
| 875 | - }else{ | |
| 876 | - if(c.isDestroy() && (c.getDestroyReason()==null?"": c.getDestroyReason()).equals(item)) | |
| 877 | - sum = Arith.add(sum, c.getMileage()); | |
| 878 | - } | |
| 870 | + if(c.getMileageType().equals("service")){ | |
| 871 | + if(item.equals("其他")){ | |
| 872 | + if(c.isDestroy() && | |
| 873 | + ((c.getDestroyReason()==null?"": c.getDestroyReason()).equals(item)|| | |
| 874 | + (c.getDestroyReason()==null?"": c.getDestroyReason()).equals(""))) | |
| 875 | + sum = Arith.add(sum, c.getMileage()); | |
| 876 | + }else{ | |
| 877 | + if(c.isDestroy() && (c.getDestroyReason()==null?"": c.getDestroyReason()).equals(item)) | |
| 878 | + sum = Arith.add(sum, c.getMileage()); | |
| 879 | + } | |
| 880 | + } | |
| 879 | 881 | } |
| 880 | 882 | } |
| 881 | 883 | } | ... | ... |
src/main/java/com/bsth/service/report/impl/ReportServiceImpl.java
| ... | ... | @@ -1773,27 +1773,28 @@ public class ReportServiceImpl implements ReportService{ |
| 1773 | 1773 | while (it.hasNext()) { |
| 1774 | 1774 | ChildTaskPlan childTaskPlan = it.next(); |
| 1775 | 1775 | if (childTaskPlan.isDestroy()) { |
| 1776 | - String destroyReason = ""; | |
| 1777 | - if (childTaskPlan.getDestroyReason() == null) { | |
| 1778 | - destroyReason = "其他"; | |
| 1779 | - } else if (childTaskPlan.getDestroyReason().equals("")) { | |
| 1780 | - destroyReason = "其他"; | |
| 1781 | - } else { | |
| 1782 | - destroyReason = childTaskPlan.getDestroyReason(); | |
| 1783 | - } | |
| 1784 | - Map<String, Object> newMap = new HashMap<String, Object>(); | |
| 1785 | - newMap.put("nr", destroyReason); | |
| 1786 | - newMap.put("lp", scheduleRealInfo.getLpName()); | |
| 1787 | - newMap.put("nbbm", scheduleRealInfo.getClZbh()); | |
| 1788 | - newMap.put("jgh", scheduleRealInfo.getjGh()+scheduleRealInfo.getjName()+"/"+scheduleRealInfo.getsGh()+scheduleRealInfo.getsName()); | |
| 1789 | - newMap.put("dz", childTaskPlan.getStartStationName()); | |
| 1790 | - newMap.put("sj", childTaskPlan.getStartDate()); | |
| 1791 | - newMap.put("gzf", " "); | |
| 1792 | - newMap.put("lbbc", 0); | |
| 1793 | - newMap.put("lblc", childTaskPlan.getMileage()); | |
| 1794 | - newMap.put("jyqp", childTaskPlan.getRemarks()); | |
| 1795 | - list.add(newMap); | |
| 1796 | - | |
| 1776 | + if(childTaskPlan.getMileageType().equals("service")){ | |
| 1777 | + String destroyReason = ""; | |
| 1778 | + if (childTaskPlan.getDestroyReason() == null) { | |
| 1779 | + destroyReason = "其他"; | |
| 1780 | + } else if (childTaskPlan.getDestroyReason().equals("")) { | |
| 1781 | + destroyReason = "其他"; | |
| 1782 | + } else { | |
| 1783 | + destroyReason = childTaskPlan.getDestroyReason(); | |
| 1784 | + } | |
| 1785 | + Map<String, Object> newMap = new HashMap<String, Object>(); | |
| 1786 | + newMap.put("nr", destroyReason); | |
| 1787 | + newMap.put("lp", scheduleRealInfo.getLpName()); | |
| 1788 | + newMap.put("nbbm", scheduleRealInfo.getClZbh()); | |
| 1789 | + newMap.put("jgh", scheduleRealInfo.getjGh()+scheduleRealInfo.getjName()+"/"+scheduleRealInfo.getsGh()+scheduleRealInfo.getsName()); | |
| 1790 | + newMap.put("dz", childTaskPlan.getStartStationName()); | |
| 1791 | + newMap.put("sj", childTaskPlan.getStartDate()); | |
| 1792 | + newMap.put("gzf", " "); | |
| 1793 | + newMap.put("lbbc", 0); | |
| 1794 | + newMap.put("lblc", childTaskPlan.getMileage()); | |
| 1795 | + newMap.put("jyqp", childTaskPlan.getRemarks()); | |
| 1796 | + list.add(newMap); | |
| 1797 | + } | |
| 1797 | 1798 | } |
| 1798 | 1799 | } |
| 1799 | 1800 | } | ... | ... |
src/main/java/com/bsth/service/schedule/TTInfoDetailService.java
| ... | ... | @@ -54,5 +54,5 @@ public interface TTInfoDetailService extends BService<TTInfoDetail, Long> { |
| 54 | 54 | |
| 55 | 55 | Map<String, Object> skbDetailMxSave(Map<String, Object> map); |
| 56 | 56 | |
| 57 | - List<Map<String, Object>> findZdAndTcc(int lineid, int xldir); | |
| 57 | + List<Map<String, Object>> findZdAndTcc(int lineid, int xldir, int lineversion); | |
| 58 | 58 | } | ... | ... |
src/main/java/com/bsth/service/schedule/TTInfoService.java
| ... | ... | @@ -3,6 +3,9 @@ package com.bsth.service.schedule; |
| 3 | 3 | import com.bsth.entity.schedule.TTInfo; |
| 4 | 4 | import com.bsth.service.schedule.exception.ScheduleException; |
| 5 | 5 | |
| 6 | +import java.util.List; | |
| 7 | +import java.util.Map; | |
| 8 | + | |
| 6 | 9 | /** |
| 7 | 10 | * Created by xu on 16/5/12. |
| 8 | 11 | */ |
| ... | ... | @@ -14,4 +17,8 @@ public interface TTInfoService extends BService<TTInfo, Long> { |
| 14 | 17 | |
| 15 | 18 | void backUp(Long ttInfoId) throws ScheduleException; |
| 16 | 19 | |
| 20 | + List<Map<String, Object>> getLineStationRouteVersions(Integer lineId); | |
| 21 | + | |
| 22 | + String getLineVersionDesc(Integer lineId, Integer version); | |
| 23 | + | |
| 17 | 24 | } | ... | ... |
src/main/java/com/bsth/service/schedule/impl/TTInfoDetailServiceImpl.java
| ... | ... | @@ -94,17 +94,17 @@ public class TTInfoDetailServiceImpl extends BServiceImpl<TTInfoDetail, Long> im |
| 94 | 94 | * @param xldir 线路上下行 |
| 95 | 95 | * @return |
| 96 | 96 | */ |
| 97 | - public List<Map<String, Object>> findZdAndTcc(int lineid, int xldir) { | |
| 97 | + public List<Map<String, Object>> findZdAndTcc(int lineid, int xldir, int lineversion) { | |
| 98 | 98 | String sql = "select * from " + |
| 99 | 99 | "(" + |
| 100 | - "select station_code as zcode, station_name as zname, concat(station_name, '(站点)') as aname from bsth_c_stationroute " + | |
| 101 | - "where destroy = 0 and line = ? and directions = ? " + | |
| 100 | + "select station_code as zcode, station_name as zname, concat(station_name, '(站点)') as aname from bsth_c_ls_stationroute " + | |
| 101 | + "where destroy = 0 and line = ? and directions = ? and versions = ? " + | |
| 102 | 102 | "union all " + |
| 103 | 103 | "select park_code as zcode, park_name as zname, concat(park_name, '(停车场)') as aname from bsth_c_car_park " + |
| 104 | 104 | "where destroy = 0 " + |
| 105 | 105 | ") a "; |
| 106 | 106 | |
| 107 | - return jdbcTemplate.queryForList(sql, lineid, xldir); | |
| 107 | + return jdbcTemplate.queryForList(sql, lineid, xldir, lineversion); | |
| 108 | 108 | } |
| 109 | 109 | |
| 110 | 110 | @Override | ... | ... |
src/main/java/com/bsth/service/schedule/impl/TTInfoServiceImpl.java
| 1 | 1 | package com.bsth.service.schedule.impl; |
| 2 | 2 | |
| 3 | +import com.bsth.entity.LineVersions; | |
| 3 | 4 | import com.bsth.entity.schedule.TTInfo; |
| 4 | 5 | import com.bsth.entity.schedule.TTInfoBackup; |
| 5 | 6 | import com.bsth.entity.schedule.TTInfoDetail; |
| 6 | 7 | import com.bsth.repository.schedule.TTInfoBackupRepository; |
| 7 | 8 | import com.bsth.repository.schedule.TTInfoDetailRepository; |
| 8 | 9 | import com.bsth.repository.schedule.TTInfoRepository; |
| 10 | +import com.bsth.service.LineVersionsService; | |
| 9 | 11 | import com.bsth.service.schedule.TTInfoService; |
| 10 | 12 | import com.bsth.service.schedule.exception.ScheduleException; |
| 11 | 13 | import com.bsth.service.schedule.utils.TimeTableProto; |
| 12 | 14 | import org.apache.commons.lang3.StringUtils; |
| 15 | +import org.joda.time.DateTime; | |
| 13 | 16 | import org.slf4j.Logger; |
| 14 | 17 | import org.slf4j.LoggerFactory; |
| 15 | 18 | import org.springframework.beans.factory.annotation.Autowired; |
| ... | ... | @@ -21,10 +24,7 @@ import org.springframework.util.CollectionUtils; |
| 21 | 24 | |
| 22 | 25 | import java.io.PrintWriter; |
| 23 | 26 | import java.io.StringWriter; |
| 24 | -import java.util.Date; | |
| 25 | -import java.util.HashMap; | |
| 26 | -import java.util.List; | |
| 27 | -import java.util.Map; | |
| 27 | +import java.util.*; | |
| 28 | 28 | |
| 29 | 29 | /** |
| 30 | 30 | * Created by xu on 16/12/20. |
| ... | ... | @@ -40,6 +40,8 @@ public class TTInfoServiceImpl extends BServiceImpl<TTInfo, Long> implements TTI |
| 40 | 40 | private TTInfoDetailRepository ttInfoDetailRepository; |
| 41 | 41 | @Autowired |
| 42 | 42 | private TTInfoBackupRepository ttInfoBackupRepository; |
| 43 | + @Autowired | |
| 44 | + private LineVersionsService lineVersionsService; | |
| 43 | 45 | |
| 44 | 46 | @Override |
| 45 | 47 | public void validate_name(TTInfo ttInfo) throws ScheduleException { |
| ... | ... | @@ -137,7 +139,70 @@ public class TTInfoServiceImpl extends BServiceImpl<TTInfo, Long> implements TTI |
| 137 | 139 | } |
| 138 | 140 | |
| 139 | 141 | @Override |
| 140 | - @Transactional(propagation = Propagation.REQUIRED, isolation = Isolation.READ_COMMITTED) | |
| 142 | + public List<Map<String, Object>> getLineStationRouteVersions(Integer lineId) { | |
| 143 | + // 获取线路版本 | |
| 144 | + List<LineVersions> lineVersionsList = lineVersionsService.findByLineCode(lineId); | |
| 145 | + // 按照version版本降序排序 | |
| 146 | + Collections.sort(lineVersionsList, new Comparator<LineVersions>() { | |
| 147 | + @Override | |
| 148 | + public int compare(LineVersions o1, LineVersions o2) { | |
| 149 | + if (o1.getVersions() > o2.getVersions()) { | |
| 150 | + return -1; | |
| 151 | + } else if (o1.getVersions() < o2.getVersions()) { | |
| 152 | + return 1; | |
| 153 | + } else { | |
| 154 | + return 0; | |
| 155 | + } | |
| 156 | + } | |
| 157 | + }); | |
| 158 | + | |
| 159 | + // 取最开始的2条记录 | |
| 160 | + List<Map<String, Object>> mapList = new ArrayList<>(); | |
| 161 | + for (LineVersions lv: lineVersionsList) { | |
| 162 | + String vname = lv.getName(); | |
| 163 | + String rq = lv.getStartDate() == null ? "未知启用日期" : new DateTime(lv.getStartDate()).toString("YYYY年MM月dd日"); | |
| 164 | + String sdesc = lv.getStatus() == 0 ? "历史" : (lv.getStatus() == 1 ? "当前" : "待更新"); | |
| 165 | + | |
| 166 | + Map<String, Object> value = new HashMap<>(); | |
| 167 | + value.put("desc", vname + "-" + rq + "-" + sdesc); | |
| 168 | + value.put("version", lv.getVersions()); | |
| 169 | + | |
| 170 | + mapList.add(value); | |
| 171 | + | |
| 172 | + if (mapList.size() == 2) { | |
| 173 | + break; | |
| 174 | + } | |
| 175 | + } | |
| 176 | + | |
| 177 | + return mapList; | |
| 178 | + } | |
| 179 | + | |
| 180 | + @Override | |
| 181 | + public String getLineVersionDesc(Integer lineId, Integer version) { | |
| 182 | + // 查找指定版本,并判定 | |
| 183 | + Map<String, Object> param = new HashMap<>(); | |
| 184 | + param.put("line_eq", lineId); | |
| 185 | + param.put("versions_eq", version); | |
| 186 | + List<LineVersions> lineVersionsList = (List<LineVersions>) lineVersionsService.list(param); | |
| 187 | + | |
| 188 | + LineVersions lv; | |
| 189 | + if (CollectionUtils.isEmpty(lineVersionsList)) { | |
| 190 | + return "未知版本"; | |
| 191 | + } else if (lineVersionsList.size() > 1) { | |
| 192 | + return "重复版本"; | |
| 193 | + } else { | |
| 194 | + lv = lineVersionsList.get(0); | |
| 195 | + } | |
| 196 | + | |
| 197 | + String vname = lv.getName(); | |
| 198 | + String rq = lv.getStartDate() == null ? "未知启用日期" : new DateTime(lv.getStartDate()).toString("YYYY年MM月dd日"); | |
| 199 | + String sdesc = lv.getStatus() == 0 ? "历史" : (lv.getStatus() == 1 ? "当前" : "待更新"); | |
| 200 | + | |
| 201 | + return String.format("%s-%s-%s", vname, rq, sdesc); | |
| 202 | + } | |
| 203 | + | |
| 204 | + @Override | |
| 205 | + @Transactional(propagation = Propagation.REQUIRED, isolation = Isolation.REPEATABLE_READ) | |
| 141 | 206 | public void backUp(Long ttInfoId) throws ScheduleException { |
| 142 | 207 | LOG.info(">>>>>>开始备份时刻表<<<<<<"); |
| 143 | 208 | |
| ... | ... | @@ -165,6 +230,7 @@ public class TTInfoServiceImpl extends BServiceImpl<TTInfo, Long> implements TTI |
| 165 | 230 | ttInfoBackup.setXlName(ttInfo.getXl().getName()); |
| 166 | 231 | ttInfoBackup.setTtInfo(ttInfoId); |
| 167 | 232 | ttInfoBackup.setTtInfoName(ttInfo.getName()); |
| 233 | + ttInfoBackup.setLineVersion(ttInfo.getLineVersion()); | |
| 168 | 234 | ttInfoBackup.setBackUpDate(backupdate); |
| 169 | 235 | ttInfoBackup.setBackUpInfo(backupbytes); |
| 170 | 236 | ... | ... |
src/main/java/com/bsth/service/schedule/utils/TimeTableProto.java
| ... | ... | @@ -268,6 +268,15 @@ public final class TimeTableProto { |
| 268 | 268 | */ |
| 269 | 269 | com.bsth.service.schedule.utils.TimeTableProto.TTInfoDetailOrBuilder getBcInfoOrBuilder( |
| 270 | 270 | int index); |
| 271 | + | |
| 272 | + /** | |
| 273 | + * <pre> | |
| 274 | + * 线路版本 | |
| 275 | + * </pre> | |
| 276 | + * | |
| 277 | + * <code>uint32 lineVersion = 18;</code> | |
| 278 | + */ | |
| 279 | + int getLineVersion(); | |
| 271 | 280 | } |
| 272 | 281 | /** |
| 273 | 282 | * Protobuf type {@code timetable.TTInfo} |
| ... | ... | @@ -298,6 +307,7 @@ public final class TimeTableProto { |
| 298 | 307 | createDate_ = 0L; |
| 299 | 308 | updateDate_ = 0L; |
| 300 | 309 | bcInfo_ = java.util.Collections.emptyList(); |
| 310 | + lineVersion_ = 0; | |
| 301 | 311 | } |
| 302 | 312 | |
| 303 | 313 | @java.lang.Override |
| ... | ... | @@ -421,6 +431,11 @@ public final class TimeTableProto { |
| 421 | 431 | input.readMessage(com.bsth.service.schedule.utils.TimeTableProto.TTInfoDetail.parser(), extensionRegistry)); |
| 422 | 432 | break; |
| 423 | 433 | } |
| 434 | + case 144: { | |
| 435 | + | |
| 436 | + lineVersion_ = input.readUInt32(); | |
| 437 | + break; | |
| 438 | + } | |
| 424 | 439 | } |
| 425 | 440 | } |
| 426 | 441 | } catch (com.google.protobuf.InvalidProtocolBufferException e) { |
| ... | ... | @@ -914,6 +929,19 @@ public final class TimeTableProto { |
| 914 | 929 | return bcInfo_.get(index); |
| 915 | 930 | } |
| 916 | 931 | |
| 932 | + public static final int LINEVERSION_FIELD_NUMBER = 18; | |
| 933 | + private int lineVersion_; | |
| 934 | + /** | |
| 935 | + * <pre> | |
| 936 | + * 线路版本 | |
| 937 | + * </pre> | |
| 938 | + * | |
| 939 | + * <code>uint32 lineVersion = 18;</code> | |
| 940 | + */ | |
| 941 | + public int getLineVersion() { | |
| 942 | + return lineVersion_; | |
| 943 | + } | |
| 944 | + | |
| 917 | 945 | private byte memoizedIsInitialized = -1; |
| 918 | 946 | public final boolean isInitialized() { |
| 919 | 947 | byte isInitialized = memoizedIsInitialized; |
| ... | ... | @@ -977,6 +1005,9 @@ public final class TimeTableProto { |
| 977 | 1005 | for (int i = 0; i < bcInfo_.size(); i++) { |
| 978 | 1006 | output.writeMessage(17, bcInfo_.get(i)); |
| 979 | 1007 | } |
| 1008 | + if (lineVersion_ != 0) { | |
| 1009 | + output.writeUInt32(18, lineVersion_); | |
| 1010 | + } | |
| 980 | 1011 | } |
| 981 | 1012 | |
| 982 | 1013 | public int getSerializedSize() { |
| ... | ... | @@ -1045,6 +1076,10 @@ public final class TimeTableProto { |
| 1045 | 1076 | size += com.google.protobuf.CodedOutputStream |
| 1046 | 1077 | .computeMessageSize(17, bcInfo_.get(i)); |
| 1047 | 1078 | } |
| 1079 | + if (lineVersion_ != 0) { | |
| 1080 | + size += com.google.protobuf.CodedOutputStream | |
| 1081 | + .computeUInt32Size(18, lineVersion_); | |
| 1082 | + } | |
| 1048 | 1083 | memoizedSize = size; |
| 1049 | 1084 | return size; |
| 1050 | 1085 | } |
| ... | ... | @@ -1095,6 +1130,8 @@ public final class TimeTableProto { |
| 1095 | 1130 | == other.getUpdateDate()); |
| 1096 | 1131 | result = result && getBcInfoList() |
| 1097 | 1132 | .equals(other.getBcInfoList()); |
| 1133 | + result = result && (getLineVersion() | |
| 1134 | + == other.getLineVersion()); | |
| 1098 | 1135 | return result; |
| 1099 | 1136 | } |
| 1100 | 1137 | |
| ... | ... | @@ -1147,6 +1184,8 @@ public final class TimeTableProto { |
| 1147 | 1184 | hash = (37 * hash) + BCINFO_FIELD_NUMBER; |
| 1148 | 1185 | hash = (53 * hash) + getBcInfoList().hashCode(); |
| 1149 | 1186 | } |
| 1187 | + hash = (37 * hash) + LINEVERSION_FIELD_NUMBER; | |
| 1188 | + hash = (53 * hash) + getLineVersion(); | |
| 1150 | 1189 | hash = (29 * hash) + unknownFields.hashCode(); |
| 1151 | 1190 | memoizedHashCode = hash; |
| 1152 | 1191 | return hash; |
| ... | ... | @@ -1315,6 +1354,8 @@ public final class TimeTableProto { |
| 1315 | 1354 | } else { |
| 1316 | 1355 | bcInfoBuilder_.clear(); |
| 1317 | 1356 | } |
| 1357 | + lineVersion_ = 0; | |
| 1358 | + | |
| 1318 | 1359 | return this; |
| 1319 | 1360 | } |
| 1320 | 1361 | |
| ... | ... | @@ -1364,6 +1405,7 @@ public final class TimeTableProto { |
| 1364 | 1405 | } else { |
| 1365 | 1406 | result.bcInfo_ = bcInfoBuilder_.build(); |
| 1366 | 1407 | } |
| 1408 | + result.lineVersion_ = lineVersion_; | |
| 1367 | 1409 | result.bitField0_ = to_bitField0_; |
| 1368 | 1410 | onBuilt(); |
| 1369 | 1411 | return result; |
| ... | ... | @@ -1487,6 +1529,9 @@ public final class TimeTableProto { |
| 1487 | 1529 | } |
| 1488 | 1530 | } |
| 1489 | 1531 | } |
| 1532 | + if (other.getLineVersion() != 0) { | |
| 1533 | + setLineVersion(other.getLineVersion()); | |
| 1534 | + } | |
| 1490 | 1535 | onChanged(); |
| 1491 | 1536 | return this; |
| 1492 | 1537 | } |
| ... | ... | @@ -2790,6 +2835,44 @@ public final class TimeTableProto { |
| 2790 | 2835 | } |
| 2791 | 2836 | return bcInfoBuilder_; |
| 2792 | 2837 | } |
| 2838 | + | |
| 2839 | + private int lineVersion_ ; | |
| 2840 | + /** | |
| 2841 | + * <pre> | |
| 2842 | + * 线路版本 | |
| 2843 | + * </pre> | |
| 2844 | + * | |
| 2845 | + * <code>uint32 lineVersion = 18;</code> | |
| 2846 | + */ | |
| 2847 | + public int getLineVersion() { | |
| 2848 | + return lineVersion_; | |
| 2849 | + } | |
| 2850 | + /** | |
| 2851 | + * <pre> | |
| 2852 | + * 线路版本 | |
| 2853 | + * </pre> | |
| 2854 | + * | |
| 2855 | + * <code>uint32 lineVersion = 18;</code> | |
| 2856 | + */ | |
| 2857 | + public Builder setLineVersion(int value) { | |
| 2858 | + | |
| 2859 | + lineVersion_ = value; | |
| 2860 | + onChanged(); | |
| 2861 | + return this; | |
| 2862 | + } | |
| 2863 | + /** | |
| 2864 | + * <pre> | |
| 2865 | + * 线路版本 | |
| 2866 | + * </pre> | |
| 2867 | + * | |
| 2868 | + * <code>uint32 lineVersion = 18;</code> | |
| 2869 | + */ | |
| 2870 | + public Builder clearLineVersion() { | |
| 2871 | + | |
| 2872 | + lineVersion_ = 0; | |
| 2873 | + onChanged(); | |
| 2874 | + return this; | |
| 2875 | + } | |
| 2793 | 2876 | public final Builder setUnknownFields( |
| 2794 | 2877 | final com.google.protobuf.UnknownFieldSet unknownFields) { |
| 2795 | 2878 | return this; |
| ... | ... | @@ -3103,6 +3186,15 @@ public final class TimeTableProto { |
| 3103 | 3186 | */ |
| 3104 | 3187 | com.google.protobuf.ByteString |
| 3105 | 3188 | getRemarkBytes(); |
| 3189 | + | |
| 3190 | + /** | |
| 3191 | + * <pre> | |
| 3192 | + * 线路版本 | |
| 3193 | + * </pre> | |
| 3194 | + * | |
| 3195 | + * <code>uint32 lineVersion = 20;</code> | |
| 3196 | + */ | |
| 3197 | + int getLineVersion(); | |
| 3106 | 3198 | } |
| 3107 | 3199 | /** |
| 3108 | 3200 | * Protobuf type {@code timetable.TTInfoDetail} |
| ... | ... | @@ -3135,6 +3227,7 @@ public final class TimeTableProto { |
| 3135 | 3227 | isFB_ = false; |
| 3136 | 3228 | isTS_ = false; |
| 3137 | 3229 | remark_ = ""; |
| 3230 | + lineVersion_ = 0; | |
| 3138 | 3231 | } |
| 3139 | 3232 | |
| 3140 | 3233 | @java.lang.Override |
| ... | ... | @@ -3267,6 +3360,11 @@ public final class TimeTableProto { |
| 3267 | 3360 | remark_ = s; |
| 3268 | 3361 | break; |
| 3269 | 3362 | } |
| 3363 | + case 160: { | |
| 3364 | + | |
| 3365 | + lineVersion_ = input.readUInt32(); | |
| 3366 | + break; | |
| 3367 | + } | |
| 3270 | 3368 | } |
| 3271 | 3369 | } |
| 3272 | 3370 | } catch (com.google.protobuf.InvalidProtocolBufferException e) { |
| ... | ... | @@ -3827,6 +3925,19 @@ public final class TimeTableProto { |
| 3827 | 3925 | } |
| 3828 | 3926 | } |
| 3829 | 3927 | |
| 3928 | + public static final int LINEVERSION_FIELD_NUMBER = 20; | |
| 3929 | + private int lineVersion_; | |
| 3930 | + /** | |
| 3931 | + * <pre> | |
| 3932 | + * 线路版本 | |
| 3933 | + * </pre> | |
| 3934 | + * | |
| 3935 | + * <code>uint32 lineVersion = 20;</code> | |
| 3936 | + */ | |
| 3937 | + public int getLineVersion() { | |
| 3938 | + return lineVersion_; | |
| 3939 | + } | |
| 3940 | + | |
| 3830 | 3941 | private byte memoizedIsInitialized = -1; |
| 3831 | 3942 | public final boolean isInitialized() { |
| 3832 | 3943 | byte isInitialized = memoizedIsInitialized; |
| ... | ... | @@ -3896,6 +4007,9 @@ public final class TimeTableProto { |
| 3896 | 4007 | if (!getRemarkBytes().isEmpty()) { |
| 3897 | 4008 | com.google.protobuf.GeneratedMessageV3.writeString(output, 19, remark_); |
| 3898 | 4009 | } |
| 4010 | + if (lineVersion_ != 0) { | |
| 4011 | + output.writeUInt32(20, lineVersion_); | |
| 4012 | + } | |
| 3899 | 4013 | } |
| 3900 | 4014 | |
| 3901 | 4015 | public int getSerializedSize() { |
| ... | ... | @@ -3969,6 +4083,10 @@ public final class TimeTableProto { |
| 3969 | 4083 | if (!getRemarkBytes().isEmpty()) { |
| 3970 | 4084 | size += com.google.protobuf.GeneratedMessageV3.computeStringSize(19, remark_); |
| 3971 | 4085 | } |
| 4086 | + if (lineVersion_ != 0) { | |
| 4087 | + size += com.google.protobuf.CodedOutputStream | |
| 4088 | + .computeUInt32Size(20, lineVersion_); | |
| 4089 | + } | |
| 3972 | 4090 | memoizedSize = size; |
| 3973 | 4091 | return size; |
| 3974 | 4092 | } |
| ... | ... | @@ -4025,6 +4143,8 @@ public final class TimeTableProto { |
| 4025 | 4143 | == other.getIsTS()); |
| 4026 | 4144 | result = result && getRemark() |
| 4027 | 4145 | .equals(other.getRemark()); |
| 4146 | + result = result && (getLineVersion() | |
| 4147 | + == other.getLineVersion()); | |
| 4028 | 4148 | return result; |
| 4029 | 4149 | } |
| 4030 | 4150 | |
| ... | ... | @@ -4078,6 +4198,8 @@ public final class TimeTableProto { |
| 4078 | 4198 | getIsTS()); |
| 4079 | 4199 | hash = (37 * hash) + REMARK_FIELD_NUMBER; |
| 4080 | 4200 | hash = (53 * hash) + getRemark().hashCode(); |
| 4201 | + hash = (37 * hash) + LINEVERSION_FIELD_NUMBER; | |
| 4202 | + hash = (53 * hash) + getLineVersion(); | |
| 4081 | 4203 | hash = (29 * hash) + unknownFields.hashCode(); |
| 4082 | 4204 | memoizedHashCode = hash; |
| 4083 | 4205 | return hash; |
| ... | ... | @@ -4245,6 +4367,8 @@ public final class TimeTableProto { |
| 4245 | 4367 | |
| 4246 | 4368 | remark_ = ""; |
| 4247 | 4369 | |
| 4370 | + lineVersion_ = 0; | |
| 4371 | + | |
| 4248 | 4372 | return this; |
| 4249 | 4373 | } |
| 4250 | 4374 | |
| ... | ... | @@ -4286,6 +4410,7 @@ public final class TimeTableProto { |
| 4286 | 4410 | result.isFB_ = isFB_; |
| 4287 | 4411 | result.isTS_ = isTS_; |
| 4288 | 4412 | result.remark_ = remark_; |
| 4413 | + result.lineVersion_ = lineVersion_; | |
| 4289 | 4414 | onBuilt(); |
| 4290 | 4415 | return result; |
| 4291 | 4416 | } |
| ... | ... | @@ -4394,6 +4519,9 @@ public final class TimeTableProto { |
| 4394 | 4519 | remark_ = other.remark_; |
| 4395 | 4520 | onChanged(); |
| 4396 | 4521 | } |
| 4522 | + if (other.getLineVersion() != 0) { | |
| 4523 | + setLineVersion(other.getLineVersion()); | |
| 4524 | + } | |
| 4397 | 4525 | onChanged(); |
| 4398 | 4526 | return this; |
| 4399 | 4527 | } |
| ... | ... | @@ -5651,6 +5779,44 @@ public final class TimeTableProto { |
| 5651 | 5779 | onChanged(); |
| 5652 | 5780 | return this; |
| 5653 | 5781 | } |
| 5782 | + | |
| 5783 | + private int lineVersion_ ; | |
| 5784 | + /** | |
| 5785 | + * <pre> | |
| 5786 | + * 线路版本 | |
| 5787 | + * </pre> | |
| 5788 | + * | |
| 5789 | + * <code>uint32 lineVersion = 20;</code> | |
| 5790 | + */ | |
| 5791 | + public int getLineVersion() { | |
| 5792 | + return lineVersion_; | |
| 5793 | + } | |
| 5794 | + /** | |
| 5795 | + * <pre> | |
| 5796 | + * 线路版本 | |
| 5797 | + * </pre> | |
| 5798 | + * | |
| 5799 | + * <code>uint32 lineVersion = 20;</code> | |
| 5800 | + */ | |
| 5801 | + public Builder setLineVersion(int value) { | |
| 5802 | + | |
| 5803 | + lineVersion_ = value; | |
| 5804 | + onChanged(); | |
| 5805 | + return this; | |
| 5806 | + } | |
| 5807 | + /** | |
| 5808 | + * <pre> | |
| 5809 | + * 线路版本 | |
| 5810 | + * </pre> | |
| 5811 | + * | |
| 5812 | + * <code>uint32 lineVersion = 20;</code> | |
| 5813 | + */ | |
| 5814 | + public Builder clearLineVersion() { | |
| 5815 | + | |
| 5816 | + lineVersion_ = 0; | |
| 5817 | + onChanged(); | |
| 5818 | + return this; | |
| 5819 | + } | |
| 5654 | 5820 | public final Builder setUnknownFields( |
| 5655 | 5821 | final com.google.protobuf.UnknownFieldSet unknownFields) { |
| 5656 | 5822 | return this; |
| ... | ... | @@ -5719,7 +5885,7 @@ public final class TimeTableProto { |
| 5719 | 5885 | descriptor; |
| 5720 | 5886 | static { |
| 5721 | 5887 | java.lang.String[] descriptorData = { |
| 5722 | - "\n\017timetable.proto\022\ttimetable\"\332\002\n\006TTInfo\022" + | |
| 5888 | + "\n\017timetable.proto\022\ttimetable\"\357\002\n\006TTInfo\022" + | |
| 5723 | 5889 | "\n\n\002id\030\001 \001(\004\022\014\n\004name\030\002 \001(\t\022\n\n\002xl\030\003 \001(\r\022\016\n" + |
| 5724 | 5890 | "\006xlName\030\004 \001(\t\022\r\n\005xlDir\030\005 \001(\t\022\014\n\004qyrq\030\006 \001" + |
| 5725 | 5891 | "(\004\022\033\n\023isEnableDisTemplate\030\007 \001(\010\022\020\n\010isCan" + |
| ... | ... | @@ -5728,16 +5894,17 @@ public final class TimeTableProto { |
| 5728 | 5894 | "erName\030\014 \001(\t\022\022\n\nupdateUser\030\r \001(\r\022\026\n\016upda" + |
| 5729 | 5895 | "teUserName\030\016 \001(\t\022\022\n\ncreateDate\030\017 \001(\004\022\022\n\n" + |
| 5730 | 5896 | "updateDate\030\020 \001(\004\022\'\n\006bcInfo\030\021 \003(\0132\027.timet" + |
| 5731 | - "able.TTInfoDetail\"\246\002\n\014TTInfoDetail\022\n\n\002id", | |
| 5732 | - "\030\001 \001(\004\022\n\n\002xl\030\002 \001(\r\022\016\n\006xlName\030\003 \001(\t\022\n\n\002lp" + | |
| 5733 | - "\030\004 \001(\004\022\016\n\006lpName\030\005 \001(\t\022\014\n\004fcno\030\006 \001(\r\022\r\n\005" + | |
| 5734 | - "xlDir\030\007 \001(\t\022\017\n\007qdzCode\030\010 \001(\t\022\017\n\007qdzName\030" + | |
| 5735 | - "\t \001(\t\022\017\n\007zdzCode\030\n \001(\t\022\017\n\007zdzName\030\013 \001(\t\022" + | |
| 5736 | - "\014\n\004fcsj\030\014 \001(\t\022\013\n\003bcs\030\r \001(\r\022\014\n\004jhlc\030\016 \001(\001" + | |
| 5737 | - "\022\014\n\004bcsj\030\017 \001(\r\022\016\n\006bcType\030\020 \001(\t\022\014\n\004isFB\030\021" + | |
| 5738 | - " \001(\010\022\014\n\004isTS\030\022 \001(\010\022\016\n\006remark\030\023 \001(\tB1\n\037co" + | |
| 5739 | - "m.bsth.service.schedule.utilsB\016TimeTable" + | |
| 5740 | - "Protob\006proto3" | |
| 5897 | + "able.TTInfoDetail\022\023\n\013lineVersion\030\022 \001(\r\"\273", | |
| 5898 | + "\002\n\014TTInfoDetail\022\n\n\002id\030\001 \001(\004\022\n\n\002xl\030\002 \001(\r\022" + | |
| 5899 | + "\016\n\006xlName\030\003 \001(\t\022\n\n\002lp\030\004 \001(\004\022\016\n\006lpName\030\005 " + | |
| 5900 | + "\001(\t\022\014\n\004fcno\030\006 \001(\r\022\r\n\005xlDir\030\007 \001(\t\022\017\n\007qdzC" + | |
| 5901 | + "ode\030\010 \001(\t\022\017\n\007qdzName\030\t \001(\t\022\017\n\007zdzCode\030\n " + | |
| 5902 | + "\001(\t\022\017\n\007zdzName\030\013 \001(\t\022\014\n\004fcsj\030\014 \001(\t\022\013\n\003bc" + | |
| 5903 | + "s\030\r \001(\r\022\014\n\004jhlc\030\016 \001(\001\022\014\n\004bcsj\030\017 \001(\r\022\016\n\006b" + | |
| 5904 | + "cType\030\020 \001(\t\022\014\n\004isFB\030\021 \001(\010\022\014\n\004isTS\030\022 \001(\010\022" + | |
| 5905 | + "\016\n\006remark\030\023 \001(\t\022\023\n\013lineVersion\030\024 \001(\rB1\n\037" + | |
| 5906 | + "com.bsth.service.schedule.utilsB\016TimeTab" + | |
| 5907 | + "leProtob\006proto3" | |
| 5741 | 5908 | }; |
| 5742 | 5909 | com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = |
| 5743 | 5910 | new com.google.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() { |
| ... | ... | @@ -5756,13 +5923,13 @@ public final class TimeTableProto { |
| 5756 | 5923 | internal_static_timetable_TTInfo_fieldAccessorTable = new |
| 5757 | 5924 | com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( |
| 5758 | 5925 | internal_static_timetable_TTInfo_descriptor, |
| 5759 | - new java.lang.String[] { "Id", "Name", "Xl", "XlName", "XlDir", "Qyrq", "IsEnableDisTemplate", "IsCancel", "RuleDays", "SpecialDays", "CreateUser", "CreateUserName", "UpdateUser", "UpdateUserName", "CreateDate", "UpdateDate", "BcInfo", }); | |
| 5926 | + new java.lang.String[] { "Id", "Name", "Xl", "XlName", "XlDir", "Qyrq", "IsEnableDisTemplate", "IsCancel", "RuleDays", "SpecialDays", "CreateUser", "CreateUserName", "UpdateUser", "UpdateUserName", "CreateDate", "UpdateDate", "BcInfo", "LineVersion", }); | |
| 5760 | 5927 | internal_static_timetable_TTInfoDetail_descriptor = |
| 5761 | 5928 | getDescriptor().getMessageTypes().get(1); |
| 5762 | 5929 | internal_static_timetable_TTInfoDetail_fieldAccessorTable = new |
| 5763 | 5930 | com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( |
| 5764 | 5931 | internal_static_timetable_TTInfoDetail_descriptor, |
| 5765 | - new java.lang.String[] { "Id", "Xl", "XlName", "Lp", "LpName", "Fcno", "XlDir", "QdzCode", "QdzName", "ZdzCode", "ZdzName", "Fcsj", "Bcs", "Jhlc", "Bcsj", "BcType", "IsFB", "IsTS", "Remark", }); | |
| 5932 | + new java.lang.String[] { "Id", "Xl", "XlName", "Lp", "LpName", "Fcno", "XlDir", "QdzCode", "QdzName", "ZdzCode", "ZdzName", "Fcsj", "Bcs", "Jhlc", "Bcsj", "BcType", "IsFB", "IsTS", "Remark", "LineVersion", }); | |
| 5766 | 5933 | } |
| 5767 | 5934 | |
| 5768 | 5935 | // @@protoc_insertion_point(outer_class_scope) | ... | ... |
src/main/resources/static/pages/base/geo_data_edit/css/mian.css
| 1 | -/* ^_^ baidu map hide logo */ | |
| 2 | -.anchorBL, .anchorBL, .amap-logo, .amap-copyright { | |
| 3 | - display: none; | |
| 4 | -} | |
| 5 | - | |
| 6 | -html,body{ | |
| 7 | - height: 100%; | |
| 8 | -} | |
| 9 | -.ct_page{ | |
| 10 | - padding: 0; | |
| 11 | - height: 100%; | |
| 12 | -} | |
| 13 | - | |
| 14 | -div#map_wrap{ | |
| 15 | - height: 100%; | |
| 16 | -} | |
| 17 | - | |
| 18 | -.main_left_panel{ | |
| 19 | - position: absolute; | |
| 20 | - z-index: 999; | |
| 21 | - height: calc(100% - 20px); | |
| 22 | - width: 310px; | |
| 23 | - background: #fffffff5; | |
| 24 | - top: 7px; | |
| 25 | - left: 5px; | |
| 26 | - box-shadow: 5px 5px 15px rgba(90, 90, 90, 0.48); | |
| 27 | -} | |
| 28 | -.main_lt_search_panel{ | |
| 29 | - position: absolute; | |
| 30 | - z-index: 99; | |
| 31 | - top: 10px; | |
| 32 | - left: 330px; | |
| 33 | -} | |
| 34 | -.main_rt_tools_panel{ | |
| 35 | - position: absolute; | |
| 36 | - z-index: 99; | |
| 37 | - top: 20px; | |
| 38 | - right: 77px; | |
| 39 | - background: #ffffff; | |
| 40 | - box-shadow: -5px 4px 15px rgba(90, 90, 90, 0.48); | |
| 41 | - padding: 0 12px; | |
| 42 | - text-align: center; | |
| 43 | - border-radius: 7px; | |
| 44 | - height: 28px; | |
| 45 | -} | |
| 46 | - | |
| 47 | -.main_rt_tools_panel>._icon{ | |
| 48 | - margin: 0 9px; | |
| 49 | -} | |
| 50 | -.search_input{ | |
| 51 | - width: 250px; | |
| 52 | - height: 42px; | |
| 53 | -} | |
| 54 | - | |
| 55 | -.search_input::placeholder{ | |
| 56 | - color: grey; | |
| 57 | - font-size: 12px; | |
| 58 | -} | |
| 59 | - | |
| 60 | -._line_info{ | |
| 61 | - width: 100%; | |
| 62 | - height: 80px; | |
| 63 | - background: white; | |
| 64 | - box-shadow: 0px -2px 15px rgba(90, 90, 90, 0.48); | |
| 65 | -} | |
| 66 | - | |
| 67 | -._line_name{ | |
| 68 | - padding: 10px 0 0 15px; | |
| 69 | - font-weight: 600; | |
| 70 | - font-family: 微软雅黑; | |
| 71 | - font-size: 18px; | |
| 72 | - color: #484848; | |
| 73 | - position: relative; | |
| 74 | -} | |
| 75 | - | |
| 76 | -._version_dropdown_wrap{ | |
| 77 | - padding: 4px 0 0 15px; | |
| 78 | -} | |
| 79 | -._version_text{ | |
| 80 | - font-size: 14px; | |
| 81 | - color: #0aae0a; | |
| 82 | -} | |
| 83 | -._version_dropdown_wrap li.uk-active>a{ | |
| 84 | - color: #0aae0a; | |
| 85 | -} | |
| 86 | -.uk-nav-header:not(:first-child) { | |
| 87 | - margin-top: 10px; | |
| 88 | -} | |
| 89 | -.add_line_version_icon{ | |
| 90 | - position: absolute; | |
| 91 | - right: 18px; | |
| 92 | - top: 10px; | |
| 93 | -} | |
| 94 | -.clock_enable_version{ | |
| 95 | - padding: 4px 0 0 15px; | |
| 96 | - font-size: 13px; | |
| 97 | - color: #ef4f4f; | |
| 98 | -} | |
| 99 | - | |
| 100 | -.clock_enable_version>a.uk-icon{ | |
| 101 | - vertical-align: top; | |
| 102 | - margin-top: 6px; | |
| 103 | -} | |
| 104 | -._route_info_wrap{ | |
| 105 | - height: calc(100% - 90px); | |
| 106 | - padding-top: 10px; | |
| 107 | -} | |
| 108 | - | |
| 109 | -._route_info_wrap .uk-tab>li>a{ | |
| 110 | - padding: 9px 5px; | |
| 111 | -} | |
| 112 | -._route_info_wrap>ul.uk-tab{ | |
| 113 | - padding-left: 10px; | |
| 114 | - margin-bottom: 0; | |
| 115 | -} | |
| 116 | -.rt_show_version_txt{ | |
| 117 | - position: absolute; | |
| 118 | - right: 7px; | |
| 119 | - bottom: 7px; | |
| 120 | - font-size: 12px; | |
| 121 | -} | |
| 122 | -.rt_show_version_txt{ | |
| 123 | - position: absolute; | |
| 124 | - right: 7px; | |
| 125 | - bottom: 7px; | |
| 126 | - font-size: 12px; | |
| 127 | - padding: 5px 8px; | |
| 128 | -} | |
| 129 | -.station_route>ul{ | |
| 130 | - padding: 0 0 0 30px; | |
| 131 | - font-size: 14px; | |
| 132 | - width: calc(100% - 38px); | |
| 133 | -} | |
| 134 | - | |
| 135 | -.up_down_route_list ul.uk-list>li:nth-child(n+2), .uk-list>li>ul { | |
| 136 | - margin-top: 0; | |
| 137 | -} | |
| 138 | - | |
| 139 | -.station_route>ul>li>a{ | |
| 140 | - color: #434343; | |
| 141 | - overflow: hidden; | |
| 142 | - text-overflow: ellipsis; | |
| 143 | - white-space: nowrap; | |
| 144 | - display: inline-block; | |
| 145 | - width: calc(100% - 53px); | |
| 146 | - padding: 4px 0; | |
| 147 | - vertical-align: middle;+0982/ | |
| 148 | -} | |
| 149 | - | |
| 150 | -.ct_route_badge{ | |
| 151 | - font-size: 11px; | |
| 152 | - height: 18px; | |
| 153 | - border-radius: 5px; | |
| 154 | - vertical-align: top; | |
| 155 | - margin-top: 1px; | |
| 156 | - padding: 0 4px; | |
| 157 | - margin-right: 3px; | |
| 158 | - min-width: 18px; | |
| 159 | -} | |
| 160 | - | |
| 161 | -.up_down_route_list>li:nth-of-type(2) .ct_route_badge{ | |
| 162 | - background: #fb6464; | |
| 163 | -} | |
| 164 | - | |
| 165 | -.ct_route_badge.start{ | |
| 166 | - margin-left: 0px; | |
| 167 | -} | |
| 168 | -.ct_route_badge.end{ | |
| 169 | - margin-left: 0px; | |
| 170 | -} | |
| 171 | -.road_route{ | |
| 172 | - padding-left: 30px; | |
| 173 | - width: calc(100% - 25px); | |
| 174 | - font-size: 14px; | |
| 175 | - color: #242424; | |
| 176 | - border-top: 1px solid #d5d5d5; | |
| 177 | - padding-top: 0; | |
| 178 | -} | |
| 179 | -._route_info_wrap>ul.uk-switcher{ | |
| 180 | - overflow: auto; | |
| 181 | - height: calc(100% - 62px); | |
| 182 | - margin-bottom: 0; | |
| 183 | - position: relative; | |
| 184 | - padding-top: 20px; | |
| 185 | - margin-top: 0 !important; | |
| 186 | -} | |
| 187 | - | |
| 188 | -.pos_tb_icon{ | |
| 189 | - position: absolute; | |
| 190 | - bottom: 15px; | |
| 191 | - right: 15px; | |
| 192 | -} | |
| 193 | -.ct_route_badge_wrap{ | |
| 194 | - display: inline-block; | |
| 195 | - width: 48px; | |
| 196 | - text-align: right; | |
| 197 | - vertical-align: top; | |
| 198 | - margin-top: 3px; | |
| 199 | -} | |
| 200 | - | |
| 201 | -.road_route>ul li a{ | |
| 202 | - color: #242424; | |
| 203 | - width: 100%; | |
| 204 | - display: block; | |
| 205 | - padding-left: 8px; | |
| 206 | -} | |
| 207 | - | |
| 208 | -.road_route>ul{ | |
| 209 | - border-left: 1px solid #cbcbcb; | |
| 210 | - padding-left: 0; | |
| 211 | - padding-top: 10px; | |
| 212 | -} | |
| 213 | - | |
| 214 | -span.sub_name { | |
| 215 | - font-size: 12px; | |
| 216 | - color: #777676; | |
| 217 | - margin-left: 5px; | |
| 218 | -} | |
| 219 | - | |
| 220 | -.road_route>ul>li{ | |
| 221 | - width: calc(100% - 10px); | |
| 222 | - overflow: hidden; | |
| 223 | - text-overflow: ellipsis; | |
| 224 | - white-space: nowrap; | |
| 225 | - display: inline-block; | |
| 226 | -} | |
| 227 | - | |
| 228 | -#map_wrap img { | |
| 229 | - max-width: none; | |
| 230 | -} | |
| 231 | - | |
| 232 | -ul.uk-list.station_info_win { | |
| 233 | - font-size: 14px; | |
| 234 | - padding-left: 5px; | |
| 235 | -} | |
| 236 | - | |
| 237 | -.uk-list.station_info_win>li:nth-child(n+2), .uk-list.station_info_win>li>ul { | |
| 238 | - margin-top: 7px; | |
| 239 | -} | |
| 240 | - | |
| 241 | -ul.uk-list.station_info_win>li.s_name{ | |
| 242 | - font-size: 16px; | |
| 243 | - font-weight: 600; | |
| 244 | - color: #e15428; | |
| 245 | -} | |
| 246 | - | |
| 247 | -.up_down_route_list li.ct_active{ | |
| 248 | - background: #91d9fa; | |
| 249 | -} | |
| 250 | - | |
| 251 | -.up_down_route_list li.ct_active.f_r_a{ | |
| 252 | - background: #fff; | |
| 253 | -} | |
| 254 | - | |
| 255 | -.up_down_route_list li.ct_active.f_r_a>a{ | |
| 256 | - background: #91d9fa; | |
| 257 | -} | |
| 258 | - | |
| 259 | -.road_route .uk-list ul{ | |
| 260 | - padding-left: 0; | |
| 261 | -} | |
| 262 | - | |
| 263 | -.road_route>ul>li>ul>li{ | |
| 264 | - padding-left: 22px; | |
| 265 | -} | |
| 266 | - | |
| 267 | -.ct_coord_str{ | |
| 268 | - max-height: 300px; | |
| 269 | - overflow: auto; | |
| 270 | -} | |
| 271 | - | |
| 272 | -ul.context-menu-list.station-route-ct-menu.context-menu-root { | |
| 273 | - font-size: 14px; | |
| 274 | - width: 170px !important; | |
| 275 | - min-width: 70px; | |
| 276 | - border: 1px solid #d2d2d2; | |
| 277 | - overflow: hidden; | |
| 278 | - border-radius: 0; | |
| 279 | - background: #fff; | |
| 280 | - color: #666; | |
| 281 | - box-shadow: 0 5px 12px rgba(0,0,0,.15); | |
| 282 | -} | |
| 283 | - | |
| 284 | -.main_left_panel_m_layer{ | |
| 285 | - position: absolute; | |
| 286 | - z-index: 10000; | |
| 287 | - height: calc(100% - 20px); | |
| 288 | - width: 300px; | |
| 289 | - background: #ffffff85; | |
| 290 | - top: 7px; | |
| 291 | - left: 5px; | |
| 292 | - display: none; | |
| 293 | -} | |
| 294 | - | |
| 295 | -.buffer_edit_panel{ | |
| 296 | - position: absolute; | |
| 297 | - top: 5px; | |
| 298 | - width: 390px; | |
| 299 | - height: 120px; | |
| 300 | - background: #ffffff; | |
| 301 | - left: calc(50% - 170px); | |
| 302 | - z-index: 999; | |
| 303 | - box-shadow: 5px 5px 15px rgba(90, 90, 90, 0.48); | |
| 304 | - display: none; | |
| 305 | -} | |
| 306 | -.buffer_edit_body{ | |
| 307 | - padding: 5px 0 0 15px; | |
| 308 | -} | |
| 309 | - | |
| 310 | -.buffer_edit_body>.name{ | |
| 311 | - font-weight: 600; | |
| 312 | - color: #E91E63; | |
| 313 | - margin-bottom: 0; | |
| 314 | -} | |
| 315 | - | |
| 316 | -.buffer_edit_body .ct_row .uk-inline{ | |
| 317 | - width: 175px; | |
| 318 | - height: 30px; | |
| 319 | - margin-right: 7px; | |
| 320 | -} | |
| 321 | - | |
| 322 | -.buffer_edit_body .ct_row{ | |
| 323 | - margin-top: 12px; | |
| 324 | -} | |
| 325 | - | |
| 326 | -.buffer_edit_body .ct_row .uk-inline:last-child{ | |
| 327 | - margin-right: 0; | |
| 328 | -} | |
| 329 | - | |
| 330 | -.buffer_edit_body .ct_row .uk-inline input{ | |
| 331 | - height: 30px; | |
| 332 | -} | |
| 333 | - | |
| 334 | -.buffer_edit_body .ct_row .uk-form-icon-flip { | |
| 335 | - font-size: 12px; | |
| 336 | -} | |
| 337 | - | |
| 338 | -.buffer_edit_body .ct_row .uk-inline.btns{ | |
| 339 | - text-align: right; | |
| 340 | -} | |
| 341 | -.buffer_edit_body .ct_row .uk-inline.btns .uk-button{ | |
| 342 | - padding: 0 15px; | |
| 343 | - height: 28px; | |
| 344 | - line-height: 28px; | |
| 345 | - vertical-align: top; | |
| 346 | - margin-top: 2px; | |
| 347 | -} | |
| 348 | - | |
| 349 | -.loading{ | |
| 350 | - height: 100%; | |
| 351 | - text-align: center; | |
| 352 | - position: absolute; | |
| 353 | - z-index: 10000; | |
| 354 | - top: 0; | |
| 355 | - left: 0; | |
| 356 | - width: 100%; | |
| 357 | - background: #ffffff78; | |
| 358 | - display: flex; | |
| 359 | -} | |
| 360 | - | |
| 361 | -.loading>div{ | |
| 362 | - margin: auto; | |
| 363 | - margin-top: calc(25% - 100px); | |
| 364 | - background: #f9d56c; | |
| 365 | - padding: 12px; | |
| 366 | - box-shadow: 5px 5px 15px rgba(90, 90, 90, 0.48); | |
| 367 | -} | |
| 368 | - | |
| 369 | -.loading>div>span{ | |
| 370 | - vertical-align: top; | |
| 371 | - margin-top: -6px; | |
| 372 | - margin-right: 5px; | |
| 373 | - font-size: 14px; | |
| 374 | -} | |
| 375 | -.uk-modal{ | |
| 376 | - z-index: 10001; | |
| 377 | -} | |
| 378 | - | |
| 379 | -.ct_route_badge.polygon{ | |
| 380 | - | |
| 381 | -} | |
| 382 | - | |
| 383 | -.shapes_type>div.uk-inline:nth-of-type(2){ | |
| 384 | - width: 80px; | |
| 385 | - margin-right: 0; | |
| 386 | -} | |
| 387 | - | |
| 388 | -.shapes_type>div.uk-inline:first-child{ | |
| 389 | - width: 84px; | |
| 390 | -} | |
| 391 | - | |
| 392 | -.shapes_type>div.uk-inline:first-child select{ | |
| 393 | - height: 30px; | |
| 394 | -} | |
| 395 | - | |
| 396 | -.shapes_type.st_d>div.uk-inline:nth-of-type(2){ | |
| 397 | - display: none; | |
| 398 | -} | |
| 399 | - | |
| 400 | -.shapes_type.st_d>div.uk-inline:first-child{ | |
| 401 | - width: 167px; | |
| 402 | -} | |
| 403 | - | |
| 404 | -.draw_polygon_switch{ | |
| 405 | - display: none; | |
| 406 | -} | |
| 407 | - | |
| 408 | -.shapes_type.st_d>div.uk-inline:first-child select{ | |
| 409 | - width: 107px; | |
| 410 | -} | |
| 411 | - | |
| 412 | -.shapes_type.st_d .draw_polygon_switch{ | |
| 413 | - display: inline-block; | |
| 414 | - font-size: 12px; | |
| 415 | - vertical-align: bottom; | |
| 416 | - margin-left: 5px; | |
| 417 | -} | |
| 418 | - | |
| 419 | -.shapes_type.st_d .draw_polygon_switch>a{ | |
| 420 | - color: red; | |
| 421 | -} | |
| 422 | - | |
| 423 | -.ul_li_input{ | |
| 424 | - display: inline-block; | |
| 425 | - padding: 4px 0; | |
| 426 | - width: calc(100% - 53px); | |
| 427 | - background: #f7f7f7; | |
| 428 | -} | |
| 429 | - | |
| 430 | -.ul_li_input input{ | |
| 431 | - width: 140px; | |
| 432 | - height: 28px; | |
| 433 | - margin-left: 5px; | |
| 434 | -} | |
| 435 | - | |
| 436 | -.save_icon_btn{ | |
| 437 | - color: #2121d1; | |
| 438 | - margin-right: 4px; | |
| 439 | -} | |
| 440 | - | |
| 441 | -.ul_li_input .uk-icon:hover{ | |
| 442 | - background: #dfdfdf; | |
| 443 | -} | |
| 444 | - | |
| 445 | -.station_li_transient .ct_route_badge{ | |
| 446 | - background: #ddcd3f; | |
| 447 | - vertical-align: middle; | |
| 448 | -} | |
| 449 | - | |
| 450 | -.station_li_transient .search_point_icon_btn{ | |
| 451 | - color: #FF9800; | |
| 452 | - margin-right: 5px; | |
| 453 | -} | |
| 454 | - | |
| 455 | -.station_route ._edit_name .ct_route_badge{ | |
| 456 | - vertical-align: middle; | |
| 457 | -} | |
| 458 | - | |
| 459 | -.add_station_search_point_wrap{ | |
| 460 | - width: 390px; | |
| 461 | - height: 126px; | |
| 462 | - position: absolute; | |
| 463 | - top: 10px; | |
| 464 | - left: calc(50% - 200px); | |
| 465 | - z-index: 999; | |
| 466 | - background: #ffface; | |
| 467 | - box-shadow: 5px 5px 15px rgba(90, 90, 90, 0.48); | |
| 468 | -} | |
| 469 | - | |
| 470 | -.add_station_search_point_wrap ._title { | |
| 471 | - text-align: center; | |
| 472 | - font-size: 17px; | |
| 473 | - color: #2b2b2b; | |
| 474 | - padding: 2px 0 0 0; | |
| 475 | - font-weight: 600; | |
| 476 | -} | |
| 477 | - | |
| 478 | -.add_station_search_point_wrap .buffer_edit_body .ct_row { | |
| 479 | - margin-top: 8px; | |
| 480 | -} | |
| 481 | - | |
| 482 | -.road_edit_panel{ | |
| 483 | - position: absolute; | |
| 484 | - z-index: 999; | |
| 485 | - top: 10px; | |
| 486 | - left: calc(50% - 190px); | |
| 487 | - width: 380px; | |
| 488 | - background: #fff; | |
| 489 | - height: 120px; | |
| 490 | - box-shadow: 5px 5px 15px rgba(90, 90, 90, 0.48); | |
| 491 | -} | |
| 492 | - | |
| 493 | -.road_li_transient .ul_li_input input:first-child{ | |
| 494 | - width: 110px; | |
| 495 | - margin-left: 2px; | |
| 496 | -} | |
| 497 | - | |
| 498 | -.road_li_transient .ul_li_input input:nth-of-type(2){ | |
| 499 | - width: 100px; | |
| 500 | - margin-left: 0; | |
| 501 | - font-size: 12px; | |
| 502 | -} | |
| 503 | - | |
| 504 | -.bks_list li.road_li_transient{ | |
| 505 | - margin-left: -15px; | |
| 506 | -} | |
| 507 | - | |
| 508 | -.road_li_transient .search_point_icon_btn { | |
| 509 | - color: #FF9800; | |
| 510 | - margin-right: 5px; | |
| 511 | -} | |
| 512 | - | |
| 513 | -.road_li_transient .ul_li_input{ | |
| 514 | - width: 100%; | |
| 515 | - | |
| 516 | -} | |
| 517 | - | |
| 518 | -.road_li_transient .ul_li_input input{ | |
| 519 | - color: #c5862a; | |
| 520 | -} | |
| 521 | - | |
| 522 | - | |
| 523 | -.add_road_search_point_wrap{ | |
| 524 | - width: 390px; | |
| 525 | - height: 120px; | |
| 526 | - position: absolute; | |
| 527 | - top: 10px; | |
| 528 | - left: calc(50% - 200px); | |
| 529 | - z-index: 999; | |
| 530 | - background: #ffface; | |
| 531 | - box-shadow: 5px 5px 15px rgba(90, 90, 90, 0.48); | |
| 532 | -} | |
| 533 | - | |
| 534 | -.add_road_search_point_wrap ._title { | |
| 535 | - text-align: center; | |
| 536 | - font-size: 17px; | |
| 537 | - color: #2b2b2b; | |
| 538 | - padding: 2px 0 0 0; | |
| 539 | - font-weight: 600; | |
| 540 | -} | |
| 541 | - | |
| 542 | -.add_road_search_point_wrap .buffer_edit_body .ct_row { | |
| 543 | - margin-top: 8px; | |
| 544 | -} | |
| 545 | - | |
| 546 | -.draw_polyline_switch{ | |
| 547 | - display: inline-block; | |
| 548 | - font-size: 12px; | |
| 549 | - vertical-align: bottom; | |
| 550 | - margin-left: 5px; | |
| 551 | -} | |
| 552 | - | |
| 553 | -.draw_polyline_switch>a{ | |
| 554 | - color: red; | |
| 555 | -} | |
| 556 | - | |
| 557 | -.ct_search_input::placeholder{ | |
| 558 | - font-size: 13px; | |
| 559 | -} | |
| 560 | - | |
| 561 | -.ct_search_result>ul.s_list ._title{ | |
| 562 | - display: block; | |
| 563 | - color: #009688; | |
| 564 | - font-size: 14px; | |
| 565 | -} | |
| 566 | - | |
| 567 | -.ct_search_result>ul.s_list ._address{ | |
| 568 | - font-size: 12px; | |
| 569 | -} | |
| 570 | - | |
| 571 | -.ct_s_i_wrap{ | |
| 572 | - box-shadow: 0px 4px 12px rgba(145, 145, 145, 0.48); | |
| 573 | -} | |
| 574 | - | |
| 575 | -.ct_search_result{ | |
| 576 | - background: #fff; | |
| 577 | - margin-top: 10px; | |
| 578 | - box-shadow: 5px 5px 15px rgba(90, 90, 90, 0.48); | |
| 579 | - max-width: 300px; | |
| 580 | -} | |
| 581 | - | |
| 582 | -.ct_search_result .s_list>li{ | |
| 583 | - padding: 5px 15px; | |
| 584 | - cursor: pointer; | |
| 585 | - margin-top: 0; | |
| 586 | - | |
| 587 | - overflow: hidden; | |
| 588 | - text-overflow: ellipsis; | |
| 589 | - white-space: nowrap; | |
| 590 | -} | |
| 591 | - | |
| 592 | -.ct_search_result .s_list>li:hover{ | |
| 593 | - background: #e1e1e1; | |
| 594 | -} | |
| 595 | - | |
| 596 | -.ct_search_result ._empty{ | |
| 597 | - font-size: 12px; | |
| 598 | - color: #656464; | |
| 599 | -} | |
| 600 | - | |
| 601 | -.ct_search_result .uk-icon{ | |
| 602 | - cursor: pointer; | |
| 603 | -} | |
| 604 | - | |
| 605 | -.main_lt_search_panel .uk-form-icon:not(a):not(button):not(input){ | |
| 606 | - pointer-events: auto; | |
| 607 | -} | |
| 608 | - | |
| 609 | -#add_line_versions_modal form.uk-form-horizontal .uk-form-label{ | |
| 610 | - width: 100px !important; | |
| 611 | -} | |
| 612 | - | |
| 613 | -#add_line_versions_modal form.uk-form-horizontal .uk-form-controls{ | |
| 614 | - margin-left: 115px; | |
| 1 | +/* ^_^ baidu map hide logo */ | |
| 2 | +.anchorBL, .anchorBL, .amap-logo, .amap-copyright { | |
| 3 | + display: none; | |
| 4 | +} | |
| 5 | + | |
| 6 | +html,body{ | |
| 7 | + height: 100%; | |
| 8 | +} | |
| 9 | +.ct_page{ | |
| 10 | + padding: 0; | |
| 11 | + height: 100%; | |
| 12 | +} | |
| 13 | + | |
| 14 | +div#map_wrap{ | |
| 15 | + height: 100%; | |
| 16 | +} | |
| 17 | + | |
| 18 | +.main_left_panel{ | |
| 19 | + position: absolute; | |
| 20 | + z-index: 999; | |
| 21 | + height: calc(100% - 20px); | |
| 22 | + width: 310px; | |
| 23 | + background: #fffffff5; | |
| 24 | + top: 7px; | |
| 25 | + left: 5px; | |
| 26 | + box-shadow: 5px 5px 15px rgba(90, 90, 90, 0.48); | |
| 27 | +} | |
| 28 | +.main_lt_search_panel{ | |
| 29 | + position: absolute; | |
| 30 | + z-index: 99; | |
| 31 | + top: 10px; | |
| 32 | + left: 330px; | |
| 33 | +} | |
| 34 | +.main_rt_tools_panel{ | |
| 35 | + position: absolute; | |
| 36 | + z-index: 99; | |
| 37 | + top: 20px; | |
| 38 | + right: 77px; | |
| 39 | + background: #ffffff; | |
| 40 | + box-shadow: -5px 4px 15px rgba(90, 90, 90, 0.48); | |
| 41 | + padding: 0 12px; | |
| 42 | + text-align: center; | |
| 43 | + border-radius: 7px; | |
| 44 | + height: 28px; | |
| 45 | +} | |
| 46 | + | |
| 47 | +.main_rt_tools_panel>._icon{ | |
| 48 | + margin: 0 9px; | |
| 49 | +} | |
| 50 | +.search_input{ | |
| 51 | + width: 250px; | |
| 52 | + height: 42px; | |
| 53 | +} | |
| 54 | + | |
| 55 | +.search_input::placeholder{ | |
| 56 | + color: grey; | |
| 57 | + font-size: 12px; | |
| 58 | +} | |
| 59 | + | |
| 60 | +._line_info{ | |
| 61 | + width: 100%; | |
| 62 | + height: 80px; | |
| 63 | + background: white; | |
| 64 | + box-shadow: 0px -2px 15px rgba(90, 90, 90, 0.48); | |
| 65 | +} | |
| 66 | + | |
| 67 | +._line_name{ | |
| 68 | + padding: 10px 0 0 15px; | |
| 69 | + font-weight: 600; | |
| 70 | + font-family: 微软雅黑; | |
| 71 | + font-size: 18px; | |
| 72 | + color: #484848; | |
| 73 | + position: relative; | |
| 74 | +} | |
| 75 | + | |
| 76 | +._version_dropdown_wrap{ | |
| 77 | + padding: 4px 0 0 15px; | |
| 78 | +} | |
| 79 | +._version_text{ | |
| 80 | + font-size: 14px; | |
| 81 | + color: #0aae0a; | |
| 82 | +} | |
| 83 | +._version_dropdown_wrap li.uk-active>a{ | |
| 84 | + color: #0aae0a; | |
| 85 | +} | |
| 86 | +.uk-nav-header:not(:first-child) { | |
| 87 | + margin-top: 10px; | |
| 88 | +} | |
| 89 | +.add_line_version_icon{ | |
| 90 | + position: absolute; | |
| 91 | + right: 18px; | |
| 92 | + top: 10px; | |
| 93 | +} | |
| 94 | +.clock_enable_version{ | |
| 95 | + padding: 4px 0 0 15px; | |
| 96 | + font-size: 13px; | |
| 97 | + color: #ef4f4f; | |
| 98 | +} | |
| 99 | + | |
| 100 | +.clock_enable_version>a.uk-icon{ | |
| 101 | + vertical-align: top; | |
| 102 | + margin-top: 6px; | |
| 103 | +} | |
| 104 | +._route_info_wrap{ | |
| 105 | + height: calc(100% - 90px); | |
| 106 | + padding-top: 10px; | |
| 107 | +} | |
| 108 | + | |
| 109 | +._route_info_wrap .uk-tab>li>a{ | |
| 110 | + padding: 9px 5px; | |
| 111 | +} | |
| 112 | +._route_info_wrap>ul.uk-tab{ | |
| 113 | + padding-left: 10px; | |
| 114 | + margin-bottom: 0; | |
| 115 | +} | |
| 116 | +.rt_show_version_txt{ | |
| 117 | + position: absolute; | |
| 118 | + right: 7px; | |
| 119 | + bottom: 7px; | |
| 120 | + font-size: 12px; | |
| 121 | +} | |
| 122 | +.rt_show_version_txt{ | |
| 123 | + position: absolute; | |
| 124 | + right: 7px; | |
| 125 | + bottom: 7px; | |
| 126 | + font-size: 12px; | |
| 127 | + padding: 5px 8px; | |
| 128 | +} | |
| 129 | +.station_route>ul{ | |
| 130 | + padding: 0 0 0 30px; | |
| 131 | + font-size: 14px; | |
| 132 | + width: calc(100% - 38px); | |
| 133 | +} | |
| 134 | + | |
| 135 | +.up_down_route_list ul.uk-list>li:nth-child(n+2), .uk-list>li>ul { | |
| 136 | + margin-top: 0; | |
| 137 | +} | |
| 138 | + | |
| 139 | +.station_route>ul>li>a{ | |
| 140 | + color: #434343; | |
| 141 | + overflow: hidden; | |
| 142 | + text-overflow: ellipsis; | |
| 143 | + white-space: nowrap; | |
| 144 | + display: inline-block; | |
| 145 | + width: calc(100% - 53px); | |
| 146 | + padding: 4px 0; | |
| 147 | + vertical-align: middle;+0982/ | |
| 148 | +} | |
| 149 | + | |
| 150 | +.ct_route_badge{ | |
| 151 | + font-size: 11px; | |
| 152 | + height: 18px; | |
| 153 | + border-radius: 5px; | |
| 154 | + vertical-align: top; | |
| 155 | + margin-top: 1px; | |
| 156 | + padding: 0 4px; | |
| 157 | + margin-right: 3px; | |
| 158 | + min-width: 18px; | |
| 159 | +} | |
| 160 | + | |
| 161 | +.up_down_route_list>li:nth-of-type(2) .ct_route_badge{ | |
| 162 | + background: #fb6464; | |
| 163 | +} | |
| 164 | + | |
| 165 | +.ct_route_badge.start{ | |
| 166 | + margin-left: 0px; | |
| 167 | +} | |
| 168 | +.ct_route_badge.end{ | |
| 169 | + margin-left: 0px; | |
| 170 | +} | |
| 171 | +.road_route{ | |
| 172 | + padding-left: 30px; | |
| 173 | + width: calc(100% - 25px); | |
| 174 | + font-size: 14px; | |
| 175 | + color: #242424; | |
| 176 | + border-top: 1px solid #d5d5d5; | |
| 177 | + padding-top: 0; | |
| 178 | +} | |
| 179 | +._route_info_wrap>ul.uk-switcher{ | |
| 180 | + overflow: auto; | |
| 181 | + height: calc(100% - 62px); | |
| 182 | + margin-bottom: 0; | |
| 183 | + position: relative; | |
| 184 | + padding-top: 20px; | |
| 185 | + margin-top: 0 !important; | |
| 186 | +} | |
| 187 | + | |
| 188 | +.pos_tb_icon{ | |
| 189 | + position: absolute; | |
| 190 | + bottom: 15px; | |
| 191 | + right: 15px; | |
| 192 | +} | |
| 193 | +.ct_route_badge_wrap{ | |
| 194 | + display: inline-block; | |
| 195 | + width: 48px; | |
| 196 | + text-align: right; | |
| 197 | + vertical-align: top; | |
| 198 | + margin-top: 3px; | |
| 199 | +} | |
| 200 | + | |
| 201 | +.road_route>ul li a{ | |
| 202 | + color: #242424; | |
| 203 | + width: 100%; | |
| 204 | + display: block; | |
| 205 | + padding-left: 8px; | |
| 206 | +} | |
| 207 | + | |
| 208 | +.road_route>ul{ | |
| 209 | + border-left: 1px solid #cbcbcb; | |
| 210 | + padding-left: 0; | |
| 211 | + padding-top: 10px; | |
| 212 | +} | |
| 213 | + | |
| 214 | +span.sub_name { | |
| 215 | + font-size: 12px; | |
| 216 | + color: #777676; | |
| 217 | + margin-left: 5px; | |
| 218 | +} | |
| 219 | + | |
| 220 | +.road_route>ul>li{ | |
| 221 | + width: calc(100% - 10px); | |
| 222 | + overflow: hidden; | |
| 223 | + text-overflow: ellipsis; | |
| 224 | + white-space: nowrap; | |
| 225 | + display: inline-block; | |
| 226 | +} | |
| 227 | + | |
| 228 | +#map_wrap img { | |
| 229 | + max-width: none; | |
| 230 | +} | |
| 231 | + | |
| 232 | +ul.uk-list.station_info_win { | |
| 233 | + font-size: 14px; | |
| 234 | + padding-left: 5px; | |
| 235 | +} | |
| 236 | + | |
| 237 | +.uk-list.station_info_win>li:nth-child(n+2), .uk-list.station_info_win>li>ul { | |
| 238 | + margin-top: 7px; | |
| 239 | +} | |
| 240 | + | |
| 241 | +ul.uk-list.station_info_win>li.s_name{ | |
| 242 | + font-size: 16px; | |
| 243 | + font-weight: 600; | |
| 244 | + color: #e15428; | |
| 245 | +} | |
| 246 | + | |
| 247 | +.up_down_route_list li.ct_active{ | |
| 248 | + background: #91d9fa; | |
| 249 | +} | |
| 250 | + | |
| 251 | +.up_down_route_list li.ct_active.f_r_a{ | |
| 252 | + background: #fff; | |
| 253 | +} | |
| 254 | + | |
| 255 | +.up_down_route_list li.ct_active.f_r_a>a{ | |
| 256 | + background: #91d9fa; | |
| 257 | +} | |
| 258 | + | |
| 259 | +.road_route .uk-list ul{ | |
| 260 | + padding-left: 0; | |
| 261 | +} | |
| 262 | + | |
| 263 | +.road_route>ul>li>ul>li{ | |
| 264 | + padding-left: 22px; | |
| 265 | +} | |
| 266 | + | |
| 267 | +.ct_coord_str{ | |
| 268 | + max-height: 300px; | |
| 269 | + overflow: auto; | |
| 270 | +} | |
| 271 | + | |
| 272 | +ul.context-menu-list.station-route-ct-menu.context-menu-root { | |
| 273 | + font-size: 14px; | |
| 274 | + width: 170px !important; | |
| 275 | + min-width: 70px; | |
| 276 | + border: 1px solid #d2d2d2; | |
| 277 | + overflow: hidden; | |
| 278 | + border-radius: 0; | |
| 279 | + background: #fff; | |
| 280 | + color: #666; | |
| 281 | + box-shadow: 0 5px 12px rgba(0,0,0,.15); | |
| 282 | +} | |
| 283 | + | |
| 284 | +.main_left_panel_m_layer{ | |
| 285 | + position: absolute; | |
| 286 | + z-index: 10000; | |
| 287 | + height: calc(100% - 20px); | |
| 288 | + width: 300px; | |
| 289 | + background: #ffffff85; | |
| 290 | + top: 7px; | |
| 291 | + left: 5px; | |
| 292 | + display: none; | |
| 293 | +} | |
| 294 | + | |
| 295 | +.buffer_edit_panel{ | |
| 296 | + position: absolute; | |
| 297 | + top: 5px; | |
| 298 | + width: 390px; | |
| 299 | + height: 120px; | |
| 300 | + background: #ffffff; | |
| 301 | + left: calc(50% - 170px); | |
| 302 | + z-index: 999; | |
| 303 | + box-shadow: 5px 5px 15px rgba(90, 90, 90, 0.48); | |
| 304 | + display: none; | |
| 305 | +} | |
| 306 | +.buffer_edit_body{ | |
| 307 | + padding: 5px 0 0 15px; | |
| 308 | +} | |
| 309 | + | |
| 310 | +.buffer_edit_body>.name{ | |
| 311 | + font-weight: 600; | |
| 312 | + color: #E91E63; | |
| 313 | + margin-bottom: 0; | |
| 314 | +} | |
| 315 | + | |
| 316 | +.buffer_edit_body .ct_row .uk-inline{ | |
| 317 | + width: 175px; | |
| 318 | + height: 30px; | |
| 319 | + margin-right: 7px; | |
| 320 | +} | |
| 321 | + | |
| 322 | +.buffer_edit_body .ct_row{ | |
| 323 | + margin-top: 12px; | |
| 324 | +} | |
| 325 | + | |
| 326 | +.buffer_edit_body .ct_row .uk-inline:last-child{ | |
| 327 | + margin-right: 0; | |
| 328 | +} | |
| 329 | + | |
| 330 | +.buffer_edit_body .ct_row .uk-inline input{ | |
| 331 | + height: 30px; | |
| 332 | +} | |
| 333 | + | |
| 334 | +.buffer_edit_body .ct_row .uk-form-icon-flip { | |
| 335 | + font-size: 12px; | |
| 336 | +} | |
| 337 | + | |
| 338 | +.buffer_edit_body .ct_row .uk-inline.btns{ | |
| 339 | + text-align: right; | |
| 340 | +} | |
| 341 | +.buffer_edit_body .ct_row .uk-inline.btns .uk-button{ | |
| 342 | + padding: 0 15px; | |
| 343 | + height: 28px; | |
| 344 | + line-height: 28px; | |
| 345 | + vertical-align: top; | |
| 346 | + margin-top: 2px; | |
| 347 | +} | |
| 348 | + | |
| 349 | +.loading{ | |
| 350 | + height: 100%; | |
| 351 | + text-align: center; | |
| 352 | + position: absolute; | |
| 353 | + z-index: 10000; | |
| 354 | + top: 0; | |
| 355 | + left: 0; | |
| 356 | + width: 100%; | |
| 357 | + background: #ffffff78; | |
| 358 | + display: flex; | |
| 359 | +} | |
| 360 | + | |
| 361 | +.loading>div{ | |
| 362 | + margin: auto; | |
| 363 | + margin-top: calc(25% - 100px); | |
| 364 | + background: #f9d56c; | |
| 365 | + padding: 12px; | |
| 366 | + box-shadow: 5px 5px 15px rgba(90, 90, 90, 0.48); | |
| 367 | +} | |
| 368 | + | |
| 369 | +.loading>div>span{ | |
| 370 | + vertical-align: top; | |
| 371 | + margin-top: -6px; | |
| 372 | + margin-right: 5px; | |
| 373 | + font-size: 14px; | |
| 374 | +} | |
| 375 | +.uk-modal{ | |
| 376 | + z-index: 10001; | |
| 377 | +} | |
| 378 | + | |
| 379 | +.ct_route_badge.polygon{ | |
| 380 | + | |
| 381 | +} | |
| 382 | + | |
| 383 | +.shapes_type>div.uk-inline:nth-of-type(2){ | |
| 384 | + width: 80px; | |
| 385 | + margin-right: 0; | |
| 386 | +} | |
| 387 | + | |
| 388 | +.shapes_type>div.uk-inline:first-child{ | |
| 389 | + width: 84px; | |
| 390 | +} | |
| 391 | + | |
| 392 | +.shapes_type>div.uk-inline:first-child select{ | |
| 393 | + height: 30px; | |
| 394 | +} | |
| 395 | + | |
| 396 | +.shapes_type.st_d>div.uk-inline:nth-of-type(2){ | |
| 397 | + display: none; | |
| 398 | +} | |
| 399 | + | |
| 400 | +.shapes_type.st_d>div.uk-inline:first-child{ | |
| 401 | + width: 167px; | |
| 402 | +} | |
| 403 | + | |
| 404 | +.draw_polygon_switch{ | |
| 405 | + display: none; | |
| 406 | +} | |
| 407 | + | |
| 408 | +.shapes_type.st_d>div.uk-inline:first-child select{ | |
| 409 | + width: 107px; | |
| 410 | +} | |
| 411 | + | |
| 412 | +.shapes_type.st_d .draw_polygon_switch{ | |
| 413 | + display: inline-block; | |
| 414 | + font-size: 12px; | |
| 415 | + vertical-align: bottom; | |
| 416 | + margin-left: 5px; | |
| 417 | +} | |
| 418 | + | |
| 419 | +.shapes_type.st_d .draw_polygon_switch>a{ | |
| 420 | + color: red; | |
| 421 | +} | |
| 422 | + | |
| 423 | +.ul_li_input{ | |
| 424 | + display: inline-block; | |
| 425 | + padding: 4px 0; | |
| 426 | + width: calc(100% - 53px); | |
| 427 | + background: #f7f7f7; | |
| 428 | +} | |
| 429 | + | |
| 430 | +.ul_li_input input{ | |
| 431 | + width: 140px; | |
| 432 | + height: 28px; | |
| 433 | + margin-left: 5px; | |
| 434 | +} | |
| 435 | + | |
| 436 | +.save_icon_btn{ | |
| 437 | + color: #2121d1; | |
| 438 | + margin-right: 4px; | |
| 439 | +} | |
| 440 | + | |
| 441 | +.ul_li_input .uk-icon:hover{ | |
| 442 | + background: #dfdfdf; | |
| 443 | +} | |
| 444 | + | |
| 445 | +.station_li_transient .ct_route_badge{ | |
| 446 | + background: #ddcd3f; | |
| 447 | + vertical-align: middle; | |
| 448 | +} | |
| 449 | + | |
| 450 | +.station_li_transient .search_point_icon_btn{ | |
| 451 | + color: #FF9800; | |
| 452 | + margin-right: 5px; | |
| 453 | +} | |
| 454 | + | |
| 455 | +.station_route ._edit_name .ct_route_badge{ | |
| 456 | + vertical-align: middle; | |
| 457 | +} | |
| 458 | + | |
| 459 | +.add_station_search_point_wrap{ | |
| 460 | + width: 390px; | |
| 461 | + height: 126px; | |
| 462 | + position: absolute; | |
| 463 | + top: 10px; | |
| 464 | + left: calc(50% - 200px); | |
| 465 | + z-index: 999; | |
| 466 | + background: #ffface; | |
| 467 | + box-shadow: 5px 5px 15px rgba(90, 90, 90, 0.48); | |
| 468 | +} | |
| 469 | + | |
| 470 | +.add_station_search_point_wrap ._title { | |
| 471 | + text-align: center; | |
| 472 | + font-size: 17px; | |
| 473 | + color: #2b2b2b; | |
| 474 | + padding: 2px 0 0 0; | |
| 475 | + font-weight: 600; | |
| 476 | +} | |
| 477 | + | |
| 478 | +.add_station_search_point_wrap .buffer_edit_body .ct_row { | |
| 479 | + margin-top: 8px; | |
| 480 | +} | |
| 481 | + | |
| 482 | +.road_edit_panel{ | |
| 483 | + position: absolute; | |
| 484 | + z-index: 999; | |
| 485 | + top: 10px; | |
| 486 | + left: calc(50% - 190px); | |
| 487 | + width: 380px; | |
| 488 | + background: #fff; | |
| 489 | + height: 120px; | |
| 490 | + box-shadow: 5px 5px 15px rgba(90, 90, 90, 0.48); | |
| 491 | +} | |
| 492 | + | |
| 493 | +.road_li_transient .ul_li_input input:first-child{ | |
| 494 | + width: 110px; | |
| 495 | + margin-left: 2px; | |
| 496 | +} | |
| 497 | + | |
| 498 | +.road_li_transient .ul_li_input input:nth-of-type(2){ | |
| 499 | + width: 100px; | |
| 500 | + margin-left: 0; | |
| 501 | + font-size: 12px; | |
| 502 | +} | |
| 503 | + | |
| 504 | +.bks_list li.road_li_transient{ | |
| 505 | + margin-left: -15px; | |
| 506 | +} | |
| 507 | + | |
| 508 | +.road_li_transient .search_point_icon_btn { | |
| 509 | + color: #FF9800; | |
| 510 | + margin-right: 5px; | |
| 511 | +} | |
| 512 | + | |
| 513 | +.road_li_transient .ul_li_input{ | |
| 514 | + width: 100%; | |
| 515 | + | |
| 516 | +} | |
| 517 | + | |
| 518 | +.road_li_transient .ul_li_input input{ | |
| 519 | + color: #c5862a; | |
| 520 | +} | |
| 521 | + | |
| 522 | + | |
| 523 | +.add_road_search_point_wrap{ | |
| 524 | + width: 390px; | |
| 525 | + height: 120px; | |
| 526 | + position: absolute; | |
| 527 | + top: 10px; | |
| 528 | + left: calc(50% - 200px); | |
| 529 | + z-index: 999; | |
| 530 | + background: #ffface; | |
| 531 | + box-shadow: 5px 5px 15px rgba(90, 90, 90, 0.48); | |
| 532 | +} | |
| 533 | + | |
| 534 | +.add_road_search_point_wrap ._title { | |
| 535 | + text-align: center; | |
| 536 | + font-size: 17px; | |
| 537 | + color: #2b2b2b; | |
| 538 | + padding: 2px 0 0 0; | |
| 539 | + font-weight: 600; | |
| 540 | +} | |
| 541 | + | |
| 542 | +.add_road_search_point_wrap .buffer_edit_body .ct_row { | |
| 543 | + margin-top: 8px; | |
| 544 | +} | |
| 545 | + | |
| 546 | +.draw_polyline_switch{ | |
| 547 | + display: inline-block; | |
| 548 | + font-size: 12px; | |
| 549 | + vertical-align: bottom; | |
| 550 | + margin-left: 5px; | |
| 551 | +} | |
| 552 | + | |
| 553 | +.draw_polyline_switch>a{ | |
| 554 | + color: red; | |
| 555 | +} | |
| 556 | + | |
| 557 | +.ct_search_input::placeholder{ | |
| 558 | + font-size: 13px; | |
| 559 | +} | |
| 560 | + | |
| 561 | +.ct_search_result>ul.s_list ._title{ | |
| 562 | + display: block; | |
| 563 | + color: #009688; | |
| 564 | + font-size: 14px; | |
| 565 | +} | |
| 566 | + | |
| 567 | +.ct_search_result>ul.s_list ._address{ | |
| 568 | + font-size: 12px; | |
| 569 | +} | |
| 570 | + | |
| 571 | +.ct_s_i_wrap{ | |
| 572 | + box-shadow: 0px 4px 12px rgba(145, 145, 145, 0.48); | |
| 573 | +} | |
| 574 | + | |
| 575 | +.ct_search_result{ | |
| 576 | + background: #fff; | |
| 577 | + margin-top: 10px; | |
| 578 | + box-shadow: 5px 5px 15px rgba(90, 90, 90, 0.48); | |
| 579 | + max-width: 300px; | |
| 580 | +} | |
| 581 | + | |
| 582 | +.ct_search_result .s_list>li{ | |
| 583 | + padding: 5px 15px; | |
| 584 | + cursor: pointer; | |
| 585 | + margin-top: 0; | |
| 586 | + | |
| 587 | + overflow: hidden; | |
| 588 | + text-overflow: ellipsis; | |
| 589 | + white-space: nowrap; | |
| 590 | +} | |
| 591 | + | |
| 592 | +.ct_search_result .s_list>li:hover{ | |
| 593 | + background: #e1e1e1; | |
| 594 | +} | |
| 595 | + | |
| 596 | +.ct_search_result ._empty{ | |
| 597 | + font-size: 12px; | |
| 598 | + color: #656464; | |
| 599 | +} | |
| 600 | + | |
| 601 | +.ct_search_result .uk-icon{ | |
| 602 | + cursor: pointer; | |
| 603 | +} | |
| 604 | + | |
| 605 | +.main_lt_search_panel .uk-form-icon:not(a):not(button):not(input){ | |
| 606 | + pointer-events: auto; | |
| 607 | +} | |
| 608 | + | |
| 609 | +#add_line_versions_modal form.uk-form-horizontal .uk-form-label{ | |
| 610 | + width: 100px !important; | |
| 611 | +} | |
| 612 | + | |
| 613 | +#add_line_versions_modal form.uk-form-horizontal .uk-form-controls{ | |
| 614 | + margin-left: 115px; | |
| 615 | 615 | } |
| 616 | 616 | \ No newline at end of file | ... | ... |
src/main/resources/static/pages/base/geo_data_edit/fragments/f_station_route.html
| 1 | -<div> | |
| 2 | - <script id="geo_d_e_station_route-temp" type="text/html"> | |
| 3 | - <ul class="uk-list"> | |
| 4 | - {{each list as s i}} | |
| 5 | - <li class="s_r_item" data-code="{{s.stationCode}}" data-id="{{s.id}}"> | |
| 6 | - <div class="ct_route_badge_wrap"> | |
| 7 | - <span class="uk-badge ct_route_badge {{if s.stationMark=='B'}}start{{else if s.stationMark=='E'}}end{{/if}} {{if s.shapesType=='d'}}polygon{{/if}}"> | |
| 8 | - {{if s.stationMark=='B'}}起点站{{else if s.stationMark=='E'}}终点站{{else}}{{i + 1}}{{/if}}</span> | |
| 9 | - </div> | |
| 10 | - <a data-code="{{s.stationCode}}" data-updown="{{s.directions}}">{{s.stationName}}</a> | |
| 11 | - </li> | |
| 12 | - {{/each}} | |
| 13 | - </ul> | |
| 14 | - </script> | |
| 15 | - | |
| 16 | - <script id="geo_d_e_station_route_one-temp" type="text/html"> | |
| 17 | - <li class="s_r_item" data-code="{{stationCode}}" data-id="{{id}}"> | |
| 18 | - <div class="ct_route_badge_wrap"> | |
| 19 | - <span class="uk-badge ct_route_badge {{if stationMark=='B'}}start{{else if stationMark=='E'}}end{{/if}} {{if shapesType=='d'}}polygon{{/if}}"> | |
| 20 | - {{if stationMark=='B'}}起点站{{else if stationMark=='E'}}终点站{{else}}{{index}}{{/if}}</span> | |
| 21 | - </div> | |
| 22 | - <a class="uk-animation-shake" data-code="{{stationCode}}" data-updown="{{directions}}">{{stationName}}</a> | |
| 23 | - </li> | |
| 24 | - </script> | |
| 25 | - | |
| 26 | - | |
| 27 | - <script id="geo_d_e_station_info_win-temp" type="text/html"> | |
| 28 | - <ul class="uk-list station_info_win"> | |
| 29 | - <li class="s_name">{{stationName}}</li> | |
| 30 | - <li>站点编码: {{stationCode}}</li> | |
| 31 | - <li>站点类型: | |
| 32 | - {{if stationMark=='B'}} | |
| 33 | - 起点站 | |
| 34 | - {{else if stationMark=='E'}} | |
| 35 | - 终点站 | |
| 36 | - {{else if stationMark=='Z'}} | |
| 37 | - 中途站 | |
| 38 | - {{/if}} | |
| 39 | - </li> | |
| 40 | - <li> | |
| 41 | - 经度: {{gLaty}} | |
| 42 | - </li> | |
| 43 | - <li>纬度: {{gLonx}}</li> | |
| 44 | - <li> | |
| 45 | - 电子围栏类型: | |
| 46 | - {{if shapesType=='r'}} | |
| 47 | - 圆形 | |
| 48 | - {{else if shapesType=='d'}} | |
| 49 | - 多边形 | |
| 50 | - {{/if}} | |
| 51 | - </li> | |
| 52 | - <li> | |
| 53 | - {{if shapesType=='r'}} | |
| 54 | - 半径:{{radius}} | |
| 55 | - {{/if}} | |
| 56 | - </li> | |
| 57 | - <li>站序:{{index + 1}}</li> | |
| 58 | - <li>路由序号:{{stationRouteCode}}</li> | |
| 59 | - </ul> | |
| 60 | - </script> | |
| 61 | - | |
| 62 | - <script id="geo_d_e_map_edit_buffer_panel-temp" type="text/html"> | |
| 63 | - <div class="buffer_edit_panel uk-animation-slide-top-small"> | |
| 64 | - <div class="buffer_edit_body" > | |
| 65 | - <h6 class="name">{{stationName}}(缓冲区编辑)</h6> | |
| 66 | - <form> | |
| 67 | - <input type="hidden" value="{{id}}" name="id"> | |
| 68 | - <input type="hidden" value="{{directions}}" name="directions"> | |
| 69 | - <input type="hidden" value="{{stationCode}}" name="stationCode"> | |
| 70 | - <input type="hidden" value="{{stationName}}" name="stationName"> | |
| 71 | - <div class="ct_row"> | |
| 72 | - <div class="uk-inline"> | |
| 73 | - <span class="uk-form-icon uk-form-icon-flip" >经度</span> | |
| 74 | - <input class="uk-input" name="gLaty" type="text" value="{{bd_lat}}" readonly> | |
| 75 | - </div> | |
| 76 | - <div class="uk-inline"> | |
| 77 | - <span class="uk-form-icon uk-form-icon-flip" >纬度</span> | |
| 78 | - <input class="uk-input" name="gLonx" type="text" value="{{bd_lon}}" readonly> | |
| 79 | - </div> | |
| 80 | - </div> | |
| 81 | - | |
| 82 | - <div class="ct_row shapes_type {{shapesType=='d'?'st_d':''}}"> | |
| 83 | - <div class="uk-inline" > | |
| 84 | - <select name="shapesType" class="uk-select"> | |
| 85 | - <option value="r" {{shapesType=='r'?'selected':''}}>圆形</option> | |
| 86 | - <option value="d" {{shapesType=='d'?'selected':''}}>多边形</option> | |
| 87 | - </select> | |
| 88 | - <span class="draw_polygon_switch" data-type="{{shapesType=='d'?'3':'1'}}"><a>{{shapesType=='d'?'重新绘制':'暂停绘制'}}</a></span> | |
| 89 | - </div> | |
| 90 | - <div class="uk-inline"> | |
| 91 | - <span class="uk-form-icon uk-form-icon-flip" >半径</span> | |
| 92 | - <input class="uk-input" name="radius" type="text" value="{{radius}}"> | |
| 93 | - </div> | |
| 94 | - <div class="uk-inline btns"> | |
| 95 | - <button class="uk-button uk-button-primary submit">确定</button> | |
| 96 | - <button class="uk-button uk-button-default cancel">取消</button> | |
| 97 | - </div> | |
| 98 | - </div> | |
| 99 | - </form> | |
| 100 | - </div> | |
| 101 | - </div> | |
| 102 | - </script> | |
| 103 | - | |
| 104 | - <script id="geo_d_e_edit_name_panel-temp" type="text/html"> | |
| 105 | - <div class="ul_li_input"> | |
| 106 | - <form> | |
| 107 | - <input type="hidden" value="{{id}}" name="id"> | |
| 108 | - <input type="hidden" value="{{stationCode}}" name="stationCode"> | |
| 109 | - <input type="hidden" value="{{lineCode}}" name="lineCode"> | |
| 110 | - <input type="hidden" value="{{stationMark}}" name="stationMark"> | |
| 111 | - <input class="uk-input" autocomplete="off" value="{{stationName}}" name="stationName"> | |
| 112 | - <span uk-icon="icon: check" title="确定" uk-tooltip class="save_icon_btn"></span> | |
| 113 | - <span uk-icon="icon: close" title="取消" uk-tooltip class="cancel_icon_btn"></span> | |
| 114 | - </form> | |
| 115 | - </div> | |
| 116 | - </script> | |
| 117 | - | |
| 118 | - <script id="geo_d_e_add_station_panel-temp" type="text/html"> | |
| 119 | - <li class="station_li_transient"> | |
| 120 | - <div class="ct_route_badge_wrap"> | |
| 121 | - <span class="uk-badge ct_route_badge ">?</span> | |
| 122 | - </div> | |
| 123 | - <div class="ul_li_input"> | |
| 124 | - <form> | |
| 125 | - <input class="uk-input" value="" autocomplete="off" placeholder="输入站点名称" name="stationName"> | |
| 126 | - <span uk-icon="icon: location;ratio:.8" title="选择一个坐标位置" uk-tooltip class="search_point_icon_btn"></span> | |
| 127 | - <span uk-icon="icon: close" title="取消" uk-tooltip class="cancel_icon_btn"></span> | |
| 128 | - </form> | |
| 129 | - </div> | |
| 130 | - </li> | |
| 131 | - </script> | |
| 132 | - | |
| 133 | - <script id="geo_d_e_add_search_point_panel-temp" type="text/html"> | |
| 134 | - <div class="add_station_search_point_wrap uk-animation-slide-top-small"> | |
| 135 | - <div class="_title">为 {{name}} 选择一个坐标位置</div> | |
| 136 | - <div class="buffer_edit_body"> | |
| 137 | - <form> | |
| 138 | - <input type="hidden" value="{{name}}" name="stationName"> | |
| 139 | - <div class="ct_row"> | |
| 140 | - <div class="uk-inline"> | |
| 141 | - <span class="uk-form-icon uk-form-icon-flip" >经度</span> | |
| 142 | - <input class="uk-input" name="gLaty" type="text" readonly> | |
| 143 | - </div> | |
| 144 | - <div class="uk-inline"> | |
| 145 | - <span class="uk-form-icon uk-form-icon-flip" >纬度</span> | |
| 146 | - <input class="uk-input" name="gLonx" type="text" readonly> | |
| 147 | - </div> | |
| 148 | - </div> | |
| 149 | - <div class="ct_row "> | |
| 150 | - <div class="uk-inline" > | |
| 151 | - <div class="ct_row" style="color: #5e5d5d;font-size: 12px;"> | |
| 152 | - <span uk-icon="icon: question;ratio:.7;" style="vertical-align: top;margin-top: 2px;"></span> | |
| 153 | - 双击地图可拾取坐标点位 | |
| 154 | - </div> | |
| 155 | - </div> | |
| 156 | - <div class="uk-inline btns"> | |
| 157 | - <button class="uk-button uk-button-primary submit">确定</button> | |
| 158 | - <button class="uk-button uk-button-default cancel">取消</button> | |
| 159 | - </div> | |
| 160 | - </div> | |
| 161 | - </form> | |
| 162 | - </div> | |
| 163 | - </div> | |
| 164 | - </script> | |
| 1 | +<div> | |
| 2 | + <script id="geo_d_e_station_route-temp" type="text/html"> | |
| 3 | + <ul class="uk-list"> | |
| 4 | + {{each list as s i}} | |
| 5 | + <li class="s_r_item" data-code="{{s.stationCode}}" data-id="{{s.id}}"> | |
| 6 | + <div class="ct_route_badge_wrap"> | |
| 7 | + <span class="uk-badge ct_route_badge {{if s.stationMark=='B'}}start{{else if s.stationMark=='E'}}end{{/if}} {{if s.shapesType=='d'}}polygon{{/if}}"> | |
| 8 | + {{if s.stationMark=='B'}}起点站{{else if s.stationMark=='E'}}终点站{{else}}{{i + 1}}{{/if}}</span> | |
| 9 | + </div> | |
| 10 | + <a data-code="{{s.stationCode}}" data-updown="{{s.directions}}">{{s.stationName}}</a> | |
| 11 | + </li> | |
| 12 | + {{/each}} | |
| 13 | + </ul> | |
| 14 | + </script> | |
| 15 | + | |
| 16 | + <script id="geo_d_e_station_route_one-temp" type="text/html"> | |
| 17 | + <li class="s_r_item" data-code="{{stationCode}}" data-id="{{id}}"> | |
| 18 | + <div class="ct_route_badge_wrap"> | |
| 19 | + <span class="uk-badge ct_route_badge {{if stationMark=='B'}}start{{else if stationMark=='E'}}end{{/if}} {{if shapesType=='d'}}polygon{{/if}}"> | |
| 20 | + {{if stationMark=='B'}}起点站{{else if stationMark=='E'}}终点站{{else}}{{index}}{{/if}}</span> | |
| 21 | + </div> | |
| 22 | + <a class="uk-animation-shake" data-code="{{stationCode}}" data-updown="{{directions}}">{{stationName}}</a> | |
| 23 | + </li> | |
| 24 | + </script> | |
| 25 | + | |
| 26 | + | |
| 27 | + <script id="geo_d_e_station_info_win-temp" type="text/html"> | |
| 28 | + <ul class="uk-list station_info_win"> | |
| 29 | + <li class="s_name">{{stationName}}</li> | |
| 30 | + <li>站点编码: {{stationCode}}</li> | |
| 31 | + <li>站点类型: | |
| 32 | + {{if stationMark=='B'}} | |
| 33 | + 起点站 | |
| 34 | + {{else if stationMark=='E'}} | |
| 35 | + 终点站 | |
| 36 | + {{else if stationMark=='Z'}} | |
| 37 | + 中途站 | |
| 38 | + {{/if}} | |
| 39 | + </li> | |
| 40 | + <li> | |
| 41 | + 经度: {{gLaty}} | |
| 42 | + </li> | |
| 43 | + <li>纬度: {{gLonx}}</li> | |
| 44 | + <li> | |
| 45 | + 电子围栏类型: | |
| 46 | + {{if shapesType=='r'}} | |
| 47 | + 圆形 | |
| 48 | + {{else if shapesType=='d'}} | |
| 49 | + 多边形 | |
| 50 | + {{/if}} | |
| 51 | + </li> | |
| 52 | + <li> | |
| 53 | + {{if shapesType=='r'}} | |
| 54 | + 半径:{{radius}} | |
| 55 | + {{/if}} | |
| 56 | + </li> | |
| 57 | + <li>站序:{{index + 1}}</li> | |
| 58 | + <li>路由序号:{{stationRouteCode}}</li> | |
| 59 | + </ul> | |
| 60 | + </script> | |
| 61 | + | |
| 62 | + <script id="geo_d_e_map_edit_buffer_panel-temp" type="text/html"> | |
| 63 | + <div class="buffer_edit_panel uk-animation-slide-top-small"> | |
| 64 | + <div class="buffer_edit_body" > | |
| 65 | + <h6 class="name">{{stationName}}(缓冲区编辑)</h6> | |
| 66 | + <form> | |
| 67 | + <input type="hidden" value="{{id}}" name="id"> | |
| 68 | + <input type="hidden" value="{{directions}}" name="directions"> | |
| 69 | + <input type="hidden" value="{{stationCode}}" name="stationCode"> | |
| 70 | + <input type="hidden" value="{{stationName}}" name="stationName"> | |
| 71 | + <div class="ct_row"> | |
| 72 | + <div class="uk-inline"> | |
| 73 | + <span class="uk-form-icon uk-form-icon-flip" >经度</span> | |
| 74 | + <input class="uk-input" name="gLaty" type="text" value="{{bd_lat}}" readonly> | |
| 75 | + </div> | |
| 76 | + <div class="uk-inline"> | |
| 77 | + <span class="uk-form-icon uk-form-icon-flip" >纬度</span> | |
| 78 | + <input class="uk-input" name="gLonx" type="text" value="{{bd_lon}}" readonly> | |
| 79 | + </div> | |
| 80 | + </div> | |
| 81 | + | |
| 82 | + <div class="ct_row shapes_type {{shapesType=='d'?'st_d':''}}"> | |
| 83 | + <div class="uk-inline" > | |
| 84 | + <select name="shapesType" class="uk-select"> | |
| 85 | + <option value="r" {{shapesType=='r'?'selected':''}}>圆形</option> | |
| 86 | + <option value="d" {{shapesType=='d'?'selected':''}}>多边形</option> | |
| 87 | + </select> | |
| 88 | + <span class="draw_polygon_switch" data-type="{{shapesType=='d'?'3':'1'}}"><a>{{shapesType=='d'?'重新绘制':'暂停绘制'}}</a></span> | |
| 89 | + </div> | |
| 90 | + <div class="uk-inline"> | |
| 91 | + <span class="uk-form-icon uk-form-icon-flip" >半径</span> | |
| 92 | + <input class="uk-input" name="radius" type="text" value="{{radius}}"> | |
| 93 | + </div> | |
| 94 | + <div class="uk-inline btns"> | |
| 95 | + <button class="uk-button uk-button-primary submit">确定</button> | |
| 96 | + <button class="uk-button uk-button-default cancel">取消</button> | |
| 97 | + </div> | |
| 98 | + </div> | |
| 99 | + </form> | |
| 100 | + </div> | |
| 101 | + </div> | |
| 102 | + </script> | |
| 103 | + | |
| 104 | + <script id="geo_d_e_edit_name_panel-temp" type="text/html"> | |
| 105 | + <div class="ul_li_input"> | |
| 106 | + <form> | |
| 107 | + <input type="hidden" value="{{id}}" name="id"> | |
| 108 | + <input type="hidden" value="{{stationCode}}" name="stationCode"> | |
| 109 | + <input type="hidden" value="{{lineCode}}" name="lineCode"> | |
| 110 | + <input type="hidden" value="{{stationMark}}" name="stationMark"> | |
| 111 | + <input class="uk-input" autocomplete="off" value="{{stationName}}" name="stationName"> | |
| 112 | + <span uk-icon="icon: check" title="确定" uk-tooltip class="save_icon_btn"></span> | |
| 113 | + <span uk-icon="icon: close" title="取消" uk-tooltip class="cancel_icon_btn"></span> | |
| 114 | + </form> | |
| 115 | + </div> | |
| 116 | + </script> | |
| 117 | + | |
| 118 | + <script id="geo_d_e_add_station_panel-temp" type="text/html"> | |
| 119 | + <li class="station_li_transient"> | |
| 120 | + <div class="ct_route_badge_wrap"> | |
| 121 | + <span class="uk-badge ct_route_badge ">?</span> | |
| 122 | + </div> | |
| 123 | + <div class="ul_li_input"> | |
| 124 | + <form> | |
| 125 | + <input class="uk-input" value="" autocomplete="off" placeholder="输入站点名称" name="stationName"> | |
| 126 | + <span uk-icon="icon: location;ratio:.8" title="选择一个坐标位置" uk-tooltip class="search_point_icon_btn"></span> | |
| 127 | + <span uk-icon="icon: close" title="取消" uk-tooltip class="cancel_icon_btn"></span> | |
| 128 | + </form> | |
| 129 | + </div> | |
| 130 | + </li> | |
| 131 | + </script> | |
| 132 | + | |
| 133 | + <script id="geo_d_e_add_search_point_panel-temp" type="text/html"> | |
| 134 | + <div class="add_station_search_point_wrap uk-animation-slide-top-small"> | |
| 135 | + <div class="_title">为 {{name}} 选择一个坐标位置</div> | |
| 136 | + <div class="buffer_edit_body"> | |
| 137 | + <form> | |
| 138 | + <input type="hidden" value="{{name}}" name="stationName"> | |
| 139 | + <div class="ct_row"> | |
| 140 | + <div class="uk-inline"> | |
| 141 | + <span class="uk-form-icon uk-form-icon-flip" >经度</span> | |
| 142 | + <input class="uk-input" name="gLaty" type="text" readonly> | |
| 143 | + </div> | |
| 144 | + <div class="uk-inline"> | |
| 145 | + <span class="uk-form-icon uk-form-icon-flip" >纬度</span> | |
| 146 | + <input class="uk-input" name="gLonx" type="text" readonly> | |
| 147 | + </div> | |
| 148 | + </div> | |
| 149 | + <div class="ct_row "> | |
| 150 | + <div class="uk-inline" > | |
| 151 | + <div class="ct_row" style="color: #5e5d5d;font-size: 12px;"> | |
| 152 | + <span uk-icon="icon: question;ratio:.7;" style="vertical-align: top;margin-top: 2px;"></span> | |
| 153 | + 双击地图可拾取坐标点位 | |
| 154 | + </div> | |
| 155 | + </div> | |
| 156 | + <div class="uk-inline btns"> | |
| 157 | + <button class="uk-button uk-button-primary submit">确定</button> | |
| 158 | + <button class="uk-button uk-button-default cancel">取消</button> | |
| 159 | + </div> | |
| 160 | + </div> | |
| 161 | + </form> | |
| 162 | + </div> | |
| 163 | + </div> | |
| 164 | + </script> | |
| 165 | 165 | </div> |
| 166 | 166 | \ No newline at end of file | ... | ... |
src/main/resources/static/pages/base/geo_data_edit/fragments/versions.html
| 1 | -<div> | |
| 2 | - <script id="geo_d_e_version_add-temp" type="text/html"> | |
| 3 | - <div id="add_line_versions_modal" uk-modal esc-close="false" bg-close="false"> | |
| 4 | - <div class="uk-modal-dialog uk-modal-body"> | |
| 5 | - <button class="uk-modal-close-default" type="button" uk-close></button> | |
| 6 | - <h2 class="uk-modal-title">添加走向版本</h2> | |
| 7 | - | |
| 8 | - <form class="uk-form-horizontal uk-margin-large"> | |
| 9 | - <div class="uk-margin"> | |
| 10 | - <label class="uk-form-label" >变更走向原因</label> | |
| 11 | - <div class="uk-form-controls"> | |
| 12 | - <select class="uk-select" name="remark"> | |
| 13 | - <option>线路改道</option> | |
| 14 | - <option>其他</option> | |
| 15 | - </select> | |
| 16 | - </div> | |
| 17 | - </div> | |
| 18 | - | |
| 19 | - <div class="uk-margin"> | |
| 20 | - <label class="uk-form-label" >启用时间</label> | |
| 21 | - <div class="uk-form-controls"> | |
| 22 | - <input class="uk-input _flatpickr" type="text" name="startDate" placeholder="启用该版本走向的时间"> | |
| 23 | - </div> | |
| 24 | - </div> | |
| 25 | - | |
| 26 | - <div class="uk-margin"> | |
| 27 | - <label class="uk-form-label" >版本名称</label> | |
| 28 | - <div class="uk-form-controls"> | |
| 29 | - <input class="uk-input" type="text" name="name" placeholder="版本名称"> | |
| 30 | - </div> | |
| 31 | - </div> | |
| 32 | - | |
| 33 | - <div class="uk-margin"> | |
| 34 | - <div class="uk-form-label">继承走向</div> | |
| 35 | - <div class="uk-form-controls"> | |
| 36 | - <select class="uk-select" > | |
| 37 | - <option>不继承之前的走向</option> | |
| 38 | - | |
| 39 | - {{each array as obj i}} | |
| 40 | - <option data-id="{{obj.id}}" data-versions="{{obj.versions}}">{{obj.name}}</option> | |
| 41 | - {{/each}} | |
| 42 | - </select> | |
| 43 | - </div> | |
| 44 | - </div> | |
| 45 | - | |
| 46 | - </form> | |
| 47 | - | |
| 48 | - <p class="uk-text-right"> | |
| 49 | - <button class="uk-button uk-button-default uk-modal-close" type="button">取消</button> | |
| 50 | - <button class="uk-button uk-button-primary _submit" type="button">提交</button> | |
| 51 | - </p> | |
| 52 | - </div> | |
| 53 | - </div> | |
| 54 | - </script> | |
| 1 | +<div> | |
| 2 | + <script id="geo_d_e_version_add-temp" type="text/html"> | |
| 3 | + <div id="add_line_versions_modal" uk-modal esc-close="false" bg-close="false"> | |
| 4 | + <div class="uk-modal-dialog uk-modal-body"> | |
| 5 | + <button class="uk-modal-close-default" type="button" uk-close></button> | |
| 6 | + <h2 class="uk-modal-title">添加走向版本</h2> | |
| 7 | + | |
| 8 | + <form class="uk-form-horizontal uk-margin-large"> | |
| 9 | + <div class="uk-margin"> | |
| 10 | + <label class="uk-form-label" >变更走向原因</label> | |
| 11 | + <div class="uk-form-controls"> | |
| 12 | + <select class="uk-select" name="remark"> | |
| 13 | + <option>线路改道</option> | |
| 14 | + <option>其他</option> | |
| 15 | + </select> | |
| 16 | + </div> | |
| 17 | + </div> | |
| 18 | + | |
| 19 | + <div class="uk-margin"> | |
| 20 | + <label class="uk-form-label" >启用时间</label> | |
| 21 | + <div class="uk-form-controls"> | |
| 22 | + <input class="uk-input _flatpickr" type="text" name="startDate" placeholder="启用该版本走向的时间"> | |
| 23 | + </div> | |
| 24 | + </div> | |
| 25 | + | |
| 26 | + <div class="uk-margin"> | |
| 27 | + <label class="uk-form-label" >版本名称</label> | |
| 28 | + <div class="uk-form-controls"> | |
| 29 | + <input class="uk-input" type="text" name="name" placeholder="版本名称"> | |
| 30 | + </div> | |
| 31 | + </div> | |
| 32 | + | |
| 33 | + <div class="uk-margin"> | |
| 34 | + <div class="uk-form-label">继承走向</div> | |
| 35 | + <div class="uk-form-controls"> | |
| 36 | + <select class="uk-select" > | |
| 37 | + <option>不继承之前的走向</option> | |
| 38 | + | |
| 39 | + {{each array as obj i}} | |
| 40 | + <option data-id="{{obj.id}}" data-versions="{{obj.versions}}">{{obj.name}}</option> | |
| 41 | + {{/each}} | |
| 42 | + </select> | |
| 43 | + </div> | |
| 44 | + </div> | |
| 45 | + | |
| 46 | + </form> | |
| 47 | + | |
| 48 | + <p class="uk-text-right"> | |
| 49 | + <button class="uk-button uk-button-default uk-modal-close" type="button">取消</button> | |
| 50 | + <button class="uk-button uk-button-primary _submit" type="button">提交</button> | |
| 51 | + </p> | |
| 52 | + </div> | |
| 53 | + </div> | |
| 54 | + </script> | |
| 55 | 55 | </div> |
| 56 | 56 | \ No newline at end of file | ... | ... |
src/main/resources/static/pages/base/geo_data_edit/js/map.js
| 1 | -<!-- 地图操作 --> | |
| 2 | - | |
| 3 | -var gb_ct_map = function () { | |
| 4 | - | |
| 5 | - //初始化地图 | |
| 6 | - if (!window.BMap) { | |
| 7 | - alert('地图没有加载成功,请确认是否能正常连接外网!!'); | |
| 8 | - } | |
| 9 | - var gb_map_consts = { | |
| 10 | - mapContainer: '#map_wrap', | |
| 11 | - center_point: { | |
| 12 | - lng: 121.544336, | |
| 13 | - lat: 31.221315 | |
| 14 | - } | |
| 15 | - }; | |
| 16 | - | |
| 17 | - var styleOptions = { | |
| 18 | - strokeColor:"#E91E63", //边线颜色。 | |
| 19 | - fillColor:"#E91E63", //填充颜色。当参数为空时,圆形将没有填充效果。 | |
| 20 | - strokeWeight: 6, //边线的宽度,以像素为单位。 | |
| 21 | - strokeOpacity: 0.8, //边线透明度,取值范围0 - 1。 | |
| 22 | - fillOpacity: 0.6, //填充的透明度,取值范围0 - 1。 | |
| 23 | - strokeStyle: 'solid' //边线的样式,solid或dashed。 | |
| 24 | - } | |
| 25 | - | |
| 26 | - | |
| 27 | - /** | |
| 28 | - * 地图状态 | |
| 29 | - * 1: 站点缓冲区编辑 | |
| 30 | - */ | |
| 31 | - var map_status = 0; | |
| 32 | - var editCircle; | |
| 33 | - var editPolygon; | |
| 34 | - var dragMarker; | |
| 35 | - | |
| 36 | - map = new BMap.Map($(gb_map_consts.mapContainer)[0], {enableMapClick: false}); | |
| 37 | - //中心点和缩放级别 | |
| 38 | - map.centerAndZoom(new BMap.Point(gb_map_consts.center_point.lng, gb_map_consts.center_point.lat), 14); | |
| 39 | - map.enableScrollWheelZoom(); | |
| 40 | - | |
| 41 | - var stCtrl = new BMap.PanoramaControl(); //构造全景控件 | |
| 42 | - stCtrl.setOffset(new BMap.Size(20, 20)); | |
| 43 | - map.addControl(stCtrl);//添加全景控件 | |
| 44 | - | |
| 45 | - var roadPolylines = [], stationMarkers = []; | |
| 46 | - var _render = function (cb) { | |
| 47 | - //绘制路段 | |
| 48 | - _renderRoads(gb_road_route.getData()); | |
| 49 | - //绘制站点 | |
| 50 | - _renderStation(gb_station_route.getData()); | |
| 51 | - | |
| 52 | - changeUpDown(); | |
| 53 | - | |
| 54 | - //居中至上行中间站点 | |
| 55 | - var cm = stationMarkers[0][parseInt(stationMarkers[0].length / 2)]; | |
| 56 | - map.setCenter(cm.point); | |
| 57 | - | |
| 58 | - cb && cb(); | |
| 59 | - }; | |
| 60 | - | |
| 61 | - var updownColor = function (updown) { | |
| 62 | - return updown == 0 ? 'blue' : 'red'; | |
| 63 | - }; | |
| 64 | - var _renderRoads = function (data) { | |
| 65 | - _renderPolyline(data[0], updownColor(0));//上行路段 | |
| 66 | - _renderPolyline(data[1], updownColor(1));//下行路段 | |
| 67 | - }; | |
| 68 | - | |
| 69 | - var _renderStation = function (data) { | |
| 70 | - _renderStationMarket(data[0]);//上行站点 | |
| 71 | - _renderStationMarket(data[1]);//下行站点 | |
| 72 | - }; | |
| 73 | - | |
| 74 | - var _renderStationMarket = function (routes, color) { | |
| 75 | - var marker; | |
| 76 | - var array = []; | |
| 77 | - $.each(routes, function (i) { | |
| 78 | - this.index = i; | |
| 79 | - transCoord(this); | |
| 80 | - marker = createStationMark(this); | |
| 81 | - marker.stationCode = this.stationCode; | |
| 82 | - marker.ct_data = this; | |
| 83 | - marker.ct_source = '1'; | |
| 84 | - map.addOverlay(marker); | |
| 85 | - | |
| 86 | - array.push(marker); | |
| 87 | - }); | |
| 88 | - | |
| 89 | - stationMarkers[routes[0].directions] = array; | |
| 90 | - }; | |
| 91 | - | |
| 92 | - function transCoord(obj) { | |
| 93 | - var coord = TransGPS.wgsToBD(obj.gLaty, obj.gLonx); | |
| 94 | - obj.bd_lat = coord.lat; | |
| 95 | - obj.bd_lon = coord.lng; | |
| 96 | - } | |
| 97 | - | |
| 98 | - var _renderPolyline = function (routes, color) { | |
| 99 | - var pos, temps; | |
| 100 | - var polyline, _pLines = []; | |
| 101 | - var style = {strokeWeight: 7, strokeColor: color, strokeOpacity: .7}; | |
| 102 | - $.each(routes, function (i, item) { | |
| 103 | - | |
| 104 | - pos = []; | |
| 105 | - $.each(item.bdCoords, function () { | |
| 106 | - temps = this.split(' '); | |
| 107 | - pos.push(new BMap.Point(temps[0], temps[1])); | |
| 108 | - }); | |
| 109 | - polyline = new BMap.Polyline(pos, style); | |
| 110 | - polyline.ct_data = item; | |
| 111 | - polyline.ct_data.oldColor = color; | |
| 112 | - polyline.ct_source = '1'; | |
| 113 | - map.addOverlay(polyline); | |
| 114 | - | |
| 115 | - polyline.addEventListener('mouseover', function () { | |
| 116 | - //if (map_status != 1) | |
| 117 | - if(this!=editPolyline) | |
| 118 | - this.setStrokeColor('#20bd26'); | |
| 119 | - }); | |
| 120 | - polyline.addEventListener('mouseout', function () { | |
| 121 | - //if (map_status != 1 && this != road_win_show_p) | |
| 122 | - if(this!=editPolyline && this != road_win_show_p) | |
| 123 | - this.setStrokeColor(updownColor(this.ct_data.directions)); | |
| 124 | - }); | |
| 125 | - polyline.addEventListener('click', function (e) { | |
| 126 | - if (map_status != 1) | |
| 127 | - openRoadInfoWin(this, e.point); | |
| 128 | - }); | |
| 129 | - _pLines.push(polyline); | |
| 130 | - }); | |
| 131 | - | |
| 132 | - roadPolylines[routes[0].directions]= _pLines; | |
| 133 | - }; | |
| 134 | - | |
| 135 | - var road_win_show_p; | |
| 136 | - | |
| 137 | - function openRoadInfoWin(p, point) { | |
| 138 | - var data = p.ct_data; | |
| 139 | - var win = new BMap.InfoWindow(gb_road_route.getTemps()['geo_d_e_road_info_win-temp'](data)); | |
| 140 | - | |
| 141 | - //close event | |
| 142 | - win.addEventListener('close', function (e) { | |
| 143 | - if(map_status != 1) { | |
| 144 | - p.setStrokeColor(updownColor(p.ct_data.directions)); | |
| 145 | - gb_road_route.clearFocus(); | |
| 146 | - road_win_show_p = null; | |
| 147 | - } | |
| 148 | - }); | |
| 149 | - //open event | |
| 150 | - win.addEventListener('open', function (e) { | |
| 151 | - if(map_status !=1){ | |
| 152 | - gb_road_route.focus(data); | |
| 153 | - p.setStrokeColor('#20bd26'); | |
| 154 | - road_win_show_p = p; | |
| 155 | - } | |
| 156 | - }); | |
| 157 | - | |
| 158 | - map.openInfoWindow(win, point); | |
| 159 | - } | |
| 160 | - | |
| 161 | - function createStationMark(statio) { | |
| 162 | - var point = new BMap.Point(statio.bd_lon, statio.bd_lat); | |
| 163 | - var marker = new BMap.Marker(point); | |
| 164 | - | |
| 165 | - //根据站点名称 计算marker 宽度 | |
| 166 | - var w = statio.stationName.length * 12 + 38 | |
| 167 | - , iw = w - 2; | |
| 168 | - var icon = new BMap.Icon(createStationIcon(statio, w), new BMap.Size(iw, 24), {anchor: new BMap.Size(iw / 2, 25)}) | |
| 169 | - marker.setIcon(icon); | |
| 170 | - marker.setShadow(null); | |
| 171 | - | |
| 172 | - marker.addEventListener('click', function () { | |
| 173 | - if (map_status != 1) | |
| 174 | - openStationInfoWin(this); | |
| 175 | - }); | |
| 176 | - | |
| 177 | - //mouseover | |
| 178 | - marker.addEventListener('mouseover', function () { | |
| 179 | - setTop(this); | |
| 180 | - }); | |
| 181 | - return marker; | |
| 182 | - } | |
| 183 | - | |
| 184 | - var openStationInfoWin = function (m) { | |
| 185 | - //ct_data | |
| 186 | - var win = new BMap.InfoWindow(gb_station_route.getTemps()['geo_d_e_station_info_win-temp'](m.ct_data), {offset: new BMap.Size(0, -13)}); | |
| 187 | - //close event | |
| 188 | - win.addEventListener('close', function (e) { | |
| 189 | - gb_station_route.clearFocus(); | |
| 190 | - }); | |
| 191 | - //open event | |
| 192 | - win.addEventListener('open', function (e) { | |
| 193 | - gb_station_route.focus(m.ct_data); | |
| 194 | - }); | |
| 195 | - | |
| 196 | - map.openInfoWindow(win, m.point); | |
| 197 | - }; | |
| 198 | - | |
| 199 | - //绘制站点icon | |
| 200 | - function createStationIcon(station, w, bg) { | |
| 201 | - var canvas = $('<canvas></canvas>')[0]; | |
| 202 | - var ctx = canvas.getContext('2d'); | |
| 203 | - | |
| 204 | - if(!bg) | |
| 205 | - bg = station.directions == 0 ? '#5757fc' : '#fc4c4c'; | |
| 206 | - //矩形 | |
| 207 | - //ctx.roundRect(0, 0, w, 17, 1).stroke(); | |
| 208 | - ctx.lineWidth = "3"; | |
| 209 | - ctx.rect(0, 0, w - 2, 19); | |
| 210 | - ctx.fillStyle = '#fff'; | |
| 211 | - ctx.fill(); | |
| 212 | - ctx.strokeStyle = bg; | |
| 213 | - ctx.stroke(); | |
| 214 | - ctx.lineWidth = "1"; | |
| 215 | - | |
| 216 | - //文字 | |
| 217 | - ctx.font = "12px arial"; | |
| 218 | - ctx.fillStyle = '#000'; | |
| 219 | - ctx.fillText(station.stationName, 27, 14); | |
| 220 | - | |
| 221 | - //序号 | |
| 222 | - ctx.beginPath(); | |
| 223 | - ctx.rect(0, 0, 20, 19); | |
| 224 | - ctx.fillStyle = bg; | |
| 225 | - ctx.fill(); | |
| 226 | - | |
| 227 | - ctx.font = "12px arial"; | |
| 228 | - ctx.fillStyle = '#fff'; | |
| 229 | - | |
| 230 | - var i = station.index; | |
| 231 | - if(!isNaN(i)) | |
| 232 | - i ++; | |
| 233 | - var left = (i + '').length > 1 ? 3 : 7; | |
| 234 | - ctx.fillText(i, left, 14); | |
| 235 | - | |
| 236 | - //角 | |
| 237 | - var c = w / 2; | |
| 238 | - ctx.beginPath(); | |
| 239 | - ctx.moveTo(c - 7, 16); | |
| 240 | - ctx.lineTo(c, 24); | |
| 241 | - ctx.lineTo(c + 7, 16); | |
| 242 | - ctx.closePath(); | |
| 243 | - | |
| 244 | - ctx.fillStyle = bg; | |
| 245 | - ctx.fill(); | |
| 246 | - ctx.strokeStyle = '#fff'; | |
| 247 | - ctx.stroke(); | |
| 248 | - return canvas.toDataURL(); | |
| 249 | - } | |
| 250 | - | |
| 251 | - var changeUpDown = function () { | |
| 252 | - var upDown = getUpDown(); | |
| 253 | - $.each(roadPolylines[upDown == 0 ? 1 : 0], function () { | |
| 254 | - this.hide(); | |
| 255 | - }); | |
| 256 | - $.each(roadPolylines[upDown], function () { | |
| 257 | - this.show(); | |
| 258 | - }); | |
| 259 | - | |
| 260 | - | |
| 261 | - $.each(stationMarkers[upDown == 0 ? 1 : 0], function () { | |
| 262 | - this.hide(); | |
| 263 | - }); | |
| 264 | - $.each(stationMarkers[upDown], function () { | |
| 265 | - this.show(); | |
| 266 | - }); | |
| 267 | - }; | |
| 268 | - | |
| 269 | - /** | |
| 270 | - * 定位到站点 | |
| 271 | - * @param code | |
| 272 | - */ | |
| 273 | - var focusStation = function (code, updown) { | |
| 274 | - var marker = getStationMarker(code, updown); | |
| 275 | - if (marker) { | |
| 276 | - openStationInfoWin(marker); | |
| 277 | - } | |
| 278 | - }; | |
| 279 | - | |
| 280 | - var getStationMarker = function (code, updown) { | |
| 281 | - var array = stationMarkers[updown], | |
| 282 | - marker; | |
| 283 | - for (var i = 0, m; m = array[i++];) { | |
| 284 | - if (m.stationCode == code) { | |
| 285 | - marker = m; | |
| 286 | - break; | |
| 287 | - } | |
| 288 | - } | |
| 289 | - return marker; | |
| 290 | - }; | |
| 291 | - | |
| 292 | - /** | |
| 293 | - * 定位到路段 | |
| 294 | - * @param code | |
| 295 | - * @param updown | |
| 296 | - */ | |
| 297 | - var focusRoad = function (code, updown) { | |
| 298 | - var array = roadPolylines[updown], | |
| 299 | - polyline; | |
| 300 | - for (var i = 0, p; p = array[i++];) { | |
| 301 | - if (p.ct_data.sectionCode == code) { | |
| 302 | - polyline = p; | |
| 303 | - break; | |
| 304 | - } | |
| 305 | - } | |
| 306 | - | |
| 307 | - openRoadInfoWin(p, new BMap.Point(p.ct_data.cp.longitude, p.ct_data.cp.latitude)); | |
| 308 | - }; | |
| 309 | - | |
| 310 | - var exitEditBufferStatus = function (s) { | |
| 311 | - map_status = 0; | |
| 312 | - $('.main_left_panel_m_layer').hide(); | |
| 313 | - $('.buffer_edit_panel').remove(); | |
| 314 | - //enabledOtherElem(); | |
| 315 | - //gb_station_route.hideEditPanel(); | |
| 316 | - | |
| 317 | - clearOtherOverlay(); | |
| 318 | - reSetDragMarker();//关闭marker 拖拽 | |
| 319 | - | |
| 320 | - clearEditBuffer(); | |
| 321 | - //map.removeOverlay(editCircle); | |
| 322 | - | |
| 323 | - openStationInfoWin(getStationMarker(s.stationCode, s.directions)); | |
| 324 | - }; | |
| 325 | - | |
| 326 | - /** | |
| 327 | - * 编辑站点缓冲区 | |
| 328 | - * @param station | |
| 329 | - */ | |
| 330 | - var editStationBuffer = function (s) { | |
| 331 | - map_status = 1; | |
| 332 | - map.closeInfoWindow();//关闭infoWindow | |
| 333 | - gb_station_route.clearFocus(); | |
| 334 | - gb_station_route.focus(s); | |
| 335 | - disabledOtherElem(); | |
| 336 | - gb_station_route.showEditPanel(s); | |
| 337 | - | |
| 338 | - var marker = getStationMarker(s.stationCode, s.directions); | |
| 339 | - setDragMarker(marker);//站点 点位可拖拽 | |
| 340 | - | |
| 341 | - map.centerAndZoom(marker.point, 18); | |
| 342 | - var bElem = openBufferOverlay(marker); | |
| 343 | - | |
| 344 | - if (s.shapesType == 'r') { | |
| 345 | - //lineupdate | |
| 346 | - bElem.addEventListener('lineupdate', function (e) { | |
| 347 | - //console.log('lineupdatelineupdate 1111', e); | |
| 348 | - gb_station_route.reWriteEditPanel(e.target); | |
| 349 | - }); | |
| 350 | - } | |
| 351 | - else if (s.shapesType == 'd') { | |
| 352 | - //调整多边形 | |
| 353 | - | |
| 354 | - } | |
| 355 | - }; | |
| 356 | - | |
| 357 | - var setDragMarker = function (marker) { | |
| 358 | - marker.enableDragging(); | |
| 359 | - dragMarker = marker; | |
| 360 | - dragMarker._old_point = dragMarker.point; | |
| 361 | - //监听拖拽事件 dragging | |
| 362 | - dragMarker.addEventListener('dragging', dragMarkerDragEvent); | |
| 363 | - }; | |
| 364 | - | |
| 365 | - var dragMarkerDragEvent = function () { | |
| 366 | - if (editPolygon) { | |
| 367 | - if (!BMapLib.GeoUtils.isPointInPolygon(this.point, editPolygon)) | |
| 368 | - dragMarker.setPosition(dragMarker._old_point);//还原位置 | |
| 369 | - | |
| 370 | - gb_station_route.reWriteEditPanel(this, true); | |
| 371 | - } | |
| 372 | - else if (editCircle) { | |
| 373 | - editCircle.disableEditing(); | |
| 374 | - //缓冲区跟随点位运动 | |
| 375 | - editCircle.setCenter(this.point); | |
| 376 | - editCircle.enableEditing(); | |
| 377 | - } | |
| 378 | - }; | |
| 379 | - | |
| 380 | - var reSetDragMarker = function () { | |
| 381 | - if (dragMarker) { | |
| 382 | - dragMarker.setPosition(dragMarker._old_point); | |
| 383 | - dragMarker.removeEventListener('dragging', dragMarkerDragEvent); | |
| 384 | - dragMarker.disableDragging(); | |
| 385 | - dragMarker = null; | |
| 386 | - } | |
| 387 | - }; | |
| 388 | - | |
| 389 | - | |
| 390 | - /* var removeDragMarkerEvent = function () { | |
| 391 | - dragMarker.removeEventListener('dragging', dragMarkerDragEvent); | |
| 392 | - };*/ | |
| 393 | - | |
| 394 | - /** | |
| 395 | - * 禁用其他元素 | |
| 396 | - */ | |
| 397 | - var disabledOtherElem = function () { | |
| 398 | - $('.main_left_panel_m_layer').show(); | |
| 399 | - }; | |
| 400 | - | |
| 401 | - var openBufferOverlay = function (m) { | |
| 402 | - var elem; | |
| 403 | - var data = m.ct_data; | |
| 404 | - if (data.shapesType == 'r') { | |
| 405 | - elem = new BMap.Circle(m.point, data.radius, {strokeColor: '#E91E63'/*updownColor(data.directions)*/}); | |
| 406 | - editCircle = elem; | |
| 407 | - } | |
| 408 | - else if (data.shapesType == 'd') { | |
| 409 | - var array = data.bdCoords; | |
| 410 | - var pos = []; | |
| 411 | - var temp = []; | |
| 412 | - for (var i = 0, c; c = array[i++];) { | |
| 413 | - temp = c.split(' '); | |
| 414 | - pos.push(new BMap.Point(temp[0], temp[1])); | |
| 415 | - } | |
| 416 | - | |
| 417 | - elem = new BMap.Polygon(pos); | |
| 418 | - editPolygon = elem; | |
| 419 | - } | |
| 420 | - | |
| 421 | - map.addOverlay(elem); | |
| 422 | - elem.enableEditing(); | |
| 423 | - return elem; | |
| 424 | - }; | |
| 425 | - | |
| 426 | - /** | |
| 427 | - * 更新站点 | |
| 428 | - * @param s | |
| 429 | - */ | |
| 430 | - function updateStation(s) { | |
| 431 | - var m = getStationMarker(s.stationCode, s.directions); | |
| 432 | - //更新位置 | |
| 433 | - transCoord(s); | |
| 434 | - m.ct_data = s; | |
| 435 | - m.setPosition(new BMap.Point(s.bd_lon, s.bd_lat)); | |
| 436 | - m._old_point = this.point; | |
| 437 | - m.disableDragging(); | |
| 438 | - } | |
| 439 | - | |
| 440 | - var topOverlay; | |
| 441 | - | |
| 442 | - function setTop(overlay) { | |
| 443 | - if (topOverlay) | |
| 444 | - topOverlay.setTop(false); | |
| 445 | - overlay.setTop(true); | |
| 446 | - topOverlay = overlay; | |
| 447 | - } | |
| 448 | - | |
| 449 | - /** | |
| 450 | - * 切换缓冲区类型 | |
| 451 | - * @param v | |
| 452 | - */ | |
| 453 | - var _drawingManager; | |
| 454 | - var changeShapeType = function (v) { | |
| 455 | - clearEditBuffer(); | |
| 456 | - | |
| 457 | - if (v == 'd') { | |
| 458 | - _drawingManager = new BMapLib.DrawingManager(map, {polygonOptions: styleOptions}); | |
| 459 | - _drawingManager.open(); | |
| 460 | - _drawingManager.enableCalculate(); | |
| 461 | - _drawingManager.setDrawingMode('polygon'); | |
| 462 | - | |
| 463 | - //绘制结束事件 | |
| 464 | - _drawingManager.addEventListener('overlaycomplete', function (e) { | |
| 465 | - editPolygon = e.overlay; | |
| 466 | - gb_station_route.drawEnd(); | |
| 467 | - }); | |
| 468 | - } | |
| 469 | - else if (v == 'r') { | |
| 470 | - updateDragRadius(80); | |
| 471 | - | |
| 472 | - //圆形编辑事件 reWriteEditPanel | |
| 473 | - editCircle.addEventListener('lineupdate', function (e) { | |
| 474 | - gb_station_route.reWriteEditPanel(e.target); | |
| 475 | - }); | |
| 476 | - /*map.removeOverlay(editCircle); | |
| 477 | - map.removeOverlay(editPolygon); | |
| 478 | - | |
| 479 | - //以站点为中心,生成一个默认的圆 | |
| 480 | - var marker = getStationMarker(s.stationCode, s.directions); | |
| 481 | - editCircle = new BMap.Circle(marker.point,s.radius?s.radius:50, {strokeColor: '#E91E63'}); | |
| 482 | - editCircle.enableEditing(); | |
| 483 | - map.addOverlay(editCircle);*/ | |
| 484 | - } | |
| 485 | - }; | |
| 486 | - | |
| 487 | - var clearEditBuffer = function () { | |
| 488 | - map.removeOverlay(editCircle); | |
| 489 | - map.removeOverlay(editPolygon); | |
| 490 | - editCircle = null; | |
| 491 | - editPolygon = null; | |
| 492 | - }; | |
| 493 | - | |
| 494 | - var updateDragRadius = function (radius) { | |
| 495 | - if (!editCircle) { | |
| 496 | - clearOtherOverlay(); | |
| 497 | - var s = gb_station_route.getRealEditStation(); | |
| 498 | - | |
| 499 | - //以站点为中心,生成一个默认的圆 | |
| 500 | - var marker = getStationMarker(s.stationCode, s.directions); | |
| 501 | - var circle = new BMap.Circle(marker.point, s.radius ? s.radius : 80, {strokeColor: '#E91E63'}); | |
| 502 | - | |
| 503 | - setTimeout(function () { | |
| 504 | - circle.enableEditing(); | |
| 505 | - }, 200); | |
| 506 | - map.addOverlay(circle); | |
| 507 | - | |
| 508 | - editCircle = circle; | |
| 509 | - } | |
| 510 | - | |
| 511 | - editCircle.setRadius(radius); | |
| 512 | - }; | |
| 513 | - | |
| 514 | - var exitDrawStatus = function () { | |
| 515 | - if (_drawingManager) { | |
| 516 | - clearOtherOverlay(); | |
| 517 | - _drawingManager.close(); | |
| 518 | - } | |
| 519 | - }; | |
| 520 | - | |
| 521 | - var openDrawStatus = function () { | |
| 522 | - if (_drawingManager) { | |
| 523 | - clearOtherOverlay(); | |
| 524 | - _drawingManager.open(); | |
| 525 | - } | |
| 526 | - }; | |
| 527 | - | |
| 528 | - var clearOtherOverlay = function () { | |
| 529 | - var all = map.getOverlays(); | |
| 530 | - for (var i = 0, obj; obj = all[i++];) { | |
| 531 | - if (obj.ct_source && obj.ct_source == '1') | |
| 532 | - continue; | |
| 533 | - map.removeOverlay(obj); | |
| 534 | - //obj = null; | |
| 535 | - } | |
| 536 | - }; | |
| 537 | - | |
| 538 | - var closeInfoWin = function () { | |
| 539 | - map.closeInfoWindow(); | |
| 540 | - }; | |
| 541 | - | |
| 542 | - /** | |
| 543 | - * 绘制新增路段 | |
| 544 | - * @param name | |
| 545 | - */ | |
| 546 | - var showAddRoadPanel = function (name, cName) { | |
| 547 | - map_status = 1; | |
| 548 | - | |
| 549 | - var point; | |
| 550 | - var pId = gb_road_route.getAddPrevId(); | |
| 551 | - if(pId){ | |
| 552 | - //从上一个路段继续绘制 | |
| 553 | - var prev = gb_road_route.getRoadById(pId), | |
| 554 | - coords = prev.bdCoords, | |
| 555 | - lastCoord = coords[coords.length-1].split(' '); | |
| 556 | - | |
| 557 | - point = new BMap.Point(lastCoord[0], lastCoord[1]); | |
| 558 | - } | |
| 559 | - | |
| 560 | - map.centerAndZoom(point, 18); | |
| 561 | - | |
| 562 | - //开启鼠标绘制 | |
| 563 | - _drawingManager = new BMapLib.DrawingManager(map, { | |
| 564 | - polylineOptions: styleOptions | |
| 565 | - }); | |
| 566 | - | |
| 567 | - _drawingManager.open(); | |
| 568 | - //_drawingManager.enableCalculate(); | |
| 569 | - _drawingManager.setDrawingMode('polyline'); | |
| 570 | - | |
| 571 | - //绘制完成 | |
| 572 | - _drawingManager.addEventListener('polylinecomplete', function (e) { | |
| 573 | - console.log('eee', e, e.getPath()); | |
| 574 | - _drawingManager.close(); | |
| 575 | - | |
| 576 | - var polyline = new BMap.Polyline(e.getPath(), {strokeWeight: 7, strokeColor: '#E91E63', strokeOpacity: .7}); | |
| 577 | - | |
| 578 | - map.removeOverlay(e); | |
| 579 | - map.addOverlay(polyline); | |
| 580 | - polyline.enableEditing(); | |
| 581 | - | |
| 582 | - editPolyline = polyline; | |
| 583 | - }); | |
| 584 | - }; | |
| 585 | - | |
| 586 | - /** | |
| 587 | - * 为新增的站点选择一个位置 | |
| 588 | - */ | |
| 589 | - var showAddPointPanel = function (name) { | |
| 590 | - map_status = 1; | |
| 591 | - var spp = gb_station_route.getTemps()['geo_d_e_add_search_point_panel-temp']({name: name}); | |
| 592 | - $('body').append(spp); | |
| 593 | - | |
| 594 | - //按名称定位地图位置 | |
| 595 | - var local = new BMap.LocalSearch(map, { | |
| 596 | - renderOptions: {map: map}, | |
| 597 | - onMarkersSet: function (pos) { | |
| 598 | - var point; | |
| 599 | - if(!pos || pos.length==0){ | |
| 600 | - var pId = gb_station_route.getAddPrevId(); | |
| 601 | - if(pId){ | |
| 602 | - //百度没有定位到位置,默认靠近在上一个站 | |
| 603 | - var prev = gb_station_route.getStationById(pId); | |
| 604 | - point = new BMap.Point(prev.bd_lon - 0.0001, prev.bd_lat - 0.0001); | |
| 605 | - } | |
| 606 | - else{ | |
| 607 | - //没有上一个站点,默认在地图中间 | |
| 608 | - point = map.getCenter() | |
| 609 | - } | |
| 610 | - } | |
| 611 | - else{ | |
| 612 | - var old_m = pos[0].marker; | |
| 613 | - point = old_m.point; | |
| 614 | - //清除默认的点 | |
| 615 | - map.removeOverlay(old_m); | |
| 616 | - } | |
| 617 | - //进入新增点位 地图选点模式 | |
| 618 | - startSearchPoint(point, name); | |
| 619 | - } | |
| 620 | - }); | |
| 621 | - local.setPageCapacity(1); | |
| 622 | - local.search(name + "-公交车站"); | |
| 623 | - }; | |
| 624 | - | |
| 625 | - var a_s_p_maeker; | |
| 626 | - var startSearchPoint = function (point, name) { | |
| 627 | - var m = createYellowStation(point, name); | |
| 628 | - m.enableDragging(); | |
| 629 | - map.addOverlay(m); | |
| 630 | - map.setCenter(point); | |
| 631 | - | |
| 632 | - if(map.getZoom() < 16) | |
| 633 | - map.setZoom(16); | |
| 634 | - | |
| 635 | - _updateSearchPoint(m); | |
| 636 | - m.addEventListener('dragging', function () { | |
| 637 | - _updateSearchPoint(this); | |
| 638 | - }); | |
| 639 | - | |
| 640 | - //监听地图双击事件 | |
| 641 | - map.disableDoubleClickZoom(); | |
| 642 | - map.addEventListener('dblclick', pickupPoint); | |
| 643 | - | |
| 644 | - a_s_p_maeker = m; | |
| 645 | - }; | |
| 646 | - | |
| 647 | - /** | |
| 648 | - * 拾取坐标点位 | |
| 649 | - */ | |
| 650 | - var pickupPoint = function (e) { | |
| 651 | - var point = e.point; | |
| 652 | - | |
| 653 | - a_s_p_maeker.setPosition(point); | |
| 654 | - _updateSearchPoint(a_s_p_maeker); | |
| 655 | - }; | |
| 656 | - | |
| 657 | - var _updateSearchPoint = function (m) { | |
| 658 | - gb_station_route.reWriteSearchPointPanel(m.point); | |
| 659 | - }; | |
| 660 | - /** | |
| 661 | - * 创建一个黄色的,带添加的站点marker | |
| 662 | - * @param point | |
| 663 | - * @returns {BMap.Marker} | |
| 664 | - */ | |
| 665 | - function createYellowStation(point, name) { | |
| 666 | - var marker = new BMap.Marker(point); | |
| 667 | - | |
| 668 | - //根据站点名称 计算marker 宽度 | |
| 669 | - var w = name.length * 12 + 38 | |
| 670 | - , iw = w - 2; | |
| 671 | - var icon = new BMap.Icon(createStationIcon({ | |
| 672 | - stationName: name, index: '?' | |
| 673 | - }, w, '#ff9800'), new BMap.Size(iw, 24), {anchor: new BMap.Size(iw / 2, 25)}); | |
| 674 | - marker.setIcon(icon); | |
| 675 | - marker.setShadow(null); | |
| 676 | - | |
| 677 | - marker.addEventListener('click', function () { | |
| 678 | - if (map_status != 1) | |
| 679 | - openStationInfoWin(this); | |
| 680 | - }); | |
| 681 | - | |
| 682 | - //mouseover | |
| 683 | - marker.addEventListener('mouseover', function () { | |
| 684 | - setTop(this); | |
| 685 | - }); | |
| 686 | - return marker; | |
| 687 | - } | |
| 688 | - | |
| 689 | - /** | |
| 690 | - * 重绘一个走向的站点 | |
| 691 | - * @param upDown | |
| 692 | - */ | |
| 693 | - var reDrawStation = function (upDown) { | |
| 694 | - $.each(stationMarkers[upDown], function () { | |
| 695 | - map.removeOverlay(this); | |
| 696 | - }); | |
| 697 | - stationMarkers[upDown] = []; | |
| 698 | - | |
| 699 | - clearOtherOverlay(); | |
| 700 | - _renderStationMarket(gb_station_route.getData()[upDown]); | |
| 701 | - }; | |
| 702 | - | |
| 703 | - /** | |
| 704 | - * 重绘一个走向的路段 | |
| 705 | - * @param upDown | |
| 706 | - */ | |
| 707 | - var reDrawRoad = function (upDown) { | |
| 708 | - $.each(roadPolylines[upDown], function () { | |
| 709 | - map.removeOverlay(this); | |
| 710 | - }); | |
| 711 | - roadPolylines[upDown] = []; | |
| 712 | - | |
| 713 | - clearOtherOverlay(); | |
| 714 | - | |
| 715 | - _renderPolyline(gb_road_route.getData()[upDown], updownColor(upDown)); | |
| 716 | - }; | |
| 717 | - | |
| 718 | - | |
| 719 | - /** | |
| 720 | - * 进入路段编辑模式 | |
| 721 | - * @param road | |
| 722 | - */ | |
| 723 | - var editPolyline; | |
| 724 | - var start_edit_road= function (road) { | |
| 725 | - map.closeInfoWindow();//关闭infoWindow | |
| 726 | - map_status = 1; | |
| 727 | - gb_road_route.focus(road); | |
| 728 | - | |
| 729 | - //居中 | |
| 730 | - console.log('road.cproad.cp', road.cp); | |
| 731 | - map.centerAndZoom(new BMap.Point(road.cp.longitude, road.cp.latitude), 20); | |
| 732 | - | |
| 733 | - //路段变色 | |
| 734 | - var polyline = getRoadPolyline(road.sectionCode, road.directions); | |
| 735 | - editPolyline = polyline; | |
| 736 | - polyline.setStrokeColor('#E91E63'); | |
| 737 | - | |
| 738 | - //路段可编辑 | |
| 739 | - polyline.enableEditing(); | |
| 740 | - | |
| 741 | - //lineupdate,计算长度 mouseup | |
| 742 | - polyline.addEventListener('lineupdate', reCalcPathLength); | |
| 743 | - //gb_road_route.showPathLength(geolib.getPathLength(polyline.getPath())); | |
| 744 | - } | |
| 745 | - | |
| 746 | - /** | |
| 747 | - * 计算并显示路段长度 | |
| 748 | - * @param p | |
| 749 | - */ | |
| 750 | - var reCalcPathLength = function () { | |
| 751 | - var len = geolib.getPathLength(this.getPath()); | |
| 752 | - gb_road_route.showPathLength(len); | |
| 753 | - }; | |
| 754 | - | |
| 755 | - var getRoadPolyline = function (code, updown) { | |
| 756 | - var array = roadPolylines[updown], | |
| 757 | - polyline; | |
| 758 | - for (var i = 0, p; p = array[i++];) { | |
| 759 | - if (p.ct_data.sectionCode == code) { | |
| 760 | - polyline = p; | |
| 761 | - break; | |
| 762 | - } | |
| 763 | - } | |
| 764 | - return polyline; | |
| 765 | - }; | |
| 766 | - | |
| 767 | - var focusMarker; | |
| 768 | - var focusPoint = function (lat, lng) { | |
| 769 | - var p = new BMap.Point(lng,lat); | |
| 770 | - map.setCenter(p); | |
| 771 | - | |
| 772 | - clearfocus(); | |
| 773 | - | |
| 774 | - var marker = new BMap.Marker(p); | |
| 775 | - map.addOverlay(marker); | |
| 776 | - marker.setAnimation(BMAP_ANIMATION_BOUNCE); | |
| 777 | - focusMarker = marker; | |
| 778 | - var zoom = map.getZoom(); | |
| 779 | - if(zoom < 18) | |
| 780 | - map.setZoom(18); | |
| 781 | - }; | |
| 782 | - | |
| 783 | - var clearfocus = function () { | |
| 784 | - if(focusMarker){ | |
| 785 | - map.removeOverlay(focusMarker); | |
| 786 | - focusMarker = null; | |
| 787 | - } | |
| 788 | - }; | |
| 789 | - | |
| 790 | - /** | |
| 791 | - * 退出路段编辑模式 | |
| 792 | - */ | |
| 793 | - var exitEditRoadStatus = function (road, noFocus) { | |
| 794 | - map_status = 0; | |
| 795 | - $('.main_left_panel_m_layer').hide(); | |
| 796 | - $('.road_edit_panel').remove(); | |
| 797 | - | |
| 798 | - editPolyline.removeEventListener('lineupdate', reCalcPathLength); | |
| 799 | - editPolyline = null; | |
| 800 | - if(noFocus) | |
| 801 | - return; | |
| 802 | - | |
| 803 | - //polyline | |
| 804 | - var polyline = getRoadPolyline(road.sectionCode, road.directions); | |
| 805 | - polyline.disableEditing(); | |
| 806 | - polyline.ct_data = road; | |
| 807 | - polyline.setStrokeColor(updownColor(road.directions)); | |
| 808 | - | |
| 809 | - openRoadInfoWin(polyline, new BMap.Point(road.cp.longitude, road.cp.latitude)); | |
| 810 | - }; | |
| 811 | - | |
| 812 | - res_load_ep.emitLater('load_map'); | |
| 813 | - return { | |
| 814 | - _render: _render, | |
| 815 | - changeUpDown: changeUpDown, | |
| 816 | - focusStation: focusStation, | |
| 817 | - focusRoad: focusRoad, | |
| 818 | - editStationBuffer: editStationBuffer, | |
| 819 | - updateStation: updateStation, | |
| 820 | - exitEditBufferStatus: exitEditBufferStatus, | |
| 821 | - changeShapeType: changeShapeType, | |
| 822 | - exitDrawStatus: exitDrawStatus, | |
| 823 | - openDrawStatus: openDrawStatus, | |
| 824 | - getDrawPolygon: function () { | |
| 825 | - return editPolygon; | |
| 826 | - }, | |
| 827 | - getDrawPolyline: function () { | |
| 828 | - return editPolyline; | |
| 829 | - }, | |
| 830 | - updateDragRadius: updateDragRadius, | |
| 831 | - closeInfoWin: closeInfoWin, | |
| 832 | - showAddPointPanel: showAddPointPanel, | |
| 833 | - resetMapStatus: function () { | |
| 834 | - map_status = 0; | |
| 835 | - clearOtherOverlay(); | |
| 836 | - map.removeEventListener('dblclick', pickupPoint); | |
| 837 | - map.enableDoubleClickZoom(); | |
| 838 | - }, | |
| 839 | - reDrawStation: reDrawStation, | |
| 840 | - reDrawRoad: reDrawRoad, | |
| 841 | - edit_road: start_edit_road, | |
| 842 | - exitEditRoadStatus: exitEditRoadStatus, | |
| 843 | - showAddRoadPanel: showAddRoadPanel, | |
| 844 | - map: map, | |
| 845 | - focus: focusPoint, | |
| 846 | - clearfocus: clearfocus | |
| 847 | - }; | |
| 1 | +<!-- 地图操作 --> | |
| 2 | + | |
| 3 | +var gb_ct_map = function () { | |
| 4 | + | |
| 5 | + //初始化地图 | |
| 6 | + if (!window.BMap) { | |
| 7 | + alert('地图没有加载成功,请确认是否能正常连接外网!!'); | |
| 8 | + } | |
| 9 | + var gb_map_consts = { | |
| 10 | + mapContainer: '#map_wrap', | |
| 11 | + center_point: { | |
| 12 | + lng: 121.544336, | |
| 13 | + lat: 31.221315 | |
| 14 | + } | |
| 15 | + }; | |
| 16 | + | |
| 17 | + var styleOptions = { | |
| 18 | + strokeColor:"#E91E63", //边线颜色。 | |
| 19 | + fillColor:"#E91E63", //填充颜色。当参数为空时,圆形将没有填充效果。 | |
| 20 | + strokeWeight: 6, //边线的宽度,以像素为单位。 | |
| 21 | + strokeOpacity: 0.8, //边线透明度,取值范围0 - 1。 | |
| 22 | + fillOpacity: 0.6, //填充的透明度,取值范围0 - 1。 | |
| 23 | + strokeStyle: 'solid' //边线的样式,solid或dashed。 | |
| 24 | + } | |
| 25 | + | |
| 26 | + | |
| 27 | + /** | |
| 28 | + * 地图状态 | |
| 29 | + * 1: 站点缓冲区编辑 | |
| 30 | + */ | |
| 31 | + var map_status = 0; | |
| 32 | + var editCircle; | |
| 33 | + var editPolygon; | |
| 34 | + var dragMarker; | |
| 35 | + | |
| 36 | + map = new BMap.Map($(gb_map_consts.mapContainer)[0], {enableMapClick: false}); | |
| 37 | + //中心点和缩放级别 | |
| 38 | + map.centerAndZoom(new BMap.Point(gb_map_consts.center_point.lng, gb_map_consts.center_point.lat), 14); | |
| 39 | + map.enableScrollWheelZoom(); | |
| 40 | + | |
| 41 | + var stCtrl = new BMap.PanoramaControl(); //构造全景控件 | |
| 42 | + stCtrl.setOffset(new BMap.Size(20, 20)); | |
| 43 | + map.addControl(stCtrl);//添加全景控件 | |
| 44 | + | |
| 45 | + var roadPolylines = [], stationMarkers = []; | |
| 46 | + var _render = function (cb) { | |
| 47 | + //绘制路段 | |
| 48 | + _renderRoads(gb_road_route.getData()); | |
| 49 | + //绘制站点 | |
| 50 | + _renderStation(gb_station_route.getData()); | |
| 51 | + | |
| 52 | + changeUpDown(); | |
| 53 | + | |
| 54 | + //居中至上行中间站点 | |
| 55 | + var cm = stationMarkers[0][parseInt(stationMarkers[0].length / 2)]; | |
| 56 | + map.setCenter(cm.point); | |
| 57 | + | |
| 58 | + cb && cb(); | |
| 59 | + }; | |
| 60 | + | |
| 61 | + var updownColor = function (updown) { | |
| 62 | + return updown == 0 ? 'blue' : 'red'; | |
| 63 | + }; | |
| 64 | + var _renderRoads = function (data) { | |
| 65 | + _renderPolyline(data[0], updownColor(0));//上行路段 | |
| 66 | + _renderPolyline(data[1], updownColor(1));//下行路段 | |
| 67 | + }; | |
| 68 | + | |
| 69 | + var _renderStation = function (data) { | |
| 70 | + _renderStationMarket(data[0]);//上行站点 | |
| 71 | + _renderStationMarket(data[1]);//下行站点 | |
| 72 | + }; | |
| 73 | + | |
| 74 | + var _renderStationMarket = function (routes, color) { | |
| 75 | + var marker; | |
| 76 | + var array = []; | |
| 77 | + $.each(routes, function (i) { | |
| 78 | + this.index = i; | |
| 79 | + transCoord(this); | |
| 80 | + marker = createStationMark(this); | |
| 81 | + marker.stationCode = this.stationCode; | |
| 82 | + marker.ct_data = this; | |
| 83 | + marker.ct_source = '1'; | |
| 84 | + map.addOverlay(marker); | |
| 85 | + | |
| 86 | + array.push(marker); | |
| 87 | + }); | |
| 88 | + | |
| 89 | + stationMarkers[routes[0].directions] = array; | |
| 90 | + }; | |
| 91 | + | |
| 92 | + function transCoord(obj) { | |
| 93 | + var coord = TransGPS.wgsToBD(obj.gLaty, obj.gLonx); | |
| 94 | + obj.bd_lat = coord.lat; | |
| 95 | + obj.bd_lon = coord.lng; | |
| 96 | + } | |
| 97 | + | |
| 98 | + var _renderPolyline = function (routes, color) { | |
| 99 | + var pos, temps; | |
| 100 | + var polyline, _pLines = []; | |
| 101 | + var style = {strokeWeight: 7, strokeColor: color, strokeOpacity: .7}; | |
| 102 | + $.each(routes, function (i, item) { | |
| 103 | + | |
| 104 | + pos = []; | |
| 105 | + $.each(item.bdCoords, function () { | |
| 106 | + temps = this.split(' '); | |
| 107 | + pos.push(new BMap.Point(temps[0], temps[1])); | |
| 108 | + }); | |
| 109 | + polyline = new BMap.Polyline(pos, style); | |
| 110 | + polyline.ct_data = item; | |
| 111 | + polyline.ct_data.oldColor = color; | |
| 112 | + polyline.ct_source = '1'; | |
| 113 | + map.addOverlay(polyline); | |
| 114 | + | |
| 115 | + polyline.addEventListener('mouseover', function () { | |
| 116 | + //if (map_status != 1) | |
| 117 | + if(this!=editPolyline) | |
| 118 | + this.setStrokeColor('#20bd26'); | |
| 119 | + }); | |
| 120 | + polyline.addEventListener('mouseout', function () { | |
| 121 | + //if (map_status != 1 && this != road_win_show_p) | |
| 122 | + if(this!=editPolyline && this != road_win_show_p) | |
| 123 | + this.setStrokeColor(updownColor(this.ct_data.directions)); | |
| 124 | + }); | |
| 125 | + polyline.addEventListener('click', function (e) { | |
| 126 | + if (map_status != 1) | |
| 127 | + openRoadInfoWin(this, e.point); | |
| 128 | + }); | |
| 129 | + _pLines.push(polyline); | |
| 130 | + }); | |
| 131 | + | |
| 132 | + roadPolylines[routes[0].directions]= _pLines; | |
| 133 | + }; | |
| 134 | + | |
| 135 | + var road_win_show_p; | |
| 136 | + | |
| 137 | + function openRoadInfoWin(p, point) { | |
| 138 | + var data = p.ct_data; | |
| 139 | + var win = new BMap.InfoWindow(gb_road_route.getTemps()['geo_d_e_road_info_win-temp'](data)); | |
| 140 | + | |
| 141 | + //close event | |
| 142 | + win.addEventListener('close', function (e) { | |
| 143 | + if(map_status != 1) { | |
| 144 | + p.setStrokeColor(updownColor(p.ct_data.directions)); | |
| 145 | + gb_road_route.clearFocus(); | |
| 146 | + road_win_show_p = null; | |
| 147 | + } | |
| 148 | + }); | |
| 149 | + //open event | |
| 150 | + win.addEventListener('open', function (e) { | |
| 151 | + if(map_status !=1){ | |
| 152 | + gb_road_route.focus(data); | |
| 153 | + p.setStrokeColor('#20bd26'); | |
| 154 | + road_win_show_p = p; | |
| 155 | + } | |
| 156 | + }); | |
| 157 | + | |
| 158 | + map.openInfoWindow(win, point); | |
| 159 | + } | |
| 160 | + | |
| 161 | + function createStationMark(statio) { | |
| 162 | + var point = new BMap.Point(statio.bd_lon, statio.bd_lat); | |
| 163 | + var marker = new BMap.Marker(point); | |
| 164 | + | |
| 165 | + //根据站点名称 计算marker 宽度 | |
| 166 | + var w = statio.stationName.length * 12 + 38 | |
| 167 | + , iw = w - 2; | |
| 168 | + var icon = new BMap.Icon(createStationIcon(statio, w), new BMap.Size(iw, 24), {anchor: new BMap.Size(iw / 2, 25)}) | |
| 169 | + marker.setIcon(icon); | |
| 170 | + marker.setShadow(null); | |
| 171 | + | |
| 172 | + marker.addEventListener('click', function () { | |
| 173 | + if (map_status != 1) | |
| 174 | + openStationInfoWin(this); | |
| 175 | + }); | |
| 176 | + | |
| 177 | + //mouseover | |
| 178 | + marker.addEventListener('mouseover', function () { | |
| 179 | + setTop(this); | |
| 180 | + }); | |
| 181 | + return marker; | |
| 182 | + } | |
| 183 | + | |
| 184 | + var openStationInfoWin = function (m) { | |
| 185 | + //ct_data | |
| 186 | + var win = new BMap.InfoWindow(gb_station_route.getTemps()['geo_d_e_station_info_win-temp'](m.ct_data), {offset: new BMap.Size(0, -13)}); | |
| 187 | + //close event | |
| 188 | + win.addEventListener('close', function (e) { | |
| 189 | + gb_station_route.clearFocus(); | |
| 190 | + }); | |
| 191 | + //open event | |
| 192 | + win.addEventListener('open', function (e) { | |
| 193 | + gb_station_route.focus(m.ct_data); | |
| 194 | + }); | |
| 195 | + | |
| 196 | + map.openInfoWindow(win, m.point); | |
| 197 | + }; | |
| 198 | + | |
| 199 | + //绘制站点icon | |
| 200 | + function createStationIcon(station, w, bg) { | |
| 201 | + var canvas = $('<canvas></canvas>')[0]; | |
| 202 | + var ctx = canvas.getContext('2d'); | |
| 203 | + | |
| 204 | + if(!bg) | |
| 205 | + bg = station.directions == 0 ? '#5757fc' : '#fc4c4c'; | |
| 206 | + //矩形 | |
| 207 | + //ctx.roundRect(0, 0, w, 17, 1).stroke(); | |
| 208 | + ctx.lineWidth = "3"; | |
| 209 | + ctx.rect(0, 0, w - 2, 19); | |
| 210 | + ctx.fillStyle = '#fff'; | |
| 211 | + ctx.fill(); | |
| 212 | + ctx.strokeStyle = bg; | |
| 213 | + ctx.stroke(); | |
| 214 | + ctx.lineWidth = "1"; | |
| 215 | + | |
| 216 | + //文字 | |
| 217 | + ctx.font = "12px arial"; | |
| 218 | + ctx.fillStyle = '#000'; | |
| 219 | + ctx.fillText(station.stationName, 27, 14); | |
| 220 | + | |
| 221 | + //序号 | |
| 222 | + ctx.beginPath(); | |
| 223 | + ctx.rect(0, 0, 20, 19); | |
| 224 | + ctx.fillStyle = bg; | |
| 225 | + ctx.fill(); | |
| 226 | + | |
| 227 | + ctx.font = "12px arial"; | |
| 228 | + ctx.fillStyle = '#fff'; | |
| 229 | + | |
| 230 | + var i = station.index; | |
| 231 | + if(!isNaN(i)) | |
| 232 | + i ++; | |
| 233 | + var left = (i + '').length > 1 ? 3 : 7; | |
| 234 | + ctx.fillText(i, left, 14); | |
| 235 | + | |
| 236 | + //角 | |
| 237 | + var c = w / 2; | |
| 238 | + ctx.beginPath(); | |
| 239 | + ctx.moveTo(c - 7, 16); | |
| 240 | + ctx.lineTo(c, 24); | |
| 241 | + ctx.lineTo(c + 7, 16); | |
| 242 | + ctx.closePath(); | |
| 243 | + | |
| 244 | + ctx.fillStyle = bg; | |
| 245 | + ctx.fill(); | |
| 246 | + ctx.strokeStyle = '#fff'; | |
| 247 | + ctx.stroke(); | |
| 248 | + return canvas.toDataURL(); | |
| 249 | + } | |
| 250 | + | |
| 251 | + var changeUpDown = function () { | |
| 252 | + var upDown = getUpDown(); | |
| 253 | + $.each(roadPolylines[upDown == 0 ? 1 : 0], function () { | |
| 254 | + this.hide(); | |
| 255 | + }); | |
| 256 | + $.each(roadPolylines[upDown], function () { | |
| 257 | + this.show(); | |
| 258 | + }); | |
| 259 | + | |
| 260 | + | |
| 261 | + $.each(stationMarkers[upDown == 0 ? 1 : 0], function () { | |
| 262 | + this.hide(); | |
| 263 | + }); | |
| 264 | + $.each(stationMarkers[upDown], function () { | |
| 265 | + this.show(); | |
| 266 | + }); | |
| 267 | + }; | |
| 268 | + | |
| 269 | + /** | |
| 270 | + * 定位到站点 | |
| 271 | + * @param code | |
| 272 | + */ | |
| 273 | + var focusStation = function (code, updown) { | |
| 274 | + var marker = getStationMarker(code, updown); | |
| 275 | + if (marker) { | |
| 276 | + openStationInfoWin(marker); | |
| 277 | + } | |
| 278 | + }; | |
| 279 | + | |
| 280 | + var getStationMarker = function (code, updown) { | |
| 281 | + var array = stationMarkers[updown], | |
| 282 | + marker; | |
| 283 | + for (var i = 0, m; m = array[i++];) { | |
| 284 | + if (m.stationCode == code) { | |
| 285 | + marker = m; | |
| 286 | + break; | |
| 287 | + } | |
| 288 | + } | |
| 289 | + return marker; | |
| 290 | + }; | |
| 291 | + | |
| 292 | + /** | |
| 293 | + * 定位到路段 | |
| 294 | + * @param code | |
| 295 | + * @param updown | |
| 296 | + */ | |
| 297 | + var focusRoad = function (code, updown) { | |
| 298 | + var array = roadPolylines[updown], | |
| 299 | + polyline; | |
| 300 | + for (var i = 0, p; p = array[i++];) { | |
| 301 | + if (p.ct_data.sectionCode == code) { | |
| 302 | + polyline = p; | |
| 303 | + break; | |
| 304 | + } | |
| 305 | + } | |
| 306 | + | |
| 307 | + openRoadInfoWin(p, new BMap.Point(p.ct_data.cp.longitude, p.ct_data.cp.latitude)); | |
| 308 | + }; | |
| 309 | + | |
| 310 | + var exitEditBufferStatus = function (s) { | |
| 311 | + map_status = 0; | |
| 312 | + $('.main_left_panel_m_layer').hide(); | |
| 313 | + $('.buffer_edit_panel').remove(); | |
| 314 | + //enabledOtherElem(); | |
| 315 | + //gb_station_route.hideEditPanel(); | |
| 316 | + | |
| 317 | + clearOtherOverlay(); | |
| 318 | + reSetDragMarker();//关闭marker 拖拽 | |
| 319 | + | |
| 320 | + clearEditBuffer(); | |
| 321 | + //map.removeOverlay(editCircle); | |
| 322 | + | |
| 323 | + openStationInfoWin(getStationMarker(s.stationCode, s.directions)); | |
| 324 | + }; | |
| 325 | + | |
| 326 | + /** | |
| 327 | + * 编辑站点缓冲区 | |
| 328 | + * @param station | |
| 329 | + */ | |
| 330 | + var editStationBuffer = function (s) { | |
| 331 | + map_status = 1; | |
| 332 | + map.closeInfoWindow();//关闭infoWindow | |
| 333 | + gb_station_route.clearFocus(); | |
| 334 | + gb_station_route.focus(s); | |
| 335 | + disabledOtherElem(); | |
| 336 | + gb_station_route.showEditPanel(s); | |
| 337 | + | |
| 338 | + var marker = getStationMarker(s.stationCode, s.directions); | |
| 339 | + setDragMarker(marker);//站点 点位可拖拽 | |
| 340 | + | |
| 341 | + map.centerAndZoom(marker.point, 18); | |
| 342 | + var bElem = openBufferOverlay(marker); | |
| 343 | + | |
| 344 | + if (s.shapesType == 'r') { | |
| 345 | + //lineupdate | |
| 346 | + bElem.addEventListener('lineupdate', function (e) { | |
| 347 | + //console.log('lineupdatelineupdate 1111', e); | |
| 348 | + gb_station_route.reWriteEditPanel(e.target); | |
| 349 | + }); | |
| 350 | + } | |
| 351 | + else if (s.shapesType == 'd') { | |
| 352 | + //调整多边形 | |
| 353 | + | |
| 354 | + } | |
| 355 | + }; | |
| 356 | + | |
| 357 | + var setDragMarker = function (marker) { | |
| 358 | + marker.enableDragging(); | |
| 359 | + dragMarker = marker; | |
| 360 | + dragMarker._old_point = dragMarker.point; | |
| 361 | + //监听拖拽事件 dragging | |
| 362 | + dragMarker.addEventListener('dragging', dragMarkerDragEvent); | |
| 363 | + }; | |
| 364 | + | |
| 365 | + var dragMarkerDragEvent = function () { | |
| 366 | + if (editPolygon) { | |
| 367 | + if (!BMapLib.GeoUtils.isPointInPolygon(this.point, editPolygon)) | |
| 368 | + dragMarker.setPosition(dragMarker._old_point);//还原位置 | |
| 369 | + | |
| 370 | + gb_station_route.reWriteEditPanel(this, true); | |
| 371 | + } | |
| 372 | + else if (editCircle) { | |
| 373 | + editCircle.disableEditing(); | |
| 374 | + //缓冲区跟随点位运动 | |
| 375 | + editCircle.setCenter(this.point); | |
| 376 | + editCircle.enableEditing(); | |
| 377 | + } | |
| 378 | + }; | |
| 379 | + | |
| 380 | + var reSetDragMarker = function () { | |
| 381 | + if (dragMarker) { | |
| 382 | + dragMarker.setPosition(dragMarker._old_point); | |
| 383 | + dragMarker.removeEventListener('dragging', dragMarkerDragEvent); | |
| 384 | + dragMarker.disableDragging(); | |
| 385 | + dragMarker = null; | |
| 386 | + } | |
| 387 | + }; | |
| 388 | + | |
| 389 | + | |
| 390 | + /* var removeDragMarkerEvent = function () { | |
| 391 | + dragMarker.removeEventListener('dragging', dragMarkerDragEvent); | |
| 392 | + };*/ | |
| 393 | + | |
| 394 | + /** | |
| 395 | + * 禁用其他元素 | |
| 396 | + */ | |
| 397 | + var disabledOtherElem = function () { | |
| 398 | + $('.main_left_panel_m_layer').show(); | |
| 399 | + }; | |
| 400 | + | |
| 401 | + var openBufferOverlay = function (m) { | |
| 402 | + var elem; | |
| 403 | + var data = m.ct_data; | |
| 404 | + if (data.shapesType == 'r') { | |
| 405 | + elem = new BMap.Circle(m.point, data.radius, {strokeColor: '#E91E63'/*updownColor(data.directions)*/}); | |
| 406 | + editCircle = elem; | |
| 407 | + } | |
| 408 | + else if (data.shapesType == 'd') { | |
| 409 | + var array = data.bdCoords; | |
| 410 | + var pos = []; | |
| 411 | + var temp = []; | |
| 412 | + for (var i = 0, c; c = array[i++];) { | |
| 413 | + temp = c.split(' '); | |
| 414 | + pos.push(new BMap.Point(temp[0], temp[1])); | |
| 415 | + } | |
| 416 | + | |
| 417 | + elem = new BMap.Polygon(pos); | |
| 418 | + editPolygon = elem; | |
| 419 | + } | |
| 420 | + | |
| 421 | + map.addOverlay(elem); | |
| 422 | + elem.enableEditing(); | |
| 423 | + return elem; | |
| 424 | + }; | |
| 425 | + | |
| 426 | + /** | |
| 427 | + * 更新站点 | |
| 428 | + * @param s | |
| 429 | + */ | |
| 430 | + function updateStation(s) { | |
| 431 | + var m = getStationMarker(s.stationCode, s.directions); | |
| 432 | + //更新位置 | |
| 433 | + transCoord(s); | |
| 434 | + m.ct_data = s; | |
| 435 | + m.setPosition(new BMap.Point(s.bd_lon, s.bd_lat)); | |
| 436 | + m._old_point = this.point; | |
| 437 | + m.disableDragging(); | |
| 438 | + } | |
| 439 | + | |
| 440 | + var topOverlay; | |
| 441 | + | |
| 442 | + function setTop(overlay) { | |
| 443 | + if (topOverlay) | |
| 444 | + topOverlay.setTop(false); | |
| 445 | + overlay.setTop(true); | |
| 446 | + topOverlay = overlay; | |
| 447 | + } | |
| 448 | + | |
| 449 | + /** | |
| 450 | + * 切换缓冲区类型 | |
| 451 | + * @param v | |
| 452 | + */ | |
| 453 | + var _drawingManager; | |
| 454 | + var changeShapeType = function (v) { | |
| 455 | + clearEditBuffer(); | |
| 456 | + | |
| 457 | + if (v == 'd') { | |
| 458 | + _drawingManager = new BMapLib.DrawingManager(map, {polygonOptions: styleOptions}); | |
| 459 | + _drawingManager.open(); | |
| 460 | + _drawingManager.enableCalculate(); | |
| 461 | + _drawingManager.setDrawingMode('polygon'); | |
| 462 | + | |
| 463 | + //绘制结束事件 | |
| 464 | + _drawingManager.addEventListener('overlaycomplete', function (e) { | |
| 465 | + editPolygon = e.overlay; | |
| 466 | + gb_station_route.drawEnd(); | |
| 467 | + }); | |
| 468 | + } | |
| 469 | + else if (v == 'r') { | |
| 470 | + updateDragRadius(80); | |
| 471 | + | |
| 472 | + //圆形编辑事件 reWriteEditPanel | |
| 473 | + editCircle.addEventListener('lineupdate', function (e) { | |
| 474 | + gb_station_route.reWriteEditPanel(e.target); | |
| 475 | + }); | |
| 476 | + /*map.removeOverlay(editCircle); | |
| 477 | + map.removeOverlay(editPolygon); | |
| 478 | + | |
| 479 | + //以站点为中心,生成一个默认的圆 | |
| 480 | + var marker = getStationMarker(s.stationCode, s.directions); | |
| 481 | + editCircle = new BMap.Circle(marker.point,s.radius?s.radius:50, {strokeColor: '#E91E63'}); | |
| 482 | + editCircle.enableEditing(); | |
| 483 | + map.addOverlay(editCircle);*/ | |
| 484 | + } | |
| 485 | + }; | |
| 486 | + | |
| 487 | + var clearEditBuffer = function () { | |
| 488 | + map.removeOverlay(editCircle); | |
| 489 | + map.removeOverlay(editPolygon); | |
| 490 | + editCircle = null; | |
| 491 | + editPolygon = null; | |
| 492 | + }; | |
| 493 | + | |
| 494 | + var updateDragRadius = function (radius) { | |
| 495 | + if (!editCircle) { | |
| 496 | + clearOtherOverlay(); | |
| 497 | + var s = gb_station_route.getRealEditStation(); | |
| 498 | + | |
| 499 | + //以站点为中心,生成一个默认的圆 | |
| 500 | + var marker = getStationMarker(s.stationCode, s.directions); | |
| 501 | + var circle = new BMap.Circle(marker.point, s.radius ? s.radius : 80, {strokeColor: '#E91E63'}); | |
| 502 | + | |
| 503 | + setTimeout(function () { | |
| 504 | + circle.enableEditing(); | |
| 505 | + }, 200); | |
| 506 | + map.addOverlay(circle); | |
| 507 | + | |
| 508 | + editCircle = circle; | |
| 509 | + } | |
| 510 | + | |
| 511 | + editCircle.setRadius(radius); | |
| 512 | + }; | |
| 513 | + | |
| 514 | + var exitDrawStatus = function () { | |
| 515 | + if (_drawingManager) { | |
| 516 | + clearOtherOverlay(); | |
| 517 | + _drawingManager.close(); | |
| 518 | + } | |
| 519 | + }; | |
| 520 | + | |
| 521 | + var openDrawStatus = function () { | |
| 522 | + if (_drawingManager) { | |
| 523 | + clearOtherOverlay(); | |
| 524 | + _drawingManager.open(); | |
| 525 | + } | |
| 526 | + }; | |
| 527 | + | |
| 528 | + var clearOtherOverlay = function () { | |
| 529 | + var all = map.getOverlays(); | |
| 530 | + for (var i = 0, obj; obj = all[i++];) { | |
| 531 | + if (obj.ct_source && obj.ct_source == '1') | |
| 532 | + continue; | |
| 533 | + map.removeOverlay(obj); | |
| 534 | + //obj = null; | |
| 535 | + } | |
| 536 | + }; | |
| 537 | + | |
| 538 | + var closeInfoWin = function () { | |
| 539 | + map.closeInfoWindow(); | |
| 540 | + }; | |
| 541 | + | |
| 542 | + /** | |
| 543 | + * 绘制新增路段 | |
| 544 | + * @param name | |
| 545 | + */ | |
| 546 | + var showAddRoadPanel = function (name, cName) { | |
| 547 | + map_status = 1; | |
| 548 | + | |
| 549 | + var point; | |
| 550 | + var pId = gb_road_route.getAddPrevId(); | |
| 551 | + if(pId){ | |
| 552 | + //从上一个路段继续绘制 | |
| 553 | + var prev = gb_road_route.getRoadById(pId), | |
| 554 | + coords = prev.bdCoords, | |
| 555 | + lastCoord = coords[coords.length-1].split(' '); | |
| 556 | + | |
| 557 | + point = new BMap.Point(lastCoord[0], lastCoord[1]); | |
| 558 | + } | |
| 559 | + | |
| 560 | + map.centerAndZoom(point, 18); | |
| 561 | + | |
| 562 | + //开启鼠标绘制 | |
| 563 | + _drawingManager = new BMapLib.DrawingManager(map, { | |
| 564 | + polylineOptions: styleOptions | |
| 565 | + }); | |
| 566 | + | |
| 567 | + _drawingManager.open(); | |
| 568 | + //_drawingManager.enableCalculate(); | |
| 569 | + _drawingManager.setDrawingMode('polyline'); | |
| 570 | + | |
| 571 | + //绘制完成 | |
| 572 | + _drawingManager.addEventListener('polylinecomplete', function (e) { | |
| 573 | + console.log('eee', e, e.getPath()); | |
| 574 | + _drawingManager.close(); | |
| 575 | + | |
| 576 | + var polyline = new BMap.Polyline(e.getPath(), {strokeWeight: 7, strokeColor: '#E91E63', strokeOpacity: .7}); | |
| 577 | + | |
| 578 | + map.removeOverlay(e); | |
| 579 | + map.addOverlay(polyline); | |
| 580 | + polyline.enableEditing(); | |
| 581 | + | |
| 582 | + editPolyline = polyline; | |
| 583 | + }); | |
| 584 | + }; | |
| 585 | + | |
| 586 | + /** | |
| 587 | + * 为新增的站点选择一个位置 | |
| 588 | + */ | |
| 589 | + var showAddPointPanel = function (name) { | |
| 590 | + map_status = 1; | |
| 591 | + var spp = gb_station_route.getTemps()['geo_d_e_add_search_point_panel-temp']({name: name}); | |
| 592 | + $('body').append(spp); | |
| 593 | + | |
| 594 | + //按名称定位地图位置 | |
| 595 | + var local = new BMap.LocalSearch(map, { | |
| 596 | + renderOptions: {map: map}, | |
| 597 | + onMarkersSet: function (pos) { | |
| 598 | + var point; | |
| 599 | + if(!pos || pos.length==0){ | |
| 600 | + var pId = gb_station_route.getAddPrevId(); | |
| 601 | + if(pId){ | |
| 602 | + //百度没有定位到位置,默认靠近在上一个站 | |
| 603 | + var prev = gb_station_route.getStationById(pId); | |
| 604 | + point = new BMap.Point(prev.bd_lon - 0.0001, prev.bd_lat - 0.0001); | |
| 605 | + } | |
| 606 | + else{ | |
| 607 | + //没有上一个站点,默认在地图中间 | |
| 608 | + point = map.getCenter() | |
| 609 | + } | |
| 610 | + } | |
| 611 | + else{ | |
| 612 | + var old_m = pos[0].marker; | |
| 613 | + point = old_m.point; | |
| 614 | + //清除默认的点 | |
| 615 | + map.removeOverlay(old_m); | |
| 616 | + } | |
| 617 | + //进入新增点位 地图选点模式 | |
| 618 | + startSearchPoint(point, name); | |
| 619 | + } | |
| 620 | + }); | |
| 621 | + local.setPageCapacity(1); | |
| 622 | + local.search(name + "-公交车站"); | |
| 623 | + }; | |
| 624 | + | |
| 625 | + var a_s_p_maeker; | |
| 626 | + var startSearchPoint = function (point, name) { | |
| 627 | + var m = createYellowStation(point, name); | |
| 628 | + m.enableDragging(); | |
| 629 | + map.addOverlay(m); | |
| 630 | + map.setCenter(point); | |
| 631 | + | |
| 632 | + if(map.getZoom() < 16) | |
| 633 | + map.setZoom(16); | |
| 634 | + | |
| 635 | + _updateSearchPoint(m); | |
| 636 | + m.addEventListener('dragging', function () { | |
| 637 | + _updateSearchPoint(this); | |
| 638 | + }); | |
| 639 | + | |
| 640 | + //监听地图双击事件 | |
| 641 | + map.disableDoubleClickZoom(); | |
| 642 | + map.addEventListener('dblclick', pickupPoint); | |
| 643 | + | |
| 644 | + a_s_p_maeker = m; | |
| 645 | + }; | |
| 646 | + | |
| 647 | + /** | |
| 648 | + * 拾取坐标点位 | |
| 649 | + */ | |
| 650 | + var pickupPoint = function (e) { | |
| 651 | + var point = e.point; | |
| 652 | + | |
| 653 | + a_s_p_maeker.setPosition(point); | |
| 654 | + _updateSearchPoint(a_s_p_maeker); | |
| 655 | + }; | |
| 656 | + | |
| 657 | + var _updateSearchPoint = function (m) { | |
| 658 | + gb_station_route.reWriteSearchPointPanel(m.point); | |
| 659 | + }; | |
| 660 | + /** | |
| 661 | + * 创建一个黄色的,带添加的站点marker | |
| 662 | + * @param point | |
| 663 | + * @returns {BMap.Marker} | |
| 664 | + */ | |
| 665 | + function createYellowStation(point, name) { | |
| 666 | + var marker = new BMap.Marker(point); | |
| 667 | + | |
| 668 | + //根据站点名称 计算marker 宽度 | |
| 669 | + var w = name.length * 12 + 38 | |
| 670 | + , iw = w - 2; | |
| 671 | + var icon = new BMap.Icon(createStationIcon({ | |
| 672 | + stationName: name, index: '?' | |
| 673 | + }, w, '#ff9800'), new BMap.Size(iw, 24), {anchor: new BMap.Size(iw / 2, 25)}); | |
| 674 | + marker.setIcon(icon); | |
| 675 | + marker.setShadow(null); | |
| 676 | + | |
| 677 | + marker.addEventListener('click', function () { | |
| 678 | + if (map_status != 1) | |
| 679 | + openStationInfoWin(this); | |
| 680 | + }); | |
| 681 | + | |
| 682 | + //mouseover | |
| 683 | + marker.addEventListener('mouseover', function () { | |
| 684 | + setTop(this); | |
| 685 | + }); | |
| 686 | + return marker; | |
| 687 | + } | |
| 688 | + | |
| 689 | + /** | |
| 690 | + * 重绘一个走向的站点 | |
| 691 | + * @param upDown | |
| 692 | + */ | |
| 693 | + var reDrawStation = function (upDown) { | |
| 694 | + $.each(stationMarkers[upDown], function () { | |
| 695 | + map.removeOverlay(this); | |
| 696 | + }); | |
| 697 | + stationMarkers[upDown] = []; | |
| 698 | + | |
| 699 | + clearOtherOverlay(); | |
| 700 | + _renderStationMarket(gb_station_route.getData()[upDown]); | |
| 701 | + }; | |
| 702 | + | |
| 703 | + /** | |
| 704 | + * 重绘一个走向的路段 | |
| 705 | + * @param upDown | |
| 706 | + */ | |
| 707 | + var reDrawRoad = function (upDown) { | |
| 708 | + $.each(roadPolylines[upDown], function () { | |
| 709 | + map.removeOverlay(this); | |
| 710 | + }); | |
| 711 | + roadPolylines[upDown] = []; | |
| 712 | + | |
| 713 | + clearOtherOverlay(); | |
| 714 | + | |
| 715 | + _renderPolyline(gb_road_route.getData()[upDown], updownColor(upDown)); | |
| 716 | + }; | |
| 717 | + | |
| 718 | + | |
| 719 | + /** | |
| 720 | + * 进入路段编辑模式 | |
| 721 | + * @param road | |
| 722 | + */ | |
| 723 | + var editPolyline; | |
| 724 | + var start_edit_road= function (road) { | |
| 725 | + map.closeInfoWindow();//关闭infoWindow | |
| 726 | + map_status = 1; | |
| 727 | + gb_road_route.focus(road); | |
| 728 | + | |
| 729 | + //居中 | |
| 730 | + console.log('road.cproad.cp', road.cp); | |
| 731 | + map.centerAndZoom(new BMap.Point(road.cp.longitude, road.cp.latitude), 20); | |
| 732 | + | |
| 733 | + //路段变色 | |
| 734 | + var polyline = getRoadPolyline(road.sectionCode, road.directions); | |
| 735 | + editPolyline = polyline; | |
| 736 | + polyline.setStrokeColor('#E91E63'); | |
| 737 | + | |
| 738 | + //路段可编辑 | |
| 739 | + polyline.enableEditing(); | |
| 740 | + | |
| 741 | + //lineupdate,计算长度 mouseup | |
| 742 | + polyline.addEventListener('lineupdate', reCalcPathLength); | |
| 743 | + //gb_road_route.showPathLength(geolib.getPathLength(polyline.getPath())); | |
| 744 | + } | |
| 745 | + | |
| 746 | + /** | |
| 747 | + * 计算并显示路段长度 | |
| 748 | + * @param p | |
| 749 | + */ | |
| 750 | + var reCalcPathLength = function () { | |
| 751 | + var len = geolib.getPathLength(this.getPath()); | |
| 752 | + gb_road_route.showPathLength(len); | |
| 753 | + }; | |
| 754 | + | |
| 755 | + var getRoadPolyline = function (code, updown) { | |
| 756 | + var array = roadPolylines[updown], | |
| 757 | + polyline; | |
| 758 | + for (var i = 0, p; p = array[i++];) { | |
| 759 | + if (p.ct_data.sectionCode == code) { | |
| 760 | + polyline = p; | |
| 761 | + break; | |
| 762 | + } | |
| 763 | + } | |
| 764 | + return polyline; | |
| 765 | + }; | |
| 766 | + | |
| 767 | + var focusMarker; | |
| 768 | + var focusPoint = function (lat, lng) { | |
| 769 | + var p = new BMap.Point(lng,lat); | |
| 770 | + map.setCenter(p); | |
| 771 | + | |
| 772 | + clearfocus(); | |
| 773 | + | |
| 774 | + var marker = new BMap.Marker(p); | |
| 775 | + map.addOverlay(marker); | |
| 776 | + marker.setAnimation(BMAP_ANIMATION_BOUNCE); | |
| 777 | + focusMarker = marker; | |
| 778 | + var zoom = map.getZoom(); | |
| 779 | + if(zoom < 18) | |
| 780 | + map.setZoom(18); | |
| 781 | + }; | |
| 782 | + | |
| 783 | + var clearfocus = function () { | |
| 784 | + if(focusMarker){ | |
| 785 | + map.removeOverlay(focusMarker); | |
| 786 | + focusMarker = null; | |
| 787 | + } | |
| 788 | + }; | |
| 789 | + | |
| 790 | + /** | |
| 791 | + * 退出路段编辑模式 | |
| 792 | + */ | |
| 793 | + var exitEditRoadStatus = function (road, noFocus) { | |
| 794 | + map_status = 0; | |
| 795 | + $('.main_left_panel_m_layer').hide(); | |
| 796 | + $('.road_edit_panel').remove(); | |
| 797 | + | |
| 798 | + editPolyline.removeEventListener('lineupdate', reCalcPathLength); | |
| 799 | + editPolyline = null; | |
| 800 | + if(noFocus) | |
| 801 | + return; | |
| 802 | + | |
| 803 | + //polyline | |
| 804 | + var polyline = getRoadPolyline(road.sectionCode, road.directions); | |
| 805 | + polyline.disableEditing(); | |
| 806 | + polyline.ct_data = road; | |
| 807 | + polyline.setStrokeColor(updownColor(road.directions)); | |
| 808 | + | |
| 809 | + openRoadInfoWin(polyline, new BMap.Point(road.cp.longitude, road.cp.latitude)); | |
| 810 | + }; | |
| 811 | + | |
| 812 | + res_load_ep.emitLater('load_map'); | |
| 813 | + return { | |
| 814 | + _render: _render, | |
| 815 | + changeUpDown: changeUpDown, | |
| 816 | + focusStation: focusStation, | |
| 817 | + focusRoad: focusRoad, | |
| 818 | + editStationBuffer: editStationBuffer, | |
| 819 | + updateStation: updateStation, | |
| 820 | + exitEditBufferStatus: exitEditBufferStatus, | |
| 821 | + changeShapeType: changeShapeType, | |
| 822 | + exitDrawStatus: exitDrawStatus, | |
| 823 | + openDrawStatus: openDrawStatus, | |
| 824 | + getDrawPolygon: function () { | |
| 825 | + return editPolygon; | |
| 826 | + }, | |
| 827 | + getDrawPolyline: function () { | |
| 828 | + return editPolyline; | |
| 829 | + }, | |
| 830 | + updateDragRadius: updateDragRadius, | |
| 831 | + closeInfoWin: closeInfoWin, | |
| 832 | + showAddPointPanel: showAddPointPanel, | |
| 833 | + resetMapStatus: function () { | |
| 834 | + map_status = 0; | |
| 835 | + clearOtherOverlay(); | |
| 836 | + map.removeEventListener('dblclick', pickupPoint); | |
| 837 | + map.enableDoubleClickZoom(); | |
| 838 | + }, | |
| 839 | + reDrawStation: reDrawStation, | |
| 840 | + reDrawRoad: reDrawRoad, | |
| 841 | + edit_road: start_edit_road, | |
| 842 | + exitEditRoadStatus: exitEditRoadStatus, | |
| 843 | + showAddRoadPanel: showAddRoadPanel, | |
| 844 | + map: map, | |
| 845 | + focus: focusPoint, | |
| 846 | + clearfocus: clearfocus | |
| 847 | + }; | |
| 848 | 848 | }(); |
| 849 | 849 | \ No newline at end of file | ... | ... |
src/main/resources/static/pages/base/geo_data_edit/js/search.js
| 1 | -/** | |
| 2 | - * 地图搜索定位 | |
| 3 | - */ | |
| 4 | -var gb_ct_search = function () { | |
| 5 | - | |
| 6 | - var local; | |
| 7 | - | |
| 8 | - var _$icon = $('.main_lt_search_panel span[uk-icon]'); | |
| 9 | - var v, run_flag; | |
| 10 | - $('.ct_search_input').on('input', function () { | |
| 11 | - v = $(this).val(); | |
| 12 | - if(run_flag) | |
| 13 | - return; | |
| 14 | - | |
| 15 | - run_flag = true; | |
| 16 | - setTimeout(function () { | |
| 17 | - if(!v){ | |
| 18 | - _$icon.attr('uk-icon', 'icon: search'); | |
| 19 | - closeSearchResult(); | |
| 20 | - } | |
| 21 | - else{ | |
| 22 | - _$icon.attr('uk-icon', 'icon: close'); | |
| 23 | - local.search(v); | |
| 24 | - } | |
| 25 | - run_flag = false; | |
| 26 | - }, 300); | |
| 27 | - }); | |
| 28 | - | |
| 29 | - var searchComplete = function (e) { | |
| 30 | - var htmlStr = template('geo_d_e_search_result-temp', {list: e.wr}); | |
| 31 | - $('.ct_search_result').html(htmlStr); | |
| 32 | - | |
| 33 | - }; | |
| 34 | - | |
| 35 | - _$icon.on('click', function () { | |
| 36 | - var type = $(this).attr('uk-icon'); | |
| 37 | - if(type=='icon: close'){ | |
| 38 | - $('.ct_search_input').val('');//.trigger('input'); | |
| 39 | - _$icon.attr('uk-icon', 'icon: search'); | |
| 40 | - closeSearchResult(); | |
| 41 | - } | |
| 42 | - }); | |
| 43 | - | |
| 44 | - $(document).on('click', '.ct_search_result>ul.s_list>li', function () { | |
| 45 | - if($(this).hasClass('_empty')) | |
| 46 | - return; | |
| 47 | - var lat = $(this).data('lat'); | |
| 48 | - var lng = $(this).data('lng'); | |
| 49 | - gb_ct_map.focus(lat, lng); | |
| 50 | - }); | |
| 51 | - | |
| 52 | - function closeSearchResult() { | |
| 53 | - $('.ct_search_result').empty(); | |
| 54 | - gb_ct_map.clearfocus(); | |
| 55 | - } | |
| 56 | - | |
| 57 | - return {init: function () { | |
| 58 | - local = new BMap.LocalSearch(gb_ct_map.map, { | |
| 59 | - onSearchComplete: searchComplete | |
| 60 | - }) | |
| 61 | - }} | |
| 1 | +/** | |
| 2 | + * 地图搜索定位 | |
| 3 | + */ | |
| 4 | +var gb_ct_search = function () { | |
| 5 | + | |
| 6 | + var local; | |
| 7 | + | |
| 8 | + var _$icon = $('.main_lt_search_panel span[uk-icon]'); | |
| 9 | + var v, run_flag; | |
| 10 | + $('.ct_search_input').on('input', function () { | |
| 11 | + v = $(this).val(); | |
| 12 | + if(run_flag) | |
| 13 | + return; | |
| 14 | + | |
| 15 | + run_flag = true; | |
| 16 | + setTimeout(function () { | |
| 17 | + if(!v){ | |
| 18 | + _$icon.attr('uk-icon', 'icon: search'); | |
| 19 | + closeSearchResult(); | |
| 20 | + } | |
| 21 | + else{ | |
| 22 | + _$icon.attr('uk-icon', 'icon: close'); | |
| 23 | + local.search(v); | |
| 24 | + } | |
| 25 | + run_flag = false; | |
| 26 | + }, 300); | |
| 27 | + }); | |
| 28 | + | |
| 29 | + var searchComplete = function (e) { | |
| 30 | + var htmlStr = template('geo_d_e_search_result-temp', {list: e.wr}); | |
| 31 | + $('.ct_search_result').html(htmlStr); | |
| 32 | + | |
| 33 | + }; | |
| 34 | + | |
| 35 | + _$icon.on('click', function () { | |
| 36 | + var type = $(this).attr('uk-icon'); | |
| 37 | + if(type=='icon: close'){ | |
| 38 | + $('.ct_search_input').val('');//.trigger('input'); | |
| 39 | + _$icon.attr('uk-icon', 'icon: search'); | |
| 40 | + closeSearchResult(); | |
| 41 | + } | |
| 42 | + }); | |
| 43 | + | |
| 44 | + $(document).on('click', '.ct_search_result>ul.s_list>li', function () { | |
| 45 | + if($(this).hasClass('_empty')) | |
| 46 | + return; | |
| 47 | + var lat = $(this).data('lat'); | |
| 48 | + var lng = $(this).data('lng'); | |
| 49 | + gb_ct_map.focus(lat, lng); | |
| 50 | + }); | |
| 51 | + | |
| 52 | + function closeSearchResult() { | |
| 53 | + $('.ct_search_result').empty(); | |
| 54 | + gb_ct_map.clearfocus(); | |
| 55 | + } | |
| 56 | + | |
| 57 | + return {init: function () { | |
| 58 | + local = new BMap.LocalSearch(gb_ct_map.map, { | |
| 59 | + onSearchComplete: searchComplete | |
| 60 | + }) | |
| 61 | + }} | |
| 62 | 62 | }(); |
| 63 | 63 | \ No newline at end of file | ... | ... |
src/main/resources/static/pages/base/geo_data_edit/js/station_route.js
| 1 | -<!-- 站点路由 --> | |
| 2 | -var gb_station_route = function () { | |
| 3 | - | |
| 4 | - var temps; | |
| 5 | - var station_maps; | |
| 6 | - //绘制线路路由 | |
| 7 | - var init = function (cb) { | |
| 8 | - var lineCode = storage.getItem("geo_data_edit_line_code"); | |
| 9 | - | |
| 10 | - var ep = EventProxy.create("data", "temp", function (data, temp) { | |
| 11 | - station_maps = data; | |
| 12 | - temps = temp; | |
| 13 | - //当前使用的线路版本 | |
| 14 | - storage.setItem("geo_data_edit_line_version" , data[0][0].versions); | |
| 15 | - //渲染页面 | |
| 16 | - var upHtmlStr = temps['geo_d_e_station_route-temp']({list: station_maps[0]}); | |
| 17 | - $('.up_down_route_list>li:first>.station_route').html(upHtmlStr); | |
| 18 | - var downHtmlStr = temps['geo_d_e_station_route-temp']({list: station_maps[1]}); | |
| 19 | - $('.up_down_route_list>li:last>.station_route').html(downHtmlStr); | |
| 20 | - | |
| 21 | - cb && cb(); | |
| 22 | - }); | |
| 23 | - | |
| 24 | - //加载数据 | |
| 25 | - gb_common.$get('/_geo_data/findGeoStations', {lineCode: lineCode}, function (rs) { | |
| 26 | - rs.list.sort(function (a, b) { | |
| 27 | - return parseInt(a.stationRouteCode) - parseInt(b.stationRouteCode); | |
| 28 | - }); | |
| 29 | - ep.emit('data', gb_common.groupBy(rs.list, 'directions')); | |
| 30 | - }); | |
| 31 | - | |
| 32 | - //加载模板片段 | |
| 33 | - $.get('/pages/base/geo_data_edit/fragments/f_station_route.html', function (dom) { | |
| 34 | - ep.emit('temp', gb_common.compileTempByDom(dom, { | |
| 35 | - compress: true | |
| 36 | - })); | |
| 37 | - }); | |
| 38 | - }; | |
| 39 | - | |
| 40 | - //站点单击 | |
| 41 | - $('.up_down_route_list>li>.station_route').on('click', 'a[data-code]', function () { | |
| 42 | - var code = $(this).data('code'), | |
| 43 | - updown = $(this).data('updown'); | |
| 44 | - | |
| 45 | - clearFocus(); | |
| 46 | - gb_ct_map.focusStation(code, updown); | |
| 47 | - }); | |
| 48 | - | |
| 49 | - var clearFocus = function () { | |
| 50 | - $('.up_down_route_list>li>.station_route li.ct_active').removeClass('ct_active'); | |
| 51 | - }; | |
| 52 | - | |
| 53 | - var focus = function (s) { | |
| 54 | - var elem = $('.up_down_route_list>li>.station_route .s_r_item[data-code='+s.stationCode+']'); | |
| 55 | - elem.addClass('ct_active'); | |
| 56 | - | |
| 57 | - if (!isShow(elem)) { | |
| 58 | - //定位滚动条 | |
| 59 | - var cont = $('.up_down_route_list'), | |
| 60 | - diff = cont.height() / 2; | |
| 61 | - cont.animate({ | |
| 62 | - scrollTop: elem.offset().top - cont.offset().top + cont.scrollTop() - diff | |
| 63 | - }, 500); | |
| 64 | - } | |
| 65 | - }; | |
| 66 | - | |
| 67 | - var isShow = function (elem) { | |
| 68 | - var wrap = $('.up_down_route_list'); | |
| 69 | - return elem.offset().top < wrap.height() + 122 && elem.offset().top > 122; | |
| 70 | - }; | |
| 71 | - | |
| 72 | - var getStation = function (code, updown) { | |
| 73 | - var array = station_maps[updown]; | |
| 74 | - for(var i=0,s;s=array[i++];){ | |
| 75 | - if(s.stationCode==code) | |
| 76 | - return s; | |
| 77 | - } | |
| 78 | - return null; | |
| 79 | - }; | |
| 80 | - | |
| 81 | - /** | |
| 82 | - * 编辑站点名称 | |
| 83 | - * @param station | |
| 84 | - */ | |
| 85 | - var station_edit_name = function (station) { | |
| 86 | - var cellWrap = getStationLI(station); | |
| 87 | - $('a[data-code]', cellWrap).hide(); | |
| 88 | - | |
| 89 | - cellWrap.append(temps['geo_d_e_edit_name_panel-temp'](station)).addClass('_edit_name'); | |
| 90 | - //焦点 | |
| 91 | - $('input[name=stationName]', cellWrap).focus(); | |
| 92 | - //取消 | |
| 93 | - $('.cancel_icon_btn', cellWrap).on('click', function () { | |
| 94 | - $('.ul_li_input', cellWrap).remove(); | |
| 95 | - $('a[data-code]', cellWrap).show(); | |
| 96 | - }); | |
| 97 | - }; | |
| 98 | - | |
| 99 | - var getStationLI = function (s) { | |
| 100 | - return $('.up_down_route_list>li:eq('+s.directions+')>.station_route .s_r_item[data-code='+s.stationCode+']'); | |
| 101 | - }; | |
| 102 | - | |
| 103 | - var addPrevId;//添加站点路由的上一个站点ID | |
| 104 | - var insert_station_before = function (station) { | |
| 105 | - //在之前插入站点 | |
| 106 | - var cell = getStationLI(station); | |
| 107 | - | |
| 108 | - var addCell = $(temps['geo_d_e_add_station_panel-temp'](station)); | |
| 109 | - cell.before(addCell); | |
| 110 | - | |
| 111 | - add_station(addCell); | |
| 112 | - }; | |
| 113 | - | |
| 114 | - | |
| 115 | - //添加站点 取消按钮 | |
| 116 | - $(document).on('click', '.add_station_search_point_wrap button.cancel', function () { | |
| 117 | - $('.main_left_panel_m_layer').hide(); | |
| 118 | - $(this).parents('.buffer_edit_body').parent().remove(); | |
| 119 | - gb_ct_map.resetMapStatus(); | |
| 120 | - }); | |
| 121 | - | |
| 122 | - var add_station = function (addCell) { | |
| 123 | - gb_ct_map.closeInfoWin(); | |
| 124 | - //焦点 | |
| 125 | - var $nameInput = $('input[name=stationName]', addCell); | |
| 126 | - $nameInput.focus(); | |
| 127 | - //取消 | |
| 128 | - $('.cancel_icon_btn', addCell).on('click', function () { | |
| 129 | - addCell.remove(); | |
| 130 | - }); | |
| 131 | - | |
| 132 | - //选择地图位置 | |
| 133 | - $('.search_point_icon_btn', addCell).on('click', function () { | |
| 134 | - $('.station_li_transient').removeClass('_search_point'); | |
| 135 | - $(this).parents('.station_li_transient').addClass('_search_point'); | |
| 136 | - var name = $nameInput.val(); | |
| 137 | - if(!name) | |
| 138 | - return UIkit.notification("你必须输入站点名称!", {status: 'danger'}); | |
| 139 | - | |
| 140 | - if(is_duplication(name)) | |
| 141 | - return UIkit.notification("站点路由名称重复!!", {status: 'danger'}); | |
| 142 | - | |
| 143 | - debugger | |
| 144 | - //上一个站点的ID | |
| 145 | - var _cell = $(this).parents('.station_li_transient'); | |
| 146 | - var $prev = prevs(_cell, 's_r_item') | |
| 147 | - if($prev.length > 0) | |
| 148 | - addPrevId = $prev.data('id'); | |
| 149 | - else | |
| 150 | - addPrevId = -1; | |
| 151 | - | |
| 152 | - $('.main_left_panel_m_layer').show(); | |
| 153 | - gb_ct_map.showAddPointPanel(name); | |
| 154 | - | |
| 155 | - }); | |
| 156 | - //监听回车事件 | |
| 157 | - $('[name=stationName]', addCell).on('keydown', function (e) { | |
| 158 | - if(event.keyCode == "13") | |
| 159 | - $('.search_point_icon_btn', addCell).trigger('click'); | |
| 160 | - }); | |
| 161 | - }; | |
| 162 | - | |
| 163 | - var prevs = function (that, clazz) { | |
| 164 | - var prev; | |
| 165 | - while(true){ | |
| 166 | - prev = $(that).prev(); | |
| 167 | - | |
| 168 | - if(prev.length == 0) | |
| 169 | - return null; | |
| 170 | - | |
| 171 | - if(prev.hasClass(clazz)) | |
| 172 | - return prev; | |
| 173 | - | |
| 174 | - that = prev; | |
| 175 | - } | |
| 176 | - }; | |
| 177 | - | |
| 178 | - /** | |
| 179 | - * name 是否重复 | |
| 180 | - * @param name | |
| 181 | - */ | |
| 182 | - var is_duplication = function (name) { | |
| 183 | - var array = station_maps[getUpDown()]; | |
| 184 | - for(var i=0, s; s=array[i++];){ | |
| 185 | - if(s.stationName==$.trim(name)) | |
| 186 | - return true; | |
| 187 | - } | |
| 188 | - return false; | |
| 189 | - }; | |
| 190 | - | |
| 191 | - var insert_station_after = function (station) { | |
| 192 | - //在之后插入站点 | |
| 193 | - var cell = getStationLI(station); | |
| 194 | - | |
| 195 | - var addCell = $(temps['geo_d_e_add_station_panel-temp'](station)); | |
| 196 | - cell.after(addCell); | |
| 197 | - | |
| 198 | - add_station(addCell); | |
| 199 | - }; | |
| 200 | - | |
| 201 | - var realEditStation; | |
| 202 | - var callbackHandler = { | |
| 203 | - edit_buffer: function (station) { | |
| 204 | - gb_ct_map.editStationBuffer(station); | |
| 205 | - }, | |
| 206 | - edit_name: station_edit_name, | |
| 207 | - insert_before: insert_station_before, | |
| 208 | - insert_after: insert_station_after, | |
| 209 | - destroy: function (station) { | |
| 210 | - gb_data_submit.destroyStation(station); | |
| 211 | - } | |
| 212 | - }; | |
| 213 | - | |
| 214 | - $.contextMenu({ | |
| 215 | - selector: '._route_info_wrap .up_down_route_list .station_route>ul>li>a[data-code]', | |
| 216 | - className: 'station-route-ct-menu', | |
| 217 | - callback: function (key, options) { | |
| 218 | - var aLink = options.$trigger; | |
| 219 | - var code = aLink.data('code'), | |
| 220 | - updown = aLink.data('updown'); | |
| 221 | - var station = getStation(code, updown); | |
| 222 | - realEditStation = station; | |
| 223 | - callbackHandler[key] && callbackHandler[key](station); | |
| 224 | - }, | |
| 225 | - items: { | |
| 226 | - 'edit_buffer': { | |
| 227 | - name: '编辑缓冲区' | |
| 228 | - }, | |
| 229 | - 'sep1': '---------', | |
| 230 | - 'edit_name': { | |
| 231 | - name: '修改站点名称' | |
| 232 | - }, | |
| 233 | - 'insert_after': { | |
| 234 | - name: '新增站点(之后)' | |
| 235 | - }, | |
| 236 | - 'insert_before': { | |
| 237 | - name: '新增站点(之前)' | |
| 238 | - }, | |
| 239 | - 'destroy': { | |
| 240 | - name: '撤销站点' | |
| 241 | - } | |
| 242 | - } | |
| 243 | - }); | |
| 244 | - | |
| 245 | - var showEditPanel = function (s) { | |
| 246 | - var htmlStr = temps['geo_d_e_map_edit_buffer_panel-temp'](s); | |
| 247 | - $('.ct_page').append(htmlStr); | |
| 248 | - $('.buffer_edit_panel').show(); | |
| 249 | - | |
| 250 | - //缓冲区编辑 取消 | |
| 251 | - $('button.cancel', $editWrap).on('click', function (e) { | |
| 252 | - $('.main_left_panel_m_layer').hide(); | |
| 253 | - $(this).parents('.buffer_edit_body').parent().remove(); | |
| 254 | - gb_ct_map.resetMapStatus(); | |
| 255 | - | |
| 256 | - var f = $(this).parents('form'); | |
| 257 | - var data = f.serializeJSON(); | |
| 258 | - | |
| 259 | - gb_ct_map.exitEditBufferStatus(data); | |
| 260 | - }); | |
| 261 | - | |
| 262 | - var $editWrap = '.buffer_edit_panel>.buffer_edit_body'; | |
| 263 | - | |
| 264 | - //缓冲区编辑 切换缓冲区类型(圆形,多边形) | |
| 265 | - $('select[name=shapesType]', $editWrap).on('change', function (e) { | |
| 266 | - var v = $(this).val(); | |
| 267 | - if(v=='d'){ | |
| 268 | - $('.buffer_edit_panel .shapes_type').addClass('st_d'); | |
| 269 | - } | |
| 270 | - else{ | |
| 271 | - $('.buffer_edit_panel .shapes_type').removeClass('st_d'); | |
| 272 | - $('input[name=radius]', $editWrap).val(80); | |
| 273 | - } | |
| 274 | - gb_ct_map.changeShapeType(v); | |
| 275 | - }); | |
| 276 | - | |
| 277 | - //半径修改 | |
| 278 | - var update_radius_flag, update_radius; | |
| 279 | - $('input[name=radius]', $editWrap).on('input', function (e) { | |
| 280 | - update_radius = $(this).val(); | |
| 281 | - if(update_radius_flag){ | |
| 282 | - return; | |
| 283 | - } | |
| 284 | - update_radius_flag = true; | |
| 285 | - setTimeout(function () { | |
| 286 | - gb_ct_map.updateDragRadius(update_radius); | |
| 287 | - update_radius_flag = false; | |
| 288 | - }, 180); | |
| 289 | - }); | |
| 290 | - | |
| 291 | - //缓冲区编辑 切换绘制模式 | |
| 292 | - $('.draw_polygon_switch', $editWrap).on('input', function (e) { | |
| 293 | - var type = $(this).data('type'); | |
| 294 | - if(type==1){ | |
| 295 | - //退出绘制状态 | |
| 296 | - gb_ct_map.exitDrawStatus(); | |
| 297 | - $(this).data('type', 0).find('a').text('开始绘制'); | |
| 298 | - } | |
| 299 | - else if(type==0 || type==2){ | |
| 300 | - gb_ct_map.openDrawStatus(); | |
| 301 | - $(this).data('type', 1).find('a').text('暂停绘制'); | |
| 302 | - } | |
| 303 | - else if(type==3){ | |
| 304 | - gb_ct_map.changeShapeType('d'); | |
| 305 | - $(this).data('type', 1).find('a').text('暂停绘制'); | |
| 306 | - } | |
| 307 | - }); | |
| 308 | - }; | |
| 309 | - | |
| 310 | - /** | |
| 311 | - * 绘制结束 | |
| 312 | - */ | |
| 313 | - var drawEnd = function () { | |
| 314 | - $('.buffer_edit_panel>.buffer_edit_body .draw_polygon_switch').data('type', 2).find('a').text('重新绘制'); | |
| 315 | - }; | |
| 316 | - | |
| 317 | - var edPanelRunFlag; | |
| 318 | - var ecObj; | |
| 319 | - var reWriteEditPanel = function (ec, isPolygon) { | |
| 320 | - ecObj = ec; | |
| 321 | - if(edPanelRunFlag){ | |
| 322 | - return; | |
| 323 | - } | |
| 324 | - | |
| 325 | - edPanelRunFlag = true; | |
| 326 | - setTimeout(function () { | |
| 327 | - var panel = $('.buffer_edit_panel'); | |
| 328 | - var p; | |
| 329 | - if(!isPolygon){ | |
| 330 | - $('[name=radius]', panel).val(parseInt(ecObj.getRadius()));//半径 | |
| 331 | - p = ecObj.getCenter(); | |
| 332 | - }else{ | |
| 333 | - p = ecObj.point; | |
| 334 | - } | |
| 335 | - | |
| 336 | - $('[name=gLaty]', panel).val(p.lat); | |
| 337 | - $('[name=gLonx]', panel).val(p.lng); | |
| 338 | - edPanelRunFlag = false; | |
| 339 | - }, 200); | |
| 340 | - }; | |
| 341 | - | |
| 342 | - var update = function (s) { | |
| 343 | - var array = station_maps[s.directions]; | |
| 344 | - for(var i=0,item; item=array[i++];){ | |
| 345 | - if(item.stationCode==s.stationCode){ | |
| 346 | - s.index = i; | |
| 347 | - array.splice(i - 1, 1, s); | |
| 348 | - break; | |
| 349 | - } | |
| 350 | - } | |
| 351 | - | |
| 352 | - //替换 | |
| 353 | - var sCell = $(temps['geo_d_e_station_route_one-temp'](s)); | |
| 354 | - $('a.uk-animation-shake', sCell).on('webkitAnimationEnd', function () { | |
| 355 | - $(this).removeClass('uk-animation-shake'); | |
| 356 | - }); | |
| 357 | - getStationLI(s).replaceWith(sCell); | |
| 358 | - }; | |
| 359 | - | |
| 360 | - //取消按钮 | |
| 361 | -/* $(document).on('click','.buffer_edit_body button.cancel', function (e) { | |
| 362 | - $('.main_left_panel_m_layer').hide(); | |
| 363 | - $(this).parents('.buffer_edit_body').parent().remove(); | |
| 364 | - gb_ct_map.resetMapStatus(); | |
| 365 | - });*/ | |
| 366 | - | |
| 367 | - | |
| 368 | - var spcPanelRunFlag; | |
| 369 | - var spcPoint; | |
| 370 | - var reWriteSearchPointPanel = function (point) { | |
| 371 | - spcPoint = point; | |
| 372 | - if(spcPanelRunFlag){ | |
| 373 | - return; | |
| 374 | - } | |
| 375 | - | |
| 376 | - spcPanelRunFlag = true; | |
| 377 | - setTimeout(function () { | |
| 378 | - var panel = $('.add_station_search_point_wrap .buffer_edit_body'); | |
| 379 | - | |
| 380 | - $('[name=gLaty]', panel).val(spcPoint.lat); | |
| 381 | - $('[name=gLonx]', panel).val(spcPoint.lng); | |
| 382 | - spcPanelRunFlag = false; | |
| 383 | - }, 200); | |
| 384 | - }; | |
| 385 | - | |
| 386 | - var updateStationRouteData = function (list) { | |
| 387 | - list.sort(function (a, b) { | |
| 388 | - return parseInt(a.stationRouteCode) - parseInt(b.stationRouteCode); | |
| 389 | - }); | |
| 390 | - | |
| 391 | - var upDown = list[0].directions; | |
| 392 | - var dataMaps = {}; | |
| 393 | - //更新数据 | |
| 394 | - for(var i=0,s;s=list[i++];){ | |
| 395 | - s.index = i; | |
| 396 | - dataMaps[s.id] = s; | |
| 397 | - } | |
| 398 | - station_maps[upDown] = list; | |
| 399 | - //更新序号 | |
| 400 | - var wrap = $('.up_down_route_list>li:eq('+upDown+')>.station_route'); | |
| 401 | - $('.s_r_item', wrap).each(function () { | |
| 402 | - $(this).replaceWith( | |
| 403 | - temps['geo_d_e_station_route_one-temp'](dataMaps[$(this).data('id')])); | |
| 404 | - }); | |
| 405 | - | |
| 406 | - //延迟清除动画class | |
| 407 | - setTimeout(function () { | |
| 408 | - $('.s_r_item a.uk-animation-shake', wrap).removeClass('uk-animation-shake'); | |
| 409 | - }, 1000); | |
| 410 | - | |
| 411 | - //更新地图 | |
| 412 | - gb_ct_map.reDrawStation(upDown); | |
| 413 | - }; | |
| 414 | - | |
| 415 | - /** | |
| 416 | - * 添加结束,刷新List | |
| 417 | - * @param list | |
| 418 | - */ | |
| 419 | - var addEnd = function (list, _newRCode) { | |
| 420 | - updateStationRouteData(list); | |
| 421 | - | |
| 422 | - var upDown = list[0].directions; | |
| 423 | - var wrap = $('.up_down_route_list>li:eq('+upDown+')>.station_route'); | |
| 424 | - //新增的站点路由 | |
| 425 | - var ns = getStationByRouteCode(upDown, _newRCode); | |
| 426 | - $('.station_li_transient._search_point', wrap).replaceWith( | |
| 427 | - temps['geo_d_e_station_route_one-temp'](ns) | |
| 428 | - ); | |
| 429 | - | |
| 430 | - $('.main_left_panel_m_layer').hide(); | |
| 431 | - $('.add_station_search_point_wrap').remove(); | |
| 432 | - }; | |
| 433 | - | |
| 434 | - /** | |
| 435 | - * 撤销完成 | |
| 436 | - * @param list | |
| 437 | - */ | |
| 438 | - var destroyEnd = function (list, station) { | |
| 439 | - //被撤销的 | |
| 440 | - $('.up_down_route_list .s_r_item[data-id='+station.id+']').remove(); | |
| 441 | - updateStationRouteData(list); | |
| 442 | - }; | |
| 443 | - | |
| 444 | - var getStationByRouteCode = function (upDown, _newRCode) { | |
| 445 | - var list = station_maps[upDown]; | |
| 446 | - for(var i=0,s; s=list[i++];){ | |
| 447 | - if(s.stationRouteCode==_newRCode) | |
| 448 | - return s; | |
| 449 | - } | |
| 450 | - return null; | |
| 451 | - }; | |
| 452 | - | |
| 453 | - var getStationById = function (id) { | |
| 454 | - for(var i=0,s;s=station_maps[0][i++];){ | |
| 455 | - if(s.id == id) | |
| 456 | - return s; | |
| 457 | - } | |
| 458 | - for(var i=0,s;s=station_maps[1][i++];){ | |
| 459 | - if(s.id == id) | |
| 460 | - return s; | |
| 461 | - } | |
| 462 | - return null; | |
| 463 | - }; | |
| 464 | - | |
| 465 | - res_load_ep.emitLater('load_station_route'); | |
| 466 | - return { | |
| 467 | - init: init, | |
| 468 | - getData: function () { | |
| 469 | - return station_maps; | |
| 470 | - }, | |
| 471 | - getTemps: function () { | |
| 472 | - return temps; | |
| 473 | - }, | |
| 474 | - clearFocus: clearFocus, | |
| 475 | - focus: focus, | |
| 476 | - showEditPanel: showEditPanel, | |
| 477 | - reWriteEditPanel: reWriteEditPanel, | |
| 478 | - update: update, | |
| 479 | - drawEnd: drawEnd, | |
| 480 | - getRealEditStation: function () { | |
| 481 | - return realEditStation; | |
| 482 | - }, | |
| 483 | - reWriteSearchPointPanel: reWriteSearchPointPanel, | |
| 484 | - getAddPrevId: function () { | |
| 485 | - return addPrevId; | |
| 486 | - }, | |
| 487 | - addEnd: addEnd, | |
| 488 | - destroyEnd: destroyEnd, | |
| 489 | - getStationById:getStationById | |
| 490 | - }; | |
| 1 | +<!-- 站点路由 --> | |
| 2 | +var gb_station_route = function () { | |
| 3 | + | |
| 4 | + var temps; | |
| 5 | + var station_maps; | |
| 6 | + //绘制线路路由 | |
| 7 | + var init = function (cb) { | |
| 8 | + var lineCode = storage.getItem("geo_data_edit_line_code"); | |
| 9 | + | |
| 10 | + var ep = EventProxy.create("data", "temp", function (data, temp) { | |
| 11 | + station_maps = data; | |
| 12 | + temps = temp; | |
| 13 | + //当前使用的线路版本 | |
| 14 | + storage.setItem("geo_data_edit_line_version" , data[0][0].versions); | |
| 15 | + //渲染页面 | |
| 16 | + var upHtmlStr = temps['geo_d_e_station_route-temp']({list: station_maps[0]}); | |
| 17 | + $('.up_down_route_list>li:first>.station_route').html(upHtmlStr); | |
| 18 | + var downHtmlStr = temps['geo_d_e_station_route-temp']({list: station_maps[1]}); | |
| 19 | + $('.up_down_route_list>li:last>.station_route').html(downHtmlStr); | |
| 20 | + | |
| 21 | + cb && cb(); | |
| 22 | + }); | |
| 23 | + | |
| 24 | + //加载数据 | |
| 25 | + gb_common.$get('/_geo_data/findGeoStations', {lineCode: lineCode}, function (rs) { | |
| 26 | + rs.list.sort(function (a, b) { | |
| 27 | + return parseInt(a.stationRouteCode) - parseInt(b.stationRouteCode); | |
| 28 | + }); | |
| 29 | + ep.emit('data', gb_common.groupBy(rs.list, 'directions')); | |
| 30 | + }); | |
| 31 | + | |
| 32 | + //加载模板片段 | |
| 33 | + $.get('/pages/base/geo_data_edit/fragments/f_station_route.html', function (dom) { | |
| 34 | + ep.emit('temp', gb_common.compileTempByDom(dom, { | |
| 35 | + compress: true | |
| 36 | + })); | |
| 37 | + }); | |
| 38 | + }; | |
| 39 | + | |
| 40 | + //站点单击 | |
| 41 | + $('.up_down_route_list>li>.station_route').on('click', 'a[data-code]', function () { | |
| 42 | + var code = $(this).data('code'), | |
| 43 | + updown = $(this).data('updown'); | |
| 44 | + | |
| 45 | + clearFocus(); | |
| 46 | + gb_ct_map.focusStation(code, updown); | |
| 47 | + }); | |
| 48 | + | |
| 49 | + var clearFocus = function () { | |
| 50 | + $('.up_down_route_list>li>.station_route li.ct_active').removeClass('ct_active'); | |
| 51 | + }; | |
| 52 | + | |
| 53 | + var focus = function (s) { | |
| 54 | + var elem = $('.up_down_route_list>li>.station_route .s_r_item[data-code='+s.stationCode+']'); | |
| 55 | + elem.addClass('ct_active'); | |
| 56 | + | |
| 57 | + if (!isShow(elem)) { | |
| 58 | + //定位滚动条 | |
| 59 | + var cont = $('.up_down_route_list'), | |
| 60 | + diff = cont.height() / 2; | |
| 61 | + cont.animate({ | |
| 62 | + scrollTop: elem.offset().top - cont.offset().top + cont.scrollTop() - diff | |
| 63 | + }, 500); | |
| 64 | + } | |
| 65 | + }; | |
| 66 | + | |
| 67 | + var isShow = function (elem) { | |
| 68 | + var wrap = $('.up_down_route_list'); | |
| 69 | + return elem.offset().top < wrap.height() + 122 && elem.offset().top > 122; | |
| 70 | + }; | |
| 71 | + | |
| 72 | + var getStation = function (code, updown) { | |
| 73 | + var array = station_maps[updown]; | |
| 74 | + for(var i=0,s;s=array[i++];){ | |
| 75 | + if(s.stationCode==code) | |
| 76 | + return s; | |
| 77 | + } | |
| 78 | + return null; | |
| 79 | + }; | |
| 80 | + | |
| 81 | + /** | |
| 82 | + * 编辑站点名称 | |
| 83 | + * @param station | |
| 84 | + */ | |
| 85 | + var station_edit_name = function (station) { | |
| 86 | + var cellWrap = getStationLI(station); | |
| 87 | + $('a[data-code]', cellWrap).hide(); | |
| 88 | + | |
| 89 | + cellWrap.append(temps['geo_d_e_edit_name_panel-temp'](station)).addClass('_edit_name'); | |
| 90 | + //焦点 | |
| 91 | + $('input[name=stationName]', cellWrap).focus(); | |
| 92 | + //取消 | |
| 93 | + $('.cancel_icon_btn', cellWrap).on('click', function () { | |
| 94 | + $('.ul_li_input', cellWrap).remove(); | |
| 95 | + $('a[data-code]', cellWrap).show(); | |
| 96 | + }); | |
| 97 | + }; | |
| 98 | + | |
| 99 | + var getStationLI = function (s) { | |
| 100 | + return $('.up_down_route_list>li:eq('+s.directions+')>.station_route .s_r_item[data-code='+s.stationCode+']'); | |
| 101 | + }; | |
| 102 | + | |
| 103 | + var addPrevId;//添加站点路由的上一个站点ID | |
| 104 | + var insert_station_before = function (station) { | |
| 105 | + //在之前插入站点 | |
| 106 | + var cell = getStationLI(station); | |
| 107 | + | |
| 108 | + var addCell = $(temps['geo_d_e_add_station_panel-temp'](station)); | |
| 109 | + cell.before(addCell); | |
| 110 | + | |
| 111 | + add_station(addCell); | |
| 112 | + }; | |
| 113 | + | |
| 114 | + | |
| 115 | + //添加站点 取消按钮 | |
| 116 | + $(document).on('click', '.add_station_search_point_wrap button.cancel', function () { | |
| 117 | + $('.main_left_panel_m_layer').hide(); | |
| 118 | + $(this).parents('.buffer_edit_body').parent().remove(); | |
| 119 | + gb_ct_map.resetMapStatus(); | |
| 120 | + }); | |
| 121 | + | |
| 122 | + var add_station = function (addCell) { | |
| 123 | + gb_ct_map.closeInfoWin(); | |
| 124 | + //焦点 | |
| 125 | + var $nameInput = $('input[name=stationName]', addCell); | |
| 126 | + $nameInput.focus(); | |
| 127 | + //取消 | |
| 128 | + $('.cancel_icon_btn', addCell).on('click', function () { | |
| 129 | + addCell.remove(); | |
| 130 | + }); | |
| 131 | + | |
| 132 | + //选择地图位置 | |
| 133 | + $('.search_point_icon_btn', addCell).on('click', function () { | |
| 134 | + $('.station_li_transient').removeClass('_search_point'); | |
| 135 | + $(this).parents('.station_li_transient').addClass('_search_point'); | |
| 136 | + var name = $nameInput.val(); | |
| 137 | + if(!name) | |
| 138 | + return UIkit.notification("你必须输入站点名称!", {status: 'danger'}); | |
| 139 | + | |
| 140 | + if(is_duplication(name)) | |
| 141 | + return UIkit.notification("站点路由名称重复!!", {status: 'danger'}); | |
| 142 | + | |
| 143 | + debugger | |
| 144 | + //上一个站点的ID | |
| 145 | + var _cell = $(this).parents('.station_li_transient'); | |
| 146 | + var $prev = prevs(_cell, 's_r_item') | |
| 147 | + if($prev.length > 0) | |
| 148 | + addPrevId = $prev.data('id'); | |
| 149 | + else | |
| 150 | + addPrevId = -1; | |
| 151 | + | |
| 152 | + $('.main_left_panel_m_layer').show(); | |
| 153 | + gb_ct_map.showAddPointPanel(name); | |
| 154 | + | |
| 155 | + }); | |
| 156 | + //监听回车事件 | |
| 157 | + $('[name=stationName]', addCell).on('keydown', function (e) { | |
| 158 | + if(event.keyCode == "13") | |
| 159 | + $('.search_point_icon_btn', addCell).trigger('click'); | |
| 160 | + }); | |
| 161 | + }; | |
| 162 | + | |
| 163 | + var prevs = function (that, clazz) { | |
| 164 | + var prev; | |
| 165 | + while(true){ | |
| 166 | + prev = $(that).prev(); | |
| 167 | + | |
| 168 | + if(prev.length == 0) | |
| 169 | + return null; | |
| 170 | + | |
| 171 | + if(prev.hasClass(clazz)) | |
| 172 | + return prev; | |
| 173 | + | |
| 174 | + that = prev; | |
| 175 | + } | |
| 176 | + }; | |
| 177 | + | |
| 178 | + /** | |
| 179 | + * name 是否重复 | |
| 180 | + * @param name | |
| 181 | + */ | |
| 182 | + var is_duplication = function (name) { | |
| 183 | + var array = station_maps[getUpDown()]; | |
| 184 | + for(var i=0, s; s=array[i++];){ | |
| 185 | + if(s.stationName==$.trim(name)) | |
| 186 | + return true; | |
| 187 | + } | |
| 188 | + return false; | |
| 189 | + }; | |
| 190 | + | |
| 191 | + var insert_station_after = function (station) { | |
| 192 | + //在之后插入站点 | |
| 193 | + var cell = getStationLI(station); | |
| 194 | + | |
| 195 | + var addCell = $(temps['geo_d_e_add_station_panel-temp'](station)); | |
| 196 | + cell.after(addCell); | |
| 197 | + | |
| 198 | + add_station(addCell); | |
| 199 | + }; | |
| 200 | + | |
| 201 | + var realEditStation; | |
| 202 | + var callbackHandler = { | |
| 203 | + edit_buffer: function (station) { | |
| 204 | + gb_ct_map.editStationBuffer(station); | |
| 205 | + }, | |
| 206 | + edit_name: station_edit_name, | |
| 207 | + insert_before: insert_station_before, | |
| 208 | + insert_after: insert_station_after, | |
| 209 | + destroy: function (station) { | |
| 210 | + gb_data_submit.destroyStation(station); | |
| 211 | + } | |
| 212 | + }; | |
| 213 | + | |
| 214 | + $.contextMenu({ | |
| 215 | + selector: '._route_info_wrap .up_down_route_list .station_route>ul>li>a[data-code]', | |
| 216 | + className: 'station-route-ct-menu', | |
| 217 | + callback: function (key, options) { | |
| 218 | + var aLink = options.$trigger; | |
| 219 | + var code = aLink.data('code'), | |
| 220 | + updown = aLink.data('updown'); | |
| 221 | + var station = getStation(code, updown); | |
| 222 | + realEditStation = station; | |
| 223 | + callbackHandler[key] && callbackHandler[key](station); | |
| 224 | + }, | |
| 225 | + items: { | |
| 226 | + 'edit_buffer': { | |
| 227 | + name: '编辑缓冲区' | |
| 228 | + }, | |
| 229 | + 'sep1': '---------', | |
| 230 | + 'edit_name': { | |
| 231 | + name: '修改站点名称' | |
| 232 | + }, | |
| 233 | + 'insert_after': { | |
| 234 | + name: '新增站点(之后)' | |
| 235 | + }, | |
| 236 | + 'insert_before': { | |
| 237 | + name: '新增站点(之前)' | |
| 238 | + }, | |
| 239 | + 'destroy': { | |
| 240 | + name: '撤销站点' | |
| 241 | + } | |
| 242 | + } | |
| 243 | + }); | |
| 244 | + | |
| 245 | + var showEditPanel = function (s) { | |
| 246 | + var htmlStr = temps['geo_d_e_map_edit_buffer_panel-temp'](s); | |
| 247 | + $('.ct_page').append(htmlStr); | |
| 248 | + $('.buffer_edit_panel').show(); | |
| 249 | + | |
| 250 | + //缓冲区编辑 取消 | |
| 251 | + $('button.cancel', $editWrap).on('click', function (e) { | |
| 252 | + $('.main_left_panel_m_layer').hide(); | |
| 253 | + $(this).parents('.buffer_edit_body').parent().remove(); | |
| 254 | + gb_ct_map.resetMapStatus(); | |
| 255 | + | |
| 256 | + var f = $(this).parents('form'); | |
| 257 | + var data = f.serializeJSON(); | |
| 258 | + | |
| 259 | + gb_ct_map.exitEditBufferStatus(data); | |
| 260 | + }); | |
| 261 | + | |
| 262 | + var $editWrap = '.buffer_edit_panel>.buffer_edit_body'; | |
| 263 | + | |
| 264 | + //缓冲区编辑 切换缓冲区类型(圆形,多边形) | |
| 265 | + $('select[name=shapesType]', $editWrap).on('change', function (e) { | |
| 266 | + var v = $(this).val(); | |
| 267 | + if(v=='d'){ | |
| 268 | + $('.buffer_edit_panel .shapes_type').addClass('st_d'); | |
| 269 | + } | |
| 270 | + else{ | |
| 271 | + $('.buffer_edit_panel .shapes_type').removeClass('st_d'); | |
| 272 | + $('input[name=radius]', $editWrap).val(80); | |
| 273 | + } | |
| 274 | + gb_ct_map.changeShapeType(v); | |
| 275 | + }); | |
| 276 | + | |
| 277 | + //半径修改 | |
| 278 | + var update_radius_flag, update_radius; | |
| 279 | + $('input[name=radius]', $editWrap).on('input', function (e) { | |
| 280 | + update_radius = $(this).val(); | |
| 281 | + if(update_radius_flag){ | |
| 282 | + return; | |
| 283 | + } | |
| 284 | + update_radius_flag = true; | |
| 285 | + setTimeout(function () { | |
| 286 | + gb_ct_map.updateDragRadius(update_radius); | |
| 287 | + update_radius_flag = false; | |
| 288 | + }, 180); | |
| 289 | + }); | |
| 290 | + | |
| 291 | + //缓冲区编辑 切换绘制模式 | |
| 292 | + $('.draw_polygon_switch', $editWrap).on('input', function (e) { | |
| 293 | + var type = $(this).data('type'); | |
| 294 | + if(type==1){ | |
| 295 | + //退出绘制状态 | |
| 296 | + gb_ct_map.exitDrawStatus(); | |
| 297 | + $(this).data('type', 0).find('a').text('开始绘制'); | |
| 298 | + } | |
| 299 | + else if(type==0 || type==2){ | |
| 300 | + gb_ct_map.openDrawStatus(); | |
| 301 | + $(this).data('type', 1).find('a').text('暂停绘制'); | |
| 302 | + } | |
| 303 | + else if(type==3){ | |
| 304 | + gb_ct_map.changeShapeType('d'); | |
| 305 | + $(this).data('type', 1).find('a').text('暂停绘制'); | |
| 306 | + } | |
| 307 | + }); | |
| 308 | + }; | |
| 309 | + | |
| 310 | + /** | |
| 311 | + * 绘制结束 | |
| 312 | + */ | |
| 313 | + var drawEnd = function () { | |
| 314 | + $('.buffer_edit_panel>.buffer_edit_body .draw_polygon_switch').data('type', 2).find('a').text('重新绘制'); | |
| 315 | + }; | |
| 316 | + | |
| 317 | + var edPanelRunFlag; | |
| 318 | + var ecObj; | |
| 319 | + var reWriteEditPanel = function (ec, isPolygon) { | |
| 320 | + ecObj = ec; | |
| 321 | + if(edPanelRunFlag){ | |
| 322 | + return; | |
| 323 | + } | |
| 324 | + | |
| 325 | + edPanelRunFlag = true; | |
| 326 | + setTimeout(function () { | |
| 327 | + var panel = $('.buffer_edit_panel'); | |
| 328 | + var p; | |
| 329 | + if(!isPolygon){ | |
| 330 | + $('[name=radius]', panel).val(parseInt(ecObj.getRadius()));//半径 | |
| 331 | + p = ecObj.getCenter(); | |
| 332 | + }else{ | |
| 333 | + p = ecObj.point; | |
| 334 | + } | |
| 335 | + | |
| 336 | + $('[name=gLaty]', panel).val(p.lat); | |
| 337 | + $('[name=gLonx]', panel).val(p.lng); | |
| 338 | + edPanelRunFlag = false; | |
| 339 | + }, 200); | |
| 340 | + }; | |
| 341 | + | |
| 342 | + var update = function (s) { | |
| 343 | + var array = station_maps[s.directions]; | |
| 344 | + for(var i=0,item; item=array[i++];){ | |
| 345 | + if(item.stationCode==s.stationCode){ | |
| 346 | + s.index = i; | |
| 347 | + array.splice(i - 1, 1, s); | |
| 348 | + break; | |
| 349 | + } | |
| 350 | + } | |
| 351 | + | |
| 352 | + //替换 | |
| 353 | + var sCell = $(temps['geo_d_e_station_route_one-temp'](s)); | |
| 354 | + $('a.uk-animation-shake', sCell).on('webkitAnimationEnd', function () { | |
| 355 | + $(this).removeClass('uk-animation-shake'); | |
| 356 | + }); | |
| 357 | + getStationLI(s).replaceWith(sCell); | |
| 358 | + }; | |
| 359 | + | |
| 360 | + //取消按钮 | |
| 361 | +/* $(document).on('click','.buffer_edit_body button.cancel', function (e) { | |
| 362 | + $('.main_left_panel_m_layer').hide(); | |
| 363 | + $(this).parents('.buffer_edit_body').parent().remove(); | |
| 364 | + gb_ct_map.resetMapStatus(); | |
| 365 | + });*/ | |
| 366 | + | |
| 367 | + | |
| 368 | + var spcPanelRunFlag; | |
| 369 | + var spcPoint; | |
| 370 | + var reWriteSearchPointPanel = function (point) { | |
| 371 | + spcPoint = point; | |
| 372 | + if(spcPanelRunFlag){ | |
| 373 | + return; | |
| 374 | + } | |
| 375 | + | |
| 376 | + spcPanelRunFlag = true; | |
| 377 | + setTimeout(function () { | |
| 378 | + var panel = $('.add_station_search_point_wrap .buffer_edit_body'); | |
| 379 | + | |
| 380 | + $('[name=gLaty]', panel).val(spcPoint.lat); | |
| 381 | + $('[name=gLonx]', panel).val(spcPoint.lng); | |
| 382 | + spcPanelRunFlag = false; | |
| 383 | + }, 200); | |
| 384 | + }; | |
| 385 | + | |
| 386 | + var updateStationRouteData = function (list) { | |
| 387 | + list.sort(function (a, b) { | |
| 388 | + return parseInt(a.stationRouteCode) - parseInt(b.stationRouteCode); | |
| 389 | + }); | |
| 390 | + | |
| 391 | + var upDown = list[0].directions; | |
| 392 | + var dataMaps = {}; | |
| 393 | + //更新数据 | |
| 394 | + for(var i=0,s;s=list[i++];){ | |
| 395 | + s.index = i; | |
| 396 | + dataMaps[s.id] = s; | |
| 397 | + } | |
| 398 | + station_maps[upDown] = list; | |
| 399 | + //更新序号 | |
| 400 | + var wrap = $('.up_down_route_list>li:eq('+upDown+')>.station_route'); | |
| 401 | + $('.s_r_item', wrap).each(function () { | |
| 402 | + $(this).replaceWith( | |
| 403 | + temps['geo_d_e_station_route_one-temp'](dataMaps[$(this).data('id')])); | |
| 404 | + }); | |
| 405 | + | |
| 406 | + //延迟清除动画class | |
| 407 | + setTimeout(function () { | |
| 408 | + $('.s_r_item a.uk-animation-shake', wrap).removeClass('uk-animation-shake'); | |
| 409 | + }, 1000); | |
| 410 | + | |
| 411 | + //更新地图 | |
| 412 | + gb_ct_map.reDrawStation(upDown); | |
| 413 | + }; | |
| 414 | + | |
| 415 | + /** | |
| 416 | + * 添加结束,刷新List | |
| 417 | + * @param list | |
| 418 | + */ | |
| 419 | + var addEnd = function (list, _newRCode) { | |
| 420 | + updateStationRouteData(list); | |
| 421 | + | |
| 422 | + var upDown = list[0].directions; | |
| 423 | + var wrap = $('.up_down_route_list>li:eq('+upDown+')>.station_route'); | |
| 424 | + //新增的站点路由 | |
| 425 | + var ns = getStationByRouteCode(upDown, _newRCode); | |
| 426 | + $('.station_li_transient._search_point', wrap).replaceWith( | |
| 427 | + temps['geo_d_e_station_route_one-temp'](ns) | |
| 428 | + ); | |
| 429 | + | |
| 430 | + $('.main_left_panel_m_layer').hide(); | |
| 431 | + $('.add_station_search_point_wrap').remove(); | |
| 432 | + }; | |
| 433 | + | |
| 434 | + /** | |
| 435 | + * 撤销完成 | |
| 436 | + * @param list | |
| 437 | + */ | |
| 438 | + var destroyEnd = function (list, station) { | |
| 439 | + //被撤销的 | |
| 440 | + $('.up_down_route_list .s_r_item[data-id='+station.id+']').remove(); | |
| 441 | + updateStationRouteData(list); | |
| 442 | + }; | |
| 443 | + | |
| 444 | + var getStationByRouteCode = function (upDown, _newRCode) { | |
| 445 | + var list = station_maps[upDown]; | |
| 446 | + for(var i=0,s; s=list[i++];){ | |
| 447 | + if(s.stationRouteCode==_newRCode) | |
| 448 | + return s; | |
| 449 | + } | |
| 450 | + return null; | |
| 451 | + }; | |
| 452 | + | |
| 453 | + var getStationById = function (id) { | |
| 454 | + for(var i=0,s;s=station_maps[0][i++];){ | |
| 455 | + if(s.id == id) | |
| 456 | + return s; | |
| 457 | + } | |
| 458 | + for(var i=0,s;s=station_maps[1][i++];){ | |
| 459 | + if(s.id == id) | |
| 460 | + return s; | |
| 461 | + } | |
| 462 | + return null; | |
| 463 | + }; | |
| 464 | + | |
| 465 | + res_load_ep.emitLater('load_station_route'); | |
| 466 | + return { | |
| 467 | + init: init, | |
| 468 | + getData: function () { | |
| 469 | + return station_maps; | |
| 470 | + }, | |
| 471 | + getTemps: function () { | |
| 472 | + return temps; | |
| 473 | + }, | |
| 474 | + clearFocus: clearFocus, | |
| 475 | + focus: focus, | |
| 476 | + showEditPanel: showEditPanel, | |
| 477 | + reWriteEditPanel: reWriteEditPanel, | |
| 478 | + update: update, | |
| 479 | + drawEnd: drawEnd, | |
| 480 | + getRealEditStation: function () { | |
| 481 | + return realEditStation; | |
| 482 | + }, | |
| 483 | + reWriteSearchPointPanel: reWriteSearchPointPanel, | |
| 484 | + getAddPrevId: function () { | |
| 485 | + return addPrevId; | |
| 486 | + }, | |
| 487 | + addEnd: addEnd, | |
| 488 | + destroyEnd: destroyEnd, | |
| 489 | + getStationById:getStationById | |
| 490 | + }; | |
| 491 | 491 | }(); |
| 492 | 492 | \ No newline at end of file | ... | ... |
src/main/resources/static/pages/base/geo_data_edit/js/submit.js
| 1 | -/** | |
| 2 | - * 事件代理,提交数据 | |
| 3 | - */ | |
| 4 | -var gb_data_submit = function () { | |
| 5 | - | |
| 6 | - /** | |
| 7 | - * 缓冲区编辑提交 | |
| 8 | - */ | |
| 9 | - $(document).on('click', '.buffer_edit_panel>.buffer_edit_body button.submit', function (e) { | |
| 10 | - var f = $(this).parents('form'); | |
| 11 | - var data = f.serializeJSON(); | |
| 12 | - UIkit.modal.confirm('确定保存【'+data.stationName+'】的缓冲区信息?').then(function() { | |
| 13 | - if(data.shapesType=='d'){ | |
| 14 | - var polygon = gb_ct_map.getDrawPolygon(); | |
| 15 | - if(null == polygon){ | |
| 16 | - alert('失败,无法获取到 polygon..'); | |
| 17 | - return; | |
| 18 | - } | |
| 19 | - var pos = polygon.getPath(); | |
| 20 | - //闭合 | |
| 21 | - pos.push(pos[0]); | |
| 22 | - var gPolygonGrid = ''; | |
| 23 | - for(var i=0,p;p=pos[i++];){ | |
| 24 | - gPolygonGrid += (p.lng + " " + p.lat + ","); | |
| 25 | - } | |
| 26 | - data.gPolygonGrid = gPolygonGrid.substr(0, gPolygonGrid.length - 1); | |
| 27 | - } | |
| 28 | - | |
| 29 | - //gb_ct_map.removeDragMarkerEvent(); | |
| 30 | - show_run_text('正在提交缓冲区信息...'); | |
| 31 | - gb_common.$post('/_geo_data/updateBufferInfo', data, function (rs) { | |
| 32 | - hide_run_text(); | |
| 33 | - UIkit.notification("提交成功!", {status: 'success'}); | |
| 34 | - //更新前端数据 | |
| 35 | - gb_station_route.update(rs.station); | |
| 36 | - gb_ct_map.updateStation(rs.station); | |
| 37 | - | |
| 38 | - //退出编辑模式 | |
| 39 | - gb_ct_map.exitEditBufferStatus(rs.station); | |
| 40 | - }); | |
| 41 | - }); | |
| 42 | - return false; | |
| 43 | - }); | |
| 44 | - | |
| 45 | - /** | |
| 46 | - * 修改名称提交 | |
| 47 | - */ | |
| 48 | - $(document).on('click', '.up_down_route_list .station_route .ul_li_input .save_icon_btn', function (e) { | |
| 49 | - var f = $(this).parents('form'); | |
| 50 | - var data = f.serializeJSON(); | |
| 51 | - | |
| 52 | - UIkit.modal.confirm('确定将站点名称修改为【'+data.stationName+'】?').then(function() { | |
| 53 | - show_run_text('正在保存...'); | |
| 54 | - | |
| 55 | - gb_common.$post('/_geo_data/updateStationName', data, function (rs) { | |
| 56 | - hide_run_text(); | |
| 57 | - UIkit.notification("修改成功!", {status: 'success'}); | |
| 58 | - gb_station_route.update(rs.station); | |
| 59 | - }); | |
| 60 | - }); | |
| 61 | - }); | |
| 62 | - | |
| 63 | - /** | |
| 64 | - * 新增站点提交 | |
| 65 | - */ | |
| 66 | - $(document).on('click', '.add_station_search_point_wrap .buffer_edit_body button.submit', function (e) { | |
| 67 | - var f = $(this).parents('form'); | |
| 68 | - var data = f.serializeJSON(); | |
| 69 | - data.stationName = $.trim(data.stationName); | |
| 70 | - | |
| 71 | - UIkit.modal.confirm('确定新增站点【'+data.stationName+'】?').then(function() { | |
| 72 | - data.lineCode = storage.getItem('geo_data_edit_line_code'); | |
| 73 | - data.versions = storage.getItem('geo_data_edit_line_version'); | |
| 74 | - data.upDown = getUpDown(); | |
| 75 | - data.prevRouteId = gb_station_route.getAddPrevId(); | |
| 76 | - data.lng = data.gLonx; | |
| 77 | - data.lat = data.gLaty; | |
| 78 | - | |
| 79 | - delete data.gLonx; | |
| 80 | - delete data.gLaty; | |
| 81 | - show_run_text('正在提交数据...'); | |
| 82 | - //添加 | |
| 83 | - gb_common.$post('/_geo_data/addNewStationRoute', data, function (rs) { | |
| 84 | - gb_station_route.addEnd(rs.list, rs.newStationRouteCode); | |
| 85 | - | |
| 86 | - hide_run_text(); | |
| 87 | - UIkit.notification("修改成功!", {status: 'success'}); | |
| 88 | - }); | |
| 89 | - }); | |
| 90 | - return false; | |
| 91 | - }); | |
| 92 | - | |
| 93 | - /** | |
| 94 | - * 新增路段提交 | |
| 95 | - */ | |
| 96 | - $(document).on('click', '.add_road_search_point_wrap .buffer_edit_body button.submit', function (e) { | |
| 97 | - var f = $(this).parents('form'); | |
| 98 | - var data = f.serializeJSON(); | |
| 99 | - | |
| 100 | - UIkit.modal.confirm('确定新增路段【'+data.sectionName+'('+data.crosesRoad+')】?').then(function() { | |
| 101 | - data.lineCode = storage.getItem('geo_data_edit_line_code'); | |
| 102 | - data.versions = storage.getItem('geo_data_edit_line_version'); | |
| 103 | - data.upDown = getUpDown(); | |
| 104 | - | |
| 105 | - data.prevRouteId = gb_road_route.getAddPrevId(); | |
| 106 | - | |
| 107 | - var polyline = gb_ct_map.getDrawPolyline(); | |
| 108 | - var pos = polyline.getPath(); | |
| 109 | - var gsectionVector = ''; | |
| 110 | - for(var i=0,p;p=pos[i++];){ | |
| 111 | - gsectionVector += (p.lng + " " + p.lat + ","); | |
| 112 | - } | |
| 113 | - data.coords = gsectionVector.substr(0, gsectionVector.length - 1); | |
| 114 | - | |
| 115 | - show_run_text('正在提交数据...'); | |
| 116 | - //添加 | |
| 117 | - gb_common.$post('/_geo_data/addNewRoadRoute', data, function (rs) { | |
| 118 | - | |
| 119 | - gb_road_route.updateList(rs.list); | |
| 120 | - hide_run_text(); | |
| 121 | - UIkit.notification("添加成功!", {status: 'success'}); | |
| 122 | - $('.add_road_search_point_wrap').remove(); | |
| 123 | - gb_ct_map.exitEditRoadStatus(null, true); | |
| 124 | - }); | |
| 125 | - }); | |
| 126 | - return false; | |
| 127 | - }); | |
| 128 | - | |
| 129 | - /** | |
| 130 | - * 路段编辑提交 | |
| 131 | - */ | |
| 132 | - $(document).on('click', '.road_edit_panel .buffer_edit_body button.submit', function (e) { | |
| 133 | - var f = $(this).parents('form'); | |
| 134 | - var data = f.serializeJSON(); | |
| 135 | - | |
| 136 | - var polyline = gb_ct_map.getDrawPolyline(); | |
| 137 | - var pos = polyline.getPath(); | |
| 138 | - var gsectionVector = ''; | |
| 139 | - for(var i=0,p;p=pos[i++];){ | |
| 140 | - gsectionVector += (p.lng + " " + p.lat + ","); | |
| 141 | - } | |
| 142 | - data.gsectionVector = gsectionVector.substr(0, gsectionVector.length - 1); | |
| 143 | - | |
| 144 | - console.log('data', data); | |
| 145 | - UIkit.modal.confirm('确定保存编辑的【'+data.sectionName+'】?').then(function() { | |
| 146 | - show_run_text('正在保存...'); | |
| 147 | - | |
| 148 | - gb_common.$post('/_geo_data/updateRoadInfo', data, function (rs) { | |
| 149 | - hide_run_text(); | |
| 150 | - UIkit.notification("修改成功!", {status: 'success'}); | |
| 151 | - gb_road_route.update(rs.road); | |
| 152 | - | |
| 153 | - gb_ct_map.exitEditRoadStatus(rs.road); | |
| 154 | - }); | |
| 155 | - }); | |
| 156 | - }); | |
| 157 | - | |
| 158 | - var show_run_text = function (t) { | |
| 159 | - $('.text', $loadPanel).text(t); | |
| 160 | - $loadPanel.show(); | |
| 161 | - }; | |
| 162 | - | |
| 163 | - var hide_run_text = function () { | |
| 164 | - $('.text', $loadPanel).text(''); | |
| 165 | - $loadPanel.hide(); | |
| 166 | - }; | |
| 167 | - | |
| 168 | - /** | |
| 169 | - * 撤销站点 | |
| 170 | - * @param station | |
| 171 | - */ | |
| 172 | - var destroyStation = function (station) { | |
| 173 | - | |
| 174 | - UIkit.modal.confirm('确定撤销站点【'+station.stationName+'】?').then(function() { | |
| 175 | - show_run_text('正在撤销...'); | |
| 176 | - | |
| 177 | - gb_common.$post("/_geo_data/destroyStation", station, function (rs) { | |
| 178 | - gb_station_route.destroyEnd(rs.list, station); | |
| 179 | - hide_run_text(); | |
| 180 | - UIkit.notification("撤销成功!", {status: 'success'}); | |
| 181 | - }); | |
| 182 | - }); | |
| 183 | - } | |
| 184 | - | |
| 185 | - /** | |
| 186 | - * 撤销路段 | |
| 187 | - * @param road | |
| 188 | - */ | |
| 189 | - var destroyRoad = function (road) { | |
| 190 | - UIkit.modal.confirm('确定撤销路段【'+road.sectionName+'】?').then(function() { | |
| 191 | - show_run_text('正在撤销...'); | |
| 192 | - console.log('road', road); | |
| 193 | - | |
| 194 | - delete road.bdCoords; | |
| 195 | - delete road.cp; | |
| 196 | - gb_common.$post("/_geo_data/destroyRoad", road, function (rs) { | |
| 197 | - | |
| 198 | - gb_road_route.updateList(rs.list); | |
| 199 | - hide_run_text(); | |
| 200 | - UIkit.notification("撤销成功!", {status: 'success'}); | |
| 201 | - }); | |
| 202 | - }); | |
| 203 | - }; | |
| 204 | - | |
| 205 | - function getUpDown(){ | |
| 206 | - return $('._route_info_wrap>ul>li:first').hasClass('uk-active')?0:1; | |
| 207 | - } | |
| 208 | - return { | |
| 209 | - destroyStation: destroyStation, | |
| 210 | - destroyRoad: destroyRoad | |
| 211 | - }; | |
| 1 | +/** | |
| 2 | + * 事件代理,提交数据 | |
| 3 | + */ | |
| 4 | +var gb_data_submit = function () { | |
| 5 | + | |
| 6 | + /** | |
| 7 | + * 缓冲区编辑提交 | |
| 8 | + */ | |
| 9 | + $(document).on('click', '.buffer_edit_panel>.buffer_edit_body button.submit', function (e) { | |
| 10 | + var f = $(this).parents('form'); | |
| 11 | + var data = f.serializeJSON(); | |
| 12 | + UIkit.modal.confirm('确定保存【'+data.stationName+'】的缓冲区信息?').then(function() { | |
| 13 | + if(data.shapesType=='d'){ | |
| 14 | + var polygon = gb_ct_map.getDrawPolygon(); | |
| 15 | + if(null == polygon){ | |
| 16 | + alert('失败,无法获取到 polygon..'); | |
| 17 | + return; | |
| 18 | + } | |
| 19 | + var pos = polygon.getPath(); | |
| 20 | + //闭合 | |
| 21 | + pos.push(pos[0]); | |
| 22 | + var gPolygonGrid = ''; | |
| 23 | + for(var i=0,p;p=pos[i++];){ | |
| 24 | + gPolygonGrid += (p.lng + " " + p.lat + ","); | |
| 25 | + } | |
| 26 | + data.gPolygonGrid = gPolygonGrid.substr(0, gPolygonGrid.length - 1); | |
| 27 | + } | |
| 28 | + | |
| 29 | + //gb_ct_map.removeDragMarkerEvent(); | |
| 30 | + show_run_text('正在提交缓冲区信息...'); | |
| 31 | + gb_common.$post('/_geo_data/updateBufferInfo', data, function (rs) { | |
| 32 | + hide_run_text(); | |
| 33 | + UIkit.notification("提交成功!", {status: 'success'}); | |
| 34 | + //更新前端数据 | |
| 35 | + gb_station_route.update(rs.station); | |
| 36 | + gb_ct_map.updateStation(rs.station); | |
| 37 | + | |
| 38 | + //退出编辑模式 | |
| 39 | + gb_ct_map.exitEditBufferStatus(rs.station); | |
| 40 | + }); | |
| 41 | + }); | |
| 42 | + return false; | |
| 43 | + }); | |
| 44 | + | |
| 45 | + /** | |
| 46 | + * 修改名称提交 | |
| 47 | + */ | |
| 48 | + $(document).on('click', '.up_down_route_list .station_route .ul_li_input .save_icon_btn', function (e) { | |
| 49 | + var f = $(this).parents('form'); | |
| 50 | + var data = f.serializeJSON(); | |
| 51 | + | |
| 52 | + UIkit.modal.confirm('确定将站点名称修改为【'+data.stationName+'】?').then(function() { | |
| 53 | + show_run_text('正在保存...'); | |
| 54 | + | |
| 55 | + gb_common.$post('/_geo_data/updateStationName', data, function (rs) { | |
| 56 | + hide_run_text(); | |
| 57 | + UIkit.notification("修改成功!", {status: 'success'}); | |
| 58 | + gb_station_route.update(rs.station); | |
| 59 | + }); | |
| 60 | + }); | |
| 61 | + }); | |
| 62 | + | |
| 63 | + /** | |
| 64 | + * 新增站点提交 | |
| 65 | + */ | |
| 66 | + $(document).on('click', '.add_station_search_point_wrap .buffer_edit_body button.submit', function (e) { | |
| 67 | + var f = $(this).parents('form'); | |
| 68 | + var data = f.serializeJSON(); | |
| 69 | + data.stationName = $.trim(data.stationName); | |
| 70 | + | |
| 71 | + UIkit.modal.confirm('确定新增站点【'+data.stationName+'】?').then(function() { | |
| 72 | + data.lineCode = storage.getItem('geo_data_edit_line_code'); | |
| 73 | + data.versions = storage.getItem('geo_data_edit_line_version'); | |
| 74 | + data.upDown = getUpDown(); | |
| 75 | + data.prevRouteId = gb_station_route.getAddPrevId(); | |
| 76 | + data.lng = data.gLonx; | |
| 77 | + data.lat = data.gLaty; | |
| 78 | + | |
| 79 | + delete data.gLonx; | |
| 80 | + delete data.gLaty; | |
| 81 | + show_run_text('正在提交数据...'); | |
| 82 | + //添加 | |
| 83 | + gb_common.$post('/_geo_data/addNewStationRoute', data, function (rs) { | |
| 84 | + gb_station_route.addEnd(rs.list, rs.newStationRouteCode); | |
| 85 | + | |
| 86 | + hide_run_text(); | |
| 87 | + UIkit.notification("修改成功!", {status: 'success'}); | |
| 88 | + }); | |
| 89 | + }); | |
| 90 | + return false; | |
| 91 | + }); | |
| 92 | + | |
| 93 | + /** | |
| 94 | + * 新增路段提交 | |
| 95 | + */ | |
| 96 | + $(document).on('click', '.add_road_search_point_wrap .buffer_edit_body button.submit', function (e) { | |
| 97 | + var f = $(this).parents('form'); | |
| 98 | + var data = f.serializeJSON(); | |
| 99 | + | |
| 100 | + UIkit.modal.confirm('确定新增路段【'+data.sectionName+'('+data.crosesRoad+')】?').then(function() { | |
| 101 | + data.lineCode = storage.getItem('geo_data_edit_line_code'); | |
| 102 | + data.versions = storage.getItem('geo_data_edit_line_version'); | |
| 103 | + data.upDown = getUpDown(); | |
| 104 | + | |
| 105 | + data.prevRouteId = gb_road_route.getAddPrevId(); | |
| 106 | + | |
| 107 | + var polyline = gb_ct_map.getDrawPolyline(); | |
| 108 | + var pos = polyline.getPath(); | |
| 109 | + var gsectionVector = ''; | |
| 110 | + for(var i=0,p;p=pos[i++];){ | |
| 111 | + gsectionVector += (p.lng + " " + p.lat + ","); | |
| 112 | + } | |
| 113 | + data.coords = gsectionVector.substr(0, gsectionVector.length - 1); | |
| 114 | + | |
| 115 | + show_run_text('正在提交数据...'); | |
| 116 | + //添加 | |
| 117 | + gb_common.$post('/_geo_data/addNewRoadRoute', data, function (rs) { | |
| 118 | + | |
| 119 | + gb_road_route.updateList(rs.list); | |
| 120 | + hide_run_text(); | |
| 121 | + UIkit.notification("添加成功!", {status: 'success'}); | |
| 122 | + $('.add_road_search_point_wrap').remove(); | |
| 123 | + gb_ct_map.exitEditRoadStatus(null, true); | |
| 124 | + }); | |
| 125 | + }); | |
| 126 | + return false; | |
| 127 | + }); | |
| 128 | + | |
| 129 | + /** | |
| 130 | + * 路段编辑提交 | |
| 131 | + */ | |
| 132 | + $(document).on('click', '.road_edit_panel .buffer_edit_body button.submit', function (e) { | |
| 133 | + var f = $(this).parents('form'); | |
| 134 | + var data = f.serializeJSON(); | |
| 135 | + | |
| 136 | + var polyline = gb_ct_map.getDrawPolyline(); | |
| 137 | + var pos = polyline.getPath(); | |
| 138 | + var gsectionVector = ''; | |
| 139 | + for(var i=0,p;p=pos[i++];){ | |
| 140 | + gsectionVector += (p.lng + " " + p.lat + ","); | |
| 141 | + } | |
| 142 | + data.gsectionVector = gsectionVector.substr(0, gsectionVector.length - 1); | |
| 143 | + | |
| 144 | + console.log('data', data); | |
| 145 | + UIkit.modal.confirm('确定保存编辑的【'+data.sectionName+'】?').then(function() { | |
| 146 | + show_run_text('正在保存...'); | |
| 147 | + | |
| 148 | + gb_common.$post('/_geo_data/updateRoadInfo', data, function (rs) { | |
| 149 | + hide_run_text(); | |
| 150 | + UIkit.notification("修改成功!", {status: 'success'}); | |
| 151 | + gb_road_route.update(rs.road); | |
| 152 | + | |
| 153 | + gb_ct_map.exitEditRoadStatus(rs.road); | |
| 154 | + }); | |
| 155 | + }); | |
| 156 | + }); | |
| 157 | + | |
| 158 | + var show_run_text = function (t) { | |
| 159 | + $('.text', $loadPanel).text(t); | |
| 160 | + $loadPanel.show(); | |
| 161 | + }; | |
| 162 | + | |
| 163 | + var hide_run_text = function () { | |
| 164 | + $('.text', $loadPanel).text(''); | |
| 165 | + $loadPanel.hide(); | |
| 166 | + }; | |
| 167 | + | |
| 168 | + /** | |
| 169 | + * 撤销站点 | |
| 170 | + * @param station | |
| 171 | + */ | |
| 172 | + var destroyStation = function (station) { | |
| 173 | + | |
| 174 | + UIkit.modal.confirm('确定撤销站点【'+station.stationName+'】?').then(function() { | |
| 175 | + show_run_text('正在撤销...'); | |
| 176 | + | |
| 177 | + gb_common.$post("/_geo_data/destroyStation", station, function (rs) { | |
| 178 | + gb_station_route.destroyEnd(rs.list, station); | |
| 179 | + hide_run_text(); | |
| 180 | + UIkit.notification("撤销成功!", {status: 'success'}); | |
| 181 | + }); | |
| 182 | + }); | |
| 183 | + } | |
| 184 | + | |
| 185 | + /** | |
| 186 | + * 撤销路段 | |
| 187 | + * @param road | |
| 188 | + */ | |
| 189 | + var destroyRoad = function (road) { | |
| 190 | + UIkit.modal.confirm('确定撤销路段【'+road.sectionName+'】?').then(function() { | |
| 191 | + show_run_text('正在撤销...'); | |
| 192 | + console.log('road', road); | |
| 193 | + | |
| 194 | + delete road.bdCoords; | |
| 195 | + delete road.cp; | |
| 196 | + gb_common.$post("/_geo_data/destroyRoad", road, function (rs) { | |
| 197 | + | |
| 198 | + gb_road_route.updateList(rs.list); | |
| 199 | + hide_run_text(); | |
| 200 | + UIkit.notification("撤销成功!", {status: 'success'}); | |
| 201 | + }); | |
| 202 | + }); | |
| 203 | + }; | |
| 204 | + | |
| 205 | + function getUpDown(){ | |
| 206 | + return $('._route_info_wrap>ul>li:first').hasClass('uk-active')?0:1; | |
| 207 | + } | |
| 208 | + return { | |
| 209 | + destroyStation: destroyStation, | |
| 210 | + destroyRoad: destroyRoad | |
| 211 | + }; | |
| 212 | 212 | }(); |
| 213 | 213 | \ No newline at end of file | ... | ... |
src/main/resources/static/pages/scheduleApp/module/common/prj-common-globalservice.js
| ... | ... | @@ -727,6 +727,24 @@ angular.module('ScheduleApp').factory( |
| 727 | 727 | } |
| 728 | 728 | } |
| 729 | 729 | } |
| 730 | + ), | |
| 731 | + | |
| 732 | + versiondesc: $resource( | |
| 733 | + '/tic_ec/versiondesc/:lineId/:version', | |
| 734 | + {}, | |
| 735 | + { | |
| 736 | + do: { | |
| 737 | + method: 'GET', | |
| 738 | + transformResponse: function(rs) { | |
| 739 | + var dst = angular.fromJson(rs); | |
| 740 | + if (dst.status == 'SUCCESS') { | |
| 741 | + return dst.data; | |
| 742 | + } else { | |
| 743 | + return dst; // 业务错误留给控制器处理 | |
| 744 | + } | |
| 745 | + } | |
| 746 | + } | |
| 747 | + } | |
| 730 | 748 | ) |
| 731 | 749 | }; |
| 732 | 750 | ... | ... |
src/main/resources/static/pages/scheduleApp/module/common/prj-common-ui-route-state.js
| ... | ... | @@ -1207,7 +1207,7 @@ ScheduleApp.config([ |
| 1207 | 1207 | } |
| 1208 | 1208 | }) |
| 1209 | 1209 | .state("ttInfoDetailManage_edit3", { // 时刻表详细信息编辑 |
| 1210 | - url: '/ttInfoDetailManage_edit3/:xlid/:ttid/:xlname/:ttname/:rflag', | |
| 1210 | + url: '/ttInfoDetailManage_edit3/:xlid/:ttid/:xlname/:ttname/:rflag/:lineversion', | |
| 1211 | 1211 | views: { |
| 1212 | 1212 | "": {templateUrl: 'pages/scheduleApp/module/core/ttInfoManage/detailedit/edit3.html'} |
| 1213 | 1213 | }, |
| ... | ... | @@ -1225,7 +1225,7 @@ ScheduleApp.config([ |
| 1225 | 1225 | } |
| 1226 | 1226 | }) |
| 1227 | 1227 | .state("ttInfoDetailManage_detail_edit", { // 时刻表详细信息单元格编辑 |
| 1228 | - url: '/ttInfoDetailManage_detail_edit/:id/:xlid/:ttid/:xlname/:ttname/:rowindex/:colindex', | |
| 1228 | + url: '/ttInfoDetailManage_detail_edit/:id/:xlid/:ttid/:xlname/:ttname/:rowindex/:colindex/:lineversion', | |
| 1229 | 1229 | views: { |
| 1230 | 1230 | "": {templateUrl: 'pages/scheduleApp/module/core/ttInfoManage/detailedit/edit-detail.html'} |
| 1231 | 1231 | }, |
| ... | ... | @@ -1244,7 +1244,7 @@ ScheduleApp.config([ |
| 1244 | 1244 | } |
| 1245 | 1245 | }) |
| 1246 | 1246 | .state("ttInfoDetailManage_detail_edit2", { // 时刻表详细信息批量单元格修改 |
| 1247 | - url: '/ttInfoDetailManage_detail_edit/:xlid/:ttid/:xlname/:ttname', | |
| 1247 | + url: '/ttInfoDetailManage_detail_edit/:xlid/:ttid/:xlname/:ttname/:lineversion', | |
| 1248 | 1248 | views: { |
| 1249 | 1249 | "": {templateUrl: 'pages/scheduleApp/module/core/ttInfoManage/detailedit/edit-detail2.html'} |
| 1250 | 1250 | }, |
| ... | ... | @@ -1263,7 +1263,7 @@ ScheduleApp.config([ |
| 1263 | 1263 | } |
| 1264 | 1264 | }) |
| 1265 | 1265 | .state("ttInfoDetailManage_detail_edit_mulselect", { // 时刻表详细信息批量单元格修改 |
| 1266 | - url: '/ttInfoDetailManage_detail_edit_mulselect/:xlid/:ttid/:xlname/:ttname', | |
| 1266 | + url: '/ttInfoDetailManage_detail_edit_mulselect/:xlid/:ttid/:xlname/:ttname/:lineversion', | |
| 1267 | 1267 | views: { |
| 1268 | 1268 | "": {templateUrl: 'pages/scheduleApp/module/core/ttInfoManage/detailedit/edit-mulselect.html'} |
| 1269 | 1269 | }, | ... | ... |
src/main/resources/static/pages/scheduleApp/module/core/ttInfoManage/detailedit/edit-detail.html
| ... | ... | @@ -30,8 +30,14 @@ |
| 30 | 30 | <div class="portlet light bordered"> |
| 31 | 31 | <div class="portlet-title"> |
| 32 | 32 | <div class="caption"> |
| 33 | - <i class="icon-equalizer font-red-sunglo"></i> <span | |
| 34 | - class="caption-subject font-red-sunglo bold uppercase" ng-bind="ctrl.title2"></span> | |
| 33 | + <div> | |
| 34 | + <i class="icon-equalizer font-red-sunglo"></i> | |
| 35 | + <span class="caption-subject font-red-sunglo bold uppercase" ng-bind="ctrl.title2"></span> | |
| 36 | + </div> | |
| 37 | + <div style="padding-top: 10px;"> | |
| 38 | + <i class="icon-equalizer font-red-sunglo"></i> | |
| 39 | + <span class="caption-subject font-red-sunglo bold uppercase" ng-bind="ctrl.title_tip"></span> | |
| 40 | + </div> | |
| 35 | 41 | </div> |
| 36 | 42 | </div> |
| 37 | 43 | |
| ... | ... | @@ -93,7 +99,7 @@ |
| 93 | 99 | cmaps="{'qdzCode' : 'zcode', 'qdzName': 'zname'}" |
| 94 | 100 | dcname="qdzCode" |
| 95 | 101 | icname="zcode" |
| 96 | - dsparams="{{ {type: 'ajax', param:{'lineid': ctrl.TimeTableDetailForSave.xl.id, 'xldir': ctrl.TimeTableDetailForSave.xlDir}, atype:'zd_tcc' } | json }}" | |
| 102 | + dsparams="{{ {type: 'ajax', param: {'lineid': ctrl.TimeTableDetailForSave.xl.id, 'xldir': ctrl.TimeTableDetailForSave.xlDir, 'lineversion': ctrl.TimeTableDetailForSave.lineVersion}, atype:'zd_tcc' } | json }}" | |
| 97 | 103 | iterobjname="item" |
| 98 | 104 | iterobjexp="item.aname" |
| 99 | 105 | searchph="请输拼音..." |
| ... | ... | @@ -114,7 +120,7 @@ |
| 114 | 120 | cmaps="{'zdzCode' : 'zcode', 'zdzName': 'zname'}" |
| 115 | 121 | dcname="zdzCode" |
| 116 | 122 | icname="zcode" |
| 117 | - dsparams="{{ {type: 'ajax', param:{'lineid': ctrl.TimeTableDetailForSave.xl.id, 'xldir': ctrl.TimeTableDetailForSave.xlDir}, atype:'zd_tcc' } | json }}" | |
| 123 | + dsparams="{{ {type: 'ajax', param:{'lineid': ctrl.TimeTableDetailForSave.xl.id, 'xldir': ctrl.TimeTableDetailForSave.xlDir, 'lineversion': ctrl.TimeTableDetailForSave.lineVersion}, atype:'zd_tcc' } | json }}" | |
| 118 | 124 | iterobjname="item" |
| 119 | 125 | iterobjexp="item.aname" |
| 120 | 126 | searchph="请输拼音..." |
| ... | ... | @@ -244,7 +250,7 @@ |
| 244 | 250 | <button type="submit" class="btn green" |
| 245 | 251 | ng-disabled="!myForm.$valid"><i class="fa fa-check"></i> 提交</button> |
| 246 | 252 | <a type="button" class="btn default" |
| 247 | - ui-sref="ttInfoDetailManage_edit3({xlid: ctrl.xlid, ttid : ctrl.ttid, xlname: ctrl.xlname, ttname : ctrl.ttname})" ><i class="fa fa-times"></i> 取消</a> | |
| 253 | + ui-sref="ttInfoDetailManage_edit3({xlid: ctrl.xlid, ttid : ctrl.ttid, xlname: ctrl.xlname, ttname : ctrl.ttname, lineversion : ctrl.lineversion})" ><i class="fa fa-times"></i> 取消</a> | |
| 248 | 254 | </div> |
| 249 | 255 | </div> |
| 250 | 256 | </div> | ... | ... |
src/main/resources/static/pages/scheduleApp/module/core/ttInfoManage/detailedit/edit-detail2.html
| ... | ... | @@ -30,8 +30,14 @@ |
| 30 | 30 | <div class="portlet light bordered"> |
| 31 | 31 | <div class="portlet-title"> |
| 32 | 32 | <div class="caption"> |
| 33 | - <i class="icon-equalizer font-red-sunglo"></i> <span | |
| 34 | - class="caption-subject font-red-sunglo bold uppercase" ng-bind="ctrl.title1"></span> | |
| 33 | + <div> | |
| 34 | + <i class="icon-equalizer font-red-sunglo"></i> | |
| 35 | + <span class="caption-subject font-red-sunglo bold uppercase" ng-bind="ctrl.title1"></span> | |
| 36 | + </div> | |
| 37 | + <div style="padding-top: 10px;"> | |
| 38 | + <i class="icon-equalizer font-red-sunglo"></i> | |
| 39 | + <span class="caption-subject font-red-sunglo bold uppercase" ng-bind="ctrl.title_tip"></span> | |
| 40 | + </div> | |
| 35 | 41 | </div> |
| 36 | 42 | </div> |
| 37 | 43 | |
| ... | ... | @@ -74,7 +80,7 @@ |
| 74 | 80 | cmaps="{'qdzCode' : 'zcode', 'qdzName': 'zname'}" |
| 75 | 81 | dcname="qdzCode" |
| 76 | 82 | icname="zcode" |
| 77 | - dsparams="{{ {type: 'ajax', param:{'lineid': ctrl.xlid, 'xldir': ctrl.tt.xlDir}, atype:'zd_tcc' } | json }}" | |
| 83 | + dsparams="{{ {type: 'ajax', param:{'lineid': ctrl.xlid, 'xldir': ctrl.tt.xlDir, 'lineversion': ctrl.lineversion}, atype:'zd_tcc' } | json }}" | |
| 78 | 84 | iterobjname="item" |
| 79 | 85 | iterobjexp="item.aname" |
| 80 | 86 | searchph="请输拼音..." |
| ... | ... | @@ -91,7 +97,7 @@ |
| 91 | 97 | cmaps="{'zdzCode' : 'zcode', 'zdzName': 'zname'}" |
| 92 | 98 | dcname="zdzCode" |
| 93 | 99 | icname="zcode" |
| 94 | - dsparams="{{ {type: 'ajax', param:{'lineid': ctrl.xlid, 'xldir': ctrl.tt.xlDir}, atype:'zd_tcc' } | json }}" | |
| 100 | + dsparams="{{ {type: 'ajax', param:{'lineid': ctrl.xlid, 'xldir': ctrl.tt.xlDir, 'lineversion': ctrl.lineversion}, atype:'zd_tcc' } | json }}" | |
| 95 | 101 | iterobjname="item" |
| 96 | 102 | iterobjexp="item.aname" |
| 97 | 103 | searchph="请输拼音..." |
| ... | ... | @@ -198,7 +204,7 @@ |
| 198 | 204 | <button type="submit" class="btn green" |
| 199 | 205 | ng-disabled="!myForm.$valid"><i class="fa fa-check"></i> 提交</button> |
| 200 | 206 | <a type="button" class="btn default" |
| 201 | - ui-sref="ttInfoDetailManage_edit3({xlid: ctrl.xlid, ttid : ctrl.ttid, xlname: ctrl.xlname, ttname : ctrl.ttname})" ><i class="fa fa-times"></i> 取消</a> | |
| 207 | + ui-sref="ttInfoDetailManage_edit3({xlid: ctrl.xlid, ttid : ctrl.ttid, xlname: ctrl.xlname, ttname : ctrl.ttname, lineversion : ctrl.lineversion})" ><i class="fa fa-times"></i> 取消</a> | |
| 202 | 208 | </div> |
| 203 | 209 | </div> |
| 204 | 210 | </div> | ... | ... |
src/main/resources/static/pages/scheduleApp/module/core/ttInfoManage/detailedit/edit-mulselect.html
| ... | ... | @@ -90,7 +90,7 @@ |
| 90 | 90 | <button type="submit" class="btn green" |
| 91 | 91 | ng-disabled="!myForm.$valid"><i class="fa fa-check"></i> 提交</button> |
| 92 | 92 | <a type="button" class="btn default" |
| 93 | - ui-sref="ttInfoDetailManage_edit3({xlid: ctrl.xlid, ttid : ctrl.ttid, xlname: ctrl.xlname, ttname : ctrl.ttname})" ><i class="fa fa-times"></i> 取消</a> | |
| 93 | + ui-sref="ttInfoDetailManage_edit3({xlid: ctrl.xlid, ttid : ctrl.ttid, xlname: ctrl.xlname, ttname : ctrl.ttname, lineversion : ctrl.lineversion})" ><i class="fa fa-times"></i> 取消</a> | |
| 94 | 94 | </div> |
| 95 | 95 | </div> |
| 96 | 96 | </div> | ... | ... |
src/main/resources/static/pages/scheduleApp/module/core/ttInfoManage/detailedit/edit3.html
| ... | ... | @@ -29,6 +29,7 @@ |
| 29 | 29 | <div class="caption font-dark"> |
| 30 | 30 | <i class="fa fa-database font-dark"></i> |
| 31 | 31 | <span class="caption-subject bold uppercase" ng-bind="ctrl.title"></span> |
| 32 | + <span class="caption-subject bold uppercase" ng-bind="ctrl.title2"></span> | |
| 32 | 33 | </div> |
| 33 | 34 | <div class="actions"> |
| 34 | 35 | <!--<i class="fa fa-arrow-up" aria-hidden="true"></i>--> | ... | ... |
src/main/resources/static/pages/scheduleApp/module/core/ttInfoManage/detailedit/route.js
| ... | ... | @@ -64,7 +64,7 @@ ScheduleApp.config([ |
| 64 | 64 | } |
| 65 | 65 | }) |
| 66 | 66 | .state("ttInfoDetailManage_edit3", { // 时刻表详细信息编辑 |
| 67 | - url: '/ttInfoDetailManage_edit3/:xlid/:ttid/:xlname/:ttname/:rflag', | |
| 67 | + url: '/ttInfoDetailManage_edit3/:xlid/:ttid/:xlname/:ttname/:rflag/:lineversion', | |
| 68 | 68 | views: { |
| 69 | 69 | "": {templateUrl: 'pages/scheduleApp/module/core/ttInfoManage/detailedit/edit3.html'} |
| 70 | 70 | }, |
| ... | ... | @@ -82,7 +82,7 @@ ScheduleApp.config([ |
| 82 | 82 | } |
| 83 | 83 | }) |
| 84 | 84 | .state("ttInfoDetailManage_detail_edit", { // 时刻表详细信息单元格编辑 |
| 85 | - url: '/ttInfoDetailManage_detail_edit/:id/:xlid/:ttid/:xlname/:ttname/:rowindex/:colindex', | |
| 85 | + url: '/ttInfoDetailManage_detail_edit/:id/:xlid/:ttid/:xlname/:ttname/:rowindex/:colindex/:lineversion', | |
| 86 | 86 | views: { |
| 87 | 87 | "": {templateUrl: 'pages/scheduleApp/module/core/ttInfoManage/detailedit/edit-detail.html'} |
| 88 | 88 | }, |
| ... | ... | @@ -101,7 +101,7 @@ ScheduleApp.config([ |
| 101 | 101 | } |
| 102 | 102 | }) |
| 103 | 103 | .state("ttInfoDetailManage_detail_edit2", { // 时刻表详细信息批量单元格修改 |
| 104 | - url: '/ttInfoDetailManage_detail_edit/:xlid/:ttid/:xlname/:ttname', | |
| 104 | + url: '/ttInfoDetailManage_detail_edit/:xlid/:ttid/:xlname/:ttname/:lineversion', | |
| 105 | 105 | views: { |
| 106 | 106 | "": {templateUrl: 'pages/scheduleApp/module/core/ttInfoManage/detailedit/edit-detail2.html'} |
| 107 | 107 | }, |
| ... | ... | @@ -120,7 +120,7 @@ ScheduleApp.config([ |
| 120 | 120 | } |
| 121 | 121 | }) |
| 122 | 122 | .state("ttInfoDetailManage_detail_edit_mulselect", { // 时刻表详细信息批量单元格修改 |
| 123 | - url: '/ttInfoDetailManage_detail_edit_mulselect/:xlid/:ttid/:xlname/:ttname', | |
| 123 | + url: '/ttInfoDetailManage_detail_edit_mulselect/:xlid/:ttid/:xlname/:ttname/:lineversion', | |
| 124 | 124 | views: { |
| 125 | 125 | "": {templateUrl: 'pages/scheduleApp/module/core/ttInfoManage/detailedit/edit-mulselect.html'} |
| 126 | 126 | }, | ... | ... |
src/main/resources/static/pages/scheduleApp/module/core/ttInfoManage/detailedit/timeTableDetailManage_old.js
| ... | ... | @@ -3,10 +3,11 @@ angular.module('ScheduleApp').factory( |
| 3 | 3 | 'TimeTableDetailManageService_old', |
| 4 | 4 | [ |
| 5 | 5 | 'TimeTableDetailManageService_g', |
| 6 | + 'TTInfoManageService_g', | |
| 6 | 7 | '$state', |
| 7 | 8 | '$q', |
| 8 | 9 | 'SaTimeTableUtils', |
| 9 | - function(service, $state, $q, SaTimeTableUtils) { | |
| 10 | + function(service, service2, $state, $q, SaTimeTableUtils) { | |
| 10 | 11 | |
| 11 | 12 | // 查询对象类 |
| 12 | 13 | var queryClass = service.rest; |
| ... | ... | @@ -206,8 +207,20 @@ angular.module('ScheduleApp').factory( |
| 206 | 207 | } |
| 207 | 208 | |
| 208 | 209 | return deferred.promise; |
| 209 | - } | |
| 210 | + }, | |
| 210 | 211 | |
| 212 | + /** | |
| 213 | + * 获取线路版本描述。 | |
| 214 | + * @param lineId | |
| 215 | + * @param version | |
| 216 | + * @returns {*|Function|promise|n} | |
| 217 | + */ | |
| 218 | + versiondesc: function(lineId, version) { | |
| 219 | + var param = {}; | |
| 220 | + param.lineId = lineId; | |
| 221 | + param.version = version; | |
| 222 | + return service2.versiondesc.do(param).$promise; | |
| 223 | + } | |
| 211 | 224 | |
| 212 | 225 | }; |
| 213 | 226 | } |
| ... | ... | @@ -215,7 +228,7 @@ angular.module('ScheduleApp').factory( |
| 215 | 228 | ] |
| 216 | 229 | ); |
| 217 | 230 | |
| 218 | -// edit.html 时刻表编辑界面 | |
| 231 | +// edit.html 时刻表表格编辑界面 | |
| 219 | 232 | angular.module('ScheduleApp').controller( |
| 220 | 233 | 'TimeTableDetailManageCtrl_old', |
| 221 | 234 | [ |
| ... | ... | @@ -232,8 +245,17 @@ angular.module('ScheduleApp').controller( |
| 232 | 245 | self.xlname = $stateParams.xlname; // 获取传过来的线路名字 |
| 233 | 246 | self.ttname = $stateParams.ttname; // 获取传过来的时刻表名字 |
| 234 | 247 | self.rflag = $stateParams.rflag; // 刷新标志 |
| 248 | + self.lineversion = $stateParams.lineversion; // 线路版本 | |
| 235 | 249 | |
| 236 | 250 | self.title = self.xlname + "(" + self.ttname + ")" + "时刻表明细信息"; |
| 251 | + self.title2 = "--->版本加载中..."; | |
| 252 | + service.versiondesc(self.xlid, self.lineversion).then( | |
| 253 | + function(result) { | |
| 254 | + self.title2 = "--->线路版本(" + result.desc + ")"; | |
| 255 | + } | |
| 256 | + ); | |
| 257 | + | |
| 258 | + // TODO:线路版本 | |
| 237 | 259 | |
| 238 | 260 | // 获取时刻表明细数据(内部保存) |
| 239 | 261 | self.getDetailHeads = function() { |
| ... | ... | @@ -304,7 +326,8 @@ angular.module('ScheduleApp').controller( |
| 304 | 326 | xlname: self.xlname, |
| 305 | 327 | ttname: self.ttname, |
| 306 | 328 | rowindex: r, |
| 307 | - colindex: c | |
| 329 | + colindex: c, | |
| 330 | + lineversion: self.lineversion | |
| 308 | 331 | } |
| 309 | 332 | ); |
| 310 | 333 | }; |
| ... | ... | @@ -313,13 +336,13 @@ angular.module('ScheduleApp').controller( |
| 313 | 336 | self.editInfos = function() { |
| 314 | 337 | if (!service.editIsSel()) { |
| 315 | 338 | alert("请选择班次信息"); |
| 316 | - return; | |
| 317 | 339 | } else { |
| 318 | 340 | $state.go("ttInfoDetailManage_detail_edit2", { |
| 319 | 341 | xlid: self.xlid, |
| 320 | 342 | ttid: self.ttid, |
| 321 | 343 | xlname: self.xlname, |
| 322 | - ttname: self.ttname | |
| 344 | + ttname: self.ttname, | |
| 345 | + lineversion: self.lineversion | |
| 323 | 346 | }); |
| 324 | 347 | } |
| 325 | 348 | |
| ... | ... | @@ -331,7 +354,8 @@ angular.module('ScheduleApp').controller( |
| 331 | 354 | xlid: self.xlid, |
| 332 | 355 | ttid: self.ttid, |
| 333 | 356 | xlname: self.xlname, |
| 334 | - ttname: self.ttname | |
| 357 | + ttname: self.ttname, | |
| 358 | + lineversion: self.lineversion | |
| 335 | 359 | }); |
| 336 | 360 | }; |
| 337 | 361 | |
| ... | ... | @@ -346,7 +370,8 @@ angular.module('ScheduleApp').controller( |
| 346 | 370 | xlid: self.xlid, |
| 347 | 371 | ttid: self.ttid, |
| 348 | 372 | xlname: self.xlname, |
| 349 | - ttname: self.ttname | |
| 373 | + ttname: self.ttname, | |
| 374 | + lineversion: self.lineversion | |
| 350 | 375 | }); |
| 351 | 376 | }, function() { |
| 352 | 377 | alert("批量删除失败!"); |
| ... | ... | @@ -354,7 +379,8 @@ angular.module('ScheduleApp').controller( |
| 354 | 379 | xlid: self.xlid, |
| 355 | 380 | ttid: self.ttid, |
| 356 | 381 | xlname: self.xlname, |
| 357 | - ttname: self.ttname | |
| 382 | + ttname: self.ttname, | |
| 383 | + lineversion: self.lineversion | |
| 358 | 384 | }); |
| 359 | 385 | }); |
| 360 | 386 | }; |
| ... | ... | @@ -467,8 +493,15 @@ angular.module('ScheduleApp').controller( |
| 467 | 493 | self.ttname = $stateParams.ttname; // 获取传过来的时刻表名字 |
| 468 | 494 | self.rowindex = $stateParams.rowindex; // 修改的第几行 |
| 469 | 495 | self.colindex = $stateParams.colindex; // 修改的第几列 |
| 496 | + self.lineversion = $stateParams.lineversion; // 线路版本 | |
| 470 | 497 | |
| 471 | 498 | self.title1 = self.xlname + "(" + self.ttname + ")" + "时刻表明细信息"; |
| 499 | + self.title_tip = "版本加载中..."; | |
| 500 | + service.versiondesc(self.xlid, self.lineversion).then( | |
| 501 | + function(result) { | |
| 502 | + self.title_tip = "线路版本(" + result.desc + ")"; | |
| 503 | + } | |
| 504 | + ); | |
| 472 | 505 | |
| 473 | 506 | if (id) { |
| 474 | 507 | TTInfoDetail.get({id: id}, function(value) { |
| ... | ... | @@ -491,6 +524,7 @@ angular.module('ScheduleApp').controller( |
| 491 | 524 | self.ttname |
| 492 | 525 | ); |
| 493 | 526 | |
| 527 | + self.TimeTableDetailForSave.lineVersion = self.lineversion; | |
| 494 | 528 | self.TimeTableDetailForSave.isTS = 0; |
| 495 | 529 | self.title2 = |
| 496 | 530 | self.xlname + "(" + self.ttname + ")" + "时刻表明细信息" + |
| ... | ... | @@ -531,7 +565,8 @@ angular.module('ScheduleApp').controller( |
| 531 | 565 | xlid: self.xlid, |
| 532 | 566 | ttid: self.ttid, |
| 533 | 567 | xlname: self.xlname, |
| 534 | - ttname: self.ttname | |
| 568 | + ttname: self.ttname, | |
| 569 | + lineversion: self.lineversion | |
| 535 | 570 | }); |
| 536 | 571 | }); |
| 537 | 572 | |
| ... | ... | @@ -555,8 +590,15 @@ angular.module('ScheduleApp').controller( |
| 555 | 590 | self.ttid = $stateParams.ttid; // 获取传过来的时刻表id |
| 556 | 591 | self.xlname = $stateParams.xlname; // 获取传过来的线路名字 |
| 557 | 592 | self.ttname = $stateParams.ttname; // 获取传过来的时刻表名字 |
| 593 | + self.lineversion = $stateParams.lineversion; // 线路版本 | |
| 558 | 594 | |
| 559 | 595 | self.title1 = self.xlname + "(" + self.ttname + ")" + "时刻表明细信息 批量修改班次信息"; |
| 596 | + self.title_tip = "版本加载中..."; | |
| 597 | + service.versiondesc(self.xlid, self.lineversion).then( | |
| 598 | + function(result) { | |
| 599 | + self.title_tip = "线路版本(" + result.desc + ")"; | |
| 600 | + } | |
| 601 | + ); | |
| 560 | 602 | |
| 561 | 603 | //var TTInfoDetail = service.getQueryClass(); |
| 562 | 604 | |
| ... | ... | @@ -663,7 +705,8 @@ angular.module('ScheduleApp').controller( |
| 663 | 705 | xlid: self.xlid, |
| 664 | 706 | ttid: self.ttid, |
| 665 | 707 | xlname: self.xlname, |
| 666 | - ttname: self.ttname | |
| 708 | + ttname: self.ttname, | |
| 709 | + lineversion: self.lineversion | |
| 667 | 710 | }); |
| 668 | 711 | }, function() { |
| 669 | 712 | alert("批量更新失败!"); |
| ... | ... | @@ -671,7 +714,8 @@ angular.module('ScheduleApp').controller( |
| 671 | 714 | xlid: self.xlid, |
| 672 | 715 | ttid: self.ttid, |
| 673 | 716 | xlname: self.xlname, |
| 674 | - ttname: self.ttname | |
| 717 | + ttname: self.ttname, | |
| 718 | + lineversion: self.lineversion | |
| 675 | 719 | }); |
| 676 | 720 | }); |
| 677 | 721 | |
| ... | ... | @@ -681,7 +725,7 @@ angular.module('ScheduleApp').controller( |
| 681 | 725 | ] |
| 682 | 726 | ); |
| 683 | 727 | |
| 684 | -// edit-mulselect.html 具体班次明细修改页面 | |
| 728 | +// edit-mulselect.html 班次批量选择页面 | |
| 685 | 729 | angular.module('ScheduleApp').controller( |
| 686 | 730 | 'TimeTableDetailManageFormCtrl_mulselect', |
| 687 | 731 | [ |
| ... | ... | @@ -696,6 +740,7 @@ angular.module('ScheduleApp').controller( |
| 696 | 740 | self.ttid = $stateParams.ttid; // 获取传过来的时刻表id |
| 697 | 741 | self.xlname = $stateParams.xlname; // 获取传过来的线路名字 |
| 698 | 742 | self.ttname = $stateParams.ttname; // 获取传过来的时刻表名字 |
| 743 | + self.lineversion = $stateParams.lineversion; // 线路版本 | |
| 699 | 744 | |
| 700 | 745 | self.title1 = self.xlname + "(" + self.ttname + ")" + "时刻表明细信息"; |
| 701 | 746 | |
| ... | ... | @@ -744,7 +789,8 @@ angular.module('ScheduleApp').controller( |
| 744 | 789 | xlid: self.xlid, |
| 745 | 790 | ttid: self.ttid, |
| 746 | 791 | xlname: self.xlname, |
| 747 | - ttname: self.ttname | |
| 792 | + ttname: self.ttname, | |
| 793 | + lineversion: self.lineversion | |
| 748 | 794 | }); |
| 749 | 795 | |
| 750 | 796 | }; | ... | ... |
src/main/resources/static/pages/scheduleApp/module/core/ttInfoManage/list.html
| ... | ... | @@ -9,7 +9,7 @@ |
| 9 | 9 | <th style="width: 180px;">时刻表名称</th> |
| 10 | 10 | <th style="width: 80px">上下行</th> |
| 11 | 11 | <th style="width: 50px;">启用</th> |
| 12 | - <th style="width: 120px">启用/备份日期</th> | |
| 12 | + <th style="width: 130px">操作日期</th> | |
| 13 | 13 | <th style="width: 80px">状态</th> |
| 14 | 14 | <th style="width: 60%">时刻表明细</th> |
| 15 | 15 | <th style="width: 40%">操作</th> |
| ... | ... | @@ -69,7 +69,25 @@ |
| 69 | 69 | </div> |
| 70 | 70 | </td> |
| 71 | 71 | <td> |
| 72 | - <span ng-bind="info.xl.name"></span> | |
| 72 | + <div> | |
| 73 | + <a href="#"> | |
| 74 | + <span ng-bind="info.xl.name"></span> | |
| 75 | + </a> | |
| 76 | + </div> | |
| 77 | + <div> | |
| 78 | + <a href="#" | |
| 79 | + ng-mouseenter="ctrl.getLineVersionTip(info)" | |
| 80 | + tooltip-animation="false" | |
| 81 | + tooltip-placement="top" | |
| 82 | + uib-tooltip="{{ctrl.lineVersionTip}}" | |
| 83 | + tooltip-class="headClass"> | |
| 84 | + | |
| 85 | + <span ng-bind="'线路版本:' + info.lineVersion"></span> | |
| 86 | + </a> | |
| 87 | + | |
| 88 | + </div> | |
| 89 | + | |
| 90 | + | |
| 73 | 91 | </td> |
| 74 | 92 | <td> |
| 75 | 93 | <div> |
| ... | ... | @@ -90,23 +108,62 @@ |
| 90 | 108 | </td> |
| 91 | 109 | <td> |
| 92 | 110 | <div> |
| 93 | - <a href="#"> | |
| 94 | - <span ng-bind="info.qyrq | date: 'yyyy-MM-dd'"></span> | |
| 111 | + <a href="#" | |
| 112 | + tooltip-animation="false" | |
| 113 | + tooltip-placement="top" | |
| 114 | + uib-tooltip="启用时间:{{info.qyrq | date: 'yyyy-MM-dd HH:mm:ss' }}" | |
| 115 | + tooltip-class="headClass"> | |
| 116 | + 启用 | |
| 117 | + <span ng-bind="(info.qyrq | date: 'yyyy-MM-dd')"></span> | |
| 95 | 118 | </a> |
| 96 | 119 | </div> |
| 120 | + | |
| 97 | 121 | <div> |
| 98 | 122 | <a href="#" |
| 99 | 123 | tooltip-animation="false" |
| 100 | 124 | tooltip-placement="top" |
| 101 | 125 | uib-tooltip="备份时间:{{info.lastBackUpDate | date: 'yyyy-MM-dd HH:mm:ss' }}" |
| 102 | 126 | tooltip-class="headClass"> |
| 127 | + 备份 | |
| 128 | + <span ng-bind="(info.lastBackUpDate | date: 'yyyy-MM-dd')"></span> | |
| 129 | + </a> | |
| 130 | + </div> | |
| 103 | 131 | |
| 104 | - <i class="fa fa-hdd-o" aria-hidden="true"></i> | |
| 105 | - <span ng-bind="info.lastBackUpDate | date: 'yyyy-MM-dd'"></span> | |
| 132 | + <div> | |
| 133 | + <a href="#" | |
| 134 | + tooltip-animation="false" | |
| 135 | + tooltip-placement="top" | |
| 136 | + uib-tooltip="创建时间:{{info.createDate | date: 'yyyy-MM-dd HH:mm:ss' }}" | |
| 137 | + tooltip-class="headClass"> | |
| 138 | + 创建 | |
| 139 | + <span ng-bind="(info.createDate | date: 'yyyy-MM-dd')"></span> | |
| 106 | 140 | </a> |
| 141 | + </div> | |
| 107 | 142 | |
| 143 | + <div> | |
| 144 | + <a href="#" | |
| 145 | + tooltip-animation="false" | |
| 146 | + tooltip-placement="top" | |
| 147 | + uib-tooltip="更新时间:{{info.updateDate | date: 'yyyy-MM-dd HH:mm:ss' }}" | |
| 148 | + tooltip-class="headClass"> | |
| 149 | + 更新 | |
| 150 | + <span ng-bind="(info.updateDate | date: 'yyyy-MM-dd')"></span> | |
| 151 | + </a> | |
| 108 | 152 | </div> |
| 109 | 153 | |
| 154 | + <!--<div>--> | |
| 155 | + <!--<a href="#"--> | |
| 156 | + <!--tooltip-animation="false"--> | |
| 157 | + <!--tooltip-placement="top"--> | |
| 158 | + <!--uib-tooltip="备份时间:{{info.lastBackUpDate | date: 'yyyy-MM-dd HH:mm:ss' }}"--> | |
| 159 | + <!--tooltip-class="headClass">--> | |
| 160 | + | |
| 161 | + <!--<i class="fa fa-hdd-o" aria-hidden="true"></i>--> | |
| 162 | + <!--<span ng-bind="info.lastBackUpDate | date: 'yyyy-MM-dd'"></span>--> | |
| 163 | + <!--</a>--> | |
| 164 | + | |
| 165 | + <!--</div>--> | |
| 166 | + | |
| 110 | 167 | </td> |
| 111 | 168 | <td> |
| 112 | 169 | <span class="glyphicon glyphicon-ok" ng-if="info.isCancel == '0'"></span> |
| ... | ... | @@ -117,7 +174,7 @@ |
| 117 | 174 | <!--class="btn btn-info btn-sm" ng-if="info.isCancel == '0'"> 编辑 </a>--> |
| 118 | 175 | <!--<a ui-sref="ttInfoDetailManage_edit2({xlid: info.xl.id, ttid : info.id, xlname: info.xl.name, ttname : info.name})"--> |
| 119 | 176 | <!--class="btn btn-info btn-sm" ng-if="info.isCancel == '0'"> 编辑2 </a>--> |
| 120 | - <a ui-sref="ttInfoDetailManage_edit3({xlid: info.xl.id, ttid : info.id, xlname: info.xl.name, ttname : info.name, rflag : true})" | |
| 177 | + <a ui-sref="ttInfoDetailManage_edit3({xlid: info.xl.id, ttid : info.id, xlname: info.xl.name, ttname : info.name, rflag : true, lineversion : info.lineVersion})" | |
| 121 | 178 | class="btn btn-info btn-sm" ng-if="info.isCancel == '0'"> 编辑 </a> |
| 122 | 179 | <a ng-click="ctrl.toTtInfoDetailAuto(info.id)" |
| 123 | 180 | class="btn btn-info btn-sm" ng-if="info.isCancel == '0'"> 生成 </a> | ... | ... |
src/main/resources/static/pages/scheduleApp/module/core/ttInfoManage/module.js
| ... | ... | @@ -80,6 +80,19 @@ angular.module('ScheduleApp').factory( |
| 80 | 80 | var param = {}; |
| 81 | 81 | param.ttinfoid = ttinfoid; |
| 82 | 82 | return service.backup.do(param).$promise; |
| 83 | + }, | |
| 84 | + | |
| 85 | + /** | |
| 86 | + * 获取线路版本描述。 | |
| 87 | + * @param lineId | |
| 88 | + * @param version | |
| 89 | + * @returns {*|Function|promise|n} | |
| 90 | + */ | |
| 91 | + versiondesc: function(lineId, version) { | |
| 92 | + var param = {}; | |
| 93 | + param.lineId = lineId; | |
| 94 | + param.version = version; | |
| 95 | + return service.versiondesc.do(param).$promise; | |
| 83 | 96 | } |
| 84 | 97 | |
| 85 | 98 | |
| ... | ... | @@ -171,12 +184,26 @@ angular.module('ScheduleApp').controller( |
| 171 | 184 | |
| 172 | 185 | self.doPage(); |
| 173 | 186 | |
| 174 | - // 自动生成时刻表 | |
| 187 | + // TODO:跳转到自动生成时刻表页面(jquery页面),之后会替换为Angularjs版本 | |
| 175 | 188 | self.toTtInfoDetailAuto = function(ttinfoid) { |
| 176 | 189 | showPjax(); |
| 177 | 190 | $.pjax({url: 'pages/base/timesmodel/add.html?no=' + ttinfoid, container: pjaxContainer}); |
| 178 | 191 | }; |
| 179 | 192 | |
| 193 | + self.lineVersionTip = "载入中..."; | |
| 194 | + var currentTTInfoForLineVersion; | |
| 195 | + self.getLineVersionTip = function(info) { | |
| 196 | + if (currentTTInfoForLineVersion != info) { | |
| 197 | + service.versiondesc(info.xl.id, info.lineVersion).then( | |
| 198 | + function(result) { | |
| 199 | + self.lineVersionTip = result.desc; | |
| 200 | + currentTTInfoForLineVersion = info; | |
| 201 | + } | |
| 202 | + ); | |
| 203 | + } | |
| 204 | + | |
| 205 | + }; | |
| 206 | + | |
| 180 | 207 | // TODO: |
| 181 | 208 | } |
| 182 | 209 | ] | ... | ... |
src/main/resources/static/pages/scheduleApp/module/core/ttInfoManage/service.js
| ... | ... | @@ -53,6 +53,24 @@ angular.module('ScheduleApp').factory( |
| 53 | 53 | } |
| 54 | 54 | } |
| 55 | 55 | } |
| 56 | + ), | |
| 57 | + | |
| 58 | + versiondesc: $resource( | |
| 59 | + '/tic_ec/versiondesc/:lineId/:version', | |
| 60 | + {}, | |
| 61 | + { | |
| 62 | + do: { | |
| 63 | + method: 'GET', | |
| 64 | + transformResponse: function(rs) { | |
| 65 | + var dst = angular.fromJson(rs); | |
| 66 | + if (dst.status == 'SUCCESS') { | |
| 67 | + return dst.data; | |
| 68 | + } else { | |
| 69 | + return dst; // 业务错误留给控制器处理 | |
| 70 | + } | |
| 71 | + } | |
| 72 | + } | |
| 73 | + } | |
| 56 | 74 | ) |
| 57 | 75 | }; |
| 58 | 76 | ... | ... |
src/main/resources/static/real_control_v2/js/safe_driv/CallCenterPluginDemo.html
| 1 | -<!DOCTYPE html> | |
| 2 | -<html> | |
| 3 | -<head> | |
| 4 | - <meta charset="utf-8" /> | |
| 5 | - <title></title> | |
| 6 | -</head> | |
| 7 | -<body> | |
| 8 | - <script src="http://180.168.57.114:4244/Scripts/CallCenterPlugin.js" type="text/javascript"></script> | |
| 9 | -</body> | |
| 1 | +<!DOCTYPE html> | |
| 2 | +<html> | |
| 3 | +<head> | |
| 4 | + <meta charset="utf-8" /> | |
| 5 | + <title></title> | |
| 6 | +</head> | |
| 7 | +<body> | |
| 8 | + <script src="http://180.168.57.114:4244/Scripts/CallCenterPlugin.js" type="text/javascript"></script> | |
| 9 | +</body> | |
| 10 | 10 | </html> |
| 11 | 11 | \ No newline at end of file | ... | ... |
src/main/resources/static/real_control_v2/js/safe_driv/call_phone.js
| 1 | -var gb_call_phone = function () { | |
| 2 | - | |
| 3 | - var basePath = "http://180.168.57.114:4244"; | |
| 4 | - var wsUri = "ws://180.168.57.114:21892/"; | |
| 5 | - | |
| 6 | - var nbbm2tel = { | |
| 7 | - | |
| 8 | - }; | |
| 9 | - | |
| 10 | - var locData = window.localStorage.getItem('test_nbbm2tel_json'); | |
| 11 | - if(locData){ | |
| 12 | - nbbm2tel = JSON.parse(locData); | |
| 13 | - } | |
| 14 | - | |
| 15 | - var login = function (cb) { | |
| 16 | - var agentID = '1002'; | |
| 17 | - var dn = '6006'; | |
| 18 | - | |
| 19 | - var options = { | |
| 20 | - AgentID: agentID, | |
| 21 | - DN: dn, | |
| 22 | - wsUri: wsUri, | |
| 23 | - setbtnStatus: function (stateName) { | |
| 24 | - //setState(stateName); | |
| 25 | - console.log('stateName', stateName); | |
| 26 | - | |
| 27 | - cb && cb(stateName) | |
| 28 | - } | |
| 29 | - }; | |
| 30 | - $.CallCenterInit(options); | |
| 31 | - }; | |
| 32 | - | |
| 33 | - var call = function (nbbm, loginSucc, loginFailed, callSucc) { | |
| 34 | - var telNumber = nbbm2tel[nbbm]; | |
| 35 | - if(!telNumber){ | |
| 36 | - alert('没有该车辆的对照表..'); | |
| 37 | - loginFailed && loginFailed(); | |
| 38 | - return; | |
| 39 | - } | |
| 40 | - login(function (sname) { | |
| 41 | - if(sname=='login'){ | |
| 42 | - loginSucc && loginSucc(); | |
| 43 | - | |
| 44 | - $.CallCenterPublicFun.Dialing(telNumber); | |
| 45 | - setTimeout(function () { | |
| 46 | - callSucc && callSucc(); | |
| 47 | - }, 1000); | |
| 48 | - } | |
| 49 | - else{ | |
| 50 | - loginFailed && loginFailed(); | |
| 51 | - } | |
| 52 | - }); | |
| 53 | - }; | |
| 54 | - | |
| 55 | - var hangup = function () { | |
| 56 | - console.log('hangup...'); | |
| 57 | - $.CallCenterPublicFun.Hangup(); | |
| 58 | - }; | |
| 59 | - | |
| 60 | - return { | |
| 61 | - call: call, | |
| 62 | - hangup: hangup, | |
| 63 | - setNbbm2tel: function (json) { | |
| 64 | - nbbm2tel = json; | |
| 65 | - | |
| 66 | - window.localStorage.setItem('test_nbbm2tel_json', JSON.stringify(nbbm2tel)); | |
| 67 | - }, | |
| 68 | - getNbbm2tel: function () { | |
| 69 | - return nbbm2tel; | |
| 70 | - } | |
| 71 | - } | |
| 1 | +var gb_call_phone = function () { | |
| 2 | + | |
| 3 | + var basePath = "http://180.168.57.114:4244"; | |
| 4 | + var wsUri = "ws://180.168.57.114:21892/"; | |
| 5 | + | |
| 6 | + var nbbm2tel = { | |
| 7 | + | |
| 8 | + }; | |
| 9 | + | |
| 10 | + var locData = window.localStorage.getItem('test_nbbm2tel_json'); | |
| 11 | + if(locData){ | |
| 12 | + nbbm2tel = JSON.parse(locData); | |
| 13 | + } | |
| 14 | + | |
| 15 | + var login = function (cb) { | |
| 16 | + var agentID = '1002'; | |
| 17 | + var dn = '6006'; | |
| 18 | + | |
| 19 | + var options = { | |
| 20 | + AgentID: agentID, | |
| 21 | + DN: dn, | |
| 22 | + wsUri: wsUri, | |
| 23 | + setbtnStatus: function (stateName) { | |
| 24 | + //setState(stateName); | |
| 25 | + console.log('stateName', stateName); | |
| 26 | + | |
| 27 | + cb && cb(stateName) | |
| 28 | + } | |
| 29 | + }; | |
| 30 | + $.CallCenterInit(options); | |
| 31 | + }; | |
| 32 | + | |
| 33 | + var call = function (nbbm, loginSucc, loginFailed, callSucc) { | |
| 34 | + var telNumber = nbbm2tel[nbbm]; | |
| 35 | + if(!telNumber){ | |
| 36 | + alert('没有该车辆的对照表..'); | |
| 37 | + loginFailed && loginFailed(); | |
| 38 | + return; | |
| 39 | + } | |
| 40 | + login(function (sname) { | |
| 41 | + if(sname=='login'){ | |
| 42 | + loginSucc && loginSucc(); | |
| 43 | + | |
| 44 | + $.CallCenterPublicFun.Dialing(telNumber); | |
| 45 | + setTimeout(function () { | |
| 46 | + callSucc && callSucc(); | |
| 47 | + }, 1000); | |
| 48 | + } | |
| 49 | + else{ | |
| 50 | + loginFailed && loginFailed(); | |
| 51 | + } | |
| 52 | + }); | |
| 53 | + }; | |
| 54 | + | |
| 55 | + var hangup = function () { | |
| 56 | + console.log('hangup...'); | |
| 57 | + $.CallCenterPublicFun.Hangup(); | |
| 58 | + }; | |
| 59 | + | |
| 60 | + return { | |
| 61 | + call: call, | |
| 62 | + hangup: hangup, | |
| 63 | + setNbbm2tel: function (json) { | |
| 64 | + nbbm2tel = json; | |
| 65 | + | |
| 66 | + window.localStorage.setItem('test_nbbm2tel_json', JSON.stringify(nbbm2tel)); | |
| 67 | + }, | |
| 68 | + getNbbm2tel: function () { | |
| 69 | + return nbbm2tel; | |
| 70 | + } | |
| 71 | + } | |
| 72 | 72 | }(); |
| 73 | 73 | \ No newline at end of file | ... | ... |
src/main/resources/timetable.proto
| ... | ... | @@ -34,6 +34,8 @@ message TTInfo { |
| 34 | 34 | |
| 35 | 35 | // list |
| 36 | 36 | repeated TTInfoDetail bcInfo = 17; |
| 37 | + | |
| 38 | + uint32 lineVersion = 18; // 线路版本 | |
| 37 | 39 | } |
| 38 | 40 | |
| 39 | 41 | message TTInfoDetail { |
| ... | ... | @@ -64,6 +66,7 @@ message TTInfoDetail { |
| 64 | 66 | bool isTS = 18; // 是否停驶(表示此班次执行完成,停在终点站,不进场) |
| 65 | 67 | string remark = 19; // 备注 |
| 66 | 68 | |
| 69 | + uint32 lineVersion = 20; // 线路版本 | |
| 67 | 70 | } |
| 68 | 71 | |
| 69 | 72 | ... | ... |