From 730d1944e3a13c517c77df2b0712df05645a38dd Mon Sep 17 00:00:00 2001
From: dengzedong <dengzedong@email>
Date: 星期一, 06 一月 2025 16:00:58 +0800
Subject: [PATCH] chartParamList api

---
 iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mpk/dto/ChartDTO.java                          |    2 +-
 iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mpk/service/impl/ChartParamServiceImpl.java    |   11 ++++++++---
 iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mpk/controller/admin/ChartParamController.java |   10 +---------
 iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mpk/service/ChartParamService.java             |    7 +++----
 iailab-module-model/iailab-module-model-api/src/main/java/com/iailab/module/model/api/mcs/dto/ChartParamDTO.java                 |    2 +-
 iailab-module-model/iailab-module-model-api/src/main/java/com/iailab/module/model/api/mcs/McsApi.java                            |    4 ++++
 iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mpk/controller/admin/ChartController.java      |    2 --
 iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/api/McsApiImpl.java                            |   12 ++++++++++++
 8 files changed, 30 insertions(+), 20 deletions(-)

diff --git a/iailab-module-model/iailab-module-model-api/src/main/java/com/iailab/module/model/api/mcs/McsApi.java b/iailab-module-model/iailab-module-model-api/src/main/java/com/iailab/module/model/api/mcs/McsApi.java
index cbc77d4..97c9b8b 100644
--- a/iailab-module-model/iailab-module-model-api/src/main/java/com/iailab/module/model/api/mcs/McsApi.java
+++ b/iailab-module-model/iailab-module-model-api/src/main/java/com/iailab/module/model/api/mcs/McsApi.java
@@ -87,4 +87,8 @@
     @GetMapping(PREFIX + "/schedule-scheme/list")
     @Operation(summary = "获取调度方案列表")
     List<StScheduleSchemeDTO> listScheduleScheme(@RequestParam("triggerMethod") String triggerMethod, @RequestParam("triggerCondition") String triggerCondition);
+
+    @GetMapping(PREFIX + "/chart/param/list")
+    @Operation(summary = "图表配置列表")
+    List<ChartParamDTO> getChartParamList(@RequestParam("chartCode") String chartCode);
 }
\ No newline at end of file
diff --git a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mpk/dto/ChartParamDTO.java b/iailab-module-model/iailab-module-model-api/src/main/java/com/iailab/module/model/api/mcs/dto/ChartParamDTO.java
similarity index 94%
rename from iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mpk/dto/ChartParamDTO.java
rename to iailab-module-model/iailab-module-model-api/src/main/java/com/iailab/module/model/api/mcs/dto/ChartParamDTO.java
index 6b04368..8cd6f95 100644
--- a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mpk/dto/ChartParamDTO.java
+++ b/iailab-module-model/iailab-module-model-api/src/main/java/com/iailab/module/model/api/mcs/dto/ChartParamDTO.java
@@ -1,4 +1,4 @@
-package com.iailab.module.model.mpk.dto;
+package com.iailab.module.model.api.mcs.dto;
 
 import lombok.Data;
 
diff --git a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/api/McsApiImpl.java b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/api/McsApiImpl.java
index 92e3e0e..f5fc81e 100644
--- a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/api/McsApiImpl.java
+++ b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/api/McsApiImpl.java
@@ -26,6 +26,7 @@
 import com.iailab.module.model.mcs.sche.service.StScheduleSuggestService;
 import com.iailab.module.model.mcs.sche.vo.StScheduleSuggestSaveReqVO;
 import com.iailab.module.model.mdk.vo.ItemVO;
+import com.iailab.module.model.mpk.service.ChartParamService;
 import com.iailab.module.model.mpk.service.ChartService;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang3.StringUtils;
@@ -86,6 +87,9 @@
 
     @Autowired
     private StScheduleSchemeService stScheduleSchemeService;
+
+    @Autowired
+    private ChartParamService chartParamService;
 
     private int HOUR_MINS = 60;
 
@@ -560,6 +564,14 @@
         return stScheduleSchemeService.list(params);
     }
 
