Commit a1b038dd1a3f89c7d345de9f1c39d45cb2617107

Authored by 潘钊
2 parents 10f61394 e7f7d368

Merge branch 'minhang' of http://222.66.0.204:8090/panzhaov5/bsth_control into minhang

Showing 31 changed files with 3378 additions and 73 deletions

Too many changes to show.

To preserve performance only 31 of 41 files are displayed.

src/main/java/com/bsth/controller/SectionSpeedController.java 0 → 100644
  1 +package com.bsth.controller;
  2 +
  3 +import java.util.List;
  4 +import java.util.Map;
  5 +
  6 +import com.bsth.entity.SectionSpeed;
  7 +import com.bsth.service.SectionSpeedService;
  8 +
  9 +import org.springframework.beans.factory.annotation.Autowired;
  10 +import org.springframework.web.bind.annotation.*;
  11 +
  12 +
  13 +@RestController
  14 +@RequestMapping("sectionspeed")
  15 +public class SectionSpeedController extends BaseController<SectionSpeed, Integer> {
  16 +
  17 + @Autowired
  18 + private SectionSpeedService sectionSpeedService;
  19 +
  20 + /**@description TODO(新增路段限速) */
  21 + @RequestMapping(value="add" , method = RequestMethod.POST)
  22 + public Map<String, Object> collectionSave(@RequestParam Map<String, Object> map) {
  23 + return sectionSpeedService.add(map);
  24 + }
  25 +
  26 + /**@description TODO(修改路段) */
  27 + @RequestMapping(value="roadUpd" , method = RequestMethod.POST)
  28 + public Map<String, Object> roadUpd(@RequestParam Map<String, Object> map) {
  29 + return sectionSpeedService.roadUpd(map);
  30 + }
  31 +
  32 + /** @description TODO(根据线路ID与编码及方向查询路段限速信息) */
  33 + @RequestMapping(value="getSectionSpeedInfoList",method=RequestMethod.GET)
  34 + public List<Map<String, Object>> getSectionSpeedInfoList(@RequestParam Map<String, Object> map){
  35 + return sectionSpeedService.getSectionSpeedInfo(map);
  36 + }
  37 +
  38 + /**
  39 + * @Description :TODO(查询路段信息)
  40 + *
  41 + * @param map <line.id_eq:线路ID; directions_eq:方向>
  42 + *
  43 + * @return Map<String, Object>
  44 + */
  45 + @RequestMapping(value = "/analyticSection" , method = RequestMethod.GET)
  46 + public List<Map<String, Object>> findPoints(@RequestParam Map<String, Object> map) {
  47 + return sectionSpeedService.analyticSection(map);
  48 + }
  49 +
  50 +}
