|
@@ -19,14 +19,14 @@ public class EmsAnalysisController {
|
|
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private EmsAnalysisService emsAnalysisService;
|
|
private EmsAnalysisService emsAnalysisService;
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* 获取当前日期的默认值
|
|
* 获取当前日期的默认值
|
|
|
*/
|
|
*/
|
|
|
private String getCurrentDefaultTimeDimension() {
|
|
private String getCurrentDefaultTimeDimension() {
|
|
|
return "D"; // 按日统计
|
|
return "D"; // 按日统计
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* 获取当前日期的默认值(根据时间维度返回对应格式)
|
|
* 获取当前日期的默认值(根据时间维度返回对应格式)
|
|
|
*/
|
|
*/
|
|
@@ -80,16 +80,13 @@ public class EmsAnalysisController {
|
|
|
return ApiResult.success(emsAnalysisService.getTrendCategory(projectId, timeDimension, timeValue, energyTypeId));
|
|
return ApiResult.success(emsAnalysisService.getTrendCategory(projectId, timeDimension, timeValue, energyTypeId));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- @GetMapping("/region")
|
|
|
|
|
- public ApiResult<EmsRegionAnalysisResponse> getRegionAnalysis(
|
|
|
|
|
- @RequestParam(required = false) Long projectId,
|
|
|
|
|
- @RequestParam(required = false) String regionIds,
|
|
|
|
|
- @RequestParam(required = false) String timeDimension,
|
|
|
|
|
- @RequestParam(required = false) String timeValue,
|
|
|
|
|
- @RequestParam(required = false) Long energyTypeId) {
|
|
|
|
|
- if (timeDimension == null) timeDimension = getCurrentDefaultTimeDimension();
|
|
|
|
|
- if (timeValue == null) timeValue = getCurrentDefaultTimeValue(timeDimension);
|
|
|
|
|
- return ApiResult.success(emsAnalysisService.getRegionAnalysis(projectId, regionIds, timeDimension, timeValue, energyTypeId));
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 区域能耗时序分析
|
|
|
|
|
+ * 按分项编码与区域列表,查询各区域在时间轴上的能耗数据
|
|
|
|
|
+ */
|
|
|
|
|
+ @PostMapping("/region")
|
|
|
|
|
+ public ApiResult<EmsAverageResponseVO> getRegionAnalysis(@RequestBody EmsAverageRequest request) {
|
|
|
|
|
+ return ApiResult.success(emsAnalysisService.getRegionalAnalysis(request));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@PostMapping("/compare")
|
|
@PostMapping("/compare")
|