潘志宝
2024-08-20 9d7e020fb49c52068aba885fd84836490f7e31d5
data
已添加22个文件
已重命名2个文件
已删除60个文件
已修改9个文件
5547 ■■■■ 文件已修改
iailab-module-data/iailab-module-data-api/src/main/java/com/iailab/module/data/api/IFeignDataApi.java 63 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-api/src/main/java/com/iailab/module/data/api/ind/IndItemApi.java 28 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-api/src/main/java/com/iailab/module/data/api/ind/dto/ApiIndItemQueryDTO.java 35 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-api/src/main/java/com/iailab/module/data/api/ind/dto/ApiIndItemValueDTO.java 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-api/src/main/java/com/iailab/module/data/api/point/DataPointApi.java 48 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-api/src/main/java/com/iailab/module/data/api/point/dto/ApiPointDTO.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-api/src/main/java/com/iailab/module/data/api/point/dto/ApiPointValueDTO.java 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-api/src/main/java/com/iailab/module/data/api/point/dto/ApiPointValueQueryDTO.java 37 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-api/src/main/java/com/iailab/module/data/api/point/dto/ApiPointValueWriteDTO.java 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-api/src/main/java/com/iailab/module/data/api/point/dto/ApiPointsValueQueryDTO.java 36 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-api/src/main/java/com/iailab/module/data/dto/AlarmTaskDto.java 58 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-api/src/main/java/com/iailab/module/data/dto/ApiDataDTO.java 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-api/src/main/java/com/iailab/module/data/dto/ApiIndValueDTO.java 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-api/src/main/java/com/iailab/module/data/dto/ApiPointValueQueryDTO.java 32 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-api/src/main/java/com/iailab/module/data/dto/FeignFileQueryDto.java 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-api/src/main/java/com/iailab/module/data/dto/FeignFileSaveDto.java 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-api/src/main/java/com/iailab/module/data/dto/FeignFixDetDTO.java 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-api/src/main/java/com/iailab/module/data/dto/FeignHttpApiDTO.java 32 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-api/src/main/java/com/iailab/module/data/dto/FeignOrderTaskDTO.java 140 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-api/src/main/java/com/iailab/module/data/dto/FeignQueryPointDTO.java 37 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-api/src/main/java/com/iailab/module/data/dto/FeignResultDTO.java 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-api/src/main/java/com/iailab/module/data/dto/FileDto.java 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-api/src/main/java/com/iailab/module/package-info.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-biz/pom.xml 80 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/api/controller/DataController.java 42 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/opcda/collector/OpcDACollector.java 115 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/opcda/collector/OpcDAUtils.java 115 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/opcda/controller/ChannelOPCDADeviceController.java 86 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/opcda/controller/ChannelOPCDATagController.java 102 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/opcda/dao/ChannelOPCDADeviceDao.java 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/opcda/dao/ChannelOPCDATagDao.java 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/opcda/dto/ChannelOPCDADeviceDTO.java 46 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/opcda/dto/ChannelOPCDATagDTO.java 43 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/opcda/dto/WriteDTO.java 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/opcda/entity/ChannelOPCDADeviceEntity.java 67 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/opcda/entity/ChannelOPCDATagEntity.java 62 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/opcda/service/ChannelOPCDADeviceService.java 60 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/opcda/service/ChannelOPCDATagService.java 70 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/opcda/service/impl/ChannelOPCDADeviceServiceImpl.java 115 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/opcda/service/impl/ChannelOPCDATagServiceImpl.java 187 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/opcua/dto/ChannelOPCUADeviceDTO.java 53 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/opcua/entity/ChannelOPCUATagEntity.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/feign/FeignDataImpl.java 192 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/framework/filter/MyFilter.java 31 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/framework/filter/MyHttpServletRequestWrapper.java 74 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/framework/filter/RequestReadUtils.java 27 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/framework/filter/RewriteRequestFilter.java 30 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/framework/interceptor/CommonData.java 47 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/framework/interceptor/WebMvcConfig.java 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/framework/package-info.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/framework/rpc/config/RpcConfiguration.java 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/framework/rpc/package-info.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/framework/security/config/SecurityConfiguration.java 48 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/framework/security/core/package-info.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/http/collector/HttpCollectorForSD.java 187 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/http/collector/HttpCollectorForUser.java 85 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/http/dao/EleLowTagDao.java 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/http/dao/FxjyTagDao.java 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/http/dao/HttpApiDao.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/http/dao/XSTTagDao.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/http/dto/TokenJsonDto.java 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/http/service/HttpTagService.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/http/service/impl/FxjyTagServiceImpl.java 238 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/http/service/impl/HttpTagCollector.java 44 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/http/service/impl/HttpTagServiceImpl.java 216 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/indexdata/common/ClockSuffix.java 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/indexdata/common/IndexDataBc.java 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/indexdata/common/IndexDataConstant.java 79 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/indexdata/common/IndexDataUtils.java 768 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/indexdata/controller/admin/IndexDataClockController.java 109 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/indexdata/controller/admin/IndexDataItemController.java 93 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/indexdata/controller/admin/IndexDataValueController.java 34 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/indexdata/controller/package-info.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/indexdata/dao/IndexDataClockDao.java 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/indexdata/dao/IndexDataItemDao.java 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/indexdata/dao/IndexDataValueDao.java 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/indexdata/entity/IndexDataClockEntity.java 85 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/indexdata/entity/IndexDataItemEntity.java 184 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/indexdata/entity/IndexDataValueEntity.java 121 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/indexdata/service/IndexDataClockService.java 31 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/indexdata/service/IndexDataItemService.java 31 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/indexdata/service/IndexDataValueService.java 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/indexdata/service/impl/IndexDataClockServiceImpl.java 87 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/indexdata/service/impl/IndexDataItemServiceImpl.java 86 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/indexdata/service/impl/IndexDataValueServiceImpl.java 55 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/job/init/JobCommandLineRunner.java 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/job/task/HttpCollectDeviceTask.java 42 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/job/task/HttpCollectHealthStateTask.java 47 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/job/task/HttpCollectRunStateTask.java 47 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/job/task/HttpCollectTemperatureTask.java 47 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/job/task/HttpCollectUserTask.java 46 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/job/task/HttpTokenTask.java 40 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/point/collection/handler/MeasureHandle.java 61 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-api/src/main/java/com/iailab/module/data/api/IFeignDataApi.java
文件已删除
iailab-module-data/iailab-module-data-api/src/main/java/com/iailab/module/data/api/ind/IndItemApi.java
对比新文件
@@ -0,0 +1,28 @@
package com.iailab.module.data.api.ind;
import com.iailab.module.data.api.ind.dto.ApiIndItemQueryDTO;
import com.iailab.module.data.api.ind.dto.ApiIndItemValueDTO;
import com.iailab.module.data.enums.ApiConstants;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import java.util.List;
/**
 * @author PanZhibao
 * @Description
 * @createTime 2024年08月19日
 */
@FeignClient(name = ApiConstants.NAME)
@Tag(name = "指标项服务")
public interface IndItemApi {
    String PREFIX = ApiConstants.PREFIX + "/ind-item";
    @PostMapping(PREFIX + "/vlues")
    @Operation(summary = "查询指标项")
    List<ApiIndItemValueDTO> queryIndItemValues(@RequestBody ApiIndItemQueryDTO dto);
}
iailab-module-data/iailab-module-data-api/src/main/java/com/iailab/module/data/api/ind/dto/ApiIndItemQueryDTO.java
对比新文件
@@ -0,0 +1,35 @@
package com.iailab.module.data.api.ind.dto;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.Data;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Date;
/**
 * @author PanZhibao
 * @Description
 * @createTime 2024年08月19日
 */
@Data
@Tag(name = "指标项值查询")
public class ApiIndItemQueryDTO implements Serializable {
    private static final long serialVersionUID = 1L;
    @Schema(description = "itemNo")
    @NotNull(message="itemNo不能为空")
    private String itemNo;
    @Schema(description = "开始时间")
    @NotNull(message="start不能为空")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date start;
    @Schema(description = "结束时间")
    @NotNull(message="end不能为空")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date end;
}
iailab-module-data/iailab-module-data-api/src/main/java/com/iailab/module/data/api/ind/dto/ApiIndItemValueDTO.java
对比新文件
@@ -0,0 +1,22 @@
package com.iailab.module.data.api.ind.dto;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
 * @author PanZhibao
 * @Description
 * @createTime 2024年08月19日
 */
@Data
@Tag(name = "指标项值结果")
public class ApiIndItemValueDTO implements Serializable {
    private static final long serialVersionUID = 1L;
    private String dataTime;
    private double dataValue;
}
iailab-module-data/iailab-module-data-api/src/main/java/com/iailab/module/data/api/point/DataPointApi.java
对比新文件
@@ -0,0 +1,48 @@
package com.iailab.module.data.api.point;
import com.iailab.module.data.api.point.dto.*;
import com.iailab.module.data.enums.ApiConstants;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import java.util.List;
import java.util.Map;
/**
 * @author PanZhibao
 * @Description
 * @createTime 2024年08月19日
 */
@FeignClient(name = ApiConstants.NAME)
@Tag(name = "数据测点服务")
public interface DataPointApi {
    String PREFIX = ApiConstants.PREFIX + "/point";
    @PostMapping(PREFIX + "/point/{pointNo}")
    @Operation(summary = "查询测点信息")
    ApiPointDTO getPoint(@PathVariable("pointNo") String pointNo);
    @PostMapping(PREFIX + "/current")
    @Operation(summary = "查询多个测点当前值")
    Map<String, Object> pointsCurrent(@RequestParam("pointNos") List<String> pointNos);
    @PostMapping(PREFIX + "/history")
    @Operation(summary = "查询多个测点历史值")
    Map<String, List<Map<String, Object>>> pointsHistory(@RequestBody ApiPointsValueQueryDTO queryDto);
    @PostMapping(PREFIX + "/value/get")
    @Operation(summary = "查询单个测点历史值")
    List<ApiPointValueDTO> getValue(@RequestBody ApiPointValueQueryDTO queryDto);
    @PostMapping(PREFIX + "/value/set")
    @Operation(summary = "设置单个测点值")
    Boolean setValue(@RequestBody ApiPointValueWriteDTO queryDto);
}
iailab-module-data/iailab-module-data-api/src/main/java/com/iailab/module/data/api/point/dto/ApiPointDTO.java
文件名从 iailab-module-data/iailab-module-data-api/src/main/java/com/iailab/module/data/dto/ApiDataPointDTO.java 修改
@@ -1,4 +1,4 @@
package com.iailab.module.data.dto;
package com.iailab.module.data.api.point.dto;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
@@ -12,7 +12,7 @@
 */
