|
|
@@ -1,6 +1,13 @@
|
|
|
package com.kym.admin.controller;
|
|
|
|
|
|
+import com.kym.common.R;
|
|
|
+import com.kym.common.annotation.SysLog;
|
|
|
+import com.kym.service.admin.StationService;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.format.annotation.DateTimeFormat;
|
|
|
+import org.springframework.web.bind.annotation.GetMapping;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
+import org.springframework.web.bind.annotation.RequestParam;
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
/**
|
|
|
@@ -15,4 +22,28 @@ import org.springframework.web.bind.annotation.RestController;
|
|
|
@RequestMapping("/station")
|
|
|
public class StationController {
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private StationService stationService;
|
|
|
+
|
|
|
+ @SysLog("充电站数据统计")
|
|
|
+ @GetMapping("/stationStatusDetail")
|
|
|
+ R stationStatusDetail(@RequestParam("stationId") String stationId,
|
|
|
+ @RequestParam("startTime") @DateTimeFormat(pattern = "yyyy-MM-dd") String startTime,
|
|
|
+ @RequestParam("endTime") @DateTimeFormat(pattern = "yyyy-MM-dd") String endTime) {
|
|
|
+ // 请求en+接口
|
|
|
+ var response = stationService.stationStats(stationId, startTime, endTime);
|
|
|
+ return R.success(response);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 拉取EN+充电站信息数据并更新本地服务器数据
|
|
|
+ *
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @GetMapping("/pullEnStations")
|
|
|
+ R pullEnStationInfos() {
|
|
|
+ stationService.pullEnStationInfos();
|
|
|
+ return R.success();
|
|
|
+ }
|
|
|
+
|
|
|
}
|