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