Commit ff2b0fb30306f8f2257742346ca8ba7457e75d35

Authored by 廖磊
1 parent d1711123

到离站加牌照 准点率时间区间查询 修正添加修改人

src/main/java/com/bsth/controller/report/ReportController.java
@@ -110,6 +110,7 @@ public class ReportController { @@ -110,6 +110,7 @@ public class ReportController {
110 Map<String, Object> m = new HashMap<String, Object>(); 110 Map<String, Object> m = new HashMap<String, Object>();
111 m.put("i", i); 111 m.put("i", i);
112 m.put("nbbm", a.getNbbm()); 112 m.put("nbbm", a.getNbbm());
  113 + m.put("pzh", a.getPzh());
113 m.put("stopName", a.getStopName()); 114 m.put("stopName", a.getStopName());
114 m.put("jzsj", a.getJzsj()); 115 m.put("jzsj", a.getJzsj());
115 m.put("czsj", a.getCzsj()); 116 m.put("czsj", a.getCzsj());
src/main/java/com/bsth/controller/report/SheetController.java
@@ -36,9 +36,21 @@ public class SheetController extends BaseController&lt;Sheet, Integer&gt;{ @@ -36,9 +36,21 @@ public class SheetController extends BaseController&lt;Sheet, Integer&gt;{
36 List<Sheet> list=sheetService.sheetList(id); 36 List<Sheet> list=sheetService.sheetList(id);
37 return list; 37 return list;
38 } 38 }
  39 + @RequestMapping(value = "/exportList",method = RequestMethod.GET)
  40 + public List<Sheet> exportList(@RequestParam Integer id){
  41 + List<Sheet> list=sheetService.exportList(id);
  42 + return list;
  43 + }
  44 +
39 @RequestMapping(value = "/countList",method = RequestMethod.GET) 45 @RequestMapping(value = "/countList",method = RequestMethod.GET)
40 public List<Map<String, Object>> countList(@RequestParam Map<String, Object> map){ 46 public List<Map<String, Object>> countList(@RequestParam Map<String, Object> map){
41 List<Map<String, Object>> list=sheetService.countList(map); 47 List<Map<String, Object>> list=sheetService.countList(map);
42 return list; 48 return list;
43 } 49 }
  50 +
  51 + @RequestMapping(value = "/listSheet",method = RequestMethod.GET)
  52 + public List<Map<String, Object>> listSheet(@RequestParam Map<String, Object> map){
  53 + List<Map<String, Object>> list=sheetService.listSheet(map);
  54 + return list;
  55 + }
44 } 56 }
src/main/java/com/bsth/entity/excep/ArrivalInfo.java
@@ -20,6 +20,8 @@ public class ArrivalInfo { @@ -20,6 +20,8 @@ public class ArrivalInfo {
20 20
21 private String nbbm; 21 private String nbbm;
22 22
  23 +
  24 + private String pzh;
23 /** 站点名称 */ 25 /** 站点名称 */
24 private String stopName; 26 private String stopName;
25 27
@@ -243,6 +245,14 @@ public class ArrivalInfo { @@ -243,6 +245,14 @@ public class ArrivalInfo {
243 public void setJzsj(String jzsj) { 245 public void setJzsj(String jzsj) {
244 this.jzsj = jzsj; 246 this.jzsj = jzsj;
245 } 247 }
  248 +
  249 + public String getPzh() {
  250 + return pzh;
  251 + }
  252 +
  253 + public void setPzh(String pzh) {
  254 + this.pzh = pzh;
  255 + }
246 256
247 257
248 258
src/main/java/com/bsth/service/realcontrol/impl/ScheduleRealInfoServiceImpl.java
@@ -2001,7 +2001,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -2001,7 +2001,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
2001 for (int i = 0; i < list.size(); i++) { 2001 for (int i = 0; i < list.size(); i++) {
2002 SchEditInfoDto t=list.get(i); 2002 SchEditInfoDto t=list.get(i);
2003 if(map.get(t.getType())!=null){ 2003 if(map.get(t.getType())!=null){
2004 - t.setType2(t.getTimeStr()+":"+map.get(t.getType()).toString()); 2004 + t.setType2(t.getUser()+"于"+t.getTimeStr()+"进行"+map.get(t.getType()).toString()+";");
2005 }else{ 2005 }else{
2006 t.setType2(""); 2006 t.setType2("");
2007 } 2007 }
@@ -2013,6 +2013,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -2013,6 +2013,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
2013 fage=false; 2013 fage=false;
2014 } 2014 }
2015 } 2015 }
  2016 +
2016 if(fage){ 2017 if(fage){
2017 lists.add(t); 2018 lists.add(t);
2018 } 2019 }
src/main/java/com/bsth/service/report/SheetService.java
@@ -10,6 +10,7 @@ public interface SheetService extends BaseService&lt;Sheet, Integer&gt;{ @@ -10,6 +10,7 @@ public interface SheetService extends BaseService&lt;Sheet, Integer&gt;{
10 public List<Map<String, Object>> bcPunctual(Map<String, Object> map); 10 public List<Map<String, Object>> bcPunctual(Map<String, Object> map);
11 public String saveSheetList(String date) throws Exception; 11 public String saveSheetList(String date) throws Exception;
12 public List<Map<String, Object>> countList(Map<String, Object> map); 12 public List<Map<String, Object>> countList(Map<String, Object> map);
13 - 13 + public List<Map<String, Object>> listSheet(Map<String, Object> map);
14 public List<Sheet> sheetList(Integer id); 14 public List<Sheet> sheetList(Integer id);
  15 + public List<Sheet> exportList(Integer id);
15 } 16 }
src/main/java/com/bsth/service/report/impl/ReportServiceImpl.java
@@ -156,7 +156,9 @@ public class ReportServiceImpl implements ReportService{ @@ -156,7 +156,9 @@ public class ReportServiceImpl implements ReportService{
156 while(rs.next()){ 156 while(rs.next()){
157 arr = new ArrivalInfo(); 157 arr = new ArrivalInfo();
158 arr.setDeviceId(rs.getString("device_id")); 158 arr.setDeviceId(rs.getString("device_id"));
159 - arr.setNbbm(BasicData.deviceId2NbbmMap.get(arr.getDeviceId())); 159 + String nbbm=BasicData.deviceId2NbbmMap.get(arr.getDeviceId());
  160 + arr.setNbbm(nbbm);
  161 + arr.setPzh(BasicData.nbbmCompanyPlateMap.get(nbbm));
160 if(null == arr.getNbbm()){ 162 if(null == arr.getNbbm()){
161 logger.warn("未注册的设备号," + arr.getDeviceId()); 163 logger.warn("未注册的设备号," + arr.getDeviceId());
162 continue; 164 continue;
src/main/java/com/bsth/service/report/impl/SheetServiceImpl.java
1 package com.bsth.service.report.impl; 1 package com.bsth.service.report.impl;
2 2
  3 +import java.lang.reflect.InvocationTargetException;
3 import java.sql.ResultSet; 4 import java.sql.ResultSet;
4 import java.sql.SQLException; 5 import java.sql.SQLException;
5 import java.text.DecimalFormat; 6 import java.text.DecimalFormat;
@@ -42,6 +43,7 @@ import com.bsth.service.report.SheetService; @@ -42,6 +43,7 @@ import com.bsth.service.report.SheetService;
42 import com.bsth.util.BatchSaveUtils; 43 import com.bsth.util.BatchSaveUtils;
43 import com.bsth.util.ComparableChild; 44 import com.bsth.util.ComparableChild;
44 import com.bsth.util.ComparableReal; 45 import com.bsth.util.ComparableReal;
  46 +import com.bsth.util.ReportRelatedUtils;
45 import com.google.common.util.concurrent.AbstractScheduledService.Scheduler; 47 import com.google.common.util.concurrent.AbstractScheduledService.Scheduler;
46 48
47 @Service 49 @Service
@@ -658,7 +660,8 @@ public class SheetServiceImpl extends BaseServiceImpl&lt;Sheet, Integer&gt; implements @@ -658,7 +660,8 @@ public class SheetServiceImpl extends BaseServiceImpl&lt;Sheet, Integer&gt; implements
658 fgs=map.get("fgs").toString(); 660 fgs=map.get("fgs").toString();
659 } 661 }
660 String date=map.get("date").toString(); 662 String date=map.get("date").toString();
661 - String sql="select * from bsth_c_sheet where date='"+date+"'"; 663 + String endDate=map.get("endDate").toString();
  664 + String sql="select * from bsth_c_sheet where date BETWEEN '"+date+"' and '"+endDate+"'";
662 if(line.trim().equals("")){ 665 if(line.trim().equals("")){
663 sql +=" and gs like '%"+gs+"%' and fgs like '%"+fgs+"%'"; 666 sql +=" and gs like '%"+gs+"%' and fgs like '%"+fgs+"%'";
664 }else{ 667 }else{
@@ -721,6 +724,7 @@ public class SheetServiceImpl extends BaseServiceImpl&lt;Sheet, Integer&gt; implements @@ -721,6 +724,7 @@ public class SheetServiceImpl extends BaseServiceImpl&lt;Sheet, Integer&gt; implements
721 String gs=BasicData.businessCodeNameMap.get(list.get(0).getGs()); 724 String gs=BasicData.businessCodeNameMap.get(list.get(0).getGs());
722 String fgs=BasicData.businessFgsCodeNameMap.get(list.get(0).getFgs()+"_"+list.get(0).getGs()); 725 String fgs=BasicData.businessFgsCodeNameMap.get(list.get(0).getFgs()+"_"+list.get(0).getGs());
723 String line=BasicData.lineCode2NameMap.get(list.get(0).getLine()); 726 String line=BasicData.lineCode2NameMap.get(list.get(0).getLine());
  727 + String date=list.get(0).getDate();
724 Integer id=list.get(0).getId(); 728 Integer id=list.get(0).getId();
725 int bcs=list.size(); 729 int bcs=list.size();
726 int zdbcs=0; 730 int zdbcs=0;
@@ -740,6 +744,7 @@ public class SheetServiceImpl extends BaseServiceImpl&lt;Sheet, Integer&gt; implements @@ -740,6 +744,7 @@ public class SheetServiceImpl extends BaseServiceImpl&lt;Sheet, Integer&gt; implements
740 map.put("zdbcs", zdbcs); 744 map.put("zdbcs", zdbcs);
741 map.put("zdlv", df.format(zdlv)+"%"); 745 map.put("zdlv", df.format(zdlv)+"%");
742 map.put("id", id); 746 map.put("id", id);
  747 + map.put("date", date);
743 return map; 748 return map;
744 } 749 }
745 @Override 750 @Override
@@ -781,6 +786,128 @@ public class SheetServiceImpl extends BaseServiceImpl&lt;Sheet, Integer&gt; implements @@ -781,6 +786,128 @@ public class SheetServiceImpl extends BaseServiceImpl&lt;Sheet, Integer&gt; implements
781 return list; 786 return list;
782 } 787 }
783 788
  789 + @Override
  790 + public List<Sheet> exportList(Integer id) {
  791 + // TODO Auto-generated method stub
  792 + ReportRelatedUtils rru = new ReportRelatedUtils();
  793 + Sheet sheet=sheetRepository.findOne(id);
  794 + String sql="select * from bsth_c_sheet where date='"+sheet.getDate()+"' and line = '"+sheet.getLine()+"'"
  795 + + " order by xl_dir,jhsj";
  796 +
  797 + List<Sheet> list=jdbcTemplate.query(sql,
  798 + new RowMapper<Sheet>(){
  799 + @Override
  800 + public Sheet mapRow(ResultSet rs, int rowNum) throws SQLException {
  801 + Sheet s=new Sheet();
  802 + s.setId(rs.getInt("id"));
  803 + s.setGs(rs.getString("gs"));
  804 + s.setFgs(rs.getString("fgs"));
  805 + s.setLine(rs.getString("line"));
  806 + s.setDate(rs.getString("date"));
  807 + s.setJhsj(rs.getString("jhsj"));
  808 + s.setJhsjt(rs.getLong("jhsjt"));
  809 + s.setSjsj(rs.getString("sjsj"));
  810 + s.setSjsjt(rs.getLong("sjsjt"));
  811 + s.setZdname(rs.getString("zdname"));
  812 + return s;
  813 + }
  814 + });
  815 +
  816 + List<Map<String, Object>> listMap = new ArrayList<Map<String, Object>>();
  817 + for (int i = 0; i < list.size(); i++) {
  818 + Sheet t=list.get(i);
  819 + t.setLine(BasicData.lineCode2NameMap.get(t.getLine()));
  820 + Long sjc=t.getJhsjt()-t.getSjsjt();
  821 + if(sjc>= 3*60*1000*-1 && sjc <=1*60*1000){
  822 + t.setSfzd("准点");
  823 + }else{
  824 + t.setSfzd("不准点");
  825 + }
  826 +
  827 + try {
  828 + Map<String, Object> map = rru.getMapValue(t);
  829 + listMap.add(map);
  830 + } catch (ClassNotFoundException e) {
  831 + // TODO Auto-generated catch block
  832 + e.printStackTrace();
  833 + } catch (IllegalAccessException e) {
  834 + // TODO Auto-generated catch block
  835 + e.printStackTrace();
  836 + } catch (InvocationTargetException e) {
  837 + // TODO Auto-generated catch block
  838 + e.printStackTrace();
  839 + } catch (NoSuchMethodException e) {
  840 + // TODO Auto-generated catch block
  841 + e.printStackTrace();
  842 + } catch (NoSuchFieldException e) {
  843 + // TODO Auto-generated catch block
  844 + e.printStackTrace();
  845 + }
  846 +
  847 + }
  848 +
  849 + return list;
  850 + }
  851 + @Override
  852 + public List<Map<String, Object>> listSheet(Map<String, Object> map) {
  853 + // TODO Auto-generated method stub
  854 + List<Map<String, Object>> listmap=new ArrayList<Map<String,Object>>();
  855 + Integer id=Integer.parseInt(map.get("id").toString());
  856 + Sheet sheet=sheetRepository.findOne(id);
  857 + String date=map.get("date").toString();
  858 + String endDate=map.get("endDate").toString();
  859 +
  860 + String sqlByDate="select date from bsth_c_sheet where date BETWEEN '"+date+"' and '"+endDate+"'"
  861 + + "and line = '"+sheet.getLine()+"' group by date order by date";
  862 +
  863 + List<String> dateList=jdbcTemplate.query(sqlByDate,
  864 + new RowMapper<String>(){
  865 + @Override
  866 + public String mapRow(ResultSet rs, int rowNum) throws SQLException {
  867 + String date=rs.getString("date");
  868 +
  869 + return date;
  870 + }
  871 + });
  872 +
  873 + String sql="select * from bsth_c_sheet where date BETWEEN '"+date+"' and '"+endDate+"'"
  874 + + " and line ='"+sheet.getLine()+"' order by date";
  875 +
  876 + List<Sheet> list=jdbcTemplate.query(sql,
  877 + new RowMapper<Sheet>(){
  878 + @Override
  879 + public Sheet mapRow(ResultSet rs, int rowNum) throws SQLException {
  880 + Sheet s=new Sheet();
  881 + s.setGs(rs.getString("gs"));
  882 + s.setFgs(rs.getString("fgs"));
  883 + s.setLine(rs.getString("line"));
  884 + s.setDate(rs.getString("date"));
  885 + s.setJhsj(rs.getString("jhsj"));
  886 + s.setJhsjt(rs.getLong("jhsjt"));
  887 + s.setSjsj(rs.getString("sjsj"));
  888 + s.setSjsjt(rs.getLong("sjsjt"));
  889 + s.setId(rs.getInt("id"));
  890 + return s;
  891 + }
  892 + });
  893 + for (int i = 0; i < dateList.size(); i++) {
  894 + String s=dateList.get(i);
  895 + List<Sheet> newList=new ArrayList<Sheet>();
  896 + for (int j = 0; j < list.size(); j++) {
  897 + Sheet t=list.get(j);
  898 + if(t.getDate().equals(s)){
  899 + newList.add(t);
  900 + }
  901 + }
  902 +
  903 + if(newList.size()>0){
  904 + Map<String, Object> newmap=culateByLine(newList);
  905 + listmap.add(newmap);
  906 + }
  907 + }
  908 + return listmap;
  909 + }
  910 +
784 911
785 } 912 }
786 class ComparableAcual implements Comparator<ScheduleRealInfo>{ 913 class ComparableAcual implements Comparator<ScheduleRealInfo>{
src/main/resources/static/pages/forms/mould/inoutstation.xls
No preview for this file type
src/main/resources/static/pages/forms/statement/correctForm.html
@@ -253,7 +253,7 @@ @@ -253,7 +253,7 @@
253 {{/each}} 253 {{/each}}
254 {{if list.length == 0}} 254 {{if list.length == 0}}
255 <tr> 255 <tr>
256 - <td colspan="6"><h6 class="muted">没有找到相关数据</h6></td> 256 + <td colspan="7"><h6 class="muted">没有找到相关数据</h6></td>
257 </tr> 257 </tr>
258 {{/if}} 258 {{/if}}
259 </script> 259 </script>
src/main/resources/static/pages/report/inoutstation.html
@@ -31,7 +31,7 @@ @@ -31,7 +31,7 @@
31 <div style="display: inline-block;margin-left: 15px;"> 31 <div style="display: inline-block;margin-left: 15px;">
32 <input class="item-label" type="radio" name="typeLx" checked="checked" value="1" /> 32 <input class="item-label" type="radio" name="typeLx" checked="checked" value="1" />
33 班次执行情况 33 班次执行情况
34 - <input class="item-label" type="radio" name="typeLX" value="2" /> 34 + <input class="item-label" type="radio" name="typeLx" value="2" />
35 车辆/站点 35 车辆/站点
36 </div> 36 </div>
37 <div style="display: inline-block; margin-left: 33px;" id="gsdmDiv"> 37 <div style="display: inline-block; margin-left: 33px;" id="gsdmDiv">
@@ -116,16 +116,17 @@ @@ -116,16 +116,17 @@
116 <thead> 116 <thead>
117 <tr> 117 <tr>
118 <td width="3%"></td> 118 <td width="3%"></td>
119 - <td width="9%">内部编码</td>  
120 - <td width="8%">到站名称</td>  
121 - <td width="8%">到站时刻</td>  
122 - <td width="8%">离站时刻</td>  
123 - <td width="8%">是否开关门</td>  
124 - <td width="8%">上下行</td> 119 + <td width="8%">内部编码</td>
  120 + <td width="8%">牌照号</td>
  121 + <td width="7%">到站名称</td>
  122 + <td width="7%">到站时刻</td>
  123 + <td width="7%">离站时刻</td>
  124 + <td width="7%">是否开关门</td>
  125 + <td width="7%">上下行</td>
125 <td width="8%">开门速度(公里/小时)</td> 126 <td width="8%">开门速度(公里/小时)</td>
126 - <td width="8%">补发</td>  
127 - <td width="8%">刷卡次数</td>  
128 - <td width="8%">刷卡金额</td> 127 + <td width="7%">补发</td>
  128 + <td width="7%">刷卡次数</td>
  129 + <td width="7%">刷卡金额</td>
129 <td width="8%">免费刷卡次数</td> 130 <td width="8%">免费刷卡次数</td>
130 <td width="8%">免费刷卡金额</td> 131 <td width="8%">免费刷卡金额</td>
131 </tr> 132 </tr>
@@ -497,6 +498,7 @@ @@ -497,6 +498,7 @@
497 <tr> 498 <tr>
498 <td>{{i+1}}</td> 499 <td>{{i+1}}</td>
499 <td>{{obj.nbbm}}</td> 500 <td>{{obj.nbbm}}</td>
  501 + <td>{{obj.pzh}}</td>
500 <td>{{obj.stopName}}</td> 502 <td>{{obj.stopName}}</td>
501 <td>{{obj.jzsj}}</td> 503 <td>{{obj.jzsj}}</td>
502 <td>{{obj.czsj}}</td> 504 <td>{{obj.czsj}}</td>
src/main/resources/static/pages/report/sheet/list.html
@@ -18,7 +18,7 @@ @@ -18,7 +18,7 @@
18 18
19 <div class="page-head"> 19 <div class="page-head">
20 <div class="page-title" style="margin-left: 20px"> 20 <div class="page-title" style="margin-left: 20px">
21 - <button>数据导出</button> 21 + <button id="exportList">数据导出</button>
22 </div> 22 </div>
23 </div> 23 </div>
24 24
@@ -27,7 +27,7 @@ @@ -27,7 +27,7 @@
27 <div class="portlet light porttlet-fit bordered"> 27 <div class="portlet light porttlet-fit bordered">
28 <div class="portlet-body"> 28 <div class="portlet-body">
29 <div class="table-container" style="margin-top: 10px;overflow:auto;min-width: 600px"> 29 <div class="table-container" style="margin-top: 10px;overflow:auto;min-width: 600px">
30 - <table class="table table-bordered table-hover table-checkable" id="forms_1"> 30 + <table class="table table-bordered table-hover table-checkable" id="forms_2">
31 <thead> 31 <thead>
32 <tr> 32 <tr>
33 <td></td> 33 <td></td>
@@ -40,7 +40,7 @@ @@ -40,7 +40,7 @@
40 </tr> 40 </tr>
41 </thead> 41 </thead>
42 42
43 - <tbody > 43 + <tbody>
44 44
45 </tbody> 45 </tbody>
46 </table> 46 </table>
@@ -55,32 +55,28 @@ @@ -55,32 +55,28 @@
55 // 关闭左侧栏 55 // 关闭左侧栏
56 if (!$('body').hasClass('page-sidebar-closed')) 56 if (!$('body').hasClass('page-sidebar-closed'))
57 $('.menu-toggler.sidebar-toggler').click(); 57 $('.menu-toggler.sidebar-toggler').click();
58 - 58 + var no="";
59 $("#sheetList").on('init', function (e, id) { 59 $("#sheetList").on('init', function (e, id) {
  60 + no=id;
60 $get('/sheet/sheetList',{id:id},function(result){ 61 $get('/sheet/sheetList',{id:id},function(result){
61 - var sheetList_1 = template('sheetList_1',{list:result});  
62 - $('#forms_1 tbody').html(sheetList_1); 62 + var sheetList_2 = template('sheetList_2',{list:result});
  63 + $('#forms_2 tbody').html(sheetList_2);
63 }); 64 });
64 }) 65 })
65 - /* $("#query").on('click',function(){  
66 - var line = $("#line").val();  
67 - var date = $("#date").val();  
68 - var fgs=$('#fgsdm').val();  
69 - var gs=$('#gsdm').val();  
70 - $get('/sheet/countList',{line:line,date:date,gs:gs,fgs:fgs},function(result){  
71 - var sheetList = template('sheetList',{list:result});  
72 - $('#forms tbody').html(sheetList);  
73 - $('.btn-sheetList').on('click', openSheetList);  
74 - });  
75 - }); */ 66 + $("#exportList").on('click',function(){
  67 +
  68 + $get('/sheet/exportList',params,function(result){
  69 + window.open("/downloadFile/download?fileName=班次车辆人员月报表"+moment($("#startDate").val()).format("YYYYMMDD"));
  70 + });
  71 + });
76 72
77 73
78 }); 74 });
79 </script> 75 </script>
80 -<script type="text/html" id="sheetList_1"> 76 +<script type="text/html" id="sheetList_2">
81 {{each list as obj i}} 77 {{each list as obj i}}
82 <tr {{if obj.sfzd!="Y"}}style="color: red" {{/if}}> 78 <tr {{if obj.sfzd!="Y"}}style="color: red" {{/if}}>
83 - <td>{{i}}</td> 79 + <td>{{i+1}}</td>
84 <td>{{obj.date}}</td> 80 <td>{{obj.date}}</td>
85 <td>{{obj.line}}</td> 81 <td>{{obj.line}}</td>
86 <td>{{obj.zdname}}</td> 82 <td>{{obj.zdname}}</td>
src/main/resources/static/pages/report/sheet/sheetList.html
@@ -35,14 +35,20 @@ @@ -35,14 +35,20 @@
35 <span class="item-label" style="width: 80px;">分公司: </span> 35 <span class="item-label" style="width: 80px;">分公司: </span>
36 <select class="form-control" name="subCompany" id="fgsdm" style="width: 180px;"></select> 36 <select class="form-control" name="subCompany" id="fgsdm" style="width: 180px;"></select>
37 </div> 37 </div>
38 - <div style="display: inline-block;margin-left: 15px;"> 38 + <div style="margin-top: 10px">
  39 + </div>
  40 + <div style="display: inline-block;margin-left: 33px;">
