潘志宝
2024-09-03 f7e880deb0612ba5efe96e6ce229abd8c19bc6e7
Merge remote-tracking branch 'origin/master'
已修改38个文件
已重命名15个文件
已删除14个文件
已添加35个文件
4137 ■■■■ 文件已修改
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/api/controller/DataController.java 43 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/http/collector/HttpCollectorForZxzk.java 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/http/controller/admin/HttpApiController.java 88 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/http/controller/admin/HttpTagController.java 69 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/http/controller/admin/HttpTokenController.java 74 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/http/controller/package-info.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/http/dao/HttpApiDao.java 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/http/dao/HttpTagDao.java 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/http/dao/HttpTokenDao.java 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/http/dto/HttpTagDTO.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/http/dto/TagAffectDetailsJsonDto.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/http/dto/TagCommonCurrentDto.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/http/dto/TagCurrentPerformanceJsonDto.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/http/dto/TagCurrentSaleJsonDto.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/http/dto/TagJsonDto.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/http/dto/TagPrdTimeDistJsonDto.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/http/dto/TagYearPeiJsonDto.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/http/entity/EleLowTagEntity.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/http/entity/FxjyTagEntity.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/http/entity/HttpApiEntity.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/http/entity/HttpTagEntity.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/http/entity/HttpTokenEntity.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/http/entity/XSTTagEntity.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/http/service/HttpApiService.java 25 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/http/service/HttpTagService.java 26 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/http/service/HttpTokenService.java 27 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/http/service/impl/HttpApiServiceImpl.java 61 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/http/service/impl/HttpTagServiceImpl.java 76 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/http/service/impl/HttpTokenServiceImpl.java 98 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/http/vo/HttpApiPageReqVO.java 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/http/vo/HttpApiRespVO.java 63 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/http/vo/HttpTagPageReqVO.java 25 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/http/vo/HttpTagRespVO.java 47 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/http/vo/HttpTokenPageReqVO.java 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/http/vo/HttpTokenRespVO.java 71 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/kio/collector/KingIOCollector.java 16 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/kio/controller/admin/ChannelKioDeviceController.java 83 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/kio/controller/admin/ChannelKioTagController.java 83 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/kio/dao/ChannelKioDeviceDao.java 17 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/kio/dao/ChannelKioTagDao.java 18 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/kio/service/ChannelKioDeviceService.java 23 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/kio/service/ChannelKioTagService.java 28 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/kio/service/impl/ChannelKioDeviceServiceImpl.java 78 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/kio/service/impl/ChannelKioTagServiceImpl.java 82 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/kio/vo/KioDevicePageReqVO.java 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/kio/vo/KioDeviceRespVO.java 51 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/kio/vo/KioTagPageReqVO.java 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/kio/vo/KioTagRespVO.java 59 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/modbus/controller/admin/ChannelModbusTagController.java 113 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/modbus/dao/ChannelModBusTagDao.java 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/modbus/service/ChannelModbusTagService.java 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/modbus/service/impl/ChannelModbusTagServiceImpl.java 74 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/modbus/vo/ModBusTagPageReqVO.java 27 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/modbus/vo/ModBusTagRespVO.java 63 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/opcda/controller/ChannelOPCDADeviceController.java 74 ●●●●● 补丁 | 查看 | 原始文档 | 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 19 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/opcda/service/ChannelOPCDADeviceService.java 52 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/opcda/service/ChannelOPCDATagService.java 59 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/opcda/service/impl/ChannelOPCDADeviceServiceImpl.java 55 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/opcda/service/impl/ChannelOPCDATagServiceImpl.java 126 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/opcda/vo/OpcDaDevicePageReqVO.java 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/opcda/vo/OpcDaDeviceRespVO.java 55 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/opcda/vo/OpcDaTagPageReqVO.java 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/opcda/vo/OpcDaTagRespVO.java 51 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/opcua/controller/admin/ChannelOPCUADeviceController.java 111 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/opcua/controller/admin/ChannelOPCUATagController.java 119 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/opcua/dao/ChannelOPCUADeviceDao.java 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/opcua/dao/ChannelOPCUATagDao.java 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/opcua/service/ChannelOPCUADeviceService.java 56 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/opcua/service/ChannelOPCUATagService.java 51 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/opcua/service/impl/ChannelOPCUADeviceServiceImpl.java 62 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/opcua/service/impl/ChannelOPCUATagServiceImpl.java 74 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/opcua/vo/OpcUaDevicePageReqVO.java 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/opcua/vo/OpcUaDeviceRespVO.java 63 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/opcua/vo/OpcUaTagPageReqVO.java 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/opcua/vo/OpcUaTagRespVO.java 55 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/tag/controller/TagController.java 16 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/http/controller/admin/HttpApiController.java 82 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/http/controller/admin/HttpTagController.java 103 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/http/controller/admin/HttpTokenController.java 96 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/http/controller/package-info.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/http/dao/HttpApiDao.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/http/dao/HttpTagDao.java 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/http/dao/HttpTokenDao.java 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/http/service/HttpApiService.java 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/http/service/HttpTagService.java 28 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/http/service/HttpTokenService.java 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/http/service/impl/HttpApiServiceImpl.java 57 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/http/service/impl/HttpTagServiceImpl.java 88 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/http/service/impl/HttpTokenServiceImpl.java 79 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/point/collection/PointCollector.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/point/collection/handler/MeasureHandle.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/point/controller/admin/DaPointController.java 101 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/point/dao/DaPointDao.java 18 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/point/service/DaPointService.java 27 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/point/service/impl/DaPointServiceImpl.java 69 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/point/vo/DaPointPageReqVO.java 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/point/vo/DaPointRespVO.java 88 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-biz/src/main/resources/mapper/http/HttpTagDao.xml 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pom.xml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/api/controller/DataController.java
@@ -5,6 +5,8 @@
import com.iailab.module.data.api.dto.IndexQueryDTO;
import com.iailab.module.data.api.dto.echarts.BarLineDTO;
import com.iailab.module.data.api.dto.echarts.SeriesItem;
import com.iailab.module.data.channel.kio.entity.ChannelKioDeviceEntity;
import com.iailab.module.data.common.utils.Constant;
import com.iailab.module.data.common.utils.R;
import com.iailab.module.data.api.dto.ApiPointValueQueryDTO;
import com.iailab.module.data.point.collection.PointCollector;
@@ -30,6 +32,9 @@
import java.math.BigDecimal;
import java.util.*;
import java.util.stream.Collectors;
import static com.iailab.framework.common.pojo.CommonResult.success;
import static com.iailab.framework.common.pojo.CommonResult.error;
/**
 * @author PanZhibao
@@ -62,13 +67,13 @@
    @PostMapping("/point/history")
    @Operation(summary = "point历史数据")
    public R pointHistory(HttpServletResponse response, HttpServletRequest
    public CommonResult<Map<String, List<Map<String, Object>>>> pointHistory(HttpServletResponse response, HttpServletRequest
            request, @RequestBody ApiPointValueQueryDTO queryDto) {
        try {
            apiSecurityUtils.validate(request);
            Map<String, List<Map<String, Object>>> data = new HashMap<>();
            if (CollectionUtils.isEmpty(queryDto.getPointNos())) {
                return R.ok().put("data", data);
                return success(data);
            }
            if (queryDto.getStart() == null) {
                queryDto.setStart(new Date());
@@ -80,7 +85,7 @@
            params.put("pointNos", queryDto.getPointNos());
            List<DaPointDTO> pointList = daPointService.list(params);
            if (CollectionUtils.isEmpty(pointList)) {
                return R.ok().put("data", data);
                return success(data);
            }
            List<InfluxPointValuePOJO> influxParams = pointList.stream().map(item -> {
                InfluxPointValuePOJO pojo = new InfluxPointValuePOJO();
@@ -89,23 +94,23 @@
                return pojo;
            }).collect(Collectors.toList());
            data = influxDBService.queryPointsValues(influxParams, queryDto.getStart(), queryDto.getEnd());
            return R.ok().put("data", data);
            return success(data);
        } catch (Exception ex) {
            return R.error(ex.getMessage());
            return new CommonResult<Map<String, List<Map<String, Object>>>>().setMsg(ex.getMessage());
        }
    }
    @PostMapping("/point/current")
    @Operation(summary = "point当前实时数据")
    public R pointCurrent(HttpServletResponse response, HttpServletRequest
    public CommonResult<Map<String, Object>> pointCurrent(HttpServletResponse response, HttpServletRequest
            request, @RequestBody List<String> pointNos) {
        try {
            // apiSecurityUtils.validate(request);
            Map<String, Object> data = pointCollector.getCurrentValue(pointNos);
            return R.ok().put("data", data);
            return success(data);
        } catch (Exception ex) {
            return R.error(ex.getMessage());
            return new CommonResult<Map<String, Object>>().setMsg(ex.getMessage());
        }
    }
@@ -166,12 +171,12 @@
    @PostMapping("/pointRelation/history")
    @Operation(summary = "pointRelation历史数据")
    public R pointRelationHistory(HttpServletResponse response, HttpServletRequest
    public CommonResult<Map<String, List<Map<String, Object>>>> pointRelationHistory(HttpServletResponse response, HttpServletRequest
            request, @RequestBody ApiPointValueQueryDTO queryDto) {
        try {
            Map<String, List<Map<String, Object>>> data = new HashMap<>();
            if (CollectionUtils.isEmpty(queryDto.getPointNos())) {
                return R.ok().put("data", data);
                return success(data);
            }
            if (queryDto.getStart() == null) {
                queryDto.setStart(new Date());
@@ -181,11 +186,11 @@
            }
            data = daPointValueService.getHistoryList(queryDto);
            if (CollectionUtils.isEmpty(data)) {
                return R.ok().put("data", data);
                return success(data);
            }
            return R.ok().put("data", data);
            return success(data);
        } catch (Exception ex) {
            return R.error(ex.getMessage());
            return new CommonResult<Map<String, List<Map<String, Object>>>>().setMsg(ex.getMessage());
        }
    }
@@ -210,20 +215,20 @@
    @PostMapping("/ind-item/values")
    @Operation(summary = "point当前实时数据")
    public R indItemValues(HttpServletResponse response, HttpServletRequest
    public CommonResult<Map<String, List<IndItemValueDTO>>> indItemValues(HttpServletResponse response, HttpServletRequest
            request, @RequestBody List<String> itemNos) {
        try {
            // apiSecurityUtils.validate(request);
            Map<String, List<IndItemValueDTO>> data = indItemCollector.getValueList(itemNos);
            return R.ok().put("data", data);
            return success(data);
        } catch (Exception ex) {
            return R.error(ex.getMessage());
            return new CommonResult<Map<String, List<IndItemValueDTO>>>().setMsg(ex.getMessage());
        }
    }
    @PostMapping("/ind-item/current-value")
    @Operation(summary = "point当前实时数据")
    public R indItemCurrentValue(HttpServletResponse response, HttpServletRequest
    public CommonResult<Map<String, BigDecimal>> indItemCurrentValue(HttpServletResponse response, HttpServletRequest
            request, @RequestBody List<String> itemNos) {
        try {
            Map<String, BigDecimal> data = new HashMap<>();
@@ -232,9 +237,9 @@
            dataList.forEach((k, v) -> {
                data.put(k, CollectionUtils.isEmpty(v) ? null : v.get(0).getDataValue());
            });
            return R.ok().put("data", data);
            return success(data);
        } catch (Exception ex) {
            return R.error(ex.getMessage());
            return new CommonResult<Map<String, BigDecimal>>().setMsg(ex.getMessage());
        }
    }
}
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/http/collector/HttpCollectorForZxzk.java
文件名从 iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/http/collector/HttpCollectorForZxzk.java 修改
@@ -1,4 +1,4 @@
package com.iailab.module.data.http.collector;
package com.iailab.module.data.channel.http.collector;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
@@ -7,8 +7,8 @@
import com.iailab.module.data.common.enums.DataSourceType;
import com.iailab.module.data.common.utils.HttpsRequest;
import com.iailab.module.data.common.utils.TagUtils;
import com.iailab.module.data.http.entity.HttpApiEntity;
import com.iailab.module.data.http.service.HttpApiService;
import com.iailab.module.data.channel.http.entity.HttpApiEntity;
import com.iailab.module.data.channel.http.service.HttpApiService;
import lombok.extern.slf4j.Slf4j;
import javax.annotation.Resource;
import org.springframework.stereotype.Component;
@@ -57,7 +57,7 @@
        if (apiMap.containsKey(id)) {
            return apiMap.get(id);
        }
        HttpApiEntity httpApi = httpApiService.get(id);
        HttpApiEntity httpApi = httpApiService.info(id);
        apiMap.put(id, httpApi);
        return httpApi;
    }
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/http/controller/admin/HttpApiController.java
对比新文件
@@ -0,0 +1,88 @@
package com.iailab.module.data.channel.http.controller.admin;
import com.iailab.framework.common.pojo.CommonResult;
import com.iailab.framework.common.pojo.PageResult;
import com.iailab.framework.common.util.object.BeanUtils;
import com.iailab.module.data.channel.http.entity.HttpApiEntity;
import com.iailab.module.data.channel.http.service.HttpApiService;
import com.iailab.module.data.channel.http.vo.HttpApiPageReqVO;
import com.iailab.module.data.channel.http.vo.HttpApiRespVO;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.validation.Valid;
import java.util.List;
import java.util.UUID;
import static com.iailab.framework.common.pojo.CommonResult.success;
/**
 * @author lirm
 * @Description
 * @createTime 2024年08月27日
 */
@RestController
@RequestMapping("/data/channel/http/api")
public class HttpApiController {
    @Resource
    private HttpApiService httpApiService;
    @GetMapping("page")
    public CommonResult<PageResult<HttpApiRespVO>> page(@Valid HttpApiPageReqVO reqVO) {
        PageResult<HttpApiEntity> page = httpApiService.queryPage(reqVO);
        return success(BeanUtils.toBean(page, HttpApiRespVO.class));
    }
    @GetMapping("list")
    public CommonResult<List<HttpApiEntity>> list() {
        List<HttpApiEntity> list = httpApiService.list();
        return success(list);
    }
    /**
     * 根据id查询详情
     *
     * @param id
     */
    @GetMapping("/info/{id}")
    public CommonResult<HttpApiEntity> info(@PathVariable("id") String id){
        HttpApiEntity info= httpApiService.info(id);
        return success(info);
    }
    /**
     * 添加API
     *
     * @param httpApiEntity
     */
    @PostMapping("/add")
    public CommonResult<Boolean> add(@RequestBody HttpApiEntity httpApiEntity){
        String id = UUID.randomUUID().toString();
        httpApiEntity.setId(id);
        httpApiService.add(httpApiEntity);
        return success(true);
    }
    /**
     * 修改API
     *
     * @param httpApiEntity
     */
    @PutMapping("/update")
    public CommonResult<Boolean> update(@RequestBody HttpApiEntity httpApiEntity) {
        httpApiService.update(httpApiEntity);
        return success(true);
    }
    /**
     * 删除API
     *
     * @param id
     *
     */
    @DeleteMapping("/delete")
    public CommonResult<Boolean> delete(@RequestParam("id") String id) {
        httpApiService.delete(id);
        return success(true);
    }
}
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/http/controller/admin/HttpTagController.java
对比新文件
@@ -0,0 +1,69 @@
package com.iailab.module.data.channel.http.controller.admin;
import com.iailab.framework.common.pojo.CommonResult;
import com.iailab.framework.common.pojo.PageResult;
import com.iailab.framework.common.util.object.BeanUtils;
import com.iailab.module.data.channel.http.entity.HttpTagEntity;
import com.iailab.module.data.channel.http.service.HttpTagService;
import com.iailab.module.data.channel.http.vo.HttpTagPageReqVO;
import com.iailab.module.data.channel.http.vo.HttpTagRespVO;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.validation.Valid;
import java.util.List;
import java.util.UUID;
import static com.iailab.framework.common.pojo.CommonResult.success;
/**
 * @author lirm
 * @Description
 * @createTime 2024年08月27日
 */
@RestController
@RequestMapping("/data/http/tag")
public class HttpTagController {
    @Resource
    private HttpTagService tagService;
    @GetMapping("page")
    public CommonResult<PageResult<HttpTagRespVO>> page(@Valid HttpTagPageReqVO reqVO) {
        PageResult<HttpTagEntity> page = tagService.queryPage(reqVO);
        return success(BeanUtils.toBean(page, HttpTagRespVO.class));
    }
    @GetMapping("list")
    public CommonResult<List<HttpTagEntity>> list(){
        List<HttpTagEntity> list = tagService.list();
        return new CommonResult<List<HttpTagEntity>>().setData(list);
    }
    @GetMapping("/info/{id}")
    public CommonResult<HttpTagEntity> info(@PathVariable("id") String id){
        HttpTagEntity info= tagService.info(id);
        return success(info);
    }
    @PostMapping("/add")
    public CommonResult<Boolean> add(@RequestBody HttpTagEntity httpTagEntity){
        String id = UUID.randomUUID().toString();
        httpTagEntity.setId(id);
        tagService.add(httpTagEntity);
        return success(true);
    }
    @PutMapping("/update")
    public CommonResult<Boolean> update(@RequestBody HttpTagEntity httpTagEntity) {
        tagService.update(httpTagEntity);
        return success(true);
    }
    @DeleteMapping("/delete")
    public CommonResult<Boolean> delete(@RequestParam("id") String id) {
        tagService.delete(id);
        return success(true);
    }
}
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/http/controller/admin/HttpTokenController.java
对比新文件
@@ -0,0 +1,74 @@
package com.iailab.module.data.channel.http.controller.admin;
import com.iailab.framework.common.pojo.CommonResult;
import com.iailab.framework.common.pojo.PageResult;
import com.iailab.framework.common.util.object.BeanUtils;
import com.iailab.module.data.channel.http.entity.HttpTokenEntity;
import com.iailab.module.data.channel.http.service.HttpTokenService;
import com.iailab.module.data.channel.http.vo.HttpTokenPageReqVO;
import com.iailab.module.data.channel.http.vo.HttpTokenRespVO;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.validation.Valid;
import java.util.List;
import java.util.UUID;
import static com.iailab.framework.common.pojo.CommonResult.success;
/**
 * @author lirm
 * @Description
 * @createTime 2024年08月27日
 */