... ...
src/main/java/com/bsth/entity/Line.java
... ... @@ -25,116 +25,117 @@ import java.util.Date;
25 25 @Table(name = "bsth_c_line")
26 26 public class Line implements Serializable {
27 27  
28   - // 线路ID
29 28 @Id
30   - /*@GeneratedValue(strategy = GenerationType.IDENTITY)*/
  29 + /** 线路ID 主键(唯一标识符) int length(11) */
31 30 private Integer id;
32 31  
33   - // 线路名称
  32 + /** 线路名称 varchar length(50) 不能为空 */
34 33 private String name;
35 34  
36   - // 线路代码
  35 + /** 线路编码 varchar length(50) 不能为空 */
37 36 private String lineCode;
38 37  
39   - // 英文名
  38 + /** 英文名 varchar length(50) */
40 39 private String es;
41 40  
42   - // 简称
  41 + /** 简称 varchar length(50) */
43 42 private String shortName;
44 43  
45   - // 起始站名称
  44 + /** 起始站名称 varchar length(50) 不能为空
  45 + * 该字段值会在规划线路站点操作时会去验证是否有值。如果为空,则用线路规划站点的起点站。默认使用该字段填写值 */
46 46 private String startStationName;
47 47  
48   - // 起始站首班车时间 00:00
  48 + /** 终点站名称 varchar length(50) 不能为空
  49 + * 该字段值会在规划线路站点操作时会去验证是否有值。如果为空,则用线路规划站点的起点站。默认使用该字段填写值 */
  50 + private String endStationName;
  51 +
  52 + /** 起始站首班车时间 00:00 上海公交APP中某个接口所需要的字段值 varchar length(50) 不能为空 */
49 53 private String startStationFirstTime;
50 54  
51   - // 起始站末班车时间 00:00
  55 + /** 起始站末班车时间 00:00 上海公交APP中某个接口所需要的字段值 varchar length(50) 不能为空 */
52 56 private String startStationEndTime;
53 57  
54   - // 终点站名称
55   - private String endStationName;
56   -
57   - // 终点站首班时间 00:00
  58 + /** 终点站首班时间 00:00 上海公交APP中某个接口所需要的字段值 varchar length(50) 不能为空*/
58 59 private String endStationFirstTime;
59 60  
60   - // 终点站末班时间 00:00
  61 + /** 终点站末班时间 00:00 上海公交APP中某个接口所需要的字段值 */
61 62 private String endStationEndTime;
62 63  
63   - // 所属公司
  64 + /** 所属公司 varchar length(50) */
64 65 private String company;
65 66  
66   - // 分公司
  67 + /** 分公司 varchar length(50)*/
67 68 private String brancheCompany;
68 69  
69   - // 性质(线路类型)
  70 + /** 性质(线路类型) varchar length(50) */
70 71 private String nature;
71 72  
72   - // 线路等级
  73 + /** 线路等级 varchar length(50) */
73 74 private String level;
74 75  
75   - // 线路长度
  76 + /** 线路长度 */
76 77 private double length;
77 78  
78   - // 线路负责人
  79 + /** 线路负责人 varchar length(50) */
79 80 private String chargeName;
80 81  
81   - // 负责人电话
  82 + /** 负责人电话 varchar length(50) */
82 83 private String telephone;
83 84  
84   - // 是否撤销
  85 + /** 是否撤销 <1:是;0:否> bit length(50) */
85 86 private Integer destroy;
86 87  
87   - // 是否夜宵线
  88 + /** 是否夜宵线 <1:是;0:否> bit length(50)*/
88 89 private Integer supperLine;
89 90  
90   - // 起始调度电话
  91 + /** 起始调度电话 varchar length(50) */
91 92 private String startPhone;
92 93  
93   - // 终点调度电话
  94 + /** 终点调度电话 varchar length(50) */
94 95 private String endPhone;
95 96  
96   - // 开辟日期
  97 + /** 开辟日期 date*/
97 98 @DateTimeFormat(pattern ="yyyy-MM-dd")
98 99 private Date openDate;
99 100  
100   - // 线路沿革
  101 + /** 线路沿革 varchar length(50) */
101 102 private String history;
102 103  
103   - // 上海市线路编码
  104 + /** 上海市线路编码 varchar length(50) */
104 105 private String shanghaiLinecode;
105 106  
106   - // 设备线路编码
  107 + /** 设备线路编码 varchar length(50) */
107 108 private String eqLinecode;
108 109  
109   - /** 配置车辆总数 老版本系统字段, 新版本系统业务需求暂时没用到该字段 ,这里暂时留着 */
  110 + /** 配置车辆总数 老版本系统字段, 新版本系统业务需求暂时没用到该字段 ,这里暂时留着 int length(11)*/
110 111 private Integer carSumNumber;
111 112  
112   - /** 空调车辆数量 老版本系统字段, 新版本系统业务需求暂时没用到该字段 ,这里暂时留着 */
  113 + /** 空调车辆数量 老版本系统字段, 新版本系统业务需求暂时没用到该字段 ,这里暂时留着 int length(11) */
113 114 private Integer hvacCarNumber;
114 115  
115   - /** 普通车辆数量 老版本系统字段, 新版本系统业务需求暂时没用到该字段 ,这里暂时留着 */
  116 + /** 普通车辆数量 老版本系统字段, 新版本系统业务需求暂时没用到该字段 ,这里暂时留着 int length(11) */
116 117 private Integer ordCarNumber;
117 118  
118   - /** 停车场编码 老版本系统字段, 新版本系统业务需求暂时没用到该字段 ,这里暂时留着 */
  119 + /** 停车场编码 老版本系统字段, 新版本系统业务需求暂时没用到该字段 ,这里暂时留着 int length(11) */
119 120 private String carParkCode;
120 121  
121   - /** 线路规划类型 <0:双向;1:环线> */
  122 + /** 线路规划类型 <0:双向;1:环线> int length(11) 运管处接口需要的字段 不能为空 */
122 123 private Integer linePlayType;
123 124  
124   - // 描述
  125 + /** 描述 varchar length(255) */
125 126 private String descriptions;
126 127  
127   - // 创建人
  128 + /** 创建人 int length(11) */
128 129 private Integer createBy;
129 130  
130   - // 修改人
  131 + /** 修改人 int length(11) */
131 132 private Integer updateBy;
132 133  
133   - // 创建日期
  134 + /** 创建日期 timestamp */
134 135 @Column(updatable = false, name = "create_date", columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP")
135 136 private Date createDate;
136 137  
137   - // 修改日期
  138 + /** 修改日期 timestamp */
138 139 @Column(name = "update_date", columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP")
139 140 private Date updateDate;
140 141  
... ...
src/main/java/com/bsth/entity/Road.java 0 → 100644
  1 +package com.bsth.entity;
  2 +
  3 +import javax.persistence.Entity;
  4 +import javax.persistence.Id;
  5 +import javax.persistence.Table;
  6 +
  7 +@Entity
  8 +@Table(name = "bsth_c_road")
  9 +public class Road {
  10 +
  11 + @Id
  12 + /*@GeneratedValue(strategy = GenerationType.IDENTITY)*/
  13 + private Integer id;
  14 +
  15 + // 路段编码
  16 + private String roadCode;
  17 +
  18 + // 路段名称
  19 + private String roadName;
  20 +
  21 + // 路段矢量(空间坐标点集合)--百度原始坐标坐标点
  22 + private String broadVector;
  23 +
  24 + // 路段矢量(空间坐标点集合)--GPS坐标点
  25 + private String groadVector;
  26 +
  27 + // 限速
  28 + private Double speed;
  29 +
  30 + public Integer getId() {
  31 + return id;
  32 + }
  33 +
  34 + public void setId(Integer id) {
  35 + this.id = id;
  36 + }
  37 +
  38 + public String getRoadCode() {
  39 + return roadCode;
  40 + }
  41 +
  42 + public void setRoadCode(String roadCode) {
  43 + this.roadCode = roadCode;
  44 + }
  45 +
  46 + public String getRoadName() {
  47 + return roadName;
  48 + }
  49 +
  50 + public void setRoadName(String roadName) {
  51 + this.roadName = roadName;
  52 + }
  53 +
  54 + public String getBroadVector() {
  55 + return broadVector;
  56 + }
  57 +
  58 + public void setBroadVector(String broadVector) {
  59 + this.broadVector = broadVector;
  60 + }
  61 +
  62 + public String getGroadVector() {
  63 + return groadVector;
  64 + }
  65 +
  66 + public void setGroadVector(String groadVector) {
  67 + this.groadVector = groadVector;
  68 + }
  69 +
  70 + public Double getSpeed() {
  71 + return speed;
  72 + }
  73 +
  74 + public void setSpeed(Double speed) {
  75 + this.speed = speed;
  76 + }
  77 +}
... ...
src/main/java/com/bsth/entity/SectionRoute.java
... ... @@ -52,6 +52,9 @@ public class SectionRoute {
52 52 // 是否撤销
53 53 private Integer destroy;
54 54  
  55 + /** 是否有路段限速数据 <0:无;1:有>*/
  56 + private Integer isRoadeSpeed;
  57 +
55 58 // 描述
56 59 private String descriptions;
57 60  
... ... @@ -76,6 +79,14 @@ public class SectionRoute {
76 79 // 线路信息
77 80 @ManyToOne
78 81 private Line line;
  82 +
  83 + public Integer getIsRoadeSpeed() {
  84 + return isRoadeSpeed;
  85 + }
  86 +
  87 + public void setIsRoadeSpeed(Integer isRoadeSpeed) {
  88 + this.isRoadeSpeed = isRoadeSpeed;
  89 + }
79 90  
80 91 public Integer getId() {
81 92 return id;
... ...
src/main/java/com/bsth/entity/SectionSpeed.java 0 → 100644
  1 +package com.bsth.entity;
  2 +
  3 +import javax.persistence.Entity;
  4 +import javax.persistence.GeneratedValue;
  5 +import javax.persistence.GenerationType;
  6 +import javax.persistence.Id;
  7 +import javax.persistence.ManyToOne;
  8 +import javax.persistence.Table;
  9 +
  10 +/**
  11 + * @description TODO(路段限速)
  12 + *
  13 + * @author bsth@lq
  14 + *
  15 + * @date 2016年9月14日 14:15:42
  16 + */
  17 +
  18 +
  19 +@Entity
  20 +@Table(name = "bsth_c_sectionspeed")
  21 +public class SectionSpeed {
  22 +
  23 + @Id
  24 + @GeneratedValue(strategy = GenerationType.IDENTITY)
  25 + private Integer id;
  26 +
  27 + // 线路信息
  28 + @ManyToOne
  29 + private Line line;
  30 +
  31 + @ManyToOne
  32 + private Road road;
  33 +
  34 + /** 线路编码 */
  35 + private String lineCode;
  36 +
  37 + private String roadCode;
  38 +
  39 + /** 方向*/
  40 + private Integer directions;
  41 +
  42 + /** 序号*/
  43 + private Integer code;
  44 +
  45 + /** 路段名称 */
  46 + private String sName;
  47 +
  48 + public String getRoadCode() {
  49 + return roadCode;
  50 + }
  51 +
  52 + public void setRoadCode(String roadCode) {
  53 + this.roadCode = roadCode;
  54 + }
  55 +
  56 + public Road getRoad() {
  57 + return road;
  58 + }
  59 +
  60 + public void setRoad(Road road) {
  61 + this.road = road;
  62 + }
  63 +
  64 + public Integer getDirections() {
  65 + return directions;
  66 + }
  67 +
  68 + public void setDirections(Integer directions) {
  69 + this.directions = directions;
  70 + }
  71 +
  72 + public Integer getCode() {
  73 + return code;
  74 + }
  75 +
  76 + public void setCode(Integer code) {
  77 + this.code = code;
  78 + }
  79 +
  80 + public Integer getId() {
  81 + return id;
  82 + }
  83 +
  84 + public void setId(Integer id) {
  85 + this.id = id;
  86 + }
  87 +
  88 + public Line getLine() {
  89 + return line;
  90 + }
  91 +
  92 + public void setLine(Line line) {
  93 + this.line = line;
  94 + }
  95 +
  96 + public String getLineCode() {
  97 + return lineCode;
  98 + }
  99 +
  100 + public void setLineCode(String lineCode) {
  101 + this.lineCode = lineCode;
  102 + }
  103 +
  104 + public String getsName() {
  105 + return sName;
  106 + }
  107 +
  108 + public void setsName(String sName) {
  109 + this.sName = sName;
  110 + }
  111 +
  112 +}
... ...
src/main/java/com/bsth/entity/schedule/CarConfigInfo.java
... ... @@ -53,6 +53,10 @@ public class CarConfigInfo implements Serializable {
53 53 @Column(nullable = false)
54 54 private int isSwitch;
55 55  
  56 + /** 是否删除(标记) */
  57 + @Column(nullable = false)
  58 + private Boolean isCancel = false;
  59 +
56 60 /** 创建人 */
57 61 @ManyToOne(fetch = FetchType.LAZY, cascade = CascadeType.PERSIST)
58 62 private SysUser createBy;
... ... @@ -170,4 +174,12 @@ public class CarConfigInfo implements Serializable {
170 174 public void setUpdateDate(Date updateDate) {
171 175 this.updateDate = updateDate;
172 176 }
  177 +
  178 + public Boolean getIsCancel() {
  179 + return isCancel;
  180 + }
  181 +
  182 + public void setIsCancel(Boolean isCancel) {
  183 + this.isCancel = isCancel;
  184 + }
173 185 }
... ...
src/main/java/com/bsth/entity/schedule/EmployeeConfigInfo.java
... ... @@ -49,6 +49,9 @@ public class EmployeeConfigInfo {
49 49 @Formula(" dbbm + 0 ")
50 50 private Integer dbbmFormula;
51 51  
  52 + /** 是否删除(标记) */
  53 + @Column(nullable = false)
  54 + private Boolean isCancel = false;
52 55  
53 56 /** 创建人 */
54 57 @ManyToOne(fetch = FetchType.LAZY, cascade = CascadeType.PERSIST)
... ... @@ -96,6 +99,22 @@ public class EmployeeConfigInfo {
96 99 this.jsy = jsy;
97 100 }
98 101  
  102 + public Personnel getSpy() {
  103 + return spy;
  104 + }
  105 +
  106 + public void setSpy(Personnel spy) {
  107 + this.spy = spy;
  108 + }
  109 +
  110 + public String getDbbm() {
  111 + return dbbm;
  112 + }
  113 +
  114 + public void setDbbm(String dbbm) {
  115 + this.dbbm = dbbm;
  116 + }
  117 +
99 118 public Integer getDbbmFormula() {
100 119 return dbbmFormula;
101 120 }
... ... @@ -104,6 +123,14 @@ public class EmployeeConfigInfo {
104 123 this.dbbmFormula = dbbmFormula;
105 124 }
106 125  
  126 + public Boolean getIsCancel() {
  127 + return isCancel;
  128 + }
  129 +
  130 + public void setIsCancel(Boolean isCancel) {
  131 + this.isCancel = isCancel;
  132 + }
  133 +
107 134 public SysUser getCreateBy() {
108 135 return createBy;
109 136 }
... ... @@ -120,22 +147,6 @@ public class EmployeeConfigInfo {
120 147 this.updateBy = updateBy;
121 148 }
122 149  
123   - public Personnel getSpy() {
124   - return spy;
125   - }
126   -
127   - public void setSpy(Personnel spy) {
128   - this.spy = spy;
129   - }
130   -
131   - public String getDbbm() {
132   - return dbbm;
133   - }
134   -
135   - public void setDbbm(String dbbm) {
136   - this.dbbm = dbbm;
137   - }
138   -
139 150 public Date getCreateDate() {
140 151 return createDate;
141 152 }
... ...
src/main/java/com/bsth/entity/search/CustomerSpecs.java
1 1 package com.bsth.entity.search;
2 2  
3   -import java.lang.reflect.Method;
4   -import java.util.ArrayList;
5   -import java.util.List;
6   -import java.util.Map;
7   -import java.util.Set;
8   -import java.util.TreeSet;
9   -
10   -import javax.persistence.criteria.CriteriaBuilder;
11   -import javax.persistence.criteria.CriteriaQuery;
12   -import javax.persistence.criteria.Path;
13   -import javax.persistence.criteria.Predicate;
14   -import javax.persistence.criteria.Root;
15   -
  3 +import com.bsth.entity.search.exception.UnrecognizableSearchSymbolException;
16 4 import org.apache.commons.lang3.StringUtils;
17 5 import org.slf4j.Logger;
18 6 import org.slf4j.LoggerFactory;
19 7 import org.springframework.data.jpa.domain.Specification;
20 8  
21   -import com.bsth.entity.search.exception.UnrecognizableSearchSymbolException;
  9 +import javax.persistence.criteria.*;
  10 +import java.lang.reflect.Method;
  11 +import java.util.*;
22 12  
23 13 /**
24 14 *
... ... @@ -74,6 +64,14 @@ public class CustomerSpecs&lt;T&gt; implements Specification&lt;T&gt; {
74 64 // 值为空的不参与查询
75 65 if (value == null || (value instanceof String && value.equals("")))
76 66 continue;
  67 +
  68 + // 如果是布尔值,转换,限定 'true','false' 字符串
  69 + if ("true".equals(value)) {
  70 + value = Boolean.TRUE;
  71 + }
  72 + if ("false".equals(value)) {
  73 + value = Boolean.FALSE;
  74 + }
77 75  
78 76 try {
79 77 if(!eSet.contains(searchs[1]))
... ...
src/main/java/com/bsth/repository/SectionRouteRepository.java
... ... @@ -157,4 +157,9 @@ public interface SectionRouteRepository extends BaseRepository&lt;SectionRoute, Int
157 157 " FROM bsth_c_sectionroute c " +
158 158 " LEFT JOIN bsth_c_section s on c.section = s.id where c.line = ?1 and c.directions = ?2", nativeQuery=true)
159 159 List<Object[]> sectionRouteVector(Integer lineId,Integer directions);
  160 +
  161 + @Transactional
  162 + @Modifying
  163 + @Query(value="UPDATE bsth_c_sectionroute set is_roade_speed = ?1 where line= ?2 and directions=?3 ",nativeQuery = true)
  164 + void isRoadSpeedUpd(Integer isR,Integer line,Integer directions);
160 165 }
... ...
src/main/java/com/bsth/repository/SectionSpeedRepository.java 0 → 100644
  1 +package com.bsth.repository;
  2 +
  3 +import java.util.List;
  4 +
  5 +import org.springframework.data.jpa.repository.Modifying;
  6 +import org.springframework.data.jpa.repository.Query;
  7 +import org.springframework.stereotype.Repository;
  8 +import org.springframework.transaction.annotation.Transactional;
  9 +
  10 +import com.bsth.entity.SectionSpeed;
  11 +
  12 +/**
  13 + * @description TODO(路段限速持久层)
  14 + *
  15 + * @author Administrator
  16 + *
  17 + * @date 2016年9月21日 13:31:25
  18 + */
  19 +@Repository
  20 +public interface SectionSpeedRepository extends BaseRepository<SectionSpeed, Integer>{
  21 +
  22 +
  23 + @Transactional
  24 + @Modifying
  25 + @Query(value="INSERT INTO bsth_c_sectionspeed (" +
  26 + "line , line_code , directions , `code` , s_name,road,road_code ) " +
  27 + " VALUES (" +
  28 + "?1 , ?2 , ?3 , ?4 , ?5,?6,?7)", nativeQuery=true)
  29 + /** @description TODO(路段限速保存) @param (<line:线路ID;versions:版本号;destroy:是否撤销;directions:方向;sValue:限速;code:路段序号> )*/
  30 + /** @param (<lineCode:线路编码;sName:路段名称;sType:路段类型;bLineStr:路段矢量百度坐标;gLineStr:路段矢量WGS坐标;descriptions:说明>)*/
  31 + void add(Integer line,String lineCode,Integer directions,Integer code,String sName,Integer road,String road_code);
  32 +
  33 + @Transactional
  34 + @Modifying
  35 + @Query(value="INSERT INTO bsth_c_road("+
  36 + "broad_vector,groad_vector,road_code,road_name,speed,id)"+
  37 + " VALUES(" +
  38 + "ST_GeomFromText(?1),ST_GeomFromText(?2),?3,?4,?5,?6)", nativeQuery=true)
  39 + void insertRoad(String broad_vector,String groad_vector,String road_code,String road_name,Double speed,Integer id);
  40 +
  41 + @Query(value="SELECT b.`name` as linename, a.speedid, a.bLineStr ,a.line_code,a.s_name,a.speed ,a.line,a.codenumb,a.road,a.directions FROM ("+
  42 + " SELECT p.id AS speedid,p.line,p.line_code,p.road,p.directions,p.`code` AS codenumb,p.s_name,ST_AsText(r.broad_vector) AS bLineStr,r.speed FROM ("+
  43 + " SELECT s.id,s.line,s.line_code,s.road,s.directions,s.`code`,s.s_name FROM bsth_c_sectionspeed s where s.line =?1 and s.line_code=?2 and s.directions=?3) p LEFT JOIN bsth_c_road r ON p.road = r.id) a "+
  44 + " LEFT JOIN bsth_c_line b ON a.line = b.id ORDER BY codenumb asc",nativeQuery = true)
  45 + List<Object[]> getSectionSpeedInfo(int lineId, String lineCode, int directions);
  46 +
  47 + /** 获取路网数据 */
  48 + @Query(value="SELECT ST_AsText(g.bdjw) as SHAPE , id as id ,ldbh,mc FROM jjwgps_t_gjldb g where g.bdjw is not null ",nativeQuery = true)
  49 + List<Object[]> getroadNet();
  50 +
  51 + /** */
  52 + @Query(value="SELECT ST_Contains(ST_Buffer(ST_GeomFromText(?1),0.0005),ST_GeomFromText(?2)) AS result",nativeQuery = true)
  53 + int ST_Contains(String g1,String g2);
  54 +
  55 +
  56 + @Query(value="SELECT id FROM bsth_c_road r where r.road_code = ?1",nativeQuery = true)
  57 + Integer validateRoade(String raodCode);
  58 +
  59 + @Transactional
  60 + @Modifying
  61 + @Query(value="UPDATE bsth_c_sectionspeed set `code` =?1 where id=?2",nativeQuery = true)
  62 + void roadUpdCode(Integer code,Integer sSpeedId);
  63 +
  64 + @Transactional
  65 + @Modifying
  66 + @Query(value="UPDATE bsth_c_road set road_name = ?1 ,speed =?2 where id= ?3",nativeQuery = true)
  67 + void sSpeedUpd(String roadName,Double speed ,Integer id);
  68 +
  69 +}
... ...
src/main/java/com/bsth/service/SectionSpeedService.java 0 → 100644
  1 +package com.bsth.service;
  2 +
  3 +import java.util.List;
  4 +import java.util.Map;
  5 +
  6 +import com.bsth.entity.SectionSpeed;
  7 +
  8 +/**
  9 + * Created by xu on 16/5/31.
  10 + */
  11 +public interface SectionSpeedService extends BaseService<SectionSpeed, Integer> {
  12 +
  13 + /** @description TODO(新增路段限速) @return map ({status:SUCCESS}成功 或者 {status:ERROR}失败) @param map (路段限速信息)*/
  14 + Map<String, Object> add(Map<String, Object> map);
  15 +
  16 + /** @description TODO(修改路段) @return map ({status:SUCCESS}成功 或者 {status:ERROR}失败) @param map (路段限速信息)*/
  17 + Map<String, Object> roadUpd(Map<String, Object> map);
  18 +
  19 + List<Map<String, Object>> getSectionSpeedInfo(Map<String, Object> map);
  20 +
  21 + /** 解析路段 */
  22 + List<Map<String, Object>> analyticSection(Map<String,Object> map);
  23 +
  24 +}
... ...
src/main/java/com/bsth/service/impl/SectionSpeedServiceImpl.java 0 → 100644
  1 +package com.bsth.service.impl;
  2 +
  3 +import java.util.ArrayList;
  4 +import java.util.HashMap;
  5 +import java.util.List;
  6 +import java.util.Map;
  7 +
  8 +import com.alibaba.fastjson.JSONArray;
  9 +import com.bsth.common.ResponseCode;
  10 +import com.bsth.entity.SectionSpeed;
  11 +import com.bsth.repository.SectionRouteRepository;
  12 +import com.bsth.repository.SectionSpeedRepository;
  13 +import com.bsth.service.SectionSpeedService;
  14 +import com.bsth.util.TransGPS;
  15 +import com.bsth.util.TransGPS.Location;
  16 +import com.bsth.util.Geo.GeoUtils;
  17 +import com.bsth.util.Geo.Point;
  18 +
  19 +import org.springframework.beans.factory.annotation.Autowired;
  20 +import org.springframework.stereotype.Service;
  21 +import org.springframework.transaction.annotation.Transactional;
  22 +
  23 +/**
  24 + * @description TODO(路段限速service实现类)
  25 + *
  26 + * @author Administrator
  27 + *
  28 + * @date 2016年9月21日 13:30:33
  29 + */
  30 +@Service
  31 +public class SectionSpeedServiceImpl extends BaseServiceImpl<SectionSpeed, Integer> implements SectionSpeedService {
  32 +
  33 + @Autowired
  34 + private SectionSpeedRepository sectionSpeedRepository;
  35 +
  36 + @Autowired
  37 + private SectionRouteRepository sectionRouteRepository;
  38 +
  39 +
  40 + /** @description TODO(新增路段限速) @return map ({status:SUCCESS}成功 或者 {status:ERROR}失败) @param map (路段限速信息)*/
  41 + @Override
  42 + public Map<String, Object> add(Map<String, Object> map) {
  43 +
  44 + /** 返回值 {status:SUCCESS}成功 或者 {status:ERROR}失败*/
  45 + Map<String, Object> resultMap = new HashMap<String, Object>();
  46 +
  47 + /** <line:线路ID;versions:版本号;destroy:是否撤销;directions:方向;sValue:限速;code:路段序号> */
  48 + Integer line = null, versions=null, destroy=null,directions = null,sValue = null,code = null;
  49 +
  50 + /** <lineCode:线路编码;sName:路段名称;sType:路段类型;bLineStr:路段矢量百度坐标;gLineStr:路段矢量WGS坐标;descriptions:说明>*/
  51 + String lineCode ="", sName = "", sType = "",bLineStr="",gLineStr="",descriptions="";
  52 +
  53 + line = map.get("lineId").equals("") ? null : Integer.valueOf(map.get("lineId").toString());
  54 +
  55 + lineCode = map.get("lineCode").equals("") ? null : map.get("lineCode").toString();
  56 +
  57 + directions = map.get("directions").equals("") ? null : Integer.valueOf(map.get("directions").toString());
  58 +
  59 + code = map.get("code").equals("") ? null : Integer.valueOf(map.get("code").toString());
  60 +
  61 + sName = map.get("sName").equals("") ? "" : map.get("sName").toString();
  62 +
  63 + sValue = map.get("sValue").equals("") ? null : Integer.valueOf(map.get("sValue").toString());
  64 +
  65 + sType = map.get("sType").equals("") ? "" : map.get("sType").toString();
  66 +
  67 + bLineStr = map.get("bLineStr").equals("") ? "" : map.get("bLineStr").toString();
  68 +
  69 + String bPolyline = "";
  70 +
  71 + String gPolyline = "";
  72 +
  73 + // 转换成JSON数组
  74 + JSONArray sectionsArray = JSONArray.parseArray(bLineStr);
  75 + //[{"lng":121.337574,"lat":31.116436},{"lng":121.362439,"lat":31.099245},{"lng":121.362008,"lat":31.090834},{"lng":121.349791,"lat":31.093679}]
  76 + // 遍历
  77 + for(int s = 0 ;s<sectionsArray.size();s++) {
  78 +
  79 + String pointsLngStr = sectionsArray.getJSONObject(s).get("lng").toString();
  80 +
  81 + String pointsLatStr = sectionsArray.getJSONObject(s).get("lat").toString();
  82 +
  83 + Location resultPoint = FromBDPointToWGSPoint(pointsLngStr,pointsLatStr);
  84 +
  85 + String WGSLngStr = String.valueOf(resultPoint.getLng());
  86 +
  87 + String WGSLatStr = String.valueOf(resultPoint.getLat());
  88 +
  89 + if(s<sectionsArray.size()-1){
  90 +
  91 + bPolyline = bPolyline + pointsLngStr + " " + pointsLatStr + ",";
  92 +
  93 + gPolyline = gPolyline + WGSLngStr + " " + WGSLatStr + ",";
  94 +
  95 + }else{
  96 +
  97 + bPolyline = bPolyline + pointsLngStr + " " + pointsLatStr;
  98 +
  99 + gPolyline = gPolyline + WGSLngStr + " " + WGSLatStr;
  100 + }
  101 +
  102 + }
  103 +
  104 +
  105 + bPolyline = "LINESTRING(" + bPolyline +")";
  106 +
  107 + gPolyline = "LINESTRING(" + gPolyline +")";
  108 + /*gLineStr = map.get("gLineStr").equals("") ? "" : map.get("gLineStr").toString();*/
  109 +
  110 + versions = map.get("versions").equals("") ? null : Integer.valueOf(map.get("versions").toString());
  111 +
  112 + destroy = map.get("destroy").equals("") ? null : Integer.valueOf(map.get("destroy").toString());
  113 +
  114 + descriptions = map.get("descriptions").equals("") ? "" : map.get("descriptions").toString();
  115 +
  116 + try {
  117 +
  118 + /** 保存*/
  119 + /*sectionSpeedRepository.add(line, lineCode, directions, code, sName, sValue, sType, bPolyline, gPolyline, versions, destroy, descriptions);*/
  120 +
  121 + resultMap.put("status", ResponseCode.SUCCESS);
  122 +
  123 + } catch (Exception e) {
  124 +
  125 + resultMap.put("status", ResponseCode.ERROR);
  126 +
  127 + logger.error("save erro.", e);
  128 +
  129 + }
  130 +
  131 + return resultMap;
  132 + }
  133 +
  134 + /** 百度坐标转WGS坐标 */
  135 + public Location FromBDPointToWGSPoint(String bLonx,String bLatx) {
  136 +
  137 + double lng = Double.parseDouble(bLonx);
  138 +
  139 + double lat = Double.parseDouble(bLatx);
  140 +
  141 + Location bdLoc = TransGPS.LocationMake(lng, lat);
  142 +
  143 + Location location = TransGPS.bd_decrypt(bdLoc);
  144 +
  145 + Location WGSPoint = TransGPS.transformFromGCJToWGS(location);
  146 +
  147 + return WGSPoint;
  148 +
  149 + }
  150 +
  151 + @Override
  152 + public List<Map<String, Object>> getSectionSpeedInfo(Map<String, Object> map) {
  153 +
  154 + int lineId = Integer.parseInt(map.get("lineId").toString());
  155 +
  156 + String lineCode = map.get("lineCode").toString();
  157 +
  158 + int directions = Integer.parseInt(map.get("directions").toString());
  159 +
  160 + List<Object[]> listObj = sectionSpeedRepository.getSectionSpeedInfo(lineId, lineCode, directions);
  161 +
  162 + List<Map<String, Object>> resultList = new ArrayList<Map<String,Object>>();
  163 +
  164 + if(listObj.size()>0) {
  165 +
  166 + for(int i = 0 ;i<listObj.size();i++){
  167 + Map<String, Object> tempM = new HashMap<String, Object>();
  168 +
  169 + tempM.put("lineName", listObj.get(i)[0]);
  170 +
  171 + tempM.put("id", listObj.get(i)[1]);
  172 +
  173 + tempM.put("bLineStr", listObj.get(i)[2]);
  174 +
  175 + tempM.put("line_code", listObj.get(i)[3]);
  176 +
  177 + tempM.put("s_name", listObj.get(i)[4]);
  178 +
  179 + tempM.put("s_value", listObj.get(i)[5]);
  180 +
  181 + tempM.put("line", listObj.get(i)[6]);
  182 +
  183 + tempM.put("xh", listObj.get(i)[7]);
  184 +
  185 + tempM.put("road", listObj.get(i)[8]);
  186 +
  187 + tempM.put("directions", listObj.get(i)[9]);
  188 + resultList.add(tempM);
  189 +
  190 + }
  191 + }
  192 + return resultList;
  193 + }
  194 +
  195 + @Override
  196 + public List<Map<String, Object>> analyticSection(Map<String, Object> map) {
  197 +
  198 + int lineId = map.get("line.id_eq").equals("") ? 0 : Integer.parseInt(map.get("line.id_eq").toString());
  199 +
  200 + int directions = map.get("directions_eq").equals("") ? 0 : Integer.parseInt(map.get("directions_eq").toString());
  201 +
  202 + String lineCode = map.get("lineCode").toString();
  203 +
  204 + String argus = map.get("argus").toString();
  205 +
  206 + List<Object[]> listObjArray = sectionRouteRepository.getSectionRoute(lineId, directions);
  207 +
  208 + List<Object[]> loadArray = sectionSpeedRepository.getroadNet();
  209 +
  210 + int len = loadArray.size();
  211 +
  212 + int size = listObjArray.size();
  213 +
  214 + List<Map<String, Object>> idArray = new ArrayList<Map<String, Object>>();
  215 +
  216 + if(size > 0) {
  217 +
  218 + for(int i = 0; i< size; i++) {
  219 +
  220 + String g1 = listObjArray.get(i)[16].toString();
  221 +
  222 + for(int k = 0;k<len;k++) {
  223 +
  224 + String g2 = loadArray.get(k)[0].toString();
  225 +
  226 + int isContains = sectionSpeedRepository.ST_Contains(g1, g2);
  227 +
  228 + if(isContains == 1) {
  229 +
  230 + String ldbh = loadArray.get(k)[2].toString();
  231 +
  232 + String mc = loadArray.get(k)[3].toString();
  233 +
  234 + Map<String, Object> mp = new HashMap<>();
  235 +
  236 + mp.put("linestring", g2);
  237 +
  238 + int index = sectionSort(g1,g2);
  239 +
  240 + mp.put("index", index+100);
  241 +
  242 + mp.put("ldbh", ldbh);
  243 +
  244 + mp.put("mc", mc);
  245 +
  246 + mp.put("id", loadArray.get(k)[1].toString());
  247 +
  248 + idArray.add(mp);
  249 +
  250 + }
  251 +
  252 + }
  253 + }
  254 +
  255 + if(argus.equals("1"))
  256 + insertRode(idArray,lineId,directions,lineCode );
  257 +
  258 + }
  259 +
  260 + return idArray;
  261 + }
  262 +
  263 + @Transactional
  264 + private void insertRode(List<Map<String, Object>> idArray,int line,int directions,String lineCode) {
  265 +
  266 + int size = idArray.size();
  267 +
  268 + if(size>0) {
  269 + for(int i =0;i<size;i++) {
  270 +
  271 + String broad_vector = idArray.get(i).get("linestring").toString();
  272 +
  273 + String groad_vector = null;
  274 +
  275 + String road_code = idArray.get(i).get("ldbh").toString();
  276 +
  277 + String road_name = idArray.get(i).get("mc").toString();
  278 +
  279 + Integer id = Integer.parseInt(idArray.get(i).get("id").toString());
  280 +
  281 + Double speed = 60.0d;
  282 +
  283 + Integer index = Integer.parseInt(idArray.get(i).get("index").toString());
  284 +
  285 + Integer vali = sectionSpeedRepository.validateRoade(road_code);
  286 +
  287 + if(vali==null)
  288 + sectionSpeedRepository.insertRoad(broad_vector, groad_vector, road_code, road_name, speed,id);
  289 + else
  290 + id = vali;
  291 +
  292 + sectionSpeedRepository.add(line, lineCode, directions, index, road_name, id,road_code);
  293 +
  294 + }
  295 + }
  296 +
  297 + int isR = 1;
  298 +
  299 + sectionRouteRepository.isRoadSpeedUpd( isR, line, directions);
  300 +
  301 + }
  302 +
  303 + public int sectionSort(String g1,String g2) {
  304 +
  305 + String g1_str = g1.substring(g1.indexOf("(")+1, g1.length()-1);
  306 +
  307 + String g2_str = g2.substring(g2.indexOf("(")+1, g2.length()-1);
  308 +
  309 + String g1_array[] = g1_str.split(",");
  310 +
  311 + String g2_array[] = g2_str.split(",");
  312 +
  313 + int len = g1_array.length;
  314 +
  315 + String pArray[] = g2_array[g2_array.length/2].split(" ");
  316 +
  317 + Point p = new Point(Double.parseDouble(pArray[0]), Double.parseDouble(pArray[1]));
  318 +
  319 + for(int l =0 ;l<len-1;l++) {
  320 +
  321 + List<Point> ps = new ArrayList<Point>();
  322 +
  323 + Point Point1 = new Point(Double.parseDouble(g1_array[l].split(" ")[0]), Double.parseDouble(g1_array[l].split(" ")[1]));
  324 +
  325 + Point Point2 = new Point(Double.parseDouble(g1_array[l+1].split(" ")[0]), Double.parseDouble(g1_array[l+1].split(" ")[1]));
  326 +
  327 + ps.add(Point1);
  328 +
  329 + ps.add(Point2);
  330 +
  331 + boolean b = GeoUtils.isInSection(ps, p);
  332 +
  333 + if(b)
  334 + return l;
  335 +
  336 + }
  337 + return 0;
  338 + }
  339 +
  340 + @Transactional
  341 + public Map<String, Object> roadUpd(Map<String, Object> map) {
  342 + /** 返回值 {status:SUCCESS}成功 或者 {status:ERROR}失败*/
  343 + Map<String, Object> resultMap = new HashMap<String, Object>();
  344 + try {
  345 + Integer code = Integer.parseInt(map.get("code").toString());
  346 + Integer sSpeedId = Integer.parseInt(map.get("sSpeedId").toString());
  347 + String roadName = map.get("roadName").toString();
  348 + Double speed = Double.parseDouble(map.get("speed").toString());
  349 + Integer id = Integer.parseInt(map.get("id").toString());
  350 + sectionSpeedRepository.roadUpdCode(code, sSpeedId);
  351 + sectionSpeedRepository.sSpeedUpd(roadName, speed, id);
  352 + resultMap.put("status", ResponseCode.SUCCESS);
  353 + } catch (Exception e) {
  354 +
  355 + resultMap.put("status", ResponseCode.ERROR);
  356 +
  357 + logger.error("save erro.", e);
  358 +
  359 + }
  360 + return resultMap;
  361 + }
  362 +}
... ...
src/main/java/com/bsth/service/schedule/CarConfigInfoServiceImpl.java
1 1 package com.bsth.service.schedule;
2 2  
  3 +import com.bsth.common.ResponseCode;
3 4 import com.bsth.entity.schedule.CarConfigInfo;
  5 +import com.bsth.entity.schedule.rule.ScheduleRule1Flat;
  6 +import com.bsth.repository.schedule.CarConfigInfoRepository;
4 7 import com.bsth.service.impl.BaseServiceImpl;
  8 +import org.springframework.beans.factory.annotation.Autowired;
5 9 import org.springframework.stereotype.Service;
6 10  
  11 +import javax.transaction.Transactional;
  12 +import java.util.*;
  13 +
7 14 /**
8 15 * Created by xu on 16/5/9.
9 16 */
10 17 @Service
11 18 public class CarConfigInfoServiceImpl extends BaseServiceImpl<CarConfigInfo, Long> implements CarConfigInfoService {
  19 + @Autowired
  20 + private CarConfigInfoRepository carConfigInfoRepository;
  21 + @Autowired
  22 + private ScheduleRule1FlatService scheduleRule1FlatService;
  23 +
  24 + @Override
  25 + @Transactional
  26 + public Map<String, Object> delete(Long aLong) {
  27 + // 获取待作废的车辆配置
  28 + CarConfigInfo carConfigInfo = carConfigInfoRepository.findOne(aLong);
  29 + // 查询有无规则使用过此车辆配置
  30 + Map<String, Object> param = new HashMap<>();
  31 + param.put("carConfigInfo.id_eq", carConfigInfo.getId());
  32 + Iterator<ScheduleRule1Flat> scheduleRule1FlatIterator =
  33 + scheduleRule1FlatService.list(param).iterator();
  34 + boolean isExist = false;
  35 + while (scheduleRule1FlatIterator.hasNext()) {
  36 + ScheduleRule1Flat scheduleRule1Flat = scheduleRule1FlatIterator.next();
  37 + if (scheduleRule1Flat.getCarConfigInfo().getId().equals(carConfigInfo.getId())) {
  38 + isExist = true;
  39 + break;
  40 + }
  41 + }
  42 +
  43 + Map<String, Object> map = new HashMap<>();
  44 +
  45 + if (isExist) {
  46 + throw new RuntimeException("车辆配置已被规则使用,不能删除,请先修改规则!");
  47 + } else {
  48 + carConfigInfo.setIsCancel(true);
  49 + map.put("status", ResponseCode.SUCCESS);
  50 + }
  51 +
  52 + return map;
  53 +
  54 + }
12 55 }
... ...
src/main/java/com/bsth/service/schedule/EmployeeConfigInfoServiceImpl.java
1 1 package com.bsth.service.schedule;
2 2  
  3 +import com.bsth.common.ResponseCode;
  4 +import com.bsth.entity.Line;
3 5 import com.bsth.entity.schedule.EmployeeConfigInfo;
  6 +import com.bsth.entity.schedule.rule.ScheduleRule1Flat;
  7 +import com.bsth.repository.schedule.EmployeeConfigInfoRepository;
4 8 import com.bsth.service.impl.BaseServiceImpl;
  9 +import org.springframework.beans.factory.annotation.Autowired;
5 10 import org.springframework.stereotype.Service;
6 11  
  12 +import javax.transaction.Transactional;
  13 +import java.util.*;
  14 +
7 15 /**
8 16 * Created by xu on 16/5/10.
9 17 */
10 18 @Service
11 19 public class EmployeeConfigInfoServiceImpl extends BaseServiceImpl<EmployeeConfigInfo, Long> implements EmployeeConfigInfoService {
  20 + @Autowired
  21 + private EmployeeConfigInfoRepository employeeConfigInfoRepository;
  22 + @Autowired
  23 + private ScheduleRule1FlatService scheduleRule1FlatService;
  24 +
  25 +
  26 + @Override
  27 + @Transactional
  28 + public Map<String, Object> delete(Long aLong) {
  29 + // 获取待作废的人员配置
  30 + EmployeeConfigInfo employeeConfigInfo = employeeConfigInfoRepository.findOne(aLong);
  31 + // 获取线路
  32 + Line xl = employeeConfigInfo.getXl();
  33 + // 查找线路的规则,比较人员配置信息
  34 + Map<String, Object> param = new HashMap<>();
  35 + param.put("xl.id_eq", xl.getId());
  36 + Iterator<ScheduleRule1Flat> employeeConfigInfoIterator = scheduleRule1FlatService.list(param).iterator();
  37 + List<String> ryConfigIds = new ArrayList<>();
  38 + while (employeeConfigInfoIterator.hasNext()) {
  39 + ScheduleRule1Flat scheduleRule1Flat = employeeConfigInfoIterator.next();
  40 + ryConfigIds.addAll(Arrays.asList(scheduleRule1Flat.getRyConfigIds().split(",")));
  41 + }
  42 +
  43 + Map<String, Object> map = new HashMap<>();
  44 +
  45 + if (ryConfigIds.contains(employeeConfigInfo.getId().toString())) {
  46 + throw new RuntimeException("人员配置已被规则使用,不能删除,请先修改规则!");
  47 + } else {
  48 + employeeConfigInfo.setIsCancel(true);
  49 + map.put("status", ResponseCode.SUCCESS);
  50 + }
  51 +
  52 + return map;
  53 + }
  54 +
12 55 }
... ...
src/main/java/com/bsth/util/Geo/AnalySection.java 0 → 100644
  1 +package com.bsth.util.Geo;
  2 +
  3 +import java.sql.Connection;
  4 +import java.sql.PreparedStatement;
  5 +import java.sql.ResultSet;
  6 +import java.sql.SQLException;
  7 +import java.util.ArrayList;
  8 +import java.util.HashMap;
  9 +import java.util.List;
  10 +import java.util.Map;
  11 +
  12 +import org.junit.Test;
  13 +
  14 +import com.bsth.util.db.DBUtils_MS;
  15 +
  16 +public class AnalySection {
  17 +
  18 + public static void main(String[] args) {
  19 +
  20 + String pt = "LINESTRING(121.427084 31.023463, 121.428111 31.0209, 121.428239 31.020581, 121.428282 31.020473, 121.428282 31.020473, 121.428428 31.020522, 121.43158 31.021588, 121.432536 31.021911, 121.432913 31.022039, 121.433123 31.02211, 121.433125 31.02211, 121.433162 31.022123, 121.434294 31.022493, 121.435396 31.022854, 121.435655 31.022939, 121.435665 31.022942, 121.435853 31.023003, 121.436642 31.023259, 121.437547 31.023553, 121.438305 31.023799, 121.438766 31.023948, 121.439166 31.024078, 121.439498 31.024185, 121.440023 31.024356, 121.440195 31.024412, 121.440553 31.024528, 121.440555 31.024529, 121.44287 31.025288, 121.44287 31.025288, 121.443571 31.023482, 121.443571 31.023481, 121.443741 31.023072, 121.443741 31.023071, 121.444873 31.020715, 121.444873 31.020715, 121.445904 31.018896, 121.445904 31.018896, 121.44595 31.018908, 121.448164 31.019475, 121.448169 31.019476, 121.448874 31.019683, 121.450747 31.020041, 121.452977 31.020467, 121.45356 31.020578, 121.453619 31.02059, 121.453624 31.020591, 121.458521 31.021501, 121.45859 31.021514, 121.458592 31.021514, 121.46086 31.021921, 121.460939 31.021935, 121.462975 31.0223, 121.464179 31.022516, 121.46471 31.022611, 121.466105 31.02298, 121.466738 31.023148, 121.466742 31.023149, 121.468916 31.023743, 121.470353 31.024135, 121.470353 31.024135, 121.470276 31.024269, 121.470208 31.024405, 121.470141 31.02456, 121.470114 31.024664, 121.470074 31.024776, 121.470024 31.024888, 121.46997 31.025012, 121.469912 31.025198, 121.469854 31.025434, 121.469804 31.025612, 121.46975 31.025809, 121.469499 31.026165, 121.469319 31.02642, 121.469018 31.026718, 121.468695 31.027043, 121.468542 31.027194, 121.468623 31.027403, 121.468744 31.027704, 121.468928 31.028157, 121.46913 31.028679, 121.469337 31.029197, 121.469467 31.029495, 121.469575 31.029801, 121.469683 31.03006, 121.469223 31.030134, 121.468539 31.030406, 121.467866 31.030848, 121.467374 31.031456, 121.466971 31.032342, 121.467139 31.032383, 121.467994 31.032594, 121.468055 31.032609, 121.468274 31.032663, 121.470605 31.033238, 121.470968 31.033327, 121.471741 31.033518, 121.471742 31.033518, 121.474855 31.034286, 121.475005 31.034323, 121.476549 31.034704, 121.476632 31.034725, 121.476632 31.034725, 121.47662 31.034806, 121.476218 31.037582, 121.476217 31.037587, 121.476177 31.037872, 121.476114 31.038324, 121.47591 31.039777, 121.47575 31.04091, 121.475525 31.042514, 121.475505 31.042654, 121.475491 31.042754, 121.475467 31.042925, 121.475405 31.043366, 121.475326 31.043928, 121.475135 31.04529, 121.475127 31.04535, 121.475113 31.04545, 121.475087 31.045632, 121.475086 31.045637, 121.475032 31.046043, 121.474851 31.047386, 121.474734 31.048258, 121.474734 31.048258, 121.474643 31.048231, 121.473857 31.048001, 121.473609 31.047928, 121.473145 31.047792, 121.472745 31.047675, 121.472411 31.047577, 121.47195 31.047442, 121.471853 31.047413, 121.471565 31.047333, 121.471589 31.047337, 121.471107 31.047196, 121.470985 31.047155, 121.47046 31.046997, 121.469858 31.046811, 121.469571 31.046718, 121.469256 31.046641, 121.468717 31.046471, 121.467855 31.046215, 121.467514 31.046115, 121.467338 31.046803, 121.467226 31.047198, 121.467145 31.047488, 121.467042 31.047832, 121.466966 31.048103, 121.466878 31.04838, 121.466878 31.04838, 121.465844 31.048174, 121.464972 31.048001, 121.46497 31.048001, 121.464618 31.04794, 121.464088 31.047848, 121.463501 31.047746, 121.463204 31.047694, 121.463144 31.047684, 121.462691 31.047605, 121.462691 31.047605, 121.46234 31.047532, 121.461527 31.047362, 121.461477 31.047352, 121.461265 31.047321, 121.460833 31.047258, 121.459616 31.047081, 121.459201 31.047021, 121.4592 31.047021, 121.457806 31.046907, 121.457717 31.047577, 121.457685 31.047818, 121.457635 31.048199, 121.457634 31.048209, 121.457605 31.048459, 121.457595 31.048549, 121.457624 31.050018, 121.457614 31.050178, 121.457598 31.050428, 121.457749 31.050423, 121.457897 31.050427, 121.458072 31.050415, 121.458194 31.050415, 121.458405 31.050415, 121.45853 31.050423, 121.458751 31.050415, 121.458818 31.050415, 121.458818 31.050419, 121.458831 31.050419)";
  21 +
  22 + Connection conn = null;
  23 +
  24 + PreparedStatement ps = null;
  25 +
  26 + ResultSet rs = null;
  27 +
  28 + String sqlSelect = "SELECT ST_AsText(g.bdjw) as SHAPE , g.OGR_FID as id FROM gjld g";
  29 +
  30 + String sqlIntersects = "SELECT ST_Contains(ST_Buffer(ST_GeomFromText(?),0.0005),ST_GeomFromText(?)) AS result";
  31 +
  32 + List<Map<String, Object>> list = new ArrayList<>();
  33 +
  34 + try {
  35 + conn = DBUtils_MS.getConnection();
  36 +
  37 + ps = conn.prepareStatement(sqlSelect);
  38 +
  39 + rs = ps.executeQuery();
  40 +
  41 + while (rs.next()) {
  42 +
  43 + Map<String, Object> map = new HashMap<String, Object>();
  44 +
  45 + map.put("shape", rs.getString("SHAPE"));
  46 +
  47 + map.put("id", rs.getInt("id"));
  48 +
  49 + list.add(map);
  50 + }
  51 +
  52 + ps = null;
  53 +
  54 + rs = null;
  55 +
  56 + for(int i =0;i<list.size();i++) {
  57 +
  58 + ps = conn.prepareStatement(sqlIntersects);
  59 +
  60 + ps.setString(1, pt);
  61 +
  62 + ps.setString(2, list.get(i).get("shape").toString());
  63 +
  64 + rs = ps.executeQuery();
  65 +
  66 + while (rs.next()) {
  67 +
  68 + if(rs.getInt("result")==1) {
  69 + System.out.println(list.get(i).get("id").toString() + "*********************相交");
  70 + }
  71 +
  72 + /*System.out.println(rs.getInt("result"));*/
  73 +
  74 + }
  75 +
  76 + }
  77 + } catch (SQLException e) {
  78 + // TODO Auto-generated catch block
  79 + e.printStackTrace();
  80 + }
  81 + }
  82 +
  83 +}
... ...
src/main/java/com/bsth/util/Geo/Bounds.java 0 → 100644
  1 +package com.bsth.util.Geo;
  2 +
  3 +public final class Bounds {
  4 +
  5 + private Point northEast;
  6 + private Point southWest;
  7 +
  8 + public Bounds(Point min, Point max) {
  9 + this.southWest = min;
  10 + this.northEast = max;
  11 + }
  12 +
  13 + public Point getNorthEast() {
  14 + return northEast;
  15 + }
  16 +
  17 + public Point getSouthWest() {
  18 + return southWest;
  19 + }
  20 +}
... ...
src/main/java/com/bsth/util/Geo/Circle.java 0 → 100644
  1 +package com.bsth.util.Geo;
  2 +
  3 +public final class Circle {
  4 +
  5 + private Point center;
  6 + private double radius;
  7 +
  8 + public Circle(Point c, double r) {
  9 + this.center = c;
  10 + this.radius = r;
  11 + }
  12 +
  13 + public Point getCenter() {
  14 + return center;
  15 + }
  16 +
  17 + public double getRadius() {
  18 + return radius;
  19 + }
  20 +}
... ...
src/main/java/com/bsth/util/Geo/GeoUtils.java 0 → 100644
  1 +package com.bsth.util.Geo;
  2 +
  3 +import java.util.ArrayList;
  4 +import java.util.List;
  5 +
  6 +
  7 +public class GeoUtils {
  8 +
  9 + private final static double EARTH_RADIUS = 6378137;
  10 + private final static double INLINE_THRESHOLD = Integer.parseInt("120");
  11 + private final static double DRIFT_THRESHOLD = Integer.parseInt("2000");
  12 +
  13 + public static boolean isPointInRect(Point point, Bounds bounds) {
  14 + Point sw = bounds.getSouthWest(); // 西南脚点
  15 + Point ne = bounds.getNorthEast(); // 东北脚点
  16 + return (point.getLon() >= sw.getLon() && point.getLon() <= ne.getLon()
  17 + && point.getLat() >= sw.getLat() && point.getLat() <= ne
  18 + .getLat());
  19 + }
  20 +
  21 + public static boolean isPointInCircle(Point point, Circle circle) {
  22 + // point与圆心距离小于圆形半径,则点在圆内,否则在圆外
  23 + Point c = circle.getCenter();
  24 + double r = circle.getRadius();
  25 +
  26 + double dis = getDistance(point, c);
  27 + if (dis <= r) {
  28 + return true;
  29 + } else {
  30 + return false;
  31 + }
  32 + }
  33 +
  34 + public static boolean isPointInPolygon(Point point, Polygon polygon) {
  35 + Bounds polygonBounds = polygon.getBounds();
  36 + if (!isPointInRect(point, polygonBounds)) {
  37 + return false;
  38 + }
  39 +
  40 + List<Point> pts = polygon.getPoints();// 获取多边形点
  41 +
  42 + // 下述代码来源:http://paulbourke.net/geometry/insidepoly/,进行了部分修改
  43 + // 基本思想是利用射线法,计算射线与多边形各边的交点,如果是偶数,则点在多边形外,否则
  44 + // 在多边形内。还会考虑一些特殊情况,如点在多边形顶点上,点在多边形边上等特殊情况。
  45 +
  46 + int N = pts.size();
  47 + boolean boundOrVertex = true; // 如果点位于多边形的顶点或边上,也算做点在多边形内,直接返回true
  48 + int intersectCount = 0;// cross points count of x
  49 + double precision = 2e-10; // 浮点类型计算时候与0比较时候的容差
  50 + Point p1, p2;// neighbour bound vertices
  51 + Point p = point; // 测试点
  52 +
  53 + p1 = pts.get(0);// left vertex
  54 + for (int i = 1; i <= N; ++i) {// check all rays
  55 + if (p.equals(p1)) {
  56 + return boundOrVertex;// p is an vertex
  57 + }
  58 +
  59 + p2 = pts.get(i % N);// right vertex
  60 + if (p.getLat() < Math.min(p1.getLat(), p2.getLat())
  61 + || p.getLat() > Math.max(p1.getLat(), p2.getLat())) {// ray
  62 + // is
  63 + // outside
  64 + // of
  65 + // our
  66 + // interests
  67 + p1 = p2;
  68 + continue;// next ray left point
  69 + }
  70 +
  71 + if (p.getLat() > Math.min(p1.getLat(), p2.getLat())
  72 + && p.getLat() < Math.max(p1.getLat(), p2.getLat())) {// ray
  73 + // is
  74 + // crossing
  75 + // over
  76 + // by
  77 + // the
  78 + // algorithm
  79 + // (common
  80 + // part
  81 + // of)
  82 + if (p.getLon() <= Math.max(p1.getLon(), p2.getLon())) {// x is
  83 + // before
  84 + // of
  85 + // ray
  86 + if (p1.getLat() == p2.getLat()
  87 + && p.getLon() >= Math.min(p1.getLon(), p2.getLon())) {// overlies
  88 + // on
  89 + // a
  90 + // horizontal
  91 + // ray
  92 + return boundOrVertex;
  93 + }
  94 +
  95 + if (p1.getLon() == p2.getLon()) {// ray is vertical
  96 + if (p1.getLon() == p.getLon()) {// overlies on a
  97 + // vertical ray
  98 + return boundOrVertex;
  99 + } else {// before ray
  100 + ++intersectCount;
  101 + }
  102 + } else {// cross point on the left side
  103 + double xinters = (p.getLat() - p1.getLat())
  104 + * (p2.getLon() - p1.getLon())
  105 + / (p2.getLat() - p1.getLat()) + p1.getLon();// cross
  106 + // point
  107 + // of
  108 + // lng
  109 + if (Math.abs(p.getLon() - xinters) < precision) {// overlies
  110 + // on
  111 + // a
  112 + // ray
  113 + return boundOrVertex;
  114 + }
  115 +
  116 + if (p.getLon() < xinters) {// before ray
  117 + ++intersectCount;
  118 + }
  119 + }
  120 + }
  121 + } else {// special case when ray is crossing through the vertex
  122 + if (p.getLat() == p2.getLat() && p.getLon() <= p2.getLon()) {// p
  123 + // crossing
  124 + // over
  125 + // p2
  126 + Point p3 = pts.get((i + 1) % N); // next vertex
  127 + if (p.getLat() >= Math.min(p1.getLat(), p3.getLat())
  128 + && p.getLat() <= Math.max(p1.getLat(), p3.getLat())) {// p.lat
  129 + // lies
  130 + // between
  131 + // p1.lat
  132 + // &
  133 + // p3.lat
  134 + ++intersectCount;
  135 + } else {
  136 + intersectCount += 2;
  137 + }
  138 + }
  139 + }
  140 + p1 = p2;// next ray left point
  141 + }
  142 +
  143 + if (intersectCount % 2 == 0) {// 偶数在多边形外
  144 + return false;
  145 + } else { // 奇数在多边形内
  146 + return true;
  147 + }
  148 + }
  149 +
  150 + private static double degreeToRad(double degree) {
  151 + return Math.PI * degree / 180;
  152 + }
  153 +
  154 + private static double radToDegree(double rad) {
  155 + return (180 * rad) / Math.PI;
  156 + }
  157 +
  158 + private static double getRange(double v, double a, double b) {
  159 + v = Math.min(Math.max(v, a), b);
  160 + return v;
  161 + }
  162 +
  163 + private static double getLoop(double v, double a, double b) {
  164 + while (v > b) {
  165 + v -= b - a;
  166 + }
  167 + while (v < a) {
  168 + v += b - a;
  169 + }
  170 + return v;
  171 + }
  172 +
  173 + /**
  174 + * 判断点是否在某个路段
  175 + * @param ps
  176 + * @param p
  177 + * @return
  178 + */
  179 + public static boolean isInSection(List<Point> ps, Point p) {
  180 + for (int i = 0, len = ps.size();i < len - 1;i++) {
  181 + if (isInSection(ps.get(i), ps.get(i + 1), p)) return true;
  182 + }
  183 + return false;
  184 + }
  185 +
  186 + /**
  187 + * 判断点是否在某个线段上
  188 + * @param lp1
  189 + * @param lp2
  190 + * @param p
  191 + * @return
  192 + */
  193 + private static boolean isInSection(Point lp1, Point lp2, Point p) {
  194 + double a = lp1.getLat() - lp2.getLat(), b = lp2.getLon() - lp1.getLon(), c = lp1.getLon()*lp2.getLat() - lp2.getLon()*lp1.getLat();
  195 + double lon = (Math.pow(b, 2)*p.getLon() - a*b*p.getLat() - a*c)/(Math.pow(a, 2) + Math.pow(b, 2));
  196 + double lat = (Math.pow(a, 2)*p.getLat() - a*b*p.getLon() - b*c)/(Math.pow(a, 2) + Math.pow(b, 2));
  197 + Point vp = new Point(lon, lat);
  198 + return getDistance(p, vp) < INLINE_THRESHOLD && isBetween(lp1, lp2, vp);
  199 + }
  200 +
  201 + private static boolean isBetween(Point lp1, Point lp2, Point p) {
  202 + double lon1 = lp1.getLon(), lat1 = lp1.getLat();
  203 + double lon2 = lp2.getLon(), lat2 = lp2.getLat();
  204 + double lon = p.getLon(), lat = p.getLat();
  205 + return (lon > lon1 && lon < lon2 || lon > lon2 && lon < lon1) || (lat > lat1 && lat < lat2 || lat > lat2 && lat < lat1);
  206 + }
  207 +
  208 + public static boolean isDrift(Point p1, Point p2) {
  209 + return getDistance(p1, p2) > DRIFT_THRESHOLD;
  210 + }
  211 +
  212 + public static double getDistance(Point p1, Point p2) {
  213 + double lng1 = getLoop(p1.getLon(), -180, 180), lat1 = getRange(
  214 + p1.getLat(), -74, 74);
  215 + double lng2 = getLoop(p2.getLon(), -180, 180), lat2 = getRange(
  216 + p2.getLat(), -74, 74);
  217 +
  218 + double x1, x2, y1, y2;
  219 + x1 = degreeToRad(lng1);
  220 + y1 = degreeToRad(lat1);
  221 + x2 = degreeToRad(lng2);
  222 + y2 = degreeToRad(lat2);
  223 + return EARTH_RADIUS
  224 + * Math.acos((Math.sin(y1) * Math.sin(y2) + Math.cos(y1)
  225 + * Math.cos(y2) * Math.cos(x2 - x1)));
  226 + }
  227 +
  228 + public static void main(String args[]) {
  229 + String a = "121.644416 31.195991, 121.643949 31.195928, 121.64364 31.195886";
  230 + List<Point> points = new ArrayList<>();
  231 + for(String t1 : a.split(", ")){
  232 + String[] arr = t1.split(" ");
  233 + Point p = new Point(Double.parseDouble(arr[0]), Double.parseDouble(arr[1]));
  234 + points.add(p);
  235 + }
  236 + System.out.println(isInSection(points, new Point(121.644416, 31.195991)));
  237 + }
  238 +}
... ...
src/main/java/com/bsth/util/Geo/Point.java 0 → 100644
  1 +package com.bsth.util.Geo;
  2 +
  3 +public class Point {
  4 +
  5 + private double lon;
  6 + private double lat;
  7 +
  8 + public Point(double lon, double lat) {
  9 + this.lon = lon;
  10 + this.lat = lat;
  11 + }
  12 +
  13 + public double getLon() {
  14 + return lon;
  15 + }
  16 +
  17 + public double getLat() {
  18 + return lat;
  19 + }
  20 +}
... ...
src/main/java/com/bsth/util/Geo/Polygon.java 0 → 100644
  1 +package com.bsth.util.Geo;
  2 +
  3 +import java.util.ArrayList;
  4 +import java.util.List;
  5 +
  6 +public final class Polygon {
  7 +
  8 + private List<Point> points;
  9 + private Bounds bounds;
  10 +
  11 + public Polygon(List<Point> ps) {
  12 + this.points = new ArrayList<Point>(ps);
  13 + double minlon = 200, minlat = 200, maxlon = -1, maxlat = -1;
  14 + for (Point p : ps) {
  15 + minlon = p.getLon() < minlon ? p.getLon() : minlon;
  16 + minlat = p.getLat() < minlat ? p.getLat() : minlat;
  17 + maxlon = p.getLon() > maxlon ? p.getLon() : maxlon;
  18 + maxlat = p.getLat() > maxlat ? p.getLat() : maxlat;
  19 + }
  20 + bounds = new Bounds(new Point(minlon, minlat), new Point(maxlon, maxlat));
  21 + }
  22 +
  23 + public List<Point> getPoints() {
  24 + return new ArrayList<Point>(points);
  25 + }
  26 +
  27 + public Bounds getBounds() {
  28 + return bounds;
  29 + }
  30 +}
... ...
src/main/java/com/bsth/util/Geo/SHCJ2BDJW.java 0 → 100644
  1 +package com.bsth.util.Geo;
  2 +
  3 +import java.sql.Connection;
  4 +import java.sql.PreparedStatement;
  5 +import java.sql.ResultSet;
  6 +import java.sql.SQLException;
  7 +import java.util.ArrayList;
  8 +import java.util.HashMap;
  9 +import java.util.List;
  10 +import java.util.Map;
  11 +
  12 +
  13 +import com.bsth.util.JWDUtil;
  14 +import com.bsth.util.TransGPS;
  15 +import com.bsth.util.TransGPS.Location;
  16 +import com.bsth.util.db.DBUtils_MS;
  17 +
  18 +public class SHCJ2BDJW {
  19 +
  20 + public static void main(String[] args) {
  21 +
  22 + Connection conn = null;
  23 +
  24 + PreparedStatement ps = null;
  25 +
  26 + ResultSet rs = null;
  27 +
  28 + String sqlSelect = "SELECT b.SHAPESTRING as SHAPE , b.id as ID FROM jjwgps_t_gjldb b where SHAPESTRING is not null order by b.ldbh asc ";
  29 +
  30 + String sqlUpdate = "UPDATE jjwgps_t_gjldb SET bdjw = GeomFromText(?),SHAPE = GeomFromText(?) where id = ?";
  31 +
  32 + List<Map<String, Object>> list = new ArrayList<>();
  33 +
  34 + try {
  35 + conn = DBUtils_MS.getConnection();
  36 +
  37 + ps = conn.prepareStatement(sqlSelect);
  38 +
  39 + rs = ps.executeQuery();
  40 +
  41 + while (rs.next()) {
  42 +
  43 + Map<String, Object> map = new HashMap<String, Object>();
  44 +
  45 + map.put("shape", rs.getString("SHAPE"));
  46 +
  47 + map.put("id", rs.getInt("ID"));
  48 +
  49 + list.add(map);
  50 + }
  51 +
  52 + for(int i =0;i<list.size();i++) {
  53 +
  54 + Map<String, Object> temp = list.get(i);
  55 +
  56 + String lineString = temp.get("shape").toString();
  57 + /*String lineString = "LINESTRING (13532.5305161702 -3677.63275264995, 13433.22401617 -3881.74765264988)";*/
  58 +
  59 +
  60 + String arrayP[] = lineString.substring(lineString.indexOf("(")+1, lineString.length()-1).split(", ");
  61 +
  62 + int id = Integer.parseInt(temp.get("id").toString());
  63 + String geometry = "";
  64 +
  65 + for(int k =0;k<arrayP.length;k++) {
  66 +
  67 + String arrayXY[] = arrayP[k].split(" ");
  68 +
  69 + Double lng = Double.parseDouble(arrayXY[0]);
  70 +
  71 + Double lat = Double.parseDouble(arrayXY[1]);
  72 +
  73 + Map map_2 = JWDUtil.ConvertSHToJW(lng,lat);
  74 +
  75 + Location location = TransGPS.LocationMake(Float.parseFloat(map_2.get("x").toString()), Float.parseFloat(map_2.get("y").toString()));
  76 +
  77 + location = TransGPS.bd_encrypt(TransGPS.transformFromWGSToGCJ(location));
  78 +
  79 + if(k==arrayP.length-1)
  80 + geometry = geometry + (location.getLng()+0.000727) + " " + (location.getLat() - 0.0000624);
  81 + else
  82 + geometry = geometry + (location.getLng()+0.000727) + " " + (location.getLat() - 0.0000624) + ",";
  83 +
  84 +
  85 + }
  86 +
  87 + ps = null;
  88 +
  89 + geometry = "LINESTRING(" + geometry +")";
  90 +
  91 + ps = conn.prepareStatement(sqlUpdate);
  92 +
  93 + ps.setString(1, geometry);
  94 +
  95 + ps.setString(2, lineString);
  96 +
  97 + ps.setInt(3, id);
  98 +
  99 + int stauts = ps.executeUpdate();
  100 +
  101 + }
  102 +
  103 + } catch (SQLException e) {
  104 + // TODO Auto-generated catch block
  105 + e.printStackTrace();
  106 + }
  107 + }
  108 +
  109 +}
... ...
src/main/java/com/bsth/util/JWDUtil.java 0 → 100644
  1 +/**
  2 + * JWDUtil.java
  3 + * com.bsth.web.service
  4 + * JwdChange
  5 + */
  6 +package com.bsth.util;
  7 +
  8 +import java.util.HashMap;
  9 +import java.util.Map;
  10 +
  11 +import com.bsth.util.TransGPS.Location;
  12 +
  13 +/**
  14 + * @author caiwangjue
  15 + * @date 2011-10-13 上午09:53:40
  16 + * 经纬度和城建坐标互转
  17 + */
  18 +public class JWDUtil {
  19 +
  20 + /**
  21 + * 经纬度坐标转换成上海城建坐标
  22 + * @param fLon 经度
  23 + * @param fLat 纬度
  24 + * @return 城建坐标Map
  25 + */
  26 + @SuppressWarnings("rawtypes")
  27 + public static Map ConvertJWToSH(double fLon, double fLat)
  28 + {
  29 + double jd = fLon;
  30 + double wd = fLat;
  31 + Map map = ConvertJWDToBeijing(jd, wd);
  32 + //Map rmap = ConvertBeijingToShanghai((Double)map.get("x"), (Double)map.get("y"));
  33 + return map;
  34 + }
  35 +
  36 + /**
  37 + * 上海城建坐标转换为经纬度
  38 + * @param fXX X坐标
  39 + * @param fYY Y坐标
  40 + * @return 经纬度坐标Map
  41 + */
  42 + @SuppressWarnings("rawtypes")
  43 + public static Map ConvertSHToJW(double fXX, double fYY)
  44 + {
  45 + double x = fXX;
  46 + double y = fYY;
  47 + Map map = ConvertShanghaiToBeijing(x, y);
  48 + Map rmap = ConvertBeijingToJWD((Double)map.get("x"), (Double)map.get("y"));
  49 + return rmap;
  50 + }
  51 +
  52 +
  53 + /**
  54 + * 经纬度坐标转换成北京城建坐标
  55 + * @param jd 经度
  56 + * @param wd 纬度
  57 + * @return 城建坐标Map
  58 + */
  59 + @SuppressWarnings({ "unchecked", "rawtypes" })
  60 + private static Map ConvertJWDToBeijing(double jd, double wd)
  61 + {
  62 + Map map = new HashMap();
  63 + double num = 121.4671606;
  64 + double num2 = jd - num;
  65 + double num3 = num2 / 57.2957795130823;
  66 + double a = (wd / 180.0) * Math.PI;
  67 + double num5 = Math.tan(a);
  68 + double num6 = Math.cos(a);
  69 + double num7 = (0.006738525415 * num6) * num6;
  70 + double num8 = num5 * num5;
  71 + double d = 1.0 + num7;
  72 + double num10 = 6399698.9018 / Math.sqrt(d);
  73 + double num11 = ((num3 * num3) * num6) * num6;
  74 + double num12 = num5 * num6;
  75 + double num13 = num12 * num12;
  76 + double num14 = 32005.78006 + (num13 * (133.92133 + (num13 * 0.7031)));
  77 + double num15 = (((6367558.49686 * wd) / 57.29577951308) - ((num12 * num6) * num14)) + ((((((((((((((num8 - 58.0) * num8) + 61.0) * num11) / 30.0) + (((4.0 * num7) + 5.0) * d)) - num8) * num11) / 12.0) + 1.0) * num10) * num5) * num11) / 2.0);
  78 + double num16 = ((((((((((((num8 - 18.0) * num8) - (((58.0 * num8) - 14.0) * num7)) + 5.0) * num11) / 20.0) + d) - num8) * num11) / 6.0) + 1.0) * num10) * (num3 * num6);
  79 + map.put("x", (num15 + -3457140.589));
  80 + map.put("y", num16);
  81 + return map;
  82 + }
  83 +
  84 + /**
  85 + * 上海城建坐标转换为北京城建坐标
  86 + * @param x X坐标
  87 + * @param y Y坐标
  88 + * @return 城建坐标Map
  89 + */
  90 + @SuppressWarnings({ "rawtypes", "unchecked" })
  91 + private static Map ConvertShanghaiToBeijing(double x, double y)
  92 + {
  93 + Map map = new HashMap();
  94 + double num = x;
  95 + x = y;
  96 + y = num;
  97 + double num2 = 3458144.04;
  98 + double num3 = -146121.96;
  99 + double num4 = 1.000140682;
  100 + double num5 = 0.013930556;
  101 + double num6 = (num2 + (num4 * x)) - (num5 * y);
  102 + double num7 = (num3 + (num4 * y)) + (num5 * x);
  103 + map.put("x", num6);
  104 + map.put("y", (num7 + 21000000.0) + 500000.0);
  105 + return map;
  106 + }
  107 +
  108 + /**
  109 + * 北京城建坐标转换为上海城建坐标
  110 + * @param x X坐标
  111 + * @param y Y坐标
  112 + * @return 城建坐标Map
  113 + */
  114 + @SuppressWarnings({ "rawtypes", "unused", "unchecked" })
  115 + private static Map ConvertBeijingToShanghai(double x, double y)
  116 + {
  117 + Map map = new HashMap();
  118 + double num = 3458144.04;
  119 + double num2 = -146121.96;
  120 + double num3 = 1.000140682;
  121 + double num4 = 0.013930556;
  122 + y -= 21500000.0;
  123 + double num5 = ((num3 * (x - num)) + (num4 * (y - num2))) / (Math.pow(num3, 2.0) + Math.pow(num4, 2.0));
  124 + double num6 = ((num3 * (y - num2)) - (num4 * (x - num))) / (Math.pow(num3, 2.0) + Math.pow(num4, 2.0));
  125 + map.put("x", num6);
  126 + map.put("y", num5);
  127 + return map;
  128 + }
  129 +
  130 + /**
  131 + * 北京城建坐标转换为经纬度
  132 + * @param x X坐标
  133 + * @param y Y坐标
  134 + * @return 经纬度坐标Map
  135 + */
  136 + @SuppressWarnings({ "rawtypes", "unchecked" })
  137 + private static Map ConvertBeijingToJWD(double x, double y)
  138 + {
  139 + Map map = new HashMap();
  140 + double num = 123.0;
  141 + y -= 21500000.0;
  142 + double num2 = (x / 1000000.0) - 3.0;
  143 + double num3 = (((((27.11115372595 + (9.02468257083 * num2)) - (0.00579740442 * Math.pow(num2, 2.0))) - (0.00043532572 * Math.pow(num2, 3.0))) + (4.857285E-05 * Math.pow(num2, 4.0))) + (2.15727E-06 * Math.pow(num2, 5.0))) - (1.9288E-07 * Math.pow(num2, 6.0));
  144 + double num4 = Math.tan((num3 * Math.PI) / 180.0);
  145 + double num5 = 0.0067385254147 * Math.pow(Math.cos((num3 * Math.PI) / 180.0), 2.0);
  146 + double num6 = (y * Math.sqrt(1.0 + num5)) / 6399698.90178271;
  147 + double num7 = num3 - ((((1.0 + num5) * num4) * (((90.0 * Math.pow(num6, 2.0)) - ((7.5 * ((5.0 + (3.0 * Math.pow(num4, 2.0))) -
  148 + ((9.0 * num5) * Math.pow(num5, 2.0)))) * Math.pow(num6, 4.0))) + ((0.25 * ((61.0 + (90.0 * Math.pow(num5, 2.0)))
  149 + + (45.0 * Math.pow(num4, 4.0)))) * Math.pow(num6, 6.0)))) / Math.PI);
  150 + double num8 = (((180.0 * num6) - ((30.0 * ((1.0 + (2.0 * Math.pow(num4, 2.0))) + num5)) * Math.pow(num6, 3.0))) +
  151 + ((1.5 * ((5.0 + (28.0 * Math.pow(num4, 2.0))) + (24.0 * Math.pow(num4, 4.0)))) * Math.pow(num6, 5.0))) / (Math.PI * Math.cos((num3 * Math.PI) / 180.0));
  152 + double num9 = num + num8;
  153 + map.put("x", num9);
  154 + map.put("y", num7);
  155 + return map;
  156 + }
  157 +
  158 + @SuppressWarnings({ "rawtypes", "unused" })
  159 + private static Map ConvertJWDToSH(double x, double y)
  160 + {
  161 + Map map = new HashMap();
  162 + double num = 123.0;
  163 +
  164 + return map;
  165 + }
  166 +
  167 + public static void main(String[] args)
  168 + {
  169 + //2447.667013 351.858477
  170 + Map map = JWDUtil.ConvertJWToSH(121.56320853169203, 31.264449981962045);
  171 + /*System.out.println(map.get("x")+"####"+map.get("y"));*/
  172 +
  173 + Map map_2 = JWDUtil.ConvertSHToJW(8733.12663,103.65674);
  174 + System.out.println(map_2.get("x")+"####"+map_2.get("y"));
  175 + Location location = TransGPS.LocationMake(Float.parseFloat(map_2.get("x").toString()), Float.parseFloat(map_2.get("y").toString()));
  176 + location = TransGPS.bd_encrypt(TransGPS.transformFromWGSToGCJ(location));
  177 + System.out.println(location.getLng()+","+location.getLat());
  178 + }
  179 +}
... ...
src/main/resources/static/pages/base/sectionspeed/css/addmap.css 0 → 100644
  1 + #mapContainer{
  2 + min-width: 100%;
  3 + width: calc(100% + 26px);
  4 + /* margin-top: -28px; */
  5 + border: 2px solid #fdfdfd;
  6 + min-height: 659px;
  7 + height:100%;
  8 + overflow: hidden;
  9 + }
  10 +
  11 + .BMap_pop img:nth-child(10){
  12 +
  13 + display: none !important;
  14 +
  15 +}
  16 +
  17 + #realSearchInput, .select2-container--bootstrap .select2-selection--single {
  18 + height: 47px;
  19 + line-height: 1.42857;
  20 + padding: 6px 24px 6px 12px;
  21 + background-color: #555;
  22 + border: 1px solid #555;
  23 +}
  24 +
  25 + .select2-container--bootstrap .select2-selection--single .select2-selection__rendered {
  26 + color: #fff;
  27 + padding: 0;
  28 + margin-top: 5px;
  29 +}
  30 +.select2-container--bootstrap.select2-container--disabled .select2-selection, .select2-container--bootstrap.select2-container--disabled .select2-selection--multiple .select2-selection__choice {
  31 + background-color: #bfbfbf;
  32 +}
  33 + #pjax-container{
  34 +
  35 + overflow: hidden;
  36 + }
  37 +
  38 + /* 隐藏百度地图logo */
  39 +.anchorBL,
  40 +.anchorBL,
  41 +.amap-logo,
  42 +.amap-copyright{
  43 + display: none;
  44 +}
  45 +
  46 + .mapRightWrap.search {
  47 + height: 47px;
  48 + padding-top: 0;
  49 + background-color: #626775 !important;
  50 +}
  51 +
  52 +.mapRightWrap {
  53 + position: absolute;
  54 + width: 320px;
  55 + height: 150px;
  56 + right: 30px;
  57 + /* background-color: #3B3F51; */
  58 + background-color: #12507c;
  59 + top: 98px;
  60 + /* padding-top: 15px; */
  61 + transition: all .3s ease;
  62 +}
  63 +
  64 +.z-depth-3 {
  65 + box-shadow: 0 12px 15px 0 rgba(0,0,0,0.24),0 17px 50px 0 rgba(0,0,0,0.19);
  66 +}
  67 +
  68 +.mapRightWrap::-webkit-scrollbar-thumb {
  69 + box-shadow: 0 0 0 5px rgba(231, 236, 241, 0.52) inset;
  70 +}
  71 +
  72 +.mapRightWrap.search .input-group input {
  73 + height: 48px;
  74 + background-color: #626775;
  75 + border: 1px solid #626775;
  76 + color: white;
  77 +}
  78 +
  79 +.mapRightWrap.search .input-group .input-group-btn button {
  80 + color: #FFFFFF;
  81 + background-color: #1BBC9B;
  82 + border-color: #1BBC9B;
  83 +}
  84 +
  85 +.mapRightWrap.search .input-group-btn button {
  86 + height: 48px;
  87 + width: 80px;
  88 + font-size: 15px;
  89 +}
  90 +
0 91 \ No newline at end of file
... ...
src/main/resources/static/pages/base/sectionspeed/css/real.css 0 → 100644
  1 +
  2 +.z-depth-1{
  3 + box-shadow: 0 2px 5px 0 rgba(0,0,0,0.16),0 2px 10px 0 rgba(0,0,0,0.12);
  4 +}
  5 +
  6 +.z-depth-2 {
  7 + box-shadow: 0 8px 17px 0 rgba(0,0,0,0.2),0 6px 20px 0 rgba(0,0,0,0.19);
  8 +}
  9 +
  10 +.z-depth-3 {
  11 + box-shadow: 0 12px 15px 0 rgba(0,0,0,0.24),0 17px 50px 0 rgba(0,0,0,0.19);
  12 +}
  13 +
  14 +
  15 +
  16 +
  17 +
  18 +.mapRightWrap.vehicle .slimScrollBar{
  19 + width: 6px !important;
  20 + opacity: 0.5 !important;
  21 + background: #e7ecf1 !important;
  22 + border-radius: 5px !important;
  23 +}
  24 +
  25 +.mapRightWrap.vehicle a.fixed-line{
  26 + text-decoration: none;
  27 + position: fixed;
  28 + top: 218.5px;
  29 + width: 318px;
  30 + left: 1586px;
  31 + background-color: red;
  32 + z-index: 2;
  33 +}
  34 +
  35 +.mapRightWrap.vehicle a.fixed-line .head{
  36 + border-bottom: none;
  37 + margin: 15px 15px 10px 15px;
  38 +}
  39 +
  40 +.mapRightWrap.to_searchPanel{
  41 + transform:rotateY(180deg);
  42 + height: 200px;
  43 +}
  44 +
  45 +.mapRightWrap.to_vehicle{
  46 + transform:rotateY(180deg);
  47 + height: calc(100% - 110px);
  48 +}
  49 +
  50 +.mapRightWrap.to_playBack{
  51 + transform:rotateY(180deg);
  52 + min-height: 454px;
  53 + width: 390px;
  54 + height: auto;
  55 +}
  56 +
  57 +.mapRightWrap.playBack{
  58 + min-height: 374px;
  59 + width: 390px;
  60 + height: auto;
  61 +}
  62 +
  63 +/* .mapRightWrap.playBack form select{
  64 + width: 100%;
  65 +} */
  66 +
  67 +.mapRightWrap.playBack .alert{
  68 + font-size: 13px;
  69 + margin-top: 1px;
  70 + width: calc(100% - 2px);
  71 + margin-left: 1px;
  72 + border-radius: 4px 4px 0 0 !important;
  73 +}
  74 +
  75 +.mapRightWrap.vehicle{
  76 + height: calc(100% - 110px);
  77 + overflow: auto;
  78 + overflow-x: hidden;
  79 +}
  80 +
  81 +.mapRightWrap.search{
  82 + height: 47px;
  83 + padding-top: 0;
  84 + background-color: #626775 !important;
  85 +}
  86 +
  87 +.playBack form{
  88 + padding: 13px 20px 0 0;
  89 + color: #f5f3f3;
  90 +}
  91 +
  92 +.playBack .btn-lg{
  93 + padding: 8px 14px;
  94 + font-size: 16px;
  95 + border-radius: 4px !important;
  96 +}
  97 +
  98 +.playBack hr{
  99 + border-color: #5c6e86;
  100 +}
  101 +
  102 +.playBack form .control-label{
  103 + padding-right: 5px;
  104 + font-family: 微软雅黑;
  105 +}
  106 +
  107 +.playBack form .help-block{
  108 + color: #b6b6b6
  109 +}
  110 +
  111 +.mapRightWrap.search .input-group .input-group-btn button{
  112 + color: #FFFFFF;
  113 + background-color: #1BBC9B;
  114 + border-color: #1BBC9B;
  115 +}
  116 +
  117 +.mapRightWrap.search .input-group .input-group-btn button:hover{
  118 + background-color: #158f76;
  119 + border-color: #13866f;
  120 +}
  121 +
  122 +.mapRightWrap.search .input-group input{
  123 + height: 48px;
  124 + background-color: #626775;
  125 + border: 1px solid #626775;
  126 + color: white;
  127 +}
  128 +
  129 +.mapRightWrap.search .input-group-btn button{
  130 + height: 48px;
  131 + width: 80px;
  132 + font-size: 15px;
  133 +}
  134 +
  135 +.rotate0{
  136 + transform:rotateY(0deg) !important;
  137 +}
  138 +
  139 +.leftUtilsWrap{
  140 + padding-left: 28px;
  141 +}
  142 +
  143 +.leftUtils{
  144 + position: absolute;
  145 + width: 259px;
  146 + height: 40px;
  147 + background-color: #3B3F51;
  148 + z-index: 9999;
  149 + color: #ddd;
  150 + padding-top: 7px;
  151 + top: 20px;
  152 +
  153 + transition: all .5s ease;
  154 +}
  155 +
  156 +.leftUtils span.item{
  157 + line-height: 28px;
  158 + border-right: 1px solid #999;
  159 + padding-right: 10px;
  160 + padding-left: 15px;
  161 + cursor: pointer;
  162 + font-family: 微软雅黑;
  163 +}
  164 +
  165 +.leftUtils span.item:hover{
  166 + color: #fff;
  167 +}
  168 +
  169 +.leftUtils span.item:last-child{
  170 + border-right:none;
  171 +}
  172 +
  173 +.mapTools{
  174 + position: absolute;
  175 + width: 320px;
  176 + height: 60px;
  177 + right: 10px;
  178 + background-color: #3B3F51;
  179 + top: 20px;
  180 + transition: all .5s ease;
  181 +}
  182 +
  183 +.mapTools .item{
  184 + color: #999;
  185 + display: inline-block;
  186 + margin: 24px 0 0 18px;
  187 + font-weight: bold;
  188 + cursor: pointer;
  189 +}
  190 +
  191 +.mapTools.disable .item{
  192 + /* color: #625C5C; */
  193 +}
  194 +
  195 +.mapTools .item.active{
  196 + color: #e5e5e5;
  197 +}
  198 +
  199 +.mapTools .item:hover{
  200 + color: #e5e5e5;
  201 +}
  202 +
  203 +.mapTools .item i{
  204 + font-size: 20px;
  205 +}
  206 +
  207 +html{
  208 + overflow: hidden;
  209 +}
  210 +
  211 +.ctrlMenu {
  212 + position: absolute;
  213 + width: 52px;
  214 + height: 52px;
  215 + background: #3B3F51;
  216 + top: 3px;
  217 + color: white;
  218 + font-size: 12px;
  219 + padding-top: 7px;
  220 + border-radius: 0 2px 52px 0 !important;
  221 + padding-left: 8px;
  222 + font-family: 微软雅黑;
  223 + cursor: pointer;
  224 +}
  225 +
  226 +/* spinner load start ------------------------------- */
  227 +.spinner {
  228 + margin: 50px auto;
  229 + width: 50px;
  230 + height: 40px;
  231 + text-align: center;
  232 + font-size: 10px;
  233 +}
  234 +
  235 +.spinner > div {
  236 + background-color: #69D7E1;
  237 + height: 100%;
  238 + width: 6px;
  239 + display: inline-block;
  240 +
  241 + -webkit-animation: sk-stretchdelay 1.2s infinite ease-in-out;
  242 + animation: sk-stretchdelay 1.2s infinite ease-in-out;
  243 +}
  244 +
  245 +.spinner .rect2 {
  246 + -webkit-animation-delay: -1.1s;
  247 + animation-delay: -1.1s;
  248 +}
  249 +
  250 +.spinner .rect3 {
  251 + -webkit-animation-delay: -1.0s;
  252 + animation-delay: -1.0s;
  253 +}
  254 +
  255 +.spinner .rect4 {
  256 + -webkit-animation-delay: -0.9s;
  257 + animation-delay: -0.9s;
  258 +}
  259 +
  260 +.spinner .rect5 {
  261 + -webkit-animation-delay: -0.8s;
  262 + animation-delay: -0.8s;
  263 +}
  264 +
  265 +@-webkit-keyframes sk-stretchdelay {
  266 + 0%, 40%, 100% { -webkit-transform: scaleY(0.4) }
  267 + 20% { -webkit-transform: scaleY(1.0) }
  268 +}
  269 +
  270 +@keyframes sk-stretchdelay {
  271 + 0%, 40%, 100% {
  272 + transform: scaleY(0.4);
  273 + -webkit-transform: scaleY(0.4);
  274 + } 20% {
  275 + transform: scaleY(1.0);
  276 + -webkit-transform: scaleY(1.0);
  277 + }
  278 +}
  279 +
  280 +.sk-cube-grid {
  281 + width: 40px;
  282 + height: 40px;
  283 + margin: 100px auto;
  284 +}
  285 +
  286 +.sk-cube-grid .sk-cube {
  287 + width: 33%;
  288 + height: 33%;
  289 + background-color: #69D7E1;
  290 + float: left;
  291 + -webkit-animation: sk-cubeGridScaleDelay 1.3s infinite ease-in-out;
  292 + animation: sk-cubeGridScaleDelay 1.3s infinite ease-in-out;
  293 +}
  294 +.sk-cube-grid .sk-cube1 {
  295 + -webkit-animation-delay: 0.2s;
  296 + animation-delay: 0.2s; }
  297 +.sk-cube-grid .sk-cube2 {
  298 + -webkit-animation-delay: 0.3s;
  299 + animation-delay: 0.3s; }
  300 +.sk-cube-grid .sk-cube3 {
  301 + -webkit-animation-delay: 0.4s;
  302 + animation-delay: 0.4s; }
  303 +.sk-cube-grid .sk-cube4 {
  304 + -webkit-animation-delay: 0.1s;
  305 + animation-delay: 0.1s; }
  306 +.sk-cube-grid .sk-cube5 {
  307 + -webkit-animation-delay: 0.2s;
  308 + animation-delay: 0.2s; }
  309 +.sk-cube-grid .sk-cube6 {
  310 + -webkit-animation-delay: 0.3s;
  311 + animation-delay: 0.3s; }
  312 +.sk-cube-grid .sk-cube7 {
  313 + -webkit-animation-delay: 0s;
  314 + animation-delay: 0s; }
  315 +.sk-cube-grid .sk-cube8 {
  316 + -webkit-animation-delay: 0.1s;
  317 + animation-delay: 0.1s; }
  318 +.sk-cube-grid .sk-cube9 {
  319 + -webkit-animation-delay: 0.2s;
  320 + animation-delay: 0.2s; }
  321 +
  322 +@-webkit-keyframes sk-cubeGridScaleDelay {
  323 + 0%, 70%, 100% {
  324 + -webkit-transform: scale3D(1, 1, 1);
  325 + transform: scale3D(1, 1, 1);
  326 + } 35% {
  327 + -webkit-transform: scale3D(0, 0, 1);
  328 + transform: scale3D(0, 0, 1);
  329 + }
  330 +}
  331 +
  332 +@keyframes sk-cubeGridScaleDelay {
  333 + 0%, 70%, 100% {
  334 + -webkit-transform: scale3D(1, 1, 1);
  335 + transform: scale3D(1, 1, 1);
  336 + } 35% {
  337 + -webkit-transform: scale3D(0, 0, 1);
  338 + transform: scale3D(0, 0, 1);
  339 + }
  340 +}
  341 +/* spinner load end ------------------------------- */
  342 +
  343 +.sk-cube-grid._center{
  344 + position: absolute;
  345 + top: 30%;
  346 + left: 50%;
  347 + transform: translate(-50%, -50%);
  348 + -webkit-transform: translate(-50%, -50%);
  349 +}
  350 +
  351 +.mapRightWrap.vehicle p.head{
  352 + color: #B7B7B7;
  353 + font-size: 18px;
  354 + border-bottom: 1px dashed #556471;
  355 + position: relative;
  356 + margin: 15px;
  357 + padding-bottom: 10px;
  358 + font-family: 微软;
  359 +}
  360 +
  361 +/* .mapRightWrap.vehicle p.head:hover{
  362 + box-shadow: 0 8px 17px 0 rgba(128, 123, 123, 0.2),0 6px 20px 0 rgba(86, 67, 67, 0.19);
  363 +}
  364 + */
  365 +.mapRightWrap.vehicle p.head>span.icon{
  366 + position: absolute;
  367 + right: 10px;
  368 + top: -6px;
  369 + font-size: 24px;
  370 + color: #7C8994;
  371 + transition: all .5s ease;
  372 +
  373 +}
  374 +
  375 +.mapRightWrap.vehicle p.head>span.icon.rotate{
  376 + transform:rotate(180deg);
  377 +}
  378 +
  379 +
  380 +.mapRightWrap.vehicle p.head>span.icon:hover{
  381 + color: #D8D5D5;
  382 +}
  383 +
  384 +.mapRightWrap.vehicle .vehicle-item{
  385 + position: relative;
  386 + color: #C7C7C7;
  387 + padding-left: 8px;
  388 + padding-top: 7px;
  389 + width: 90%;
  390 + margin: auto;
  391 + margin-top: 9px;
  392 + border-bottom: 1px solid #717070;
  393 +}
  394 +
  395 +.mapRightWrap.vehicle .vehicle-item div.text{
  396 + padding: 5px 0 11px 5px;
  397 + color: #aebbae;
  398 + -webkit-user-select: initial;
  399 +}
  400 +
  401 +.mapRightWrap.vehicle .vehicle-item div.text span.nbbm{
  402 + padding: 5px 5px;
  403 + cursor: pointer;
  404 +}
  405 +
  406 +.mapRightWrap.vehicle .vehicle-item.online_0 div.text span.nbbm{
  407 + color: #45D245;
  408 + font-size: 13px;
  409 +}
  410 +
  411 +.mapRightWrap.vehicle .vehicle-item.online_1 div.text span.nbbm{
  412 + color: #ff8375;
  413 +}
  414 +
  415 +
  416 +.mapRightWrap.vehicle .vehicle-item.online_0 div.text span.nbbm:hover{
  417 + color: #45D245;
  418 +}
  419 +
  420 +.mapRightWrap.vehicle .vehicle-item.online_1 div.text span.nbbm:hover{
  421 + color: #f16454;
  422 +}
  423 +
  424 +.mapRightWrap.vehicle .vehicle-item div.text span i{
  425 + font-size: 12px;
  426 +}
  427 +
  428 +/* .mapRightWrap.vehicle .vehicle-item.online div.text span i{
  429 + color: #45D245;
  430 +} */
  431 +
  432 +/* off line */
  433 +.mapRightWrap.vehicle .vehicle-item.offline div.text span i,
  434 +.mapRightWrap.vehicle .vehicle-item.offline div.text span,
  435 +.mapRightWrap.vehicle .vehicle-item.offline div.text{
  436 + color: #aca7a7;
  437 +}
  438 +
  439 +.mapRightWrap.vehicle .vehicle-item div.icon{
  440 + position: absolute;
  441 + right: 15px;
  442 + top: 10px;
  443 + cursor: pointer;
  444 +}
  445 +
  446 +.mapRightWrap.vehicle .vehicle-item div.icon:hover{
  447 + color: #fafafa;
  448 +}
  449 +
  450 +
  451 +.mapRightWrap .search_result{
  452 + position: absolute;
  453 + background: rgba(59, 92, 115,0.95);
  454 + width: 100%;
  455 + top: 60px;
  456 + color: #e5e5e5;
  457 +
  458 + max-height: 500px;
  459 + overflow: auto;
  460 +}
  461 +
  462 +.mapRightWrap .search_result::-webkit-scrollbar-thumb{
  463 + box-shadow: 0 0 0 5px rgba(255, 255, 255, 0.2) inset;
  464 +}
  465 +
  466 +.mapRightWrap .search_result .result_item{
  467 + padding-left: 10px;
  468 + margin: 0;
  469 + padding: 10px;
  470 + cursor: pointer;
  471 +}
  472 +
  473 +.mapRightWrap .search_result .result_item:hover{
  474 + background: #59829e;
  475 + color: #fff;
  476 +}
  477 +
  478 +.mapRightWrap .search_result .result_item:hover span.sub_text{
  479 + color: #eee;
  480 +}
  481 +
  482 +.mapRightWrap .search_result .result_item span.sub_text{
  483 + color: #BBBABA;
  484 + margin-left: 5px;
  485 + font-size: 14px;
  486 +}
  487 +
  488 +.mapRightWrap .search_result .item_vehicle_list{
  489 + /* margin-bottom: 20px; */
  490 + /* border-bottom: 1px solid #F3F5F5; */
  491 +}
  492 +
  493 +.mapRightWrap .search_result .item_vehicle{
  494 + color: #fafcfb;
  495 +}
  496 +
  497 +.mapRightWrap .search_result .item_vehicle.state_online{
  498 + color: #84ffe4;
  499 + font-size: 15px;
  500 +}
  501 +
  502 +/* GaoDe style start------- */
  503 +.mapRightWrap.gaode{
  504 + background: #fff;
  505 + border-radius: 5px !important;
  506 +}
  507 +
  508 +.mapTools.gaode{
  509 + background: #0D9BF2;
  510 + border-radius: 5px !important;
  511 +}
  512 +
  513 +.mapTools.gaode .item{
  514 + color: #fff;
  515 +}
  516 +
  517 +.mapTools.gaode .item.active {
  518 + color: #e1e5ec;
  519 +}
  520 +
  521 +.leftUtils.gaode{
  522 + background: #fafafa;
  523 + border-radius: 5px !important;
  524 + color: #5A5858;
  525 +}
  526 +
  527 +.leftUtils.gaode span.item:hover{
  528 + color: #1C1B1B;
  529 +}
  530 +
  531 +.leftUtils.gaode span.item.active{
  532 + padding-left: 5px;
  533 + color: #0D9BF2;
  534 +}
  535 +
  536 +.leftUtils.gaode span.item.active:before{
  537 + content: "\f00c";
  538 + font: normal normal normal 14px/1 FontAwesome;
  539 +}
  540 +
  541 +.mapRightWrap.gaode.vehicle .vehicle-item{
  542 + background: #fdfdfd;
  543 + color: #2D2929;
  544 +}
  545 +
  546 +.mapRightWrap.gaode.vehicle .vehicle-item div.text {
  547 + color: #999;
  548 +}
  549 +
  550 +.mapRightWrap.gaode.vehicle .vehicle-item.online_0 div.text span {
  551 + color: #23a023;
  552 +}
  553 +
  554 +.mapRightWrap.gaode.playBack form {
  555 + color: #8e8282;
  556 +}
  557 +
  558 +.mapRightWrap.gaode.vehicle p.head{
  559 + border-bottom: 1px dashed #E2DFDF;
  560 + color: #7D7777;
  561 +}
  562 +
  563 +.mapRightWrap.vehicle.gaode p.head>span.icon>a{
  564 + color: #999;
  565 +}
  566 +
  567 +.mapRightWrap.vehicle.gaode p.head>span.icon>a:hover{
  568 + color: #555555;
  569 +}
  570 +
  571 +.mapRightWrap.vehicle.gaode .vehicle-item.offline div.text span i,
  572 +.mapRightWrap.vehicle.gaode .vehicle-item.offline div.text span,
  573 +.mapRightWrap.vehicle.gaode .vehicle-item.offline div.text{
  574 + color: #e43a45;
  575 +}
  576 +
  577 +.mapRightWrap.search.gaode .input-group input{
  578 + background-color: #fafafa;
  579 + border: 1px solid #fafafa;
  580 + color: #333333;
  581 +}
  582 +
  583 +.mapRightWrap.search.gaode .input-group .input-group-btn button{
  584 + background-color: #3598dc;
  585 + border-color: #3598dc;
  586 +}
  587 +
  588 +.mapRightWrap.search.gaode .input-group .input-group-btn button:hover{
  589 + background-color: #217ebd;
  590 + border-color: #1f78b5;
  591 +}
  592 +
  593 +.mapRightWrap.gaode .search_result{
  594 + background: rgba(250, 250, 250, 0.95);
  595 + color: #333333;
  596 +}
  597 +
  598 +.mapRightWrap.gaode .search_result .item_vehicle_list{
  599 + border-bottom: 1px solid #C7C7C7;
  600 +}
  601 +
  602 +.mapRightWrap.gaode .search_result .item_vehicle.state_online{
  603 + color: #3d3dec;
  604 +}
  605 +
  606 +.mapRightWrap.gaode .search_result .result_item span.sub_text{
  607 + color: #8E8D8D;
  608 +}
  609 +
  610 +.mapRightWrap.gaode .search_result .result_item:hover{
  611 + background: #ddd;
  612 + color: #333333;
  613 +}
  614 +
  615 +.mapRightWrap.gaode .search_result .item_vehicle{
  616 + color: #333333;
  617 +}
  618 +
  619 +.mapRightWrap.gaode.playBack hr{
  620 + border-color: #c5c5c5;
  621 +}
  622 +
  623 +.mapRightWrap.gaode .alert-info{
  624 + background-color: #ccc;
  625 + border-color: #ccc;
  626 + color: #555555;
  627 +}
  628 +/* GaoDe style end------- */
  629 +
  630 +
  631 +.map-gps-empty{
  632 + padding: 10px;
  633 + text-align: center;
  634 + color: #b37f7f;
  635 + border-bottom: 1px dashed #556471;
  636 + font-size: 13px;
  637 +}
  638 +
  639 +.mapRightWrap::-webkit-scrollbar-thumb {
  640 + box-shadow: 0 0 0 5px rgba(231, 236, 241, 0.52) inset;
  641 +}
  642 +
  643 +.gps_info_win{
  644 + width: 190px;
  645 + overflow: hidden;
  646 +}
  647 +
  648 +.gps_info_win p{
  649 + margin-bottom: 13px;
  650 + font-size: 13px;
  651 +}
  652 +
  653 +.play-back-list{
  654 + display: none;
  655 + position: absolute;
  656 + width: 295px;
  657 + right: 5px;
  658 + z-index: 9999;
  659 + height: calc(100% - 50px);
  660 + top: 25px;
  661 + padding: 15px 7px 3px;
  662 + background: #2d2b2b;
  663 + border-radius: 5px !important;
  664 +}
  665 +
  666 +.progress-wrap{
  667 + width: calc(100% - 340px);
  668 + height: 10px;
  669 + bottom: 33px;
  670 + left: 20px;
  671 + position: absolute;
  672 + display: none;
  673 +}
  674 +
  675 +.play-back-progress{
  676 + position: absolute;
  677 + height: 10px;
  678 + border-radius: 12px !important;
  679 + cursor: pointer;
  680 + box-shadow: 0 2px 5px 0 rgba(0,0,0,0.16),0 2px 10px 0 rgba(0,0,0,0.12);
  681 + border: 1px solid #d0d0d0;
  682 + background: white;
  683 + width: 100%;
  684 +}
  685 +
  686 +.progress-body{
  687 + width: 100%;
  688 + height: 100%;
  689 + position: relative;
  690 +}
  691 +
  692 +.play-back-progress-mark{
  693 + position: absolute;
  694 + height: 10px;
  695 + z-index: 10000;
  696 + border-radius: 12px 0 0 12px !important;
  697 + background: #2d2b2b;
  698 + width: 0;
  699 + cursor: pointer;
  700 +
  701 + /* transition: all 1s ease; */
  702 +}
  703 +
  704 +.play-back-btns{
  705 + display: none;
  706 + background: #2d2b2b;
  707 + width: 285px;
  708 + height: 44px;
  709 + position: absolute;
  710 + right: 320px;
  711 + bottom: 58px;
  712 + padding: 9px 0 0 18px;
  713 + border-radius: 15px !important;
  714 +}
  715 +
  716 +.play-back-btns .dropup{
  717 + display: inline-block;
  718 +}
  719 +
  720 +.play-back-btns .dropdown-menu{
  721 + min-width: 80px;
  722 + width: 80px;
  723 +}
  724 +
  725 +.play-back-btns>i.playBtn{
  726 + font-size: 28px;
  727 + margin-right: 7px;
  728 + cursor: pointer;
  729 + color: white;
  730 + vertical-align: middle;
  731 +}
  732 +
  733 +.play-back-btns>i.playBtn:HOVER{
  734 + color: #e0e1e1;
  735 +}
  736 +
  737 +.play-back-btns>i.fa-pause{
  738 + font-size: 26px;
  739 + margin-right: 8px;
  740 +}
  741 +
  742 +.pback-logs{
  743 + color: white;
  744 +}
  745 +
  746 +.pback-logs-item.out{
  747 + color: #f58f83;
  748 +}
  749 +
  750 +.pback-logs-item.in{
  751 + color: #8181d4;
  752 +}
  753 +
  754 +.pback-logs-item{
  755 + padding: 8px 12px;
  756 + border-bottom: 1px dashed #d2d2d2;
  757 +}
  758 +
  759 +.pback-logs-item-date{
  760 + font-size: 13px;
  761 + display: block;
  762 + text-align: left;
  763 + color: #a2a2a2;
  764 +}
  765 +
  766 +.play-back-list .slimScrollBar{
  767 + background: rgb(167, 170, 169) !important;
  768 + border-radius: 7px !important;
  769 +}
  770 +
  771 +.progress-mark-info{
  772 + position: absolute;
  773 + width: 62px;
  774 + height: 27px;
  775 + z-index: 10000;
  776 + background: #2d2b2b;
  777 + display: none;
  778 + top: -30px;
  779 + padding: 4px 3px;
  780 + color: white;
  781 +}
  782 +
  783 +#progress-mark-time{
  784 + /* transition: all 1s ease; */
  785 + top: 12px;
  786 +}
  787 +
  788 +#progress-mark-time-mouse{
  789 + background: #aeaeae;
  790 +}
  791 +
  792 +/* #playSpeed{
  793 + font-size: 15px;
  794 + vertical-align: middle;
  795 + font-weight: 600;
  796 + margin-right: 5px;
  797 + color: #c7c7c7;
  798 + padding: 4px 8px 4px 13px;
  799 + cursor: pointer;
  800 + border-left: 1px solid #4b4a4a;
  801 + border-right: 1px solid #4b4a4a;
  802 +} */
  803 +
  804 +.angle-up-item{
  805 + font-size: 15px;
  806 + vertical-align: middle;
  807 + font-weight: 600;
  808 + margin-right: 5px;
  809 + color: #c7c7c7;
  810 + padding: 10px 3px 10px 8px;
  811 + cursor: pointer;
  812 + border-left: 1px solid #4b4a4a;
  813 +}
  814 +
  815 +#bufferArea.angle-up-item{
  816 + font-weight: 400;
  817 + font-size: 13px;
  818 + border-right: 1px solid #4b4a4a;
  819 + padding-right: 12px;
  820 +}
  821 +
  822 +.angle-up-item:HOVER{
  823 + background: #484949;
  824 +}
  825 +
  826 +.play-back-close{
  827 + font-family: 微软雅黑;
  828 + font-weight: 600;
  829 +}
  830 +
  831 +#playSpeed .fa-angle-up{
  832 + color: #5f5d5d;
  833 + margin-left: 7px;
  834 +}
  835 +
  836 +/* #playSpeed:HOVER{
  837 + background: #484949;
  838 +} */
  839 +
  840 +#playSpeedText{
  841 + display: inline-block;
  842 + width: 20px;
  843 + text-align: center;
  844 +}
  845 +
  846 +/* #playSpeed i{
  847 + color: #5f5d5d;
  848 + margin-left: 7px;
  849 +} */
  850 +
  851 +.layui-layer-msg.layer-bg-green{
  852 + background: #1bbc9b;
  853 + border: 1px solid #1bbc9b;
  854 + color: white;
  855 +}
  856 +
  857 +.layui-layer-msg.layer-bg-red{
  858 + background: red;
  859 + border: 1px solid red;
  860 + color: white;
  861 +}
  862 +
  863 +#bufferAreaWrap{
  864 + display: none;
  865 +}
  866 +
  867 +#bufferAreaConfigPanel ul.list{
  868 + list-style-type:none;
  869 +}
  870 +
  871 +#bufferAreaConfigPanel ul.list li{
  872 + margin: 7px;
  873 +}
  874 +
  875 +#bufferAreaConfigPanel ul.list li:FIRST-CHILD {
  876 + margin-top: 0px;
  877 +}
