Commit 26a7b094043866a1202405252123fd3ad2704164
1 parent
2df18a06
充电量月报表 改为以路单为主
Showing
1 changed file
with
7 additions
and
6 deletions
src/main/java/com/bsth/service/impl/RefuelServiceImpl.java
| 1 | package com.bsth.service.impl; | 1 | package com.bsth.service.impl; |
| 2 | 2 | ||
| 3 | import com.bsth.common.ResponseCode; | 3 | import com.bsth.common.ResponseCode; |
| 4 | +import com.bsth.data.BasicData; | ||
| 4 | import com.bsth.entity.Cars; | 5 | import com.bsth.entity.Cars; |
| 5 | import com.bsth.entity.Refuel; | 6 | import com.bsth.entity.Refuel; |
| 6 | import com.bsth.entity.oil.JdlReception; | 7 | import com.bsth.entity.oil.JdlReception; |
| @@ -1483,7 +1484,7 @@ public class RefuelServiceImpl extends BaseServiceImpl<Refuel, Long> implements | @@ -1483,7 +1484,7 @@ public class RefuelServiceImpl extends BaseServiceImpl<Refuel, Long> implements | ||
| 1483 | String dateS=map.get("dateS"); | 1484 | String dateS=map.get("dateS"); |
| 1484 | String dateE=map.get("dateE"); | 1485 | String dateE=map.get("dateE"); |
| 1485 | List<JdlReception> jdlReceptions=jdlReceptionRepository.queryListByDateStr(dateS,dateE); | 1486 | List<JdlReception> jdlReceptions=jdlReceptionRepository.queryListByDateStr(dateS,dateE); |
| 1486 | - Set<String> carSet = new HashSet<>(); | 1487 | + /*Set<String> carSet = new HashSet<>(); |
| 1487 | Set<String> stationSet = new HashSet<>(); | 1488 | Set<String> stationSet = new HashSet<>(); |
| 1488 | Map<String,String> carPlate = new HashMap<>(); | 1489 | Map<String,String> carPlate = new HashMap<>(); |
| 1489 | for (JdlReception jdlReception : jdlReceptions) { | 1490 | for (JdlReception jdlReception : jdlReceptions) { |
| @@ -1496,15 +1497,15 @@ public class RefuelServiceImpl extends BaseServiceImpl<Refuel, Long> implements | @@ -1496,15 +1497,15 @@ public class RefuelServiceImpl extends BaseServiceImpl<Refuel, Long> implements | ||
| 1496 | } | 1497 | } |
| 1497 | } | 1498 | } |
| 1498 | 1499 | ||
| 1499 | - List<String> cars = new ArrayList<>(carSet); | 1500 | + List<String> cars = new ArrayList<>(carSet);*/ |
| 1500 | List<String> stations = Arrays.asList(JdlReception.parks); | 1501 | List<String> stations = Arrays.asList(JdlReception.parks); |
| 1501 | //路单分组 | 1502 | //路单分组 |
| 1502 | List<ScheduleRealInfo> realInfos=repository.scheduleByDate(dateS,dateE); | 1503 | List<ScheduleRealInfo> realInfos=repository.scheduleByDate(dateS,dateE); |
| 1503 | Map<String,List<ScheduleRealInfo>> sMap=realInfos.stream().collect(Collectors.groupingBy(ScheduleRealInfo::getClZbh)); | 1504 | Map<String,List<ScheduleRealInfo>> sMap=realInfos.stream().collect(Collectors.groupingBy(ScheduleRealInfo::getClZbh)); |
| 1504 | - | 1505 | + Set<String> carSet =sMap.keySet(); |
| 1505 | //给每个站充电量赋默认值 | 1506 | //给每个站充电量赋默认值 |
| 1506 | Map<String, Map<String, Double>> matrix = new LinkedHashMap<>(); | 1507 | Map<String, Map<String, Double>> matrix = new LinkedHashMap<>(); |
| 1507 | - for (String car : cars) { | 1508 | + for (String car : carSet) { |
| 1508 | Map<String, Double> stationMap = new HashMap<>(); | 1509 | Map<String, Double> stationMap = new HashMap<>(); |
| 1509 | for (String station : stations) { | 1510 | for (String station : stations) { |
| 1510 | stationMap.put(station, 0.00); | 1511 | stationMap.put(station, 0.00); |
| @@ -1528,9 +1529,9 @@ public class RefuelServiceImpl extends BaseServiceImpl<Refuel, Long> implements | @@ -1528,9 +1529,9 @@ public class RefuelServiceImpl extends BaseServiceImpl<Refuel, Long> implements | ||
| 1528 | } | 1529 | } |
| 1529 | 1530 | ||
| 1530 | //数据统计 | 1531 | //数据统计 |
| 1531 | - for (String car : cars) { | 1532 | + for (String car : carSet) { |
| 1532 | Map<String, Object> row = new LinkedHashMap<>(); | 1533 | Map<String, Object> row = new LinkedHashMap<>(); |
| 1533 | - row.put("plate", carPlate.get(car)); | 1534 | + row.put("plate", BasicData.nbbmCompanyPlateMap.get(car)); |
| 1534 | row.put("car", car); | 1535 | row.put("car", car); |
| 1535 | String realMileage ="0"; | 1536 | String realMileage ="0"; |
| 1536 | List<ScheduleRealInfo> list = sMap.get(car); | 1537 | List<ScheduleRealInfo> list = sMap.get(car); |