Commit b7789aeba2dcbae3d16c0721667de81a2975c8e4
Merge remote-tracking branch 'origin/pudong' into pudong
Showing
34 changed files
with
2997 additions
and
1327 deletions
Too many changes to show.
To preserve performance only 34 of 67 files are displayed.
README.md
| 1 | -公交调度系统BS版 0.1 | ||
| 2 | -====== | ||
| 3 | ----------- | ||
| 4 | -## 目录 | ||
| 5 | ---------- | ||
| 6 | - * [字典表](#字典表) | ||
| 7 | - * [动态jpa查询实现](#动态jpa查询实现) | ||
| 8 | - * [车载 gps 相关数据](#gps) | ||
| 9 | - * [实时gps数据接口 http](#实时gps接口) | ||
| 10 | - * [进出站数据表结构](#进站数据) | ||
| 11 | - * [异常警报表结构](#异常警报) | ||
| 12 | - * [大间隔](#大间隔) | ||
| 13 | - * [超速](#超速) | ||
| 14 | - * [越界](#越界) | ||
| 15 | - * [越站](#越站) | ||
| 16 | - * [聚集](#聚集) | ||
| 17 | - * [掉线](#掉线) | ||
| 18 | - * [调度消息下发接口HTTP](#调度消息下发接口) | ||
| 19 | - * [调度消息上传接口HTTP](#调度消息上传接口) | ||
| 20 | - * [车辆历史GPS数据](#车辆历史GPS) | ||
| 21 | - | ||
| 22 | ----------- | ||
| 23 | - | ||
| 24 | -## 字典表 | ||
| 25 | ----------- | ||
| 26 | -字典操作全部由前端负责,主要有2种。 | ||
| 27 | - | ||
| 28 | -1、转换字典代码。 | ||
| 29 | - 当pjax的`pjax:success`事件被触发(片段加载完成) | ||
| 30 | - 扫描容器内所有有 `$(".nt-dictionary")` 元素进行字典转换 | ||
| 31 | -``` html | ||
| 32 | ---dom标签为span div p h1 h2 h3 h4 h5 h6 等等文本元素时,如下写法,text为要转换的代码 | ||
| 33 | -<span class="nt-dictionary" data-group="ScheduleType">out</span> | ||
| 34 | ---to | ||
| 35 | -<span>出场</span> | ||
| 36 | - | ||
| 37 | -<!- dom标签为input时,如下 data-code为要转换的代码 --> | ||
| 38 | -<input class="nt-dictionary" data-group="ScheduleType" data-code="out"> | ||
| 39 | ---to | ||
| 40 | -<input value="出场"> | ||
| 41 | - | ||
| 42 | -<!- dom标签为select时 如下 data-code为要选中的项 --> | ||
| 43 | -<select class="nt-dictionary" data-group="ScheduleType" data-code="out"></select> | ||
| 44 | ---to | ||
| 45 | -<select> | ||
| 46 | - <option value="normal">正常班次</option> | ||
| 47 | - <option value="out" selected>出场</option> | ||
| 48 | - <option value="in">进场</option> | ||
| 49 | - <option value="oil">加油</option> | ||
| 50 | - <option value="temp">临加</option> | ||
| 51 | - <option value="region">区间</option> | ||
| 52 | - <option value="venting">放空</option> | ||
| 53 | - <option value="major">放大站</option> | ||
| 54 | -</select> | ||
| 55 | -``` | ||
| 56 | -*原标签的class 除nt-dictionary 外,其余均会被保留* | ||
| 57 | - | ||
| 58 | -2、dictionary.js提供如下方法自行使用 | ||
| 59 | -| 方法名 | 参数|返回| | ||
| 60 | -| ---- | ---- | ---- | ---- | | ||
| 61 | -| groups (获取所有字典组) | 无| | {LineTrend: 线路走向, ScheduleType: 班次类型} | | ||
| 62 | -| getByGroup (获取字典组下的字典)| (group) |{0: 上行, 1: 下行}| | ||
| 63 | -| transformCode (转换字典代码)| (group, code) | 上行 | | ||
| 64 | - | ||
| 65 | -## 动态jpa查询实现 | ||
| 66 | ----------- | ||
| 67 | -*参考调度系统枚举com.bsth.entity.search.SearchOperator* | ||
| 68 | - | ||
| 69 | - | ||
| 70 | -## gps | ||
| 71 | ----------- | ||
| 72 | -### 实时gps接口 | ||
| 73 | - | ||
| 74 | -所有在线GPS: [http://192.168.168.192:8080/transport_server/rtgps](http://192.168.168.192:8080/transport_server/rtgps/) | ||
| 75 | -根据设备号查询:[http://192.168.168.192:8080/transport_server/rtgps/05B01901](http://192.168.168.192:8080/transport_server/rtgps/05B01901) | ||
| 76 | - | ||
| 77 | -<span style="color: red">Response</span>: | ||
| 78 | -```json | ||
| 79 | -{ | ||
| 80 | - "data":[ | ||
| 81 | - { | ||
| 82 | - "companyCode":5, | ||
| 83 | - "lineId":10329, | ||
| 84 | - "deviceId":"05B01901", | ||
| 85 | - "carparkNo":"00000000", | ||
| 86 | - "stopNo":"7C890002", | ||
| 87 | - "lon":121.549866, | ||
| 88 | - "lat":31.238798, | ||
| 89 | - "timestamp":1397104499000, | ||
| 90 | - "speed":42.0, | ||
| 91 | - "direction":245.9, | ||
| 92 | - "state":0, | ||
| 93 | - "upDown":0 | ||
| 94 | - }] | ||
| 95 | -} | ||
| 96 | -``` | ||
| 97 | - | ||
| 98 | -| -- | --|--| | ||
| 99 | -| ---- | ---- | ---- | | ||
| 100 | -| companyCode | int | 公司代码 | | ||
| 101 | -| lineId | int | 线路编码 | | ||
| 102 | -| deviceId | String | 设备编号 | | ||
| 103 | -| carparkNo | String | 停车场编码 | | ||
| 104 | -| stopNo | String | 站点编码 | | ||
| 105 | -| lon | float | 经度 | | ||
| 106 | -| lat | float | 纬度 | | ||
| 107 | -| timestamp | long | 时间戳 | | ||
| 108 | -| speed | float | 速度| | ||
| 109 | -| direction | float | 方向(角度) | | ||
| 110 | -| state | int | 营运状态( 0 营运 ,1 非营运, -1 无效) | | ||
| 111 | -| upDown | int | 上下行(0 上行 , 1 下行 , -1 无效)| | ||
| 112 | - | ||
| 113 | - | ||
| 114 | -### 进站数据 | ||
| 115 | ----------- | ||
| 116 | -表名: | ||
| 117 | - | ||
| 118 | -| .. | .. | .. | | ||
| 119 | -| ---- | ---- | ---- | | ||
| 120 | -| id | int | 主键 | | ||
| 121 | -| deviceId | String | 设备号 | | ||
| 122 | -| lineId | int | 线路编码 | | ||
| 123 | -| stopNo | long | 站点编码 | | ||
| 124 | -| timestamp | long | 时间戳 | | ||
| 125 | -| upDown | int | 上下行(0 上行 , 1 下行 , -1 无效) | | ||
| 126 | -| createDate | Date | 创建时间 | | ||
| 127 | - | ||
| 128 | - | ||
| 129 | -### 异常警报 | ||
| 130 | ----------- | ||
| 131 | - | ||
| 132 | -### 大间隔 | ||
| 133 | ----------- | ||
| 134 | -表名: | ||
| 135 | - | ||
| 136 | -| .. | .. | .. | | ||
| 137 | -| ---- | ---- | ---- | | ||
| 138 | -| id | int | 主键 | | ||
| 139 | -| line | int | 线路编码 | | ||
| 140 | -| station | String | 站点编码 | | ||
| 141 | -| cVehicle | String | 当前车辆编码 | | ||
| 142 | -| lastVehicle | String | 上一个车辆编码 | | ||
| 143 | -| interval | long | 间隔时间(秒) | | ||
| 144 | -| timestamp | long | 时间戳 | | ||
| 145 | -| createDate | Date | 创建时间 | | ||
| 146 | - | ||
| 147 | -### 超速 | ||
| 148 | ----------- | ||
| 149 | -表名: | ||
| 150 | - | ||
| 151 | -| .. | .. | .. | | ||
| 152 | -| ---- | ---- | ---- | | ||
| 153 | -| id | int | 主键 | | ||
| 154 | -| vehicle | String | 车辆编码 | | ||
| 155 | -| line | int | 线路编码 | | ||
| 156 | -| upDown | int | 上下行(0 上行 , 1 下行 , -1 无效) | | ||
| 157 | -| lon | float | 经度 | | ||
| 158 | -| lat | float | 纬度| | ||
| 159 | -| speed | float | 速度 | | ||
| 160 | -| timestamp | long | 时间戳 | | ||
| 161 | -| createDate | Date | 时间 | | ||
| 162 | - | ||
| 163 | -### 越界 | ||
| 164 | ----------- | ||
| 165 | -表名: | ||
| 166 | - | ||
| 167 | -| .. | .. | .. | | ||
| 168 | -| ---- | ---- | ---- | | ||
| 169 | -| id | int | 主键 | | ||
| 170 | -| vehicle | String | 车辆编码 | | ||
| 171 | -| line | int | 线路编码 | | ||
| 172 | -| upDown | int | 上下行(0 上行 , 1 下行 , -1 无效) | | ||
| 173 | -| lon | float | 经度 | | ||
| 174 | -| lat | float | 纬度| | ||
| 175 | -| location | String | 越界位置(由线调页面进行初始转换)意思是该字段默认为空,页面第一次查看时会写入值| | ||
| 176 | -| timestamp | long | 时间戳 | | ||
| 177 | -| createDate | Date | 时间 | | ||
| 178 | - | ||
| 179 | - | ||
| 180 | -### 越站 | ||
| 181 | ----------- | ||
| 182 | -表名: | ||
| 183 | - | ||
| 184 | -| .. | .. | .. | | ||
| 185 | -| ---- | ---- | ---- | | ||
| 186 | -| id | int | 主键 | | ||
| 187 | -| line | int | 线路编码 | | ||
| 188 | -| upDown | int | 上下行(0 上行 , 1 下行 , -1 无效) | | ||
| 189 | -| station | String | 站点编码 | | ||
| 190 | -| vehicle | String | 车辆编码 | | ||
| 191 | -| inData | Date | 进站时间 | | ||
| 192 | -| outDate | Date | 出站时间 | | ||
| 193 | - | ||
| 194 | - | ||
| 195 | -### 聚集 | ||
| 196 | ----------- | ||
| 197 | -表名: | ||
| 198 | - | ||
| 199 | -| .. | .. | .. | | ||
| 200 | -| ---- | ---- | ---- | | ||
| 201 | -| id | int | 主键 | | ||
| 202 | -| line | int | 线路编码 | | ||
| 203 | -| upDown | int | 上下行(0 上行 , 1 下行 , -1 无效) | | ||
| 204 | -| stations | String | 站点(多个用 , 号分隔。应该是连续站点) | | ||
| 205 | -| vehicles | String | 车辆编码(多个用 , 号分隔) | | ||
| 206 | -| timestamp | long | 时间戳 | | ||
| 207 | -| createDate | Date | 时间 | | ||
| 208 | - | ||
| 209 | - | ||
| 210 | -### 掉线 | ||
| 211 | ----------- | ||
| 212 | -表名: | ||
| 213 | - | ||
| 214 | -| .. | .. | .. | | ||
| 215 | -| ---- | ---- | ---- | | ||
| 216 | -| id | int | 主键 | | ||
| 217 | -| line | int | 线路编码 | | ||
| 218 | -| upDown | int | 上下行(0 上行 , 1 下行 , -1 无效) | | ||
| 219 | -| vehicle | String | 车辆编码 | | ||
| 220 | -| lon | float | 经度 | | ||
| 221 | -| lat | float | 纬度| | ||
| 222 | -| timestamp | long | 时间戳 | | ||
| 223 | -| createDate | Date | 时间 | | ||
| 224 | - | ||
| 225 | - | ||
| 226 | -### 调度消息下发接口 | ||
| 227 | ----------- | ||
| 228 | -[http://192.168.168.192:8080/transport_server/message](http://192.168.168.192:8080/transport_server/message/) | ||
| 229 | - | ||
| 230 | -<span style="color: red">Request</span>: | ||
| 231 | -```json | ||
| 232 | -{ | ||
| 233 | - "deviceId":12345, | ||
| 234 | - "timestamp":44324, | ||
| 235 | - "operCode":0x60, | ||
| 236 | - "data":{ | ||
| 237 | - "companyCode":22, | ||
| 238 | - "deviceId":"029L2222", | ||
| 239 | - "timestamp":134326, | ||
| 240 | - "instructType":00, | ||
| 241 | - "dispatchInstruct":0x00, | ||
| 242 | - "msgId":12345, | ||
| 243 | - "alarmTime":201606012000, | ||
| 244 | - "serviceState":00000000, | ||
| 245 | - "txtContent":"你好" | ||
| 246 | - } | ||
| 247 | -} | ||
| 248 | -``` | ||
| 249 | -| .. | .. | .. | | ||
| 250 | -| ---- | ---- | ---- | | ||
| 251 | -| deviceId | string | 设备编号 | | ||
| 252 | -| timestamp | long | 时间戳(ms) | | ||
| 253 | -| operCode | short | 一级协议 | | ||
| 254 | -| data.companyCode | short | 公司代码 | | ||
| 255 | -| data.deviceId | string | 设备编号 | | ||
| 256 | -| data.timestamp | long | 时间戳 | | ||
| 257 | -| data.instructType | short | 保留 默认0 | | ||
| 258 | -| data.dispatchInstruct | short | 调度指令 调度指令。0X00表示信息短语,0X01表示取消上次指令+调度指令(闹钟有效),0x02表示为调度指令(闹钟有效); 0x03表示运营状态指令(闹钟无效);0x04表示其他指令。| | ||
| 259 | -| data.msgId | long | 同上 | | ||
| 260 | -| data.alarmTime | long | 闹钟 MMddhhmm| | ||
| 261 | -| data.serviceState | long | 多状态字节 先由车载发起车辆故障、事故报告、扣证、纠纷、加油等审请,经调度确认后,下发调度指令与运营状态。当调度指令为0X00终端需要提示信息。当调度指令为0x01和0x02,终端需要收到后提示信息。并且必须在闹钟结束后进行终端相关状态更新。在闹钟时间前120秒开始提示。当调度指令为0x03,收到后进行终端相关状态更新,终端不需要提示信息。当调度指令为0x04,暂不需要提示信息。| | ||
| 262 | -| data.txtContent | string | 下发的消息文本 | | ||
| 263 | -```json | ||
| 264 | -{ | ||
| 265 | - "deviceId":12345, | ||
| 266 | - "timestamp":44324, | ||
| 267 | - "operCode":0x64, | ||
| 268 | - "data":{ | ||
| 269 | - "cityCode":22, | ||
| 270 | - "deviceId":"029L2222", | ||
| 271 | - "lineId":"134326" | ||
| 272 | - } | ||
| 273 | -} | ||
| 274 | -``` | ||
| 275 | -| .. | .. | .. | | ||
| 276 | -| ---- | ---- | ---- | | ||
| 277 | -| deviceId | string | 设备编号 | | ||
| 278 | -| timestamp | long | 时间戳(ms) | | ||
| 279 | -| operCode | short | 一级协议 | | ||
| 280 | -| data.cityCode | short | 城市区号 | | ||
| 281 | -| data.deviceId | string | 设备编号 | | ||
| 282 | -| data.lineId | string | 线路编号 6位 不足6位前面补0 如编号890 用000890表示 | | ||
| 283 | - | ||
| 284 | -```json | ||
| 285 | -{ | ||
| 286 | - "deviceId":12345, | ||
| 287 | - "timestamp":44324, | ||
| 288 | - "operCode":0xC0, | ||
| 289 | - "data":{ | ||
| 290 | - "operCode":0x86, | ||
| 291 | - "requestAck":0x06 | ||
| 292 | - } | ||
| 293 | -} | ||
| 294 | -``` | ||
| 295 | -| .. | .. | .. | | ||
| 296 | -| ---- | ---- | ---- | | ||
| 297 | -| deviceId | string | 设备编号 | | ||
| 298 | -| timestamp | long | 时间戳(ms) | | ||
| 299 | -| operCode | short | 一级协议 | | ||
| 300 | -| data.operCode | short | 二级协议 | | ||
| 301 | -| data.requestAck | short | 请求应答字 0x06同意 0x15不同意| | ||
| 302 | - | ||
| 303 | -```json | ||
| 304 | -{ | ||
| 305 | - "deviceId":12345, | ||
| 306 | - "timestamp":44324, | ||
| 307 | - "operCode":0xC0, | ||
| 308 | - "data":{ | ||
| 309 | - "operCode":0xa3, | ||
| 310 | - "deviceId":12345, | ||
| 311 | - "ipAddress":222.66.0.204, | ||
| 312 | - "port":8899, | ||
| 313 | - "reportMode":0, | ||
| 314 | - "interval":0, | ||
| 315 | - "distance":0, | ||
| 316 | - "speedingThreshold":0, | ||
| 317 | - "alarmThreshold":0, | ||
| 318 | - "posIpAddress":0, | ||
| 319 | - "posPort":0, | ||
| 320 | - "delay":0, | ||
| 321 | - "speedThreshold1":0, | ||
| 322 | - "speedThreshold2":0, | ||
| 323 | - "contrast":0, | ||
| 324 | - "brightness":0, | ||
| 325 | - "saturation":0 | ||
| 326 | - } | ||
| 327 | -} | ||
| 328 | -``` | ||
| 329 | -| .. | .. | .. | | ||
| 330 | -| ---- | ---- | ---- | | ||
| 331 | -| deviceId | string | 设备编号 | | ||
| 332 | -| timestamp | long | 时间戳(ms) | | ||
| 333 | -| operCode | short | 一级协议 | | ||
| 334 | -| data.operCode | short | 二级协议 | | ||
| 335 | -| data.deviceId | string | 设备编号| | ||
| 336 | -| data.ipAddress | string | 网关IP地址| | ||
| 337 | -| data.port | string | 网关端口| | ||
| 338 | -| data.reportMode | short | 定时定距上报模式| | ||
| 339 | -| data.interval | int | 定时上报时间间隔| | ||
| 340 | -| data.distance | string | 定距上报距离间隔| | ||
| 341 | -| data.speedingThreshold | short | 非线路状态超速阀门| | ||
| 342 | -| data.alarmThreshold | short | 预警阀门| | ||
| 343 | -| data.posIpAddress | string | pos机IP地址| | ||
| 344 | -| data.posPort | string | pos机端口| | ||
| 345 | -| data.delay | int | 延迟机关时间| | ||
| 346 | -| data.deviceId | short | 中门视频切换到码表界面速度阀门 默认45| | ||
| 347 | -| data.deviceId | short | 码表界面切换到中门视频速度阀门 默认35| | ||
| 348 | -| data.deviceId | short | 对比度| | ||
| 349 | -| data.deviceId | short | 亮度| | ||
| 350 | -| data.deviceId | short | 饱和度| | ||
| 351 | - | ||
| 352 | -```json | ||
| 353 | -{ | ||
| 354 | - "deviceId":12345, | ||
| 355 | - "timestamp":44324, | ||
| 356 | - "operCode":0xC0, | ||
| 357 | - "data":{ | ||
| 358 | - "operCode":0xa4 | ||
| 359 | - } | ||
| 360 | -} | ||
| 361 | -``` | ||
| 362 | -| .. | .. | .. | | ||
| 363 | -| ---- | ---- | ---- | | ||
| 364 | -| deviceId | string | 设备编号 | | ||
| 365 | -| timestamp | long | 时间戳(ms) | | ||
| 366 | -| operCode | short | 一级协议 | | ||
| 367 | -| data.operCode | short | 二级协议 | | ||
| 368 | - | ||
| 369 | -```json | ||
| 370 | -{ | ||
| 371 | - "deviceId":12345, | ||
| 372 | - "timestamp":44324, | ||
| 373 | - "operCode":0xC0, | ||
| 374 | - "data":{ | ||
| 375 | - "operCode":0xa5 | ||
| 376 | - "programVersion":2 | ||
| 377 | - } | ||
| 378 | -} | ||
| 379 | -``` | ||
| 380 | -| .. | .. | .. | | ||
| 381 | -| ---- | ---- | ---- | | ||
| 382 | -| deviceId | string | 设备编号 | | ||
| 383 | -| timestamp | long | 时间戳(ms) | | ||
| 384 | -| operCode | short | 一级协议 | | ||
| 385 | -| data.operCode | short | 二级协议 | | ||
| 386 | -| data.programVersion | short | 程序版本 | | ||
| 387 | - | ||
| 388 | -<span style="color: red">Response</span>: | ||
| 389 | -```json | ||
| 390 | -{ | ||
| 391 | - "errCode":0 | ||
| 392 | -} | ||
| 393 | -``` | ||
| 394 | - | ||
| 395 | -### 调度消息上传接口 | ||
| 396 | ----------- | ||
| 397 | -上行POST地址:[http://192.168.168.120:9088/control/upstream](http://192.168.168.120:9088/control/upstream) | ||
| 398 | -<span style="color: red">Request</span>: | ||
| 399 | -```json | ||
| 400 | -{ | ||
| 401 | - "deviceId":12345, | ||
| 402 | - "timestamp":44324, | ||
| 403 | - "status":0, | ||
| 404 | - "operCode":0x80, | ||
| 405 | - "data":{ | ||
| 406 | - "operCode":0x26, | ||
| 407 | - "requestCode":22 | ||
| 408 | - } | ||
| 409 | -} | ||
| 410 | -``` | ||
| 411 | -| .. | .. | .. | | ||
| 412 | -| ---- | ---- | ---- | | ||
| 413 | -| deviceId | string | 设备编号 | | ||
| 414 | -| timestamp | long | 时间戳(ms) | | ||
| 415 | -| status | int | 0x80时无数据 0表示失败 1表示成功或设备确认 2表示驾驶员阅读 | | ||
| 416 | -| operCode | short | 一级协议 消息确认将无数据 | | ||
| 417 | -| data.operCode | short | 二级协议 | | ||
| 418 | -| data.requestCode | short | 请求代码0xa1 恢复运营 0xa2 申请调档 0xa3 出场请求 0xa5 进场请求 0xa7 加油请求 0x50 车辆故障 0x70 路阻报告 0x60 事故报告 0x11 扣证纠纷 0x12 报警 | | ||
| 419 | -<span style="color: red">Response</span>: | ||
| 420 | -```json | ||
| 421 | -{ | ||
| 422 | - "errCode":0 | ||
| 423 | -} | ||
| 424 | -``` | ||
| 425 | - | ||
| 426 | -### 车辆历史GPS | ||
| 427 | ----------- | ||
| 428 | -表名:BSTH_C_GPS_INFO | ||
| 429 | - | ||
| 430 | -| .. | .. | .. | | ||
| 431 | -| ---- | ---- | ---- | | ||
| 432 | -| cityCode | int | 城市代码 | | ||
| 433 | -| industryCode | int | 行业代码 | | ||
| 434 | -| companyCode | int | 企业代码 | | ||
| 435 | -| lineId | int | 线路编号 | | ||
| 436 | -| deviceId | string | 设备编号 | | ||
| 437 | -| driverNo | int | 驾驶员工号 | | ||
| 438 | -| carparkSerialNo | int | 停车场序列号 | | ||
| 439 | -| carparkNo | string | 停车场编号 | | ||
| 440 | -| stopSerialNo | int | 站点序列号 | | ||
| 441 | -| stopNo | string | 停车场编号 | | ||
| 442 | -| lon | float | 经度 | | ||
| 443 | -| lat | float | 维度 | | ||
| 444 | -| ts | long | 时间戳 | | ||
| 445 | -| speedSensor | float | 发动机速度 | | ||
| 446 | -| speedGps | float | gps速度 | | ||
| 447 | -| direction | float | 角度0-359 | | ||
| 448 | -| inTemp | int | 车内温度 | | ||
| 449 | -| serviceState | long | 设备状态字 | | ||
| 450 | -| daysYear | int | 对应年中的天数 为分区字段 查询一定要用此字段过滤 | | ||
| 451 | - | 1 | +公交调度系统BS版 0.1 |
| 2 | +====== | ||
| 3 | +---------- | ||
| 4 | +## 目录 | ||
| 5 | +--------- | ||
| 6 | + * [字典表](#字典表) | ||
| 7 | + * [动态jpa查询实现](#动态jpa查询实现) | ||
| 8 | + * [车载 gps 相关数据](#gps) | ||
| 9 | + * [实时gps数据接口 http](#实时gps接口) | ||
| 10 | + * [进出站数据表结构](#进站数据) | ||
| 11 | + * [异常警报表结构](#异常警报) | ||
| 12 | + * [大间隔](#大间隔) | ||
| 13 | + * [超速](#超速) | ||
| 14 | + * [越界](#越界) | ||
| 15 | + * [越站](#越站) | ||
| 16 | + * [聚集](#聚集) | ||
| 17 | + * [掉线](#掉线) | ||
| 18 | + * [调度消息下发接口HTTP](#调度消息下发接口) | ||
| 19 | + * [调度消息上传接口HTTP](#调度消息上传接口) | ||
| 20 | + * [车辆历史GPS数据](#车辆历史GPS) | ||
| 21 | + | ||
| 22 | +---------- | ||
| 23 | + | ||
| 24 | +## 字典表 | ||
| 25 | +---------- | ||
| 26 | +字典操作全部由前端负责,主要有2种。 | ||
| 27 | + | ||
| 28 | +1、转换字典代码。 | ||
| 29 | + 当pjax的`pjax:success`事件被触发(片段加载完成) | ||
| 30 | + 扫描容器内所有有 `$(".nt-dictionary")` 元素进行字典转换 | ||
| 31 | +``` html | ||
| 32 | +--dom标签为span div p h1 h2 h3 h4 h5 h6 等等文本元素时,如下写法,text为要转换的代码 | ||
| 33 | +<span class="nt-dictionary" data-group="ScheduleType">out</span> | ||
| 34 | +--to | ||
| 35 | +<span>出场</span> | ||
| 36 | + | ||
| 37 | +<!- dom标签为input时,如下 data-code为要转换的代码 --> | ||
| 38 | +<input class="nt-dictionary" data-group="ScheduleType" data-code="out"> | ||
| 39 | +--to | ||
| 40 | +<input value="出场"> | ||
| 41 | + | ||
| 42 | +<!- dom标签为select时 如下 data-code为要选中的项 --> | ||
| 43 | +<select class="nt-dictionary" data-group="ScheduleType" data-code="out"></select> | ||
| 44 | +--to | ||
| 45 | +<select> | ||
| 46 | + <option value="normal">正常班次</option> | ||
| 47 | + <option value="out" selected>出场</option> | ||
| 48 | + <option value="in">进场</option> | ||
| 49 | + <option value="oil">加油</option> | ||
| 50 | + <option value="temp">临加</option> | ||
| 51 | + <option value="region">区间</option> | ||
| 52 | + <option value="venting">放空</option> | ||
| 53 | + <option value="major">放大站</option> | ||
| 54 | +</select> | ||
| 55 | +``` | ||
| 56 | +*原标签的class 除nt-dictionary 外,其余均会被保留* | ||
| 57 | + | ||
| 58 | +2、dictionary.js提供如下方法自行使用 | ||
| 59 | +| 方法名 | 参数|返回| | ||
| 60 | +| ---- | ---- | ---- | ---- | | ||
| 61 | +| groups (获取所有字典组) | 无| | {LineTrend: 线路走向, ScheduleType: 班次类型} | | ||
| 62 | +| getByGroup (获取字典组下的字典)| (group) |{0: 上行, 1: 下行}| | ||
| 63 | +| transformCode (转换字典代码)| (group, code) | 上行 | | ||
| 64 | + | ||
| 65 | +## 动态jpa查询实现 | ||
| 66 | +---------- | ||
| 67 | +*参考调度系统枚举com.bsth.entity.search.SearchOperator* | ||
| 68 | + | ||
| 69 | + | ||
| 70 | +## gps | ||
| 71 | +---------- | ||
| 72 | +### 实时gps接口 | ||
| 73 | + | ||
| 74 | +所有在线GPS: [http://192.168.168.192:8080/transport_server/rtgps](http://192.168.168.192:8080/transport_server/rtgps/) | ||
| 75 | +根据设备号查询:[http://192.168.168.192:8080/transport_server/rtgps/05B01901](http://192.168.168.192:8080/transport_server/rtgps/05B01901) | ||
| 76 | + | ||
| 77 | +<span style="color: red">Response</span>: | ||
| 78 | +```json | ||
| 79 | +{ | ||
| 80 | + "data":[ | ||
| 81 | + { | ||
| 82 | + "companyCode":5, | ||
| 83 | + "lineId":10329, | ||
| 84 | + "deviceId":"05B01901", | ||
| 85 | + "carparkNo":"00000000", | ||
| 86 | + "stopNo":"7C890002", | ||
| 87 | + "lon":121.549866, | ||
| 88 | + "lat":31.238798, | ||
| 89 | + "timestamp":1397104499000, | ||
| 90 | + "speed":42.0, | ||
| 91 | + "direction":245.9, | ||
| 92 | + "state":0, | ||
| 93 | + "upDown":0 | ||
| 94 | + }] | ||
| 95 | +} | ||
| 96 | +``` | ||
| 97 | + | ||
| 98 | +| -- | --|--| | ||
| 99 | +| ---- | ---- | ---- | | ||
| 100 | +| companyCode | int | 公司代码 | | ||
| 101 | +| lineId | int | 线路编码 | | ||
| 102 | +| deviceId | String | 设备编号 | | ||
| 103 | +| carparkNo | String | 停车场编码 | | ||
| 104 | +| stopNo | String | 站点编码 | | ||
| 105 | +| lon | float | 经度 | | ||
| 106 | +| lat | float | 纬度 | | ||
| 107 | +| timestamp | long | 时间戳 | | ||
| 108 | +| speed | float | 速度| | ||
| 109 | +| direction | float | 方向(角度) | | ||
| 110 | +| state | int | 营运状态( 0 营运 ,1 非营运, -1 无效) | | ||
| 111 | +| upDown | int | 上下行(0 上行 , 1 下行 , -1 无效)| | ||
| 112 | + | ||
| 113 | + | ||
| 114 | +### 进站数据 | ||
| 115 | +---------- | ||
| 116 | +表名: | ||
| 117 | + | ||
| 118 | +| .. | .. | .. | | ||
| 119 | +| ---- | ---- | ---- | | ||
| 120 | +| id | int | 主键 | | ||
| 121 | +| deviceId | String | 设备号 | | ||
| 122 | +| lineId | int | 线路编码 | | ||
| 123 | +| stopNo | long | 站点编码 | | ||
| 124 | +| timestamp | long | 时间戳 | | ||
| 125 | +| upDown | int | 上下行(0 上行 , 1 下行 , -1 无效) | | ||
| 126 | +| createDate | Date | 创建时间 | | ||
| 127 | + | ||
| 128 | + | ||
| 129 | +### 异常警报 | ||
| 130 | +---------- | ||
| 131 | + | ||
| 132 | +### 大间隔 | ||
| 133 | +---------- | ||
| 134 | +表名: | ||
| 135 | + | ||
| 136 | +| .. | .. | .. | | ||
| 137 | +| ---- | ---- | ---- | | ||
| 138 | +| id | int | 主键 | | ||
| 139 | +| line | int | 线路编码 | | ||
| 140 | +| station | String | 站点编码 | | ||
| 141 | +| cVehicle | String | 当前车辆编码 | | ||
| 142 | +| lastVehicle | String | 上一个车辆编码 | | ||
| 143 | +| interval | long | 间隔时间(秒) | | ||
| 144 | +| timestamp | long | 时间戳 | | ||
| 145 | +| createDate | Date | 创建时间 | | ||
| 146 | + | ||
| 147 | +### 超速 | ||
| 148 | +---------- | ||
| 149 | +表名: | ||
| 150 | + | ||
| 151 | +| .. | .. | .. | | ||
| 152 | +| ---- | ---- | ---- | | ||
| 153 | +| id | int | 主键 | | ||
| 154 | +| vehicle | String | 车辆编码 | | ||
| 155 | +| line | int | 线路编码 | | ||
| 156 | +| upDown | int | 上下行(0 上行 , 1 下行 , -1 无效) | | ||
| 157 | +| lon | float | 经度 | | ||
| 158 | +| lat | float | 纬度| | ||
| 159 | +| speed | float | 速度 | | ||
| 160 | +| timestamp | long | 时间戳 | | ||
| 161 | +| createDate | Date | 时间 | | ||
| 162 | + | ||
| 163 | +### 越界 | ||
| 164 | +---------- | ||
| 165 | +表名: | ||
| 166 | + | ||
| 167 | +| .. | .. | .. | | ||
| 168 | +| ---- | ---- | ---- | | ||
| 169 | +| id | int | 主键 | | ||
| 170 | +| vehicle | String | 车辆编码 | | ||
| 171 | +| line | int | 线路编码 | | ||
| 172 | +| upDown | int | 上下行(0 上行 , 1 下行 , -1 无效) | | ||
| 173 | +| lon | float | 经度 | | ||
| 174 | +| lat | float | 纬度| | ||
| 175 | +| location | String | 越界位置(由线调页面进行初始转换)意思是该字段默认为空,页面第一次查看时会写入值| | ||
| 176 | +| timestamp | long | 时间戳 | | ||
| 177 | +| createDate | Date | 时间 | | ||
| 178 | + | ||
| 179 | + | ||
| 180 | +### 越站 | ||
| 181 | +---------- | ||
| 182 | +表名: | ||
| 183 | + | ||
| 184 | +| .. | .. | .. | | ||
| 185 | +| ---- | ---- | ---- | | ||
| 186 | +| id | int | 主键 | | ||
| 187 | +| line | int | 线路编码 | | ||
| 188 | +| upDown | int | 上下行(0 上行 , 1 下行 , -1 无效) | | ||
| 189 | +| station | String | 站点编码 | | ||
| 190 | +| vehicle | String | 车辆编码 | | ||
| 191 | +| inData | Date | 进站时间 | | ||
| 192 | +| outDate | Date | 出站时间 | | ||
| 193 | + | ||
| 194 | + | ||
| 195 | +### 聚集 | ||
| 196 | +---------- | ||
| 197 | +表名: | ||
| 198 | + | ||
| 199 | +| .. | .. | .. | | ||
| 200 | +| ---- | ---- | ---- | | ||
| 201 | +| id | int | 主键 | | ||
| 202 | +| line | int | 线路编码 | | ||
| 203 | +| upDown | int | 上下行(0 上行 , 1 下行 , -1 无效) | | ||
| 204 | +| stations | String | 站点(多个用 , 号分隔。应该是连续站点) | | ||
| 205 | +| vehicles | String | 车辆编码(多个用 , 号分隔) | | ||
| 206 | +| timestamp | long | 时间戳 | | ||
| 207 | +| createDate | Date | 时间 | | ||
| 208 | + | ||
| 209 | + | ||
| 210 | +### 掉线 | ||
| 211 | +---------- | ||
| 212 | +表名: | ||
| 213 | + | ||
| 214 | +| .. | .. | .. | | ||
| 215 | +| ---- | ---- | ---- | | ||
| 216 | +| id | int | 主键 | | ||
| 217 | +| line | int | 线路编码 | | ||
| 218 | +| upDown | int | 上下行(0 上行 , 1 下行 , -1 无效) | | ||
| 219 | +| vehicle | String | 车辆编码 | | ||
| 220 | +| lon | float | 经度 | | ||
| 221 | +| lat | float | 纬度| | ||
| 222 | +| timestamp | long | 时间戳 | | ||
| 223 | +| createDate | Date | 时间 | | ||
| 224 | + | ||
| 225 | + | ||
| 226 | +### 调度消息下发接口 | ||
| 227 | +---------- | ||
| 228 | +[http://192.168.168.192:8080/transport_server/message](http://192.168.168.192:8080/transport_server/message/) | ||
| 229 | + | ||
| 230 | +<span style="color: red">Request</span>: | ||
| 231 | +```json | ||
| 232 | +{ | ||
| 233 | + "deviceId":12345, | ||
| 234 | + "timestamp":44324, | ||
| 235 | + "operCode":0x60, | ||
| 236 | + "data":{ | ||
| 237 | + "companyCode":22, | ||
| 238 | + "deviceId":"029L2222", | ||
| 239 | + "timestamp":134326, | ||
| 240 | + "instructType":00, | ||
| 241 | + "dispatchInstruct":0x00, | ||
| 242 | + "msgId":12345, | ||
| 243 | + "alarmTime":201606012000, | ||
| 244 | + "serviceState":00000000, | ||
| 245 | + "txtContent":"你好" | ||
| 246 | + } | ||
| 247 | +} | ||
| 248 | +``` | ||
| 249 | +| .. | .. | .. | | ||
| 250 | +| ---- | ---- | ---- | | ||
| 251 | +| deviceId | string | 设备编号 | | ||
| 252 | +| timestamp | long | 时间戳(ms) | | ||
| 253 | +| operCode | short | 一级协议 | | ||
| 254 | +| data.companyCode | short | 公司代码 | | ||
| 255 | +| data.deviceId | string | 设备编号 | | ||
| 256 | +| data.timestamp | long | 时间戳 | | ||
| 257 | +| data.instructType | short | 保留 默认0 | | ||
| 258 | +| data.dispatchInstruct | short | 调度指令 调度指令。0X00表示信息短语,0X01表示取消上次指令+调度指令(闹钟有效),0x02表示为调度指令(闹钟有效); 0x03表示运营状态指令(闹钟无效);0x04表示其他指令。| | ||
| 259 | +| data.msgId | long | 同上 | | ||
| 260 | +| data.alarmTime | long | 闹钟 MMddhhmm| | ||
| 261 | +| data.serviceState | long | 多状态字节 先由车载发起车辆故障、事故报告、扣证、纠纷、加油等审请,经调度确认后,下发调度指令与运营状态。当调度指令为0X00终端需要提示信息。当调度指令为0x01和0x02,终端需要收到后提示信息。并且必须在闹钟结束后进行终端相关状态更新。在闹钟时间前120秒开始提示。当调度指令为0x03,收到后进行终端相关状态更新,终端不需要提示信息。当调度指令为0x04,暂不需要提示信息。| | ||
| 262 | +| data.txtContent | string | 下发的消息文本 | | ||
| 263 | +```json | ||
| 264 | +{ | ||
| 265 | + "deviceId":12345, | ||
| 266 | + "timestamp":44324, | ||
| 267 | + "operCode":0x64, | ||
| 268 | + "data":{ | ||
| 269 | + "cityCode":22, | ||
| 270 | + "deviceId":"029L2222", | ||
| 271 | + "lineId":"134326" | ||
| 272 | + } | ||
| 273 | +} | ||
| 274 | +``` | ||
| 275 | +| .. | .. | .. | | ||
| 276 | +| ---- | ---- | ---- | | ||
| 277 | +| deviceId | string | 设备编号 | | ||
| 278 | +| timestamp | long | 时间戳(ms) | | ||
| 279 | +| operCode | short | 一级协议 | | ||
| 280 | +| data.cityCode | short | 城市区号 | | ||
| 281 | +| data.deviceId | string | 设备编号 | | ||
| 282 | +| data.lineId | string | 线路编号 6位 不足6位前面补0 如编号890 用000890表示 | | ||
| 283 | + | ||
| 284 | +```json | ||
| 285 | +{ | ||
| 286 | + "deviceId":12345, | ||
| 287 | + "timestamp":44324, | ||
| 288 | + "operCode":0xC0, | ||
| 289 | + "data":{ | ||
| 290 | + "operCode":0x86, | ||
| 291 | + "requestAck":0x06 | ||
| 292 | + } | ||
| 293 | +} | ||
| 294 | +``` | ||
| 295 | +| .. | .. | .. | | ||
| 296 | +| ---- | ---- | ---- | | ||
| 297 | +| deviceId | string | 设备编号 | | ||
| 298 | +| timestamp | long | 时间戳(ms) | | ||
| 299 | +| operCode | short | 一级协议 | | ||
| 300 | +| data.operCode | short | 二级协议 | | ||
| 301 | +| data.requestAck | short | 请求应答字 0x06同意 0x15不同意| | ||
| 302 | + | ||
| 303 | +```json | ||
| 304 | +{ | ||
| 305 | + "deviceId":12345, | ||
| 306 | + "timestamp":44324, | ||
| 307 | + "operCode":0xC0, | ||
| 308 | + "data":{ | ||
| 309 | + "operCode":0xa3, | ||
| 310 | + "deviceId":12345, | ||
| 311 | + "ipAddress":222.66.0.204, | ||
| 312 | + "port":8899, | ||
| 313 | + "reportMode":0, | ||
| 314 | + "interval":0, | ||
| 315 | + "distance":0, | ||
| 316 | + "speedingThreshold":0, | ||
| 317 | + "alarmThreshold":0, | ||
| 318 | + "posIpAddress":0, | ||
| 319 | + "posPort":0, | ||
| 320 | + "delay":0, | ||
| 321 | + "speedThreshold1":0, | ||
| 322 | + "speedThreshold2":0, | ||
| 323 | + "contrast":0, | ||
| 324 | + "brightness":0, | ||
| 325 | + "saturation":0 | ||
| 326 | + } | ||
| 327 | +} | ||
| 328 | +``` | ||
| 329 | +| .. | .. | .. | | ||
| 330 | +| ---- | ---- | ---- | | ||
| 331 | +| deviceId | string | 设备编号 | | ||
| 332 | +| timestamp | long | 时间戳(ms) | | ||
| 333 | +| operCode | short | 一级协议 | | ||
| 334 | +| data.operCode | short | 二级协议 | | ||
| 335 | +| data.deviceId | string | 设备编号| | ||
| 336 | +| data.ipAddress | string | 网关IP地址| | ||
| 337 | +| data.port | string | 网关端口| | ||
| 338 | +| data.reportMode | short | 定时定距上报模式| | ||
| 339 | +| data.interval | int | 定时上报时间间隔| | ||
| 340 | +| data.distance | string | 定距上报距离间隔| | ||
| 341 | +| data.speedingThreshold | short | 非线路状态超速阀门| | ||
| 342 | +| data.alarmThreshold | short | 预警阀门| | ||
| 343 | +| data.posIpAddress | string | pos机IP地址| | ||
| 344 | +| data.posPort | string | pos机端口| | ||
| 345 | +| data.delay | int | 延迟机关时间| | ||
| 346 | +| data.deviceId | short | 中门视频切换到码表界面速度阀门 默认45| | ||
| 347 | +| data.deviceId | short | 码表界面切换到中门视频速度阀门 默认35| | ||
| 348 | +| data.deviceId | short | 对比度| | ||
| 349 | +| data.deviceId | short | 亮度| | ||
| 350 | +| data.deviceId | short | 饱和度| | ||
| 351 | + | ||
| 352 | +```json | ||
| 353 | +{ | ||
| 354 | + "deviceId":12345, | ||
| 355 | + "timestamp":44324, | ||
| 356 | + "operCode":0xC0, | ||
| 357 | + "data":{ | ||
| 358 | + "operCode":0xa4 | ||
| 359 | + } | ||
| 360 | +} | ||
| 361 | +``` | ||
| 362 | +| .. | .. | .. | | ||
| 363 | +| ---- | ---- | ---- | | ||
| 364 | +| deviceId | string | 设备编号 | | ||
| 365 | +| timestamp | long | 时间戳(ms) | | ||
| 366 | +| operCode | short | 一级协议 | | ||
| 367 | +| data.operCode | short | 二级协议 | | ||
| 368 | + | ||
| 369 | +```json | ||
| 370 | +{ | ||
| 371 | + "deviceId":12345, | ||
| 372 | + "timestamp":44324, | ||
| 373 | + "operCode":0xC0, | ||
| 374 | + "data":{ | ||
| 375 | + "operCode":0xa5 | ||
| 376 | + "programVersion":2 | ||
| 377 | + } | ||
| 378 | +} | ||
| 379 | +``` | ||
| 380 | +| .. | .. | .. | | ||
| 381 | +| ---- | ---- | ---- | | ||
| 382 | +| deviceId | string | 设备编号 | | ||
| 383 | +| timestamp | long | 时间戳(ms) | | ||
| 384 | +| operCode | short | 一级协议 | | ||
| 385 | +| data.operCode | short | 二级协议 | | ||
| 386 | +| data.programVersion | short | 程序版本 | | ||
| 387 | + | ||
| 388 | +<span style="color: red">Response</span>: | ||
| 389 | +```json | ||
| 390 | +{ | ||
| 391 | + "errCode":0 | ||
| 392 | +} | ||
| 393 | +``` | ||
| 394 | + | ||
| 395 | +### 调度消息上传接口 | ||
| 396 | +---------- | ||
| 397 | +上行POST地址:[http://192.168.168.120:9088/control/upstream](http://192.168.168.120:9088/control/upstream) | ||
| 398 | +<span style="color: red">Request</span>: | ||
| 399 | +```json | ||
| 400 | +{ | ||
| 401 | + "deviceId":12345, | ||
| 402 | + "timestamp":44324, | ||
| 403 | + "status":0, | ||
| 404 | + "operCode":0x80, | ||
| 405 | + "data":{ | ||
| 406 | + "operCode":0x26, | ||
| 407 | + "requestCode":22 | ||
| 408 | + } | ||
| 409 | +} | ||
| 410 | +``` | ||
| 411 | +| .. | .. | .. | | ||
| 412 | +| ---- | ---- | ---- | | ||
| 413 | +| deviceId | string | 设备编号 | | ||
| 414 | +| timestamp | long | 时间戳(ms) | | ||
| 415 | +| status | int | 0x80时无数据 0表示失败 1表示成功或设备确认 2表示驾驶员阅读 | | ||
| 416 | +| operCode | short | 一级协议 消息确认将无数据 | | ||
| 417 | +| data.operCode | short | 二级协议 | | ||
| 418 | +| data.requestCode | short | 请求代码0xa1 恢复运营 0xa2 申请调档 0xa3 出场请求 0xa5 进场请求 0xa7 加油请求 0x50 车辆故障 0x70 路阻报告 0x60 事故报告 0x11 扣证纠纷 0x12 报警 | | ||
| 419 | +<span style="color: red">Response</span>: | ||
| 420 | +```json | ||
| 421 | +{ | ||
| 422 | + "errCode":0 | ||
| 423 | +} | ||
| 424 | +``` | ||
| 425 | + | ||
| 426 | +### 车辆历史GPS | ||
| 427 | +---------- | ||
| 428 | +表名:BSTH_C_GPS_INFO | ||
| 429 | + | ||
| 430 | +| .. | .. | .. | | ||
| 431 | +| ---- | ---- | ---- | | ||
| 432 | +| cityCode | int | 城市代码 | | ||
| 433 | +| industryCode | int | 行业代码 | | ||
| 434 | +| companyCode | int | 企业代码 | | ||
| 435 | +| lineId | int | 线路编号 | | ||
| 436 | +| deviceId | string | 设备编号 | | ||
| 437 | +| driverNo | int | 驾驶员工号 | | ||
| 438 | +| carparkSerialNo | int | 停车场序列号 | | ||
| 439 | +| carparkNo | string | 停车场编号 | | ||
| 440 | +| stopSerialNo | int | 站点序列号 | | ||
| 441 | +| stopNo | string | 停车场编号 | | ||
| 442 | +| lon | float | 经度 | | ||
| 443 | +| lat | float | 维度 | | ||
| 444 | +| ts | long | 时间戳 | | ||
| 445 | +| speedSensor | float | 发动机速度 | | ||
| 446 | +| speedGps | float | gps速度 | | ||
| 447 | +| direction | float | 角度0-359 | | ||
| 448 | +| inTemp | int | 车内温度 | | ||
| 449 | +| serviceState | long | 设备状态字 | | ||
| 450 | +| daysYear | int | 对应年中的天数 为分区字段 查询一定要用此字段过滤 | | ||
| 451 | + |
pom.xml
| @@ -295,6 +295,13 @@ | @@ -295,6 +295,13 @@ | ||
| 295 | <artifactId>jpinyin</artifactId> | 295 | <artifactId>jpinyin</artifactId> |
| 296 | <version>1.1.8</version> | 296 | <version>1.1.8</version> |
| 297 | </dependency> | 297 | </dependency> |
| 298 | + | ||
| 299 | + <!-- plan common工程依赖 --> | ||
| 300 | + <dependency> | ||
| 301 | + <groupId>com.bsth.control_v2</groupId> | ||
| 302 | + <artifactId>plan_module-common</artifactId> | ||
| 303 | + <version>1.0-SNAPSHOT</version> | ||
| 304 | + </dependency> | ||
| 298 | </dependencies> | 305 | </dependencies> |
| 299 | 306 | ||
| 300 | <dependencyManagement> | 307 | <dependencyManagement> |
src/main/java/com/bsth/controller/calc/CalcExportController.java
| @@ -16,6 +16,7 @@ import org.springframework.web.bind.annotation.RestController; | @@ -16,6 +16,7 @@ import org.springframework.web.bind.annotation.RestController; | ||
| 16 | import com.bsth.common.ResponseCode; | 16 | import com.bsth.common.ResponseCode; |
| 17 | import com.bsth.entity.calc.CalcWaybill; | 17 | import com.bsth.entity.calc.CalcWaybill; |
| 18 | import com.bsth.entity.mcy_forms.Waybillday; | 18 | import com.bsth.entity.mcy_forms.Waybillday; |
| 19 | +import com.bsth.service.calc.CalcLbStatuAnalyService; | ||
| 19 | import com.bsth.service.calc.CalcMixService; | 20 | import com.bsth.service.calc.CalcMixService; |
| 20 | import com.bsth.service.calc.CalcWaybillService; | 21 | import com.bsth.service.calc.CalcWaybillService; |
| 21 | import com.bsth.util.ReportUtils; | 22 | import com.bsth.util.ReportUtils; |
| @@ -26,6 +27,9 @@ public class CalcExportController { | @@ -26,6 +27,9 @@ public class CalcExportController { | ||
| 26 | 27 | ||
| 27 | @Autowired | 28 | @Autowired |
| 28 | CalcWaybillService service; | 29 | CalcWaybillService service; |
| 30 | + | ||
| 31 | + @Autowired | ||
| 32 | + CalcLbStatuAnalyService lbService; | ||
| 29 | 33 | ||
| 30 | @Autowired | 34 | @Autowired |
| 31 | CalcMixService clacMixService; | 35 | CalcMixService clacMixService; |
| @@ -204,5 +208,84 @@ public class CalcExportController { | @@ -204,5 +208,84 @@ public class CalcExportController { | ||
| 204 | } | 208 | } |
| 205 | return resMap; | 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/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/schedule/log/ModuleOperatorLog.java
0 → 100644
| 1 | +package com.bsth.entity.schedule.log; | ||
| 2 | + | ||
| 3 | +import com.bsth.control_v2.plan_module.common.enums.log.ModuleOperatorType; | ||
| 4 | +import com.bsth.control_v2.plan_module.common.enums.log.ModuleType; | ||
| 5 | +import com.bsth.control_v2.plan_module.common.enums.log.OperatorType; | ||
| 6 | +import com.bsth.entity.schedule.log.convert.ModuleOperatorTypeConverter; | ||
| 7 | +import com.bsth.entity.schedule.log.convert.ModuleTypeConverter; | ||
| 8 | +import com.bsth.entity.schedule.log.convert.OperatorTypeConverter; | ||
| 9 | + | ||
| 10 | +import javax.persistence.*; | ||
| 11 | +import java.io.Serializable; | ||
| 12 | +import java.util.Date; | ||
| 13 | + | ||
| 14 | +/** | ||
| 15 | + * 模块业务操作日志。 | ||
| 16 | + */ | ||
| 17 | +@Entity | ||
| 18 | +@Table(name = "bsth_c_s_op_log") | ||
| 19 | +public class ModuleOperatorLog implements Serializable { | ||
| 20 | + | ||
| 21 | + /** 主键Id */ | ||
| 22 | + @Id | ||
| 23 | + @GeneratedValue | ||
| 24 | + private Long id; | ||
| 25 | + | ||
| 26 | + /** 日志插入时间 */ | ||
| 27 | + @Column(nullable = false) | ||
| 28 | + private Long timestmp; | ||
| 29 | + | ||
| 30 | + /** 模块类型 */ | ||
| 31 | + @Column(nullable = false) | ||
| 32 | + @Convert(converter = ModuleTypeConverter.class) | ||
| 33 | + private ModuleType moduleType; | ||
| 34 | + | ||
| 35 | + @Column(nullable = false) | ||
| 36 | + @Convert(converter = OperatorTypeConverter.class) | ||
| 37 | + private OperatorType operatorType; | ||
| 38 | + | ||
| 39 | + /** 模块操作类型 */ | ||
| 40 | + @Column(nullable = false) | ||
| 41 | + @Convert(converter = ModuleOperatorTypeConverter.class) | ||
| 42 | + private ModuleOperatorType moduleOperatorType; | ||
| 43 | + | ||
| 44 | + /** 日志描述 */ | ||
| 45 | + @Column(nullable = false) | ||
| 46 | + private String message; | ||
| 47 | + | ||
| 48 | + /** 日志级别 */ | ||
| 49 | + @Column(nullable = false) | ||
| 50 | + private String levelName; | ||
| 51 | + /** 模块业务操作开始时间 */ | ||
| 52 | + @Column(nullable = false) | ||
| 53 | + private Date opStartTime; | ||
| 54 | + /** 模块业务操作结束时间 */ | ||
| 55 | + @Column(nullable = false) | ||
| 56 | + private Date opEndTime; | ||
| 57 | + /** 模块业务操作人姓名 */ | ||
| 58 | + @Column(nullable = false) | ||
| 59 | + private String opUserName; | ||
| 60 | + /** 模块业务操作人工号 */ | ||
| 61 | + @Column(nullable = false) | ||
| 62 | + private String opUserCode; | ||
| 63 | + /** 关联的实体class名 */ | ||
| 64 | + @Column(nullable = false) | ||
| 65 | + private String opEntityClass; | ||
| 66 | + /** 操作前的实体json */ | ||
| 67 | + @Column(nullable = false) | ||
| 68 | + private String opBeforeJson; | ||
| 69 | + /** 操作后的实体json */ | ||
| 70 | + @Column(nullable = false) | ||
| 71 | + private String opAfterJson; | ||
| 72 | + | ||
| 73 | + /** 备用-可选参数1 */ | ||
| 74 | + private String optArg1; | ||
| 75 | + /** 备用-可选参数2 */ | ||
| 76 | + private String optArg2; | ||
| 77 | + /** 备用-可选参数3 */ | ||
| 78 | + private String optArg3; | ||
| 79 | + | ||
| 80 | + //------------- 客户端信息 -------------// | ||
| 81 | + /** 客户端Ip */ | ||
| 82 | + private String clientIp; | ||
| 83 | + /** 客户端游览器 */ | ||
| 84 | + private String clientBowser; | ||
| 85 | + /** 客户端主机信息 */ | ||
| 86 | + private String clientSystem; | ||
| 87 | + /** 获取mac地址 */ | ||
| 88 | + private String clientMacAddress; | ||
| 89 | + | ||
| 90 | + public Long getId() { | ||
| 91 | + return id; | ||
| 92 | + } | ||
| 93 | + | ||
| 94 | + public void setId(Long id) { | ||
| 95 | + this.id = id; | ||
| 96 | + } | ||
| 97 | + | ||
| 98 | + public Long getTimestmp() { | ||
| 99 | + return timestmp; | ||
| 100 | + } | ||
| 101 | + | ||
| 102 | + public void setTimestmp(Long timestmp) { | ||
| 103 | + this.timestmp = timestmp; | ||
| 104 | + } | ||
| 105 | + | ||
| 106 | + public ModuleType getModuleType() { | ||
| 107 | + return moduleType; | ||
| 108 | + } | ||
| 109 | + | ||
| 110 | + public void setModuleType(ModuleType moduleType) { | ||
| 111 | + this.moduleType = moduleType; | ||
| 112 | + } | ||
| 113 | + | ||
| 114 | + public OperatorType getOperatorType() { | ||
| 115 | + return operatorType; | ||
| 116 | + } | ||
| 117 | + | ||
| 118 | + public void setOperatorType(OperatorType operatorType) { | ||
| 119 | + this.operatorType = operatorType; | ||
| 120 | + } | ||
| 121 | + | ||
| 122 | + public ModuleOperatorType getModuleOperatorType() { | ||
| 123 | + return moduleOperatorType; | ||
| 124 | + } | ||
| 125 | + | ||
| 126 | + public void setModuleOperatorType(ModuleOperatorType moduleOperatorType) { | ||
| 127 | + this.moduleOperatorType = moduleOperatorType; | ||
| 128 | + } | ||
| 129 | + | ||
| 130 | + public String getMessage() { | ||
| 131 | + return message; | ||
| 132 | + } | ||
| 133 | + | ||
| 134 | + public void setMessage(String message) { | ||
| 135 | + this.message = message; | ||
| 136 | + } | ||
| 137 | + | ||
| 138 | + public String getLevelName() { | ||
| 139 | + return levelName; | ||
| 140 | + } | ||
| 141 | + | ||
| 142 | + public void setLevelName(String levelName) { | ||
| 143 | + this.levelName = levelName; | ||
| 144 | + } | ||
| 145 | + | ||
| 146 | + public Date getOpStartTime() { | ||
| 147 | + return opStartTime; | ||
| 148 | + } | ||
| 149 | + | ||
| 150 | + public void setOpStartTime(Date opStartTime) { | ||
| 151 | + this.opStartTime = opStartTime; | ||
| 152 | + } | ||
| 153 | + | ||
| 154 | + public Date getOpEndTime() { | ||
| 155 | + return opEndTime; | ||
| 156 | + } | ||
| 157 | + | ||
| 158 | + public void setOpEndTime(Date opEndTime) { | ||
| 159 | + this.opEndTime = opEndTime; | ||
| 160 | + } | ||
| 161 | + | ||
| 162 | + public String getOpUserName() { | ||
| 163 | + return opUserName; | ||
| 164 | + } | ||
| 165 | + | ||
| 166 | + public void setOpUserName(String opUserName) { | ||
| 167 | + this.opUserName = opUserName; | ||
| 168 | + } | ||
| 169 | + | ||
| 170 | + public String getOpUserCode() { | ||
| 171 | + return opUserCode; | ||
| 172 | + } | ||
| 173 | + | ||
| 174 | + public void setOpUserCode(String opUserCode) { | ||
| 175 | + this.opUserCode = opUserCode; | ||
| 176 | + } | ||
| 177 | + | ||
| 178 | + public String getOpEntityClass() { | ||
| 179 | + return opEntityClass; | ||
| 180 | + } | ||
| 181 | + | ||
| 182 | + public void setOpEntityClass(String opEntityClass) { | ||
| 183 | + this.opEntityClass = opEntityClass; | ||
| 184 | + } | ||
| 185 | + | ||
| 186 | + public String getOpBeforeJson() { | ||
| 187 | + return opBeforeJson; | ||
| 188 | + } | ||
| 189 | + | ||
| 190 | + public void setOpBeforeJson(String opBeforeJson) { | ||
| 191 | + this.opBeforeJson = opBeforeJson; | ||
| 192 | + } | ||
| 193 | + | ||
| 194 | + public String getOpAfterJson() { | ||
| 195 | + return opAfterJson; | ||
| 196 | + } | ||
| 197 | + | ||
| 198 | + public void setOpAfterJson(String opAfterJson) { | ||
| 199 | + this.opAfterJson = opAfterJson; | ||
| 200 | + } | ||
| 201 | + | ||
| 202 | + public String getOptArg1() { | ||
| 203 | + return optArg1; | ||
| 204 | + } | ||
| 205 | + | ||
| 206 | + public void setOptArg1(String optArg1) { | ||
| 207 | + this.optArg1 = optArg1; | ||
| 208 | + } | ||
| 209 | + | ||
| 210 | + public String getOptArg2() { | ||
| 211 | + return optArg2; | ||
| 212 | + } | ||
| 213 | + | ||
| 214 | + public void setOptArg2(String optArg2) { | ||
| 215 | + this.optArg2 = optArg2; | ||
| 216 | + } | ||
| 217 | + | ||
| 218 | + public String getOptArg3() { | ||
| 219 | + return optArg3; | ||
| 220 | + } | ||
| 221 | + | ||
| 222 | + public void setOptArg3(String optArg3) { | ||
| 223 | + this.optArg3 = optArg3; | ||
| 224 | + } | ||
| 225 | + | ||
| 226 | + public String getClientIp() { | ||
| 227 | + return clientIp; | ||
| 228 | + } | ||
| 229 | + | ||
| 230 | + public void setClientIp(String clientIp) { | ||
| 231 | + this.clientIp = clientIp; | ||
| 232 | + } | ||
| 233 | + | ||
| 234 | + public String getClientBowser() { | ||
| 235 | + return clientBowser; | ||
| 236 | + } | ||
| 237 | + | ||
| 238 | + public void setClientBowser(String clientBowser) { | ||
| 239 | + this.clientBowser = clientBowser; | ||
| 240 | + } | ||
| 241 | + | ||
| 242 | + public String getClientSystem() { | ||
| 243 | + return clientSystem; | ||
| 244 | + } | ||
| 245 | + | ||
| 246 | + public void setClientSystem(String clientSystem) { | ||
| 247 | + this.clientSystem = clientSystem; | ||
| 248 | + } | ||
| 249 | + | ||
| 250 | + public String getClientMacAddress() { | ||
| 251 | + return clientMacAddress; | ||
| 252 | + } | ||
| 253 | + | ||
| 254 | + public void setClientMacAddress(String clientMacAddress) { | ||
| 255 | + this.clientMacAddress = clientMacAddress; | ||
| 256 | + } | ||
| 257 | +} |
src/main/java/com/bsth/entity/schedule/log/convert/ModuleOperatorTypeConverter.java
0 → 100644
| 1 | +package com.bsth.entity.schedule.log.convert; | ||
| 2 | + | ||
| 3 | +import com.bsth.control_v2.plan_module.common.enums.log.ModuleOperatorType; | ||
| 4 | + | ||
| 5 | +import javax.persistence.AttributeConverter; | ||
| 6 | +import javax.persistence.Convert; | ||
| 7 | + | ||
| 8 | +@Convert | ||
| 9 | +public class ModuleOperatorTypeConverter implements AttributeConverter<ModuleOperatorType, String> { | ||
| 10 | + @Override | ||
| 11 | + public String convertToDatabaseColumn(ModuleOperatorType attribute) { | ||
| 12 | + return attribute.getDicDesc(); | ||
| 13 | + } | ||
| 14 | + | ||
| 15 | + @Override | ||
| 16 | + public ModuleOperatorType convertToEntityAttribute(String dbData) { | ||
| 17 | + return ModuleOperatorType.fromDicDesc(dbData); | ||
| 18 | + } | ||
| 19 | +} |
src/main/java/com/bsth/entity/schedule/log/convert/ModuleTypeConverter.java
0 → 100644
| 1 | +package com.bsth.entity.schedule.log.convert; | ||
| 2 | + | ||
| 3 | +import com.bsth.control_v2.plan_module.common.enums.log.ModuleType; | ||
| 4 | + | ||
| 5 | +import javax.persistence.AttributeConverter; | ||
| 6 | +import javax.persistence.Convert; | ||
| 7 | + | ||
| 8 | +@Convert | ||
| 9 | +public class ModuleTypeConverter implements AttributeConverter<ModuleType, String> { | ||
| 10 | + @Override | ||
| 11 | + public String convertToDatabaseColumn(ModuleType attribute) { | ||
| 12 | + return attribute.getDicDesc(); | ||
| 13 | + } | ||
| 14 | + | ||
| 15 | + @Override | ||
| 16 | + public ModuleType convertToEntityAttribute(String dbData) { | ||
| 17 | + return ModuleType.fromDicDesc(dbData); | ||
| 18 | + } | ||
| 19 | +} |
src/main/java/com/bsth/entity/schedule/log/convert/OperatorTypeConverter.java
0 → 100644
| 1 | +package com.bsth.entity.schedule.log.convert; | ||
| 2 | + | ||
| 3 | +import com.bsth.control_v2.plan_module.common.enums.log.OperatorType; | ||
| 4 | + | ||
| 5 | +import javax.persistence.AttributeConverter; | ||
| 6 | +import javax.persistence.Convert; | ||
| 7 | + | ||
| 8 | +@Convert | ||
| 9 | +public class OperatorTypeConverter implements AttributeConverter<OperatorType, String> { | ||
| 10 | + @Override | ||
| 11 | + public String convertToDatabaseColumn(OperatorType attribute) { | ||
| 12 | + return attribute.getDicDesc(); | ||
| 13 | + } | ||
| 14 | + | ||
| 15 | + @Override | ||
| 16 | + public OperatorType convertToEntityAttribute(String dbData) { | ||
| 17 | + return OperatorType.fromDicDesc(dbData); | ||
| 18 | + } | ||
| 19 | +} |
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<Ylb, Integer>{ | @@ -46,7 +46,8 @@ public interface YlbRepository extends BaseRepository<Ylb, Integer>{ | ||
| 46 | + " and y.xlbm like %?4% and y.nbbm like %?5%",nativeQuery=true) | 46 | + " and y.xlbm like %?4% and y.nbbm like %?5%",nativeQuery=true) |
| 47 | List<Ylb> listMaxRqJcsx(String rq,String gsbm,String fgsbm,String xlbm,String nbbm); | 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 | + " and rq< ?1 and ssgsdm like %?2%" | 51 | + " and rq< ?1 and ssgsdm like %?2%" |
| 51 | + " and fgsdm like %?3% and xlbm like %?4% and nbbm like %?5% " | 52 | + " and fgsdm like %?3% and xlbm like %?4% and nbbm like %?5% " |
| 52 | + " order by nbbm , rq desc,jcsx desc,lp desc",nativeQuery=true) | 53 | + " order by nbbm , rq desc,jcsx desc,lp desc",nativeQuery=true) |
| @@ -54,7 +55,7 @@ public interface YlbRepository extends BaseRepository<Ylb, Integer>{ | @@ -54,7 +55,7 @@ public interface YlbRepository extends BaseRepository<Ylb, Integer>{ | ||
| 54 | 55 | ||
| 55 | @Query(value="select * from bsth_c_ylb where rq>=?1 " | 56 | @Query(value="select * from bsth_c_ylb where rq>=?1 " |
| 56 | + " and rq<= ?2 and ssgsdm =?3" | 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 | + " order by nbbm , rq desc,jcsx desc,lp desc",nativeQuery=true) | 59 | + " order by nbbm , rq desc,jcsx desc,lp desc",nativeQuery=true) |
| 59 | List<Ylb> listByMonthJcsx(String rq,String rq2,String gsbm,String fgsbm,String xlbm); | 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<Ylb, Integer>{ | @@ -125,6 +126,12 @@ public interface YlbRepository extends BaseRepository<Ylb, Integer>{ | ||
| 125 | List<Object[]> checkNbmmYl(String rq, String gsbm,String fgsbm,String xlbm,String nbbm); | 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 | @Query(value="select jzl,yh,sh from Ylb s " | 135 | @Query(value="select jzl,yh,sh from Ylb s " |
| 129 | + " where to_days(s.rq)=to_days(?1) " | 136 | + " where to_days(s.rq)=to_days(?1) " |
| 130 | + " and s.ssgsdm like %?2% " | 137 | + " and s.ssgsdm like %?2% " |
| @@ -155,7 +162,7 @@ public interface YlbRepository extends BaseRepository<Ylb, Integer>{ | @@ -155,7 +162,7 @@ public interface YlbRepository extends BaseRepository<Ylb, Integer>{ | ||
| 155 | @Query(value="select s from Ylb s " | 162 | @Query(value="select s from Ylb s " |
| 156 | + " where to_days(s.rq)=to_days(?1) " | 163 | + " where to_days(s.rq)=to_days(?1) " |
| 157 | + " and s.ssgsdm =?2 " | 164 | + " and s.ssgsdm =?2 " |
| 158 | - + " and s.fgsdm =?3 " | 165 | + + " and s.fgsdm like %?3% " |
| 159 | + " and s.xlbm like %?4% " | 166 | + " and s.xlbm like %?4% " |
| 160 | + " and s.nbbm in ?5 order by nbbm,jcsx") | 167 | + " and s.nbbm in ?5 order by nbbm,jcsx") |
| 161 | List<Ylb> listYlb(String rq, String gsbm,String fgsbm,String xlbm,List<String> listNbbm); | 168 | List<Ylb> listYlb(String rq, String gsbm,String fgsbm,String xlbm,List<String> listNbbm); |
| @@ -163,7 +170,7 @@ public interface YlbRepository extends BaseRepository<Ylb, Integer>{ | @@ -163,7 +170,7 @@ public interface YlbRepository extends BaseRepository<Ylb, Integer>{ | ||
| 163 | @Query(value="select s from Ylb s " | 170 | @Query(value="select s from Ylb s " |
| 164 | + " where s.rq=?1 " | 171 | + " where s.rq=?1 " |
| 165 | + " and s.ssgsdm =?2 " | 172 | + " and s.ssgsdm =?2 " |
| 166 | - + " and s.fgsdm =?3 " | 173 | + + " and s.fgsdm like %?3% " |
| 167 | + " and s.xlbm like %?4% " | 174 | + " and s.xlbm like %?4% " |
| 168 | + " and s.nbbm in ?5 order by nbbm,jcsx") | 175 | + " and s.nbbm in ?5 order by nbbm,jcsx") |
| 169 | List<Ylb> listYlb_s(Date rq, String gsbm,String fgsbm,String xlbm,List<String> listNbbm); | 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,9 +306,9 @@ public class CalcMixServiceImpl implements CalcMixService { | ||
| 306 | m.put("hyl", Arith.add(m.get("hyl"), sin_.getHyl()!=null?sin_.getHyl():0)); | 306 | m.put("hyl", Arith.add(m.get("hyl"), sin_.getHyl()!=null?sin_.getHyl():0)); |
| 307 | m.put("jzl", Arith.add(m.get("jzl"), sin_.getJzl()!=null?sin_.getJzl():0)); | 307 | m.put("jzl", Arith.add(m.get("jzl"), sin_.getJzl()!=null?sin_.getJzl():0)); |
| 308 | m.put("sh", Arith.add(m.get("sh"), sin_.getUnyyyl()!=null?sin_.getUnyyyl():0)); | 308 | m.put("sh", Arith.add(m.get("sh"), sin_.getUnyyyl()!=null?sin_.getUnyyyl():0)); |
| 309 | - last.put("hyl", Arith.add(last.get("hyl"), m.get("hyl"))); | ||
| 310 | - last.put("jzl", Arith.add(last.get("jzl"), m.get("jzl"))); | ||
| 311 | - last.put("sh", Arith.add(last.get("sh"), m.get("sh"))); | 309 | + last.put("hyl", Arith.add(last.get("hyl"), sin_.getHyl()!=null?sin_.getHyl():0)); |
| 310 | + last.put("jzl", Arith.add(last.get("jzl"), sin_.getJzl()!=null?sin_.getJzl():0)); | ||
| 311 | + last.put("sh", Arith.add(last.get("sh"), sin_.getUnyyyl()!=null?sin_.getUnyyyl():0)); | ||
| 312 | } else { | 312 | } else { |
| 313 | Map<String, Object> m = new HashMap<String, Object>(); | 313 | Map<String, Object> m = new HashMap<String, Object>(); |
| 314 | m.put("gS", BasicData.businessFgsCodeNameMap.get(fgsdm+"_"+gsdm)); | 314 | m.put("gS", BasicData.businessFgsCodeNameMap.get(fgsdm+"_"+gsdm)); |
src/main/java/com/bsth/service/calc/impl/CalcToolServiceImpl.java
| @@ -358,7 +358,6 @@ public class CalcToolServiceImpl implements CalcToolService { | @@ -358,7 +358,6 @@ public class CalcToolServiceImpl implements CalcToolService { | ||
| 358 | t_.setDtbc(0); | 358 | t_.setDtbc(0); |
| 359 | t_.setDtbczgf(0); | 359 | t_.setDtbczgf(0); |
| 360 | t_.setDtbcwgf(0); | 360 | t_.setDtbcwgf(0); |
| 361 | - list.add(t_); | ||
| 362 | list2.add(t_); | 361 | list2.add(t_); |
| 363 | } | 362 | } |
| 364 | } | 363 | } |
src/main/java/com/bsth/service/gps/GpsServiceImpl.java
| @@ -12,10 +12,12 @@ import com.bsth.data.pilot80.PilotReport; | @@ -12,10 +12,12 @@ import com.bsth.data.pilot80.PilotReport; | ||
| 12 | import com.bsth.data.safe_driv.SafeDriv; | 12 | import com.bsth.data.safe_driv.SafeDriv; |
| 13 | import com.bsth.data.safe_driv.SafeDrivCenter; | 13 | import com.bsth.data.safe_driv.SafeDrivCenter; |
| 14 | import com.bsth.data.schedule.DayOfSchedule; | 14 | import com.bsth.data.schedule.DayOfSchedule; |
| 15 | +import com.bsth.entity.Line; | ||
| 15 | import com.bsth.entity.LineVersions; | 16 | import com.bsth.entity.LineVersions; |
| 16 | import com.bsth.entity.directive.D80; | 17 | import com.bsth.entity.directive.D80; |
| 17 | import com.bsth.entity.realcontrol.ScheduleRealInfo; | 18 | import com.bsth.entity.realcontrol.ScheduleRealInfo; |
| 18 | import com.bsth.repository.CarParkRepository; | 19 | import com.bsth.repository.CarParkRepository; |
| 20 | +import com.bsth.repository.LineRepository; | ||
| 19 | import com.bsth.repository.LineVersionsRepository; | 21 | import com.bsth.repository.LineVersionsRepository; |
| 20 | import com.bsth.repository.StationRepository; | 22 | import com.bsth.repository.StationRepository; |
| 21 | import com.bsth.repository.realcontrol.ScheduleRealInfoRepository; | 23 | import com.bsth.repository.realcontrol.ScheduleRealInfoRepository; |
| @@ -87,6 +89,9 @@ public class GpsServiceImpl implements GpsService { | @@ -87,6 +89,9 @@ public class GpsServiceImpl implements GpsService { | ||
| 87 | @Autowired | 89 | @Autowired |
| 88 | LineVersionsRepository lineVersionsRepository; | 90 | LineVersionsRepository lineVersionsRepository; |
| 89 | 91 | ||
| 92 | + @Autowired | ||
| 93 | + LineRepository lineRepository; | ||
| 94 | + | ||
| 90 | // 历史gps查询 | 95 | // 历史gps查询 |
| 91 | @Override | 96 | @Override |
| 92 | public List<Map<String, Object>> history(String device, Long startTime, Long endTime, int directions) { | 97 | public List<Map<String, Object>> history(String device, Long startTime, Long endTime, int directions) { |
| @@ -228,50 +233,73 @@ public class GpsServiceImpl implements GpsService { | @@ -228,50 +233,73 @@ public class GpsServiceImpl implements GpsService { | ||
| 228 | //查询GPS数据 | 233 | //查询GPS数据 |
| 229 | JdbcTemplate jdbcTemplate_ms = new JdbcTemplate(DBUtils_MS.getDataSource()); | 234 | JdbcTemplate jdbcTemplate_ms = new JdbcTemplate(DBUtils_MS.getDataSource()); |
| 230 | List<Map<String, Object>> dataList = jdbcTemplate_ms.queryForList(sql.toString()); | 235 | List<Map<String, Object>> dataList = jdbcTemplate_ms.queryForList(sql.toString()); |
| 231 | - if (!dataList.isEmpty()){ | ||
| 232 | 236 | ||
| 233 | - int lineId=Integer.parseInt(map_get_str(dataList.get(0), "LINE_ID")); | ||
| 234 | - List<LineVersions> lvs=lineVersionsRepository.findBylineId(lineId); | ||
| 235 | - SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss"); | ||
| 236 | - List<Map<String,Object>> vlist=new ArrayList<>(); | ||
| 237 | - Map<String,Object> vMap; | ||
| 238 | - if (lvs!=null&&!lvs.isEmpty()){ | ||
| 239 | - for (LineVersions lv : lvs) { | ||
| 240 | - vMap=new HashMap(); | ||
| 241 | - Long sd=lv.getStartDate().getTime(); | ||
| 242 | - Long ed=lv.getEndDate().getTime(); | ||
| 243 | - if (sd<st&&et<ed){ | ||
| 244 | - vMap.put("version",lv.getVersions()); | ||
| 245 | - vMap.put("vtime","all"); | ||
| 246 | - vlist.add(vMap); | ||
| 247 | - }else if(sd<st&&et>ed&&st<ed){ | ||
| 248 | - vMap.put("version",lv.getVersions()); | ||
| 249 | - vMap.put("endTime",lv.getEndDate().getTime()); | ||
| 250 | - vlist.add(vMap); | ||
| 251 | - }else if(st<sd&&et<ed&&sd<et){ | ||
| 252 | - vMap.put("version",lv.getVersions()); | ||
| 253 | - vMap.put("startTime",lv.getStartDate().getTime()); | ||
| 254 | - vlist.add(vMap); | ||
| 255 | - } | ||
| 256 | - } | ||
| 257 | - } | ||
| 258 | - rsMap.put("lineVerson",vlist); | ||
| 259 | - } | ||
| 260 | Float lon, lat; | 237 | Float lon, lat; |
| 261 | Location bdLoc, gdLoc; | 238 | Location bdLoc, gdLoc; |
| 262 | int inOutStop; | 239 | int inOutStop; |
| 263 | long serviceState; | 240 | long serviceState; |
| 264 | ArrivalEntity arrival; | 241 | ArrivalEntity arrival; |
| 265 | - | 242 | + Set<String> lineSet=new HashSet(); |
| 243 | + List<Map<String,Object>> lineSwitch=new ArrayList<>(); | ||
| 244 | + | ||
| 245 | + List<Map> gpsNotValidList=new ArrayList(); | ||
| 246 | + List<Map> versionSwitchList=new ArrayList(); | ||
| 247 | + List<Map> gpsEqualsZeroList=new ArrayList(); | ||
| 248 | + Map<String,Object> zeroMap=null; | ||
| 249 | + Map<String,Object> gpsNotValidMap=null; | ||
| 250 | + boolean isFirstNotValid=true; | ||
| 251 | + boolean isFirstLonlatZero=true; | ||
| 266 | Map<String, Object> map = null; | 252 | Map<String, Object> map = null; |
| 267 | for(Map<String, Object> rs : dataList){ | 253 | for(Map<String, Object> rs : dataList){ |
| 254 | + int index=dataList.indexOf(rs); | ||
| 255 | + if (index< dataList.size()-1&&!map_get_str( rs,"LINE_ID").equals(map_get_str( dataList.get(index+1),"LINE_ID"))){ | ||
| 256 | + | ||
| 257 | + Line cLine =lineRepository.findOne(Integer.valueOf(map_get_str( rs,"LINE_ID"))); | ||
| 258 | + Line nextLine =lineRepository.findOne(Integer.valueOf(map_get_str( dataList.get(index+1),"LINE_ID"))); | ||
| 259 | + if (cLine!=null&&nextLine!=null){ | ||
| 260 | + Map<String,Object> LSmap=new HashMap<>(); | ||
| 261 | + String name=cLine.getName(); | ||
| 262 | + String NextName=nextLine.getName(); | ||
| 263 | + LSmap.put("abnormalType","linesSwitch"); | ||
| 264 | + LSmap.put("line_line",name+"-->"+NextName); | ||
| 265 | + LSmap.put("st",map_get_long(rs, "TS")); | ||
| 266 | + LSmap.put("et",index== dataList.size()-1?map_get_long(rs, "TS"):map_get_long( dataList.get(index+1), "TS")); | ||
| 267 | + lineSwitch.add(LSmap); | ||
| 268 | + } | ||
| 269 | + } | ||
| 268 | serviceState = map_get_long(rs, "SERVICE_STATE"); | 270 | serviceState = map_get_long(rs, "SERVICE_STATE"); |
| 269 | - if(getGpsValid(serviceState) == 1) | ||
| 270 | - continue; | 271 | + if(getGpsValid(serviceState) == 1){ |
| 272 | + if (isFirstNotValid) { | ||
| 273 | + gpsNotValidMap=new HashMap<>(); | ||
| 274 | + gpsNotValidMap.put("abnormalType","gpsNotValid"); | ||
| 275 | + gpsNotValidMap.put("st",map_get_long(rs,"TS")); | ||
| 276 | + isFirstNotValid=false; | ||
| 277 | + } | ||
| 278 | + if (index== dataList.size()-1||index< dataList.size()-1&&getGpsValid(map_get_long(dataList.get(index+1), "SERVICE_STATE"))!=1){ | ||
| 279 | + gpsNotValidMap.put("et",map_get_long(rs,"TS")); | ||
| 280 | + gpsNotValidList.add(gpsNotValidMap); | ||
| 281 | + isFirstNotValid=true; | ||
| 282 | + gpsNotValidMap=null; | ||
| 283 | + } | ||
| 284 | + } | ||
| 285 | + //continue; | ||
| 271 | 286 | ||
| 272 | map = new HashMap<>(); | 287 | map = new HashMap<>(); |
| 273 | lon = map_get_float(rs, "LON"); | 288 | lon = map_get_float(rs, "LON"); |
| 274 | lat = map_get_float(rs, "LAT"); | 289 | lat = map_get_float(rs, "LAT"); |
| 290 | + if (lon==0||lat==0){ | ||
| 291 | + if (isFirstLonlatZero){ | ||
| 292 | + zeroMap=new HashMap<>(); | ||
| 293 | + zeroMap.put("abnormalType","gpsZero"); | ||
| 294 | + zeroMap.put("st",map_get_long(rs,"TS")); | ||
| 295 | + isFirstLonlatZero=false; | ||
| 296 | + } | ||
| 297 | + if (index<dataList.size()-1&&(map_get_float(dataList.get(index+1),"LON")!=0&&map_get_float(dataList.get(index+1),"LAT")!=0)){ | ||
| 298 | + zeroMap.put("et",map_get_long(rs,"TS")); | ||
| 299 | + gpsEqualsZeroList.add(zeroMap); | ||
| 300 | + isFirstLonlatZero=true; | ||
| 301 | + } | ||
| 302 | + } | ||
| 275 | // 高德坐标 | 303 | // 高德坐标 |
| 276 | gdLoc = TransGPS.transformFromWGSToGCJ(TransGPS.LocationMake(lon, lat)); | 304 | gdLoc = TransGPS.transformFromWGSToGCJ(TransGPS.LocationMake(lon, lat)); |
| 277 | map.put("gcj_lon", gdLoc.getLng()); | 305 | map.put("gcj_lon", gdLoc.getLng()); |
| @@ -292,7 +320,7 @@ public class GpsServiceImpl implements GpsService { | @@ -292,7 +320,7 @@ public class GpsServiceImpl implements GpsService { | ||
| 292 | 320 | ||
| 293 | map.put("lineId", map_get_str(rs, "LINE_ID")); | 321 | map.put("lineId", map_get_str(rs, "LINE_ID")); |
| 294 | map.put("speed", map_get_float(rs,"SPEED_GPS")); | 322 | map.put("speed", map_get_float(rs,"SPEED_GPS")); |
| 295 | - | 323 | + lineSet.add(map_get_str(rs, "LINE_ID")); |
| 296 | inOutStop = Integer.parseInt(rs.get("INOUT_STOP").toString()); | 324 | inOutStop = Integer.parseInt(rs.get("INOUT_STOP").toString()); |
| 297 | map.put("inout_stop", inOutStop); | 325 | map.put("inout_stop", inOutStop); |
| 298 | 326 | ||
| @@ -310,6 +338,48 @@ public class GpsServiceImpl implements GpsService { | @@ -310,6 +338,48 @@ public class GpsServiceImpl implements GpsService { | ||
| 310 | map.put("section_code", map_get_str(rs,"SECTION_CODE")); | 338 | map.put("section_code", map_get_str(rs,"SECTION_CODE")); |
| 311 | list.add(map); | 339 | list.add(map); |
| 312 | } | 340 | } |
| 341 | + | ||
| 342 | + if (lineSet.size()>0){ | ||
| 343 | + for (String s : lineSet) { | ||
| 344 | + int lineId=Integer.parseInt(s); | ||
| 345 | + List<LineVersions> lvs=lineVersionsRepository.findBylineId(lineId); | ||
| 346 | + List<Map<String,Object>> vlist=new ArrayList<>(); | ||
| 347 | + Map<String,Object> vMap; | ||
| 348 | + Long qt=0L; | ||
| 349 | + if (lvs!=null&&!lvs.isEmpty()){ | ||
| 350 | + for (LineVersions lv : lvs) { | ||
| 351 | + vMap=new HashMap(); | ||
| 352 | + Long sd=lv.getStartDate().getTime(); | ||
| 353 | + Long ed=lv.getEndDate().getTime(); | ||
| 354 | + if (sd<st&&et<ed){ | ||
| 355 | + vMap.put("version",lv.getVersions()); | ||
| 356 | + vMap.put("vtime","all"); | ||
| 357 | + vlist.add(vMap); | ||
| 358 | + }else if(sd<st&&et>ed&&st<ed){ | ||
| 359 | + vMap.put("version",lv.getVersions()); | ||
| 360 | + vMap.put("endTime",lv.getEndDate().getTime()); | ||
| 361 | + vMap.put("abnormalType","versionSwitch"); | ||
| 362 | + vMap.put("st",lv.getEndDate().getTime()); | ||
| 363 | + //vMap.put("et",lvs.indexOf(lv)==lvs.size()-1?lv.getEndDate().getTime():lvs.get(lvs.indexOf(lv)+1).getStartDate().getTime()); | ||
| 364 | + qt=lv.getEndDate().getTime(); | ||
| 365 | + vlist.add(vMap); | ||
| 366 | + }else if(st<sd&&et<ed&&sd<et){ | ||
| 367 | + vMap.put("version",lv.getVersions()); | ||
| 368 | + vMap.put("startTime",lv.getStartDate().getTime()); | ||
| 369 | + vlist.add(vMap); | ||
| 370 | + } | ||
| 371 | + } | ||
| 372 | + } | ||
| 373 | + rsMap.put("lineVerson",vlist); | ||
| 374 | + if (vlist.size()>1){ | ||
| 375 | + Map<String,Object> VSmap=new HashMap<>(); | ||
| 376 | + VSmap.put("abnormalType","vserionSwitch"); | ||
| 377 | + VSmap.put("st",qt); | ||
| 378 | + versionSwitchList.add(VSmap); | ||
| 379 | + } | ||
| 380 | + } | ||
| 381 | + | ||
| 382 | + } | ||
| 313 | // 按时间排序 | 383 | // 按时间排序 |
| 314 | Collections.sort(list, new Comparator<Map<String, Object>>() { | 384 | Collections.sort(list, new Comparator<Map<String, Object>>() { |
| 315 | 385 | ||
| @@ -321,6 +391,9 @@ public class GpsServiceImpl implements GpsService { | @@ -321,6 +391,9 @@ public class GpsServiceImpl implements GpsService { | ||
| 321 | 391 | ||
| 322 | rsMap.put("list", list); | 392 | rsMap.put("list", list); |
| 323 | rsMap.put("dcs", dcs); | 393 | rsMap.put("dcs", dcs); |
| 394 | + rsMap.put("gpsNotValid",gpsNotValidList); | ||
| 395 | + rsMap.put("lineSwitch",lineSwitch); | ||
| 396 | + rsMap.put("lonlatZero",gpsEqualsZeroList); | ||
| 324 | return rsMap; | 397 | return rsMap; |
| 325 | } | 398 | } |
| 326 | 399 | ||
| @@ -749,6 +822,9 @@ public class GpsServiceImpl implements GpsService { | @@ -749,6 +822,9 @@ public class GpsServiceImpl implements GpsService { | ||
| 749 | rs.put("sumMileage", new DecimalFormat(".##").format(sum / 1000)); | 822 | rs.put("sumMileage", new DecimalFormat(".##").format(sum / 1000)); |
| 750 | rs.put("dcs", gpsMap.get("dcs")); | 823 | rs.put("dcs", gpsMap.get("dcs")); |
| 751 | rs.put("lineVerson",gpsMap.get("lineVerson")); | 824 | rs.put("lineVerson",gpsMap.get("lineVerson")); |
| 825 | + rs.put("gpsInvalid",gpsMap.get("gpsNotValid")); | ||
| 826 | + rs.put("gpslineSwitch",gpsMap.get("lineSwitch")); | ||
| 827 | + rs.put("gpslonlatex",gpsMap.get("lonlatZero")); | ||
| 752 | } catch (Exception e) { | 828 | } catch (Exception e) { |
| 753 | logger.error("", e); | 829 | logger.error("", e); |
| 754 | rs.put("status", ResponseCode.ERROR); | 830 | rs.put("status", ResponseCode.ERROR); |
src/main/java/com/bsth/service/impl/BusIntervalServiceImpl.java
| @@ -306,10 +306,10 @@ public class BusIntervalServiceImpl implements BusIntervalService { | @@ -306,10 +306,10 @@ public class BusIntervalServiceImpl implements BusIntervalService { | ||
| 306 | String sql = "select id,cc_id,mileage_type,destroy,destroy_reason," + | 306 | String sql = "select id,cc_id,mileage_type,destroy,destroy_reason," + |
| 307 | " mileage,type1,type2,schedule from bsth_c_s_child_task" + | 307 | " mileage,type1,type2,schedule from bsth_c_s_child_task" + |
| 308 | " where 1=1"; | 308 | " where 1=1"; |
| 309 | - if(schedule1 != null && schedule1 > 0){ | 309 | + if(schedule1 != null && schedule1 >= 0){ |
| 310 | sql += " and schedule >= '"+schedule1+"'"; | 310 | sql += " and schedule >= '"+schedule1+"'"; |
| 311 | } | 311 | } |
| 312 | - if(schedule2 != null && schedule2 > 0){ | 312 | + if(schedule2 != null && schedule2 >= 0){ |
| 313 | sql += " and schedule <= '"+schedule2+"'"; | 313 | sql += " and schedule <= '"+schedule2+"'"; |
| 314 | } | 314 | } |
| 315 | 315 | ||
| @@ -520,9 +520,9 @@ public class BusIntervalServiceImpl implements BusIntervalService { | @@ -520,9 +520,9 @@ public class BusIntervalServiceImpl implements BusIntervalService { | ||
| 520 | continue; | 520 | continue; |
| 521 | Map<String, List<ScheduleRealInfo>> keyMap2 = new HashMap<String, List<ScheduleRealInfo>>(); | 521 | Map<String, List<ScheduleRealInfo>> keyMap2 = new HashMap<String, List<ScheduleRealInfo>>(); |
| 522 | for(ScheduleRealInfo schedule : keyMap.get(key)){ | 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 | companyName = schedule.getGsName(); | 524 | companyName = schedule.getGsName(); |
| 525 | - if(subCompanyName.length() == 0 && schedule.getFgsName() != null) | 525 | + if(subCompanyName.trim().length() == 0 && schedule.getFgsName() != null) |
| 526 | subCompanyName = schedule.getFgsName(); | 526 | subCompanyName = schedule.getFgsName(); |
| 527 | String date = schedule.getScheduleDateStr(); | 527 | String date = schedule.getScheduleDateStr(); |
| 528 | if(!keyMap2.containsKey(date)) | 528 | if(!keyMap2.containsKey(date)) |
| @@ -1061,7 +1061,7 @@ public class BusIntervalServiceImpl implements BusIntervalService { | @@ -1061,7 +1061,7 @@ public class BusIntervalServiceImpl implements BusIntervalService { | ||
| 1061 | continue; | 1061 | continue; |
| 1062 | } | 1062 | } |
| 1063 | String key = schedule.getScheduleDateStr() + "/" + schedule.getXlName() + "/" | 1063 | String key = schedule.getScheduleDateStr() + "/" + schedule.getXlName() + "/" |
| 1064 | - + schedule.getLpName() + "/" + schedule.getFgsName(); | 1064 | + + schedule.getLpName() + "/" + schedule.getFgsBm(); |
| 1065 | if(model.length() != 0){ | 1065 | if(model.length() != 0){ |
| 1066 | if(ttSet.contains(schedule.getSpId())){ | 1066 | if(ttSet.contains(schedule.getSpId())){ |
| 1067 | if(!keyMap.containsKey(key)) | 1067 | if(!keyMap.containsKey(key)) |
| @@ -1099,10 +1099,10 @@ public class BusIntervalServiceImpl implements BusIntervalService { | @@ -1099,10 +1099,10 @@ public class BusIntervalServiceImpl implements BusIntervalService { | ||
| 1099 | long jhyssj1 = 0, sjyssj1 = 0; | 1099 | long jhyssj1 = 0, sjyssj1 = 0; |
| 1100 | double jhlc = 0, sjlc = 0; | 1100 | double jhlc = 0, sjlc = 0; |
| 1101 | for(ScheduleRealInfo schedule : list2){ | 1101 | for(ScheduleRealInfo schedule : list2){ |
| 1102 | - if(companyName.length() == 0 && schedule.getGsName() != null){ | 1102 | + if(companyName.trim().length() == 0 && schedule.getGsName() != null){ |
| 1103 | companyName = schedule.getGsName(); | 1103 | companyName = schedule.getGsName(); |
| 1104 | } | 1104 | } |
| 1105 | - if(subCompanyName.length() == 0 && schedule.getFgsName() != null){ | 1105 | + if(subCompanyName.trim().length() == 0 && schedule.getFgsName() != null){ |
| 1106 | subCompanyName = schedule.getFgsName(); | 1106 | subCompanyName = schedule.getFgsName(); |
| 1107 | } | 1107 | } |
| 1108 | long fcsj = schedule.getFcsjT(); | 1108 | long fcsj = schedule.getFcsjT(); |
| @@ -1887,7 +1887,7 @@ public class BusIntervalServiceImpl implements BusIntervalService { | @@ -1887,7 +1887,7 @@ public class BusIntervalServiceImpl implements BusIntervalService { | ||
| 1887 | continue; | 1887 | continue; |
| 1888 | } | 1888 | } |
| 1889 | 1889 | ||
| 1890 | - String key = schedule.getXlName() + "/" + schedule.getFgsName(); | 1890 | + String key = schedule.getXlName() + "/" + schedule.getFgsBm(); |
| 1891 | if(!keyMap.containsKey(key)) | 1891 | if(!keyMap.containsKey(key)) |
| 1892 | keyMap.put(key, new ArrayList<ScheduleRealInfo>()); | 1892 | keyMap.put(key, new ArrayList<ScheduleRealInfo>()); |
| 1893 | keyMap.get(key).add(schedule); | 1893 | keyMap.get(key).add(schedule); |
| @@ -1978,9 +1978,9 @@ public class BusIntervalServiceImpl implements BusIntervalService { | @@ -1978,9 +1978,9 @@ public class BusIntervalServiceImpl implements BusIntervalService { | ||
| 1978 | qtlc = new BigDecimal("0"); | 1978 | qtlc = new BigDecimal("0"); |
| 1979 | String companyName = "", subCompanyName = ""; | 1979 | String companyName = "", subCompanyName = ""; |
| 1980 | for(ScheduleRealInfo schedule : keyMap.get(key)){ | 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 | companyName = schedule.getGsName(); | 1982 | companyName = schedule.getGsName(); |
| 1983 | - if(schedule.getFgsName() != null && subCompanyName.length() == 0) | 1983 | + if(schedule.getFgsName() != null && subCompanyName.trim().length() == 0) |
| 1984 | subCompanyName = schedule.getFgsName(); | 1984 | subCompanyName = schedule.getFgsName(); |
| 1985 | BigDecimal lc = new BigDecimal("0"); | 1985 | BigDecimal lc = new BigDecimal("0"); |
| 1986 | if(schedule.getJhlcOrig() != null && schedule.getJhlcOrig() > 0.1d){ | 1986 | if(schedule.getJhlcOrig() != null && schedule.getJhlcOrig() > 0.1d){ |
| @@ -2071,7 +2071,8 @@ public class BusIntervalServiceImpl implements BusIntervalService { | @@ -2071,7 +2071,8 @@ public class BusIntervalServiceImpl implements BusIntervalService { | ||
| 2071 | String[] keys = key.split("/"); | 2071 | String[] keys = key.split("/"); |
| 2072 | tempMap.put("date", Date); | 2072 | tempMap.put("date", Date); |
| 2073 | tempMap.put("company", companyName); | 2073 | tempMap.put("company", companyName); |
| 2074 | - tempMap.put("subCompany", keys[1]); | 2074 | + tempMap.put("subCompany", subCompanyName); |
| 2075 | +// tempMap.put("subCompany", keys[1]); | ||
| 2075 | tempMap.put("times", sfqr == 1 ? times : "全日"); | 2076 | tempMap.put("times", sfqr == 1 ? times : "全日"); |
| 2076 | tempMap.put("line", keys[0]); | 2077 | tempMap.put("line", keys[0]); |
| 2077 | tempMap.put("jhbc", jhbc); | 2078 | tempMap.put("jhbc", jhbc); |
| @@ -2338,17 +2339,23 @@ public class BusIntervalServiceImpl implements BusIntervalService { | @@ -2338,17 +2339,23 @@ public class BusIntervalServiceImpl implements BusIntervalService { | ||
| 2338 | continue; | 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 | if(!keyMap.containsKey(key)) | 2343 | if(!keyMap.containsKey(key)) |
| 2343 | keyMap.put(key, new ArrayList<ScheduleRealInfo>()); | 2344 | keyMap.put(key, new ArrayList<ScheduleRealInfo>()); |
| 2344 | keyMap.get(key).add(schedule); | 2345 | keyMap.get(key).add(schedule); |
| 2345 | } | 2346 | } |
| 2347 | + | ||
| 2346 | for(String key : keyMap.keySet()){ | 2348 | for(String key : keyMap.keySet()){ |
| 2349 | + String companyName = "", subCompanyName = ""; | ||
| 2347 | Map<String, Object> tempMap = new HashMap<String, Object>(); | 2350 | Map<String, Object> tempMap = new HashMap<String, Object>(); |
| 2348 | List<ScheduleRealInfo> tempList = new ArrayList<ScheduleRealInfo>(); | 2351 | List<ScheduleRealInfo> tempList = new ArrayList<ScheduleRealInfo>(); |
| 2349 | int sjbc = 0, sddf = 0, zddf = 0, | 2352 | int sjbc = 0, sddf = 0, zddf = 0, |
| 2350 | dxtz = 0, lbtz = 0; | 2353 | dxtz = 0, lbtz = 0; |
| 2351 | for(ScheduleRealInfo schedule : keyMap.get(key)){ | 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 | boolean flag = false; | 2359 | boolean flag = false; |
| 2353 | if(schedule.getFcsjActual() != null && schedule.getZdsjActual() != null | 2360 | if(schedule.getFcsjActual() != null && schedule.getZdsjActual() != null |
| 2354 | && schedule.getStatus() != -1 && !schedule.isCcService()){ | 2361 | && schedule.getStatus() != -1 && !schedule.isCcService()){ |
| @@ -2373,8 +2380,10 @@ public class BusIntervalServiceImpl implements BusIntervalService { | @@ -2373,8 +2380,10 @@ public class BusIntervalServiceImpl implements BusIntervalService { | ||
| 2373 | } | 2380 | } |
| 2374 | tempMap.put("date", date); | 2381 | tempMap.put("date", date); |
| 2375 | String[] keys = key.split("/"); | 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 | tempMap.put("line", keys[2]); | 2387 | tempMap.put("line", keys[2]); |
| 2379 | tempMap.put("sjbc", sjbc); | 2388 | tempMap.put("sjbc", sjbc); |
| 2380 | tempMap.put("sddf", sddf); | 2389 | tempMap.put("sddf", sddf); |
| @@ -3108,7 +3117,7 @@ public class BusIntervalServiceImpl implements BusIntervalService { | @@ -3108,7 +3117,7 @@ public class BusIntervalServiceImpl implements BusIntervalService { | ||
| 3108 | continue; | 3117 | continue; |
| 3109 | } | 3118 | } |
| 3110 | 3119 | ||
| 3111 | - String xl = s.getXlName() + "/" + s.getFgsName(); | 3120 | + String xl = s.getXlName() + "/" + s.getFgsBm(); |
| 3112 | String dateStr = s.getScheduleDateStr(); | 3121 | String dateStr = s.getScheduleDateStr(); |
| 3113 | if(!sches.containsKey(xl)){ | 3122 | if(!sches.containsKey(xl)){ |
| 3114 | sches.put(xl, new HashMap<String, List<ScheduleRealInfo>>()); | 3123 | sches.put(xl, new HashMap<String, List<ScheduleRealInfo>>()); |
| @@ -3138,12 +3147,19 @@ public class BusIntervalServiceImpl implements BusIntervalService { | @@ -3138,12 +3147,19 @@ public class BusIntervalServiceImpl implements BusIntervalService { | ||
| 3138 | List<List<Map<String, Object>>> lists = new ArrayList<List<Map<String, Object>>>(); | 3147 | List<List<Map<String, Object>>> lists = new ArrayList<List<Map<String, Object>>>(); |
| 3139 | Map<Long, ScheduleRealInfo> keyTemp = new HashMap<Long, ScheduleRealInfo>(); | 3148 | Map<Long, ScheduleRealInfo> keyTemp = new HashMap<Long, ScheduleRealInfo>(); |
| 3140 | for(Long time : timeList){ | 3149 | for(Long time : timeList){ |
| 3150 | + String companyName = "", subCompanyName = ""; | ||
| 3141 | List<Long> keyList = new ArrayList<Long>(); | 3151 | List<Long> keyList = new ArrayList<Long>(); |
| 3142 | String date = timeTemp.get(time); | 3152 | String date = timeTemp.get(time); |
| 3143 | List<ScheduleRealInfo> sche2 = sche1.get(date); | 3153 | List<ScheduleRealInfo> sche2 = sche1.get(date); |
| 3144 | for(ScheduleRealInfo s : sche2){ | 3154 | for(ScheduleRealInfo s : sche2){ |
| 3145 | if(s.getFcsj()!=null && s.getFcsj().trim().length() > 0 | 3155 | if(s.getFcsj()!=null && s.getFcsj().trim().length() > 0 |
| 3146 | && s.getFcsj().contains(":")){ | 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 | String[] split = s.getFcsj().split(":"); | 3163 | String[] split = s.getFcsj().split(":"); |
| 3148 | Long key = Long.valueOf(s.getXlDir())*1500 + Long.valueOf(split[0])*60 + Long.valueOf(split[1]); | 3164 | Long key = Long.valueOf(s.getXlDir())*1500 + Long.valueOf(split[0])*60 + Long.valueOf(split[1]); |
| 3149 | while(keyTemp.containsKey(key)){ | 3165 | while(keyTemp.containsKey(key)){ |
| @@ -3158,8 +3174,10 @@ public class BusIntervalServiceImpl implements BusIntervalService { | @@ -3158,8 +3174,10 @@ public class BusIntervalServiceImpl implements BusIntervalService { | ||
| 3158 | for(Long l : keyList){ | 3174 | for(Long l : keyList){ |
| 3159 | ScheduleRealInfo s = keyTemp.get(l); | 3175 | ScheduleRealInfo s = keyTemp.get(l); |
| 3160 | Map<String, Object> temp = new HashMap<String, Object>(); | 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 | temp.put("fgsBm", s.getFgsBm()); | 3181 | temp.put("fgsBm", s.getFgsBm()); |
| 3164 | temp.put("date", date); | 3182 | temp.put("date", date); |
| 3165 | temp.put("xlbm", s.getXlBm()); | 3183 | temp.put("xlbm", s.getXlBm()); |
src/main/java/com/bsth/service/oil/impl/YlbServiceImpl.java
| @@ -291,6 +291,26 @@ public class YlbServiceImpl extends BaseServiceImpl<Ylb,Integer> implements YlbS | @@ -291,6 +291,26 @@ public class YlbServiceImpl extends BaseServiceImpl<Ylb,Integer> implements YlbS | ||
| 291 | String sxtj=map2.get("sxtj").toString(); | 291 | String sxtj=map2.get("sxtj").toString(); |
| 292 | if(sxtj.equals("0")){ | 292 | if(sxtj.equals("0")){ |
| 293 | listpb=listpbs; | 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 | }else{ | 314 | }else{ |
| 295 | List<Object[]> objectLists=repository.checkNbmmNum(rq, gsbm, fgsbm, "",nbbm); | 315 | List<Object[]> objectLists=repository.checkNbmmNum(rq, gsbm, fgsbm, "",nbbm); |
| 296 | List<String> stringList=new ArrayList<String>(); | 316 | List<String> stringList=new ArrayList<String>(); |
| @@ -1269,6 +1289,19 @@ public class YlbServiceImpl extends BaseServiceImpl<Ylb,Integer> implements YlbS | @@ -1269,6 +1289,19 @@ public class YlbServiceImpl extends BaseServiceImpl<Ylb,Integer> implements YlbS | ||
| 1269 | else | 1289 | else |
| 1270 | listYlb = repository.listYlb_s(sdf.parse(rq+" 00:00:00"), gsbm, fgsbm, xlbm, stringList); | 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 | } else { | 1305 | } else { |
| 1273 | List<Object[]> objectLists; | 1306 | List<Object[]> objectLists; |
| 1274 | if (sxtj.equals("3")) { | 1307 | if (sxtj.equals("3")) { |
| @@ -1395,6 +1428,10 @@ public class YlbServiceImpl extends BaseServiceImpl<Ylb,Integer> implements YlbS | @@ -1395,6 +1428,10 @@ public class YlbServiceImpl extends BaseServiceImpl<Ylb,Integer> implements YlbS | ||
| 1395 | try { | 1428 | try { |
| 1396 | List<Cyl> cylList = cylRepository.findAll(new CustomerSpecs<Cyl>(newMap)); | 1429 | List<Cyl> cylList = cylRepository.findAll(new CustomerSpecs<Cyl>(newMap)); |
| 1397 | String json =StringEscapeUtils.unescapeHtml4(map.get("ylbList").toString()); | 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 | JSONArray jsonArray=JSONArray.parseArray(json); | 1435 | JSONArray jsonArray=JSONArray.parseArray(json); |
| 1399 | JSONObject jsonObject; | 1436 | JSONObject jsonObject; |
| 1400 | for (int x = 0; x < jsonArray.size(); x++) { | 1437 | for (int x = 0; x < jsonArray.size(); x++) { |
| @@ -1409,7 +1446,12 @@ public class YlbServiceImpl extends BaseServiceImpl<Ylb,Integer> implements YlbS | @@ -1409,7 +1446,12 @@ public class YlbServiceImpl extends BaseServiceImpl<Ylb,Integer> implements YlbS | ||
| 1409 | String nbbm_eq = ylb.getNbbm(); | 1446 | String nbbm_eq = ylb.getNbbm(); |
| 1410 | Date rq_eq = ylb.getRq(); | 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 | Double jzl = 0.0; | 1456 | Double jzl = 0.0; |
| 1415 | // 保存总的里程 | 1457 | // 保存总的里程 |
| @@ -1431,9 +1473,14 @@ public class YlbServiceImpl extends BaseServiceImpl<Ylb,Integer> implements YlbS | @@ -1431,9 +1473,14 @@ public class YlbServiceImpl extends BaseServiceImpl<Ylb,Integer> implements YlbS | ||
| 1431 | }*/ | 1473 | }*/ |
| 1432 | map.put("nbbm_eq", nbbm_eq); | 1474 | map.put("nbbm_eq", nbbm_eq); |
| 1433 | map.put("rq_eq", rq_eq); | 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 | // repository.obtainYl(sdf.format(rq_eq),ylb.getSsgsdm(),ylb.getFgsdm(),"", | 1484 | // repository.obtainYl(sdf.format(rq_eq),ylb.getSsgsdm(),ylb.getFgsdm(),"", |
| 1438 | // ylb.getNbbm(),"jcsx"); | 1485 | // ylb.getNbbm(),"jcsx"); |
| 1439 | DecimalFormat df = new DecimalFormat("#.00"); | 1486 | DecimalFormat df = new DecimalFormat("#.00"); |
src/main/java/com/bsth/service/realcontrol/impl/ScheduleRealInfoServiceImpl.java
| @@ -568,7 +568,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -568,7 +568,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 568 | 568 | ||
| 569 | //公司 和 分公司名称 | 569 | //公司 和 分公司名称 |
| 570 | t.setGsName(BasicData.businessCodeNameMap.get(t.getGsBm())); | 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 | //t.setScheduleDateStr(schDate); | 573 | //t.setScheduleDateStr(schDate); |
| 574 | t.setScheduleDate(sdfyyyyMMdd.parse(t.getScheduleDateStr())); | 574 | t.setScheduleDate(sdfyyyyMMdd.parse(t.getScheduleDateStr())); |
| @@ -590,6 +590,11 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -590,6 +590,11 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 590 | 590 | ||
| 591 | //计算班次实际执行时间 | 591 | //计算班次实际执行时间 |
| 592 | schAttrCalculator.calcRealDate(t).calcAllTimeByFcsj(t); | 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 | if (t.getZdsjT() < t.getFcsjT()) { | 598 | if (t.getZdsjT() < t.getFcsjT()) { |
| 594 | rs.put("status", ResponseCode.ERROR); | 599 | rs.put("status", ResponseCode.ERROR); |
| 595 | rs.put("msg", "起终点时间异常!"); | 600 | rs.put("msg", "起终点时间异常!"); |
src/main/java/com/bsth/service/report/impl/CalcSheetServiceImpl.java
| @@ -790,11 +790,11 @@ public class CalcSheetServiceImpl extends BaseServiceImpl<CalcSheet, Integer> im | @@ -790,11 +790,11 @@ public class CalcSheetServiceImpl extends BaseServiceImpl<CalcSheet, Integer> im | ||
| 790 | if(map.get("fgsdmTurn")!=null){ | 790 | if(map.get("fgsdmTurn")!=null){ |
| 791 | fgs=map.get("fgsdmTurn").toString().trim(); | 791 | fgs=map.get("fgsdmTurn").toString().trim(); |
| 792 | } | 792 | } |
| 793 | -// String nature="0"; | ||
| 794 | -// if(map.get("nature")!=null){ | ||
| 795 | -// nature=map.get("nature").toString(); | ||
| 796 | -// } | ||
| 797 | -// Map<String, Boolean> lineMap=lineService.lineNature(); | 793 | + String nature="0"; |
| 794 | + if(map.get("nature")!=null){ | ||
| 795 | + nature=map.get("nature").toString(); | ||
| 796 | + } | ||
| 797 | + Map<String, Boolean> lineMap=lineService.lineNature(); | ||
| 798 | 798 | ||
| 799 | String startDate=map.get("startDate").toString(); | 799 | String startDate=map.get("startDate").toString(); |
| 800 | String endDate=map.get("endDate").toString(); | 800 | String endDate=map.get("endDate").toString(); |
| @@ -847,16 +847,82 @@ public class CalcSheetServiceImpl extends BaseServiceImpl<CalcSheet, Integer> im | @@ -847,16 +847,82 @@ public class CalcSheetServiceImpl extends BaseServiceImpl<CalcSheet, Integer> im | ||
| 847 | return s; | 847 | return s; |
| 848 | } | 848 | } |
| 849 | }); | 849 | }); |
| 850 | + | ||
| 851 | + | ||
| 852 | + List<Map<String, Object>> list=new ArrayList<Map<String,Object>>(); | ||
| 853 | + int jhcc = 0, sjcc = 0; | ||
| 854 | + int jhcczgf = 0, sjcczgf = 0; | ||
| 855 | + int count=0; | ||
| 856 | + Map<String, String> xlMap=new HashMap<String,String>(); | ||
| 857 | + for(Map<String, Object> m : lists){ | ||
| 858 | + if(nature.equals("0")){ | ||
| 859 | + list.add(m); | ||
| 860 | + jhcc += Integer.valueOf(m.get("jhcc").toString()); | ||
| 861 | + sjcc += Integer.valueOf(m.get("sjcc").toString()); | ||
| 862 | + jhcczgf += Integer.valueOf(m.get("jhcczgf").toString()); | ||
| 863 | + sjcczgf +=Integer.valueOf(m.get("sjcczgf").toString()); | ||
| 864 | + if(xlMap.get(m.get("xl").toString())==null){ | ||
| 865 | + count++; | ||
| 866 | + xlMap.put(m.get("xl").toString(), m.get("xl").toString()); | ||
| 867 | + } | ||
| 868 | + }else if(nature.equals("1")){ | ||
| 869 | + if(lineMap.get(m.get("xl").toString())){ | ||
| 870 | + list.add(m); | ||
| 871 | + jhcc += Integer.valueOf(m.get("jhcc").toString()); | ||
| 872 | + sjcc += Integer.valueOf(m.get("sjcc").toString()); | ||
| 873 | + jhcczgf += Integer.valueOf(m.get("jhcczgf").toString()); | ||
| 874 | + sjcczgf +=Integer.valueOf(m.get("sjcczgf").toString()); | ||
| 875 | + if(xlMap.get(m.get("xl").toString())==null){ | ||
| 876 | + count++; | ||
| 877 | + xlMap.put(m.get("xl").toString(), m.get("xl").toString()); | ||
| 878 | + } | ||
| 879 | + } | ||
| 880 | + }else{ | ||
| 881 | + if(!lineMap.get(m.get("xl").toString())){ | ||
| 882 | + list.add(m); | ||
| 883 | + jhcc += Integer.valueOf(m.get("jhcc").toString()); | ||
| 884 | + sjcc += Integer.valueOf(m.get("sjcc").toString()); | ||
| 885 | + jhcczgf += Integer.valueOf(m.get("jhcczgf").toString()); | ||
| 886 | + sjcczgf +=Integer.valueOf(m.get("sjcczgf").toString()); | ||
| 887 | + if(xlMap.get(m.get("xl").toString())==null){ | ||
| 888 | + count++; | ||
| 889 | + xlMap.put(m.get("xl").toString(), m.get("xl").toString()); | ||
| 890 | + } | ||
| 891 | + } | ||
| 892 | + } | ||
| 893 | + | ||
| 894 | + } | ||
| 895 | + | ||
| 896 | + Map<String, Object> tempMap=new HashMap<String,Object>(); | ||
| 897 | + tempMap.put("rq", "分类汇总"); | ||
| 898 | + tempMap.put("line_", "共" + list.size() + "条线路"); | ||
| 899 | + tempMap.put("xlName", "共" +count + "条线路"); | ||
| 900 | + tempMap.put("jhcc", jhcc); | ||
| 901 | + tempMap.put("sjcc", sjcc); | ||
| 902 | + tempMap.put("sjcczgf", sjcczgf); | ||
| 903 | + tempMap.put("jhcczgf", jhcczgf); | ||
| 904 | + tempMap.put("sm", ""); | ||
| 905 | + list.add(tempMap); | ||
| 906 | + if(jhcc != 0 && sjcc != 0){ | ||
| 907 | + tempMap.put("ccl", df.format(((float)sjcc / jhcc)*100)+"%"); | ||
| 908 | + }else{ | ||
| 909 | + tempMap.put("ccl", "0.00%"); | ||
| 910 | + } | ||
| 911 | + if(jhcczgf != 0 && sjcczgf != 0){ | ||
| 912 | + tempMap.put("cclzgf", df.format(((float)sjcczgf / jhcczgf)*100)+"%"); | ||
| 913 | + }else{ | ||
| 914 | + tempMap.put("cclzgf", "0.00%"); | ||
| 915 | + } | ||
| 850 | if (type.equals("export")) { | 916 | if (type.equals("export")) { |
| 851 | String lineName=map.get("lineName").toString(); | 917 | String lineName=map.get("lineName").toString(); |
| 852 | ReportUtils ee = new ReportUtils(); | 918 | ReportUtils ee = new ReportUtils(); |
| 853 | List<Iterator<?>> listI = new ArrayList<Iterator<?>>(); | 919 | List<Iterator<?>> listI = new ArrayList<Iterator<?>>(); |
| 854 | - listI.add(lists.iterator()); | 920 | + listI.add(list.iterator()); |
| 855 | String path = this.getClass().getResource("/").getPath() + "static/pages/forms/"; | 921 | String path = this.getClass().getResource("/").getPath() + "static/pages/forms/"; |
| 856 | ee.excelReplace(listI, new Object[] { map }, path + "mould/calcTurnoutrateZgf.xls", path + "export/" | 922 | ee.excelReplace(listI, new Object[] { map }, path + "mould/calcTurnoutrateZgf.xls", path + "export/" |
| 857 | + dates + "-" + lineName + "-营运线路出车率统计表.xls"); | 923 | + dates + "-" + lineName + "-营运线路出车率统计表.xls"); |
| 858 | } | 924 | } |
| 859 | - return lists; | 925 | + return list; |
| 860 | } | 926 | } |
| 861 | 927 | ||
| 862 | @Override | 928 | @Override |
src/main/java/com/bsth/service/schedule/datatools/TTInfoDetailDataToolsImpl.java
| @@ -454,6 +454,19 @@ public class TTInfoDetailDataToolsImpl implements DataToolsService, TTInfoDetail | @@ -454,6 +454,19 @@ public class TTInfoDetailDataToolsImpl implements DataToolsService, TTInfoDetail | ||
| 454 | 454 | ||
| 455 | StationRoute station1 = stationRouteService.findById(lpObjList.get(0).getStationRouteId1()); | 455 | StationRoute station1 = stationRouteService.findById(lpObjList.get(0).getStationRouteId1()); |
| 456 | StationRoute station2 = stationRouteService.findById(lpObjList.get(1).getStationRouteId2()); | 456 | StationRoute station2 = stationRouteService.findById(lpObjList.get(1).getStationRouteId2()); |
| 457 | + | ||
| 458 | + // TODO | ||
| 459 | + Map<String, Object> param = new HashMap<>(); | ||
| 460 | + param.put("station.id_eq", null); | ||
| 461 | + if (station1 == null) { | ||
| 462 | + param.put("station.id_eq", lpObjList.get(0).getStationRouteId1()); | ||
| 463 | + station1 = ((List<StationRoute>) stationRouteService.list(param)).get(0); | ||
| 464 | + } | ||
| 465 | + if (station2 == null) { | ||
| 466 | + param.put("station.id_eq", lpObjList.get(0).getStationRouteId2()); | ||
| 467 | + station2 = ((List<StationRoute>) stationRouteService.list(param)).get(0); | ||
| 468 | + } | ||
| 469 | + | ||
| 457 | for (int i = 0; i < groupCount; i++) { | 470 | for (int i = 0; i < groupCount; i++) { |
| 458 | excelPoiOperator.createStringCell(wb, lpHeadRow, (short) (i * 2 + 1), station1.getStationName(), new Color(0x96b9d7)); | 471 | excelPoiOperator.createStringCell(wb, lpHeadRow, (short) (i * 2 + 1), station1.getStationName(), new Color(0x96b9d7)); |
| 459 | excelPoiOperator.createStringCell(wb, lpHeadRow, (short) (i * 2 + 2), station2.getStationName(), new Color(0x96b9d7)); | 472 | excelPoiOperator.createStringCell(wb, lpHeadRow, (short) (i * 2 + 2), station2.getStationName(), new Color(0x96b9d7)); |
| @@ -566,6 +579,19 @@ public class TTInfoDetailDataToolsImpl implements DataToolsService, TTInfoDetail | @@ -566,6 +579,19 @@ public class TTInfoDetailDataToolsImpl implements DataToolsService, TTInfoDetail | ||
| 566 | 579 | ||
| 567 | StationRoute station1 = stationRouteService.findById(lpObjList.get(0).getStationRouteId1()); | 580 | StationRoute station1 = stationRouteService.findById(lpObjList.get(0).getStationRouteId1()); |
| 568 | StationRoute station2 = stationRouteService.findById(lpObjList.get(1).getStationRouteId2()); | 581 | StationRoute station2 = stationRouteService.findById(lpObjList.get(1).getStationRouteId2()); |
| 582 | + | ||
| 583 | + // TODO | ||
| 584 | + Map<String, Object> param = new HashMap<>(); | ||
| 585 | + param.put("station.id_eq", null); | ||
| 586 | + if (station1 == null) { | ||
| 587 | + param.put("station.id_eq", lpObjList.get(0).getStationRouteId1()); | ||
| 588 | + station1 = ((List<StationRoute>) stationRouteService.list(param)).get(0); | ||
| 589 | + } | ||
| 590 | + if (station2 == null) { | ||
| 591 | + param.put("station.id_eq", lpObjList.get(0).getStationRouteId2()); | ||
| 592 | + station2 = ((List<StationRoute>) stationRouteService.list(param)).get(0); | ||
| 593 | + } | ||
| 594 | + | ||
| 569 | for (int i = 1; i <= groupCount; i++) { | 595 | for (int i = 1; i <= groupCount; i++) { |
| 570 | excelPoiOperator.createStringCell(wb, lpHeadRow, (short) (i * 2 + 1), station1.getStationName(), new Color(0x96b9d7)); | 596 | excelPoiOperator.createStringCell(wb, lpHeadRow, (short) (i * 2 + 1), station1.getStationName(), new Color(0x96b9d7)); |
| 571 | excelPoiOperator.createStringCell(wb, lpHeadRow, (short) (i * 2 + 2), station2.getStationName(), new Color(0x96b9d7)); | 597 | excelPoiOperator.createStringCell(wb, lpHeadRow, (short) (i * 2 + 2), station2.getStationName(), new Color(0x96b9d7)); |
| @@ -644,7 +670,9 @@ public class TTInfoDetailDataToolsImpl implements DataToolsService, TTInfoDetail | @@ -644,7 +670,9 @@ public class TTInfoDetailDataToolsImpl implements DataToolsService, TTInfoDetail | ||
| 644 | cell.setCellValue(bcObj.getFcsj() + "X"); | 670 | cell.setCellValue(bcObj.getFcsj() + "X"); |
| 645 | } else { // 一个车次链 | 671 | } else { // 一个车次链 |
| 646 | cell = lpRow.getCell((short) (bcObj.getGroupNo() * 2 + bcObj.getGroupBcNo() + 3)); | 672 | cell = lpRow.getCell((short) (bcObj.getGroupNo() * 2 + bcObj.getGroupBcNo() + 3)); |
| 647 | - cell.setCellValue(bcObj.getFcsj() + "X"); | 673 | + if (cell != null) { |
| 674 | + cell.setCellValue(bcObj.getFcsj() + "X"); | ||
| 675 | + } | ||
| 648 | } | 676 | } |
| 649 | break; | 677 | break; |
| 650 | case LC: | 678 | case LC: |
src/main/java/com/bsth/service/schedule/log/ModuleOperatorDbAppender.java
0 → 100644
| 1 | +package com.bsth.service.schedule.log; | ||
| 2 | + | ||
| 3 | +import ch.qos.logback.classic.spi.ILoggingEvent; | ||
| 4 | +import ch.qos.logback.core.db.DBAppenderBase; | ||
| 5 | +import ch.qos.logback.core.db.DBHelper; | ||
| 6 | +import com.bsth.control_v2.plan_module.common.exception.PlanModuleException; | ||
| 7 | +import com.bsth.entity.schedule.log.ModuleOperatorLog; | ||
| 8 | + | ||
| 9 | +import java.lang.reflect.Method; | ||
| 10 | +import java.sql.Connection; | ||
| 11 | +import java.sql.Date; | ||
| 12 | +import java.sql.PreparedStatement; | ||
| 13 | + | ||
| 14 | +/** | ||
| 15 | + * 自定义模块业务操作日志logback自定义appender。 | ||
| 16 | + */ | ||
| 17 | +public class ModuleOperatorDbAppender extends DBAppenderBase<ILoggingEvent> { | ||
| 18 | + /** JDBC3.0中的绑定表自增的主键值,获取result需要此方法 */ | ||
| 19 | + protected static final Method GET_GENERATED_KEYS_METHOD; | ||
| 20 | + /** 插入日志sql */ | ||
| 21 | + protected static final String INSERT_SQL; | ||
| 22 | + | ||
| 23 | + @Override | ||
| 24 | + public void start() { | ||
| 25 | + super.start(); | ||
| 26 | + } | ||
| 27 | + | ||
| 28 | + @Override | ||
| 29 | + protected Method getGeneratedKeysMethod() { | ||
| 30 | + return GET_GENERATED_KEYS_METHOD; | ||
| 31 | + } | ||
| 32 | + | ||
| 33 | + @Override | ||
| 34 | + protected String getInsertSQL() { | ||
| 35 | + return INSERT_SQL; | ||
| 36 | + } | ||
| 37 | + | ||
| 38 | + @Override | ||
| 39 | + protected void subAppend(ILoggingEvent iLoggingEvent, Connection connection, PreparedStatement insertStatement) throws Throwable { | ||
| 40 | + // 参数判定,第一个参数必须是ModuleOperatorLog,后续的参数最多取3个 | ||
| 41 | + if (iLoggingEvent.getArgumentArray().length == 0) { | ||
| 42 | + throw new PlanModuleException(iLoggingEvent.getLoggerName() + "日志参数必须大于1"); | ||
| 43 | + } else { | ||
| 44 | + Object arg1 = iLoggingEvent.getArgumentArray()[0]; | ||
| 45 | + if (!(arg1 instanceof ModuleOperatorLog)) { | ||
| 46 | + throw new PlanModuleException(iLoggingEvent.getLoggerName() + "日志第一个参数必须是ModuleOperatorLog类型"); | ||
| 47 | + } else { | ||
| 48 | + ModuleOperatorLog arg1_log = (ModuleOperatorLog) arg1; | ||
| 49 | + // insertStatement设定ModuleOperatorLog关联数据 | ||
| 50 | + insertStatement.setLong(1, iLoggingEvent.getTimeStamp()); | ||
| 51 | + insertStatement.setString(2, arg1_log.getModuleType().getDicDesc()); | ||
| 52 | + insertStatement.setString(3, arg1_log.getOperatorType().getDicDesc()); | ||
| 53 | + insertStatement.setString(4, arg1_log.getModuleOperatorType().getDicDesc()); | ||
| 54 | + insertStatement.setString(5, arg1_log.getMessage()); | ||
| 55 | + insertStatement.setString(6, iLoggingEvent.getLevel().levelStr); | ||
| 56 | + insertStatement.setDate(7, new Date(arg1_log.getOpStartTime().getTime())); | ||
| 57 | + insertStatement.setDate(8, new Date(arg1_log.getOpEndTime().getTime())); | ||
| 58 | + insertStatement.setString(9, arg1_log.getOpUserName()); | ||
| 59 | + insertStatement.setString(10, arg1_log.getOpUserCode()); | ||
| 60 | + insertStatement.setString(11, arg1_log.getOpEntityClass()); | ||
| 61 | + insertStatement.setString(12, arg1_log.getOpBeforeJson()); | ||
| 62 | + insertStatement.setString(13, arg1_log.getOpAfterJson()); | ||
| 63 | + insertStatement.setString(14, ""); | ||
| 64 | + insertStatement.setString(15, ""); | ||
| 65 | + insertStatement.setString(16, ""); | ||
| 66 | + | ||
| 67 | + for (int i = 1; i < iLoggingEvent.getArgumentArray().length; i++) { | ||
| 68 | + if (i == 1) { | ||
| 69 | + insertStatement.setString(14, iLoggingEvent.getArgumentArray()[i].toString()); | ||
| 70 | + } else if (i == 2) { | ||
| 71 | + insertStatement.setString(15, iLoggingEvent.getArgumentArray()[i].toString()); | ||
| 72 | + } else if (i == 3) { | ||
| 73 | + insertStatement.setString(16, iLoggingEvent.getArgumentArray()[i].toString()); | ||
| 74 | + } else { | ||
| 75 | + break; | ||
| 76 | + } | ||
| 77 | + } | ||
| 78 | + | ||
| 79 | + int updateCount = insertStatement.executeUpdate(); | ||
| 80 | + if (updateCount != 1) { | ||
| 81 | + addWarn("Failed to insert loggingEvent"); | ||
| 82 | + } | ||
| 83 | + } | ||
| 84 | + } | ||
| 85 | + | ||
| 86 | + } | ||
| 87 | + | ||
| 88 | + @Override | ||
| 89 | + protected void secondarySubAppend(ILoggingEvent iLoggingEvent, Connection connection, long l) throws Throwable { | ||
| 90 | + // TODO: | ||
| 91 | + } | ||
| 92 | + | ||
| 93 | + @Override | ||
| 94 | + public void append(ILoggingEvent eventObject) { | ||
| 95 | + Connection connection = null; | ||
| 96 | + PreparedStatement insertStatement = null; | ||
| 97 | + try { | ||
| 98 | + connection = this.connectionSource.getConnection(); | ||
| 99 | + connection.setAutoCommit(false); | ||
| 100 | + insertStatement = connection.prepareStatement(INSERT_SQL); | ||
| 101 | + synchronized (this) { | ||
| 102 | + subAppend(eventObject, connection, insertStatement); | ||
| 103 | + } | ||
| 104 | + // TODO:可能以后需要secondarySubAppend | ||
| 105 | + | ||
| 106 | + connection.commit(); | ||
| 107 | + } catch (Throwable exp) { | ||
| 108 | + exp.printStackTrace(); | ||
| 109 | + this.addError("problem appending event", exp); | ||
| 110 | + } finally { | ||
| 111 | + DBHelper.closeStatement(insertStatement); | ||
| 112 | + DBHelper.closeConnection(connection); | ||
| 113 | + } | ||
| 114 | + } | ||
| 115 | + | ||
| 116 | + static { | ||
| 117 | + StringBuilder sql = new StringBuilder(); | ||
| 118 | + sql.append("insert into bsth_c_s_op_log ("); | ||
| 119 | + sql.append("timestmp, "); | ||
| 120 | + sql.append("module_type, "); | ||
| 121 | + sql.append("operator_type, "); | ||
| 122 | + sql.append("module_operator_type, "); | ||
| 123 | + sql.append("message, "); | ||
| 124 | + sql.append("level_name, "); | ||
| 125 | + sql.append("op_start_time, "); | ||
| 126 | + sql.append("op_end_time, "); | ||
| 127 | + sql.append("op_user_name, "); | ||
| 128 | + sql.append("op_user_code, "); | ||
| 129 | + sql.append("op_entity_class, "); | ||
| 130 | + sql.append("op_before_json, "); | ||
| 131 | + sql.append("op_after_json, "); | ||
| 132 | + sql.append("opt_arg1, "); | ||
| 133 | + sql.append("opt_arg2, "); | ||
| 134 | + sql.append("opt_arg3) "); | ||
| 135 | + sql.append(" values (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)"); | ||
| 136 | + INSERT_SQL = sql.toString(); | ||
| 137 | + | ||
| 138 | + Method getGeneratedKeysMethod; | ||
| 139 | + try { | ||
| 140 | + getGeneratedKeysMethod = PreparedStatement.class.getMethod("getGeneratedKeys", (Class[])null); | ||
| 141 | + } catch (Exception exp) { | ||
| 142 | + getGeneratedKeysMethod = null; | ||
| 143 | + } | ||
| 144 | + | ||
| 145 | + GET_GENERATED_KEYS_METHOD = getGeneratedKeysMethod; | ||
| 146 | + } | ||
| 147 | +} |
src/main/java/com/bsth/service/schedule/log/PlanLogger.java
0 → 100644
| 1 | +package com.bsth.service.schedule.log; | ||
| 2 | + | ||
| 3 | +import com.bsth.control_v2.plan_module.common.dto.schedule.PlanInfoDto; | ||
| 4 | +import com.bsth.control_v2.plan_module.common.enums.log.ModuleOperatorType; | ||
| 5 | +import com.bsth.control_v2.plan_module.common.enums.log.ModuleType; | ||
| 6 | +import com.bsth.control_v2.plan_module.common.enums.log.OperatorType; | ||
| 7 | +import com.bsth.entity.schedule.SchedulePlan; | ||
| 8 | +import com.bsth.entity.schedule.log.ModuleOperatorLog; | ||
| 9 | +import org.slf4j.Logger; | ||
| 10 | +import org.slf4j.LoggerFactory; | ||
| 11 | +import org.springframework.stereotype.Service; | ||
| 12 | + | ||
| 13 | +import java.util.Date; | ||
| 14 | + | ||
| 15 | +/** | ||
| 16 | + * 排班计划日志。 | ||
| 17 | + */ | ||
| 18 | +@Service | ||
| 19 | +public class PlanLogger { | ||
| 20 | + /** 日志记录器 */ | ||
| 21 | + private static final Logger LOGGER = LoggerFactory.getLogger(PlanLogger.class); | ||
| 22 | + | ||
| 23 | + /** | ||
| 24 | + * 生成排班计划日志。 | ||
| 25 | + * @param startTime 操作开始时间 | ||
| 26 | + * @param endTime 操作结束时间 | ||
| 27 | + */ | ||
| 28 | + public void createLog(Date startTime, Date endTime) { | ||
| 29 | + ModuleOperatorLog moduleOperatorLog = new ModuleOperatorLog(); | ||
| 30 | + moduleOperatorLog.setMessage("排班生成!"); | ||
| 31 | + moduleOperatorLog.setModuleType(ModuleType.SCHEDULE); | ||
| 32 | + moduleOperatorLog.setOperatorType(OperatorType.NEW); | ||
| 33 | + moduleOperatorLog.setModuleOperatorType(ModuleOperatorType.SCHEDULE_NEW); | ||
| 34 | + moduleOperatorLog.setOpStartTime(startTime); | ||
| 35 | + moduleOperatorLog.setOpEndTime(endTime); | ||
| 36 | + moduleOperatorLog.setOpUserName("root"); | ||
| 37 | + moduleOperatorLog.setOpUserCode("root"); | ||
| 38 | + moduleOperatorLog.setOpEntityClass(SchedulePlan.class.getName()); | ||
| 39 | + moduleOperatorLog.setOpBeforeJson("{}"); | ||
| 40 | + moduleOperatorLog.setOpAfterJson("{}"); | ||
| 41 | + | ||
| 42 | + // 如果需要opArg1,opArg2,opArg3,从第2个参数加起,如:LOGGER.info("", {moduleOperatorLog}, {opArg1}, {opArg2}) | ||
| 43 | + LOGGER.info("排班计划生成日志:{}", moduleOperatorLog); | ||
| 44 | + } | ||
| 45 | + | ||
| 46 | + /** | ||
| 47 | + * 修改排班计划明细日志。 | ||
| 48 | + * @param startTime 操作开始时间 | ||
| 49 | + * @param beforeData 修改前数据 | ||
| 50 | + * @param endTime 操作结束时间 | ||
| 51 | + * @param afterData 修改后数据 | ||
| 52 | + */ | ||
| 53 | + public void modifyInfoLog(Date startTime, PlanInfoDto beforeData, Date endTime, PlanInfoDto afterData) { | ||
| 54 | + // TODO: | ||
| 55 | + } | ||
| 56 | +} |
src/main/java/com/bsth/service/schedule/log/TimetableLogger.java
0 → 100644
| 1 | +package com.bsth.service.schedule.log; | ||
| 2 | + | ||
| 3 | +import com.bsth.control_v2.plan_module.common.dto.schedule.timetable.TTInfoDetailDto; | ||
| 4 | +import com.bsth.control_v2.plan_module.common.dto.schedule.timetable.TTInfoDto; | ||
| 5 | +import org.slf4j.Logger; | ||
| 6 | +import org.slf4j.LoggerFactory; | ||
| 7 | +import org.springframework.stereotype.Service; | ||
| 8 | + | ||
| 9 | +import java.util.Date; | ||
| 10 | + | ||
| 11 | +/** | ||
| 12 | + * 时刻表日志。 | ||
| 13 | + */ | ||
| 14 | +@Service | ||
| 15 | +public class TimetableLogger { | ||
| 16 | + /** 日志记录器 */ | ||
| 17 | + private static final Logger LOGGER = LoggerFactory.getLogger(TimetableLogger.class); | ||
| 18 | + | ||
| 19 | + /** | ||
| 20 | + * 生成时刻表模版日志。 | ||
| 21 | + * @param startTime 操作开始时间 | ||
| 22 | + * @param endTime 操作结束时间 | ||
| 23 | + */ | ||
| 24 | + public void createTTLog(Date startTime, Date endTime) { | ||
| 25 | + // TODO: | ||
| 26 | + } | ||
| 27 | + | ||
| 28 | + /** | ||
| 29 | + * 修改时刻表模版日志。 | ||
| 30 | + * @param startTime 操作开始时间 | ||
| 31 | + * @param beforeData 修改前数据 | ||
| 32 | + * @param endTime 操作结束时间 | ||
| 33 | + * @param afterData 修改后数据 | ||
| 34 | + */ | ||
| 35 | + public void modifyTTLog(Date startTime, TTInfoDto beforeData, Date endTime, TTInfoDto afterData) { | ||
| 36 | + // TODO: | ||
| 37 | + } | ||
| 38 | + | ||
| 39 | + /** | ||
| 40 | + * 导入时刻表明细日志。 | ||
| 41 | + * @param startTime 操作开始时间 | ||
| 42 | + * @param endTime 操作结束时间 | ||
| 43 | + */ | ||
| 44 | + public void importTTDLog(Date startTime, Date endTime) { | ||
| 45 | + // TODO:导入前备份一次,导入后备份一次,备份前后的id放入before和after中 | ||
| 46 | + } | ||
| 47 | + | ||
| 48 | + /** | ||
| 49 | + * 修改时刻表明细日志。 | ||
| 50 | + * @param startTime 操作开始时间 | ||
| 51 | + * @param beforeData 修改前数据 | ||
| 52 | + * @param endTime 操作结束时间 | ||
| 53 | + * @param afterData 修改后数据 | ||
| 54 | + */ | ||
| 55 | + public void modifyTTDLog(Date startTime, TTInfoDetailDto beforeData, Date endTime, TTInfoDetailDto afterData) { | ||
| 56 | + // TODO: | ||
| 57 | + } | ||
| 58 | +} |
src/main/resources/application-dev.properties
| @@ -8,9 +8,10 @@ spring.jpa.hibernate.naming_strategy= org.hibernate.cfg.ImprovedNamingStrategy | @@ -8,9 +8,10 @@ spring.jpa.hibernate.naming_strategy= org.hibernate.cfg.ImprovedNamingStrategy | ||
| 8 | spring.jpa.database= MYSQL | 8 | spring.jpa.database= MYSQL |
| 9 | spring.jpa.show-sql= true | 9 | spring.jpa.show-sql= true |
| 10 | spring.datasource.driver-class-name= com.mysql.jdbc.Driver | 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 | spring.datasource.username= root | 13 | spring.datasource.username= root |
| 13 | -spring.datasource.password= | 14 | +spring.datasource.password= root |
| 14 | #spring.datasource.url= jdbc:mysql://192.168.168.117/pd_control?useUnicode=true&characterEncoding=utf-8&useSSL=false | 15 | #spring.datasource.url= jdbc:mysql://192.168.168.117/pd_control?useUnicode=true&characterEncoding=utf-8&useSSL=false |
| 15 | #spring.datasource.username= root | 16 | #spring.datasource.username= root |
| 16 | #spring.datasource.password= root | 17 | #spring.datasource.password= root |
| @@ -31,4 +32,4 @@ http.gps.real.cache.url= http://10.10.150.24:12580/realGps/all | @@ -31,4 +32,4 @@ http.gps.real.cache.url= http://10.10.150.24:12580/realGps/all | ||
| 31 | ## gateway real data | 32 | ## gateway real data |
| 32 | http.gps.real.url= http://114.80.178.12:18080/transport_server/rtgps/ | 33 | http.gps.real.url= http://114.80.178.12:18080/transport_server/rtgps/ |
| 33 | ## gateway send directive | 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 | \ No newline at end of file | 36 | \ No newline at end of file |
src/main/resources/fatso/package.json
| @@ -11,8 +11,8 @@ | @@ -11,8 +11,8 @@ | ||
| 11 | "dependencies": { | 11 | "dependencies": { |
| 12 | "cheerio": "^0.20.0", | 12 | "cheerio": "^0.20.0", |
| 13 | "clean-css": "^4.0.12", | 13 | "clean-css": "^4.0.12", |
| 14 | - "colors": "^1.1.2", | 14 | + "colors": "^1.3.3", |
| 15 | "eventproxy": "^0.3.4", | 15 | "eventproxy": "^0.3.4", |
| 16 | "uglify-js": "^2.6.2" | 16 | "uglify-js": "^2.6.2" |
| 17 | } | 17 | } |
| 18 | -} | ||
| 19 | \ No newline at end of file | 18 | \ No newline at end of file |
| 19 | +} |
src/main/resources/fatso/start.js
| @@ -16,7 +16,7 @@ var platform = process.platform; | @@ -16,7 +16,7 @@ var platform = process.platform; | ||
| 16 | var iswin = platform == 'win32'; | 16 | var iswin = platform == 'win32'; |
| 17 | var sp = platform == 'win32' ? '\\' : '/'; | 17 | var sp = platform == 'win32' ? '\\' : '/'; |
| 18 | //不参与的目录 | 18 | //不参与的目录 |
| 19 | -var excludes = ['scheduleApp', 'trafficManage', 'control', 'permission' + sp + 'authorize_all', 'summary', 'history_sch', 'report' + sp + 'oil', 'base' + sp + 'geo_data_edit', 'base' + sp + 'carpark', 'forms', 'mforms', 'report', 'punctual', 'base' + sp + 'timesmodel'] | 19 | +var excludes = ['scheduleApp', 'trafficManage', 'control', 'permission' + sp + 'authorize_all','permission' + sp + 'user', 'summary', 'history_sch', 'report' + sp + 'oil', 'base' + sp + 'geo_data_edit', 'base' + sp + 'carpark', 'forms', 'mforms', 'report', 'punctual', 'base' + sp + 'timesmodel'] |
| 20 | , ep = new EventProxy() | 20 | , ep = new EventProxy() |
| 21 | , pName = 'bsth_control' | 21 | , pName = 'bsth_control' |
| 22 | , path = process.cwd() | 22 | , path = process.cwd() |
src/main/resources/logback.xml
| @@ -160,6 +160,46 @@ | @@ -160,6 +160,46 @@ | ||
| 160 | </logger> | 160 | </logger> |
| 161 | 161 | ||
| 162 | 162 | ||
| 163 | + <!-- 时刻表,排班计划业务修改日志 --> | ||
| 164 | + <!--<springProfile name="dev">--> | ||
| 165 | + <!--<appender name="MYDB" class="com.bsth.service.schedule.log.ModuleOperatorDbAppender">--> | ||
| 166 | + <!--<connectionSource class="ch.qos.logback.core.db.DataSourceConnectionSource">--> | ||
| 167 | + <!--<dataSource class="org.apache.commons.dbcp.BasicDataSource">--> | ||
| 168 | + <!--<driverClassName>com.mysql.jdbc.Driver</driverClassName>--> | ||
| 169 | + <!--<url>--> | ||
| 170 | + <!--<![CDATA[--> | ||
| 171 | + <!--jdbc:mysql://127.0.0.1/test_control?useUnicode=true&characterEncoding=utf-8&useSSL=false--> | ||
| 172 | + <!--]]>--> | ||
| 173 | + <!--</url>--> | ||
| 174 | + <!--<username>root</username>--> | ||
| 175 | + <!--<password></password>--> | ||
| 176 | + <!--<testOnBorrow>true</testOnBorrow>--> | ||
| 177 | + <!--<validationQuery>--> | ||
| 178 | + <!--<![CDATA[--> | ||
| 179 | + <!--SELECT 1--> | ||
| 180 | + <!--]]>--> | ||
| 181 | + <!--</validationQuery>--> | ||
| 182 | + <!--</dataSource>--> | ||
| 183 | + <!--</connectionSource>--> | ||
| 184 | + <!--</appender>--> | ||
| 185 | + <!--</springProfile>--> | ||
| 186 | + | ||
| 187 | + <!--<appender name="ASYNC_MYDB" class="ch.qos.logback.classic.AsyncAppender">--> | ||
| 188 | + <!--<!– 不丢失日志.默认的,如果队列的80%已满,则会丢弃TRACT、DEBUG、INFO级别的日志 –>--> | ||
| 189 | + <!--<discardingThreshold >0</discardingThreshold>--> | ||
| 190 | + <!--<!– 更改默认的队列的深度,该值会影响性能.默认值为256 –>--> | ||
| 191 | + <!--<queueSize>512</queueSize>--> | ||
| 192 | + <!--<!– 添加附加的appender,最多只能添加一个 –>--> | ||
| 193 | + <!--<appender-ref ref ="MYDB"/>--> | ||
| 194 | + <!--</appender>--> | ||
| 195 | + | ||
| 196 | + <!--<logger name="com.bsth.service.schedule.log.PlanLogger"--> | ||
| 197 | + <!--level="INFO" additivity="false">--> | ||
| 198 | + <!--<appender-ref ref="ASYNC_MYDB" />--> | ||
| 199 | + <!--</logger>--> | ||
| 200 | + | ||
| 201 | + <!-- TODO --> | ||
| 202 | + | ||
| 163 | <!-- gps --> | 203 | <!-- gps --> |
| 164 | <appender name="GPS_COUNT" | 204 | <appender name="GPS_COUNT" |
| 165 | class="ch.qos.logback.core.rolling.RollingFileAppender"> | 205 | class="ch.qos.logback.core.rolling.RollingFileAppender"> |
src/main/resources/rules/kBase3_validate_timetable.drl
| @@ -100,6 +100,7 @@ declare TTInfo_wrap | @@ -100,6 +100,7 @@ declare TTInfo_wrap | ||
| 100 | weekdays: List // 周一到周日是否启用 List<Boolean> | 100 | weekdays: List // 周一到周日是否启用 List<Boolean> |
| 101 | specialDays: List // 特殊节假日 List<DateTime> | 101 | specialDays: List // 特殊节假日 List<DateTime> |
| 102 | updateDate: DateTime // 最新修改时间 | 102 | updateDate: DateTime // 最新修改时间 |
| 103 | + lineVersion : Integer // 线路版本 | ||
| 103 | end | 104 | end |
| 104 | 105 | ||
| 105 | rule "TTInfo_wrap_result" | 106 | rule "TTInfo_wrap_result" |
| @@ -118,6 +119,7 @@ rule "TTInfo_wrap_result" | @@ -118,6 +119,7 @@ rule "TTInfo_wrap_result" | ||
| 118 | ttInfo_wrap.setUpdateDate(new DateTime($ttinfo.getUpdateDate())); | 119 | ttInfo_wrap.setUpdateDate(new DateTime($ttinfo.getUpdateDate())); |
| 119 | ttInfo_wrap.setWeekdays(new ArrayList()); | 120 | ttInfo_wrap.setWeekdays(new ArrayList()); |
| 120 | ttInfo_wrap.setSpecialDays(new ArrayList()); | 121 | ttInfo_wrap.setSpecialDays(new ArrayList()); |
| 122 | + ttInfo_wrap.setLineVersion($ttinfo.getLineVersion()); | ||
| 121 | 123 | ||
| 122 | String[] days = $ttinfo.getRule_days().split(","); | 124 | String[] days = $ttinfo.getRule_days().split(","); |
| 123 | for (int i = 0; i < 7; i++) { | 125 | for (int i = 0; i < 7; i++) { |
| @@ -151,6 +153,7 @@ end | @@ -151,6 +153,7 @@ end | ||
| 151 | 153 | ||
| 152 | declare TTInfoDetails_wrap | 154 | declare TTInfoDetails_wrap |
| 153 | ttInfoId: Long // 时刻表id | 155 | ttInfoId: Long // 时刻表id |
| 156 | + lineVersion: Integer // 线路版本 | ||
| 154 | bcInfoList: List // 班次信息列表 List<TTInfoDetail> | 157 | bcInfoList: List // 班次信息列表 List<TTInfoDetail> |
| 155 | end | 158 | end |
| 156 | 159 | ||
| @@ -165,6 +168,7 @@ rule "Calcu_iter_days_special_day" // 特殊日期匹配 | @@ -165,6 +168,7 @@ rule "Calcu_iter_days_special_day" // 特殊日期匹配 | ||
| 165 | TTInfo_wrap( | 168 | TTInfo_wrap( |
| 166 | $tid: id, | 169 | $tid: id, |
| 167 | $tname: name, | 170 | $tname: name, |
| 171 | + $lineVersion: lineVersion, | ||
| 168 | specialDays contains $calcu_date | 172 | specialDays contains $calcu_date |
| 169 | ) | 173 | ) |
| 170 | then | 174 | then |
| @@ -189,6 +193,7 @@ rule "Calcu_iter_days_special_day" // 特殊日期匹配 | @@ -189,6 +193,7 @@ rule "Calcu_iter_days_special_day" // 特殊日期匹配 | ||
| 189 | 193 | ||
| 190 | TTInfoDetails_wrap ttInfoDetails_wrap = new TTInfoDetails_wrap(); | 194 | TTInfoDetails_wrap ttInfoDetails_wrap = new TTInfoDetails_wrap(); |
| 191 | ttInfoDetails_wrap.setTtInfoId($tid); | 195 | ttInfoDetails_wrap.setTtInfoId($tid); |
| 196 | + ttInfoDetails_wrap.setLineVersion($lineVersion); | ||
| 192 | ttInfoDetails_wrap.setBcInfoList(tTInfoDetailRepository.findByTtinfoId($tid)); | 197 | ttInfoDetails_wrap.setBcInfoList(tTInfoDetailRepository.findByTtinfoId($tid)); |
| 193 | insert(ttInfoDetails_wrap); | 198 | insert(ttInfoDetails_wrap); |
| 194 | } | 199 | } |
| @@ -208,6 +213,7 @@ rule "Calcu_iter_days_normal_day" // 平日匹配 | @@ -208,6 +213,7 @@ rule "Calcu_iter_days_normal_day" // 平日匹配 | ||
| 208 | TTInfo_wrap( | 213 | TTInfo_wrap( |
| 209 | $tid: id, | 214 | $tid: id, |
| 210 | $tname: name, | 215 | $tname: name, |
| 216 | + $lineVersion: lineVersion, | ||
| 211 | specialDays not contains $calcu_date, | 217 | specialDays not contains $calcu_date, |
| 212 | weekdays[$calcu_weekday - 1] == Boolean.TRUE | 218 | weekdays[$calcu_weekday - 1] == Boolean.TRUE |
| 213 | ) | 219 | ) |
| @@ -234,6 +240,7 @@ rule "Calcu_iter_days_normal_day" // 平日匹配 | @@ -234,6 +240,7 @@ rule "Calcu_iter_days_normal_day" // 平日匹配 | ||
| 234 | 240 | ||
| 235 | TTInfoDetails_wrap ttInfoDetails_wrap = new TTInfoDetails_wrap(); | 241 | TTInfoDetails_wrap ttInfoDetails_wrap = new TTInfoDetails_wrap(); |
| 236 | ttInfoDetails_wrap.setTtInfoId($tid); | 242 | ttInfoDetails_wrap.setTtInfoId($tid); |
| 243 | + ttInfoDetails_wrap.setLineVersion($lineVersion); | ||
| 237 | ttInfoDetails_wrap.setBcInfoList(tTInfoDetailRepository.findByTtinfoId($tid)); | 244 | ttInfoDetails_wrap.setBcInfoList(tTInfoDetailRepository.findByTtinfoId($tid)); |
| 238 | insert(ttInfoDetails_wrap); | 245 | insert(ttInfoDetails_wrap); |
| 239 | } | 246 | } |
| @@ -253,6 +260,7 @@ rule "Calcu_iter_days_other_day" // 都没有的情况下,匹配 | @@ -253,6 +260,7 @@ rule "Calcu_iter_days_other_day" // 都没有的情况下,匹配 | ||
| 253 | TTInfo_wrap( | 260 | TTInfo_wrap( |
| 254 | $tid: id, | 261 | $tid: id, |
| 255 | $tname: name, | 262 | $tname: name, |
| 263 | + $lineVersion: lineVersion, | ||
| 256 | specialDays not contains $calcu_date, | 264 | specialDays not contains $calcu_date, |
| 257 | weekdays[$calcu_weekday - 1] == false | 265 | weekdays[$calcu_weekday - 1] == false |
| 258 | ) | 266 | ) |
| @@ -278,6 +286,7 @@ rule "Calcu_iter_days_other_day" // 都没有的情况下,匹配 | @@ -278,6 +286,7 @@ rule "Calcu_iter_days_other_day" // 都没有的情况下,匹配 | ||
| 278 | 286 | ||
| 279 | TTInfoDetails_wrap ttInfoDetails_wrap = new TTInfoDetails_wrap(); | 287 | TTInfoDetails_wrap ttInfoDetails_wrap = new TTInfoDetails_wrap(); |
| 280 | ttInfoDetails_wrap.setTtInfoId($tid); | 288 | ttInfoDetails_wrap.setTtInfoId($tid); |
| 289 | + ttInfoDetails_wrap.setLineVersion($lineVersion); | ||
| 281 | Map<String, Object> param = new HashMap<String, Object>(); | 290 | Map<String, Object> param = new HashMap<String, Object>(); |
| 282 | ttInfoDetails_wrap.setBcInfoList(tTInfoDetailRepository.findByTtinfoId($tid)); | 291 | ttInfoDetails_wrap.setBcInfoList(tTInfoDetailRepository.findByTtinfoId($tid)); |
| 283 | insert(ttInfoDetails_wrap); | 292 | insert(ttInfoDetails_wrap); |
| @@ -308,7 +317,7 @@ rule "statinfo_result" // 统计计算结果 | @@ -308,7 +317,7 @@ rule "statinfo_result" // 统计计算结果 | ||
| 308 | $statInfo.setYybc($yybc); | 317 | $statInfo.setYybc($yybc); |
| 309 | $statInfo.setErrorbc($errorbc); | 318 | $statInfo.setErrorbc($errorbc); |
| 310 | 319 | ||
| 311 | - int lineVersion = ((TTInfoDetail) $ttInfoDetails_wrap.getBcInfoList().get(0)).getLineVersion(); | 320 | + int lineVersion = $ttInfoDetails_wrap.getLineVersion(); |
| 312 | $statInfo.setLineVersion(lineVersion); | 321 | $statInfo.setLineVersion(lineVersion); |
| 313 | 322 | ||
| 314 | rs.getInfos().add($statInfo); | 323 | rs.getInfos().add($statInfo); |
src/main/resources/static/pages/base/timesmodel/js/add-form-reload.js
| @@ -3,7 +3,7 @@ | @@ -3,7 +3,7 @@ | ||
| 3 | if (!$('body').hasClass('page-sidebar-closed')) { | 3 | if (!$('body').hasClass('page-sidebar-closed')) { |
| 4 | $('.menu-toggler.sidebar-toggler').click(); | 4 | $('.menu-toggler.sidebar-toggler').click(); |
| 5 | } | 5 | } |
| 6 | - | 6 | + |
| 7 | $('.openHaveSkb').on('click',function() { | 7 | $('.openHaveSkb').on('click',function() { |
| 8 | var skbId = $("#skbNameSelect").val(); | 8 | var skbId = $("#skbNameSelect").val(); |
| 9 | var argus = { | 9 | var argus = { |
src/main/resources/static/pages/base/timesmodel/js/gantt.js
| @@ -66,6 +66,8 @@ | @@ -66,6 +66,8 @@ | ||
| 66 | CSMap = getMaxCarAndStopSpace0(map,seMap); | 66 | CSMap = getMaxCarAndStopSpace0(map,seMap); |
| 67 | // 发车间隙 | 67 | // 发车间隙 |
| 68 | map.fcjx = CSMap.fcjx; | 68 | map.fcjx = CSMap.fcjx; |
| 69 | + map.stt = "1"; | ||
| 70 | + _paramObj = Main_v2.getFactory().createParameterObj(map, dataMap); | ||
| 69 | }else if(map.baseRes== '1') { | 71 | }else if(map.baseRes== '1') { |
| 70 | CSMap = getMaxCarAndStopSpace1(map); | 72 | CSMap = getMaxCarAndStopSpace1(map); |
| 71 | // 发车间隙 | 73 | // 发车间隙 |
| @@ -77,6 +79,7 @@ | @@ -77,6 +79,7 @@ | ||
| 77 | CSMap = getMaxCarAndStopSpace1(map); | 79 | CSMap = getMaxCarAndStopSpace1(map); |
| 78 | } else if (map.baseRes == '3') { // 主站停站使用v2_2版本 | 80 | } else if (map.baseRes == '3') { // 主站停站使用v2_2版本 |
| 79 | _paramObj = Main_v2.getFactory().createParameterObj(map, dataMap); // TODO:暂时使用v2_1版本的方法,通用的,后续再放到v2_2版本中 | 81 | _paramObj = Main_v2.getFactory().createParameterObj(map, dataMap); // TODO:暂时使用v2_1版本的方法,通用的,后续再放到v2_2版本中 |
| 82 | + console.log(_paramObj); | ||
| 80 | map.clzs = InternalScheduleObj_v2_2.calcuClzx(_paramObj); | 83 | map.clzs = InternalScheduleObj_v2_2.calcuClzx(_paramObj); |
| 81 | CSMap = getMaxCarAndStopSpace1(map); | 84 | CSMap = getMaxCarAndStopSpace1(map); |
| 82 | } | 85 | } |
| @@ -143,7 +146,7 @@ | @@ -143,7 +146,7 @@ | ||
| 143 | // // 初始化右键菜单. | 146 | // // 初始化右键菜单. |
| 144 | // contextInit(graph); | 147 | // contextInit(graph); |
| 145 | 148 | ||
| 146 | - if (map.baseRes == '3' || map.baseRes == '1') { | 149 | + if (map.baseRes == '3' || map.baseRes == '1' || map.baseRes == '0') { |
| 147 | // 导入导出设置 | 150 | // 导入导出设置 |
| 148 | // Main_v2_2.exportExcelConfig($_GlobalGraph.getDataArray); | 151 | // Main_v2_2.exportExcelConfig($_GlobalGraph.getDataArray); |
| 149 | 152 | ||
| @@ -186,7 +189,7 @@ | @@ -186,7 +189,7 @@ | ||
| 186 | return _rtnBcArray; | 189 | return _rtnBcArray; |
| 187 | }; | 190 | }; |
| 188 | 191 | ||
| 189 | - // Main_v2_2.exportExcelConfig(_dfun); | 192 | + Main_v2_2.exportExcelConfig(_paramObj, _dfun); |
| 190 | } | 193 | } |
| 191 | 194 | ||
| 192 | // 关闭弹出层 | 195 | // 关闭弹出层 |
src/main/resources/static/pages/base/timesmodel/js/v2_2/Main_v2_2_ExcelObj.js
| @@ -581,10 +581,10 @@ var Main_v2_2_ExcelObj = (function() { | @@ -581,10 +581,10 @@ var Main_v2_2_ExcelObj = (function() { | ||
| 581 | "zdzid": oGanttBc.zdz, // 终点站id | 581 | "zdzid": oGanttBc.zdz, // 终点站id |
| 582 | 582 | ||
| 583 | "isUp": bIsUp, // 是否上行 | 583 | "isUp": bIsUp, // 是否上行 |
| 584 | - "isFb": null, // 是否分班(_resetBdOutInLcBcGroup方法修正) | 584 | + "isFb": false, // 是否分班(_resetBdOutInLcBcGroup方法修正) |
| 585 | 585 | ||
| 586 | "bcType": oGanttBc.bcType, // 班次类型(bc、out、in、lc) | 586 | "bcType": oGanttBc.bcType, // 班次类型(bc、out、in、lc) |
| 587 | - "fcsj": oGanttBc.fcsj, // 发车时间描述 | 587 | + "fcsj": (oGanttBc.fcsj == null ? "" : oGanttBc.fcsj), // 发车时间描述 |
| 588 | 588 | ||
| 589 | "groupNo": -99, // 第几圈(_resetBdOutInLcBcGroup方法修正) | 589 | "groupNo": -99, // 第几圈(_resetBdOutInLcBcGroup方法修正) |
| 590 | "groupBcNo": -99, // 圈里第几个班次(_resetBdOutInLcBcGroup方法修正) | 590 | "groupBcNo": -99, // 圈里第几个班次(_resetBdOutInLcBcGroup方法修正) |
src/main/resources/static/pages/base/timesmodel/js/v2_2/main_v2_2.js
| @@ -43,7 +43,7 @@ var Main_v2_2 = function() { | @@ -43,7 +43,7 @@ var Main_v2_2 = function() { | ||
| 43 | schedule.fnAdjustHeadway(); | 43 | schedule.fnAdjustHeadway(); |
| 44 | // 4、计算吃饭班次 | 44 | // 4、计算吃饭班次 |
| 45 | schedule.fnCalcuEatBc(); | 45 | schedule.fnCalcuEatBc(); |
| 46 | - // // 6、计算末班车 | 46 | + // // 6、计算末班车(TODO:这里家里末班车,貌似导出Excel会报错,待修正) |
| 47 | // schedule.fnCalcuLastBc(); | 47 | // schedule.fnCalcuLastBc(); |
| 48 | // 7、重新设置停站时间 | 48 | // 7、重新设置停站时间 |
| 49 | schedule.fnReSetLayoverTime(); | 49 | schedule.fnReSetLayoverTime(); |
| @@ -64,8 +64,8 @@ var Main_v2_2 = function() { | @@ -64,8 +64,8 @@ var Main_v2_2 = function() { | ||
| 64 | * 导出时刻表配置。 | 64 | * 导出时刻表配置。 |
| 65 | * @param fnGetGanttBc 获取gantt班次方法 | 65 | * @param fnGetGanttBc 获取gantt班次方法 |
| 66 | */ | 66 | */ |
| 67 | - exportExcelConfig: function(fnGetGanttBc) { | ||
| 68 | - var oExcel = new Main_v2_2_ExcelObj(_paramObj, fnGetGanttBc); | 67 | + exportExcelConfig: function(paramobj, fnGetGanttBc) { |
| 68 | + var oExcel = new Main_v2_2_ExcelObj(paramobj, fnGetGanttBc); | ||
| 69 | 69 | ||
| 70 | $('.exportAddXls').off('click'); | 70 | $('.exportAddXls').off('click'); |
| 71 | $('.exportAddXlsx').off('click'); | 71 | $('.exportAddXlsx').off('click'); |