0 878 \ No newline at end of file
... ...
src/main/resources/static/pages/base/sectionspeed/edit_road_mobal.html 0 → 100644
  1 +<div class="modal fade" id="edit_road_mobal" tabindex="-1" role="basic" aria-hidden="true">
  2 +
  3 + <div class="modal-dialog">
  4 +
  5 + <div class="modal-content">
  6 +
  7 + <div class="modal-header">
  8 + <button type="button" class="close" data-dismiss="modal" aria-hidden="true"></button>
  9 + <h4 class="modal-title">选择修改站点方式</h4>
  10 + </div>
  11 +
  12 + <div class="modal-body">
  13 +
  14 + <form class="form-horizontal" action="/" method="post" id="edit_road_form" role="form">
  15 +
  16 + <div class="alert alert-danger display-hide" id="editRoadFormError">
  17 + <button class="close" data-close="alert"></button>
  18 + 站点名称为必填项
  19 + </div>
  20 +
  21 + <div class="alert alert-danger display-hide" id="serchrname">
  22 + <button class="close" data-close="alert"></button>
  23 + 系统无法生成,请选择其他方式新增
  24 + </div>
  25 +
  26 + <input type="hidden" name="sSpeedId" id="sSpeedIdInput">
  27 +
  28 + <input type="hidden" name="id" id="idInput">
  29 +
  30 + <div class="form-group" id="formRequ">
  31 + <label class="col-md-3 control-label"><span class="required"> * </span>路段名称:</label>
  32 + <div class="col-md-9" id="errorInfo">
  33 + <input type="text" class="form-control input-medium" id="roadNameInput" name="roadName">
  34 + </div>
  35 + </div>
  36 +
  37 + <div class="form-group" id="formRequ">
  38 + <label class="col-md-3 control-label"><span class="required"> * </span>路段序号:</label>
  39 + <div class="col-md-9" id="errorInfo">
  40 + <input type="text" class="form-control input-medium" id="codeInput" name="code">
  41 + </div>
  42 + </div>
  43 +
  44 + <div class="form-group" id="formRequ">
  45 + <label class="col-md-3 control-label"><span class="required"> * </span>路段限速:</label>
  46 + <div class="col-md-9" id="errorInfo">
  47 + <input type="text" class="form-control input-medium" id="speedInput" name="speed">
  48 + </div>
  49 + </div>
  50 +
  51 + </form>
  52 + </div>
  53 + <div class="modal-footer">
  54 + <button type="button" class="btn default" data-dismiss="modal">取消</button>
  55 + <button type="button" class="btn btn-primary" id="edit-road-sbmt">提交</button>
  56 + </div>
  57 + </div>
  58 + </div>
  59 +</div>
  60 +<script type="text/javascript">
  61 +
  62 +$('#edit_road_mobal').on('editRoadMobal_show', function(e,objP){
  63 + // 显示选择修改方式弹出层
  64 + $('#edit_road_mobal').modal({show : true,backdrop: 'static',keyboard: false});
  65 +
  66 + $('#roadNameInput').val(objP.name);
  67 +
  68 + $('#speedInput').val(objP.sValue);
  69 +
  70 + $('#sSpeedIdInput').val(objP.id);
  71 +
  72 + $('#idInput').val(objP.roadId)
  73 +
  74 + $('#codeInput').val(objP.code);
  75 +
  76 + // 获取表单元素
  77 + var form = $('#edit_road_form');
  78 +
  79 + // 获取错误提示元素
  80 + var editSelectrequired = $('#editRoadFormError', form);
  81 +
  82 + // 提交数据按钮事件
  83 + $('#edit-road-sbmt').on('click', function() {
  84 +
  85 + // 表单提交
  86 + form.submit();
  87 +
  88 + });
  89 +
  90 + //form 表单验证
  91 + form.validate({
  92 +
  93 + errorElement : 'span',
  94 +
  95 + errorClass : 'help-block help-block-error',
  96 +
  97 + focusInvalid : false,
  98 +
  99 + rules : {
  100 +
  101 + 'roadName' : {
  102 +
  103 + required : true
  104 +
  105 + },
  106 +
  107 + 'code' : {
  108 +
  109 + required : true
  110 +
  111 + },
  112 +
  113 + 'speed' : {
  114 +
  115 + required : true
  116 +
  117 + }
  118 +
  119 + },
  120 +
  121 + invalidHandler : function(event, validator) {
  122 +
  123 + editSelectrequired.show();
  124 +
  125 + App.scrollTo(editSelectrequired, -200);
  126 +
  127 + },
  128 +
  129 + highlight : function(element) {
  130 +
  131 + $(element).closest('.form-group').addClass('has-error');
  132 +
  133 + },
  134 +
  135 + unhighlight : function(element) {
  136 +
  137 + $(element).closest('.form-group').removeClass('has-error');
  138 +
  139 + },
  140 +
  141 + success : function(label) {
  142 +
  143 + label.closest('.form-group').removeClass('has-error');
  144 +
  145 + },
  146 +
  147 + submitHandler : function(f) {
  148 +
  149 + // 隐藏弹出层
  150 + $('#edit_road_mobal').modal('hide');
  151 +
  152 + // 表单序列
  153 + var params = form.serializeJSON();
  154 +
  155 + $post('/sectionspeed/roadUpd', params, function(result) {
  156 +
  157 + // 如果返回结果不为空
  158 + if(result){
  159 +
  160 + // 返回状态码为"SUCCESS" ,则修改成功;返回状态码为"ERROR" ,则修改失败
  161 + if(result.status=='SUCCESS') {
  162 +
  163 + // 弹出修改成功提示消息
  164 + layer.msg('修改成功...');
  165 +
  166 + var seachP = {'lineId':objP.lineId,'lineCode':objP.lineCode,'directions':objP.directions};
  167 + /** 列出路段 */
  168 + PublicFunctions.getSectionSpeedInfoList(seachP,objP.lineName);
  169 +
  170 + } else if(result.status=='ERROR') {
  171 +
  172 + // 弹出修改失败提示消息
  173 + layer.msg('修改失败...');
  174 +
  175 + }
  176 + }
  177 +
  178 + });
  179 + }
  180 + });
  181 +})
  182 +</script>
