Commit 5cb3584e507fe4f60ee2b903ede32f4e7b3f41fc

Authored by lizhuojun
2 parents 6303b954 a65a6883

线调更新

Too many changes to show.

To preserve performance only 22 of 32 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 -| daysYear | int | 对应年中的天数 为分区字段 查询一定要用此字段过滤 |  
451 - 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 +
src/main/java/com/bsth/controller/realcontrol/ScheduleRealInfoController.java
1 -package com.bsth.controller.realcontrol;  
2 -  
3 -import java.io.ByteArrayOutputStream;  
4 -import java.io.IOException;  
5 -import java.io.InputStream;  
6 -import java.io.OutputStream;  
7 -import java.net.HttpURLConnection;  
8 -import java.net.URL;  
9 -import java.util.ArrayList;  
10 -import java.util.Collection;  
11 -import java.util.HashMap;  
12 -import java.util.List;  
13 -import java.util.Map;  
14 -  
15 -import org.apache.commons.io.IOUtils;  
16 -import org.apache.commons.lang3.StringEscapeUtils;  
17 -import org.joda.time.format.DateTimeFormat;  
18 -import org.joda.time.format.DateTimeFormatter;  
19 -import org.springframework.beans.factory.annotation.Autowired;  
20 -import org.springframework.web.bind.annotation.PathVariable;  
21 -import org.springframework.web.bind.annotation.RequestMapping;  
22 -import org.springframework.web.bind.annotation.RequestMethod;  
23 -import org.springframework.web.bind.annotation.RequestParam;  
24 -import org.springframework.web.bind.annotation.RestController;  
25 -  
26 -import com.alibaba.fastjson.JSONArray;  
27 -import com.bsth.common.ResponseCode;  
28 -import com.bsth.controller.BaseController;  
29 -import com.bsth.controller.realcontrol.dto.ChangePersonCar;  
30 -import com.bsth.controller.realcontrol.dto.DfsjChange;  
31 -import com.bsth.data.BasicData;  
32 -import com.bsth.data.schedule.DayOfSchedule;  
33 -import com.bsth.data.schedule.edit_logs.service.dto.SchEditInfoDto;  
34 -import com.bsth.entity.realcontrol.ScheduleRealInfo;  
35 -import com.bsth.entity.schedule.SchedulePlanInfo;  
36 -import com.bsth.entity.sys.SysUser;  
37 -import com.bsth.security.util.SecurityUtils;  
38 -import com.bsth.service.realcontrol.ScheduleRealInfoService;  
39 -import com.bsth.util.ConfigUtil;  
40 -import com.fasterxml.jackson.databind.ObjectMapper;  
41 -  
42 -@RestController  
43 -@RequestMapping("/realSchedule")  
44 -public class ScheduleRealInfoController extends BaseController<ScheduleRealInfo, Long> {  
45 -  
46 - @Autowired  
47 - ScheduleRealInfoService scheduleRealInfoService;  
48 -  
49 - @Autowired  
50 - DayOfSchedule dayOfSchedule;  
51 -  
52 - @RequestMapping(value = "check_fgs_ascription", method = RequestMethod.POST)  
53 - public Map<String, Object> checkPCFgsAscription(@RequestParam Long schId, String jGh, String sGh, String nbbm){  
54 - return scheduleRealInfoService.checkPCFgsAscription(schId, jGh, sGh, nbbm);  
55 - }  
56 -  
57 - @RequestMapping(value = "/lines")  
58 - public Map<String, Collection<ScheduleRealInfo>> findByLines(@RequestParam String lines) {  
59 - return scheduleRealInfoService.findByLines(lines);  
60 - }  
61 -  
62 - @RequestMapping(value = "/car")  
63 - public List<ScheduleRealInfo> findByCar(String nbbm){  
64 - return dayOfSchedule.findByNbbm(nbbm);  
65 - }  
66 -  
67 - /**  
68 - *  
69 - * @Title: outgoAdjust @Description: TODO(待发调整) @param @param id  
70 - * 主键 @param @param remarks 备注 @param @param dfsj 待发时间(HH:mm) @throws  
71 - */  
72 - @RequestMapping(value = "/outgoAdjust", method = RequestMethod.POST)  
73 - public Map<String, Object> outgoAdjust(@RequestParam Long id, @RequestParam String remarks,  
74 - @RequestParam String dfsj,String bcType,  
75 - @RequestParam(defaultValue = "") String opType) {  
76 - return scheduleRealInfoService.outgoAdjust(id, remarks, dfsj, bcType, opType, null);  
77 - }  
78 -  
79 - /**  
80 - *  
81 - * @Title: destroy @Description: TODO(销毁,烂班) @param @param idsStr 要烂掉的班次ID ,分隔  
82 - */  
83 - @RequestMapping(value = "/destroy", method = RequestMethod.POST)  
84 - public Map<String, Object> destroy(@RequestParam String idsStr  
85 - /*, @RequestParam(defaultValue = "-1") int spaceAdjust*/,  
86 - @RequestParam String remarks, @RequestParam String adjustExps/*, @RequestParam(defaultValue = "0") int spaceNum*/) {  
87 - return scheduleRealInfoService.destroy(idsStr, remarks, adjustExps, null);  
88 - }  
89 -  
90 - /**  
91 - *  
92 - * @Title: carDeviceMapp @Description: TODO(获取车辆自编号和设备号对照,从缓存取) @throws  
93 - */  
94 - @RequestMapping(value = "/carDeviceMapp", method = RequestMethod.GET)  
95 - public Map<String, String> carDeviceMapp() {  
96 - return BasicData.deviceId2NbbmMap.inverse();  
97 - }  
98 -  
99 - /**  
100 - *  
101 - * @Title: findPersionByLine @Description: TODO(根据线路主键获取驾驶员) @param @param  
102 - * lineId @throws  
103 - */  
104 - @RequestMapping(value = "/driver", method = RequestMethod.GET)  
105 - public List<Map<String, String>> findDriverByLine(@RequestParam String lineCode) {  
106 - return scheduleRealInfoService.findDriverByLine(lineCode);  
107 - }  
108 -  
109 - /**  
110 - *  
111 - * @Title: findPersionByLine @Description: TODO(根据线路主键获取售票员) @param @param  
112 - * lineId @throws  
113 - */  
114 - @RequestMapping(value = "/conductor", method = RequestMethod.GET)  
115 - public List<Map<String, String>> findConductorByLine(@RequestParam String lineCode) {  
116 - return scheduleRealInfoService.findConductorByLine(lineCode);  
117 - }  
118 -  
119 - /**  
120 - *  
121 - * @Title: findPersionByLine @Description: TODO(根据线路主键获取车辆) @param @param  
122 - * lineId @throws  
123 - */  
124 - @RequestMapping(value = "/cars", method = RequestMethod.GET)  
125 - public List<Map<String, String>> findCarByLine(@RequestParam String lineCode) {  
126 - return scheduleRealInfoService.findCarByLine(lineCode);  
127 - }  
128 -  
129 - /**  
130 - *  
131 - * @Title: sreachNbbm @Description: TODO(搜索车辆内部编码) @throws  
132 - */  
133 - @RequestMapping(value = "/sreachVehic", method = RequestMethod.GET)  
134 - public List<Map<String, String>> sreachVehic(@RequestParam String nbbm) {  
135 - return scheduleRealInfoService.sreachVehic(nbbm);  
136 - }  
137 - /**  
138 - *  
139 - * @Title: realOutAdjust  
140 - * @Description: TODO(实发调整)  
141 - * @param @param id 班次ID  
142 - * @param @param fcsjActual 实际发车时间 HH:mm  
143 - * @param @param remarks 备注  
144 - * @throws  
145 - */  
146 - @RequestMapping(value = "/realOutAdjust", method = RequestMethod.POST)  
147 - public Map<String, Object> realOutAdjust(@RequestParam Long id, @RequestParam String fcsjActual,  
148 - @RequestParam String remarks) {  
149 - return scheduleRealInfoService.realOutAdjust(id, fcsjActual, remarks);  
150 - }  
151 -  
152 - /**  
153 - *  
154 - * @Title: revokeDestroy  
155 - * @Description: TODO(撤销烂班)  
156 - * @param @param id  
157 - * @throws  
158 - */  
159 - @RequestMapping(value = "/revokeDestroy", method = RequestMethod.POST)  
160 - public Map<String, Object> revokeDestroy(@RequestParam Long id){  
161 - return scheduleRealInfoService.revokeDestroy(id);  
162 - }  
163 -  
164 - /**  
165 - *  
166 - * @Title: revokeRealOutgo  
167 - * @Description: TODO(撤销实发)  
168 - * @param @param id  
169 - * @throws  
170 - */  
171 - @RequestMapping(value = "/revokeRealOutgo", method = RequestMethod.POST)  
172 - public Map<String, Object> revokeRealOutgo(@RequestParam Long id){  
173 - return scheduleRealInfoService.revokeRealOutgo(id);  
174 - }  
175 -  
176 - /**  
177 - * 撤销执行  
178 - * @param id  
179 - * @return  
180 - */  
181 - @RequestMapping(value = "/revokeRealArrive", method = RequestMethod.POST)  
182 - public Map<String, Object> revokeRealArrive(@RequestParam Long id){  
183 - return scheduleRealInfoService.revokeRealArrive(id);  
184 - }  
185 -  
186 - /**  
187 - *  
188 - * @Title: spaceAdjust  
189 - * @Description: TODO(间隔调整)  
190 - * @param @param ids 要调整的班次数组ID  
191 - * @param @param space 间隔  
192 - * @throws  
193 - */  
194 - @RequestMapping(value = "/spaceAdjust", method = RequestMethod.POST)  
195 - public Map<String, Object> spaceAdjust(Long[] ids, Integer space){  
196 - return scheduleRealInfoService.spaceAdjust(ids, space);  
197 - }  
198 -  
199 - /**  
200 - *  
201 - * @Title: schInfoFineTune  
202 - * @Description: TODO(发车信息微调)  
203 - * @param @param map  
204 - * @throws  
205 - */  
206 - @RequestMapping(value = "/schInfoFineTune", method = RequestMethod.POST)  
207 - public Map<String, Object> schInfoFineTune(@RequestParam Map<String, String> map){  
208 - return scheduleRealInfoService.schInfoFineTune(map);  
209 - }  
210 -  
211 - /**  
212 - *  
213 - * @Title: outgoAdjustAll  
214 - * @Description: TODO(批量待发调整)  
215 - * @param @param list  
216 - * @throws  
217 - */  
218 - @RequestMapping(value = "/outgoAdjustAll", method = RequestMethod.POST)  
219 - public Map<String, Object> outgoAdjustAll(@RequestParam String params){  
220 - //反转义  
221 - params = StringEscapeUtils.unescapeHtml4(params);  
222 - return scheduleRealInfoService.outgoAdjustAll(params);  
223 - }  
224 -  
225 - /**  
226 - *  
227 - * @Title: findByLineAndUpDown  
228 - * @Description: TODO(根据线路和走向获取班次)  
229 - * @param @param line  
230 - * @param @param upDown  
231 - */  
232 - @RequestMapping(value = "/findByLineAndUpDown")  
233 - public List<ScheduleRealInfo> findByLineAndUpDown(@RequestParam String line,@RequestParam Integer upDown){  
234 - return dayOfSchedule.findByLineAndUpDown(line, upDown);  
235 - }  
236 -  
237 - /**  
238 - *  
239 - * @Title: findRouteByLine  
240 - * @Description: TODO(获取线路的站点,路段路由)  
241 - * @param @param lineCode  
242 - * @throws  
243 - */  
244 - @RequestMapping(value = "/findRouteByLine")  
245 - public Map<String, Object> findRouteByLine(@RequestParam String lineCode){  
246 - return scheduleRealInfoService.findRouteByLine(lineCode);  
247 - }  
248 -  
249 - /**  
250 - *  
251 - * @Title: removeChildTask  
252 - * @Description: TODO(删除子任务)  
253 - * @param @param taskId 子任务ID  
254 - * @throws  
255 - */  
256 - @RequestMapping(value = "/childTask/{taskId}", method = RequestMethod.DELETE)  
257 - public Map<String, Object> removeChildTask(@PathVariable("taskId") Long taskId){  
258 - return scheduleRealInfoService.removeChildTask(taskId);  
259 - }  
260 -  
261 - /**  
262 - *  
263 - * @Title: findByLineCode  
264 - * @Description: TODO(根据线路获取班次信息)  
265 - * @param @param lineCode  
266 - */  
267 - @RequestMapping(value = "/lineCode/{lineCode}")  
268 - public List<ScheduleRealInfo> findByLineCode(@PathVariable("lineCode") String lineCode){  
269 - return dayOfSchedule.findByLineCode(lineCode);  
270 - }  
271 -  
272 - @RequestMapping(value = "/queryUserInfo")  
273 - public List<ScheduleRealInfo> queryUserInfo(@RequestParam String line,  
274 - @RequestParam String date,@RequestParam String state) {  
275 - return scheduleRealInfoService.queryUserInfo(line, date,state);  
276 - }  
277 -  
278 - @RequestMapping(value = "/queryUserInfoPx")  
279 - public List<ScheduleRealInfo> queryUserInfoPx(@RequestParam String line,  
280 - @RequestParam String date,@RequestParam String state,@RequestParam String type) {  
281 - return scheduleRealInfoService.queryUserInfoPx(line, date,state,type);  
282 - }  
283 -  
284 - @RequestMapping(value = "/exportWaybill",method = RequestMethod.GET)  
285 - public List<ScheduleRealInfo> exportWaybill(@RequestParam String jName, @RequestParam String clZbh,  
286 - @RequestParam String lpName,@RequestParam String date,@RequestParam String line) {  
287 - return scheduleRealInfoService.exportWaybill(jName, clZbh, lpName,date,line);  
288 - }  
289 -  
290 - @RequestMapping(value = "/exportWaybillQp",method = RequestMethod.GET)  
291 - public List<ScheduleRealInfo> exportWaybillQp(@RequestParam String clZbh  
292 - ,@RequestParam String date,@RequestParam String line) {  
293 - return scheduleRealInfoService.exportWaybillQp( clZbh, date,line);  
294 - }  
295 -  
296 -  
297 - @RequestMapping(value = "/dailyInfo")  
298 - public List<Map<String, Object>> dailyInfo(@RequestParam String line, @RequestParam String date,@RequestParam String type) {  
299 - return scheduleRealInfoService.dailyInfo(line, date, type);  
300 - }  
301 -  
302 - @RequestMapping(value = "/historyMessage")  
303 - public List<Object[]> historyMessage(@RequestParam String line, @RequestParam String date,  
304 - @RequestParam String code, @RequestParam String type) {  
305 - return scheduleRealInfoService.historyMessage(line, date, code, type);  
306 - }  
307 -  
308 - @RequestMapping(value="/findLine")  
309 - public List<Map<String,String>> findLine(@RequestParam String line){  
310 - return scheduleRealInfoService.findLine(line);  
311 - }  
312 -  
313 - @RequestMapping(value="/findKMBC",method = RequestMethod.GET)  
314 - public Map<String,Object> findKMBC(@RequestParam String jGh,@RequestParam String clZbh,@RequestParam String lpName  
315 - ,@RequestParam String date,@RequestParam String line){  
316 - return scheduleRealInfoService.findKMBC(jGh, clZbh,lpName,date,line);  
317 - }  
318 -  
319 - /**  
320 - * 路单公里统计 (闵行审计专用)  
321 - * @param jGh  
322 - * @param clZbh  
323 - * @param lpName  
324 - * @param date  
325 - * @param line  
326 - * @return  
327 - */  
328 - @RequestMapping(value="/findKMBC_mh_2",method = RequestMethod.GET)  
329 - public Map<String,Object> findKMBC_mh_2(@RequestParam String jGh,@RequestParam String clZbh,@RequestParam String lpName  
330 - ,@RequestParam String date,@RequestParam String line){  
331 - return scheduleRealInfoService.findKMBC_mh_2(jGh, clZbh,lpName,date,line);  
332 - }  
333 -  
334 - @RequestMapping(value="/findKMBCQp",method = RequestMethod.GET)  
335 - public Map<String,Object> findKMBCQp(@RequestParam String clZbh  
336 - ,@RequestParam String date,@RequestParam String line){  
337 - return scheduleRealInfoService.findKMBCQp(clZbh,date,line);  
338 - }  
339 -  
340 - @RequestMapping(value="/findLpName")  
341 - public List<Map<String,String>> findLpName(@RequestParam String lpName){  
342 - return scheduleRealInfoService.findLpName(lpName);  
343 - }  
344 -  
345 - @RequestMapping(value = "/account")  
346 - public List<Map<String,Object>> account(@RequestParam String line, @RequestParam String date,  
347 - @RequestParam String code,@RequestParam String xlName, @RequestParam String type) {  
348 - return scheduleRealInfoService.account(line, date, code, xlName, type);  
349 - }  
350 -  
351 - @RequestMapping(value = "/accountPx")  
352 - public List<Map<String,Object>> accountPx(@RequestParam String line, @RequestParam String date,  
353 - @RequestParam String code,@RequestParam String xlName, @RequestParam String px) {  
354 - return scheduleRealInfoService.accountPx(line, date, code, xlName, px);  
355 - }  
356 -  
357 - @RequestMapping(value = "/correctForm")  
358 - public List<SchEditInfoDto> correctForm(@RequestParam String line, @RequestParam String date,  
359 - @RequestParam String endDate,  
360 - @RequestParam String lpName, @RequestParam String code,  
361 - @RequestParam String type,@RequestParam String changType) {  
362 - return scheduleRealInfoService.correctForm(line, date, endDate, lpName, code, type,changType);  
363 - }  
364 - /**  
365 - * @Title queryListWaybill  
366 - * @Description 查询行车路单列表  
367 - * @param jName 驾驶员名字  
368 - * @param clZbh 车辆自编号(内部编号)  
369 - * @param lpName 路牌  
370 - * @return  
371 - */  
372 - @RequestMapping(value="/queryListWaybill",method = RequestMethod.GET)  
373 - public List<ScheduleRealInfo> queryListWaybill(@RequestParam String jName,@RequestParam String clZbh,@RequestParam String lpName  
374 - ,@RequestParam String date,@RequestParam String line){  
375 - return scheduleRealInfoService.queryListWaybill(jName, clZbh,lpName,date,line);  
376 - }  
377 -  
378 - /**  
379 - * @Title queryListWaybill  
380 - * @Description 查询行车路单列表(闵行审计专用路单)  
381 - * @param jName 驾驶员名字  
382 - * @param clZbh 车辆自编号(内部编号)  
383 - * @param lpName 路牌  
384 - * @return  
385 - */  
386 - @RequestMapping(value="/queryListWaybill_mh_2",method = RequestMethod.GET)  
387 - public List<ScheduleRealInfo> queryListWaybill_mh_2(@RequestParam String jName,@RequestParam String clZbh,@RequestParam String lpName  
388 - ,@RequestParam String date,@RequestParam String line){  
389 - return scheduleRealInfoService.queryListWaybill2(jName, clZbh,lpName,date,line);  
390 - }  
391 -  
392 - @RequestMapping(value="/queryListWaybillQp",method = RequestMethod.GET)  
393 - public List<ScheduleRealInfo> queryListWaybillQp(@RequestParam String clZbh,  
394 - @RequestParam String date,@RequestParam String line){  
395 - return scheduleRealInfoService.queryListWaybillQp(clZbh,date,line);  
396 - }  
397 -  
398 - @RequestMapping(value="/statisticsDaily")  
399 - public List<Map<String,Object>> statisticsDaily(@RequestParam String line, @RequestParam String date,  
400 - @RequestParam String xlName, @RequestParam String type){  
401 - return scheduleRealInfoService.statisticsDaily(line, date, xlName, type);  
402 - }  
403 -  
404 - @RequestMapping(value="/statisticsDaily_mh_2")  
405 - public List<Map<String,Object>> statisticsDaily_mh_2(@RequestParam String line, @RequestParam String date,  
406 - @RequestParam String xlName, @RequestParam String type){  
407 - return scheduleRealInfoService.statisticsDaily_mh_2(line, date, xlName, type);  
408 - }  
409 -  
410 - @RequestMapping(value="/statisticsDailyTj")  
411 - public List<Map<String,Object>> statisticsDailyTj(@RequestParam Map<String, Object> map){  
412 - String gsdm="";  
413 - if(map.get("gsdm")!=null){  
414 - gsdm=map.get("gsdm").toString();  
415 - }  
416 - String fgsdm="";  
417 - if(map.get("fgsdm")!=null){  
418 - fgsdm=map.get("fgsdm").toString();  
419 - }  
420 - String line="";  
421 - if(map.get("line")!=null){  
422 - line=map.get("line").toString();  
423 - }  
424 - String date="";  
425 - if(map.get("date")!=null){  
426 - date=map.get("date").toString();  
427 - }  
428 - String date2="";  
429 - if(map.get("date2")!=null){  
430 - date2=map.get("date2").toString();  
431 - }  
432 - String xlName="";  
433 - if(map.get("xlName")!=null){  
434 - xlName=map.get("xlName").toString();  
435 - }  
436 - String type="";  
437 - if(map.get("type")!=null){  
438 - type=map.get("type").toString();  
439 - }  
440 - String nature="0";  
441 - if(map.get("nature")!=null){  
442 - nature=map.get("nature").toString();  
443 - }  
444 - return scheduleRealInfoService.statisticsDailyTj(gsdm,fgsdm,line, date,date2, xlName, type,nature);  
445 - }  
446 -  
447 - /*  
448 - * 公里修正报表  
449 - */  
450 - @RequestMapping(value="/mileageReportTj")  
451 - public List<Map<String,Object>> mileageReport(@RequestParam Map<String, Object> map){  
452 - String gsdm="";  
453 - if(map.get("gsdm")!=null){  
454 - gsdm=map.get("gsdm").toString();  
455 - }  
456 - String fgsdm="";  
457 - if(map.get("fgsdm")!=null){  
458 - fgsdm=map.get("fgsdm").toString();  
459 - }  
460 - String line="";  
461 - if(map.get("line")!=null){  
462 - line=map.get("line").toString();  
463 - }  
464 - String date="";  
465 - if(map.get("date")!=null){  
466 - date=map.get("date").toString();  
467 - }  
468 - String date2="";  
469 - if(map.get("date2")!=null){  
470 - date2=map.get("date2").toString();  
471 - }  
472 - String xlName="";  
473 - if(map.get("xlName")!=null){  
474 - xlName=map.get("xlName").toString();  
475 - }  
476 - return scheduleRealInfoService.mileageReport(gsdm,fgsdm,line, date,date2);  
477 - }  
478 -  
479 - /*  
480 - * 班次修正报表  
481 - */  
482 - @RequestMapping(value="/scheduleCorrectionReport")  
483 - public List<Map<String,Object>> scheduleCorrectionReport(@RequestParam Map<String, Object> map){  
484 - String gsdm="";  
485 - if(map.get("gsdm")!=null){  
486 - gsdm=map.get("gsdm").toString();  
487 - }  
488 - String fgsdm="";  
489 - if(map.get("fgsdm")!=null){  
490 - fgsdm=map.get("fgsdm").toString();  
491 - }  
492 - String line="";  
493 - if(map.get("line")!=null){  
494 - line=map.get("line").toString();  
495 - }  
496 - String date="";  
497 - if(map.get("date")!=null){  
498 - date=map.get("date").toString();  
499 - }  
500 - String date2="";  
501 - if(map.get("date2")!=null){  
502 - date2=map.get("date2").toString();  
503 - }  
504 - String xlName="";  
505 - if(map.get("xlName")!=null){  
506 - xlName=map.get("xlName").toString();  
507 - }  
508 - return scheduleRealInfoService.scheduleCorrectionReport(gsdm,fgsdm,line, date,date2);  
509 - }  
510 -  
511 - @RequestMapping(value="/MapById",method = RequestMethod.GET)  
512 - public Map<String, Object> MapById(@RequestParam("id") Long id){  
513 - return scheduleRealInfoService.MapById(id);  
514 - }  
515 -  
516 - @RequestMapping(value="/MapByIdQp",method = RequestMethod.GET)  
517 - public Map<String, Object> MapByIdQp(@RequestParam("id") Long id){  
518 - return scheduleRealInfoService.MapByIdQp(id);  
519 - }  
520 -  
521 - /**  
522 - * @Title: scheduleDaily  
523 - * @Description: TODO(调度日报表)  
524 - * @param line 线路  
525 - * @param date 时间  
526 - * @return  
527 - */  
528 - @RequestMapping(value="/scheduleDaily")  
529 - public Map<String,Object> scheduleDaily(@RequestParam String line,@RequestParam String date){  
530 - return scheduleRealInfoService.scheduleDaily(line,date);  
531 - }  
532 -  
533 - @RequestMapping(value="/realScheduleList")  
534 - public List<ScheduleRealInfo> realScheduleList(@RequestParam String line,@RequestParam String date){  
535 - return scheduleRealInfoService.realScheduleList(line,date);  
536 - }  
537 -  
538 - @RequestMapping(value="/realScheduleList_zrw")  
539 - public List<ScheduleRealInfo> realScheduleList_zrw(@RequestParam String line,@RequestParam String date){  
540 - return scheduleRealInfoService.realScheduleList_zrw(line,date);  
541 - }  
542 -  
543 - @RequestMapping(value="/realScheduleList_mh_2")  
544 - public List<ScheduleRealInfo> realScheduleList_mh_2(@RequestParam String line,@RequestParam String date){  
545 - return scheduleRealInfoService.realScheduleList_mh_2(line,date);  
546 - }  
547 -  
548 - @RequestMapping(value="/realScheduleListQp")  
549 - public List<ScheduleRealInfo> realScheduleListQp(@RequestParam String line,@RequestParam String date){  
550 - return scheduleRealInfoService.realScheduleListQp(line,date);  
551 - }  
552 -  
553 - @RequestMapping(value="/multi_tzrc", method=RequestMethod.POST)  
554 - public Map<String, Object> multi_tzrc(@RequestParam String cpcsJson){  
555 - cpcsJson = StringEscapeUtils.unescapeHtml4(cpcsJson);  
556 - List<ChangePersonCar> cpcs = JSONArray.parseArray(cpcsJson, ChangePersonCar.class);  
557 - return scheduleRealInfoService.multi_tzrc(cpcs, null);  
558 - }  
559 -  
560 - @RequestMapping(value="/multi_dftz", method=RequestMethod.POST)  
561 - public Map<String, Object> multi_dftz(@RequestParam String dcsJson){  
562 - dcsJson = StringEscapeUtils.unescapeHtml4(dcsJson);  
563 - List<DfsjChange> dfsjcs = JSONArray.parseArray(dcsJson, DfsjChange.class);  
564 - return scheduleRealInfoService.multi_dftz(dfsjcs);  
565 - }  
566 -  
567 - @RequestMapping(value="/changeBcType/{id}", method=RequestMethod.POST)  
568 - public Map<String, Object> changeBcType(@PathVariable("id") Long id, String bcType, String remarks, String majorStationName){  
569 - return scheduleRealInfoService.changeBcType(id, bcType, remarks, majorStationName);  
570 - }  
571 -  
572 - @RequestMapping(value="/history", method=RequestMethod.POST)  
573 - public Map<String,Object> historySave(ScheduleRealInfo sch){  
574 - return scheduleRealInfoService.historySave(sch);  
575 - }  
576 -  
577 -  
578 - private static DateTimeFormatter fmtyyyyMMdd = DateTimeFormat.forPattern("yyyy-MM-dd");  
579 - private final static long ONE_DAY = 1000 * 60 * 60 * 24;  
580 - /**  
581 - * 获取可编辑的历史班次日期  
582 - * @return  
583 - */  
584 - @RequestMapping("dateArray")  
585 - public List<String> dateArray(@RequestParam(defaultValue = "0") int c){  
586 - List<String> rs = new ArrayList<>();  
587 -  
588 - long t = System.currentTimeMillis();  
589 - if(c != 1)  
590 - t -= (ONE_DAY + (1000 * 60 * 60 * 6));  
591 - for(int i = 0; i < 3; i ++){  
592 - rs.add(fmtyyyyMMdd.print(t));  
593 - t -= ONE_DAY;  
594 - }  
595 - return rs;  
596 - }  
597 -  
598 - @RequestMapping(value = "svgAttr", method = RequestMethod.POST)  
599 - public Map<String, Object> svgAttr(@RequestParam String jsonStr){  
600 - return scheduleRealInfoService.svgAttr(jsonStr);  
601 - }  
602 -  
603 - @RequestMapping(value = "svgAttr", method = RequestMethod.GET)  
604 - public Map<String, Object> findSvgAttr(@RequestParam String idx){  
605 - return scheduleRealInfoService.findSvgAttr(idx);  
606 - }  
607 -  
608 - @RequestMapping(value = "addRemarks", method = RequestMethod.POST)  
609 - public Map<String, Object> addRemarks(@RequestParam Long id, @RequestParam String remarks){  
610 - return scheduleRealInfoService.addRemarks(id, remarks);  
611 - }  
612 -  
613 - @RequestMapping(value = "scheduleDailyQp", method = RequestMethod.GET)  
614 - public List<Map<String, Object>> scheduleDailyQp(@RequestParam String line,@RequestParam String date){  
615 - return scheduleRealInfoService.scheduleDailyQp(line,date);  
616 - }  
617 -  
618 - @RequestMapping(value = "scheduleDailyExport", method = RequestMethod.GET)  
619 - public List<Map<String, Object>> scheduleDailyExport(@RequestParam Map<String, Object> map){  
620 - return scheduleRealInfoService.scheduleDailyExport(map);  
621 - }  
622 -  
623 - @RequestMapping(value = "exportWaybillMore", method = RequestMethod.GET)  
624 - public Map<String, Object> exportWaybillMore(@RequestParam Map<String, Object> map){  
625 - return scheduleRealInfoService.exportWaybillMore(map);  
626 - }  
627 -  
628 - /**  
629 - * 获取当日计划排班 , 从计划表抓取数据  
630 - * @return  
631 - */  
632 - @RequestMapping(value = "currSchedulePlanByLineCode", method = RequestMethod.GET)  
633 - public List<SchedulePlanInfo> currentSchedulePlan(@RequestParam String lineCode){  
634 - return scheduleRealInfoService.currentSchedulePlan(lineCode);  
635 - }  
636 -  
637 - @RequestMapping(value = "lpChangeMulti", method = RequestMethod.POST)  
638 - public Map<String, Object> lpChangeMulti(@RequestParam String leftIdx, @RequestParam String rightIdx,@RequestParam int type){  
639 - return scheduleRealInfoService.lpChangeMulti(leftIdx, rightIdx, type);  
640 - }  
641 -  
642 - /**  
643 - * 删除当日实际排班  
644 - * @return  
645 - */  
646 - @RequestMapping(value = "deleteRealSchedule", method = RequestMethod.POST)  
647 - public Map<String, Object> deleteRealSchedule(@RequestParam String lineCode){  
648 - return dayOfSchedule.deleteRealSchedule(lineCode);  
649 - }  
650 -  
651 - /**  
652 - * 从计划表重新加载当日排班  
653 - * @param lineCode  
654 - * @return  
655 - */  
656 - @RequestMapping(value = "reLoadRealSchedule", method = RequestMethod.POST)  
657 - public Map<String, Object> reLoadRealSchedule(@RequestParam String lineCode){  
658 - Map<String, Object> rs = new HashMap<>();  
659 - List<ScheduleRealInfo> list = dayOfSchedule.findByLineCode(lineCode);  
660 - if(list != null && list.size() > 0){  
661 - rs.put("status", ResponseCode.ERROR);  
662 - rs.put("msg", "失败," + list.get(0).getXlName() + "当日存在实际排班,无法重新加载。");  
663 - return rs;  
664 - }  
665 -  
666 - int code = dayOfSchedule.reloadSch(lineCode);  
667 -  
668 - //重新按公司编码索引数据  
669 - dayOfSchedule.groupByGsbm();  
670 - rs.put("status", code==0? ResponseCode.SUCCESS: ResponseCode.ERROR);  
671 - return rs;  
672 - }  
673 -  
674 - /**  
675 - * 误点调整  
676 - * @param idx  
677 - * @param minute  
678 - * @return  
679 - */  
680 - @RequestMapping(value = "lateAdjust", method = RequestMethod.POST)  
681 - public Map<String, Object> lateAdjust(@RequestParam String idx,@RequestParam float minute ){  
682 - return scheduleRealInfoService.lateAdjust(idx, minute);  
683 - }  
684 -  
685 - /**  
686 - * 获取所有应发未到的班次  
687 - * @param idx  
688 - * @return  
689 - */  
690 - @RequestMapping(value = "allLate2")  
691 - public List<ScheduleRealInfo> allLate2(@RequestParam String idx){  
692 - return scheduleRealInfoService.allLate2(idx);  
693 - }  
694 -  
695 - /**  
696 - * 添加一个临加到历史库  
697 - * @param sch  
698 - * @return  
699 - */  
700 - @RequestMapping(value = "history/add", method = RequestMethod.POST)  
701 - public Map<String, Object> addToHistory(ScheduleRealInfo sch){  
702 - return scheduleRealInfoService.addToHistory(sch);  
703 - }  
704 -  
705 - /**  
706 - * 从历史库里删除临加班次  
707 - * @param sch  
708 - * @return  
709 - */  
710 - @RequestMapping(value = "history/{id}", method = RequestMethod.DELETE)  
711 - public Map<String, Object> deleteToHistory(@PathVariable("id") Long id){  
712 - return scheduleRealInfoService.deleteToHistory(id);  
713 - }  
714 -  
715 - @RequestMapping(value = "isCircleQdz", method = RequestMethod.POST)  
716 - public Map<String, Object> isCircleQdz(@RequestParam String line, String nbbm, String ts, String qdzCode){  
717 - Map<String, Object> map =new HashMap<>();  
718 - map.put("isExist",scheduleRealInfoService.isCircleQdz(nbbm, ts, line, qdzCode));  
719 - return map;  
720 - }  
721 -  
722 - /**  
723 - * 从历史库里删除临加班次  
724 - * @param sch  
725 - * @return  
726 - */  
727 - @RequestMapping(value = "wxsb", method = RequestMethod.POST)  
728 - public Map<String, Object> deleteToHistory(@RequestParam Map<String, Object> param){  
729 - SysUser user = SecurityUtils.getCurrentUser();  
730 - String uname = user.getUserName();  
731 - StringBuilder url = new StringBuilder(ConfigUtil.get("http.report.url"));  
732 - url.append("?nbbm=").append(param.get("nbbm")).append("&bxy=").append(uname).append("&bxbm=").append(param.get("bxType"));  
733 - // 分公司保存格式 分公司编码_公司编码  
734 - String val = BasicData.nbbm2FgsCompanyCodeMap.get(param.get("nbbm"));  
735 - String[] arr = val.split("_");  
736 - if (!"22".equals(arr[1])) {  
737 - Map<String, Object> res = new HashMap<String, Object>();  
738 - res.put("status", ResponseCode.ERROR);  
739 - res.put("msg", "除金高公司外暂未开通此功能");  
740 -  
741 - return res;  
742 - }  
743 - url.append("&fgs=").append(arr[0]);  
744 -  
745 - return request(url.toString());  
746 - }  
747 -  
748 - @SuppressWarnings("unchecked")  
749 - private static Map<String, Object> request(String url) {  
750 - Map<String, Object> res = new HashMap<String, Object>();  
751 - res.put("status", ResponseCode.SUCCESS);  
752 - InputStream in = null;  
753 - HttpURLConnection con = null;  
754 - try {  
755 - con = (HttpURLConnection)new URL(url).openConnection();  
756 - con.setRequestMethod("POST");  
757 - con.setRequestProperty("keep-alive", "true");  
758 - con.setRequestProperty("accept", "application/json");  
759 - con.setRequestProperty("content-type", "application/json");  
760 - con.setDoInput(true);  
761 - con.setReadTimeout(2500);  
762 - con.setConnectTimeout(2500);  
763 -  
764 - con.connect();  
765 - if (con.getResponseCode() == 200) {  
766 - in = con.getInputStream();  
767 - ByteArrayOutputStream bout = new ByteArrayOutputStream();  
768 - IOUtils.copy(in, bout); bout.close();  
769 - Map<String, Object> response = new ObjectMapper().readValue(bout.toByteArray(), Map.class);  
770 - if (!"报修成功".equals(response.get("msg"))) {  
771 - res.put("status", ResponseCode.ERROR);  
772 - res.putAll(response);  
773 - }  
774 - }  
775 - } catch (IOException e) {  
776 - // TODO Auto-generated catch block  
777 - res.put("status", ResponseCode.ERROR);  
778 - res.put("msg", "调用上报接口异常");  
779 - } finally {  
780 - try {  
781 - if (in != null) in.close();  
782 - if (con != null) con.disconnect();  
783 - } catch (IOException e) {  
784 - // TODO Auto-generated catch block  
785 - e.printStackTrace();  
786 - }  
787 - }  
788 -  
789 - return res;  
790 - }  
791 -} 1 +package com.bsth.controller.realcontrol;
  2 +
  3 +import java.io.ByteArrayOutputStream;
  4 +import java.io.IOException;
  5 +import java.io.InputStream;
  6 +import java.io.OutputStream;
  7 +import java.net.HttpURLConnection;
  8 +import java.net.URL;
  9 +import java.util.ArrayList;
  10 +import java.util.Collection;
  11 +import java.util.HashMap;
  12 +import java.util.List;
  13 +import java.util.Map;
  14 +
  15 +import org.apache.commons.io.IOUtils;
  16 +import org.apache.commons.lang3.StringEscapeUtils;
  17 +import org.joda.time.format.DateTimeFormat;
  18 +import org.joda.time.format.DateTimeFormatter;
  19 +import org.springframework.beans.factory.annotation.Autowired;
  20 +import org.springframework.web.bind.annotation.PathVariable;
  21 +import org.springframework.web.bind.annotation.RequestMapping;
  22 +import org.springframework.web.bind.annotation.RequestMethod;
  23 +import org.springframework.web.bind.annotation.RequestParam;
  24 +import org.springframework.web.bind.annotation.RestController;
  25 +
  26 +import com.alibaba.fastjson.JSONArray;
  27 +import com.bsth.common.ResponseCode;
  28 +import com.bsth.controller.BaseController;
  29 +import com.bsth.controller.realcontrol.dto.ChangePersonCar;
  30 +import com.bsth.controller.realcontrol.dto.DfsjChange;
  31 +import com.bsth.data.BasicData;
  32 +import com.bsth.data.schedule.DayOfSchedule;
  33 +import com.bsth.data.schedule.edit_logs.service.dto.SchEditInfoDto;
  34 +import com.bsth.entity.realcontrol.ScheduleRealInfo;
  35 +import com.bsth.entity.schedule.SchedulePlanInfo;
  36 +import com.bsth.entity.sys.SysUser;
  37 +import com.bsth.security.util.SecurityUtils;
  38 +import com.bsth.service.realcontrol.ScheduleRealInfoService;
  39 +import com.bsth.util.ConfigUtil;
  40 +import com.fasterxml.jackson.databind.ObjectMapper;
  41 +
  42 +@RestController
  43 +@RequestMapping("/realSchedule")
  44 +public class ScheduleRealInfoController extends BaseController<ScheduleRealInfo, Long> {
  45 +
  46 + @Autowired
  47 + ScheduleRealInfoService scheduleRealInfoService;
  48 +
  49 + @Autowired
  50 + DayOfSchedule dayOfSchedule;
  51 +
  52 + @RequestMapping(value = "check_fgs_ascription", method = RequestMethod.POST)
  53 + public Map<String, Object> checkPCFgsAscription(@RequestParam Long schId, String jGh, String sGh, String nbbm){
  54 + return scheduleRealInfoService.checkPCFgsAscription(schId, jGh, sGh, nbbm);
  55 + }
  56 +
  57 + @RequestMapping(value = "/lines")
  58 + public Map<String, Collection<ScheduleRealInfo>> findByLines(@RequestParam String lines) {
  59 + return scheduleRealInfoService.findByLines(lines);
  60 + }
  61 +
  62 + @RequestMapping(value = "/car")
  63 + public List<ScheduleRealInfo> findByCar(String nbbm){
  64 + return dayOfSchedule.findByNbbm(nbbm);
  65 + }
  66 +
  67 + /**
  68 + *
  69 + * @Title: outgoAdjust @Description: TODO(待发调整) @param @param id
  70 + * 主键 @param @param remarks 备注 @param @param dfsj 待发时间(HH:mm) @throws
  71 + */
  72 + @RequestMapping(value = "/outgoAdjust", method = RequestMethod.POST)
  73 + public Map<String, Object> outgoAdjust(@RequestParam Long id, @RequestParam String remarks,
  74 + @RequestParam String dfsj,String bcType,
  75 + @RequestParam(defaultValue = "") String opType) {
  76 + return scheduleRealInfoService.outgoAdjust(id, remarks, dfsj, bcType, opType, null);
  77 + }
  78 +
  79 + /**
  80 + *
  81 + * @Title: destroy @Description: TODO(销毁,烂班) @param @param idsStr 要烂掉的班次ID ,分隔
  82 + */
  83 + @RequestMapping(value = "/destroy", method = RequestMethod.POST)
  84 + public Map<String, Object> destroy(@RequestParam String idsStr
  85 + /*, @RequestParam(defaultValue = "-1") int spaceAdjust*/,
  86 + @RequestParam String remarks, @RequestParam String adjustExps/*, @RequestParam(defaultValue = "0") int spaceNum*/) {
  87 + return scheduleRealInfoService.destroy(idsStr, remarks, adjustExps, null);
  88 + }
  89 +
  90 + /**
  91 + *
  92 + * @Title: carDeviceMapp @Description: TODO(获取车辆自编号和设备号对照,从缓存取) @throws
  93 + */
  94 + @RequestMapping(value = "/carDeviceMapp", method = RequestMethod.GET)
  95 + public Map<String, String> carDeviceMapp() {
  96 + return BasicData.deviceId2NbbmMap.inverse();
  97 + }
  98 +
  99 + /**
  100 + *
  101 + * @Title: findPersionByLine @Description: TODO(根据线路主键获取驾驶员) @param @param
  102 + * lineId @throws
  103 + */
  104 + @RequestMapping(value = "/driver", method = RequestMethod.GET)
  105 + public List<Map<String, String>> findDriverByLine(@RequestParam String lineCode) {
  106 + return scheduleRealInfoService.findDriverByLine(lineCode);
  107 + }
  108 +
  109 + /**
  110 + *
  111 + * @Title: findPersionByLine @Description: TODO(根据线路主键获取售票员) @param @param
  112 + * lineId @throws
  113 + */
  114 + @RequestMapping(value = "/conductor", method = RequestMethod.GET)
  115 + public List<Map<String, String>> findConductorByLine(@RequestParam String lineCode) {
  116 + return scheduleRealInfoService.findConductorByLine(lineCode);
  117 + }
  118 +
  119 + /**
  120 + *
  121 + * @Title: findPersionByLine @Description: TODO(根据线路主键获取车辆) @param @param
  122 + * lineId @throws
  123 + */
  124 + @RequestMapping(value = "/cars", method = RequestMethod.GET)
  125 + public List<Map<String, String>> findCarByLine(@RequestParam String lineCode) {
  126 + return scheduleRealInfoService.findCarByLine(lineCode);
  127 + }
  128 +
  129 + /**
  130 + *
  131 + * @Title: sreachNbbm @Description: TODO(搜索车辆内部编码) @throws
  132 + */
  133 + @RequestMapping(value = "/sreachVehic", method = RequestMethod.GET)
  134 + public List<Map<String, String>> sreachVehic(@RequestParam String nbbm) {
  135 + return scheduleRealInfoService.sreachVehic(nbbm);
  136 + }
  137 + /**
  138 + *
  139 + * @Title: realOutAdjust
  140 + * @Description: TODO(实发调整)
  141 + * @param @param id 班次ID
  142 + * @param @param fcsjActual 实际发车时间 HH:mm
  143 + * @param @param remarks 备注
  144 + * @throws
  145 + */
  146 + @RequestMapping(value = "/realOutAdjust", method = RequestMethod.POST)
  147 + public Map<String, Object> realOutAdjust(@RequestParam Long id, @RequestParam String fcsjActual,
  148 + @RequestParam String remarks) {
  149 + return scheduleRealInfoService.realOutAdjust(id, fcsjActual, remarks);
  150 + }
  151 +
  152 + /**
  153 + *
  154 + * @Title: revokeDestroy
  155 + * @Description: TODO(撤销烂班)
  156 + * @param @param id
  157 + * @throws
  158 + */
  159 + @RequestMapping(value = "/revokeDestroy", method = RequestMethod.POST)
  160 + public Map<String, Object> revokeDestroy(@RequestParam Long id){
  161 + return scheduleRealInfoService.revokeDestroy(id);
  162 + }
  163 +
  164 + /**
  165 + *
  166 + * @Title: revokeRealOutgo
  167 + * @Description: TODO(撤销实发)
  168 + * @param @param id
  169 + * @throws
  170 + */
  171 + @RequestMapping(value = "/revokeRealOutgo", method = RequestMethod.POST)
  172 + public Map<String, Object> revokeRealOutgo(@RequestParam Long id){
  173 + return scheduleRealInfoService.revokeRealOutgo(id);
  174 + }
  175 +
  176 + /**
  177 + * 撤销执行
  178 + * @param id
  179 + * @return
  180 + */
  181 + @RequestMapping(value = "/revokeRealArrive", method = RequestMethod.POST)
  182 + public Map<String, Object> revokeRealArrive(@RequestParam Long id){
  183 + return scheduleRealInfoService.revokeRealArrive(id);
  184 + }
  185 +
  186 + /**
  187 + *
  188 + * @Title: spaceAdjust
  189 + * @Description: TODO(间隔调整)
  190 + * @param @param ids 要调整的班次数组ID
  191 + * @param @param space 间隔
  192 + * @throws
  193 + */
  194 + @RequestMapping(value = "/spaceAdjust", method = RequestMethod.POST)
  195 + public Map<String, Object> spaceAdjust(Long[] ids, Integer space){
  196 + return scheduleRealInfoService.spaceAdjust(ids, space);
  197 + }
  198 +
  199 + /**
  200 + *
  201 + * @Title: schInfoFineTune
  202 + * @Description: TODO(发车信息微调)
  203 + * @param @param map
  204 + * @throws
  205 + */
  206 + @RequestMapping(value = "/schInfoFineTune", method = RequestMethod.POST)
  207 + public Map<String, Object> schInfoFineTune(@RequestParam Map<String, String> map){
  208 + return scheduleRealInfoService.schInfoFineTune(map);
  209 + }
  210 +
  211 + /**
  212 + *
  213 + * @Title: outgoAdjustAll
  214 + * @Description: TODO(批量待发调整)
  215 + * @param @param list
  216 + * @throws
  217 + */
  218 + @RequestMapping(value = "/outgoAdjustAll", method = RequestMethod.POST)
  219 + public Map<String, Object> outgoAdjustAll(@RequestParam String params){
  220 + //反转义
  221 + params = StringEscapeUtils.unescapeHtml4(params);
  222 + return scheduleRealInfoService.outgoAdjustAll(params);
  223 + }
  224 +
  225 + /**
  226 + *
  227 + * @Title: findByLineAndUpDown
  228 + * @Description: TODO(根据线路和走向获取班次)
  229 + * @param @param line
  230 + * @param @param upDown
  231 + */
  232 + @RequestMapping(value = "/findByLineAndUpDown")
  233 + public List<ScheduleRealInfo> findByLineAndUpDown(@RequestParam String line,@RequestParam Integer upDown){
  234 + return dayOfSchedule.findByLineAndUpDown(line, upDown);
  235 + }
  236 +
  237 + /**
  238 + *
  239 + * @Title: findRouteByLine
  240 + * @Description: TODO(获取线路的站点,路段路由)
  241 + * @param @param lineCode
  242 + * @throws
  243 + */
  244 + @RequestMapping(value = "/findRouteByLine")
  245 + public Map<String, Object> findRouteByLine(@RequestParam String lineCode){
  246 + return scheduleRealInfoService.findRouteByLine(lineCode);
  247 + }
  248 +
  249 + /**
  250 + *
  251 + * @Title: removeChildTask
  252 + * @Description: TODO(删除子任务)
  253 + * @param @param taskId 子任务ID
  254 + * @throws
  255 + */
  256 + @RequestMapping(value = "/childTask/{taskId}", method = RequestMethod.DELETE)
  257 + public Map<String, Object> removeChildTask(@PathVariable("taskId") Long taskId){
  258 + return scheduleRealInfoService.removeChildTask(taskId);
  259 + }
  260 +
  261 + /**
  262 + *
  263 + * @Title: findByLineCode
  264 + * @Description: TODO(根据线路获取班次信息)
  265 + * @param @param lineCode
  266 + */
  267 + @RequestMapping(value = "/lineCode/{lineCode}")
  268 + public List<ScheduleRealInfo> findByLineCode(@PathVariable("lineCode") String lineCode){
  269 + return dayOfSchedule.findByLineCode(lineCode);
  270 + }
  271 +
  272 + @RequestMapping(value = "/queryUserInfo")
  273 + public List<ScheduleRealInfo> queryUserInfo(@RequestParam String line,
  274 + @RequestParam String date,@RequestParam String state) {
  275 + return scheduleRealInfoService.queryUserInfo(line, date,state);
  276 + }
  277 +
  278 + @RequestMapping(value = "/queryUserInfoPx")
  279 + public List<ScheduleRealInfo> queryUserInfoPx(@RequestParam String line,
  280 + @RequestParam String date,@RequestParam String state,@RequestParam String type) {
  281 + return scheduleRealInfoService.queryUserInfoPx(line, date,state,type);
  282 + }
  283 +
  284 + @RequestMapping(value = "/exportWaybill",method = RequestMethod.GET)
  285 + public List<ScheduleRealInfo> exportWaybill(@RequestParam String jName, @RequestParam String clZbh,
  286 + @RequestParam String lpName,@RequestParam String date,@RequestParam String line) {
  287 + return scheduleRealInfoService.exportWaybill(jName, clZbh, lpName,date,line);
  288 + }
  289 +
  290 + @RequestMapping(value = "/exportWaybillQp",method = RequestMethod.GET)
  291 + public List<ScheduleRealInfo> exportWaybillQp(@RequestParam String clZbh
  292 + ,@RequestParam String date,@RequestParam String line) {
  293 + return scheduleRealInfoService.exportWaybillQp( clZbh, date,line);
  294 + }
  295 +
  296 +
  297 + @RequestMapping(value = "/dailyInfo")
  298 + public List<Map<String, Object>> dailyInfo(@RequestParam String line, @RequestParam String date,@RequestParam String type) {
  299 + return scheduleRealInfoService.dailyInfo(line, date, type);
  300 + }
  301 +
  302 + @RequestMapping(value = "/historyMessage")
  303 + public List<Object[]> historyMessage(@RequestParam String line, @RequestParam String date,
  304 + @RequestParam String code, @RequestParam String type) {
  305 + return scheduleRealInfoService.historyMessage(line, date, code, type);
  306 + }
  307 +
  308 + @RequestMapping(value="/findLine")
  309 + public List<Map<String,String>> findLine(@RequestParam String line){
  310 + return scheduleRealInfoService.findLine(line);
  311 + }
  312 +
  313 + @RequestMapping(value="/findKMBC",method = RequestMethod.GET)
  314 + public Map<String,Object> findKMBC(@RequestParam String jGh,@RequestParam String clZbh,@RequestParam String lpName
  315 + ,@RequestParam String date,@RequestParam String line){
  316 + return scheduleRealInfoService.findKMBC(jGh, clZbh,lpName,date,line);
  317 + }
  318 +
  319 + /**
  320 + * 路单公里统计 (闵行审计专用)
  321 + * @param jGh
  322 + * @param clZbh
  323 + * @param lpName
  324 + * @param date
  325 + * @param line
  326 + * @return
  327 + */
  328 + @RequestMapping(value="/findKMBC_mh_2",method = RequestMethod.GET)
  329 + public Map<String,Object> findKMBC_mh_2(@RequestParam String jGh,@RequestParam String clZbh,@RequestParam String lpName
  330 + ,@RequestParam String date,@RequestParam String line){
  331 + return scheduleRealInfoService.findKMBC_mh_2(jGh, clZbh,lpName,date,line);
  332 + }
  333 +
  334 + @RequestMapping(value="/findKMBCQp",method = RequestMethod.GET)
  335 + public Map<String,Object> findKMBCQp(@RequestParam String clZbh
  336 + ,@RequestParam String date,@RequestParam String line){
  337 + return scheduleRealInfoService.findKMBCQp(clZbh,date,line);
  338 + }
  339 +
  340 + @RequestMapping(value="/findLpName")
  341 + public List<Map<String,String>> findLpName(@RequestParam String lpName){
  342 + return scheduleRealInfoService.findLpName(lpName);
  343 + }
  344 +
  345 + @RequestMapping(value = "/account")
  346 + public List<Map<String,Object>> account(@RequestParam String line, @RequestParam String date,
  347 + @RequestParam String code,@RequestParam String xlName, @RequestParam String type) {
  348 + return scheduleRealInfoService.account(line, date, code, xlName, type);
  349 + }
  350 +
  351 + @RequestMapping(value = "/accountPx")
  352 + public List<Map<String,Object>> accountPx(@RequestParam String line, @RequestParam String date,
  353 + @RequestParam String code,@RequestParam String xlName, @RequestParam String px) {
  354 + return scheduleRealInfoService.accountPx(line, date, code, xlName, px);
  355 + }
  356 +
  357 + @RequestMapping(value = "/correctForm")
  358 + public List<SchEditInfoDto> correctForm(@RequestParam String line, @RequestParam String date,
  359 + @RequestParam String endDate,
  360 + @RequestParam String lpName, @RequestParam String code,
  361 + @RequestParam String type,@RequestParam String changType) {
  362 + return scheduleRealInfoService.correctForm(line, date, endDate, lpName, code, type,changType);
  363 + }
  364 + /**
  365 + * @Title queryListWaybill
  366 + * @Description 查询行车路单列表
  367 + * @param jName 驾驶员名字
  368 + * @param clZbh 车辆自编号(内部编号)
  369 + * @param lpName 路牌
  370 + * @return
  371 + */
  372 + @RequestMapping(value="/queryListWaybill",method = RequestMethod.GET)
  373 + public List<ScheduleRealInfo> queryListWaybill(@RequestParam String jName,@RequestParam String clZbh,@RequestParam String lpName
  374 + ,@RequestParam String date,@RequestParam String line){
  375 + return scheduleRealInfoService.queryListWaybill(jName, clZbh,lpName,date,line);
  376 + }
  377 +
  378 + /**
  379 + * @Title queryListWaybill
  380 + * @Description 查询行车路单列表(闵行审计专用路单)
  381 + * @param jName 驾驶员名字
  382 + * @param clZbh 车辆自编号(内部编号)
  383 + * @param lpName 路牌
  384 + * @return
  385 + */
  386 + @RequestMapping(value="/queryListWaybill_mh_2",method = RequestMethod.GET)
  387 + public List<ScheduleRealInfo> queryListWaybill_mh_2(@RequestParam String jName,@RequestParam String clZbh,@RequestParam String lpName
  388 + ,@RequestParam String date,@RequestParam String line){
  389 + return scheduleRealInfoService.queryListWaybill2(jName, clZbh,lpName,date,line);
  390 + }
  391 +
  392 + @RequestMapping(value="/queryListWaybillQp",method = RequestMethod.GET)
  393 + public List<ScheduleRealInfo> queryListWaybillQp(@RequestParam String clZbh,
  394 + @RequestParam String date,@RequestParam String line){
  395 + return scheduleRealInfoService.queryListWaybillQp(clZbh,date,line);
  396 + }
  397 +
  398 + @RequestMapping(value="/statisticsDaily")
  399 + public List<Map<String,Object>> statisticsDaily(@RequestParam String line, @RequestParam String date,
  400 + @RequestParam String xlName, @RequestParam String type){
  401 + return scheduleRealInfoService.statisticsDaily(line, date, xlName, type);
  402 + }
  403 +
  404 + @RequestMapping(value="/statisticsDaily_mh_2")
  405 + public List<Map<String,Object>> statisticsDaily_mh_2(@RequestParam String line, @RequestParam String date,
  406 + @RequestParam String xlName, @RequestParam String type){
  407 + return scheduleRealInfoService.statisticsDaily_mh_2(line, date, xlName, type);
  408 + }
  409 +
  410 + @RequestMapping(value="/statisticsDailyTj")
  411 + public List<Map<String,Object>> statisticsDailyTj(@RequestParam Map<String, Object> map){
  412 + String gsdm="";
  413 + if(map.get("gsdm")!=null){
  414 + gsdm=map.get("gsdm").toString();
  415 + }
  416 + String fgsdm="";
  417 + if(map.get("fgsdm")!=null){
  418 + fgsdm=map.get("fgsdm").toString();
  419 + }
  420 + String line="";
  421 + if(map.get("line")!=null){
  422 + line=map.get("line").toString();
  423 + }
  424 + String date="";
  425 + if(map.get("date")!=null){
  426 + date=map.get("date").toString();
  427 + }
  428 + String date2="";
  429 + if(map.get("date2")!=null){
  430 + date2=map.get("date2").toString();
  431 + }
  432 + String xlName="";
  433 + if(map.get("xlName")!=null){
  434 + xlName=map.get("xlName").toString();
  435 + }
  436 + String type="";
  437 + if(map.get("type")!=null){
  438 + type=map.get("type").toString();
  439 + }
  440 + String nature="0";
  441 + if(map.get("nature")!=null){
  442 + nature=map.get("nature").toString();
  443 + }
  444 + return scheduleRealInfoService.statisticsDailyTj(gsdm,fgsdm,line, date,date2, xlName, type,nature);
  445 + }
  446 +
  447 + /*
  448 + * 公里修正报表
  449 + */
  450 + @RequestMapping(value="/mileageReportTj")
  451 + public List<Map<String,Object>> mileageReport(@RequestParam Map<String, Object> map){
  452 + String gsdm="";
  453 + if(map.get("gsdm")!=null){
  454 + gsdm=map.get("gsdm").toString();
  455 + }
  456 + String fgsdm="";
  457 + if(map.get("fgsdm")!=null){
  458 + fgsdm=map.get("fgsdm").toString();
  459 + }
  460 + String line="";
  461 + if(map.get("line")!=null){
  462 + line=map.get("line").toString();
  463 + }
  464 + String date="";
  465 + if(map.get("date")!=null){
  466 + date=map.get("date").toString();
  467 + }
  468 + String date2="";
  469 + if(map.get("date2")!=null){
  470 + date2=map.get("date2").toString();
  471 + }
  472 + String xlName="";
  473 + if(map.get("xlName")!=null){
  474 + xlName=map.get("xlName").toString();
  475 + }
  476 + return scheduleRealInfoService.mileageReport(gsdm,fgsdm,line, date,date2);
  477 + }
  478 +
  479 + /*
  480 + * 班次修正报表
  481 + */
  482 + @RequestMapping(value="/scheduleCorrectionReport")
  483 + public List<Map<String,Object>> scheduleCorrectionReport(@RequestParam Map<String, Object> map){
  484 + String gsdm="";
  485 + if(map.get("gsdm")!=null){
  486 + gsdm=map.get("gsdm").toString();
  487 + }
  488 + String fgsdm="";
  489 + if(map.get("fgsdm")!=null){
  490 + fgsdm=map.get("fgsdm").toString();
  491 + }
  492 + String line="";
  493 + if(map.get("line")!=null){
  494 + line=map.get("line").toString();
  495 + }
  496 + String date="";
  497 + if(map.get("date")!=null){
  498 + date=map.get("date").toString();
  499 + }
  500 + String date2="";
  501 + if(map.get("date2")!=null){
  502 + date2=map.get("date2").toString();
  503 + }
  504 + String xlName="";
  505 + if(map.get("xlName")!=null){
  506 + xlName=map.get("xlName").toString();
  507 + }
  508 + return scheduleRealInfoService.scheduleCorrectionReport(gsdm,fgsdm,line, date,date2);
  509 + }
  510 +
  511 + @RequestMapping(value="/MapById",method = RequestMethod.GET)
  512 + public Map<String, Object> MapById(@RequestParam("id") Long id){
  513 + return scheduleRealInfoService.MapById(id);
  514 + }
  515 +
  516 + @RequestMapping(value="/MapByIdQp",method = RequestMethod.GET)
  517 + public Map<String, Object> MapByIdQp(@RequestParam("id") Long id){
  518 + return scheduleRealInfoService.MapByIdQp(id);
  519 + }
  520 +
  521 + /**
  522 + * @Title: scheduleDaily
  523 + * @Description: TODO(调度日报表)
  524 + * @param line 线路
  525 + * @param date 时间
  526 + * @return
  527 + */
  528 + @RequestMapping(value="/scheduleDaily")
  529 + public Map<String,Object> scheduleDaily(@RequestParam String line,@RequestParam String date){
  530 + return scheduleRealInfoService.scheduleDaily(line,date);
  531 + }
  532 +
  533 + @RequestMapping(value="/realScheduleList")
  534 + public List<ScheduleRealInfo> realScheduleList(@RequestParam String line,@RequestParam String date){
  535 + return scheduleRealInfoService.realScheduleList(line,date);
  536 + }
  537 +
  538 + @RequestMapping(value="/realScheduleList_zrw")
  539 + public List<ScheduleRealInfo> realScheduleList_zrw(@RequestParam String line,@RequestParam String date){
  540 + return scheduleRealInfoService.realScheduleList_zrw(line,date);
  541 + }
  542 +
  543 + @RequestMapping(value="/realScheduleList_mh_2")
  544 + public List<ScheduleRealInfo> realScheduleList_mh_2(@RequestParam String line,@RequestParam String date){
  545 + return scheduleRealInfoService.realScheduleList_mh_2(line,date);
  546 + }
  547 +
  548 + @RequestMapping(value="/realScheduleListQp")
  549 + public List<ScheduleRealInfo> realScheduleListQp(@RequestParam String line,@RequestParam String date){
  550 + return scheduleRealInfoService.realScheduleListQp(line,date);
  551 + }
  552 +
  553 + @RequestMapping(value="/multi_tzrc", method=RequestMethod.POST)
  554 + public Map<String, Object> multi_tzrc(@RequestParam String cpcsJson){
  555 + cpcsJson = StringEscapeUtils.unescapeHtml4(cpcsJson);
  556 + List<ChangePersonCar> cpcs = JSONArray.parseArray(cpcsJson, ChangePersonCar.class);
  557 + return scheduleRealInfoService.multi_tzrc(cpcs, null);
  558 + }
  559 +
  560 + @RequestMapping(value="/multi_dftz", method=RequestMethod.POST)
  561 + public Map<String, Object> multi_dftz(@RequestParam String dcsJson){
  562 + dcsJson = StringEscapeUtils.unescapeHtml4(dcsJson);
  563 + List<DfsjChange> dfsjcs = JSONArray.parseArray(dcsJson, DfsjChange.class);
  564 + return scheduleRealInfoService.multi_dftz(dfsjcs);
  565 + }
  566 +
  567 + @RequestMapping(value="/changeBcType/{id}", method=RequestMethod.POST)
  568 + public Map<String, Object> changeBcType(@PathVariable("id") Long id, String bcType, String remarks, String majorStationName){
  569 + return scheduleRealInfoService.changeBcType(id, bcType, remarks, majorStationName);
  570 + }
  571 +
  572 + @RequestMapping(value="/history", method=RequestMethod.POST)
  573 + public Map<String,Object> historySave(ScheduleRealInfo sch){
  574 + return scheduleRealInfoService.historySave(sch);
  575 + }
  576 +
  577 +
  578 + private static DateTimeFormatter fmtyyyyMMdd = DateTimeFormat.forPattern("yyyy-MM-dd");
  579 + private final static long ONE_DAY = 1000 * 60 * 60 * 24;
  580 + /**
  581 + * 获取可编辑的历史班次日期
  582 + * @return
  583 + */
  584 + @RequestMapping("dateArray")
  585 + public List<String> dateArray(@RequestParam(defaultValue = "0") int c){
  586 + List<String> rs = new ArrayList<>();
  587 +
  588 + long t = System.currentTimeMillis();
  589 + if(c != 1)
  590 + t -= (ONE_DAY + (1000 * 60 * 60 * 6));
  591 + for(int i = 0; i < 3; i ++){
  592 + rs.add(fmtyyyyMMdd.print(t));
  593 + t -= ONE_DAY;
  594 + }
  595 + return rs;
  596 + }
  597 +
  598 + @RequestMapping(value = "svgAttr", method = RequestMethod.POST)
  599 + public Map<String, Object> svgAttr(@RequestParam String jsonStr){
  600 + return scheduleRealInfoService.svgAttr(jsonStr);
  601 + }
  602 +
  603 + @RequestMapping(value = "svgAttr", method = RequestMethod.GET)
  604 + public Map<String, Object> findSvgAttr(@RequestParam String idx){
  605 + return scheduleRealInfoService.findSvgAttr(idx);
  606 + }
  607 +
  608 + @RequestMapping(value = "addRemarks", method = RequestMethod.POST)
  609 + public Map<String, Object> addRemarks(@RequestParam Long id, @RequestParam String remarks){
  610 + return scheduleRealInfoService.addRemarks(id, remarks);
  611 + }
  612 +
  613 + @RequestMapping(value = "scheduleDailyQp", method = RequestMethod.GET)
  614 + public List<Map<String, Object>> scheduleDailyQp(@RequestParam String line,@RequestParam String date){
  615 + return scheduleRealInfoService.scheduleDailyQp(line,date);
  616 + }
  617 +
  618 + @RequestMapping(value = "scheduleDailyExport", method = RequestMethod.GET)
  619 + public List<Map<String, Object>> scheduleDailyExport(@RequestParam Map<String, Object> map){
  620 + return scheduleRealInfoService.scheduleDailyExport(map);
  621 + }
  622 +
  623 + @RequestMapping(value = "exportWaybillMore", method = RequestMethod.GET)
  624 + public Map<String, Object> exportWaybillMore(@RequestParam Map<String, Object> map){
  625 + return scheduleRealInfoService.exportWaybillMore(map);
  626 + }
  627 +
  628 + /**
  629 + * 获取当日计划排班 , 从计划表抓取数据
  630 + * @return
  631 + */
  632 + @RequestMapping(value = "currSchedulePlanByLineCode", method = RequestMethod.GET)
  633 + public List<SchedulePlanInfo> currentSchedulePlan(@RequestParam String lineCode){
  634 + return scheduleRealInfoService.currentSchedulePlan(lineCode);
  635 + }
  636 +
  637 + @RequestMapping(value = "lpChangeMulti", method = RequestMethod.POST)
  638 + public Map<String, Object> lpChangeMulti(@RequestParam String leftIdx, @RequestParam String rightIdx,@RequestParam int type){
  639 + return scheduleRealInfoService.lpChangeMulti(leftIdx, rightIdx, type);
  640 + }
  641 +
  642 + /**
  643 + * 删除当日实际排班
  644 + * @return
  645 + */
  646 + @RequestMapping(value = "deleteRealSchedule", method = RequestMethod.POST)
  647 + public Map<String, Object> deleteRealSchedule(@RequestParam String lineCode){
  648 + return dayOfSchedule.deleteRealSchedule(lineCode);
  649 + }
  650 +
  651 + /**
  652 + * 从计划表重新加载当日排班
  653 + * @param lineCode
  654 + * @return
  655 + */
  656 + @RequestMapping(value = "reLoadRealSchedule", method = RequestMethod.POST)
  657 + public Map<String, Object> reLoadRealSchedule(@RequestParam String lineCode){
  658 + Map<String, Object> rs = new HashMap<>();
  659 + List<ScheduleRealInfo> list = dayOfSchedule.findByLineCode(lineCode);
  660 + if(list != null && list.size() > 0){
  661 + rs.put("status", ResponseCode.ERROR);
  662 + rs.put("msg", "失败," + list.get(0).getXlName() + "当日存在实际排班,无法重新加载。");
  663 + return rs;
  664 + }
  665 +
  666 + int code = dayOfSchedule.reloadSch(lineCode);
  667 +
  668 + //重新按公司编码索引数据
  669 + dayOfSchedule.groupByGsbm();
  670 + rs.put("status", code==0? ResponseCode.SUCCESS: ResponseCode.ERROR);
  671 + return rs;
  672 + }
  673 +
  674 + /**
  675 + * 误点调整
  676 + * @param idx
  677 + * @param minute
  678 + * @return
  679 + */
  680 + @RequestMapping(value = "lateAdjust", method = RequestMethod.POST)
  681 + public Map<String, Object> lateAdjust(@RequestParam String idx,@RequestParam float minute ){
  682 + return scheduleRealInfoService.lateAdjust(idx, minute);
  683 + }
  684 +
  685 + /**
  686 + * 获取所有应发未到的班次
  687 + * @param idx
  688 + * @return
  689 + */
  690 + @RequestMapping(value = "allLate2")
  691 + public List<ScheduleRealInfo> allLate2(@RequestParam String idx){
  692 + return scheduleRealInfoService.allLate2(idx);
  693 + }
  694 +
  695 + /**
  696 + * 添加一个临加到历史库
  697 + * @param sch
  698 + * @return
  699 + */
  700 + @RequestMapping(value = "history/add", method = RequestMethod.POST)
  701 + public Map<String, Object> addToHistory(ScheduleRealInfo sch){
  702 + return scheduleRealInfoService.addToHistory(sch);
  703 + }
  704 +
  705 + /**
  706 + * 从历史库里删除临加班次
  707 + * @param sch
  708 + * @return
  709 + */
  710 + @RequestMapping(value = "history/{id}", method = RequestMethod.DELETE)
  711 + public Map<String, Object> deleteToHistory(@PathVariable("id") Long id){
  712 + return scheduleRealInfoService.deleteToHistory(id);
  713 + }
  714 +
  715 + @RequestMapping(value = "isCircleQdz", method = RequestMethod.POST)
  716 + public Map<String, Object> isCircleQdz(@RequestParam String line, String nbbm, String ts, String qdzCode){
  717 + Map<String, Object> map =new HashMap<>();
  718 + map.put("isExist",scheduleRealInfoService.isCircleQdz(nbbm, ts, line, qdzCode));
  719 + return map;
  720 + }
  721 +
  722 + /**
  723 + * 从历史库里删除临加班次
  724 + * @param sch
  725 + * @return
  726 + */
  727 + @RequestMapping(value = "wxsb", method = RequestMethod.POST)
  728 + public Map<String, Object> deleteToHistory(@RequestParam Map<String, Object> param){
  729 + SysUser user = SecurityUtils.getCurrentUser();
  730 + String uname = user.getUserName();
  731 + StringBuilder url = new StringBuilder(ConfigUtil.get("http.report.url"));
  732 + url.append("?nbbm=").append(param.get("nbbm")).append("&bxy=").append(uname).append("&bxbm=").append(param.get("bxType"));
  733 + // 分公司保存格式 分公司编码_公司编码
  734 + String val = BasicData.nbbm2FgsCompanyCodeMap.get(param.get("nbbm"));
  735 + String[] arr = val.split("_");
  736 + if (!"22".equals(arr[1])) {
  737 + Map<String, Object> res = new HashMap<String, Object>();
  738 + res.put("status", ResponseCode.ERROR);
  739 + res.put("msg", "除金高公司外暂未开通此功能");
  740 +
  741 + return res;
  742 + }
  743 + url.append("&fgs=").append(arr[0]);
  744 +
  745 + return request(url.toString());
  746 + }
  747 +
  748 + @SuppressWarnings("unchecked")
  749 + private static Map<String, Object> request(String url) {
  750 + Map<String, Object> res = new HashMap<String, Object>();
  751 + res.put("status", ResponseCode.SUCCESS);
  752 + InputStream in = null;
  753 + HttpURLConnection con = null;
  754 + try {
  755 + con = (HttpURLConnection)new URL(url).openConnection();
  756 + con.setRequestMethod("POST");
  757 + con.setRequestProperty("keep-alive", "true");
  758 + con.setRequestProperty("accept", "application/json");
  759 + con.setRequestProperty("content-type", "application/json");
  760 + con.setDoInput(true);
  761 + con.setReadTimeout(2500);
  762 + con.setConnectTimeout(2500);
  763 +
  764 + con.connect();
  765 + if (con.getResponseCode() == 200) {
  766 + in = con.getInputStream();
  767 + ByteArrayOutputStream bout = new ByteArrayOutputStream();
  768 + IOUtils.copy(in, bout); bout.close();
  769 + Map<String, Object> response = new ObjectMapper().readValue(bout.toByteArray(), Map.class);
  770 + if (!"报修成功".equals(response.get("msg"))) {
  771 + res.put("status", ResponseCode.ERROR);
  772 + res.putAll(response);
  773 + }
  774 + }
  775 + } catch (IOException e) {
  776 + // TODO Auto-generated catch block
  777 + res.put("status", ResponseCode.ERROR);
  778 + res.put("msg", "调用上报接口异常");
  779 + } finally {
  780 + try {
  781 + if (in != null) in.close();
  782 + if (con != null) con.disconnect();
  783 + } catch (IOException e) {
  784 + // TODO Auto-generated catch block
  785 + e.printStackTrace();
  786 + }
  787 + }
  788 +
  789 + return res;
  790 + }
  791 +}
