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