潘志宝
2025-01-14 85988421613383c029a25f1e21dfe8dd09cc562c
提交 | 用户 | 时间
a6de49 1 package com.iailab.module.data.point.service.impl;
H 2
139c6a 3 import cn.hutool.core.collection.CollUtil;
a6de49 4 import com.alibaba.fastjson.JSONArray;
cfbd83 5 import com.baomidou.dynamic.datasource.annotation.DSTransactional;
a6de49 6 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
250190 7 import com.baomidou.mybatisplus.core.metadata.IPage;
6bf63b 8 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
48c064 9 import com.iailab.framework.common.constant.Constant;
6bf63b 10 import com.iailab.framework.common.pojo.PageResult;
48c064 11 import com.iailab.framework.common.service.impl.BaseServiceImpl;
139c6a 12 import com.iailab.framework.common.util.object.BeanUtils;
6bf63b 13 import com.iailab.framework.common.util.object.ConvertUtils;
07890e 14 import com.iailab.module.data.api.point.dto.ApiPointDTO;
01d6f8 15 import com.iailab.module.data.channel.common.service.ChannelSourceService;
a6de49 16 import com.iailab.module.data.common.enums.CommonConstant;
H 17 import com.iailab.module.data.common.enums.IsEnableEnum;
c96e44 18 import com.iailab.module.data.common.enums.IncreaseCodeEnum;
a6de49 19 import com.iailab.module.data.point.common.PointTypeEnum;
6bf63b 20 import com.iailab.module.data.point.dao.DaPointDao;
0ed8ac 21 import com.iailab.module.data.point.dto.DaCumulatePointDTO;
22 import com.iailab.module.data.point.dto.DaMathPointDTO;
a6de49 23 import com.iailab.module.data.point.dto.DaMeasurePointDTO;
H 24 import com.iailab.module.data.point.dto.DaPointDTO;
139c6a 25 import com.iailab.module.data.point.entity.DaMeasurePointEntity;
a6de49 26 import com.iailab.module.data.point.entity.DaPointEntity;
0ed8ac 27 import com.iailab.module.data.point.service.*;
f21253 28 import com.iailab.module.data.point.vo.DaPointPageReqVO;
J 29 import com.iailab.module.data.point.vo.PointImportExcelVO;
30 import com.iailab.module.data.point.vo.PointImportRespVO;
48c57b 31 import org.apache.commons.lang3.ObjectUtils;
0ed8ac 32 import org.springframework.beans.factory.annotation.Autowired;
a6de49 33 import org.springframework.stereotype.Service;
H 34 import org.springframework.util.CollectionUtils;
35
6bf63b 36 import javax.annotation.Resource;
a6de49 37 import java.util.*;
9df837 38 import java.util.concurrent.ConcurrentHashMap;
139c6a 39
D 40 import static com.iailab.framework.common.exception.util.ServiceExceptionUtil.exception;
f21253 41 import static com.iailab.module.data.enums.ErrorCodeConstants.POINT_EXISTS;
J 42 import static com.iailab.module.data.enums.ErrorCodeConstants.POINT_IMPORT_LIST_IS_EMPTY;
a6de49 43
H 44 /**
6bf63b 45  * @author lirm
a6de49 46  * @Description
6bf63b 47  * @createTime 2024年09月2日
a6de49 48  */
H 49 @Service
48c064 50 public class DaPointServiceImpl extends BaseServiceImpl<DaPointDao, DaPointEntity> implements DaPointService {
a6de49 51
0ed8ac 52     @Autowired
a6de49 53     private DaMeasurePointService daMeasurePointService;
H 54
0ed8ac 55     @Autowired
a6de49 56     private DaMathPointService daMathPointService;
H 57
0ed8ac 58     @Autowired
59     private DaCumulatePointService daCumulatePointService;
60
61     @Autowired
a6de49 62     private DaSequenceNumService daSequenceNumService;
6bf63b 63     
L 64     @Resource
65     private DaPointDao daPointDao;
66
139c6a 67     @Resource
01d6f8 68     private ChannelSourceService channelSourceService;
9df837 69
90e342 70     @Resource
71     private DaPointCollectStatusService daPointCollectStatusService;
72
07890e 73     private static Map<String, ApiPointDTO> pointIdMap = new ConcurrentHashMap<>();
a4891a 74
9df837 75     private static Map<String, DaPointDTO> pointNoMap = new ConcurrentHashMap<>();
a6de49 76
H 77     @Override
250190 78     public PageResult<DaPointDTO> queryPage(DaPointPageReqVO reqVO) {
139c6a 79         IPage<DaPointDTO> page = daPointDao.selectPageList(reqVO);
a4891a 80         return new PageResult<>(page.getRecords(), page.getTotal());
81     }
82
83     private void clearCache() {
84         pointIdMap.clear();
85         pointNoMap.clear();
a6de49 86     }
H 87
88     @Override
6bf63b 89     public DaPointDTO info(String id) {
L 90         DaPointEntity entity = daPointDao.selectById(id);
a6de49 91         DaPointDTO result = ConvertUtils.sourceToTarget(entity, DaPointDTO.class);
0ed8ac 92         result.setMeasurePoint(new DaMeasurePointDTO());
93         result.setMathPoint(new DaMathPointDTO());
94         result.setCumulatePoint(new DaCumulatePointDTO());
95         switch (PointTypeEnum.getEumByCode(result.getPointType())) {
96             case MEASURE_POINT:
97                 DaMeasurePointDTO measurePoint = daMeasurePointService.getByPoint(id);
98                 result.setMeasurePoint(measurePoint);
99                 List<String> sourceOption = new ArrayList<>();
100                 sourceOption.add(measurePoint.getSourceType());
101                 sourceOption.add(measurePoint.getSourceId());
102                 sourceOption.add(measurePoint.getTagNo());
103                 result.setSourceOption(sourceOption);
104                 break;
105             case CALCULATE_POINT:
106                 result.setMathPoint(daMathPointService.getByPoint(id));
107                 break;
108             case CUMULATE:
109                 result.setCumulatePoint(daCumulatePointService.getByPoint(id));
110                 break;
111             default:
112                 break;
a6de49 113         }
H 114         return result;
115     }
116
117     @Override
07890e 118     public ApiPointDTO getSimpleInfoById(String id) {
a4891a 119         if (pointIdMap.containsKey(id)) {
120             return pointIdMap.get(id);
121         }
07890e 122         ApiPointDTO dto = ConvertUtils.sourceToTarget(daPointDao.selectById(id), ApiPointDTO.class);
5f7008 123         if (dto == null) {
124             return null;
125         }
a4891a 126         pointIdMap.put(id, dto);
07890e 127         return dto;
b8b8cb 128     }
129
130     @Override
131     public DaPointDTO getSimpleInfoByNo(String no) {
29b971 132         QueryWrapper<DaPointEntity> queryWrapper = new QueryWrapper<>();
7511af 133         queryWrapper.eq("point_no", no);
b8b8cb 134         return ConvertUtils.sourceToTarget(daPointDao.selectOne(queryWrapper), DaPointDTO.class);
135     }
136
137     @Override
a6de49 138     public List<DaPointDTO> list(Map<String, Object> params) {
48c57b 139         Object pointType = params.get("pointType");
a6de49 140         List<String> pointNos = new ArrayList<>();
H 141         if (params.get("pointNos") != null) {
142             pointNos = JSONArray.parseArray(JSONArray.toJSONString(params.get("pointNos")), String.class);
143         }
14cb32 144         List<String> pointTypes = new ArrayList<>();
145         if (params.get("pointTypes") != null) {
146             pointTypes = Arrays.asList(params.get("pointTypes").toString().split(","));
147         }
148
48c57b 149         Object pointNoLike = params.get("pointNoLike");
a6de49 150         QueryWrapper<DaPointEntity> queryWrapper = new QueryWrapper();
48c57b 151         queryWrapper.eq(!ObjectUtils.isEmpty(pointType), "point_type", pointType);
L 152         queryWrapper.in(pointNos.size() != 0,"point_no", pointNos);
153         queryWrapper.like(!ObjectUtils.isEmpty(pointNoLike), "point_no", pointNoLike);
14cb32 154         queryWrapper.in(pointTypes.size() != 0,"point_type", pointTypes);
6bf63b 155         List<DaPointEntity> list = daPointDao.selectList(queryWrapper);
a6de49 156         return ConvertUtils.sourceToTarget(list, DaPointDTO.class);
H 157     }
158
159     @Override
cfbd83 160     @DSTransactional(rollbackFor = Exception.class)
a6de49 161     public void add(DaPointDTO dataPoint) {
H 162         DaPointEntity daPointEntity = ConvertUtils.sourceToTarget(dataPoint, DaPointEntity.class);
163         daPointEntity.setId(UUID.randomUUID().toString());
01d6f8 164         switch (PointTypeEnum.getEumByCode(dataPoint.getPointType())) {
165             case MEASURE_POINT:
166                 DaMeasurePointDTO measurePoint = new DaMeasurePointDTO();
167                 measurePoint.setSourceType(dataPoint.getSourceOption().get(0));
168                 measurePoint.setSourceId(dataPoint.getSourceOption().get(1));
169                 measurePoint.setTagNo(dataPoint.getSourceOption().get(2));
170                 daMeasurePointService.add(measurePoint, daPointEntity.getId());
171                 daPointEntity.setPointNo(daSequenceNumService.getAndIncreaseByCode(IncreaseCodeEnum.POINT_M.name()));
172                 break;
173             case CALCULATE_POINT:
174                 daMathPointService.add(dataPoint.getMathPoint(), daPointEntity.getId());
175                 daPointEntity.setPointNo(daSequenceNumService.getAndIncreaseByCode(IncreaseCodeEnum.POINT_C.name()));
176                 break;
177             case CONSTANT:
178                 daPointEntity.setPointNo(daSequenceNumService.getAndIncreaseByCode(IncreaseCodeEnum.POINT_F.name()));
179                 break;
0ed8ac 180             case CUMULATE:
181                 daCumulatePointService.add(dataPoint.getCumulatePoint(), daPointEntity.getId());
182                 daPointEntity.setPointNo(daSequenceNumService.getAndIncreaseByCode(IncreaseCodeEnum.POINT_L.name()));
183                 break;
01d6f8 184             default:
185                 break;
a6de49 186         }
H 187         daPointEntity.setIsEnable(CommonConstant.IS_ENABLE);
188         daPointEntity.setCreateTime(new Date());
6bf63b 189         daPointDao.insert(daPointEntity);
9df837 190
90e342 191         daPointCollectStatusService.add(daPointEntity.getPointNo());
9df837 192         // 清空缓存
a4891a 193         clearCache();
a6de49 194     }
H 195
196     @Override
cfbd83 197     @DSTransactional(rollbackFor = Exception.class)
a6de49 198     public void update(DaPointDTO dataPoint) {
H 199         DaPointEntity daPointEntity = ConvertUtils.sourceToTarget(dataPoint, DaPointEntity.class);
200         daPointEntity.setUpdateTime(new Date());
6bf63b 201         daPointDao.updateById(daPointEntity);
01d6f8 202         switch (PointTypeEnum.getEumByCode(dataPoint.getPointType())) {
203             case MEASURE_POINT:
204                 DaMeasurePointDTO measurePoint = dataPoint.getMeasurePoint();
205                 measurePoint.setSourceType(dataPoint.getSourceOption().get(0));
206                 measurePoint.setSourceId(dataPoint.getSourceOption().get(1));
207                 measurePoint.setTagNo(dataPoint.getSourceOption().get(2));
208                 daMeasurePointService.update(measurePoint);
209                 break;
210             case CALCULATE_POINT:
211                 daMathPointService.update(dataPoint.getMathPoint());
212                 break;
0ed8ac 213             case CUMULATE:
214                 daCumulatePointService.update(dataPoint.getCumulatePoint());
215                 break;
01d6f8 216             default:
217                 break;
a6de49 218         }
9df837 219         // 清空缓存
a4891a 220         clearCache();
a6de49 221     }
H 222
223     @Override
cfbd83 224     @DSTransactional(rollbackFor = Exception.class)
eb1c5f 225     public void delete(String[] ids) {
226         daPointDao.deleteBatchIds(Arrays.asList(ids));
227         daMeasurePointService.deleteByPoint(ids);
228         daMathPointService.deleteByPoint(ids);
229         daCumulatePointService.deleteByPoint(ids);
9df837 230         // 清空缓存
a4891a 231         clearCache();
a6de49 232     }
H 233
234     @Override
14cb32 235     public List<DaPointDTO> getConstantPoint(DaPointPageReqVO reqVO) {
236         Map<String, Object> params = new HashMap<>();
237         params.put("pointType", PointTypeEnum.CONSTANT.getCode());
238         params.put("pointNo", reqVO.getPointNo());
239         params.put("pointName", reqVO.getPointName());
240         return daPointDao.getConstantPoint(params);
241     }
242
243     @Override
a6de49 244     public List<DaPointDTO> getConstantPoint(String freq) {
H 245         Map<String, Object> params = new HashMap<>();
246         params.put("pointType", PointTypeEnum.CONSTANT.getCode());
247         params.put("isEnable", CommonConstant.IS_ENABLE);
248         params.put("minfreqid", freq);
6bf63b 249         return daPointDao.getConstantPoint(params);
a6de49 250     }
H 251
252     @Override
253     public List<DaPointDTO> getConstantPoint(List<String> pointNos) {
254         Map<String, Object> params = new HashMap<>();
255         params.put("pointType", PointTypeEnum.CONSTANT.getCode());
256         params.put("isEnable", CommonConstant.IS_ENABLE);
257         params.put("pointNos", pointNos);
6bf63b 258         return daPointDao.getConstantPoint(params);
14cb32 259     }
260
261     @Override
262     public List<DaPointDTO> getMeasurePoint(DaPointPageReqVO reqVO) {
263         Map<String, Object> params = new HashMap<>();
264         params.put("pointType", PointTypeEnum.MEASURE_POINT.getCode());
265         params.put("pointNo", reqVO.getPointNo());
266         params.put("pointName", reqVO.getPointName());
267         params.put("sourceName", reqVO.getSourceName());
268         return daPointDao.getMeasurePoint(params);
a6de49 269     }
H 270
271     @Override
272     public List<DaPointDTO> getMeasurePoint(String freq) {
273         Map<String, Object> params = new HashMap<>();
274         params.put("pointType", PointTypeEnum.MEASURE_POINT.getCode());
275         params.put("isEnable", CommonConstant.IS_ENABLE);
276         params.put("minfreqid", freq);
6bf63b 277         return daPointDao.getMeasurePoint(params);
a6de49 278     }
H 279
280     @Override
281     public List<DaPointDTO> getMeasurePoint(List<String> pointNos) {
282         Map<String, Object> params = new HashMap<>();
283         params.put("pointType", PointTypeEnum.MEASURE_POINT.getCode());
284         params.put("isEnable", CommonConstant.IS_ENABLE);
285         params.put("pointNos", pointNos);
6bf63b 286         return daPointDao.getMeasurePoint(params);
a6de49 287     }
H 288
289     @Override
290     public DaPointDTO getMeasurePointByNo(String pointNo) {
291         Map<String, Object> params = new HashMap<>();
292         params.put("pointType", PointTypeEnum.MEASURE_POINT.getCode());
293         params.put("pointNo", pointNo);
6bf63b 294         List<DaPointDTO> list = daPointDao.getMeasurePoint(params);
a6de49 295         if (CollectionUtils.isEmpty(list)) {
H 296             return null;
297         }
298         return list.get(0);
14cb32 299     }
300
301     @Override
302     public List<DaPointDTO> getMathPoint(DaPointPageReqVO reqVO) {
303         Map<String, Object> params = new HashMap<>();
304         params.put("pointType", PointTypeEnum.CALCULATE_POINT.getCode());
305         params.put("pointNo", reqVO.getPointNo());
306         params.put("pointName", reqVO.getPointName());
307         return daPointDao.getMathPoint(params);
a6de49 308     }
H 309
310     @Override
311     public List<DaPointDTO> getMathPoint(String freq) {
312         Map<String, Object> params = new HashMap<>();
313         params.put("pointType", PointTypeEnum.CALCULATE_POINT.getCode());
314         params.put("isEnable", CommonConstant.IS_ENABLE);
315         params.put("minfreqid", freq);
6bf63b 316         return daPointDao.getMathPoint(params);
a6de49 317     }
H 318
319     @Override
320     public List<DaPointDTO> getMathPoint(List<String> pointNos) {
321         Map<String, Object> params = new HashMap<>();
322         params.put("pointType", PointTypeEnum.CALCULATE_POINT.getCode());
323         params.put("isEnable", CommonConstant.IS_ENABLE);
324         params.put("pointNos", pointNos);
6bf63b 325         return daPointDao.getMathPoint(params);
a6de49 326     }
H 327
328     @Override
56dba6 329     public List<DaPointDTO> getCumulatePoint(String freq) {
eb1c5f 330         Map<String, Object> params = new HashMap<>(3);
56dba6 331         params.put("pointType", PointTypeEnum.CUMULATE.getCode());
332         params.put("isEnable", CommonConstant.IS_ENABLE);
333         params.put("minfreqid", freq);
eb1c5f 334         return daPointDao.getCumulatePoint(params);
335     }
336
337     @Override
d64649 338     public List<DaPointDTO> getCumulatePoint(List<String> pointNos) {
339         Map<String, Object> params = new HashMap<>(3);
340         params.put("pointType", PointTypeEnum.CUMULATE.getCode());
341         params.put("isEnable", CommonConstant.IS_ENABLE);
342         params.put("pointNos", pointNos);
343         return daPointDao.getCumulatePoint(params);
344     }
345
346     @Override
eb1c5f 347     public List<DaPointDTO> getCumulatePoint(DaPointPageReqVO reqVO) {
348         Map<String, Object> params = new HashMap<>(3);
349         params.put("pointType", PointTypeEnum.CUMULATE.getCode());
350         params.put("pointNo", reqVO.getPointNo());
351         params.put("pointName", reqVO.getPointName());
56dba6 352         return daPointDao.getCumulatePoint(params);
353     }
354
355     @Override
a6de49 356     public DaPointDTO getByNo(String pointNo) {
9df837 357         if (pointNoMap.containsKey(pointNo)) {
358             return pointNoMap.get(pointNo);
359         }
a6de49 360         QueryWrapper<DaPointEntity> wrapper = new QueryWrapper<>();
H 361         wrapper.eq("point_no", pointNo);
6bf63b 362         DaPointEntity entity = daPointDao.selectOne(wrapper);
9df837 363         DaPointDTO dto = ConvertUtils.sourceToTarget(entity, DaPointDTO.class);
364         pointNoMap.put(pointNo, dto);
365         return dto;
a6de49 366     }
H 367
368     @Override
369     public List<DaPointDTO> getByNos(List<String> pointNos) {
370         QueryWrapper<DaPointEntity> wrapper = new QueryWrapper<>();
371         wrapper.in("point_no", pointNos);
6bf63b 372         List<DaPointEntity> list = daPointDao.selectList(wrapper);
a6de49 373         return ConvertUtils.sourceToTarget(list, DaPointDTO.class);
H 374     }
375
376     @Override
377     public void updateDefaultValue(DaPointDTO dto) {
378         QueryWrapper<DaPointEntity> wrapper = new QueryWrapper<>();
379         wrapper.eq("point_no", dto.getPointNo());
380         DaPointEntity entity = new DaPointEntity();
381         entity.setDefaultValue(dto.getDefaultValue());
6bf63b 382         daPointDao.update(entity, wrapper);
a6de49 383     }
H 384
385     @Override
139c6a 386     @DSTransactional(rollbackFor = Exception.class) // 添加事务,异常则回滚所有导入
D 387     public PointImportRespVO importPointList(List<PointImportExcelVO> importPoints, boolean isUpdateSupport) {
388         // 1.1 参数校验
389         if (CollUtil.isEmpty(importPoints)) {
390             throw exception(POINT_IMPORT_LIST_IS_EMPTY);
391         }
01d6f8 392
393         Map<String, Map<String, String>> sourcesIdMap = channelSourceService.getSourcesId();
139c6a 394         // 2. 遍历,逐个创建 or 更新
D 395         PointImportRespVO respVO = PointImportRespVO.builder().createPointnames(new ArrayList<>())
396                 .updatePointnames(new ArrayList<>()).failurePointnames(new LinkedHashMap<>()).build();
397         importPoints.forEach(importPoint -> {
398
399             // 判断如果不存在,再进行插入
48c064 400             DaPointEntity existPoint = baseDao.selectByPointName(importPoint.getPointName());
139c6a 401             if (existPoint == null) {
D 402                 DaPointEntity daPointEntity = ConvertUtils.sourceToTarget(importPoint, DaPointEntity.class);
403                 daPointEntity.setId(UUID.randomUUID().toString());
404                 daPointEntity.setIsEnable(CommonConstant.IS_ENABLE);
405                 daPointEntity.setCreateTime(new Date());
01d6f8 406                 switch (PointTypeEnum.getEumByCode(daPointEntity.getPointType())) {
407                     case MEASURE_POINT:
408                         DaMeasurePointDTO measurePoint = new DaMeasurePointDTO();
409                         measurePoint.setSourceType(importPoint.getSourceType());
410                         measurePoint.setSourceId(sourcesIdMap.get(importPoint.getSourceType()).get(importPoint.getSourceName()));
411                         measurePoint.setTagNo(importPoint.getTagNo());
412                         measurePoint.setValueType(importPoint.getValueType());
413                         measurePoint.setDimension(importPoint.getDimension());
414                         daMeasurePointService.add(measurePoint, daPointEntity.getId());
415                         daPointEntity.setPointNo(daSequenceNumService.getAndIncreaseByCode(IncreaseCodeEnum.POINT_M.name()));
416                         break;
417                     case CALCULATE_POINT:
418                         daMathPointService.add(importPoint.getExpression(), daPointEntity.getId());
419                         daPointEntity.setPointNo(daSequenceNumService.getAndIncreaseByCode(IncreaseCodeEnum.POINT_C.name()));
420                         break;
421                     case CONSTANT:
422                         daPointEntity.setPointNo(daSequenceNumService.getAndIncreaseByCode(IncreaseCodeEnum.POINT_F.name()));
423                         break;
eb1c5f 424                     case CUMULATE:
425                         DaCumulatePointDTO cumulatePoint = new DaCumulatePointDTO();
426                         cumulatePoint.setMomentPoint(importPoint.getMomentPoint());
427                         cumulatePoint.setLength(importPoint.getLength());
428                         cumulatePoint.setDivisor(importPoint.getDivisor());
429                         daCumulatePointService.add(cumulatePoint, daPointEntity.getId());
430                         daPointEntity.setPointNo(daSequenceNumService.getAndIncreaseByCode(IncreaseCodeEnum.POINT_L.name()));
01d6f8 431                     default:
432                         break;
433                 }
139c6a 434
D 435                 daPointDao.insert(daPointEntity);
13e045 436                 daPointCollectStatusService.add(daPointEntity.getPointNo());
139c6a 437                 respVO.getCreatePointnames().add(importPoint.getPointName());
D 438                 return;
439             }
440
441             // 如果存在,判断是否允许更新
442             if (!isUpdateSupport) {
443                 respVO.getFailurePointnames().put(importPoint.getPointName(), POINT_EXISTS.getMsg());
444                 return;
445             }
446
447             DaPointEntity updatePoint = BeanUtils.toBean(importPoint, DaPointEntity.class);
448             updatePoint.setId(existPoint.getId());
48c064 449             baseDao.updateById(updatePoint);
139c6a 450             DaMeasurePointEntity measurePoint = new DaMeasurePointEntity();
D 451             measurePoint.setSourceType(importPoint.getSourceType());
01d6f8 452             measurePoint.setSourceId(sourcesIdMap.get(importPoint.getSourceType()).get(importPoint.getSourceName()));
139c6a 453             measurePoint.setTagNo(importPoint.getTagNo());
D 454             daMeasurePointService.update(measurePoint, new QueryWrapper<DaMeasurePointEntity>().eq("point_id",updatePoint.getId()));
455             respVO.getUpdatePointnames().add(importPoint.getPointName());
456         });
457         return respVO;
458     }
459
460     @Override
14cb32 461     public List<DaPointDTO> getList(DaPointPageReqVO exportReqVO) {
462         return daPointDao.getList(exportReqVO);
139c6a 463     }
D 464
465     @Override
ee9f60 466     @DSTransactional(rollbackFor = Exception.class)
a6de49 467     public void enableByIds(String[] ids) {
H 468         if (CollectionUtils.isEmpty(Arrays.asList(ids))) {
469             return;
470         }
471         Arrays.asList(ids).forEach(item -> {
472             DaPointEntity entity = new DaPointEntity();
473             entity.setId(item);
f21253 474             entity.setIsEnable(IsEnableEnum.ENABLE.getCode());
ee9f60 475             entity.setUpdateTime(new Date());
6bf63b 476             daPointDao.updateById(entity);
a6de49 477         });
H 478     }
479
480     @Override
ee9f60 481     @DSTransactional(rollbackFor = Exception.class)
a6de49 482     public void disableByIds(String[] ids) {
H 483         if (CollectionUtils.isEmpty(Arrays.asList(ids))) {
484             return;
485         }
486         Arrays.asList(ids).forEach(item -> {
487             DaPointEntity entity = new DaPointEntity();
488             entity.setId(item);
f21253 489             entity.setIsEnable(IsEnableEnum.DISABLE.getCode());
ee9f60 490             entity.setUpdateTime(new Date());
6bf63b 491             daPointDao.updateById(entity);
a6de49 492         });
H 493     }
494 }