+    @Override
+    public List<ChartParamDTO> getChartParamList(String chartCode) {
+        if (StringUtils.isBlank(chartCode)) {
+            return null;
+        }
+        return chartParamService.list(chartCode);
+    }
+
     private Date[] calResultTime(ItemVO predictItem, Date startTimeReq, Date endTimeReq, int lengthLeft, int lengthRight) {
         Date[] result = new Date[3];
         Date predictTime = predictItem.getLastTime();
diff --git a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mpk/controller/admin/ChartController.java b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mpk/controller/admin/ChartController.java
index 3f69d83..a5964f2 100644
--- a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mpk/controller/admin/ChartController.java
+++ b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mpk/controller/admin/ChartController.java
@@ -3,9 +3,7 @@
 import com.iailab.framework.common.page.PageData;
 import com.iailab.framework.common.pojo.CommonResult;
 import com.iailab.module.model.mpk.dto.ChartDTO;
-import com.iailab.module.model.mpk.dto.ChartParamDTO;
 import com.iailab.module.model.mpk.entity.ChartEntity;
-import com.iailab.module.model.mpk.entity.ChartParamEntity;
 import com.iailab.module.model.mpk.service.ChartService;
 import io.swagger.v3.oas.annotations.Operation;
 import io.swagger.v3.oas.annotations.tags.Tag;
diff --git a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mpk/controller/admin/ChartParamController.java b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mpk/controller/admin/ChartParamController.java
index e1c920b..08bb14a 100644
--- a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mpk/controller/admin/ChartParamController.java
+++ b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mpk/controller/admin/ChartParamController.java
@@ -2,22 +2,14 @@
 
 import com.iailab.framework.common.page.PageData;
 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.mpk.dto.ChartParamDTO;
-import com.iailab.module.model.mpk.dto.MpkFileDTO;
+import com.iailab.module.model.api.mcs.dto.ChartParamDTO;
 import com.iailab.module.model.mpk.entity.ChartParamEntity;
-import com.iailab.module.model.mpk.entity.IconEntity;
 import com.iailab.module.model.mpk.service.ChartParamService;
-import com.iailab.module.model.mpk.vo.IconPageReqVO;
 import io.swagger.v3.oas.annotations.Operation;
 import io.swagger.v3.oas.annotations.tags.Tag;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.*;
 
-import javax.validation.Valid;
-import java.util.List;
 import java.util.Map;
 
 import static com.iailab.framework.common.pojo.CommonResult.success;
diff --git a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mpk/dto/ChartDTO.java b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mpk/dto/ChartDTO.java
index be7dd70..902ee15 100644
--- a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mpk/dto/ChartDTO.java
+++ b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mpk/dto/ChartDTO.java
@@ -1,7 +1,7 @@
 package com.iailab.module.model.mpk.dto;
 
 import com.baomidou.mybatisplus.annotation.TableId;
-import com.baomidou.mybatisplus.annotation.TableName;
+import com.iailab.module.model.api.mcs.dto.ChartParamDTO;
 import lombok.Data;
 
 import java.io.Serializable;
diff --git a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mpk/service/ChartParamService.java b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mpk/service/ChartParamService.java
index 9f503d7..70d46e1 100644
--- a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mpk/service/ChartParamService.java
+++ b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mpk/service/ChartParamService.java
@@ -1,11 +1,8 @@
 package com.iailab.module.model.mpk.service;
 
 import com.iailab.framework.common.page.PageData;
-import com.iailab.framework.common.pojo.PageResult;
-import com.iailab.module.model.mpk.dto.ChartParamDTO;
+import com.iailab.module.model.api.mcs.dto.ChartParamDTO;
 import com.iailab.module.model.mpk.entity.ChartParamEntity;
-import com.iailab.module.model.mpk.entity.IconEntity;
-import com.iailab.module.model.mpk.vo.IconPageReqVO;
 
 import java.util.List;
 import java.util.Map;
@@ -28,4 +25,6 @@
     void delete(String id);
 
     Map<String, String> getByChartId(String chartId);
+
+    List<com.iailab.module.model.api.mcs.dto.ChartParamDTO> list(String chartCode);
 }
diff --git a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mpk/service/impl/ChartParamServiceImpl.java b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mpk/service/impl/ChartParamServiceImpl.java
index 782bbea..d03826c 100644
--- a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mpk/service/impl/ChartParamServiceImpl.java
+++ b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mpk/service/impl/ChartParamServiceImpl.java
@@ -4,14 +4,13 @@
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.iailab.framework.common.page.PageData;
 import com.iailab.framework.common.service.impl.BaseServiceImpl;
+import com.iailab.framework.common.util.object.ConvertUtils;
+import com.iailab.module.model.api.mcs.dto.ChartParamDTO;
 import com.iailab.module.model.mpk.dao.ChartParamDao;
-import com.iailab.module.model.mpk.dto.ChartParamDTO;
-import com.iailab.module.model.mpk.entity.ChartEntity;
 import com.iailab.module.model.mpk.entity.ChartParamEntity;
 import com.iailab.module.model.mpk.service.ChartParamService;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang3.StringUtils;
-import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.util.CollectionUtils;
 
@@ -70,6 +69,12 @@
     }
 
     @Override
+    public List<ChartParamDTO> list(String chartCode) {
+        List<ChartParamEntity> list = baseDao.selectList(new QueryWrapper<ChartParamEntity>().eq("chart_code", chartCode));
+        return ConvertUtils.sourceToTarget(list,ChartParamDTO.class);
+    }
+
+    @Override
     public void delete(String id) {
         baseDao.deleteById(id);
     }

--
Gitblit v1.9.3