提交 | 用户 | 时间
|
97d38f
|
1 |
package com.iailab.module.model.mcs.pre.service.impl; |
潘 |
2 |
|
9587d2
|
3 |
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
5b952f
|
4 |
import com.baomidou.mybatisplus.core.metadata.IPage; |
b06c21
|
5 |
import com.iailab.framework.common.pojo.PageResult; |
潘 |
6 |
import com.iailab.framework.common.service.impl.BaseServiceImpl; |
|
7 |
import com.iailab.framework.common.util.object.BeanUtils; |
5b952f
|
8 |
import com.iailab.framework.security.core.util.SecurityFrameworkUtils; |
9587d2
|
9 |
import com.iailab.module.model.api.mcs.dto.AlarmConfigRespDTO; |
b06c21
|
10 |
import com.iailab.module.model.mcs.pre.dao.MmPredictAlarmConfigDao; |
9587d2
|
11 |
import com.iailab.module.model.mcs.pre.entity.DmModuleEntity; |
b06c21
|
12 |
import com.iailab.module.model.mcs.pre.entity.MmPredictAlarmConfigEntity; |
9587d2
|
13 |
import com.iailab.module.model.mcs.pre.entity.MmPredictAlarmMessageEntity; |
97d38f
|
14 |
import com.iailab.module.model.mcs.pre.service.MmPredictAlarmConfigService; |
b06c21
|
15 |
import com.iailab.module.model.mcs.pre.vo.MmPredictAlarmConfigPageReqVO; |
5b952f
|
16 |
import com.iailab.module.model.mcs.pre.vo.MmPredictAlarmConfigRespVO; |
b06c21
|
17 |
import com.iailab.module.model.mcs.pre.vo.MmPredictAlarmConfigSaveReqVO; |
9587d2
|
18 |
import org.apache.commons.lang3.StringUtils; |
b06c21
|
19 |
import org.springframework.stereotype.Service; |
潘 |
20 |
|
9587d2
|
21 |
import java.util.*; |
97d38f
|
22 |
|
潘 |
23 |
/** |
|
24 |
* @author PanZhibao |
|
25 |
* @Description |
|
26 |
* @createTime 2024年11月19日 |
|
27 |
*/ |
b06c21
|
28 |
@Service |
潘 |
29 |
public class MmPredictAlarmConfigServiceImpl extends BaseServiceImpl<MmPredictAlarmConfigDao, MmPredictAlarmConfigEntity> |
|
30 |
implements MmPredictAlarmConfigService { |
|
31 |
|
|
32 |
@Override |
5b952f
|
33 |
public PageResult<MmPredictAlarmConfigRespVO> page(MmPredictAlarmConfigPageReqVO reqVO) { |
L |
34 |
IPage<MmPredictAlarmConfigRespVO> page = baseDao.selectPage(reqVO); |
|
35 |
return new PageResult<>(page.getRecords(), page.getTotal()); |
b06c21
|
36 |
} |
潘 |
37 |
|
|
38 |
@Override |
|
39 |
public MmPredictAlarmConfigEntity getInfo(String id) { |
|
40 |
return baseDao.selectById(id); |
|
41 |
} |
|
42 |
|
|
43 |
@Override |
|
44 |
public void create(MmPredictAlarmConfigSaveReqVO reqVO) { |
|
45 |
MmPredictAlarmConfigEntity entity = BeanUtils.toBean(reqVO, MmPredictAlarmConfigEntity.class); |
|
46 |
entity.setId(UUID.randomUUID().toString()); |
5b952f
|
47 |
entity.setCreator(SecurityFrameworkUtils.getLoginUserNickname()); |
b06c21
|
48 |
entity.setCreateTime(new Date()); |
潘 |
49 |
baseDao.insert(entity); |
|
50 |
} |
|
51 |
|
|
52 |
@Override |
|
53 |
public void update(MmPredictAlarmConfigSaveReqVO reqVO) { |
|
54 |
MmPredictAlarmConfigEntity entity = BeanUtils.toBean(reqVO, MmPredictAlarmConfigEntity.class); |
5b952f
|
55 |
entity.setUpdater(SecurityFrameworkUtils.getLoginUserNickname()); |
L |
56 |
entity.setUpdateTime(new Date()); |
b06c21
|
57 |
baseDao.updateById(entity); |
潘 |
58 |
} |
|
59 |
|
|
60 |
@Override |
|
61 |
public void delete(String id) { |
|
62 |
baseDao.deleteById(id); |
|
63 |
} |
9587d2
|
64 |
|
L |
65 |
@Override |
|
66 |
public List<AlarmConfigRespDTO> list(Map<String, Object> params) { |
|
67 |
QueryWrapper<MmPredictAlarmConfigEntity> wrapper = new QueryWrapper<>(); |
|
68 |
wrapper.eq("is_enable", 1); |
|
69 |
return BeanUtils.toBean(baseDao.selectList(wrapper), AlarmConfigRespDTO.class); |
|
70 |
} |
97d38f
|
71 |
} |