@Data
@Schema(description = "测点")
public class ApiDataPointDTO implements Serializable {
public class ApiPointDTO implements Serializable {
    private static final long serialVersionUID = 1L;
    @Schema(description = "测点编码", required = true)
iailab-module-data/iailab-module-data-api/src/main/java/com/iailab/module/data/api/point/dto/ApiPointValueDTO.java
对比新文件
@@ -0,0 +1,20 @@
package com.iailab.module.data.api.point.dto;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
 * @author PanZhibao
 * @Description
 * @createTime 2024年08月19日
 */
@Data
public class ApiPointValueDTO implements Serializable {
    private static final long serialVersionUID = 1L;
    private Date dataTime;
    private double dataValue;
}
iailab-module-data/iailab-module-data-api/src/main/java/com/iailab/module/data/api/point/dto/ApiPointValueQueryDTO.java
对比新文件
@@ -0,0 +1,37 @@
package com.iailab.module.data.api.point.dto;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.Data;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
/**
 * @author PanZhibao
 * @Description
 * @createTime 2024年08月19日
 */
@Data
@Tag(name = "测点值查询")
public class ApiPointValueQueryDTO implements Serializable {
    private static final long serialVersionUID = 1L;
    @Schema(description = "pointNos")
    @NotNull(message="pointNo不能为空")
    private String pointNo;
    @Schema(description = "开始时间")
    @NotNull(message="start不能为空")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date start;
    @Schema(description = "结束时间")
    @NotNull(message="end不能为空")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date end;
}
iailab-module-data/iailab-module-data-api/src/main/java/com/iailab/module/data/api/point/dto/ApiPointValueWriteDTO.java
文件名从 iailab-module-data/iailab-module-data-api/src/main/java/com/iailab/module/data/dto/FeignWritePointValueDTO.java 修改
@@ -1,4 +1,4 @@
package com.iailab.module.data.dto;
package com.iailab.module.data.api.point.dto;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
@@ -9,15 +9,15 @@
/**
 * @author PanZhibao
 * @Description
 * @createTime 2024年06月05日
 * @createTime 2024年08月19日
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Schema(description = "写入测点值")
public class FeignWritePointValueDTO implements Serializable {
public class ApiPointValueWriteDTO implements Serializable {
    @Schema(description = "测点编号")
    private String pointCode;
    private String pointNo;
    @Schema(description = "测点值")
    private Object pointValue;
iailab-module-data/iailab-module-data-api/src/main/java/com/iailab/module/data/api/point/dto/ApiPointsValueQueryDTO.java
对比新文件
@@ -0,0 +1,36 @@
package com.iailab.module.data.api.point.dto;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.Data;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
/**
 * @author PanZhibao
 * @Description
 * @createTime 2024年08月19日
 */
@Data
@Tag(name = "测点值查询")
public class ApiPointsValueQueryDTO implements Serializable {
    private static final long serialVersionUID = 1L;
    @Schema(description = "pointNos")
    @NotNull(message="pointNos不能为空")
    private List<String> pointNos;
    @Schema(description = "开始时间")
    @NotNull(message="start不能为空")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date start;
    @Schema(description = "结束时间")
    @NotNull(message="end不能为空")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date end;
}
iailab-module-data/iailab-module-data-api/src/main/java/com/iailab/module/data/dto/AlarmTaskDto.java
文件已删除
iailab-module-data/iailab-module-data-api/src/main/java/com/iailab/module/data/dto/ApiDataDTO.java
文件已删除
iailab-module-data/iailab-module-data-api/src/main/java/com/iailab/module/data/dto/ApiIndValueDTO.java
文件已删除
iailab-module-data/iailab-module-data-api/src/main/java/com/iailab/module/data/dto/ApiPointValueQueryDTO.java
文件已删除
iailab-module-data/iailab-module-data-api/src/main/java/com/iailab/module/data/dto/FeignFileQueryDto.java
文件已删除
iailab-module-data/iailab-module-data-api/src/main/java/com/iailab/module/data/dto/FeignFileSaveDto.java
文件已删除
iailab-module-data/iailab-module-data-api/src/main/java/com/iailab/module/data/dto/FeignFixDetDTO.java
文件已删除
iailab-module-data/iailab-module-data-api/src/main/java/com/iailab/module/data/dto/FeignHttpApiDTO.java
文件已删除
iailab-module-data/iailab-module-data-api/src/main/java/com/iailab/module/data/dto/FeignOrderTaskDTO.java
文件已删除
iailab-module-data/iailab-module-data-api/src/main/java/com/iailab/module/data/dto/FeignQueryPointDTO.java
文件已删除
iailab-module-data/iailab-module-data-api/src/main/java/com/iailab/module/data/dto/FeignResultDTO.java
文件已删除
iailab-module-data/iailab-module-data-api/src/main/java/com/iailab/module/data/dto/FileDto.java
文件已删除
iailab-module-data/iailab-module-data-api/src/main/java/com/iailab/module/package-info.java
文件已删除
iailab-module-data/iailab-module-data-biz/pom.xml
@@ -95,35 +95,38 @@
            <artifactId>quartz</artifactId>
            <version>2.3.2</version>
        </dependency>
<!--        <dependency>-->
<!--            <groupId>cn.afterturn</groupId>-->
<!--            <artifactId>easypoi-base</artifactId>-->
<!--            <version>${easypoi.version}</version>-->
<!--        </dependency>-->
<!--        <dependency>-->
<!--            <groupId>cn.afterturn</groupId>-->
<!--            <artifactId>easypoi-web</artifactId>-->
<!--            <version>${easypoi.version}</version>-->
<!--        </dependency>-->
<!--        <dependency>-->
<!--            <groupId>cn.afterturn</groupId>-->
<!--            <artifactId>easypoi-annotation</artifactId>-->
<!--            <version>${easypoi.version}</version>-->
<!--        </dependency>-->
        <!-- 引用POI -->
<!--        <dependency>-->
<!--            <groupId>org.apache.poi</groupId>-->
<!--            <artifactId>poi</artifactId>-->
<!--            <version>4.1.1</version>-->
<!--        </dependency>-->
<!--        <dependency>-->
<!--            <groupId>org.jetbrains</groupId>-->
<!--            <artifactId>annotations</artifactId>-->
<!--            <version>17.0.0</version>-->
<!--            <scope>compile</scope>-->
<!--        </dependency>-->
        <!-- OPC DA -->
        <dependency>
            <groupId>org.openscada.external</groupId>
            <artifactId>org.openscada.external.jcifs</artifactId>
            <version>1.2.25</version>
        </dependency>
        <dependency>
            <groupId>org.openscada.jinterop</groupId>
            <artifactId>org.openscada.jinterop.core</artifactId>
            <version>2.1.8</version>
        </dependency>
        <dependency>
            <groupId>org.openscada.jinterop</groupId>
            <artifactId>org.openscada.jinterop.deps</artifactId>
            <version>1.5.0</version>
        </dependency>
        <dependency>
            <groupId>org.openscada.utgard</groupId>
            <artifactId>org.openscada.opc.dcom</artifactId>
            <version>1.5.0</version>
        </dependency>
        <dependency>
            <groupId>org.openscada.utgard</groupId>
            <artifactId>org.openscada.opc.lib</artifactId>
            <version>1.5.0</version>
        </dependency>
        <dependency>
            <groupId>org.bouncycastle</groupId>
            <artifactId>bcprov-jdk15on</artifactId>
            <version>1.61</version>
        </dependency>
        <!-- ModBus TCP -->
        <dependency>
@@ -162,12 +165,6 @@
            <scope>test</scope>
        </dependency>
<!--        &lt;!&ndash; websocket &ndash;&gt;-->
<!--        <dependency>-->
<!--            <groupId>org.springframework.boot</groupId>-->
<!--            <artifactId>spring-boot-starter-websocket</artifactId>-->
<!--        </dependency>-->
    </dependencies>
    <build>
@@ -180,21 +177,6 @@
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.1</version>
            </plugin>
            <!--            <plugin>-->
<!--                <groupId>org.springframework.boot</groupId>-->
<!--                <artifactId>spring-boot-maven-plugin</artifactId>-->
<!--                <version>${spring.boot.version}</version>-->
<!--                <executions>-->
<!--                    <execution>-->
<!--                        <goals>-->
<!--                            <goal>repackage</goal> &lt;!&ndash; 将引入的 jar 打入其中 &ndash;&gt;-->
<!--                        </goals>-->
<!--                    </execution>-->
<!--                </executions>-->
<!--            </plugin>-->
        </plugins>
    </build>
</project>
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/api/controller/DataController.java
@@ -1,6 +1,5 @@
package com.iailab.module.data.api.controller;
import com.iailab.api.IFeignModelApi;
import com.iailab.framework.common.pojo.CommonResult;
import com.iailab.framework.common.util.date.DateUtils;
import com.iailab.module.data.common.dto.IndexQueryDTO;
@@ -60,9 +59,6 @@
    @Resource
    private IndItemCollector indItemCollector;
    @Resource
    private IFeignModelApi feignModelApi;
    @PostMapping("/point/history")
    @Operation(summary = "point历史数据")
@@ -238,44 +234,6 @@
            });
            return R.ok().put("data", data);
        } catch (Exception ex) {
            return R.error(ex.getMessage());
        }
    }
    @PostMapping("/ind-item/values-trend")
    @Operation(summary = "point当前实时数据")
    public R indItemValuesTrend(HttpServletResponse response, HttpServletRequest
            request, @RequestBody List<String> itemNos) {
        try {
            apiSecurityUtils.validate(request);
            Map<String, Object> CommonResult = new HashMap<>();
            Map<String, List<IndItemValueDTO>> values = indItemCollector.getValueList(itemNos);
            CommonResult.put("values", values);
            Map<String, Map<String, Object>> trend = new HashMap<>();
            Map<String, Object> params = new HashMap<>(1);
            params.put("modelCode", "trend_analysis");
            values.forEach((k, v) -> {
                try {
                    List<double[][]> sampleDataList = new ArrayList<>();
                    List<IndItemValueDTO> nv = v.stream().filter(dto -> {
                        return dto.getDataValue() != null;
                    }).collect(Collectors.toList());
                    double[][] mix = new double[nv.size()][1];
                    for (int i = 0; i < nv.size(); i++) {
                        mix[i][0] = nv.get(i).getDataValue().doubleValue();
                    }
                    sampleDataList.add(mix);
                    Map<String, Object> trendItem = feignModelApi.runModel(params, sampleDataList);
                    trend.put(k, trendItem);
                } catch (Exception ex) {
                    ex.printStackTrace();
                }
            });
            CommonResult.put("trend", trend);
            return R.ok().put("data", CommonResult);
        } catch (Exception ex) {
            ex.printStackTrace();
            return R.error(ex.getMessage());
        }
    }
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/opcda/collector/OpcDACollector.java
对比新文件
@@ -0,0 +1,115 @@
package com.iailab.module.data.channel.opcda.collector;
import com.iailab.module.data.channel.opcda.entity.ChannelOPCDADeviceEntity;
import com.iailab.module.data.channel.opcda.service.ChannelOPCDADeviceService;
import com.iailab.module.data.common.enums.CommonConstant;
import com.iailab.module.data.common.enums.DataSourceType;
import com.iailab.module.data.common.utils.TagUtils;
import lombok.extern.slf4j.Slf4j;
import org.jinterop.dcom.common.JIException;
import org.jinterop.dcom.core.JIVariant;
import org.openscada.opc.lib.da.Group;
import org.openscada.opc.lib.da.Item;
import org.openscada.opc.lib.da.ItemState;
import org.openscada.opc.lib.da.Server;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.util.CollectionUtils;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.stream.Collectors;
@Slf4j
@Component
public class OpcDACollector {
    @Autowired
    private OpcDAUtils opcDAUtils;
    @Autowired
    private ChannelOPCDADeviceService channelOPCDADeviceService;
    private Map<String, Server> serverMap = new ConcurrentHashMap<>();
    private Map<String, Group> groupMap = new ConcurrentHashMap<>();
    private Map<String, ChannelOPCDADeviceEntity> deviceMap = new HashMap<>();
    private Server getServer(String sourceId) throws Exception {
        try {
            if (!serverMap.containsKey(sourceId)) {
                log.info("根据数据源获取opcDAServer,sourceId=" + sourceId);
                ChannelOPCDADeviceEntity OPCDADevice = channelOPCDADeviceService.info(sourceId);
                deviceMap.put(sourceId, OPCDADevice);
                Server server = opcDAUtils.createServer(OPCDADevice);
                if (server != null) {
                    serverMap.put(sourceId, server);
                }
            }
        } catch (Exception ex) {
            log.info("=========getOPCDAServer Exception============");
            log.info("ex.message+" + ex.getMessage());
            ex.printStackTrace();
            throw new Exception(ex.getMessage());
        }
        return serverMap.get(sourceId);
    }
    public Map<String, Object> getTagValues(List<String[]> tags) {
        if (CollectionUtils.isEmpty(tags)) {
            return new HashMap<>();
        }
        Map<String, Object> result = new HashMap<>(tags.size());
        // 按照sourceId分组
        Map<String, List<String[]>> sourceIdTagMap = tags.stream().collect(Collectors.groupingBy(t -> t[0]));
        for (Map.Entry<String, List<String[]>> entry : sourceIdTagMap.entrySet()) {
            try {
                Server server = this.getServer(entry.getKey());
                Group group = this.getGroup(server, entry.getKey());
                Map<Item, ItemState> read = OpcDAUtils.readA(group, entry.getValue());
                for (Map.Entry<Item, ItemState> itemStateEntry : read.entrySet()) {
                    try {
                        result.put(TagUtils.genTagId(DataSourceType.OPCDA.getCode(), deviceMap.get(entry.getKey()).getServerName(), itemStateEntry.getKey().getId()), OpcDAUtils.getObjectValue(itemStateEntry.getValue()));
                    } catch (JIException e) {
                        result.put(TagUtils.genTagId(DataSourceType.OPCDA.getCode(), deviceMap.get(entry.getKey()).getServerName(), itemStateEntry.getKey().getId()), CommonConstant.BAD_VALUE);
                    }
                }
            } catch (Exception ex) {
                ex.printStackTrace();
                for (String[] tag : entry.getValue()) {
                    result.put(TagUtils.genTagId(DataSourceType.OPCDA.getCode(), deviceMap.get(entry.getKey()).getServerName(), tag[1]), CommonConstant.BAD_VALUE);
                }
            }
        }
        return result;
    }
    private Group getGroup(Server server, String sourceId) throws Exception {
        try {
            if (!groupMap.containsKey(sourceId)) {
                log.info("根据数据源获取opcDAGroup,sourceId=" + sourceId);
                Group group = server.addGroup(sourceId);
                if (group != null) {
                    groupMap.put(sourceId, group);
                }
            }
        } catch (Exception ex) {
            log.info("=========getOPCDAGroup Exception============");
            log.info("ex.message+" + ex.getMessage());
            ex.printStackTrace();
            throw new Exception(ex.getMessage());
        }
        return groupMap.get(sourceId);
    }
    public void write(String serverId) throws Exception {
        Server server = this.getServer(serverId);
        Group group = server.addGroup();
        Item item = group.addItem("通道 1.设备 1.item001");
        OpcDAUtils.write(item, new JIVariant("999"));
    }
}
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/opcda/collector/OpcDAUtils.java
对比新文件
@@ -0,0 +1,115 @@
package com.iailab.module.data.channel.opcda.collector;
import com.iailab.module.data.channel.opcda.dto.WriteDTO;
import com.iailab.module.data.channel.opcda.entity.ChannelOPCDADeviceEntity;
import com.iailab.module.data.channel.opcda.entity.ChannelOPCDATagEntity;
import lombok.extern.slf4j.Slf4j;
import org.jinterop.dcom.common.JIException;
import org.jinterop.dcom.core.JIVariant;
import org.openscada.opc.lib.common.ConnectionInformation;
import org.openscada.opc.lib.da.*;
import org.springframework.stereotype.Component;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.concurrent.Executors;
import java.util.stream.Collectors;
@Slf4j
@Component
public class OpcDAUtils {
    // 上次获取时间
    private static long nextGetTime;
    // 获取间隔时间
    private static long expGetTime = 1000 * 60;
    public synchronized Server createServer(ChannelOPCDADeviceEntity config) {
        if (System.currentTimeMillis() - nextGetTime < expGetTime) {
            throw new RuntimeException("获取OpcUaClient过快");
        }
        nextGetTime = System.currentTimeMillis();
        Server server;
        try {
            ConnectionInformation ci = new ConnectionInformation();
            ci.setHost(config.getHost());
            ci.setUser(config.getUser());
            ci.setPassword(config.getPassword());
            ci.setClsid(config.getClsId());
            ci.setProgId(config.getProgId());
            server = new Server(ci, Executors.newSingleThreadScheduledExecutor());
            server.connect();
            log.info("创建OpcUA客户端完成");
        } catch (Exception e) {
            log.error("创建OpcUA客户端失败", e.getMessage());
            throw new RuntimeException(e.getMessage());
        }
        return server;
    }
    public static Map<Item, ItemState> readA(Group group, List<String[]> tags) throws AddFailedException, JIException {
        List<String> itemIds = tags.stream().map(t -> t[1]).collect(Collectors.toList());
        Map<String, Item> stringItemMap = addItems(group, itemIds);
        List<Item> list = new ArrayList<>(stringItemMap.size());
        for (Map.Entry<String, Item> entry : stringItemMap.entrySet()) {
            list.add(entry.getValue());
        }
        Item[] items = list.toArray(new Item[stringItemMap.size()]);
        return group.read(true, items);
    }
    public static Map<Item, ItemState> read(Group group, List<ChannelOPCDATagEntity> tags) throws AddFailedException, JIException {
        List<String> itemIds = tags.stream().map(ChannelOPCDATagEntity::getItemId).collect(Collectors.toList());
        Map<String, Item> stringItemMap = addItems(group, itemIds);
        List<Item> list = new ArrayList<>(stringItemMap.size());
        for (Map.Entry<String, Item> entry : stringItemMap.entrySet()) {
            list.add(entry.getValue());
        }
        Item[] items = list.toArray(new Item[stringItemMap.size()]);
        return group.read(true, items);
    }
    public static ItemState read(Item item) throws AddFailedException, JIException {
        return item.read(true);
    }
    public static Integer write(Item item,JIVariant value) throws AddFailedException, JIException {
        return item.write(value);
    }
    public static Map<Item, Integer> write(Group group, List<WriteDTO> writeDTOS) throws AddFailedException, JIException {
        WriteRequest[] writeRequests = new WriteRequest[writeDTOS.size()];
        for (int i = 0; i < writeDTOS.size(); i++) {
            WriteDTO writeDTO = writeDTOS.get(i);
            WriteRequest writeRequest = new WriteRequest(writeDTO.getItem(),writeDTO.getValue());
            writeRequests[i] = writeRequest;
        }
        return group.write(writeRequests);
    }
    public static Item addItem(Group group, String itemId) throws AddFailedException, JIException {
        List<String> itemIds = new ArrayList<>(1);
        itemIds.add(itemId);
        Map<String, Item> stringItemMap = addItems(group, itemIds);
        return stringItemMap.get(itemId);
    }
    public static Map<String, Item> addItems(Group group, List<String> itemIds) throws AddFailedException, JIException {
        String[] items = itemIds.toArray(new String[itemIds.size()]);
        return group.addItems(items);
    }
    public static Object getObjectValue(ItemState itemState) throws JIException {
        JIVariant value = itemState.getValue();
        if (value.getType() == JIVariant.VT_UI2 || value.getType() == JIVariant.VT_UI4){
            return value.getObjectAsUnsigned().getValue();
        }else if (value.getType() == JIVariant.VT_I2){
            return value.getObjectAsShort();
        }else {
            return value.getObject();
        }
    }
}
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/opcda/controller/ChannelOPCDADeviceController.java
对比新文件
@@ -0,0 +1,86 @@
package com.iailab.module.data.channel.opcda.controller;
import com.iailab.module.data.channel.opcda.entity.ChannelOPCDADeviceEntity;
import com.iailab.module.data.channel.opcda.service.ChannelOPCDADeviceService;
import com.iailab.module.data.common.utils.PageUtils;
import com.iailab.module.data.common.utils.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.Date;
import java.util.Map;
import java.util.UUID;
/**
 * 操作opc ua配置
 *
 * @author DongYukun
 * @createTime 2023年04月26日 10:33:00
 */
