Commit 0056063fc2066550e5a58198e4a58decafeaa904

Authored by 娄高锋
1 parent f19a4a39

时刻表分析 加一列表头“路牌”

src/main/java/com/bsth/service/schedule/impl/PeopleCarPlanServiceImpl.java
... ... @@ -611,7 +611,7 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
611 611 try {
612 612  
613 613 String sql = "select schedule_date_str,xl_name,bc_type,gs_name,fgs_name,fgs_bm,bcs,"
614   - +"fcno,fcsj,fcsj_actual,zdsj,zdsj_actual,bcsj,qdz_name,sp_id,cc_service"
  614 + +"fcno,fcsj,fcsj_actual,zdsj,zdsj_actual,bcsj,qdz_name,sp_id,cc_service,lp_name"
615 615 +" from bsth_c_s_sp_info_real where schedule_date_str >= '"+startDate
616 616 +"' and schedule_date_str <= '"+endDate+"'";
617 617 if(line.length() != 0){
... ... @@ -650,6 +650,7 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
650 650 schedule.setQdzName(rs.getString("qdz_name"));
651 651 schedule.setSpId(rs.getLong("sp_id"));
652 652 schedule.setCcService(rs.getBoolean("cc_service"));
  653 + schedule.setLpName(rs.getString("lp_name"));
653 654  
654 655 if(schedule.getFcsjActual() != null && schedule.getFcsjActual().trim().length() == 0){
655 656 schedule.setFcsjActual(null);
... ... @@ -718,7 +719,7 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
718 719 continue;
719 720 }
720 721  
721   - String key = schedule.getXlName()+"/"+schedule.getQdzName()+"/"+schedule.getFcsj()+"/"+schedule.getFgsBm();
  722 + String key = schedule.getXlName()+"/"+schedule.getQdzName()+"/"+schedule.getFcsj()+"/"+schedule.getFgsBm()+"/"+schedule.getLpName();
722 723 if(model.length() != 0){
723 724 if(ttSet.contains(schedule.getSpId())){
724 725 if(!keyMap.containsKey(key))
... ... @@ -810,6 +811,7 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
810 811 tempMap.put("line", split[0]);
811 812 tempMap.put("qdz", split[1]);
812 813 tempMap.put("jhfc", split[2]);
  814 + tempMap.put("lp", split[4]);
813 815 tempMap.put("jhbc", jhbc);
814 816 tempMap.put("sjbc", sjbc);
815 817 tempList.add(tempMap);
... ... @@ -819,27 +821,32 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
819 821 Map<String, List<Map<String, Object>>> listMap = new HashMap<String, List<Map<String, Object>>>();
820 822 Map<String, List<Map<String, Object>>> listMap2 = new HashMap<String, List<Map<String, Object>>>();
821 823 for(Map<String, Object> m : tempList){
822   - String key = m.get("line").toString() + m.get("qdz") + m.get("subCompany");
  824 + String key = m.get("line").toString() + "/" + m.get("qdz") + "/" + m.get("subCompany");
823 825 if(!listMap.containsKey(key))
824 826 listMap.put(key, new ArrayList<Map<String, Object>>());
825 827 listMap.get(key).add(m);
826 828 }
827 829 for(String key : listMap.keySet()){
828   - Map<Integer, Map<String, Object>> tempMap = new HashMap<Integer, Map<String,Object>>();
  830 + Map<Integer, List<Map<String, Object>>> tempMap = new HashMap<Integer, List<Map<String,Object>>>();
829 831 List<Integer> keyList = new ArrayList<Integer>();
830 832 for(Map<String, Object> m : listMap.get(key)){
831 833 String[] split = m.get("jhfc").toString().split(":");
832 834 int jhfc = Integer.valueOf(split[0])*60 + Integer.valueOf(split[1]);
833   - tempMap.put(jhfc, m);
834   - keyList.add(jhfc);
  835 + if(!tempMap.containsKey(jhfc)){
  836 + tempMap.put(jhfc, new ArrayList<Map<String, Object>>());
  837 + keyList.add(jhfc);
  838 + }
  839 + tempMap.get(jhfc).add(m);
  840 +
835 841 }
836 842 Collections.sort(keyList);
837 843 for(Integer Int : keyList){
838   - Map<String, Object> m = tempMap.get(Int);
  844 + List<Map<String, Object>> l = tempMap.get(Int);
  845 + Map<String, Object> m = l.get(0);
839 846 String str = m.get("line").toString();
840 847 if(!listMap2.containsKey(str))
841 848 listMap2.put(str, new ArrayList<Map<String, Object>>());
842   - listMap2.get(str).add(m);
  849 + listMap2.get(str).addAll(l);
843 850 }
844 851 }
845 852 for(String str : listMap2.keySet()){
... ... @@ -860,6 +867,13 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
860 867  
861 868 //导出
862 869 if(type.equals("export")){
  870 + for(Map<String, Object> m : resList){
  871 + if(m.get("lp") != null){
  872 + if(m.get("lp").toString().contains("+") || m.get("lp").toString().contains("-")){
  873 + m.put("lp", "\'" + m.get("lp").toString().trim());
  874 + }
  875 + }
  876 + }
863 877 String lineName = "";
864 878 if(map.containsKey("lineName"))
865 879 lineName = map.get("lineName").toString();
... ...
src/main/resources/static/pages/forms/mould/scheduleAnaly.xls
No preview for this file type
src/main/resources/static/pages/forms/statement/scheduleAnaly.html
... ... @@ -79,6 +79,7 @@
79 79 <th width="8%">分公司</th>
80 80 <th width="8%">线路</th>
81 81 <th width="8%">起点站名</th>
  82 + <th width="6%">路牌</th>
82 83 <th width="6%">计发时间</th>
83 84 <th width="6%">计划运送时间(分)</th>
84 85 <th width="6%">计划完成次数</th>
... ... @@ -424,6 +425,7 @@
424 425 <td>{{obj.subCompany}}</td>
425 426 <td>{{obj.line}}</td>
426 427 <td>{{obj.qdz}}</td>
  428 + <td>{{obj.lp}}</td>
427 429 <td>{{obj.jhfc}}</td>
428 430 <td>{{obj.bcsj}}</td>
429 431 <td>{{obj.jhbc}}</td>
... ... @@ -438,7 +440,7 @@
438 440 {{/each}}
439 441 {{if list.length == 0}}
440 442 <tr>
441   - <td colspan="14"><h6 class="muted">没有找到相关数据</h6></td>
  443 + <td colspan="15"><h6 class="muted">没有找到相关数据</h6></td>
442 444 </tr>
443 445 {{/if}}
444 446 </script>
445 447 \ No newline at end of file
... ...