新增后管数据看板

This commit is contained in:
Lemon
2026-05-08 11:42:11 +08:00
parent 478c70a352
commit b563659f84
14 changed files with 217 additions and 4 deletions

View File

@@ -4,11 +4,11 @@ import com.alibaba.fastjson2.JSON;
import com.jsowell.common.core.controller.BaseController;
import com.jsowell.common.response.RestApiResponse;
import com.jsowell.pile.dto.IndexQueryDTO;
import com.jsowell.pile.service.MemberBasicInfoService;
import com.jsowell.pile.service.OrderBasicInfoService;
import com.jsowell.pile.service.PileBasicInfoService;
import com.jsowell.pile.vo.web.IndexGeneralSituationVO;
import com.jsowell.pile.vo.web.IndexOrderInfoVO;
import com.jsowell.pile.vo.web.IndexPlatformProfitVO;
import com.jsowell.pile.service.PileStationInfoService;
import com.jsowell.pile.vo.web.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
@@ -32,6 +32,12 @@ public class indexController extends BaseController {
@Autowired
private OrderBasicInfoService orderBasicInfoService;
@Autowired
private MemberBasicInfoService memberBasicInfoService;
@Autowired
private PileStationInfoService pileStationInfoService;
@PostMapping("/getGeneralSituation")
public RestApiResponse<?> getGeneralSituation(@RequestBody IndexQueryDTO dto) {
logger.info("首页基础数据查询 param:{}", JSON.toJSONString(dto));
@@ -105,4 +111,67 @@ public class indexController extends BaseController {
return response;
}
/**
* 大数据平台-总览数据
*/
@PostMapping("/getBigDataOverview")
public RestApiResponse<?> getBigDataOverview() {
logger.info("大数据平台总览数据查询");
RestApiResponse<?> response;
try {
BigDataOverviewVO overviewVO = new BigDataOverviewVO();
overviewVO.setTotalUsers(memberBasicInfoService.countTotalMembers());
overviewVO.setTotalOrders(orderBasicInfoService.countTotalOrders());
overviewVO.setTotalPiles(Long.valueOf(pileBasicInfoService.getGeneralSituation(new IndexQueryDTO()).getTotalPileQuantity()));
overviewVO.setTotalStations(pileStationInfoService.countTotalStations());
IndexGeneralSituationVO generalSituation = pileBasicInfoService.getGeneralSituation(new IndexQueryDTO());
overviewVO.setTotalTransactionAmount(generalSituation.getTotalChargingAmount());
overviewVO.setTotalElectricity(generalSituation.getTotalChargingDegree());
response = new RestApiResponse<>(overviewVO);
} catch (Exception e) {
logger.error("大数据平台总览数据查询错误", e);
response = new RestApiResponse<>("00200005", "大数据平台总览数据查询错误");
}
logger.info("大数据平台总览数据查询 result:{}", JSON.toJSONString(response));
return response;
}
/**
* 大数据平台-充电站地图数据
*/
@PostMapping("/getStationMapData")
public RestApiResponse<?> getStationMapData() {
logger.info("大数据平台充电站地图数据查询");
RestApiResponse<?> response;
try {
List<StationMapVO> stationMapData = pileStationInfoService.getStationMapData();
response = new RestApiResponse<>(stationMapData);
} catch (Exception e) {
logger.error("大数据平台充电站地图数据查询错误", e);
response = new RestApiResponse<>("00200006", "大数据平台充电站地图数据查询错误");
}
logger.info("大数据平台充电站地图数据查询 result:{}", JSON.toJSONString(response));
return response;
}
/**
* 大数据平台-使用率趋势数据
*/
@PostMapping("/getUsageTrend")
public RestApiResponse<?> getUsageTrend(@RequestBody IndexQueryDTO dto) {
logger.info("大数据平台使用率趋势查询 param:{}", JSON.toJSONString(dto));
RestApiResponse<?> response;
try {
List<UsageTrendVO> trendData = orderBasicInfoService.getUsageTrendData(dto);
response = new RestApiResponse<>(trendData);
} catch (Exception e) {
logger.error("大数据平台使用率趋势查询错误", e);
response = new RestApiResponse<>("00200007", "大数据平台使用率趋势查询错误");
}
logger.info("大数据平台使用率趋势查询 result:{}", JSON.toJSONString(response));
return response;
}
}

View File

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<!-- 日志存放路径 -->
<property name="log.path" value="/opt/app/spring/logs" />
<property name="log.path" value="./opt/app/spring/logs" />
<!-- 日志输出格式 -->
<property name="log.pattern" value="%d{HH:mm:ss.SSS} [%thread] %-5level %logger{20} - [%method,%line] - %msg%n%ex" />
<!-- 日志最大的历史 90天 -->