@RestController
@RequestMapping("/channel/opcda/device")
public class ChannelOPCDADeviceController {
    @Autowired
    private ChannelOPCDADeviceService channelOPCDADeviceService;
    /**
     * 分页查询opc da 配置
     *
     * @param params
     */
    @GetMapping("/list")
    public R list(@RequestParam Map<String, Object> params) {
        PageUtils page = channelOPCDADeviceService.queryPage(params);
        return R.ok().put("page", page);
    }
    /**
     * 根据id查询opc da配置详情
     *
     * @param id
     */
    @GetMapping("/info/{id}")
    public R info(@PathVariable("id") String id) {
        ChannelOPCDADeviceEntity info = channelOPCDADeviceService.info(id);
        return R.ok().put("data", info);
    }
    /**
     * 添加opc ua配置
     *
     * @param channelOPCDADeviceEntity
     */
    @PostMapping("/add")
    public R add(@RequestBody ChannelOPCDADeviceEntity channelOPCDADeviceEntity) {
        String id = UUID.randomUUID().toString();
        channelOPCDADeviceEntity.setId(id);
        channelOPCDADeviceEntity.setCreateTime(new Date());
        channelOPCDADeviceService.add(channelOPCDADeviceEntity);
        return R.ok();
    }
    /**
     * 修改opc ua配置
     *
     * @param channelOPCDADeviceEntity
     */
    @PostMapping("/update")
    public R update(@RequestBody ChannelOPCDADeviceEntity channelOPCDADeviceEntity) {
        channelOPCDADeviceEntity.setUpdateTime(new Date());
        channelOPCDADeviceService.update(channelOPCDADeviceEntity);
        return R.ok();
    }
    /**
     * 删除opc ua配置
     *
     * @param params
     */
    @PostMapping("/delete")
    public R delete(@RequestBody Map<String, Object> params) {
        String id = (String) params.get("id");
        channelOPCDADeviceService.delete(id);
        return R.ok();
    }
}
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/opcda/controller/ChannelOPCDATagController.java
对比新文件
@@ -0,0 +1,102 @@
package com.iailab.module.data.channel.opcda.controller;
import com.iailab.module.data.channel.opcda.entity.ChannelOPCDATagEntity;
import com.iailab.module.data.channel.opcda.service.ChannelOPCDATagService;
import com.iailab.module.data.common.exception.RRException;
import com.iailab.module.data.common.utils.PageUtils;
import com.iailab.module.data.common.utils.R;
import jodd.util.Base64;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import java.util.Map;
import java.util.UUID;
/**
 * 操作OPCDA tag配置
 *
 * @author DongYukun
 * @createTime 2023年05月6日 17:44:00
 */
