From 66782b7ba787a92b54640cbab0ebd201f0ad9e51 Mon Sep 17 00:00:00 2001 From: dengzedong <dengzedong@email> Date: 星期四, 09 一月 2025 10:29:25 +0800 Subject: [PATCH] chartParamList --- iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/api/controller/admin/McsApiController.java | 55 ++++++++++++++++++++++++++++++++++++++++++++++++------- 1 files changed, 48 insertions(+), 7 deletions(-) diff --git a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/api/controller/admin/McsApiController.java b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/api/controller/admin/McsApiController.java index 872c83d..b97d09c 100644 --- a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/api/controller/admin/McsApiController.java +++ b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/api/controller/admin/McsApiController.java @@ -1,7 +1,8 @@ package com.iailab.module.model.api.controller.admin; -import com.iailab.framework.apilog.core.annotation.ApiAccessLog; import com.iailab.framework.common.pojo.CommonResult; +import com.iailab.framework.common.pojo.PageResult; +import com.iailab.framework.common.util.object.BeanUtils; import com.iailab.module.model.api.mcs.McsApi; import com.iailab.module.model.api.mcs.dto.*; import com.iailab.module.model.common.utils.ApiSecurityUtils; @@ -13,14 +14,15 @@ import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; -import javax.annotation.security.PermitAll; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.io.IOException; import java.text.SimpleDateFormat; import java.util.Date; import java.util.List; -import static com.iailab.framework.apilog.core.enums.OperateTypeEnum.EXPORT; +import java.util.Map; + +import static com.iailab.framework.common.pojo.CommonResult.success; /** * @author PanZhibao @@ -89,9 +91,18 @@ return CommonResult.success(respVO); } + @PostMapping("/predict-data/cur") + @Operation(summary = "获取当前预测数据") + public CommonResult<Map<String, List<Object[]>>> getPreDataCur(HttpServletResponse response, HttpServletRequest + request, @RequestBody PreDataJsonReqVO reqVO)throws Exception { + apiSecurityUtils.validate(request); + reqVO.setPredictTime(new Date()); + Map<String, List<Object[]>> map = mcsApi.getPreDataCur(reqVO); + return CommonResult.success(map); + } + @GetMapping("/predict-data/exportValue") @Operation(summary = "导出预测数据") - @ApiAccessLog(operateType = EXPORT) public void exportPointValue(@RequestParam("itemId") String itemId, @RequestParam("startTime") String startTime, @RequestParam("endTime") String endTime, @@ -101,13 +112,13 @@ reqVO.setItemId(itemId); try { if (startTime == "") { - reqVO.setStartTime(new Date((new Date()).getTime() - 60*60*1000)); + reqVO.setStartTime(new Date((new Date()).getTime() - 60 * 60 * 1000)); } else { reqVO.setStartTime(formatter.parse(startTime)); } if (endTime == "") { - reqVO.setEndTime(new Date((new Date()).getTime() + 60*60*1000)); + reqVO.setEndTime(new Date((new Date()).getTime() + 60 * 60 * 1000)); } else { reqVO.setEndTime(formatter.parse(endTime)); } @@ -116,10 +127,40 @@ } PreDataItemChartRespVO respVO = mcsApi.getPreDataItemChart(reqVO); try { - String sheetTitle = "sheet1"; + String sheetTitle = "sheet1"; ExcelUtil.exportchart(sheetTitle, respVO, response); } catch (Exception ex) { ex.printStackTrace(); } } + + @GetMapping("/alarm-message/last-one") + @Operation(summary = "根据监控对象获取最新预警信息") + public CommonResult<AlarmMessageRespDTO> getLastAlarmMessage(HttpServletResponse response, HttpServletRequest + request, @RequestParam("alarmObj") String alarmObj) { + AlarmMessageRespDTO data = mcsApi.getLastAlarmMessage(alarmObj); + return CommonResult.success(data); + } + + @GetMapping("/schedule-suggest/last-limit") + @Operation(summary = "根据监控对象获取最新预警信息") + public CommonResult<List<ScheduleSuggestRespDTO>> getLastLimitScheduleSuggest(HttpServletResponse response, HttpServletRequest + request, @RequestParam("scheduleObj") String scheduleObj, @RequestParam("limit") Integer limit) { + List<ScheduleSuggestRespDTO> data = mcsApi.getLastLimitScheduleSuggest(scheduleObj, limit); + return CommonResult.success(data); + } + + @PostMapping("/alarm-suggest/page") + @Operation(summary = "获取预警信息和调度建议分页列表") + public CommonResult<PageResult<StAlarmAndSuggestRespVO>> getAlarmAndSuggestPage(@RequestBody StAlarmAndSuggestPageReqVO reqVO) { + PageResult<StAlarmAndSuggestRespVO> page = mcsApi.getAlarmAndSuggestPage(reqVO); + return success(BeanUtils.toBean(page, StAlarmAndSuggestRespVO.class)); + } + + @GetMapping("/chart/param/list") + @Operation(summary = "图表配置列表") + public CommonResult<List<ChartParamDTO>> getChartParamList(@RequestParam("chartCode") String chartCode) { + List<ChartParamDTO> chartParamList = mcsApi.getChartParamList(chartCode); + return CommonResult.success(chartParamList); + } } \ No newline at end of file -- Gitblit v1.9.3