Commit 1b36c794d0b2b9c9c0fa7b12d92da2b45ad03282
1 parent
05c2525d
大间隔发生次数汇总 添加了营运线路搜索项和导出功能
Showing
6 changed files
with
53 additions
and
30 deletions
src/main/java/com/bsth/service/calc/impl/CalcIntervalServiceImpl.java
| ... | ... | @@ -702,16 +702,15 @@ public class CalcIntervalServiceImpl extends BaseServiceImpl<CalcInterval,Intege |
| 702 | 702 | public List<Map<String, Object>> sumInterval(Map<String, Object> map) { |
| 703 | 703 | // TODO Auto-generated method stub |
| 704 | 704 | final DecimalFormat df = new DecimalFormat("0.00"); |
| 705 | - List<Map<String, Object>> list=new ArrayList<>(); | |
| 706 | 705 | String gs=map.get("gs").toString().trim(); |
| 707 | 706 | String fgs=map.get("fgs").toString().trim(); |
| 708 | 707 | String sDate=map.get("date").toString(); |
| 709 | 708 | String eDate=map.get("endDate").toString(); |
| 710 | -// String nature=map.get("nature").toString(); | |
| 709 | + String nature=map.get("nature").toString(); | |
| 711 | 710 | |
| 712 | 711 | List<Map<String, Object>> listAll=new ArrayList<Map<String, Object>>(); |
| 713 | 712 | |
| 714 | - String sql="select gsbm,fgsbm,level,djg_all,bcs" | |
| 713 | + String sql="select gsbm,fgsbm,xl_bm,xl_name,level,djg_all,bcs" | |
| 715 | 714 | + " from bsth_c_calc_interval where date>= '"+sDate+"' and date<='"+eDate+"'" |
| 716 | 715 | + " and level is not null and level <> '' "; |
| 717 | 716 | if(gs.length() > 0){ |
| ... | ... | @@ -722,29 +721,52 @@ public class CalcIntervalServiceImpl extends BaseServiceImpl<CalcInterval,Intege |
| 722 | 721 | } |
| 723 | 722 | } |
| 724 | 723 | sql += " order by gsbm,fgsbm,level"; |
| 725 | - | |
| 726 | - List<Map<String, Object>> countList=jdbcTemplate.query(sql, | |
| 724 | + | |
| 725 | + List<Map<String, Object>> countList = new ArrayList<Map<String, Object>>(); | |
| 726 | + List<Map<String, Object>> list=jdbcTemplate.query(sql, | |
| 727 | 727 | new RowMapper<Map<String,Object>>(){ |
| 728 | 728 | @Override |
| 729 | 729 | public Map<String, Object> mapRow(ResultSet rs, int rowNum) throws SQLException { |
| 730 | 730 | Map<String, Object> m=new HashMap<String,Object>(); |
| 731 | 731 | m.put("gs", BasicData.businessCodeNameMap.get(rs.getString("gsbm"))); |
| 732 | 732 | m.put("fgs", BasicData.businessFgsCodeNameMap.get(rs.getString("fgsbm")+"_"+rs.getString("gsbm"))); |
| 733 | + m.put("xlBm", rs.getString("xl_bm")); | |
| 734 | + m.put("xlName", rs.getString("xl_name")); | |
| 733 | 735 | m.put("level", rs.getString("level")); |
| 734 | 736 | m.put("djgAll", rs.getInt("djg_all")); |
| 735 | 737 | m.put("bcs", rs.getInt("bcs")); |
| 736 | 738 | return m; |
| 737 | 739 | } |
| 738 | 740 | }); |
| 741 | + | |
| 742 | + //根据线路类型确定是否营运 | |
| 743 | + Map<String, Boolean> lineMap=lineService.lineNature(); | |
| 744 | + for (int i = 0; i < list.size(); i++) { | |
| 745 | + Map<String, Object> m=list.get(i); | |
| 746 | + if (nature.equals("0")) { | |
| 747 | + countList.add(m); | |
| 748 | + }else if(nature.equals("1")){ | |
| 749 | + if(lineMap.get(m.get("xlBm").toString())){ | |
| 750 | + countList.add(m); | |
| 751 | + } | |
| 752 | + }else{ | |
| 753 | + if(!lineMap.get(m.get("xlBm").toString())){ | |
| 754 | + countList.add(m); | |
| 755 | + } | |
| 756 | + } | |
| 757 | + } | |
| 739 | 758 | |
| 740 | 759 | List<String> keyList = new ArrayList<String>(); |
| 741 | 760 | Map<String, Map<String, Object>> keyMap = new HashMap<String, Map<String, Object>>(); |
| 742 | 761 | Map<String, Object> sumMap1 = new HashMap<String, Object>(); |
| 743 | 762 | Map<String, Object> sumMap2 = new HashMap<String, Object>(); |
| 744 | 763 | sumMap1.put("fgs", "合计"); //分公司合计 |
| 764 | + sumMap1.put("level", ""); | |
| 745 | 765 | sumMap1.put("djgNum", "0"); |
| 746 | 766 | sumMap1.put("bcs", "0"); |
| 747 | 767 | sumMap2.put("gs", "合计"); //公司合计 |
| 768 | + sumMap2.put("fgs", ""); | |
| 769 | + sumMap2.put("level", ""); | |
| 748 | 770 | sumMap2.put("djgNum", "0"); |
| 749 | 771 | sumMap2.put("bcs", "0"); |
| 750 | 772 | for(Map<String, Object> m : countList){ |
| ... | ... | @@ -763,6 +785,7 @@ public class CalcIntervalServiceImpl extends BaseServiceImpl<CalcInterval,Intege |
| 763 | 785 | sumMap1 = new HashMap<String, Object>(); |
| 764 | 786 | sumMap1.put("gs", gsName); |
| 765 | 787 | sumMap1.put("fgs", "合计"); |
| 788 | + sumMap1.put("level", ""); | |
| 766 | 789 | sumMap1.put("djgNum", "0"); |
| 767 | 790 | sumMap1.put("bcs", "0"); |
| 768 | 791 | } |
| ... | ... | @@ -833,10 +856,10 @@ public class CalcIntervalServiceImpl extends BaseServiceImpl<CalcInterval,Intege |
| 833 | 856 | String xlsName=""; |
| 834 | 857 | m.put("sDate", sDate); |
| 835 | 858 | m.put("eDate", eDate); |
| 836 | - xls="calcIntervalCount.xls"; | |
| 837 | - xlsName="大间隔情况表.xls"; | |
| 859 | + xls="calcIntervalSum.xls"; | |
| 860 | + xlsName="大间隔发生次数汇总.xls"; | |
| 838 | 861 | |
| 839 | - ee.excelReplace(listI, new Object[]{m}, path + "mould/" + ""+xls, | |
| 862 | + ee.excelReplace(listI, new Object[]{m}, path + "mould/" + xls, | |
| 840 | 863 | path + "export/"+dateTime+"-"+lineName+"-"+xlsName); |
| 841 | 864 | } catch (Exception e) { |
| 842 | 865 | // TODO: handle exception | ... | ... |
src/main/resources/static/pages/forms/mould/calcIntervalCount.xls
No preview for this file type
src/main/resources/static/pages/forms/mould/calcIntervalList1.xls
No preview for this file type
src/main/resources/static/pages/forms/mould/calcIntervalSum.xls
0 → 100644
No preview for this file type
src/main/resources/static/pages/report/sheet/intervalCount.html
src/main/resources/static/pages/report/sheet/intervalSum.html
| ... | ... | @@ -18,7 +18,7 @@ |
| 18 | 18 | |
| 19 | 19 | <div class="page-head"> |
| 20 | 20 | <div class="page-title"> |
| 21 | - <h1>大间隔统计表</h1> | |
| 21 | + <h1>大间隔发生次数汇总</h1> | |
| 22 | 22 | </div> |
| 23 | 23 | </div> |
| 24 | 24 | |
| ... | ... | @@ -27,7 +27,7 @@ |
| 27 | 27 | <div class="portlet light porttlet-fit bordered"> |
| 28 | 28 | <div class="portlet-title"> |
| 29 | 29 | <form class="form-inline" action=""> |
| 30 | - <div style="display: inline-block; margin-left: 33px;" id="gsdmDiv"> | |
| 30 | + <div style="display: inline-block; margin-left: 42px;" id="gsdmDiv"> | |
| 31 | 31 | <span class="item-label" style="width: 80px;">公司: </span> |
| 32 | 32 | <select class="form-control" name="company" id="gsdm" style="width: 180px;"></select> |
| 33 | 33 | </div> |
| ... | ... | @@ -35,16 +35,16 @@ |
| 35 | 35 | <span class="item-label" style="width: 80px;">分公司: </span> |
| 36 | 36 | <select class="form-control" name="subCompany" id="fgsdm" style="width: 180px;"></select> |
| 37 | 37 | </div> |
| 38 | -<!-- <div style="display: inline-block;margin-left: 18px;"> --> | |
| 39 | -<!-- <span class="item-label" style="width: 80px;">线路性质: </span> --> | |
| 40 | -<!-- <select --> | |
| 41 | -<!-- class="form-control" name="nature" id="nature" --> | |
| 42 | -<!-- style="width: 180px;"> --> | |
| 43 | -<!-- <option value="0">全部线路</option> --> | |
| 44 | -<!-- <option value="1" selected="selected">营运线路</option> --> | |
| 45 | -<!-- <option value="2">非营运线路</option> --> | |
| 46 | -<!-- </select> --> | |
| 47 | -<!-- </div> --> | |
| 38 | + <div style="display: inline-block;margin-left: 18px;"> | |
| 39 | + <span class="item-label" style="width: 80px;">线路性质: </span> | |
| 40 | + <select | |
| 41 | + class="form-control" name="nature" id="nature" | |
| 42 | + style="width: 180px;"> | |
| 43 | + <option value="0" selected="selected">全部线路</option> | |
| 44 | + <option value="1">营运线路</option> | |
| 45 | + <option value="2">非营运线路</option> | |
| 46 | + </select> | |
| 47 | + </div> | |
| 48 | 48 | <div style="margin-top: 10px"> |
| 49 | 49 | </div> |
| 50 | 50 | <div style="display: inline-block;"> |
| ... | ... | @@ -56,10 +56,10 @@ |
| 56 | 56 | <input class="form-control" type="text" id="endDate" style="width: 180px;"/> |
| 57 | 57 | </div> |
| 58 | 58 | |
| 59 | - <div class="form-group"> | |
| 59 | + <div class="form-group" style="margin-left: 8px;"> | |
| 60 | 60 | <input type="hidden" id="id"/> |
| 61 | 61 | <input class="btn btn-default" type="button" id="query" value="查询"/> |
| 62 | -<!-- <input class="btn btn-default" type="button" id="export" value="导出"/> --> | |
| 62 | + <input class="btn btn-default" type="button" id="export" value="导出"/> | |
| 63 | 63 | </div> |
| 64 | 64 | </form> |
| 65 | 65 | </div> |
| ... | ... | @@ -72,8 +72,8 @@ |
| 72 | 72 | <td>公司</td> |
| 73 | 73 | <td>分公司</td> |
| 74 | 74 | <td>线路等级</td> |
| 75 | - <td>发生次数</td> | |
| 76 | - <td>班次数</td> | |
| 75 | + <td>大间隔发生次数</td> | |
| 76 | + <td>全日班次数</td> | |
| 77 | 77 | <td>万班次发生率</td> |
| 78 | 78 | </tr> |
| 79 | 79 | </thead> |
| ... | ... | @@ -166,9 +166,9 @@ |
| 166 | 166 | var endDate = $("#endDate").val(); |
| 167 | 167 | var fgs=$('#fgsdm').val(); |
| 168 | 168 | var gs=$('#gsdm').val(); |
| 169 | -// var nature=$("#nature").val(); | |
| 169 | + var nature=$("#nature").val(); | |
| 170 | 170 | var i = layer.load(2); |
| 171 | - $get('/calcInterval/sumInterval',{date:date,endDate:endDate,gs:gs,fgs:fgs,type:'query'},function(result){ | |
| 171 | + $get('/calcInterval/sumInterval',{date:date,endDate:endDate,gs:gs,fgs:fgs,nature:nature,type:'query'},function(result){ | |
| 172 | 172 | var intervalList_sum = template('intervalList_sum',{list:result}); |
| 173 | 173 | $('#forms_djg_sum tbody').html(intervalList_sum); |
| 174 | 174 | |
| ... | ... | @@ -185,13 +185,13 @@ |
| 185 | 185 | var endDate = $("#endDate").val(); |
| 186 | 186 | var fgs=$('#fgsdm').val(); |
| 187 | 187 | var gs=$('#gsdm').val(); |
| 188 | -// var nature=$('#nature').val(); | |
| 188 | + var nature=$('#nature').val(); | |
| 189 | 189 | var lineName = $('#fgsdm option:selected').text(); |
| 190 | 190 | if(lineName=="全部分公司") |
| 191 | 191 | lineName = $('#gsdm option:selected').text(); |
| 192 | 192 | |
| 193 | 193 | var i = layer.load(2); |
| 194 | - $get('/calcInterval/countList',{date:date,endDate:endDate,gs:gs,fgs:fgs,nature:nature,type:"export",lineName:lineName},function(result){ | |
| 194 | + $get('/calcInterval/sumInterval',{date:date,endDate:endDate,gs:gs,fgs:fgs,nature:nature,type:"export",lineName:lineName},function(result){ | |
| 195 | 195 | var dateTime = ""; |
| 196 | 196 | if(date == endDate){ |
| 197 | 197 | dateTime = moment(date).format("YYYYMMDD"); |
| ... | ... | @@ -200,7 +200,7 @@ |
| 200 | 200 | moment(endDate).format("YYYYMMDD"); |
| 201 | 201 | } |
| 202 | 202 | window.open("/downloadFile/download?fileName=" |
| 203 | - +dateTime+"-"+lineName+"-大间统计表"); | |
| 203 | + +dateTime+"-"+lineName+"-大间隔发生次数汇总"); | |
| 204 | 204 | |
| 205 | 205 | layer.close(i); |
| 206 | 206 | }); | ... | ... |