@RestController
@RequestMapping("/channel/opcda/tag")
public class ChannelOPCDATagController {
    @Autowired
    private ChannelOPCDATagService channelOPCDATagService;
    /**
     * 分页查询tag
     *
     * @param params
     */
    @GetMapping("/list")
    public R tagList(@RequestParam Map<String, Object> params){
        PageUtils page = channelOPCDATagService.queryPage(params);
        return R.ok().put("page", page);
    }
    /**
     * 根据id查询tag详情
     *
     * @param id
     */
    @GetMapping("/info/{id}")
    public R tagInfo(@PathVariable("id") String id){
        ChannelOPCDATagEntity info= channelOPCDATagService.info(Base64.decodeToString(id));
        return R.ok().put("data", info);
    }
    /**
     * 添加tag
     *
     * @param entity
     */
    @PostMapping("/add")
    public R tagAdd(@RequestBody ChannelOPCDATagEntity entity){
        entity.setId(UUID.randomUUID().toString());
        channelOPCDATagService.add(entity);
        return R.ok();
    }
    /**
     * 修改tag
     *
     * @param channelOPCDATagEntity
     */
    @PostMapping("/update")
    public R tagUpdate(@RequestBody ChannelOPCDATagEntity channelOPCDATagEntity) {
        channelOPCDATagService.update(channelOPCDATagEntity);
        return R.ok();
    }
    /**
     * 删除tag
     * @param params
     *
     */
    @PostMapping("/delete")
    public R tagDelete(@RequestBody Map<String, Object> params) {
        String id = (String)params.get("id");
        channelOPCDATagService.delete(id);
        return R.ok();
    }
    /**
     * 导入
     *
     * @param serverId
     * @param file
     * @return
     */
    @PostMapping("/import/{serverId}")
    public R importTag(@PathVariable("serverId") String serverId, @RequestParam("file") MultipartFile file) {
        try {
            if (file.isEmpty()) {
                throw new RRException("上传文件不能为空");
            }
            channelOPCDATagService.importTag(serverId, file);
        } catch (Exception ex) {
            return R.error(ex.getMessage());
        }
        return R.ok();
    }
}
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/opcda/dao/ChannelOPCDADeviceDao.java
对比新文件
@@ -0,0 +1,16 @@
package com.iailab.module.data.channel.opcda.dao;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.iailab.module.data.channel.opcda.entity.ChannelOPCDADeviceEntity;
import org.apache.ibatis.annotations.Mapper;
/**
 * @author PanZhibao
 * @Description
 * @createTime 2023年04月26日 11:31:00
 */
@Mapper
public interface ChannelOPCDADeviceDao extends BaseMapper<ChannelOPCDADeviceEntity> {
}
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/opcda/dao/ChannelOPCDATagDao.java
对比新文件
@@ -0,0 +1,14 @@
package com.iailab.module.data.channel.opcda.dao;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.iailab.module.data.channel.opcda.entity.ChannelOPCDATagEntity;
import org.apache.ibatis.annotations.Mapper;
/**
 * @author DongYukun
 * @Description
 * @createTime 2023年05月8日 15:01:00
 */
@Mapper
public interface ChannelOPCDATagDao extends BaseMapper<ChannelOPCDATagEntity> {
}
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/opcda/dto/ChannelOPCDADeviceDTO.java
对比新文件
@@ -0,0 +1,46 @@
package com.iailab.module.data.channel.opcda.dto;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
 * @description: opcda_device
 * @author: dzd
 * @date: 2024/7/12 10:42
 **/
@Schema(description = "OPC DA设备")
@Data
public class ChannelOPCDADeviceDTO implements Serializable {
    private static final long serialVersionUID = 1L;
    @Schema(description = "主键", example = "主键")
    private String id;
    @Schema(description = "服务名", example = "服务名")
    private String serverName;
    @Schema(description = "主机IP", example = "主机IP")
    private String host;
    @Schema(description = "用户名", example = "用户名")
    private String user;
    @Schema(description = "密码", example = "密码")
    private String password;
    @Schema(description = "设备名", example = "设备名")
    private String progId;
    @Schema(description = "设备注册表ID", example = "设备注册表ID")
    private String clsId;
    @Schema(description = "创建时间", example = "创建时间")
    private Date createTime;
    @Schema(description = "更新时间", example = "更新时间")
    private Date updateTime;
}
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/opcda/dto/ChannelOPCDATagDTO.java
对比新文件
@@ -0,0 +1,43 @@
package com.iailab.module.data.channel.opcda.dto;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
 * @description: opcda_tag
 * @author: dzd
 * @date: 2024/7/12 11:00
 **/
@Schema(description = "OPC DA TAG")
@Data
public class ChannelOPCDATagDTO implements Serializable {
    private static final long serialVersionUID = 1L;
    @Schema(description = "主键", example = "主键")
    private String id;
    @Schema(description = "服务id", example = "服务id")
    private String serverId;
    @Schema(description = "TagName", example = "TagName")
    private String tagName;
    @Schema(description = "数据类型", example = "数据类型")
    private String dataType;
    @Schema(description = "是否可以tag", example = "是否可以tag")
    private Boolean enabled;
    @Schema(description = "itemId", example = "itemId")
    private String itemId;
    @Schema(description = "创建时间", example = "创建时间")
    private Date createTime;
    @Schema(description = "修改时间", example = "修改时间")
    private Date updateTime;
}
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/opcda/dto/WriteDTO.java
对比新文件
@@ -0,0 +1,15 @@
package com.iailab.module.data.channel.opcda.dto;
import lombok.Data;
import org.jinterop.dcom.core.JIVariant;
import org.openscada.opc.lib.da.Item;
import java.io.Serializable;
@Data
public class WriteDTO implements Serializable {
    private static final long serialVersionUID = 1L;
    private Item item;
    private JIVariant value;
}
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/opcda/entity/ChannelOPCDADeviceEntity.java
对比新文件
@@ -0,0 +1,67 @@
package com.iailab.module.data.channel.opcda.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
 * @description: opcda_device
 * @author: dzd
 * @date: 2024/7/12 10:42
 **/
@Data
@TableName("t_channel_opcda_device")
public class ChannelOPCDADeviceEntity implements Serializable {
    private static final long serialVersionUID = 1L;
    /**
     * 主键
     */
    @TableId(value = "id",type = IdType.INPUT)
    private String id;
    /**
     * ServerName 服务名
     */
    private String serverName;
    /**
     * ip
     */
    private String host;
    /**
     * 用户名
     */
    private String user;
    /**
     * 密码
     */
    private String password;
    /**
     * 设备名
     */
    private String progId;
    /**
     * 设备注册表ID
     */
    private String clsId;
    /**
     * 创建时间
     */
    private Date createTime;
    /**
     * 更新时间
     */
    private Date updateTime;
}
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/opcda/entity/ChannelOPCDATagEntity.java
对比新文件
@@ -0,0 +1,62 @@
package com.iailab.module.data.channel.opcda.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
 * @description: opcda_tag
 * @author: dzd
 * @date: 2024/7/12 11:00
 **/
@Data
@TableName("t_channel_opcda_tag")
public class ChannelOPCDATagEntity implements Serializable {
    private static final long serialVersionUID = 1L;
    /**
     * 主键
     */
    @TableId(value = "id",type = IdType.INPUT)
    private String id;
    /**
     * 服务id
     */
    private String serverId;
    /**
     * TagName
     */
    private String tagName;
    /**
     * 数据类型
     */
    private String dataType;
    /**
     * 是否可以tag,如果为false,即使定义了但是runtime不会读取该数据
     */
    private Boolean enabled;
    /**
     * itemId
     */
    private String itemId;
    /**
     * 创建时间
     */
    private Date createTime;
    /**
     * 修改时间
     */
    private Date updateTime;
}
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/opcda/service/ChannelOPCDADeviceService.java
对比新文件
@@ -0,0 +1,60 @@
package com.iailab.module.data.channel.opcda.service;
import com.iailab.module.data.channel.opcda.dto.ChannelOPCDADeviceDTO;
import com.iailab.module.data.channel.opcda.entity.ChannelOPCDADeviceEntity;
import com.iailab.module.data.common.utils.PageUtils;
import java.util.List;
import java.util.Map;
/**
 * @author DongYukun
 * @Description
 * @createTime 2023年05月08日 15:04:00
 */
