提交 | 用户 | 时间
|
7fd198
|
1 |
package com.iailab.module.model.mcs.sche.service.impl; |
潘 |
2 |
|
bbc1ee
|
3 |
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
潘 |
4 |
import com.iailab.framework.common.pojo.PageResult; |
7fd198
|
5 |
import com.iailab.framework.common.service.impl.BaseServiceImpl; |
bbc1ee
|
6 |
import com.iailab.framework.common.util.object.BeanUtils; |
4072bc
|
7 |
import com.iailab.framework.common.util.object.ConvertUtils; |
L |
8 |
import com.iailab.module.model.api.mcs.dto.AlarmConfigRespDTO; |
|
9 |
import com.iailab.module.model.api.mcs.dto.StScheduleSchemeDTO; |
|
10 |
import com.iailab.module.model.mcs.pre.entity.MmPredictAlarmConfigEntity; |
7fd198
|
11 |
import com.iailab.module.model.mcs.sche.dao.StScheduleSchemeDao; |
潘 |
12 |
import com.iailab.module.model.mcs.sche.entity.StScheduleSchemeEntity; |
|
13 |
import com.iailab.module.model.mcs.sche.service.StScheduleSchemeService; |
bbc1ee
|
14 |
import com.iailab.module.model.mcs.sche.vo.StScheduleSchemePageReqVO; |
潘 |
15 |
import com.iailab.module.model.mcs.sche.vo.StScheduleSchemeSaveReqVO; |
7fd198
|
16 |
import org.springframework.stereotype.Service; |
bbc1ee
|
17 |
|
4072bc
|
18 |
import java.util.*; |
7fd198
|
19 |
|
潘 |
20 |
/** |
|
21 |
* @author PanZhibao |
|
22 |
* @date 2021年08月11日 12:06 |
|
23 |
*/ |
bbc1ee
|
24 |
@Service |
7fd198
|
25 |
public class StScheduleSchemeServiceImpl extends BaseServiceImpl<StScheduleSchemeDao, StScheduleSchemeEntity> |
潘 |
26 |
implements StScheduleSchemeService { |
bbc1ee
|
27 |
|
潘 |
28 |
@Override |
|
29 |
public PageResult<StScheduleSchemeEntity> page(StScheduleSchemePageReqVO reqVO) { |
|
30 |
return baseDao.selectPage(reqVO); |
|
31 |
} |
|
32 |
|
|
33 |
@Override |
|
34 |
public void create(StScheduleSchemeSaveReqVO createReqVO) { |
|
35 |
StScheduleSchemeEntity entity = BeanUtils.toBean(createReqVO, StScheduleSchemeEntity.class); |
|
36 |
entity.setId(UUID.randomUUID().toString()); |
|
37 |
baseDao.insert(entity); |
|
38 |
} |
|
39 |
|
|
40 |
@Override |
51c1c2
|
41 |
public void update(StScheduleSchemeSaveReqVO updateReqVO) { |
潘 |
42 |
StScheduleSchemeEntity entity = BeanUtils.toBean(updateReqVO, StScheduleSchemeEntity.class); |
bbc1ee
|
43 |
baseDao.updateById(entity); |
潘 |
44 |
} |
|
45 |
|
|
46 |
@Override |
|
47 |
public void delete(String id) { |
|
48 |
baseDao.deleteById(id); |
|
49 |
} |
|
50 |
|
|
51 |
@Override |
|
52 |
public StScheduleSchemeEntity getInfo(String id) { |
|
53 |
return baseDao.selectById(id); |
|
54 |
} |
|
55 |
|
|
56 |
@Override |
|
57 |
public StScheduleSchemeEntity getByCode(String code) { |
|
58 |
QueryWrapper<StScheduleSchemeEntity> queryWrapper = new QueryWrapper<>(); |
|
59 |
queryWrapper.eq("code", code); |
|
60 |
return baseDao.selectOne(queryWrapper); |
|
61 |
} |
|
62 |
|
|
63 |
@Override |
4072bc
|
64 |
public List<StScheduleSchemeDTO> list(Map<String, Object> params) { |
L |
65 |
QueryWrapper<StScheduleSchemeEntity> queryWrapper = new QueryWrapper<>(); |
19f359
|
66 |
queryWrapper.eq("trigger_method", params.get("trigger_method")); |
4072bc
|
67 |
queryWrapper.eq("trigger_condition", params.get("trigger_condition")); |
L |
68 |
List<StScheduleSchemeEntity> list = baseDao.selectList(queryWrapper); |
|
69 |
return ConvertUtils.sourceToTarget(list, StScheduleSchemeDTO.class); |
|
70 |
} |
|
71 |
|
|
72 |
@Override |
bbc1ee
|
73 |
public void updateTime(String id, Date scheduleTime) { |
潘 |
74 |
StScheduleSchemeEntity entity = new StScheduleSchemeEntity(); |
|
75 |
entity.setId(id); |
|
76 |
entity.setScheduleTime(scheduleTime); |
|
77 |
baseDao.updateById(entity); |
|
78 |
} |
7fd198
|
79 |
} |