0 183 \ No newline at end of file
... ...
src/main/resources/static/pages/base/sectionspeed/js/events.js 0 → 100644
  1 +$(function(){
  2 +
  3 + /** 搜索事件 */
  4 + $('#search-btn').on('click',function() {
  5 +
  6 + /** 获取搜索框的值 */
  7 + var lineValueStr = $('#realSearchInput').val();
  8 +
  9 + /** 获取线路名称 */
  10 + var lineName = $("#realSearchInput").select2('data')[0].text;
  11 +
  12 + if(lineValueStr==''){
  13 +
  14 + // 弹出提示消息
  15 + layer.msg('请选择线路...');
  16 +
  17 + return false;
  18 +
  19 + }
  20 +
  21 + /** 切割 */
  22 + var array = lineValueStr.split('_');
  23 +
  24 + /** 线路ID */
  25 + var line = array[0];
  26 +
  27 + /** 方向 */
  28 + var dirc = array[2];
  29 +
  30 + /** 清楚地图覆盖物 */
  31 + SectionSpeedVmapWorlds.clearMarkAndOverlays();
  32 +
  33 + /** 获取线路走向百度坐标 */
  34 + PublicFunctions.getSectionRouteInfo(line,dirc,function(data) {
  35 +
  36 + /** 在地图上画出线路走向 @param:<Line.id:线路Id;0:上行;data:上行路段数据> */
  37 + PublicFunctions.linePanlThree(line,data,dirc);
  38 +
  39 + });
  40 +
  41 + var params = {'lineId':array[0],'lineCode':array[1],'directions':array[2]};
  42 + /** 列出路段 */
  43 + PublicFunctions.getSectionSpeedInfoList(params,lineName);
  44 +
  45 + });
  46 +
  47 + $('.mapRightWrap').on('click','#line-jxld',function() {
  48 +
  49 + $('.gps-line-wrap').hide();
  50 +
  51 + $('.flipInX').show();
  52 +
  53 + // 弹出正在加载层
  54 + var index = layer.load(0,{offset:['400px', '85%']});
  55 +
  56 + var id = $('#line-id').val();
  57 +
  58 + var dc = $('#line-dirc').val();
  59 +
  60 + var argus = $('input[name="argus"]:checked').val();
  61 +
  62 + var lineCode = $('#line-code').val();
  63 +
  64 + if(argus ==undefined)
  65 + argus = 0;
  66 +
  67 + PublicFunctions.getAnalyticSection(id,dc,argus,lineCode,function(data) {
  68 +
  69 + layer.close(index);
  70 +
  71 + $('.flipInX').hide();
  72 +
  73 + if(data != null)
  74 + PublicFunctions.analyticSection(data);
  75 +
  76 + /** 获取线路名称 */
  77 + var lineName = $("#realSearchInput").select2('data')[0].text;
  78 +
  79 + /** 列出路段 */
  80 + var params = {'lineId':id,'lineCode':lineCode,'directions':dc};
  81 + PublicFunctions.getSectionSpeedInfoList(params,lineName);
  82 +
  83 + });
  84 + });
  85 +
  86 + $('.mapRightWrap').on('click', '.goto-marker', function() {
  87 +
  88 + var lineStr = $(this).data('deviceid');
  89 +
  90 + var subStr = lineStr.substring(lineStr.indexOf("(")+1,lineStr.length-1);
  91 +
  92 + // 分割折线坐标字符串
  93 + var lineArray = subStr.split(',');
  94 +
  95 + // 地图折线坐标点集合
  96 + var polylineArray = [];
  97 +
  98 + for(var i = 0;i<lineArray.length;i++) {
  99 +
  100 + polylineArray.push(new BMap.Point(lineArray[i].split(' ')[0],lineArray[i].split(' ')[1]));
  101 +
  102 + }
  103 +
  104 + /** 在地图上画出线路走向 @param:<polylineArray:地图折线坐标点集合;resultdata:站点路由数据> */
  105 + SectionSpeedVmapWorlds.drawingSecitons(polylineArray);
  106 +
  107 + });
  108 +
  109 + $('.mapRightWrap').on('click', '.edit', function() {
  110 +
  111 + var id = $(this).data('id');
  112 +
  113 + var name = $(this).data('name');
  114 +
  115 + var sValue = $(this).data('svalue');
  116 +
  117 + var code = $(this).data('code');
  118 +
  119 + var roadId = $(this).data('road');
  120 +
  121 + var line = $(this).data('line');
  122 +
  123 + var linecode = $(this).data('linecode');
  124 +
  125 + var directions = $(this).data('directions');
  126 + /** 获取线路名称 */
  127 + var lineName = $("#realSearchInput").select2('data')[0].text;
  128 +
  129 + var objP = {'id':id,'name':name,'sValue':sValue,'code':code,'roadId':roadId,'lineId':line,'lineCode':linecode,'directions':directions,'lineName':lineName};
  130 +
  131 + $.get('edit_road_mobal.html', function(m){
  132 +
  133 + $(pjaxContainer).append(m);
  134 +
  135 + $('#edit_road_mobal').trigger('editRoadMobal_show', [objP]);
  136 + });
  137 + });
  138 +
  139 +});
