Commit 8e87a84a8a488f0f1c64c3109f3a9471d9e952e4
1 parent
c8d5c770
纯电车日报表查询优化。
Showing
1 changed file
with
5 additions
and
3 deletions
src/main/java/com/bsth/service/impl/RefuelServiceImpl.java
| @@ -962,10 +962,12 @@ public class RefuelServiceImpl extends BaseServiceImpl<Refuel, Long> implements | @@ -962,10 +962,12 @@ public class RefuelServiceImpl extends BaseServiceImpl<Refuel, Long> implements | ||
| 962 | Map<String, List<ScheduleRealInfo>> scheduleDayMap = new HashMap<String, List<ScheduleRealInfo>>(); | 962 | Map<String, List<ScheduleRealInfo>> scheduleDayMap = new HashMap<String, List<ScheduleRealInfo>>(); |
| 963 | for(ScheduleRealInfo s : scheduleDayList){ | 963 | for(ScheduleRealInfo s : scheduleDayList){ |
| 964 | String carCode = s.getClZbh(); | 964 | String carCode = s.getClZbh(); |
| 965 | - if(carSet.contains(carCode) && !scheduleDayMap.containsKey(carCode)){ | ||
| 966 | - scheduleDayMap.put(carCode, new ArrayList<ScheduleRealInfo>()); | 965 | + if(carSet.contains(carCode)){ |
| 966 | + if(!scheduleDayMap.containsKey(carCode)){ | ||
| 967 | + scheduleDayMap.put(carCode, new ArrayList<ScheduleRealInfo>()); | ||
| 968 | + } | ||
| 969 | + scheduleDayMap.get(carCode).add(s); | ||
| 967 | } | 970 | } |
| 968 | - scheduleDayMap.get(carCode).add(s); | ||
| 969 | } | 971 | } |
| 970 | Map<String, Double> mileageMap = new HashMap<String, Double>(); | 972 | Map<String, Double> mileageMap = new HashMap<String, Double>(); |
| 971 | for(String carCode : scheduleDayMap.keySet()){ | 973 | for(String carCode : scheduleDayMap.keySet()){ |