Commit ac4452a2bc96a46fb76b6b71f66e23d8a0330b4f

Authored by 潘钊
2 parents 0456d096 b855b368

Merge branch 'minhang' of http://222.66.0.204:8090/panzhaov5/bsth_control into minhang

src/main/java/com/bsth/entity/schedule/temp/SchedulePlanRuleResult.java
@@ -27,20 +27,22 @@ public class SchedulePlanRuleResult { @@ -27,20 +27,22 @@ public class SchedulePlanRuleResult {
27 27
28 /** 排班规则id */ 28 /** 排班规则id */
29 private String ruleId; 29 private String ruleId;
30 - /** 启用日期 */ 30 + /** 启用日期(用于md5计算) */
31 private Date qyrq; 31 private Date qyrq;
32 /** 车辆配置id */ 32 /** 车辆配置id */
33 private String ccId; 33 private String ccId;
34 /** 车辆自编号 */ 34 /** 车辆自编号 */
35 private String ccZbh; 35 private String ccZbh;
36 36
37 - /** 路牌id列表字符串 */ 37 + /** 路牌id列表字符串(用于md5计算) */
38 @Column(length = 1000) 38 @Column(length = 1000)
39 private String gids; 39 private String gids;
40 /** 路牌名字列表字符串 */ 40 /** 路牌名字列表字符串 */
41 private String gnames; 41 private String gnames;
42 /** 翻到哪个路牌索引 */ 42 /** 翻到哪个路牌索引 */
43 private String gidindex; 43 private String gidindex;
  44 + /** 原始的起始路牌索引(用于md5计算) */
  45 + private String origingidindex;
44 /** 人员配置id列表字符串 */ 46 /** 人员配置id列表字符串 */
45 @Column(length = 1000) 47 @Column(length = 1000)
46 private String ecids; 48 private String ecids;
@@ -81,8 +83,8 @@ public class SchedulePlanRuleResult { @@ -81,8 +83,8 @@ public class SchedulePlanRuleResult {
81 "(xl_id,xl_name,rule_id,cc_id,cc_zbh," + 83 "(xl_id,xl_name,rule_id,cc_id,cc_zbh," +
82 "gids,gnames,gidindex,ecids,ecdbbms,ecindex," + 84 "gids,gnames,gidindex,ecids,ecdbbms,ecindex," +
83 "ttinfo_id,ttinfo_name,schedule_date," + 85 "ttinfo_id,ttinfo_name,schedule_date," +
84 - "sysuser_id,sysuser_name,create_date, qyrq) " +  
85 - "values (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)"; 86 + "sysuser_id,sysuser_name,create_date, qyrq, origingidindex) " +
  87 + "values (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
86 88
87 return sql; 89 return sql;
88 } 90 }
@@ -106,7 +108,7 @@ public class SchedulePlanRuleResult { @@ -106,7 +108,7 @@ public class SchedulePlanRuleResult {
106 ps.setString(16, this.getSysuserName()); 108 ps.setString(16, this.getSysuserName());
107 ps.setTimestamp(17, new java.sql.Timestamp(this.getCreateDate().getTime())); 109 ps.setTimestamp(17, new java.sql.Timestamp(this.getCreateDate().getTime()));
108 ps.setDate(18, new java.sql.Date(this.getQyrq().getTime())); 110 ps.setDate(18, new java.sql.Date(this.getQyrq().getTime()));
109 - 111 + ps.setString(19, this.getOrigingidindex());
110 112
111 } 113 }
112 114
@@ -261,4 +263,12 @@ public class SchedulePlanRuleResult { @@ -261,4 +263,12 @@ public class SchedulePlanRuleResult {
261 public void setQyrq(Date qyrq) { 263 public void setQyrq(Date qyrq) {
262 this.qyrq = qyrq; 264 this.qyrq = qyrq;
263 } 265 }
  266 +
  267 + public String getOrigingidindex() {
  268 + return origingidindex;
  269 + }
  270 +
  271 + public void setOrigingidindex(String origingidindex) {
  272 + this.origingidindex = origingidindex;
  273 + }
264 } 274 }
src/main/java/com/bsth/service/impl/BusIntervalServiceImpl.java
@@ -1569,7 +1569,7 @@ public class BusIntervalServiceImpl implements BusIntervalService { @@ -1569,7 +1569,7 @@ public class BusIntervalServiceImpl implements BusIntervalService {
1569 1569
1570 jhbc++; 1570 jhbc++;
1571 jhlc += lc; 1571 jhlc += lc;
1572 - if(schedule.getStatus() == 2){ 1572 + if(schedule.getStatus() != -1){
1573 sjbc++; 1573 sjbc++;
1574 sjlc += lc; 1574 sjlc += lc;
1575 } else if(schedule.getStatus() == -1){ 1575 } else if(schedule.getStatus() == -1){
@@ -1622,37 +1622,37 @@ public class BusIntervalServiceImpl implements BusIntervalService { @@ -1622,37 +1622,37 @@ public class BusIntervalServiceImpl implements BusIntervalService {
1622 tempMap.put("lcbfb", df.format(jhlc>0?(double)sjlc/jhlc*100:0)+"%"); 1622 tempMap.put("lcbfb", df.format(jhlc>0?(double)sjlc/jhlc*100:0)+"%");
1623 tempMap.put("lzbc", lzbc); 1623 tempMap.put("lzbc", lzbc);
1624 tempMap.put("lzlc", lzlc); 1624 tempMap.put("lzlc", lzlc);
1625 - tempMap.put("lzbfb", df.format(jhlc>0?(double)lzlc/jhlc*100:0)+"%"); 1625 + tempMap.put("lzbfb", df.format(jhlc>0?(double)lzbc/jhbc*100:0)+"%");
1626 tempMap.put("dmbc", dmbc); 1626 tempMap.put("dmbc", dmbc);
1627 tempMap.put("dmlc", dmlc); 1627 tempMap.put("dmlc", dmlc);
1628 - tempMap.put("dmbfb", df.format(jhlc>0?(double)dmlc/jhlc*100:0)+"%"); 1628 + tempMap.put("dmbfb", df.format(jhlc>0?(double)dmbc/jhbc*100:0)+"%");
1629 tempMap.put("gzbc", gzbc); 1629 tempMap.put("gzbc", gzbc);
1630 tempMap.put("gzlc", gzlc); 1630 tempMap.put("gzlc", gzlc);
1631 - tempMap.put("gzbfb", df.format(jhlc>0?(double)gzlc/jhlc*100:0)+"%"); 1631 + tempMap.put("gzbfb", df.format(jhlc>0?(double)gzbc/jhbc*100:0)+"%");
1632 tempMap.put("jfbc", jfbc); 1632 tempMap.put("jfbc", jfbc);
1633 tempMap.put("jflc", jflc); 1633 tempMap.put("jflc", jflc);
1634 - tempMap.put("jfbfb", df.format(jhlc>0?(double)jflc/jhlc*100:0)+"%"); 1634 + tempMap.put("jfbfb", df.format(jhlc>0?(double)jfbc/jhbc*100:0)+"%");
1635 tempMap.put("zsbc", zsbc); 1635 tempMap.put("zsbc", zsbc);
1636 tempMap.put("zslc", zslc); 1636 tempMap.put("zslc", zslc);
1637 - tempMap.put("zsbfb", df.format(jhlc>0?(double)zslc/jhlc*100:0)+"%"); 1637 + tempMap.put("zsbfb", df.format(jhlc>0?(double)zsbc/jhbc*100:0)+"%");
1638 tempMap.put("qrbc", qrbc); 1638 tempMap.put("qrbc", qrbc);
1639 tempMap.put("qrlc", qrlc); 1639 tempMap.put("qrlc", qrlc);
1640 - tempMap.put("qrbfb", df.format(jhlc>0?(double)qrlc/jhlc*100:0)+"%"); 1640 + tempMap.put("qrbfb", df.format(jhlc>0?(double)qrbc/jhbc*100:0)+"%");
1641 tempMap.put("qcbc", qcbc); 1641 tempMap.put("qcbc", qcbc);
1642 tempMap.put("qclc", qclc); 1642 tempMap.put("qclc", qclc);
1643 - tempMap.put("qcbfb", df.format(jhlc>0?(double)qclc/jhlc*100:0)+"%"); 1643 + tempMap.put("qcbfb", df.format(jhlc>0?(double)qcbc/jhbc*100:0)+"%");
1644 tempMap.put("kxbc", kxbc); 1644 tempMap.put("kxbc", kxbc);
1645 tempMap.put("kxlc", kxlc); 1645 tempMap.put("kxlc", kxlc);
1646 - tempMap.put("kxbfb", df.format(jhlc>0?(double)kxlc/jhlc*100:0)+"%"); 1646 + tempMap.put("kxbfb", df.format(jhlc>0?(double)kxbc/jhbc*100:0)+"%");
1647 tempMap.put("qhbc", qhbc); 1647 tempMap.put("qhbc", qhbc);
1648 tempMap.put("qhlc", qhlc); 1648 tempMap.put("qhlc", qhlc);
1649 - tempMap.put("qhbfb", df.format(jhlc>0?(double)qhlc/jhlc*100:0)+"%"); 1649 + tempMap.put("qhbfb", df.format(jhlc>0?(double)qhbc/jhbc*100:0)+"%");
1650 tempMap.put("wybc", wybc); 1650 tempMap.put("wybc", wybc);
1651 tempMap.put("wylc", wylc); 1651 tempMap.put("wylc", wylc);
1652 - tempMap.put("wybfb", df.format(jhlc>0?(double)wylc/jhlc*100:0)+"%"); 1652 + tempMap.put("wybfb", df.format(jhlc>0?(double)wybc/jhbc*100:0)+"%");
1653 tempMap.put("qtbc", qtbc); 1653 tempMap.put("qtbc", qtbc);
1654 tempMap.put("qtlc", qtlc); 1654 tempMap.put("qtlc", qtlc);
1655 - tempMap.put("qtbfb", df.format(jhlc>0?(double)qtlc/jhlc*100:0)+"%"); 1655 + tempMap.put("qtbfb", df.format(jhlc>0?(double)qtbc/jhbc*100:0)+"%");
1656 1656
1657 resList.add(tempMap); 1657 resList.add(tempMap);
1658 } 1658 }
src/main/java/com/bsth/service/schedule/impl/PeopleCarPlanServiceImpl.java
1 package com.bsth.service.schedule.impl; 1 package com.bsth.service.schedule.impl;
2 2
3 -import com.bsth.entity.realcontrol.ScheduleRealInfo;  
4 -import com.bsth.entity.schedule.SchedulePlanInfo;  
5 -import com.bsth.repository.realcontrol.ScheduleRealInfoRepository;  
6 -import com.bsth.util.ReportUtils;  
7 -import org.springframework.beans.factory.annotation.Autowired;  
8 -import org.springframework.jdbc.core.JdbcTemplate;  
9 -import org.springframework.jdbc.core.RowMapper;  
10 -import org.springframework.stereotype.Service;  
11 -  
12 import java.math.BigDecimal; 3 import java.math.BigDecimal;
  4 +import java.net.URLEncoder;
13 import java.sql.ResultSet; 5 import java.sql.ResultSet;
14 import java.sql.SQLException; 6 import java.sql.SQLException;
15 import java.text.DecimalFormat; 7 import java.text.DecimalFormat;
16 import java.text.NumberFormat; 8 import java.text.NumberFormat;
17 import java.text.ParseException; 9 import java.text.ParseException;
18 import java.text.SimpleDateFormat; 10 import java.text.SimpleDateFormat;
19 -import java.util.*;  
20 - 11 +import java.util.ArrayList;
  12 +import java.util.Collections;
  13 +import java.util.Date;
  14 +import java.util.HashMap;
  15 +import java.util.HashSet;
  16 +import java.util.Iterator;
  17 +import java.util.List;
  18 +import java.util.Map;
  19 +import java.util.Set;
21 20
22 import org.springframework.beans.factory.annotation.Autowired; 21 import org.springframework.beans.factory.annotation.Autowired;
23 import org.springframework.jdbc.core.JdbcTemplate; 22 import org.springframework.jdbc.core.JdbcTemplate;
@@ -404,20 +403,22 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { @@ -404,20 +403,22 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
404 } 403 }
405 } 404 }
406 405
407 - if(!schedule.getBcType().equals("in") && !schedule.getBcType().equals("out")){  
408 - String clZbh = schedule.getClZbh();  
409 - if(!listMap.containsKey(clZbh))  
410 - listMap.put(clZbh, new ArrayList<ScheduleRealInfo>());  
411 - listMap.get(clZbh).add(schedule); 406 + if(!schedule.getBcType().equals("in") && !schedule.getBcType().equals("out")
  407 + && schedule.getFcsjActual() != null){
  408 +// String clZbh = schedule.getClZbh();
  409 + String xlDir = schedule.getXlDir();
  410 + if(!listMap.containsKey(xlDir))
  411 + listMap.put(xlDir, new ArrayList<ScheduleRealInfo>());
  412 + listMap.get(xlDir).add(schedule);
412 } 413 }
413 } 414 }
414 415
415 //求首末班准点率 416 //求首末班准点率
416 - for(String clZbh : listMap.keySet()){ 417 + for(String xlDir : listMap.keySet()){
417 Map<Integer, ScheduleRealInfo> temp = new HashMap<Integer, ScheduleRealInfo>(); 418 Map<Integer, ScheduleRealInfo> temp = new HashMap<Integer, ScheduleRealInfo>();
418 List <ScheduleRealInfo> tempList = new ArrayList<ScheduleRealInfo>(); 419 List <ScheduleRealInfo> tempList = new ArrayList<ScheduleRealInfo>();
419 List<Integer> sort = new ArrayList<Integer>(); 420 List<Integer> sort = new ArrayList<Integer>();
420 - for(ScheduleRealInfo schedule : listMap.get(clZbh)){ 421 + for(ScheduleRealInfo schedule : listMap.get(xlDir)){
421 String[] split = schedule.getFcsj().split(":"); 422 String[] split = schedule.getFcsj().split(":");
422 int min = Integer.valueOf(split[0])*60 + Integer.valueOf(split[1]); 423 int min = Integer.valueOf(split[0])*60 + Integer.valueOf(split[1]);
423 temp.put(min, schedule); 424 temp.put(min, schedule);
@@ -762,7 +763,7 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { @@ -762,7 +763,7 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
762 return modelMap; 763 return modelMap;
763 } 764 }
764 765
765 -// @Override 766 + @Override
766 public Map<String, Object> scheduleAnaly_sum(Map<String, Object> map) { 767 public Map<String, Object> scheduleAnaly_sum(Map<String, Object> map) {
767 DecimalFormat df = new DecimalFormat("00"); 768 DecimalFormat df = new DecimalFormat("00");
768 NumberFormat nf = NumberFormat.getNumberInstance(); 769 NumberFormat nf = NumberFormat.getNumberInstance();
@@ -867,101 +868,122 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { @@ -867,101 +868,122 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
867 { 868 {
868 Map<String, Object> m0 = new HashMap<String, Object>(); 869 Map<String, Object> m0 = new HashMap<String, Object>();
869 m0.put("time", "首~6:30"); 870 m0.put("time", "首~6:30");
870 - m0.put("upbc", "0");m0.put("dnbc", "0");  
871 - m0.put("upys", "--");m0.put("dnys", "--"); 871 + m0.put("upbc", "0"); m0.put("dnbc", "0");
  872 + m0.put("upys", "--"); m0.put("dnys", "--");
872 m0.put("pjys", "--"); 873 m0.put("pjys", "--");
873 tempList.add(m0); 874 tempList.add(m0);
874 Map<String, Object> m1 = new HashMap<String, Object>(); 875 Map<String, Object> m1 = new HashMap<String, Object>();
875 m1.put("time", "6:31~8:30"); 876 m1.put("time", "6:31~8:30");
876 - m1.put("upbc", "0");m1.put("dnbc", "0");  
877 - m1.put("upys", "--");m1.put("dnys", "--"); 877 + m1.put("upbc", "0"); m1.put("dnbc", "0");
  878 + m1.put("upys", "--"); m1.put("dnys", "--");
878 m1.put("pjys", "--"); 879 m1.put("pjys", "--");
879 tempList.add(m1); 880 tempList.add(m1);
880 Map<String, Object> m2 = new HashMap<String, Object>(); 881 Map<String, Object> m2 = new HashMap<String, Object>();
881 m2.put("time", "8:31~11:00"); 882 m2.put("time", "8:31~11:00");
882 - m2.put("upbc", "0");m2.put("dnbc", "0");  
883 - m2.put("upys", "--");m2.put("dnys", "--"); 883 + m2.put("upbc", "0"); m2.put("dnbc", "0");
  884 + m2.put("upys", "--"); m2.put("dnys", "--");
884 m2.put("pjys", "--"); 885 m2.put("pjys", "--");
885 tempList.add(m2); 886 tempList.add(m2);
886 Map<String, Object> m3 = new HashMap<String, Object>(); 887 Map<String, Object> m3 = new HashMap<String, Object>();
887 m3.put("time", "11:01~13:30"); 888 m3.put("time", "11:01~13:30");
888 - m3.put("upbc", "0");m3.put("dnbc", "0");  
889 - m3.put("upys", "--");m3.put("dnys", "--"); 889 + m3.put("upbc", "0"); m3.put("dnbc", "0");
  890 + m3.put("upys", "--"); m3.put("dnys", "--");
890 m3.put("pjys", "--"); 891 m3.put("pjys", "--");
891 tempList.add(m3); 892 tempList.add(m3);
892 Map<String, Object> m4 = new HashMap<String, Object>(); 893 Map<String, Object> m4 = new HashMap<String, Object>();
893 m4.put("time", "13:31~16:00"); 894 m4.put("time", "13:31~16:00");
894 - m4.put("upbc", "0");m4.put("dnbc", "0");  
895 - m4.put("upys", "--");m4.put("dnys", "--"); 895 + m4.put("upbc", "0"); m4.put("dnbc", "0");
  896 + m4.put("upys", "--"); m4.put("dnys", "--");
896 m4.put("pjys", "--"); 897 m4.put("pjys", "--");
897 tempList.add(m4); 898 tempList.add(m4);
898 Map<String, Object> m5 = new HashMap<String, Object>(); 899 Map<String, Object> m5 = new HashMap<String, Object>();
899 m5.put("time", "16:01~18:00"); 900 m5.put("time", "16:01~18:00");
900 - m5.put("upbc", "0");m5.put("dnbc", "0");  
901 - m5.put("upys", "--");m5.put("dnys", "--"); 901 + m5.put("upbc", "0"); m5.put("dnbc", "0");
  902 + m5.put("upys", "--"); m5.put("dnys", "--");
902 m5.put("pjys", "--"); 903 m5.put("pjys", "--");
903 tempList.add(m5); 904 tempList.add(m5);
904 Map<String, Object> m6 = new HashMap<String, Object>(); 905 Map<String, Object> m6 = new HashMap<String, Object>();
905 m6.put("time", "18:01~20:30"); 906 m6.put("time", "18:01~20:30");
906 - m6.put("upbc", "0");m6.put("dnbc", "0");  
907 - m6.put("upys", "--");m6.put("dnys", "--"); 907 + m6.put("upbc", "0"); m6.put("dnbc", "0");
  908 + m6.put("upys", "--"); m6.put("dnys", "--");
908 m6.put("pjys", "--"); 909 m6.put("pjys", "--");
909 tempList.add(m6); 910 tempList.add(m6);
910 Map<String, Object> m7 = new HashMap<String, Object>(); 911 Map<String, Object> m7 = new HashMap<String, Object>();
911 m7.put("time", "20:31~末"); 912 m7.put("time", "20:31~末");
912 - m7.put("upbc", "0");m7.put("dnbc", "0");  
913 - m7.put("upys", "--");m7.put("dnys", "--"); 913 + m7.put("upbc", "0"); m7.put("dnbc", "0");
  914 + m7.put("upys", "--"); m7.put("dnys", "--");
914 m7.put("pjys", "--"); 915 m7.put("pjys", "--");
915 tempList.add(m7); 916 tempList.add(m7);
916 } 917 }
917 918
  919 + String companyName = "";
  920 + String subCompanyName = "";
  921 +
918 //按时间段分组 922 //按时间段分组
919 for(ScheduleRealInfo schedule : list){ 923 for(ScheduleRealInfo schedule : list){
  924 + if(companyName.length()==0&&schedule.getGsName()!=null
  925 + &&schedule.getGsName().trim().length()!=0){
  926 + companyName = schedule.getGsName();
  927 + }
  928 + if(subCompanyName.length()==0&&schedule.getFgsName()!=null
  929 + &&schedule.getFgsName().trim().length()!=0){
  930 + subCompanyName = schedule.getFgsName();
  931 + }
  932 +
920 if(schedule.getFcsjActualTime()!=null && schedule.getZdsjActualTime()!=null){ 933 if(schedule.getFcsjActualTime()!=null && schedule.getZdsjActualTime()!=null){
921 Long fcsjA = schedule.getFcsjActualTime(); 934 Long fcsjA = schedule.getFcsjActualTime();
922 - if(fcsjA <= 6*60+30){ 935 + if(!schedule.getRealExecDate().equals(schedule.getScheduleDateStr())
  936 + || fcsjA > 20*60+30){
  937 + if(!keyMap.containsKey("20:31~末"))
  938 + keyMap.put("20:31~末", new ArrayList<ScheduleRealInfo>());
  939 + keyMap.get("20:31~末").add(schedule);
  940 +
  941 + } else if(fcsjA <= 6*60+30){
  942 +
923 if(!keyMap.containsKey("首~6:30")) 943 if(!keyMap.containsKey("首~6:30"))
924 keyMap.put("首~6:30", new ArrayList<ScheduleRealInfo>()); 944 keyMap.put("首~6:30", new ArrayList<ScheduleRealInfo>());
925 keyMap.get("首~6:30").add(schedule); 945 keyMap.get("首~6:30").add(schedule);
926 - }  
927 - if(fcsjA > 6*60+30 && fcsjA <= 8*60+30){ 946 +
  947 + } else if(fcsjA > 6*60+30 && fcsjA <= 8*60+30){
  948 +
928 if(!keyMap.containsKey("6:31~8:30")) 949 if(!keyMap.containsKey("6:31~8:30"))
929 keyMap.put("6:31~8:30", new ArrayList<ScheduleRealInfo>()); 950 keyMap.put("6:31~8:30", new ArrayList<ScheduleRealInfo>());
930 keyMap.get("6:31~8:30").add(schedule); 951 keyMap.get("6:31~8:30").add(schedule);
931 - }  
932 - if(fcsjA > 8*60+30 && fcsjA <= 11*60){ 952 +
  953 + } else if(fcsjA > 8*60+30 && fcsjA <= 11*60){
  954 +
933 if(!keyMap.containsKey("8:31~11:00")) 955 if(!keyMap.containsKey("8:31~11:00"))
934 keyMap.put("8:31~11:00", new ArrayList<ScheduleRealInfo>()); 956 keyMap.put("8:31~11:00", new ArrayList<ScheduleRealInfo>());
935 keyMap.get("8:31~11:00").add(schedule); 957 keyMap.get("8:31~11:00").add(schedule);
936 - }  
937 - if(fcsjA > 11*60 && fcsjA <= 13*60+30){ 958 +
  959 + } else if(fcsjA > 11*60 && fcsjA <= 13*60+30){
  960 +
938 if(!keyMap.containsKey("11:01~13:30")) 961 if(!keyMap.containsKey("11:01~13:30"))
939 keyMap.put("11:01~13:30", new ArrayList<ScheduleRealInfo>()); 962 keyMap.put("11:01~13:30", new ArrayList<ScheduleRealInfo>());
940 keyMap.get("11:01~13:30").add(schedule); 963 keyMap.get("11:01~13:30").add(schedule);
941 - }  
942 - if(fcsjA > 13*60+30 && fcsjA <= 16*60){ 964 +
  965 + } else if(fcsjA > 13*60+30 && fcsjA <= 16*60){
  966 +
943 if(!keyMap.containsKey("13:31~16:00")) 967 if(!keyMap.containsKey("13:31~16:00"))
944 keyMap.put("13:31~16:00", new ArrayList<ScheduleRealInfo>()); 968 keyMap.put("13:31~16:00", new ArrayList<ScheduleRealInfo>());
945 keyMap.get("13:31~16:00").add(schedule); 969 keyMap.get("13:31~16:00").add(schedule);
946 - }  
947 - if(fcsjA > 16*60 && fcsjA <= 18*60){ 970 +
  971 + } else if(fcsjA > 16*60 && fcsjA <= 18*60){
  972 +
948 if(!keyMap.containsKey("16:01~18:00")) 973 if(!keyMap.containsKey("16:01~18:00"))
949 keyMap.put("16:01~18:00", new ArrayList<ScheduleRealInfo>()); 974 keyMap.put("16:01~18:00", new ArrayList<ScheduleRealInfo>());
950 keyMap.get("16:01~18:00").add(schedule); 975 keyMap.get("16:01~18:00").add(schedule);
951 - }  
952 - if(fcsjA > 18*60 && fcsjA <= 20*60+30){ 976 +
  977 + } else if(fcsjA > 18*60 && fcsjA <= 20*60+30){
  978 +
953 if(!keyMap.containsKey("18:01~20:30")) 979 if(!keyMap.containsKey("18:01~20:30"))
954 keyMap.put("18:01~20:30", new ArrayList<ScheduleRealInfo>()); 980 keyMap.put("18:01~20:30", new ArrayList<ScheduleRealInfo>());
955 keyMap.get("18:01~20:30").add(schedule); 981 keyMap.get("18:01~20:30").add(schedule);
956 } 982 }
957 - if(fcsjA > 20*60+30){  
958 - if(!keyMap.containsKey("20:31~末"))  
959 - keyMap.put("20:31~末", new ArrayList<ScheduleRealInfo>());  
960 - keyMap.get("20:31~末").add(schedule);  
961 - }  
962 } 983 }
963 } 984 }
964 985
  986 + boolean flag = false;
965 for(String key : keyMap.keySet()){ 987 for(String key : keyMap.keySet()){
966 Map<String, Object> m = null; 988 Map<String, Object> m = null;
967 for(Map<String, Object> map2 : tempList){ 989 for(Map<String, Object> map2 : tempList){
@@ -972,6 +994,7 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { @@ -972,6 +994,7 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
972 int upbc = 0, dnbc = 0; 994 int upbc = 0, dnbc = 0;
973 long upys = 0, dnys = 0; 995 long upys = 0, dnys = 0;
974 for(ScheduleRealInfo schedule : keyMap.get(key)){ 996 for(ScheduleRealInfo schedule : keyMap.get(key)){
  997 + flag = true;
975 if(schedule.getXlDir().equals("0")){ 998 if(schedule.getXlDir().equals("0")){
976 upbc++; 999 upbc++;
977 upys += schedule.getZdsjActualTime() - schedule.getFcsjActualTime(); 1000 upys += schedule.getZdsjActualTime() - schedule.getFcsjActualTime();
@@ -979,15 +1002,25 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { @@ -979,15 +1002,25 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
979 dnbc++; 1002 dnbc++;
980 dnys += schedule.getZdsjActualTime() - schedule.getFcsjActualTime(); 1003 dnys += schedule.getZdsjActualTime() - schedule.getFcsjActualTime();
981 } 1004 }
  1005 +
  1006 + if(schedule.getXlName() != null && schedule.getXlName().trim().length() != 0){
  1007 + m.put("line", schedule.getXlName());
  1008 + }
982 } 1009 }
983 m.put("upbc", upbc); 1010 m.put("upbc", upbc);
984 m.put("dnbc", dnbc); 1011 m.put("dnbc", dnbc);
985 - m.put("upys", nf.format((float)upys / upbc));  
986 - m.put("dnys", nf.format((float)dnys / dnbc));  
987 - m.put("pjys", nf.format((float) (upys + dnys) / (upbc + dnbc))); 1012 + m.put("upys", upbc > 0 ? nf.format((float)upys / upbc) : "/");
  1013 + m.put("dnys", dnbc > 0 ? nf.format((float)dnys / dnbc) : "/");
  1014 + m.put("pjys", (upbc + dnbc) > 0 ? nf.format((float) (upys + dnys) / (upbc + dnbc)) : "/");
  1015 + m.put("company", companyName.trim());
  1016 + m.put("subCompany", subCompanyName.trim());
988 } 1017 }
989 1018
990 - modelMap.put("dataList", tempList); 1019 + if(flag){
  1020 + modelMap.put("dataList", tempList);
  1021 + } else {
  1022 + modelMap.put("dataList", new ArrayList<Map<String, Object>>());
  1023 + }
991 1024
992 //导出 1025 //导出
993 if(type.equals("export")){ 1026 if(type.equals("export")){
@@ -1180,6 +1213,10 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { @@ -1180,6 +1213,10 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
1180 } 1213 }
1181 } 1214 }
1182 1215
  1216 + if(longList0.size() == 0 && longList1.size() == 0){
  1217 + continue;
  1218 + }
  1219 +
1183 if(longList0.size() != 0){ 1220 if(longList0.size() != 0){
1184 Collections.sort(longList0); 1221 Collections.sort(longList0);
1185 ScheduleRealInfo shouban0 = temp0.get(longList0.get(0)); 1222 ScheduleRealInfo shouban0 = temp0.get(longList0.get(0));
@@ -1297,7 +1334,7 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { @@ -1297,7 +1334,7 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
1297 return resList; 1334 return resList;
1298 } 1335 }
1299 1336
1300 -// @Override 1337 + @Override
1301 public List<Map<String, Object>> firstAndLastBus_sum(Map<String, Object> map) { 1338 public List<Map<String, Object>> firstAndLastBus_sum(Map<String, Object> map) {
1302 NumberFormat nf = NumberFormat.getNumberInstance(); 1339 NumberFormat nf = NumberFormat.getNumberInstance();
1303 nf.setMinimumFractionDigits(2); 1340 nf.setMinimumFractionDigits(2);
@@ -1355,6 +1392,9 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { @@ -1355,6 +1392,9 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
1355 } 1392 }
1356 } 1393 }
1357 1394
  1395 + if(longList0.size() == 0 && longList1.size() == 0){
  1396 + continue;
  1397 + }
1358 int jhbc = 0; 1398 int jhbc = 0;
1359 int sjbc = 0; 1399 int sjbc = 0;
1360 1400
@@ -1415,7 +1455,6 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { @@ -1415,7 +1455,6 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
1415 tempMap.put("subCompany", subCompanyName); 1455 tempMap.put("subCompany", subCompanyName);
1416 tempMap.put("line", key); 1456 tempMap.put("line", key);
1417 resList.add(tempMap); 1457 resList.add(tempMap);
1418 - System.out.println(tempMap);  
1419 } 1458 }
1420 1459
1421 if(type.equals("export")){ 1460 if(type.equals("export")){
@@ -1427,8 +1466,8 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { @@ -1427,8 +1466,8 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
1427 try { 1466 try {
1428 listI.add(resList.iterator()); 1467 listI.add(resList.iterator());
1429 String path = this.getClass().getResource("/").getPath()+"static/pages/forms/"; 1468 String path = this.getClass().getResource("/").getPath()+"static/pages/forms/";
1430 - ee.excelReplace(listI, new Object[] { m }, path+"mould/firstAndLastBus.xls",  
1431 - path+"export/线路首末班" + sdfSimple.format(sdfMonth.parse(date)) + ".xls"); 1469 + ee.excelReplace(listI, new Object[] { m }, path+"mould/firstAndLastBus_sum.xls",
  1470 + path+"export/线路首末班准点率" + sdfSimple.format(sdfMonth.parse(date)) + ".xls");
1432 } catch (Exception e) { 1471 } catch (Exception e) {
1433 // TODO: handle exception 1472 // TODO: handle exception
1434 e.printStackTrace(); 1473 e.printStackTrace();
src/main/java/com/bsth/service/schedule/impl/SchedulePlanServiceImpl.java
@@ -358,6 +358,7 @@ public class SchedulePlanServiceImpl extends BServiceImpl&lt;SchedulePlan, Long&gt; im @@ -358,6 +358,7 @@ public class SchedulePlanServiceImpl extends BServiceImpl&lt;SchedulePlan, Long&gt; im
358 // 执行完毕销毁,有日志的也要关闭 358 // 执行完毕销毁,有日志的也要关闭
359 session.dispose(); 359 session.dispose();
360 360
  361 +// logger.info("错误总数={}", result.getInfos().size());
361 // for (ValidateResults_output.ValidInfo validInfo: result.getInfos()) { 362 // for (ValidateResults_output.ValidInfo validInfo: result.getInfos()) {
362 // logger.info(validInfo.getDesc()); 363 // logger.info(validInfo.getDesc());
363 // } 364 // }
src/main/java/com/bsth/service/schedule/rules/ScheduleRuleServiceImpl.java
@@ -119,6 +119,7 @@ public class ScheduleRuleServiceImpl implements ScheduleRuleService { @@ -119,6 +119,7 @@ public class ScheduleRuleServiceImpl implements ScheduleRuleService {
119 obj.setScheduleDate(rs.getDate("schedule_date")); 119 obj.setScheduleDate(rs.getDate("schedule_date"));
120 obj.setGidindex(rs.getString("gidindex")); 120 obj.setGidindex(rs.getString("gidindex"));
121 obj.setEcindex(rs.getString("ecindex")); 121 obj.setEcindex(rs.getString("ecindex"));
  122 + obj.setOrigingidindex(rs.getString("origingidindex"));
122 123
123 // 其他字段没用 124 // 其他字段没用
124 return obj; 125 return obj;
src/main/java/com/bsth/service/schedule/rules/validate/ValidRepeatBcFunction.java
@@ -47,12 +47,14 @@ public class ValidRepeatBcFunction implements AccumulateFunction { @@ -47,12 +47,14 @@ public class ValidRepeatBcFunction implements AccumulateFunction {
47 47
48 @Override 48 @Override
49 public Serializable createContext() { 49 public Serializable createContext() {
  50 + System.out.println("create");
50 return new RepeatBcInfo(); 51 return new RepeatBcInfo();
51 } 52 }
52 53
53 @Override 54 @Override
54 public void init(Serializable serializable) throws Exception { 55 public void init(Serializable serializable) throws Exception {
55 // TODO: 56 // TODO:
  57 + System.out.println("init");
56 } 58 }
57 59
58 @Override 60 @Override
@@ -82,12 +84,20 @@ public class ValidRepeatBcFunction implements AccumulateFunction { @@ -82,12 +84,20 @@ public class ValidRepeatBcFunction implements AccumulateFunction {
82 84
83 @Override 85 @Override
84 public boolean supportsReverse() { 86 public boolean supportsReverse() {
85 - return false; 87 + return true;
86 } 88 }
87 89
88 @Override 90 @Override
89 - public void reverse(Serializable serializable, Object o) throws Exception { 91 + public void reverse(Serializable context, Object o) throws Exception {
  92 + RepeatBcInfo repeatBcInfo = (RepeatBcInfo) context;
  93 + SchedulePlanInfo schedulePlanInfo = (SchedulePlanInfo) o;
90 94
  95 + String key = schedulePlanInfo.getLp() + "_" + schedulePlanInfo.getFcsj();
  96 + repeatBcInfo.lpBcFcsjCount.remove(key);
  97 +
  98 + if (!repeatBcInfo.validInfoList.isEmpty()) { // 全部清空
  99 + repeatBcInfo.validInfoList.clear();
  100 + }
91 } 101 }
92 102
93 @Override 103 @Override
src/main/resources/rules/shiftloop_fb_2.drl
@@ -88,7 +88,9 @@ rule &quot;calcu_days_1_&quot; @@ -88,7 +88,9 @@ rule &quot;calcu_days_1_&quot;
88 String ruleMd5 = Md5Util.getMd5( 88 String ruleMd5 = Md5Util.getMd5(
89 String.valueOf($qyrq.getMillis()) + 89 String.valueOf($qyrq.getMillis()) +
90 "_" + 90 "_" +
91 - $sri.getSelf().getLpIds() 91 + $sri.getSelf().getLpIds() +
  92 + "_" +
  93 + $sri.getSelf().getLpStart().toString()
92 ); 94 );
93 cdrp.setRuleMd5(ruleMd5); 95 cdrp.setRuleMd5(ruleMd5);
94 // 人员范围个数 96 // 人员范围个数
@@ -136,7 +138,9 @@ rule &quot;calcu_days_2_&quot; @@ -136,7 +138,9 @@ rule &quot;calcu_days_2_&quot;
136 String ruleMd5 = Md5Util.getMd5( 138 String ruleMd5 = Md5Util.getMd5(
137 String.valueOf($qyrq.getMillis()) + 139 String.valueOf($qyrq.getMillis()) +
138 "_" + 140 "_" +
139 - $sri.getSelf().getLpIds() 141 + $sri.getSelf().getLpIds() +
  142 + "_" +
  143 + $sri.getSelf().getLpStart().toString()
140 ); 144 );
141 cdrp.setRuleMd5(ruleMd5); 145 cdrp.setRuleMd5(ruleMd5);
142 // 人员范围个数 146 // 人员范围个数
@@ -187,7 +191,9 @@ rule &quot;Calcu_SchedulePlanRuleResult_wrap&quot; @@ -187,7 +191,9 @@ rule &quot;Calcu_SchedulePlanRuleResult_wrap&quot;
187 String md5 = Md5Util.getMd5( 191 String md5 = Md5Util.getMd5(
188 String.valueOf($sprr.getQyrq().getTime()) + 192 String.valueOf($sprr.getQyrq().getTime()) +
189 "_" + 193 "_" +
190 - $sprr.getGids() 194 + $sprr.getGids() +
  195 + "_" +
  196 + $sprr.getOrigingidindex()
191 ); 197 );
192 198
193 // System.out.println("修改后的md5:" + md5 + "车辆:" + $sprr.getCcZbh()); 199 // System.out.println("修改后的md5:" + md5 + "车辆:" + $sprr.getCcZbh());
@@ -350,7 +356,7 @@ rule &quot;Calcu_loop2_1_&quot; // 路牌在时刻表中存在,就翻 @@ -350,7 +356,7 @@ rule &quot;Calcu_loop2_1_&quot; // 路牌在时刻表中存在,就翻
350 schedulePlanRuleResult.setRuleId($ruleId); 356 schedulePlanRuleResult.setRuleId($ruleId);
351 schedulePlanRuleResult.setCcId($cid); 357 schedulePlanRuleResult.setCcId($cid);
352 schedulePlanRuleResult.setCcZbh($srf.getCarConfigInfo().getCl().getInsideCode()); 358 schedulePlanRuleResult.setCcZbh($srf.getCarConfigInfo().getCl().getInsideCode());
353 - schedulePlanRuleResult.setGids($srf.getLpIds()); 359 + schedulePlanRuleResult.setGids($srf.getLpIds()); // 参与md5计算
354 schedulePlanRuleResult.setGnames($srf.getLpNames()); 360 schedulePlanRuleResult.setGnames($srf.getLpNames());
355 schedulePlanRuleResult.setGidindex(String.valueOf($lpindex)); 361 schedulePlanRuleResult.setGidindex(String.valueOf($lpindex));
356 schedulePlanRuleResult.setEcids($srf.getRyConfigIds()); 362 schedulePlanRuleResult.setEcids($srf.getRyConfigIds());
@@ -359,7 +365,8 @@ rule &quot;Calcu_loop2_1_&quot; // 路牌在时刻表中存在,就翻 @@ -359,7 +365,8 @@ rule &quot;Calcu_loop2_1_&quot; // 路牌在时刻表中存在,就翻
359 schedulePlanRuleResult.setScheduleDate($csd2.toDate()); 365 schedulePlanRuleResult.setScheduleDate($csd2.toDate());
360 schedulePlanRuleResult.setTtinfoId($ttinfoId); 366 schedulePlanRuleResult.setTtinfoId($ttinfoId);
361 schedulePlanRuleResult.setTtinfoName($ttinfoName); 367 schedulePlanRuleResult.setTtinfoName($ttinfoName);
362 - schedulePlanRuleResult.setQyrq($sri.getQyrq().toDate()); 368 + schedulePlanRuleResult.setQyrq($sri.getQyrq().toDate()); // 参与md5计算
  369 + schedulePlanRuleResult.setOrigingidindex(String.valueOf($sri.getSelf().getLpStart())); // 参与md5计算
363 370
364 scheduleResult.getSchedulePlanRuleResults().add(schedulePlanRuleResult); 371 scheduleResult.getSchedulePlanRuleResults().add(schedulePlanRuleResult);
365 372
src/main/resources/rules/validplan.drl
@@ -46,11 +46,11 @@ rule &quot;Valid_repeat_bc&quot; // 验证是否存在重复班次 @@ -46,11 +46,11 @@ rule &quot;Valid_repeat_bc&quot; // 验证是否存在重复班次
46 when 46 when
47 $lp: Loop_param($sd: start_date, $ed: end_date) 47 $lp: Loop_param($sd: start_date, $ed: end_date)
48 eval($sd.isBefore($ed) || $sd.isEqual($ed)) 48 eval($sd.isBefore($ed) || $sd.isEqual($ed))
49 - $spiList: ArrayList() from collect (SchedulePlanInfo(scheduleDate.getTime() == $sd.millis)) 49 + $spiList: ArrayList() from collect (SchedulePlanInfo(scheduleDate.getTime() == $sd.getMillis()))
50 $infos: ArrayList() from accumulate ($spi: SchedulePlanInfo() from $spiList, vrb($spi)) 50 $infos: ArrayList() from accumulate ($spi: SchedulePlanInfo() from $spiList, vrb($spi))
51 then 51 then
52 // TODO: 52 // TODO:
53 -// log.info("日期={},班次重复错误数={}", $sd, $infos.size()); 53 + log.info("日期={},班次重复错误数={}", $sd, $infos.size());
54 54
55 validResult.getInfos().addAll($infos); 55 validResult.getInfos().addAll($infos);
56 56
src/main/resources/static/pages/forms/mould/firstAndLastBus_sum.xls 0 → 100644
No preview for this file type
src/main/resources/static/pages/forms/mould/scheduleAnaly_sum.xls
No preview for this file type
src/main/resources/static/pages/forms/statement/firstAndLastBus.html
@@ -207,7 +207,6 @@ @@ -207,7 +207,6 @@
207 params['company'] = company; 207 params['company'] = company;
208 params['subCompany'] = subCompany; 208 params['subCompany'] = subCompany;
209 params['line'] = line; 209 params['line'] = line;
210 - params['line'] = line;  
211 params['date'] = date; 210 params['date'] = date;
212 params['type'] = "query"; 211 params['type'] = "query";
213 $(".hidden").removeClass("hidden"); 212 $(".hidden").removeClass("hidden");
@@ -225,11 +224,14 @@ @@ -225,11 +224,14 @@
225 } 224 }
226 225
227 $("#export").on("click",function(){ 226 $("#export").on("click",function(){
  227 + if($("#date").val() == null || $("#date").val().trim().length == 0){
  228 + layer.msg("请选择时间!");
  229 + return;
  230 + }
228 var params = {}; 231 var params = {};
229 params['company'] = company; 232 params['company'] = company;
230 params['subCompany'] = subCompany; 233 params['subCompany'] = subCompany;
231 params['line'] = line; 234 params['line'] = line;
232 - params['line'] = line;  
233 params['date'] = date; 235 params['date'] = date;
234 params['type'] = "export"; 236 params['type'] = "export";
235 $get('/pcpc/firstAndLastBus', params, function(result){ 237 $get('/pcpc/firstAndLastBus', params, function(result){
@@ -248,22 +250,50 @@ @@ -248,22 +250,50 @@
248 <td>{{obj.company}}</td> 250 <td>{{obj.company}}</td>
249 <td>{{obj.subCompany}}</td> 251 <td>{{obj.subCompany}}</td>
250 <td>{{obj.line}}</td> 252 <td>{{obj.line}}</td>
251 - <td>{{obj.qdzFirst0}}</td>  
252 - <td>{{obj.jhfcFirst0}}</td>  
253 - <td>{{obj.sjfcFirst0}}</td>  
254 - <td>{{obj.delayFirst0}}</td>  
255 - <td>{{obj.qdzLast0}}</td>  
256 - <td>{{obj.jhfcLast0}}</td>  
257 - <td>{{obj.sjfcLast0}}</td>  
258 - <td>{{obj.delayLast0}}</td>  
259 - <td>{{obj.qdzFirst1}}</td>  
260 - <td>{{obj.jhfcFirst1}}</td>  
261 - <td>{{obj.sjfcFirst1}}</td>  
262 - <td>{{obj.delayFirst1}}</td>  
263 - <td>{{obj.qdzLast1}}</td>  
264 - <td>{{obj.jhfcLast1}}</td>  
265 - <td>{{obj.sjfcLast1}}</td>  
266 - <td>{{obj.delayLast1}}</td> 253 + {{if obj.delayFirst0 != '/' && obj.delayFirst0 != '0'}}
  254 + <td style="background-color: #FF9999">{{obj.qdzFirst0}}</td>
  255 + <td style="background-color: #FF9999">{{obj.jhfcFirst0}}</td>
  256 + <td style="background-color: #FF9999">{{obj.sjfcFirst0}}</td>
  257 + <td style="background-color: #FF9999">{{obj.delayFirst0}}</td>
  258 + {{else}}
  259 + <td>{{obj.qdzFirst0}}</td>
  260 + <td>{{obj.jhfcFirst0}}</td>
  261 + <td>{{obj.sjfcFirst0}}</td>
  262 + <td>{{obj.delayFirst0}}</td>
  263 + {{/if}}
  264 + {{if obj.delayLast0 != '/' && obj.delayLast0 != '0'}}
  265 + <td style="background-color: #FF9999">{{obj.qdzLast0}}</td>
  266 + <td style="background-color: #FF9999">{{obj.jhfcLast0}}</td>
  267 + <td style="background-color: #FF9999">{{obj.sjfcLast0}}</td>
  268 + <td style="background-color: #FF9999">{{obj.delayLast0}}</td>
  269 + {{else}}
  270 + <td>{{obj.qdzLast0}}</td>
  271 + <td>{{obj.jhfcLast0}}</td>
  272 + <td>{{obj.sjfcLast0}}</td>
  273 + <td>{{obj.delayLast0}}</td>
  274 + {{/if}}
  275 + {{if obj.delayFirst1 != '/' && obj.delayFirst1 != '0'}}
  276 + <td style="background-color: #FF9999">{{obj.qdzFirst1}}</td>
  277 + <td style="background-color: #FF9999">{{obj.jhfcFirst1}}</td>
  278 + <td style="background-color: #FF9999">{{obj.sjfcFirst1}}</td>
  279 + <td style="background-color: #FF9999">{{obj.delayFirst1}}</td>
  280 + {{else}}
  281 + <td>{{obj.qdzFirst1}}</td>
  282 + <td>{{obj.jhfcFirst1}}</td>
  283 + <td>{{obj.sjfcFirst1}}</td>
  284 + <td>{{obj.delayFirst1}}</td>
  285 + {{/if}}
  286 + {{if obj.delayLast1 != '/' && obj.delayLast1 != '0'}}
  287 + <td style="background-color: #FF9999">{{obj.qdzLast1}}</td>
  288 + <td style="background-color: #FF9999">{{obj.jhfcLast1}}</td>
  289 + <td style="background-color: #FF9999">{{obj.sjfcLast1}}</td>
  290 + <td style="background-color: #FF9999">{{obj.delayLast1}}</td>
  291 + {{else}}
  292 + <td>{{obj.qdzLast1}}</td>
  293 + <td>{{obj.jhfcLast1}}</td>
  294 + <td>{{obj.sjfcLast1}}</td>
  295 + <td>{{obj.delayLast1}}</td>
  296 + {{/if}}
267 </tr> 297 </tr>
268 {{/each}} 298 {{/each}}
269 {{if list.length == 0}} 299 {{if list.length == 0}}
src/main/resources/static/pages/forms/statement/firstAndLastBus_sum.html
@@ -205,6 +205,10 @@ @@ -205,6 +205,10 @@
205 } 205 }
206 206
207 $("#export").on("click",function(){ 207 $("#export").on("click",function(){
  208 + if($("#date").val() == null || $("#date").val().trim().length == 0){
  209 + layer.msg("请选择时间!");
  210 + return;
  211 + }
208 var params = {}; 212 var params = {};
209 params['company'] = company; 213 params['company'] = company;
210 params['subCompany'] = subCompany; 214 params['subCompany'] = subCompany;
@@ -212,8 +216,8 @@ @@ -212,8 +216,8 @@
212 params['line'] = line; 216 params['line'] = line;
213 params['date'] = date; 217 params['date'] = date;
214 params['type'] = "export"; 218 params['type'] = "export";
215 - $get('/pcpc/firstAndLastBus', params, function(result){  
216 - window.open("/downloadFile/download?fileName=线路首末班"+moment(date).format("YYYYMMDD")); 219 + $get('/pcpc/firstAndLastBus_sum', params, function(result){
  220 + window.open("/downloadFile/download?fileName=线路首末班准点率"+moment(date).format("YYYYMMDD"));
217 }); 221 });
218 }); 222 });
219 223
src/main/resources/static/pages/forms/statement/scheduleAnaly_sum.html
@@ -11,14 +11,16 @@ @@ -11,14 +11,16 @@
11 .table-bordered > thead > tr > th, 11 .table-bordered > thead > tr > th,
12 .table-bordered > thead > tr > td { 12 .table-bordered > thead > tr > td {
13 border-bottom-width: 2px; } 13 border-bottom-width: 2px; }
14 -  
15 .table > tbody + tbody { 14 .table > tbody + tbody {
16 border-top: 1px solid; } 15 border-top: 1px solid; }
  16 + #forms > tbody > tr{
  17 + background-color: #FFFFFF;
  18 + }
17 </style> 19 </style>
18 20
19 <div class="page-head"> 21 <div class="page-head">
20 <div class="page-title"> 22 <div class="page-title">
21 - <h1>时刻表分析</h1> 23 + <h1>时刻表分析(汇总)</h1>
22 </div> 24 </div>
23 </div> 25 </div>
24 26
@@ -70,6 +72,9 @@ @@ -70,6 +72,9 @@
70 <thead> 72 <thead>
71 <tr class="hidden"> 73 <tr class="hidden">
72 <th style="display: none;"></th> 74 <th style="display: none;"></th>
  75 + <th>公司</th>
  76 + <th>分公司</th>
  77 + <th>线路</th>
73 <th>时间段</th> 78 <th>时间段</th>
74 <th>上行班次</th> 79 <th>上行班次</th>
75 <th>下行班次</th> 80 <th>下行班次</th>
@@ -196,6 +201,8 @@ @@ -196,6 +201,8 @@
196 jsDoQuery(true); 201 jsDoQuery(true);
197 }); 202 });
198 203
  204 + var companyName = "";
  205 + var subCompanyName = "";
199 var line = $("#line").val(); 206 var line = $("#line").val();
200 var startDate = $("#startDate").val(); 207 var startDate = $("#startDate").val();
201 var endDate = $("#endDate").val(); 208 var endDate = $("#endDate").val();
@@ -232,7 +239,7 @@ @@ -232,7 +239,7 @@
232 $(".hidden").removeClass("hidden"); 239 $(".hidden").removeClass("hidden");
233 $get('/pcpc/scheduleAnaly_sum', params, function(result){ 240 $get('/pcpc/scheduleAnaly_sum', params, function(result){
234 // 把数据填充到模版中 241 // 把数据填充到模版中
235 - var tbodyHtml = template('list_scheduleAnaly',{list:result.dataList}); 242 + var tbodyHtml = template('list_scheduleAnaly',{list:result.dataList, companyName:companyName, subCompanyName:subCompanyName});
236 // 把渲染好的模版html文本追加到表格中 243 // 把渲染好的模版html文本追加到表格中
237 $('#forms tbody').html(tbodyHtml); 244 $('#forms tbody').html(tbodyHtml);
238 245
@@ -362,6 +369,11 @@ @@ -362,6 +369,11 @@
362 {{each list as obj i}} 369 {{each list as obj i}}
363 <tr> 370 <tr>
364 <th style="display: none;"></th> 371 <th style="display: none;"></th>
  372 + {{if i == 0}}
  373 + <td rowspan='8'>{{obj.company}}</td>
  374 + <td rowspan='8'>{{obj.subCompany}}</td>
  375 + <td rowspan='8'>{{obj.line}}</td>
  376 + {{/if}}
365 <td>{{obj.time}}</td> 377 <td>{{obj.time}}</td>
366 <td>{{obj.upbc}}</td> 378 <td>{{obj.upbc}}</td>
367 <td>{{obj.dnbc}}</td> 379 <td>{{obj.dnbc}}</td>
@@ -372,7 +384,7 @@ @@ -372,7 +384,7 @@
372 {{/each}} 384 {{/each}}
373 {{if list.length == 0}} 385 {{if list.length == 0}}
374 <tr> 386 <tr>
375 - <td colspan="6"><h6 class="muted">没有找到相关数据</h6></td> 387 + <td colspan="9"><h6 class="muted">没有找到相关数据</h6></td>
376 </tr> 388 </tr>
377 {{/if}} 389 {{/if}}
378 </script> 390 </script>
379 \ No newline at end of file 391 \ No newline at end of file
src/test/resources/testdata/test6.txt
@@ -7,6 +7,13 @@ update bsth_c_s_sp_rule_rst a @@ -7,6 +7,13 @@ update bsth_c_s_sp_rule_rst a
7 set a.qyrq = (select qyrq from bsth_c_s_sr1_flat where id = a.rule_id) 7 set a.qyrq = (select qyrq from bsth_c_s_sr1_flat where id = a.rule_id)
8 where a.qyrq is null; 8 where a.qyrq is null;
9 9
  10 +select * from bsth_c_s_sp_rule_rst
  11 +where origingidindex is null;
  12 +
  13 +update bsth_c_s_sp_rule_rst a
  14 +set a.origingidindex = (select lp_start from bsth_c_s_sr1_flat where id = a.rule_id)
  15 +where a.origingidindex is null;
  16 +
10 970 17 970
11 789 18 789
12 604 19 604