src/main/java/com/bsth/entity/search/PredicatesBuilder.java
@@ -9,6 +9,7 @@ import java.text.NumberFormat; @@ -9,6 +9,7 @@ import java.text.NumberFormat;
9 import java.text.ParseException; 9 import java.text.ParseException;
10 import java.text.SimpleDateFormat; 10 import java.text.SimpleDateFormat;
11 import java.util.ArrayList; 11 import java.util.ArrayList;
  12 +import java.util.Calendar;
12 import java.util.Date; 13 import java.util.Date;
13 import java.util.List; 14 import java.util.List;
14 15
@@ -37,7 +38,13 @@ public class PredicatesBuilder { @@ -37,7 +38,13 @@ public class PredicatesBuilder {
37 if(Date.class.isAssignableFrom(leftType) && 38 if(Date.class.isAssignableFrom(leftType) &&
38 String.class.isAssignableFrom(rightType)){ 39 String.class.isAssignableFrom(rightType)){
39 DateTime dateTime = new DateTime(object); 40 DateTime dateTime = new DateTime(object);
40 - return cb.equal(expression, dateTime.toDate()); 41 + Date startTime = dateTime.toDate();//设置起始时间
  42 + Calendar c = Calendar.getInstance();
  43 + c.setTime(startTime);
  44 + c.add(Calendar.DAY_OF_MONTH, 1);
  45 + // 设置结束时间,起始时间为结束时间加1天
  46 + Date endTime = c.getTime();
  47 + return cb.between((Path<Date>) expression,startTime,endTime);
41 } 48 }
42 else { 49 else {
43 return cb.equal(expression, object); 50 return cb.equal(expression, object);
src/main/java/com/bsth/entity/traffic/SKBUploadLogger.java
1 package com.bsth.entity.traffic; 1 package com.bsth.entity.traffic;
2 2
3 -import com.bsth.entity.schedule.TTInfo; 3 +import com.bsth.entity.Line;
4 import com.bsth.entity.sys.SysUser; 4 import com.bsth.entity.sys.SysUser;
5 import com.fasterxml.jackson.annotation.JsonIgnoreProperties; 5 import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
6 6
@@ -33,7 +33,7 @@ public class SKBUploadLogger { @@ -33,7 +33,7 @@ public class SKBUploadLogger {
33 33
34 /** 时刻表信息 */ 34 /** 时刻表信息 */
35 @ManyToOne(optional = false, cascade = CascadeType.DETACH, fetch = FetchType.LAZY) 35 @ManyToOne(optional = false, cascade = CascadeType.DETACH, fetch = FetchType.LAZY)
36 - private TTInfo ttInfo; 36 + private Line line;
37 37
38 /** 用户 关联 */ 38 /** 用户 关联 */
39 @ManyToOne(optional = false, cascade = CascadeType.DETACH, fetch = FetchType.LAZY) 39 @ManyToOne(optional = false, cascade = CascadeType.DETACH, fetch = FetchType.LAZY)
@@ -43,6 +43,23 @@ public class SKBUploadLogger { @@ -43,6 +43,23 @@ public class SKBUploadLogger {
43 @Column(updatable = false, name = "create_date", columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP") 43 @Column(updatable = false, name = "create_date", columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP")
44 private Date createDate; 44 private Date createDate;
45 45
  46 + // 上传的参数
  47 + @Column( name = "upload_xml" , columnDefinition="TEXT")
  48 + private String uploadXml;
  49 +
  50 + // 上传的参数2
  51 + @Column( name = "upload_xml_sub" , columnDefinition="TEXT")
  52 + private String uploadXmlSub;
  53 +
  54 + // 日志类型 1:时刻表;2:上传线路;3:上传路单
  55 + private String type;
  56 +
  57 + // 模板名称
  58 + private String name;
  59 +
  60 + // 上传状态:是否成功 1:成功;0:失败
  61 + private String state;
  62 +
46 public Integer getId() { 63 public Integer getId() {
47 return id; 64 return id;
48 } 65 }
@@ -51,14 +68,6 @@ public class SKBUploadLogger { @@ -51,14 +68,6 @@ public class SKBUploadLogger {
51 this.id = id; 68 this.id = id;
52 } 69 }
53 70
54 - public TTInfo getTtInfo() {  
55 - return ttInfo;  
56 - }  
57 -  
58 - public void setTtInfo(TTInfo ttInfo) {  
59 - this.ttInfo = ttInfo;  
60 - }  
61 -  
62 public SysUser getUser() { 71 public SysUser getUser() {
63 return user; 72 return user;
64 } 73 }
@@ -71,7 +80,29 @@ public class SKBUploadLogger { @@ -71,7 +80,29 @@ public class SKBUploadLogger {
71 return createDate; 80 return createDate;
72 } 81 }
73 82
74 - public void setCreateDate(Date createDate) {  
75 - this.createDate = createDate;  
76 - } 83 + public void setCreateDate(Date createDate) { this.createDate = createDate; }
  84 +
  85 + public String getUploadXml() { return uploadXml; }
  86 +
  87 + public void setUploadXml(String uploadXml) { this.uploadXml = uploadXml; }
  88 +
  89 + public String getState() { return state; }
  90 +
  91 + public void setState(String state) { this.state = state; }
  92 +
  93 + public Line getLine() { return line;}
  94 +
  95 + public void setLine(Line line) { this.line = line; }
  96 +
  97 + public String getType() { return type; }
  98 +
  99 + public void setType(String type) { this.type = type; }
  100 +
  101 + public String getName() { return name; }
  102 +
  103 + public void setName(String name) { this.name = name; }
  104 +
  105 + public String getUploadXmlSub() {return uploadXmlSub;}
  106 +
  107 + public void setUploadXmlSub(String uploadXmlSub) {this.uploadXmlSub = uploadXmlSub; }
77 } 108 }
src/main/java/com/bsth/service/calc/impl/CalcMixServiceImpl.java
@@ -306,9 +306,9 @@ public class CalcMixServiceImpl implements CalcMixService { @@ -306,9 +306,9 @@ public class CalcMixServiceImpl implements CalcMixService {
306 m.put("hyl", Arith.add(m.get("hyl"), sin_.getHyl()!=null?sin_.getHyl():0)); 306 m.put("hyl", Arith.add(m.get("hyl"), sin_.getHyl()!=null?sin_.getHyl():0));
307 m.put("jzl", Arith.add(m.get("jzl"), sin_.getJzl()!=null?sin_.getJzl():0)); 307 m.put("jzl", Arith.add(m.get("jzl"), sin_.getJzl()!=null?sin_.getJzl():0));
308 m.put("sh", Arith.add(m.get("sh"), sin_.getUnyyyl()!=null?sin_.getUnyyyl():0)); 308 m.put("sh", Arith.add(m.get("sh"), sin_.getUnyyyl()!=null?sin_.getUnyyyl():0));
309 - last.put("hyl", Arith.add(last.get("hyl"), m.get("hyl")));  
310 - last.put("jzl", Arith.add(last.get("jzl"), m.get("jzl")));  
311 - last.put("sh", Arith.add(last.get("sh"), m.get("sh"))); 309 + last.put("hyl", Arith.add(last.get("hyl"), sin_.getHyl()!=null?sin_.getHyl():0));
  310 + last.put("jzl", Arith.add(last.get("jzl"), sin_.getJzl()!=null?sin_.getJzl():0));
  311 + last.put("sh", Arith.add(last.get("sh"), sin_.getUnyyyl()!=null?sin_.getUnyyyl():0));
312 } else { 312 } else {
313 Map<String, Object> m = new HashMap<String, Object>(); 313 Map<String, Object> m = new HashMap<String, Object>();
314 m.put("gS", BasicData.businessFgsCodeNameMap.get(fgsdm+"_"+gsdm)); 314 m.put("gS", BasicData.businessFgsCodeNameMap.get(fgsdm+"_"+gsdm));
src/main/java/com/bsth/service/impl/TrafficManageServiceImpl.java
@@ -32,6 +32,7 @@ import org.slf4j.LoggerFactory; @@ -32,6 +32,7 @@ import org.slf4j.LoggerFactory;
32 import org.springframework.beans.factory.annotation.Autowired; 32 import org.springframework.beans.factory.annotation.Autowired;
33 import org.springframework.data.domain.Sort; 33 import org.springframework.data.domain.Sort;
34 import org.springframework.data.domain.Sort.Direction; 34 import org.springframework.data.domain.Sort.Direction;
  35 +import org.springframework.security.core.context.SecurityContextHolder;
35 import org.springframework.stereotype.Service; 36 import org.springframework.stereotype.Service;
36 37
37 import java.io.*; 38 import java.io.*;
@@ -65,6 +66,10 @@ import java.util.regex.Pattern; @@ -65,6 +66,10 @@ import java.util.regex.Pattern;
65 public class TrafficManageServiceImpl implements TrafficManageService{ 66 public class TrafficManageServiceImpl implements TrafficManageService{
66 67
67 Logger logger = LoggerFactory.getLogger(this.getClass()); 68 Logger logger = LoggerFactory.getLogger(this.getClass());
  69 + // 运管处上传日志类型
  70 + public static final String UPLOAD_TYPE_SKB = "1";
  71 + public static final String UPLOAD_TYPE_XL = "2";
  72 + public static final String UPLOAD_TYPE_LD = "3";
68 73
69 // 线路repository 74 // 线路repository
70 @Autowired 75 @Autowired
@@ -170,7 +175,7 @@ public class TrafficManageServiceImpl implements TrafficManageService{ @@ -170,7 +175,7 @@ public class TrafficManageServiceImpl implements TrafficManageService{
170 @Override 175 @Override
171 public String setXL(String ids) { 176 public String setXL(String ids) {
172 String result = "failure"; 177 String result = "failure";
173 - StringBuffer sBuffer = new StringBuffer(); 178 + String xml ;
174 String[] idArray = ids.split(","); 179 String[] idArray = ids.split(",");
175 try { 180 try {
176 for (String id : idArray) { 181 for (String id : idArray) {
@@ -185,12 +190,6 @@ public class TrafficManageServiceImpl implements TrafficManageService{ @@ -185,12 +190,6 @@ public class TrafficManageServiceImpl implements TrafficManageService{
185 if(line == null){ 190 if(line == null){
186 continue; 191 continue;
187 } 192 }
188 - List<StationRoute> upStationsList ;// 上行站点路由集  
189 - List<StationRoute> downStationsList;// 下行站点路由集  
190 - List<Object[]> downPointList;// 下行站点集  
191 - List<Object[]> upPointList;// 上行站点集  
192 - sBuffer.append("<XLs>");  
193 - sBuffer.append("<XL>");  
194 if(BasicData.lineId2ShangHaiCodeMap.get(line.getId()) == null){ 193 if(BasicData.lineId2ShangHaiCodeMap.get(line.getId()) == null){
195 return result; 194 return result;
196 } 195 }
@@ -200,56 +199,25 @@ public class TrafficManageServiceImpl implements TrafficManageService{ @@ -200,56 +199,25 @@ public class TrafficManageServiceImpl implements TrafficManageService{
200 if(lineInformation == null){ 199 if(lineInformation == null){
201 continue; 200 continue;
202 } 201 }
203 - sBuffer.append("<XLBM>").append(BasicData.lineId2ShangHaiCodeMap.get(line.getId())).append("</XLBM>");  
204 - sBuffer.append("<XLMC>").append(line.getName()).append("</XLMC>");  
205 - sBuffer.append("<QDZ>").append(line.getStartStationName()).append("</QDZ>");  
206 - sBuffer.append("<ZDZ>").append(line.getEndStationName()).append("</ZDZ>");  
207 - sBuffer.append("<QZLC>").append(lineInformation.getUpMileage()).append("</QZLC>");  
208 - sBuffer.append("<ZQLC>").append(lineInformation.getDownMileage()).append("</ZQLC>");  
209 - sBuffer.append("<XLGH>").append(line.getLinePlayType()).append("</XLGH>");  
210 - sBuffer.append("<UPDATE_DATE>").append(sdfnyr.format(new Date())).append("</UPDATE_DATE>");  
211 -  
212 - // 循环添加站点信息  
213 - sBuffer.append("<StationList>");  
214 -  
215 - // 先查上行  
216 - upStationsList = stationRouteRepository.findByLine(line.getLineCode(), 0);  
217 - Map<String, Integer> stationNumMap = getStationName2YgcNumberMap(line.getLineCode());  
218 - int startId = 1;  
219 - startId = packagStationXml(upStationsList, sBuffer, startId,stationNumMap);  
220 - // 环线不查下行  
221 - if(line.getLinePlayType() != 1){  
222 - // 再查下行  
223 - downStationsList = stationRouteRepository.findByLine(line.getLineCode(), 1);  
224 - packagStationXml(downStationsList, sBuffer, startId,stationNumMap);  
225 - }  
226 - sBuffer.append("</StationList>");  
227 -  
228 - // 循环添加站点点位信息  
229 - sBuffer.append("<LinePointList>");  
230 - upPointList = sectionRepository.getSectionDirByLineId(line.getId(),0);  
231 - startId = 1;  
232 - startId = packagStationPointXml(upPointList, sBuffer, startId);  
233 - // 环线不查下行  
234 - if(line.getLinePlayType() != 1){  
235 - downPointList = sectionRepository.getSectionDirByLineId(line.getId(),1);  
236 - packagStationPointXml(downPointList, sBuffer, startId);  
237 - }  
238 - sBuffer.append("</LinePointList>");  
239 - sBuffer.append("</XL>");  
240 - sBuffer.append("</XLs>");  
241 - // 临时添加,后面删除  
242 - if(sBuffer.indexOf("<ZDXH>0</ZDXH>") != -1){ 202 + // 取得封装好的xml
  203 + xml = getSetXlXml(line,lineInformation);
  204 + // 站点序号不能为0,如果为0,则返回错误
  205 + if(xml.indexOf("<ZDXH>0</ZDXH>") != -1){
243 return "0"; 206 return "0";
244 } 207 }
  208 + String state;// 是否上传成功
245 // 调用上传方法 209 // 调用上传方法
246 - if(getWebServiceSoapUp().setXL(userNameUp,passwordUp,sBuffer.toString()).isSuccess()){ 210 + if(getWebServiceSoapUp().setXL(userNameUp,passwordUp,xml).isSuccess()){
247 result = "success"; 211 result = "success";
  212 + state = "1";
248 }else{ 213 }else{
249 result = "failure"; 214 result = "failure";
  215 + state = "0";
250 } 216 }
251 - logger.info("setXL:"+sBuffer.toString()); 217 + logger.info("setXL:"+xml);
252 logger.info("setXL:"+result); 218 logger.info("setXL:"+result);
  219 + // 保存运管处上传记录
  220 + saveYgcUploadLog(line,xml,TrafficManageServiceImpl.UPLOAD_TYPE_XL,state);
253 } 221 }
254 } catch (Exception e) { 222 } catch (Exception e) {
255 logger.error("setXL:",e); 223 logger.error("setXL:",e);
@@ -422,10 +390,11 @@ public class TrafficManageServiceImpl implements TrafficManageService{ @@ -422,10 +390,11 @@ public class TrafficManageServiceImpl implements TrafficManageService{
422 HashMap logXlbmMap = new HashMap(); 390 HashMap logXlbmMap = new HashMap();
423 Results results = null; 391 Results results = null;
424 String str = "",xlbm; 392 String str = "",xlbm;
  393 + // 保存线路(运管处日志用)
  394 + Map<String , Line> logLineMap = null;
425 try { 395 try {
426 int counter = 0; // 计数器 396 int counter = 0; // 计数器
427 int per = 10; // 每几条线路上传一次路单 397 int per = 10; // 每几条线路上传一次路单
428 -  
429 List<ScheduleRealInfo> list = scheduleRealInfoRepository.setLD(date); 398 List<ScheduleRealInfo> list = scheduleRealInfoRepository.setLD(date);
430 List<Map<String,Object>> listGroup = scheduleRealInfoRepository.setLDGroup(date); 399 List<Map<String,Object>> listGroup = scheduleRealInfoRepository.setLDGroup(date);
431 Map<String,Object> map = new HashMap(); 400 Map<String,Object> map = new HashMap();
@@ -444,13 +413,15 @@ public class TrafficManageServiceImpl implements TrafficManageService{ @@ -444,13 +413,15 @@ public class TrafficManageServiceImpl implements TrafficManageService{
444 if(counter % per == 0){ 413 if(counter % per == 0){
445 sf = new StringBuffer(); 414 sf = new StringBuffer();
446 sf.append("<DLDS>"); 415 sf.append("<DLDS>");
  416 + logLineMap = new HashMap<>();
447 } 417 }
448 counter ++; 418 counter ++;
449 xlbm = BasicData.lineCode2ShangHaiCodeMap.get(schRealInfo.get("xlBm")+""); 419 xlbm = BasicData.lineCode2ShangHaiCodeMap.get(schRealInfo.get("xlBm")+"");
450 - // 保存一次路单的线路编码,用于发送邮箱  
451 - if(logXlbmMap.get(xlbm) == null){ 420 + // 保存一线次路单的路编码,用于发送邮箱
  421 + if(xlbm != null && !xlbm.equals("null") && logXlbmMap.get(xlbm) == null){
452 logXlbmMap.put(xlbm,xlbm); 422 logXlbmMap.put(xlbm,xlbm);
453 } 423 }
  424 + logLineMap.put(line.getLineCode(),line);
454 sf.append("<DLD>"); 425 sf.append("<DLD>");
455 sf.append("<RQ>"+date+"</RQ>"); 426 sf.append("<RQ>"+date+"</RQ>");
456 sf.append("<XLBM>"+xlbm+"</XLBM>"); 427 sf.append("<XLBM>"+xlbm+"</XLBM>");
@@ -513,7 +484,7 @@ public class TrafficManageServiceImpl implements TrafficManageService{ @@ -513,7 +484,7 @@ public class TrafficManageServiceImpl implements TrafficManageService{
513 str = sf.toString().replace("'","");// 去掉'号 484 str = sf.toString().replace("'","");// 去掉'号
514 results = ssop.setLD(userNameOther, passwordOther, StringEscapeUtils.unescapeHtml(str)); 485 results = ssop.setLD(userNameOther, passwordOther, StringEscapeUtils.unescapeHtml(str));
515 // 记录日志 486 // 记录日志
516 - result = logRecord(results,logXlbmMap,logXlbmSuccessMap,logXlbmFailureMap,logSuccess,logFailure,str); 487 + result = logRecord(results,logXlbmMap,logXlbmSuccessMap,logXlbmFailureMap,logSuccess,logFailure,str,logLineMap);
517 } 488 }
518 } 489 }
519 // 每per条线路上传后剩下的数据再上传 490 // 每per条线路上传后剩下的数据再上传
@@ -521,9 +492,9 @@ public class TrafficManageServiceImpl implements TrafficManageService{ @@ -521,9 +492,9 @@ public class TrafficManageServiceImpl implements TrafficManageService{
521 sf.append("</DLDS>"); 492 sf.append("</DLDS>");
522 str = sf.toString().replace("'","");// 去掉'号 493 str = sf.toString().replace("'","");// 去掉'号
523 results = ssop.setLD(userNameOther, passwordOther, StringEscapeUtils.unescapeHtml(str)); 494 results = ssop.setLD(userNameOther, passwordOther, StringEscapeUtils.unescapeHtml(str));
  495 + // 记录日志
  496 + result = logRecord(results,logXlbmMap,logXlbmSuccessMap,logXlbmFailureMap,logSuccess,logFailure,str,logLineMap);
524 } 497 }
525 - // 记录日志  
526 - result = logRecord(results,logXlbmMap,logXlbmSuccessMap,logXlbmFailureMap,logSuccess,logFailure,str);  
527 } catch (Exception e) { 498 } catch (Exception e) {
528 logger.error("setLD:",e); 499 logger.error("setLD:",e);
529 logFailure.append(e).append("<br/>"); 500 logFailure.append(e).append("<br/>");
@@ -558,21 +529,26 @@ public class TrafficManageServiceImpl implements TrafficManageService{ @@ -558,21 +529,26 @@ public class TrafficManageServiceImpl implements TrafficManageService{
558 * @param str 529 * @param str
559 */ 530 */
560 private String logRecord(Results results,HashMap logXlbmMap,HashMap logXlbmSuccessMap,HashMap logXlbmFailureMap,StringBuffer logSuccess, 531 private String logRecord(Results results,HashMap logXlbmMap,HashMap logXlbmSuccessMap,HashMap logXlbmFailureMap,StringBuffer logSuccess,
561 - StringBuffer logFailure,String str){ 532 + StringBuffer logFailure,String str,Map<String ,Line> logLineMap){
562 String result = "failure"; 533 String result = "failure";
  534 + String state;
563 // 记录日志 535 // 记录日志
564 if(results != null){ 536 if(results != null){
565 if(results.isSuccess()){// 上传成功 537 if(results.isSuccess()){// 上传成功
566 // 把上线成功的线路编码放入 logXlbmSuccessMap,并记录logSuccess 538 // 把上线成功的线路编码放入 logXlbmSuccessMap,并记录logSuccess
567 countSuccess += fillMailXlbmMap(logXlbmMap,logXlbmSuccessMap,logSuccess); 539 countSuccess += fillMailXlbmMap(logXlbmMap,logXlbmSuccessMap,logSuccess);
568 result = "success"; 540 result = "success";
  541 + state = "1";
569 }else{// 上传失败 542 }else{// 上传失败
570 // 把上线失败的线路编码放入 logXlbmFailureMap,并记录logFailure 543 // 把上线失败的线路编码放入 logXlbmFailureMap,并记录logFailure
571 countFailure += fillMailXlbmMap(logXlbmMap,logXlbmFailureMap,logFailure); 544 countFailure += fillMailXlbmMap(logXlbmMap,logXlbmFailureMap,logFailure);
572 result = "failure"; 545 result = "failure";
  546 + state = "0";
573 } 547 }
574 logger.info("setLD:"+str); 548 logger.info("setLD:"+str);
575 logger.info("setLD:"+result); 549 logger.info("setLD:"+result);
  550 + // 保存运管处上传记录
  551 + saveYgcUploadLog(logLineMap,str,TrafficManageServiceImpl.UPLOAD_TYPE_LD,state);
576 results = null; 552 results = null;
577 logXlbmMap = new HashMap(); 553 logXlbmMap = new HashMap();
578 } 554 }
@@ -946,7 +922,7 @@ public class TrafficManageServiceImpl implements TrafficManageService{ @@ -946,7 +922,7 @@ public class TrafficManageServiceImpl implements TrafficManageService{
946 @Override 922 @Override
947 public String setSKB(String ids) { 923 public String setSKB(String ids) {
948 String result = "上传失败,"; 924 String result = "上传失败,";
949 - StringBuffer sBuffer = new StringBuffer(); 925 + StringBuffer sBuffer = new StringBuffer("<SKBs>");
950 DecimalFormat df = new DecimalFormat("######0.000"); 926 DecimalFormat df = new DecimalFormat("######0.000");
951 Map<String,String> lsStationCode2NameMap = null; 927 Map<String,String> lsStationCode2NameMap = null;
952 Map<String, Integer> lsStationName2YgcNumber = null; 928 Map<String, Integer> lsStationName2YgcNumber = null;
@@ -962,7 +938,6 @@ public class TrafficManageServiceImpl implements TrafficManageService{ @@ -962,7 +938,6 @@ public class TrafficManageServiceImpl implements TrafficManageService{
962 LineInformation lineInformation; 938 LineInformation lineInformation;
963 Iterator<TTInfoDetail> ttInfoDetailIterator; 939 Iterator<TTInfoDetail> ttInfoDetailIterator;
964 HashMap<String,Object> param ; 940 HashMap<String,Object> param ;
965 - sBuffer.append("<SKBs>");  
966 HashMap<String,String> paramMap; 941 HashMap<String,String> paramMap;
967 HashMap<String,String> otherMap = new HashMap<>(); 942 HashMap<String,String> otherMap = new HashMap<>();
968 // 线路编码、周几执行、发车站点名称、发车站点序号、到达站点名称、到达站点序号 943 // 线路编码、周几执行、发车站点名称、发车站点序号、到达站点名称、到达站点序号
@@ -1113,29 +1088,103 @@ public class TrafficManageServiceImpl implements TrafficManageService{ @@ -1113,29 +1088,103 @@ public class TrafficManageServiceImpl implements TrafficManageService{
1113 logger.info("setSKB:"+"ttinfoId:"+ttinfoId+";当前站点版本号:"+lineVersion+";查询历史站点路由:"+lsStationCode2NameMap+";查询历史站点编号:"+lsStationName2YgcNumber); 1088 logger.info("setSKB:"+"ttinfoId:"+ttinfoId+";当前站点版本号:"+lineVersion+";查询历史站点路由:"+lsStationCode2NameMap+";查询历史站点编号:"+lsStationName2YgcNumber);
1114 } 1089 }
1115 sBuffer.append("</SKBs>"); 1090 sBuffer.append("</SKBs>");
1116 - if(ssop.setSKB(userNameOther, passwordOther, sBuffer.toString()).isSuccess()){  
1117 - result = "上传成功";  
1118 - SKBUploadLogger skbUploadLogger ;  
1119 - SysUser user = SecurityUtils.getCurrentUser();  
1120 - // 保存时刻表上传记录  
1121 - for(TTInfo ttInfo1 : ttinfoList){  
1122 - skbUploadLogger = new SKBUploadLogger();  
1123 - skbUploadLogger.setTtInfo(ttInfo1);  
1124 - skbUploadLogger.setUser(user);  
1125 - skbUploadLoggerRepository.save(skbUploadLogger);  
1126 - }  
1127 - } 1091 + String state;// 是否上传成功
  1092 + if(ssop.setSKB(userNameOther, passwordOther, sBuffer.toString()).isSuccess()){
  1093 + result = "上传成功";
  1094 + state = "1";
  1095 + }else{// 上传失败
  1096 + result = "上传失败";
  1097 + state = "0";
  1098 + }
  1099 + // 保存运管处上传记录
  1100 + saveYgcUploadLog(ttinfoList,sBuffer.toString(),TrafficManageServiceImpl.UPLOAD_TYPE_SKB,state);
1128 } catch (Exception e) { 1101 } catch (Exception e) {
1129 logger.error("setSKB:", e); 1102 logger.error("setSKB:", e);
1130 e.printStackTrace(); 1103 e.printStackTrace();
1131 }finally{ 1104 }finally{
1132 - logger.info("setSKB:"+sBuffer.toString());  
1133 - logger.info("setSKB:"+result); 1105 + logger.info("setSKB:"+sBuffer.toString());
  1106 + logger.info("setSKB:"+result);
1134 } 1107 }
1135 return result; 1108 return result;
1136 } 1109 }
1137 1110
1138 /** 1111 /**
  1112 + * 保存上传运管处的日志
  1113 + * @param obj 参数
  1114 + * @param type 日志类型
  1115 + * @param xml 上传参数
  1116 + */
  1117 + private void saveYgcUploadLog(Object obj,String xml,String type,String state){
  1118 + SKBUploadLogger skbUploadLogger = new SKBUploadLogger();
  1119 + SysUser user;
  1120 + // 如果不是人为上传,SysUser则为空,设置上传人员为管理员
  1121 + if(SecurityContextHolder.getContext() == null || SecurityContextHolder.getContext().getAuthentication() == null){
  1122 + user = new SysUser();
  1123 + user.setId(1);
  1124 + }else{// 获取上传人员
  1125 + user = SecurityUtils.getCurrentUser();
  1126 + }
  1127 + // 最大的字符长度
  1128 + int maxLength = 60000;
  1129 + int cutLength = 50000;// 需要截取的字符长度
  1130 + String xml_sub = null;
  1131 + skbUploadLogger.setType(type);// 设置类型
  1132 + // 判断xml是否超长,如果超长,则截取
  1133 + if(xml != null && xml.length() > maxLength){
  1134 + int xmlLength = xml.length();
  1135 + int cutCount = xmlLength / cutLength + (xmlLength % cutLength > 0 ? 1 : 0);
  1136 + if(cutCount > 2){
  1137 + xml = "由于上传参数内容超长,请查看服务器的系统日志";
  1138 + }else if(cutCount == 2){
  1139 + xml_sub =xml.substring(cutLength);
  1140 + xml = xml.substring(0,cutLength);
  1141 + }else{
  1142 + // 不做处理
  1143 + }
  1144 + }
  1145 + skbUploadLogger.setUploadXml(xml);// 上传的参数
  1146 + skbUploadLogger.setUploadXmlSub(xml_sub);
  1147 + skbUploadLogger.setState(state);// 状态:是否成功
  1148 + skbUploadLogger.setUser(user);
  1149 + // 时刻表
  1150 + if(type.equals(TrafficManageServiceImpl.UPLOAD_TYPE_SKB)){
  1151 + List<TTInfo> ttInfoList = (List<TTInfo>)obj;
  1152 + String name = "";
  1153 + Line line = null;
  1154 + for(TTInfo ttInfo : ttInfoList){
  1155 + name += ttInfo.getName() + " ";
  1156 + line = ttInfo.getXl();
  1157 + }
  1158 + skbUploadLogger.setLine(line);
  1159 + skbUploadLogger.setUser(user);
  1160 + skbUploadLogger.setName(name);
  1161 + skbUploadLoggerRepository.save(skbUploadLogger);
  1162 + }else{
  1163 + if(type.equals(TrafficManageServiceImpl.UPLOAD_TYPE_XL)){
  1164 + Line line = (Line) obj;
  1165 + String name = line.getName() + "线路停靠站上传";
  1166 + skbUploadLogger.setLine(line);
  1167 + skbUploadLogger.setName(name);
  1168 + skbUploadLoggerRepository.save(skbUploadLogger);
  1169 + }else if(type.equals(TrafficManageServiceImpl.UPLOAD_TYPE_LD)){
  1170 + Map<String ,Line> logLineMap = (Map<String ,Line> )obj;
  1171 + for (String key : logLineMap.keySet()) {
  1172 + Line line = logLineMap.get(key);
  1173 + String name = line.getName() + "路单上传";
  1174 + skbUploadLogger = new SKBUploadLogger();
  1175 + skbUploadLogger.setType(type);// 设置类型
  1176 + skbUploadLogger.setUploadXml(xml);// 上传的参数
  1177 + skbUploadLogger.setUploadXmlSub(xml_sub);
  1178 + skbUploadLogger.setState(state);// 状态:是否成功
  1179 + skbUploadLogger.setUser(user);
  1180 + skbUploadLogger.setLine(line);
  1181 + skbUploadLogger.setName(name);
  1182 + skbUploadLoggerRepository.save(skbUploadLogger);
  1183 + }
  1184 + }
  1185 + }
  1186 + }
  1187 + /**
1139 * 上传线路人员车辆配置信息 1188 * 上传线路人员车辆配置信息
1140 */ 1189 */
1141 @Override 1190 @Override
@@ -1640,4 +1689,50 @@ public class TrafficManageServiceImpl implements TrafficManageService{ @@ -1640,4 +1689,50 @@ public class TrafficManageServiceImpl implements TrafficManageService{
1640 } 1689 }
1641 return tempStationName2YgcNumber; 1690 return tempStationName2YgcNumber;
1642 } 1691 }
  1692 +
  1693 + private String getSetXlXml(Line line,LineInformation lineInformation){
  1694 + StringBuffer sBuffer = new StringBuffer();
  1695 + List<StationRoute> upStationsList ;// 上行站点路由集
  1696 + List<StationRoute> downStationsList;// 下行站点路由集
  1697 + List<Object[]> downPointList;// 下行站点集
  1698 + List<Object[]> upPointList;// 上行站点集
  1699 + sBuffer.append("<XLs>");
  1700 + sBuffer.append("<XL>");
  1701 + sBuffer.append("<XLBM>").append(BasicData.lineId2ShangHaiCodeMap.get(line.getId())).append("</XLBM>");
  1702 + sBuffer.append("<XLMC>").append(line.getName()).append("</XLMC>");
  1703 + sBuffer.append("<QDZ>").append(line.getStartStationName()).append("</QDZ>");
  1704 + sBuffer.append("<ZDZ>").append(line.getEndStationName()).append("</ZDZ>");
  1705 + sBuffer.append("<QZLC>").append(lineInformation.getUpMileage()).append("</QZLC>");
  1706 + sBuffer.append("<ZQLC>").append(lineInformation.getDownMileage()).append("</ZQLC>");
  1707 + sBuffer.append("<XLGH>").append(line.getLinePlayType()).append("</XLGH>");
  1708 + sBuffer.append("<UPDATE_DATE>").append(sdfnyr.format(new Date())).append("</UPDATE_DATE>");
  1709 + // 循环添加站点信息
  1710 + sBuffer.append("<StationList>");
  1711 + // 先查上行
  1712 + upStationsList = stationRouteRepository.findByLine(line.getLineCode(), 0);
  1713 + Map<String, Integer> stationNumMap = getStationName2YgcNumberMap(line.getLineCode());
  1714 + int startId = 1;
  1715 + startId = packagStationXml(upStationsList, sBuffer, startId,stationNumMap);
  1716 + // 环线不查下行
  1717 + if(line.getLinePlayType() != 1){
  1718 + // 再查下行
  1719 + downStationsList = stationRouteRepository.findByLine(line.getLineCode(), 1);
  1720 + packagStationXml(downStationsList, sBuffer, startId,stationNumMap);
  1721 + }
  1722 + sBuffer.append("</StationList>");
  1723 + // 循环添加站点点位信息
  1724 + sBuffer.append("<LinePointList>");
  1725 + upPointList = sectionRepository.getSectionDirByLineId(line.getId(),0);
  1726 + startId = 1;
  1727 + startId = packagStationPointXml(upPointList, sBuffer, startId);
  1728 + // 环线不查下行
  1729 + if(line.getLinePlayType() != 1){
  1730 + downPointList = sectionRepository.getSectionDirByLineId(line.getId(),1);
  1731 + packagStationPointXml(downPointList, sBuffer, startId);
  1732 + }
  1733 + sBuffer.append("</LinePointList>");
  1734 + sBuffer.append("</XL>");
  1735 + sBuffer.append("</XLs>");
  1736 + return sBuffer.toString();
  1737 + }
1643 } 1738 }
src/main/java/com/bsth/service/report/impl/CalcSheetServiceImpl.java
@@ -790,11 +790,11 @@ public class CalcSheetServiceImpl extends BaseServiceImpl&lt;CalcSheet, Integer&gt; im @@ -790,11 +790,11 @@ public class CalcSheetServiceImpl extends BaseServiceImpl&lt;CalcSheet, Integer&gt; im
790 if(map.get("fgsdmTurn")!=null){ 790 if(map.get("fgsdmTurn")!=null){
791 fgs=map.get("fgsdmTurn").toString().trim(); 791 fgs=map.get("fgsdmTurn").toString().trim();
792 } 792 }
793 -// String nature="0";  
794 -// if(map.get("nature")!=null){  
795 -// nature=map.get("nature").toString();  
796 -// }  
797 -// Map<String, Boolean> lineMap=lineService.lineNature(); 793 + String nature="0";
  794 + if(map.get("nature")!=null){
  795 + nature=map.get("nature").toString();
  796 + }
  797 + Map<String, Boolean> lineMap=lineService.lineNature();
798 798
799 String startDate=map.get("startDate").toString(); 799 String startDate=map.get("startDate").toString();
800 String endDate=map.get("endDate").toString(); 800 String endDate=map.get("endDate").toString();
@@ -847,16 +847,82 @@ public class CalcSheetServiceImpl extends BaseServiceImpl&lt;CalcSheet, Integer&gt; im @@ -847,16 +847,82 @@ public class CalcSheetServiceImpl extends BaseServiceImpl&lt;CalcSheet, Integer&gt; im
847 return s; 847 return s;
848 } 848 }
849 }); 849 });
  850 +
  851 +
  852 + List<Map<String, Object>> list=new ArrayList<Map<String,Object>>();
  853 + int jhcc = 0, sjcc = 0;
  854 + int jhcczgf = 0, sjcczgf = 0;
  855 + int count=0;
  856 + Map<String, String> xlMap=new HashMap<String,String>();
  857 + for(Map<String, Object> m : lists){
  858 + if(nature.equals("0")){
  859 + list.add(m);
  860 + jhcc += Integer.valueOf(m.get("jhcc").toString());
  861 + sjcc += Integer.valueOf(m.get("sjcc").toString());
  862 + jhcczgf += Integer.valueOf(m.get("jhcczgf").toString());
  863 + sjcczgf +=Integer.valueOf(m.get("sjcczgf").toString());
  864 + if(xlMap.get(m.get("xl").toString())==null){
  865 + count++;
  866 + xlMap.put(m.get("xl").toString(), m.get("xl").toString());
  867 + }
  868 + }else if(nature.equals("1")){
  869 + if(lineMap.get(m.get("xl").toString())){
  870 + list.add(m);
  871 + jhcc += Integer.valueOf(m.get("jhcc").toString());
  872 + sjcc += Integer.valueOf(m.get("sjcc").toString());
  873 + jhcczgf += Integer.valueOf(m.get("jhcczgf").toString());
  874 + sjcczgf +=Integer.valueOf(m.get("sjcczgf").toString());
  875 + if(xlMap.get(m.get("xl").toString())==null){
  876 + count++;
  877 + xlMap.put(m.get("xl").toString(), m.get("xl").toString());
  878 + }
  879 + }
  880 + }else{
  881 + if(!lineMap.get(m.get("xl").toString())){
  882 + list.add(m);
  883 + jhcc += Integer.valueOf(m.get("jhcc").toString());
  884 + sjcc += Integer.valueOf(m.get("sjcc").toString());
  885 + jhcczgf += Integer.valueOf(m.get("jhcczgf").toString());
  886 + sjcczgf +=Integer.valueOf(m.get("sjcczgf").toString());
  887 + if(xlMap.get(m.get("xl").toString())==null){
  888 + count++;
  889 + xlMap.put(m.get("xl").toString(), m.get("xl").toString());
  890 + }
  891 + }
  892 + }
  893 +
  894 + }
  895 +
  896 + Map<String, Object> tempMap=new HashMap<String,Object>();
  897 + tempMap.put("rq", "分类汇总");
  898 + tempMap.put("line_", "共" + list.size() + "条线路");
  899 + tempMap.put("xlName", "共" +count + "条线路");
  900 + tempMap.put("jhcc", jhcc);
  901 + tempMap.put("sjcc", sjcc);
  902 + tempMap.put("sjcczgf", sjcczgf);
  903 + tempMap.put("jhcczgf", jhcczgf);
  904 + tempMap.put("sm", "");
  905 + list.add(tempMap);
  906 + if(jhcc != 0 && sjcc != 0){
  907 + tempMap.put("ccl", df.format(((float)sjcc / jhcc)*100)+"%");
  908 + }else{
  909 + tempMap.put("ccl", "0.00%");
  910 + }
  911 + if(jhcczgf != 0 && sjcczgf != 0){
  912 + tempMap.put("cclzgf", df.format(((float)sjcczgf / jhcczgf)*100)+"%");
  913 + }else{
  914 + tempMap.put("cclzgf", "0.00%");
  915 + }
850 if (type.equals("export")) { 916 if (type.equals("export")) {
851 String lineName=map.get("lineName").toString(); 917 String lineName=map.get("lineName").toString();
852 ReportUtils ee = new ReportUtils(); 918 ReportUtils ee = new ReportUtils();
853 List<Iterator<?>> listI = new ArrayList<Iterator<?>>(); 919 List<Iterator<?>> listI = new ArrayList<Iterator<?>>();
854 - listI.add(lists.iterator()); 920 + listI.add(list.iterator());
855 String path = this.getClass().getResource("/").getPath() + "static/pages/forms/"; 921 String path = this.getClass().getResource("/").getPath() + "static/pages/forms/";
856 ee.excelReplace(listI, new Object[] { map }, path + "mould/calcTurnoutrateZgf.xls", path + "export/" 922 ee.excelReplace(listI, new Object[] { map }, path + "mould/calcTurnoutrateZgf.xls", path + "export/"
857 + dates + "-" + lineName + "-营运线路出车率统计表.xls"); 923 + dates + "-" + lineName + "-营运线路出车率统计表.xls");
858 } 924 }
859 - return lists; 925 + return list;
860 } 926 }
861 927
862 @Override 928 @Override
src/main/resources/application-dev.properties
@@ -31,4 +31,4 @@ http.gps.real.cache.url= http://10.10.150.24:12580/realGps/all @@ -31,4 +31,4 @@ http.gps.real.cache.url= http://10.10.150.24:12580/realGps/all
31 ## gateway real data 31 ## gateway real data
32 http.gps.real.url= http://114.80.178.12:18080/transport_server/rtgps/ 32 http.gps.real.url= http://114.80.178.12:18080/transport_server/rtgps/
33 ## gateway send directive 33 ## gateway send directive
34 -http.send.directive = http://192.168.168.201:9090/transport_server/message/ 34 +http.send.directive = http://192.168.168.201:9090/transport_server/message/
35 \ No newline at end of file 35 \ No newline at end of file
src/main/resources/fatso/package.json
1 -{  
2 - "name": "fatso",  
3 - "version": "1.0.0",  
4 - "description": "子页面js检查、合并、压缩等处理",  
5 - "main": "start.js",  
6 - "scripts": {  
7 - "test": "echo \"Error: no test specified\" && exit 1"  
8 - },  
9 - "author": "panzhaov5",  
10 - "license": "ISC",  
11 - "dependencies": {  
12 - "cheerio": "^0.20.0",  
13 - "clean-css": "^4.0.12",  
14 - "colors": "^1.1.2",  
15 - "eventproxy": "^0.3.4",  
16 - "uglify-js": "^2.6.2"  
17 - }  
18 -}  
19 \ No newline at end of file 1 \ No newline at end of file
  2 +{
  3 + "name": "fatso",
  4 + "version": "1.0.0",
  5 + "description": "子页面js检查、合并、压缩等处理",
  6 + "main": "start.js",
  7 + "scripts": {
  8 + "test": "echo \"Error: no test specified\" && exit 1"
  9 + },
  10 + "author": "panzhaov5",
  11 + "license": "ISC",
  12 + "dependencies": {
  13 + "cheerio": "^0.20.0",
  14 + "clean-css": "^4.0.12",
  15 + "colors": "^1.3.3",
  16 + "eventproxy": "^0.3.4",
  17 + "uglify-js": "^2.6.2"
  18 + }
  19 +}
src/main/resources/static/pages/base/timesmodel/js/gantt.js
@@ -77,6 +77,7 @@ @@ -77,6 +77,7 @@
77 CSMap = getMaxCarAndStopSpace1(map); 77 CSMap = getMaxCarAndStopSpace1(map);
78 } else if (map.baseRes == '3') { // 主站停站使用v2_2版本 78 } else if (map.baseRes == '3') { // 主站停站使用v2_2版本
79 _paramObj = Main_v2.getFactory().createParameterObj(map, dataMap); // TODO:暂时使用v2_1版本的方法,通用的,后续再放到v2_2版本中 79 _paramObj = Main_v2.getFactory().createParameterObj(map, dataMap); // TODO:暂时使用v2_1版本的方法,通用的,后续再放到v2_2版本中
  80 + console.log(_paramObj);
80 map.clzs = InternalScheduleObj_v2_2.calcuClzx(_paramObj); 81 map.clzs = InternalScheduleObj_v2_2.calcuClzx(_paramObj);
81 CSMap = getMaxCarAndStopSpace1(map); 82 CSMap = getMaxCarAndStopSpace1(map);
82 } 83 }
@@ -186,7 +187,7 @@ @@ -186,7 +187,7 @@
186 return _rtnBcArray; 187 return _rtnBcArray;
187 }; 188 };
188 189
189 - // Main_v2_2.exportExcelConfig(_dfun); 190 + Main_v2_2.exportExcelConfig(_paramObj, _dfun);
190 } 191 }
191 192
192 // 关闭弹出层 193 // 关闭弹出层
src/main/resources/static/pages/base/timesmodel/js/v2_2/main_v2_2.js
1 -/**  
2 - * 主类(v2_2版本)。  
3 - */  
4 -var Main_v2_2 = function() {  
5 -  
6 - var _paramObj; // 参数对象  
7 -  
8 - return {  
9 - /**  
10 - * 使用发车间隔策略生成时刻表。  
11 - * @param paramObj 参数对象  
12 - * @param lpArray 路牌数组  
13 - * @constructor  
14 - */  
15 - BXPplaceClassesTime03 : function(paramObj, lpArray) {  
16 - // 参数对象  
17 - _paramObj = paramObj;  
18 -  
19 - // // 测试行驶时间  
20 - // var _fcsj = paramObj.toTimeObj("16:20");  
21 - // var _bcsj = StrategyUtils_v2_2.sFn("CALCU_RUNTIME")(false, _fcsj, paramObj); // 使用策略计算班次行驶时间  
22 - // console.log("发车时间=" + _fcsj.format("HH:mm") + ",行驶时间=" + _bcsj);  
23 - //  
24 -  
25 - // // 测试停站时间  
26 - // var _fcsj = paramObj.toTimeObj("05:30");  
27 - // var _layovertime = StrategyUtils_v2_2.sFn("CALCU_LAYOVER_TIME")(  
28 - // _fcsj, false, StrategyUtils_v2_2.sFn("CALCU_RUNTIME"), paramObj);  
29 - // console.log("发车时间=" + _fcsj.format("HH:mm") + ",停站layover时间=" + _layovertime);  
30 - //  
31 - // var schedule = {};  
32 -  
33 - // // 测试间隔时间  
34 - // var _fcsj = paramObj.toTimeObj("07:30");  
35 - // var _headway = StrategyUtils_v2_2.sFn("CALCU_HEADWAY_2")(true, _fcsj, _paramObj);  
36 - // console.log("发车时间=" + _fcsj.format("HH:mm") + ",发车间隔=" + _headway);  
37 -  
38 - // 1、初始化行车计划  
39 - var schedule = new InternalScheduleObj_v2_2(paramObj, lpArray);  
40 - // 2、生成班次(从第2圈开始)  
41 - schedule.fnCreateBclistWithMasterBc(2, 20);  
42 - // 3、调整发车间隔  
43 - schedule.fnAdjustHeadway();  
44 - // 4、计算吃饭班次  
45 - schedule.fnCalcuEatBc();  
46 - // // 6、计算末班车  
47 - // schedule.fnCalcuLastBc();  
48 - // 7、重新设置停站时间  
49 - schedule.fnReSetLayoverTime();  
50 - // 8、补进出场例保班次  
51 - schedule.fnCalcuOtherBc();  
52 -  
53 - //-------------------- 输出ganut图上的班次,班型描述 ----------------------//  
54 - // TODO:班型再议  
55 - return {  
56 - 'json':schedule.fnToGanttBcArray(),'bxrcgs':null,  
57 - 'aInternalLpObj': schedule.fnGetLpArray()  
58 - };  
59 - },  
60 -  
61 - //----------------------------------- 导入导出配置 -----------------------------------//  
62 -  
63 - /**  
64 - * 导出时刻表配置。  
65 - * @param fnGetGanttBc 获取gantt班次方法  
66 - */  
67 - exportExcelConfig: function(fnGetGanttBc) {  
68 - var oExcel = new Main_v2_2_ExcelObj(_paramObj, fnGetGanttBc);  
69 -  
70 - $('.exportAddXls').off('click');  
71 - $('.exportAddXlsx').off('click');  
72 -  
73 - $('.exportAddXls').on('click', function() {  
74 -  
75 - var aInfos = {  
76 - "lpObjList": oExcel.fnGetLpBcInfoList(), // 路牌班次信息列表  
77 - "statInfoList": oExcel.fnGetStatInfoList(), // 统计项目列表  
78 - "parameterInfoList" : oExcel.fnGetParamInfoList() // 参数对象  
79 - };  
80 -  
81 - console.log(aInfos);  
82 -  
83 - $(".exportAdd").addClass("disabled");  
84 - $(".exportAddSpan").html("正在导出...");  
85 -  
86 - // 提交  
87 - $.ajax({  
88 - type: 'POST',  
89 - url: "/tidc/exportDTDFile/xls",  
90 - dataType: 'binary',  
91 - contentType: "application/json",  
92 - data: JSON.stringify(aInfos),  
93 - success: function(data){  
94 - oExcel.downloadFile(data, "application/octet-stream", "时刻表信息.xls");  
95 -  
96 - $(".exportAdd").removeClass("disabled");  
97 - $(".exportAddSpan").html(" 导出数据");  
98 - },  
99 - error: function(xhr, type){  
100 - alert('错误:TODO');  
101 -  
102 - $(".exportAdd").removeClass("disabled");  
103 - $(".exportAddSpan").html(" 导出数据");  
104 - }  
105 - });  
106 - });  
107 -  
108 - $('.exportAddXlsx').on('click', function() {  
109 - var aInfos = {  
110 - "lpObjList": oExcel.fnGetLpBcInfoList(), // 路牌班次信息列表  
111 - "statInfoList": oExcel.fnGetStatInfoList(), // 统计项目列表  
112 - "parameterInfoList" : oExcel.fnGetParamInfoList() // 参数对象  
113 - };  
114 -  
115 - console.log(aInfos);  
116 -  
117 - $(".exportAdd").addClass("disabled");  
118 - $(".exportAddSpan").html("正在导出...");  
119 -  
120 - // 提交  
121 - $.ajax({  
122 - type: 'POST',  
123 - url: "/tidc/exportDTDFile/xlsx",  
124 - dataType: 'binary',  
125 - contentType: "application/json",  
126 - data: JSON.stringify(aInfos),  
127 - success: function(data){  
128 - oExcel.downloadFile(data, "application/octet-stream", "时刻表信息.xlsx");  
129 -  
130 - $(".exportAdd").removeClass("disabled");  
131 - $(".exportAddSpan").html(" 导出数据");  
132 - },  
133 - error: function(xhr, type){  
134 - alert('错误:TODO');  
135 -  
136 - $(".exportAdd").removeClass("disabled");  
137 - $(".exportAddSpan").html(" 导出数据");  
138 - }  
139 - });  
140 - });  
141 - }  
142 -  
143 -  
144 - } 1 +/**
  2 + * 主类(v2_2版本)。
  3 + */
  4 +var Main_v2_2 = function() {
  5 +
  6 + var _paramObj; // 参数对象
  7 +
  8 + return {
  9 + /**
  10 + * 使用发车间隔策略生成时刻表。
  11 + * @param paramObj 参数对象
  12 + * @param lpArray 路牌数组
  13 + * @constructor
  14 + */
  15 + BXPplaceClassesTime03 : function(paramObj, lpArray) {
  16 + // 参数对象
  17 + _paramObj = paramObj;
  18 +
  19 + // // 测试行驶时间
  20 + // var _fcsj = paramObj.toTimeObj("16:20");
  21 + // var _bcsj = StrategyUtils_v2_2.sFn("CALCU_RUNTIME")(false, _fcsj, paramObj); // 使用策略计算班次行驶时间
  22 + // console.log("发车时间=" + _fcsj.format("HH:mm") + ",行驶时间=" + _bcsj);
  23 + //
  24 +
  25 + // // 测试停站时间
  26 + // var _fcsj = paramObj.toTimeObj("05:30");
  27 + // var _layovertime = StrategyUtils_v2_2.sFn("CALCU_LAYOVER_TIME")(
  28 + // _fcsj, false, StrategyUtils_v2_2.sFn("CALCU_RUNTIME"), paramObj);
  29 + // console.log("发车时间=" + _fcsj.format("HH:mm") + ",停站layover时间=" + _layovertime);
  30 + //
  31 + // var schedule = {};
  32 +
  33 + // // 测试间隔时间
  34 + // var _fcsj = paramObj.toTimeObj("07:30");
  35 + // var _headway = StrategyUtils_v2_2.sFn("CALCU_HEADWAY_2")(true, _fcsj, _paramObj);
  36 + // console.log("发车时间=" + _fcsj.format("HH:mm") + ",发车间隔=" + _headway);
  37 +
  38 + // 1、初始化行车计划
  39 + var schedule = new InternalScheduleObj_v2_2(paramObj, lpArray);
  40 + // 2、生成班次(从第2圈开始)
  41 + schedule.fnCreateBclistWithMasterBc(2, 20);
  42 + // 3、调整发车间隔
  43 + schedule.fnAdjustHeadway();
  44 + // 4、计算吃饭班次
  45 + schedule.fnCalcuEatBc();
  46 + // // 6、计算末班车
  47 + // schedule.fnCalcuLastBc();
  48 + // 7、重新设置停站时间
  49 + schedule.fnReSetLayoverTime();
  50 + // 8、补进出场例保班次
  51 + schedule.fnCalcuOtherBc();
  52 +
  53 + //-------------------- 输出ganut图上的班次,班型描述 ----------------------//
  54 + // TODO:班型再议
  55 + return {
  56 + 'json':schedule.fnToGanttBcArray(),'bxrcgs':null,
  57 + 'aInternalLpObj': schedule.fnGetLpArray()
  58 + };
  59 + },
  60 +
  61 + //----------------------------------- 导入导出配置 -----------------------------------//
  62 +
  63 + /**
  64 + * 导出时刻表配置。
  65 + * @param fnGetGanttBc 获取gantt班次方法
  66 + */
  67 + exportExcelConfig: function(fnGetGanttBc) {
  68 + var oExcel = new Main_v2_2_ExcelObj(_paramObj, fnGetGanttBc);
  69 +
  70 + $('.exportAddXls').off('click');
  71 + $('.exportAddXlsx').off('click');
  72 +
  73 + $('.exportAddXls').on('click', function() {
  74 +
  75 + var aInfos = {
  76 + "lpObjList": oExcel.fnGetLpBcInfoList(), // 路牌班次信息列表
  77 + "statInfoList": oExcel.fnGetStatInfoList(), // 统计项目列表
  78 + "parameterInfoList" : oExcel.fnGetParamInfoList() // 参数对象
  79 + };
  80 +
  81 + console.log(aInfos);
  82 +
  83 + $(".exportAdd").addClass("disabled");
  84 + $(".exportAddSpan").html("正在导出...");
  85 +
  86 + // 提交
  87 + $.ajax({
  88 + type: 'POST',
  89 + url: "/tidc/exportDTDFile/xls",
  90 + dataType: 'binary',
  91 + contentType: "application/json",
  92 + data: JSON.stringify(aInfos),
  93 + success: function(data){
  94 + oExcel.downloadFile(data, "application/octet-stream", "时刻表信息.xls");
  95 +
  96 + $(".exportAdd").removeClass("disabled");
  97 + $(".exportAddSpan").html(" 导出数据");
  98 + },
  99 + error: function(xhr, type){
  100 + alert('错误:TODO');
  101 +
  102 + $(".exportAdd").removeClass("disabled");
  103 + $(".exportAddSpan").html(" 导出数据");
  104 + }
  105 + });
  106 + });
  107 +
  108 + $('.exportAddXlsx').on('click', function() {
  109 + var aInfos = {
  110 + "lpObjList": oExcel.fnGetLpBcInfoList(), // 路牌班次信息列表
  111 + "statInfoList": oExcel.fnGetStatInfoList(), // 统计项目列表
  112 + "parameterInfoList" : oExcel.fnGetParamInfoList() // 参数对象
  113 + };
  114 +
  115 + console.log(aInfos);
  116 +
  117 + $(".exportAdd").addClass("disabled");
  118 + $(".exportAddSpan").html("正在导出...");
  119 +
  120 + // 提交
  121 + $.ajax({
  122 + type: 'POST',
  123 + url: "/tidc/exportDTDFile/xlsx",
  124 + dataType: 'binary',
  125 + contentType: "application/json",
  126 + data: JSON.stringify(aInfos),
  127 + success: function(data){
  128 + oExcel.downloadFile(data, "application/octet-stream", "时刻表信息.xlsx");
  129 +
  130 + $(".exportAdd").removeClass("disabled");
  131 + $(".exportAddSpan").html(" 导出数据");
  132 + },
  133 + error: function(xhr, type){
  134 + alert('错误:TODO');
  135 +
  136 + $(".exportAdd").removeClass("disabled");
  137 + $(".exportAddSpan").html(" 导出数据");
  138 + }
  139 + });
  140 + });
  141 + }
  142 +
  143 +
  144 + }
145 }(); 145 }();
146 \ No newline at end of file 146 \ No newline at end of file
src/main/resources/static/pages/forms/calc/calcjsyspy.html
@@ -89,7 +89,6 @@ @@ -89,7 +89,6 @@
89 <th>实际空驶里程</th> 89 <th>实际空驶里程</th>
90 <th>烂班里程</th> 90 <th>烂班里程</th>
91 <th>临加营运里程</th> 91 <th>临加营运里程</th>
92 - <th>临加空驶里程</th>  
93 </tr> 92 </tr>
94 </thead> 93 </thead>
95 <tbody> 94 <tbody>
@@ -302,7 +301,6 @@ @@ -302,7 +301,6 @@
302 <td>{{obj.sjfyylc}}</td> 301 <td>{{obj.sjfyylc}}</td>
303 <td>{{obj.lblc}}</td> 302 <td>{{obj.lblc}}</td>
304 <td>{{obj.ljyylc}}</td> 303 <td>{{obj.ljyylc}}</td>
305 - <td>{{obj.ljfyylc}}</td>  
306 </tr> 304 </tr>
307 {{/each}} 305 {{/each}}
308 {{if list.length == 0}} 306 {{if list.length == 0}}
src/main/resources/static/pages/forms/calc/calcsingledata.html
@@ -186,10 +186,10 @@ @@ -186,10 +186,10 @@
186 var temp = tempData[$("#line").val()].split(":"); 186 var temp = tempData[$("#line").val()].split(":");
187 $("#gsdmSing").val(temp[0]); 187 $("#gsdmSing").val(temp[0]);
188 updateCompany(); 188 updateCompany();
189 -// $("#fgsdmSing").val(temp[1]);  
190 - $("#fgsdmSing").val(""); 189 + $("#fgsdmSing").val(temp[1]);
  190 +// $("#fgsdmSing").val("");
191 $("#gsdmSing").attr("disabled", true); 191 $("#gsdmSing").attr("disabled", true);
192 -// $("#fgsdmSing").attr("disabled", true); 192 + $("#fgsdmSing").attr("disabled", true);
193 } 193 }
194 }); 194 });
195 195
src/main/resources/static/pages/forms/mould/calcjsyspy.xls
No preview for this file type
src/main/resources/static/pages/mforms/shifdays/shifday.html
@@ -277,7 +277,10 @@ $(function(){ @@ -277,7 +277,10 @@ $(function(){
277 var gsdmShif = $("#gsdmShif").val(); 277 var gsdmShif = $("#gsdmShif").val();
278 var fgsdmShif = $("#fgsdmShif").val(); 278 var fgsdmShif = $("#fgsdmShif").val();
279 var params = {}; 279 var params = {};
280 - params.fgsdmShif =fgsdmShif; 280 + if(line )
  281 + if(line ==" " || line ==""){
  282 + params.fgsdmShif =fgsdmShif;
  283 + }
281 params.date =date; 284 params.date =date;
282 params.gsdmShif =gsdmShif; 285 params.gsdmShif =gsdmShif;
283 params.line =line; 286 params.line =line;
@@ -308,12 +311,14 @@ $(function(){ @@ -308,12 +311,14 @@ $(function(){
308 var fgsdmShif = $("#fgsdmShif").val(); 311 var fgsdmShif = $("#fgsdmShif").val();
309 var lineName = $('#line option:selected').text(); 312 var lineName = $('#line option:selected').text();
310 var params = {}; 313 var params = {};
311 - params.fgsdmShif =fgsdmShif;  
312 - params.date =date;  
313 - params.gsdmShif =gsdmShif;  
314 - params.line =line;  
315 - params.type='export';  
316 - params.lineName =lineName; 314 + if(line ==" " || line ==""){
  315 + params.fgsdmShif =fgsdmShif;
  316 + }
  317 + params.date =date;
  318 + params.gsdmShif =gsdmShif;
  319 + params.line =line;
  320 + params.type='export';
  321 + params.lineName =lineName;
317 $get('/mcy_export/shifdayExport',params,function(result){ 322 $get('/mcy_export/shifdayExport',params,function(result){
318 window.open("/downloadFile/download?fileName=" 323 window.open("/downloadFile/download?fileName="
319 +moment(date).format("YYYYMMDD")+ 324 +moment(date).format("YYYYMMDD")+
src/main/resources/static/pages/mforms/turnoutrates/calcTurnoutrateZgf.html
@@ -28,7 +28,7 @@ @@ -28,7 +28,7 @@
28 28
29 <div class="page-head"> 29 <div class="page-head">
30 <div class="page-title"> 30 <div class="page-title">
31 - <h1>营运线路出车率统计表</h1> 31 + <h1>营运线路早高峰出车率统计表</h1>
32 </div> 32 </div>
33 </div> 33 </div>
34 34
@@ -50,6 +50,15 @@ @@ -50,6 +50,15 @@
50 <select class="form-control" name="line" id="line" style="width: 140px;"></select> 50 <select class="form-control" name="line" id="line" style="width: 140px;"></select>
51 </div> 51 </div>
52 <div style="margin-top: 10px"></div> 52 <div style="margin-top: 10px"></div>
  53 + <div style="display: inline-block;">
  54 + <span class="item-label" style="width: 80px;">线路性质: </span> <select
  55 + class="form-control" name="nature" id="nature"
  56 + style="width: 140px;">
  57 + <option value="0">全部线路</option>
  58 + <option value="1" selected="selected">营运线路</option>
  59 + <option value="2">非营运线路</option>
  60 + </select>
  61 + </div>
53 <div style="display: inline-block;margin-left: 15px;"> 62 <div style="display: inline-block;margin-left: 15px;">
54 <span class="item-label" style="width: 80px;">开始时间: </span> 63 <span class="item-label" style="width: 80px;">开始时间: </span>
55 <input class="form-control" type="text" id="startDate" style="width: 140px;"/> 64 <input class="form-control" type="text" id="startDate" style="width: 140px;"/>
src/main/resources/static/pages/permission/authorize_all/user_auth.html
1 -<!-- 用户线调授权页面 -->  
2 -<div id="user_authorize_wrap" style="height: 100%;">  
3 - <div class="top_title"></div>  
4 -  
5 - <div class="xd_line_list">  
6 - </div>  
7 - <div class="top_tools">  
8 - <form class="ct_pattern_form">  
9 - <div class="uk-margin">  
10 - <div uk-form-custom="target: > * > span:first" style="display: none">  
11 - <select id="pattern_select">  
12 - <option value="0">监控模式</option>  
13 - <option value="1">主调模式</option>  
14 - <option value="2">作废模式</option>  
15 - </select>  
16 - <button class="uk-button uk-button-default" type="button" tabindex="-1">  
17 - <span></span>  
18 - <span uk-icon="icon: chevron-down"></span>  
19 - </button>  
20 - </div>  
21 - </div>  
22 - </form>  
23 - <div class="add_line_icon" uk-toggle="target: #select_line_modal">  
24 - <i uk-icon="icon: plus"></i> 添加线路  
25 - </div>  
26 - &nbsp;&nbsp;  
27 - <button class="uk-button uk-button-primary uk-button-small" id="global_save_btn">保存哇!</button>  
28 - </div>  
29 -  
30 - <div class="uk-child-width-expand uk-grid-small xd_menu_grid" uk-grid style="display: none;">  
31 -  
32 - <div>  
33 - <h4>数据&统计</h4>  
34 - <ul class="uk-list uk-list-large uk-list-divider">  
35 - <li><label><input class="uk-checkbox" type="checkbox" data-event="curr_date_schedule"> 当日计划排班</label></li>  
36 - <li><label><input class="uk-checkbox" type="checkbox" data-event="cache_data_manage"> 缓存数据管理</label></li>  
37 - <li><label><input class="uk-checkbox" type="checkbox" data-event="history_sch_maintain"> 历史路单维护</label></li>  
38 - <li><label><input class="uk-checkbox" type="checkbox" data-event="sch_edit_info"> 班次修正日志</label></li>  
39 - </ul>  
40 - </div>  
41 -  
42 - <div>  
43 - <h4>报表管理</h4>  
44 - <ul class="uk-list uk-list-large uk-list-divider">  
45 - <li><label><input class="uk-checkbox" type="checkbox" data-event="form_waybill"> 行车路单</label></li>  
46 - <li><label><input class="uk-checkbox" type="checkbox" data-event="form_history_message"> 调度历史消息</label></li>  
47 - <li><label><input class="uk-checkbox" type="checkbox" data-event="form_account"> 驾驶员请求台账</label></li>  
48 - <li><label><input class="uk-checkbox" type="checkbox" data-event="form_correctForm"> 修正报表</label></li>  
49 - <li><label><input class="uk-checkbox" type="checkbox" data-event="form_statisticsDaily"> 统计日报</label></li>  
50 - <li><label><input class="uk-checkbox" type="checkbox" data-event="form_scheduleDaily"> 调度日报</label></li>  
51 - <li><label><input class="uk-checkbox" type="checkbox" data-event="form_jobSummary"> 工作汇总</label></li>  
52 - <li><label><input class="uk-checkbox" type="checkbox" data-event="form_daily"> 班次日报表</label></li>  
53 - <li><label><input class="uk-checkbox" type="checkbox" data-event="form_inoutstation"> 班次到离站</label></li>  
54 - <li><label><input class="uk-checkbox" type="checkbox" data-event="form_oilListMonth"> 月存油报表</label></li>  
55 - <li><label><input class="uk-checkbox" type="checkbox" data-event="form_scheduleAnaly"> 时刻表分析</label></li>  
56 - <li><label><input class="uk-checkbox" type="checkbox" data-event="form_message"> 调度消息分析</label></li>  
57 - <li><label><input class="uk-checkbox" type="checkbox" data-event="form_changetochange"> 换人换车情况统计表</label></li>  
58 - </ul>  
59 - </div>  
60 -  
61 - <div>  
62 - <h4>车载设备</h4>  
63 - <ul class="uk-list uk-list-large uk-list-divider">  
64 - <li><label><input class="uk-checkbox" type="checkbox" data-event="all_devices"> 设备管理</label></li>  
65 - <li><label><input class="uk-checkbox" type="checkbox" data-event="directive_history"> 指令下发记录</label></li>  
66 - <li><label><input class="uk-checkbox" type="checkbox" data-event="device_report"> 设备上报记录</label></li>  
67 - <li><label><input class="uk-checkbox" type="checkbox" data-event="gps_play_back"> 轨迹回放</label></li>  
68 - <li><label><input class="uk-checkbox" type="checkbox" data-event="safe_driving"> 安全驾驶(图像)</label></li>  
69 - </ul>  
70 - </div>  
71 -  
72 - <div>  
73 - <h4>系统设置</h4>  
74 - <ul class="uk-list uk-list-large uk-list-divider">  
75 - <li><label><input class="uk-checkbox" type="checkbox" data-event="line_config"> 线路配置</label></li>  
76 - <li><label><input class="uk-checkbox" type="checkbox" data-event="fbzdzx_config"> 翻班与自动执行</label></li>  
77 - <li><label><input class="uk-checkbox" type="checkbox" data-event="tts_config"> TTS</label></li>  
78 - <li><label><input class="uk-checkbox" type="checkbox" data-event="signal_state"> 信号标记</label></li>  
79 - </ul>  
80 - </div>  
81 -  
82 - </div>  
83 -  
84 - <!-- This is the modal -->  
85 - <div id="select_line_modal" class="uk-modal-container" uk-modal="bg-close:false;">  
86 - <div class="uk-modal-dialog uk-modal-body">  
87 - <button class="uk-modal-close-outside" type="button" uk-close></button>  
88 - <h2 class="uk-modal-title">添加线路权限</h2>  
89 - <div>  
90 - <form>  
91 - <div class="ct_field" style="width: 140px;">  
92 - <label>状态</label>  
93 - <select class="uk-select" id="modal_type_select" style="width: 94px;">  
94 - <option value="-1">全部</option>  
95 - <option value="0">营运</option>  
96 - <option value="1">撤销</option>  
97 - </select>  
98 - </div>  
99 - <div class="ct_field">  
100 - <label>公司</label>  
101 - <select class="uk-select" id="modal_company_select"></select>  
102 - </div>  
103 - <div class="ct_field">  
104 - <label>分公司</label>  
105 - <select class="uk-select" id="modal_sub_company_select" disabled></select>  
106 - </div>  
107 - <div class="ct_field">  
108 - <label>线路</label>  
109 - <input class="uk-input" id="modal_line_input" placeholder="没做拼音映射!!"/>  
110 - </div>  
111 - <label><input class="uk-checkbox" type="checkbox" id="globalCheckbox"> 全选</label>  
112 - </form>  
113 - <div class="uk-modal-body line_checkbox_list" style="padding: 0 !important;" uk-overflow-auto>  
114 - </div>  
115 - </div>  
116 - <p class="uk-text-right">  
117 - <button class="uk-button uk-button-default uk-modal-close" type="button">取消</button>  
118 - <button class="uk-button uk-button-primary" id="confirmBtn" type="button">确定</button>  
119 - </p>  
120 - </div>  
121 - </div>  
122 -  
123 - <script id="authorize-user-auth-lines-temp" type="text/html">  
124 - {{each list as t i}}  
125 - <h5>{{t.fgsName}}</h5>  
126 - <div class="sub_lines">  
127 - {{each t.list as obj j}}  
128 - <span title="{{obj.lineCode}}" class="line_btn {{obj.destroy==1?'destroy':''}}">{{obj.name}}</span>  
129 - {{/each}}  
130 - </div>  
131 - {{/each}}  
132 - </script>  
133 - <script id="authorize-user-auth-title-temp" type="text/html">  
134 - <div style="font-weight: 600;">{{name}}({{userName}})  
135 - </div>  
136 - <!--<div class="desc">最近登录 {{lastLoginDateStr}}</div>-->  
137 - <div class="desc">...</div>  
138 - </script>  
139 -  
140 - <script id="authorize-modal-lines-temp" type="text/html">  
141 - {{each list as obj i}}  
142 - <label class="btn {{obj.destroy==1?'destroy':''}}" data-gs="{{obj.company}}" data-fgs="{{obj.brancheCompany}}"  
143 - title="{{obj.name}}" data-code="{{obj.lineCode}}">  
144 - <input class="uk-checkbox" type="checkbox">{{obj.name}}  
145 - </label>  
146 - {{/each}}  
147 - </script>  
148 - <script>  
149 - (function () {  
150 - var wrap = '#user_authorize_wrap', user, xd_auth, all_lines, companyData;  
151 - //分公司名称映射(只用于分组展示,就写死)  
152 -  
153 - var fgs_name_mapp = {  
154 - '55_3': '上南公司(六分公司)',  
155 - '55_1': '上南公司(二分公司)',  
156 - '55_2': '上南公司(三分公司)',  
157 - '55_4': '上南公司(一分公司)',  
158 - '55_5': '上南公司(培训部)',  
159 - '22_2': '金高公司(二分公司)',  
160 - '22_1': '金高公司(四分公司)',  
161 - '22_3': '金高公司(三分公司)',  
162 - '22_5': '金高公司(一分公司)',  
163 - '26_3': '南汇公司(三分公司)',  
164 - '26_2': '南汇公司(南汇二分)',  
165 - '26_1': '南汇公司(南汇一分)',  
166 - '26_4': '南汇公司(南汇维修公司)',  
167 - '26_5': '南汇公司(南汇公司)',  
168 - '26_6': '南汇公司(南汇六分)',  
169 - '05_5': '杨高公司(杨高分公司)',  
170 - '05_6': '杨高公司(周浦分公司)',  
171 - '05_3': '杨高公司(芦潮港分公司)',  
172 - '05_1': '杨高公司(川沙分公司)',  
173 - '05_2': '杨高公司(金桥分公司)',  
174 - '77_78': '闵行公司',  
175 - '300_301': '金球公交',  
176 - '99_100': '青浦公交',  
177 - '24_1': '一车队',  
178 - '24_2': '二车队',  
179 - '24_3': '三车队'  
180 -  
181 - };  
182 -  
183 - var defauleConfig;  
184 - var patSelect;  
185 - $(wrap).on('init', function (e, data) {  
186 - e.stopPropagation();  
187 - user = data.user;  
188 - all_lines = data.lineArray;  
189 - companyData = data.companyData;  
190 -  
191 - all_lines.sort(function (a, b) {  
192 - return a.name.localeCompare(b.name);  
193 - });  
194 - //top title  
195 - var htmlStr = template('authorize-user-auth-title-temp', user);  
196 - $('.top_title', wrap).html(htmlStr);  
197 -  
198 - //用户线调权限  
199 - defauleConfig = {userId: user.id, pattern: 0, excludeMenus: 'history_sch_maintain'};  
200 - $.get('/realControAuthority/findByUserId', {userId: user.id}, function (rs) {  
201 - //console.log('rsrs',rs);  
202 - xd_auth = rs;  
203 - if (!xd_auth)  
204 - xd_auth = defauleConfig;  
205 - //渲染线路权限  
206 - render_auth_lines();  
207 - //渲染菜单权限  
208 - render_auth_menus();  
209 - //渲染线路选择modal  
210 - //render_line_select_modal();  
211 - patSelect = rs.pattern;  
212 - $('#pattern_select', wrap).val(xd_auth.pattern).trigger('change').parent().show();  
213 - });  
214 - });  
215 - $('#pattern_select').change(function () {  
216 - if ($('#pattern_select', wrap).val() == 2 && $('#pattern_select', wrap).val() != patSelect) {  
217 - // UIkit.modal.confirm("选择作废模式后该用户将失去所有线路和权限", function(){  
218 - //  
219 - // });  
220 - UIkit.modal.alert("选择作废模式后该用户将失去所有线路和权限!");  
221 - }  
222 -  
223 - })  
224 -  
225 - function render_auth_lines() {  
226 - var data = [], codeArray = [];  
227 - if (xd_auth && xd_auth.lineCodeStr)  
228 - codeArray = xd_auth.lineCodeStr.split(',');  
229 -  
230 - $.each(all_lines, function () {  
231 - if (codeArray.indexOf(this.lineCode) != -1)  
232 - data.push(this);  
233 - });  
234 -  
235 - data.sort(function (a, b) {  
236 - return a.name.localeCompare(b.name);  
237 - });  
238 - //按分公司分组  
239 - var gd = groupBy(data, 'cgsbm');  
240 - data = [];  
241 - for (var code in gd) {  
242 - data.push({  
243 - code: code,  
244 - fgsName: fgs_name_mapp[code],  
245 - list: gd[code]  
246 - });  
247 - if (!fgs_name_mapp[code]) {  
248 - alert('出现异常的公司归属 :' + code);  
249 - }  
250 - }  
251 -  
252 - data.sort(function (a, b) {  
253 - return a.fgsName.localeCompare(b.fgsName);  
254 - });  
255 -  
256 - var htmlStr = template('authorize-user-auth-lines-temp', {list: data});  
257 - $('.xd_line_list', wrap).html(htmlStr);  
258 -  
259 - //滚动条  
260 - $('.xd_line_list', wrap).perfectScrollbar({suppressScrollX: true});  
261 - }  
262 -  
263 - function render_auth_menus() {  
264 - debugger  
265 - var excludeArray = [], event;  
266 - if (xd_auth && xd_auth.excludeMenus)  
267 - excludeArray = xd_auth.excludeMenus.split(',');  
268 -  
269 - $('.xd_menu_grid li>label>input').each(function () {  
270 - event = $(this).data('event');  
271 - if (excludeArray.indexOf(event) == -1)  
272 - this.checked = true;  
273 - });  
274 - $('.xd_menu_grid').show();  
275 - $('.xd_menu_grid .uk-list', wrap).perfectScrollbar('update');  
276 - }  
277 -  
278 - $('.xd_menu_grid .uk-list', wrap).perfectScrollbar({suppressScrollX: true});  
279 -  
280 - /**  
281 - * 线路选择modal  
282 - */  
283 - var compSelectData, modal = '#select_line_modal', modalRender;  
284 - $(modal).on('show', function () {  
285 - if (!modalRender) {  
286 - render_line_select_modal();  
287 - modalRender = true;  
288 - }  
289 - $('#modal_line_input', modal).focus();  
290 - });  
291 -  
292 - function render_line_select_modal() {  
293 - var htmlStr = template('authorize-modal-lines-temp', {  
294 - list: all_lines,  
295 - destroy: $('.modal_type_select', modal).val()  
296 - });  
297 - $('.line_checkbox_list').html(htmlStr);  
298 - //选中线路  
299 - var codeArray = [];  
300 - if (xd_auth && xd_auth.lineCodeStr)  
301 - codeArray = xd_auth.lineCodeStr.split(',');  
302 -  
303 - $('.line_checkbox_list>label.btn').each(function () {  
304 - if (codeArray.indexOf($(this).data('code') + '') != -1) {  
305 - $(this).addClass('active').find('>input')[0].checked = true;  
306 - }  
307 - });  
308 -  
309 - //构建公司级联下拉框  
310 - compSelectData = convert_buss_data(companyData);  
311 - var companyStr = '<option value="">请选择...</option>';  
312 - for (var code in compSelectData) {  
313 - companyStr += '<option value="' + code + '">' + compSelectData[code].name + '</option>';  
314 - }  
315 - $('#modal_company_select', modal).html(companyStr).on('change', function () {  
316 - var code = $(this).val(), subSelect = $('#modal_sub_company_select', modal);  
317 - if (!code)  
318 - subSelect.empty().attr('disabled', 'disabled');  
319 - else {  
320 - var subCompStr = '<option value="">请选择...</option>';  
321 - $.each(compSelectData[code].childs, function () {  
322 - subCompStr += '<option value="' + this.businessCode + '">' + this.businessName + '</option>';  
323 - });  
324 - subSelect.html(subCompStr).removeAttr('disabled');  
325 - }  
326 - //过滤线路  
327 - filter_modal_lines();  
328 - });  
329 - $('#modal_sub_company_select', modal).on('change', filter_modal_lines);  
330 - $('#modal_type_select', modal).on('change', filter_modal_lines);  
331 - }  
332 -  
333 - $('#modal_line_input', modal).on('input', function () {  
334 - var t = $(this).val() + '';  
335 - if (!t) {  
336 - filter_modal_lines();  
337 - return;  
338 - }  
339 - var codes = [];  
340 - $.each(all_lines, function () {  
341 - if (this.name.indexOf(t) != -1)  
342 - codes.push(this.lineCode);  
343 - });  
344 -  
345 - var array = $('.line_checkbox_list>label.btn').css('display', 'none');  
346 - array.each(function () {  
347 - if (codes.indexOf($(this).data('code') + '') != -1)  
348 - $(this).css('display', 'inline-block');  
349 - });  
350 - });  
351 -  
352 - function filter_modal_lines() {  
353 - console.log('filter_modal_lines');  
354 - var company = $('#modal_company_select', modal).val(),//公司代码  
355 - sub_company = $('#modal_sub_company_select', modal).val(),//分公司代码  
356 - type = $('#modal_type_select', modal).val();//线路状态  
357 -  
358 - var array = $('.line_checkbox_list>label.btn').css('display', 'none'), s_dom = [];  
359 -  
360 - if (!company && !sub_company && type == -1) {  
361 - array.css('display', 'inline-block');  
362 - return;  
363 - }  
364 -  
365 - var status;  
366 - array.each(function () {  
367 - if (company && $(this).data('gs') != company)  
368 - return true;  
369 - if (sub_company && $(this).data('fgs') != sub_company)  
370 - return true;  
371 -  
372 - status = $(this).hasClass('destroy') ? 1 : 0;  
373 - if (type != -1 && type != status)  
374 - return true;  
375 -  
376 - s_dom.push(this);  
377 - });  
378 - for (var i = 0, dom; dom = s_dom[i++];)  
379 - $(dom).css('display', 'inline-block');  
380 - }  
381 -  
382 - $('.line_checkbox_list').on('click', 'label.btn', function () {  
383 - if ($('input', this)[0].checked)  
384 - $(this).addClass('active');  
385 - else  
386 - $(this).removeClass('active');  
387 - });  
388 -  
389 - //全选  
390 - $('#globalCheckbox', modal).on('click', function () {  
391 - var state = this.checked;  
392 - $('.line_checkbox_list>label.btn:visible>input').each(function () {  
393 - this.checked = state;  
394 - });  
395 -  
396 - $('.line_checkbox_list>label.btn:visible').each(function () {  
397 - if (state)  
398 - $(this).addClass('active');  
399 - else  
400 - $(this).removeClass('active');  
401 - });  
402 - });  
403 -  
404 - //确定  
405 - $('#confirmBtn', modal).on('click', function () {  
406 - var lines = '';  
407 - $('.line_checkbox_list>label.btn.active').each(function () {  
408 - lines += ($(this).data('code') + ',');  
409 - });  
410 - xd_auth.lineCodeStr = lines;  
411 - render_auth_lines();  
412 - UIkit.modal(modal).hide();  
413 - });  
414 -  
415 -  
416 - //保存  
417 - $('#global_save_btn', wrap).on('click', function () {  
418 - $(this).attr('disabled', 'disabled');  
419 - //调度模式  
420 - xd_auth.pattern = $('#pattern_select', wrap).val();  
421 - //要排除的线调菜单  
422 - var excludeMenus = '';  
423 - $('.xd_menu_grid ul input[type=checkbox]').each(function () {  
424 - if (!this.checked)  
425 - excludeMenus += $(this).data('event') + ',';  
426 - });  
427 - xd_auth.excludeMenus = excludeMenus;  
428 - if (xd_auth.pattern == 2) {  
429 - //UIkit.modal.confirm("选择作废模式后该用户将失去所有线路和权限", function () {  
430 - xd_auth.lineCodeStr = '';  
431 - var excludeMenusAll = '';  
432 - $('.xd_menu_grid ul input[type=checkbox]').each(function () {  
433 - excludeMenusAll += $(this).data('event') + ',';  
434 - });  
435 - xd_auth.excludeMenus = excludeMenusAll;  
436 - //});  
437 -  
438 - }  
439 - $.post('/realControAuthority', xd_auth, function (rs) {  
440 - UIkit.notification('保存成功!', 'primary');  
441 - $('.authorize_right_cont').trigger('refresh-user');  
442 - });  
443 - });  
444 - })();  
445 - </script> 1 +<!-- 用户线调授权页面 -->
  2 +<div id="user_authorize_wrap" style="height: 100%;">
  3 + <div class="top_title"></div>
  4 +
  5 + <div class="xd_line_list">
  6 + </div>
  7 + <div class="top_tools">
  8 + <form class="ct_pattern_form">
  9 + <div class="uk-margin">
  10 + <div uk-form-custom="target: > * > span:first" style="display: none">
  11 + <select id="pattern_select">
  12 + <option value="0">监控模式</option>
  13 + <option value="1">主调模式</option>
  14 + <option value="2">作废模式</option>
  15 + </select>
  16 + <button class="uk-button uk-button-default" type="button" tabindex="-1">
  17 + <span></span>
  18 + <span uk-icon="icon: chevron-down"></span>
  19 + </button>
  20 + </div>
  21 + </div>
  22 + </form>
  23 + <div class="add_line_icon" uk-toggle="target: #select_line_modal">
  24 + <i uk-icon="icon: plus"></i> 添加线路
  25 + </div>
  26 + &nbsp;&nbsp;
  27 + <button class="uk-button uk-button-primary uk-button-small" id="global_save_btn">保存哇!</button>
  28 + </div>
  29 +
  30 + <div class="uk-child-width-expand uk-grid-small xd_menu_grid" uk-grid style="display: none;">
  31 +
  32 + <div>
  33 + <h4>数据&统计</h4>
  34 + <ul class="uk-list uk-list-large uk-list-divider">
  35 + <li><label><input class="uk-checkbox" type="checkbox" data-event="curr_date_schedule"> 当日计划排班</label></li>
  36 + <li><label><input class="uk-checkbox" type="checkbox" data-event="cache_data_manage"> 缓存数据管理</label></li>
  37 + <li><label><input class="uk-checkbox" type="checkbox" data-event="history_sch_maintain"> 历史路单维护</label></li>
  38 + <li><label><input class="uk-checkbox" type="checkbox" data-event="sch_edit_info"> 班次修正日志</label></li>
  39 + </ul>
  40 + </div>
  41 +
  42 + <div>
  43 + <h4>报表管理</h4>
  44 + <ul class="uk-list uk-list-large uk-list-divider">
  45 + <li><label><input class="uk-checkbox" type="checkbox" data-event="form_waybill"> 行车路单</label></li>
  46 + <li><label><input class="uk-checkbox" type="checkbox" data-event="form_history_message"> 调度历史消息</label></li>
  47 + <li><label><input class="uk-checkbox" type="checkbox" data-event="form_account"> 驾驶员请求台账</label></li>
  48 + <li><label><input class="uk-checkbox" type="checkbox" data-event="form_correctForm"> 修正报表</label></li>
  49 + <li><label><input class="uk-checkbox" type="checkbox" data-event="form_statisticsDaily"> 统计日报</label></li>
  50 + <li><label><input class="uk-checkbox" type="checkbox" data-event="form_scheduleDaily"> 调度日报</label></li>
  51 + <li><label><input class="uk-checkbox" type="checkbox" data-event="form_jobSummary"> 工作汇总</label></li>
  52 + <li><label><input class="uk-checkbox" type="checkbox" data-event="form_daily"> 班次日报表</label></li>
  53 + <li><label><input class="uk-checkbox" type="checkbox" data-event="form_inoutstation"> 班次到离站</label></li>
  54 + <li><label><input class="uk-checkbox" type="checkbox" data-event="form_oilListMonth"> 月存油报表</label></li>
  55 + <li><label><input class="uk-checkbox" type="checkbox" data-event="form_scheduleAnaly"> 时刻表分析</label></li>
  56 + <li><label><input class="uk-checkbox" type="checkbox" data-event="form_message"> 调度消息分析</label></li>
  57 + <li><label><input class="uk-checkbox" type="checkbox" data-event="form_changetochange"> 换人换车情况统计表</label></li>
  58 + </ul>
  59 + </div>
  60 +
  61 + <div>
  62 + <h4>车载设备</h4>
  63 + <ul class="uk-list uk-list-large uk-list-divider">
  64 + <li><label><input class="uk-checkbox" type="checkbox" data-event="all_devices"> 设备管理</label></li>
  65 + <li><label><input class="uk-checkbox" type="checkbox" data-event="directive_history"> 指令下发记录</label></li>
  66 + <li><label><input class="uk-checkbox" type="checkbox" data-event="device_report"> 设备上报记录</label></li>
  67 + <li><label><input class="uk-checkbox" type="checkbox" data-event="gps_play_back"> 轨迹回放</label></li>
  68 + <li><label><input class="uk-checkbox" type="checkbox" data-event="safe_driving"> 安全驾驶(图像)</label></li>
  69 + </ul>
  70 + </div>
  71 +
  72 + <div>
  73 + <h4>系统设置</h4>
  74 + <ul class="uk-list uk-list-large uk-list-divider">
  75 + <li><label><input class="uk-checkbox" type="checkbox" data-event="line_config"> 线路配置</label></li>
  76 + <li><label><input class="uk-checkbox" type="checkbox" data-event="fbzdzx_config"> 翻班与自动执行</label></li>
  77 + <li><label><input class="uk-checkbox" type="checkbox" data-event="tts_config"> TTS</label></li>
  78 + <li><label><input class="uk-checkbox" type="checkbox" data-event="signal_state"> 信号标记</label></li>
  79 + </ul>
  80 + </div>
  81 +
  82 + </div>
  83 +
  84 + <!-- This is the modal -->
  85 + <div id="select_line_modal" class="uk-modal-container" uk-modal="bg-close:false;">
  86 + <div class="uk-modal-dialog uk-modal-body">
  87 + <button class="uk-modal-close-outside" type="button" uk-close></button>
  88 + <h2 class="uk-modal-title">添加线路权限</h2>
  89 + <div>
  90 + <form>
  91 + <div class="ct_field" style="width: 140px;">
  92 + <label>状态</label>
  93 + <select class="uk-select" id="modal_type_select" style="width: 94px;">
  94 + <option value="-1">全部</option>
  95 + <option value="0">营运</option>
  96 + <option value="1">撤销</option>
  97 + </select>
  98 + </div>
  99 + <div class="ct_field">
  100 + <label>公司</label>
  101 + <select class="uk-select" id="modal_company_select"></select>
  102 + </div>
  103 + <div class="ct_field">
  104 + <label>分公司</label>
  105 + <select class="uk-select" id="modal_sub_company_select" disabled></select>
  106 + </div>
  107 + <div class="ct_field">
  108 + <label>线路</label>
  109 + <input class="uk-input" id="modal_line_input" placeholder="没做拼音映射!!"/>
  110 + </div>
  111 + <label><input class="uk-checkbox" type="checkbox" id="globalCheckbox"> 全选</label>
  112 + </form>
  113 + <div class="uk-modal-body line_checkbox_list" style="padding: 0 !important;" uk-overflow-auto>
  114 + </div>
  115 + </div>
  116 + <p class="uk-text-right">
  117 + <button class="uk-button uk-button-default uk-modal-close" type="button">取消</button>
  118 + <button class="uk-button uk-button-primary" id="confirmBtn" type="button">确定</button>
  119 + </p>
  120 + </div>
  121 + </div>
  122 +
  123 + <script id="authorize-user-auth-lines-temp" type="text/html">
  124 + {{each list as t i}}
  125 + <h5>{{t.fgsName}}</h5>
  126 + <div class="sub_lines">
  127 + {{each t.list as obj j}}
  128 + <span title="{{obj.lineCode}}" class="line_btn {{obj.destroy==1?'destroy':''}}">{{obj.name}}</span>
  129 + {{/each}}
  130 + </div>
  131 + {{/each}}
  132 + </script>
  133 + <script id="authorize-user-auth-title-temp" type="text/html">
  134 + <div style="font-weight: 600;">{{name}}({{userName}})
  135 + </div>
  136 + <!--<div class="desc">最近登录 {{lastLoginDateStr}}</div>-->
  137 + <div class="desc">...</div>
  138 + </script>
  139 +
  140 + <script id="authorize-modal-lines-temp" type="text/html">
  141 + {{each list as obj i}}
  142 + <label class="btn {{obj.destroy==1?'destroy':''}}" data-gs="{{obj.company}}" data-fgs="{{obj.brancheCompany}}"
  143 + title="{{obj.name}}" data-code="{{obj.lineCode}}">
  144 + <input class="uk-checkbox" type="checkbox">{{obj.name}}
  145 + </label>
  146 + {{/each}}
  147 + </script>
  148 + <script>
  149 + (function () {
  150 + var wrap = '#user_authorize_wrap', user, xd_auth, all_lines, companyData;
  151 + //分公司名称映射(只用于分组展示,就写死)
  152 +
  153 + var fgs_name_mapp = {
  154 + '55_3': '上南公司(六分公司)',
  155 + '55_1': '上南公司(二分公司)',
  156 + '55_2': '上南公司(三分公司)',
  157 + '55_4': '上南公司(一分公司)',
  158 + '55_5': '上南公司(培训部)',
  159 + '22_2': '金高公司(二分公司)',
  160 + '22_1': '金高公司(四分公司)',
  161 + '22_3': '金高公司(三分公司)',
  162 + '22_5': '金高公司(一分公司)',
  163 + '26_3': '南汇公司(三分公司)',
  164 + '26_2': '南汇公司(南汇二分)',
  165 + '26_1': '南汇公司(南汇一分)',
  166 + '26_4': '南汇公司(南汇维修公司)',
  167 + '26_5': '南汇公司(南汇公司)',
  168 + '26_6': '南汇公司(南汇六分)',
  169 + '05_5': '杨高公司(杨高分公司)',
  170 + '05_6': '杨高公司(周浦分公司)',
  171 + '05_3': '杨高公司(芦潮港分公司)',
  172 + '05_1': '杨高公司(川沙分公司)',
  173 + '05_2': '杨高公司(金桥分公司)',
  174 + '77_78': '闵行公司',
  175 + '300_301': '金球公交',
  176 + '99_100': '青浦公交',
  177 + '24_1': '一车队',
  178 + '24_2': '二车队',
  179 + '24_3': '三车队'
  180 +
  181 + };
  182 +
  183 + var defauleConfig;
  184 + var patSelect;
  185 + $(wrap).on('init', function (e, data) {
  186 + e.stopPropagation();
  187 + user = data.user;
  188 + all_lines = data.lineArray;
  189 + companyData = data.companyData;
  190 +
  191 + all_lines.sort(function (a, b) {
  192 + return a.name.localeCompare(b.name);
  193 + });
  194 + //top title
  195 + var htmlStr = template('authorize-user-auth-title-temp', user);
  196 + $('.top_title', wrap).html(htmlStr);
  197 +
  198 + //用户线调权限
  199 + defauleConfig = {userId: user.id, pattern: 0, excludeMenus: 'history_sch_maintain'};
  200 + $.get('/realControAuthority/findByUserId', {userId: user.id}, function (rs) {
  201 + //console.log('rsrs',rs);
  202 + xd_auth = rs;
  203 + if (!xd_auth)
  204 + xd_auth = defauleConfig;
  205 + //渲染线路权限
  206 + render_auth_lines();
  207 + //渲染菜单权限
  208 + render_auth_menus();
  209 + //渲染线路选择modal
  210 + //render_line_select_modal();
  211 + patSelect = rs.pattern;
  212 + $('#pattern_select', wrap).val(xd_auth.pattern).trigger('change').parent().show();
  213 + });
  214 + });
  215 + $('#pattern_select').change(function () {
  216 + if ($('#pattern_select', wrap).val() == 2 && $('#pattern_select', wrap).val() != patSelect) {
  217 + // UIkit.modal.confirm("选择作废模式后该用户将失去所有线路和权限", function(){
  218 + //
  219 + // });
  220 + UIkit.modal.alert("选择作废模式后该用户将失去所有线路和权限!");
  221 + }
  222 +
  223 + })
  224 +
  225 + function render_auth_lines() {
  226 + var data = [], codeArray = [];
  227 + if (xd_auth && xd_auth.lineCodeStr)
  228 + codeArray = xd_auth.lineCodeStr.split(',');
  229 +
  230 + $.each(all_lines, function () {
  231 + if (codeArray.indexOf(this.lineCode) != -1)
  232 + data.push(this);
  233 + });
  234 +
  235 + data.sort(function (a, b) {
  236 + return a.name.localeCompare(b.name);
  237 + });
  238 + //按分公司分组
  239 + var gd = groupBy(data, 'cgsbm');
  240 + data = [];
  241 + for (var code in gd) {
  242 + data.push({
  243 + code: code,
  244 + fgsName: fgs_name_mapp[code],
  245 + list: gd[code]
  246 + });
  247 + if (!fgs_name_mapp[code]) {
  248 + alert('出现异常的公司归属 :' + code);
  249 + }
  250 + }
  251 +
  252 + data.sort(function (a, b) {
  253 + return a.fgsName.localeCompare(b.fgsName);
  254 + });
  255 +
  256 + var htmlStr = template('authorize-user-auth-lines-temp', {list: data});
  257 + $('.xd_line_list', wrap).html(htmlStr);
  258 +
  259 + //滚动条
  260 + $('.xd_line_list', wrap).perfectScrollbar({suppressScrollX: true});
  261 + }
  262 +
  263 + function render_auth_menus() {
  264 + debugger
  265 + var excludeArray = [], event;
  266 + if (xd_auth && xd_auth.excludeMenus)
  267 + excludeArray = xd_auth.excludeMenus.split(',');
  268 +
  269 + $('.xd_menu_grid li>label>input').each(function () {
  270 + event = $(this).data('event');
  271 + if (excludeArray.indexOf(event) == -1)
  272 + this.checked = true;
  273 + });
  274 + $('.xd_menu_grid').show();
  275 + $('.xd_menu_grid .uk-list', wrap).perfectScrollbar('update');
  276 + }
  277 +
  278 + $('.xd_menu_grid .uk-list', wrap).perfectScrollbar({suppressScrollX: true});
  279 +
  280 + /**
  281 + * 线路选择modal
  282 + */
  283 + var compSelectData, modal = '#select_line_modal', modalRender;
  284 + $(modal).on('show', function () {
  285 + if (!modalRender) {
  286 + render_line_select_modal();
  287 + modalRender = true;
  288 + }
  289 + $('#modal_line_input', modal).focus();
  290 + });
  291 +
  292 + function render_line_select_modal() {
  293 + var htmlStr = template('authorize-modal-lines-temp', {
  294 + list: all_lines,
  295 + destroy: $('.modal_type_select', modal).val()
  296 + });
  297 + $('.line_checkbox_list').html(htmlStr);
  298 + //选中线路
  299 + var codeArray = [];
  300 + if (xd_auth && xd_auth.lineCodeStr)
  301 + codeArray = xd_auth.lineCodeStr.split(',');
  302 +
  303 + $('.line_checkbox_list>label.btn').each(function () {
  304 + if (codeArray.indexOf($(this).data('code') + '') != -1) {
  305 + $(this).addClass('active').find('>input')[0].checked = true;
  306 + }
  307 + });
  308 +
  309 + //构建公司级联下拉框
  310 + compSelectData = convert_buss_data(companyData);
  311 + var companyStr = '<option value="">请选择...</option>';
  312 + for (var code in compSelectData) {
  313 + companyStr += '<option value="' + code + '">' + compSelectData[code].name + '</option>';
  314 + }
  315 + $('#modal_company_select', modal).html(companyStr).on('change', function () {
  316 + var code = $(this).val(), subSelect = $('#modal_sub_company_select', modal);
  317 + if (!code)
  318 + subSelect.empty().attr('disabled', 'disabled');
  319 + else {
  320 + var subCompStr = '<option value="">请选择...</option>';
  321 + $.each(compSelectData[code].childs, function () {
  322 + subCompStr += '<option value="' + this.businessCode + '">' + this.businessName + '</option>';
  323 + });
  324 + subSelect.html(subCompStr).removeAttr('disabled');
  325 + }
  326 + //过滤线路
  327 + filter_modal_lines();
  328 + });
  329 + $('#modal_sub_company_select', modal).on('change', filter_modal_lines);
  330 + $('#modal_type_select', modal).on('change', filter_modal_lines);
  331 + }
  332 +
  333 + $('#modal_line_input', modal).on('input', function () {
  334 + var t = $(this).val() + '';
  335 + if (!t) {
  336 + filter_modal_lines();
  337 + return;
  338 + }
  339 + var codes = [];
  340 + $.each(all_lines, function () {
  341 + if (this.name.indexOf(t) != -1)
  342 + codes.push(this.lineCode);
  343 + });
  344 +
  345 + var array = $('.line_checkbox_list>label.btn').css('display', 'none');
  346 + array.each(function () {
  347 + if (codes.indexOf($(this).data('code') + '') != -1)
  348 + $(this).css('display', 'inline-block');
  349 + });
  350 + });
  351 +
  352 + function filter_modal_lines() {
  353 + console.log('filter_modal_lines');
  354 + var company = $('#modal_company_select', modal).val(),//公司代码
  355 + sub_company = $('#modal_sub_company_select', modal).val(),//分公司代码
  356 + type = $('#modal_type_select', modal).val();//线路状态
  357 +
  358 + var array = $('.line_checkbox_list>label.btn').css('display', 'none'), s_dom = [];
  359 +
  360 + if (!company && !sub_company && type == -1) {
  361 + array.css('display', 'inline-block');
  362 + return;
  363 + }
  364 +
  365 + var status;
  366 + array.each(function () {
  367 + if (company && $(this).data('gs') != company)
  368 + return true;
  369 + if (sub_company && $(this).data('fgs') != sub_company)
  370 + return true;
  371 +
  372 + status = $(this).hasClass('destroy') ? 1 : 0;
  373 + if (type != -1 && type != status)
  374 + return true;
  375 +
  376 + s_dom.push(this);
  377 + });
  378 + for (var i = 0, dom; dom = s_dom[i++];)
  379 + $(dom).css('display', 'inline-block');
  380 + }
  381 +
  382 + $('.line_checkbox_list').on('click', 'label.btn', function () {
  383 + if ($('input', this)[0].checked)
  384 + $(this).addClass('active');
  385 + else
  386 + $(this).removeClass('active');
  387 + });
  388 +
  389 + //全选
  390 + $('#globalCheckbox', modal).on('click', function () {
  391 + var state = this.checked;
  392 + $('.line_checkbox_list>label.btn:visible>input').each(function () {
  393 + this.checked = state;
  394 + });
  395 +
  396 + $('.line_checkbox_list>label.btn:visible').each(function () {
  397 + if (state)
  398 + $(this).addClass('active');
  399 + else
  400 + $(this).removeClass('active');
  401 + });
  402 + });
  403 +
  404 + //确定
  405 + $('#confirmBtn', modal).on('click', function () {
  406 + var lines = '';
  407 + $('.line_checkbox_list>label.btn.active').each(function () {
  408 + lines += ($(this).data('code') + ',');
  409 + });
  410 + xd_auth.lineCodeStr = lines;
  411 + render_auth_lines();
  412 + UIkit.modal(modal).hide();
  413 + });
  414 +
  415 +
  416 + //保存
  417 + $('#global_save_btn', wrap).on('click', function () {
  418 + $(this).attr('disabled', 'disabled');
  419 + //调度模式
  420 + xd_auth.pattern = $('#pattern_select', wrap).val();
  421 + //要排除的线调菜单
  422 + var excludeMenus = '';
  423 + $('.xd_menu_grid ul input[type=checkbox]').each(function () {
  424 + if (!this.checked)
  425 + excludeMenus += $(this).data('event') + ',';
  426 + });
  427 + xd_auth.excludeMenus = excludeMenus;
  428 + if (xd_auth.pattern == 2) {
  429 + //UIkit.modal.confirm("选择作废模式后该用户将失去所有线路和权限", function () {
  430 + xd_auth.lineCodeStr = '';
  431 + var excludeMenusAll = '';
  432 + $('.xd_menu_grid ul input[type=checkbox]').each(function () {
  433 + excludeMenusAll += $(this).data('event') + ',';
  434 + });
  435 + xd_auth.excludeMenus = excludeMenusAll;
  436 + //});
  437 +
  438 + }
  439 + $.post('/realControAuthority', xd_auth, function (rs) {
  440 + UIkit.notification('保存成功!', 'primary');
  441 + $('.authorize_right_cont').trigger('refresh-user');
  442 + });
  443 + });
  444 + })();
  445 + </script>
446 </div> 446 </div>
447 \ No newline at end of file 447 \ No newline at end of file
src/main/resources/static/pages/permission/user/main.html
1 -<iframe src="authorize.html?origin=real_control_iframe" frameborder="0" style="height: 90%;width: 100%;"></iframe>  
2 -<div class="form-actions">  
3 - <div class="row">  
4 - <div class="col-md-offset-3 col-md-4">  
5 - <!--<a href="main.html" class="btn green" ><i class="fa fa-check"></i> 上一步</a>-->  
6 - <!--<button type="submit" class="btn green" ><i class="fa fa-check"></i> 提交</button>-->  
7 - <!--<a type="button" class="btn default" href="list.html" data-pjax><i class="fa fa-times"></i> 取消</a>-->  
8 - </div>  
9 - </div> 1 +<iframe src="authorize.html?origin=real_control_iframe" frameborder="0" style="height: 90%;width: 100%;"></iframe>
  2 +<div class="form-actions">
  3 + <div class="row">
  4 + <div class="col-md-offset-3 col-md-4">
  5 + <!--<a href="main.html" class="btn green" ><i class="fa fa-check"></i> 上一步</a>-->
  6 + <!--<button type="submit" class="btn green" ><i class="fa fa-check"></i> 提交</button>-->
  7 + <!--<a type="button" class="btn default" href="list.html" data-pjax><i class="fa fa-times"></i> 取消</a>-->
  8 + </div>
  9 + </div>
10 </div> 10 </div>
11 \ No newline at end of file 11 \ No newline at end of file
src/main/resources/static/pages/scheduleApp/Gruntfile.js
@@ -87,8 +87,10 @@ module.exports = function (grunt) { @@ -87,8 +87,10 @@ module.exports = function (grunt) {
87 'module/common/dts2/guideboardGroup/saGuideboardgroup.js', // 路牌选择整合指令 87 'module/common/dts2/guideboardGroup/saGuideboardgroup.js', // 路牌选择整合指令
88 'module/common/dts2/employeeGroup/saEmployeegroup.js', // 人员选饿整合指令 88 'module/common/dts2/employeeGroup/saEmployeegroup.js', // 人员选饿整合指令
89 'module/common/dts2/bcGroup/saBcgroup.js', // 班次选择整合指令 89 'module/common/dts2/bcGroup/saBcgroup.js', // 班次选择整合指令
90 - 'module/common/dts2/ttinfotable/saTimeTable.js', // 时刻表显示指令  
91 - 'module/common/dts2/ttinfotable/saTimeTableScrolly1.js', // 时刻表滚动1显示指令 90 + 'module/common/dts2/ttinfotable/saTimeTable.js', // 时刻表显示指令(编辑模式)
  91 + 'module/common/dts2/ttinfotable/saTimeTablePreView.js', // 时刻表显示指令(预览模式)
  92 + 'module/common/dts2/ttinfotable/saTimeTableScrolly1.js', // 时刻表滚动1显示指令(编辑模式)
  93 + 'module/common/dts2/ttinfotable/saTimeTableScrolly2.js', // 时刻表滚动2显示指令(预览模式)
92 'module/common/dts2/queryOption/saOrderOption.js', // saOrderoption指令,搜索时的排序选项(在搜索时可以使用,通用的) 94 'module/common/dts2/queryOption/saOrderOption.js', // saOrderoption指令,搜索时的排序选项(在搜索时可以使用,通用的)
93 'module/common/dts2/scheduleplan/saScpdate.js', // saScpdate指令(非通用指令,只在排班计划form中使用) 95 'module/common/dts2/scheduleplan/saScpdate.js', // saScpdate指令(非通用指令,只在排班计划form中使用)
94 'module/common/dts2/scheduleplan/saSrule.js', // saSrule指令(非通用指令,只在排班计划form中使用) 96 'module/common/dts2/scheduleplan/saSrule.js', // saSrule指令(非通用指令,只在排班计划form中使用)
src/main/resources/static/pages/scheduleApp/module/common/dts2/ttinfotable/saTimeTablePreView.js 0 → 100644
  1 +/**
  2 + * saTimetablePreview指令,时刻表预览模式视图。
  3 + */
  4 +angular.module("ScheduleApp").directive(
  5 + "saTimetable2",
  6 + [
  7 + '$timeout',
  8 + function($timeout) {
  9 + return {
  10 + restrict : 'E',
  11 + templateUrl : '/pages/scheduleApp/module/common/dts2/ttinfotable/saTimeTablePreViewTemplate.html',
  12 + scope : { // 独立作用域
  13 + // 使用外部数据源,内部重新组合显示
  14 + ds : "=ngModel"
  15 + },
  16 + controllerAs : "$saTimeTablePreviewCtrl",
  17 + bindToController: true,
  18 + controller : function() {
  19 + var self = this;
  20 +
  21 + // TODO:
  22 + },
  23 +
  24 + /**,
  25 + * compile阶段,angular还没有编译模版,根据需要可以修改模版dom
  26 + * @param tElem
  27 + * @param tAttrs
  28 + * @returns {{pre: Function, post: Function}}
  29 + */
  30 + compile : function(tElem, tAttrs) {
  31 + // 获取属性
  32 + var $attr_name = tAttrs["name"]; // 控件的名字
  33 + if (!$attr_name) {
  34 + throw new Error("saTimeTablePreview指令 name属性required");
  35 + }
  36 +
  37 + // TODO:
  38 +
  39 + return {
  40 + pre : function(scope, element, attr) {
  41 + // TODO:
  42 + },
  43 + post : function(scope, element, attr) {
  44 + // TODO:
  45 +
  46 + }
  47 + };
  48 + }
  49 + };
  50 + }
  51 + ]
  52 +);
0 \ No newline at end of file 53 \ No newline at end of file
src/main/resources/static/pages/scheduleApp/module/common/dts2/ttinfotable/saTimeTablePreViewTemplate.html 0 → 100644
  1 +<style>
  2 + .ttpv_detail {
  3 + height: 100%;
  4 + }
  5 + .ttpv_detail .container-fluid {
  6 + height: 100%;
  7 + margin-left: 0;
  8 + }
  9 + .ttpv_detail .container-fluid>* {
  10 + padding: 0;
  11 + }
  12 + .ttpv_detail .container-fluid.top-container {
  13 + margin-top: 5px;
  14 + padding: 0;
  15 + }
  16 +
  17 + .ttpv_detail .detail-panel {
  18 + padding: 0;
  19 + height: 100%;
  20 + border: 1px solid #ddd;
  21 + background: #fafafa;
  22 + border-radius: 10px !important;
  23 + moz-user-select: -moz-none;
  24 + -moz-user-select: none;
  25 + -o-user-select: none;
  26 + -khtml-user-select: none;
  27 + -webkit-user-select: none;
  28 + -ms-user-select: none;
  29 + user-select: none;
  30 + }
  31 +
  32 + .ttpv_detail .detail-panel .detail-wrap {
  33 + height: calc(100% - 1px);
  34 + padding: 0;
  35 +
  36 + font-size: 14px;
  37 + color: #cccaca;
  38 + }
  39 +
  40 + .ttpv_detail .detail-panel .detail-wrap .detail-title {
  41 + margin: 7px 0 5px;
  42 + text-indent: 5px;
  43 + margin: 0;
  44 + height: 31px;
  45 + line-height: 31px;
  46 + color: #2765A7;
  47 + }
  48 +
  49 + .ttpv_detail .detail-panel .detail-wrap .detail-body {
  50 + height: calc(100% - 37px);
  51 + background: #fff;
  52 + }
  53 +
  54 + .ttpv_detail .detail-panel .detail-wrap .detail-body .ttpv_table_wrap {
  55 + width: 100%;
  56 + height: 100%;
  57 + border-left: 0;
  58 + border-bottom: 0;
  59 + overflow: auto;
  60 + }
  61 +
  62 +</style>
  63 +
  64 +<style>
  65 + /** 表格样式 */
  66 + .ttpv_table {
  67 + position: relative;
  68 + padding-top: 30px;
  69 + font-size: 13px;
  70 + }
  71 +
  72 + .ttpv_table dl {
  73 + display: block;
  74 + /*width: 100%;*/
  75 + margin: 0;
  76 + /*border-bottom: 1px solid;*/
  77 + height: 30px;
  78 + cursor: default;
  79 + }
  80 + .ttpv_table dl {
  81 + font-size: 0;
  82 + white-space: nowrap;
  83 + }
  84 + .ttpv_table dl {
  85 + transition: all .1s ease;
  86 + }
  87 +
  88 + .ttpv_table dl dd, .ttpv_table dl dt {
  89 + display: inline-block;
  90 + white-space: nowrap;
  91 + overflow: hidden;
  92 + text-overflow: ellipsis;
  93 + height: 100%;
  94 + line-height: 30px;
  95 + border-right: 1px solid;
  96 + text-indent: 5px;
  97 + }
  98 + .ttpv_table dl dd, .ttpv_table dl dt {
  99 + border-right-color: #dedede;
  100 + font-size: 13px;
  101 + /*border-bottom: 1px solid #dedede;*/
  102 + border-top: 1px solid #dedede;
  103 + }
  104 +
  105 + .ttpv_table dl dt:nth-of-type(1), .ttpv_table dl dd:nth-of-type(1) {
  106 + width: 50px;
  107 + text-align: center;
  108 + }
  109 + .ttpv_table dl dt:nth-of-type(2), .ttpv_table dl dd:nth-of-type(2) {
  110 + width: 80px;
  111 + text-align: center;
  112 + }
  113 + .ttpv_table dl dt:nth-of-type(3), .ttpv_table dl dd:nth-of-type(3) {
  114 + width: 120px;
  115 + text-align: left;
  116 + }
  117 + .ttpv_table dl dt:nth-of-type(4), .ttpv_table dl dd:nth-of-type(4) {
  118 + width: 220px;
  119 + text-align: center;
  120 + }
  121 +
  122 + .ttpv_table > .ttpv_table_head {
  123 + position: absolute;
  124 + top: 0;
  125 + height: 30px;
  126 + background: #f5f5f5;
  127 + /*width: 100%;*/
  128 + line-height: 30px;
  129 + z-index: 1;
  130 + }
  131 + .ttpv_table_head dl {
  132 + border-bottom: 2px solid #96b9d7;
  133 + color: #333333;
  134 + background-color: #f5f5f5;
  135 + }
  136 + .ttpv_table_head dl dt {
  137 + font-weight: normal;
  138 + font-size: 12px;
  139 + }
  140 +
  141 + .ttpv_table > .ttpv_table_body {
  142 + /*width: 100%;*/
  143 + position: absolute;
  144 + border-bottom: 1px solid #dedede;
  145 + }
  146 +
  147 + .ttpv_table_body dd.ists {
  148 + background: #105383 !important;
  149 + color: white !important;
  150 + }
  151 + .ttpv_table_body dd.region {
  152 + background: #686d7b !important;
  153 + color: white !important;
  154 + }
  155 + .ttpv_table_body dd.isfb {
  156 + background: #adff00 !important;
  157 + color: #501a1a !important;
  158 + }
  159 +
  160 + .ttpv_table_body dd:nth-of-type(1) {
  161 + color: #2765A7;
  162 + background: #eae8e8;
  163 + /*border-bottom: 1px solid #b3b3b3;*/
  164 + border-right: 1px solid #b3b3b3;
  165 + text-align: center;
  166 + text-indent: -3px;
  167 + }
  168 + .ttpv_table_body dd:nth-of-type(n + 2) {
  169 + color: #2765A7;
  170 + }
  171 + .ttpv_table_body dl:hover {
  172 + box-shadow: 0 0 4px #656c71;
  173 + background: #f5fbff;
  174 + }
  175 + .ttpv_table_body dl:hover dd:nth-of-type(1) {
  176 + background: #fafafa;
  177 + background: linear-gradient(to right, #fafafa, #f5fbff);
  178 + }
  179 +
  180 +</style>
  181 +
  182 +<style>
  183 + /** 滚动条css样式 */
  184 +
  185 + .ttpv_table_scrollbar::-webkit-scrollbar {
  186 + width: 18px;
  187 + height: 18px;
  188 + }
  189 +
  190 + .ttpv_table_scrollbar::-webkit-scrollbar-track, ::-webkit-scrollbar-thumb {
  191 + border-radius: 999px;
  192 + border: 5px solid transparent;
  193 + }
  194 +
  195 + .ttpv_table_scrollbar::-webkit-scrollbar-track {
  196 + box-shadow: 1px 1px 5px rgba(0, 0, 0, .2) inset;
  197 + }
  198 +
  199 + .ttpv_table_scrollbar::-webkit-scrollbar-thumb {
  200 + min-height: 20px;
  201 + background-clip: content-box;
  202 + box-shadow: 0 0 0 5px rgba(0, 0, 0, .2) inset;
  203 + }
  204 +
  205 + .ttpv_table_scrollbar::-webkit-scrollbar-corner {
  206 + background: transparent;
  207 + }
  208 +</style>
  209 +
  210 +<div class="ttpv_detail">
  211 + <div class="container-fluid top-container">
  212 + <div class="col-md-12 container-fluid">
  213 + <div class="col-md-6" style="height: 100%; padding-right: 3px;">
  214 + <div class="detail-panel">
  215 + <div class="detail-wrap" >
  216 + <h3 class="detail-title">
  217 + 上行起始站点:{{$saTimeTablePreviewCtrl.ds.up_qdz_name}}
  218 + </h3>
  219 + <div class="detail-body">
  220 + <div class="ttpv_table_wrap ttpv_table_scrollbar" sa-tscrolly2 scrclass = ".upFixHead">
  221 + <div class="ttpv_table">
  222 + <div class="ttpv_table_head upFixHead">
  223 + <dl>
  224 + <dt>序号</dt>
  225 + <dt>路牌</dt>
  226 + <dt>发车时间</dt>
  227 + <dt>备注</dt>
  228 + </dl>
  229 + </div>
  230 + <div class="ttpv_table_body">
  231 + <dl ng-repeat="bc in $saTimeTablePreviewCtrl.ds.up_bc_list_asc track by $index">
  232 + <dd>{{$index + 1}}</dd>
  233 + <dd>{{bc.lp.lpName}}</dd>
  234 + <dd ng-class="{ists: bc.isTS, region: bc.bcType == 'region', isfb: bc.isFB}">
  235 + {{bc.fcsj}}
  236 + <span class="badge"
  237 + style="border-radius: 2px !important; background-color: #f9a124;"
  238 + ng-show="bc.bcType == 'out'">出场</span>
  239 + <span class="badge"
  240 + style="border-radius: 2px !important; background-color: #f9a124;"
  241 + ng-show="bc.bcType == 'in'">进场</span>
  242 + </dd>
  243 + <dd>{{bc.remark}}</dd>
  244 + </dl>
  245 + </div>
  246 + </div>
  247 + </div>
  248 + </div>
  249 + </div>
  250 + </div>
  251 + </div>
  252 +
  253 + <div class="col-md-6" style="height: 100%; padding-left: 3px;">
  254 + <div class="detail-panel">
  255 + <div class="detail-wrap" >
  256 + <h3 class="detail-title">
  257 + 下行起始站点:{{$saTimeTablePreviewCtrl.ds.down_qdz_name}}
  258 + </h3>
  259 + <div class="detail-body">
  260 + <div class="ttpv_table_wrap ttpv_table_scrollbar" sa-tscrolly2 scrclass = ".downFixHead">
  261 + <div class="ttpv_table">
  262 + <div class="ttpv_table_head downFixHead">
  263 + <dl>
  264 + <dt>序号</dt>
  265 + <dt>路牌</dt>
  266 + <dt>发车时间</dt>
  267 + <dt>备注</dt>
  268 + </dl>
  269 + </div>
  270 + <div class="ttpv_table_body">
  271 + <dl ng-repeat="bc in $saTimeTablePreviewCtrl.ds.down_bc_list_asc track by $index">
  272 + <dd>{{$index + 1}}</dd>
  273 + <dd>{{bc.lp.lpName}}</dd>
  274 + <dd ng-class="{ists: bc.isTS, region: bc.bcType == 'region', isfb: bc.isFB}">
  275 + {{bc.fcsj}}
  276 + <span class="badge"
  277 + style="border-radius: 2px !important; background-color: #f9a124;"
  278 + ng-show="bc.bcType == 'out'">出场</span>
  279 + <span class="badge"
  280 + style="border-radius: 2px !important; background-color: #f9a124;"
  281 + ng-show="bc.bcType == 'in'">进场</span>
  282 + </dd>
  283 + <dd>{{bc.remark}}</dd>
  284 + </dl>
  285 + </div>
  286 + </div>
  287 + </div>
  288 + </div>
  289 + </div>
  290 + </div>
  291 + </div>
  292 +
  293 + </div>
  294 + </div>
  295 +</div>
  296 +
  297 +
  298 +
  299 +
  300 +
  301 +
  302 +
  303 +
  304 +
  305 +
  306 +
src/main/resources/static/pages/scheduleApp/module/common/dts2/ttinfotable/saTimeTableScrolly2.js 0 → 100644
  1 +/**
  2 + * 滚动事件控制指令。
  3 + */
  4 +angular.module('ScheduleApp').directive(
  5 + 'saTscrolly2',
  6 + [
  7 + function() {
  8 + return {
  9 + restrict: 'A',
  10 +
  11 + compile: function(tElem, tAttrs) {
  12 +
  13 + return {
  14 + pre: function(scope, element, attr) {
  15 + // TODO:
  16 + //alert(element.find("#tooltipTest").html());
  17 + //$compile(element.find("#tooltipTest"))(scope);
  18 +
  19 + },
  20 +
  21 + post: function(scope, element, attr) {
  22 + //var head = element[0];
  23 +
  24 + //console.log("llllllllload");
  25 + //console.log(element.name);
  26 +
  27 + element.bind('scroll', function() {
  28 + //console.log("top=", angular.element(".tt_table_head").css("top"));
  29 + //console.log("left=", angular.element(".tt_table_head").css("left"));
  30 + //console.log("s top=" + element.scrollTop());
  31 +
  32 + angular.element(attr.scrclass).css("top", element.scrollTop());
  33 + // angular.element(".tt_table_head:eq(0)").css("left", element.scrollLeft());
  34 + // angular.element(".tt_table_body:eq(0)").css("left", element.scrollLeft());
  35 +
  36 + });
  37 + }
  38 +
  39 + };
  40 + }
  41 + }
  42 + }
  43 + ]
  44 +);
0 \ No newline at end of file 45 \ No newline at end of file