Commit 7ebfa758d4878aa4ee9b4db3cedbb8f5f29e7827
1 parent
62867bc2
LGF 报表
Showing
6 changed files
with
1013 additions
and
244 deletions
src/main/java/com/bsth/service/impl/BusIntervalServiceImpl.java
| ... | ... | @@ -44,12 +44,6 @@ public class BusIntervalServiceImpl implements BusIntervalService { |
| 44 | 44 | List<ScheduleRealInfo> list = new ArrayList<ScheduleRealInfo>(); |
| 45 | 45 | List<ScheduleRealInfo> resList = new ArrayList<ScheduleRealInfo>(); |
| 46 | 46 | |
| 47 | - if(startDate.length() == 0){ | |
| 48 | - startDate = new SimpleDateFormat("yyyy-MM-dd").format(new Date()); | |
| 49 | - } | |
| 50 | - if(endDate.length() == 0){ | |
| 51 | - endDate = new SimpleDateFormat("yyyy-MM-dd").format(new Date()); | |
| 52 | - } | |
| 53 | 47 | try { |
| 54 | 48 | |
| 55 | 49 | String sql = "select * from bsth_c_s_sp_info_real where DATE_FORMAT(schedule_date,'%Y-%m-%d') >= '"+startDate+"' and DATE_FORMAT(schedule_date,'%Y-%m-%d') <= '"+endDate+"'"; |
| ... | ... | @@ -84,6 +78,13 @@ public class BusIntervalServiceImpl implements BusIntervalService { |
| 84 | 78 | schedule.setXlDir(rs.getString("xl_dir")); |
| 85 | 79 | schedule.setStatus(rs.getInt("status")); |
| 86 | 80 | schedule.setRemarks(rs.getString("remarks")); |
| 81 | + schedule.setGsName(rs.getString("gs_name")); | |
| 82 | + schedule.setFgsName(rs.getString("fgs_name")); | |
| 83 | + schedule.setDfAuto(rs.getBoolean("df_auto")); | |
| 84 | + schedule.setOnline(rs.getBoolean("online")); | |
| 85 | + schedule.setClZbh(rs.getString("cl_zbh")); | |
| 86 | + schedule.setjGh(rs.getString("j_gh")); | |
| 87 | + schedule.setjName(rs.getString("j_name")); | |
| 87 | 88 | return schedule; |
| 88 | 89 | } |
| 89 | 90 | }); |
| ... | ... | @@ -216,6 +217,16 @@ public class BusIntervalServiceImpl implements BusIntervalService { |
| 216 | 217 | String model = map.get("model").toString(); |
| 217 | 218 | String times = map.get("times").toString(); |
| 218 | 219 | String type = map.get("type").toString(); |
| 220 | + | |
| 221 | + if(startDate.length() == 0){ | |
| 222 | + startDate = new SimpleDateFormat("yyyy-MM-dd").format(new Date()); | |
| 223 | + } | |
| 224 | + if(endDate.length() == 0){ | |
| 225 | + endDate = new SimpleDateFormat("yyyy-MM-dd").format(new Date()); | |
| 226 | + } | |
| 227 | + if(times.length() == 0){ | |
| 228 | + times = "06:00-07:00"; | |
| 229 | + } | |
| 219 | 230 | |
| 220 | 231 | List<ScheduleRealInfo> list = this.getSchedule(line, startDate, endDate, model, times); |
| 221 | 232 | |
| ... | ... | @@ -243,6 +254,7 @@ public class BusIntervalServiceImpl implements BusIntervalService { |
| 243 | 254 | long sjInterval = 0; |
| 244 | 255 | int jhNum = 0; |
| 245 | 256 | int sjNum = 0; |
| 257 | + String company = "", subCompany = ""; | |
| 246 | 258 | Map<String, Object> tempMap = new HashMap<String, Object>(); |
| 247 | 259 | Map<String, List<ScheduleRealInfo>> temp = new HashMap<String, List<ScheduleRealInfo>>(); |
| 248 | 260 | for(ScheduleRealInfo schedule : keyMap.get(key)){ |
| ... | ... | @@ -257,6 +269,10 @@ public class BusIntervalServiceImpl implements BusIntervalService { |
| 257 | 269 | jhNum++; |
| 258 | 270 | ScheduleRealInfo schedule1 = tempList.get(i - 1); |
| 259 | 271 | ScheduleRealInfo schedule2 = tempList.get(i); |
| 272 | + if(schedule1.getGsName() != null && company.length() == 0) | |
| 273 | + company = schedule1.getGsName(); | |
| 274 | + if(schedule1.getFgsName() != null && subCompany.length() == 0) | |
| 275 | + subCompany = schedule1.getFgsName(); | |
| 260 | 276 | jhInterval += schedule2.getFcsjT(); |
| 261 | 277 | jhInterval -= schedule1.getFcsjT(); |
| 262 | 278 | if(schedule1.getFcsjActual()!=null && schedule2.getFcsjActual()!=null){ |
| ... | ... | @@ -274,6 +290,8 @@ public class BusIntervalServiceImpl implements BusIntervalService { |
| 274 | 290 | tempMap.put("line", keys[0]); |
| 275 | 291 | tempMap.put("qdz", keys[1]); |
| 276 | 292 | tempMap.put("times", times); |
| 293 | + tempMap.put("company", company); | |
| 294 | + tempMap.put("subCompany", subCompany); | |
| 277 | 295 | if(jhNum != 0) |
| 278 | 296 | tempMap.put("jhInterval", jhInterval/jhNum); |
| 279 | 297 | else |
| ... | ... | @@ -286,7 +304,8 @@ public class BusIntervalServiceImpl implements BusIntervalService { |
| 286 | 304 | tempMap.put("sjInterval", "/"); |
| 287 | 305 | tempMap.put("deviation", "/"); |
| 288 | 306 | } |
| 289 | - resList.add(tempMap); | |
| 307 | + if(tempMap.get("jhInterval") != null && !tempMap.get("jhInterval").toString().equals("0") && !tempMap.get("jhInterval").toString().equals("/")) | |
| 308 | + resList.add(tempMap); | |
| 290 | 309 | } |
| 291 | 310 | |
| 292 | 311 | //排序 |
| ... | ... | @@ -322,6 +341,16 @@ public class BusIntervalServiceImpl implements BusIntervalService { |
| 322 | 341 | String type = map.get("type").toString(); |
| 323 | 342 | String zdzName = map.get("upDown").toString(); |
| 324 | 343 | |
| 344 | + if(startDate.length() == 0){ | |
| 345 | + startDate = new SimpleDateFormat("yyyy-MM-dd").format(new Date()); | |
| 346 | + } | |
| 347 | + if(endDate.length() == 0){ | |
| 348 | + endDate = new SimpleDateFormat("yyyy-MM-dd").format(new Date()); | |
| 349 | + } | |
| 350 | + if(times.length() == 0){ | |
| 351 | + times = "06:00-07:00"; | |
| 352 | + } | |
| 353 | + | |
| 325 | 354 | List<ScheduleRealInfo> list = this.getSchedule(line, startDate, endDate, model, times); |
| 326 | 355 | |
| 327 | 356 | String[] date1 = startDate.split("-"); |
| ... | ... | @@ -334,10 +363,8 @@ public class BusIntervalServiceImpl implements BusIntervalService { |
| 334 | 363 | int endTime = Integer.valueOf(split[1].split(":")[0])*60 + Integer.valueOf(split[1].split(":")[1]); |
| 335 | 364 | |
| 336 | 365 | for(ScheduleRealInfo schedule : list){ |
| 337 | - if(zdzName.length() != 0){ | |
| 338 | - if(!zdzName.equals(schedule.getZdzName())){ | |
| 339 | - continue; | |
| 340 | - } | |
| 366 | + if(zdzName.length() != 0 && !zdzName.equals(schedule.getZdzName())){ | |
| 367 | + continue; | |
| 341 | 368 | } |
| 342 | 369 | int fcsj = Integer.valueOf(schedule.getFcsjT() + ""); |
| 343 | 370 | if(!(endTime != 0?(fcsj >= startTime && fcsj < endTime):(fcsj >= startTime))){ |
| ... | ... | @@ -362,7 +389,12 @@ public class BusIntervalServiceImpl implements BusIntervalService { |
| 362 | 389 | double yssd = 0; |
| 363 | 390 | int yyNum = 0; |
| 364 | 391 | int ysNum = 0; |
| 392 | + String company = "", subCompany = ""; | |
| 365 | 393 | for(ScheduleRealInfo schedule : keyMap.get(key)){ |
| 394 | + if(schedule.getGsName() != null && company.length() == 0) | |
| 395 | + company = schedule.getGsName(); | |
| 396 | + if(schedule.getFgsName() != null && subCompany.length() == 0) | |
| 397 | + subCompany = schedule.getFgsName(); | |
| 366 | 398 | if(!tempMap.containsKey("xlDir")) |
| 367 | 399 | tempMap.put("xlDir", schedule.getXlDir()); |
| 368 | 400 | if(!tempMap.containsKey("qdz_zdz") && schedule.getXlDir().equals("0")) |
| ... | ... | @@ -392,6 +424,8 @@ public class BusIntervalServiceImpl implements BusIntervalService { |
| 392 | 424 | tempMap.put("line", keys[0]); |
| 393 | 425 | tempMap.put("lp", keys[1]); |
| 394 | 426 | tempMap.put("zdz", keys[2]); |
| 427 | + tempMap.put("company", company); | |
| 428 | + tempMap.put("subCompany", subCompany); | |
| 395 | 429 | |
| 396 | 430 | tempMap.put("yysj", (yysj/60) + "小时" + (yysj%60) + "分钟"); |
| 397 | 431 | yysjSum += yysj; |
| ... | ... | @@ -458,6 +492,7 @@ public class BusIntervalServiceImpl implements BusIntervalService { |
| 458 | 492 | List<ScheduleRealInfo> list = new ArrayList<ScheduleRealInfo>(); |
| 459 | 493 | Map<String, List<ScheduleRealInfo>> keyMap = new HashMap<String, List<ScheduleRealInfo>>(); |
| 460 | 494 | Map<String, List<Map<String, Object>>> keyMap0 = new HashMap<String, List<Map<String, Object>>>(); |
| 495 | + Map<String, List<Map<String, Object>>> keyMap1 = new HashMap<String, List<Map<String, Object>>>(); | |
| 461 | 496 | |
| 462 | 497 | String line = map.get("line").toString(); |
| 463 | 498 | String startDate = map.get("startDate").toString(); |
| ... | ... | @@ -467,6 +502,16 @@ public class BusIntervalServiceImpl implements BusIntervalService { |
| 467 | 502 | String type = map.get("type").toString(); |
| 468 | 503 | String qdzName = map.get("upDown").toString(); |
| 469 | 504 | |
| 505 | + if(startDate.length() == 0){ | |
| 506 | + startDate = new SimpleDateFormat("yyyy-MM-dd").format(new Date()); | |
| 507 | + } | |
| 508 | + if(endDate.length() == 0){ | |
| 509 | + endDate = new SimpleDateFormat("yyyy-MM-dd").format(new Date()); | |
| 510 | + } | |
| 511 | + if(times.length() == 0){ | |
| 512 | + times = "06:00-07:00"; | |
| 513 | + } | |
| 514 | + | |
| 470 | 515 | list = getSchedule(line, startDate, endDate, model, times); |
| 471 | 516 | |
| 472 | 517 | String[] date1 = startDate.split("-"); |
| ... | ... | @@ -480,14 +525,14 @@ public class BusIntervalServiceImpl implements BusIntervalService { |
| 480 | 525 | |
| 481 | 526 | |
| 482 | 527 | for(ScheduleRealInfo schedule : list){ |
| 483 | - if(!qdzName.equals(schedule.getQdzName())){ | |
| 528 | + if(qdzName.length() != 0 && !qdzName.equals(schedule.getQdzName())){ | |
| 484 | 529 | continue; |
| 485 | 530 | } |
| 486 | 531 | Long fcsj = schedule.getFcsjT(); |
| 487 | 532 | if(!(endTime!=0?fcsj>=startTime&&fcsj<endTime:fcsj>=startTime)){ |
| 488 | 533 | continue; |
| 489 | 534 | } |
| 490 | - String key = schedule.getScheduleDateStr() + "/" + schedule.getXlName() + "/" + schedule.getLpName() + "/" + schedule.getFcsj(); | |
| 535 | + String key = schedule.getScheduleDateStr() + "/" + schedule.getXlName() + "/" + schedule.getLpName() + "/" + schedule.getFcsj() + "/" + schedule.getQdzName(); | |
| 491 | 536 | if(!keyMap.containsKey(key)) |
| 492 | 537 | keyMap.put(key, new ArrayList<ScheduleRealInfo>()); |
| 493 | 538 | keyMap.get(key).add(schedule); |
| ... | ... | @@ -514,7 +559,12 @@ public class BusIntervalServiceImpl implements BusIntervalService { |
| 514 | 559 | long sjtz = 0l; |
| 515 | 560 | long tzsjMax = 0l; |
| 516 | 561 | long tzsjMin = 0l; |
| 562 | + String company = "", subCompany = ""; | |
| 517 | 563 | for(ScheduleRealInfo schedule : keyMap.get(key)){ |
| 564 | + if(schedule.getGsName() != null && company.length() == 0) | |
| 565 | + company = schedule.getGsName(); | |
| 566 | + if(schedule.getFgsName() != null && subCompany.length() == 0) | |
| 567 | + subCompany = schedule.getFgsName(); | |
| 518 | 568 | long tzsj = 0l; |
| 519 | 569 | long yssj = 0l; |
| 520 | 570 | jhbc++; |
| ... | ... | @@ -566,8 +616,10 @@ public class BusIntervalServiceImpl implements BusIntervalService { |
| 566 | 616 | tempMap.put("lp", keys[2]); |
| 567 | 617 | tempMap.put("jhdf", keys[3]); |
| 568 | 618 | tempMap.put("jhfc", keys[3]); |
| 569 | - tempMap.put("station", qdzName); | |
| 619 | + tempMap.put("station", keys[4]); | |
| 570 | 620 | tempMap.put("times", times); |
| 621 | + tempMap.put("company", company); | |
| 622 | + tempMap.put("subCompany", subCompany); | |
| 571 | 623 | if(startDate.equals(endDate)) |
| 572 | 624 | tempMap.put("dates", startDate); |
| 573 | 625 | else |
| ... | ... | @@ -640,7 +692,10 @@ public class BusIntervalServiceImpl implements BusIntervalService { |
| 640 | 692 | int wdfc2 = 0; |
| 641 | 693 | int ys = 0; |
| 642 | 694 | int tz = 0; |
| 695 | + String company = ""; | |
| 643 | 696 | for(Map<String, Object> m : keyMap0.get(key)){ |
| 697 | + if(m.containsKey("company") && company.length() == 0) | |
| 698 | + company = m.get("company").toString(); | |
| 644 | 699 | jhbc += Integer.valueOf(m.get("jhbc").toString()); |
| 645 | 700 | sjbc += Integer.valueOf(m.get("sjbc").toString()); |
| 646 | 701 | wddf1 += Integer.valueOf(m.get("wddf1").toString().substring(0, m.get("wddf1").toString().length() - 1)); |
| ... | ... | @@ -654,6 +709,7 @@ public class BusIntervalServiceImpl implements BusIntervalService { |
| 654 | 709 | tempMap.put("dates", startDate); |
| 655 | 710 | else |
| 656 | 711 | tempMap.put("dates", startDate + "--" + endDate); |
| 712 | + tempMap.put("company", company); | |
| 657 | 713 | String[] keys = key.split("/"); |
| 658 | 714 | tempMap.put("line", keys[0]); |
| 659 | 715 | tempMap.put("lp", keys[1]); |
| ... | ... | @@ -668,20 +724,29 @@ public class BusIntervalServiceImpl implements BusIntervalService { |
| 668 | 724 | tempMap.put("pjys", ys/keyMap0.get(key).size()+"分"); |
| 669 | 725 | tempMap.put("pjtz", tz/keyMap0.get(key).size()+"分"); |
| 670 | 726 | tempMap.put("workList", keyMap0.get(key)); |
| 671 | - resList.add(tempMap); | |
| 727 | + | |
| 728 | + String key1 = tempMap.get("line").toString(); | |
| 729 | + if(!keyMap1.containsKey(key1)) | |
| 730 | + keyMap1.put(key1, new ArrayList<Map<String, Object>>()); | |
| 731 | + keyMap1.get(key1).add(tempMap); | |
| 672 | 732 | } |
| 673 | 733 | |
| 674 | - Collections.sort(resList, new Comparator<Map<String, Object>>() { | |
| 675 | - | |
| 676 | - public int compare(Map<String, Object> o1, Map<String, Object> o2) { | |
| 677 | - | |
| 678 | - Integer a = Integer.valueOf(o1.get("lp").toString()); | |
| 679 | - Integer b = Integer.valueOf(o2.get("lp").toString()); | |
| 734 | + for(String key : keyMap1.keySet()){ | |
| 735 | + Collections.sort(keyMap1.get(key), new Comparator<Map<String, Object>>() { | |
| 736 | + | |
| 737 | + public int compare(Map<String, Object> o1, Map<String, Object> o2) { | |
| 738 | + | |
| 739 | + Integer a = Integer.valueOf(o1.get("lp").toString()); | |
| 740 | + Integer b = Integer.valueOf(o2.get("lp").toString()); | |
| 680 | 741 | |
| 681 | - // 升序 | |
| 682 | - return a.compareTo(b); | |
| 683 | - } | |
| 684 | - }); | |
| 742 | + // 升序 | |
| 743 | + return a.compareTo(b); | |
| 744 | + } | |
| 745 | + }); | |
| 746 | + | |
| 747 | + resList.addAll(keyMap1.get(key)); | |
| 748 | + } | |
| 749 | + | |
| 685 | 750 | |
| 686 | 751 | return resList; |
| 687 | 752 | } |
| ... | ... | @@ -699,6 +764,16 @@ public class BusIntervalServiceImpl implements BusIntervalService { |
| 699 | 764 | String times = map.get("times").toString(); |
| 700 | 765 | String type = map.get("type").toString(); |
| 701 | 766 | |
| 767 | + if(startDate.length() == 0){ | |
| 768 | + startDate = new SimpleDateFormat("yyyy-MM-dd").format(new Date()); | |
| 769 | + } | |
| 770 | + if(endDate.length() == 0){ | |
| 771 | + endDate = new SimpleDateFormat("yyyy-MM-dd").format(new Date()); | |
| 772 | + } | |
| 773 | + if(times.length() == 0){ | |
| 774 | + times = "06:00-07:00"; | |
| 775 | + } | |
| 776 | + | |
| 702 | 777 | list = getSchedule(line, startDate, endDate, model, times); |
| 703 | 778 | |
| 704 | 779 | String[] date1 = startDate.split("-"); |
| ... | ... | @@ -732,7 +807,12 @@ public class BusIntervalServiceImpl implements BusIntervalService { |
| 732 | 807 | qcbc = 0, qclc = 0, kxbc = 0, kxlc = 0, |
| 733 | 808 | qhbc = 0, qhlc = 0, wybc = 0, wylc = 0; |
| 734 | 809 | int qtbc = 0, qtlc = 0; |
| 810 | + String company = "", subCompany = ""; | |
| 735 | 811 | for(ScheduleRealInfo schedule : keyMap.get(key)){ |
| 812 | + if(schedule.getGsName() != null && company.length() == 0) | |
| 813 | + company = schedule.getGsName(); | |
| 814 | + if(schedule.getFgsName() != null && subCompany.length() == 0) | |
| 815 | + subCompany = schedule.getFgsName(); | |
| 736 | 816 | jhbc++; |
| 737 | 817 | if(schedule.getJhlc() != null) |
| 738 | 818 | jhlc += schedule.getJhlc(); |
| ... | ... | @@ -781,6 +861,8 @@ public class BusIntervalServiceImpl implements BusIntervalService { |
| 781 | 861 | tempMap.put("date", startDate); |
| 782 | 862 | else |
| 783 | 863 | tempMap.put("date", startDate + "--" + endDate); |
| 864 | + tempMap.put("company", company); | |
| 865 | + tempMap.put("subCompany", subCompany); | |
| 784 | 866 | tempMap.put("times", times); |
| 785 | 867 | tempMap.put("line", key); |
| 786 | 868 | tempMap.put("jhbc", jhbc); |
| ... | ... | @@ -834,10 +916,13 @@ public class BusIntervalServiceImpl implements BusIntervalService { |
| 834 | 916 | List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>(); |
| 835 | 917 | List<ScheduleRealInfo> list = new ArrayList<ScheduleRealInfo>(); |
| 836 | 918 | Map<String, List<ScheduleRealInfo>> keyMap = new HashMap<String, List<ScheduleRealInfo>>(); |
| 919 | + Map<String, List<Map<String, Object>>> keyMap0 = new HashMap<String, List<Map<String, Object>>>(); | |
| 920 | + Map<String, List<Map<String, Object>>> keyMap1 = new HashMap<String, List<Map<String, Object>>>(); | |
| 837 | 921 | |
| 838 | 922 | String line = map.get("line").toString(); |
| 839 | 923 | String startDate = map.get("startDate").toString(); |
| 840 | 924 | String endDate = map.get("endDate").toString(); |
| 925 | + String times = map.get("times").toString(); | |
| 841 | 926 | String type = map.get("type").toString(); |
| 842 | 927 | |
| 843 | 928 | if(startDate.length() == 0){ |
| ... | ... | @@ -852,10 +937,10 @@ public class BusIntervalServiceImpl implements BusIntervalService { |
| 852 | 937 | if(line.length() != 0){ |
| 853 | 938 | sql += " and xl_bm = '"+line+"'"; |
| 854 | 939 | } |
| 855 | -// if(times.length() != 0){ | |
| 856 | -// String[] split = times.split("-"); | |
| 857 | -// sql += " and fcsj >= '"+split[0]+"' and fcsj <= '"+split[1]+"'"; | |
| 858 | -// } | |
| 940 | + if(times.length() != 0){ | |
| 941 | + String[] split = times.split("-"); | |
| 942 | + sql += " and fcsj >= '"+split[0]+"' and fcsj <= '"+split[1]+"'"; | |
| 943 | + } | |
| 859 | 944 | sql += " and bc_type = 'normal'"; |
| 860 | 945 | |
| 861 | 946 | list =jdbcTemplate.query(sql, |
| ... | ... | @@ -884,6 +969,11 @@ public class BusIntervalServiceImpl implements BusIntervalService { |
| 884 | 969 | schedule.setFgsName(rs.getString("fgs_name")); |
| 885 | 970 | schedule.setDfAuto(rs.getBoolean("df_auto")); |
| 886 | 971 | schedule.setOnline(rs.getBoolean("online")); |
| 972 | + schedule.setClZbh(rs.getString("cl_zbh")); | |
| 973 | + schedule.setjGh(rs.getString("j_gh")); | |
| 974 | + schedule.setjName(rs.getString("j_name")); | |
| 975 | + schedule.setUpdateDate(rs.getDate("update_date")); | |
| 976 | + | |
| 887 | 977 | return schedule; |
| 888 | 978 | } |
| 889 | 979 | }); |
| ... | ... | @@ -896,6 +986,11 @@ public class BusIntervalServiceImpl implements BusIntervalService { |
| 896 | 986 | String[] date2 = endDate.split("-"); |
| 897 | 987 | startDate = date1[0] + "年" + date1[1] + "月" + date1[2] + "日"; |
| 898 | 988 | endDate = date2[0] + "年" + date2[1] + "月" + date2[2] + "日"; |
| 989 | + String date = ""; | |
| 990 | + if(startDate.equals(endDate)) | |
| 991 | + date = startDate; | |
| 992 | + else | |
| 993 | + date = startDate + "--" + endDate; | |
| 899 | 994 | |
| 900 | 995 | for(ScheduleRealInfo schedule : list){ |
| 901 | 996 | String key = schedule.getGsName() + "/" + schedule.getFgsName() + "/" + schedule.getXlName(); |
| ... | ... | @@ -914,16 +1009,16 @@ public class BusIntervalServiceImpl implements BusIntervalService { |
| 914 | 1009 | sjbc++; |
| 915 | 1010 | if(schedule.getDfsj() != null && !schedule.getDfsj().equals(schedule.getFcsj())){ |
| 916 | 1011 | flag = true; |
| 1012 | + schedule.setRemarks("待发调整"); | |
| 917 | 1013 | if(schedule.isDfAuto()) |
| 918 | 1014 | zddf++; |
| 919 | 1015 | else |
| 920 | 1016 | sddf++; |
| 921 | - } | |
| 922 | - if(!schedule.isOnline()){ | |
| 1017 | + }else if(!schedule.isOnline()){ | |
| 923 | 1018 | flag = true; |
| 1019 | + schedule.setRemarks("掉线调整"); | |
| 924 | 1020 | dxtz++; |
| 925 | - } | |
| 926 | - if(schedule.getStatus() == 2){ | |
| 1021 | + }else if(schedule.getStatus() == 2){ | |
| 927 | 1022 | flag = true; |
| 928 | 1023 | lbtz++; |
| 929 | 1024 | } |
| ... | ... | @@ -931,10 +1026,7 @@ public class BusIntervalServiceImpl implements BusIntervalService { |
| 931 | 1026 | tempList.add(schedule); |
| 932 | 1027 | } |
| 933 | 1028 | } |
| 934 | - if(startDate.equals(endDate)) | |
| 935 | - tempMap.put("date", startDate); | |
| 936 | - else | |
| 937 | - tempMap.put("date", startDate + "--" + endDate); | |
| 1029 | + tempMap.put("date", date); | |
| 938 | 1030 | String[] keys = key.split("/"); |
| 939 | 1031 | tempMap.put("company", keys[0]); |
| 940 | 1032 | tempMap.put("subCompany", keys[1]); |
| ... | ... | @@ -946,11 +1038,142 @@ public class BusIntervalServiceImpl implements BusIntervalService { |
| 946 | 1038 | tempMap.put("dxtz", dxtz); |
| 947 | 1039 | tempMap.put("lbtz", lbtz); |
| 948 | 1040 | tempMap.put("correct", sddf + zddf + dxtz + lbtz); |
| 949 | - tempMap.put("dfbl", df.format((double)(sddf + zddf)/sjbc) + "%"); | |
| 950 | - tempMap.put("dxbl", df.format((double)(dxtz)/sjbc) + "%"); | |
| 951 | - tempMap.put("lbbl", df.format((double)(lbtz)/sjbc) + "%"); | |
| 952 | - tempMap.put("lbbl", df.format((double)(sddf + zddf + dxtz + lbtz)/sjbc) + "%"); | |
| 1041 | + tempMap.put("dfbl", df.format((double)(sddf + zddf)/sjbc*100) + "%"); | |
| 1042 | + tempMap.put("dxbl", df.format((double)(dxtz)/sjbc*100) + "%"); | |
| 1043 | + tempMap.put("lbbl", df.format((double)(lbtz)/sjbc*100) + "%"); | |
| 1044 | + tempMap.put("correctbl", df.format((double)(sddf + zddf + dxtz + lbtz)/sjbc*100) + "%"); | |
| 1045 | + tempMap.put("workList", tempList); | |
| 1046 | + | |
| 1047 | + String key0 = keys[0] + "/" + keys[1]; | |
| 1048 | + if(!keyMap0.containsKey(key0)) | |
| 1049 | + keyMap0.put(key0, new ArrayList<Map<String, Object>>()); | |
| 1050 | + keyMap0.get(key0).add(tempMap); | |
| 1051 | + } | |
| 1052 | + | |
| 1053 | + for(String key : keyMap0.keySet()){ | |
| 1054 | + Map<String, Object> tempMap = new HashMap<String, Object>(); | |
| 1055 | + int sjbc = 0, sddf = 0, zddf = 0, | |
| 1056 | + dxtz = 0, lbtz = 0; | |
| 1057 | + for(Map<String, Object> m : keyMap0.get(key)){ | |
| 1058 | + sjbc += (int)m.get("sjbc"); | |
| 1059 | + sddf += (int)m.get("sddf"); | |
| 1060 | + zddf += (int)m.get("zddf"); | |
| 1061 | + dxtz += (int)m.get("dxtz"); | |
| 1062 | + lbtz += (int)m.get("lbtz"); | |
| 1063 | + } | |
| 1064 | + tempMap.put("date", date); | |
| 1065 | + String[] keys = key.split("/"); | |
| 1066 | + tempMap.put("company", keys[0]); | |
| 1067 | + tempMap.put("subCompany", keys[1]); | |
| 1068 | + tempMap.put("lines", keyMap0.get(key).size()); | |
| 1069 | + tempMap.put("sjbc", sjbc); | |
| 1070 | + tempMap.put("sddf", sddf); | |
| 1071 | + tempMap.put("zddf", zddf); | |
| 1072 | + tempMap.put("dfhj", sddf + zddf); | |
| 1073 | + tempMap.put("dxtz", dxtz); | |
| 1074 | + tempMap.put("lbtz", lbtz); | |
| 1075 | + tempMap.put("correct", sddf + zddf + dxtz + lbtz); | |
| 1076 | + tempMap.put("dfbl", df.format((double)(sddf + zddf)/sjbc*100) + "%"); | |
| 1077 | + tempMap.put("dxbl", df.format((double)(dxtz)/sjbc*100) + "%"); | |
| 1078 | + tempMap.put("lbbl", df.format((double)(lbtz)/sjbc*100) + "%"); | |
| 1079 | + tempMap.put("correctbl", df.format((double)(sddf + zddf + dxtz + lbtz)/sjbc*100) + "%"); | |
| 1080 | + tempMap.put("workList", keyMap0.get(key)); | |
| 1081 | + | |
| 1082 | + String key1 = keys[0]; | |
| 1083 | + if(!keyMap1.containsKey(key1)) | |
| 1084 | + keyMap1.put(key1, new ArrayList<Map<String, Object>>()); | |
| 1085 | + keyMap1.get(key1).add(tempMap); | |
| 1086 | + } | |
| 1087 | + | |
| 1088 | + for(String key : keyMap1.keySet()){ | |
| 1089 | + Map<String, Object> tempMap = new HashMap<String, Object>(); | |
| 1090 | + int sjbc = 0, sddf = 0, zddf = 0, | |
| 1091 | + dxtz = 0, lbtz = 0, lines = 0; | |
| 1092 | + for(Map<String, Object> m : keyMap1.get(key)){ | |
| 1093 | + sjbc += (int)m.get("sjbc"); | |
| 1094 | + sddf += (int)m.get("sddf"); | |
| 1095 | + zddf += (int)m.get("zddf"); | |
| 1096 | + dxtz += (int)m.get("dxtz"); | |
| 1097 | + lbtz += (int)m.get("lbtz"); | |
| 1098 | + lines += (int)m.get("lines"); | |
| 1099 | + } | |
| 1100 | + tempMap.put("date", date); | |
| 1101 | + tempMap.put("company", key); | |
| 1102 | + tempMap.put("lines", lines); | |
| 1103 | + tempMap.put("sjbc", sjbc); | |
| 1104 | + tempMap.put("sddf", sddf); | |
| 1105 | + tempMap.put("zddf", zddf); | |
| 1106 | + tempMap.put("dfhj", sddf + zddf); | |
| 1107 | + tempMap.put("dxtz", dxtz); | |
| 1108 | + tempMap.put("lbtz", lbtz); | |
| 1109 | + tempMap.put("correct", sddf + zddf + dxtz + lbtz); | |
| 1110 | + tempMap.put("dfbl", df.format((double)(sddf + zddf)/sjbc*100) + "%"); | |
| 1111 | + tempMap.put("dxbl", df.format((double)(dxtz)/sjbc*100) + "%"); | |
| 1112 | + tempMap.put("lbbl", df.format((double)(lbtz)/sjbc*100) + "%"); | |
| 1113 | + tempMap.put("correctbl", df.format((double)(sddf + zddf + dxtz + lbtz)/sjbc*100) + "%"); | |
| 1114 | + tempMap.put("workList", keyMap1.get(key)); | |
| 953 | 1115 | |
| 1116 | + resList.add(tempMap); | |
| 1117 | + } | |
| 1118 | + | |
| 1119 | + if(resList.size() != 0){ | |
| 1120 | + Map<String, Object> tempMap = new HashMap<String, Object>(); | |
| 1121 | + int sjbc = 0, sddf = 0, zddf = 0, | |
| 1122 | + dxtz = 0, lbtz = 0, lines = 0; | |
| 1123 | + for(Map<String, Object> m : resList){ | |
| 1124 | + sjbc += (int)m.get("sjbc"); | |
| 1125 | + sddf += (int)m.get("sddf"); | |
| 1126 | + zddf += (int)m.get("zddf"); | |
| 1127 | + dxtz += (int)m.get("dxtz"); | |
| 1128 | + lbtz += (int)m.get("lbtz"); | |
| 1129 | + lines += (int)m.get("lines"); | |
| 1130 | + for(Map<String, Object> m0 : (List<Map<String, Object>>)m.get("workList")){ | |
| 1131 | + Map<String, Object> temp = new HashMap<String, Object>(); | |
| 1132 | + temp.put("date", "合计"); | |
| 1133 | + temp.put("lines", m0.get("lines")); | |
| 1134 | + temp.put("sjbc", m0.get("sjbc")); | |
| 1135 | + temp.put("sddf", m0.get("sddf")); | |
| 1136 | + temp.put("zddf", m0.get("zddf")); | |
| 1137 | + temp.put("dfhj", m0.get("dfhj")); | |
| 1138 | + temp.put("dxtz", m0.get("dxtz")); | |
| 1139 | + temp.put("lbtz", m0.get("lbtz")); | |
| 1140 | + temp.put("correct", m0.get("correct")); | |
| 1141 | + temp.put("dfbl", m0.get("dfbl")); | |
| 1142 | + temp.put("dxbl", m0.get("dxbl")); | |
| 1143 | + temp.put("lbbl", m0.get("lbbl")); | |
| 1144 | + temp.put("correctbl", m0.get("correctbl")); | |
| 1145 | + ((List<Map<String, Object>>)m0.get("workList")).add(temp); | |
| 1146 | + } | |
| 1147 | + Map<String, Object> temp = new HashMap<String, Object>(); | |
| 1148 | + temp.put("date", "合计"); | |
| 1149 | + temp.put("lines", m.get("lines")); | |
| 1150 | + temp.put("sjbc", m.get("sjbc")); | |
| 1151 | + temp.put("sddf", m.get("sddf")); | |
| 1152 | + temp.put("zddf", m.get("zddf")); | |
| 1153 | + temp.put("dfhj", m.get("dfhj")); | |
| 1154 | + temp.put("dxtz", m.get("dxtz")); | |
| 1155 | + temp.put("lbtz", m.get("lbtz")); | |
| 1156 | + temp.put("correct", m.get("correct")); | |
| 1157 | + temp.put("dfbl", m.get("dfbl")); | |
| 1158 | + temp.put("dxbl", m.get("dxbl")); | |
| 1159 | + temp.put("lbbl", m.get("lbbl")); | |
| 1160 | + temp.put("correctbl", m.get("correctbl")); | |
| 1161 | + ((List<Map<String, Object>>)m.get("workList")).add(temp); | |
| 1162 | + } | |
| 1163 | + tempMap.put("date", "合计"); | |
| 1164 | + tempMap.put("lines", lines); | |
| 1165 | + tempMap.put("sjbc", sjbc); | |
| 1166 | + tempMap.put("sddf", sddf); | |
| 1167 | + tempMap.put("zddf", zddf); | |
| 1168 | + tempMap.put("dfhj", sddf + zddf); | |
| 1169 | + tempMap.put("dxtz", dxtz); | |
| 1170 | + tempMap.put("lbtz", lbtz); | |
| 1171 | + tempMap.put("correct", sddf + zddf + dxtz + lbtz); | |
| 1172 | + tempMap.put("dfbl", df.format((double)(sddf + zddf)/sjbc*100) + "%"); | |
| 1173 | + tempMap.put("dxbl", df.format((double)(dxtz)/sjbc*100) + "%"); | |
| 1174 | + tempMap.put("lbbl", df.format((double)(lbtz)/sjbc*100) + "%"); | |
| 1175 | + tempMap.put("correctbl", df.format((double)(sddf + zddf + dxtz + lbtz)/sjbc*100) + "%"); | |
| 1176 | + resList.add(tempMap); | |
| 954 | 1177 | } |
| 955 | 1178 | |
| 956 | 1179 | return resList; | ... | ... |
src/main/resources/static/pages/forms/statement/busInterval.html
| ... | ... | @@ -13,6 +13,9 @@ |
| 13 | 13 | border-bottom-width: 2px; } |
| 14 | 14 | .table > tbody + tbody { |
| 15 | 15 | border-top: 1px solid; } |
| 16 | + #forms > tbody > tr{ | |
| 17 | + background-color: #FFFFFF; | |
| 18 | + } | |
| 16 | 19 | </style> |
| 17 | 20 | |
| 18 | 21 | <div class="page-head"> |
| ... | ... | @@ -27,49 +30,41 @@ |
| 27 | 30 | <div class="portlet-title"> |
| 28 | 31 | <form id="history" class="form-inline" action=""> |
| 29 | 32 | <div style="display: inline-block;"> |
| 30 | - <span class="item-label" style="width: 80px;">线路: </span> | |
| 33 | + <span class="item-label" style="width: 80px; margin-left: 33px">公司: </span> | |
| 34 | + <select class="form-control" name="company" id="company" style="width: 180px;"></select> | |
| 35 | + </div> | |
| 36 | + <div style="display: inline-block;"> | |
| 37 | + <span class="item-label" style="width: 80px; margin-left: 24px">分公司: </span> | |
| 38 | + <select class="form-control" name="subCompany" id="subCompany" style="width: 180px;"></select> | |
| 39 | + </div> | |
| 40 | + <div style="display: inline-block;"> | |
| 41 | + <span class="item-label" style="width: 80px; margin-left: 24px">线路: </span> | |
| 31 | 42 | <select class="form-control" name="line" id="line" style="width: 180px;"></select> |
| 32 | 43 | </div> |
| 33 | - <div style="display: inline-block;margin-left: 15px;"> | |
| 44 | + <div style="display: inline-block; margin-left: 10px"> | |
| 45 | + <span class="item-label" style="width: 80px;">时刻类型: </span> | |
| 46 | + <select class="form-control" name="model" id="model" style="width: 180px;"> | |
| 47 | + <option value="">请选择...</option> | |
| 48 | + </select> | |
| 49 | + </div> | |
| 50 | + <div style="margin-top: 10px"></div> | |
| 51 | + <div style="display: inline-block;margin-left: 5px;"> | |
| 34 | 52 | <span class="item-label" style="width: 80px;">开始时间: </span> |
| 35 | 53 | <input class="form-control" type="text" id="startDate" style="width: 180px;"/> |
| 36 | 54 | </div> |
| 37 | - <div style="display: inline-block;margin-left: 15px;"> | |
| 55 | + <div style="display: inline-block;margin-left: 10px;"> | |
| 38 | 56 | <span class="item-label" style="width: 80px;">结束时间: </span> |
| 39 | 57 | <input class="form-control" type="text" id="endDate" style="width: 180px;"/> |
| 40 | 58 | </div> |
| 41 | - <br/> | |
| 42 | - <div style="display: inline-block;"> | |
| 43 | - <span class="item-label" style="width: 80px;">时刻类型: </span> | |
| 44 | - <select class="form-control" name="model" id="model" style="width: 180px;"> | |
| 45 | - <option value="">请选择...</option> | |
| 46 | - </select> | |
| 59 | + <div style="display: inline-block;margin-left: 10px;"> | |
| 60 | + <span class="item-label" style="width: 80px;">时间段: </span> | |
| 61 | + <input class="form-control" type="text" id="times1" style="width: 80px;"/> | |
| 47 | 62 | </div> |
| 48 | 63 | <div style="display: inline-block;"> |
| 49 | - <span class="item-label" style="width: 80px;">时间段: </span> | |
| 50 | - <select class="form-control" name="model" id="times" style="width: 180px;"> | |
| 51 | - <option value="05:00-06:00">05:00-06:00</option> | |
| 52 | - <option value="06:00-07:00">06:00-07:00</option> | |
| 53 | - <option value="07:00-08:00">07:00-08:00</option> | |
| 54 | - <option value="08:00-09:00">08:00-09:00</option> | |
| 55 | - <option value="09:00-10:00">09:00-10:00</option> | |
| 56 | - <option value="10:00-11:00">10:00-11:00</option> | |
| 57 | - <option value="11:00-12:00">11:00-12:00</option> | |
| 58 | - <option value="12:00-13:00">12:00-13:00</option> | |
| 59 | - <option value="13:00-14:00">13:00-14:00</option> | |
| 60 | - <option value="14:00-15:00">14:00-15:00</option> | |
| 61 | - <option value="15:00-16:00">15:00-16:00</option> | |
| 62 | - <option value="16:00-17:00">16:00-17:00</option> | |
| 63 | - <option value="17:00-18:00">17:00-18:00</option> | |
| 64 | - <option value="18:00-19:00">18:00-19:00</option> | |
| 65 | - <option value="19:00-20:00">19:00-20:00</option> | |
| 66 | - <option value="20:00-21:00">20:00-21:00</option> | |
| 67 | - <option value="21:00-22:00">21:00-22:00</option> | |
| 68 | - <option value="22:00-23:00">22:00-23:00</option> | |
| 69 | - <option value="23:00-00:00">23:00-00:00</option> | |
| 70 | - </select> | |
| 64 | + <span class="item-label" style="width: 80px;"> - </span> | |
| 65 | + <input class="form-control" type="text" id="times2" style="width: 80px;"/> | |
| 71 | 66 | </div> |
| 72 | - <div class="form-group"> | |
| 67 | + <div class="form-group" style="margin-left: 10px"> | |
| 73 | 68 | <input class="btn btn-default" type="button" id="query" value="筛选"/> |
| 74 | 69 | <!-- <input class="btn btn-default" type="button" id="export" value="导出"/> --> |
| 75 | 70 | </div> |
| ... | ... | @@ -80,15 +75,15 @@ |
| 80 | 75 | <table class="table table-bordered table-hover table-checkable" id="forms"> |
| 81 | 76 | <thead> |
| 82 | 77 | <tr class="hidden"> |
| 83 | - <th width="130px">日期</th> | |
| 84 | - <th width="120px">时段</th> | |
| 78 | + <th>日期</th> | |
| 79 | + <th>时段</th> | |
| 85 | 80 | <th>公司</th> |
| 86 | 81 | <th>分公司</th> |
| 87 | - <th width="120px">线路</th> | |
| 88 | - <th width="140px">起讫站</th> | |
| 89 | - <th width="140px">计划车距(分钟)</th> | |
| 90 | - <th width="140px">实际车距(分钟)</th> | |
| 91 | - <th width="100px">误差值</th> | |
| 82 | + <th>线路</th> | |
| 83 | + <th>起讫站</th> | |
| 84 | + <th>计划车距(分钟)</th> | |
| 85 | + <th>实际车距(分钟)</th> | |
| 86 | + <th>误差值</th> | |
| 92 | 87 | </tr> |
| 93 | 88 | </thead> |
| 94 | 89 | <tbody> |
| ... | ... | @@ -119,6 +114,15 @@ |
| 119 | 114 | format : 'YYYY-MM-DD', |
| 120 | 115 | locale : 'zh-cn' |
| 121 | 116 | }); |
| 117 | + | |
| 118 | + $("#times1").datetimepicker({ | |
| 119 | + format : 'HH:mm', | |
| 120 | + locale : 'zh-cn' | |
| 121 | + }); | |
| 122 | + $("#times2").datetimepicker({ | |
| 123 | + format : 'HH:mm', | |
| 124 | + locale : 'zh-cn' | |
| 125 | + }); | |
| 122 | 126 | |
| 123 | 127 | var d = new Date(); |
| 124 | 128 | var year = d.getFullYear(); |
| ... | ... | @@ -131,17 +135,44 @@ |
| 131 | 135 | $("#startDate").val(year + "-0" + month + "-" + day); |
| 132 | 136 | $("#endDate").val(year + "-0" + month + "-" + day); |
| 133 | 137 | } |
| 138 | + $("#times1").val("06:00"); | |
| 139 | + $("#times2").val("07:00"); | |
| 140 | + | |
| 141 | + var obj = []; | |
| 142 | + $.get('/user/companyData', function(result){ | |
| 143 | + obj = result; | |
| 144 | + var options = ''; | |
| 145 | + for(var i = 0; i < obj.length; i++){ | |
| 146 | + options += '<option value="'+obj[i].companyCode+'">'+obj[i].companyName+'</option>'; | |
| 147 | + } | |
| 148 | + $('#company').html(options); | |
| 149 | + updateCompany(); | |
| 150 | + }); | |
| 151 | + $("#company").on("change",updateCompany); | |
| 152 | + function updateCompany(){ | |
| 153 | + var company = $('#company').val(); | |
| 154 | + var options = ''; | |
| 155 | + for(var i = 0; i < obj.length; i++){ | |
| 156 | + if(obj[i].companyCode == company){ | |
| 157 | + var children = obj[i].children; | |
| 158 | + for(var j = 0; j < children.length; j++){ | |
| 159 | + options += '<option value="'+children[j].code+'">'+children[j].name+'</option>'; | |
| 160 | + } | |
| 161 | + } | |
| 162 | + } | |
| 163 | + $('#subCompany').html(options); | |
| 164 | + } | |
| 134 | 165 | |
| 135 | 166 | $.get('/basic/lineCode2Name',function(result){ |
| 136 | 167 | var data=[]; |
| 137 | - | |
| 168 | + data.push({id:" ", text:"全部线路"}); | |
| 138 | 169 | for(var code in result){ |
| 139 | 170 | data.push({id: code, text: result[code]}); |
| 140 | 171 | } |
| 141 | 172 | console.log(data); |
| 142 | 173 | initPinYinSelect2('#line',data,''); |
| 143 | 174 | |
| 144 | - line = data[0].id; | |
| 175 | + line = ""; | |
| 145 | 176 | updateModel(); |
| 146 | 177 | }) |
| 147 | 178 | |
| ... | ... | @@ -190,14 +221,14 @@ |
| 190 | 221 | var startDate = $("#startDate").val(); |
| 191 | 222 | var endDate = $("#endDate").val(); |
| 192 | 223 | var model = $("#model").val(); |
| 193 | - var times = $("#times").val(); | |
| 224 | + var times = $("#times1").val() + "-" + $("#times2").val(); | |
| 194 | 225 | function jsDoQuery(pagination){ |
| 195 | 226 | var params = {}; |
| 196 | - line = $("#line").val(); | |
| 227 | +// line = $("#line").val(); | |
| 197 | 228 | startDate = $("#startDate").val(); |
| 198 | 229 | endDate = $("#endDate").val(); |
| 199 | 230 | model = $("#model").val(); |
| 200 | - times = $("#times").val(); | |
| 231 | + times = $("#times1").val() + "-" + $("#times2").val(); | |
| 201 | 232 | params['line'] = line; |
| 202 | 233 | params['startDate'] = startDate; |
| 203 | 234 | params['endDate'] = endDate; |
| ... | ... | @@ -210,19 +241,26 @@ |
| 210 | 241 | var tbodyHtml = template('list_workDaily',{list:result}); |
| 211 | 242 | // 把渲染好的模版html文本追加到表格中 |
| 212 | 243 | $('#forms tbody').html(tbodyHtml); |
| 244 | + _w_table_rowspan("#forms tbody", 1); | |
| 245 | + _w_table_rowspan("#forms tbody", 2); | |
| 246 | + _w_table_rowspan("#forms tbody", 3); | |
| 247 | + _w_table_rowspan("#forms tbody", 4); | |
| 248 | + _w_table_rowspan("#forms tbody", 5); | |
| 213 | 249 | |
| 214 | 250 | }); |
| 215 | 251 | } |
| 216 | 252 | |
| 217 | - $("#export").on("click",function(){ | |
| 218 | - $get('/pcpc/workDaily',{line:line,date:date,type:'export'},function(result){ | |
| 219 | - window.open("/downloadFile/download?fileName=营运服务日报表"+moment(date).format("YYYYMMDD")); | |
| 220 | - }); | |
| 221 | - }); | |
| 253 | +// $("#export").on("click",function(){ | |
| 254 | +// $get('/pcpc/workDaily',{line:line,date:date,type:'export'},function(result){ | |
| 255 | +// window.open("/downloadFile/download?fileName=营运服务日报表"+moment(date).format("YYYYMMDD")); | |
| 256 | +// }); | |
| 257 | +// }); | |
| 222 | 258 | |
| 223 | 259 | |
| 224 | 260 | $("#line").on("change", function(){ |
| 225 | 261 | line = $("#line").val(); |
| 262 | + if(line == " ") | |
| 263 | + line = ""; | |
| 226 | 264 | updateModel(); |
| 227 | 265 | }); |
| 228 | 266 | $('#startDate').on("blur", function(){ |
| ... | ... | @@ -258,6 +296,30 @@ |
| 258 | 296 | } |
| 259 | 297 | |
| 260 | 298 | |
| 299 | + function _w_table_rowspan(_w_table_id, _w_table_colnum){ | |
| 300 | + _w_table_firsttd = ""; | |
| 301 | + _w_table_currenttd = ""; | |
| 302 | + _w_table_SpanNum = 0; | |
| 303 | + _w_table_Obj = jQuery(_w_table_id + " tr td:nth-child(" + _w_table_colnum + ")"); | |
| 304 | + _w_table_Obj.each(function(i){ | |
| 305 | + if(i==0){ | |
| 306 | + _w_table_firsttd = jQuery(this); | |
| 307 | + _w_table_SpanNum = 1; | |
| 308 | + }else{ | |
| 309 | + _w_table_currenttd = jQuery(this); | |
| 310 | + if(_w_table_firsttd.text()==_w_table_currenttd.text()){ | |
| 311 | + _w_table_SpanNum++; | |
| 312 | + _w_table_currenttd.hide(); //remove(); | |
| 313 | + _w_table_firsttd.attr("rowSpan",_w_table_SpanNum); | |
| 314 | + }else{ | |
| 315 | + _w_table_firsttd = jQuery(this); | |
| 316 | + _w_table_SpanNum = 1; | |
| 317 | + } | |
| 318 | + } | |
| 319 | + }); | |
| 320 | + } | |
| 321 | + | |
| 322 | + | |
| 261 | 323 | }); |
| 262 | 324 | |
| 263 | 325 | </script> |
| ... | ... | @@ -267,7 +329,7 @@ |
| 267 | 329 | <td>{{obj.date}}</td> |
| 268 | 330 | <td>{{obj.times}}</td> |
| 269 | 331 | <td>{{obj.company}}</td> |
| 270 | - <td>{{obj.branchCompany}}</td> | |
| 332 | + <td>{{obj.subCompany}}</td> | |
| 271 | 333 | <td>{{obj.line}}</td> |
| 272 | 334 | <td>{{obj.qdz}}</td> |
| 273 | 335 | <td>{{obj.jhInterval}}</td> | ... | ... |
src/main/resources/static/pages/forms/statement/correctStatis.html
0 → 100644
| 1 | +<style type="text/css"> | |
| 2 | + .table-bordered { | |
| 3 | + border: 1px solid; } | |
| 4 | + .table-bordered > thead > tr > th, | |
| 5 | + .table-bordered > thead > tr > td, | |
| 6 | + .table-bordered > tbody > tr > th, | |
| 7 | + .table-bordered > tbody > tr > td, | |
| 8 | + .table-bordered > tfoot > tr > th, | |
| 9 | + .table-bordered > tfoot > tr > td { | |
| 10 | + border: 1px solid; } | |
| 11 | + .table-bordered > thead > tr > th, | |
| 12 | + .table-bordered > thead > tr > td { | |
| 13 | + border-bottom-width: 2px; } | |
| 14 | + .table > tbody + tbody { | |
| 15 | + border-top: 1px solid; } | |
| 16 | +</style> | |
| 17 | + | |
| 18 | +<div class="page-head"> | |
| 19 | + <div class="page-title"> | |
| 20 | + <h1>集群调度修正率统计表</h1> | |
| 21 | + </div> | |
| 22 | +</div> | |
| 23 | + | |
| 24 | +<div class="row"> | |
| 25 | + <div class="col-md-12"> | |
| 26 | + <div class="portlet light porttlet-fit bordered"> | |
| 27 | + <div class="portlet-title"> | |
| 28 | + <form id="history" class="form-inline" action=""> | |
| 29 | + <div style="display: inline-block;"> | |
| 30 | + <span class="item-label" style="width: 80px; margin-left: 33px">公司: </span> | |
| 31 | + <select class="form-control" name="company" id="company" style="width: 140px;"></select> | |
| 32 | + </div> | |
| 33 | + <div style="display: inline-block;"> | |
| 34 | + <span class="item-label" style="width: 80px; margin-left: 24px">分公司: </span> | |
| 35 | + <select class="form-control" name="subCompany" id="subCompany" style="width: 140px;"></select> | |
| 36 | + </div> | |
| 37 | + <div style="display: inline-block;"> | |
| 38 | + <span class="item-label" style="width: 80px; margin-left: 24px">线路: </span> | |
| 39 | + <select class="form-control" name="line" id="line" style="width: 140px;"></select> | |
| 40 | + </div> | |
| 41 | + <div style="margin-top: 10px"></div> | |
| 42 | + <div style="display: inline-block;margin-left: 5px;"> | |
| 43 | + <span class="item-label" style="width: 80px;">开始时间: </span> | |
| 44 | + <input class="form-control" type="text" id="startDate" style="width: 140px;"/> | |
| 45 | + </div> | |
| 46 | + <div style="display: inline-block;margin-left: 10px;"> | |
| 47 | + <span class="item-label" style="width: 80px;">结束时间: </span> | |
| 48 | + <input class="form-control" type="text" id="endDate" style="width: 140px;"/> | |
| 49 | + </div> | |
| 50 | + <div style="display: inline-block;margin-left: 10px;"> | |
| 51 | + <span class="item-label" style="width: 80px;">时间段: </span> | |
| 52 | + <input class="form-control" type="text" id="times1" style="width: 60px;"/> | |
| 53 | + </div> | |
| 54 | + <div style="display: inline-block;"> | |
| 55 | + <span class="item-label" style="width: 80px;"> - </span> | |
| 56 | + <input class="form-control" type="text" id="times2" style="width: 60px;"/> | |
| 57 | + </div> | |
| 58 | + <div class="form-group"> | |
| 59 | + <input class="btn btn-default" type="button" id="query" value="筛选"/> | |
| 60 | +<!-- <input class="btn btn-default" type="button" id="export" value="导出"/> --> | |
| 61 | + </div> | |
| 62 | + </form> | |
| 63 | + </div> | |
| 64 | + <div class="portlet-body"> | |
| 65 | + <div class="table-container" style="margin-top: 10px;overflow:auto;min-width: 906px"> | |
| 66 | + <table class="table table-bordered table-hover table-checkable" id="forms"> | |
| 67 | + </table> | |
| 68 | + <div style="text-align: right;"> | |
| 69 | + <ul id="pagination" class="pagination"></ul> | |
| 70 | + </div> | |
| 71 | + </div> | |
| 72 | + | |
| 73 | + <div class="table-container" style="margin-top: 10px;overflow:auto;min-width: 906px"> | |
| 74 | + <table class="table table-bordered table-hover table-checkable" id="subinfo"> | |
| 75 | + </table> | |
| 76 | + <div style="text-align: right;"> | |
| 77 | + <ul id="pagination" class="pagination"></ul> | |
| 78 | + </div> | |
| 79 | + </div> | |
| 80 | + | |
| 81 | + <div class="table-container" style="margin-top: 10px;overflow:auto;min-width: 906px"> | |
| 82 | + <table class="table table-bordered table-hover table-checkable" id="lineinfo"> | |
| 83 | + </table> | |
| 84 | + <div style="text-align: right;"> | |
| 85 | + <ul id="pagination" class="pagination"></ul> | |
| 86 | + </div> | |
| 87 | + </div> | |
| 88 | + | |
| 89 | + <div class="table-container" style="margin-top: 10px;overflow:auto;min-width: 906px"> | |
| 90 | + <table class="table table-bordered table-hover table-checkable" id="lines"> | |
| 91 | + </table> | |
| 92 | + <div style="text-align: right;"> | |
| 93 | + <ul id="pagination" class="pagination"></ul> | |
| 94 | + </div> | |
| 95 | + </div> | |
| 96 | + </div> | |
| 97 | + </div> | |
| 98 | + </div> | |
| 99 | +</div> | |
| 100 | + | |
| 101 | +<script> | |
| 102 | + $(function(){ | |
| 103 | + | |
| 104 | + | |
| 105 | + // 关闭左侧栏 | |
| 106 | + if (!$('body').hasClass('page-sidebar-closed')) | |
| 107 | + $('.menu-toggler.sidebar-toggler').click(); | |
| 108 | + | |
| 109 | + $("#startDate").datetimepicker({ | |
| 110 | + format : 'YYYY-MM-DD', | |
| 111 | + locale : 'zh-cn' | |
| 112 | + }); | |
| 113 | + $("#endDate").datetimepicker({ | |
| 114 | + format : 'YYYY-MM-DD', | |
| 115 | + locale : 'zh-cn' | |
| 116 | + }); | |
| 117 | + $("#times1").datetimepicker({ | |
| 118 | + format : 'HH:mm', | |
| 119 | + locale : 'zh-cn' | |
| 120 | + }); | |
| 121 | + $("#times2").datetimepicker({ | |
| 122 | + format : 'HH:mm', | |
| 123 | + locale : 'zh-cn' | |
| 124 | + }); | |
| 125 | + | |
| 126 | + var d = new Date(); | |
| 127 | + var year = d.getFullYear(); | |
| 128 | + var month = d.getMonth() + 1; | |
| 129 | + var day = d.getDate(); | |
| 130 | + if(month > 9){ | |
| 131 | + $("#startDate").val(year + "-" + month + "-" + day); | |
| 132 | + $("#endDate").val(year + "-" + month + "-" + day); | |
| 133 | + } else { | |
| 134 | + $("#startDate").val(year + "-0" + month + "-" + day); | |
| 135 | + $("#endDate").val(year + "-0" + month + "-" + day); | |
| 136 | + } | |
| 137 | + $("#times1").val("06:00"); | |
| 138 | + $("#times2").val("07:00"); | |
| 139 | + | |
| 140 | + $.get('/basic/lineCode2Name', function(result){ | |
| 141 | + var data=[]; | |
| 142 | + | |
| 143 | + data.push({id: " ", text: "全部线路"}); | |
| 144 | + for(var code in result){ | |
| 145 | + data.push({id: code, text: result[code]}); | |
| 146 | + } | |
| 147 | + console.log(data); | |
| 148 | + initPinYinSelect2('#line',data,''); | |
| 149 | + | |
| 150 | + line = ""; | |
| 151 | + updateModel(); | |
| 152 | + }); | |
| 153 | + | |
| 154 | + var obj = []; | |
| 155 | + $.get('/user/companyData', function(result){ | |
| 156 | + obj = result; | |
| 157 | + var options = ''; | |
| 158 | + for(var i = 0; i < obj.length; i++){ | |
| 159 | + options += '<option value="'+obj[i].companyCode+'">'+obj[i].companyName+'</option>'; | |
| 160 | + } | |
| 161 | + $('#company').html(options); | |
| 162 | + updateCompany(); | |
| 163 | + }); | |
| 164 | + | |
| 165 | + $("#company").on("change",updateCompany); | |
| 166 | + function updateCompany(){ | |
| 167 | + var company = $('#company').val(); | |
| 168 | + var options = ''; | |
| 169 | + for(var i = 0; i < obj.length; i++){ | |
| 170 | + if(obj[i].companyCode == company){ | |
| 171 | + var children = obj[i].children; | |
| 172 | + for(var j = 0; j < children.length; j++){ | |
| 173 | + options += '<option value="'+children[j].code+'">'+children[j].name+'</option>'; | |
| 174 | + } | |
| 175 | + } | |
| 176 | + } | |
| 177 | + $('#subCompany').html(options); | |
| 178 | + } | |
| 179 | + | |
| 180 | + | |
| 181 | + $("#query").on("click",jsDoQuery); | |
| 182 | + | |
| 183 | + var company; | |
| 184 | + var subCompany; | |
| 185 | + var lines; | |
| 186 | + var line = $("#line").val(); | |
| 187 | + var startDate = $("#startDate").val(); | |
| 188 | + var endDate = $("#endDate").val(); | |
| 189 | + var times = $("#times1").val() + "-" + $("#times2").val(); | |
| 190 | + function jsDoQuery(pagination){ | |
| 191 | + var params = {}; | |
| 192 | +// line = $("#line").val(); | |
| 193 | + startDate = $("#startDate").val(); | |
| 194 | + endDate = $("#endDate").val(); | |
| 195 | + times = $("#times1").val() + "-" + $("#times2").val(); | |
| 196 | + params['line'] = line; | |
| 197 | + params['startDate'] = startDate; | |
| 198 | + params['endDate'] = endDate; | |
| 199 | + params['times'] = times; | |
| 200 | + params['type'] = "query"; | |
| 201 | +// $(".hidden").removeClass("hidden"); | |
| 202 | + $get('/busInterval/correctStatis', params, function(result){ | |
| 203 | + // 把数据填充到模版中 | |
| 204 | + var tbodyHtml = template('list_company',{list:result, type:1}); | |
| 205 | + // 把渲染好的模版html文本追加到表格中 | |
| 206 | + $('#forms').html(tbodyHtml); | |
| 207 | + $('#subinfo').html(""); | |
| 208 | + $('#lineinfo').html(""); | |
| 209 | + $("#lines").html(""); | |
| 210 | + | |
| 211 | + company = result; | |
| 212 | + }); | |
| 213 | + } | |
| 214 | + | |
| 215 | + $("#forms").on("click","tbody tr",function(){ | |
| 216 | + if($(this).children().size() < 2){ | |
| 217 | + return; | |
| 218 | + } | |
| 219 | + var params = {}; | |
| 220 | + $(this).children().each(function(index){ | |
| 221 | + params[index] = $(this).text(); | |
| 222 | + }); | |
| 223 | + $.each(company, function(i, g){ | |
| 224 | + if(g.company == params[1]){ | |
| 225 | + var tbodyHtml = template('list_company',{list:g.workList, type:2}); | |
| 226 | + $("#subinfo").html(tbodyHtml); | |
| 227 | + $("#lineinfo").html(""); | |
| 228 | + $("#lines").html(""); | |
| 229 | + | |
| 230 | + subCompany = g.workList; | |
| 231 | + } | |
| 232 | + }); | |
| 233 | + }); | |
| 234 | + | |
| 235 | + $("#subinfo").on("click","tbody tr",function(){ | |
| 236 | + if($(this).children().size() < 2){ | |
| 237 | + return; | |
| 238 | + } | |
| 239 | + var params = {}; | |
| 240 | + $(this).children().each(function(index){ | |
| 241 | + params[index] = $(this).text(); | |
| 242 | + }); | |
| 243 | + $.each(subCompany, function(i, g){ | |
| 244 | + if(g.company == params[1] && g.subCompany == params[2]){ | |
| 245 | + var tbodyHtml = template('list_company',{list:g.workList, type:3}); | |
| 246 | + $("#lineinfo").html(tbodyHtml); | |
| 247 | + $("#lines").html(""); | |
| 248 | + | |
| 249 | + lines = g.workList; | |
| 250 | + } | |
| 251 | + }); | |
| 252 | + }); | |
| 253 | + | |
| 254 | + $("#lineinfo").on("click","tbody tr",function(){ | |
| 255 | + if($(this).children().size() < 2){ | |
| 256 | + return; | |
| 257 | + } | |
| 258 | + var params = {}; | |
| 259 | + $(this).children().each(function(index){ | |
| 260 | + params[index] = $(this).text(); | |
| 261 | + }); | |
| 262 | + $.each(lines, function(i, g){ | |
| 263 | + if(g.company == params[1] && g.subCompany == params[2] && g.line == params[3]){ | |
| 264 | + var tbodyHtml = template('list_workList',{list:g.workList}); | |
| 265 | + $("#lines").html(tbodyHtml); | |
| 266 | + } | |
| 267 | + }); | |
| 268 | + }); | |
| 269 | + | |
| 270 | + $("#export").on("click", function(){ | |
| 271 | + $get('/pcpc/workDaily',{line:line,date:date,type:'export'},function(result){ | |
| 272 | + window.open("/downloadFile/download?fileName=营运服务日报表"+moment(date).format("YYYYMMDD")); | |
| 273 | + }); | |
| 274 | + }); | |
| 275 | + | |
| 276 | + | |
| 277 | + $("#line").on("change", function(){ | |
| 278 | + line = $("#line").val(); | |
| 279 | + if(line == " ") | |
| 280 | + line = ""; | |
| 281 | + updateModel(); | |
| 282 | + }); | |
| 283 | + $('#startDate').on("blur", function(){ | |
| 284 | + startDate = $("#startDate").val(); | |
| 285 | + endDate = $("#endDate").val(); | |
| 286 | + updateModel(); | |
| 287 | + }); | |
| 288 | + $('#endDate').on("blur", function(){ | |
| 289 | + startDate = $("#startDate").val(); | |
| 290 | + endDate = $("#endDate").val(); | |
| 291 | + updateModel(); | |
| 292 | + }); | |
| 293 | + | |
| 294 | + | |
| 295 | + }); | |
| 296 | + | |
| 297 | +</script> | |
| 298 | +<script type="text/html" id="list_company"> | |
| 299 | +<thead> | |
| 300 | + <tr> | |
| 301 | + <th class="hidden"></th> | |
| 302 | + <th rowspan="2" width="120px">日期</th> | |
| 303 | + <th rowspan="2">公司</th> | |
| 304 | + {{if type>1}}<th rowspan="2">分公司</th>{{/if}} | |
| 305 | + {{if type<3}}<th rowspan="2">线路条数</th>{{/if}} | |
| 306 | + {{if type==3}}<th rowspan="2">线路</th>{{/if}} | |
| 307 | + <th rowspan="2">实际营运班次</th> | |
| 308 | + <th colspan="3" align="center">待发调整数</th> | |
| 309 | + <th rowspan="2">掉线调整数</th> | |
| 310 | + <th rowspan="2">各类烂班调整数</th> | |
| 311 | + <th rowspan="2">修正次数汇总</th> | |
| 312 | + <th rowspan="2">待发调整率</th> | |
| 313 | + <th rowspan="2">掉线调整率</th> | |
| 314 | + <th rowspan="2">各类烂班调整率</th> | |
| 315 | + <th rowspan="2">修正率汇总</th> | |
| 316 | + </tr> | |
| 317 | + <tr> | |
| 318 | + <th class="hidden"></th> | |
| 319 | + <th>手动调整</th> | |
| 320 | + <th>自动调整</th> | |
| 321 | + <th>待发调整合计</th> | |
| 322 | + </tr> | |
| 323 | +</thead> | |
| 324 | +<tbody> | |
| 325 | + {{each list as obj i}} | |
| 326 | + <tr> | |
| 327 | + {{if obj.date=='合计'}} | |
| 328 | + {{if type==1}}<td colspan="2">{{obj.date}}</td>{{/if}} | |
| 329 | + {{if type==2}}<td colspan="3">{{obj.date}}</td>{{/if}} | |
| 330 | + {{if type==3}}<td colspan="4">{{obj.date}}</td>{{/if}} | |
| 331 | + {{/if}} | |
| 332 | + {{if obj.date!='合计'}} | |
| 333 | + <td>{{obj.date}}</td> | |
| 334 | + | |
| 335 | + {{/if}} | |
| 336 | + {{if obj.date!='合计'}}<td>{{obj.company}}</td>{{/if}} | |
| 337 | + {{if type>1 && obj.date!='合计'}}<td>{{obj.subCompany}}</td>{{/if}} | |
| 338 | + {{if type<3}}<td>{{obj.lines}}</td>{{/if}} | |
| 339 | + {{if type==3 && obj.date!='合计'}}<td>{{obj.line}}</td>{{/if}} | |
| 340 | + <td>{{obj.sjbc}}</td> | |
| 341 | + <td>{{obj.sddf}}</td> | |
| 342 | + <td>{{obj.zddf}}</td> | |
| 343 | + <td>{{obj.dfhj}}</td> | |
| 344 | + <td>{{obj.dxtz}}</td> | |
| 345 | + <td>{{obj.lbtz}}</td> | |
| 346 | + <td>{{obj.correct}}</td> | |
| 347 | + <td>{{obj.dfbl}}</td> | |
| 348 | + <td>{{obj.dxbl}}</td> | |
| 349 | + <td>{{obj.lbbl}}</td> | |
| 350 | + <td>{{obj.correctbl}}</td> | |
| 351 | + </tr> | |
| 352 | + {{/each}} | |
| 353 | + {{if list.length == 0}} | |
| 354 | + <tr> | |
| 355 | + <td colspan="15"><h6 class="muted">没有找到相关数据</h6></td> | |
| 356 | + </tr> | |
| 357 | + {{/if}} | |
| 358 | +</tbody> | |
| 359 | +</script> | |
| 360 | +<script type="text/html" id="list_workList"> | |
| 361 | +<thead> | |
| 362 | + <tr> | |
| 363 | + <th colspan="9">修正报表</th> | |
| 364 | + </tr> | |
| 365 | + <tr> | |
| 366 | + <th>路牌</th> | |
| 367 | + <th>车号</th> | |
| 368 | + <th>工号</th> | |
| 369 | + <th>人名</th> | |
| 370 | + <th>发车时间</th> | |
| 371 | + <th>结束时间</th> | |
| 372 | + <th>修改人</th> | |
| 373 | + <th>修改时间</th> | |
| 374 | + <th>修改原因</th> | |
| 375 | + </tr> | |
| 376 | +</thead> | |
| 377 | +<tbody> | |
| 378 | + {{each list as obj i}} | |
| 379 | + <tr> | |
| 380 | + <td>{{obj.lpName}}</td> | |
| 381 | + <td>{{obj.clZbh}}</td> | |
| 382 | + <td>{{obj.jGh}}</td> | |
| 383 | + <td>{{obj.jName}}</td> | |
| 384 | + <td>{{obj.fcsj}}</td> | |
| 385 | + <td>{{obj.zdsj}}</td> | |
| 386 | + <td>{{obj.updateBy}}</td> | |
| 387 | + <td>{{obj.updateDate}}</td> | |
| 388 | + <td>{{obj.remarks}}</td> | |
| 389 | + </tr> | |
| 390 | + {{/each}} | |
| 391 | + {{if list.length == 0}} | |
| 392 | + <tr> | |
| 393 | + <td colspan="15"><h6 class="muted">没有找到相关数据</h6></td> | |
| 394 | + </tr> | |
| 395 | + {{/if}} | |
| 396 | +</tbody> | |
| 397 | +</script> | ... | ... |
src/main/resources/static/pages/forms/statement/lbStatuAnaly.html
| ... | ... | @@ -13,6 +13,9 @@ |
| 13 | 13 | border-bottom-width: 2px; } |
| 14 | 14 | .table > tbody + tbody { |
| 15 | 15 | border-top: 1px solid; } |
| 16 | + #forms > tbody > tr{ | |
| 17 | + background-color: #FFFFFF; | |
| 18 | + } | |
| 16 | 19 | </style> |
| 17 | 20 | |
| 18 | 21 | <div class="page-head"> |
| ... | ... | @@ -26,7 +29,7 @@ |
| 26 | 29 | <div class="portlet light porttlet-fit bordered"> |
| 27 | 30 | <div class="portlet-title"> |
| 28 | 31 | <form id="history" class="form-inline" action=""> |
| 29 | - <div style="display: inline-block;margin-left: 15px;"> | |
| 32 | + <div style="display: inline-block;margin-left: 5px;"> | |
| 30 | 33 | <span class="item-label" style="width: 80px;">烂班原因: </span> |
| 31 | 34 | <input class="form-control" type="checkbox" id="totalLb" style="width: 20px;" checked="true"/>全选 |
| 32 | 35 | <input class="form-control" type="checkbox" name="reason" style="width: 20px;" value="0" checked="true"/>路阻 |
| ... | ... | @@ -41,59 +44,43 @@ |
| 41 | 44 | <input class="form-control" type="checkbox" name="reason" style="width: 20px;" value="9" checked="true"/>外援 |
| 42 | 45 | <input class="form-control" type="checkbox" name="reason" style="width: 20px;" value="10" checked="true"/>其他 |
| 43 | 46 | </div> |
| 44 | - <br/> | |
| 45 | - <div style="display: inline-block;margin-left: 15px;"> | |
| 46 | - <span class="item-label" style="width: 80px;">公司: </span> | |
| 47 | - <select class="form-control" name="company" id="company" style="width: 180px;"></select> | |
| 48 | - </div> | |
| 49 | - <div style="display: inline-block;margin-left: 15px;"> | |
| 50 | - <span class="item-label" style="width: 80px;">分公司: </span> | |
| 51 | - <select class="form-control" name="subCompany" id="subCompany" style="width: 180px;"></select> | |
| 47 | + <div style="margin-top: 5px"></div> | |
| 48 | + <div style="display: inline-block;"> | |
| 49 | + <span class="item-label" style="width: 80px; margin-left: 33px">公司: </span> | |
| 50 | + <select class="form-control" name="company" id="company" style="width: 140px;"></select> | |
| 52 | 51 | </div> |
| 53 | 52 | <div style="display: inline-block;"> |
| 54 | - <span class="item-label" style="width: 80px;">线路: </span> | |
| 55 | - <select class="form-control" name="line" id="line" style="width: 180px;"></select> | |
| 53 | + <span class="item-label" style="width: 80px; margin-left: 24px">分公司: </span> | |
| 54 | + <select class="form-control" name="subCompany" id="subCompany" style="width: 140px;"></select> | |
| 56 | 55 | </div> |
| 57 | 56 | <div style="display: inline-block;"> |
| 57 | + <span class="item-label" style="width: 80px; margin-left: 24px">线路: </span> | |
| 58 | + <select class="form-control" name="line" id="line" style="width: 140px;"></select> | |
| 59 | + </div> | |
| 60 | + <div style="display: inline-block; margin-left: 10px"> | |
| 58 | 61 | <span class="item-label" style="width: 80px;">时刻类型: </span> |
| 59 | - <select class="form-control" name="model" id="model" style="width: 180px;"> | |
| 62 | + <select class="form-control" name="model" id="model" style="width: 165px;"> | |
| 60 | 63 | <option value="">请选择...</option> |
| 61 | 64 | </select> |
| 62 | 65 | </div> |
| 63 | - <br/> | |
| 64 | - <div style="display: inline-block;margin-left: 15px;"> | |
| 66 | + <div style="margin-top: 10px"></div> | |
| 67 | + <div style="display: inline-block;margin-left: 5px;"> | |
| 65 | 68 | <span class="item-label" style="width: 80px;">开始时间: </span> |
| 66 | - <input class="form-control" type="text" id="startDate" style="width: 180px;"/> | |
| 69 | + <input class="form-control" type="text" id="startDate" style="width: 140px;"/> | |
| 67 | 70 | </div> |
| 68 | - <div style="display: inline-block;margin-left: 15px;"> | |
| 71 | + <div style="display: inline-block;margin-left: 10px;"> | |
| 69 | 72 | <span class="item-label" style="width: 80px;">结束时间: </span> |
| 70 | - <input class="form-control" type="text" id="endDate" style="width: 180px;"/> | |
| 73 | + <input class="form-control" type="text" id="endDate" style="width: 140px;"/> | |
| 71 | 74 | </div> |
| 72 | - <div style="display: inline-block;"> | |
| 75 | + <div style="display: inline-block;margin-left: 10px;"> | |
| 73 | 76 | <span class="item-label" style="width: 80px;">时间段: </span> |
| 74 | - <select class="form-control" name="model" id="times" style="width: 180px;"> | |
| 75 | - <option value="05:00-06:00">05:00-06:00</option> | |
| 76 | - <option value="06:00-07:00">06:00-07:00</option> | |
| 77 | - <option value="07:00-08:00">07:00-08:00</option> | |
| 78 | - <option value="08:00-09:00">08:00-09:00</option> | |
| 79 | - <option value="09:00-10:00">09:00-10:00</option> | |
| 80 | - <option value="10:00-11:00">10:00-11:00</option> | |
| 81 | - <option value="11:00-12:00">11:00-12:00</option> | |
| 82 | - <option value="12:00-13:00">12:00-13:00</option> | |
| 83 | - <option value="13:00-14:00">13:00-14:00</option> | |
| 84 | - <option value="14:00-15:00">14:00-15:00</option> | |
| 85 | - <option value="15:00-16:00">15:00-16:00</option> | |
| 86 | - <option value="16:00-17:00">16:00-17:00</option> | |
| 87 | - <option value="17:00-18:00">17:00-18:00</option> | |
| 88 | - <option value="18:00-19:00">18:00-19:00</option> | |
| 89 | - <option value="19:00-20:00">19:00-20:00</option> | |
| 90 | - <option value="20:00-21:00">20:00-21:00</option> | |
| 91 | - <option value="21:00-22:00">21:00-22:00</option> | |
| 92 | - <option value="22:00-23:00">22:00-23:00</option> | |
| 93 | - <option value="23:00-00:00">23:00-00:00</option> | |
| 94 | - </select> | |
| 77 | + <input class="form-control" type="text" id="times1" style="width: 60px;"/> | |
| 78 | + </div> | |
| 79 | + <div style="display: inline-block;"> | |
| 80 | + <span class="item-label" style="width: 80px;"> - </span> | |
| 81 | + <input class="form-control" type="text" id="times2" style="width: 60px;"/> | |
| 95 | 82 | </div> |
| 96 | - <div class="form-group"> | |
| 83 | + <div class="form-group" style="margin-left: 10px"> | |
| 97 | 84 | <input class="btn btn-default" type="button" id="query" value="筛选"/> |
| 98 | 85 | <!-- <input class="btn btn-default" type="button" id="export" value="导出"/> --> |
| 99 | 86 | </div> |
| ... | ... | @@ -134,6 +121,14 @@ |
| 134 | 121 | format : 'YYYY-MM-DD', |
| 135 | 122 | locale : 'zh-cn' |
| 136 | 123 | }); |
| 124 | + $("#times1").datetimepicker({ | |
| 125 | + format : 'HH:mm', | |
| 126 | + locale : 'zh-cn' | |
| 127 | + }); | |
| 128 | + $("#times2").datetimepicker({ | |
| 129 | + format : 'HH:mm', | |
| 130 | + locale : 'zh-cn' | |
| 131 | + }); | |
| 137 | 132 | |
| 138 | 133 | var d = new Date(); |
| 139 | 134 | var year = d.getFullYear(); |
| ... | ... | @@ -146,17 +141,20 @@ |
| 146 | 141 | $("#startDate").val(year + "-0" + month + "-" + day); |
| 147 | 142 | $("#endDate").val(year + "-0" + month + "-" + day); |
| 148 | 143 | } |
| 144 | + $("#times1").val("06:00"); | |
| 145 | + $("#times2").val("07:00"); | |
| 149 | 146 | |
| 150 | 147 | $.get('/basic/lineCode2Name', function(result){ |
| 151 | 148 | var data=[]; |
| 152 | 149 | |
| 150 | + data.push({id: " ", text: "全部线路"}); | |
| 153 | 151 | for(var code in result){ |
| 154 | 152 | data.push({id: code, text: result[code]}); |
| 155 | 153 | } |
| 156 | -// console.log(data); | |
| 154 | + console.log(data); | |
| 157 | 155 | initPinYinSelect2('#line',data,''); |
| 158 | 156 | |
| 159 | - line = data[0].id; | |
| 157 | + line = ""; | |
| 160 | 158 | updateModel(); |
| 161 | 159 | }) |
| 162 | 160 | |
| ... | ... | @@ -165,7 +163,6 @@ |
| 165 | 163 | obj = result; |
| 166 | 164 | var options = ''; |
| 167 | 165 | for(var i = 0; i < obj.length; i++){ |
| 168 | -// alert(obj[i].children.length); | |
| 169 | 166 | options += '<option value="'+obj[i].companyCode+'">'+obj[i].companyName+'</option>'; |
| 170 | 167 | } |
| 171 | 168 | $('#company').html(options); |
| ... | ... | @@ -219,15 +216,15 @@ |
| 219 | 216 | var startDate = $("#startDate").val(); |
| 220 | 217 | var endDate = $("#endDate").val(); |
| 221 | 218 | var model = $("#model").val(); |
| 222 | - var times = $("#times").val(); | |
| 219 | + var times = $("#times1").val() + "-" + $("#times2").val(); | |
| 223 | 220 | function jsDoQuery(pagination){ |
| 224 | 221 | var reason = $("input[name='reason']"); |
| 225 | 222 | var params = {}; |
| 226 | - line = $("#line").val(); | |
| 223 | +// line = $("#line").val(); | |
| 227 | 224 | startDate = $("#startDate").val(); |
| 228 | 225 | endDate = $("#endDate").val(); |
| 229 | 226 | model = $("#model").val(); |
| 230 | - times = $("#times").val(); | |
| 227 | + times = $("#times1").val() + "-" + $("#times2").val(); | |
| 231 | 228 | params['line'] = line; |
| 232 | 229 | params['startDate'] = startDate; |
| 233 | 230 | params['endDate'] = endDate; |
| ... | ... | @@ -240,6 +237,11 @@ |
| 240 | 237 | var tbodyHtml = template('list_lbAnaly',{list:result, reason:reason, lb:lb}); |
| 241 | 238 | // 把渲染好的模版html文本追加到表格中 |
| 242 | 239 | $('#forms').html(tbodyHtml); |
| 240 | + _w_table_rowspan("#forms", 1); | |
| 241 | + _w_table_rowspan("#forms", 2); | |
| 242 | + _w_table_rowspan("#forms", 3); | |
| 243 | + _w_table_rowspan("#forms", 4); | |
| 244 | + _w_table_rowspan("#forms", 5); | |
| 243 | 245 | }); |
| 244 | 246 | } |
| 245 | 247 | |
| ... | ... | @@ -252,6 +254,8 @@ |
| 252 | 254 | |
| 253 | 255 | $("#line").on("change", function(){ |
| 254 | 256 | line = $("#line").val(); |
| 257 | + if(line == " ") | |
| 258 | + line = ""; | |
| 255 | 259 | updateModel(); |
| 256 | 260 | }); |
| 257 | 261 | $('#startDate').on("blur", function(){ |
| ... | ... | @@ -287,6 +291,30 @@ |
| 287 | 291 | } |
| 288 | 292 | |
| 289 | 293 | |
| 294 | + function _w_table_rowspan(_w_table_id, _w_table_colnum){ | |
| 295 | + _w_table_firsttd = ""; | |
| 296 | + _w_table_currenttd = ""; | |
| 297 | + _w_table_SpanNum = 0; | |
| 298 | + _w_table_Obj = jQuery(_w_table_id + " tr td:nth-child(" + _w_table_colnum + ")"); | |
| 299 | + _w_table_Obj.each(function(i){ | |
| 300 | + if(i==0){ | |
| 301 | + _w_table_firsttd = jQuery(this); | |
| 302 | + _w_table_SpanNum = 1; | |
| 303 | + }else{ | |
| 304 | + _w_table_currenttd = jQuery(this); | |
| 305 | + if(_w_table_firsttd.text()==_w_table_currenttd.text()){ | |
| 306 | + _w_table_SpanNum++; | |
| 307 | + _w_table_currenttd.hide(); //remove(); | |
| 308 | + _w_table_firsttd.attr("rowSpan",_w_table_SpanNum); | |
| 309 | + }else{ | |
| 310 | + _w_table_firsttd = jQuery(this); | |
| 311 | + _w_table_SpanNum = 1; | |
| 312 | + } | |
| 313 | + } | |
| 314 | + }); | |
| 315 | + } | |
| 316 | + | |
| 317 | + | |
| 290 | 318 | }); |
| 291 | 319 | |
| 292 | 320 | </script> |
| ... | ... | @@ -361,7 +389,7 @@ |
| 361 | 389 | {{/each}} |
| 362 | 390 | {{if list.length == 0}} |
| 363 | 391 | <tr> |
| 364 | - <td colspan="41"><h6 class="muted">没有找到相关数据</h6></td> | |
| 392 | + <td colspan="44"><h6 class="muted">没有找到相关数据</h6></td> | |
| 365 | 393 | </tr> |
| 366 | 394 | {{/if}} |
| 367 | 395 | </tbody> | ... | ... |
src/main/resources/static/pages/forms/statement/lineTimeAnaly.html
| ... | ... | @@ -34,55 +34,43 @@ |
| 34 | 34 | <div class="portlet-title"> |
| 35 | 35 | <form id="history" class="form-inline" action=""> |
| 36 | 36 | <div style="display: inline-block;"> |
| 37 | - <span class="item-label" style="width: 80px;">线路: </span> | |
| 38 | - <select class="form-control" name="line" id="line" style="width: 180px;"></select> | |
| 37 | + <span class="item-label" style="width: 80px; margin-left: 33px">公司: </span> | |
| 38 | + <select class="form-control" name="company" id="company" style="width: 140px;"></select> | |
| 39 | 39 | </div> |
| 40 | - <div style="display: inline-block;margin-left: 15px;"> | |
| 41 | - <span class="item-label" style="width: 80px;">开始时间: </span> | |
| 42 | - <input class="form-control" type="text" id="startDate" style="width: 180px;"/> | |
| 43 | - </div> | |
| 44 | - <div style="display: inline-block;margin-left: 15px;"> | |
| 45 | - <span class="item-label" style="width: 80px;">结束时间: </span> | |
| 46 | - <input class="form-control" type="text" id="endDate" style="width: 180px;"/> | |
| 40 | + <div style="display: inline-block;"> | |
| 41 | + <span class="item-label" style="width: 80px; margin-left: 38px">线路: </span> | |
| 42 | + <select class="form-control" name="line" id="line" style="width: 140px;"></select> | |
| 47 | 43 | </div> |
| 48 | - <br/> | |
| 49 | 44 | <div style="display: inline-block;"> |
| 45 | + <span class="item-label" style="width: 80px; margin-left: 24px">方向: </span> | |
| 46 | + <select class="form-control" name="upDown" id="upDown" style="width: 140px;"> | |
| 47 | + <option value="">请先选择线路</option> | |
| 48 | + </select> | |
| 49 | + </div> | |
| 50 | + <div style="display: inline-block; margin-left: 10px"> | |
| 50 | 51 | <span class="item-label" style="width: 80px;">时刻类型: </span> |
| 51 | - <select class="form-control" name="model" id="model" style="width: 180px;"> | |
| 52 | + <select class="form-control" name="model" id="model" style="width: 165px;"> | |
| 52 | 53 | <option value="">请选择...</option> |
| 53 | 54 | </select> |
| 54 | 55 | </div> |
| 55 | - <div style="display: inline-block;"> | |
| 56 | + <div style="margin-top: 10px"></div> | |
| 57 | + <div style="display: inline-block;margin-left: 5px;"> | |
| 58 | + <span class="item-label" style="width: 80px;">开始时间: </span> | |
| 59 | + <input class="form-control" type="text" id="startDate" style="width: 140px;"/> | |
| 60 | + </div> | |
| 61 | + <div style="display: inline-block;margin-left: 10px;"> | |
| 62 | + <span class="item-label" style="width: 80px;">结束时间: </span> | |
| 63 | + <input class="form-control" type="text" id="endDate" style="width: 140px;"/> | |
| 64 | + </div> | |
| 65 | + <div style="display: inline-block;margin-left: 10px;"> | |
| 56 | 66 | <span class="item-label" style="width: 80px;">时间段: </span> |
| 57 | - <select class="form-control" name="times" id="times" style="width: 180px;"> | |
| 58 | - <option value="05:00-06:00">05:00-06:00</option> | |
| 59 | - <option value="06:00-07:00">06:00-07:00</option> | |
| 60 | - <option value="07:00-08:00">07:00-08:00</option> | |
| 61 | - <option value="08:00-09:00">08:00-09:00</option> | |
| 62 | - <option value="09:00-10:00">09:00-10:00</option> | |
| 63 | - <option value="10:00-11:00">10:00-11:00</option> | |
| 64 | - <option value="11:00-12:00">11:00-12:00</option> | |
| 65 | - <option value="12:00-13:00">12:00-13:00</option> | |
| 66 | - <option value="13:00-14:00">13:00-14:00</option> | |
| 67 | - <option value="14:00-15:00">14:00-15:00</option> | |
| 68 | - <option value="15:00-16:00">15:00-16:00</option> | |
| 69 | - <option value="16:00-17:00">16:00-17:00</option> | |
| 70 | - <option value="17:00-18:00">17:00-18:00</option> | |
| 71 | - <option value="18:00-19:00">18:00-19:00</option> | |
| 72 | - <option value="19:00-20:00">19:00-20:00</option> | |
| 73 | - <option value="20:00-21:00">20:00-21:00</option> | |
| 74 | - <option value="21:00-22:00">21:00-22:00</option> | |
| 75 | - <option value="22:00-23:00">22:00-23:00</option> | |
| 76 | - <option value="23:00-00:00">23:00-00:00</option> | |
| 77 | - </select> | |
| 67 | + <input class="form-control" type="text" id="times1" style="width: 60px;"/> | |
| 78 | 68 | </div> |
| 79 | 69 | <div style="display: inline-block;"> |
| 80 | - <span class="item-label" style="width: 80px;">方向: </span> | |
| 81 | - <select class="form-control" name="upDown" id="upDown" style="width: 180px;"> | |
| 82 | - <option value="">请先选择线路</option> | |
| 83 | - </select> | |
| 70 | + <span class="item-label" style="width: 80px;"> - </span> | |
| 71 | + <input class="form-control" type="text" id="times2" style="width: 60px;"/> | |
| 84 | 72 | </div> |
| 85 | - <div class="form-group"> | |
| 73 | + <div class="form-group" style="margin-left: 10px"> | |
| 86 | 74 | <input class="btn btn-default" type="button" id="query" value="筛选"/> |
| 87 | 75 | <!-- <input class="btn btn-default" type="button" id="export" value="导出"/> --> |
| 88 | 76 | </div> |
| ... | ... | @@ -186,6 +174,15 @@ |
| 186 | 174 | format : 'YYYY-MM-DD', |
| 187 | 175 | locale : 'zh-cn' |
| 188 | 176 | }); |
| 177 | + | |
| 178 | + $("#times1").datetimepicker({ | |
| 179 | + format : 'HH:mm', | |
| 180 | + locale : 'zh-cn' | |
| 181 | + }); | |
| 182 | + $("#times2").datetimepicker({ | |
| 183 | + format : 'HH:mm', | |
| 184 | + locale : 'zh-cn' | |
| 185 | + }); | |
| 189 | 186 | |
| 190 | 187 | var d = new Date(); |
| 191 | 188 | var year = d.getFullYear(); |
| ... | ... | @@ -198,24 +195,38 @@ |
| 198 | 195 | $("#startDate").val(year + "-0" + month + "-" + day); |
| 199 | 196 | $("#endDate").val(year + "-0" + month + "-" + day); |
| 200 | 197 | } |
| 198 | + $("#times1").val("06:00"); | |
| 199 | + $("#times2").val("07:00"); | |
| 200 | + | |
| 201 | + var obj = []; | |
| 202 | + $.get('/user/companyData', function(result){ | |
| 203 | + obj = result; | |
| 204 | + var options = ''; | |
| 205 | + for(var i = 0; i < obj.length; i++){ | |
| 206 | + options += '<option value="'+obj[i].companyCode+'">'+obj[i].companyName+'</option>'; | |
| 207 | + } | |
| 208 | + $('#company').html(options); | |
| 209 | + updateCompany(); | |
| 210 | + }); | |
| 201 | 211 | |
| 202 | 212 | $.get('/basic/lineCode2Name',function(result){ |
| 203 | 213 | var data=[]; |
| 204 | 214 | |
| 215 | + data.push({id: " ", text:"全部路线"}); | |
| 205 | 216 | for(var code in result){ |
| 206 | 217 | data.push({id: code, text: result[code]}); |
| 207 | 218 | } |
| 208 | 219 | console.log(data); |
| 209 | 220 | initPinYinSelect2('#line',data,''); |
| 210 | 221 | |
| 211 | - line = data[0].id; | |
| 222 | + line = ""; | |
| 212 | 223 | updateModel(); |
| 213 | 224 | |
| 214 | 225 | var params = {}; |
| 215 | 226 | params['line'] = line; |
| 216 | 227 | $get('/busInterval/getDir', params, function(result){ |
| 217 | 228 | dirData = createTreeData(result); |
| 218 | - var options = ''; | |
| 229 | + var options = '<option value="">全部方向</option>'; | |
| 219 | 230 | $.each(dirData, function(i, g){ |
| 220 | 231 | options += '<option value="'+g.name+'">'+g.name+'</option>'; |
| 221 | 232 | }); |
| ... | ... | @@ -224,30 +235,22 @@ |
| 224 | 235 | }); |
| 225 | 236 | |
| 226 | 237 | $("#query").on("click", function (){ |
| 227 | - line = $("#line").val(); | |
| 228 | - upDown = $("#upDown").val(); | |
| 229 | - if(line=="" || line==null){ | |
| 230 | - layer.msg("请选择线路"); | |
| 231 | - }else if(upDown==null || upDown==""){ | |
| 232 | - layer.msg("请选择方向"); | |
| 233 | - }else{ | |
| 234 | - jsDoQuery(); | |
| 235 | - } | |
| 238 | + jsDoQuery(); | |
| 236 | 239 | }); |
| 237 | 240 | |
| 238 | 241 | var line = $("#line").val(); |
| 239 | 242 | var startDate = $("#startDate").val(); |
| 240 | 243 | var endDate = $("#endDate").val(); |
| 241 | 244 | var model = $("#model").val(); |
| 242 | - var times = $("#times").val(); | |
| 245 | + var times = $("#times1").val() + "-" + $("#times2").val(); | |
| 243 | 246 | var upDown = $("#upDown").val(); |
| 244 | 247 | function jsDoQuery(pagination){ |
| 245 | 248 | var params = {}; |
| 246 | - line = $("#line").val(); | |
| 249 | +// line = $("#line").val(); | |
| 247 | 250 | startDate = $("#startDate").val(); |
| 248 | 251 | endDate = $("#endDate").val(); |
| 249 | 252 | model = $("#model").val(); |
| 250 | - times = $("#times").val(); | |
| 253 | + times = $("#times1").val() + "-" + $("#times2").val(); | |
| 251 | 254 | upDown = $("#upDown").val(); |
| 252 | 255 | params['line'] = line; |
| 253 | 256 | params['startDate'] = startDate; |
| ... | ... | @@ -302,12 +305,14 @@ |
| 302 | 305 | |
| 303 | 306 | $("#line").on("change", function(){ |
| 304 | 307 | line = $("#line").val(); |
| 308 | + if(line == " ") | |
| 309 | + line = ""; | |
| 305 | 310 | updateModel(); |
| 306 | 311 | var params = {}; |
| 307 | 312 | params['line'] = line; |
| 308 | 313 | $get('/busInterval/getDir', params, function(result){ |
| 309 | 314 | dirData = createTreeData(result); |
| 310 | - var options = ''; | |
| 315 | + var options = '<option value="">全部方向</option>'; | |
| 311 | 316 | $.each(dirData, function(i, g){ |
| 312 | 317 | options += '<option value="'+g.name+'">'+g.name+'</option>'; |
| 313 | 318 | }); | ... | ... |
src/main/resources/static/pages/forms/statement/timeAndSpeed.html
| ... | ... | @@ -13,6 +13,9 @@ |
| 13 | 13 | border-bottom-width: 2px; } |
| 14 | 14 | .table > tbody + tbody { |
| 15 | 15 | border-top: 1px solid; } |
| 16 | + #forms > tbody > tr{ | |
| 17 | + background-color: #FFFFFF; | |
| 18 | + } | |
| 16 | 19 | </style> |
| 17 | 20 | |
| 18 | 21 | <div class="page-head"> |
| ... | ... | @@ -27,55 +30,47 @@ |
| 27 | 30 | <div class="portlet-title"> |
| 28 | 31 | <form id="history" class="form-inline" action=""> |
| 29 | 32 | <div style="display: inline-block;"> |
| 30 | - <span class="item-label" style="width: 80px;">线路: </span> | |
| 31 | - <select class="form-control" name="line" id="line" style="width: 180px;"></select> | |
| 33 | + <span class="item-label" style="width: 80px; margin-left: 33px">公司: </span> | |
| 34 | + <select class="form-control" name="company" id="company" style="width: 140px;"></select> | |
| 32 | 35 | </div> |
| 33 | - <div style="display: inline-block;margin-left: 15px;"> | |
| 34 | - <span class="item-label" style="width: 80px;">开始时间: </span> | |
| 35 | - <input class="form-control" type="text" id="startDate" style="width: 180px;"/> | |
| 36 | + <div style="display: inline-block;"> | |
| 37 | + <span class="item-label" style="width: 80px; margin-left: 24px">分公司: </span> | |
| 38 | + <select class="form-control" name="subCompany" id="subCompany" style="width: 140px;"></select> | |
| 36 | 39 | </div> |
| 37 | - <div style="display: inline-block;margin-left: 15px;"> | |
| 38 | - <span class="item-label" style="width: 80px;">结束时间: </span> | |
| 39 | - <input class="form-control" type="text" id="endDate" style="width: 180px;"/> | |
| 40 | + <div style="display: inline-block;"> | |
| 41 | + <span class="item-label" style="width: 80px; margin-left: 24px">线路: </span> | |
| 42 | + <select class="form-control" name="line" id="line" style="width: 140px;"></select> | |
| 40 | 43 | </div> |
| 41 | - <br/> | |
| 42 | 44 | <div style="display: inline-block;"> |
| 45 | + <span class="item-label" style="width: 80px; margin-left: 8px">方向: </span> | |
| 46 | + <select class="form-control" name="upDown" id="upDown" style="width: 140px;"> | |
| 47 | + <option value="">请先选择线路</option> | |
| 48 | + </select> | |
| 49 | + </div> | |
| 50 | + <div style="display: inline-block; margin-left: 10px"> | |
| 43 | 51 | <span class="item-label" style="width: 80px;">时刻类型: </span> |
| 44 | - <select class="form-control" name="model" id="model" style="width: 180px;"> | |
| 52 | + <select class="form-control" name="model" id="model" style="width: 165px;"> | |
| 45 | 53 | <option value="">请选择...</option> |
| 46 | 54 | </select> |
| 47 | 55 | </div> |
| 48 | - <div style="display: inline-block;"> | |
| 56 | + <div style="margin-top: 10px"></div> | |
| 57 | + <div style="display: inline-block;margin-left: 5px;"> | |
| 58 | + <span class="item-label" style="width: 80px;">开始时间: </span> | |
| 59 | + <input class="form-control" type="text" id="startDate" style="width: 140px;"/> | |
| 60 | + </div> | |
| 61 | + <div style="display: inline-block;margin-left: 10px;"> | |
| 62 | + <span class="item-label" style="width: 80px;">结束时间: </span> | |
| 63 | + <input class="form-control" type="text" id="endDate" style="width: 140px;"/> | |
| 64 | + </div> | |
| 65 | + <div style="display: inline-block;margin-left: 10px;"> | |
| 49 | 66 | <span class="item-label" style="width: 80px;">时间段: </span> |
| 50 | - <select class="form-control" name="times" id="times" style="width: 180px;"> | |
| 51 | - <option value="05:00-06:00">05:00-06:00</option> | |
| 52 | - <option value="06:00-07:00">06:00-07:00</option> | |
| 53 | - <option value="07:00-08:00">07:00-08:00</option> | |
| 54 | - <option value="08:00-09:00">08:00-09:00</option> | |
| 55 | - <option value="09:00-10:00">09:00-10:00</option> | |
| 56 | - <option value="10:00-11:00">10:00-11:00</option> | |
| 57 | - <option value="11:00-12:00">11:00-12:00</option> | |
| 58 | - <option value="12:00-13:00">12:00-13:00</option> | |
| 59 | - <option value="13:00-14:00">13:00-14:00</option> | |
| 60 | - <option value="14:00-15:00">14:00-15:00</option> | |
| 61 | - <option value="15:00-16:00">15:00-16:00</option> | |
| 62 | - <option value="16:00-17:00">16:00-17:00</option> | |
| 63 | - <option value="17:00-18:00">17:00-18:00</option> | |
| 64 | - <option value="18:00-19:00">18:00-19:00</option> | |
| 65 | - <option value="19:00-20:00">19:00-20:00</option> | |
| 66 | - <option value="20:00-21:00">20:00-21:00</option> | |
| 67 | - <option value="21:00-22:00">21:00-22:00</option> | |
| 68 | - <option value="22:00-23:00">22:00-23:00</option> | |
| 69 | - <option value="23:00-00:00">23:00-00:00</option> | |
| 70 | - </select> | |
| 67 | + <input class="form-control" type="text" id="times1" style="width: 60px;"/> | |
| 71 | 68 | </div> |
| 72 | 69 | <div style="display: inline-block;"> |
| 73 | - <span class="item-label" style="width: 80px;">方向: </span> | |
| 74 | - <select class="form-control" name="upDown" id="upDown" style="width: 180px;"> | |
| 75 | - <option value="">请先选择线路</option> | |
| 76 | - </select> | |
| 70 | + <span class="item-label" style="width: 80px;"> - </span> | |
| 71 | + <input class="form-control" type="text" id="times2" style="width: 60px;"/> | |
| 77 | 72 | </div> |
| 78 | - <div class="form-group"> | |
| 73 | + <div class="form-group" style="margin-left: 10px"> | |
| 79 | 74 | <input class="btn btn-default" type="button" id="query" value="筛选"/> |
| 80 | 75 | <!-- <input class="btn btn-default" type="button" id="export" value="导出"/> --> |
| 81 | 76 | </div> |
| ... | ... | @@ -127,6 +122,14 @@ |
| 127 | 122 | $("#endDate").datetimepicker({ |
| 128 | 123 | format : 'YYYY-MM-DD', |
| 129 | 124 | locale : 'zh-cn' |
| 125 | + }); | |
| 126 | + $("#times1").datetimepicker({ | |
| 127 | + format : 'HH:mm', | |
| 128 | + locale : 'zh-cn' | |
| 129 | + }); | |
| 130 | + $("#times2").datetimepicker({ | |
| 131 | + format : 'HH:mm', | |
| 132 | + locale : 'zh-cn' | |
| 130 | 133 | }); |
| 131 | 134 | |
| 132 | 135 | var d = new Date(); |
| ... | ... | @@ -140,24 +143,52 @@ |
| 140 | 143 | $("#startDate").val(year + "-0" + month + "-" + day); |
| 141 | 144 | $("#endDate").val(year + "-0" + month + "-" + day); |
| 142 | 145 | } |
| 146 | + $("#times1").val("06:00"); | |
| 147 | + $("#times2").val("07:00"); | |
| 148 | + | |
| 149 | + var obj = []; | |
| 150 | + $.get('/user/companyData', function(result){ | |
| 151 | + obj = result; | |
| 152 | + var options = ''; | |
| 153 | + for(var i = 0; i < obj.length; i++){ | |
| 154 | + options += '<option value="'+obj[i].companyCode+'">'+obj[i].companyName+'</option>'; | |
| 155 | + } | |
| 156 | + $('#company').html(options); | |
| 157 | + updateCompany(); | |
| 158 | + }); | |
| 159 | + $("#company").on("change",updateCompany); | |
| 160 | + function updateCompany(){ | |
| 161 | + var company = $('#company').val(); | |
| 162 | + var options = ''; | |
| 163 | + for(var i = 0; i < obj.length; i++){ | |
| 164 | + if(obj[i].companyCode == company){ | |
| 165 | + var children = obj[i].children; | |
| 166 | + for(var j = 0; j < children.length; j++){ | |
| 167 | + options += '<option value="'+children[j].code+'">'+children[j].name+'</option>'; | |
| 168 | + } | |
| 169 | + } | |
| 170 | + } | |
| 171 | + $('#subCompany').html(options); | |
| 172 | + } | |
| 143 | 173 | |
| 144 | 174 | $.get('/basic/lineCode2Name',function(result){ |
| 145 | 175 | var data=[]; |
| 146 | 176 | |
| 177 | + data.push({id: " ", text: "全部线路"}); | |
| 147 | 178 | for(var code in result){ |
| 148 | 179 | data.push({id: code, text: result[code]}); |
| 149 | 180 | } |
| 150 | 181 | console.log(data); |
| 151 | 182 | initPinYinSelect2('#line',data,''); |
| 152 | 183 | |
| 153 | - line = data[0].id; | |
| 184 | + line = ""; | |
| 154 | 185 | updateModel(); |
| 155 | 186 | |
| 156 | 187 | var params = {}; |
| 157 | 188 | params['line'] = line; |
| 158 | 189 | $get('/busInterval/getDir', params, function(result){ |
| 159 | 190 | dirData = createTreeData(result); |
| 160 | - var options = ''; | |
| 191 | + var options = '<option value="">全部方向</option>';; | |
| 161 | 192 | $.each(dirData, function(i, g){ |
| 162 | 193 | options += '<option value="'+g.name+'">'+g.name+'</option>'; |
| 163 | 194 | }); |
| ... | ... | @@ -166,30 +197,22 @@ |
| 166 | 197 | }) |
| 167 | 198 | |
| 168 | 199 | $("#query").on("click", function (){ |
| 169 | - line = $("#line").val(); | |
| 170 | - upDown = $("#upDown").val(); | |
| 171 | - if(line=="" || line==null){ | |
| 172 | - layer.msg("请选择线路"); | |
| 173 | - }else if(upDown==null || upDown==""){ | |
| 174 | - layer.msg("请选择方向"); | |
| 175 | - }else{ | |
| 176 | - jsDoQuery(); | |
| 177 | - } | |
| 200 | + jsDoQuery(); | |
| 178 | 201 | }); |
| 179 | 202 | |
| 180 | 203 | var line = $("#line").val(); |
| 181 | 204 | var startDate = $("#startDate").val(); |
| 182 | 205 | var endDate = $("#endDate").val(); |
| 183 | 206 | var model = $("#model").val(); |
| 184 | - var times = $("#times").val(); | |
| 207 | + var times = $("#times1").val() + "-" + $("#times2").val(); | |
| 185 | 208 | var upDown = $("#upDown").val(); |
| 186 | 209 | function jsDoQuery(pagination){ |
| 187 | 210 | var params = {}; |
| 188 | - line = $("#line").val(); | |
| 211 | +// line = $("#line").val(); | |
| 189 | 212 | startDate = $("#startDate").val(); |
| 190 | 213 | endDate = $("#endDate").val(); |
| 191 | 214 | model = $("#model").val(); |
| 192 | - times = $("#times").val(); | |
| 215 | + times = $("#times1").val() + "-" + $("#times2").val(); | |
| 193 | 216 | upDown = $("#upDown").val(); |
| 194 | 217 | params['line'] = line; |
| 195 | 218 | params['startDate'] = startDate; |
| ... | ... | @@ -204,6 +227,11 @@ |
| 204 | 227 | var tbodyHtml = template('list_timeAndSpeed',{list:result}); |
| 205 | 228 | // 把渲染好的模版html文本追加到表格中 |
| 206 | 229 | $('#forms tbody').html(tbodyHtml); |
| 230 | + _w_table_rowspan("#forms tbody", 1); | |
| 231 | + _w_table_rowspan("#forms tbody", 2); | |
| 232 | + _w_table_rowspan("#forms tbody", 3); | |
| 233 | + _w_table_rowspan("#forms tbody", 4); | |
| 234 | + _w_table_rowspan("#forms tbody", 5); | |
| 207 | 235 | |
| 208 | 236 | }); |
| 209 | 237 | } |
| ... | ... | @@ -217,12 +245,14 @@ |
| 217 | 245 | |
| 218 | 246 | $("#line").on("change", function(){ |
| 219 | 247 | line = $("#line").val(); |
| 248 | + if(line == " ") | |
| 249 | + line = ""; | |
| 220 | 250 | updateModel(); |
| 221 | 251 | var params = {}; |
| 222 | 252 | params['line'] = line; |
| 223 | 253 | $get('/busInterval/getDir', params, function(result){ |
| 224 | 254 | dirData = createTreeData(result); |
| 225 | - var options = ''; | |
| 255 | + var options = '<option value="">全部方向</option>'; | |
| 226 | 256 | $.each(dirData, function(i, g){ |
| 227 | 257 | options += '<option value="'+g.name+'">'+g.name+'</option>'; |
| 228 | 258 | }); |
| ... | ... | @@ -262,6 +292,30 @@ |
| 262 | 292 | } |
| 263 | 293 | |
| 264 | 294 | |
| 295 | + function _w_table_rowspan(_w_table_id, _w_table_colnum){ | |
| 296 | + _w_table_firsttd = ""; | |
| 297 | + _w_table_currenttd = ""; | |
| 298 | + _w_table_SpanNum = 0; | |
| 299 | + _w_table_Obj = jQuery(_w_table_id + " tr td:nth-child(" + _w_table_colnum + ")"); | |
| 300 | + _w_table_Obj.each(function(i){ | |
| 301 | + if(i==0){ | |
| 302 | + _w_table_firsttd = jQuery(this); | |
| 303 | + _w_table_SpanNum = 1; | |
| 304 | + }else{ | |
| 305 | + _w_table_currenttd = jQuery(this); | |
| 306 | + if(_w_table_firsttd.text()==_w_table_currenttd.text()){ | |
| 307 | + _w_table_SpanNum++; | |
| 308 | + _w_table_currenttd.hide(); //remove(); | |
| 309 | + _w_table_firsttd.attr("rowSpan",_w_table_SpanNum); | |
| 310 | + }else{ | |
| 311 | + _w_table_firsttd = jQuery(this); | |
| 312 | + _w_table_SpanNum = 1; | |
| 313 | + } | |
| 314 | + } | |
| 315 | + }); | |
| 316 | + } | |
| 317 | + | |
| 318 | + | |
| 265 | 319 | }); |
| 266 | 320 | |
| 267 | 321 | </script> |
| ... | ... | @@ -271,7 +325,7 @@ |
| 271 | 325 | <td>{{obj.date}}</td> |
| 272 | 326 | <td>{{obj.times}}</td> |
| 273 | 327 | <td>{{obj.company}}</td> |
| 274 | - <td>{{obj.branchCompany}}</td> | |
| 328 | + <td>{{obj.subCompany}}</td> | |
| 275 | 329 | <td>{{obj.line}}</td> |
| 276 | 330 | <td>{{obj.lp}}</td> |
| 277 | 331 | <td>{{obj.qdz_zdz}}</td> | ... | ... |