39 <span class="item-label" style="width: 80px;">线路: </span> 41 <span class="item-label" style="width: 80px;">线路: </span>
40 <select class="form-control" name="line" id="line" style="width: 180px;"></select> 42 <select class="form-control" name="line" id="line" style="width: 180px;"></select>
41 </div> 43 </div>
42 <div style="display: inline-block;"> 44 <div style="display: inline-block;">
43 - <span class="item-label" style="width: 80px;">时间: </span> 45 + <span class="item-label" style="width: 80px;margin-left: 24px;">开始时间: </span>
44 <input class="form-control" type="text" id="date" style="width: 180px;"/> 46 <input class="form-control" type="text" id="date" style="width: 180px;"/>
45 </div> 47 </div>
  48 + <div style="display: inline-block;">
  49 + <span class="item-label" style="width: 80px;margin-left: 24px;">结束时间: </span>
  50 + <input class="form-control" type="text" id="endDate" style="width: 180px;"/>
  51 + </div>
46 52
47 <div class="form-group"> 53 <div class="form-group">
48 <input class="btn btn-default" type="button" id="query" value="查询"/> 54 <input class="btn btn-default" type="button" id="query" value="查询"/>
@@ -65,7 +71,28 @@ @@ -65,7 +71,28 @@
65 </tr> 71 </tr>
66 </thead> 72 </thead>
67 73
68 - <tbody > 74 + <tbody>
  75 +
  76 + </tbody>
  77 + </table>
  78 + </div>
  79 +
  80 + <div class="table-container" style="margin-top: 10px;overflow:auto;min-width: 906px">
  81 + <table class="table table-bordered table-hover table-checkable" id="forms_1">
  82 + <thead>
  83 + <tr class="hidden">
  84 + <td>公司</td>
  85 + <td>分公司</td>
  86 + <td>日期</td>
  87 + <td>线路</td>
  88 + <td>班次数</td>
  89 + <td>准点班次数</td>
  90 + <td>准点率</td>
  91 + <td>查看</td>
  92 + </tr>
  93 + </thead>
  94 +
  95 + <tbody>
