Commit cb3ee48623c80a223a7281a38e2a7e2eebbc9dbd

Authored by 娄高锋
1 parent 901928ec

营运线路出车率统计表

src/main/java/com/bsth/service/forms/impl/FormsServiceImpl.java
@@ -783,6 +783,7 @@ public class FormsServiceImpl implements FormsService { @@ -783,6 +783,7 @@ public class FormsServiceImpl implements FormsService {
783 @Override 783 @Override
784 public List<Map<String, Object>> turnoutrate(Map<String, Object> map) { 784 public List<Map<String, Object>> turnoutrate(Map<String, Object> map) {
785 785
  786 + List<Map<String, Object>> tempList = new ArrayList<Map<String, Object>>();
786 List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>(); 787 List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>();
787 SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); 788 SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
788 SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy年MM月dd日"); 789 SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy年MM月dd日");
@@ -804,11 +805,14 @@ public class FormsServiceImpl implements FormsService { @@ -804,11 +805,14 @@ public class FormsServiceImpl implements FormsService {
804 String line = map.get("line").toString(); 805 String line = map.get("line").toString();
805 String startDate = map.get("startDate").toString(); 806 String startDate = map.get("startDate").toString();
806 String endDate = map.get("endDate").toString(); 807 String endDate = map.get("endDate").toString();
  808 + if(line.trim().length() == 0){
  809 + line = "";
  810 + }
807 811
808 rq = rq2 + "-" + rq3; 812 rq = rq2 + "-" + rq3;
809 813
810 List<ScheduleRealInfo> list = scheduleRealInfoRepository.scheduleByDateAndLineTj(line, startDate, endDate, company, subCompany); 814 List<ScheduleRealInfo> list = scheduleRealInfoRepository.scheduleByDateAndLineTj(line, startDate, endDate, company, subCompany);
811 - List<Line> lineList = lineRepository.findLineBygsBm(company, subCompany, line); 815 + List<Line> lineList = lineRepository.findLineBygsBm(company, subCompany, line.length()==0?"%"+line+"%":line);
812 816
813 String sql = "select * from bsth_c_s_sp_info where gs_bm = '"+company+"' and fgs_bm = '"+subCompany+"' " 817 String sql = "select * from bsth_c_s_sp_info where gs_bm = '"+company+"' and fgs_bm = '"+subCompany+"' "
814 + "and DATE_FORMAT(schedule_date,'%Y-%m-%d') BETWEEN '"+startDate+"' and '"+endDate+"' "; 818 + "and DATE_FORMAT(schedule_date,'%Y-%m-%d') BETWEEN '"+startDate+"' and '"+endDate+"' ";
@@ -842,10 +846,10 @@ public class FormsServiceImpl implements FormsService { @@ -842,10 +846,10 @@ public class FormsServiceImpl implements FormsService {
842 m.put("xlBm", line1.getLineCode()); 846 m.put("xlBm", line1.getLineCode());
843 m.put("qz", line1.getWarrantCar()!=null?line1.getWarrantCar():0); 847 m.put("qz", line1.getWarrantCar()!=null?line1.getWarrantCar():0);
844 m.put("sm", ""); 848 m.put("sm", "");
845 - resList.add(m); 849 + tempList.add(m);
846 } 850 }
847 } 851 }
848 - for(Map<String, Object> m : resList){ 852 + for(Map<String, Object> m : tempList){
849 String xlBm = m.get("xlBm").toString(); 853 String xlBm = m.get("xlBm").toString();
850 List<ScheduleRealInfo> reals = new ArrayList<ScheduleRealInfo>(); 854 List<ScheduleRealInfo> reals = new ArrayList<ScheduleRealInfo>();
851 List<SchedulePlanInfo> plans = new ArrayList<SchedulePlanInfo>(); 855 List<SchedulePlanInfo> plans = new ArrayList<SchedulePlanInfo>();
@@ -895,6 +899,9 @@ public class FormsServiceImpl implements FormsService { @@ -895,6 +899,9 @@ public class FormsServiceImpl implements FormsService {
895 }else{ 899 }else{
896 m.put("zxl", "--"); 900 m.put("zxl", "--");
897 } 901 }
  902 + if(jhbc != 0 && sjbc != 0){
  903 + resList.add(m);
  904 + }
898 } 905 }
899 Map<String, Object> tempMap = new HashMap<String, Object>(); 906 Map<String, Object> tempMap = new HashMap<String, Object>();
900 int jhcc = 0; 907 int jhcc = 0;
@@ -902,7 +909,7 @@ public class FormsServiceImpl implements FormsService { @@ -902,7 +909,7 @@ public class FormsServiceImpl implements FormsService {
902 int jhbc = 0; 909 int jhbc = 0;
903 int sjbc = 0; 910 int sjbc = 0;
904 int qz = 0; 911 int qz = 0;
905 - for(Map<String, Object> m : resList){ 912 + for(Map<String, Object> m : tempList){
906 jhcc += Integer.valueOf(m.get("jhcc").toString()); 913 jhcc += Integer.valueOf(m.get("jhcc").toString());
907 sjcc += Integer.valueOf(m.get("sjcc").toString()); 914 sjcc += Integer.valueOf(m.get("sjcc").toString());
908 jhbc += Integer.valueOf(m.get("jhbc").toString()); 915 jhbc += Integer.valueOf(m.get("jhbc").toString());
@@ -910,7 +917,7 @@ public class FormsServiceImpl implements FormsService { @@ -910,7 +917,7 @@ public class FormsServiceImpl implements FormsService {
910 qz += Integer.valueOf(m.get("qz").toString()); 917 qz += Integer.valueOf(m.get("qz").toString());
911 } 918 }
912 tempMap.put("rq", "分类汇总"); 919 tempMap.put("rq", "分类汇总");
913 - tempMap.put("line", "共" + resList.size() + "条线路"); 920 + tempMap.put("line", "共" + tempList.size() + "条线路");
914 tempMap.put("jhcc", jhcc); 921 tempMap.put("jhcc", jhcc);
915 tempMap.put("sjcc", sjcc); 922 tempMap.put("sjcc", sjcc);
916 tempMap.put("jhbc", jhbc); 923 tempMap.put("jhbc", jhbc);
src/main/resources/static/pages/mforms/turnoutrates/turnoutrate.html
@@ -37,15 +37,15 @@ @@ -37,15 +37,15 @@
37 <div class="portlet light porttlet-fit bordered"> 37 <div class="portlet light porttlet-fit bordered">
38 <div class="portlet-title"> 38 <div class="portlet-title">
39 <form class="form-inline" action="" method="post"> 39 <form class="form-inline" action="" method="post">
40 - <div style="display: inline-block; margin-left: 33px;" id="gsdmDiv_turn"> 40 + <div style="display: inline-block; margin-left: 20px;" id="gsdmDiv_turn">
41 <span class="item-label" style="width: 80px;">公司: </span> 41 <span class="item-label" style="width: 80px;">公司: </span>
42 <select class="form-control" name="company" id="gsdmTurn" style="width: 140px;"></select> 42 <select class="form-control" name="company" id="gsdmTurn" style="width: 140px;"></select>
43 </div> 43 </div>
44 - <div style="display: inline-block; margin-left: 24px;" id="fgsdmDiv_turn"> 44 + <div style="display: inline-block; margin-left: 20px;" id="fgsdmDiv_turn">
45 <span class="item-label" style="width: 80px;">分公司: </span> 45 <span class="item-label" style="width: 80px;">分公司: </span>
46 <select class="form-control" name="subCompany" id="fgsdmTurn" style="width: 140px;"></select> 46 <select class="form-control" name="subCompany" id="fgsdmTurn" style="width: 140px;"></select>
47 </div> 47 </div>
48 - <div style="display: inline-block;"> 48 + <div style="display: inline-block; margin-left: 15px;">
49 <span class="item-label" style="width: 80px;">线路: </span> 49 <span class="item-label" style="width: 80px;">线路: </span>
50 <select class="form-control" name="line" id="line" style="width: 120px;"></select> 50 <select class="form-control" name="line" id="line" style="width: 120px;"></select>
51 </div> 51 </div>
@@ -124,6 +124,17 @@ @@ -124,6 +124,17 @@
124 locale : 'zh-cn' 124 locale : 'zh-cn'
125 }); 125 });
126 126
  127 + var d = new Date();
  128 + var year = d.getFullYear();
  129 + var month = d.getMonth() + 1;
  130 + var day = d.getDate();
  131 + if(month < 10)
  132 + month = "0" + month;
  133 + if(day < 10)
  134 + day = "0" + day;
  135 + $("#startDate").val(year + "-" + month + "-" + day);
  136 + $("#endDate").val(year + "-" + month + "-" + day);
  137 +
127 var fage=false; 138 var fage=false;
128 var xlList; 139 var xlList;
129 var obj = []; 140 var obj = [];
@@ -167,6 +178,7 @@ @@ -167,6 +178,7 @@
167 $("#fgsdmTurn").on("change",initXl); 178 $("#fgsdmTurn").on("change",initXl);
168 function initXl(){ 179 function initXl(){
169 var data=[]; 180 var data=[];
  181 + data.push({id:" ", text:"全部线路"});
170 if(fage){ 182 if(fage){
171 $("#line").select2("destroy").html(''); 183 $("#line").select2("destroy").html('');
172 } 184 }