public interface ChannelOPCDADeviceService {
    /**
     * 分页查询设备
     *
     * @param params
     */
    PageUtils queryPage(Map<String, Object> params);
    /**
     * 查询设备详情
     *
     * @param id
     */
    ChannelOPCDADeviceEntity info(String id);
    /**
     * 列表
     *
     * @param params
     * @return
     */
    List<ChannelOPCDADeviceEntity> list(Map<String, Object> params);
    /**
     * 添加设备
     *
     * @param channelOPCDADeviceEntity
     */
    void add(ChannelOPCDADeviceEntity channelOPCDADeviceEntity);
    /**
     * 修改设备
     *
     * @param channelOPCDADeviceEntity
     */
    void update(ChannelOPCDADeviceEntity channelOPCDADeviceEntity);
    /**
     * 删除设备
     *
     * @param id
     */
    void delete(String id);
    /**
     * 查询全部设备
     *
     */
    List<ChannelOPCDADeviceDTO> selectAll();
}
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/opcda/service/ChannelOPCDATagService.java
对比新文件
@@ -0,0 +1,70 @@
package com.iailab.module.data.channel.opcda.service;
import com.iailab.module.data.channel.opcda.dto.ChannelOPCDATagDTO;
import com.iailab.module.data.channel.opcda.entity.ChannelOPCDATagEntity;
import com.iailab.module.data.common.utils.PageUtils;
import org.springframework.web.multipart.MultipartFile;
import java.util.List;
import java.util.Map;
/**
 * @author DongYukun
 * @Description
 * @createTime 2023年05月08日 15:04:00
 */
public interface ChannelOPCDATagService {
    /**
     * 分页查询tag
     *
     * @param params
     */
    PageUtils queryPage(Map<String, Object> params);
    /**
     * 查询tag详情
     * @param id
     *
     */
    ChannelOPCDATagEntity info(String id);
    /**
     * 添加tag
     *
     * @param channelOPCDATagEntity
     */
    void add(ChannelOPCDATagEntity channelOPCDATagEntity);
    /**
     * 修改tag
     *
     * @param channelOPCDATagEntity
     */
    void update(ChannelOPCDATagEntity channelOPCDATagEntity);
    /**
     * 删除tag
     * @param id
     *
     */
    void delete(String id);
    List<ChannelOPCDATagEntity> getByserverId(String serverId);
    List<ChannelOPCDATagDTO> selectAll();
    List<ChannelOPCDATagEntity> listByIds(List<String> ids);
    /**
     * 通过serverId删除
     *
     */
    void deleteByServerId(String serverId);
    /**
     * 导入Tag
     *
     * @param serverId
     * @param file
     * @throws Exception
     */
    void importTag(String serverId, MultipartFile file) throws Exception;
}
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/opcda/service/impl/ChannelOPCDADeviceServiceImpl.java
对比新文件
@@ -0,0 +1,115 @@
package com.iailab.module.data.channel.opcda.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.iailab.framework.common.util.object.ConvertUtils;
import com.iailab.module.data.channel.opcda.dao.ChannelOPCDADeviceDao;
import com.iailab.module.data.channel.opcda.dto.ChannelOPCDADeviceDTO;
import com.iailab.module.data.channel.opcda.entity.ChannelOPCDADeviceEntity;
import com.iailab.module.data.channel.opcda.service.ChannelOPCDADeviceService;
import com.iailab.module.data.channel.opcda.service.ChannelOPCDATagService;
import com.iailab.module.data.common.utils.PageUtils;
import com.iailab.module.data.common.utils.Query;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
import java.util.Map;
/**
 * @author DongYukun
 * @Description
 * @createTime 2023年05月08日 15:04:00
 */
@Service
public class ChannelOPCDADeviceServiceImpl extends ServiceImpl<ChannelOPCDADeviceDao, ChannelOPCDADeviceEntity> implements ChannelOPCDADeviceService {
    @Resource
    private ChannelOPCDADeviceDao channelOPCDADeviceDao;
    @Autowired
    private ChannelOPCDATagService channelOPCDATagService;
    /**
     * 分页查询opc ua配置
     *
     * @param params
     */
    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        String serverName = (String) params.get("serverName");
        IPage<ChannelOPCDADeviceEntity> page = this.page(
                new Query<ChannelOPCDADeviceEntity>().getPage(params),
                new QueryWrapper<ChannelOPCDADeviceEntity>()
                        .like(StringUtils.isNotBlank(serverName), "server_name", serverName)
                        .orderByDesc("create_time")
        );
        return new PageUtils(page);
    }
    /**
     * 查询opc ua配置详情
     *
     * @param id
     */
    @Override
    public ChannelOPCDADeviceEntity info(String id) {
        return channelOPCDADeviceDao.selectById(id);
    }
    /**
     * 列表
     *
     * @param params
     * @return
     */
    @Override
    public List<ChannelOPCDADeviceEntity> list(Map<String, Object> params) {
        return channelOPCDADeviceDao.selectList(new QueryWrapper<ChannelOPCDADeviceEntity>().orderByAsc("server_name"));
    }
    /**
     * 添加opc ua配置
     *
     * @param channelOPCDADeviceEntity
     */
    @Override
    public void add(ChannelOPCDADeviceEntity channelOPCDADeviceEntity) {
        channelOPCDADeviceDao.insert(channelOPCDADeviceEntity);
    }
    /**
     * 修改opc ua配置
     *
     * @param channelOPCDADeviceEntity
     */
    @Override
    public void update(ChannelOPCDADeviceEntity channelOPCDADeviceEntity) {
        channelOPCDADeviceDao.updateById(channelOPCDADeviceEntity);
    }
    /**
     * 删除opc ua配置
     *
     * @param id
     */
    @Override
    public void delete(String id) {
        //先删除device下的tag
        channelOPCDATagService.deleteByServerId(id);
        channelOPCDADeviceDao.deleteById(id);
    }
    @Override
    public List<ChannelOPCDADeviceDTO> selectAll() {
        List<ChannelOPCDADeviceEntity> entityList = baseMapper.selectList(
                null
        );
        return ConvertUtils.sourceToTarget(entityList, ChannelOPCDADeviceDTO.class);
    }
}
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/opcda/service/impl/ChannelOPCDATagServiceImpl.java
对比新文件
@@ -0,0 +1,187 @@
package com.iailab.module.data.channel.opcda.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.util.object.ConvertUtils;
import com.iailab.module.data.channel.opcda.dao.ChannelOPCDATagDao;
import com.iailab.module.data.channel.opcda.dto.ChannelOPCDATagDTO;
import com.iailab.module.data.channel.opcda.entity.ChannelOPCDATagEntity;
import com.iailab.module.data.channel.opcda.service.ChannelOPCDATagService;
import com.iailab.module.data.common.utils.PageUtils;
import com.iailab.module.data.common.utils.Query;
import lombok.extern.slf4j.Slf4j;
import org.apache.poi.ss.usermodel.CellType;
import org.apache.poi.xssf.usermodel.XSSFRow;
import org.apache.poi.xssf.usermodel.XSSFSheet;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource;
import java.io.File;
import java.io.FileInputStream;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.UUID;
/**
 * @author DongYukun
 * @Description
 * @createTime 2023年05月08日 15:04:00
 */
@Slf4j
@Service
public class ChannelOPCDATagServiceImpl extends ServiceImpl<ChannelOPCDATagDao, ChannelOPCDATagEntity> implements ChannelOPCDATagService {
    @Resource
    private ChannelOPCDATagDao channelOPCDATagDao;
    @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 serverId = (String) params.get("serverId");
        IPage<ChannelOPCDATagEntity> page = this.page(
                new Query<ChannelOPCDATagEntity>().getPage(params),
                new QueryWrapper<ChannelOPCDATagEntity>()
                        .like(StringUtils.isNotBlank(tagName), "tag_name", tagName)
                        .eq(StringUtils.isNotBlank(serverId), "server_id", serverId)
                        .orderByDesc("create_time")
        );
        return new PageUtils(page);
    }
    /**
     * 查询tag详情
     *
     * @param id
     */
    @Override
    public ChannelOPCDATagEntity info(String id) {
        return channelOPCDATagDao.selectById(id);
    }
    @Override
    public List<ChannelOPCDATagEntity> getByserverId(String serverId) {
        QueryWrapper<ChannelOPCDATagEntity> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("server_id", serverId).orderByDesc ("create_time");
        return channelOPCDATagDao.selectList(queryWrapper);
    }
    /**
     * 添加tag
     *
     * @param channelOPCDATagEntity
     */
    @Override
    public void add(ChannelOPCDATagEntity channelOPCDATagEntity) {
        channelOPCDATagDao.insert(channelOPCDATagEntity);
    }
    /**
     * 修改tag
     *
     * @param channelOPCDATagEntity
     */
    @Override
    public void update(ChannelOPCDATagEntity channelOPCDATagEntity) {
        channelOPCDATagDao.updateById(channelOPCDATagEntity);
    }
    /**
     * 删除tag
     *
     * @param id
     */
    @Override
    public void delete(String id) {
        channelOPCDATagDao.deleteById(id);
    }
    @Override
    public List<ChannelOPCDATagDTO> selectAll() {
        List<ChannelOPCDATagEntity> entityList = baseMapper.selectList(
                null
        );
        return ConvertUtils.sourceToTarget(entityList, ChannelOPCDATagDTO.class);
    }
    @Override
    public List<ChannelOPCDATagEntity> listByIds(List<String> ids) {
        return baseMapper.selectList(new QueryWrapper<ChannelOPCDATagEntity>().in("id", ids));
    }
    @Override
    public void deleteByServerId(String serverId) {
        baseMapper.delete(new QueryWrapper<ChannelOPCDATagEntity>().eq("server_id",serverId));
    }
    /**
     * 导入Tag
     *
     * @param serverId
     * @param file
     * @throws Exception
     */
    @Override
    @Transactional(rollbackFor = Exception.class)
    public void importTag(String serverId, MultipartFile file) throws Exception {
        try {
            String suffix = file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf("."));
            String fileName = UUID.randomUUID().toString() + suffix;
            String path = uploadDir + fileName;
            file.transferTo(new File(path));
            XSSFWorkbook hssfWorkbook = new XSSFWorkbook(new FileInputStream(path));
            XSSFSheet sheet = hssfWorkbook.getSheetAt(0);
            int lastRowNum = sheet.getLastRowNum();
            log.info("最后一行:" + lastRowNum);
            int lastCellNum = 4;
            List<ChannelOPCDATagEntity> dangerList = new ArrayList<>();
            for (int i = 2; i <= lastRowNum; i++) {
                XSSFRow row = sheet.getRow(i);
                for (int j = row.getFirstCellNum(); j < lastCellNum; j++) {
                    row.getCell(j).setCellType(CellType.STRING);
                }
                ChannelOPCDATagEntity tagEntity = new ChannelOPCDATagEntity();
                tagEntity.setId(UUID.randomUUID().toString());
                tagEntity.setTagName(row.getCell(1).getStringCellValue());
                tagEntity.setDataType(row.getCell(2).getStringCellValue());
                tagEntity.setItemId(row.getCell(3).getStringCellValue());
                tagEntity.setEnabled(true);
                tagEntity.setServerId(serverId);
                dangerList.add(tagEntity);
            }
            if (CollectionUtils.isEmpty(dangerList)) {
                return;
            }
            //getBaseMapper().insertList(dangerList);
            dangerList.forEach(item -> {
                try {
                    getBaseMapper().insert(item);
                } catch (Exception ex) {
                    log.warn("插入异常:" + item.getTagName());
                }
            });
        } catch (Exception ex) {
            ex.printStackTrace();
            log.warn("导入失败!");
            throw ex;
        }
    }
}
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/opcua/dto/ChannelOPCUADeviceDTO.java
@@ -1,6 +1,7 @@
package com.iailab.module.data.channel.opcua.dto;
import com.alibaba.fastjson.annotation.JSONField;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.io.Serializable;
@@ -10,67 +11,39 @@
 * @Description
 * @createTime 2023年04月23日 14:25:00
 */
