Commit 8056533b253a77c9e591bbbb8c03bc3c20f88838

Authored by 王通
1 parent 6f09bbeb

1.jdk7版本代码加入线路版本信息

Too many changes to show.

To preserve performance only 13 of 126 files are displayed.

README.md
1 -公交调度系统BS版 0.1  
2 -======  
3 -----------  
4 -## 目录  
5 ----------  
6 - * [字典表](#字典表)  
7 - * [动态jpa查询实现](#动态jpa查询实现)  
8 - * [车载 gps 相关数据](#gps)  
9 - * [实时gps数据接口 http](#实时gps接口)  
10 - * [进出站数据表结构](#进站数据)  
11 - * [异常警报表结构](#异常警报)  
12 - * [大间隔](#大间隔)  
13 - * [超速](#超速)  
14 - * [越界](#越界)  
15 - * [越站](#越站)  
16 - * [聚集](#聚集)  
17 - * [掉线](#掉线)  
18 - * [调度消息下发接口HTTP](#调度消息下发接口)  
19 - * [调度消息上传接口HTTP](#调度消息上传接口)  
20 - * [车辆历史GPS数据](#车辆历史GPS)  
21 -  
22 -----------  
23 -  
24 -## 字典表  
25 -----------  
26 -字典操作全部由前端负责,主要有2种。  
27 -  
28 -1、转换字典代码。  
29 - 当pjax的`pjax:success`事件被触发(片段加载完成)  
30 - 扫描容器内所有有 `$(".nt-dictionary")` 元素进行字典转换  
31 -``` html  
32 ---dom标签为span div p h1 h2 h3 h4 h5 h6 等等文本元素时,如下写法,text为要转换的代码  
33 -<span class="nt-dictionary" data-group="ScheduleType">out</span>  
34 ---to  
35 -<span>出场</span>  
36 -  
37 -<!- dom标签为input时,如下 data-code为要转换的代码 -->  
38 -<input class="nt-dictionary" data-group="ScheduleType" data-code="out">  
39 ---to  
40 -<input value="出场">  
41 -  
42 -<!- dom标签为select时 如下 data-code为要选中的项 -->  
43 -<select class="nt-dictionary" data-group="ScheduleType" data-code="out"></select>  
44 ---to  
45 -<select>  
46 - <option value="normal">正常班次</option>  
47 - <option value="out" selected>出场</option>  
48 - <option value="in">进场</option>  
49 - <option value="oil">加油</option>  
50 - <option value="temp">临加</option>  
51 - <option value="region">区间</option>  
52 - <option value="venting">放空</option>  
53 - <option value="major">放大站</option>  
54 -</select>  
55 -```  
56 -*原标签的class 除nt-dictionary 外,其余均会被保留*  
57 -  
58 -2、dictionary.js提供如下方法自行使用  
59 -| 方法名 | 参数|返回|  
60 -| ---- | ---- | ---- | ---- |  
61 -| groups (获取所有字典组) | 无| | {LineTrend: 线路走向, ScheduleType: 班次类型} |  
62 -| getByGroup (获取字典组下的字典)| (group) |{0: 上行, 1: 下行}|  
63 -| transformCode (转换字典代码)| (group, code) | 上行 |  
64 -  
65 -## 动态jpa查询实现  
66 -----------  
67 -*参考调度系统枚举com.bsth.entity.search.SearchOperator*  
68 -  
69 -  
70 -## gps  
71 -----------  
72 -### 实时gps接口  
73 -  
74 -所有在线GPS: [http://192.168.168.192:8080/transport_server/rtgps](http://192.168.168.192:8080/transport_server/rtgps/)  
75 -根据设备号查询:[http://192.168.168.192:8080/transport_server/rtgps/05B01901](http://192.168.168.192:8080/transport_server/rtgps/05B01901)  
76 -  
77 -<span style="color: red">Response</span>:  
78 -```json  
79 -{  
80 - "data":[  
81 - {  
82 - "companyCode":5,  
83 - "lineId":10329,  
84 - "deviceId":"05B01901",  
85 - "carparkNo":"00000000",  
86 - "stopNo":"7C890002",  
87 - "lon":121.549866,  
88 - "lat":31.238798,  
89 - "timestamp":1397104499000,  
90 - "speed":42.0,  
91 - "direction":245.9,  
92 - "state":0,  
93 - "upDown":0  
94 - }]  
95 -}  
96 -```  
97 -  
98 -| -- | --|--|  
99 -| ---- | ---- | ---- |  
100 -| companyCode | int | 公司代码 |  
101 -| lineId | int | 线路编码 |  
102 -| deviceId | String | 设备编号 |  
103 -| carparkNo | String | 停车场编码 |  
104 -| stopNo | String | 站点编码 |  
105 -| lon | float | 经度 |  
106 -| lat | float | 纬度 |  
107 -| timestamp | long | 时间戳 |  
108 -| speed | float | 速度|  
109 -| direction | float | 方向(角度) |  
110 -| state | int | 营运状态( 0 营运 ,1 非营运, -1 无效) |  
111 -| upDown | int | 上下行(0 上行 , 1 下行 , -1 无效)|  
112 -  
113 -  
114 -### 进站数据  
115 -----------  
116 -表名:  
117 -  
118 -| .. | .. | .. |  
119 -| ---- | ---- | ---- |  
120 -| id | int | 主键 |  
121 -| deviceId | String | 设备号 |  
122 -| lineId | int | 线路编码 |  
123 -| stopNo | long | 站点编码 |  
124 -| timestamp | long | 时间戳 |  
125 -| upDown | int | 上下行(0 上行 , 1 下行 , -1 无效) |  
126 -| createDate | Date | 创建时间 |  
127 -  
128 -  
129 -### 异常警报  
130 -----------  
131 -  
132 -### 大间隔  
133 -----------  
134 -表名:  
135 -  
136 -| .. | .. | .. |  
137 -| ---- | ---- | ---- |  
138 -| id | int | 主键 |  
139 -| line | int | 线路编码 |  
140 -| station | String | 站点编码 |  
141 -| cVehicle | String | 当前车辆编码 |  
142 -| lastVehicle | String | 上一个车辆编码 |  
143 -| interval | long | 间隔时间(秒) |  
144 -| timestamp | long | 时间戳 |  
145 -| createDate | Date | 创建时间 |  
146 -  
147 -### 超速  
148 -----------  
149 -表名:  
150 -  
151 -| .. | .. | .. |  
152 -| ---- | ---- | ---- |  
153 -| id | int | 主键 |  
154 -| vehicle | String | 车辆编码 |  
155 -| line | int | 线路编码 |  
156 -| upDown | int | 上下行(0 上行 , 1 下行 , -1 无效) |  
157 -| lon | float | 经度 |  
158 -| lat | float | 纬度|  
159 -| speed | float | 速度 |  
160 -| timestamp | long | 时间戳 |  
161 -| createDate | Date | 时间 |  
162 -  
163 -### 越界  
164 -----------  
165 -表名:  
166 -  
167 -| .. | .. | .. |  
168 -| ---- | ---- | ---- |  
169 -| id | int | 主键 |  
170 -| vehicle | String | 车辆编码 |  
171 -| line | int | 线路编码 |  
172 -| upDown | int | 上下行(0 上行 , 1 下行 , -1 无效) |  
173 -| lon | float | 经度 |  
174 -| lat | float | 纬度|  
175 -| location | String | 越界位置(由线调页面进行初始转换)意思是该字段默认为空,页面第一次查看时会写入值|  
176 -| timestamp | long | 时间戳 |  
177 -| createDate | Date | 时间 |  
178 -  
179 -  
180 -### 越站  
181 -----------  
182 -表名:  
183 -  
184 -| .. | .. | .. |  
185 -| ---- | ---- | ---- |  
186 -| id | int | 主键 |  
187 -| line | int | 线路编码 |  
188 -| upDown | int | 上下行(0 上行 , 1 下行 , -1 无效) |  
189 -| station | String | 站点编码 |  
190 -| vehicle | String | 车辆编码 |  
191 -| inData | Date | 进站时间 |  
192 -| outDate | Date | 出站时间 |  
193 -  
194 -  
195 -### 聚集  
196 -----------  
197 -表名:  
198 -  
199 -| .. | .. | .. |  
200 -| ---- | ---- | ---- |  
201 -| id | int | 主键 |  
202 -| line | int | 线路编码 |  
203 -| upDown | int | 上下行(0 上行 , 1 下行 , -1 无效) |  
204 -| stations | String | 站点(多个用 , 号分隔。应该是连续站点) |  
205 -| vehicles | String | 车辆编码(多个用 , 号分隔) |  
206 -| timestamp | long | 时间戳 |  
207 -| createDate | Date | 时间 |  
208 -  
209 -  
210 -### 掉线  
211 -----------  
212 -表名:  
213 -  
214 -| .. | .. | .. |  
215 -| ---- | ---- | ---- |  
216 -| id | int | 主键 |  
217 -| line | int | 线路编码 |  
218 -| upDown | int | 上下行(0 上行 , 1 下行 , -1 无效) |  
219 -| vehicle | String | 车辆编码 |  
220 -| lon | float | 经度 |  
221 -| lat | float | 纬度|  
222 -| timestamp | long | 时间戳 |  
223 -| createDate | Date | 时间 |  
224 -  
225 -  
226 -### 调度消息下发接口  
227 -----------  
228 -[http://192.168.168.192:8080/transport_server/message](http://192.168.168.192:8080/transport_server/message/)  
229 -  
230 -<span style="color: red">Request</span>:  
231 -```json  
232 -{  
233 - "deviceId":12345,  
234 - "timestamp":44324,  
235 - "operCode":0x60,  
236 - "data":{  
237 - "companyCode":22,  
238 - "deviceId":"029L2222",  
239 - "timestamp":134326,  
240 - "instructType":00,  
241 - "dispatchInstruct":0x00,  
242 - "msgId":12345,  
243 - "alarmTime":201606012000,  
244 - "serviceState":00000000,  
245 - "txtContent":"你好"  
246 - }  
247 -}  
248 -```  
249 -| .. | .. | .. |  
250 -| ---- | ---- | ---- |  
251 -| deviceId | string | 设备编号 |  
252 -| timestamp | long | 时间戳(ms) |  
253 -| operCode | short | 一级协议 |  
254 -| data.companyCode | short | 公司代码 |  
255 -| data.deviceId | string | 设备编号 |  
256 -| data.timestamp | long | 时间戳 |  
257 -| data.instructType | short | 保留 默认0 |  
258 -| data.dispatchInstruct | short | 调度指令 调度指令。0X00表示信息短语,0X01表示取消上次指令+调度指令(闹钟有效),0x02表示为调度指令(闹钟有效); 0x03表示运营状态指令(闹钟无效);0x04表示其他指令。|  
259 -| data.msgId | long | 同上 |  
260 -| data.alarmTime | long | 闹钟 MMddhhmm|  
261 -| data.serviceState | long | 多状态字节   先由车载发起车辆故障、事故报告、扣证、纠纷、加油等审请,经调度确认后,下发调度指令与运营状态。当调度指令为0X00终端需要提示信息。当调度指令为0x01和0x02,终端需要收到后提示信息。并且必须在闹钟结束后进行终端相关状态更新。在闹钟时间前120秒开始提示。当调度指令为0x03,收到后进行终端相关状态更新,终端不需要提示信息。当调度指令为0x04,暂不需要提示信息。|  
262 -| data.txtContent | string | 下发的消息文本 |  
263 -```json  
264 -{  
265 - "deviceId":12345,  
266 - "timestamp":44324,  
267 - "operCode":0x64,  
268 - "data":{  
269 - "cityCode":22,  
270 - "deviceId":"029L2222",  
271 - "lineId":"134326"  
272 - }  
273 -}  
274 -```  
275 -| .. | .. | .. |  
276 -| ---- | ---- | ---- |  
277 -| deviceId | string | 设备编号 |  
278 -| timestamp | long | 时间戳(ms) |  
279 -| operCode | short | 一级协议 |  
280 -| data.cityCode | short | 城市区号 |  
281 -| data.deviceId | string | 设备编号 |  
282 -| data.lineId | string | 线路编号 6位 不足6位前面补0 如编号890 用000890表示 |  
283 -  
284 -```json  
285 -{  
286 - "deviceId":12345,  
287 - "timestamp":44324,  
288 - "operCode":0xC0,  
289 - "data":{  
290 - "operCode":0x86,  
291 - "requestAck":0x06  
292 - }  
293 -}  
294 -```  
295 -| .. | .. | .. |  
296 -| ---- | ---- | ---- |  
297 -| deviceId | string | 设备编号 |  
298 -| timestamp | long | 时间戳(ms) |  
299 -| operCode | short | 一级协议 |  
300 -| data.operCode | short | 二级协议 |  
301 -| data.requestAck | short | 请求应答字 0x06同意 0x15不同意|  
302 -  
303 -```json  
304 -{  
305 - "deviceId":12345,  
306 - "timestamp":44324,  
307 - "operCode":0xC0,  
308 - "data":{  
309 - "operCode":0xa3,  
310 - "deviceId":12345,  
311 - "ipAddress":222.66.0.204,  
312 - "port":8899,  
313 - "reportMode":0,  
314 - "interval":0,  
315 - "distance":0,  
316 - "speedingThreshold":0,  
317 - "alarmThreshold":0,  
318 - "posIpAddress":0,  
319 - "posPort":0,  
320 - "delay":0,  
321 - "speedThreshold1":0,  
322 - "speedThreshold2":0,  
323 - "contrast":0,  
324 - "brightness":0,  
325 - "saturation":0  
326 - }  
327 -}  
328 -```  
329 -| .. | .. | .. |  
330 -| ---- | ---- | ---- |  
331 -| deviceId | string | 设备编号 |  
332 -| timestamp | long | 时间戳(ms) |  
333 -| operCode | short | 一级协议 |  
334 -| data.operCode | short | 二级协议 |  
335 -| data.deviceId | string | 设备编号|  
336 -| data.ipAddress | string | 网关IP地址|  
337 -| data.port | string | 网关端口|  
338 -| data.reportMode | short | 定时定距上报模式|  
339 -| data.interval | int | 定时上报时间间隔|  
340 -| data.distance | string | 定距上报距离间隔|  
341 -| data.speedingThreshold | short | 非线路状态超速阀门|  
342 -| data.alarmThreshold | short | 预警阀门|  
343 -| data.posIpAddress | string | pos机IP地址|  
344 -| data.posPort | string | pos机端口|  
345 -| data.delay | int | 延迟机关时间|  
346 -| data.deviceId | short | 中门视频切换到码表界面速度阀门 默认45|  
347 -| data.deviceId | short | 码表界面切换到中门视频速度阀门 默认35|  
348 -| data.deviceId | short | 对比度|  
349 -| data.deviceId | short | 亮度|  
350 -| data.deviceId | short | 饱和度|  
351 -  
352 -```json  
353 -{  
354 - "deviceId":12345,  
355 - "timestamp":44324,  
356 - "operCode":0xC0,  
357 - "data":{  
358 - "operCode":0xa4  
359 - }  
360 -}  
361 -```  
362 -| .. | .. | .. |  
363 -| ---- | ---- | ---- |  
364 -| deviceId | string | 设备编号 |  
365 -| timestamp | long | 时间戳(ms) |  
366 -| operCode | short | 一级协议 |  
367 -| data.operCode | short | 二级协议 |  
368 -  
369 -```json  
370 -{  
371 - "deviceId":12345,  
372 - "timestamp":44324,  
373 - "operCode":0xC0,  
374 - "data":{  
375 - "operCode":0xa5  
376 - "programVersion":2  
377 - }  
378 -}  
379 -```  
380 -| .. | .. | .. |  
381 -| ---- | ---- | ---- |  
382 -| deviceId | string | 设备编号 |  
383 -| timestamp | long | 时间戳(ms) |  
384 -| operCode | short | 一级协议 |  
385 -| data.operCode | short | 二级协议 |  
386 -| data.programVersion | short | 程序版本 |  
387 -  
388 -<span style="color: red">Response</span>:  
389 -```json  
390 -{  
391 - "errCode":0  
392 -}  
393 -```  
394 -  
395 -### 调度消息上传接口  
396 -----------  
397 -上行POST地址:[http://192.168.168.120:9088/control/upstream](http://192.168.168.120:9088/control/upstream)  
398 -<span style="color: red">Request</span>:  
399 -```json  
400 -{  
401 - "deviceId":12345,  
402 - "timestamp":44324,  
403 - "status":0,  
404 - "operCode":0x80,  
405 - "data":{  
406 - "operCode":0x26,  
407 - "requestCode":22  
408 - }  
409 -}  
410 -```  
411 -| .. | .. | .. |  
412 -| ---- | ---- | ---- |  
413 -| deviceId | string | 设备编号 |  
414 -| timestamp | long | 时间戳(ms) |  
415 -| status | int | 0x80时无数据 0表示失败 1表示成功或设备确认 2表示驾驶员阅读 |  
416 -| operCode | short | 一级协议 消息确认将无数据 |  
417 -| data.operCode | short | 二级协议 |  
418 -| data.requestCode | short | 请求代码0xa1 恢复运营 0xa2 申请调档 0xa3 出场请求 0xa5 进场请求 0xa7 加油请求 0x50 车辆故障 0x70 路阻报告 0x60 事故报告 0x11 扣证纠纷 0x12 报警 |  
419 -<span style="color: red">Response</span>:  
420 -```json  
421 -{  
422 - "errCode":0  
423 -}  
424 -```  
425 -  
426 -### 车辆历史GPS  
427 -----------  
428 -表名:BSTH_C_GPS_INFO  
429 -  
430 -| .. | .. | .. |  
431 -| ---- | ---- | ---- |  
432 -| cityCode | int | 城市代码 |  
433 -| industryCode | int | 行业代码 |  
434 -| companyCode | int | 企业代码 |  
435 -| lineId | int | 线路编号 |  
436 -| deviceId | string | 设备编号 |  
437 -| driverNo | int | 驾驶员工号 |  
438 -| carparkSerialNo | int | 停车场序列号 |  
439 -| carparkNo | string | 停车场编号 |  
440 -| stopSerialNo | int | 站点序列号 |  
441 -| stopNo | string | 停车场编号 |  
442 -| lon | float | 经度 |  
443 -| lat | float | 维度 |  
444 -| ts | long | 时间戳 |  
445 -| speedSensor | float | 发动机速度 |  
446 -| speedGps | float | gps速度 |  
447 -| direction | float | 角度0-359 |  
448 -| inTemp | int | 车内温度 |  
449 -| serviceState | long | 设备状态字 |  
450 -<<<<<<< HEAD  
451 -| daysYear | int | 对应年中的天数 为分区字段 查询一定要用此字段过滤 |  
452 -=======  
453 -| daysYear | int | 对应年中的天数 为分区字段 查询一定要用此字段过滤 |  
454 -  
455 ->>>>>>> af8ec3bedc8644f5813e9adab12a163e93cc7f50 1 +公交调度系统BS版 0.1
  2 +======
  3 +----------
  4 +## 目录
  5 +---------
  6 + * [字典表](#字典表)
  7 + * [动态jpa查询实现](#动态jpa查询实现)
  8 + * [车载 gps 相关数据](#gps)
  9 + * [实时gps数据接口 http](#实时gps接口)
  10 + * [进出站数据表结构](#进站数据)
  11 + * [异常警报表结构](#异常警报)
  12 + * [大间隔](#大间隔)
  13 + * [超速](#超速)
  14 + * [越界](#越界)
  15 + * [越站](#越站)
  16 + * [聚集](#聚集)
  17 + * [掉线](#掉线)
  18 + * [调度消息下发接口HTTP](#调度消息下发接口)
  19 + * [调度消息上传接口HTTP](#调度消息上传接口)
  20 + * [车辆历史GPS数据](#车辆历史GPS)
  21 +
  22 +----------
  23 +
  24 +## 字典表
  25 +----------
  26 +字典操作全部由前端负责,主要有2种。
  27 +
  28 +1、转换字典代码。
  29 + 当pjax的`pjax:success`事件被触发(片段加载完成)
  30 + 扫描容器内所有有 `$(".nt-dictionary")` 元素进行字典转换
  31 +``` html
  32 +--dom标签为span div p h1 h2 h3 h4 h5 h6 等等文本元素时,如下写法,text为要转换的代码
  33 +<span class="nt-dictionary" data-group="ScheduleType">out</span>
  34 +--to
  35 +<span>出场</span>
  36 +
  37 +<!- dom标签为input时,如下 data-code为要转换的代码 -->
  38 +<input class="nt-dictionary" data-group="ScheduleType" data-code="out">
  39 +--to
  40 +<input value="出场">
  41 +
  42 +<!- dom标签为select时 如下 data-code为要选中的项 -->
  43 +<select class="nt-dictionary" data-group="ScheduleType" data-code="out"></select>
  44 +--to
  45 +<select>
  46 + <option value="normal">正常班次</option>
  47 + <option value="out" selected>出场</option>
  48 + <option value="in">进场</option>
  49 + <option value="oil">加油</option>
  50 + <option value="temp">临加</option>
  51 + <option value="region">区间</option>
  52 + <option value="venting">放空</option>
  53 + <option value="major">放大站</option>
  54 +</select>
  55 +```
  56 +*原标签的class 除nt-dictionary 外,其余均会被保留*
  57 +
  58 +2、dictionary.js提供如下方法自行使用
  59 +| 方法名 | 参数|返回|
  60 +| ---- | ---- | ---- | ---- |
  61 +| groups (获取所有字典组) | 无| | {LineTrend: 线路走向, ScheduleType: 班次类型} |
  62 +| getByGroup (获取字典组下的字典)| (group) |{0: 上行, 1: 下行}|
  63 +| transformCode (转换字典代码)| (group, code) | 上行 |
  64 +
  65 +## 动态jpa查询实现
  66 +----------
  67 +*参考调度系统枚举com.bsth.entity.search.SearchOperator*
  68 +
  69 +
  70 +## gps
  71 +----------
  72 +### 实时gps接口
  73 +
  74 +所有在线GPS: [http://192.168.168.192:8080/transport_server/rtgps](http://192.168.168.192:8080/transport_server/rtgps/)
  75 +根据设备号查询:[http://192.168.168.192:8080/transport_server/rtgps/05B01901](http://192.168.168.192:8080/transport_server/rtgps/05B01901)
  76 +
  77 +<span style="color: red">Response</span>:
  78 +```json
  79 +{
  80 + "data":[
  81 + {
  82 + "companyCode":5,
  83 + "lineId":10329,
  84 + "deviceId":"05B01901",
  85 + "carparkNo":"00000000",
  86 + "stopNo":"7C890002",
  87 + "lon":121.549866,
  88 + "lat":31.238798,
  89 + "timestamp":1397104499000,
  90 + "speed":42.0,
  91 + "direction":245.9,
  92 + "state":0,
  93 + "upDown":0
  94 + }]
  95 +}
  96 +```
  97 +
  98 +| -- | --|--|
  99 +| ---- | ---- | ---- |
  100 +| companyCode | int | 公司代码 |
  101 +| lineId | int | 线路编码 |
  102 +| deviceId | String | 设备编号 |
  103 +| carparkNo | String | 停车场编码 |
  104 +| stopNo | String | 站点编码 |
  105 +| lon | float | 经度 |
  106 +| lat | float | 纬度 |
  107 +| timestamp | long | 时间戳 |
  108 +| speed | float | 速度|
  109 +| direction | float | 方向(角度) |
  110 +| state | int | 营运状态( 0 营运 ,1 非营运, -1 无效) |
  111 +| upDown | int | 上下行(0 上行 , 1 下行 , -1 无效)|
  112 +
  113 +
  114 +### 进站数据
  115 +----------
  116 +表名:
  117 +
  118 +| .. | .. | .. |
  119 +| ---- | ---- | ---- |
  120 +| id | int | 主键 |
  121 +| deviceId | String | 设备号 |
  122 +| lineId | int | 线路编码 |
  123 +| stopNo | long | 站点编码 |
  124 +| timestamp | long | 时间戳 |
  125 +| upDown | int | 上下行(0 上行 , 1 下行 , -1 无效) |
  126 +| createDate | Date | 创建时间 |
  127 +
  128 +
  129 +### 异常警报
  130 +----------
  131 +
  132 +### 大间隔
  133 +----------
  134 +表名:
  135 +
  136 +| .. | .. | .. |
  137 +| ---- | ---- | ---- |
  138 +| id | int | 主键 |
  139 +| line | int | 线路编码 |
  140 +| station | String | 站点编码 |
  141 +| cVehicle | String | 当前车辆编码 |
  142 +| lastVehicle | String | 上一个车辆编码 |
  143 +| interval | long | 间隔时间(秒) |
  144 +| timestamp | long | 时间戳 |
  145 +| createDate | Date | 创建时间 |
  146 +
  147 +### 超速
  148 +----------
  149 +表名:
  150 +
  151 +| .. | .. | .. |
  152 +| ---- | ---- | ---- |
  153 +| id | int | 主键 |
  154 +| vehicle | String | 车辆编码 |
  155 +| line | int | 线路编码 |
  156 +| upDown | int | 上下行(0 上行 , 1 下行 , -1 无效) |
  157 +| lon | float | 经度 |
  158 +| lat | float | 纬度|
  159 +| speed | float | 速度 |
  160 +| timestamp | long | 时间戳 |
  161 +| createDate | Date | 时间 |
  162 +
  163 +### 越界
  164 +----------
  165 +表名:
  166 +
  167 +| .. | .. | .. |
  168 +| ---- | ---- | ---- |
  169 +| id | int | 主键 |
  170 +| vehicle | String | 车辆编码 |
  171 +| line | int | 线路编码 |
  172 +| upDown | int | 上下行(0 上行 , 1 下行 , -1 无效) |
  173 +| lon | float | 经度 |
  174 +| lat | float | 纬度|
  175 +| location | String | 越界位置(由线调页面进行初始转换)意思是该字段默认为空,页面第一次查看时会写入值|
  176 +| timestamp | long | 时间戳 |
  177 +| createDate | Date | 时间 |
  178 +
  179 +
  180 +### 越站
  181 +----------
  182 +表名:
  183 +
  184 +| .. | .. | .. |
  185 +| ---- | ---- | ---- |
  186 +| id | int | 主键 |
  187 +| line | int | 线路编码 |
  188 +| upDown | int | 上下行(0 上行 , 1 下行 , -1 无效) |
  189 +| station | String | 站点编码 |
  190 +| vehicle | String | 车辆编码 |
  191 +| inData | Date | 进站时间 |
  192 +| outDate | Date | 出站时间 |
  193 +
  194 +
  195 +### 聚集
  196 +----------
  197 +表名:
  198 +
  199 +| .. | .. | .. |
  200 +| ---- | ---- | ---- |
  201 +| id | int | 主键 |
  202 +| line | int | 线路编码 |
  203 +| upDown | int | 上下行(0 上行 , 1 下行 , -1 无效) |
  204 +| stations | String | 站点(多个用 , 号分隔。应该是连续站点) |
  205 +| vehicles | String | 车辆编码(多个用 , 号分隔) |
  206 +| timestamp | long | 时间戳 |
  207 +| createDate | Date | 时间 |
  208 +
  209 +
  210 +### 掉线
  211 +----------
  212 +表名:
  213 +
  214 +| .. | .. | .. |
  215 +| ---- | ---- | ---- |
  216 +| id | int | 主键 |
  217 +| line | int | 线路编码 |
  218 +| upDown | int | 上下行(0 上行 , 1 下行 , -1 无效) |
  219 +| vehicle | String | 车辆编码 |
  220 +| lon | float | 经度 |
  221 +| lat | float | 纬度|
  222 +| timestamp | long | 时间戳 |
  223 +| createDate | Date | 时间 |
  224 +
  225 +
  226 +### 调度消息下发接口
  227 +----------
  228 +[http://192.168.168.192:8080/transport_server/message](http://192.168.168.192:8080/transport_server/message/)
  229 +
  230 +<span style="color: red">Request</span>:
  231 +```json
  232 +{
  233 + "deviceId":12345,
  234 + "timestamp":44324,
  235 + "operCode":0x60,
  236 + "data":{
  237 + "companyCode":22,
  238 + "deviceId":"029L2222",
  239 + "timestamp":134326,
  240 + "instructType":00,
  241 + "dispatchInstruct":0x00,
  242 + "msgId":12345,
  243 + "alarmTime":201606012000,
  244 + "serviceState":00000000,
  245 + "txtContent":"你好"
  246 + }
  247 +}
  248 +```
  249 +| .. | .. | .. |
  250 +| ---- | ---- | ---- |
  251 +| deviceId | string | 设备编号 |
  252 +| timestamp | long | 时间戳(ms) |
  253 +| operCode | short | 一级协议 |
  254 +| data.companyCode | short | 公司代码 |
  255 +| data.deviceId | string | 设备编号 |
  256 +| data.timestamp | long | 时间戳 |
  257 +| data.instructType | short | 保留 默认0 |
  258 +| data.dispatchInstruct | short | 调度指令 调度指令。0X00表示信息短语,0X01表示取消上次指令+调度指令(闹钟有效),0x02表示为调度指令(闹钟有效); 0x03表示运营状态指令(闹钟无效);0x04表示其他指令。|
  259 +| data.msgId | long | 同上 |
  260 +| data.alarmTime | long | 闹钟 MMddhhmm|
  261 +| data.serviceState | long | 多状态字节   先由车载发起车辆故障、事故报告、扣证、纠纷、加油等审请,经调度确认后,下发调度指令与运营状态。当调度指令为0X00终端需要提示信息。当调度指令为0x01和0x02,终端需要收到后提示信息。并且必须在闹钟结束后进行终端相关状态更新。在闹钟时间前120秒开始提示。当调度指令为0x03,收到后进行终端相关状态更新,终端不需要提示信息。当调度指令为0x04,暂不需要提示信息。|
  262 +| data.txtContent | string | 下发的消息文本 |
  263 +```json
  264 +{
  265 + "deviceId":12345,
  266 + "timestamp":44324,
  267 + "operCode":0x64,
  268 + "data":{
  269 + "cityCode":22,
  270 + "deviceId":"029L2222",
  271 + "lineId":"134326"
  272 + }
  273 +}
  274 +```
  275 +| .. | .. | .. |
  276 +| ---- | ---- | ---- |
  277 +| deviceId | string | 设备编号 |
  278 +| timestamp | long | 时间戳(ms) |
  279 +| operCode | short | 一级协议 |
  280 +| data.cityCode | short | 城市区号 |
  281 +| data.deviceId | string | 设备编号 |
  282 +| data.lineId | string | 线路编号 6位 不足6位前面补0 如编号890 用000890表示 |
  283 +
  284 +```json
  285 +{
  286 + "deviceId":12345,
  287 + "timestamp":44324,
  288 + "operCode":0xC0,
  289 + "data":{
  290 + "operCode":0x86,
  291 + "requestAck":0x06
  292 + }
  293 +}
  294 +```
  295 +| .. | .. | .. |
  296 +| ---- | ---- | ---- |
  297 +| deviceId | string | 设备编号 |
  298 +| timestamp | long | 时间戳(ms) |
  299 +| operCode | short | 一级协议 |
  300 +| data.operCode | short | 二级协议 |
  301 +| data.requestAck | short | 请求应答字 0x06同意 0x15不同意|
  302 +
  303 +```json
  304 +{
  305 + "deviceId":12345,
  306 + "timestamp":44324,
  307 + "operCode":0xC0,
  308 + "data":{
  309 + "operCode":0xa3,
  310 + "deviceId":12345,
  311 + "ipAddress":222.66.0.204,
  312 + "port":8899,
  313 + "reportMode":0,
  314 + "interval":0,
  315 + "distance":0,
  316 + "speedingThreshold":0,
  317 + "alarmThreshold":0,
  318 + "posIpAddress":0,
  319 + "posPort":0,
  320 + "delay":0,
  321 + "speedThreshold1":0,
  322 + "speedThreshold2":0,
  323 + "contrast":0,
  324 + "brightness":0,
  325 + "saturation":0
  326 + }
  327 +}
  328 +```
  329 +| .. | .. | .. |
  330 +| ---- | ---- | ---- |
  331 +| deviceId | string | 设备编号 |
  332 +| timestamp | long | 时间戳(ms) |
  333 +| operCode | short | 一级协议 |
  334 +| data.operCode | short | 二级协议 |
  335 +| data.deviceId | string | 设备编号|
  336 +| data.ipAddress | string | 网关IP地址|
  337 +| data.port | string | 网关端口|
  338 +| data.reportMode | short | 定时定距上报模式|
  339 +| data.interval | int | 定时上报时间间隔|
  340 +| data.distance | string | 定距上报距离间隔|
  341 +| data.speedingThreshold | short | 非线路状态超速阀门|
  342 +| data.alarmThreshold | short | 预警阀门|
  343 +| data.posIpAddress | string | pos机IP地址|
  344 +| data.posPort | string | pos机端口|
  345 +| data.delay | int | 延迟机关时间|
  346 +| data.deviceId | short | 中门视频切换到码表界面速度阀门 默认45|
  347 +| data.deviceId | short | 码表界面切换到中门视频速度阀门 默认35|
  348 +| data.deviceId | short | 对比度|
  349 +| data.deviceId | short | 亮度|
  350 +| data.deviceId | short | 饱和度|
  351 +
  352 +```json
  353 +{
  354 + "deviceId":12345,
  355 + "timestamp":44324,
  356 + "operCode":0xC0,
  357 + "data":{
  358 + "operCode":0xa4
  359 + }
  360 +}
  361 +```
  362 +| .. | .. | .. |
  363 +| ---- | ---- | ---- |
  364 +| deviceId | string | 设备编号 |
  365 +| timestamp | long | 时间戳(ms) |
  366 +| operCode | short | 一级协议 |
  367 +| data.operCode | short | 二级协议 |
  368 +
  369 +```json
  370 +{
  371 + "deviceId":12345,
  372 + "timestamp":44324,
  373 + "operCode":0xC0,
  374 + "data":{
  375 + "operCode":0xa5
  376 + "programVersion":2
  377 + }
  378 +}
  379 +```
  380 +| .. | .. | .. |
  381 +| ---- | ---- | ---- |
  382 +| deviceId | string | 设备编号 |
  383 +| timestamp | long | 时间戳(ms) |
  384 +| operCode | short | 一级协议 |
  385 +| data.operCode | short | 二级协议 |
  386 +| data.programVersion | short | 程序版本 |
  387 +
  388 +<span style="color: red">Response</span>:
  389 +```json
  390 +{
  391 + "errCode":0
  392 +}
  393 +```
  394 +
  395 +### 调度消息上传接口
  396 +----------
  397 +上行POST地址:[http://192.168.168.120:9088/control/upstream](http://192.168.168.120:9088/control/upstream)
  398 +<span style="color: red">Request</span>:
  399 +```json
  400 +{
  401 + "deviceId":12345,
  402 + "timestamp":44324,
  403 + "status":0,
  404 + "operCode":0x80,
  405 + "data":{
  406 + "operCode":0x26,
  407 + "requestCode":22
  408 + }
  409 +}
  410 +```
  411 +| .. | .. | .. |
  412 +| ---- | ---- | ---- |
  413 +| deviceId | string | 设备编号 |
  414 +| timestamp | long | 时间戳(ms) |
  415 +| status | int | 0x80时无数据 0表示失败 1表示成功或设备确认 2表示驾驶员阅读 |
  416 +| operCode | short | 一级协议 消息确认将无数据 |
  417 +| data.operCode | short | 二级协议 |
  418 +| data.requestCode | short | 请求代码0xa1 恢复运营 0xa2 申请调档 0xa3 出场请求 0xa5 进场请求 0xa7 加油请求 0x50 车辆故障 0x70 路阻报告 0x60 事故报告 0x11 扣证纠纷 0x12 报警 |
  419 +<span style="color: red">Response</span>:
  420 +```json
  421 +{
  422 + "errCode":0
  423 +}
  424 +```
  425 +
  426 +### 车辆历史GPS
  427 +----------
  428 +表名:BSTH_C_GPS_INFO
  429 +
  430 +| .. | .. | .. |
  431 +| ---- | ---- | ---- |
  432 +| cityCode | int | 城市代码 |
  433 +| industryCode | int | 行业代码 |
  434 +| companyCode | int | 企业代码 |
  435 +| lineId | int | 线路编号 |
  436 +| deviceId | string | 设备编号 |
  437 +| driverNo | int | 驾驶员工号 |
  438 +| carparkSerialNo | int | 停车场序列号 |
  439 +| carparkNo | string | 停车场编号 |
  440 +| stopSerialNo | int | 站点序列号 |
  441 +| stopNo | string | 停车场编号 |
  442 +| lon | float | 经度 |
  443 +| lat | float | 维度 |
  444 +| ts | long | 时间戳 |
  445 +| speedSensor | float | 发动机速度 |
  446 +| speedGps | float | gps速度 |
  447 +| direction | float | 角度0-359 |
  448 +| inTemp | int | 车内温度 |
  449 +| serviceState | long | 设备状态字 |
  450 +| daysYear | int | 对应年中的天数 为分区字段 查询一定要用此字段过滤 |
  451 +
doc/pom错误解决.txt 0 → 100644
  1 +1、jsonpath手动导入
  2 +pom定义如下:
  3 +<!-- https://mvnrepository.com/artifact/pentaho/simple-jndi -->
  4 +<dependency>
  5 + <groupId>pentaho</groupId>
  6 + <artifactId>simple-jndi</artifactId>
  7 + <version>1.0.0</version>
  8 +</dependency>
  9 +pom中repositoy添加如下:
  10 +<repository>
  11 + <id>pentaho-public</id>
  12 + <url>https://repo.orl.eng.hitachivantara.com/artifactory/pnt-mvn/</url>
  13 +</repository>
  14 +如果无法获取,可能由于被墙了,则手动导入,控制台输入命令如下:
  15 +mvn install:install-file -DgroupId=pentaho -DartifactId=simple-jndi -Dversion=1.0.0 -Dpackaging=jar -Dfile=./jar/simple-jndi-1.0.0.jar
1 -<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"  
2 - xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">  
3 -  
4 - <modelVersion>4.0.0</modelVersion>  
5 - <groupId>com.bsth</groupId>  
6 - <artifactId>bsth_control</artifactId>  
7 - <version>0.0.1-SNAPSHOT</version>  
8 - <packaging>war</packaging>  
9 -  
10 - <parent>  
11 - <groupId>org.springframework.boot</groupId>  
12 - <artifactId>spring-boot-starter-parent</artifactId>  
13 - <version>1.3.3.RELEASE</version>  
14 - </parent>  
15 -  
16 - <dependencies>  
17 - <dependency>  
18 - <groupId>org.springframework.boot</groupId>  
19 - <artifactId>spring-boot-starter-web</artifactId>  
20 - </dependency>  
21 -  
22 - <dependency>  
23 - <groupId>org.springframework.boot</groupId>  
24 - <artifactId>spring-boot-starter-tomcat</artifactId>  
25 - <scope>provided</scope>  
26 - </dependency>  
27 - <dependency>  
28 - <groupId>javax.servlet</groupId>  
29 - <artifactId>javax.servlet-api</artifactId>  
30 - <version>3.1.0</version>  
31 - <scope>provided</scope>  
32 - </dependency>  
33 - <dependency>  
34 - <groupId>org.springframework.boot</groupId>  
35 - <artifactId>spring-boot-starter-security</artifactId>  
36 - </dependency>  
37 - <!-- <dependency> <groupId>org.springframework.security</groupId> <artifactId>spring-security-config</artifactId>  
38 - </dependency> -->  
39 - <dependency>  
40 - <groupId>org.springframework.boot</groupId>  
41 - <artifactId>spring-boot-starter-data-jpa</artifactId>  
42 - </dependency>  
43 - <dependency>  
44 - <groupId>org.springframework.boot</groupId>  
45 - <artifactId>spring-boot-starter-aop</artifactId>  
46 - </dependency>  
47 -  
48 - <dependency>  
49 - <groupId>org.springframework</groupId>  
50 - <artifactId>spring-context-support</artifactId>  
51 - </dependency>  
52 - <dependency>  
53 - <groupId>org.springframework.boot</groupId>  
54 - <artifactId>spring-boot-starter-redis</artifactId>  
55 - </dependency>  
56 - <dependency>  
57 - <groupId>org.springframework.boot</groupId>  
58 - <artifactId>spring-boot-starter-websocket</artifactId>  
59 - </dependency>  
60 - <dependency>  
61 - <groupId>mysql</groupId>  
62 - <artifactId>mysql-connector-java</artifactId>  
63 - </dependency>  
64 -  
65 - <dependency>  
66 - <groupId>joda-time</groupId>  
67 - <artifactId>joda-time</artifactId>  
68 - </dependency>  
69 - <dependency>  
70 - <groupId>com.alibaba</groupId>  
71 - <artifactId>fastjson</artifactId>  
72 - <version>1.2.4</version>  
73 - </dependency>  
74 -  
75 - <dependency>  
76 - <groupId>org.apache.httpcomponents</groupId>  
77 - <artifactId>httpclient</artifactId>  
78 - </dependency>  
79 -  
80 - <dependency>  
81 - <groupId>commons-dbcp</groupId>  
82 - <artifactId>commons-dbcp</artifactId>  
83 - </dependency>  
84 - <dependency>  
85 - <groupId>commons-lang</groupId>  
86 - <artifactId>commons-lang</artifactId>  
87 - <version>2.6</version>  
88 - </dependency>  
89 - <dependency>  
90 - <groupId>org.apache.commons</groupId>  
91 - <artifactId>commons-lang3</artifactId>  
92 - <version>3.4</version>  
93 - </dependency>  
94 - <dependency>  
95 - <groupId>commons-fileupload</groupId>  
96 - <artifactId>commons-fileupload</artifactId>  
97 - <version>1.2.2</version>  
98 - </dependency>  
99 - <dependency>  
100 - <groupId>commons-io</groupId>  
101 - <artifactId>commons-io</artifactId>  
102 - <version>2.4</version>  
103 - </dependency>  
104 - <dependency>  
105 - <groupId>org.codehaus.janino</groupId>  
106 - <artifactId>janino</artifactId>  
107 - </dependency>  
108 -  
109 - <dependency>  
110 - <groupId>org.apache.poi</groupId>  
111 - <artifactId>poi-ooxml</artifactId>  
112 - <version>3.13</version>  
113 - </dependency>  
114 -  
115 - <dependency>  
116 - <groupId>com.google.guava</groupId>  
117 - <artifactId>guava</artifactId>  
118 - <version>19.0</version>  
119 - </dependency>  
120 - <!-- ftp文件上传包 -->  
121 - <dependency>  
122 - <groupId>commons-net</groupId>  
123 - <artifactId>commons-net</artifactId>  
124 - <version>3.5</version>  
125 - </dependency>  
126 - <dependency>  
127 - <groupId>org.apache.commons</groupId>  
128 - <artifactId>commons-compress</artifactId>  
129 - <version>1.3</version>  
130 - </dependency>  
131 - <!-- drools 6依赖 -->  
132 - <dependency>  
133 - <groupId>org.kie</groupId>  
134 - <artifactId>kie-api</artifactId>  
135 - </dependency>  
136 - <dependency>  
137 - <groupId>org.drools</groupId>  
138 - <artifactId>drools-compiler</artifactId>  
139 - </dependency>  
140 -  
141 - <!-- springboot测试 -->  
142 - <dependency>  
143 - <groupId>org.springframework.boot</groupId>  
144 - <artifactId>spring-boot-starter-test</artifactId>  
145 - <scope>test</scope>  
146 - </dependency>  
147 -  
148 - <dependency>  
149 - <groupId>c3p0</groupId>  
150 - <artifactId>c3p0</artifactId>  
151 - <version>0.9.1.2</version>  
152 - </dependency>  
153 -  
154 - <!-- 图表 -->  
155 - <dependency>  
156 - <groupId>com.google.code.gson</groupId>  
157 - <artifactId>gson</artifactId>  
158 - <version>2.2.4</version>  
159 - </dependency>  
160 - <dependency>  
161 - <groupId>com.github.abel533</groupId>  
162 - <artifactId>ECharts</artifactId>  
163 - <version>2.1.8</version>  
164 - </dependency>  
165 -  
166 - <dependency>  
167 - <groupId>org.apache.tika</groupId>  
168 - <artifactId>tika-core</artifactId>  
169 - <version>1.7</version>  
170 - </dependency>  
171 -  
172 - <!-- pentaho kettle 依赖 -->  
173 - <dependency>  
174 - <groupId>com.pentaho.kettle</groupId>  
175 - <artifactId>kettle-core</artifactId>  
176 - <version>6.0.1.0-386</version>  
177 - </dependency>  
178 - <dependency>  
179 - <groupId>com.pentaho.kettle</groupId>  
180 - <artifactId>kettle-engine</artifactId>  
181 - <version>6.0.1.0-386</version>  
182 - </dependency>  
183 - <dependency>  
184 - <groupId>com.pentaho.kettle</groupId>  
185 - <artifactId>metastore</artifactId>  
186 - <version>6.0.1.0-386</version>  
187 - </dependency>  
188 - <dependency>  
189 - <groupId>com.pentaho.kettle</groupId>  
190 - <artifactId>vfs2</artifactId>  
191 - <version>2.1-20150824</version>  
192 - </dependency>  
193 - <dependency>  
194 - <groupId>net.sourceforge.jexcelapi</groupId>  
195 - <artifactId>jxl</artifactId>  
196 - <version>2.6.12</version>  
197 - </dependency>  
198 - <dependency>  
199 - <groupId>rhino</groupId>  
200 - <artifactId>js</artifactId>  
201 - <version>1.7R2</version>  
202 - </dependency>  
203 - <dependency>  
204 - <groupId>javax.mail</groupId>  
205 - <artifactId>mail</artifactId>  
206 - <version>1.4.7</version>  
207 - </dependency>  
208 -  
209 - <dependency>  
210 - <groupId>com.github.axet</groupId>  
211 - <artifactId>kaptcha</artifactId>  
212 - <version>0.0.9</version>  
213 - </dependency>  
214 -  
215 - <dependency>  
216 - <groupId>commons-codec</groupId>  
217 - <artifactId>commons-codec</artifactId>  
218 - <version>1.4</version>  
219 - <scope>compile</scope>  
220 - </dependency>  
221 - <dependency>  
222 - <groupId>org.bouncycastle</groupId>  
223 - <artifactId>bcprov-jdk15on</artifactId>  
224 - <version>1.52</version>  
225 - </dependency>  
226 - <dependency>  
227 - <groupId>axis</groupId>  
228 - <artifactId>axis</artifactId>  
229 - <version>1.4</version>  
230 - </dependency>  
231 - <dependency>  
232 - <groupId>javax.xml</groupId>  
233 - <artifactId>jaxrpc-api</artifactId>  
234 - <version>1.1</version>  
235 - </dependency>  
236 -  
237 - <dependency>  
238 - <groupId>org.apache.axis2</groupId>  
239 - <artifactId>axis2-adb</artifactId>  
240 - <version>1.7.4</version>  
241 - </dependency>  
242 - <dependency>  
243 - <groupId>org.apache.axis2</groupId>  
244 - <artifactId>axis2-transport-local</artifactId>  
245 - <version>1.7.4</version>  
246 - </dependency>  
247 - <dependency>  
248 - <groupId>org.apache.axis2</groupId>  
249 - <artifactId>axis2-transport-http</artifactId>  
250 - <version>1.7.4</version>  
251 - </dependency>  
252 -  
253 - <dependency>  
254 - <groupId>org.dbunit</groupId>  
255 - <artifactId>dbunit</artifactId>  
256 - <version>2.4.9</version>  
257 - <scope>test</scope>  
258 -  
259 - <exclusions>  
260 - <exclusion>  
261 - <groupId>org.slf4j</groupId>  
262 - <artifactId>slf4j-api</artifactId>  
263 - </exclusion>  
264 - </exclusions>  
265 - </dependency>  
266 -  
267 - <dependency>  
268 - <groupId>com.h2database</groupId>  
269 - <artifactId>h2</artifactId>  
270 - <version>1.2.132</version>  
271 - <scope>test</scope>  
272 - </dependency>  
273 -  
274 -  
275 - <dependency>  
276 - <groupId>ojdbc</groupId>  
277 - <artifactId>ojdbc</artifactId>  
278 - <version>14</version>  
279 - </dependency>  
280 -  
281 - <dependency>  
282 - <groupId>org.apache.mina</groupId>  
283 - <artifactId>mina-core</artifactId>  
284 - <version>2.0.13</version>  
285 - </dependency>  
286 -  
287 - <dependency>  
288 - <groupId>com.google.protobuf</groupId>  
289 - <artifactId>protobuf-java</artifactId>  
290 - <version>3.3.0</version>  
291 - </dependency>  
292 -  
293 - <dependency>  
294 - <groupId>com.github.stuxuhai</groupId>  
295 - <artifactId>jpinyin</artifactId>  
296 - <version>1.1.8</version>  
297 - </dependency>  
298 - </dependencies>  
299 -  
300 - <dependencyManagement>  
301 - <dependencies>  
302 - <!-- drools 6依赖 -->  
303 - <dependency>  
304 - <groupId>org.drools</groupId>  
305 - <artifactId>drools-bom</artifactId>  
306 - <type>pom</type>  
307 - <version>6.3.0.Final</version>  
308 - <scope>import</scope>  
309 - </dependency>  
310 - </dependencies>  
311 - </dependencyManagement>  
312 -  
313 - <build>  
314 - <plugins>  
315 - <plugin>  
316 - <artifactId>maven-compiler-plugin</artifactId>  
317 - <version>2.3.2</version><!--$NO-MVN-MAN-VER$ -->  
318 - <configuration>  
319 - <source>1.7</source>  
320 - <target>1.7</target>  
321 - </configuration>  
322 - </plugin>  
323 - <plugin>  
324 - <artifactId>maven-war-plugin</artifactId>  
325 - <version>2.2</version><!--$NO-MVN-MAN-VER$ -->  
326 - <configuration>  
327 - <failOnMissingWebXml>false</failOnMissingWebXml>  
328 - </configuration>  
329 - </plugin>  
330 - <plugin>  
331 - <groupId>org.springframework.boot</groupId>  
332 - <artifactId>spring-boot-maven-plugin</artifactId>  
333 - </plugin>  
334 - </plugins>  
335 - <resources>  
336 - <resource>  
337 - <directory>src/main/resources</directory>  
338 - <filtering>false</filtering>  
339 - </resource>  
340 - </resources>  
341 - </build>  
342 - <repositories>  
343 - <repository>  
344 - <id>spring-snapshots</id>  
345 - <url>http://repo.spring.io/snapshot</url>  
346 - <snapshots>  
347 - <enabled>true</enabled>  
348 - </snapshots>  
349 - </repository>  
350 - <repository>  
351 - <id>spring-milestones</id>  
352 - <url>http://repo.spring.io/milestone</url>  
353 - </repository>  
354 - </repositories>  
355 - <pluginRepositories>  
356 - <pluginRepository>  
357 - <id>spring-snapshots</id>  
358 - <url>http://repo.spring.io/snapshot</url>  
359 - </pluginRepository>  
360 - <pluginRepository>  
361 - <id>spring-milestones</id>  
362 - <url>http://repo.spring.io/milestone</url>  
363 - </pluginRepository>  
364 - </pluginRepositories>  
365 -  
366 - <properties>  
367 - <start-class>com.bsth.Application</start-class>  
368 - </properties>  
369 -</project> 1 +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  2 + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  3 +
  4 + <modelVersion>4.0.0</modelVersion>
  5 + <groupId>com.bsth</groupId>
  6 + <artifactId>bsth_control</artifactId>
  7 + <version>0.0.1-SNAPSHOT</version>
  8 + <packaging>war</packaging>
  9 +
  10 + <parent>
  11 + <groupId>org.springframework.boot</groupId>
  12 + <artifactId>spring-boot-starter-parent</artifactId>
  13 + <version>1.3.3.RELEASE</version>
  14 + </parent>
  15 +
  16 + <dependencies>
  17 + <dependency>
  18 + <groupId>org.springframework.boot</groupId>
  19 + <artifactId>spring-boot-starter-web</artifactId>
  20 + </dependency>
  21 +
  22 + <dependency>
  23 + <groupId>org.springframework.boot</groupId>
  24 + <artifactId>spring-boot-starter-tomcat</artifactId>
  25 + <scope>provided</scope>
  26 + </dependency>
  27 + <dependency>
  28 + <groupId>javax.servlet</groupId>
  29 + <artifactId>javax.servlet-api</artifactId>
  30 + <version>3.1.0</version>
  31 + <scope>provided</scope>
  32 + </dependency>
  33 + <dependency>
  34 + <groupId>org.springframework.boot</groupId>
  35 + <artifactId>spring-boot-starter-security</artifactId>
  36 + </dependency>
  37 + <!-- <dependency> <groupId>org.springframework.security</groupId> <artifactId>spring-security-config</artifactId>
  38 + </dependency> -->
  39 + <dependency>
  40 + <groupId>org.springframework.boot</groupId>
  41 + <artifactId>spring-boot-starter-data-jpa</artifactId>
  42 + </dependency>
  43 + <dependency>
  44 + <groupId>org.springframework.boot</groupId>
  45 + <artifactId>spring-boot-starter-aop</artifactId>
  46 + </dependency>
  47 +
  48 + <dependency>
  49 + <groupId>org.springframework</groupId>
  50 + <artifactId>spring-context-support</artifactId>
  51 + </dependency>
  52 + <dependency>
  53 + <groupId>org.springframework.boot</groupId>
  54 + <artifactId>spring-boot-starter-redis</artifactId>
  55 + </dependency>
  56 + <dependency>
  57 + <groupId>org.springframework.boot</groupId>
  58 + <artifactId>spring-boot-starter-websocket</artifactId>
  59 + </dependency>
  60 + <dependency>
  61 + <groupId>mysql</groupId>
  62 + <artifactId>mysql-connector-java</artifactId>
  63 + </dependency>
  64 +
  65 + <dependency>
  66 + <groupId>joda-time</groupId>
  67 + <artifactId>joda-time</artifactId>
  68 + </dependency>
  69 + <dependency>
  70 + <groupId>com.alibaba</groupId>
  71 + <artifactId>fastjson</artifactId>
  72 + <version>1.2.4</version>
  73 + </dependency>
  74 +
  75 + <dependency>
  76 + <groupId>org.apache.httpcomponents</groupId>
  77 + <artifactId>httpclient</artifactId>
  78 + </dependency>
  79 +
  80 + <dependency>
  81 + <groupId>commons-dbcp</groupId>
  82 + <artifactId>commons-dbcp</artifactId>
  83 + </dependency>
  84 + <dependency>
  85 + <groupId>commons-lang</groupId>
  86 + <artifactId>commons-lang</artifactId>
  87 + <version>2.6</version>
  88 + </dependency>
  89 + <dependency>
  90 + <groupId>org.apache.commons</groupId>
  91 + <artifactId>commons-lang3</artifactId>
  92 + <version>3.4</version>
  93 + </dependency>
  94 + <dependency>
  95 + <groupId>commons-fileupload</groupId>
  96 + <artifactId>commons-fileupload</artifactId>
  97 + <version>1.2.2</version>
  98 + </dependency>
  99 + <dependency>
  100 + <groupId>commons-io</groupId>
  101 + <artifactId>commons-io</artifactId>
  102 + <version>2.4</version>
  103 + </dependency>
  104 + <dependency>
  105 + <groupId>org.codehaus.janino</groupId>
  106 + <artifactId>janino</artifactId>
  107 + </dependency>
  108 +
  109 + <dependency>
  110 + <groupId>org.apache.poi</groupId>
  111 + <artifactId>poi-ooxml</artifactId>
  112 + <version>3.13</version>
  113 + </dependency>
  114 +
  115 + <dependency>
  116 + <groupId>com.google.guava</groupId>
  117 + <artifactId>guava</artifactId>
  118 + <version>19.0</version>
  119 + </dependency>
  120 + <!-- ftp文件上传包 -->
  121 + <dependency>
  122 + <groupId>commons-net</groupId>
  123 + <artifactId>commons-net</artifactId>
  124 + <version>3.5</version>
  125 + </dependency>
  126 + <dependency>
  127 + <groupId>org.apache.commons</groupId>
  128 + <artifactId>commons-compress</artifactId>
  129 + <version>1.3</version>
  130 + </dependency>
  131 + <!-- drools 6依赖 -->
  132 + <dependency>
  133 + <groupId>org.kie</groupId>
  134 + <artifactId>kie-api</artifactId>
  135 + </dependency>
  136 + <dependency>
  137 + <groupId>org.drools</groupId>
  138 + <artifactId>drools-compiler</artifactId>
  139 + </dependency>
  140 +
  141 + <!-- springboot测试 -->
  142 + <dependency>
  143 + <groupId>org.springframework.boot</groupId>
  144 + <artifactId>spring-boot-starter-test</artifactId>
  145 + <scope>test</scope>
  146 + </dependency>
  147 +
  148 + <dependency>
  149 + <groupId>c3p0</groupId>
  150 + <artifactId>c3p0</artifactId>
  151 + <version>0.9.1.2</version>
  152 + </dependency>
  153 +
  154 + <!-- 图表 -->
  155 + <dependency>
  156 + <groupId>com.google.code.gson</groupId>
  157 + <artifactId>gson</artifactId>
  158 + <version>2.2.4</version>
  159 + </dependency>
  160 + <dependency>
  161 + <groupId>com.github.abel533</groupId>
  162 + <artifactId>ECharts</artifactId>
  163 + <version>2.1.8</version>
  164 + </dependency>
  165 +
  166 + <dependency>
  167 + <groupId>org.apache.tika</groupId>
  168 + <artifactId>tika-core</artifactId>
  169 + <version>1.7</version>
  170 + </dependency>
  171 +
  172 + <!-- pentaho kettle 依赖 -->
  173 + <dependency>
  174 + <groupId>com.pentaho.kettle</groupId>
  175 + <artifactId>kettle-core</artifactId>
  176 + <version>6.0.1.0-386</version>
  177 + </dependency>
  178 + <dependency>
  179 + <groupId>com.pentaho.kettle</groupId>
  180 + <artifactId>kettle-engine</artifactId>
  181 + <version>6.0.1.0-386</version>
  182 + </dependency>
  183 + <dependency>
  184 + <groupId>com.pentaho.kettle</groupId>
  185 + <artifactId>metastore</artifactId>
  186 + <version>6.0.1.0-386</version>
  187 + </dependency>
  188 + <dependency>
  189 + <groupId>com.pentaho.kettle</groupId>
  190 + <artifactId>vfs2</artifactId>
  191 + <version>2.1-20150824</version>
  192 + </dependency>
  193 + <dependency>
  194 + <groupId>net.sourceforge.jexcelapi</groupId>
  195 + <artifactId>jxl</artifactId>
  196 + <version>2.6.12</version>
  197 + </dependency>
  198 + <dependency>
  199 + <groupId>rhino</groupId>
  200 + <artifactId>js</artifactId>
  201 + <version>1.7R2</version>
  202 + </dependency>
  203 + <dependency>
  204 + <groupId>javax.mail</groupId>
  205 + <artifactId>mail</artifactId>
  206 + <version>1.4.7</version>
  207 + </dependency>
  208 +
  209 + <dependency>
  210 + <groupId>com.github.axet</groupId>
  211 + <artifactId>kaptcha</artifactId>
  212 + <version>0.0.9</version>
  213 + </dependency>
  214 +
  215 + <dependency>
  216 + <groupId>commons-codec</groupId>
  217 + <artifactId>commons-codec</artifactId>
  218 + <version>1.4</version>
  219 + <scope>compile</scope>
  220 + </dependency>
  221 + <dependency>
  222 + <groupId>org.bouncycastle</groupId>
  223 + <artifactId>bcprov-jdk15on</artifactId>
  224 + <version>1.52</version>
  225 + </dependency>
  226 + <dependency>
  227 + <groupId>axis</groupId>
  228 + <artifactId>axis</artifactId>
  229 + <version>1.4</version>
  230 + </dependency>
  231 + <dependency>
  232 + <groupId>javax.xml</groupId>
  233 + <artifactId>jaxrpc-api</artifactId>
  234 + <version>1.1</version>
  235 + </dependency>
  236 +
  237 + <dependency>
  238 + <groupId>org.apache.axis2</groupId>
  239 + <artifactId>axis2-adb</artifactId>
  240 + <version>1.7.4</version>
  241 + </dependency>
  242 + <dependency>
  243 + <groupId>org.apache.axis2</groupId>
  244 + <artifactId>axis2-transport-local</artifactId>
  245 + <version>1.7.4</version>
  246 + </dependency>
  247 + <dependency>
  248 + <groupId>org.apache.axis2</groupId>
  249 + <artifactId>axis2-transport-http</artifactId>
  250 + <version>1.7.4</version>
  251 + </dependency>
  252 +
  253 + <dependency>
  254 + <groupId>org.dbunit</groupId>
  255 + <artifactId>dbunit</artifactId>
  256 + <version>2.4.9</version>
  257 + <scope>test</scope>
  258 +
  259 + <exclusions>
  260 + <exclusion>
  261 + <groupId>org.slf4j</groupId>
  262 + <artifactId>slf4j-api</artifactId>
  263 + </exclusion>
  264 + </exclusions>
  265 + </dependency>
  266 +
  267 + <dependency>
  268 + <groupId>com.h2database</groupId>
  269 + <artifactId>h2</artifactId>
  270 + <version>1.2.132</version>
  271 + <scope>test</scope>
  272 + </dependency>
  273 +
  274 +
  275 + <dependency>
  276 + <groupId>ojdbc</groupId>
  277 + <artifactId>ojdbc</artifactId>
  278 + <version>14</version>
  279 + </dependency>
  280 +
  281 + <dependency>
  282 + <groupId>org.apache.mina</groupId>
  283 + <artifactId>mina-core</artifactId>
  284 + <version>2.0.13</version>
  285 + </dependency>
  286 +
  287 + <dependency>
  288 + <groupId>com.google.protobuf</groupId>
  289 + <artifactId>protobuf-java</artifactId>
  290 + <version>3.3.0</version>
  291 + </dependency>
  292 +
  293 + <dependency>
  294 + <groupId>com.github.stuxuhai</groupId>
  295 + <artifactId>jpinyin</artifactId>
  296 + <version>1.1.8</version>
  297 + </dependency>
  298 +
  299 + <!-- geotool -->
  300 + <dependency>
  301 + <groupId>org.locationtech.jts</groupId>
  302 + <artifactId>jts-core</artifactId>
  303 + <version>1.16.1</version>
  304 + </dependency>
  305 + </dependencies>
  306 +
  307 + <dependencyManagement>
  308 + <dependencies>
  309 + <!-- drools 6依赖 -->
  310 + <dependency>
  311 + <groupId>org.drools</groupId>
  312 + <artifactId>drools-bom</artifactId>
  313 + <type>pom</type>
  314 + <version>6.3.0.Final</version>
  315 + <scope>import</scope>
  316 + </dependency>
  317 + </dependencies>
  318 + </dependencyManagement>
  319 +
  320 + <build>
  321 + <plugins>
  322 + <plugin>
  323 + <artifactId>maven-compiler-plugin</artifactId>
  324 + <configuration>
  325 + <source>1.7</source>
  326 + <target>1.7</target>
  327 + </configuration>
  328 + </plugin>
  329 + <plugin>
  330 + <artifactId>maven-war-plugin</artifactId>
  331 + <configuration>
  332 + <failOnMissingWebXml>false</failOnMissingWebXml>
  333 + </configuration>
  334 + </plugin>
  335 + <plugin>
  336 + <groupId>org.springframework.boot</groupId>
  337 + <artifactId>spring-boot-maven-plugin</artifactId>
  338 + </plugin>
  339 + </plugins>
  340 + <resources>
  341 + <resource>
  342 + <directory>src/main/resources</directory>
  343 + <filtering>false</filtering>
  344 + </resource>
  345 + </resources>
  346 + </build>
  347 + <repositories>
  348 + <repository>
  349 + <id>spring-snapshots</id>
  350 + <url>http://repo.spring.io/snapshot</url>
  351 + <snapshots>
  352 + <enabled>true</enabled>
  353 + </snapshots>
  354 + </repository>
  355 + <repository>
  356 + <id>spring-milestones</id>
  357 + <url>http://repo.spring.io/milestone</url>
  358 + </repository>
  359 + </repositories>
  360 + <pluginRepositories>
  361 + <pluginRepository>
  362 + <id>spring-snapshots</id>
  363 + <url>http://repo.spring.io/snapshot</url>
  364 + </pluginRepository>
  365 + <pluginRepository>
  366 + <id>spring-milestones</id>
  367 + <url>http://repo.spring.io/milestone</url>
  368 + </pluginRepository>
  369 + </pluginRepositories>
  370 +
  371 + <properties>
  372 + <start-class>com.bsth.Application</start-class>
  373 + </properties>
  374 +</project>
src/main/java/com/bsth/controller/IndexController.java
1 -package com.bsth.controller;  
2 -  
3 -import java.io.BufferedInputStream;  
4 -import java.io.IOException;  
5 -import java.io.InputStream;  
6 -  
7 -import javax.servlet.http.HttpServletResponse;  
8 -  
9 -import org.apache.commons.lang3.StringUtils;  
10 -import org.slf4j.Logger;  
11 -import org.slf4j.LoggerFactory;  
12 -import org.springframework.web.bind.annotation.RequestMapping;  
13 -import org.springframework.web.bind.annotation.RestController;  
14 -  
15 -@RestController  
16 -@RequestMapping("/")  
17 -public class IndexController {  
18 -  
19 - Logger logger = LoggerFactory.getLogger(this.getClass());  
20 -  
21 - String indexSource;  
22 -  
23 - /**  
24 - * 构造函数  
25 - */  
26 - public IndexController() {  
27 - BufferedInputStream bis = null;  
28 -  
29 - try {  
30 - InputStream is = IndexController.class.getClassLoader().getResourceAsStream("static/index.html");  
31 - bis = new BufferedInputStream(is);  
32 - StringBuilder source = new StringBuilder();  
33 - byte[] buffer = new byte[bis.available()];  
34 -  
35 - while (bis.read(buffer) != -1) {  
36 - source.append(new String(buffer));  
37 - }  
38 -  
39 - indexSource = source.toString();  
40 - } catch (Exception e) {  
41 - logger.error("", e);  
42 - } finally {  
43 - try {  
44 - bis.close();  
45 - } catch (IOException e) {  
46 - logger.error("", e);  
47 - }  
48 - }  
49 - }  
50 -  
51 - /**  
52 - *  
53 - * @Title: index  
54 - * @Description: TODO(输出首页 index.html)  
55 - */  
56 - @RequestMapping  
57 - public void index(String initFragment, HttpServletResponse resp) {  
58 -  
59 - // 初始打开的片段地址  
60 - String outStr = StringUtils.replace(indexSource, "^_^initFragment^_^",  
61 - initFragment == null ? "" : initFragment);  
62 -  
63 - resp.setContentType("text/html;charset=UTF-8");  
64 - try {  
65 - resp.getOutputStream().write(outStr.getBytes());  
66 - } catch (IOException e) {  
67 - logger.error("", e);  
68 - }  
69 -  
70 - }  
71 -} 1 +package com.bsth.controller;
  2 +
  3 +import java.io.BufferedInputStream;
  4 +import java.io.IOException;
  5 +import java.io.InputStream;
  6 +
  7 +import javax.servlet.http.HttpServletResponse;
  8 +
  9 +import org.apache.commons.lang3.StringUtils;
  10 +import org.slf4j.Logger;
  11 +import org.slf4j.LoggerFactory;
  12 +import org.springframework.web.bind.annotation.RequestMapping;
  13 +import org.springframework.web.bind.annotation.RequestMethod;
  14 +import org.springframework.web.bind.annotation.RestController;
  15 +
  16 +@RestController
  17 +@RequestMapping("/")
  18 +public class IndexController {
  19 +
  20 + Logger logger = LoggerFactory.getLogger(this.getClass());
  21 +
  22 + String indexSource;
  23 +
  24 + /**
  25 + * 构造函数
  26 + */
  27 + public IndexController() {
  28 + load();
  29 + }
  30 +
  31 + /**
  32 + *
  33 + * @Title: index
  34 + * @Description: TODO(输出首页 index.html)
  35 + */
  36 + @RequestMapping
  37 + public void index(String initFragment, HttpServletResponse resp) {
  38 +
  39 + // 初始打开的片段地址
  40 + String outStr = StringUtils.replace(indexSource, "^_^initFragment^_^",
  41 + initFragment == null ? "" : initFragment);
  42 +
  43 + resp.setContentType("text/html;charset=UTF-8");
  44 + try {
  45 + resp.getOutputStream().write(outStr.getBytes());
  46 + } catch (IOException e) {
  47 + logger.error("", e);
  48 + }
  49 +
  50 + }
  51 +
  52 + @RequestMapping(value = "/index/load", method = RequestMethod.GET)
  53 + public void load() {
  54 + BufferedInputStream bis = null;
  55 +
  56 + try {
  57 + InputStream is = IndexController.class.getClassLoader().getResourceAsStream("static/index.html");
  58 + bis = new BufferedInputStream(is);
  59 + StringBuilder source = new StringBuilder();
  60 + byte[] buffer = new byte[bis.available()];
  61 +
  62 + while (bis.read(buffer) != -1) {
  63 + source.append(new String(buffer));
  64 + }
  65 +
  66 + indexSource = source.toString();
  67 + } catch (Exception e) {
  68 + logger.error("", e);
  69 + } finally {
  70 + try {
  71 + bis.close();
  72 + } catch (IOException e) {
  73 + logger.error("", e);
  74 + }
  75 + }
  76 + }
  77 +}
src/main/java/com/bsth/controller/LineController.java
1 -package com.bsth.controller;  
2 -  
3 -import com.bsth.common.ResponseCode;  
4 -import com.bsth.entity.Line;  
5 -import com.bsth.entity.LineVersions;  
6 -import com.bsth.service.LineService;  
7 -import com.bsth.service.LineVersionsService;  
8 -import com.bsth.util.GetUIDAndCode;  
9 -import org.springframework.beans.factory.annotation.Autowired;  
10 -import org.springframework.web.bind.annotation.RequestMapping;  
11 -import org.springframework.web.bind.annotation.RequestMethod;  
12 -import org.springframework.web.bind.annotation.RequestParam;  
13 -import org.springframework.web.bind.annotation.RestController;  
14 -  
15 -import java.text.ParseException;  
16 -import java.text.SimpleDateFormat;  
17 -import java.util.Date;  
18 -import java.util.HashMap;  
19 -import java.util.Map;  
20 -  
21 -/**  
22 - *  
23 - * @ClassName: LineController(线路控制器)  
24 - *  
25 - * @Extends : BaseController  
26 - *  
27 - * @Description: TODO(线路控制层)  
28 - *  
29 - * @Author bsth@lq  
30 - *  
31 - * @Date 2016年4月28日 上午9:21:17  
32 - *  
33 - * @Version 公交调度系统BS版 0.1  
34 - *  
35 - */  
36 -@RestController  
37 -@RequestMapping("line")  
38 -public class LineController extends BaseController<Line, Integer> {  
39 -  
40 - @Autowired  
41 - private LineService service;  
42 -  
43 - @Autowired  
44 - private LineVersionsService lineVersionsService;  
45 -  
46 - /**  
47 - * 获取线路编码与ID  
48 - *  
49 - * @return int <lineCode:线路编码>  
50 - */  
51 - @RequestMapping(value = "getLineCode", method = RequestMethod.GET)  
52 - public long getLineCode() {  
53 - return GetUIDAndCode.getLineId();  
54 - }  
55 -  
56 - /**  
57 - * 验证线路编码是否存在  
58 - *  
59 - * @return Map < {valid: true }:是否通过验证>  
60 - */  
61 - @RequestMapping(value = "lineCodeVerification", method = RequestMethod.GET)  
62 - public String lineCodeVerification(@RequestParam(defaultValue = "lineCode") String lineCode) {  
63 - return service.lineCodeVerification(lineCode);  
64 - }  
65 -  
66 - /**  
67 - *  
68 - * 保存  
69 - *  
70 - */  
71 - @RequestMapping(method = RequestMethod.POST)  
72 - public Map<String, Object> save(Line t){  
73 - Map<String, Object> map = new HashMap<>();  
74 - if(t.getId()==null) {  
75 -  
76 - t.setId(Integer.valueOf(t.getLineCode()));  
77 -  
78 - }  
79 - if( (t.getId().toString().length()) > 6 || service.lineCodeVerification(t.getLineCode()).equals("false") ) {  
80 -  
81 - map.put("status", ResponseCode.ERROR);  
82 - return map;  
83 - }  
84 - // 添加线路版本  
85 - SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");  
86 - try {  
87 - Date endDate = simpleDateFormat.parse("2088-08-08 00:00:00");  
88 - LineVersions lineVersions = new LineVersions();  
89 - lineVersions.setName("原始版本");  
90 - lineVersions.setLine(t);  
91 - lineVersions.setLineCode(t.getLineCode());  
92 - lineVersions.setStartDate(new java.sql.Date(new Date().getTime()));  
93 - lineVersions.setEndDate(new java.sql.Date(endDate.getTime()));// 2088-8-8 00:00:00  
94 - lineVersions.setVersions(1);  
95 - lineVersions.setStatus(1);  
96 - // 先添加线路再添加版本  
97 - service.save(t);  
98 - return lineVersionsService.save(lineVersions);  
99 - } catch (ParseException e) {  
100 - // TODO Auto-generated catch block  
101 - e.printStackTrace();  
102 - map.put("status", ResponseCode.ERROR);  
103 - return map;  
104 - }  
105 - }  
106 -  
107 - /**  
108 - * 更改  
109 - */  
110 - @RequestMapping(value="/update", method = RequestMethod.POST)  
111 - public Map<String, Object> update(Line l){  
112 - Map<String, Object> map = new HashMap<>();  
113 - if((l.getId().toString().length()) > 6 || service.lineCodeVerification(l.getLineCode()).equals("true") ) {  
114 -  
115 - map.put("status", ResponseCode.ERROR);  
116 - return map;  
117 - }  
118 - return service.update(l);  
119 - }  
120 -  
121 - @RequestMapping(value ="/findById" , method = RequestMethod.GET)  
122 - Line findByID(@RequestParam(defaultValue = "id") Integer id){  
123 - return service.findById(id);  
124 - }  
125 -  
126 - /**  
127 - * 删除线路  
128 - * @param id  
129 - * @return  
130 - */  
131 - @RequestMapping(value ="/remove" , method = RequestMethod.POST)  
132 - public Map<String, Object> remove(Integer id){  
133 - return service.remove(id);  
134 - }  
135 -} 1 +package com.bsth.controller;
  2 +
  3 +import com.bsth.common.ResponseCode;
  4 +import com.bsth.entity.Line;
  5 +import com.bsth.entity.LineVersions;
  6 +import com.bsth.service.LineService;
  7 +import com.bsth.service.LineVersionsService;
  8 +import com.bsth.util.GetUIDAndCode;
  9 +import org.springframework.beans.factory.annotation.Autowired;
  10 +import org.springframework.web.bind.annotation.RequestMapping;
  11 +import org.springframework.web.bind.annotation.RequestMethod;
  12 +import org.springframework.web.bind.annotation.RequestParam;
  13 +import org.springframework.web.bind.annotation.RestController;
  14 +
  15 +import java.text.ParseException;
  16 +import java.text.SimpleDateFormat;
  17 +import java.util.Date;
  18 +import java.util.HashMap;
  19 +import java.util.Map;
  20 +
  21 +/**
  22 + *
  23 + * @ClassName: LineController(线路控制器)
  24 + *
  25 + * @Extends : BaseController
  26 + *
  27 + * @Description: TODO(线路控制层)
  28 + *
  29 + * @Author bsth@lq
  30 + *
  31 + * @Date 2016年4月28日 上午9:21:17
  32 + *
  33 + * @Version 公交调度系统BS版 0.1
  34 + *
  35 + */
  36 +@RestController
  37 +@RequestMapping("line")
  38 +public class LineController extends BaseController<Line, Integer> {
  39 +
  40 + @Autowired
  41 + private LineService service;
  42 +
  43 + @Autowired
  44 + private LineVersionsService lineVersionsService;
  45 +
  46 + /**
  47 + * 获取线路编码与ID
  48 + *
  49 + * @return int <lineCode:线路编码>
  50 + */
  51 + @RequestMapping(value = "getLineCode", method = RequestMethod.GET)
  52 + public long getLineCode() {
  53 + return service.selectMaxIdToLineCode() + 1;
  54 + }
  55 +
  56 + /**
  57 + * 验证线路编码是否存在
  58 + *
  59 + * @return Map < {valid: true }:是否通过验证>
  60 + */
  61 + @RequestMapping(value = "lineCodeVerification", method = RequestMethod.GET)
  62 + public String lineCodeVerification(@RequestParam(defaultValue = "lineCode") String lineCode) {
  63 + return service.lineCodeVerification(lineCode);
  64 + }
  65 +
  66 + /**
  67 + *
  68 + * 保存
  69 + *
  70 + */
  71 + @RequestMapping(method = RequestMethod.POST)
  72 + public Map<String, Object> save(Line t){
  73 + Map<String, Object> map = new HashMap<>();
  74 + if(t.getId()==null) {
  75 +
  76 + t.setId(Integer.valueOf(t.getLineCode()));
  77 +
  78 + }
  79 + if( (t.getId().toString().length()) > 6 || service.lineCodeVerification(t.getLineCode()).equals("false") ) {
  80 +
  81 + map.put("status", ResponseCode.ERROR);
  82 + return map;
  83 + }
  84 + if(t.getDestroy() == 0){
  85 + t.setInUse(1);
  86 + } else
  87 + t.setInUse(0);
  88 + // 添加线路版本
  89 + SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
  90 + try {
  91 + Date endDate = simpleDateFormat.parse("2088-08-08 00:00:00");
  92 + LineVersions lineVersions = new LineVersions();
  93 + lineVersions.setName("原始版本");
  94 + lineVersions.setLine(t);
  95 + lineVersions.setLineCode(t.getLineCode());
  96 + lineVersions.setStartDate(new java.sql.Date(new Date().getTime()));
  97 + lineVersions.setEndDate(new java.sql.Date(endDate.getTime()));// 2088-8-8 00:00:00
  98 + lineVersions.setVersions(1);
  99 + lineVersions.setStatus(1);
  100 + // 先添加线路再添加版本
  101 + service.save(t);
  102 + return lineVersionsService.save(lineVersions);
  103 + } catch (ParseException e) {
  104 + // TODO Auto-generated catch block
  105 + e.printStackTrace();
  106 + map.put("status", ResponseCode.ERROR);
  107 + return map;
  108 + }
  109 + }
  110 +
  111 + /**
  112 + * 更改
  113 + */
  114 + @RequestMapping(value="/update", method = RequestMethod.POST)
  115 + public Map<String, Object> update(Line l){
  116 + Map<String, Object> map = new HashMap<>();
  117 + if((l.getId().toString().length()) > 6 || service.lineCodeVerification(l.getLineCode()).equals("true") ) {
  118 +
  119 + map.put("status", ResponseCode.ERROR);
  120 + return map;
  121 + }
  122 + return service.update(l);
  123 + }
  124 +
  125 + @RequestMapping(value ="/findById" , method = RequestMethod.GET)
  126 + Line findByID(@RequestParam(defaultValue = "id") Integer id){
  127 + return service.findById(id);
  128 + }
  129 +
  130 + /**
  131 + * 删除线路
  132 + * @param id
  133 + * @return
  134 + */
  135 + @RequestMapping(value ="/remove" , method = RequestMethod.POST)
  136 + public Map<String, Object> remove(Integer id){
  137 + return service.remove(id);
  138 + }
  139 +}
src/main/java/com/bsth/controller/LineVersionsController.java
1 -package com.bsth.controller;  
2 -  
3 -import java.util.List;  
4 -import java.util.Map;  
5 -  
6 -import org.springframework.beans.factory.annotation.Autowired;  
7 -import org.springframework.web.bind.annotation.RequestMapping;  
8 -import org.springframework.web.bind.annotation.RequestMethod;  
9 -import org.springframework.web.bind.annotation.RequestParam;  
10 -import org.springframework.web.bind.annotation.RestController;  
11 -  
12 -import com.bsth.entity.LineVersions;  
13 -import com.bsth.repository.LineRepository;  
14 -import com.bsth.service.LineVersionsService;  
15 -  
16 -/**  
17 - *  
18 - * @ClassName: LineController(线路版本控制器)  
19 - *  
20 - * @Extends : BaseController  
21 - *  
22 - * @Description: TODO(线路版本版控制层)  
23 - *  
24 - * @Author bsth@lq  
25 - *  
26 - * @Version 公交调度系统BS版 0.1  
27 - *  
28 - */  
29 -@RestController  
30 -@RequestMapping("lineVersions")  
31 -public class LineVersionsController extends BaseController<LineVersions, Integer> {  
32 -  
33 - @Autowired  
34 - private LineVersionsService service;  
35 -  
36 - @Autowired  
37 - LineRepository lineRepository;  
38 -  
39 - /**  
40 - * 获取线路所有版本  
41 - */  
42 - @RequestMapping(value = "findLineVersionsMax", method = RequestMethod.GET)  
43 - public LineVersions findLineVersionsMax(@RequestParam(defaultValue = "lineId") int lineId) {  
44 - return service.findLineVersionsMax(lineId);  
45 - }  
46 -  
47 - /**  
48 - * 获取线路所有版本  
49 - *  
50 - */  
51 - @RequestMapping(value = "findByLineId", method = RequestMethod.GET)  
52 - public List<LineVersions> getLineCode(@RequestParam(defaultValue = "lineId") int lineId) {  
53 - return service.findByLineCode(lineId);  
54 - }  
55 -  
56 - /**  
57 - * 根据id查询线路版本信息  
58 - *  
59 - */  
60 - @RequestMapping(value = "findById", method = RequestMethod.GET)  
61 - public LineVersions findOne(@RequestParam(defaultValue = "id") int id) {  
62 - return service.findById(id);  
63 - }  
64 -  
65 - /**  
66 - * 根据id修改线路版本信息  
67 - *  
68 - */  
69 - @RequestMapping(value = "update", method = RequestMethod.POST)  
70 - public Map<String, Object> update(@RequestParam Map<String, Object> map) {  
71 - return service.update(map);  
72 - }  
73 -  
74 - @RequestMapping(value = "add", method = RequestMethod.POST)  
75 - public Map<String, Object> add(@RequestParam Map<String, Object> map) {  
76 - return service.add(map);  
77 - }  
78 -  
79 - /**  
80 - * 根据线路id获取当前版本号  
81 - *  
82 - */  
83 - @RequestMapping(value = "findCurrentVersion", method = RequestMethod.GET)  
84 - public Integer findCurrentVersion(@RequestParam(defaultValue = "lineId") int lineId) {  
85 - return service.findCurrentVersion(lineId);  
86 - }  
87 -  
88 - /**  
89 - * 根据id发布版本号(修改isupdate字段)  
90 - */  
91 - @RequestMapping(value = "issueVersion", method = RequestMethod.POST)  
92 - public Map<String, Object> issueVersion(@RequestParam(defaultValue = "id") int id) {  
93 - return service.issueVersion(id);  
94 - }  
95 -  
96 -} 1 +package com.bsth.controller;
  2 +
  3 +import com.bsth.entity.LineVersions;
  4 +import com.bsth.entity.LsSectionRoute;
  5 +import com.bsth.entity.LsStationRoute;
  6 +import com.bsth.repository.LineRepository;
  7 +import com.bsth.repository.LsSectionRouteRepository;
  8 +import com.bsth.repository.LsStationRouteRepository;
  9 +import com.bsth.service.LineVersionsService;
  10 +import org.springframework.beans.factory.annotation.Autowired;
  11 +import org.springframework.web.bind.annotation.RequestMapping;
  12 +import org.springframework.web.bind.annotation.RequestMethod;
  13 +import org.springframework.web.bind.annotation.RequestParam;
  14 +import org.springframework.web.bind.annotation.RestController;
  15 +
  16 +import java.util.List;
  17 +import java.util.Map;
  18 +
  19 +/**
  20 + *
  21 + * @ClassName: LineController(线路版本控制器)
  22 + *
  23 + * @Extends : BaseController
  24 + *
  25 + * @Description: TODO(线路版本版控制层)
  26 + *
  27 + * @Author bsth@lq
  28 + *
  29 + * @Version 公交调度系统BS版 0.1
  30 + *
  31 + */
  32 +@RestController
  33 +@RequestMapping("lineVersions")
  34 +public class LineVersionsController extends BaseController<LineVersions, Integer> {
  35 +
  36 + @Autowired
  37 + private LineVersionsService service;
  38 +
  39 +
  40 + @Autowired
  41 + private LsStationRouteRepository lsStationRouteRepository;
  42 +
  43 + @Autowired
  44 + private LsSectionRouteRepository lsSectionRouteRepository;
  45 +
  46 + @Autowired
  47 + LineRepository lineRepository;
  48 +
  49 + /**
  50 + * 获取线路所有版本
  51 + */
  52 + @RequestMapping(value = "findLineVersionsMax", method = RequestMethod.GET)
  53 + public LineVersions findLineVersionsMax(@RequestParam(defaultValue = "lineId") int lineId) {
  54 + return service.findLineVersionsMax(lineId);
  55 + }
  56 +
  57 + @RequestMapping(value = "findAllHistroyLineVersionsById", method = RequestMethod.GET)
  58 + public List<LineVersions> findAllHistroyLineVersionsById(@RequestParam(defaultValue = "lineId") int lineId) {
  59 + return service.findAllHistroyLineVersionsById(lineId);
  60 + }
  61 +
  62 + /**
  63 + * 获取线路所有版本
  64 + *
  65 + */
  66 + @RequestMapping(value = "findByLineId", method = RequestMethod.GET)
  67 + public List<LineVersions> getLineCode(@RequestParam(defaultValue = "lineId") int lineId) {
  68 + return service.findByLineCode(lineId);
  69 + }
  70 +
  71 + /**
  72 + * 根据id查询线路版本信息
  73 + *
  74 + */
  75 + @RequestMapping(value = "findById", method = RequestMethod.GET)
  76 + public LineVersions findOne(@RequestParam(defaultValue = "id") int id) {
  77 + return service.findById(id);
  78 + }
  79 +
  80 + /**
  81 + * 根据id修改线路版本信息
  82 + *
  83 + */
  84 + @RequestMapping(value = "update", method = RequestMethod.POST)
  85 + public Map<String, Object> update(@RequestParam Map<String, Object> map) {
  86 + return service.update(map);
  87 + }
  88 +
  89 + @RequestMapping(value = "add", method = RequestMethod.POST)
  90 + public Map<String, Object> add(@RequestParam Map<String, Object> map) {
  91 + return service.add(map);
  92 + }
  93 +
  94 + @RequestMapping(value = "delete", method = RequestMethod.POST)
  95 + public Map<String, Object> delete(@RequestParam (defaultValue = "id") int id) {
  96 +
  97 + return service.deleteAllData(id);
  98 + }
  99 +
  100 + /**
  101 + * 根据线路id获取当前版本号
  102 + *
  103 + */
  104 + @RequestMapping(value = "findCurrentVersion", method = RequestMethod.GET)
  105 + public Integer findCurrentVersion(@RequestParam(defaultValue = "lineId") int lineId) {
  106 + return service.findCurrentVersion(lineId);
  107 + }
  108 +
  109 + /**
  110 + * 根据id发布版本号(修改isupdate字段)
  111 + */
  112 + @RequestMapping(value = "issueVersion", method = RequestMethod.POST)
  113 + public Map<String, Object> issueVersion(@RequestParam(defaultValue = "id") int id) {
  114 + return service.issueVersion(id);
  115 + }
  116 +
  117 +}
src/main/java/com/bsth/controller/SectionController.java
1 -package com.bsth.controller;  
2 -  
3 -import java.util.Map;  
4 -  
5 -import org.springframework.beans.factory.annotation.Autowired;  
6 -import org.springframework.web.bind.annotation.RequestMapping;  
7 -import org.springframework.web.bind.annotation.RequestMethod;  
8 -import org.springframework.web.bind.annotation.RequestParam;  
9 -import org.springframework.web.bind.annotation.RestController;  
10 -  
11 -import com.bsth.entity.Section;  
12 -import com.bsth.service.SectionService;  
13 -import com.bsth.util.GetUIDAndCode;  
14 -  
15 -/**  
16 - *  
17 - * @ClassName: SectionController(路段控制器)  
18 - *  
19 - * @Extends : BaseController  
20 - *  
21 - * @Description: TODO(路段控制层)  
22 - *  
23 - * @Author bsth@lq  
24 - *  
25 - * @Date 2016年05月03日 上午9:21:17  
26 - *  
27 - * @Version 公交调度系统BS版 0.1  
28 - *  
29 - */  
30 -  
31 -@RestController  
32 -@RequestMapping("section")  
33 -public class SectionController extends BaseController<Section, Integer> {  
34 -  
35 - @Autowired  
36 - SectionService service;  
37 -  
38 - /**  
39 - * 新增路段信息  
40 - *  
41 - * @param map:<bsectionVector:折线百度坐标集合;dbType:圆坐标类型;descriptions:描述与说明;destroy:是否撤销;directions:方向;lineId:线路ID  
42 - *  
43 - * lineCode :线路编码;roadCoding:道路编码;sectionCode:路段编码;sectionDistance:路段长度;sectionName:路段名称;sectionTime:路段时长;  
44 - *  
45 - * sectionrouteCode:路段序号;speedLimit:路段限速>  
46 - *  
47 - * @return map<SUCCESS:成功;ERROR:异常>  
48 - */  
49 - @RequestMapping(value="sectionSave" , method = RequestMethod.POST)  
50 - public Map<String, Object> sectionSave(@RequestParam Map<String, Object> map) {  
51 - map.put("createBy", "");  
52 - map.put("updateBy", "");  
53 - return service.sectionSave(map);  
54 - }  
55 -  
56 - /**  
57 - * @Description :TODO(编辑线路走向)  
58 - *  
59 - * @param map <sectionId:路段ID; sectionJSON:路段信息>  
60 - *  
61 - * @return Map<String, Object> <SUCCESS ; ERROR>  
62 - */  
63 - @RequestMapping(value="sectionCut" , method = RequestMethod.POST)  
64 - public Map<String, Object> sectionCut(@RequestParam Map<String, Object> map) {  
65 -  
66 - map.put("updateBy", "");  
67 -  
68 - map.put("createBy", "");  
69 -  
70 - map.put("createDate", "");  
71 -  
72 - return service.sectionCut(map);  
73 -  
74 - }  
75 -  
76 - /**  
77 - * @Description :TODO(编辑线路走向保存到线路历史表)  
78 - *  
79 - * @param map <sectionId:路段ID; sectionJSON:路段信息>  
80 - *  
81 - * @return Map<String, Object> <SUCCESS ; ERROR>  
82 - */  
83 - @RequestMapping(value="sectionCutSaveLineLS" , method = RequestMethod.POST)  
84 - public Map<String, Object> sectionCutSaveLineLS(@RequestParam Map<String, Object> map) {  
85 -  
86 - map.put("updateBy", "");  
87 -  
88 - map.put("createBy", "");  
89 -  
90 - return service.sectionCutSaveLineLS(map);  
91 -  
92 - }  
93 -  
94 - /**  
95 - * @Description :TODO(编辑线路走向)  
96 - *  
97 - * @param map <sectionId:路段ID; sectionJSON:路段信息>  
98 - *  
99 - * @return Map<String, Object> <SUCCESS ; ERROR>  
100 - */  
101 - @RequestMapping(value="sectionUpdate" , method = RequestMethod.POST)  
102 - public Map<String, Object> sectionUpdate(@RequestParam Map<String, Object> map) {  
103 -  
104 - map.put("updateBy", "");  
105 -  
106 - map.put("createBy", "");  
107 -  
108 - map.put("createDate", "");  
109 -  
110 - return service.sectionUpdate(map);  
111 -  
112 - }  
113 -  
114 - /**  
115 - * @Description :TODO(编辑缓存线路走向)  
116 - */  
117 - @RequestMapping(value="sectionCacheUpdate" , method = RequestMethod.POST)  
118 - public Map<String, Object> sectionCacheUpdate(@RequestParam Map<String, Object> map) {  
119 -  
120 - map.put("updateBy", "");  
121 -  
122 - map.put("createBy", "");  
123 -  
124 - map.put("createDate", "");  
125 -  
126 - return service.sectionCacheUpdate(map);  
127 -  
128 - }  
129 -  
130 - /**  
131 - * @Description :TODO(查询路段编码)  
132 - *  
133 - * @return int <sectionCode路段编码>  
134 - */  
135 - @RequestMapping(value="getSectionCode" , method = RequestMethod.GET)  
136 - public long getSectionCode() {  
137 - return GetUIDAndCode.getSectionId();  
138 - }  
139 -  
140 - /**  
141 - * @Description :TODO(把路段截取位双路名路段)  
142 - *  
143 - * @return int <sectionCode路段编码>  
144 - */  
145 - @RequestMapping(value="doubleName" , method = RequestMethod.POST)  
146 - public Map<String, Object> doubleName(@RequestParam Map<String, Object> map) {  
147 - return service.doubleName(map);  
148 - }  
149 -  
150 -} 1 +package com.bsth.controller;
  2 +
  3 +import java.util.Map;
  4 +
  5 +import org.springframework.beans.factory.annotation.Autowired;
  6 +import org.springframework.web.bind.annotation.RequestMapping;
  7 +import org.springframework.web.bind.annotation.RequestMethod;
  8 +import org.springframework.web.bind.annotation.RequestParam;
  9 +import org.springframework.web.bind.annotation.RestController;
  10 +
  11 +import com.bsth.entity.Section;
  12 +import com.bsth.repository.SectionRepository;
  13 +import com.bsth.service.SectionService;
  14 +import com.bsth.util.GetUIDAndCode;
  15 +
  16 +/**
  17 + *
  18 + * @ClassName: SectionController(路段控制器)
  19 + *
  20 + * @Extends : BaseController
  21 + *
  22 + * @Description: TODO(路段控制层)
  23 + *
  24 + * @Author bsth@lq
  25 + *
  26 + * @Date 2016年05月03日 上午9:21:17
  27 + *
  28 + * @Version 公交调度系统BS版 0.1
  29 + *
  30 + */
  31 +
  32 +@RestController
  33 +@RequestMapping("section")
  34 +public class SectionController extends BaseController<Section, Integer> {
  35 +
  36 + @Autowired
  37 + SectionService service;
  38 +
  39 + @Autowired
  40 + SectionRepository sectionRepository;
  41 +
  42 + /**
  43 + * 新增路段信息
  44 + *
  45 + * @param map:<bsectionVector:折线百度坐标集合;dbType:圆坐标类型;descriptions:描述与说明;destroy:是否撤销;directions:方向;lineId:线路ID
  46 + *
  47 + * lineCode :线路编码;roadCoding:道路编码;sectionCode:路段编码;sectionDistance:路段长度;sectionName:路段名称;sectionTime:路段时长;
  48 + *
  49 + * sectionrouteCode:路段序号;speedLimit:路段限速>
  50 + *
  51 + * @return map<SUCCESS:成功;ERROR:异常>
  52 + */
  53 + @RequestMapping(value="sectionSave" , method = RequestMethod.POST)
  54 + public Map<String, Object> sectionSave(@RequestParam Map<String, Object> map) {
  55 + map.put("createBy", "");
  56 + map.put("updateBy", "");
  57 + return service.sectionSave(map);
  58 + }
  59 +
  60 + /**
  61 + * @Description :TODO(编辑线路走向)
  62 + *
  63 + * @param map <sectionId:路段ID; sectionJSON:路段信息>
  64 + *
  65 + * @return Map<String, Object> <SUCCESS ; ERROR>
  66 + */
  67 + @RequestMapping(value="sectionCut" , method = RequestMethod.POST)
  68 + public Map<String, Object> sectionCut(@RequestParam Map<String, Object> map) {
  69 +
  70 + map.put("updateBy", "");
  71 +
  72 + map.put("createBy", "");
  73 +
  74 + map.put("createDate", "");
  75 +
  76 + return service.sectionCut(map);
  77 +
  78 + }
  79 +
  80 + /**
  81 + * @Description :TODO(编辑线路走向保存到线路历史表)
  82 + *
  83 + * @param map <sectionId:路段ID; sectionJSON:路段信息>
  84 + *
  85 + * @return Map<String, Object> <SUCCESS ; ERROR>
  86 + */
  87 + @RequestMapping(value="sectionCutSaveLineLS" , method = RequestMethod.POST)
  88 + public Map<String, Object> sectionCutSaveLineLS(@RequestParam Map<String, Object> map) {
  89 +
  90 + map.put("updateBy", "");
  91 +
  92 + map.put("createBy", "");
  93 +
  94 + return service.sectionCutSaveLineLS(map);
  95 +
  96 + }
  97 +
  98 + /**
  99 + * @Description :TODO(编辑线路走向)
  100 + *
  101 + * @param map <sectionId:路段ID; sectionJSON:路段信息>
  102 + *
  103 + * @return Map<String, Object> <SUCCESS ; ERROR>
  104 + */
  105 + @RequestMapping(value="sectionUpdate" , method = RequestMethod.POST)
  106 + public Map<String, Object> sectionUpdate(@RequestParam Map<String, Object> map) {
  107 +
  108 + map.put("updateBy", "");
  109 +
  110 + map.put("createBy", "");
  111 +
  112 + map.put("createDate", "");
  113 +
  114 + return service.sectionUpdate(map);
  115 +
  116 + }
  117 +
  118 + /**
  119 + * @Description :TODO(编辑缓存线路走向)
  120 + */
  121 + @RequestMapping(value="sectionCacheUpdate" , method = RequestMethod.POST)
  122 + public Map<String, Object> sectionCacheUpdate(@RequestParam Map<String, Object> map) {
  123 +
  124 + map.put("updateBy", "");
  125 +
  126 + map.put("createBy", "");
  127 +
  128 + map.put("createDate", "");
  129 +
  130 + return service.sectionCacheUpdate(map);
  131 +
  132 + }
  133 +
  134 + /**
  135 + * @Description :TODO(查询路段编码)
  136 + *
  137 + * @return int <sectionCode路段编码>
  138 + */
  139 + @RequestMapping(value="getSectionCode" , method = RequestMethod.GET)
  140 + public long getSectionCode() {
  141 + return sectionRepository.sectionMaxId() + 1;
  142 + }
  143 +
  144 + /**
  145 + * @Description :TODO(把路段截取位双路名路段)
  146 + *
  147 + * @return int <sectionCode路段编码>
  148 + */
  149 + @RequestMapping(value="doubleName" , method = RequestMethod.POST)
  150 + public Map<String, Object> doubleName(@RequestParam Map<String, Object> map) {
  151 + return service.doubleName(map);
  152 + }
  153 +
  154 +}
src/main/java/com/bsth/controller/SectionRouteController.java
1 -package com.bsth.controller;  
2 -  
3 -import java.util.List;  
4 -import java.util.Map;  
5 -  
6 -import org.springframework.beans.factory.annotation.Autowired;  
7 -import org.springframework.web.bind.annotation.RequestMapping;  
8 -import org.springframework.web.bind.annotation.RequestMethod;  
9 -import org.springframework.web.bind.annotation.RequestParam;  
10 -import org.springframework.web.bind.annotation.RestController;  
11 -  
12 -import com.bsth.entity.SectionRoute;  
13 -import com.bsth.entity.StationRouteCache;  
14 -import com.bsth.service.SectionRouteService;  
15 -  
16 -/**  
17 - *  
18 - * @ClassName: SectionRouteController(路段路由控制器)  
19 - *  
20 - * @Extends : BaseController  
21 - *  
22 - * @Description: TODO(路段路由控制层)  
23 - *  
24 - * @Author bsth@lq  
25 - *  
26 - * @Date 2016年05月03日 上午9:21:17  
27 - *  
28 - * @Version 公交调度系统BS版 0.1  
29 - *  
30 - */  
31 -  
32 -@RestController  
33 -@RequestMapping("sectionroute")  
34 -public class SectionRouteController extends BaseController<SectionRoute, Integer> {  
35 -  
36 - @Autowired  
37 - SectionRouteService routeService;  
38 -  
39 - /**  
40 - * @param map  
41 - * @throws  
42 - * @Description: TODO(批量撤销路段)  
43 - */  
44 - @RequestMapping(value = "/batchDestroy", method = RequestMethod.POST)  
45 - public Map<String, Object> updateBatch(@RequestParam Map<String, Object> map) {  
46 - return routeService.updateSectionRouteInfoFormId(map);  
47 - }  
48 - /**  
49 - * @param id //路段路由id  
50 - * @Description: TODO(撤销路段)  
51 - */  
52 - @RequestMapping(value = "/destroy", method = RequestMethod.POST)  
53 - public Map<String, Object> destroy(@RequestParam Integer id) {  
54 - return routeService.destroy(id);  
55 - }  
56 -  
57 - /**  
58 - * @param @param map  
59 - * @throws  
60 - * @Title: list  
61 - * @Description: TODO(多条件查询)  
62 - */  
63 - @RequestMapping(value = "/all", method = RequestMethod.GET)  
64 - public Iterable<SectionRoute> list(@RequestParam Map<String, Object> map) {  
65 - return routeService.list(map);  
66 - }  
67 -  
68 - @RequestMapping(value = "/cacheList", method = RequestMethod.GET)  
69 - public List<StationRouteCache> cacheList(@RequestParam Map<String, Object> map) {  
70 -// routeService.cacheList(map)  
71 - return null;  
72 - }  
73 -  
74 - /**  
75 - * @Description :TODO(查询路段信息)  
76 - *  
77 - * @param map <line.id_eq:线路ID; directions_eq:方向>  
78 - *  
79 - * @return Map<String, Object>  
80 - */  
81 - @RequestMapping(value = "/findSection" , method = RequestMethod.GET)  
82 - public List<Map<String, Object>> findPoints(@RequestParam Map<String, Object> map) {  
83 - return routeService.getSectionRoute(map);  
84 - }  
85 -  
86 -  
87 - /**  
88 - * @Description :TODO(查询路段信息)  
89 - *  
90 - * @param map <line.id_eq:线路ID; directions_eq:方向>  
91 - *  
92 - * @return Map<String, Object>  
93 - */  
94 - @RequestMapping(value = "/findCacheSection" , method = RequestMethod.GET)  
95 - public List<Map<String, Object>> getSectionRouteCache(@RequestParam Map<String, Object> map) {  
96 - return routeService.getSectionRouteCache(map);  
97 - }  
98 -  
99 - /**  
100 - * @Description : TODO(根据路段路由Id查询详情)  
101 - *  
102 - * @param map <id:路段路由ID>  
103 - *  
104 - * @return List<Map<String, Object>>  
105 - */  
106 - @RequestMapping(value = "/findSectionRouteInfoFormId",method = RequestMethod.GET)  
107 - public List<Map<String, Object>> findSectionRouteInfoFormId(@RequestParam Map<String, Object> map) {  
108 - return routeService.findSectionRouteInfoFormId(map);  
109 - }  
110 -  
111 - /**  
112 - * @Description :TODO(查询线路某方向下的上一个路段序号)  
113 - *  
114 - * @param map <lineId:线路ID; direction:方向;sectionRouteCode:路段编码>  
115 - *  
116 - * @return List<Map<String, Object>>  
117 - */  
118 - @RequestMapping(value = "/findUpSectionRouteCode" , method = RequestMethod.GET)  
119 - public List<Map<String, Object>> findUpStationRouteCode(@RequestParam Map<String, Object> map) {  
120 - return routeService.findUpSectionRouteCode(map);  
121 - }  
122 -  
123 - @RequestMapping(value = "/findCacheUpSectionRouteCode" , method = RequestMethod.GET)  
124 - public List<Map<String, Object>> findCacheUpSectionRouteCode(@RequestParam Map<String, Object> map) {  
125 - return routeService.findCacheUpSectionRouteCode(map);  
126 - }  
127 -  
128 - /**  
129 - * @Description :TODO(引用路段)  
130 - *  
131 - * @return List<Map<String, Object>>  
132 - */  
133 - @RequestMapping(value = "/quoteSection" , method = RequestMethod.POST)  
134 - public Map<String, Object> quoteSection(@RequestParam Map<String, Object> map) {  
135 - return routeService.quoteSection(map);  
136 - }  
137 -} 1 +package com.bsth.controller;
  2 +
  3 +import java.util.List;
  4 +import java.util.Map;
  5 +
  6 +import org.springframework.beans.factory.annotation.Autowired;
  7 +import org.springframework.web.bind.annotation.RequestMapping;
  8 +import org.springframework.web.bind.annotation.RequestMethod;
  9 +import org.springframework.web.bind.annotation.RequestParam;
  10 +import org.springframework.web.bind.annotation.RestController;
  11 +
  12 +import com.bsth.entity.SectionRoute;
  13 +import com.bsth.entity.StationRouteCache;
  14 +import com.bsth.service.SectionRouteService;
  15 +
  16 +/**
  17 + *
  18 + * @ClassName: SectionRouteController(路段路由控制器)
  19 + *
  20 + * @Extends : BaseController
  21 + *
  22 + * @Description: TODO(路段路由控制层)
  23 + *
  24 + * @Author bsth@lq
  25 + *
  26 + * @Date 2016年05月03日 上午9:21:17
  27 + *
  28 + * @Version 公交调度系统BS版 0.1
  29 + *
  30 + */
  31 +
  32 +@RestController
  33 +@RequestMapping("sectionroute")
  34 +public class SectionRouteController extends BaseController<SectionRoute, Integer> {
  35 +
  36 + @Autowired
  37 + SectionRouteService routeService;
  38 +
  39 + @RequestMapping(value = "/allls", method = RequestMethod.GET)
  40 + public Map allls(@RequestParam Map<String, Object> map) {
  41 +
  42 + return routeService.pageLs(map);
  43 + }
  44 +
  45 +
  46 + /**
  47 + * @param map
  48 + * @throws
  49 + * @Description: TODO(批量撤销路段)
  50 + */
  51 + @RequestMapping(value = "/batchDestroy", method = RequestMethod.POST)
  52 + public Map<String, Object> updateBatch(@RequestParam Map<String, Object> map) {
  53 + return routeService.updateSectionRouteInfoFormId(map);
  54 + }
  55 + /**
  56 + * @param id //路段路由id
  57 + * @Description: TODO(撤销路段)
  58 + */
  59 + @RequestMapping(value = "/destroy", method = RequestMethod.POST)
  60 + public Map<String, Object> destroy(@RequestParam Map<String, Object> map) {
  61 +
  62 + int id = Integer.parseInt(map.get("id").toString());
  63 +
  64 + if(map.get("status") == null || Integer.parseInt(map.get("status").toString()) == 1) {
  65 + return routeService.destroy(id);
  66 + }else if(Integer.parseInt(map.get("status").toString()) == 2){
  67 + return routeService.destroyHistory(id);
  68 + }else {
  69 + return map;
  70 + }
  71 + }
  72 +
  73 + /**
  74 + * @param @param map
  75 + * @throws
  76 + * @Title: list
  77 + * @Description: TODO(多条件查询)
  78 + */
  79 + @RequestMapping(value = "/all", method = RequestMethod.GET)
  80 + public Iterable<SectionRoute> list(@RequestParam Map<String, Object> map) {
  81 + return routeService.list(map);
  82 + }
  83 +
  84 + @RequestMapping(value = "/cacheList", method = RequestMethod.GET)
  85 + public List<StationRouteCache> cacheList(@RequestParam Map<String, Object> map) {
  86 +// routeService.cacheList(map)
  87 + return null;
  88 + }
  89 +
  90 + /**
  91 + * @Description :TODO(查询路段信息)
  92 + *
  93 + * @param map <line.id_eq:线路ID; directions_eq:方向>
  94 + *
  95 + * @return Map<String, Object>
  96 + */
  97 + @RequestMapping(value = "/findSection" , method = RequestMethod.GET)
  98 + public List<Map<String, Object>> findPoints(@RequestParam Map<String, Object> map) {
  99 + return routeService.getSectionRoute(map);
  100 + }
  101 +
  102 +
  103 + /**
  104 + * @Description :TODO(查询路段信息)
  105 + *
  106 + * @param map <line.id_eq:线路ID; directions_eq:方向>
  107 + *
  108 + * @return Map<String, Object>
  109 + */
  110 + @RequestMapping(value = "/findCacheSection" , method = RequestMethod.GET)
  111 + public List<Map<String, Object>> getSectionRouteCache(@RequestParam Map<String, Object> map) {
  112 + return routeService.getSectionRouteCache(map);
  113 + }
  114 +
  115 + /**
  116 + * @Description : TODO(根据路段路由Id查询详情)
  117 + *
  118 + * @param map <id:路段路由ID>
  119 + *
  120 + * @return List<Map<String, Object>>
  121 + */
  122 + @RequestMapping(value = "/findSectionRouteInfoFormId",method = RequestMethod.GET)
  123 + public List<Map<String, Object>> findSectionRouteInfoFormId(@RequestParam Map<String, Object> map) {
  124 + return routeService.findSectionRouteInfoFormId(map);
  125 + }
  126 +
  127 + /**
  128 + * @Description :TODO(查询线路某方向下的上一个路段序号)
  129 + *
  130 + * @param map <lineId:线路ID; direction:方向;sectionRouteCode:路段编码>
  131 + *
  132 + * @return List<Map<String, Object>>
  133 + */
  134 + @RequestMapping(value = "/findUpSectionRouteCode" , method = RequestMethod.GET)
  135 + public List<Map<String, Object>> findUpStationRouteCode(@RequestParam Map<String, Object> map) {
  136 + return routeService.findUpSectionRouteCode(map);
  137 + }
  138 +
  139 + @RequestMapping(value = "/findCacheUpSectionRouteCode" , method = RequestMethod.GET)
  140 + public List<Map<String, Object>> findCacheUpSectionRouteCode(@RequestParam Map<String, Object> map) {
  141 + return routeService.findCacheUpSectionRouteCode(map);
  142 + }
  143 +
  144 + /**
  145 + * @Description :TODO(引用路段)
  146 + *
  147 + * @return List<Map<String, Object>>
  148 + */
  149 + @RequestMapping(value = "/quoteSection" , method = RequestMethod.POST)
  150 + public Map<String, Object> quoteSection(@RequestParam Map<String, Object> map) {
  151 + return routeService.quoteSection(map);
  152 + }
  153 +}
src/main/java/com/bsth/controller/StationController.java
1 -package com.bsth.controller;  
2 -  
3 -import com.bsth.entity.Station;  
4 -import com.bsth.service.StationService;  
5 -import com.bsth.util.GetUIDAndCode;  
6 -import org.slf4j.Logger;  
7 -import org.slf4j.LoggerFactory;  
8 -import org.springframework.beans.factory.annotation.Autowired;  
9 -import org.springframework.web.bind.annotation.RequestMapping;  
10 -import org.springframework.web.bind.annotation.RequestMethod;  
11 -import org.springframework.web.bind.annotation.RequestParam;  
12 -import org.springframework.web.bind.annotation.RestController;  
13 -  
14 -import java.util.Map;  
15 -  
16 -/**  
17 - *  
18 - * @ClassName: StationController(站点控制器)  
19 - *  
20 - * @Extends : BaseController  
21 - *  
22 - * @Description: TODO(站点控制层)  
23 - *  
24 - * @Author bsth@lq  
25 - *  
26 - * @Date 2016年05月03日 上午9:21:17  
27 - *  
28 - * @Version 公交调度系统BS版 0.1  
29 - *  
30 - */  
31 -  
32 -@RestController  
33 -@RequestMapping("station")  
34 -public class StationController extends BaseController<Station, Integer> {  
35 -  
36 - @Autowired  
37 - private StationService service;  
38 -  
39 - /** 日志记录器 */  
40 - private static final Logger LOGGER = LoggerFactory.getLogger(StationController.class);  
41 -  
42 - /**  
43 - * @Description :TODO(根据坐标点匹配数据库中的站点)  
44 - *  
45 - * @param map: <point:坐标点; name:站点名>  
46 - *  
47 - */  
48 - @RequestMapping(value="matchStation" , method = RequestMethod.GET)  
49 - public Map<String, Object> matchStation(@RequestParam Map<String, Object> map) {  
50 - return service.matchStation(map);  
51 - }  
52 -  
53 - /**  
54 - * @Description :TODO(系统规划保存数据)  
55 - *  
56 - * @param map <stationJSON:站点信息;  
57 - *  
58 - * - - - - - - sectionJSON:路段信息;  
59 - *  
60 - * - - - - - - dbType:坐标类型;  
61 - *  
62 - * - - - - - - destroy:是否撤销;  
63 - *  
64 - * - - - - - - directions:方向;  
65 - *  
66 - * - - - - - - lineId:线路ID;  
67 - *  
68 - * - - - - - - radius:圆半径  
69 - *  
70 - * - - - - - - shapesType:图形类型  
71 - *  
72 - * - - - - - - speedLimit:限速>  
73 - *  
74 - * @return Map<String, Object> <SUCCESS ; ERROR>  
75 - */  
76 - @RequestMapping(value="collectionSave" , method = RequestMethod.POST)  
77 - public Map<String, Object> collectionSave(@RequestParam Map<String, Object> map) {  
78 - return service.systemSaveStations(map);  
79 - }  
80 -  
81 - @RequestMapping(value="manualSave" , method = RequestMethod.POST)  
82 - public Map<String, Object> manualSave(@RequestParam Map<String, Object> map) {  
83 - return service.manualSave(map);  
84 - }  
85 -  
86 - @RequestMapping(value="cacheSave" , method = RequestMethod.POST)  
87 - public Map<String, Object> cacheSave(@RequestParam Map<String, Object> map) {  
88 - return service.cacheSave(map);  
89 - }  
90 -  
91 - /**  
92 - * @Description :TODO(新增站点保存)  
93 - *  
94 - * @param map <bJwpoints:中心点百度坐标;bPolygonGrid:多边形图形百度坐标;dbType:原坐标类型;  
95 - *  
96 - * descriptions:说明;destroy:是否撤销;directions:方向;distances:到站距离;gJwpoints:中心点WGS坐标;  
97 - *  
98 - * gPolygonGrid:多边形图形WGS坐标;lineId:线路ID;radius:圆半径;roadCoding:道路编码;shapesType:图形类型;  
99 - *  
100 - * stationCod:站点编码;stationMark:站点类型;stationName:站点名称;stationRouteCode:站点序号;toTime:到站时间  
101 - *  
102 - * versions:版本号;x:城建坐标x;y:城建坐标y>  
103 - *  
104 - * @return Map<String, Object> <SUCCESS ; ERROR>  
105 - */  
106 - @RequestMapping(value="stationSave" , method = RequestMethod.POST)  
107 - public Map<String, Object> stationSave(@RequestParam Map<String, Object> map) {  
108 - map.put("createBy", "");  
109 - map.put("updateBy", "");  
110 - return service.stationSaveMap(map);  
111 - }  
112 -  
113 - /**  
114 - * @Description :TODO(更新站点保存)  
115 - *  
116 - * @param map <bJwpoints:中心点百度坐标;bPolygonGrid:多边形图形百度坐标;dbType:原坐标类型;  
117 - *  
118 - * descriptions:说明;destroy:是否撤销;directions:方向;distances:到站距离;gJwpoints:中心点WGS坐标;  
119 - *  
120 - * gPolygonGrid:多边形图形WGS坐标;lineId:线路ID;radius:圆半径;roadCoding:道路编码;shapesType:图形类型;  
121 - *  
122 - * stationCod:站点编码;stationMark:站点类型;stationName:站点名称;stationRouteCode:站点序号;toTime:到站时间  
123 - *  
124 - * versions:版本号;x:城建坐标x;y:城建坐标y>  
125 - *  
126 - * @return Map<String, Object> <SUCCESS ; ERROR>  
127 - */  
128 - @RequestMapping(value="stationUpdate" , method = RequestMethod.POST)  
129 - public Map<String, Object> stationUpdate(@RequestParam Map<String, Object> map) {  
130 - map.put("updateBy", "");  
131 - return service.stationUpdate(map);  
132 - }  
133 -  
134 - /**  
135 - * @Description :TODO(更新缓存站点保存)  
136 - *  
137 - * @param map <bJwpoints:中心点百度坐标;bPolygonGrid:多边形图形百度坐标;dbType:原坐标类型;  
138 - *  
139 - * descriptions:说明;destroy:是否撤销;directions:方向;distances:到站距离;gJwpoints:中心点WGS坐标;  
140 - *  
141 - * gPolygonGrid:多边形图形WGS坐标;lineId:线路ID;radius:圆半径;roadCoding:道路编码;shapesType:图形类型;  
142 - *  
143 - * stationCod:站点编码;stationMark:站点类型;stationName:站点名称;stationRouteCode:站点序号;toTime:到站时间  
144 - *  
145 - * versions:版本号;x:城建坐标x;y:城建坐标y>  
146 - *  
147 - * @return Map<String, Object> <SUCCESS ; ERROR>  
148 - */  
149 - @RequestMapping(value="stationCacheUpdate" , method = RequestMethod.POST)  
150 - public Map<String, Object> stationCacheUpdate(@RequestParam Map<String, Object> map) {  
151 - map.put("updateBy", "");  
152 - return service.stationCacheUpdate(map);  
153 - }  
154 - /**  
155 - * @Description :TODO(更新内部编码)  
156 - * @param stationCount,sectionCount 更新数  
157 - */  
158 - @RequestMapping(value="updateStationAndSectionCode" , method = RequestMethod.GET)  
159 - public int updateStationAndSectionCode(@RequestParam Integer stationCount, Integer sectionCount) {  
160 - System.out.println(stationCount+" _ "+ sectionCount );  
161 - for(int i = 0; i < stationCount; i++) {  
162 - System.out.println(i);  
163 - GetUIDAndCode.getStationId();  
164 - }  
165 - for(int j = 0; j < sectionCount; j++) {  
166 - System.out.println(j);  
167 - GetUIDAndCode.getSectionId();  
168 - }  
169 - return 1;  
170 - }  
171 - /**  
172 - * @Description :TODO(查询站点编码)  
173 - *  
174 - * @return int <stationCode站点编码>  
175 - */  
176 - @RequestMapping(value="getStationCode" , method = RequestMethod.GET)  
177 - public long getStationCode() {  
178 - return GetUIDAndCode.getStationId();  
179 -  
180 - }  
181 - /**  
182 - * @Description :TODO(查询站点编码)  
183 - *  
184 - * @return int <stationCode站点编码>  
185 - */  
186 - @RequestMapping(value="stationCacheSave" , method = RequestMethod.POST)  
187 - public Map<String, Object> stationCacheSave(@RequestParam Map<String, Object> map) {  
188 - map.put("createBy", "");  
189 - map.put("updateBy", "");  
190 - return service.stationCacheSave(map);  
191 - }  
192 -} 1 +package com.bsth.controller;
  2 +
  3 +import com.bsth.entity.Station;
  4 +import com.bsth.repository.StationRepository;
  5 +import com.bsth.service.StationService;
  6 +import com.bsth.util.GetUIDAndCode;
  7 +import org.slf4j.Logger;
  8 +import org.slf4j.LoggerFactory;
  9 +import org.springframework.beans.factory.annotation.Autowired;
  10 +import org.springframework.web.bind.annotation.RequestMapping;
  11 +import org.springframework.web.bind.annotation.RequestMethod;
  12 +import org.springframework.web.bind.annotation.RequestParam;
  13 +import org.springframework.web.bind.annotation.RestController;
  14 +
  15 +import java.util.Map;
  16 +
  17 +/**
  18 + *
  19 + * @ClassName: StationController(站点控制器)
  20 + *
  21 + * @Extends : BaseController
  22 + *
  23 + * @Description: TODO(站点控制层)
  24 + *
  25 + * @Author bsth@lq
  26 + *
  27 + * @Date 2016年05月03日 上午9:21:17
  28 + *
  29 + * @Version 公交调度系统BS版 0.1
  30 + *
  31 + */
  32 +
  33 +@RestController
  34 +@RequestMapping("station")
  35 +public class StationController extends BaseController<Station, Integer> {
  36 +
  37 + @Autowired
  38 + private StationService service;
  39 +
  40 + @Autowired
  41 + StationRepository stationRepository;
  42 +
  43 + /** 日志记录器 */
  44 + private static final Logger LOGGER = LoggerFactory.getLogger(StationController.class);
  45 +
  46 + /**
  47 + * @Description :TODO(根据坐标点匹配数据库中的站点)
  48 + *
  49 + * @param map: <point:坐标点; name:站点名>
  50 + *
  51 + */
  52 + @RequestMapping(value="matchStation" , method = RequestMethod.GET)
  53 + public Map<String, Object> matchStation(@RequestParam Map<String, Object> map) {
  54 + return service.matchStation(map);
  55 + }
  56 +
  57 + /**
  58 + * @Description :TODO(系统规划保存数据)
  59 + *
  60 + * @param map <stationJSON:站点信息;
  61 + *
  62 + * - - - - - - sectionJSON:路段信息;
  63 + *
  64 + * - - - - - - dbType:坐标类型;
  65 + *
  66 + * - - - - - - destroy:是否撤销;
  67 + *
  68 + * - - - - - - directions:方向;
  69 + *
  70 + * - - - - - - lineId:线路ID;
  71 + *
  72 + * - - - - - - radius:圆半径
  73 + *
  74 + * - - - - - - shapesType:图形类型
  75 + *
  76 + * - - - - - - speedLimit:限速>
  77 + *
  78 + * @return Map<String, Object> <SUCCESS ; ERROR>
  79 + */
  80 + @RequestMapping(value="collectionSave" , method = RequestMethod.POST)
  81 + public Map<String, Object> collectionSave(@RequestParam Map<String, Object> map) {
  82 + return service.systemSaveStations(map);
  83 + }
  84 +
  85 + @RequestMapping(value="manualSave" , method = RequestMethod.POST)
  86 + public Map<String, Object> manualSave(@RequestParam Map<String, Object> map) {
  87 + return service.manualSave(map);
  88 + }
  89 +
  90 + @RequestMapping(value="cacheSave" , method = RequestMethod.POST)
  91 + public Map<String, Object> cacheSave(@RequestParam Map<String, Object> map) {
  92 + return service.cacheSave(map);
  93 + }
  94 +
  95 + /**
  96 + * @Description :TODO(新增站点保存)
  97 + *
  98 + * @param map <bJwpoints:中心点百度坐标;bPolygonGrid:多边形图形百度坐标;dbType:原坐标类型;
  99 + *
  100 + * descriptions:说明;destroy:是否撤销;directions:方向;distances:到站距离;gJwpoints:中心点WGS坐标;
  101 + *
  102 + * gPolygonGrid:多边形图形WGS坐标;lineId:线路ID;radius:圆半径;roadCoding:道路编码;shapesType:图形类型;
  103 + *
  104 + * stationCod:站点编码;stationMark:站点类型;stationName:站点名称;stationRouteCode:站点序号;toTime:到站时间
  105 + *
  106 + * versions:版本号;x:城建坐标x;y:城建坐标y>
  107 + *
  108 + * @return Map<String, Object> <SUCCESS ; ERROR>
  109 + */
  110 + @RequestMapping(value="stationSave" , method = RequestMethod.POST)
  111 + public Map<String, Object> stationSave(@RequestParam Map<String, Object> map) {
  112 + map.put("createBy", "");
  113 + map.put("updateBy", "");
  114 + return service.stationSaveMap(map);
  115 + }
  116 +
  117 + /**
  118 + * @Description :TODO(更新站点保存)
  119 + *
  120 + * @param map <bJwpoints:中心点百度坐标;bPolygonGrid:多边形图形百度坐标;dbType:原坐标类型;
  121 + *
  122 + * descriptions:说明;destroy:是否撤销;directions:方向;distances:到站距离;gJwpoints:中心点WGS坐标;
  123 + *
  124 + * gPolygonGrid:多边形图形WGS坐标;lineId:线路ID;radius:圆半径;roadCoding:道路编码;shapesType:图形类型;
  125 + *
  126 + * stationCod:站点编码;stationMark:站点类型;stationName:站点名称;stationRouteCode:站点序号;toTime:到站时间
  127 + *
  128 + * versions:版本号;x:城建坐标x;y:城建坐标y>
  129 + *
  130 + * @return Map<String, Object> <SUCCESS ; ERROR>
  131 + */
  132 + @RequestMapping(value="stationUpdate" , method = RequestMethod.POST)
  133 + public Map<String, Object> stationUpdate(@RequestParam Map<String, Object> map) {
  134 + map.put("updateBy", ""); //??
  135 + return service.stationUpdate(map);
  136 + }
  137 +
  138 + /**
  139 + * @Description :TODO(更新缓存站点保存)
  140 + *
  141 + * @param map <bJwpoints:中心点百度坐标;bPolygonGrid:多边形图形百度坐标;dbType:原坐标类型;
  142 + *
  143 + * descriptions:说明;destroy:是否撤销;directions:方向;distances:到站距离;gJwpoints:中心点WGS坐标;
  144 + *
  145 + * gPolygonGrid:多边形图形WGS坐标;lineId:线路ID;radius:圆半径;roadCoding:道路编码;shapesType:图形类型;
  146 + *
  147 + * stationCod:站点编码;stationMark:站点类型;stationName:站点名称;stationRouteCode:站点序号;toTime:到站时间
  148 + *
  149 + * versions:版本号;x:城建坐标x;y:城建坐标y>
  150 + *
  151 + * @return Map<String, Object> <SUCCESS ; ERROR>
  152 + */
  153 + @RequestMapping(value="stationCacheUpdate" , method = RequestMethod.POST)
  154 + public Map<String, Object> stationCacheUpdate(@RequestParam Map<String, Object> map) {
  155 + map.put("updateBy", "");
  156 + return service.stationCacheUpdate(map);
  157 + }
  158 + /**
  159 + * @Description :TODO(更新内部编码)
  160 + * @param stationCount,sectionCount 更新数
  161 + */
  162 + @RequestMapping(value="updateStationAndSectionCode" , method = RequestMethod.GET)
  163 + public int updateStationAndSectionCode(@RequestParam Integer stationCount, Integer sectionCount) {
  164 +// System.out.println(stationCount+" _ "+ sectionCount );
  165 +// for(int i = 0; i < stationCount; i++) {
  166 +//// System.out.println(i);
  167 +// stationRepository.stationMaxId() + 1;
  168 +// }
  169 +// for(int j = 0; j < sectionCount; j++) {
  170 +//// System.out.println(j);
  171 +// sectionRepository.sectionMaxId() + 1;
  172 +// }
  173 + return 1;
  174 + }
  175 + /**
  176 + * @Description :TODO(查询站点编码)
  177 + *
  178 + * @return int <stationCode站点编码>
  179 + */
  180 + @RequestMapping(value="getStationCode" , method = RequestMethod.GET)
  181 + public long getStationCode() {
  182 + return stationRepository.stationMaxId() + 1;
  183 +
  184 + }
  185 + /**
  186 + * @Description :TODO(查询站点编码)
  187 + *
  188 + * @return int <stationCode站点编码>
  189 + */
  190 + @RequestMapping(value="stationCacheSave" , method = RequestMethod.POST)
  191 + public Map<String, Object> stationCacheSave(@RequestParam Map<String, Object> map) {
  192 + map.put("createBy", "");
  193 + map.put("updateBy", "");
  194 + return service.stationCacheSave(map);
  195 + }
  196 +}
src/main/java/com/bsth/controller/StationRouteController.java
1 -package com.bsth.controller;  
2 -  
3 -import com.bsth.entity.StationRoute;  
4 -import com.bsth.entity.StationRouteCache;  
5 -import com.bsth.repository.StationRouteCacheRepository;  
6 -import com.bsth.repository.StationRouteRepository;  
7 -import com.bsth.service.StationRouteService;  
8 -import org.springframework.beans.factory.annotation.Autowired;  
9 -import org.springframework.web.bind.annotation.RequestMapping;  
10 -import org.springframework.web.bind.annotation.RequestMethod;  
11 -import org.springframework.web.bind.annotation.RequestParam;  
12 -import org.springframework.web.bind.annotation.RestController;  
13 -  
14 -import javax.servlet.http.HttpServletResponse;  
15 -import java.util.List;  
16 -import java.util.Map;  
17 -  
18 -/**  
19 - *  
20 - * @ClassName: StationRouteController(站点路由控制器)  
21 - *  
22 - * @Extends : BaseController  
23 - *  
24 - * @Description: TODO(站点路由控制层)  
25 - *  
26 - * @Author bsth@lq  
27 - *  
28 - * @Date 2016年5月03日 上午9:21:17  
29 - *  
30 - * @Dersion 公交调度系统BS版 0.1  
31 - *  
32 - */  
33 -@RestController  
34 -@RequestMapping("stationroute")  
35 -public class StationRouteController extends BaseController<StationRoute, Integer> {  
36 -  
37 - @Autowired  
38 - StationRouteService service;  
39 - @Autowired  
40 - StationRouteRepository stationRouteRepository;  
41 - @Autowired  
42 - StationRouteCacheRepository stationRouteCacheRepository;  
43 -  
44 - /**  
45 - * @param @param map  
46 - * @throws  
47 - * @Title: list  
48 - * @Description: TODO(多条件查询)  
49 - */  
50 - @RequestMapping(value = "/all", method = RequestMethod.GET)  
51 - public Iterable<StationRoute> list(@RequestParam Map<String, Object> map) {  
52 - return service.list(map);  
53 - }  
54 -  
55 - @RequestMapping(value = "/cacheList", method = RequestMethod.GET)  
56 - public List<StationRouteCache> cacheList(@RequestParam Map<String, Object> map) {  
57 - return service.cacheList(map);  
58 - }  
59 -  
60 - /**  
61 - * @Description :TODO(查询路段信息)  
62 - *  
63 - * @param map <line.id_eq:线路ID; directions_eq:方向>  
64 - *  
65 - * @return Map<String, Object>  
66 - */  
67 - @RequestMapping(value = "/export" , method = RequestMethod.GET)  
68 - public Map<String, Object> export(@RequestParam Integer id, HttpServletResponse resp) {  
69 - return service.getSectionRouteExport(id, resp);  
70 - }  
71 -  
72 - /**  
73 - * @param map  
74 - * @throws  
75 - * @Description: TODO(批量撤销站点)  
76 - */  
77 - @RequestMapping(value = "/batchDestroy", method = RequestMethod.POST)  
78 - public Map<String, Object> updateBatch(@RequestParam Map<String, Object> map) {  
79 - return service.updateStationRouteInfoFormId(map);  
80 - }  
81 -  
82 - /**  
83 - * @Description :TODO(查询树站点与路段数据)  
84 - *  
85 - * @param map <line.id_eq:线路ID; directions_eq:方向>  
86 - *  
87 - * @return List<Map<String, Object>>  
88 - */  
89 - @RequestMapping(value = "/findStations" , method = RequestMethod.GET)  
90 - public List<Map<String, Object>> findStations(@RequestParam Map<String, Object> map) {  
91 - return service.findPoints(map);  
92 - }  
93 -  
94 - @RequestMapping(value = "/systemQuote" , method = RequestMethod.POST)  
95 - public Map<String, Object> systemQuote(@RequestParam Map<String, Object> map) {  
96 - return service.systemQuote(map);  
97 - }  
98 -  
99 - /**  
100 - * @Description :TODO(查询线路某方向下的站点序号与类型)  
101 - *  
102 - * @param map <lineId:线路ID; direction:方向;stationRouteCode:站点编码>  
103 - *  
104 - * @return List<Map<String, Object>>  
105 - */  
106 - @RequestMapping(value = "/findUpStationRouteCode" , method = RequestMethod.GET)  
107 - public List<Map<String, Object>> findUpStationRouteCode(@RequestParam Map<String, Object> map) {  
108 - return service.findUpStationRouteCode(map);  
109 - }  
110 -  
111 - /**  
112 - * @Description :TODO(查询线路某方向下的站点序号与类型)  
113 - */  
114 - @RequestMapping(value = "/findCacheUpStationRouteCode" , method = RequestMethod.GET)  
115 - public List<Map<String, Object>> findCacheUpStationRouteCode(@RequestParam Map<String, Object> map) {  
116 - return service.findCacheUpStationRouteCode(map);  
117 - }  
118 -  
119 - /**  
120 - * @Description :TODO(查询站点的下一个缓存站点)  
121 - */  
122 - @RequestMapping(value = "/findDownStationRoute" , method = RequestMethod.GET)  
123 - public List<Map<String, Object>> findDownStationRoute(@RequestParam Map<String, Object> map) {  
124 - return service.findDownStationRoute(map);  
125 - }  
126 -  
127 - /**  
128 - * @Description :TODO(查询线路某方向下所有站点的中心百度坐标)  
129 - *  
130 - * @param map <lineId:线路ID; direction:方向>  
131 - *  
132 - * @return List<Map<String, Object>>  
133 - */  
134 - @RequestMapping(value = "/getStationRouteCenterPoints" , method = RequestMethod.GET)  
135 - public List<Map<String, Object>> getStationRouteCenterPoints(@RequestParam Map<String, Object> map) {  
136 - return service.getStationRouteCenterPoints(map);  
137 - }  
138 -  
139 - /**  
140 - * @Description :TODO(查询线路某方向下所有站点)  
141 - *  
142 - * @param map <lineId:线路ID; direction:方向>  
143 - *  
144 - * @return List<Map<String, Object>>  
145 - */  
146 - @RequestMapping(value = "/getStationRouteList" , method = RequestMethod.GET)  
147 - public List<Map<String, Object>> getStationRouteList(@RequestParam Map<String, Object> map) {  
148 - return service.getStationRouteList(map);  
149 - }  
150 -  
151 - /**  
152 - * @Description :TODO(查询线路某方向下所有站点的中心百度坐标)  
153 - *  
154 - * @param map <lineId:线路ID; direction:方向>  
155 - *  
156 - * @return List<Map<String, Object>>  
157 - */  
158 - @RequestMapping(value = "/getStationRouteCacheCenterPoints" , method = RequestMethod.GET)  
159 - public List<Map<String, Object>> getStationRouteCacheCenterPoints(@RequestParam Map<String, Object> map) {  
160 - return service.getStationRouteCacheCenterPoints(map);  
161 - }  
162 -  
163 - /**  
164 - * @Description :TODO(撤销站点)  
165 - *  
166 - * @param map <lineId:线路ID; destroy:是否撤销(0:否;1:是)>  
167 - *  
168 - * @return Map<String, Object> <SUCCESS ; ERROR>  
169 - */  
170 - @RequestMapping(value = "/stationRouteIsDestroy" , method = RequestMethod.POST)  
171 - public Map<String, Object> stationRouteIsDestroy(@RequestParam Map<String, Object> map) {  
172 - return service.stationRouteIsDestroy(map);  
173 - }  
174 -  
175 - /**  
176 - * @Description : TODO(根据线路ID生成行单)  
177 - *  
178 - * @param map <id:线路ID>  
179 - *  
180 - * @return Map<String, Object> <SUCCESS ; ERROR ; NOTDATA>  
181 - */  
182 - @RequestMapping(value = "/usingSingle",method = RequestMethod.POST)  
183 - public Map<String, Object> usingSingle(@RequestParam Map<String, Object> map) {  
184 - return service.usingSingle(map);  
185 - }  
186 -  
187 -  
188 - /**  
189 - * @Description : TODO(根据站点路由Id查询详情)  
190 - *  
191 - * @param map <id:站点路由ID>  
192 - *  
193 - * @return List<Map<String, Object>>  
194 - */  
195 - @RequestMapping(value = "/findStationRouteInfo",method = RequestMethod.GET)  
196 - public List<Map<String, Object>> findStationRouteInfo(@RequestParam Map<String, Object> map) {  
197 - return service.findStationRouteInfo(map);  
198 - }  
199 -  
200 - @RequestMapping(value = "/stations", method = RequestMethod.GET)  
201 - public List<Map<String, Object>> findStations(Integer xlid, Integer xldir) {  
202 - return stationRouteRepository.findStations(xlid, xldir);  
203 - }  
204 -  
205 - /**  
206 - *  
207 - * @Title: findByMultiLine  
208 - * @Description: TODO(多线路路由查询)  
209 - */  
210 - @RequestMapping(value = "/multiLine", method = RequestMethod.GET)  
211 - public Map<String, Object> findByMultiLine(@RequestParam String lineIds){  
212 - return service.findByMultiLine(lineIds);  
213 - }  
214 -  
215 - /**  
216 - *  
217 - * @Title: updSwitchDir  
218 - * @Description: TODO(上下行切换)  
219 - */  
220 - @RequestMapping(value = "/updSwitchDir", method = RequestMethod.POST)  
221 - public Map<String, Object> updSwitchDir(@RequestParam String lineIds){  
222 - return service.updSwitchDir(lineIds);  
223 - }  
224 -  
225 - /**  
226 - *  
227 - * @Title: upddis  
228 - * @Description: TODO(更新站距)  
229 - */  
230 - @RequestMapping(value = "/upddis",method = RequestMethod.POST)  
231 - public Map<String, Object> upddis(@RequestParam Map<String, Object> map) {  
232 - return service.upddis(map);  
233 - }  
234 -  
235 - /**  
236 - *  
237 - * @Title: findCacheStationRoute  
238 - * @Description: TODO(查询缓存路由)  
239 - */  
240 - @RequestMapping(value = "/findCacheStationRoute",method = RequestMethod.GET)  
241 - public List<StationRouteCache> findCacheStationRoute(@RequestParam Map<String, Object> map) {  
242 - int lineId = Integer.parseInt(map.get("lineId").toString());  
243 - int dir = Integer.parseInt(map.get("dir").toString());  
244 - return stationRouteCacheRepository.findstationRoute(lineId, dir);  
245 - }  
246 -  
247 - /**  
248 - *  
249 - * @Title: findCachePoint  
250 - *  
251 - * @param map <lineId:线路ID; dir:方向>  
252 - *  
253 - * @Description: TODO(查询缓存路由)  
254 - */  
255 - @RequestMapping(value = "/findCachePoint",method = RequestMethod.GET)  
256 - public List<Map<String, Object>> findCachePoint(@RequestParam Map<String, Object> map) {  
257 - int lineId = Integer.parseInt(map.get("lineId").toString());  
258 - int dir = Integer.parseInt(map.get("dir").toString());  
259 - return service.findCachePoint(lineId, dir);  
260 - }  
261 -} 1 +package com.bsth.controller;
  2 +
  3 +import java.util.List;
  4 +import java.util.Map;
  5 +
  6 +import javax.servlet.http.HttpServletResponse;
  7 +
  8 +import org.springframework.beans.factory.annotation.Autowired;
  9 +import org.springframework.web.bind.annotation.RequestMapping;
  10 +import org.springframework.web.bind.annotation.RequestMethod;
  11 +import org.springframework.web.bind.annotation.RequestParam;
  12 +import org.springframework.web.bind.annotation.RestController;
  13 +
  14 +import com.bsth.entity.LsStationRoute;
  15 +import com.bsth.entity.StationRoute;
  16 +import com.bsth.entity.StationRouteCache;
  17 +import com.bsth.repository.StationRouteCacheRepository;
  18 +import com.bsth.repository.StationRouteRepository;
  19 +import com.bsth.service.StationRouteService;
  20 +
  21 +/**
  22 + *
  23 + * @ClassName: StationRouteController(站点路由控制器)
  24 + *
  25 + * @Extends : BaseController
  26 + *
  27 + * @Description: TODO(站点路由控制层)
  28 + *
  29 + * @Author bsth@lq
  30 + *
  31 + * @Date 2016年5月03日 上午9:21:17
  32 + *
  33 + * @Dersion 公交调度系统BS版 0.1
  34 + *
  35 + */
  36 +@RestController
  37 +@RequestMapping("stationroute")
  38 +public class StationRouteController extends BaseController<StationRoute, Integer> {
  39 +
  40 + @Autowired
  41 + StationRouteService service;
  42 + @Autowired
  43 + StationRouteRepository stationRouteRepository;
  44 + @Autowired
  45 + StationRouteCacheRepository stationRouteCacheRepository;
  46 +
  47 +
  48 + @RequestMapping(value = "/allls", method = RequestMethod.GET)
  49 + public Map allls(@RequestParam Map<String, Object> map) {
  50 +
  51 + return service.pageLs(map);
  52 + }
  53 +
  54 + @RequestMapping(value = "/all_ls", method = RequestMethod.GET)
  55 + public Iterable<LsStationRoute> list_ls(@RequestParam Map<String, Object> map) {
  56 + return service.list_ls(map);
  57 + }
  58 +
  59 +
  60 + @RequestMapping(value = "/all", method = RequestMethod.GET)
  61 + public Iterable<StationRoute> list(@RequestParam Map<String, Object> map) {
  62 + return service.list(map);
  63 + }
  64 +
  65 + @RequestMapping(value = "/cacheList", method = RequestMethod.GET)
  66 + public List<StationRouteCache> cacheList(@RequestParam Map<String, Object> map) {
  67 + return service.cacheList(map);
  68 + }
  69 +
  70 + /**
  71 + * @Description :TODO(查询路段信息)
  72 + *
  73 + * @param id
  74 + *
  75 + * @return Map<String, Object>
  76 + */
  77 + @RequestMapping(value = "/export" , method = RequestMethod.GET)
  78 + public Map<String, Object> export(@RequestParam Integer id, HttpServletResponse resp) {
  79 + return service.getSectionRouteExport(id, resp);
  80 + }
  81 +
  82 + /**
  83 + * @param map
  84 + * @throws
  85 + * @Description: TODO(批量撤销站点)
  86 + */
  87 + @RequestMapping(value = "/batchDestroy", method = RequestMethod.POST)
  88 + public Map<String, Object> updateBatch(@RequestParam Map<String, Object> map) {
  89 + return service.updateStationRouteInfoFormId(map);
  90 + }
  91 +
  92 + /**
  93 + * @Description :TODO(查询树站点与路段数据)
  94 + *
  95 + * @param map <line.id_eq:线路ID; directions_eq:方向>
  96 + *
  97 + * @return List<Map<String, Object>>
  98 + */
  99 + @RequestMapping(value = "/findStations" , method = RequestMethod.GET)
  100 + public List<Map<String, Object>> findStations(@RequestParam Map<String, Object> map) {
  101 + return service.findPoints(map);
  102 + }
  103 +
  104 + @RequestMapping(value = "/systemQuote" , method = RequestMethod.POST)
  105 + public Map<String, Object> systemQuote(@RequestParam Map<String, Object> map) {
  106 + return service.systemQuote(map);
  107 + }
  108 +
  109 + /**
  110 + * @Description :TODO(查询线路某方向下的站点序号与类型)
  111 + *
  112 + * @param map <lineId:线路ID; direction:方向;stationRouteCode:站点编码>
  113 + *
  114 + * @return List<Map<String, Object>>
  115 + */
  116 + @RequestMapping(value = "/findUpStationRouteCode" , method = RequestMethod.GET)
  117 + public List<Map<String, Object>> findUpStationRouteCode(@RequestParam Map<String, Object> map) {
  118 + return service.findUpStationRouteCode(map);
  119 + }
  120 +
  121 + /**
  122 + * @Description :TODO(查询线路某方向下的站点序号与类型)
  123 + */
  124 + @RequestMapping(value = "/findCacheUpStationRouteCode" , method = RequestMethod.GET)
  125 + public List<Map<String, Object>> findCacheUpStationRouteCode(@RequestParam Map<String, Object> map) {
  126 + return service.findCacheUpStationRouteCode(map);
  127 + }
  128 +
  129 + /**
  130 + * @Description :TODO(查询站点的下一个缓存站点)
  131 + */
  132 + @RequestMapping(value = "/findDownStationRoute" , method = RequestMethod.GET)
  133 + public List<Map<String, Object>> findDownStationRoute(@RequestParam Map<String, Object> map) {
  134 + return service.findDownStationRoute(map);
  135 + }
  136 +
  137 + /**
  138 + * @Description :TODO(查询线路某方向下所有站点的中心百度坐标)
  139 + *
  140 + * @param map <lineId:线路ID; direction:方向>
  141 + *
  142 + * @return List<Map<String, Object>>
  143 + */
  144 + @RequestMapping(value = "/getStationRouteCenterPoints" , method = RequestMethod.GET)
  145 + public List<Map<String, Object>> getStationRouteCenterPoints(@RequestParam Map<String, Object> map) {
  146 + return service.getStationRouteCenterPoints(map);
  147 + }
  148 +
  149 + /**
  150 + * @Description :TODO(查询线路某方向下所有站点)
  151 + *
  152 + * @param map <lineId:线路ID; direction:方向>
  153 + *
  154 + * @return List<Map<String, Object>>
  155 + */
  156 + @RequestMapping(value = "/getStationRouteList" , method = RequestMethod.GET)
  157 + public List<Map<String, Object>> getStationRouteList(@RequestParam Map<String, Object> map) {
  158 + return service.getStationRouteList(map);
  159 + }
  160 +
  161 + /**
  162 + * @Description :TODO(查询线路某方向下所有站点的中心百度坐标)
  163 + *
  164 + * @param map <lineId:线路ID; direction:方向>
  165 + *
  166 + * @return List<Map<String, Object>>
  167 + */
  168 + @RequestMapping(value = "/getStationRouteCacheCenterPoints" , method = RequestMethod.GET)
  169 + public List<Map<String, Object>> getStationRouteCacheCenterPoints(@RequestParam Map<String, Object> map) {
  170 + return service.getStationRouteCacheCenterPoints(map);
  171 + }
  172 +
  173 + /**
  174 + * @Description :TODO(撤销站点)
  175 + *
  176 + * @param map <lineId:线路ID; destroy:是否撤销(0:否;1:是)>
  177 + *
  178 + * @return Map<String, Object> <SUCCESS ; ERROR>
  179 + */
  180 + @RequestMapping(value = "/stationRouteIsDestroy" , method = RequestMethod.POST)
  181 + public Map<String, Object> stationRouteIsDestroy(@RequestParam Map<String, Object> map) {
  182 + return service.stationRouteIsDestroy(map);
  183 + }
  184 +
  185 + /**
  186 + * @Description : TODO(根据线路ID生成行单)
  187 + *
  188 + * @param map <id:线路ID>
  189 + *
  190 + * @return Map<String, Object> <SUCCESS ; ERROR ; NOTDATA>
  191 + */
  192 + @RequestMapping(value = "/usingSingle",method = RequestMethod.POST)
  193 + public Map<String, Object> usingSingle(@RequestParam Map<String, Object> map) {
  194 + return service.usingSingle(map);
  195 + }
  196 +
  197 +
  198 + /**
  199 + * @Description : TODO(根据站点路由Id查询详情)
  200 + *
  201 + * @param map <id:站点路由ID>
  202 + *
  203 + * @return List<Map<String, Object>>
  204 + */
  205 + @RequestMapping(value = "/findStationRouteInfo",method = RequestMethod.GET)
  206 + public List<Map<String, Object>> findStationRouteInfo(@RequestParam Map<String, Object> map) {
  207 + return service.findStationRouteInfo(map);
  208 + }
  209 +
  210 + @RequestMapping(value = "/stations", method = RequestMethod.GET)
  211 + public List<Map<String, Object>> findStations(Integer xlid, Integer xldir) {
  212 + return stationRouteRepository.findStations(xlid, xldir);
  213 + }
  214 +
  215 + /**
  216 + *
  217 + * @Title: findByMultiLine
  218 + * @Description: TODO(多线路路由查询)
  219 + */
  220 + @RequestMapping(value = "/multiLine", method = RequestMethod.GET)
  221 + public Map<String, Object> findByMultiLine(@RequestParam String lineIds){
  222 + return service.findByMultiLine(lineIds);
  223 + }
  224 +
  225 + /**
  226 + *
  227 + * @Title: updSwitchDir
  228 + * @Description: TODO(上下行切换)
  229 + */
  230 + @RequestMapping(value = "/updSwitchDir", method = RequestMethod.POST)
  231 + public Map<String, Object> updSwitchDir(@RequestParam String lineIds, @RequestParam(value = "status", required = false)int status){
  232 + return service.updSwitchDir(lineIds,status);
  233 + }
  234 +
  235 + /**
  236 + *
  237 + * @Title: upddis
  238 + * @Description: TODO(更新站距)
  239 + */
  240 + @RequestMapping(value = "/upddis",method = RequestMethod.POST)
  241 + public Map<String, Object> upddis(@RequestParam Map<String, Object> map) {
  242 + return service.upddis(map);
  243 + }
  244 +
  245 + /**
  246 + *
  247 + * @Title: findCacheStationRoute
  248 + * @Description: TODO(查询缓存路由)
  249 + */
  250 + @RequestMapping(value = "/findCacheStationRoute",method = RequestMethod.GET)
  251 + public List<StationRouteCache> findCacheStationRoute(@RequestParam Map<String, Object> map) {
  252 + int lineId = Integer.parseInt(map.get("lineId").toString());
  253 + int dir = Integer.parseInt(map.get("dir").toString());
  254 + return stationRouteCacheRepository.findstationRoute(lineId, dir);
  255 + }
  256 +
  257 + /**
  258 + *
  259 + * @Title: findCachePoint
  260 + *
  261 + * @param map <lineId:线路ID; dir:方向>
  262 + *
  263 + * @Description: TODO(查询缓存路由)
  264 + */
  265 + @RequestMapping(value = "/findCachePoint",method = RequestMethod.GET)
  266 + public List<Map<String, Object>> findCachePoint(@RequestParam Map<String, Object> map) {
  267 + int lineId = Integer.parseInt(map.get("lineId").toString());
  268 + int dir = Integer.parseInt(map.get("dir").toString());
  269 + return service.findCachePoint(lineId, dir);
  270 + }
  271 +
  272 +
  273 + /**
  274 + * 查询博协站点
  275 + * @param map
  276 + * @return
  277 + */
  278 + @RequestMapping(value = "/findMatchStation", method = RequestMethod.GET)
  279 + public Map<String, Object> findMatchStation(@RequestParam Map<String, Object> map){
  280 + return service.findMatchStation(map);
  281 + }
  282 +
  283 + /**
  284 + * 批量修改行业编码
  285 + * @param map
  286 + * @return
  287 + */
  288 + @RequestMapping(value = "/updIndustryCode",method = RequestMethod.POST)
  289 + public Map<String, Object> updIndustryCode(@RequestParam Map<String, Object> map) {
  290 + return service.updIndustryCode(map);
  291 + }
  292 +
  293 + /**
  294 + * 匹配外部站点行业编码
  295 + * @param map
  296 + * @return
  297 + */
  298 + @RequestMapping(value = "/matchIndustryCode",method = RequestMethod.POST)
  299 + public Map<String, Object> matchIndustryCode(@RequestParam Map<String, Object> map) {
  300 + return service.matchIndustryCode(map);
  301 + }
  302 + /**
  303 + * 匹配附近站点行业编码
  304 + * @param map
  305 + * @return
  306 + */
  307 + @RequestMapping(value = "/matchNearbyStation",method = RequestMethod.GET)
  308 + public Map<String, Object> matchNearbyStation(@RequestParam Map<String, Object> map) {
  309 + return service.matchNearbyStation(map);
  310 + }
  311 +}
src/main/java/com/bsth/controller/realcontrol/AdminUtilsController.java
1 -package com.bsth.controller.realcontrol;  
2 -  
3 -import com.bsth.data.directive.DayOfDirectives;  
4 -import com.bsth.data.directive.DirectivesPstThread;  
5 -import com.bsth.data.gpsdata_v2.cache.GeoCacheData;  
6 -import com.bsth.data.gpsdata_v2.handlers.overspeed.OverspeedProcess;  
7 -import com.bsth.data.gpsdata_v2.thread.GpsDataLoaderThread;  
8 -import com.bsth.data.msg_queue.DirectivePushQueue;  
9 -import com.bsth.data.msg_queue.WebSocketPushQueue;  
10 -import com.bsth.data.pilot80.PilotReport;  
11 -import com.bsth.data.schedule.DayOfSchedule;  
12 -import com.bsth.entity.realcontrol.ScheduleRealInfo;  
13 -import com.bsth.websocket.handler.SendUtils;  
14 -import org.slf4j.Logger;  
15 -import org.slf4j.LoggerFactory;  
16 -import org.springframework.beans.factory.annotation.Autowired;  
17 -import org.springframework.web.bind.annotation.RequestMapping;  
18 -import org.springframework.web.bind.annotation.RequestParam;  
19 -import org.springframework.web.bind.annotation.RestController;  
20 -  
21 -import java.util.HashMap;  
22 -import java.util.List;  
23 -import java.util.Map;  
24 -  
25 -/**  
26 - * Created by panzhao on 2017/4/14.  
27 - */  
28 -@RestController  
29 -@RequestMapping("adminUtils")  
30 -public class AdminUtilsController {  
31 -  
32 -  
33 - Logger logger = LoggerFactory.getLogger(this.getClass());  
34 -  
35 - @Autowired  
36 - DayOfSchedule dayOfSchedule;  
37 -  
38 - @Autowired  
39 - GeoCacheData geoCacheData;  
40 -  
41 - @Autowired  
42 - DayOfDirectives dayOfDirectives;  
43 -  
44 - @Autowired  
45 - SendUtils sendUtils;  
46 -  
47 - @Autowired  
48 - PilotReport pilotReport;  
49 -  
50 - /**  
51 - * 出现重复班次的车辆  
52 - * @param  
53 -  
54 - @RequestMapping(value = "/schRepeat", method = RequestMethod.POST)  
55 - public void schRepeat(@RequestParam String nbbm){  
56 - logger.info("前端通知,车辆 " + nbbm + "出现重复班次,开始检测...");  
57 - List<ScheduleRealInfo> list = dayOfSchedule.findByNbbm(nbbm);  
58 - logger.info("检测前,车辆班次数量:" + list.size());  
59 -  
60 - Map<Long, ScheduleRealInfo> map = new HashMap<>();  
61 - for(ScheduleRealInfo sch : list){  
62 - if(map.containsKey(sch.getId())){  
63 - logger.info("检测到重复ID: " + sch.getId());  
64 - }  
65 - map.put(sch.getId(), sch);  
66 - }  
67 -  
68 - logger.info("检测后,车辆班次数量:" + list.size());  
69 - if(map.values().size() > 0){  
70 - dayOfSchedule.replaceByNbbm(nbbm, map.values());  
71 - }  
72 - }*/  
73 -  
74 -/* @RequestMapping(value = "/directivePushQueue")  
75 - public void directivePushQueue(){  
76 - DirectivePushQueue.start();  
77 - }*/  
78 -  
79 - @RequestMapping(value = "/directiveQueueSize")  
80 - public void directiveQueueSize(){  
81 - DirectivePushQueue.size();  
82 - }  
83 -  
84 - /*@RequestMapping(value = "/webSocketPushQueue")  
85 - public void webSocketPushQueue(){  
86 - WebSocketPushQueue.start();  
87 - }*/  
88 -  
89 - @RequestMapping(value = "/webSocketQueueSize")  
90 - public void webSocketQueueSize(){  
91 - WebSocketPushQueue.size();  
92 - }  
93 -  
94 - @RequestMapping(value = "/setHttpFlag")  
95 - public void setHttpFlag(@RequestParam int flag){  
96 - if(flag != 0 && flag != -1)  
97 - return;  
98 - GpsDataLoaderThread.setFlag(flag);  
99 - }  
100 -  
101 - @RequestMapping(value = "/updateCacheBuff")  
102 - public void updateCacheBuff(){  
103 - geoCacheData.loadData();  
104 - }  
105 -  
106 - @RequestMapping(value = "/reCalcLpSch")  
107 - public void reCalcLpSch(){  
108 - dayOfSchedule._test_reCalcLpSch();  
109 - }  
110 -  
111 - @RequestMapping(value = "/findSchByLpName")  
112 - public List<ScheduleRealInfo> findSchByLpName(@RequestParam String lpName){  
113 - return dayOfSchedule.getLpScheduleMap().get(lpName);  
114 - }  
115 -  
116 - @RequestMapping(value = "/findSchByNbbm")  
117 - public List<ScheduleRealInfo> findSchByNbbm(@RequestParam String nbbm){  
118 - return dayOfSchedule.findByNbbm(nbbm);  
119 - }  
120 -  
121 - @RequestMapping(value = "/removeExecPlan")  
122 - public int removeExecPlan(@RequestParam String nbbm){  
123 - dayOfSchedule.removeExecPlan(nbbm);  
124 - return 1;  
125 - }  
126 -  
127 - @RequestMapping(value = "/sch_re_calc_id_maps")  
128 - public int reCalcIdMaps(){  
129 - return dayOfSchedule.reCalcIdMaps();  
130 - }  
131 -  
132 - @RequestMapping(value = "/sch_size_string")  
133 - public String schSizeString(){  
134 - return dayOfSchedule.sizeString();  
135 - }  
136 -  
137 - @RequestMapping(value = "/containerSize")  
138 - public Map<String, Integer> containerSize(){  
139 - Map<String, Integer> rs = new HashMap<>();  
140 - rs.put("60_size", dayOfDirectives.all60().size());  
141 - rs.put("80_size", pilotReport.findAll().size());  
142 - rs.put("nbbm_sch_size", dayOfSchedule.findAll().size());  
143 - rs.put("lp_sch_size", dayOfSchedule.findAllByLpContainer().size());  
144 - rs.put("id_sch_size", dayOfSchedule.findAllByIdContainer().size());  
145 - rs.put("pst_sch_size", dayOfSchedule.getPstSize());  
146 - rs.put("speeds_size", OverspeedProcess.size());  
147 - return rs;  
148 - }  
149 -  
150 - @RequestMapping(value = "/websocketRadioText")  
151 - public int radioText(String t, String lineCode){  
152 - sendUtils.sendRadioText(t, lineCode);  
153 - return 0;  
154 - }  
155 -  
156 - @Autowired  
157 - DirectivesPstThread directivesPstThread;  
158 -  
159 - @RequestMapping(value = "/_sd_60_pst")  
160 - public void sd_60_pst(){  
161 - logger.info("手动入库指令....");  
162 - directivesPstThread.run();  
163 - } 1 +package com.bsth.controller.realcontrol;
  2 +
  3 +import ch.qos.logback.classic.Level;
  4 +import ch.qos.logback.classic.LoggerContext;
  5 +import com.bsth.data.BasicData;
  6 +import com.bsth.data.directive.DayOfDirectives;
  7 +import com.bsth.data.directive.DirectivesPstThread;
  8 +import com.bsth.data.gpsdata_v2.cache.GeoCacheData;
  9 +import com.bsth.data.gpsdata_v2.handlers.overspeed.OverspeedProcess;
  10 +import com.bsth.data.gpsdata_v2.thread.GpsDataLoaderThread;
  11 +import com.bsth.data.msg_queue.DirectivePushQueue;
  12 +import com.bsth.data.msg_queue.WebSocketPushQueue;
  13 +import com.bsth.data.pilot80.PilotReport;
  14 +import com.bsth.data.schedule.DayOfSchedule;
  15 +import com.bsth.entity.realcontrol.ScheduleRealInfo;
  16 +import com.bsth.websocket.handler.SendUtils;
  17 +import com.fasterxml.jackson.databind.ObjectMapper;
  18 +import org.slf4j.Logger;
  19 +import org.slf4j.LoggerFactory;
  20 +import org.springframework.beans.factory.annotation.Autowired;
  21 +import org.springframework.web.bind.annotation.RequestMapping;
  22 +import org.springframework.web.bind.annotation.RequestParam;
  23 +import org.springframework.web.bind.annotation.RestController;
  24 +
  25 +import java.util.HashMap;
  26 +import java.util.List;
  27 +import java.util.Map;
  28 +import java.util.Set;
  29 +
  30 +/**
  31 + * Created by panzhao on 2017/4/14.
  32 + */
  33 +@RestController
  34 +@RequestMapping("adminUtils")
  35 +public class AdminUtilsController {
  36 +
  37 +
  38 + Logger logger = LoggerFactory.getLogger(this.getClass());
  39 +
  40 + @Autowired
  41 + private ObjectMapper objectMapper;
  42 +
  43 + @Autowired
  44 + DayOfSchedule dayOfSchedule;
  45 +
  46 + @Autowired
  47 + GeoCacheData geoCacheData;
  48 +
  49 + @Autowired
  50 + DayOfDirectives dayOfDirectives;
  51 +
  52 + @Autowired
  53 + SendUtils sendUtils;
  54 +
  55 + @Autowired
  56 + PilotReport pilotReport;
  57 +
  58 + @Autowired
  59 + private BasicData.BasicDataLoader basicDataLoader;
  60 +
  61 + /**
  62 + * 出现重复班次的车辆
  63 + *
  64 + * @param
  65 + * @RequestMapping(value = "/schRepeat", method = RequestMethod.POST)
  66 + * public void schRepeat(@RequestParam String nbbm){
  67 + * logger.info("前端通知,车辆 " + nbbm + "出现重复班次,开始检测...");
  68 + * List<ScheduleRealInfo> list = dayOfSchedule.findByNbbm(nbbm);
  69 + * logger.info("检测前,车辆班次数量:" + list.size());
  70 + * <p>
  71 + * Map<Long, ScheduleRealInfo> map = new HashMap<>();
  72 + * for(ScheduleRealInfo sch : list){
  73 + * if(map.containsKey(sch.getId())){
  74 + * logger.info("检测到重复ID: " + sch.getId());
  75 + * }
  76 + * map.put(sch.getId(), sch);
  77 + * }
  78 + * <p>
  79 + * logger.info("检测后,车辆班次数量:" + list.size());
  80 + * if(map.values().size() > 0){
  81 + * dayOfSchedule.replaceByNbbm(nbbm, map.values());
  82 + * }
  83 + * }
  84 + */
  85 +
  86 +/* @RequestMapping(value = "/directivePushQueue")
  87 + public void directivePushQueue(){
  88 + DirectivePushQueue.start();
  89 + }*/
  90 + @RequestMapping(value = "/directiveQueueSize")
  91 + public void directiveQueueSize() {
  92 + DirectivePushQueue.size();
  93 + }
  94 +
  95 + /*@RequestMapping(value = "/webSocketPushQueue")
  96 + public void webSocketPushQueue(){
  97 + WebSocketPushQueue.start();
  98 + }*/
  99 +
  100 + @RequestMapping(value = "/webSocketQueueSize")
  101 + public void webSocketQueueSize() {
  102 + WebSocketPushQueue.size();
  103 + }
  104 +
  105 + @RequestMapping(value = "/setHttpFlag")
  106 + public void setHttpFlag(@RequestParam int flag) {
  107 + if (flag != 0 && flag != -1)
  108 + return;
  109 + GpsDataLoaderThread.setFlag(flag);
  110 + }
  111 +
  112 + @RequestMapping(value = "/updateCacheBuff")
  113 + public void updateCacheBuff() {
  114 + geoCacheData.loadData();
  115 + }
  116 +
  117 + @RequestMapping(value = "/reCalcLpSch")
  118 + public void reCalcLpSch() {
  119 + dayOfSchedule._test_reCalcLpSch();
  120 + }
  121 +
  122 + @RequestMapping(value = "/findSchByLpName")
  123 + public List<ScheduleRealInfo> findSchByLpName(@RequestParam String lpName) {
  124 + return dayOfSchedule.getLpScheduleMap().get(lpName);
  125 + }
  126 +
  127 + @RequestMapping(value = "/findSchByNbbm")
  128 + public List<ScheduleRealInfo> findSchByNbbm(@RequestParam String nbbm) {
  129 + return dayOfSchedule.findByNbbm(nbbm);
  130 + }
  131 +
  132 + @RequestMapping(value = "/executeCurr")
  133 + public ScheduleRealInfo executeCurr(@RequestParam String nbbm) {
  134 + return dayOfSchedule.executeCurr(nbbm);
  135 + };
  136 +
  137 + @RequestMapping(value = "/reCalcExecPlan4Nbbm")
  138 + public void reCalcExecPlan4Nbbm(@RequestParam String nbbm) {
  139 + dayOfSchedule.reCalcExecPlan(nbbm);
  140 + };
  141 +
  142 + @RequestMapping(value = "/reCalcExecPlan4Line")
  143 + public void reCalcExecPlan4Line(@RequestParam String lineCode) {
  144 + Set<String> nbbms = dayOfSchedule.findCarByLineCode(lineCode);
  145 + for (String nbbm : nbbms) {
  146 + dayOfSchedule.reCalcExecPlan(nbbm);
  147 + }
  148 + };
  149 +
  150 + @RequestMapping(value = "/removeExecPlan")
  151 + public int removeExecPlan(@RequestParam String nbbm) {
  152 + dayOfSchedule.removeExecPlan(nbbm);
  153 + return 1;
  154 + }
  155 +
  156 + @RequestMapping(value = "/sch_re_calc_id_maps")
  157 + public int reCalcIdMaps() {
  158 + return dayOfSchedule.reCalcIdMaps();
  159 + }
  160 +
  161 + @RequestMapping(value = "/sch_size_string")
  162 + public String schSizeString() {
  163 + return dayOfSchedule.sizeString();
  164 + }
  165 +
  166 + @RequestMapping(value = "/containerSize")
  167 + public Map<String, Integer> containerSize() {
  168 + Map<String, Integer> rs = new HashMap<>();
  169 + rs.put("60_size", dayOfDirectives.all60().size());
  170 + rs.put("80_size", pilotReport.findAll().size());
  171 + rs.put("nbbm_sch_size", dayOfSchedule.findAll().size());
  172 + rs.put("lp_sch_size", dayOfSchedule.findAllByLpContainer().size());
  173 + rs.put("id_sch_size", dayOfSchedule.findAllByIdContainer().size());
  174 + rs.put("pst_sch_size", dayOfSchedule.getPstSize());
  175 + rs.put("speeds_size", OverspeedProcess.size());
  176 + return rs;
  177 + }
  178 +
  179 + @RequestMapping(value = "/websocketRadioText")
  180 + public int radioText(String t, String lineCode) {
  181 + sendUtils.sendRadioText(t, lineCode);
  182 + return 0;
  183 + }
  184 +
  185 + @Autowired
  186 + DirectivesPstThread directivesPstThread;
  187 +
  188 + @RequestMapping(value = "/_sd_60_pst")
  189 + public void sd_60_pst() {
  190 + logger.info("手动入库指令....");
  191 + directivesPstThread.run();
  192 + }
  193 +
  194 + @RequestMapping("/changeLogLevel")
  195 + public Map<String, Object> changeLogLevel(@RequestParam String level) {
  196 + Map<String, Object> rs = new HashMap<>();
  197 + rs.put("errCode", 1);
  198 + LoggerContext context = (LoggerContext)LoggerFactory.getILoggerFactory();
  199 + context.getLogger("root").setLevel(Level.toLevel(level));
  200 + rs.put("errCode", 0);
  201 + rs.put("errMsg", "成功");
  202 +
  203 + return rs;
  204 + }
  205 +
  206 + @RequestMapping("/refreshBasicAll")
  207 + public String refreshBasicAll() {
  208 + Map<String, Object> result = new HashMap<>();
  209 + try {
  210 + basicDataLoader.loadAllData();
  211 + return "success";
  212 + } catch (Exception e) {
  213 + e.printStackTrace();
  214 + }
  215 +
  216 + return "error";
  217 + }
  218 +
  219 + @RequestMapping("/reloadSystemParam")
  220 + public String reloadSystemParam() {
  221 + Map<String, Object> result = new HashMap<>();
  222 + try {
  223 + basicDataLoader.loadSystemParam();
  224 + return "success";
  225 + } catch (Exception e) {
  226 + e.printStackTrace();
  227 + }
  228 +
  229 + return "error";
  230 + }
164 } 231 }
165 \ No newline at end of file 232 \ No newline at end of file
src/main/java/com/bsth/controller/realcontrol/RealMapController.java
1 -package com.bsth.controller.realcontrol;  
2 -  
3 -import com.bsth.service.realcontrol.RealMapService;  
4 -import org.springframework.beans.factory.annotation.Autowired;  
5 -import org.springframework.web.bind.annotation.RequestMapping;  
6 -import org.springframework.web.bind.annotation.RequestParam;  
7 -import org.springframework.web.bind.annotation.RestController;  
8 -  
9 -import java.util.Map;  
10 -  
11 -/**  
12 - * 线调 地图监控相关  
13 - * Created by panzhao on 2016/11/23.  
14 - */  
15 -@RestController  
16 -@RequestMapping("realMap")  
17 -public class RealMapController {  
18 -  
19 - @Autowired  
20 - RealMapService realMapService;  
21 -  
22 - /**  
23 - * 根据线路获取站点路由及空间数据  
24 - */  
25 - @RequestMapping(value = "/stationSpatialData")  
26 - public Map<String, Object> stationSpatialData(@RequestParam String idx) {  
27 - return realMapService.stationSpatialData(idx);  
28 - }  
29 -  
30 - /**  
31 - * 停车场  
32 - *  
33 - * @return  
34 - */  
35 - @RequestMapping(value = "/carParkSpatialData")  
36 - public Map<String, Object> carParkSpatialData() {  
37 - return realMapService.carParkSpatialData();  
38 - }  
39 -  
40 -  
41 - /**  
42 - * @param @param lineCode  
43 - * @throws  
44 - * @Title: findRouteByLine  
45 - * @Description: TODO(获取线路的站点,路段路由)  
46 - */  
47 - @RequestMapping(value = "/findRouteByLine")  
48 - public Map<String, Object> findRouteByLine(@RequestParam String idx) {  
49 - return realMapService.findRouteByLine(idx);  
50 - }  
51 -  
52 - @RequestMapping(value = "/multiRouteByLine")  
53 - public Map<String, Object> multiRouteByLine(@RequestParam String codeStr) {  
54 - return realMapService.multiRouteByLine(codeStr);  
55 - }  
56 -  
57 -  
58 - /**  
59 - * 获取线路的路段路由 和 站点路由信息 (为前端站间距计算提供数据源)  
60 - * @param lineCode  
61 - * @return  
62 - */  
63 - @RequestMapping(value = "/findRouteAndStationByLine")  
64 - public Map<String, Object> findRouteAndStationByLine(@RequestParam String lineCode){  
65 - return realMapService.findRouteAndStationByLine(lineCode);  
66 - }  
67 -  
68 - /**  
69 - * 获取多个线路的路段信息(为前端越界计算提供数据)  
70 - * @param codeIdx  
71 - * @return  
72 - */  
73 - @RequestMapping(value = "/multiSectionRoute")  
74 - public Map<String, Object> multiSectionRoute(@RequestParam String codeIdx){  
75 - return realMapService.multiSectionRoute(codeIdx);  
76 - }  
77 -} 1 +package com.bsth.controller.realcontrol;
  2 +
  3 +import com.bsth.service.realcontrol.RealMapService;
  4 +import org.springframework.beans.factory.annotation.Autowired;
  5 +import org.springframework.web.bind.annotation.RequestMapping;
  6 +import org.springframework.web.bind.annotation.RequestParam;
  7 +import org.springframework.web.bind.annotation.RestController;
  8 +
  9 +import java.util.Map;
  10 +
  11 +/**
  12 + * 线调 地图监控相关
  13 + * Created by panzhao on 2016/11/23.
  14 + */
  15 +@RestController
  16 +@RequestMapping("realMap")
  17 +public class RealMapController {
  18 +
  19 + @Autowired
  20 + RealMapService realMapService;
  21 +
  22 + /**
  23 + * 根据线路获取站点路由及空间数据
  24 + */
  25 + @RequestMapping(value = "/stationSpatialData")
  26 + public Map<String, Object> stationSpatialData(@RequestParam String idx) {
  27 + return realMapService.stationSpatialData(idx);
  28 + }
  29 +
  30 + @RequestMapping(value = "/stationVersionSpatialData")
  31 + public Map<String, Object> stationVersionSpatialData(@RequestParam String idx) {
  32 + return realMapService.stationVersionSpatialData(idx);
  33 + }
  34 +
  35 + /**
  36 + * 停车场
  37 + *
  38 + * @return
  39 + */
  40 + @RequestMapping(value = "/carParkSpatialData")
  41 + public Map<String, Object> carParkSpatialData() {
  42 + return realMapService.carParkSpatialData();
  43 + }
  44 +
  45 +
  46 + /**
  47 + * @param @param lineCode
  48 + * @throws
  49 + * @Title: findRouteByLine
  50 + * @Description: TODO(获取线路的站点,路段路由)
  51 + */
  52 + @RequestMapping(value = "/findRouteByLine")
  53 + public Map<String, Object> findRouteByLine(@RequestParam String idx) {
  54 + return realMapService.findRouteByLine(idx);
  55 + }
  56 +
  57 +
  58 + @RequestMapping(value = "/findRouteAndVersionByLine")
  59 + public Map<String, Object> findRouteByLineAndVersion(@RequestParam String idx) {
  60 + return realMapService.findRouteAndVersionByLine(idx);
  61 + }
  62 +
  63 + @RequestMapping(value = "/multiRouteByLine")
  64 + public Map<String, Object> multiRouteByLine(@RequestParam String codeStr) {
  65 + return realMapService.multiRouteByLine(codeStr);
  66 + }
  67 +
  68 +
  69 + /**
  70 + * 获取线路的路段路由 和 站点路由信息 (为前端站间距计算提供数据源)
  71 + * @param lineCode
  72 + * @return
  73 + */
  74 + @RequestMapping(value = "/findRouteAndStationByLine")
  75 + public Map<String, Object> findRouteAndStationByLine(@RequestParam String lineCode){
  76 + return realMapService.findRouteAndStationByLine(lineCode);
  77 + }
  78 +
  79 + /**
  80 + * 获取多个线路的路段信息(为前端越界计算提供数据)
  81 + * @param codeIdx
  82 + * @return
  83 + */
  84 + @RequestMapping(value = "/multiSectionRoute")
  85 + public Map<String, Object> multiSectionRoute(@RequestParam String codeIdx){
  86 + return realMapService.multiSectionRoute(codeIdx);
  87 + }
  88 +}
src/main/java/com/bsth/controller/schedule/TrafficManageController.java
1 -package com.bsth.controller.schedule;  
2 -  
3 -import com.bsth.service.TrafficManageService;  
4 -  
5 -import org.springframework.beans.factory.annotation.Autowired;  
6 -import org.springframework.web.bind.annotation.RequestMapping;  
7 -import org.springframework.web.bind.annotation.RequestMethod;  
8 -import org.springframework.web.bind.annotation.RequestParam;  
9 -import org.springframework.web.bind.annotation.RestController;  
10 -  
11 -/**  
12 - *  
13 - * @author BSTH  
14 - *  
15 - */  
16 -@RestController  
17 -@RequestMapping("trmg")  
18 -public class TrafficManageController {  
19 -  
20 - @Autowired  
21 - private TrafficManageService trManageService;  
22 -  
23 -  
24 - @RequestMapping(value = "/setXL", method = RequestMethod.GET)  
25 - public String setXL(@RequestParam("ids") String ids) throws Exception {  
26 - try {  
27 - return trManageService.setXL(ids);  
28 - } catch (Exception exp) {  
29 - throw new Exception(exp.getCause());  
30 - }  
31 - }  
32 -  
33 - @RequestMapping(value = "/setXLByInUse", method = RequestMethod.GET)  
34 - public String setXLByInUse(@RequestParam("inUse") String inUse) throws Exception {  
35 - try {  
36 - return trManageService.setXLByInUse(inUse);  
37 - } catch (Exception exp) {  
38 - throw new Exception(exp.getCause());  
39 - }  
40 - }  
41 -  
42 - @RequestMapping(value = "/setCL", method = RequestMethod.GET)  
43 - public String setCL() throws Exception {  
44 - try {  
45 - return trManageService.setCL();  
46 - } catch (Exception exp) {  
47 - throw new Exception(exp.getCause());  
48 - }  
49 - }  
50 -  
51 - @RequestMapping(value = "/setSJ", method = RequestMethod.GET)  
52 - public String setSJ() throws Exception {  
53 - try {  
54 - return trManageService.setSJ();  
55 - } catch (Exception exp) {  
56 - throw new Exception(exp.getCause());  
57 - }  
58 - }  
59 -  
60 - @RequestMapping(value = "/setLD", method = RequestMethod.GET)  
61 - public String setLD() throws Exception {  
62 - try {  
63 - return trManageService.setLD();  
64 - } catch (Exception exp) {  
65 - throw new Exception(exp.getCause());  
66 - }  
67 - }  
68 -  
69 - @RequestMapping(value = "/setLDByDate", method = RequestMethod.GET)  
70 - public String setLDByDate(@RequestParam("theDate") String theDate) throws Exception {  
71 - try {  
72 - return trManageService.setLD(theDate);  
73 - } catch (Exception exp) {  
74 - throw new Exception(exp.getCause());  
75 - }  
76 - }  
77 -  
78 - @RequestMapping(value = "/setLDFile", method = RequestMethod.GET)  
79 - public String setLDFile() throws Exception {  
80 - try {  
81 - return trManageService.setLDFile();  
82 - } catch (Exception exp) {  
83 - throw new Exception(exp.getCause());  
84 - }  
85 - }  
86 -  
87 - @RequestMapping(value = "/setLCYH", method = RequestMethod.GET)  
88 - public String setLCYH() throws Exception {  
89 - try {  
90 - return trManageService.setLCYH();  
91 - } catch (Exception exp) {  
92 - throw new Exception(exp.getCause());  
93 - }  
94 - }  
95 -  
96 - @RequestMapping(value = "/setDDRB", method = RequestMethod.GET)  
97 - public String setDDRB() throws Exception {  
98 - try {  
99 - return trManageService.setDDRB();  
100 - } catch (Exception exp) {  
101 - throw new Exception(exp.getCause());  
102 - }  
103 - }  
104 -  
105 - @RequestMapping(value = "/setJHBC", method = RequestMethod.GET)  
106 - public String setJHBC() throws Exception {  
107 - try {  
108 - return trManageService.setJHBC();  
109 - } catch (Exception exp) {  
110 - throw new Exception(exp.getCause());  
111 - }  
112 - }  
113 -  
114 - @RequestMapping(value = "/setJHBCByDate", method = RequestMethod.GET)  
115 - public String setJHBCByDate(@RequestParam("theDate") String theDate) throws Exception {  
116 - try {  
117 - return trManageService.setJHBC(theDate);  
118 - } catch (Exception exp) {  
119 - throw new Exception(exp.getCause());  
120 - }  
121 - }  
122 -  
123 - @RequestMapping(value = "/setSKB", method = RequestMethod.GET)  
124 - public String setSKB(@RequestParam("ids") String ids) throws Exception {  
125 - try {  
126 - return trManageService.setSKB(ids);  
127 - } catch (Exception exp) {  
128 - throw new Exception(exp.getCause());  
129 - }  
130 - }  
131 -  
132 - @RequestMapping(value = "/setXLPC", method = RequestMethod.GET)  
133 - public String setXLPC() throws Exception {  
134 - try {  
135 - return trManageService.setXLPC();  
136 - } catch (Exception exp) {  
137 - throw new Exception(exp.getCause());  
138 - }  
139 - }  
140 -  
141 - @RequestMapping(value = "/setCS", method = RequestMethod.GET)  
142 - public String setCS() throws Exception {  
143 - try {  
144 - return trManageService.setCS();  
145 - } catch (Exception exp) {  
146 - throw new Exception(exp.getCause());  
147 - }  
148 - }  
149 -  
150 - @RequestMapping(value = "/getDownLoadAllDataFile", method = RequestMethod.GET)  
151 - public String getDownLoadAllDataFile() throws Exception {  
152 - try {  
153 - return trManageService.getDownLoadAllDataFile();  
154 - } catch (Exception exp) {  
155 - throw new Exception(exp.getCause());  
156 - }  
157 - }  
158 -  
159 -} 1 +package com.bsth.controller.schedule;
  2 +
  3 +import com.bsth.service.TrafficManageService;
  4 +
  5 +import org.springframework.beans.factory.annotation.Autowired;
  6 +import org.springframework.web.bind.annotation.RequestMapping;
  7 +import org.springframework.web.bind.annotation.RequestMethod;
  8 +import org.springframework.web.bind.annotation.RequestParam;
  9 +import org.springframework.web.bind.annotation.RestController;
  10 +
  11 +/**
  12 + *
  13 + * @author BSTH
  14 + *
  15 + */
  16 +@RestController
  17 +@RequestMapping("trmg")
  18 +public class TrafficManageController {
  19 +
  20 + @Autowired
  21 + private TrafficManageService trManageService;
  22 +
  23 +
  24 + @RequestMapping(value = "/setXL", method = RequestMethod.GET)
  25 + public String setXL(@RequestParam("ids") String ids) throws Exception {
  26 + try {
  27 + return trManageService.setXL(ids);
  28 + } catch (Exception exp) {
  29 + throw new Exception(exp.getCause());
  30 + }
  31 + }
  32 +
  33 + @RequestMapping(value = "/setXLByInUse", method = RequestMethod.GET)
  34 + public String setXLByInUse(@RequestParam("inUse") String inUse) throws Exception {
  35 + try {
  36 + return trManageService.setXLByInUse(inUse);
  37 + } catch (Exception exp) {
  38 + throw new Exception(exp.getCause());
  39 + }
  40 + }
  41 +
  42 + @RequestMapping(value = "/setCL", method = RequestMethod.GET)
  43 + public String setCL() throws Exception {
  44 + try {
  45 + return trManageService.setCL();
  46 + } catch (Exception exp) {
  47 + throw new Exception(exp.getCause());
  48 + }
  49 + }
  50 +
  51 + @RequestMapping(value = "/setSJ", method = RequestMethod.GET)
  52 + public String setSJ() throws Exception {
  53 + try {
  54 + return trManageService.setSJ();
  55 + } catch (Exception exp) {
  56 + throw new Exception(exp.getCause());
  57 + }
  58 + }
  59 +
  60 + @RequestMapping(value = "/setLD", method = RequestMethod.GET)
  61 + public String setLD() throws Exception {
  62 + try {
  63 + return trManageService.setLD();
  64 + } catch (Exception exp) {
  65 + throw new Exception(exp.getCause());
  66 + }
  67 + }
  68 +
  69 + @RequestMapping(value = "/setLDByDate", method = RequestMethod.GET)
  70 + public String setLDByDate(@RequestParam("theDate") String theDate) throws Exception {
  71 + try {
  72 + return trManageService.setLD(theDate);
  73 + } catch (Exception exp) {
  74 + throw new Exception(exp.getCause());
  75 + }
  76 + }
  77 +
  78 + @RequestMapping(value = "/setLDFile", method = RequestMethod.GET)
  79 + public String setLDFile() throws Exception {
  80 + try {
  81 + return trManageService.setLDFile();
  82 + } catch (Exception exp) {
  83 + throw new Exception(exp.getCause());
  84 + }
  85 + }
  86 +
  87 + @RequestMapping(value = "/setLCYH", method = RequestMethod.GET)
  88 + public String setLCYH() throws Exception {
  89 + try {
  90 + return trManageService.setLCYH();
  91 + } catch (Exception exp) {
  92 + throw new Exception(exp.getCause());
  93 + }
  94 + }
  95 +
  96 + @RequestMapping(value = "/setDDRB", method = RequestMethod.GET)
  97 + public String setDDRB() throws Exception {
  98 + try {
  99 + return trManageService.setDDRB();
  100 + } catch (Exception exp) {
  101 + throw new Exception(exp.getCause());
  102 + }
  103 + }
  104 +
  105 + @RequestMapping(value = "/setJHBC", method = RequestMethod.GET)
  106 + public String setJHBC() throws Exception {
  107 + try {
  108 + return trManageService.setJHBC();
  109 + } catch (Exception exp) {
  110 + throw new Exception(exp.getCause());
  111 + }
  112 + }
  113 +
  114 + @RequestMapping(value = "/setJHBCByDate", method = RequestMethod.GET)
  115 + public String setJHBCByDate(@RequestParam("theDate") String theDate) throws Exception {
  116 + try {
  117 + return trManageService.setJHBC(theDate);
  118 + } catch (Exception exp) {
  119 + throw new Exception(exp.getCause());
  120 + }
  121 + }
  122 +
  123 + @RequestMapping(value = "/setSKB", method = RequestMethod.GET)
  124 + public String setSKB(@RequestParam("ids") String ids, @RequestParam("qyrqs") String qyrqs) throws Exception {
  125 + try {
  126 + return trManageService.setSKB(ids, qyrqs);
  127 + } catch (Exception exp) {
  128 + throw new Exception(exp.getCause());
  129 + }
  130 + }
  131 +
  132 + @RequestMapping(value = "/setXLPC", method = RequestMethod.GET)
  133 + public String setXLPC() throws Exception {
  134 + try {
  135 + return trManageService.setXLPC();
  136 + } catch (Exception exp) {
  137 + throw new Exception(exp.getCause());
  138 + }
  139 + }
  140 +
  141 + @RequestMapping(value = "/setCS", method = RequestMethod.GET)
  142 + public String setCS() throws Exception {
  143 + try {
  144 + return trManageService.setCS();
  145 + } catch (Exception exp) {
  146 + throw new Exception(exp.getCause());
  147 + }
  148 + }
  149 +
  150 + @RequestMapping(value = "/getDownLoadAllDataFile", method = RequestMethod.GET)
  151 + public String getDownLoadAllDataFile() throws Exception {
  152 + try {
  153 + return trManageService.getDownLoadAllDataFile();
  154 + } catch (Exception exp) {
  155 + throw new Exception(exp.getCause());
  156 + }
  157 + }
  158 +
  159 +}