From 85b2001c0ec2f1adc598db3bf47ad457dcca7074 Mon Sep 17 00:00:00 2001 From: dengzedong <dengzedong@email> Date: 星期四, 19 十二月 2024 16:37:53 +0800 Subject: [PATCH] item-chart 空point校验 --- iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/point/service/impl/DaPointServiceImpl.java | 16 +++++++++++----- 1 files changed, 11 insertions(+), 5 deletions(-) diff --git a/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/point/service/impl/DaPointServiceImpl.java b/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/point/service/impl/DaPointServiceImpl.java index 7898476..b9742f0 100644 --- a/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/point/service/impl/DaPointServiceImpl.java +++ b/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/point/service/impl/DaPointServiceImpl.java @@ -9,6 +9,7 @@ import com.iailab.framework.common.pojo.PageResult; import com.iailab.framework.common.util.object.BeanUtils; import com.iailab.framework.common.util.object.ConvertUtils; +import com.iailab.module.data.api.point.dto.ApiPointDTO; import com.iailab.module.data.channel.common.service.ChannelSourceService; import com.iailab.module.data.common.enums.CommonConstant; import com.iailab.module.data.common.enums.IsEnableEnum; @@ -64,7 +65,10 @@ @Resource private ChannelSourceService channelSourceService; - private static Map<String, DaPointDTO> pointIdMap = new ConcurrentHashMap<>(); + @Resource + private DaPointCollectStatusService daPointCollectStatusService; + + private static Map<String, ApiPointDTO> pointIdMap = new ConcurrentHashMap<>(); private static Map<String, DaPointDTO> pointNoMap = new ConcurrentHashMap<>(); @@ -109,21 +113,21 @@ } @Override - public DaPointDTO getSimpleInfoById(String id) { + public ApiPointDTO getSimpleInfoById(String id) { if (pointIdMap.containsKey(id)) { return pointIdMap.get(id); } - DaPointDTO dto = ConvertUtils.sourceToTarget(daPointDao.selectById(id), DaPointDTO.class); + ApiPointDTO dto = ConvertUtils.sourceToTarget(daPointDao.selectById(id), ApiPointDTO.class); if (dto == null) { return null; } pointIdMap.put(id, dto); - return pointIdMap.get(id); + return dto; } @Override public DaPointDTO getSimpleInfoByNo(String no) { - QueryWrapper<DaPointEntity> queryWrapper = new QueryWrapper(); + QueryWrapper<DaPointEntity> queryWrapper = new QueryWrapper<>(); queryWrapper.eq("point_no", no); return ConvertUtils.sourceToTarget(daPointDao.selectOne(queryWrapper), DaPointDTO.class); } @@ -182,6 +186,7 @@ daPointEntity.setCreateTime(new Date()); daPointDao.insert(daPointEntity); + daPointCollectStatusService.add(daPointEntity.getPointNo()); // 清空缓存 clearCache(); } @@ -417,6 +422,7 @@ } daPointDao.insert(daPointEntity); + daPointCollectStatusService.add(daPointEntity.getPointNo()); respVO.getCreatePointnames().add(importPoint.getPointName()); return; } -- Gitblit v1.9.3