@Schema(description = "OPC UA设备")
@Data
public class ChannelOPCUADeviceDTO implements Serializable {
    private static final long serialVersionUID = 1L;
    /**
     * ServerName
     */
    @JSONField(name="ServerName")
    @Schema(description = "ServerName", example = "ServerName")
    private String ServerName;
    /**
     * EndpointUrl
     */
    @JSONField(name="EndpointUrl")
    @Schema(description = "EndpointUrl", example = "EndpointUrl")
    private String EndpointUrl;
    /**
     * SecurityPolicy
     */
    @JSONField(name="SecurityPolicy")
    @Schema(description = "SecurityPolicy", example = "SecurityPolicy")
    private String SecurityPolicy;
    /**
     * SecurityMode
     */
    @JSONField(name="SecurityMode")
    @Schema(description = "SecurityMode", example = "SecurityMode")
    private String SecurityMode;
    /**
     * 连接方式(0,匿名;1,用户名密码; 2,安全证书)
     */
    @JSONField(name="ConnectionType")
    @Schema(description = "连接方式", example = "连接方式(0,匿名;1,用户名密码; 2,安全证书)")
    private String ConnectionType;
    /**
     * 用户名
     */
    @JSONField(name="UserName")
    @Schema(description = "用户名", example = "用户名")
    private String UserName;
    /**
     * 密码
     */
    @JSONField(name="Password")
    @Schema(description = "密码", example = "密码")
    private String Password;
    /**
     * 安全证书路径
     */
    @JSONField(name="CertificatePath")
    @Schema(description = "安全证书路径", example = "安全证书路径")
    private String CertificatePath;
    /**
     * 设备不活动超时时间
     */
    @JSONField(name="ConnectInactivityTimeout")
    @Schema(description = "设备不活动超时时间", example = "设备不活动超时时间")
    private Integer ConnectInactivityTimeout;
    /**
     * 重连超时
     */
    @JSONField(name="ConnectInactivityTimeout")
    @Schema(description = "重连超时", example = "重连超时")
    private Integer ReconnectInterval;
}
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/opcua/entity/ChannelOPCUATagEntity.java
@@ -3,7 +3,6 @@
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.io.Serializable;
@@ -24,7 +23,6 @@
    /**
     * 主键
     */
    @Schema(description = "主键")
    @TableId(value = "id",type = IdType.INPUT)
    private String id;
    /**
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/feign/FeignDataImpl.java
文件已删除
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/framework/filter/MyFilter.java
文件已删除
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/framework/filter/MyHttpServletRequestWrapper.java
文件已删除
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/framework/filter/RequestReadUtils.java
文件已删除
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/framework/filter/RewriteRequestFilter.java
文件已删除
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/framework/interceptor/CommonData.java
文件已删除
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/framework/interceptor/WebMvcConfig.java
文件已删除
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/framework/package-info.java
文件已删除
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/framework/rpc/config/RpcConfiguration.java
文件已删除
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/framework/rpc/package-info.java
文件已删除
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/framework/security/config/SecurityConfiguration.java
文件已删除
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/framework/security/core/package-info.java
文件已删除
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/http/collector/HttpCollectorForSD.java
文件已删除
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/http/collector/HttpCollectorForUser.java
文件已删除
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/http/dao/EleLowTagDao.java
文件已删除
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/http/dao/FxjyTagDao.java
文件已删除
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/http/dao/HttpApiDao.java
@@ -2,7 +2,6 @@
import com.iailab.framework.common.dao.BaseDao;
import com.iailab.module.data.http.entity.HttpApiEntity;
import com.iailab.module.data.http.entity.HttpApiEntity;
import org.apache.ibatis.annotations.Mapper;
@Mapper
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/http/dao/XSTTagDao.java
文件已删除
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/http/dto/TokenJsonDto.java
文件已删除
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/http/service/HttpTagService.java
@@ -22,11 +22,7 @@
    List<HttpTagEntity> selectList(Map<String, Object> params);
    Map<String, BigDecimal> getTagsValues(String httpApiCode, List<TagCommonCurrentDto> tags);
    List<HttpTagEntity> getByCode(String code);
    List<String> getByTagType(String deviceId);
    List<HttpTagDTO> list(Map<String, Object> params);
}
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/http/service/impl/FxjyTagServiceImpl.java
文件已删除
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/http/service/impl/HttpTagCollector.java
文件已删除
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/http/service/impl/HttpTagServiceImpl.java
@@ -81,224 +81,8 @@
    }
    @Override
    public List<String> getByTagType(String deviceId) {
        QueryWrapper<HttpTagEntity> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("tag_type", deviceId);
        List<HttpTagEntity> entityList = baseDao.selectList(queryWrapper);
        List<String> list = new ArrayList<>();
        if(ObjectUtils.isNotEmpty(entityList)) {
            entityList.stream().forEach(entity -> {
                String tagCode = entity.getTagCode();
                list.add(tagCode);
            });
        }
        return list;
    }
    @Override
    public List<HttpTagDTO> list(Map<String, Object> params) {
        List<HttpTagDTO> list = baseDao.getList(params);
        return list;
    }
    @Override
    public Map<String, BigDecimal> getTagsValues(String httpApiCode, List<TagCommonCurrentDto> tags) {
        Map<String, BigDecimal> stringBigDecimalMap = new HashMap<>();
        if (CommonConstant.YEAR_PEI_HTTP_TAG.equals(httpApiCode)) {
            stringBigDecimalMap = yearPeiTagsValues(tags);
        } else if(CommonConstant.CURRENT_PERFORMANCE_HTTP_TAG.equals(httpApiCode)) {
            stringBigDecimalMap = currentPerformanceTagsValues(tags);
        } else if(CommonConstant.CURRENT_SALE_HTTP_TAG.equals(httpApiCode)) {
            stringBigDecimalMap = currentSaleTagsValues(tags);
        } else if(CommonConstant.PRD_TIME_DIST_HTTP_TAG.equals(httpApiCode)) {
            stringBigDecimalMap = prdTimeDistTagsValues(tags);
        }
        return stringBigDecimalMap;
    }
    private Map<String, BigDecimal> yearPeiTagsValues(List<TagCommonCurrentDto> tags) {
        Map<String, BigDecimal> result = new HashMap<>(tags.size());
        Calendar calendar = Calendar.getInstance();
        int currentMonth = calendar.get(Calendar.MONTH) + 1;
//        String url = httpApiService.getByCode(API_CODE).getUrl();
//        String responseStr = httpsRequest.doGet(url, params,"utf-8", "");
        String url = "http://192.168.55.121/Sunny/Action/BdApi/Invoke?code=Prd.YearPEI";
        String responseStr = "{\"sta\":true,\"msg\":null,\"res\":{\"yearData\":{\"year\":2024,\"xxPlan\":21850000.00,\"xxPerformance\":6794492.00,\"zqPlan\":12500000.00,\"zqPerformance\":3149110.41},\"monthData\":[{\"month\":1,\"xxPlan\":1400000.00,\"xxPerformance\":2022725.00,\"zqPlan\":800000.00,\"zqPerformance\":955066.76},{\"month\":2,\"xxPlan\":1400000.00,\"xxPerformance\":1829671.00,\"zqPlan\":800000.00,\"zqPerformance\":809494.02},{\"month\":3,\"xxPlan\":1700000.00,\"xxPerformance\":2225923.00,\"zqPlan\":1000000.00,\"zqPerformance\":971406.22},{\"month\":4,\"xxPlan\":1620000.00,\"xxPerformance\":716173.00,\"zqPlan\":1000000.00,\"zqPerformance\":345324.75},{\"month\":5,\"xxPlan\":0.0,\"xxPerformance\":0.00,\"zqPlan\":0.0,\"zqPerformance\":0.0},{\"month\":6,\"xxPlan\":0.0,\"xxPerformance\":0.0,\"zqPlan\":0.0,\"zqPerformance\":0.0},{\"month\":7,\"xxPlan\":0.0,\"xxPerformance\":0.0,\"zqPlan\":0.0,\"zqPerformance\":0.0},{\"month\":8,\"xxPlan\":0.0,\"xxPerformance\":0.0,\"zqPlan\":0.0,\"zqPerformance\":0.0},{\"month\":9,\"xxPlan\":0.0,\"xxPerformance\":0.0,\"zqPlan\":0.0,\"zqPerformance\":0.0},{\"month\":10,\"xxPlan\":0.0,\"xxPerformance\":0.0,\"zqPlan\":0.0,\"zqPerformance\":0.0},{\"month\":11,\"xxPlan\":0.0,\"xxPerformance\":0.0,\"zqPlan\":0.0,\"zqPerformance\":0.0},{\"month\":12,\"xxPlan\":0.0,\"xxPerformance\":0.0,\"zqPlan\":0.0,\"zqPerformance\":0.0}]}}";
        if (StringUtils.isNotBlank(responseStr)) {
            TagYearPeiJsonDto yearPeiJsonDto = parseYearPeiDto(responseStr);
            tags.stream().forEach(
                    item -> {
                        String tagType = item.getTagType();
                        String tagCode = item.getTagCode().split(CommonConstant.UNDERLINE)[1];
                        TagYearPeiJsonDto.DATA res = yearPeiJsonDto.getRes();
                        TagYearPeiJsonDto.DATA.YEAR yearData = res.getYearData();
                        List<TagYearPeiJsonDto.DATA.MONTH> monthDataList = res.getMonthData();
                        TagYearPeiJsonDto.DATA.MONTH month = monthDataList.get(currentMonth - 1);
                        Class<?> yearPeiClass = res.getClass();
                        String name = yearPeiClass.getName();
                        try {
                            BigDecimal value;
                            Class<?> yearPeiTypeClass1 = Class.forName(name + CommonConstant.DOLLAR + tagType.toUpperCase());
                            Field field = yearPeiTypeClass1.getDeclaredField(tagCode);
                            field.setAccessible(true);
                            if(CommonConstant.YEAR.equals(tagType)){
                                value = new BigDecimal((String) field.get(yearData));
                                result.put(item.getTagCode(), value);
                            } else if(CommonConstant.MONTH.equals(tagType)){
                                value = new BigDecimal((String) field.get(month));
                                result.put(item.getTagCode(), value);
                            }
                        } catch (NoSuchFieldException e) {
                            log.info("没有找到tag" + item.getTagType() + ";" + item.getTagCode());
                        } catch (IllegalAccessException e) {
                            log.info("没有反射权限");
                        } catch (ClassNotFoundException e) {
                            throw new RuntimeException(e);
                        }
                    }
            );
        }
        return result;
    }
    private Map<String, BigDecimal> currentPerformanceTagsValues(List<TagCommonCurrentDto> tags) {
        Map<String, BigDecimal> result = new HashMap<>(tags.size());
        Map<String, String> params = new HashMap<>(2);
//        String url = httpApiService.getByCode(API_CODE).getUrl();
//        String responseStr = httpsRequest.doGet(url, params,"utf-8", "");
        String responseStr = "{\"sta\":true,\"msg\":null,\"res\":{\"today\":{\"xxPerformance\":30866.00,\"zqPerformance\":0.0},\"yesterday\":{\"xxPerformance\":65748.00,\"zqPerformance\":36263.20},\"currentMonth\":{\"xxPerformance\":716173.00,\"zqPerformance\":345324.75},\"currentYear\":{\"xxPerformance\":6794492.00,\"zqPerformance\":3149110.41}}}";
        if (StringUtils.isNotBlank(responseStr)) {
            TagCurrentPerformanceJsonDto currentPerformanceJsonDto = parseCurrentPerformanceDto(responseStr);
            tags.stream().forEach(
                    item -> {
                        String tagType = item.getTagType();
                        String tagCode = item.getTagCode().split(CommonConstant.UNDERLINE)[1];
                        Class<?> currentPerformanceClass = currentPerformanceJsonDto.getRes().getClass();
                        String name = currentPerformanceClass.getName();
                        try {
                            Field declaredField = currentPerformanceClass.getDeclaredField(tagType);
                            Class<?> typeClass = Class.forName(name + CommonConstant.DOLLAR + tagType.toUpperCase());
                            Field field = typeClass.getDeclaredField(tagCode);
                            field.setAccessible(true);
                            declaredField.setAccessible(true);
                            BigDecimal value = new BigDecimal((String) field.get(declaredField.get(currentPerformanceJsonDto.getRes())));
                            result.put(item.getTagCode(), value);
                        } catch (NoSuchFieldException e) {
                            log.info("没有找到tag" + item.getTagType() + ";" + item.getTagCode());
                        } catch (IllegalAccessException e) {
                            log.info("没有反射权限");
                        } catch (ClassNotFoundException e) {
                            throw new RuntimeException(e);
                        }
                    }
            );
        }
        return result;
    }
    private Map<String, BigDecimal> currentSaleTagsValues(List<TagCommonCurrentDto> tags) {
        Map<String, BigDecimal> result = new HashMap<>(tags.size());
        Map<String, String> params = new HashMap<>(2);
//        String url = httpApiService.getByCode(API_CODE).getUrl();
//        String responseStr = httpsRequest.doGet(url, params,"utf-8", "");
        String responseStr = "{\"sta\":true,\"msg\":null,\"res\":{\"today\":{\"groundsales\":0.0,\"medblock\":0.0,\"nubmeasure\":0.0,\"gangue\":0.0,\"reshipped\":0.0,\"trainTon\":0.0,\"trainCount\":0},\"yesterday\":{\"groundsales\":15696.00,\"medblock\":14757.00,\"nubmeasure\":0.00,\"gangue\":4384.00,\"reshipped\":2447.00,\"trainTon\":36263.20,\"trainCount\":10},\"currentMonth\":{\"groundsales\":0.0,\"medblock\":0.0,\"nubmeasure\":0.0,\"gangue\":0.0,\"reshipped\":0.0,\"trainTon\":0.0,\"trainCount\":0},\"currentYear\":{\"groundsales\":521638.00,\"medblock\":266372.00,\"nubmeasure\":0.00,\"gangue\":143475.00,\"reshipped\":139695.00,\"trainTon\":0.0,\"trainCount\":0}}}";
        if (StringUtils.isNotBlank(responseStr)) {
            TagCurrentSaleJsonDto currentPerformanceJsonDto = parseCurrentSaleDto(responseStr);
            tags.stream().forEach(
                    item -> {
                        String tagType = item.getTagType();
                        String tagCode = item.getTagCode().split(CommonConstant.UNDERLINE)[1];
                        Class<?> currentSaleClass = currentPerformanceJsonDto.getRes().getClass();
                        String name = currentSaleClass.getName();
                        try {
                            Field declaredField = currentSaleClass.getDeclaredField(tagType);
                            Class<?> typeClass = Class.forName(name + CommonConstant.DOLLAR + tagType.toUpperCase());
                            Field field = typeClass.getDeclaredField(tagCode);
                            field.setAccessible(true);
                            declaredField.setAccessible(true);
                            BigDecimal value = new BigDecimal((String) field.get(declaredField.get(currentPerformanceJsonDto.getRes())));
                            result.put(item.getTagCode(), value);
                        } catch (NoSuchFieldException e) {
                            log.info("没有找到tag" + item.getTagType() + ";" + item.getTagCode());
                        } catch (IllegalAccessException e) {
                            log.info("没有反射权限");
                        } catch (ClassNotFoundException e) {
                            throw new RuntimeException(e);
                        }
                    }
            );
        }
        return result;
    }
    private Map<String, BigDecimal> prdTimeDistTagsValues(List<TagCommonCurrentDto> tags) {
        Map<String, BigDecimal> result = new HashMap<>(tags.size());
        Map<String, String> params = new HashMap<>(2);
//        String url = httpApiService.getByCode(API_CODE).getUrl();
//        String responseStr = httpsRequest.doGet(url, params,"utf-8", "");
        String responseStr = "{\"sta\":true,\"msg\":null,\"res\":{\"xx\":{\"runMinutes\":1120.0,\"overhaulMinutes\":305.0,\"affectMinutes\":15.0},\"zq\":{\"runMinutes\":645.0,\"overhaulMinutes\":223.0,\"affectMinutes\":572.0}}}";
        if (StringUtils.isNotBlank(responseStr)) {
            TagPrdTimeDistJsonDto prdTimeDistJsonDto = parsePrdTimeDistDto(responseStr);
            tags.stream().forEach(
                    item -> {
                        String tagType = item.getTagType();
                        String tagCode = item.getTagCode().split(CommonConstant.UNDERLINE)[1];
                        Class<?> prdTimeDistClass = prdTimeDistJsonDto.getRes().getClass();
                        String name = prdTimeDistClass.getName();
                        try {
                            Field declaredField = prdTimeDistClass.getDeclaredField(tagType);
                            Class<?> typeClass = Class.forName(name + CommonConstant.DOLLAR + tagType.toUpperCase());
                            Field field = typeClass.getDeclaredField(tagCode);
                            field.setAccessible(true);
                            declaredField.setAccessible(true);
                            BigDecimal value = new BigDecimal((String) field.get(declaredField.get(prdTimeDistJsonDto.getRes())));
                            result.put(item.getTagCode(), value);
                        } catch (NoSuchFieldException e) {
                            log.info("没有找到tag" + item.getTagType() + ";" + item.getTagCode());
                        } catch (IllegalAccessException e) {
                            log.info("没有反射权限");
                        } catch (ClassNotFoundException e) {
                            throw new RuntimeException(e);
                        }
                    }
            );
        }
        return result;
    }
    private TagYearPeiJsonDto parseYearPeiDto(String responseStr) {
        TagYearPeiJsonDto result = new TagYearPeiJsonDto();
        if (!StringUtils.isEmpty(responseStr)) {
            JSONObject items = JSONObject.parseObject(responseStr);
            result = items.toJavaObject(TagYearPeiJsonDto.class);
        }
        return result;
    }
    private TagCurrentPerformanceJsonDto parseCurrentPerformanceDto(String responseStr) {
        TagCurrentPerformanceJsonDto result = new TagCurrentPerformanceJsonDto();
        if (!StringUtils.isEmpty(responseStr)) {
            JSONObject items = JSONObject.parseObject(responseStr);
            result = items.toJavaObject(TagCurrentPerformanceJsonDto.class);
        }
        return result;
    }
    private TagCurrentSaleJsonDto parseCurrentSaleDto(String responseStr) {
        TagCurrentSaleJsonDto result = new TagCurrentSaleJsonDto();
        if (!StringUtils.isEmpty(responseStr)) {
            JSONObject items = JSONObject.parseObject(responseStr);
            result = items.toJavaObject(TagCurrentSaleJsonDto.class);
        }
        return result;
    }
    private TagPrdTimeDistJsonDto parsePrdTimeDistDto(String responseStr) {
        TagPrdTimeDistJsonDto result = new TagPrdTimeDistJsonDto();
        if (!StringUtils.isEmpty(responseStr)) {
            JSONObject items = JSONObject.parseObject(responseStr);
            result = items.toJavaObject(TagPrdTimeDistJsonDto.class);
        }
        return result;
    }
}
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/indexdata/common/ClockSuffix.java
文件已删除
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/indexdata/common/IndexDataBc.java
文件已删除
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/indexdata/common/IndexDataConstant.java
文件已删除
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/indexdata/common/IndexDataUtils.java
文件已删除
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/indexdata/controller/admin/IndexDataClockController.java
文件已删除
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/indexdata/controller/admin/IndexDataItemController.java
文件已删除
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/indexdata/controller/admin/IndexDataValueController.java
文件已删除
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/indexdata/controller/package-info.java
文件已删除
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/indexdata/dao/IndexDataClockDao.java
文件已删除
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/indexdata/dao/IndexDataItemDao.java
文件已删除
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/indexdata/dao/IndexDataValueDao.java
文件已删除
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/indexdata/entity/IndexDataClockEntity.java
文件已删除
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/indexdata/entity/IndexDataItemEntity.java
文件已删除
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/indexdata/entity/IndexDataValueEntity.java
文件已删除
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/indexdata/service/IndexDataClockService.java
文件已删除
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/indexdata/service/IndexDataItemService.java
文件已删除
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/indexdata/service/IndexDataValueService.java
文件已删除
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/indexdata/service/impl/IndexDataClockServiceImpl.java
文件已删除
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/indexdata/service/impl/IndexDataItemServiceImpl.java
文件已删除
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/indexdata/service/impl/IndexDataValueServiceImpl.java
文件已删除
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/job/init/JobCommandLineRunner.java
@@ -1,23 +1,9 @@
/**
 * Copyright (c) 2018 人人开源 All rights reserved.
 *
 * https://www.renren.io
 *
 * 版权所有,侵权必究!
 */
