|
|
@@ -2,11 +2,10 @@ package com.kym.admin.controller;
|
|
|
|
|
|
import com.kym.common.R;
|
|
|
import com.kym.entity.admin.queryParams.StatQueryParam;
|
|
|
+import com.kym.entity.admin.queryParams.StatementsQueryParam;
|
|
|
+import com.kym.service.admin.StationStatMonthService;
|
|
|
import com.kym.service.miniapp.ChargeOrderService;
|
|
|
-import org.springframework.web.bind.annotation.GetMapping;
|
|
|
-import org.springframework.web.bind.annotation.ModelAttribute;
|
|
|
-import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
-import org.springframework.web.bind.annotation.RestController;
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
/**
|
|
|
* @author skyline
|
|
|
@@ -18,9 +17,11 @@ import org.springframework.web.bind.annotation.RestController;
|
|
|
public class StatController {
|
|
|
|
|
|
private final ChargeOrderService chargeOrderService;
|
|
|
+ private final StationStatMonthService stationStatMonthService;
|
|
|
|
|
|
- public StatController(ChargeOrderService chargeOrderService) {
|
|
|
+ public StatController(ChargeOrderService chargeOrderService, StationStatMonthService stationStatMonthService) {
|
|
|
this.chargeOrderService = chargeOrderService;
|
|
|
+ this.stationStatMonthService = stationStatMonthService;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -31,8 +32,7 @@ public class StatController {
|
|
|
*/
|
|
|
@GetMapping("/stationStat")
|
|
|
R<?> stationStat(@ModelAttribute StatQueryParam params) {
|
|
|
- var res = chargeOrderService.stationStat(params);
|
|
|
- return R.success(res);
|
|
|
+ return R.success(chargeOrderService.stationStat(params));
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -42,19 +42,40 @@ public class StatController {
|
|
|
*/
|
|
|
@GetMapping("/stationTodayStat")
|
|
|
R<?> stationTodayStat(String stationId) {
|
|
|
- var res = chargeOrderService.stationTodayStat(stationId);
|
|
|
- return R.success(res);
|
|
|
+ return R.success(chargeOrderService.stationTodayStat(stationId));
|
|
|
}
|
|
|
|
|
|
- // TODO: 2023-12-01 站点平均单桩充电数据 日/月/整体维度
|
|
|
+ /**
|
|
|
+ * 站点详细数据统计
|
|
|
+ *
|
|
|
+ * @param params
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @GetMapping("/stationStatDetail")
|
|
|
+ R<?> stationStatDetail(@ModelAttribute StatQueryParam params) {
|
|
|
+ return R.success(chargeOrderService.stationStatDetail(params));
|
|
|
+ }
|
|
|
|
|
|
- // TODO: 2023-12-01 站点平均单度电费数据 日/月/整体维度
|
|
|
+ /**
|
|
|
+ * 站点月统计数据列表
|
|
|
+ *
|
|
|
+ * @param params
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @GetMapping("/listStatMonth")
|
|
|
+ R<?> listStatMonth(@ModelAttribute StatementsQueryParam params) {
|
|
|
+ return R.success(stationStatMonthService.listStatMonth(params));
|
|
|
+ }
|
|
|
|
|
|
- // 站点详细数据统计
|
|
|
- @GetMapping("/stationStatDetail")
|
|
|
- R<?> stationStatDetail(@ModelAttribute StatQueryParam params){
|
|
|
- var res = chargeOrderService.stationStatDetail(params);
|
|
|
- return R.success(res);
|
|
|
+ /**
|
|
|
+ * 单条站点月统计数据
|
|
|
+ *
|
|
|
+ * @param statMonthId
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @GetMapping("/getStationStatMonth/{statMonthId}")
|
|
|
+ R<?> getStationStatMonth(@PathVariable("statMonthId") String statMonthId) {
|
|
|
+ return R.success(stationStatMonthService.getById(statMonthId));
|
|
|
}
|
|
|
|
|
|
|