From a477ef0bdb41b5caaf9bf624ac264e55cc60e28b Mon Sep 17 00:00:00 2001 From: 潘志宝 <979469083@qq.com> Date: 星期三, 18 九月 2024 08:30:31 +0800 Subject: [PATCH] data tag 配置 --- iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/opcua/service/impl/ChannelOPCUATagServiceImpl.java | 74 +++++++------------------------------ 1 files changed, 14 insertions(+), 60 deletions(-) diff --git a/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/opcua/service/impl/ChannelOPCUATagServiceImpl.java b/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/opcua/service/impl/ChannelOPCUATagServiceImpl.java index f8ba635..0e0f9f0 100644 --- a/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/opcua/service/impl/ChannelOPCUATagServiceImpl.java +++ b/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/opcua/service/impl/ChannelOPCUATagServiceImpl.java @@ -1,17 +1,15 @@ package com.iailab.module.data.channel.opcua.service.impl; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; -import com.baomidou.mybatisplus.core.toolkit.StringUtils; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.iailab.framework.common.pojo.PageResult; import com.iailab.framework.common.util.object.ConvertUtils; -import com.iailab.module.data.common.utils.PageUtils; -import com.iailab.module.data.common.utils.Query; import com.iailab.module.data.channel.opcua.dao.ChannelOPCUATagDao; import com.iailab.module.data.channel.opcua.dto.ChannelOPCUATagDTO; import com.iailab.module.data.channel.opcua.entity.ChannelOPCUATagEntity; import com.iailab.module.data.channel.opcua.service.ChannelOPCUATagService; +import com.iailab.module.data.channel.opcua.vo.OpcUaTagPageReqVO; import lombok.extern.slf4j.Slf4j; import org.apache.poi.ss.usermodel.CellType; import org.apache.poi.xssf.usermodel.XSSFRow; @@ -27,13 +25,12 @@ import java.io.FileInputStream; import java.util.ArrayList; import java.util.List; -import java.util.Map; import java.util.UUID; /** - * @author DongYukun + * @author lirm * @Description - * @createTime 2023年05月08日 15:04:00 + * @createTime 2024年08月26日 */ @Slf4j @Service @@ -44,77 +41,41 @@ @Value("${iems.upload-dir}") private String uploadDir; - /** - * 分页查询tag - * - * @param params - */ @Override - public PageUtils queryPage(Map<String, Object> params) { - String tagName = (String) params.get("tagName"); - String device = (String) params.get("device"); - - IPage<ChannelOPCUATagEntity> page = this.page( - new Query<ChannelOPCUATagEntity>().getPage(params), - new QueryWrapper<ChannelOPCUATagEntity>() - .like(StringUtils.isNotBlank(tagName), "tag_name", tagName) - .eq(StringUtils.isNotBlank(device), "device", device) - .orderByDesc("create_time") - ); - return new PageUtils(page); + public PageResult<ChannelOPCUATagEntity> queryPage(OpcUaTagPageReqVO reqVO) { + return channelOPCUATagDao.selectPage(reqVO); } - /** - * 查询tag详情 - * - * @param id - */ @Override public ChannelOPCUATagEntity info(String id) { return channelOPCUATagDao.selectById(id); } @Override - public List<ChannelOPCUATagEntity> getByDevice(String device) { - QueryWrapper<ChannelOPCUATagEntity> queryWrapper = new QueryWrapper<>(); - queryWrapper.eq("device", device).orderByDesc ("create_time"); - return channelOPCUATagDao.selectList(queryWrapper); - - } - - /** - * 添加tag - * - * @param channelOPCUATagEntity - */ - @Override public void add(ChannelOPCUATagEntity channelOPCUATagEntity) { channelOPCUATagDao.insert(channelOPCUATagEntity); } - /** - * 修改tag - * - * @param channelOPCUATagEntity - */ @Override public void update(ChannelOPCUATagEntity channelOPCUATagEntity) { channelOPCUATagDao.updateById(channelOPCUATagEntity); } - /** - * 删除tag - * - * @param id - */ @Override public void delete(String id) { channelOPCUATagDao.deleteById(id); } + + @Override + public List<ChannelOPCUATagEntity> getByDevice(String device) { + QueryWrapper<ChannelOPCUATagEntity> queryWrapper = new QueryWrapper<>(); + queryWrapper.eq("device", device).orderByDesc ("create_time"); + return channelOPCUATagDao.selectList(queryWrapper); + } + @Override public List<ChannelOPCUATagDTO> selectAll() { - List<ChannelOPCUATagEntity> entityList = baseMapper.selectList( null ); @@ -131,13 +92,6 @@ baseMapper.delete(new QueryWrapper<ChannelOPCUATagEntity>().eq("device",name)); } - /** - * 导入Tag - * - * @param device - * @param file - * @throws Exception - */ @Override @Transactional(rollbackFor = Exception.class) public void importTag(String device, MultipartFile file) throws Exception { -- Gitblit v1.9.3