Commit 289d761832d1dbf5fcc2a57d4d15f77ce59cda05

Authored by 娄高锋
1 parent 2283456a

LGF 导出

src/main/java/com/bsth/service/schedule/PeopleCarPlanServiceImpl.java
@@ -313,6 +313,8 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { @@ -313,6 +313,8 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
313 // TODO Auto-generated catch block 313 // TODO Auto-generated catch block
314 e.printStackTrace(); 314 e.printStackTrace();
315 } 315 }
  316 + String companyName = "", subCompanyName = "";
  317 +
316 for(String key : keyMap.keySet()){ 318 for(String key : keyMap.keySet()){
317 Map<String, Object> tempMap = new HashMap<String, Object>(); 319 Map<String, Object> tempMap = new HashMap<String, Object>();
318 Map<String, List <ScheduleRealInfo>> listMap = new HashMap<String, List <ScheduleRealInfo>>(); 320 Map<String, List <ScheduleRealInfo>> listMap = new HashMap<String, List <ScheduleRealInfo>>();
@@ -323,6 +325,10 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { @@ -323,6 +325,10 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
323 int jhzgf = 0, sjzgf = 0, jhwgf = 0, sjwgf = 0; 325 int jhzgf = 0, sjzgf = 0, jhwgf = 0, sjwgf = 0;
324 for(ScheduleRealInfo schedule : keyMap.get(key)){ 326 for(ScheduleRealInfo schedule : keyMap.get(key)){
325 // schedule.setFcsjAll(schedule.getFcsj()); 327 // schedule.setFcsjAll(schedule.getFcsj());
  328 + if(companyName.length() == 0 && schedule.getGsName() != null)
  329 + companyName = schedule.getGsName();
  330 + if(subCompanyName.length() == 0 && schedule.getFgsName() != null)
  331 + subCompanyName = schedule.getFgsName();
326 332
327 //早晚高峰时段执行率 333 //早晚高峰时段执行率
328 if(schedule.getFcsjT() >= zgfBegin && schedule.getFcsjT() <= zgfEnd){ 334 if(schedule.getFcsjT() >= zgfBegin && schedule.getFcsjT() <= zgfEnd){
@@ -424,6 +430,8 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { @@ -424,6 +430,8 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
424 430
425 } 431 }
426 432
  433 + tempMap.put("company", companyName);
  434 + tempMap.put("subCompany", subCompanyName);
427 tempMap.put("date", date); 435 tempMap.put("date", date);
428 tempMap.put("line", key); 436 tempMap.put("line", key);
429 tempMap.put("jhbc", jhbc); 437 tempMap.put("jhbc", jhbc);
@@ -509,6 +517,8 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { @@ -509,6 +517,8 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
509 schedule.setScheduleDateStr(rs.getString("schedule_date_Str")); 517 schedule.setScheduleDateStr(rs.getString("schedule_date_Str"));
510 schedule.setXlName(rs.getString("xl_name")); 518 schedule.setXlName(rs.getString("xl_name"));
511 schedule.setBcType(rs.getString("bc_type")); 519 schedule.setBcType(rs.getString("bc_type"));
  520 + schedule.setGsName(rs.getString("gs_name"));
  521 + schedule.setFgsName(rs.getString("fgs_name"));
512 schedule.setBcs(rs.getInt("bcs")); 522 schedule.setBcs(rs.getInt("bcs"));
513 schedule.setFcno(rs.getInt("fcno")); 523 schedule.setFcno(rs.getInt("fcno"));
514 schedule.setFcsj(rs.getString("fcsj")); 524 schedule.setFcsj(rs.getString("fcsj"));
@@ -588,6 +598,7 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { @@ -588,6 +598,7 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
588 } 598 }
589 } 599 }
590 } 600 }
  601 + String companyName = "", subCompanyName = "";
591 for(String key : keyMap.keySet()){ 602 for(String key : keyMap.keySet()){
592 Map<String, Object> tempMap = new HashMap<String, Object>(); 603 Map<String, Object> tempMap = new HashMap<String, Object>();
593 List<Integer> fcsj = new ArrayList<Integer>(); 604 List<Integer> fcsj = new ArrayList<Integer>();
@@ -595,6 +606,11 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { @@ -595,6 +606,11 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
595 int jhbc = 0; 606 int jhbc = 0;
596 int sjbc = 0; 607 int sjbc = 0;
597 for(ScheduleRealInfo schedule : keyMap.get(key)){ 608 for(ScheduleRealInfo schedule : keyMap.get(key)){
  609 + if(companyName.length() == 0 && schedule.getGsName() != null)
  610 + companyName = schedule.getGsName();
  611 + if(subCompanyName.length() == 0 && schedule.getFgsName() != null)
  612 + subCompanyName = schedule.getFgsName();
  613 +
598 tempMap.put("date", schedule.getScheduleDateStr()); 614 tempMap.put("date", schedule.getScheduleDateStr());
599 tempMap.put("bcsj", schedule.getBcsj()); 615 tempMap.put("bcsj", schedule.getBcsj());
600 if(schedule.getFcsjActual() != null){ 616 if(schedule.getFcsjActual() != null){
@@ -654,6 +670,8 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { @@ -654,6 +670,8 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
654 tempMap.put("zmys", "/"); 670 tempMap.put("zmys", "/");
655 tempMap.put("pjys", "/"); 671 tempMap.put("pjys", "/");
656 } 672 }
  673 + tempMap.put("company", companyName);
  674 + tempMap.put("subCompany", subCompanyName);
657 String[] split = key.split("/"); 675 String[] split = key.split("/");
658 tempMap.put("line", split[0]); 676 tempMap.put("line", split[0]);
659 tempMap.put("qdz", split[1]); 677 tempMap.put("qdz", split[1]);
src/main/resources/static/pages/forms/mould/peoCarPlan.xls
No preview for this file type
src/main/resources/static/pages/forms/mould/scheduleAnaly.xls
No preview for this file type
src/main/resources/static/pages/forms/mould/workDaily.xls
No preview for this file type
src/main/resources/static/pages/forms/statement/firstAndLastBus.html
@@ -97,6 +97,7 @@ @@ -97,6 +97,7 @@
97 97
98 <script> 98 <script>
99 $(function(){ 99 $(function(){
  100 + $('#export').attr('disabled', "true");
100 101
101 // 关闭左侧栏 102 // 关闭左侧栏
102 if (!$('body').hasClass('page-sidebar-closed')) 103 if (!$('body').hasClass('page-sidebar-closed'))
@@ -186,11 +187,22 @@ @@ -186,11 +187,22 @@
186 // 把渲染好的模版html文本追加到表格中 187 // 把渲染好的模版html文本追加到表格中
187 $('#forms tbody').html(tbodyHtml); 188 $('#forms tbody').html(tbodyHtml);
188 189
  190 + if(result.length == 0)
  191 + $("#export").attr('disabled',"true");
  192 + else
  193 + $("#export").removeAttr("disabled");
189 }); 194 });
190 } 195 }
191 196
192 $("#export").on("click",function(){ 197 $("#export").on("click",function(){
193 - $get('/pcpc/firstAndLastBus',{line:line,date:date,type:'export'},function(result){ 198 + var params = {};
  199 + params['company'] = company;
  200 + params['subCompany'] = subCompany;
  201 + params['line'] = line;
  202 + params['line'] = line;
  203 + params['date'] = date;
  204 + params['type'] = "export";
  205 + $get('/pcpc/firstAndLastBus', params, function(result){
194 window.open("/downloadFile/download?fileName=线路首末班"+moment(date).format("YYYYMMDD")); 206 window.open("/downloadFile/download?fileName=线路首末班"+moment(date).format("YYYYMMDD"));
195 }); 207 });
196 }); 208 });
src/main/resources/static/pages/forms/statement/peopleCarPlan.html
@@ -80,6 +80,7 @@ @@ -80,6 +80,7 @@
80 80
81 <script> 81 <script>
82 $(function(){ 82 $(function(){
  83 + $('#export').attr('disabled', "true");
83 84
84 // 关闭左侧栏 85 // 关闭左侧栏
85 if (!$('body').hasClass('page-sidebar-closed')) 86 if (!$('body').hasClass('page-sidebar-closed'))
@@ -168,11 +169,21 @@ @@ -168,11 +169,21 @@
168 // 把渲染好的模版html文本追加到表格中 169 // 把渲染好的模版html文本追加到表格中
169 $('#forms tbody').html(tbodyHtml); 170 $('#forms tbody').html(tbodyHtml);
170 171
  172 + if(result.length == 0)
  173 + $("#export").attr('disabled',"true");
  174 + else
  175 + $("#export").removeAttr("disabled");
171 }); 176 });
172 } 177 }
173 178
174 $("#export").on("click",function(){ 179 $("#export").on("click",function(){
175 - $get('/pcpc/queryPeopleCar',{line:line,date:date,type:'export'},function(result){ 180 + var params = {};
  181 + params['company'] = company;
  182 + params['subCompany'] = subCompany;
  183 + params['line'] = line;
  184 + params['date'] = date;
  185 + params['type'] = "export";
  186 + $get('/pcpc/queryPeopleCar', params, function(result){
176 window.open("/downloadFile/download?fileName=计划车辆班次人员"+moment(date).format("YYYYMMDD")); 187 window.open("/downloadFile/download?fileName=计划车辆班次人员"+moment(date).format("YYYYMMDD"));
177 }); 188 });
178 }); 189 });
src/main/resources/static/pages/forms/statement/scheduleAnaly.html
@@ -65,18 +65,21 @@ @@ -65,18 +65,21 @@
65 <table class="table table-bordered table-hover table-checkable" id="forms"> 65 <table class="table table-bordered table-hover table-checkable" id="forms">
66 <thead> 66 <thead>
67 <tr class="hidden"> 67 <tr class="hidden">
68 - <th width="10%">线路</th>  
69 - <th width="10%">起点站名</th>  
70 - <th width="8%">计发时间</th>  
71 - <th width="8%">计划运送时间(分)</th>  
72 - <th width="8%">计划完成次数</th>  
73 - <th width="8%">完成次数</th>  
74 - <th width="8%">最早发车时间</th>  
75 - <th width="8%">最晚发车时间</th>  
76 - <th width="8%">平均发车时间</th>  
77 - <th width="8%">最慢运送时间(分)</th>  
78 - <th width="8%">最快运送时间(分)</th>  
79 - <th width="8%">平均运送时间(分)</th> 68 + <th style="display: none;"></th>
  69 + <th width="8%">公司</th>
  70 + <th width="8%">分公司</th>
  71 + <th width="8%">线路</th>
  72 + <th width="8%">起点站名</th>
  73 + <th width="6%">计发时间</th>
  74 + <th width="6%">计划运送时间(分)</th>
  75 + <th width="6%">计划完成次数</th>
  76 + <th width="6%">完成次数</th>
  77 + <th width="6%">最早发车时间</th>
  78 + <th width="6%">最晚发车时间</th>
  79 + <th width="6%">平均发车时间</th>
  80 + <th width="6%">最慢运送时间(分)</th>
  81 + <th width="6%">最快运送时间(分)</th>
  82 + <th width="6%">平均运送时间(分)</th>
80 </tr> 83 </tr>
81 </thead> 84 </thead>
82 <tbody> 85 <tbody>
@@ -95,6 +98,7 @@ @@ -95,6 +98,7 @@
95 <script> 98 <script>
96 $(function(){ 99 $(function(){
97 var page = 0, initPagination; 100 var page = 0, initPagination;
  101 + $('#export').attr('disabled', "true");
98 102
99 // 关闭左侧栏 103 // 关闭左侧栏
100 if (!$('body').hasClass('page-sidebar-closed')) 104 if (!$('body').hasClass('page-sidebar-closed'))
@@ -200,6 +204,11 @@ @@ -200,6 +204,11 @@
200 // 把渲染好的模版html文本追加到表格中 204 // 把渲染好的模版html文本追加到表格中
201 $('#forms tbody').html(tbodyHtml); 205 $('#forms tbody').html(tbodyHtml);
202 206
  207 + if(result.dataList.length == 0)
  208 + $("#export").attr('disabled',"true");
  209 + else
  210 + $("#export").removeAttr("disabled");
  211 +
203 if(pagination && result.dataList.length > 0){ 212 if(pagination && result.dataList.length > 0){
204 //重新分页 213 //重新分页
205 initPagination = true; 214 initPagination = true;
@@ -213,7 +222,16 @@ @@ -213,7 +222,16 @@
213 } 222 }
214 223
215 $("#export").on("click",function(){ 224 $("#export").on("click",function(){
216 - $get('/pcpc/scheduleAnaly',{page:'',line:line,startDate:startDate,endDate:endDate,model:model,type:'export'},function(result){ 225 + var params = {};
  226 + params['page'] = page;
  227 + params['line'] = line;
  228 + params['startDate'] = startDate;
  229 + params['endDate'] = endDate;
  230 + params['model'] = model;
  231 + params['company'] = company;
  232 + params['subCompany'] = subCompany;
  233 + params['type'] = "export";
  234 + $get('/pcpc/scheduleAnaly', params, function(result){
217 window.open("/downloadFile/download?fileName=时刻表分析"+moment(startDate).format("YYYYMMDD")+"-"+moment(endDate).format("YYYYMMDD")); 235 window.open("/downloadFile/download?fileName=时刻表分析"+moment(startDate).format("YYYYMMDD")+"-"+moment(endDate).format("YYYYMMDD"));
218 }); 236 });
219 }); 237 });
@@ -289,6 +307,9 @@ @@ -289,6 +307,9 @@
289 <script type="text/html" id="list_scheduleAnaly"> 307 <script type="text/html" id="list_scheduleAnaly">
290 {{each list as obj i}} 308 {{each list as obj i}}
291 <tr> 309 <tr>
  310 + <th style="display: none;"></th>
  311 + <td>{{obj.company}}</td>
  312 + <td>{{obj.subCompany}}</td>
292 <td>{{obj.line}}</td> 313 <td>{{obj.line}}</td>
293 <td>{{obj.qdz}}</td> 314 <td>{{obj.qdz}}</td>
294 <td>{{obj.jhfc}}</td> 315 <td>{{obj.jhfc}}</td>
@@ -305,7 +326,7 @@ @@ -305,7 +326,7 @@
305 {{/each}} 326 {{/each}}
306 {{if list.length == 0}} 327 {{if list.length == 0}}
307 <tr> 328 <tr>
308 - <td colspan="12"><h6 class="muted">没有找到相关数据</h6></td> 329 + <td colspan="14"><h6 class="muted">没有找到相关数据</h6></td>
309 </tr> 330 </tr>
310 {{/if}} 331 {{/if}}
311 </script> 332 </script>
312 \ No newline at end of file 333 \ No newline at end of file
src/main/resources/static/pages/forms/statement/workDaily.html
@@ -55,11 +55,13 @@ @@ -55,11 +55,13 @@
55 <thead> 55 <thead>
56 <tr class="hidden"> 56 <tr class="hidden">
57 <th width="80px">日期</th> 57 <th width="80px">日期</th>
58 - <th width="100px">线路</th> 58 + <th>公司</th>
  59 + <th>分公司</th>
  60 + <th>线路</th>
59 <th>计划班次</th> 61 <th>计划班次</th>
60 <th>待发调整</th> 62 <th>待发调整</th>
61 - <th>待发调整比率</th>  
62 - <th>出场率</th> 63 + <th width="60px">待发调整比率</th>
  64 + <th width="60px">出场率</th>
63 <th width="46px">上行发快</th> 65 <th width="46px">上行发快</th>
64 <th width="46px">上行到快</th> 66 <th width="46px">上行到快</th>
65 <th width="46px">下行发快</th> 67 <th width="46px">下行发快</th>
@@ -68,9 +70,9 @@ @@ -68,9 +70,9 @@
68 <th width="46px">上行到慢</th> 70 <th width="46px">上行到慢</th>
69 <th width="46px">下行发慢</th> 71 <th width="46px">下行发慢</th>
70 <th width="46px">下行到慢</th> 72 <th width="46px">下行到慢</th>
71 - <th>误点总数(快/慢)</th>  
72 - <th>首末班准点率</th>  
73 - <th>高峰班次执行率(早/晚)</th> 73 + <th width="75px">误点总数(快/慢)</th>
  74 + <th width="100px">首末班准点率</th>
  75 + <th width="100px">高峰班次执行率(早/晚)</th>
74 </tr> 76 </tr>
75 </thead> 77 </thead>
76 <tbody> 78 <tbody>
@@ -88,6 +90,7 @@ @@ -88,6 +90,7 @@
88 90
89 <script> 91 <script>
90 $(function(){ 92 $(function(){
  93 + $('#export').attr('disabled', "true");
91 94
92 // 关闭左侧栏 95 // 关闭左侧栏
93 if (!$('body').hasClass('page-sidebar-closed')) 96 if (!$('body').hasClass('page-sidebar-closed'))
@@ -176,11 +179,21 @@ @@ -176,11 +179,21 @@
176 // 把渲染好的模版html文本追加到表格中 179 // 把渲染好的模版html文本追加到表格中
177 $('#forms tbody').html(tbodyHtml); 180 $('#forms tbody').html(tbodyHtml);
178 181
  182 + if(result.length == 0)
  183 + $("#export").attr('disabled',"true");
  184 + else
  185 + $("#export").removeAttr("disabled");
179 }); 186 });
180 } 187 }
181 188
182 $("#export").on("click",function(){ 189 $("#export").on("click",function(){
183 - $get('/pcpc/workDaily',{line:line,date:date,type:'export'},function(result){ 190 + var params = {};
  191 + params['line'] = line;
  192 + params['date'] = date;
  193 + params['type'] = "export";
  194 + params['company'] = company;
  195 + params['subCompany'] = subCompany;
  196 + $get('/pcpc/workDaily', params, function(result){
184 window.open("/downloadFile/download?fileName=营运服务日报表"+moment(date).format("YYYYMMDD")); 197 window.open("/downloadFile/download?fileName=营运服务日报表"+moment(date).format("YYYYMMDD"));
185 }); 198 });
186 }); 199 });
@@ -193,6 +206,8 @@ @@ -193,6 +206,8 @@
193 {{each list as obj i}} 206 {{each list as obj i}}
194 <tr> 207 <tr>
195 <td>{{obj.date}}</td> 208 <td>{{obj.date}}</td>
  209 + <td>{{obj.company}}</td>
  210 + <td>{{obj.subCompany}}</td>
196 <td>{{obj.line}}</td> 211 <td>{{obj.line}}</td>
197 <td>{{obj.jhbc}}</td> 212 <td>{{obj.jhbc}}</td>
198 <td>{{obj.dftz}}</td> 213 <td>{{obj.dftz}}</td>
@@ -213,7 +228,7 @@ @@ -213,7 +228,7 @@
213 {{/each}} 228 {{/each}}
214 {{if list.length == 0}} 229 {{if list.length == 0}}
215 <tr> 230 <tr>
216 - <td colspan="17"><h6 class="muted">没有找到相关数据</h6></td> 231 + <td colspan="19"><h6 class="muted">没有找到相关数据</h6></td>
217 </tr> 232 </tr>
218 {{/if}} 233 {{/if}}
219 </script> 234 </script>
220 \ No newline at end of file 235 \ No newline at end of file