0 140 \ No newline at end of file
... ...
src/main/resources/static/pages/base/sectionspeed/js/function.js 0 → 100644
  1 +var PublicFunctions = function () {
  2 +
  3 + var PubFun = {
  4 +
  5 + /** 获取所有线路 */
  6 + getLineAllInfo : function(cb) {
  7 +
  8 + /** get请求获取所有线路 */
  9 + $get('/line/all', null, function(array){return cb && cb(array);});
  10 +
  11 + },
  12 +
  13 + /** 获取线路走向百度坐标 */
  14 + getSectionRouteInfo : function(lineId,direction,callback) {
  15 +
  16 + $get('/sectionroute/findSection',{'line.id_eq' : lineId , 'directions_eq' : direction},function(resultdata) {
  17 +
  18 + callback && callback(resultdata);
  19 +
  20 + });
  21 +
  22 + },
  23 +
  24 + getSectionSpeedInfoList : function(params,lineName){
  25 +
  26 + $get('/sectionspeed/getSectionSpeedInfoList',params,function(rs) {
  27 +
  28 + $('#vehicle').show();
  29 +
  30 + var resultHtml = template('vehicle_panel_collapse_temp', {list: rs,lineName:lineName,lineId:params.lineId,dirc:params.directions,lineCode:params.lineCode});
  31 +
  32 + $('#vehicle').html(resultHtml);
  33 +
  34 + });
  35 +
  36 + },
  37 +
  38 + getAnalyticSection : function(lineId,direction,argus,lineCode,callback) {
  39 + $get('/sectionspeed/analyticSection',{'line.id_eq' : lineId , 'directions_eq' : direction,'argus':argus,'lineCode':lineCode},function(resultdata) {
  40 +
  41 + callback && callback(resultdata);
  42 +
  43 + });
  44 +
  45 + },
  46 +
  47 + // 查询线路某方向下所有站点的中心百度坐标
  48 + getStationRoutePoint : function(id_,dir_,callback) {
  49 +
  50 + $get('/stationroute/getStationRouteCenterPoints',{lineId:id_,direction:dir_},function(result) {
  51 +
  52 + callback && callback(result);
  53 +
  54 + });
  55 +
  56 + },
  57 +
  58 + /** 在地图上画出线路走向 @param:<Line.id:线路Id;0:上行;data:上行路段数据> */
  59 + linePanlThree : function(lineId,data,direction) {
  60 +
  61 + /** 获取站点路由信息 @param:<Line.id:线路Id;0:上行> @return:<resultdata:站点路由数据> */
  62 + PublicFunctions.getStationRoutePoint(lineId,direction,function(resultdata) {
  63 +
  64 + SectionSpeedVmapWorlds.clearMarkAndOverlays();
  65 +
  66 + // 路段数据长度
  67 + var dataLen = data.length;
  68 +
  69 + // 如果大于零
  70 + if(dataLen>0) {
  71 +
  72 + // 地图折线坐标点集合
  73 + var polylineArray = [];
  74 +
  75 + // 编辑路段数据
  76 + for(var d= 0; d<dataLen;d++){
  77 +
  78 + // 获取路段折线坐标字符串
  79 + var sectionBsectionVectorStr = data[d].sectionBsectionVector;
  80 +
  81 + if(sectionBsectionVectorStr==null) {
  82 +
  83 + continue;
  84 +
  85 + }
  86 +
  87 + // 切割段折线坐标字符串
  88 + var tempStr = sectionBsectionVectorStr.substring(11,sectionBsectionVectorStr.length-1);
  89 +
  90 + // 分割折线坐标字符串
  91 + var lineArray = tempStr.split(',');
  92 +
  93 + for(var i = 0;i<lineArray.length;i++) {
  94 +
  95 + polylineArray.push(new BMap.Point(lineArray[i].split(' ')[0],lineArray[i].split(' ')[1]));
  96 +
  97 + }
  98 +
  99 + }
  100 +
  101 + /** 在地图上画出线路走向 @param:<polylineArray:地图折线坐标点集合;resultdata:站点路由数据> */
  102 + SectionSpeedVmapWorlds.drawingUpline(polylineArray,resultdata);
  103 +
  104 + // 如果站点路由数据不为空
  105 + if(resultdata.length>0) {
  106 +
  107 + // 遍历站点路由数据
  108 + for(var s = 0 ; s<resultdata.length;s++) {
  109 +
  110 + // 中心点坐标字符串
  111 + var bJwpointsStr = resultdata[s].bJwpoints;
  112 +
  113 + var stationName = resultdata[s].stationName;
  114 +
  115 + // 起个中心点坐标字符串
  116 + var bJwpointsArray = bJwpointsStr.split(' ');
  117 +
  118 + // 设置中心点
  119 + var point_center = new BMap.Point(bJwpointsArray[0],bJwpointsArray[1]);
  120 +
  121 + /** 在地图上画点 @param:<point_center:中心坐标点> */
  122 + SectionSpeedVmapWorlds.drawingUpStationPoint(point_center,stationName,s+1);
  123 +
  124 + }
  125 +
  126 + }
  127 +
  128 + }
  129 +
  130 + });
  131 +
  132 + },
  133 +
  134 + analyticSection : function(dataLen) {
  135 +
  136 + // 编辑路段数据
  137 + for(var d= 0; d<dataLen.length;d++){
  138 +
  139 + // 地图折线坐标点集合
  140 + var polylineArray = [];
  141 +
  142 + // 获取路段折线坐标字符串
  143 + var sectionBsectionVectorStr = dataLen[d].linestring;
  144 +
  145 + if(sectionBsectionVectorStr==null) {
  146 +
  147 + continue;
  148 +
  149 + }
  150 +
  151 + // 切割段折线坐标字符串
  152 + var tempStr = sectionBsectionVectorStr.substring(sectionBsectionVectorStr.indexOf("(")+1,sectionBsectionVectorStr.length-1);
  153 +
  154 + // 分割折线坐标字符串
  155 + var lineArray = tempStr.split(',');
  156 +
  157 + for(var i = 0;i<lineArray.length;i++) {
  158 +
  159 + polylineArray.push(new BMap.Point(lineArray[i].split(' ')[0],lineArray[i].split(' ')[1]));
  160 +
  161 + }
  162 +
  163 + /** 在地图上画出线路走向 @param:<polylineArray:地图折线坐标点集合;resultdata:站点路由数据> */
  164 + SectionSpeedVmapWorlds.drawingSecitons(polylineArray);
  165 +
  166 + }
  167 +
  168 + }
  169 +
  170 + }
  171 +
  172 + return PubFun ;
  173 +
  174 +}();
