liriming
2024-09-23 1f6ff03df42388413846fb4b2571d6b010ef3306
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/tag/controller/TagController.java
@@ -1,8 +1,9 @@
package com.iailab.module.data.channel.tag.controller;
import com.iailab.module.data.channel.kio.entity.ChannelKioDeviceEntity;
import com.iailab.module.data.channel.kio.entity.ChannelKioTagEntity;
import com.iailab.module.data.common.enums.DataSourceType;
import com.iailab.framework.common.pojo.CommonResult;
import com.iailab.module.data.channel.kio.dto.ChannelKioDeviceDTO;
import com.iailab.module.data.channel.kio.service.ChannelKioDeviceService;
import com.iailab.module.data.channel.kio.service.ChannelKioTagService;
import com.iailab.module.data.channel.modbus.entity.ChannelModBusDeviceEntity;
@@ -13,12 +14,11 @@
import com.iailab.module.data.channel.opcua.service.ChannelOPCUADeviceService;
import com.iailab.module.data.channel.opcua.service.ChannelOPCUATagService;
import com.iailab.module.data.channel.tag.dto.TagOptionDTO;
import com.iailab.module.data.http.entity.HttpApiEntity;
import com.iailab.module.data.http.entity.HttpTagEntity;
import com.iailab.module.data.http.service.HttpApiService;
import com.iailab.module.data.channel.kio.dto.ChannelKioTagDTO;
import com.iailab.module.data.channel.http.entity.HttpApiEntity;
import com.iailab.module.data.channel.http.entity.HttpTagEntity;
import com.iailab.module.data.channel.http.service.HttpApiService;
import com.iailab.module.data.channel.opcua.entity.ChannelOPCUATagEntity;
import com.iailab.module.data.http.service.HttpTagService;
import com.iailab.module.data.channel.http.service.HttpTagService;
import javax.annotation.Resource;
import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.GetMapping;
@@ -121,14 +121,14 @@
        TagOptionDTO kioData = new TagOptionDTO();
        kioData.setValue(DataSourceType.KIO.getCode());
        kioData.setLabel(DataSourceType.KIO.getDesc());
        List<ChannelKioDeviceDTO> kioList = channelKioDeviceService.list(new HashMap<>());
        List<ChannelKioDeviceEntity> kioList = channelKioDeviceService.list(new HashMap<>());
        List<TagOptionDTO> kioDeviceOp = new ArrayList<>();
        if (!CollectionUtils.isEmpty(kioList)) {
            kioList.forEach(item -> {
                TagOptionDTO op1 = new TagOptionDTO();
                op1.setValue(item.getId());
                op1.setLabel(item.getInstanceName());
                List<ChannelKioTagDTO> tags = channelKioTagService.getByDevice(item.getInstanceName());
                List<ChannelKioTagEntity> tags = channelKioTagService.getByDevice(item.getInstanceName());
                List<TagOptionDTO> op2 = new ArrayList<>();
                tags.forEach(item1 -> {
                    TagOptionDTO op3 = new TagOptionDTO();
@@ -157,8 +157,8 @@
                List<TagOptionDTO> op2 = new ArrayList<>();
                tags.forEach(item1 -> {
                    TagOptionDTO op3 = new TagOptionDTO();
                    op3.setValue(item1.getTagCode());
                    op3.setLabel(item1.getTagCode());
                    op3.setValue(item1.getTagName());
                    op3.setLabel(item1.getTagName());
                    op2.add(op3);
                });
                op1.setChildren(op2);