提交 | 用户 | 时间
|
2a6f08
|
1 |
package com.iailab.module.data.ind.value.service.impl; |
潘 |
2 |
|
|
3 |
import com.iailab.framework.common.pojo.PageResult; |
|
4 |
import com.iailab.framework.common.service.impl.BaseServiceImpl; |
|
5 |
import com.iailab.framework.common.util.object.BeanUtils; |
cf757d
|
6 |
import com.iailab.module.data.ind.item.vo.IndItemValueVO; |
2a6f08
|
7 |
import com.iailab.module.data.ind.value.dao.IndItemValueDao; |
cf757d
|
8 |
import com.iailab.module.data.ind.value.dto.QuerySourceValueDTO; |
2a6f08
|
9 |
import com.iailab.module.data.ind.value.entity.IndItemValueEntity; |
潘 |
10 |
import com.iailab.module.data.ind.value.service.IndItemValueService; |
|
11 |
import com.iailab.module.data.ind.value.vo.IndItemValuePageReqVO; |
|
12 |
import com.iailab.module.data.ind.value.vo.IndItemValueSaveReqVO; |
cf757d
|
13 |
import org.apache.commons.lang3.StringUtils; |
2a6f08
|
14 |
import org.springframework.stereotype.Service; |
潘 |
15 |
|
cf757d
|
16 |
import java.util.List; |
潘 |
17 |
import java.util.Map; |
2a6f08
|
18 |
import java.util.UUID; |
潘 |
19 |
|
|
20 |
/** |
|
21 |
* @author PanZhibao |
|
22 |
* @Description |
|
23 |
* @createTime 2024年09月11日 |
|
24 |
*/ |
|
25 |
@Service |
|
26 |
public class IndItemValueServiceImpl extends BaseServiceImpl<IndItemValueDao, IndItemValueEntity> implements IndItemValueService { |
|
27 |
|
|
28 |
@Override |
|
29 |
public PageResult<IndItemValueEntity> page(IndItemValuePageReqVO reqVO) { |
|
30 |
return baseDao.selectPage(reqVO); |
|
31 |
} |
|
32 |
|
|
33 |
@Override |
|
34 |
public void create(IndItemValueSaveReqVO createReqVO) { |
|
35 |
IndItemValueEntity entity = BeanUtils.toBean(createReqVO, IndItemValueEntity.class); |
|
36 |
entity.setId(UUID.randomUUID().toString()); |
|
37 |
baseDao.insert(entity); |
|
38 |
} |
|
39 |
|
|
40 |
@Override |
|
41 |
public void update(IndItemValueSaveReqVO updateReqVO) { |
|
42 |
IndItemValueEntity entity = BeanUtils.toBean(updateReqVO, IndItemValueEntity.class); |
|
43 |
baseDao.updateById(entity); |
|
44 |
} |
|
45 |
|
|
46 |
@Override |
|
47 |
public IndItemValueEntity get(String id) { |
|
48 |
return baseDao.selectById(id); |
|
49 |
} |
|
50 |
|
|
51 |
@Override |
|
52 |
public void delete(String id) { |
|
53 |
baseDao.deleteById(id); |
|
54 |
} |
cf757d
|
55 |
|
潘 |
56 |
/** |
|
57 |
* 根据配置的数据源动态查询 |
|
58 |
* @param dto |
|
59 |
* @return |
|
60 |
*/ |
|
61 |
@Override |
|
62 |
public List<IndItemValueVO> getSourceValue(QuerySourceValueDTO dto) { |
|
63 |
if (StringUtils.isEmpty(dto.getDataSource())) { |
|
64 |
log.warn("数据源不能为空"); |
|
65 |
return null; |
|
66 |
} |
|
67 |
|
|
68 |
|
|
69 |
return baseDao.getSourceValue(dto); |
|
70 |
} |
2a6f08
|
71 |
} |