From 4b677f722568b022be3aef6a2d29599c0e00d1af Mon Sep 17 00:00:00 2001
From: liriming <1343021927@qq.com>
Date: 星期二, 01 四月 2025 13:31:41 +0800
Subject: [PATCH] 修改建议状态

---
 iailab-module-model/iailab-module-model-api/src/main/java/com/iailab/module/model/api/mcs/dto/StAlarmAndSuggestReqVO.java                 |   24 ++++++++++++++++++++++++
 iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/service/impl/StScheduleSuggestServiceImpl.java |   12 ++++++++++++
 iailab-module-model/iailab-module-model-api/src/main/java/com/iailab/module/model/api/mcs/dto/StAlarmAndSuggestRespVO.java                |    2 ++
 iailab-module-model/iailab-module-model-api/src/main/java/com/iailab/module/model/api/mcs/McsApi.java                                     |    5 +++++
 iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/api/McsApiImpl.java                                     |    5 +++++
 iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/service/StScheduleSuggestService.java          |    4 ++++
 iailab-module-model/iailab-module-model-biz/src/main/resources/mapper/mcs/StScheduleSchemeDao.xml                                         |    5 +++--
 7 files changed, 55 insertions(+), 2 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 fcb8ff0..5186674 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
@@ -152,4 +152,9 @@
     @PostMapping(PREFIX + "/item/result/last-point")
     @Operation(summary = "获取")
     List<Object[]> getItemResultLastPoint(@RequestBody PreItemResultReqVO reqVO);
+
+    @PostMapping(PREFIX + "/schedule-suggest/update-status")
+    @Operation(summary = "修改调度建议状态")
+    Boolean updateSuggestStatus(@RequestBody StAlarmAndSuggestReqVO reqVO);
+
 }
\ No newline at end of file
diff --git a/iailab-module-model/iailab-module-model-api/src/main/java/com/iailab/module/model/api/mcs/dto/StAlarmAndSuggestReqVO.java b/iailab-module-model/iailab-module-model-api/src/main/java/com/iailab/module/model/api/mcs/dto/StAlarmAndSuggestReqVO.java
new file mode 100644
index 0000000..00ffd2e
--- /dev/null
+++ b/iailab-module-model/iailab-module-model-api/src/main/java/com/iailab/module/model/api/mcs/dto/StAlarmAndSuggestReqVO.java
@@ -0,0 +1,24 @@
+package com.iailab.module.model.api.mcs.dto;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * @author PanZhibao
+ * @Description
+ * @createTime 2025年01月07日
+ */
+@Schema(description = "RPC 模型 - 预警和建议 DTO")
+@Data
+public class StAlarmAndSuggestReqVO implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    private String id;
+
+    private Integer status;
+}
\ No newline at end of file
diff --git a/iailab-module-model/iailab-module-model-api/src/main/java/com/iailab/module/model/api/mcs/dto/StAlarmAndSuggestRespVO.java b/iailab-module-model/iailab-module-model-api/src/main/java/com/iailab/module/model/api/mcs/dto/StAlarmAndSuggestRespVO.java
index c9678be..bcd927b 100644
--- a/iailab-module-model/iailab-module-model-api/src/main/java/com/iailab/module/model/api/mcs/dto/StAlarmAndSuggestRespVO.java
+++ b/iailab-module-model/iailab-module-model-api/src/main/java/com/iailab/module/model/api/mcs/dto/StAlarmAndSuggestRespVO.java
@@ -18,6 +18,8 @@
 
     private static final long serialVersionUID = 1L;
 
+    private String id;
+
     @Schema(description = "类型(1:预警,2:建议)")
     private String type;
 
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 b4b3cfa..0911d2f 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
@@ -877,6 +877,11 @@
         return mmItemResultLastPointService.getData(reqVO.getOutputid(),reqVO.getStartTime(),reqVO.getEndTime(),reqVO.getTimeFormat());
     }
 
+    @Override
+    public Boolean updateSuggestStatus(StAlarmAndSuggestReqVO reqVO) {
+        return stScheduleSuggestService.updateSuggestStatus(reqVO);
+    }
+
     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/mcs/sche/service/StScheduleSuggestService.java b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/service/StScheduleSuggestService.java
index 4fae173..de7c43b 100644
--- a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/service/StScheduleSuggestService.java
+++ b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/service/StScheduleSuggestService.java
@@ -4,6 +4,8 @@
 import com.iailab.framework.common.service.BaseService;
 import com.iailab.module.model.api.mcs.dto.ScheduleSuggestReqDTO;
 import com.iailab.module.model.api.mcs.dto.ScheduleSuggestRespDTO;
