diff --git a/jsowell-admin/src/main/java/com/jsowell/lianlian/LianLianController.java b/jsowell-admin/src/main/java/com/jsowell/lianlian/LianLianController.java index 3b06e6a01..c900b8381 100644 --- a/jsowell-admin/src/main/java/com/jsowell/lianlian/LianLianController.java +++ b/jsowell-admin/src/main/java/com/jsowell/lianlian/LianLianController.java @@ -5,6 +5,7 @@ import com.jsowell.common.annotation.Anonymous; import com.jsowell.common.core.controller.BaseController; import com.jsowell.common.response.RestApiResponse; import com.jsowell.pile.dto.QueryStationInfoDTO; +import com.jsowell.thirdparty.domain.StationStatsInfo; import com.jsowell.thirdparty.service.LianLianService; import com.jsowell.thirdparty.vo.LianLianPageResponse; import org.apache.commons.collections4.CollectionUtils; @@ -50,8 +51,8 @@ public class LianLianController extends BaseController { } /** - * 查询充电站状态信息 - * @param dto + * 联联平台查询充电站状态信息 + * @param StationIDs * @return */ @PostMapping("/query_station_status") @@ -71,4 +72,24 @@ public class LianLianController extends BaseController { logger.info("联联平台查询充电站状态信息 result:{}", response); return response; } + + /** + * 查询统计信息 + * @param dto + * @return + */ + @PostMapping("/query_station_stats") + public RestApiResponse query_station_stats(@RequestBody QueryStationInfoDTO dto) { + logger.info("联联平台查询统计信息 params :{}", JSONObject.toJSONString(dto)); + RestApiResponse response; + try { + StationStatsInfo stationStatsInfo = lianLianService.query_station_stats(dto); + response = new RestApiResponse<>(stationStatsInfo); + } catch (Exception e) { + logger.error("联联平台查询统计信息 error", e); + response = new RestApiResponse<>(e); + } + logger.info("联联平台查询统计信息 result :{}", response); + return response; + } } diff --git a/jsowell-pile/src/main/java/com/jsowell/pile/dto/QueryStationInfoDTO.java b/jsowell-pile/src/main/java/com/jsowell/pile/dto/QueryStationInfoDTO.java index 6b7278e7e..c4a3ac15e 100644 --- a/jsowell-pile/src/main/java/com/jsowell/pile/dto/QueryStationInfoDTO.java +++ b/jsowell-pile/src/main/java/com/jsowell/pile/dto/QueryStationInfoDTO.java @@ -1,5 +1,6 @@ package com.jsowell.pile.dto; +import com.fasterxml.jackson.annotation.JsonProperty; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; @@ -23,35 +24,41 @@ public class QueryStationInfoDTO { * 格式“yyyy-MM-dd HH:mm:ss”,可以为空,如果 * 不填写,则查询所有的充电站信息 */ + @JsonProperty(value = "LastQueryTime") private String LastQueryTime; /** * 查询页码 * 不填写默认为 1 */ + @JsonProperty(value = "PageNo") private Integer PageNo; /** * 每页数量 * 不填写默认为 10 */ + @JsonProperty(value = "PageSize") private Integer PageSize; /** * 充电站 ID */ + @JsonProperty(value = "StationID") private String StationID; /** * 统计开始时间 * 格式“yyyy-MM-dd” */ + @JsonProperty(value = "StartTime") private String StartTime; /** * 统计结束时间 * 格式“yyyy-MM-dd” */ + @JsonProperty(value = "EndTime") private String EndTime; } diff --git a/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/service/impl/LianLianServiceImpl.java b/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/service/impl/LianLianServiceImpl.java index 864330dbf..cc4fd6706 100644 --- a/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/service/impl/LianLianServiceImpl.java +++ b/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/service/impl/LianLianServiceImpl.java @@ -293,38 +293,7 @@ public class LianLianServiceImpl implements LianLianService { // 所有充电桩用电量之和 stationElectricity = stationElectricity.add(pileElec); } - - - // 查出站点下所有枪口的充电量 - // Map connectorElectricityMap = list.stream() - // .collect(Collectors.toMap(AccumulativeInfoVO::getPileConnectorCode, AccumulativeInfoVO::getConnectorElectricity)); - // - // // 查出设备列表下所有设备列表的充电量 - // Map pileElectricityMap = list.stream() - // .collect(Collectors.toMap(AccumulativeInfoVO::getPileSn, AccumulativeInfoVO::getConnectorElectricity)); - - // 组装数据并返回 - // 枪口累计数据 - // for (Map.Entry entry : connectorElectricityMap.entrySet()) { - // ConnectorStatsInfo connectorStatsInfo = ConnectorStatsInfo.builder() - // .ConnectorID(entry.getKey()) - // .ConnectorElectricity(new BigDecimal(entry.getValue())) - // .build(); - // connectorStatsInfos.add(connectorStatsInfo); - // } - - // 桩累计数据 - // for (Map.Entry pileEntry : pileElectricityMap.entrySet()) { - // BigDecimal pileElectricity = new BigDecimal(pileEntry.getValue()); - // EquipmentStatsInfo equipmentStatsInfo = EquipmentStatsInfo.builder() - // .EquipmentID(pileEntry.getKey()) - // .EquipmentElectricity(new BigDecimal(pileEntry.getValue())) - // .ConnectorStatsInfos(connectorStatsInfos) - // .build(); - // equipmentStatsInfoList.add(equipmentStatsInfo); - // stationElectricity = stationElectricity.add(pileElectricity); - // } - + StationStatsInfo stationStatsInfo = StationStatsInfo.builder() .StationID(dto.getStationID()) .StartTime(dto.getStartTime())