Commit 7f6d008fcad64155ea71a35509156af9a107c428
1 parent
c21cccbf
修改几个没有线路名而报错的问题
Showing
1 changed file
with
7 additions
and
3 deletions
src/main/java/com/bsth/service/schedule/PeopleCarPlanServiceImpl.java
| @@ -298,6 +298,8 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { | @@ -298,6 +298,8 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { | ||
| 298 | Map<String, List<ScheduleRealInfo>> keyMap = new HashMap<String, List<ScheduleRealInfo>>(); | 298 | Map<String, List<ScheduleRealInfo>> keyMap = new HashMap<String, List<ScheduleRealInfo>>(); |
| 299 | for(ScheduleRealInfo schedule : list){ | 299 | for(ScheduleRealInfo schedule : list){ |
| 300 | String key = schedule.getXlName(); | 300 | String key = schedule.getXlName(); |
| 301 | + if(key == null || key.trim().equals("")) | ||
| 302 | + continue; | ||
| 301 | if(!keyMap.containsKey(key)){ | 303 | if(!keyMap.containsKey(key)){ |
| 302 | keyMap.put(key, new ArrayList<ScheduleRealInfo>()); | 304 | keyMap.put(key, new ArrayList<ScheduleRealInfo>()); |
| 303 | } | 305 | } |
| @@ -888,6 +890,8 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { | @@ -888,6 +890,8 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { | ||
| 888 | if(schedule.getBcType().equals("in") || schedule.getBcType().equals("out")) | 890 | if(schedule.getBcType().equals("in") || schedule.getBcType().equals("out")) |
| 889 | continue; | 891 | continue; |
| 890 | String key = schedule.getXlName(); | 892 | String key = schedule.getXlName(); |
| 893 | + if(key == null || key.trim().length() == 0) | ||
| 894 | + continue; | ||
| 891 | if(!keyMap.containsKey(key)) | 895 | if(!keyMap.containsKey(key)) |
| 892 | keyMap.put(key, new ArrayList<ScheduleRealInfo>()); | 896 | keyMap.put(key, new ArrayList<ScheduleRealInfo>()); |
| 893 | keyMap.get(key).add(schedule); | 897 | keyMap.get(key).add(schedule); |
| @@ -1092,16 +1096,16 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { | @@ -1092,16 +1096,16 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { | ||
| 1092 | keyMap.put(key, new ArrayList<Map<String, Object>>()); | 1096 | keyMap.put(key, new ArrayList<Map<String, Object>>()); |
| 1093 | keyMap.get(key).add(m); | 1097 | keyMap.get(key).add(m); |
| 1094 | } | 1098 | } |
| 1099 | + String companyName = "", subCompanyName = ""; | ||
| 1095 | for(String key : keyMap.keySet()){ | 1100 | for(String key : keyMap.keySet()){ |
| 1096 | Map<String, Object> tempMap = new HashMap<String, Object>(); | 1101 | Map<String, Object> tempMap = new HashMap<String, Object>(); |
| 1097 | Set<String> tempSet = new HashSet<String>(); | 1102 | Set<String> tempSet = new HashSet<String>(); |
| 1098 | int sjf = 0; | 1103 | int sjf = 0; |
| 1099 | int wqr = 0; | 1104 | int wqr = 0; |
| 1100 | - String companyName = "", subCompanyName = ""; | ||
| 1101 | for(Map<String, Object> m : keyMap.get(key)){ | 1105 | for(Map<String, Object> m : keyMap.get(key)){ |
| 1102 | - if(m.containsKey("company") && m.get("company").toString().length()!=0 && companyName.length()==0) | 1106 | + if(m.containsKey("company") && m.get("company")!=null && m.get("company").toString().length()!=0 && companyName.length()==0) |
| 1103 | companyName = m.get("company").toString(); | 1107 | companyName = m.get("company").toString(); |
| 1104 | - if(m.containsKey("subCompany") && m.get("subCompany").toString().length()!=0 && subCompanyName.length()==0) | 1108 | + if(m.containsKey("subCompany") && m.get("subCompany")!=null && m.get("subCompany").toString().length()!=0 && subCompanyName.length()==0) |
| 1105 | subCompanyName = m.get("subCompany").toString(); | 1109 | subCompanyName = m.get("subCompany").toString(); |
| 1106 | tempSet.add(m.get("id").toString()); | 1110 | tempSet.add(m.get("id").toString()); |
| 1107 | if(m.get("timestamp") != null){ | 1111 | if(m.get("timestamp") != null){ |