Commit 26d356d2863ef7972c4469e5012986f9629f3fc6
线调更新
Showing
36 changed files
with
2445 additions
and
1483 deletions
Too many changes to show.
To preserve performance only 36 of 109 files are displayed.
README.md
| 1 | -公交调度系统BS版 0.1 | ||
| 2 | -====== | ||
| 3 | ----------- | ||
| 4 | -## 目录 | ||
| 5 | ---------- | ||
| 6 | - * [字典表](#字典表) | ||
| 7 | - * [动态jpa查询实现](#动态jpa查询实现) | ||
| 8 | - * [车载 gps 相关数据](#gps) | ||
| 9 | - * [实时gps数据接口 http](#实时gps接口) | ||
| 10 | - * [进出站数据表结构](#进站数据) | ||
| 11 | - * [异常警报表结构](#异常警报) | ||
| 12 | - * [大间隔](#大间隔) | ||
| 13 | - * [超速](#超速) | ||
| 14 | - * [越界](#越界) | ||
| 15 | - * [越站](#越站) | ||
| 16 | - * [聚集](#聚集) | ||
| 17 | - * [掉线](#掉线) | ||
| 18 | - * [调度消息下发接口HTTP](#调度消息下发接口) | ||
| 19 | - * [调度消息上传接口HTTP](#调度消息上传接口) | ||
| 20 | - * [车辆历史GPS数据](#车辆历史GPS) | ||
| 21 | - | ||
| 22 | ----------- | ||
| 23 | - | ||
| 24 | -## 字典表 | ||
| 25 | ----------- | ||
| 26 | -字典操作全部由前端负责,主要有2种。 | ||
| 27 | - | ||
| 28 | -1、转换字典代码。 | ||
| 29 | - 当pjax的`pjax:success`事件被触发(片段加载完成) | ||
| 30 | - 扫描容器内所有有 `$(".nt-dictionary")` 元素进行字典转换 | ||
| 31 | -``` html | ||
| 32 | ---dom标签为span div p h1 h2 h3 h4 h5 h6 等等文本元素时,如下写法,text为要转换的代码 | ||
| 33 | -<span class="nt-dictionary" data-group="ScheduleType">out</span> | ||
| 34 | ---to | ||
| 35 | -<span>出场</span> | ||
| 36 | - | ||
| 37 | -<!- dom标签为input时,如下 data-code为要转换的代码 --> | ||
| 38 | -<input class="nt-dictionary" data-group="ScheduleType" data-code="out"> | ||
| 39 | ---to | ||
| 40 | -<input value="出场"> | ||
| 41 | - | ||
| 42 | -<!- dom标签为select时 如下 data-code为要选中的项 --> | ||
| 43 | -<select class="nt-dictionary" data-group="ScheduleType" data-code="out"></select> | ||
| 44 | ---to | ||
| 45 | -<select> | ||
| 46 | - <option value="normal">正常班次</option> | ||
| 47 | - <option value="out" selected>出场</option> | ||
| 48 | - <option value="in">进场</option> | ||
| 49 | - <option value="oil">加油</option> | ||
| 50 | - <option value="temp">临加</option> | ||
| 51 | - <option value="region">区间</option> | ||
| 52 | - <option value="venting">放空</option> | ||
| 53 | - <option value="major">放大站</option> | ||
| 54 | -</select> | ||
| 55 | -``` | ||
| 56 | -*原标签的class 除nt-dictionary 外,其余均会被保留* | ||
| 57 | - | ||
| 58 | -2、dictionary.js提供如下方法自行使用 | ||
| 59 | -| 方法名 | 参数|返回| | ||
| 60 | -| ---- | ---- | ---- | ---- | | ||
| 61 | -| groups (获取所有字典组) | 无| | {LineTrend: 线路走向, ScheduleType: 班次类型} | | ||
| 62 | -| getByGroup (获取字典组下的字典)| (group) |{0: 上行, 1: 下行}| | ||
| 63 | -| transformCode (转换字典代码)| (group, code) | 上行 | | ||
| 64 | - | ||
| 65 | -## 动态jpa查询实现 | ||
| 66 | ----------- | ||
| 67 | -*参考调度系统枚举com.bsth.entity.search.SearchOperator* | ||
| 68 | - | ||
| 69 | - | ||
| 70 | -## gps | ||
| 71 | ----------- | ||
| 72 | -### 实时gps接口 | ||
| 73 | - | ||
| 74 | -所有在线GPS: [http://192.168.168.192:8080/transport_server/rtgps](http://192.168.168.192:8080/transport_server/rtgps/) | ||
| 75 | -根据设备号查询:[http://192.168.168.192:8080/transport_server/rtgps/05B01901](http://192.168.168.192:8080/transport_server/rtgps/05B01901) | ||
| 76 | - | ||
| 77 | -<span style="color: red">Response</span>: | ||
| 78 | -```json | ||
| 79 | -{ | ||
| 80 | - "data":[ | ||
| 81 | - { | ||
| 82 | - "companyCode":5, | ||
| 83 | - "lineId":10329, | ||
| 84 | - "deviceId":"05B01901", | ||
| 85 | - "carparkNo":"00000000", | ||
| 86 | - "stopNo":"7C890002", | ||
| 87 | - "lon":121.549866, | ||
| 88 | - "lat":31.238798, | ||
| 89 | - "timestamp":1397104499000, | ||
| 90 | - "speed":42.0, | ||
| 91 | - "direction":245.9, | ||
| 92 | - "state":0, | ||
| 93 | - "upDown":0 | ||
| 94 | - }] | ||
| 95 | -} | ||
| 96 | -``` | ||
| 97 | - | ||
| 98 | -| -- | --|--| | ||
| 99 | -| ---- | ---- | ---- | | ||
| 100 | -| companyCode | int | 公司代码 | | ||
| 101 | -| lineId | int | 线路编码 | | ||
| 102 | -| deviceId | String | 设备编号 | | ||
| 103 | -| carparkNo | String | 停车场编码 | | ||
| 104 | -| stopNo | String | 站点编码 | | ||
| 105 | -| lon | float | 经度 | | ||
| 106 | -| lat | float | 纬度 | | ||
| 107 | -| timestamp | long | 时间戳 | | ||
| 108 | -| speed | float | 速度| | ||
| 109 | -| direction | float | 方向(角度) | | ||
| 110 | -| state | int | 营运状态( 0 营运 ,1 非营运, -1 无效) | | ||
| 111 | -| upDown | int | 上下行(0 上行 , 1 下行 , -1 无效)| | ||
| 112 | - | ||
| 113 | - | ||
| 114 | -### 进站数据 | ||
| 115 | ----------- | ||
| 116 | -表名: | ||
| 117 | - | ||
| 118 | -| .. | .. | .. | | ||
| 119 | -| ---- | ---- | ---- | | ||
| 120 | -| id | int | 主键 | | ||
| 121 | -| deviceId | String | 设备号 | | ||
| 122 | -| lineId | int | 线路编码 | | ||
| 123 | -| stopNo | long | 站点编码 | | ||
| 124 | -| timestamp | long | 时间戳 | | ||
| 125 | -| upDown | int | 上下行(0 上行 , 1 下行 , -1 无效) | | ||
| 126 | -| createDate | Date | 创建时间 | | ||
| 127 | - | ||
| 128 | - | ||
| 129 | -### 异常警报 | ||
| 130 | ----------- | ||
| 131 | - | ||
| 132 | -### 大间隔 | ||
| 133 | ----------- | ||
| 134 | -表名: | ||
| 135 | - | ||
| 136 | -| .. | .. | .. | | ||
| 137 | -| ---- | ---- | ---- | | ||
| 138 | -| id | int | 主键 | | ||
| 139 | -| line | int | 线路编码 | | ||
| 140 | -| station | String | 站点编码 | | ||
| 141 | -| cVehicle | String | 当前车辆编码 | | ||
| 142 | -| lastVehicle | String | 上一个车辆编码 | | ||
| 143 | -| interval | long | 间隔时间(秒) | | ||
| 144 | -| timestamp | long | 时间戳 | | ||
| 145 | -| createDate | Date | 创建时间 | | ||
| 146 | - | ||
| 147 | -### 超速 | ||
| 148 | ----------- | ||
| 149 | -表名: | ||
| 150 | - | ||
| 151 | -| .. | .. | .. | | ||
| 152 | -| ---- | ---- | ---- | | ||
| 153 | -| id | int | 主键 | | ||
| 154 | -| vehicle | String | 车辆编码 | | ||
| 155 | -| line | int | 线路编码 | | ||
| 156 | -| upDown | int | 上下行(0 上行 , 1 下行 , -1 无效) | | ||
| 157 | -| lon | float | 经度 | | ||
| 158 | -| lat | float | 纬度| | ||
| 159 | -| speed | float | 速度 | | ||
| 160 | -| timestamp | long | 时间戳 | | ||
| 161 | -| createDate | Date | 时间 | | ||
| 162 | - | ||
| 163 | -### 越界 | ||
| 164 | ----------- | ||
| 165 | -表名: | ||
| 166 | - | ||
| 167 | -| .. | .. | .. | | ||
| 168 | -| ---- | ---- | ---- | | ||
| 169 | -| id | int | 主键 | | ||
| 170 | -| vehicle | String | 车辆编码 | | ||
| 171 | -| line | int | 线路编码 | | ||
| 172 | -| upDown | int | 上下行(0 上行 , 1 下行 , -1 无效) | | ||
| 173 | -| lon | float | 经度 | | ||
| 174 | -| lat | float | 纬度| | ||
| 175 | -| location | String | 越界位置(由线调页面进行初始转换)意思是该字段默认为空,页面第一次查看时会写入值| | ||
| 176 | -| timestamp | long | 时间戳 | | ||
| 177 | -| createDate | Date | 时间 | | ||
| 178 | - | ||
| 179 | - | ||
| 180 | -### 越站 | ||
| 181 | ----------- | ||
| 182 | -表名: | ||
| 183 | - | ||
| 184 | -| .. | .. | .. | | ||
| 185 | -| ---- | ---- | ---- | | ||
| 186 | -| id | int | 主键 | | ||
| 187 | -| line | int | 线路编码 | | ||
| 188 | -| upDown | int | 上下行(0 上行 , 1 下行 , -1 无效) | | ||
| 189 | -| station | String | 站点编码 | | ||
| 190 | -| vehicle | String | 车辆编码 | | ||
| 191 | -| inData | Date | 进站时间 | | ||
| 192 | -| outDate | Date | 出站时间 | | ||
| 193 | - | ||
| 194 | - | ||
| 195 | -### 聚集 | ||
| 196 | ----------- | ||
| 197 | -表名: | ||
| 198 | - | ||
| 199 | -| .. | .. | .. | | ||
| 200 | -| ---- | ---- | ---- | | ||
| 201 | -| id | int | 主键 | | ||
| 202 | -| line | int | 线路编码 | | ||
| 203 | -| upDown | int | 上下行(0 上行 , 1 下行 , -1 无效) | | ||
| 204 | -| stations | String | 站点(多个用 , 号分隔。应该是连续站点) | | ||
| 205 | -| vehicles | String | 车辆编码(多个用 , 号分隔) | | ||
| 206 | -| timestamp | long | 时间戳 | | ||
| 207 | -| createDate | Date | 时间 | | ||
| 208 | - | ||
| 209 | - | ||
| 210 | -### 掉线 | ||
| 211 | ----------- | ||
| 212 | -表名: | ||
| 213 | - | ||
| 214 | -| .. | .. | .. | | ||
| 215 | -| ---- | ---- | ---- | | ||
| 216 | -| id | int | 主键 | | ||
| 217 | -| line | int | 线路编码 | | ||
| 218 | -| upDown | int | 上下行(0 上行 , 1 下行 , -1 无效) | | ||
| 219 | -| vehicle | String | 车辆编码 | | ||
| 220 | -| lon | float | 经度 | | ||
| 221 | -| lat | float | 纬度| | ||
| 222 | -| timestamp | long | 时间戳 | | ||
| 223 | -| createDate | Date | 时间 | | ||
| 224 | - | ||
| 225 | - | ||
| 226 | -### 调度消息下发接口 | ||
| 227 | ----------- | ||
| 228 | -[http://192.168.168.192:8080/transport_server/message](http://192.168.168.192:8080/transport_server/message/) | ||
| 229 | - | ||
| 230 | -<span style="color: red">Request</span>: | ||
| 231 | -```json | ||
| 232 | -{ | ||
| 233 | - "deviceId":12345, | ||
| 234 | - "timestamp":44324, | ||
| 235 | - "operCode":0x60, | ||
| 236 | - "data":{ | ||
| 237 | - "companyCode":22, | ||
| 238 | - "deviceId":"029L2222", | ||
| 239 | - "timestamp":134326, | ||
| 240 | - "instructType":00, | ||
| 241 | - "dispatchInstruct":0x00, | ||
| 242 | - "msgId":12345, | ||
| 243 | - "alarmTime":201606012000, | ||
| 244 | - "serviceState":00000000, | ||
| 245 | - "txtContent":"你好" | ||
| 246 | - } | ||
| 247 | -} | ||
| 248 | -``` | ||
| 249 | -| .. | .. | .. | | ||
| 250 | -| ---- | ---- | ---- | | ||
| 251 | -| deviceId | string | 设备编号 | | ||
| 252 | -| timestamp | long | 时间戳(ms) | | ||
| 253 | -| operCode | short | 一级协议 | | ||
| 254 | -| data.companyCode | short | 公司代码 | | ||
| 255 | -| data.deviceId | string | 设备编号 | | ||
| 256 | -| data.timestamp | long | 时间戳 | | ||
| 257 | -| data.instructType | short | 保留 默认0 | | ||
| 258 | -| data.dispatchInstruct | short | 调度指令 调度指令。0X00表示信息短语,0X01表示取消上次指令+调度指令(闹钟有效),0x02表示为调度指令(闹钟有效); 0x03表示运营状态指令(闹钟无效);0x04表示其他指令。| | ||
| 259 | -| data.msgId | long | 同上 | | ||
| 260 | -| data.alarmTime | long | 闹钟 MMddhhmm| | ||
| 261 | -| data.serviceState | long | 多状态字节 先由车载发起车辆故障、事故报告、扣证、纠纷、加油等审请,经调度确认后,下发调度指令与运营状态。当调度指令为0X00终端需要提示信息。当调度指令为0x01和0x02,终端需要收到后提示信息。并且必须在闹钟结束后进行终端相关状态更新。在闹钟时间前120秒开始提示。当调度指令为0x03,收到后进行终端相关状态更新,终端不需要提示信息。当调度指令为0x04,暂不需要提示信息。| | ||
| 262 | -| data.txtContent | string | 下发的消息文本 | | ||
| 263 | -```json | ||
| 264 | -{ | ||
| 265 | - "deviceId":12345, | ||
| 266 | - "timestamp":44324, | ||
| 267 | - "operCode":0x64, | ||
| 268 | - "data":{ | ||
| 269 | - "cityCode":22, | ||
| 270 | - "deviceId":"029L2222", | ||
| 271 | - "lineId":"134326" | ||
| 272 | - } | ||
| 273 | -} | ||
| 274 | -``` | ||
| 275 | -| .. | .. | .. | | ||
| 276 | -| ---- | ---- | ---- | | ||
| 277 | -| deviceId | string | 设备编号 | | ||
| 278 | -| timestamp | long | 时间戳(ms) | | ||
| 279 | -| operCode | short | 一级协议 | | ||
| 280 | -| data.cityCode | short | 城市区号 | | ||
| 281 | -| data.deviceId | string | 设备编号 | | ||
| 282 | -| data.lineId | string | 线路编号 6位 不足6位前面补0 如编号890 用000890表示 | | ||
| 283 | - | ||
| 284 | -```json | ||
| 285 | -{ | ||
| 286 | - "deviceId":12345, | ||
| 287 | - "timestamp":44324, | ||
| 288 | - "operCode":0xC0, | ||
| 289 | - "data":{ | ||
| 290 | - "operCode":0x86, | ||
| 291 | - "requestAck":0x06 | ||
| 292 | - } | ||
| 293 | -} | ||
| 294 | -``` | ||
| 295 | -| .. | .. | .. | | ||
| 296 | -| ---- | ---- | ---- | | ||
| 297 | -| deviceId | string | 设备编号 | | ||
| 298 | -| timestamp | long | 时间戳(ms) | | ||
| 299 | -| operCode | short | 一级协议 | | ||
| 300 | -| data.operCode | short | 二级协议 | | ||
| 301 | -| data.requestAck | short | 请求应答字 0x06同意 0x15不同意| | ||
| 302 | - | ||
| 303 | -```json | ||
| 304 | -{ | ||
| 305 | - "deviceId":12345, | ||
| 306 | - "timestamp":44324, | ||
| 307 | - "operCode":0xC0, | ||
| 308 | - "data":{ | ||
| 309 | - "operCode":0xa3, | ||
| 310 | - "deviceId":12345, | ||
| 311 | - "ipAddress":222.66.0.204, | ||
| 312 | - "port":8899, | ||
| 313 | - "reportMode":0, | ||
| 314 | - "interval":0, | ||
| 315 | - "distance":0, | ||
| 316 | - "speedingThreshold":0, | ||
| 317 | - "alarmThreshold":0, | ||
| 318 | - "posIpAddress":0, | ||
| 319 | - "posPort":0, | ||
| 320 | - "delay":0, | ||
| 321 | - "speedThreshold1":0, | ||
| 322 | - "speedThreshold2":0, | ||
| 323 | - "contrast":0, | ||
| 324 | - "brightness":0, | ||
| 325 | - "saturation":0 | ||
| 326 | - } | ||
| 327 | -} | ||
| 328 | -``` | ||
| 329 | -| .. | .. | .. | | ||
| 330 | -| ---- | ---- | ---- | | ||
| 331 | -| deviceId | string | 设备编号 | | ||
| 332 | -| timestamp | long | 时间戳(ms) | | ||
| 333 | -| operCode | short | 一级协议 | | ||
| 334 | -| data.operCode | short | 二级协议 | | ||
| 335 | -| data.deviceId | string | 设备编号| | ||
| 336 | -| data.ipAddress | string | 网关IP地址| | ||
| 337 | -| data.port | string | 网关端口| | ||
| 338 | -| data.reportMode | short | 定时定距上报模式| | ||
| 339 | -| data.interval | int | 定时上报时间间隔| | ||
| 340 | -| data.distance | string | 定距上报距离间隔| | ||
| 341 | -| data.speedingThreshold | short | 非线路状态超速阀门| | ||
| 342 | -| data.alarmThreshold | short | 预警阀门| | ||
| 343 | -| data.posIpAddress | string | pos机IP地址| | ||
| 344 | -| data.posPort | string | pos机端口| | ||
| 345 | -| data.delay | int | 延迟机关时间| | ||
| 346 | -| data.deviceId | short | 中门视频切换到码表界面速度阀门 默认45| | ||
| 347 | -| data.deviceId | short | 码表界面切换到中门视频速度阀门 默认35| | ||
| 348 | -| data.deviceId | short | 对比度| | ||
| 349 | -| data.deviceId | short | 亮度| | ||
| 350 | -| data.deviceId | short | 饱和度| | ||
| 351 | - | ||
| 352 | -```json | ||
| 353 | -{ | ||
| 354 | - "deviceId":12345, | ||
| 355 | - "timestamp":44324, | ||
| 356 | - "operCode":0xC0, | ||
| 357 | - "data":{ | ||
| 358 | - "operCode":0xa4 | ||
| 359 | - } | ||
| 360 | -} | ||
| 361 | -``` | ||
| 362 | -| .. | .. | .. | | ||
| 363 | -| ---- | ---- | ---- | | ||
| 364 | -| deviceId | string | 设备编号 | | ||
| 365 | -| timestamp | long | 时间戳(ms) | | ||
| 366 | -| operCode | short | 一级协议 | | ||
| 367 | -| data.operCode | short | 二级协议 | | ||
| 368 | - | ||
| 369 | -```json | ||
| 370 | -{ | ||
| 371 | - "deviceId":12345, | ||
| 372 | - "timestamp":44324, | ||
| 373 | - "operCode":0xC0, | ||
| 374 | - "data":{ | ||
| 375 | - "operCode":0xa5 | ||
| 376 | - "programVersion":2 | ||
| 377 | - } | ||
| 378 | -} | ||
| 379 | -``` | ||
| 380 | -| .. | .. | .. | | ||
| 381 | -| ---- | ---- | ---- | | ||
| 382 | -| deviceId | string | 设备编号 | | ||
| 383 | -| timestamp | long | 时间戳(ms) | | ||
| 384 | -| operCode | short | 一级协议 | | ||
| 385 | -| data.operCode | short | 二级协议 | | ||
| 386 | -| data.programVersion | short | 程序版本 | | ||
| 387 | - | ||
| 388 | -<span style="color: red">Response</span>: | ||
| 389 | -```json | ||
| 390 | -{ | ||
| 391 | - "errCode":0 | ||
| 392 | -} | ||
| 393 | -``` | ||
| 394 | - | ||
| 395 | -### 调度消息上传接口 | ||
| 396 | ----------- | ||
| 397 | -上行POST地址:[http://192.168.168.120:9088/control/upstream](http://192.168.168.120:9088/control/upstream) | ||
| 398 | -<span style="color: red">Request</span>: | ||
| 399 | -```json | ||
| 400 | -{ | ||
| 401 | - "deviceId":12345, | ||
| 402 | - "timestamp":44324, | ||
| 403 | - "status":0, | ||
| 404 | - "operCode":0x80, | ||
| 405 | - "data":{ | ||
| 406 | - "operCode":0x26, | ||
| 407 | - "requestCode":22 | ||
| 408 | - } | ||
| 409 | -} | ||
| 410 | -``` | ||
| 411 | -| .. | .. | .. | | ||
| 412 | -| ---- | ---- | ---- | | ||
| 413 | -| deviceId | string | 设备编号 | | ||
| 414 | -| timestamp | long | 时间戳(ms) | | ||
| 415 | -| status | int | 0x80时无数据 0表示失败 1表示成功或设备确认 2表示驾驶员阅读 | | ||
| 416 | -| operCode | short | 一级协议 消息确认将无数据 | | ||
| 417 | -| data.operCode | short | 二级协议 | | ||
| 418 | -| data.requestCode | short | 请求代码0xa1 恢复运营 0xa2 申请调档 0xa3 出场请求 0xa5 进场请求 0xa7 加油请求 0x50 车辆故障 0x70 路阻报告 0x60 事故报告 0x11 扣证纠纷 0x12 报警 | | ||
| 419 | -<span style="color: red">Response</span>: | ||
| 420 | -```json | ||
| 421 | -{ | ||
| 422 | - "errCode":0 | ||
| 423 | -} | ||
| 424 | -``` | ||
| 425 | - | ||
| 426 | -### 车辆历史GPS | ||
| 427 | ----------- | ||
| 428 | -表名:BSTH_C_GPS_INFO | ||
| 429 | - | ||
| 430 | -| .. | .. | .. | | ||
| 431 | -| ---- | ---- | ---- | | ||
| 432 | -| cityCode | int | 城市代码 | | ||
| 433 | -| industryCode | int | 行业代码 | | ||
| 434 | -| companyCode | int | 企业代码 | | ||
| 435 | -| lineId | int | 线路编号 | | ||
| 436 | -| deviceId | string | 设备编号 | | ||
| 437 | -| driverNo | int | 驾驶员工号 | | ||
| 438 | -| carparkSerialNo | int | 停车场序列号 | | ||
| 439 | -| carparkNo | string | 停车场编号 | | ||
| 440 | -| stopSerialNo | int | 站点序列号 | | ||
| 441 | -| stopNo | string | 停车场编号 | | ||
| 442 | -| lon | float | 经度 | | ||
| 443 | -| lat | float | 维度 | | ||
| 444 | -| ts | long | 时间戳 | | ||
| 445 | -| speedSensor | float | 发动机速度 | | ||
| 446 | -| speedGps | float | gps速度 | | ||
| 447 | -| direction | float | 角度0-359 | | ||
| 448 | -| inTemp | int | 车内温度 | | ||
| 449 | -| serviceState | long | 设备状态字 | | ||
| 450 | -<<<<<<< HEAD | ||
| 451 | -| daysYear | int | 对应年中的天数 为分区字段 查询一定要用此字段过滤 | | ||
| 452 | -======= | ||
| 453 | -| daysYear | int | 对应年中的天数 为分区字段 查询一定要用此字段过滤 | | ||
| 454 | - | ||
| 455 | ->>>>>>> af8ec3bedc8644f5813e9adab12a163e93cc7f50 | 1 | +公交调度系统BS版 0.1 |
| 2 | +====== | ||
| 3 | +---------- | ||
| 4 | +## 目录 | ||
| 5 | +--------- | ||
| 6 | + * [字典表](#字典表) | ||
| 7 | + * [动态jpa查询实现](#动态jpa查询实现) | ||
| 8 | + * [车载 gps 相关数据](#gps) | ||
| 9 | + * [实时gps数据接口 http](#实时gps接口) | ||
| 10 | + * [进出站数据表结构](#进站数据) | ||
| 11 | + * [异常警报表结构](#异常警报) | ||
| 12 | + * [大间隔](#大间隔) | ||
| 13 | + * [超速](#超速) | ||
| 14 | + * [越界](#越界) | ||
| 15 | + * [越站](#越站) | ||
| 16 | + * [聚集](#聚集) | ||
| 17 | + * [掉线](#掉线) | ||
| 18 | + * [调度消息下发接口HTTP](#调度消息下发接口) | ||
| 19 | + * [调度消息上传接口HTTP](#调度消息上传接口) | ||
| 20 | + * [车辆历史GPS数据](#车辆历史GPS) | ||
| 21 | + | ||
| 22 | +---------- | ||
| 23 | + | ||
| 24 | +## 字典表 | ||
| 25 | +---------- | ||
| 26 | +字典操作全部由前端负责,主要有2种。 | ||
| 27 | + | ||
| 28 | +1、转换字典代码。 | ||
| 29 | + 当pjax的`pjax:success`事件被触发(片段加载完成) | ||
| 30 | + 扫描容器内所有有 `$(".nt-dictionary")` 元素进行字典转换 | ||
| 31 | +``` html | ||
| 32 | +--dom标签为span div p h1 h2 h3 h4 h5 h6 等等文本元素时,如下写法,text为要转换的代码 | ||
| 33 | +<span class="nt-dictionary" data-group="ScheduleType">out</span> | ||
| 34 | +--to | ||
| 35 | +<span>出场</span> | ||
| 36 | + | ||
| 37 | +<!- dom标签为input时,如下 data-code为要转换的代码 --> | ||
| 38 | +<input class="nt-dictionary" data-group="ScheduleType" data-code="out"> | ||
| 39 | +--to | ||
| 40 | +<input value="出场"> | ||
| 41 | + | ||
| 42 | +<!- dom标签为select时 如下 data-code为要选中的项 --> | ||
| 43 | +<select class="nt-dictionary" data-group="ScheduleType" data-code="out"></select> | ||
| 44 | +--to | ||
| 45 | +<select> | ||
| 46 | + <option value="normal">正常班次</option> | ||
| 47 | + <option value="out" selected>出场</option> | ||
| 48 | + <option value="in">进场</option> | ||
| 49 | + <option value="oil">加油</option> | ||
| 50 | + <option value="temp">临加</option> | ||
| 51 | + <option value="region">区间</option> | ||
| 52 | + <option value="venting">放空</option> | ||
| 53 | + <option value="major">放大站</option> | ||
| 54 | +</select> | ||
| 55 | +``` | ||
| 56 | +*原标签的class 除nt-dictionary 外,其余均会被保留* | ||
| 57 | + | ||
| 58 | +2、dictionary.js提供如下方法自行使用 | ||
| 59 | +| 方法名 | 参数|返回| | ||
| 60 | +| ---- | ---- | ---- | ---- | | ||
| 61 | +| groups (获取所有字典组) | 无| | {LineTrend: 线路走向, ScheduleType: 班次类型} | | ||
| 62 | +| getByGroup (获取字典组下的字典)| (group) |{0: 上行, 1: 下行}| | ||
| 63 | +| transformCode (转换字典代码)| (group, code) | 上行 | | ||
| 64 | + | ||
| 65 | +## 动态jpa查询实现 | ||
| 66 | +---------- | ||
| 67 | +*参考调度系统枚举com.bsth.entity.search.SearchOperator* | ||
| 68 | + | ||
| 69 | + | ||
| 70 | +## gps | ||
| 71 | +---------- | ||
| 72 | +### 实时gps接口 | ||
| 73 | + | ||
| 74 | +所有在线GPS: [http://192.168.168.192:8080/transport_server/rtgps](http://192.168.168.192:8080/transport_server/rtgps/) | ||
| 75 | +根据设备号查询:[http://192.168.168.192:8080/transport_server/rtgps/05B01901](http://192.168.168.192:8080/transport_server/rtgps/05B01901) | ||
| 76 | + | ||
| 77 | +<span style="color: red">Response</span>: | ||
| 78 | +```json | ||
| 79 | +{ | ||
| 80 | + "data":[ | ||
| 81 | + { | ||
| 82 | + "companyCode":5, | ||
| 83 | + "lineId":10329, | ||
| 84 | + "deviceId":"05B01901", | ||
| 85 | + "carparkNo":"00000000", | ||
| 86 | + "stopNo":"7C890002", | ||
| 87 | + "lon":121.549866, | ||
| 88 | + "lat":31.238798, | ||
| 89 | + "timestamp":1397104499000, | ||
| 90 | + "speed":42.0, | ||
| 91 | + "direction":245.9, | ||
| 92 | + "state":0, | ||
| 93 | + "upDown":0 | ||
| 94 | + }] | ||
| 95 | +} | ||
| 96 | +``` | ||
| 97 | + | ||
| 98 | +| -- | --|--| | ||
| 99 | +| ---- | ---- | ---- | | ||
| 100 | +| companyCode | int | 公司代码 | | ||
| 101 | +| lineId | int | 线路编码 | | ||
| 102 | +| deviceId | String | 设备编号 | | ||
| 103 | +| carparkNo | String | 停车场编码 | | ||
| 104 | +| stopNo | String | 站点编码 | | ||
| 105 | +| lon | float | 经度 | | ||
| 106 | +| lat | float | 纬度 | | ||
| 107 | +| timestamp | long | 时间戳 | | ||
| 108 | +| speed | float | 速度| | ||
| 109 | +| direction | float | 方向(角度) | | ||
| 110 | +| state | int | 营运状态( 0 营运 ,1 非营运, -1 无效) | | ||
| 111 | +| upDown | int | 上下行(0 上行 , 1 下行 , -1 无效)| | ||
| 112 | + | ||
| 113 | + | ||
| 114 | +### 进站数据 | ||
| 115 | +---------- | ||
| 116 | +表名: | ||
| 117 | + | ||
| 118 | +| .. | .. | .. | | ||
| 119 | +| ---- | ---- | ---- | | ||
| 120 | +| id | int | 主键 | | ||
| 121 | +| deviceId | String | 设备号 | | ||
| 122 | +| lineId | int | 线路编码 | | ||
| 123 | +| stopNo | long | 站点编码 | | ||
| 124 | +| timestamp | long | 时间戳 | | ||
| 125 | +| upDown | int | 上下行(0 上行 , 1 下行 , -1 无效) | | ||
| 126 | +| createDate | Date | 创建时间 | | ||
| 127 | + | ||
| 128 | + | ||
| 129 | +### 异常警报 | ||
| 130 | +---------- | ||
| 131 | + | ||
| 132 | +### 大间隔 | ||
| 133 | +---------- | ||
| 134 | +表名: | ||
| 135 | + | ||
| 136 | +| .. | .. | .. | | ||
| 137 | +| ---- | ---- | ---- | | ||
| 138 | +| id | int | 主键 | | ||
| 139 | +| line | int | 线路编码 | | ||
| 140 | +| station | String | 站点编码 | | ||
| 141 | +| cVehicle | String | 当前车辆编码 | | ||
| 142 | +| lastVehicle | String | 上一个车辆编码 | | ||
| 143 | +| interval | long | 间隔时间(秒) | | ||
| 144 | +| timestamp | long | 时间戳 | | ||
| 145 | +| createDate | Date | 创建时间 | | ||
| 146 | + | ||
| 147 | +### 超速 | ||
| 148 | +---------- | ||
| 149 | +表名: | ||
| 150 | + | ||
| 151 | +| .. | .. | .. | | ||
| 152 | +| ---- | ---- | ---- | | ||
| 153 | +| id | int | 主键 | | ||
| 154 | +| vehicle | String | 车辆编码 | | ||
| 155 | +| line | int | 线路编码 | | ||
| 156 | +| upDown | int | 上下行(0 上行 , 1 下行 , -1 无效) | | ||
| 157 | +| lon | float | 经度 | | ||
| 158 | +| lat | float | 纬度| | ||
| 159 | +| speed | float | 速度 | | ||
| 160 | +| timestamp | long | 时间戳 | | ||
| 161 | +| createDate | Date | 时间 | | ||
| 162 | + | ||
| 163 | +### 越界 | ||
| 164 | +---------- | ||
| 165 | +表名: | ||
| 166 | + | ||
| 167 | +| .. | .. | .. | | ||
| 168 | +| ---- | ---- | ---- | | ||
| 169 | +| id | int | 主键 | | ||
| 170 | +| vehicle | String | 车辆编码 | | ||
| 171 | +| line | int | 线路编码 | | ||
| 172 | +| upDown | int | 上下行(0 上行 , 1 下行 , -1 无效) | | ||
| 173 | +| lon | float | 经度 | | ||
| 174 | +| lat | float | 纬度| | ||
| 175 | +| location | String | 越界位置(由线调页面进行初始转换)意思是该字段默认为空,页面第一次查看时会写入值| | ||
| 176 | +| timestamp | long | 时间戳 | | ||
| 177 | +| createDate | Date | 时间 | | ||
| 178 | + | ||
| 179 | + | ||
| 180 | +### 越站 | ||
| 181 | +---------- | ||
| 182 | +表名: | ||
| 183 | + | ||
| 184 | +| .. | .. | .. | | ||
| 185 | +| ---- | ---- | ---- | | ||
| 186 | +| id | int | 主键 | | ||
| 187 | +| line | int | 线路编码 | | ||
| 188 | +| upDown | int | 上下行(0 上行 , 1 下行 , -1 无效) | | ||
| 189 | +| station | String | 站点编码 | | ||
| 190 | +| vehicle | String | 车辆编码 | | ||
| 191 | +| inData | Date | 进站时间 | | ||
| 192 | +| outDate | Date | 出站时间 | | ||
| 193 | + | ||
| 194 | + | ||
| 195 | +### 聚集 | ||
| 196 | +---------- | ||
| 197 | +表名: | ||
| 198 | + | ||
| 199 | +| .. | .. | .. | | ||
| 200 | +| ---- | ---- | ---- | | ||
| 201 | +| id | int | 主键 | | ||
| 202 | +| line | int | 线路编码 | | ||
| 203 | +| upDown | int | 上下行(0 上行 , 1 下行 , -1 无效) | | ||
| 204 | +| stations | String | 站点(多个用 , 号分隔。应该是连续站点) | | ||
| 205 | +| vehicles | String | 车辆编码(多个用 , 号分隔) | | ||
| 206 | +| timestamp | long | 时间戳 | | ||
| 207 | +| createDate | Date | 时间 | | ||
| 208 | + | ||
| 209 | + | ||
| 210 | +### 掉线 | ||
| 211 | +---------- | ||
| 212 | +表名: | ||
| 213 | + | ||
| 214 | +| .. | .. | .. | | ||
| 215 | +| ---- | ---- | ---- | | ||
| 216 | +| id | int | 主键 | | ||
| 217 | +| line | int | 线路编码 | | ||
| 218 | +| upDown | int | 上下行(0 上行 , 1 下行 , -1 无效) | | ||
| 219 | +| vehicle | String | 车辆编码 | | ||
| 220 | +| lon | float | 经度 | | ||
| 221 | +| lat | float | 纬度| | ||
| 222 | +| timestamp | long | 时间戳 | | ||
| 223 | +| createDate | Date | 时间 | | ||
| 224 | + | ||
| 225 | + | ||
| 226 | +### 调度消息下发接口 | ||
| 227 | +---------- | ||
| 228 | +[http://192.168.168.192:8080/transport_server/message](http://192.168.168.192:8080/transport_server/message/) | ||
| 229 | + | ||
| 230 | +<span style="color: red">Request</span>: | ||
| 231 | +```json | ||
| 232 | +{ | ||
| 233 | + "deviceId":12345, | ||
| 234 | + "timestamp":44324, | ||
| 235 | + "operCode":0x60, | ||
| 236 | + "data":{ | ||
| 237 | + "companyCode":22, | ||
| 238 | + "deviceId":"029L2222", | ||
| 239 | + "timestamp":134326, | ||
| 240 | + "instructType":00, | ||
| 241 | + "dispatchInstruct":0x00, | ||
| 242 | + "msgId":12345, | ||
| 243 | + "alarmTime":201606012000, | ||
| 244 | + "serviceState":00000000, | ||
| 245 | + "txtContent":"你好" | ||
| 246 | + } | ||
| 247 | +} | ||
| 248 | +``` | ||
| 249 | +| .. | .. | .. | | ||
| 250 | +| ---- | ---- | ---- | | ||
| 251 | +| deviceId | string | 设备编号 | | ||
| 252 | +| timestamp | long | 时间戳(ms) | | ||
| 253 | +| operCode | short | 一级协议 | | ||
| 254 | +| data.companyCode | short | 公司代码 | | ||
| 255 | +| data.deviceId | string | 设备编号 | | ||
| 256 | +| data.timestamp | long | 时间戳 | | ||
| 257 | +| data.instructType | short | 保留 默认0 | | ||
| 258 | +| data.dispatchInstruct | short | 调度指令 调度指令。0X00表示信息短语,0X01表示取消上次指令+调度指令(闹钟有效),0x02表示为调度指令(闹钟有效); 0x03表示运营状态指令(闹钟无效);0x04表示其他指令。| | ||
| 259 | +| data.msgId | long | 同上 | | ||
| 260 | +| data.alarmTime | long | 闹钟 MMddhhmm| | ||
| 261 | +| data.serviceState | long | 多状态字节 先由车载发起车辆故障、事故报告、扣证、纠纷、加油等审请,经调度确认后,下发调度指令与运营状态。当调度指令为0X00终端需要提示信息。当调度指令为0x01和0x02,终端需要收到后提示信息。并且必须在闹钟结束后进行终端相关状态更新。在闹钟时间前120秒开始提示。当调度指令为0x03,收到后进行终端相关状态更新,终端不需要提示信息。当调度指令为0x04,暂不需要提示信息。| | ||
| 262 | +| data.txtContent | string | 下发的消息文本 | | ||
| 263 | +```json | ||
| 264 | +{ | ||
| 265 | + "deviceId":12345, | ||
| 266 | + "timestamp":44324, | ||
| 267 | + "operCode":0x64, | ||
| 268 | + "data":{ | ||
| 269 | + "cityCode":22, | ||
| 270 | + "deviceId":"029L2222", | ||
| 271 | + "lineId":"134326" | ||
| 272 | + } | ||
| 273 | +} | ||
| 274 | +``` | ||
| 275 | +| .. | .. | .. | | ||
| 276 | +| ---- | ---- | ---- | | ||
| 277 | +| deviceId | string | 设备编号 | | ||
| 278 | +| timestamp | long | 时间戳(ms) | | ||
| 279 | +| operCode | short | 一级协议 | | ||
| 280 | +| data.cityCode | short | 城市区号 | | ||
| 281 | +| data.deviceId | string | 设备编号 | | ||
| 282 | +| data.lineId | string | 线路编号 6位 不足6位前面补0 如编号890 用000890表示 | | ||
| 283 | + | ||
| 284 | +```json | ||
| 285 | +{ | ||
| 286 | + "deviceId":12345, | ||
| 287 | + "timestamp":44324, | ||
| 288 | + "operCode":0xC0, | ||
| 289 | + "data":{ | ||
| 290 | + "operCode":0x86, | ||
| 291 | + "requestAck":0x06 | ||
| 292 | + } | ||
| 293 | +} | ||
| 294 | +``` | ||
| 295 | +| .. | .. | .. | | ||
| 296 | +| ---- | ---- | ---- | | ||
| 297 | +| deviceId | string | 设备编号 | | ||
| 298 | +| timestamp | long | 时间戳(ms) | | ||
| 299 | +| operCode | short | 一级协议 | | ||
| 300 | +| data.operCode | short | 二级协议 | | ||
| 301 | +| data.requestAck | short | 请求应答字 0x06同意 0x15不同意| | ||
| 302 | + | ||
| 303 | +```json | ||
| 304 | +{ | ||
| 305 | + "deviceId":12345, | ||
| 306 | + "timestamp":44324, | ||
| 307 | + "operCode":0xC0, | ||
| 308 | + "data":{ | ||
| 309 | + "operCode":0xa3, | ||
| 310 | + "deviceId":12345, | ||
| 311 | + "ipAddress":222.66.0.204, | ||
| 312 | + "port":8899, | ||
| 313 | + "reportMode":0, | ||
| 314 | + "interval":0, | ||
| 315 | + "distance":0, | ||
| 316 | + "speedingThreshold":0, | ||
| 317 | + "alarmThreshold":0, | ||
| 318 | + "posIpAddress":0, | ||
| 319 | + "posPort":0, | ||
| 320 | + "delay":0, | ||
| 321 | + "speedThreshold1":0, | ||
| 322 | + "speedThreshold2":0, | ||
| 323 | + "contrast":0, | ||
| 324 | + "brightness":0, | ||
| 325 | + "saturation":0 | ||
| 326 | + } | ||
| 327 | +} | ||
| 328 | +``` | ||
| 329 | +| .. | .. | .. | | ||
| 330 | +| ---- | ---- | ---- | | ||
| 331 | +| deviceId | string | 设备编号 | | ||
| 332 | +| timestamp | long | 时间戳(ms) | | ||
| 333 | +| operCode | short | 一级协议 | | ||
| 334 | +| data.operCode | short | 二级协议 | | ||
| 335 | +| data.deviceId | string | 设备编号| | ||
| 336 | +| data.ipAddress | string | 网关IP地址| | ||
| 337 | +| data.port | string | 网关端口| | ||
| 338 | +| data.reportMode | short | 定时定距上报模式| | ||
| 339 | +| data.interval | int | 定时上报时间间隔| | ||
| 340 | +| data.distance | string | 定距上报距离间隔| | ||
| 341 | +| data.speedingThreshold | short | 非线路状态超速阀门| | ||
| 342 | +| data.alarmThreshold | short | 预警阀门| | ||
| 343 | +| data.posIpAddress | string | pos机IP地址| | ||
| 344 | +| data.posPort | string | pos机端口| | ||
| 345 | +| data.delay | int | 延迟机关时间| | ||
| 346 | +| data.deviceId | short | 中门视频切换到码表界面速度阀门 默认45| | ||
| 347 | +| data.deviceId | short | 码表界面切换到中门视频速度阀门 默认35| | ||
| 348 | +| data.deviceId | short | 对比度| | ||
| 349 | +| data.deviceId | short | 亮度| | ||
| 350 | +| data.deviceId | short | 饱和度| | ||
| 351 | + | ||
| 352 | +```json | ||
| 353 | +{ | ||
| 354 | + "deviceId":12345, | ||
| 355 | + "timestamp":44324, | ||
| 356 | + "operCode":0xC0, | ||
| 357 | + "data":{ | ||
| 358 | + "operCode":0xa4 | ||
| 359 | + } | ||
| 360 | +} | ||
| 361 | +``` | ||
| 362 | +| .. | .. | .. | | ||
| 363 | +| ---- | ---- | ---- | | ||
| 364 | +| deviceId | string | 设备编号 | | ||
| 365 | +| timestamp | long | 时间戳(ms) | | ||
| 366 | +| operCode | short | 一级协议 | | ||
| 367 | +| data.operCode | short | 二级协议 | | ||
| 368 | + | ||
| 369 | +```json | ||
| 370 | +{ | ||
| 371 | + "deviceId":12345, | ||
| 372 | + "timestamp":44324, | ||
| 373 | + "operCode":0xC0, | ||
| 374 | + "data":{ | ||
| 375 | + "operCode":0xa5 | ||
| 376 | + "programVersion":2 | ||
| 377 | + } | ||
| 378 | +} | ||
| 379 | +``` | ||
| 380 | +| .. | .. | .. | | ||
| 381 | +| ---- | ---- | ---- | | ||
| 382 | +| deviceId | string | 设备编号 | | ||
| 383 | +| timestamp | long | 时间戳(ms) | | ||
| 384 | +| operCode | short | 一级协议 | | ||
| 385 | +| data.operCode | short | 二级协议 | | ||
| 386 | +| data.programVersion | short | 程序版本 | | ||
| 387 | + | ||
| 388 | +<span style="color: red">Response</span>: | ||
| 389 | +```json | ||
| 390 | +{ | ||
| 391 | + "errCode":0 | ||
| 392 | +} | ||
| 393 | +``` | ||
| 394 | + | ||
| 395 | +### 调度消息上传接口 | ||
| 396 | +---------- | ||
| 397 | +上行POST地址:[http://192.168.168.120:9088/control/upstream](http://192.168.168.120:9088/control/upstream) | ||
| 398 | +<span style="color: red">Request</span>: | ||
| 399 | +```json | ||
| 400 | +{ | ||
| 401 | + "deviceId":12345, | ||
| 402 | + "timestamp":44324, | ||
| 403 | + "status":0, | ||
| 404 | + "operCode":0x80, | ||
| 405 | + "data":{ | ||
| 406 | + "operCode":0x26, | ||
| 407 | + "requestCode":22 | ||
| 408 | + } | ||
| 409 | +} | ||
| 410 | +``` | ||
| 411 | +| .. | .. | .. | | ||
| 412 | +| ---- | ---- | ---- | | ||
| 413 | +| deviceId | string | 设备编号 | | ||
| 414 | +| timestamp | long | 时间戳(ms) | | ||
| 415 | +| status | int | 0x80时无数据 0表示失败 1表示成功或设备确认 2表示驾驶员阅读 | | ||
| 416 | +| operCode | short | 一级协议 消息确认将无数据 | | ||
| 417 | +| data.operCode | short | 二级协议 | | ||
| 418 | +| data.requestCode | short | 请求代码0xa1 恢复运营 0xa2 申请调档 0xa3 出场请求 0xa5 进场请求 0xa7 加油请求 0x50 车辆故障 0x70 路阻报告 0x60 事故报告 0x11 扣证纠纷 0x12 报警 | | ||
| 419 | +<span style="color: red">Response</span>: | ||
| 420 | +```json | ||
| 421 | +{ | ||
| 422 | + "errCode":0 | ||
| 423 | +} | ||
| 424 | +``` | ||
| 425 | + | ||
| 426 | +### 车辆历史GPS | ||
| 427 | +---------- | ||
| 428 | +表名:BSTH_C_GPS_INFO | ||
| 429 | + | ||
| 430 | +| .. | .. | .. | | ||
| 431 | +| ---- | ---- | ---- | | ||
| 432 | +| cityCode | int | 城市代码 | | ||
| 433 | +| industryCode | int | 行业代码 | | ||
| 434 | +| companyCode | int | 企业代码 | | ||
| 435 | +| lineId | int | 线路编号 | | ||
| 436 | +| deviceId | string | 设备编号 | | ||
| 437 | +| driverNo | int | 驾驶员工号 | | ||
| 438 | +| carparkSerialNo | int | 停车场序列号 | | ||
| 439 | +| carparkNo | string | 停车场编号 | | ||
| 440 | +| stopSerialNo | int | 站点序列号 | | ||
| 441 | +| stopNo | string | 停车场编号 | | ||
| 442 | +| lon | float | 经度 | | ||
| 443 | +| lat | float | 维度 | | ||
| 444 | +| ts | long | 时间戳 | | ||
| 445 | +| speedSensor | float | 发动机速度 | | ||
| 446 | +| speedGps | float | gps速度 | | ||
| 447 | +| direction | float | 角度0-359 | | ||
| 448 | +| inTemp | int | 车内温度 | | ||
| 449 | +| serviceState | long | 设备状态字 | | ||
| 450 | +| daysYear | int | 对应年中的天数 为分区字段 查询一定要用此字段过滤 | | ||
| 451 | + |
src/main/java/com/bsth/controller/LineVersionsController.java
| 1 | package com.bsth.controller; | 1 | package com.bsth.controller; |
| 2 | 2 | ||
| 3 | -import java.util.List; | ||
| 4 | -import java.util.Map; | ||
| 5 | - | 3 | +import com.bsth.entity.LineVersions; |
| 4 | +import com.bsth.repository.LineRepository; | ||
| 5 | +import com.bsth.service.LineVersionsService; | ||
| 6 | import org.springframework.beans.factory.annotation.Autowired; | 6 | import org.springframework.beans.factory.annotation.Autowired; |
| 7 | import org.springframework.web.bind.annotation.RequestMapping; | 7 | import org.springframework.web.bind.annotation.RequestMapping; |
| 8 | import org.springframework.web.bind.annotation.RequestMethod; | 8 | import org.springframework.web.bind.annotation.RequestMethod; |
| 9 | import org.springframework.web.bind.annotation.RequestParam; | 9 | import org.springframework.web.bind.annotation.RequestParam; |
| 10 | import org.springframework.web.bind.annotation.RestController; | 10 | import org.springframework.web.bind.annotation.RestController; |
| 11 | 11 | ||
| 12 | -import com.bsth.entity.LineVersions; | ||
| 13 | -import com.bsth.repository.LineRepository; | ||
| 14 | -import com.bsth.service.LineVersionsService; | 12 | +import java.util.List; |
| 13 | +import java.util.Map; | ||
| 15 | 14 | ||
| 16 | /** | 15 | /** |
| 17 | * | 16 | * |
| @@ -75,7 +74,11 @@ public class LineVersionsController extends BaseController<LineVersions, Integer | @@ -75,7 +74,11 @@ public class LineVersionsController extends BaseController<LineVersions, Integer | ||
| 75 | public Map<String, Object> add(@RequestParam Map<String, Object> map) { | 74 | public Map<String, Object> add(@RequestParam Map<String, Object> map) { |
| 76 | return service.add(map); | 75 | return service.add(map); |
| 77 | } | 76 | } |
| 78 | - | 77 | + @RequestMapping(value = "delete", method = RequestMethod.POST) |
| 78 | + public Map<String, Object> delete(@RequestParam (defaultValue = "id") int id) { | ||
| 79 | + return service.delete(id); | ||
| 80 | + } | ||
| 81 | + | ||
| 79 | /** | 82 | /** |
| 80 | * 根据线路id获取当前版本号 | 83 | * 根据线路id获取当前版本号 |
| 81 | * | 84 | * |
src/main/java/com/bsth/controller/calc/CalcExportController.java
0 → 100644
| 1 | +package com.bsth.controller.calc; | ||
| 2 | + | ||
| 3 | +import java.text.SimpleDateFormat; | ||
| 4 | +import java.util.ArrayList; | ||
| 5 | +import java.util.HashMap; | ||
| 6 | +import java.util.Iterator; | ||
| 7 | +import java.util.List; | ||
| 8 | +import java.util.Map; | ||
| 9 | + | ||
| 10 | +import org.springframework.beans.factory.annotation.Autowired; | ||
| 11 | +import org.springframework.web.bind.annotation.RequestMapping; | ||
| 12 | +import org.springframework.web.bind.annotation.RequestMethod; | ||
| 13 | +import org.springframework.web.bind.annotation.RequestParam; | ||
| 14 | +import org.springframework.web.bind.annotation.RestController; | ||
| 15 | + | ||
| 16 | +import com.bsth.common.ResponseCode; | ||
| 17 | +import com.bsth.entity.calc.CalcWaybill; | ||
| 18 | +import com.bsth.entity.mcy_forms.Waybillday; | ||
| 19 | +import com.bsth.service.calc.CalcMixService; | ||
| 20 | +import com.bsth.service.calc.CalcWaybillService; | ||
| 21 | +import com.bsth.util.ReportUtils; | ||
| 22 | + | ||
| 23 | +@RestController | ||
| 24 | +@RequestMapping("calc_export") | ||
| 25 | +public class CalcExportController { | ||
| 26 | + | ||
| 27 | + @Autowired | ||
| 28 | + CalcWaybillService service; | ||
| 29 | + | ||
| 30 | + @Autowired | ||
| 31 | + CalcMixService clacMixService; | ||
| 32 | + | ||
| 33 | + @RequestMapping(value = "/waybilldayExport", method = RequestMethod.GET) | ||
| 34 | + public Map<String, Object> calcjsyspyExport(@RequestParam Map<String, Object> map) { | ||
| 35 | + | ||
| 36 | + String line=""; | ||
| 37 | + if(map.get("line")!=null){ | ||
| 38 | + line=map.get("line").toString().trim(); | ||
| 39 | + } | ||
| 40 | + String lineName=""; | ||
| 41 | + if(map.get("lineName")!=null){ | ||
| 42 | + lineName=map.get("lineName").toString().trim(); | ||
| 43 | + } | ||
| 44 | + String startDate=""; | ||
| 45 | + if(map.get("startDate")!=null){ | ||
| 46 | + startDate=map.get("startDate").toString().trim(); | ||
| 47 | + } | ||
| 48 | + String endDate=""; | ||
| 49 | + if(map.get("endDate")!=null){ | ||
| 50 | + endDate=map.get("endDate").toString().trim(); | ||
| 51 | + } | ||
| 52 | + String cont=""; | ||
| 53 | + if(map.get("cont")!=null){ | ||
| 54 | + cont=map.get("cont").toString().trim(); | ||
| 55 | + } | ||
| 56 | + String empnames=""; | ||
| 57 | + if(map.get("empnames")!=null){ | ||
| 58 | + empnames=map.get("empnames").toString().trim(); | ||
| 59 | + } | ||
| 60 | + String gsdmManth=""; | ||
| 61 | + if(map.get("gsdmManth")!=null){ | ||
| 62 | + gsdmManth=map.get("gsdmManth").toString().trim(); | ||
| 63 | + } | ||
| 64 | + String fgsdmManth=""; | ||
| 65 | + if(map.get("fgsdmManth")!=null){ | ||
| 66 | + fgsdmManth=map.get("fgsdmManth").toString().trim(); | ||
| 67 | + } | ||
| 68 | + | ||
| 69 | + Map<String, Object> resMap = new HashMap<String, Object>(); | ||
| 70 | + List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>(); | ||
| 71 | + List<Map<String, Object>> list = clacMixService.calcjsyspy(line, startDate, endDate, empnames, cont, gsdmManth, fgsdmManth); | ||
| 72 | + | ||
| 73 | + Map<String, Object> temp = new HashMap<String, Object>(); | ||
| 74 | + temp.put("i", "序号"); | ||
| 75 | + temp.put("jName", empnames); | ||
| 76 | + temp.put("jhyybc", "计划营运班次"); | ||
| 77 | + temp.put("jhfyybc", "计划空驶班次"); | ||
| 78 | + temp.put("sjyybc", "实际营运班次"); | ||
| 79 | + temp.put("sjfyybc", "实际空驶班次"); | ||
| 80 | + temp.put("lbbc", "烂班班次"); | ||
| 81 | + temp.put("ljbc", "临加班次"); | ||
| 82 | + temp.put("jhzlc", "计划总里程"); | ||
| 83 | + temp.put("jhyylc", "计划营运里程"); | ||
| 84 | + temp.put("jhfyylc", "计划空驶里程"); | ||
| 85 | + temp.put("sjzlc", "实际总里程"); | ||
| 86 | + temp.put("sjyylc", "实际营运里程"); | ||
| 87 | + temp.put("sjfyylc", "实际空驶里程"); | ||
| 88 | + temp.put("lblc", "烂班里程"); | ||
| 89 | + temp.put("ljyylc", "临加营运里程"); | ||
| 90 | + temp.put("ljfyylc", "临加空驶里程"); | ||
| 91 | + resList.add(temp); | ||
| 92 | + for(int i = 0; i < list.size(); i++){ | ||
| 93 | + temp = list.get(i); | ||
| 94 | + temp.put("i", i+1); | ||
| 95 | + resList.add(temp); | ||
| 96 | + } | ||
| 97 | + | ||
| 98 | + String date = startDate.replaceAll("-", ""); | ||
| 99 | + if(!startDate.equals(endDate)){ | ||
| 100 | + date = startDate.replaceAll("-", "") + "-" + endDate.replaceAll("-", ""); | ||
| 101 | + } | ||
| 102 | + | ||
| 103 | + SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"), | ||
| 104 | + sdfSimple = new SimpleDateFormat("yyyyMMdd"); | ||
| 105 | + List<Iterator<?>> listI = new ArrayList<Iterator<?>>(); | ||
| 106 | + Map<String,Object> mm = new HashMap<String, Object>(); | ||
| 107 | + ReportUtils ee = new ReportUtils(); | ||
| 108 | + | ||
| 109 | + try { | ||
| 110 | + listI.add(resList.iterator()); | ||
| 111 | + String path = this.getClass().getResource("/").getPath()+"static/pages/forms/"; | ||
| 112 | + ee.excelReplace(listI, new Object[] { mm }, path+"mould/calcjsyspy.xls", | ||
| 113 | + path+"export/"+date+"-"+lineName+"-人车班次公里统计.xls"); | ||
| 114 | + resMap.put("status", ResponseCode.SUCCESS); | ||
| 115 | + } catch (Exception e) { | ||
| 116 | + e.printStackTrace(); | ||
| 117 | + resMap.put("status", ResponseCode.ERROR); | ||
| 118 | + } | ||
| 119 | + return resMap; | ||
| 120 | + } | ||
| 121 | + | ||
| 122 | + @RequestMapping(value = "/singledataExportTj", method = RequestMethod.GET) | ||
| 123 | + public Map<String, Object> singledataExportTj(@RequestParam Map<String, Object> map) { | ||
| 124 | + | ||
| 125 | + String line=""; | ||
| 126 | + if(map.get("line")!=null){ | ||
| 127 | + line=map.get("line").toString().trim(); | ||
| 128 | + } | ||
| 129 | + String lineName=""; | ||
| 130 | + if(map.get("lineName")!=null){ | ||
| 131 | + lineName=map.get("lineName").toString().trim(); | ||
| 132 | + } | ||
| 133 | + String startDate=""; | ||
| 134 | + if(map.get("startDate")!=null){ | ||
| 135 | + startDate=map.get("startDate").toString().trim(); | ||
| 136 | + } | ||
| 137 | + String endDate=""; | ||
| 138 | + if(map.get("endDate")!=null){ | ||
| 139 | + endDate=map.get("endDate").toString().trim(); | ||
| 140 | + } | ||
| 141 | + String tjtype=""; | ||
| 142 | + if(map.get("tjtype")!=null){ | ||
| 143 | + tjtype=map.get("tjtype").toString().trim(); | ||
| 144 | + } | ||
| 145 | + String cont=""; | ||
| 146 | + if(map.get("cont")!=null){ | ||
| 147 | + cont=map.get("cont").toString().trim(); | ||
| 148 | + } | ||
| 149 | + String gsdmSing=""; | ||
| 150 | + if(map.get("gsdmSing")!=null){ | ||
| 151 | + gsdmSing=map.get("gsdmSing").toString().trim(); | ||
| 152 | + } | ||
| 153 | + String fgsdmSing=""; | ||
| 154 | + if(map.get("fgsdmSing")!=null){ | ||
| 155 | + fgsdmSing=map.get("fgsdmSing").toString().trim(); | ||
| 156 | + } | ||
| 157 | + | ||
| 158 | + Map<String, Object> resMap = new HashMap<String, Object>(); | ||
| 159 | + List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>(); | ||
| 160 | + List<Map<String, Object>> list = clacMixService.singledatatj(line, startDate, endDate, tjtype, cont, gsdmSing, fgsdmSing); | ||
| 161 | + | ||
| 162 | + Map<String, Object> temp = new HashMap<String, Object>(); | ||
| 163 | + temp.put("i", "序号"); | ||
| 164 | + temp.put("gS", "所属公司"); | ||
| 165 | + temp.put("xlName", "线路"); | ||
| 166 | + temp.put("jName", tjtype); | ||
| 167 | + temp.put("jhzlc", "计划公里"); | ||
| 168 | + temp.put("sjzlc", "行驶里程(包括空放)"); | ||
| 169 | + temp.put("sjfyylc", "空驶里程"); | ||
| 170 | + temp.put("hyl", "耗油量"); | ||
| 171 | + temp.put("jzl", "加注量"); | ||
| 172 | + temp.put("sh", "非营业用油"); | ||
| 173 | + | ||
| 174 | + resList.add(temp); | ||
| 175 | + for(int i = 0; i < list.size(); i++){ | ||
| 176 | + temp = list.get(i); | ||
| 177 | + temp.put("i", i+1); | ||
| 178 | + if(temp.get("xlName") == null){ | ||
| 179 | + temp.put("xlName", ""); | ||
| 180 | + } | ||
| 181 | + resList.add(temp); | ||
| 182 | + } | ||
| 183 | + | ||
| 184 | + String date = startDate.replaceAll("-", ""); | ||
| 185 | + if(!startDate.equals(endDate)){ | ||
| 186 | + date = startDate.replaceAll("-", "") + "-" + endDate.replaceAll("-", ""); | ||
| 187 | + } | ||
| 188 | + | ||
| 189 | + SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"), | ||
| 190 | + sdfSimple = new SimpleDateFormat("yyyyMMdd"); | ||
| 191 | + List<Iterator<?>> listI = new ArrayList<Iterator<?>>(); | ||
| 192 | + Map<String,Object> mm = new HashMap<String, Object>(); | ||
| 193 | + ReportUtils ee = new ReportUtils(); | ||
| 194 | + | ||
| 195 | + try { | ||
| 196 | + listI.add(resList.iterator()); | ||
| 197 | + String path = this.getClass().getResource("/").getPath()+"static/pages/forms/"; | ||
| 198 | + ee.excelReplace(listI, new Object[] { mm }, path+"mould/calcsingledata.xls", | ||
| 199 | + path+"export/"+date+"-"+lineName+"-路单数据(统计).xls"); | ||
| 200 | + resMap.put("status", ResponseCode.SUCCESS); | ||
| 201 | + } catch (Exception e) { | ||
| 202 | + e.printStackTrace(); | ||
| 203 | + resMap.put("status", ResponseCode.ERROR); | ||
| 204 | + } | ||
| 205 | + return resMap; | ||
| 206 | + } | ||
| 207 | + | ||
| 208 | +} |
src/main/java/com/bsth/controller/calc/CalcMixController.java
0 → 100644
| 1 | +package com.bsth.controller.calc; | ||
| 2 | + | ||
| 3 | +import java.util.List; | ||
| 4 | +import java.util.Map; | ||
| 5 | + | ||
| 6 | +import org.springframework.beans.factory.annotation.Autowired; | ||
| 7 | +import org.springframework.web.bind.annotation.RequestMapping; | ||
| 8 | +import org.springframework.web.bind.annotation.RequestMethod; | ||
| 9 | +import org.springframework.web.bind.annotation.RequestParam; | ||
| 10 | +import org.springframework.web.bind.annotation.RestController; | ||
| 11 | + | ||
| 12 | +import com.bsth.service.calc.CalcMixService; | ||
| 13 | + | ||
| 14 | +@RestController | ||
| 15 | +@RequestMapping("calc_mix") | ||
| 16 | +public class CalcMixController { | ||
| 17 | + | ||
| 18 | + @Autowired | ||
| 19 | + CalcMixService service; | ||
| 20 | + | ||
| 21 | + @RequestMapping(value="/calcjsyspy") | ||
| 22 | + public List<Map<String, Object>> calcjsyspy(@RequestParam Map<String, Object> map){ | ||
| 23 | + String line=""; | ||
| 24 | + if(map.get("line")!=null){ | ||
| 25 | + line=map.get("line").toString().trim(); | ||
| 26 | + } | ||
| 27 | + String startDate=""; | ||
| 28 | + if(map.get("startDate")!=null){ | ||
| 29 | + startDate=map.get("startDate").toString().trim(); | ||
| 30 | + } | ||
| 31 | + String endDate=""; | ||
| 32 | + if(map.get("endDate")!=null){ | ||
| 33 | + endDate=map.get("endDate").toString().trim(); | ||
| 34 | + } | ||
| 35 | + String empnames=""; | ||
| 36 | + if(map.get("empnames")!=null){ | ||
| 37 | + empnames=map.get("empnames").toString().trim(); | ||
| 38 | + } | ||
| 39 | + String cont=""; | ||
| 40 | + if(map.get("cont")!=null){ | ||
| 41 | + cont=map.get("cont").toString().trim(); | ||
| 42 | + } | ||
| 43 | + String gsdmManth=""; | ||
| 44 | + if(map.get("gsdmManth")!=null){ | ||
| 45 | + gsdmManth=map.get("gsdmManth").toString().trim(); | ||
| 46 | + } | ||
| 47 | + String fgsdmManth=""; | ||
| 48 | + if(map.get("fgsdmManth")!=null){ | ||
| 49 | + fgsdmManth=map.get("fgsdmManth").toString().trim(); | ||
| 50 | + } | ||
| 51 | + return service.calcjsyspy(line, startDate, endDate, empnames, cont, gsdmManth, fgsdmManth); | ||
| 52 | + } | ||
| 53 | + | ||
| 54 | + @RequestMapping(value = "/singledatatj", method = RequestMethod.GET) | ||
| 55 | + public List<Map<String, Object>> singledatatj(@RequestParam Map<String, Object> map) { | ||
| 56 | + String line=""; | ||
| 57 | + if(map.get("line")!=null){ | ||
| 58 | + line=map.get("line").toString().trim(); | ||
| 59 | + } | ||
| 60 | + String startDate=""; | ||
| 61 | + if(map.get("startDate")!=null){ | ||
| 62 | + startDate=map.get("startDate").toString().trim(); | ||
| 63 | + } | ||
| 64 | + String endDate=""; | ||
| 65 | + if(map.get("endDate")!=null){ | ||
| 66 | + endDate=map.get("endDate").toString().trim(); | ||
| 67 | + } | ||
| 68 | + String tjtype=""; | ||
| 69 | + if(map.get("tjtype")!=null){ | ||
| 70 | + tjtype=map.get("tjtype").toString().trim(); | ||
| 71 | + } | ||
| 72 | + String cont=""; | ||
| 73 | + if(map.get("cont")!=null){ | ||
| 74 | + cont=map.get("cont").toString().trim(); | ||
| 75 | + } | ||
| 76 | + String gsdmSing=""; | ||
| 77 | + if(map.get("gsdmSing")!=null){ | ||
| 78 | + gsdmSing=map.get("gsdmSing").toString().trim(); | ||
| 79 | + } | ||
| 80 | + String fgsdmSing=""; | ||
| 81 | + if(map.get("fgsdmSing")!=null){ | ||
| 82 | + fgsdmSing=map.get("fgsdmSing").toString().trim(); | ||
| 83 | + } | ||
| 84 | + return service.singledatatj(line, startDate, endDate, tjtype, cont, gsdmSing, fgsdmSing); | ||
| 85 | + } | ||
| 86 | + | ||
| 87 | +} |
src/main/java/com/bsth/controller/oil/DlbController.java
| @@ -152,7 +152,11 @@ public class DlbController extends BaseController<Dlb, Integer>{ | @@ -152,7 +152,11 @@ public class DlbController extends BaseController<Dlb, Integer>{ | ||
| 152 | m.put("rq", y.getRq()); | 152 | m.put("rq", y.getRq()); |
| 153 | m.put("gsname",y.getGsname() ); | 153 | m.put("gsname",y.getGsname() ); |
| 154 | m.put("fgsname", y.getFgsname()); | 154 | m.put("fgsname", y.getFgsname()); |
| 155 | - m.put("xlname", y.getXlname()); | 155 | + if(y.getLinename()==null){ |
| 156 | + m.put("xlname", y.getXlname()==null?"":y.getXlname()); | ||
| 157 | + }else{ | ||
| 158 | + m.put("xlname", y.getLinename()); | ||
| 159 | + } | ||
| 156 | m.put("nbbm", y.getNbbm()); | 160 | m.put("nbbm", y.getNbbm()); |
| 157 | m.put("jsy", y.getJsy()); | 161 | m.put("jsy", y.getJsy()); |
| 158 | m.put("name", y.getName()); | 162 | m.put("name", y.getName()); |
src/main/java/com/bsth/controller/oil/YlbController.java
| @@ -255,7 +255,11 @@ public class YlbController extends BaseController<Ylb, Integer>{ | @@ -255,7 +255,11 @@ public class YlbController extends BaseController<Ylb, Integer>{ | ||
| 255 | m.put("rq", sdfMonth.format(y.getRq())); | 255 | m.put("rq", sdfMonth.format(y.getRq())); |
| 256 | m.put("gsname",y.getGsname() ); | 256 | m.put("gsname",y.getGsname() ); |
| 257 | m.put("fgsname", y.getFgsname()); | 257 | m.put("fgsname", y.getFgsname()); |
| 258 | - m.put("xlname", y.getXlname()==null?"":y.getXlname()); | 258 | + if(y.getLinename()==null){ |
| 259 | + m.put("xlname", y.getXlname()==null?"":y.getXlname()); | ||
| 260 | + }else{ | ||
| 261 | + m.put("xlname", y.getLinename()); | ||
| 262 | + } | ||
| 259 | m.put("nbbm", y.getNbbm()); | 263 | m.put("nbbm", y.getNbbm()); |
| 260 | m.put("jsy", y.getJsy()); | 264 | m.put("jsy", y.getJsy()); |
| 261 | m.put("name", y.getName()); | 265 | m.put("name", y.getName()); |
src/main/java/com/bsth/controller/realcontrol/ScheduleRealInfoController.java
| 1 | -package com.bsth.controller.realcontrol; | ||
| 2 | - | ||
| 3 | -import com.alibaba.fastjson.JSONArray; | ||
| 4 | -import com.bsth.common.ResponseCode; | ||
| 5 | -import com.bsth.controller.BaseController; | ||
| 6 | -import com.bsth.controller.realcontrol.dto.ChangePersonCar; | ||
| 7 | -import com.bsth.controller.realcontrol.dto.DfsjChange; | ||
| 8 | -import com.bsth.data.BasicData; | ||
| 9 | -import com.bsth.data.schedule.DayOfSchedule; | ||
| 10 | -import com.bsth.data.schedule.edit_logs.service.dto.SchEditInfoDto; | ||
| 11 | -import com.bsth.entity.realcontrol.ScheduleRealInfo; | ||
| 12 | -import com.bsth.entity.schedule.SchedulePlanInfo; | ||
| 13 | -import com.bsth.service.realcontrol.ScheduleRealInfoService; | ||
| 14 | -import org.apache.commons.lang3.StringEscapeUtils; | ||
| 15 | -import org.joda.time.format.DateTimeFormat; | ||
| 16 | -import org.joda.time.format.DateTimeFormatter; | ||
| 17 | -import org.springframework.beans.factory.annotation.Autowired; | ||
| 18 | -import org.springframework.web.bind.annotation.*; | ||
| 19 | - | ||
| 20 | -import java.util.*; | ||
| 21 | - | ||
| 22 | -@RestController | ||
| 23 | -@RequestMapping("/realSchedule") | ||
| 24 | -public class ScheduleRealInfoController extends BaseController<ScheduleRealInfo, Long> { | ||
| 25 | - | ||
| 26 | - @Autowired | ||
| 27 | - ScheduleRealInfoService scheduleRealInfoService; | ||
| 28 | - | ||
| 29 | - @Autowired | ||
| 30 | - DayOfSchedule dayOfSchedule; | ||
| 31 | - | ||
| 32 | - @RequestMapping(value = "check_fgs_ascription", method = RequestMethod.POST) | ||
| 33 | - public Map<String, Object> checkPCFgsAscription(@RequestParam Long schId, String jGh, String sGh, String nbbm){ | ||
| 34 | - return scheduleRealInfoService.checkPCFgsAscription(schId, jGh, sGh, nbbm); | ||
| 35 | - } | ||
| 36 | - | ||
| 37 | - @RequestMapping(value = "/lines") | ||
| 38 | - public Map<String, Collection<ScheduleRealInfo>> findByLines(@RequestParam String lines) { | ||
| 39 | - return scheduleRealInfoService.findByLines(lines); | ||
| 40 | - } | ||
| 41 | - | ||
| 42 | - @RequestMapping(value = "/car") | ||
| 43 | - public List<ScheduleRealInfo> findByCar(String nbbm){ | ||
| 44 | - return dayOfSchedule.findByNbbm(nbbm); | ||
| 45 | - } | ||
| 46 | - | ||
| 47 | - /** | ||
| 48 | - * | ||
| 49 | - * @Title: outgoAdjust @Description: TODO(待发调整) @param @param id | ||
| 50 | - * 主键 @param @param remarks 备注 @param @param dfsj 待发时间(HH:mm) @throws | ||
| 51 | - */ | ||
| 52 | - @RequestMapping(value = "/outgoAdjust", method = RequestMethod.POST) | ||
| 53 | - public Map<String, Object> outgoAdjust(@RequestParam Long id, @RequestParam String remarks, | ||
| 54 | - @RequestParam String dfsj,String bcType, | ||
| 55 | - @RequestParam(defaultValue = "") String opType) { | ||
| 56 | - return scheduleRealInfoService.outgoAdjust(id, remarks, dfsj, bcType, opType, null); | ||
| 57 | - } | ||
| 58 | - | ||
| 59 | - /** | ||
| 60 | - * | ||
| 61 | - * @Title: destroy @Description: TODO(销毁,烂班) @param @param idsStr 要烂掉的班次ID ,分隔 | ||
| 62 | - */ | ||
| 63 | - @RequestMapping(value = "/destroy", method = RequestMethod.POST) | ||
| 64 | - public Map<String, Object> destroy(@RequestParam String idsStr | ||
| 65 | - /*, @RequestParam(defaultValue = "-1") int spaceAdjust*/, | ||
| 66 | - @RequestParam String remarks, @RequestParam String adjustExps/*, @RequestParam(defaultValue = "0") int spaceNum*/) { | ||
| 67 | - return scheduleRealInfoService.destroy(idsStr, remarks, adjustExps, null); | ||
| 68 | - } | ||
| 69 | - | ||
| 70 | - /** | ||
| 71 | - * | ||
| 72 | - * @Title: carDeviceMapp @Description: TODO(获取车辆自编号和设备号对照,从缓存取) @throws | ||
| 73 | - */ | ||
| 74 | - @RequestMapping(value = "/carDeviceMapp", method = RequestMethod.GET) | ||
| 75 | - public Map<String, String> carDeviceMapp() { | ||
| 76 | - return BasicData.deviceId2NbbmMap.inverse(); | ||
| 77 | - } | ||
| 78 | - | ||
| 79 | - /** | ||
| 80 | - * | ||
| 81 | - * @Title: findPersionByLine @Description: TODO(根据线路主键获取驾驶员) @param @param | ||
| 82 | - * lineId @throws | ||
| 83 | - */ | ||
| 84 | - @RequestMapping(value = "/driver", method = RequestMethod.GET) | ||
| 85 | - public List<Map<String, String>> findDriverByLine(@RequestParam String lineCode) { | ||
| 86 | - return scheduleRealInfoService.findDriverByLine(lineCode); | ||
| 87 | - } | ||
| 88 | - | ||
| 89 | - /** | ||
| 90 | - * | ||
| 91 | - * @Title: findPersionByLine @Description: TODO(根据线路主键获取售票员) @param @param | ||
| 92 | - * lineId @throws | ||
| 93 | - */ | ||
| 94 | - @RequestMapping(value = "/conductor", method = RequestMethod.GET) | ||
| 95 | - public List<Map<String, String>> findConductorByLine(@RequestParam String lineCode) { | ||
| 96 | - return scheduleRealInfoService.findConductorByLine(lineCode); | ||
| 97 | - } | ||
| 98 | - | ||
| 99 | - /** | ||
| 100 | - * | ||
| 101 | - * @Title: findPersionByLine @Description: TODO(根据线路主键获取车辆) @param @param | ||
| 102 | - * lineId @throws | ||
| 103 | - */ | ||
| 104 | - @RequestMapping(value = "/cars", method = RequestMethod.GET) | ||
| 105 | - public List<Map<String, String>> findCarByLine(@RequestParam String lineCode) { | ||
| 106 | - return scheduleRealInfoService.findCarByLine(lineCode); | ||
| 107 | - } | ||
| 108 | - | ||
| 109 | - /** | ||
| 110 | - * | ||
| 111 | - * @Title: sreachNbbm @Description: TODO(搜索车辆内部编码) @throws | ||
| 112 | - */ | ||
| 113 | - @RequestMapping(value = "/sreachVehic", method = RequestMethod.GET) | ||
| 114 | - public List<Map<String, String>> sreachVehic(@RequestParam String nbbm) { | ||
| 115 | - return scheduleRealInfoService.sreachVehic(nbbm); | ||
| 116 | - } | ||
| 117 | - /** | ||
| 118 | - * | ||
| 119 | - * @Title: realOutAdjust | ||
| 120 | - * @Description: TODO(实发调整) | ||
| 121 | - * @param @param id 班次ID | ||
| 122 | - * @param @param fcsjActual 实际发车时间 HH:mm | ||
| 123 | - * @param @param remarks 备注 | ||
| 124 | - * @throws | ||
| 125 | - */ | ||
| 126 | - @RequestMapping(value = "/realOutAdjust", method = RequestMethod.POST) | ||
| 127 | - public Map<String, Object> realOutAdjust(@RequestParam Long id, @RequestParam String fcsjActual, | ||
| 128 | - @RequestParam String remarks) { | ||
| 129 | - return scheduleRealInfoService.realOutAdjust(id, fcsjActual, remarks); | ||
| 130 | - } | ||
| 131 | - | ||
| 132 | - /** | ||
| 133 | - * | ||
| 134 | - * @Title: revokeDestroy | ||
| 135 | - * @Description: TODO(撤销烂班) | ||
| 136 | - * @param @param id | ||
| 137 | - * @throws | ||
| 138 | - */ | ||
| 139 | - @RequestMapping(value = "/revokeDestroy", method = RequestMethod.POST) | ||
| 140 | - public Map<String, Object> revokeDestroy(@RequestParam Long id){ | ||
| 141 | - return scheduleRealInfoService.revokeDestroy(id); | ||
| 142 | - } | ||
| 143 | - | ||
| 144 | - /** | ||
| 145 | - * | ||
| 146 | - * @Title: revokeRealOutgo | ||
| 147 | - * @Description: TODO(撤销实发) | ||
| 148 | - * @param @param id | ||
| 149 | - * @throws | ||
| 150 | - */ | ||
| 151 | - @RequestMapping(value = "/revokeRealOutgo", method = RequestMethod.POST) | ||
| 152 | - public Map<String, Object> revokeRealOutgo(@RequestParam Long id){ | ||
| 153 | - return scheduleRealInfoService.revokeRealOutgo(id); | ||
| 154 | - } | ||
| 155 | - | ||
| 156 | - /** | ||
| 157 | - * 撤销执行 | ||
| 158 | - * @param id | ||
| 159 | - * @return | ||
| 160 | - */ | ||
| 161 | - @RequestMapping(value = "/revokeRealArrive", method = RequestMethod.POST) | ||
| 162 | - public Map<String, Object> revokeRealArrive(@RequestParam Long id){ | ||
| 163 | - return scheduleRealInfoService.revokeRealArrive(id); | ||
| 164 | - } | ||
| 165 | - | ||
| 166 | - /** | ||
| 167 | - * | ||
| 168 | - * @Title: spaceAdjust | ||
| 169 | - * @Description: TODO(间隔调整) | ||
| 170 | - * @param @param ids 要调整的班次数组ID | ||
| 171 | - * @param @param space 间隔 | ||
| 172 | - * @throws | ||
| 173 | - */ | ||
| 174 | - @RequestMapping(value = "/spaceAdjust", method = RequestMethod.POST) | ||
| 175 | - public Map<String, Object> spaceAdjust(Long[] ids, Integer space){ | ||
| 176 | - return scheduleRealInfoService.spaceAdjust(ids, space); | ||
| 177 | - } | ||
| 178 | - | ||
| 179 | - /** | ||
| 180 | - * | ||
| 181 | - * @Title: schInfoFineTune | ||
| 182 | - * @Description: TODO(发车信息微调) | ||
| 183 | - * @param @param map | ||
| 184 | - * @throws | ||
| 185 | - */ | ||
| 186 | - @RequestMapping(value = "/schInfoFineTune", method = RequestMethod.POST) | ||
| 187 | - public Map<String, Object> schInfoFineTune(@RequestParam Map<String, String> map){ | ||
| 188 | - return scheduleRealInfoService.schInfoFineTune(map); | ||
| 189 | - } | ||
| 190 | - | ||
| 191 | - /** | ||
| 192 | - * | ||
| 193 | - * @Title: outgoAdjustAll | ||
| 194 | - * @Description: TODO(批量待发调整) | ||
| 195 | - * @param @param list | ||
| 196 | - * @throws | ||
| 197 | - */ | ||
| 198 | - @RequestMapping(value = "/outgoAdjustAll", method = RequestMethod.POST) | ||
| 199 | - public Map<String, Object> outgoAdjustAll(@RequestParam String params){ | ||
| 200 | - //反转义 | ||
| 201 | - params = StringEscapeUtils.unescapeHtml4(params); | ||
| 202 | - return scheduleRealInfoService.outgoAdjustAll(params); | ||
| 203 | - } | ||
| 204 | - | ||
| 205 | - /** | ||
| 206 | - * | ||
| 207 | - * @Title: findByLineAndUpDown | ||
| 208 | - * @Description: TODO(根据线路和走向获取班次) | ||
| 209 | - * @param @param line | ||
| 210 | - * @param @param upDown | ||
| 211 | - */ | ||
| 212 | - @RequestMapping(value = "/findByLineAndUpDown") | ||
| 213 | - public List<ScheduleRealInfo> findByLineAndUpDown(@RequestParam String line,@RequestParam Integer upDown){ | ||
| 214 | - return dayOfSchedule.findByLineAndUpDown(line, upDown); | ||
| 215 | - } | ||
| 216 | - | ||
| 217 | - /** | ||
| 218 | - * | ||
| 219 | - * @Title: findRouteByLine | ||
| 220 | - * @Description: TODO(获取线路的站点,路段路由) | ||
| 221 | - * @param @param lineCode | ||
| 222 | - * @throws | ||
| 223 | - */ | ||
| 224 | - @RequestMapping(value = "/findRouteByLine") | ||
| 225 | - public Map<String, Object> findRouteByLine(@RequestParam String lineCode){ | ||
| 226 | - return scheduleRealInfoService.findRouteByLine(lineCode); | ||
| 227 | - } | ||
| 228 | - | ||
| 229 | - /** | ||
| 230 | - * | ||
| 231 | - * @Title: removeChildTask | ||
| 232 | - * @Description: TODO(删除子任务) | ||
| 233 | - * @param @param taskId 子任务ID | ||
| 234 | - * @throws | ||
| 235 | - */ | ||
| 236 | - @RequestMapping(value = "/childTask/{taskId}", method = RequestMethod.DELETE) | ||
| 237 | - public Map<String, Object> removeChildTask(@PathVariable("taskId") Long taskId){ | ||
| 238 | - return scheduleRealInfoService.removeChildTask(taskId); | ||
| 239 | - } | ||
| 240 | - | ||
| 241 | - /** | ||
| 242 | - * | ||
| 243 | - * @Title: findByLineCode | ||
| 244 | - * @Description: TODO(根据线路获取班次信息) | ||
| 245 | - * @param @param lineCode | ||
| 246 | - */ | ||
| 247 | - @RequestMapping(value = "/lineCode/{lineCode}") | ||
| 248 | - public List<ScheduleRealInfo> findByLineCode(@PathVariable("lineCode") String lineCode){ | ||
| 249 | - return dayOfSchedule.findByLineCode(lineCode); | ||
| 250 | - } | ||
| 251 | - | ||
| 252 | - @RequestMapping(value = "/queryUserInfo") | ||
| 253 | - public List<ScheduleRealInfo> queryUserInfo(@RequestParam String line, | ||
| 254 | - @RequestParam String date,@RequestParam String state) { | ||
| 255 | - return scheduleRealInfoService.queryUserInfo(line, date,state); | ||
| 256 | - } | ||
| 257 | - | ||
| 258 | - @RequestMapping(value = "/queryUserInfoPx") | ||
| 259 | - public List<ScheduleRealInfo> queryUserInfoPx(@RequestParam String line, | ||
| 260 | - @RequestParam String date,@RequestParam String state,@RequestParam String type) { | ||
| 261 | - return scheduleRealInfoService.queryUserInfoPx(line, date,state,type); | ||
| 262 | - } | ||
| 263 | - | ||
| 264 | - @RequestMapping(value = "/exportWaybill",method = RequestMethod.GET) | ||
| 265 | - public List<ScheduleRealInfo> exportWaybill(@RequestParam String jName, @RequestParam String clZbh, | ||
| 266 | - @RequestParam String lpName,@RequestParam String date,@RequestParam String line) { | ||
| 267 | - return scheduleRealInfoService.exportWaybill(jName, clZbh, lpName,date,line); | ||
| 268 | - } | ||
| 269 | - | ||
| 270 | - @RequestMapping(value = "/exportWaybillQp",method = RequestMethod.GET) | ||
| 271 | - public List<ScheduleRealInfo> exportWaybillQp(@RequestParam String clZbh | ||
| 272 | - ,@RequestParam String date,@RequestParam String line) { | ||
| 273 | - return scheduleRealInfoService.exportWaybillQp( clZbh, date,line); | ||
| 274 | - } | ||
| 275 | - | ||
| 276 | - | ||
| 277 | - @RequestMapping(value = "/dailyInfo") | ||
| 278 | - public List<Map<String, Object>> dailyInfo(@RequestParam String line, @RequestParam String date,@RequestParam String type) { | ||
| 279 | - return scheduleRealInfoService.dailyInfo(line, date, type); | ||
| 280 | - } | ||
| 281 | - | ||
| 282 | - @RequestMapping(value = "/historyMessage") | ||
| 283 | - public List<Object[]> historyMessage(@RequestParam String line, @RequestParam String date, | ||
| 284 | - @RequestParam String code, @RequestParam String type) { | ||
| 285 | - return scheduleRealInfoService.historyMessage(line, date, code, type); | ||
| 286 | - } | ||
| 287 | - | ||
| 288 | - @RequestMapping(value="/findLine") | ||
| 289 | - public List<Map<String,String>> findLine(@RequestParam String line){ | ||
| 290 | - return scheduleRealInfoService.findLine(line); | ||
| 291 | - } | ||
| 292 | - | ||
| 293 | - @RequestMapping(value="/findKMBC",method = RequestMethod.GET) | ||
| 294 | - public Map<String,Object> findKMBC(@RequestParam String jGh,@RequestParam String clZbh,@RequestParam String lpName | ||
| 295 | - ,@RequestParam String date,@RequestParam String line){ | ||
| 296 | - return scheduleRealInfoService.findKMBC(jGh, clZbh,lpName,date,line); | ||
| 297 | - } | ||
| 298 | - | ||
| 299 | - /** | ||
| 300 | - * 路单公里统计 (闵行审计专用) | ||
| 301 | - * @param jGh | ||
| 302 | - * @param clZbh | ||
| 303 | - * @param lpName | ||
| 304 | - * @param date | ||
| 305 | - * @param line | ||
| 306 | - * @return | ||
| 307 | - */ | ||
| 308 | - @RequestMapping(value="/findKMBC_mh_2",method = RequestMethod.GET) | ||
| 309 | - public Map<String,Object> findKMBC_mh_2(@RequestParam String jGh,@RequestParam String clZbh,@RequestParam String lpName | ||
| 310 | - ,@RequestParam String date,@RequestParam String line){ | ||
| 311 | - return scheduleRealInfoService.findKMBC_mh_2(jGh, clZbh,lpName,date,line); | ||
| 312 | - } | ||
| 313 | - | ||
| 314 | - @RequestMapping(value="/findKMBCQp",method = RequestMethod.GET) | ||
| 315 | - public Map<String,Object> findKMBCQp(@RequestParam String clZbh | ||
| 316 | - ,@RequestParam String date,@RequestParam String line){ | ||
| 317 | - return scheduleRealInfoService.findKMBCQp(clZbh,date,line); | ||
| 318 | - } | ||
| 319 | - | ||
| 320 | - @RequestMapping(value="/findLpName") | ||
| 321 | - public List<Map<String,String>> findLpName(@RequestParam String lpName){ | ||
| 322 | - return scheduleRealInfoService.findLpName(lpName); | ||
| 323 | - } | ||
| 324 | - | ||
| 325 | - @RequestMapping(value = "/account") | ||
| 326 | - public List<Map<String,Object>> account(@RequestParam String line, @RequestParam String date, | ||
| 327 | - @RequestParam String code,@RequestParam String xlName, @RequestParam String type) { | ||
| 328 | - return scheduleRealInfoService.account(line, date, code, xlName, type); | ||
| 329 | - } | ||
| 330 | - | ||
| 331 | - @RequestMapping(value = "/accountPx") | ||
| 332 | - public List<Map<String,Object>> accountPx(@RequestParam String line, @RequestParam String date, | ||
| 333 | - @RequestParam String code,@RequestParam String xlName, @RequestParam String px) { | ||
| 334 | - return scheduleRealInfoService.accountPx(line, date, code, xlName, px); | ||
| 335 | - } | ||
| 336 | - | ||
| 337 | - @RequestMapping(value = "/correctForm") | ||
| 338 | - public List<SchEditInfoDto> correctForm(@RequestParam String line, @RequestParam String date, | ||
| 339 | - @RequestParam String endDate, | ||
| 340 | - @RequestParam String lpName, @RequestParam String code, | ||
| 341 | - @RequestParam String type,@RequestParam String changType) { | ||
| 342 | - return scheduleRealInfoService.correctForm(line, date, endDate, lpName, code, type,changType); | ||
| 343 | - } | ||
| 344 | - /** | ||
| 345 | - * @Title queryListWaybill | ||
| 346 | - * @Description 查询行车路单列表 | ||
| 347 | - * @param jName 驾驶员名字 | ||
| 348 | - * @param clZbh 车辆自编号(内部编号) | ||
| 349 | - * @param lpName 路牌 | ||
| 350 | - * @return | ||
| 351 | - */ | ||
| 352 | - @RequestMapping(value="/queryListWaybill",method = RequestMethod.GET) | ||
| 353 | - public List<ScheduleRealInfo> queryListWaybill(@RequestParam String jName,@RequestParam String clZbh,@RequestParam String lpName | ||
| 354 | - ,@RequestParam String date,@RequestParam String line){ | ||
| 355 | - return scheduleRealInfoService.queryListWaybill(jName, clZbh,lpName,date,line); | ||
| 356 | - } | ||
| 357 | - | ||
| 358 | - /** | ||
| 359 | - * @Title queryListWaybill | ||
| 360 | - * @Description 查询行车路单列表(闵行审计专用路单) | ||
| 361 | - * @param jName 驾驶员名字 | ||
| 362 | - * @param clZbh 车辆自编号(内部编号) | ||
| 363 | - * @param lpName 路牌 | ||
| 364 | - * @return | ||
| 365 | - */ | ||
| 366 | - @RequestMapping(value="/queryListWaybill_mh_2",method = RequestMethod.GET) | ||
| 367 | - public List<ScheduleRealInfo> queryListWaybill_mh_2(@RequestParam String jName,@RequestParam String clZbh,@RequestParam String lpName | ||
| 368 | - ,@RequestParam String date,@RequestParam String line){ | ||
| 369 | - return scheduleRealInfoService.queryListWaybill2(jName, clZbh,lpName,date,line); | ||
| 370 | - } | ||
| 371 | - | ||
| 372 | - @RequestMapping(value="/queryListWaybillQp",method = RequestMethod.GET) | ||
| 373 | - public List<ScheduleRealInfo> queryListWaybillQp(@RequestParam String clZbh, | ||
| 374 | - @RequestParam String date,@RequestParam String line){ | ||
| 375 | - return scheduleRealInfoService.queryListWaybillQp(clZbh,date,line); | ||
| 376 | - } | ||
| 377 | - | ||
| 378 | - @RequestMapping(value="/statisticsDaily") | ||
| 379 | - public List<Map<String,Object>> statisticsDaily(@RequestParam String line, @RequestParam String date, | ||
| 380 | - @RequestParam String xlName, @RequestParam String type){ | ||
| 381 | - return scheduleRealInfoService.statisticsDaily(line, date, xlName, type); | ||
| 382 | - } | ||
| 383 | - | ||
| 384 | - @RequestMapping(value="/statisticsDaily_mh_2") | ||
| 385 | - public List<Map<String,Object>> statisticsDaily_mh_2(@RequestParam String line, @RequestParam String date, | ||
| 386 | - @RequestParam String xlName, @RequestParam String type){ | ||
| 387 | - return scheduleRealInfoService.statisticsDaily_mh_2(line, date, xlName, type); | ||
| 388 | - } | ||
| 389 | - | ||
| 390 | - @RequestMapping(value="/statisticsDailyTj") | ||
| 391 | - public List<Map<String,Object>> statisticsDailyTj(@RequestParam Map<String, Object> map){ | ||
| 392 | - String gsdm=""; | ||
| 393 | - if(map.get("gsdm")!=null){ | ||
| 394 | - gsdm=map.get("gsdm").toString(); | ||
| 395 | - } | ||
| 396 | - String fgsdm=""; | ||
| 397 | - if(map.get("fgsdm")!=null){ | ||
| 398 | - fgsdm=map.get("fgsdm").toString(); | ||
| 399 | - } | ||
| 400 | - String line=""; | ||
| 401 | - if(map.get("line")!=null){ | ||
| 402 | - line=map.get("line").toString(); | ||
| 403 | - } | ||
| 404 | - String date=""; | ||
| 405 | - if(map.get("date")!=null){ | ||
| 406 | - date=map.get("date").toString(); | ||
| 407 | - } | ||
| 408 | - String date2=""; | ||
| 409 | - if(map.get("date2")!=null){ | ||
| 410 | - date2=map.get("date2").toString(); | ||
| 411 | - } | ||
| 412 | - String xlName=""; | ||
| 413 | - if(map.get("xlName")!=null){ | ||
| 414 | - xlName=map.get("xlName").toString(); | ||
| 415 | - } | ||
| 416 | - String type=""; | ||
| 417 | - if(map.get("type")!=null){ | ||
| 418 | - type=map.get("type").toString(); | ||
| 419 | - } | ||
| 420 | - String nature="0"; | ||
| 421 | - if(map.get("nature")!=null){ | ||
| 422 | - nature=map.get("nature").toString(); | ||
| 423 | - } | ||
| 424 | - return scheduleRealInfoService.statisticsDailyTj(gsdm,fgsdm,line, date,date2, xlName, type,nature); | ||
| 425 | - } | ||
| 426 | - | ||
| 427 | - /* | ||
| 428 | - * 公里修正报表 | ||
| 429 | - */ | ||
| 430 | - @RequestMapping(value="/mileageReportTj") | ||
| 431 | - public List<Map<String,Object>> mileageReport(@RequestParam Map<String, Object> map){ | ||
| 432 | - String gsdm=""; | ||
| 433 | - if(map.get("gsdm")!=null){ | ||
| 434 | - gsdm=map.get("gsdm").toString(); | ||
| 435 | - } | ||
| 436 | - String fgsdm=""; | ||
| 437 | - if(map.get("fgsdm")!=null){ | ||
| 438 | - fgsdm=map.get("fgsdm").toString(); | ||
| 439 | - } | ||
| 440 | - String line=""; | ||
| 441 | - if(map.get("line")!=null){ | ||
| 442 | - line=map.get("line").toString(); | ||
| 443 | - } | ||
| 444 | - String date=""; | ||
| 445 | - if(map.get("date")!=null){ | ||
| 446 | - date=map.get("date").toString(); | ||
| 447 | - } | ||
| 448 | - String date2=""; | ||
| 449 | - if(map.get("date2")!=null){ | ||
| 450 | - date2=map.get("date2").toString(); | ||
| 451 | - } | ||
| 452 | - String xlName=""; | ||
| 453 | - if(map.get("xlName")!=null){ | ||
| 454 | - xlName=map.get("xlName").toString(); | ||
| 455 | - } | ||
| 456 | - return scheduleRealInfoService.mileageReport(gsdm,fgsdm,line, date,date2); | ||
| 457 | - } | ||
| 458 | - | ||
| 459 | - /* | ||
| 460 | - * 班次修正报表 | ||
| 461 | - */ | ||
| 462 | - @RequestMapping(value="/scheduleCorrectionReport") | ||
| 463 | - public List<Map<String,Object>> scheduleCorrectionReport(@RequestParam Map<String, Object> map){ | ||
| 464 | - String gsdm=""; | ||
| 465 | - if(map.get("gsdm")!=null){ | ||
| 466 | - gsdm=map.get("gsdm").toString(); | ||
| 467 | - } | ||
| 468 | - String fgsdm=""; | ||
| 469 | - if(map.get("fgsdm")!=null){ | ||
| 470 | - fgsdm=map.get("fgsdm").toString(); | ||
| 471 | - } | ||
| 472 | - String line=""; | ||
| 473 | - if(map.get("line")!=null){ | ||
| 474 | - line=map.get("line").toString(); | ||
| 475 | - } | ||
| 476 | - String date=""; | ||
| 477 | - if(map.get("date")!=null){ | ||
| 478 | - date=map.get("date").toString(); | ||
| 479 | - } | ||
| 480 | - String date2=""; | ||
| 481 | - if(map.get("date2")!=null){ | ||
| 482 | - date2=map.get("date2").toString(); | ||
| 483 | - } | ||
| 484 | - String xlName=""; | ||
| 485 | - if(map.get("xlName")!=null){ | ||
| 486 | - xlName=map.get("xlName").toString(); | ||
| 487 | - } | ||
| 488 | - return scheduleRealInfoService.scheduleCorrectionReport(gsdm,fgsdm,line, date,date2); | ||
| 489 | - } | ||
| 490 | - | ||
| 491 | - @RequestMapping(value="/MapById",method = RequestMethod.GET) | ||
| 492 | - public Map<String, Object> MapById(@RequestParam("id") Long id){ | ||
| 493 | - return scheduleRealInfoService.MapById(id); | ||
| 494 | - } | ||
| 495 | - | ||
| 496 | - @RequestMapping(value="/MapByIdQp",method = RequestMethod.GET) | ||
| 497 | - public Map<String, Object> MapByIdQp(@RequestParam("id") Long id){ | ||
| 498 | - return scheduleRealInfoService.MapByIdQp(id); | ||
| 499 | - } | ||
| 500 | - | ||
| 501 | - /** | ||
| 502 | - * @Title: scheduleDaily | ||
| 503 | - * @Description: TODO(调度日报表) | ||
| 504 | - * @param line 线路 | ||
| 505 | - * @param date 时间 | ||
| 506 | - * @return | ||
| 507 | - */ | ||
| 508 | - @RequestMapping(value="/scheduleDaily") | ||
| 509 | - public Map<String,Object> scheduleDaily(@RequestParam String line,@RequestParam String date){ | ||
| 510 | - return scheduleRealInfoService.scheduleDaily(line,date); | ||
| 511 | - } | ||
| 512 | - | ||
| 513 | - @RequestMapping(value="/realScheduleList") | ||
| 514 | - public List<ScheduleRealInfo> realScheduleList(@RequestParam String line,@RequestParam String date){ | ||
| 515 | - return scheduleRealInfoService.realScheduleList(line,date); | ||
| 516 | - } | ||
| 517 | - | ||
| 518 | - @RequestMapping(value="/realScheduleList_zrw") | ||
| 519 | - public List<ScheduleRealInfo> realScheduleList_zrw(@RequestParam String line,@RequestParam String date){ | ||
| 520 | - return scheduleRealInfoService.realScheduleList_zrw(line,date); | ||
| 521 | - } | ||
| 522 | - | ||
| 523 | - @RequestMapping(value="/realScheduleList_mh_2") | ||
| 524 | - public List<ScheduleRealInfo> realScheduleList_mh_2(@RequestParam String line,@RequestParam String date){ | ||
| 525 | - return scheduleRealInfoService.realScheduleList_mh_2(line,date); | ||
| 526 | - } | ||
| 527 | - | ||
| 528 | - @RequestMapping(value="/realScheduleListQp") | ||
| 529 | - public List<ScheduleRealInfo> realScheduleListQp(@RequestParam String line,@RequestParam String date){ | ||
| 530 | - return scheduleRealInfoService.realScheduleListQp(line,date); | ||
| 531 | - } | ||
| 532 | - | ||
| 533 | - @RequestMapping(value="/multi_tzrc", method=RequestMethod.POST) | ||
| 534 | - public Map<String, Object> multi_tzrc(@RequestParam String cpcsJson){ | ||
| 535 | - cpcsJson = StringEscapeUtils.unescapeHtml4(cpcsJson); | ||
| 536 | - List<ChangePersonCar> cpcs = JSONArray.parseArray(cpcsJson, ChangePersonCar.class); | ||
| 537 | - return scheduleRealInfoService.multi_tzrc(cpcs, null); | ||
| 538 | - } | ||
| 539 | - | ||
| 540 | - @RequestMapping(value="/multi_dftz", method=RequestMethod.POST) | ||
| 541 | - public Map<String, Object> multi_dftz(@RequestParam String dcsJson){ | ||
| 542 | - dcsJson = StringEscapeUtils.unescapeHtml4(dcsJson); | ||
| 543 | - List<DfsjChange> dfsjcs = JSONArray.parseArray(dcsJson, DfsjChange.class); | ||
| 544 | - return scheduleRealInfoService.multi_dftz(dfsjcs); | ||
| 545 | - } | ||
| 546 | - | ||
| 547 | - @RequestMapping(value="/changeBcType/{id}", method=RequestMethod.POST) | ||
| 548 | - public Map<String, Object> changeBcType(@PathVariable("id") Long id, String bcType, String remarks, String majorStationName){ | ||
| 549 | - return scheduleRealInfoService.changeBcType(id, bcType, remarks, majorStationName); | ||
| 550 | - } | ||
| 551 | - | ||
| 552 | - @RequestMapping(value="/history", method=RequestMethod.POST) | ||
| 553 | - public Map<String,Object> historySave(ScheduleRealInfo sch){ | ||
| 554 | - return scheduleRealInfoService.historySave(sch); | ||
| 555 | - } | ||
| 556 | - | ||
| 557 | - | ||
| 558 | - private static DateTimeFormatter fmtyyyyMMdd = DateTimeFormat.forPattern("yyyy-MM-dd"); | ||
| 559 | - private final static long ONE_DAY = 1000 * 60 * 60 * 24; | ||
| 560 | - /** | ||
| 561 | - * 获取可编辑的历史班次日期 | ||
| 562 | - * @return | ||
| 563 | - */ | ||
| 564 | - @RequestMapping("dateArray") | ||
| 565 | - public List<String> dateArray(@RequestParam(defaultValue = "0") int c){ | ||
| 566 | - List<String> rs = new ArrayList<>(); | ||
| 567 | - | ||
| 568 | - long t = System.currentTimeMillis(); | ||
| 569 | - if(c != 1) | ||
| 570 | - t -= (ONE_DAY + (1000 * 60 * 60 * 6)); | ||
| 571 | - for(int i = 0; i < 3; i ++){ | ||
| 572 | - rs.add(fmtyyyyMMdd.print(t)); | ||
| 573 | - t -= ONE_DAY; | ||
| 574 | - } | ||
| 575 | - return rs; | ||
| 576 | - } | ||
| 577 | - | ||
| 578 | - @RequestMapping(value = "svgAttr", method = RequestMethod.POST) | ||
| 579 | - public Map<String, Object> svgAttr(@RequestParam String jsonStr){ | ||
| 580 | - return scheduleRealInfoService.svgAttr(jsonStr); | ||
| 581 | - } | ||
| 582 | - | ||
| 583 | - @RequestMapping(value = "svgAttr", method = RequestMethod.GET) | ||
| 584 | - public Map<String, Object> findSvgAttr(@RequestParam String idx){ | ||
| 585 | - return scheduleRealInfoService.findSvgAttr(idx); | ||
| 586 | - } | ||
| 587 | - | ||
| 588 | - @RequestMapping(value = "addRemarks", method = RequestMethod.POST) | ||
| 589 | - public Map<String, Object> addRemarks(@RequestParam Long id, @RequestParam String remarks){ | ||
| 590 | - return scheduleRealInfoService.addRemarks(id, remarks); | ||
| 591 | - } | ||
| 592 | - | ||
| 593 | - @RequestMapping(value = "scheduleDailyQp", method = RequestMethod.GET) | ||
| 594 | - public List<Map<String, Object>> scheduleDailyQp(@RequestParam String line,@RequestParam String date){ | ||
| 595 | - return scheduleRealInfoService.scheduleDailyQp(line,date); | ||
| 596 | - } | ||
| 597 | - | ||
| 598 | - @RequestMapping(value = "scheduleDailyExport", method = RequestMethod.GET) | ||
| 599 | - public List<Map<String, Object>> scheduleDailyExport(@RequestParam Map<String, Object> map){ | ||
| 600 | - return scheduleRealInfoService.scheduleDailyExport(map); | ||
| 601 | - } | ||
| 602 | - | ||
| 603 | - @RequestMapping(value = "exportWaybillMore", method = RequestMethod.GET) | ||
| 604 | - public Map<String, Object> exportWaybillMore(@RequestParam Map<String, Object> map){ | ||
| 605 | - return scheduleRealInfoService.exportWaybillMore(map); | ||
| 606 | - } | ||
| 607 | - | ||
| 608 | - /** | ||
| 609 | - * 获取当日计划排班 , 从计划表抓取数据 | ||
| 610 | - * @return | ||
| 611 | - */ | ||
| 612 | - @RequestMapping(value = "currSchedulePlanByLineCode", method = RequestMethod.GET) | ||
| 613 | - public List<SchedulePlanInfo> currentSchedulePlan(@RequestParam String lineCode){ | ||
| 614 | - return scheduleRealInfoService.currentSchedulePlan(lineCode); | ||
| 615 | - } | ||
| 616 | - | ||
| 617 | - @RequestMapping(value = "lpChangeMulti", method = RequestMethod.POST) | ||
| 618 | - public Map<String, Object> lpChangeMulti(@RequestParam String leftIdx, @RequestParam String rightIdx,@RequestParam int type){ | ||
| 619 | - return scheduleRealInfoService.lpChangeMulti(leftIdx, rightIdx, type); | ||
| 620 | - } | ||
| 621 | - | ||
| 622 | - /** | ||
| 623 | - * 删除当日实际排班 | ||
| 624 | - * @return | ||
| 625 | - */ | ||
| 626 | - @RequestMapping(value = "deleteRealSchedule", method = RequestMethod.POST) | ||
| 627 | - public Map<String, Object> deleteRealSchedule(@RequestParam String lineCode){ | ||
| 628 | - return dayOfSchedule.deleteRealSchedule(lineCode); | ||
| 629 | - } | ||
| 630 | - | ||
| 631 | - /** | ||
| 632 | - * 从计划表重新加载当日排班 | ||
| 633 | - * @param lineCode | ||
| 634 | - * @return | ||
| 635 | - */ | ||
| 636 | - @RequestMapping(value = "reLoadRealSchedule", method = RequestMethod.POST) | ||
| 637 | - public Map<String, Object> reLoadRealSchedule(@RequestParam String lineCode){ | ||
| 638 | - Map<String, Object> rs = new HashMap<>(); | ||
| 639 | - List<ScheduleRealInfo> list = dayOfSchedule.findByLineCode(lineCode); | ||
| 640 | - if(list != null && list.size() > 0){ | ||
| 641 | - rs.put("status", ResponseCode.ERROR); | ||
| 642 | - rs.put("msg", "失败," + list.get(0).getXlName() + "当日存在实际排班,无法重新加载。"); | ||
| 643 | - return rs; | ||
| 644 | - } | ||
| 645 | - | ||
| 646 | - int code = dayOfSchedule.reloadSch(lineCode); | ||
| 647 | - | ||
| 648 | - //重新按公司编码索引数据 | ||
| 649 | - dayOfSchedule.groupByGsbm(); | ||
| 650 | - rs.put("status", code==0? ResponseCode.SUCCESS: ResponseCode.ERROR); | ||
| 651 | - return rs; | ||
| 652 | - } | ||
| 653 | - | ||
| 654 | - /** | ||
| 655 | - * 误点调整 | ||
| 656 | - * @param idx | ||
| 657 | - * @param minute | ||
| 658 | - * @return | ||
| 659 | - */ | ||
| 660 | - @RequestMapping(value = "lateAdjust", method = RequestMethod.POST) | ||
| 661 | - public Map<String, Object> lateAdjust(@RequestParam String idx,@RequestParam float minute ){ | ||
| 662 | - return scheduleRealInfoService.lateAdjust(idx, minute); | ||
| 663 | - } | ||
| 664 | - | ||
| 665 | - /** | ||
| 666 | - * 获取所有应发未到的班次 | ||
| 667 | - * @param idx | ||
| 668 | - * @return | ||
| 669 | - */ | ||
| 670 | - @RequestMapping(value = "allLate2") | ||
| 671 | - public List<ScheduleRealInfo> allLate2(@RequestParam String idx){ | ||
| 672 | - return scheduleRealInfoService.allLate2(idx); | ||
| 673 | - } | ||
| 674 | - | ||
| 675 | - /** | ||
| 676 | - * 添加一个临加到历史库 | ||
| 677 | - * @param sch | ||
| 678 | - * @return | ||
| 679 | - */ | ||
| 680 | - @RequestMapping(value = "history/add", method = RequestMethod.POST) | ||
| 681 | - public Map<String, Object> addToHistory(ScheduleRealInfo sch){ | ||
| 682 | - return scheduleRealInfoService.addToHistory(sch); | ||
| 683 | - } | ||
| 684 | - | ||
| 685 | - /** | ||
| 686 | - * 从历史库里删除临加班次 | ||
| 687 | - * @param sch | ||
| 688 | - * @return | ||
| 689 | - */ | ||
| 690 | - @RequestMapping(value = "history/{id}", method = RequestMethod.DELETE) | ||
| 691 | - public Map<String, Object> deleteToHistory(@PathVariable("id") Long id){ | ||
| 692 | - return scheduleRealInfoService.deleteToHistory(id); | ||
| 693 | - } | ||
| 694 | - @RequestMapping(value = "isCircleQdz", method = RequestMethod.POST) | ||
| 695 | - public Map<String, Object> isCircleQdz(@RequestParam String line, String nbbm, String ts, String qdzCode){ | ||
| 696 | - Map<String, Object> map =new HashMap<>(); | ||
| 697 | - map.put("isExist",scheduleRealInfoService.isCircleQdz(nbbm, ts, line, qdzCode)); | ||
| 698 | - return map; | ||
| 699 | - } | ||
| 700 | -} | 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/controller/report/CalcSheetController.java
| @@ -42,4 +42,11 @@ public class CalcSheetController extends BaseController<CalcSheet, Integer>{ | @@ -42,4 +42,11 @@ public class CalcSheetController extends BaseController<CalcSheet, Integer>{ | ||
| 42 | List<Map<String, Object>> list=calcSheetService.calcTurnoutrate(map); | 42 | List<Map<String, Object>> list=calcSheetService.calcTurnoutrate(map); |
| 43 | return list; | 43 | return list; |
| 44 | } | 44 | } |
| 45 | + | ||
| 46 | + | ||
| 47 | + @RequestMapping(value = "/calcTurnoutrateZgf",method = RequestMethod.GET) | ||
| 48 | + public List<Map<String, Object>> calcTurnoutrateZgf(@RequestParam Map<String, Object> map){ | ||
| 49 | + List<Map<String, Object>> list=calcSheetService.calcTurnoutrateZgf(map); | ||
| 50 | + return list; | ||
| 51 | + } | ||
| 45 | } | 52 | } |
src/main/java/com/bsth/controller/report/ReportController.java
| @@ -19,6 +19,7 @@ import com.alibaba.fastjson.JSONObject; | @@ -19,6 +19,7 @@ import com.alibaba.fastjson.JSONObject; | ||
| 19 | import com.bsth.data.BasicData; | 19 | import com.bsth.data.BasicData; |
| 20 | import com.bsth.entity.StationRoute; | 20 | import com.bsth.entity.StationRoute; |
| 21 | import com.bsth.entity.excep.ArrivalInfo; | 21 | import com.bsth.entity.excep.ArrivalInfo; |
| 22 | +import com.bsth.entity.mcy_forms.Singledata; | ||
| 22 | import com.bsth.entity.realcontrol.ScheduleRealInfo; | 23 | import com.bsth.entity.realcontrol.ScheduleRealInfo; |
| 23 | import com.bsth.service.report.ReportService; | 24 | import com.bsth.service.report.ReportService; |
| 24 | import com.bsth.util.ReportUtils; | 25 | import com.bsth.util.ReportUtils; |
| @@ -357,10 +358,17 @@ public class ReportController { | @@ -357,10 +358,17 @@ public class ReportController { | ||
| 357 | 358 | ||
| 358 | return lMap; | 359 | return lMap; |
| 359 | } | 360 | } |
| 360 | - | ||
| 361 | - | ||
| 362 | @RequestMapping(value="/online") | 361 | @RequestMapping(value="/online") |
| 363 | public Map<String, Object> online(@RequestParam Map<String, Object> map){ | 362 | public Map<String, Object> online(@RequestParam Map<String, Object> map){ |
| 364 | return service.online(map); | 363 | return service.online(map); |
| 365 | } | 364 | } |
| 365 | + | ||
| 366 | + | ||
| 367 | + | ||
| 368 | + @RequestMapping(value = "/singledatatj", method = RequestMethod.GET) | ||
| 369 | + public List<Singledata> singledatatj(@RequestParam Map<String, Object> map) { | ||
| 370 | + | ||
| 371 | + return service.singledatatj(map); | ||
| 372 | + } | ||
| 373 | + | ||
| 366 | } | 374 | } |
src/main/java/com/bsth/data/BasicData.java
| @@ -55,6 +55,7 @@ public class BasicData { | @@ -55,6 +55,7 @@ public class BasicData { | ||
| 55 | //线路编码和名称对照 | 55 | //线路编码和名称对照 |
| 56 | public static Map<String, String> lineCode2NameMap; | 56 | public static Map<String, String> lineCode2NameMap; |
| 57 | 57 | ||
| 58 | + public static Map<String, String> lineCodeAllNameMap; | ||
| 58 | //停车场 | 59 | //停车场 |
| 59 | public static List<String> parkCodeList; | 60 | public static List<String> parkCodeList; |
| 60 | 61 | ||
| @@ -315,6 +316,14 @@ public class BasicData { | @@ -315,6 +316,14 @@ public class BasicData { | ||
| 315 | lineId2ShangHaiCodeMap = id2SHcode; | 316 | lineId2ShangHaiCodeMap = id2SHcode; |
| 316 | lineCode2ShangHaiCodeMap = code2SHcode; | 317 | lineCode2ShangHaiCodeMap = code2SHcode; |
| 317 | stationName2YgcNumber = tempStationName2YgcNumber; | 318 | stationName2YgcNumber = tempStationName2YgcNumber; |
| 319 | + | ||
| 320 | + Map<String, String> code2nameAll = new HashMap<>(); | ||
| 321 | + Iterator<Line> iteratorAll = lineRepository.findAll().iterator(); | ||
| 322 | + while (iteratorAll.hasNext()) { | ||
| 323 | + line = iteratorAll.next(); | ||
| 324 | + code2nameAll.put(line.getLineCode(), line.getName()); | ||
| 325 | + } | ||
| 326 | + lineCodeAllNameMap=code2nameAll; | ||
| 318 | } | 327 | } |
| 319 | 328 | ||
| 320 | /** | 329 | /** |
src/main/java/com/bsth/data/gpsdata_v2/handlers/InStationProcess.java
| @@ -121,7 +121,7 @@ public class InStationProcess { | @@ -121,7 +121,7 @@ public class InStationProcess { | ||
| 121 | private void inEndStation(ScheduleRealInfo sch, GpsEntity gps) { | 121 | private void inEndStation(ScheduleRealInfo sch, GpsEntity gps) { |
| 122 | String nbbm = sch.getClZbh(); | 122 | String nbbm = sch.getClZbh(); |
| 123 | //校验进站前置约束 | 123 | //校验进站前置约束 |
| 124 | - if (!validInPremise(gps)) | 124 | + if (!validInPremise(gps) && isNormalSch(sch)) |
| 125 | return; | 125 | return; |
| 126 | 126 | ||
| 127 | //实达时间不覆盖 | 127 | //实达时间不覆盖 |
src/main/java/com/bsth/data/gpsdata_v2/handlers/OutStationProcess.java
| @@ -74,7 +74,7 @@ public class OutStationProcess { | @@ -74,7 +74,7 @@ public class OutStationProcess { | ||
| 74 | * @param gps | 74 | * @param gps |
| 75 | */ | 75 | */ |
| 76 | private void outStation(GpsEntity gps, GpsEntity prev) { | 76 | private void outStation(GpsEntity gps, GpsEntity prev) { |
| 77 | - logger.info("进站记录(到达时间:" + gps.getArrTime() + " 进出站状态:" + gps.getInstation() + " 站点编号:" + gps.getStopNo() + " deviceId:" + gps.getDeviceId() + " nbbm:" + gps.getNbbm() + ")"); | 77 | + logger.info("出站记录(到达时间:" + gps.getArrTime() + " 进出站状态:" + gps.getInstation() + " 站点编号:" + gps.getStopNo() + " deviceId:" + gps.getDeviceId() + " nbbm:" + gps.getNbbm() + ")"); |
| 78 | ScheduleRealInfo sch = dayOfSchedule.executeCurr(gps.getNbbm()); | 78 | ScheduleRealInfo sch = dayOfSchedule.executeCurr(gps.getNbbm()); |
| 79 | 79 | ||
| 80 | //起点发车 | 80 | //起点发车 |
src/main/java/com/bsth/data/schedule/thread/CalcOilThread.java
| @@ -44,7 +44,7 @@ public class CalcOilThread extends Thread{ | @@ -44,7 +44,7 @@ public class CalcOilThread extends Thread{ | ||
| 44 | dlbService.obtainDsq(); | 44 | dlbService.obtainDsq(); |
| 45 | logger.info("计算路单里程加注量结束!"); | 45 | logger.info("计算路单里程加注量结束!"); |
| 46 | logger.info("开始计算班次准点率...."); | 46 | logger.info("开始计算班次准点率...."); |
| 47 | - sheetService.saveSheetList(""); | 47 | + //sheetService.saveSheetList(""); |
| 48 | logger.info("计算班次准点率结束!"); | 48 | logger.info("计算班次准点率结束!"); |
| 49 | 49 | ||
| 50 | logger.info("开始保存重新统计数据...."); | 50 | logger.info("开始保存重新统计数据...."); |
src/main/java/com/bsth/entity/mcy_forms/Shifday.java
| @@ -35,6 +35,8 @@ public class Shifday { | @@ -35,6 +35,8 @@ public class Shifday { | ||
| 35 | private String sjbc;//实际班次 | 35 | private String sjbc;//实际班次 |
| 36 | 36 | ||
| 37 | private String jgh; | 37 | private String jgh; |
| 38 | + | ||
| 39 | + private String sgh; | ||
| 38 | 40 | ||
| 39 | private String zbh; | 41 | private String zbh; |
| 40 | 42 | ||
| @@ -56,6 +58,14 @@ public class Shifday { | @@ -56,6 +58,14 @@ public class Shifday { | ||
| 56 | this.jgh = jgh; | 58 | this.jgh = jgh; |
| 57 | } | 59 | } |
| 58 | 60 | ||
| 61 | + public String getSgh() { | ||
| 62 | + return sgh; | ||
| 63 | + } | ||
| 64 | + | ||
| 65 | + public void setSgh(String sgh) { | ||
| 66 | + this.sgh = sgh; | ||
| 67 | + } | ||
| 68 | + | ||
| 59 | public String getZbh() { | 69 | public String getZbh() { |
| 60 | return zbh; | 70 | return zbh; |
| 61 | } | 71 | } |
src/main/java/com/bsth/entity/oil/Dlb.java
| @@ -22,6 +22,7 @@ public class Dlb { | @@ -22,6 +22,7 @@ public class Dlb { | ||
| 22 | @DateTimeFormat(pattern="yyyy-MM-dd") | 22 | @DateTimeFormat(pattern="yyyy-MM-dd") |
| 23 | private Date rq; | 23 | private Date rq; |
| 24 | private String xlbm; | 24 | private String xlbm; |
| 25 | + private String linename; | ||
| 25 | private String ssgsdm; | 26 | private String ssgsdm; |
| 26 | private String fgsdm; | 27 | private String fgsdm; |
| 27 | private String nbbm; | 28 | private String nbbm; |
| @@ -102,6 +103,14 @@ public class Dlb { | @@ -102,6 +103,14 @@ public class Dlb { | ||
| 102 | this.xlbm = xlbm; | 103 | this.xlbm = xlbm; |
| 103 | } | 104 | } |
| 104 | 105 | ||
| 106 | + public String getLinename() { | ||
| 107 | + return linename; | ||
| 108 | + } | ||
| 109 | + | ||
| 110 | + public void setLinename(String linename) { | ||
| 111 | + this.linename = linename; | ||
| 112 | + } | ||
| 113 | + | ||
| 105 | public String getSsgsdm() { | 114 | public String getSsgsdm() { |
| 106 | return ssgsdm; | 115 | return ssgsdm; |
| 107 | } | 116 | } |
| @@ -348,7 +357,7 @@ public class Dlb { | @@ -348,7 +357,7 @@ public class Dlb { | ||
| 348 | } | 357 | } |
| 349 | 358 | ||
| 350 | public String getXlname() { | 359 | public String getXlname() { |
| 351 | - return BasicData.lineCode2NameMap.get(this.xlbm); | 360 | + return BasicData.lineCodeAllNameMap.get(this.xlbm); |
| 352 | } | 361 | } |
| 353 | 362 | ||
| 354 | public void setXlname(String xlname) { | 363 | public void setXlname(String xlname) { |
src/main/java/com/bsth/entity/oil/Ylb.java
| @@ -22,6 +22,7 @@ public class Ylb { | @@ -22,6 +22,7 @@ public class Ylb { | ||
| 22 | @DateTimeFormat(pattern="yyyy-MM-dd") | 22 | @DateTimeFormat(pattern="yyyy-MM-dd") |
| 23 | private Date rq; | 23 | private Date rq; |
| 24 | private String xlbm; | 24 | private String xlbm; |
| 25 | + private String linename; | ||
| 25 | private String ssgsdm; | 26 | private String ssgsdm; |
| 26 | private String fgsdm; | 27 | private String fgsdm; |
| 27 | private String nbbm; | 28 | private String nbbm; |
| @@ -95,6 +96,15 @@ public class Ylb { | @@ -95,6 +96,15 @@ public class Ylb { | ||
| 95 | public void setXlbm(String xlbm) { | 96 | public void setXlbm(String xlbm) { |
| 96 | this.xlbm = xlbm; | 97 | this.xlbm = xlbm; |
| 97 | } | 98 | } |
| 99 | + | ||
| 100 | + public String getLinename() { | ||
| 101 | + return linename; | ||
| 102 | + } | ||
| 103 | + | ||
| 104 | + public void setLinename(String linename) { | ||
| 105 | + this.linename = linename; | ||
| 106 | + } | ||
| 107 | + | ||
| 98 | public String getSsgsdm() { | 108 | public String getSsgsdm() { |
| 99 | return ssgsdm; | 109 | return ssgsdm; |
| 100 | } | 110 | } |
| @@ -292,7 +302,7 @@ public class Ylb { | @@ -292,7 +302,7 @@ public class Ylb { | ||
| 292 | } | 302 | } |
| 293 | 303 | ||
| 294 | public String getXlname() { | 304 | public String getXlname() { |
| 295 | - return BasicData.lineCode2NameMap.get(this.xlbm); | 305 | + return BasicData.lineCodeAllNameMap.get(this.xlbm); |
| 296 | } | 306 | } |
| 297 | 307 | ||
| 298 | public void setXlname(String xlname) { | 308 | public void setXlname(String xlname) { |
src/main/java/com/bsth/entity/sheet/CalcSheet.java
| @@ -49,6 +49,8 @@ public class CalcSheet { | @@ -49,6 +49,8 @@ public class CalcSheet { | ||
| 49 | private String sjbcs; | 49 | private String sjbcs; |
| 50 | /*临加班次数*/ | 50 | /*临加班次数*/ |
| 51 | private String ljbcs; | 51 | private String ljbcs; |
| 52 | + /*计划发车早高峰*/ | ||
| 53 | + private String jhcczgf; | ||
| 52 | /*公司名字*/ | 54 | /*公司名字*/ |
| 53 | @Transient | 55 | @Transient |
| 54 | private String gsname; | 56 | private String gsname; |
| @@ -173,6 +175,12 @@ public class CalcSheet { | @@ -173,6 +175,12 @@ public class CalcSheet { | ||
| 173 | } | 175 | } |
| 174 | 176 | ||
| 175 | 177 | ||
| 178 | + public String getJhcczgf() { | ||
| 179 | + return jhcczgf; | ||
| 180 | + } | ||
| 181 | + public void setJhcczgf(String jhcczgf) { | ||
| 182 | + this.jhcczgf = jhcczgf; | ||
| 183 | + } | ||
| 176 | public String getFgsname() { | 184 | public String getFgsname() { |
| 177 | return BasicData.businessFgsCodeNameMap.get(this.fgsdm+"_"+this.gsdm); | 185 | return BasicData.businessFgsCodeNameMap.get(this.fgsdm+"_"+this.gsdm); |
| 178 | } | 186 | } |
src/main/java/com/bsth/filter/AccessLogFilter.java
| @@ -58,9 +58,11 @@ public class AccessLogFilter extends BaseFilter { | @@ -58,9 +58,11 @@ public class AccessLogFilter extends BaseFilter { | ||
| 58 | s.append(getBlock(params)); | 58 | s.append(getBlock(params)); |
| 59 | s.append(getBlock(headers)); | 59 | s.append(getBlock(headers)); |
| 60 | s.append(getBlock(request.getHeader("Referer"))); | 60 | s.append(getBlock(request.getHeader("Referer"))); |
| 61 | - | ||
| 62 | - logger.info(s.toString()); | 61 | + |
| 62 | + long now = System.currentTimeMillis(); | ||
| 63 | chain.doFilter(request, response); | 63 | chain.doFilter(request, response); |
| 64 | + s.append("<cost time:").append(System.currentTimeMillis() - now).append(">"); | ||
| 65 | + logger.info(s.toString()); | ||
| 64 | } | 66 | } |
| 65 | 67 | ||
| 66 | private static String getParams(HttpServletRequest request) { | 68 | private static String getParams(HttpServletRequest request) { |
src/main/java/com/bsth/repository/LineRepository.java
| @@ -51,6 +51,8 @@ public interface LineRepository extends BaseRepository<Line, Integer> { | @@ -51,6 +51,8 @@ public interface LineRepository extends BaseRepository<Line, Integer> { | ||
| 51 | @Query("SELECT L FROM Line L where L.destroy=0 and L.remove !=1") | 51 | @Query("SELECT L FROM Line L where L.destroy=0 and L.remove !=1") |
| 52 | List<Line> findAllService(); | 52 | List<Line> findAllService(); |
| 53 | 53 | ||
| 54 | + @Query("SELECT L FROM Line L") | ||
| 55 | + List<Line> findAll(); | ||
| 54 | 56 | ||
| 55 | @Modifying | 57 | @Modifying |
| 56 | @Query(value = "UPDATE Line l set l.name=?1 , l.company=?2, l.brancheCompany=?3, " | 58 | @Query(value = "UPDATE Line l set l.name=?1 , l.company=?2, l.brancheCompany=?3, " |
src/main/java/com/bsth/repository/calc/CalcWaybillRepository.java
| @@ -58,4 +58,15 @@ public interface CalcWaybillRepository extends BaseRepository<CalcWaybill, Integ | @@ -58,4 +58,15 @@ public interface CalcWaybillRepository extends BaseRepository<CalcWaybill, Integ | ||
| 58 | @Query("select DISTINCT s from ScheduleRealInfo s where s.scheduleDateStr=?1") | 58 | @Query("select DISTINCT s from ScheduleRealInfo s where s.scheduleDateStr=?1") |
| 59 | List<ScheduleRealInfo> findAllScheduleByDate(String schDate); | 59 | List<ScheduleRealInfo> findAllScheduleByDate(String schDate); |
| 60 | 60 | ||
| 61 | + | ||
| 62 | + //按照时间段统计,公司下线路 (驾驶员) | ||
| 63 | + @Query(value="select DISTINCT c from CalcWaybill c where c.xl like %?1% and c.rqStr between ?2 and ?3 and c.gsdm like %?4% and c.fgsdm like %?5% and CONCAT(jGh,'/',jName) like %?6% order by c.xl") | ||
| 64 | + List<CalcWaybill> scheduleByJsy(String line,String date,String date2,String gsdm,String fgsdm,String jsy); | ||
| 65 | + //按照时间段统计,公司下线路 (售票员) | ||
| 66 | + @Query(value="select DISTINCT c from CalcWaybill c where c.xl like %?1% and c.rqStr between ?2 and ?3 and c.gsdm like %?4% and c.fgsdm like %?5% and CONCAT(sGh,'/',sName) like %?6% order by c.xl") | ||
| 67 | + List<CalcWaybill> scheduleBySpy(String line,String date,String date2,String gsdm,String fgsdm,String spy); | ||
| 68 | + //按照时间段统计,公司下线路 (车辆自编号) | ||
| 69 | + @Query(value="select DISTINCT c from CalcWaybill c where c.xl like %?1% and c.rqStr between ?2 and ?3 and c.gsdm like %?4% and c.fgsdm like %?5% and cl like %?6% order by c.xl") | ||
| 70 | + List<CalcWaybill> scheduleByZbh(String line,String date,String date2,String gsdm,String fgsdm,String zbh); | ||
| 71 | + | ||
| 61 | } | 72 | } |
src/main/java/com/bsth/repository/oil/CwjyRepository.java
| @@ -22,8 +22,8 @@ public interface CwjyRepository extends BaseRepository<Cwjy, Integer>{ | @@ -22,8 +22,8 @@ public interface CwjyRepository extends BaseRepository<Cwjy, Integer>{ | ||
| 22 | */ | 22 | */ |
| 23 | @Query(value="SELECT a.gsdm as gsdm,a.nbbm as nbbm,b.jsy as jsy,b.jzl as jzl ,b.stationid as stationid," | 23 | @Query(value="SELECT a.gsdm as gsdm,a.nbbm as nbbm,b.jsy as jsy,b.jzl as jzl ,b.stationid as stationid," |
| 24 | + "b.nylx as nylx,b.yj as yj,b.bz as bz,c.jsy as ldgh FROM bsth_c_cwjy a "+ | 24 | + "b.nylx as nylx,b.yj as yj,b.bz as bz,c.jsy as ldgh FROM bsth_c_cwjy a "+ |
| 25 | - " left join ( select * from bsth_c_ylxxb b where to_days(b.yyrq)=to_days(?1) and jylx=1) b " + | ||
| 26 | - " on a.nbbm=b.nbbm left join (select nbbm,group_concat(jsy) as jsy from bsth_c_ylb where to_days(rq)= to_days(?1 ) group by nbbm "+ | 25 | + " left join ( select * from bsth_c_ylxxb b where b.yyrq=?1 and jylx=1) b " + |
| 26 | + " on a.nbbm=b.nbbm left join (select nbbm,group_concat(jsy) as jsy from bsth_c_ylb where rq= ?1 group by nbbm "+ | ||
| 27 | " ) c on a.nbbm=c.nbbm where a.nbbm like %?2% ",nativeQuery=true) | 27 | " ) c on a.nbbm=c.nbbm where a.nbbm like %?2% ",nativeQuery=true) |
| 28 | List<Object[]> obtainCwjycl(String rq,String nbbm); | 28 | List<Object[]> obtainCwjycl(String rq,String nbbm); |
| 29 | 29 |
src/main/java/com/bsth/repository/oil/DlbRepository.java
| 1 | package com.bsth.repository.oil; | 1 | package com.bsth.repository.oil; |
| 2 | 2 | ||
| 3 | +import java.util.Date; | ||
| 3 | import java.util.List; | 4 | import java.util.List; |
| 4 | 5 | ||
| 5 | import org.springframework.data.jpa.repository.Modifying; | 6 | import org.springframework.data.jpa.repository.Modifying; |
| @@ -28,19 +29,27 @@ public interface DlbRepository extends BaseRepository<Dlb, Integer>{ | @@ -28,19 +29,27 @@ public interface DlbRepository extends BaseRepository<Dlb, Integer>{ | ||
| 28 | * @param rq | 29 | * @param rq |
| 29 | * @return | 30 | * @return |
| 30 | */ | 31 | */ |
| 31 | - @Query(value="SELECT * FROM bsth_c_dlb where to_days(?1)=to_days(rq) and ssgsdm like %?2% " | 32 | + @Query(value="SELECT * FROM bsth_c_dlb where rq=?1 and ssgsdm like %?2% " |
| 32 | + " and fgsdm like %?3%" | 33 | + " and fgsdm like %?3%" |
| 33 | + " and xlbm like %?4% and nbbm like %?5% order by ?6 asc",nativeQuery=true) | 34 | + " and xlbm like %?4% and nbbm like %?5% order by ?6 asc",nativeQuery=true) |
| 34 | List<Dlb> obtainDl(String rq,String gsbm,String fgsdm,String xlbm,String nbbm,String px); | 35 | List<Dlb> obtainDl(String rq,String gsbm,String fgsdm,String xlbm,String nbbm,String px); |
| 35 | 36 | ||
| 36 | @Query(value="select s from Dlb s " | 37 | @Query(value="select s from Dlb s " |
| 37 | - + " where to_days(?1)=to_days(s.rq) " | 38 | + + " where to_days(s.rq)=to_days(?1) " |
| 38 | + " and s.ssgsdm like %?2% " | 39 | + " and s.ssgsdm like %?2% " |
| 39 | + " and s.fgsdm like %?3%" | 40 | + " and s.fgsdm like %?3%" |
| 40 | + " and s.xlbm like %?4% " | 41 | + " and s.xlbm like %?4% " |
| 41 | + " and s.nbbm in ?5 order by nbbm,jcsx") | 42 | + " and s.nbbm in ?5 order by nbbm,jcsx") |
| 42 | List<Dlb> listDlb(String rq, String gsbm,String fgsbm,String xlbm,List<String> listNbbm); | 43 | List<Dlb> listDlb(String rq, String gsbm,String fgsbm,String xlbm,List<String> listNbbm); |
| 43 | 44 | ||
| 45 | + @Query(value="select s from Dlb s " | ||
| 46 | + + " where s.rq=?1 " | ||
| 47 | + + " and s.ssgsdm like %?2% " | ||
| 48 | + + " and s.fgsdm like %?3%" | ||
| 49 | + + " and s.xlbm like %?4% " | ||
| 50 | + + " and s.nbbm in ?5 order by nbbm,jcsx") | ||
| 51 | + List<Dlb> listDlb_s(Date rq, String gsbm,String fgsbm,String xlbm,List<String> listNbbm); | ||
| 52 | + | ||
| 44 | 53 | ||
| 45 | /** | 54 | /** |
| 46 | * | 55 | * |
| @@ -49,14 +58,14 @@ public interface DlbRepository extends BaseRepository<Dlb, Integer>{ | @@ -49,14 +58,14 @@ public interface DlbRepository extends BaseRepository<Dlb, Integer>{ | ||
| 49 | * @param xlbm | 58 | * @param xlbm |
| 50 | * @return | 59 | * @return |
| 51 | */ | 60 | */ |
| 52 | - @Query(value="select nbbm,count(nbbm) from bsth_c_dlb where to_days(?1)=to_days(rq) and " | 61 | + @Query(value="select nbbm,count(nbbm) from bsth_c_dlb where rq=?1 and " |
| 53 | + " ssgsdm like %?2% " | 62 | + " ssgsdm like %?2% " |
| 54 | + " and fgsdm like %?3%" | 63 | + " and fgsdm like %?3%" |
| 55 | + " and xlbm like %?4% and nbbm like %?5% " | 64 | + " and xlbm like %?4% and nbbm like %?5% " |
| 56 | + " group by nbbm,rq,ssgsdm,fgsdm",nativeQuery=true) | 65 | + " group by nbbm,rq,ssgsdm,fgsdm",nativeQuery=true) |
| 57 | List<Object[]> checkNbmmNum(String rq, String gsbm,String fgsbm,String xlbm,String nbbm); | 66 | List<Object[]> checkNbmmNum(String rq, String gsbm,String fgsbm,String xlbm,String nbbm); |
| 58 | 67 | ||
| 59 | - @Query(value="select nbbm,sum(cdl*100) as cdl ,sum(zlc*100) as zlc from bsth_c_dlb where to_days(?1)=to_days(rq) and " | 68 | + @Query(value="select nbbm,sum(cdl*100) as cdl ,sum(zlc*100) as zlc from bsth_c_dlb where rq= ?1 and " |
| 60 | + " ssgsdm like %?2% " | 69 | + " ssgsdm like %?2% " |
| 61 | + " and fgsdm like %?3%" | 70 | + " and fgsdm like %?3%" |
| 62 | + " and xlbm like %?4% and nbbm like %?5% " | 71 | + " and xlbm like %?4% and nbbm like %?5% " |
| @@ -66,15 +75,24 @@ public interface DlbRepository extends BaseRepository<Dlb, Integer>{ | @@ -66,15 +75,24 @@ public interface DlbRepository extends BaseRepository<Dlb, Integer>{ | ||
| 66 | 75 | ||
| 67 | 76 | ||
| 68 | @Query(value="select cdl,hd,sh from Dlb s " | 77 | @Query(value="select cdl,hd,sh from Dlb s " |
| 69 | - + " where to_days(?1)=to_days(s.rq) " | 78 | + + " where to_days(s.rq)=to_days(?1) " |
| 70 | + " and s.ssgsdm like %?2% " | 79 | + " and s.ssgsdm like %?2% " |
| 71 | + " and s.fgsdm like %?3%" | 80 | + " and s.fgsdm like %?3%" |
| 72 | + " and s.xlbm like %?4% " | 81 | + " and s.xlbm like %?4% " |
| 73 | + " and s.nbbm in ?5 ") | 82 | + " and s.nbbm in ?5 ") |
| 74 | List<Object[]> sumDlb(String rq, String gsbm,String fgsbm,String xlbm,List<String> listNbbm); | 83 | List<Object[]> sumDlb(String rq, String gsbm,String fgsbm,String xlbm,List<String> listNbbm); |
| 75 | 84 | ||
| 85 | + @Query(value="select cdl,hd,sh from Dlb s " | ||
| 86 | + + " where s.rq=?1" | ||
| 87 | + + " and s.ssgsdm like %?2% " | ||
| 88 | + + " and s.fgsdm like %?3%" | ||
| 89 | + + " and s.xlbm like %?4% " | ||
| 90 | + + " and s.nbbm in ?5 ") | ||
| 91 | + List<Object[]> sumDlb_s(Date rq, String gsbm,String fgsbm,String xlbm,List<String> listNbbm); | ||
| 92 | + | ||
| 93 | + | ||
| 76 | @Query(value="select ifnull(cdl,0),ifnull(hd,0),ifnull(sh,0) from bsth_c_dlb " | 94 | @Query(value="select ifnull(cdl,0),ifnull(hd,0),ifnull(sh,0) from bsth_c_dlb " |
| 77 | - + " where to_days(?1)=to_days(rq) " | 95 | + + " where rq=?1 " |
| 78 | + " and ssgsdm like %?2% " | 96 | + " and ssgsdm like %?2% " |
| 79 | + " and fgsdm like %?3%" | 97 | + " and fgsdm like %?3%" |
| 80 | + " and xlbm like %?4% " | 98 | + " and xlbm like %?4% " |
| @@ -93,10 +111,10 @@ public interface DlbRepository extends BaseRepository<Dlb, Integer>{ | @@ -93,10 +111,10 @@ public interface DlbRepository extends BaseRepository<Dlb, Integer>{ | ||
| 93 | " WHERE id = ?1", nativeQuery=true) | 111 | " WHERE id = ?1", nativeQuery=true) |
| 94 | public void dlbUpdate(Integer id,double czcd,double jzcd,double hd, double sh,String shyy,int yhlx); | 112 | public void dlbUpdate(Integer id,double czcd,double jzcd,double hd, double sh,String shyy,int yhlx); |
| 95 | 113 | ||
| 96 | - @Query(value="SELECT * FROM bsth_c_dlb where to_days(?1)=to_days(rq) and nbbm =?2 and jsy=?3 and xlbm=?4",nativeQuery=true) | 114 | + @Query(value="SELECT * FROM bsth_c_dlb where rq=?1 and nbbm =?2 and jsy=?3 and xlbm=?4",nativeQuery=true) |
| 97 | List<Dlb> queryListDlb(String rq,String nbbm,String jgh,String xlbm); | 115 | List<Dlb> queryListDlb(String rq,String nbbm,String jgh,String xlbm); |
| 98 | 116 | ||
| 99 | - @Query(value="SELECT * FROM bsth_c_dlb where to_days(?1)=to_days(rq) and xlbm=?2",nativeQuery=true) | 117 | + @Query(value="SELECT * FROM bsth_c_dlb where rq=?1 and xlbm=?2",nativeQuery=true) |
| 100 | List<Dlb> queryDlbByRqXlbm(String rq, String xlbm); | 118 | List<Dlb> queryDlbByRqXlbm(String rq, String xlbm); |
| 101 | 119 | ||
| 102 | } | 120 | } |
src/main/java/com/bsth/repository/oil/LsylbRepository.java
| @@ -22,7 +22,7 @@ public interface LsylbRepository extends BaseRepository<Lsylb, Integer>{ | @@ -22,7 +22,7 @@ public interface LsylbRepository extends BaseRepository<Lsylb, Integer>{ | ||
| 22 | * @param xlbm | 22 | * @param xlbm |
| 23 | * @return | 23 | * @return |
| 24 | */ | 24 | */ |
| 25 | - @Query(value="select nbbm,count(nbbm) from bsth_ls_ylb where to_days(?1)=to_days(rq) and " | 25 | + @Query(value="select nbbm,count(nbbm) from bsth_ls_ylb where rq=?1 and " |
| 26 | + " ssgsdm like %?2% " | 26 | + " ssgsdm like %?2% " |
| 27 | + " and fgsdm like %?3%" | 27 | + " and fgsdm like %?3%" |
| 28 | + " and xlbm like %?4% and nbbm like %?5% and nylx= ?6 " | 28 | + " and xlbm like %?4% and nbbm like %?5% and nylx= ?6 " |
| @@ -30,7 +30,7 @@ public interface LsylbRepository extends BaseRepository<Lsylb, Integer>{ | @@ -30,7 +30,7 @@ public interface LsylbRepository extends BaseRepository<Lsylb, Integer>{ | ||
| 30 | List<Object[]> checkNbmmNum(String rq, String gsbm,String fgsbm,String xlbm,String nbbm,int nylx); | 30 | List<Object[]> checkNbmmNum(String rq, String gsbm,String fgsbm,String xlbm,String nbbm,int nylx); |
| 31 | 31 | ||
| 32 | @Query(value="select s from Lsylb s " | 32 | @Query(value="select s from Lsylb s " |
| 33 | - + " where to_days(?1)=to_days(s.rq) " | 33 | + + " where to_days(s.rq)=to_days(?1) " |
| 34 | + " and s.ssgsdm =?2 " | 34 | + " and s.ssgsdm =?2 " |
| 35 | + " and s.fgsdm =?3 " | 35 | + " and s.fgsdm =?3 " |
| 36 | + " and s.xlbm like %?4% " | 36 | + " and s.xlbm like %?4% " |
| @@ -38,7 +38,7 @@ public interface LsylbRepository extends BaseRepository<Lsylb, Integer>{ | @@ -38,7 +38,7 @@ public interface LsylbRepository extends BaseRepository<Lsylb, Integer>{ | ||
| 38 | + " and s.nbbm in ?6 order by nbbm,jhsj") | 38 | + " and s.nbbm in ?6 order by nbbm,jhsj") |
| 39 | List<Lsylb> listYlb(String rq, String gsbm,String fgsbm,String xlbm,int nylx,List<String> listNbbm); | 39 | List<Lsylb> listYlb(String rq, String gsbm,String fgsbm,String xlbm,int nylx,List<String> listNbbm); |
| 40 | 40 | ||
| 41 | - @Query(value="select nbbm,sum(jzl*100) as jzl ,sum(zlc*100) as zlc from bsth_ls_ylb where to_days(?1)=to_days(rq) and " | 41 | + @Query(value="select nbbm,sum(jzl*100) as jzl ,sum(zlc*100) as zlc from bsth_ls_ylb where rq=?1 and " |
| 42 | + " ssgsdm like %?2% " | 42 | + " ssgsdm like %?2% " |
| 43 | + " and fgsdm like %?3%" | 43 | + " and fgsdm like %?3%" |
| 44 | + " and xlbm like %?4% and nbbm like %?5% and nylx =?6 " | 44 | + " and xlbm like %?4% and nbbm like %?5% and nylx =?6 " |
| @@ -47,7 +47,7 @@ public interface LsylbRepository extends BaseRepository<Lsylb, Integer>{ | @@ -47,7 +47,7 @@ public interface LsylbRepository extends BaseRepository<Lsylb, Integer>{ | ||
| 47 | 47 | ||
| 48 | 48 | ||
| 49 | @Query(value="select ifnull(jzl,0),ifnull(yh,0),ifnull(sh,0) from bsth_ls_ylb " | 49 | @Query(value="select ifnull(jzl,0),ifnull(yh,0),ifnull(sh,0) from bsth_ls_ylb " |
| 50 | - + " where to_days(?1)=to_days(rq) " | 50 | + + " where rq=?1 " |
| 51 | + " and ssgsdm like %?2% " | 51 | + " and ssgsdm like %?2% " |
| 52 | + " and fgsdm like %?3%" | 52 | + " and fgsdm like %?3%" |
| 53 | + " and xlbm like %?4% " | 53 | + " and xlbm like %?4% " |
| @@ -57,7 +57,7 @@ public interface LsylbRepository extends BaseRepository<Lsylb, Integer>{ | @@ -57,7 +57,7 @@ public interface LsylbRepository extends BaseRepository<Lsylb, Integer>{ | ||
| 57 | 57 | ||
| 58 | 58 | ||
| 59 | @Query(value="select jzl,yh,sh from Lsylb s " | 59 | @Query(value="select jzl,yh,sh from Lsylb s " |
| 60 | - + " where to_days(?1)=to_days(s.rq) " | 60 | + + " where to_days(s.rq)=to_days(?1) " |
| 61 | + " and s.ssgsdm like %?2% " | 61 | + " and s.ssgsdm like %?2% " |
| 62 | + " and s.fgsdm like %?3%" | 62 | + " and s.fgsdm like %?3%" |
| 63 | + " and s.xlbm like %?4% " | 63 | + " and s.xlbm like %?4% " |
src/main/java/com/bsth/repository/oil/YlbRepository.java
| @@ -33,7 +33,7 @@ public interface YlbRepository extends BaseRepository<Ylb, Integer>{ | @@ -33,7 +33,7 @@ public interface YlbRepository extends BaseRepository<Ylb, Integer>{ | ||
| 33 | @Query(value="select y.* from (select max(d.id) as id ,d.nbbm from (" | 33 | @Query(value="select y.* from (select max(d.id) as id ,d.nbbm from (" |
| 34 | + " select b.rq,b.nbbm,max(b.jcsx) as jcsx from (" | 34 | + " select b.rq,b.nbbm,max(b.jcsx) as jcsx from (" |
| 35 | + " select max(t.rq) as rq ,t.nbbm from bsth_c_ylb t " | 35 | + " select max(t.rq) as rq ,t.nbbm from bsth_c_ylb t " |
| 36 | - + " where to_days(t.rq)< to_days(?1) " | 36 | + + " where t.rq< ?1 " |
| 37 | + " and t.ssgsdm like %?2% and t.fgsdm like %?3% " | 37 | + " and t.ssgsdm like %?2% and t.fgsdm like %?3% " |
| 38 | + " and t.xlbm like %?4% and t.nbbm like %?5% group by nbbm ) a " | 38 | + " and t.xlbm like %?4% and t.nbbm like %?5% group by nbbm ) a " |
| 39 | + " left join bsth_c_ylb b on a.rq=b.rq and a.nbbm=b.nbbm " | 39 | + " left join bsth_c_ylb b on a.rq=b.rq and a.nbbm=b.nbbm " |
| @@ -63,29 +63,29 @@ public interface YlbRepository extends BaseRepository<Ylb, Integer>{ | @@ -63,29 +63,29 @@ public interface YlbRepository extends BaseRepository<Ylb, Integer>{ | ||
| 63 | * @param rq | 63 | * @param rq |
| 64 | * @return | 64 | * @return |
| 65 | */ | 65 | */ |
| 66 | - @Query(value="SELECT * FROM bsth_c_ylb where to_days(?1)=to_days(rq) and ssgsdm like %?2% " | 66 | + @Query(value="SELECT * FROM bsth_c_ylb where rq=?1 and ssgsdm like %?2% " |
| 67 | + " and fgsdm like %?3%" | 67 | + " and fgsdm like %?3%" |
| 68 | + " and xlbm like %?4% and nbbm like %?5% order by ?6 asc ",nativeQuery=true) | 68 | + " and xlbm like %?4% and nbbm like %?5% order by ?6 asc ",nativeQuery=true) |
| 69 | List<Ylb> obtainYl(String rq,String gsdm,String fgsdm,String xlbm,String nbbm,String px); | 69 | List<Ylb> obtainYl(String rq,String gsdm,String fgsdm,String xlbm,String nbbm,String px); |
| 70 | 70 | ||
| 71 | - @Query(value="SELECT * FROM bsth_c_ylb where to_days(?1)=to_days(rq) and ssgsdm like %?2% " | 71 | + @Query(value="SELECT * FROM bsth_c_ylb where rq=?1 and ssgsdm like %?2% " |
| 72 | + " and fgsdm like %?3%" | 72 | + " and fgsdm like %?3%" |
| 73 | + " and xlbm = ?4 and nbbm like %?5% order by ?6 asc ",nativeQuery=true) | 73 | + " and xlbm = ?4 and nbbm like %?5% order by ?6 asc ",nativeQuery=true) |
| 74 | List<Ylb> obtainYlEq(String rq,String gsdm,String fgsdm,String xlbm,String nbbm,String px); | 74 | List<Ylb> obtainYlEq(String rq,String gsdm,String fgsdm,String xlbm,String nbbm,String px); |
| 75 | 75 | ||
| 76 | - @Query(value="SELECT * FROM bsth_c_ylb where to_days(?1)=to_days(rq) and ssgsdm like %?2% " | 76 | + @Query(value="SELECT * FROM bsth_c_ylb where rq=?1 and ssgsdm like %?2% " |
| 77 | + " and fgsdm like %?3%" | 77 | + " and fgsdm like %?3%" |
| 78 | + " and xlbm = ?4 and nbbm like %?5% order by ?6 asc ",nativeQuery=true) | 78 | + " and xlbm = ?4 and nbbm like %?5% order by ?6 asc ",nativeQuery=true) |
| 79 | List<Ylb> obtainYl_eq(String rq,String gsdm,String fgsdm,String xlbm,String nbbm,String px); | 79 | List<Ylb> obtainYl_eq(String rq,String gsdm,String fgsdm,String xlbm,String nbbm,String px); |
| 80 | 80 | ||
| 81 | 81 | ||
| 82 | - @Query(value="SELECT * FROM bsth_c_ylb where to_days(?1)=to_days(rq) and nbbm =?2 and jsy=?3 and xlbm=?4",nativeQuery=true) | 82 | + @Query(value="SELECT * FROM bsth_c_ylb where rq=?1 and nbbm =?2 and jsy=?3 and xlbm=?4",nativeQuery=true) |
| 83 | List<Ylb> queryListYlb(String rq,String nbbm,String jgh,String xlbm); | 83 | List<Ylb> queryListYlb(String rq,String nbbm,String jgh,String xlbm); |
| 84 | 84 | ||
| 85 | - @Query(value="SELECT * FROM bsth_c_ylb where to_days(?1)=to_days(rq) and xlbm=?2",nativeQuery=true) | 85 | + @Query(value="SELECT * FROM bsth_c_ylb where rq=?1 and xlbm=?2",nativeQuery=true) |
| 86 | List<Ylb> queryYlbByRqXlbm(String rq,String xlbm); | 86 | List<Ylb> queryYlbByRqXlbm(String rq,String xlbm); |
| 87 | 87 | ||
| 88 | - @Query(value="SELECT * FROM bsth_c_ylb where to_days(?1)=to_days(rq) and nbbm =?2 and jsy=?3 and xlbm=?4 order by ?5 asc",nativeQuery=true) | 88 | + @Query(value="SELECT * FROM bsth_c_ylb where rq=?1 and nbbm =?2 and jsy=?3 and xlbm=?4 order by ?5 asc",nativeQuery=true) |
| 89 | List<Ylb> checkYlb(String rq,String nbbm,String jgh,String xlbm,String px); | 89 | List<Ylb> checkYlb(String rq,String nbbm,String jgh,String xlbm,String px); |
| 90 | /** | 90 | /** |
| 91 | * 查询当天总的加注量和总里程 | 91 | * 查询当天总的加注量和总里程 |
| @@ -102,7 +102,7 @@ public interface YlbRepository extends BaseRepository<Ylb, Integer>{ | @@ -102,7 +102,7 @@ public interface YlbRepository extends BaseRepository<Ylb, Integer>{ | ||
| 102 | * @param xlbm | 102 | * @param xlbm |
| 103 | * @return | 103 | * @return |
| 104 | */ | 104 | */ |
| 105 | - @Query(value="select nbbm,count(nbbm) from bsth_c_ylb where to_days(?1)=to_days(rq) and " | 105 | + @Query(value="select nbbm,count(nbbm) from bsth_c_ylb where rq=?1 and " |
| 106 | + " ssgsdm like %?2% " | 106 | + " ssgsdm like %?2% " |
| 107 | + " and fgsdm like %?3%" | 107 | + " and fgsdm like %?3%" |
| 108 | + " and xlbm like %?4% and nbbm like %?5% " | 108 | + " and xlbm like %?4% and nbbm like %?5% " |
| @@ -117,7 +117,7 @@ public interface YlbRepository extends BaseRepository<Ylb, Integer>{ | @@ -117,7 +117,7 @@ public interface YlbRepository extends BaseRepository<Ylb, Integer>{ | ||
| 117 | * @param xlbm | 117 | * @param xlbm |
| 118 | * @return | 118 | * @return |
| 119 | */ | 119 | */ |
| 120 | - @Query(value="select nbbm,sum(jzl*100) as jzl ,sum(zlc*100) as zlc from bsth_c_ylb where to_days(?1)=to_days(rq) and " | 120 | + @Query(value="select nbbm,sum(jzl*100) as jzl ,sum(zlc*100) as zlc from bsth_c_ylb where rq=?1 and " |
| 121 | + " ssgsdm like %?2% " | 121 | + " ssgsdm like %?2% " |
| 122 | + " and fgsdm like %?3%" | 122 | + " and fgsdm like %?3%" |
| 123 | + " and xlbm like %?4% and nbbm like %?5% " | 123 | + " and xlbm like %?4% and nbbm like %?5% " |
| @@ -126,15 +126,24 @@ public interface YlbRepository extends BaseRepository<Ylb, Integer>{ | @@ -126,15 +126,24 @@ public interface YlbRepository extends BaseRepository<Ylb, Integer>{ | ||
| 126 | 126 | ||
| 127 | 127 | ||
| 128 | @Query(value="select jzl,yh,sh from Ylb s " | 128 | @Query(value="select jzl,yh,sh from Ylb s " |
| 129 | - + " where to_days(?1)=to_days(s.rq) " | 129 | + + " where to_days(s.rq)=to_days(?1) " |
| 130 | + " and s.ssgsdm like %?2% " | 130 | + " and s.ssgsdm like %?2% " |
| 131 | + " and s.fgsdm like %?3%" | 131 | + " and s.fgsdm like %?3%" |
| 132 | + " and s.xlbm like %?4% " | 132 | + " and s.xlbm like %?4% " |
| 133 | + " and s.nbbm in ?5 ") | 133 | + " and s.nbbm in ?5 ") |
| 134 | List<Object[]> sumYlb(String rq, String gsbm,String fgsbm,String xlbm,List<String> listNbbm); | 134 | List<Object[]> sumYlb(String rq, String gsbm,String fgsbm,String xlbm,List<String> listNbbm); |
| 135 | 135 | ||
| 136 | + @Query(value="select jzl,yh,sh from Ylb s " | ||
| 137 | + + " where s.rq=?1 " | ||
| 138 | + + " and s.ssgsdm like %?2% " | ||
| 139 | + + " and s.fgsdm like %?3%" | ||
| 140 | + + " and s.xlbm like %?4% " | ||
| 141 | + + " and s.nbbm in ?5 ") | ||
| 142 | + List<Object[]> sumYlb_s(Date rq, String gsbm,String fgsbm,String xlbm,List<String> listNbbm); | ||
| 143 | + | ||
| 144 | + | ||
| 136 | @Query(value="select ifnull(jzl,0),ifnull(yh,0),ifnull(sh,0) from bsth_c_ylb " | 145 | @Query(value="select ifnull(jzl,0),ifnull(yh,0),ifnull(sh,0) from bsth_c_ylb " |
| 137 | - + " where to_days(?1)=to_days(rq) " | 146 | + + " where rq=?1 " |
| 138 | + " and ssgsdm like %?2% " | 147 | + " and ssgsdm like %?2% " |
| 139 | + " and fgsdm like %?3%" | 148 | + " and fgsdm like %?3%" |
| 140 | + " and xlbm like %?4% " | 149 | + " and xlbm like %?4% " |
| @@ -144,13 +153,21 @@ public interface YlbRepository extends BaseRepository<Ylb, Integer>{ | @@ -144,13 +153,21 @@ public interface YlbRepository extends BaseRepository<Ylb, Integer>{ | ||
| 144 | 153 | ||
| 145 | 154 | ||
| 146 | @Query(value="select s from Ylb s " | 155 | @Query(value="select s from Ylb s " |
| 147 | - + " where to_days(?1)=to_days(s.rq) " | 156 | + + " where to_days(s.rq)=to_days(?1) " |
| 148 | + " and s.ssgsdm =?2 " | 157 | + " and s.ssgsdm =?2 " |
| 149 | + " and s.fgsdm =?3 " | 158 | + " and s.fgsdm =?3 " |
| 150 | + " and s.xlbm like %?4% " | 159 | + " and s.xlbm like %?4% " |
| 151 | + " and s.nbbm in ?5 order by nbbm,jcsx") | 160 | + " and s.nbbm in ?5 order by nbbm,jcsx") |
| 152 | List<Ylb> listYlb(String rq, String gsbm,String fgsbm,String xlbm,List<String> listNbbm); | 161 | List<Ylb> listYlb(String rq, String gsbm,String fgsbm,String xlbm,List<String> listNbbm); |
| 153 | 162 | ||
| 163 | + @Query(value="select s from Ylb s " | ||
| 164 | + + " where s.rq=?1 " | ||
| 165 | + + " and s.ssgsdm =?2 " | ||
| 166 | + + " and s.fgsdm =?3 " | ||
| 167 | + + " and s.xlbm like %?4% " | ||
| 168 | + + " 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); | ||
| 170 | + | ||
| 154 | 171 | ||
| 155 | @Transactional | 172 | @Transactional |
| 156 | @Modifying | 173 | @Modifying |
src/main/java/com/bsth/service/calc/CalcMixService.java
0 → 100644
| 1 | +package com.bsth.service.calc; | ||
| 2 | + | ||
| 3 | +import java.util.List; | ||
| 4 | +import java.util.Map; | ||
| 5 | + | ||
| 6 | +/** | ||
| 7 | + * Created by 19/02/28. | ||
| 8 | + */ | ||
| 9 | +public interface CalcMixService { | ||
| 10 | + | ||
| 11 | + List<Map<String, Object>> calcjsyspy(String line, String startDate, String endDate, String cont, String empnames, String gsdmManth, String fgsdmManth); | ||
| 12 | + | ||
| 13 | + List<Map<String, Object>> singledatatj(String line, String startDate, String endDate, String tjtype, String cont, String gsdmSing, String fgsdmSing); | ||
| 14 | + | ||
| 15 | +} |
src/main/java/com/bsth/service/calc/impl/CalcMixServiceImpl.java
0 → 100644
| 1 | +package com.bsth.service.calc.impl; | ||
| 2 | + | ||
| 3 | +import java.sql.ResultSet; | ||
| 4 | +import java.sql.SQLException; | ||
| 5 | +import java.util.ArrayList; | ||
| 6 | +import java.util.HashMap; | ||
| 7 | +import java.util.List; | ||
| 8 | +import java.util.Map; | ||
| 9 | + | ||
| 10 | +import com.bsth.data.BasicData; | ||
| 11 | +import com.bsth.entity.calc.CalcWaybill; | ||
| 12 | +import com.bsth.entity.mcy_forms.Singledata; | ||
| 13 | +import com.bsth.repository.calc.CalcWaybillRepository; | ||
| 14 | +import com.bsth.service.calc.CalcMixService; | ||
| 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.jdbc.core.RowMapper; | ||
| 22 | +import org.springframework.stereotype.Service; | ||
| 23 | + | ||
| 24 | +/** | ||
| 25 | + * Created by 19/02/28. | ||
| 26 | + */ | ||
| 27 | +@Service | ||
| 28 | +public class CalcMixServiceImpl implements CalcMixService { | ||
| 29 | + | ||
| 30 | + @Autowired | ||
| 31 | + private CalcWaybillRepository calcRepository; | ||
| 32 | + | ||
| 33 | + @Autowired | ||
| 34 | + JdbcTemplate jdbcTemplate; | ||
| 35 | + | ||
| 36 | + | ||
| 37 | + Logger logger = LoggerFactory.getLogger(this.getClass()); | ||
| 38 | + | ||
| 39 | + | ||
| 40 | + @Override | ||
| 41 | + public List<Map<String, Object>> calcjsyspy(String line, String date, String date2, | ||
| 42 | + String empnames, String cont, String gsdm, String fgsdm) { | ||
| 43 | + | ||
| 44 | + List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>(); | ||
| 45 | + List<CalcWaybill> list = null; | ||
| 46 | + | ||
| 47 | + int flag = 0; | ||
| 48 | + if("驾驶员".equals(empnames)){ | ||
| 49 | + flag = 1; | ||
| 50 | + list = calcRepository.scheduleByJsy(line, date, date2, gsdm, fgsdm, cont); | ||
| 51 | + } else if("售票员".equals(empnames)){ | ||
| 52 | + flag = 2; | ||
| 53 | + list = calcRepository.scheduleBySpy(line, date, date2, gsdm, fgsdm, cont); | ||
| 54 | + } else if("车辆自编号".equals(empnames)){ | ||
| 55 | + flag = 3; | ||
| 56 | + list = calcRepository.scheduleByZbh(line, date, date2, gsdm, fgsdm, cont); | ||
| 57 | + } | ||
| 58 | + | ||
| 59 | + List<CalcWaybill> calcList = new ArrayList<CalcWaybill>(); | ||
| 60 | + Map<String, CalcWaybill> calcMap = new HashMap<String, CalcWaybill>(); | ||
| 61 | + | ||
| 62 | + CalcWaybill zjCalc = this.initCalcWaybill(); | ||
| 63 | + zjCalc.setjName("合计"); | ||
| 64 | + for(CalcWaybill c : list){ | ||
| 65 | + String key = ""; | ||
| 66 | + if(flag == 1){ | ||
| 67 | + if(c.getjGh() != null && c.getjName() != null) | ||
| 68 | + key = c.getjGh() + "/" + c.getjName(); | ||
| 69 | + } else if(flag == 2){ | ||
| 70 | + if(c.getsGh() != null && c.getsName() != null) | ||
| 71 | + key = c.getsGh() + "/" + c.getsName(); | ||
| 72 | + } else if(flag == 3){ | ||
| 73 | + if(c.getCl() != null) | ||
| 74 | + key = c.getCl(); | ||
| 75 | + } | ||
| 76 | + | ||
| 77 | + if(key.trim().length() == 0 || "/".equals(key)) | ||
| 78 | + continue; | ||
| 79 | + | ||
| 80 | + CalcWaybill calc = null; | ||
| 81 | + if(calcMap.containsKey(key)){ | ||
| 82 | + calc = calcMap.get(key); | ||
| 83 | + } else { | ||
| 84 | + calc = this.initCalcWaybill(); | ||
| 85 | + calc.setjName(key); | ||
| 86 | + calcList.add(calc); | ||
| 87 | + calcMap.put(key, calc); | ||
| 88 | + } | ||
| 89 | + | ||
| 90 | + this.summation(calc, c); | ||
| 91 | + | ||
| 92 | + this.summation(zjCalc, c); | ||
| 93 | + | ||
| 94 | + } | ||
| 95 | + calcList.add(zjCalc); | ||
| 96 | + calcMap.put("合计", zjCalc); | ||
| 97 | + | ||
| 98 | + for(CalcWaybill c : calcList){ | ||
| 99 | + Map<String, Object> m = new HashMap<String, Object>(); | ||
| 100 | + m.put("jName", c.getjName()); | ||
| 101 | + m.put("jhyybc", c.getJhyybc()); | ||
| 102 | + m.put("jhfyybc", c.getJhfyybc()); | ||
| 103 | + m.put("sjyybc", c.getSjyybc()); | ||
| 104 | + m.put("sjfyybc", c.getSjfyybc()); | ||
| 105 | + m.put("lbbc", c.getLbbc()); | ||
| 106 | + m.put("ljbc", c.getLjbc()); | ||
| 107 | + m.put("jhzlc", Arith.add(c.getJhyylc(), c.getJhfyylc())); | ||
| 108 | + m.put("jhyylc", c.getJhyylc()); | ||
| 109 | + m.put("jhfyylc", c.getJhfyylc()); | ||
| 110 | + m.put("sjzlc", Arith.add(c.getSjyylc(), c.getSjfyylc())); | ||
| 111 | + m.put("sjyylc", c.getSjyylc()); | ||
| 112 | + m.put("sjfyylc", c.getSjfyylc()); | ||
| 113 | + m.put("lblc", c.getLblc()); | ||
| 114 | + m.put("ljyylc", c.getLjyylc()); | ||
| 115 | + m.put("ljfyylc", c.getLjfyylc()); | ||
| 116 | + resList.add(m); | ||
| 117 | + } | ||
| 118 | + | ||
| 119 | + return resList; | ||
| 120 | + } | ||
| 121 | + | ||
| 122 | + public CalcWaybill initCalcWaybill(){ | ||
| 123 | + CalcWaybill calc = new CalcWaybill(); | ||
| 124 | + calc.setJhyybc(0); | ||
| 125 | + calc.setJhyylc(0d); | ||
| 126 | + calc.setJhfyybc(0); | ||
| 127 | + calc.setJhfyylc(0d); | ||
| 128 | + calc.setSjyybc(0); | ||
| 129 | + calc.setSjyylc(0d); | ||
| 130 | + calc.setSjfyybc(0); | ||
| 131 | + calc.setSjfyylc(0d); | ||
| 132 | + calc.setLbbc(0); | ||
| 133 | + calc.setLblc(0d); | ||
| 134 | + calc.setLjbc(0); | ||
| 135 | + calc.setLjyylc(0d); | ||
| 136 | + calc.setLjfyylc(0d); | ||
| 137 | + return calc; | ||
| 138 | + } | ||
| 139 | + | ||
| 140 | + public CalcWaybill summation(CalcWaybill c1, CalcWaybill c2){ | ||
| 141 | + c1.setJhyybc(c1.getJhyybc() + c2.getJhyybc()); | ||
| 142 | + c1.setJhyylc(Arith.add(c1.getJhyylc(), c2.getJhyylc())); | ||
| 143 | + c1.setJhfyybc(c1.getJhfyybc() + c2.getJhfyybc()); | ||
| 144 | + c1.setJhfyylc(Arith.add(c1.getJhfyylc(), c2.getJhfyylc())); | ||
| 145 | + c1.setSjyybc(c1.getSjyybc() + c2.getSjyybc()); | ||
| 146 | + c1.setSjyylc(Arith.add(c1.getSjyylc(), c2.getSjyylc())); | ||
| 147 | + c1.setSjyylc(Arith.add(c1.getSjyylc(), c2.getLjyylc())); | ||
| 148 | + c1.setSjfyybc(c1.getSjfyybc() + c2.getSjfyybc()); | ||
| 149 | + c1.setSjfyylc(Arith.add(c1.getSjfyylc(), c2.getSjfyylc())); | ||
| 150 | + c1.setSjfyylc(Arith.add(c1.getSjfyylc(), c2.getLjfyylc())); | ||
| 151 | + c1.setLbbc(c1.getLbbc() + c2.getLbbc()); | ||
| 152 | + c1.setLblc(Arith.add(c1.getLblc(), c2.getLblc())); | ||
| 153 | + c1.setLjbc(c1.getLjbc() + c2.getLjbc()); | ||
| 154 | + c1.setLjyylc(Arith.add(c1.getLjyylc(), c2.getLjyylc())); | ||
| 155 | + c1.setLjfyylc(Arith.add(c1.getLjfyylc(), c2.getLjfyylc())); | ||
| 156 | + return c1; | ||
| 157 | + } | ||
| 158 | + | ||
| 159 | + @Override | ||
| 160 | + public List<Map<String, Object>> singledatatj(String line, | ||
| 161 | + String date, String date2, | ||
| 162 | + String tjtype, String cont, | ||
| 163 | + String gsdm, String fgsdm) { | ||
| 164 | + | ||
| 165 | + List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>(); | ||
| 166 | + List<CalcWaybill> list = null; | ||
| 167 | + | ||
| 168 | + int flag = 0; | ||
| 169 | + if("驾驶员".equals(tjtype)){ | ||
| 170 | + flag = 1; | ||
| 171 | + list = calcRepository.scheduleByJsy(line, date, date2, gsdm, fgsdm, cont); | ||
| 172 | + } else if("售票员".equals(tjtype)){ | ||
| 173 | + flag = 2; | ||
| 174 | + list = calcRepository.scheduleBySpy(line, date, date2, gsdm, fgsdm, cont); | ||
| 175 | + } else if("车辆自编号".equals(tjtype)){ | ||
| 176 | + flag = 3; | ||
| 177 | + list = calcRepository.scheduleByZbh(line, date, date2, gsdm, fgsdm, cont); | ||
| 178 | + } | ||
| 179 | + | ||
| 180 | + List<CalcWaybill> calcList = new ArrayList<CalcWaybill>(); | ||
| 181 | + Map<String, CalcWaybill> calcMap = new HashMap<String, CalcWaybill>(); | ||
| 182 | + | ||
| 183 | + CalcWaybill zjCalc = this.initCalcWaybill(); | ||
| 184 | + zjCalc.setjName("合计"); | ||
| 185 | + for(CalcWaybill c : list){ | ||
| 186 | + String key = ""; | ||
| 187 | + if(flag == 1){ | ||
| 188 | + if(c.getjGh() != null && c.getjName() != null) | ||
| 189 | + key += c.getjGh() + "/" + c.getjName(); | ||
| 190 | + } else if(flag == 2){ | ||
| 191 | + if(c.getsGh() != null && c.getsName() != null) | ||
| 192 | + key += c.getsGh() + "/" + c.getsName(); | ||
| 193 | + } else if(flag == 3){ | ||
| 194 | + if(c.getCl() != null) | ||
| 195 | + key += c.getCl(); | ||
| 196 | + } | ||
| 197 | + | ||
| 198 | + if(key.trim().length() == 0 || "/".equals(key)) | ||
| 199 | + continue; | ||
| 200 | + | ||
| 201 | + String jName = key; | ||
| 202 | + key = c.getXl() + "/" + key; | ||
| 203 | + | ||
| 204 | + CalcWaybill calc = null; | ||
| 205 | + if(calcMap.containsKey(key)){ | ||
| 206 | + calc = calcMap.get(key); | ||
| 207 | + } else { | ||
| 208 | + calc = this.initCalcWaybill(); | ||
| 209 | + calc.setXlName(c.getXlName()); | ||
| 210 | + calc.setXl(c.getXl()); | ||
| 211 | + calc.setjName(jName); | ||
| 212 | + calcList.add(calc); | ||
| 213 | + calcMap.put(key, calc); | ||
| 214 | + } | ||
| 215 | + | ||
| 216 | + this.summation(calc, c); | ||
| 217 | + | ||
| 218 | + this.summation(zjCalc, c); | ||
| 219 | + | ||
| 220 | + } | ||
| 221 | + calcList.add(zjCalc); | ||
| 222 | + calcMap.put("合计", zjCalc); | ||
| 223 | + | ||
| 224 | + Map<String, Map<String, Object>> keyMap = new HashMap<String, Map<String, Object>>(); | ||
| 225 | + for(CalcWaybill c : calcList){ | ||
| 226 | + Map<String, Object> m = new HashMap<String, Object>(); | ||
| 227 | + m.put("gS", BasicData.businessFgsCodeNameMap.get(fgsdm+"_"+gsdm)); | ||
| 228 | + m.put("xl", c.getXl()); | ||
| 229 | + m.put("xlName", c.getXlName()); | ||
| 230 | + m.put("jName", c.getjName()); | ||
| 231 | + m.put("jhyybc", c.getJhyybc()); | ||
| 232 | + m.put("jhfyybc", c.getJhfyybc()); | ||
| 233 | + m.put("sjyybc", c.getSjyybc()); | ||
| 234 | + m.put("sjfyybc", c.getSjfyybc()); | ||
| 235 | + m.put("lbbc", c.getLbbc()); | ||
| 236 | + m.put("ljbc", c.getLjbc()); | ||
| 237 | + m.put("jhzlc", Arith.add(c.getJhyylc(), c.getJhfyylc())); | ||
| 238 | + m.put("jhyylc", c.getJhyylc()); | ||
| 239 | + m.put("jhfyylc", c.getJhfyylc()); | ||
| 240 | + m.put("sjzlc", Arith.add(c.getSjyylc(), c.getSjfyylc())); | ||
| 241 | + m.put("sjyylc", c.getSjyylc()); | ||
| 242 | + m.put("sjfyylc", c.getSjfyylc()); | ||
| 243 | + m.put("lblc", c.getLblc()); | ||
| 244 | + m.put("ljyylc", c.getLjyylc()); | ||
| 245 | + m.put("ljfyylc", c.getLjfyylc()); | ||
| 246 | + if(flag != 2){ | ||
| 247 | + m.put("hyl", 0); | ||
| 248 | + m.put("jzl", 0); | ||
| 249 | + m.put("sh", 0); | ||
| 250 | + } | ||
| 251 | + resList.add(m); | ||
| 252 | + keyMap.put(c.getXl() + "/" + c.getjName(), m); | ||
| 253 | + } | ||
| 254 | + | ||
| 255 | + String linesql=""; | ||
| 256 | + if(!line.equals("")){ | ||
| 257 | + linesql +=" and xlbm ='"+line+"' "; | ||
| 258 | + } | ||
| 259 | + if(!gsdm.equals("")){ | ||
| 260 | + linesql +=" and ssgsdm ='"+gsdm+"' "; | ||
| 261 | + } | ||
| 262 | + if(!fgsdm.equals("")){ | ||
| 263 | + linesql +=" and fgsdm ='"+fgsdm+"' "; | ||
| 264 | + } | ||
| 265 | + String nysql="SELECT id,xlbm,nbbm,jsy,jzl as jzl,yh as yh,sh as sh,fgsdm FROM bsth_c_ylb" | ||
| 266 | + + " WHERE rq >= '"+date+"' and rq <= '"+date2+"'" | ||
| 267 | + + linesql | ||
| 268 | + + " union" | ||
| 269 | + + " SELECT id,xlbm,nbbm,jsy,cdl as jzl,hd as yh,sh as sh,fgsdm FROM bsth_c_dlb" | ||
| 270 | + + " WHERE rq >= '"+date2+"' and rq <= '"+date2+"'" | ||
| 271 | + + linesql; | ||
| 272 | + List<Singledata> listNy = jdbcTemplate.query(nysql, new RowMapper<Singledata>() { | ||
| 273 | + @Override | ||
| 274 | + public Singledata mapRow(ResultSet arg0, int arg1) throws SQLException { | ||
| 275 | + Singledata sin = new Singledata(); | ||
| 276 | + sin.setxL(arg0.getString("xlbm")); | ||
| 277 | + sin.setJsy(arg0.getString("jsy")); | ||
| 278 | + sin.setClzbh(arg0.getString("nbbm")); | ||
| 279 | + sin.setJzl(arg0.getString("jzl")); | ||
| 280 | + sin.setHyl(arg0.getString("yh")); | ||
| 281 | + sin.setUnyyyl(arg0.getString("sh")); | ||
| 282 | + sin.setgS(arg0.getString("fgsdm")); | ||
| 283 | + return sin; | ||
| 284 | + } | ||
| 285 | + }); | ||
| 286 | + | ||
| 287 | + if(flag != 2){ | ||
| 288 | + Map<String, Object> last = resList.get(resList.size()-1); | ||
| 289 | + last.put("hyl", 0); | ||
| 290 | + last.put("jzl", 0); | ||
| 291 | + last.put("sh", 0); | ||
| 292 | + | ||
| 293 | + //统计油,电表中手动添加的或者有加注没里程的数据 | ||
| 294 | + for (int i = 0; i < listNy.size(); i++) { | ||
| 295 | + Singledata sin_=listNy.get(i); | ||
| 296 | + String xl=sin_.getxL(); | ||
| 297 | + String str = ""; | ||
| 298 | + if(flag == 1){ | ||
| 299 | + str = sin_.getJsy() + "/" + BasicData.allPerson.get(gsdm+"-"+sin_.getJsy()); | ||
| 300 | + } else { | ||
| 301 | + str = sin_.getClzbh(); | ||
| 302 | + } | ||
| 303 | +// boolean fages=true; | ||
| 304 | + if(keyMap.containsKey(xl + "/" + str)){ | ||
| 305 | + Map<String, Object> m = keyMap.get(xl + "/" + str); | ||
| 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)); | ||
| 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"))); | ||
| 312 | + } else { | ||
| 313 | + Map<String, Object> m = new HashMap<String, Object>(); | ||
| 314 | + m.put("gS", BasicData.businessFgsCodeNameMap.get(fgsdm+"_"+gsdm)); | ||
| 315 | + m.put("xl", xl); | ||
| 316 | + m.put("xlName", BasicData.lineCodeAllNameMap.get(xl)); | ||
| 317 | + m.put("jName", str); | ||
| 318 | + m.put("jhzlc", 0); | ||
| 319 | + m.put("sjzlc", 0); | ||
| 320 | + m.put("sjfyylc", 0); | ||
| 321 | + m.put("hyl", sin_.getHyl()!=null?sin_.getHyl():0); | ||
| 322 | + m.put("jzl", sin_.getJzl()!=null?sin_.getJzl():0); | ||
| 323 | + m.put("sh", sin_.getUnyyyl()!=null?sin_.getUnyyyl():0); | ||
| 324 | + last.put("hyl", Arith.add(last.get("hyl"), m.get("hyl"))); | ||
| 325 | + last.put("jzl", Arith.add(last.get("jzl"), m.get("jzl"))); | ||
| 326 | + last.put("sh", Arith.add(last.get("sh"), m.get("sh"))); | ||
| 327 | + | ||
| 328 | + keyMap.put(xl + "/" + str, m); | ||
| 329 | + } | ||
| 330 | + } | ||
| 331 | + resList.remove(last); | ||
| 332 | + resList.add(last); | ||
| 333 | + } | ||
| 334 | + | ||
| 335 | + return resList; | ||
| 336 | + } | ||
| 337 | + | ||
| 338 | +} |
src/main/java/com/bsth/service/calc/impl/CalcToolServiceImpl.java
| @@ -181,12 +181,12 @@ public class CalcToolServiceImpl implements CalcToolService { | @@ -181,12 +181,12 @@ public class CalcToolServiceImpl implements CalcToolService { | ||
| 181 | if(i != l){ | 181 | if(i != l){ |
| 182 | CalcWaybill c1 = listCal.get(i); | 182 | CalcWaybill c1 = listCal.get(i); |
| 183 | CalcWaybill c2 = listCal.get(l); | 183 | CalcWaybill c2 = listCal.get(l); |
| 184 | - | ||
| 185 | - c1.setSjyylc(c1.getSjyylc() + c2.getSjyylc()); | ||
| 186 | - c1.setSjfyylc(c1.getSjfyylc() + c2.getSjfyylc()); | ||
| 187 | - c1.setLjyylc(c1.getLjyylc() + c2.getLjyylc()); | ||
| 188 | - c1.setLjfyylc(c1.getLjfyylc() + c2.getLjfyylc()); | ||
| 189 | - | 184 | +// |
| 185 | +// c1.setSjyylc(c1.getSjyylc() + c2.getSjyylc()); | ||
| 186 | +// c1.setSjfyylc(c1.getSjfyylc() + c2.getSjfyylc()); | ||
| 187 | +// c1.setLjyylc(c1.getLjyylc() + c2.getLjyylc()); | ||
| 188 | +// c1.setLjfyylc(c1.getLjfyylc() + c2.getLjfyylc()); | ||
| 189 | +// | ||
| 190 | listCal.remove(l); | 190 | listCal.remove(l); |
| 191 | } else { | 191 | } else { |
| 192 | break; | 192 | break; |
src/main/java/com/bsth/service/forms/impl/FormsServiceImpl.java
| @@ -596,7 +596,7 @@ public class FormsServiceImpl implements FormsService { | @@ -596,7 +596,7 @@ public class FormsServiceImpl implements FormsService { | ||
| 596 | @Override | 596 | @Override |
| 597 | public List<Shifday> shifday(Map<String, Object> map) { | 597 | public List<Shifday> shifday(Map<String, Object> map) { |
| 598 | 598 | ||
| 599 | - String line=""; | 599 | + String line=""; |
| 600 | String date=""; | 600 | String date=""; |
| 601 | String gsdmShif=""; | 601 | String gsdmShif=""; |
| 602 | String fgsdmShif=""; | 602 | String fgsdmShif=""; |
| @@ -624,18 +624,17 @@ public class FormsServiceImpl implements FormsService { | @@ -624,18 +624,17 @@ public class FormsServiceImpl implements FormsService { | ||
| 624 | if(!type.equals("") && !statue.equals("")){ | 624 | if(!type.equals("") && !statue.equals("")){ |
| 625 | sql_ +=" order by "+statue+" "+type; | 625 | sql_ +=" order by "+statue+" "+type; |
| 626 | } | 626 | } |
| 627 | - String sql ="select t.* from (select r.schedule_date,r.j_name," | ||
| 628 | - + "IFNULL(r.s_name,'')as s_name," | ||
| 629 | - + " r.cl_zbh,r.xl_bm, r.j_gh,r.gs_bm,r.fgs_bm,r.lp_name " | ||
| 630 | - + "FROM bsth_c_s_sp_info_real r where 1=1 " | ||
| 631 | - + " and r.schedule_date_str='"+date + "' " | 627 | + String sql ="select t.* from (select r.schedule_date," |
| 628 | + + " IFNULL(r.s_gh,'')as s_gh,r.cl_zbh," | ||
| 629 | + + " r.xl_bm,r.j_gh,r.gs_bm,r.fgs_bm,r.lp_name" | ||
| 630 | + + " FROM bsth_c_s_sp_info_real r where 1=1 " | ||
| 631 | + + " and r.schedule_date_str='"+date + "' " | ||
| 632 | + " and r.xl_bm = '"+line+"' " | 632 | + " and r.xl_bm = '"+line+"' " |
| 633 | + " and r.gs_bm like '%"+gsdmShif+"%' " | 633 | + " and r.gs_bm like '%"+gsdmShif+"%' " |
| 634 | - + " and r.fgs_bm like '%"+fgsdmShif+"%' ) t" | ||
| 635 | - + " GROUP BY t.schedule_date,t.j_name,t.s_name, " | ||
| 636 | - + "t.cl_zbh,t.xl_bm,t.j_gh,t.gs_bm,t.fgs_bm,t.lp_name " | ||
| 637 | - + sql_; | ||
| 638 | - | 634 | + + " and r.fgs_bm like '%"+fgsdmShif+"%' "+sql_+") t" |
| 635 | + + " GROUP BY t.schedule_date,t.xl_bm,t.cl_zbh,t.lp_name," | ||
| 636 | + + " t.j_gh,t.s_gh,t.gs_bm,t.fgs_bm "; | ||
| 637 | + | ||
| 639 | 638 | ||
| 640 | List<Shifday> list = jdbcTemplate.query(sql, new RowMapper<Shifday>() { | 639 | List<Shifday> list = jdbcTemplate.query(sql, new RowMapper<Shifday>() { |
| 641 | 640 | ||
| @@ -643,15 +642,16 @@ public class FormsServiceImpl implements FormsService { | @@ -643,15 +642,16 @@ public class FormsServiceImpl implements FormsService { | ||
| 643 | public Shifday mapRow(ResultSet arg0, int arg1) throws SQLException { | 642 | public Shifday mapRow(ResultSet arg0, int arg1) throws SQLException { |
| 644 | Shifday shifday = new Shifday(); | 643 | Shifday shifday = new Shifday(); |
| 645 | shifday.setRq(arg0.getString("schedule_date")); | 644 | shifday.setRq(arg0.getString("schedule_date")); |
| 646 | - shifday.setjName(arg0.getString("j_name").toString()); | ||
| 647 | - shifday.setsName(arg0.getString("s_name") == null ? "" : arg0.getString("s_name").toString()); | 645 | +// shifday.setjName(arg0.getString("j_name").toString()); |
| 646 | +// shifday.setsName(arg0.getString("s_name") == null ? "" : arg0.getString("s_name").toString()); | ||
| 648 | shifday.setCarPlate(arg0.getString("cl_zbh").toString()); | 647 | shifday.setCarPlate(arg0.getString("cl_zbh").toString()); |
| 649 | shifday.setJgh(arg0.getString("j_gh")); | 648 | shifday.setJgh(arg0.getString("j_gh")); |
| 649 | + shifday.setSgh(arg0.getString("s_gh") == null ? "" : arg0.getString("s_gh").toString()); | ||
| 650 | shifday.setLpName(arg0.getString("lp_name")== null ? "" : arg0.getString("lp_name").toString()); | 650 | shifday.setLpName(arg0.getString("lp_name")== null ? "" : arg0.getString("lp_name").toString()); |
| 651 | return shifday; | 651 | return shifday; |
| 652 | } | 652 | } |
| 653 | - | ||
| 654 | }); | 653 | }); |
| 654 | + | ||
| 655 | List<ScheduleRealInfo> sList; | 655 | List<ScheduleRealInfo> sList; |
| 656 | List<ScheduleRealInfo> list_s; | 656 | List<ScheduleRealInfo> list_s; |
| 657 | List<ScheduleRealInfo> lists=scheduleRealInfoRepository.scheduleByDateAndLineTjrb(map.get("line").toString(), map.get("date").toString()); | 657 | List<ScheduleRealInfo> lists=scheduleRealInfoRepository.scheduleByDateAndLineTjrb(map.get("line").toString(), map.get("date").toString()); |
| @@ -661,8 +661,9 @@ public class FormsServiceImpl implements FormsService { | @@ -661,8 +661,9 @@ public class FormsServiceImpl implements FormsService { | ||
| 661 | Shifday d=list.get(i); | 661 | Shifday d=list.get(i); |
| 662 | for (int j = 0; j < lists.size(); j++) { | 662 | for (int j = 0; j < lists.size(); j++) { |
| 663 | ScheduleRealInfo s=lists.get(j); | 663 | ScheduleRealInfo s=lists.get(j); |
| 664 | - if(d.getJgh().equals(s.getjGh()) && d.getCarPlate().equals(s.getClZbh()) | ||
| 665 | - &&d.getLpName().equals(s.getLpName())){ | 664 | + if(d.getJgh().equals(s.getjGh()) && d.getSgh().equals(s.getsGh()) |
| 665 | + && d.getCarPlate().equals(s.getClZbh()) | ||
| 666 | + && d.getLpName().equals(s.getLpName())){ | ||
| 666 | sList.add(s); | 667 | sList.add(s); |
| 667 | Set<ChildTaskPlan> cts = s.getcTasks(); | 668 | Set<ChildTaskPlan> cts = s.getcTasks(); |
| 668 | if(cts != null && cts.size() > 0){ | 669 | if(cts != null && cts.size() > 0){ |
| @@ -674,7 +675,10 @@ public class FormsServiceImpl implements FormsService { | @@ -674,7 +675,10 @@ public class FormsServiceImpl implements FormsService { | ||
| 674 | } | 675 | } |
| 675 | } | 676 | } |
| 676 | } | 677 | } |
| 677 | - | 678 | + if(sList.size()>0){ |
| 679 | + d.setjName(sList.get(0).getjName()); | ||
| 680 | + d.setsName(sList.get(0).getsName() == null ? "":sList.get(0).getsName()); | ||
| 681 | + } | ||
| 678 | double ksgl=culateMileageService.culateKsgl(list_s); | 682 | double ksgl=culateMileageService.culateKsgl(list_s); |
| 679 | double jccgl=culateMileageService.culateJccgl(list_s); | 683 | double jccgl=culateMileageService.culateJccgl(list_s); |
| 680 | double zksgl=Arith.add(ksgl, jccgl); | 684 | double zksgl=Arith.add(ksgl, jccgl); |
| @@ -893,7 +897,9 @@ public class FormsServiceImpl implements FormsService { | @@ -893,7 +897,9 @@ public class FormsServiceImpl implements FormsService { | ||
| 893 | if(fgsdm.length() != 0){ | 897 | if(fgsdm.length() != 0){ |
| 894 | sql += " and r.fgs_bm ='"+fgsdm+"'"; | 898 | sql += " and r.fgs_bm ='"+fgsdm+"'"; |
| 895 | } | 899 | } |
| 896 | - sql += " group by r.j_gh,r.xl_bm,r.cl_zbh,r.j_name order by r.xl_bm,r.cl_zbh"; | 900 | + sql += " group by r.fgs_bm,r.j_gh,r.xl_bm,r.cl_zbh,r.j_name " + |
| 901 | + "order by r.xl_bm,r.cl_zbh"; | ||
| 902 | + | ||
| 897 | 903 | ||
| 898 | list = jdbcTemplate.query(sql, new RowMapper<Singledata>() { | 904 | list = jdbcTemplate.query(sql, new RowMapper<Singledata>() { |
| 899 | @Override | 905 | @Override |
| @@ -924,7 +930,7 @@ public class FormsServiceImpl implements FormsService { | @@ -924,7 +930,7 @@ public class FormsServiceImpl implements FormsService { | ||
| 924 | + " WHERE rq = '"+startDate+"'" | 930 | + " WHERE rq = '"+startDate+"'" |
| 925 | + linesql | 931 | + linesql |
| 926 | + " union" | 932 | + " union" |
| 927 | - + " SELECT id,xlbm,nbbm,jsy,cdl as jzl,hd as yh,sh as sh,fgsdm FROM bsth_c_dlb" | 933 | + + " SELECT id,xlbm,nbbm,jsy,cdl as jzl,hd as yh,sh as sh,fgsdm FROM bsth_c_dlb" |
| 928 | + " WHERE rq = '"+startDate+"'" | 934 | + " WHERE rq = '"+startDate+"'" |
| 929 | + linesql; | 935 | + linesql; |
| 930 | List<Singledata> listNy = jdbcTemplate.query(nysql, new RowMapper<Singledata>() { | 936 | List<Singledata> listNy = jdbcTemplate.query(nysql, new RowMapper<Singledata>() { |
| @@ -968,7 +974,7 @@ public class FormsServiceImpl implements FormsService { | @@ -968,7 +974,7 @@ public class FormsServiceImpl implements FormsService { | ||
| 968 | s.setsName(""); | 974 | s.setsName(""); |
| 969 | s.setgS(BasicData.businessFgsCodeNameMap.get(sin_.getgS()+"_"+gsdm)); | 975 | s.setgS(BasicData.businessFgsCodeNameMap.get(sin_.getgS()+"_"+gsdm)); |
| 970 | s.setxL(line); | 976 | s.setxL(line); |
| 971 | - s.setXlmc(BasicData.lineCode2NameMap.get(line)); | 977 | + s.setXlmc(BasicData.lineCodeAllNameMap.get(line)); |
| 972 | s.setJzl(sin_.getJzl()); | 978 | s.setJzl(sin_.getJzl()); |
| 973 | s.setHyl(sin_.getHyl()); | 979 | s.setHyl(sin_.getHyl()); |
| 974 | s.setUnyyyl(sin_.getUnyyyl()); | 980 | s.setUnyyyl(sin_.getUnyyyl()); |
| @@ -1724,7 +1730,7 @@ public class FormsServiceImpl implements FormsService { | @@ -1724,7 +1730,7 @@ public class FormsServiceImpl implements FormsService { | ||
| 1724 | startDate = map.get("startDate").toString(); | 1730 | startDate = map.get("startDate").toString(); |
| 1725 | 1731 | ||
| 1726 | String sql="select r.s_gh,r.s_name, " | 1732 | String sql="select r.s_gh,r.s_name, " |
| 1727 | - + " r.xl_bm,r.cl_zbh,r.j_gh,r.j_name,r.gs_bm,r.fgs_bm" | 1733 | + + " r.xl_bm,r.cl_zbh,r.j_gh,r.j_name,r.gs_bm,r.fgs_bm,xl_name" |
| 1728 | + " from bsth_c_s_sp_info_real r where r.schedule_date_str = '"+startDate+"'"; | 1734 | + " from bsth_c_s_sp_info_real r where r.schedule_date_str = '"+startDate+"'"; |
| 1729 | if(!xlbm.equals("")){ | 1735 | if(!xlbm.equals("")){ |
| 1730 | sql += " and r.xl_bm = '"+xlbm+"'"; | 1736 | sql += " and r.xl_bm = '"+xlbm+"'"; |
| @@ -1736,7 +1742,7 @@ public class FormsServiceImpl implements FormsService { | @@ -1736,7 +1742,7 @@ public class FormsServiceImpl implements FormsService { | ||
| 1736 | sql += " and r.fgs_bm='"+fgsdm+"'"; | 1742 | sql += " and r.fgs_bm='"+fgsdm+"'"; |
| 1737 | } | 1743 | } |
| 1738 | sql += " group by r.s_gh,r.s_name," | 1744 | sql += " group by r.s_gh,r.s_name," |
| 1739 | - + " r.xl_bm,r.cl_zbh,r.j_gh,r.j_name,r.gs_bm,r.fgs_bm order by r.xl_bm,r.cl_zbh"; | 1745 | + + " r.xl_bm,r.cl_zbh,r.j_gh,r.j_name,r.gs_bm,r.fgs_bm,xl_name order by r.xl_bm,r.cl_zbh"; |
| 1740 | 1746 | ||
| 1741 | List<Singledata> list = jdbcTemplate.query(sql, new RowMapper<Singledata>() { | 1747 | List<Singledata> list = jdbcTemplate.query(sql, new RowMapper<Singledata>() { |
| 1742 | //SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); | 1748 | //SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); |
| @@ -1750,6 +1756,7 @@ public class FormsServiceImpl implements FormsService { | @@ -1750,6 +1756,7 @@ public class FormsServiceImpl implements FormsService { | ||
| 1750 | sin.setjName(arg0.getString("j_name")); | 1756 | sin.setjName(arg0.getString("j_name")); |
| 1751 | sin.setSgh(arg0.getString("s_gh")); | 1757 | sin.setSgh(arg0.getString("s_gh")); |
| 1752 | sin.setsName(arg0.getString("s_name")); | 1758 | sin.setsName(arg0.getString("s_name")); |
| 1759 | + sin.setXlmc(arg0.getString("xl_name")); | ||
| 1753 | sin.setgS(BasicData.businessFgsCodeNameMap.get(arg0.getString("fgs_bm")+"_"+arg0.getString("gs_bm"))); | 1760 | sin.setgS(BasicData.businessFgsCodeNameMap.get(arg0.getString("fgs_bm")+"_"+arg0.getString("gs_bm"))); |
| 1754 | 1761 | ||
| 1755 | return sin; | 1762 | return sin; |
| @@ -1767,7 +1774,7 @@ public class FormsServiceImpl implements FormsService { | @@ -1767,7 +1774,7 @@ public class FormsServiceImpl implements FormsService { | ||
| 1767 | String clzbh=sin.getClzbh(); | 1774 | String clzbh=sin.getClzbh(); |
| 1768 | String xl=sin.getxL(); | 1775 | String xl=sin.getxL(); |
| 1769 | String spy=sin.getSgh(); | 1776 | String spy=sin.getSgh(); |
| 1770 | - sin.setxL(BasicData.lineCode2NameMap.get(xl)); | 1777 | + sin.setxL(sin.getXlmc()); |
| 1771 | for (int j = 0; j < listReal.size(); j++) { | 1778 | for (int j = 0; j < listReal.size(); j++) { |
| 1772 | ScheduleRealInfo s=listReal.get(j); | 1779 | ScheduleRealInfo s=listReal.get(j); |
| 1773 | if(s.getjGh().equals(jsy) && s.getClZbh().equals(clzbh) | 1780 | if(s.getjGh().equals(jsy) && s.getClZbh().equals(clzbh) |
| @@ -1912,7 +1919,12 @@ public class FormsServiceImpl implements FormsService { | @@ -1912,7 +1919,12 @@ public class FormsServiceImpl implements FormsService { | ||
| 1912 | sin.setEmptMileage(String.valueOf(zksgl)); | 1919 | sin.setEmptMileage(String.valueOf(zksgl)); |
| 1913 | sin.setJhjl(String.valueOf(Arith.add(jhgl,jhjcc))); | 1920 | sin.setJhjl(String.valueOf(Arith.add(jhgl,jhjcc))); |
| 1914 | sin.setxL(y.getXlbm()); | 1921 | sin.setxL(y.getXlbm()); |
| 1915 | - sin.setXlmc(BasicData.lineCode2NameMap.get(y.getXlbm())); | 1922 | + if(y.getLinename()==null){ |
| 1923 | + sin.setXlmc(y.getXlname()); | ||
| 1924 | + }else{ | ||
| 1925 | + sin.setXlmc(y.getLinename()); | ||
| 1926 | + } | ||
| 1927 | + | ||
| 1916 | sin.setClzbh(clzbh); | 1928 | sin.setClzbh(clzbh); |
| 1917 | sin.setJsy(jsy); | 1929 | sin.setJsy(jsy); |
| 1918 | sin.setrQ(startDate); | 1930 | sin.setrQ(startDate); |
| @@ -1994,8 +2006,11 @@ public class FormsServiceImpl implements FormsService { | @@ -1994,8 +2006,11 @@ public class FormsServiceImpl implements FormsService { | ||
| 1994 | sin.setEmptMileage(String.valueOf(zksgl)); | 2006 | sin.setEmptMileage(String.valueOf(zksgl)); |
| 1995 | sin.setJhjl(String.valueOf(Arith.add(jhgl,jhjcc))); | 2007 | sin.setJhjl(String.valueOf(Arith.add(jhgl,jhjcc))); |
| 1996 | sin.setxL(y.getXlbm()); | 2008 | sin.setxL(y.getXlbm()); |
| 1997 | - sin.setXlmc(BasicData.lineCode2NameMap.get(y.getXlbm())); | ||
| 1998 | - sin.setClzbh(clzbh); | 2009 | + if(y.getLinename()==null){ |
| 2010 | + sin.setXlmc(y.getXlname()); | ||
| 2011 | + }else{ | ||
| 2012 | + sin.setXlmc(y.getLinename()); | ||
| 2013 | + } sin.setClzbh(clzbh); | ||
| 1999 | sin.setJsy(jsy); | 2014 | sin.setJsy(jsy); |
| 2000 | sin.setrQ(startDate); | 2015 | sin.setrQ(startDate); |
| 2001 | if(newList.size()>0){ | 2016 | if(newList.size()>0){ |
| @@ -2019,7 +2034,7 @@ public class FormsServiceImpl implements FormsService { | @@ -2019,7 +2034,7 @@ public class FormsServiceImpl implements FormsService { | ||
| 2019 | list.addAll(listD); | 2034 | list.addAll(listD); |
| 2020 | }else{ | 2035 | }else{ |
| 2021 | String sql="select r.s_gh,r.s_name, " | 2036 | String sql="select r.s_gh,r.s_name, " |
| 2022 | - + " r.xl_bm,r.cl_zbh,r.gs_bm,r.fgs_bm" | 2037 | + + " r.xl_bm,r.cl_zbh,r.gs_bm,r.fgs_bm,r.xl_name" |
| 2023 | + " from bsth_c_s_sp_info_real r where " | 2038 | + " from bsth_c_s_sp_info_real r where " |
| 2024 | + " r.schedule_date_str = '"+startDate+"'" | 2039 | + " r.schedule_date_str = '"+startDate+"'" |
| 2025 | + " and r.s_gh !='' and r.s_gh is not null "; | 2040 | + " and r.s_gh !='' and r.s_gh is not null "; |
| @@ -2033,7 +2048,7 @@ public class FormsServiceImpl implements FormsService { | @@ -2033,7 +2048,7 @@ public class FormsServiceImpl implements FormsService { | ||
| 2033 | sql += " and r.fgs_bm='"+fgsdm+"'"; | 2048 | sql += " and r.fgs_bm='"+fgsdm+"'"; |
| 2034 | } | 2049 | } |
| 2035 | sql += " group by r.s_gh,r.s_name," | 2050 | sql += " group by r.s_gh,r.s_name," |
| 2036 | - + " r.xl_bm,r.cl_zbh,r.gs_bm,r.fgs_bm order by r.xl_bm,r.cl_zbh"; | 2051 | + + " r.xl_bm,r.cl_zbh,r.gs_bm,r.fgs_bm,r.xl_name order by r.xl_bm,r.cl_zbh"; |
| 2037 | 2052 | ||
| 2038 | list = jdbcTemplate.query(sql, new RowMapper<Singledata>() { | 2053 | list = jdbcTemplate.query(sql, new RowMapper<Singledata>() { |
| 2039 | //SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); | 2054 | //SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); |
| @@ -2045,6 +2060,7 @@ public class FormsServiceImpl implements FormsService { | @@ -2045,6 +2060,7 @@ public class FormsServiceImpl implements FormsService { | ||
| 2045 | sin.setClzbh(arg0.getString("cl_zbh")); | 2060 | sin.setClzbh(arg0.getString("cl_zbh")); |
| 2046 | sin.setSgh(arg0.getString("s_gh")); | 2061 | sin.setSgh(arg0.getString("s_gh")); |
| 2047 | sin.setsName(arg0.getString("s_name")); | 2062 | sin.setsName(arg0.getString("s_name")); |
| 2063 | + sin.setXlmc(arg0.getString("xl_name")); | ||
| 2048 | return sin; | 2064 | return sin; |
| 2049 | } | 2065 | } |
| 2050 | }); | 2066 | }); |
| @@ -2054,6 +2070,7 @@ public class FormsServiceImpl implements FormsService { | @@ -2054,6 +2070,7 @@ public class FormsServiceImpl implements FormsService { | ||
| 2054 | String jsy=sin.getSgh(); | 2070 | String jsy=sin.getSgh(); |
| 2055 | String line=sin.getxL(); | 2071 | String line=sin.getxL(); |
| 2056 | String clzbh=sin.getClzbh(); | 2072 | String clzbh=sin.getClzbh(); |
| 2073 | + String xl_name=sin.getXlmc(); | ||
| 2057 | List<ScheduleRealInfo> newList=new ArrayList<ScheduleRealInfo>(); | 2074 | List<ScheduleRealInfo> newList=new ArrayList<ScheduleRealInfo>(); |
| 2058 | List<ScheduleRealInfo> newList_=new ArrayList<ScheduleRealInfo>(); | 2075 | List<ScheduleRealInfo> newList_=new ArrayList<ScheduleRealInfo>(); |
| 2059 | 2076 | ||
| @@ -2086,7 +2103,7 @@ public class FormsServiceImpl implements FormsService { | @@ -2086,7 +2103,7 @@ public class FormsServiceImpl implements FormsService { | ||
| 2086 | 2103 | ||
| 2087 | sin.setEmptMileage(String.valueOf(zksgl)); | 2104 | sin.setEmptMileage(String.valueOf(zksgl)); |
| 2088 | sin.setJhjl(String.valueOf(Arith.add(jhgl,jhjcc))); | 2105 | sin.setJhjl(String.valueOf(Arith.add(jhgl,jhjcc))); |
| 2089 | - sin.setXlmc(BasicData.lineCode2NameMap.get(line)); | 2106 | + sin.setXlmc(xl_name); |
| 2090 | sin.setClzbh(clzbh); | 2107 | sin.setClzbh(clzbh); |
| 2091 | sin.setJsy(""); | 2108 | sin.setJsy(""); |
| 2092 | sin.setjName(""); | 2109 | sin.setjName(""); |
| @@ -2192,8 +2209,11 @@ public class FormsServiceImpl implements FormsService { | @@ -2192,8 +2209,11 @@ public class FormsServiceImpl implements FormsService { | ||
| 2192 | sin.setEmptMileage(String.valueOf(zksgl)); | 2209 | sin.setEmptMileage(String.valueOf(zksgl)); |
| 2193 | sin.setJhjl(String.valueOf(Arith.add(jhgl,jhjcc))); | 2210 | sin.setJhjl(String.valueOf(Arith.add(jhgl,jhjcc))); |
| 2194 | sin.setxL(y.getXlbm()); | 2211 | sin.setxL(y.getXlbm()); |
| 2195 | - sin.setXlmc(BasicData.lineCode2NameMap.get(y.getXlbm())); | ||
| 2196 | - sin.setClzbh(clzbh); | 2212 | + if(y.getLinename()==null){ |
| 2213 | + sin.setXlmc(y.getXlname()); | ||
| 2214 | + }else{ | ||
| 2215 | + sin.setXlmc(y.getLinename()); | ||
| 2216 | + } sin.setClzbh(clzbh); | ||
| 2197 | sin.setJsy(jsy); | 2217 | sin.setJsy(jsy); |
| 2198 | sin.setrQ(startDate); | 2218 | sin.setrQ(startDate); |
| 2199 | if(newList.size()>0){ | 2219 | if(newList.size()>0){ |
| @@ -2274,7 +2294,11 @@ public class FormsServiceImpl implements FormsService { | @@ -2274,7 +2294,11 @@ public class FormsServiceImpl implements FormsService { | ||
| 2274 | sin.setEmptMileage(String.valueOf(zksgl)); | 2294 | sin.setEmptMileage(String.valueOf(zksgl)); |
| 2275 | sin.setJhjl(String.valueOf(Arith.add(jhgl,jhjcc))); | 2295 | sin.setJhjl(String.valueOf(Arith.add(jhgl,jhjcc))); |
| 2276 | sin.setxL(y.getXlbm()); | 2296 | sin.setxL(y.getXlbm()); |
| 2277 | - sin.setXlmc(BasicData.lineCode2NameMap.get(y.getXlbm())); | 2297 | + if(y.getLinename()==null){ |
| 2298 | + sin.setXlmc(y.getXlname()); | ||
| 2299 | + }else{ | ||
| 2300 | + sin.setXlmc(y.getLinename()); | ||
| 2301 | + } | ||
| 2278 | sin.setClzbh(clzbh); | 2302 | sin.setClzbh(clzbh); |
| 2279 | sin.setJsy(jsy); | 2303 | sin.setJsy(jsy); |
| 2280 | sin.setrQ(startDate); | 2304 | sin.setrQ(startDate); |
| @@ -2299,7 +2323,7 @@ public class FormsServiceImpl implements FormsService { | @@ -2299,7 +2323,7 @@ public class FormsServiceImpl implements FormsService { | ||
| 2299 | list.addAll(listD); | 2323 | list.addAll(listD); |
| 2300 | }else{ | 2324 | }else{ |
| 2301 | String sql="select r.s_gh,r.s_name, " | 2325 | String sql="select r.s_gh,r.s_name, " |
| 2302 | - + " r.xl_bm,r.cl_zbh,r.gs_bm,r.fgs_bm" | 2326 | + + " r.xl_bm,r.cl_zbh,r.gs_bm,r.fgs_bm,r.xl_name" |
| 2303 | + " from bsth_c_s_sp_info_real r where " | 2327 | + " from bsth_c_s_sp_info_real r where " |
| 2304 | + " r.schedule_date_str = '"+startDate+"'" | 2328 | + " r.schedule_date_str = '"+startDate+"'" |
| 2305 | + " and r.s_gh !='' and r.s_gh is not null "; | 2329 | + " and r.s_gh !='' and r.s_gh is not null "; |
| @@ -2313,7 +2337,7 @@ public class FormsServiceImpl implements FormsService { | @@ -2313,7 +2337,7 @@ public class FormsServiceImpl implements FormsService { | ||
| 2313 | sql += " and r.fgs_bm='"+fgsdm+"'"; | 2337 | sql += " and r.fgs_bm='"+fgsdm+"'"; |
| 2314 | } | 2338 | } |
| 2315 | sql += " group by r.s_gh,r.s_name," | 2339 | sql += " group by r.s_gh,r.s_name," |
| 2316 | - + " r.xl_bm,r.cl_zbh,r.gs_bm,r.fgs_bm order by r.xl_bm,r.cl_zbh"; | 2340 | + + " r.xl_bm,r.cl_zbh,r.gs_bm,r.fgs_bm,xl_name order by r.xl_bm,r.cl_zbh"; |
| 2317 | 2341 | ||
| 2318 | list = jdbcTemplate.query(sql, new RowMapper<Singledata>() { | 2342 | list = jdbcTemplate.query(sql, new RowMapper<Singledata>() { |
| 2319 | //SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); | 2343 | //SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); |
| @@ -2325,6 +2349,7 @@ public class FormsServiceImpl implements FormsService { | @@ -2325,6 +2349,7 @@ public class FormsServiceImpl implements FormsService { | ||
| 2325 | sin.setClzbh(arg0.getString("cl_zbh")); | 2349 | sin.setClzbh(arg0.getString("cl_zbh")); |
| 2326 | sin.setSgh(arg0.getString("s_gh")); | 2350 | sin.setSgh(arg0.getString("s_gh")); |
| 2327 | sin.setsName(arg0.getString("s_name")); | 2351 | sin.setsName(arg0.getString("s_name")); |
| 2352 | + sin.setXlmc(arg0.getString("xl_name")); | ||
| 2328 | return sin; | 2353 | return sin; |
| 2329 | } | 2354 | } |
| 2330 | }); | 2355 | }); |
| @@ -2334,6 +2359,7 @@ public class FormsServiceImpl implements FormsService { | @@ -2334,6 +2359,7 @@ public class FormsServiceImpl implements FormsService { | ||
| 2334 | String jsy=sin.getSgh(); | 2359 | String jsy=sin.getSgh(); |
| 2335 | String line=sin.getxL(); | 2360 | String line=sin.getxL(); |
| 2336 | String clzbh=sin.getClzbh(); | 2361 | String clzbh=sin.getClzbh(); |
| 2362 | + String xl_name=sin.getXlmc(); | ||
| 2337 | List<ScheduleRealInfo> newList=new ArrayList<ScheduleRealInfo>(); | 2363 | List<ScheduleRealInfo> newList=new ArrayList<ScheduleRealInfo>(); |
| 2338 | List<ScheduleRealInfo> newList_=new ArrayList<ScheduleRealInfo>(); | 2364 | List<ScheduleRealInfo> newList_=new ArrayList<ScheduleRealInfo>(); |
| 2339 | 2365 | ||
| @@ -2367,7 +2393,7 @@ public class FormsServiceImpl implements FormsService { | @@ -2367,7 +2393,7 @@ public class FormsServiceImpl implements FormsService { | ||
| 2367 | 2393 | ||
| 2368 | sin.setEmptMileage(String.valueOf(zksgl)); | 2394 | sin.setEmptMileage(String.valueOf(zksgl)); |
| 2369 | sin.setJhjl(String.valueOf(Arith.add(jhgl,jhjcc))); | 2395 | sin.setJhjl(String.valueOf(Arith.add(jhgl,jhjcc))); |
| 2370 | - sin.setXlmc(BasicData.lineCode2NameMap.get(line)); | 2396 | + sin.setXlmc(xl_name); |
| 2371 | sin.setClzbh(clzbh); | 2397 | sin.setClzbh(clzbh); |
| 2372 | sin.setJsy(""); | 2398 | sin.setJsy(""); |
| 2373 | sin.setjName(""); | 2399 | sin.setjName(""); |
src/main/java/com/bsth/service/geo_data/impl/GeoDataServiceImpl.java
| @@ -376,7 +376,7 @@ public class GeoDataServiceImpl implements GeoDataService { | @@ -376,7 +376,7 @@ public class GeoDataServiceImpl implements GeoDataService { | ||
| 376 | lVersion.setLineCode(lineCode); | 376 | lVersion.setLineCode(lineCode); |
| 377 | 377 | ||
| 378 | //如果有待启用的版本,设置为历史版本 | 378 | //如果有待启用的版本,设置为历史版本 |
| 379 | - jdbcTemplate.update("update bsth_c_line_versions set `status`=0, start_date=null,end_date=null where line_code='"+lineCode+"' and `status`=2"); | 379 | + jdbcTemplate.update("update bsth_c_line_versions set `status`=2, start_date=null,end_date=null where line_code='"+lineCode+"' and `status`=0"); |
| 380 | 380 | ||
| 381 | //入库线路版本 | 381 | //入库线路版本 |
| 382 | jdbcTemplate.update("insert into bsth_c_line_versions(name, line, line_code, versions, start_date, create_date, update_date, remark,status, isupdate) " + | 382 | jdbcTemplate.update("insert into bsth_c_line_versions(name, line, line_code, versions, start_date, create_date, update_date, remark,status, isupdate) " + |
src/main/java/com/bsth/service/impl/BusIntervalServiceImpl.java
| @@ -400,7 +400,7 @@ public class BusIntervalServiceImpl implements BusIntervalService { | @@ -400,7 +400,7 @@ public class BusIntervalServiceImpl implements BusIntervalService { | ||
| 400 | sql += " and cl.line_code = '"+line+"'"; | 400 | sql += " and cl.line_code = '"+line+"'"; |
| 401 | if(ttId.length() != 0) | 401 | if(ttId.length() != 0) |
| 402 | sql += " and td.ttinfo = '"+ttId+"'"; | 402 | sql += " and td.ttinfo = '"+ttId+"'"; |
| 403 | - sql += " group by td.lp"; | 403 | + sql += " group by td.lp, lp.lp_name"; |
| 404 | 404 | ||
| 405 | list = jdbcTemplate.query(sql, | 405 | list = jdbcTemplate.query(sql, |
| 406 | new RowMapper<Map<String, Object>>(){ | 406 | new RowMapper<Map<String, Object>>(){ |
| @@ -505,7 +505,7 @@ public class BusIntervalServiceImpl implements BusIntervalService { | @@ -505,7 +505,7 @@ public class BusIntervalServiceImpl implements BusIntervalService { | ||
| 505 | } | 505 | } |
| 506 | 506 | ||
| 507 | String key = schedule.getXlBm() + "/" + schedule.getXlName() + "/" + schedule.getQdzName() | 507 | String key = schedule.getXlBm() + "/" + schedule.getXlName() + "/" + schedule.getQdzName() |
| 508 | - + "/" + schedule.getFgsName() + "/" + schedule.getFgsBm(); | 508 | + + "/" + schedule.getFgsBm(); |
| 509 | if(!keyMap.containsKey(key)) | 509 | if(!keyMap.containsKey(key)) |
| 510 | keyMap.put(key, new ArrayList<ScheduleRealInfo>()); | 510 | keyMap.put(key, new ArrayList<ScheduleRealInfo>()); |
| 511 | keyMap.get(key).add(schedule); | 511 | keyMap.get(key).add(schedule); |
| @@ -618,8 +618,8 @@ public class BusIntervalServiceImpl implements BusIntervalService { | @@ -618,8 +618,8 @@ public class BusIntervalServiceImpl implements BusIntervalService { | ||
| 618 | tempMap.put("line", split[1]); | 618 | tempMap.put("line", split[1]); |
| 619 | tempMap.put("qdz", split[2]); | 619 | tempMap.put("qdz", split[2]); |
| 620 | tempMap.put("company", companyName); | 620 | tempMap.put("company", companyName); |
| 621 | - tempMap.put("subCompany", split[3]); | ||
| 622 | - tempMap.put("fgsbm", split[4]); | 621 | + tempMap.put("subCompany", subCompanyName); |
| 622 | + tempMap.put("fgsbm", split[3]); | ||
| 623 | long jhInterval = 0l; | 623 | long jhInterval = 0l; |
| 624 | long sjInterval = 0l; | 624 | long sjInterval = 0l; |
| 625 | for(Long i : fcsjs) | 625 | for(Long i : fcsjs) |
| @@ -677,7 +677,7 @@ public class BusIntervalServiceImpl implements BusIntervalService { | @@ -677,7 +677,7 @@ public class BusIntervalServiceImpl implements BusIntervalService { | ||
| 677 | }else if(statu.equals("0")){ | 677 | }else if(statu.equals("0")){ |
| 678 | List<Long> longList = new ArrayList<Long>(); | 678 | List<Long> longList = new ArrayList<Long>(); |
| 679 | for(String key : keyList){ | 679 | for(String key : keyList){ |
| 680 | - long xlBm = Long.valueOf(key.split("/")[4]) * 1000000l + Long.valueOf(key.split("/")[0]); | 680 | + long xlBm = Long.valueOf(key.split("/")[3]) * 1000000l + Long.valueOf(key.split("/")[0]); |
| 681 | if(!longList.contains(xlBm)) | 681 | if(!longList.contains(xlBm)) |
| 682 | longList.add(xlBm); | 682 | longList.add(xlBm); |
| 683 | Collections.sort(longList); | 683 | Collections.sort(longList); |
| @@ -685,7 +685,7 @@ public class BusIntervalServiceImpl implements BusIntervalService { | @@ -685,7 +685,7 @@ public class BusIntervalServiceImpl implements BusIntervalService { | ||
| 685 | for(long xlBm : longList){ | 685 | for(long xlBm : longList){ |
| 686 | for(String key : keyList){ | 686 | for(String key : keyList){ |
| 687 | String[] split = key.split("/"); | 687 | String[] split = key.split("/"); |
| 688 | - long kl = Long.valueOf(split[4]) * 1000000l + Long.valueOf(split[0]); | 688 | + long kl = Long.valueOf(split[3]) * 1000000l + Long.valueOf(split[0]); |
| 689 | if(kl == xlBm){ | 689 | if(kl == xlBm){ |
| 690 | Map<String, Object> tempMap = new HashMap<String, Object>(); | 690 | Map<String, Object> tempMap = new HashMap<String, Object>(); |
| 691 | List<Long> fcsjs = new ArrayList<Long>(); | 691 | List<Long> fcsjs = new ArrayList<Long>(); |
| @@ -712,8 +712,8 @@ public class BusIntervalServiceImpl implements BusIntervalService { | @@ -712,8 +712,8 @@ public class BusIntervalServiceImpl implements BusIntervalService { | ||
| 712 | tempMap.put("line", split[1]); | 712 | tempMap.put("line", split[1]); |
| 713 | tempMap.put("qdz", split[2]); | 713 | tempMap.put("qdz", split[2]); |
| 714 | tempMap.put("company", companyName); | 714 | tempMap.put("company", companyName); |
| 715 | - tempMap.put("subCompany", split[3]); | ||
| 716 | - tempMap.put("fgsbm", split[4]); | 715 | + tempMap.put("subCompany", subCompanyName); |
| 716 | + tempMap.put("fgsbm", split[3]); | ||
| 717 | tempMap.put("jhInterval", fcsjs.size()>0?df.format((double)fcsj/fcsjs.size()):"/"); | 717 | tempMap.put("jhInterval", fcsjs.size()>0?df.format((double)fcsj/fcsjs.size()):"/"); |
| 718 | tempMap.put("sjInterval", fcsjAs.size()>0?df.format((double)fcsjA/fcsjAs.size()):"/"); | 718 | tempMap.put("sjInterval", fcsjAs.size()>0?df.format((double)fcsjA/fcsjAs.size()):"/"); |
| 719 | tempMap.put("MaxInterval", fcsjAs.size()>0?fcsjAs.get(fcsjAs.size() - 1):"/"); | 719 | tempMap.put("MaxInterval", fcsjAs.size()>0?fcsjAs.get(fcsjAs.size() - 1):"/"); |
src/main/java/com/bsth/service/impl/LineVersionsServiceImpl.java
| 1 | package com.bsth.service.impl; | 1 | package com.bsth.service.impl; |
| 2 | 2 | ||
| 3 | -import java.sql.PreparedStatement; | ||
| 4 | -import java.sql.SQLException; | ||
| 5 | -import java.text.ParseException; | ||
| 6 | -import java.text.SimpleDateFormat; | ||
| 7 | -import java.util.Date; | ||
| 8 | -import java.util.HashMap; | ||
| 9 | -import java.util.List; | ||
| 10 | -import java.util.Map; | ||
| 11 | - | ||
| 12 | -import org.springframework.beans.factory.annotation.Autowired; | ||
| 13 | -import org.springframework.jdbc.core.BatchPreparedStatementSetter; | ||
| 14 | -import org.springframework.jdbc.core.JdbcTemplate; | ||
| 15 | -import org.springframework.stereotype.Service; | ||
| 16 | -import org.springframework.transaction.annotation.Transactional; | ||
| 17 | - | ||
| 18 | import com.alibaba.fastjson.JSON; | 3 | import com.alibaba.fastjson.JSON; |
| 19 | import com.alibaba.fastjson.JSONArray; | 4 | import com.alibaba.fastjson.JSONArray; |
| 20 | import com.bsth.common.ResponseCode; | 5 | import com.bsth.common.ResponseCode; |
| @@ -31,6 +16,20 @@ import com.bsth.repository.LsStationRouteRepository; | @@ -31,6 +16,20 @@ import com.bsth.repository.LsStationRouteRepository; | ||
| 31 | import com.bsth.service.LineVersionsService; | 16 | import com.bsth.service.LineVersionsService; |
| 32 | import com.bsth.service.SectionRouteService; | 17 | import com.bsth.service.SectionRouteService; |
| 33 | import com.bsth.service.StationRouteService; | 18 | import com.bsth.service.StationRouteService; |
| 19 | +import org.springframework.beans.factory.annotation.Autowired; | ||
| 20 | +import org.springframework.jdbc.core.BatchPreparedStatementSetter; | ||
| 21 | +import org.springframework.jdbc.core.JdbcTemplate; | ||
| 22 | +import org.springframework.stereotype.Service; | ||
| 23 | +import org.springframework.transaction.annotation.Transactional; | ||
| 24 | + | ||
| 25 | +import java.sql.PreparedStatement; | ||
| 26 | +import java.sql.SQLException; | ||
| 27 | +import java.text.ParseException; | ||
| 28 | +import java.text.SimpleDateFormat; | ||
| 29 | +import java.util.Date; | ||
| 30 | +import java.util.HashMap; | ||
| 31 | +import java.util.List; | ||
| 32 | +import java.util.Map; | ||
| 34 | 33 | ||
| 35 | /** | 34 | /** |
| 36 | * | 35 | * |
| @@ -97,8 +96,10 @@ public class LineVersionsServiceImpl extends BaseServiceImpl<LineVersions, Integ | @@ -97,8 +96,10 @@ public class LineVersionsServiceImpl extends BaseServiceImpl<LineVersions, Integ | ||
| 97 | int statu = repository.update(id,line,lineCode,new java.sql.Date(startDate.getTime()), | 96 | int statu = repository.update(id,line,lineCode,new java.sql.Date(startDate.getTime()), |
| 98 | new java.sql.Date(endDate.getTime()),versions,status,remark); | 97 | new java.sql.Date(endDate.getTime()),versions,status,remark); |
| 99 | LineVersions upLineVersions = repository.findBylineIdAndVersions(line.getId(),versions); | 98 | LineVersions upLineVersions = repository.findBylineIdAndVersions(line.getId(),versions); |
| 100 | - upLineVersions.setEndDate(new java.sql.Date(startDate.getTime())); | ||
| 101 | - repository.save(upLineVersions); | 99 | + if(upLineVersions != null){ |
| 100 | + upLineVersions.setEndDate(new java.sql.Date(startDate.getTime())); | ||
| 101 | + repository.save(upLineVersions); | ||
| 102 | + } | ||
| 102 | if (statu==1) { | 103 | if (statu==1) { |
| 103 | resultMap.put("status", ResponseCode.SUCCESS); | 104 | resultMap.put("status", ResponseCode.SUCCESS); |
| 104 | } else { | 105 | } else { |
src/main/java/com/bsth/service/impl/StationRouteServiceImpl.java
| 1 | package com.bsth.service.impl; | 1 | package com.bsth.service.impl; |
| 2 | 2 | ||
| 3 | import com.bsth.common.ResponseCode; | 3 | import com.bsth.common.ResponseCode; |
| 4 | -import com.bsth.entity.*; | 4 | +import com.bsth.entity.Line; |
| 5 | +import com.bsth.entity.LsStationRoute; | ||
| 6 | +import com.bsth.entity.Station; | ||
| 7 | +import com.bsth.entity.StationRoute; | ||
| 8 | +import com.bsth.entity.StationRouteCache; | ||
| 5 | import com.bsth.entity.search.CustomerSpecs; | 9 | import com.bsth.entity.search.CustomerSpecs; |
| 6 | -import com.bsth.repository.*; | 10 | +import com.bsth.repository.LineRepository; |
| 11 | +import com.bsth.repository.LsStationRouteRepository; | ||
| 12 | +import com.bsth.repository.SectionRouteRepository; | ||
| 13 | +import com.bsth.repository.StationRepository; | ||
| 14 | +import com.bsth.repository.StationRouteCacheRepository; | ||
| 15 | +import com.bsth.repository.StationRouteRepository; | ||
| 7 | import com.bsth.service.StationRouteService; | 16 | import com.bsth.service.StationRouteService; |
| 8 | import com.bsth.util.ExcelUtil; | 17 | import com.bsth.util.ExcelUtil; |
| 9 | import com.bsth.util.FTPClientUtils; | 18 | import com.bsth.util.FTPClientUtils; |
| 10 | -import com.bsth.util.PackTarGZUtils; | ||
| 11 | import com.bsth.util.Geo.GeoUtils; | 19 | import com.bsth.util.Geo.GeoUtils; |
| 12 | import com.bsth.util.Geo.Point; | 20 | import com.bsth.util.Geo.Point; |
| 21 | +import com.bsth.util.PackTarGZUtils; | ||
| 13 | import com.bsth.util.db.DBUtils_MS; | 22 | import com.bsth.util.db.DBUtils_MS; |
| 14 | import com.google.common.base.Splitter; | 23 | import com.google.common.base.Splitter; |
| 15 | import org.springframework.beans.factory.annotation.Autowired; | 24 | import org.springframework.beans.factory.annotation.Autowired; |
| @@ -18,13 +27,17 @@ import org.springframework.data.domain.Sort.Direction; | @@ -18,13 +27,17 @@ import org.springframework.data.domain.Sort.Direction; | ||
| 18 | import org.springframework.stereotype.Service; | 27 | import org.springframework.stereotype.Service; |
| 19 | import org.springframework.transaction.annotation.Transactional; | 28 | import org.springframework.transaction.annotation.Transactional; |
| 20 | 29 | ||
| 30 | +import javax.servlet.http.HttpServletResponse; | ||
| 21 | import java.io.ByteArrayInputStream; | 31 | import java.io.ByteArrayInputStream; |
| 22 | import java.io.File; | 32 | import java.io.File; |
| 23 | import java.io.InputStream; | 33 | import java.io.InputStream; |
| 24 | import java.text.DecimalFormat; | 34 | import java.text.DecimalFormat; |
| 25 | -import java.util.*; | ||
| 26 | - | ||
| 27 | -import javax.servlet.http.HttpServletResponse; | 35 | +import java.util.ArrayList; |
| 36 | +import java.util.HashMap; | ||
| 37 | +import java.util.Iterator; | ||
| 38 | +import java.util.List; | ||
| 39 | +import java.util.Map; | ||
| 40 | +import java.util.Properties; | ||
| 28 | 41 | ||
| 29 | /** | 42 | /** |
| 30 | * | 43 | * |
| @@ -93,7 +106,7 @@ public class StationRouteServiceImpl extends BaseServiceImpl<StationRoute, Integ | @@ -93,7 +106,7 @@ public class StationRouteServiceImpl extends BaseServiceImpl<StationRoute, Integ | ||
| 93 | public Map<String, Object> getSectionRouteExport(Integer id, HttpServletResponse resp) { | 106 | public Map<String, Object> getSectionRouteExport(Integer id, HttpServletResponse resp) { |
| 94 | Map<String, Object> resultMap = new HashMap<String, Object>(); | 107 | Map<String, Object> resultMap = new HashMap<String, Object>(); |
| 95 | try { | 108 | try { |
| 96 | - // List<Map<String, Object>> resultList = new ArrayList<Map<String,Object>>(); | 109 | + // List<Map<String, Object>> resultList = new ArrayList<Map<String,Object>>(); |
| 97 | Map<String,Object> resultExcel = new HashMap<String,Object>();//导出参数的对象 | 110 | Map<String,Object> resultExcel = new HashMap<String,Object>();//导出参数的对象 |
| 98 | /* 添加表头*/ | 111 | /* 添加表头*/ |
| 99 | List<String> title = new ArrayList<String>(); | 112 | List<String> title = new ArrayList<String>(); |
| @@ -113,10 +126,10 @@ public class StationRouteServiceImpl extends BaseServiceImpl<StationRoute, Integ | @@ -113,10 +126,10 @@ public class StationRouteServiceImpl extends BaseServiceImpl<StationRoute, Integ | ||
| 113 | if(strtionList == null){ | 126 | if(strtionList == null){ |
| 114 | logger.info("没有数据导,出用户信息失败!"); | 127 | logger.info("没有数据导,出用户信息失败!"); |
| 115 | } else { | 128 | } else { |
| 116 | - | 129 | + |
| 117 | for (int i = 0; i < strtionList.size(); i++) { | 130 | for (int i = 0; i < strtionList.size(); i++) { |
| 118 | StationRoute station = strtionList.get(i); | 131 | StationRoute station = strtionList.get(i); |
| 119 | - | 132 | + |
| 120 | List<String> varList = new ArrayList<String>(); | 133 | List<String> varList = new ArrayList<String>(); |
| 121 | varList.add(station.getLine().getId().toString()); | 134 | varList.add(station.getLine().getId().toString()); |
| 122 | varList.add(station.getDirections().toString()); | 135 | varList.add(station.getDirections().toString()); |
src/main/java/com/bsth/service/impl/StationServiceImpl.java
| @@ -1372,8 +1372,11 @@ public class StationServiceImpl extends BaseServiceImpl<Station, Integer> implem | @@ -1372,8 +1372,11 @@ public class StationServiceImpl extends BaseServiceImpl<Station, Integer> implem | ||
| 1372 | // 匹配到了用数据库中的点替换 | 1372 | // 匹配到了用数据库中的点替换 |
| 1373 | if (GeoUtils.isPointInCircle(point, circle)) { | 1373 | if (GeoUtils.isPointInCircle(point, circle)) { |
| 1374 | map.put("name", s.getStationName().toString()); | 1374 | map.put("name", s.getStationName().toString()); |
| 1375 | - map.put("potion_lng", points[0]); | ||
| 1376 | - map.put("potion_lat", points[1]); | 1375 | + // 匹配到站点后用这个站点的名字,但是使用gps点作为中心点 |
| 1376 | +// map.put("potion_lng", points[0]); | ||
| 1377 | +// map.put("potion_lat", points[1]); | ||
| 1378 | + map.put("potion_lng", lon); | ||
| 1379 | + map.put("potion_lat", lat); | ||
| 1377 | map.put("isHave", "true"); | 1380 | map.put("isHave", "true"); |
| 1378 | map.put("id", s.getId()); | 1381 | map.put("id", s.getId()); |
| 1379 | isMatch = true; | 1382 | isMatch = true; |
src/main/java/com/bsth/service/oil/impl/CwjyServiceImpl.java
| @@ -328,7 +328,7 @@ public class CwjyServiceImpl extends BaseServiceImpl<Cwjy,Integer> implements Cw | @@ -328,7 +328,7 @@ public class CwjyServiceImpl extends BaseServiceImpl<Cwjy,Integer> implements Cw | ||
| 328 | } | 328 | } |
| 329 | 329 | ||
| 330 | String sql_ylb="SELECT nbbm,group_concat(jsy) AS jsy FROM bsth_c_ylb WHERE " | 330 | String sql_ylb="SELECT nbbm,group_concat(jsy) AS jsy FROM bsth_c_ylb WHERE " |
| 331 | - + " to_days(rq) = to_days('"+rq+"') AND ssgsdm = '"+gsdm+"' AND " | 331 | + + " rq = '"+rq+"' AND ssgsdm = '"+gsdm+"' AND " |
| 332 | + " fgsdm = '"+fgsdm+"' GROUP BY nbbm"; | 332 | + " fgsdm = '"+fgsdm+"' GROUP BY nbbm"; |
| 333 | 333 | ||
| 334 | List<Map<String, String>> ylbList= jdbcTemplate.query(sql_ylb, | 334 | List<Map<String, String>> ylbList= jdbcTemplate.query(sql_ylb, |
src/main/java/com/bsth/service/oil/impl/DlbServiceImpl.java
| @@ -197,6 +197,7 @@ public class DlbServiceImpl extends BaseServiceImpl<Dlb,Integer> implements DlbS | @@ -197,6 +197,7 @@ public class DlbServiceImpl extends BaseServiceImpl<Dlb,Integer> implements DlbS | ||
| 197 | t.setJsy(map.get("jGh")==null?"":map.get("jGh").toString()); | 197 | t.setJsy(map.get("jGh")==null?"":map.get("jGh").toString()); |
| 198 | t.setZlc(map.get("totalKilometers")==null?0.0:Double.parseDouble(df.format(Double.parseDouble(map.get("totalKilometers").toString())))); | 198 | t.setZlc(map.get("totalKilometers")==null?0.0:Double.parseDouble(df.format(Double.parseDouble(map.get("totalKilometers").toString())))); |
| 199 | t.setXlbm(map.get("xlBm")==null?"":map.get("xlBm").toString()); | 199 | t.setXlbm(map.get("xlBm")==null?"":map.get("xlBm").toString()); |
| 200 | + t.setLinename(map.get("lineName")==null?"":map.get("lineName").toString()); | ||
| 200 | t.setJcsx(Integer.parseInt(map.get("seqNumber").toString())); | 201 | t.setJcsx(Integer.parseInt(map.get("seqNumber").toString())); |
| 201 | t.setSsgsdm(map.get("company")==null?"":map.get("company").toString()); | 202 | t.setSsgsdm(map.get("company")==null?"":map.get("company").toString()); |
| 202 | t.setFgsdm(map.get("bCompany")==null?"":map.get("bCompany").toString()); | 203 | t.setFgsdm(map.get("bCompany")==null?"":map.get("bCompany").toString()); |
| @@ -464,6 +465,7 @@ public class DlbServiceImpl extends BaseServiceImpl<Dlb,Integer> implements DlbS | @@ -464,6 +465,7 @@ public class DlbServiceImpl extends BaseServiceImpl<Dlb,Integer> implements DlbS | ||
| 464 | t.setZlc(map.get("totalKilometers") == null ? 0.0 | 465 | t.setZlc(map.get("totalKilometers") == null ? 0.0 |
| 465 | : Double.parseDouble(map.get("totalKilometers").toString())); | 466 | : Double.parseDouble(map.get("totalKilometers").toString())); |
| 466 | t.setXlbm(map.get("xlBm") == null ? "" : map.get("xlBm").toString()); | 467 | t.setXlbm(map.get("xlBm") == null ? "" : map.get("xlBm").toString()); |
| 468 | + t.setLinename(map.get("lineName")==null?"":map.get("lineName").toString()); | ||
| 467 | t.setJcsx(Integer.parseInt(map.get("seqNumber").toString())); | 469 | t.setJcsx(Integer.parseInt(map.get("seqNumber").toString())); |
| 468 | t.setSsgsdm(map.get("company") == null ? "" : map.get("company").toString()); | 470 | t.setSsgsdm(map.get("company") == null ? "" : map.get("company").toString()); |
| 469 | t.setFgsdm(map.get("bCompany") == null ? "" : map.get("bCompany").toString()); | 471 | t.setFgsdm(map.get("bCompany") == null ? "" : map.get("bCompany").toString()); |
| @@ -660,82 +662,97 @@ public class DlbServiceImpl extends BaseServiceImpl<Dlb,Integer> implements DlbS | @@ -660,82 +662,97 @@ public class DlbServiceImpl extends BaseServiceImpl<Dlb,Integer> implements DlbS | ||
| 660 | @Override | 662 | @Override |
| 661 | public List<Dlb> listDlb(Map<String, Object> map) { | 663 | public List<Dlb> listDlb(Map<String, Object> map) { |
| 662 | // TODO Auto-generated method stub | 664 | // TODO Auto-generated method stub |
| 663 | - List<Dlb> listDlb=new ArrayList<Dlb>(); | ||
| 664 | - List<String> stringList=new ArrayList<String>(); | ||
| 665 | - String rq=map.get("rq").toString(); | ||
| 666 | - String gsbm=map.get("ssgsdm_like").toString(); | ||
| 667 | - String fgsbm=map.get("fgsdm_like").toString(); | ||
| 668 | - String xlbm=map.get("xlbm_like").toString().trim(); | ||
| 669 | - String nbbm=map.get("nbbm_eq").toString(); | ||
| 670 | - String sxtj=map.get("sxtj").toString(); | ||
| 671 | - | ||
| 672 | - if(nbbm.trim()!=""){ | ||
| 673 | - stringList.add(nbbm); | ||
| 674 | - listDlb=repository.listDlb(rq, gsbm, fgsbm, xlbm, stringList); | ||
| 675 | - }else{ | ||
| 676 | - //全部 | ||
| 677 | - if(sxtj.equals("0")){ | ||
| 678 | - List<Object[]> objectLists=repository.checkNbmmNum(rq, gsbm, fgsbm, xlbm,nbbm); | ||
| 679 | - for (int i = 0; i < objectLists.size(); i++) { | ||
| 680 | - String clbm=objectLists.get(i)[0].toString(); | ||
| 681 | - stringList.add(clbm); | ||
| 682 | - } | ||
| 683 | - if(stringList.size()>0){ | ||
| 684 | - listDlb=repository.listDlb(rq, gsbm, fgsbm, xlbm, stringList); | ||
| 685 | - } | ||
| 686 | - }else{ | ||
| 687 | - List<Object[]> objectLists; | ||
| 688 | - if(sxtj.equals("3")){ | ||
| 689 | - //有加油没里程 | ||
| 690 | - objectLists=repository.checkNbmmDl(rq, gsbm, fgsbm, xlbm, nbbm); | 665 | + List<Dlb> listDlb = new ArrayList<Dlb>(); |
| 666 | + List<String> stringList = new ArrayList<String>(); | ||
| 667 | + String rq = map.get("rq").toString(); | ||
| 668 | + String gsbm = map.get("ssgsdm_like").toString(); | ||
| 669 | + String fgsbm = map.get("fgsdm_like").toString(); | ||
| 670 | + String xlbm = map.get("xlbm_like").toString().trim(); | ||
| 671 | + String nbbm = map.get("nbbm_eq").toString(); | ||
| 672 | + String sxtj = map.get("sxtj").toString(); | ||
| 673 | + String type = map.get("type").toString(); | ||
| 674 | + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); | ||
| 675 | + try { | ||
| 676 | + if (nbbm.trim() != "") { | ||
| 677 | + stringList.add(nbbm); | ||
| 678 | + if (type.equals("1")) | ||
| 679 | + listDlb = repository.listDlb(rq, gsbm, fgsbm, xlbm, stringList); | ||
| 680 | + else | ||
| 681 | + listDlb = repository.listDlb_s(sdf.parse(rq + " 00:00:00"), gsbm, fgsbm, xlbm, stringList); | ||
| 682 | + | ||
| 683 | + } else { | ||
| 684 | + // 全部 | ||
| 685 | + if (sxtj.equals("0")) { | ||
| 686 | + List<Object[]> objectLists = repository.checkNbmmNum(rq, gsbm, fgsbm, xlbm, nbbm); | ||
| 691 | for (int i = 0; i < objectLists.size(); i++) { | 687 | for (int i = 0; i < objectLists.size(); i++) { |
| 692 | - String clbm=objectLists.get(i)[0].toString(); | ||
| 693 | - double jzl=Double.parseDouble(objectLists.get(i)[1].toString()); | ||
| 694 | - double zlc=Double.parseDouble(objectLists.get(i)[2].toString()); | ||
| 695 | - if(jzl>0 && zlc<=0){ | ||
| 696 | - stringList.add(clbm); | ||
| 697 | - } | ||
| 698 | - | 688 | + String clbm = objectLists.get(i)[0].toString(); |
| 689 | + stringList.add(clbm); | ||
| 699 | } | 690 | } |
| 700 | - | ||
| 701 | - }else if(sxtj.equals("4")){ | ||
| 702 | - //有里程没加油 | ||
| 703 | - objectLists=repository.checkNbmmDl(rq, gsbm, fgsbm, xlbm, nbbm); | ||
| 704 | - for (int i = 0; i < objectLists.size(); i++) { | ||
| 705 | - String clbm=objectLists.get(i)[0].toString(); | ||
| 706 | - double jzl=Double.parseDouble(objectLists.get(i)[1].toString()); | ||
| 707 | - double zlc=Double.parseDouble(objectLists.get(i)[2].toString()); | ||
| 708 | - if(zlc>0 && jzl<=0){ | ||
| 709 | - stringList.add(clbm); | ||
| 710 | - } | ||
| 711 | - | 691 | + if (stringList.size() > 0) { |
| 692 | + if (type.equals("1")) | ||
| 693 | + listDlb = repository.listDlb(rq, gsbm, fgsbm, xlbm, stringList); | ||
| 694 | + else | ||
| 695 | + listDlb = repository.listDlb_s(sdf.parse(rq + " 00:00:00"), gsbm, fgsbm, xlbm, stringList); | ||
| 712 | } | 696 | } |
| 713 | - }else{ | ||
| 714 | - objectLists=repository.checkNbmmNum(rq, gsbm, fgsbm, xlbm,nbbm); | ||
| 715 | - for (int i = 0; i < objectLists.size(); i++) { | ||
| 716 | - String clbm=objectLists.get(i)[0].toString(); | ||
| 717 | - int cs=Integer.parseInt(objectLists.get(i)[1].toString()); | ||
| 718 | - //一车一单 | ||
| 719 | - if(sxtj.equals("1")){ | ||
| 720 | - if(cs==1){ | 697 | + } else { |
| 698 | + List<Object[]> objectLists; | ||
| 699 | + if (sxtj.equals("3")) { | ||
| 700 | + // 有加油没里程 | ||
| 701 | + objectLists = repository.checkNbmmDl(rq, gsbm, fgsbm, xlbm, nbbm); | ||
| 702 | + for (int i = 0; i < objectLists.size(); i++) { | ||
| 703 | + String clbm = objectLists.get(i)[0].toString(); | ||
| 704 | + double jzl = Double.parseDouble(objectLists.get(i)[1].toString()); | ||
| 705 | + double zlc = Double.parseDouble(objectLists.get(i)[2].toString()); | ||
| 706 | + if (jzl > 0 && zlc <= 0) { | ||
| 721 | stringList.add(clbm); | 707 | stringList.add(clbm); |
| 722 | } | 708 | } |
| 723 | - } | ||
| 724 | - //一车多单 | ||
| 725 | - if(sxtj.equals("2")){ | ||
| 726 | - if(cs>1){ | 709 | + |
| 710 | + } | ||
| 711 | + | ||
| 712 | + } else if (sxtj.equals("4")) { | ||
| 713 | + // 有里程没加油 | ||
| 714 | + objectLists = repository.checkNbmmDl(rq, gsbm, fgsbm, xlbm, nbbm); | ||
| 715 | + for (int i = 0; i < objectLists.size(); i++) { | ||
| 716 | + String clbm = objectLists.get(i)[0].toString(); | ||
| 717 | + double jzl = Double.parseDouble(objectLists.get(i)[1].toString()); | ||
| 718 | + double zlc = Double.parseDouble(objectLists.get(i)[2].toString()); | ||
| 719 | + if (zlc > 0 && jzl <= 0) { | ||
| 727 | stringList.add(clbm); | 720 | stringList.add(clbm); |
| 728 | } | 721 | } |
| 722 | + | ||
| 723 | + } | ||
| 724 | + } else { | ||
| 725 | + objectLists = repository.checkNbmmNum(rq, gsbm, fgsbm, xlbm, nbbm); | ||
| 726 | + for (int i = 0; i < objectLists.size(); i++) { | ||
| 727 | + String clbm = objectLists.get(i)[0].toString(); | ||
| 728 | + int cs = Integer.parseInt(objectLists.get(i)[1].toString()); | ||
| 729 | + // 一车一单 | ||
| 730 | + if (sxtj.equals("1")) { | ||
| 731 | + if (cs == 1) { | ||
| 732 | + stringList.add(clbm); | ||
| 733 | + } | ||
| 734 | + } | ||
| 735 | + // 一车多单 | ||
| 736 | + if (sxtj.equals("2")) { | ||
| 737 | + if (cs > 1) { | ||
| 738 | + stringList.add(clbm); | ||
| 739 | + } | ||
| 740 | + } | ||
| 729 | } | 741 | } |
| 730 | } | 742 | } |
| 731 | - } | ||
| 732 | - | ||
| 733 | - if(stringList.size()>0){ | ||
| 734 | - listDlb=repository.listDlb(rq, gsbm, fgsbm, xlbm, stringList); | 743 | + |
| 744 | + if (stringList.size() > 0) { | ||
| 745 | + if (type.equals("1")) | ||
| 746 | + listDlb = repository.listDlb(rq, gsbm, fgsbm, xlbm, stringList); | ||
| 747 | + else | ||
| 748 | + listDlb = repository.listDlb_s(sdf.parse(rq + " 00:00:00"), gsbm, fgsbm, xlbm, stringList); | ||
| 749 | + } | ||
| 735 | } | 750 | } |
| 736 | } | 751 | } |
| 752 | + } catch (ParseException e) { | ||
| 753 | + // TODO Auto-generated catch block | ||
| 754 | + e.printStackTrace(); | ||
| 737 | } | 755 | } |
| 738 | - | ||
| 739 | return listDlb; | 756 | return listDlb; |
| 740 | } | 757 | } |
| 741 | 758 | ||
| @@ -749,86 +766,97 @@ public class DlbServiceImpl extends BaseServiceImpl<Dlb,Integer> implements DlbS | @@ -749,86 +766,97 @@ public class DlbServiceImpl extends BaseServiceImpl<Dlb,Integer> implements DlbS | ||
| 749 | String xlbm = map.get("xlbm_like").toString().trim(); | 766 | String xlbm = map.get("xlbm_like").toString().trim(); |
| 750 | String nbbm = map.get("nbbm_eq").toString(); | 767 | String nbbm = map.get("nbbm_eq").toString(); |
| 751 | String sxtj = map.get("sxtj").toString(); | 768 | String sxtj = map.get("sxtj").toString(); |
| 752 | - if (nbbm.trim() != "") { | ||
| 753 | - stringList.add(nbbm); | ||
| 754 | - } else { | ||
| 755 | - if (!sxtj.equals("0")) { | ||
| 756 | - List<Object[]> objectLists; | ||
| 757 | - if (sxtj.equals("3")) { | ||
| 758 | - // 有加油没里程 | ||
| 759 | - objectLists = repository.checkNbmmDl(rq, gsbm, fgsbm, xlbm, nbbm); | ||
| 760 | - for (int i = 0; i < objectLists.size(); i++) { | ||
| 761 | - String clbm = objectLists.get(i)[0].toString(); | ||
| 762 | - double jzl = Double.parseDouble(objectLists.get(i)[1].toString()); | ||
| 763 | - double zlc = Double.parseDouble(objectLists.get(i)[2].toString()); | ||
| 764 | - if (jzl > 0 && zlc <= 0) { | ||
| 765 | - stringList.add(clbm); | ||
| 766 | - } | ||
| 767 | - | ||
| 768 | - } | 769 | + String type = map.get("type").toString(); |
| 770 | + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); | ||
| 771 | + List<Object[]> sumYlbList = new ArrayList<Object[]>(); | ||
| 772 | + try { | ||
| 773 | + if (nbbm.trim() != "") { | ||
| 774 | + stringList.add(nbbm); | ||
| 775 | + } else { | ||
| 776 | + if (!sxtj.equals("0")) { | ||
| 777 | + List<Object[]> objectLists; | ||
| 778 | + if (sxtj.equals("3")) { | ||
| 779 | + // 有加油没里程 | ||
| 780 | + objectLists = repository.checkNbmmDl(rq, gsbm, fgsbm, xlbm, nbbm); | ||
| 781 | + for (int i = 0; i < objectLists.size(); i++) { | ||
| 782 | + String clbm = objectLists.get(i)[0].toString(); | ||
| 783 | + double jzl = Double.parseDouble(objectLists.get(i)[1].toString()); | ||
| 784 | + double zlc = Double.parseDouble(objectLists.get(i)[2].toString()); | ||
| 785 | + if (jzl > 0 && zlc <= 0) { | ||
| 786 | + stringList.add(clbm); | ||
| 787 | + } | ||
| 769 | 788 | ||
| 770 | - } else if (sxtj.equals("4")) { | ||
| 771 | - // 有里程没加油 | ||
| 772 | - objectLists = repository.checkNbmmDl(rq, gsbm, fgsbm, xlbm, nbbm); | ||
| 773 | - for (int i = 0; i < objectLists.size(); i++) { | ||
| 774 | - String clbm = objectLists.get(i)[0].toString(); | ||
| 775 | - double jzl = Double.parseDouble(objectLists.get(i)[1].toString()); | ||
| 776 | - double zlc = Double.parseDouble(objectLists.get(i)[2].toString()); | ||
| 777 | - if (zlc > 0 && jzl <= 0) { | ||
| 778 | - stringList.add(clbm); | ||
| 779 | } | 789 | } |
| 780 | 790 | ||
| 781 | - } | ||
| 782 | - } else { | ||
| 783 | - objectLists = repository.checkNbmmNum(rq, gsbm, fgsbm, xlbm, nbbm); | ||
| 784 | - for (int i = 0; i < objectLists.size(); i++) { | ||
| 785 | - String clbm = objectLists.get(i)[0].toString(); | ||
| 786 | - int cs = Integer.parseInt(objectLists.get(i)[1].toString()); | ||
| 787 | - // 一车一单 | ||
| 788 | - | ||
| 789 | - if (sxtj.equals("1")) { | ||
| 790 | - if (cs == 1) { | 791 | + } else if (sxtj.equals("4")) { |
| 792 | + // 有里程没加油 | ||
| 793 | + objectLists = repository.checkNbmmDl(rq, gsbm, fgsbm, xlbm, nbbm); | ||
| 794 | + for (int i = 0; i < objectLists.size(); i++) { | ||
| 795 | + String clbm = objectLists.get(i)[0].toString(); | ||
| 796 | + double jzl = Double.parseDouble(objectLists.get(i)[1].toString()); | ||
| 797 | + double zlc = Double.parseDouble(objectLists.get(i)[2].toString()); | ||
| 798 | + if (zlc > 0 && jzl <= 0) { | ||
| 791 | stringList.add(clbm); | 799 | stringList.add(clbm); |
| 792 | } | 800 | } |
| 801 | + | ||
| 793 | } | 802 | } |
| 794 | - // 一车多单 | ||
| 795 | - if (sxtj.equals("2")) { | ||
| 796 | - if (cs > 1) { | ||
| 797 | - stringList.add(clbm); | 803 | + } else { |
| 804 | + objectLists = repository.checkNbmmNum(rq, gsbm, fgsbm, xlbm, nbbm); | ||
| 805 | + for (int i = 0; i < objectLists.size(); i++) { | ||
| 806 | + String clbm = objectLists.get(i)[0].toString(); | ||
| 807 | + int cs = Integer.parseInt(objectLists.get(i)[1].toString()); | ||
| 808 | + // 一车一单 | ||
| 809 | + | ||
| 810 | + if (sxtj.equals("1")) { | ||
| 811 | + if (cs == 1) { | ||
| 812 | + stringList.add(clbm); | ||
| 813 | + } | ||
| 814 | + } | ||
| 815 | + // 一车多单 | ||
| 816 | + if (sxtj.equals("2")) { | ||
| 817 | + if (cs > 1) { | ||
| 818 | + stringList.add(clbm); | ||
| 819 | + } | ||
| 798 | } | 820 | } |
| 799 | } | 821 | } |
| 800 | } | 822 | } |
| 801 | } | 823 | } |
| 802 | } | 824 | } |
| 803 | - } | ||
| 804 | - List<Object[]> sumYlbList = new ArrayList<Object[]>(); | ||
| 805 | if (sxtj.equals("0")) { | 825 | if (sxtj.equals("0")) { |
| 806 | sumYlbList = repository.sumDlb2(rq, gsbm, fgsbm, xlbm, nbbm); | 826 | sumYlbList = repository.sumDlb2(rq, gsbm, fgsbm, xlbm, nbbm); |
| 807 | } else { | 827 | } else { |
| 808 | if (stringList.size() > 0) { | 828 | if (stringList.size() > 0) { |
| 809 | - | 829 | + |
| 810 | // String strings[]=new String[stringList.size()]; | 830 | // String strings[]=new String[stringList.size()]; |
| 811 | // for(int i=0;i<stringList.size();i++){ | 831 | // for(int i=0;i<stringList.size();i++){ |
| 812 | // strings[i]=stringList.get(i); | 832 | // strings[i]=stringList.get(i); |
| 813 | // } | 833 | // } |
| 814 | - sumYlbList = repository.sumDlb(rq, gsbm, fgsbm, xlbm, stringList); | ||
| 815 | - } | ||
| 816 | -// else { | ||
| 817 | -// sumYlbList = repository.sumDlb2(rq, gsbm, fgsbm, xlbm, nbbm); | ||
| 818 | -// } | ||
| 819 | - } | ||
| 820 | - Double jzl = 0.0, yh = 0.0, sh = 0.0; | ||
| 821 | - for (int i = 0; i < sumYlbList.size(); i++) { | ||
| 822 | - jzl = Arith.add(jzl, Double.valueOf(sumYlbList.get(i)[0].toString())); | ||
| 823 | - yh = Arith.add(yh, Double.valueOf(sumYlbList.get(i)[1].toString())); | ||
| 824 | - sh = Arith.add(sh, Double.valueOf(sumYlbList.get(i)[2].toString())); | 834 | + if (type.equals("1")) |
| 835 | + sumYlbList = repository.sumDlb(rq, gsbm, fgsbm, xlbm, stringList); | ||
| 836 | + else | ||
| 837 | + sumYlbList = repository.sumDlb_s(sdf.parse(rq + " 00:00:00"), gsbm, fgsbm, xlbm, stringList); | ||
| 838 | + | ||
| 839 | + } | ||
| 840 | + // else { | ||
| 841 | + // sumYlbList = repository.sumDlb2(rq, gsbm, fgsbm, xlbm, nbbm); | ||
| 842 | + // } | ||
| 825 | } | 843 | } |
| 826 | - | ||
| 827 | - Map<String, Object> sumMap = new HashMap<String, Object>(); | ||
| 828 | - sumMap.put("jzl", jzl); | ||
| 829 | - sumMap.put("yh", yh); | ||
| 830 | - sumMap.put("sh", sh); | ||
| 831 | - return sumMap; | 844 | + } catch (ParseException e) { |
| 845 | + // TODO Auto-generated catch block | ||
| 846 | + e.printStackTrace(); | ||
| 847 | + } | ||
| 848 | + Double jzl = 0.0, yh = 0.0, sh = 0.0; | ||
| 849 | + for (int i = 0; i < sumYlbList.size(); i++) { | ||
| 850 | + jzl = Arith.add(jzl, Double.valueOf(sumYlbList.get(i)[0].toString())); | ||
| 851 | + yh = Arith.add(yh, Double.valueOf(sumYlbList.get(i)[1].toString())); | ||
| 852 | + sh = Arith.add(sh, Double.valueOf(sumYlbList.get(i)[2].toString())); | ||
| 853 | + } | ||
| 854 | + | ||
| 855 | + Map<String, Object> sumMap = new HashMap<String, Object>(); | ||
| 856 | + sumMap.put("jzl", jzl); | ||
| 857 | + sumMap.put("yh", yh); | ||
| 858 | + sumMap.put("sh", sh); | ||
| 859 | + return sumMap; | ||
| 832 | } | 860 | } |
| 833 | 861 | ||
| 834 | 862 | ||
| @@ -884,7 +912,7 @@ public class DlbServiceImpl extends BaseServiceImpl<Dlb,Integer> implements DlbS | @@ -884,7 +912,7 @@ public class DlbServiceImpl extends BaseServiceImpl<Dlb,Integer> implements DlbS | ||
| 884 | String px) { | 912 | String px) { |
| 885 | // TODO Auto-generated method stub | 913 | // TODO Auto-generated method stub |
| 886 | String sql="SELECT * FROM bsth_c_dlb " | 914 | String sql="SELECT * FROM bsth_c_dlb " |
| 887 | - + " where to_days('"+rq+"')=to_days(rq) and ssgsdm like '%"+gsdm+"%' " | 915 | + + " where rq='"+rq+"' and ssgsdm like '%"+gsdm+"%' " |
| 888 | + " and fgsdm like '%"+fgsdm+"%'"; | 916 | + " and fgsdm like '%"+fgsdm+"%'"; |
| 889 | if(xlbm.equals("")){ | 917 | if(xlbm.equals("")){ |
| 890 | sql+= " and xlbm like '%"+xlbm+"%' "; | 918 | sql+= " and xlbm like '%"+xlbm+"%' "; |
src/main/java/com/bsth/service/oil/impl/YlbServiceImpl.java
| @@ -194,6 +194,7 @@ public class YlbServiceImpl extends BaseServiceImpl<Ylb,Integer> implements YlbS | @@ -194,6 +194,7 @@ public class YlbServiceImpl extends BaseServiceImpl<Ylb,Integer> implements YlbS | ||
| 194 | t.setJsy(map.get("jGh")==null?"":map.get("jGh").toString()); | 194 | t.setJsy(map.get("jGh")==null?"":map.get("jGh").toString()); |
| 195 | t.setZlc(map.get("totalKilometers")==null?0.0:Double.parseDouble(map.get("totalKilometers").toString())); | 195 | t.setZlc(map.get("totalKilometers")==null?0.0:Double.parseDouble(map.get("totalKilometers").toString())); |
| 196 | t.setXlbm(map.get("xlBm")==null?"":map.get("xlBm").toString()); | 196 | t.setXlbm(map.get("xlBm")==null?"":map.get("xlBm").toString()); |
| 197 | + t.setLinename(map.get("lineName")==null?"":map.get("lineName").toString()); | ||
| 197 | t.setJcsx(Integer.parseInt(map.get("seqNumber").toString())); | 198 | t.setJcsx(Integer.parseInt(map.get("seqNumber").toString())); |
| 198 | t.setSsgsdm(map.get("company")==null?"":map.get("company").toString()); | 199 | t.setSsgsdm(map.get("company")==null?"":map.get("company").toString()); |
| 199 | t.setFgsdm(map.get("bCompany")==null?"":map.get("bCompany").toString()); | 200 | t.setFgsdm(map.get("bCompany")==null?"":map.get("bCompany").toString()); |
| @@ -492,6 +493,7 @@ public class YlbServiceImpl extends BaseServiceImpl<Ylb,Integer> implements YlbS | @@ -492,6 +493,7 @@ public class YlbServiceImpl extends BaseServiceImpl<Ylb,Integer> implements YlbS | ||
| 492 | t.setZlc(map.get("totalKilometers") == null ? 0.0 | 493 | t.setZlc(map.get("totalKilometers") == null ? 0.0 |
| 493 | : Double.parseDouble(map.get("totalKilometers").toString())); | 494 | : Double.parseDouble(map.get("totalKilometers").toString())); |
| 494 | t.setXlbm(map.get("xlBm") == null ? "" : map.get("xlBm").toString()); | 495 | t.setXlbm(map.get("xlBm") == null ? "" : map.get("xlBm").toString()); |
| 496 | + t.setLinename(map.get("lineName")==null?"":map.get("lineName").toString()); | ||
| 495 | t.setJcsx(Integer.parseInt(map.get("seqNumber").toString())); | 497 | t.setJcsx(Integer.parseInt(map.get("seqNumber").toString())); |
| 496 | t.setSsgsdm(map.get("company") == null ? "" : map.get("company").toString()); | 498 | t.setSsgsdm(map.get("company") == null ? "" : map.get("company").toString()); |
| 497 | t.setFgsdm(map.get("bCompany") == null ? "" : map.get("bCompany").toString()); | 499 | t.setFgsdm(map.get("bCompany") == null ? "" : map.get("bCompany").toString()); |
| @@ -1106,6 +1108,10 @@ public class YlbServiceImpl extends BaseServiceImpl<Ylb,Integer> implements YlbS | @@ -1106,6 +1108,10 @@ public class YlbServiceImpl extends BaseServiceImpl<Ylb,Integer> implements YlbS | ||
| 1106 | String xlbm=map.get("xlbm_like").toString().trim(); | 1108 | String xlbm=map.get("xlbm_like").toString().trim(); |
| 1107 | String nbbm=map.get("nbbm_eq").toString(); | 1109 | String nbbm=map.get("nbbm_eq").toString(); |
| 1108 | String sxtj=map.get("sxtj").toString(); | 1110 | String sxtj=map.get("sxtj").toString(); |
| 1111 | + String type=map.get("type").toString(); | ||
| 1112 | + SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); | ||
| 1113 | + List<Object[]> sumYlbList=new ArrayList<Object[]>(); | ||
| 1114 | + try { | ||
| 1109 | if(nbbm.trim()!=""){ | 1115 | if(nbbm.trim()!=""){ |
| 1110 | stringList.add(nbbm); | 1116 | stringList.add(nbbm); |
| 1111 | }else{ | 1117 | }else{ |
| @@ -1158,7 +1164,6 @@ public class YlbServiceImpl extends BaseServiceImpl<Ylb,Integer> implements YlbS | @@ -1158,7 +1164,6 @@ public class YlbServiceImpl extends BaseServiceImpl<Ylb,Integer> implements YlbS | ||
| 1158 | } | 1164 | } |
| 1159 | } | 1165 | } |
| 1160 | } | 1166 | } |
| 1161 | - List<Object[]> sumYlbList=new ArrayList<Object[]>(); | ||
| 1162 | if(sxtj.equals("0")){ | 1167 | if(sxtj.equals("0")){ |
| 1163 | sumYlbList=repository.sumYlb2(rq, gsbm, fgsbm, xlbm,nbbm); | 1168 | sumYlbList=repository.sumYlb2(rq, gsbm, fgsbm, xlbm,nbbm); |
| 1164 | }else{ | 1169 | }else{ |
| @@ -1168,14 +1173,20 @@ public class YlbServiceImpl extends BaseServiceImpl<Ylb,Integer> implements YlbS | @@ -1168,14 +1173,20 @@ public class YlbServiceImpl extends BaseServiceImpl<Ylb,Integer> implements YlbS | ||
| 1168 | // for(int i=0;i<stringList.size();i++){ | 1173 | // for(int i=0;i<stringList.size();i++){ |
| 1169 | // strings[i]=stringList.get(i); | 1174 | // strings[i]=stringList.get(i); |
| 1170 | // } | 1175 | // } |
| 1171 | - sumYlbList=repository.sumYlb(rq, gsbm, fgsbm, xlbm, stringList); | 1176 | + if (type.equals("1")) |
| 1177 | + sumYlbList=repository.sumYlb(rq, gsbm, fgsbm, xlbm, stringList); | ||
| 1178 | + else | ||
| 1179 | + sumYlbList=repository.sumYlb_s(sdf.parse(rq+" 00:00:00"), gsbm, fgsbm, xlbm, stringList); | ||
| 1172 | } | 1180 | } |
| 1173 | // else{ | 1181 | // else{ |
| 1174 | // sumYlbList=repository.sumYlb2(rq, gsbm, fgsbm, xlbm, nbbm); | 1182 | // sumYlbList=repository.sumYlb2(rq, gsbm, fgsbm, xlbm, nbbm); |
| 1175 | // } | 1183 | // } |
| 1176 | 1184 | ||
| 1177 | } | 1185 | } |
| 1178 | - | 1186 | + } catch (ParseException e) { |
| 1187 | + // TODO Auto-generated catch block | ||
| 1188 | + e.printStackTrace(); | ||
| 1189 | + } | ||
| 1179 | Double jzl=0.0,yh=0.0,sh=0.0; | 1190 | Double jzl=0.0,yh=0.0,sh=0.0; |
| 1180 | for (int i = 0; i < sumYlbList.size(); i++) { | 1191 | for (int i = 0; i < sumYlbList.size(); i++) { |
| 1181 | jzl = Arith.add(jzl, Double.valueOf(sumYlbList.get(i)[0].toString())); | 1192 | jzl = Arith.add(jzl, Double.valueOf(sumYlbList.get(i)[0].toString())); |
| @@ -1187,6 +1198,7 @@ public class YlbServiceImpl extends BaseServiceImpl<Ylb,Integer> implements YlbS | @@ -1187,6 +1198,7 @@ public class YlbServiceImpl extends BaseServiceImpl<Ylb,Integer> implements YlbS | ||
| 1187 | sumMap.put("jzl", jzl); | 1198 | sumMap.put("jzl", jzl); |
| 1188 | sumMap.put("yh", yh); | 1199 | sumMap.put("yh", yh); |
| 1189 | sumMap.put("sh", sh); | 1200 | sumMap.put("sh", sh); |
| 1201 | + | ||
| 1190 | // String sql="select sum(jzl),sum(yh),sum(sh) from bsth_c_ylb " | 1202 | // String sql="select sum(jzl),sum(yh),sum(sh) from bsth_c_ylb " |
| 1191 | // + " where to_days('"+map.get("rq").toString()+"')=to_days(rq) " | 1203 | // + " where to_days('"+map.get("rq").toString()+"')=to_days(rq) " |
| 1192 | // + " and ssgsdm like '%"+map.get("ssgsdm_like").toString()+"%' " | 1204 | // + " and ssgsdm like '%"+map.get("ssgsdm_like").toString()+"%' " |
| @@ -1204,96 +1216,118 @@ public class YlbServiceImpl extends BaseServiceImpl<Ylb,Integer> implements YlbS | @@ -1204,96 +1216,118 @@ public class YlbServiceImpl extends BaseServiceImpl<Ylb,Integer> implements YlbS | ||
| 1204 | @Override | 1216 | @Override |
| 1205 | public List<Ylb> listYlb(Map<String, Object> map) { | 1217 | public List<Ylb> listYlb(Map<String, Object> map) { |
| 1206 | // TODO Auto-generated method stub | 1218 | // TODO Auto-generated method stub |
| 1207 | - List<Ylb> listYlb=new ArrayList<Ylb>(); | ||
| 1208 | - List<String> stringList=new ArrayList<String>(); | ||
| 1209 | - String rq=map.get("rq").toString(); | ||
| 1210 | - String gsbm=map.get("ssgsdm_like").toString(); | ||
| 1211 | - String fgsbm=map.get("fgsdm_like").toString(); | ||
| 1212 | - String xlbm=map.get("xlbm_like").toString().trim(); | ||
| 1213 | - String nbbm=map.get("nbbm_eq").toString(); | ||
| 1214 | - String sxtj=map.get("sxtj").toString(); | ||
| 1215 | - if(nbbm.trim()!=""){ | ||
| 1216 | - stringList.add(nbbm); | ||
| 1217 | - List<Object[]> objectLists=repository.checkNbmmNum(rq, gsbm, fgsbm, xlbm,nbbm); | ||
| 1218 | - if(objectLists.size()>0){ | ||
| 1219 | - int cs=Integer.parseInt(objectLists.get(0)[1].toString()); | ||
| 1220 | - if(sxtj.equals("1")){ | ||
| 1221 | - if(cs==1){ | ||
| 1222 | - listYlb=repository.listYlb(rq, gsbm, fgsbm, xlbm, stringList); | ||
| 1223 | - } | ||
| 1224 | - }else if(sxtj.equals("2")){ | ||
| 1225 | - if(cs>1){ | ||
| 1226 | - listYlb=repository.listYlb(rq, gsbm, fgsbm, xlbm, stringList); | 1219 | + List<Ylb> listYlb = new ArrayList<Ylb>(); |
| 1220 | + try { | ||
| 1221 | + List<String> stringList = new ArrayList<String>(); | ||
| 1222 | + String rq = map.get("rq").toString(); | ||
| 1223 | + String gsbm = map.get("ssgsdm_like").toString(); | ||
| 1224 | + String fgsbm = map.get("fgsdm_like").toString(); | ||
| 1225 | + String xlbm = map.get("xlbm_like").toString().trim(); | ||
| 1226 | + String nbbm = map.get("nbbm_eq").toString(); | ||
| 1227 | + String sxtj = map.get("sxtj").toString(); | ||
| 1228 | + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); | ||
| 1229 | + String type = map.get("type").toString(); | ||
| 1230 | + if (nbbm.trim() != "") { | ||
| 1231 | + stringList.add(nbbm); | ||
| 1232 | + List<Object[]> objectLists = repository.checkNbmmNum(rq, gsbm, fgsbm, xlbm, nbbm); | ||
| 1233 | + if (objectLists.size() > 0) { | ||
| 1234 | + int cs = Integer.parseInt(objectLists.get(0)[1].toString()); | ||
| 1235 | + if (sxtj.equals("1")) { | ||
| 1236 | + if (cs == 1) { | ||
| 1237 | + if (type.equals("1")) | ||
| 1238 | + listYlb = repository.listYlb(rq, gsbm, fgsbm, xlbm, stringList); | ||
| 1239 | + else | ||
| 1240 | + listYlb = repository.listYlb_s(sdf.parse(rq+" 00:00:00"), gsbm, fgsbm, xlbm, stringList); | ||
| 1241 | + | ||
| 1242 | + } | ||
| 1243 | + } else if (sxtj.equals("2")) { | ||
| 1244 | + if (cs > 1) { | ||
| 1245 | + if (type.equals("1")) | ||
| 1246 | + listYlb = repository.listYlb(rq, gsbm, fgsbm, xlbm, stringList); | ||
| 1247 | + else | ||
| 1248 | + listYlb = repository.listYlb_s(sdf.parse(rq+" 00:00:00"), gsbm, fgsbm, xlbm, stringList); | ||
| 1249 | + } | ||
| 1250 | + } else { | ||
| 1251 | + if (type.equals("1")) | ||
| 1252 | + listYlb = repository.listYlb(rq, gsbm, fgsbm, xlbm, stringList); | ||
| 1253 | + else | ||
| 1254 | + listYlb = repository.listYlb_s(sdf.parse(rq+" 00:00:00"), gsbm, fgsbm, xlbm, stringList); | ||
| 1227 | } | 1255 | } |
| 1228 | - }else{ | ||
| 1229 | - listYlb=repository.listYlb(rq, gsbm, fgsbm, xlbm, stringList); | ||
| 1230 | - } | ||
| 1231 | - } | ||
| 1232 | - | ||
| 1233 | - }else{ | ||
| 1234 | - //全部 | ||
| 1235 | - if(sxtj.equals("0")){ | ||
| 1236 | - List<Object[]> objectLists=repository.checkNbmmNum(rq, gsbm, fgsbm, xlbm,nbbm); | ||
| 1237 | - for (int i = 0; i < objectLists.size(); i++) { | ||
| 1238 | - String clbm=objectLists.get(i)[0].toString(); | ||
| 1239 | - stringList.add(clbm); | ||
| 1240 | - } | ||
| 1241 | - if(stringList.size()>0){ | ||
| 1242 | - listYlb=repository.listYlb(rq, gsbm, fgsbm, xlbm, stringList); | ||
| 1243 | } | 1256 | } |
| 1244 | - }else{ | ||
| 1245 | - List<Object[]> objectLists; | ||
| 1246 | - if(sxtj.equals("3")){ | ||
| 1247 | - //有加油没里程 | ||
| 1248 | - objectLists=repository.checkNbmmYl(rq, gsbm, fgsbm, xlbm, nbbm); | 1257 | + |
| 1258 | + } else { | ||
| 1259 | + // 全部 | ||
| 1260 | + if (sxtj.equals("0")) { | ||
| 1261 | + List<Object[]> objectLists = repository.checkNbmmNum(rq, gsbm, fgsbm, xlbm, nbbm); | ||
| 1249 | for (int i = 0; i < objectLists.size(); i++) { | 1262 | for (int i = 0; i < objectLists.size(); i++) { |
| 1250 | - String clbm=objectLists.get(i)[0].toString(); | ||
| 1251 | - double jzl=Double.parseDouble(objectLists.get(i)[1].toString()); | ||
| 1252 | - double zlc=Double.parseDouble(objectLists.get(i)[2].toString()); | ||
| 1253 | - if(jzl>0 && zlc<=0){ | ||
| 1254 | - stringList.add(clbm); | ||
| 1255 | - } | ||
| 1256 | - | 1263 | + String clbm = objectLists.get(i)[0].toString(); |
| 1264 | + stringList.add(clbm); | ||
| 1257 | } | 1265 | } |
| 1258 | - | ||
| 1259 | - }else if(sxtj.equals("4")){ | ||
| 1260 | - //有里程没加油 | ||
| 1261 | - objectLists=repository.checkNbmmYl(rq, gsbm, fgsbm, xlbm, nbbm); | ||
| 1262 | - for (int i = 0; i < objectLists.size(); i++) { | ||
| 1263 | - String clbm=objectLists.get(i)[0].toString(); | ||
| 1264 | - double jzl=Double.parseDouble(objectLists.get(i)[1].toString()); | ||
| 1265 | - double zlc=Double.parseDouble(objectLists.get(i)[2].toString()); | ||
| 1266 | - if(zlc>0 && jzl<=0){ | ||
| 1267 | - stringList.add(clbm); | ||
| 1268 | - } | ||
| 1269 | - | 1266 | + if (stringList.size() > 0) { |
| 1267 | + if (type.equals("1")) | ||
| 1268 | + listYlb = repository.listYlb(rq, gsbm, fgsbm, xlbm, stringList); | ||
| 1269 | + else | ||
| 1270 | + listYlb = repository.listYlb_s(sdf.parse(rq+" 00:00:00"), gsbm, fgsbm, xlbm, stringList); | ||
| 1270 | } | 1271 | } |
| 1271 | - }else{ | ||
| 1272 | - objectLists=repository.checkNbmmNum(rq, gsbm, fgsbm, xlbm,nbbm); | ||
| 1273 | - for (int i = 0; i < objectLists.size(); i++) { | ||
| 1274 | - String clbm=objectLists.get(i)[0].toString(); | ||
| 1275 | - int cs=Integer.parseInt(objectLists.get(i)[1].toString()); | ||
| 1276 | - //一车一单 | ||
| 1277 | - if(sxtj.equals("1")){ | ||
| 1278 | - if(cs==1){ | 1272 | + } else { |
| 1273 | + List<Object[]> objectLists; | ||
| 1274 | + if (sxtj.equals("3")) { | ||
| 1275 | + // 有加油没里程 | ||
| 1276 | + objectLists = repository.checkNbmmYl(rq, gsbm, fgsbm, xlbm, nbbm); | ||
| 1277 | + for (int i = 0; i < objectLists.size(); i++) { | ||
| 1278 | + String clbm = objectLists.get(i)[0].toString(); | ||
| 1279 | + double jzl = Double.parseDouble(objectLists.get(i)[1].toString()); | ||
| 1280 | + double zlc = Double.parseDouble(objectLists.get(i)[2].toString()); | ||
| 1281 | + if (jzl > 0 && zlc <= 0) { | ||
| 1279 | stringList.add(clbm); | 1282 | stringList.add(clbm); |
| 1280 | } | 1283 | } |
| 1281 | - } | ||
| 1282 | - //一车多单 | ||
| 1283 | - if(sxtj.equals("2")){ | ||
| 1284 | - if(cs>1){ | 1284 | + |
| 1285 | + } | ||
| 1286 | + | ||
| 1287 | + } else if (sxtj.equals("4")) { | ||
| 1288 | + // 有里程没加油 | ||
| 1289 | + objectLists = repository.checkNbmmYl(rq, gsbm, fgsbm, xlbm, nbbm); | ||
| 1290 | + for (int i = 0; i < objectLists.size(); i++) { | ||
| 1291 | + String clbm = objectLists.get(i)[0].toString(); | ||
| 1292 | + double jzl = Double.parseDouble(objectLists.get(i)[1].toString()); | ||
| 1293 | + double zlc = Double.parseDouble(objectLists.get(i)[2].toString()); | ||
| 1294 | + if (zlc > 0 && jzl <= 0) { | ||
| 1285 | stringList.add(clbm); | 1295 | stringList.add(clbm); |
| 1286 | } | 1296 | } |
| 1297 | + | ||
| 1298 | + } | ||
| 1299 | + } else { | ||
| 1300 | + objectLists = repository.checkNbmmNum(rq, gsbm, fgsbm, xlbm, nbbm); | ||
| 1301 | + for (int i = 0; i < objectLists.size(); i++) { | ||
| 1302 | + String clbm = objectLists.get(i)[0].toString(); | ||
| 1303 | + int cs = Integer.parseInt(objectLists.get(i)[1].toString()); | ||
| 1304 | + // 一车一单 | ||
| 1305 | + if (sxtj.equals("1")) { | ||
| 1306 | + if (cs == 1) { | ||
| 1307 | + stringList.add(clbm); | ||
| 1308 | + } | ||
| 1309 | + } | ||
| 1310 | + // 一车多单 | ||
| 1311 | + if (sxtj.equals("2")) { | ||
| 1312 | + if (cs > 1) { | ||
| 1313 | + stringList.add(clbm); | ||
| 1314 | + } | ||
| 1315 | + } | ||
| 1287 | } | 1316 | } |
| 1288 | } | 1317 | } |
| 1289 | - } | ||
| 1290 | - | ||
| 1291 | - if(stringList.size()>0){ | ||
| 1292 | - listYlb=repository.listYlb(rq, gsbm, fgsbm, xlbm, stringList); | 1318 | + |
| 1319 | + if (stringList.size() > 0) { | ||
| 1320 | + if (type.equals("1")) | ||
| 1321 | + listYlb = repository.listYlb(rq, gsbm, fgsbm, xlbm, stringList); | ||
| 1322 | + else | ||
| 1323 | + listYlb = repository.listYlb_s(sdf.parse(rq+" 00:00:00"), gsbm, fgsbm, xlbm, stringList); | ||
| 1324 | + } | ||
| 1293 | } | 1325 | } |
| 1294 | } | 1326 | } |
| 1327 | + } catch (ParseException e) { | ||
| 1328 | + // TODO Auto-generated catch block | ||
| 1329 | + e.printStackTrace(); | ||
| 1295 | } | 1330 | } |
| 1296 | - | ||
| 1297 | return listYlb; | 1331 | return listYlb; |
| 1298 | } | 1332 | } |
| 1299 | 1333 |