Commit 0af540a30ce73ace931dc3771ea1c3ad9ca7d48b

Authored by 王通
1 parent 1edf7882

1.线路信息接口添加环线和双向的标识

src/main/java/com/bsth/server_rs/base_info/line/Line.java
1   -package com.bsth.server_rs.base_info.line;
2   -
3   -import com.bsth.server_rs.adapter.DateTimeAdapter;
4   -
5   -import javax.xml.bind.annotation.XmlRootElement;
6   -import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
7   -import java.io.Serializable;
8   -import java.util.Date;
9   -
10   -
11   -/**
12   - * @ClassName: Line(线路实体类)
13   - * @Description: TODO(线路)
14   - * @Author bsth@lq
15   - * @Date 2016-4-11 16:06:17
16   - * @Version 公交调度系统BS版 0.1
17   - */
18   -@XmlRootElement
19   -public class Line implements Serializable {
20   -
21   -
22   - /**线路名称 varchar length(50) 不能为空*/
23   - private String name;
24   -
25   - /** 线路编码 varchar length(50) 不能为空*/
26   - private String lineCode;
27   -
28   - /** 起始站名称*/
29   - private String startStationName;
30   -
31   - /** 终点站名称*/
32   - private String endStationName;
33   -
34   - /** 起始站首班车时间 00:00 */
35   - private String startStationFirstTime;
36   -
37   - /** 起始站末班车时间 00:00 */
38   - private String startStationEndTime;
39   -
40   - /** 终点站首班时间 00:00 */
41   - private String endStationFirstTime;
42   -
43   - /** 终点站末班时间 00:00 */
44   - private String endStationEndTime;
45   -
46   - /** 所属公司 */
47   - private String company;
48   -
49   - /** 分公司 */
50   - private String brancheCompany;
51   -
52   - /** 性质(线路类型) */
53   - private String nature;
54   -
55   - /**线路等级 */
56   - private String level;
57   -
58   - /**是否撤销 <1:是;0:否> */
59   - private Integer destroy;
60   -
61   - /** 是否夜宵线 <1:是;0:否> */
62   - private Integer supperLine;
63   -
64   - /** 设备线路编码 */
65   - private String eqLinecode;
66   -
67   - /**
68   - * 创建日期 timestamp
69   - */
70   - private Date createDate;
71   -
72   - //-------------- 标准信息 -----------
73   - /** 标准总里程 */
74   - private Double totalMileage;
75   - /** 早高峰大间隔(分钟) */
76   - private Double earlyIntervalLg;
77   -
78   - /** 晚高峰大间隔(分钟) */
79   - private Double lateIntervalLg;
80   -
81   - /** 平时大间隔(分钟) */
82   - private Double intervalLg;
83   -
84   - /** 限速(平时) */
85   - private Double speedLimit;
86   -
87   - /** 滞站 */
88   - private Integer lagStation;
89   -
90   - /** 越站 */
91   - private Integer skip;
92   -
93   - /** 超速 */
94   - private Integer speeding;
95   -
96   - /** 串线 */
97   - private Integer crossedLine;
98   -
99   - /** 越界 */
100   - private Integer overflights;
101   -
102   - /**
103   - * 上海市线路编码
104   - */
105   - private String shanghaiLinecode;
106   -
107   - public String getName() {
108   - return name;
109   - }
110   -
111   - public void setName(String name) {
112   - this.name = name;
113   - }
114   -
115   - public String getLineCode() {
116   - return lineCode;
117   - }
118   -
119   - public void setLineCode(String lineCode) {
120   - this.lineCode = lineCode;
121   - }
122   -
123   - public String getStartStationName() {
124   - return startStationName;
125   - }
126   -
127   - public void setStartStationName(String startStationName) {
128   - this.startStationName = startStationName;
129   - }
130   -
131   - public String getEndStationName() {
132   - return endStationName;
133   - }
134   -
135   - public void setEndStationName(String endStationName) {
136   - this.endStationName = endStationName;
137   - }
138   -
139   - public String getStartStationFirstTime() {
140   - return startStationFirstTime;
141   - }
142   -
143   - public void setStartStationFirstTime(String startStationFirstTime) {
144   - this.startStationFirstTime = startStationFirstTime;
145   - }
146   -
147   - public String getStartStationEndTime() {
148   - return startStationEndTime;
149   - }
150   -
151   - public void setStartStationEndTime(String startStationEndTime) {
152   - this.startStationEndTime = startStationEndTime;
153   - }
154   -
155   - public String getEndStationFirstTime() {
156   - return endStationFirstTime;
157   - }
158   -
159   - public void setEndStationFirstTime(String endStationFirstTime) {
160   - this.endStationFirstTime = endStationFirstTime;
161   - }
162   -
163   - public String getEndStationEndTime() {
164   - return endStationEndTime;
165   - }
166   -
167   - public void setEndStationEndTime(String endStationEndTime) {
168   - this.endStationEndTime = endStationEndTime;
169   - }
170   -
171   - public String getCompany() {
172   - return company;
173   - }
174   -
175   - public void setCompany(String company) {
176   - this.company = company;
177   - }
178   -
179   - public String getBrancheCompany() {
180   - return brancheCompany;
181   - }
182   -
183   - public void setBrancheCompany(String brancheCompany) {
184   - this.brancheCompany = brancheCompany;
185   - }
186   -
187   - public String getNature() {
188   - return nature;
189   - }
190   -
191   - public void setNature(String nature) {
192   - this.nature = nature;
193   - }
194   -
195   - public String getLevel() {
196   - return level;
197   - }
198   -
199   - public void setLevel(String level) {
200   - this.level = level;
201   - }
202   -
203   - public Integer getDestroy() {
204   - return destroy;
205   - }
206   -
207   - public void setDestroy(Integer destroy) {
208   - this.destroy = destroy;
209   - }
210   -
211   - public Integer getSupperLine() {
212   - return supperLine;
213   - }
214   -
215   - public void setSupperLine(Integer supperLine) {
216   - this.supperLine = supperLine;
217   - }
218   -
219   - public String getEqLinecode() {
220   - return eqLinecode;
221   - }
222   -
223   - public void setEqLinecode(String eqLinecode) {
224   - this.eqLinecode = eqLinecode;
225   - }
226   -
227   - @XmlJavaTypeAdapter(DateTimeAdapter.class)
228   - public Date getCreateDate() {
229   - return createDate;
230   - }
231   -
232   - public void setCreateDate(Date createDate) {
233   - this.createDate = createDate;
234   - }
235   -
236   - public Double getTotalMileage() {
237   - return totalMileage;
238   - }
239   -
240   - public void setTotalMileage(Double totalMileage) {
241   - this.totalMileage = totalMileage;
242   - }
243   -
244   - public Double getEarlyIntervalLg() {
245   - return earlyIntervalLg;
246   - }
247   -
248   - public void setEarlyIntervalLg(Double earlyIntervalLg) {
249   - this.earlyIntervalLg = earlyIntervalLg;
250   - }
251   -
252   - public Double getLateIntervalLg() {
253   - return lateIntervalLg;
254   - }
255   -
256   - public void setLateIntervalLg(Double lateIntervalLg) {
257   - this.lateIntervalLg = lateIntervalLg;
258   - }
259   -
260   - public Double getIntervalLg() {
261   - return intervalLg;
262   - }
263   -
264   - public void setIntervalLg(Double intervalLg) {
265   - this.intervalLg = intervalLg;
266   - }
267   -
268   - public Double getSpeedLimit() {
269   - return speedLimit;
270   - }
271   -
272   - public void setSpeedLimit(Double speedLimit) {
273   - this.speedLimit = speedLimit;
274   - }
275   -
276   - public Integer getLagStation() {
277   - return lagStation;
278   - }
279   -
280   - public void setLagStation(Integer lagStation) {
281   - this.lagStation = lagStation;
282   - }
283   -
284   - public Integer getSkip() {
285   - return skip;
286   - }
287   -
288   - public void setSkip(Integer skip) {
289   - this.skip = skip;
290   - }
291   -
292   - public Integer getSpeeding() {
293   - return speeding;
294   - }
295   -
296   - public void setSpeeding(Integer speeding) {
297   - this.speeding = speeding;
298   - }
299   -
300   - public Integer getCrossedLine() {
301   - return crossedLine;
302   - }
303   -
304   - public void setCrossedLine(Integer crossedLine) {
305   - this.crossedLine = crossedLine;
306   - }
307   -
308   - public Integer getOverflights() {
309   - return overflights;
310   - }
311   -
312   - public void setOverflights(Integer overflights) {
313   - this.overflights = overflights;
314   - }
315   -
316   - public String getShanghaiLinecode() {
317   - return shanghaiLinecode;
318   - }
319   -
320   - public void setShanghaiLinecode(String shanghaiLinecode) {
321   - this.shanghaiLinecode = shanghaiLinecode;
322   - }
323   -}
  1 +package com.bsth.server_rs.base_info.line;
  2 +
  3 +import com.bsth.server_rs.adapter.DateTimeAdapter;
  4 +
  5 +import javax.xml.bind.annotation.XmlRootElement;
  6 +import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
  7 +import java.io.Serializable;
  8 +import java.util.Date;
  9 +
  10 +
  11 +/**
  12 + * @ClassName: Line(线路实体类)
  13 + * @Description: TODO(线路)
  14 + * @Author bsth@lq
  15 + * @Date 2016-4-11 16:06:17
  16 + * @Version 公交调度系统BS版 0.1
  17 + */
  18 +@XmlRootElement
  19 +public class Line implements Serializable {
  20 +
  21 +
  22 + /**线路名称 varchar length(50) 不能为空*/
  23 + private String name;
  24 +
  25 + /** 线路编码 varchar length(50) 不能为空*/
  26 + private String lineCode;
  27 +
  28 + /** 起始站名称*/
  29 + private String startStationName;
  30 +
  31 + /** 终点站名称*/
  32 + private String endStationName;
  33 +
  34 + /** 起始站首班车时间 00:00 */
  35 + private String startStationFirstTime;
  36 +
  37 + /** 起始站末班车时间 00:00 */
  38 + private String startStationEndTime;
  39 +
  40 + /** 终点站首班时间 00:00 */
  41 + private String endStationFirstTime;
  42 +
  43 + /** 终点站末班时间 00:00 */
  44 + private String endStationEndTime;
  45 +
  46 + /** 所属公司 */
  47 + private String company;
  48 +
  49 + /** 分公司 */
  50 + private String brancheCompany;
  51 +
  52 + /** 性质(线路类型) */
  53 + private String nature;
  54 +
  55 + /**线路等级 */
  56 + private String level;
  57 +
  58 + /**是否撤销 <1:是;0:否> */
  59 + private Integer destroy;
  60 +
  61 + /** 是否夜宵线 <1:是;0:否> */
  62 + private Integer supperLine;
  63 +
  64 + /** 设备线路编码 */
  65 + private String eqLinecode;
  66 +
  67 + /**
  68 + * 创建日期 timestamp
  69 + */
  70 + private Date createDate;
  71 +
  72 + //-------------- 标准信息 -----------
  73 + /** 标准总里程 */
  74 + private Double totalMileage;
  75 + /** 早高峰大间隔(分钟) */
  76 + private Double earlyIntervalLg;
  77 +
  78 + /** 晚高峰大间隔(分钟) */
  79 + private Double lateIntervalLg;
  80 +
  81 + /** 平时大间隔(分钟) */
  82 + private Double intervalLg;
  83 +
  84 + /** 限速(平时) */
  85 + private Double speedLimit;
  86 +
  87 + /** 滞站 */
  88 + private Integer lagStation;
  89 +
  90 + /** 越站 */
  91 + private Integer skip;
  92 +
  93 + /** 超速 */
  94 + private Integer speeding;
  95 +
  96 + /** 串线 */
  97 + private Integer crossedLine;
  98 +
  99 + /** 越界 */
  100 + private Integer overflights;
  101 +
  102 + /**
  103 + * 上海市线路编码
  104 + */
  105 + private String shanghaiLinecode;
  106 +
  107 + // 环线或双向
  108 + private int linePlayType;
  109 +
  110 + public String getName() {
  111 + return name;
  112 + }
  113 +
  114 + public void setName(String name) {
  115 + this.name = name;
  116 + }
  117 +
  118 + public String getLineCode() {
  119 + return lineCode;
  120 + }
  121 +
  122 + public void setLineCode(String lineCode) {
  123 + this.lineCode = lineCode;
  124 + }
  125 +
  126 + public String getStartStationName() {
  127 + return startStationName;
  128 + }
  129 +
  130 + public void setStartStationName(String startStationName) {
  131 + this.startStationName = startStationName;
  132 + }
  133 +
  134 + public String getEndStationName() {
  135 + return endStationName;
  136 + }
  137 +
  138 + public void setEndStationName(String endStationName) {
  139 + this.endStationName = endStationName;
  140 + }
  141 +
  142 + public String getStartStationFirstTime() {
  143 + return startStationFirstTime;
  144 + }
  145 +
  146 + public void setStartStationFirstTime(String startStationFirstTime) {
  147 + this.startStationFirstTime = startStationFirstTime;
  148 + }
  149 +
  150 + public String getStartStationEndTime() {
  151 + return startStationEndTime;
  152 + }
  153 +
  154 + public void setStartStationEndTime(String startStationEndTime) {
  155 + this.startStationEndTime = startStationEndTime;
  156 + }
  157 +
  158 + public String getEndStationFirstTime() {
  159 + return endStationFirstTime;
  160 + }
  161 +
  162 + public void setEndStationFirstTime(String endStationFirstTime) {
  163 + this.endStationFirstTime = endStationFirstTime;
  164 + }
  165 +
  166 + public String getEndStationEndTime() {
  167 + return endStationEndTime;
  168 + }
  169 +
  170 + public void setEndStationEndTime(String endStationEndTime) {
  171 + this.endStationEndTime = endStationEndTime;
  172 + }
  173 +
  174 + public String getCompany() {
  175 + return company;
  176 + }
  177 +
  178 + public void setCompany(String company) {
  179 + this.company = company;
  180 + }
  181 +
  182 + public String getBrancheCompany() {
  183 + return brancheCompany;
  184 + }
  185 +
  186 + public void setBrancheCompany(String brancheCompany) {
  187 + this.brancheCompany = brancheCompany;
  188 + }
  189 +
  190 + public String getNature() {
  191 + return nature;
  192 + }
  193 +
  194 + public void setNature(String nature) {
  195 + this.nature = nature;
  196 + }
  197 +
  198 + public String getLevel() {
  199 + return level;
  200 + }
  201 +
  202 + public void setLevel(String level) {
  203 + this.level = level;
  204 + }
  205 +
  206 + public Integer getDestroy() {
  207 + return destroy;
  208 + }
  209 +
  210 + public void setDestroy(Integer destroy) {
  211 + this.destroy = destroy;
  212 + }
  213 +
  214 + public Integer getSupperLine() {
  215 + return supperLine;
  216 + }
  217 +
  218 + public void setSupperLine(Integer supperLine) {
  219 + this.supperLine = supperLine;
  220 + }
  221 +
  222 + public String getEqLinecode() {
  223 + return eqLinecode;
  224 + }
  225 +
  226 + public void setEqLinecode(String eqLinecode) {
  227 + this.eqLinecode = eqLinecode;
  228 + }
  229 +
  230 + @XmlJavaTypeAdapter(DateTimeAdapter.class)
  231 + public Date getCreateDate() {
  232 + return createDate;
  233 + }
  234 +
  235 + public void setCreateDate(Date createDate) {
  236 + this.createDate = createDate;
  237 + }
  238 +
  239 + public Double getTotalMileage() {
  240 + return totalMileage;
  241 + }
  242 +
  243 + public void setTotalMileage(Double totalMileage) {
  244 + this.totalMileage = totalMileage;
  245 + }
  246 +
  247 + public Double getEarlyIntervalLg() {
  248 + return earlyIntervalLg;
  249 + }
  250 +
  251 + public void setEarlyIntervalLg(Double earlyIntervalLg) {
  252 + this.earlyIntervalLg = earlyIntervalLg;
  253 + }
  254 +
  255 + public Double getLateIntervalLg() {
  256 + return lateIntervalLg;
  257 + }
  258 +
  259 + public void setLateIntervalLg(Double lateIntervalLg) {
  260 + this.lateIntervalLg = lateIntervalLg;
  261 + }
  262 +
  263 + public Double getIntervalLg() {
  264 + return intervalLg;
  265 + }
  266 +
  267 + public void setIntervalLg(Double intervalLg) {
  268 + this.intervalLg = intervalLg;
  269 + }
  270 +
  271 + public Double getSpeedLimit() {
  272 + return speedLimit;
  273 + }
  274 +
  275 + public void setSpeedLimit(Double speedLimit) {
  276 + this.speedLimit = speedLimit;
  277 + }
  278 +
  279 + public Integer getLagStation() {
  280 + return lagStation;
  281 + }
  282 +
  283 + public void setLagStation(Integer lagStation) {
  284 + this.lagStation = lagStation;
  285 + }
  286 +
  287 + public Integer getSkip() {
  288 + return skip;
  289 + }
  290 +
  291 + public void setSkip(Integer skip) {
  292 + this.skip = skip;
  293 + }
  294 +
  295 + public Integer getSpeeding() {
  296 + return speeding;
  297 + }
  298 +
  299 + public void setSpeeding(Integer speeding) {
  300 + this.speeding = speeding;
  301 + }
  302 +
  303 + public Integer getCrossedLine() {
  304 + return crossedLine;
  305 + }
  306 +
  307 + public void setCrossedLine(Integer crossedLine) {
  308 + this.crossedLine = crossedLine;
  309 + }
  310 +
  311 + public Integer getOverflights() {
  312 + return overflights;
  313 + }
  314 +
  315 + public void setOverflights(Integer overflights) {
  316 + this.overflights = overflights;
  317 + }
  318 +
  319 + public String getShanghaiLinecode() {
  320 + return shanghaiLinecode;
  321 + }
  322 +
  323 + public void setShanghaiLinecode(String shanghaiLinecode) {
  324 + this.shanghaiLinecode = shanghaiLinecode;
  325 + }
  326 +
  327 + public int getLinePlayType() {
  328 + return linePlayType;
  329 + }
  330 +
  331 + public void setLinePlayType(int linePlayType) {
  332 + this.linePlayType = linePlayType;
  333 + }
  334 +}