0 175 \ No newline at end of file
... ...
src/main/resources/static/pages/base/sectionspeed/js/map.js 0 → 100644
  1 +/**
  2 + * @description TODO(路段限速地图JS模块)
  3 + *
  4 + * @author bsth@lq
  5 + *
  6 + * @date 二〇一六年十月二十一日 15:34:33
  7 + *
  8 + */
  9 +
  10 +var SectionSpeedVmapWorlds = function() {
  11 +
  12 + /** 路段限速地图JS模块下的全局变量 <mapB:地图对象;drawingManager:鼠标绘制对象;polyUpline:线路走向对象;bitsPolyline:路段对象> */
  13 + var mapB = '', drawingManager = '',polyUpline = '',bitsPolyline='';
  14 +
  15 + var overlays = [];
  16 +
  17 + /** 路段限速地图JS模块下的全局变量---鼠标绘制参数
  18 + * <strokeColor:边线颜色;
  19 + * fillColor:填充颜色。当参数为空时,圆形将没有填充效果;
  20 + * strokeWeight: 边线的宽度,以像素为单位
  21 + * strokeOpacity:边线透明度,取值范围0 - 1;
  22 + * fillOpacity:填充的透明度,取值范围0 - 1;
  23 + * strokeStyle:边线的样式,solid或dashed> */
  24 + var styleOptions = {strokeColor : "red", fillColor : "red", strokeWeight : 3,strokeOpacity : 0.8,fillOpacity : 0.6, strokeStyle : 'solid'};
  25 +
  26 + /** 鼠标工具参数
  27 + * <anchor:位置;
  28 + * offset:偏离值;
  29 + * scale:工具栏缩放比例;
  30 + * drawingModes:工具模型> */
  31 + var drawingToolOptions = {anchor : BMAP_ANCHOR_TOP_LEFT, offset : new BMap.Size(80, 5),scale : 0.8,drawingModes:[BMAP_DRAWING_POLYLINE]};
  32 +
  33 + /** 路段限速地图JS模块下的全局变量---鼠标监听时间参数
  34 + * <isOpen:是否开启绘制模式;
  35 + * enableDrawingTool:是否显示工具栏;
  36 + * drawingToolOptions:鼠标工具参数;
  37 + * polylineOptions:线的样式> */
  38 + var drawingManagerOptions = {isOpen : false,enableDrawingTool : false,drawingToolOptions : drawingToolOptions,polylineOptions : styleOptions,}
  39 +
  40 + /** 鼠标监听事件 */
  41 + function addDrawingManagerEvent(e,overlay) {}
  42 +
  43 + /** 地图绘制地图走向参数 */
  44 + var polylineOptions = {strokeColor : "blue",strokeWeight : 6,strokeOpacity : 0.5};
  45 +
  46 + /** 自定义标注物图片 */
  47 + var icon_target = new BMap.Icon('/pages/base/stationroute/css/img/gjzd.png',new BMap.Size(10, 10));
  48 +
  49 + /** 创建标注物参数 */
  50 + var RichMarkerOptions = {"anchor" : new BMap.Size(-10,8), "enableDragging" : true};
  51 +
  52 + var Bmap = {
  53 +
  54 + /** 初始化地图 */
  55 + init : function() {
  56 +
  57 + /** 设置中心点 */
  58 + var CENTER_POINT = {lng : 121.528733,lat : 31.237425};
  59 +
  60 + /** 百度API Key */
  61 + var bdKey = 'IGGrr4UjwIYzatoCRFKEL8sT';
  62 +
  63 + /** 初始化百度地图 */
  64 + mapB = new BMap.Map("mapContainer",{enableMapClick:false});
  65 +
  66 + /** 中心点和缩放级别 */
  67 + mapB.centerAndZoom(new BMap.Point(CENTER_POINT.lng,CENTER_POINT.lat), 15);
  68 +
  69 + /** 启用地图拖拽事件,默认启用(可不写) */
  70 + mapB.enableDragging();
  71 +
  72 + /** 启用地图滚轮放大缩小 */
  73 + mapB.enableScrollWheelZoom();
  74 +
  75 + /** 禁用鼠标双击放大 */
  76 + mapB.disableDoubleClickZoom();
  77 +
  78 + /** 启用键盘上下左右键移动地图 */
  79 + mapB.enableKeyboard();
  80 +
  81 + /** 创建鼠标绘制管理类 */
  82 + // drawingManager = new BMapLib.DrawingManager(mapB, drawingManagerOptions);
  83 +
  84 + /** 添加绘画完成事件 */
  85 + // drawingManager.addEventListener('polylinecomplete', addDrawingManagerEvent);
  86 +
  87 + return mapB;
  88 + },
  89 +
  90 + /** 关闭信息窗口 */
  91 + closeMapInfoWin:function() {
  92 +
  93 + mapB.closeInfoWindow();
  94 +
  95 + },
  96 +
  97 + /** 在地图上画出线路走向 */
  98 + drawingUpline : function (polylineArray,resultdata) {
  99 +
  100 + /** 创建线路走向 */
  101 + polyUpline = new BMap.Polyline(polylineArray,polylineOptions);
  102 +
  103 + /** 把折线添加到地图上 */
  104 + mapB.addOverlay(polyUpline);
  105 +
  106 + var ceter_index = Math.round(resultdata.length / 2);
  107 +
  108 + var ceterPointsStr = resultdata[ceter_index].bJwpoints;
  109 +
  110 + var ceterPointsArray = ceterPointsStr.split(' ');
  111 +
  112 + var polyline_center = new BMap.Point(ceterPointsArray[0],ceterPointsArray[1]);
  113 +
  114 + var PanOptions_ ={noAnimation :true};
  115 +
  116 + mapB.reset();
  117 +
  118 + mapB.panTo(polyline_center,PanOptions_);
  119 +
  120 + mapB.setZoom(14);
  121 +
  122 + },
  123 +
  124 + /** 在地图上画出路段 */
  125 + drawingSecitons : function(polylineArray) {
  126 +
  127 + /** 创建路段 */
  128 + bitsPolyline = new BMap.Polyline(polylineArray, {strokeColor : "red",strokeWeight : 6,strokeOpacity : 0.5});
  129 +
  130 + /** 把路段添加到地图上 */
  131 + mapB.addOverlay(bitsPolyline);
  132 + },
  133 +
  134 +
  135 + /** 在地图上画点 @param:<point_center:中心坐标点> */
  136 + drawingUpStationPoint : function(point_center,stationName,s) {
  137 +
  138 + var html2 = '<div style="position: absolute; margin: 0pt; padding: 0pt; width: 160px; height: 26px; left: -10px; top: -35px; overflow: hidden;">'
  139 + + '<img class="rm3_image" style="border:none;left:0px; top:0px; position:absolute;" src="/pages/base/stationroute/css/img/back160.png">'
  140 + + '</div>'
  141 + + '<label class=" BMapLabel" unselectable="on" style="position: absolute; -moz-user-select: none; display: inline; cursor: inherit; border: 0px none; padding: 2px 1px 1px; white-space: nowrap; font: 12px arial,simsun; z-index: 80; color: rgb(255, 102, 0); left: 15px; top: -35px;"><span style="float: left; color: #fdfdfd; margin-left: -22px; font-size: 6px;">'+ s+'</span>'+ stationName+'</label>';
  142 +
  143 +
  144 + var myRichMarker1 = new BMapLib.RichMarker(html2, point_center,RichMarkerOptions);
  145 +
  146 + myRichMarker1.disableDragging();
  147 +
  148 + mapB.addOverlay(myRichMarker1);
  149 +
  150 + /** 创建标注物 */
  151 + marker = new BMap.Marker(point_center,{icon : icon_target});
  152 +
  153 + /** 允许覆盖物在map.clearOverlays方法中被清除。 */
  154 + marker.enableMassClear();
  155 +
  156 + /** 添加 */
  157 + mapB.addOverlay(marker);
  158 + },
  159 +
  160 + /** 清除地图覆盖物 */
  161 + clearMarkAndOverlays : function() {
  162 +
  163 + // 清楚地图覆盖物
  164 + mapB.clearOverlays();
  165 +
  166 + mapB.removeOverlay();
  167 +
  168 + }
  169 +
  170 + }
  171 +
  172 + return Bmap;
  173 +
  174 +}();
