Commit c21cccbff8965132fee5dd2b8c1b6411fc70d7b6

Authored by 娄高锋
1 parent f992eaea

添加时间段

src/main/java/com/bsth/service/impl/BusIntervalServiceImpl.java
@@ -73,7 +73,6 @@ public class BusIntervalServiceImpl implements BusIntervalService { @@ -73,7 +73,6 @@ public class BusIntervalServiceImpl implements BusIntervalService {
73 if(normal){ 73 if(normal){
74 sql += " and bc_type != 'in' and bc_type != 'out'"; 74 sql += " and bc_type != 'in' and bc_type != 'out'";
75 } 75 }
76 - System.out.println(sql);  
77 76
78 list = jdbcTemplate.query(sql, 77 list = jdbcTemplate.query(sql,
79 new RowMapper<ScheduleRealInfo>(){ 78 new RowMapper<ScheduleRealInfo>(){
@@ -238,6 +237,7 @@ public class BusIntervalServiceImpl implements BusIntervalService { @@ -238,6 +237,7 @@ public class BusIntervalServiceImpl implements BusIntervalService {
238 237
239 String sql = "select start_station_name, end_station_name from bsth_c_line where line_code = '"+line+"'"; 238 String sql = "select start_station_name, end_station_name from bsth_c_line where line_code = '"+line+"'";
240 239
  240 + System.out.println(sql);
241 list = jdbcTemplate.query(sql, 241 list = jdbcTemplate.query(sql,
242 new RowMapper<Map<String, Object>>(){ 242 new RowMapper<Map<String, Object>>(){
243 @Override 243 @Override
@@ -315,8 +315,10 @@ public class BusIntervalServiceImpl implements BusIntervalService { @@ -315,8 +315,10 @@ public class BusIntervalServiceImpl implements BusIntervalService {
315 String endDate = map.get("endDate").toString(); 315 String endDate = map.get("endDate").toString();
316 String model = map.get("model").toString(); 316 String model = map.get("model").toString();
317 String statu = map.get("statu").toString(); 317 String statu = map.get("statu").toString();
318 -// String times = map.get("times").toString(); 318 + String times1 = map.get("times1").toString();
  319 + String times2 = map.get("times2").toString();
319 String type = map.get("type").toString(); 320 String type = map.get("type").toString();
  321 + int sfqr = Integer.valueOf(map.get("sfqr").toString());
320 322
321 if(startDate.length() == 0){ 323 if(startDate.length() == 0){
322 startDate = new SimpleDateFormat("yyyy-MM-dd").format(new Date()); 324 startDate = new SimpleDateFormat("yyyy-MM-dd").format(new Date());
@@ -327,12 +329,18 @@ public class BusIntervalServiceImpl implements BusIntervalService { @@ -327,12 +329,18 @@ public class BusIntervalServiceImpl implements BusIntervalService {
327 if(statu.equals("0")){ 329 if(statu.equals("0")){
328 line = ""; 330 line = "";
329 } 331 }
330 -// if(times.length() == 0){  
331 -// times = "06:00-07:00";  
332 -// }  
333 332
334 - List<ScheduleRealInfo> list = this.getSchedule(company, subCompany, line, startDate, endDate, model, "", true); 333 + List<ScheduleRealInfo> list = this.getSchedule(company, subCompany, line,
  334 + startDate, endDate, model, sfqr==1?times1+"-"+times2:"", true);
335 335
  336 + long time1 = 0;
  337 + long time2 = 0;
  338 + if(sfqr == 1){
  339 + String[] split1 = times1.split(":");
  340 + String[] split2 = times2.split(":");
  341 + time1 = Long.valueOf(split1[0])*60 + Long.valueOf(split1[1]);
  342 + time2 = Long.valueOf(split2[0])*60 + Long.valueOf(split2[1]);
  343 + }
336 String[] date1 = startDate.split("-"); 344 String[] date1 = startDate.split("-");
337 String[] date2 = endDate.split("-"); 345 String[] date2 = endDate.split("-");
338 // startDate = date1[0] + "年" + date1[1] + "月" + date1[2] + "日"; 346 // startDate = date1[0] + "年" + date1[1] + "月" + date1[2] + "日";
@@ -349,6 +357,15 @@ public class BusIntervalServiceImpl implements BusIntervalService { @@ -349,6 +357,15 @@ public class BusIntervalServiceImpl implements BusIntervalService {
349 // int endTime = Integer.valueOf(split[1].split(":")[0])*60 + Integer.valueOf(split[1].split(":")[1]); 357 // int endTime = Integer.valueOf(split[1].split(":")[0])*60 + Integer.valueOf(split[1].split(":")[1]);
350 358
351 for(ScheduleRealInfo schedule : list){ 359 for(ScheduleRealInfo schedule : list){
  360 + String[] split1 = schedule.getFcsj().split(":");
  361 + String[] split2 = schedule.getZdsj().split(":");
  362 + long fcsj = Long.valueOf(split1[0])*60 + Long.valueOf(split1[1]);
  363 + long zdsj = Long.valueOf(split2[0])*60 + Long.valueOf(split2[1]);
  364 + if(sfqr == 1 && (zdsj < time1 || fcsj > time2)){
  365 + continue;
  366 + }
  367 + if(schedule.getXlName() == null || schedule.getXlName().trim().length() == 0)
  368 + continue;
352 String key = schedule.getXlBm() + "/" + schedule.getXlName() + "/" + schedule.getQdzName(); 369 String key = schedule.getXlBm() + "/" + schedule.getXlName() + "/" + schedule.getQdzName();
353 if(!keyMap.containsKey(key)) 370 if(!keyMap.containsKey(key))
354 keyMap.put(key, new ArrayList<ScheduleRealInfo>()); 371 keyMap.put(key, new ArrayList<ScheduleRealInfo>());
@@ -566,8 +583,11 @@ public class BusIntervalServiceImpl implements BusIntervalService { @@ -566,8 +583,11 @@ public class BusIntervalServiceImpl implements BusIntervalService {
566 String statu = map.get("statu").toString(); 583 String statu = map.get("statu").toString();
567 String startDate = map.get("startDate").toString(); 584 String startDate = map.get("startDate").toString();
568 String endDate = map.get("endDate").toString(); 585 String endDate = map.get("endDate").toString();
  586 + String times1 = map.get("times1").toString();
  587 + String times2 = map.get("times2").toString();
569 String model = map.get("model").toString(); 588 String model = map.get("model").toString();
570 String type = map.get("type").toString(); 589 String type = map.get("type").toString();
  590 + int sfqr = Integer.valueOf(map.get("sfqr").toString());
571 591
572 if(startDate.length() == 0){ 592 if(startDate.length() == 0){
573 startDate = new SimpleDateFormat("yyyy-MM-dd").format(new Date()); 593 startDate = new SimpleDateFormat("yyyy-MM-dd").format(new Date());
@@ -588,6 +608,9 @@ public class BusIntervalServiceImpl implements BusIntervalService { @@ -588,6 +608,9 @@ public class BusIntervalServiceImpl implements BusIntervalService {
588 if(company.length() != 0){ 608 if(company.length() != 0){
589 sql += " and gs_bm = '"+company+"' and fgs_bm = '"+subCompany+"'"; 609 sql += " and gs_bm = '"+company+"' and fgs_bm = '"+subCompany+"'";
590 } 610 }
  611 + if(sfqr == 1){
  612 + sql += " and zdsj >= '"+times1+"' and fcsj <= '"+times2+"'";
  613 + }
591 sql += " and bc_type != 'in' and bc_type != 'out' order by fcsj"; 614 sql += " and bc_type != 'in' and bc_type != 'out' order by fcsj";
592 615
593 list = jdbcTemplate.query(sql, 616 list = jdbcTemplate.query(sql,
@@ -698,7 +721,9 @@ public class BusIntervalServiceImpl implements BusIntervalService { @@ -698,7 +721,9 @@ public class BusIntervalServiceImpl implements BusIntervalService {
698 e.printStackTrace(); 721 e.printStackTrace();
699 } 722 }
700 723
701 - 724 +
  725 + long time1 = 0;
  726 + long time2 = 0;
702 String[] date1 = startDate.split("-"); 727 String[] date1 = startDate.split("-");
703 String[] date2 = endDate.split("-"); 728 String[] date2 = endDate.split("-");
704 String date = ""; 729 String date = "";
@@ -710,6 +735,12 @@ public class BusIntervalServiceImpl implements BusIntervalService { @@ -710,6 +735,12 @@ public class BusIntervalServiceImpl implements BusIntervalService {
710 date = date1[0] + "年" + date1[1] + "月" + date1[2] + "日--" + 735 date = date1[0] + "年" + date1[1] + "月" + date1[2] + "日--" +
711 date2[0] + "年" + date2[1] + "月" + date2[2] + "日"; 736 date2[0] + "年" + date2[1] + "月" + date2[2] + "日";
712 } 737 }
  738 + if(sfqr == 1){
  739 + String[] split1 = times1.split(":");
  740 + String[] split2 = times2.split(":");
  741 + time1 = Long.valueOf(split1[0])*60 + Long.valueOf(split1[1]);
  742 + time2 = Long.valueOf(split2[0])*60 + Long.valueOf(split2[1]);
  743 + }
713 744
714 for(ChildTaskPlan cTask : cList){ 745 for(ChildTaskPlan cTask : cList){
715 String key = cTask.getRemarks(); 746 String key = cTask.getRemarks();
@@ -719,6 +750,8 @@ public class BusIntervalServiceImpl implements BusIntervalService { @@ -719,6 +750,8 @@ public class BusIntervalServiceImpl implements BusIntervalService {
719 } 750 }
720 751
721 for(ScheduleRealInfo schedule : list){ 752 for(ScheduleRealInfo schedule : list){
  753 + if(schedule.getXlName()==null || schedule.getXlName().trim().length()==0)
  754 + continue;
722 if(model.length() != 0){ 755 if(model.length() != 0){
723 for(Long tt : ttList) 756 for(Long tt : ttList)
724 if((long) tt == (long)schedule.getSpId()){ 757 if((long) tt == (long)schedule.getSpId()){
@@ -744,6 +777,8 @@ public class BusIntervalServiceImpl implements BusIntervalService { @@ -744,6 +777,8 @@ public class BusIntervalServiceImpl implements BusIntervalService {
744 List<ScheduleRealInfo> list2 = keyMap.get(key); 777 List<ScheduleRealInfo> list2 = keyMap.get(key);
745 long jhyysj = 0, sjyysj = 0; 778 long jhyysj = 0, sjyysj = 0;
746 long jhyssj = 0, sjyssj = 0; 779 long jhyssj = 0, sjyssj = 0;
  780 + long jhyysj1 = 0, sjyysj1 = 0;
  781 + long jhyssj1 = 0, sjyssj1 = 0;
747 double jhlc = 0, sjlc = 0; 782 double jhlc = 0, sjlc = 0;
748 for(ScheduleRealInfo schedule : list2){ 783 for(ScheduleRealInfo schedule : list2){
749 if(companyName.length() == 0 && schedule.getGsName() != null){ 784 if(companyName.length() == 0 && schedule.getGsName() != null){
@@ -766,20 +801,40 @@ public class BusIntervalServiceImpl implements BusIntervalService { @@ -766,20 +801,40 @@ public class BusIntervalServiceImpl implements BusIntervalService {
766 for(int i = 1; i < keyList.size(); i++){ 801 for(int i = 1; i < keyList.size(); i++){
767 ScheduleRealInfo schedule1 = sortMap.get(keyList.get(i - 1)); 802 ScheduleRealInfo schedule1 = sortMap.get(keyList.get(i - 1));
768 ScheduleRealInfo schedule2 = sortMap.get(keyList.get(i)); 803 ScheduleRealInfo schedule2 = sortMap.get(keyList.get(i));
769 - jhyysj += schedule2.getFcsjT() - schedule1.getFcsjT();  
770 - 804 + if(sfqr == 1 && time1 > schedule1.getFcsjT()){
  805 + jhyysj += schedule2.getFcsjT() - time1;
  806 + }else if(sfqr == 1 && time2 < schedule2.getFcsjT()){
  807 + jhyysj += time2 - schedule1.getFcsjT();
  808 + }else{
  809 + jhyysj += schedule2.getFcsjT() - schedule1.getFcsjT();
  810 + }
  811 + jhyysj1 += schedule2.getFcsjT() - schedule1.getFcsjT();
771 long zdsj2 = schedule2.getZdsjT(); 812 long zdsj2 = schedule2.getZdsjT();
772 long fcsj2 = schedule2.getFcsjT(); 813 long fcsj2 = schedule2.getFcsjT();
773 if(fcsj2 > zdsj2) 814 if(fcsj2 > zdsj2)
774 zdsj2 += 1440l; 815 zdsj2 += 1440l;
775 - jhyssj += zdsj2 - fcsj2; 816 + if(sfqr == 1 && time1 > fcsj2){
  817 + jhyssj += zdsj2 - time1;
  818 + }else if(sfqr == 1 && time2 < zdsj2){
  819 + jhyssj += time2 - fcsj2;
  820 + }else{
  821 + jhyssj += zdsj2 - fcsj2;
  822 + }
  823 + jhyssj1 += zdsj2 - fcsj2;
776 jhlc += schedule2.getJhlc()==null?0:schedule2.getJhlc(); 824 jhlc += schedule2.getJhlc()==null?0:schedule2.getJhlc();
777 if(i == 1){ 825 if(i == 1){
778 long zdsj1 = schedule1.getZdsjT(); 826 long zdsj1 = schedule1.getZdsjT();
779 long fcsj1 = schedule1.getFcsjT(); 827 long fcsj1 = schedule1.getFcsjT();
780 if(fcsj1 > zdsj1) 828 if(fcsj1 > zdsj1)
781 zdsj1 += 1440l; 829 zdsj1 += 1440l;
782 - jhyssj += zdsj1 - fcsj1; 830 + if(sfqr == 1 && time1 > fcsj1){
  831 + jhyssj += zdsj1 - time1;
  832 + }else if(sfqr == 1 && time2 < zdsj1){
  833 + jhyssj += time1 - fcsj1;
  834 + }else{
  835 + jhyssj += zdsj1 - fcsj1;
  836 + }
  837 + jhyssj1 += zdsj1 - fcsj1;
783 jhlc += schedule1.getJhlc()==null?0:schedule1.getJhlc(); 838 jhlc += schedule1.getJhlc()==null?0:schedule1.getJhlc();
784 } 839 }
785 } 840 }
@@ -834,22 +889,45 @@ public class BusIntervalServiceImpl implements BusIntervalService { @@ -834,22 +889,45 @@ public class BusIntervalServiceImpl implements BusIntervalService {
834 Map<String, Object> m1 = mapList.get(i - 1); 889 Map<String, Object> m1 = mapList.get(i - 1);
835 Map<String, Object> m2 = mapList.get(i); 890 Map<String, Object> m2 = mapList.get(i);
836 if(m1.get("fcsj") != null && m2.get("fcsj") != null){ 891 if(m1.get("fcsj") != null && m2.get("fcsj") != null){
837 - sjyysj += Long.valueOf(m2.get("fcsj").toString()) - Long.valueOf(m1.get("fcsj").toString()); 892 + long fcsj2 = Long.valueOf(m2.get("fcsj").toString());
  893 + long fcsj1 = Long.valueOf(m1.get("fcsj").toString());
  894 + if(sfqr == 1 && time1 > fcsj1){
  895 + sjyysj += fcsj2 - time1;
  896 + }else if(sfqr == 1 && time2 < fcsj2){
  897 + sjyysj += time2 - fcsj1;
  898 + }else{
  899 + sjyysj += fcsj2 - fcsj1;
  900 + }
  901 + sjyysj1 += fcsj2 - fcsj1;
838 } 902 }
839 - if(m2.get("fcsj") != null){ 903 + if(m2.get("fcsj") != null && m2.get("zdsj") != null){
840 long zdsj = Long.valueOf(m2.get("zdsj").toString()); 904 long zdsj = Long.valueOf(m2.get("zdsj").toString());
841 long fcsj = Long.valueOf(m2.get("fcsj").toString()); 905 long fcsj = Long.valueOf(m2.get("fcsj").toString());
842 if(fcsj > zdsj) 906 if(fcsj > zdsj)
843 zdsj += 1440l; 907 zdsj += 1440l;
844 - sjyssj += zdsj - fcsj; 908 + if(sfqr == 1 && time1 > fcsj){
  909 + sjyssj += zdsj - time1;
  910 + }else if(sfqr == 1 && time2 < zdsj){
  911 + sjyssj += zdsj - fcsj;
  912 + }else{
  913 + sjyssj += zdsj - fcsj;
  914 + }
  915 + sjyssj1 += zdsj - fcsj;
845 sjlc += Double.valueOf(m2.get("lc").toString()); 916 sjlc += Double.valueOf(m2.get("lc").toString());
846 } 917 }
847 - if(i == 1 && m1.get("fcsj") != null){ 918 + if(i == 1 && m1.get("fcsj") != null && m1.get("zdsj") != null){
848 long zdsj = Long.valueOf(m1.get("zdsj").toString()); 919 long zdsj = Long.valueOf(m1.get("zdsj").toString());
849 long fcsj = Long.valueOf(m1.get("fcsj").toString()); 920 long fcsj = Long.valueOf(m1.get("fcsj").toString());
850 if(fcsj > zdsj) 921 if(fcsj > zdsj)
851 zdsj += 1440l; 922 zdsj += 1440l;
852 - sjyssj += zdsj - fcsj; 923 + if(sfqr == 1 && time1 > fcsj){
  924 + sjyssj += zdsj - time1;
  925 + }else if(sfqr == 1 && time2 < zdsj){
  926 + sjyssj += time2 - fcsj;
  927 + }else{
  928 + sjyssj += zdsj - fcsj;
  929 + }
  930 + sjyssj1 += zdsj - fcsj;
853 sjlc += Double.valueOf(m1.get("lc").toString()); 931 sjlc += Double.valueOf(m1.get("lc").toString());
854 } 932 }
855 } 933 }
@@ -867,7 +945,7 @@ public class BusIntervalServiceImpl implements BusIntervalService { @@ -867,7 +945,7 @@ public class BusIntervalServiceImpl implements BusIntervalService {
867 tempMap.put("jhyycs", "0"); 945 tempMap.put("jhyycs", "0");
868 } else { 946 } else {
869 tempMap.put("jhyysj", df.format((float)jhyysj / 60)); 947 tempMap.put("jhyysj", df.format((float)jhyysj / 60));
870 - tempMap.put("jhyycs", df.format(jhlc == 0 ? 0 : jhlc / jhyysj * 60)); 948 + tempMap.put("jhyycs", df.format(jhlc == 0 ? 0 : jhlc / jhyysj1 * 60));
871 } 949 }
872 950
873 if(jhyssj == 0){ 951 if(jhyssj == 0){
@@ -875,7 +953,7 @@ public class BusIntervalServiceImpl implements BusIntervalService { @@ -875,7 +953,7 @@ public class BusIntervalServiceImpl implements BusIntervalService {
875 tempMap.put("jhyscs", "0"); 953 tempMap.put("jhyscs", "0");
876 } else { 954 } else {
877 tempMap.put("jhyssj", df.format((float)jhyssj / 60)); 955 tempMap.put("jhyssj", df.format((float)jhyssj / 60));
878 - tempMap.put("jhyscs", df.format(jhlc == 0 ? 0 : jhlc / jhyssj * 60)); 956 + tempMap.put("jhyscs", df.format(jhlc == 0 ? 0 : jhlc / jhyssj1 * 60));
879 } 957 }
880 958
881 if(sjyysj == 0){ 959 if(sjyysj == 0){
@@ -883,7 +961,7 @@ public class BusIntervalServiceImpl implements BusIntervalService { @@ -883,7 +961,7 @@ public class BusIntervalServiceImpl implements BusIntervalService {
883 tempMap.put("sjyycs", "0"); 961 tempMap.put("sjyycs", "0");
884 } else { 962 } else {
885 tempMap.put("sjyysj", df.format((float)sjyysj / 60)); 963 tempMap.put("sjyysj", df.format((float)sjyysj / 60));
886 - tempMap.put("sjyycs", df.format(sjlc == 0 ? 0 : sjlc / sjyysj * 60)); 964 + tempMap.put("sjyycs", df.format(sjlc == 0 ? 0 : sjlc / sjyysj1 * 60));
887 } 965 }
888 966
889 if(sjyssj == 0){ 967 if(sjyssj == 0){
@@ -891,8 +969,16 @@ public class BusIntervalServiceImpl implements BusIntervalService { @@ -891,8 +969,16 @@ public class BusIntervalServiceImpl implements BusIntervalService {
891 tempMap.put("sjyscs", "0"); 969 tempMap.put("sjyscs", "0");
892 } else { 970 } else {
893 tempMap.put("sjyssj", df.format((float)sjyssj / 60)); 971 tempMap.put("sjyssj", df.format((float)sjyssj / 60));
894 - tempMap.put("sjyscs", df.format(sjlc == 0 ? 0 : sjlc / sjyssj * 60)); 972 + tempMap.put("sjyscs", df.format(sjlc == 0 ? 0 : sjlc / sjyssj1 * 60));
895 } 973 }
  974 + if(!tempMap.get("jhyysj").equals("0"))
  975 + if(!tempMap.get("jhyycs").equals("0"))
  976 + if(!tempMap.get("jhyssj").equals("0"))
  977 + if(!tempMap.get("jhyscs").equals("0"))
  978 + if(!tempMap.get("sjyysj").equals("0"))
  979 + if(!tempMap.get("sjyycs").equals("0"))
  980 + if(!tempMap.get("sjyssj").equals("0"))
  981 + if(!tempMap.get("sjyscs").equals("0"))
896 resList.add(tempMap); 982 resList.add(tempMap);
897 } 983 }
898 Map<String, List<Map<String, Object>>> keyMap2 = new HashMap<String, List<Map<String, Object>>>(); 984 Map<String, List<Map<String, Object>>> keyMap2 = new HashMap<String, List<Map<String, Object>>>();
@@ -1124,7 +1210,7 @@ public class BusIntervalServiceImpl implements BusIntervalService { @@ -1124,7 +1210,7 @@ public class BusIntervalServiceImpl implements BusIntervalService {
1124 endDate = new SimpleDateFormat("yyyy-MM-dd").format(new Date()); 1210 endDate = new SimpleDateFormat("yyyy-MM-dd").format(new Date());
1125 } 1211 }
1126 if(times.length() == 0){ 1212 if(times.length() == 0){
1127 - times = "06:00-07:00"; 1213 + times = "05:00-23:00";
1128 } 1214 }
1129 1215
1130 list = getSchedule(company, subCompany, line, startDate, endDate, model, times, true); 1216 list = getSchedule(company, subCompany, line, startDate, endDate, model, times, true);
@@ -1387,6 +1473,7 @@ public class BusIntervalServiceImpl implements BusIntervalService { @@ -1387,6 +1473,7 @@ public class BusIntervalServiceImpl implements BusIntervalService {
1387 String model = map.get("model").toString(); 1473 String model = map.get("model").toString();
1388 String times = map.get("times").toString(); 1474 String times = map.get("times").toString();
1389 String type = map.get("type").toString(); 1475 String type = map.get("type").toString();
  1476 + int sfqr = Integer.valueOf(map.get("sfqr").toString());
1390 1477
1391 if(startDate.length() == 0){ 1478 if(startDate.length() == 0){
1392 startDate = new SimpleDateFormat("yyyy-MM-dd").format(new Date()); 1479 startDate = new SimpleDateFormat("yyyy-MM-dd").format(new Date());
@@ -1395,10 +1482,10 @@ public class BusIntervalServiceImpl implements BusIntervalService { @@ -1395,10 +1482,10 @@ public class BusIntervalServiceImpl implements BusIntervalService {
1395 endDate = new SimpleDateFormat("yyyy-MM-dd").format(new Date()); 1482 endDate = new SimpleDateFormat("yyyy-MM-dd").format(new Date());
1396 } 1483 }
1397 if(times.length() == 0){ 1484 if(times.length() == 0){
1398 - times = "06:00-07:00"; 1485 + times = "05:00-23:00";
1399 } 1486 }
1400 1487
1401 - list = getSchedule(company, subCompany, line, startDate, endDate, model, times, true); 1488 + list = getSchedule(company, subCompany, line, startDate, endDate, model, sfqr==1?times:"", true);
1402 1489
1403 String[] date1 = startDate.split("-"); 1490 String[] date1 = startDate.split("-");
1404 String[] date2 = endDate.split("-"); 1491 String[] date2 = endDate.split("-");
@@ -1417,7 +1504,7 @@ public class BusIntervalServiceImpl implements BusIntervalService { @@ -1417,7 +1504,7 @@ public class BusIntervalServiceImpl implements BusIntervalService {
1417 1504
1418 for(ScheduleRealInfo schedule : list){ 1505 for(ScheduleRealInfo schedule : list){
1419 Long fcsj = schedule.getFcsjT(); 1506 Long fcsj = schedule.getFcsjT();
1420 - if(!(endTime!=0?fcsj>=startTime&&fcsj<endTime:fcsj>=startTime)){ 1507 + if(sfqr == 1 && !(endTime!=0?fcsj>=startTime&&fcsj<endTime:fcsj>=startTime)){
1421 continue; 1508 continue;
1422 } 1509 }
1423 String key = schedule.getXlName(); 1510 String key = schedule.getXlName();
@@ -1571,6 +1658,7 @@ public class BusIntervalServiceImpl implements BusIntervalService { @@ -1571,6 +1658,7 @@ public class BusIntervalServiceImpl implements BusIntervalService {
1571 String endDate = map.get("endDate").toString(); 1658 String endDate = map.get("endDate").toString();
1572 String times = map.get("times").toString(); 1659 String times = map.get("times").toString();
1573 String type = map.get("type").toString(); 1660 String type = map.get("type").toString();
  1661 + int sfqr = Integer.valueOf(map.get("sfqr").toString());
1574 1662
1575 if(startDate.length() == 0){ 1663 if(startDate.length() == 0){
1576 startDate = new SimpleDateFormat("yyyy-MM-dd").format(new Date()); 1664 startDate = new SimpleDateFormat("yyyy-MM-dd").format(new Date());
@@ -1584,7 +1672,7 @@ public class BusIntervalServiceImpl implements BusIntervalService { @@ -1584,7 +1672,7 @@ public class BusIntervalServiceImpl implements BusIntervalService {
1584 if(line.length() != 0){ 1672 if(line.length() != 0){
1585 sql += " and xl_bm = '"+line+"'"; 1673 sql += " and xl_bm = '"+line+"'";
1586 } 1674 }
1587 - if(times.length() != 0){ 1675 + if(sfqr == 1 && times.length() != 0){
1588 String[] split = times.split("-"); 1676 String[] split = times.split("-");
1589 String[] split0 = split[0].split(":"); 1677 String[] split0 = split[0].split(":");
1590 String[] split1 = split[1].split(":"); 1678 String[] split1 = split[1].split(":");
@@ -1651,6 +1739,8 @@ public class BusIntervalServiceImpl implements BusIntervalService { @@ -1651,6 +1739,8 @@ public class BusIntervalServiceImpl implements BusIntervalService {
1651 date = startDate + "--" + endDate; 1739 date = startDate + "--" + endDate;
1652 1740
1653 for(ScheduleRealInfo schedule : list){ 1741 for(ScheduleRealInfo schedule : list){
  1742 + if(schedule.getXlName() == null || schedule.getXlName().trim().length() == 0)
  1743 + continue;
1654 String key = schedule.getGsName() + "/" + schedule.getFgsName() + "/" + schedule.getXlName(); 1744 String key = schedule.getGsName() + "/" + schedule.getFgsName() + "/" + schedule.getXlName();
1655 if(!keyMap.containsKey(key)) 1745 if(!keyMap.containsKey(key))
1656 keyMap.put(key, new ArrayList<ScheduleRealInfo>()); 1746 keyMap.put(key, new ArrayList<ScheduleRealInfo>());