@RestController
@RequestMapping("/data/http/token")
public class HttpTokenController {
    @Resource
    private HttpTokenService httpTokenService;
    @GetMapping("page")
    public CommonResult<PageResult<HttpTokenRespVO>> page(@Valid HttpTokenPageReqVO reqVO) {
        PageResult<HttpTokenEntity> page = httpTokenService.queryPage(reqVO);
        return success(BeanUtils.toBean(page, HttpTokenRespVO.class));
    }
    @GetMapping("list")
    public CommonResult<List<HttpTokenEntity>> list(){
        List<HttpTokenEntity> list = httpTokenService.list();
        return new CommonResult<List<HttpTokenEntity>>().setData(list);
    }
    @GetMapping("/info/{id}")
    public CommonResult<HttpTokenEntity> info(@PathVariable("id") String id){
        HttpTokenEntity info= httpTokenService.info(id);
        return success(info);
    }
    @PostMapping("/add")
    public CommonResult<Boolean> add(@RequestBody HttpTokenEntity HttpTokenEntity){
        String id = UUID.randomUUID().toString();
        HttpTokenEntity.setId(id);
        httpTokenService.add(HttpTokenEntity);
        return success(true);
    }
    @PutMapping("/update")
    public CommonResult<Boolean> update(@RequestBody HttpTokenEntity HttpTokenEntity) {
        httpTokenService.update(HttpTokenEntity);
        return success(true);
    }
    @DeleteMapping("/delete")
    public CommonResult<Boolean> delete(@RequestParam("id") String id) {
        httpTokenService.delete(id);
        return success(true);
    }
    @GetMapping("/api-id/{apiId}")
    public CommonResult<HttpTokenEntity> apiId(@PathVariable("apiId") String apiId) {
        HttpTokenEntity info = httpTokenService.getByApiId(apiId);
        return success(info);
    }
}
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/http/controller/package-info.java
对比新文件
@@ -0,0 +1 @@
package com.iailab.module.data.channel.http.controller;
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/http/dao/HttpApiDao.java
对比新文件
@@ -0,0 +1,20 @@
package com.iailab.module.data.channel.http.dao;
import com.iailab.framework.common.pojo.PageResult;
import com.iailab.framework.mybatis.core.mapper.BaseMapperX;
import com.iailab.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.iailab.framework.tenant.core.db.dynamic.TenantDS;
import com.iailab.module.data.channel.http.entity.HttpApiEntity;
import com.iailab.module.data.channel.http.vo.HttpApiPageReqVO;
import org.apache.ibatis.annotations.Mapper;
@TenantDS
@Mapper
public interface HttpApiDao extends BaseMapperX<HttpApiEntity> {
    default PageResult<HttpApiEntity> selectPage(HttpApiPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<HttpApiEntity>()
                .likeIfPresent(HttpApiEntity::getCode, reqVO.getCode())
                .likeIfPresent(HttpApiEntity::getName, reqVO.getName())
                .orderByDesc(HttpApiEntity::getCreateTime));
    }
}
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/http/dao/HttpTagDao.java
对比新文件
@@ -0,0 +1,21 @@
package com.iailab.module.data.channel.http.dao;
import com.iailab.framework.common.pojo.PageResult;
import com.iailab.framework.mybatis.core.mapper.BaseMapperX;
import com.iailab.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.iailab.framework.tenant.core.db.dynamic.TenantDS;
import com.iailab.module.data.channel.http.entity.HttpTagEntity;
import com.iailab.module.data.channel.http.vo.HttpTagPageReqVO;
import org.apache.ibatis.annotations.Mapper;
@TenantDS
@Mapper
public interface HttpTagDao extends BaseMapperX<HttpTagEntity> {
    default PageResult<HttpTagEntity> selectPage(HttpTagPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<HttpTagEntity>()
                .likeIfPresent(HttpTagEntity::getTagType, reqVO.getTagType())
                .likeIfPresent(HttpTagEntity::getTagCode, reqVO.getTagCode())
                .likeIfPresent(HttpTagEntity::getTagName, reqVO.getTagName())
                .orderByDesc(HttpTagEntity::getCreateTime));
    }
}
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/http/dao/HttpTokenDao.java
对比新文件
@@ -0,0 +1,19 @@
package com.iailab.module.data.channel.http.dao;
import com.iailab.framework.common.pojo.PageResult;
import com.iailab.framework.mybatis.core.mapper.BaseMapperX;
import com.iailab.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.iailab.framework.tenant.core.db.dynamic.TenantDS;
import com.iailab.module.data.channel.http.entity.HttpTokenEntity;
import com.iailab.module.data.channel.http.vo.HttpTokenPageReqVO;
import org.apache.ibatis.annotations.Mapper;
@TenantDS
@Mapper
public interface HttpTokenDao extends BaseMapperX<HttpTokenEntity> {
    default PageResult<HttpTokenEntity> selectPage(HttpTokenPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<HttpTokenEntity>()
                .likeIfPresent(HttpTokenEntity::getClientId, reqVO.getClientId())
                .orderByDesc(HttpTokenEntity::getExpireTime));
    }
}
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/http/dto/HttpTagDTO.java
文件名从 iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/http/dto/HttpTagDTO.java 修改
@@ -1,4 +1,4 @@
package com.iailab.module.data.http.dto;
package com.iailab.module.data.channel.http.dto;
import lombok.Data;
import org.springframework.stereotype.Component;
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/http/dto/TagAffectDetailsJsonDto.java
文件名从 iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/http/dto/TagAffectDetailsJsonDto.java 修改
@@ -1,4 +1,4 @@
package com.iailab.module.data.http.dto;
package com.iailab.module.data.channel.http.dto;
import lombok.Data;
import org.springframework.stereotype.Component;
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/http/dto/TagCommonCurrentDto.java
文件名从 iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/http/dto/TagCommonCurrentDto.java 修改
@@ -1,4 +1,4 @@
package com.iailab.module.data.http.dto;
package com.iailab.module.data.channel.http.dto;
import lombok.Data;
import org.springframework.stereotype.Component;
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/http/dto/TagCurrentPerformanceJsonDto.java
文件名从 iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/http/dto/TagCurrentPerformanceJsonDto.java 修改
@@ -1,4 +1,4 @@
package com.iailab.module.data.http.dto;
package com.iailab.module.data.channel.http.dto;
import lombok.Data;
import org.springframework.stereotype.Component;
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/http/dto/TagCurrentSaleJsonDto.java
文件名从 iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/http/dto/TagCurrentSaleJsonDto.java 修改
@@ -1,4 +1,4 @@
package com.iailab.module.data.http.dto;
package com.iailab.module.data.channel.http.dto;
import lombok.Data;
import org.springframework.stereotype.Component;
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/http/dto/TagJsonDto.java
文件名从 iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/http/dto/TagJsonDto.java 修改
@@ -1,4 +1,4 @@
package com.iailab.module.data.http.dto;
package com.iailab.module.data.channel.http.dto;
import lombok.Data;
import org.springframework.stereotype.Component;
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/http/dto/TagPrdTimeDistJsonDto.java
文件名从 iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/http/dto/TagPrdTimeDistJsonDto.java 修改
@@ -1,4 +1,4 @@
package com.iailab.module.data.http.dto;
package com.iailab.module.data.channel.http.dto;
import lombok.Data;
import org.springframework.stereotype.Component;
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/http/dto/TagYearPeiJsonDto.java
文件名从 iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/http/dto/TagYearPeiJsonDto.java 修改
@@ -1,4 +1,4 @@
package com.iailab.module.data.http.dto;
package com.iailab.module.data.channel.http.dto;
import lombok.Data;
import org.springframework.stereotype.Component;
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/http/entity/EleLowTagEntity.java
文件名从 iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/http/entity/EleLowTagEntity.java 修改
@@ -1,4 +1,4 @@
package com.iailab.module.data.http.entity;
package com.iailab.module.data.channel.http.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/http/entity/FxjyTagEntity.java
文件名从 iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/http/entity/FxjyTagEntity.java 修改
@@ -1,4 +1,4 @@
package com.iailab.module.data.http.entity;
package com.iailab.module.data.channel.http.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/http/entity/HttpApiEntity.java
文件名从 iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/http/entity/HttpApiEntity.java 修改
@@ -1,4 +1,4 @@
package com.iailab.module.data.http.entity;
package com.iailab.module.data.channel.http.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/http/entity/HttpTagEntity.java
文件名从 iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/http/entity/HttpTagEntity.java 修改
@@ -1,4 +1,4 @@
package com.iailab.module.data.http.entity;
package com.iailab.module.data.channel.http.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/http/entity/HttpTokenEntity.java
文件名从 iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/http/entity/HttpTokenEntity.java 修改
@@ -1,4 +1,4 @@
package com.iailab.module.data.http.entity;
package com.iailab.module.data.channel.http.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/http/entity/XSTTagEntity.java
文件名从 iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/http/entity/XSTTagEntity.java 修改
@@ -1,4 +1,4 @@
package com.iailab.module.data.http.entity;
package com.iailab.module.data.channel.http.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/http/service/HttpApiService.java
对比新文件
@@ -0,0 +1,25 @@
package com.iailab.module.data.channel.http.service;
import com.iailab.framework.common.pojo.PageResult;
import com.iailab.module.data.channel.http.entity.HttpApiEntity;
import com.iailab.module.data.channel.http.vo.HttpApiPageReqVO;
import java.util.List;
public interface HttpApiService{
    PageResult<HttpApiEntity> queryPage(HttpApiPageReqVO reqVO);
    HttpApiEntity info(String id);
    void add(HttpApiEntity httpApiEntity);
    void update(HttpApiEntity httpApiEntity);
    void delete(String id);
    HttpApiEntity selectXstHttpTagApi();
    HttpApiEntity getByCode(String code);
    List<HttpApiEntity> list();
}
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/http/service/HttpTagService.java
对比新文件
@@ -0,0 +1,26 @@
package com.iailab.module.data.channel.http.service;
import com.iailab.framework.common.pojo.PageResult;
import com.iailab.module.data.channel.http.entity.HttpTagEntity;
import com.iailab.module.data.channel.http.vo.HttpTagPageReqVO;
import java.util.List;
import java.util.Map;
public interface HttpTagService{
    PageResult<HttpTagEntity> queryPage(HttpTagPageReqVO reqVO);
    HttpTagEntity info(String id);
    void add(HttpTagEntity httpTagEntity);
    void update(HttpTagEntity httpTagEntity);
    void delete(String id);
    List<HttpTagEntity> list();
    List<HttpTagEntity> selectList(Map<String, Object> params);
    List<HttpTagEntity> getByCode(String code);
}
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/http/service/HttpTokenService.java
对比新文件
@@ -0,0 +1,27 @@
package com.iailab.module.data.channel.http.service;
import com.iailab.framework.common.pojo.PageResult;
import com.iailab.module.data.channel.http.entity.HttpTokenEntity;
import com.iailab.module.data.channel.http.vo.HttpTokenPageReqVO;
import java.util.List;
public interface HttpTokenService{
    PageResult<HttpTokenEntity> queryPage(HttpTokenPageReqVO reqVO);
    HttpTokenEntity info(String id);
    void add(HttpTokenEntity httpTokenEntity);
    void update(HttpTokenEntity httpTokenEntity);
    void delete(String id);
    List<HttpTokenEntity> list();
    HttpTokenEntity getByApiId(String apiId);
    void updateToken(String clientId);
    String queryToken(String clientId);
}
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/http/service/impl/HttpApiServiceImpl.java
对比新文件
@@ -0,0 +1,61 @@
package com.iailab.module.data.channel.http.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.iailab.framework.common.pojo.PageResult;
import com.iailab.module.data.channel.http.dao.HttpApiDao;
import com.iailab.module.data.channel.http.entity.HttpApiEntity;
import com.iailab.module.data.channel.http.service.HttpApiService;
import com.iailab.module.data.channel.http.vo.HttpApiPageReqVO;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
@Service
public class HttpApiServiceImpl extends ServiceImpl<HttpApiDao, HttpApiEntity> implements HttpApiService {
    @Resource
    private HttpApiDao httpApiDao;
    @Override
    public PageResult<HttpApiEntity> queryPage(HttpApiPageReqVO reqVO) {
        return httpApiDao.selectPage(reqVO);
    }
    @Override
    public HttpApiEntity info(String id) {
        return httpApiDao.selectById(id);
    }
    @Override
    public void add(HttpApiEntity httpApiEntity) {
        httpApiDao.insert(httpApiEntity);
    }
    @Override
    public void update(HttpApiEntity httpApiEntity) {
        httpApiDao.updateById(httpApiEntity);
    }
    @Override
    public void delete(String id) {
        httpApiDao.deleteById(id);
    }
    @Override
    public HttpApiEntity selectXstHttpTagApi() {
        return httpApiDao.selectOne(new QueryWrapper<HttpApiEntity>().eq("code","xstHttpTag"));
    }
    @Override
    public HttpApiEntity getByCode(String code) {
        return httpApiDao.selectOne(new QueryWrapper<HttpApiEntity>().eq("code", code));
    }
    @Override
    public List<HttpApiEntity> list() {
        return httpApiDao.selectList(new QueryWrapper<>());
    }
}
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/http/service/impl/HttpTagServiceImpl.java
对比新文件
@@ -0,0 +1,76 @@
package com.iailab.module.data.channel.http.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.iailab.framework.common.pojo.PageResult;
import com.iailab.module.data.channel.http.dao.HttpTagDao;
import com.iailab.module.data.channel.http.entity.HttpApiEntity;
import com.iailab.module.data.channel.http.entity.HttpTagEntity;
import com.iailab.module.data.channel.http.service.HttpApiService;
import com.iailab.module.data.channel.http.service.HttpTagService;
import com.iailab.module.data.channel.http.vo.HttpTagPageReqVO;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
import java.util.Map;
@Slf4j
@Service
public class HttpTagServiceImpl extends ServiceImpl<HttpTagDao, HttpTagEntity> implements HttpTagService {
    @Resource
    private HttpApiService httpApiService;
    @Resource
    private HttpTagDao httpTagDao;
    @Override
    public PageResult<HttpTagEntity> queryPage(HttpTagPageReqVO reqVO) {
        return httpTagDao.selectPage(reqVO);
    }
    @Override
    public HttpTagEntity info(String id) {
        return httpTagDao.selectById(id);
    }
    @Override
    public void add(HttpTagEntity httpTagEntity) {
        httpTagDao.insert(httpTagEntity);
    }
    @Override
    public void update(HttpTagEntity httpTagEntity) {
        httpTagDao.updateById(httpTagEntity);
    }
    @Override
    public void delete(String id) {
        httpTagDao.deleteById(id);
    }
    @Override
    public List<HttpTagEntity> list() {
        return httpTagDao.selectList(new QueryWrapper<>());
    }
    @Override
    public List<HttpTagEntity> selectList(Map<String, Object> params) {
        String httpId = (String) params.get("httpId");
        HttpApiEntity httpApiEntity = httpApiService.info(httpId);
        return httpTagDao.selectList(new QueryWrapper<HttpTagEntity>()
                        .eq("http_api_code", httpApiEntity.getCode())
                        .orderByDesc("create_time"));
    }
    @Override
    public List<HttpTagEntity> getByCode(String code) {
        return httpTagDao.selectList(new QueryWrapper<HttpTagEntity>()
                .eq("http_api_code", code)
                .orderByDesc("create_time"));
    }
}
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/http/service/impl/HttpTokenServiceImpl.java
对比新文件
@@ -0,0 +1,98 @@
package com.iailab.module.data.channel.http.service.impl;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.iailab.framework.common.pojo.PageResult;
import com.iailab.module.data.channel.http.dao.HttpTokenDao;
import com.iailab.module.data.channel.http.entity.HttpTokenEntity;
import com.iailab.module.data.channel.http.service.HttpTokenService;
import com.iailab.module.data.channel.http.vo.HttpTokenPageReqVO;
import com.iailab.module.data.common.utils.HttpsRequest;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@Service
public class HttpTokenServiceImpl extends ServiceImpl<HttpTokenDao, HttpTokenEntity> implements HttpTokenService {
    @Resource
    private HttpsRequest httpsRequest;
    @Resource
    private HttpTokenDao httpTokenDao;
    @Override
    public PageResult<HttpTokenEntity> queryPage(HttpTokenPageReqVO reqVO) {
        return httpTokenDao.selectPage(reqVO);
    }
    @Override
    public HttpTokenEntity info(String id) {
        return httpTokenDao.selectById(id);
    }
    @Override
    public void add(HttpTokenEntity httpTokenEntity) {
        httpTokenDao.insert(httpTokenEntity);
    }
    @Override
    public void update(HttpTokenEntity httpTokenEntity) {
        httpTokenDao.updateById(httpTokenEntity);
    }
    @Override
    public void delete(String id) {
        httpTokenDao.deleteById(id);
    }
    @Override
    public List<HttpTokenEntity> list() {
        return httpTokenDao.selectList(new QueryWrapper<>());
    }
    @Override
    public HttpTokenEntity getByApiId(String apiId) {
        QueryWrapper<HttpTokenEntity> wrapper = new QueryWrapper<>();
        wrapper.eq(StringUtils.isNotBlank(apiId), "api_id", apiId);
        return httpTokenDao.selectOne(wrapper);
    }
    @Override
    public void updateToken(String clientId) {
        Map<String, String> params = new HashMap<>(1);
        params.put("timeout", "30000");
        HttpTokenEntity entity = httpTokenDao.selectOne(new QueryWrapper<HttpTokenEntity>().eq("client_id", clientId));
        Map<String, String> dataJson = new HashMap<>(2);
        String url = entity.getLoginUrl();
        String userName = entity.getUsername();
        String password = entity.getPassword();
        String prvsetName = entity.getPrvsetName();
        String projectName = entity.getProjectName();
        String platform = entity.getPlatform();
        dataJson.put("username", userName);
        dataJson.put("password", password);
        dataJson.put("prvset_name", prvsetName);
        dataJson.put("project_name", projectName);
        dataJson.put("platform", platform);
        //查询token的请求
        String responseStr = httpsRequest.doPostToken(url, params, JSONObject.toJSONString(dataJson), "utf-8");
        //插入token和更新时间
        entity.setToken(responseStr);
        entity.setUpdateTime(new Date());
        httpTokenDao.update(entity, new QueryWrapper<HttpTokenEntity>().eq("client_id", clientId));
    }
    @Override
    public String queryToken(String clientId) {
        return httpTokenDao.selectOne(new QueryWrapper<HttpTokenEntity>().eq("client_id", clientId)).getToken();
    }
}
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/http/vo/HttpApiPageReqVO.java
对比新文件
@@ -0,0 +1,23 @@
package com.iailab.module.data.channel.http.vo;
import com.iailab.framework.common.pojo.PageParam;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
/**
 * @author lirm
 * @Description
 * @createTime 2024年08月26日
 */
@Schema(description = "数据平台 - HttpApi分页 Request VO")
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
public class HttpApiPageReqVO extends PageParam {
    private String name;
    private String code;
}
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/http/vo/HttpApiRespVO.java
对比新文件
@@ -0,0 +1,63 @@
package com.iailab.module.data.channel.http.vo;
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.util.Date;
/**
 * @author lirm
 * @Description
 * @createTime 2024年08月26日
 */
