mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-05-15 15:28:41 +08:00
Merge branch 'dev' of http://192.168.2.46:8099/jsowell/jsowell-charger-web into dev
This commit is contained in:
@@ -3,6 +3,7 @@ package com.jsowell.api.uniapp.business;
|
|||||||
import com.alibaba.fastjson2.JSONObject;
|
import com.alibaba.fastjson2.JSONObject;
|
||||||
import com.google.common.collect.ImmutableMap;
|
import com.google.common.collect.ImmutableMap;
|
||||||
import com.jsowell.common.core.controller.BaseController;
|
import com.jsowell.common.core.controller.BaseController;
|
||||||
|
import com.jsowell.common.exception.BusinessException;
|
||||||
import com.jsowell.common.response.RestApiResponse;
|
import com.jsowell.common.response.RestApiResponse;
|
||||||
import com.jsowell.pile.dto.StationBusinessAnalyzeInfoDTO;
|
import com.jsowell.pile.dto.StationBusinessAnalyzeInfoDTO;
|
||||||
import com.jsowell.pile.dto.StationStatisticsInfoDTO;
|
import com.jsowell.pile.dto.StationStatisticsInfoDTO;
|
||||||
@@ -82,7 +83,11 @@ public class BusinessStationInfoController extends BaseController {
|
|||||||
try {
|
try {
|
||||||
StationBusinessAnalyzeInfoVO vo = pileStationInfoService.getStationMonthlyBusinessAnalyzeInfo(dto);
|
StationBusinessAnalyzeInfoVO vo = pileStationInfoService.getStationMonthlyBusinessAnalyzeInfo(dto);
|
||||||
response = new RestApiResponse<>(ImmutableMap.of("stationBusinessAnalyzeInfoVO", vo));
|
response = new RestApiResponse<>(ImmutableMap.of("stationBusinessAnalyzeInfoVO", vo));
|
||||||
} catch (Exception e) {
|
}catch (BusinessException e){
|
||||||
|
logger.error("获取站点运营分析信息 error:{}", e);
|
||||||
|
response = new RestApiResponse<>(e.getCode(), e.getMessage());
|
||||||
|
}
|
||||||
|
catch (Exception e) {
|
||||||
logger.error("获取站点运营分析信息 error", e);
|
logger.error("获取站点运营分析信息 error", e);
|
||||||
response = new RestApiResponse<>(e);
|
response = new RestApiResponse<>(e);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -797,26 +797,27 @@ public class PileStationInfoServiceImpl implements PileStationInfoService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// 日期区间
|
// 日期区间
|
||||||
String startTime = null;
|
// String startTime = null;
|
||||||
String endTime = null;
|
// String endTime = null;
|
||||||
if (dateTime == null) {
|
// 用户未选中某天时
|
||||||
// 用户未选中某天时
|
Date date = null;
|
||||||
Date date = null;
|
if (StringUtils.equals(Constants.ONE, type)) {
|
||||||
if (StringUtils.equals(Constants.ONE, type)) {
|
// 7天
|
||||||
// 7天
|
date = DateUtils.addDays(new Date(), -7);
|
||||||
date = DateUtils.addDays(new Date(), -7);
|
}else if (StringUtils.equals(Constants.TWO, type)) {
|
||||||
}else if (StringUtils.equals(Constants.TWO, type)) {
|
// 30天
|
||||||
// 30天
|
date = DateUtils.addDays(new Date(), -30);
|
||||||
date = DateUtils.addDays(new Date(), -30);
|
|
||||||
}
|
|
||||||
startTime = DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD, date);
|
|
||||||
endTime = DateUtils.dateTimeNow(DateUtils.YYYY_MM_DD);
|
|
||||||
|
|
||||||
} else {
|
|
||||||
// 用户选中某天的数据时↓
|
|
||||||
startTime = dateTime;
|
|
||||||
endTime = dateTime;
|
|
||||||
}
|
}
|
||||||
|
String startTime = DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD, date);
|
||||||
|
String endTime = DateUtils.dateTimeNow(DateUtils.YYYY_MM_DD);
|
||||||
|
// if (dateTime == null) {
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// } else {
|
||||||
|
// // 用户选中某天的数据时↓
|
||||||
|
// startTime = dateTime;
|
||||||
|
// endTime = dateTime;
|
||||||
|
// }
|
||||||
|
|
||||||
// 根据站点ids和日期区间查询订单详情
|
// 根据站点ids和日期区间查询订单详情
|
||||||
List<BusinessOrderDetailInfoVO> orderDetails = orderBasicInfoService.getOrderDetailByStationIds(stationIds, startTime, endTime);
|
List<BusinessOrderDetailInfoVO> orderDetails = orderBasicInfoService.getOrderDetailByStationIds(stationIds, startTime, endTime);
|
||||||
@@ -966,6 +967,9 @@ public class PileStationInfoServiceImpl implements PileStationInfoService {
|
|||||||
|
|
||||||
// 查询订单日报表过去一年的数据
|
// 查询订单日报表过去一年的数据
|
||||||
List<SettleOrderReport> list = settleOrderReportService.queryOrderReport(stationIds, startTime, endTime);
|
List<SettleOrderReport> list = settleOrderReportService.queryOrderReport(stationIds, startTime, endTime);
|
||||||
|
if (CollectionUtils.isEmpty(list)) {
|
||||||
|
throw new BusinessException(ReturnCodeEnum.CODE_SELECT_INFO_IS_NULL);
|
||||||
|
}
|
||||||
// 按照日期汇总数据
|
// 按照日期汇总数据
|
||||||
Map<String, SettleOrderReport> collect = list.stream()
|
Map<String, SettleOrderReport> collect = list.stream()
|
||||||
.peek(report -> {
|
.peek(report -> {
|
||||||
|
|||||||
Reference in New Issue
Block a user