0 175 \ No newline at end of file
... ...
src/main/resources/static/pages/base/sectionspeed/js/reload.js 0 → 100644
  1 +/**
  2 + *
  3 + * @Author : bsth@lq
  4 + *
  5 + * @Description : TODO(路段限速初始化加载ldxs.html页面JS模块)
  6 + *
  7 + * @Data : 二〇一六年十月二十一日 15:28:48
  8 + *
  9 + * @Version 公交调度系统BS版 0.1
  10 + *
  11 + */
  12 +
  13 +(function(){
  14 +
  15 + /** 关闭左侧栏 */
  16 + if (!$('body').hasClass('page-sidebar-closed'))
  17 + $('.menu-toggler.sidebar-toggler').click();
  18 +
  19 + /** 延迟(500毫秒)加载 */
  20 + setTimeout(function(){
  21 +
  22 + /** 地图初始化 */
  23 + var mapB = SectionSpeedVmapWorlds.init();
  24 +
  25 + /** 线路下拉框初始化 */
  26 + PublicFunctions.getLineAllInfo(function(array) {
  27 +
  28 + var opGroup = '<option value="">请选择...</option><optgroup label="上行">';
  29 +
  30 + var len_ = array.length;
  31 +
  32 + if(len_>0) {
  33 +
  34 + $.each(array, function(i, g){
  35 +
  36 + opGroup += '<option value="'+ g.id + '_' + g.lineCode +'_0' +'">'+g.name+'</option>';
  37 +
  38 + });
  39 +
  40 + }
  41 +
  42 + opGroup += '</optgroup>';
  43 +
  44 + opGroup += '<optgroup label="下行">';
  45 +
  46 + if(len_>0) {
  47 +
  48 + $.each(array, function(i, g){
  49 +
  50 + opGroup += '<option value="'+ g.id + '_' + g.lineCode +'_1' +'">'+g.name+'</option>';
  51 +
  52 + });
  53 +
  54 + }
  55 +
  56 + opGroup += '</optgroup>';
  57 +
  58 + $('#realSearchInput').html(opGroup).select2();
  59 +
  60 + });
  61 +
  62 + }, 500);
  63 +
  64 +})();