@Schema(description = "数据平台 - KioDevice Response VO")
@Data
@ExcelIgnoreUnannotated
public class HttpApiRespVO {
    @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
    @ExcelProperty("ID")
    private String id;
    @Schema(description = "", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
    @ExcelProperty("")
    private String name;
    @Schema(description = "", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
    @ExcelProperty("")
    private String code;
    @Schema(description = "", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
    @ExcelProperty("")
    private String url;
    @Schema(description = "", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
    @ExcelProperty("")
    private String method;
    @Schema(description = "", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
    @ExcelProperty("")
    private String collectType;
    @Schema(description = "", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
    @ExcelProperty("")
    private String param;
    @Schema(description = "", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
    @ExcelProperty("")
    private String descp;
    @Schema(description = "", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
    @ExcelProperty("")
    private Integer status;
    @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
    @ExcelProperty("创建时间")
    private Date createTime;
    @Schema(description = "更新时间", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
    @ExcelProperty("更新时间")
    private Date updateTime;
}
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/http/vo/HttpTagPageReqVO.java
对比新文件
@@ -0,0 +1,25 @@
package com.iailab.module.data.channel.http.vo;
import com.iailab.framework.common.pojo.PageParam;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
/**
 * @author lirm
 * @Description
 * @createTime 2024年08月26日
 */
@Schema(description = "数据平台 - HttpTag分页 Request VO")
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
public class HttpTagPageReqVO extends PageParam {
    private String tagType;
    private String tagCode;
    private String tagName;
}
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/http/vo/HttpTagRespVO.java
对比新文件
@@ -0,0 +1,47 @@
package com.iailab.module.data.channel.http.vo;
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.util.Date;
/**
 * @author lirm
 * @Description
 * @createTime 2024年08月26日
 */
@Schema(description = "数据平台 - KioDevice Response VO")
@Data
@ExcelIgnoreUnannotated
public class HttpTagRespVO {
    @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
    @ExcelProperty("ID")
    private String id;
    @Schema(description = "api编码", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
    @ExcelProperty("api编码")
    private String httpApiCode;
    @Schema(description = "测点类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
    @ExcelProperty("测点类型")
    private String tagType;
    @Schema(description = "测点编码", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
    @ExcelProperty("测点编码")
    private String tagCode;
    @Schema(description = "测点名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
    @ExcelProperty("测点名称")
    private String tagName;
    @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
    @ExcelProperty("创建时间")
    private Date createTime;
    @Schema(description = "更新时间", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
    @ExcelProperty("更新时间")
    private Date updateTime;
}
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/http/vo/HttpTokenPageReqVO.java
对比新文件
@@ -0,0 +1,22 @@
package com.iailab.module.data.channel.http.vo;
import com.iailab.framework.common.pojo.PageParam;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
/**
 * @author lirm
 * @Description
 * @createTime 2024年08月26日
 */
@Schema(description = "数据平台 - HttpToken分页 Request VO")
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
public class HttpTokenPageReqVO extends PageParam {
    private String clientId;
}
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/http/vo/HttpTokenRespVO.java
对比新文件
@@ -0,0 +1,71 @@
package com.iailab.module.data.channel.http.vo;
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.util.Date;
/**
 * @author lirm
 * @Description
 * @createTime 2024年08月26日
 */
@Schema(description = "数据平台 - KioDevice Response VO")
@Data
@ExcelIgnoreUnannotated
public class HttpTokenRespVO {
    @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
    @ExcelProperty("ID")
    private String id;
    @Schema(description = "", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
    @ExcelProperty("")
    private String apiId;
    @Schema(description = "", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
    @ExcelProperty("")
    private String loginUrl;
    @Schema(description = "", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
    @ExcelProperty("")
    private String clientId;
    @Schema(description = "", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
    @ExcelProperty("")
    private String clientSecret;
    @Schema(description = "", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
    @ExcelProperty("")
    private String username;
    @Schema(description = "", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
    @ExcelProperty("")
    private String password;
    @Schema(description = "", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
    @ExcelProperty("")
    private String token;
    @Schema(description = "", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
    @ExcelProperty("")
    private String prvsetName;
    @Schema(description = "", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
    @ExcelProperty("")
    private String projectName;
    @Schema(description = "", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
    @ExcelProperty("")
    private String platform;
    @Schema(description = "", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
    @ExcelProperty("")
    private Date expireTime;
    @Schema(description = "更新时间", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
    @ExcelProperty("更新时间")
    private Date updateTime;
}
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/kio/collector/KingIOCollector.java
@@ -1,14 +1,14 @@
package com.iailab.module.data.channel.kio.collector;
import com.iailab.module.data.channel.kio.entity.ChannelKioDeviceEntity;
import com.iailab.module.data.channel.kio.service.ChannelKioDeviceService;
import com.iailab.module.data.common.enums.DataSourceType;
import com.iailab.module.data.common.utils.TagUtils;
import com.iailab.module.data.channel.kio.dto.ChannelKioDeviceDTO;
import com.iailab.module.data.channel.kio.service.ChannelKioDeviceService;
import lombok.extern.slf4j.Slf4j;
import javax.annotation.Resource;
import org.springframework.stereotype.Component;
import org.springframework.util.CollectionUtils;
import javax.annotation.Resource;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.HashMap;
@@ -31,15 +31,15 @@
    private Map<String, KingIOClient> clientMap = new ConcurrentHashMap<>();
    private Map<String, ChannelKioDeviceDTO> deviceMap = new HashMap<>();
    private Map<String, ChannelKioDeviceEntity> deviceMap = new HashMap<>();
    public synchronized KingIOClient getClient(String sourceId) throws Exception {
        if (!clientMap.containsKey(sourceId)) {
            ChannelKioDeviceDTO deviceDto = channelKioDeviceService.get(sourceId);
            deviceMap.put(sourceId, deviceDto);
            KingIOClient kingIOClient = new KingIOClient(deviceDto.getInstanceName());
            ChannelKioDeviceEntity deviceEntity = channelKioDeviceService.info(sourceId);
            deviceMap.put(sourceId, deviceEntity);
            KingIOClient kingIOClient = new KingIOClient(deviceEntity.getInstanceName());
            clientMap.put(sourceId, kingIOClient);
            if (!kingIOClient.login(deviceDto.getAddress(), deviceDto.getPort(), deviceDto.getUsername(), deviceDto.getPassword())) {
            if (!kingIOClient.login(deviceEntity.getAddress(), deviceEntity.getPort(), deviceEntity.getUsername(), deviceEntity.getPassword())) {
                throw new Exception("登录异常");
            }
        }
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/kio/controller/admin/ChannelKioDeviceController.java
@@ -1,29 +1,28 @@
package com.iailab.module.data.channel.kio.controller.admin;
import com.iailab.framework.common.constant.Constant;
import com.iailab.framework.common.page.PageData;
import com.iailab.framework.common.pojo.CommonResult;
import com.iailab.framework.common.util.validation.ValidationUtils;
import com.iailab.framework.common.validation.group.AddGroup;
import com.iailab.framework.common.validation.group.DefaultGroup;
import com.iailab.module.data.channel.kio.service.ChannelKioDeviceService;
import com.iailab.framework.common.pojo.PageResult;
import com.iailab.framework.common.util.object.BeanUtils;
import com.iailab.module.data.channel.kio.dto.ChannelKioDeviceDTO;
import com.iailab.module.data.channel.kio.entity.ChannelKioDeviceEntity;
import com.iailab.module.data.channel.kio.service.ChannelKioDeviceService;
import com.iailab.module.data.channel.kio.vo.KioDevicePageReqVO;
import com.iailab.module.data.channel.kio.vo.KioDeviceRespVO;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Parameters;
import io.swagger.v3.oas.annotations.tags.Tag;
import javax.annotation.Resource;
import org.springframework.web.bind.annotation.*;
import java.util.Map;
import javax.annotation.Resource;
import javax.validation.Valid;
import java.util.Date;
import java.util.UUID;
import static com.iailab.framework.common.pojo.CommonResult.success;
/**
 * @author PanZhibao
 * @author lirm
 * @Description
 * @createTime 2024年06月04日
 * @createTime 2024年08月26日
 */
@RestController
@RequestMapping("/data/channel/kio/device")
@@ -34,53 +33,37 @@
    private ChannelKioDeviceService channelKioDeviceService;
    @GetMapping("page")
    @Operation(summary = "分页")
    @Parameters({
            @Parameter(name = Constant.PAGE, description = "当前页码,从1开始", required = true) ,
            @Parameter(name = Constant.LIMIT, description = "每页显示记录数", required = true) ,
            @Parameter(name = Constant.ORDER_FIELD, description = "排序字段") ,
            @Parameter(name = Constant.ORDER, description = "排序方式,可选值(asc、desc)")
    })
    public CommonResult<PageData<ChannelKioDeviceDTO>> list(@RequestParam Map<String, Object> params) {
        PageData<ChannelKioDeviceDTO> page = channelKioDeviceService.page(params);
        return success(page);
    public CommonResult<PageResult<KioDeviceRespVO>> list(@Valid KioDevicePageReqVO reqVO) {
        PageResult<ChannelKioDeviceEntity> page = channelKioDeviceService.queryPage(reqVO);
        return success(BeanUtils.toBean(page, KioDeviceRespVO.class));
    }
    @GetMapping("{id}")
    @GetMapping("/info/{id}")
    @Operation(summary = "信息")
    public CommonResult<ChannelKioDeviceDTO> get(@PathVariable("id") String id) {
        ChannelKioDeviceDTO data = channelKioDeviceService.get(id);
        return success(data);
    public CommonResult<ChannelKioDeviceEntity> info(@PathVariable("id") String id) {
        ChannelKioDeviceEntity info = channelKioDeviceService.info(id);
        return success(info);
    }
    @PostMapping
    @Operation(summary = "保存")
    public CommonResult save(@RequestBody ChannelKioDeviceDTO dto) {
        //效验数据
        ValidationUtils.validate(dto, AddGroup.class, DefaultGroup.class);
    @PostMapping("/add")
    public CommonResult<Boolean> add(@RequestBody ChannelKioDeviceEntity channelKioDeviceEntity) {
        String id = UUID.randomUUID().toString();
        dto.setId(id);
        channelKioDeviceService.save(dto);
        return new CommonResult();
        channelKioDeviceEntity.setId(id);
        channelKioDeviceEntity.setCreateTime(new Date());
        channelKioDeviceService.add(channelKioDeviceEntity);
        return success(true);
    }
    /**
     * 修改kio配置
     *
     */
    @PutMapping
    @Operation(summary = "修改")
    public CommonResult update(@RequestBody ChannelKioDeviceDTO dto) {
        //效验数据
        ValidationUtils.validate(dto, AddGroup.class, DefaultGroup.class);
        channelKioDeviceService.update(dto);
        return new CommonResult();
    @PutMapping("/update")
    public CommonResult<Boolean> update(@RequestBody ChannelKioDeviceEntity channelKioDeviceEntity) {
        channelKioDeviceEntity.setUpdateTime(new Date());
        channelKioDeviceService.update(channelKioDeviceEntity);
        return success(true);
    }
    @DeleteMapping
    @Operation(summary = "删除")
    public CommonResult delete(@RequestBody String[] ids){
        channelKioDeviceService.delete(ids);
        return new CommonResult();
    @DeleteMapping("/delete")
    public CommonResult<Boolean> delete(@RequestParam("id") String id) {
        channelKioDeviceService.delete(id);
        return success(true);
    }
}
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/kio/controller/admin/ChannelKioTagController.java
@@ -1,27 +1,24 @@
package com.iailab.module.data.channel.kio.controller.admin;
import com.iailab.framework.common.constant.Constant;
import com.iailab.framework.common.page.PageData;
import com.iailab.framework.common.pojo.CommonResult;
import com.iailab.framework.common.util.validation.ValidationUtils;
import com.iailab.framework.common.validation.group.AddGroup;
import com.iailab.framework.common.validation.group.DefaultGroup;
import com.iailab.module.data.channel.kio.dto.ChannelKioTagDTO;
import com.iailab.framework.common.pojo.PageResult;
import com.iailab.framework.common.util.object.BeanUtils;
import com.iailab.module.data.channel.kio.entity.ChannelKioTagEntity;
import com.iailab.module.data.channel.kio.service.ChannelKioTagService;
import com.iailab.module.data.channel.kio.vo.KioTagPageReqVO;
import com.iailab.module.data.channel.kio.vo.KioTagRespVO;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Parameters;
import javax.annotation.Resource;
import org.springframework.web.bind.annotation.*;
import java.util.Map;
import javax.annotation.Resource;
import javax.validation.Valid;
import java.util.Date;
import java.util.UUID;
import static com.iailab.framework.common.pojo.CommonResult.success;
/**
 * 操作opcua tag配置
 *
 * @author DongYukun
 * @createTime 2023年05月6日 17:44:00
 */
@RestController
@RequestMapping("/data/channel/kio/tag")
@@ -33,50 +30,38 @@
     * 分页查询tag
     * */
    @GetMapping("page")
    @Operation(summary = "分页")
    @Parameters({
            @Parameter(name = Constant.PAGE, description = "当前页码,从1开始", required = true) ,
            @Parameter(name = Constant.LIMIT, description = "每页显示记录数", required = true) ,
            @Parameter(name = Constant.ORDER_FIELD, description = "排序字段") ,
            @Parameter(name = Constant.ORDER, description = "排序方式,可选值(asc、desc)")
    })
    public CommonResult<PageData<ChannelKioTagDTO>> page(@RequestParam Map<String, Object> params){
        PageData<ChannelKioTagDTO> page = channelKioTagService.page(params);
        return  new CommonResult<PageData<ChannelKioTagDTO>>().setData(page);
    public CommonResult<PageResult<KioTagRespVO>> page(@Valid KioTagPageReqVO reqVO){
        PageResult<ChannelKioTagEntity> page = channelKioTagService.queryPage(reqVO);
        return success(BeanUtils.toBean(page, KioTagRespVO.class));
    }
    @GetMapping("{id}")
    @GetMapping("/info/{id}")
    @Operation(summary = "信息")
    public CommonResult<ChannelKioTagDTO> get(@PathVariable("id") String id){
        ChannelKioTagDTO data= channelKioTagService.get(id);
        return new CommonResult<ChannelKioTagDTO>().setData(data);
    public CommonResult<ChannelKioTagEntity> info(@PathVariable("id") String id) {
        ChannelKioTagEntity info = channelKioTagService.info(id);
        return success(info);
    }
    @PostMapping
    @Operation(summary = "保存")
    public CommonResult save(@RequestBody ChannelKioTagDTO entity){
        entity.setId(UUID.randomUUID().toString());
        channelKioTagService.save(entity);
        return new CommonResult();
    @PostMapping("/add")
    public CommonResult<Boolean> add(@RequestBody ChannelKioTagEntity channelKioTagEntity) {
        String id = UUID.randomUUID().toString();
        channelKioTagEntity.setId(id);
        channelKioTagEntity.setCreateTime(new Date());
        channelKioTagService.add(channelKioTagEntity);
        return success(true);
    }
    /**
     * 修改tag
     */
    @PutMapping
    @Operation(summary = "修改")
    public CommonResult update(@RequestBody ChannelKioTagDTO dto) {
        //效验数据
        ValidationUtils.validate(dto, AddGroup.class, DefaultGroup.class);
        channelKioTagService.update(dto);
        return new CommonResult();
    @PutMapping("/update")
    public CommonResult<Boolean> update(@RequestBody ChannelKioTagEntity channelKioTagEntity) {
        channelKioTagEntity.setUpdateTime(new Date());
        channelKioTagService.update(channelKioTagEntity);
        return success(true);
    }
    @DeleteMapping
    @Operation(summary = "删除")
    public CommonResult tagDelete(@RequestBody String[] ids) {
        channelKioTagService.delete(ids);
        return new CommonResult();
    @DeleteMapping("/delete")
    public CommonResult<Boolean> delete(@RequestParam("id") String id) {
        channelKioTagService.delete(id);
        return success(true);
    }
}
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/kio/dao/ChannelKioDeviceDao.java
@@ -1,16 +1,25 @@
package com.iailab.module.data.channel.kio.dao;
import com.iailab.framework.common.dao.BaseDao;
import com.iailab.framework.common.pojo.PageResult;
import com.iailab.framework.mybatis.core.mapper.BaseMapperX;
import com.iailab.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.iailab.framework.tenant.core.db.dynamic.TenantDS;
import com.iailab.module.data.channel.kio.entity.ChannelKioDeviceEntity;
import com.iailab.module.data.channel.kio.vo.KioDevicePageReqVO;
import org.apache.ibatis.annotations.Mapper;
/**
 * @author PanZhibao
 * @author lirm
 * @Description
 * @createTime 2024年06月04日
 * @createTime 2024年08月26日
 */
@TenantDS
@Mapper
public interface ChannelKioDeviceDao extends BaseDao<ChannelKioDeviceEntity> {
public interface ChannelKioDeviceDao extends BaseMapperX<ChannelKioDeviceEntity> {
    default PageResult<ChannelKioDeviceEntity> selectPage(KioDevicePageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<ChannelKioDeviceEntity>()
                .likeIfPresent(ChannelKioDeviceEntity::getInstanceName, reqVO.getInstanceName())
                .orderByDesc(ChannelKioDeviceEntity::getCreateTime));
    }
}
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/kio/dao/ChannelKioTagDao.java
@@ -1,16 +1,28 @@
package com.iailab.module.data.channel.kio.dao;
import com.iailab.framework.common.dao.BaseDao;
import com.iailab.framework.common.pojo.PageResult;
import com.iailab.framework.mybatis.core.mapper.BaseMapperX;
import com.iailab.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.iailab.framework.tenant.core.db.dynamic.TenantDS;
import com.iailab.module.data.channel.kio.entity.ChannelKioTagEntity;
import com.iailab.module.data.channel.kio.entity.ChannelKioTagEntity;
import com.iailab.module.data.channel.kio.vo.KioDevicePageReqVO;
import com.iailab.module.data.channel.kio.vo.KioTagPageReqVO;
import org.apache.ibatis.annotations.Mapper;
/**
 * @author PanZhibao
 * @author lirm
 * @Description
 * @createTime 2024年06月05日
 * @createTime 2024年08月26日
 */
@TenantDS
@Mapper
public interface ChannelKioTagDao extends BaseDao<ChannelKioTagEntity> {
public interface ChannelKioTagDao extends BaseMapperX<ChannelKioTagEntity> {
    default PageResult<ChannelKioTagEntity> selectPage(KioTagPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<ChannelKioTagEntity>()
                .likeIfPresent(ChannelKioTagEntity::getTagName, reqVO.getTagName())
                .likeIfPresent(ChannelKioTagEntity::getDevice, reqVO.getDevice())
                .orderByDesc(ChannelKioTagEntity::getCreateTime));
    }
}
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/kio/service/ChannelKioDeviceService.java
@@ -1,29 +1,30 @@
package com.iailab.module.data.channel.kio.service;
import com.iailab.framework.common.page.PageData;
import com.iailab.framework.common.service.BaseService;
import com.iailab.framework.common.pojo.PageResult;
import com.iailab.module.data.channel.kio.dto.ChannelKioDeviceDTO;
import com.iailab.module.data.channel.kio.entity.ChannelKioDeviceEntity;
import com.iailab.module.data.channel.kio.vo.KioDevicePageReqVO;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
 * @author PanZhibao
 * @author lirm
 * @Description
 * @createTime 2024年06月04日
 * @createTime 2024年08月26日
 */
public interface ChannelKioDeviceService extends BaseService<ChannelKioDeviceEntity> {
public interface ChannelKioDeviceService{
    PageData<ChannelKioDeviceDTO> page(Map<String, Object> params);
    PageResult<ChannelKioDeviceEntity> queryPage(KioDevicePageReqVO reqVO);
    List<ChannelKioDeviceDTO> list(Map<String, Object> params);
    ChannelKioDeviceEntity info(String id);
    ChannelKioDeviceDTO get(String id);
    void add(ChannelKioDeviceEntity channelKioDeviceEntity);
    void save(ChannelKioDeviceDTO dto);
    void update(ChannelKioDeviceEntity channelKioDeviceEntity);
    void update(ChannelKioDeviceDTO dto);
    void delete(String id);
    void delete(String[] ids);
    List<ChannelKioDeviceEntity> list(Map<String, Object> params);
}
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/kio/service/ChannelKioTagService.java
@@ -1,33 +1,31 @@
package com.iailab.module.data.channel.kio.service;
import com.iailab.framework.common.page.PageData;
import com.iailab.framework.common.service.BaseService;
import com.iailab.module.data.channel.kio.dto.ChannelKioTagDTO;
import com.iailab.framework.common.pojo.PageResult;
import com.iailab.module.data.channel.kio.entity.ChannelKioTagEntity;
import com.iailab.module.data.channel.kio.vo.KioTagPageReqVO;
import java.util.List;
import java.util.Map;
/**
 * @author PanZhibao
 * @author lirm
 * @Description
 * @createTime 2024年06月05日
 * @createTime 2024年08月26日
 */
public interface ChannelKioTagService extends BaseService<ChannelKioTagEntity> {
public interface ChannelKioTagService {
    PageData<ChannelKioTagDTO> page(Map<String, Object> params);
    PageResult<ChannelKioTagEntity> queryPage(KioTagPageReqVO reqVO);
    ChannelKioTagDTO get(String id);
    ChannelKioTagEntity info(String id);
    void save(ChannelKioTagDTO dto);
    void add(ChannelKioTagEntity channelKioTagEntity);
    void update(ChannelKioTagDTO dto);
    void update(ChannelKioTagEntity channelKioTagEntity);
    void delete(String[] ids);
    List<ChannelKioTagDTO> getByDevice(String instanceName);
    void delete(String id);
    ChannelKioTagDTO getByTagName(String tagName);
    List<ChannelKioTagEntity> getByDevice(String device);
    ChannelKioTagEntity getByTagName(String tagName);
    void deleteByDeviceName(String name);
}
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/kio/service/impl/ChannelKioDeviceServiceImpl.java
@@ -1,83 +1,69 @@
package com.iailab.module.data.channel.kio.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.iailab.framework.common.constant.Constant;
import com.iailab.framework.common.page.PageData;
import com.iailab.framework.common.service.impl.BaseServiceImpl;
import com.iailab.framework.common.util.object.ConvertUtils;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.iailab.framework.common.pojo.PageResult;
import com.iailab.module.data.channel.kio.service.ChannelKioTagService;
import com.iailab.module.data.channel.kio.dao.ChannelKioDeviceDao;
import com.iailab.module.data.channel.kio.dto.ChannelKioDeviceDTO;
import com.iailab.module.data.channel.kio.entity.ChannelKioDeviceEntity;
import com.iailab.module.data.channel.kio.service.ChannelKioDeviceService;
import com.iailab.module.data.channel.kio.service.ChannelKioTagService;
import org.apache.commons.lang3.StringUtils;
import javax.annotation.Resource;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.iailab.module.data.channel.kio.vo.KioDevicePageReqVO;
import java.util.Arrays;
import javax.annotation.Resource;
import com.iailab.module.data.channel.modbus.entity.ChannelModBusDeviceEntity;
import org.springframework.stereotype.Service;
import java.util.Date;
import java.util.List;
import java.util.Map;
/**
 * @author PanZhibao
 * @author lirm
 * @Description
 * @createTime 2024年06月04日
 * @createTime 2024年08月26日
 */
@Service
public class ChannelKioDeviceServiceImpl extends BaseServiceImpl<ChannelKioDeviceDao, ChannelKioDeviceEntity> implements ChannelKioDeviceService {
public class ChannelKioDeviceServiceImpl extends ServiceImpl<ChannelKioDeviceDao, ChannelKioDeviceEntity> implements ChannelKioDeviceService {
    @Resource
    private ChannelKioDeviceDao channelKioDeviceDao;
    @Resource
    ChannelKioTagService channelKioTagService;
    @Override
    public PageData<ChannelKioDeviceDTO> page(Map<String, Object> params) {
        IPage<ChannelKioDeviceEntity> page = baseDao.selectPage(
                getPage(params, Constant.CREATE_TIME, false),
                getWrapper(params)
        );
        return getPageData(page, ChannelKioDeviceDTO.class);
    public PageResult<ChannelKioDeviceEntity> queryPage(KioDevicePageReqVO reqVO) {
        return channelKioDeviceDao.selectPage(reqVO);
    }
    @Override
    public List<ChannelKioDeviceDTO> list(Map<String, Object> params) {
        List<ChannelKioDeviceEntity> list = baseDao.selectList(getWrapper(params));
        return ConvertUtils.sourceToTarget(list, ChannelKioDeviceDTO.class);
    }
    private QueryWrapper<ChannelKioDeviceEntity> getWrapper(Map<String, Object> params){
        String instanceName = (String)params.get("instanceName");
        QueryWrapper<ChannelKioDeviceEntity> wrapper = new QueryWrapper<>();
        wrapper.like(StringUtils.isNotBlank(instanceName), "instance_name", instanceName);
        return wrapper;
    public ChannelKioDeviceEntity info(String id) {
        return channelKioDeviceDao.selectById(id);
    }
    @Override
    public ChannelKioDeviceDTO get(String id) {
        ChannelKioDeviceEntity entity = baseDao.selectById(id);
        return ConvertUtils.sourceToTarget(entity, ChannelKioDeviceDTO.class);
    public void add(ChannelKioDeviceEntity channelKioDeviceEntity) {
        channelKioDeviceDao.insert(channelKioDeviceEntity);
    }
    @Override
    public void save(ChannelKioDeviceDTO dto) {
        ChannelKioDeviceEntity entity = ConvertUtils.sourceToTarget(dto, ChannelKioDeviceEntity.class);
        insert(entity);
    public void update(ChannelKioDeviceEntity channelKioDeviceEntity) {
        channelKioDeviceDao.updateById(channelKioDeviceEntity);
    }
    @Override
    public void update(ChannelKioDeviceDTO dto) {
        ChannelKioDeviceEntity entity = ConvertUtils.sourceToTarget(dto, ChannelKioDeviceEntity.class);
        updateById(entity);
    public void delete(String id) {
        //先删除device下的tag
        channelKioTagService.deleteByDeviceName(info(id).getInstanceName());
        channelKioDeviceDao.deleteById(id);
    }
    @Override
    @Transactional(rollbackFor = Exception.class)
    public void delete(String[] ids) {
        Arrays.asList(ids).forEach(id -> {
            channelKioTagService.deleteByDeviceName(get(id).getInstanceName());
        });
        baseDao.deleteBatchIds(Arrays.asList(ids));
    public List<ChannelKioDeviceEntity> list(Map<String, Object> params) {
        return channelKioDeviceDao.selectList(new QueryWrapper<ChannelKioDeviceEntity>().orderByAsc("instance_name"));
    }
}
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/kio/service/impl/ChannelKioTagServiceImpl.java
@@ -1,106 +1,74 @@
package com.iailab.module.data.channel.kio.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.iailab.framework.common.constant.Constant;
import com.iailab.framework.common.page.PageData;
import com.iailab.framework.common.service.impl.BaseServiceImpl;
import com.iailab.framework.common.util.object.ConvertUtils;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.iailab.framework.common.pojo.PageResult;
import com.iailab.module.data.channel.kio.dao.ChannelKioTagDao;
import com.iailab.module.data.channel.kio.dto.ChannelKioTagDTO;
import com.iailab.module.data.channel.kio.entity.ChannelKioTagEntity;
import com.iailab.module.data.channel.kio.service.ChannelKioTagService;
import com.iailab.module.data.channel.kio.vo.KioTagPageReqVO;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
import java.util.Map;
/**
 * @author PanZhibao
 * @author lirm
 * @Description
 * @createTime 2024年06月05日
 * @createTime 2024年08月26日
 */
@Slf4j
@Service
public class ChannelKioTagServiceImpl extends BaseServiceImpl<ChannelKioTagDao, ChannelKioTagEntity> implements ChannelKioTagService {
public class ChannelKioTagServiceImpl extends ServiceImpl<ChannelKioTagDao, ChannelKioTagEntity> implements ChannelKioTagService {
    @Resource
    private ChannelKioTagDao channelKioTagDao;
    @Value("${iems.upload-dir}")
    private String uploadDir;
    @Override
    public PageData<ChannelKioTagDTO> page(Map<String, Object> params) {
        IPage<ChannelKioTagEntity> page = baseDao.selectPage(
                getPage(params, Constant.CREATE_TIME, false),
                getWrapper(params)
        );
        return getPageData(page, ChannelKioTagDTO.class);
    public PageResult<ChannelKioTagEntity> queryPage(KioTagPageReqVO reqVO) {
        return channelKioTagDao.selectPage(reqVO);
    }
    @Override
    public ChannelKioTagDTO get(String id) {
        ChannelKioTagEntity entity = baseDao.selectById(id);
        return ConvertUtils.sourceToTarget(entity, ChannelKioTagDTO.class);
    public ChannelKioTagEntity info(String id) {
        return channelKioTagDao.selectById(id);
    }
    @Override
    public void save(ChannelKioTagDTO dto) {
        ChannelKioTagEntity entity = ConvertUtils.sourceToTarget(dto, ChannelKioTagEntity.class);
        entity.setCreateTime(new Date());
        entity.setUpdateTime(new Date());
        insert(entity);
    public void add(ChannelKioTagEntity channelKioTagEntity) {
        channelKioTagDao.insert(channelKioTagEntity);
    }
    @Override
    public void update(ChannelKioTagDTO dto) {
        ChannelKioTagEntity entity = ConvertUtils.sourceToTarget(dto, ChannelKioTagEntity.class);
        entity.setUpdateTime(new Date());
        updateById(entity);
    public void update(ChannelKioTagEntity channelKioTagEntity) {
        channelKioTagDao.updateById(channelKioTagEntity);
    }
    @Override
    public void delete(String[] ids) {
        baseDao.deleteBatchIds(Arrays.asList(ids));
    public void delete(String id) {
        channelKioTagDao.deleteById(id);
    }
    @Override
    public List<ChannelKioTagDTO> getByDevice(String device) {
    public List<ChannelKioTagEntity> getByDevice(String device) {
        QueryWrapper<ChannelKioTagEntity> wrapper = new QueryWrapper<>();
        wrapper.like(StringUtils.isNotBlank(device), "device", device)
        .orderByAsc("tag_id");
        List<ChannelKioTagEntity> list = baseDao.selectList(wrapper);
        return ConvertUtils.sourceToTarget(list, ChannelKioTagDTO.class);
        wrapper.like("device", device);
        wrapper.orderByAsc("tag_id");
        List<ChannelKioTagEntity> list = channelKioTagDao.selectList(wrapper);
        return list;
    }
    @Override
    public ChannelKioTagDTO getByTagName(String tagName) {
    public ChannelKioTagEntity getByTagName(String tagName) {
        QueryWrapper<ChannelKioTagEntity> wrapper = new QueryWrapper<>();
        wrapper.eq("tag_name", tagName);
        ChannelKioTagEntity entity = baseDao.selectOne(wrapper);
        return ConvertUtils.sourceToTarget(entity, ChannelKioTagDTO.class);
        ChannelKioTagEntity entity = channelKioTagDao.selectOne(wrapper);
        return entity;
    }
    @Override
    public void deleteByDeviceName(String name) {
        baseDao.delete(new QueryWrapper<ChannelKioTagEntity>().eq("device",name));
        channelKioTagDao.delete(new QueryWrapper<ChannelKioTagEntity>().eq("device",name));
    }
    private QueryWrapper<ChannelKioTagEntity> getWrapper(Map<String, Object> params){
        String tagName = (String) params.get("tagName");
        String device = (String) params.get("device");
        QueryWrapper<ChannelKioTagEntity> wrapper = new QueryWrapper<>();
        wrapper.eq(StringUtils.isNotBlank(device), "device", device);
        wrapper.like(StringUtils.isNotBlank(tagName), "tag_name", tagName);
        wrapper.orderByDesc("create_time");
        return wrapper;
    }
}
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/kio/vo/KioDevicePageReqVO.java
对比新文件
@@ -0,0 +1,21 @@
package com.iailab.module.data.channel.kio.vo;
import com.iailab.framework.common.pojo.PageParam;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
/**
 * @author lirm
 * @Description
 * @createTime 2024年08月26日
 */
@Schema(description = "数据平台 - Kio分页 Request VO")
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
public class KioDevicePageReqVO extends PageParam {
    private String instanceName;
}
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/kio/vo/KioDeviceRespVO.java
对比新文件
@@ -0,0 +1,51 @@
package com.iailab.module.data.channel.kio.vo;
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.util.Date;
/**
 * @author lirm
 * @Description
 * @createTime 2024年08月26日
 */
@Schema(description = "数据平台 - KioDevice Response VO")
@Data
@ExcelIgnoreUnannotated
public class KioDeviceRespVO {
    @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
    @ExcelProperty("ID")
    private String id;
    @Schema(description = "实例名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
    @ExcelProperty("实例名称")
    private String instanceName;
    @Schema(description = "IP地址", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
    @ExcelProperty("IP地址")
    private String address;
    @Schema(description = "端口", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
    @ExcelProperty("端口")
    private Integer port;
    @Schema(description = "用户名", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
    @ExcelProperty("用户名")
    private String username;
    @Schema(description = "密码", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
    @ExcelProperty("密码")
    private String password;
    @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
    @ExcelProperty("创建时间")
    private Date createTime;
    @Schema(description = "更新时间", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
    @ExcelProperty("更新时间")
    private Date updateTime;
}
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/kio/vo/KioTagPageReqVO.java
对比新文件
@@ -0,0 +1,23 @@
package com.iailab.module.data.channel.kio.vo;
import com.iailab.framework.common.pojo.PageParam;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
/**
 * @author lirm
 * @Description
 * @createTime 2024年08月26日
 */
@Schema(description = "数据平台 - Kio分页 Request VO")
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
public class KioTagPageReqVO extends PageParam {
    private String tagName;
    private String device;
}
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/kio/vo/KioTagRespVO.java
对比新文件
@@ -0,0 +1,59 @@
package com.iailab.module.data.channel.kio.vo;
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.util.Date;
/**
 * @author lirm
 * @Description
 * @createTime 2024年08月26日
 */
@Schema(description = "数据平台 - KioDevice Response VO")
@Data
@ExcelIgnoreUnannotated
public class KioTagRespVO {
    @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
    @ExcelProperty("ID")
    private String id;
    @Schema(description = "名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
    @ExcelProperty("名称")
    private String tagName;
    @Schema(description = "数据类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
    @ExcelProperty("数据类型")
    private String dataType;
    @Schema(description = "顺序号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
    @ExcelProperty("顺序号")
    private Integer tagId;
    @Schema(description = "测点描述", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
    @ExcelProperty("测点描述")
    private String tagDesc;
    @Schema(description = "是否可以tag", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
    @ExcelProperty("是否可以tag")
    private Boolean enabled;
    @Schema(description = "关联设备", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
    @ExcelProperty("关联设备")
    private String device;
    @Schema(description = "采集频率", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
    @ExcelProperty("采集频率")
    private Integer samplingRate;
    @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
    @ExcelProperty("创建时间")
    private Date createTime;
    @Schema(description = "更新时间", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
    @ExcelProperty("更新时间")
    private Date updateTime;
}
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/modbus/controller/admin/ChannelModbusTagController.java
@@ -1,100 +1,85 @@
package com.iailab.module.data.channel.modbus.controller.admin;
import cn.hutool.core.codec.Base64;
import com.iailab.module.data.common.utils.PageUtils;
import com.iailab.module.data.common.utils.R;
import com.iailab.framework.common.pojo.CommonResult;
import com.iailab.framework.common.pojo.PageResult;
import com.iailab.framework.common.util.object.BeanUtils;
import com.iailab.module.data.channel.modbus.entity.ChannelModBusTagEntity;
import com.iailab.module.data.channel.modbus.entity.ChannelModBusTagEntity;
import com.iailab.module.data.channel.modbus.service.ChannelModbusTagService;
import javax.annotation.Resource;
import com.iailab.module.data.channel.modbus.vo.ModBusTagPageReqVO;
import com.iailab.module.data.channel.modbus.vo.ModBusTagRespVO;
import org.springframework.web.bind.annotation.*;
import java.util.Map;
import javax.annotation.Resource;
import javax.validation.Valid;
import java.util.Date;
import java.util.UUID;
import static com.iailab.framework.common.pojo.CommonResult.success;
/**
 * 操作modbus tag配置
 *
 * @author DongYukun
 * @createTime 2023年04月25日 10:31:00
 * @author lirm
 * @Description
 * @createTime 2024年08月27日
 */
@RestController
@RequestMapping("/data/channel/modbus/tag")
public class ChannelModbusTagController {
    @Resource
    private ChannelModbusTagService channelModbusTagService;
    /**
     * 分页查询tag
     *
     * @param params
     */
    @GetMapping("/list")
    public R tagList(@RequestParam Map<String, Object> params){
        PageUtils page = channelModbusTagService.queryPage(params);
        return R.ok().put("page", page);
    @GetMapping("/page")
    public CommonResult<PageResult<ModBusTagRespVO>> list(@Valid ModBusTagPageReqVO reqVO) {
        PageResult<ChannelModBusTagEntity> page = channelModbusTagService.queryPage(reqVO);
        return success(BeanUtils.toBean(page, ModBusTagRespVO.class));
    }
    /**
     * 根据id查询tag详情
     * 根据id查询设备详情
     *
     * @param id
     */
    @GetMapping("/info/{id}")
    public R tagInfo(@PathVariable("id") String id){
        ChannelModBusTagEntity info= channelModbusTagService.info(Base64.decodeStr(id));
        return R.ok().put("data", info);
    }
    /**
     * 添加tag
     *
     * @param entity
     */
    @PostMapping("/add")
    public R tagAdd(@RequestBody ChannelModBusTagEntity entity){
        entity.setId(UUID.randomUUID().toString());
        channelModbusTagService.add(entity);
        return R.ok();
    public CommonResult<ChannelModBusTagEntity> info(@PathVariable("id") String id) {
        ChannelModBusTagEntity info = channelModbusTagService.info(id);
        return success(info);
    }
    /**
     * 修改tag
     * 添加设备
     *
     * @param channelModBusTagEntity
     */
    @PostMapping("/update")
    public R tagUpdate(@RequestBody ChannelModBusTagEntity channelModBusTagEntity) {
        channelModbusTagService.update(channelModBusTagEntity);
        return R.ok();
    @PostMapping("/add")
    public CommonResult<Boolean> add(@RequestBody ChannelModBusTagEntity channelModBusTagEntity) {
        String id = UUID.randomUUID().toString();
        channelModBusTagEntity.setId(id);
        channelModBusTagEntity.setCreateTime(new Date());
        channelModbusTagService.add(channelModBusTagEntity);
        return success(true);
    }
    /**
     * 删除tag
     * @param params
     * 修改设备
     *
     * @param channelModBusTagEntity
     */
    @PostMapping("/delete")
    public R tagDelete(@RequestBody Map<String, Object> params) {
        String id = (String)params.get("id");
        channelModbusTagService.delete(id);
        return R.ok();
    @PutMapping("/update")
    public CommonResult<Boolean> update(@RequestBody ChannelModBusTagEntity channelModBusTagEntity) {
        channelModBusTagEntity.setUpdateTime(new Date());
        channelModbusTagService.update(channelModBusTagEntity);
        return success(true);
    }
//    /**
//     * 导入
//     *
//     * @param device
//     * @param file
//     * @return
//     */
//    @PostMapping("/import/{device}")
//    public R importTag(@PathVariable("device") String device, @RequestParam("file") MultipartFile file) {
//        try {
//            if (file.isEmpty()) {
//                throw new RRException("上传文件不能为空");
//            }
//            channelModbusTagService.importTag(device, file);
//        } catch (Exception ex) {
//            return R.error(ex.getMessage());
//        }
//        return R.ok();
//    }
    /**
     * 删除设备
     *
     * @param id
     */
    @DeleteMapping("/delete")
    public CommonResult<Boolean> delete(@RequestParam("id") String id) {
        channelModbusTagService.delete(id);
        return success(true);
    }
}
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/modbus/dao/ChannelModBusTagDao.java
@@ -1,23 +1,31 @@
package com.iailab.module.data.channel.modbus.dao;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.iailab.framework.common.pojo.PageResult;
import com.iailab.framework.mybatis.core.mapper.BaseMapperX;
import com.iailab.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.iailab.framework.tenant.core.db.dynamic.TenantDS;
import com.iailab.module.data.channel.modbus.entity.ChannelModBusTagEntity;
import com.iailab.module.data.channel.modbus.vo.ModBusTagPageReqVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
 * @author DongYukun
 * @author lirm
 * @Description
 * @createTime 2023年04月25日 15:12:00
 * @createTime 2024年08月27日
 */
@TenantDS
@Mapper
public interface ChannelModBusTagDao extends BaseMapper<ChannelModBusTagEntity> {
public interface ChannelModBusTagDao extends BaseMapperX<ChannelModBusTagEntity> {
    void insertList(List<ChannelModBusTagEntity> list);
    String selectIdByName(@Param("name") String name);
    default PageResult<ChannelModBusTagEntity> selectPage(ModBusTagPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<ChannelModBusTagEntity>()
                .likeIfPresent(ChannelModBusTagEntity::getTagName, reqVO.getTagName())
                .likeIfPresent(ChannelModBusTagEntity::getAddress, reqVO.getAddress())
                .likeIfPresent(ChannelModBusTagEntity::getTagDesc, reqVO.getTagDesc())
                .likeIfPresent(ChannelModBusTagEntity::getDevice, reqVO.getDevice())
                .orderByDesc(ChannelModBusTagEntity::getCreateTime));
    }
}
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/modbus/service/ChannelModbusTagService.java
@@ -1,24 +1,24 @@
package com.iailab.module.data.channel.modbus.service;
import com.iailab.module.data.common.utils.PageUtils;
import com.iailab.framework.common.pojo.PageResult;
import com.iailab.module.data.channel.modbus.dto.ChannelModbusTagDTO;
import com.iailab.module.data.channel.modbus.entity.ChannelModBusTagEntity;
import com.iailab.module.data.channel.modbus.vo.ModBusTagPageReqVO;
import java.util.List;
import java.util.Map;
/**
 * @author DongYukun
 * @author lirm
 * @Description
 * @createTime 2023年05月08日 15:04:00
 * @createTime 2024年08月27日
 */
public interface ChannelModbusTagService {
    /**
     * 分页查询tag
     *
     * @param params
     * @param reqVO
     */
    PageUtils queryPage(Map<String, Object> params);
    PageResult queryPage(ModBusTagPageReqVO reqVO);
    
    /**
     * 查询tag详情
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/modbus/service/impl/ChannelModbusTagServiceImpl.java
@@ -1,28 +1,26 @@
package com.iailab.module.data.channel.modbus.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.module.data.common.utils.PageUtils;
import com.iailab.module.data.common.utils.Query;
import com.iailab.framework.common.pojo.PageResult;
import com.iailab.framework.common.util.object.ConvertUtils;
import com.iailab.module.data.channel.modbus.dto.ChannelModbusTagDTO;
import com.iailab.module.data.channel.modbus.dao.ChannelModBusTagDao;
import com.iailab.module.data.channel.modbus.dto.ChannelModbusTagDTO;
import com.iailab.module.data.channel.modbus.entity.ChannelModBusTagEntity;
import com.iailab.module.data.channel.modbus.service.ChannelModbusTagService;
import com.iailab.module.data.channel.modbus.vo.ModBusTagPageReqVO;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.Date;
import java.util.List;
import java.util.Map;
/**
 * @author DongYukun
 * @author lirm
 * @Description
 * @createTime 2023年05月08日 15:04:00
 * @createTime 2024年08月27日
 */
@Slf4j
@Service
@@ -33,65 +31,26 @@
    @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 address = (String) params.get("address");
        String tagDesc = (String) params.get("tagDesc");
        String device = (String) params.get("device");
        IPage<ChannelModBusTagEntity> page = this.page(
                new Query<ChannelModBusTagEntity>().getPage(params),
                new QueryWrapper<ChannelModBusTagEntity>()
                        .like(StringUtils.isNotBlank(tagName), "tag_name", tagName)
                        .like(StringUtils.isNotBlank(address), "address", address)
                        .like(StringUtils.isNotBlank(tagDesc), "tag_desc", tagDesc)
                        .eq(StringUtils.isNotBlank(device), "device", device)
                        .orderByDesc("create_time")
        );
        return new PageUtils(page);
    public PageResult<ChannelModBusTagEntity> queryPage(ModBusTagPageReqVO reqVO) {
        return channelModBusTagDao.selectPage(reqVO);
    }
    /**
     * 查询tag详情
     *
     * @param id
     */
    @Override
    public ChannelModBusTagEntity info(String id) {
        return channelModBusTagDao.selectById(id);
    }
    /**
     * 添加tag
     *
     * @param channelModBusTagEntity
     */
    @Override
    public void add(ChannelModBusTagEntity channelModBusTagEntity) {
        channelModBusTagDao.insert(channelModBusTagEntity);
    }
    /**
     * 修改tag
     *
     * @param channelModBusTagEntity
     */
    @Override
    public void update(ChannelModBusTagEntity channelModBusTagEntity) {
        channelModBusTagDao.updateById(channelModBusTagEntity);
    }
    /**
     * 删除tag
     *
     * @param id
     */
    @Override
    public void delete(String id) {
        channelModBusTagDao.deleteById(id);
@@ -105,11 +64,6 @@
        return channelModBusTagDao.selectList(queryWrapper);
    }
    /**
     * 查询全部
     *
     * @return
     */
    @Override
    public List<ChannelModbusTagDTO> selectAll() {
        List<ChannelModBusTagEntity> entityList = baseMapper.selectList(
@@ -118,28 +72,16 @@
        return ConvertUtils.sourceToTarget(entityList, ChannelModbusTagDTO.class);
    }
    /**
     * listByIds
     *
     * @param ids
     * @return
     */
    @Override
    public List<ChannelModBusTagEntity> listByIds(List<String> ids) {
        return baseMapper.selectList(new QueryWrapper<ChannelModBusTagEntity>().in("id", ids));
    }
    /**
     * deleteByDeviceName
     *
     * @param name
     */
    @Override
    public void deleteByDeviceName(String name) {
        baseMapper.delete(new QueryWrapper<ChannelModBusTagEntity>().eq("device", name));
    }
    //TODO 使用easyExcel重写
//    /**
//     * 导入Tag
//     *
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/modbus/vo/ModBusTagPageReqVO.java
对比新文件
@@ -0,0 +1,27 @@
package com.iailab.module.data.channel.modbus.vo;
import com.iailab.framework.common.pojo.PageParam;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
/**
 * @author PanZhibao
 * @Description
 * @createTime 2024年08月22日
 */
@Schema(description = "数据平台 - ModeBus分页 Request VO")
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
public class ModBusTagPageReqVO extends PageParam {
    private String tagName;
    private String address;
    private String tagDesc;
    private String device;
}
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/modbus/vo/ModBusTagRespVO.java
对比新文件
@@ -0,0 +1,63 @@
package com.iailab.module.data.channel.modbus.vo;
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.util.Date;
/**
 * @author lirm
 * @Description
 * @createTime 2024年08月27日
 */
@Schema(description = "数据平台 - ModBusDevice Response VO")
@Data
@ExcelIgnoreUnannotated
public class ModBusTagRespVO {
    @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
    @ExcelProperty("ID")
    private String id;
    @Schema(description = "tag名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
    @ExcelProperty("tag名称")
    private String tagName;
    @Schema(description = "数据类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
    @ExcelProperty("数据类型")
    private String dataType;
    @Schema(description = "是否启用", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
    @ExcelProperty("是否启用")
    private Boolean enabled;
    @Schema(description = "大小端", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
    @ExcelProperty("大小端")
    private String format;
    @Schema(description = "关联设备", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
    @ExcelProperty("关联设备")
    private String device;
    @Schema(description = "Modbus地址 00001 ~49999", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
    @ExcelProperty("Modbus地址")
    private String address;
    @Schema(description = "采集频率", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
    @ExcelProperty("采集频率")
    private Integer samplingRate;
    @Schema(description = "描述", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
    @ExcelProperty("描述")
    private String tagDesc;
    @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
    @ExcelProperty("创建时间")
    private Date createTime;
    @Schema(description = "更新时间", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
    @ExcelProperty("更新时间")
    private Date updateTime;
}
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/opcda/controller/ChannelOPCDADeviceController.java
@@ -1,86 +1,64 @@
package com.iailab.module.data.channel.opcda.controller;
import com.iailab.framework.common.pojo.CommonResult;
import com.iailab.framework.common.pojo.PageResult;
import com.iailab.framework.common.util.object.BeanUtils;
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 com.iailab.module.data.channel.opcda.vo.OpcDaDevicePageReqVO;
import com.iailab.module.data.channel.opcda.vo.OpcDaDeviceRespVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
import java.util.Date;
import java.util.Map;
import java.util.UUID;
import static com.iailab.framework.common.pojo.CommonResult.success;
/**
 * 操作opc ua配置
 *
 * @author DongYukun
 * @createTime 2023年04月26日 10:33:00
 * @author lirm
 * @Description
 * @createTime 2024年08月26日
 */
@RestController
@RequestMapping("/channel/opcda/device")
@RequestMapping("/data/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);
    @GetMapping("page")
    public CommonResult<PageResult<OpcDaDeviceRespVO>> list(@Valid OpcDaDevicePageReqVO reqVO) {
        PageResult<ChannelOPCDADeviceEntity> page = channelOPCDADeviceService.queryPage(reqVO);
        return success(BeanUtils.toBean(page, OpcDaDeviceRespVO.class));
    }
    /**
     * 根据id查询opc da配置详情
     *
     * @param id
     */
    @GetMapping("/info/{id}")
    public R info(@PathVariable("id") String id) {
    public CommonResult<ChannelOPCDADeviceEntity> info(@PathVariable("id") String id) {
        ChannelOPCDADeviceEntity info = channelOPCDADeviceService.info(id);
        return R.ok().put("data", info);
        return success(info);
    }
    /**
     * 添加opc ua配置
     *
     * @param channelOPCDADeviceEntity
     */
    @PostMapping("/add")
    public R add(@RequestBody ChannelOPCDADeviceEntity channelOPCDADeviceEntity) {
    public CommonResult<Boolean> add(@RequestBody ChannelOPCDADeviceEntity channelOPCDADeviceEntity) {
        String id = UUID.randomUUID().toString();
        channelOPCDADeviceEntity.setId(id);
        channelOPCDADeviceEntity.setCreateTime(new Date());
        channelOPCDADeviceService.add(channelOPCDADeviceEntity);
        return R.ok();
        return success(true);
    }
    /**
     * 修改opc ua配置
     *
     * @param channelOPCDADeviceEntity
     */
    @PostMapping("/update")
    public R update(@RequestBody ChannelOPCDADeviceEntity channelOPCDADeviceEntity) {
    @PutMapping("/update")
    public CommonResult<Boolean> update(@RequestBody ChannelOPCDADeviceEntity channelOPCDADeviceEntity) {
        channelOPCDADeviceEntity.setUpdateTime(new Date());
        channelOPCDADeviceService.update(channelOPCDADeviceEntity);
        return R.ok();
        return success(true);
    }
    /**
     * 删除opc ua配置
     *
     * @param params
     */
    @PostMapping("/delete")
    public R delete(@RequestBody Map<String, Object> params) {
        String id = (String) params.get("id");
    @DeleteMapping("/delete")
    public CommonResult<Boolean> delete(@RequestParam("id") String id) {
        channelOPCDADeviceService.delete(id);
        return R.ok();
        return success(true);
    }
}
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/opcda/controller/ChannelOPCDATagController.java
@@ -1,102 +1,78 @@
package com.iailab.module.data.channel.opcda.controller;
import com.iailab.framework.common.pojo.CommonResult;
import com.iailab.framework.common.pojo.PageResult;
import com.iailab.framework.common.util.object.BeanUtils;
import com.iailab.module.data.channel.opcda.entity.ChannelOPCDATagEntity;
import com.iailab.module.data.channel.opcda.service.ChannelOPCDATagService;
import com.iailab.module.data.channel.opcda.vo.OpcDaTagPageReqVO;
import com.iailab.module.data.channel.opcda.vo.OpcDaTagRespVO;
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 javax.validation.Valid;
import java.util.Date;
import java.util.UUID;
import static com.iailab.framework.common.pojo.CommonResult.success;
/**
 * 操作OPCDA tag配置
 *
 * @author DongYukun
 * @createTime 2023年05月6日 17:44:00
 * @author lirm
 * @Description
 * @createTime 2024年08月26日
 */
@RestController
@RequestMapping("/channel/opcda/tag")
@RequestMapping("/data/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);
    @GetMapping("page")
    public CommonResult<PageResult<OpcDaTagRespVO>> list(@Valid OpcDaTagPageReqVO reqVO) {
        PageResult<ChannelOPCDATagEntity> page = channelOPCDATagService.queryPage(reqVO);
        return success(BeanUtils.toBean(page, OpcDaTagRespVO.class));
    }
    /**
     * 根据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);
    public CommonResult<ChannelOPCDATagEntity> info(@PathVariable("id") String id) {
        ChannelOPCDATagEntity info = channelOPCDATagService.info(id);
        return success(info);
    }
    /**
     * 添加tag
     *
     * @param entity
     */
    @PostMapping("/add")
    public R tagAdd(@RequestBody ChannelOPCDATagEntity entity){
        entity.setId(UUID.randomUUID().toString());
        channelOPCDATagService.add(entity);
        return R.ok();
    public CommonResult<Boolean> add(@RequestBody ChannelOPCDATagEntity channelOPCDATagEntity) {
        String id = UUID.randomUUID().toString();
        channelOPCDATagEntity.setId(id);
        channelOPCDATagEntity.setCreateTime(new Date());
        channelOPCDATagService.add(channelOPCDATagEntity);
        return success(true);
    }
    /**
     * 修改tag
     *
     * @param channelOPCDATagEntity
     */
    @PostMapping("/update")
    public R tagUpdate(@RequestBody ChannelOPCDATagEntity channelOPCDATagEntity) {
    @PutMapping("/update")
    public CommonResult<Boolean> update(@RequestBody ChannelOPCDATagEntity channelOPCDATagEntity) {
        channelOPCDATagEntity.setUpdateTime(new Date());
        channelOPCDATagService.update(channelOPCDATagEntity);
        return R.ok();
        return success(true);
    }
    /**
     * 删除tag
     * @param params
     *
     */
    @PostMapping("/delete")
    public R tagDelete(@RequestBody Map<String, Object> params) {
        String id = (String)params.get("id");
    @DeleteMapping("/delete")
    public CommonResult<Boolean> delete(@RequestParam("id") String id) {
        channelOPCDATagService.delete(id);
        return R.ok();
        return success(true);
    }
    /**
     * 导入
     *
     * @param serverId
     * @param file
     * @return
     */
    @PostMapping("/import/{serverId}")
    public R importTag(@PathVariable("serverId") String serverId, @RequestParam("file") MultipartFile file) {
    public CommonResult<String> 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());
            ex.getMessage();
        }
        return R.ok();
        return success("上传成功");
    }
}
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/opcda/dao/ChannelOPCDADeviceDao.java
@@ -1,18 +1,26 @@
package com.iailab.module.data.channel.opcda.dao;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.iailab.framework.common.pojo.PageResult;
import com.iailab.framework.mybatis.core.mapper.BaseMapperX;
import com.iailab.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.iailab.framework.tenant.core.db.dynamic.TenantDS;
import com.iailab.module.data.channel.opcda.entity.ChannelOPCDADeviceEntity;
import com.iailab.module.data.channel.opcda.vo.OpcDaDevicePageReqVO;
import org.apache.ibatis.annotations.Mapper;
/**
 * @author PanZhibao
 * @author lirm
 * @Description
 * @createTime 2023年04月26日 11:31:00
 * @createTime 2024年08月26日
 */
@TenantDS
@Mapper
public interface ChannelOPCDADeviceDao extends BaseMapper<ChannelOPCDADeviceEntity> {
public interface ChannelOPCDADeviceDao extends BaseMapperX<ChannelOPCDADeviceEntity> {
    default PageResult<ChannelOPCDADeviceEntity> selectPage(OpcDaDevicePageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<ChannelOPCDADeviceEntity>()
                .likeIfPresent(ChannelOPCDADeviceEntity::getServerName, reqVO.getServerName())
                .orderByDesc(ChannelOPCDADeviceEntity::getCreateTime));
    }
}
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/opcda/dao/ChannelOPCDATagDao.java
@@ -1,16 +1,29 @@
package com.iailab.module.data.channel.opcda.dao;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.iailab.framework.common.pojo.PageResult;
import com.iailab.framework.mybatis.core.mapper.BaseMapperX;
import com.iailab.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.iailab.framework.tenant.core.db.dynamic.TenantDS;
import com.iailab.module.data.channel.opcda.entity.ChannelOPCDATagEntity;
import com.iailab.module.data.channel.opcda.entity.ChannelOPCDATagEntity;
import com.iailab.module.data.channel.opcda.vo.OpcDaDevicePageReqVO;
import com.iailab.module.data.channel.opcda.vo.OpcDaTagPageReqVO;
import org.apache.ibatis.annotations.Mapper;
/**
 * @author DongYukun
 * @author lirm
 * @Description
 * @createTime 2023年05月8日 15:01:00
 * @createTime 2024年08月26日
 */
@TenantDS
@Mapper
public interface ChannelOPCDATagDao extends BaseMapper<ChannelOPCDATagEntity> {
public interface ChannelOPCDATagDao extends BaseMapperX<ChannelOPCDATagEntity> {
    default PageResult<ChannelOPCDATagEntity> selectPage(OpcDaTagPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<ChannelOPCDATagEntity>()
                .likeIfPresent(ChannelOPCDATagEntity::getTagName, reqVO.getTagName())
                .likeIfPresent(ChannelOPCDATagEntity::getServerId, reqVO.getServerId())
                .orderByDesc(ChannelOPCDATagEntity::getCreateTime));
    }
}
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/opcda/service/ChannelOPCDADeviceService.java
@@ -1,60 +1,30 @@
package com.iailab.module.data.channel.opcda.service;
import com.iailab.framework.common.pojo.PageResult;
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.vo.OpcDaDevicePageReqVO;
import com.iailab.module.data.common.utils.PageUtils;
import java.util.List;
import java.util.Map;
/**
 * @author DongYukun
 * @author lirm
 * @Description
 * @createTime 2023年05月08日 15:04:00
 * @createTime 2024年08月26日
 */
public interface ChannelOPCDADeviceService {
    /**
     * 分页查询设备
     *
     * @param params
     */
    PageUtils queryPage(Map<String, Object> params);
    /**
     * 查询设备详情
     *
     * @param id
     */
    List<ChannelOPCDADeviceDTO> selectAll();
    PageResult<ChannelOPCDADeviceEntity> queryPage(OpcDaDevicePageReqVO reqVO);
    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
@@ -1,7 +1,9 @@
package com.iailab.module.data.channel.opcda.service;
import com.iailab.framework.common.pojo.PageResult;
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.vo.OpcDaTagPageReqVO;
import com.iailab.module.data.common.utils.PageUtils;
import org.springframework.web.multipart.MultipartFile;
@@ -9,62 +11,29 @@
import java.util.Map;
/**
 * @author DongYukun
 * @author lirm
 * @Description
 * @createTime 2023年05月08日 15:04:00
 * @createTime 2024年08月26日
 */
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;
    PageResult<ChannelOPCDATagEntity> queryPage(OpcDaTagPageReqVO reqVO);
    ChannelOPCDATagEntity info(String id);
    void add(ChannelOPCDATagEntity channelOPCDATagEntity);
    void update(ChannelOPCDATagEntity channelOPCDATagEntity);
    void delete(String id);
}
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/opcda/service/impl/ChannelOPCDADeviceServiceImpl.java
@@ -4,12 +4,14 @@
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.pojo.PageResult;
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.channel.opcda.vo.OpcDaDevicePageReqVO;
import com.iailab.module.data.common.utils.PageUtils;
import com.iailab.module.data.common.utils.Query;
import org.springframework.beans.factory.annotation.Autowired;
@@ -20,9 +22,9 @@
import java.util.Map;
/**
 * @author DongYukun
 * @author lirm
 * @Description
 * @createTime 2023年05月08日 15:04:00
 * @createTime 2024年08月26日
 */
@Service
public class ChannelOPCDADeviceServiceImpl extends ServiceImpl<ChannelOPCDADeviceDao, ChannelOPCDADeviceEntity> implements ChannelOPCDADeviceService {
@@ -31,70 +33,27 @@
    @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);
    @Override
    public PageResult<ChannelOPCDADeviceEntity> queryPage(OpcDaDevicePageReqVO reqVO) {
        return channelOPCDADeviceDao.selectPage(reqVO);
    }
    /**
     * 查询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) {
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/opcda/service/impl/ChannelOPCDATagServiceImpl.java
@@ -1,17 +1,15 @@
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.pojo.PageResult;
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 com.iailab.module.data.channel.opcda.vo.OpcDaTagPageReqVO;
import lombok.extern.slf4j.Slf4j;
import org.apache.poi.ss.usermodel.CellType;
import org.apache.poi.xssf.usermodel.XSSFRow;
@@ -27,13 +25,12 @@
import java.io.FileInputStream;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.UUID;
/**
 * @author DongYukun
 * @author lirm
 * @Description
 * @createTime 2023年05月08日 15:04:00
 * @createTime 2024年08月26日
 */
@Slf4j
@Service
@@ -44,34 +41,46 @@
    @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);
    @Override
    public PageResult<ChannelOPCDATagEntity> queryPage(OpcDaTagPageReqVO reqVO) {
        return channelOPCDATagDao.selectPage(reqVO);
    }
    /**
     * 查询tag详情
     *
     * @param id
     */
    @Override
    public ChannelOPCDATagEntity info(String id) {
        return channelOPCDATagDao.selectById(id);
    }
    @Override
    public void add(ChannelOPCDATagEntity channelOPCDATagEntity) {
        channelOPCDATagDao.insert(channelOPCDATagEntity);
    }
    @Override
    public void update(ChannelOPCDATagEntity channelOPCDATagEntity) {
        channelOPCDATagDao.updateById(channelOPCDATagEntity);
    }
    @Override
    public void delete(String id) {
        channelOPCDATagDao.deleteById(id);
    }
    @Override
    public List<ChannelOPCDATagDTO> selectAll() {
        List<ChannelOPCDATagEntity> entityList = channelOPCDATagDao.selectList(null);
        return ConvertUtils.sourceToTarget(entityList, ChannelOPCDATagDTO.class);
    }
    @Override
    public List<ChannelOPCDATagEntity> listByIds(List<String> ids) {
        return channelOPCDATagDao.selectList(new QueryWrapper<ChannelOPCDATagEntity>().in("id", ids));
    }
    @Override
    public void deleteByServerId(String serverId) {
        channelOPCDATagDao.delete(new QueryWrapper<ChannelOPCDATagEntity>().eq("server_id",serverId));
    }
    @Override
@@ -82,62 +91,6 @@
    }
    /**
     * 添加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 {
@@ -173,7 +126,7 @@
            //getBaseMapper().insertList(dangerList);
            dangerList.forEach(item -> {
                try {
                    getBaseMapper().insert(item);
                    channelOPCDATagDao.insert(item);
                } catch (Exception ex) {
                    log.warn("插入异常:" + item.getTagName());
                }
@@ -184,4 +137,5 @@
            throw ex;
        }
    }
}
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/opcda/vo/OpcDaDevicePageReqVO.java
对比新文件
@@ -0,0 +1,21 @@
package com.iailab.module.data.channel.opcda.vo;
import com.iailab.framework.common.pojo.PageParam;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
/**
 * @author lirm
 * @Description
 * @createTime 2024年08月26日
 */
@Schema(description = "数据平台 - opcda分页 Request VO")
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
public class OpcDaDevicePageReqVO extends PageParam {
    private String serverName;
}
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/opcda/vo/OpcDaDeviceRespVO.java
对比新文件
@@ -0,0 +1,55 @@
package com.iailab.module.data.channel.opcda.vo;
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.util.Date;
/**
 * @author lirm
 * @Description
 * @createTime 2024年08月26日
 */
@Schema(description = "数据平台 - opcdaDevice Response VO")
@Data
@ExcelIgnoreUnannotated
public class OpcDaDeviceRespVO {
    @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
    @ExcelProperty("ID")
    private String id;
    @Schema(description = "服务名", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
    @ExcelProperty("服务名")
    private String serverName;
    @Schema(description = "IP", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
    @ExcelProperty("IP")
    private String host;
    @Schema(description = "用户名", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
    @ExcelProperty("用户名")
    private String user;
    @Schema(description = "密码", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
    @ExcelProperty("密码")
    private String password;
    @Schema(description = "设备名", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
    @ExcelProperty("设备名")
    private String progId;
    @Schema(description = "设备注册表ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
    @ExcelProperty("设备注册表ID")
    private String clsId;
    @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
    @ExcelProperty("创建时间")
    private Date createTime;
    @Schema(description = "更新时间", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
    @ExcelProperty("更新时间")
    private Date updateTime;
}
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/opcda/vo/OpcDaTagPageReqVO.java
对比新文件
@@ -0,0 +1,23 @@
package com.iailab.module.data.channel.opcda.vo;
import com.iailab.framework.common.pojo.PageParam;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
/**
 * @author lirm
 * @Description
 * @createTime 2024年08月26日
 */
@Schema(description = "数据平台 - opcda分页 Request VO")
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
public class OpcDaTagPageReqVO extends PageParam {
    private String tagName;
    private String serverId;
}
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/opcda/vo/OpcDaTagRespVO.java
对比新文件
@@ -0,0 +1,51 @@
package com.iailab.module.data.channel.opcda.vo;
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.util.Date;
/**
 * @author lirm
 * @Description
 * @createTime 2024年08月26日
 */
@Schema(description = "数据平台 - opcdaTag Response VO")
@Data
@ExcelIgnoreUnannotated
public class OpcDaTagRespVO {
    @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
    @ExcelProperty("ID")
    private String id;
    @Schema(description = "服务ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
    @ExcelProperty("服务ID")
    private String serverId;
    @Schema(description = "tag名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
    @ExcelProperty("tag名称")
    private String tagName;
    @Schema(description = "数据类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
    @ExcelProperty("数据类型")
    private String dataType;
    @Schema(description = "是否启用", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
    @ExcelProperty("是否启用")
    private Boolean enabled;
    @Schema(description = "itemID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
    @ExcelProperty("itemID")
    private String itemId;
    @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
    @ExcelProperty("创建时间")
    private Date createTime;
    @Schema(description = "更新时间", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
    @ExcelProperty("更新时间")
    private Date updateTime;
}
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/opcua/controller/admin/ChannelOPCUADeviceController.java
@@ -1,23 +1,25 @@
package com.iailab.module.data.channel.opcua.controller.admin;
import com.iailab.module.data.common.utils.PageUtils;
import com.iailab.module.data.common.utils.R;
import com.iailab.framework.common.pojo.CommonResult;
import com.iailab.framework.common.pojo.PageResult;
import com.iailab.framework.common.util.object.BeanUtils;
import com.iailab.module.data.channel.opcua.entity.ChannelOPCUADeviceEntity;
import com.iailab.module.data.channel.opcua.service.ChannelOPCUADeviceService;
import javax.annotation.Resource;
import com.iailab.module.data.channel.opcua.vo.OpcUaDevicePageReqVO;
import com.iailab.module.data.channel.opcua.vo.OpcUaDeviceRespVO;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import java.io.File;
import java.io.IOException;
import java.util.Map;
import javax.annotation.Resource;
import javax.validation.Valid;
import java.util.UUID;
import static com.iailab.framework.common.pojo.CommonResult.success;
/**
 * 操作opc ua配置
 *
 * @author DongYukun
 * @createTime 2023年04月26日 10:33:00
 * @author lirm
 * @Description
 * @createTime 2024年08月26日
 */
@RestController
@RequestMapping("/data/channel/opcua/device")
@@ -25,84 +27,57 @@
    @Resource
    private ChannelOPCUADeviceService channelOPCUADeviceService;
    /**
     * 分页查询opc ua 配置
     *
     * @param params
     */
    @GetMapping("/list")
    public R list(@RequestParam Map<String, Object> params) {
        PageUtils page = channelOPCUADeviceService.queryPage(params);
        return R.ok().put("page", page);
    @GetMapping("page")
    public CommonResult<PageResult<OpcUaDeviceRespVO>> list(@Valid OpcUaDevicePageReqVO reqVO) {
        PageResult<ChannelOPCUADeviceEntity> page = channelOPCUADeviceService.queryPage(reqVO);
        return success(BeanUtils.toBean(page, OpcUaDeviceRespVO.class));
    }
    /**
     * 根据id查询opc ua配置详情
     *
     * @param id
     */
    @GetMapping("/info/{id}")
    public R info(@PathVariable("id") String id) {
    public CommonResult<ChannelOPCUADeviceEntity> info(@PathVariable("id") String id) {
        ChannelOPCUADeviceEntity info = channelOPCUADeviceService.info(id);
        return R.ok().put("data", info);
        return success(info);
    }
    /**
     * 添加opc ua配置
     *
     * @param channelOPCUADeviceEntity
     */
    @PostMapping("/add")
    public R add(@RequestBody ChannelOPCUADeviceEntity channelOPCUADeviceEntity) {
    public CommonResult<Boolean> add(@RequestBody ChannelOPCUADeviceEntity channelOPCUADeviceEntity) {
        String id = UUID.randomUUID().toString();
        channelOPCUADeviceEntity.setId(id);
        channelOPCUADeviceService.add(channelOPCUADeviceEntity);
        return R.ok();
        return success(true);
    }
    /**
     * 修改opc ua配置
     *
     * @param channelOPCUADeviceEntity
     */
    @PostMapping("/update")
    public R update(@RequestBody ChannelOPCUADeviceEntity channelOPCUADeviceEntity) {
    @PutMapping("/update")
    public CommonResult<Boolean> update(@RequestBody ChannelOPCUADeviceEntity channelOPCUADeviceEntity) {
        channelOPCUADeviceService.update(channelOPCUADeviceEntity);
        return R.ok();
        return success(true);
    }
    /**
     * 删除opc ua配置
     *
     * @param params
     */
    @PostMapping("/delete")
    public R delete(@RequestBody Map<String, Object> params) {
        String id = (String) params.get("id");
    @DeleteMapping("/delete")
    public CommonResult<Boolean> delete(@RequestParam("id") String id) {
        channelOPCUADeviceService.delete(id);
        return R.ok();
        return success(true);
    }
    /**
     * 上传安全证书
     *
     * @param file
     */
    @PostMapping("/upload")
    public R uploadFile(@RequestParam("file") MultipartFile file) {
        String fileName = file.getOriginalFilename();
        String filePath = "";
        try {
            File dir = new File(filePath);
            if (!dir.exists()) {
                dir.mkdirs();
            }
            File saveFile = new File(filePath + fileName);
            file.transferTo(saveFile);
            return R.ok().put("data",saveFile.getAbsolutePath());
        } catch (IOException e) {
            e.printStackTrace();
            return R.error();
        }
    }
//    @PostMapping("/upload")
//    public R uploadFile(@RequestParam("file") MultipartFile file) {
//        String fileName = file.getOriginalFilename();
//        String filePath = "";
//        try {
//            File dir = new File(filePath);
//            if (!dir.exists()) {
//                dir.mkdirs();
//            }
//            File saveFile = new File(filePath + fileName);
//            file.transferTo(saveFile);
//            return R.ok().put("data",saveFile.getAbsolutePath());
//        } catch (IOException e) {
//            e.printStackTrace();
//            return R.error();
//        }
//    }
}
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/opcua/controller/admin/ChannelOPCUATagController.java
@@ -1,102 +1,77 @@
package com.iailab.module.data.channel.opcua.controller.admin;
import cn.hutool.core.codec.Base64;
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 com.iailab.framework.common.pojo.CommonResult;
import com.iailab.framework.common.pojo.PageResult;
import com.iailab.framework.common.util.object.BeanUtils;
import com.iailab.module.data.channel.opcua.entity.ChannelOPCUATagEntity;
import com.iailab.module.data.channel.opcua.service.ChannelOPCUATagService;
import javax.annotation.Resource;
import com.iailab.module.data.channel.opcua.vo.OpcUaTagPageReqVO;
import com.iailab.module.data.channel.opcua.vo.OpcUaTagRespVO;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import java.util.Map;
import javax.annotation.Resource;
import javax.validation.Valid;
import java.util.Date;
import java.util.UUID;
import static com.iailab.framework.common.pojo.CommonResult.success;
/**
 * 操作opcua tag配置
 *
 * @author DongYukun
 * @createTime 2023年05月6日 17:44:00
 * @author lirm
 * @Description
 * @createTime 2024年08月26日
 */
@RestController
@RequestMapping("/data/channel/opcua/tag")
public class ChannelOPCUATagController {
    @Resource
    private ChannelOPCUATagService channelOpcuaTagService;
    /**
     * 分页查询tag
     *
     * @param params
     */
    @GetMapping("/list")
    public R tagList(@RequestParam Map<String, Object> params){
        PageUtils page = channelOpcuaTagService.queryPage(params);
        return R.ok().put("page", page);
    @GetMapping("page")
    public CommonResult<PageResult<OpcUaTagRespVO>> list(@Valid OpcUaTagPageReqVO reqVO) {
        PageResult<ChannelOPCUATagEntity> page = channelOpcuaTagService.queryPage(reqVO);
        return success(BeanUtils.toBean(page, OpcUaTagRespVO.class));
    }
    /**
     * 根据id查询tag详情
     *
     * @param id
     */
    @GetMapping("/info/{id}")
    public R tagInfo(@PathVariable("id") String id){
        ChannelOPCUATagEntity info= channelOpcuaTagService.info(Base64.decodeStr(id));
        return R.ok().put("data", info);
    public CommonResult<ChannelOPCUATagEntity> info(@PathVariable("id") String id) {
        ChannelOPCUATagEntity info = channelOpcuaTagService.info(id);
        return success(info);
    }
    /**
     * 添加tag
     *
     * @param entity
     */
    @PostMapping("/add")
    public R tagAdd(@RequestBody ChannelOPCUATagEntity entity){
        entity.setId(UUID.randomUUID().toString());
        channelOpcuaTagService.add(entity);
        return R.ok();
    public CommonResult<Boolean> add(@RequestBody ChannelOPCUATagEntity channelOPCUATagEntity) {
        String id = UUID.randomUUID().toString();
        channelOPCUATagEntity.setId(id);
        channelOPCUATagEntity.setCreateTime(new Date());
        channelOpcuaTagService.add(channelOPCUATagEntity);
        return success(true);
    }
    /**
     * 修改tag
     *
     * @param channelOPCUATagEntity
     */
    @PostMapping("/update")
    public R tagUpdate(@RequestBody ChannelOPCUATagEntity channelOPCUATagEntity) {
    @PutMapping("/update")
    public CommonResult<Boolean> update(@RequestBody ChannelOPCUATagEntity channelOPCUATagEntity) {
        channelOPCUATagEntity.setUpdateTime(new Date());
        channelOpcuaTagService.update(channelOPCUATagEntity);
        return R.ok();
        return success(true);
    }
    /**
     * 删除tag
     * @param params
     *
     */
    @PostMapping("/delete")
    public R tagDelete(@RequestBody Map<String, Object> params) {
        String id = (String)params.get("id");
    @DeleteMapping("/delete")
    public CommonResult<Boolean> delete(@RequestParam("id") String id) {
        channelOpcuaTagService.delete(id);
        return R.ok();
        return success(true);
    }
    /**
     * 导入
     *
     * @param device
     * @param file
     * @return
     */
    @PostMapping("/import/{device}")
    public R importTag(@PathVariable("device") String device, @RequestParam("file") MultipartFile file) {
        try {
            if (file.isEmpty()) {
                throw new RRException("上传文件不能为空");
            }
            channelOpcuaTagService.importTag(device, file);
        } catch (Exception ex) {
            return R.error(ex.getMessage());
        }
        return R.ok();
    }
//    @PostMapping("/import/{device}")
//    public R importTag(@PathVariable("device") String device, @RequestParam("file") MultipartFile file) {
//        try {
//            if (file.isEmpty()) {
//                throw new RRException("上传文件不能为空");
//            }
//            channelOpcuaTagService.importTag(device, 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/opcua/dao/ChannelOPCUADeviceDao.java
@@ -1,21 +1,25 @@
package com.iailab.module.data.channel.opcua.dao;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.iailab.framework.common.pojo.PageResult;
import com.iailab.framework.mybatis.core.mapper.BaseMapperX;
import com.iailab.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.iailab.framework.tenant.core.db.dynamic.TenantDS;
import com.iailab.module.data.channel.opcua.entity.ChannelOPCUADeviceEntity;
import com.iailab.module.data.channel.opcua.entity.ChannelOPCUADeviceEntity;
import com.iailab.module.data.channel.opcua.entity.ChannelOPCUADeviceEntity;
import com.iailab.module.data.channel.opcua.entity.ChannelOPCUADeviceEntity;
import com.iailab.module.data.channel.opcua.vo.OpcUaDevicePageReqVO;
import org.apache.ibatis.annotations.Mapper;
/**
 * @author PanZhibao
 * @author lirm
 * @Description
 * @createTime 2023年04月26日 11:31:00
 * @createTime 2024年08月26日
 */
@TenantDS
@Mapper
public interface ChannelOPCUADeviceDao extends BaseMapper<ChannelOPCUADeviceEntity> {
public interface ChannelOPCUADeviceDao extends BaseMapperX<ChannelOPCUADeviceEntity> {
    default PageResult<ChannelOPCUADeviceEntity> selectPage(OpcUaDevicePageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<ChannelOPCUADeviceEntity>()
                .likeIfPresent(ChannelOPCUADeviceEntity::getServerName, reqVO.getServerName()));
    }
}
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/opcua/dao/ChannelOPCUATagDao.java
@@ -1,19 +1,25 @@
package com.iailab.module.data.channel.opcua.dao;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.iailab.framework.common.pojo.PageResult;
import com.iailab.framework.mybatis.core.mapper.BaseMapperX;
import com.iailab.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.iailab.framework.tenant.core.db.dynamic.TenantDS;
import com.iailab.module.data.channel.opcua.entity.ChannelOPCUATagEntity;
import com.iailab.module.data.channel.opcua.entity.ChannelOPCUATagEntity;
import com.iailab.module.data.channel.opcua.entity.ChannelOPCUATagEntity;
import com.iailab.module.data.channel.opcua.entity.ChannelOPCUATagEntity;
import com.iailab.module.data.channel.opcua.vo.OpcUaTagPageReqVO;
import org.apache.ibatis.annotations.Mapper;
/**
 * @author DongYukun
 * @author lirm
 * @Description
 * @createTime 2023年05月8日 15:01:00
 * @createTime 2024年08月26日
 */
@TenantDS
@Mapper
public interface ChannelOPCUATagDao extends BaseMapper<ChannelOPCUATagEntity> {
public interface ChannelOPCUATagDao extends BaseMapperX<ChannelOPCUATagEntity> {
    default PageResult<ChannelOPCUATagEntity> selectPage(OpcUaTagPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<ChannelOPCUATagEntity>()
                .likeIfPresent(ChannelOPCUATagEntity::getTagName, reqVO.getTagName())
                .likeIfPresent(ChannelOPCUATagEntity::getDevice, reqVO.getDevice())
                .orderByDesc(ChannelOPCUATagEntity::getCreateTime));
    }
}
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/opcua/service/ChannelOPCUADeviceService.java
@@ -1,60 +1,32 @@
package com.iailab.module.data.channel.opcua.service;
import com.iailab.module.data.common.utils.PageUtils;
import com.iailab.module.data.channel.opcua.entity.ChannelOPCUADeviceEntity;
import com.iailab.framework.common.pojo.PageResult;
import com.iailab.module.data.channel.opcua.dto.ChannelOPCUADeviceDTO;
import com.iailab.module.data.channel.opcua.entity.ChannelOPCUADeviceEntity;
import com.iailab.module.data.channel.opcua.vo.OpcUaDevicePageReqVO;
import com.iailab.module.data.common.utils.PageUtils;
import java.util.List;
import java.util.Map;
/**
 * @author DongYukun
 * @author lirm
 * @Description
 * @createTime 2023年05月08日 15:04:00
 * @createTime 2024年08月26日
 */
public interface ChannelOPCUADeviceService {
    /**
     * 分页查询设备
     *
     * @param params
     */
    PageUtils queryPage(Map<String, Object> params);
    /**
     * 查询设备详情
     *
     * @param id
     */
    PageResult<ChannelOPCUADeviceEntity> queryPage(OpcUaDevicePageReqVO reqVO);
    ChannelOPCUADeviceEntity info(String id);
    /**
     * 列表
     *
     * @param params
     * @return
     */
    List<ChannelOPCUADeviceEntity> list(Map<String, Object> params);
    /**
     * 添加设备
     *
     * @param channelOPCUADeviceEntity
     */
    void add(ChannelOPCUADeviceEntity channelOPCUADeviceEntity);
    /**
     * 修改设备
     *
     * @param channelOPCUADeviceEntity
     */
    void update(ChannelOPCUADeviceEntity channelOPCUADeviceEntity);
    /**
     * 删除设备
     *
     * @param id
     */
    void delete(String id);
    /**
     * 查询全部设备
     *
     */
    List<ChannelOPCUADeviceDTO> selectAll();
    List<ChannelOPCUADeviceEntity> list(Map<String, Object> params);
}
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/opcua/service/ChannelOPCUATagService.java
@@ -1,70 +1,37 @@
package com.iailab.module.data.channel.opcua.service;
import com.iailab.module.data.common.utils.PageUtils;
import com.iailab.framework.common.pojo.PageResult;
import com.iailab.module.data.channel.opcua.dto.ChannelOPCUATagDTO;
import com.iailab.module.data.channel.opcua.entity.ChannelOPCUATagEntity;
import com.iailab.module.data.channel.opcua.vo.OpcUaTagPageReqVO;
import org.springframework.web.multipart.MultipartFile;
import java.util.List;
import java.util.Map;
/**
 * @author DongYukun
 * @author lirm
 * @Description
 * @createTime 2023年05月08日 15:04:00
 * @createTime 2024年08月26日
 */
public interface ChannelOPCUATagService {
    /**
     * 分页查询tag
     *
     * @param params
     */
    PageUtils queryPage(Map<String, Object> params);
    PageResult<ChannelOPCUATagEntity> queryPage(OpcUaTagPageReqVO reqVO);
    /**
     * 查询tag详情
     * @param id
     *
     */
    ChannelOPCUATagEntity info(String id);
    /**
     * 添加tag
     *
     * @param channelOPCUATagEntity
     */
    void add(ChannelOPCUATagEntity channelOPCUATagEntity);
    /**
     * 修改tag
     *
     * @param channelOPCUATagEntity
     */
    void update(ChannelOPCUATagEntity channelOPCUATagEntity);
    /**
     * 删除tag
     * @param id
     *
     */
    void delete(String id);
    List<ChannelOPCUATagEntity> getByDevice(String device);
    List<ChannelOPCUATagDTO> selectAll();
    List<ChannelOPCUATagEntity> listByIds(List<String> ids);
    /**
     * 通过deviceName删除
     *
     */
    void deleteByDeviceName(String name);
    /**
     * 导入Tag
     *
     * @param device
     * @param file
     * @throws Exception
     */
    void importTag(String device, MultipartFile file) throws Exception;
}
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/opcua/service/impl/ChannelOPCUADeviceServiceImpl.java
@@ -4,7 +4,11 @@
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.pojo.PageResult;
import com.iailab.framework.common.util.object.ConvertUtils;
import com.iailab.module.data.channel.opcda.entity.ChannelOPCDADeviceEntity;
import com.iailab.module.data.channel.opcda.vo.OpcDaDevicePageReqVO;
import com.iailab.module.data.channel.opcua.vo.OpcUaDevicePageReqVO;
import com.iailab.module.data.common.utils.PageUtils;
import com.iailab.module.data.common.utils.Query;
import com.iailab.module.data.channel.opcua.dao.ChannelOPCUADeviceDao;
@@ -19,9 +23,9 @@
import java.util.Map;
/**
 * @author DongYukun
 * @author lirm
 * @Description
 * @createTime 2023年05月08日 15:04:00
 * @createTime 2024年08月26日
 */
@Service
public class ChannelOPCUADeviceServiceImpl extends ServiceImpl<ChannelOPCUADeviceDao, ChannelOPCUADeviceEntity> implements ChannelOPCUADeviceService {
@@ -30,70 +34,27 @@
    @Resource
    private ChannelOPCUATagService channelOPCUATagService;
    /**
     * 分页查询opc ua配置
     *
     * @param params
     */
    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        String serverName = (String) params.get("serverName");
        IPage<ChannelOPCUADeviceEntity> page = this.page(
                new Query<ChannelOPCUADeviceEntity>().getPage(params),
                new QueryWrapper<ChannelOPCUADeviceEntity>()
                        .like(StringUtils.isNotBlank(serverName), "server_name", serverName)
                        .orderByDesc("create_time")
        );
        return new PageUtils(page);
    @Override
    public PageResult<ChannelOPCUADeviceEntity> queryPage(OpcUaDevicePageReqVO reqVO) {
        return channelOPCUADeviceDao.selectPage(reqVO);
    }
    /**
     * 查询opc ua配置详情
     *
     * @param id
     */
    @Override
    public ChannelOPCUADeviceEntity info(String id) {
        return channelOPCUADeviceDao.selectById(id);
    }
    /**
     * 列表
     *
     * @param params
     * @return
     */
    @Override
    public List<ChannelOPCUADeviceEntity> list(Map<String, Object> params) {
        return channelOPCUADeviceDao.selectList(new QueryWrapper<ChannelOPCUADeviceEntity>().orderByAsc("server_name"));
    }
    /**
     * 添加opc ua配置
     *
     * @param channelOPCUADeviceEntity
     */
    @Override
    public void add(ChannelOPCUADeviceEntity channelOPCUADeviceEntity) {
        channelOPCUADeviceDao.insert(channelOPCUADeviceEntity);
    }
    /**
     * 修改opc ua配置
     *
     * @param channelOPCUADeviceEntity
     */
    @Override
    public void update(ChannelOPCUADeviceEntity channelOPCUADeviceEntity) {
        channelOPCUADeviceDao.updateById(channelOPCUADeviceEntity);
    }
    /**
     * 删除opc ua配置
     *
     * @param id
     */
    @Override
    public void delete(String id) {
@@ -111,4 +72,9 @@
        );
        return ConvertUtils.sourceToTarget(entityList, ChannelOPCUADeviceDTO.class);
    }
    @Override
    public List<ChannelOPCUADeviceEntity> list(Map<String, Object> params) {
        return channelOPCUADeviceDao.selectList(new QueryWrapper<ChannelOPCUADeviceEntity>().orderByAsc("server_name"));
    }
}
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/opcua/service/impl/ChannelOPCUATagServiceImpl.java
@@ -1,17 +1,15 @@
package com.iailab.module.data.channel.opcua.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.iailab.framework.common.pojo.PageResult;
import com.iailab.framework.common.util.object.ConvertUtils;
import com.iailab.module.data.common.utils.PageUtils;
import com.iailab.module.data.common.utils.Query;
import com.iailab.module.data.channel.opcua.dao.ChannelOPCUATagDao;
import com.iailab.module.data.channel.opcua.dto.ChannelOPCUATagDTO;
import com.iailab.module.data.channel.opcua.entity.ChannelOPCUATagEntity;
import com.iailab.module.data.channel.opcua.service.ChannelOPCUATagService;
import com.iailab.module.data.channel.opcua.vo.OpcUaTagPageReqVO;
import lombok.extern.slf4j.Slf4j;
import org.apache.poi.ss.usermodel.CellType;
import org.apache.poi.xssf.usermodel.XSSFRow;
@@ -27,13 +25,12 @@
import java.io.FileInputStream;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.UUID;
/**
 * @author DongYukun
 * @author lirm
 * @Description
 * @createTime 2023年05月08日 15:04:00
 * @createTime 2024年08月26日
 */
@Slf4j
@Service
@@ -44,77 +41,41 @@
    @Value("${iems.upload-dir}")
    private String uploadDir;
    /**
     * 分页查询tag
     *
     * @param params
     */
    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        String tagName = (String) params.get("tagName");
        String device = (String) params.get("device");
        IPage<ChannelOPCUATagEntity> page = this.page(
                new Query<ChannelOPCUATagEntity>().getPage(params),
                new QueryWrapper<ChannelOPCUATagEntity>()
                        .like(StringUtils.isNotBlank(tagName), "tag_name", tagName)
                        .eq(StringUtils.isNotBlank(device), "device", device)
                        .orderByDesc("create_time")
        );
        return new PageUtils(page);
    public PageResult<ChannelOPCUATagEntity> queryPage(OpcUaTagPageReqVO reqVO) {
        return channelOPCUATagDao.selectPage(reqVO);
    }
    /**
     * 查询tag详情
     *
     * @param id
     */
    @Override
    public ChannelOPCUATagEntity info(String id) {
        return channelOPCUATagDao.selectById(id);
    }
    @Override
    public List<ChannelOPCUATagEntity> getByDevice(String device) {
        QueryWrapper<ChannelOPCUATagEntity> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("device", device).orderByDesc ("create_time");
        return channelOPCUATagDao.selectList(queryWrapper);
    }
    /**
     * 添加tag
     *
     * @param channelOPCUATagEntity
     */
    @Override
    public void add(ChannelOPCUATagEntity channelOPCUATagEntity) {
        channelOPCUATagDao.insert(channelOPCUATagEntity);
    }
    /**
     * 修改tag
     *
     * @param channelOPCUATagEntity
     */
    @Override
    public void update(ChannelOPCUATagEntity channelOPCUATagEntity) {
        channelOPCUATagDao.updateById(channelOPCUATagEntity);
    }
    /**
     * 删除tag
     *
     * @param id
     */
    @Override
    public void delete(String id) {
        channelOPCUATagDao.deleteById(id);
    }
    @Override
    public List<ChannelOPCUATagEntity> getByDevice(String device) {
        QueryWrapper<ChannelOPCUATagEntity> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("device", device).orderByDesc ("create_time");
        return channelOPCUATagDao.selectList(queryWrapper);
    }
    @Override
    public List<ChannelOPCUATagDTO> selectAll() {
        List<ChannelOPCUATagEntity> entityList = baseMapper.selectList(
                null
        );
@@ -131,13 +92,6 @@
        baseMapper.delete(new QueryWrapper<ChannelOPCUATagEntity>().eq("device",name));
    }
    /**
     * 导入Tag
     *
     * @param device
     * @param file
     * @throws Exception
     */
    @Override
    @Transactional(rollbackFor = Exception.class)
    public void importTag(String device, MultipartFile file) throws Exception {
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/opcua/vo/OpcUaDevicePageReqVO.java
对比新文件
@@ -0,0 +1,21 @@
package com.iailab.module.data.channel.opcua.vo;
import com.iailab.framework.common.pojo.PageParam;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
/**
 * @author lirm
 * @Description
 * @createTime 2024年08月26日
 */
@Schema(description = "数据平台 - opcua分页 Request VO")
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
public class OpcUaDevicePageReqVO extends PageParam {
    private String serverName;
}
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/opcua/vo/OpcUaDeviceRespVO.java
对比新文件
@@ -0,0 +1,63 @@
package com.iailab.module.data.channel.opcua.vo;
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.util.Date;
/**
 * @author lirm
 * @Description
 * @createTime 2024年08月26日
 */
@Schema(description = "数据平台 - opcuaDevice Response VO")
@Data
@ExcelIgnoreUnannotated
public class OpcUaDeviceRespVO {
    @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
    @ExcelProperty("ID")
    private String id;
    @Schema(description = "服务名", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
    @ExcelProperty("服务名")
    private String serverName;
    @Schema(description = "端点URL", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
    @ExcelProperty("端点URL")
    private String endpointUrl;
    @Schema(description = "安全策略", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
    @ExcelProperty("安全策略")
    private String securityPolicy;
    @Schema(description = "安全模式", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
    @ExcelProperty("安全模式")
    private String securityMode;
    @Schema(description = "连接方式(0,匿名;1,用户名密码; 2,安全证书)", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
    @ExcelProperty("连接方式")
    private String connectionType;
    @Schema(description = "用户名", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
    @ExcelProperty("用户名")
    private String userName;
    @Schema(description = "密码", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
    @ExcelProperty("密码")
    private String password;
    @Schema(description = "安全证书路径", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
    @ExcelProperty("安全证书路径")
    private String certificatePath;
    @Schema(description = "设备不活动超时时间", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
    @ExcelProperty("设备不活动超时时间")
    private Integer connectInactivityTimeout;
    @Schema(description = "重连超时", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
    @ExcelProperty("重连超时")
    private Integer reconnectInterval;
}
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/opcua/vo/OpcUaTagPageReqVO.java
对比新文件
@@ -0,0 +1,23 @@
package com.iailab.module.data.channel.opcua.vo;
import com.iailab.framework.common.pojo.PageParam;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
/**
 * @author lirm
 * @Description
 * @createTime 2024年08月26日
 */
@Schema(description = "数据平台 - opcua分页 Request VO")
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
public class OpcUaTagPageReqVO extends PageParam {
    private String tagName;
    private String device;
}
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/opcua/vo/OpcUaTagRespVO.java
对比新文件
@@ -0,0 +1,55 @@
package com.iailab.module.data.channel.opcua.vo;
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.util.Date;
/**
 * @author lirm
 * @Description
 * @createTime 2024年08月26日
 */
@Schema(description = "数据平台 - opcuaTag Response VO")
@Data
@ExcelIgnoreUnannotated
public class OpcUaTagRespVO {
    @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
    @ExcelProperty("ID")
    private String id;
    @Schema(description = "tag名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
    @ExcelProperty("tag名称")
    private String tagName;
    @Schema(description = "数据类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
    @ExcelProperty("数据类型")
    private String dataType;
    @Schema(description = "是否启用", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
    @ExcelProperty("是否启用")
    private Boolean enabled;
    @Schema(description = "关联设备", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
    @ExcelProperty("关联设备")
    private String device;
    @Schema(description = "Modbus地址 00001 ~49999", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
    @ExcelProperty("Modbus地址")
    private String address;
    @Schema(description = "采集频率", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
    @ExcelProperty("采集频率")
    private Integer samplingRate;
    @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
    @ExcelProperty("创建时间")
    private Date createTime;
    @Schema(description = "更新时间", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
    @ExcelProperty("更新时间")
    private Date updateTime;
}
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/tag/controller/TagController.java
@@ -1,8 +1,9 @@
package com.iailab.module.data.channel.tag.controller;
import com.iailab.module.data.channel.kio.entity.ChannelKioDeviceEntity;
import com.iailab.module.data.channel.kio.entity.ChannelKioTagEntity;
import com.iailab.module.data.common.enums.DataSourceType;
import com.iailab.framework.common.pojo.CommonResult;
import com.iailab.module.data.channel.kio.dto.ChannelKioDeviceDTO;
import com.iailab.module.data.channel.kio.service.ChannelKioDeviceService;
import com.iailab.module.data.channel.kio.service.ChannelKioTagService;
import com.iailab.module.data.channel.modbus.entity.ChannelModBusDeviceEntity;
@@ -13,12 +14,11 @@
import com.iailab.module.data.channel.opcua.service.ChannelOPCUADeviceService;
import com.iailab.module.data.channel.opcua.service.ChannelOPCUATagService;
import com.iailab.module.data.channel.tag.dto.TagOptionDTO;
import com.iailab.module.data.http.entity.HttpApiEntity;
import com.iailab.module.data.http.entity.HttpTagEntity;
import com.iailab.module.data.http.service.HttpApiService;
import com.iailab.module.data.channel.kio.dto.ChannelKioTagDTO;
import com.iailab.module.data.channel.http.entity.HttpApiEntity;
import com.iailab.module.data.channel.http.entity.HttpTagEntity;
import com.iailab.module.data.channel.http.service.HttpApiService;
import com.iailab.module.data.channel.opcua.entity.ChannelOPCUATagEntity;
import com.iailab.module.data.http.service.HttpTagService;
import com.iailab.module.data.channel.http.service.HttpTagService;
import javax.annotation.Resource;
import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.GetMapping;
@@ -121,14 +121,14 @@
        TagOptionDTO kioData = new TagOptionDTO();
        kioData.setValue(DataSourceType.KIO.getCode());
        kioData.setLabel(DataSourceType.KIO.getDesc());
        List<ChannelKioDeviceDTO> kioList = channelKioDeviceService.list(new HashMap<>());
        List<ChannelKioDeviceEntity> kioList = channelKioDeviceService.list(new HashMap<>());
        List<TagOptionDTO> kioDeviceOp = new ArrayList<>();
        if (!CollectionUtils.isEmpty(kioList)) {
            kioList.forEach(item -> {
                TagOptionDTO op1 = new TagOptionDTO();
                op1.setValue(item.getId());
                op1.setLabel(item.getInstanceName());
                List<ChannelKioTagDTO> tags = channelKioTagService.getByDevice(item.getInstanceName());
                List<ChannelKioTagEntity> tags = channelKioTagService.getByDevice(item.getInstanceName());
                List<TagOptionDTO> op2 = new ArrayList<>();
                tags.forEach(item1 -> {
                    TagOptionDTO op3 = new TagOptionDTO();
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/http/controller/admin/HttpApiController.java
文件已删除
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/http/controller/admin/HttpTagController.java
文件已删除
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/http/controller/admin/HttpTokenController.java
文件已删除
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/http/controller/package-info.java
文件已删除
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/http/dao/HttpApiDao.java
文件已删除
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/http/dao/HttpTagDao.java
文件已删除
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/http/dao/HttpTokenDao.java
文件已删除
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/http/service/HttpApiService.java
文件已删除
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/http/service/HttpTagService.java
文件已删除
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/http/service/HttpTokenService.java
文件已删除
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/http/service/impl/HttpApiServiceImpl.java
文件已删除
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/http/service/impl/HttpTagServiceImpl.java
文件已删除
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/http/service/impl/HttpTokenServiceImpl.java
文件已删除
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/point/collection/PointCollector.java
@@ -7,7 +7,7 @@
import com.iailab.module.data.point.common.PointTypeEnum;
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.channel.http.collector.HttpCollectorForZxzk;
import com.iailab.module.data.influxdb.pojo.InfluxPointValuePOJO;
import com.iailab.module.data.channel.modbus.collector.ModBusCollector;
import com.iailab.module.data.channel.opcua.collector.OpcUaCollector;
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/point/collection/handler/MeasureHandle.java
@@ -12,7 +12,7 @@
import com.iailab.module.data.point.common.PointDataTypeEnum;
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.channel.http.collector.HttpCollectorForZxzk;
import com.iailab.module.data.influxdb.pojo.InfluxPointValuePOJO;
import lombok.extern.slf4j.Slf4j;
import javax.annotation.Resource;
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/point/controller/admin/DaPointController.java
@@ -1,37 +1,32 @@
package com.iailab.module.data.point.controller.admin;
import com.iailab.framework.common.constant.Constant;
import com.iailab.framework.common.page.PageData;
import com.iailab.framework.common.pojo.CommonResult;
import com.iailab.framework.common.util.validation.ValidationUtils;
import com.iailab.framework.common.validation.group.AddGroup;
import com.iailab.framework.common.validation.group.UpdateGroup;
import com.iailab.framework.common.validation.group.DefaultGroup;
import com.iailab.framework.common.pojo.PageResult;
import com.iailab.framework.common.util.object.BeanUtils;
import com.iailab.module.data.point.dto.DaPointDTO;
import com.iailab.module.data.point.entity.DaPointEntity;
import com.iailab.module.data.point.service.DaPointService;
import com.iailab.module.data.point.vo.DaPointPageReqVO;
import com.iailab.module.data.point.vo.DaPointRespVO;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Parameters;
import javax.annotation.Resource;
import javax.annotation.security.PermitAll;
import javax.validation.Valid;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.validation.Valid;
import java.util.List;
import java.util.Map;
import java.util.UUID;
import static com.iailab.framework.common.pojo.CommonResult.success;
/**
 * @author PanZhibao
 * @author lirm
 * @Description
 * @createTime 2024年05月12日
 * @createTime 2024年09月2日
 */
@Tag(name = "数据采集,测点")
@RestController
@@ -43,66 +38,42 @@
    private DaPointService daPointService;
    @GetMapping("page")
    @Operation(summary = "分页")
    @Parameters({
            @Parameter(name = Constant.PAGE, description = "当前页码,从1开始", required = true) ,
            @Parameter(name = Constant.LIMIT, description = "每页显示记录数", required = true) ,
            @Parameter(name = Constant.ORDER_FIELD, description = "排序字段") ,
            @Parameter(name = Constant.ORDER, description = "排序方式,可选值(asc、desc)")
    })
    @PreAuthorize("@ss.hasPermission('data:point:query')")
    public CommonResult<PageData<DaPointDTO>> page(@RequestParam Map<String, Object> params){
        PageData<DaPointDTO> page = daPointService.page(params);
        return success(page);
    }
    @GetMapping("{id}")
    @Operation(summary = "信息")
    @PreAuthorize("@ss.hasPermission('data:point:query')")
    public CommonResult<DaPointDTO> get(@PathVariable("id") String id){
        DaPointDTO data = daPointService.get(id);
        return new CommonResult<DaPointDTO>().setData(data);
    public CommonResult<PageResult<DaPointRespVO>> page(@Valid DaPointPageReqVO reqVO){
        PageResult<DaPointEntity> page = daPointService.queryPage(reqVO);
        return success(BeanUtils.toBean(page, DaPointRespVO.class));
    }
    @GetMapping("/list")
    @Operation(summary = "列表")
    @PreAuthorize("@ss.hasPermission('data:point:query')")
    public CommonResult<List<DaPointDTO>> list(@Valid @RequestParam Map<String, Object> params) {
        List<DaPointDTO> list = daPointService.list(params);
        return success(list);
    }
    @PostMapping
    @Operation(summary = "保存")
    @PreAuthorize("@ss.hasPermission('data:point:save')")
    public CommonResult save(@RequestBody DaPointDTO dto){
        //效验数据
        ValidationUtils.validate(dto, AddGroup.class, DefaultGroup.class);
        daPointService.add(dto);
        return new CommonResult();
    @GetMapping("/info/{id}")
    public CommonResult<DaPointDTO> info(@PathVariable("id") String id){
        DaPointDTO info= daPointService.info(id);
        return success(info);
    }
    @PutMapping
    @Operation(summary = "修改")
    @PreAuthorize("@ss.hasPermission('data:point:update')")
    public CommonResult update(@RequestBody DaPointDTO dto){
        //效验数据
        ValidationUtils.validate(dto, UpdateGroup.class, DefaultGroup.class);
        daPointService.update(dto);
        return new CommonResult();
    @PostMapping("/add")
    public CommonResult<Boolean> add(@RequestBody DaPointDTO daPointDTO){
        String id = UUID.randomUUID().toString();
        daPointDTO.setId(id);
        daPointService.add(daPointDTO);
        return success(true);
    }
    @DeleteMapping
    @Operation(summary = "删除")
    @PreAuthorize("@ss.hasPermission('data:point:delete')")
    public CommonResult delete(@RequestBody String[] ids){
    @PutMapping("/update")
    public CommonResult<Boolean> update(@RequestBody DaPointDTO daPointDTO) {
        daPointService.update(daPointDTO);
        return success(true);
    }
    @DeleteMapping("/delete")
    public CommonResult<Boolean> delete(String[] ids) {
        daPointService.delete(ids);
        return new CommonResult();
        return success(true);
    }
    @GetMapping("pointNo")
@@ -115,17 +86,17 @@
    @PutMapping("/enable")
    @Operation(summary = "启用")
    @Transactional
    public CommonResult enable(@RequestBody String[] ids) {
    public CommonResult<Boolean> enable(@RequestBody String[] ids) {
        daPointService.enableByIds(ids);
        return new CommonResult();
        return success(true);
    }
    @PutMapping("/disable")
    @Operation(summary = "禁用")
    @Transactional
    public CommonResult disable(@RequestBody String[] ids) {
    public CommonResult<Boolean> disable(@RequestBody String[] ids) {
        daPointService.disableByIds(ids);
        return new CommonResult();
        return success(true);
    }
}
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/point/dao/DaPointDao.java
@@ -1,10 +1,13 @@
package com.iailab.module.data.point.dao;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.iailab.framework.common.dao.BaseDao;
import com.iailab.framework.common.pojo.PageResult;
import com.iailab.framework.mybatis.core.mapper.BaseMapperX;
import com.iailab.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.iailab.framework.tenant.core.db.dynamic.TenantDS;
import com.iailab.module.data.point.dto.DaPointDTO;
import com.iailab.module.data.point.entity.DaPointEntity;
import com.iailab.module.data.point.vo.DaPointPageReqVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@@ -12,13 +15,13 @@
import java.util.Map;
/**
 * @author PanZhibao
 * @author lirm
 * @Description
 * @createTime 2022年07月12日 13:47:00
 * @createTime 2024年09月2日
 */
@TenantDS
@Mapper
public interface DaPointDao extends BaseDao<DaPointEntity> {
public interface DaPointDao extends BaseMapperX<DaPointEntity> {
    IPage<DaPointDTO> getPageList(IPage<DaPointEntity> page, @Param("params") Map<String, Object> params);
@@ -27,4 +30,11 @@
    List<DaPointDTO> getMeasurePoint(Map<String, Object> params);
    List<DaPointDTO> getMathPoint(Map<String, Object> params);
    default PageResult<DaPointEntity> selectPage(DaPointPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<DaPointEntity>()
                .likeIfPresent(DaPointEntity::getPointNo, reqVO.getPointNo())
                .likeIfPresent(DaPointEntity::getPointName, reqVO.getPointName())
                .orderByDesc(DaPointEntity::getCreateTime));
    }
}
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/point/service/DaPointService.java
@@ -1,31 +1,31 @@
package com.iailab.module.data.point.service;
import com.iailab.framework.common.page.PageData;
import com.iailab.framework.common.service.BaseService;
import com.iailab.framework.common.pojo.PageResult;
import com.iailab.module.data.point.dto.DaPointDTO;
import com.iailab.module.data.point.entity.DaPointEntity;
import com.iailab.module.data.point.vo.DaPointPageReqVO;
import java.util.List;
import java.util.Map;
/**
 * @author PanZhibao
 * @author lirm
 * @Description
 * @createTime 2024年05月12日
 * @createTime 2024年09月2日
 */
public interface DaPointService extends BaseService<DaPointEntity> {
public interface DaPointService{
    PageResult<DaPointEntity> queryPage(DaPointPageReqVO reqVO);
    PageData<DaPointDTO> page(Map<String, Object> params);
    DaPointDTO info(String id);
    DaPointDTO get(String id);
    void add(DaPointDTO daPointDTO);
    void update(DaPointDTO daPointDTO);
    void delete(String[] id);
    List<DaPointDTO> list(Map<String, Object> params);
    void add(DaPointDTO dataPoint);
    void update(DaPointDTO dataPoint);
    void delete(String[] ids);
    List<DaPointDTO> getConstantPoint(String freq);
@@ -50,4 +50,5 @@
    void disableByIds(String[] ids);
    void updateDefaultValue(DaPointDTO dto);
}
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/point/service/impl/DaPointServiceImpl.java
@@ -2,38 +2,37 @@
import com.alibaba.fastjson.JSONArray;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.iailab.framework.common.constant.Constant;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.iailab.framework.common.pojo.PageResult;
import com.iailab.framework.common.util.object.ConvertUtils;
import com.iailab.module.data.common.enums.CommonConstant;
import com.iailab.module.data.common.enums.IsEnableEnum;
import com.iailab.framework.common.page.PageData;
import com.iailab.framework.common.service.impl.BaseServiceImpl;
import com.iailab.framework.common.util.object.ConvertUtils;
import com.iailab.module.data.point.common.IncreaseCodeEnum;
import com.iailab.module.data.point.dao.DaPointDao;
import com.iailab.module.data.point.service.DaMeasurePointService;
import com.iailab.module.data.point.common.PointTypeEnum;
import com.iailab.module.data.point.dao.DaPointDao;
import com.iailab.module.data.point.dto.DaMeasurePointDTO;
import com.iailab.module.data.point.dto.DaPointDTO;
import com.iailab.module.data.point.entity.DaPointEntity;
import com.iailab.module.data.point.service.DaMathPointService;
import com.iailab.module.data.point.service.DaMeasurePointService;
import com.iailab.module.data.point.service.DaPointService;
import com.iailab.module.data.point.service.DaSequenceNumService;
import com.iailab.module.data.point.vo.DaPointPageReqVO;
import org.apache.commons.lang3.StringUtils;
import javax.annotation.Resource;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import javax.annotation.Resource;
import java.util.*;
/**
 * @author PanZhibao
 * @author lirm
 * @Description
 * @createTime 2024年05月12日
 * @createTime 2024年09月2日
 */
@Service
public class DaPointServiceImpl extends BaseServiceImpl<DaPointDao, DaPointEntity> implements DaPointService {
public class DaPointServiceImpl extends ServiceImpl<DaPointDao, DaPointEntity> implements DaPointService {
    @Resource
    private DaMeasurePointService daMeasurePointService;
@@ -43,19 +42,19 @@
    @Resource
    private DaSequenceNumService daSequenceNumService;
    @Resource
    private DaPointDao daPointDao;
    @Override
    public PageData<DaPointDTO> page(Map<String, Object> params) {
        IPage<DaPointDTO> page = baseDao.getPageList(
                getPage(params, Constant.CREATE_TIME, false),
                params
        );
        return getPageData(page, DaPointDTO.class);
    public PageResult<DaPointEntity> queryPage(DaPointPageReqVO reqVO) {
        return daPointDao.selectPage(reqVO);
    }
    @Override
    public DaPointDTO get(String id) {
        DaPointEntity entity = baseDao.selectById(id);
    public DaPointDTO info(String id) {
        DaPointEntity entity = daPointDao.selectById(id);
        DaPointDTO result = ConvertUtils.sourceToTarget(entity, DaPointDTO.class);
        if (PointTypeEnum.MEASURE_POINT.getCode().equals(result.getPointType())) {
            DaMeasurePointDTO measurePoint = daMeasurePointService.getByPoint(id);
@@ -86,7 +85,7 @@
        .in(!CollectionUtils.isEmpty(pointNos),"point_no", pointNos)
        .like(StringUtils.isNotBlank(pointNoLike), "point_no", pointNoLike)
                .last("limit 1, 10");
        List<DaPointEntity> list = baseDao.selectList(queryWrapper);
        List<DaPointEntity> list = daPointDao.selectList(queryWrapper);
        return ConvertUtils.sourceToTarget(list, DaPointDTO.class);
    }
@@ -110,7 +109,7 @@
        }
        daPointEntity.setIsEnable(CommonConstant.IS_ENABLE);
        daPointEntity.setCreateTime(new Date());
        baseDao.insert(daPointEntity);
        daPointDao.insert(daPointEntity);
    }
    @Override
@@ -118,7 +117,7 @@
    public void update(DaPointDTO dataPoint) {
        DaPointEntity daPointEntity = ConvertUtils.sourceToTarget(dataPoint, DaPointEntity.class);
        daPointEntity.setUpdateTime(new Date());
        baseDao.updateById(daPointEntity);
        daPointDao.updateById(daPointEntity);
        if (PointTypeEnum.MEASURE_POINT.getName().equals(dataPoint.getPointType())) {
            DaMeasurePointDTO measurePoint = dataPoint.getMeasurePoint();
            measurePoint.setSourceType(dataPoint.getSourceOption().get(0));
@@ -133,7 +132,7 @@
    @Override
    @Transactional(rollbackFor = Exception.class)
    public void delete(String[] ids) {
        baseDao.deleteBatchIds(Arrays.asList(ids));
        daPointDao.deleteBatchIds(Arrays.asList(ids));
        daMeasurePointService.deleteByPoint(ids);
        daMathPointService.deleteByPoint(ids);
    }
@@ -144,7 +143,7 @@
        params.put("pointType", PointTypeEnum.CONSTANT.getCode());
        params.put("isEnable", CommonConstant.IS_ENABLE);
        params.put("minfreqid", freq);
        return baseDao.getConstantPoint(params);
        return daPointDao.getConstantPoint(params);
    }
    @Override
@@ -153,7 +152,7 @@
        params.put("pointType", PointTypeEnum.CONSTANT.getCode());
        params.put("isEnable", CommonConstant.IS_ENABLE);
        params.put("pointNos", pointNos);
        return baseDao.getConstantPoint(params);
        return daPointDao.getConstantPoint(params);
    }
    @Override
@@ -162,7 +161,7 @@
        params.put("pointType", PointTypeEnum.MEASURE_POINT.getCode());
        params.put("isEnable", CommonConstant.IS_ENABLE);
        params.put("minfreqid", freq);
        return baseDao.getMeasurePoint(params);
        return daPointDao.getMeasurePoint(params);
    }
    @Override
@@ -171,7 +170,7 @@
        params.put("pointType", PointTypeEnum.MEASURE_POINT.getCode());
        params.put("isEnable", CommonConstant.IS_ENABLE);
        params.put("pointNos", pointNos);
        return baseDao.getMeasurePoint(params);
        return daPointDao.getMeasurePoint(params);
    }
    @Override
@@ -179,7 +178,7 @@
        Map<String, Object> params = new HashMap<>();
        params.put("pointType", PointTypeEnum.MEASURE_POINT.getCode());
        params.put("pointNo", pointNo);
        List<DaPointDTO> list = baseDao.getMeasurePoint(params);
        List<DaPointDTO> list = daPointDao.getMeasurePoint(params);
        if (CollectionUtils.isEmpty(list)) {
            return null;
        }
@@ -192,7 +191,7 @@
        params.put("pointType", PointTypeEnum.CALCULATE_POINT.getCode());
        params.put("isEnable", CommonConstant.IS_ENABLE);
        params.put("minfreqid", freq);
        return baseDao.getMathPoint(params);
        return daPointDao.getMathPoint(params);
    }
    @Override
@@ -201,14 +200,14 @@
        params.put("pointType", PointTypeEnum.CALCULATE_POINT.getCode());
        params.put("isEnable", CommonConstant.IS_ENABLE);
        params.put("pointNos", pointNos);
        return baseDao.getMathPoint(params);
        return daPointDao.getMathPoint(params);
    }
    @Override
    public DaPointDTO getByNo(String pointNo) {
        QueryWrapper<DaPointEntity> wrapper = new QueryWrapper<>();
        wrapper.eq("point_no", pointNo);
        DaPointEntity entity = baseDao.selectOne(wrapper);
        DaPointEntity entity = daPointDao.selectOne(wrapper);
        return ConvertUtils.sourceToTarget(entity, DaPointDTO.class);
    }
@@ -216,7 +215,7 @@
    public List<DaPointDTO> getByNos(List<String> pointNos) {
        QueryWrapper<DaPointEntity> wrapper = new QueryWrapper<>();
        wrapper.in("point_no", pointNos);
        List<DaPointEntity> list = baseDao.selectList(wrapper);
        List<DaPointEntity> list = daPointDao.selectList(wrapper);
        return ConvertUtils.sourceToTarget(list, DaPointDTO.class);
    }
@@ -226,7 +225,7 @@
        wrapper.eq("point_no", dto.getPointNo());
        DaPointEntity entity = new DaPointEntity();
        entity.setDefaultValue(dto.getDefaultValue());
        baseDao.update(entity, wrapper);
        daPointDao.update(entity, wrapper);
    }
    @Override
@@ -238,7 +237,7 @@
            DaPointEntity entity = new DaPointEntity();
            entity.setId(item);
            entity.setIsEnable(IsEnableEnum.ENABLE.value());
            baseDao.updateById(entity);
            daPointDao.updateById(entity);
        });
    }
@@ -251,7 +250,7 @@
            DaPointEntity entity = new DaPointEntity();
            entity.setId(item);
            entity.setIsEnable(IsEnableEnum.DISABLE.value());
            baseDao.updateById(entity);
            daPointDao.updateById(entity);
        });
    }
}
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/point/vo/DaPointPageReqVO.java
对比新文件
@@ -0,0 +1,23 @@
package com.iailab.module.data.point.vo;
import com.iailab.framework.common.pojo.PageParam;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
/**
 * @author lirm
 * @Description
 * @createTime 2024年09月2日
 */
@Schema(description = "数据平台 - DaPoint分页 Request VO")
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
public class DaPointPageReqVO extends PageParam {
    private String pointNo;
    private String pointName;
}
iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/point/vo/DaPointRespVO.java
对比新文件
@@ -0,0 +1,88 @@
package com.iailab.module.data.point.vo;
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.math.BigDecimal;
import java.util.Date;
/**
 * @author lirm
 * @Description
 * @createTime 2024年09月2日
 */
@Schema(description = "数据平台 - DaPoint Response VO")
@Data
@ExcelIgnoreUnannotated
public class DaPointRespVO {
    @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
    @ExcelProperty("ID")
    private String id;
    @Schema(description = "测点编码", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
    @ExcelProperty("测点编码")
    private String pointNo;
    @Schema(description = "测点名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
    @ExcelProperty("测点名称")
    private String pointName;
    @Schema(description = "测点类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
    @ExcelProperty("测点类型")
    private String pointType;
    @Schema(description = "数据类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
    @ExcelProperty("数据类型")
    private String dataType;
    @Schema(description = "值类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
    @ExcelProperty("值类型")
    private String valueType;
    @Schema(description = "存储类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
    @ExcelProperty("存储类型")
    private String storeType;
    @Schema(description = "测量单位", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
    @ExcelProperty("测量单位")
    private String unit;
    @Schema(description = "单位转换", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
    @ExcelProperty("单位转换")
    private BigDecimal unittransfactor;
    @Schema(description = "默认值", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
    @ExcelProperty("默认值")
    private BigDecimal defaultValue;
    @Schema(description = "最大值", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
    @ExcelProperty("最大值")
    private BigDecimal maxValue;
    @Schema(description = "最小值", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
    @ExcelProperty("最小值")
    private BigDecimal minValue;
    @Schema(description = "采集频率", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
    @ExcelProperty("采集频率")
    private String minfreqid;
    @Schema(description = "备注", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
    @ExcelProperty("备注")
    private String remark;
    @Schema(description = "是否启用", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
    @ExcelProperty("是否启用")
    private Integer isEnable;
    @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
    @ExcelProperty("创建时间")
    private Date createTime;
    @Schema(description = "更新时间", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
    @ExcelProperty("更新时间")
    private Date updateTime;
}
iailab-module-data/iailab-module-data-biz/src/main/resources/mapper/http/HttpTagDao.xml
文件已删除
pom.xml
@@ -118,7 +118,7 @@
                <nacos.username>nacos</nacos.username>
                <nacos.password>nacos</nacos.password>
                <nacos.metadata.version>1.0.0</nacos.metadata.version>
                <log.path>E:\DLUT\iailab-plat</log.path>
                <log.path>D:\DLUT\iailab-plat</log.path>
                <logstash.address>127.0.0.1:4560</logstash.address>
            </properties>
            <activation>