From 97d38f7b7f7d95fe38cdbb79960106c15454b6ba Mon Sep 17 00:00:00 2001
From: 潘志宝 <979469083@qq.com>
Date: 星期二, 19 十一月 2024 15:23:51 +0800
Subject: [PATCH] 预警信息

---
 iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/controller/admin/StScheduleModelController.java |   29 +++++++++++++++++++++--------
 1 files changed, 21 insertions(+), 8 deletions(-)

diff --git a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/controller/admin/StScheduleModelController.java b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/controller/admin/StScheduleModelController.java
index 71ad196..ced1d63 100644
--- a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/controller/admin/StScheduleModelController.java
+++ b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/controller/admin/StScheduleModelController.java
@@ -4,10 +4,12 @@
 import com.iailab.framework.common.pojo.PageResult;
 import com.iailab.framework.common.util.object.BeanUtils;
 import com.iailab.module.model.mcs.sche.entity.StScheduleModelEntity;
+import com.iailab.module.model.mcs.sche.entity.StScheduleModelParamEntity;
+import com.iailab.module.model.mcs.sche.entity.StScheduleModelSettingEntity;
+import com.iailab.module.model.mcs.sche.service.StScheduleModelParamService;
 import com.iailab.module.model.mcs.sche.service.StScheduleModelService;
-import com.iailab.module.model.mcs.sche.vo.StScheduleModelPageReqVO;
-import com.iailab.module.model.mcs.sche.vo.StScheduleModelRespVO;
-import com.iailab.module.model.mcs.sche.vo.StScheduleModelSaveReqVO;
+import com.iailab.module.model.mcs.sche.service.StScheduleModelSettingService;
+import com.iailab.module.model.mcs.sche.vo.*;
 import io.swagger.v3.oas.annotations.Operation;
 import io.swagger.v3.oas.annotations.tags.Tag;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -33,6 +35,12 @@
     @Autowired
     private StScheduleModelService stScheduleModelService;
 
+    @Autowired
+    private StScheduleModelParamService stScheduleModelParamService;
+
+    @Autowired
+    private StScheduleModelSettingService stScheduleModelSettingService;
+
     @GetMapping("/page")
     @Operation(summary = "获得分页")
     @PreAuthorize("@ss.hasPermission('sche:model:query')")
@@ -51,15 +59,20 @@
     @GetMapping("/get")
     @Operation(summary = "获得详情")
     @PreAuthorize("@ss.hasPermission('sche:model:query')")
-    public CommonResult<StScheduleModelRespVO> get(@RequestParam("id") String id){
+    public CommonResult<StScheduleModelRespVO> get(@RequestParam("id") String id) {
         StScheduleModelEntity data = stScheduleModelService.get(id);
-        return success(BeanUtils.toBean(data, StScheduleModelRespVO.class));
+        StScheduleModelRespVO result = BeanUtils.toBean(data, StScheduleModelRespVO.class);
+        List<StScheduleModelParamEntity> paramList = stScheduleModelParamService.getByModelId(data.getId());
+        result.setParamList(BeanUtils.toBean(paramList, StScheduleModelParamRespVO.class));
+        List<StScheduleModelSettingEntity> settingList = stScheduleModelSettingService.getByModelId(data.getId());
+        result.setSettingList(BeanUtils.toBean(settingList, StScheduleModelSettingRespVO.class));
+        return success(result);
     }
 
     @PostMapping("/create")
     @Operation(summary = "创建模型")
     @PreAuthorize("@ss.hasPermission('sche:model:create')")
-    public CommonResult<Boolean> save(@Valid @RequestBody StScheduleModelSaveReqVO reqVO){
+    public CommonResult<Boolean> save(@Valid @RequestBody StScheduleModelSaveReqVO reqVO) {
         Long count = stScheduleModelService.check(reqVO);
         if (count > 0) {
             return error(999, "名称或编号重复");
@@ -71,7 +84,7 @@
     @PutMapping("/update")
     @Operation(summary = "更新模型")
     @PreAuthorize("@ss.hasPermission('sche:model:update')")
-    public CommonResult<Boolean> update(@Valid @RequestBody StScheduleModelSaveReqVO reqVO){
+    public CommonResult<Boolean> update(@Valid @RequestBody StScheduleModelSaveReqVO reqVO) {
         Long count = stScheduleModelService.check(reqVO);
         if (count > 0) {
             return error(999, "名称或编号重复");
@@ -83,7 +96,7 @@
     @DeleteMapping("/delete")
     @Operation(summary = "删除模型")
     @PreAuthorize("@ss.hasPermission('sche:model:delete')")
-    public CommonResult<Boolean> delete(@RequestParam("id") String id){
+    public CommonResult<Boolean> delete(@RequestParam("id") String id) {
         stScheduleModelService.delete(id);
         return success(true);
     }

--
Gitblit v1.9.3