From df99e46312fdd5ee830f1451e478f6658e09f9ed Mon Sep 17 00:00:00 2001 From: 潘志宝 <979469083@qq.com> Date: 星期一, 16 十二月 2024 13:41:41 +0800 Subject: [PATCH] 导出测点数据 修改 --- iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/point/service/impl/DaPointServiceImpl.java | 46 +++++++++++++++++++++++++++++++++++++--------- 1 files changed, 37 insertions(+), 9 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 c5b0f3d..53c8b35 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 @@ -64,6 +64,9 @@ @Resource private ChannelSourceService channelSourceService; + @Resource + private DaPointCollectStatusService daPointCollectStatusService; + private static Map<String, DaPointDTO> pointIdMap = new ConcurrentHashMap<>(); private static Map<String, DaPointDTO> pointNoMap = new ConcurrentHashMap<>(); @@ -123,8 +126,8 @@ @Override public DaPointDTO getSimpleInfoByNo(String no) { - QueryWrapper<DaPointEntity> queryWrapper = new QueryWrapper(); - queryWrapper.eq("pointNo", no); + QueryWrapper<DaPointEntity> queryWrapper = new QueryWrapper<>(); + queryWrapper.eq("point_no", no); return ConvertUtils.sourceToTarget(daPointDao.selectOne(queryWrapper), DaPointDTO.class); } @@ -182,6 +185,7 @@ daPointEntity.setCreateTime(new Date()); daPointDao.insert(daPointEntity); + daPointCollectStatusService.add(daPointEntity.getPointNo()); // 清空缓存 clearCache(); } @@ -215,10 +219,11 @@ @Override @DSTransactional(rollbackFor = Exception.class) - public void delete(String[] id) { - daPointDao.deleteBatchIds(Arrays.asList(id)); - daMeasurePointService.deleteByPoint(id); - daMathPointService.deleteByPoint(id); + public void delete(String[] ids) { + daPointDao.deleteBatchIds(Arrays.asList(ids)); + daMeasurePointService.deleteByPoint(ids); + daMathPointService.deleteByPoint(ids); + daCumulatePointService.deleteByPoint(ids); // 清空缓存 clearCache(); } @@ -318,6 +323,24 @@ } @Override + public List<DaPointDTO> getCumulatePoint(String freq) { + Map<String, Object> params = new HashMap<>(3); + params.put("pointType", PointTypeEnum.CUMULATE.getCode()); + params.put("isEnable", CommonConstant.IS_ENABLE); + params.put("minfreqid", freq); + return daPointDao.getCumulatePoint(params); + } + + @Override + public List<DaPointDTO> getCumulatePoint(DaPointPageReqVO reqVO) { + Map<String, Object> params = new HashMap<>(3); + params.put("pointType", PointTypeEnum.CUMULATE.getCode()); + params.put("pointNo", reqVO.getPointNo()); + params.put("pointName", reqVO.getPointName()); + return daPointDao.getCumulatePoint(params); + } + + @Override public DaPointDTO getByNo(String pointNo) { if (pointNoMap.containsKey(pointNo)) { return pointNoMap.get(pointNo); @@ -386,11 +409,19 @@ case CONSTANT: daPointEntity.setPointNo(daSequenceNumService.getAndIncreaseByCode(IncreaseCodeEnum.POINT_F.name())); break; + case CUMULATE: + DaCumulatePointDTO cumulatePoint = new DaCumulatePointDTO(); + cumulatePoint.setMomentPoint(importPoint.getMomentPoint()); + cumulatePoint.setLength(importPoint.getLength()); + cumulatePoint.setDivisor(importPoint.getDivisor()); + daCumulatePointService.add(cumulatePoint, daPointEntity.getId()); + daPointEntity.setPointNo(daSequenceNumService.getAndIncreaseByCode(IncreaseCodeEnum.POINT_L.name())); default: break; } daPointDao.insert(daPointEntity); + daPointCollectStatusService.add(daPointEntity.getPointNo()); respVO.getCreatePointnames().add(importPoint.getPointName()); return; } @@ -409,9 +440,6 @@ measurePoint.setSourceId(sourcesIdMap.get(importPoint.getSourceType()).get(importPoint.getSourceName())); measurePoint.setTagNo(importPoint.getTagNo()); daMeasurePointService.update(measurePoint, new QueryWrapper<DaMeasurePointEntity>().eq("point_id",updatePoint.getId())); - - - respVO.getUpdatePointnames().add(importPoint.getPointName()); }); return respVO; -- Gitblit v1.9.3