0 65 \ No newline at end of file
... ...
src/main/resources/static/pages/base/sectionspeed/ldxs.html 0 → 100644
  1 +<link href="/pages/base/sectionspeed/css/addmap.css" rel="stylesheet" type="text/css" />
  2 +
  3 +<link href="/pages/base/sectionspeed/css/real.css" rel="stylesheet" type="text/css" />
  4 +
  5 +<!-- 地图容器 -->
  6 +<div id="mapContainer"></div>
  7 +
  8 +<!-- 搜索框 -->
  9 +<div class="mapRightWrap z-depth-3 search" style="top: 35px;">
  10 + <div class="input-group">
  11 + <select name="line" class="form-control" style="width:100%" id="realSearchInput"></select>
  12 + <span class="input-group-btn">
  13 + <button class="btn" type="button" id="search-btn"><i class="fa fa-search"></i> 搜索</button>
  14 + </span>
  15 + </div>
  16 +</div>
  17 +
  18 +<div class="mapRightWrap z-depth-3 vehicle" id="vehicle" style="display:none"></div>
  19 +
  20 +<script id="vehicle_panel_collapse_temp" type="text/html">
  21 +<div class="alert alert-info animated flipInX" style="display:none">
  22 +<i class="fa fa-exclamation-circle"></i> 线路正在解析中...可能需要等待些时间</div>
  23 +<div class="gps-line-wrap">
  24 +
  25 +<p class="head">
  26 + {{lineName}}
  27 +</p>
  28 +{{each list as obj i}}
  29 + <div class="vehicle-item {{if obj.directions==0}}online_{{obj.directions}}{{else}}offline{{/if}}" >
  30 + <div class="text">
  31 + <span class="nbbm goto-marker" data-deviceId="{{obj.bLineStr}}" data-road="{{obj.road}}">
  32 + <i class="fa fa-circle"></i> &nbsp;{{obj.xh}}、{{obj.s_name}}</span>
  33 +
  34 + <span style="font-size: 13px;">&nbsp;限速:{{obj.s_value}}</span>
  35 +
  36 + <a href="javascript:;" class="btn default red-stripe edit"
  37 + data-line="{{obj.line}}"
  38 + data-linecode="{{obj.line_code}}"
  39 + data-directions="{{obj.directions}}"
  40 + data-road = "{{obj.road}}"
  41 + data-id="{{obj.id}}"
  42 + data-name="{{obj.s_name}}"
  43 + data-svalue="{{obj.s_value}}"
  44 + data-code="{{obj.xh}}" style="padding: 3px 5px; margin-left: 4px;"> 修改 </a>
  45 + </div>
  46 + </div>
  47 +{{/each}}
  48 +{{if list.length == 0}}
  49 +<div class="map-gps-empty">没有相关数据</div>
  50 +<div class="map-gps-empty">
  51 + <form role="form" class="form-horizontal">
  52 + <input type="hidden" name="line-id" id="line-id" value="{{lineId}}">
  53 + <input type="hidden" name="line-dirc" id="line-dirc" value="{{dirc}}">
  54 + <input type="hidden" name="line-code" id="line-code" value="{{lineCode}}">
  55 + <div class="form-body">
  56 + <div class="form-group">
  57 + <div class="col-md-6">
  58 + <div class="checkbox-list">
  59 + <label>
  60 + <div class="checker">
  61 + <span class="checked"><input type="checkbox" name="argus" id="argus" value="1"></span> 解析并保存
  62 + </div>
  63 + </label>
  64 + </div>
  65 + </div>
  66 +
  67 + <div class="col-md-6">
  68 + <button type="button" class="btn blue-madison right" id="line-jxld">线路解析</button>
  69 + </div>
  70 + </div>
  71 + </div>
  72 + </form>
  73 +</div>
  74 +{{/if}}
  75 +</div></div>
  76 +</script>
  77 +
  78 +<!-- 地图JS类库 -->
  79 +<script src="/pages/base/sectionspeed/js/map.js" data-exclude=1></script>
  80 +
  81 +<!-- reload事件 -->
  82 +<script src="/pages/base/sectionspeed/js/reload.js"></script>
  83 +
  84 +<!-- 表单元素事件JS类库 -->
  85 +<script src="/pages/base/sectionspeed/js/events.js"></script>
  86 +
  87 +<!-- 函数方法JS类库 -->
  88 +<script src="/pages/base/sectionspeed/js/function.js"></script>
0 89 \ No newline at end of file
... ...
src/main/resources/static/pages/base/stationroute/list.html
... ... @@ -115,10 +115,10 @@
115 115 </div>
116 116 <div class="row" style="margin-top: 10px;">
117 117 <div class="col-md-12">
118   - <!-- 提示 -->
119   - <div class="alert alert-warning" style="background-color: #22313F;border-color: #FFFFFF;color: #2ab4c0;">
120   - <strong>系统未初始化该线路上行站点!</strong> 请从上方【上行规划选择】里选择任意一种方式规划该线路上行站点.
121   - </div>
  118 + <!-- 提示 -->
  119 + <div class="alert alert-warning" style="background-color: #22313F;border-color: #FFFFFF;color: #2ab4c0;">
  120 + <strong>系统未初始化该线路上行站点!</strong> 请从上方【上行规划选择】里选择任意一种方式规划该线路上行站点.
  121 + </div>
122 122 </div>
123 123 </div>
124 124 </div>
... ...