69 96
70 </tbody> 97 </tbody>
71 </table> 98 </table>
@@ -85,6 +112,10 @@ @@ -85,6 +112,10 @@
85 format : 'YYYY-MM-DD', 112 format : 'YYYY-MM-DD',
86 locale : 'zh-cn' 113 locale : 'zh-cn'
87 }); 114 });
  115 + $("#endDate").datetimepicker({
  116 + format : 'YYYY-MM-DD',
  117 + locale : 'zh-cn'
  118 + });
88 var d = new Date(); 119 var d = new Date();
89 var year = d.getFullYear(); 120 var year = d.getFullYear();
90 var month = d.getMonth() + 1; 121 var month = d.getMonth() + 1;
@@ -93,8 +124,10 @@ @@ -93,8 +124,10 @@
93 day = "0"+day; 124 day = "0"+day;
94 if(month > 9){ 125 if(month > 9){
95 $("#date").val(year + "-" + month + "-" + day); 126 $("#date").val(year + "-" + month + "-" + day);
  127 + $("#endDate").val(year + "-" + month + "-" + day);
96 } else { 128 } else {
97 $("#date").val(year + "-0" + month + "-" + day); 129 $("#date").val(year + "-0" + month + "-" + day);
  130 + $("#endDate").val(year + "-" + month + "-" + day);
98 } 131 }
99 132
100 var fage=false; 133 var fage=false;
@@ -172,19 +205,34 @@ @@ -172,19 +205,34 @@
172 $("#query").on('click',function(){ 205 $("#query").on('click',function(){
173 var line = $("#line").val(); 206 var line = $("#line").val();
174 var date = $("#date").val(); 207 var date = $("#date").val();
  208 + var endDate = $("#endDate").val();
175 var fgs=$('#fgsdm').val(); 209 var fgs=$('#fgsdm').val();
176 var gs=$('#gsdm').val(); 210 var gs=$('#gsdm').val();
177 - $get('/sheet/countList',{line:line,date:date,gs:gs,fgs:fgs},function(result){ 211 + $get('/sheet/countList',{line:line,date:date,endDate:endDate,gs:gs,fgs:fgs},function(result){
178 var sheetList = template('sheetList',{list:result}); 212 var sheetList = template('sheetList',{list:result});
179 $('#forms tbody').html(sheetList); 213 $('#forms tbody').html(sheetList);
180 - $('.btn-sheetList').on('click', openSheetList); 214 + $('.btn-sheetList').on('click', showSheetList);
181 }); 215 });
182 // $post('/sheet/saveListSheet',function(result){ 216 // $post('/sheet/saveListSheet',function(result){
183 // }); 217 // });
184 }); 218 });
185 - 219 + function showSheetList(){
  220 + var id = $(this).data('id');
  221 + var date = $("#date").val();
  222 + var endDate = $("#endDate").val();
  223 + $get('/sheet/listSheet',{id:id,date:date,endDate:endDate},function(result){
  224 + var sheetList = template('sheetList_1',{list:result});
  225 +
  226 + $('#forms_1 tbody').html(sheetList);
  227 + $('.btn-sheetList_1').on('click', openSheetList);
  228 + $("#forms_1 .hidden").removeClass("hidden");
  229 + $("html,body").animate({scrollTop:$("#forms_1").offset().top},1000);
  230 +
  231 + });
  232 + }
