From 0a2b23ad3f30dfb01c5d590fb98f39e93bfe1932 Mon Sep 17 00:00:00 2001
From: dongyukun <1208714201@qq.com>
Date: 星期二, 31 十二月 2024 18:35:17 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/impl/MmPredictAlarmConfigServiceImpl.java |   25 +++++++++++++++++++++----
 1 files changed, 21 insertions(+), 4 deletions(-)

diff --git a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/impl/MmPredictAlarmConfigServiceImpl.java b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/impl/MmPredictAlarmConfigServiceImpl.java
index 6536a6c..58e5c42 100644
--- a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/impl/MmPredictAlarmConfigServiceImpl.java
+++ b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/impl/MmPredictAlarmConfigServiceImpl.java
@@ -1,17 +1,22 @@
 package com.iailab.module.model.mcs.pre.service.impl;
 
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.iailab.framework.common.pojo.PageResult;
 import com.iailab.framework.common.service.impl.BaseServiceImpl;
 import com.iailab.framework.common.util.object.BeanUtils;
+import com.iailab.framework.common.util.object.ConvertUtils;
+import com.iailab.framework.security.core.util.SecurityFrameworkUtils;
+import com.iailab.module.model.api.mcs.dto.AlarmConfigRespDTO;
 import com.iailab.module.model.mcs.pre.dao.MmPredictAlarmConfigDao;
 import com.iailab.module.model.mcs.pre.entity.MmPredictAlarmConfigEntity;
 import com.iailab.module.model.mcs.pre.service.MmPredictAlarmConfigService;
 import com.iailab.module.model.mcs.pre.vo.MmPredictAlarmConfigPageReqVO;
+import com.iailab.module.model.mcs.pre.vo.MmPredictAlarmConfigRespVO;
 import com.iailab.module.model.mcs.pre.vo.MmPredictAlarmConfigSaveReqVO;
 import org.springframework.stereotype.Service;
 
-import java.util.Date;
-import java.util.UUID;
+import java.util.*;
 
 /**
  * @author PanZhibao
@@ -23,8 +28,9 @@
         implements MmPredictAlarmConfigService {
 
     @Override
-    public PageResult<MmPredictAlarmConfigEntity> page(MmPredictAlarmConfigPageReqVO reqVO) {
-        return baseDao.selectPage(reqVO);
+    public PageResult<MmPredictAlarmConfigRespVO> page(MmPredictAlarmConfigPageReqVO reqVO) {
+        IPage<MmPredictAlarmConfigRespVO> page = baseDao.selectPage(reqVO);
+        return new PageResult<>(page.getRecords(), page.getTotal());
     }
 
     @Override
@@ -36,6 +42,7 @@
     public void create(MmPredictAlarmConfigSaveReqVO reqVO) {
         MmPredictAlarmConfigEntity entity = BeanUtils.toBean(reqVO, MmPredictAlarmConfigEntity.class);
         entity.setId(UUID.randomUUID().toString());
+        entity.setCreator(SecurityFrameworkUtils.getLoginUserNickname());
         entity.setCreateTime(new Date());
         baseDao.insert(entity);
     }
@@ -43,6 +50,8 @@
     @Override
     public void update(MmPredictAlarmConfigSaveReqVO reqVO) {
         MmPredictAlarmConfigEntity entity = BeanUtils.toBean(reqVO, MmPredictAlarmConfigEntity.class);
+        entity.setUpdater(SecurityFrameworkUtils.getLoginUserNickname());
+        entity.setUpdateTime(new Date());
         baseDao.updateById(entity);
     }
 
@@ -50,4 +59,12 @@
     public void delete(String id) {
         baseDao.deleteById(id);
     }
+
+    @Override
+    public List<AlarmConfigRespDTO> list(Map<String, Object> params) {
+        QueryWrapper<MmPredictAlarmConfigEntity> wrapper = new QueryWrapper<>();
+        wrapper.eq("is_enable", 1);
+        List<MmPredictAlarmConfigEntity> list = baseDao.selectList(wrapper);
+        return ConvertUtils.sourceToTarget(list, AlarmConfigRespDTO.class);
+    }
 }
\ No newline at end of file

--
Gitblit v1.9.3