Commit 612f7eeaec71d81dd4ecfc99e89ba73f89d71b4f
Merge branch 'minhang' of http://222.66.0.204:8090/panzhaov5/bsth_control into minhang
Showing
3 changed files
with
109 additions
and
31 deletions
src/main/java/com/bsth/service/impl/BusIntervalServiceImpl.java
| ... | ... | @@ -1102,7 +1102,7 @@ public class BusIntervalServiceImpl implements BusIntervalService { |
| 1102 | 1102 | } |
| 1103 | 1103 | for(String key : keyMap.keySet()){ |
| 1104 | 1104 | Map<String, Object> tempMap = new HashMap<String, Object>(); |
| 1105 | - int jhbc = 0, sjbc = 0, kbc = 0, mbc = 0; | |
| 1105 | + int jhbc = 0, sjbc = 0, wdfz = 0; | |
| 1106 | 1106 | long jhdf = 0l, sjdf = 0l, wddf1 = 0l, wddf2 = 0l; |
| 1107 | 1107 | long jhfc = 0l, sjfc = 0l, wdfc1 = 0l, wdfc2 = 0l; |
| 1108 | 1108 | long jhys = 0l, sjys = 0l, yssjMax = 0l, yssjMin = 0l; |
| ... | ... | @@ -1127,10 +1127,10 @@ public class BusIntervalServiceImpl implements BusIntervalService { |
| 1127 | 1127 | yssj += schedule.getZdsjActualTime() - schedule.getFcsjActualTime(); |
| 1128 | 1128 | if(schedule.getFcsjActualTime() - schedule.getFcsjT() < 0){ |
| 1129 | 1129 | wdfc1 += schedule.getFcsjT() - schedule.getFcsjActualTime(); |
| 1130 | - kbc++; | |
| 1130 | +// kbc++; | |
| 1131 | 1131 | } else if(schedule.getFcsjActualTime() - schedule.getFcsjT() > 0){ |
| 1132 | 1132 | wdfc2 += schedule.getFcsjActualTime() - schedule.getFcsjT(); |
| 1133 | - mbc++; | |
| 1133 | +// mbc++; | |
| 1134 | 1134 | } |
| 1135 | 1135 | |
| 1136 | 1136 | if(schedule.getDfsj() != null){ |
| ... | ... | @@ -1197,8 +1197,16 @@ public class BusIntervalServiceImpl implements BusIntervalService { |
| 1197 | 1197 | tempMap.put("pjys", "0分"); |
| 1198 | 1198 | tempMap.put("pjtz", "0分"); |
| 1199 | 1199 | } |
| 1200 | - tempMap.put("kbc", kbc); | |
| 1201 | - tempMap.put("mbc", mbc); | |
| 1200 | +// tempMap.put("kbc", kbc); | |
| 1201 | +// tempMap.put("mbc", mbc); | |
| 1202 | + if(!tempMap.get("jhfc").toString().equals("/") && !tempMap.get("sjfc").toString().equals("/")){ | |
| 1203 | + String[] temp1 = tempMap.get("jhfc").toString().split(":"); | |
| 1204 | + String[] temp2 = tempMap.get("sjfc").toString().split(":"); | |
| 1205 | + tempMap.put("wdfz", (Integer.valueOf(temp2[0])*60 + Integer.valueOf(temp2[1])) | |
| 1206 | + - (Integer.valueOf(temp1[0])*60 + Integer.valueOf(temp1[1]))); | |
| 1207 | + }else{ | |
| 1208 | + tempMap.put("wdfz", "/"); | |
| 1209 | + } | |
| 1202 | 1210 | tempMap.put("jhys", jhys); |
| 1203 | 1211 | tempMap.put("sjys", sjys); |
| 1204 | 1212 | tempMap.put("yssjMin", yssjMin); | ... | ... |
src/main/java/com/bsth/service/schedule/PeopleCarPlanServiceImpl.java
| ... | ... | @@ -77,6 +77,48 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { |
| 77 | 77 | schedule.setsGh(rs.getString("s_gh")); |
| 78 | 78 | schedule.setsName(rs.getString("s_name")); |
| 79 | 79 | schedule.setSpId(rs.getLong("sp_id")); |
| 80 | + | |
| 81 | + if(schedule.getFcsj() != null && schedule.getZdsj() != null){ | |
| 82 | + String[] split1 = schedule.getFcsj().split(":"); | |
| 83 | + String[] split2 = schedule.getZdsj().split(":"); | |
| 84 | + int fcsj = Integer.valueOf(split1[0]) * 60 + Integer.valueOf(split1[1]); | |
| 85 | + int zdsj = Integer.valueOf(split2[0]) * 60 + Integer.valueOf(split2[1]); | |
| 86 | + if(fcsj > zdsj){ | |
| 87 | + zdsj += 1440; | |
| 88 | + schedule.setZdsj((zdsj/60>9?zdsj/60:"0"+zdsj/60) + ":" + (zdsj%60>9?zdsj%60:"0"+zdsj%60)); | |
| 89 | + } | |
| 90 | + } | |
| 91 | + if(schedule.getFcsj() != null){ | |
| 92 | + String[] split = schedule.getFcsj().split(":"); | |
| 93 | + int fcsj = Integer.valueOf(split[0]) * 60 + Integer.valueOf(split[1]); | |
| 94 | + schedule.setFcsjT((long)fcsj); | |
| 95 | + } | |
| 96 | + if(schedule.getZdsj() != null){ | |
| 97 | + String[] split = schedule.getZdsj().split(":"); | |
| 98 | + int zdsj = Integer.valueOf(split[0]) * 60 + Integer.valueOf(split[1]); | |
| 99 | + schedule.setZdsjT((long)zdsj); | |
| 100 | + } | |
| 101 | + if(schedule.getFcsjActual() != null && schedule.getZdsjActual() != null){ | |
| 102 | + String[] split1 = schedule.getFcsjActual().split(":"); | |
| 103 | + String[] split2 = schedule.getZdsjActual().split(":"); | |
| 104 | + int fcsjA = Integer.valueOf(split1[0]) * 60 + Integer.valueOf(split1[1]); | |
| 105 | + int zdsjA = Integer.valueOf(split2[0]) * 60 + Integer.valueOf(split2[1]); | |
| 106 | + if(fcsjA > zdsjA){ | |
| 107 | + zdsjA += 1440; | |
| 108 | + schedule.setZdsjActual((zdsjA/60>9?zdsjA/60:"0"+zdsjA/60) + ":" + (zdsjA%60>9?zdsjA%60:"0"+zdsjA%60)); | |
| 109 | + } | |
| 110 | + } | |
| 111 | + if(schedule.getFcsjActual() != null){ | |
| 112 | + String[] split = schedule.getFcsjActual().split(":"); | |
| 113 | + int fcsjA = Integer.valueOf(split[0]) * 60 + Integer.valueOf(split[1]); | |
| 114 | + schedule.setFcsjActualTime((long)fcsjA); | |
| 115 | + } | |
| 116 | + if(schedule.getZdsjActual() != null){ | |
| 117 | + String[] split = schedule.getZdsjActual().split(":"); | |
| 118 | + int zdsjA = Integer.valueOf(split[0]) * 60 + Integer.valueOf(split[1]); | |
| 119 | + schedule.setZdsjActualTime((long)zdsjA); | |
| 120 | + } | |
| 121 | + | |
| 80 | 122 | return schedule; |
| 81 | 123 | } |
| 82 | 124 | }); |
| ... | ... | @@ -259,11 +301,15 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { |
| 259 | 301 | Long wgfEnd = 0l; |
| 260 | 302 | try { |
| 261 | 303 | //早晚高峰时段 |
| 262 | - zgfBegin = sdf.parse(date + "06:30").getTime(); | |
| 263 | - zgfEnd = sdf.parse(date + "08:30").getTime(); | |
| 264 | - wgfBegin = sdf.parse(date + "16:00").getTime(); | |
| 265 | - wgfEnd = sdf.parse(date + "18:00").getTime(); | |
| 266 | - } catch (ParseException e) { | |
| 304 | +// zgfBegin = sdf.parse(date + "06:30").getTime(); | |
| 305 | +// zgfEnd = sdf.parse(date + "08:30").getTime(); | |
| 306 | +// wgfBegin = sdf.parse(date + "16:00").getTime(); | |
| 307 | +// wgfEnd = sdf.parse(date + "18:00").getTime(); | |
| 308 | + zgfBegin = 6l * 60l + 30l; | |
| 309 | + zgfEnd = 8l * 60l + 30l; | |
| 310 | + wgfBegin = 16l * 60l + 0l; | |
| 311 | + wgfEnd = 18l * 60l + 0l; | |
| 312 | + } catch (Exception e) { | |
| 267 | 313 | // TODO Auto-generated catch block |
| 268 | 314 | e.printStackTrace(); |
| 269 | 315 | } |
| ... | ... | @@ -276,7 +322,7 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { |
| 276 | 322 | int jhsb = 0, sjsb = 0, jhmb = 0, sjmb = 0; |
| 277 | 323 | int jhzgf = 0, sjzgf = 0, jhwgf = 0, sjwgf = 0; |
| 278 | 324 | for(ScheduleRealInfo schedule : keyMap.get(key)){ |
| 279 | - schedule.setFcsjAll(schedule.getFcsj()); | |
| 325 | +// schedule.setFcsjAll(schedule.getFcsj()); | |
| 280 | 326 | |
| 281 | 327 | //早晚高峰时段执行率 |
| 282 | 328 | if(schedule.getFcsjT() >= zgfBegin && schedule.getFcsjT() <= zgfEnd){ |
| ... | ... | @@ -299,13 +345,13 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { |
| 299 | 345 | if(schedule.getFcsjActual() != null){ |
| 300 | 346 | if(schedule.getBcType().equals("out")) |
| 301 | 347 | sjcc++; |
| 302 | - schedule.setFcsjActualAll(schedule.getFcsjActual()); | |
| 303 | - if(schedule.getFcsjActualTime() - schedule.getFcsjT() < -60000){ | |
| 348 | +// schedule.setFcsjActualAll(schedule.getFcsjActual()); | |
| 349 | + if(schedule.getFcsjActualTime() - schedule.getFcsjT() < -1){ | |
| 304 | 350 | if(schedule.getXlDir().equals("0")) |
| 305 | 351 | upfk++; |
| 306 | 352 | else if (schedule.getXlDir().equals("1")) |
| 307 | 353 | dnfk++; |
| 308 | - } else if(schedule.getFcsjActualTime() - schedule.getFcsjT() > 180000){ | |
| 354 | + } else if(schedule.getFcsjActualTime() - schedule.getFcsjT() > 3){ | |
| 309 | 355 | if(schedule.getXlDir().equals("0")) |
| 310 | 356 | upfm++; |
| 311 | 357 | else if (schedule.getXlDir().equals("1")) |
| ... | ... | @@ -314,15 +360,16 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { |
| 314 | 360 | } |
| 315 | 361 | //到站时间快慢 |
| 316 | 362 | if(schedule.getZdsjActual() != null && schedule.getBcsj() != null){ |
| 317 | - schedule.setZdsjActualAll(schedule.getZdsjActual()); | |
| 318 | - schedule.setDfsjAll(schedule.getDfsj()); | |
| 319 | - schedule.calcEndTime(); | |
| 320 | - if(schedule.getZdsjActualTime() - schedule.getZdsjT() < -60000){ | |
| 363 | +// schedule.setZdsjActualAll(schedule.getZdsjActual()); | |
| 364 | +// schedule.setDfsjAll(schedule.getDfsj()); | |
| 365 | +// schedule.calcEndTime(); | |
| 366 | + schedule.setZdsjT(schedule.getFcsjT() + schedule.getBcsj()); | |
| 367 | + if(schedule.getZdsjActualTime() - schedule.getZdsjT() < -1){ | |
| 321 | 368 | if(schedule.getXlDir().equals("0")) |
| 322 | 369 | updk++; |
| 323 | 370 | else if (schedule.getXlDir().equals("1")) |
| 324 | 371 | dndk++; |
| 325 | - } else if(schedule.getZdsjActualTime() - schedule.getZdsjT() > 180000){ | |
| 372 | + } else if(schedule.getZdsjActualTime() - schedule.getZdsjT() > 3){ | |
| 326 | 373 | if(schedule.getXlDir().equals("0")) |
| 327 | 374 | updm++; |
| 328 | 375 | else if (schedule.getXlDir().equals("1")) |
| ... | ... | @@ -337,7 +384,7 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { |
| 337 | 384 | } |
| 338 | 385 | } |
| 339 | 386 | |
| 340 | - if(schedule.getBcType().equals("normal")){ | |
| 387 | + if(!schedule.getBcType().equals("in") && !schedule.getBcType().equals("out")){ | |
| 341 | 388 | String clZbh = schedule.getClZbh(); |
| 342 | 389 | if(!listMap.containsKey(clZbh)) |
| 343 | 390 | listMap.put(clZbh, new ArrayList<ScheduleRealInfo>()); |
| ... | ... | @@ -366,12 +413,12 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { |
| 366 | 413 | // System.out.println(moban.getFcsjActual() + "-末班-" + moban.getFcsj()); |
| 367 | 414 | jhsb++; |
| 368 | 415 | if(shouban.getFcsjActual() != null){ |
| 369 | - if(shouban.getFcsjActualTime() - shouban.getFcsjT() >= -60000 && shouban.getFcsjActualTime() - shouban.getFcsjT() <= 180000) | |
| 416 | + if(shouban.getFcsjActualTime() - shouban.getFcsjT() >= -1 && shouban.getFcsjActualTime() - shouban.getFcsjT() <= 3) | |
| 370 | 417 | sjsb++; |
| 371 | 418 | } |
| 372 | 419 | jhmb++; |
| 373 | 420 | if(moban.getFcsjActual() != null){ |
| 374 | - if(moban.getFcsjActualTime() - moban.getFcsjT() >= -60000 && moban.getFcsjActualTime() - moban.getFcsjT() <= 180000) | |
| 421 | + if(moban.getFcsjActualTime() - moban.getFcsjT() >= -1 && moban.getFcsjActualTime() - moban.getFcsjT() <= 3) | |
| 375 | 422 | sjmb++; |
| 376 | 423 | } |
| 377 | 424 | |
| ... | ... | @@ -452,7 +499,7 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { |
| 452 | 499 | if(company.length() != 0){ |
| 453 | 500 | sql += " and gs_bm = '"+company+"' and fgs_bm = '"+subCompany+"'"; |
| 454 | 501 | } |
| 455 | - sql += " and bc_type = 'normal'"; | |
| 502 | + sql += " and bc_type != 'in' and bc_type != 'out'"; | |
| 456 | 503 | |
| 457 | 504 | list = jdbcTemplate.query(sql, |
| 458 | 505 | new RowMapper<ScheduleRealInfo>(){ |
| ... | ... | @@ -471,13 +518,39 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { |
| 471 | 518 | schedule.setBcsj(rs.getInt("bcsj")); |
| 472 | 519 | schedule.setQdzName(rs.getString("qdz_name")); |
| 473 | 520 | schedule.setSpId(rs.getLong("sp_id")); |
| 521 | + | |
| 522 | + if(schedule.getFcsj() != null && schedule.getZdsj() != null){ | |
| 523 | + String[] split1 = schedule.getFcsj().split(":"); | |
| 524 | + String[] split2 = schedule.getZdsj().split(":"); | |
| 525 | + int fcsj = Integer.valueOf(split1[0]) * 60 + Integer.valueOf(split1[1]); | |
| 526 | + int zdsj = Integer.valueOf(split2[0]) * 60 + Integer.valueOf(split2[1]); | |
| 527 | + if(zdsj < fcsj){ | |
| 528 | + zdsj += 1440; | |
| 529 | + schedule.setZdsj((zdsj/60>9?zdsj/60:"0"+zdsj/60) + ":" + (zdsj%60>9?zdsj%60:"0"+zdsj%60)); | |
| 530 | + } | |
| 531 | + schedule.setFcsjT((long)fcsj); | |
| 532 | + schedule.setZdsjT((long)zdsj); | |
| 533 | + } | |
| 534 | + if(schedule.getFcsjActual() != null && schedule.getZdsjActual() != null){ | |
| 535 | + String[] split3 = schedule.getFcsjActual().split(":"); | |
| 536 | + String[] split4 = schedule.getZdsjActual().split(":"); | |
| 537 | + int fcsjA = Integer.valueOf(split3[0]) * 60 + Integer.valueOf(split3[1]); | |
| 538 | + int zdsjA = Integer.valueOf(split4[0]) * 60 + Integer.valueOf(split4[1]); | |
| 539 | + if(fcsjA > zdsjA){ | |
| 540 | + zdsjA += 1440; | |
| 541 | + schedule.setZdsjActual((zdsjA/60>9?zdsjA/60:"0"+zdsjA/60) + ":" + (zdsjA%60>9?zdsjA%60:"0"+zdsjA%60)); | |
| 542 | + } | |
| 543 | + schedule.setFcsjActualTime((long)fcsjA); | |
| 544 | + schedule.setZdsjActualTime((long)zdsjA); | |
| 545 | + } | |
| 546 | + | |
| 474 | 547 | return schedule; |
| 475 | 548 | } |
| 476 | 549 | }); |
| 477 | 550 | |
| 478 | 551 | if(model.length() != 0){ |
| 479 | -// sql = "select * from bsth_c_s_ttinfo_detail where ttinfo = '"+model+"' and bc_type = 'normal'"; | |
| 480 | - sql = "select id from bsth_c_s_sp_info where tt_info = '" + model + "' and bc_type = 'normal'"; | |
| 552 | +// sql = "select * from bsth_c_s_ttinfo_detail where ttinfo = '"+model+"' and bc_type != 'in' and bc_type != 'out'"; | |
| 553 | + sql = "select id from bsth_c_s_sp_info where tt_info = '" + model + "' and bc_type != 'in' and bc_type != 'out'"; | |
| 481 | 554 | |
| 482 | 555 | ttList = jdbcTemplate.query(sql, |
| 483 | 556 | new RowMapper<Long>(){ |
| ... | ... | @@ -784,7 +857,7 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { |
| 784 | 857 | List<ScheduleRealInfo> list = this.getSchedule(company, subCompany, line, date); |
| 785 | 858 | |
| 786 | 859 | for(ScheduleRealInfo schedule : list){ |
| 787 | - if(!schedule.getBcType().equals("normal")) | |
| 860 | + if(schedule.getBcType().equals("in") || schedule.getBcType().equals("out")) | |
| 788 | 861 | continue; |
| 789 | 862 | String key = schedule.getXlName(); |
| 790 | 863 | if(!keyMap.containsKey(key)) | ... | ... |
src/main/resources/static/pages/forms/statement/lineTimeAnaly.html
| ... | ... | @@ -121,7 +121,7 @@ |
| 121 | 121 | <th rowspan="2">日期</th> |
| 122 | 122 | <th colspan="4">到达时间</th> |
| 123 | 123 | <th colspan="4">发车时间</th> |
| 124 | - <th colspan="2">误点率</th> | |
| 124 | + <th rowspan="2">误点分钟</th> | |
| 125 | 125 | <th colspan="5">运送时间</th> |
| 126 | 126 | <th colspan="5">停站时间</th> |
| 127 | 127 | </tr> |
| ... | ... | @@ -134,8 +134,6 @@ |
| 134 | 134 | <th>实际</th> |
| 135 | 135 | <th>平均提前</th> |
| 136 | 136 | <th>平均延误</th> |
| 137 | - <th>快</th> | |
| 138 | - <th>慢</th> | |
| 139 | 137 | <th>计划</th> |
| 140 | 138 | <th>实际</th> |
| 141 | 139 | <th>最快</th> |
| ... | ... | @@ -419,8 +417,7 @@ |
| 419 | 417 | <td rowspan="{{list.workList.length}}" class="merge">{{list.wdfc1}}</td> |
| 420 | 418 | <td rowspan="{{list.workList.length}}" class="merge">{{list.wdfc2}}</td> |
| 421 | 419 | {{/if}} |
| 422 | - <td>{{obj.kbc}}</td> | |
| 423 | - <td>{{obj.mbc}}</td> | |
| 420 | + <td class="merge">{{obj.wdfz}}</td> | |
| 424 | 421 | <td>{{obj.jhys}}</td> |
| 425 | 422 | <td>{{obj.sjys}}</td> |
| 426 | 423 | <td>{{obj.yssjMin}}</td> | ... | ... |