mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-21 11:35:12 +08:00
新增 获取站点运营分析信息接口
This commit is contained in:
@@ -462,6 +462,8 @@ public interface OrderBasicInfoService{
|
||||
*/
|
||||
List<OrderListVO> queryOrderByOccupyTime(QueryOrderDTO dto);
|
||||
|
||||
|
||||
//↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓ 后管小程序 ↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓
|
||||
/**
|
||||
* 通过站点idList,创建时间查询订单数据详情
|
||||
* @param stationIds
|
||||
|
||||
@@ -160,8 +160,14 @@ public interface PileStationInfoService {
|
||||
List<StationStatisticsInfosVO> getStationStatisticsInfos(StationStatisticsInfoDTO dto);
|
||||
|
||||
/**
|
||||
* 获取站点运营分析信息
|
||||
* 获取站点运营分析信息(7天、30天)
|
||||
* @param dto
|
||||
*/
|
||||
StationBusinessAnalyzeInfoVO getStationBusinessAnalyzeInfo(StationBusinessAnalyzeInfoDTO dto);
|
||||
|
||||
/**
|
||||
* 获取站点运营分析信息(12个月)
|
||||
* @param dto
|
||||
*/
|
||||
StationBusinessAnalyzeInfoVO getStationMonthlyBusinessAnalyzeInfo(StationBusinessAnalyzeInfoDTO dto);
|
||||
}
|
||||
|
||||
@@ -744,7 +744,7 @@ public class PileStationInfoServiceImpl implements PileStationInfoService {
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取站点运营分析信息
|
||||
* 获取站点运营分析信息(7天、30天)
|
||||
* @param dto
|
||||
*/
|
||||
@Override
|
||||
@@ -926,5 +926,46 @@ public class PileStationInfoServiceImpl implements PileStationInfoService {
|
||||
return vo;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取站点运营分析信息(12个月)
|
||||
* @param dto
|
||||
*/
|
||||
@Override
|
||||
public StationBusinessAnalyzeInfoVO getStationMonthlyBusinessAnalyzeInfo(StationBusinessAnalyzeInfoDTO dto) {
|
||||
String stationId = dto.getStationId();
|
||||
Calendar instance = Calendar.getInstance();
|
||||
instance.add(Calendar.YEAR, -1);
|
||||
String startTime = DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD, instance.getTime());
|
||||
String endTime = DateUtils.dateTimeNow(DateUtils.YYYY_MM_DD);
|
||||
// 查询订单日报表过去一年的数据
|
||||
List<SettleOrderReport> list = settleOrderReportService.queryOrderReport(Lists.newArrayList(stationId), startTime, endTime);
|
||||
|
||||
// 按照日期汇总数据
|
||||
Map<String, SettleOrderReport> collect = list.stream()
|
||||
.sorted(Comparator.comparing(SettleOrderReport::getTradeDate))
|
||||
.collect(Collectors.toMap(SettleOrderReport::getTradeDate, Function.identity(),
|
||||
(a, b) -> {
|
||||
a.setUseElectricity(a.getUseElectricity().add(b.getUseElectricity()));
|
||||
a.setTotalAmount(a.getTotalAmount().add(b.getTotalAmount()));
|
||||
a.setElectricityAmount(a.getElectricityAmount().add(b.getElectricityAmount()));
|
||||
a.setServiceAmount(a.getServiceAmount().add(b.getServiceAmount()));
|
||||
return a;
|
||||
}));
|
||||
// 通过TreeMap排序
|
||||
TreeMap<String, SettleOrderReport> map = new TreeMap<>(collect);
|
||||
List<SettleOrderReport> settleOrderReports = new ArrayList<>(map.values());
|
||||
|
||||
// StationBusinessAnalyzeInfoVO vo = StationBusinessAnalyzeInfoVO.builder()
|
||||
// .electricityGrowthRate()
|
||||
// .orderAmountGrowthRate()
|
||||
// .serviceAmountGrowthRate()
|
||||
//
|
||||
// .businessOrderDetailInfoVOList()
|
||||
// .build();
|
||||
|
||||
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user