Commit a884f08187bcde04e01ed5c9c0eaa8a7d93c0712

Authored by 娄高锋
1 parent 56b9c321

时刻表分析

src/main/java/com/bsth/service/schedule/impl/PeopleCarPlanServiceImpl.java
... ... @@ -565,7 +565,10 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
565 565 }
566 566 try {
567 567  
568   - String sql = "select * from bsth_c_s_sp_info_real where schedule_date_str >= '"+startDate+"' and schedule_date_str <= '"+endDate+"'";
  568 + String sql = "select schedule_date_str,xl_name,bc_type,gs_name,fgs_name,bcs,fcno,"
  569 + +"fcsj,fcsj_actual,zdsj,zdsj_actual,bcsj,qdz_name,sp_id,cc_service"
  570 + +" from bsth_c_s_sp_info_real where schedule_date_str >= '"+startDate
  571 + +"' and schedule_date_str <= '"+endDate+"'";
569 572 if(line.length() != 0){
570 573 sql += " and xl_bm = '"+line+"'";
571 574 }
... ... @@ -636,8 +639,8 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
636 639  
637 640 if(model.length() != 0){
638 641 // sql = "select * from bsth_c_s_ttinfo_detail where ttinfo = '"+model+"' and bc_type != 'in' and bc_type != 'out'";
639   - sql = "select id from bsth_c_s_sp_info where tt_info = '" + model + "' and bc_type != 'in' and bc_type != 'out'" +
640   - " and bc_type != 'ldks' and schedule_date >= '"+startDate+"' and schedule_date <= '"+endDate+"'";
  642 + sql = "select id from bsth_c_s_sp_info where tt_info = '" + model + "' and bc_type != 'in' and bc_type != 'out'"
  643 + + " and bc_type != 'ldks' and schedule_date >= '"+startDate+"' and schedule_date <= '"+endDate+"'";
641 644 if(line.length() != 0){
642 645 sql += " and xl_bm = '"+line+"'";
643 646 }
... ... @@ -656,21 +659,21 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
656 659 e.printStackTrace();
657 660 }
658 661  
  662 + Set<Long> ttSet = new HashSet<Long>();
  663 + for(Long tt : ttList){
  664 + ttSet.add(tt);
  665 + }
659 666 //分组计算 同时判断是否所选时刻信息
660 667 for(ScheduleRealInfo schedule : list){
661 668 if(schedule.isCcService()){
662 669 continue;
663 670 }
664   - DO:{
665 671 if(model.length() != 0){
666   - for(Long tt : ttList){
667   - if((long)tt == (long)schedule.getSpId()){
668   - String key = schedule.getXlName()+"/"+schedule.getQdzName()+"/"+schedule.getFcsj();
669   - if(!keyMap.containsKey(key))
670   - keyMap.put(key, new ArrayList<ScheduleRealInfo>());
671   - keyMap.get(key).add(schedule);
672   - break DO;
673   - }
  672 + if(ttSet.contains(schedule.getSpId())){
  673 + String key = schedule.getXlName()+"/"+schedule.getQdzName()+"/"+schedule.getFcsj();
  674 + if(!keyMap.containsKey(key))
  675 + keyMap.put(key, new ArrayList<ScheduleRealInfo>());
  676 + keyMap.get(key).add(schedule);
674 677 }
675 678 } else {
676 679 String key = schedule.getXlName()+"/"+schedule.getQdzName()+"/"+schedule.getFcsj();
... ... @@ -678,7 +681,6 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
678 681 keyMap.put(key, new ArrayList<ScheduleRealInfo>());
679 682 keyMap.get(key).add(schedule);
680 683 }
681   - }
682 684 }
683 685 String companyName = "", subCompanyName = "";
684 686 for(String key : keyMap.keySet()){
... ... @@ -800,7 +802,8 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
800 802 if(page.length() != 0 && type.equals("query")){
801 803 int currPage = Integer.valueOf(page);
802 804 modelMap.put("totalPage", resList.size()%10>0?(resList.size()/10 + 1):resList.size()/10);
803   - modelMap.put("dataList", resList.subList(currPage*10,((currPage+1)*10)>=resList.size()?resList.size():(currPage+1)*10));
  805 +// modelMap.put("dataList", resList.subList(currPage*10,((currPage+1)*10)>=resList.size()?resList.size():(currPage+1)*10));
  806 + modelMap.put("dataList", resList);
804 807 } else {
805 808 modelMap.put("dataList", resList);
806 809 }
... ...
src/main/resources/static/pages/forms/statement/scheduleAnaly.html
... ... @@ -218,6 +218,7 @@
218 218 jsDoQuery(true);
219 219 });
220 220  
  221 + var list;
221 222 var line = $("#line").val();
222 223 var startDate = $("#startDate").val();
223 224 var endDate = $("#endDate").val();
... ... @@ -254,10 +255,8 @@
254 255 $(".hidden").removeClass("hidden");
255 256 var i = layer.load(2);
256 257 $get('/pcpc/scheduleAnaly', params, function(result){
257   - // 把数据填充到模版中
258   - var tbodyHtml = template('list_scheduleAnaly',{list:result.dataList});
259   - // 把渲染好的模版html文本追加到表格中
260   - $('#forms tbody').html(tbodyHtml);
  258 + list = result.dataList;
  259 + dataPageChange(page, result.dataList);
261 260 layer.close(i);
262 261  
263 262 if(result.dataList.length == 0)
... ... @@ -277,6 +276,17 @@
277 276 });
278 277 }
279 278  
  279 + function dataPageChange(page, list){
  280 + var tempList = [];
  281 + for(var f = page*10; f < list.length && f < (page+1)*10; f++){
  282 + tempList[tempList.length] = list[f];
  283 + }
  284 + // 把数据填充到模版中
  285 + var tbodyHtml = template('list_scheduleAnaly',{list:tempList});
  286 + // 把渲染好的模版html文本追加到表格中
  287 + $('#forms tbody').html(tbodyHtml);
  288 + }
  289 +
280 290 $("#export").on("click",function(){
281 291 var params = {};
282 292 params['page'] = page;
... ... @@ -387,7 +397,8 @@
387 397 return;
388 398 }
389 399 page = num - 1;
390   - jsDoQuery(false);
  400 +// jsDoQuery(false);
  401 + dataPageChange(page, list);
391 402 }
392 403 });
393 404 }
... ...