... ...
src/main/java/com/bsth/server_rs/base_info/line/buffer/LineRefreshThread.java
1   -package com.bsth.server_rs.base_info.line.buffer;
2   -
3   -import com.bsth.server_rs.base_info.line.Line;
4   -import org.slf4j.Logger;
5   -import org.slf4j.LoggerFactory;
6   -import org.springframework.beans.factory.annotation.Autowired;
7   -import org.springframework.jdbc.core.BeanPropertyRowMapper;
8   -import org.springframework.jdbc.core.JdbcTemplate;
9   -import org.springframework.stereotype.Component;
10   -
11   -import java.util.ArrayList;
12   -import java.util.HashMap;
13   -import java.util.List;
14   -import java.util.Map;
15   -
16   -/**
17   - * Created by panzhao on 2017/3/27.
18   - */
19   -@Component
20   -public class LineRefreshThread extends Thread{
21   -
22   - @Autowired
23   - JdbcTemplate jdbcTemplate;
24   -
25   - Logger logger = LoggerFactory.getLogger(this.getClass());
26   -
27   - @Override
28   - public void run() {
29   -
30   - try {
31   - List<Line> list = jdbcTemplate.query("SELECT t1. NAME,t1.line_code,t1.start_station_name,t1.end_station_name,t1.start_station_first_time,t1.start_station_end_time,t1.end_station_first_time,t1.end_station_end_time,t1.company,t1.branche_company,t1.nature,t1.`level`,t1.destroy,t1.supper_line,t1.eq_linecode,t1.create_date,t2.total_mileage,t2.early_interval_lg,t2.late_interval_lg,t2.interval_lg,t2.speed_limit,t2.lag_station,t2.skip,t2.speeding,t2.crossed_line,t2.overflights,t1.shanghai_linecode FROM bsth_c_line t1 LEFT JOIN bsth_c_line_information t2 ON t1.id = t2.line where t1.destroy=0",
32   - BeanPropertyRowMapper.newInstance(Line.class));
33   -
34   - Map<String, Line> map = new HashMap<>();
35   - //过滤数据,多条线路配人的保留一条
36   - for(Line line : list){
37   - map.put(line.getLineCode(), line);
38   - }
39   -
40   - if(list != null && list.size() > 0)
41   - LineBufferData.replaceAll(new ArrayList(map.values()));
42   - }catch (Exception e){
43   - logger.error("", e);
44   - }
45   - }
46   -}
  1 +package com.bsth.server_rs.base_info.line.buffer;
  2 +
  3 +import com.bsth.server_rs.base_info.line.Line;
  4 +import org.slf4j.Logger;
  5 +import org.slf4j.LoggerFactory;
  6 +import org.springframework.beans.factory.annotation.Autowired;
  7 +import org.springframework.jdbc.core.BeanPropertyRowMapper;
  8 +import org.springframework.jdbc.core.JdbcTemplate;
  9 +import org.springframework.stereotype.Component;
  10 +
  11 +import java.util.ArrayList;
  12 +import java.util.HashMap;
  13 +import java.util.List;
  14 +import java.util.Map;
  15 +
  16 +/**
  17 + * Created by panzhao on 2017/3/27.
  18 + */
  19 +@Component
  20 +public class LineRefreshThread extends Thread{
  21 +
  22 + @Autowired
  23 + JdbcTemplate jdbcTemplate;
  24 +
  25 + Logger logger = LoggerFactory.getLogger(this.getClass());
  26 +
  27 + @Override
  28 + public void run() {
  29 +
  30 + try {
  31 + List<Line> list = jdbcTemplate.query("SELECT t1. NAME,t1.line_code,t1.start_station_name,t1.end_station_name,t1.start_station_first_time,t1.start_station_end_time,t1.end_station_first_time,t1.end_station_end_time,t1.company,t1.branche_company,t1.nature,t1.`level`,t1.destroy,t1.supper_line,t1.eq_linecode,t1.create_date,t2.total_mileage,t2.early_interval_lg,t2.late_interval_lg,t2.interval_lg,t2.speed_limit,t2.lag_station,t2.skip,t2.speeding,t2.crossed_line,t2.overflights,t1.shanghai_linecode, t1.line_play_type FROM bsth_c_line t1 LEFT JOIN bsth_c_line_information t2 ON t1.id = t2.line where t1.destroy=0",
  32 + BeanPropertyRowMapper.newInstance(Line.class));
  33 +
  34 + Map<String, Line> map = new HashMap<>();
  35 + //过滤数据,多条线路配人的保留一条
  36 + for(Line line : list){
  37 + map.put(line.getLineCode(), line);
  38 + }
  39 +
  40 + if(list != null && list.size() > 0)
  41 + LineBufferData.replaceAll(new ArrayList(map.values()));
  42 + }catch (Exception e){
  43 + logger.error("", e);
  44 + }
  45 + }
  46 +}
... ...