Commit 4bbb49029219165ade2df19a44aa3ba577b2015a
Merge branch 'minhang' into pudong
Showing
132 changed files
with
3579 additions
and
1550 deletions
src/main/java/com/bsth/controller/forms/ExportController.java
| ... | ... | @@ -13,8 +13,10 @@ import org.springframework.web.bind.annotation.RequestMethod; |
| 13 | 13 | import org.springframework.web.bind.annotation.RequestParam; |
| 14 | 14 | import org.springframework.web.bind.annotation.RestController; |
| 15 | 15 | |
| 16 | +import com.bsth.data.BasicData; | |
| 16 | 17 | import com.bsth.entity.mcy_forms.Allline; |
| 17 | 18 | import com.bsth.entity.mcy_forms.Changetochange; |
| 19 | +import com.bsth.entity.mcy_forms.Daily; | |
| 18 | 20 | import com.bsth.entity.mcy_forms.Executionrate; |
| 19 | 21 | import com.bsth.entity.mcy_forms.Linepasswengerflow; |
| 20 | 22 | import com.bsth.entity.mcy_forms.Operationservice; |
| ... | ... | @@ -231,7 +233,7 @@ public class ExportController { |
| 231 | 233 | listI.add(resList.iterator()); |
| 232 | 234 | String path = this.getClass().getResource("/").getPath() + "static\\pages\\forms\\"; |
| 233 | 235 | ee.excelReplace(listI, new Object[] { map }, path + "mould\\vehicleloading.xls", |
| 234 | - path + "export\\车辆加注" + sdfSimple.format(sdfMonth.parse(map.get("dat").toString())) + ".xls"); | |
| 236 | + path + "export\\车辆加注" + sdfSimple.format(sdfMonth.parse(map.get("data").toString())) + ".xls"); | |
| 235 | 237 | } catch (Exception e) { |
| 236 | 238 | e.printStackTrace(); |
| 237 | 239 | } |
| ... | ... | @@ -319,8 +321,31 @@ public class ExportController { |
| 319 | 321 | List<Turnoutrate> turnoutrate = formsService.turnoutrate(map); |
| 320 | 322 | Map<String, Object> map1 = new HashMap<String, Object>(); |
| 321 | 323 | List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>(); |
| 324 | + /*Float xlts=0f; | |
| 325 | + Float jh=0f; | |
| 326 | + Float sj=0f; | |
| 327 | + Float qz=0f; | |
| 328 | + Float ccl=0f; | |
| 329 | + Float bcjh=0f; | |
| 330 | + Float bcsj=0f; | |
| 331 | + Float bczxl=0f; | |
| 332 | + Float gs=0f; | |
| 333 | + Float zhgs=0f;*/ | |
| 334 | + | |
| 322 | 335 | for (Turnoutrate l : turnoutrate) { |
| 323 | 336 | Map<String, Object> m = new HashMap<String, Object>(); |
| 337 | + | |
| 338 | + /* xlts +=l.getGs()==""?0f:Float.valueOf(l.getGs()); | |
| 339 | + jh +=l.getZhgs()==""?0f:Float.valueOf(l.getZhgs()); | |
| 340 | + sj +=l.getXl()==""?0f:Float.valueOf(l.getXl()); | |
| 341 | + ccl +=l.getCchjh()==""?0f:Float.valueOf(l.getCchjh()); | |
| 342 | + bcjh +=l.getCchsj()==""?0f:Float.valueOf(l.getCchsj()); | |
| 343 | + bcsj +=l.getChl()==""?0f:Float.valueOf(l.getChl()); | |
| 344 | + bczxl +=l.getBcjh()==""?0f:Float.valueOf(l.getBcjh()); | |
| 345 | + gs +=l.getBbzxl()==""?0f:Float.valueOf(l.getBbzxl()); | |
| 346 | + zhgs +=l.getBbzxl()==""?0f:Float.valueOf(l.getBbzxl()); | |
| 347 | + | |
| 348 | + */ | |
| 324 | 349 | m.put("rq", l.getRq()); |
| 325 | 350 | m.put("gs", l.getGs()); |
| 326 | 351 | m.put("zhgs", l.getZhgs()); |
| ... | ... | @@ -334,6 +359,19 @@ public class ExportController { |
| 334 | 359 | m.put("bbzxl", l.getBbzxl()); |
| 335 | 360 | m.put("sm", l.getSm()); |
| 336 | 361 | resList.add(m); |
| 362 | + | |
| 363 | + /*m=new HashMap<String,Object>(); | |
| 364 | + m.put("total_xlts", jh); | |
| 365 | + m.put("total_jh", jh); | |
| 366 | + m.put("total_sj", sj); | |
| 367 | + m.put("total_qz", qz); | |
| 368 | + m.put("total_ccl", ccl); | |
| 369 | + m.put("total_bcjh", bcjh); | |
| 370 | + m.put("total_bcsj", bcsj); | |
| 371 | + m.put("total_bczxl", bczxl); | |
| 372 | + m.put("total_gs", gs); | |
| 373 | + m.put("total_zhgs", zhgs); | |
| 374 | + */ | |
| 337 | 375 | } |
| 338 | 376 | |
| 339 | 377 | try { |
| ... | ... | @@ -356,8 +394,29 @@ public class ExportController { |
| 356 | 394 | List<Executionrate> executionrate = formsService.executionrate(map); |
| 357 | 395 | Map<String, Object> map1 = new HashMap<String, Object>(); |
| 358 | 396 | List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>(); |
| 397 | + /* Float xlts=0f; | |
| 398 | + Float jh=0f; | |
| 399 | + Float sj=0f; | |
| 400 | + Float ccl=0f; | |
| 401 | + Float bcjh=0f; | |
| 402 | + Float bcsj=0f; | |
| 403 | + Float bczxl=0f; | |
| 404 | + Float gs=0f; | |
| 405 | + Float zhgs=0f;*/ | |
| 406 | + | |
| 359 | 407 | for (Executionrate l : executionrate) { |
| 360 | 408 | Map<String, Object> m = new HashMap<String, Object>(); |
| 409 | + /* xlts +=l.getGs()==""?0f:Float.valueOf(l.getGs()); | |
| 410 | + jh +=l.getZhgs()==""?0f:Float.valueOf(l.getZhgs()); | |
| 411 | + sj +=l.getXl()==""?0f:Float.valueOf(l.getXl()); | |
| 412 | + ccl +=l.getCchjh()==""?0f:Float.valueOf(l.getCchjh()); | |
| 413 | + bcjh +=l.getCchsj()==""?0f:Float.valueOf(l.getCchsj()); | |
| 414 | + bcsj +=l.getChl()==""?0f:Float.valueOf(l.getChl()); | |
| 415 | + bczxl +=l.getBcjh()==""?0f:Float.valueOf(l.getBcjh()); | |
| 416 | + gs +=l.getBbzxl()==""?0f:Float.valueOf(l.getBbzxl()); | |
| 417 | + zhgs +=l.getBbzxl()==""?0f:Float.valueOf(l.getBbzxl()); | |
| 418 | + | |
| 419 | + */ | |
| 361 | 420 | m.put("rq", l.getRq()); |
| 362 | 421 | m.put("gs", l.getGs()); |
| 363 | 422 | m.put("zhgs", l.getZhgs()); |
| ... | ... | @@ -370,6 +429,19 @@ public class ExportController { |
| 370 | 429 | m.put("bbzxl", l.getBbzxl()); |
| 371 | 430 | m.put("sm", l.getSm()); |
| 372 | 431 | resList.add(m); |
| 432 | + | |
| 433 | + | |
| 434 | + /* m=new HashMap<String,Object>(); | |
| 435 | + m.put("total_xlts", jh); | |
| 436 | + m.put("total_jh", jh); | |
| 437 | + m.put("total_sj", sj); | |
| 438 | + m.put("total_ccl", ccl); | |
| 439 | + m.put("total_bcjh", bcjh); | |
| 440 | + m.put("total_bcsj", bcsj); | |
| 441 | + m.put("total_bczxl", bczxl); | |
| 442 | + m.put("total_gs", gs); | |
| 443 | + m.put("total_zhgs", zhgs);*/ | |
| 444 | + | |
| 373 | 445 | } |
| 374 | 446 | |
| 375 | 447 | try { |
| ... | ... | @@ -393,12 +465,31 @@ public class ExportController { |
| 393 | 465 | List<Allline> allline = formsService.allline(map); |
| 394 | 466 | Map<String, Object> map1 = new HashMap<String, Object>(); |
| 395 | 467 | List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>(); |
| 468 | + /* Integer jh=0; | |
| 469 | + Integer sj=0; | |
| 470 | + Integer ccl=0; | |
| 471 | + Integer bcjh=0; | |
| 472 | + Float bcsj=0f; | |
| 473 | + Integer bczxl=0; | |
| 474 | + Integer gs=0; | |
| 475 | + Float zhgs=0f; | |
| 476 | + */ | |
| 396 | 477 | for (Allline l : allline) { |
| 397 | 478 | Map<String, Object> m = new HashMap<String, Object>(); |
| 479 | + | |
| 480 | + /*jh +=l.getGsgs()=="" ? 0: Integer.valueOf(l.getGsgs()); | |
| 481 | + sj +=l.getFgsgs()==""?0: Integer.valueOf(l.getFgsgs()); | |
| 482 | + ccl +=l.getCchjh()==""?0: Integer.valueOf(l.getCchjh()); | |
| 483 | + bcjh +=l.getCchsj()==""?0: Integer.valueOf(l.getCchsj()); | |
| 484 | + bcsj +=l.getChl()==""?0f:Float.valueOf(l.getChl()); | |
| 485 | + bczxl +=l.getBcjh()==""?0: Integer.valueOf(l.getBcjh()); | |
| 486 | + gs +=l.getBbzxl()==""?0: Integer.valueOf(l.getBbzxl()); | |
| 487 | + zhgs +=l.getBbzxl()==""?0f:Float.valueOf(l.getBbzxl()); | |
| 488 | + */ | |
| 398 | 489 | m.put("rq", l.getRq()); |
| 399 | - m.put("gs", l.getGs()); | |
| 400 | - m.put("zhgs", l.getZhgs()); | |
| 401 | - m.put("xl", l.getXl()); | |
| 490 | + m.put("gs", l.getGsgs()); | |
| 491 | + m.put("zhgs", l.getFgsgs()); | |
| 492 | + //m.put("xl", l.getXl()); | |
| 402 | 493 | m.put("cchjh", l.getCchjh()); |
| 403 | 494 | m.put("cchsj", l.getCchsj()); |
| 404 | 495 | m.put("chl", l.getChl()); |
| ... | ... | @@ -407,6 +498,17 @@ public class ExportController { |
| 407 | 498 | m.put("bbzxl", l.getBbzxl()); |
| 408 | 499 | m.put("sm", l.getSm()); |
| 409 | 500 | resList.add(m); |
| 501 | + | |
| 502 | + /*m=new HashMap<String,Object>(); | |
| 503 | + m.put("total_jh", jh); | |
| 504 | + m.put("total_sj", sj); | |
| 505 | + m.put("total_ccl", ccl); | |
| 506 | + m.put("total_bcjh", bcjh); | |
| 507 | + m.put("total_bcsj", bcsj); | |
| 508 | + m.put("total_bczxl", bczxl); | |
| 509 | + m.put("total_gs", gs); | |
| 510 | + m.put("total_zhgs", zhgs); | |
| 511 | + */ | |
| 410 | 512 | } |
| 411 | 513 | |
| 412 | 514 | try { |
| ... | ... | @@ -422,6 +524,56 @@ public class ExportController { |
| 422 | 524 | |
| 423 | 525 | |
| 424 | 526 | |
| 527 | + //班次日报表 | |
| 528 | + @RequestMapping(value = "/dailyExport", method = RequestMethod.POST) | |
| 529 | + public List<Map<String, Object>> dailyExport(@RequestParam Map<String, Object> map) { | |
| 530 | + SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"), sdfSimple = new SimpleDateFormat("yyyyMMdd"); | |
| 531 | + List<Iterator<?>> listI = new ArrayList<Iterator<?>>(); | |
| 532 | + ReportUtils ee = new ReportUtils(); | |
| 533 | + List<Daily> allline = formsService.daily(map); | |
| 534 | + | |
| 535 | + List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>(); | |
| 536 | + Float zgl=0f; | |
| 537 | + Float ks=0f; | |
| 538 | + Float yh=0f; | |
| 539 | + Float bc=0f; | |
| 540 | + Map<String, Object> m ; | |
| 541 | + for (Daily d : allline) { | |
| 542 | + m = new HashMap<String, Object>(); | |
| 543 | + zgl +=d.getZlc()==""?0f:Float.valueOf(d.getZlc()); | |
| 544 | + ks +=d.getJzl1()==""?0f:Float.valueOf(d.getJzl1()); | |
| 545 | + yh +=d.getYh()==""?0f:Float.valueOf(d.getYh()); | |
| 546 | + bc +=d.getBc()==""?0f:Float.valueOf(d.getBc()); | |
| 547 | + m.put("zbh", d.getZbh()); | |
| 548 | + m.put("jgh",d.getJgh()); | |
| 549 | + m.put("jName", d.getjName()); | |
| 550 | + m.put("zlc", d.getZlc()); | |
| 551 | + m.put("jzl1", d.getJzl1()); | |
| 552 | + m.put("yh", d.getYh()); | |
| 553 | + m.put("bc", d.getBc()); | |
| 554 | + | |
| 555 | + resList.add(m); | |
| 556 | + } | |
| 557 | + | |
| 558 | + m=new HashMap<String,Object>(); | |
| 559 | + m.put("total_zgl", zgl); | |
| 560 | + m.put("total_ks", ks); | |
| 561 | + m.put("total_yh", yh); | |
| 562 | + m.put("total_bc", bc); | |
| 563 | + | |
| 564 | + m.put("line", BasicData.lineCode2NameMap.get(map.get("line").toString())); | |
| 565 | + m.put("date", map.get("date").toString()); | |
| 566 | + try { | |
| 567 | + listI.add(resList.iterator()); | |
| 568 | + String path = this.getClass().getResource("/").getPath() + "static\\pages\\forms\\"; | |
| 569 | + ee.excelReplace(listI, new Object[] { m }, path + "mould\\daily.xls", path + "export\\班次日报表" | |
| 570 | + + sdfSimple.format(sdfMonth.parse(map.get("date").toString())) + ".xls"); | |
| 571 | + } catch (Exception e) { | |
| 572 | + e.printStackTrace(); | |
| 573 | + } | |
| 574 | + return resList; | |
| 575 | + } | |
| 576 | + | |
| 425 | 577 | |
| 426 | 578 | |
| 427 | 579 | } | ... | ... |
src/main/java/com/bsth/controller/forms/MCY_FormsController.java
| ... | ... | @@ -11,6 +11,7 @@ import org.springframework.web.bind.annotation.RestController; |
| 11 | 11 | |
| 12 | 12 | import com.bsth.entity.mcy_forms.Allline; |
| 13 | 13 | import com.bsth.entity.mcy_forms.Changetochange; |
| 14 | +import com.bsth.entity.mcy_forms.Daily; | |
| 14 | 15 | import com.bsth.entity.mcy_forms.Executionrate; |
| 15 | 16 | import com.bsth.entity.mcy_forms.Linepasswengerflow; |
| 16 | 17 | import com.bsth.entity.mcy_forms.Operationservice; |
| ... | ... | @@ -112,4 +113,12 @@ public class MCY_FormsController { |
| 112 | 113 | |
| 113 | 114 | return formsService.allline(map); |
| 114 | 115 | } |
| 116 | + | |
| 117 | + // 营运线路名称统计表 | |
| 118 | + @RequestMapping(value = "/daily", method = RequestMethod.POST) | |
| 119 | + public List<Daily> daily(@RequestParam Map<String, Object> map) { | |
| 120 | + | |
| 121 | + return formsService.daily(map); | |
| 122 | + } | |
| 123 | + | |
| 115 | 124 | } | ... | ... |
src/main/java/com/bsth/controller/realcontrol/SignalStateController.java
0 → 100644
| 1 | +package com.bsth.controller.realcontrol; | |
| 2 | + | |
| 3 | +import com.bsth.data.gpsdata.SignalStateData; | |
| 4 | +import com.bsth.data.gpsdata.arrival.entity.SignalState; | |
| 5 | +import org.springframework.beans.factory.annotation.Autowired; | |
| 6 | +import org.springframework.web.bind.annotation.RequestMapping; | |
| 7 | +import org.springframework.web.bind.annotation.RequestParam; | |
| 8 | +import org.springframework.web.bind.annotation.RestController; | |
| 9 | + | |
| 10 | +import java.util.List; | |
| 11 | + | |
| 12 | +/** | |
| 13 | + * Created by panzhao on 2016/12/30. | |
| 14 | + */ | |
| 15 | +@RestController | |
| 16 | +@RequestMapping("signalState") | |
| 17 | +public class SignalStateController { | |
| 18 | + | |
| 19 | + @Autowired | |
| 20 | + SignalStateData signalStateData; | |
| 21 | + | |
| 22 | + @RequestMapping("/multi") | |
| 23 | + public List<SignalState> findByMultiLine(@RequestParam String idx){ | |
| 24 | + return signalStateData.get(idx); | |
| 25 | + } | |
| 26 | +} | ... | ... |
src/main/java/com/bsth/controller/report/ReportController.java
| ... | ... | @@ -64,6 +64,11 @@ public class ReportController { |
| 64 | 64 | return service.tbodyTime3(line, ttinfo); |
| 65 | 65 | } |
| 66 | 66 | |
| 67 | + @RequestMapping(value = "/tbodyTime4", method = RequestMethod.GET) | |
| 68 | + public List<Map<String, Object>> tbodyTime4(@RequestParam String line,@RequestParam String ttinfo) { | |
| 69 | + return service.tbodyTime4(line, ttinfo); | |
| 70 | + } | |
| 71 | + | |
| 67 | 72 | @RequestMapping(value = "/tbodyTime5", method = RequestMethod.GET) |
| 68 | 73 | public List<Map<String, Object>> tbodyTime5(@RequestParam String line,@RequestParam String ttinfo) { |
| 69 | 74 | return service.tbodyTime5(line, ttinfo); | ... | ... |
src/main/java/com/bsth/data/BasicData.java
| 1 | 1 | package com.bsth.data; |
| 2 | 2 | |
| 3 | 3 | import com.bsth.Application; |
| 4 | -import com.bsth.data.gpsdata.analyse.GeoCacheData; | |
| 4 | +import com.bsth.data.gpsdata.arrival.GeoCacheData; | |
| 5 | 5 | import com.bsth.entity.*; |
| 6 | 6 | import com.bsth.entity.schedule.CarConfigInfo; |
| 7 | 7 | import com.bsth.repository.*; |
| ... | ... | @@ -13,6 +13,7 @@ import org.slf4j.Logger; |
| 13 | 13 | import org.slf4j.LoggerFactory; |
| 14 | 14 | import org.springframework.beans.factory.annotation.Autowired; |
| 15 | 15 | import org.springframework.boot.CommandLineRunner; |
| 16 | +import org.springframework.core.annotation.Order; | |
| 16 | 17 | import org.springframework.stereotype.Component; |
| 17 | 18 | |
| 18 | 19 | import java.util.*; |
| ... | ... | @@ -25,13 +26,14 @@ import java.util.concurrent.TimeUnit; |
| 25 | 26 | * @date 2016年8月10日 下午3:27:45 |
| 26 | 27 | */ |
| 27 | 28 | @Component |
| 29 | +@Order(value = 1) | |
| 28 | 30 | public class BasicData implements CommandLineRunner { |
| 29 | - | |
| 30 | - //公司代码和公司名对照(K: 公司编码,V:公司名) | |
| 31 | - public static Map<String, String> businessCodeNameMap; | |
| 32 | - | |
| 33 | - //分公司公司代码和分公司公司名对照(K: 公司编码+分公司编码,V:分公司公司名) | |
| 34 | - public static Map<String, String> businessFgsCodeNameMap; | |
| 31 | + | |
| 32 | + //公司代码和公司名对照(K: 公司编码,V:公司名) | |
| 33 | + public static Map<String, String> businessCodeNameMap; | |
| 34 | + | |
| 35 | + //分公司公司代码和分公司公司名对照(K: 公司编码+分公司编码,V:分公司公司名) | |
| 36 | + public static Map<String, String> businessFgsCodeNameMap; | |
| 35 | 37 | |
| 36 | 38 | //设备号和车辆自编号 (K: 设备编码 ,V:车辆自编号) |
| 37 | 39 | public static BiMap<String, String> deviceId2NbbmMap; |
| ... | ... | @@ -39,27 +41,21 @@ public class BasicData implements CommandLineRunner { |
| 39 | 41 | //车辆自编号和公司代码对照 (K: 车辆自编号 ,V:公司代码) |
| 40 | 42 | public static Map<String, String> nbbm2CompanyCodeMap; |
| 41 | 43 | |
| 42 | - //站点编码和名称对照,包括停车场 (K: 站点编码 ,V:站点名称) | |
| 44 | + //站点编码和名称对照,包括停车场 (K: lineCode_updown_stationCode ,V:站点名称) | |
| 43 | 45 | public static Map<String, String> stationCode2NameMap; |
| 44 | 46 | |
| 45 | 47 | //线路起终点对照(线路编码_上下行_起终点) 1024_0_B (1024上行起点) |
| 46 | - public static Map<String, String> lineSEPointMap; | |
| 48 | + //public static Map<String, String> lineSEPointMap; | |
| 47 | 49 | |
| 48 | 50 | //车辆和线路对照 |
| 49 | 51 | public static Map<String, Line> nbbm2LineMap; |
| 50 | 52 | |
| 51 | - //线路和用户对照 用于webSocket定向推送消息(用户进入线调时写入数据) | |
| 52 | - //public static TreeMultimap<String, String> lineCode2SocketUserMap = TreeMultimap.create(); | |
| 53 | - | |
| 54 | 53 | //线路ID和code 对照 |
| 55 | 54 | public static BiMap<Integer, String> lineId2CodeMap; |
| 56 | 55 | |
| 57 | 56 | //线路编码和名称对照 |
| 58 | 57 | public static Map<String, String> lineCode2NameMap; |
| 59 | 58 | |
| 60 | - //线路编码_站点编码 == 0|1 上下行 | |
| 61 | - //public static Map<String, Integer> lineStationUpDownMap; | |
| 62 | - | |
| 63 | 59 | //停车场 |
| 64 | 60 | public static List<String> parkCodeList; |
| 65 | 61 | |
| ... | ... | @@ -77,7 +73,7 @@ public class BasicData implements CommandLineRunner { |
| 77 | 73 | public static Map<String, String> allPerson; |
| 78 | 74 | |
| 79 | 75 | //站点名和运管处编号 对照 |
| 80 | - public static Map<String,Integer> stationName2YgcNumber; | |
| 76 | + public static Map<String, Integer> stationName2YgcNumber; | |
| 81 | 77 | |
| 82 | 78 | |
| 83 | 79 | static Logger logger = LoggerFactory.getLogger(BasicData.class); |
| ... | ... | @@ -87,7 +83,7 @@ public class BasicData implements CommandLineRunner { |
| 87 | 83 | |
| 88 | 84 | @Override |
| 89 | 85 | public void run(String... arg0) throws Exception { |
| 90 | - Application.mainServices.scheduleWithFixedDelay(dataLoader, 2, 2, TimeUnit.HOURS); | |
| 86 | + Application.mainServices.scheduleWithFixedDelay(dataLoader, 0, 2, TimeUnit.HOURS); | |
| 91 | 87 | } |
| 92 | 88 | |
| 93 | 89 | |
| ... | ... | @@ -114,7 +110,7 @@ public class BasicData implements CommandLineRunner { |
| 114 | 110 | |
| 115 | 111 | @Autowired |
| 116 | 112 | PersonnelRepository personnelRepository; |
| 117 | - | |
| 113 | + | |
| 118 | 114 | @Autowired |
| 119 | 115 | BusinessRepository businessRepository; |
| 120 | 116 | |
| ... | ... | @@ -156,47 +152,24 @@ public class BasicData implements CommandLineRunner { |
| 156 | 152 | return 0; |
| 157 | 153 | } |
| 158 | 154 | |
| 159 | - | |
| 160 | -/* private void loadStationRouteInfo() { | |
| 161 | - Iterator<StationRoute> iterator = stationRouteRepository.findAllEffective().iterator(); | |
| 162 | - | |
| 163 | - Map<String, String> sePointMap = new HashMap<>(); | |
| 164 | - //lineSEPointMap | |
| 165 | - Map<String, Integer> map = new HashMap<>(); | |
| 166 | - | |
| 167 | - StationRoute route; | |
| 168 | - while (iterator.hasNext()) { | |
| 169 | - route = iterator.next(); | |
| 170 | - map.put(route.getLineCode() + "_" + route.getStationCode(), route.getDirections()); | |
| 171 | - | |
| 172 | - if (route.getStationMark() != null && | |
| 173 | - (route.getStationMark().equals("B") || route.getStationMark().equals("E"))) { | |
| 174 | - sePointMap.put(route.getLineCode() + "_" | |
| 175 | - + route.getDirections() | |
| 176 | - + "_" + route.getStationMark(), route.getStationCode()); | |
| 177 | - } | |
| 178 | - } | |
| 179 | - lineStationUpDownMap = map; | |
| 180 | - lineSEPointMap = sePointMap; | |
| 181 | - }*/ | |
| 182 | - | |
| 183 | 155 | /** |
| 184 | 156 | * loadBusinessInfo |
| 185 | 157 | * (公司代码公司名对照) |
| 186 | 158 | */ |
| 187 | - public void loadBusinessInfo(){ | |
| 188 | - Map<String, String> businessMap=new HashMap<String,String>(); | |
| 189 | - Map<String, String> businessFgsMap=new HashMap<String,String>(); | |
| 190 | - Iterator<Business> busIter=businessRepository.findAll().iterator(); | |
| 191 | - Business t; | |
| 192 | - while(busIter.hasNext()){ | |
| 193 | - t=busIter.next(); | |
| 194 | - businessMap.put(t.getBusinessCode(), t.getBusinessName()); | |
| 195 | - businessFgsMap.put(t.getBusinessCode()+"_"+t.getUpCode(), t.getBusinessName()); | |
| 196 | - } | |
| 197 | - businessCodeNameMap=businessMap; | |
| 198 | - businessFgsCodeNameMap=businessFgsMap; | |
| 159 | + public void loadBusinessInfo() { | |
| 160 | + Map<String, String> businessMap = new HashMap<String, String>(); | |
| 161 | + Map<String, String> businessFgsMap = new HashMap<String, String>(); | |
| 162 | + Iterator<Business> busIter = businessRepository.findAll().iterator(); | |
| 163 | + Business t; | |
| 164 | + while (busIter.hasNext()) { | |
| 165 | + t = busIter.next(); | |
| 166 | + businessMap.put(t.getBusinessCode(), t.getBusinessName()); | |
| 167 | + businessFgsMap.put(t.getBusinessCode() + "_" + t.getUpCode(), t.getBusinessName()); | |
| 168 | + } | |
| 169 | + businessCodeNameMap = businessMap; | |
| 170 | + businessFgsCodeNameMap = businessFgsMap; | |
| 199 | 171 | } |
| 172 | + | |
| 200 | 173 | /** |
| 201 | 174 | * @Title: loadDeviceInfo |
| 202 | 175 | * @Description: TODO(加载设备相关信息) |
| ... | ... | @@ -223,13 +196,13 @@ public class BasicData implements CommandLineRunner { |
| 223 | 196 | */ |
| 224 | 197 | public void loadStationInfo() { |
| 225 | 198 | Map<String, String> stationCode2Name = new HashMap<>(); |
| 226 | - Iterator<Station> iterator = stationRepository.findAll().iterator(); | |
| 227 | - //站点 | |
| 228 | - Station station; | |
| 199 | + Iterator<StationRoute> iterator = stationRouteRepository.findAll().iterator(); | |
| 200 | + StationRoute sroute; | |
| 229 | 201 | while (iterator.hasNext()) { |
| 230 | - station = iterator.next(); | |
| 231 | - stationCode2Name.put(station.getStationCod(), station.getStationName()); | |
| 202 | + sroute = iterator.next(); | |
| 203 | + stationCode2Name.put(sroute.getLineCode() + "_" + sroute.getDirections() + "_" + sroute.getStationCode(), sroute.getStationName()); | |
| 232 | 204 | } |
| 205 | + | |
| 233 | 206 | //停车场 |
| 234 | 207 | Iterator<CarPark> iterator2 = carParkRepository.findAll().iterator(); |
| 235 | 208 | |
| ... | ... | @@ -266,7 +239,7 @@ public class BasicData implements CommandLineRunner { |
| 266 | 239 | * @Title: loadLineInfo |
| 267 | 240 | * @Description: TODO(加载线路相关信息) |
| 268 | 241 | */ |
| 269 | - public void loadLineInfo(){ | |
| 242 | + public void loadLineInfo() { | |
| 270 | 243 | Iterator<Line> iterator = lineRepository.findAll().iterator(); |
| 271 | 244 | |
| 272 | 245 | Line line; |
| ... | ... | @@ -276,36 +249,36 @@ public class BasicData implements CommandLineRunner { |
| 276 | 249 | Map<String, String> code2SHcode = new HashMap<String, String>(); |
| 277 | 250 | Map<String, Integer> tempStationName2YgcNumber = new HashMap<String, Integer>(); |
| 278 | 251 | |
| 279 | - while(iterator.hasNext()){ | |
| 252 | + while (iterator.hasNext()) { | |
| 280 | 253 | line = iterator.next(); |
| 281 | 254 | biMap.put(line.getId(), line.getLineCode()); |
| 282 | 255 | code2name.put(line.getLineCode(), line.getName()); |
| 283 | - id2SHcode.put(line.getId(),line.getShanghaiLinecode()); | |
| 256 | + id2SHcode.put(line.getId(), line.getShanghaiLinecode()); | |
| 284 | 257 | code2SHcode.put(line.getLineCode(), line.getShanghaiLinecode()); |
| 285 | 258 | |
| 286 | 259 | /** |
| 287 | 260 | * 加载运管处的站点及序号 |
| 288 | 261 | * 上行从1开始,下行顺序续编 |
| 289 | 262 | |
| 290 | - List<Object[]> ygcLines = stationRouteRepository.findAllLineWithYgc(); | |
| 291 | - if(ygcLines != null && ygcLines.size() > 0){ | |
| 292 | - int size = ygcLines.size(); | |
| 293 | - Object[] tempArray ; | |
| 294 | - int num = 1; | |
| 295 | - String key; | |
| 296 | - String lineCode = ""; | |
| 297 | - for (int i = 0; i < size; i ++){ | |
| 298 | - tempArray = ygcLines.get(i); | |
| 299 | - if(lineCode.equals("")){ | |
| 300 | - lineCode = tempArray[0]+""; | |
| 301 | - }else if(!lineCode.equals(tempArray[0]+"")){ | |
| 302 | - num = 1; | |
| 303 | - lineCode = tempArray[0]+""; | |
| 304 | - } | |
| 305 | - key = tempArray[0] + "_"+tempArray[1] + "_"+tempArray[2]; | |
| 306 | - tempStationName2YgcNumber.put(key,num++); | |
| 307 | - } | |
| 308 | - }*/ | |
| 263 | + List<Object[]> ygcLines = stationRouteRepository.findAllLineWithYgc(); | |
| 264 | + if(ygcLines != null && ygcLines.size() > 0){ | |
| 265 | + int size = ygcLines.size(); | |
| 266 | + Object[] tempArray ; | |
| 267 | + int num = 1; | |
| 268 | + String key; | |
| 269 | + String lineCode = ""; | |
| 270 | + for (int i = 0; i < size; i ++){ | |
| 271 | + tempArray = ygcLines.get(i); | |
| 272 | + if(lineCode.equals("")){ | |
| 273 | + lineCode = tempArray[0]+""; | |
| 274 | + }else if(!lineCode.equals(tempArray[0]+"")){ | |
| 275 | + num = 1; | |
| 276 | + lineCode = tempArray[0]+""; | |
| 277 | + } | |
| 278 | + key = tempArray[0] + "_"+tempArray[1] + "_"+tempArray[2]; | |
| 279 | + tempStationName2YgcNumber.put(key,num++); | |
| 280 | + } | |
| 281 | + }*/ | |
| 309 | 282 | } |
| 310 | 283 | |
| 311 | 284 | lineId2CodeMap = biMap; | ... | ... |
src/main/java/com/bsth/data/LineConfigData.java
| ... | ... | @@ -10,6 +10,7 @@ import org.slf4j.Logger; |
| 10 | 10 | import org.slf4j.LoggerFactory; |
| 11 | 11 | import org.springframework.beans.factory.annotation.Autowired; |
| 12 | 12 | import org.springframework.boot.CommandLineRunner; |
| 13 | +import org.springframework.core.annotation.Order; | |
| 13 | 14 | import org.springframework.stereotype.Component; |
| 14 | 15 | |
| 15 | 16 | import java.util.*; |
| ... | ... | @@ -23,6 +24,7 @@ import java.util.*; |
| 23 | 24 | * |
| 24 | 25 | */ |
| 25 | 26 | @Component |
| 27 | +@Order(value = 2) | |
| 26 | 28 | public class LineConfigData implements CommandLineRunner { |
| 27 | 29 | |
| 28 | 30 | Logger logger = LoggerFactory.getLogger(this.getClass()); | ... | ... |
src/main/java/com/bsth/data/gpsdata/GpsEntity.java
| 1 | 1 | package com.bsth.data.gpsdata; |
| 2 | 2 | |
| 3 | -import com.bsth.data.gpsdata.analyse.StationRoute; | |
| 3 | +import com.bsth.data.gpsdata.arrival.entity.StationRoute; | |
| 4 | 4 | import com.fasterxml.jackson.annotation.JsonIgnore; |
| 5 | 5 | |
| 6 | 6 | /** |
| ... | ... | @@ -78,15 +78,15 @@ public class GpsEntity { |
| 78 | 78 | private boolean sEPoint; |
| 79 | 79 | */ |
| 80 | 80 | |
| 81 | - /** 站内 */ | |
| 82 | - private boolean instation; | |
| 81 | + /** 0: 站外 1:站内 2:场内 */ | |
| 82 | + private int instation; | |
| 83 | 83 | |
| 84 | 84 | /** 站点信息,站内时有值 */ |
| 85 | 85 | @JsonIgnore |
| 86 | 86 | private StationRoute station; |
| 87 | 87 | |
| 88 | 88 | /** 状态 */ |
| 89 | - private String state2; | |
| 89 | + private String signalState = "normal"; | |
| 90 | 90 | |
| 91 | 91 | public Integer getCompanyCode() { |
| 92 | 92 | return companyCode; |
| ... | ... | @@ -233,14 +233,6 @@ public class GpsEntity { |
| 233 | 233 | this.version = version; |
| 234 | 234 | } |
| 235 | 235 | |
| 236 | - public boolean isInstation() { | |
| 237 | - return instation; | |
| 238 | - } | |
| 239 | - | |
| 240 | - public void setInstation(boolean instation) { | |
| 241 | - this.instation = instation; | |
| 242 | - } | |
| 243 | - | |
| 244 | 236 | public StationRoute getStation() { |
| 245 | 237 | return station; |
| 246 | 238 | } |
| ... | ... | @@ -257,11 +249,19 @@ public class GpsEntity { |
| 257 | 249 | this.abnormal = abnormal; |
| 258 | 250 | } |
| 259 | 251 | |
| 260 | - public String getState2() { | |
| 261 | - return state2; | |
| 252 | + public String getSignalState() { | |
| 253 | + return signalState; | |
| 262 | 254 | } |
| 263 | 255 | |
| 264 | - public void setState2(String state2) { | |
| 265 | - this.state2 = state2; | |
| 256 | + public void setSignalState(String signalState) { | |
| 257 | + this.signalState = signalState; | |
| 258 | + } | |
| 259 | + | |
| 260 | + public int getInstation() { | |
| 261 | + return instation; | |
| 262 | + } | |
| 263 | + | |
| 264 | + public void setInstation(int instation) { | |
| 265 | + this.instation = instation; | |
| 266 | 266 | } |
| 267 | 267 | } | ... | ... |
src/main/java/com/bsth/data/gpsdata/GpsRealData.java
| ... | ... | @@ -2,11 +2,9 @@ package com.bsth.data.gpsdata; |
| 2 | 2 | |
| 3 | 3 | import com.alibaba.fastjson.JSON; |
| 4 | 4 | import com.alibaba.fastjson.JSONObject; |
| 5 | -import com.bsth.Application; | |
| 6 | 5 | import com.bsth.data.BasicData; |
| 7 | 6 | import com.bsth.data.forecast.ForecastRealServer; |
| 8 | -import com.bsth.data.gpsdata.analyse.GeoCacheData; | |
| 9 | -import com.bsth.data.gpsdata.analyse.GpsAnalyse; | |
| 7 | +import com.bsth.data.gpsdata.arrival.GpsRealAnalyse; | |
| 10 | 8 | import com.bsth.data.gpsdata.recovery.GpsDataRecovery; |
| 11 | 9 | import com.bsth.data.schedule.DayOfSchedule; |
| 12 | 10 | import com.bsth.entity.realcontrol.ScheduleRealInfo; |
| ... | ... | @@ -27,262 +25,202 @@ import org.springframework.stereotype.Component; |
| 27 | 25 | import java.io.BufferedReader; |
| 28 | 26 | import java.io.InputStreamReader; |
| 29 | 27 | import java.util.*; |
| 30 | -import java.util.concurrent.TimeUnit; | |
| 31 | 28 | |
| 32 | 29 | /** |
| 33 | - * | |
| 30 | + * @author PanZhao | |
| 34 | 31 | * @ClassName: GpsRealData |
| 35 | 32 | * @Description: TODO(实时GPS数据集合) |
| 36 | - * @author PanZhao | |
| 37 | 33 | * @date 2016年8月12日 下午2:04:41 |
| 38 | - * | |
| 39 | 34 | */ |
| 40 | 35 | @Component |
| 41 | -public class GpsRealData implements CommandLineRunner{ | |
| 42 | - | |
| 43 | - static Logger logger = LoggerFactory.getLogger(GpsRealData.class); | |
| 44 | - | |
| 45 | - private static Map<String, GpsEntity> gpsMap; | |
| 46 | - | |
| 47 | - //按线路分组设备号 | |
| 48 | - private static TreeMultimap<String, String> lineCode2Devices; | |
| 49 | - | |
| 50 | - // 网关数据接口地址 | |
| 51 | - private static String url; | |
| 52 | - | |
| 53 | - @Autowired | |
| 54 | - GpsDataLoader gpsDataLoader; | |
| 55 | - | |
| 56 | - @Autowired | |
| 57 | - DayOfSchedule dayOfSchedule; | |
| 58 | - | |
| 59 | - @Autowired | |
| 60 | - ForecastRealServer forecastRealServer; | |
| 61 | - | |
| 62 | - /** | |
| 63 | - * 构造函数 | |
| 64 | - */ | |
| 65 | - public GpsRealData(){ | |
| 66 | - gpsMap = new HashMap<>(); | |
| 67 | - lineCode2Devices = TreeMultimap.create(); | |
| 68 | - url = ConfigUtil.get("http.gps.real.url"); | |
| 69 | - } | |
| 70 | - | |
| 71 | - @Override | |
| 72 | - public void run(String... arg0) throws Exception { | |
| 73 | - logger.info("gpsDataLoader,20,6"); | |
| 74 | - Application.mainServices.scheduleWithFixedDelay(gpsDataLoader, 40, 6, TimeUnit.SECONDS); | |
| 75 | - } | |
| 76 | - | |
| 77 | - static final long CLEAR_DIFF = 1000 * 60 * 60 * 2; | |
| 78 | - public GpsEntity add(GpsEntity gps) { | |
| 79 | - String device = gps.getDeviceId(); | |
| 80 | - GpsEntity old = gpsMap.get(device); | |
| 81 | - | |
| 82 | - //断线2个小时,清除缓存数据 | |
| 83 | - if(gps.getTimestamp() - old.getTimestamp() > CLEAR_DIFF && gps.getNbbm() != null) | |
| 84 | - GeoCacheData.clear(gps.getNbbm()); | |
| 85 | - | |
| 86 | - //分析gps | |
| 87 | - if(isAvailable(gps) && (old == null || old.getTimestamp() != gps.getTimestamp())) | |
| 88 | - GpsAnalyse.start(gps); | |
| 89 | - | |
| 90 | - if(!StringUtils.isEmpty(gps.getStopNo())){ | |
| 91 | - //定时定距数据附带站点编码改变 | |
| 92 | - if(null == old || !gps.getStopNo().equals(old.getStopNo())){ | |
| 93 | - gps.setArrTime(gps.getTimestamp()); | |
| 94 | - //预测到达终点时间 | |
| 95 | - forecastRealServer.forecast(gps.getNbbm(), gps); | |
| 96 | - } | |
| 97 | - else{ | |
| 98 | - gps.setArrTime(old.getArrTime()); | |
| 99 | - //不预测, 重新计算终点时间 | |
| 100 | - gps.setExpectStopTime(forecastRealServer.expectStopTime(gps.getNbbm())); | |
| 101 | - } | |
| 102 | - } | |
| 103 | - | |
| 104 | - gpsMap.put(device, gps); | |
| 105 | - if(StringUtils.isNotBlank(gps.getLineId())) | |
| 106 | - lineCode2Devices.put(gps.getLineId(), device); | |
| 107 | - return gps; | |
| 108 | - } | |
| 109 | - | |
| 110 | - public boolean isAvailable(GpsEntity gps){ | |
| 111 | - return StringUtils.isNotEmpty(gps.getLineId()) && | |
| 112 | - dayOfSchedule.getCurrSchDate().containsKey(gps.getLineId()); | |
| 113 | - } | |
| 114 | - | |
| 115 | - /** | |
| 116 | - * | |
| 117 | - * @Title: get @Description: TODO(设备号获取GPS) | |
| 118 | - */ | |
| 119 | - public GpsEntity get(String deviceId) { | |
| 120 | - return gpsMap.get(deviceId); | |
| 121 | - } | |
| 122 | - | |
| 123 | - /** | |
| 124 | - * | |
| 125 | - * @Title: get @Description: TODO(线路编码获取GPS集合) @throws | |
| 126 | - */ | |
| 127 | - public List<GpsEntity> getByLine(String lineCode) { | |
| 128 | - NavigableSet<String> set = lineCode2Devices.get(lineCode); | |
| 129 | - | |
| 130 | - List<GpsEntity> rs = new ArrayList<>(); | |
| 131 | - GpsEntity gps; | |
| 132 | - ScheduleRealInfo sch; | |
| 133 | - for(String device : set){ | |
| 134 | - gps = gpsMap.get(device); | |
| 135 | - //过滤异常GPS数据 | |
| 136 | - if(gps.isAbnormal()) | |
| 137 | - continue; | |
| 138 | - | |
| 139 | - sch = dayOfSchedule.execPlanMap().get(gps.getNbbm()); | |
| 140 | - if(null != sch) | |
| 141 | - gps.setSchId(sch.getId()); | |
| 142 | - rs.add(gps); | |
| 143 | - } | |
| 144 | - | |
| 145 | - return rs; | |
| 146 | - } | |
| 147 | - | |
| 148 | - public List<GpsEntity> get(List<String> pArray){ | |
| 149 | - List<GpsEntity> list = new ArrayList<>(); | |
| 150 | - | |
| 151 | - for(String code : pArray) | |
| 152 | - list.addAll(getByLine(code)); | |
| 153 | - return list; | |
| 154 | - } | |
| 155 | - | |
| 156 | - public Set<String> allDevices(){ | |
| 157 | - return gpsMap.keySet(); | |
| 158 | - } | |
| 159 | - | |
| 160 | - public GpsEntity findByDeviceId(String deviceId) { | |
| 161 | - return gpsMap.get(deviceId); | |
| 162 | - } | |
| 163 | - | |
| 164 | - public Collection<GpsEntity> all(){ | |
| 165 | - return gpsMap.values(); | |
| 166 | - } | |
| 167 | - | |
| 168 | - public void remove(String device){ | |
| 169 | - gpsMap.remove(device); | |
| 170 | - } | |
| 171 | - @Component | |
| 172 | - public static class GpsDataLoader extends Thread{ | |
| 173 | - | |
| 174 | - Logger logger = LoggerFactory.getLogger(GpsDataLoader.class); | |
| 175 | - | |
| 176 | - @Autowired | |
| 177 | - GpsRealData gpsRealData; | |
| 178 | - | |
| 179 | - @Override | |
| 180 | - public void run() { | |
| 181 | - try{ | |
| 182 | - //如果正在恢复数据 | |
| 183 | - if(GpsDataRecovery.run){ | |
| 184 | - return; | |
| 185 | - } | |
| 186 | - | |
| 187 | - load(); | |
| 188 | - }catch(Exception e){ | |
| 189 | - logger.error("", e); | |
| 190 | - } | |
| 191 | - } | |
| 192 | - | |
| 193 | - public void load() throws Exception { | |
| 194 | - List<GpsEntity> list = new ArrayList<>(); | |
| 195 | - CloseableHttpClient httpClient = null; | |
| 196 | - CloseableHttpResponse response = null; | |
| 197 | - try { | |
| 198 | - httpClient = HttpClients.createDefault(); | |
| 199 | - HttpGet get = new HttpGet(url); | |
| 200 | - | |
| 201 | - response = httpClient.execute(get); | |
| 202 | - | |
| 203 | - HttpEntity entity = response.getEntity(); | |
| 204 | - if (null != entity) { | |
| 205 | - // 返回数据量比较大,建议以流的形式读取 | |
| 206 | - BufferedReader br = new BufferedReader(new InputStreamReader(entity.getContent())); | |
| 207 | - StringBuffer stringBuffer = new StringBuffer(); | |
| 208 | - String str = ""; | |
| 209 | - while ((str = br.readLine()) != null) | |
| 210 | - stringBuffer.append(str); | |
| 211 | - | |
| 212 | - JSONObject jsonObj = JSON.parseObject(stringBuffer.toString()); | |
| 213 | - | |
| 214 | - if (jsonObj != null) | |
| 215 | - list = JSON.parseArray(jsonObj.getString("data"), GpsEntity.class); | |
| 216 | - | |
| 217 | - String nbbm; | |
| 218 | - for(GpsEntity gps : list){ | |
| 219 | - //没有设备号 | |
| 220 | - if(StringUtils.isBlank(gps.getDeviceId())) | |
| 221 | - continue; | |
| 222 | - | |
| 223 | - nbbm = BasicData.deviceId2NbbmMap.get(gps.getDeviceId()); | |
| 224 | - if(StringUtils.isBlank(nbbm)) | |
| 225 | - gps.setAbnormal(true);//标记为异常数据 | |
| 226 | - else | |
| 227 | - gps.setNbbm(nbbm); | |
| 228 | - | |
| 229 | - gps.setStationName(BasicData.stationCode2NameMap.get(gps.getStopNo())); | |
| 230 | - gpsRealData.add(gps); | |
| 231 | - | |
| 232 | - //纠正走向 | |
| 233 | - //correctUpdown(gps); | |
| 234 | - } | |
| 235 | - } else | |
| 236 | - logger.error("result is null"); | |
| 237 | - } catch(Exception e){ | |
| 238 | - logger.error("", e); | |
| 239 | - } | |
| 240 | - finally { | |
| 241 | - if (null != httpClient) | |
| 242 | - httpClient.close(); | |
| 243 | - if(null != response) | |
| 244 | - response.close(); | |
| 245 | - } | |
| 246 | - } | |
| 247 | - | |
| 248 | - /** | |
| 249 | - * 是否是起终点 | |
| 250 | - * @param gps | |
| 251 | - * @return | |
| 252 | - | |
| 253 | - public boolean isSEPoint(GpsEntity gps){ | |
| 254 | - String key = gps.getLineId()+"_"+gps.getUpDown()+"_" | |
| 255 | - ,stationCode; | |
| 256 | - | |
| 257 | - if(BasicData.lineSEPointMap.containsKey(key+"B")){ | |
| 258 | - stationCode = BasicData.lineSEPointMap.get(key+"B"); | |
| 259 | - if(gps.getStopNo().equals(stationCode)){ | |
| 260 | - gps.setsEPoint(true); | |
| 261 | - return true; | |
| 262 | - } | |
| 263 | - } | |
| 264 | - | |
| 265 | - if(BasicData.lineSEPointMap.containsKey(key+"E")){ | |
| 266 | - stationCode = BasicData.lineSEPointMap.get(key+"E"); | |
| 267 | - if(gps.getStopNo().equals(stationCode)){ | |
| 268 | - gps.setsEPoint(true); | |
| 269 | - return true; | |
| 270 | - } | |
| 271 | - } | |
| 272 | - return false; | |
| 273 | - }*/ | |
| 274 | - | |
| 275 | - /** | |
| 276 | - * 纠正上下行 | |
| 277 | - * @param gps | |
| 278 | - | |
| 279 | - public void correctUpdown(GpsEntity gps){ | |
| 280 | - Integer updown=BasicData.lineStationUpDownMap.get(gps.getLineId()+"_"+gps.getStopNo()); | |
| 281 | - if(updown != null && !updown.equals(gps.getUpDown())) | |
| 282 | - gps.setUpDown(updown); | |
| 283 | - | |
| 284 | - if(isSEPoint(gps)) | |
| 285 | - return; | |
| 286 | - }*/ | |
| 287 | - } | |
| 36 | +public class GpsRealData implements CommandLineRunner { | |
| 37 | + | |
| 38 | + static Logger logger = LoggerFactory.getLogger(GpsRealData.class); | |
| 39 | + | |
| 40 | + private static Map<String, GpsEntity> gpsMap; | |
| 41 | + | |
| 42 | + //按线路分组设备号 | |
| 43 | + private static TreeMultimap<String, String> lineCode2Devices; | |
| 44 | + | |
| 45 | + // 网关数据接口地址 | |
| 46 | + private static String url; | |
| 47 | + | |
| 48 | + @Autowired | |
| 49 | + GpsDataLoader gpsDataLoader; | |
| 50 | + | |
| 51 | + @Autowired | |
| 52 | + DayOfSchedule dayOfSchedule; | |
| 53 | + | |
| 54 | + @Autowired | |
| 55 | + ForecastRealServer forecastRealServer; | |
| 56 | + | |
| 57 | + /** | |
| 58 | + * 构造函数 | |
| 59 | + */ | |
| 60 | + public GpsRealData() { | |
| 61 | + gpsMap = new HashMap<>(); | |
| 62 | + lineCode2Devices = TreeMultimap.create(); | |
| 63 | + url = ConfigUtil.get("http.gps.real.url"); | |
| 64 | + } | |
| 65 | + | |
| 66 | + @Override | |
| 67 | + public void run(String... arg0) throws Exception { | |
| 68 | + logger.info("gpsDataLoader,20,5"); | |
| 69 | + //Application.mainServices.scheduleWithFixedDelay(gpsDataLoader, 20, 6, TimeUnit.SECONDS); | |
| 70 | + } | |
| 71 | + | |
| 72 | + public void put(GpsEntity gps) { | |
| 73 | + String device = gps.getDeviceId(); | |
| 74 | + gpsMap.put(device, gps); | |
| 75 | + | |
| 76 | + if (StringUtils.isNotBlank(gps.getLineId())){ | |
| 77 | + //站点名称 | |
| 78 | + gps.setStationName(getStationName(gps)); | |
| 79 | + lineCode2Devices.put(gps.getLineId(), device); | |
| 80 | + } | |
| 81 | + } | |
| 82 | + | |
| 83 | + public String getStationName(GpsEntity gps){ | |
| 84 | + return BasicData.stationCode2NameMap.get(gps.getLineId() + "_" + gps.getUpDown() + gps.getStopNo()); | |
| 85 | + } | |
| 86 | + | |
| 87 | + /** | |
| 88 | + * @Title: get @Description: TODO(设备号获取GPS) | |
| 89 | + */ | |
| 90 | + public GpsEntity get(String deviceId) { | |
| 91 | + return gpsMap.get(deviceId); | |
| 92 | + } | |
| 93 | + | |
| 94 | + /** | |
| 95 | + * @Title: get @Description: TODO(线路编码获取GPS集合) @throws | |
| 96 | + */ | |
| 97 | + public List<GpsEntity> getByLine(String lineCode) { | |
| 98 | + NavigableSet<String> set = lineCode2Devices.get(lineCode); | |
| 99 | + | |
| 100 | + List<GpsEntity> rs = new ArrayList<>(); | |
| 101 | + GpsEntity gps; | |
| 102 | + ScheduleRealInfo sch; | |
| 103 | + for (String device : set) { | |
| 104 | + gps = gpsMap.get(device); | |
| 105 | + //过滤异常GPS数据 | |
| 106 | + if (gps.isAbnormal()) | |
| 107 | + continue; | |
| 108 | + | |
| 109 | + sch = dayOfSchedule.execPlanMap().get(gps.getNbbm()); | |
| 110 | + if (null != sch) | |
| 111 | + gps.setSchId(sch.getId()); | |
| 112 | + rs.add(gps); | |
| 113 | + } | |
| 114 | + | |
| 115 | + return rs; | |
| 116 | + } | |
| 117 | + | |
| 118 | + public List<GpsEntity> get(List<String> pArray) { | |
| 119 | + List<GpsEntity> list = new ArrayList<>(); | |
| 120 | + | |
| 121 | + for (String code : pArray) | |
| 122 | + list.addAll(getByLine(code)); | |
| 123 | + return list; | |
| 124 | + } | |
| 125 | + | |
| 126 | + public Set<String> allDevices() { | |
| 127 | + return gpsMap.keySet(); | |
| 128 | + } | |
| 129 | + | |
| 130 | + public GpsEntity findByDeviceId(String deviceId) { | |
| 131 | + return gpsMap.get(deviceId); | |
| 132 | + } | |
| 133 | + | |
| 134 | + public Collection<GpsEntity> all() { | |
| 135 | + return gpsMap.values(); | |
| 136 | + } | |
| 137 | + | |
| 138 | + public void remove(String device) { | |
| 139 | + gpsMap.remove(device); | |
| 140 | + } | |
| 141 | + | |
| 142 | + @Component | |
| 143 | + public static class GpsDataLoader extends Thread { | |
| 144 | + | |
| 145 | + Logger logger = LoggerFactory.getLogger(GpsDataLoader.class); | |
| 146 | + | |
| 147 | + @Autowired | |
| 148 | + GpsRealData gpsRealData; | |
| 149 | + | |
| 150 | + @Autowired | |
| 151 | + GpsRealAnalyse gpsRealAnalyse; | |
| 152 | + | |
| 153 | + @Override | |
| 154 | + public void run() { | |
| 155 | + try { | |
| 156 | + //如果正在恢复数据 | |
| 157 | + if (GpsDataRecovery.run) | |
| 158 | + return; | |
| 159 | + | |
| 160 | + load(); | |
| 161 | + } catch (Exception e) { | |
| 162 | + logger.error("", e); | |
| 163 | + } | |
| 164 | + } | |
| 165 | + | |
| 166 | + public void load() throws Exception { | |
| 167 | + List<GpsEntity> list = null; | |
| 168 | + List<GpsEntity> updateList = new ArrayList<>(); | |
| 169 | + CloseableHttpClient httpClient = null; | |
| 170 | + CloseableHttpResponse response = null; | |
| 171 | + try { | |
| 172 | + httpClient = HttpClients.createDefault(); | |
| 173 | + HttpGet get = new HttpGet(url); | |
| 174 | + | |
| 175 | + response = httpClient.execute(get); | |
| 176 | + | |
| 177 | + HttpEntity entity = response.getEntity(); | |
| 178 | + if (null != entity) { | |
| 179 | + BufferedReader br = new BufferedReader(new InputStreamReader(entity.getContent())); | |
| 180 | + StringBuffer stringBuffer = new StringBuffer(); | |
| 181 | + String str = ""; | |
| 182 | + while ((str = br.readLine()) != null) | |
| 183 | + stringBuffer.append(str); | |
| 184 | + | |
| 185 | + JSONObject jsonObj = JSON.parseObject(stringBuffer.toString()); | |
| 186 | + | |
| 187 | + if (jsonObj != null) | |
| 188 | + list = JSON.parseArray(jsonObj.getString("data"), GpsEntity.class); | |
| 189 | + | |
| 190 | + String nbbm; | |
| 191 | + GpsEntity old; | |
| 192 | + for (GpsEntity gps : list) { | |
| 193 | + //没有设备号 | |
| 194 | + if (StringUtils.isBlank(gps.getDeviceId())) | |
| 195 | + continue; | |
| 196 | + | |
| 197 | + old = gpsMap.get(gps.getDeviceId()); | |
| 198 | + if (old != null && | |
| 199 | + old.getTimestamp() == gps.getTimestamp()) | |
| 200 | + continue; | |
| 201 | + | |
| 202 | + nbbm = BasicData.deviceId2NbbmMap.get(gps.getDeviceId()); | |
| 203 | + if (StringUtils.isBlank(nbbm)) | |
| 204 | + gps.setAbnormal(true);//标记为异常数据 | |
| 205 | + else | |
| 206 | + gps.setNbbm(nbbm); | |
| 207 | + //有更新的点位 | |
| 208 | + updateList.add(gps); | |
| 209 | + //实时GPS数据集 | |
| 210 | + gpsRealData.put(gps); | |
| 211 | + } | |
| 212 | + //分析数据 | |
| 213 | + gpsRealAnalyse.analyse(updateList); | |
| 214 | + } else | |
| 215 | + logger.error("real gps result is null"); | |
| 216 | + } catch (Exception e) { | |
| 217 | + logger.error("", e); | |
| 218 | + } finally { | |
| 219 | + if (null != httpClient) | |
| 220 | + httpClient.close(); | |
| 221 | + if (null != response) | |
| 222 | + response.close(); | |
| 223 | + } | |
| 224 | + } | |
| 225 | + } | |
| 288 | 226 | } |
| 289 | 227 | \ No newline at end of file | ... | ... |
src/main/java/com/bsth/data/gpsdata/SignalStateData.java
0 → 100644
| 1 | +package com.bsth.data.gpsdata; | |
| 2 | + | |
| 3 | +import com.bsth.data.gpsdata.arrival.entity.SignalState; | |
| 4 | +import com.bsth.websocket.handler.SendUtils; | |
| 5 | +import com.google.common.base.Splitter; | |
| 6 | +import com.google.common.collect.ArrayListMultimap; | |
| 7 | +import org.springframework.beans.factory.annotation.Autowired; | |
| 8 | +import org.springframework.stereotype.Component; | |
| 9 | + | |
| 10 | +import java.util.ArrayList; | |
| 11 | +import java.util.List; | |
| 12 | + | |
| 13 | +/** | |
| 14 | + * 信号状态数据 | |
| 15 | + * Created by panzhao on 2016/12/30. | |
| 16 | + */ | |
| 17 | +@Component | |
| 18 | +public class SignalStateData { | |
| 19 | + | |
| 20 | + @Autowired | |
| 21 | + SendUtils sendUtils; | |
| 22 | + | |
| 23 | + private static ArrayListMultimap<String, SignalState> listMultimap = ArrayListMultimap.create(); | |
| 24 | + | |
| 25 | + public void put(SignalState state){ | |
| 26 | + listMultimap.put(state.getLineCode(), state); | |
| 27 | + //推送到客户端 | |
| 28 | + sendUtils.sendSignalState(state); | |
| 29 | + } | |
| 30 | + | |
| 31 | + public List<SignalState> get(String idx){ | |
| 32 | + List<SignalState> rs = new ArrayList<>(); | |
| 33 | + List<String> ids = Splitter.on(",").splitToList(idx); | |
| 34 | + | |
| 35 | + for(String lineCode : ids){ | |
| 36 | + rs.addAll(listMultimap.get(lineCode)); | |
| 37 | + } | |
| 38 | + return rs; | |
| 39 | + } | |
| 40 | +} | ... | ... |
src/main/java/com/bsth/data/gpsdata/analyse/GpsAnalyse.java deleted
100644 → 0
| 1 | -package com.bsth.data.gpsdata.analyse; | |
| 2 | - | |
| 3 | -import com.bsth.data.gpsdata.GpsEntity; | |
| 4 | -import com.bsth.data.gpsdata.analyse.components.GpsArrival; | |
| 5 | -import org.slf4j.Logger; | |
| 6 | -import org.slf4j.LoggerFactory; | |
| 7 | - | |
| 8 | -import java.util.concurrent.ExecutorService; | |
| 9 | -import java.util.concurrent.Executors; | |
| 10 | - | |
| 11 | -/** | |
| 12 | - * 分析gps状态信息 | |
| 13 | - * Created by panzhao on 2016/12/23. | |
| 14 | - */ | |
| 15 | -public class GpsAnalyse { | |
| 16 | - | |
| 17 | - static Logger logger = LoggerFactory.getLogger(GpsAnalyse.class); | |
| 18 | - | |
| 19 | - //线程池 | |
| 20 | - static ExecutorService threadPool = Executors.newFixedThreadPool(50); | |
| 21 | - | |
| 22 | - public static void start(GpsEntity gps) { | |
| 23 | - threadPool.execute(new ArrivalMatchThread(gps)); | |
| 24 | - } | |
| 25 | - | |
| 26 | - public static class ArrivalMatchThread implements Runnable { | |
| 27 | - | |
| 28 | - private GpsEntity gps; | |
| 29 | - | |
| 30 | - public ArrivalMatchThread(GpsEntity gps) { | |
| 31 | - this.gps = gps; | |
| 32 | - } | |
| 33 | - | |
| 34 | - @Override | |
| 35 | - public void run() { | |
| 36 | - GpsArrival.arrival(gps); | |
| 37 | - } | |
| 38 | - } | |
| 39 | -} | |
| 40 | 0 | \ No newline at end of file |
src/main/java/com/bsth/data/gpsdata/analyse/components/GpsArrival.java deleted
100644 → 0
| 1 | -package com.bsth.data.gpsdata.analyse.components; | |
| 2 | - | |
| 3 | -import com.bsth.data.LineConfigData; | |
| 4 | -import com.bsth.data.gpsdata.GpsEntity; | |
| 5 | -import com.bsth.data.gpsdata.analyse.CircleQueue; | |
| 6 | -import com.bsth.data.gpsdata.analyse.GeoCacheData; | |
| 7 | -import com.bsth.data.gpsdata.analyse.StationRoute; | |
| 8 | -import com.bsth.data.gpsdata.analyse.util.GeoUtils; | |
| 9 | -import com.bsth.data.schedule.DayOfSchedule; | |
| 10 | -import com.bsth.entity.realcontrol.LineConfig; | |
| 11 | -import com.bsth.entity.realcontrol.ScheduleRealInfo; | |
| 12 | -import com.bsth.service.directive.DirectiveService; | |
| 13 | -import com.bsth.websocket.handler.SendUtils; | |
| 14 | -import org.slf4j.Logger; | |
| 15 | -import org.slf4j.LoggerFactory; | |
| 16 | -import org.springframework.beans.BeansException; | |
| 17 | -import org.springframework.context.ApplicationContext; | |
| 18 | -import org.springframework.context.ApplicationContextAware; | |
| 19 | -import org.springframework.stereotype.Component; | |
| 20 | - | |
| 21 | -import java.util.List; | |
| 22 | - | |
| 23 | -/** | |
| 24 | - * gps 到离站判断 | |
| 25 | - * Created by panzhao on 2016/12/24. | |
| 26 | - */ | |
| 27 | -@Component | |
| 28 | -public class GpsArrival implements ApplicationContextAware { | |
| 29 | - | |
| 30 | - static Logger logger = LoggerFactory.getLogger(GpsArrival.class); | |
| 31 | - | |
| 32 | - static DayOfSchedule dayOfSchedule; | |
| 33 | - static LineConfigData lineConfigData; | |
| 34 | - static SendUtils sendUtils; | |
| 35 | - static DirectiveService directiveService; | |
| 36 | - | |
| 37 | - public static void arrival(GpsEntity gps) { | |
| 38 | - | |
| 39 | - if (gps.getLat() == 0 || gps.getLon() == 0) { | |
| 40 | - //logger.error("无效的gps"); | |
| 41 | - return; | |
| 42 | - } | |
| 43 | - | |
| 44 | - Object task = DayOfSchedule.executeCurr(gps.getNbbm()); | |
| 45 | - if (task == null) | |
| 46 | - return; | |
| 47 | - if (task.getClass().isAssignableFrom(ScheduleRealInfo.class)) { | |
| 48 | - ScheduleRealInfo sch = (ScheduleRealInfo) task; | |
| 49 | - //和班次同步走向 | |
| 50 | - gps.setUpDown(Integer.parseInt(sch.getXlDir())); | |
| 51 | - | |
| 52 | - //出场 | |
| 53 | - if (sch.getBcType().equals("out")) { | |
| 54 | - outCarpark(gps, sch); | |
| 55 | - } else if (sch.getBcType().equals("normal")) | |
| 56 | - normalInOut(gps, sch); | |
| 57 | - else if (sch.getBcType().equals("in")) { | |
| 58 | - inCarpark(gps, sch); | |
| 59 | - } | |
| 60 | - } | |
| 61 | - | |
| 62 | - GeoCacheData.putGps(gps); | |
| 63 | - } | |
| 64 | - | |
| 65 | - /** | |
| 66 | - * 正常班次 | |
| 67 | - * | |
| 68 | - * @param gps | |
| 69 | - * @param sch | |
| 70 | - */ | |
| 71 | - private static void normalInOut(GpsEntity gps, ScheduleRealInfo sch) { | |
| 72 | - CircleQueue<GpsEntity> queue = GeoCacheData.getGps(gps.getNbbm()); | |
| 73 | - GpsEntity prev = null; | |
| 74 | - if (queue != null) | |
| 75 | - prev = queue.getTail(); | |
| 76 | - | |
| 77 | - List<StationRoute> srs = GeoCacheData.getStationRoute(sch.getXlBm(), gps.getUpDown()); | |
| 78 | - StationRoute station = GeoUtils.gpsInStation(gps, srs); | |
| 79 | - | |
| 80 | - if (station != null) { | |
| 81 | - //站内 | |
| 82 | - gps.setStopNo(station.getCode()); | |
| 83 | - gps.setInstation(true); | |
| 84 | - stationInside(gps, prev, sch); | |
| 85 | - } else { | |
| 86 | - //站外 | |
| 87 | - stationOutside(gps, prev, sch); | |
| 88 | - } | |
| 89 | - } | |
| 90 | - | |
| 91 | - /** | |
| 92 | - * GPS在站点内 | |
| 93 | - * | |
| 94 | - * @param gps | |
| 95 | - * @param prev | |
| 96 | - * @param sch | |
| 97 | - */ | |
| 98 | - private static void stationInside(GpsEntity gps, GpsEntity prev, ScheduleRealInfo sch) { | |
| 99 | - if (prev == null) | |
| 100 | - return; | |
| 101 | - | |
| 102 | - if (gps.getStopNo().equals(sch.getZdzCode()) && sch.getZdsjActual() == null) { | |
| 103 | - //到终点站 | |
| 104 | - arriveEnd(sch, gps); | |
| 105 | - return; | |
| 106 | - } | |
| 107 | - | |
| 108 | - //上一个点在站外 | |
| 109 | - if (!prev.isInstation()) | |
| 110 | - return; | |
| 111 | - //超过 (待发时间 + 90%的单程运送时间) 并且超过下一个班次的待发时间,还在起点站。默认烂一圈 | |
| 112 | - if (prev.getStopNo().equals(gps.getStopNo())) { | |
| 113 | - if (gps.getStopNo().equals(sch.getQdzCode()) | |
| 114 | - && gps.getTimestamp() > sch.getDfsjT() + (sch.getBcsj() * 60 * 1000 * 0.9)) { | |
| 115 | - | |
| 116 | - ScheduleRealInfo next = dayOfSchedule.next(sch); | |
| 117 | - if(gps.getTimestamp() > next.getDfsjT()) | |
| 118 | - dayOfSchedule.addExecPlan(dayOfSchedule.next(next)); | |
| 119 | - } | |
| 120 | - return; | |
| 121 | - } | |
| 122 | - | |
| 123 | - //发车 | |
| 124 | - if (prev.getStopNo().equals(sch.getQdzCode())) { | |
| 125 | - busWillDepart(sch, gps); | |
| 126 | - return; | |
| 127 | - } | |
| 128 | - | |
| 129 | - if (gps.getUpDown() != prev.getUpDown()) | |
| 130 | - return; | |
| 131 | - | |
| 132 | - //中途站 | |
| 133 | - StationRoute prevStation = GeoCacheData.getStation(prev.getLineId(), prev.getUpDown(), prev.getStopNo()); | |
| 134 | - StationRoute currStation = GeoCacheData.getStation(gps.getLineId(), gps.getUpDown(), gps.getStopNo()); | |
| 135 | - if (currStation.getRouteSort() < prevStation.getRouteSort()) { | |
| 136 | - //开始下一个班次 | |
| 137 | - finishPlan(sch); | |
| 138 | - | |
| 139 | - logger.info("路由反向。。。。。。:" + gps.getTimestamp()); | |
| 140 | - //为班次补上实际时间 | |
| 141 | - } | |
| 142 | - } | |
| 143 | - | |
| 144 | - /** | |
| 145 | - * GPS在站点外 | |
| 146 | - * | |
| 147 | - * @param gps | |
| 148 | - * @param prev | |
| 149 | - * @param sch | |
| 150 | - */ | |
| 151 | - private static void stationOutside(GpsEntity gps, GpsEntity prev, ScheduleRealInfo sch) { | |
| 152 | - if (prev == null) | |
| 153 | - return; | |
| 154 | - | |
| 155 | - gps.setStopNo(prev.getStopNo()); | |
| 156 | - if (prev.isInstation() && prev.getStopNo().equals(sch.getQdzCode())) { | |
| 157 | - //发车 | |
| 158 | - busWillDepart(sch, gps); | |
| 159 | - return; | |
| 160 | - } | |
| 161 | - } | |
| 162 | - | |
| 163 | - /** | |
| 164 | - * 公交车起点发出 | |
| 165 | - */ | |
| 166 | - final static long DRIFT_VAL_TIME = 1000 * 60 * 10; | |
| 167 | - //班次最大差值2小时 | |
| 168 | - final static long MAX_DIFF = 1000 * 60 * 60 * 2; | |
| 169 | - | |
| 170 | - private static void busWillDepart(ScheduleRealInfo sch, GpsEntity gps) { | |
| 171 | - //实发时间不覆盖 | |
| 172 | - if (sch.getFcsjActual() == null && Math.abs(gps.getTimestamp() - sch.getDfsjT()) < MAX_DIFF) { | |
| 173 | - | |
| 174 | - //提前10分钟以上发出,判断一下是否是漂移 | |
| 175 | - /*if (sch.getDfsjT() - gps.getTimestamp() > DRIFT_VAL_TIME) { | |
| 176 | - ScheduleRealInfo schPrev = dayOfSchedule.prev(sch); | |
| 177 | - if (schPrev != null && schPrev.getZdsjActual() != null) { | |
| 178 | - //计划停站时间 | |
| 179 | - long stopTimeJH = sch.getDfsjT() - schPrev.getZdsjT(); | |
| 180 | - //实际停站时间 | |
| 181 | - long actualStopTime = gps.getTimestamp() - schPrev.getZdsjActualTime(); | |
| 182 | - *//* | |
| 183 | - 没停够计划百分之30的,算漂移 | |
| 184 | - (这里出现的误判,由程序在车辆到中途站的时候进行补偿) | |
| 185 | - *//* | |
| 186 | - if (stopTimeJH * 0.3 > actualStopTime) { | |
| 187 | - logger.info("漂移.... 车辆:" + gps.getNbbm() + " ts: " + gps.getTimestamp()); | |
| 188 | - return; | |
| 189 | - } | |
| 190 | - } | |
| 191 | - }*/ | |
| 192 | - | |
| 193 | - LineConfig config = lineConfigData.get(sch.getXlBm()); | |
| 194 | - if (config != null && config.getOutConfig() == 2) { | |
| 195 | - //出站既出场 | |
| 196 | - ScheduleRealInfo schPrev = dayOfSchedule.prev(sch); | |
| 197 | - if (schPrev.getBcType().equals("out")) { | |
| 198 | - schPrev.setFcsjActualAll(gps.getTimestamp()); | |
| 199 | - schPrev.setZdsjActualAll(gps.getTimestamp()); | |
| 200 | - } | |
| 201 | - } | |
| 202 | - | |
| 203 | - sch.setFcsjActualAll(gps.getTimestamp()); | |
| 204 | - //通知客户端 | |
| 205 | - sendUtils.sendFcsj(sch); | |
| 206 | - //持久化 | |
| 207 | - dayOfSchedule.save(sch); | |
| 208 | - logger.info("(站外)班次:" + sch.getDfsj() + "发车, 时间:" + sch.getFcsjActual()); | |
| 209 | - } | |
| 210 | - } | |
| 211 | - | |
| 212 | - /** | |
| 213 | - * 公交车到达终点 | |
| 214 | - * | |
| 215 | - * @param sch | |
| 216 | - * @param gps | |
| 217 | - */ | |
| 218 | - private static void arriveEnd(ScheduleRealInfo sch, GpsEntity gps) { | |
| 219 | - if(Math.abs(gps.getTimestamp() - sch.getZdsjT()) >= MAX_DIFF) | |
| 220 | - return; | |
| 221 | - | |
| 222 | - sch.setZdsjActualAll(gps.getTimestamp()); | |
| 223 | - ScheduleRealInfo next = finishPlan(sch); | |
| 224 | - //已完成班次数 | |
| 225 | - int doneSum = dayOfSchedule.doneSum(sch.getClZbh()); | |
| 226 | - //通知客户端 | |
| 227 | - sendUtils.sendZdsj(sch, next, doneSum); | |
| 228 | - //持久化 | |
| 229 | - dayOfSchedule.save(sch); | |
| 230 | - logger.info("班次:" + sch.getDfsj() + "到达终点, 时间:" + sch.getZdsjActual()); | |
| 231 | - | |
| 232 | - if (next == null) | |
| 233 | - return; | |
| 234 | - | |
| 235 | - LineConfig config = lineConfigData.get(sch.getXlBm()); | |
| 236 | - //进站既进场 | |
| 237 | - if (next.getBcType().equals("in") && | |
| 238 | - config != null && config.getOutConfig() == 2) { | |
| 239 | - next.setFcsjActualAll(gps.getTimestamp()); | |
| 240 | - next.setZdsjActualAll(gps.getTimestamp()); | |
| 241 | - | |
| 242 | - finishPlan(next); | |
| 243 | - } else { | |
| 244 | - //下发调度指令 | |
| 245 | - directiveService.send60Dispatch(next, doneSum, "到站@系统"); | |
| 246 | - | |
| 247 | - //套跑 -下发线路切换指令 | |
| 248 | - /* if (!next.getXlBm().equals(sch.getXlBm())) | |
| 249 | - directiveService.lineChange(sch.getClZbh(), next.getXlBm(), "套跑@系统");*/ | |
| 250 | - } | |
| 251 | - | |
| 252 | - //将gps转换为下一个班次走向的站内信号 | |
| 253 | - int updown = Integer.parseInt(next.getXlDir()); | |
| 254 | - List<StationRoute> srs = GeoCacheData.getStationRoute(next.getXlBm(), updown); | |
| 255 | - StationRoute station = GeoUtils.gpsInStation(gps, srs); | |
| 256 | - if (station != null) { | |
| 257 | - gps.setUpDown(updown); | |
| 258 | - gps.setStopNo(station.getCode()); | |
| 259 | - } | |
| 260 | - } | |
| 261 | - | |
| 262 | - /** | |
| 263 | - * 出场班次 | |
| 264 | - * | |
| 265 | - * @param gps | |
| 266 | - * @param sch | |
| 267 | - */ | |
| 268 | - private static void outCarpark(GpsEntity gps, ScheduleRealInfo sch) { | |
| 269 | - CircleQueue<GpsEntity> queue = GeoCacheData.getGps(gps.getNbbm()); | |
| 270 | - GpsEntity prev = null; | |
| 271 | - if (queue != null) | |
| 272 | - prev = queue.getTail(); | |
| 273 | - | |
| 274 | - //是否在停车场内 | |
| 275 | - String carpark = GeoUtils.gpsInCarpark(gps); | |
| 276 | - if (carpark != null && carpark.equals(sch.getQdzCode())) { | |
| 277 | - gps.setInstation(true); | |
| 278 | - gps.setStopNo(carpark); | |
| 279 | - return; // 还在场内 | |
| 280 | - } | |
| 281 | - | |
| 282 | - List<StationRoute> srs = GeoCacheData.getStationRoute(sch.getXlBm(), gps.getUpDown()); | |
| 283 | - StationRoute station = GeoUtils.gpsInStation(gps, srs); | |
| 284 | - //线路上 站点内 | |
| 285 | - if (station != null) { | |
| 286 | - gps.setInstation(true); | |
| 287 | - gps.setStopNo(station.getCode()); | |
| 288 | - | |
| 289 | - //上一个点附带的站点站标记 | |
| 290 | - if (prev != null && prev.getStopNo() != null | |
| 291 | - && prev.getStopNo().equals(sch.getZdzCode())) | |
| 292 | - return; | |
| 293 | - | |
| 294 | - //到达终点 | |
| 295 | - if (station.getCode().equals(sch.getZdzCode())) | |
| 296 | - arriveEnd(sch, gps); | |
| 297 | - } | |
| 298 | - | |
| 299 | - //上一个点在场内 | |
| 300 | - if (prev != null && prev.isInstation() && prev.getStopNo().equals(sch.getQdzCode())) { | |
| 301 | - //当前点在场外 | |
| 302 | - if (carpark == null) { | |
| 303 | - gps.setStopNo(prev.getStopNo()); | |
| 304 | - //停车场发出 | |
| 305 | - busWillDepart(sch, gps); | |
| 306 | - return; | |
| 307 | - } | |
| 308 | - } | |
| 309 | - } | |
| 310 | - | |
| 311 | - | |
| 312 | - /** | |
| 313 | - * 进场班次 | |
| 314 | - * | |
| 315 | - * @param gps | |
| 316 | - * @param sch | |
| 317 | - */ | |
| 318 | - private static void inCarpark(GpsEntity gps, ScheduleRealInfo sch) { | |
| 319 | - String carpark = GeoUtils.gpsInCarpark(gps); | |
| 320 | - if (carpark != null && carpark.equals(sch.getZdzCode())) { | |
| 321 | - //进场班次取第一个实际进场时间 | |
| 322 | - if (sch.getZdsjActual() != null) | |
| 323 | - return; | |
| 324 | - | |
| 325 | - //进场 | |
| 326 | - arriveEnd(sch, gps); | |
| 327 | - return; | |
| 328 | - } | |
| 329 | - | |
| 330 | - CircleQueue<GpsEntity> queue = GeoCacheData.getGps(gps.getNbbm()); | |
| 331 | - if (queue == null) | |
| 332 | - return; | |
| 333 | - //上一个gps | |
| 334 | - GpsEntity prev = queue.getTail(); | |
| 335 | - | |
| 336 | - if (carpark == null && prev.isInstation() && prev.getStopNo().equals(sch.getQdzCode())) { | |
| 337 | - gps.setStopNo(prev.getStopNo()); | |
| 338 | - //进场班次发出 | |
| 339 | - busWillDepart(sch, gps); | |
| 340 | - return; | |
| 341 | - } | |
| 342 | - } | |
| 343 | - | |
| 344 | - /** | |
| 345 | - * 完成班次 -返回下一个班次 | |
| 346 | - * | |
| 347 | - * @param sch | |
| 348 | - */ | |
| 349 | - private static ScheduleRealInfo finishPlan(ScheduleRealInfo sch) { | |
| 350 | - ScheduleRealInfo next = dayOfSchedule.next(sch); | |
| 351 | - if (next != null) { | |
| 352 | - next.setQdzArrDatesj(sch.getZdsjActual()); | |
| 353 | - dayOfSchedule.addExecPlan(next); | |
| 354 | - } | |
| 355 | - return next; | |
| 356 | - } | |
| 357 | - | |
| 358 | - @Override | |
| 359 | - public void setApplicationContext(ApplicationContext applicationContext) throws BeansException { | |
| 360 | - dayOfSchedule = applicationContext.getBean(DayOfSchedule.class); | |
| 361 | - lineConfigData = applicationContext.getBean(LineConfigData.class); | |
| 362 | - sendUtils = applicationContext.getBean(SendUtils.class); | |
| 363 | - directiveService = applicationContext.getBean(DirectiveService.class); | |
| 364 | - } | |
| 365 | -} |
src/main/java/com/bsth/data/gpsdata/analyse/components/GpsStateCorrective.java deleted
100644 → 0
| 1 | -package com.bsth.data.gpsdata.analyse.components; | |
| 2 | - | |
| 3 | -import com.bsth.data.gpsdata.GpsEntity; | |
| 4 | -import com.bsth.data.schedule.DayOfSchedule; | |
| 5 | -import com.bsth.entity.realcontrol.ScheduleRealInfo; | |
| 6 | -import com.vividsolutions.jts.geom.GeometryFactory; | |
| 7 | -import org.joda.time.format.DateTimeFormat; | |
| 8 | -import org.joda.time.format.DateTimeFormatter; | |
| 9 | -import org.slf4j.Logger; | |
| 10 | -import org.slf4j.LoggerFactory; | |
| 11 | -import org.springframework.beans.BeansException; | |
| 12 | -import org.springframework.context.ApplicationContext; | |
| 13 | -import org.springframework.context.ApplicationContextAware; | |
| 14 | -import org.springframework.stereotype.Component; | |
| 15 | - | |
| 16 | -/** | |
| 17 | - * GPS状态纠正 | |
| 18 | - * Created by panzhao on 2016/12/23. | |
| 19 | - */ | |
| 20 | -@Component | |
| 21 | -public class GpsStateCorrective implements ApplicationContextAware { | |
| 22 | - | |
| 23 | - static Logger logger = LoggerFactory.getLogger(GpsStateCorrective.class); | |
| 24 | - | |
| 25 | - static DayOfSchedule dayOfSchedule; | |
| 26 | - | |
| 27 | - private static GeometryFactory geometryFactory = new GeometryFactory(); | |
| 28 | - | |
| 29 | - public static void correct(GpsEntity gps, ScheduleRealInfo sch){ | |
| 30 | -/* int upDown = Integer.parseInt(sch.getXlDir()); | |
| 31 | - gps.setUpDown(upDown); | |
| 32 | - List<StationRoute> srs = GeoCacheData.getStationRoute(sch.getXlBm(), upDown); | |
| 33 | - | |
| 34 | - Point point = geometryFactory.createPoint(new Coordinate(gps.getLat(), gps.getLon())); | |
| 35 | - | |
| 36 | - //之前的点位 | |
| 37 | - CircleQueue<GpsEntity> queue = GeoCacheData.getGps(gps.getNbbm()); | |
| 38 | - GpsEntity prev = null; | |
| 39 | - if(queue != null) | |
| 40 | - prev = queue.getTail(); | |
| 41 | - | |
| 42 | - //线路上,站点间 | |
| 43 | - StationRoute station = GeoUtils.pointInStation(point, srs); | |
| 44 | - //在站内 | |
| 45 | - if(station != null){ | |
| 46 | - gps.setStopNo(station.getCode()); | |
| 47 | - gps.setInstation(true); | |
| 48 | - gps.setStation(station); | |
| 49 | - | |
| 50 | - if(prev != null && prev.getUpDown() == upDown){ | |
| 51 | - StationRoute prevStation = GeoCacheData.getStation(prev.getLineId(), upDown, prev.getStopNo()); | |
| 52 | - | |
| 53 | - //倒着开?? | |
| 54 | - if(prevStation.getRouteSort() > station.getRouteSort()){ | |
| 55 | - reversalHandle(gps, prev, sch); | |
| 56 | - } | |
| 57 | - } | |
| 58 | - } | |
| 59 | - else{ | |
| 60 | - if(prev != null) | |
| 61 | - gps.setStopNo(prev.getStopNo()); | |
| 62 | - } | |
| 63 | - | |
| 64 | - //是否在停车场内 | |
| 65 | - Map<String, Polygon> carparkMap = GeoCacheData.tccMap; | |
| 66 | - Set<String> codes = carparkMap.keySet(); | |
| 67 | - Polygon p; | |
| 68 | - for(String code : codes){ | |
| 69 | - p = carparkMap.get(code); | |
| 70 | - //场内 | |
| 71 | - if(p.contains(point)){ | |
| 72 | - gps.setCarparkNo(code); | |
| 73 | - if(sch.getBcType().equals("out")){ | |
| 74 | - gps.setInstation(true); | |
| 75 | - gps.setStopNo(code); | |
| 76 | - } | |
| 77 | - } | |
| 78 | - }*/ | |
| 79 | - } | |
| 80 | - | |
| 81 | - private static DateTimeFormatter fmt = DateTimeFormat.forPattern("HH:mm"); | |
| 82 | - | |
| 83 | - private static void reversalHandle(GpsEntity gps, GpsEntity prev, ScheduleRealInfo sch){ | |
| 84 | - /*if(sch.getBcType().equals("out") && gps.getTimestamp() < sch.getZdsjT()) | |
| 85 | - return; | |
| 86 | - | |
| 87 | - //先假设没到终点,直接开始了下一个班次 | |
| 88 | - ScheduleRealInfo next = dayOfSchedule.next(sch); | |
| 89 | - String log = "倒着开??? nbbm: " + gps.getNbbm() + " 当前:" + gps.getStopNo() + " 上一站:" + prev.getStopNo() + " 当前班次:" + sch.getDfsj(); | |
| 90 | - if(next != null){ | |
| 91 | - dayOfSchedule.addExecPlan(next); | |
| 92 | - | |
| 93 | - log += (" 下一个班次:" + next.getDfsj()); | |
| 94 | - } | |
| 95 | - | |
| 96 | - log += (" GPS时间:" + fmt.print(gps.getTimestamp())); | |
| 97 | - | |
| 98 | - logger.info(log);*/ | |
| 99 | - } | |
| 100 | - | |
| 101 | - @Override | |
| 102 | - public void setApplicationContext(ApplicationContext applicationContext) throws BeansException { | |
| 103 | - dayOfSchedule = applicationContext.getBean(DayOfSchedule.class); | |
| 104 | - } | |
| 105 | -} |
src/main/java/com/bsth/data/gpsdata/analyse/GeoCacheData.java renamed to src/main/java/com/bsth/data/gpsdata/arrival/GeoCacheData.java
| 1 | -package com.bsth.data.gpsdata.analyse; | |
| 1 | +package com.bsth.data.gpsdata.arrival; | |
| 2 | 2 | |
| 3 | 3 | import com.bsth.data.gpsdata.GpsEntity; |
| 4 | +import com.bsth.data.gpsdata.arrival.entity.StationRoute; | |
| 5 | +import com.bsth.data.gpsdata.arrival.utils.CircleQueue; | |
| 6 | +import com.bsth.data.gpsdata.arrival.utils.StationRouteComp; | |
| 4 | 7 | import com.google.common.collect.ArrayListMultimap; |
| 5 | 8 | import com.vividsolutions.jts.geom.Coordinate; |
| 6 | 9 | import com.vividsolutions.jts.geom.GeometryFactory; |
| ... | ... | @@ -26,8 +29,8 @@ public class GeoCacheData { |
| 26 | 29 | |
| 27 | 30 | static Logger logger = LoggerFactory.getLogger(GeoCacheData.class); |
| 28 | 31 | |
| 29 | - //每辆车缓存最后200条gps | |
| 30 | - private static final int CACHE_SIZE = 200; | |
| 32 | + //每辆车缓存最后1000条gps | |
| 33 | + private static final int CACHE_SIZE = 1000; | |
| 31 | 34 | private static Map<String, CircleQueue<GpsEntity>> gpsCacheMap = new HashMap<>(); |
| 32 | 35 | |
| 33 | 36 | //线路路段走向 |
| ... | ... | @@ -36,6 +39,9 @@ public class GeoCacheData { |
| 36 | 39 | //线路站点路由 |
| 37 | 40 | private static ArrayListMultimap<String, StationRoute> stationCacheMap; |
| 38 | 41 | |
| 42 | + //线路_上下行_站点编码 ——> 站点 | |
| 43 | + private static Map<String, StationRoute> routeCodeMap; | |
| 44 | + | |
| 39 | 45 | //停车场 |
| 40 | 46 | public static Map<String, Polygon> tccMap; |
| 41 | 47 | |
| ... | ... | @@ -49,9 +55,9 @@ public class GeoCacheData { |
| 49 | 55 | public static void putGps(GpsEntity gps) { |
| 50 | 56 | CircleQueue<GpsEntity> queue = gpsCacheMap.get(gps.getNbbm()); |
| 51 | 57 | if (queue == null) { |
| 52 | - //第一个点从站内开始 | |
| 53 | - if (!gps.isInstation()) | |
| 54 | - return; | |
| 58 | + /*//第一个点从站内开始 | |
| 59 | + if (gps.getInstation() == 0) | |
| 60 | + return;*/ | |
| 55 | 61 | |
| 56 | 62 | queue = new CircleQueue<>(CACHE_SIZE); |
| 57 | 63 | gpsCacheMap.put(gps.getNbbm(), queue); |
| ... | ... | @@ -69,6 +75,10 @@ public class GeoCacheData { |
| 69 | 75 | } |
| 70 | 76 | } |
| 71 | 77 | |
| 78 | + public static StationRoute getRouteCode(GpsEntity gps) { | |
| 79 | + return routeCodeMap.get(gps.getLineId() + "_" + gps.getUpDown() + "_" + gps.getStopNo()); | |
| 80 | + } | |
| 81 | + | |
| 72 | 82 | public static List<StationRoute> getStationRoute(String lineCode, int directions) { |
| 73 | 83 | return stationCacheMap.get(lineCode + "_" + directions); |
| 74 | 84 | } |
| ... | ... | @@ -84,6 +94,21 @@ public class GeoCacheData { |
| 84 | 94 | return null; |
| 85 | 95 | } |
| 86 | 96 | |
| 97 | + public static List<StationRoute> midwayStation(String lineCode, int directions, String sCode, String eCode) { | |
| 98 | + List<StationRoute> list = getStationRoute(lineCode, directions), rs = new ArrayList<>(); | |
| 99 | + | |
| 100 | + boolean flag = false; | |
| 101 | + for (StationRoute sr : list) { | |
| 102 | + if (flag) | |
| 103 | + rs.add(sr); | |
| 104 | + if (sr.getCode().equals(sCode)) | |
| 105 | + flag = true; | |
| 106 | + else if (sr.getCode().equals(eCode)) | |
| 107 | + break; | |
| 108 | + } | |
| 109 | + return rs; | |
| 110 | + } | |
| 111 | + | |
| 87 | 112 | public static Polygon getTccPolygon(String code) { |
| 88 | 113 | return tccMap.get(code); |
| 89 | 114 | } |
| ... | ... | @@ -91,7 +116,7 @@ public class GeoCacheData { |
| 91 | 116 | public void loadData() { |
| 92 | 117 | final GeometryFactory geometryFactory = new GeometryFactory(); |
| 93 | 118 | //加载站点路由 |
| 94 | - String sql = "select r.LINE_CODE,r.DIRECTIONS,r.STATION_CODE,r.STATION_MARK,s.SHAPES_TYPE,s.G_LONX,s.G_LATY,ST_AsText(s.G_POLYGON_GRID) as G_POLYGON_GRID,s.RADIUS, r.STATION_ROUTE_CODE from bsth_c_stationroute r left join bsth_c_station s on r.station=s.id where r.destroy=0 order by r.station_route_code"; | |
| 119 | + String sql = "select r.LINE_CODE,r.DIRECTIONS,r.STATION_CODE,r.STATION_MARK,s.SHAPES_TYPE,s.G_LONX,s.G_LATY,ST_AsText(s.G_POLYGON_GRID) as G_POLYGON_GRID,s.RADIUS, r.STATION_ROUTE_CODE,s.STATION_NAME from bsth_c_stationroute r left join bsth_c_station s on r.station=s.id where r.destroy=0 order by r.station_route_code"; | |
| 95 | 120 | List<StationRoute> routeList = jdbcTemplate.query(sql, new RowMapper<StationRoute>() { |
| 96 | 121 | @Override |
| 97 | 122 | public StationRoute mapRow(ResultSet rs, int rowNum) throws SQLException { |
| ... | ... | @@ -103,6 +128,7 @@ public class GeoCacheData { |
| 103 | 128 | sRoute.setRadius(rs.getFloat("RADIUS")); |
| 104 | 129 | sRoute.setRouteSort(rs.getInt("STATION_ROUTE_CODE")); |
| 105 | 130 | sRoute.setMark(rs.getString("STATION_MARK")); |
| 131 | + sRoute.setName(rs.getString("STATION_NAME")); | |
| 106 | 132 | |
| 107 | 133 | String shapesType = rs.getString("SHAPES_TYPE"); |
| 108 | 134 | //多边形电子围栏 |
| ... | ... | @@ -115,8 +141,11 @@ public class GeoCacheData { |
| 115 | 141 | //按线路和走向分组 |
| 116 | 142 | if (routeList.size() > 0) { |
| 117 | 143 | ArrayListMultimap<String, StationRoute> tempMap = ArrayListMultimap.create(); |
| 144 | + Map<String, StationRoute> codeMap = new HashMap<>(routeList.size()); | |
| 118 | 145 | for (StationRoute sr : routeList) { |
| 119 | 146 | tempMap.put(sr.getLineCode() + "_" + sr.getDirections(), sr); |
| 147 | + //站点编码 ——> 和路由顺序对照 | |
| 148 | + codeMap.put(sr.getLineCode() + "_" + sr.getDirections() + "_" + sr.getCode(), sr); | |
| 120 | 149 | } |
| 121 | 150 | |
| 122 | 151 | StationRouteComp srCom = new StationRouteComp(); |
| ... | ... | @@ -128,6 +157,7 @@ public class GeoCacheData { |
| 128 | 157 | } |
| 129 | 158 | |
| 130 | 159 | stationCacheMap = tempMap; |
| 160 | + routeCodeMap = codeMap; | |
| 131 | 161 | } |
| 132 | 162 | |
| 133 | 163 | //加载停车场数据 |
| ... | ... | @@ -176,4 +206,16 @@ public class GeoCacheData { |
| 176 | 206 | } |
| 177 | 207 | return cds; |
| 178 | 208 | } |
| 209 | + | |
| 210 | + /** | |
| 211 | + * 是不是终点站 | |
| 212 | + * @param lineId | |
| 213 | + * @param upDown | |
| 214 | + * @param stationCode | |
| 215 | + * @return | |
| 216 | + */ | |
| 217 | + public static boolean isEndStation(String lineId, Integer upDown, String stationCode) { | |
| 218 | + StationRoute station = routeCodeMap.get(lineId + "_" + upDown + "_" + stationCode); | |
| 219 | + return station != null && station.getMark().equals("E"); | |
| 220 | + } | |
| 179 | 221 | } |
| 180 | 222 | \ No newline at end of file | ... | ... |
src/main/java/com/bsth/data/gpsdata/arrival/GpsRealAnalyse.java
0 → 100644
| 1 | +package com.bsth.data.gpsdata.arrival; | |
| 2 | + | |
| 3 | +import com.bsth.data.gpsdata.GpsEntity; | |
| 4 | +import com.bsth.data.gpsdata.arrival.handlers.*; | |
| 5 | +import com.bsth.data.gpsdata.arrival.utils.CircleQueue; | |
| 6 | +import org.slf4j.Logger; | |
| 7 | +import org.slf4j.LoggerFactory; | |
| 8 | +import org.springframework.beans.factory.annotation.Autowired; | |
| 9 | +import org.springframework.stereotype.Component; | |
| 10 | + | |
| 11 | +import java.util.List; | |
| 12 | +import java.util.concurrent.CountDownLatch; | |
| 13 | +import java.util.concurrent.ExecutorService; | |
| 14 | +import java.util.concurrent.Executors; | |
| 15 | + | |
| 16 | +/** | |
| 17 | + * gps 实时数据分析 | |
| 18 | + * Created by panzhao on 2016/12/27. | |
| 19 | + */ | |
| 20 | +@Component | |
| 21 | +public class GpsRealAnalyse { | |
| 22 | + | |
| 23 | + Logger logger = LoggerFactory.getLogger(this.getClass()); | |
| 24 | + | |
| 25 | + @Autowired | |
| 26 | + OfflineSignalHandle offlineSignalHandle; | |
| 27 | + @Autowired | |
| 28 | + CorrectSignalHandle correctSignalHandle; | |
| 29 | + @Autowired | |
| 30 | + StationInsideHandle stationInsideHandle; | |
| 31 | + @Autowired | |
| 32 | + InOutStationSignalHandle inOutStationSignalHandle; | |
| 33 | + @Autowired | |
| 34 | + ReverseSignalHandle reverseSignalHandle; | |
| 35 | + | |
| 36 | + //50个线程 | |
| 37 | + static ExecutorService threadPool = Executors.newFixedThreadPool(50); | |
| 38 | + | |
| 39 | + public void analyse(List<GpsEntity> list) { | |
| 40 | + CountDownLatch count = new CountDownLatch(list.size()); | |
| 41 | + | |
| 42 | + for(GpsEntity gps : list) | |
| 43 | + threadPool.execute(new SignalHandleThread(gps, count)); | |
| 44 | + | |
| 45 | + try { | |
| 46 | + //等待子线程结束 | |
| 47 | + count.await(); | |
| 48 | + } catch (InterruptedException e) { | |
| 49 | + logger.error("", e); | |
| 50 | + } | |
| 51 | + } | |
| 52 | + | |
| 53 | + public class SignalHandleThread implements Runnable { | |
| 54 | + | |
| 55 | + GpsEntity gps; | |
| 56 | + CountDownLatch count; | |
| 57 | + | |
| 58 | + SignalHandleThread(GpsEntity gps, CountDownLatch count) { | |
| 59 | + this.gps = gps; | |
| 60 | + this.count = count; | |
| 61 | + } | |
| 62 | + | |
| 63 | + @Override | |
| 64 | + public void run() { | |
| 65 | + | |
| 66 | + try { | |
| 67 | + CircleQueue<GpsEntity> prevs = GeoCacheData.getGps(gps.getNbbm()); | |
| 68 | + //掉线处理 | |
| 69 | + offlineSignalHandle.handle(gps, prevs); | |
| 70 | + //状态处理 | |
| 71 | + if(!correctSignalHandle.handle(gps, prevs)) | |
| 72 | + return; | |
| 73 | + //场,站内外判断 | |
| 74 | + stationInsideHandle.handle(gps, prevs); | |
| 75 | + //反向处理 | |
| 76 | + reverseSignalHandle.handle(gps, prevs); | |
| 77 | + //进出站动作处理 | |
| 78 | + inOutStationSignalHandle.handle(gps, prevs); | |
| 79 | + GeoCacheData.putGps(gps); | |
| 80 | + | |
| 81 | + } catch (Exception e) { | |
| 82 | + logger.error("", e); | |
| 83 | + } finally { | |
| 84 | + count.countDown(); | |
| 85 | + } | |
| 86 | + } | |
| 87 | + } | |
| 88 | +} | ... | ... |
src/main/java/com/bsth/data/gpsdata/arrival/SignalHandle.java
0 → 100644
| 1 | +package com.bsth.data.gpsdata.arrival; | |
| 2 | + | |
| 3 | +import com.bsth.data.gpsdata.GpsEntity; | |
| 4 | +import com.bsth.data.gpsdata.arrival.entity.StationRoute; | |
| 5 | +import com.bsth.data.gpsdata.arrival.utils.CircleQueue; | |
| 6 | +import com.bsth.data.gpsdata.arrival.utils.GeoUtils; | |
| 7 | +import com.bsth.entity.realcontrol.ScheduleRealInfo; | |
| 8 | + | |
| 9 | +import java.util.List; | |
| 10 | + | |
| 11 | +/** | |
| 12 | + * Created by panzhao on 2016/12/27. | |
| 13 | + */ | |
| 14 | +public abstract class SignalHandle { | |
| 15 | + | |
| 16 | + public abstract boolean handle(GpsEntity gps, CircleQueue<GpsEntity> prevs); | |
| 17 | + | |
| 18 | + protected boolean isNotEmpty(CircleQueue<GpsEntity> prevs) { | |
| 19 | + return prevs != null && prevs.size() > 0 && prevs.getTail() != null; | |
| 20 | + } | |
| 21 | + | |
| 22 | + protected boolean isDriftSignal(GpsEntity gps) { | |
| 23 | + return gps.getLat() == 0 || gps.getLon() == 0; | |
| 24 | + } | |
| 25 | + | |
| 26 | + /** | |
| 27 | + * 是不是异常信号 | |
| 28 | + * | |
| 29 | + * @param gps | |
| 30 | + * @return protected boolean isAbnormal(GpsEntity gps) { | |
| 31 | + return gps.getLat() == 0 || gps.getLon() == 0; | |
| 32 | + }*/ | |
| 33 | + | |
| 34 | + /** | |
| 35 | + * 连续异常信号个数统计 | |
| 36 | + * | |
| 37 | + * @param prevs | |
| 38 | + * @return protected int abnormalCount(CircleQueue<GpsEntity> prevs) { | |
| 39 | + * int count = 0; | |
| 40 | + * <p> | |
| 41 | + * if (!isNotEmpty(prevs)) | |
| 42 | + * return count; | |
| 43 | + * <p> | |
| 44 | + * GpsEntity[] array = (GpsEntity[]) prevs.getQueue(); | |
| 45 | + * GpsEntity gps; | |
| 46 | + * for (int i = array.length - 1; i > 0; i--) { | |
| 47 | + * gps = array[i]; | |
| 48 | + * <p> | |
| 49 | + * if (isAbnormal(gps)) | |
| 50 | + * count++; | |
| 51 | + * else | |
| 52 | + * break; | |
| 53 | + * } | |
| 54 | + * <p> | |
| 55 | + * return count; | |
| 56 | + * } | |
| 57 | + */ | |
| 58 | + | |
| 59 | + protected void transformUpdown(GpsEntity gps, ScheduleRealInfo sch) { | |
| 60 | + int updown = Integer.parseInt(sch.getXlDir()); | |
| 61 | + List<StationRoute> srs = GeoCacheData.getStationRoute(sch.getXlBm(), updown); | |
| 62 | + StationRoute station = GeoUtils.gpsInStation(gps, srs); | |
| 63 | + if (station != null) { | |
| 64 | + gps.setUpDown(updown); | |
| 65 | + gps.setStopNo(station.getCode()); | |
| 66 | + } | |
| 67 | + } | |
| 68 | + | |
| 69 | + /** | |
| 70 | + * 是否是从异常状态恢复的第一个信号 | |
| 71 | + * | |
| 72 | + * @param gps | |
| 73 | + * @param prevs | |
| 74 | + * @return | |
| 75 | + */ | |
| 76 | + protected boolean abnormalRecovery(GpsEntity gps, CircleQueue<GpsEntity> prevs) { | |
| 77 | + if (prevs == null || prevs.size() == 0) | |
| 78 | + return false; | |
| 79 | + | |
| 80 | + GpsEntity prev = prevs.getTail(); | |
| 81 | + //从漂移状态恢复 | |
| 82 | + if (isDriftSignal(prev) | |
| 83 | + && !isDriftSignal(gps)) { | |
| 84 | + return true; | |
| 85 | + } | |
| 86 | + | |
| 87 | + return false; | |
| 88 | + } | |
| 89 | +} | |
| 0 | 90 | \ No newline at end of file | ... | ... |
src/main/java/com/bsth/data/gpsdata/arrival/entity/RouteReverse.java
0 → 100644
| 1 | +package com.bsth.data.gpsdata.arrival.entity; | |
| 2 | + | |
| 3 | +/** 路由反转 | |
| 4 | + * Created by panzhao on 2016/12/28. | |
| 5 | + */ | |
| 6 | +public class RouteReverse { | |
| 7 | + | |
| 8 | + private String nbbm; | |
| 9 | + //反转个数 | |
| 10 | + private int count; | |
| 11 | + | |
| 12 | + //详细 1,2,3,2,1 | |
| 13 | + private String detail; | |
| 14 | + | |
| 15 | + //掉头站点 | |
| 16 | + private String turned; | |
| 17 | + | |
| 18 | + //掉头时间 | |
| 19 | + private long zt; | |
| 20 | + | |
| 21 | + //检测时间 | |
| 22 | + private long ct; | |
| 23 | + | |
| 24 | + //是否闭合 | |
| 25 | + private boolean close; | |
| 26 | + | |
| 27 | + //信号不明确 | |
| 28 | + private boolean vague; | |
| 29 | + | |
| 30 | + public int getCount() { | |
| 31 | + return count; | |
| 32 | + } | |
| 33 | + | |
| 34 | + public void setCount(int count) { | |
| 35 | + this.count = count; | |
| 36 | + } | |
| 37 | + | |
| 38 | + public String getDetail() { | |
| 39 | + return detail; | |
| 40 | + } | |
| 41 | + | |
| 42 | + public void setDetail(String detail) { | |
| 43 | + this.detail = detail; | |
| 44 | + } | |
| 45 | + | |
| 46 | + public String getTurned() { | |
| 47 | + return turned; | |
| 48 | + } | |
| 49 | + | |
| 50 | + public void setTurned(String turned) { | |
| 51 | + this.turned = turned; | |
| 52 | + } | |
| 53 | + | |
| 54 | + public boolean isClose() { | |
| 55 | + return close; | |
| 56 | + } | |
| 57 | + | |
| 58 | + public void setClose(boolean close) { | |
| 59 | + this.close = close; | |
| 60 | + } | |
| 61 | + | |
| 62 | + public long getZt() { | |
| 63 | + return zt; | |
| 64 | + } | |
| 65 | + | |
| 66 | + public void setZt(long zt) { | |
| 67 | + this.zt = zt; | |
| 68 | + } | |
| 69 | + | |
| 70 | + public long getCt() { | |
| 71 | + return ct; | |
| 72 | + } | |
| 73 | + | |
| 74 | + public void setCt(long ct) { | |
| 75 | + this.ct = ct; | |
| 76 | + } | |
| 77 | + | |
| 78 | + public String getNbbm() { | |
| 79 | + return nbbm; | |
| 80 | + } | |
| 81 | + | |
| 82 | + public void setNbbm(String nbbm) { | |
| 83 | + this.nbbm = nbbm; | |
| 84 | + } | |
| 85 | + | |
| 86 | + public boolean isVague() { | |
| 87 | + return vague; | |
| 88 | + } | |
| 89 | + | |
| 90 | + public void setVague(boolean vague) { | |
| 91 | + this.vague = vague; | |
| 92 | + } | |
| 93 | +} | |
| 0 | 94 | \ No newline at end of file | ... | ... |
src/main/java/com/bsth/data/gpsdata/arrival/entity/SignalAbnormal.java
0 → 100644
| 1 | +package com.bsth.data.gpsdata.arrival.entity; | |
| 2 | + | |
| 3 | +/** | |
| 4 | + * 班次信号异常(漂移 或 断线) | |
| 5 | + * Created by panzhao on 2016/12/31. | |
| 6 | + */ | |
| 7 | +public class SignalAbnormal { | |
| 8 | + | |
| 9 | + private Long et; | |
| 10 | + | |
| 11 | + /** drift or reconnection */ | |
| 12 | + private String abnormalType; | |
| 13 | + | |
| 14 | + private Long st; | |
| 15 | + | |
| 16 | + private String nearPoint; | |
| 17 | + | |
| 18 | + private String destCode; | |
| 19 | + | |
| 20 | + private Long ct; | |
| 21 | + | |
| 22 | + //0: 发车 1:到站 | |
| 23 | + private int outOrIn; | |
| 24 | + | |
| 25 | + public Long getEt() { | |
| 26 | + return et; | |
| 27 | + } | |
| 28 | + | |
| 29 | + public void setEt(Long et) { | |
| 30 | + this.et = et; | |
| 31 | + } | |
| 32 | + | |
| 33 | + public String getAbnormalType() { | |
| 34 | + return abnormalType; | |
| 35 | + } | |
| 36 | + | |
| 37 | + public void setAbnormalType(String abnormalType) { | |
| 38 | + this.abnormalType = abnormalType; | |
| 39 | + } | |
| 40 | + | |
| 41 | + public Long getSt() { | |
| 42 | + return st; | |
| 43 | + } | |
| 44 | + | |
| 45 | + public void setSt(Long st) { | |
| 46 | + this.st = st; | |
| 47 | + } | |
| 48 | + | |
| 49 | + public String getNearPoint() { | |
| 50 | + return nearPoint; | |
| 51 | + } | |
| 52 | + | |
| 53 | + public void setNearPoint(String nearPoint) { | |
| 54 | + this.nearPoint = nearPoint; | |
| 55 | + } | |
| 56 | + | |
| 57 | + public Long getCt() { | |
| 58 | + return ct; | |
| 59 | + } | |
| 60 | + | |
| 61 | + public void setCt(Long ct) { | |
| 62 | + this.ct = ct; | |
| 63 | + } | |
| 64 | + | |
| 65 | + public int getOutOrIn() { | |
| 66 | + return outOrIn; | |
| 67 | + } | |
| 68 | + | |
| 69 | + public void setOutOrIn(int outOrIn) { | |
| 70 | + this.outOrIn = outOrIn; | |
| 71 | + } | |
| 72 | + | |
| 73 | + public String getDestCode() { | |
| 74 | + return destCode; | |
| 75 | + } | |
| 76 | + | |
| 77 | + public void setDestCode(String destCode) { | |
| 78 | + this.destCode = destCode; | |
| 79 | + } | |
| 80 | +} | ... | ... |
src/main/java/com/bsth/data/gpsdata/arrival/entity/SignalState.java
0 → 100644
| 1 | +package com.bsth.data.gpsdata.arrival.entity; | |
| 2 | + | |
| 3 | +import com.bsth.data.BasicData; | |
| 4 | +import com.bsth.entity.realcontrol.ScheduleRealInfo; | |
| 5 | +import org.joda.time.format.DateTimeFormat; | |
| 6 | +import org.joda.time.format.DateTimeFormatter; | |
| 7 | + | |
| 8 | +/** | |
| 9 | + * 信号状态 | |
| 10 | + * Created by panzhao on 2016/12/30. | |
| 11 | + */ | |
| 12 | +public class SignalState { | |
| 13 | + | |
| 14 | + private String type; | |
| 15 | + | |
| 16 | + private Long st; | |
| 17 | + | |
| 18 | + //private Long checkTime; | |
| 19 | + | |
| 20 | + private Long schId; | |
| 21 | + | |
| 22 | + private String lineCode; | |
| 23 | + | |
| 24 | + private String text; | |
| 25 | + | |
| 26 | + private RouteReverse reverse; | |
| 27 | + | |
| 28 | + private SignalAbnormal signalAbnormal; | |
| 29 | + | |
| 30 | + private static DateTimeFormatter fmtHHmm = DateTimeFormat.forPattern("HH:mm"); | |
| 31 | + | |
| 32 | + /** | |
| 33 | + * 记录区间调头 | |
| 34 | + * | |
| 35 | + * @param sch | |
| 36 | + * @param reverse | |
| 37 | + * @return | |
| 38 | + */ | |
| 39 | + public static SignalState reverseSignalSTate(ScheduleRealInfo sch, RouteReverse reverse) { | |
| 40 | + if(reverse.isVague()) | |
| 41 | + return null; | |
| 42 | + | |
| 43 | + SignalState state = new SignalState(); | |
| 44 | + state.setSchId(sch.getId()); | |
| 45 | + state.setType("route_reverse"); | |
| 46 | + //state.setCheckTime(System.currentTimeMillis()); | |
| 47 | + | |
| 48 | + String stationName = BasicData.stationCode2NameMap.get(sch.getXlBm() + "_" + sch.getXlDir() + "_" + reverse.getTurned()); | |
| 49 | + state.setText(fmtHHmm.print(reverse.getZt()) + " 从 " + stationName + " 站掉头"); | |
| 50 | + state.setSt(sch.getFcsjActualTime()); | |
| 51 | + state.setLineCode(sch.getXlBm()); | |
| 52 | + state.setReverse(reverse); | |
| 53 | + return state; | |
| 54 | + } | |
| 55 | + | |
| 56 | + public static SignalState abnormalSignalSTate(ScheduleRealInfo sch, SignalAbnormal signalAbnormal) { | |
| 57 | + SignalState state = new SignalState(); | |
| 58 | + state.setSchId(sch.getId()); | |
| 59 | + state.setType("abnormal_signal"); | |
| 60 | + //state.setCheckTime(signalAbnormal.getCt()); | |
| 61 | + state.setLineCode(sch.getXlBm()); | |
| 62 | + | |
| 63 | + String text = (fmtHHmm.print(signalAbnormal.getSt()) + " ~ " + fmtHHmm.print(signalAbnormal.getEt())); | |
| 64 | + String abnormType = signalAbnormal.getAbnormalType(); | |
| 65 | + if (abnormType.equals("drift")) | |
| 66 | + text += "(GPS无效)"; | |
| 67 | + else if (abnormType.equals("reconnection")) | |
| 68 | + text += "(信号丢失)"; | |
| 69 | + | |
| 70 | + state.setText(text); | |
| 71 | + state.setSignalAbnormal(signalAbnormal); | |
| 72 | + return state; | |
| 73 | + } | |
| 74 | + | |
| 75 | + public String getType() { | |
| 76 | + return type; | |
| 77 | + } | |
| 78 | + | |
| 79 | + public void setType(String type) { | |
| 80 | + this.type = type; | |
| 81 | + } | |
| 82 | + | |
| 83 | + public long getSchId() { | |
| 84 | + return schId; | |
| 85 | + } | |
| 86 | + | |
| 87 | + public void setSchId(long schId) { | |
| 88 | + this.schId = schId; | |
| 89 | + } | |
| 90 | + | |
| 91 | + public String getLineCode() { | |
| 92 | + return lineCode; | |
| 93 | + } | |
| 94 | + | |
| 95 | + public void setLineCode(String lineCode) { | |
| 96 | + this.lineCode = lineCode; | |
| 97 | + } | |
| 98 | + | |
| 99 | + public Long getSt() { | |
| 100 | + return st; | |
| 101 | + } | |
| 102 | + | |
| 103 | + public void setSt(Long st) { | |
| 104 | + this.st = st; | |
| 105 | + } | |
| 106 | + | |
| 107 | + public String getText() { | |
| 108 | + return text; | |
| 109 | + } | |
| 110 | + | |
| 111 | + public void setText(String text) { | |
| 112 | + this.text = text; | |
| 113 | + } | |
| 114 | + | |
| 115 | + public RouteReverse getReverse() { | |
| 116 | + return reverse; | |
| 117 | + } | |
| 118 | + | |
| 119 | + public void setReverse(RouteReverse reverse) { | |
| 120 | + this.reverse = reverse; | |
| 121 | + } | |
| 122 | + | |
| 123 | + public SignalAbnormal getSignalAbnormal() { | |
| 124 | + return signalAbnormal; | |
| 125 | + } | |
| 126 | + | |
| 127 | + public void setSignalAbnormal(SignalAbnormal signalAbnormal) { | |
| 128 | + this.signalAbnormal = signalAbnormal; | |
| 129 | + } | |
| 130 | +} | ... | ... |
src/main/java/com/bsth/data/gpsdata/analyse/StationRoute.java renamed to src/main/java/com/bsth/data/gpsdata/arrival/entity/StationRoute.java
| 1 | -package com.bsth.data.gpsdata.analyse; | |
| 1 | +package com.bsth.data.gpsdata.arrival.entity; | |
| 2 | 2 | |
| 3 | 3 | import com.vividsolutions.jts.geom.Point; |
| 4 | 4 | import com.vividsolutions.jts.geom.Polygon; |
| ... | ... | @@ -58,6 +58,8 @@ public class StationRoute { |
| 58 | 58 | */ |
| 59 | 59 | private StationRoute prve; |
| 60 | 60 | |
| 61 | + private String name; | |
| 62 | + | |
| 61 | 63 | public String getCode() { |
| 62 | 64 | return code; |
| 63 | 65 | } |
| ... | ... | @@ -137,5 +139,13 @@ public class StationRoute { |
| 137 | 139 | public void setMark(String mark) { |
| 138 | 140 | this.mark = mark; |
| 139 | 141 | } |
| 142 | + | |
| 143 | + public String getName() { | |
| 144 | + return name; | |
| 145 | + } | |
| 146 | + | |
| 147 | + public void setName(String name) { | |
| 148 | + this.name = name; | |
| 149 | + } | |
| 140 | 150 | } |
| 141 | 151 | ... | ... |
src/main/java/com/bsth/data/gpsdata/arrival/handlers/CorrectSignalHandle.java
0 → 100644
| 1 | +package com.bsth.data.gpsdata.arrival.handlers; | |
| 2 | + | |
| 3 | +import com.bsth.data.gpsdata.GpsEntity; | |
| 4 | +import com.bsth.data.gpsdata.arrival.SignalHandle; | |
| 5 | +import com.bsth.data.gpsdata.arrival.utils.CircleQueue; | |
| 6 | +import com.bsth.data.schedule.DayOfSchedule; | |
| 7 | +import com.bsth.entity.realcontrol.ChildTaskPlan; | |
| 8 | +import com.bsth.entity.realcontrol.ScheduleRealInfo; | |
| 9 | +import org.springframework.beans.factory.annotation.Autowired; | |
| 10 | +import org.springframework.stereotype.Component; | |
| 11 | + | |
| 12 | +/** | |
| 13 | + * 信号状态纠正 | |
| 14 | + * Created by panzhao on 2016/12/27. | |
| 15 | + */ | |
| 16 | +@Component | |
| 17 | +public class CorrectSignalHandle extends SignalHandle { | |
| 18 | + | |
| 19 | + @Autowired | |
| 20 | + DayOfSchedule dayOfSchedule; | |
| 21 | + | |
| 22 | + @Override | |
| 23 | + public boolean handle(GpsEntity gps, CircleQueue<GpsEntity> prevs) { | |
| 24 | + Object task = dayOfSchedule.executeCurr(gps.getNbbm()); | |
| 25 | + if(task == null) | |
| 26 | + return false; | |
| 27 | + ScheduleRealInfo sch; | |
| 28 | + | |
| 29 | + //子任务 | |
| 30 | + if(task.getClass().isAssignableFrom(ChildTaskPlan.class)){ | |
| 31 | + ChildTaskPlan childTask = (ChildTaskPlan) task; | |
| 32 | + sch = childTask.getSchedule(); | |
| 33 | + } | |
| 34 | + else | |
| 35 | + sch = (ScheduleRealInfo) task; | |
| 36 | + | |
| 37 | + int updown = Integer.parseInt(sch.getXlDir()); | |
| 38 | + //走向 | |
| 39 | + if(gps.getUpDown() != updown){ | |
| 40 | + gps.setUpDown(updown); | |
| 41 | + gps.setState(0); | |
| 42 | + } | |
| 43 | + | |
| 44 | + | |
| 45 | + return true; | |
| 46 | + } | |
| 47 | +} | ... | ... |
src/main/java/com/bsth/data/gpsdata/arrival/handlers/InOutStationSignalHandle.java
0 → 100644
| 1 | +package com.bsth.data.gpsdata.arrival.handlers; | |
| 2 | + | |
| 3 | +import com.bsth.data.LineConfigData; | |
| 4 | +import com.bsth.data.gpsdata.GpsEntity; | |
| 5 | +import com.bsth.data.gpsdata.arrival.SignalHandle; | |
| 6 | +import com.bsth.data.gpsdata.arrival.utils.CircleQueue; | |
| 7 | +import com.bsth.data.gpsdata.arrival.utils.ScheduleSignalState; | |
| 8 | +import com.bsth.data.gpsdata.arrival.utils.SignalSchPlanMatcher; | |
| 9 | +import com.bsth.data.schedule.DayOfSchedule; | |
| 10 | +import com.bsth.entity.realcontrol.LineConfig; | |
| 11 | +import com.bsth.entity.realcontrol.ScheduleRealInfo; | |
| 12 | +import com.bsth.service.directive.DirectiveService; | |
| 13 | +import com.bsth.websocket.handler.SendUtils; | |
| 14 | +import org.apache.commons.lang3.StringUtils; | |
| 15 | +import org.slf4j.Logger; | |
| 16 | +import org.slf4j.LoggerFactory; | |
| 17 | +import org.springframework.beans.factory.annotation.Autowired; | |
| 18 | +import org.springframework.stereotype.Component; | |
| 19 | + | |
| 20 | +/** | |
| 21 | + * 进出站动作处理 | |
| 22 | + * Created by panzhao on 2016/12/27. | |
| 23 | + */ | |
| 24 | +@Component | |
| 25 | +public class InOutStationSignalHandle extends SignalHandle{ | |
| 26 | + | |
| 27 | + Logger logger = LoggerFactory.getLogger(this.getClass()); | |
| 28 | + | |
| 29 | + @Autowired | |
| 30 | + DayOfSchedule dayOfSchedule; | |
| 31 | + | |
| 32 | + @Autowired | |
| 33 | + LineConfigData lineConfigData; | |
| 34 | + | |
| 35 | + @Autowired | |
| 36 | + SendUtils sendUtils; | |
| 37 | + | |
| 38 | + @Autowired | |
| 39 | + DirectiveService directiveService; | |
| 40 | + | |
| 41 | + @Autowired | |
| 42 | + ScheduleSignalState scheduleSignalState; | |
| 43 | + | |
| 44 | + @Autowired | |
| 45 | + SignalSchPlanMatcher signalSchPlanMatcher; | |
| 46 | + | |
| 47 | + private final static int MAX_BEFORE_TIME = 1000 * 60 * 72; | |
| 48 | + | |
| 49 | + @Override | |
| 50 | + public boolean handle(GpsEntity gps, CircleQueue<GpsEntity> prevs) { | |
| 51 | + //忽略漂移信号 | |
| 52 | + if(isDriftSignal(gps)) | |
| 53 | + return false; | |
| 54 | + | |
| 55 | + //从异常状态恢复的第一个信号 | |
| 56 | + if(abnormalRecovery(gps, prevs)){ | |
| 57 | + //回溯一下之前的轨迹 | |
| 58 | + scheduleSignalState.signalRetrospect(gps); | |
| 59 | + } | |
| 60 | + | |
| 61 | + if(isNotEmpty(prevs)){ | |
| 62 | + GpsEntity prev = prevs.getTail(); | |
| 63 | + if(isOutStation(gps, prev)) | |
| 64 | + outStation(gps, prev); | |
| 65 | + | |
| 66 | + | |
| 67 | + if(isInStation(gps, prev)) | |
| 68 | + inStation(gps, prev); | |
| 69 | + } | |
| 70 | + | |
| 71 | + return true; | |
| 72 | + } | |
| 73 | + | |
| 74 | + private boolean isOutStation(GpsEntity gps, GpsEntity prev){ | |
| 75 | + //从站内到站外 | |
| 76 | + if(prev.getInstation() > 0 && gps.getInstation() == 0) | |
| 77 | + return true; | |
| 78 | + | |
| 79 | + //从站内到另一个站内 | |
| 80 | + if(prev.getInstation() > 0 && gps.getInstation() > 0 | |
| 81 | + && !prev.getStopNo().equals(gps.getStopNo())) | |
| 82 | + return true; | |
| 83 | + return false; | |
| 84 | + } | |
| 85 | + | |
| 86 | + private boolean isInStation(GpsEntity gps, GpsEntity prev){ | |
| 87 | + //从站外到站内 | |
| 88 | + if(prev.getInstation() == 0 && gps.getInstation() > 0 | |
| 89 | + /*&& !prev.getStopNo().equals(gps.getStopNo())*/){ | |
| 90 | + return true; | |
| 91 | + } | |
| 92 | + | |
| 93 | + //从站内到另一个站内 | |
| 94 | + if(prev.getInstation() > 0 && gps.getInstation() > 0 | |
| 95 | + && !prev.getStopNo().equals(gps.getStopNo())) | |
| 96 | + return true; | |
| 97 | + return false; | |
| 98 | + } | |
| 99 | + | |
| 100 | + /** | |
| 101 | + * 出站 | |
| 102 | + * @param gps 当前点 | |
| 103 | + * @param prev 上一个点 | |
| 104 | + */ | |
| 105 | + private void outStation(GpsEntity gps, GpsEntity prev) { | |
| 106 | + ScheduleRealInfo sch = dayOfSchedule.executeCurr(gps.getNbbm()); | |
| 107 | + String qdzCode = sch.getQdzCode(); | |
| 108 | + | |
| 109 | + //首班出场最多提前1.2小时 | |
| 110 | + if(dayOfSchedule.isFirstOut(sch) && sch.getDfsjT() - gps.getTimestamp() > MAX_BEFORE_TIME) | |
| 111 | + return; | |
| 112 | + | |
| 113 | + //起点发车 | |
| 114 | + if(qdzCode != null && prev.getStopNo().equals(qdzCode) | |
| 115 | + && !willDepart(gps, prev, sch)){ | |
| 116 | + | |
| 117 | + //发车班次匹配 | |
| 118 | + signalSchPlanMatcher.outMatch(gps, sch); | |
| 119 | + sch = dayOfSchedule.executeCurr(gps.getNbbm()); | |
| 120 | + | |
| 121 | + //实发时间不覆盖 | |
| 122 | + if(StringUtils.isNotEmpty(sch.getFcsjActual())) | |
| 123 | + return; | |
| 124 | + | |
| 125 | + //实发时间 | |
| 126 | + sch.setFcsjActualAll(gps.getTimestamp()); | |
| 127 | + //通知客户端 | |
| 128 | + sendUtils.sendFcsj(sch); | |
| 129 | + //持久化 | |
| 130 | + dayOfSchedule.save(sch); | |
| 131 | + | |
| 132 | + //出站既出场 | |
| 133 | + outStationAndOutPark(sch); | |
| 134 | + logger.info("班次:" + sch.getDfsj() + "发车, 时间:" + sch.getFcsjActual()); | |
| 135 | + } | |
| 136 | + else if(sch.getBcType().equals("out")){ | |
| 137 | + ScheduleRealInfo next = dayOfSchedule.nextSame(sch); | |
| 138 | + if(prev.getStopNo().equals(next.getQdzCode())){ | |
| 139 | + //发下一个班次 | |
| 140 | + dayOfSchedule.addExecPlan(next); | |
| 141 | + outStation(gps, prev); | |
| 142 | + } | |
| 143 | + } | |
| 144 | + } | |
| 145 | + | |
| 146 | + | |
| 147 | + private void outStationAndOutPark(ScheduleRealInfo sch){ | |
| 148 | + LineConfig config = lineConfigData.get(sch.getXlBm()); | |
| 149 | + if (config != null && config.getOutConfig() == 2) { | |
| 150 | + //出站既出场 | |
| 151 | + ScheduleRealInfo schPrev = dayOfSchedule.prev(sch); | |
| 152 | + if (schPrev != null && schPrev.getBcType().equals("out")) { | |
| 153 | + schPrev.setFcsjActualAll(sch.getFcsjActualTime()); | |
| 154 | + schPrev.setZdsjActualAll(sch.getFcsjActualTime()); | |
| 155 | + | |
| 156 | + sendUtils.refreshSch(schPrev); | |
| 157 | + } | |
| 158 | + } | |
| 159 | + } | |
| 160 | + | |
| 161 | + /** | |
| 162 | + * 进站 | |
| 163 | + * @param gps 当前点 | |
| 164 | + * @param prev 上一个点 | |
| 165 | + */ | |
| 166 | + private void inStation(GpsEntity gps, GpsEntity prev){ | |
| 167 | + ScheduleRealInfo sch = dayOfSchedule.executeCurr(gps.getNbbm()); | |
| 168 | + | |
| 169 | + if(gps.getStopNo().equals(sch.getZdzCode())){ | |
| 170 | + | |
| 171 | + //实达时间不覆盖 | |
| 172 | + if(StringUtils.isNotEmpty(sch.getZdsjActual())) | |
| 173 | + return; | |
| 174 | + | |
| 175 | + sch.setZdsjActualAll(gps.getTimestamp()); | |
| 176 | + //已完成班次数 | |
| 177 | + int doneSum = dayOfSchedule.doneSum(sch.getClZbh()); | |
| 178 | + ScheduleRealInfo next = dayOfSchedule.next(sch); | |
| 179 | + //通知客户端 | |
| 180 | + sendUtils.sendZdsj(sch, next, doneSum); | |
| 181 | + //持久化 | |
| 182 | + dayOfSchedule.save(sch); | |
| 183 | + //下发调度指令 | |
| 184 | + directiveService.send60Dispatch(next, doneSum, "到站@系统"); | |
| 185 | + | |
| 186 | + //准备执行下一个班次 | |
| 187 | + if (next != null) { | |
| 188 | + next.setQdzArrDatesj(sch.getZdsjActual()); | |
| 189 | + dayOfSchedule.addExecPlan(next); | |
| 190 | + //进站既进场 | |
| 191 | + inStationAndInPark(sch, next); | |
| 192 | + //将gps转换为下一个班次走向的站内信号 | |
| 193 | + transformUpdown(gps, sch); | |
| 194 | + } | |
| 195 | + } | |
| 196 | + else if(sch.getFcsjActual() == null){ | |
| 197 | + //有进站,但班次没有实发,向前追溯一下信号 | |
| 198 | + scheduleSignalState.signalRetrospect(gps, sch); | |
| 199 | + } | |
| 200 | + } | |
| 201 | + | |
| 202 | + /** | |
| 203 | + * 进站既进场 | |
| 204 | + * @param sch | |
| 205 | + */ | |
| 206 | + private void inStationAndInPark(ScheduleRealInfo sch, ScheduleRealInfo next){ | |
| 207 | + LineConfig config = lineConfigData.get(sch.getXlBm()); | |
| 208 | + if (next.getBcType().equals("in") && | |
| 209 | + config != null && config.getOutConfig() == 2) { | |
| 210 | + next.setFcsjActualAll(sch.getZdsjActualTime()); | |
| 211 | + next.setZdsjActualAll(sch.getZdsjActualTime()); | |
| 212 | + | |
| 213 | + sendUtils.refreshSch(next); | |
| 214 | + } | |
| 215 | + } | |
| 216 | + | |
| 217 | + /** | |
| 218 | + * 发车漂移判定(这里出现的误判,由车辆到达中途站的时候补偿) | |
| 219 | + * @param gps | |
| 220 | + * @param prev | |
| 221 | + * @param task | |
| 222 | + * @return | |
| 223 | + */ | |
| 224 | + private boolean willDepart(GpsEntity gps, GpsEntity prev, Object task){ | |
| 225 | + | |
| 226 | + /*ScheduleRealInfo sch = (ScheduleRealInfo) task; | |
| 227 | + ScheduleRealInfo prevTask = dayOfSchedule.prev(sch); | |
| 228 | + if(prevTask == null || prevTask.getBcType().equals("out")) | |
| 229 | + return false; | |
| 230 | + | |
| 231 | + //计划停站时间 | |
| 232 | + int stopTimePlan = (int) (sch.getDfsjT() - prevTask.getZdsjT()); | |
| 233 | + | |
| 234 | + if(stopTimePlan < 1000 * 60 * 10) | |
| 235 | + return false; | |
| 236 | + | |
| 237 | + //实际停站时间 | |
| 238 | + if(prevTask.getZdsjActual() != null){ | |
| 239 | + int actualTime = (int) (gps.getTimestamp() - prevTask.getZdsjActualTime()); | |
| 240 | + | |
| 241 | + if(actualTime < stopTimePlan * 0.8){ | |
| 242 | + logger.info("漂移判定"); | |
| 243 | + | |
| 244 | + return true; | |
| 245 | + } | |
| 246 | + }*/ | |
| 247 | + return false; | |
| 248 | + } | |
| 249 | +} | ... | ... |
src/main/java/com/bsth/data/gpsdata/arrival/handlers/OfflineSignalHandle.java
0 → 100644
| 1 | +package com.bsth.data.gpsdata.arrival.handlers; | |
| 2 | + | |
| 3 | +import com.bsth.data.gpsdata.GpsEntity; | |
| 4 | +import com.bsth.data.gpsdata.arrival.GeoCacheData; | |
| 5 | +import com.bsth.data.gpsdata.arrival.SignalHandle; | |
| 6 | +import com.bsth.data.gpsdata.arrival.utils.CircleQueue; | |
| 7 | +import org.springframework.stereotype.Component; | |
| 8 | + | |
| 9 | +/** | |
| 10 | + * 信号断线重连处理 | |
| 11 | + * Created by panzhao on 2016/12/27. | |
| 12 | + */ | |
| 13 | +@Component | |
| 14 | +public class OfflineSignalHandle extends SignalHandle{ | |
| 15 | + | |
| 16 | + //断开2分钟,标记为重连信号 | |
| 17 | + private final static int OFFLINE_TIME = 1000 * 60 * 2; | |
| 18 | + | |
| 19 | + //断开70分钟,之前的信号不再有参考价值 | |
| 20 | + private final static int CLEAR_TIME = 1000 * 60 * 70; | |
| 21 | + | |
| 22 | + @Override | |
| 23 | + public boolean handle(GpsEntity gps, CircleQueue<GpsEntity> prevs) { | |
| 24 | + //漂移信号不管 | |
| 25 | + if(isDriftSignal(gps)){ | |
| 26 | + gps.setSignalState("drift"); | |
| 27 | + return true; | |
| 28 | + } | |
| 29 | + | |
| 30 | + if(isNotEmpty(prevs)){ | |
| 31 | + GpsEntity prev = prevs.getTail(); | |
| 32 | + int space = (int) (gps.getTimestamp() - prev.getTimestamp()); | |
| 33 | + if(space > OFFLINE_TIME) | |
| 34 | + gps.setSignalState("reconnection"); | |
| 35 | + | |
| 36 | + if(space > CLEAR_TIME){ | |
| 37 | + //清理缓存的信号 | |
| 38 | + GeoCacheData.clear(gps.getNbbm()); | |
| 39 | + } | |
| 40 | + } | |
| 41 | + return true; | |
| 42 | + } | |
| 43 | +} | |
| 0 | 44 | \ No newline at end of file | ... | ... |
src/main/java/com/bsth/data/gpsdata/arrival/handlers/ReverseSignalHandle.java
0 → 100644
| 1 | +package com.bsth.data.gpsdata.arrival.handlers; | |
| 2 | + | |
| 3 | +import com.bsth.data.gpsdata.GpsEntity; | |
| 4 | +import com.bsth.data.gpsdata.arrival.GeoCacheData; | |
| 5 | +import com.bsth.data.gpsdata.arrival.SignalHandle; | |
| 6 | +import com.bsth.data.gpsdata.arrival.entity.RouteReverse; | |
| 7 | +import com.bsth.data.gpsdata.arrival.entity.StationRoute; | |
| 8 | +import com.bsth.data.gpsdata.arrival.utils.CircleQueue; | |
| 9 | +import com.bsth.data.gpsdata.arrival.utils.ScheduleSignalState; | |
| 10 | +import com.bsth.data.schedule.DayOfSchedule; | |
| 11 | +import org.slf4j.Logger; | |
| 12 | +import org.slf4j.LoggerFactory; | |
| 13 | +import org.springframework.beans.factory.annotation.Autowired; | |
| 14 | +import org.springframework.stereotype.Component; | |
| 15 | + | |
| 16 | +/** | |
| 17 | + * 路由反向信号处理 | |
| 18 | + * Created by panzhao on 2016/12/28. | |
| 19 | + */ | |
| 20 | +@Component | |
| 21 | +public class ReverseSignalHandle extends SignalHandle { | |
| 22 | + | |
| 23 | + Logger logger = LoggerFactory.getLogger(this.getClass()); | |
| 24 | + | |
| 25 | + @Autowired | |
| 26 | + DayOfSchedule dayOfSchedule; | |
| 27 | + | |
| 28 | + @Autowired | |
| 29 | + ScheduleSignalState scheduleSignalState; | |
| 30 | + | |
| 31 | + @Override | |
| 32 | + public boolean handle(GpsEntity gps, CircleQueue<GpsEntity> prevs) { | |
| 33 | + if (!isNotEmpty(prevs)) | |
| 34 | + return false; | |
| 35 | + | |
| 36 | + GpsEntity prev = prevs.getTail(); | |
| 37 | + | |
| 38 | + if (isReverse(gps, prev)) { | |
| 39 | + RouteReverse reverse = reverseSearch(prevs, gps); | |
| 40 | + | |
| 41 | + if (reverse.getCount() >= 4 | |
| 42 | + && reverse.isClose() | |
| 43 | + && !GeoCacheData.isEndStation(gps.getLineId(), gps.getUpDown(), reverse.getTurned())) { | |
| 44 | + scheduleSignalState.reverseAnalyse(reverse); | |
| 45 | + } | |
| 46 | + } | |
| 47 | + return false; | |
| 48 | + } | |
| 49 | + | |
| 50 | + /** | |
| 51 | + * 搜索路由反向详细 | |
| 52 | + * | |
| 53 | + * @param prevs | |
| 54 | + * @param gps | |
| 55 | + * @return | |
| 56 | + */ | |
| 57 | + public RouteReverse reverseSearch(CircleQueue<GpsEntity> prevs, GpsEntity gps) { | |
| 58 | + RouteReverse routeReverse = new RouteReverse(); | |
| 59 | + int count = 0; | |
| 60 | + String path = ""; | |
| 61 | + long zt = 0L; | |
| 62 | + boolean half = false; | |
| 63 | + | |
| 64 | + //当前站点 | |
| 65 | + StationRoute curr = GeoCacheData.getRouteCode(gps), sr; | |
| 66 | + GpsEntity prev; | |
| 67 | + Object[] array = prevs.getQueue(); | |
| 68 | + for (int i = array.length - 1; i > 0; i--) { | |
| 69 | + prev = (GpsEntity) array[i]; | |
| 70 | + | |
| 71 | + if (!prev.getUpDown().equals(gps.getUpDown()) | |
| 72 | + || prev.getSignalState().equals("reconnection")) | |
| 73 | + break; | |
| 74 | + | |
| 75 | + if (prev.getInstation() == 1) { | |
| 76 | + sr = GeoCacheData.getRouteCode(prev); | |
| 77 | + | |
| 78 | + if (sr.getRouteSort() > curr.getRouteSort()) { | |
| 79 | + if(half){ | |
| 80 | + routeReverse.setVague(true); | |
| 81 | + } | |
| 82 | + | |
| 83 | + path += (curr.getCode() + ","); | |
| 84 | + count++; | |
| 85 | + zt = prev.getTimestamp(); | |
| 86 | + } else if (sr.getRouteSort() < curr.getRouteSort()) { | |
| 87 | + if (routeReverse.getTurned() == null) { | |
| 88 | + routeReverse.setTurned(curr.getCode()); | |
| 89 | + half = true; | |
| 90 | + } | |
| 91 | + | |
| 92 | + path += (curr.getCode() + ","); | |
| 93 | + //掉头前当前站 | |
| 94 | + if (sr.getCode().equals(gps.getStopNo())) { | |
| 95 | + routeReverse.setClose(true); | |
| 96 | + path += sr.getCode(); | |
| 97 | + break; | |
| 98 | + } | |
| 99 | + } | |
| 100 | + | |
| 101 | + curr = sr; | |
| 102 | + } | |
| 103 | + } | |
| 104 | + | |
| 105 | + routeReverse.setZt(zt); | |
| 106 | + routeReverse.setCount(count); | |
| 107 | + routeReverse.setDetail(path); | |
| 108 | + routeReverse.setCt(gps.getTimestamp()); | |
| 109 | + routeReverse.setNbbm(gps.getNbbm()); | |
| 110 | + return routeReverse; | |
| 111 | + } | |
| 112 | + | |
| 113 | + /** | |
| 114 | + * 是否反向 | |
| 115 | + * | |
| 116 | + * @param gps | |
| 117 | + * @param prev | |
| 118 | + * @return | |
| 119 | + */ | |
| 120 | + public boolean isReverse(GpsEntity gps, GpsEntity prev) { | |
| 121 | + if (gps.getInstation() == 1 | |
| 122 | + && | |
| 123 | + gps.getUpDown().equals(prev.getUpDown()) | |
| 124 | + && !gps.getStopNo().equals(prev.getStopNo())) { | |
| 125 | + | |
| 126 | + StationRoute currStation = GeoCacheData.getRouteCode(gps); | |
| 127 | + StationRoute prevStation = GeoCacheData.getRouteCode(prev); | |
| 128 | + | |
| 129 | + if (currStation == null || prevStation == null) | |
| 130 | + return false; | |
| 131 | + | |
| 132 | + if (currStation.getRouteSort() < prevStation.getRouteSort()) | |
| 133 | + return true; | |
| 134 | + } | |
| 135 | + return false; | |
| 136 | + } | |
| 137 | +} | |
| 0 | 138 | \ No newline at end of file | ... | ... |
src/main/java/com/bsth/data/gpsdata/arrival/handlers/StationInsideHandle.java
0 → 100644
| 1 | +package com.bsth.data.gpsdata.arrival.handlers; | |
| 2 | + | |
| 3 | +import com.bsth.data.gpsdata.GpsEntity; | |
| 4 | +import com.bsth.data.gpsdata.arrival.GeoCacheData; | |
| 5 | +import com.bsth.data.gpsdata.arrival.SignalHandle; | |
| 6 | +import com.bsth.data.gpsdata.arrival.entity.StationRoute; | |
| 7 | +import com.bsth.data.gpsdata.arrival.utils.CircleQueue; | |
| 8 | +import com.bsth.data.gpsdata.arrival.utils.GeoUtils; | |
| 9 | +import org.springframework.stereotype.Component; | |
| 10 | + | |
| 11 | +import java.util.List; | |
| 12 | + | |
| 13 | +/** | |
| 14 | + * 站内站外判定 | |
| 15 | + * Created by panzhao on 2016/12/27. | |
| 16 | + */ | |
| 17 | +@Component | |
| 18 | +public class StationInsideHandle extends SignalHandle { | |
| 19 | + | |
| 20 | + | |
| 21 | + @Override | |
| 22 | + public boolean handle(GpsEntity gps, CircleQueue<GpsEntity> prevs) { | |
| 23 | + //是否在场内 | |
| 24 | + String parkCode = GeoUtils.gpsInCarpark(gps); | |
| 25 | + if (parkCode != null) { | |
| 26 | + gps.setInstation(2); | |
| 27 | + gps.setStopNo(parkCode); | |
| 28 | + } | |
| 29 | + | |
| 30 | + //是否在站内 | |
| 31 | + List<StationRoute> srs = GeoCacheData.getStationRoute(gps.getLineId(), gps.getUpDown()); | |
| 32 | + StationRoute station = GeoUtils.gpsInStation(gps, srs); | |
| 33 | + if (station != null) { | |
| 34 | + gps.setInstation(1); | |
| 35 | + gps.setStopNo(station.getCode()); | |
| 36 | + gps.setStation(station); | |
| 37 | + } | |
| 38 | + | |
| 39 | + //在场,站外 | |
| 40 | + if(gps.getInstation() == 0 && isNotEmpty(prevs)){ | |
| 41 | + //继承上一个点的站点编码 | |
| 42 | + GpsEntity prev = prevs.getTail(); | |
| 43 | + gps.setStopNo(prev.getStopNo()); | |
| 44 | + } | |
| 45 | + | |
| 46 | + return true; | |
| 47 | + } | |
| 48 | +} | ... | ... |
src/main/java/com/bsth/data/gpsdata/analyse/CircleQueue.java renamed to src/main/java/com/bsth/data/gpsdata/arrival/utils/CircleQueue.java
| 1 | -package com.bsth.data.gpsdata.analyse; | |
| 1 | +package com.bsth.data.gpsdata.arrival.utils; | |
| 2 | 2 | |
| 3 | 3 | import java.util.Arrays; |
| 4 | 4 | |
| ... | ... | @@ -19,12 +19,12 @@ public class CircleQueue<T> { |
| 19 | 19 | public Object[] elementData; |
| 20 | 20 | |
| 21 | 21 | /** |
| 22 | - * 队头(先进先出) | |
| 22 | + * 头 | |
| 23 | 23 | */ |
| 24 | 24 | public int head = 0; |
| 25 | 25 | |
| 26 | 26 | /** |
| 27 | - * 队尾 | |
| 27 | + * 尾 | |
| 28 | 28 | */ |
| 29 | 29 | public int tail = 0; |
| 30 | 30 | |
| ... | ... | @@ -39,7 +39,7 @@ public class CircleQueue<T> { |
| 39 | 39 | } |
| 40 | 40 | |
| 41 | 41 | /** |
| 42 | - * 获取循环队列的大小(包含元素的个数) | |
| 42 | + * 获取循环队列的大小 | |
| 43 | 43 | */ |
| 44 | 44 | public int size() { |
| 45 | 45 | if (isEmpty()) { |
| ... | ... | @@ -87,10 +87,12 @@ public class CircleQueue<T> { |
| 87 | 87 | * @return 取 循环队列里的值(先进的index=0) |
| 88 | 88 | */ |
| 89 | 89 | public Object[] getQueue() { |
| 90 | - final Object[] elementDataSort = new Object[capacity]; | |
| 90 | + final Object[] elementDataSort; | |
| 91 | 91 | final Object[] elementDataCopy = elementData.clone(); |
| 92 | 92 | if (isEmpty()) { |
| 93 | + elementDataSort = new Object[0]; | |
| 93 | 94 | } else if (isFull()) { |
| 95 | + elementDataSort = new Object[capacity]; | |
| 94 | 96 | int indexMax = capacity; |
| 95 | 97 | int indexSort = 0; |
| 96 | 98 | for (int i = head; i < indexMax;) { |
| ... | ... | @@ -103,13 +105,18 @@ public class CircleQueue<T> { |
| 103 | 105 | } |
| 104 | 106 | } |
| 105 | 107 | } else { |
| 106 | - for (int i = 0; i < tail; i++) { | |
| 108 | + elementDataSort = new Object[tail + 1]; | |
| 109 | + for (int i = 0; i <= tail; i++) { | |
| 107 | 110 | elementDataSort[i] = elementDataCopy[i]; |
| 108 | 111 | } |
| 109 | 112 | } |
| 110 | 113 | return elementDataSort; |
| 111 | 114 | } |
| 112 | 115 | |
| 116 | + /** | |
| 117 | + * 取最后一个值 | |
| 118 | + * @return | |
| 119 | + */ | |
| 113 | 120 | public T getTail(){ |
| 114 | 121 | return elementData[tail] == null?null:(T)elementData[tail]; |
| 115 | 122 | } | ... | ... |
src/main/java/com/bsth/data/gpsdata/analyse/util/GeoUtils.java renamed to src/main/java/com/bsth/data/gpsdata/arrival/utils/GeoUtils.java
| 1 | -package com.bsth.data.gpsdata.analyse.util; | |
| 1 | +package com.bsth.data.gpsdata.arrival.utils; | |
| 2 | 2 | |
| 3 | 3 | import com.bsth.data.gpsdata.GpsEntity; |
| 4 | -import com.bsth.data.gpsdata.analyse.GeoCacheData; | |
| 5 | -import com.bsth.data.gpsdata.analyse.StationRoute; | |
| 4 | +import com.bsth.data.gpsdata.arrival.GeoCacheData; | |
| 5 | +import com.bsth.data.gpsdata.arrival.entity.StationRoute; | |
| 6 | 6 | import com.vividsolutions.jts.geom.Coordinate; |
| 7 | 7 | import com.vividsolutions.jts.geom.GeometryFactory; |
| 8 | 8 | import com.vividsolutions.jts.geom.Point; | ... | ... |
src/main/java/com/bsth/data/gpsdata/arrival/utils/ScheduleSignalState.java
0 → 100644
| 1 | +package com.bsth.data.gpsdata.arrival.utils; | |
| 2 | + | |
| 3 | +import com.bsth.data.LineConfigData; | |
| 4 | +import com.bsth.data.gpsdata.GpsEntity; | |
| 5 | +import com.bsth.data.gpsdata.SignalStateData; | |
| 6 | +import com.bsth.data.gpsdata.arrival.GeoCacheData; | |
| 7 | +import com.bsth.data.gpsdata.arrival.entity.RouteReverse; | |
| 8 | +import com.bsth.data.gpsdata.arrival.entity.SignalAbnormal; | |
| 9 | +import com.bsth.data.gpsdata.arrival.entity.SignalState; | |
| 10 | +import com.bsth.data.schedule.DayOfSchedule; | |
| 11 | +import com.bsth.entity.realcontrol.LineConfig; | |
| 12 | +import com.bsth.entity.realcontrol.ScheduleRealInfo; | |
| 13 | +import org.slf4j.Logger; | |
| 14 | +import org.slf4j.LoggerFactory; | |
| 15 | +import org.springframework.beans.factory.annotation.Autowired; | |
| 16 | +import org.springframework.stereotype.Component; | |
| 17 | + | |
| 18 | +/** | |
| 19 | + * 班次信号状态分析 | |
| 20 | + * Created by panzhao on 2016/12/29. | |
| 21 | + */ | |
| 22 | +@Component | |
| 23 | +public class ScheduleSignalState { | |
| 24 | + | |
| 25 | + @Autowired | |
| 26 | + DayOfSchedule dayOfSchedule; | |
| 27 | + | |
| 28 | + Logger logger = LoggerFactory.getLogger(this.getClass()); | |
| 29 | + | |
| 30 | + @Autowired | |
| 31 | + LineConfigData lineConfigData; | |
| 32 | + | |
| 33 | + @Autowired | |
| 34 | + SignalStateData signalStateData; | |
| 35 | + | |
| 36 | + /** | |
| 37 | + * 路由反向分析 | |
| 38 | + */ | |
| 39 | + public void reverseAnalyse(RouteReverse reverse) { | |
| 40 | + ScheduleRealInfo sch = dayOfSchedule.executeCurr(reverse.getNbbm()); | |
| 41 | + | |
| 42 | + String bcType = sch.getBcType(); | |
| 43 | + | |
| 44 | + switch (bcType) { | |
| 45 | + case "out": | |
| 46 | + outReverseAnalyse(sch, reverse); | |
| 47 | + break; | |
| 48 | + case "normal": | |
| 49 | + normalReverseAnalyse(sch, reverse); | |
| 50 | + break; | |
| 51 | + } | |
| 52 | + } | |
| 53 | + | |
| 54 | + /** | |
| 55 | + * 出场班次路由反向分析 | |
| 56 | + * | |
| 57 | + * @param sch | |
| 58 | + */ | |
| 59 | + private void outReverseAnalyse(ScheduleRealInfo sch, RouteReverse reverse) { | |
| 60 | + long t = reverse.getCt(); | |
| 61 | + //出场班次终点时间前,允许反向轨迹 | |
| 62 | + if (sch.getZdsjT() != null && sch.getZdsjT() > t) { | |
| 63 | + return; | |
| 64 | + } | |
| 65 | + | |
| 66 | + int rt; | |
| 67 | + //从实发 到 当前时间 < 计划运送时间 * 0.9 | |
| 68 | + if (sch.getFcsjActual() != null && sch.getBcsj() != null) { | |
| 69 | + rt = (int) (t - sch.getFcsjActualTime()); | |
| 70 | + if (rt < sch.getBcsj() * 0.9) | |
| 71 | + return; | |
| 72 | + } | |
| 73 | + | |
| 74 | + ScheduleRealInfo next = dayOfSchedule.next(sch); | |
| 75 | + if (next.getXlDir().equals(sch.getXlDir())) | |
| 76 | + return; | |
| 77 | + | |
| 78 | + //时间足够下一个班次待发时间运行到当前站 | |
| 79 | + int runTime = reverse.getCount() * 1500 * 60; | |
| 80 | + if (next.getDfsjT() + runTime < t) { | |
| 81 | + //跳到下一个班次 | |
| 82 | + dayOfSchedule.addExecPlan(next); | |
| 83 | + } | |
| 84 | + } | |
| 85 | + | |
| 86 | + /** | |
| 87 | + * 正常班次路由反向分析 | |
| 88 | + * | |
| 89 | + * @param sch | |
| 90 | + * @param reverse | |
| 91 | + */ | |
| 92 | + private void normalReverseAnalyse(ScheduleRealInfo sch, RouteReverse reverse) { | |
| 93 | + LineConfig conf = lineConfigData.get(sch.getXlBm()); | |
| 94 | + | |
| 95 | + if (conf.isReadReverse()) { | |
| 96 | + //跳下一个班次 | |
| 97 | + ScheduleRealInfo next = dayOfSchedule.next(sch); | |
| 98 | + if (next != null) | |
| 99 | + dayOfSchedule.addExecPlan(next); | |
| 100 | + | |
| 101 | + //记录信号状态 | |
| 102 | + SignalState signalState = SignalState.reverseSignalSTate(sch, reverse); | |
| 103 | + signalStateData.put(signalState); | |
| 104 | + } | |
| 105 | + } | |
| 106 | + | |
| 107 | + public void signalRetrospect(GpsEntity gps) { | |
| 108 | + signalRetrospect(gps, dayOfSchedule.executeCurr(gps.getNbbm())); | |
| 109 | + } | |
| 110 | + | |
| 111 | + /** | |
| 112 | + * 信号追溯 | |
| 113 | + * | |
| 114 | + * @param gps | |
| 115 | + * @param sch | |
| 116 | + */ | |
| 117 | + public void signalRetrospect(GpsEntity gps, ScheduleRealInfo sch) { | |
| 118 | + //回放数据,是否有掉线或者漂移 | |
| 119 | + CircleQueue<GpsEntity> queue = GeoCacheData.getGps(gps.getNbbm()); | |
| 120 | + if (queue == null || queue.size() == 0 /*|| gps.getInstation() == 0*/) | |
| 121 | + return; | |
| 122 | + | |
| 123 | + //起始时间点 | |
| 124 | + long st = 0; | |
| 125 | + ScheduleRealInfo prev = dayOfSchedule.prev(sch); | |
| 126 | + | |
| 127 | + if (prev != null) { | |
| 128 | + if (prev.getZdsjActual() != null) | |
| 129 | + st = prev.getZdsjActualTime(); | |
| 130 | + else | |
| 131 | + st = (GeoCacheData.midwayStation(gps.getLineId(), gps.getUpDown(), sch.getQdzCode(), gps.getStopNo()).size() + 1) * (1000 * 60 * 5); | |
| 132 | + } | |
| 133 | + | |
| 134 | + Object[] tempArray = queue.getQueue(); | |
| 135 | + int len = tempArray.length; | |
| 136 | + | |
| 137 | + Object[] array = new Object[len + 1]; | |
| 138 | + System.arraycopy(tempArray, 0, array, 0, len); | |
| 139 | + array[len] = gps; | |
| 140 | + | |
| 141 | + String gpsState = ""; | |
| 142 | + GpsEntity tempGps, nearGps = null; | |
| 143 | + int i = len - 1; | |
| 144 | + for (; i >= 0; i--) { | |
| 145 | + tempGps = (GpsEntity) array[i]; | |
| 146 | + | |
| 147 | + gpsState = tempGps.getSignalState(); | |
| 148 | + if (gpsState.equals("truncation")) | |
| 149 | + break; | |
| 150 | + else if (gpsState.equals("drift")) { | |
| 151 | + nearGps = (GpsEntity) array[i + 1]; | |
| 152 | + break; | |
| 153 | + } else if (gpsState.equals("reconnection")) { | |
| 154 | + nearGps = tempGps; | |
| 155 | + break; | |
| 156 | + } | |
| 157 | + | |
| 158 | + if (tempGps.getTimestamp() < st) | |
| 159 | + break; | |
| 160 | + } | |
| 161 | + | |
| 162 | + if (nearGps != null && i > 0) { | |
| 163 | + createSignalAbnormal(gpsState, nearGps, i, array, sch); | |
| 164 | + } | |
| 165 | + } | |
| 166 | + | |
| 167 | + private void createSignalAbnormal(String gpsState, GpsEntity nearGps, int i, Object[] array, ScheduleRealInfo sch) { | |
| 168 | + switch (gpsState) { | |
| 169 | + case "drift": | |
| 170 | + driftSignalAbnormal(nearGps, i, array, sch); | |
| 171 | + break; | |
| 172 | + case "reconnection": | |
| 173 | + offlineSignalAbnormal(nearGps, ((GpsEntity) array[i - 1]), sch); | |
| 174 | + break; | |
| 175 | + } | |
| 176 | + } | |
| 177 | + | |
| 178 | + /** | |
| 179 | + * 掉线异常状态记录 | |
| 180 | + * | |
| 181 | + * @param e | |
| 182 | + * @param s | |
| 183 | + */ | |
| 184 | + private void offlineSignalAbnormal(GpsEntity e, GpsEntity s, ScheduleRealInfo sch) { | |
| 185 | + long st = s.getTimestamp(), et = e.getTimestamp(); | |
| 186 | + | |
| 187 | + //掉线超过10分钟才记录 | |
| 188 | + if (et - st < (1000 * 60 * 10)) | |
| 189 | + return; | |
| 190 | + | |
| 191 | + SignalAbnormal signalAbnormal = new SignalAbnormal(); | |
| 192 | + signalAbnormal.setSt(st); | |
| 193 | + signalAbnormal.setEt(et); | |
| 194 | + signalAbnormal.setAbnormalType("reconnection"); | |
| 195 | + signalAbnormal.setDestCode(sch.getQdzCode()); | |
| 196 | + signalAbnormal.setOutOrIn(0); | |
| 197 | + | |
| 198 | + //截断GPS | |
| 199 | + e.setSignalState("truncation"); | |
| 200 | + | |
| 201 | + //记录信号状态 | |
| 202 | + SignalState signalState = SignalState.abnormalSignalSTate(sch, signalAbnormal); | |
| 203 | + signalStateData.put(signalState); | |
| 204 | + } | |
| 205 | + | |
| 206 | + /** | |
| 207 | + * 漂移异常状态记录 | |
| 208 | + * | |
| 209 | + * @param nearGps | |
| 210 | + * @param i | |
| 211 | + * @param array | |
| 212 | + */ | |
| 213 | + private void driftSignalAbnormal(GpsEntity nearGps, int i, Object[] array, ScheduleRealInfo sch) { | |
| 214 | + GpsEntity gps, s = null; | |
| 215 | + //找到漂移开始时间 | |
| 216 | + for (; i >= 0; i--) { | |
| 217 | + gps = (GpsEntity) array[i]; | |
| 218 | + | |
| 219 | + if (!gps.getSignalState().equals("drift") || i == 0 | |
| 220 | + || gps.getSignalState().equals("truncation")) { | |
| 221 | + s = gps; | |
| 222 | + break; | |
| 223 | + } | |
| 224 | + } | |
| 225 | + | |
| 226 | + long st = s.getTimestamp(), et = nearGps.getTimestamp(); | |
| 227 | + if (et - st < (1000 * 60 * 3)) | |
| 228 | + return; | |
| 229 | + /*if (s != null){ | |
| 230 | + st = s.getTimestamp(); | |
| 231 | + //漂移小于3分钟 | |
| 232 | + if(et - st < (1000 * 60 * 3)) | |
| 233 | + return; | |
| 234 | + }*/ | |
| 235 | + | |
| 236 | + | |
| 237 | + SignalAbnormal signalAbnormal = new SignalAbnormal(); | |
| 238 | + signalAbnormal.setSt(st); | |
| 239 | + signalAbnormal.setEt(et); | |
| 240 | + signalAbnormal.setAbnormalType("drift"); | |
| 241 | + signalAbnormal.setDestCode(sch.getQdzCode()); | |
| 242 | + signalAbnormal.setOutOrIn(0); | |
| 243 | + | |
| 244 | + //截断GPS | |
| 245 | + nearGps.setSignalState("truncation"); | |
| 246 | + | |
| 247 | + //记录信号状态 | |
| 248 | + SignalState signalState = SignalState.abnormalSignalSTate(sch, signalAbnormal); | |
| 249 | + signalStateData.put(signalState); | |
| 250 | + } | |
| 251 | +} | ... | ... |
src/main/java/com/bsth/data/gpsdata/arrival/utils/SignalSchPlanMatcher.java
0 → 100644
| 1 | +package com.bsth.data.gpsdata.arrival.utils; | |
| 2 | + | |
| 3 | +import com.bsth.data.gpsdata.GpsEntity; | |
| 4 | +import com.bsth.data.schedule.DayOfSchedule; | |
| 5 | +import com.bsth.entity.realcontrol.ScheduleRealInfo; | |
| 6 | +import org.springframework.beans.factory.annotation.Autowired; | |
| 7 | +import org.springframework.stereotype.Component; | |
| 8 | + | |
| 9 | +/** | |
| 10 | + * 班次匹配器 | |
| 11 | + * Created by panzhao on 2016/12/31. | |
| 12 | + */ | |
| 13 | +@Component | |
| 14 | +public class SignalSchPlanMatcher { | |
| 15 | + | |
| 16 | + @Autowired | |
| 17 | + DayOfSchedule dayOfSchedule; | |
| 18 | + | |
| 19 | + /** | |
| 20 | + * 发车信号匹配 | |
| 21 | + * @param outSigal | |
| 22 | + * @param sch | |
| 23 | + * @return | |
| 24 | + */ | |
| 25 | + public void outMatch(GpsEntity outSigal, ScheduleRealInfo sch){ | |
| 26 | + long t = outSigal.getTimestamp(); | |
| 27 | + if(t < sch.getDfsjT()) | |
| 28 | + return; | |
| 29 | + | |
| 30 | + //下一个相同走向的班次 | |
| 31 | + ScheduleRealInfo next = dayOfSchedule.nextSame(sch); | |
| 32 | + if(next == null || !next.getQdzCode().equals(sch.getQdzCode())) | |
| 33 | + return; | |
| 34 | + | |
| 35 | + //晚于班次间隔百分之70,跳下一个班次 | |
| 36 | + double s = (int) (next.getDfsjT() - sch.getDfsjT()); | |
| 37 | + double r = (int) (t - sch.getDfsjT()); | |
| 38 | + if(r / s > 0.7){ | |
| 39 | + dayOfSchedule.addExecPlan(next); | |
| 40 | + outMatch(outSigal, next); | |
| 41 | + } | |
| 42 | + } | |
| 43 | +} | ... | ... |
src/main/java/com/bsth/data/gpsdata/analyse/StationRouteComp.java renamed to src/main/java/com/bsth/data/gpsdata/arrival/utils/StationRouteComp.java
src/main/java/com/bsth/data/gpsdata/recovery/GpsDataRecovery.java
| ... | ... | @@ -2,13 +2,19 @@ package com.bsth.data.gpsdata.recovery; |
| 2 | 2 | |
| 3 | 3 | import com.bsth.data.BasicData; |
| 4 | 4 | import com.bsth.data.gpsdata.GpsEntity; |
| 5 | -import com.bsth.data.gpsdata.analyse.components.GpsArrival; | |
| 5 | +import com.bsth.data.gpsdata.arrival.GeoCacheData; | |
| 6 | +import com.bsth.data.gpsdata.arrival.handlers.*; | |
| 7 | +import com.bsth.data.gpsdata.arrival.utils.CircleQueue; | |
| 6 | 8 | import com.bsth.util.db.DBUtils_MS; |
| 7 | 9 | import com.google.common.collect.ArrayListMultimap; |
| 8 | 10 | import org.slf4j.Logger; |
| 9 | 11 | import org.slf4j.LoggerFactory; |
| 12 | +import org.springframework.beans.BeansException; | |
| 13 | +import org.springframework.context.ApplicationContext; | |
| 14 | +import org.springframework.context.ApplicationContextAware; | |
| 10 | 15 | import org.springframework.jdbc.core.JdbcTemplate; |
| 11 | 16 | import org.springframework.jdbc.core.RowMapper; |
| 17 | +import org.springframework.stereotype.Component; | |
| 12 | 18 | |
| 13 | 19 | import java.sql.ResultSet; |
| 14 | 20 | import java.sql.SQLException; |
| ... | ... | @@ -18,42 +24,50 @@ import java.util.concurrent.ExecutorService; |
| 18 | 24 | import java.util.concurrent.Executors; |
| 19 | 25 | |
| 20 | 26 | /** |
| 21 | - * 数据恢复 | |
| 27 | + * gps数据恢复 | |
| 22 | 28 | * Created by panzhao on 2016/12/24. |
| 23 | 29 | */ |
| 24 | -public class GpsDataRecovery { | |
| 30 | +@Component | |
| 31 | +public class GpsDataRecovery implements ApplicationContextAware { | |
| 25 | 32 | |
| 26 | 33 | static Logger logger = LoggerFactory.getLogger(GpsDataRecovery.class); |
| 27 | 34 | |
| 28 | 35 | public static boolean run; |
| 29 | 36 | |
| 30 | - static ExecutorService threadPool = Executors.newFixedThreadPool(50); | |
| 37 | + static ExecutorService threadPool = Executors.newFixedThreadPool(10); | |
| 31 | 38 | |
| 32 | - private static CountDownLatch count; | |
| 39 | + static OfflineSignalHandle offlineSignalHandle; | |
| 40 | + static CorrectSignalHandle correctSignalHandle; | |
| 41 | + static StationInsideHandle stationInsideHandle; | |
| 42 | + static InOutStationSignalHandle inOutStationSignalHandle; | |
| 43 | + static ReverseSignalHandle reverseSignalHandle; | |
| 33 | 44 | |
| 34 | - public static void recovery() { | |
| 45 | + public void recovery() { | |
| 35 | 46 | List<GpsEntity> list = loadData(); |
| 36 | 47 | |
| 37 | 48 | //按车辆分组数据 |
| 38 | 49 | ArrayListMultimap<String, GpsEntity> listMap = ArrayListMultimap.create(); |
| 39 | 50 | for (GpsEntity gps : list) { |
| 40 | - if(gps.getNbbm() != null) | |
| 51 | + if (gps.getNbbm() != null) | |
| 41 | 52 | listMap.put(gps.getNbbm(), gps); |
| 42 | 53 | } |
| 43 | 54 | |
| 44 | - count = new CountDownLatch(listMap.keySet().size()); | |
| 45 | 55 | |
| 46 | 56 | Set<String> keys = listMap.keySet(); |
| 57 | + | |
| 58 | + CountDownLatch count = new CountDownLatch(keys.size()); | |
| 59 | + GpsComp comp = new GpsComp(); | |
| 47 | 60 | for (String nbbm : keys) { |
| 48 | - threadPool.execute(new RecoveryDataThread(listMap.get(nbbm), count)); | |
| 49 | - /*if(nbbm.equals("W9H-003")) | |
| 50 | - new RecoveryDataThread(listMap.get(nbbm), count).run();*/ | |
| 61 | + Collections.sort(listMap.get(nbbm), comp); | |
| 62 | + threadPool.execute(new RecoveryThread(listMap.get(nbbm), count)); | |
| 63 | + /*if(nbbm.equals("YT-CD008")) | |
| 64 | + new RecoveryThread(listMap.get(nbbm), count).run();*/ | |
| 51 | 65 | } |
| 66 | + | |
| 52 | 67 | try { |
| 53 | - //等待子线程结束 | |
| 54 | 68 | count.await(); |
| 55 | - logger.info("GPS 数据恢复完成...."); | |
| 56 | 69 | run = false; |
| 70 | + logger.info("数据恢复完成...."); | |
| 57 | 71 | } catch (InterruptedException e) { |
| 58 | 72 | logger.error("", e); |
| 59 | 73 | } |
| ... | ... | @@ -64,7 +78,7 @@ public class GpsDataRecovery { |
| 64 | 78 | * |
| 65 | 79 | * @return |
| 66 | 80 | */ |
| 67 | - public static List<GpsEntity> loadData() { | |
| 81 | + public List<GpsEntity> loadData() { | |
| 68 | 82 | Calendar calendar = Calendar.getInstance(); |
| 69 | 83 | int dayOfYear = calendar.get(Calendar.DAY_OF_YEAR); |
| 70 | 84 | |
| ... | ... | @@ -103,12 +117,28 @@ public class GpsDataRecovery { |
| 103 | 117 | return (((serviceState & 0x10000000) == 0x10000000) ? 1 : 0); |
| 104 | 118 | } |
| 105 | 119 | |
| 106 | - public static class RecoveryDataThread implements Runnable { | |
| 120 | + @Override | |
| 121 | + public void setApplicationContext(ApplicationContext applicationContext) throws BeansException { | |
| 122 | + offlineSignalHandle = applicationContext.getBean(OfflineSignalHandle.class); | |
| 123 | + correctSignalHandle = applicationContext.getBean(CorrectSignalHandle.class); | |
| 124 | + stationInsideHandle = applicationContext.getBean(StationInsideHandle.class); | |
| 125 | + inOutStationSignalHandle = applicationContext.getBean(InOutStationSignalHandle.class); | |
| 126 | + reverseSignalHandle = applicationContext.getBean(ReverseSignalHandle.class); | |
| 127 | + } | |
| 128 | + | |
| 129 | + public static class GpsComp implements Comparator<GpsEntity> { | |
| 130 | + | |
| 131 | + @Override | |
| 132 | + public int compare(GpsEntity g1, GpsEntity g2) { | |
| 133 | + return g1.getTimestamp().compareTo(g2.getTimestamp()); | |
| 134 | + } | |
| 135 | + } | |
| 107 | 136 | |
| 137 | + public static class RecoveryThread implements Runnable { | |
| 108 | 138 | List<GpsEntity> list; |
| 109 | 139 | CountDownLatch count; |
| 110 | 140 | |
| 111 | - public RecoveryDataThread(List<GpsEntity> list, CountDownLatch count) { | |
| 141 | + RecoveryThread(List<GpsEntity> list, CountDownLatch count) { | |
| 112 | 142 | this.list = list; |
| 113 | 143 | this.count = count; |
| 114 | 144 | } |
| ... | ... | @@ -116,19 +146,26 @@ public class GpsDataRecovery { |
| 116 | 146 | @Override |
| 117 | 147 | public void run() { |
| 118 | 148 | try { |
| 119 | - //排序 | |
| 120 | - Collections.sort(list, new GpsComp()); | |
| 121 | - //依次跑完gps | |
| 122 | - //int i = 0; | |
| 123 | - for(GpsEntity gps : list){ | |
| 124 | - /* i++; | |
| 125 | - if(i == 4527){ | |
| 126 | - System.out.println("aaa"); | |
| 127 | - } | |
| 128 | - | |
| 129 | - if(gps.getTimestamp() == 1482726071000L) | |
| 130 | - System.out.println("bbb");*/ | |
| 131 | - GpsArrival.arrival(gps); | |
| 149 | + //循环gps恢复数据 | |
| 150 | + CircleQueue<GpsEntity> prevs; | |
| 151 | + | |
| 152 | + for (GpsEntity gps : list) { | |
| 153 | + | |
| 154 | + prevs = GeoCacheData.getGps(gps.getNbbm()); | |
| 155 | + //掉线处理 | |
| 156 | + offlineSignalHandle.handle(gps, prevs); | |
| 157 | + //状态处理 | |
| 158 | + if (!correctSignalHandle.handle(gps, prevs)) | |
| 159 | + continue; | |
| 160 | + //场,站内外判断 | |
| 161 | + stationInsideHandle.handle(gps, prevs); | |
| 162 | + //反向处理 | |
| 163 | + reverseSignalHandle.handle(gps, prevs); | |
| 164 | + //进出站动作处理 | |
| 165 | + inOutStationSignalHandle.handle(gps, prevs); | |
| 166 | + GeoCacheData.putGps(gps); | |
| 167 | + | |
| 168 | + //Thread.sleep(50); | |
| 132 | 169 | } |
| 133 | 170 | } catch (Exception e) { |
| 134 | 171 | logger.error("", e); |
| ... | ... | @@ -137,12 +174,4 @@ public class GpsDataRecovery { |
| 137 | 174 | } |
| 138 | 175 | } |
| 139 | 176 | } |
| 140 | - | |
| 141 | - public static class GpsComp implements Comparator<GpsEntity>{ | |
| 142 | - | |
| 143 | - @Override | |
| 144 | - public int compare(GpsEntity g1, GpsEntity g2) { | |
| 145 | - return (int) (g1.getTimestamp() - g2.getTimestamp()); | |
| 146 | - } | |
| 147 | - } | |
| 148 | 177 | } |
| 149 | 178 | \ No newline at end of file | ... | ... |
src/main/java/com/bsth/data/schedule/DayOfSchedule.java
| ... | ... | @@ -2,8 +2,6 @@ package com.bsth.data.schedule; |
| 2 | 2 | |
| 3 | 3 | import com.alibaba.fastjson.JSON; |
| 4 | 4 | import com.alibaba.fastjson.JSONArray; |
| 5 | -import com.bsth.Application; | |
| 6 | -import com.bsth.data.BasicData; | |
| 7 | 5 | import com.bsth.data.LineConfigData; |
| 8 | 6 | import com.bsth.data.directive.FirstScheduleCheckThread; |
| 9 | 7 | import com.bsth.data.gpsdata.GpsRealData; |
| ... | ... | @@ -29,12 +27,12 @@ import org.slf4j.Logger; |
| 29 | 27 | import org.slf4j.LoggerFactory; |
| 30 | 28 | import org.springframework.beans.factory.annotation.Autowired; |
| 31 | 29 | import org.springframework.boot.CommandLineRunner; |
| 30 | +import org.springframework.core.annotation.Order; | |
| 32 | 31 | import org.springframework.stereotype.Component; |
| 33 | 32 | |
| 34 | 33 | import java.text.ParseException; |
| 35 | 34 | import java.text.SimpleDateFormat; |
| 36 | 35 | import java.util.*; |
| 37 | -import java.util.concurrent.TimeUnit; | |
| 38 | 36 | |
| 39 | 37 | /** |
| 40 | 38 | * @author PanZhao |
| ... | ... | @@ -43,6 +41,7 @@ import java.util.concurrent.TimeUnit; |
| 43 | 41 | * @date 2016年8月15日 上午10:16:12 |
| 44 | 42 | */ |
| 45 | 43 | @Component |
| 44 | +@Order(value = 3) | |
| 46 | 45 | public class DayOfSchedule implements CommandLineRunner { |
| 47 | 46 | |
| 48 | 47 | Logger logger = LoggerFactory.getLogger(this.getClass()); |
| ... | ... | @@ -117,25 +116,23 @@ public class DayOfSchedule implements CommandLineRunner { |
| 117 | 116 | LineConfigData lineConfigs; |
| 118 | 117 | |
| 119 | 118 | @Autowired |
| 120 | - BasicData.BasicDataLoader dataLoader; | |
| 119 | + GpsDataRecovery gpsDataRecovery; | |
| 121 | 120 | |
| 122 | 121 | private static DateTimeFormatter fmtyyyyMMdd = DateTimeFormat.forPattern("yyyy-MM-dd"), fmtHHmm = DateTimeFormat.forPattern("HH:mm"); |
| 123 | 122 | |
| 124 | 123 | @Override |
| 125 | 124 | public void run(String... arg0) throws Exception { |
| 126 | - //加载基础数据 | |
| 127 | - dataLoader.loadAllData(); | |
| 128 | 125 | //从数据库恢复排班 |
| 129 | 126 | //dataRecovery(); |
| 130 | 127 | |
| 131 | 128 | //翻班线程 |
| 132 | - Application.mainServices.scheduleWithFixedDelay(scheduleRefreshThread, 15, 240, TimeUnit.SECONDS); | |
| 129 | +// Application.mainServices.scheduleWithFixedDelay(scheduleRefreshThread, 15, 240, TimeUnit.SECONDS); | |
| 133 | 130 | //入库 |
| 134 | - Application.mainServices.scheduleWithFixedDelay(schedulePstThread, 60, 60, TimeUnit.SECONDS); | |
| 131 | +// Application.mainServices.scheduleWithFixedDelay(schedulePstThread, 60, 60, TimeUnit.SECONDS); | |
| 135 | 132 | //首班出场指令补发器 |
| 136 | 133 | // Application.mainServices.scheduleWithFixedDelay(firstScheduleCheckThread, 30, 240, TimeUnit.SECONDS); |
| 137 | 134 | //班次误点扫描 |
| 138 | - Application.mainServices.scheduleWithFixedDelay(scheduleLateThread, 60, 60, TimeUnit.SECONDS); | |
| 135 | +// Application.mainServices.scheduleWithFixedDelay(scheduleLateThread, 60, 60, TimeUnit.SECONDS); | |
| 139 | 136 | |
| 140 | 137 | //每天凌晨2点20提交数据到运管处 |
| 141 | 138 | long diff = (DateUtils.getTimestamp() + 1000 * 60 * 140) - System.currentTimeMillis(); |
| ... | ... | @@ -160,7 +157,7 @@ public class DayOfSchedule implements CommandLineRunner { |
| 160 | 157 | } |
| 161 | 158 | |
| 162 | 159 | //恢复gps数据 |
| 163 | - GpsDataRecovery.recovery(); | |
| 160 | + gpsDataRecovery.recovery(); | |
| 164 | 161 | } |
| 165 | 162 | |
| 166 | 163 | public Map<String, String> getCurrSchDate() { |
| ... | ... | @@ -221,15 +218,8 @@ public class DayOfSchedule implements CommandLineRunner { |
| 221 | 218 | reCalcExecPlan(nbbm); |
| 222 | 219 | } |
| 223 | 220 | |
| 224 | - //是否是出站即出场 | |
| 225 | - LineConfig conf = lineConfigData.get(lineCode); | |
| 226 | - if (conf.getOutConfig() == 2) { | |
| 227 | - for (String nbbm : cars) | |
| 228 | - schAttrCalculator.connectOutSchedule(nbbmScheduleMap.get(nbbm)); | |
| 229 | - } | |
| 230 | - | |
| 231 | 221 | // 页面 翻班通知 |
| 232 | - sendUtils.shiftSchedule(lineCode); | |
| 222 | + //sendUtils.shiftSchedule(lineCode); | |
| 233 | 223 | } catch (Exception e) { |
| 234 | 224 | logger.error("", e); |
| 235 | 225 | return -1; |
| ... | ... | @@ -500,6 +490,41 @@ public class DayOfSchedule implements CommandLineRunner { |
| 500 | 490 | } |
| 501 | 491 | |
| 502 | 492 | /** |
| 493 | + * 下一个相同走向的班次 | |
| 494 | + * @param sch | |
| 495 | + * @return | |
| 496 | + */ | |
| 497 | + public ScheduleRealInfo nextSame(ScheduleRealInfo sch){ | |
| 498 | + List<ScheduleRealInfo> list = nbbmScheduleMap.get(sch.getClZbh()); | |
| 499 | + int outConfig = -1; | |
| 500 | + LineConfig config = lineConfigData.get(sch.getXlBm()); | |
| 501 | + if (config != null) | |
| 502 | + outConfig = config.getOutConfig(); | |
| 503 | + | |
| 504 | + boolean flag = false; | |
| 505 | + ScheduleRealInfo next = null; | |
| 506 | + for (ScheduleRealInfo temp : list) { | |
| 507 | + if (temp.getId() == sch.getId()) { | |
| 508 | + flag = true; | |
| 509 | + continue; | |
| 510 | + } | |
| 511 | + //忽略烂班 | |
| 512 | + if (temp.isDestroy()) | |
| 513 | + continue; | |
| 514 | + | |
| 515 | + //出站既出场,忽略出场班次 | |
| 516 | + if (outConfig == 2 && temp.getBcType().equals("out")) | |
| 517 | + continue; | |
| 518 | + | |
| 519 | + if (flag && temp.getXlDir().equals(sch.getXlDir())) { | |
| 520 | + next = temp; | |
| 521 | + break; | |
| 522 | + } | |
| 523 | + } | |
| 524 | + return next; | |
| 525 | + } | |
| 526 | + | |
| 527 | + /** | |
| 503 | 528 | * 上一个班次 |
| 504 | 529 | * |
| 505 | 530 | * @param sch |
| ... | ... | @@ -524,6 +549,18 @@ public class DayOfSchedule implements CommandLineRunner { |
| 524 | 549 | return prev; |
| 525 | 550 | } |
| 526 | 551 | |
| 552 | + /** | |
| 553 | + * 是否是首班出场 | |
| 554 | + * @param sch | |
| 555 | + * @return | |
| 556 | + */ | |
| 557 | + public boolean isFirstOut(ScheduleRealInfo sch){ | |
| 558 | + List<ScheduleRealInfo> list = nbbmScheduleMap.get(sch.getClZbh()); | |
| 559 | + if(list.get(0).equals(sch) && sch.getBcType().equals("out")) | |
| 560 | + return true; | |
| 561 | + return false; | |
| 562 | + } | |
| 563 | + | |
| 527 | 564 | public void put(ScheduleRealInfo sch) { |
| 528 | 565 | schAttrCalculator |
| 529 | 566 | .calcRealDate(sch) |
| ... | ... | @@ -706,7 +743,8 @@ public class DayOfSchedule implements CommandLineRunner { |
| 706 | 743 | } |
| 707 | 744 | |
| 708 | 745 | public void addExecPlan(ScheduleRealInfo sch) { |
| 709 | - carExecutePlanMap.put(sch.getClZbh(), sch); | |
| 746 | + if(sch != null) | |
| 747 | + carExecutePlanMap.put(sch.getClZbh(), sch); | |
| 710 | 748 | } |
| 711 | 749 | |
| 712 | 750 | public void removeExecPlan(String clzbh) { |
| ... | ... | @@ -723,7 +761,7 @@ public class DayOfSchedule implements CommandLineRunner { |
| 723 | 761 | * @param nbbm |
| 724 | 762 | * @return |
| 725 | 763 | */ |
| 726 | - public static ScheduleRealInfo executeCurr(String nbbm) { | |
| 764 | + public ScheduleRealInfo executeCurr(String nbbm) { | |
| 727 | 765 | return carExecutePlanMap.get(nbbm); |
| 728 | 766 | } |
| 729 | 767 | |
| ... | ... | @@ -763,6 +801,41 @@ public class DayOfSchedule implements CommandLineRunner { |
| 763 | 801 | } |
| 764 | 802 | |
| 765 | 803 | /** |
| 804 | + * 是否在执行首班出场 | |
| 805 | + * @param nbbm | |
| 806 | + * @return | |
| 807 | + */ | |
| 808 | + public boolean isExecFirstOut(String nbbm, long time){ | |
| 809 | + try { | |
| 810 | + List<ScheduleRealInfo> list = nbbmScheduleMap.get(nbbm); | |
| 811 | + ScheduleRealInfo second = list.get(2), | |
| 812 | + first = executeCurr(nbbm); | |
| 813 | + | |
| 814 | + if(first.getBcType().equals("out") | |
| 815 | + && first.getDfsjT() < second.getDfsjT() | |
| 816 | + && doneSum(nbbm) == 0 && second.getDfsjT() > time) | |
| 817 | + return true; | |
| 818 | + } catch (Exception e) { | |
| 819 | + logger.error("", e); | |
| 820 | + } | |
| 821 | + | |
| 822 | + return false; | |
| 823 | + } | |
| 824 | + | |
| 825 | + /** | |
| 826 | + * 获取班次的计划停站时间 | |
| 827 | + * @param sch | |
| 828 | + * @return | |
| 829 | + | |
| 830 | + public int stopTimePlan(Object task) { | |
| 831 | + | |
| 832 | + ScheduleRealInfo sch = prev((ScheduleRealInfo) task); | |
| 833 | + | |
| 834 | + sch.getzdsj | |
| 835 | + return -1; | |
| 836 | + }*/ | |
| 837 | + | |
| 838 | + /** | |
| 766 | 839 | * |
| 767 | 840 | * @Title: linkToSchPlan |
| 768 | 841 | * @Description: TODO(车辆关联到班次) | ... | ... |
src/main/java/com/bsth/data/schedule/SchAttrCalculator.java
| ... | ... | @@ -62,13 +62,13 @@ public class SchAttrCalculator { |
| 62 | 62 | sch.setDfsjAll(fmtyyyyMMddHHmm.parseMillis(sch.getScheduleDateStr()+sch.getDfsj())); |
| 63 | 63 | |
| 64 | 64 | //實發時間 |
| 65 | - if(sch.getFcsjActual() != null && | |
| 65 | + if(StringUtils.isNotEmpty(sch.getFcsjActual()) && | |
| 66 | 66 | sch.getFcsjActual().compareTo(conf.getStartOpt()) < 0){ |
| 67 | 67 | sch.setFcsjActualAll(fmtyyyyMMddHHmm.parseMillis(sch.getScheduleDateStr()+sch.getFcsjActual()) + DAY_TIME); |
| 68 | 68 | } |
| 69 | 69 | |
| 70 | 70 | //實際終點時間 |
| 71 | - if(sch.getZdsjActual() != null && | |
| 71 | + if(StringUtils.isNotEmpty(sch.getZdsjActual()) && | |
| 72 | 72 | sch.getZdsjActual().compareTo(conf.getStartOpt()) < 0){ |
| 73 | 73 | sch.setZdsjActualAll(fmtyyyyMMddHHmm.parseMillis(sch.getScheduleDateStr()+sch.getZdsjActual()) + DAY_TIME); |
| 74 | 74 | } |
| ... | ... | @@ -162,34 +162,6 @@ public class SchAttrCalculator { |
| 162 | 162 | |
| 163 | 163 | return updateList; |
| 164 | 164 | } |
| 165 | - | |
| 166 | - /** | |
| 167 | - * | |
| 168 | - * @Title: connectOutSchedule | |
| 169 | - * @Description: TODO(关联出场班次) | |
| 170 | - */ | |
| 171 | - public void connectOutSchedule(List<ScheduleRealInfo> list){ | |
| 172 | - Collections.sort(list, new ScheduleComparator.FCSJ()); | |
| 173 | - | |
| 174 | - int len = list.size(); | |
| 175 | - if(len == 0) | |
| 176 | - return; | |
| 177 | - | |
| 178 | - ScheduleRealInfo prve = list.get(0), curr; | |
| 179 | - for(int i = 1; i < len; i ++){ | |
| 180 | - curr = list.get(i); | |
| 181 | - | |
| 182 | - //出站即出场关联 | |
| 183 | - if(prve.getBcType().equals("out") && prve.getJhlc() == null) | |
| 184 | - curr.setTwinsSch(prve); | |
| 185 | - | |
| 186 | - //进站即进场关联 | |
| 187 | - if(curr.getBcType().equals("in") && curr.getJhlc() == null) | |
| 188 | - prve.setTwinsSch(curr); | |
| 189 | - | |
| 190 | - prve = curr; | |
| 191 | - } | |
| 192 | - } | |
| 193 | 165 | |
| 194 | 166 | public SchAttrCalculator calcFcsjTime(ScheduleRealInfo sch) throws ParseException { |
| 195 | 167 | sch.setFcsjT(fmtyyyyMMddHHmm.parseMillis(sch.getRealExecDate() + sch.getFcsj())); | ... | ... |
src/main/java/com/bsth/entity/Cars.java
| ... | ... | @@ -23,7 +23,7 @@ import java.util.Date; |
| 23 | 23 | |
| 24 | 24 | @Entity |
| 25 | 25 | @Table(name = "bsth_c_cars") |
| 26 | -@JsonIgnoreProperties(value={"hibernateLazyInitializer","handler","fieldHandler"}) | |
| 26 | +@JsonIgnoreProperties(value={"hibernateLazyInitializer","handlers","fieldHandler"}) | |
| 27 | 27 | public class Cars extends BEntity implements Serializable { |
| 28 | 28 | |
| 29 | 29 | /** 主键Id */ | ... | ... |
src/main/java/com/bsth/entity/Line.java
| ... | ... | @@ -24,7 +24,7 @@ import java.util.Date; |
| 24 | 24 | |
| 25 | 25 | @Entity |
| 26 | 26 | @Table(name = "bsth_c_line") |
| 27 | -@JsonIgnoreProperties(value={"hibernateLazyInitializer","handler","fieldHandler"}) | |
| 27 | +@JsonIgnoreProperties(value={"hibernateLazyInitializer","handlers","fieldHandler"}) | |
| 28 | 28 | public class Line implements Serializable { |
| 29 | 29 | |
| 30 | 30 | @Id | ... | ... |
src/main/java/com/bsth/entity/Personnel.java
| ... | ... | @@ -21,7 +21,7 @@ import javax.persistence.*; |
| 21 | 21 | |
| 22 | 22 | @Entity |
| 23 | 23 | @Table(name = "bsth_c_personnel") |
| 24 | -@JsonIgnoreProperties(value={"hibernateLazyInitializer","handler","fieldHandler"}) | |
| 24 | +@JsonIgnoreProperties(value={"hibernateLazyInitializer","handlers","fieldHandler"}) | |
| 25 | 25 | public class Personnel extends BEntity { |
| 26 | 26 | |
| 27 | 27 | /** 主键Id */ | ... | ... |
src/main/java/com/bsth/entity/mcy_forms/Daily.java
0 → 100644
| 1 | +package com.bsth.entity.mcy_forms; | |
| 2 | + | |
| 3 | +public class Daily { | |
| 4 | + | |
| 5 | + private String rq;//日期 | |
| 6 | + | |
| 7 | + public String getRq() { | |
| 8 | + return rq; | |
| 9 | + } | |
| 10 | + | |
| 11 | + public void setRq(String rq) { | |
| 12 | + this.rq = rq; | |
| 13 | + } | |
| 14 | + | |
| 15 | + private String zbh;//车牌号 | |
| 16 | + | |
| 17 | + private String jgh;//员工号 | |
| 18 | + | |
| 19 | + private String jName;//驾驶员 | |
| 20 | + | |
| 21 | + private String zlc;//里程 | |
| 22 | + | |
| 23 | + private String jzl1;//空驶公里 | |
| 24 | + | |
| 25 | + private String yh;//油耗 | |
| 26 | + | |
| 27 | + private String bc;//班次 | |
| 28 | + | |
| 29 | + public String getZbh() { | |
| 30 | + return zbh; | |
| 31 | + } | |
| 32 | + | |
| 33 | + public void setZbh(String zbh) { | |
| 34 | + this.zbh = zbh; | |
| 35 | + } | |
| 36 | + | |
| 37 | + public String getJgh() { | |
| 38 | + return jgh; | |
| 39 | + } | |
| 40 | + | |
| 41 | + public void setJgh(String jgh) { | |
| 42 | + this.jgh = jgh; | |
| 43 | + } | |
| 44 | + | |
| 45 | + public String getjName() { | |
| 46 | + return jName; | |
| 47 | + } | |
| 48 | + | |
| 49 | + public void setjName(String jName) { | |
| 50 | + this.jName = jName; | |
| 51 | + } | |
| 52 | + | |
| 53 | + public String getZlc() { | |
| 54 | + return zlc; | |
| 55 | + } | |
| 56 | + | |
| 57 | + public void setZlc(String zlc) { | |
| 58 | + this.zlc = zlc; | |
| 59 | + } | |
| 60 | + | |
| 61 | + public String getJzl1() { | |
| 62 | + return jzl1; | |
| 63 | + } | |
| 64 | + | |
| 65 | + public void setJzl1(String jzl1) { | |
| 66 | + this.jzl1 = jzl1; | |
| 67 | + } | |
| 68 | + | |
| 69 | + public String getYh() { | |
| 70 | + return yh; | |
| 71 | + } | |
| 72 | + | |
| 73 | + public void setYh(String yh) { | |
| 74 | + this.yh = yh; | |
| 75 | + } | |
| 76 | + | |
| 77 | + public String getBc() { | |
| 78 | + return bc; | |
| 79 | + } | |
| 80 | + | |
| 81 | + public void setBc(String bc) { | |
| 82 | + this.bc = bc; | |
| 83 | + } | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | +} | ... | ... |
src/main/java/com/bsth/entity/realcontrol/LineConfig.java
| ... | ... | @@ -53,6 +53,9 @@ public class LineConfig { |
| 53 | 53 | /** 调度指令模板 */ |
| 54 | 54 | private String schDirectiveTemp; |
| 55 | 55 | |
| 56 | + /** 识别区间调头 */ | |
| 57 | + private boolean readReverse; | |
| 58 | + | |
| 56 | 59 | @OneToMany(cascade = CascadeType.ALL) |
| 57 | 60 | private Set<D80ReplyTemp> d80Temps = new HashSet<>(); |
| 58 | 61 | |
| ... | ... | @@ -140,4 +143,12 @@ public class LineConfig { |
| 140 | 143 | public void setD80Temps(Set<D80ReplyTemp> d80Temps) { |
| 141 | 144 | this.d80Temps = d80Temps; |
| 142 | 145 | } |
| 146 | + | |
| 147 | + public boolean isReadReverse() { | |
| 148 | + return readReverse; | |
| 149 | + } | |
| 150 | + | |
| 151 | + public void setReadReverse(boolean readReverse) { | |
| 152 | + this.readReverse = readReverse; | |
| 153 | + } | |
| 143 | 154 | } | ... | ... |
src/main/java/com/bsth/entity/realcontrol/ScheduleRealInfo.java
| ... | ... | @@ -94,11 +94,6 @@ public class ScheduleRealInfo { |
| 94 | 94 | * 班次类型 TODO:正常班次、出场、进场、加油、区间班次、放空班次、放大站班次、两点间空驶 |
| 95 | 95 | */ |
| 96 | 96 | private String bcType; |
| 97 | - | |
| 98 | - /** 出站即出场 , 关联的进出场班次 */ | |
| 99 | - @JsonIgnore | |
| 100 | - @Transient | |
| 101 | - private ScheduleRealInfo twinsSch; | |
| 102 | 97 | |
| 103 | 98 | /** 创建人 */ |
| 104 | 99 | @JsonIgnore |
| ... | ... | @@ -258,21 +253,6 @@ public class ScheduleRealInfo { |
| 258 | 253 | this.ccno = ccno; |
| 259 | 254 | } |
| 260 | 255 | |
| 261 | - public static DateTimeFormatter getFmtHHmm() { | |
| 262 | - return fmtHHmm; | |
| 263 | - } | |
| 264 | - | |
| 265 | - public static void setFmtHHmm(DateTimeFormatter fmtHHmm) { | |
| 266 | - ScheduleRealInfo.fmtHHmm = fmtHHmm; | |
| 267 | - } | |
| 268 | - | |
| 269 | - public static DateTimeFormatter getFmtyyyyMMddHHmm() { | |
| 270 | - return fmtyyyyMMddHHmm; | |
| 271 | - } | |
| 272 | - | |
| 273 | - public static void setFmtyyyyMMddHHmm(DateTimeFormatter fmtyyyyMMddHHmm) { | |
| 274 | - ScheduleRealInfo.fmtyyyyMMddHHmm = fmtyyyyMMddHHmm; | |
| 275 | - } | |
| 276 | 256 | |
| 277 | 257 | /** ---------------- |
| 278 | 258 | @OneToOne(fetch = FetchType.LAZY, cascade = CascadeType.ALL) |
| ... | ... | @@ -804,13 +784,13 @@ public class ScheduleRealInfo { |
| 804 | 784 | this.opDirectiveState = opDirectiveState; |
| 805 | 785 | } |
| 806 | 786 | |
| 807 | - public ScheduleRealInfo getTwinsSch() { | |
| 787 | +/* public ScheduleRealInfo getTwinsSch() { | |
| 808 | 788 | return twinsSch; |
| 809 | 789 | } |
| 810 | 790 | |
| 811 | 791 | public void setTwinsSch(ScheduleRealInfo twinsSch) { |
| 812 | 792 | this.twinsSch = twinsSch; |
| 813 | - } | |
| 793 | + }*/ | |
| 814 | 794 | |
| 815 | 795 | public boolean isLate() { |
| 816 | 796 | return late; | ... | ... |
src/main/java/com/bsth/entity/schedule/CarConfigInfo.java
| ... | ... | @@ -19,7 +19,7 @@ import java.util.Date; |
| 19 | 19 | @NamedAttributeNode("cl") |
| 20 | 20 | }) |
| 21 | 21 | }) |
| 22 | -@JsonIgnoreProperties(value={"hibernateLazyInitializer","handler","fieldHandler"}) | |
| 22 | +@JsonIgnoreProperties(value={"hibernateLazyInitializer","handlers","fieldHandler"}) | |
| 23 | 23 | public class CarConfigInfo extends BEntity implements Serializable { |
| 24 | 24 | |
| 25 | 25 | /** 主健Id */ | ... | ... |
src/main/java/com/bsth/entity/schedule/EmployeeConfigInfo.java
| ... | ... | @@ -22,7 +22,7 @@ import java.io.Serializable; |
| 22 | 22 | @NamedAttributeNode("xl") |
| 23 | 23 | }) |
| 24 | 24 | }) |
| 25 | -@JsonIgnoreProperties(value={"hibernateLazyInitializer","handler","fieldHandler"}) | |
| 25 | +@JsonIgnoreProperties(value={"hibernateLazyInitializer","handlers","fieldHandler"}) | |
| 26 | 26 | public class EmployeeConfigInfo extends BEntity implements Serializable { |
| 27 | 27 | |
| 28 | 28 | /** 主键Id */ | ... | ... |
src/main/java/com/bsth/entity/schedule/GuideboardInfo.java
| ... | ... | @@ -15,7 +15,7 @@ import javax.persistence.*; |
| 15 | 15 | @NamedAttributeNode("xl") |
| 16 | 16 | }) |
| 17 | 17 | }) |
| 18 | -@JsonIgnoreProperties(value={"hibernateLazyInitializer","handler","fieldHandler"}) | |
| 18 | +@JsonIgnoreProperties(value={"hibernateLazyInitializer","handlers","fieldHandler"}) | |
| 19 | 19 | public class GuideboardInfo extends BEntity { |
| 20 | 20 | |
| 21 | 21 | /** 主键Id */ | ... | ... |
src/main/java/com/bsth/entity/sys/SysUser.java
| ... | ... | @@ -9,7 +9,7 @@ import java.util.Set; |
| 9 | 9 | |
| 10 | 10 | @Entity |
| 11 | 11 | @Table(name = "bsth_c_sys_user") |
| 12 | -@JsonIgnoreProperties(value={"hibernateLazyInitializer","handler","fieldHandler"}) | |
| 12 | +@JsonIgnoreProperties(value={"hibernateLazyInitializer","handlers","fieldHandler"}) | |
| 13 | 13 | public class SysUser { |
| 14 | 14 | |
| 15 | 15 | @Id | ... | ... |
src/main/java/com/bsth/repository/realcontrol/ScheduleRealInfoRepository.java
| ... | ... | @@ -71,7 +71,7 @@ public interface ScheduleRealInfoRepository extends BaseRepository<ScheduleRealI |
| 71 | 71 | @Query(value="select count(jName) from ScheduleRealInfo s where s.jName = ?1 and s.clZbh = ?2 and s.lpName = ?3 and sflj != 0") |
| 72 | 72 | int findLjbc(String jName,String clZbh,String lpName); |
| 73 | 73 | |
| 74 | - @Query(value="SELECT c.company,r.request_code,FROM_UNIXTIME(r.timestamp/1000,'%Y-%m-%d %T') FROM bsth_v_report_80 r LEFT JOIN bsth_c_cars c ON c.equipment_code = r.device_id where FROM_UNIXTIME(r.timestamp/1000,'%Y-%m-%d') = ?2 and r.line_id = ?1 and c.inside_code = ?3",nativeQuery=true) | |
| 74 | + @Query(value="SELECT c.company,r.request_code,FROM_UNIXTIME(r.timestamp/1000,'%Y-%m-%d %T'),c.inside_code FROM bsth_v_report_80 r LEFT JOIN bsth_c_cars c ON c.equipment_code = r.device_id where FROM_UNIXTIME(r.timestamp/1000,'%Y-%m-%d') = ?2 and r.line_id like %?1% and c.inside_code like %?3%",nativeQuery=true) | |
| 75 | 75 | List<Object[]> account(String line,String date,String code); |
| 76 | 76 | |
| 77 | 77 | @Query(value="select s from ScheduleRealInfo s where s.xlBm = ?1 and s.scheduleDate >= str_to_date(?2,'%Y-%m-%d') " |
| ... | ... | @@ -125,4 +125,4 @@ public interface ScheduleRealInfoRepository extends BaseRepository<ScheduleRealI |
| 125 | 125 | @Query(value="select new map(xlBm as xlBm) from ScheduleRealInfo s where DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') = ?1 GROUP BY xlBm ORDER BY xlBm") |
| 126 | 126 | List<Map<String,Object>> setDDRBGroup(String date); |
| 127 | 127 | |
| 128 | -} | |
| 128 | +} | |
| 129 | 129 | \ No newline at end of file | ... | ... |
src/main/java/com/bsth/service/excep/impl/OfflineServiceImpl.java
| ... | ... | @@ -46,23 +46,33 @@ public class OfflineServiceImpl implements OfflineService { |
| 46 | 46 | Object line=map.get("line"); |
| 47 | 47 | Object nbbm=map.get("nbbm"); |
| 48 | 48 | Object updown=map.get("updown"); |
| 49 | - | |
| 49 | + Object date=map.get("date"); | |
| 50 | 50 | |
| 51 | 51 | if(line!=null){ |
| 52 | - if(line.toString()!="") | |
| 53 | - sql +=" and line="+line; | |
| 52 | + sql +=" and line like'%"+line.toString()+"%'"; | |
| 54 | 53 | } |
| 55 | 54 | |
| 56 | 55 | if(nbbm!=null){ |
| 57 | - if(nbbm.toString()!="") | |
| 58 | - sql +=" and vehicle like '%"+nbbm+"%'"; | |
| 56 | + sql +=" and vehicle like '%"+nbbm.toString()+"%'"; | |
| 59 | 57 | } |
| 60 | 58 | |
| 61 | 59 | if(updown!=null){ |
| 62 | - if(updown.toString() !="") | |
| 63 | - sql +="and up_down ="+updown; | |
| 60 | + sql +="and up_down like '%"+updown.toString()+"%'"; | |
| 61 | + } | |
| 62 | + if(date!=null){ | |
| 63 | + if (date.toString().length()>0) { | |
| 64 | + SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:MM:SS"); | |
| 65 | + try { | |
| 66 | + Long t1=sdf.parse(date.toString()+" 00:00:00").getTime(); | |
| 67 | + Long t2=sdf.parse(date.toString()+" 23:59:59").getTime(); | |
| 68 | + sql += " and timestamp >="+t1 +" and timestamp <="+t2; | |
| 69 | + } catch (ParseException e) { | |
| 70 | + // TODO Auto-generated catch block | |
| 71 | + e.printStackTrace(); | |
| 72 | + } | |
| 73 | + } | |
| 74 | + | |
| 64 | 75 | } |
| 65 | - | |
| 66 | 76 | sql +=" order by id limit ?,?"; |
| 67 | 77 | |
| 68 | 78 | try { |
| ... | ... | @@ -118,19 +128,32 @@ public class OfflineServiceImpl implements OfflineService { |
| 118 | 128 | Object nbbm=map.get("nbbm"); |
| 119 | 129 | Object updown=map.get("updown"); |
| 120 | 130 | |
| 131 | + Object date=map.get("date"); | |
| 132 | + | |
| 121 | 133 | if(line!=null){ |
| 122 | - if(line.toString()!="") | |
| 123 | - sql +=" and line="+line; | |
| 134 | + sql +=" and line like'%"+line.toString()+"%'"; | |
| 124 | 135 | } |
| 125 | 136 | |
| 126 | 137 | if(nbbm!=null){ |
| 127 | - if(nbbm.toString()!="") | |
| 128 | - sql +=" and vehicle like '%"+nbbm+"%'"; | |
| 138 | + sql +=" and vehicle like '%"+nbbm.toString()+"%'"; | |
| 129 | 139 | } |
| 130 | 140 | |
| 131 | 141 | if(updown!=null){ |
| 132 | - if(updown.toString() !="") | |
| 133 | - sql +="and up_down ="+updown; | |
| 142 | + sql +="and up_down like '%"+updown.toString()+"%'"; | |
| 143 | + } | |
| 144 | + if(date!=null){ | |
| 145 | + if (date.toString().length()>0) { | |
| 146 | + SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:MM:SS"); | |
| 147 | + try { | |
| 148 | + Long t1=sdf.parse(date.toString()+" 00:00:00").getTime(); | |
| 149 | + Long t2=sdf.parse(date.toString()+" 23:59:59").getTime(); | |
| 150 | + sql += " and timestamp >="+t1 +" and timestamp <="+t2; | |
| 151 | + } catch (ParseException e) { | |
| 152 | + // TODO Auto-generated catch block | |
| 153 | + e.printStackTrace(); | |
| 154 | + } | |
| 155 | + } | |
| 156 | + | |
| 134 | 157 | } |
| 135 | 158 | |
| 136 | 159 | Connection conn = null; | ... | ... |
src/main/java/com/bsth/service/excep/impl/OutboundServiceImpl.java
| ... | ... | @@ -36,23 +36,33 @@ public class OutboundServiceImpl implements OutboundService{ |
| 36 | 36 | Object line=map.get("line"); |
| 37 | 37 | Object nbbm=map.get("nbbm"); |
| 38 | 38 | Object updown=map.get("updown"); |
| 39 | + Object date=map.get("date"); | |
| 39 | 40 | |
| 40 | - | |
| 41 | 41 | if(line!=null){ |
| 42 | - if(line.toString()!="") | |
| 43 | - sql +=" and line="+line; | |
| 42 | + sql +=" and line like'%"+line.toString()+"%'"; | |
| 44 | 43 | } |
| 45 | 44 | |
| 46 | 45 | if(nbbm!=null){ |
| 47 | - if(nbbm.toString()!="") | |
| 48 | - sql +=" and vehicle like '%"+nbbm+"%'"; | |
| 46 | + sql +=" and vehicle like '%"+nbbm.toString()+"%'"; | |
| 49 | 47 | } |
| 50 | 48 | |
| 51 | 49 | if(updown!=null){ |
| 52 | - if(updown.toString() !="") | |
| 53 | - sql +="and up_down ="+updown; | |
| 50 | + sql +="and up_down like '%"+updown.toString()+"%'"; | |
| 51 | + } | |
| 52 | + if(date!=null){ | |
| 53 | + if (date.toString().length()>0) { | |
| 54 | + SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:MM:SS"); | |
| 55 | + try { | |
| 56 | + Long t1=sdf.parse(date.toString()+" 00:00:00").getTime(); | |
| 57 | + Long t2=sdf.parse(date.toString()+" 23:59:59").getTime(); | |
| 58 | + sql += " and timestamp >="+t1 +" and timestamp <="+t2; | |
| 59 | + } catch (ParseException e) { | |
| 60 | + // TODO Auto-generated catch block | |
| 61 | + e.printStackTrace(); | |
| 62 | + } | |
| 63 | + } | |
| 64 | + | |
| 54 | 65 | } |
| 55 | - | |
| 56 | 66 | sql +=" order by id limit ?,?"; |
| 57 | 67 | |
| 58 | 68 | |
| ... | ... | @@ -102,20 +112,32 @@ public class OutboundServiceImpl implements OutboundService{ |
| 102 | 112 | Object line=map.get("line"); |
| 103 | 113 | Object nbbm=map.get("nbbm"); |
| 104 | 114 | Object updown=map.get("updown"); |
| 105 | - | |
| 115 | + Object date=map.get("date"); | |
| 106 | 116 | if(line!=null){ |
| 107 | - if(line.toString()!="") | |
| 108 | - sql +=" and line="+line; | |
| 117 | + sql +=" and line like '%"+line.toString()+"%'"; | |
| 118 | + | |
| 109 | 119 | } |
| 110 | 120 | |
| 111 | 121 | if(nbbm!=null){ |
| 112 | - if(nbbm.toString()!="") | |
| 113 | - sql +=" and vehicle like '%"+nbbm+"%'"; | |
| 122 | + sql +=" and vehicle like '%"+nbbm.toString()+"%'"; | |
| 114 | 123 | } |
| 115 | 124 | |
| 116 | 125 | if(updown!=null){ |
| 117 | - if(updown.toString() !="") | |
| 118 | - sql +="and up_down ="+updown; | |
| 126 | + sql +=" and up_down like '%"+updown.toString()+"%'"; | |
| 127 | + } | |
| 128 | + if(date!=null){ | |
| 129 | + if (date.toString().length()>0) { | |
| 130 | + SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); | |
| 131 | + try { | |
| 132 | + Long t1=sdf.parse(date.toString()+" 00:00:00").getTime(); | |
| 133 | + Long t2=sdf.parse(date.toString()+" 23:59:59").getTime(); | |
| 134 | + sql += " and timestamp >="+t1 +" and timestamp <="+t2; | |
| 135 | + } catch (ParseException e) { | |
| 136 | + // TODO Auto-generated catch block | |
| 137 | + e.printStackTrace(); | |
| 138 | + } | |
| 139 | + } | |
| 140 | + | |
| 119 | 141 | } |
| 120 | 142 | Connection conn = null; |
| 121 | 143 | PreparedStatement ps = null; |
| ... | ... | @@ -214,7 +236,7 @@ public class OutboundServiceImpl implements OutboundService{ |
| 214 | 236 | times=sdf.format(new Date()); |
| 215 | 237 | } |
| 216 | 238 | SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| 217 | - String times1=times+" 00:00:01"; | |
| 239 | + String times1=times+" 00:00:00"; | |
| 218 | 240 | String times2=times+" 23:59:59"; |
| 219 | 241 | |
| 220 | 242 | Connection conn = null; | ... | ... |
src/main/java/com/bsth/service/excep/impl/SpeedingServiceImpl.java
| ... | ... | @@ -38,22 +38,34 @@ public class SpeedingServiceImpl implements SpeedingService { |
| 38 | 38 | Object line=map.get("line"); |
| 39 | 39 | Object nbbm=map.get("nbbm"); |
| 40 | 40 | Object updown=map.get("updown"); |
| 41 | - | |
| 41 | + Object date=map.get("date"); | |
| 42 | 42 | |
| 43 | 43 | if(line!=null){ |
| 44 | - if(line.toString()!="") | |
| 45 | - sql +=" and line="+line; | |
| 44 | + sql +=" and line like'%"+line.toString()+"%'"; | |
| 46 | 45 | } |
| 47 | 46 | |
| 48 | 47 | if(nbbm!=null){ |
| 49 | - if(nbbm.toString()!="") | |
| 50 | - sql +=" and vehicle like '%"+nbbm+"%'"; | |
| 48 | + sql +=" and vehicle like '%"+nbbm.toString()+"%'"; | |
| 51 | 49 | } |
| 52 | 50 | |
| 53 | 51 | if(updown!=null){ |
| 54 | - if(updown.toString() !="") | |
| 55 | - sql +="and up_down ="+updown; | |
| 52 | + sql +="and up_down like '%"+updown.toString()+"%'"; | |
| 53 | + } | |
| 54 | + if(date!=null){ | |
| 55 | + if (date.toString().length()>0) { | |
| 56 | + SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:MM:SS"); | |
| 57 | + try { | |
| 58 | + Long t1=sdf.parse(date.toString()+" 00:00:00").getTime(); | |
| 59 | + Long t2=sdf.parse(date.toString()+" 23:59:59").getTime(); | |
| 60 | + sql += " and timestamp >="+t1 +" and timestamp <="+t2; | |
| 61 | + } catch (ParseException e) { | |
| 62 | + // TODO Auto-generated catch block | |
| 63 | + e.printStackTrace(); | |
| 64 | + } | |
| 65 | + } | |
| 66 | + | |
| 56 | 67 | } |
| 68 | + | |
| 57 | 69 | |
| 58 | 70 | sql +=" order by id limit ?,?"; |
| 59 | 71 | |
| ... | ... | @@ -103,19 +115,32 @@ public class SpeedingServiceImpl implements SpeedingService { |
| 103 | 115 | Object nbbm=map.get("nbbm"); |
| 104 | 116 | Object updown=map.get("updown"); |
| 105 | 117 | |
| 118 | + Object date=map.get("date"); | |
| 119 | + | |
| 106 | 120 | if(line!=null){ |
| 107 | - if(line.toString()!="") | |
| 108 | - sql +=" and line="+line; | |
| 121 | + sql +=" and line like'%"+line.toString()+"%'"; | |
| 109 | 122 | } |
| 110 | 123 | |
| 111 | 124 | if(nbbm!=null){ |
| 112 | - if(nbbm.toString()!="") | |
| 113 | - sql +=" and vehicle like '%"+nbbm+"%'"; | |
| 125 | + sql +=" and vehicle like '%"+nbbm.toString()+"%'"; | |
| 114 | 126 | } |
| 115 | 127 | |
| 116 | 128 | if(updown!=null){ |
| 117 | - if(updown.toString() !="") | |
| 118 | - sql +="and up_down ="+updown; | |
| 129 | + sql +="and up_down like '%"+updown.toString()+"%'"; | |
| 130 | + } | |
| 131 | + if(date!=null){ | |
| 132 | + if (date.toString().length()>0) { | |
| 133 | + SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:MM:SS"); | |
| 134 | + try { | |
| 135 | + Long t1=sdf.parse(date.toString()+" 00:00:00").getTime(); | |
| 136 | + Long t2=sdf.parse(date.toString()+" 23:59:59").getTime(); | |
| 137 | + sql += " and timestamp >="+t1 +" and timestamp <="+t2; | |
| 138 | + } catch (ParseException e) { | |
| 139 | + // TODO Auto-generated catch block | |
| 140 | + e.printStackTrace(); | |
| 141 | + } | |
| 142 | + } | |
| 143 | + | |
| 119 | 144 | } |
| 120 | 145 | Connection conn = null; |
| 121 | 146 | PreparedStatement ps = null; | ... | ... |
src/main/java/com/bsth/service/forms/ExportService.java
| ... | ... | @@ -2,6 +2,7 @@ package com.bsth.service.forms; |
| 2 | 2 | |
| 3 | 3 | import java.util.List; |
| 4 | 4 | |
| 5 | +import com.bsth.entity.mcy_forms.Daily; | |
| 5 | 6 | import com.bsth.entity.mcy_forms.Linepasswengerflow; |
| 6 | 7 | import com.bsth.entity.mcy_forms.Operationservice; |
| 7 | 8 | import com.bsth.entity.mcy_forms.Shifday; |
| ... | ... | @@ -28,6 +29,6 @@ public interface ExportService { |
| 28 | 29 | public void operationservice(String startDate, String endDate, String lpName, |
| 29 | 30 | List<Operationservice> resList); |
| 30 | 31 | |
| 31 | - | |
| 32 | + | |
| 32 | 33 | |
| 33 | 34 | } | ... | ... |
src/main/java/com/bsth/service/forms/FormsService.java
| ... | ... | @@ -5,6 +5,7 @@ import java.util.Map; |
| 5 | 5 | |
| 6 | 6 | import com.bsth.entity.mcy_forms.Allline; |
| 7 | 7 | import com.bsth.entity.mcy_forms.Changetochange; |
| 8 | +import com.bsth.entity.mcy_forms.Daily; | |
| 8 | 9 | import com.bsth.entity.mcy_forms.Executionrate; |
| 9 | 10 | import com.bsth.entity.mcy_forms.Linepasswengerflow; |
| 10 | 11 | import com.bsth.entity.mcy_forms.Operationservice; |
| ... | ... | @@ -39,4 +40,6 @@ public interface FormsService { |
| 39 | 40 | public List<Executionrate> executionrate(Map<String, Object> map); |
| 40 | 41 | |
| 41 | 42 | public List<Allline> allline(Map<String, Object> map); |
| 43 | + | |
| 44 | + public List<Daily> daily(Map<String, Object> map); | |
| 42 | 45 | } | ... | ... |
src/main/java/com/bsth/service/forms/impl/FormsServiceImpl.java
| ... | ... | @@ -25,6 +25,7 @@ import com.bsth.entity.mcy_forms.Vehicleloading; |
| 25 | 25 | import com.bsth.entity.mcy_forms.Waybillday; |
| 26 | 26 | import com.bsth.entity.mcy_forms.Allline; |
| 27 | 27 | import com.bsth.entity.mcy_forms.Changetochange; |
| 28 | +import com.bsth.entity.mcy_forms.Daily; | |
| 28 | 29 | import com.bsth.entity.mcy_forms.Executionrate; |
| 29 | 30 | import com.bsth.service.forms.CommonService; |
| 30 | 31 | import com.bsth.service.forms.FormsService; |
| ... | ... | @@ -290,6 +291,7 @@ public class FormsServiceImpl implements FormsService { |
| 290 | 291 | |
| 291 | 292 | List<Changetochange> list = jdbcTemplate.query(sql, new RowMapper<Changetochange>() { |
| 292 | 293 | |
| 294 | + | |
| 293 | 295 | @Override |
| 294 | 296 | public Changetochange mapRow(ResultSet arg0, int arg1) throws SQLException { |
| 295 | 297 | Changetochange chan = new Changetochange(); |
| ... | ... | @@ -314,6 +316,7 @@ public class FormsServiceImpl implements FormsService { |
| 314 | 316 | return list; |
| 315 | 317 | } |
| 316 | 318 | |
| 319 | + | |
| 317 | 320 | // 路单数据 |
| 318 | 321 | @Override |
| 319 | 322 | public List<Singledata> singledata(Map<String, Object> map) { |
| ... | ... | @@ -706,4 +709,46 @@ public class FormsServiceImpl implements FormsService { |
| 706 | 709 | |
| 707 | 710 | return list; |
| 708 | 711 | } |
| 712 | + | |
| 713 | + @Override | |
| 714 | + public List<Daily> daily(Map<String, Object> map) { | |
| 715 | + | |
| 716 | + String sql ="select r.schedule_date_str,r.xl_bm,r.xl_name,r.cl_zbh,r.j_gh,r.j_name,y.YH,r.gs_bm,r.gs_name,r.fgs_bm,r.fgs_name " | |
| 717 | + + " from bsth_c_s_sp_info_real r LEFT JOIN bsth_c_ylb y ON r.cl_zbh = y.nbbm " | |
| 718 | + + " WHERE 1 = 1" | |
| 719 | + + " and r.xl_bm='" + map.get("line").toString() + "'" | |
| 720 | + + " and to_days(r.schedule_date)=to_days('"+map.get("date").toString()+"')" | |
| 721 | + + " AND r.gs_bm is not null"; | |
| 722 | + | |
| 723 | + if(map.get("gsdmDaily").toString()!=""){ | |
| 724 | + sql+=" and r.gs_bm='"+map.get("gsdmDaily").toString()+"'"; | |
| 725 | + } | |
| 726 | + if(map.get("fgsdmDaily").toString()!=""){ | |
| 727 | + sql+=" and r.fgs_bm='"+map.get("fgsdmDaily").toString()+"'"; | |
| 728 | + } | |
| 729 | + sql += " GROUP BY r.schedule_date_str,r.xl_bm,r.xl_name,r.cl_zbh,r.j_gh,r.j_name,y.YH,r.gs_bm,r.gs_name,r.fgs_bm,r.fgs_name "; | |
| 730 | + | |
| 731 | + List<Daily> list = jdbcTemplate.query(sql, new RowMapper<Daily>() { | |
| 732 | + @Override | |
| 733 | + public Daily mapRow(ResultSet arg0, int arg1) throws SQLException { | |
| 734 | + Daily daily = new Daily(); | |
| 735 | + daily.setRq(arg0.getString("schedule_date_str")); | |
| 736 | + daily.setZbh(arg0.getString("cl_zbh")); | |
| 737 | + daily.setJgh(arg0.getString("j_gh")); | |
| 738 | + daily.setjName(arg0.getString("j_name")); | |
| 739 | + daily.setYh(arg0.getString("YH")); | |
| 740 | + return daily; | |
| 741 | + } | |
| 742 | + }); | |
| 743 | + | |
| 744 | + for(int i=0;i<list.size();i++){ | |
| 745 | + Daily d=list.get(i); | |
| 746 | + Map<String, Object> maps = new HashMap<>(); | |
| 747 | + maps = commonService.findKMBC2(d.getJgh(),d.getZbh(),d.getRq()); | |
| 748 | + d.setJzl1(maps.get("ksgl").toString()); | |
| 749 | + d.setZlc(maps.get("realMileage").toString()); | |
| 750 | + d.setBc(maps.get("sjbc").toString()); | |
| 751 | + } | |
| 752 | + return list; | |
| 753 | + } | |
| 709 | 754 | } | ... | ... |
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/realcontrol/buffer/GetSchedulePlanThread.java
| ... | ... | @@ -20,7 +20,7 @@ |
| 20 | 20 | //import com.bsth.repository.realcontrol.ScheduleRealInfoRepository; |
| 21 | 21 | //import com.bsth.repository.schedule.SchedulePlanInfoRepository; |
| 22 | 22 | //import com.bsth.util.BatchSaveUtils; |
| 23 | -//import com.bsth.websocket.handler.RealControlSocketHandler; | |
| 23 | +//import com.bsth.websocket.handlers.RealControlSocketHandler; | |
| 24 | 24 | // |
| 25 | 25 | ///** |
| 26 | 26 | // * | ... | ... |
src/main/java/com/bsth/service/realcontrol/impl/ScheduleRealInfoServiceImpl.java
| ... | ... | @@ -1212,7 +1212,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf |
| 1212 | 1212 | map.put("ljbc", ljbc); |
| 1213 | 1213 | map.put("sjbc", jhbc-cjbc+ljbc); |
| 1214 | 1214 | map.put("jcclc", jcclc); |
| 1215 | - map.put("zkslc", ksgl+jcclc); | |
| 1215 | + map.put("zkslc", format.format(ksgl+jcclc)); | |
| 1216 | 1216 | return map; |
| 1217 | 1217 | } |
| 1218 | 1218 | |
| ... | ... | @@ -1226,7 +1226,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf |
| 1226 | 1226 | if(obj != null){ |
| 1227 | 1227 | map = new HashMap<String,Object>(); |
| 1228 | 1228 | map.put("xlName", xlName); |
| 1229 | - map.put("clZbh", code); | |
| 1229 | + map.put("clZbh", obj[3]); | |
| 1230 | 1230 | map.put("company", obj[0]); |
| 1231 | 1231 | map.put("requestType", "0x" + Integer.toHexString(Integer.parseInt(obj[1]+"")).toUpperCase()); |
| 1232 | 1232 | map.put("requestTime", obj[2]); | ... | ... |
src/main/java/com/bsth/service/report/ReportService.java
| ... | ... | @@ -24,6 +24,8 @@ public interface ReportService { |
| 24 | 24 | Map<String, Object> tbodyTime2(String line ,String ttinfo); |
| 25 | 25 | |
| 26 | 26 | List<Map<String, Object>> tbodyTime3(String line ,String ttinfo); |
| 27 | + | |
| 28 | + List<Map<String, Object>> tbodyTime4(String line ,String ttinfo); | |
| 27 | 29 | List<Map<String, Object>> tbodyTime5(String line ,String ttinfo); |
| 28 | 30 | |
| 29 | 31 | List<Map<String, Object>> getTtinfo(Map<String, Object> map); | ... | ... |
src/main/java/com/bsth/service/report/impl/ReportServiceImpl.java
| ... | ... | @@ -451,21 +451,36 @@ public class ReportServiceImpl implements ReportService{ |
| 451 | 451 | System.out.println(609360%60); |
| 452 | 452 | } |
| 453 | 453 | @Override |
| 454 | - public List<Map<String, Object>> tbodyTime3(String line, String date) { | |
| 454 | + public List<Map<String, Object>> tbodyTime3(String line, String ttinfo) { | |
| 455 | 455 | // TODO Auto-generated method stub |
| 456 | 456 | List<Map<String, Object>> list=new ArrayList<Map<String,Object>>(); |
| 457 | - String sqlZd=" select qdz_name, count(cl_zbh) as cls , 'zqc' as lx from bsth_c_s_sp_info where " | |
| 458 | - + " DATE_FORMAT(schedule_date,'%Y-%m-%d') ='"+date+"' and xl_bm='"+line+"' and bc_type='normal' " | |
| 459 | - + " and fcsj>'06:31' and fcsj<'08:00' group by qdz_name union " | |
| 460 | - + " select qdz_name, count(cl_zbh) as cls , 'wqc' as lx from bsth_c_s_sp_info " | |
| 461 | - + " where DATE_FORMAT(schedule_date,'%Y-%m-%d') ='"+date+"' and xl_bm='"+line+"' " | |
| 462 | - + " and bc_type='normal' and fcsj>'16:01' and fcsj<'18:00' group by qdz_name union " | |
| 463 | - + " select qdz_name, count(cl_zbh) as cls , 'zqj' as lx from bsth_c_s_sp_info " | |
| 464 | - + " where DATE_FORMAT(schedule_date,'%Y-%m-%d') ='"+date+"' and xl_bm='"+line+"' " | |
| 465 | - + " and bc_type='region' and fcsj>'06:31' and fcsj<'08:00' group by qdz_name union " | |
| 466 | - + " select qdz_name, count(cl_zbh) as cls , 'wqj' as lx from bsth_c_s_sp_info " | |
| 467 | - + " where DATE_FORMAT(schedule_date,'%Y-%m-%d') ='"+date+"' and xl_bm='"+line+"' " | |
| 468 | - + " and bc_type='region' and fcsj>'16:01' and fcsj<'18:00'group by qdz_name"; | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + String sqlZd=" select t.*,x.station_name as qdz_name from (" | |
| 461 | + + " select qdz,count(lp) as cls,lx from ( select qdz,lp, 'zqc' as lx " | |
| 462 | + + " from bsth_c_s_ttinfo_detail where " | |
| 463 | + + " bc_type='normal' and ttinfo ='"+ttinfo+"' " | |
| 464 | + + " and fcsj>'06:31' and fcsj<'08:00' group by qdz,lp) t1" | |
| 465 | + + " group by qdz " | |
| 466 | + + " union " | |
| 467 | + + " select qdz,count(lp) as cls,lx from ( select qdz,lp, 'wqc' as lx " | |
| 468 | + + " from bsth_c_s_ttinfo_detail where " | |
| 469 | + + " bc_type='normal' and ttinfo ='"+ttinfo+"' " | |
| 470 | + + " and fcsj>'16:01' and fcsj<'18:00' group by qdz,lp) t2" | |
| 471 | + + " group by qdz " | |
| 472 | + + " union " | |
| 473 | + + " select qdz,count(lp) as cls,lx from ( select qdz,lp, 'zqj' as lx " | |
| 474 | + + " from bsth_c_s_ttinfo_detail where " | |
| 475 | + + " bc_type='region' and ttinfo ='"+ttinfo+"' " | |
| 476 | + + " and fcsj>'06:31' and fcsj<'08:00' group by qdz,lp) t3" | |
| 477 | + + " group by qdz " | |
| 478 | + + " union " | |
| 479 | + + " select qdz,count(lp) as cls,lx from ( select qdz,lp, 'wqj' as lx " | |
| 480 | + + " from bsth_c_s_ttinfo_detail where " | |
| 481 | + + " bc_type='region' and ttinfo ='"+ttinfo+"' " | |
| 482 | + + " and fcsj>'16:01' and fcsj<'18:00' group by qdz,lp) t4" | |
| 483 | + + " group by qdz ) t left join bsth_c_station x on t.qdz=x.id"; | |
| 469 | 484 | |
| 470 | 485 | List<Map<String, Object>> lists= jdbcTemplate.query(sqlZd, |
| 471 | 486 | new RowMapper<Map<String, Object>>(){ |
| ... | ... | @@ -526,55 +541,238 @@ public class ReportServiceImpl implements ReportService{ |
| 526 | 541 | } |
| 527 | 542 | return list; |
| 528 | 543 | } |
| 544 | + | |
| 529 | 545 | @Override |
| 530 | - public List<Map<String, Object>> tbodyTime5(String line, String date) { | |
| 546 | + public List<Map<String, Object>> tbodyTime4(String line, String ttinfo) { | |
| 547 | + List<Map<String, Object>> list =new ArrayList<>(); | |
| 531 | 548 | // TODO Auto-generated method stub |
| 532 | - String sql="select min(fcsj) as fcsj,'lx0' as lx from bsth_c_s_sp_info where " | |
| 533 | - + " DATE_FORMAT(schedule_date,'%Y-%m-%d') ='"+date+"' and xl_bm='"+line+"'" | |
| 534 | - + " and bc_type='out' and xl_dir=0 union " | |
| 535 | - + " select min(fcsj) as fcsj,'lx1' as lx from bsth_c_s_sp_info where " | |
| 536 | - + " DATE_FORMAT(schedule_date,'%Y-%m-%d') ='"+date+"' and xl_bm='"+line+"'" | |
| 537 | - + " and bc_type='out' and xl_dir=1"; | |
| 538 | - List<Map<String, Object>> lists= jdbcTemplate.query(sql, | |
| 539 | - new RowMapper<Map<String, Object>>(){ | |
| 549 | + //最早营运时间 区分夜宵线 | |
| 550 | + String sqlMinYysj="select start_opt from bsth_c_line_config where line = '"+BasicData.lineId2CodeMap.inverse().get(line) +"'"; | |
| 551 | + String minfcsj=jdbcTemplate.queryForObject(sqlMinYysj, String.class); | |
| 552 | + | |
| 553 | + //查询全程 | |
| 554 | + String sqlqc="select t.*,x.station_name as qdz_name from ( " | |
| 555 | + + "(SELECT fcsj,qdz,2 as xh,xl_dir FROM bsth_c_s_ttinfo_detail " | |
| 556 | + + " where ttinfo ='"+ttinfo+"' and bc_type='normal' and fcsj <='"+minfcsj+"' ) " | |
| 557 | + + " union " | |
| 558 | + + " (SELECT fcsj,qdz,1 as xh,xl_dir FROM bsth_c_s_ttinfo_detail " | |
| 559 | + + " where ttinfo ='"+ttinfo+"' and bc_type='normal' and fcsj > '"+minfcsj+"') " | |
| 560 | + + "order by xl_dir,xh,fcsj ) t left join bsth_c_station x on t.qdz=x.id"; | |
| 561 | + List<Map<String, String>> qclist= jdbcTemplate.query(sqlqc, | |
| 562 | + new RowMapper<Map<String, String>>(){ | |
| 540 | 563 | @Override |
| 541 | - public Map<String, Object> mapRow(ResultSet rs, int rowNum) throws SQLException { | |
| 542 | - Map<String, Object> m=new HashMap<String,Object>(); | |
| 543 | - m.put("lx", rs.getString("lx")); | |
| 564 | + public Map<String, String> mapRow(ResultSet rs, int rowNum) throws SQLException { | |
| 565 | + Map<String, String> m=new HashMap<String,String>(); | |
| 566 | + m.put("qdz_name", rs.getString("qdz_name")); | |
| 544 | 567 | m.put("fcsj", rs.getString("fcsj")); |
| 568 | + m.put("xl", rs.getString("xl_dir")); | |
| 545 | 569 | return m; |
| 546 | 570 | } |
| 571 | + | |
| 547 | 572 | }); |
| 573 | + | |
| 574 | + Map<String, Object> qcMap=new HashMap<String,Object>(); | |
| 575 | + int num=0; | |
| 576 | + String sxfcsj=""; | |
| 577 | + String xxfcsj=""; | |
| 578 | + String sxzd=""; | |
| 579 | + String xxzd=""; | |
| 580 | + for (int i = 0; i < qclist.size(); i++) { | |
| 581 | + Map<String, String> map=qclist.get(i); | |
| 582 | + if(map.get("xl").equals("0")){ | |
| 583 | + if(sxzd.equals("")){ | |
| 584 | + sxzd=map.get("qdz_name").toString(); | |
| 585 | + qcMap.put("sxzm", sxzd); | |
| 586 | + sxfcsj +=map.get("fcsj").toString()+"-"; | |
| 587 | + } | |
| 588 | + if(!(qclist.get(i+1).get("xl").equals("0"))){ | |
| 589 | + sxfcsj +=map.get("fcsj").toString(); | |
| 590 | + qcMap.put("sxsj",sxfcsj); | |
| 591 | + qcMap.put("sxbc", i+1); | |
| 592 | + num=i+1; | |
| 593 | + } | |
| 594 | + } | |
| 595 | + if(map.get("xl").equals("1")){ | |
| 596 | + if(xxzd.equals("")){ | |
| 597 | + xxzd=map.get("qdz_name").toString(); | |
| 598 | + xxfcsj+=map.get("fcsj").toString()+"-"; | |
| 599 | + qcMap.put("xxzm", xxzd); | |
| 600 | + } | |
| 601 | + } | |
| 602 | + } | |
| 603 | + xxfcsj +=qclist.get(qclist.size()-1).get("fcsj").toString(); | |
| 604 | + qcMap.put("xxsj", xxfcsj); | |
| 605 | + qcMap.put("xxbc", qclist.size()-num); | |
| 606 | + list.add(qcMap); | |
| 548 | 607 | |
| 549 | - String sqlList="select * from bsth_c_s_sp_info where " | |
| 550 | - + "DATE_FORMAT(schedule_date,'%Y-%m-%d') ='"+date+"' and xl_bm='"+line+"'" | |
| 551 | - + " and bc_type='normal' order by fcsj"; | |
| 552 | - List<SchedulePlanInfo> list= jdbcTemplate.query(sqlList, | |
| 553 | - new RowMapper<SchedulePlanInfo>(){ | |
| 608 | + | |
| 609 | + //查询区间 | |
| 610 | + String sqlqj="select t.*,x.station_name as qdz_name from ( " | |
| 611 | + + "(SELECT fcsj,qdz,'1' as gf,xl_dir FROM bsth_c_s_ttinfo_detail " | |
| 612 | + + "where ttinfo ='"+ttinfo+"' and bc_type='region' and fcsj >='06:31'" | |
| 613 | + + "and fcsj <'08:30')" | |
| 614 | + + " union ( SELECT fcsj,qdz,'2' as gf,xl_dir FROM bsth_c_s_ttinfo_detail " | |
| 615 | + + "where ttinfo ='"+ttinfo+"' and bc_type='region' " | |
| 616 | + + "and fcsj > '16:01' and fcsj < '18:00') order by xl_dir,gf,fcsj ) t " | |
| 617 | + + "left join bsth_c_station x on t.qdz=x.id"; | |
| 618 | + | |
| 619 | + List<Map<String, String>> qjlist= jdbcTemplate.query(sqlqj, | |
| 620 | + new RowMapper<Map<String, String>>(){ | |
| 554 | 621 | @Override |
| 555 | - public SchedulePlanInfo mapRow(ResultSet rs, int rowNum) throws SQLException { | |
| 556 | - SchedulePlanInfo m=new SchedulePlanInfo(); | |
| 557 | - m.setBcsj(rs.getInt("bcsj")); | |
| 558 | - m.setXlDir(rs.getString("xl_dir")); | |
| 559 | - m.setFcsj(rs.getString("fcsj")); | |
| 622 | + public Map<String, String> mapRow(ResultSet rs, int rowNum) throws SQLException { | |
| 623 | + Map<String, String> m=new HashMap<String,String>(); | |
| 624 | + m.put("qdz_name", rs.getString("qdz_name")); | |
| 625 | + m.put("fcsj", rs.getString("fcsj")); | |
| 626 | + m.put("xl", rs.getString("xl_dir")); | |
| 627 | + m.put("gf", rs.getString("gf")); | |
| 560 | 628 | return m; |
| 561 | 629 | } |
| 562 | 630 | }); |
| 563 | - //上下行最早发车时间 (用于与夜班线 跨零点的班次进行比较) | |
| 564 | - String lx0=""; | |
| 565 | - String lx1=""; | |
| 566 | - for (int x = 0; x < lists.size(); x++) { | |
| 567 | - if(lists.get(x).get("lx").equals("lx0")){ | |
| 568 | - lx0=lists.get(x).get("fcsj")==null?"0:0":lists.get(x).get("fcsj").toString(); | |
| 631 | + | |
| 632 | + Map<String, Object> qjzMap=new HashMap<String,Object>(); | |
| 633 | + Map<String, Object> qjwMap=new HashMap<String,Object>(); | |
| 634 | + int numqj=0; | |
| 635 | + String sxfcsjqj=""; | |
| 636 | + String xxfcsjqj=""; | |
| 637 | + String sxzdqj=""; | |
| 638 | + String xxzdqj=""; | |
| 639 | + for(int i=0;i<qjlist.size();i++){ | |
| 640 | + Map<String, String> map=qjlist.get(i); | |
| 641 | + if(map.get("xl").toString().equals("0")){ | |
| 642 | + if(map.get("gf").toString().equals("1")){ | |
| 643 | + if(sxzdqj.equals("")){ | |
| 644 | + sxzdqj =map.get("qdz_name").toString(); | |
| 645 | + qjzMap.put("sxzm", sxzdqj); | |
| 646 | + sxfcsjqj +=map.get("fcsj").toString()+"-"; | |
| 647 | + } | |
| 648 | + if(i<qjlist.size()-1){ | |
| 649 | + if(!(qjlist.get(i+1).get("gf").equals("1"))){ | |
| 650 | + sxfcsjqj +=map.get("fcsj").toString(); | |
| 651 | + qjzMap.put("sxsj",sxfcsjqj); | |
| 652 | + qjzMap.put("sxbc", i+1); | |
| 653 | + numqj=i+1; | |
| 654 | + sxzdqj =""; | |
| 655 | + sxfcsjqj=""; | |
| 656 | + } | |
| 657 | + }else{ | |
| 658 | + qjzMap.put("sxsj",sxfcsjqj+"-"+map.get("fcsj").toString()); | |
| 659 | + qjzMap.put("sxbc", i+1); | |
| 660 | + numqj=i+1; | |
| 661 | + sxzdqj =""; | |
| 662 | + sxfcsjqj=""; | |
| 663 | + } | |
| 664 | + } | |
| 665 | + if(map.get("gf").toString().equals("2")){ | |
| 666 | + if(sxzdqj.equals("")){ | |
| 667 | + sxzdqj =map.get("qdz_name").toString(); | |
| 668 | + qjwMap.put("sxzm", sxzdqj); | |
| 669 | + sxfcsjqj +=map.get("fcsj").toString()+"-"; | |
| 670 | + } | |
| 671 | + if(i<qjlist.size()-1){ | |
| 672 | + if(!(qjlist.get(i+1).get("xl").equals("0"))){ | |
| 673 | + sxfcsjqj +=map.get("fcsj").toString(); | |
| 674 | + qjwMap.put("sxsj",sxfcsjqj); | |
| 675 | + qjwMap.put("sxbc", i+1-numqj); | |
| 676 | + numqj=i+1; | |
| 677 | + } | |
| 678 | + }else{ | |
| 679 | + qjwMap.put("sxsj",sxfcsjqj+"-"+map.get("fcsj").toString()); | |
| 680 | + qjwMap.put("sxbc", i+1-numqj); | |
| 681 | + numqj=i+1; | |
| 682 | + } | |
| 683 | + } | |
| 684 | + | |
| 569 | 685 | }else{ |
| 570 | - lx1=lists.get(x).get("fcsj")==null?"0:0":lists.get(x).get("fcsj").toString(); | |
| 686 | + if(map.get("gf").toString().equals("1")){ | |
| 687 | + if(xxzdqj.equals("")){ | |
| 688 | + xxzdqj =map.get("qdz_name").toString(); | |
| 689 | + qjzMap.put("xxzm", xxzdqj); | |
| 690 | + xxfcsjqj +=map.get("fcsj").toString()+"-"; | |
| 691 | + } | |
| 692 | + if(i<qjlist.size()-1){ | |
| 693 | + if(!(qjlist.get(i+1).get("gf").equals("1"))){ | |
| 694 | + xxfcsjqj +=map.get("fcsj").toString(); | |
| 695 | + qjzMap.put("xxsj",xxfcsjqj); | |
| 696 | + qjzMap.put("xxbc", i+1-numqj); | |
| 697 | + numqj=i+1; | |
| 698 | + xxzdqj =""; | |
| 699 | + xxfcsjqj=""; | |
| 700 | + } | |
| 701 | + }else{ | |
| 702 | + qjzMap.put("xxsj",xxfcsjqj+"-"+map.get("fcsj").toString()); | |
| 703 | + qjzMap.put("xxbc", i+1-numqj); | |
| 704 | + numqj=i+1; | |
| 705 | + xxzdqj =""; | |
| 706 | + xxfcsjqj=""; | |
| 707 | + } | |
| 708 | + } | |
| 709 | + if(map.get("gf").toString().equals("2")){ | |
| 710 | + if(xxzdqj.equals("")){ | |
| 711 | + xxzdqj =map.get("qdz_name").toString(); | |
| 712 | + qjwMap.put("xxzm", xxzdqj); | |
| 713 | + xxfcsjqj +=map.get("fcsj").toString()+"-"; | |
| 714 | + } | |
| 715 | + if(i<qjlist.size()){ | |
| 716 | + if(i==qjlist.size()-1){ | |
| 717 | + xxfcsjqj +=map.get("fcsj").toString(); | |
| 718 | + qjwMap.put("xxsj",xxfcsjqj); | |
| 719 | + qjwMap.put("xxbc", i+1-numqj); | |
| 720 | + numqj=i+1; | |
| 721 | + } | |
| 722 | + }else{ | |
| 723 | + qjwMap.put("xxsj",xxfcsjqj+"-"+xxfcsjqj); | |
| 724 | + qjwMap.put("xxbc", i+1-numqj); | |
| 725 | + numqj=i+1; | |
| 726 | + } | |
| 727 | + } | |
| 728 | + | |
| 729 | + | |
| 571 | 730 | } |
| 572 | 731 | } |
| 573 | 732 | |
| 574 | - String[] lx0sj = lx0.split(":"); | |
| 575 | - int sxFc=Integer.parseInt(lx0sj[0])*60+Integer.parseInt(lx0sj[1]); | |
| 576 | - String[] lx1sj = lx1.split(":"); | |
| 577 | - int xxFc=Integer.parseInt(lx1sj[0])*60+Integer.parseInt(lx1sj[1]); | |
| 733 | + if(!qjzMap.isEmpty()){ | |
| 734 | + list.add(qjzMap); | |
| 735 | + } | |
| 736 | + if(!qjwMap.isEmpty()){ | |
| 737 | + list.add(qjwMap); | |
| 738 | + | |
| 739 | + } | |
| 740 | + return list; | |
| 741 | + } | |
| 742 | + @Override | |
| 743 | + public List<Map<String, Object>> tbodyTime5(String line, String ttinfo) { | |
| 744 | + // TODO Auto-generated method stub | |
| 745 | + //最早营运时间 区分夜宵线 | |
| 746 | + String sqlMinYysj="select start_opt from bsth_c_line_config where line = '"+BasicData.lineId2CodeMap.inverse().get(line) +"'"; | |
| 747 | + String minfcsj=jdbcTemplate.queryForObject(sqlMinYysj, String.class); | |
| 748 | + String[] minSjs = minfcsj.split(":"); | |
| 749 | + int minSj=Integer.parseInt(minSjs[0])*60+Integer.parseInt(minSjs[1]); | |
| 750 | + //查询时间里程 | |
| 751 | + String sqlPc=" (SELECT jhlc,fcsj,bcsj,bc_type,lp,xl_dir,2 as xh FROM " | |
| 752 | + + " bsth_c_s_ttinfo_detail where ttinfo ='"+ttinfo+"' and " | |
| 753 | + + " fcsj <='"+minfcsj+"' and bc_type = 'normal') " | |
| 754 | + + " union " | |
| 755 | + + " (SELECT jhlc,fcsj,bcsj,bc_type,lp,xl_dir,1 as xh FROM " | |
| 756 | + + " bsth_c_s_ttinfo_detail where ttinfo ='"+ttinfo+"' and " | |
| 757 | + + " fcsj >'"+minfcsj+"' and bc_type ='normal') " | |
| 758 | + + " order by xl_dir, xh,fcsj"; | |
| 759 | + | |
| 760 | + Map<String, Object> map=new HashMap<String,Object>(); | |
| 761 | + List<Map<String, Object>> list= jdbcTemplate.query(sqlPc, | |
| 762 | + new RowMapper<Map<String, Object>>(){ | |
| 763 | + @Override | |
| 764 | + public Map<String, Object> mapRow(ResultSet rs, int rowNum) throws SQLException { | |
| 765 | + Map<String, Object> m=new HashMap<String,Object>(); | |
| 766 | + m.put("fcsj", rs.getString("fcsj")); | |
| 767 | + m.put("yygl", rs.getString("jhlc")==null?"0":rs.getString("jhlc")); | |
| 768 | + m.put("bcsj", rs.getString("bcsj")); | |
| 769 | + m.put("bcType", rs.getString("bc_type")); | |
| 770 | + m.put("lp", rs.getString("lp")); | |
| 771 | + m.put("dir", rs.getString("xl_dir")); | |
| 772 | + return m; | |
| 773 | + } | |
| 774 | + }); | |
| 775 | + | |
| 578 | 776 | //班次 |
| 579 | 777 | int sj_0 = 6*60+31,sj_1 = 8*60+30,sj_2 = 16*60+1,sj_3 = 18*60; |
| 580 | 778 | |
| ... | ... | @@ -587,17 +785,17 @@ public class ReportServiceImpl implements ReportService{ |
| 587 | 785 | //车距 (发车时间的间距) i--MIN a--MAX |
| 588 | 786 | int iC=999,aC=-1,iZg=999,aZg=-1,iZw=999,aZw=-1,iWg=999,aWg=-1,iJcZ=999,aJcZ=-1,iJcW=999,aJcW=-1; |
| 589 | 787 | int iC1=999,aC1=-1,iZg1=999,aZg1=-1,iZw1=999,aZw1=-1,iWg1=999,aWg1=-1,iJc1Z=999,aJc1Z=-1,iJc1W=999,aJc1W=-1; |
| 590 | -// List<ScheduleRealInfo> list = scheduleRealInfoRepository.scheduleByDateAndLine(line, date); | |
| 788 | + | |
| 591 | 789 | for(int i=0;i<list.size();i++){ |
| 592 | - SchedulePlanInfo t=list.get(i); | |
| 593 | - String xlDir=t.getXlDir(); | |
| 594 | - int bcsj=t.getBcsj(); | |
| 595 | - String fcsj=t.getFcsj(); | |
| 790 | + Map<String, Object> ttMap=list.get(i); | |
| 791 | + String xlDir=ttMap.get("dir").toString(); | |
| 792 | + int bcsj=Integer.parseInt(ttMap.get("bcsj").toString()); | |
| 793 | + String fcsj=ttMap.get("fcsj").toString(); | |
| 596 | 794 | String[] fcsjs=fcsj.split(":"); |
| 597 | 795 | int fcsjNum=Integer.parseInt(fcsjs[0])*60+Integer.parseInt(fcsjs[1]); |
| 598 | 796 | |
| 599 | 797 | if(xlDir.equals("0")){ |
| 600 | - if(fcsjNum>=sxFc && fcsjNum<sj_0){ | |
| 798 | + if(fcsjNum>=minSj && fcsjNum<sj_0){ | |
| 601 | 799 | ccsj0 +=bcsj; |
| 602 | 800 | if(aC<0){ |
| 603 | 801 | cfc0 =fcsjNum; |
| ... | ... | @@ -672,7 +870,7 @@ public class ReportServiceImpl implements ReportService{ |
| 672 | 870 | } |
| 673 | 871 | jcfc0W=fcsjNum; |
| 674 | 872 | } |
| 675 | - }else if(fcsjNum<sxFc){ | |
| 873 | + }else if(fcsjNum<minSj){ | |
| 676 | 874 | jcsj0 +=bcsj; |
| 677 | 875 | if(aJcZ<0){ |
| 678 | 876 | jcfc0Z=fcsjNum; |
| ... | ... | @@ -690,7 +888,7 @@ public class ReportServiceImpl implements ReportService{ |
| 690 | 888 | |
| 691 | 889 | |
| 692 | 890 | }else{ |
| 693 | - if(fcsjNum>=xxFc && fcsjNum<sj_0){ | |
| 891 | + if(fcsjNum>=minSj && fcsjNum<sj_0){ | |
| 694 | 892 | ccsj1 +=bcsj; |
| 695 | 893 | if(aC1<0){ |
| 696 | 894 | cfc1=fcsjNum; |
| ... | ... | @@ -762,7 +960,7 @@ public class ReportServiceImpl implements ReportService{ |
| 762 | 960 | |
| 763 | 961 | jcfc1W=fcsjNum; |
| 764 | 962 | } |
| 765 | - }else if(fcsjNum<xxFc){ | |
| 963 | + }else if(fcsjNum<minSj){ | |
| 766 | 964 | jcsj1 +=bcsj; |
| 767 | 965 | if(aJc1Z<0){ |
| 768 | 966 | jcfc1Z=fcsjNum; |
| ... | ... | @@ -860,4 +1058,5 @@ public class ReportServiceImpl implements ReportService{ |
| 860 | 1058 | } |
| 861 | 1059 | return list; |
| 862 | 1060 | } |
| 1061 | + | |
| 863 | 1062 | } | ... | ... |
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 | }); |
| ... | ... | @@ -138,6 +180,7 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { |
| 138 | 180 | |
| 139 | 181 | |
| 140 | 182 | } catch (Exception e) { |
| 183 | + | |
| 141 | 184 | // TODO Auto-generated catch block |
| 142 | 185 | e.printStackTrace(); |
| 143 | 186 | } |
| ... | ... | @@ -259,14 +302,20 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { |
| 259 | 302 | Long wgfEnd = 0l; |
| 260 | 303 | try { |
| 261 | 304 | //早晚高峰时段 |
| 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) { | |
| 305 | +// zgfBegin = sdf.parse(date + "06:30").getTime(); | |
| 306 | +// zgfEnd = sdf.parse(date + "08:30").getTime(); | |
| 307 | +// wgfBegin = sdf.parse(date + "16:00").getTime(); | |
| 308 | +// wgfEnd = sdf.parse(date + "18:00").getTime(); | |
| 309 | + zgfBegin = 6l * 60l + 30l; | |
| 310 | + zgfEnd = 8l * 60l + 30l; | |
| 311 | + wgfBegin = 16l * 60l + 0l; | |
| 312 | + wgfEnd = 18l * 60l + 0l; | |
| 313 | + } catch (Exception e) { | |
| 267 | 314 | // TODO Auto-generated catch block |
| 268 | 315 | e.printStackTrace(); |
| 269 | 316 | } |
| 317 | + String companyName = "", subCompanyName = ""; | |
| 318 | + | |
| 270 | 319 | for(String key : keyMap.keySet()){ |
| 271 | 320 | Map<String, Object> tempMap = new HashMap<String, Object>(); |
| 272 | 321 | Map<String, List <ScheduleRealInfo>> listMap = new HashMap<String, List <ScheduleRealInfo>>(); |
| ... | ... | @@ -276,7 +325,11 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { |
| 276 | 325 | int jhsb = 0, sjsb = 0, jhmb = 0, sjmb = 0; |
| 277 | 326 | int jhzgf = 0, sjzgf = 0, jhwgf = 0, sjwgf = 0; |
| 278 | 327 | for(ScheduleRealInfo schedule : keyMap.get(key)){ |
| 279 | - schedule.setFcsjAll(schedule.getFcsj()); | |
| 328 | +// schedule.setFcsjAll(schedule.getFcsj()); | |
| 329 | + if(companyName.length() == 0 && schedule.getGsName() != null) | |
| 330 | + companyName = schedule.getGsName(); | |
| 331 | + if(subCompanyName.length() == 0 && schedule.getFgsName() != null) | |
| 332 | + subCompanyName = schedule.getFgsName(); | |
| 280 | 333 | |
| 281 | 334 | //早晚高峰时段执行率 |
| 282 | 335 | if(schedule.getFcsjT() >= zgfBegin && schedule.getFcsjT() <= zgfEnd){ |
| ... | ... | @@ -299,13 +352,13 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { |
| 299 | 352 | if(schedule.getFcsjActual() != null){ |
| 300 | 353 | if(schedule.getBcType().equals("out")) |
| 301 | 354 | sjcc++; |
| 302 | - schedule.setFcsjActualAll(schedule.getFcsjActual()); | |
| 303 | - if(schedule.getFcsjActualTime() - schedule.getFcsjT() < -60000){ | |
| 355 | +// schedule.setFcsjActualAll(schedule.getFcsjActual()); | |
| 356 | + if(schedule.getFcsjActualTime() - schedule.getFcsjT() < -1){ | |
| 304 | 357 | if(schedule.getXlDir().equals("0")) |
| 305 | 358 | upfk++; |
| 306 | 359 | else if (schedule.getXlDir().equals("1")) |
| 307 | 360 | dnfk++; |
| 308 | - } else if(schedule.getFcsjActualTime() - schedule.getFcsjT() > 180000){ | |
| 361 | + } else if(schedule.getFcsjActualTime() - schedule.getFcsjT() > 3){ | |
| 309 | 362 | if(schedule.getXlDir().equals("0")) |
| 310 | 363 | upfm++; |
| 311 | 364 | else if (schedule.getXlDir().equals("1")) |
| ... | ... | @@ -314,15 +367,16 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { |
| 314 | 367 | } |
| 315 | 368 | //到站时间快慢 |
| 316 | 369 | 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){ | |
| 370 | +// schedule.setZdsjActualAll(schedule.getZdsjActual()); | |
| 371 | +// schedule.setDfsjAll(schedule.getDfsj()); | |
| 372 | +// schedule.calcEndTime(); | |
| 373 | + schedule.setZdsjT(schedule.getFcsjT() + schedule.getBcsj()); | |
| 374 | + if(schedule.getZdsjActualTime() - schedule.getZdsjT() < -1){ | |
| 321 | 375 | if(schedule.getXlDir().equals("0")) |
| 322 | 376 | updk++; |
| 323 | 377 | else if (schedule.getXlDir().equals("1")) |
| 324 | 378 | dndk++; |
| 325 | - } else if(schedule.getZdsjActualTime() - schedule.getZdsjT() > 180000){ | |
| 379 | + } else if(schedule.getZdsjActualTime() - schedule.getZdsjT() > 3){ | |
| 326 | 380 | if(schedule.getXlDir().equals("0")) |
| 327 | 381 | updm++; |
| 328 | 382 | else if (schedule.getXlDir().equals("1")) |
| ... | ... | @@ -337,7 +391,7 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { |
| 337 | 391 | } |
| 338 | 392 | } |
| 339 | 393 | |
| 340 | - if(schedule.getBcType().equals("normal")){ | |
| 394 | + if(!schedule.getBcType().equals("in") && !schedule.getBcType().equals("out")){ | |
| 341 | 395 | String clZbh = schedule.getClZbh(); |
| 342 | 396 | if(!listMap.containsKey(clZbh)) |
| 343 | 397 | listMap.put(clZbh, new ArrayList<ScheduleRealInfo>()); |
| ... | ... | @@ -366,17 +420,19 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { |
| 366 | 420 | // System.out.println(moban.getFcsjActual() + "-末班-" + moban.getFcsj()); |
| 367 | 421 | jhsb++; |
| 368 | 422 | if(shouban.getFcsjActual() != null){ |
| 369 | - if(shouban.getFcsjActualTime() - shouban.getFcsjT() >= -60000 && shouban.getFcsjActualTime() - shouban.getFcsjT() <= 180000) | |
| 423 | + if(shouban.getFcsjActualTime() - shouban.getFcsjT() >= -1 && shouban.getFcsjActualTime() - shouban.getFcsjT() <= 3) | |
| 370 | 424 | sjsb++; |
| 371 | 425 | } |
| 372 | 426 | jhmb++; |
| 373 | 427 | if(moban.getFcsjActual() != null){ |
| 374 | - if(moban.getFcsjActualTime() - moban.getFcsjT() >= -60000 && moban.getFcsjActualTime() - moban.getFcsjT() <= 180000) | |
| 428 | + if(moban.getFcsjActualTime() - moban.getFcsjT() >= -1 && moban.getFcsjActualTime() - moban.getFcsjT() <= 3) | |
| 375 | 429 | sjmb++; |
| 376 | 430 | } |
| 377 | 431 | |
| 378 | 432 | } |
| 379 | 433 | |
| 434 | + tempMap.put("company", companyName); | |
| 435 | + tempMap.put("subCompany", subCompanyName); | |
| 380 | 436 | tempMap.put("date", date); |
| 381 | 437 | tempMap.put("line", key); |
| 382 | 438 | tempMap.put("jhbc", jhbc); |
| ... | ... | @@ -452,7 +508,7 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { |
| 452 | 508 | if(company.length() != 0){ |
| 453 | 509 | sql += " and gs_bm = '"+company+"' and fgs_bm = '"+subCompany+"'"; |
| 454 | 510 | } |
| 455 | - sql += " and bc_type = 'normal'"; | |
| 511 | + sql += " and bc_type != 'in' and bc_type != 'out'"; | |
| 456 | 512 | |
| 457 | 513 | list = jdbcTemplate.query(sql, |
| 458 | 514 | new RowMapper<ScheduleRealInfo>(){ |
| ... | ... | @@ -462,6 +518,8 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { |
| 462 | 518 | schedule.setScheduleDateStr(rs.getString("schedule_date_Str")); |
| 463 | 519 | schedule.setXlName(rs.getString("xl_name")); |
| 464 | 520 | schedule.setBcType(rs.getString("bc_type")); |
| 521 | + schedule.setGsName(rs.getString("gs_name")); | |
| 522 | + schedule.setFgsName(rs.getString("fgs_name")); | |
| 465 | 523 | schedule.setBcs(rs.getInt("bcs")); |
| 466 | 524 | schedule.setFcno(rs.getInt("fcno")); |
| 467 | 525 | schedule.setFcsj(rs.getString("fcsj")); |
| ... | ... | @@ -471,13 +529,39 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { |
| 471 | 529 | schedule.setBcsj(rs.getInt("bcsj")); |
| 472 | 530 | schedule.setQdzName(rs.getString("qdz_name")); |
| 473 | 531 | schedule.setSpId(rs.getLong("sp_id")); |
| 532 | + | |
| 533 | + if(schedule.getFcsj() != null && schedule.getZdsj() != null){ | |
| 534 | + String[] split1 = schedule.getFcsj().split(":"); | |
| 535 | + String[] split2 = schedule.getZdsj().split(":"); | |
| 536 | + int fcsj = Integer.valueOf(split1[0]) * 60 + Integer.valueOf(split1[1]); | |
| 537 | + int zdsj = Integer.valueOf(split2[0]) * 60 + Integer.valueOf(split2[1]); | |
| 538 | + if(zdsj < fcsj){ | |
| 539 | + zdsj += 1440; | |
| 540 | + schedule.setZdsj((zdsj/60>9?zdsj/60:"0"+zdsj/60) + ":" + (zdsj%60>9?zdsj%60:"0"+zdsj%60)); | |
| 541 | + } | |
| 542 | + schedule.setFcsjT((long)fcsj); | |
| 543 | + schedule.setZdsjT((long)zdsj); | |
| 544 | + } | |
| 545 | + if(schedule.getFcsjActual() != null && schedule.getZdsjActual() != null){ | |
| 546 | + String[] split3 = schedule.getFcsjActual().split(":"); | |
| 547 | + String[] split4 = schedule.getZdsjActual().split(":"); | |
| 548 | + int fcsjA = Integer.valueOf(split3[0]) * 60 + Integer.valueOf(split3[1]); | |
| 549 | + int zdsjA = Integer.valueOf(split4[0]) * 60 + Integer.valueOf(split4[1]); | |
| 550 | + if(fcsjA > zdsjA){ | |
| 551 | + zdsjA += 1440; | |
| 552 | + schedule.setZdsjActual((zdsjA/60>9?zdsjA/60:"0"+zdsjA/60) + ":" + (zdsjA%60>9?zdsjA%60:"0"+zdsjA%60)); | |
| 553 | + } | |
| 554 | + schedule.setFcsjActualTime((long)fcsjA); | |
| 555 | + schedule.setZdsjActualTime((long)zdsjA); | |
| 556 | + } | |
| 557 | + | |
| 474 | 558 | return schedule; |
| 475 | 559 | } |
| 476 | 560 | }); |
| 477 | 561 | |
| 478 | 562 | 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'"; | |
| 563 | +// sql = "select * from bsth_c_s_ttinfo_detail where ttinfo = '"+model+"' and bc_type != 'in' and bc_type != 'out'"; | |
| 564 | + sql = "select id from bsth_c_s_sp_info where tt_info = '" + model + "' and bc_type != 'in' and bc_type != 'out'"; | |
| 481 | 565 | |
| 482 | 566 | ttList = jdbcTemplate.query(sql, |
| 483 | 567 | new RowMapper<Long>(){ |
| ... | ... | @@ -515,6 +599,7 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { |
| 515 | 599 | } |
| 516 | 600 | } |
| 517 | 601 | } |
| 602 | + String companyName = "", subCompanyName = ""; | |
| 518 | 603 | for(String key : keyMap.keySet()){ |
| 519 | 604 | Map<String, Object> tempMap = new HashMap<String, Object>(); |
| 520 | 605 | List<Integer> fcsj = new ArrayList<Integer>(); |
| ... | ... | @@ -522,6 +607,11 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { |
| 522 | 607 | int jhbc = 0; |
| 523 | 608 | int sjbc = 0; |
| 524 | 609 | for(ScheduleRealInfo schedule : keyMap.get(key)){ |
| 610 | + if(companyName.length() == 0 && schedule.getGsName() != null) | |
| 611 | + companyName = schedule.getGsName(); | |
| 612 | + if(subCompanyName.length() == 0 && schedule.getFgsName() != null) | |
| 613 | + subCompanyName = schedule.getFgsName(); | |
| 614 | + | |
| 525 | 615 | tempMap.put("date", schedule.getScheduleDateStr()); |
| 526 | 616 | tempMap.put("bcsj", schedule.getBcsj()); |
| 527 | 617 | if(schedule.getFcsjActual() != null){ |
| ... | ... | @@ -581,6 +671,8 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { |
| 581 | 671 | tempMap.put("zmys", "/"); |
| 582 | 672 | tempMap.put("pjys", "/"); |
| 583 | 673 | } |
| 674 | + tempMap.put("company", companyName); | |
| 675 | + tempMap.put("subCompany", subCompanyName); | |
| 584 | 676 | String[] split = key.split("/"); |
| 585 | 677 | tempMap.put("line", split[0]); |
| 586 | 678 | tempMap.put("qdz", split[1]); |
| ... | ... | @@ -784,7 +876,7 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { |
| 784 | 876 | List<ScheduleRealInfo> list = this.getSchedule(company, subCompany, line, date); |
| 785 | 877 | |
| 786 | 878 | for(ScheduleRealInfo schedule : list){ |
| 787 | - if(!schedule.getBcType().equals("normal")) | |
| 879 | + if(schedule.getBcType().equals("in") || schedule.getBcType().equals("out")) | |
| 788 | 880 | continue; |
| 789 | 881 | String key = schedule.getXlName(); |
| 790 | 882 | if(!keyMap.containsKey(key)) | ... | ... |
src/main/java/com/bsth/websocket/handler/SendUtils.java
| 1 | 1 | package com.bsth.websocket.handler; |
| 2 | 2 | |
| 3 | -import java.text.SimpleDateFormat; | |
| 4 | -import java.util.ArrayList; | |
| 5 | -import java.util.Date; | |
| 6 | -import java.util.HashMap; | |
| 7 | -import java.util.List; | |
| 8 | -import java.util.Map; | |
| 9 | - | |
| 10 | -import org.slf4j.Logger; | |
| 11 | -import org.slf4j.LoggerFactory; | |
| 12 | -import org.springframework.beans.factory.annotation.Autowired; | |
| 13 | -import org.springframework.stereotype.Component; | |
| 14 | - | |
| 15 | 3 | import com.alibaba.fastjson.JSONObject; |
| 16 | 4 | import com.bsth.data.BasicData; |
| 17 | 5 | import com.bsth.data.LineConfigData; |
| 18 | -import com.bsth.data.schedule.DayOfSchedule; | |
| 6 | +import com.bsth.data.gpsdata.arrival.entity.SignalState; | |
| 19 | 7 | import com.bsth.entity.directive.D80; |
| 20 | 8 | import com.bsth.entity.realcontrol.ScheduleRealInfo; |
| 21 | 9 | import com.fasterxml.jackson.core.JsonProcessingException; |
| 22 | 10 | import com.fasterxml.jackson.databind.ObjectMapper; |
| 11 | +import org.slf4j.Logger; | |
| 12 | +import org.slf4j.LoggerFactory; | |
| 13 | +import org.springframework.beans.factory.annotation.Autowired; | |
| 14 | +import org.springframework.stereotype.Component; | |
| 15 | + | |
| 16 | +import java.text.SimpleDateFormat; | |
| 17 | +import java.util.*; | |
| 23 | 18 | |
| 24 | 19 | @Component |
| 25 | 20 | public class SendUtils{ |
| ... | ... | @@ -40,7 +35,7 @@ public class SendUtils{ |
| 40 | 35 | */ |
| 41 | 36 | public void sendFcsj(ScheduleRealInfo sch) { |
| 42 | 37 | //处理出站即出场的班次 |
| 43 | - connectOutSchTime(sch); | |
| 38 | + //connectOutSchTime(sch); | |
| 44 | 39 | |
| 45 | 40 | Map<String, Object> map = new HashMap<>(); |
| 46 | 41 | map.put("fn", "faChe"); |
| ... | ... | @@ -86,7 +81,7 @@ public class SendUtils{ |
| 86 | 81 | */ |
| 87 | 82 | public void sendZdsj(ScheduleRealInfo sch, ScheduleRealInfo nextSch, int finish) { |
| 88 | 83 | //处理进站即进场的班次 |
| 89 | - connectInSchTime(sch); | |
| 84 | + //connectInSchTime(sch); | |
| 90 | 85 | |
| 91 | 86 | Map<String, Object> map = new HashMap<>(); |
| 92 | 87 | map.put("fn", "zhongDian"); |
| ... | ... | @@ -103,12 +98,30 @@ public class SendUtils{ |
| 103 | 98 | logger.error("", e); |
| 104 | 99 | } |
| 105 | 100 | } |
| 101 | + | |
| 102 | + /** | |
| 103 | + * 推送班次信号状态 | |
| 104 | + * @param state | |
| 105 | + */ | |
| 106 | + public void sendSignalState(SignalState state){ | |
| 107 | + Map<String, Object> map = new HashMap<>(); | |
| 108 | + map.put("fn", "signal_state"); | |
| 109 | + map.put("data", state); | |
| 110 | + | |
| 111 | + ObjectMapper mapper = new ObjectMapper(); | |
| 112 | + | |
| 113 | + try { | |
| 114 | + socketHandler.sendMessageToLine(state.getLineCode(), mapper.writeValueAsString(map)); | |
| 115 | + } catch (Exception e) { | |
| 116 | + logger.error("", e); | |
| 117 | + } | |
| 118 | + } | |
| 106 | 119 | |
| 107 | 120 | /** |
| 108 | 121 | * |
| 109 | 122 | * @Title: shiftSchedule |
| 110 | 123 | * @Description: TODO(线路翻班通知) |
| 111 | - */ | |
| 124 | + | |
| 112 | 125 | public void shiftSchedule(String lineCode){ |
| 113 | 126 | Map<String, Object> map = new HashMap<>(); |
| 114 | 127 | map.put("fn", "systemNotice"); |
| ... | ... | @@ -124,7 +137,7 @@ public class SendUtils{ |
| 124 | 137 | logger.error("", e); |
| 125 | 138 | } |
| 126 | 139 | } |
| 127 | - | |
| 140 | + */ | |
| 128 | 141 | /** |
| 129 | 142 | * |
| 130 | 143 | * @Title: sendDirectiveToPage |
| ... | ... | @@ -157,39 +170,4 @@ public class SendUtils{ |
| 157 | 170 | list.add(sch); |
| 158 | 171 | refreshSch(list); |
| 159 | 172 | } |
| 160 | - | |
| 161 | - | |
| 162 | - //出站即出场 | |
| 163 | - public void connectOutSchTime(ScheduleRealInfo sch){ | |
| 164 | - try{ | |
| 165 | - ScheduleRealInfo twins = sch.getTwinsSch(); | |
| 166 | - if(twins != null | |
| 167 | - && lineConfigData.get(sch.getXlBm()).getOutConfig() == 2 | |
| 168 | - && twins.getBcType().equals("out")){ | |
| 169 | - | |
| 170 | - twins.setFcsjActualAll(sch.getFcsjActualTime()); | |
| 171 | - //刷新关联的出场班次 | |
| 172 | - //refreshSch(twins); | |
| 173 | - } | |
| 174 | - }catch(Exception e){ | |
| 175 | - logger.error("", e); | |
| 176 | - } | |
| 177 | - } | |
| 178 | - | |
| 179 | - //进站即出场 | |
| 180 | - public void connectInSchTime(ScheduleRealInfo sch){ | |
| 181 | - try{ | |
| 182 | - ScheduleRealInfo twins = sch.getTwinsSch(); | |
| 183 | - if(twins != null | |
| 184 | - && lineConfigData.get(sch.getXlBm()).getOutConfig() == 2 | |
| 185 | - && twins.getBcType().equals("in")){ | |
| 186 | - | |
| 187 | - twins.setZdsjActualAll(sch.getZdsjActualTime()); | |
| 188 | - //刷新关联的出场班次 | |
| 189 | - //refreshSch(twins); | |
| 190 | - } | |
| 191 | - }catch(Exception e){ | |
| 192 | - logger.error("", e); | |
| 193 | - } | |
| 194 | - } | |
| 195 | 173 | } | ... | ... |
src/main/resources/static/assets/bower_components/angular-bootstrap/ui-bootstrap-tpls.js
| ... | ... | @@ -2625,7 +2625,7 @@ angular.module('ui.bootstrap.dropdown', ['ui.bootstrap.position']) |
| 2625 | 2625 | |
| 2626 | 2626 | var closeDropdown = function(evt) { |
| 2627 | 2627 | // This method may still be called during the same mouse event that |
| 2628 | - // unbound this event handler. So check openScope before proceeding. | |
| 2628 | + // unbound this event handlers. So check openScope before proceeding. | |
| 2629 | 2629 | if (!openScope) { return; } |
| 2630 | 2630 | |
| 2631 | 2631 | if (evt && openScope.getAutoClose() === 'disabled') { return ; } |
| ... | ... | @@ -6982,7 +6982,7 @@ angular.module('ui.bootstrap.typeahead', ['ui.bootstrap.position']) |
| 6982 | 6982 | selected = false; |
| 6983 | 6983 | }); |
| 6984 | 6984 | |
| 6985 | - // Keep reference to click handler to unbind it. | |
| 6985 | + // Keep reference to click handlers to unbind it. | |
| 6986 | 6986 | var dismissClickHandler = function(evt) { |
| 6987 | 6987 | // Issue #3973 |
| 6988 | 6988 | // Firefox treats right click as a click on document |
| ... | ... | @@ -7490,7 +7490,7 @@ angular.module('ui.bootstrap.typeahead') |
| 7490 | 7490 | selected = false; |
| 7491 | 7491 | }); |
| 7492 | 7492 | |
| 7493 | - // Keep reference to click handler to unbind it. | |
| 7493 | + // Keep reference to click handlers to unbind it. | |
| 7494 | 7494 | var dismissClickHandler = function(evt) { |
| 7495 | 7495 | // Issue #3973 |
| 7496 | 7496 | // Firefox treats right click as a click on document | ... | ... |
src/main/resources/static/assets/bower_components/angular-bootstrap/ui-bootstrap.js
| ... | ... | @@ -2624,7 +2624,7 @@ angular.module('ui.bootstrap.dropdown', ['ui.bootstrap.position']) |
| 2624 | 2624 | |
| 2625 | 2625 | var closeDropdown = function(evt) { |
| 2626 | 2626 | // This method may still be called during the same mouse event that |
| 2627 | - // unbound this event handler. So check openScope before proceeding. | |
| 2627 | + // unbound this event handlers. So check openScope before proceeding. | |
| 2628 | 2628 | if (!openScope) { return; } |
| 2629 | 2629 | |
| 2630 | 2630 | if (evt && openScope.getAutoClose() === 'disabled') { return ; } |
| ... | ... | @@ -6981,7 +6981,7 @@ angular.module('ui.bootstrap.typeahead', ['ui.bootstrap.position']) |
| 6981 | 6981 | selected = false; |
| 6982 | 6982 | }); |
| 6983 | 6983 | |
| 6984 | - // Keep reference to click handler to unbind it. | |
| 6984 | + // Keep reference to click handlers to unbind it. | |
| 6985 | 6985 | var dismissClickHandler = function(evt) { |
| 6986 | 6986 | // Issue #3973 |
| 6987 | 6987 | // Firefox treats right click as a click on document |
| ... | ... | @@ -7489,7 +7489,7 @@ angular.module('ui.bootstrap.typeahead') |
| 7489 | 7489 | selected = false; |
| 7490 | 7490 | }); |
| 7491 | 7491 | |
| 7492 | - // Keep reference to click handler to unbind it. | |
| 7492 | + // Keep reference to click handlers to unbind it. | |
| 7493 | 7493 | var dismissClickHandler = function(evt) { |
| 7494 | 7494 | // Issue #3973 |
| 7495 | 7495 | // Firefox treats right click as a click on document | ... | ... |
src/main/resources/static/assets/bower_components/angular-file-upload/src/services/FileDrop.js
| ... | ... | @@ -47,7 +47,7 @@ export default (FileDirective) => { |
| 47 | 47 | getFilters() { |
| 48 | 48 | } |
| 49 | 49 | /** |
| 50 | - * Event handler | |
| 50 | + * Event handlers | |
| 51 | 51 | */ |
| 52 | 52 | onDrop(event) { |
| 53 | 53 | var transfer = this._getTransfer(event); |
| ... | ... | @@ -59,7 +59,7 @@ export default (FileDirective) => { |
| 59 | 59 | this.uploader.addToQueue(transfer.files, options, filters); |
| 60 | 60 | } |
| 61 | 61 | /** |
| 62 | - * Event handler | |
| 62 | + * Event handlers | |
| 63 | 63 | */ |
| 64 | 64 | onDragOver(event) { |
| 65 | 65 | var transfer = this._getTransfer(event); |
| ... | ... | @@ -69,7 +69,7 @@ export default (FileDirective) => { |
| 69 | 69 | forEach(this.uploader._directives.over, this._addOverClass, this); |
| 70 | 70 | } |
| 71 | 71 | /** |
| 72 | - * Event handler | |
| 72 | + * Event handlers | |
| 73 | 73 | */ |
| 74 | 74 | onDragLeave(event) { |
| 75 | 75 | if(event.currentTarget === this.element[0]) return; | ... | ... |
src/main/resources/static/assets/bower_components/angular-file-upload/src/services/FileSelect.js
src/main/resources/static/assets/bower_components/angular-file-upload/src/services/FileUploader.js
| ... | ... | @@ -526,7 +526,7 @@ export default (fileUploaderOptions, $rootScope, $http, $window, FileLikeObject, |
| 526 | 526 | // Note that if non standard 4xx or 5xx error code returned |
| 527 | 527 | // from WS then response content can be accessed without error |
| 528 | 528 | // but 'XHR' status becomes 200. In order to avoid confusion |
| 529 | - // returning response via same 'success' event handler. | |
| 529 | + // returning response via same 'success' event handlers. | |
| 530 | 530 | |
| 531 | 531 | // fixed angular.contents() for iframes |
| 532 | 532 | html = iframe[0].contentDocument.body.innerHTML; | ... | ... |
src/main/resources/static/assets/bower_components/angular-mocks/angular-mocks.js
| ... | ... | @@ -229,7 +229,7 @@ angular.mock.$ExceptionHandlerProvider = function() { |
| 229 | 229 | * mode stores an array of errors in `$exceptionHandler.errors`, to allow later |
| 230 | 230 | * assertion of them. See {@link ngMock.$log#assertEmpty assertEmpty()} and |
| 231 | 231 | * {@link ngMock.$log#reset reset()} |
| 232 | - * - `rethrow`: If any errors are passed to the handler in tests, it typically means that there | |
| 232 | + * - `rethrow`: If any errors are passed to the handlers in tests, it typically means that there | |
| 233 | 233 | * is a bug in the application or test, so this mock will make these tests fail. |
| 234 | 234 | * For any implementations that expect exceptions to be thrown, the `rethrow` mode |
| 235 | 235 | * will also maintain a log of thrown errors. | ... | ... |
src/main/resources/static/assets/bower_components/angular-touch/angular-touch.js
| ... | ... | @@ -277,10 +277,10 @@ ngTouch.directive('ngClick', ['$parse', '$timeout', '$rootElement', |
| 277 | 277 | // - element's touchstart: Starts a touch |
| 278 | 278 | // (- touchcancel ends the touch, no click follows) |
| 279 | 279 | // - element's touchend: Determines if the tap is valid (didn't move too far away, didn't hold |
| 280 | - // too long) and fires the user's tap handler. The touchend also calls preventGhostClick(). | |
| 280 | + // too long) and fires the user's tap handlers. The touchend also calls preventGhostClick(). | |
| 281 | 281 | // - preventGhostClick() removes the allowable region the global touchstart created. |
| 282 | 282 | // - The browser generates a click event. |
| 283 | - // - The global click handler catches the click, and checks whether it was in an allowable region. | |
| 283 | + // - The global click handlers catches the click, and checks whether it was in an allowable region. | |
| 284 | 284 | // - If preventGhostClick was called, the region will have been removed, the click is busted. |
| 285 | 285 | // - If the region is still there, the click proceeds normally. Therefore clicks on links and |
| 286 | 286 | // other elements without ngTap on them work normally. |
| ... | ... | @@ -313,7 +313,7 @@ ngTouch.directive('ngClick', ['$parse', '$timeout', '$rootElement', |
| 313 | 313 | return false; // No allowable region; bust it. |
| 314 | 314 | } |
| 315 | 315 | |
| 316 | - // Global click handler that prevents the click if it's in a bustable zone and preventGhostClick | |
| 316 | + // Global click handlers that prevents the click if it's in a bustable zone and preventGhostClick | |
| 317 | 317 | // was called recently. |
| 318 | 318 | function onClick(event) { |
| 319 | 319 | if (Date.now() - lastPreventedTime > PREVENT_DURATION) { |
| ... | ... | @@ -359,7 +359,7 @@ ngTouch.directive('ngClick', ['$parse', '$timeout', '$rootElement', |
| 359 | 359 | } |
| 360 | 360 | |
| 361 | 361 | |
| 362 | - // Global touchstart handler that creates an allowable region for a click event. | |
| 362 | + // Global touchstart handlers that creates an allowable region for a click event. | |
| 363 | 363 | // This allowable region can be removed by preventGhostClick if we want to bust it. |
| 364 | 364 | function onTouchStart(event) { |
| 365 | 365 | var touches = event.touches && event.touches.length ? event.touches : [event]; |
| ... | ... | @@ -466,11 +466,11 @@ ngTouch.directive('ngClick', ['$parse', '$timeout', '$rootElement', |
| 466 | 466 | // something else nearby. |
| 467 | 467 | element.onclick = function(event) { }; |
| 468 | 468 | |
| 469 | - // Actual click handler. | |
| 469 | + // Actual click handlers. | |
| 470 | 470 | // There are three different kinds of clicks, only two of which reach this point. |
| 471 | 471 | // - On desktop browsers without touch events, their clicks will always come here. |
| 472 | 472 | // - On mobile browsers, the simulated "fast" click will call this. |
| 473 | - // - But the browser's follow-up slow click will be "busted" before it reaches this handler. | |
| 473 | + // - But the browser's follow-up slow click will be "busted" before it reaches this handlers. | |
| 474 | 474 | // Therefore it's safe to use this directive on both mobile and desktop. |
| 475 | 475 | element.on('click', function(event, touchend) { |
| 476 | 476 | scope.$apply(function() { | ... | ... |
src/main/resources/static/assets/bower_components/angular-ui-router/README.md
| ... | ... | @@ -81,7 +81,7 @@ The majority of UI-Router's power is in its ability to nest states & views. |
| 81 | 81 | <div ui-view></div> |
| 82 | 82 | <!-- We'll also add some navigation: --> |
| 83 | 83 | <a ui-sref="state1">State 1</a> |
| 84 | - <a ui-sref="state2">State 2</a> | |
| 84 | + <a ui-sref="signalState">State 2</a> | |
| 85 | 85 | </body> |
| 86 | 86 | ``` |
| 87 | 87 | |
| ... | ... | @@ -96,10 +96,10 @@ The majority of UI-Router's power is in its ability to nest states & views. |
| 96 | 96 | <div ui-view></div> |
| 97 | 97 | ``` |
| 98 | 98 | ```html |
| 99 | -<!-- partials/state2.html --> | |
| 99 | +<!-- partials/signalState.html --> | |
| 100 | 100 | <h1>State 2</h1> |
| 101 | 101 | <hr/> |
| 102 | -<a ui-sref="state2.list">Show List</a> | |
| 102 | +<a ui-sref="signalState.list">Show List</a> | |
| 103 | 103 | <div ui-view></div> |
| 104 | 104 | ``` |
| 105 | 105 | |
| ... | ... | @@ -116,7 +116,7 @@ The majority of UI-Router's power is in its ability to nest states & views. |
| 116 | 116 | |
| 117 | 117 | > |
| 118 | 118 | ```html |
| 119 | -<!-- partials/state2.list.html --> | |
| 119 | +<!-- partials/signalState.list.html --> | |
| 120 | 120 | <h3>List of State 2 Things</h3> |
| 121 | 121 | <ul> |
| 122 | 122 | <li ng-repeat="thing in things">{{ thing }}</li> |
| ... | ... | @@ -146,13 +146,13 @@ myApp.config(function($stateProvider, $urlRouterProvider) { |
| 146 | 146 | $scope.items = ["A", "List", "Of", "Items"]; |
| 147 | 147 | } |
| 148 | 148 | }) |
| 149 | - .state('state2', { | |
| 150 | - url: "/state2", | |
| 151 | - templateUrl: "partials/state2.html" | |
| 149 | + .state('signalState', { | |
| 150 | + url: "/signalState", | |
| 151 | + templateUrl: "partials/signalState.html" | |
| 152 | 152 | }) |
| 153 | - .state('state2.list', { | |
| 153 | + .state('signalState.list', { | |
| 154 | 154 | url: "/list", |
| 155 | - templateUrl: "partials/state2.list.html", | |
| 155 | + templateUrl: "partials/signalState.list.html", | |
| 156 | 156 | controller: function($scope) { |
| 157 | 157 | $scope.things = ["A", "Set", "Of", "Things"]; |
| 158 | 158 | } | ... | ... |
src/main/resources/static/assets/bower_components/angular-ui-router/release/angular-ui-router.js
| ... | ... | @@ -1843,14 +1843,14 @@ function $UrlRouterProvider( $locationProvider, $urlMatcherFactory) { |
| 1843 | 1843 | * @methodOf ui.router.router.$urlRouterProvider |
| 1844 | 1844 | * |
| 1845 | 1845 | * @description |
| 1846 | - * Registers a handler for a given url matching. if handle is a string, it is | |
| 1846 | + * Registers a handlers for a given url matching. if handle is a string, it is | |
| 1847 | 1847 | * treated as a redirect, and is interpolated according to the syntax of match |
| 1848 | 1848 | * (i.e. like `String.replace()` for `RegExp`, or like a `UrlMatcher` pattern otherwise). |
| 1849 | 1849 | * |
| 1850 | - * If the handler is a function, it is injectable. It gets invoked if `$location` | |
| 1850 | + * If the handlers is a function, it is injectable. It gets invoked if `$location` | |
| 1851 | 1851 | * matches. You have the option of inject the match object as `$match`. |
| 1852 | 1852 | * |
| 1853 | - * The handler can return | |
| 1853 | + * The handlers can return | |
| 1854 | 1854 | * |
| 1855 | 1855 | * - **falsy** to indicate that the rule didn't match after all, then `$urlRouter` |
| 1856 | 1856 | * will continue trying to find another one that matches. |
| ... | ... | @@ -1879,7 +1879,7 @@ function $UrlRouterProvider( $locationProvider, $urlMatcherFactory) { |
| 1879 | 1879 | if (isString(what)) what = $urlMatcherFactory.compile(what); |
| 1880 | 1880 | |
| 1881 | 1881 | if (!handlerIsString && !isFunction(handler) && !isArray(handler)) |
| 1882 | - throw new Error("invalid 'handler' in when()"); | |
| 1882 | + throw new Error("invalid 'handlers' in when()"); | |
| 1883 | 1883 | |
| 1884 | 1884 | var strategies = { |
| 1885 | 1885 | matcher: function (what, handler) { |
| ... | ... | @@ -1928,7 +1928,7 @@ function $UrlRouterProvider( $locationProvider, $urlMatcherFactory) { |
| 1928 | 1928 | * If you wish to customize the behavior of syncing the URL (for example, if you wish to |
| 1929 | 1929 | * defer a transition but maintain the current URL), call this method at configuration time. |
| 1930 | 1930 | * Then, at run time, call `$urlRouter.listen()` after you have configured your own |
| 1931 | - * `$locationChangeSuccess` event handler. | |
| 1931 | + * `$locationChangeSuccess` event handlers. | |
| 1932 | 1932 | * |
| 1933 | 1933 | * @example |
| 1934 | 1934 | * <pre> |
| ... | ... | @@ -1947,7 +1947,7 @@ function $UrlRouterProvider( $locationProvider, $urlMatcherFactory) { |
| 1947 | 1947 | * // UserService is an example service for managing user state |
| 1948 | 1948 | * if (UserService.isLoggedIn()) return; |
| 1949 | 1949 | * |
| 1950 | - * // Prevent $urlRouter's default handler from firing | |
| 1950 | + * // Prevent $urlRouter's default handlers from firing | |
| 1951 | 1951 | * e.preventDefault(); |
| 1952 | 1952 | * |
| 1953 | 1953 | * UserService.handleLogin().then(function() { |
| ... | ... | @@ -2914,7 +2914,7 @@ function $StateProvider( $urlRouterProvider, $urlMatcherFactory) { |
| 2914 | 2914 | return null; |
| 2915 | 2915 | } |
| 2916 | 2916 | |
| 2917 | - // Allow the handler to return a promise to defer state lookup retry | |
| 2917 | + // Allow the handlers to return a promise to defer state lookup retry | |
| 2918 | 2918 | if (options.$retry) { |
| 2919 | 2919 | $urlRouter.update(); |
| 2920 | 2920 | return TransitionFailed; | ... | ... |
src/main/resources/static/assets/bower_components/angular-ui-router/release/angular-ui-router.min.js
| ... | ... | @@ -4,4 +4,4 @@ |
| 4 | 4 | * @link http://angular-ui.github.com/ |
| 5 | 5 | * @license MIT License, http://www.opensource.org/licenses/MIT |
| 6 | 6 | */ |
| 7 | -"undefined"!=typeof module&&"undefined"!=typeof exports&&module.exports===exports&&(module.exports="ui.router"),function(a,b,c){"use strict";function d(a,b){return N(new(N(function(){},{prototype:a})),b)}function e(a){return M(arguments,function(b){b!==a&&M(b,function(b,c){a.hasOwnProperty(c)||(a[c]=b)})}),a}function f(a,b){var c=[];for(var d in a.path){if(a.path[d]!==b.path[d])break;c.push(a.path[d])}return c}function g(a){if(Object.keys)return Object.keys(a);var b=[];return M(a,function(a,c){b.push(c)}),b}function h(a,b){if(Array.prototype.indexOf)return a.indexOf(b,Number(arguments[2])||0);var c=a.length>>>0,d=Number(arguments[2])||0;for(d=0>d?Math.ceil(d):Math.floor(d),0>d&&(d+=c);c>d;d++)if(d in a&&a[d]===b)return d;return-1}function i(a,b,c,d){var e,i=f(c,d),j={},k=[];for(var l in i)if(i[l].params&&(e=g(i[l].params),e.length))for(var m in e)h(k,e[m])>=0||(k.push(e[m]),j[e[m]]=a[e[m]]);return N({},j,b)}function j(a,b,c){if(!c){c=[];for(var d in a)c.push(d)}for(var e=0;e<c.length;e++){var f=c[e];if(a[f]!=b[f])return!1}return!0}function k(a,b){var c={};return M(a,function(a){c[a]=b[a]}),c}function l(a){var b={},c=Array.prototype.concat.apply(Array.prototype,Array.prototype.slice.call(arguments,1));return M(c,function(c){c in a&&(b[c]=a[c])}),b}function m(a){var b={},c=Array.prototype.concat.apply(Array.prototype,Array.prototype.slice.call(arguments,1));for(var d in a)-1==h(c,d)&&(b[d]=a[d]);return b}function n(a,b){var c=L(a),d=c?[]:{};return M(a,function(a,e){b(a,e)&&(d[c?d.length:e]=a)}),d}function o(a,b){var c=L(a)?[]:{};return M(a,function(a,d){c[d]=b(a,d)}),c}function p(a,b){var d=1,f=2,i={},j=[],k=i,l=N(a.when(i),{$$promises:i,$$values:i});this.study=function(i){function n(a,c){if(s[c]!==f){if(r.push(c),s[c]===d)throw r.splice(0,h(r,c)),new Error("Cyclic dependency: "+r.join(" -> "));if(s[c]=d,J(a))q.push(c,[function(){return b.get(a)}],j);else{var e=b.annotate(a);M(e,function(a){a!==c&&i.hasOwnProperty(a)&&n(i[a],a)}),q.push(c,a,e)}r.pop(),s[c]=f}}function o(a){return K(a)&&a.then&&a.$$promises}if(!K(i))throw new Error("'invocables' must be an object");var p=g(i||{}),q=[],r=[],s={};return M(i,n),i=r=s=null,function(d,f,g){function h(){--u||(v||e(t,f.$$values),r.$$values=t,r.$$promises=r.$$promises||!0,delete r.$$inheritedValues,n.resolve(t))}function i(a){r.$$failure=a,n.reject(a)}function j(c,e,f){function j(a){l.reject(a),i(a)}function k(){if(!H(r.$$failure))try{l.resolve(b.invoke(e,g,t)),l.promise.then(function(a){t[c]=a,h()},j)}catch(a){j(a)}}var l=a.defer(),m=0;M(f,function(a){s.hasOwnProperty(a)&&!d.hasOwnProperty(a)&&(m++,s[a].then(function(b){t[a]=b,--m||k()},j))}),m||k(),s[c]=l.promise}if(o(d)&&g===c&&(g=f,f=d,d=null),d){if(!K(d))throw new Error("'locals' must be an object")}else d=k;if(f){if(!o(f))throw new Error("'parent' must be a promise returned by $resolve.resolve()")}else f=l;var n=a.defer(),r=n.promise,s=r.$$promises={},t=N({},d),u=1+q.length/3,v=!1;if(H(f.$$failure))return i(f.$$failure),r;f.$$inheritedValues&&e(t,m(f.$$inheritedValues,p)),N(s,f.$$promises),f.$$values?(v=e(t,m(f.$$values,p)),r.$$inheritedValues=m(f.$$values,p),h()):(f.$$inheritedValues&&(r.$$inheritedValues=m(f.$$inheritedValues,p)),f.then(h,i));for(var w=0,x=q.length;x>w;w+=3)d.hasOwnProperty(q[w])?h():j(q[w],q[w+1],q[w+2]);return r}},this.resolve=function(a,b,c,d){return this.study(a)(b,c,d)}}function q(a,b,c){this.fromConfig=function(a,b,c){return H(a.template)?this.fromString(a.template,b):H(a.templateUrl)?this.fromUrl(a.templateUrl,b):H(a.templateProvider)?this.fromProvider(a.templateProvider,b,c):null},this.fromString=function(a,b){return I(a)?a(b):a},this.fromUrl=function(c,d){return I(c)&&(c=c(d)),null==c?null:a.get(c,{cache:b,headers:{Accept:"text/html"}}).then(function(a){return a.data})},this.fromProvider=function(a,b,d){return c.invoke(a,null,d||{params:b})}}function r(a,b,e){function f(b,c,d,e){if(q.push(b),o[b])return o[b];if(!/^\w+(-+\w+)*(?:\[\])?$/.test(b))throw new Error("Invalid parameter name '"+b+"' in pattern '"+a+"'");if(p[b])throw new Error("Duplicate parameter name '"+b+"' in pattern '"+a+"'");return p[b]=new P.Param(b,c,d,e),p[b]}function g(a,b,c,d){var e=["",""],f=a.replace(/[\\\[\]\^$*+?.()|{}]/g,"\\$&");if(!b)return f;switch(c){case!1:e=["(",")"+(d?"?":"")];break;case!0:e=["?(",")?"];break;default:e=["("+c+"|",")?"]}return f+e[0]+b+e[1]}function h(e,f){var g,h,i,j,k;return g=e[2]||e[3],k=b.params[g],i=a.substring(m,e.index),h=f?e[4]:e[4]||("*"==e[1]?".*":null),j=P.type(h||"string")||d(P.type("string"),{pattern:new RegExp(h,b.caseInsensitive?"i":c)}),{id:g,regexp:h,segment:i,type:j,cfg:k}}b=N({params:{}},K(b)?b:{});var i,j=/([:*])([\w\[\]]+)|\{([\w\[\]]+)(?:\:((?:[^{}\\]+|\\.|\{(?:[^{}\\]+|\\.)*\})+))?\}/g,k=/([:]?)([\w\[\]-]+)|\{([\w\[\]-]+)(?:\:((?:[^{}\\]+|\\.|\{(?:[^{}\\]+|\\.)*\})+))?\}/g,l="^",m=0,n=this.segments=[],o=e?e.params:{},p=this.params=e?e.params.$$new():new P.ParamSet,q=[];this.source=a;for(var r,s,t;(i=j.exec(a))&&(r=h(i,!1),!(r.segment.indexOf("?")>=0));)s=f(r.id,r.type,r.cfg,"path"),l+=g(r.segment,s.type.pattern.source,s.squash,s.isOptional),n.push(r.segment),m=j.lastIndex;t=a.substring(m);var u=t.indexOf("?");if(u>=0){var v=this.sourceSearch=t.substring(u);if(t=t.substring(0,u),this.sourcePath=a.substring(0,m+u),v.length>0)for(m=0;i=k.exec(v);)r=h(i,!0),s=f(r.id,r.type,r.cfg,"search"),m=j.lastIndex}else this.sourcePath=a,this.sourceSearch="";l+=g(t)+(b.strict===!1?"/?":"")+"$",n.push(t),this.regexp=new RegExp(l,b.caseInsensitive?"i":c),this.prefix=n[0],this.$$paramNames=q}function s(a){N(this,a)}function t(){function a(a){return null!=a?a.toString().replace(/\//g,"%2F"):a}function e(a){return null!=a?a.toString().replace(/%2F/g,"/"):a}function f(){return{strict:p,caseInsensitive:m}}function i(a){return I(a)||L(a)&&I(a[a.length-1])}function j(){for(;w.length;){var a=w.shift();if(a.pattern)throw new Error("You cannot override a type's .pattern at runtime.");b.extend(u[a.name],l.invoke(a.def))}}function k(a){N(this,a||{})}P=this;var l,m=!1,p=!0,q=!1,u={},v=!0,w=[],x={string:{encode:a,decode:e,is:function(a){return null==a||!H(a)||"string"==typeof a},pattern:/[^/]*/},"int":{encode:a,decode:function(a){return parseInt(a,10)},is:function(a){return H(a)&&this.decode(a.toString())===a},pattern:/\d+/},bool:{encode:function(a){return a?1:0},decode:function(a){return 0!==parseInt(a,10)},is:function(a){return a===!0||a===!1},pattern:/0|1/},date:{encode:function(a){return this.is(a)?[a.getFullYear(),("0"+(a.getMonth()+1)).slice(-2),("0"+a.getDate()).slice(-2)].join("-"):c},decode:function(a){if(this.is(a))return a;var b=this.capture.exec(a);return b?new Date(b[1],b[2]-1,b[3]):c},is:function(a){return a instanceof Date&&!isNaN(a.valueOf())},equals:function(a,b){return this.is(a)&&this.is(b)&&a.toISOString()===b.toISOString()},pattern:/[0-9]{4}-(?:0[1-9]|1[0-2])-(?:0[1-9]|[1-2][0-9]|3[0-1])/,capture:/([0-9]{4})-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])/},json:{encode:b.toJson,decode:b.fromJson,is:b.isObject,equals:b.equals,pattern:/[^/]*/},any:{encode:b.identity,decode:b.identity,equals:b.equals,pattern:/.*/}};t.$$getDefaultValue=function(a){if(!i(a.value))return a.value;if(!l)throw new Error("Injectable functions cannot be called at configuration time");return l.invoke(a.value)},this.caseInsensitive=function(a){return H(a)&&(m=a),m},this.strictMode=function(a){return H(a)&&(p=a),p},this.defaultSquashPolicy=function(a){if(!H(a))return q;if(a!==!0&&a!==!1&&!J(a))throw new Error("Invalid squash policy: "+a+". Valid policies: false, true, arbitrary-string");return q=a,a},this.compile=function(a,b){return new r(a,N(f(),b))},this.isMatcher=function(a){if(!K(a))return!1;var b=!0;return M(r.prototype,function(c,d){I(c)&&(b=b&&H(a[d])&&I(a[d]))}),b},this.type=function(a,b,c){if(!H(b))return u[a];if(u.hasOwnProperty(a))throw new Error("A type named '"+a+"' has already been defined.");return u[a]=new s(N({name:a},b)),c&&(w.push({name:a,def:c}),v||j()),this},M(x,function(a,b){u[b]=new s(N({name:b},a))}),u=d(u,{}),this.$get=["$injector",function(a){return l=a,v=!1,j(),M(x,function(a,b){u[b]||(u[b]=new s(a))}),this}],this.Param=function(a,b,d,e){function f(a){var b=K(a)?g(a):[],c=-1===h(b,"value")&&-1===h(b,"type")&&-1===h(b,"squash")&&-1===h(b,"array");return c&&(a={value:a}),a.$$fn=i(a.value)?a.value:function(){return a.value},a}function j(b,c,d){if(b.type&&c)throw new Error("Param '"+a+"' has two type configurations.");return c?c:b.type?b.type instanceof s?b.type:new s(b.type):"config"===d?u.any:u.string}function k(){var b={array:"search"===e?"auto":!1},c=a.match(/\[\]$/)?{array:!0}:{};return N(b,c,d).array}function m(a,b){var c=a.squash;if(!b||c===!1)return!1;if(!H(c)||null==c)return q;if(c===!0||J(c))return c;throw new Error("Invalid squash policy: '"+c+"'. Valid policies: false, true, or arbitrary string")}function p(a,b,d,e){var f,g,i=[{from:"",to:d||b?c:""},{from:null,to:d||b?c:""}];return f=L(a.replace)?a.replace:[],J(e)&&f.push({from:e,to:c}),g=o(f,function(a){return a.from}),n(i,function(a){return-1===h(g,a.from)}).concat(f)}function r(){if(!l)throw new Error("Injectable functions cannot be called at configuration time");var a=l.invoke(d.$$fn);if(null!==a&&a!==c&&!w.type.is(a))throw new Error("Default value ("+a+") for parameter '"+w.id+"' is not an instance of Type ("+w.type.name+")");return a}function t(a){function b(a){return function(b){return b.from===a}}function c(a){var c=o(n(w.replace,b(a)),function(a){return a.to});return c.length?c[0]:a}return a=c(a),H(a)?w.type.$normalize(a):r()}function v(){return"{Param:"+a+" "+b+" squash: '"+z+"' optional: "+y+"}"}var w=this;d=f(d),b=j(d,b,e);var x=k();b=x?b.$asArray(x,"search"===e):b,"string"!==b.name||x||"path"!==e||d.value!==c||(d.value="");var y=d.value!==c,z=m(d,y),A=p(d,x,y,z);N(this,{id:a,type:b,location:e,array:x,squash:z,replace:A,isOptional:y,value:t,dynamic:c,config:d,toString:v})},k.prototype={$$new:function(){return d(this,N(new k,{$$parent:this}))},$$keys:function(){for(var a=[],b=[],c=this,d=g(k.prototype);c;)b.push(c),c=c.$$parent;return b.reverse(),M(b,function(b){M(g(b),function(b){-1===h(a,b)&&-1===h(d,b)&&a.push(b)})}),a},$$values:function(a){var b={},c=this;return M(c.$$keys(),function(d){b[d]=c[d].value(a&&a[d])}),b},$$equals:function(a,b){var c=!0,d=this;return M(d.$$keys(),function(e){var f=a&&a[e],g=b&&b[e];d[e].type.equals(f,g)||(c=!1)}),c},$$validates:function(a){var d,e,f,g,h,i=this.$$keys();for(d=0;d<i.length&&(e=this[i[d]],f=a[i[d]],f!==c&&null!==f||!e.isOptional);d++){if(g=e.type.$normalize(f),!e.type.is(g))return!1;if(h=e.type.encode(g),b.isString(h)&&!e.type.pattern.exec(h))return!1}return!0},$$parent:c},this.ParamSet=k}function u(a,d){function e(a){var b=/^\^((?:\\[^a-zA-Z0-9]|[^\\\[\]\^$*+?.()|{}]+)*)/.exec(a.source);return null!=b?b[1].replace(/\\(.)/g,"$1"):""}function f(a,b){return a.replace(/\$(\$|\d{1,2})/,function(a,c){return b["$"===c?0:Number(c)]})}function g(a,b,c){if(!c)return!1;var d=a.invoke(b,b,{$match:c});return H(d)?d:!0}function h(d,e,f,g){function h(a,b,c){return"/"===p?a:b?p.slice(0,-1)+a:c?p.slice(1)+a:a}function m(a){function b(a){var b=a(f,d);return b?(J(b)&&d.replace().url(b),!0):!1}if(!a||!a.defaultPrevented){o&&d.url()===o;o=c;var e,g=j.length;for(e=0;g>e;e++)if(b(j[e]))return;k&&b(k)}}function n(){return i=i||e.$on("$locationChangeSuccess",m)}var o,p=g.baseHref(),q=d.url();return l||n(),{sync:function(){m()},listen:function(){return n()},update:function(a){return a?void(q=d.url()):void(d.url()!==q&&(d.url(q),d.replace()))},push:function(a,b,e){var f=a.format(b||{});null!==f&&b&&b["#"]&&(f+="#"+b["#"]),d.url(f),o=e&&e.$$avoidResync?d.url():c,e&&e.replace&&d.replace()},href:function(c,e,f){if(!c.validates(e))return null;var g=a.html5Mode();b.isObject(g)&&(g=g.enabled);var i=c.format(e);if(f=f||{},g||null===i||(i="#"+a.hashPrefix()+i),null!==i&&e&&e["#"]&&(i+="#"+e["#"]),i=h(i,g,f.absolute),!f.absolute||!i)return i;var j=!g&&i?"/":"",k=d.port();return k=80===k||443===k?"":":"+k,[d.protocol(),"://",d.host(),k,j,i].join("")}}}var i,j=[],k=null,l=!1;this.rule=function(a){if(!I(a))throw new Error("'rule' must be a function");return j.push(a),this},this.otherwise=function(a){if(J(a)){var b=a;a=function(){return b}}else if(!I(a))throw new Error("'rule' must be a function");return k=a,this},this.when=function(a,b){var c,h=J(b);if(J(a)&&(a=d.compile(a)),!h&&!I(b)&&!L(b))throw new Error("invalid 'handler' in when()");var i={matcher:function(a,b){return h&&(c=d.compile(b),b=["$match",function(a){return c.format(a)}]),N(function(c,d){return g(c,b,a.exec(d.path(),d.search()))},{prefix:J(a.prefix)?a.prefix:""})},regex:function(a,b){if(a.global||a.sticky)throw new Error("when() RegExp must not be global or sticky");return h&&(c=b,b=["$match",function(a){return f(c,a)}]),N(function(c,d){return g(c,b,a.exec(d.path()))},{prefix:e(a)})}},j={matcher:d.isMatcher(a),regex:a instanceof RegExp};for(var k in j)if(j[k])return this.rule(i[k](a,b));throw new Error("invalid 'what' in when()")},this.deferIntercept=function(a){a===c&&(a=!0),l=a},this.$get=h,h.$inject=["$location","$rootScope","$injector","$browser"]}function v(a,e){function f(a){return 0===a.indexOf(".")||0===a.indexOf("^")}function m(a,b){if(!a)return c;var d=J(a),e=d?a:a.name,g=f(e);if(g){if(!b)throw new Error("No reference point given for path '"+e+"'");b=m(b);for(var h=e.split("."),i=0,j=h.length,k=b;j>i;i++)if(""!==h[i]||0!==i){if("^"!==h[i])break;if(!k.parent)throw new Error("Path '"+e+"' not valid for state '"+b.name+"'");k=k.parent}else k=b;h=h.slice(i).join("."),e=k.name+(k.name&&h?".":"")+h}var l=z[e];return!l||!d&&(d||l!==a&&l.self!==a)?c:l}function n(a,b){A[a]||(A[a]=[]),A[a].push(b)}function p(a){for(var b=A[a]||[];b.length;)q(b.shift())}function q(b){b=d(b,{self:b,resolve:b.resolve||{},toString:function(){return this.name}});var c=b.name;if(!J(c)||c.indexOf("@")>=0)throw new Error("State must have a valid name");if(z.hasOwnProperty(c))throw new Error("State '"+c+"'' is already defined");var e=-1!==c.indexOf(".")?c.substring(0,c.lastIndexOf(".")):J(b.parent)?b.parent:K(b.parent)&&J(b.parent.name)?b.parent.name:"";if(e&&!z[e])return n(e,b.self);for(var f in C)I(C[f])&&(b[f]=C[f](b,C.$delegates[f]));return z[c]=b,!b[B]&&b.url&&a.when(b.url,["$match","$stateParams",function(a,c){y.$current.navigable==b&&j(a,c)||y.transitionTo(b,a,{inherit:!0,location:!1})}]),p(c),b}function r(a){return a.indexOf("*")>-1}function s(a){for(var b=a.split("."),c=y.$current.name.split("."),d=0,e=b.length;e>d;d++)"*"===b[d]&&(c[d]="*");return"**"===b[0]&&(c=c.slice(h(c,b[1])),c.unshift("**")),"**"===b[b.length-1]&&(c.splice(h(c,b[b.length-2])+1,Number.MAX_VALUE),c.push("**")),b.length!=c.length?!1:c.join("")===b.join("")}function t(a,b){return J(a)&&!H(b)?C[a]:I(b)&&J(a)?(C[a]&&!C.$delegates[a]&&(C.$delegates[a]=C[a]),C[a]=b,this):this}function u(a,b){return K(a)?b=a:b.name=a,q(b),this}function v(a,e,f,h,l,n,p,q,t){function u(b,c,d,f){var g=a.$broadcast("$stateNotFound",b,c,d);if(g.defaultPrevented)return p.update(),D;if(!g.retry)return null;if(f.$retry)return p.update(),E;var h=y.transition=e.when(g.retry);return h.then(function(){return h!==y.transition?A:(b.options.$retry=!0,y.transitionTo(b.to,b.toParams,b.options))},function(){return D}),p.update(),h}function v(a,c,d,g,i,j){function m(){var c=[];return M(a.views,function(d,e){var g=d.resolve&&d.resolve!==a.resolve?d.resolve:{};g.$template=[function(){return f.load(e,{view:d,locals:i.globals,params:n,notify:j.notify})||""}],c.push(l.resolve(g,i.globals,i.resolve,a).then(function(c){if(I(d.controllerProvider)||L(d.controllerProvider)){var f=b.extend({},g,i.globals);c.$$controller=h.invoke(d.controllerProvider,null,f)}else c.$$controller=d.controller;c.$$state=a,c.$$controllerAs=d.controllerAs,i[e]=c}))}),e.all(c).then(function(){return i.globals})}var n=d?c:k(a.params.$$keys(),c),o={$stateParams:n};i.resolve=l.resolve(a.resolve,o,i.resolve,a);var p=[i.resolve.then(function(a){i.globals=a})];return g&&p.push(g),e.all(p).then(m).then(function(a){return i})}var A=e.reject(new Error("transition superseded")),C=e.reject(new Error("transition prevented")),D=e.reject(new Error("transition aborted")),E=e.reject(new Error("transition failed"));return x.locals={resolve:null,globals:{$stateParams:{}}},y={params:{},current:x.self,$current:x,transition:null},y.reload=function(a){return y.transitionTo(y.current,n,{reload:a||!0,inherit:!1,notify:!0})},y.go=function(a,b,c){return y.transitionTo(a,b,N({inherit:!0,relative:y.$current},c))},y.transitionTo=function(b,c,f){c=c||{},f=N({location:!0,inherit:!1,relative:null,notify:!0,reload:!1,$retry:!1},f||{});var g,j=y.$current,l=y.params,o=j.path,q=m(b,f.relative),r=c["#"];if(!H(q)){var s={to:b,toParams:c,options:f},t=u(s,j.self,l,f);if(t)return t;if(b=s.to,c=s.toParams,f=s.options,q=m(b,f.relative),!H(q)){if(!f.relative)throw new Error("No such state '"+b+"'");throw new Error("Could not resolve '"+b+"' from state '"+f.relative+"'")}}if(q[B])throw new Error("Cannot transition to abstract state '"+b+"'");if(f.inherit&&(c=i(n,c||{},y.$current,q)),!q.params.$$validates(c))return E;c=q.params.$$values(c),b=q;var z=b.path,D=0,F=z[D],G=x.locals,I=[];if(f.reload){if(J(f.reload)||K(f.reload)){if(K(f.reload)&&!f.reload.name)throw new Error("Invalid reload state object");var L=f.reload===!0?o[0]:m(f.reload);if(f.reload&&!L)throw new Error("No such reload state '"+(J(f.reload)?f.reload:f.reload.name)+"'");for(;F&&F===o[D]&&F!==L;)G=I[D]=F.locals,D++,F=z[D]}}else for(;F&&F===o[D]&&F.ownParams.$$equals(c,l);)G=I[D]=F.locals,D++,F=z[D];if(w(b,c,j,l,G,f))return r&&(c["#"]=r),y.params=c,O(y.params,n),f.location&&b.navigable&&b.navigable.url&&(p.push(b.navigable.url,c,{$$avoidResync:!0,replace:"replace"===f.location}),p.update(!0)),y.transition=null,e.when(y.current);if(c=k(b.params.$$keys(),c||{}),f.notify&&a.$broadcast("$stateChangeStart",b.self,c,j.self,l).defaultPrevented)return a.$broadcast("$stateChangeCancel",b.self,c,j.self,l),p.update(),C;for(var M=e.when(G),P=D;P<z.length;P++,F=z[P])G=I[P]=d(G),M=v(F,c,F===b,M,G,f);var Q=y.transition=M.then(function(){var d,e,g;if(y.transition!==Q)return A;for(d=o.length-1;d>=D;d--)g=o[d],g.self.onExit&&h.invoke(g.self.onExit,g.self,g.locals.globals),g.locals=null;for(d=D;d<z.length;d++)e=z[d],e.locals=I[d],e.self.onEnter&&h.invoke(e.self.onEnter,e.self,e.locals.globals);return r&&(c["#"]=r),y.transition!==Q?A:(y.$current=b,y.current=b.self,y.params=c,O(y.params,n),y.transition=null,f.location&&b.navigable&&p.push(b.navigable.url,b.navigable.locals.globals.$stateParams,{$$avoidResync:!0,replace:"replace"===f.location}),f.notify&&a.$broadcast("$stateChangeSuccess",b.self,c,j.self,l),p.update(!0),y.current)},function(d){return y.transition!==Q?A:(y.transition=null,g=a.$broadcast("$stateChangeError",b.self,c,j.self,l,d),g.defaultPrevented||p.update(),e.reject(d))});return Q},y.is=function(a,b,d){d=N({relative:y.$current},d||{});var e=m(a,d.relative);return H(e)?y.$current!==e?!1:b?j(e.params.$$values(b),n):!0:c},y.includes=function(a,b,d){if(d=N({relative:y.$current},d||{}),J(a)&&r(a)){if(!s(a))return!1;a=y.$current.name}var e=m(a,d.relative);return H(e)?H(y.$current.includes[e.name])?b?j(e.params.$$values(b),n,g(b)):!0:!1:c},y.href=function(a,b,d){d=N({lossy:!0,inherit:!0,absolute:!1,relative:y.$current},d||{});var e=m(a,d.relative);if(!H(e))return null;d.inherit&&(b=i(n,b||{},y.$current,e));var f=e&&d.lossy?e.navigable:e;return f&&f.url!==c&&null!==f.url?p.href(f.url,k(e.params.$$keys().concat("#"),b||{}),{absolute:d.absolute}):null},y.get=function(a,b){if(0===arguments.length)return o(g(z),function(a){return z[a].self});var c=m(a,b||y.$current);return c&&c.self?c.self:null},y}function w(a,b,c,d,e,f){function g(a,b,c){function d(b){return"search"!=a.params[b].location}var e=a.params.$$keys().filter(d),f=l.apply({},[a.params].concat(e)),g=new P.ParamSet(f);return g.$$equals(b,c)}return!f.reload&&a===c&&(e===c.locals||a.self.reloadOnSearch===!1&&g(c,d,b))?!0:void 0}var x,y,z={},A={},B="abstract",C={parent:function(a){if(H(a.parent)&&a.parent)return m(a.parent);var b=/^(.+)\.[^.]+$/.exec(a.name);return b?m(b[1]):x},data:function(a){return a.parent&&a.parent.data&&(a.data=a.self.data=N({},a.parent.data,a.data)),a.data},url:function(a){var b=a.url,c={params:a.params||{}};if(J(b))return"^"==b.charAt(0)?e.compile(b.substring(1),c):(a.parent.navigable||x).url.concat(b,c);if(!b||e.isMatcher(b))return b;throw new Error("Invalid url '"+b+"' in state '"+a+"'")},navigable:function(a){return a.url?a:a.parent?a.parent.navigable:null},ownParams:function(a){var b=a.url&&a.url.params||new P.ParamSet;return M(a.params||{},function(a,c){b[c]||(b[c]=new P.Param(c,null,a,"config"))}),b},params:function(a){return a.parent&&a.parent.params?N(a.parent.params.$$new(),a.ownParams):new P.ParamSet},views:function(a){var b={};return M(H(a.views)?a.views:{"":a},function(c,d){d.indexOf("@")<0&&(d+="@"+a.parent.name),b[d]=c}),b},path:function(a){return a.parent?a.parent.path.concat(a):[]},includes:function(a){var b=a.parent?N({},a.parent.includes):{};return b[a.name]=!0,b},$delegates:{}};x=q({name:"",url:"^",views:null,"abstract":!0}),x.navigable=null,this.decorator=t,this.state=u,this.$get=v,v.$inject=["$rootScope","$q","$view","$injector","$resolve","$stateParams","$urlRouter","$location","$urlMatcherFactory"]}function w(){function a(a,b){return{load:function(c,d){var e,f={template:null,controller:null,view:null,locals:null,notify:!0,async:!0,params:{}};return d=N(f,d),d.view&&(e=b.fromConfig(d.view,d.params,d.locals)),e&&d.notify&&a.$broadcast("$viewContentLoading",d),e}}}this.$get=a,a.$inject=["$rootScope","$templateFactory"]}function x(){var a=!1;this.useAnchorScroll=function(){a=!0},this.$get=["$anchorScroll","$timeout",function(b,c){return a?b:function(a){return c(function(){a[0].scrollIntoView()},0,!1)}}]}function y(a,c,d,e){function f(){return c.has?function(a){return c.has(a)?c.get(a):null}:function(a){try{return c.get(a)}catch(b){return null}}}function g(a,b){var c=function(){return{enter:function(a,b,c){b.after(a),c()},leave:function(a,b){a.remove(),b()}}};if(j)return{enter:function(a,b,c){var d=j.enter(a,null,b,c);d&&d.then&&d.then(c)},leave:function(a,b){var c=j.leave(a,b);c&&c.then&&c.then(b)}};if(i){var d=i&&i(b,a);return{enter:function(a,b,c){d.enter(a,null,b),c()},leave:function(a,b){d.leave(a),b()}}}return c()}var h=f(),i=h("$animator"),j=h("$animate"),k={restrict:"ECA",terminal:!0,priority:400,transclude:"element",compile:function(c,f,h){return function(c,f,i){function j(){l&&(l.remove(),l=null),n&&(n.$destroy(),n=null),m&&(r.leave(m,function(){l=null}),l=m,m=null)}function k(g){var k,l=A(c,i,f,e),s=l&&a.$current&&a.$current.locals[l];if(g||s!==o){k=c.$new(),o=a.$current.locals[l];var t=h(k,function(a){r.enter(a,f,function(){n&&n.$emit("$viewContentAnimationEnded"),(b.isDefined(q)&&!q||c.$eval(q))&&d(a)}),j()});m=t,n=k,n.$emit("$viewContentLoaded"),n.$eval(p)}}var l,m,n,o,p=i.onload||"",q=i.autoscroll,r=g(i,c);c.$on("$stateChangeSuccess",function(){k(!1)}),c.$on("$viewContentLoading",function(){k(!1)}),k(!0)}}};return k}function z(a,b,c,d){return{restrict:"ECA",priority:-400,compile:function(e){var f=e.html();return function(e,g,h){var i=c.$current,j=A(e,h,g,d),k=i&&i.locals[j];if(k){g.data("$uiView",{name:j,state:k.$$state}),g.html(k.$template?k.$template:f);var l=a(g.contents());if(k.$$controller){k.$scope=e,k.$element=g;var m=b(k.$$controller,k);k.$$controllerAs&&(e[k.$$controllerAs]=m),g.data("$ngControllerController",m),g.children().data("$ngControllerController",m)}l(e)}}}}}function A(a,b,c,d){var e=d(b.uiView||b.name||"")(a),f=c.inheritedData("$uiView");return e.indexOf("@")>=0?e:e+"@"+(f?f.state.name:"")}function B(a,b){var c,d=a.match(/^\s*({[^}]*})\s*$/);if(d&&(a=b+"("+d[1]+")"),c=a.replace(/\n/g," ").match(/^([^(]+?)\s*(\((.*)\))?$/),!c||4!==c.length)throw new Error("Invalid state ref '"+a+"'");return{state:c[1],paramExpr:c[3]||null}}function C(a){var b=a.parent().inheritedData("$uiView");return b&&b.state&&b.state.name?b.state:void 0}function D(a,c){var d=["location","inherit","reload","absolute"];return{restrict:"A",require:["?^uiSrefActive","?^uiSrefActiveEq"],link:function(e,f,g,h){var i=B(g.uiSref,a.current.name),j=null,k=C(f)||a.$current,l="[object SVGAnimatedString]"===Object.prototype.toString.call(f.prop("href"))?"xlink:href":"href",m=null,n="A"===f.prop("tagName").toUpperCase(),o="FORM"===f[0].nodeName,p=o?"action":l,q=!0,r={relative:k,inherit:!0},s=e.$eval(g.uiSrefOpts)||{};b.forEach(d,function(a){a in s&&(r[a]=s[a])});var t=function(c){if(c&&(j=b.copy(c)),q){m=a.href(i.state,j,r);var d=h[1]||h[0];return d&&d.$$addStateInfo(i.state,j),null===m?(q=!1,!1):void g.$set(p,m)}};i.paramExpr&&(e.$watch(i.paramExpr,function(a,b){a!==j&&t(a)},!0),j=b.copy(e.$eval(i.paramExpr))),t(),o||f.bind("click",function(b){var d=b.which||b.button;if(!(d>1||b.ctrlKey||b.metaKey||b.shiftKey||f.attr("target"))){var e=c(function(){a.go(i.state,j,r)});b.preventDefault();var g=n&&!m?1:0;b.preventDefault=function(){g--<=0&&c.cancel(e)}}})}}}function E(a,b,c){return{restrict:"A",controller:["$scope","$element","$attrs",function(b,d,e){function f(){g()?d.addClass(i):d.removeClass(i)}function g(){for(var a=0;a<j.length;a++)if(h(j[a].state,j[a].params))return!0;return!1}function h(b,c){return"undefined"!=typeof e.uiSrefActiveEq?a.is(b.name,c):a.includes(b.name,c)}var i,j=[];i=c(e.uiSrefActiveEq||e.uiSrefActive||"",!1)(b),this.$$addStateInfo=function(b,c){var e=a.get(b,C(d));j.push({state:e||{name:b},params:c}),f()},b.$on("$stateChangeSuccess",f)}]}}function F(a){var b=function(b){return a.is(b)};return b.$stateful=!0,b}function G(a){var b=function(b){return a.includes(b)};return b.$stateful=!0,b}var H=b.isDefined,I=b.isFunction,J=b.isString,K=b.isObject,L=b.isArray,M=b.forEach,N=b.extend,O=b.copy;b.module("ui.router.util",["ng"]),b.module("ui.router.router",["ui.router.util"]),b.module("ui.router.state",["ui.router.router","ui.router.util"]),b.module("ui.router",["ui.router.state"]),b.module("ui.router.compat",["ui.router"]),p.$inject=["$q","$injector"],b.module("ui.router.util").service("$resolve",p),q.$inject=["$http","$templateCache","$injector"],b.module("ui.router.util").service("$templateFactory",q);var P;r.prototype.concat=function(a,b){var c={caseInsensitive:P.caseInsensitive(),strict:P.strictMode(),squash:P.defaultSquashPolicy()};return new r(this.sourcePath+a+this.sourceSearch,N(c,b),this)},r.prototype.toString=function(){return this.source},r.prototype.exec=function(a,b){function c(a){function b(a){return a.split("").reverse().join("")}function c(a){return a.replace(/\\-/g,"-")}var d=b(a).split(/-(?!\\)/),e=o(d,b);return o(e,c).reverse()}var d=this.regexp.exec(a);if(!d)return null;b=b||{};var e,f,g,h=this.parameters(),i=h.length,j=this.segments.length-1,k={};if(j!==d.length-1)throw new Error("Unbalanced capture group in route '"+this.source+"'");for(e=0;j>e;e++){g=h[e];var l=this.params[g],m=d[e+1];for(f=0;f<l.replace;f++)l.replace[f].from===m&&(m=l.replace[f].to);m&&l.array===!0&&(m=c(m)),k[g]=l.value(m)}for(;i>e;e++)g=h[e],k[g]=this.params[g].value(b[g]);return k},r.prototype.parameters=function(a){return H(a)?this.params[a]||null:this.$$paramNames},r.prototype.validates=function(a){return this.params.$$validates(a)},r.prototype.format=function(a){function b(a){return encodeURIComponent(a).replace(/-/g,function(a){return"%5C%"+a.charCodeAt(0).toString(16).toUpperCase()})}a=a||{};var c=this.segments,d=this.parameters(),e=this.params;if(!this.validates(a))return null;var f,g=!1,h=c.length-1,i=d.length,j=c[0];for(f=0;i>f;f++){var k=h>f,l=d[f],m=e[l],n=m.value(a[l]),p=m.isOptional&&m.type.equals(m.value(),n),q=p?m.squash:!1,r=m.type.encode(n);if(k){var s=c[f+1];if(q===!1)null!=r&&(j+=L(r)?o(r,b).join("-"):encodeURIComponent(r)),j+=s;else if(q===!0){var t=j.match(/\/$/)?/\/?(.*)/:/(.*)/;j+=s.match(t)[1]}else J(q)&&(j+=q+s)}else{if(null==r||p&&q!==!1)continue;L(r)||(r=[r]),r=o(r,encodeURIComponent).join("&"+l+"="),j+=(g?"&":"?")+(l+"="+r),g=!0}}return j},s.prototype.is=function(a,b){return!0},s.prototype.encode=function(a,b){return a},s.prototype.decode=function(a,b){return a},s.prototype.equals=function(a,b){return a==b},s.prototype.$subPattern=function(){var a=this.pattern.toString();return a.substr(1,a.length-2)},s.prototype.pattern=/.*/,s.prototype.toString=function(){return"{Type:"+this.name+"}"},s.prototype.$normalize=function(a){return this.is(a)?a:this.decode(a)},s.prototype.$asArray=function(a,b){function d(a,b){function d(a,b){return function(){return a[b].apply(a,arguments)}}function e(a){return L(a)?a:H(a)?[a]:[]}function f(a){switch(a.length){case 0:return c;case 1:return"auto"===b?a[0]:a;default:return a}}function g(a){return!a}function h(a,b){return function(c){c=e(c);var d=o(c,a);return b===!0?0===n(d,g).length:f(d)}}function i(a){return function(b,c){var d=e(b),f=e(c);if(d.length!==f.length)return!1;for(var g=0;g<d.length;g++)if(!a(d[g],f[g]))return!1;return!0}}this.encode=h(d(a,"encode")),this.decode=h(d(a,"decode")),this.is=h(d(a,"is"),!0),this.equals=i(d(a,"equals")),this.pattern=a.pattern,this.$normalize=h(d(a,"$normalize")),this.name=a.name,this.$arrayMode=b}if(!a)return this;if("auto"===a&&!b)throw new Error("'auto' array mode is for query parameters only");return new d(this,a)},b.module("ui.router.util").provider("$urlMatcherFactory",t),b.module("ui.router.util").run(["$urlMatcherFactory",function(a){}]),u.$inject=["$locationProvider","$urlMatcherFactoryProvider"],b.module("ui.router.router").provider("$urlRouter",u),v.$inject=["$urlRouterProvider","$urlMatcherFactoryProvider"],b.module("ui.router.state").value("$stateParams",{}).provider("$state",v),w.$inject=[],b.module("ui.router.state").provider("$view",w),b.module("ui.router.state").provider("$uiViewScroll",x),y.$inject=["$state","$injector","$uiViewScroll","$interpolate"],z.$inject=["$compile","$controller","$state","$interpolate"],b.module("ui.router.state").directive("uiView",y),b.module("ui.router.state").directive("uiView",z),D.$inject=["$state","$timeout"],E.$inject=["$state","$stateParams","$interpolate"],b.module("ui.router.state").directive("uiSref",D).directive("uiSrefActive",E).directive("uiSrefActiveEq",E),F.$inject=["$state"],G.$inject=["$state"],b.module("ui.router.state").filter("isState",F).filter("includedByState",G)}(window,window.angular); | |
| 8 | 7 | \ No newline at end of file |
| 8 | +"undefined"!=typeof module&&"undefined"!=typeof exports&&module.exports===exports&&(module.exports="ui.router"),function(a,b,c){"use strict";function d(a,b){return N(new(N(function(){},{prototype:a})),b)}function e(a){return M(arguments,function(b){b!==a&&M(b,function(b,c){a.hasOwnProperty(c)||(a[c]=b)})}),a}function f(a,b){var c=[];for(var d in a.path){if(a.path[d]!==b.path[d])break;c.push(a.path[d])}return c}function g(a){if(Object.keys)return Object.keys(a);var b=[];return M(a,function(a,c){b.push(c)}),b}function h(a,b){if(Array.prototype.indexOf)return a.indexOf(b,Number(arguments[2])||0);var c=a.length>>>0,d=Number(arguments[2])||0;for(d=0>d?Math.ceil(d):Math.floor(d),0>d&&(d+=c);c>d;d++)if(d in a&&a[d]===b)return d;return-1}function i(a,b,c,d){var e,i=f(c,d),j={},k=[];for(var l in i)if(i[l].params&&(e=g(i[l].params),e.length))for(var m in e)h(k,e[m])>=0||(k.push(e[m]),j[e[m]]=a[e[m]]);return N({},j,b)}function j(a,b,c){if(!c){c=[];for(var d in a)c.push(d)}for(var e=0;e<c.length;e++){var f=c[e];if(a[f]!=b[f])return!1}return!0}function k(a,b){var c={};return M(a,function(a){c[a]=b[a]}),c}function l(a){var b={},c=Array.prototype.concat.apply(Array.prototype,Array.prototype.slice.call(arguments,1));return M(c,function(c){c in a&&(b[c]=a[c])}),b}function m(a){var b={},c=Array.prototype.concat.apply(Array.prototype,Array.prototype.slice.call(arguments,1));for(var d in a)-1==h(c,d)&&(b[d]=a[d]);return b}function n(a,b){var c=L(a),d=c?[]:{};return M(a,function(a,e){b(a,e)&&(d[c?d.length:e]=a)}),d}function o(a,b){var c=L(a)?[]:{};return M(a,function(a,d){c[d]=b(a,d)}),c}function p(a,b){var d=1,f=2,i={},j=[],k=i,l=N(a.when(i),{$$promises:i,$$values:i});this.study=function(i){function n(a,c){if(s[c]!==f){if(r.push(c),s[c]===d)throw r.splice(0,h(r,c)),new Error("Cyclic dependency: "+r.join(" -> "));if(s[c]=d,J(a))q.push(c,[function(){return b.get(a)}],j);else{var e=b.annotate(a);M(e,function(a){a!==c&&i.hasOwnProperty(a)&&n(i[a],a)}),q.push(c,a,e)}r.pop(),s[c]=f}}function o(a){return K(a)&&a.then&&a.$$promises}if(!K(i))throw new Error("'invocables' must be an object");var p=g(i||{}),q=[],r=[],s={};return M(i,n),i=r=s=null,function(d,f,g){function h(){--u||(v||e(t,f.$$values),r.$$values=t,r.$$promises=r.$$promises||!0,delete r.$$inheritedValues,n.resolve(t))}function i(a){r.$$failure=a,n.reject(a)}function j(c,e,f){function j(a){l.reject(a),i(a)}function k(){if(!H(r.$$failure))try{l.resolve(b.invoke(e,g,t)),l.promise.then(function(a){t[c]=a,h()},j)}catch(a){j(a)}}var l=a.defer(),m=0;M(f,function(a){s.hasOwnProperty(a)&&!d.hasOwnProperty(a)&&(m++,s[a].then(function(b){t[a]=b,--m||k()},j))}),m||k(),s[c]=l.promise}if(o(d)&&g===c&&(g=f,f=d,d=null),d){if(!K(d))throw new Error("'locals' must be an object")}else d=k;if(f){if(!o(f))throw new Error("'parent' must be a promise returned by $resolve.resolve()")}else f=l;var n=a.defer(),r=n.promise,s=r.$$promises={},t=N({},d),u=1+q.length/3,v=!1;if(H(f.$$failure))return i(f.$$failure),r;f.$$inheritedValues&&e(t,m(f.$$inheritedValues,p)),N(s,f.$$promises),f.$$values?(v=e(t,m(f.$$values,p)),r.$$inheritedValues=m(f.$$values,p),h()):(f.$$inheritedValues&&(r.$$inheritedValues=m(f.$$inheritedValues,p)),f.then(h,i));for(var w=0,x=q.length;x>w;w+=3)d.hasOwnProperty(q[w])?h():j(q[w],q[w+1],q[w+2]);return r}},this.resolve=function(a,b,c,d){return this.study(a)(b,c,d)}}function q(a,b,c){this.fromConfig=function(a,b,c){return H(a.template)?this.fromString(a.template,b):H(a.templateUrl)?this.fromUrl(a.templateUrl,b):H(a.templateProvider)?this.fromProvider(a.templateProvider,b,c):null},this.fromString=function(a,b){return I(a)?a(b):a},this.fromUrl=function(c,d){return I(c)&&(c=c(d)),null==c?null:a.get(c,{cache:b,headers:{Accept:"text/html"}}).then(function(a){return a.data})},this.fromProvider=function(a,b,d){return c.invoke(a,null,d||{params:b})}}function r(a,b,e){function f(b,c,d,e){if(q.push(b),o[b])return o[b];if(!/^\w+(-+\w+)*(?:\[\])?$/.test(b))throw new Error("Invalid parameter name '"+b+"' in pattern '"+a+"'");if(p[b])throw new Error("Duplicate parameter name '"+b+"' in pattern '"+a+"'");return p[b]=new P.Param(b,c,d,e),p[b]}function g(a,b,c,d){var e=["",""],f=a.replace(/[\\\[\]\^$*+?.()|{}]/g,"\\$&");if(!b)return f;switch(c){case!1:e=["(",")"+(d?"?":"")];break;case!0:e=["?(",")?"];break;default:e=["("+c+"|",")?"]}return f+e[0]+b+e[1]}function h(e,f){var g,h,i,j,k;return g=e[2]||e[3],k=b.params[g],i=a.substring(m,e.index),h=f?e[4]:e[4]||("*"==e[1]?".*":null),j=P.type(h||"string")||d(P.type("string"),{pattern:new RegExp(h,b.caseInsensitive?"i":c)}),{id:g,regexp:h,segment:i,type:j,cfg:k}}b=N({params:{}},K(b)?b:{});var i,j=/([:*])([\w\[\]]+)|\{([\w\[\]]+)(?:\:((?:[^{}\\]+|\\.|\{(?:[^{}\\]+|\\.)*\})+))?\}/g,k=/([:]?)([\w\[\]-]+)|\{([\w\[\]-]+)(?:\:((?:[^{}\\]+|\\.|\{(?:[^{}\\]+|\\.)*\})+))?\}/g,l="^",m=0,n=this.segments=[],o=e?e.params:{},p=this.params=e?e.params.$$new():new P.ParamSet,q=[];this.source=a;for(var r,s,t;(i=j.exec(a))&&(r=h(i,!1),!(r.segment.indexOf("?")>=0));)s=f(r.id,r.type,r.cfg,"path"),l+=g(r.segment,s.type.pattern.source,s.squash,s.isOptional),n.push(r.segment),m=j.lastIndex;t=a.substring(m);var u=t.indexOf("?");if(u>=0){var v=this.sourceSearch=t.substring(u);if(t=t.substring(0,u),this.sourcePath=a.substring(0,m+u),v.length>0)for(m=0;i=k.exec(v);)r=h(i,!0),s=f(r.id,r.type,r.cfg,"search"),m=j.lastIndex}else this.sourcePath=a,this.sourceSearch="";l+=g(t)+(b.strict===!1?"/?":"")+"$",n.push(t),this.regexp=new RegExp(l,b.caseInsensitive?"i":c),this.prefix=n[0],this.$$paramNames=q}function s(a){N(this,a)}function t(){function a(a){return null!=a?a.toString().replace(/\//g,"%2F"):a}function e(a){return null!=a?a.toString().replace(/%2F/g,"/"):a}function f(){return{strict:p,caseInsensitive:m}}function i(a){return I(a)||L(a)&&I(a[a.length-1])}function j(){for(;w.length;){var a=w.shift();if(a.pattern)throw new Error("You cannot override a type's .pattern at runtime.");b.extend(u[a.name],l.invoke(a.def))}}function k(a){N(this,a||{})}P=this;var l,m=!1,p=!0,q=!1,u={},v=!0,w=[],x={string:{encode:a,decode:e,is:function(a){return null==a||!H(a)||"string"==typeof a},pattern:/[^/]*/},"int":{encode:a,decode:function(a){return parseInt(a,10)},is:function(a){return H(a)&&this.decode(a.toString())===a},pattern:/\d+/},bool:{encode:function(a){return a?1:0},decode:function(a){return 0!==parseInt(a,10)},is:function(a){return a===!0||a===!1},pattern:/0|1/},date:{encode:function(a){return this.is(a)?[a.getFullYear(),("0"+(a.getMonth()+1)).slice(-2),("0"+a.getDate()).slice(-2)].join("-"):c},decode:function(a){if(this.is(a))return a;var b=this.capture.exec(a);return b?new Date(b[1],b[2]-1,b[3]):c},is:function(a){return a instanceof Date&&!isNaN(a.valueOf())},equals:function(a,b){return this.is(a)&&this.is(b)&&a.toISOString()===b.toISOString()},pattern:/[0-9]{4}-(?:0[1-9]|1[0-2])-(?:0[1-9]|[1-2][0-9]|3[0-1])/,capture:/([0-9]{4})-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])/},json:{encode:b.toJson,decode:b.fromJson,is:b.isObject,equals:b.equals,pattern:/[^/]*/},any:{encode:b.identity,decode:b.identity,equals:b.equals,pattern:/.*/}};t.$$getDefaultValue=function(a){if(!i(a.value))return a.value;if(!l)throw new Error("Injectable functions cannot be called at configuration time");return l.invoke(a.value)},this.caseInsensitive=function(a){return H(a)&&(m=a),m},this.strictMode=function(a){return H(a)&&(p=a),p},this.defaultSquashPolicy=function(a){if(!H(a))return q;if(a!==!0&&a!==!1&&!J(a))throw new Error("Invalid squash policy: "+a+". Valid policies: false, true, arbitrary-string");return q=a,a},this.compile=function(a,b){return new r(a,N(f(),b))},this.isMatcher=function(a){if(!K(a))return!1;var b=!0;return M(r.prototype,function(c,d){I(c)&&(b=b&&H(a[d])&&I(a[d]))}),b},this.type=function(a,b,c){if(!H(b))return u[a];if(u.hasOwnProperty(a))throw new Error("A type named '"+a+"' has already been defined.");return u[a]=new s(N({name:a},b)),c&&(w.push({name:a,def:c}),v||j()),this},M(x,function(a,b){u[b]=new s(N({name:b},a))}),u=d(u,{}),this.$get=["$injector",function(a){return l=a,v=!1,j(),M(x,function(a,b){u[b]||(u[b]=new s(a))}),this}],this.Param=function(a,b,d,e){function f(a){var b=K(a)?g(a):[],c=-1===h(b,"value")&&-1===h(b,"type")&&-1===h(b,"squash")&&-1===h(b,"array");return c&&(a={value:a}),a.$$fn=i(a.value)?a.value:function(){return a.value},a}function j(b,c,d){if(b.type&&c)throw new Error("Param '"+a+"' has two type configurations.");return c?c:b.type?b.type instanceof s?b.type:new s(b.type):"config"===d?u.any:u.string}function k(){var b={array:"search"===e?"auto":!1},c=a.match(/\[\]$/)?{array:!0}:{};return N(b,c,d).array}function m(a,b){var c=a.squash;if(!b||c===!1)return!1;if(!H(c)||null==c)return q;if(c===!0||J(c))return c;throw new Error("Invalid squash policy: '"+c+"'. Valid policies: false, true, or arbitrary string")}function p(a,b,d,e){var f,g,i=[{from:"",to:d||b?c:""},{from:null,to:d||b?c:""}];return f=L(a.replace)?a.replace:[],J(e)&&f.push({from:e,to:c}),g=o(f,function(a){return a.from}),n(i,function(a){return-1===h(g,a.from)}).concat(f)}function r(){if(!l)throw new Error("Injectable functions cannot be called at configuration time");var a=l.invoke(d.$$fn);if(null!==a&&a!==c&&!w.type.is(a))throw new Error("Default value ("+a+") for parameter '"+w.id+"' is not an instance of Type ("+w.type.name+")");return a}function t(a){function b(a){return function(b){return b.from===a}}function c(a){var c=o(n(w.replace,b(a)),function(a){return a.to});return c.length?c[0]:a}return a=c(a),H(a)?w.type.$normalize(a):r()}function v(){return"{Param:"+a+" "+b+" squash: '"+z+"' optional: "+y+"}"}var w=this;d=f(d),b=j(d,b,e);var x=k();b=x?b.$asArray(x,"search"===e):b,"string"!==b.name||x||"path"!==e||d.value!==c||(d.value="");var y=d.value!==c,z=m(d,y),A=p(d,x,y,z);N(this,{id:a,type:b,location:e,array:x,squash:z,replace:A,isOptional:y,value:t,dynamic:c,config:d,toString:v})},k.prototype={$$new:function(){return d(this,N(new k,{$$parent:this}))},$$keys:function(){for(var a=[],b=[],c=this,d=g(k.prototype);c;)b.push(c),c=c.$$parent;return b.reverse(),M(b,function(b){M(g(b),function(b){-1===h(a,b)&&-1===h(d,b)&&a.push(b)})}),a},$$values:function(a){var b={},c=this;return M(c.$$keys(),function(d){b[d]=c[d].value(a&&a[d])}),b},$$equals:function(a,b){var c=!0,d=this;return M(d.$$keys(),function(e){var f=a&&a[e],g=b&&b[e];d[e].type.equals(f,g)||(c=!1)}),c},$$validates:function(a){var d,e,f,g,h,i=this.$$keys();for(d=0;d<i.length&&(e=this[i[d]],f=a[i[d]],f!==c&&null!==f||!e.isOptional);d++){if(g=e.type.$normalize(f),!e.type.is(g))return!1;if(h=e.type.encode(g),b.isString(h)&&!e.type.pattern.exec(h))return!1}return!0},$$parent:c},this.ParamSet=k}function u(a,d){function e(a){var b=/^\^((?:\\[^a-zA-Z0-9]|[^\\\[\]\^$*+?.()|{}]+)*)/.exec(a.source);return null!=b?b[1].replace(/\\(.)/g,"$1"):""}function f(a,b){return a.replace(/\$(\$|\d{1,2})/,function(a,c){return b["$"===c?0:Number(c)]})}function g(a,b,c){if(!c)return!1;var d=a.invoke(b,b,{$match:c});return H(d)?d:!0}function h(d,e,f,g){function h(a,b,c){return"/"===p?a:b?p.slice(0,-1)+a:c?p.slice(1)+a:a}function m(a){function b(a){var b=a(f,d);return b?(J(b)&&d.replace().url(b),!0):!1}if(!a||!a.defaultPrevented){o&&d.url()===o;o=c;var e,g=j.length;for(e=0;g>e;e++)if(b(j[e]))return;k&&b(k)}}function n(){return i=i||e.$on("$locationChangeSuccess",m)}var o,p=g.baseHref(),q=d.url();return l||n(),{sync:function(){m()},listen:function(){return n()},update:function(a){return a?void(q=d.url()):void(d.url()!==q&&(d.url(q),d.replace()))},push:function(a,b,e){var f=a.format(b||{});null!==f&&b&&b["#"]&&(f+="#"+b["#"]),d.url(f),o=e&&e.$$avoidResync?d.url():c,e&&e.replace&&d.replace()},href:function(c,e,f){if(!c.validates(e))return null;var g=a.html5Mode();b.isObject(g)&&(g=g.enabled);var i=c.format(e);if(f=f||{},g||null===i||(i="#"+a.hashPrefix()+i),null!==i&&e&&e["#"]&&(i+="#"+e["#"]),i=h(i,g,f.absolute),!f.absolute||!i)return i;var j=!g&&i?"/":"",k=d.port();return k=80===k||443===k?"":":"+k,[d.protocol(),"://",d.host(),k,j,i].join("")}}}var i,j=[],k=null,l=!1;this.rule=function(a){if(!I(a))throw new Error("'rule' must be a function");return j.push(a),this},this.otherwise=function(a){if(J(a)){var b=a;a=function(){return b}}else if(!I(a))throw new Error("'rule' must be a function");return k=a,this},this.when=function(a,b){var c,h=J(b);if(J(a)&&(a=d.compile(a)),!h&&!I(b)&&!L(b))throw new Error("invalid 'handlers' in when()");var i={matcher:function(a,b){return h&&(c=d.compile(b),b=["$match",function(a){return c.format(a)}]),N(function(c,d){return g(c,b,a.exec(d.path(),d.search()))},{prefix:J(a.prefix)?a.prefix:""})},regex:function(a,b){if(a.global||a.sticky)throw new Error("when() RegExp must not be global or sticky");return h&&(c=b,b=["$match",function(a){return f(c,a)}]),N(function(c,d){return g(c,b,a.exec(d.path()))},{prefix:e(a)})}},j={matcher:d.isMatcher(a),regex:a instanceof RegExp};for(var k in j)if(j[k])return this.rule(i[k](a,b));throw new Error("invalid 'what' in when()")},this.deferIntercept=function(a){a===c&&(a=!0),l=a},this.$get=h,h.$inject=["$location","$rootScope","$injector","$browser"]}function v(a,e){function f(a){return 0===a.indexOf(".")||0===a.indexOf("^")}function m(a,b){if(!a)return c;var d=J(a),e=d?a:a.name,g=f(e);if(g){if(!b)throw new Error("No reference point given for path '"+e+"'");b=m(b);for(var h=e.split("."),i=0,j=h.length,k=b;j>i;i++)if(""!==h[i]||0!==i){if("^"!==h[i])break;if(!k.parent)throw new Error("Path '"+e+"' not valid for state '"+b.name+"'");k=k.parent}else k=b;h=h.slice(i).join("."),e=k.name+(k.name&&h?".":"")+h}var l=z[e];return!l||!d&&(d||l!==a&&l.self!==a)?c:l}function n(a,b){A[a]||(A[a]=[]),A[a].push(b)}function p(a){for(var b=A[a]||[];b.length;)q(b.shift())}function q(b){b=d(b,{self:b,resolve:b.resolve||{},toString:function(){return this.name}});var c=b.name;if(!J(c)||c.indexOf("@")>=0)throw new Error("State must have a valid name");if(z.hasOwnProperty(c))throw new Error("State '"+c+"'' is already defined");var e=-1!==c.indexOf(".")?c.substring(0,c.lastIndexOf(".")):J(b.parent)?b.parent:K(b.parent)&&J(b.parent.name)?b.parent.name:"";if(e&&!z[e])return n(e,b.self);for(var f in C)I(C[f])&&(b[f]=C[f](b,C.$delegates[f]));return z[c]=b,!b[B]&&b.url&&a.when(b.url,["$match","$stateParams",function(a,c){y.$current.navigable==b&&j(a,c)||y.transitionTo(b,a,{inherit:!0,location:!1})}]),p(c),b}function r(a){return a.indexOf("*")>-1}function s(a){for(var b=a.split("."),c=y.$current.name.split("."),d=0,e=b.length;e>d;d++)"*"===b[d]&&(c[d]="*");return"**"===b[0]&&(c=c.slice(h(c,b[1])),c.unshift("**")),"**"===b[b.length-1]&&(c.splice(h(c,b[b.length-2])+1,Number.MAX_VALUE),c.push("**")),b.length!=c.length?!1:c.join("")===b.join("")}function t(a,b){return J(a)&&!H(b)?C[a]:I(b)&&J(a)?(C[a]&&!C.$delegates[a]&&(C.$delegates[a]=C[a]),C[a]=b,this):this}function u(a,b){return K(a)?b=a:b.name=a,q(b),this}function v(a,e,f,h,l,n,p,q,t){function u(b,c,d,f){var g=a.$broadcast("$stateNotFound",b,c,d);if(g.defaultPrevented)return p.update(),D;if(!g.retry)return null;if(f.$retry)return p.update(),E;var h=y.transition=e.when(g.retry);return h.then(function(){return h!==y.transition?A:(b.options.$retry=!0,y.transitionTo(b.to,b.toParams,b.options))},function(){return D}),p.update(),h}function v(a,c,d,g,i,j){function m(){var c=[];return M(a.views,function(d,e){var g=d.resolve&&d.resolve!==a.resolve?d.resolve:{};g.$template=[function(){return f.load(e,{view:d,locals:i.globals,params:n,notify:j.notify})||""}],c.push(l.resolve(g,i.globals,i.resolve,a).then(function(c){if(I(d.controllerProvider)||L(d.controllerProvider)){var f=b.extend({},g,i.globals);c.$$controller=h.invoke(d.controllerProvider,null,f)}else c.$$controller=d.controller;c.$$state=a,c.$$controllerAs=d.controllerAs,i[e]=c}))}),e.all(c).then(function(){return i.globals})}var n=d?c:k(a.params.$$keys(),c),o={$stateParams:n};i.resolve=l.resolve(a.resolve,o,i.resolve,a);var p=[i.resolve.then(function(a){i.globals=a})];return g&&p.push(g),e.all(p).then(m).then(function(a){return i})}var A=e.reject(new Error("transition superseded")),C=e.reject(new Error("transition prevented")),D=e.reject(new Error("transition aborted")),E=e.reject(new Error("transition failed"));return x.locals={resolve:null,globals:{$stateParams:{}}},y={params:{},current:x.self,$current:x,transition:null},y.reload=function(a){return y.transitionTo(y.current,n,{reload:a||!0,inherit:!1,notify:!0})},y.go=function(a,b,c){return y.transitionTo(a,b,N({inherit:!0,relative:y.$current},c))},y.transitionTo=function(b,c,f){c=c||{},f=N({location:!0,inherit:!1,relative:null,notify:!0,reload:!1,$retry:!1},f||{});var g,j=y.$current,l=y.params,o=j.path,q=m(b,f.relative),r=c["#"];if(!H(q)){var s={to:b,toParams:c,options:f},t=u(s,j.self,l,f);if(t)return t;if(b=s.to,c=s.toParams,f=s.options,q=m(b,f.relative),!H(q)){if(!f.relative)throw new Error("No such state '"+b+"'");throw new Error("Could not resolve '"+b+"' from state '"+f.relative+"'")}}if(q[B])throw new Error("Cannot transition to abstract state '"+b+"'");if(f.inherit&&(c=i(n,c||{},y.$current,q)),!q.params.$$validates(c))return E;c=q.params.$$values(c),b=q;var z=b.path,D=0,F=z[D],G=x.locals,I=[];if(f.reload){if(J(f.reload)||K(f.reload)){if(K(f.reload)&&!f.reload.name)throw new Error("Invalid reload state object");var L=f.reload===!0?o[0]:m(f.reload);if(f.reload&&!L)throw new Error("No such reload state '"+(J(f.reload)?f.reload:f.reload.name)+"'");for(;F&&F===o[D]&&F!==L;)G=I[D]=F.locals,D++,F=z[D]}}else for(;F&&F===o[D]&&F.ownParams.$$equals(c,l);)G=I[D]=F.locals,D++,F=z[D];if(w(b,c,j,l,G,f))return r&&(c["#"]=r),y.params=c,O(y.params,n),f.location&&b.navigable&&b.navigable.url&&(p.push(b.navigable.url,c,{$$avoidResync:!0,replace:"replace"===f.location}),p.update(!0)),y.transition=null,e.when(y.current);if(c=k(b.params.$$keys(),c||{}),f.notify&&a.$broadcast("$stateChangeStart",b.self,c,j.self,l).defaultPrevented)return a.$broadcast("$stateChangeCancel",b.self,c,j.self,l),p.update(),C;for(var M=e.when(G),P=D;P<z.length;P++,F=z[P])G=I[P]=d(G),M=v(F,c,F===b,M,G,f);var Q=y.transition=M.then(function(){var d,e,g;if(y.transition!==Q)return A;for(d=o.length-1;d>=D;d--)g=o[d],g.self.onExit&&h.invoke(g.self.onExit,g.self,g.locals.globals),g.locals=null;for(d=D;d<z.length;d++)e=z[d],e.locals=I[d],e.self.onEnter&&h.invoke(e.self.onEnter,e.self,e.locals.globals);return r&&(c["#"]=r),y.transition!==Q?A:(y.$current=b,y.current=b.self,y.params=c,O(y.params,n),y.transition=null,f.location&&b.navigable&&p.push(b.navigable.url,b.navigable.locals.globals.$stateParams,{$$avoidResync:!0,replace:"replace"===f.location}),f.notify&&a.$broadcast("$stateChangeSuccess",b.self,c,j.self,l),p.update(!0),y.current)},function(d){return y.transition!==Q?A:(y.transition=null,g=a.$broadcast("$stateChangeError",b.self,c,j.self,l,d),g.defaultPrevented||p.update(),e.reject(d))});return Q},y.is=function(a,b,d){d=N({relative:y.$current},d||{});var e=m(a,d.relative);return H(e)?y.$current!==e?!1:b?j(e.params.$$values(b),n):!0:c},y.includes=function(a,b,d){if(d=N({relative:y.$current},d||{}),J(a)&&r(a)){if(!s(a))return!1;a=y.$current.name}var e=m(a,d.relative);return H(e)?H(y.$current.includes[e.name])?b?j(e.params.$$values(b),n,g(b)):!0:!1:c},y.href=function(a,b,d){d=N({lossy:!0,inherit:!0,absolute:!1,relative:y.$current},d||{});var e=m(a,d.relative);if(!H(e))return null;d.inherit&&(b=i(n,b||{},y.$current,e));var f=e&&d.lossy?e.navigable:e;return f&&f.url!==c&&null!==f.url?p.href(f.url,k(e.params.$$keys().concat("#"),b||{}),{absolute:d.absolute}):null},y.get=function(a,b){if(0===arguments.length)return o(g(z),function(a){return z[a].self});var c=m(a,b||y.$current);return c&&c.self?c.self:null},y}function w(a,b,c,d,e,f){function g(a,b,c){function d(b){return"search"!=a.params[b].location}var e=a.params.$$keys().filter(d),f=l.apply({},[a.params].concat(e)),g=new P.ParamSet(f);return g.$$equals(b,c)}return!f.reload&&a===c&&(e===c.locals||a.self.reloadOnSearch===!1&&g(c,d,b))?!0:void 0}var x,y,z={},A={},B="abstract",C={parent:function(a){if(H(a.parent)&&a.parent)return m(a.parent);var b=/^(.+)\.[^.]+$/.exec(a.name);return b?m(b[1]):x},data:function(a){return a.parent&&a.parent.data&&(a.data=a.self.data=N({},a.parent.data,a.data)),a.data},url:function(a){var b=a.url,c={params:a.params||{}};if(J(b))return"^"==b.charAt(0)?e.compile(b.substring(1),c):(a.parent.navigable||x).url.concat(b,c);if(!b||e.isMatcher(b))return b;throw new Error("Invalid url '"+b+"' in state '"+a+"'")},navigable:function(a){return a.url?a:a.parent?a.parent.navigable:null},ownParams:function(a){var b=a.url&&a.url.params||new P.ParamSet;return M(a.params||{},function(a,c){b[c]||(b[c]=new P.Param(c,null,a,"config"))}),b},params:function(a){return a.parent&&a.parent.params?N(a.parent.params.$$new(),a.ownParams):new P.ParamSet},views:function(a){var b={};return M(H(a.views)?a.views:{"":a},function(c,d){d.indexOf("@")<0&&(d+="@"+a.parent.name),b[d]=c}),b},path:function(a){return a.parent?a.parent.path.concat(a):[]},includes:function(a){var b=a.parent?N({},a.parent.includes):{};return b[a.name]=!0,b},$delegates:{}};x=q({name:"",url:"^",views:null,"abstract":!0}),x.navigable=null,this.decorator=t,this.state=u,this.$get=v,v.$inject=["$rootScope","$q","$view","$injector","$resolve","$stateParams","$urlRouter","$location","$urlMatcherFactory"]}function w(){function a(a,b){return{load:function(c,d){var e,f={template:null,controller:null,view:null,locals:null,notify:!0,async:!0,params:{}};return d=N(f,d),d.view&&(e=b.fromConfig(d.view,d.params,d.locals)),e&&d.notify&&a.$broadcast("$viewContentLoading",d),e}}}this.$get=a,a.$inject=["$rootScope","$templateFactory"]}function x(){var a=!1;this.useAnchorScroll=function(){a=!0},this.$get=["$anchorScroll","$timeout",function(b,c){return a?b:function(a){return c(function(){a[0].scrollIntoView()},0,!1)}}]}function y(a,c,d,e){function f(){return c.has?function(a){return c.has(a)?c.get(a):null}:function(a){try{return c.get(a)}catch(b){return null}}}function g(a,b){var c=function(){return{enter:function(a,b,c){b.after(a),c()},leave:function(a,b){a.remove(),b()}}};if(j)return{enter:function(a,b,c){var d=j.enter(a,null,b,c);d&&d.then&&d.then(c)},leave:function(a,b){var c=j.leave(a,b);c&&c.then&&c.then(b)}};if(i){var d=i&&i(b,a);return{enter:function(a,b,c){d.enter(a,null,b),c()},leave:function(a,b){d.leave(a),b()}}}return c()}var h=f(),i=h("$animator"),j=h("$animate"),k={restrict:"ECA",terminal:!0,priority:400,transclude:"element",compile:function(c,f,h){return function(c,f,i){function j(){l&&(l.remove(),l=null),n&&(n.$destroy(),n=null),m&&(r.leave(m,function(){l=null}),l=m,m=null)}function k(g){var k,l=A(c,i,f,e),s=l&&a.$current&&a.$current.locals[l];if(g||s!==o){k=c.$new(),o=a.$current.locals[l];var t=h(k,function(a){r.enter(a,f,function(){n&&n.$emit("$viewContentAnimationEnded"),(b.isDefined(q)&&!q||c.$eval(q))&&d(a)}),j()});m=t,n=k,n.$emit("$viewContentLoaded"),n.$eval(p)}}var l,m,n,o,p=i.onload||"",q=i.autoscroll,r=g(i,c);c.$on("$stateChangeSuccess",function(){k(!1)}),c.$on("$viewContentLoading",function(){k(!1)}),k(!0)}}};return k}function z(a,b,c,d){return{restrict:"ECA",priority:-400,compile:function(e){var f=e.html();return function(e,g,h){var i=c.$current,j=A(e,h,g,d),k=i&&i.locals[j];if(k){g.data("$uiView",{name:j,state:k.$$state}),g.html(k.$template?k.$template:f);var l=a(g.contents());if(k.$$controller){k.$scope=e,k.$element=g;var m=b(k.$$controller,k);k.$$controllerAs&&(e[k.$$controllerAs]=m),g.data("$ngControllerController",m),g.children().data("$ngControllerController",m)}l(e)}}}}}function A(a,b,c,d){var e=d(b.uiView||b.name||"")(a),f=c.inheritedData("$uiView");return e.indexOf("@")>=0?e:e+"@"+(f?f.state.name:"")}function B(a,b){var c,d=a.match(/^\s*({[^}]*})\s*$/);if(d&&(a=b+"("+d[1]+")"),c=a.replace(/\n/g," ").match(/^([^(]+?)\s*(\((.*)\))?$/),!c||4!==c.length)throw new Error("Invalid state ref '"+a+"'");return{state:c[1],paramExpr:c[3]||null}}function C(a){var b=a.parent().inheritedData("$uiView");return b&&b.state&&b.state.name?b.state:void 0}function D(a,c){var d=["location","inherit","reload","absolute"];return{restrict:"A",require:["?^uiSrefActive","?^uiSrefActiveEq"],link:function(e,f,g,h){var i=B(g.uiSref,a.current.name),j=null,k=C(f)||a.$current,l="[object SVGAnimatedString]"===Object.prototype.toString.call(f.prop("href"))?"xlink:href":"href",m=null,n="A"===f.prop("tagName").toUpperCase(),o="FORM"===f[0].nodeName,p=o?"action":l,q=!0,r={relative:k,inherit:!0},s=e.$eval(g.uiSrefOpts)||{};b.forEach(d,function(a){a in s&&(r[a]=s[a])});var t=function(c){if(c&&(j=b.copy(c)),q){m=a.href(i.state,j,r);var d=h[1]||h[0];return d&&d.$$addStateInfo(i.state,j),null===m?(q=!1,!1):void g.$set(p,m)}};i.paramExpr&&(e.$watch(i.paramExpr,function(a,b){a!==j&&t(a)},!0),j=b.copy(e.$eval(i.paramExpr))),t(),o||f.bind("click",function(b){var d=b.which||b.button;if(!(d>1||b.ctrlKey||b.metaKey||b.shiftKey||f.attr("target"))){var e=c(function(){a.go(i.state,j,r)});b.preventDefault();var g=n&&!m?1:0;b.preventDefault=function(){g--<=0&&c.cancel(e)}}})}}}function E(a,b,c){return{restrict:"A",controller:["$scope","$element","$attrs",function(b,d,e){function f(){g()?d.addClass(i):d.removeClass(i)}function g(){for(var a=0;a<j.length;a++)if(h(j[a].state,j[a].params))return!0;return!1}function h(b,c){return"undefined"!=typeof e.uiSrefActiveEq?a.is(b.name,c):a.includes(b.name,c)}var i,j=[];i=c(e.uiSrefActiveEq||e.uiSrefActive||"",!1)(b),this.$$addStateInfo=function(b,c){var e=a.get(b,C(d));j.push({state:e||{name:b},params:c}),f()},b.$on("$stateChangeSuccess",f)}]}}function F(a){var b=function(b){return a.is(b)};return b.$stateful=!0,b}function G(a){var b=function(b){return a.includes(b)};return b.$stateful=!0,b}var H=b.isDefined,I=b.isFunction,J=b.isString,K=b.isObject,L=b.isArray,M=b.forEach,N=b.extend,O=b.copy;b.module("ui.router.util",["ng"]),b.module("ui.router.router",["ui.router.util"]),b.module("ui.router.state",["ui.router.router","ui.router.util"]),b.module("ui.router",["ui.router.state"]),b.module("ui.router.compat",["ui.router"]),p.$inject=["$q","$injector"],b.module("ui.router.util").service("$resolve",p),q.$inject=["$http","$templateCache","$injector"],b.module("ui.router.util").service("$templateFactory",q);var P;r.prototype.concat=function(a,b){var c={caseInsensitive:P.caseInsensitive(),strict:P.strictMode(),squash:P.defaultSquashPolicy()};return new r(this.sourcePath+a+this.sourceSearch,N(c,b),this)},r.prototype.toString=function(){return this.source},r.prototype.exec=function(a,b){function c(a){function b(a){return a.split("").reverse().join("")}function c(a){return a.replace(/\\-/g,"-")}var d=b(a).split(/-(?!\\)/),e=o(d,b);return o(e,c).reverse()}var d=this.regexp.exec(a);if(!d)return null;b=b||{};var e,f,g,h=this.parameters(),i=h.length,j=this.segments.length-1,k={};if(j!==d.length-1)throw new Error("Unbalanced capture group in route '"+this.source+"'");for(e=0;j>e;e++){g=h[e];var l=this.params[g],m=d[e+1];for(f=0;f<l.replace;f++)l.replace[f].from===m&&(m=l.replace[f].to);m&&l.array===!0&&(m=c(m)),k[g]=l.value(m)}for(;i>e;e++)g=h[e],k[g]=this.params[g].value(b[g]);return k},r.prototype.parameters=function(a){return H(a)?this.params[a]||null:this.$$paramNames},r.prototype.validates=function(a){return this.params.$$validates(a)},r.prototype.format=function(a){function b(a){return encodeURIComponent(a).replace(/-/g,function(a){return"%5C%"+a.charCodeAt(0).toString(16).toUpperCase()})}a=a||{};var c=this.segments,d=this.parameters(),e=this.params;if(!this.validates(a))return null;var f,g=!1,h=c.length-1,i=d.length,j=c[0];for(f=0;i>f;f++){var k=h>f,l=d[f],m=e[l],n=m.value(a[l]),p=m.isOptional&&m.type.equals(m.value(),n),q=p?m.squash:!1,r=m.type.encode(n);if(k){var s=c[f+1];if(q===!1)null!=r&&(j+=L(r)?o(r,b).join("-"):encodeURIComponent(r)),j+=s;else if(q===!0){var t=j.match(/\/$/)?/\/?(.*)/:/(.*)/;j+=s.match(t)[1]}else J(q)&&(j+=q+s)}else{if(null==r||p&&q!==!1)continue;L(r)||(r=[r]),r=o(r,encodeURIComponent).join("&"+l+"="),j+=(g?"&":"?")+(l+"="+r),g=!0}}return j},s.prototype.is=function(a,b){return!0},s.prototype.encode=function(a,b){return a},s.prototype.decode=function(a,b){return a},s.prototype.equals=function(a,b){return a==b},s.prototype.$subPattern=function(){var a=this.pattern.toString();return a.substr(1,a.length-2)},s.prototype.pattern=/.*/,s.prototype.toString=function(){return"{Type:"+this.name+"}"},s.prototype.$normalize=function(a){return this.is(a)?a:this.decode(a)},s.prototype.$asArray=function(a,b){function d(a,b){function d(a,b){return function(){return a[b].apply(a,arguments)}}function e(a){return L(a)?a:H(a)?[a]:[]}function f(a){switch(a.length){case 0:return c;case 1:return"auto"===b?a[0]:a;default:return a}}function g(a){return!a}function h(a,b){return function(c){c=e(c);var d=o(c,a);return b===!0?0===n(d,g).length:f(d)}}function i(a){return function(b,c){var d=e(b),f=e(c);if(d.length!==f.length)return!1;for(var g=0;g<d.length;g++)if(!a(d[g],f[g]))return!1;return!0}}this.encode=h(d(a,"encode")),this.decode=h(d(a,"decode")),this.is=h(d(a,"is"),!0),this.equals=i(d(a,"equals")),this.pattern=a.pattern,this.$normalize=h(d(a,"$normalize")),this.name=a.name,this.$arrayMode=b}if(!a)return this;if("auto"===a&&!b)throw new Error("'auto' array mode is for query parameters only");return new d(this,a)},b.module("ui.router.util").provider("$urlMatcherFactory",t),b.module("ui.router.util").run(["$urlMatcherFactory",function(a){}]),u.$inject=["$locationProvider","$urlMatcherFactoryProvider"],b.module("ui.router.router").provider("$urlRouter",u),v.$inject=["$urlRouterProvider","$urlMatcherFactoryProvider"],b.module("ui.router.state").value("$stateParams",{}).provider("$state",v),w.$inject=[],b.module("ui.router.state").provider("$view",w),b.module("ui.router.state").provider("$uiViewScroll",x),y.$inject=["$state","$injector","$uiViewScroll","$interpolate"],z.$inject=["$compile","$controller","$state","$interpolate"],b.module("ui.router.state").directive("uiView",y),b.module("ui.router.state").directive("uiView",z),D.$inject=["$state","$timeout"],E.$inject=["$state","$stateParams","$interpolate"],b.module("ui.router.state").directive("uiSref",D).directive("uiSrefActive",E).directive("uiSrefActiveEq",E),F.$inject=["$state"],G.$inject=["$state"],b.module("ui.router.state").filter("isState",F).filter("includedByState",G)}(window,window.angular); | |
| 9 | 9 | \ No newline at end of file | ... | ... |
src/main/resources/static/assets/bower_components/angular-ui-router/src/state.js
| ... | ... | @@ -765,7 +765,7 @@ function $StateProvider( $urlRouterProvider, $urlMatcherFactory) { |
| 765 | 765 | return null; |
| 766 | 766 | } |
| 767 | 767 | |
| 768 | - // Allow the handler to return a promise to defer state lookup retry | |
| 768 | + // Allow the handlers to return a promise to defer state lookup retry | |
| 769 | 769 | if (options.$retry) { |
| 770 | 770 | $urlRouter.update(); |
| 771 | 771 | return TransitionFailed; | ... | ... |
src/main/resources/static/assets/bower_components/angular-ui-router/src/urlRouter.js
| ... | ... | @@ -122,14 +122,14 @@ function $UrlRouterProvider( $locationProvider, $urlMatcherFactory) { |
| 122 | 122 | * @methodOf ui.router.router.$urlRouterProvider |
| 123 | 123 | * |
| 124 | 124 | * @description |
| 125 | - * Registers a handler for a given url matching. if handle is a string, it is | |
| 125 | + * Registers a handlers for a given url matching. if handle is a string, it is | |
| 126 | 126 | * treated as a redirect, and is interpolated according to the syntax of match |
| 127 | 127 | * (i.e. like `String.replace()` for `RegExp`, or like a `UrlMatcher` pattern otherwise). |
| 128 | 128 | * |
| 129 | - * If the handler is a function, it is injectable. It gets invoked if `$location` | |
| 129 | + * If the handlers is a function, it is injectable. It gets invoked if `$location` | |
| 130 | 130 | * matches. You have the option of inject the match object as `$match`. |
| 131 | 131 | * |
| 132 | - * The handler can return | |
| 132 | + * The handlers can return | |
| 133 | 133 | * |
| 134 | 134 | * - **falsy** to indicate that the rule didn't match after all, then `$urlRouter` |
| 135 | 135 | * will continue trying to find another one that matches. |
| ... | ... | @@ -158,7 +158,7 @@ function $UrlRouterProvider( $locationProvider, $urlMatcherFactory) { |
| 158 | 158 | if (isString(what)) what = $urlMatcherFactory.compile(what); |
| 159 | 159 | |
| 160 | 160 | if (!handlerIsString && !isFunction(handler) && !isArray(handler)) |
| 161 | - throw new Error("invalid 'handler' in when()"); | |
| 161 | + throw new Error("invalid 'handlers' in when()"); | |
| 162 | 162 | |
| 163 | 163 | var strategies = { |
| 164 | 164 | matcher: function (what, handler) { |
| ... | ... | @@ -207,7 +207,7 @@ function $UrlRouterProvider( $locationProvider, $urlMatcherFactory) { |
| 207 | 207 | * If you wish to customize the behavior of syncing the URL (for example, if you wish to |
| 208 | 208 | * defer a transition but maintain the current URL), call this method at configuration time. |
| 209 | 209 | * Then, at run time, call `$urlRouter.listen()` after you have configured your own |
| 210 | - * `$locationChangeSuccess` event handler. | |
| 210 | + * `$locationChangeSuccess` event handlers. | |
| 211 | 211 | * |
| 212 | 212 | * @example |
| 213 | 213 | * <pre> |
| ... | ... | @@ -226,7 +226,7 @@ function $UrlRouterProvider( $locationProvider, $urlMatcherFactory) { |
| 226 | 226 | * // UserService is an example service for managing user state |
| 227 | 227 | * if (UserService.isLoggedIn()) return; |
| 228 | 228 | * |
| 229 | - * // Prevent $urlRouter's default handler from firing | |
| 229 | + * // Prevent $urlRouter's default handlers from firing | |
| 230 | 230 | * e.preventDefault(); |
| 231 | 231 | * |
| 232 | 232 | * UserService.handleLogin().then(function() { | ... | ... |
src/main/resources/static/assets/bower_components/angular/angular.js
| ... | ... | @@ -3067,7 +3067,7 @@ function jqLiteDocumentLoaded(action, win) { |
| 3067 | 3067 | // i.e. it will definitely not be in a $apply |
| 3068 | 3068 | win.setTimeout(action); |
| 3069 | 3069 | } else { |
| 3070 | - // No need to unbind this handler as load is only ever called once | |
| 3070 | + // No need to unbind this handlers as load is only ever called once | |
| 3071 | 3071 | jqLite(win).on('load', action); |
| 3072 | 3072 | } |
| 3073 | 3073 | } |
| ... | ... | @@ -3349,7 +3349,7 @@ function createEventHandler(element, events) { |
| 3349 | 3349 | return event.immediatePropagationStopped === true; |
| 3350 | 3350 | }; |
| 3351 | 3351 | |
| 3352 | - // Some events have special handlers that wrap the real handler | |
| 3352 | + // Some events have special handlers that wrap the real handlers | |
| 3353 | 3353 | var handlerWrapper = eventFns.specialHandlerWrapper || defaultHandlerWrapper; |
| 3354 | 3354 | |
| 3355 | 3355 | // Copy event handlers in case event handlers array is modified during execution. |
| ... | ... | @@ -3379,7 +3379,7 @@ function specialMouseHandlerWrapper(target, event, handler) { |
| 3379 | 3379 | // Read about mouseenter and mouseleave: |
| 3380 | 3380 | // http://www.quirksmode.org/js/events_mouse.html#link8 |
| 3381 | 3381 | var related = event.relatedTarget; |
| 3382 | - // For mousenter/leave call the handler if related is outside the target. | |
| 3382 | + // For mousenter/leave call the handlers if related is outside the target. | |
| 3383 | 3383 | // NB: No relatedTarget if the mouse left/entered the browser window |
| 3384 | 3384 | if (!related || (related !== target && !jqLiteContains.call(target, related))) { |
| 3385 | 3385 | handler.call(target, event); |
| ... | ... | @@ -5992,7 +5992,7 @@ function Browser(window, document, $log, $sniffer) { |
| 5992 | 5992 | |
| 5993 | 5993 | /** |
| 5994 | 5994 | * @private |
| 5995 | - * Remove popstate and hashchange handler from window. | |
| 5995 | + * Remove popstate and hashchange handlers from window. | |
| 5996 | 5996 | * |
| 5997 | 5997 | * NOTE: this api is intended for use only by $rootScope. |
| 5998 | 5998 | */ |
| ... | ... | @@ -12581,7 +12581,7 @@ function $LocationProvider() { |
| 12581 | 12581 | defaultPrevented = $rootScope.$broadcast('$locationChangeStart', newUrl, oldUrl, |
| 12582 | 12582 | newState, oldState).defaultPrevented; |
| 12583 | 12583 | |
| 12584 | - // if the location was changed by a `$locationChangeStart` handler then stop | |
| 12584 | + // if the location was changed by a `$locationChangeStart` handlers then stop | |
| 12585 | 12585 | // processing this location change |
| 12586 | 12586 | if ($location.absUrl() !== newUrl) return; |
| 12587 | 12587 | |
| ... | ... | @@ -12615,7 +12615,7 @@ function $LocationProvider() { |
| 12615 | 12615 | var defaultPrevented = $rootScope.$broadcast('$locationChangeStart', newUrl, oldUrl, |
| 12616 | 12616 | $location.$$state, oldState).defaultPrevented; |
| 12617 | 12617 | |
| 12618 | - // if the location was changed by a `$locationChangeStart` handler then stop | |
| 12618 | + // if the location was changed by a `$locationChangeStart` handlers then stop | |
| 12619 | 12619 | // processing this location change |
| 12620 | 12620 | if ($location.absUrl() !== newUrl) return; |
| 12621 | 12621 | |
| ... | ... | @@ -16308,7 +16308,7 @@ function $RootScopeProvider() { |
| 16308 | 16308 | * unrolling of the loop. |
| 16309 | 16309 | * |
| 16310 | 16310 | * Just before a scope is destroyed, a `$destroy` event is broadcasted on this scope. |
| 16311 | - * Application code can register a `$destroy` event handler that will give it a chance to | |
| 16311 | + * Application code can register a `$destroy` event handlers that will give it a chance to | |
| 16312 | 16312 | * perform any necessary cleanup. |
| 16313 | 16313 | * |
| 16314 | 16314 | * Note that, in AngularJS, there is also a `$destroy` jQuery event, which can be used to |
| ... | ... | @@ -20994,7 +20994,7 @@ var formDirectiveFactory = function(isNgForm) { |
| 20994 | 20994 | // action is not prevented. see #1238 |
| 20995 | 20995 | // |
| 20996 | 20996 | // IE 9 is not affected because it doesn't fire a submit event and try to do a full |
| 20997 | - // page reload if the form was destroyed by submission of the form via a click handler | |
| 20997 | + // page reload if the form was destroyed by submission of the form via a click handlers | |
| 20998 | 20998 | // on a button in the form. Looks like an IE9 specific bug. |
| 20999 | 20999 | var handleFormSubmission = function(event) { |
| 21000 | 21000 | scope.$apply(function() { |
| ... | ... | @@ -24084,7 +24084,7 @@ forEach( |
| 24084 | 24084 | compile: function($element, attr) { |
| 24085 | 24085 | // We expose the powerful $event object on the scope that provides access to the Window, |
| 24086 | 24086 | // etc. that isn't protected by the fast paths in $parse. We explicitly request better |
| 24087 | - // checks at the cost of speed since event handler expressions are not executed as | |
| 24087 | + // checks at the cost of speed since event handlers expressions are not executed as | |
| 24088 | 24088 | // frequently as regular change detection. |
| 24089 | 24089 | var fn = $parse(attr[directiveName], /* interceptorFn */ null, /* expensiveChecks */ true); |
| 24090 | 24090 | return function ngEventHandler(scope, element) { |
| ... | ... | @@ -25893,7 +25893,7 @@ var NgModelController = ['$scope', '$exceptionHandler', '$attrs', '$element', '$ |
| 25893 | 25893 | * Update the view value. |
| 25894 | 25894 | * |
| 25895 | 25895 | * This method should be called when a control wants to change the view value; typically, |
| 25896 | - * this is done from within a DOM event handler. For example, the {@link ng.directive:input input} | |
| 25896 | + * this is done from within a DOM event handlers. For example, the {@link ng.directive:input input} | |
| 25897 | 25897 | * directive calls it when the value of the input changes and {@link ng.directive:select select} |
| 25898 | 25898 | * calls it when an option is selected. |
| 25899 | 25899 | * |
| ... | ... | @@ -26909,7 +26909,7 @@ var ngOptionsDirective = ['$compile', '$parse', function($compile, $parse) { |
| 26909 | 26909 | getWatchables: $parse(valuesFn, function(optionValues) { |
| 26910 | 26910 | // Create a collection of things that we would like to watch (watchedArray) |
| 26911 | 26911 | // so that they can all be watched using a single $watchCollection |
| 26912 | - // that only runs the handler once if anything changes | |
| 26912 | + // that only runs the handlers once if anything changes | |
| 26913 | 26913 | var watchedArray = []; |
| 26914 | 26914 | optionValues = optionValues || []; |
| 26915 | 26915 | ... | ... |
src/main/resources/static/assets/bower_components/handsontable/dist/handsontable.full.js
| ... | ... | @@ -30159,7 +30159,7 @@ if (typeof exports !== "undefined") { |
| 30159 | 30159 | return typeof elements.length !== "number" ? [ elements ] : elements; |
| 30160 | 30160 | }; |
| 30161 | 30161 | /** |
| 30162 | - * Add a `mouseover` handler function for a clipped element. | |
| 30162 | + * Add a `mouseover` handlers function for a clipped element. | |
| 30163 | 30163 | * |
| 30164 | 30164 | * @returns `undefined` |
| 30165 | 30165 | * @private |
| ... | ... | @@ -30199,7 +30199,7 @@ if (typeof exports !== "undefined") { |
| 30199 | 30199 | }; |
| 30200 | 30200 | }; |
| 30201 | 30201 | /** |
| 30202 | - * Remove a `mouseover` handler function for a clipped element. | |
| 30202 | + * Remove a `mouseover` handlers function for a clipped element. | |
| 30203 | 30203 | * |
| 30204 | 30204 | * @returns `undefined` |
| 30205 | 30205 | * @private |
| ... | ... | @@ -30240,7 +30240,7 @@ if (typeof exports !== "undefined") { |
| 30240 | 30240 | return _clientOn.apply(this, _args(arguments)); |
| 30241 | 30241 | }; |
| 30242 | 30242 | /** |
| 30243 | - * Unregister an event handler from the client. | |
| 30243 | + * Unregister an event handlers from the client. | |
| 30244 | 30244 | * If no `listener` function/object is provided, it will unregister all handlers for the provided `eventType`. |
| 30245 | 30245 | * If no `eventType` is provided, it will unregister all handlers for every event type. |
| 30246 | 30246 | * | ... | ... |
src/main/resources/static/assets/bower_components/handsontable/dist/zeroclipboard/ZeroClipboard.js
| ... | ... | @@ -2353,7 +2353,7 @@ |
| 2353 | 2353 | return typeof elements.length !== "number" ? [ elements ] : elements; |
| 2354 | 2354 | }; |
| 2355 | 2355 | /** |
| 2356 | - * Add a `mouseover` handler function for a clipped element. | |
| 2356 | + * Add a `mouseover` handlers function for a clipped element. | |
| 2357 | 2357 | * |
| 2358 | 2358 | * @returns `undefined` |
| 2359 | 2359 | * @private |
| ... | ... | @@ -2393,7 +2393,7 @@ |
| 2393 | 2393 | }; |
| 2394 | 2394 | }; |
| 2395 | 2395 | /** |
| 2396 | - * Remove a `mouseover` handler function for a clipped element. | |
| 2396 | + * Remove a `mouseover` handlers function for a clipped element. | |
| 2397 | 2397 | * |
| 2398 | 2398 | * @returns `undefined` |
| 2399 | 2399 | * @private |
| ... | ... | @@ -2434,7 +2434,7 @@ |
| 2434 | 2434 | return _clientOn.apply(this, _args(arguments)); |
| 2435 | 2435 | }; |
| 2436 | 2436 | /** |
| 2437 | - * Unregister an event handler from the client. | |
| 2437 | + * Unregister an event handlers from the client. | |
| 2438 | 2438 | * If no `listener` function/object is provided, it will unregister all handlers for the provided `eventType`. |
| 2439 | 2439 | * If no `eventType` is provided, it will unregister all handlers for every event type. |
| 2440 | 2440 | * | ... | ... |
src/main/resources/static/assets/bower_components/zeroclipboard/dist/ZeroClipboard.js
| ... | ... | @@ -2488,7 +2488,7 @@ |
| 2488 | 2488 | return typeof elements.length !== "number" ? [ elements ] : elements; |
| 2489 | 2489 | }; |
| 2490 | 2490 | /** |
| 2491 | - * Add a `mouseover` handler function for a clipped element. | |
| 2491 | + * Add a `mouseover` handlers function for a clipped element. | |
| 2492 | 2492 | * |
| 2493 | 2493 | * @returns `undefined` |
| 2494 | 2494 | * @private |
| ... | ... | @@ -2528,7 +2528,7 @@ |
| 2528 | 2528 | }; |
| 2529 | 2529 | }; |
| 2530 | 2530 | /** |
| 2531 | - * Remove a `mouseover` handler function for a clipped element. | |
| 2531 | + * Remove a `mouseover` handlers function for a clipped element. | |
| 2532 | 2532 | * |
| 2533 | 2533 | * @returns `undefined` |
| 2534 | 2534 | * @private |
| ... | ... | @@ -2569,7 +2569,7 @@ |
| 2569 | 2569 | return _clientOn.apply(this, _args(arguments)); |
| 2570 | 2570 | }; |
| 2571 | 2571 | /** |
| 2572 | - * Unregister an event handler from the client. | |
| 2572 | + * Unregister an event handlers from the client. | |
| 2573 | 2573 | * If no `listener` function/object is provided, it will unregister all handlers for the provided `eventType`. |
| 2574 | 2574 | * If no `eventType` is provided, it will unregister all handlers for every event type. |
| 2575 | 2575 | * | ... | ... |
src/main/resources/static/assets/js/angular.js
| ... | ... | @@ -3067,7 +3067,7 @@ function jqLiteDocumentLoaded(action, win) { |
| 3067 | 3067 | // i.e. it will definitely not be in a $apply |
| 3068 | 3068 | win.setTimeout(action); |
| 3069 | 3069 | } else { |
| 3070 | - // No need to unbind this handler as load is only ever called once | |
| 3070 | + // No need to unbind this handlers as load is only ever called once | |
| 3071 | 3071 | jqLite(win).on('load', action); |
| 3072 | 3072 | } |
| 3073 | 3073 | } |
| ... | ... | @@ -3349,7 +3349,7 @@ function createEventHandler(element, events) { |
| 3349 | 3349 | return event.immediatePropagationStopped === true; |
| 3350 | 3350 | }; |
| 3351 | 3351 | |
| 3352 | - // Some events have special handlers that wrap the real handler | |
| 3352 | + // Some events have special handlers that wrap the real handlers | |
| 3353 | 3353 | var handlerWrapper = eventFns.specialHandlerWrapper || defaultHandlerWrapper; |
| 3354 | 3354 | |
| 3355 | 3355 | // Copy event handlers in case event handlers array is modified during execution. |
| ... | ... | @@ -3379,7 +3379,7 @@ function specialMouseHandlerWrapper(target, event, handler) { |
| 3379 | 3379 | // Read about mouseenter and mouseleave: |
| 3380 | 3380 | // http://www.quirksmode.org/js/events_mouse.html#link8 |
| 3381 | 3381 | var related = event.relatedTarget; |
| 3382 | - // For mousenter/leave call the handler if related is outside the target. | |
| 3382 | + // For mousenter/leave call the handlers if related is outside the target. | |
| 3383 | 3383 | // NB: No relatedTarget if the mouse left/entered the browser window |
| 3384 | 3384 | if (!related || (related !== target && !jqLiteContains.call(target, related))) { |
| 3385 | 3385 | handler.call(target, event); |
| ... | ... | @@ -5992,7 +5992,7 @@ function Browser(window, document, $log, $sniffer) { |
| 5992 | 5992 | |
| 5993 | 5993 | /** |
| 5994 | 5994 | * @private |
| 5995 | - * Remove popstate and hashchange handler from window. | |
| 5995 | + * Remove popstate and hashchange handlers from window. | |
| 5996 | 5996 | * |
| 5997 | 5997 | * NOTE: this api is intended for use only by $rootScope. |
| 5998 | 5998 | */ |
| ... | ... | @@ -12581,7 +12581,7 @@ function $LocationProvider() { |
| 12581 | 12581 | defaultPrevented = $rootScope.$broadcast('$locationChangeStart', newUrl, oldUrl, |
| 12582 | 12582 | newState, oldState).defaultPrevented; |
| 12583 | 12583 | |
| 12584 | - // if the location was changed by a `$locationChangeStart` handler then stop | |
| 12584 | + // if the location was changed by a `$locationChangeStart` handlers then stop | |
| 12585 | 12585 | // processing this location change |
| 12586 | 12586 | if ($location.absUrl() !== newUrl) return; |
| 12587 | 12587 | |
| ... | ... | @@ -12615,7 +12615,7 @@ function $LocationProvider() { |
| 12615 | 12615 | var defaultPrevented = $rootScope.$broadcast('$locationChangeStart', newUrl, oldUrl, |
| 12616 | 12616 | $location.$$state, oldState).defaultPrevented; |
| 12617 | 12617 | |
| 12618 | - // if the location was changed by a `$locationChangeStart` handler then stop | |
| 12618 | + // if the location was changed by a `$locationChangeStart` handlers then stop | |
| 12619 | 12619 | // processing this location change |
| 12620 | 12620 | if ($location.absUrl() !== newUrl) return; |
| 12621 | 12621 | |
| ... | ... | @@ -16308,7 +16308,7 @@ function $RootScopeProvider() { |
| 16308 | 16308 | * unrolling of the loop. |
| 16309 | 16309 | * |
| 16310 | 16310 | * Just before a scope is destroyed, a `$destroy` event is broadcasted on this scope. |
| 16311 | - * Application code can register a `$destroy` event handler that will give it a chance to | |
| 16311 | + * Application code can register a `$destroy` event handlers that will give it a chance to | |
| 16312 | 16312 | * perform any necessary cleanup. |
| 16313 | 16313 | * |
| 16314 | 16314 | * Note that, in AngularJS, there is also a `$destroy` jQuery event, which can be used to |
| ... | ... | @@ -20994,7 +20994,7 @@ var formDirectiveFactory = function(isNgForm) { |
| 20994 | 20994 | // action is not prevented. see #1238 |
| 20995 | 20995 | // |
| 20996 | 20996 | // IE 9 is not affected because it doesn't fire a submit event and try to do a full |
| 20997 | - // page reload if the form was destroyed by submission of the form via a click handler | |
| 20997 | + // page reload if the form was destroyed by submission of the form via a click handlers | |
| 20998 | 20998 | // on a button in the form. Looks like an IE9 specific bug. |
| 20999 | 20999 | var handleFormSubmission = function(event) { |
| 21000 | 21000 | scope.$apply(function() { |
| ... | ... | @@ -24084,7 +24084,7 @@ forEach( |
| 24084 | 24084 | compile: function($element, attr) { |
| 24085 | 24085 | // We expose the powerful $event object on the scope that provides access to the Window, |
| 24086 | 24086 | // etc. that isn't protected by the fast paths in $parse. We explicitly request better |
| 24087 | - // checks at the cost of speed since event handler expressions are not executed as | |
| 24087 | + // checks at the cost of speed since event handlers expressions are not executed as | |
| 24088 | 24088 | // frequently as regular change detection. |
| 24089 | 24089 | var fn = $parse(attr[directiveName], /* interceptorFn */ null, /* expensiveChecks */ true); |
| 24090 | 24090 | return function ngEventHandler(scope, element) { |
| ... | ... | @@ -25893,7 +25893,7 @@ var NgModelController = ['$scope', '$exceptionHandler', '$attrs', '$element', '$ |
| 25893 | 25893 | * Update the view value. |
| 25894 | 25894 | * |
| 25895 | 25895 | * This method should be called when a control wants to change the view value; typically, |
| 25896 | - * this is done from within a DOM event handler. For example, the {@link ng.directive:input input} | |
| 25896 | + * this is done from within a DOM event handlers. For example, the {@link ng.directive:input input} | |
| 25897 | 25897 | * directive calls it when the value of the input changes and {@link ng.directive:select select} |
| 25898 | 25898 | * calls it when an option is selected. |
| 25899 | 25899 | * |
| ... | ... | @@ -26909,7 +26909,7 @@ var ngOptionsDirective = ['$compile', '$parse', function($compile, $parse) { |
| 26909 | 26909 | getWatchables: $parse(valuesFn, function(optionValues) { |
| 26910 | 26910 | // Create a collection of things that we would like to watch (watchedArray) |
| 26911 | 26911 | // so that they can all be watched using a single $watchCollection |
| 26912 | - // that only runs the handler once if anything changes | |
| 26912 | + // that only runs the handlers once if anything changes | |
| 26913 | 26913 | var watchedArray = []; |
| 26914 | 26914 | optionValues = optionValues || []; |
| 26915 | 26915 | ... | ... |
src/main/resources/static/assets/js/baidu/TextIconOverlay.js
| ... | ... | @@ -15,11 +15,11 @@ var BMapLib = window.BMapLib = BMapLib || {}; |
| 15 | 15 | |
| 16 | 16 | (function () { |
| 17 | 17 | |
| 18 | - /** | |
| 19 | - * 声明baidu包 | |
| 20 | - */ | |
| 18 | + /** | |
| 19 | + * 声明baidu包 | |
| 20 | + */ | |
| 21 | 21 | var T, |
| 22 | - baidu = T = baidu || {version: "1.3.8"}; | |
| 22 | + baidu = T = baidu || {version: "1.3.8"}; | |
| 23 | 23 | |
| 24 | 24 | (function (){ |
| 25 | 25 | //提出guid,防止在与老版本Tangram混用时 |
| ... | ... | @@ -34,8 +34,8 @@ var BMapLib = window.BMapLib = BMapLib || {}; |
| 34 | 34 | * @ignore |
| 35 | 35 | * @namespace baidu.dom 操作dom的方法。 |
| 36 | 36 | */ |
| 37 | - baidu.dom = baidu.dom || {}; | |
| 38 | - | |
| 37 | + baidu.dom = baidu.dom || {}; | |
| 38 | + | |
| 39 | 39 | |
| 40 | 40 | /** |
| 41 | 41 | * 从文档中获取指定的DOM元素 |
| ... | ... | @@ -581,7 +581,7 @@ var BMapLib = window.BMapLib = BMapLib || {}; |
| 581 | 581 | |
| 582 | 582 | /** |
| 583 | 583 | * 注册对象的事件监听器。引入baidu.lang.Event后,Class的子类实例才会获得该方法。 |
| 584 | - * @grammar obj.addEventListener(type, handler[, key]) | |
| 584 | + * @grammar obj.addEventListener(type, handlers[, key]) | |
| 585 | 585 | * @param {string} type 自定义事件的名称 |
| 586 | 586 | * @param {Function} handler 自定义事件被触发时应该调用的回调函数 |
| 587 | 587 | * @param {string} [key] 为事件监听函数指定的名称,可在移除时使用。如果不提供,方法会默认为它生成一个全局唯一的key。 |
| ... | ... | @@ -613,7 +613,7 @@ var BMapLib = window.BMapLib = BMapLib || {}; |
| 613 | 613 | |
| 614 | 614 | /** |
| 615 | 615 | * 移除对象的事件监听器。引入baidu.lang.Event后,Class的子类实例才会获得该方法。 |
| 616 | - * @grammar obj.removeEventListener(type, handler) | |
| 616 | + * @grammar obj.removeEventListener(type, handlers) | |
| 617 | 617 | * @param {string} type 事件类型 |
| 618 | 618 | * @param {Function|string} handler 要移除的事件监听函数或者监听函数的key |
| 619 | 619 | * @remark 如果第二个参数handler没有被绑定到对应的自定义事件中,什么也不做。 |
| ... | ... | @@ -704,23 +704,23 @@ var BMapLib = window.BMapLib = BMapLib || {}; |
| 704 | 704 | baidu.inherits = baidu.lang.inherits; |
| 705 | 705 | })(); |
| 706 | 706 | |
| 707 | - | |
| 708 | - /** | |
| 707 | + | |
| 708 | + /** | |
| 709 | 709 | |
| 710 | - * 图片的路径 | |
| 710 | + * 图片的路径 | |
| 711 | 711 | |
| 712 | 712 | * @private |
| 713 | - * @type {String} | |
| 713 | + * @type {String} | |
| 714 | 714 | |
| 715 | 715 | */ |
| 716 | 716 | var _IMAGE_PATH = 'http://api.map.baidu.com/library/TextIconOverlay/1.2/src/images/m'; |
| 717 | 717 | |
| 718 | - /** | |
| 718 | + /** | |
| 719 | 719 | |
| 720 | - * 图片的后缀名 | |
| 720 | + * 图片的后缀名 | |
| 721 | 721 | |
| 722 | 722 | * @private |
| 723 | - * @type {String} | |
| 723 | + * @type {String} | |
| 724 | 724 | |
| 725 | 725 | */ |
| 726 | 726 | var _IMAGE_EXTENSION = 'png'; |
| ... | ... | @@ -930,72 +930,72 @@ var BMapLib = window.BMapLib = BMapLib || {}; |
| 930 | 930 | }; |
| 931 | 931 | |
| 932 | 932 | |
| 933 | - /** | |
| 933 | + /** | |
| 934 | 934 | |
| 935 | - * 当鼠标点击该覆盖物时会触发该事件 | |
| 935 | + * 当鼠标点击该覆盖物时会触发该事件 | |
| 936 | 936 | |
| 937 | - * @name TextIconOverlay#click | |
| 937 | + * @name TextIconOverlay#click | |
| 938 | 938 | |
| 939 | - * @event | |
| 939 | + * @event | |
| 940 | 940 | |
| 941 | - * @param {Event Object} e 回调函数会返回event参数,包括以下返回值: | |
| 941 | + * @param {Event Object} e 回调函数会返回event参数,包括以下返回值: | |
| 942 | 942 | |
| 943 | - * <br />"<b>type</b> : {String} 事件类型 | |
| 943 | + * <br />"<b>type</b> : {String} 事件类型 | |
| 944 | 944 | |
| 945 | - * <br />"<b>target</b>:{BMapLib.TextIconOverlay} 事件目标 | |
| 945 | + * <br />"<b>target</b>:{BMapLib.TextIconOverlay} 事件目标 | |
| 946 | 946 | |
| 947 | - * | |
| 947 | + * | |
| 948 | 948 | |
| 949 | 949 | */ |
| 950 | 950 | |
| 951 | - /** | |
| 951 | + /** | |
| 952 | 952 | |
| 953 | - * 当鼠标进入该覆盖物区域时会触发该事件 | |
| 953 | + * 当鼠标进入该覆盖物区域时会触发该事件 | |
| 954 | 954 | |
| 955 | - * @name TextIconOverlay#mouseover | |
| 955 | + * @name TextIconOverlay#mouseover | |
| 956 | 956 | |
| 957 | 957 | * @event |
| 958 | - * @param {Event Object} e 回调函数会返回event参数,包括以下返回值: | |
| 958 | + * @param {Event Object} e 回调函数会返回event参数,包括以下返回值: | |
| 959 | 959 | |
| 960 | - * <br />"<b>type</b> : {String} 事件类型 | |
| 960 | + * <br />"<b>type</b> : {String} 事件类型 | |
| 961 | 961 | |
| 962 | - * <br />"<b>target</b>:{BMapLib.TextIconOverlay} 事件目标 | |
| 962 | + * <br />"<b>target</b>:{BMapLib.TextIconOverlay} 事件目标 | |
| 963 | 963 | |
| 964 | - * <br />"<b>point</b> : {BMap.Point} 最新添加上的节点BMap.Point对象 | |
| 964 | + * <br />"<b>point</b> : {BMap.Point} 最新添加上的节点BMap.Point对象 | |
| 965 | 965 | |
| 966 | - * <br />"<b>pixel</b>:{BMap.pixel} 最新添加上的节点BMap.Pixel对象 | |
| 966 | + * <br />"<b>pixel</b>:{BMap.pixel} 最新添加上的节点BMap.Pixel对象 | |
| 967 | 967 | |
| 968 | - * | |
| 968 | + * | |
| 969 | 969 | |
| 970 | - * @example <b>参考示例:</b><br /> | |
| 970 | + * @example <b>参考示例:</b><br /> | |
| 971 | 971 | |
| 972 | - * myTextIconOverlay.addEventListener("mouseover", function(e) { alert(e.point); }); | |
| 972 | + * myTextIconOverlay.addEventListener("mouseover", function(e) { alert(e.point); }); | |
| 973 | 973 | |
| 974 | 974 | */ |
| 975 | 975 | |
| 976 | - /** | |
| 976 | + /** | |
| 977 | 977 | |
| 978 | - * 当鼠标离开该覆盖物区域时会触发该事件 | |
| 978 | + * 当鼠标离开该覆盖物区域时会触发该事件 | |
| 979 | 979 | |
| 980 | - * @name TextIconOverlay#mouseout | |
| 980 | + * @name TextIconOverlay#mouseout | |
| 981 | 981 | |
| 982 | - * @event | |
| 982 | + * @event | |
| 983 | 983 | |
| 984 | - * @param {Event Object} e 回调函数会返回event参数,包括以下返回值: | |
| 984 | + * @param {Event Object} e 回调函数会返回event参数,包括以下返回值: | |
| 985 | 985 | |
| 986 | - * <br />"<b>type</b> : {String} 事件类型 | |
| 986 | + * <br />"<b>type</b> : {String} 事件类型 | |
| 987 | 987 | |
| 988 | - * <br />"<b>target</b>:{BMapLib.TextIconOverlay} 事件目标 | |
| 988 | + * <br />"<b>target</b>:{BMapLib.TextIconOverlay} 事件目标 | |
| 989 | 989 | |
| 990 | - * <br />"<b>point</b> : {BMap.Point} 最新添加上的节点BMap.Point对象 | |
| 990 | + * <br />"<b>point</b> : {BMap.Point} 最新添加上的节点BMap.Point对象 | |
| 991 | 991 | |
| 992 | - * <br />"<b>pixel</b>:{BMap.pixel} 最新添加上的节点BMap.Pixel对象 | |
| 992 | + * <br />"<b>pixel</b>:{BMap.pixel} 最新添加上的节点BMap.Pixel对象 | |
| 993 | 993 | |
| 994 | - * | |
| 994 | + * | |
| 995 | 995 | |
| 996 | - * @example <b>参考示例:</b><br /> | |
| 996 | + * @example <b>参考示例:</b><br /> | |
| 997 | 997 | |
| 998 | - * myTextIconOverlay.addEventListener("mouseout", function(e) { alert(e.point); }); | |
| 998 | + * myTextIconOverlay.addEventListener("mouseout", function(e) { alert(e.point); }); | |
| 999 | 999 | |
| 1000 | 1000 | */ |
| 1001 | 1001 | ... | ... |
src/main/resources/static/assets/js/eventproxy.js
| ... | ... | @@ -326,7 +326,7 @@ |
| 326 | 326 | EventProxy.prototype.assign = EventProxy.prototype.all; |
| 327 | 327 | |
| 328 | 328 | /** |
| 329 | - * Assign the only one 'error' event handler. | |
| 329 | + * Assign the only one 'error' event handlers. | |
| 330 | 330 | * @param {Function(err)} callback |
| 331 | 331 | */ |
| 332 | 332 | EventProxy.prototype.fail = function (callback) { |
| ... | ... | @@ -334,7 +334,7 @@ |
| 334 | 334 | |
| 335 | 335 | that.once('error', function () { |
| 336 | 336 | that.unbind(); |
| 337 | - // put all arguments to the error handler | |
| 337 | + // put all arguments to the error handlers | |
| 338 | 338 | // fail(function(err, args1, args2, ...){}) |
| 339 | 339 | callback.apply(null, arguments); |
| 340 | 340 | }); |
| ... | ... | @@ -444,7 +444,7 @@ |
| 444 | 444 | that._after[group].index++; |
| 445 | 445 | return function (err, data) { |
| 446 | 446 | if (err) { |
| 447 | - // put all arguments to the error handler | |
| 447 | + // put all arguments to the error handlers | |
| 448 | 448 | return that.emit.apply(that, ['error'].concat(SLICE.call(arguments))); |
| 449 | 449 | } |
| 450 | 450 | that.emit(group, { |
| ... | ... | @@ -499,7 +499,7 @@ |
| 499 | 499 | }; |
| 500 | 500 | |
| 501 | 501 | /** |
| 502 | - * Success callback wrapper, will handler err for you. | |
| 502 | + * Success callback wrapper, will handlers err for you. | |
| 503 | 503 | * |
| 504 | 504 | * ```js |
| 505 | 505 | * fs.readFile('foo.txt', ep.done('content')); |
| ... | ... | @@ -535,7 +535,7 @@ |
| 535 | 535 | var that = this; |
| 536 | 536 | return function (err, data) { |
| 537 | 537 | if (err) { |
| 538 | - // put all arguments to the error handler | |
| 538 | + // put all arguments to the error handlers | |
| 539 | 539 | return that.emit.apply(that, ['error'].concat(SLICE.call(arguments))); |
| 540 | 540 | } |
| 541 | 541 | |
| ... | ... | @@ -552,7 +552,7 @@ |
| 552 | 552 | // only replace the args when it really return a result |
| 553 | 553 | return that.emit(handler, callback.apply(null, args)); |
| 554 | 554 | } else { |
| 555 | - // put all arguments to the done handler | |
| 555 | + // put all arguments to the done handlers | |
| 556 | 556 | //ep.done('some'); |
| 557 | 557 | //ep.on('some', function(args1, args2, ...){}); |
| 558 | 558 | return that.emit.apply(that, [handler].concat(args)); | ... | ... |
src/main/resources/static/assets/plugins/jquery.pjax.js
| ... | ... | @@ -39,7 +39,7 @@ function fnPjax(selector, container, options) { |
| 39 | 39 | }) |
| 40 | 40 | } |
| 41 | 41 | |
| 42 | -// Public: pjax on click handler | |
| 42 | +// Public: pjax on click handlers | |
| 43 | 43 | // |
| 44 | 44 | // Exported as $.pjax.click. |
| 45 | 45 | // |
| ... | ... | @@ -100,7 +100,7 @@ function handleClick(event, container, options) { |
| 100 | 100 | } |
| 101 | 101 | } |
| 102 | 102 | |
| 103 | -// Public: pjax on form submit handler | |
| 103 | +// Public: pjax on form submit handlers | |
| 104 | 104 | // |
| 105 | 105 | // Exported as $.pjax.submit |
| 106 | 106 | // |
| ... | ... | @@ -422,7 +422,7 @@ if ('state' in window.history) { |
| 422 | 422 | initialPop = false |
| 423 | 423 | } |
| 424 | 424 | |
| 425 | -// popstate handler takes care of the back and forward buttons | |
| 425 | +// popstate handlers takes care of the back and forward buttons | |
| 426 | 426 | // |
| 427 | 427 | // You probably shouldn't use pjax on pages with other pushState |
| 428 | 428 | // stuff yet. | ... | ... |
src/main/resources/static/metronic_v4.5.4/layout4/scripts/demo.js
src/main/resources/static/metronic_v4.5.4/plugins/bootstrap-editable/bootstrap-editable/js/bootstrap-editable.js
| ... | ... | @@ -94,7 +94,7 @@ Editableform is linked with one of input types, e.g. 'text', 'select' etc. |
| 94 | 94 | this.input.autosubmit(); |
| 95 | 95 | } |
| 96 | 96 | |
| 97 | - //attach 'cancel' handler | |
| 97 | + //attach 'cancel' handlers | |
| 98 | 98 | this.$form.find('.editable-cancel').click($.proxy(this.cancel, this)); |
| 99 | 99 | |
| 100 | 100 | if(this.input.error) { |
| ... | ... | @@ -109,7 +109,7 @@ Editableform is linked with one of input types, e.g. 'text', 'select' etc. |
| 109 | 109 | this.$form.find('.editable-submit').removeAttr('disabled'); |
| 110 | 110 | var value = (this.value === null || this.value === undefined || this.value === '') ? this.options.defaultValue : this.value; |
| 111 | 111 | this.input.value2input(value); |
| 112 | - //attach submit handler | |
| 112 | + //attach submit handlers | |
| 113 | 113 | this.$form.submit($.proxy(this.submit, this)); |
| 114 | 114 | } |
| 115 | 115 | |
| ... | ... | @@ -917,7 +917,7 @@ Applied as jQuery method. |
| 917 | 917 | this.destroy(); |
| 918 | 918 | }, this)); |
| 919 | 919 | |
| 920 | - //attach document handler to close containers on click / escape | |
| 920 | + //attach document handlers to close containers on click / escape | |
| 921 | 921 | if(!$(document).data('editable-handlers-attached')) { |
| 922 | 922 | //close all on escape |
| 923 | 923 | $(document).on('keyup.editable', function (e) { |
| ... | ... | @@ -1509,7 +1509,7 @@ Makes editable any HTML element on the page. Applied as jQuery method. |
| 1509 | 1509 | this.$element.addClass('editable-pre-wrapped'); |
| 1510 | 1510 | } |
| 1511 | 1511 | |
| 1512 | - //attach handler activating editable. In disabled mode it just prevent default action (useful for links) | |
| 1512 | + //attach handlers activating editable. In disabled mode it just prevent default action (useful for links) | |
| 1513 | 1513 | if(this.options.toggle !== 'manual') { |
| 1514 | 1514 | this.$element.addClass('editable-click'); |
| 1515 | 1515 | this.$element.on(this.options.toggle + '.editable', $.proxy(function(e){ |
| ... | ... | @@ -1518,7 +1518,7 @@ Makes editable any HTML element on the page. Applied as jQuery method. |
| 1518 | 1518 | e.preventDefault(); |
| 1519 | 1519 | } |
| 1520 | 1520 | |
| 1521 | - //stop propagation not required because in document click handler it checks event target | |
| 1521 | + //stop propagation not required because in document click handlers it checks event target | |
| 1522 | 1522 | //e.stopPropagation(); |
| 1523 | 1523 | |
| 1524 | 1524 | if(this.options.toggle === 'mouseenter') { |
| ... | ... | @@ -2103,7 +2103,7 @@ Makes editable any HTML element on the page. Applied as jQuery method. |
| 2103 | 2103 | /** |
| 2104 | 2104 | How to toggle editable. Can be <code>click|dblclick|mouseenter|manual</code>. |
| 2105 | 2105 | When set to <code>manual</code> you should manually call <code>show/hide</code> methods of editable. |
| 2106 | - **Note**: if you call <code>show</code> or <code>toggle</code> inside **click** handler of some DOM element, | |
| 2106 | + **Note**: if you call <code>show</code> or <code>toggle</code> inside **click** handlers of some DOM element, | |
| 2107 | 2107 | you need to apply <code>e.stopPropagation()</code> because containers are being closed on any click on document. |
| 2108 | 2108 | |
| 2109 | 2109 | @example |
| ... | ... | @@ -2402,7 +2402,7 @@ To create your own input you can inherit from this class. |
| 2402 | 2402 | }, |
| 2403 | 2403 | |
| 2404 | 2404 | /** |
| 2405 | - attach handler to automatically submit form when value changed (useful when buttons not shown) | |
| 2405 | + attach handlers to automatically submit form when value changed (useful when buttons not shown) | |
| 2406 | 2406 | **/ |
| 2407 | 2407 | autosubmit: function() { |
| 2408 | 2408 | ... | ... |
src/main/resources/static/metronic_v4.5.4/plugins/bootstrap-editable/inputs-ext/address/address.js
src/main/resources/static/metronic_v4.5.4/plugins/bootstrap-editable/inputs-ext/wysihtml5/bootstrap-wysihtml5-0.0.2/wysihtml5-0.3.0.js
| ... | ... | @@ -8056,7 +8056,7 @@ wysihtml5.views.View = Base.extend( |
| 8056 | 8056 | this.element.innerHTML = this.textarea.getValue(true); |
| 8057 | 8057 | this.enable(); |
| 8058 | 8058 | |
| 8059 | - // Make sure our selection handler is ready | |
| 8059 | + // Make sure our selection handlers is ready | |
| 8060 | 8060 | this.selection = new wysihtml5.Selection(this.parent); |
| 8061 | 8061 | |
| 8062 | 8062 | // Make sure commands dispatcher is ready |
| ... | ... | @@ -8469,7 +8469,7 @@ wysihtml5.views.View = Base.extend( |
| 8469 | 8469 | dom.observe(focusBlurElement, "focus", function() { |
| 8470 | 8470 | that.parent.fire("focus").fire("focus:composer"); |
| 8471 | 8471 | |
| 8472 | - // Delay storing of state until all focus handler are fired | |
| 8472 | + // Delay storing of state until all focus handlers are fired | |
| 8473 | 8473 | // especially the one which resets the placeholder |
| 8474 | 8474 | setTimeout(function() { state = that.getValue(); }, 0); |
| 8475 | 8475 | }); | ... | ... |
src/main/resources/static/metronic_v4.5.4/plugins/jquery-validation/js/jquery.validate.js
| ... | ... | @@ -536,7 +536,7 @@ $.extend( $.validator, { |
| 536 | 536 | $( this.findLastActive() || this.errorList.length && this.errorList[ 0 ].element || []) |
| 537 | 537 | .filter( ":visible" ) |
| 538 | 538 | .focus() |
| 539 | - // manually trigger focusin event; without it, focusin handler isn't called, findLastActive won't have anything to find | |
| 539 | + // manually trigger focusin event; without it, focusin handlers isn't called, findLastActive won't have anything to find | |
| 540 | 540 | .trigger( "focusin" ); |
| 541 | 541 | } catch ( e ) { |
| 542 | 542 | // ignore IE throwing errors when focusing hidden elements | ... | ... |
src/main/resources/static/metronic_v4.5.4/plugins/jstree/dist/jstree.js
| ... | ... | @@ -4945,7 +4945,7 @@ |
| 4945 | 4945 | if(this.settings.checkbox.cascade.indexOf('up') !== -1) { |
| 4946 | 4946 | this.element |
| 4947 | 4947 | .on('delete_node.jstree', $.proxy(function (e, data) { |
| 4948 | - // apply up (whole handler) | |
| 4948 | + // apply up (whole handlers) | |
| 4949 | 4949 | var p = this.get_node(data.parent), |
| 4950 | 4950 | m = this._model.data, |
| 4951 | 4951 | i, j, c, tmp, t = this.settings.checkbox.tie_selection; |
| ... | ... | @@ -4969,7 +4969,7 @@ |
| 4969 | 4969 | } |
| 4970 | 4970 | }, this)) |
| 4971 | 4971 | .on('move_node.jstree', $.proxy(function (e, data) { |
| 4972 | - // apply up (whole handler) | |
| 4972 | + // apply up (whole handlers) | |
| 4973 | 4973 | var is_multi = data.is_multi, |
| 4974 | 4974 | old_par = data.old_parent, |
| 4975 | 4975 | new_par = this.get_node(data.parent), | ... | ... |
src/main/resources/static/metronic_v4.5.4/plugins/select2/js/select2.full.js
| ... | ... | @@ -392,7 +392,7 @@ var requirejs, require, define; |
| 392 | 392 | //Support require(['a']) |
| 393 | 393 | callback = callback || function () {}; |
| 394 | 394 | |
| 395 | - //If relName is a function, it is an errback handler, | |
| 395 | + //If relName is a function, it is an errback handlers, | |
| 396 | 396 | //so remove it. |
| 397 | 397 | if (typeof relName === 'function') { |
| 398 | 398 | relName = forceSync; | ... | ... |
src/main/resources/static/metronic_v4.5.4/plugins/select2/js/select2.js
| ... | ... | @@ -392,7 +392,7 @@ var requirejs, require, define; |
| 392 | 392 | //Support require(['a']) |
| 393 | 393 | callback = callback || function () {}; |
| 394 | 394 | |
| 395 | - //If relName is a function, it is an errback handler, | |
| 395 | + //If relName is a function, it is an errback handlers, | |
| 396 | 396 | //so remove it. |
| 397 | 397 | if (typeof relName === 'function') { |
| 398 | 398 | relName = forceSync; | ... | ... |
src/main/resources/static/pages/excep/boundList.html
| ... | ... | @@ -82,7 +82,9 @@ |
| 82 | 82 | <option value="-1">无效</option> |
| 83 | 83 | </select> |
| 84 | 84 | </td> |
| 85 | - <td></td> | |
| 85 | + <td> | |
| 86 | + <input class="form-control" type="date" name="date" /> | |
| 87 | + </td> | |
| 86 | 88 | <td> |
| 87 | 89 | <button class="btn btn-sm green btn-outline filter-submit margin-bottom" > |
| 88 | 90 | <i class="fa fa-search"></i> 搜索</button> |
| ... | ... | @@ -237,8 +239,20 @@ $(function(){ |
| 237 | 239 | initPagination = false; |
| 238 | 240 | return; |
| 239 | 241 | } |
| 242 | + var cells = $('tr.filter')[0].cells | |
| 243 | + ,params = {} | |
| 244 | + ,name; | |
| 245 | + $.each(cells, function(i, cell){ | |
| 246 | + var items = $('input,select', cell); | |
| 247 | + for(var j = 0, item; item = items[j++];){ | |
| 248 | + name = $(item).attr('name'); | |
| 249 | + if(name){ | |
| 250 | + params[name] = $(item).val(); | |
| 251 | + } | |
| 252 | + } | |
| 253 | + }); | |
| 240 | 254 | page = num - 1; |
| 241 | - jsDoQuery(null, false); | |
| 255 | + jsDoQuery(params, false); | |
| 242 | 256 | } |
| 243 | 257 | }); |
| 244 | 258 | } | ... | ... |
src/main/resources/static/pages/excep/offlineList.html
| ... | ... | @@ -82,7 +82,9 @@ |
| 82 | 82 | <option value="-1">无效</option> |
| 83 | 83 | </select> |
| 84 | 84 | </td> |
| 85 | - <td></td> | |
| 85 | + <td> | |
| 86 | + <input class="form-control" type="date" name="date" /> | |
| 87 | + </td> | |
| 86 | 88 | <td> |
| 87 | 89 | <button class="btn btn-sm green btn-outline filter-submit margin-bottom" > |
| 88 | 90 | <i class="fa fa-search"></i> 搜索</button> |
| ... | ... | @@ -242,7 +244,20 @@ $(function(){ |
| 242 | 244 | |
| 243 | 245 | |
| 244 | 246 | page = num - 1; |
| 245 | - jsDoQuery(null, false); | |
| 247 | + | |
| 248 | + var cells = $('tr.filter')[0].cells | |
| 249 | + ,params = {} | |
| 250 | + ,name; | |
| 251 | + $.each(cells, function(i, cell){ | |
| 252 | + var items = $('input,select', cell); | |
| 253 | + for(var j = 0, item; item = items[j++];){ | |
| 254 | + name = $(item).attr('name'); | |
| 255 | + if(name){ | |
| 256 | + params[name] = $(item).val(); | |
| 257 | + } | |
| 258 | + } | |
| 259 | + }); | |
| 260 | + jsDoQuery(params, false); | |
| 246 | 261 | } |
| 247 | 262 | }); |
| 248 | 263 | } | ... | ... |
src/main/resources/static/pages/excep/speedingList.html
| ... | ... | @@ -72,6 +72,7 @@ |
| 72 | 72 | <input type="text" class="form-control form-filter input-sm" name="nbbm"> |
| 73 | 73 | </td> |
| 74 | 74 | <td> |
| 75 | + <input class="form-control" type="date" name="date" /> | |
| 75 | 76 | </td> |
| 76 | 77 | <td></td> |
| 77 | 78 | <td> |
| ... | ... | @@ -238,7 +239,19 @@ $(function(){ |
| 238 | 239 | return; |
| 239 | 240 | } |
| 240 | 241 | page = num - 1; |
| 241 | - jsDoQuery(null, false); | |
| 242 | + var cells = $('tr.filter')[0].cells | |
| 243 | + ,params = {} | |
| 244 | + ,name; | |
| 245 | + $.each(cells, function(i, cell){ | |
| 246 | + var items = $('input,select', cell); | |
| 247 | + for(var j = 0, item; item = items[j++];){ | |
| 248 | + name = $(item).attr('name'); | |
| 249 | + if(name){ | |
| 250 | + params[name] = $(item).val(); | |
| 251 | + } | |
| 252 | + } | |
| 253 | + }); | |
| 254 | + jsDoQuery(params, false); | |
| 242 | 255 | } |
| 243 | 256 | }); |
| 244 | 257 | } | ... | ... |
src/main/resources/static/pages/forms/mould/allline.xls
No preview for this file type
src/main/resources/static/pages/forms/mould/daily.xls
No preview for this file type
src/main/resources/static/pages/forms/mould/peoCarPlan.xls
No preview for this file type
src/main/resources/static/pages/forms/mould/scheduleAnaly.xls
No preview for this file type
src/main/resources/static/pages/forms/mould/workDaily.xls
No preview for this file type
src/main/resources/static/pages/forms/statement/account.html
| ... | ... | @@ -133,7 +133,7 @@ |
| 133 | 133 | |
| 134 | 134 | $("#query").on("click",function(){ |
| 135 | 135 | var line = $("#line").val(); |
| 136 | - var xlName = $("#line").text(); | |
| 136 | + var xlName = $("#select2-line-container").html(); | |
| 137 | 137 | var date = $("#date").val(); |
| 138 | 138 | var code = $("#code").val(); |
| 139 | 139 | $(".hidden").removeClass("hidden"); | ... | ... |
src/main/resources/static/pages/forms/statement/correctForm.html
| ... | ... | @@ -49,7 +49,7 @@ |
| 49 | 49 | </div> |
| 50 | 50 | <div class="form-group"> |
| 51 | 51 | <input class="btn btn-default" type="button" id="query" value="筛选"/> |
| 52 | - <input class="btn btn-default" type="button" id="export" value="导出"/> | |
| 52 | +<!-- <input class="btn btn-default" type="button" id="export" value="导出"/> --> | |
| 53 | 53 | </div> |
| 54 | 54 | </form> |
| 55 | 55 | </div> | ... | ... |
src/main/resources/static/pages/forms/statement/daily.html
| ... | ... | @@ -26,7 +26,15 @@ |
| 26 | 26 | <div class="col-md-12"> |
| 27 | 27 | <div class="portlet light porttlet-fit bordered"> |
| 28 | 28 | <div class="portlet-title"> |
| 29 | - <form class="form-inline" action=""> | |
| 29 | + <form class="form-inline" action=""> | |
| 30 | + <div style="display: inline-block; margin-left: 33px;" id="gsdmDiv_daily"> | |
| 31 | + <span class="item-label" style="width: 80px;">公司: </span> | |
| 32 | + <select class="form-control" name="company" id="gsdmDaily" style="width: 140px;"></select> | |
| 33 | + </div> | |
| 34 | + <div style="display: inline-block; margin-left: 24px;" id="fgsdmDiv_daily"> | |
| 35 | + <span class="item-label" style="width: 80px;">分公司: </span> | |
| 36 | + <select class="form-control" name="subCompany" id="fgsdmDaily" style="width: 140px;"></select> | |
| 37 | + </div> | |
| 30 | 38 | <div style="display: inline-block;"> |
| 31 | 39 | <span class="item-label" style="width: 80px;">线路: </span> |
| 32 | 40 | <select class="form-control" name="line" id="line" style="width: 180px;"></select> |
| ... | ... | @@ -64,15 +72,15 @@ |
| 64 | 72 | <td>班次</td> |
| 65 | 73 | </tr> |
| 66 | 74 | </thead> |
| 67 | - <tbody class="dailyInfo"> | |
| 75 | + <tbody id="tbody"> | |
| 68 | 76 | |
| 69 | 77 | </tbody> |
| 70 | 78 | <tr> |
| 71 | 79 | <td colspan="3">小计</td> |
| 72 | 80 | <td><span id="total_zgl"> </span></td> |
| 73 | - <td><span id="total_ksgl"> </span></td> | |
| 81 | + <td><span id="total_ks"> </span></td> | |
| 74 | 82 | <td><span id="total_yh"> </span></td> |
| 75 | - <td><span id="total_bcs"> </span></td> | |
| 83 | + <td><span id="total_bc"> </span></td> | |
| 76 | 84 | </tr> |
| 77 | 85 | </table> |
| 78 | 86 | </div> |
| ... | ... | @@ -82,7 +90,9 @@ |
| 82 | 90 | </div> |
| 83 | 91 | |
| 84 | 92 | <script> |
| 85 | - $(function(){ | |
| 93 | + $(function(){ | |
| 94 | + var reqCodeMap = {"0xA1": '请求恢复运营', "0xA2": '申请调档', "0xA3": '出场请求', "0xA5": '进场请求', "0xA7": '加油请求', "0x50": '车辆故障', "0x70": '路阻报告', "0x60": '事故报告', "0x11": '扣证纠纷', "0x12" : '报警'}; | |
| 95 | + | |
| 86 | 96 | // 关闭左侧栏 |
| 87 | 97 | if (!$('body').hasClass('page-sidebar-closed')) |
| 88 | 98 | $('.menu-toggler.sidebar-toggler').click(); |
| ... | ... | @@ -92,6 +102,42 @@ |
| 92 | 102 | locale : 'zh-cn' |
| 93 | 103 | }); |
| 94 | 104 | |
| 105 | + var obj = []; | |
| 106 | + $.get('/user/companyData', function(result){ | |
| 107 | + obj = result; | |
| 108 | + var options = ''; | |
| 109 | + for(var i = 0; i < obj.length; i++){ | |
| 110 | + options += '<option value="'+obj[i].companyCode+'">'+obj[i].companyName+'</option>'; | |
| 111 | + } | |
| 112 | + | |
| 113 | + if(obj.length ==0){ | |
| 114 | + $("#gsdmDiv_daily").css('display','none'); | |
| 115 | + $('#gsdmDiv_daily').css('display','none'); | |
| 116 | + }else if(obj.length ==1){ | |
| 117 | + $("#fgsdmDiv_daily").css('display','none'); | |
| 118 | + if(obj[0].children.length == 1 || obj[0].children.length ==0) | |
| 119 | + $('#fgsdmDiv_daily').css('display','none'); | |
| 120 | + } | |
| 121 | + $('#gsdmDaily').html(options); | |
| 122 | + updateCompany(); | |
| 123 | + }); | |
| 124 | + | |
| 125 | + $("#gsdmDaily").on("change",updateCompany); | |
| 126 | + function updateCompany(){ | |
| 127 | + var company = $('#gsdmDaily').val(); | |
| 128 | + var options = ''; | |
| 129 | + for(var i = 0; i < obj.length; i++){ | |
| 130 | + if(obj[i].companyCode == company){ | |
| 131 | + var children = obj[i].children; | |
| 132 | + for(var j = 0; j < children.length; j++){ | |
| 133 | + options += '<option value="'+children[j].code+'">'+children[j].name+'</option>'; | |
| 134 | + } | |
| 135 | + } | |
| 136 | + } | |
| 137 | + $('#fgsdmDaily').html(options); | |
| 138 | + } | |
| 139 | + | |
| 140 | + | |
| 95 | 141 | $.get('/basic/lineCode2Name',function(result){ |
| 96 | 142 | var data=[]; |
| 97 | 143 | |
| ... | ... | @@ -101,50 +147,82 @@ |
| 101 | 147 | initPinYinSelect2('#line',data,''); |
| 102 | 148 | |
| 103 | 149 | }) |
| 104 | - var line; | |
| 105 | - var date; | |
| 106 | - $("#query").on("click",function(){ | |
| 107 | - line = $("#line").val(); | |
| 108 | - var lineName=$("#select2-line-container").html(); | |
| 109 | - date = $("#date").val(); | |
| 110 | - $get('/realSchedule/dailyInfo',{line:line,date:date,type:'query'},function(result){ | |
| 111 | - $("#form_line").text(lineName); | |
| 112 | - $("#form_date").text(date); | |
| 113 | - var total_zgl = 0,total_ksgl = 0,total_yh = 0,total_bcs = 0; | |
| 114 | - $.each(result, function(i, obj) { | |
| 115 | - total_zgl = Number(obj.zgl)+Number(total_zgl); | |
| 116 | - total_ksgl = Number(obj.ksgl)+Number(total_ksgl); | |
| 117 | - total_yh = Number(0)+Number(total_yh); | |
| 118 | - total_bcs = Number(obj.bcs)+Number(total_bcs); | |
| 119 | - }); | |
| 120 | - $("#total_zgl").text(total_zgl.toFixed(2)); | |
| 121 | - $("#total_ksgl").text(total_ksgl.toFixed(2)); | |
| 122 | - $("#total_yh").text(total_yh.toFixed(2)); | |
| 123 | - $("#total_bcs").text(total_bcs); | |
| 124 | - | |
| 125 | - // 把数据填充到模版中 | |
| 126 | - var tbodyHtml = template('dailyInfo',{list:result}); | |
| 127 | - // 把渲染好的模版html文本追加到表格中 | |
| 128 | - $('#forms .dailyInfo').html(tbodyHtml); | |
| 129 | - }); | |
| 150 | + | |
| 151 | + var line; | |
| 152 | + var date; | |
| 153 | + var gsdmDaily; | |
| 154 | + var fgsdmDaily; | |
| 155 | + $("#query").on("click",function(){ | |
| 156 | + | |
| 157 | + line = $("#line").val(); | |
| 158 | + var lineName=$("#select2-line-container").html(); | |
| 159 | + date = $("#date").val(); | |
| 160 | + gsdmDaily=$("#gsdmDaily").val(); | |
| 161 | + fgsdmDaily = $("#fgsdmDaily").val(); | |
| 162 | + | |
| 163 | + $post('/mcy_forms/daily',{gsdmDaily:gsdmDaily,fgsdmDaily:fgsdmDaily, line:line,date:date,type:'query'},function(result){ | |
| 164 | + $("#form_line").text(lineName); | |
| 165 | + $("#form_date").text(date); | |
| 166 | + // 把数据填充到模版中 | |
| 167 | + var tbodyHtml = template('dailyInfo',{list:result}); | |
| 168 | + // 把渲染好的模版html文本追加到表格中 | |
| 169 | + $('#tbody').html(tbodyHtml); | |
| 170 | + line = $("#line").val(); | |
| 171 | + | |
| 172 | + startDate = $("#startDate").val(); | |
| 173 | + endDate = $("#endDate").val(); | |
| 174 | + $("#sDate").text(startDate); | |
| 175 | + $("#eDate").text(endDate); | |
| 176 | + | |
| 177 | + var total_zgl = 0,total_ks = 0; | |
| 178 | + var total_yh = 0,total_bc = 0; | |
| 179 | + | |
| 180 | + $.each(result, function(i, obj) { | |
| 181 | + total_zgl +=Number(obj.zlc); | |
| 182 | + total_ks +=Number(obj.jzl1); | |
| 183 | + total_yh += Number(obj.yh); | |
| 184 | + total_bc += Number(obj.bc); | |
| 185 | + | |
| 186 | + }); | |
| 187 | + $("#total_zgl").text(total_zgl.toFixed(2)); | |
| 188 | + $("#total_ks").text(total_ks.toFixed(2)); | |
| 189 | + $("#total_yh").text(total_yh.toFixed(2)); | |
| 190 | + $("#total_bc").text(total_bc.toFixed(2)); | |
| 191 | + | |
| 192 | + var temp = {}; | |
| 193 | + var today_account = 0; | |
| 194 | + | |
| 195 | + temp["line"] = $("#line").text(); | |
| 196 | + $.each(result, function(i, obj) { | |
| 197 | + if(moment(obj.schedule_date_str).format("YYYY-MM-DD") == moment(obj.startDate).format("YYYY-MM-DD")){ | |
| 198 | + today_account++; | |
| 199 | + } | |
| 200 | + obj.updateDate = moment(obj.startDate).format("YYYY-MM-DD HH:mm:ss"); | |
| 201 | + }); | |
| 202 | + }) | |
| 203 | + }); | |
| 204 | + | |
| 205 | + $("#export").on("click",function(){ | |
| 206 | + line = $("#line").val(); | |
| 207 | + date = $("#date").val(); | |
| 208 | + gsdmDaily=$("#gsdmDaily").val(); | |
| 209 | + fgsdmDaily = $("#fgsdmDaily").val(); | |
| 210 | + $post('/mcy_export/dailyExport',{gsdmDaily:gsdmDaily,fgsdmDaily:fgsdmDaily,line:line,date:date,type:'export'},function(result){ | |
| 211 | + window.open("/downloadFile/download?fileName=班次日报表"+moment(date).format("YYYYMMDD")); | |
| 130 | 212 | }); |
| 131 | - $("#export").on("click",function(){ | |
| 132 | - $get('/realSchedule/dailyInfo',{line:line,date:date,type:'export'},function(result){ | |
| 133 | - window.open("/downloadFile/download?fileName=班次日报"+moment(date).format("YYYYMMDD")); | |
| 134 | - }); | |
| 135 | - }); | |
| 136 | - }); | |
| 213 | + }); | |
| 214 | +}); | |
| 137 | 215 | </script> |
| 138 | 216 | <script type="text/html" id="dailyInfo"> |
| 139 | 217 | {{each list as obj i}} |
| 140 | 218 | <tr> |
| 141 | - <td>{{obj.clZbh}}</td> | |
| 142 | - <td>{{obj.jGh}}</td> | |
| 219 | + <td>{{obj.zbh}}</td> | |
| 220 | + <td>{{obj.jgh}}</td> | |
| 143 | 221 | <td>{{obj.jName}}</td> |
| 144 | - <td>{{obj.zgl}}</td> | |
| 145 | - <td>{{obj.ksgl}}</td> | |
| 146 | - <td>0</td> | |
| 147 | - <td>{{obj.bcs}}</td> | |
| 222 | + <td>{{obj.zlc}}</td> | |
| 223 | + <td>{{obj.jzl1}}</td> | |
| 224 | + <td>{{obj.yh}}</td> | |
| 225 | + <td>{{obj.bc}}</td> | |
| 148 | 226 | </tr> |
| 149 | 227 | {{/each}} |
| 150 | 228 | {{if list.length == 0}} | ... | ... |
src/main/resources/static/pages/forms/statement/firstAndLastBus.html
| ... | ... | @@ -97,6 +97,7 @@ |
| 97 | 97 | |
| 98 | 98 | <script> |
| 99 | 99 | $(function(){ |
| 100 | + $('#export').attr('disabled', "true"); | |
| 100 | 101 | |
| 101 | 102 | // 关闭左侧栏 |
| 102 | 103 | if (!$('body').hasClass('page-sidebar-closed')) |
| ... | ... | @@ -186,11 +187,22 @@ |
| 186 | 187 | // 把渲染好的模版html文本追加到表格中 |
| 187 | 188 | $('#forms tbody').html(tbodyHtml); |
| 188 | 189 | |
| 190 | + if(result.length == 0) | |
| 191 | + $("#export").attr('disabled',"true"); | |
| 192 | + else | |
| 193 | + $("#export").removeAttr("disabled"); | |
| 189 | 194 | }); |
| 190 | 195 | } |
| 191 | 196 | |
| 192 | 197 | $("#export").on("click",function(){ |
| 193 | - $get('/pcpc/firstAndLastBus',{line:line,date:date,type:'export'},function(result){ | |
| 198 | + var params = {}; | |
| 199 | + params['company'] = company; | |
| 200 | + params['subCompany'] = subCompany; | |
| 201 | + params['line'] = line; | |
| 202 | + params['line'] = line; | |
| 203 | + params['date'] = date; | |
| 204 | + params['type'] = "export"; | |
| 205 | + $get('/pcpc/firstAndLastBus', params, function(result){ | |
| 194 | 206 | window.open("/downloadFile/download?fileName=线路首末班"+moment(date).format("YYYYMMDD")); |
| 195 | 207 | }); |
| 196 | 208 | }); | ... | ... |
src/main/resources/static/pages/forms/statement/historyMessage.html
| ... | ... | @@ -41,7 +41,7 @@ |
| 41 | 41 | </div> |
| 42 | 42 | <div class="form-group"> |
| 43 | 43 | <input class="btn btn-default" type="button" id="query" value="筛选"/> |
| 44 | - <input class="btn btn-default" type="button" id="export" value="导出"/> | |
| 44 | +<!-- <input class="btn btn-default" type="button" id="export" value="导出"/> --> | |
| 45 | 45 | </div> |
| 46 | 46 | </form> |
| 47 | 47 | </div> | ... | ... |
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> | ... | ... |
src/main/resources/static/pages/forms/statement/peopleCarPlan.html
| ... | ... | @@ -80,6 +80,7 @@ |
| 80 | 80 | |
| 81 | 81 | <script> |
| 82 | 82 | $(function(){ |
| 83 | + $('#export').attr('disabled', "true"); | |
| 83 | 84 | |
| 84 | 85 | // 关闭左侧栏 |
| 85 | 86 | if (!$('body').hasClass('page-sidebar-closed')) |
| ... | ... | @@ -168,11 +169,21 @@ |
| 168 | 169 | // 把渲染好的模版html文本追加到表格中 |
| 169 | 170 | $('#forms tbody').html(tbodyHtml); |
| 170 | 171 | |
| 172 | + if(result.length == 0) | |
| 173 | + $("#export").attr('disabled',"true"); | |
| 174 | + else | |
| 175 | + $("#export").removeAttr("disabled"); | |
| 171 | 176 | }); |
| 172 | 177 | } |
| 173 | 178 | |
| 174 | 179 | $("#export").on("click",function(){ |
| 175 | - $get('/pcpc/queryPeopleCar',{line:line,date:date,type:'export'},function(result){ | |
| 180 | + var params = {}; | |
| 181 | + params['company'] = company; | |
| 182 | + params['subCompany'] = subCompany; | |
| 183 | + params['line'] = line; | |
| 184 | + params['date'] = date; | |
| 185 | + params['type'] = "export"; | |
| 186 | + $get('/pcpc/queryPeopleCar', params, function(result){ | |
| 176 | 187 | window.open("/downloadFile/download?fileName=计划车辆班次人员"+moment(date).format("YYYYMMDD")); |
| 177 | 188 | }); |
| 178 | 189 | }); | ... | ... |
src/main/resources/static/pages/forms/statement/scheduleAnaly.html
| ... | ... | @@ -65,18 +65,21 @@ |
| 65 | 65 | <table class="table table-bordered table-hover table-checkable" id="forms"> |
| 66 | 66 | <thead> |
| 67 | 67 | <tr class="hidden"> |
| 68 | - <th width="10%">线路</th> | |
| 69 | - <th width="10%">起点站名</th> | |
| 70 | - <th width="8%">计发时间</th> | |
| 71 | - <th width="8%">计划运送时间(分)</th> | |
| 72 | - <th width="8%">计划完成次数</th> | |
| 73 | - <th width="8%">完成次数</th> | |
| 74 | - <th width="8%">最早发车时间</th> | |
| 75 | - <th width="8%">最晚发车时间</th> | |
| 76 | - <th width="8%">平均发车时间</th> | |
| 77 | - <th width="8%">最慢运送时间(分)</th> | |
| 78 | - <th width="8%">最快运送时间(分)</th> | |
| 79 | - <th width="8%">平均运送时间(分)</th> | |
| 68 | + <th style="display: none;"></th> | |
| 69 | + <th width="8%">公司</th> | |
| 70 | + <th width="8%">分公司</th> | |
| 71 | + <th width="8%">线路</th> | |
| 72 | + <th width="8%">起点站名</th> | |
| 73 | + <th width="6%">计发时间</th> | |
| 74 | + <th width="6%">计划运送时间(分)</th> | |
| 75 | + <th width="6%">计划完成次数</th> | |
| 76 | + <th width="6%">完成次数</th> | |
| 77 | + <th width="6%">最早发车时间</th> | |
| 78 | + <th width="6%">最晚发车时间</th> | |
| 79 | + <th width="6%">平均发车时间</th> | |
| 80 | + <th width="6%">最慢运送时间(分)</th> | |
| 81 | + <th width="6%">最快运送时间(分)</th> | |
| 82 | + <th width="6%">平均运送时间(分)</th> | |
| 80 | 83 | </tr> |
| 81 | 84 | </thead> |
| 82 | 85 | <tbody> |
| ... | ... | @@ -95,6 +98,7 @@ |
| 95 | 98 | <script> |
| 96 | 99 | $(function(){ |
| 97 | 100 | var page = 0, initPagination; |
| 101 | + $('#export').attr('disabled', "true"); | |
| 98 | 102 | |
| 99 | 103 | // 关闭左侧栏 |
| 100 | 104 | if (!$('body').hasClass('page-sidebar-closed')) |
| ... | ... | @@ -200,6 +204,11 @@ |
| 200 | 204 | // 把渲染好的模版html文本追加到表格中 |
| 201 | 205 | $('#forms tbody').html(tbodyHtml); |
| 202 | 206 | |
| 207 | + if(result.dataList.length == 0) | |
| 208 | + $("#export").attr('disabled',"true"); | |
| 209 | + else | |
| 210 | + $("#export").removeAttr("disabled"); | |
| 211 | + | |
| 203 | 212 | if(pagination && result.dataList.length > 0){ |
| 204 | 213 | //重新分页 |
| 205 | 214 | initPagination = true; |
| ... | ... | @@ -213,7 +222,16 @@ |
| 213 | 222 | } |
| 214 | 223 | |
| 215 | 224 | $("#export").on("click",function(){ |
| 216 | - $get('/pcpc/scheduleAnaly',{page:'',line:line,startDate:startDate,endDate:endDate,model:model,type:'export'},function(result){ | |
| 225 | + var params = {}; | |
| 226 | + params['page'] = page; | |
| 227 | + params['line'] = line; | |
| 228 | + params['startDate'] = startDate; | |
| 229 | + params['endDate'] = endDate; | |
| 230 | + params['model'] = model; | |
| 231 | + params['company'] = company; | |
| 232 | + params['subCompany'] = subCompany; | |
| 233 | + params['type'] = "export"; | |
| 234 | + $get('/pcpc/scheduleAnaly', params, function(result){ | |
| 217 | 235 | window.open("/downloadFile/download?fileName=时刻表分析"+moment(startDate).format("YYYYMMDD")+"-"+moment(endDate).format("YYYYMMDD")); |
| 218 | 236 | }); |
| 219 | 237 | }); |
| ... | ... | @@ -289,6 +307,9 @@ |
| 289 | 307 | <script type="text/html" id="list_scheduleAnaly"> |
| 290 | 308 | {{each list as obj i}} |
| 291 | 309 | <tr> |
| 310 | + <th style="display: none;"></th> | |
| 311 | + <td>{{obj.company}}</td> | |
| 312 | + <td>{{obj.subCompany}}</td> | |
| 292 | 313 | <td>{{obj.line}}</td> |
| 293 | 314 | <td>{{obj.qdz}}</td> |
| 294 | 315 | <td>{{obj.jhfc}}</td> |
| ... | ... | @@ -305,7 +326,7 @@ |
| 305 | 326 | {{/each}} |
| 306 | 327 | {{if list.length == 0}} |
| 307 | 328 | <tr> |
| 308 | - <td colspan="12"><h6 class="muted">没有找到相关数据</h6></td> | |
| 329 | + <td colspan="14"><h6 class="muted">没有找到相关数据</h6></td> | |
| 309 | 330 | </tr> |
| 310 | 331 | {{/if}} |
| 311 | 332 | </script> |
| 312 | 333 | \ No newline at end of file | ... | ... |
src/main/resources/static/pages/forms/statement/scheduleDaily.html
| ... | ... | @@ -37,7 +37,7 @@ |
| 37 | 37 | </div> |
| 38 | 38 | <div class="form-group"> |
| 39 | 39 | <input class="btn btn-default" type="button" id="query" value="查询"/> |
| 40 | - <input class="btn btn-default" type="button" id="export" value="导出"/> | |
| 40 | +<!-- <input class="btn btn-default" type="button" id="export" value="导出"/> --> | |
| 41 | 41 | </div> |
| 42 | 42 | </form> |
| 43 | 43 | </div> | ... | ... |
src/main/resources/static/pages/forms/statement/scheduleDailyQp.html
| ... | ... | @@ -61,20 +61,20 @@ |
| 61 | 61 | <th colspan="3" style="text-align:center;vertical-align:middle;">驾驶员</th> |
| 62 | 62 | <th colspan="3" style="text-align:center;vertical-align:middle;">售票员</th> |
| 63 | 63 | <th rowspan="3" style="text-align:center;vertical-align:middle;">路牌</th> |
| 64 | - <th rowspan="3" style="text-align:center;vertical-align:middle;">记录项目</th> | |
| 65 | - <th colspan="3" style="text-align:center;vertical-align:middle;">1</th> | |
| 66 | - <th colspan="3" style="text-align:center;vertical-align:middle;">2</th> | |
| 67 | - <th colspan="3" style="text-align:center;vertical-align:middle;">3</th> | |
| 68 | - <th colspan="3" style="text-align:center;vertical-align:middle;">4</th> | |
| 69 | - <th colspan="3" style="text-align:center;vertical-align:middle;">5</th> | |
| 70 | - <th colspan="3" style="text-align:center;vertical-align:middle;">6</th> | |
| 71 | - <th colspan="3" style="text-align:center;vertical-align:middle;">7</th> | |
| 72 | - <th colspan="3" style="text-align:center;vertical-align:middle;">8</th> | |
| 73 | - <th colspan="3" style="text-align:center;vertical-align:middle;">9</th> | |
| 74 | - <th colspan="3" style="text-align:center;vertical-align:middle;">10</th> | |
| 75 | - <th colspan="3" style="text-align:center;vertical-align:middle;">11</th> | |
| 76 | - <th colspan="3" style="text-align:center;vertical-align:middle;">12</th> | |
| 77 | - <th colspan="3" style="text-align:center;vertical-align:middle;">13</th> | |
| 64 | + <th rowspan="4" style="text-align:center;vertical-align:middle;">记录项目</th> | |
| 65 | + <th colspan="4" style="text-align:center;vertical-align:middle;">1</th> | |
| 66 | + <th colspan="4" style="text-align:center;vertical-align:middle;">2</th> | |
| 67 | + <th colspan="4" style="text-align:center;vertical-align:middle;">3</th> | |
| 68 | + <th colspan="4" style="text-align:center;vertical-align:middle;">4</th> | |
| 69 | + <th colspan="4" style="text-align:center;vertical-align:middle;">5</th> | |
| 70 | + <th colspan="4" style="text-align:center;vertical-align:middle;">6</th> | |
| 71 | + <th colspan="4" style="text-align:center;vertical-align:middle;">7</th> | |
| 72 | + <th colspan="4" style="text-align:center;vertical-align:middle;">8</th> | |
| 73 | + <th colspan="4" style="text-align:center;vertical-align:middle;">9</th> | |
| 74 | + <th colspan="4" style="text-align:center;vertical-align:middle;">10</th> | |
| 75 | + <th colspan="4" style="text-align:center;vertical-align:middle;">11</th> | |
| 76 | + <th colspan="4" style="text-align:center;vertical-align:middle;">12</th> | |
| 77 | + <th colspan="4" style="text-align:center;vertical-align:middle;">13</th> | |
| 78 | 78 | |
| 79 | 79 | </tr> |
| 80 | 80 | <tr> |
| ... | ... | @@ -86,42 +86,55 @@ |
| 86 | 86 | <th rowspan="2">到达</th> |
| 87 | 87 | <th rowspan="2">早/迟</th> |
| 88 | 88 | <th rowspan="2">开出</th> |
| 89 | + <th rowspan="2">备注</th> | |
| 89 | 90 | <th rowspan="2">到达</th> |
| 90 | 91 | <th rowspan="2">早/迟</th> |
| 91 | 92 | <th rowspan="2">开出</th> |
| 93 | + <th rowspan="2">备注</th> | |
| 92 | 94 | <th rowspan="2">到达</th> |
| 93 | 95 | <th rowspan="2">早/迟</th> |
| 94 | 96 | <th rowspan="2">开出</th> |
| 97 | + <th rowspan="2">备注</th> | |
| 95 | 98 | <th rowspan="2">到达</th> |
| 96 | 99 | <th rowspan="2">早/迟</th> |
| 97 | 100 | <th rowspan="2">开出</th> |
| 101 | + <th rowspan="2">备注</th> | |
| 98 | 102 | <th rowspan="2">到达</th> |
| 99 | 103 | <th rowspan="2">早/迟</th> |
| 100 | 104 | <th rowspan="2">开出</th> |
| 105 | + <th rowspan="2">备注</th> | |
| 101 | 106 | <th rowspan="2">到达</th> |
| 102 | 107 | <th rowspan="2">早/迟</th> |
| 103 | 108 | <th rowspan="2">开出</th> |
| 109 | + <th rowspan="2">备注</th> | |
| 104 | 110 | <th rowspan="2">到达</th> |
| 105 | 111 | <th rowspan="2">早/迟</th> |
| 106 | 112 | <th rowspan="2">开出</th> |
| 113 | + <th rowspan="2">备注</th> | |
| 107 | 114 | <th rowspan="2">到达</th> |
| 108 | 115 | <th rowspan="2">早/迟</th> |
| 109 | 116 | <th rowspan="2">开出</th> |
| 117 | + <th rowspan="2">备注</th> | |
| 110 | 118 | <th rowspan="2">到达</th> |
| 111 | 119 | <th rowspan="2">早/迟</th> |
| 112 | 120 | <th rowspan="2">开出</th> |
| 121 | + <th rowspan="2">备注</th> | |
| 113 | 122 | <th rowspan="2">到达</th> |
| 114 | 123 | <th rowspan="2">早/迟</th> |
| 115 | 124 | <th rowspan="2">开出</th> |
| 125 | + <th rowspan="2">备注</th> | |
| 116 | 126 | <th rowspan="2">到达</th> |
| 117 | 127 | <th rowspan="2">早/迟</th> |
| 118 | 128 | <th rowspan="2">开出</th> |
| 129 | + <th rowspan="2">备注</th> | |
| 119 | 130 | <th rowspan="2">到达</th> |
| 120 | 131 | <th rowspan="2">早/迟</th> |
| 121 | 132 | <th rowspan="2">开出</th> |
| 133 | + <th rowspan="2">备注</th> | |
| 122 | 134 | <th rowspan="2">到达</th> |
| 123 | 135 | <th rowspan="2">早/迟</th> |
| 124 | 136 | <th rowspan="2">开出</th> |
| 137 | + <th rowspan="2">备注</th> | |
| 125 | 138 | </tr> |
| 126 | 139 | <tr> |
| 127 | 140 | <th>出场</th> |
| ... | ... | @@ -134,17 +147,80 @@ |
| 134 | 147 | </thead> |
| 135 | 148 | <tbody> |
| 136 | 149 | <tr > |
| 137 | - <td></td> | |
| 150 | + <td>1</td> | |
| 138 | 151 | <td> |
| 152 | + YT-CD001 | |
| 139 | 153 | </td> |
| 140 | - <td></td> | |
| 141 | - <td></td> | |
| 142 | - <td></td> | |
| 143 | - <td colspan="46"> | |
| 144 | - <div> | |
| 145 | - | |
| 146 | - </div> | |
| 154 | + <td> | |
| 155 | + | |
| 156 | + </td> | |
| 157 | + <td> | |
| 158 | + 1 | |
| 159 | + </td> | |
| 160 | + <td> | |
| 161 | + 00001 | |
| 162 | + </td> | |
| 163 | + <td > | |
| 164 | + 04:30 | |
| 147 | 165 | </td> |
| 166 | + <td></td> | |
| 167 | + <td></td> | |
| 168 | + <td></td> | |
| 169 | + <td></td> | |
| 170 | + <td>1</td> | |
| 171 | + <td></td> | |
| 172 | + <td>06:50</td> | |
| 173 | + <td>1</td> | |
| 174 | + <td>06:00</td> | |
| 175 | + <td></td> | |
| 176 | + <td>08:02</td> | |
| 177 | + <td>-2</td> | |
| 178 | + <td>07:10</td> | |
| 179 | + <td></td> | |
| 180 | + <td></td> | |
| 181 | + <td></td> | |
| 182 | + <td></td> | |
| 183 | + <td></td> | |
| 184 | + <td></td> | |
| 185 | + <td></td> | |
| 186 | + <td></td> | |
| 187 | + <td></td> | |
| 188 | + <td></td> | |
| 189 | + <td></td> | |
| 190 | + <td></td> | |
| 191 | + <td></td> | |
| 192 | + <td></td> | |
| 193 | + <td></td> | |
| 194 | + <td></td> | |
| 195 | + <td></td> | |
| 196 | + <td></td> | |
| 197 | + <td></td> | |
| 198 | + <td></td> | |
| 199 | + <td></td> | |
| 200 | + <td></td> | |
| 201 | + <td></td> | |
| 202 | + <td></td> | |
| 203 | + <td></td> | |
| 204 | + <td></td> | |
| 205 | + <td></td> | |
| 206 | + <td></td> | |
| 207 | + <td></td> | |
| 208 | + <td></td> | |
| 209 | + <td></td> | |
| 210 | + <td></td> | |
| 211 | + <td></td> | |
| 212 | + <td></td> | |
| 213 | + <td></td> | |
| 214 | + <td></td> | |
| 215 | + <td></td> | |
| 216 | + <td></td> | |
| 217 | + <td></td> | |
| 218 | + <td></td> | |
| 219 | + <td></td> | |
| 220 | + <td></td> | |
| 221 | + <td></td> | |
| 222 | + <td></td> | |
| 223 | + <td></td> | |
| 148 | 224 | </tr> |
| 149 | 225 | |
| 150 | 226 | </tbody> | ... | ... |
src/main/resources/static/pages/forms/statement/statisticsDaily .html
| ... | ... | @@ -37,7 +37,7 @@ |
| 37 | 37 | </div> |
| 38 | 38 | <div class="form-group"> |
| 39 | 39 | <input class="btn btn-default" type="button" id="query" value="查询"/> |
| 40 | - <input class="btn btn-default" type="button" id="export" value="导出"/> | |
| 40 | +<!-- <input class="btn btn-default" type="button" id="export" value="导出"/> --> | |
| 41 | 41 | </div> |
| 42 | 42 | </form> |
| 43 | 43 | </div> | ... | ... |
src/main/resources/static/pages/forms/statement/waybill.html
| ... | ... | @@ -39,7 +39,7 @@ |
| 39 | 39 | <input class="btn btn-default" type="button" id="query" value="查询"/> |
| 40 | 40 | <input class="btn btn-default" type="button" id="export" value="导出"/> |
| 41 | 41 | <input class="btn btn-default" type="button" id="print" value="打印"/> |
| 42 | - <input class="btn btn-default" type="button" id="exportMore" value="批量导出"/> | |
| 42 | +<!-- <input class="btn btn-default" type="button" id="exportMore" value="批量导出"/> --> | |
| 43 | 43 | </div> |
| 44 | 44 | </form> |
| 45 | 45 | </div> | ... | ... |
src/main/resources/static/pages/forms/statement/workDaily.html
| ... | ... | @@ -55,11 +55,13 @@ |
| 55 | 55 | <thead> |
| 56 | 56 | <tr class="hidden"> |
| 57 | 57 | <th width="80px">日期</th> |
| 58 | - <th width="100px">线路</th> | |
| 58 | + <th>公司</th> | |
| 59 | + <th>分公司</th> | |
| 60 | + <th>线路</th> | |
| 59 | 61 | <th>计划班次</th> |
| 60 | 62 | <th>待发调整</th> |
| 61 | - <th>待发调整比率</th> | |
| 62 | - <th>出场率</th> | |
| 63 | + <th width="60px">待发调整比率</th> | |
| 64 | + <th width="60px">出场率</th> | |
| 63 | 65 | <th width="46px">上行发快</th> |
| 64 | 66 | <th width="46px">上行到快</th> |
| 65 | 67 | <th width="46px">下行发快</th> |
| ... | ... | @@ -68,9 +70,9 @@ |
| 68 | 70 | <th width="46px">上行到慢</th> |
| 69 | 71 | <th width="46px">下行发慢</th> |
| 70 | 72 | <th width="46px">下行到慢</th> |
| 71 | - <th>误点总数(快/慢)</th> | |
| 72 | - <th>首末班准点率</th> | |
| 73 | - <th>高峰班次执行率(早/晚)</th> | |
| 73 | + <th width="75px">误点总数(快/慢)</th> | |
| 74 | + <th width="100px">首末班准点率</th> | |
| 75 | + <th width="100px">高峰班次执行率(早/晚)</th> | |
| 74 | 76 | </tr> |
| 75 | 77 | </thead> |
| 76 | 78 | <tbody> |
| ... | ... | @@ -88,6 +90,7 @@ |
| 88 | 90 | |
| 89 | 91 | <script> |
| 90 | 92 | $(function(){ |
| 93 | + $('#export').attr('disabled', "true"); | |
| 91 | 94 | |
| 92 | 95 | // 关闭左侧栏 |
| 93 | 96 | if (!$('body').hasClass('page-sidebar-closed')) |
| ... | ... | @@ -176,11 +179,21 @@ |
| 176 | 179 | // 把渲染好的模版html文本追加到表格中 |
| 177 | 180 | $('#forms tbody').html(tbodyHtml); |
| 178 | 181 | |
| 182 | + if(result.length == 0) | |
| 183 | + $("#export").attr('disabled',"true"); | |
| 184 | + else | |
| 185 | + $("#export").removeAttr("disabled"); | |
| 179 | 186 | }); |
| 180 | 187 | } |
| 181 | 188 | |
| 182 | 189 | $("#export").on("click",function(){ |
| 183 | - $get('/pcpc/workDaily',{line:line,date:date,type:'export'},function(result){ | |
| 190 | + var params = {}; | |
| 191 | + params['line'] = line; | |
| 192 | + params['date'] = date; | |
| 193 | + params['type'] = "export"; | |
| 194 | + params['company'] = company; | |
| 195 | + params['subCompany'] = subCompany; | |
| 196 | + $get('/pcpc/workDaily', params, function(result){ | |
| 184 | 197 | window.open("/downloadFile/download?fileName=营运服务日报表"+moment(date).format("YYYYMMDD")); |
| 185 | 198 | }); |
| 186 | 199 | }); |
| ... | ... | @@ -193,6 +206,8 @@ |
| 193 | 206 | {{each list as obj i}} |
| 194 | 207 | <tr> |
| 195 | 208 | <td>{{obj.date}}</td> |
| 209 | + <td>{{obj.company}}</td> | |
| 210 | + <td>{{obj.subCompany}}</td> | |
| 196 | 211 | <td>{{obj.line}}</td> |
| 197 | 212 | <td>{{obj.jhbc}}</td> |
| 198 | 213 | <td>{{obj.dftz}}</td> |
| ... | ... | @@ -213,7 +228,7 @@ |
| 213 | 228 | {{/each}} |
| 214 | 229 | {{if list.length == 0}} |
| 215 | 230 | <tr> |
| 216 | - <td colspan="17"><h6 class="muted">没有找到相关数据</h6></td> | |
| 231 | + <td colspan="19"><h6 class="muted">没有找到相关数据</h6></td> | |
| 217 | 232 | </tr> |
| 218 | 233 | {{/if}} |
| 219 | 234 | </script> |
| 220 | 235 | \ No newline at end of file | ... | ... |
src/main/resources/static/pages/forms/statement/allline.html renamed to src/main/resources/static/pages/mforms/alllines/allline.html
src/main/resources/static/pages/forms/statement/changetochange.html renamed to src/main/resources/static/pages/mforms/changetochanges/changetochange.html
src/main/resources/static/pages/forms/statement/executionrate.html renamed to src/main/resources/static/pages/mforms/executionrates/executionrate.html
src/main/resources/static/pages/forms/statement/linepassengerflow.html renamed to src/main/resources/static/pages/mforms/linepassengerflows/linepassengerflow.html
src/main/resources/static/pages/forms/statement/operationservice.html renamed to src/main/resources/static/pages/mforms/operationservices/operationservice.html
src/main/resources/static/pages/forms/statement/shifday.html renamed to src/main/resources/static/pages/mforms/shifdays/shifday.html
src/main/resources/static/pages/forms/statement/shiftuehiclemanth.html renamed to src/main/resources/static/pages/mforms/shiftuehiclemanths/shiftuehiclemanth.html
src/main/resources/static/pages/forms/statement/singledata.html renamed to src/main/resources/static/pages/mforms/singledatas/singledata.html
src/main/resources/static/pages/forms/statement/turnoutrate.html renamed to src/main/resources/static/pages/mforms/turnoutrates/turnoutrate.html
src/main/resources/static/pages/forms/statement/vehicleloading.html renamed to src/main/resources/static/pages/mforms/vehicleloadings/vehicleloading.html
src/main/resources/static/pages/forms/statement/waybillday.html renamed to src/main/resources/static/pages/mforms/waybilldays/waybillday.html
src/main/resources/static/pages/report/inoutstation.html
| ... | ... | @@ -294,17 +294,18 @@ |
| 294 | 294 | var id=params[0].split("\\")[0]; |
| 295 | 295 | var fcsj = $('.in_carpark_fcsj[data-id='+id+']', '#forms').html(); |
| 296 | 296 | var ddsj= $('.in_carpark_zdsj[data-id='+id+']', '#forms').html(); |
| 297 | - | |
| 298 | - $post('/report/queryListZdxx',{clzbh:nbbm,date:rq,line:line,fcsj:fcsj,ddsj:ddsj},function(result){ | |
| 299 | - var xlmc="线路: "+$("#select2-line-container").html(); | |
| 300 | - var clmc="车辆: "+nbbm; | |
| 301 | - var rqmc="日期: "+rq; | |
| 302 | - var bcmc="班次: "+fcsj+"-"+ddsj; | |
| 303 | - $("#dlzmx").html("到离站详细 "+xlmc+" "+clmc+" "+rqmc+" "+bcmc); | |
| 304 | - var ludan_ll_1 = template('ludan_ll_1',{list:result}); | |
| 305 | - // 把渲染好的模版html文本追加到表格中 | |
| 306 | - $('#forms1 .ludan_ll_1').html(ludan_ll_1); | |
| 307 | - }); | |
| 297 | + if(!(typeof(fcsj)=='undefined'|| typeof(ddsj)=='undefined')){ | |
| 298 | + $post('/report/queryListZdxx',{clzbh:nbbm,date:rq,line:line,fcsj:fcsj,ddsj:ddsj},function(result){ | |
| 299 | + var xlmc="线路: "+$("#select2-line-container").html(); | |
| 300 | + var clmc="车辆: "+nbbm; | |
| 301 | + var rqmc="日期: "+rq; | |
| 302 | + var bcmc="班次: "+fcsj+"-"+ddsj; | |
| 303 | + $("#dlzmx").html("到离站详细 "+xlmc+" "+clmc+" "+rqmc+" "+bcmc); | |
| 304 | + var ludan_ll_1 = template('ludan_ll_1',{list:result}); | |
| 305 | + // 把渲染好的模版html文本追加到表格中 | |
| 306 | + $('#forms1 .ludan_ll_1').html(ludan_ll_1); | |
| 307 | + }); | |
| 308 | + } | |
| 308 | 309 | }) |
| 309 | 310 | |
| 310 | 311 | $("#query2").click(function(){ | ... | ... |
src/main/resources/static/pages/report/message/message.html
| ... | ... | @@ -18,7 +18,7 @@ |
| 18 | 18 | |
| 19 | 19 | <div class="page-head"> |
| 20 | 20 | <div class="page-title"> |
| 21 | - <h1>行车路单</h1> | |
| 21 | + <h1>调度消息分析</h1> | |
| 22 | 22 | </div> |
| 23 | 23 | </div> |
| 24 | 24 | |
| ... | ... | @@ -41,9 +41,9 @@ |
| 41 | 41 | </div> |
| 42 | 42 | <div class="form-group" style="display: inline-block;margin-left: 15px;"> |
| 43 | 43 | <input class="btn btn-default" type="button" id="query" value="查询"/> |
| 44 | - <input class="btn btn-default" type="button" id="export" value="导出"/> | |
| 44 | +<!-- <input class="btn btn-default" type="button" id="export" value="导出"/> --> | |
| 45 | 45 | <input class="btn btn-default" type="button" id="print" value="打印"/> |
| 46 | - <input class="btn btn-default" type="button" id="exportMore" value="批量导出"/> | |
| 46 | +<!-- <input class="btn btn-default" type="button" id="exportMore" value="批量导出"/> --> | |
| 47 | 47 | </div> |
| 48 | 48 | </form> |
| 49 | 49 | </div> |
| ... | ... | @@ -235,12 +235,12 @@ |
| 235 | 235 | {{each list as obj i}} |
| 236 | 236 | <tr> |
| 237 | 237 | <td>{{i+1}}</td> |
| 238 | + <td>{{obj[4]}}</td> | |
| 239 | + <td>{{obj[6]}}</td> | |
| 238 | 240 | <td>{{obj[0]}}</td> |
| 239 | 241 | <td>{{obj[1]}}</td> |
| 240 | - <td>{{obj[2]}}</td> | |
| 241 | 242 | <td>{{obj[3]}}</td> |
| 242 | - <td>{{obj[4]}}</td> | |
| 243 | - <td>{{obj[5]}}</td> | |
| 243 | + <td>{{obj[2]}}</td> | |
| 244 | 244 | </tr> |
| 245 | 245 | {{/each}} |
| 246 | 246 | {{if list.length == 0}} | ... | ... |
src/main/resources/static/pages/report/timetable/timetable.html
| ... | ... | @@ -141,21 +141,21 @@ |
| 141 | 141 | <div class="portlet-body"> |
| 142 | 142 | <div class="row"> |
| 143 | 143 | <div class="col-md-6" > |
| 144 | - <table class="table table-bordered table-checkable"> | |
| 144 | + <table class="table table-bordered table-checkable" id="formsTime4"> | |
| 145 | 145 | <tr> |
| 146 | 146 | <td colspan="6">调度形式</td> |
| 147 | 147 | </tr> |
| 148 | 148 | <tr> |
| 149 | - <td colspan="3" align="center">上行向()站</td> | |
| 150 | - <td colspan="3" align="center">下行向()站</td> | |
| 149 | + <td colspan="3" align="center">上行向(<span id="skb_sxzd"></span>)站</td> | |
| 150 | + <td colspan="3" align="center">下行向(<span id="skb_xxzd"></span>)站</td> | |
| 151 | 151 | </tr> |
| 152 | 152 | <tr> |
| 153 | - <td>起讫站</td> | |
| 154 | - <td>起讫时间</td> | |
| 155 | - <td>班次</td> | |
| 156 | - <td>起讫站</td> | |
| 157 | - <td>起讫时间</td> | |
| 158 | - <td>班次</td> | |
| 153 | + <td width="22%">起讫站</td> | |
| 154 | + <td width="20%">起讫时间</td> | |
| 155 | + <td width="8%">班次</td> | |
| 156 | + <td width="22%">起讫站</td> | |
| 157 | + <td width="20%">起讫时间</td> | |
| 158 | + <td width="8%">班次</td> | |
| 159 | 159 | </tr> |
| 160 | 160 | <tbody class="tbody_time_4"> |
| 161 | 161 | |
| ... | ... | @@ -283,26 +283,25 @@ |
| 283 | 283 | $.get('/report/tbodyTime2',{line:line,ttinfo:ttinfo},function(result){ |
| 284 | 284 | var tbodyTime2 = template('tbodyTime2',{map:result}); |
| 285 | 285 | $('#formsTime2 .tbody_time_2').html(tbodyTime2); |
| 286 | - });/* | |
| 286 | + }); | |
| 287 | 287 | $.get('/report/tbodyTime3',{line:line,ttinfo:ttinfo},function(result){ |
| 288 | - | |
| 289 | 288 | var tbodyTime3 = template('tbodyTime3',{list:result}); |
| 290 | 289 | $('#formsTime3 .tbody_time_3').html(tbodyTime3); |
| 291 | 290 | var divTime3 = window.document.getElementById('formsTime3'); |
| 292 | 291 | var divTime2 = window.document.getElementById('formsTime2'); |
| 293 | - console.log(divTime3.offsetHeight); | |
| 294 | 292 | divTime2.style.height=divTime3.offsetHeight+"px"; |
| 295 | - }); */ | |
| 293 | + }); | |
| 296 | 294 | |
| 297 | - /* | |
| 298 | - $.get('/report/tbodyTime4',{line:line,date:date},function(result){ | |
| 299 | - var scheduleDaily_3 = template('scheduleDaily_3',{list:result}); | |
| 300 | - $('#forms .scheduleDaily_3').html(scheduleDaily_3); | |
| 301 | - });*/ | |
| 302 | - /* $.get('/report/tbodyTime5',{line:line,ttinfo:ttinfo},function(result){ | |
| 295 | + $.get('/report/tbodyTime4',{line:line,ttinfo:ttinfo},function(result){ | |
| 296 | + $("#skb_sxzd").html(result[0].sxzm); | |
| 297 | + $("#skb_xxzd").html(result[0].xxzm); | |
| 298 | + var tbodyTime4 = template('tbodyTime4',{list:result}); | |
| 299 | + $('#formsTime4 .tbody_time_4').html(tbodyTime4); | |
| 300 | + }); | |
| 301 | + $.get('/report/tbodyTime5',{line:line,ttinfo:ttinfo},function(result){ | |
| 303 | 302 | var tbodyTime5 = template('tbodyTime5',{list:result}); |
| 304 | 303 | $('#formsTime5 .tbody_time_5').html(tbodyTime5); |
| 305 | - }); */ | |
| 304 | + }); | |
| 306 | 305 | } |
| 307 | 306 | |
| 308 | 307 | |
| ... | ... | @@ -352,6 +351,27 @@ |
| 352 | 351 | </script> |
| 353 | 352 | |
| 354 | 353 | |
| 354 | + | |
| 355 | + | |
| 356 | +<script type="text/html" id="tbodyTime4"> | |
| 357 | +{{each list as result i}} | |
| 358 | + | |
| 359 | + <tr> | |
| 360 | + <td align="center">{{result.sxzm}}</td> | |
| 361 | + <td align="center">{{result.sxsj}}</td> | |
| 362 | + <td align="center">{{result.sxbc}}</td> | |
| 363 | + <td align="center">{{result.xxzm}}</td> | |
| 364 | + <td align="center">{{result.xxsj}}</td> | |
| 365 | + <td align="center">{{result.xxbc}}</td> | |
| 366 | + </tr> | |
| 367 | +{{/each}} | |
| 368 | +{{if list.length == 0}} | |
| 369 | + <tr> | |
| 370 | + <td colspan="5"><h6 class="muted">没有找到相关数据</h6></td> | |
| 371 | + </tr> | |
| 372 | + {{/if}} | |
| 373 | +</script> | |
| 374 | + | |
| 355 | 375 | <script type="text/html" id="tbodyTime5"> |
| 356 | 376 | {{each list as result i}} |
| 357 | 377 | <tr> | ... | ... |
src/main/resources/static/real_control_v2/assets/echarts-3/echarts.js
No preview for this file type
src/main/resources/static/real_control_v2/css/line_schedule.css
| ... | ... | @@ -55,7 +55,7 @@ |
| 55 | 55 | padding: 0; |
| 56 | 56 | } |
| 57 | 57 | |
| 58 | -.line_schedule .schedule-wrap i.uk-icon-question-circle{ | |
| 58 | +.line_schedule .schedule-wrap .header-title i.uk-icon-question-circle{ | |
| 59 | 59 | cursor: pointer; |
| 60 | 60 | font-size: 14px; |
| 61 | 61 | color: #cccaca; |
| ... | ... | @@ -528,6 +528,7 @@ div.drop-rail[data-type="car"]:before { |
| 528 | 528 | |
| 529 | 529 | dl.relevance-active dd:nth-child(n+2) { |
| 530 | 530 | background: #f1efef !important; |
| 531 | + color: #333; | |
| 531 | 532 | } |
| 532 | 533 | |
| 533 | 534 | dl.relevance-active.intimity dd:nth-child(n+2) { |
| ... | ... | @@ -976,19 +977,19 @@ dd.fcsjActualCell.tl-yzx div.last-sch-sunken span._badge { |
| 976 | 977 | } |
| 977 | 978 | |
| 978 | 979 | dd.fcsjActualCell div.last-sch-sunken span._badge{ |
| 979 | - font-size: 12px; | |
| 980 | - border-radius: 0 7px 7px 0; | |
| 980 | + font-size: 13px; | |
| 981 | + border-radius: 0 9px 9px 0; | |
| 981 | 982 | padding-left: 0; |
| 982 | - width: 79px; | |
| 983 | + width: 81px; | |
| 983 | 984 | display: inline-block; |
| 984 | - height: 22px; | |
| 985 | - line-height: 22px; | |
| 985 | + height: 23px; | |
| 986 | + line-height: 23px; | |
| 986 | 987 | box-shadow: 2px 0px 2px 0 rgba(0,0,0,0.16), 2px 0px 4px 0 rgba(0,0,0,0.12); |
| 987 | 988 | vertical-align: top; |
| 988 | 989 | margin-right: 3px; |
| 989 | 990 | margin-top: 1px; |
| 990 | 991 | margin-left: -7px; |
| 991 | - /*text-indent: 2px;*/ | |
| 992 | + /* text-indent: 2px; */ | |
| 992 | 993 | border-left: 0; |
| 993 | 994 | /* transform: scale(.9); */ |
| 994 | 995 | color: grey; |
| ... | ... | @@ -1022,4 +1023,27 @@ dd.fcsjActualCell div.last-sch-sunken span._badge{ |
| 1022 | 1023 | .ct_table>.ct_table_body dl.dl-last-sch:hover div.last-sch-sunken, |
| 1023 | 1024 | .ct_table>.ct_table_body dl.dl-last-sch.context-menu-active div.last-sch-sunken{ |
| 1024 | 1025 | background: #f5fbff; |
| 1026 | +} | |
| 1027 | + | |
| 1028 | +dd.fcsjActualCell{ | |
| 1029 | + position: relative; | |
| 1030 | +} | |
| 1031 | + | |
| 1032 | +i.signal_state_icon{ | |
| 1033 | + position: absolute; | |
| 1034 | + right: 5px; | |
| 1035 | + top: 7px; | |
| 1036 | + box-shadow: 0px 0px 11px 0 rgba(0, 0, 0, 0.2), -1px 3px 8px 0 rgba(0, 0, 0, 0.19); | |
| 1037 | + text-indent: 0; | |
| 1038 | + border-radius: 15px; | |
| 1039 | + cursor: pointer; | |
| 1040 | +} | |
| 1041 | + | |
| 1042 | +i.signal_state_icon.uk-icon-question-circle{ | |
| 1043 | + color: #e85252 !important; | |
| 1044 | +} | |
| 1045 | + | |
| 1046 | +i.signal_state_icon.uk-icon-reply{ | |
| 1047 | + color: #4134e3 !important; | |
| 1048 | + box-shadow: none; | |
| 1025 | 1049 | } |
| 1026 | 1050 | \ No newline at end of file | ... | ... |
src/main/resources/static/real_control_v2/fragments/line_schedule/sch_table.html
| ... | ... | @@ -83,7 +83,7 @@ |
| 83 | 83 | <dd data-sort-val={{sch.dfsjT}} dbclick dbclick-type="dfsj" dbclick-val="{{sch.dfsj}}"> |
| 84 | 84 | {{sch.dfsj}} |
| 85 | 85 | </dd> |
| 86 | - <dd class=" | |
| 86 | + <dd data-uk-observe class=" | |
| 87 | 87 | {{if sch.status==-1}} |
| 88 | 88 | tl-qrlb |
| 89 | 89 | {{else if sch.status==2}} |
| ... | ... | @@ -130,7 +130,7 @@ |
| 130 | 130 | </script> |
| 131 | 131 | |
| 132 | 132 | <script id="line-schedule-sfsj-temp" type="text/html"> |
| 133 | - <dd class=" | |
| 133 | + <dd data-uk-observe class=" | |
| 134 | 134 | {{if status==-1}} |
| 135 | 135 | tl-qrlb |
| 136 | 136 | {{else if status==2}} | ... | ... |
src/main/resources/static/real_control_v2/fragments/north/nav/signal_state_config.html
0 → 100644
| 1 | +<div class="uk-modal ct-form-modal" id="signal_state_config-modal"> | |
| 2 | + <div class="uk-modal-dialog" style="width: 530px;"> | |
| 3 | + <a href="" class="uk-modal-close uk-close"></a> | |
| 4 | + <div class="uk-modal-header"> | |
| 5 | + <h2>信号标记设置</h2></div> | |
| 6 | + | |
| 7 | + <p style="border-bottom: 1px solid #efefef;color: grey;padding-bottom: 9px;"> | |
| 8 | + <small> | |
| 9 | + <i class="uk-icon-question-circle"> </i> | |
| 10 | + 设置项将会保存在本地客户端,清理缓存和更换电脑会重置.</small> | |
| 11 | + </p> | |
| 12 | + <form class="uk-form uk-form-horizontal"> | |
| 13 | + <div class="uk-grid"> | |
| 14 | + <div class="uk-width-2-3 uk-container-center"> | |
| 15 | + <div class="uk-form-row"> | |
| 16 | + <label class="uk-form-label">是否启用</label> | |
| 17 | + <div class="uk-form-controls"> | |
| 18 | + <select name="enable"> | |
| 19 | + <option value="1">启用</option> | |
| 20 | + <option value="0">禁用</option> | |
| 21 | + </select> | |
| 22 | + </div> | |
| 23 | + </div> | |
| 24 | + </div> | |
| 25 | + </div> | |
| 26 | + | |
| 27 | + <div class="uk-modal-footer uk-text-right" style="margin-bottom: -20px;"> | |
| 28 | + <button type="button" class="uk-button uk-modal-close">取消</button> | |
| 29 | + <button type="submit" class="uk-button uk-button-primary"><i class="uk-icon-check"></i> 保存</button> | |
| 30 | + </div> | |
| 31 | + </form> | |
| 32 | + </div> | |
| 33 | + | |
| 34 | + <script> | |
| 35 | + (function() { | |
| 36 | + var modal = '#signal_state_config-modal'; | |
| 37 | + var f = $('form', modal); | |
| 38 | + | |
| 39 | + $(modal).on('init', function(e, data) { | |
| 40 | + var val = gb_signal_state.isEnable()?1:0; | |
| 41 | + $('[name=enable]', f).val(val); | |
| 42 | + }); | |
| 43 | + | |
| 44 | + f.formValidation(gb_form_validation_opts); | |
| 45 | + f.on('success.form.fv', function(e) { | |
| 46 | + e.preventDefault(); | |
| 47 | + var data = $(this).serializeJSON(); | |
| 48 | + | |
| 49 | + if(data.enable=='1') | |
| 50 | + gb_signal_state.enable(); | |
| 51 | + else | |
| 52 | + gb_signal_state.disable(); | |
| 53 | + | |
| 54 | + UIkit.modal(modal).hide(); | |
| 55 | + }); | |
| 56 | + | |
| 57 | + })(); | |
| 58 | + </script> | |
| 59 | +</div> | |
| 0 | 60 | \ No newline at end of file | ... | ... |
src/main/resources/static/real_control_v2/js/data/json/north_toolbar.json
src/main/resources/static/real_control_v2/js/line_schedule/layout.js
| ... | ... | @@ -22,7 +22,7 @@ var gb_line_layout = (function() { |
| 22 | 22 | }; |
| 23 | 23 | |
| 24 | 24 | //图例icon tootip |
| 25 | - $(document).on('mouseenter', '.schedule-wrap i.uk-icon-question-circle', function() { | |
| 25 | + $(document).on('mouseenter', '.schedule-wrap .header-title i.uk-icon-question-circle', function() { | |
| 26 | 26 | $(this).qtip({ |
| 27 | 27 | show: { |
| 28 | 28 | ready: true, | ... | ... |
src/main/resources/static/real_control_v2/js/line_schedule/sch_table.js
| ... | ... | @@ -236,6 +236,8 @@ var gb_schedule_table = (function () { |
| 236 | 236 | else |
| 237 | 237 | $(dds[8]).html(''); |
| 238 | 238 | |
| 239 | + //信号状态标记 | |
| 240 | + gb_signal_state.marker_sch(sch); | |
| 239 | 241 | //班次是车辆的最后一班 |
| 240 | 242 | if(dl.hasClass('dl-last-sch')) |
| 241 | 243 | markerLastSch([sch]); |
| ... | ... | @@ -446,6 +448,7 @@ var gb_schedule_table = (function () { |
| 446 | 448 | return car_yfwf_map[lineCode]; |
| 447 | 449 | }, |
| 448 | 450 | scroToDl: scroToDl, |
| 449 | - reset_drag_active_all: reset_drag_active_all | |
| 451 | + reset_drag_active_all: reset_drag_active_all, | |
| 452 | + getDl: getDl | |
| 450 | 453 | }; |
| 451 | 454 | })(); | ... | ... |
src/main/resources/static/real_control_v2/js/main.js
| 1 | 1 | //主调和监控模式 |
| 2 | 2 | var operationMode = window.localStorage.getItem('operationMode'); |
| 3 | -if(operationMode == 0){ | |
| 3 | +if (operationMode == 0) { | |
| 4 | 4 | $('body>.north').addClass('monitor'); |
| 5 | 5 | $(document).on('ajaxSend', interceptPOST); |
| 6 | 6 | } |
| ... | ... | @@ -8,8 +8,8 @@ else |
| 8 | 8 | $('body>.north').addClass('main'); |
| 9 | 9 | |
| 10 | 10 | //拦截POST请求 |
| 11 | -function interceptPOST(e, xhr, t){ | |
| 12 | - if(t && (t.method == 'POST' || t.type == 'POST')){ | |
| 11 | +function interceptPOST(e, xhr, t) { | |
| 12 | + if (t && (t.method == 'POST' || t.type == 'POST')) { | |
| 13 | 13 | console.log(e, xhr, t); |
| 14 | 14 | xhr.abort(); |
| 15 | 15 | notify_err('监控模式!'); |
| ... | ... | @@ -18,54 +18,56 @@ function interceptPOST(e, xhr, t){ |
| 18 | 18 | |
| 19 | 19 | /* main js */ |
| 20 | 20 | var gb_main_ep = new EventProxy(), |
| 21 | - res_load_ep = EventProxy.create('load_data_basic', 'load_tab', 'load_home_layout', 'load_home_line_panel', function() { | |
| 21 | + res_load_ep = EventProxy.create('load_data_basic', 'load_tab', 'load_home_layout', 'load_home_line_panel', function () { | |
| 22 | 22 | var eq = gb_main_ep; |
| 23 | 23 | // basic data end |
| 24 | 24 | eq.once('data-basic', g_emit('tab')); |
| 25 | 25 | // tabs |
| 26 | - eq.once('tab', function() { | |
| 26 | + eq.once('tab', function () { | |
| 27 | 27 | gb_tabs.init( |
| 28 | 28 | g_emit('home-layout') |
| 29 | 29 | ); |
| 30 | 30 | }); |
| 31 | 31 | //home layout |
| 32 | - eq.once('home-layout', function() { | |
| 32 | + eq.once('home-layout', function () { | |
| 33 | 33 | gb_home_layout.layout( |
| 34 | 34 | g_emit('home-line-panel') |
| 35 | 35 | ); |
| 36 | 36 | }); |
| 37 | 37 | //home line panel |
| 38 | - eq.once('home-line-panel', function() { | |
| 38 | + eq.once('home-line-panel', function () { | |
| 39 | 39 | gb_home_line_panel.init(g_emit('gps-time-refresh')); |
| 40 | 40 | }); |
| 41 | 41 | |
| 42 | 42 | //start fixed time refresh gps |
| 43 | - eq.once('gps-time-refresh', function() { | |
| 43 | + eq.once('gps-time-refresh', function () { | |
| 44 | 44 | gb_data_gps.fixedTimeRefresh(); |
| 45 | 45 | g_emit('line-schedule-layout')(); |
| 46 | 46 | }); |
| 47 | 47 | |
| 48 | 48 | //line schedule layout |
| 49 | - eq.once('line-schedule-layout', function() { | |
| 49 | + eq.once('line-schedule-layout', function () { | |
| 50 | 50 | gb_line_layout.layout(g_emit('render-sch-table')); |
| 51 | 51 | }); |
| 52 | 52 | |
| 53 | 53 | //render schedule table |
| 54 | - eq.once('render-sch-table', function() { | |
| 55 | - gb_schedule_table.show(function(){ | |
| 56 | - //搜索框 | |
| 57 | - gb_sch_search.init(); | |
| 54 | + eq.once('render-sch-table', function () { | |
| 55 | + gb_schedule_table.show(function () { | |
| 56 | + //搜索框 | |
| 57 | + gb_sch_search.init(); | |
| 58 | + //加载信号状态 | |
| 59 | + gb_signal_state.init(); | |
| 58 | 60 | }); |
| 59 | 61 | |
| 60 | 62 | //嵌入地图页面 |
| 61 | - $('li.map-panel','#main-tab-content').load('/real_control_v2/mapmonitor/real.html'); | |
| 62 | - | |
| 63 | + $('li.map-panel', '#main-tab-content').load('/real_control_v2/mapmonitor/real.html'); | |
| 64 | + //弹出更新说明 | |
| 63 | 65 | showUpdateDescription(); |
| 64 | 66 | }); |
| 65 | 67 | |
| 66 | 68 | function g_emit(id) { |
| 67 | 69 | console.log('g_emit [' + id + ']'); |
| 68 | - return function() { | |
| 70 | + return function () { | |
| 69 | 71 | console.log('eq.emitLater(' + id + ')'); |
| 70 | 72 | return eq.emitLater(id); |
| 71 | 73 | }; |
| ... | ... | @@ -73,17 +75,17 @@ var gb_main_ep = new EventProxy(), |
| 73 | 75 | }); |
| 74 | 76 | |
| 75 | 77 | //modal hide remove dom |
| 76 | -$(document).on('hide.uk.modal', '.uk-modal', function() { | |
| 78 | +$(document).on('hide.uk.modal', '.uk-modal', function () { | |
| 77 | 79 | $(this).remove(); |
| 78 | 80 | }); |
| 79 | 81 | |
| 80 | 82 | $(document).on('click', '.ct-bottom-drawer-close', function () { |
| 81 | - $(this).parents('.ct-bottom-drawer').removeClass('open'); | |
| 83 | + $(this).parents('.ct-bottom-drawer').removeClass('open'); | |
| 82 | 84 | }); |
| 83 | 85 | |
| 84 | 86 | function connectArr(arr, separator, transFun) { |
| 85 | 87 | var rs = ''; |
| 86 | - $.each(arr, function(i, item) { | |
| 88 | + $.each(arr, function (i, item) { | |
| 87 | 89 | if (transFun) |
| 88 | 90 | item = transFun(item); |
| 89 | 91 | rs += (separator + item); |
| ... | ... | @@ -102,26 +104,26 @@ var gb_form_validation_opts = { |
| 102 | 104 | }; |
| 103 | 105 | |
| 104 | 106 | |
| 105 | -var notify_wait = function(t) { | |
| 107 | +var notify_wait = function (t) { | |
| 106 | 108 | UIkit.notify("<i class='uk-icon-spinner uk-icon-spin'></i> " + t, { |
| 107 | 109 | status: 'info' |
| 108 | 110 | }); |
| 109 | 111 | }; |
| 110 | 112 | |
| 111 | -var notify_succ = function(t) { | |
| 113 | +var notify_succ = function (t) { | |
| 112 | 114 | UIkit.notify("<i class='uk-icon-check'></i> " + t, { |
| 113 | 115 | status: 'success' |
| 114 | 116 | }); |
| 115 | 117 | }; |
| 116 | 118 | |
| 117 | -var notify_err = function(t) { | |
| 119 | +var notify_err = function (t) { | |
| 118 | 120 | UIkit.notify("<i class='uk-icon-times'></i> " + t, { |
| 119 | 121 | status: 'danger' |
| 120 | 122 | }); |
| 121 | 123 | }; |
| 122 | 124 | |
| 123 | -var alt_confirm = function(content, succ, okBtn) { | |
| 124 | - var modalEl = UIkit.modal.confirm(content, function() { | |
| 125 | +var alt_confirm = function (content, succ, okBtn) { | |
| 126 | + var modalEl = UIkit.modal.confirm(content, function () { | |
| 125 | 127 | succ && succ(); |
| 126 | 128 | modalEl.hide(); |
| 127 | 129 | }, { |
| ... | ... | @@ -129,15 +131,15 @@ var alt_confirm = function(content, succ, okBtn) { |
| 129 | 131 | Ok: okBtn, |
| 130 | 132 | Cancel: '取消' |
| 131 | 133 | } |
| 132 | - ,center: true | |
| 134 | + , center: true | |
| 133 | 135 | }); |
| 134 | 136 | }; |
| 135 | 137 | |
| 136 | -var isArray = function(obj) { | |
| 138 | +var isArray = function (obj) { | |
| 137 | 139 | return Object.prototype.toString.call(obj) === '[object Array]'; |
| 138 | 140 | }; |
| 139 | 141 | |
| 140 | -var notify_err_form = function(t, form) { | |
| 142 | +var notify_err_form = function (t, form) { | |
| 141 | 143 | $('.uk-alert-danger', form).remove(); |
| 142 | 144 | $('.uk-modal-footer', form).before('<div class="uk-alert uk-alert-danger" data-uk-alert="">' + |
| 143 | 145 | '<a href="" class="uk-alert-close uk-close"></a>' + |
| ... | ... | @@ -147,29 +149,29 @@ var notify_err_form = function(t, form) { |
| 147 | 149 | enable_submit_btn(form); |
| 148 | 150 | }; |
| 149 | 151 | |
| 150 | -var enable_submit_btn = function(form) { | |
| 152 | +var enable_submit_btn = function (form) { | |
| 151 | 153 | var subBtn = $('button[type=submit]', form); |
| 152 | 154 | if (subBtn) { |
| 153 | 155 | subBtn.removeClass('disabled').removeAttr('disabled'); |
| 154 | 156 | } |
| 155 | 157 | } |
| 156 | 158 | |
| 157 | -var disabled_submit_btn = function(form) { | |
| 159 | +var disabled_submit_btn = function (form) { | |
| 158 | 160 | var subBtn = $('button[type=submit]', form); |
| 159 | 161 | if (subBtn) { |
| 160 | - subBtn.addClass('disabled').attr('disabled','disabled'); | |
| 162 | + subBtn.addClass('disabled').attr('disabled', 'disabled'); | |
| 161 | 163 | } |
| 162 | 164 | }; |
| 163 | 165 | |
| 164 | -var show_modal = function(id, dom) { | |
| 166 | +var show_modal = function (id, dom) { | |
| 165 | 167 | $(document.body).append(dom); |
| 166 | 168 | return UIkit.modal(id, { |
| 167 | 169 | bgclose: false |
| 168 | 170 | }).show(); |
| 169 | 171 | }; |
| 170 | 172 | |
| 171 | -var open_modal = function(pageUrl, data, opt) { | |
| 172 | - $.get(pageUrl, function(dom) { | |
| 173 | +var open_modal = function (pageUrl, data, opt) { | |
| 174 | + $.get(pageUrl, function (dom) { | |
| 173 | 175 | if (!$(dom).hasClass('uk-modal')) { |
| 174 | 176 | alert('无效的dom片段!'); |
| 175 | 177 | return; |
| ... | ... | @@ -188,20 +190,20 @@ var open_modal = function(pageUrl, data, opt) { |
| 188 | 190 | |
| 189 | 191 | function showUpdateDescription() { |
| 190 | 192 | //更新说明 |
| 191 | - var updateDescription={ | |
| 193 | + var updateDescription = { | |
| 192 | 194 | date: '2016-12-20', |
| 193 | 195 | text: '<h5>1、回场子任务开放使用。</h5>' |
| 194 | 196 | }; |
| 195 | 197 | |
| 196 | 198 | var storage = window.localStorage |
| 197 | - ,key = 'update_' + updateDescription.date; | |
| 199 | + , key = 'update_' + updateDescription.date; | |
| 198 | 200 | var text = storage.getItem(key); |
| 199 | - if(!text){ | |
| 200 | - var modal = '<div class="uk-modal" id="update-description-modal">'+ | |
| 201 | - ' <div class="uk-modal-dialog">'+ | |
| 202 | - ' <a class="uk-modal-close uk-close"></a>'+ | |
| 203 | - ' <div class="uk-modal-header">'+ | |
| 204 | - ' <h2>'+updateDescription.date+' 更新说明</h2></div>'+updateDescription.text+ | |
| 201 | + if (!text) { | |
| 202 | + var modal = '<div class="uk-modal" id="update-description-modal">' + | |
| 203 | + ' <div class="uk-modal-dialog">' + | |
| 204 | + ' <a class="uk-modal-close uk-close"></a>' + | |
| 205 | + ' <div class="uk-modal-header">' + | |
| 206 | + ' <h2>' + updateDescription.date + ' 更新说明</h2></div>' + updateDescription.text + | |
| 205 | 207 | ' </div>'; |
| 206 | 208 | |
| 207 | 209 | show_modal('#update-description-modal', modal); | ... | ... |
src/main/resources/static/real_control_v2/js/north/toolbar.js
| ... | ... | @@ -71,6 +71,9 @@ var gb_northToolbar = (function() { |
| 71 | 71 | }, |
| 72 | 72 | gps_play_back: function () { |
| 73 | 73 | gb_map_play_back.initParams(); |
| 74 | + }, | |
| 75 | + signal_state: function () { | |
| 76 | + open_modal('/real_control_v2/fragments/north/nav/signal_state_config.html', {}, modal_opts); | |
| 74 | 77 | } |
| 75 | 78 | } |
| 76 | 79 | })(); | ... | ... |
src/main/resources/static/real_control_v2/js/signal_state/signal_state.js
0 → 100644
| 1 | +/** | |
| 2 | + * GPS信号状态 | |
| 3 | + * @type {{}} | |
| 4 | + */ | |
| 5 | +var gb_signal_state = (function () { | |
| 6 | + var storage = window.localStorage; | |
| 7 | + | |
| 8 | + $(document).on('click', 'i.signal_state_icon', function (e) { | |
| 9 | + e.stopPropagation(); | |
| 10 | + }); | |
| 11 | + | |
| 12 | + var signal_state_data = {}; | |
| 13 | + var enable = true; | |
| 14 | + //读取本地状态 | |
| 15 | + var locStatus = storage.getItem("signal_state_enable"); | |
| 16 | + if (locStatus && locStatus=='0') | |
| 17 | + enable = false; | |
| 18 | + | |
| 19 | + var init = function () { | |
| 20 | + $.get('/signalState/multi', {idx: gb_data_basic.line_idx}, function (rs) { | |
| 21 | + //按班次ID分组 | |
| 22 | + signal_state_data = gb_common.groupBy(rs, 'schId'); | |
| 23 | + | |
| 24 | + for (var schId in signal_state_data) { | |
| 25 | + multi_render(signal_state_data[schId]); | |
| 26 | + } | |
| 27 | + }); | |
| 28 | + }; | |
| 29 | + | |
| 30 | + var multi_render = function (list) { | |
| 31 | + if (!enable) | |
| 32 | + return; | |
| 33 | + | |
| 34 | + if (!list || list.length == 0) | |
| 35 | + return; | |
| 36 | + var line = list[0].lineCode | |
| 37 | + , schId = list[0].schId; | |
| 38 | + | |
| 39 | + var sch = gb_schedule_table.findScheduleByLine(line)[schId]; | |
| 40 | + var dl = gb_schedule_table.getDl(sch); | |
| 41 | + var icon = 'question-circle'; | |
| 42 | + var t = ''; | |
| 43 | + $.each(list, function () { | |
| 44 | + t += (this.text + '<br>'); | |
| 45 | + }); | |
| 46 | + | |
| 47 | + if (list.length == 1 && list[0].type == 'route_reverse') | |
| 48 | + icon = 'reply'; | |
| 49 | + | |
| 50 | + var dd = $('dd.fcsjActualCell', dl); | |
| 51 | + var se = $('i.signal_state_icon', dd); | |
| 52 | + if (se && se.length > 0) | |
| 53 | + se.remove(); | |
| 54 | + | |
| 55 | + dd.append('<i data-uk-tooltip title="' + t + '" class="uk-icon-' + icon + ' signal_state_icon"></i>'); | |
| 56 | + }; | |
| 57 | + | |
| 58 | + var put = function (obj) { | |
| 59 | + if (!signal_state_data[obj.schId]) { | |
| 60 | + signal_state_data[obj.schId] = []; | |
| 61 | + } | |
| 62 | + | |
| 63 | + signal_state_data[obj.schId].push(obj); | |
| 64 | + multi_render(signal_state_data[obj.schId]); | |
| 65 | + }; | |
| 66 | + | |
| 67 | + var marker_sch = function (sch) { | |
| 68 | + var list = signal_state_data[sch.id]; | |
| 69 | + if (list) { | |
| 70 | + multi_render(list); | |
| 71 | + } | |
| 72 | + }; | |
| 73 | + | |
| 74 | + var clearAll = function () { | |
| 75 | + $('.signal_state_icon').remove(); | |
| 76 | + }; | |
| 77 | + | |
| 78 | + return { | |
| 79 | + init: init, | |
| 80 | + put: put, | |
| 81 | + marker_sch: marker_sch, | |
| 82 | + isEnable: function () { | |
| 83 | + return enable; | |
| 84 | + }, | |
| 85 | + disable: function () { | |
| 86 | + enable = false; | |
| 87 | + storage.setItem("signal_state_enable", 0); | |
| 88 | + | |
| 89 | + clearAll(); | |
| 90 | + }, | |
| 91 | + enable: function () { | |
| 92 | + enable = true; | |
| 93 | + storage.setItem("signal_state_enable", 1); | |
| 94 | + for (var schId in signal_state_data) { | |
| 95 | + multi_render(signal_state_data[schId]); | |
| 96 | + } | |
| 97 | + } | |
| 98 | + }; | |
| 99 | +})(); | |
| 0 | 100 | \ No newline at end of file | ... | ... |
src/main/resources/static/real_control_v2/js/websocket/sch_websocket.js
| ... | ... | @@ -26,7 +26,7 @@ var gb_sch_websocket = (function () { |
| 26 | 26 | var data = { |
| 27 | 27 | operCode: 'register_line', |
| 28 | 28 | idx: gb_data_basic.line_idx |
| 29 | - } | |
| 29 | + }; | |
| 30 | 30 | schSock.send(JSON.stringify(data)); |
| 31 | 31 | console.log('regListen....', data); |
| 32 | 32 | } |
| ... | ... | @@ -45,21 +45,21 @@ var gb_sch_websocket = (function () { |
| 45 | 45 | var calcUntreated = function (lineCode) { |
| 46 | 46 | var size = $('li.line_schedule[data-id=' + lineCode + '] .sys-mailbox .sys-mail-item').length; |
| 47 | 47 | $('#badge_untreated_num_' + lineCode).text(size); |
| 48 | - } | |
| 48 | + }; | |
| 49 | 49 | |
| 50 | 50 | var calcUntreatedAll = function () { |
| 51 | 51 | $('#main-tab-content li.line_schedule').each(function () { |
| 52 | 52 | calcUntreated($(this).data('id')); |
| 53 | 53 | }); |
| 54 | - } | |
| 54 | + }; | |
| 55 | 55 | |
| 56 | 56 | |
| 57 | 57 | //80协议上报 |
| 58 | 58 | var report80 = function (msg) { |
| 59 | 59 | msg.dateStr = moment(msg.timestamp).format('HH:mm'); |
| 60 | 60 | msg.text = gb_common.reqCode80[msg.data.requestCode]; |
| 61 | - if(!msg.text) | |
| 62 | - msg.text='(未知的请求码 '+msg.data.requestCode+')'; | |
| 61 | + if (!msg.text) | |
| 62 | + msg.text = '(未知的请求码 ' + msg.data.requestCode + ')'; | |
| 63 | 63 | |
| 64 | 64 | var $item = $(temps['sys-note-80-temp'](msg)); |
| 65 | 65 | findMailBox(msg.data.lineId).prepend($item); |
| ... | ... | @@ -68,7 +68,7 @@ var gb_sch_websocket = (function () { |
| 68 | 68 | gb_tts.speak(ttsMsg, msg.data.lineId); |
| 69 | 69 | |
| 70 | 70 | calcUntreated(msg.data.lineId); |
| 71 | - } | |
| 71 | + }; | |
| 72 | 72 | |
| 73 | 73 | var waitRemoves = []; |
| 74 | 74 | //车辆发出 |
| ... | ... | @@ -89,7 +89,7 @@ var gb_sch_websocket = (function () { |
| 89 | 89 | gb_schedule_table.calc_yfwf_num(msg.t.xlBm); |
| 90 | 90 | |
| 91 | 91 | calcUntreated(msg.t.xlBm); |
| 92 | - } | |
| 92 | + }; | |
| 93 | 93 | |
| 94 | 94 | //到达终点 |
| 95 | 95 | var zhongDian = function (msg) { |
| ... | ... | @@ -107,20 +107,20 @@ var gb_sch_websocket = (function () { |
| 107 | 107 | gb_tts.speak(ttsMsg, msg.t.xlBm); |
| 108 | 108 | |
| 109 | 109 | calcUntreated(msg.t.xlBm); |
| 110 | - } | |
| 110 | + }; | |
| 111 | 111 | |
| 112 | 112 | //服务器通知刷新班次 |
| 113 | 113 | var refreshSch = function (msg) { |
| 114 | 114 | gb_schedule_table.updateSchedule(msg.ts); |
| 115 | 115 | /*//重新计算应发未发 |
| 116 | - var idx={}; | |
| 117 | - $.each(msg.ts, function(i, t){ | |
| 118 | - if(idx[t.xlBm]) | |
| 119 | - return true; | |
| 120 | - gb_schedule_table.calc_yfwf_num(t.xlBm); | |
| 121 | - idx[t.xlBm]=1; | |
| 122 | - });*/ | |
| 123 | - } | |
| 116 | + var idx={}; | |
| 117 | + $.each(msg.ts, function(i, t){ | |
| 118 | + if(idx[t.xlBm]) | |
| 119 | + return true; | |
| 120 | + gb_schedule_table.calc_yfwf_num(t.xlBm); | |
| 121 | + idx[t.xlBm]=1; | |
| 122 | + });*/ | |
| 123 | + }; | |
| 124 | 124 | |
| 125 | 125 | //80消息确认 |
| 126 | 126 | var d80Confirm = function (msg) { |
| ... | ... | @@ -129,12 +129,17 @@ var gb_sch_websocket = (function () { |
| 129 | 129 | calcUntreated(msg.lineId); |
| 130 | 130 | //重新计算应发未发 |
| 131 | 131 | gb_schedule_table.calc_yfwf_num(msg.lineId); |
| 132 | - } | |
| 132 | + }; | |
| 133 | 133 | |
| 134 | 134 | //指令状态改变 |
| 135 | - var directiveStatus = function(msg){ | |
| 135 | + var directiveStatus = function (msg) { | |
| 136 | 136 | gb_schedule_table.updateSchedule(msg.t); |
| 137 | - } | |
| 137 | + }; | |
| 138 | + | |
| 139 | + //班次信号状态 | |
| 140 | + var signalState = function (msg) { | |
| 141 | + gb_signal_state.put(msg.data); | |
| 142 | + }; | |
| 138 | 143 | |
| 139 | 144 | var msgHandle = { |
| 140 | 145 | report80: report80, |
| ... | ... | @@ -142,8 +147,9 @@ var gb_sch_websocket = (function () { |
| 142 | 147 | zhongDian: zhongDian, |
| 143 | 148 | refreshSch: refreshSch, |
| 144 | 149 | d80Confirm: d80Confirm, |
| 145 | - directive: directiveStatus | |
| 146 | - } | |
| 150 | + directive: directiveStatus, | |
| 151 | + signal_state: signalState | |
| 152 | + }; | |
| 147 | 153 | |
| 148 | 154 | function currentSecond() { |
| 149 | 155 | return Date.parse(new Date()) / 1000; |
| ... | ... | @@ -167,15 +173,15 @@ var gb_sch_websocket = (function () { |
| 167 | 173 | $(this).parents('.sys-note-42').remove(); |
| 168 | 174 | |
| 169 | 175 | var size = $(this).parents('.sys-mailbox').find('.sys-mail-item').length |
| 170 | - ,lineCode = $(this).parents('li.line_schedule').data('id'); | |
| 176 | + , lineCode = $(this).parents('li.line_schedule').data('id'); | |
| 171 | 177 | |
| 172 | 178 | $('#badge_untreated_num_' + lineCode).text(size); |
| 173 | 179 | }); |
| 174 | 180 | |
| 175 | 181 | //42消息点击 |
| 176 | 182 | $(document).on('click', '.sys-mailbox .sys-note-42', function () { |
| 177 | - var lineCode=$(this).parents('li.line_schedule').data('id') | |
| 178 | - ,id=$(this).data('id'); | |
| 183 | + var lineCode = $(this).parents('li.line_schedule').data('id') | |
| 184 | + , id = $(this).data('id'); | |
| 179 | 185 | var sch = gb_schedule_table.findScheduleByLine(lineCode)[id]; |
| 180 | 186 | var dl = gb_schedule_table.scroToDl(sch); |
| 181 | 187 | //高亮 |
| ... | ... | @@ -205,7 +211,7 @@ var gb_sch_websocket = (function () { |
| 205 | 211 | notify_succ(rs.msg); |
| 206 | 212 | cb && cb(); |
| 207 | 213 | }); |
| 208 | - } | |
| 214 | + }; | |
| 209 | 215 | |
| 210 | 216 | |
| 211 | 217 | //定时到离站信使清理掉 | ... | ... |
src/main/resources/static/real_control_v2/main.html
| ... | ... | @@ -142,6 +142,8 @@ |
| 142 | 142 | <script src="/real_control_v2/assets/echarts-3/echarts.js"></script> |
| 143 | 143 | <!-- Geolib --> |
| 144 | 144 | <script src="/real_control_v2/geolib/geolib.js"></script> |
| 145 | + | |
| 146 | + <script src="/real_control_v2/js/signal_state/signal_state.js"></script> | |
| 145 | 147 | </body> |
| 146 | 148 | |
| 147 | 149 | </html> | ... | ... |
src/main/resources/static/real_control_v2/mapmonitor/fragments/playback/run.html
| ... | ... | @@ -148,10 +148,14 @@ |
| 148 | 148 | var logs = []; |
| 149 | 149 | for (var i = 0; i <= ei; i++) { |
| 150 | 150 | trailArray.push(new BMap.Point(gpsArray[i].bd_lon, gpsArray[i].bd_lat)); |
| 151 | - if(i > 0 && logs[logs.length - 1].road.ROAD_CODE == gpsArray[i].road.ROAD_CODE) | |
| 152 | - logs.pop(); | |
| 153 | - | |
| 154 | - logs.push(gpsArray[i]); | |
| 151 | + try { | |
| 152 | + if(i > 0 && logs[logs.length - 1].road.ROAD_CODE == gpsArray[i].road.ROAD_CODE) | |
| 153 | + logs.pop(); | |
| 154 | + } | |
| 155 | + catch (e){} | |
| 156 | + | |
| 157 | + if(gpsArray[i].road) | |
| 158 | + logs.push(gpsArray[i]); | |
| 155 | 159 | } |
| 156 | 160 | trailPolyline.setPath(trailArray); |
| 157 | 161 | |
| ... | ... | @@ -302,6 +306,9 @@ |
| 302 | 306 | gb_ct_table.fixedHead(logWrap); |
| 303 | 307 | |
| 304 | 308 | function logWrite(gps, prve) { |
| 309 | + if(!gps.road || !gps.road.ROAD_CODE) | |
| 310 | + return; | |
| 311 | + | |
| 305 | 312 | var code = gps.road.ROAD_CODE; |
| 306 | 313 | if (!prve || code != prve.road.ROAD_CODE) { |
| 307 | 314 | logPanel.append('<dl data-code="' + code + '" ><dd>' + gps.timeStr + '</dd><dd>' + gps.speed + '</dd><dd>' + gps.road.ROAD_NAME + '</dd><dd>正常</dd></dl>'); | ... | ... |