Commit 3b4b1385e543cc08dae2673e5eabdef4eebd587f

Authored by 王通
2 parents d2e53621 d42e5163

Merge branch 'pudong' of http://192.168.168.201:8888/panzhaov5/bsth_control.git into pudong

Showing 59 changed files with 7052 additions and 3931 deletions
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/calc/CalcExportController.java
... ... @@ -16,6 +16,7 @@ import org.springframework.web.bind.annotation.RestController;
16 16 import com.bsth.common.ResponseCode;
17 17 import com.bsth.entity.calc.CalcWaybill;
18 18 import com.bsth.entity.mcy_forms.Waybillday;
  19 +import com.bsth.service.calc.CalcLbStatuAnalyService;
19 20 import com.bsth.service.calc.CalcMixService;
20 21 import com.bsth.service.calc.CalcWaybillService;
21 22 import com.bsth.util.ReportUtils;
... ... @@ -26,6 +27,9 @@ public class CalcExportController {
26 27  
27 28 @Autowired
28 29 CalcWaybillService service;
  30 +
  31 + @Autowired
  32 + CalcLbStatuAnalyService lbService;
29 33  
30 34 @Autowired
31 35 CalcMixService clacMixService;
... ... @@ -204,5 +208,84 @@ public class CalcExportController {
204 208 }
205 209 return resMap;
206 210 }
  211 +
  212 + @RequestMapping(value = "/lbStatuAnalyExport", method = RequestMethod.GET)
  213 + public Map<String, Object> lbStatuAnalyExport(@RequestParam Map<String, Object> map) {
  214 +
  215 + String gsdm="";
  216 + if(map.get("company")!=null){
  217 + gsdm=map.get("company").toString().trim();
  218 + }
  219 + String fgsdm="";
  220 + if(map.get("subCompany")!=null){
  221 + fgsdm=map.get("subCompany").toString().trim();
  222 + }
  223 + String line="";
  224 + if(map.get("line")!=null){
  225 + line=map.get("line").toString().trim();
  226 + }
  227 + String lineName="";
  228 + if(map.get("lineName")!=null){
  229 + lineName=map.get("lineName").toString().trim();
  230 + }
  231 + String date="";
  232 + if(map.get("startDate")!=null){
  233 + date=map.get("startDate").toString().trim();
  234 + }
  235 + String date2="";
  236 + if(map.get("endDate")!=null){
  237 + date2=map.get("endDate").toString().trim();
  238 + }
  239 + String sfyy="";
  240 + if(map.get("sfyy")!=null){
  241 + sfyy=map.get("sfyy").toString().trim();
  242 + }
  243 + String type="";
  244 + if(map.get("type")!=null){
  245 + type=map.get("type").toString().trim();
  246 + }
  247 +
  248 + Map<String, Object> resMap = new HashMap<String, Object>();
  249 + List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>();
  250 + List<Map<String, Object>> list = lbService.lbStatuAnaly(gsdm, fgsdm, line, date, date2, sfyy, type);
  251 +
  252 + for(int i = 0; i < list.size(); i++){
  253 + Map<String, Object> temp = list.get(i);
  254 + temp.put("i", i+1);
  255 + if(!temp.containsKey("date") || temp.get("date") == null){
  256 + temp.put("date", "");
  257 + }
  258 + if(!temp.containsKey("company") || temp.get("company") == null){
  259 + temp.put("company", "");
  260 + }
  261 + if(!temp.containsKey("subCompany") || temp.get("subCompany") == null){
  262 + temp.put("subCompany", "");
  263 + }
  264 + resList.add(temp);
  265 + }
  266 +
  267 + String Data = date.replaceAll("-", "");
  268 + if(!date.equals(date2)){
  269 + Data = date.replaceAll("-", "") + "-" + date2.replaceAll("-", "");
  270 + }
  271 +
  272 + SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"),
  273 + sdfSimple = new SimpleDateFormat("yyyyMMdd");
  274 + List<Iterator<?>> listI = new ArrayList<Iterator<?>>();
  275 + Map<String,Object> mm = new HashMap<String, Object>();
  276 + ReportUtils ee = new ReportUtils();
  277 +
  278 + try {
  279 + listI.add(resList.iterator());
  280 + String path = this.getClass().getResource("/").getPath()+"static/pages/forms/";
  281 + ee.excelReplace(listI, new Object[] { mm }, path+"mould/calcLbStatuAnaly.xls",
  282 + path+"export/"+Data+"-"+lineName+"-烂班情况分析表(统计).xls");
  283 + resMap.put("status", ResponseCode.SUCCESS);
  284 + } catch (Exception e) {
  285 + e.printStackTrace();
  286 + resMap.put("status", ResponseCode.ERROR);
  287 + }
  288 + return resMap;
  289 + }
207 290  
208 291 }
... ...
src/main/java/com/bsth/controller/calc/CalcLbStatuAnalyController.java 0 → 100644
  1 +package com.bsth.controller.calc;
  2 +
  3 +import java.util.List;
  4 +import java.util.Map;
  5 +
  6 +import com.bsth.controller.BaseController;
  7 +import com.bsth.entity.calc.CalcLbStatuAnaly;
  8 +import com.bsth.service.calc.CalcLbStatuAnalyService;
  9 +import org.springframework.beans.factory.annotation.Autowired;
  10 +import org.springframework.web.bind.annotation.RequestMapping;
  11 +import org.springframework.web.bind.annotation.RequestParam;
  12 +import org.springframework.web.bind.annotation.RestController;
  13 +
  14 +/**
  15 + * Created by 19/03/18.
  16 + */
  17 +@RestController
  18 +@RequestMapping("calcLbStatuAnaly")
  19 +public class CalcLbStatuAnalyController extends BaseController<CalcLbStatuAnaly, Integer> {
  20 +
  21 + @Autowired
  22 + private CalcLbStatuAnalyService service;
  23 +
  24 +
  25 + @RequestMapping(value="/lbStatuAnaly")
  26 + public List<Map<String,Object>> lbStatuAnaly(@RequestParam Map<String, Object> map){
  27 + String gsdm="";
  28 + if(map.get("company")!=null){
  29 + gsdm=map.get("company").toString().trim();
  30 + }
  31 + String fgsdm="";
  32 + if(map.get("subCompany")!=null){
  33 + fgsdm=map.get("subCompany").toString().trim();
  34 + }
  35 + String line="";
  36 + if(map.get("line")!=null){
  37 + line=map.get("line").toString().trim();
  38 + }
  39 + String date="";
  40 + if(map.get("startDate")!=null){
  41 + date=map.get("startDate").toString().trim();
  42 + }
  43 + String date2="";
  44 + if(map.get("endDate")!=null){
  45 + date2=map.get("endDate").toString().trim();
  46 + }
  47 + String sfyy="";
  48 + if(map.get("sfyy")!=null){
  49 + sfyy=map.get("sfyy").toString().trim();
  50 + }
  51 + String type="";
  52 + if(map.get("type")!=null){
  53 + type=map.get("type").toString().trim();
  54 + }
  55 + return service.lbStatuAnaly(gsdm,fgsdm,line,date,date2,sfyy,type);
  56 + }
  57 +
  58 +}
... ...
src/main/java/com/bsth/controller/realcontrol/RealMapController.java
... ... @@ -49,6 +49,12 @@ public class RealMapController {
49 49 return realMapService.findRouteByLine(idx);
50 50 }
51 51  
  52 +
  53 + @RequestMapping(value = "/findRouteAndVersionByLine")
  54 + public Map<String, Object> findRouteByLineAndVersion(@RequestParam String idx) {
  55 + return realMapService.findRouteAndVersionByLine(idx);
  56 + }
  57 +
52 58 @RequestMapping(value = "/multiRouteByLine")
53 59 public Map<String, Object> multiRouteByLine(@RequestParam String codeStr) {
54 60 return realMapService.multiRouteByLine(codeStr);
... ...
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/calc/CalcLbStatuAnaly.java 0 → 100644
  1 +package com.bsth.entity.calc;
  2 +
  3 +import java.util.Date;
  4 +
  5 +import javax.persistence.Entity;
  6 +import javax.persistence.GeneratedValue;
  7 +import javax.persistence.Id;
  8 +import javax.persistence.Table;
  9 +
  10 +@Entity
  11 +@Table(name = "calc_lb_statu_analy")
  12 +public class CalcLbStatuAnaly {
  13 + /* 主键*/
  14 + @Id
  15 + @GeneratedValue
  16 + private Long id;
  17 + /* 公司代码*/
  18 + private String gsdm;
  19 + /* 公司名称*/
  20 + private String gsname;
  21 + /* 分公司代码*/
  22 + private String fgsdm;
  23 + /* 分公司名称*/
  24 + private String fgsname;
  25 + /* 日期*/
  26 + private Date rq;
  27 + /* 日期字符串*/
  28 + private String rqStr;
  29 + /* 线路编码*/
  30 + private String xl;
  31 + /* 线路名称*/
  32 + private String xlName;
  33 + /* 计划班次*/
  34 + private int jhbc;
  35 + /* 实际班次*/
  36 + private int sjbc;
  37 + /* 计划里程*/
  38 + private Double jhlc;
  39 + /* 实际公里*/
  40 + private Double sjlc;
  41 + /* 路阻(烂班班次)*/
  42 + private int lzbc;
  43 + /* 路阻(烂班里程)*/
  44 + private Double lzlc;
  45 + /* 吊慢(烂班班次)*/
  46 + private int dmbc;
  47 + /* 吊慢(烂班里程)*/
  48 + private Double dmlc;
  49 + /* 故障(烂班班次)*/
  50 + private int gzbc;
  51 + /* 故障(烂班里程)*/
  52 + private Double gzlc;
  53 + /* 纠纷(烂班班次)*/
  54 + private int jfbc;
  55 + /* 纠纷(烂班里程)*/
  56 + private Double jflc;
  57 + /* 肇事(烂班班次)*/
  58 + private int zsbc;
  59 + /* 肇事(烂班里程)*/
  60 + private Double zslc;
  61 + /* 缺人(烂班班次)*/
  62 + private int qrbc;
  63 + /* 缺人(烂班里程)*/
  64 + private Double qrlc;
  65 + /* 缺车(烂班班次)*/
  66 + private int qcbc;
  67 + /* 缺车(烂班里程)*/
  68 + private Double qclc;
  69 + /* 客稀(烂班班次)*/
  70 + private int kxbc;
  71 + /* 客稀(烂班里程)*/
  72 + private Double kxlc;
  73 + /* 气候(烂班班次)*/
  74 + private int qhbc;
  75 + /* 气候(烂班里程)*/
  76 + private Double qhlc;
  77 + /* 援外(烂班班次)*/
  78 + private int ywbc;
  79 + /* 援外(烂班里程)*/
  80 + private Double ywlc;
  81 + /* 其他(烂班班次)*/
  82 + private int qtbc;
  83 + /* 其他(烂班里程)*/
  84 + private Double qtlc;
  85 + /* 备注*/
  86 + private String remark;
  87 +
  88 +
  89 + public Long getId() {
  90 + return id;
  91 + }
  92 + public void setId(Long id) {
  93 + this.id = id;
  94 + }
  95 + public String getGsdm() {
  96 + return gsdm;
  97 + }
  98 + public void setGsdm(String gsdm) {
  99 + this.gsdm = gsdm;
  100 + }
  101 + public String getGsname() {
  102 + return gsname;
  103 + }
  104 + public void setGsname(String gsname) {
  105 + this.gsname = gsname;
  106 + }
  107 + public String getFgsdm() {
  108 + return fgsdm;
  109 + }
  110 + public void setFgsdm(String fgsdm) {
  111 + this.fgsdm = fgsdm;
  112 + }
  113 + public String getFgsname() {
  114 + return fgsname;
  115 + }
  116 + public void setFgsname(String fgsname) {
  117 + this.fgsname = fgsname;
  118 + }
  119 + public Date getRq() {
  120 + return rq;
  121 + }
  122 + public void setRq(Date rq) {
  123 + this.rq = rq;
  124 + }
  125 + public String getRqStr() {
  126 + return rqStr;
  127 + }
  128 + public void setRqStr(String rqStr) {
  129 + this.rqStr = rqStr;
  130 + }
  131 + public String getXl() {
  132 + return xl;
  133 + }
  134 + public void setXl(String xl) {
  135 + this.xl = xl;
  136 + }
  137 + public String getXlName() {
  138 + return xlName;
  139 + }
  140 + public void setXlName(String xlName) {
  141 + this.xlName = xlName;
  142 + }
  143 + public int getJhbc() {
  144 + return jhbc;
  145 + }
  146 + public void setJhbc(int jhbc) {
  147 + this.jhbc = jhbc;
  148 + }
  149 + public int getSjbc() {
  150 + return sjbc;
  151 + }
  152 + public void setSjbc(int sjbc) {
  153 + this.sjbc = sjbc;
  154 + }
  155 + public Double getJhlc() {
  156 + return jhlc;
  157 + }
  158 + public void setJhlc(Double jhlc) {
  159 + this.jhlc = jhlc;
  160 + }
  161 + public Double getSjlc() {
  162 + return sjlc;
  163 + }
  164 + public void setSjlc(Double sjlc) {
  165 + this.sjlc = sjlc;
  166 + }
  167 + public int getLzbc() {
  168 + return lzbc;
  169 + }
  170 + public void setLzbc(int lzbc) {
  171 + this.lzbc = lzbc;
  172 + }
  173 + public Double getLzlc() {
  174 + return lzlc;
  175 + }
  176 + public void setLzlc(Double lzlc) {
  177 + this.lzlc = lzlc;
  178 + }
  179 + public int getDmbc() {
  180 + return dmbc;
  181 + }
  182 + public void setDmbc(int dmbc) {
  183 + this.dmbc = dmbc;
  184 + }
  185 + public Double getDmlc() {
  186 + return dmlc;
  187 + }
  188 + public void setDmlc(Double dmlc) {
  189 + this.dmlc = dmlc;
  190 + }
  191 + public int getGzbc() {
  192 + return gzbc;
  193 + }
  194 + public void setGzbc(int gzbc) {
  195 + this.gzbc = gzbc;
  196 + }
  197 + public Double getGzlc() {
  198 + return gzlc;
  199 + }
  200 + public void setGzlc(Double gzlc) {
  201 + this.gzlc = gzlc;
  202 + }
  203 + public int getJfbc() {
  204 + return jfbc;
  205 + }
  206 + public void setJfbc(int jfbc) {
  207 + this.jfbc = jfbc;
  208 + }
  209 + public Double getJflc() {
  210 + return jflc;
  211 + }
  212 + public void setJflc(Double jflc) {
  213 + this.jflc = jflc;
  214 + }
  215 + public int getZsbc() {
  216 + return zsbc;
  217 + }
  218 + public void setZsbc(int zsbc) {
  219 + this.zsbc = zsbc;
  220 + }
  221 + public Double getZslc() {
  222 + return zslc;
  223 + }
  224 + public void setZslc(Double zslc) {
  225 + this.zslc = zslc;
  226 + }
  227 + public int getQrbc() {
  228 + return qrbc;
  229 + }
  230 + public void setQrbc(int qrbc) {
  231 + this.qrbc = qrbc;
  232 + }
  233 + public Double getQrlc() {
  234 + return qrlc;
  235 + }
  236 + public void setQrlc(Double qrlc) {
  237 + this.qrlc = qrlc;
  238 + }
  239 + public int getQcbc() {
  240 + return qcbc;
  241 + }
  242 + public void setQcbc(int qcbc) {
  243 + this.qcbc = qcbc;
  244 + }
  245 + public Double getQclc() {
  246 + return qclc;
  247 + }
  248 + public void setQclc(Double qclc) {
  249 + this.qclc = qclc;
  250 + }
  251 + public int getKxbc() {
  252 + return kxbc;
  253 + }
  254 + public void setKxbc(int kxbc) {
  255 + this.kxbc = kxbc;
  256 + }
  257 + public Double getKxlc() {
  258 + return kxlc;
  259 + }
  260 + public void setKxlc(Double kxlc) {
  261 + this.kxlc = kxlc;
  262 + }
  263 + public int getQhbc() {
  264 + return qhbc;
  265 + }
  266 + public void setQhbc(int qhbc) {
  267 + this.qhbc = qhbc;
  268 + }
  269 + public Double getQhlc() {
  270 + return qhlc;
  271 + }
  272 + public void setQhlc(Double qhlc) {
  273 + this.qhlc = qhlc;
  274 + }
  275 + public int getYwbc() {
  276 + return ywbc;
  277 + }
  278 + public void setYwbc(int ywbc) {
  279 + this.ywbc = ywbc;
  280 + }
  281 + public Double getYwlc() {
  282 + return ywlc;
  283 + }
  284 + public void setYwlc(Double ywlc) {
  285 + this.ywlc = ywlc;
  286 + }
  287 + public int getQtbc() {
  288 + return qtbc;
  289 + }
  290 + public void setQtbc(int qtbc) {
  291 + this.qtbc = qtbc;
  292 + }
  293 + public Double getQtlc() {
  294 + return qtlc;
  295 + }
  296 + public void setQtlc(Double qtlc) {
  297 + this.qtlc = qtlc;
  298 + }
  299 + public String getRemark() {
  300 + return remark;
  301 + }
  302 + public void setRemark(String remark) {
  303 + this.remark = remark;
  304 + }
  305 +
  306 +}
... ...
src/main/java/com/bsth/entity/search/PredicatesBuilder.java
... ... @@ -9,6 +9,7 @@ import java.text.NumberFormat;
9 9 import java.text.ParseException;
10 10 import java.text.SimpleDateFormat;
11 11 import java.util.ArrayList;
  12 +import java.util.Calendar;
12 13 import java.util.Date;
13 14 import java.util.List;
14 15  
... ... @@ -37,7 +38,13 @@ public class PredicatesBuilder {
37 38 if(Date.class.isAssignableFrom(leftType) &&
38 39 String.class.isAssignableFrom(rightType)){
39 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 49 else {
43 50 return cb.equal(expression, object);
... ...
src/main/java/com/bsth/entity/traffic/SKBUploadLogger.java
1 1 package com.bsth.entity.traffic;
2 2  
3   -import com.bsth.entity.schedule.TTInfo;
  3 +import com.bsth.entity.Line;
4 4 import com.bsth.entity.sys.SysUser;
5 5 import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
6 6  
... ... @@ -33,7 +33,7 @@ public class SKBUploadLogger {
33 33  
34 34 /** 时刻表信息 */
35 35 @ManyToOne(optional = false, cascade = CascadeType.DETACH, fetch = FetchType.LAZY)
36   - private TTInfo ttInfo;
  36 + private Line line;
37 37  
38 38 /** 用户 关联 */
39 39 @ManyToOne(optional = false, cascade = CascadeType.DETACH, fetch = FetchType.LAZY)
... ... @@ -43,6 +43,23 @@ public class SKBUploadLogger {
43 43 @Column(updatable = false, name = "create_date", columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP")
44 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 63 public Integer getId() {
47 64 return id;
48 65 }
... ... @@ -51,14 +68,6 @@ public class SKBUploadLogger {
51 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 71 public SysUser getUser() {
63 72 return user;
64 73 }
... ... @@ -71,7 +80,29 @@ public class SKBUploadLogger {
71 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/repository/calc/CalcLbStatuAnalyRepository.java 0 → 100644
  1 +package com.bsth.repository.calc;
  2 +
  3 +import java.util.List;
  4 +
  5 +import javax.transaction.Transactional;
  6 +
  7 +import com.bsth.entity.calc.CalcLbStatuAnaly;
  8 +import com.bsth.repository.BaseRepository;
  9 +
  10 +import org.springframework.data.jpa.repository.Modifying;
  11 +import org.springframework.data.jpa.repository.Query;
  12 +import org.springframework.stereotype.Repository;
  13 +
  14 +/**
  15 + *
  16 + */
  17 +@Repository
  18 +public interface CalcLbStatuAnalyRepository extends BaseRepository<CalcLbStatuAnaly, Integer>{
  19 +
  20 + //按照时间段统计,公司下线路
  21 + @Query(value="select DISTINCT c from CalcLbStatuAnaly c where c.xl like %?1% and c.rqStr between ?2 and ?3 and c.gsdm like %?4% and c.fgsdm like %?5% order by c.xl")
  22 + List<CalcLbStatuAnaly> selectByDateAndLine(String line,String date,String date2,String gsdm,String fgsdm);
  23 +
  24 + //按照时间段统计,单条线路
  25 + @Query(value="select DISTINCT c from CalcLbStatuAnaly c where c.xl = ?1 and c.rqStr between ?2 and ?3 order by c.xl")
  26 + List<CalcLbStatuAnaly> selectByDateAndLine(String line,String date,String date2);
  27 +
  28 + //按照日期和线路删除数据
  29 + @Modifying
  30 + @Transactional
  31 + @Query(value = "delete CalcLbStatuAnaly c where c.rqStr=?1 and c.xl=?2")
  32 + void deleteByDateAndLine(String date, String line);
  33 +
  34 + //按照日期删除数据
  35 + @Modifying
  36 + @Transactional
  37 + @Query(value = "delete CalcLbStatuAnaly c where c.rqStr=?1")
  38 + void deleteByDate(String date);
  39 +
  40 +}
... ...
src/main/java/com/bsth/repository/oil/YlbRepository.java
... ... @@ -46,7 +46,8 @@ public interface YlbRepository extends BaseRepository&lt;Ylb, Integer&gt;{
46 46 + " and y.xlbm like %?4% and y.nbbm like %?5%",nativeQuery=true)
47 47 List<Ylb> listMaxRqJcsx(String rq,String gsbm,String fgsbm,String xlbm,String nbbm);
48 48  
49   - @Query(value="select * from bsth_c_ylb where to_days(?1) -to_days(rq) <30 "
  49 + @Query(value="select * from bsth_c_ylb where "
  50 + + " DATE_SUB(CURDATE(), INTERVAL 30 DAY) <= rq "
50 51 + " and rq< ?1 and ssgsdm like %?2%"
51 52 + " and fgsdm like %?3% and xlbm like %?4% and nbbm like %?5% "
52 53 + " order by nbbm , rq desc,jcsx desc,lp desc",nativeQuery=true)
... ... @@ -54,7 +55,7 @@ public interface YlbRepository extends BaseRepository&lt;Ylb, Integer&gt;{
54 55  
55 56 @Query(value="select * from bsth_c_ylb where rq>=?1 "
56 57 + " and rq<= ?2 and ssgsdm =?3"
57   - + " and fgsdm =?4 and xlbm like %?5% "
  58 + + " and fgsdm like %?4% and xlbm like %?5% "
58 59 + " order by nbbm , rq desc,jcsx desc,lp desc",nativeQuery=true)
59 60 List<Ylb> listByMonthJcsx(String rq,String rq2,String gsbm,String fgsbm,String xlbm);
60 61  
... ... @@ -125,6 +126,12 @@ public interface YlbRepository extends BaseRepository&lt;Ylb, Integer&gt;{
125 126 List<Object[]> checkNbmmYl(String rq, String gsbm,String fgsbm,String xlbm,String nbbm);
126 127  
127 128  
  129 + @Query(value="select nbbm,cs from (select nbbm,count(nbbm) as cs from ("
  130 + + " select nbbm,fgsdm from bsth_c_ylb where rq=?1 "
  131 + + " and ssgsdm like %?2% group by nbbm,fgsdm "
  132 + + " ) t group by t.nbbm) x where x.cs >1 ",nativeQuery=true)
  133 + List<Object[]> checkNbmmFgs(String rq, String gsbm);
  134 +
128 135 @Query(value="select jzl,yh,sh from Ylb s "
129 136 + " where to_days(s.rq)=to_days(?1) "
130 137 + " and s.ssgsdm like %?2% "
... ... @@ -155,7 +162,7 @@ public interface YlbRepository extends BaseRepository&lt;Ylb, Integer&gt;{
155 162 @Query(value="select s from Ylb s "
156 163 + " where to_days(s.rq)=to_days(?1) "
157 164 + " and s.ssgsdm =?2 "
158   - + " and s.fgsdm =?3 "
  165 + + " and s.fgsdm like %?3% "
159 166 + " and s.xlbm like %?4% "
160 167 + " and s.nbbm in ?5 order by nbbm,jcsx")
161 168 List<Ylb> listYlb(String rq, String gsbm,String fgsbm,String xlbm,List<String> listNbbm);
... ... @@ -163,7 +170,7 @@ public interface YlbRepository extends BaseRepository&lt;Ylb, Integer&gt;{
163 170 @Query(value="select s from Ylb s "
164 171 + " where s.rq=?1 "
165 172 + " and s.ssgsdm =?2 "
166   - + " and s.fgsdm =?3 "
  173 + + " and s.fgsdm like %?3% "
167 174 + " and s.xlbm like %?4% "
168 175 + " and s.nbbm in ?5 order by nbbm,jcsx")
169 176 List<Ylb> listYlb_s(Date rq, String gsbm,String fgsbm,String xlbm,List<String> listNbbm);
... ...
src/main/java/com/bsth/service/calc/CalcLbStatuAnalyService.java 0 → 100644
  1 +package com.bsth.service.calc;
  2 +
  3 +import java.util.List;
  4 +import java.util.Map;
  5 +
  6 +import com.bsth.entity.calc.CalcLbStatuAnaly;
  7 +import com.bsth.service.BaseService;
  8 +
  9 +/**
  10 + * Created by 19/03/18.
  11 + */
  12 +public interface CalcLbStatuAnalyService extends BaseService<CalcLbStatuAnaly, Integer> {
  13 +
  14 + List<Map<String, Object>> lbStatuAnaly(String gsdm, String fgsdm, String line, String date, String date2, String sfyy, String type);
  15 +
  16 +}
... ...
src/main/java/com/bsth/service/calc/impl/CalcLbStatuAnalyServiceImpl.java 0 → 100644
  1 +package com.bsth.service.calc.impl;
  2 +
  3 +import java.util.ArrayList;
  4 +import java.util.Collections;
  5 +import java.util.Comparator;
  6 +import java.util.HashMap;
  7 +import java.util.List;
  8 +import java.util.Map;
  9 +
  10 +import com.bsth.entity.calc.CalcLbStatuAnaly;
  11 +import com.bsth.repository.calc.CalcLbStatuAnalyRepository;
  12 +import com.bsth.service.LineService;
  13 +import com.bsth.service.calc.CalcLbStatuAnalyService;
  14 +import com.bsth.service.impl.BaseServiceImpl;
  15 +import com.bsth.util.Arith;
  16 +
  17 +import org.slf4j.Logger;
  18 +import org.slf4j.LoggerFactory;
  19 +import org.springframework.beans.factory.annotation.Autowired;
  20 +import org.springframework.jdbc.core.JdbcTemplate;
  21 +import org.springframework.stereotype.Service;
  22 +
  23 +/**
  24 + * Created by 19/03/18.
  25 + */
  26 +@Service
  27 +public class CalcLbStatuAnalyServiceImpl extends BaseServiceImpl<CalcLbStatuAnaly, Integer> implements CalcLbStatuAnalyService {
  28 +
  29 + @Autowired
  30 + private CalcLbStatuAnalyRepository calcRepository;
  31 +
  32 + @Autowired
  33 + private LineService lineService;
  34 +
  35 + @Autowired
  36 + JdbcTemplate jdbcTemplate;
  37 +
  38 +
  39 + Logger logger = LoggerFactory.getLogger(this.getClass());
  40 +
  41 +
  42 + @Override
  43 + public List<Map<String, Object>> lbStatuAnaly(String gsdm, String fgsdm,
  44 + String line, String date, String date2, String sfyy, String type) {
  45 + // TODO Auto-generated method stub
  46 + List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>();
  47 + List<CalcLbStatuAnaly> query = calcRepository.selectByDateAndLine(line, date, date2, gsdm, fgsdm);
  48 + Map<String, Boolean> lineNature = lineService.lineNature();
  49 + Map<String, List<CalcLbStatuAnaly>> keyMap = new HashMap<String, List<CalcLbStatuAnaly>>();
  50 + List<String> keyList = new ArrayList<String>();
  51 +
  52 + String[] Date1 = date.split("-");
  53 + String[] Date2 = date2.split("-");
  54 + String Date = "";
  55 + if(date.equals(date2))
  56 + Date = Date1[0] + "年" + Date1[1] + "月" + Date1[2] + "日";
  57 + else
  58 + Date = Date1[0] + "年" + Date1[1] + "月" + Date1[2] + "日 - "
  59 + + Date2[0] + "年" + Date2[1] + "月" + Date2[2] + "日";
  60 +
  61 + for(CalcLbStatuAnaly lb : query){
  62 + String xlBm = lb.getXl();
  63 + if(lineNature.containsKey(xlBm) && lineNature.get(xlBm) != null){
  64 + if(sfyy.equals("1") && !lineNature.get(xlBm)){
  65 + continue;
  66 + } else if(sfyy.equals("2") && lineNature.get(xlBm)){
  67 + continue;
  68 + }
  69 + } else if(sfyy.equals("2")){
  70 + continue;
  71 + }
  72 +
  73 + String key = lb.getGsdm() + "/" + lb.getFgsdm() + "/" + lb.getXl();
  74 +
  75 + if(!keyMap.containsKey(key)){
  76 + keyMap.put(key, new ArrayList<CalcLbStatuAnaly>());
  77 + keyList.add(key);
  78 + }
  79 + keyMap.get(key).add(lb);
  80 + }
  81 +
  82 + Collections.sort(keyList, new Comparator<String>() {
  83 +
  84 + public int compare(String o1, String o2) {
  85 +
  86 + Long a = 0l;
  87 + Long b = 0l;
  88 + String[] split1 = o1.split("/");
  89 + String[] split2 = o2.split("/");
  90 + char[] charArray1 = split1[2].toCharArray();
  91 + char[] charArray2 = split2[2].toCharArray();
  92 + for(int i = 0; i < charArray1.length; i++){
  93 + long temp = 1l;
  94 + for(int j = 0; j < i; j++)
  95 + temp *= 10;
  96 + a += (long)charArray1[charArray1.length - 1 - i] * temp;
  97 + }
  98 + for(int i = 0; i < charArray2.length; i++){
  99 + long temp = 1l;
  100 + for(int j = 0; j < i; j++)
  101 + temp *= 10;
  102 + b += (long)charArray2[charArray2.length - 1 - i] * temp;
  103 + }
  104 +
  105 + return a.compareTo(b);
  106 + }
  107 + });
  108 + Collections.sort(keyList, new Comparator<String>() {
  109 +
  110 + public int compare(String o1, String o2) {
  111 +
  112 + Long a = 0l;
  113 + Long b = 0l;
  114 + String[] split1 = o1.split("/");
  115 + String[] split2 = o2.split("/");
  116 + char[] charArray1 = split1[1].toCharArray();
  117 + char[] charArray2 = split2[1].toCharArray();
  118 + for(int i = 0; i < charArray1.length; i++){
  119 + long temp = 1l;
  120 + for(int j = 0; j < i; j++)
  121 + temp *= 10;
  122 + a += (long)charArray1[charArray1.length - 1 - i] * temp;
  123 + }
  124 + for(int i = 0; i < charArray2.length; i++){
  125 + long temp = 1l;
  126 + for(int j = 0; j < i; j++)
  127 + temp *= 10;
  128 + b += (long)charArray2[charArray2.length - 1 - i] * temp;
  129 + }
  130 +
  131 + return a.compareTo(b);
  132 + }
  133 + });
  134 +
  135 + String company = "", subCompany = "", lineName = "";
  136 + Map<String, Object> lastMap = new HashMap<String, Object>();
  137 + lastMap.put("line", "合计");
  138 + for(String key : keyList){
  139 + List<CalcLbStatuAnaly> list = keyMap.get(key);
  140 + Map<String, Object> m = new HashMap<String, Object>();
  141 + company = "";
  142 + subCompany = "";
  143 + lineName = "";
  144 + for(CalcLbStatuAnaly lb : list){
  145 + if(lb.getGsname() != null && company.trim().length() == 0)
  146 + company = lb.getGsname();
  147 + if(lb.getFgsname() != null && subCompany.trim().length() == 0)
  148 + subCompany = lb.getFgsname();
  149 + if(lb.getXlName() != null && lineName.trim().length() == 0)
  150 + lineName = lb.getXlName();
  151 + m.put("jhbc", Arith.add(m.get("jhbc")!=null?m.get("jhbc"):"0", lb.getJhbc()));
  152 + m.put("sjbc", Arith.add(m.get("sjbc")!=null?m.get("sjbc"):"0", lb.getSjbc()));
  153 + m.put("jhlc", Arith.add(m.get("jhlc")!=null?m.get("jhlc"):"0", lb.getJhlc()!=null?lb.getJhlc():"0"));
  154 + m.put("sjlc", Arith.add(m.get("sjlc")!=null?m.get("sjlc"):"0", lb.getSjlc()!=null?lb.getSjlc():"0"));
  155 + m.put("lzbc", Arith.add(m.get("lzbc")!=null?m.get("lzbc"):"0", lb.getLzbc()));
  156 + m.put("lzlc", Arith.add(m.get("lzlc")!=null?m.get("lzlc"):"0", lb.getLzlc()!=null?lb.getLzlc():"0"));
  157 + m.put("dmbc", Arith.add(m.get("dmbc")!=null?m.get("dmbc"):"0", lb.getDmbc()));
  158 + m.put("dmlc", Arith.add(m.get("dmlc")!=null?m.get("dmlc"):"0", lb.getDmlc()!=null?lb.getDmlc():"0"));
  159 + m.put("gzbc", Arith.add(m.get("gzbc")!=null?m.get("gzbc"):"0", lb.getGzbc()));
  160 + m.put("gzlc", Arith.add(m.get("gzlc")!=null?m.get("gzlc"):"0", lb.getGzlc()!=null?lb.getGzlc():"0"));
  161 + m.put("jfbc", Arith.add(m.get("jfbc")!=null?m.get("jfbc"):"0", lb.getJfbc()));
  162 + m.put("jflc", Arith.add(m.get("jflc")!=null?m.get("jflc"):"0", lb.getJflc()!=null?lb.getJflc():"0"));
  163 + m.put("zsbc", Arith.add(m.get("zsbc")!=null?m.get("zsbc"):"0", lb.getZsbc()));
  164 + m.put("zslc", Arith.add(m.get("zslc")!=null?m.get("zslc"):"0", lb.getZslc()!=null?lb.getZslc():"0"));
  165 + m.put("qrbc", Arith.add(m.get("qrbc")!=null?m.get("qrbc"):"0", lb.getQrbc()));
  166 + m.put("qrlc", Arith.add(m.get("qrlc")!=null?m.get("qrlc"):"0", lb.getQrlc()!=null?lb.getQrlc():"0"));
  167 + m.put("qcbc", Arith.add(m.get("qcbc")!=null?m.get("qcbc"):"0", lb.getQcbc()));
  168 + m.put("qclc", Arith.add(m.get("qclc")!=null?m.get("qclc"):"0", lb.getQclc()!=null?lb.getQclc():"0"));
  169 + m.put("kxbc", Arith.add(m.get("kxbc")!=null?m.get("kxbc"):"0", lb.getKxbc()));
  170 + m.put("kxlc", Arith.add(m.get("kxlc")!=null?m.get("kxlc"):"0", lb.getKxlc()!=null?lb.getKxlc():"0"));
  171 + m.put("qhbc", Arith.add(m.get("qhbc")!=null?m.get("qhbc"):"0", lb.getQhbc()));
  172 + m.put("qhlc", Arith.add(m.get("qhlc")!=null?m.get("qhlc"):"0", lb.getQhlc()!=null?lb.getQhlc():"0"));
  173 + m.put("ywbc", Arith.add(m.get("ywbc")!=null?m.get("ywbc"):"0", lb.getYwbc()));
  174 + m.put("ywlc", Arith.add(m.get("ywlc")!=null?m.get("ywlc"):"0", lb.getYwlc()!=null?lb.getYwlc():"0"));
  175 + m.put("qtbc", Arith.add(m.get("qtbc")!=null?m.get("qtbc"):"0", lb.getQtbc()));
  176 + m.put("qtlc", Arith.add(m.get("qtlc")!=null?m.get("qtlc"):"0", lb.getQtlc()!=null?lb.getQtlc():"0"));
  177 + }
  178 + m.put("date", Date);
  179 + m.put("company", company);
  180 + m.put("subCompany", subCompany);
  181 + m.put("line", lineName);
  182 + resList.add(m);
  183 +
  184 + lastMap.put("jhbc", Arith.add(m.get("jhbc")!=null?m.get("jhbc"):"0", lastMap.get("jhbc")!=null?lastMap.get("jhbc"):"0"));
  185 + lastMap.put("sjbc", Arith.add(m.get("sjbc")!=null?m.get("sjbc"):"0", lastMap.get("sjbc")!=null?lastMap.get("sjbc"):"0"));
  186 + lastMap.put("jhlc", Arith.add(m.get("jhlc")!=null?m.get("jhlc"):"0", lastMap.get("jhlc")!=null?lastMap.get("jhlc"):"0"));
  187 + lastMap.put("sjlc", Arith.add(m.get("sjlc")!=null?m.get("sjlc"):"0", lastMap.get("sjlc")!=null?lastMap.get("sjlc"):"0"));
  188 + lastMap.put("lzbc", Arith.add(m.get("lzbc")!=null?m.get("lzbc"):"0", lastMap.get("lzbc")!=null?lastMap.get("lzbc"):"0"));
  189 + lastMap.put("lzlc", Arith.add(m.get("lzlc")!=null?m.get("lzlc"):"0", lastMap.get("lzlc")!=null?lastMap.get("lzlc"):"0"));
  190 + lastMap.put("dmbc", Arith.add(m.get("dmbc")!=null?m.get("dmbc"):"0", lastMap.get("dmbc")!=null?lastMap.get("dmbc"):"0"));
  191 + lastMap.put("dmlc", Arith.add(m.get("dmlc")!=null?m.get("dmlc"):"0", lastMap.get("dmlc")!=null?lastMap.get("dmlc"):"0"));
  192 + lastMap.put("gzbc", Arith.add(m.get("gzbc")!=null?m.get("gzbc"):"0", lastMap.get("gzbc")!=null?lastMap.get("gzbc"):"0"));
  193 + lastMap.put("gzlc", Arith.add(m.get("gzlc")!=null?m.get("gzlc"):"0", lastMap.get("gzlc")!=null?lastMap.get("gzlc"):"0"));
  194 + lastMap.put("jfbc", Arith.add(m.get("jfbc")!=null?m.get("jfbc"):"0", lastMap.get("jfbc")!=null?lastMap.get("jfbc"):"0"));
  195 + lastMap.put("jflc", Arith.add(m.get("jflc")!=null?m.get("jflc"):"0", lastMap.get("jflc")!=null?lastMap.get("jflc"):"0"));
  196 + lastMap.put("zsbc", Arith.add(m.get("zsbc")!=null?m.get("zsbc"):"0", lastMap.get("zsbc")!=null?lastMap.get("zsbc"):"0"));
  197 + lastMap.put("zslc", Arith.add(m.get("zslc")!=null?m.get("zslc"):"0", lastMap.get("zslc")!=null?lastMap.get("zslc"):"0"));
  198 + lastMap.put("qrbc", Arith.add(m.get("qrbc")!=null?m.get("qrbc"):"0", lastMap.get("qrbc")!=null?lastMap.get("qrbc"):"0"));
  199 + lastMap.put("qrlc", Arith.add(m.get("qrlc")!=null?m.get("qrlc"):"0", lastMap.get("qrlc")!=null?lastMap.get("qrlc"):"0"));
  200 + lastMap.put("qcbc", Arith.add(m.get("qcbc")!=null?m.get("qcbc"):"0", lastMap.get("qcbc")!=null?lastMap.get("qcbc"):"0"));
  201 + lastMap.put("qclc", Arith.add(m.get("qclc")!=null?m.get("qclc"):"0", lastMap.get("qclc")!=null?lastMap.get("qclc"):"0"));
  202 + lastMap.put("kxbc", Arith.add(m.get("kxbc")!=null?m.get("kxbc"):"0", lastMap.get("kxbc")!=null?lastMap.get("kxbc"):"0"));
  203 + lastMap.put("kxlc", Arith.add(m.get("kxlc")!=null?m.get("kxlc"):"0", lastMap.get("kxlc")!=null?lastMap.get("kxlc"):"0"));
  204 + lastMap.put("qhbc", Arith.add(m.get("qhbc")!=null?m.get("qhbc"):"0", lastMap.get("qhbc")!=null?lastMap.get("qhbc"):"0"));
  205 + lastMap.put("qhlc", Arith.add(m.get("qhlc")!=null?m.get("qhlc"):"0", lastMap.get("qhlc")!=null?lastMap.get("qhlc"):"0"));
  206 + lastMap.put("ywbc", Arith.add(m.get("ywbc")!=null?m.get("ywbc"):"0", lastMap.get("ywbc")!=null?lastMap.get("ywbc"):"0"));
  207 + lastMap.put("ywlc", Arith.add(m.get("ywlc")!=null?m.get("ywlc"):"0", lastMap.get("ywlc")!=null?lastMap.get("ywlc"):"0"));
  208 + lastMap.put("qtbc", Arith.add(m.get("qtbc")!=null?m.get("qtbc"):"0", lastMap.get("qtbc")!=null?lastMap.get("qtbc"):"0"));
  209 + lastMap.put("qtlc", Arith.add(m.get("qtlc")!=null?m.get("qtlc"):"0", lastMap.get("qtlc")!=null?lastMap.get("qtlc"):"0"));
  210 + }
  211 +
  212 + if(resList.size() > 0){
  213 + resList.add(lastMap);
  214 + for(Map<String, Object> m : resList){
  215 + if(Arith.compareTo(m.get("sjbc"), 0) == 1 && Arith.compareTo(m.get("jhbc"), 0) == 1){
  216 + m.put("bcbfb", Arith.div(Arith.mul(m.get("sjbc"), 100), m.get("jhbc"), 2) + "%");
  217 + } else {
  218 + m.put("bcbfb", "0%");
  219 + }
  220 + if(Arith.compareTo(m.get("sjlc"), 0) == 1 && Arith.compareTo(m.get("jhlc"), 0) == 1){
  221 + m.put("lcbfb", Arith.div(Arith.mul(m.get("sjlc"), 100), m.get("jhlc"), 2) + "%");
  222 + } else {
  223 + m.put("lcbfb", "0%");
  224 + }
  225 + if(Arith.compareTo(m.get("lzbc"), 0) == 1 && Arith.compareTo(m.get("jhbc"), 0) == 1){
  226 + m.put("lzbfb", Arith.div(Arith.mul(m.get("lzbc"), 100), m.get("jhbc"), 2) + "%");
  227 + } else {
  228 + m.put("lzbfb", "0%");
  229 + }
  230 + if(Arith.compareTo(m.get("dmbc"), 0) == 1 && Arith.compareTo(m.get("jhbc"), 0) == 1){
  231 + m.put("dmbfb", Arith.div(Arith.mul(m.get("dmbc"), 100), m.get("jhbc"), 2) + "%");
  232 + } else {
  233 + m.put("dmbfb", "0%");
  234 + }
  235 + if(Arith.compareTo(m.get("gzbc"), 0) == 1 && Arith.compareTo(m.get("jhbc"), 0) == 1){
  236 + m.put("gzbfb", Arith.div(Arith.mul(m.get("gzbc"), 100), m.get("jhbc"), 2) + "%");
  237 + } else {
  238 + m.put("gzbfb", "0%");
  239 + }
  240 + if(Arith.compareTo(m.get("jfbc"), 0) == 1 && Arith.compareTo(m.get("jhbc"), 0) == 1){
  241 + m.put("jfbfb", Arith.div(Arith.mul(m.get("jfbc"), 100), m.get("jhbc"), 2) + "%");
  242 + } else {
  243 + m.put("jfbfb", "0%");
  244 + }
  245 + if(Arith.compareTo(m.get("zsbc"), 0) == 1 && Arith.compareTo(m.get("jhbc"), 0) == 1){
  246 + m.put("zsbfb", Arith.div(Arith.mul(m.get("zsbc"), 100), m.get("jhbc"), 2) + "%");
  247 + } else {
  248 + m.put("zsbfb", "0%");
  249 + }
  250 + if(Arith.compareTo(m.get("qrbc"), 0) == 1 && Arith.compareTo(m.get("jhbc"), 0) == 1){
  251 + m.put("qrbfb", Arith.div(Arith.mul(m.get("qrbc"), 100), m.get("jhbc"), 2) + "%");
  252 + } else {
  253 + m.put("qrbfb", "0%");
  254 + }
  255 + if(Arith.compareTo(m.get("qcbc"), 0) == 1 && Arith.compareTo(m.get("jhbc"), 0) == 1){
  256 + m.put("qcbfb", Arith.div(Arith.mul(m.get("qcbc"), 100), m.get("jhbc"), 2) + "%");
  257 + } else {
  258 + m.put("qcbfb", "0%");
  259 + }
  260 + if(Arith.compareTo(m.get("kxbc"), 0) == 1 && Arith.compareTo(m.get("jhbc"), 0) == 1){
  261 + m.put("kxbfb", Arith.div(Arith.mul(m.get("kxbc"), 100), m.get("jhbc"), 2) + "%");
  262 + } else {
  263 + m.put("kxbfb", "0%");
  264 + }
  265 + if(Arith.compareTo(m.get("qhbc"), 0) == 1 && Arith.compareTo(m.get("jhbc"), 0) == 1){
  266 + m.put("qhbfb", Arith.div(Arith.mul(m.get("qhbc"), 100), m.get("jhbc"), 2) + "%");
  267 + } else {
  268 + m.put("qhbfb", "0%");
  269 + }
  270 + if(Arith.compareTo(m.get("ywbc"), 0) == 1 && Arith.compareTo(m.get("jhbc"), 0) == 1){
  271 + m.put("ywbfb", Arith.div(Arith.mul(m.get("ywbc"), 100), m.get("jhbc"), 2) + "%");
  272 + } else {
  273 + m.put("ywbfb", "0%");
  274 + }
  275 + if(Arith.compareTo(m.get("qtbc"), 0) == 1 && Arith.compareTo(m.get("jhbc"), 0) == 1){
  276 + m.put("qtbfb", Arith.div(Arith.mul(m.get("qtbc"), 100), m.get("jhbc"), 2) + "%");
  277 + } else {
  278 + m.put("qtbfb", "0%");
  279 + }
  280 + }
  281 + }
  282 +
  283 + return resList;
  284 + }
  285 +
  286 +}
... ...
src/main/java/com/bsth/service/calc/impl/CalcMixServiceImpl.java
... ... @@ -306,9 +306,9 @@ public class CalcMixServiceImpl implements CalcMixService {
306 306 m.put("hyl", Arith.add(m.get("hyl"), sin_.getHyl()!=null?sin_.getHyl():0));
307 307 m.put("jzl", Arith.add(m.get("jzl"), sin_.getJzl()!=null?sin_.getJzl():0));
308 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 312 } else {
313 313 Map<String, Object> m = new HashMap<String, Object>();
314 314 m.put("gS", BasicData.businessFgsCodeNameMap.get(fgsdm+"_"+gsdm));
... ...
src/main/java/com/bsth/service/gps/GpsServiceImpl.java
... ... @@ -12,9 +12,12 @@ import com.bsth.data.pilot80.PilotReport;
12 12 import com.bsth.data.safe_driv.SafeDriv;
13 13 import com.bsth.data.safe_driv.SafeDrivCenter;
14 14 import com.bsth.data.schedule.DayOfSchedule;
  15 +import com.bsth.entity.LineVersions;
15 16 import com.bsth.entity.directive.D80;
16 17 import com.bsth.entity.realcontrol.ScheduleRealInfo;
17 18 import com.bsth.repository.CarParkRepository;
  19 +import com.bsth.repository.LineRepository;
  20 +import com.bsth.repository.LineVersionsRepository;
18 21 import com.bsth.repository.StationRepository;
19 22 import com.bsth.repository.realcontrol.ScheduleRealInfoRepository;
20 23 import com.bsth.service.gps.entity.*;
... ... @@ -81,6 +84,13 @@ public class GpsServiceImpl implements GpsService {
81 84 @Autowired
82 85 ScheduleRealInfoRepository scheduleRealInfoRepository;
83 86  
  87 +
  88 + @Autowired
  89 + LineVersionsRepository lineVersionsRepository;
  90 +
  91 + @Autowired
  92 + LineRepository lineRepository;
  93 +
84 94 // 历史gps查询
85 95 @Override
86 96 public List<Map<String, Object>> history(String device, Long startTime, Long endTime, int directions) {
... ... @@ -228,16 +238,62 @@ public class GpsServiceImpl implements GpsService {
228 238 int inOutStop;
229 239 long serviceState;
230 240 ArrivalEntity arrival;
231   -
  241 + Set<String> lineSet=new HashSet();
  242 + List<Map<String,Object>> lineSwitch=new ArrayList<>();
  243 +
  244 + List<Map> gpsNotValidList=new ArrayList();
  245 + List<Map> versionSwitchList=new ArrayList();
  246 + List<Map> gpsEqualsZeroList=new ArrayList();
  247 + Map<String,Object> zeroMap=null;
  248 + Map<String,Object> gpsNotValidMap=null;
  249 + boolean isFirstNotValid=true;
  250 + boolean isFirstLonlatZero=true;
232 251 Map<String, Object> map = null;
233 252 for(Map<String, Object> rs : dataList){
  253 + int index=dataList.indexOf(rs);
  254 + if (index< dataList.size()-1&&!map_get_str( rs,"LINE_ID").equals(map_get_str( dataList.get(index+1),"LINE_ID"))){
  255 + Map<String,Object> LSmap=new HashMap<>();
  256 + String name=lineRepository.findOne(Integer.valueOf(map_get_str( rs,"LINE_ID"))).getName();
  257 + String NextName=lineRepository.findOne(Integer.valueOf(map_get_str( dataList.get(index+1),"LINE_ID"))).getName();
  258 + LSmap.put("abnormalType","linesSwitch");
  259 + LSmap.put("line_line",name+"-->"+NextName);
  260 + LSmap.put("st",map_get_long(rs, "TS"));
  261 + LSmap.put("et",index== dataList.size()-1?map_get_long(rs, "TS"):map_get_long( dataList.get(index+1), "TS"));
  262 + lineSwitch.add(LSmap);
  263 + }
234 264 serviceState = map_get_long(rs, "SERVICE_STATE");
235   - if(getGpsValid(serviceState) == 1)
236   - continue;
  265 + if(getGpsValid(serviceState) == 1){
  266 + if (isFirstNotValid) {
  267 + gpsNotValidMap=new HashMap<>();
  268 + gpsNotValidMap.put("abnormalType","gpsNotValid");
  269 + gpsNotValidMap.put("st",map_get_long(rs,"TS"));
  270 + isFirstNotValid=false;
  271 + }
  272 + if (index== dataList.size()-1||index< dataList.size()-1&&getGpsValid(map_get_long(dataList.get(index+1), "SERVICE_STATE"))!=1){
  273 + gpsNotValidMap.put("et",map_get_long(rs,"TS"));
  274 + gpsNotValidList.add(gpsNotValidMap);
  275 + isFirstNotValid=true;
  276 + gpsNotValidMap=null;
  277 + }
  278 + }
  279 + //continue;
237 280  
238 281 map = new HashMap<>();
239 282 lon = map_get_float(rs, "LON");
240 283 lat = map_get_float(rs, "LAT");
  284 + if (lon==0||lat==0){
  285 + if (isFirstLonlatZero){
  286 + zeroMap=new HashMap<>();
  287 + zeroMap.put("abnormalType","gpsZero");
  288 + zeroMap.put("st",map_get_long(rs,"TS"));
  289 + isFirstLonlatZero=false;
  290 + }
  291 + if (index<dataList.size()-1&&(map_get_float(dataList.get(index+1),"LON")!=0&&map_get_float(dataList.get(index+1),"LAT")!=0)){
  292 + zeroMap.put("et",map_get_long(rs,"TS"));
  293 + gpsEqualsZeroList.add(zeroMap);
  294 + isFirstLonlatZero=true;
  295 + }
  296 + }
241 297 // 高德坐标
242 298 gdLoc = TransGPS.transformFromWGSToGCJ(TransGPS.LocationMake(lon, lat));
243 299 map.put("gcj_lon", gdLoc.getLng());
... ... @@ -258,7 +314,7 @@ public class GpsServiceImpl implements GpsService {
258 314  
259 315 map.put("lineId", map_get_str(rs, "LINE_ID"));
260 316 map.put("speed", map_get_float(rs,"SPEED_GPS"));
261   -
  317 + lineSet.add(map_get_str(rs, "LINE_ID"));
262 318 inOutStop = Integer.parseInt(rs.get("INOUT_STOP").toString());
263 319 map.put("inout_stop", inOutStop);
264 320  
... ... @@ -276,6 +332,48 @@ public class GpsServiceImpl implements GpsService {
276 332 map.put("section_code", map_get_str(rs,"SECTION_CODE"));
277 333 list.add(map);
278 334 }
  335 +
  336 + if (lineSet.size()>0){
  337 + for (String s : lineSet) {
  338 + int lineId=Integer.parseInt(s);
  339 + List<LineVersions> lvs=lineVersionsRepository.findBylineId(lineId);
  340 + List<Map<String,Object>> vlist=new ArrayList<>();
  341 + Map<String,Object> vMap;
  342 + Long qt=0L;
  343 + if (lvs!=null&&!lvs.isEmpty()){
  344 + for (LineVersions lv : lvs) {
  345 + vMap=new HashMap();
  346 + Long sd=lv.getStartDate().getTime();
  347 + Long ed=lv.getEndDate().getTime();
  348 + if (sd<st&&et<ed){
  349 + vMap.put("version",lv.getVersions());
  350 + vMap.put("vtime","all");
  351 + vlist.add(vMap);
  352 + }else if(sd<st&&et>ed&&st<ed){
  353 + vMap.put("version",lv.getVersions());
  354 + vMap.put("endTime",lv.getEndDate().getTime());
  355 + vMap.put("abnormalType","versionSwitch");
  356 + vMap.put("st",lv.getEndDate().getTime());
  357 + //vMap.put("et",lvs.indexOf(lv)==lvs.size()-1?lv.getEndDate().getTime():lvs.get(lvs.indexOf(lv)+1).getStartDate().getTime());
  358 + qt=lv.getEndDate().getTime();
  359 + vlist.add(vMap);
  360 + }else if(st<sd&&et<ed&&sd<et){
  361 + vMap.put("version",lv.getVersions());
  362 + vMap.put("startTime",lv.getStartDate().getTime());
  363 + vlist.add(vMap);
  364 + }
  365 + }
  366 + }
  367 + rsMap.put("lineVerson",vlist);
  368 + if (vlist.size()>1){
  369 + Map<String,Object> VSmap=new HashMap<>();
  370 + VSmap.put("abnormalType","vserionSwitch");
  371 + VSmap.put("st",qt);
  372 + versionSwitchList.add(VSmap);
  373 + }
  374 + }
  375 +
  376 + }
279 377 // 按时间排序
280 378 Collections.sort(list, new Comparator<Map<String, Object>>() {
281 379  
... ... @@ -287,6 +385,9 @@ public class GpsServiceImpl implements GpsService {
287 385  
288 386 rsMap.put("list", list);
289 387 rsMap.put("dcs", dcs);
  388 + rsMap.put("gpsNotValid",gpsNotValidList);
  389 + rsMap.put("lineSwitch",lineSwitch);
  390 + rsMap.put("lonlatZero",gpsEqualsZeroList);
290 391 return rsMap;
291 392 }
292 393  
... ... @@ -714,6 +815,10 @@ public class GpsServiceImpl implements GpsService {
714 815 rs.put("outboundList", outboundList);
715 816 rs.put("sumMileage", new DecimalFormat(".##").format(sum / 1000));
716 817 rs.put("dcs", gpsMap.get("dcs"));
  818 + rs.put("lineVerson",gpsMap.get("lineVerson"));
  819 + rs.put("gpsInvalid",gpsMap.get("gpsNotValid"));
  820 + rs.put("gpslineSwitch",gpsMap.get("lineSwitch"));
  821 + rs.put("gpslonlatex",gpsMap.get("lonlatZero"));
717 822 } catch (Exception e) {
718 823 logger.error("", e);
719 824 rs.put("status", ResponseCode.ERROR);
... ...
src/main/java/com/bsth/service/impl/BusIntervalServiceImpl.java
... ... @@ -306,10 +306,10 @@ public class BusIntervalServiceImpl implements BusIntervalService {
306 306 String sql = "select id,cc_id,mileage_type,destroy,destroy_reason," +
307 307 " mileage,type1,type2,schedule from bsth_c_s_child_task" +
308 308 " where 1=1";
309   - if(schedule1 != null && schedule1 > 0){
  309 + if(schedule1 != null && schedule1 >= 0){
310 310 sql += " and schedule >= '"+schedule1+"'";
311 311 }
312   - if(schedule2 != null && schedule2 > 0){
  312 + if(schedule2 != null && schedule2 >= 0){
313 313 sql += " and schedule <= '"+schedule2+"'";
314 314 }
315 315  
... ... @@ -520,9 +520,9 @@ public class BusIntervalServiceImpl implements BusIntervalService {
520 520 continue;
521 521 Map<String, List<ScheduleRealInfo>> keyMap2 = new HashMap<String, List<ScheduleRealInfo>>();
522 522 for(ScheduleRealInfo schedule : keyMap.get(key)){
523   - if(companyName.length() == 0 && schedule.getGsName() != null)
  523 + if(companyName.trim().length() == 0 && schedule.getGsName() != null)
524 524 companyName = schedule.getGsName();
525   - if(subCompanyName.length() == 0 && schedule.getFgsName() != null)
  525 + if(subCompanyName.trim().length() == 0 && schedule.getFgsName() != null)
526 526 subCompanyName = schedule.getFgsName();
527 527 String date = schedule.getScheduleDateStr();
528 528 if(!keyMap2.containsKey(date))
... ... @@ -1061,7 +1061,7 @@ public class BusIntervalServiceImpl implements BusIntervalService {
1061 1061 continue;
1062 1062 }
1063 1063 String key = schedule.getScheduleDateStr() + "/" + schedule.getXlName() + "/"
1064   - + schedule.getLpName() + "/" + schedule.getFgsName();
  1064 + + schedule.getLpName() + "/" + schedule.getFgsBm();
1065 1065 if(model.length() != 0){
1066 1066 if(ttSet.contains(schedule.getSpId())){
1067 1067 if(!keyMap.containsKey(key))
... ... @@ -1099,10 +1099,10 @@ public class BusIntervalServiceImpl implements BusIntervalService {
1099 1099 long jhyssj1 = 0, sjyssj1 = 0;
1100 1100 double jhlc = 0, sjlc = 0;
1101 1101 for(ScheduleRealInfo schedule : list2){
1102   - if(companyName.length() == 0 && schedule.getGsName() != null){
  1102 + if(companyName.trim().length() == 0 && schedule.getGsName() != null){
1103 1103 companyName = schedule.getGsName();
1104 1104 }
1105   - if(subCompanyName.length() == 0 && schedule.getFgsName() != null){
  1105 + if(subCompanyName.trim().length() == 0 && schedule.getFgsName() != null){
1106 1106 subCompanyName = schedule.getFgsName();
1107 1107 }
1108 1108 long fcsj = schedule.getFcsjT();
... ... @@ -1887,7 +1887,7 @@ public class BusIntervalServiceImpl implements BusIntervalService {
1887 1887 continue;
1888 1888 }
1889 1889  
1890   - String key = schedule.getXlName() + "/" + schedule.getFgsName();
  1890 + String key = schedule.getXlName() + "/" + schedule.getFgsBm();
1891 1891 if(!keyMap.containsKey(key))
1892 1892 keyMap.put(key, new ArrayList<ScheduleRealInfo>());
1893 1893 keyMap.get(key).add(schedule);
... ... @@ -1978,9 +1978,9 @@ public class BusIntervalServiceImpl implements BusIntervalService {
1978 1978 qtlc = new BigDecimal("0");
1979 1979 String companyName = "", subCompanyName = "";
1980 1980 for(ScheduleRealInfo schedule : keyMap.get(key)){
1981   - if(schedule.getGsName() != null && companyName.length() == 0)
  1981 + if(schedule.getGsName() != null && companyName.trim().length() == 0)
1982 1982 companyName = schedule.getGsName();
1983   - if(schedule.getFgsName() != null && subCompanyName.length() == 0)
  1983 + if(schedule.getFgsName() != null && subCompanyName.trim().length() == 0)
1984 1984 subCompanyName = schedule.getFgsName();
1985 1985 BigDecimal lc = new BigDecimal("0");
1986 1986 if(schedule.getJhlcOrig() != null && schedule.getJhlcOrig() > 0.1d){
... ... @@ -2071,7 +2071,8 @@ public class BusIntervalServiceImpl implements BusIntervalService {
2071 2071 String[] keys = key.split("/");
2072 2072 tempMap.put("date", Date);
2073 2073 tempMap.put("company", companyName);
2074   - tempMap.put("subCompany", keys[1]);
  2074 + tempMap.put("subCompany", subCompanyName);
  2075 +// tempMap.put("subCompany", keys[1]);
2075 2076 tempMap.put("times", sfqr == 1 ? times : "全日");
2076 2077 tempMap.put("line", keys[0]);
2077 2078 tempMap.put("jhbc", jhbc);
... ... @@ -2338,17 +2339,23 @@ public class BusIntervalServiceImpl implements BusIntervalService {
2338 2339 continue;
2339 2340 }
2340 2341  
2341   - String key = schedule.getGsName() + "/" + schedule.getFgsName() + "/" + schedule.getXlBm();
  2342 + String key = schedule.getGsBm() + "/" + schedule.getFgsBm() + "/" + schedule.getXlBm();
2342 2343 if(!keyMap.containsKey(key))
2343 2344 keyMap.put(key, new ArrayList<ScheduleRealInfo>());
2344 2345 keyMap.get(key).add(schedule);
2345 2346 }
  2347 +
2346 2348 for(String key : keyMap.keySet()){
  2349 + String companyName = "", subCompanyName = "";
2347 2350 Map<String, Object> tempMap = new HashMap<String, Object>();
2348 2351 List<ScheduleRealInfo> tempList = new ArrayList<ScheduleRealInfo>();
2349 2352 int sjbc = 0, sddf = 0, zddf = 0,
2350 2353 dxtz = 0, lbtz = 0;
2351 2354 for(ScheduleRealInfo schedule : keyMap.get(key)){
  2355 + if(schedule.getGsName() != null && companyName.trim().length() == 0)
  2356 + companyName = schedule.getGsName();
  2357 + if(schedule.getFgsName() != null && subCompanyName.trim().length() == 0)
  2358 + subCompanyName = schedule.getFgsName();
2352 2359 boolean flag = false;
2353 2360 if(schedule.getFcsjActual() != null && schedule.getZdsjActual() != null
2354 2361 && schedule.getStatus() != -1 && !schedule.isCcService()){
... ... @@ -2373,8 +2380,10 @@ public class BusIntervalServiceImpl implements BusIntervalService {
2373 2380 }
2374 2381 tempMap.put("date", date);
2375 2382 String[] keys = key.split("/");
2376   - tempMap.put("company", keys[0]);
2377   - tempMap.put("subCompany", keys[1]);
  2383 + tempMap.put("company", companyName);
  2384 + tempMap.put("subCompany", subCompanyName);
  2385 +// tempMap.put("company", keys[0]);
  2386 +// tempMap.put("subCompany", keys[1]);
2378 2387 tempMap.put("line", keys[2]);
2379 2388 tempMap.put("sjbc", sjbc);
2380 2389 tempMap.put("sddf", sddf);
... ... @@ -3108,7 +3117,7 @@ public class BusIntervalServiceImpl implements BusIntervalService {
3108 3117 continue;
3109 3118 }
3110 3119  
3111   - String xl = s.getXlName() + "/" + s.getFgsName();
  3120 + String xl = s.getXlName() + "/" + s.getFgsBm();
3112 3121 String dateStr = s.getScheduleDateStr();
3113 3122 if(!sches.containsKey(xl)){
3114 3123 sches.put(xl, new HashMap<String, List<ScheduleRealInfo>>());
... ... @@ -3138,12 +3147,19 @@ public class BusIntervalServiceImpl implements BusIntervalService {
3138 3147 List<List<Map<String, Object>>> lists = new ArrayList<List<Map<String, Object>>>();
3139 3148 Map<Long, ScheduleRealInfo> keyTemp = new HashMap<Long, ScheduleRealInfo>();
3140 3149 for(Long time : timeList){
  3150 + String companyName = "", subCompanyName = "";
3141 3151 List<Long> keyList = new ArrayList<Long>();
3142 3152 String date = timeTemp.get(time);
3143 3153 List<ScheduleRealInfo> sche2 = sche1.get(date);
3144 3154 for(ScheduleRealInfo s : sche2){
3145 3155 if(s.getFcsj()!=null && s.getFcsj().trim().length() > 0
3146 3156 && s.getFcsj().contains(":")){
  3157 +
  3158 + if(s.getGsName() != null && companyName.trim().length() == 0)
  3159 + companyName = s.getGsName();
  3160 + if(s.getFgsName() != null && subCompanyName.trim().length() == 0)
  3161 + subCompanyName = s.getFgsName();
  3162 +
3147 3163 String[] split = s.getFcsj().split(":");
3148 3164 Long key = Long.valueOf(s.getXlDir())*1500 + Long.valueOf(split[0])*60 + Long.valueOf(split[1]);
3149 3165 while(keyTemp.containsKey(key)){
... ... @@ -3158,8 +3174,10 @@ public class BusIntervalServiceImpl implements BusIntervalService {
3158 3174 for(Long l : keyList){
3159 3175 ScheduleRealInfo s = keyTemp.get(l);
3160 3176 Map<String, Object> temp = new HashMap<String, Object>();
3161   - temp.put("gs", s.getGsName());
3162   - temp.put("fgs", s.getFgsName());
  3177 + temp.put("gs", companyName);
  3178 + temp.put("fgs", subCompanyName);
  3179 +// temp.put("gs", s.getGsName());
  3180 +// temp.put("fgs", s.getFgsName());
3163 3181 temp.put("fgsBm", s.getFgsBm());
3164 3182 temp.put("date", date);
3165 3183 temp.put("xlbm", s.getXlBm());
... ...
src/main/java/com/bsth/service/impl/TrafficManageServiceImpl.java
... ... @@ -32,6 +32,7 @@ import org.slf4j.LoggerFactory;
32 32 import org.springframework.beans.factory.annotation.Autowired;
33 33 import org.springframework.data.domain.Sort;
34 34 import org.springframework.data.domain.Sort.Direction;
  35 +import org.springframework.security.core.context.SecurityContextHolder;
35 36 import org.springframework.stereotype.Service;
36 37  
37 38 import java.io.*;
... ... @@ -65,6 +66,10 @@ import java.util.regex.Pattern;
65 66 public class TrafficManageServiceImpl implements TrafficManageService{
66 67  
67 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 74 // 线路repository
70 75 @Autowired
... ... @@ -170,7 +175,7 @@ public class TrafficManageServiceImpl implements TrafficManageService{
170 175 @Override
171 176 public String setXL(String ids) {
172 177 String result = "failure";
173   - StringBuffer sBuffer = new StringBuffer();
  178 + String xml ;
174 179 String[] idArray = ids.split(",");
175 180 try {
176 181 for (String id : idArray) {
... ... @@ -185,12 +190,6 @@ public class TrafficManageServiceImpl implements TrafficManageService{
185 190 if(line == null){
186 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 193 if(BasicData.lineId2ShangHaiCodeMap.get(line.getId()) == null){
195 194 return result;
196 195 }
... ... @@ -200,56 +199,25 @@ public class TrafficManageServiceImpl implements TrafficManageService{
200 199 if(lineInformation == null){
201 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 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 211 result = "success";
  212 + state = "1";
248 213 }else{
249 214 result = "failure";
  215 + state = "0";
250 216 }
251   - logger.info("setXL:"+sBuffer.toString());
  217 + logger.info("setXL:"+xml);
252 218 logger.info("setXL:"+result);
  219 + // 保存运管处上传记录
  220 + saveYgcUploadLog(line,xml,TrafficManageServiceImpl.UPLOAD_TYPE_XL,state);
253 221 }
254 222 } catch (Exception e) {
255 223 logger.error("setXL:",e);
... ... @@ -422,10 +390,11 @@ public class TrafficManageServiceImpl implements TrafficManageService{
422 390 HashMap logXlbmMap = new HashMap();
423 391 Results results = null;
424 392 String str = "",xlbm;
  393 + // 保存线路(运管处日志用)
  394 + Map<String , Line> logLineMap = null;
425 395 try {
426 396 int counter = 0; // 计数器
427 397 int per = 10; // 每几条线路上传一次路单
428   -
429 398 List<ScheduleRealInfo> list = scheduleRealInfoRepository.setLD(date);
430 399 List<Map<String,Object>> listGroup = scheduleRealInfoRepository.setLDGroup(date);
431 400 Map<String,Object> map = new HashMap();
... ... @@ -444,13 +413,15 @@ public class TrafficManageServiceImpl implements TrafficManageService{
444 413 if(counter % per == 0){
445 414 sf = new StringBuffer();
446 415 sf.append("<DLDS>");
  416 + logLineMap = new HashMap<>();
447 417 }
448 418 counter ++;
449 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 422 logXlbmMap.put(xlbm,xlbm);
453 423 }
  424 + logLineMap.put(line.getLineCode(),line);
454 425 sf.append("<DLD>");
455 426 sf.append("<RQ>"+date+"</RQ>");
456 427 sf.append("<XLBM>"+xlbm+"</XLBM>");
... ... @@ -513,7 +484,7 @@ public class TrafficManageServiceImpl implements TrafficManageService{
513 484 str = sf.toString().replace("'","");// 去掉'号
514 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 490 // 每per条线路上传后剩下的数据再上传
... ... @@ -521,9 +492,9 @@ public class TrafficManageServiceImpl implements TrafficManageService{
521 492 sf.append("</DLDS>");
522 493 str = sf.toString().replace("'","");// 去掉'号
523 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 498 } catch (Exception e) {
528 499 logger.error("setLD:",e);
529 500 logFailure.append(e).append("<br/>");
... ... @@ -558,21 +529,26 @@ public class TrafficManageServiceImpl implements TrafficManageService{
558 529 * @param str
559 530 */
560 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 533 String result = "failure";
  534 + String state;
563 535 // 记录日志
564 536 if(results != null){
565 537 if(results.isSuccess()){// 上传成功
566 538 // 把上线成功的线路编码放入 logXlbmSuccessMap,并记录logSuccess
567 539 countSuccess += fillMailXlbmMap(logXlbmMap,logXlbmSuccessMap,logSuccess);
568 540 result = "success";
  541 + state = "1";
569 542 }else{// 上传失败
570 543 // 把上线失败的线路编码放入 logXlbmFailureMap,并记录logFailure
571 544 countFailure += fillMailXlbmMap(logXlbmMap,logXlbmFailureMap,logFailure);
572 545 result = "failure";
  546 + state = "0";
573 547 }
574 548 logger.info("setLD:"+str);
575 549 logger.info("setLD:"+result);
  550 + // 保存运管处上传记录
  551 + saveYgcUploadLog(logLineMap,str,TrafficManageServiceImpl.UPLOAD_TYPE_LD,state);
576 552 results = null;
577 553 logXlbmMap = new HashMap();
578 554 }
... ... @@ -946,7 +922,7 @@ public class TrafficManageServiceImpl implements TrafficManageService{
946 922 @Override
947 923 public String setSKB(String ids) {
948 924 String result = "上传失败,";
949   - StringBuffer sBuffer = new StringBuffer();
  925 + StringBuffer sBuffer = new StringBuffer("<SKBs>");
950 926 DecimalFormat df = new DecimalFormat("######0.000");
951 927 Map<String,String> lsStationCode2NameMap = null;
952 928 Map<String, Integer> lsStationName2YgcNumber = null;
... ... @@ -962,7 +938,6 @@ public class TrafficManageServiceImpl implements TrafficManageService{
962 938 LineInformation lineInformation;
963 939 Iterator<TTInfoDetail> ttInfoDetailIterator;
964 940 HashMap<String,Object> param ;
965   - sBuffer.append("<SKBs>");
966 941 HashMap<String,String> paramMap;
967 942 HashMap<String,String> otherMap = new HashMap<>();
968 943 // 线路编码、周几执行、发车站点名称、发车站点序号、到达站点名称、到达站点序号
... ... @@ -1113,29 +1088,103 @@ public class TrafficManageServiceImpl implements TrafficManageService{
1113 1088 logger.info("setSKB:"+"ttinfoId:"+ttinfoId+";当前站点版本号:"+lineVersion+";查询历史站点路由:"+lsStationCode2NameMap+";查询历史站点编号:"+lsStationName2YgcNumber);
1114 1089 }
1115 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 1101 } catch (Exception e) {
1129 1102 logger.error("setSKB:", e);
1130 1103 e.printStackTrace();
1131 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 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 1190 @Override
... ... @@ -1640,4 +1689,50 @@ public class TrafficManageServiceImpl implements TrafficManageService{
1640 1689 }
1641 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/oil/impl/YlbServiceImpl.java
... ... @@ -291,6 +291,26 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS
291 291 String sxtj=map2.get("sxtj").toString();
292 292 if(sxtj.equals("0")){
293 293 listpb=listpbs;
  294 + }else if (sxtj.equals("5")){
  295 + List<String> stringList=new ArrayList<String>();
  296 +
  297 + List<Object[]> objectLists = repository.checkNbmmFgs(rq, gsbm);
  298 + for (int i = 0; i < objectLists.size(); i++) {
  299 + String clbm=objectLists.get(i)[0].toString();
  300 + stringList.add(clbm);
  301 + }
  302 +
  303 + for (int i = 0; i < stringList.size(); i++) {
  304 + String strNbbm=stringList.get(i);
  305 + for (int j = 0; j < listpbs.size(); j++) {
  306 + Map<String, Object> map = listpbs.get(j);
  307 + String mapNbbm=map.get("clZbh").toString();
  308 + if(strNbbm.equals(mapNbbm)){
  309 + listpb.add(map);
  310 + }
  311 + }
  312 + }
  313 +
294 314 }else{
295 315 List<Object[]> objectLists=repository.checkNbmmNum(rq, gsbm, fgsbm, "",nbbm);
296 316 List<String> stringList=new ArrayList<String>();
... ... @@ -1269,6 +1289,19 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS
1269 1289 else
1270 1290 listYlb = repository.listYlb_s(sdf.parse(rq+" 00:00:00"), gsbm, fgsbm, xlbm, stringList);
1271 1291 }
  1292 + }else if(sxtj.equals("5")){
  1293 + List<Object[]> objectLists = repository.checkNbmmFgs(rq, gsbm);
  1294 + for (int i = 0; i < objectLists.size(); i++) {
  1295 + String clbm =objectLists.get(i)[0].toString();
  1296 + stringList.add(clbm);
  1297 + }
  1298 +
  1299 + if (stringList.size() > 0) {
  1300 + if (type.equals("1"))
  1301 + listYlb = repository.listYlb(rq, gsbm, fgsbm, xlbm, stringList);
  1302 + else
  1303 + listYlb = repository.listYlb_s(sdf.parse(rq+" 00:00:00"), gsbm, fgsbm, xlbm, stringList);
  1304 + }
1272 1305 } else {
1273 1306 List<Object[]> objectLists;
1274 1307 if (sxtj.equals("3")) {
... ... @@ -1395,6 +1428,10 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS
1395 1428 try {
1396 1429 List<Cyl> cylList = cylRepository.findAll(new CustomerSpecs<Cyl>(newMap));
1397 1430 String json =StringEscapeUtils.unescapeHtml4(map.get("ylbList").toString());
  1431 + String fgsbm="999";
  1432 + if(map.get("fgsbm")!=null){
  1433 + fgsbm=map.get("fgsbm").toString();
  1434 + }
1398 1435 JSONArray jsonArray=JSONArray.parseArray(json);
1399 1436 JSONObject jsonObject;
1400 1437 for (int x = 0; x < jsonArray.size(); x++) {
... ... @@ -1409,7 +1446,12 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS
1409 1446 String nbbm_eq = ylb.getNbbm();
1410 1447 Date rq_eq = ylb.getRq();
1411 1448 // 得到一天总的加油和里程(根据车,时间)
1412   - List<Object[]> sumList = repository.sumLcYl(nbbm_eq, rq_eq,"",ylb.getSsgsdm(),ylb.getFgsdm());
  1449 + List<Object[]> sumList=new ArrayList<Object[]>();
  1450 + if(fgsbm.equals(""))
  1451 + sumList = repository.sumLcYl(nbbm_eq, rq_eq,"",ylb.getSsgsdm(),fgsbm);
  1452 + else
  1453 + sumList = repository.sumLcYl(nbbm_eq, rq_eq,"",ylb.getSsgsdm(),ylb.getFgsdm());
  1454 +
1413 1455 // 保存总的加油量
1414 1456 Double jzl = 0.0;
1415 1457 // 保存总的里程
... ... @@ -1431,9 +1473,14 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS
1431 1473 }*/
1432 1474 map.put("nbbm_eq", nbbm_eq);
1433 1475 map.put("rq_eq", rq_eq);
1434   -
1435   - List<Ylb> iterator2=this.listOrderBy(sdf.format(rq_eq),ylb.getSsgsdm(),ylb.getFgsdm(),"",
1436   - ylb.getNbbm(),"jcsx");
  1476 + List<Ylb> iterator2=null;
  1477 + if(fgsbm.equals(""))
  1478 + iterator2=this.listOrderBy(sdf.format(rq_eq),ylb.getSsgsdm(),fgsbm,"",
  1479 + ylb.getNbbm(),"jcsx");
  1480 + else
  1481 + iterator2=this.listOrderBy(sdf.format(rq_eq),ylb.getSsgsdm(),ylb.getFgsdm(),"",
  1482 + ylb.getNbbm(),"jcsx");
  1483 +
1437 1484 // repository.obtainYl(sdf.format(rq_eq),ylb.getSsgsdm(),ylb.getFgsdm(),"",
1438 1485 // ylb.getNbbm(),"jcsx");
1439 1486 DecimalFormat df = new DecimalFormat("#.00");
... ...
src/main/java/com/bsth/service/realcontrol/RealMapService.java
... ... @@ -12,6 +12,8 @@ public interface RealMapService {
12 12  
13 13 Map<String, Object> findRouteByLine(String idx);
14 14  
  15 + Map<String, Object> findRouteAndVersionByLine(String idx);
  16 +
15 17 Map<String,Object> findRouteAndStationByLine(String lineCode);
16 18  
17 19 Map<String,Object> multiSectionRoute(String codeIdx);
... ...
src/main/java/com/bsth/service/realcontrol/dto/SectionRouteCoords.java
... ... @@ -24,6 +24,16 @@ public class SectionRouteCoords {
24 24  
25 25 private Float sectionTime;
26 26  
  27 + private Integer versions;
  28 +
  29 + public Integer getVersions() {
  30 + return versions;
  31 + }
  32 +
  33 + public void setVersions(Integer versions) {
  34 + this.versions = versions;
  35 + }
  36 +
27 37 public int getId() {
28 38 return id;
29 39 }
... ...
src/main/java/com/bsth/service/realcontrol/impl/RealMapServiceImpl.java
... ... @@ -42,7 +42,7 @@ public class RealMapServiceImpl implements RealMapService {
42 42 }
43 43 inStr = " (" + inStr.substring(1) + ")";
44 44  
45   - String sql = "select r.LINE_CODE,r.STATION_NAME,r.STATION_CODE,r.STATION_MARK,r.DIRECTIONS,r.DISTANCES,r.TO_TIME, r.VERSIONS,s.G_LONX,s.G_LATY,s.RADIUS,s.SHAPES_TYPE,ST_AsText(s.G_POLYGON_GRID) as G_POLYGON_GRID, r.STATION_ROUTE_CODE from bsth_c_stationroute r inner join bsth_c_station s on r.station=s.id where r.line_code in " + inStr + " and r.destroy=0";
  45 + String sql = "select r.LINE_CODE,r.STATION_NAME,r.STATION_CODE,r.STATION_MARK,r.DIRECTIONS,r.DISTANCES,r.TO_TIME, r.VERSIONS,s.G_LONX,s.G_LATY,s.RADIUS,s.SHAPES_TYPE,ST_AsText(s.G_POLYGON_GRID) as G_POLYGON_GRID, r.STATION_ROUTE_CODE,r.versions from bsth_c_stationroute r inner join bsth_c_station s on r.station=s.id where r.line_code in " + inStr + " and r.destroy=0";
46 46  
47 47 List<StationSpatialData> list = jdbcTemplate.query(sql, new BeanPropertyRowMapper(StationSpatialData.class));
48 48 rs.put("status", ResponseCode.SUCCESS);
... ... @@ -84,7 +84,7 @@ public class RealMapServiceImpl implements RealMapService {
84 84 }
85 85 inCond.deleteCharAt(inCond.length() - 1).append(")");
86 86  
87   - String sql = "SELECT r.ID,r.LINE_CODE,r.SECTION_CODE,r.SECTIONROUTE_CODE,r.DIRECTIONS,s.SECTION_NAME,ST_AsText(s.GSECTION_VECTOR) GSECTION_VECTOR,s.SECTION_DISTANCE,s.SECTION_TIME FROM bsth_c_sectionroute r INNER JOIN bsth_c_section s on r.section_code=s.section_code WHERE r.line_code in "+inCond.toString()+" and r.destroy=0 order by sectionroute_code";
  87 + String sql = "SELECT r.ID,r.LINE_CODE,r.SECTION_CODE,r.SECTIONROUTE_CODE,r.DIRECTIONS,s.SECTION_NAME,ST_AsText(s.GSECTION_VECTOR) GSECTION_VECTOR,s.SECTION_DISTANCE,s.SECTION_TIME,r.versions FROM bsth_c_sectionroute r INNER JOIN bsth_c_section s on r.section_code=s.section_code WHERE r.line_code in "+inCond.toString()+" and r.destroy=0 order by sectionroute_code";
88 88 List<SectionRouteCoords> list = jdbcTemplate.query(sql, new BeanPropertyRowMapper(SectionRouteCoords.class));
89 89  
90 90 //排序
... ... @@ -133,6 +133,64 @@ public class RealMapServiceImpl implements RealMapService {
133 133 }
134 134  
135 135 @Override
  136 + public Map<String, Object> findRouteAndVersionByLine(String idx) {
  137 + Map<String, Object> rs = new HashMap<>();
  138 + StringBuilder inCond = new StringBuilder("(");
  139 + List<String> codeList = Splitter.on(",").splitToList(idx);
  140 + for(String lineCode : codeList){
  141 + inCond.append("'" + lineCode + "',");
  142 + }
  143 + inCond.deleteCharAt(inCond.length() - 1).append(")");
  144 +
  145 + String sql = "SELECT r.ID,r.LINE_CODE,r.SECTION_CODE,r.SECTIONROUTE_CODE,r.DIRECTIONS,s.SECTION_NAME,ST_AsText(s.GSECTION_VECTOR) GSECTION_VECTOR,s.SECTION_DISTANCE,s.SECTION_TIME,r.versions FROM bsth_c_sectionroute r INNER JOIN bsth_c_section s on r.section_code=s.section_code WHERE r.line_code in "+inCond.toString()+" and r.destroy=0 order by sectionroute_code";
  146 + List<SectionRouteCoords> list = jdbcTemplate.query(sql, new BeanPropertyRowMapper(SectionRouteCoords.class));
  147 +
  148 + //排序
  149 + Collections.sort(list, new Comparator<SectionRouteCoords>() {
  150 + @Override
  151 + public int compare(SectionRouteCoords o1, SectionRouteCoords o2) {
  152 + return Integer.parseInt(o1.getSectionrouteCode()) - Integer.parseInt(o2.getSectionrouteCode());
  153 + }
  154 + });
  155 +
  156 + ArrayListMultimap<String, SectionRouteCoords> listMultimap = ArrayListMultimap.create();
  157 + for (SectionRouteCoords sr : list) {
  158 + //按lineCode 分组
  159 + listMultimap.put(sr.getLineCode()+"_"+sr.getVersions(), sr);
  160 + }
  161 + //坐标转换
  162 + Map<String, Object> subMap;
  163 + Set<String> ks = listMultimap.keySet();
  164 + List<SectionRouteCoords> sublist;
  165 + List<String> upList,downList;
  166 + String vectorStr = "";
  167 + for(String k : ks){
  168 + subMap = new HashMap<>();
  169 + sublist = listMultimap.get(k);
  170 + upList = new ArrayList<>();
  171 + downList = new ArrayList<>();
  172 + for(SectionRouteCoords sr : sublist){
  173 + vectorStr = sr.getGsectionVector();
  174 + vectorStr = vectorStr.substring(11, vectorStr.length() - 2);
  175 + if (sr.getDirections() == 0)
  176 + upList.add(vectorStr);
  177 + else
  178 + downList.add(vectorStr);
  179 + }
  180 + subMap.put("up", upList);
  181 + //subMap.put("upJoins", jointCoords(upList));
  182 + subMap.put("down", downList);
  183 + subMap.put("up_bd", multiWgsToBd(upList));
  184 + subMap.put("down_bd", multiWgsToBd(downList));
  185 + subMap.put("up_gcj", multiWgsToGcj(upList));
  186 + subMap.put("down_gcj", multiWgsToGcj(downList));
  187 +
  188 + rs.put(k, subMap);
  189 + }
  190 + return rs;
  191 + }
  192 +
  193 + @Override
136 194 public Map<String, Object> findRouteAndStationByLine(String lineCode) {
137 195 Map<String, Object> rs = new HashMap<>();
138 196 try {
... ...
src/main/java/com/bsth/service/realcontrol/impl/ScheduleRealInfoServiceImpl.java
... ... @@ -568,7 +568,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
568 568  
569 569 //公司 和 分公司名称
570 570 t.setGsName(BasicData.businessCodeNameMap.get(t.getGsBm()));
571   - t.setFgsName(BasicData.businessFgsCodeNameMap.get(t.getGsBm() + "_" + t.getFgsBm()));
  571 + t.setFgsName(BasicData.businessFgsCodeNameMap.get(t.getFgsBm()+ "_" + t.getGsBm() ));
572 572  
573 573 //t.setScheduleDateStr(schDate);
574 574 t.setScheduleDate(sdfyyyyMMdd.parse(t.getScheduleDateStr()));
... ... @@ -590,6 +590,11 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
590 590  
591 591 //计算班次实际执行时间
592 592 schAttrCalculator.calcRealDate(t).calcAllTimeByFcsj(t);
  593 + //处理计达跨24点
  594 + LineConfig conf = lineConfigData.get(t.getXlBm());
  595 + if (t.getZdsj().compareTo(conf.getStartOpt()) < 0) {
  596 + t.setZdsjT(sdfyyyyMMddHHmm.parse(t.getScheduleDateStr() + t.getZdsj()).getTime() + (1000 * 60 * 60 * 24));
  597 + }
593 598 if (t.getZdsjT() < t.getFcsjT()) {
594 599 rs.put("status", ResponseCode.ERROR);
595 600 rs.put("msg", "起终点时间异常!");
... ...
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 790 if(map.get("fgsdmTurn")!=null){
791 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 799 String startDate=map.get("startDate").toString();
800 800 String endDate=map.get("endDate").toString();
... ... @@ -847,16 +847,82 @@ public class CalcSheetServiceImpl extends BaseServiceImpl&lt;CalcSheet, Integer&gt; im
847 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 916 if (type.equals("export")) {
851 917 String lineName=map.get("lineName").toString();
852 918 ReportUtils ee = new ReportUtils();
853 919 List<Iterator<?>> listI = new ArrayList<Iterator<?>>();
854   - listI.add(lists.iterator());
  920 + listI.add(list.iterator());
855 921 String path = this.getClass().getResource("/").getPath() + "static/pages/forms/";
856 922 ee.excelReplace(listI, new Object[] { map }, path + "mould/calcTurnoutrateZgf.xls", path + "export/"
857 923 + dates + "-" + lineName + "-营运线路出车率统计表.xls");
858 924 }
859   - return lists;
  925 + return list;
860 926 }
861 927  
862 928 @Override
... ...
src/main/resources/application-dev.properties
... ... @@ -8,9 +8,10 @@ spring.jpa.hibernate.naming_strategy= org.hibernate.cfg.ImprovedNamingStrategy
8 8 spring.jpa.database= MYSQL
9 9 spring.jpa.show-sql= true
10 10 spring.datasource.driver-class-name= com.mysql.jdbc.Driver
11   -spring.datasource.url= jdbc:mysql://127.0.0.1/pd_control?useUnicode=true&characterEncoding=utf-8&useSSL=false
  11 +#spring.datasource.url= jdbc:mysql://127.0.0.1/control?useUnicode=true&characterEncoding=utf-8&useSSL=false
  12 +spring.datasource.url= jdbc:mysql://192.168.168.222/control?useUnicode=true&characterEncoding=utf-8&useSSL=false
12 13 spring.datasource.username= root
13   -spring.datasource.password=
  14 +spring.datasource.password= root
14 15 #spring.datasource.url= jdbc:mysql://192.168.168.117/pd_control?useUnicode=true&characterEncoding=utf-8&useSSL=false
15 16 #spring.datasource.username= root
16 17 #spring.datasource.password= root
... ... @@ -31,4 +32,4 @@ http.gps.real.cache.url= http://10.10.150.24:12580/realGps/all
31 32 ## gateway real data
32 33 http.gps.real.url= http://114.80.178.12:18080/transport_server/rtgps/
33 34 ## gateway send directive
34   -http.send.directive = http://192.168.168.201:9090/transport_server/message/
  35 +http.send.directive = http://192.168.168.201:9090/transport_server/message/
35 36 \ No newline at end of file
... ...
src/main/resources/fatso/package.json
... ... @@ -11,8 +11,8 @@
11 11 "dependencies": {
12 12 "cheerio": "^0.20.0",
13 13 "clean-css": "^4.0.12",
14   - "colors": "^1.1.2",
  14 + "colors": "^1.3.3",
15 15 "eventproxy": "^0.3.4",
16 16 "uglify-js": "^2.6.2"
17 17 }
18   -}
19 18 \ No newline at end of file
  19 +}
... ...
src/main/resources/static/pages/base/line/js/line-list-table.js
... ... @@ -201,6 +201,7 @@
201 201 }
202 202 // 异步请求获取表格数据
203 203 $.get('/line',params,function(result){
  204 + debugger;
204 205 // 添加序号
205 206 result.content.page = page;
206 207 $.each(result.content, function(i, data) {
... ... @@ -339,8 +340,6 @@
339 340 return ;
340 341 }else {
341 342 layer.open({
342   - id:1,
343   - type: 1,
344 343 title: "线路文件版本号",
345 344 // skin:'layui-layer-rim',
346 345 area:['450px', 'auto'],
... ...
src/main/resources/static/pages/base/timesmodel/js/gantt.js
... ... @@ -77,6 +77,7 @@
77 77 CSMap = getMaxCarAndStopSpace1(map);
78 78 } else if (map.baseRes == '3') { // 主站停站使用v2_2版本
79 79 _paramObj = Main_v2.getFactory().createParameterObj(map, dataMap); // TODO:暂时使用v2_1版本的方法,通用的,后续再放到v2_2版本中
  80 + console.log(_paramObj);
80 81 map.clzs = InternalScheduleObj_v2_2.calcuClzx(_paramObj);
81 82 CSMap = getMaxCarAndStopSpace1(map);
82 83 }
... ... @@ -186,7 +187,7 @@
186 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/control/lineallot_v2/main.html
... ... @@ -507,6 +507,14 @@
507 507 });
508 508 //缓存路由
509 509 idx=idx.substr(0, idx.length - 1);
  510 + $.get('/realMap/findRouteAndVersionByLine', {idx: idx}, function (rs) {
  511 + if (rs) {
  512 + for(var lineCode in rs)
  513 + storage.setItem(lineCode + '_route', JSON.stringify(rs[lineCode]));
  514 +
  515 + eq.emit('cache_route');
  516 + }
  517 + });
510 518 $.get('/realMap/findRouteByLine', {idx: idx}, function (rs) {
511 519 if (rs) {
512 520 for(var lineCode in rs)
... ... @@ -516,6 +524,7 @@
516 524 }
517 525 });
518 526  
  527 +
519 528 //检查线路配置
520 529 checkLineConfig(ls_line_data, function (rs) {
521 530 if (rs.status == 0)
... ...
src/main/resources/static/pages/forms/calc/calcLbStatuAnaly.html 0 → 100644
  1 +<style type="text/css">
  2 + .table-bordered {
  3 + border: 1px solid; }
  4 + .table-bordered > thead > tr > th,
  5 + .table-bordered > thead > tr > td,
  6 + .table-bordered > tbody > tr > th,
  7 + .table-bordered > tbody > tr > td,
  8 + .table-bordered > tfoot > tr > th,
  9 + .table-bordered > tfoot > tr > td {
  10 + border: 1px solid; }
  11 + .table-bordered > thead > tr > th,
  12 + .table-bordered > thead > tr > td {
  13 + border-bottom-width: 2px; }
  14 + .table > tbody + tbody {
  15 + border-top: 1px solid; }
  16 + #forms > tbody > tr{
  17 + background-color: #FFFFFF;
  18 + }
  19 +</style>
  20 +
  21 +<div class="page-head">
  22 + <div class="page-title">
  23 + <h1>烂班情况分析表(统计)</h1>
  24 + </div>
  25 +</div>
  26 +
  27 +<div class="row">
  28 + <div class="col-md-12">
  29 + <div class="portlet light porttlet-fit bordered">
  30 + <div class="portlet-title">
  31 + <form id="history" class="form-inline" action="">
  32 + <div style="display: inline-block;margin-left: 5px;">
  33 + <span class="item-label" style="width: 80px;">烂班原因: </span>
  34 + <input class="form-control" type="checkbox" id="totalLb" style="width: 20px;" checked="true"/>全选
  35 + <input class="form-control" type="checkbox" name="reason" style="width: 20px;" value="0" checked="true"/>路阻
  36 + <input class="form-control" type="checkbox" name="reason" style="width: 20px;" value="1" checked="true"/>吊慢
  37 + <input class="form-control" type="checkbox" name="reason" style="width: 20px;" value="2" checked="true"/>故障
  38 + <input class="form-control" type="checkbox" name="reason" style="width: 20px;" value="3" checked="true"/>纠纷
  39 + <input class="form-control" type="checkbox" name="reason" style="width: 20px;" value="4" checked="true"/>肇事
  40 + <input class="form-control" type="checkbox" name="reason" style="width: 20px;" value="5" checked="true"/>缺人
  41 + <input class="form-control" type="checkbox" name="reason" style="width: 20px;" value="6" checked="true"/>缺车
  42 + <input class="form-control" type="checkbox" name="reason" style="width: 20px;" value="7" checked="true"/>客稀
  43 + <input class="form-control" type="checkbox" name="reason" style="width: 20px;" value="8" checked="true"/>气候
  44 + <input class="form-control" type="checkbox" name="reason" style="width: 20px;" value="9" checked="true"/>援外
  45 + <input class="form-control" type="checkbox" name="reason" style="width: 20px;" value="10" checked="true"/>其他
  46 + </div>
  47 + <div style="margin-top: 5px"></div>
  48 + <div style="display: inline-block; margin-left: 33px;" id="company1">
  49 + <span class="item-label" style="width: 80px;">公司: </span>
  50 + <select class="form-control" name="company" id="company" style="width: 140px;"></select>
  51 + </div>
  52 + <div style="display: inline-block; margin-left: 24px;" id="subCompany1">
  53 + <span class="item-label" style="width: 80px;">分公司: </span>
  54 + <select class="form-control" name="subCompany" id="subCompany" style="width: 140px;"></select>
  55 + </div>
  56 + <div style="display: inline-block; margin-left: 10px;">
  57 + <span class="item-label" style="width: 80px;">选择线路: </span>
  58 + <select class="form-control" name="line" id="line" style="width: 150px;"></select>
  59 + </div>
  60 + <div style="margin-top: 10px"></div>
  61 + <div style="display: inline-block; margin-left: 5px">
  62 + <span class="item-label" style="width: 80px;">是否营运: </span>
  63 + <select class="form-control" name="sfyy" id="sfyy" style="width: 140px;">
  64 + <option value="0">全部线路</option>
  65 + <option value="1" selected="selected">营运线路</option>
  66 + <option value="2">非营运线路</option>
  67 + </select>
  68 + </div>
  69 + <div style="display: inline-block;margin-left: 10px;">
  70 + <span class="item-label" style="width: 80px;">开始时间: </span>
  71 + <input class="form-control" type="text" id="startDate" style="width: 140px;"/>
  72 + </div>
  73 + <div style="display: inline-block;margin-left: 10px;">
  74 + <span class="item-label" style="width: 80px;">结束时间: </span>
  75 + <input class="form-control" type="text" id="endDate" style="width: 140px;"/>
  76 + </div>
  77 + <div class="form-group" style="margin-left: 10px">
  78 + <input class="btn btn-default" type="button" id="query" value="筛选"/>
  79 + <input class="btn btn-default" type="button" id="export" value="导出"/>
  80 + </div>
  81 + </form>
  82 + </div>
  83 + <div class="portlet-body">
  84 + <div class="table-container" id="table" style="margin-top: 0px;overflow:auto;min-width: 906px;">
  85 + <table class="table table-bordered table-hover table-checkable" id="forms">
  86 + <thead>
  87 +
  88 + </thead>
  89 + <tbody>
  90 +
  91 + </tbody>
  92 + </table>
  93 + <div style="text-align: right;">
  94 + <ul id="pagination" class="pagination"></ul>
  95 + </div>
  96 + </div>
  97 + </div>
  98 + </div>
  99 + </div>
  100 +</div>
  101 +
  102 +<script>
  103 + $(function(){
  104 + $('#export').attr('disabled', "true");
  105 +
  106 + // 关闭左侧栏
  107 + if (!$('body').hasClass('page-sidebar-closed'))
  108 + $('.menu-toggler.sidebar-toggler').click();
  109 +
  110 +
  111 + var d = new Date();
  112 + d.setTime(d.getTime() - 1*1000*60*60*24);
  113 + var year = d.getFullYear();
  114 + var month = d.getMonth() + 1;
  115 + var day = d.getDate();
  116 + if(month < 10)
  117 + month = "0" + month;
  118 + if(day < 10)
  119 + day = "0" + day;
  120 + var dateTime = year + "-" + month + "-" + day;
  121 + $("#startDate").datetimepicker({
  122 + format : 'YYYY-MM-DD',
  123 + locale : 'zh-cn',
  124 + maxDate : dateTime
  125 + });
  126 + $("#endDate").datetimepicker({
  127 + format : 'YYYY-MM-DD',
  128 + locale : 'zh-cn',
  129 + maxDate : dateTime
  130 + });
  131 + $("#startDate").val(dateTime);
  132 + $("#endDate").val(dateTime);
  133 +
  134 +
  135 + var fage=false;
  136 + var xlList;
  137 + var obj = [];
  138 +
  139 + $.get('/report/lineList',function(result){
  140 + xlList=result;
  141 + $.get('/user/companyData', function(result){
  142 + obj = result;
  143 + var options = '';
  144 + for(var i = 0; i < obj.length; i++){
  145 + options += '<option value="'+obj[i].companyCode+'">'+obj[i].companyName+'</option>';
  146 + }
  147 +
  148 + if(obj.length ==0){
  149 + $("#company1").css('display','none');
  150 + }else if(obj.length ==1){
  151 + $("#company1").css('display','none');
  152 + if(obj[0].children.length == 1 || obj[0].children.length ==0)
  153 + $('#subCompany1').css('display','none');
  154 + }
  155 + $('#company').html(options);
  156 + updateCompany();
  157 + });
  158 + })
  159 + $("#company").on("change",updateCompany);
  160 + function updateCompany(){
  161 + var company = $('#company').val();
  162 + var options = '<option value="">全部分公司</option>';
  163 + for(var i = 0; i < obj.length; i++){
  164 + if(obj[i].companyCode == company){
  165 + var children = obj[i].children;
  166 + for(var j = 0; j < children.length; j++){
  167 + options += '<option value="'+children[j].code+'">'+children[j].name+'</option>';
  168 + }
  169 + }
  170 + }
  171 + $('#subCompany').html(options);
  172 + }
  173 +
  174 + var tempData = {};
  175 + $.get('/report/lineList',function(xlList){
  176 + var data = [];
  177 + data.push({id: " ", text: "全部线路"});
  178 + $.get('/user/companyData', function(result){
  179 + for(var i = 0; i < result.length; i++){
  180 + var companyCode = result[i].companyCode;
  181 + var children = result[i].children;
  182 + for(var j = 0; j < children.length; j++){
  183 + var code = children[j].code;
  184 + for(var k=0;k < xlList.length;k++ ){
  185 + if(xlList[k]["fgsbm"]==code && xlList[k]["gsbm"]==companyCode){
  186 + data.push({id: xlList[k]["xlbm"], text: xlList[k]["xlname"]});
  187 + tempData[xlList[k]["xlbm"]] = companyCode+":"+code;
  188 + }
  189 + }
  190 + }
  191 + }
  192 + initPinYinSelect2('#line',data,'');
  193 +
  194 + });
  195 + });
  196 +
  197 + $("#line").on("change", function(){
  198 + if($("#line").val() == " "){
  199 + $("#company").attr("disabled", false);
  200 + $("#subCompany").attr("disabled", false);
  201 + } else {
  202 + var temp = tempData[$("#line").val()].split(":");
  203 + $("#company").val(temp[0]);
  204 + updateCompany();
  205 +// $("#subCompany").val(temp[1]);
  206 + $("#subCompany").val("");
  207 + $("#company").attr("disabled", true);
  208 +// $("#subCompany").attr("disabled", true);
  209 + }
  210 + });
  211 +
  212 + var lb = 0; //标志是否有选择至少一个烂班类型
  213 + $("#totalLb").on("change", function(){
  214 + var reason = $("input[name='reason']");
  215 + var checked = this.checked;
  216 + $.each(reason, function(i, g){
  217 + g.checked = checked;
  218 + });
  219 + if(checked == true)
  220 + lb = 33;
  221 + else
  222 + lb = 0;
  223 + });
  224 +
  225 + $("input[name='reason']").on("change", function(){
  226 + var totalLb = $("#totalLb")[0];
  227 + totalLb.checked = true;
  228 + lb = 0;
  229 + $.each($("input[name='reason']"), function(i, g){
  230 + if(g.checked == false){
  231 + totalLb.checked = false;
  232 + }else{
  233 + lb += 3;
  234 + }
  235 + });
  236 + });
  237 +
  238 + $("#query").on("click",jsDoQuery);
  239 +
  240 + var sfyy = 1;
  241 + var line = $("#line").val();
  242 + var startDate = $("#startDate").val();
  243 + var endDate = $("#endDate").val();
  244 + var company = $("#company").val();
  245 + var subCompany = $("#subCompany").val();
  246 + var lineName = $('#line option:selected').text();
  247 + function jsDoQuery(pagination){
  248 + if($("#startDate").val().trim().length == 0 || $("#endDate").val().trim().length == 0){
  249 + layer.msg("请选择日期");
  250 + return;
  251 + }
  252 + var reason = $("input[name='reason']");
  253 + var params = {};
  254 + if(line == " ")
  255 + line = "";
  256 +// line = $("#line").val();
  257 + sfyy = $("#sfyy").val();
  258 + startDate = $("#startDate").val();
  259 + endDate = $("#endDate").val();
  260 + company = $("#company").val();
  261 + subCompany = $("#subCompany").val();
  262 + params['line'] = line;
  263 + params['sfyy'] = sfyy;
  264 + params['startDate'] = startDate;
  265 + params['endDate'] = endDate;
  266 + params['company'] = company;
  267 + params['subCompany'] = subCompany;
  268 + params['type'] = "query";
  269 + lineName = $('#line option:selected').text();
  270 + if(lineName == "全部线路")
  271 + lineName = $('#subCompany option:selected').text();
  272 + var i = layer.load(2);
  273 +// $(".hidden").removeClass("hidden");
  274 + $get('/calcLbStatuAnaly/lbStatuAnaly', params, function(result){
  275 + // 把数据填充到模版中
  276 + var tbodyHtml = template('list_lbAnaly',{list:result, reason:reason, lb:lb});
  277 + // 把渲染好的模版html文本追加到表格中
  278 + $('#forms').html(tbodyHtml);
  279 + layer.close(i);
  280 +
  281 + _w_table_rowspan("#forms", 1);
  282 + _w_table_rowspan("#forms", 2);
  283 + _w_table_rowspan("#forms", 3);
  284 + _w_table_rowspan("#forms", 4);
  285 +// _w_table_rowspan("#forms", 5);
  286 +
  287 + if(result.length == 0)
  288 + $('#export').attr('disabled', "true");
  289 + else
  290 + $("#export").removeAttr("disabled");
  291 +
  292 + if($("#forms").height()+70 > $(window).height()-110){
  293 + $("#table").height($(window).height()-110);
  294 + } else {
  295 + $("#table").height($("#forms").height()+70);
  296 + }
  297 + });
  298 + }
  299 +
  300 + $("#export").on("click", function(){
  301 + if($("#startDate").val().trim().length == 0 || $("#endDate").val().trim().length == 0){
  302 + layer.msg("请选择日期");
  303 + return;
  304 + }
  305 + var params = {};
  306 + params['line'] = line;
  307 + params['sfyy'] = sfyy;
  308 + params['startDate'] = startDate;
  309 + params['endDate'] = endDate;
  310 + params['company'] = company;
  311 + params['subCompany'] = subCompany;
  312 + params['type'] = "export";
  313 + params['lineName'] = lineName;
  314 + var i = layer.load(2);
  315 + $get('/calc_export/lbStatuAnalyExport', params, function(result){
  316 + var dd = "";
  317 + if(startDate == endDate){
  318 + dd = moment(startDate).format("YYYYMMDD");
  319 + } else {
  320 + dd = moment(startDate).format("YYYYMMDD")
  321 + +"-"+moment(endDate).format("YYYYMMDD");
  322 + }
  323 + window.open("/downloadFile/download?fileName="
  324 + +dd+"-"+lineName+"-烂班情况分析表(统计)");
  325 + layer.close(i);
  326 + });
  327 + });
  328 +
  329 +
  330 + $("#line").on("change", function(){
  331 + line = $("#line").val();
  332 + if(line == " ")
  333 + line = "";
  334 + });
  335 + $('#startDate').on("blur", function(){
  336 + startDate = $("#startDate").val();
  337 + endDate = $("#endDate").val();
  338 + });
  339 + $('#endDate').on("blur", function(){
  340 + startDate = $("#startDate").val();
  341 + endDate = $("#endDate").val();
  342 + });
  343 +
  344 +
  345 + /**
  346 + * 将模块List 转换为树结构
  347 + * @param arr
  348 + * @returns {Array}
  349 + */
  350 + function createTreeData(arr){
  351 + var treeData = [];
  352 + var len = arr.length;
  353 + for(var i = 0; i < len; i ++){
  354 + var pId = arr[i].pId;
  355 + arr[i].text = arr[i].name;
  356 + if(!pId){
  357 + treeData.push(arr[i]);
  358 + }
  359 +
  360 + for(var j = 0; j < len; j ++){
  361 + if(pId == arr[j].id){
  362 + if(!arr[j].children)
  363 + arr[j].children = [];
  364 + arr[j].children.push(arr[i]);
  365 + break;
  366 + }
  367 + }
  368 + }
  369 + return treeData;
  370 + }
  371 +
  372 + function _w_table_rowspan(_w_table_id, _w_table_colnum){
  373 + _w_table_firsttd = "";
  374 + _w_table_currenttd = "";
  375 + _w_table_SpanNum = 0;
  376 + _w_table_Obj = jQuery(_w_table_id + " tr td:nth-child(" + _w_table_colnum + ")");
  377 + _w_table_Obj.each(function(i){
  378 + if(i==0){
  379 + _w_table_firsttd = jQuery(this);
  380 + _w_table_SpanNum = 1;
  381 + }else{
  382 + _w_table_currenttd = jQuery(this);
  383 + if(_w_table_firsttd.text()==_w_table_currenttd.text()){
  384 + _w_table_SpanNum++;
  385 + _w_table_currenttd.hide(); //remove();
  386 + _w_table_firsttd.attr("rowSpan",_w_table_SpanNum);
  387 + }else{
  388 + _w_table_firsttd = jQuery(this);
  389 + _w_table_SpanNum = 1;
  390 + }
  391 + }
  392 + });
  393 + }
  394 +
  395 +
  396 + });
  397 +
  398 +</script>
  399 +<script type="text/html" id="list_lbAnaly">
  400 +<thead>
  401 + <tr>
  402 + <th class="hidden"></th>
  403 + <th rowspan="3" style=" width:120px;">日期</th>
  404 + <th rowspan="3">公司</th>
  405 + <th rowspan="3">分公司</th>
  406 + <th rowspan="3">线路</th>
  407 + <th rowspan="2" colspan="3">总班次</th>
  408 + <th rowspan="2" colspan="3">总营运公里</th>
  409 + {{if lb != 0}}
  410 + <th colspan={{lb}}>烂班原因</th>
  411 + {{/if}}
  412 + </tr>
  413 + <tr>
  414 + <th class="hidden"></th>
  415 + {{if reason[0].checked == true}}<th colspan="3">路阻</th>{{/if}}
  416 + {{if reason[1].checked == true}}<th colspan="3">吊慢</th>{{/if}}
  417 + {{if reason[2].checked == true}}<th colspan="3">故障</th>{{/if}}
  418 + {{if reason[3].checked == true}}<th colspan="3">纠纷</th>{{/if}}
  419 + {{if reason[4].checked == true}}<th colspan="3">肇事</th>{{/if}}
  420 + {{if reason[5].checked == true}}<th colspan="3">缺人</th>{{/if}}
  421 + {{if reason[6].checked == true}}<th colspan="3">缺车</th>{{/if}}
  422 + {{if reason[7].checked == true}}<th colspan="3">客稀</th>{{/if}}
  423 + {{if reason[8].checked == true}}<th colspan="3">气候</th>{{/if}}
  424 + {{if reason[9].checked == true}}<th colspan="3">援外</th>{{/if}}
  425 + {{if reason[10].checked == true}}<th colspan="3">其他</th>{{/if}}
  426 + </tr>
  427 + <tr>
  428 + <th class="hidden"></th>
  429 + <th>计划</th><th>实际</th><th>百分比</th>
  430 + <th>计划</th><th>实际</th><th>百分比</th>
  431 + {{if reason[0].checked==true}}<th>烂班班次</th><th>烂班公里</th><th>百分比</th>{{/if}}
  432 + {{if reason[1].checked==true}}<th>烂班班次</th><th>烂班公里</th><th>百分比</th>{{/if}}
  433 + {{if reason[2].checked==true}}<th>烂班班次</th><th>烂班公里</th><th>百分比</th>{{/if}}
  434 + {{if reason[3].checked==true}}<th>烂班班次</th><th>烂班公里</th><th>百分比</th>{{/if}}
  435 + {{if reason[4].checked==true}}<th>烂班班次</th><th>烂班公里</th><th>百分比</th>{{/if}}
  436 + {{if reason[5].checked==true}}<th>烂班班次</th><th>烂班公里</th><th>百分比</th>{{/if}}
  437 + {{if reason[6].checked==true}}<th>烂班班次</th><th>烂班公里</th><th>百分比</th>{{/if}}
  438 + {{if reason[7].checked==true}}<th>烂班班次</th><th>烂班公里</th><th>百分比</th>{{/if}}
  439 + {{if reason[8].checked==true}}<th>烂班班次</th><th>烂班公里</th><th>百分比</th>{{/if}}
  440 + {{if reason[9].checked==true}}<th>烂班班次</th><th>烂班公里</th><th>百分比</th>{{/if}}
  441 + {{if reason[10].checked==true}}<th>烂班班次</th><th>烂班公里</th><th>百分比</th>{{/if}}
  442 + </tr>
  443 +</thead>
  444 +<tbody>
  445 + {{each list as obj i}}
  446 + <tr>
  447 + {{if obj.line!='合计'}}
  448 + <td>{{obj.date}}</td>
  449 + <td>{{obj.company}}</td>
  450 + <td>{{obj.subCompany}}</td>
  451 + <td>{{obj.line}}</td>
  452 + {{/if}}
  453 + {{if obj.line=='合计'}}
  454 + <td colspan="4">{{obj.line}}</td>
  455 + {{/if}}
  456 + <td>{{obj.jhbc}}</td><td>{{obj.sjbc}}</td><td>{{obj.bcbfb}}</td>
  457 + <td>{{obj.jhlc}}</td><td>{{obj.sjlc}}</td><td>{{obj.lcbfb}}</td>
  458 + {{if reason[0].checked==true}}<td>{{obj.lzbc}}</td><td>{{obj.lzlc}}</td><td>{{obj.lzbfb}}</td>{{/if}}
  459 + {{if reason[1].checked==true}}<td>{{obj.dmbc}}</td><td>{{obj.dmlc}}</td><td>{{obj.dmbfb}}</td>{{/if}}
  460 + {{if reason[2].checked==true}}<td>{{obj.gzbc}}</td><td>{{obj.gzlc}}</td><td>{{obj.gzbfb}}</td>{{/if}}
  461 + {{if reason[3].checked==true}}<td>{{obj.jfbc}}</td><td>{{obj.jflc}}</td><td>{{obj.jfbfb}}</td>{{/if}}
  462 + {{if reason[4].checked==true}}<td>{{obj.zsbc}}</td><td>{{obj.zslc}}</td><td>{{obj.zsbfb}}</td>{{/if}}
  463 + {{if reason[5].checked==true}}<td>{{obj.qrbc}}</td><td>{{obj.qrlc}}</td><td>{{obj.qrbfb}}</td>{{/if}}
  464 + {{if reason[6].checked==true}}<td>{{obj.qcbc}}</td><td>{{obj.qclc}}</td><td>{{obj.qcbfb}}</td>{{/if}}
  465 + {{if reason[7].checked==true}}<td>{{obj.kxbc}}</td><td>{{obj.kxlc}}</td><td>{{obj.kxbfb}}</td>{{/if}}
  466 + {{if reason[8].checked==true}}<td>{{obj.qhbc}}</td><td>{{obj.qhlc}}</td><td>{{obj.qhbfb}}</td>{{/if}}
  467 + {{if reason[9].checked==true}}<td>{{obj.ywbc}}</td><td>{{obj.ywlc}}</td><td>{{obj.ywbfb}}</td>{{/if}}
  468 + {{if reason[10].checked==true}}<td>{{obj.qtbc}}</td><td>{{obj.qtlc}}</td><td>{{obj.qtbfb}}</td>{{/if}}
  469 + </tr>
  470 + {{/each}}
  471 + {{if list.length == 0}}
  472 + <tr>
  473 + <td colspan="44"><h6 class="muted">没有找到相关数据</h6></td>
  474 + </tr>
  475 + {{/if}}
  476 +</tbody>
  477 +</script>
0 478 \ No newline at end of file
... ...
src/main/resources/static/pages/forms/calc/calcjsyspy.html
... ... @@ -89,7 +89,6 @@
89 89 <th>实际空驶里程</th>
90 90 <th>烂班里程</th>
91 91 <th>临加营运里程</th>
92   - <th>临加空驶里程</th>
93 92 </tr>
94 93 </thead>
95 94 <tbody>
... ... @@ -302,7 +301,6 @@
302 301 <td>{{obj.sjfyylc}}</td>
303 302 <td>{{obj.lblc}}</td>
304 303 <td>{{obj.ljyylc}}</td>
305   - <td>{{obj.ljfyylc}}</td>
306 304 </tr>
307 305 {{/each}}
308 306 {{if list.length == 0}}
... ...
src/main/resources/static/pages/forms/calc/calcsingledata.html
... ... @@ -186,10 +186,10 @@
186 186 var temp = tempData[$("#line").val()].split(":");
187 187 $("#gsdmSing").val(temp[0]);
188 188 updateCompany();
189   -// $("#fgsdmSing").val(temp[1]);
190   - $("#fgsdmSing").val("");
  189 + $("#fgsdmSing").val(temp[1]);
  190 +// $("#fgsdmSing").val("");
191 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/calcLbStatuAnaly.xls 0 → 100644
No preview for this file type
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 277 var gsdmShif = $("#gsdmShif").val();
278 278 var fgsdmShif = $("#fgsdmShif").val();
279 279 var params = {};
280   - params.fgsdmShif =fgsdmShif;
  280 + if(line )
  281 + if(line ==" " || line ==""){
  282 + params.fgsdmShif =fgsdmShif;
  283 + }
281 284 params.date =date;
282 285 params.gsdmShif =gsdmShif;
283 286 params.line =line;
... ... @@ -308,12 +311,14 @@ $(function(){
308 311 var fgsdmShif = $("#fgsdmShif").val();
309 312 var lineName = $('#line option:selected').text();
310 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 322 $get('/mcy_export/shifdayExport',params,function(result){
318 323 window.open("/downloadFile/download?fileName="
319 324 +moment(date).format("YYYYMMDD")+
... ...
src/main/resources/static/pages/mforms/turnoutrates/calcTurnoutrateZgf.html
... ... @@ -28,7 +28,7 @@
28 28  
29 29 <div class="page-head">
30 30 <div class="page-title">
31   - <h1>营运线路出车率统计表</h1>
  31 + <h1>营运线路早高峰出车率统计表</h1>
32 32 </div>
33 33 </div>
34 34  
... ... @@ -50,6 +50,15 @@
50 50 <select class="form-control" name="line" id="line" style="width: 140px;"></select>
51 51 </div>
52 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 62 <div style="display: inline-block;margin-left: 15px;">
54 63 <span class="item-label" style="width: 80px;">开始时间: </span>
55 64 <input class="form-control" type="text" id="startDate" style="width: 140px;"/>
... ...
src/main/resources/static/pages/oil/list_ph.html
... ... @@ -149,6 +149,7 @@
149 149 <option value="2">一车多单</option>
150 150 <option value="3">有加油没里程</option>
151 151 <option value="4">有里程没加油</option>
  152 + <option value="5">跨分工用车</option>
152 153 </select>
153 154 </div>
154 155  
... ... @@ -547,6 +548,8 @@ onkeyup=&quot;this.value=this.value.replace(/[^(\d||/.)]/g,&#39;&#39;).replace(&#39;.&#39;,&#39;$#$&#39;).rep
547 548 }else{
548 549 var params2 = {};
549 550 params2['ylbList']=JSON.stringify(ylArray2);
  551 + params2['fgsbm']=$("#ylbListFgsdmId").val();
  552 +
550 553 var i = layer.load(2);
551 554 //保存操作
552 555 $post('/ylb/saveYlbList', params, function () {
... ... @@ -659,11 +662,17 @@ onkeyup=&quot;this.value=this.value.replace(/[^(\d||/.)]/g,&#39;&#39;).replace(&#39;.&#39;,&#39;$#$&#39;).rep
659 662 $('tr.filter .filter-submit').on('click', function () {
660 663 var ylbGsdm=$("#ylbListGsdmId").val();
661 664 var ylbFgsdm=$("#ylbListFgsdmId").val();
  665 + var nbbm=$("#nbbm").val();
662 666 if ($("#rq").val() == "" || $("#rq").val() ==null){
663 667 layer.msg('请选择日期.');
664   - }else if(ylbGsdm=="" || ylbGsdm==null || ylbFgsdm=="" ||ylbFgsdm==null){
665   - layer.msg('请选择公司和分公司.');
666   - }else {
  668 + }else if(ylbGsdm=="" || ylbGsdm==null){
  669 +// || ylbFgsdm==""
  670 + layer.msg('请选择公司');
  671 + }
  672 + /* else if( (ylbFgsdm==""||ylbFgsdm==null) && (nbbm=="" || nbbm==null) ){
  673 + layer.msg('不选择分公司处理输入车辆自编号');
  674 + } */
  675 + else {
667 676 var params = getParamsList();
668 677 page = 0;
669 678 jsDoQuery(params, true);
... ... @@ -697,6 +706,7 @@ onkeyup=&quot;this.value=this.value.replace(/[^(\d||/.)]/g,&#39;&#39;).replace(&#39;.&#39;,&#39;$#$&#39;).rep
697 706 }
698 707 }
699 708 }
  709 + options += '<option value="">全部分公司</option>';
700 710 $('#ylbListFgsdmId').html(options);
701 711 initXl();
702 712 initCl();
... ...
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   -<<<<<<< HEAD
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   - var fgs_name_mapp={
182   - '55_3': '上南公司(六分公司)', '55_1': '上南公司(二分公司)', '55_2': '上南公司(三分公司)', '55_4': '上南公司(一分公司)', '55_5': '上南公司(培训部)',
183   - '22_2': '金高公司(二分公司)', '22_1': '金高公司(四分公司)', '22_3': '金高公司(三分公司)', '22_5': '金高公司(一分公司)',
184   - '26_3': '南汇公司(三分公司)', '26_2': '南汇公司(南汇二分)', '26_1': '南汇公司(南汇一分)', '26_4': '南汇公司(南汇维修公司)', '26_5': '南汇公司(南汇公司)', '26_6': '南汇公司(南汇六分)',
185   - '05_5': '杨高公司(杨高分公司)', '05_6': '杨高公司(周浦分公司)', '05_3': '杨高公司(芦潮港分公司)', '05_1': '杨高公司(川沙分公司)', '05_2': '杨高公司(金桥分公司)',
186   - '77_78': '闵行公司','300_301': '金球公交','302_303': '露虹公交', '99_100': '青浦公交','24_1': '一车队', '24_2': '二车队', '24_3': '三车队'
187   ->>>>>>> 46649faa9a8c89602fbb3f73b0242c178de95777
188   - };
189   -
190   - var defauleConfig;
191   - var patSelect;
192   - $(wrap).on('init', function (e, data) {
193   - e.stopPropagation();
194   - user = data.user;
195   - all_lines = data.lineArray;
196   - companyData = data.companyData;
197   -
198   - all_lines.sort(function (a, b) {
199   - return a.name.localeCompare(b.name);
200   - });
201   - //top title
202   - var htmlStr = template('authorize-user-auth-title-temp', user);
203   - $('.top_title', wrap).html(htmlStr);
204   -
205   - //用户线调权限
206   - defauleConfig = {userId: user.id, pattern: 0, excludeMenus: 'history_sch_maintain'};
207   - $.get('/realControAuthority/findByUserId', {userId: user.id}, function (rs) {
208   - //console.log('rsrs',rs);
209   - xd_auth = rs;
210   - if (!xd_auth)
211   - xd_auth = defauleConfig;
212   - //渲染线路权限
213   - render_auth_lines();
214   - //渲染菜单权限
215   - render_auth_menus();
216   - //渲染线路选择modal
217   - //render_line_select_modal();
218   - patSelect = rs.pattern;
219   - $('#pattern_select', wrap).val(xd_auth.pattern).trigger('change').parent().show();
220   - });
221   - });
222   - $('#pattern_select').change(function () {
223   - if ($('#pattern_select', wrap).val() == 2 && $('#pattern_select', wrap).val() != patSelect) {
224   - // UIkit.modal.confirm("选择作废模式后该用户将失去所有线路和权限", function(){
225   - //
226   - // });
227   - UIkit.modal.alert("选择作废模式后该用户将失去所有线路和权限!");
228   - }
229   -
230   - })
231   -
232   - function render_auth_lines() {
233   - var data = [], codeArray = [];
234   - if (xd_auth && xd_auth.lineCodeStr)
235   - codeArray = xd_auth.lineCodeStr.split(',');
236   -
237   - $.each(all_lines, function () {
238   - if (codeArray.indexOf(this.lineCode) != -1)
239   - data.push(this);
240   - });
241   -
242   - data.sort(function (a, b) {
243   - return a.name.localeCompare(b.name);
244   - });
245   - //按分公司分组
246   - var gd = groupBy(data, 'cgsbm');
247   - data = [];
248   - for (var code in gd) {
249   - data.push({
250   - code: code,
251   - fgsName: fgs_name_mapp[code],
252   - list: gd[code]
253   - });
254   - if (!fgs_name_mapp[code]) {
255   - alert('出现异常的公司归属 :' + code);
256   - }
257   - }
258   -
259   - data.sort(function (a, b) {
260   - return a.fgsName.localeCompare(b.fgsName);
261   - });
262   -
263   - var htmlStr = template('authorize-user-auth-lines-temp', {list: data});
264   - $('.xd_line_list', wrap).html(htmlStr);
265   -
266   - //滚动条
267   - $('.xd_line_list', wrap).perfectScrollbar({suppressScrollX: true});
268   - }
269   -
270   - function render_auth_menus() {
271   - debugger
272   - var excludeArray = [], event;
273   - if (xd_auth && xd_auth.excludeMenus)
274   - excludeArray = xd_auth.excludeMenus.split(',');
275   -
276   - $('.xd_menu_grid li>label>input').each(function () {
277   - event = $(this).data('event');
278   - if (excludeArray.indexOf(event) == -1)
279   - this.checked = true;
280   - });
281   - $('.xd_menu_grid').show();
282   - $('.xd_menu_grid .uk-list', wrap).perfectScrollbar('update');
283   - }
284   -
285   - $('.xd_menu_grid .uk-list', wrap).perfectScrollbar({suppressScrollX: true});
286   -
287   - /**
288   - * 线路选择modal
289   - */
290   - var compSelectData, modal = '#select_line_modal', modalRender;
291   - $(modal).on('show', function () {
292   - if (!modalRender) {
293   - render_line_select_modal();
294   - modalRender = true;
295   - }
296   - $('#modal_line_input', modal).focus();
297   - });
298   -
299   - function render_line_select_modal() {
300   - var htmlStr = template('authorize-modal-lines-temp', {
301   - list: all_lines,
302   - destroy: $('.modal_type_select', modal).val()
303   - });
304   - $('.line_checkbox_list').html(htmlStr);
305   - //选中线路
306   - var codeArray = [];
307   - if (xd_auth && xd_auth.lineCodeStr)
308   - codeArray = xd_auth.lineCodeStr.split(',');
309   -
310   - $('.line_checkbox_list>label.btn').each(function () {
311   - if (codeArray.indexOf($(this).data('code') + '') != -1) {
312   - $(this).addClass('active').find('>input')[0].checked = true;
313   - }
314   - });
315   -
316   - //构建公司级联下拉框
317   - compSelectData = convert_buss_data(companyData);
318   - var companyStr = '<option value="">请选择...</option>';
319   - for (var code in compSelectData) {
320   - companyStr += '<option value="' + code + '">' + compSelectData[code].name + '</option>';
321   - }
322   - $('#modal_company_select', modal).html(companyStr).on('change', function () {
323   - var code = $(this).val(), subSelect = $('#modal_sub_company_select', modal);
324   - if (!code)
325   - subSelect.empty().attr('disabled', 'disabled');
326   - else {
327   - var subCompStr = '<option value="">请选择...</option>';
328   - $.each(compSelectData[code].childs, function () {
329   - subCompStr += '<option value="' + this.businessCode + '">' + this.businessName + '</option>';
330   - });
331   - subSelect.html(subCompStr).removeAttr('disabled');
332   - }
333   - //过滤线路
334   - filter_modal_lines();
335   - });
336   - $('#modal_sub_company_select', modal).on('change', filter_modal_lines);
337   - $('#modal_type_select', modal).on('change', filter_modal_lines);
338   - }
339   -
340   - $('#modal_line_input', modal).on('input', function () {
341   - var t = $(this).val() + '';
342   - if (!t) {
343   - filter_modal_lines();
344   - return;
345   - }
346   - var codes = [];
347   - $.each(all_lines, function () {
348   - if (this.name.indexOf(t) != -1)
349   - codes.push(this.lineCode);
350   - });
351   -
352   - var array = $('.line_checkbox_list>label.btn').css('display', 'none');
353   - array.each(function () {
354   - if (codes.indexOf($(this).data('code') + '') != -1)
355   - $(this).css('display', 'inline-block');
356   - });
357   - });
358   -
359   - function filter_modal_lines() {
360   - console.log('filter_modal_lines');
361   - var company = $('#modal_company_select', modal).val(),//公司代码
362   - sub_company = $('#modal_sub_company_select', modal).val(),//分公司代码
363   - type = $('#modal_type_select', modal).val();//线路状态
364   -
365   - var array = $('.line_checkbox_list>label.btn').css('display', 'none'), s_dom = [];
366   -
367   - if (!company && !sub_company && type == -1) {
368   - array.css('display', 'inline-block');
369   - return;
370   - }
371   -
372   - var status;
373   - array.each(function () {
374   - if (company && $(this).data('gs') != company)
375   - return true;
376   - if (sub_company && $(this).data('fgs') != sub_company)
377   - return true;
378   -
379   - status = $(this).hasClass('destroy') ? 1 : 0;
380   - if (type != -1 && type != status)
381   - return true;
382   -
383   - s_dom.push(this);
384   - });
385   - for (var i = 0, dom; dom = s_dom[i++];)
386   - $(dom).css('display', 'inline-block');
387   - }
388   -
389   - $('.line_checkbox_list').on('click', 'label.btn', function () {
390   - if ($('input', this)[0].checked)
391   - $(this).addClass('active');
392   - else
393   - $(this).removeClass('active');
394   - });
395   -
396   - //全选
397   - $('#globalCheckbox', modal).on('click', function () {
398   - var state = this.checked;
399   - $('.line_checkbox_list>label.btn:visible>input').each(function () {
400   - this.checked = state;
401   - });
402   -
403   - $('.line_checkbox_list>label.btn:visible').each(function () {
404   - if (state)
405   - $(this).addClass('active');
406   - else
407   - $(this).removeClass('active');
408   - });
409   - });
410   -
411   - //确定
412   - $('#confirmBtn', modal).on('click', function () {
413   - var lines = '';
414   - $('.line_checkbox_list>label.btn.active').each(function () {
415   - lines += ($(this).data('code') + ',');
416   - });
417   - xd_auth.lineCodeStr = lines;
418   - render_auth_lines();
419   - UIkit.modal(modal).hide();
420   - });
421   -
422   -
423   - //保存
424   - $('#global_save_btn', wrap).on('click', function () {
425   - $(this).attr('disabled', 'disabled');
426   - //调度模式
427   - xd_auth.pattern = $('#pattern_select', wrap).val();
428   - //要排除的线调菜单
429   - var excludeMenus = '';
430   - $('.xd_menu_grid ul input[type=checkbox]').each(function () {
431   - if (!this.checked)
432   - excludeMenus += $(this).data('event') + ',';
433   - });
434   - xd_auth.excludeMenus = excludeMenus;
435   - if (xd_auth.pattern == 2) {
436   - //UIkit.modal.confirm("选择作废模式后该用户将失去所有线路和权限", function () {
437   - xd_auth.lineCodeStr = '';
438   - var excludeMenusAll = '';
439   - $('.xd_menu_grid ul input[type=checkbox]').each(function () {
440   - excludeMenusAll += $(this).data('event') + ',';
441   - });
442   - xd_auth.excludeMenus = excludeMenusAll;
443   - //});
444   -
445   - }
446   - $.post('/realControAuthority', xd_auth, function (rs) {
447   - UIkit.notification('保存成功!', 'primary');
448   - $('.authorize_right_cont').trigger('refresh-user');
449   - });
450   - });
451   - })();
452   - </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>
453 446 </div>
454 447 \ No newline at end of file
... ...
src/main/resources/static/pages/permission/user/authorize.html
1   -<!DOCTYPE html>
2   -<html lang="zh-cn">
3   -
4   -<head>
5   - <meta charset="UTF-8">
6   - <link rel="stylesheet" href="/assets/plugins/uk3.0/uikit.min.css"/>
7   - <link rel="stylesheet" href="/real_control_v2/assets/plugins/perfect-scrollbar/perfect-scrollbar.css" />
8   - <link rel="stylesheet" href="/assets/plugins/ztree_v3/css/zTreeStyle/zTreeStyle.css" />
9   - <style>
10   - html,body{
11   - height: 100%;
12   - }
13   - .ct_page{
14   - padding: 25px 15px;
15   - height: 100%;
16   - height: calc(100% - 50px);
17   - }
18   -
19   - .ct_cont{
20   - height: calc(100% - 41px);
21   - }
22   -
23   - .ct_cont>div>div.uk-card{
24   - height: 99%;
25   - }
26   -
27   - form .uk-inline{
28   - width: calc(100% - 4px);
29   - margin-left: 2px;
30   - }
31   -
32   - .ct-card-body{
33   - overflow: auto;
34   - padding: 1px 1px 0 2px;
35   - height: calc(100% - 54px);
36   - position: relative;
37   - margin-top: -12px;
38   - }
39   -
40   - .ct_li_desc{
41   - color: #a8a8a8;
42   - font-size: 13px;
43   - }
44   -
45   - .ct-card-body .uk-list-large{
46   - font-size: 14px;
47   - }
48   -
49   - .ct-card-body .uk-list-large>li{
50   - cursor: default;
51   - padding-left: 20px;
52   - margin-top: 2px !important;
53   - padding-top: 17px !important;
54   - position: relative;
55   - }
56   -
57   - .ct-card-body .uk-list-large>li:hover{
58   - background: #edecec;
59   - }
60   -
61   - .ct-card-body .uk-list-large>li.active{
62   - background: #1e87f0 !important;
63   - color: white;
64   - }
65   -
66   - .ct-card-body .uk-list-large>li.active>span.role-code{
67   - color: #ffffff;
68   - }
69   -
70   - .ct-card-body .uk-list-large.role-list>li:hover{
71   - background: #fff494;
72   - }
73   -
74   - .ct-card-body .uk-list-large>li.active .ct_li_desc{
75   - color: #e6e6e6;
76   - }
77   -
78   - .ct-card-body .uk-list-large>li>span.uk-badge{
79   - position: absolute;
80   - top: 17px;
81   - right: 25px;
82   - }
83   -
84   - .ct-card-body .uk-list-large>li>span.role-code{
85   - padding: 4px 6px;
86   - color: #a8a8a8;
87   - margin-left: 5px;
88   - }
89   -
90   - .top_title{
91   - padding: 9px 0 5px 15px;
92   - border-bottom: 1px solid #ededed;
93   - border-left: 5px solid #FFC107;
94   - }
95   -
96   - .top_title>.desc{
97   - font-size: 13px;
98   - color: grey;
99   - margin-top: 3px;
100   - }
101   -
102   - .left_menu_list{
103   - overflow: auto;
104   - position: relative;
105   - }
106   -
107   - .left_menu_list .ps-container > .ps-scrollbar-x-rail, .ps-container > .ps-scrollbar-y-rail{
108   - opacity: 0.6 !important;
109   - padding: 0 !important;
110   - }
111   -
112   - ._company{
113   - margin: 15px 0px;
114   - }
115   - ._company>h5{
116   - margin-bottom: 10px;
117   - font-size: 15px;
118   - color: #6b6b6b;
119   - text-indent: 12px;
120   - }
121   - ._company>._fgs>label{
122   - padding: 3px 12px 3px 10px;
123   - display: inline-block;
124   - border: 1px solid gainsboro;
125   - border-radius: 2px;
126   - margin: 5px;
127   - font-size: 14px;
128   - }
129   - ._company>._fgs>label.active{
130   - background: #1e87f0;
131   - color: #fff;
132   - }
133   - ._company .uk-checkbox:checked:focus,
134   - .line_checkbox_list .uk-checkbox:checked:focus{
135   - background-color: #1e87f0 !important;
136   - }
137   - .save_icon{
138   - position: absolute;
139   - right: 2px;
140   - background: #bec4c9;
141   - font-size: 12px;
142   - padding: 2px 15px;
143   - color: #fff;
144   - box-shadow: 0 5px 15px rgba(0,0,0,0.08);
145   - cursor: pointer;
146   - }
147   - .save_icon:hover{
148   - background: #FFC107;
149   - }
150   - .data_auth_list{
151   - position: relative;
152   - }
153   - #user_authorize_wrap .top_title{
154   - border-left: 5px solid #cacac8;
155   - }
156   - .xd_line_list{
157   - height: 37%;
158   - padding: 7px;
159   - border-bottom: 1px solid #f2f2f2;
160   - overflow: auto;
161   - position: relative;
162   - }
163   - .xd_line_list>h5{
164   - color: #858585;
165   - margin: 5px 5px 5px 0;
166   - font-size: 14px;
167   - }
168   - .sub_lines{
169   - padding-left: 15px;
170   - }
171   - .sub_lines>span.line_btn {
172   - background: #00BCD4;
173   - color: #fff;
174   - padding: 4px 9px;
175   - display: inline-block;
176   - min-width: 68px;
177   - text-align: center;
178   - margin: 5px 2px;
179   - box-shadow: 0 5px 9px rgba(0,0,0,0.08);
180   - cursor: pointer;
181   - font-size: 14px;
182   - font-family: 微软雅黑;
183   - }
184   -
185   - .sub_lines>span.line_btn.destroy{
186   - background: #ff5c5c;
187   - }
188   -
189   - .sub_lines>span.line_btn.destroy:hover{
190   - background: #ff7373;
191   - }
192   -
193   - .sub_lines>span.line_btn:hover{
194   - background: #2dd7ed;
195   - }
196   - .add_line_icon{
197   - cursor: pointer;
198   - padding: 2px 5px;
199   - border-radius: 5px;
200   - display: inline-block;
201   - }
202   - .add_line_icon>i{
203   - vertical-align: top;
204   - margin-top: 3px;
205   - }
206   - .add_line_icon:hover{
207   - background: #ededed;
208   - }
209   - .ct_pattern_form{
210   - display: inline-block;
211   - }
212   - .xd_menu_grid{
213   - padding: 25px 25px 0 25px;
214   - height: calc(63% - 91px);
215   - }
216   - .xd_menu_grid .uk-list{
217   - border: 1px solid #ededed;
218   - height: calc(100% - 70px);
219   - overflow: auto;
220   - position: relative;
221   - }
222   -
223   - .xd_menu_grid .uk-list>li{
224   - margin: 5px 0 !important;
225   - padding: 10px 0 0 10px !important;
226   - font-size: 14px;
227   - }
228   - .top_tools{
229   - position: absolute;
230   - top: 15px;
231   - right: 25px;
232   - }
233   - .ct_field {
234   - display: inline-block;
235   - width: 240px;
236   - }
237   - .ct_field>select,.ct_field>input{
238   - width: calc(100% - 60px);
239   - }
240   - .line_checkbox_list{
241   - margin-top: 15px;
242   - }
243   - .line_checkbox_list>.btn{
244   - padding: 5px 7px;
245   - border-radius: 2px;
246   - display: inline-block;
247   - margin: 4px 9px;
248   - font-size: 14px;
249   - font-family: 微软雅黑;
250   - border: 1px solid #d9d9d9;
251   - width: 100px;
252   - overflow: hidden;
253   - text-overflow: ellipsis;
254   - white-space: nowrap;
255   - }
256   - .line_checkbox_list>.btn>input{
257   - margin-right: 5px;
258   - }
259   - .line_checkbox_list>.btn.active{
260   - background: #1e87f0;
261   - color: #fff;
262   - }
263   -
264   - .line_checkbox_list>.btn.destroy,
265   - .line_checkbox_list>.btn.destroy>input{
266   - border-color: #ff9595;
267   - color: #ff5c5c;
268   - }
269   -
270   - .line_checkbox_list>.btn.destroy.active{
271   - background: #ff5c5c;
272   - color: #fff;
273   - }
274   -
275   - .line_checkbox_list>.btn.destroy.active>input{
276   - background-color: #ff5c5c !important;
277   - border-color: #ff5c5c !important;
278   - }
279   -
280   - #role_authorize_wrap .ztree *{
281   - font-size: 14px;
282   - }
283   - #role_authorize_wrap .ztree li{
284   - line-height: 21px;
285   - }
286   - .loading{
287   - height: 100%;
288   - text-align: center;
289   - }
290   - .loading .uk-spinner{
291   - margin-top: 200px;
292   - }
293   - .loading circle{
294   - stroke: red;
295   - }
296   -
297   - #select_line_modal .uk-checkbox:checked {
298   - background-color: #1e87f0;
299   - }
300   - </style>
301   -</head>
302   -
303   -<body>
304   -<div class="loading">
305   - <div uk-spinner></div>
306   -</div>
307   -<div class="ct_page" style="display: none;">
308   - <h2 class="uk-heading-line uk-heading-bullet"><span>用户授权管理</span></h2>
309   - <div class="ct_cont uk-grid-small uk-child-width-expand" uk-grid>
310   - <div class="role_list uk-width-1-4 ">
311   - <div class="uk-card uk-card-default">
312   - <form>
313   - <div class="uk-margin">
314   - <div class="uk-inline" >
315   - <!--<span class="uk-form-icon uk-form-icon-flip" uk-icon="icon: search"></span>-->
316   - <!--<input class="uk-input role_search_input" type="text" placeholder="搜索角色">-->
317   - </div>
318   - </div>
319   - </form>
320   -
321   - <div class="ct-card-body" >
322   - <ul class="uk-list uk-list-large uk-list-divider role-list">
323   - </ul>
324   - </div>
325   - </div>
326   - </div>
327   - <div class="user_list uk-width-1-5 ">
328   - <div class="uk-card uk-card-default">
329   - <form>
330   - <div class="uk-margin">
331   - <div class="uk-inline" >
332   - <!--<span class="uk-form-icon uk-form-icon-flip" uk-icon="icon: search"></span>-->
333   - <!--<input class="uk-input user_search_input" type="text" placeholder="搜索用户">-->
334   - </div>
335   - </div>
336   - </form>
337   -
338   - <div class="ct-card-body">
339   - <ul class="uk-list uk-list-large user-list">
340   - </ul>
341   - </div>
342   - </div>
343   - </div>
344   - <div class="auth_cont ">
345   - <div class="uk-card uk-card-default authorize_right_cont">
346   -
347   - </div>
348   - </div>
349   - </div>
350   -</div>
351   -
352   -<script id="authorize-role-list-temp" type="text/html">
353   - {{each list as r i}}
354   - <li data-id="{{r.id}}" data-name="{{r.roleName}}" data-code="{{r.codeUp}}">{{r.roleName}}
355   - <span class="role-code">{{r.codeName}}</span>
356   - <div class="ct_li_desc">{{r.createDateStr}}</div>
357   - <span class="uk-badge">{{r.count}}</span>
358   - </li>
359   - {{/each}}
360   -</script>
361   -<script id="authorize-user-list-temp" type="text/html">
362   - {{each list as u i}}
363   - <li class="uk-animation-fade uk-animation-fast" data-name="{{u.name}}" data-code="{{u.userNameUp}}" data-id="{{u.id}}">{{u.name}}<span class="role-code">{{u.userName}}</span></li>
364   - {{/each}}
365   -</script>
366   -<script src="/metronic_v4.5.4/plugins/jquery.min.js"></script>
367   -<script src="/assets/js/common.js"></script>
368   -<script src="/assets/plugins/uk3.0/uikit.min.js"></script>
369   -<script src="/assets/plugins/uk3.0/uikit-icons.min.js"></script>
370   -<script src="/real_control_v2/assets/plugins/perfect-scrollbar/perfect-scrollbar.jquery.js" ></script>
371   -<!-- EventProxy -->
372   -<script src="/assets/js/eventproxy.js"></script>
373   -<!-- art-template 模版引擎 -->
374   -<script src="/assets/plugins/template.js"></script>
375   -<script src="/real_control_v2/assets/plugins/moment/moment.min.js"></script>
376   -<script src="/assets/plugins/ztree_v3/js/jquery.ztree.core.min.js"></script>
377   -<script src="/assets/plugins/ztree_v3/js/jquery.ztree.excheck.min.js"></script>
378   -<script>
379   - var storage = window.localStorage;
380   -
381   - if (typeof String.prototype.startsWith != 'function') {
382   - String.prototype.startsWith = function (prefix){
383   - return this.slice(0, prefix.length) === prefix;
384   - };
385   - }
386   - var roles,users,role_users,modules,companyData,lineArray;
387   -
388   - var ep = EventProxy.create('query_roles', 'query_users', 'query_modules', 'query_company', 'query_line', function (rs, us, ms, cs, lines) {
389   - roles = rs;
390   - users = us;
391   - modules = ms;
392   - companyData = cs;
393   - lineArray=lines;
394   - role_users = {};
395   - debugger
396   - for(var i=0,r;r=roles[i++];){
397   - r.count=0;
398   - role_users[r.id]=[];
399   - r.createDateStr=moment(r.createDate).format('YYYY-MM-DD HH:ss');
400   - r.codeUp=r.codeName.toUpperCase();
401   - for(var j=0,u;u=users[j++];){
402   - if(u.roles.indexOf(r.id)!=-1){
403   - r.count++;
404   - role_users[r.id].push(u);
405   - }
406   - }
407   - }
408   - //渲染角色list
409   - render_role_list(roles);
410   - //渲染用户list
411   - render_user_list(users);
412   -
413   - $('.loading').remove();
414   - $('.ct_page').show();
415   - });
416   -
417   - //角色点击
418   - $('ul.role-list').on('click', 'li', roleClickHanlder);
419   - //用户点击
420   - $('ul.user-list').on('click', 'li', userClickHanlder);
421   -
422   -
423   - function roleClickHanlder() {
424   - if($(this).hasClass('active') && $('ul.user-list>li.active').length==0)
425   - return;
426   -
427   - reset_dom();
428   - $('ul.role-list>li.active').removeClass('active');
429   - $(this).addClass('active');
430   - //重新渲染用户list
431   - var id = $(this).data('id');
432   - render_user_list(role_users[id]);
433   - //加载角色授权页面
434   - $('.authorize_right_cont').load('/pages/permission/authorize_all/role_auth.html', function () {
435   - $('#role_authorize_wrap', this).trigger('init', {role: get_role(id), modules: modules, companyData: companyData});
436   - });
437   - }
438   -
439   - function userClickHanlder() {
440   - if($(this).hasClass('active'))
441   - return;
442   -
443   - reset_dom();
444   - $('ul.user-list>li.active').removeClass('active');
445   - $(this).addClass('active');
446   -
447   - //加载用户授权页面
448   - var id = $(this).data('id');
449   - $('.authorize_right_cont').load('/pages/permission/authorize_all/user_auth.html', function () {
450   - $('#user_authorize_wrap', this).trigger('init', {user: get_user(id),lineArray:lineArray, companyData:companyData});
451   - });
452   - }
453   -
454   - //refresh-user
455   - $('.authorize_right_cont').on('refresh-user', function () {
456   - $('ul.user-list>li.active').removeClass('active').trigger('click');
457   - });
458   -
459   - function reset_dom() {
460   - $('#select_line_modal').remove();
461   - }
462   -
463   - //滚动条
464   - $('.ct_page .uk-card .ct-card-body').perfectScrollbar({suppressScrollX: true});
465   -
466   - //query all role
467   - var paramsRole = {};
468   - paramsRole['codeName'] = 'ROLE_ADMIN';
469   - var storage = window.localStorage;
470   - var userId=storage.getItem("editUser");
471   - $get('/user',{id_eq:userId}, function (rs) {
472   - debugger
473   - //if (rs)
474   - ep.emit('query_roles', rs.content[0].roles);
475   - });
476   -
477   -
478   - //query all user
479   - var paramsUser = {};
480   - paramsRole['name'] = 'name';
481   - $.get('/user/all_distinct',paramsUser, function (rs) {
482   - var userA={};
483   - for(var i=0,u;u=rs[i++];){
484   - if (u.id==userId){
485   - discard_field(u);
486   - u.userNameUp=u.userName.toUpperCase();
487   - u.lastLoginDateStr=moment(u.lastLoginDate).format('YYYY-MM-DD HH:ss');
488   - userA[0]=u;
489   - }
490   - }
491   - ep.emit('query_users', userA);
492   - });
493   -
494   - //query all modules
495   - $.get('/module/all_distinct', function (rs) {
496   - ep.emit('query_modules', rs);
497   - });
498   -
499   - //query all company data
500   - $.get('/business/all', function (rs) {
501   - ep.emit('query_company', rs);
502   - });
503   -
504   - //query all line
505   - $.get('/line/all', {'remove_ne': 1}, function (rs) {
506   - ep.emit('query_line', rs);
507   - });
508   -
509   - function discard_field(u) {
510   - var array = [];
511   - $.each(u.roles, function () {
512   - array.push(this.id);
513   - });
514   - u.roles = array;
515   - }
516   -
517   - function render_role_list(list) {
518   - var htmlStr = template('authorize-role-list-temp', {list: list});
519   - $('ul.role-list').html(htmlStr);
520   - up_scroll();
521   - }
522   -
523   -
524   - function render_user_list(list) {
525   - var htmlStr = template('authorize-user-list-temp', {list: list});
526   - $('ul.user-list').html(htmlStr);
527   - up_scroll();
528   - }
529   -
530   - function reset_role_list(){
531   - var actives = $('ul.role-list>li.active');
532   - if(actives.length > 0){
533   - $('ul.role-list>li.active').removeClass('active');
534   - render_user_list(users);
535   - $('.authorize_right_cont').empty();
536   - }
537   - }
538   -
539   - function up_scroll() {
540   - $('.ct_page .uk-card .ct-card-body').perfectScrollbar('update');
541   - }
542   -
543   -
544   -
545   - function get_role(id) {
546   - for(var i=0,r;r=roles[i++];){
547   - if(r.id==id)
548   - return r;
549   - }
550   - return null;
551   - }
552   -
553   - function get_user(id) {
554   - for(var i=0,u;u=users[i++];){
555   - if(u.id==id)
556   - return u;
557   - }
558   - return null;
559   - }
560   -
561   - $(document).on('submit', 'form', function () {
562   - return false;
563   - });
564   -
565   - function convert_buss_data(rs) {
566   - var baseCode;
567   - //找到跟节点
568   - $.each(rs, function () {
569   - if(this.upCode == 0){
570   - baseCode=this.businessCode;
571   - return false;
572   - }
573   - });
574   - if(!baseCode){
575   - alert('大爷找不到根节点,数据有问题吧!!!');
576   - return;
577   - }
578   - //提取二级节点
579   - var secondMap={};
580   - $.each(rs, function () {
581   - if(this.upCode==baseCode){
582   - secondMap[this.businessCode] = {
583   - name: this.businessName,
584   - childs: []
585   - };
586   - }
587   - });
588   - //分公司节点
589   - $.each(rs, function () {
590   - if(secondMap[this.upCode])
591   - secondMap[this.upCode].childs.push(this);
592   - });
593   -
594   - //排序
595   - for(var sid in secondMap){
596   - secondMap[sid].childs.sort(naturalSort);
597   - }
598   -
599   - return secondMap;
600   - }
601   -
602   - var naturalSort=function (a, b) {
603   - return a.businessName.localeCompare(b.businessName);
604   - };
605   -
606   - var groupBy = function (list, field) {
607   - var rs = {},
608   - key;
609   - $.each(list, function () {
610   - key = this[field];
611   - if (!rs[key])
612   - rs[key] = [];
613   -
614   - rs[key].push(this);
615   - });
616   -
617   - return rs;
618   - };
619   -</script>
620   -</body>
  1 +<!--<!DOCTYPE html>-->
  2 +<html lang="zh-cn">
  3 +
  4 +<head>
  5 + <meta charset="UTF-8">
  6 + <script src="/metronic_v4.5.4/plugins/jquery.min.js"></script>
  7 + <script src="/assets/js/common.js"></script>
  8 + <script src="/assets/plugins/uk3.0/uikit.min.js"></script>
  9 + <script src="/assets/plugins/uk3.0/uikit-icons.min.js"></script>
  10 + <script src="/real_control_v2/assets/plugins/perfect-scrollbar/perfect-scrollbar.jquery.js"></script>
  11 + <!-- EventProxy -->
  12 + <script src="/assets/js/eventproxy.js"></script>
  13 + <!-- art-template 模版引擎 -->
  14 + <script src="/assets/plugins/template.js"></script>
  15 + <script src="/real_control_v2/assets/plugins/moment/moment.min.js"></script>
  16 + <script src="/assets/plugins/ztree_v3/js/jquery.ztree.core.min.js"></script>
  17 + <script src="/assets/plugins/ztree_v3/js/jquery.ztree.excheck.min.js"></script>
  18 + <link rel="stylesheet" href="/assets/plugins/uk3.0/uikit.min.css"/>
  19 + <link rel="stylesheet" href="/real_control_v2/assets/plugins/perfect-scrollbar/perfect-scrollbar.css" />
  20 + <link rel="stylesheet" href="/assets/plugins/ztree_v3/css/zTreeStyle/zTreeStyle.css" />
  21 + <style>
  22 + html,body{
  23 + height: 100%;
  24 + }
  25 + .ct_page{
  26 + padding: 25px 15px;
  27 + height: 100%;
  28 + height: calc(100% - 50px);
  29 + }
  30 +
  31 + .ct_cont{
  32 + height: calc(100% - 41px);
  33 + }
  34 +
  35 + .ct_cont>div>div.uk-card{
  36 + height: 99%;
  37 + }
  38 +
  39 + form .uk-inline{
  40 + width: calc(100% - 4px);
  41 + margin-left: 2px;
  42 + }
  43 +
  44 + .ct-card-body{
  45 + overflow: auto;
  46 + padding: 1px 1px 0 2px;
  47 + height: calc(100% - 54px);
  48 + position: relative;
  49 + margin-top: -12px;
  50 + }
  51 +
  52 + .ct_li_desc{
  53 + color: #a8a8a8;
  54 + font-size: 13px;
  55 + }
  56 +
  57 + .ct-card-body .uk-list-large{
  58 + font-size: 14px;
  59 + }
  60 +
  61 + .ct-card-body .uk-list-large>li{
  62 + cursor: default;
  63 + padding-left: 20px;
  64 + margin-top: 2px !important;
  65 + padding-top: 17px !important;
  66 + position: relative;
  67 + }
  68 +
  69 + .ct-card-body .uk-list-large>li:hover{
  70 + background: #edecec;
  71 + }
  72 +
  73 + .ct-card-body .uk-list-large>li.active{
  74 + background: #1e87f0 !important;
  75 + color: white;
  76 + }
  77 +
  78 + .ct-card-body .uk-list-large>li.active>span.role-code{
  79 + color: #ffffff;
  80 + }
  81 +
  82 + .ct-card-body .uk-list-large.role-list>li:hover{
  83 + background: #fff494;
  84 + }
  85 +
  86 + .ct-card-body .uk-list-large>li.active .ct_li_desc{
  87 + color: #e6e6e6;
  88 + }
  89 +
  90 + .ct-card-body .uk-list-large>li>span.uk-badge{
  91 + position: absolute;
  92 + top: 17px;
  93 + right: 25px;
  94 + }
  95 +
  96 + .ct-card-body .uk-list-large>li>span.role-code{
  97 + padding: 4px 6px;
  98 + color: #a8a8a8;
  99 + margin-left: 5px;
  100 + }
  101 +
  102 + .top_title{
  103 + padding: 9px 0 5px 15px;
  104 + border-bottom: 1px solid #ededed;
  105 + border-left: 5px solid #FFC107;
  106 + }
  107 +
  108 + .top_title>.desc{
  109 + font-size: 13px;
  110 + color: grey;
  111 + margin-top: 3px;
  112 + }
  113 +
  114 + .left_menu_list{
  115 + overflow: auto;
  116 + position: relative;
  117 + }
  118 +
  119 + .left_menu_list .ps-container > .ps-scrollbar-x-rail, .ps-container > .ps-scrollbar-y-rail{
  120 + opacity: 0.6 !important;
  121 + padding: 0 !important;
  122 + }
  123 +
  124 + ._company{
  125 + margin: 15px 0px;
  126 + }
  127 + ._company>h5{
  128 + margin-bottom: 10px;
  129 + font-size: 15px;
  130 + color: #6b6b6b;
  131 + text-indent: 12px;
  132 + }
  133 + ._company>._fgs>label{
  134 + padding: 3px 12px 3px 10px;
  135 + display: inline-block;
  136 + border: 1px solid gainsboro;
  137 + border-radius: 2px;
  138 + margin: 5px;
  139 + font-size: 14px;
  140 + }
  141 + ._company>._fgs>label.active{
  142 + background: #1e87f0;
  143 + color: #fff;
  144 + }
  145 + ._company .uk-checkbox:checked:focus,
  146 + .line_checkbox_list .uk-checkbox:checked:focus{
  147 + background-color: #1e87f0 !important;
  148 + }
  149 + .save_icon{
  150 + position: absolute;
  151 + right: 2px;
  152 + background: #bec4c9;
  153 + font-size: 12px;
  154 + padding: 2px 15px;
  155 + color: #fff;
  156 + box-shadow: 0 5px 15px rgba(0,0,0,0.08);
  157 + cursor: pointer;
  158 + }
  159 + .save_icon:hover{
  160 + background: #FFC107;
  161 + }
  162 + .data_auth_list{
  163 + position: relative;
  164 + }
  165 + #user_authorize_wrap .top_title{
  166 + border-left: 5px solid #cacac8;
  167 + }
  168 + .xd_line_list{
  169 + height: 37%;
  170 + padding: 7px;
  171 + border-bottom: 1px solid #f2f2f2;
  172 + overflow: auto;
  173 + position: relative;
  174 + }
  175 + .xd_line_list>h5{
  176 + color: #858585;
  177 + margin: 5px 5px 5px 0;
  178 + font-size: 14px;
  179 + }
  180 + .sub_lines{
  181 + padding-left: 15px;
  182 + }
  183 + .sub_lines>span.line_btn {
  184 + background: #00BCD4;
  185 + color: #fff;
  186 + padding: 4px 9px;
  187 + display: inline-block;
  188 + min-width: 68px;
  189 + text-align: center;
  190 + margin: 5px 2px;
  191 + box-shadow: 0 5px 9px rgba(0,0,0,0.08);
  192 + cursor: pointer;
  193 + font-size: 14px;
  194 + font-family: 微软雅黑;
  195 + }
  196 +
  197 + .sub_lines>span.line_btn.destroy{
  198 + background: #ff5c5c;
  199 + }
  200 +
  201 + .sub_lines>span.line_btn.destroy:hover{
  202 + background: #ff7373;
  203 + }
  204 +
  205 + .sub_lines>span.line_btn:hover{
  206 + background: #2dd7ed;
  207 + }
  208 + .add_line_icon{
  209 + cursor: pointer;
  210 + padding: 2px 5px;
  211 + border-radius: 5px;
  212 + display: inline-block;
  213 + }
  214 + .add_line_icon>i{
  215 + vertical-align: top;
  216 + margin-top: 3px;
  217 + }
  218 + .add_line_icon:hover{
  219 + background: #ededed;
  220 + }
  221 + .ct_pattern_form{
  222 + display: inline-block;
  223 + }
  224 + .xd_menu_grid{
  225 + padding: 25px 25px 0 25px;
  226 + height: calc(63% - 91px);
  227 + }
  228 + .xd_menu_grid .uk-list{
  229 + border: 1px solid #ededed;
  230 + height: calc(100% - 70px);
  231 + overflow: auto;
  232 + position: relative;
  233 + }
  234 +
  235 + .xd_menu_grid .uk-list>li{
  236 + margin: 5px 0 !important;
  237 + padding: 10px 0 0 10px !important;
  238 + font-size: 14px;
  239 + }
  240 + .top_tools{
  241 + position: absolute;
  242 + top: 15px;
  243 + right: 25px;
  244 + }
  245 + .ct_field {
  246 + display: inline-block;
  247 + width: 240px;
  248 + }
  249 + .ct_field>select,.ct_field>input{
  250 + width: calc(100% - 60px);
  251 + }
  252 + .line_checkbox_list{
  253 + margin-top: 15px;
  254 + }
  255 + .line_checkbox_list>.btn{
  256 + padding: 5px 7px;
  257 + border-radius: 2px;
  258 + display: inline-block;
  259 + margin: 4px 9px;
  260 + font-size: 14px;
  261 + font-family: 微软雅黑;
  262 + border: 1px solid #d9d9d9;
  263 + width: 100px;
  264 + overflow: hidden;
  265 + text-overflow: ellipsis;
  266 + white-space: nowrap;
  267 + }
  268 + .line_checkbox_list>.btn>input{
  269 + margin-right: 5px;
  270 + }
  271 + .line_checkbox_list>.btn.active{
  272 + background: #1e87f0;
  273 + color: #fff;
  274 + }
  275 +
  276 + .line_checkbox_list>.btn.destroy,
  277 + .line_checkbox_list>.btn.destroy>input{
  278 + border-color: #ff9595;
  279 + color: #ff5c5c;
  280 + }
  281 +
  282 + .line_checkbox_list>.btn.destroy.active{
  283 + background: #ff5c5c;
  284 + color: #fff;
  285 + }
  286 +
  287 + .line_checkbox_list>.btn.destroy.active>input{
  288 + background-color: #ff5c5c !important;
  289 + border-color: #ff5c5c !important;
  290 + }
  291 +
  292 + #role_authorize_wrap .ztree *{
  293 + font-size: 14px;
  294 + }
  295 + #role_authorize_wrap .ztree li{
  296 + line-height: 21px;
  297 + }
  298 + .loading{
  299 + height: 100%;
  300 + text-align: center;
  301 + }
  302 + .loading .uk-spinner{
  303 + margin-top: 200px;
  304 + }
  305 + .loading circle{
  306 + stroke: red;
  307 + }
  308 +
  309 + #select_line_modal .uk-checkbox:checked {
  310 + background-color: #1e87f0;
  311 + }
  312 + </style>
  313 +
  314 +</head>
  315 +
  316 +<body>
  317 +<div class="loading">
  318 + <div uk-spinner></div>
  319 +</div>
  320 +<div class="ct_page" style="display: none;">
  321 + <h2 class="uk-heading-line uk-heading-bullet"><span>用户授权管理</span></h2>
  322 + <div class="ct_cont uk-grid-small uk-child-width-expand" uk-grid>
  323 + <div class="role_list uk-width-1-4 ">
  324 + <div class="uk-card uk-card-default">
  325 + <form>
  326 + <div class="uk-margin">
  327 + <div class="uk-inline" >
  328 + </div>
  329 + </div>
  330 + </form>
  331 +
  332 + <div class="ct-card-body" >
  333 + <ul class="uk-list uk-list-large uk-list-divider role-list">
  334 + </ul>
  335 + </div>
  336 + </div>
  337 + </div>
  338 + <div class="user_list uk-width-1-5 ">
  339 + <div class="uk-card uk-card-default">
  340 + <form>
  341 + <div class="uk-margin">
  342 + <div class="uk-inline" >
  343 + </div>
  344 + </div>
  345 + </form>
  346 +
  347 + <div class="ct-card-body">
  348 + <ul class="uk-list uk-list-large user-list">
  349 + </ul>
  350 + </div>
  351 + </div>
  352 + </div>
  353 + <div class="auth_cont ">
  354 + <div class="uk-card uk-card-default authorize_right_cont">
  355 +
  356 + </div>
  357 + </div>
  358 +
  359 + </div>
  360 +</div>
  361 +
  362 +<script id="authorize-role-list-temp1" type="text/html">
  363 + {{each list as r i}}
  364 + <li data-id="{{r.id}}" data-name="{{r.roleName}}" data-code="{{r.codeUp}}">{{r.roleName}}
  365 + <span class="role-code">{{r.codeName}}</span>
  366 + <div class="ct_li_desc">{{r.createDateStr}}</div>
  367 + <span class="uk-badge">{{r.count}}</span>
  368 + </li>
  369 + {{/each}}
  370 +</script>
  371 +<script id="authorize-user-list-temp1" type="text/html">
  372 + {{each list as u i}}
  373 + <li class="uk-animation-fade uk-animation-fast" data-name="{{u.name}}" data-code="{{u.userNameUp}}" data-id="{{u.id}}">{{u.name}}<span class="role-code">{{u.userName}}</span></li>
  374 + {{/each}}
  375 +</script>
  376 +<script>
  377 + var storage = window.localStorage;
  378 +
  379 + if (typeof String.prototype.startsWith != 'function') {
  380 + String.prototype.startsWith = function (prefix){
  381 + return this.slice(0, prefix.length) === prefix;
  382 + };
  383 + }
  384 + var roles,users,role_users,modules,companyData,lineArray;
  385 +
  386 + var ep = EventProxy.create('query_roles', 'query_users', 'query_modules', 'query_company', 'query_line', function (rs, us, ms, cs, lines) {
  387 + roles = rs;
  388 + users = us;
  389 + modules = ms;
  390 + companyData = cs;
  391 + lineArray=lines;
  392 + role_users = {};
  393 + debugger
  394 + for(var i=0,r;r=roles[i++];){
  395 + r.count=0;
  396 + role_users[r.id]=[];
  397 + r.createDateStr=moment(r.createDate).format('YYYY-MM-DD HH:ss');
  398 + r.codeUp=r.codeName.toUpperCase();
  399 + for(var j=0,u;u=users[j++];){
  400 + if(u.roles.indexOf(r.id)!=-1){
  401 + r.count++;
  402 + role_users[r.id].push(u);
  403 + }
  404 + }
  405 + }
  406 + //渲染角色list
  407 + render_role_list(roles);
  408 + //渲染用户list
  409 + render_user_list(users);
  410 +
  411 + $('.loading').remove();
  412 + $('.ct_page').show();
  413 + });
  414 +
  415 + //角色点击
  416 + $('ul.role-list').on('click', 'li', roleClickHanlder);
  417 + //用户点击
  418 + $('ul.user-list').on('click', 'li', userClickHanlder);
  419 +
  420 +
  421 + function roleClickHanlder() {
  422 + if($(this).hasClass('active') && $('ul.user-list>li.active').length==0)
  423 + return;
  424 +
  425 + reset_dom();
  426 + $('ul.role-list>li.active').removeClass('active');
  427 + $(this).addClass('active');
  428 + //重新渲染用户list
  429 + var id = $(this).data('id');
  430 + render_user_list(role_users[id]);
  431 + //加载角色授权页面
  432 + $('.authorize_right_cont').load('/pages/permission/authorize_all/role_auth.html', function () {
  433 + $('#role_authorize_wrap', this).trigger('init', {role: get_role(id), modules: modules, companyData: companyData});
  434 + });
  435 + }
  436 +
  437 + function userClickHanlder() {
  438 + if($(this).hasClass('active'))
  439 + return;
  440 +
  441 + reset_dom();
  442 + $('ul.user-list>li.active').removeClass('active');
  443 + $(this).addClass('active');
  444 +
  445 + //加载用户授权页面
  446 + var id = $(this).data('id');
  447 + $('.authorize_right_cont').load('/pages/permission/authorize_all/user_auth.html', function () {
  448 + $('#user_authorize_wrap', this).trigger('init', {user: get_user(id),lineArray:lineArray, companyData:companyData});
  449 + });
  450 + }
  451 +
  452 + //refresh-user
  453 + $('.authorize_right_cont').on('refresh-user', function () {
  454 + $('ul.user-list>li.active').removeClass('active').trigger('click');
  455 + });
  456 +
  457 + function reset_dom() {
  458 + $('#select_line_modal').remove();
  459 + }
  460 +
  461 + //滚动条
  462 + $('.ct_page .uk-card .ct-card-body').perfectScrollbar({suppressScrollX: true});
  463 +
  464 + //query all role
  465 + var paramsRole = {};
  466 + paramsRole['codeName'] = 'ROLE_ADMIN';
  467 + var userId=storage.getItem("editUser");
  468 + $get('/user',{id_eq:userId}, function (rs) {
  469 + ep.emit('query_roles', rs.content[0].roles);
  470 + });
  471 +
  472 +
  473 + //query all user
  474 + var paramsUser = {};
  475 + paramsRole['name'] = 'name';
  476 + $.get('/user/all_distinct',paramsUser, function (rs) {
  477 + var userA={};
  478 + for(var i=0,u;u=rs[i++];){
  479 + if (u.id==userId){
  480 + discard_field(u);
  481 + u.userNameUp=u.userName.toUpperCase();
  482 + u.lastLoginDateStr=moment(u.lastLoginDate).format('YYYY-MM-DD HH:ss');
  483 + userA[0]=u;
  484 + }
  485 + }
  486 + ep.emit('query_users', userA);
  487 + });
  488 +
  489 + //query all modules
  490 + $.get('/module/all_distinct', function (rs) {
  491 + ep.emit('query_modules', rs);
  492 + });
  493 +
  494 + //query all company data
  495 + $.get('/business/all', function (rs) {
  496 + ep.emit('query_company', rs);
  497 + });
  498 +
  499 + //query all line
  500 + $.get('/line/all', {'remove_ne': 1}, function (rs) {
  501 + ep.emit('query_line', rs);
  502 + });
  503 +
  504 + function discard_field(u) {
  505 + var array = [];
  506 + $.each(u.roles, function () {
  507 + array.push(this.id);
  508 + });
  509 + u.roles = array;
  510 + }
  511 +
  512 + function render_role_list(list) {
  513 + var htmlStr = template('authorize-role-list-temp1', {list: list});
  514 + $('ul.role-list').html(htmlStr);
  515 + up_scroll();
  516 + }
  517 +
  518 +
  519 + function render_user_list(list) {
  520 + var htmlStr = template('authorize-user-list-temp1', {list: list});
  521 + $('ul.user-list').html(htmlStr);
  522 + up_scroll();
  523 + }
  524 +
  525 + function reset_role_list(){
  526 + var actives = $('ul.role-list>li.active');
  527 + if(actives.length > 0){
  528 + $('ul.role-list>li.active').removeClass('active');
  529 + render_user_list(users);
  530 + $('.authorize_right_cont').empty();
  531 + }
  532 + }
  533 +
  534 + function up_scroll() {
  535 + $('.ct_page .uk-card .ct-card-body').perfectScrollbar('update');
  536 + }
  537 +
  538 +
  539 +
  540 + function get_role(id) {
  541 + for(var i=0,r;r=roles[i++];){
  542 + if(r.id==id)
  543 + return r;
  544 + }
  545 + return null;
  546 + }
  547 +
  548 + function get_user(id) {
  549 + for(var i=0,u;u=users[i++];){
  550 + if(u.id==id)
  551 + return u;
  552 + }
  553 + return null;
  554 + }
  555 +
  556 + $(document).on('submit', 'form', function () {
  557 + return false;
  558 + });
  559 +
  560 + function convert_buss_data(rs) {
  561 + var baseCode;
  562 + //找到跟节点
  563 + $.each(rs, function () {
  564 + if(this.upCode == 0){
  565 + baseCode=this.businessCode;
  566 + return false;
  567 + }
  568 + });
  569 + if(!baseCode){
  570 + alert('大爷找不到根节点,数据有问题吧!!!');
  571 + return;
  572 + }
  573 + //提取二级节点
  574 + var secondMap={};
  575 + $.each(rs, function () {
  576 + if(this.upCode==baseCode){
  577 + secondMap[this.businessCode] = {
  578 + name: this.businessName,
  579 + childs: []
  580 + };
  581 + }
  582 + });
  583 + //分公司节点
  584 + $.each(rs, function () {
  585 + if(secondMap[this.upCode])
  586 + secondMap[this.upCode].childs.push(this);
  587 + });
  588 +
  589 + //排序
  590 + for(var sid in secondMap){
  591 + secondMap[sid].childs.sort(naturalSort);
  592 + }
  593 +
  594 + return secondMap;
  595 + }
  596 +
  597 + var naturalSort=function (a, b) {
  598 + return a.businessName.localeCompare(b.businessName);
  599 + };
  600 +
  601 + var groupBy = function (list, field) {
  602 + var rs = {},
  603 + key;
  604 + $.each(list, function () {
  605 + key = this[field];
  606 + if (!rs[key])
  607 + rs[key] = [];
  608 +
  609 + rs[key].push(this);
  610 + });
  611 +
  612 + return rs;
  613 + };
  614 +</script>
  615 +</body>
621 616 </html>
622 617 \ 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="/pages/permission/user/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 + </div>
  6 + </div>
10 7 </div>
11 8 \ No newline at end of file
... ...
src/main/resources/static/pages/report/inoutstation/js/Blob.js
1   -/* Blob.js
2   - * A Blob implementation.
3   - * 2014-07-24
4   - *
5   - * By Eli Grey, http://eligrey.com
6   - * By Devin Samarin, https://github.com/dsamarin
7   - * License: X11/MIT
8   - * See https://github.com/eligrey/Blob.js/blob/master/LICENSE.md
9   - */
10   -
11   -/*global self, unescape */
12   -/*jslint bitwise: true, regexp: true, confusion: true, es5: true, vars: true, white: true,
13   - plusplus: true */
14   -
15   -/*! @source http://purl.eligrey.com/github/Blob.js/blob/master/Blob.js */
16   -
17   -(function (view) {
18   - "use strict";
19   -
20   - view.URL = view.URL || view.webkitURL;
21   -
22   - if (view.Blob && view.URL) {
23   - try {
24   - new Blob;
25   - return;
26   - } catch (e) {}
27   - }
28   -
29   - // Internally we use a BlobBuilder implementation to base Blob off of
30   - // in order to support older browsers that only have BlobBuilder
31   - var BlobBuilder = view.BlobBuilder || view.WebKitBlobBuilder || view.MozBlobBuilder || (function(view) {
32   - var
33   - get_class = function(object) {
34   - return Object.prototype.toString.call(object).match(/^\[object\s(.*)\]$/)[1];
35   - }
36   - , FakeBlobBuilder = function BlobBuilder() {
37   - this.data = [];
38   - }
39   - , FakeBlob = function Blob(data, type, encoding) {
40   - this.data = data;
41   - this.size = data.length;
42   - this.type = type;
43   - this.encoding = encoding;
44   - }
45   - , FBB_proto = FakeBlobBuilder.prototype
46   - , FB_proto = FakeBlob.prototype
47   - , FileReaderSync = view.FileReaderSync
48   - , FileException = function(type) {
49   - this.code = this[this.name = type];
50   - }
51   - , file_ex_codes = (
52   - "NOT_FOUND_ERR SECURITY_ERR ABORT_ERR NOT_READABLE_ERR ENCODING_ERR "
53   - + "NO_MODIFICATION_ALLOWED_ERR INVALID_STATE_ERR SYNTAX_ERR"
54   - ).split(" ")
55   - , file_ex_code = file_ex_codes.length
56   - , real_URL = view.URL || view.webkitURL || view
57   - , real_create_object_URL = real_URL.createObjectURL
58   - , real_revoke_object_URL = real_URL.revokeObjectURL
59   - , URL = real_URL
60   - , btoa = view.btoa
61   - , atob = view.atob
62   -
63   - , ArrayBuffer = view.ArrayBuffer
64   - , Uint8Array = view.Uint8Array
65   -
66   - , origin = /^[\w-]+:\/*\[?[\w\.:-]+\]?(?::[0-9]+)?/
67   - ;
68   - FakeBlob.fake = FB_proto.fake = true;
69   - while (file_ex_code--) {
70   - FileException.prototype[file_ex_codes[file_ex_code]] = file_ex_code + 1;
71   - }
72   - // Polyfill URL
73   - if (!real_URL.createObjectURL) {
74   - URL = view.URL = function(uri) {
75   - var
76   - uri_info = document.createElementNS("http://www.w3.org/1999/xhtml", "a")
77   - , uri_origin
78   - ;
79   - uri_info.href = uri;
80   - if (!("origin" in uri_info)) {
81   - if (uri_info.protocol.toLowerCase() === "data:") {
82   - uri_info.origin = null;
83   - } else {
84   - uri_origin = uri.match(origin);
85   - uri_info.origin = uri_origin && uri_origin[1];
86   - }
87   - }
88   - return uri_info;
89   - };
90   - }
91   - URL.createObjectURL = function(blob) {
92   - var
93   - type = blob.type
94   - , data_URI_header
95   - ;
96   - if (type === null) {
97   - type = "application/octet-stream";
98   - }
99   - if (blob instanceof FakeBlob) {
100   - data_URI_header = "data:" + type;
101   - if (blob.encoding === "base64") {
102   - return data_URI_header + ";base64," + blob.data;
103   - } else if (blob.encoding === "URI") {
104   - return data_URI_header + "," + decodeURIComponent(blob.data);
105   - } if (btoa) {
106   - return data_URI_header + ";base64," + btoa(blob.data);
107   - } else {
108   - return data_URI_header + "," + encodeURIComponent(blob.data);
109   - }
110   - } else if (real_create_object_URL) {
111   - return real_create_object_URL.call(real_URL, blob);
112   - }
113   - };
114   - URL.revokeObjectURL = function(object_URL) {
115   - if (object_URL.substring(0, 5) !== "data:" && real_revoke_object_URL) {
116   - real_revoke_object_URL.call(real_URL, object_URL);
117   - }
118   - };
119   - FBB_proto.append = function(data/*, endings*/) {
120   - var bb = this.data;
121   - // decode data to a binary string
122   - if (Uint8Array && (data instanceof ArrayBuffer || data instanceof Uint8Array)) {
123   - var
124   - str = ""
125   - , buf = new Uint8Array(data)
126   - , i = 0
127   - , buf_len = buf.length
128   - ;
129   - for (; i < buf_len; i++) {
130   - str += String.fromCharCode(buf[i]);
131   - }
132   - bb.push(str);
133   - } else if (get_class(data) === "Blob" || get_class(data) === "File") {
134   - if (FileReaderSync) {
135   - var fr = new FileReaderSync;
136   - bb.push(fr.readAsBinaryString(data));
137   - } else {
138   - // async FileReader won't work as BlobBuilder is sync
139   - throw new FileException("NOT_READABLE_ERR");
140   - }
141   - } else if (data instanceof FakeBlob) {
142   - if (data.encoding === "base64" && atob) {
143   - bb.push(atob(data.data));
144   - } else if (data.encoding === "URI") {
145   - bb.push(decodeURIComponent(data.data));
146   - } else if (data.encoding === "raw") {
147   - bb.push(data.data);
148   - }
149   - } else {
150   - if (typeof data !== "string") {
151   - data += ""; // convert unsupported types to strings
152   - }
153   - // decode UTF-16 to binary string
154   - bb.push(unescape(encodeURIComponent(data)));
155   - }
156   - };
157   - FBB_proto.getBlob = function(type) {
158   - if (!arguments.length) {
159   - type = null;
160   - }
161   - return new FakeBlob(this.data.join(""), type, "raw");
162   - };
163   - FBB_proto.toString = function() {
164   - return "[object BlobBuilder]";
165   - };
166   - FB_proto.slice = function(start, end, type) {
167   - var args = arguments.length;
168   - if (args < 3) {
169   - type = null;
170   - }
171   - return new FakeBlob(
172   - this.data.slice(start, args > 1 ? end : this.data.length)
173   - , type
174   - , this.encoding
175   - );
176   - };
177   - FB_proto.toString = function() {
178   - return "[object Blob]";
179   - };
180   - FB_proto.close = function() {
181   - this.size = 0;
182   - delete this.data;
183   - };
184   - return FakeBlobBuilder;
185   - }(view));
186   -
187   - view.Blob = function(blobParts, options) {
188   - var type = options ? (options.type || "") : "";
189   - var builder = new BlobBuilder();
190   - if (blobParts) {
191   - for (var i = 0, len = blobParts.length; i < len; i++) {
192   - builder.append(blobParts[i]);
193   - }
194   - }
195   - return builder.getBlob(type);
196   - };
197   -}(typeof self !== "undefined" && self || typeof window !== "undefined" && window || this.content || this));
  1 +/* Blob.js
  2 + * A Blob implementation.
  3 + * 2014-07-24
  4 + *
  5 + * By Eli Grey, http://eligrey.com
  6 + * By Devin Samarin, https://github.com/dsamarin
  7 + * License: X11/MIT
  8 + * See https://github.com/eligrey/Blob.js/blob/master/LICENSE.md
  9 + */
  10 +
  11 +/*global self, unescape */
  12 +/*jslint bitwise: true, regexp: true, confusion: true, es5: true, vars: true, white: true,
  13 + plusplus: true */
  14 +
  15 +/*! @source http://purl.eligrey.com/github/Blob.js/blob/master/Blob.js */
  16 +
  17 +(function (view) {
  18 + "use strict";
  19 +
  20 + view.URL = view.URL || view.webkitURL;
  21 +
  22 + if (view.Blob && view.URL) {
  23 + try {
  24 + new Blob;
  25 + return;
  26 + } catch (e) {}
  27 + }
  28 +
  29 + // Internally we use a BlobBuilder implementation to base Blob off of
  30 + // in order to support older browsers that only have BlobBuilder
  31 + var BlobBuilder = view.BlobBuilder || view.WebKitBlobBuilder || view.MozBlobBuilder || (function(view) {
  32 + var
  33 + get_class = function(object) {
  34 + return Object.prototype.toString.call(object).match(/^\[object\s(.*)\]$/)[1];
  35 + }
  36 + , FakeBlobBuilder = function BlobBuilder() {
  37 + this.data = [];
  38 + }
  39 + , FakeBlob = function Blob(data, type, encoding) {
  40 + this.data = data;
  41 + this.size = data.length;
  42 + this.type = type;
  43 + this.encoding = encoding;
  44 + }
  45 + , FBB_proto = FakeBlobBuilder.prototype
  46 + , FB_proto = FakeBlob.prototype
  47 + , FileReaderSync = view.FileReaderSync
  48 + , FileException = function(type) {
  49 + this.code = this[this.name = type];
  50 + }
  51 + , file_ex_codes = (
  52 + "NOT_FOUND_ERR SECURITY_ERR ABORT_ERR NOT_READABLE_ERR ENCODING_ERR "
  53 + + "NO_MODIFICATION_ALLOWED_ERR INVALID_STATE_ERR SYNTAX_ERR"
  54 + ).split(" ")
  55 + , file_ex_code = file_ex_codes.length
  56 + , real_URL = view.URL || view.webkitURL || view
  57 + , real_create_object_URL = real_URL.createObjectURL
  58 + , real_revoke_object_URL = real_URL.revokeObjectURL
  59 + , URL = real_URL
  60 + , btoa = view.btoa
  61 + , atob = view.atob
  62 +
  63 + , ArrayBuffer = view.ArrayBuffer
  64 + , Uint8Array = view.Uint8Array
  65 +
  66 + , origin = /^[\w-]+:\/*\[?[\w\.:-]+\]?(?::[0-9]+)?/
  67 + ;
  68 + FakeBlob.fake = FB_proto.fake = true;
  69 + while (file_ex_code--) {
  70 + FileException.prototype[file_ex_codes[file_ex_code]] = file_ex_code + 1;
  71 + }
  72 + // Polyfill URL
  73 + if (!real_URL.createObjectURL) {
  74 + URL = view.URL = function(uri) {
  75 + var
  76 + uri_info = document.createElementNS("http://www.w3.org/1999/xhtml", "a")
  77 + , uri_origin
  78 + ;
  79 + uri_info.href = uri;
  80 + if (!("origin" in uri_info)) {
  81 + if (uri_info.protocol.toLowerCase() === "data:") {
  82 + uri_info.origin = null;
  83 + } else {
  84 + uri_origin = uri.match(origin);
  85 + uri_info.origin = uri_origin && uri_origin[1];
  86 + }
  87 + }
  88 + return uri_info;
  89 + };
  90 + }
  91 + URL.createObjectURL = function(blob) {
  92 + var
  93 + type = blob.type
  94 + , data_URI_header
  95 + ;
  96 + if (type === null) {
  97 + type = "application/octet-stream";
  98 + }
  99 + if (blob instanceof FakeBlob) {
  100 + data_URI_header = "data:" + type;
  101 + if (blob.encoding === "base64") {
  102 + return data_URI_header + ";base64," + blob.data;
  103 + } else if (blob.encoding === "URI") {
  104 + return data_URI_header + "," + decodeURIComponent(blob.data);
  105 + } if (btoa) {
  106 + return data_URI_header + ";base64," + btoa(blob.data);
  107 + } else {
  108 + return data_URI_header + "," + encodeURIComponent(blob.data);
  109 + }
  110 + } else if (real_create_object_URL) {
  111 + return real_create_object_URL.call(real_URL, blob);
  112 + }
  113 + };
  114 + URL.revokeObjectURL = function(object_URL) {
  115 + if (object_URL.substring(0, 5) !== "data:" && real_revoke_object_URL) {
  116 + real_revoke_object_URL.call(real_URL, object_URL);
  117 + }
  118 + };
  119 + FBB_proto.append = function(data/*, endings*/) {
  120 + var bb = this.data;
  121 + // decode data to a binary string
  122 + if (Uint8Array && (data instanceof ArrayBuffer || data instanceof Uint8Array)) {
  123 + var
  124 + str = ""
  125 + , buf = new Uint8Array(data)
  126 + , i = 0
  127 + , buf_len = buf.length
  128 + ;
  129 + for (; i < buf_len; i++) {
  130 + str += String.fromCharCode(buf[i]);
  131 + }
  132 + bb.push(str);
  133 + } else if (get_class(data) === "Blob" || get_class(data) === "File") {
  134 + if (FileReaderSync) {
  135 + var fr = new FileReaderSync;
  136 + bb.push(fr.readAsBinaryString(data));
  137 + } else {
  138 + // async FileReader won't work as BlobBuilder is sync
  139 + throw new FileException("NOT_READABLE_ERR");
  140 + }
  141 + } else if (data instanceof FakeBlob) {
  142 + if (data.encoding === "base64" && atob) {
  143 + bb.push(atob(data.data));
  144 + } else if (data.encoding === "URI") {
  145 + bb.push(decodeURIComponent(data.data));
  146 + } else if (data.encoding === "raw") {
  147 + bb.push(data.data);
  148 + }
  149 + } else {
  150 + if (typeof data !== "string") {
  151 + data += ""; // convert unsupported types to strings
  152 + }
  153 + // decode UTF-16 to binary string
  154 + bb.push(unescape(encodeURIComponent(data)));
  155 + }
  156 + };
  157 + FBB_proto.getBlob = function(type) {
  158 + if (!arguments.length) {
  159 + type = null;
  160 + }
  161 + return new FakeBlob(this.data.join(""), type, "raw");
  162 + };
  163 + FBB_proto.toString = function() {
  164 + return "[object BlobBuilder]";
  165 + };
  166 + FB_proto.slice = function(start, end, type) {
  167 + var args = arguments.length;
  168 + if (args < 3) {
  169 + type = null;
  170 + }
  171 + return new FakeBlob(
  172 + this.data.slice(start, args > 1 ? end : this.data.length)
  173 + , type
  174 + , this.encoding
  175 + );
  176 + };
  177 + FB_proto.toString = function() {
  178 + return "[object Blob]";
  179 + };
  180 + FB_proto.close = function() {
  181 + this.size = 0;
  182 + delete this.data;
  183 + };
  184 + return FakeBlobBuilder;
  185 + }(view));
  186 +
  187 + view.Blob = function(blobParts, options) {
  188 + var type = options ? (options.type || "") : "";
  189 + var builder = new BlobBuilder();
  190 + if (blobParts) {
  191 + for (var i = 0, len = blobParts.length; i < len; i++) {
  192 + builder.append(blobParts[i]);
  193 + }
  194 + }
  195 + return builder.getBlob(type);
  196 + };
  197 +}(typeof self !== "undefined" && self || typeof window !== "undefined" && window || this.content || this));
... ...
src/main/resources/static/pages/report/inoutstation/js/FileSaver.js
1   -/* FileSaver.js
2   - * A saveAs() FileSaver implementation.
3   - * 2014-08-29
4   - *
5   - * By Eli Grey, http://eligrey.com
6   - * License: X11/MIT
7   - * See https://github.com/eligrey/FileSaver.js/blob/master/LICENSE.md
8   - */
9   -
10   -/*global self */
11   -/*jslint bitwise: true, indent: 4, laxbreak: true, laxcomma: true, smarttabs: true, plusplus: true */
12   -
13   -/*! @source http://purl.eligrey.com/github/FileSaver.js/blob/master/FileSaver.js */
14   -
15   -var saveAs = saveAs
16   - // IE 10+ (native saveAs)
17   - || (typeof navigator !== "undefined" &&
18   - navigator.msSaveOrOpenBlob && navigator.msSaveOrOpenBlob.bind(navigator))
19   - // Everyone else
20   - || (function(view) {
21   - "use strict";
22   - // IE <10 is explicitly unsupported
23   - if (typeof navigator !== "undefined" &&
24   - /MSIE [1-9]\./.test(navigator.userAgent)) {
25   - return;
26   - }
27   - var
28   - doc = view.document
29   - // only get URL when necessary in case Blob.js hasn't overridden it yet
30   - , get_URL = function() {
31   - return view.URL || view.webkitURL || view;
32   - }
33   - , save_link = doc.createElementNS("http://www.w3.org/1999/xhtml", "a")
34   - , can_use_save_link = "download" in save_link
35   - , click = function(node) {
36   - var event = doc.createEvent("MouseEvents");
37   - event.initMouseEvent(
38   - "click", true, false, view, 0, 0, 0, 0, 0
39   - , false, false, false, false, 0, null
40   - );
41   - node.dispatchEvent(event);
42   - }
43   - , webkit_req_fs = view.webkitRequestFileSystem
44   - , req_fs = view.requestFileSystem || webkit_req_fs || view.mozRequestFileSystem
45   - , throw_outside = function(ex) {
46   - (view.setImmediate || view.setTimeout)(function() {
47   - throw ex;
48   - }, 0);
49   - }
50   - , force_saveable_type = "application/octet-stream"
51   - , fs_min_size = 0
52   - // See https://code.google.com/p/chromium/issues/detail?id=375297#c7 for
53   - // the reasoning behind the timeout and revocation flow
54   - , arbitrary_revoke_timeout = 10
55   - , revoke = function(file) {
56   - var revoker = function() {
57   - if (typeof file === "string") { // file is an object URL
58   - get_URL().revokeObjectURL(file);
59   - } else { // file is a File
60   - file.remove();
61   - }
62   - };
63   - if (view.chrome) {
64   - revoker();
65   - } else {
66   - setTimeout(revoker, arbitrary_revoke_timeout);
67   - }
68   - }
69   - , dispatch = function(filesaver, event_types, event) {
70   - event_types = [].concat(event_types);
71   - var i = event_types.length;
72   - while (i--) {
73   - var listener = filesaver["on" + event_types[i]];
74   - if (typeof listener === "function") {
75   - try {
76   - listener.call(filesaver, event || filesaver);
77   - } catch (ex) {
78   - throw_outside(ex);
79   - }
80   - }
81   - }
82   - }
83   - , FileSaver = function(blob, name) {
84   - // First try a.download, then web filesystem, then object URLs
85   - var
86   - filesaver = this
87   - , type = blob.type
88   - , blob_changed = false
89   - , object_url
90   - , target_view
91   - , dispatch_all = function() {
92   - dispatch(filesaver, "writestart progress write writeend".split(" "));
93   - }
94   - // on any filesys errors revert to saving with object URLs
95   - , fs_error = function() {
96   - // don't create more object URLs than needed
97   - if (blob_changed || !object_url) {
98   - object_url = get_URL().createObjectURL(blob);
99   - }
100   - if (target_view) {
101   - target_view.location.href = object_url;
102   - } else {
103   - var new_tab = view.open(object_url, "_blank");
104   - if (new_tab == undefined && typeof safari !== "undefined") {
105   - //Apple do not allow window.open, see http://bit.ly/1kZffRI
106   - view.location.href = object_url
107   - }
108   - }
109   - filesaver.readyState = filesaver.DONE;
110   - dispatch_all();
111   - revoke(object_url);
112   - }
113   - , abortable = function(func) {
114   - return function() {
115   - if (filesaver.readyState !== filesaver.DONE) {
116   - return func.apply(this, arguments);
117   - }
118   - };
119   - }
120   - , create_if_not_found = {create: true, exclusive: false}
121   - , slice
122   - ;
123   - filesaver.readyState = filesaver.INIT;
124   - if (!name) {
125   - name = "download";
126   - }
127   - if (can_use_save_link) {
128   - object_url = get_URL().createObjectURL(blob);
129   - save_link.href = object_url;
130   - save_link.download = name;
131   - click(save_link);
132   - filesaver.readyState = filesaver.DONE;
133   - dispatch_all();
134   - revoke(object_url);
135   - return;
136   - }
137   - // Object and web filesystem URLs have a problem saving in Google Chrome when
138   - // viewed in a tab, so I force save with application/octet-stream
139   - // http://code.google.com/p/chromium/issues/detail?id=91158
140   - // Update: Google errantly closed 91158, I submitted it again:
141   - // https://code.google.com/p/chromium/issues/detail?id=389642
142   - if (view.chrome && type && type !== force_saveable_type) {
143   - slice = blob.slice || blob.webkitSlice;
144   - blob = slice.call(blob, 0, blob.size, force_saveable_type);
145   - blob_changed = true;
146   - }
147   - // Since I can't be sure that the guessed media type will trigger a download
148   - // in WebKit, I append .download to the filename.
149   - // https://bugs.webkit.org/show_bug.cgi?id=65440
150   - if (webkit_req_fs && name !== "download") {
151   - name += ".download";
152   - }
153   - if (type === force_saveable_type || webkit_req_fs) {
154   - target_view = view;
155   - }
156   - if (!req_fs) {
157   - fs_error();
158   - return;
159   - }
160   - fs_min_size += blob.size;
161   - req_fs(view.TEMPORARY, fs_min_size, abortable(function(fs) {
162   - fs.root.getDirectory("saved", create_if_not_found, abortable(function(dir) {
163   - var save = function() {
164   - dir.getFile(name, create_if_not_found, abortable(function(file) {
165   - file.createWriter(abortable(function(writer) {
166   - writer.onwriteend = function(event) {
167   - target_view.location.href = file.toURL();
168   - filesaver.readyState = filesaver.DONE;
169   - dispatch(filesaver, "writeend", event);
170   - revoke(file);
171   - };
172   - writer.onerror = function() {
173   - var error = writer.error;
174   - if (error.code !== error.ABORT_ERR) {
175   - fs_error();
176   - }
177   - };
178   - "writestart progress write abort".split(" ").forEach(function(event) {
179   - writer["on" + event] = filesaver["on" + event];
180   - });
181   - writer.write(blob);
182   - filesaver.abort = function() {
183   - writer.abort();
184   - filesaver.readyState = filesaver.DONE;
185   - };
186   - filesaver.readyState = filesaver.WRITING;
187   - }), fs_error);
188   - }), fs_error);
189   - };
190   - dir.getFile(name, {create: false}, abortable(function(file) {
191   - // delete file if it already exists
192   - file.remove();
193   - save();
194   - }), abortable(function(ex) {
195   - if (ex.code === ex.NOT_FOUND_ERR) {
196   - save();
197   - } else {
198   - fs_error();
199   - }
200   - }));
201   - }), fs_error);
202   - }), fs_error);
203   - }
204   - , FS_proto = FileSaver.prototype
205   - , saveAs = function(blob, name) {
206   - return new FileSaver(blob, name);
207   - }
208   - ;
209   - FS_proto.abort = function() {
210   - var filesaver = this;
211   - filesaver.readyState = filesaver.DONE;
212   - dispatch(filesaver, "abort");
213   - };
214   - FS_proto.readyState = FS_proto.INIT = 0;
215   - FS_proto.WRITING = 1;
216   - FS_proto.DONE = 2;
217   -
218   - FS_proto.error =
219   - FS_proto.onwritestart =
220   - FS_proto.onprogress =
221   - FS_proto.onwrite =
222   - FS_proto.onabort =
223   - FS_proto.onerror =
224   - FS_proto.onwriteend =
225   - null;
226   -
227   - return saveAs;
228   -}(
229   - typeof self !== "undefined" && self
230   - || typeof window !== "undefined" && window
231   - || this.content
232   -));
233   -// `self` is undefined in Firefox for Android content script context
234   -// while `this` is nsIContentFrameMessageManager
235   -// with an attribute `content` that corresponds to the window
236   -
237   -if (typeof module !== "undefined" && module !== null) {
238   - module.exports = saveAs;
239   -} else if ((typeof define !== "undefined" && define !== null) && (define.amd != null)) {
240   - define([], function() {
241   - return saveAs;
242   - });
243   -}
  1 +/* FileSaver.js
  2 + * A saveAs() FileSaver implementation.
  3 + * 2014-08-29
  4 + *
  5 + * By Eli Grey, http://eligrey.com
  6 + * License: X11/MIT
  7 + * See https://github.com/eligrey/FileSaver.js/blob/master/LICENSE.md
  8 + */
  9 +
  10 +/*global self */
  11 +/*jslint bitwise: true, indent: 4, laxbreak: true, laxcomma: true, smarttabs: true, plusplus: true */
  12 +
  13 +/*! @source http://purl.eligrey.com/github/FileSaver.js/blob/master/FileSaver.js */
  14 +
  15 +var saveAs = saveAs
  16 + // IE 10+ (native saveAs)
  17 + || (typeof navigator !== "undefined" &&
  18 + navigator.msSaveOrOpenBlob && navigator.msSaveOrOpenBlob.bind(navigator))
  19 + // Everyone else
  20 + || (function(view) {
  21 + "use strict";
  22 + // IE <10 is explicitly unsupported
  23 + if (typeof navigator !== "undefined" &&
  24 + /MSIE [1-9]\./.test(navigator.userAgent)) {
  25 + return;
  26 + }
  27 + var
  28 + doc = view.document
  29 + // only get URL when necessary in case Blob.js hasn't overridden it yet
  30 + , get_URL = function() {
  31 + return view.URL || view.webkitURL || view;
  32 + }
  33 + , save_link = doc.createElementNS("http://www.w3.org/1999/xhtml", "a")
  34 + , can_use_save_link = "download" in save_link
  35 + , click = function(node) {
  36 + var event = doc.createEvent("MouseEvents");
  37 + event.initMouseEvent(
  38 + "click", true, false, view, 0, 0, 0, 0, 0
  39 + , false, false, false, false, 0, null
  40 + );
  41 + node.dispatchEvent(event);
  42 + }
  43 + , webkit_req_fs = view.webkitRequestFileSystem
  44 + , req_fs = view.requestFileSystem || webkit_req_fs || view.mozRequestFileSystem
  45 + , throw_outside = function(ex) {
  46 + (view.setImmediate || view.setTimeout)(function() {
  47 + throw ex;
  48 + }, 0);
  49 + }
  50 + , force_saveable_type = "application/octet-stream"
  51 + , fs_min_size = 0
  52 + // See https://code.google.com/p/chromium/issues/detail?id=375297#c7 for
  53 + // the reasoning behind the timeout and revocation flow
  54 + , arbitrary_revoke_timeout = 10
  55 + , revoke = function(file) {
  56 + var revoker = function() {
  57 + if (typeof file === "string") { // file is an object URL
  58 + get_URL().revokeObjectURL(file);
  59 + } else { // file is a File
  60 + file.remove();
  61 + }
  62 + };
  63 + if (view.chrome) {
  64 + revoker();
  65 + } else {
  66 + setTimeout(revoker, arbitrary_revoke_timeout);
  67 + }
  68 + }
  69 + , dispatch = function(filesaver, event_types, event) {
  70 + event_types = [].concat(event_types);
  71 + var i = event_types.length;
  72 + while (i--) {
  73 + var listener = filesaver["on" + event_types[i]];
  74 + if (typeof listener === "function") {
  75 + try {
  76 + listener.call(filesaver, event || filesaver);
  77 + } catch (ex) {
  78 + throw_outside(ex);
  79 + }
  80 + }
  81 + }
  82 + }
  83 + , FileSaver = function(blob, name) {
  84 + // First try a.download, then web filesystem, then object URLs
  85 + var
  86 + filesaver = this
  87 + , type = blob.type
  88 + , blob_changed = false
  89 + , object_url
  90 + , target_view
  91 + , dispatch_all = function() {
  92 + dispatch(filesaver, "writestart progress write writeend".split(" "));
  93 + }
  94 + // on any filesys errors revert to saving with object URLs
  95 + , fs_error = function() {
  96 + // don't create more object URLs than needed
  97 + if (blob_changed || !object_url) {
  98 + object_url = get_URL().createObjectURL(blob);
  99 + }
  100 + if (target_view) {
  101 + target_view.location.href = object_url;
  102 + } else {
  103 + var new_tab = view.open(object_url, "_blank");
  104 + if (new_tab == undefined && typeof safari !== "undefined") {
  105 + //Apple do not allow window.open, see http://bit.ly/1kZffRI
  106 + view.location.href = object_url
  107 + }
  108 + }
  109 + filesaver.readyState = filesaver.DONE;
  110 + dispatch_all();
  111 + revoke(object_url);
  112 + }
  113 + , abortable = function(func) {
  114 + return function() {
  115 + if (filesaver.readyState !== filesaver.DONE) {
  116 + return func.apply(this, arguments);
  117 + }
  118 + };
  119 + }
  120 + , create_if_not_found = {create: true, exclusive: false}
  121 + , slice
  122 + ;
  123 + filesaver.readyState = filesaver.INIT;
  124 + if (!name) {
  125 + name = "download";
  126 + }
  127 + if (can_use_save_link) {
  128 + object_url = get_URL().createObjectURL(blob);
  129 + save_link.href = object_url;
  130 + save_link.download = name;
  131 + click(save_link);
  132 + filesaver.readyState = filesaver.DONE;
  133 + dispatch_all();
  134 + revoke(object_url);
  135 + return;
  136 + }
  137 + // Object and web filesystem URLs have a problem saving in Google Chrome when
  138 + // viewed in a tab, so I force save with application/octet-stream
  139 + // http://code.google.com/p/chromium/issues/detail?id=91158
  140 + // Update: Google errantly closed 91158, I submitted it again:
  141 + // https://code.google.com/p/chromium/issues/detail?id=389642
  142 + if (view.chrome && type && type !== force_saveable_type) {
  143 + slice = blob.slice || blob.webkitSlice;
  144 + blob = slice.call(blob, 0, blob.size, force_saveable_type);
  145 + blob_changed = true;
  146 + }
  147 + // Since I can't be sure that the guessed media type will trigger a download
  148 + // in WebKit, I append .download to the filename.
  149 + // https://bugs.webkit.org/show_bug.cgi?id=65440
  150 + if (webkit_req_fs && name !== "download") {
  151 + name += ".download";
  152 + }
  153 + if (type === force_saveable_type || webkit_req_fs) {
  154 + target_view = view;
  155 + }
  156 + if (!req_fs) {
  157 + fs_error();
  158 + return;
  159 + }
  160 + fs_min_size += blob.size;
  161 + req_fs(view.TEMPORARY, fs_min_size, abortable(function(fs) {
  162 + fs.root.getDirectory("saved", create_if_not_found, abortable(function(dir) {
  163 + var save = function() {
  164 + dir.getFile(name, create_if_not_found, abortable(function(file) {
  165 + file.createWriter(abortable(function(writer) {
  166 + writer.onwriteend = function(event) {
  167 + target_view.location.href = file.toURL();
  168 + filesaver.readyState = filesaver.DONE;
  169 + dispatch(filesaver, "writeend", event);
  170 + revoke(file);
  171 + };
  172 + writer.onerror = function() {
  173 + var error = writer.error;
  174 + if (error.code !== error.ABORT_ERR) {
  175 + fs_error();
  176 + }
  177 + };
  178 + "writestart progress write abort".split(" ").forEach(function(event) {
  179 + writer["on" + event] = filesaver["on" + event];
  180 + });
  181 + writer.write(blob);
  182 + filesaver.abort = function() {
  183 + writer.abort();
  184 + filesaver.readyState = filesaver.DONE;
  185 + };
  186 + filesaver.readyState = filesaver.WRITING;
  187 + }), fs_error);
  188 + }), fs_error);
  189 + };
  190 + dir.getFile(name, {create: false}, abortable(function(file) {
  191 + // delete file if it already exists
  192 + file.remove();
  193 + save();
  194 + }), abortable(function(ex) {
  195 + if (ex.code === ex.NOT_FOUND_ERR) {
  196 + save();
  197 + } else {
  198 + fs_error();
  199 + }
  200 + }));
  201 + }), fs_error);
  202 + }), fs_error);
  203 + }
  204 + , FS_proto = FileSaver.prototype
  205 + , saveAs = function(blob, name) {
  206 + return new FileSaver(blob, name);
  207 + }
  208 + ;
  209 + FS_proto.abort = function() {
  210 + var filesaver = this;
  211 + filesaver.readyState = filesaver.DONE;
  212 + dispatch(filesaver, "abort");
  213 + };
  214 + FS_proto.readyState = FS_proto.INIT = 0;
  215 + FS_proto.WRITING = 1;
  216 + FS_proto.DONE = 2;
  217 +
  218 + FS_proto.error =
  219 + FS_proto.onwritestart =
  220 + FS_proto.onprogress =
  221 + FS_proto.onwrite =
  222 + FS_proto.onabort =
  223 + FS_proto.onerror =
  224 + FS_proto.onwriteend =
  225 + null;
  226 +
  227 + return saveAs;
  228 +}(
  229 + typeof self !== "undefined" && self
  230 + || typeof window !== "undefined" && window
  231 + || this.content
  232 +));
  233 +// `self` is undefined in Firefox for Android content script context
  234 +// while `this` is nsIContentFrameMessageManager
  235 +// with an attribute `content` that corresponds to the window
  236 +
  237 +if (typeof module !== "undefined" && module !== null) {
  238 + module.exports = saveAs;
  239 +} else if ((typeof define !== "undefined" && define !== null) && (define.amd != null)) {
  240 + define([], function() {
  241 + return saveAs;
  242 + });
  243 +}
... ...
src/main/resources/static/pages/report/inoutstation/js/tableExport.js
1   -
2   -
3   -(function(view){
4   - "use strict";
5   - var characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
6   - var fromCharCode = String.fromCharCode;
7   - var INVALID_CHARACTER_ERR = ( function() {
8   - // fabricate a suitable error object
9   - try {
10   - document.createElement('$');
11   - } catch (error) {
12   - return error;
13   - }
14   - }());
15   -
16   - // encoder
17   - var btoa = function(string) {
18   - var a, b, b1, b2, b3, b4, c, i = 0, len = string.length, max = Math.max, result = '';
19   -
20   - while (i < len) {
21   - a = string.charCodeAt(i++) || 0;
22   - b = string.charCodeAt(i++) || 0;
23   - c = string.charCodeAt(i++) || 0;
24   -
25   - if (max(a, b, c) > 0xFF) {
26   - throw INVALID_CHARACTER_ERR;
27   - }
28   -
29   - b1 = (a >> 2) & 0x3F;
30   - b2 = ((a & 0x3) << 4) | ((b >> 4) & 0xF);
31   - b3 = ((b & 0xF) << 2) | ((c >> 6) & 0x3);
32   - b4 = c & 0x3F;
33   -
34   - if (!b) {
35   - b3 = b4 = 64;
36   - } else if (!c) {
37   - b4 = 64;
38   - }
39   - result += characters.charAt(b1) + characters.charAt(b2) + characters.charAt(b3) + characters.charAt(b4);
40   - }
41   - return result;
42   - };
43   -
44   - //获取dom文本
45   - var getText = function( el ){
46   - var s = el.textContent || el.innerText;
47   - return s == null ? "" : s.replace( /^\s*(.*?)\s+$/, "$1");
48   - };
49   - view.tableExport = function(tableId, filename, type){
50   - var doc = view.document,
51   - table = doc.getElementById(tableId),
52   - charSet = doc.characterSet
53   -
54   - var uri = {
55   - json: 'application/json;charset='+charSet,
56   - txt: 'csv/txt;charset='+charSet,
57   - csv: 'csv/txt;charset='+charSet,
58   - doc: 'application/vnd.ms-doc',
59   - excel: 'application/vnd.ms-excel'
60   - };
61   -
62   - var base64 = function(s) {
63   - return btoa(unescape(encodeURIComponent(s)));
64   - };
65   - var template = function(s, c) {
66   - return s.replace(/{(\w+)}/g, function(m, p) {
67   - return c[p];
68   - });
69   - };
70   -
71   - var get_blob = function() {
72   - return view.Blob;
73   - }
74   -
75   - var fixCSVField = function(value) {
76   - var fixedValue = value;
77   - var addQuotes = (value.indexOf(',') !== -1) || (value.indexOf('\r') !== -1) || (value.indexOf('\n') !== -1);
78   - var replaceDoubleQuotes = (value.indexOf('"') !== -1);
79   -
80   - if (replaceDoubleQuotes) {
81   - fixedValue = fixedValue.replace(/"/g, '""');
82   - }
83   - if (addQuotes || replaceDoubleQuotes) {
84   - fixedValue = '"' + fixedValue + '"';
85   - }
86   - return fixedValue;
87   - };
88   -
89   - var saveData = function(data){
90   - var BB = get_blob();
91   - saveAs(new BB([data], {type: uri[type]}), filename + "."+type);
92   - };
93   -
94   - var toCSV = function(){
95   - var data = "\ufeff";
96   - for (var i = 0, row; row = table.rows[i]; i++) {
97   - for (var j = 0, col; col = row.cells[j]; j++) {
98   - data = data + (j ? ',' : '') + fixCSVField(getText(col));
99   - }
100   - data = data + "\r\n";
101   - }
102   - saveData(data);
103   - };
104   -
105   - var toJson = function(){
106   - var jsonHeaderArray = [];
107   -
108   - if(table.tHead){
109   - for(var i =0,col; col = table.tHead.rows[0].cells[i]; i++){
110   - jsonHeaderArray.push(getText(col));
111   - }
112   - }
113   -
114   - var jsonArray = [];
115   - if(table.tBodies){
116   - for(var j=0,tbody; tbody = table.tBodies[j]; j++){
117   - for(var k =0, rowb; rowb= tbody.rows[k]; k++){
118   - var len = jsonArray.length;
119   - jsonArray[len] = [];
120   - for (var g = 0, colb; colb = rowb.cells[g]; g++) {
121   - jsonArray[len].push(getText(colb));
122   - }
123   - }
124   - }
125   - }
126   -
127   - var jsonExportArray = {
128   - header: jsonHeaderArray,
129   - data: jsonArray
130   - };
131   - saveData(JSON.stringify(jsonExportArray));
132   - };
133   -
134   - var toOffice = function(){
135   - var tmpl = '<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:'+type+'" xmlns="http://www.w3.org/TR/REC-html40">';
136   - tmpl += '<head><meta charset="'+charSet+'" /><!--[if gte mso 9]><xml><x:ExcelWorkbook><x:ExcelWorksheets><x:ExcelWorksheet><x:Name>';
137   - tmpl += '{worksheet}</x:Name><x:WorksheetOptions><x:DisplayGridlines/></x:WorksheetOptions></x:ExcelWorksheet></x:ExcelWorksheets></x:ExcelWorkbook></xml><![endif]-->';
138   - tmpl += '</head><body><table>{table}</table></body></html>';
139   - var office = '',
140   - maph = [['<thead><tr>', '</tr></thead>'], ['<tbody><tr>', '</tr></tbody>'], ['<tr>', '</tr>']],
141   - mapb = [['<th>', '</th>'],['<td>', '</td>']],
142   - flag = +!table.tHead,
143   - com = 1 - flag;
144   -
145   - for(var i=0, row; row = table.rows[i]; i++){
146   - flag = i > com ? 2 : flag;
147   - office += maph[flag][0];
148   - for(var j =0, col; col = row.cells[j]; j++){
149   - office += mapb[+!!flag][0]+ getText(col) +mapb[+!!flag][1];
150   - }
151   - office += maph[flag][1];
152   - flag++;
153   - }
154   - saveData(template(tmpl, {worksheet: 'Worksheet', table: office}));
155   - };
156   -
157   - var typeMap = {
158   - json : toJson,
159   - txt: toCSV,
160   - csv: toCSV,
161   - doc: toOffice,
162   - docx: toOffice,
163   - xls: toOffice,
164   - xlsx: toOffice
165   - };
166   -
167   - typeMap[type]();
168   - };
169   -
  1 +
  2 +
  3 +(function(view){
  4 + "use strict";
  5 + var characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
  6 + var fromCharCode = String.fromCharCode;
  7 + var INVALID_CHARACTER_ERR = ( function() {
  8 + // fabricate a suitable error object
  9 + try {
  10 + document.createElement('$');
  11 + } catch (error) {
  12 + return error;
  13 + }
  14 + }());
  15 +
  16 + // encoder
  17 + var btoa = function(string) {
  18 + var a, b, b1, b2, b3, b4, c, i = 0, len = string.length, max = Math.max, result = '';
  19 +
  20 + while (i < len) {
  21 + a = string.charCodeAt(i++) || 0;
  22 + b = string.charCodeAt(i++) || 0;
  23 + c = string.charCodeAt(i++) || 0;
  24 +
  25 + if (max(a, b, c) > 0xFF) {
  26 + throw INVALID_CHARACTER_ERR;
  27 + }
  28 +
  29 + b1 = (a >> 2) & 0x3F;
  30 + b2 = ((a & 0x3) << 4) | ((b >> 4) & 0xF);
  31 + b3 = ((b & 0xF) << 2) | ((c >> 6) & 0x3);
  32 + b4 = c & 0x3F;
  33 +
  34 + if (!b) {
  35 + b3 = b4 = 64;
  36 + } else if (!c) {
  37 + b4 = 64;
  38 + }
  39 + result += characters.charAt(b1) + characters.charAt(b2) + characters.charAt(b3) + characters.charAt(b4);
  40 + }
  41 + return result;
  42 + };
  43 +
  44 + //获取dom文本
  45 + var getText = function( el ){
  46 + var s = el.textContent || el.innerText;
  47 + return s == null ? "" : s.replace( /^\s*(.*?)\s+$/, "$1");
  48 + };
  49 + view.tableExport = function(tableId, filename, type){
  50 + var doc = view.document,
  51 + table = doc.getElementById(tableId),
  52 + charSet = doc.characterSet
  53 +
  54 + var uri = {
  55 + json: 'application/json;charset='+charSet,
  56 + txt: 'csv/txt;charset='+charSet,
  57 + csv: 'csv/txt;charset='+charSet,
  58 + doc: 'application/vnd.ms-doc',
  59 + excel: 'application/vnd.ms-excel'
  60 + };
  61 +
  62 + var base64 = function(s) {
  63 + return btoa(unescape(encodeURIComponent(s)));
  64 + };
  65 + var template = function(s, c) {
  66 + return s.replace(/{(\w+)}/g, function(m, p) {
  67 + return c[p];
  68 + });
  69 + };
  70 +
  71 + var get_blob = function() {
  72 + return view.Blob;
  73 + }
  74 +
  75 + var fixCSVField = function(value) {
  76 + var fixedValue = value;
  77 + var addQuotes = (value.indexOf(',') !== -1) || (value.indexOf('\r') !== -1) || (value.indexOf('\n') !== -1);
  78 + var replaceDoubleQuotes = (value.indexOf('"') !== -1);
  79 +
  80 + if (replaceDoubleQuotes) {
  81 + fixedValue = fixedValue.replace(/"/g, '""');
  82 + }
  83 + if (addQuotes || replaceDoubleQuotes) {
  84 + fixedValue = '"' + fixedValue + '"';
  85 + }
  86 + return fixedValue;
  87 + };
  88 +
  89 + var saveData = function(data){
  90 + var BB = get_blob();
  91 + saveAs(new BB([data], {type: uri[type]}), filename + "."+type);
  92 + };
  93 +
  94 + var toCSV = function(){
  95 + var data = "\ufeff";
  96 + for (var i = 0, row; row = table.rows[i]; i++) {
  97 + for (var j = 0, col; col = row.cells[j]; j++) {
  98 + data = data + (j ? ',' : '') + fixCSVField(getText(col));
  99 + }
  100 + data = data + "\r\n";
  101 + }
  102 + saveData(data);
  103 + };
  104 +
  105 + var toJson = function(){
  106 + var jsonHeaderArray = [];
  107 +
  108 + if(table.tHead){
  109 + for(var i =0,col; col = table.tHead.rows[0].cells[i]; i++){
  110 + jsonHeaderArray.push(getText(col));
  111 + }
  112 + }
  113 +
  114 + var jsonArray = [];
  115 + if(table.tBodies){
  116 + for(var j=0,tbody; tbody = table.tBodies[j]; j++){
  117 + for(var k =0, rowb; rowb= tbody.rows[k]; k++){
  118 + var len = jsonArray.length;
  119 + jsonArray[len] = [];
  120 + for (var g = 0, colb; colb = rowb.cells[g]; g++) {
  121 + jsonArray[len].push(getText(colb));
  122 + }
  123 + }
  124 + }
  125 + }
  126 +
  127 + var jsonExportArray = {
  128 + header: jsonHeaderArray,
  129 + data: jsonArray
  130 + };
  131 + saveData(JSON.stringify(jsonExportArray));
  132 + };
  133 +
  134 + var toOffice = function(){
  135 + var tmpl = '<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:'+type+'" xmlns="http://www.w3.org/TR/REC-html40">';
  136 + tmpl += '<head><meta charset="'+charSet+'" /><!--[if gte mso 9]><xml><x:ExcelWorkbook><x:ExcelWorksheets><x:ExcelWorksheet><x:Name>';
  137 + tmpl += '{worksheet}</x:Name><x:WorksheetOptions><x:DisplayGridlines/></x:WorksheetOptions></x:ExcelWorksheet></x:ExcelWorksheets></x:ExcelWorkbook></xml><![endif]-->';
  138 + tmpl += '</head><body><table>{table}</table></body></html>';
  139 + var office = '',
  140 + maph = [['<thead><tr>', '</tr></thead>'], ['<tbody><tr>', '</tr></tbody>'], ['<tr>', '</tr>']],
  141 + mapb = [['<th>', '</th>'],['<td>', '</td>']],
  142 + flag = +!table.tHead,
  143 + com = 1 - flag;
  144 +
  145 + for(var i=0, row; row = table.rows[i]; i++){
  146 + flag = i > com ? 2 : flag;
  147 + office += maph[flag][0];
  148 + for(var j =0, col; col = row.cells[j]; j++){
  149 + office += mapb[+!!flag][0]+ getText(col) +mapb[+!!flag][1];
  150 + }
  151 + office += maph[flag][1];
  152 + flag++;
  153 + }
  154 + saveData(template(tmpl, {worksheet: 'Worksheet', table: office}));
  155 + };
  156 +
  157 + var typeMap = {
  158 + json : toJson,
  159 + txt: toCSV,
  160 + csv: toCSV,
  161 + doc: toOffice,
  162 + docx: toOffice,
  163 + xls: toOffice,
  164 + xlsx: toOffice
  165 + };
  166 +
  167 + typeMap[type]();
  168 + };
  169 +
170 170 })(window);
171 171 \ No newline at end of file
... ...
src/main/resources/static/pages/scheduleApp/Gruntfile.js
... ... @@ -87,8 +87,10 @@ module.exports = function (grunt) {
87 87 'module/common/dts2/guideboardGroup/saGuideboardgroup.js', // 路牌选择整合指令
88 88 'module/common/dts2/employeeGroup/saEmployeegroup.js', // 人员选饿整合指令
89 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 94 'module/common/dts2/queryOption/saOrderOption.js', // saOrderoption指令,搜索时的排序选项(在搜索时可以使用,通用的)
93 95 'module/common/dts2/scheduleplan/saScpdate.js', // saScpdate指令(非通用指令,只在排班计划form中使用)
94 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 + // 内部班次时刻模型
  22 + self.internalBcModel = {
  23 + up_qdz_name : "", // 上行起点站名字
  24 + down_qdz_name : "", // 下行起点站名字
  25 + up_bc_list_asc : [], // 上行班次列表(按照发车时间升序)
  26 + down_bc_list_asc : [] // 下行班次列表(按照发车时间升序)
  27 + };
  28 +
  29 + // 内部各个路牌block车次链模型
  30 + self.internalLpBlockModel = {
  31 + // key:路牌名字
  32 + // value: 数组(按照发车时间排序)
  33 + // value 数据内对象 {fcsj:发车时间,isUp:是否上行,fcno:发车顺序号,index:对应的班次列表索引}
  34 + };
  35 +
  36 + // TODO:
  37 + },
  38 +
  39 + /**,
  40 + * compile阶段,angular还没有编译模版,根据需要可以修改模版dom
  41 + * @param tElem
  42 + * @param tAttrs
  43 + * @returns {{pre: Function, post: Function}}
  44 + */
  45 + compile : function(tElem, tAttrs) {
  46 + // 获取属性
  47 + var $attr_name = tAttrs["name"]; // 控件的名字
  48 + if (!$attr_name) {
  49 + throw new Error("saTimeTablePreview指令 name属性required");
  50 + }
  51 +
  52 + // 内部controlAs名字
  53 + var ctrlAs = "$saTimeTablePreviewCtrl";
  54 +
  55 + // TODO:
  56 +
  57 + //------------------ 内部方法 --------------------//
  58 + var date_wrap_prefix = "2000-01-01 "; // 包装日期的前缀
  59 + var date_wrap_format = "YYYY-MM-DD HH:mm"; // 日期格式
  60 + /**
  61 + * 将时间包装成日期,方便计算。
  62 + * @param timeStr 时间格式,如 06:30
  63 + * @returns moment对象
  64 + */
  65 + var _fun_WrapTime = function(timeStr) {
  66 + return moment(
  67 + date_wrap_prefix + timeStr,
  68 + date_wrap_format
  69 + );
  70 + };
  71 +
  72 + /**
  73 + * 点击班次html元素(dl),触发班次移动,如下:
  74 + * 1、点击上行班次,下一个下行班次在下行班次列表中移到中间位置
  75 + * 2、点击下行班次,下一个上行班次在上行班次列表中移到中间位置
  76 + * @param ctrl 内部控制器
  77 + * @param index 班次索引
  78 + * @param isUp 是否上行
  79 + * @private
  80 + */
  81 + var _fun_bcDDViewMove = function(ctrl, index, isUp) {
  82 + // 获取当前点击班次对象
  83 + var oBc;
  84 + if (isUp) {
  85 + oBc = ctrl.internalBcModel.up_bc_list_asc[index];
  86 + } else {
  87 + oBc = ctrl.internalBcModel.down_bc_list_asc[index];
  88 + }
  89 +
  90 + // 找出车次链中的下一个班次索引,没有就undefined
  91 + var nextIndex = undefined;
  92 + var nextBlockBc = undefined;
  93 + var currentBlockBcIndex = undefined;
  94 + angular.forEach(ctrl.internalLpBlockModel[oBc.lpName], function(data, i) {
  95 + if (data.fcsj == oBc.fcsj) {
  96 + currentBlockBcIndex = i;
  97 + }
  98 + });
  99 + if (currentBlockBcIndex != undefined &&
  100 + currentBlockBcIndex < (ctrl.internalLpBlockModel[oBc.lpName].length - 1)) {
  101 + nextBlockBc = ctrl.internalLpBlockModel[oBc.lpName][currentBlockBcIndex + 1];
  102 + nextIndex = nextBlockBc.index;
  103 + }
  104 + // 先删除click标记,再添加
  105 + angular.forEach(ctrl.internalBcModel.up_bc_list_asc, function(data) {
  106 + delete data["isClick"];
  107 + });
  108 + angular.forEach(ctrl.internalBcModel.down_bc_list_asc, function(data) {
  109 + delete data["isClick"];
  110 + });
  111 + oBc.isClick = true;
  112 + if (nextIndex) {
  113 + if (nextBlockBc.isUp) {
  114 + ctrl.internalBcModel.up_bc_list_asc[nextIndex].isClick = true;
  115 + } else {
  116 + ctrl.internalBcModel.down_bc_list_asc[nextIndex].isClick = true;
  117 + }
  118 + }
  119 +
  120 + // 移动,同方向不移动
  121 + var clientHeight = angular.element("#temp").height() - 34;
  122 + if (nextBlockBc && isUp != nextBlockBc.isUp) {
  123 + if (isUp) { // 移动下行
  124 + angular.element(".ttpv_table_scrollbar:eq(1)").animate(
  125 + {scrollTop : nextIndex * 30 - clientHeight / 2}, 400);
  126 + } else { // 移动上行
  127 + angular.element(".ttpv_table_scrollbar:eq(0)").animate(
  128 + {scrollTop : nextIndex * 30 - clientHeight / 2}, 400);
  129 + }
  130 + }
  131 +
  132 + };
  133 +
  134 + /**
  135 + * 刷新内部数据。
  136 + * @param ctrl 内部控制器对象($saTimeTablePreviewCtrl)
  137 + * @private
  138 + */
  139 + var _fun_refreshInternalModel = function(ctrl) {
  140 + // 初始化内部数据
  141 + ctrl.internalBcModel = {
  142 + up_qdz_name : "", // 上行起点站名字
  143 + up_zdz_name : "", // 上行终点站名字
  144 + down_qdz_name : "", // 下行起点站名字
  145 + down_zdz_name : "", // 下行终点站名字
  146 + up_bc_list_asc : [], // 上行班次列表(按照发车时间升序)
  147 + down_bc_list_asc : [] // 下行班次列表(按照发车时间升序)
  148 + };
  149 + ctrl.internalLpBlockModel = {
  150 +
  151 + };
  152 +
  153 + // ngModel传入的数据
  154 + var dataSource = ctrl.ds.bcList;
  155 +
  156 + // 构造上下行班次列表,并确定上下行的首发站点
  157 + angular.forEach(dataSource, function(bcObj) {
  158 + var _internalBcObj = {};
  159 + // 构造内部班次对象
  160 + _internalBcObj.lpName = bcObj.lp.lpName; // 路牌
  161 + _internalBcObj.fcsj = bcObj.fcsj; // 发车时间
  162 + _internalBcObj.ddsj = _fun_WrapTime(bcObj.fcsj).add(bcObj.bcsj, "m").format("HH:mm");
  163 + _internalBcObj.qdzName = bcObj.qdzName; // 起点站名字
  164 + _internalBcObj.zdzName = bcObj.zdzName; // 终点站名字
  165 + _internalBcObj.bcType = bcObj.bcType; // 班次类型
  166 + _internalBcObj.isTs = bcObj.isTS; // 是否停驶
  167 + _internalBcObj.isFb = bcObj.isFB; // 是否分班
  168 + _internalBcObj.remark = bcObj.remark; // 备注
  169 + _internalBcObj._fcno = bcObj.fcno; // 发车顺序号
  170 +
  171 + if (bcObj.xlDir == "0") { // 上行
  172 + ctrl.internalBcModel.up_bc_list_asc.push(_internalBcObj);
  173 + // 确定起点站
  174 + if (ctrl.internalBcModel.up_qdz_name == "") {
  175 + if (bcObj.bcType == "normal") {
  176 + ctrl.internalBcModel.up_qdz_name = bcObj.qdzName;
  177 + }
  178 + }
  179 + // 确定终点站
  180 + if (ctrl.internalBcModel.up_zdz_name == "") {
  181 + if (bcObj.bcType == "normal") {
  182 + ctrl.internalBcModel.up_zdz_name = bcObj.zdzName;
  183 + }
  184 + }
  185 + }
  186 + if (bcObj.xlDir == "1") { // 下行
  187 + ctrl.internalBcModel.down_bc_list_asc.push(_internalBcObj);
  188 + // 确定起点站
  189 + if (ctrl.internalBcModel.down_qdz_name == "") {
  190 + if (bcObj.bcType == "normal") {
  191 + ctrl.internalBcModel.down_qdz_name = bcObj.qdzName;
  192 + }
  193 + }
  194 + // 确定终点站
  195 + if (ctrl.internalBcModel.down_zdz_name == "") {
  196 + if (bcObj.bcType == "normal") {
  197 + ctrl.internalBcModel.down_zdz_name = bcObj.zdzName;
  198 + }
  199 + }
  200 + }
  201 +
  202 + });
  203 +
  204 + // 发车时间升序排序上行班次
  205 + ctrl.internalBcModel.up_bc_list_asc.sort(function(a, b) {
  206 + var a_wrapTime = _fun_WrapTime(a.fcsj);
  207 + var b_wrapTime = _fun_WrapTime(b.fcsj);
  208 +
  209 + // 判定如果发车时间是以00,01,02,03开头的,说明是下一天凌晨的班次,需要加1天判定
  210 + // TODO:以后要配合首班车的发车时间判定
  211 + if (a.fcsj.indexOf("00:") == 0 ||
  212 + a.fcsj.indexOf("01:") == 0 ||
  213 + a.fcsj.indexOf("02:") == 0) {
  214 + a_wrapTime.add(1, "day");
  215 + }
  216 + if (b.fcsj.indexOf("00:") == 0 ||
  217 + b.fcsj.indexOf("01:") == 0 ||
  218 + b.fcsj.indexOf("02:") == 0) {
  219 + b_wrapTime.add(1, "day");
  220 + }
  221 +
  222 + if (a_wrapTime.isBefore(b_wrapTime)) {
  223 + return -1;
  224 + } else if (a_wrapTime.isAfter(b_wrapTime)) {
  225 + return 1;
  226 + } else {
  227 + return 0;
  228 + }
  229 +
  230 + });
  231 + // 发车时间升序排序下行班次
  232 + ctrl.internalBcModel.down_bc_list_asc.sort(function(a, b) {
  233 + var a_wrapTime = _fun_WrapTime(a.fcsj);
  234 + var b_wrapTime = _fun_WrapTime(b.fcsj);
  235 +
  236 + // 判定如果发车时间是以00,01,02,03开头的,说明是下一天凌晨的班次,需要加1天判定
  237 + // TODO:以后要配合首班车的发车时间判定
  238 + if (a.fcsj.indexOf("00:") == 0 ||
  239 + a.fcsj.indexOf("01:") == 0 ||
  240 + a.fcsj.indexOf("02:") == 0) {
  241 + a_wrapTime.add(1, "day");
  242 + }
  243 + if (b.fcsj.indexOf("00:") == 0 ||
  244 + b.fcsj.indexOf("01:") == 0 ||
  245 + b.fcsj.indexOf("02:") == 0) {
  246 + b_wrapTime.add(1, "day");
  247 + }
  248 +
  249 + if (a_wrapTime.isBefore(b_wrapTime)) {
  250 + return -1;
  251 + } else if (a_wrapTime.isAfter(b_wrapTime)) {
  252 + return 1;
  253 + } else {
  254 + return 0;
  255 + }
  256 + });
  257 +
  258 + // 构造路牌block车次链,按照发车顺序排序
  259 + angular.forEach(ctrl.internalBcModel.up_bc_list_asc, function(data, index) {
  260 + if (!ctrl.internalLpBlockModel[data.lpName]) {
  261 + ctrl.internalLpBlockModel[data.lpName] = [];
  262 + }
  263 + ctrl.internalLpBlockModel[data.lpName].push({
  264 + fcsj : data.fcsj,
  265 + isUp : true,
  266 + fcno : data._fcno,
  267 + index : index
  268 + });
  269 + });
  270 + angular.forEach(ctrl.internalBcModel.down_bc_list_asc, function(data, index) {
  271 + if (!ctrl.internalLpBlockModel[data.lpName]) {
  272 + ctrl.internalLpBlockModel[data.lpName] = [];
  273 + }
  274 + ctrl.internalLpBlockModel[data.lpName].push({
  275 + fcsj : data.fcsj,
  276 + isUp : false,
  277 + fcno : data._fcno,
  278 + index : index
  279 + });
  280 + });
  281 + angular.forEach(ctrl.internalLpBlockModel, function(value, key) {
  282 + value.sort(function (a, b) {
  283 + if (a.fcno < b.fcno) {
  284 + return -1;
  285 + } else if (a.fcno > b.fcno) {
  286 + return 1;
  287 + } else {
  288 + return 0;
  289 + }
  290 + });
  291 + });
  292 +
  293 +
  294 + };
  295 +
  296 + return {
  297 + pre : function(scope, element, attr) {
  298 + // TODO:
  299 + },
  300 + post : function(scope, element, attr) {
  301 + // 班次html点击事件
  302 + scope[ctrlAs].$$bcDD_Click = function(index, xlDir) {
  303 + _fun_bcDDViewMove(scope[ctrlAs], index, xlDir);
  304 + };
  305 +
  306 + // 监控ngModel绑定的外部数据源的刷新状态变化
  307 + scope.$watch(
  308 + function() {
  309 + return scope[ctrlAs].ds.refreshInfos;
  310 + },
  311 + function(newValue, oldValue) {
  312 + if (newValue === undefined && oldValue === undefined) {
  313 + return;
  314 + }
  315 + console.log("saTimetable2 refresh");
  316 + _fun_refreshInternalModel(scope[ctrlAs]);
  317 + },
  318 + true
  319 + );
  320 + }
  321 + };
  322 + }
  323 + };
  324 + }
  325 + ]
  326 +);
0 327 \ 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: 34px;
  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 + cursor: default;
  78 + }
  79 + .ttpv_table dl {
  80 + font-size: 0;
  81 + white-space: nowrap;
  82 + }
  83 + .ttpv_table dl {
  84 + transition: all .1s ease;
  85 + }
  86 +
  87 + .ttpv_table dl dd, .ttpv_table dl dt {
  88 + display: inline-block;
  89 + white-space: nowrap;
  90 + overflow: hidden;
  91 + text-overflow: ellipsis;
  92 + height: 100%;
  93 + line-height: 34px;
  94 + border-right: 1px solid;
  95 + text-indent: 5px;
  96 + }
  97 + .ttpv_table dl dd, .ttpv_table dl dt {
  98 + border-right-color: #dedede;
  99 + font-size: 13px;
  100 + /*border-bottom: 1px solid #dedede;*/
  101 + border-top: 1px solid #dedede;
  102 + text-align: center;
  103 + }
  104 +
  105 + .ttpv_table > .ttpv_table_head {
  106 + position: absolute;
  107 + top: 0;
  108 + height: 34px;
  109 + background: #f5f5f5;
  110 + /*width: 100%;*/
  111 + line-height: 34px;
  112 + z-index: 1;
  113 + }
  114 + .ttpv_table_head dl {
  115 + border-bottom: 2px solid #96b9d7;
  116 + color: #333333;
  117 + height: 34px;
  118 + background-color: #f5f5f5;
  119 + }
  120 + .ttpv_table_head dl dt {
  121 + font-weight: normal;
  122 + font-size: 12px;
  123 + }
  124 +
  125 + .ttpv_table_head dl dt:nth-of-type(1) {
  126 + width: 50px;
  127 + height: 34px;
  128 + }
  129 + .ttpv_table_head dl dt:nth-of-type(2) {
  130 + width: 55px;
  131 + height: 34px;
  132 + }
  133 + .ttpv_table_head dl dt:nth-of-type(3) {
  134 + width: 120px;
  135 + height: 34px;
  136 + }
  137 + .ttpv_table_head dl dt:nth-of-type(4) {
  138 + width: 100px;
  139 + height: 34px;
  140 + }
  141 + .ttpv_table_head dl dt:nth-of-type(5) {
  142 + width: 200px;
  143 + height: 34px;
  144 + }
  145 +
  146 + .ttpv_table > .ttpv_table_body {
  147 + /*width: 100%;*/
  148 + position: absolute;
  149 + border-bottom: 1px solid #dedede;
  150 + }
  151 +
  152 + .ttpv_table_body dd.ists {
  153 + background: #105383 !important;
  154 + color: white !important;
  155 + }
  156 + .ttpv_table_body dd.region {
  157 + background: #686d7b !important;
  158 + color: white !important;
  159 + }
  160 + .ttpv_table_body dd.isfb {
  161 + background: #adff00 !important;
  162 + color: #501a1a !important;
  163 + }
  164 +
  165 + .ttpv_table_body dd.istsClick {
  166 + background: linear-gradient(to right,#8baabf,#105383,#808086)!important;
  167 + }
  168 + .ttpv_table_body dd.regionClick {
  169 + background: linear-gradient(to right,#8baabf,#686d7b,#a09997)!important;
  170 + }
  171 + .ttpv_table_body dd.isfbClick {
  172 + background: linear-gradient(to right,#8baabf,#adff00,#a09997)!important;
  173 + }
  174 +
  175 + .ttpv_table_body dl dd:nth-of-type(1) {
  176 + width: 50px;
  177 + height: 30px;
  178 + }
  179 + .ttpv_table_body dl dd:nth-of-type(2) {
  180 + width: 55px;
  181 + height: 30px;
  182 + }
  183 + .ttpv_table_body dl dd:nth-of-type(3) {
  184 + width: 120px;
  185 + height: 30px;
  186 + text-align: left;
  187 + }
  188 + .ttpv_table_body dl dd:nth-of-type(4) {
  189 + width: 100px;
  190 + height: 30px;
  191 + }
  192 + .ttpv_table_body dl dd:nth-of-type(5) {
  193 + width: 200px;
  194 + height: 30px;
  195 + }
  196 +
  197 + .ttpv_table_body dd:nth-of-type(1) {
  198 + color: #2765A7;
  199 + background: #eae8e8;
  200 + /*border-bottom: 1px solid #b3b3b3;*/
  201 + border-right: 1px solid #b3b3b3;
  202 + text-indent: -3px;
  203 + }
  204 + .ttpv_table_body dd:nth-of-type(n + 2) {
  205 + color: #2765A7;
  206 + }
  207 + .ttpv_table_body dl:hover {
  208 + box-shadow: 0 0 4px #656c71;
  209 + background: #f5fbff;
  210 + }
  211 + .ttpv_table_body dl:hover dd:nth-of-type(1) {
  212 + background: #fafafa;
  213 + background: linear-gradient(to right, #fafafa, #f5fbff);
  214 + }
  215 +
  216 + .isClick {
  217 + background: #8baabf!important;
  218 + color: #fff!important;
  219 + }
  220 +
  221 +</style>
  222 +
  223 +<style>
  224 + /** 滚动条css样式 */
  225 +
  226 + .ttpv_table_scrollbar::-webkit-scrollbar {
  227 + width: 18px;
  228 + height: 18px;
  229 + }
  230 +
  231 + .ttpv_table_scrollbar::-webkit-scrollbar-track, ::-webkit-scrollbar-thumb {
  232 + border-radius: 999px;
  233 + border: 5px solid transparent;
  234 + }
  235 +
  236 + .ttpv_table_scrollbar::-webkit-scrollbar-track {
  237 + box-shadow: 1px 1px 5px rgba(0, 0, 0, .2) inset;
  238 + }
  239 +
  240 + .ttpv_table_scrollbar::-webkit-scrollbar-thumb {
  241 + min-height: 20px;
  242 + background-clip: content-box;
  243 + box-shadow: 0 0 0 5px rgba(0, 0, 0, .2) inset;
  244 + }
  245 +
  246 + .ttpv_table_scrollbar::-webkit-scrollbar-corner {
  247 + background: transparent;
  248 + }
  249 +</style>
  250 +
  251 +<div class="ttpv_detail">
  252 + <div class="container-fluid top-container">
  253 + <div class="col-md-12 container-fluid">
  254 + <div class="col-md-6" style="height: 100%; padding-right: 3px;">
  255 + <div class="detail-panel">
  256 + <div class="detail-wrap" >
  257 + <h3 class="detail-title">
  258 + 上行:
  259 + {{$saTimeTablePreviewCtrl.internalBcModel.up_qdz_name}}
  260 + <i class="fa fa-angle-double-right" aria-hidden="true"></i>
  261 + {{$saTimeTablePreviewCtrl.internalBcModel.up_zdz_name}}
  262 + </h3>
  263 + <div id="temp" class="detail-body">
  264 + <div class="ttpv_table_wrap ttpv_table_scrollbar" sa-tscrolly2 scrclass = ".upFixHead">
  265 + <div class="ttpv_table">
  266 + <div class="ttpv_table_head upFixHead">
  267 + <dl>
  268 + <dt>序号</dt>
  269 + <dt>路牌</dt>
  270 + <dt>发车时间</dt>
  271 + <dt>到达时间</dt>
  272 + <dt>备注</dt>
  273 + </dl>
  274 + </div>
  275 + <div class="ttpv_table_body">
  276 + <dl ng-repeat="bc in $saTimeTablePreviewCtrl.internalBcModel.up_bc_list_asc track by $index"
  277 + ng-click="$saTimeTablePreviewCtrl.$$bcDD_Click($index, true)">
  278 + <dd>{{$index + 1}}</dd>
  279 + <dd ng-class="{isClick : bc.isClick}">
  280 + {{bc.lpName}}
  281 + </dd>
  282 + <dd ng-class="{
  283 + ists: (bc.isTs && !bc.isClick),
  284 + istsClick: (bc.isTs && bc.isClick),
  285 + region: (bc.bcType == 'region' && !bc.isClick),
  286 + regionClick : (bc.bcType == 'region' && bc.isClick),
  287 + isfb: (bc.isFb && !bc.isClick),
  288 + isfbClick : (bc.isFb && bc.isClick),
  289 + isClick: bc.isClick}">
  290 + {{bc.fcsj}}
  291 + <span class="badge"
  292 + style="border-radius: 2px !important; background-color: #f9a124;"
  293 + ng-show="bc.bcType == 'out'">出场</span>
  294 + <span class="badge"
  295 + style="border-radius: 2px !important; background-color: #f9a124;"
  296 + ng-show="bc.bcType == 'in'">进场</span>
  297 + </dd>
  298 + <dd ng-class="{isClick : bc.isClick}">
  299 + {{bc.ddsj}}
  300 + </dd>
  301 + <dd ng-class="{isClick : bc.isClick}">{{bc.remark}}</dd>
  302 + </dl>
  303 + </div>
  304 + </div>
  305 + </div>
  306 + </div>
  307 + </div>
  308 + </div>
  309 + </div>
  310 +
  311 + <div class="col-md-6" style="height: 100%; padding-left: 3px;">
  312 + <div class="detail-panel">
  313 + <div class="detail-wrap" >
  314 + <h3 class="detail-title">
  315 + 下行:
  316 + {{$saTimeTablePreviewCtrl.internalBcModel.down_qdz_name}}
  317 + <i class="fa fa-angle-double-right" aria-hidden="true"></i>
  318 + {{$saTimeTablePreviewCtrl.internalBcModel.down_zdz_name}}
  319 + </h3>
  320 + <div class="detail-body">
  321 + <div class="ttpv_table_wrap ttpv_table_scrollbar" sa-tscrolly2 scrclass = ".downFixHead">
  322 + <div class="ttpv_table">
  323 + <div class="ttpv_table_head downFixHead">
  324 + <dl>
  325 + <dt>序号</dt>
  326 + <dt>路牌</dt>
  327 + <dt>发车时间</dt>
  328 + <dt>到达时间</dt>
  329 + <dt>备注</dt>
  330 + </dl>
  331 + </div>
  332 + <div class="ttpv_table_body">
  333 + <dl ng-repeat="bc in $saTimeTablePreviewCtrl.internalBcModel.down_bc_list_asc track by $index"
  334 + ng-click="$saTimeTablePreviewCtrl.$$bcDD_Click($index, false)">
  335 + <dd>{{$index + 1}}</dd>
  336 + <dd ng-class="{isClick : bc.isClick}">
  337 + {{bc.lpName}}
  338 + </dd>
  339 + <dd ng-class="{
  340 + ists: (bc.isTs && !bc.isClick),
  341 + istsClick: (bc.isTs && bc.isClick),
  342 + region: (bc.bcType == 'region' && !bc.isClick),
  343 + regionClick : (bc.bcType == 'region' && bc.isClick),
  344 + isfb: (bc.isFb && !bc.isClick),
  345 + isfbClick : (bc.isFb && bc.isClick),
  346 + isClick: bc.isClick}">
  347 + {{bc.fcsj}}
  348 + <span class="badge"
  349 + style="border-radius: 2px !important; background-color: #f9a124;"
  350 + ng-show="bc.bcType == 'out'">出场</span>
  351 + <span class="badge"
  352 + style="border-radius: 2px !important; background-color: #f9a124;"
  353 + ng-show="bc.bcType == 'in'">进场</span>
  354 + </dd>
  355 + <dd ng-class="{isClick : bc.isClick}">
  356 + {{bc.ddsj}}
  357 + </dd>
  358 + <dd ng-class="{isClick : bc.isClick}">{{bc.remark}}</dd>
  359 + </dl>
  360 + </div>
  361 + </div>
  362 + </div>
  363 + </div>
  364 + </div>
  365 + </div>
  366 + </div>
  367 +
  368 + </div>
  369 + </div>
  370 +</div>
  371 +
  372 +
  373 +
  374 +
  375 +
  376 +
  377 +
  378 +
  379 +
  380 +
  381 +
... ...
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 45 \ No newline at end of file
... ...
src/main/resources/static/pages/scheduleApp/module/common/prj-common-directive.js
... ... @@ -4407,216 +4407,326 @@ angular.module(&#39;ScheduleApp&#39;).directive(
4407 4407 ]
4408 4408 );
4409 4409  
4410   -/**
4411   - * 滚动事件控制指令。
4412   - */
4413   -angular.module('ScheduleApp').directive(
4414   - 'saTscrolly1',
4415   - [
4416   - function() {
4417   - return {
4418   - restrict: 'A',
4419   -
4420   - compile: function(tElem, tAttrs) {
4421   -
4422   - return {
4423   - pre: function(scope, element, attr) {
4424   - // TODO:
4425   - //alert(element.find("#tooltipTest").html());
4426   - //$compile(element.find("#tooltipTest"))(scope);
4427   -
4428   - },
4429   -
4430   - post: function(scope, element, attr) {
4431   - //var head = element[0];
4432   -
4433   - //console.log("llllllllload");
4434   - //console.log(element.name);
4435   -
4436   - element.bind('scroll', function() {
4437   - //console.log("top=", angular.element(".tt_table_head").css("top"));
4438   - //console.log("left=", angular.element(".tt_table_head").css("left"));
4439   - //console.log("s top=" + element.scrollTop());
4440   -
4441   - angular.element(".tt_table_head").css("top", element.scrollTop());
4442   - angular.element(".tt_table_head:eq(0)").css("left", element.scrollLeft());
4443   - angular.element(".tt_table_body:eq(0)").css("left", element.scrollLeft());
4444   -
4445   - });
4446   - }
4447   -
4448   - };
4449   - }
4450   - }
4451   - }
4452   - ]
4453   -);
4454 4410 /**
4455   - * saOrderoption指令,搜索时的排序选项(在搜索时可以使用,通用的)
4456   - * 属性如下:
4457   - * name(必须):控件的名字
4458   - * columns(必须,独立作用域):字段名字列表,格式:[{name:[字段名],desc:[字段描述]}...]
4459   - * ordercolumns(必须,独立作用域):字段排序列表,格式:{order: '字段1,字段2',direction: 'ASC,DESC'}
  4411 + * saTimetablePreview指令,时刻表预览模式视图。
4460 4412 */
4461   -angular.module('ScheduleApp').directive(
4462   - 'saOrderoption',
  4413 +angular.module("ScheduleApp").directive(
  4414 + "saTimetable2",
4463 4415 [
4464   - function() {
  4416 + '$timeout',
  4417 + function($timeout) {
4465 4418 return {
4466   - restrict: 'E',
4467   - templateUrl: '/pages/scheduleApp/module/common/dts2/queryOption/saOrderOptionTemplate.html',
4468   - scope: {
4469   - columns: '=',
4470   - ordercolumns: '='
  4419 + restrict : 'E',
  4420 + templateUrl : '/pages/scheduleApp/module/common/dts2/ttinfotable/saTimeTablePreViewTemplate.html',
  4421 + scope : { // 独立作用域
  4422 + // 使用外部数据源,内部重新组合显示
  4423 + ds : "=ngModel"
4471 4424 },
4472   - controllerAs: '$saOrderOptionCtrl',
  4425 + controllerAs : "$saTimeTablePreviewCtrl",
4473 4426 bindToController: true,
4474   - controller: function() {
  4427 + controller : function() {
4475 4428 var self = this;
4476 4429  
4477   - // 字段列表是否预载入
4478   - self.$$columns_loaded = false;
4479   - // 字段排序是否预载入
4480   - self.$$ordercolumns_loaded = false;
  4430 + // 内部班次时刻模型
  4431 + self.internalBcModel = {
  4432 + up_qdz_name : "", // 上行起点站名字
  4433 + down_qdz_name : "", // 下行起点站名字
  4434 + up_bc_list_asc : [], // 上行班次列表(按照发车时间升序)
  4435 + down_bc_list_asc : [] // 下行班次列表(按照发车时间升序)
  4436 + };
4481 4437  
  4438 + // 内部各个路牌block车次链模型
  4439 + self.internalLpBlockModel = {
  4440 + // key:路牌名字
  4441 + // value: 数组(按照发车时间排序)
  4442 + // value 数据内对象 {fcsj:发车时间,isUp:是否上行,fcno:发车顺序号,index:对应的班次列表索引}
  4443 + };
4482 4444  
4483   - // 每组选项内部数据源
4484   - // 格式:[{column:[选中的字段名],dir:[ASC/DESC]}]
4485   - self.$$selectgroupds = [];
  4445 + // TODO:
  4446 + },
4486 4447  
4487   - // TODO:选择事件
  4448 + /**,
  4449 + * compile阶段,angular还没有编译模版,根据需要可以修改模版dom
  4450 + * @param tElem
  4451 + * @param tAttrs
  4452 + * @returns {{pre: Function, post: Function}}
  4453 + */
  4454 + compile : function(tElem, tAttrs) {
  4455 + // 获取属性
  4456 + var $attr_name = tAttrs["name"]; // 控件的名字
  4457 + if (!$attr_name) {
  4458 + throw new Error("saTimeTablePreview指令 name属性required");
  4459 + }
4488 4460  
4489   - self.$$select_column_change = function() {
4490   - self.$$refresh_selectgroupds();
4491   - };
  4461 + // 内部controlAs名字
  4462 + var ctrlAs = "$saTimeTablePreviewCtrl";
4492 4463  
4493   - self.$$select_dir_change = function() {
4494   - self.$$refresh_selectgroupds();
4495   - };
  4464 + // TODO:
4496 4465  
4497   - self.$$add_option_click = function(index) {
4498   - self.$$selectgroupds.splice(index, 0, {
4499   - column: self.columns[0].name,
4500   - dir: "ASC"
4501   - });
4502   - self.$$refresh_selectgroupds();
4503   - };
4504   - self.$$del_option_click = function(index) {
4505   - self.$$selectgroupds.splice(index, 1);
4506   - self.$$refresh_selectgroupds();
  4466 + //------------------ 内部方法 --------------------//
  4467 + var date_wrap_prefix = "2000-01-01 "; // 包装日期的前缀
  4468 + var date_wrap_format = "YYYY-MM-DD HH:mm"; // 日期格式
  4469 + /**
  4470 + * 将时间包装成日期,方便计算。
  4471 + * @param timeStr 时间格式,如 06:30
  4472 + * @returns moment对象
  4473 + */
  4474 + var _fun_WrapTime = function(timeStr) {
  4475 + return moment(
  4476 + date_wrap_prefix + timeStr,
  4477 + date_wrap_format
  4478 + );
4507 4479 };
4508 4480  
4509   - // 刷新选项内部数据源
4510   - self.$$refresh_selectgroupds = function() {
4511   - if (!self.$$columns_loaded || !self.$$ordercolumns_loaded || self.columns.length == 0) {
4512   - // 没有载入完成,或者字段列表为空
4513   - return;
  4481 + /**
  4482 + * 点击班次html元素(dl),触发班次移动,如下:
  4483 + * 1、点击上行班次,下一个下行班次在下行班次列表中移到中间位置
  4484 + * 2、点击下行班次,下一个上行班次在上行班次列表中移到中间位置
  4485 + * @param ctrl 内部控制器
  4486 + * @param index 班次索引
  4487 + * @param isUp 是否上行
  4488 + * @private
  4489 + */
  4490 + var _fun_bcDDViewMove = function(ctrl, index, isUp) {
  4491 + // 获取当前点击班次对象
  4492 + var oBc;
  4493 + if (isUp) {
  4494 + oBc = ctrl.internalBcModel.up_bc_list_asc[index];
  4495 + } else {
  4496 + oBc = ctrl.internalBcModel.down_bc_list_asc[index];
4514 4497 }
4515 4498  
4516   - if (self.$$selectgroupds.length == 0) { // 默认添加一组排序
4517   - self.$$selectgroupds.push({
4518   - column: self.columns[0].name,
4519   - dir: "ASC"
4520   - });
  4499 + // 找出车次链中的下一个班次索引,没有就undefined
  4500 + var nextIndex = undefined;
  4501 + var nextBlockBc = undefined;
  4502 + var currentBlockBcIndex = undefined;
  4503 + angular.forEach(ctrl.internalLpBlockModel[oBc.lpName], function(data, i) {
  4504 + if (data.fcsj == oBc.fcsj) {
  4505 + currentBlockBcIndex = i;
  4506 + }
  4507 + });
  4508 + if (currentBlockBcIndex != undefined &&
  4509 + currentBlockBcIndex < (ctrl.internalLpBlockModel[oBc.lpName].length - 1)) {
  4510 + nextBlockBc = ctrl.internalLpBlockModel[oBc.lpName][currentBlockBcIndex + 1];
  4511 + nextIndex = nextBlockBc.index;
4521 4512 }
4522   -
4523   - // 重新计算ordercolumns
4524   -
4525   - var aColumn = [];
4526   - var aDir = [];
4527   - for (var i = 0; i < self.$$selectgroupds.length; i++) {
4528   - aColumn.push(self.$$selectgroupds[i].column);
4529   - aDir.push(self.$$selectgroupds[i].dir);
  4513 + // 先删除click标记,再添加
  4514 + angular.forEach(ctrl.internalBcModel.up_bc_list_asc, function(data) {
  4515 + delete data["isClick"];
  4516 + });
  4517 + angular.forEach(ctrl.internalBcModel.down_bc_list_asc, function(data) {
  4518 + delete data["isClick"];
  4519 + });
  4520 + oBc.isClick = true;
  4521 + if (nextIndex) {
  4522 + if (nextBlockBc.isUp) {
  4523 + ctrl.internalBcModel.up_bc_list_asc[nextIndex].isClick = true;
  4524 + } else {
  4525 + ctrl.internalBcModel.down_bc_list_asc[nextIndex].isClick = true;
  4526 + }
4530 4527 }
4531   - if (self.ordercolumns) {
4532   - self.ordercolumns.order = aColumn.join(",");
4533   - self.ordercolumns.direction = aDir.join(",");
4534   - } else {
4535   - self.ordercolumns = {order: aColumn.join(","), direction: aDir.join(",")}
  4528 +
  4529 + // 移动,同方向不移动
  4530 + var clientHeight = angular.element("#temp").height() - 34;
  4531 + if (nextBlockBc && isUp != nextBlockBc.isUp) {
  4532 + if (isUp) { // 移动下行
  4533 + angular.element(".ttpv_table_scrollbar:eq(1)").animate(
  4534 + {scrollTop : nextIndex * 30 - clientHeight / 2}, 400);
  4535 + } else { // 移动上行
  4536 + angular.element(".ttpv_table_scrollbar:eq(0)").animate(
  4537 + {scrollTop : nextIndex * 30 - clientHeight / 2}, 400);
  4538 + }
4536 4539 }
4537 4540  
4538   - }
4539   - },
4540   - compile: function(tElem, tAttrs) {
4541   - // 获取所有属性,并验证
4542   - var $name_attr = tAttrs['name']; // 控件的名字
4543   - if (!$name_attr) {
4544   - throw "必须有名称属性";
4545   - }
  4541 + };
4546 4542  
4547   - // controlAs名字
4548   - var ctrlAs = '$saOrderOptionCtrl';
  4543 + /**
  4544 + * 刷新内部数据。
  4545 + * @param ctrl 内部控制器对象($saTimeTablePreviewCtrl)
  4546 + * @private
  4547 + */
  4548 + var _fun_refreshInternalModel = function(ctrl) {
  4549 + // 初始化内部数据
  4550 + ctrl.internalBcModel = {
  4551 + up_qdz_name : "", // 上行起点站名字
  4552 + up_zdz_name : "", // 上行终点站名字
  4553 + down_qdz_name : "", // 下行起点站名字
  4554 + down_zdz_name : "", // 下行终点站名字
  4555 + up_bc_list_asc : [], // 上行班次列表(按照发车时间升序)
  4556 + down_bc_list_asc : [] // 下行班次列表(按照发车时间升序)
  4557 + };
  4558 + ctrl.internalLpBlockModel = {
4549 4559  
4550   - // TODO:
  4560 + };
4551 4561  
  4562 + // ngModel传入的数据
  4563 + var dataSource = ctrl.ds.bcList;
4552 4564  
  4565 + // 构造上下行班次列表,并确定上下行的首发站点
  4566 + angular.forEach(dataSource, function(bcObj) {
  4567 + var _internalBcObj = {};
  4568 + // 构造内部班次对象
  4569 + _internalBcObj.lpName = bcObj.lp.lpName; // 路牌
  4570 + _internalBcObj.fcsj = bcObj.fcsj; // 发车时间
  4571 + _internalBcObj.ddsj = _fun_WrapTime(bcObj.fcsj).add(bcObj.bcsj, "m").format("HH:mm");
  4572 + _internalBcObj.qdzName = bcObj.qdzName; // 起点站名字
  4573 + _internalBcObj.zdzName = bcObj.zdzName; // 终点站名字
  4574 + _internalBcObj.bcType = bcObj.bcType; // 班次类型
  4575 + _internalBcObj.isTs = bcObj.isTS; // 是否停驶
  4576 + _internalBcObj.isFb = bcObj.isFB; // 是否分班
  4577 + _internalBcObj.remark = bcObj.remark; // 备注
  4578 + _internalBcObj._fcno = bcObj.fcno; // 发车顺序号
4553 4579  
4554   - return {
4555   - pre: function(scope, element, attr) {
  4580 + if (bcObj.xlDir == "0") { // 上行
  4581 + ctrl.internalBcModel.up_bc_list_asc.push(_internalBcObj);
  4582 + // 确定起点站
  4583 + if (ctrl.internalBcModel.up_qdz_name == "") {
  4584 + if (bcObj.bcType == "normal") {
  4585 + ctrl.internalBcModel.up_qdz_name = bcObj.qdzName;
  4586 + }
  4587 + }
  4588 + // 确定终点站
  4589 + if (ctrl.internalBcModel.up_zdz_name == "") {
  4590 + if (bcObj.bcType == "normal") {
  4591 + ctrl.internalBcModel.up_zdz_name = bcObj.zdzName;
  4592 + }
  4593 + }
  4594 + }
  4595 + if (bcObj.xlDir == "1") { // 下行
  4596 + ctrl.internalBcModel.down_bc_list_asc.push(_internalBcObj);
  4597 + // 确定起点站
  4598 + if (ctrl.internalBcModel.down_qdz_name == "") {
  4599 + if (bcObj.bcType == "normal") {
  4600 + ctrl.internalBcModel.down_qdz_name = bcObj.qdzName;
  4601 + }
  4602 + }
  4603 + // 确定终点站
  4604 + if (ctrl.internalBcModel.down_zdz_name == "") {
  4605 + if (bcObj.bcType == "normal") {
  4606 + ctrl.internalBcModel.down_zdz_name = bcObj.zdzName;
  4607 + }
  4608 + }
  4609 + }
4556 4610  
4557   - },
  4611 + });
4558 4612  
4559   - post: function(scope, element, attr) {
  4613 + // 发车时间升序排序上行班次
  4614 + ctrl.internalBcModel.up_bc_list_asc.sort(function(a, b) {
  4615 + var a_wrapTime = _fun_WrapTime(a.fcsj);
  4616 + var b_wrapTime = _fun_WrapTime(b.fcsj);
4560 4617  
4561   - //--------------------- 监控属性方法 -------------------//
4562   - // 监控字段名字列表
4563   - scope.$watch(
4564   - function() {
4565   - return scope[ctrlAs].columns;
4566   - },
4567   - function(newValue, oldValue) {
4568   - if (!scope[ctrlAs].$$columns_loaded) {
4569   - // TODO:格式判定以后做,假设格式是对的
  4618 + // 判定如果发车时间是以00,01,02,03开头的,说明是下一天凌晨的班次,需要加1天判定
  4619 + // TODO:以后要配合首班车的发车时间判定
  4620 + if (a.fcsj.indexOf("00:") == 0 ||
  4621 + a.fcsj.indexOf("01:") == 0 ||
  4622 + a.fcsj.indexOf("02:") == 0) {
  4623 + a_wrapTime.add(1, "day");
  4624 + }
  4625 + if (b.fcsj.indexOf("00:") == 0 ||
  4626 + b.fcsj.indexOf("01:") == 0 ||
  4627 + b.fcsj.indexOf("02:") == 0) {
  4628 + b_wrapTime.add(1, "day");
  4629 + }
4570 4630  
  4631 + if (a_wrapTime.isBefore(b_wrapTime)) {
  4632 + return -1;
  4633 + } else if (a_wrapTime.isAfter(b_wrapTime)) {
  4634 + return 1;
  4635 + } else {
  4636 + return 0;
  4637 + }
4571 4638  
4572   - }
  4639 + });
  4640 + // 发车时间升序排序下行班次
  4641 + ctrl.internalBcModel.down_bc_list_asc.sort(function(a, b) {
  4642 + var a_wrapTime = _fun_WrapTime(a.fcsj);
  4643 + var b_wrapTime = _fun_WrapTime(b.fcsj);
4573 4644  
4574   - scope[ctrlAs].$$columns_loaded = true;
4575   - scope[ctrlAs].$$refresh_selectgroupds();
4576   - },
4577   - true
4578   - );
4579   - // 监控字段排序列表
  4645 + // 判定如果发车时间是以00,01,02,03开头的,说明是下一天凌晨的班次,需要加1天判定
  4646 + // TODO:以后要配合首班车的发车时间判定
  4647 + if (a.fcsj.indexOf("00:") == 0 ||
  4648 + a.fcsj.indexOf("01:") == 0 ||
  4649 + a.fcsj.indexOf("02:") == 0) {
  4650 + a_wrapTime.add(1, "day");
  4651 + }
  4652 + if (b.fcsj.indexOf("00:") == 0 ||
  4653 + b.fcsj.indexOf("01:") == 0 ||
  4654 + b.fcsj.indexOf("02:") == 0) {
  4655 + b_wrapTime.add(1, "day");
  4656 + }
  4657 +
  4658 + if (a_wrapTime.isBefore(b_wrapTime)) {
  4659 + return -1;
  4660 + } else if (a_wrapTime.isAfter(b_wrapTime)) {
  4661 + return 1;
  4662 + } else {
  4663 + return 0;
  4664 + }
  4665 + });
  4666 +
  4667 + // 构造路牌block车次链,按照发车顺序排序
  4668 + angular.forEach(ctrl.internalBcModel.up_bc_list_asc, function(data, index) {
  4669 + if (!ctrl.internalLpBlockModel[data.lpName]) {
  4670 + ctrl.internalLpBlockModel[data.lpName] = [];
  4671 + }
  4672 + ctrl.internalLpBlockModel[data.lpName].push({
  4673 + fcsj : data.fcsj,
  4674 + isUp : true,
  4675 + fcno : data._fcno,
  4676 + index : index
  4677 + });
  4678 + });
  4679 + angular.forEach(ctrl.internalBcModel.down_bc_list_asc, function(data, index) {
  4680 + if (!ctrl.internalLpBlockModel[data.lpName]) {
  4681 + ctrl.internalLpBlockModel[data.lpName] = [];
  4682 + }
  4683 + ctrl.internalLpBlockModel[data.lpName].push({
  4684 + fcsj : data.fcsj,
  4685 + isUp : false,
  4686 + fcno : data._fcno,
  4687 + index : index
  4688 + });
  4689 + });
  4690 + angular.forEach(ctrl.internalLpBlockModel, function(value, key) {
  4691 + value.sort(function (a, b) {
  4692 + if (a.fcno < b.fcno) {
  4693 + return -1;
  4694 + } else if (a.fcno > b.fcno) {
  4695 + return 1;
  4696 + } else {
  4697 + return 0;
  4698 + }
  4699 + });
  4700 + });
  4701 +
  4702 +
  4703 + };
  4704 +
  4705 + return {
  4706 + pre : function(scope, element, attr) {
  4707 + // TODO:
  4708 + },
  4709 + post : function(scope, element, attr) {
  4710 + // 班次html点击事件
  4711 + scope[ctrlAs].$$bcDD_Click = function(index, xlDir) {
  4712 + _fun_bcDDViewMove(scope[ctrlAs], index, xlDir);
  4713 + };
  4714 +
  4715 + // 监控ngModel绑定的外部数据源的刷新状态变化
4580 4716 scope.$watch(
4581 4717 function() {
4582   - return scope[ctrlAs].ordercolumns;
  4718 + return scope[ctrlAs].ds.refreshInfos;
4583 4719 },
4584 4720 function(newValue, oldValue) {
4585   - if (!scope[ctrlAs].$$ordercolumns_loaded) {
4586   - if (newValue) {
4587   - var aColumns = []; // 排序的字段
4588   - var aDirs = []; // 排序字段对应的排序方向
4589   -
4590   - if (newValue.order) {
4591   - aColumns = newValue.order.split(",");
4592   - }
4593   - if (newValue.direction) {
4594   - aDirs = newValue.direction.split(",");
4595   - }
4596   -
4597   - for (var i = 0; i < aColumns.length; i++) {
4598   - if (i < aDirs.length) {
4599   - scope[ctrlAs].$$selectgroupds.push({
4600   - column: aColumns[i],
4601   - dir: aDirs[i]
4602   - });
4603   - } else {
4604   - scope[ctrlAs].$$selectgroupds.push({
4605   - column: aColumns[i],
4606   - dir: 'ASC'
4607   - });
4608   - }
4609   - }
4610   - }
  4721 + if (newValue === undefined && oldValue === undefined) {
  4722 + return;
4611 4723 }
4612   - scope[ctrlAs].$$ordercolumns_loaded = true;
4613   - scope[ctrlAs].$$refresh_selectgroupds();
4614   -
  4724 + console.log("saTimetable2 refresh");
  4725 + _fun_refreshInternalModel(scope[ctrlAs]);
4615 4726 },
4616 4727 true
4617 4728 );
4618 4729 }
4619   -
4620 4730 };
4621 4731 }
4622 4732 };
... ... @@ -4624,6 +4734,266 @@ angular.module(&#39;ScheduleApp&#39;).directive(
4624 4734 ]
4625 4735 );
4626 4736 /**
  4737 + * 滚动事件控制指令。
  4738 + */
  4739 +angular.module('ScheduleApp').directive(
  4740 + 'saTscrolly1',
  4741 + [
  4742 + function() {
  4743 + return {
  4744 + restrict: 'A',
  4745 +
  4746 + compile: function(tElem, tAttrs) {
  4747 +
  4748 + return {
  4749 + pre: function(scope, element, attr) {
  4750 + // TODO:
  4751 + //alert(element.find("#tooltipTest").html());
  4752 + //$compile(element.find("#tooltipTest"))(scope);
  4753 +
  4754 + },
  4755 +
  4756 + post: function(scope, element, attr) {
  4757 + //var head = element[0];
  4758 +
  4759 + //console.log("llllllllload");
  4760 + //console.log(element.name);
  4761 +
  4762 + element.bind('scroll', function() {
  4763 + //console.log("top=", angular.element(".tt_table_head").css("top"));
  4764 + //console.log("left=", angular.element(".tt_table_head").css("left"));
  4765 + //console.log("s top=" + element.scrollTop());
  4766 +
  4767 + angular.element(".tt_table_head").css("top", element.scrollTop());
  4768 + angular.element(".tt_table_head:eq(0)").css("left", element.scrollLeft());
  4769 + angular.element(".tt_table_body:eq(0)").css("left", element.scrollLeft());
  4770 +
  4771 + });
  4772 + }
  4773 +
  4774 + };
  4775 + }
  4776 + }
  4777 + }
  4778 + ]
  4779 +);
  4780 +/**
  4781 + * 滚动事件控制指令。
  4782 + */
  4783 +angular.module('ScheduleApp').directive(
  4784 + 'saTscrolly2',
  4785 + [
  4786 + function() {
  4787 + return {
  4788 + restrict: 'A',
  4789 +
  4790 + compile: function(tElem, tAttrs) {
  4791 +
  4792 + return {
  4793 + pre: function(scope, element, attr) {
  4794 + // TODO:
  4795 + //alert(element.find("#tooltipTest").html());
  4796 + //$compile(element.find("#tooltipTest"))(scope);
  4797 +
  4798 + },
  4799 +
  4800 + post: function(scope, element, attr) {
  4801 + //var head = element[0];
  4802 +
  4803 + //console.log("llllllllload");
  4804 + //console.log(element.name);
  4805 +
  4806 + element.bind('scroll', function() {
  4807 + //console.log("top=", angular.element(".tt_table_head").css("top"));
  4808 + //console.log("left=", angular.element(".tt_table_head").css("left"));
  4809 + //console.log("s top=" + element.scrollTop());
  4810 +
  4811 + angular.element(attr.scrclass).css("top", element.scrollTop());
  4812 + // angular.element(".tt_table_head:eq(0)").css("left", element.scrollLeft());
  4813 + // angular.element(".tt_table_body:eq(0)").css("left", element.scrollLeft());
  4814 +
  4815 + });
  4816 + }
  4817 +
  4818 + };
  4819 + }
  4820 + }
  4821 + }
  4822 + ]
  4823 +);
  4824 +/**
  4825 + * saOrderoption指令,搜索时的排序选项(在搜索时可以使用,通用的)
  4826 + * 属性如下:
  4827 + * name(必须):控件的名字
  4828 + * columns(必须,独立作用域):字段名字列表,格式:[{name:[字段名],desc:[字段描述]}...]
  4829 + * ordercolumns(必须,独立作用域):字段排序列表,格式:{order: '字段1,字段2',direction: 'ASC,DESC'}
  4830 + */
  4831 +angular.module('ScheduleApp').directive(
  4832 + 'saOrderoption',
  4833 + [
  4834 + function() {
  4835 + return {
  4836 + restrict: 'E',
  4837 + templateUrl: '/pages/scheduleApp/module/common/dts2/queryOption/saOrderOptionTemplate.html',
  4838 + scope: {
  4839 + columns: '=',
  4840 + ordercolumns: '='
  4841 + },
  4842 + controllerAs: '$saOrderOptionCtrl',
  4843 + bindToController: true,
  4844 + controller: function() {
  4845 + var self = this;
  4846 +
  4847 + // 字段列表是否预载入
  4848 + self.$$columns_loaded = false;
  4849 + // 字段排序是否预载入
  4850 + self.$$ordercolumns_loaded = false;
  4851 +
  4852 +
  4853 + // 每组选项内部数据源
  4854 + // 格式:[{column:[选中的字段名],dir:[ASC/DESC]}]
  4855 + self.$$selectgroupds = [];
  4856 +
  4857 + // TODO:选择事件
  4858 +
  4859 + self.$$select_column_change = function() {
  4860 + self.$$refresh_selectgroupds();
  4861 + };
  4862 +
  4863 + self.$$select_dir_change = function() {
  4864 + self.$$refresh_selectgroupds();
  4865 + };
  4866 +
  4867 + self.$$add_option_click = function(index) {
  4868 + self.$$selectgroupds.splice(index, 0, {
  4869 + column: self.columns[0].name,
  4870 + dir: "ASC"
  4871 + });
  4872 + self.$$refresh_selectgroupds();
  4873 + };
  4874 + self.$$del_option_click = function(index) {
  4875 + self.$$selectgroupds.splice(index, 1);
  4876 + self.$$refresh_selectgroupds();
  4877 + };
  4878 +
  4879 + // 刷新选项内部数据源
  4880 + self.$$refresh_selectgroupds = function() {
  4881 + if (!self.$$columns_loaded || !self.$$ordercolumns_loaded || self.columns.length == 0) {
  4882 + // 没有载入完成,或者字段列表为空
  4883 + return;
  4884 + }
  4885 +
  4886 + if (self.$$selectgroupds.length == 0) { // 默认添加一组排序
  4887 + self.$$selectgroupds.push({
  4888 + column: self.columns[0].name,
  4889 + dir: "ASC"
  4890 + });
  4891 + }
  4892 +
  4893 + // 重新计算ordercolumns
  4894 +
  4895 + var aColumn = [];
  4896 + var aDir = [];
  4897 + for (var i = 0; i < self.$$selectgroupds.length; i++) {
  4898 + aColumn.push(self.$$selectgroupds[i].column);
  4899 + aDir.push(self.$$selectgroupds[i].dir);
  4900 + }
  4901 + if (self.ordercolumns) {
  4902 + self.ordercolumns.order = aColumn.join(",");
  4903 + self.ordercolumns.direction = aDir.join(",");
  4904 + } else {
  4905 + self.ordercolumns = {order: aColumn.join(","), direction: aDir.join(",")}
  4906 + }
  4907 +
  4908 + }
  4909 + },
  4910 + compile: function(tElem, tAttrs) {
  4911 + // 获取所有属性,并验证
  4912 + var $name_attr = tAttrs['name']; // 控件的名字
  4913 + if (!$name_attr) {
  4914 + throw "必须有名称属性";
  4915 + }
  4916 +
  4917 + // controlAs名字
  4918 + var ctrlAs = '$saOrderOptionCtrl';
  4919 +
  4920 + // TODO:
  4921 +
  4922 +
  4923 +
  4924 + return {
  4925 + pre: function(scope, element, attr) {
  4926 +
  4927 + },
  4928 +
  4929 + post: function(scope, element, attr) {
  4930 +
  4931 + //--------------------- 监控属性方法 -------------------//
  4932 + // 监控字段名字列表
  4933 + scope.$watch(
  4934 + function() {
  4935 + return scope[ctrlAs].columns;
  4936 + },
  4937 + function(newValue, oldValue) {
  4938 + if (!scope[ctrlAs].$$columns_loaded) {
  4939 + // TODO:格式判定以后做,假设格式是对的
  4940 +
  4941 +
  4942 + }
  4943 +
  4944 + scope[ctrlAs].$$columns_loaded = true;
  4945 + scope[ctrlAs].$$refresh_selectgroupds();
  4946 + },
  4947 + true
  4948 + );
  4949 + // 监控字段排序列表
  4950 + scope.$watch(
  4951 + function() {
  4952 + return scope[ctrlAs].ordercolumns;
  4953 + },
  4954 + function(newValue, oldValue) {
  4955 + if (!scope[ctrlAs].$$ordercolumns_loaded) {
  4956 + if (newValue) {
  4957 + var aColumns = []; // 排序的字段
  4958 + var aDirs = []; // 排序字段对应的排序方向
  4959 +
  4960 + if (newValue.order) {
  4961 + aColumns = newValue.order.split(",");
  4962 + }
  4963 + if (newValue.direction) {
  4964 + aDirs = newValue.direction.split(",");
  4965 + }
  4966 +
  4967 + for (var i = 0; i < aColumns.length; i++) {
  4968 + if (i < aDirs.length) {
  4969 + scope[ctrlAs].$$selectgroupds.push({
  4970 + column: aColumns[i],
  4971 + dir: aDirs[i]
  4972 + });
  4973 + } else {
  4974 + scope[ctrlAs].$$selectgroupds.push({
  4975 + column: aColumns[i],
  4976 + dir: 'ASC'
  4977 + });
  4978 + }
  4979 + }
  4980 + }
  4981 + }
  4982 + scope[ctrlAs].$$ordercolumns_loaded = true;
  4983 + scope[ctrlAs].$$refresh_selectgroupds();
  4984 +
  4985 + },
  4986 + true
  4987 + );
  4988 + }
  4989 +
  4990 + };
  4991 + }
  4992 + };
  4993 + }
  4994 + ]
  4995 +);
  4996 +/**
4627 4997 * saScpdate指令(非通用指令,只在排班计划form中使用)。
4628 4998 * 属性如下:
4629 4999 * name(必须):控件的名字
... ... @@ -4854,193 +5224,193 @@ angular.module(&#39;ScheduleApp&#39;).directive(
4854 5224 }
4855 5225 ]
4856 5226 );
4857   -/**
4858   - * saSrule指令(非通用指令,只在排班计划form中使用)。
4859   - * 属性如下:
4860   - * name(必须):控件的名字
4861   - * xlid(必须):线路id
4862   - * from(必须):独立作用域-绑定的开始时间属性名
4863   - * to(必须):独立作用域-绑定的结束时间属性名
4864   - * error(必须):独立作用域-绑定的错误描述属性名
4865   - */
4866   -angular.module('ScheduleApp').directive(
4867   - 'saSrule',
4868   - [
4869   - 'SchedulePlanManageService_g',
4870   - function(service) {
4871   - return {
4872   - restrict: 'E',
4873   - templateUrl: '/pages/scheduleApp/module/common/dts2/scheduleplan/saSruleTemplate.html',
4874   - scope: {
4875   - from: '=',
4876   - to: '=',
4877   - xlid: '=',
4878   - error: '='
4879   - },
4880   - controllerAs: '$saSruleCtrl',
4881   - bindToController: true,
4882   - controller: function() {
4883   - var self = this;
4884   -
4885   - // 内部ng-model值,用于和required配对
4886   - self.$$internalmodel = undefined;
4887   -
4888   - // 内部数据源(时刻表的一些信息)
4889   - self.$$count = 0;
4890   - self.$$qyCount = 0;
4891   - self.$$qyErrorCount = 0;
4892   - self.$$errorInfos = [];
4893   -
4894   - },
4895   - compile: function(tElem, tAttrs) {
4896   - // 获取所有属性,并验证
4897   - var $name_attr = tAttrs['name']; // 控件的名字
4898   - if (!$name_attr) {
4899   - throw "必须有名称属性";
4900   - }
4901   -
4902   - // controlAs名字
4903   - var ctrlAs = '$saSruleCtrl';
4904   -
4905   - // 线路id
4906   - var xl_id = undefined;
4907   - // 开始时间
4908   - var from_date = undefined;
4909   - // 结束时间
4910   - var to_date = undefined;
4911   -
4912   - // 内部添加required验证,将所有的错误应用到required验证上去
4913   - tElem.find("div").attr("required", "");
4914   -
4915   - return {
4916   - pre: function(scope, element, attr) {
4917   -
4918   - },
4919   -
4920   - post: function(scope, element, attr) {
4921   - // 属性值
4922   - if ($name_attr) {
4923   - scope[ctrlAs]["$name_attr"] = $name_attr;
4924   - }
4925   -
4926   - // 开始日期open属性,及方法
4927   - scope[ctrlAs].$$fromDateOpen = false;
4928   - scope[ctrlAs].$$fromDate_open = function() {
4929   - scope[ctrlAs].$$fromDateOpen = true;
4930   - };
4931   -
4932   - // 结束日期open属性,及方法
4933   - scope[ctrlAs].$$toDateOpen = false;
4934   - scope[ctrlAs].$$toDate_open = function() {
4935   - scope[ctrlAs].$$toDateOpen = true;
4936   - };
4937   -
4938   - // 内部模型刷新
4939   - scope[ctrlAs].$$internal_model_refresh = function() {
4940   - if (!xl_id) {
4941   - scope[ctrlAs].$$internalmodel = undefined;
4942   - scope[ctrlAs].error = "线路必须选择";
4943   - return;
4944   - }
4945   - if (!from_date) {
4946   - scope[ctrlAs].$$internalmodel = undefined;
4947   - scope[ctrlAs].error = "开始日期必须选择";
4948   - return;
4949   - }
4950   - if (!to_date) {
4951   - scope[ctrlAs].$$internalmodel = undefined;
4952   - scope[ctrlAs].error = "结束日期必须选择";
4953   - return;
4954   - }
4955   - if (from_date > to_date) {
4956   - scope[ctrlAs].$$internalmodel = undefined;
4957   - scope[ctrlAs].error = "开始日期必须在结束日期之前";
4958   - return;
4959   - }
4960   -
4961   - scope[ctrlAs].$$count = 0;
4962   - scope[ctrlAs].$$qyCount = 0;
4963   - scope[ctrlAs].$$qyErrorCount = 0;
4964   - scope[ctrlAs].$$errorInfos = [];
4965   -
4966   - if (scope[ctrlAs].$$qyCount == 0) {
4967   - scope[ctrlAs].$$internalmodel = undefined;
4968   - scope[ctrlAs].error = "无可启用的规则数";
4969   - }
4970   -
4971   - var QClass = service.v_rules;
4972   - QClass.val({xlid: xl_id, from: from_date, to: to_date},
4973   - function(result) {
4974   - scope[ctrlAs].$$count = result.data.count;
4975   - scope[ctrlAs].$$qyCount = result.data.qyCount;
4976   - scope[ctrlAs].$$qyErrorCount = result.data.qyErrorCount;
4977   -
4978   - angular.forEach(result.data.errorInfos, function(obj) {
4979   - scope[ctrlAs].$$errorInfos.push({
4980   - ruleId: obj.ruleId,
4981   - clZbh: obj.clZbh,
4982   - qyrq: moment(obj.qyrq).format("YYYY年MM月DD日"),
4983   - infos: obj.errorDescList.join("")
4984   - });
4985   - });
4986   -
4987   - if (scope[ctrlAs].$$qyErrorCount > 0) {
4988   - scope[ctrlAs].$$internalmodel = undefined;
4989   - scope[ctrlAs].error = "有错误的规则";
4990   - } else {
4991   - scope[ctrlAs].$$internalmodel = "ok";
4992   - scope[ctrlAs].$$errorInfos = [];
4993   - }
4994   - },
4995   - function() {
4996   - scope[ctrlAs].$$internalmodel = undefined;
4997   - scope[ctrlAs].error = "获取规则数据失败!";
4998   - }
4999   - );
5000   -
5001   - scope[ctrlAs].$$internalmodel = "ok";
5002   - };
5003   -
5004   - scope[ctrlAs].$$internal_model_refresh(); // 初始执行
5005   -
5006   - //--------------------- 监控属性方法 -------------------//
5007   - // 监控线路id模型值变化
5008   - scope.$watch(
5009   - function() {
5010   - return scope[ctrlAs].xlid;
5011   - },
5012   - function(newValue, oldValue) {
5013   - xl_id = newValue;
5014   - scope[ctrlAs].$$internal_model_refresh();
5015   - }
5016   - );
5017   -
5018   - // 监控开始时间模型值变化
5019   - scope.$watch(
5020   - function() {
5021   - return scope[ctrlAs].from;
5022   - },
5023   - function(newValue, oldValue) {
5024   - from_date = newValue;
5025   - scope[ctrlAs].$$internal_model_refresh();
5026   - }
5027   - );
5028   - // 监控结束时间模型值变化
5029   - scope.$watch(
5030   - function() {
5031   - return scope[ctrlAs].to;
5032   - },
5033   - function(newValue, oldValue) {
5034   - to_date = newValue;
5035   - scope[ctrlAs].$$internal_model_refresh();
5036   - }
5037   - );
5038   - }
5039   - };
5040   - }
5041   - };
5042   - }
5043   - ]
  5227 +/**
  5228 + * saSrule指令(非通用指令,只在排班计划form中使用)。
  5229 + * 属性如下:
  5230 + * name(必须):控件的名字
  5231 + * xlid(必须):线路id
  5232 + * from(必须):独立作用域-绑定的开始时间属性名
  5233 + * to(必须):独立作用域-绑定的结束时间属性名
  5234 + * error(必须):独立作用域-绑定的错误描述属性名
  5235 + */
  5236 +angular.module('ScheduleApp').directive(
  5237 + 'saSrule',
  5238 + [
  5239 + 'SchedulePlanManageService_g',
  5240 + function(service) {
  5241 + return {
  5242 + restrict: 'E',
  5243 + templateUrl: '/pages/scheduleApp/module/common/dts2/scheduleplan/saSruleTemplate.html',
  5244 + scope: {
  5245 + from: '=',
  5246 + to: '=',
  5247 + xlid: '=',
  5248 + error: '='
  5249 + },
  5250 + controllerAs: '$saSruleCtrl',
  5251 + bindToController: true,
  5252 + controller: function() {
  5253 + var self = this;
  5254 +
  5255 + // 内部ng-model值,用于和required配对
  5256 + self.$$internalmodel = undefined;
  5257 +
  5258 + // 内部数据源(时刻表的一些信息)
  5259 + self.$$count = 0;
  5260 + self.$$qyCount = 0;
  5261 + self.$$qyErrorCount = 0;
  5262 + self.$$errorInfos = [];
  5263 +
  5264 + },
  5265 + compile: function(tElem, tAttrs) {
  5266 + // 获取所有属性,并验证
  5267 + var $name_attr = tAttrs['name']; // 控件的名字
  5268 + if (!$name_attr) {
  5269 + throw "必须有名称属性";
  5270 + }
  5271 +
  5272 + // controlAs名字
  5273 + var ctrlAs = '$saSruleCtrl';
  5274 +
  5275 + // 线路id
  5276 + var xl_id = undefined;
  5277 + // 开始时间
  5278 + var from_date = undefined;
  5279 + // 结束时间
  5280 + var to_date = undefined;
  5281 +
  5282 + // 内部添加required验证,将所有的错误应用到required验证上去
  5283 + tElem.find("div").attr("required", "");
  5284 +
  5285 + return {
  5286 + pre: function(scope, element, attr) {
  5287 +
  5288 + },
  5289 +
  5290 + post: function(scope, element, attr) {
  5291 + // 属性值
  5292 + if ($name_attr) {
  5293 + scope[ctrlAs]["$name_attr"] = $name_attr;
  5294 + }
  5295 +
  5296 + // 开始日期open属性,及方法
  5297 + scope[ctrlAs].$$fromDateOpen = false;
  5298 + scope[ctrlAs].$$fromDate_open = function() {
  5299 + scope[ctrlAs].$$fromDateOpen = true;
  5300 + };
  5301 +
  5302 + // 结束日期open属性,及方法
  5303 + scope[ctrlAs].$$toDateOpen = false;
  5304 + scope[ctrlAs].$$toDate_open = function() {
  5305 + scope[ctrlAs].$$toDateOpen = true;
  5306 + };
  5307 +
  5308 + // 内部模型刷新
  5309 + scope[ctrlAs].$$internal_model_refresh = function() {
  5310 + if (!xl_id) {
  5311 + scope[ctrlAs].$$internalmodel = undefined;
  5312 + scope[ctrlAs].error = "线路必须选择";
  5313 + return;
  5314 + }
  5315 + if (!from_date) {
  5316 + scope[ctrlAs].$$internalmodel = undefined;
  5317 + scope[ctrlAs].error = "开始日期必须选择";
  5318 + return;
  5319 + }
  5320 + if (!to_date) {
  5321 + scope[ctrlAs].$$internalmodel = undefined;
  5322 + scope[ctrlAs].error = "结束日期必须选择";
  5323 + return;
  5324 + }
  5325 + if (from_date > to_date) {
  5326 + scope[ctrlAs].$$internalmodel = undefined;
  5327 + scope[ctrlAs].error = "开始日期必须在结束日期之前";
  5328 + return;
  5329 + }
  5330 +
  5331 + scope[ctrlAs].$$count = 0;
  5332 + scope[ctrlAs].$$qyCount = 0;
  5333 + scope[ctrlAs].$$qyErrorCount = 0;
  5334 + scope[ctrlAs].$$errorInfos = [];
  5335 +
  5336 + if (scope[ctrlAs].$$qyCount == 0) {
  5337 + scope[ctrlAs].$$internalmodel = undefined;
  5338 + scope[ctrlAs].error = "无可启用的规则数";
  5339 + }
  5340 +
  5341 + var QClass = service.v_rules;
  5342 + QClass.val({xlid: xl_id, from: from_date, to: to_date},
  5343 + function(result) {
  5344 + scope[ctrlAs].$$count = result.data.count;
  5345 + scope[ctrlAs].$$qyCount = result.data.qyCount;
  5346 + scope[ctrlAs].$$qyErrorCount = result.data.qyErrorCount;
  5347 +
  5348 + angular.forEach(result.data.errorInfos, function(obj) {
  5349 + scope[ctrlAs].$$errorInfos.push({
  5350 + ruleId: obj.ruleId,
  5351 + clZbh: obj.clZbh,
  5352 + qyrq: moment(obj.qyrq).format("YYYY年MM月DD日"),
  5353 + infos: obj.errorDescList.join("")
  5354 + });
  5355 + });
  5356 +
  5357 + if (scope[ctrlAs].$$qyErrorCount > 0) {
  5358 + scope[ctrlAs].$$internalmodel = undefined;
  5359 + scope[ctrlAs].error = "有错误的规则";
  5360 + } else {
  5361 + scope[ctrlAs].$$internalmodel = "ok";
  5362 + scope[ctrlAs].$$errorInfos = [];
  5363 + }
  5364 + },
  5365 + function() {
  5366 + scope[ctrlAs].$$internalmodel = undefined;
  5367 + scope[ctrlAs].error = "获取规则数据失败!";
  5368 + }
  5369 + );
  5370 +
  5371 + scope[ctrlAs].$$internalmodel = "ok";
  5372 + };
  5373 +
  5374 + scope[ctrlAs].$$internal_model_refresh(); // 初始执行
  5375 +
  5376 + //--------------------- 监控属性方法 -------------------//
  5377 + // 监控线路id模型值变化
  5378 + scope.$watch(
  5379 + function() {
  5380 + return scope[ctrlAs].xlid;
  5381 + },
  5382 + function(newValue, oldValue) {
  5383 + xl_id = newValue;
  5384 + scope[ctrlAs].$$internal_model_refresh();
  5385 + }
  5386 + );
  5387 +
  5388 + // 监控开始时间模型值变化
  5389 + scope.$watch(
  5390 + function() {
  5391 + return scope[ctrlAs].from;
  5392 + },
  5393 + function(newValue, oldValue) {
  5394 + from_date = newValue;
  5395 + scope[ctrlAs].$$internal_model_refresh();
  5396 + }
  5397 + );
  5398 + // 监控结束时间模型值变化
  5399 + scope.$watch(
  5400 + function() {
  5401 + return scope[ctrlAs].to;
  5402 + },
  5403 + function(newValue, oldValue) {
  5404 + to_date = newValue;
  5405 + scope[ctrlAs].$$internal_model_refresh();
  5406 + }
  5407 + );
  5408 + }
  5409 + };
  5410 + }
  5411 + };
  5412 + }
  5413 + ]
5044 5414 );
5045 5415 /**
5046 5416 * saPlaninfoedit指令,排班明细编辑控件,用在调度执勤日报的修改功能
... ...
src/main/resources/static/pages/scheduleApp/module/common/prj-common-globalservice.js
... ... @@ -344,7 +344,7 @@ angular.module(&#39;ScheduleApp&#39;).factory(&#39;GuideboardManageService_g&#39;, [&#39;$resource&#39;,
344 344 return {
345 345 rest: $resource(
346 346 '/gic/:id',
347   - {order: 'xl,isCancel,lpNo', direction: 'DESC,ASC,ASC', id: '@id'},
  347 + {order: 'xl.name,isCancel,lpNo', direction: 'DESC,ASC,ASC', id: '@id'},
348 348 {
349 349 list: {
350 350 method: 'GET',
... ... @@ -417,7 +417,7 @@ angular.module(&#39;ScheduleApp&#39;).factory(&#39;rerunManageService_g&#39;, [&#39;$resource&#39;, func
417 417 return {
418 418 rest: $resource(
419 419 '/rms/:id',
420   - {order: 'rerunXl.id,isCancel', direction: 'ASC', id: '@id'},
  420 + {order: 'rerunXl.name,isCancel', direction: 'ASC', id: '@id'},
421 421 {
422 422 list: {
423 423 method: 'GET',
... ... @@ -791,6 +791,20 @@ angular.module(&#39;ScheduleApp&#39;).factory(
791 791 '/tidc/:id',
792 792 {order: 'createDate', direction: 'DESC', id: '@id'},
793 793 {
  794 + list: {
  795 + method: 'GET',
  796 + params: {
  797 + page: 0
  798 + },
  799 + transformResponse: function(rs) {
  800 + var dst = angular.fromJson(rs);
  801 + if (dst.status == 'SUCCESS') {
  802 + return dst.data;
  803 + } else {
  804 + return dst; // 业务错误留给控制器处理
  805 + }
  806 + }
  807 + },
794 808 get: {
795 809 method: 'GET',
796 810 transformResponse: function(rs) {
... ...
src/main/resources/static/pages/scheduleApp/module/core/ttInfoManage/detailedit/edit3.html
... ... @@ -37,10 +37,13 @@
37 37 <!--<i class="fa fa-arrow-down" aria-hidden="true"></i>-->
38 38 <!--<span style="padding-right: 10px;">下行班次</span>-->
39 39 <!--<i class="fa fa-circle-o-notch" aria-hidden="true"></i>-->
40   - <span style="padding-right: 10px;background: #105383;color: white;text-align: center;">停驶班次</span>
41   - <span style="padding-right: 10px;background: #686d7b;color: white;text-align: center;">区间班次</span>
42   - <!--<i class="fa fa-adjust" aria-hidden="true"></i>-->
43   - <span style="padding-right: 10px;background: #adff00;color: #501a1a;text-align: center;">分班班次</span>
  40 +
  41 + <a href="javascript:" class="btn blue" style="padding-right: 5px;" ng-click="ctrl.switchView()">
  42 + <i class="fa fa-exchange"></i>
  43 + {{ctrl.currentView.switchBtnMsg}}
  44 + </a>
  45 +
  46 +
44 47  
45 48 <!--<div class="btn-group">-->
46 49 <!--<a href="javascript:" class="btn red btn-outline btn-circle" data-toggle="dropdown">-->
... ... @@ -87,40 +90,67 @@
87 90 </div>
88 91  
89 92 <div class="portlet-body">
90   - <div style="padding-bottom: 5px;">
91   - <a href="javascript:" style="padding-right: 5px;" ng-click="ctrl.multiselect()">
92   - <i class="fa fa-file-excel-o"></i>
93   - 批量选择
94   - </a>
95   - <a href="javascript:" style="padding-right: 5px;" ng-click="ctrl.editInfos()">
96   - <i class="fa fa-pencil-square-o"></i>
97   - 批量修改
98   - </a>
  93 + <div style="padding-bottom: 10px; height: 20px;">
  94 + <div style="float: left">
  95 + <a href="javascript:" style="padding-right: 5px;"
  96 + ng-click="ctrl.multiselect()"
  97 + ng-show="ctrl.currentView.btn1">
  98 + <i class="fa fa-file-excel-o"></i>
  99 + 批量选择
  100 + </a>
  101 + <a href="javascript:" style="padding-right: 5px;"
  102 + ng-click="ctrl.editInfos()"
  103 + ng-show="ctrl.currentView.btn2">
  104 + <i class="fa fa-pencil-square-o"></i>
  105 + 批量修改
  106 + </a>
  107 +
  108 + <a sweetalert
  109 + sweet-options="{title: '是否删除选定的班次?',text: '线路:' + ctrl.xlname + '</br>时刻表:' + ctrl.ttname + '</br>谨慎删除!', html: true,type: 'warning',showCancelButton: true,confirmButtonColor: '#DD6B55',confirmButtonText: '是',cancelButtonText: '取消'}"
  110 + sweet-on-confirm="ctrl.deleteInfos()"
  111 + style="padding-right: 5px;"
  112 + ng-show="ctrl.currentView.btn3">
  113 + <i class="fa fa-trash"></i>
  114 + 批量删除
  115 + </a>
  116 + <a href="javascript:" style="padding-right: 5px;"
  117 + ng-click="ctrl.clearsel()"
  118 + ng-show="ctrl.currentView.btn4">
  119 + <i class="fa fa-eraser"></i>
  120 + 取消选择
  121 + </a>
  122 + <a href="javascript:" style="padding-right: 5px;"
  123 + ng-click="ctrl.refresh()"
  124 + ng-show="ctrl.currentView.btn5">
  125 + <i class="fa fa-refresh"></i>
  126 + 刷新数据
  127 + </a>
  128 + </div>
  129 +
  130 +
  131 + <div style="float: right;">
  132 + <span style="padding-right: 10px;background: #105383;color: white;text-align: center;">停驶班次</span>
  133 + <span style="padding-right: 10px;background: #686d7b;color: white;text-align: center;">区间班次</span>
  134 + <!--<i class="fa fa-adjust" aria-hidden="true"></i>-->
  135 + <span style="padding-right: 10px;background: #adff00;color: #501a1a;text-align: center;">分班班次</span>
  136 + </div>
99 137  
100   - <a sweetalert
101   - sweet-options="{title: '是否删除选定的班次?',text: '线路:' + ctrl.xlname + '</br>时刻表:' + ctrl.ttname + '</br>谨慎删除!', html: true,type: 'warning',showCancelButton: true,confirmButtonColor: '#DD6B55',confirmButtonText: '是',cancelButtonText: '取消'}"
102   - sweet-on-confirm="ctrl.deleteInfos()"
103   - style="padding-right: 5px;" >
104   - <i class="fa fa-trash"></i>
105   - 批量删除
106   - </a>
107   - <a href="javascript:" style="padding-right: 5px;" ng-click="ctrl.clearsel()">
108   - <i class="fa fa-eraser"></i>
109   - 取消选择
110   - </a>
111   - <a href="javascript:" style="padding-right: 5px;" ng-click="ctrl.refresh()">
112   - <i class="fa fa-refresh"></i>
113   - 刷行数据
114   - </a>
115 138 </div>
116 139  
117 140 <!--<div ng-view></div>-->
118   - <div style="height: {{ctrl.ttHeight}}px;">
  141 + <div style="height: {{ctrl.ttHeight}}px;"
  142 + ng-show="ctrl.currentView.viewId == 1">
119 143 <sa-Timetable name="tt" ng-model="ctrl.editInfo" ng-model-options="{ getterSetter: true }" celldbclick="ctrl.singleEditBcDetail">
120 144  
121 145 </sa-Timetable>
122 146 </div>
123 147  
  148 + <div style="height: {{ctrl.ttHeight}}px;"
  149 + ng-show="ctrl.currentView.viewId == 2">
  150 + <sa-Timetable2 name="tt2" ng-model="ctrl.pvInfo" ng-model-options="{ getterSetter: true }" >
  151 +
  152 + </sa-Timetable2>
  153 + </div>
124 154  
125 155 </div>
126 156 </div>
... ...
src/main/resources/static/pages/scheduleApp/module/core/ttInfoManage/detailedit/timeTableDetailManage_old.js
... ... @@ -12,7 +12,7 @@ angular.module(&#39;ScheduleApp&#39;).factory(
12 12 // 查询对象类
13 13 var queryClass = service.rest;
14 14  
15   - // 时刻表信息
  15 + // 时刻表信息(编辑视图使用)
16 16 var editInfo = {
17 17 detailHeads: [], // 时刻表头信息
18 18 detailInfos: [], // 时刻表明细信息
... ... @@ -20,6 +20,12 @@ angular.module(&#39;ScheduleApp&#39;).factory(
20 20 yydesc: "" // 营运汇总描述
21 21 };
22 22  
  23 + // 时刻表信息(预览视图使用)
  24 + var pvInfo = {
  25 + bcList : [], // 班次列表
  26 + refreshInfos : undefined // 刷新信息
  27 + };
  28 +
23 29 return {
24 30 getQueryClass: function() {
25 31 return queryClass;
... ... @@ -27,6 +33,31 @@ angular.module(&#39;ScheduleApp&#39;).factory(
27 33 getEditInfo: function() {
28 34 return editInfo;
29 35 },
  36 + getPvInfo : function() {
  37 + return pvInfo;
  38 + },
  39 +
  40 + /**
  41 + * 获取预览用的时刻表明细数据。
  42 + * @param ttid 时刻表id
  43 + */
  44 + refreshPvInfo : function(ttid) {
  45 + service.rest.list(
  46 + {page : 0, size : 1000, "ttinfo.id_eq" : ttid},
  47 + function(result) {
  48 + if (result.content.length > 0) {
  49 + pvInfo.bcList = result.content;
  50 + if (pvInfo.refreshInfos == undefined) {
  51 + pvInfo.refreshInfos = {
  52 + count : 1 // 刷新次数
  53 + };
  54 + } else {
  55 + pvInfo.refreshInfos.count ++;
  56 + }
  57 + }
  58 + }
  59 + );
  60 + },
30 61  
31 62 /**
32 63 * 获取编辑用的时刻表明细数据。
... ... @@ -269,6 +300,7 @@ angular.module(&#39;ScheduleApp&#39;).controller(
269 300 };
270 301  
271 302 self.editInfo = undefined;
  303 + self.pvInfo = undefined;
272 304  
273 305 $scope.$watch(
274 306 function() {
... ... @@ -280,6 +312,17 @@ angular.module(&#39;ScheduleApp&#39;).controller(
280 312 true
281 313 );
282 314  
  315 + $scope.$watch(
  316 + function() {
  317 + return service.getPvInfo();
  318 + },
  319 + function(n, o) {
  320 + self.pvInfo = n;
  321 + },
  322 + true
  323 + );
  324 +
  325 +
283 326 // 清除选择
284 327 self.clearsel = function() {
285 328 var ds = service.getEditInfo().detailInfos;
... ... @@ -291,7 +334,39 @@ angular.module(&#39;ScheduleApp&#39;).controller(
291 334 };
292 335 // 刷新时刻表数据
293 336 self.refresh = function() {
294   - service.refreshEditInfo(self.xlid, self.ttid);
  337 + // TODO:目前只有2个视图,内部toggle,以后多个视图需传入viewId
  338 + if (self.currentView.viewId == 1) {
  339 + service.refreshEditInfo(self.xlid, self.ttid);
  340 + } else {
  341 + service.refreshPvInfo(self.ttid);
  342 + }
  343 + };
  344 +
  345 + // 切换视图(编辑视图/预览视图)
  346 + self.viewInfos = {
  347 + "editView" : {
  348 + viewId : 1,
  349 + switchBtnMsg : "切换预览视图",
  350 + btn1 : true,
  351 + btn2 : true,
  352 + btn3 : true,
  353 + btn4 : true,
  354 + btn5 : true
  355 + },
  356 + "preView" : {
  357 + viewId : 2,
  358 + switchBtnMsg : "切换编辑视图",
  359 + btn5 : true
  360 + }
  361 + };
  362 + self.currentView = self.viewInfos["editView"]; // 默认编辑视图
  363 + self.switchView = function() {
  364 + // TODO:目前只有2个视图,内部toggle,以后多个视图需传入viewId
  365 + if (self.currentView.viewId == 1) {
  366 + self.currentView = self.viewInfos["preView"];
  367 + } else {
  368 + self.currentView = self.viewInfos["editView"];
  369 + }
295 370 };
296 371  
297 372 self.ttHeight = 500; // 时刻表的高度
... ... @@ -431,8 +506,9 @@ angular.module(&#39;ScheduleApp&#39;).controller(
431 506  
432 507 };
433 508  
434   - if (self.rflag) { // 是否刷新
435   - self.refresh(); // 刷新数据
  509 + if (self.rflag) { // 是否初始刷新数据
  510 + service.refreshEditInfo(self.xlid, self.ttid);
  511 + service.refreshPvInfo(self.ttid);
436 512 }
437 513  
438 514 // TODO:
... ...
src/main/resources/static/pages/scheduleApp/module/core/ttInfoManage/service.js
... ... @@ -108,6 +108,20 @@ angular.module(&#39;ScheduleApp&#39;).factory(
108 108 '/tidc/:id',
109 109 {order: 'createDate', direction: 'DESC', id: '@id'},
110 110 {
  111 + list: {
  112 + method: 'GET',
  113 + params: {
  114 + page: 0
  115 + },
  116 + transformResponse: function(rs) {
  117 + var dst = angular.fromJson(rs);
  118 + if (dst.status == 'SUCCESS') {
  119 + return dst.data;
  120 + } else {
  121 + return dst; // 业务错误留给控制器处理
  122 + }
  123 + }
  124 + },
111 125 get: {
112 126 method: 'GET',
113 127 transformResponse: function(rs) {
... ...
src/main/resources/static/pages/trafficManage/js/timeTempletUploadRecord.js
... ... @@ -34,7 +34,7 @@
34 34 $('#companySelect').html(options).on('change', setbrancheCompanySelectOptions);
35 35  
36 36 });
37   -
  37 +
38 38 // 填充分公司下拉框选择值
39 39 function setbrancheCompanySelectOptions(){
40 40  
... ... @@ -197,6 +197,12 @@
197 197 $(".autocompleter").css("width",
198 198 $("#line_name").css("width"));
199 199  
  200 + // 设置上传类型
  201 + var uploadStateOptions = '<option value="1">时刻表上传</option>'
  202 + +'<option value="2">线路停靠站上传</option>'
  203 + +'<option value="3">路单上传</option>';
  204 + $('#uploadType').html(uploadStateOptions).on('change', searchM);
  205 +
200 206 searchM(null, true);
201 207 // 绑定查询事件
202 208 $("#search").click(searchM);
... ... @@ -268,4 +274,12 @@
268 274 }
269 275 });
270 276 }
271   -})();
272 277 \ No newline at end of file
  278 +
  279 + template.helper("cutXml", function(xml) {
  280 + return xml ? xml.substring(0,20) + "..." : "";
  281 + });
  282 +})();
  283 +function showXml(el){
  284 + window.sessionStorage.setItem('upload_ygc_xml',JSON.stringify($(el).val()));
  285 + $.get('show_xml.html', function(m){$(pjaxContainer).append(m);});
  286 +}
273 287 \ No newline at end of file
... ...
src/main/resources/static/pages/trafficManage/show_xml.html 0 → 100644
  1 +<div class="modal fade" id="show_xml" tabindex="-1" role="basic"
  2 + aria-hidden="true">
  3 + <div class="modal-dialog">
  4 + <div class="modal-content">
  5 + <div class="modal-header">
  6 + <button type="button" class="close" data-dismiss="modal"
  7 + aria-hidden="true"></button>
  8 + <h4 class="modal-title">上传参数</h4>
  9 + </div>
  10 + <div class="modal-body" id="content_body">
  11 +
  12 + </div>
  13 + <div class="modal-footer">
  14 + <button type="button" class="btn btn-primary" data-dismiss="modal">关闭</button>
  15 + </div>
  16 + </div>
  17 + </div>
  18 +</div>
  19 +<script data-exclude=1>
  20 + $(function() {
  21 + //modal 显示事件
  22 + $('#show_xml').on('show.bs.modal', function(){
  23 + var xml = JSON.parse(window.sessionStorage.getItem('upload_ygc_xml'));
  24 + // 转换< >括号
  25 + var _html = xml.replace(/</g,'&lt;');
  26 + _html = _html.replace(/>/g,'&gt;');
  27 + _html = _html.replace(/"/g,'&quot;');
  28 + $('#content_body').html(_html);
  29 + }).modal('show');
  30 + });
  31 +</script>
0 32 \ No newline at end of file
... ...
src/main/resources/static/pages/trafficManage/timeTempletUploadRecord.html
... ... @@ -4,22 +4,25 @@
4 4 <li><a href="/pages/home.html" data-pjax>首页</a> <i
5 5 class="fa fa-circle"></i></li>
6 6 <li><span class="active">运维管理</span> <i class="fa fa-circle"></i></li>
7   - <li><span class="active">时刻模板上传日志</span></li>
  7 + <li><span class="active">运管处上传日志</span></li>
8 8 </ul>
9 9 <div class="tab_line">
10 10 <div class="col-md-12">
11 11 <ul class="breadcrumb">
12 12 <li>筛选数据:</li>
13   - <li><select name="ttInfo.xl.company_eq" class="form-control" id="companySelect"></select></li>
14   - <li><select name="ttInfo.xl.brancheCompany_eq" class="form-control" id="brancheCompanySelect"></select></li>
  13 + <li><select name="line.company_eq" class="form-control" id="companySelect"></select></li>
  14 + <li><select name="line.brancheCompany_eq" class="form-control" id="brancheCompanySelect"></select></li>
15 15 <li>日期:</li>
16   - <li><input type="text" class="inputCommon dateTime" name="createDate_date_eq" id="dateInput" placeholder="日期"></li>
  16 + <li><input type="text" class="inputCommon dateTime" name="createDate_eq" id="dateInput" placeholder="日期">
  17 + </li>
17 18 <li>线路名称:</li>
18 19 <li><input type="text" class="form-control form-filter input-sm"
19   - name="ttInfo.xl.name_eq" id="line_name" maxlength="40" /></li>
  20 + name="line.name_eq" id="line_name" maxlength="40" /></li>
20 21 <li>上传用户:</li>
21 22 <li><input type="text" class="inputCommon inputCarPlate"
22 23 name="user.name_like" maxlength="40" /></li>
  24 + <li>上传类型:</li>
  25 + <li><select name="type_eq" class="form-control" id="uploadType"></select></li>
23 26 <li><a class="btn btn-circle blue" id="search">筛选</a></li>
24 27 </ul>
25 28 </div>
... ... @@ -37,6 +40,9 @@
37 40 <th>线路</th>
38 41 <th>模板名称</th>
39 42 <th>上传人员</th>
  43 + <th>上传参数</th>
  44 + <th>上传类型</th>
  45 + <th>是否成功</th>
40 46 <th>上传时间</th>
41 47 </tr>
42 48 </thead>
... ... @@ -57,90 +63,121 @@
57 63 {{i+1}}
58 64 </td>
59 65 <td>
60   - {{if obj.ttInfo.xl.company == '55'}}
  66 + {{if obj.line.company == '55'}}
61 67 上南公司
62   - {{else if obj.ttInfo.xl.company == '22'}}
  68 + {{else if obj.line.company == '22'}}
63 69 金高公司
64   - {{else if obj.ttInfo.xl.company == '05'}}
  70 + {{else if obj.line.company == '05'}}
65 71 杨高公司
66   - {{else if obj.ttInfo.xl.company == '26'}}
  72 + {{else if obj.line.company == '26'}}
67 73 南汇公司
68   - {{else if obj.ttInfo.xl.company == '77'}}
  74 + {{else if obj.line.company == '77'}}
69 75 闵行公司
70 76 {{/if}}
71 77 </td>
72 78 <td>
73   - {{if obj.ttInfo.xl.company == '55'}}
  79 + {{if obj.line.company == '55'}}
74 80  
75   - {{if obj.ttInfo.xl.brancheCompany == '1'}}
  81 + {{if obj.line.brancheCompany == '1'}}
76 82 上南二分公司
77   - {{else if obj.ttInfo.xl.brancheCompany == '2'}}
  83 + {{else if obj.line.brancheCompany == '2'}}
78 84 上南三分公司
79   - {{else if obj.ttInfo.xl.brancheCompany == '3'}}
  85 + {{else if obj.line.brancheCompany == '3'}}
80 86 上南六分公司
81   - {{else if obj.ttInfo.xl.brancheCompany == '4'}}
  87 + {{else if obj.line.brancheCompany == '4'}}
82 88 上南一分公司
83 89 {{/if}}
84 90  
85   - {{else if obj.ttInfo.xl.company == '22'}}
  91 + {{else if obj.line.company == '22'}}
86 92  
87   - {{if obj.ttInfo.xl.brancheCompany == '1'}}
  93 + {{if obj.line.brancheCompany == '1'}}
88 94 四分公司
89   - {{else if obj.ttInfo.xl.brancheCompany == '2'}}
  95 + {{else if obj.line.brancheCompany == '2'}}
90 96 二分公司
91   - {{else if obj.ttInfo.xl.brancheCompany == '3'}}
  97 + {{else if obj.line.brancheCompany == '3'}}
92 98 三分公司
93   - {{else if obj.ttInfo.xl.brancheCompany == '5'}}
  99 + {{else if obj.line.brancheCompany == '5'}}
94 100 一分公司
95 101 {{/if}}
96 102  
97   - {{else if obj.ttInfo.xl.company == '05'}}
  103 + {{else if obj.line.company == '05'}}
98 104  
99   - {{if obj.ttInfo.xl.brancheCompany == '1'}}
  105 + {{if obj.line.brancheCompany == '1'}}
100 106 川沙分公司
101   - {{else if obj.ttInfo.xl.brancheCompany == '2'}}
  107 + {{else if obj.line.brancheCompany == '2'}}
102 108 金桥分公司
103   - {{else if obj.ttInfo.xl.brancheCompany == '3'}}
  109 + {{else if obj.line.brancheCompany == '3'}}
104 110 芦潮港分公司
105   - {{else if obj.ttInfo.xl.brancheCompany == '5'}}
  111 + {{else if obj.line.brancheCompany == '5'}}
106 112 杨高分公司
107   - {{else if obj.ttInfo.xl.brancheCompany == '6'}}
  113 + {{else if obj.line.brancheCompany == '6'}}
108 114 周浦分公司
109 115 {{/if}}
110 116  
111   - {{else if obj.ttInfo.xl.company == '26'}}
  117 + {{else if obj.line.company == '26'}}
112 118  
113   - {{if obj.ttInfo.xl.brancheCompany == '1'}}
  119 + {{if obj.line.brancheCompany == '1'}}
114 120 南汇一分
115   - {{else if obj.ttInfo.xl.brancheCompany == '2'}}
  121 + {{else if obj.line.brancheCompany == '2'}}
116 122 南汇二分
117   - {{else if obj.ttInfo.xl.brancheCompany == '3'}}
  123 + {{else if obj.line.brancheCompany == '3'}}
118 124 南汇三分
119   - {{else if obj.ttInfo.xl.brancheCompany == '4'}}
  125 + {{else if obj.line.brancheCompany == '4'}}
120 126 南汇维修公司
121   - {{else if obj.ttInfo.xl.brancheCompany == '5'}}
  127 + {{else if obj.line.brancheCompany == '5'}}
122 128 南汇公司
123 129 {{/if}}
124 130  
125 131 {{/if}}
126 132 </td>
127 133 <td>
128   - {{obj.ttInfo.xl.name}}
  134 + {{obj.line.name}}
129 135 </td>
130 136 <td>
131   - {{obj.ttInfo.name}}
  137 + {{obj.name}}
132 138 </td>
133 139 <td>
134 140 {{obj.user.name}}
135 141 </td>
136 142 <td>
  143 + {{cutXml(obj.uploadXml)}}
  144 + {{if obj.uploadXml != null && obj.uploadXml != ''}}
  145 + {{if obj.state == '1'}}
  146 + <button type="button" class="btn btn-primary" value="{{obj.uploadXml}}{{obj.uploadXmlSub}}" onclick="showXml(this)">
  147 + 查看
  148 + </button>
  149 + {{else if obj.state == '0'}}
  150 + <button type="button" class="btn btn-danger" value="{{obj.uploadXml}}{{obj.uploadXmlSub}}" onclick="showXml(this)">
  151 + 查看
  152 + </button>
  153 + {{/if}}
  154 + {{/if}}
  155 +
  156 + </td>
  157 + <td>
  158 + {{if obj.type == '1'}}
  159 + 时刻表上传
  160 + {{else if obj.type == '2'}}
  161 + 线路停靠站上传
  162 + {{else if obj.type == '3'}}
  163 + 路单上传
  164 + {{/if}}
  165 + </td>
  166 + <td>
  167 + {{if obj.state == '1'}}
  168 + 成功
  169 + {{else if obj.state == '0'}}
  170 + 失败
  171 + {{/if}}
  172 + </td>
  173 + <td>
137 174 {{obj.createDate}}
138 175 </td>
139 176 </tr>
140 177 {{/each}}
141 178 {{if list.length == 0}}
142 179 <tr class="muted">
143   - <td colspan=7 style="text-align: center;"><h6>没有找到相关数据</h6></td>
  180 + <td colspan=10 style="text-align: center;"><h6>没有找到相关数据</h6></td>
144 181 </tr>
145 182 {{/if}}
146 183 </script>
... ...
src/main/resources/static/real_control_v2/fragments/north/nav/line_config/fbzdzx_config.html
1   -<div id="nav-fbzdzx_config-modal" class="uk-modal">
2   - <div class="uk-modal-dialog uk-modal-dialog-blank" style="overflow: hidden;">
3   - <button class="uk-modal-close uk-close" type="button"></button>
4   - <div class="uk-grid uk-flex-middle" data-uk-grid-margin>
5   - <div class="uk-width-medium-1-6 uk-height-viewport line-config-tree" data-uk-observe>
6   - <h3 class="title">翻班与自动完成</h3>
7   - <div class="uk-accordion" data-uk-accordion="{showfirst:false}" ></div>
8   - </div>
9   - <div class="uk-width-medium-5-6 uk-height-viewport right-container" data-uk-observe>
10   - <div id="fbzdzx_config_entity_panel"></div>
11   - <div id="buffer_config_panel"></div>
12   - </div>
13   - </div>
14   - </div>
15   -
16   -
17   - <script id="nav-fbzdzx_config-modal-tree-temp" type="text/html">
18   - {{each array as line i}}
19   - <h3 class="uk-accordion-title" data-id="{{line.lineCode}}">{{line.name}}</h3>
20   - <div class="uk-accordion-content">
21   - <ul class="uk-list uk-list-line" id="smooth_scroll_list">
22   - <li><a data-href="#schedule_reload_time_panel" >班次更新时间</a></li>
23   - <li><a data-href="#schedule_auto_exec_panel" >班次自动执行</a></li>
24   - </ul>
25   - </div>
26   - {{/each}}
27   - </script>
28   -
29   - <script>
30   - (function () {
31   - var modal = '#nav-fbzdzx_config-modal',
32   - lineConfig, activeCode;
33   -
34   - //初始化滚动条
35   - $('.right-container', modal).perfectScrollbar({suppressScrollX: true});
36   - /**
37   - * 手风琴拨动
38   - */
39   - $('.uk-accordion').on('toggle.uk.accordion', function (e, active, toggle, content) {
40   - if(active){
41   - activeCode = $(toggle).data('id');
42   - load();
43   - }
44   - });
45   -
46   - $(modal).on('init', function (e, data) {
47   - e.stopPropagation();
48   - var htmlStr = template('nav-fbzdzx_config-modal-tree-temp', {array: gb_data_basic.activeLines});
49   - $('.line-config-tree .uk-accordion', modal).html(htmlStr);
50   -
51   - if(data.activeCode)
52   - activeCode = data.activeCode;
53   - else{
54   - //展开tab激活的线路
55   - var $activeTab = $('#main-tab-content>li.line_schedule.uk-active');
56   - if($activeTab.length > 0)
57   - activeCode = $activeTab.data('id');
58   - else{
59   - //展开第一个
60   - var $first = $('.uk-accordion-title:eq(0)', modal);
61   - activeCode = $first.data('id');
62   - }
63   - }
64   -
65   - setTimeout(function () {
66   - $('.uk-accordion-title[data-id='+activeCode+']', modal).trigger('click');
67   - }, 500);
68   - });
69   -
70   -
71   - var load = function () {
72   - //获取线路配置信息
73   - $.get('/lineConfig/getByLineCode', {lineCode: activeCode}, function (conf) {
74   - lineConfig = conf;
75   -
76   - loadConfigEntity();
77   - loadBufferConfig();
78   -
79   - setTimeout(function () {
80   - //更新滚动条高度
81   - $('.right-container', modal).perfectScrollbar('update');
82   - }, 500);
83   - });
84   - };
85   -
86   - //线路配置表属性设置
87   - var loadConfigEntity = function () {
88   - $.get('/real_control_v2/fragments/north/nav/line_config/fbzdzx_config_entity.html', function (attrDom) {
89   - $('.right-container #fbzdzx_config_entity_panel', modal)
90   - .html(attrDom)
91   - .find('#fbzdzx_config_entity_wrap')
92   - .trigger('init', {lineConfig: lineConfig});
93   - });
94   - };
95   -
96   -
97   - //瞄点
98   - $(modal).on('click', '#smooth_scroll_list>li>a', function () {
99   - var id = $(this).data('href');
100   - scrollToElement($(id, modal));
101   - });
102   -
103   - function scrollToElement(ele) {
104   - var cont = $('.right-container', modal), diff = 10;
105   - cont.animate({
106   - scrollTop: ele.offset().top - cont.offset().top + cont.scrollTop() - diff
107   - }, 300);
108   - }
109   - })();
110   - </script>
111   -</div>
  1 +<div id="nav-fbzdzx_config-modal" class="uk-modal">
  2 + <div class="uk-modal-dialog uk-modal-dialog-blank" style="overflow: hidden;">
  3 + <button class="uk-modal-close uk-close" type="button"></button>
  4 + <div class="uk-grid uk-flex-middle" data-uk-grid-margin>
  5 + <div class="uk-width-medium-1-6 uk-height-viewport line-config-tree" data-uk-observe>
  6 + <h3 class="title">翻班与自动完成</h3>
  7 + <div class="uk-accordion" data-uk-accordion="{showfirst:false}" ></div>
  8 + </div>
  9 + <div class="uk-width-medium-5-6 uk-height-viewport right-container" data-uk-observe>
  10 + <div id="fbzdzx_config_entity_panel"></div>
  11 + <div id="buffer_config_panel"></div>
  12 + </div>
  13 + </div>
  14 + </div>
  15 +
  16 +
  17 + <script id="nav-fbzdzx_config-modal-tree-temp" type="text/html">
  18 + {{each array as line i}}
  19 + <h3 class="uk-accordion-title" data-id="{{line.lineCode}}">{{line.name}}</h3>
  20 + <div class="uk-accordion-content">
  21 + <ul class="uk-list uk-list-line" id="smooth_scroll_list">
  22 + <li><a data-href="#schedule_reload_time_panel" >班次更新时间</a></li>
  23 + <li><a data-href="#schedule_auto_exec_panel" >班次自动执行</a></li>
  24 + </ul>
  25 + </div>
  26 + {{/each}}
  27 + </script>
  28 +
  29 + <script>
  30 + (function () {
  31 + var modal = '#nav-fbzdzx_config-modal',
  32 + lineConfig, activeCode;
  33 +
  34 + //初始化滚动条
  35 + $('.right-container', modal).perfectScrollbar({suppressScrollX: true});
  36 + /**
  37 + * 手风琴拨动
  38 + */
  39 + $('.uk-accordion').on('toggle.uk.accordion', function (e, active, toggle, content) {
  40 + if(active){
  41 + activeCode = $(toggle).data('id');
  42 + load();
  43 + }
  44 + });
  45 +
  46 + $(modal).on('init', function (e, data) {
  47 + e.stopPropagation();
  48 + var htmlStr = template('nav-fbzdzx_config-modal-tree-temp', {array: gb_data_basic.activeLines});
  49 + $('.line-config-tree .uk-accordion', modal).html(htmlStr);
  50 +
  51 + if(data.activeCode)
  52 + activeCode = data.activeCode;
  53 + else{
  54 + //展开tab激活的线路
  55 + var $activeTab = $('#main-tab-content>li.line_schedule.uk-active');
  56 + if($activeTab.length > 0)
  57 + activeCode = $activeTab.data('id');
  58 + else{
  59 + //展开第一个
  60 + var $first = $('.uk-accordion-title:eq(0)', modal);
  61 + activeCode = $first.data('id');
  62 + }
  63 + }
  64 +
  65 + setTimeout(function () {
  66 + $('.uk-accordion-title[data-id='+activeCode+']', modal).trigger('click');
  67 + }, 500);
  68 + });
  69 +
  70 +
  71 + var load = function () {
  72 + //获取线路配置信息
  73 + $.get('/lineConfig/getByLineCode', {lineCode: activeCode}, function (conf) {
  74 + lineConfig = conf;
  75 +
  76 + loadConfigEntity();
  77 + loadBufferConfig();
  78 +
  79 + setTimeout(function () {
  80 + //更新滚动条高度
  81 + $('.right-container', modal).perfectScrollbar('update');
  82 + }, 500);
  83 + });
  84 + };
  85 +
  86 + //线路配置表属性设置
  87 + var loadConfigEntity = function () {
  88 + $.get('/real_control_v2/fragments/north/nav/line_config/fbzdzx_config_entity.html', function (attrDom) {
  89 + $('.right-container #fbzdzx_config_entity_panel', modal)
  90 + .html(attrDom)
  91 + .find('#fbzdzx_config_entity_wrap')
  92 + .trigger('init', {lineConfig: lineConfig});
  93 + });
  94 + };
  95 +
  96 +
  97 + //瞄点
  98 + $(modal).on('click', '#smooth_scroll_list>li>a', function () {
  99 + var id = $(this).data('href');
  100 + scrollToElement($(id, modal));
  101 + });
  102 +
  103 + function scrollToElement(ele) {
  104 + var cont = $('.right-container', modal), diff = 10;
  105 + cont.animate({
  106 + scrollTop: ele.offset().top - cont.offset().top + cont.scrollTop() - diff
  107 + }, 300);
  108 + }
  109 + })();
  110 + </script>
  111 +</div>
... ...
src/main/resources/static/real_control_v2/fragments/north/nav/line_config/fbzdzx_config_entity.html
1   -<!-- 线路配置表相关属性 -->
2   -<div id="fbzdzx_config_entity_wrap">
3   - <form class="uk-form"></form>
4   -
5   - <script id="fbzdzx_config_entity_form-temp" type="text/html">
6   - <div id="schedule_reload_time_panel">
7   - <h2 class="btn_title_line">
8   - <a class="uk-link-reset">班次更新时间</a>
9   - </h2>
10   - <div>
11   - <div>
12   - <span class="line_name"></span>每天
13   - <div class="uk-form-icon" style="margin: 0 5px;">
14   - <i class="uk-icon-clock-o"></i>
15   - <input name="startOptInput" readonly type="text" class="z-depth-input" value="{{startOpt}}"
16   - style="width: 151px;"
17   - data-uk-timepicker>
18   - </div>
19   - 更新到当日排班
20   - </div>
21   - <ul class="uk-list">
22   - <li>
23   - <small><i class="uk-icon-question-circle"></i> 所有发车时间小于该时间的班次都默认跨过24点,手动调整的实发实达均应用此规则。</small>
24   - </li>
25   - </ul>
26   - <button class="uk-button uk-button-mini" id="clearRealScheduleBtn">删除实际排班</button>
27   - <button class="uk-button uk-button-mini" id="reLoadRealScheduleBtn">重新加载实际排班</button>
28   - <button class="uk-button uk-button-mini" disabled>加载历史GPS恢复到离站</button>
29   - </div>
30   - </div>
31   -
32   - <div id="schedule_auto_exec_panel">
33   - <h2 class="btn_title_line">
34   - <a class="uk-link-reset">班次自动执行</a>
35   - </h2>
36   - <div>
37   - <div>
38   - <label>
39   - <input type="checkbox" id="enableAutoExec" {{autoExec?"checked":""}}> 启用自动班次执行
40   - </label>
41   - </div>
42   - <ul class="uk-list">
43   - <li>
44   - <small style="color: red;font-size: 14px;">1、 你必须只应该对【无固定走向且无人监管的线路】启用此项。</small>
45   - </li>
46   - <li>
47   - <small>2、启用该选项后,系统将不再依赖相关定位信号来执行班次。</small>
48   - </li>
49   - <li>
50   - <small>3、系统将在合适的时候自动填入实发实达时间,以完善报表。</small>
51   - </li>
52   - <li>
53   - <small>4、系统不会下发班次调度指令。</small>
54   - </li>
55   - </ul>
56   - </div>
57   - </div>
58   -
59   - </script>
60   -
61   - <script>
62   - (function () {
63   -
64   - var wrap = '#fbzdzx_config_entity_wrap', conf, parks, upStationRoutes;
65   -
66   - /**
67   - * 删除实际排班
68   - */
69   - var clearRealSchedule = function (e) {
70   - e.stopPropagation();
71   - var lineCode = conf.line.lineCode;
72   - var htmlStr = '<h4 style="color: red;">你确定要删除【' + conf.line.name + '】今日的实际排班?</h4><h5 style="margin-top: 15px;">今日的实际排班会被删除</h5><h5 style="margin-top: 15px;">人车、路牌、待发等相关班次调整信息会被删除。</h5><h5 style="margin-top: 15px;">调度指令和期间与设备的通讯记录被保留</h5><h5 style="margin-top: 15px;">后台日志中的人工操作痕迹被保留</h5>';
73   - alt_confirm(htmlStr, function () {
74   - show_wait_modal('正在清除数据...');
75   - gb_common.$post('/realSchedule/deleteRealSchedule', {lineCode: lineCode}, function () {
76   - //刷新班次表格
77   - gb_schedule_table.reLoadAndRefresh(lineCode);
78   - hide_wait_modal();
79   - notify_succ('删除班次成功!!!');
80   - });
81   - }, '确认删除' + conf.line.name + '的实际排班', true);
82   -
83   - return false;
84   - };
85   -
86   - /**
87   - * 重新载入实际排班
88   - */
89   - var reLoadRealSchedule = function (e) {
90   - e.stopPropagation();
91   - var lineCode = conf.line.lineCode;
92   - show_wait_modal('正在重载数据...');
93   - gb_common.$post('/realSchedule/reLoadRealSchedule', {lineCode: lineCode}, function () {
94   - //刷新班次表格
95   - gb_schedule_table.reLoadAndRefresh(lineCode);
96   - hide_wait_modal();
97   - notify_succ('重新载入班次成功');
98   - });
99   - return false;
100   - };
101   -
102   - $(wrap).on('init', function (e, data) {
103   - e.stopPropagation();
104   - conf = data.lineConfig;
105   - //停车场
106   - $.get('/basic/parks', function (rs) {
107   - parks = [];
108   - for (var code in rs) {
109   - parks.push({code: code, name: rs[code]});
110   - }
111   -
112   - parks.sort(function (a, b) {
113   - return $.trim(a.name).localeCompare($.trim(b.name), 'zh-CN');
114   - });
115   - renderPSDom();
116   - });
117   - //上行站点路由
118   - upStationRoutes = gb_common.groupBy(gb_data_basic.stationRoutes(conf.line.lineCode).sort(function (a, b) {
119   - return a.stationRouteCode - b.stationRouteCode;
120   - }), 'directions')[0];
121   -
122   - var htmlStr = template('fbzdzx_config_entity_form-temp', conf);
123   - $('form', wrap).html(htmlStr);
124   -
125   - $('.line_name', '#fbzdzx_config_entity_wrap').text(conf.line.name);
126   - //更新排班时间
127   - $('input[name=startOptInput]', wrap).on('change', updateStartTime);
128   - //出场时间类型
129   - $('select[name=outParkTypeSelect]', wrap).on('change', updateOutParkType);
130   - //原线路回场
131   - $('select[name=inParkForSourceSelect]', wrap).on('change', enableInParkForSource);
132   - //删除班次
133   - $('#clearRealScheduleBtn', wrap).on('click', clearRealSchedule);
134   - //重新载入实际排班
135   - $('#reLoadRealScheduleBtn', wrap).on('click', reLoadRealSchedule);
136   - $('#enableAutoExec', wrap).on('click', autoExecFun);
137   - });
138   -
139   - function changeTwinsParkAndStation() {
140   - var parks='',stations=''
141   - ,$panel = $('.park-and-station-wrap', wrap);
142   -
143   - $('select[name=twinsPark]', $panel).each(function () {
144   - parks += ($(this).val() + ',');
145   - });
146   -
147   - $('select[name=twinsStation]', $panel).each(function () {
148   - stations += ($(this).val() + ',');
149   - });
150   -
151   - if(parks.length > 0)
152   - parks = parks.substr(0, parks.length - 1);
153   - if(stations.length > 0)
154   - stations = stations.substr(0, stations.length - 1);
155   -
156   - gb_common.$post('/lineConfig/parkAndStationSet', {
157   - lineCode: conf.line.lineCode,
158   - twinsPark: parks,
159   - twinsStation: stations
160   - }, function (rs) {
161   - notify_succ('已保存!!');
162   - conf = rs.conf;
163   - });
164   - }
165   -
166   - //更新排班时间
167   - var startOptFlag;
168   -
169   - function updateStartTime() {
170   - if (startOptFlag || $(this).val() == conf.startOpt)
171   - return;
172   - startOptFlag = true;
173   - var that = this;
174   - setTimeout(function () {
175   - var timeStr = $(that).val();
176   - gb_common.$post('/lineConfig/editTime', {
177   - lineCode: conf.line.lineCode,
178   - time: timeStr
179   - }, function (rs) {
180   - notify_succ('班次更新时间调整为 ' + timeStr);
181   - conf.startOpt = rs.time;
182   - });
183   - startOptFlag = false;
184   - }, 300);
185   - }
186   -
187   - function updateOutParkType() {
188   - var type = $(this).val();
189   - var lineCode = conf.line.lineCode;
190   -
191   - var data = {lineCode: lineCode, type: type, parkCode: '', stationCode: ''};
192   - //出站既是出场
193   - if (type == 2) {
194   - //如果配置上有信息
195   - if(conf.twinsParks){
196   - data.parkCode = conf.twinsParks;
197   - data.stationCode = conf.twinsStations;
198   - }
199   - else{
200   - data.parkCode = gb_data_basic.getLineInformation(lineCode).carPark;//默认关联 线路标准停车场
201   - data.stationCode = upStationRoutes[0].stationCode;//和上行起点站
202   - }
203   - }
204   - gb_common.$post('/lineConfig/editOutTimeType', data, function (rs) {
205   - notify_succ('调整出场时间类型成功!');
206   - conf = rs.conf;
207   -
208   - //渲染场站关联dom
209   - renderPSDom();
210   - });
211   - }
212   -
213   -
214   -
215   - function enableInParkForSource() {
216   - var enable = $(this).val();
217   - gb_common.$post('/lineConfig/enableInParkForSource', {
218   - lineCode: conf.line.lineCode,
219   - enable: enable
220   - }, function () {
221   - notify_succ((enable == 1 ? '启用' : '禁用') + '原线路回场');
222   - conf.inParkForSource = enable;
223   - });
224   - }
225   -
226   -
227   - /**
228   - * 自动执行
229   - */
230   - function autoExecFun(){
231   - var that = this;
232   - if(that.checked){
233   - that.checked = false;
234   - alt_confirm('<span style="color: red;font-size: 16px;">启用【' + conf.line.name + '】的自动执行功能?</span>', function () {
235   - var data = {
236   - lineCode: conf.line.lineCode,
237   - autoExec: true
238   - };
239   - gb_common.$post('/lineConfig/setAutoExec', data, function (rs) {
240   - notify_succ('启用成功!');
241   - conf = rs.conf;
242   -
243   - that.checked = true;
244   - });
245   - }, '我确定要将【' + conf.line.name + '】设置为自动执行', true);
246   - }
247   - else{
248   - that.checked = true;
249   - alt_confirm('<span style="color: red;font-size: 16px;">禁用【' + conf.line.name + '】的自动执行功能?</span>', function () {
250   - var data = {
251   - lineCode: conf.line.lineCode,
252   - autoExec: false
253   - };
254   - gb_common.$post('/lineConfig/setAutoExec', data, function (rs) {
255   - notify_succ('禁用成功!');
256   - conf = rs.conf;
257   -
258   - that.checked = false;
259   - });
260   - }, '我确定要禁用【' + conf.line.name + '】的自动执行', true);
261   - }
262   - }
263   -
264   -
265   - /**
266   - * 删除 场既是站 项目
267   - */
268   - $(wrap).on('click', '.c_2_s_list .item .uk-close', function () {
269   - $(this).parents('.item').remove();
270   - changeTwinsParkAndStation();
271   - });
272   -
273   -
274   - $(wrap).on('change', 'select[name=twinsPark]', changeTwinsParkAndStation);
275   - $(wrap).on('change', 'select[name=twinsStation]', changeTwinsParkAndStation);
276   - })();
277   - </script>
  1 +<!-- 线路配置表相关属性 -->
  2 +<div id="fbzdzx_config_entity_wrap">
  3 + <form class="uk-form"></form>
  4 +
  5 + <script id="fbzdzx_config_entity_form-temp" type="text/html">
  6 + <div id="schedule_reload_time_panel">
  7 + <h2 class="btn_title_line">
  8 + <a class="uk-link-reset">班次更新时间</a>
  9 + </h2>
  10 + <div>
  11 + <div>
  12 + <span class="line_name"></span>每天
  13 + <div class="uk-form-icon" style="margin: 0 5px;">
  14 + <i class="uk-icon-clock-o"></i>
  15 + <input name="startOptInput" readonly type="text" class="z-depth-input" value="{{startOpt}}"
  16 + style="width: 151px;"
  17 + data-uk-timepicker>
  18 + </div>
  19 + 更新到当日排班
  20 + </div>
  21 + <ul class="uk-list">
  22 + <li>
  23 + <small><i class="uk-icon-question-circle"></i> 所有发车时间小于该时间的班次都默认跨过24点,手动调整的实发实达均应用此规则。</small>
  24 + </li>
  25 + </ul>
  26 + <button class="uk-button uk-button-mini" id="clearRealScheduleBtn">删除实际排班</button>
  27 + <button class="uk-button uk-button-mini" id="reLoadRealScheduleBtn">重新加载实际排班</button>
  28 + <button class="uk-button uk-button-mini" disabled>加载历史GPS恢复到离站</button>
  29 + </div>
  30 + </div>
  31 +
  32 + <div id="schedule_auto_exec_panel">
  33 + <h2 class="btn_title_line">
  34 + <a class="uk-link-reset">班次自动执行</a>
  35 + </h2>
  36 + <div>
  37 + <div>
  38 + <label>
  39 + <input type="checkbox" id="enableAutoExec" {{autoExec?"checked":""}}> 启用自动班次执行
  40 + </label>
  41 + </div>
  42 + <ul class="uk-list">
  43 + <li>
  44 + <small style="color: red;font-size: 14px;">1、 你必须只应该对【无固定走向且无人监管的线路】启用此项。</small>
  45 + </li>
  46 + <li>
  47 + <small>2、启用该选项后,系统将不再依赖相关定位信号来执行班次。</small>
  48 + </li>
  49 + <li>
  50 + <small>3、系统将在合适的时候自动填入实发实达时间,以完善报表。</small>
  51 + </li>
  52 + <li>
  53 + <small>4、系统不会下发班次调度指令。</small>
  54 + </li>
  55 + </ul>
  56 + </div>
  57 + </div>
  58 +
  59 + </script>
  60 +
  61 + <script>
  62 + (function () {
  63 +
  64 + var wrap = '#fbzdzx_config_entity_wrap', conf, parks, upStationRoutes;
  65 +
  66 + /**
  67 + * 删除实际排班
  68 + */
  69 + var clearRealSchedule = function (e) {
  70 + e.stopPropagation();
  71 + var lineCode = conf.line.lineCode;
  72 + var htmlStr = '<h4 style="color: red;">你确定要删除【' + conf.line.name + '】今日的实际排班?</h4><h5 style="margin-top: 15px;">今日的实际排班会被删除</h5><h5 style="margin-top: 15px;">人车、路牌、待发等相关班次调整信息会被删除。</h5><h5 style="margin-top: 15px;">调度指令和期间与设备的通讯记录被保留</h5><h5 style="margin-top: 15px;">后台日志中的人工操作痕迹被保留</h5>';
  73 + alt_confirm(htmlStr, function () {
  74 + show_wait_modal('正在清除数据...');
  75 + gb_common.$post('/realSchedule/deleteRealSchedule', {lineCode: lineCode}, function () {
  76 + //刷新班次表格
  77 + gb_schedule_table.reLoadAndRefresh(lineCode);
  78 + hide_wait_modal();
  79 + notify_succ('删除班次成功!!!');
  80 + });
  81 + }, '确认删除' + conf.line.name + '的实际排班', true);
  82 +
  83 + return false;
  84 + };
  85 +
  86 + /**
  87 + * 重新载入实际排班
  88 + */
  89 + var reLoadRealSchedule = function (e) {
  90 + e.stopPropagation();
  91 + var lineCode = conf.line.lineCode;
  92 + show_wait_modal('正在重载数据...');
  93 + gb_common.$post('/realSchedule/reLoadRealSchedule', {lineCode: lineCode}, function () {
  94 + //刷新班次表格
  95 + gb_schedule_table.reLoadAndRefresh(lineCode);
  96 + hide_wait_modal();
  97 + notify_succ('重新载入班次成功');
  98 + });
  99 + return false;
  100 + };
  101 +
  102 + $(wrap).on('init', function (e, data) {
  103 + e.stopPropagation();
  104 + conf = data.lineConfig;
  105 + //停车场
  106 + $.get('/basic/parks', function (rs) {
  107 + parks = [];
  108 + for (var code in rs) {
  109 + parks.push({code: code, name: rs[code]});
  110 + }
  111 +
  112 + parks.sort(function (a, b) {
  113 + return $.trim(a.name).localeCompare($.trim(b.name), 'zh-CN');
  114 + });
  115 + renderPSDom();
  116 + });
  117 + //上行站点路由
  118 + upStationRoutes = gb_common.groupBy(gb_data_basic.stationRoutes(conf.line.lineCode).sort(function (a, b) {
  119 + return a.stationRouteCode - b.stationRouteCode;
  120 + }), 'directions')[0];
  121 +
  122 + var htmlStr = template('fbzdzx_config_entity_form-temp', conf);
  123 + $('form', wrap).html(htmlStr);
  124 +
  125 + $('.line_name', '#fbzdzx_config_entity_wrap').text(conf.line.name);
  126 + //更新排班时间
  127 + $('input[name=startOptInput]', wrap).on('change', updateStartTime);
  128 + //出场时间类型
  129 + $('select[name=outParkTypeSelect]', wrap).on('change', updateOutParkType);
  130 + //原线路回场
  131 + $('select[name=inParkForSourceSelect]', wrap).on('change', enableInParkForSource);
  132 + //删除班次
  133 + $('#clearRealScheduleBtn', wrap).on('click', clearRealSchedule);
  134 + //重新载入实际排班
  135 + $('#reLoadRealScheduleBtn', wrap).on('click', reLoadRealSchedule);
  136 + $('#enableAutoExec', wrap).on('click', autoExecFun);
  137 + });
  138 +
  139 + function changeTwinsParkAndStation() {
  140 + var parks='',stations=''
  141 + ,$panel = $('.park-and-station-wrap', wrap);
  142 +
  143 + $('select[name=twinsPark]', $panel).each(function () {
  144 + parks += ($(this).val() + ',');
  145 + });
  146 +
  147 + $('select[name=twinsStation]', $panel).each(function () {
  148 + stations += ($(this).val() + ',');
  149 + });
  150 +
  151 + if(parks.length > 0)
  152 + parks = parks.substr(0, parks.length - 1);
  153 + if(stations.length > 0)
  154 + stations = stations.substr(0, stations.length - 1);
  155 +
  156 + gb_common.$post('/lineConfig/parkAndStationSet', {
  157 + lineCode: conf.line.lineCode,
  158 + twinsPark: parks,
  159 + twinsStation: stations
  160 + }, function (rs) {
  161 + notify_succ('已保存!!');
  162 + conf = rs.conf;
  163 + });
  164 + }
  165 +
  166 + //更新排班时间
  167 + var startOptFlag;
  168 +
  169 + function updateStartTime() {
  170 + if (startOptFlag || $(this).val() == conf.startOpt)
  171 + return;
  172 + startOptFlag = true;
  173 + var that = this;
  174 + setTimeout(function () {
  175 + var timeStr = $(that).val();
  176 + gb_common.$post('/lineConfig/editTime', {
  177 + lineCode: conf.line.lineCode,
  178 + time: timeStr
  179 + }, function (rs) {
  180 + notify_succ('班次更新时间调整为 ' + timeStr);
  181 + conf.startOpt = rs.time;
  182 + });
  183 + startOptFlag = false;
  184 + }, 300);
  185 + }
  186 +
  187 + function updateOutParkType() {
  188 + var type = $(this).val();
  189 + var lineCode = conf.line.lineCode;
  190 +
  191 + var data = {lineCode: lineCode, type: type, parkCode: '', stationCode: ''};
  192 + //出站既是出场
  193 + if (type == 2) {
  194 + //如果配置上有信息
  195 + if(conf.twinsParks){
  196 + data.parkCode = conf.twinsParks;
  197 + data.stationCode = conf.twinsStations;
  198 + }
  199 + else{
  200 + data.parkCode = gb_data_basic.getLineInformation(lineCode).carPark;//默认关联 线路标准停车场
  201 + data.stationCode = upStationRoutes[0].stationCode;//和上行起点站
  202 + }
  203 + }
  204 + gb_common.$post('/lineConfig/editOutTimeType', data, function (rs) {
  205 + notify_succ('调整出场时间类型成功!');
  206 + conf = rs.conf;
  207 +
  208 + //渲染场站关联dom
  209 + renderPSDom();
  210 + });
  211 + }
  212 +
  213 +
  214 +
  215 + function enableInParkForSource() {
  216 + var enable = $(this).val();
  217 + gb_common.$post('/lineConfig/enableInParkForSource', {
  218 + lineCode: conf.line.lineCode,
  219 + enable: enable
  220 + }, function () {
  221 + notify_succ((enable == 1 ? '启用' : '禁用') + '原线路回场');
  222 + conf.inParkForSource = enable;
  223 + });
  224 + }
  225 +
  226 +
  227 + /**
  228 + * 自动执行
  229 + */
  230 + function autoExecFun(){
  231 + var that = this;
  232 + if(that.checked){
  233 + that.checked = false;
  234 + alt_confirm('<span style="color: red;font-size: 16px;">启用【' + conf.line.name + '】的自动执行功能?</span>', function () {
  235 + var data = {
  236 + lineCode: conf.line.lineCode,
  237 + autoExec: true
  238 + };
  239 + gb_common.$post('/lineConfig/setAutoExec', data, function (rs) {
  240 + notify_succ('启用成功!');
  241 + conf = rs.conf;
  242 +
  243 + that.checked = true;
  244 + });
  245 + }, '我确定要将【' + conf.line.name + '】设置为自动执行', true);
  246 + }
  247 + else{
  248 + that.checked = true;
  249 + alt_confirm('<span style="color: red;font-size: 16px;">禁用【' + conf.line.name + '】的自动执行功能?</span>', function () {
  250 + var data = {
  251 + lineCode: conf.line.lineCode,
  252 + autoExec: false
  253 + };
  254 + gb_common.$post('/lineConfig/setAutoExec', data, function (rs) {
  255 + notify_succ('禁用成功!');
  256 + conf = rs.conf;
  257 +
  258 + that.checked = false;
  259 + });
  260 + }, '我确定要禁用【' + conf.line.name + '】的自动执行', true);
  261 + }
  262 + }
  263 +
  264 +
  265 + /**
  266 + * 删除 场既是站 项目
  267 + */
  268 + $(wrap).on('click', '.c_2_s_list .item .uk-close', function () {
  269 + $(this).parents('.item').remove();
  270 + changeTwinsParkAndStation();
  271 + });
  272 +
  273 +
  274 + $(wrap).on('change', 'select[name=twinsPark]', changeTwinsParkAndStation);
  275 + $(wrap).on('change', 'select[name=twinsStation]', changeTwinsParkAndStation);
  276 + })();
  277 + </script>
278 278 </div>
279 279 \ No newline at end of file
... ...
src/main/resources/static/real_control_v2/js/line_schedule/sch_table.js
... ... @@ -29,7 +29,6 @@ var gb_schedule_table = (function () {
29 29  
30 30 var show = function (cb) {
31 31 //从服务器获取班次数据
32   - debugger
33 32 $.get('/realSchedule/lines', {
34 33 lines: gb_data_basic.line_idx
35 34 }, function (rs) {
... ... @@ -106,7 +105,6 @@ var gb_schedule_table = (function () {
106 105 //监听gps车辆信息
107 106 gb_data_gps.registerCallback(renderCarRemark);
108 107 gb_sch_legend.showYdSdDb();
109   - gb_schedule_context_menu.ydsd_init()
110 108 cb && cb();
111 109 });
112 110  
... ...
src/main/resources/static/real_control_v2/mapmonitor/fragments/playback_v3/layout.html
... ... @@ -96,13 +96,21 @@
96 96 <dl>
97 97 <dd>
98 98 {{if item.abnormalType == 'speed'}}
99   - {{if item.speed>=100}}
100   - 速度异常
101   - {{else}}
102   - 超速({{item.speed}})
103   - {{/if}}
  99 + {{if item.speed>=100}}
  100 + 速度异常
  101 + {{else}}
  102 + 超速({{item.speed}})
  103 + {{/if}}
104 104 {{else if item.abnormalType == 'outbound'}}
105 105 越界
  106 + {{else if item.abnormalType == 'gpsNotValid'}}
  107 + gps无效
  108 + {{else if item.abnormalType == 'linesSwitch'}}
  109 + <span style="font-size:12px;-webkit-transform:scale(0.9);display:block;text-indent: 5px;">{{item.line_line}}</span>
  110 + {{else if item.abnormalType == 'versionSwitch'}}
  111 + 线路版本切换
  112 + {{else if item.abnormalType == 'gpsZero'}}
  113 + 经纬度为0
106 114 {{/if}}
107 115 </dd>
108 116 <dd>{{item.st_str}}</dd>
... ...
src/main/resources/static/real_control_v2/mapmonitor/fragments/playback_v3/left.html
... ... @@ -218,7 +218,7 @@
218 218 fillTrailTable(rs.list);//填充行车轨迹表格
219 219 fillArivalStationTable(rs.list);//填充到离站表格
220 220 $('.sum_mileage_span', leftWrap).text('共约 ' + rs.sumMileage + ' 公里');
221   - fillAbnormalTable(rs['outboundList'], rs['speedList']);//填充异常信息表格
  221 + fillAbnormalTable(rs['outboundList'], rs['speedList'],rs['gpsInvalid'],rs['gpslineSwitch'],rs['lineVerson'],rs['gpslonlatex']);//填充异常信息表格
222 222 //准备播放
223 223 rs.arrivalData = arrivalData;
224 224 $('.gps-play-back-panel-v3>div.right-panel .play-back-tools-wrap').trigger('ready-to-play', rs);
... ... @@ -461,14 +461,21 @@
461 461 for(var i = 0; i < arguments.length; i ++){
462 462 array = array.concat(arguments[i]);
463 463 }
  464 + var i=null;
464 465 //格式化时间
465 466 $.each(array, function () {
  467 + if(!this.abnormalType&&this.version){
  468 + i=array.indexOf(this);
  469 + }
466 470 if(this.st)
467 471 this.st_str = moment(this.st).format('HH:mm.ss');
468 472 if(this.et)
469 473 this.et_str = moment(this.et).format('HH:mm.ss');
470 474 });
471 475  
  476 + if(i){
  477 + array.splice(i,1);
  478 + }
472 479 //排序
473 480 array.sort(function (a, b) {
474 481 return a.st - b.st;
... ...
src/main/resources/static/real_control_v2/mapmonitor/fragments/playback_v3/right.html
... ... @@ -80,6 +80,8 @@
80 80 var timeTip = $('.ui-slider-tip', rightWrap);
81 81 var scale = $('.scale', progress);
82 82 var play_before_flag;
  83 + var lineVersionList;
  84 + var currentVersion;
83 85  
84 86 $('.play-back-tools-wrap', rightWrap).on('ready-to-play', function (e, data) {
85 87 e.stopPropagation();
... ... @@ -89,6 +91,7 @@
89 91 gpsArray = data.list;
90 92 arrivalData = data.arrivalData;
91 93 inoutLen = arrivalData.length;
  94 + lineVersionList=data.lineVerson;
92 95  
93 96 if(!gpsArray || gpsArray.length==0)
94 97 return;
... ... @@ -187,7 +190,6 @@
187 190 $('.top-btn-list .play', rightWrap).on('click', function () {
188 191 if(toolsDisabled())
189 192 return;
190   -debugger
191 193 if(!$(this).hasClass('pause')){
192 194 //第一次点击播放,清除一下
193 195 if(play_before_flag){
... ... @@ -241,7 +243,7 @@ debugger
241 243 }
242 244  
243 245 gps = gpsArray[index];
244   - drawCarMarker(gps);//更新GPS点位
  246 + getLineVersionAnddrawCarMarker(gps);
245 247 updateTrailLine(gps, index);//行车轨迹线
246 248 updateProgress(gps, index)//进度条
247 249  
... ... @@ -276,7 +278,8 @@ debugger
276 278 var xlPolyline = {};
277 279 var circleFirstStop=0;
278 280 var circlePrevStop=0;
279   - var drawCarMarker = function (gps) {
  281 + var circleLine=false;
  282 + var drawCarMarker = function (gps,lineVersion) {
280 283 if(!gpsMarker){
281 284 gpsMarker = new BMap.Marker(new BMap.Point(gps.bd_lon, gps.bd_lat));
282 285 var width = gb_map_imap.calcGpsMarkerWidth(gps.nbbm);
... ... @@ -291,19 +294,21 @@ debugger
291 294 var width = gb_map_imap.calcGpsMarkerWidth(gps.nbbm);
292 295 gpsMarker.setIcon(new BMap.Icon(gb_map_imap.createCarIconRotation(gps, width), new BMap.Size(width, 75)));
293 296 }
294   - var circleLine=queryIsCircle(gps.lineId,gps.nbbm,gps.timestamp,gps.stopNo);
  297 + if (gps.lineId!=xlPolyline.lineId) {
  298 + circleLine=queryIsCircle(gps.lineId,gps.nbbm,gps.timestamp,gps.stopNo);
  299 + }
295 300 if (circleLine)
296 301 circleFirstStop=gps.stopNo;
297 302 circleLine=circleLine&&circlePrevStop!=circleFirstStop?true:false;
298 303 circlePrevStop=gps.stopNo;
299   - if(autoChange && (gps.lineId!=xlPolyline.lineId || gps.upDown!=xlPolyline.upDown||circleLine)){
300   - drawXlPolyline(gps.lineId, gps.upDown);
  304 + if(autoChange && (gps.lineId!=xlPolyline.lineId || gps.upDown!=xlPolyline.upDown||circleLine)||xlPolyline.lineVersion != lineVersion){
  305 + drawXlPolyline(gps.lineId, gps.upDown,lineVersion);
301 306 }
302 307 }
303 308  
304 309 var bform = $('.buffer_area_form', rightWrap);
305 310 var autoChange=true;
306   - function drawXlPolyline(lineCode, upDown) {
  311 + function drawXlPolyline(lineCode, upDown,lineVersion) {
307 312 if(upDown!=0 && upDown!=1){
308 313 //upDown = xlPolyline.upDown?xlPolyline.upDown:0;
309 314 return;
... ... @@ -311,19 +316,21 @@ debugger
311 316  
312 317 clearXlPolyline();
313 318 //绘制路段
314   - drawRoadPolyline(lineCode, upDown);
  319 + drawRoadPolyline(lineCode, upDown,lineVersion);
315 320 //绘制站点
316 321 if($('input[name=drawPoint]', bform)[0].checked)
317   - drawStationMarkers(lineCode, upDown);
  322 + drawStationMarkers(lineCode, upDown,lineVersion);
318 323 //绘制缓冲区
319 324 if($('input[name=drawBuffArea]', bform)[0].checked)
320   - drawBuffArea(lineCode, upDown);
  325 + drawBuffArea(lineCode, upDown,lineVersion);
321 326 //绘制站点名称
322 327 if($('input[name=stationName]', bform)[0].checked)
323   - drawNameMarkers(lineCode, upDown);
  328 + drawNameMarkers(lineCode, upDown,lineVersion);
324 329  
325 330 xlPolyline.lineId = lineCode;
326 331 xlPolyline.upDown = upDown;
  332 + xlPolyline.lineVersion = lineVersion;
  333 + currentVersion =lineVersion;
327 334 }
328 335  
329 336 var storage = window.localStorage;
... ... @@ -331,9 +338,9 @@ debugger
331 338 var stations;//站点
332 339 var parks;//停车场
333 340  
334   - function drawRoadPolyline(lineCode, upDown) {
  341 + function drawRoadPolyline(lineCode, upDown,lineVersion) {
335 342 //从localStorage获取路段
336   - routes = JSON.parse(storage.getItem(lineCode + '_route'));
  343 + routes = JSON.parse(storage.getItem(lineCode+"_"+lineVersion + '_route'));
337 344 if(!routes){
338 345 var name = gb_data_basic.lineCode2NameAll()[lineCode];
339 346 notify_err("缺少" + name + "的路段信息,请选择" + name + "进入线调");
... ... @@ -355,7 +362,7 @@ debugger
355 362 xlPolyline.polylines = pls;
356 363 }
357 364  
358   - function drawStationMarkers(lineCode, upDown) {
  365 + function drawStationMarkers(lineCode, upDown,lineVersion) {
359 366 if(!lineCode)return;
360 367 //从地图模块获取站点数据
361 368 stations = gb_map_spatial_data.getStationArray(lineCode);
... ... @@ -367,6 +374,8 @@ debugger
367 374  
368 375 var array = stations[upDown], psm, zdMarkers=[];
369 376 $.each(array, function () {
  377 + if(this.versions==lineVersion){
  378 +
370 379 //坐标转换
371 380 var coord = TransGPS.wgsToBD(this.lat, this.lon);
372 381 this.bd_lat = coord.lat;
... ... @@ -376,11 +385,12 @@ debugger
376 385 map.addOverlay(psm);
377 386 psm.setIcon(new BMap.Icon(gb_map_imap.createStationPointIcon(), new BMap.Size(12, 12)));
378 387 zdMarkers.push(psm);
  388 + }
379 389 });
380 390 xlPolyline.zdMarkers=zdMarkers;
381 391 }
382 392  
383   - function drawBuffArea(lineCode, upDown) {
  393 + function drawBuffArea(lineCode, upDown,lineVersion) {
384 394 if(!lineCode)return;
385 395 stations = gb_map_spatial_data.getStationArray(lineCode);
386 396 if(!stations){
... ... @@ -391,6 +401,7 @@ debugger
391 401  
392 402 var array = stations[upDown], obj, buffs=[];
393 403 $.each(array, function () {
  404 + if(this.versions==lineVersion){
394 405 if(this.shapesType=='r')
395 406 obj = drawCircle(new BMap.Point(this.bd_lon, this.bd_lat), this.radius);
396 407 else if(this.shapesType=='d')
... ... @@ -398,12 +409,13 @@ debugger
398 409  
399 410 if(obj)
400 411 buffs.push(obj);
  412 + }
401 413 });
402 414  
403 415 xlPolyline.buffs = buffs;
404 416 }
405 417  
406   - function drawNameMarkers(lineCode, upDown) {
  418 + function drawNameMarkers(lineCode, upDown,lineVersion) {
407 419 if(!lineCode)return;
408 420 //从地图模块获取站点数据
409 421 stations = gb_map_spatial_data.getStationArray(lineCode);
... ... @@ -416,6 +428,8 @@ debugger
416 428 var style = {backgroundColor: "rgba(255, 255, 255, 0.69)",color : "black", borderColor: "black", fontSize : "12px", height : "16px", lineHeight : "16px", fontFamily:"微软雅黑"}
417 429 var array = stations[upDown], tMarkers=[];
418 430 $.each(array, function () {
  431 + if (this.versions==lineVersion) {
  432 +
419 433 var width = this.stationName.length * 12;
420 434 var label = new BMap.Label(this.stationName, {
421 435 position:new BMap.Point(this.bd_lon, this.bd_lat),
... ... @@ -424,6 +438,7 @@ debugger
424 438 label.setStyle(style);
425 439 map.addOverlay(label);
426 440 tMarkers.push(label);
  441 + }
427 442 });
428 443  
429 444 xlPolyline.tMarkers = tMarkers;
... ... @@ -564,27 +579,28 @@ debugger
564 579 var name = $(this).attr('name'),
565 580 lineCode = xlPolyline.lineId,
566 581 upDown = xlPolyline.upDown;
  582 + linesVersion = xlPolyline.lineVersion;
567 583 switch (name){
568 584 case 'stationName':
569 585 //清除站点名称
570 586 clearOverlayArray(xlPolyline.tMarkers);
571 587 xlPolyline.tMarkers = [];
572 588 if(this.checked)
573   - drawNameMarkers(lineCode, upDown);
  589 + drawNameMarkers(lineCode, upDown,linesVersion);
574 590 break;
575 591 case 'drawBuffArea':
576 592 //清除缓冲区
577 593 clearOverlayArray(xlPolyline.buffs);
578 594 xlPolyline.buffs = [];
579 595 if(this.checked)
580   - drawBuffArea(lineCode, upDown);
  596 + drawBuffArea(lineCode, upDown,linesVersion);
581 597 break;
582 598 case 'drawPoint':
583 599 //清除站点
584 600 clearOverlayArray(xlPolyline.zdMarkers);
585 601 xlPolyline.zdMarkers = [];
586 602 if(this.checked)
587   - drawStationMarkers(lineCode, upDown);
  603 + drawStationMarkers(lineCode, upDown,linesVersion);
588 604 break;
589 605 }
590 606 });
... ... @@ -607,7 +623,8 @@ debugger
607 623 var gps = gpsArray[ei];
608 624 updateProgress(gps, ei);
609 625 //更新gps marker
610   - drawCarMarker(gps);
  626 + getLineVersionAnddrawCarMarker(gps);
  627 + //drawCarMarker(gps,lineVersionList);
611 628  
612 629 //更新轨迹线条
613 630 trailArray = [];
... ... @@ -645,8 +662,9 @@ debugger
645 662 return;
646 663  
647 664 var gps = gpsArray[ei];
  665 + getLineVersionAnddrawCarMarker(gps);
648 666 //更新gps marker
649   - drawCarMarker(gps);
  667 + //drawCarMarker(gps,lineVersionList);
650 668 //更新轨迹线条
651 669 trailArray = [];
652 670 var i = 0;
... ... @@ -659,6 +677,17 @@ debugger
659 677 //居中
660 678 map.panTo(gpsMarker.getPosition());
661 679 }
  680 + function getLineVersionAnddrawCarMarker(gps){
  681 + if(lineVersionList.length>0){
  682 + for (var i = 0; i < lineVersionList.length; i++) {
  683 + if ((lineVersionList[i].endTime&&lineVersionList[i].endTime>gps.timestamp)||(lineVersionList[i].startTime&&lineVersionList[i].startTime<gps.timestamp)||(lineVersionList[i].vtime&&lineVersionList[i].vtime=='all')) {
  684 + drawCarMarker(gps,lineVersionList[i].version);//更新GPS点位
  685 + }
  686 + }
  687 + }else {
  688 + drawCarMarker(gps,0);//除非线路没有版本信息
  689 + }
  690 + }
662 691  
663 692 /**
664 693 * 初始化停车场下拉菜单
... ... @@ -746,7 +775,7 @@ debugger
746 775 var code = $(this).data('code');
747 776 var updown = $(this).data('dir');
748 777 autoChange = false;
749   - drawXlPolyline(code, updown);
  778 + drawXlPolyline(code, updown,currentVersion);
750 779 });
751 780 })();
752 781  
... ...