186 function openSheetList(){ 233 function openSheetList(){
187 var id = $(this).data('id'); 234 var id = $(this).data('id');
  235 + console.log(id);
188 $.get('/pages/report/sheet/list.html', function (content) { 236 $.get('/pages/report/sheet/list.html', function (content) {
189 layer.open({ 237 layer.open({
190 type: 1, 238 type: 1,
@@ -221,4 +269,27 @@ @@ -221,4 +269,27 @@
221 <td colspan="7"><h6 class="muted">没有找到相关数据</h6></td> 269 <td colspan="7"><h6 class="muted">没有找到相关数据</h6></td>
222 </tr> 270 </tr>
223 {{/if}} 271 {{/if}}
  272 +</script>
  273 +
  274 +<script type="text/html" id="sheetList_1">
  275 + {{each list as obj i}}
  276 + <tr>
  277 + <td>{{obj.gs}}</td>
  278 + <td>{{obj.fgs}}</td>
  279 + <td>{{obj.date}}</td>
  280 + <td>{{obj.line}}</td>
  281 + <td>{{obj.bcs}}</td>
  282 + <td>{{obj.zdbcs}}</td>
  283 + <td>{{obj.zdlv}}</td>
  284 + <td>
  285 + <button type="button" class="btn btn-sm blue btn-sheetList_1"
  286 + data-id="{{obj.id}}">详细</button>
  287 + </td>
  288 + </tr>
  289 + {{/each}}
  290 + {{if list.length == 0}}
  291 + <tr>
  292 + <td colspan="7"><h6 class="muted">没有找到相关数据</h6></td>
  293 + </tr>
  294 + {{/if}}
224 </script> 295 </script>
225 \ No newline at end of file 296 \ No newline at end of file