+import com.iailab.module.model.api.mcs.dto.StAlarmAndSuggestReqVO;
+import com.iailab.module.model.api.mcs.dto.StAlarmAndSuggestRespVO;
 import com.iailab.module.model.mcs.sche.entity.StScheduleSuggestEntity;
 import com.iailab.module.model.mcs.sche.vo.StScheduleSuggestPageReqVO;
 import com.iailab.module.model.mcs.sche.vo.StScheduleSuggestSaveReqVO;
@@ -36,4 +38,6 @@
     List<ScheduleSuggestRespDTO> list(ScheduleSuggestReqDTO vo);
 
     List<StScheduleSuggestEntity> getList(List<String> scheduleObjList, Date predictTime);
+
+    Boolean updateSuggestStatus(StAlarmAndSuggestReqVO reqVO);
 }
diff --git a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/service/impl/StScheduleSuggestServiceImpl.java b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/service/impl/StScheduleSuggestServiceImpl.java
index 1d4db1b..45037e1 100644
--- a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/service/impl/StScheduleSuggestServiceImpl.java
+++ b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/service/impl/StScheduleSuggestServiceImpl.java
@@ -7,8 +7,11 @@
 import com.iailab.framework.common.util.object.ConvertUtils;
 import com.iailab.module.model.api.mcs.dto.ScheduleSuggestReqDTO;
 import com.iailab.module.model.api.mcs.dto.ScheduleSuggestRespDTO;
+import com.iailab.module.model.api.mcs.dto.StAlarmAndSuggestReqVO;
+import com.iailab.module.model.api.mcs.dto.StAlarmAndSuggestRespVO;
 import com.iailab.module.model.common.enums.ScheduleSuggestStatusEnum;
 import com.iailab.module.model.mcs.sche.dao.StScheduleSuggestDao;
+import com.iailab.module.model.mcs.sche.entity.StScheduleSchemeEntity;
 import com.iailab.module.model.mcs.sche.entity.StScheduleSuggestEntity;
 import com.iailab.module.model.mcs.sche.service.StScheduleSuggestService;
 import com.iailab.module.model.mcs.sche.vo.StScheduleSuggestPageReqVO;
@@ -91,4 +94,13 @@
         queryWrapper.eq("schedule_time", predictTime);
         return baseDao.selectList(queryWrapper);
     }
+
+    @Override
+    public Boolean updateSuggestStatus(StAlarmAndSuggestReqVO reqVO) {
+        StScheduleSuggestEntity entity = new StScheduleSuggestEntity();
+        entity.setId(reqVO.getId());
+        entity.setStatus(reqVO.getStatus());
+        baseDao.updateById(entity);
+        return true;
+    }
 }
\ No newline at end of file
diff --git a/iailab-module-model/iailab-module-model-biz/src/main/resources/mapper/mcs/StScheduleSchemeDao.xml b/iailab-module-model/iailab-module-model-biz/src/main/resources/mapper/mcs/StScheduleSchemeDao.xml
index 3e4049e..45155f6 100644
--- a/iailab-module-model/iailab-module-model-biz/src/main/resources/mapper/mcs/StScheduleSchemeDao.xml
+++ b/iailab-module-model/iailab-module-model-biz/src/main/resources/mapper/mcs/StScheduleSchemeDao.xml
@@ -4,6 +4,7 @@
 
     <select id="getAlarmAndSuggestPage" resultType="com.iailab.module.model.api.mcs.dto.StAlarmAndSuggestRespVO">
         select
+        t.id,
         t.type,
         t.title,
         t.content,
@@ -11,10 +12,10 @@
         t.obj,
         t.status
         from (
-                 select 'alarm' type, t1.title, t1.content, t1.alarm_time `time`, t1.alarm_obj obj,0 status
+                 select id,'alarm' type, t1.title, t1.content, t1.alarm_time `time`, t1.alarm_obj obj,0 status
                  from t_mm_predict_alarm_message t1
                  UNION
-                 select 'suggest' type, t2.title, t2.content, t2.schedule_time `time`, t2.schedule_obj obj,t2.status
+                 select id,'suggest' type, t2.title, t2.content, t2.schedule_time `time`, t2.schedule_obj obj,t2.status
                  from t_st_schedule_suggest t2
         ) t
         <where>

--
Gitblit v1.9.3