package com.iailab.module.data.job.init;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.iailab.module.data.job.entity.ScheduleJobEntity;
import com.iailab.module.data.job.utils.ScheduleUtils;
import com.iailab.module.data.job.entity.ScheduleJobEntity;
import com.iailab.module.data.job.utils.ScheduleUtils;
import com.iailab.module.data.job.dao.ScheduleJobDao;
import com.iailab.module.data.job.entity.ScheduleJobEntity;
import com.iailab.module.data.job.utils.ScheduleUtils;
import com.iailab.module.data.job.entity.ScheduleJobEntity;
import com.iailab.module.data.job.utils.ScheduleUtils;
import org.quartz.CronTrigger;
import org.quartz.Scheduler;
import javax.annotation.Resource;
@@ -28,8 +14,6 @@
/**
 * 初始化定时任务数据
 *
 * @author Mark sunlightcs@gmail.com
 */
@Component
public class JobCommandLineRunner implements CommandLineRunner {
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/job/task/HttpCollectDeviceTask.java
文件已删除
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/job/task/HttpCollectHealthStateTask.java
文件已删除
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/job/task/HttpCollectRunStateTask.java
文件已删除
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/job/task/HttpCollectTemperatureTask.java
文件已删除
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/job/task/HttpCollectUserTask.java
文件已删除
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/job/task/HttpTokenTask.java
文件已删除
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/point/collection/handler/MeasureHandle.java
@@ -1,5 +1,6 @@
package com.iailab.module.data.point.collection.handler;
import com.iailab.module.data.channel.opcda.collector.OpcDACollector;
import com.iailab.module.data.common.enums.CommonConstant;
import com.iailab.module.data.common.enums.DataSourceType;
import com.iailab.module.data.common.enums.DataTypeEnum;
@@ -12,10 +13,11 @@
import com.iailab.module.data.point.dto.DaPointDTO;
import com.iailab.module.data.point.service.DaPointService;
import com.iailab.module.data.http.collector.HttpCollectorForZxzk;
import com.iailab.module.data.http.service.impl.HttpTagCollector;
import com.iailab.module.data.influxdb.pojo.InfluxPointValuePOJO;
import lombok.extern.slf4j.Slf4j;
import javax.annotation.Resource;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.util.CollectionUtils;
@@ -46,8 +48,8 @@
    @Resource
    private OpcUaCollector opcUaCollector;
    @Resource
    private HttpTagCollector httpTagCollector;
    @Autowired
    private OpcDACollector opcDACollector;
    @Resource
    private HttpCollectorForZxzk httpCollectorForZxzk;
@@ -62,74 +64,43 @@
            return result;
        }
        List<String[]> opcuaTagIds = new ArrayList<>();
        List<String[]> opcUaTagIds = new ArrayList<>();
        List<String[]> opcDaTagIds = new ArrayList<>();
        List<String[]> modbusTagIds = new ArrayList<>();
        List<String[]> kioTagIds = new ArrayList<>();
        List<String[]> httpTagZxzk = new ArrayList<>();
        List<String> tagYearPeiIds = new ArrayList<>();
        List<String> tagCurrentPerformanceIds = new ArrayList<>();
        List<String> tagCurrentSaleIds = new ArrayList<>();
        List<String> tagPrdTimeDistIds = new ArrayList<>();
        dtos.stream().forEach(item -> {
            if (DataSourceType.OPCUA.getCode().equals(item.getSourceType())) {
                opcuaTagIds.add(new String[]{item.getSourceId(), item.getTagNo()});
                opcUaTagIds.add(new String[]{item.getSourceId(), item.getTagNo()});
            } else if (DataSourceType.OPCDA.getCode().equals(item.getSourceType())) {
                opcDaTagIds.add(new String[]{item.getSourceId(), item.getTagNo()});
            } else if (DataSourceType.ModBus.getCode().equals(item.getSourceType())) {
                modbusTagIds.add(new String[]{item.getSourceId(), item.getTagNo()});
            } else if (DataSourceType.KIO.getCode().equals(item.getSourceType())) {
                kioTagIds.add(new String[]{item.getSourceId(), item.getTagNo()});
            } else if (DataSourceType.HTTP.getCode().equals(item.getSourceType())) {
                if (CommonConstant.YEAR_PEI_HTTP_TAG.equals(item.getSourceId())) {
                    tagYearPeiIds.add(item.getTagNo());
                } else if (CommonConstant.CURRENT_PERFORMANCE_HTTP_TAG.equals(item.getSourceId())) {
                    tagCurrentPerformanceIds.add(item.getTagNo());
                } else if (CommonConstant.CURRENT_SALE_HTTP_TAG.equals(item.getSourceId())) {
                    tagCurrentSaleIds.add(item.getTagNo());
                } else if (CommonConstant.PRD_TIME_DIST_HTTP_TAG.equals(item.getSourceId())) {
                    tagPrdTimeDistIds.add(item.getTagNo());
                } else if (CommonConstant.HTTP_API_ZXZK_IH.equals(item.getSourceName())) {
                    httpTagZxzk.add(new String[]{item.getSourceId(), item.getTagNo()});
                }
            }
        });
        if (!CollectionUtils.isEmpty(opcuaTagIds)) {
            Map<String, Object> tagValues = opcUaCollector.getTagValues(opcuaTagIds);
            this.toCommonResult(collectTime, dtos, tagValues, dataMap, result);
        Map<String, Object> tagValues = new HashMap<>();
        if (!CollectionUtils.isEmpty(opcUaTagIds)) {
            tagValues.putAll(opcUaCollector.getTagValues(opcUaTagIds));
        }
        if (!CollectionUtils.isEmpty(opcDaTagIds)) {
            tagValues.putAll(opcDACollector.getTagValues(modbusTagIds));
        }
        if (!CollectionUtils.isEmpty(modbusTagIds)) {
            Map<String, Object> tagValues = modBusCollector.getTagValues(modbusTagIds);
            this.toCommonResult(collectTime, dtos, tagValues, dataMap, result);
            tagValues.putAll(modBusCollector.getTagValues(modbusTagIds));
        }
        if (!CollectionUtils.isEmpty(kioTagIds)) {
            Map<String, Object> tagValues = kingIOCollector.getTagValues(kioTagIds);
            this.toCommonResult(collectTime, dtos, tagValues, dataMap, result);
            tagValues.putAll(kingIOCollector.getTagValues(kioTagIds));
        }
        if (!CollectionUtils.isEmpty(httpTagZxzk)) {
            Map<String, Object> tagValues = httpCollectorForZxzk.getTagValues(httpTagZxzk);
            this.toCommonResult(collectTime, dtos, tagValues, dataMap, result);
        }
        if (!CollectionUtils.isEmpty(tagYearPeiIds)) {
            Map<String, Object> tagValues = httpTagCollector.collect(CommonConstant.YEAR_PEI_HTTP_TAG, tagYearPeiIds);
            this.toCommonResult(collectTime, dtos, tagValues, dataMap, result);
        } else if (!CollectionUtils.isEmpty(tagCurrentPerformanceIds)) {
            Map<String, Object> tagValues = httpTagCollector.collect(CommonConstant.CURRENT_PERFORMANCE_HTTP_TAG, tagCurrentPerformanceIds);
            this.toCommonResult(collectTime, dtos, tagValues, dataMap, result);
        } else if (!CollectionUtils.isEmpty(tagCurrentSaleIds)) {
            Map<String, Object> tagValues = httpTagCollector.collect(CommonConstant.CURRENT_SALE_HTTP_TAG, tagCurrentSaleIds);
            this.toCommonResult(collectTime, dtos, tagValues, dataMap, result);
        } else if (!CollectionUtils.isEmpty(tagPrdTimeDistIds)) {
            Map<String, Object> tagValues = httpTagCollector.collect(CommonConstant.PRD_TIME_DIST_HTTP_TAG, tagPrdTimeDistIds);
            this.toCommonResult(collectTime, dtos, tagValues, dataMap, result);
        }
            tagValues.putAll(httpCollectorForZxzk.getTagValues(httpTagZxzk));
        }
        this.toCommonResult(collectTime, dtos, tagValues, dataMap, result);
        log.info("测量点处理结束");
        return result;
    }