mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-06-11 18:59:51 +08:00
新增后管数据看板
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -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天 -->
|
||||
|
||||
Reference in New Issue
Block a user