From a8b2b66065db7dd9d9c27ec45dcf41a8fde8c7b1 Mon Sep 17 00:00:00 2001 From: luyie Date: Fri, 20 Sep 2024 11:19:56 +0800 Subject: [PATCH 01/12] =?UTF-8?q?fix:=E8=A7=86=E9=A2=91=E5=B7=A1=E6=A3=80?= =?UTF-8?q?=EF=BC=8C=E5=BD=93=E8=8E=B7=E5=8F=96=E4=B8=8D=E5=88=B0=E6=88=AA?= =?UTF-8?q?=E5=9B=BE=E6=97=B6=E7=BB=A7=E7=BB=AD=E6=89=A7=E8=A1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/hnac/hzinfo/inspect/task/schedule/VideoTaskSchedule.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/schedule/VideoTaskSchedule.java b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/schedule/VideoTaskSchedule.java index 12c6a60..bd13fb4 100644 --- a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/schedule/VideoTaskSchedule.java +++ b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/schedule/VideoTaskSchedule.java @@ -182,9 +182,16 @@ public class VideoTaskSchedule { } } + String picUrl = null; // 调用海康威视api实现手动截屏回传至fileUrl if (Func.isNotEmpty(camera.getPointCode())) { - String picUrl = hikApiService.manualCapture(camera.getPointCode()); + try { + picUrl = hikApiService.manualCapture(camera.getPointCode()); + } catch (Exception e) { + log.error("get picture url fail", e); + } + } + if (Func.isNotEmpty(picUrl)) { record.setFileUrl(picUrl); record.setCurrentValue(picUrl); pictureHandle(picUrl, content.getContentId(), record, task); From 142cf9dd702d360000699182fa830a09ab98fc5a Mon Sep 17 00:00:00 2001 From: luyie Date: Fri, 20 Sep 2024 11:59:26 +0800 Subject: [PATCH 02/12] =?UTF-8?q?fix:=E8=A7=86=E9=A2=91=E5=B7=A1=E6=A3=80?= =?UTF-8?q?=EF=BC=8C=E7=A9=BA=E6=8C=87=E9=92=88=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../bigmodel/business/controller/VectorDataController.java | 10 ++++++++++ .../hnac/gglm/bigmodel/business/service/VectorDataService.java | 3 +++ .../bigmodel/business/service/impl/VectorDataServiceImpl.java | 6 ++++++ .../hnac/hzinfo/inspect/task/schedule/VideoTaskSchedule.java | 2 +- 4 files changed, 20 insertions(+), 1 deletion(-) diff --git a/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/business/controller/VectorDataController.java b/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/business/controller/VectorDataController.java index 0d4c8d1..05015e1 100644 --- a/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/business/controller/VectorDataController.java +++ b/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/business/controller/VectorDataController.java @@ -4,6 +4,7 @@ import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; import com.hnac.gglm.bigmodel.business.service.VectorDataService; import com.hnac.gglm.bigmodel.business.vo.DeviceModelData; import com.hnac.hzinfo.api.annotation.ApiInterface; +import com.hnac.hzinfo.sdk.v5.device.dto.DeviceAttrInfoDTO; import com.hnac.hzinfo.sdk.v5.model.vo.ModelAttrVO; import com.hnac.hzinfo.sdk.v5.model.vo.ModelEventVO; import com.hnac.hzinfo.sdk.v5.model.vo.ModelFuncVO; @@ -63,4 +64,13 @@ public class VectorDataController { public R> getModelData() { return R.data(vectorDataService.getModelData()); } + + + @GetMapping("/getDeviceAttr") + @ApiOperation(value = "获取模型数据") + @ApiOperationSupport(order = 4) + @ApiInterface + public R> getDeviceAttr( ) { + return R.data(vectorDataService.getDeviceAttr()); + } } diff --git a/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/business/service/VectorDataService.java b/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/business/service/VectorDataService.java index 0c20182..cf61e75 100644 --- a/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/business/service/VectorDataService.java +++ b/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/business/service/VectorDataService.java @@ -1,6 +1,7 @@ package com.hnac.gglm.bigmodel.business.service; import com.hnac.gglm.bigmodel.business.vo.DeviceModelData; +import com.hnac.hzinfo.sdk.v5.device.dto.DeviceAttrInfoDTO; import com.hnac.hzinfo.sdk.v5.model.vo.ModelAttrVO; import com.hnac.hzinfo.sdk.v5.model.vo.ModelEventVO; import com.hnac.hzinfo.sdk.v5.model.vo.ModelFuncVO; @@ -20,4 +21,6 @@ public interface VectorDataService { List getModelEventData(); List getModelData(); + + List getDeviceAttr(); } diff --git a/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/business/service/impl/VectorDataServiceImpl.java b/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/business/service/impl/VectorDataServiceImpl.java index 574562f..157b810 100644 --- a/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/business/service/impl/VectorDataServiceImpl.java +++ b/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/business/service/impl/VectorDataServiceImpl.java @@ -2,6 +2,7 @@ package com.hnac.gglm.bigmodel.business.service.impl; import com.hnac.gglm.bigmodel.business.service.VectorDataService; import com.hnac.gglm.bigmodel.business.vo.DeviceModelData; +import com.hnac.hzinfo.sdk.v5.device.dto.DeviceAttrInfoDTO; import com.hnac.hzinfo.sdk.v5.model.ModelClient; import com.hnac.hzinfo.sdk.v5.model.vo.ModelAttrVO; import com.hnac.hzinfo.sdk.v5.model.vo.ModelEventVO; @@ -61,4 +62,9 @@ public class VectorDataServiceImpl implements VectorDataService { } return modelDataList; } + + @Override + public List getDeviceAttr() { + return null; + } } diff --git a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/schedule/VideoTaskSchedule.java b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/schedule/VideoTaskSchedule.java index bd13fb4..c408c71 100644 --- a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/schedule/VideoTaskSchedule.java +++ b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/schedule/VideoTaskSchedule.java @@ -172,7 +172,7 @@ public class VideoTaskSchedule { record.setUpdateUser(task.getUpdateUser()); record.setCurrentStatus("1"); CameraInfoEntity camera = this.getCameraByProIdAndConId(project.getProjectId(), content.getContentId()); - log.info("【taskId:" + task.getId() + "】视频巡检任务执行,获取视频巡检结果,camera:" + Optional.of(camera).map(JsonUtil::toJson).orElse("null")); + log.info("【taskId:" + task.getId() + "】视频巡检任务执行,获取视频巡检结果,camera:" + Optional.ofNullable(camera).map(JsonUtil::toJson).orElse("null")); if (Func.isNotEmpty(camera)) { // 获取计划时间段内视频的告警信息设置是否异常 if (Func.isNotEmpty(camera.getEmCode())) { From 7b71eed419f86a479cb94381143bbea526964121 Mon Sep 17 00:00:00 2001 From: luyie Date: Fri, 20 Sep 2024 13:50:24 +0800 Subject: [PATCH 03/12] =?UTF-8?q?add:=E8=8E=B7=E5=8F=96=E7=B3=BB=E7=BB=9F?= =?UTF-8?q?=E8=AE=BE=E5=A4=87=E5=B1=9E=E6=80=A7=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../gglm/bigmodel/business/service/impl/VectorDataServiceImpl.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/business/service/impl/VectorDataServiceImpl.java b/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/business/service/impl/VectorDataServiceImpl.java index 157b810..f4bce9d 100644 --- a/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/business/service/impl/VectorDataServiceImpl.java +++ b/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/business/service/impl/VectorDataServiceImpl.java @@ -2,6 +2,7 @@ package com.hnac.gglm.bigmodel.business.service.impl; import com.hnac.gglm.bigmodel.business.service.VectorDataService; import com.hnac.gglm.bigmodel.business.vo.DeviceModelData; +import com.hnac.hzinfo.sdk.v5.device.client.DeviceClient; import com.hnac.hzinfo.sdk.v5.device.dto.DeviceAttrInfoDTO; import com.hnac.hzinfo.sdk.v5.model.ModelClient; import com.hnac.hzinfo.sdk.v5.model.vo.ModelAttrVO; @@ -25,6 +26,7 @@ import java.util.stream.Collectors; @AllArgsConstructor public class VectorDataServiceImpl implements VectorDataService { private final ModelClient modelClient; + private final DeviceClient deviceClient; @Override @@ -65,6 +67,6 @@ public class VectorDataServiceImpl implements VectorDataService { @Override public List getDeviceAttr() { - return null; + return deviceClient.listDeviceAttr().getData(); } } From 668a49c391f3463c845b2d4a5fbc84637ce75f3d Mon Sep 17 00:00:00 2001 From: luyie Date: Fri, 20 Sep 2024 13:51:02 +0800 Subject: [PATCH 04/12] =?UTF-8?q?add:=E8=8E=B7=E5=8F=96=E7=B3=BB=E7=BB=9F?= =?UTF-8?q?=E8=AE=BE=E5=A4=87=E5=B1=9E=E6=80=A7=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hnac/gglm/bigmodel/business/controller/VectorDataController.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/business/controller/VectorDataController.java b/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/business/controller/VectorDataController.java index 05015e1..d8923ad 100644 --- a/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/business/controller/VectorDataController.java +++ b/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/business/controller/VectorDataController.java @@ -67,7 +67,7 @@ public class VectorDataController { @GetMapping("/getDeviceAttr") - @ApiOperation(value = "获取模型数据") + @ApiOperation(value = "获取设备属性数据") @ApiOperationSupport(order = 4) @ApiInterface public R> getDeviceAttr( ) { From 239e81a8127c5c6f1a1115b771dc110b9881fe62 Mon Sep 17 00:00:00 2001 From: luyie Date: Fri, 20 Sep 2024 15:50:21 +0800 Subject: [PATCH 05/12] =?UTF-8?q?add:=E7=9F=A5=E8=AF=86=E5=BA=93=E9=97=AE?= =?UTF-8?q?=E9=A2=98=E6=95=B0=E6=8D=AE=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../business/controller/VectorDataController.java | 12 +++++- .../business/service/KnowledgeDataService.java | 13 ++++++ .../service/impl/KnowledgeDataServiceImpl.java | 49 ++++++++++++++++++++++ .../bigmodel/maintenance/dto/KnowledgeData.java | 36 ++++++++++++++++ .../mapper/KnowledgeFileFragmentMapper.java | 4 ++ .../mapper/KnowledgeFileFragmentMapper.xml | 19 +++++++++ 6 files changed, 132 insertions(+), 1 deletion(-) create mode 100644 hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/business/service/KnowledgeDataService.java create mode 100644 hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/business/service/impl/KnowledgeDataServiceImpl.java create mode 100644 hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/maintenance/dto/KnowledgeData.java create mode 100644 hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/maintenance/mapper/KnowledgeFileFragmentMapper.xml diff --git a/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/business/controller/VectorDataController.java b/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/business/controller/VectorDataController.java index d8923ad..3aa7742 100644 --- a/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/business/controller/VectorDataController.java +++ b/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/business/controller/VectorDataController.java @@ -1,8 +1,10 @@ package com.hnac.gglm.bigmodel.business.controller; import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; +import com.hnac.gglm.bigmodel.business.service.KnowledgeDataService; import com.hnac.gglm.bigmodel.business.service.VectorDataService; import com.hnac.gglm.bigmodel.business.vo.DeviceModelData; +import com.hnac.gglm.bigmodel.maintenance.dto.KnowledgeData; import com.hnac.hzinfo.api.annotation.ApiInterface; import com.hnac.hzinfo.sdk.v5.device.dto.DeviceAttrInfoDTO; import com.hnac.hzinfo.sdk.v5.model.vo.ModelAttrVO; @@ -31,7 +33,7 @@ import java.util.List; public class VectorDataController { private final VectorDataService vectorDataService; - + private final KnowledgeDataService knowledgeDataService; @GetMapping("/getModelAttributeData") @ApiOperation(value = "获取模型属性数据") @@ -73,4 +75,12 @@ public class VectorDataController { public R> getDeviceAttr( ) { return R.data(vectorDataService.getDeviceAttr()); } + + @GetMapping("/listKnowledgeData") + @ApiOperation(value = "获取知识库数据") + @ApiOperationSupport(order = 5) + @ApiInterface + public R> listKnowledgeData() { + return R.data(knowledgeDataService.listKnowledgeData()); + } } diff --git a/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/business/service/KnowledgeDataService.java b/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/business/service/KnowledgeDataService.java new file mode 100644 index 0000000..650dbd5 --- /dev/null +++ b/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/business/service/KnowledgeDataService.java @@ -0,0 +1,13 @@ +package com.hnac.gglm.bigmodel.business.service; + +import com.hnac.gglm.bigmodel.maintenance.dto.KnowledgeData; + +import java.util.List; + +/** + * @Author: ypj + * @Date: 2024/9/20 15:04 + */ +public interface KnowledgeDataService { + List listKnowledgeData(); +} diff --git a/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/business/service/impl/KnowledgeDataServiceImpl.java b/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/business/service/impl/KnowledgeDataServiceImpl.java new file mode 100644 index 0000000..a498431 --- /dev/null +++ b/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/business/service/impl/KnowledgeDataServiceImpl.java @@ -0,0 +1,49 @@ +package com.hnac.gglm.bigmodel.business.service.impl; + +import com.alibaba.fastjson.JSONObject; +import com.baomidou.dynamic.datasource.annotation.DS; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.hnac.gglm.bigmodel.business.service.KnowledgeDataService; +import com.hnac.gglm.bigmodel.maintenance.dto.KnowledgeData; +import com.hnac.gglm.bigmodel.maintenance.mapper.KnowledgeFileFragmentMapper; +import lombok.AllArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.List; + +/** + * @Author: ypj + * @Date: 2024/9/20 15:04 + */ +@Service +@Slf4j +@AllArgsConstructor +@DS("hznlm") +public class KnowledgeDataServiceImpl implements KnowledgeDataService { + KnowledgeFileFragmentMapper knowledgeFileFragmentMapper; + + @Override + public List listKnowledgeData() { + List resourceList = knowledgeFileFragmentMapper.listKnowledgeData(); + List resultList = new ArrayList<>(); + for (KnowledgeData item : resourceList) { + String question = item.getDocQs(); + List questionList = JSONObject.parseArray(question, String.class); + for (String q : questionList) { + KnowledgeData data = new KnowledgeData(); + data.setDocId(item.getDocId()); + data.setDocContent(item.getDocContent()); + data.setDocPageIndex(item.getDocPageIndex()); + data.setDocQs(q); + data.setArea(item.getArea()); + data.setLevel(item.getLevel()); + resultList.add(data); + } + } + return resultList; + } +} diff --git a/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/maintenance/dto/KnowledgeData.java b/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/maintenance/dto/KnowledgeData.java new file mode 100644 index 0000000..6e1d3ce --- /dev/null +++ b/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/maintenance/dto/KnowledgeData.java @@ -0,0 +1,36 @@ +package com.hnac.gglm.bigmodel.maintenance.dto; + +import com.baomidou.mybatisplus.annotation.TableField; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * @Author: ypj + * @Date: 2024/9/20 15:07 + */ +@Data +@ApiModel(value = "知识库文件分片信息", description = "知识库文件分片信息") +public class KnowledgeData { + @ApiModelProperty("文档ID") + @TableField("DOC_ID") + private Long docId; + + @ApiModelProperty("文档问题") + @TableField("DOC_QS") + private String docQs; + + @ApiModelProperty("文档内容") + @TableField("DOC_CONTENT") + private String docContent; + + @ApiModelProperty("文档页码") + @TableField("DOC_PAGE_INDEX") + private Integer docPageIndex; + + @ApiModelProperty("知识库领域") + private String area; + + @ApiModelProperty("等级") + private Integer level; +} diff --git a/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/maintenance/mapper/KnowledgeFileFragmentMapper.java b/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/maintenance/mapper/KnowledgeFileFragmentMapper.java index 3846042..df86ed2 100644 --- a/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/maintenance/mapper/KnowledgeFileFragmentMapper.java +++ b/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/maintenance/mapper/KnowledgeFileFragmentMapper.java @@ -1,11 +1,15 @@ package com.hnac.gglm.bigmodel.maintenance.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.hnac.gglm.bigmodel.maintenance.dto.KnowledgeData; import com.hnac.gglm.bigmodel.maintenance.entity.KnowledgeFileFragment; +import java.util.List; + /** * @Author: ypj * @Date: 2024/9/11 10:49 */ public interface KnowledgeFileFragmentMapper extends BaseMapper { + List listKnowledgeData(); } diff --git a/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/maintenance/mapper/KnowledgeFileFragmentMapper.xml b/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/maintenance/mapper/KnowledgeFileFragmentMapper.xml new file mode 100644 index 0000000..c4f82cd --- /dev/null +++ b/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/maintenance/mapper/KnowledgeFileFragmentMapper.xml @@ -0,0 +1,19 @@ + + + + + + + + \ No newline at end of file From 384af78c6334a783e46d1f52f9e447c05fb30ca9 Mon Sep 17 00:00:00 2001 From: wangyinsheng <2310589501@qq.com> Date: Fri, 20 Sep 2024 18:53:55 +0800 Subject: [PATCH 06/12] =?UTF-8?q?add:=E6=8E=A7=E5=88=B6=E6=8C=87=E4=BB=A4?= =?UTF-8?q?=E3=80=81=E6=95=B0=E6=8D=AE=E6=9F=A5=E8=AF=A2=E6=8C=87=E4=BB=A4?= =?UTF-8?q?=E7=BB=B4=E6=8A=A4=E7=95=8C=E9=9D=A2=E5=90=8E=E7=AB=AF=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E5=BC=80=E5=8F=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/DataInstructController.java | 56 ++++++++++++++++++++++ .../controller/DataRecordController.java | 54 +++++++++++++++++++++ .../maintenance/entity/DataInstructEntity.java | 42 ++++++++++++++++ .../maintenance/entity/DataRecordEntity.java | 40 +++++++++++++++- .../maintenance/mapper/DataInstructMapper.java | 8 ++++ .../maintenance/mapper/DataRecordMapper.java | 7 +++ .../maintenance/service/DataInstructService.java | 40 ++++++++++++++++ .../maintenance/service/DataRecordService.java | 14 ++++++ 8 files changed, 260 insertions(+), 1 deletion(-) create mode 100644 hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/maintenance/controller/DataInstructController.java create mode 100644 hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/maintenance/controller/DataRecordController.java create mode 100644 hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/maintenance/entity/DataInstructEntity.java create mode 100644 hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/maintenance/mapper/DataInstructMapper.java create mode 100644 hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/maintenance/mapper/DataRecordMapper.java create mode 100644 hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/maintenance/service/DataInstructService.java create mode 100644 hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/maintenance/service/DataRecordService.java diff --git a/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/maintenance/controller/DataInstructController.java b/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/maintenance/controller/DataInstructController.java new file mode 100644 index 0000000..00abfd0 --- /dev/null +++ b/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/maintenance/controller/DataInstructController.java @@ -0,0 +1,56 @@ +package com.hnac.gglm.bigmodel.maintenance.controller; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; +import com.hnac.gglm.bigmodel.maintenance.entity.DataInstructEntity; +import com.hnac.gglm.bigmodel.maintenance.service.DataInstructService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; +import lombok.AllArgsConstructor; +import org.springblade.core.mp.support.Condition; +import org.springblade.core.mp.support.Query; +import org.springblade.core.tool.api.R; +import org.springblade.core.tool.utils.Func; +import org.springframework.web.bind.annotation.*; + +import javax.validation.Valid; + +@RestController +@RequestMapping("/dataInstruct") +@Api(value = "控制指令管理",tags = "控制指令管理") +@AllArgsConstructor +public class DataInstructController { + + private DataInstructService dataInstructService; + + + @PostMapping("/save") + @ApiOperation("保存控制指令") + @ApiOperationSupport(order = 1) + public R save(@RequestBody @Valid DataInstructEntity req) { + return R.data(dataInstructService.save(req)); + } + + @PostMapping("/update") + @ApiOperation("编辑控制指令") + @ApiOperationSupport(order = 2) + public R update(@RequestBody DataInstructEntity req) { + return R.data(dataInstructService.updateById(req)); + } + + @GetMapping("/listPage") + @ApiOperation("控制指令列表查询") + @ApiOperationSupport(order = 3) + public R> listPage(Query query, DataInstructEntity req) { + return R.data(dataInstructService.page(Condition.getPage(query),Condition.getQueryWrapper(req).lambda())); + } + + @DeleteMapping("/removeByIds") + @ApiOperation("删除控制指令") + @ApiOperationSupport(order = 4) + public R removeByIds(@RequestParam @ApiParam("id,按逗号分隔") String ids) { + return R.status(dataInstructService.removeByIds(Func.toLongList(",",ids))); + } + +} diff --git a/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/maintenance/controller/DataRecordController.java b/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/maintenance/controller/DataRecordController.java new file mode 100644 index 0000000..7588b01 --- /dev/null +++ b/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/maintenance/controller/DataRecordController.java @@ -0,0 +1,54 @@ +package com.hnac.gglm.bigmodel.maintenance.controller; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; +import com.hnac.gglm.bigmodel.maintenance.entity.DataRecordEntity; +import com.hnac.gglm.bigmodel.maintenance.service.DataRecordService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; +import lombok.AllArgsConstructor; +import org.springblade.core.mp.support.Condition; +import org.springblade.core.mp.support.Query; +import org.springblade.core.tool.api.R; +import org.springblade.core.tool.utils.Func; +import org.springframework.web.bind.annotation.*; + +import javax.validation.Valid; + +@RestController +@RequestMapping("/dataRecord") +@Api(value = "数据记录管理",tags = "数据记录管理") +@AllArgsConstructor +public class DataRecordController { + + private DataRecordService dataRecordService; + + @PostMapping("/save") + @ApiOperation("保存数据记录信息") + @ApiOperationSupport(order = 1) + public R save(@RequestBody @Valid DataRecordEntity req) { + return R.data(dataRecordService.save(req)); + } + + @PostMapping("/update") + @ApiOperation("编辑数据记录信息") + @ApiOperationSupport(order = 2) + public R update(@RequestBody DataRecordEntity req) { + return R.data(dataRecordService.updateById(req)); + } + + @GetMapping("/listPage") + @ApiOperation("数据记录列表查询") + @ApiOperationSupport(order = 3) + public R> listPage(Query query, DataRecordEntity req) { + return R.data(dataRecordService.page(Condition.getPage(query),Condition.getQueryWrapper(req).lambda())); + } + + @DeleteMapping("/removeByIds") + @ApiOperation("删除数据记录") + @ApiOperationSupport(order = 4) + public R removeByIds(@RequestParam @ApiParam("id,按逗号分隔") String ids) { + return R.status(dataRecordService.removeByIds(Func.toLongList(",",ids))); + } +} diff --git a/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/maintenance/entity/DataInstructEntity.java b/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/maintenance/entity/DataInstructEntity.java new file mode 100644 index 0000000..d6f4a4a --- /dev/null +++ b/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/maintenance/entity/DataInstructEntity.java @@ -0,0 +1,42 @@ +package com.hnac.gglm.bigmodel.maintenance.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import org.springblade.core.mp.support.QueryField; +import org.springblade.core.mp.support.SqlCondition; +import org.springblade.core.tenant.mp.TenantEntity; + +@Data +@EqualsAndHashCode +@TableName("gglm_data_instruct") +@ApiModel(value = "自定义控制指令表",description = "自定义控制指令表") +public class DataInstructEntity extends TenantEntity { + + @ApiModelProperty("item") + private String itemId; + + @ApiModelProperty("站点名称") + @QueryField(condition = SqlCondition.LIKE) + private String stationName; + + @ApiModelProperty("站点ID") + private String stationId; + + @ApiModelProperty("遥控的设备名称") + @QueryField(condition = SqlCondition.LIKE) + private String deviceName; + + @ApiModelProperty("遥控的设备ID") + private String deviceId; + + @ApiModelProperty("遥控名称(不包含站点)") + @QueryField(condition = SqlCondition.LIKE) + private String ykName; + + @ApiModelProperty("用于展示和匹配的全称,一般可设为 站点名称-遥控名称") + private String itemName; + +} diff --git a/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/maintenance/entity/DataRecordEntity.java b/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/maintenance/entity/DataRecordEntity.java index c94fdd6..81cb222 100644 --- a/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/maintenance/entity/DataRecordEntity.java +++ b/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/maintenance/entity/DataRecordEntity.java @@ -1,6 +1,12 @@ package com.hnac.gglm.bigmodel.maintenance.entity; +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; import lombok.Data; +import lombok.EqualsAndHashCode; +import org.springblade.core.mp.support.QueryField; +import org.springblade.core.mp.support.SqlCondition; import org.springblade.core.tenant.mp.TenantEntity; /** @@ -8,10 +14,42 @@ import org.springblade.core.tenant.mp.TenantEntity; * @Date: 2024/07/04 15:45 */ @Data +@EqualsAndHashCode +@TableName("gglm_data_record") +@ApiModel(value = "自定义数据查询表",description = "自定义数据查询表") public class DataRecordEntity extends TenantEntity { - private String tableId; + @ApiModelProperty("item") + @QueryField(condition = SqlCondition.EQUAL) + private String itemId; + + @ApiModelProperty("站点名称") + @QueryField(condition = SqlCondition.LIKE) + private String stationName; + + @ApiModelProperty("站点ID") + private String stationId; + + @ApiModelProperty("遥控的设备名称") + @QueryField(condition = SqlCondition.LIKE) + private String deviceName; + + @ApiModelProperty("遥控的设备ID") + private String deviceId; + + @ApiModelProperty("用于展示和匹配的全称,一般可设为 站点名称-遥控名称") + private String itemName; + + @ApiModelProperty("记录名称") + @QueryField(condition = SqlCondition.LIKE) + private String recordName; + + @ApiModelProperty("单位") + private String unit; + + @ApiModelProperty("取数规则") + private String rule; } diff --git a/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/maintenance/mapper/DataInstructMapper.java b/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/maintenance/mapper/DataInstructMapper.java new file mode 100644 index 0000000..cca88da --- /dev/null +++ b/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/maintenance/mapper/DataInstructMapper.java @@ -0,0 +1,8 @@ +package com.hnac.gglm.bigmodel.maintenance.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.hnac.gglm.bigmodel.maintenance.entity.DataInstructEntity; + +public interface DataInstructMapper extends BaseMapper { + +} diff --git a/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/maintenance/mapper/DataRecordMapper.java b/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/maintenance/mapper/DataRecordMapper.java new file mode 100644 index 0000000..f36ba0f --- /dev/null +++ b/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/maintenance/mapper/DataRecordMapper.java @@ -0,0 +1,7 @@ +package com.hnac.gglm.bigmodel.maintenance.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.hnac.gglm.bigmodel.maintenance.entity.DataRecordEntity; + +public interface DataRecordMapper extends BaseMapper { +} diff --git a/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/maintenance/service/DataInstructService.java b/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/maintenance/service/DataInstructService.java new file mode 100644 index 0000000..444c320 --- /dev/null +++ b/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/maintenance/service/DataInstructService.java @@ -0,0 +1,40 @@ +package com.hnac.gglm.bigmodel.maintenance.service; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.hnac.gglm.bigmodel.maintenance.entity.DataInstructEntity; +import com.hnac.gglm.bigmodel.maintenance.mapper.DataInstructMapper; +import lombok.AllArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springblade.core.mp.base.BaseServiceImpl; +import org.springframework.stereotype.Service; + +@Service +@Slf4j +@AllArgsConstructor +public class DataInstructService extends BaseServiceImpl { + + public boolean save(DataInstructEntity entity) { + //对遥控名称判重 + LambdaQueryWrapper queryWrapper = new QueryWrapper() + .lambda().eq(DataInstructEntity::getYkName, entity.getYkName()); + Long count = baseMapper.selectCount(queryWrapper); + if (count > 0) { + return false; + } + //保存信息 + return save(entity); + } + + public boolean updateById(DataInstructEntity entity) { + LambdaQueryWrapper queryWrapper = new QueryWrapper() + .lambda().eq(DataInstructEntity::getItemName, entity.getItemName()) + .ne(DataInstructEntity::getId, entity.getId()); + Long count = baseMapper.selectCount(queryWrapper); + if (count > 0) { + return false; + } + //对遥控名称判重 + return true; + } +} diff --git a/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/maintenance/service/DataRecordService.java b/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/maintenance/service/DataRecordService.java new file mode 100644 index 0000000..ffb3743 --- /dev/null +++ b/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/maintenance/service/DataRecordService.java @@ -0,0 +1,14 @@ +package com.hnac.gglm.bigmodel.maintenance.service; + +import com.hnac.gglm.bigmodel.maintenance.entity.DataRecordEntity; +import com.hnac.gglm.bigmodel.maintenance.mapper.DataRecordMapper; +import lombok.AllArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springblade.core.mp.base.BaseServiceImpl; +import org.springframework.stereotype.Service; + +@Service +@Slf4j +@AllArgsConstructor +public class DataRecordService extends BaseServiceImpl { +} From b7f4f14816867ff31f98a099a92c4587f720c931 Mon Sep 17 00:00:00 2001 From: luyie Date: Fri, 20 Sep 2024 19:20:11 +0800 Subject: [PATCH 07/12] =?UTF-8?q?add:=E7=9F=A5=E8=AF=86=E5=BA=93=E9=97=AE?= =?UTF-8?q?=E9=A2=98=E6=95=B0=E6=8D=AE=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hnac/gglm/bigmodel/business/controller/VectorDataController.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/business/controller/VectorDataController.java b/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/business/controller/VectorDataController.java index 3aa7742..fcdde9f 100644 --- a/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/business/controller/VectorDataController.java +++ b/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/business/controller/VectorDataController.java @@ -70,7 +70,7 @@ public class VectorDataController { @GetMapping("/getDeviceAttr") @ApiOperation(value = "获取设备属性数据") - @ApiOperationSupport(order = 4) + @ApiOperationSupport(order = 5) @ApiInterface public R> getDeviceAttr( ) { return R.data(vectorDataService.getDeviceAttr()); @@ -78,7 +78,7 @@ public class VectorDataController { @GetMapping("/listKnowledgeData") @ApiOperation(value = "获取知识库数据") - @ApiOperationSupport(order = 5) + @ApiOperationSupport(order = 6) @ApiInterface public R> listKnowledgeData() { return R.data(knowledgeDataService.listKnowledgeData()); From e6521e23923b1baa9f6bbeee3d2b9bac3925b1ce Mon Sep 17 00:00:00 2001 From: luyie Date: Fri, 20 Sep 2024 23:46:28 +0800 Subject: [PATCH 08/12] =?UTF-8?q?add:=E8=AE=BE=E5=A4=87=E5=8A=9F=E8=83=BD?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../bigmodel/business/constants/AccessRules.java | 49 ++++++++++++++++++++++ .../business/controller/VectorDataController.java | 12 +++++- .../business/service/VectorDataService.java | 3 ++ .../service/impl/VectorDataServiceImpl.java | 25 ++++++++++- 4 files changed, 87 insertions(+), 2 deletions(-) create mode 100644 hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/business/constants/AccessRules.java diff --git a/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/business/constants/AccessRules.java b/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/business/constants/AccessRules.java new file mode 100644 index 0000000..ec1215b --- /dev/null +++ b/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/business/constants/AccessRules.java @@ -0,0 +1,49 @@ +package com.hnac.gglm.bigmodel.business.constants; + +import lombok.Getter; + +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; + +/** + * @Author: ypj + * @Date: 2024/9/20 22:39 + */ +@Getter +public enum AccessRules { + MOST_EARLY("0", "最早值"), + LARGEST("1", "最大值"), + SMALLEST("2", "最小值"), + AVERAGE("3", "平均值"), + SUM("4", "累计值/和值"), + CHANGE("5", "变化值/差值"), + LAST("6", "最新值/最后值"); + + private final String code; + private final String desc; + + private static final Map map = new ConcurrentHashMap<>(); + + static { + for (AccessRules accessRules : AccessRules.values()) { + map.put(accessRules.code, accessRules); + } + } + + AccessRules(String code, String desc) { + this.code = code; + this.desc = desc; + } + + public static AccessRules getByCode(String code) { + return map.get(code); + } + + public static String getDescByCode(String code) { + AccessRules rule = getByCode(code); + if (null != rule) { + return rule.getDesc(); + } + return null; + } +} diff --git a/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/business/controller/VectorDataController.java b/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/business/controller/VectorDataController.java index fcdde9f..598ca28 100644 --- a/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/business/controller/VectorDataController.java +++ b/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/business/controller/VectorDataController.java @@ -7,6 +7,7 @@ import com.hnac.gglm.bigmodel.business.vo.DeviceModelData; import com.hnac.gglm.bigmodel.maintenance.dto.KnowledgeData; import com.hnac.hzinfo.api.annotation.ApiInterface; import com.hnac.hzinfo.sdk.v5.device.dto.DeviceAttrInfoDTO; +import com.hnac.hzinfo.sdk.v5.device.dto.DeviceFuncInfoDTO; import com.hnac.hzinfo.sdk.v5.model.vo.ModelAttrVO; import com.hnac.hzinfo.sdk.v5.model.vo.ModelEventVO; import com.hnac.hzinfo.sdk.v5.model.vo.ModelFuncVO; @@ -76,11 +77,20 @@ public class VectorDataController { return R.data(vectorDataService.getDeviceAttr()); } + @GetMapping("/getDeviceFunc") + @ApiOperation(value = "获取设备功能数据") + @ApiOperationSupport(order = 6) + @ApiInterface + public R> getDeviceFunc() { + return R.data(vectorDataService.getDeviceFunc()); + } + @GetMapping("/listKnowledgeData") @ApiOperation(value = "获取知识库数据") - @ApiOperationSupport(order = 6) + @ApiOperationSupport(order = 7) @ApiInterface public R> listKnowledgeData() { return R.data(knowledgeDataService.listKnowledgeData()); } + } diff --git a/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/business/service/VectorDataService.java b/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/business/service/VectorDataService.java index cf61e75..15c5224 100644 --- a/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/business/service/VectorDataService.java +++ b/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/business/service/VectorDataService.java @@ -2,6 +2,7 @@ package com.hnac.gglm.bigmodel.business.service; import com.hnac.gglm.bigmodel.business.vo.DeviceModelData; import com.hnac.hzinfo.sdk.v5.device.dto.DeviceAttrInfoDTO; +import com.hnac.hzinfo.sdk.v5.device.dto.DeviceFuncInfoDTO; import com.hnac.hzinfo.sdk.v5.model.vo.ModelAttrVO; import com.hnac.hzinfo.sdk.v5.model.vo.ModelEventVO; import com.hnac.hzinfo.sdk.v5.model.vo.ModelFuncVO; @@ -23,4 +24,6 @@ public interface VectorDataService { List getModelData(); List getDeviceAttr(); + + List getDeviceFunc(); } diff --git a/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/business/service/impl/VectorDataServiceImpl.java b/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/business/service/impl/VectorDataServiceImpl.java index f4bce9d..26bf4b4 100644 --- a/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/business/service/impl/VectorDataServiceImpl.java +++ b/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/business/service/impl/VectorDataServiceImpl.java @@ -1,9 +1,11 @@ package com.hnac.gglm.bigmodel.business.service.impl; +import com.hnac.gglm.bigmodel.business.constants.AccessRules; import com.hnac.gglm.bigmodel.business.service.VectorDataService; import com.hnac.gglm.bigmodel.business.vo.DeviceModelData; import com.hnac.hzinfo.sdk.v5.device.client.DeviceClient; import com.hnac.hzinfo.sdk.v5.device.dto.DeviceAttrInfoDTO; +import com.hnac.hzinfo.sdk.v5.device.dto.DeviceFuncInfoDTO; import com.hnac.hzinfo.sdk.v5.model.ModelClient; import com.hnac.hzinfo.sdk.v5.model.vo.ModelAttrVO; import com.hnac.hzinfo.sdk.v5.model.vo.ModelEventVO; @@ -67,6 +69,27 @@ public class VectorDataServiceImpl implements VectorDataService { @Override public List getDeviceAttr() { - return deviceClient.listDeviceAttr().getData(); + List list = deviceClient.listDeviceAttr().getData(); + if (null != list && !list.isEmpty()) { + list.forEach(item -> { + item.setItemName(item.getProjectName() + " " + item.getDeviceName() + " " + item.getName()); + String rule = AccessRules.getDescByCode(item.getRule()); + if (null != rule) { + item.setRule(rule); + } + }); + } + return list; + } + + @Override + public List getDeviceFunc() { + List list = deviceClient.listDeviceFunc().getData(); + if (null != list && !list.isEmpty()) { + list.forEach(item -> { + item.setItemName(item.getProjectName() + " " + item.getDeviceName() + " " + item.getName()); + }); + } + return list; } } From 8745069568a2b0bb8abbd706b727814658a9718c Mon Sep 17 00:00:00 2001 From: luyie Date: Sat, 21 Sep 2024 10:13:42 +0800 Subject: [PATCH 09/12] =?UTF-8?q?add:=E7=94=BB=E5=B8=83=E5=90=91=E9=87=8F?= =?UTF-8?q?=E6=BA=90=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../business/controller/VectorDataController.java | 11 ++++++++++- .../bigmodel/business/service/VectorDataService.java | 3 +++ .../business/service/impl/VectorDataServiceImpl.java | 16 +++++++++------- 3 files changed, 22 insertions(+), 8 deletions(-) diff --git a/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/business/controller/VectorDataController.java b/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/business/controller/VectorDataController.java index 598ca28..437465a 100644 --- a/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/business/controller/VectorDataController.java +++ b/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/business/controller/VectorDataController.java @@ -11,6 +11,7 @@ import com.hnac.hzinfo.sdk.v5.device.dto.DeviceFuncInfoDTO; import com.hnac.hzinfo.sdk.v5.model.vo.ModelAttrVO; import com.hnac.hzinfo.sdk.v5.model.vo.ModelEventVO; import com.hnac.hzinfo.sdk.v5.model.vo.ModelFuncVO; +import com.hnac.hzinfo.sdk.v5.scada.vo.CanvasInfo; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import lombok.AllArgsConstructor; @@ -73,7 +74,7 @@ public class VectorDataController { @ApiOperation(value = "获取设备属性数据") @ApiOperationSupport(order = 5) @ApiInterface - public R> getDeviceAttr( ) { + public R> getDeviceAttr() { return R.data(vectorDataService.getDeviceAttr()); } @@ -93,4 +94,12 @@ public class VectorDataController { return R.data(knowledgeDataService.listKnowledgeData()); } + @GetMapping("/listCanvas") + @ApiOperation(value = "获取画布数据") + @ApiOperationSupport(order = 8) + @ApiInterface + public R> listCanvas() { + return R.data(vectorDataService.getScadaCanvas()); + } + } diff --git a/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/business/service/VectorDataService.java b/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/business/service/VectorDataService.java index 15c5224..afa5941 100644 --- a/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/business/service/VectorDataService.java +++ b/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/business/service/VectorDataService.java @@ -6,6 +6,7 @@ import com.hnac.hzinfo.sdk.v5.device.dto.DeviceFuncInfoDTO; import com.hnac.hzinfo.sdk.v5.model.vo.ModelAttrVO; import com.hnac.hzinfo.sdk.v5.model.vo.ModelEventVO; import com.hnac.hzinfo.sdk.v5.model.vo.ModelFuncVO; +import com.hnac.hzinfo.sdk.v5.scada.vo.CanvasInfo; import java.util.List; @@ -26,4 +27,6 @@ public interface VectorDataService { List getDeviceAttr(); List getDeviceFunc(); + + List getScadaCanvas(); } diff --git a/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/business/service/impl/VectorDataServiceImpl.java b/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/business/service/impl/VectorDataServiceImpl.java index 26bf4b4..795a628 100644 --- a/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/business/service/impl/VectorDataServiceImpl.java +++ b/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/business/service/impl/VectorDataServiceImpl.java @@ -10,6 +10,8 @@ import com.hnac.hzinfo.sdk.v5.model.ModelClient; import com.hnac.hzinfo.sdk.v5.model.vo.ModelAttrVO; import com.hnac.hzinfo.sdk.v5.model.vo.ModelEventVO; import com.hnac.hzinfo.sdk.v5.model.vo.ModelFuncVO; +import com.hnac.hzinfo.sdk.v5.scada.ScadaClient; +import com.hnac.hzinfo.sdk.v5.scada.vo.CanvasInfo; import lombok.AllArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springblade.core.tool.api.R; @@ -29,6 +31,7 @@ import java.util.stream.Collectors; public class VectorDataServiceImpl implements VectorDataService { private final ModelClient modelClient; private final DeviceClient deviceClient; + private final ScadaClient scadaClient; @Override @@ -84,12 +87,11 @@ public class VectorDataServiceImpl implements VectorDataService { @Override public List getDeviceFunc() { - List list = deviceClient.listDeviceFunc().getData(); - if (null != list && !list.isEmpty()) { - list.forEach(item -> { - item.setItemName(item.getProjectName() + " " + item.getDeviceName() + " " + item.getName()); - }); - } - return list; + return deviceClient.listDeviceFunc().getData(); + } + + @Override + public List getScadaCanvas() { + return scadaClient.listCanvas().getData(); } } From 0b0519371d0d4b6f79da29802cf628e874d27b88 Mon Sep 17 00:00:00 2001 From: luyie Date: Sat, 21 Sep 2024 11:51:12 +0800 Subject: [PATCH 10/12] =?UTF-8?q?fix:=E8=A7=86=E9=A2=91=E5=B7=A1=E6=A3=80?= =?UTF-8?q?=E5=8F=96=E6=B6=88=E5=BC=82=E5=B8=B8=E6=8A=9B=E5=87=BA=EF=BC=8C?= =?UTF-8?q?=E8=AE=B0=E5=BD=95=E5=AF=B9=E5=BA=94=E8=AE=B0=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hnac/hzinfo/inspect/task/schedule/VideoTaskSchedule.java | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/schedule/VideoTaskSchedule.java b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/schedule/VideoTaskSchedule.java index c408c71..dff2a32 100644 --- a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/schedule/VideoTaskSchedule.java +++ b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/schedule/VideoTaskSchedule.java @@ -195,6 +195,8 @@ public class VideoTaskSchedule { record.setFileUrl(picUrl); record.setCurrentValue(picUrl); pictureHandle(picUrl, content.getContentId(), record, task); + } else { + record.setCurrentValue("获取视频地址失败"); } } return record; @@ -257,7 +259,7 @@ public class VideoTaskSchedule { } } catch (IOException e) { log.error("获取截图文件失败", e); - throw new HzServiceException("获取截图文件失败"); + record.setCurrentValue("获取截图文件失败"); } R fileResponse = ossClient.putFileByNameAndTenantId("file", multipartFile, task.getTenantId()); log.info("【taskId:{}}】视频巡检任务执行,上传minio结果,{}", task.getId(), Optional.ofNullable(fileResponse).map(JsonUtil::toJson).orElse("null")); @@ -267,6 +269,7 @@ public class VideoTaskSchedule { ContentEntity content = contentService.getById(contentId); if (StringUtil.isBlank(content.getMultiCheckTypeSon())) { + record.setCurrentValue("没有找到巡检内容"); return; } @@ -279,7 +282,9 @@ public class VideoTaskSchedule { BigModelAnalysisResponseDTO analysisResponse = bigModelClient.analysis(analysisRequest); log.info("【taskId:{}}】视频巡检任务执行,大模型分析结果,{}", task.getId(), Optional.ofNullable(analysisResponse).map(JsonUtil::toJson).orElse("null")); if (!analysisResponse.getSuccess() || CollectionUtil.isEmpty(analysisResponse.getData())) { - throw new HzServiceException("大模型识别失败"); + record.setCurrentValue("大模型分析失败"); + log.error("【taskId:{}}】,返回消息 : {}" , task.getId(),Optional.ofNullable(analysisResponse).map(JsonUtil::toJson).orElse("null")); + return; } List results = analysisResponse.getData(); StringBuilder stringBuilder = new StringBuilder(); @@ -321,7 +326,7 @@ public class VideoTaskSchedule { messageDTO.setContent(textBuilder.toString()); R booleanR = messageClient.sendAppAndWsMsgByUsers(messageDTO); if (!booleanR.isSuccess()) { - throw new ServiceException("消息推送失败"); + log.error("【taskId:{}}】,返回的消息为{}", task.getId(), booleanR.getMsg()); } log.info("推送成功~"); } From bd2b81643fce96aa15f90415d3ba687c2833e07d Mon Sep 17 00:00:00 2001 From: luyie Date: Sat, 21 Sep 2024 11:56:24 +0800 Subject: [PATCH 11/12] =?UTF-8?q?fix:=E8=A7=86=E9=A2=91=E5=B7=A1=E6=A3=80?= =?UTF-8?q?=E5=8F=96=E6=B6=88=E5=BC=82=E5=B8=B8=E6=8A=9B=E5=87=BA=EF=BC=8C?= =?UTF-8?q?=E8=AE=B0=E5=BD=95=E5=AF=B9=E5=BA=94=E8=AE=B0=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/hnac/hzinfo/inspect/task/schedule/VideoTaskSchedule.java | 1 + 1 file changed, 1 insertion(+) diff --git a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/schedule/VideoTaskSchedule.java b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/schedule/VideoTaskSchedule.java index dff2a32..88e1d4c 100644 --- a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/schedule/VideoTaskSchedule.java +++ b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/schedule/VideoTaskSchedule.java @@ -260,6 +260,7 @@ public class VideoTaskSchedule { } catch (IOException e) { log.error("获取截图文件失败", e); record.setCurrentValue("获取截图文件失败"); + return; } R fileResponse = ossClient.putFileByNameAndTenantId("file", multipartFile, task.getTenantId()); log.info("【taskId:{}}】视频巡检任务执行,上传minio结果,{}", task.getId(), Optional.ofNullable(fileResponse).map(JsonUtil::toJson).orElse("null")); From 57cbdf8803c30b618ec5f2d560674732736ad9bc Mon Sep 17 00:00:00 2001 From: wangyinsheng <2310589501@qq.com> Date: Sat, 21 Sep 2024 12:59:48 +0800 Subject: [PATCH 12/12] =?UTF-8?q?add:=E6=8E=A7=E5=88=B6=E6=8C=87=E4=BB=A4?= =?UTF-8?q?=E3=80=81=E6=95=B0=E6=8D=AE=E6=9F=A5=E8=AF=A2=E6=8C=87=E4=BB=A4?= =?UTF-8?q?=E5=90=8C=E6=AD=A5=E5=90=91=E9=87=8F=E6=95=B0=E6=8D=AE=E5=BA=93?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E5=BC=80=E5=8F=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/DataInstructController.java | 13 ++++++ .../controller/DataRecordController.java | 12 +++++ .../bigmodel/maintenance/dto/DeviceAttrDTO.java | 33 ++++++++++++++ .../bigmodel/maintenance/dto/DeviceFuncDTO.java | 28 ++++++++++++ .../maintenance/service/DataInstructService.java | 30 ++++++++++++- .../maintenance/service/DataRecordService.java | 51 ++++++++++++++++++++++ 6 files changed, 166 insertions(+), 1 deletion(-) create mode 100644 hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/maintenance/dto/DeviceAttrDTO.java create mode 100644 hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/maintenance/dto/DeviceFuncDTO.java diff --git a/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/maintenance/controller/DataInstructController.java b/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/maintenance/controller/DataInstructController.java index 00abfd0..f588e6f 100644 --- a/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/maintenance/controller/DataInstructController.java +++ b/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/maintenance/controller/DataInstructController.java @@ -2,8 +2,11 @@ package com.hnac.gglm.bigmodel.maintenance.controller; import com.baomidou.mybatisplus.core.metadata.IPage; import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; +import com.hnac.gglm.bigmodel.maintenance.dto.DeviceFuncDTO; import com.hnac.gglm.bigmodel.maintenance.entity.DataInstructEntity; import com.hnac.gglm.bigmodel.maintenance.service.DataInstructService; +import com.hnac.hzims.operational.station.entity.StationVideoTypeEntity; +import com.hnac.hzinfo.api.annotation.ApiInterface; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiParam; @@ -15,6 +18,7 @@ import org.springblade.core.tool.utils.Func; import org.springframework.web.bind.annotation.*; import javax.validation.Valid; +import java.util.List; @RestController @RequestMapping("/dataInstruct") @@ -53,4 +57,13 @@ public class DataInstructController { return R.status(dataInstructService.removeByIds(Func.toLongList(",",ids))); } + + @GetMapping ("/getDataInstructList") + @ApiOperationSupport(order = 210) + @ApiOperation(value = "查询指令记录") + @ApiInterface + public R> getDataInstructList() { + return R.data(dataInstructService.getDataInstructList()); + } + } diff --git a/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/maintenance/controller/DataRecordController.java b/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/maintenance/controller/DataRecordController.java index 7588b01..d561cf4 100644 --- a/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/maintenance/controller/DataRecordController.java +++ b/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/maintenance/controller/DataRecordController.java @@ -2,8 +2,10 @@ package com.hnac.gglm.bigmodel.maintenance.controller; import com.baomidou.mybatisplus.core.metadata.IPage; import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; +import com.hnac.gglm.bigmodel.maintenance.dto.DeviceAttrDTO; import com.hnac.gglm.bigmodel.maintenance.entity.DataRecordEntity; import com.hnac.gglm.bigmodel.maintenance.service.DataRecordService; +import com.hnac.hzinfo.api.annotation.ApiInterface; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiParam; @@ -15,6 +17,7 @@ import org.springblade.core.tool.utils.Func; import org.springframework.web.bind.annotation.*; import javax.validation.Valid; +import java.util.List; @RestController @RequestMapping("/dataRecord") @@ -51,4 +54,13 @@ public class DataRecordController { public R removeByIds(@RequestParam @ApiParam("id,按逗号分隔") String ids) { return R.status(dataRecordService.removeByIds(Func.toLongList(",",ids))); } + + @GetMapping ("/getDataRecordList") + @ApiOperationSupport(order = 200) + @ApiOperation(value = "查询数据记录记录") + @ApiInterface + public R> getDataRecordList() { + return R.data(dataRecordService.getDataRecordList()); + } + } diff --git a/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/maintenance/dto/DeviceAttrDTO.java b/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/maintenance/dto/DeviceAttrDTO.java new file mode 100644 index 0000000..adcc3d4 --- /dev/null +++ b/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/maintenance/dto/DeviceAttrDTO.java @@ -0,0 +1,33 @@ +package com.hnac.gglm.bigmodel.maintenance.dto; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +@Data +public class DeviceAttrDTO { + + + @ApiModelProperty("item") + private String itemId; + + @ApiModelProperty("站点名称") + private String stationName; + + @ApiModelProperty("站点ID") + private String stationId; + + @ApiModelProperty("遥控的设备名称") + private String deviceName; + + @ApiModelProperty("遥控的设备ID") + private String deviceId; + + @ApiModelProperty("用于展示和匹配的全称,一般可设为 站点名称-遥控名称") + private String itemName; + + @ApiModelProperty("记录名称") + private String recordName; + + @ApiModelProperty("取数规则") + private String rule; +} diff --git a/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/maintenance/dto/DeviceFuncDTO.java b/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/maintenance/dto/DeviceFuncDTO.java new file mode 100644 index 0000000..c60ee79 --- /dev/null +++ b/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/maintenance/dto/DeviceFuncDTO.java @@ -0,0 +1,28 @@ +package com.hnac.gglm.bigmodel.maintenance.dto; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + + +@Data +public class DeviceFuncDTO { + + @ApiModelProperty("item") + private String itemId; + + @ApiModelProperty("站点名称") + private String stationName; + + @ApiModelProperty("站点ID") + private String stationId; + + @ApiModelProperty("遥控的设备名称") + private String deviceName; + + @ApiModelProperty("遥控的设备ID") + private String deviceId; + + @ApiModelProperty("用于展示和匹配的全称,一般可设为 站点名称-遥控名称") + private String itemName; + +} diff --git a/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/maintenance/service/DataInstructService.java b/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/maintenance/service/DataInstructService.java index 444c320..11ac798 100644 --- a/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/maintenance/service/DataInstructService.java +++ b/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/maintenance/service/DataInstructService.java @@ -2,18 +2,28 @@ package com.hnac.gglm.bigmodel.maintenance.service; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.hnac.gglm.bigmodel.business.service.VectorDataService; +import com.hnac.gglm.bigmodel.maintenance.dto.DeviceFuncDTO; import com.hnac.gglm.bigmodel.maintenance.entity.DataInstructEntity; import com.hnac.gglm.bigmodel.maintenance.mapper.DataInstructMapper; +import com.hnac.hzinfo.sdk.v5.device.dto.DeviceFuncInfoDTO; import lombok.AllArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springblade.core.mp.base.BaseServiceImpl; +import org.springblade.core.tool.utils.BeanUtil; import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; + +import java.util.ArrayList; +import java.util.List; @Service @Slf4j @AllArgsConstructor public class DataInstructService extends BaseServiceImpl { + private final VectorDataService vectorDataService; + public boolean save(DataInstructEntity entity) { //对遥控名称判重 LambdaQueryWrapper queryWrapper = new QueryWrapper() @@ -27,6 +37,7 @@ public class DataInstructService extends BaseServiceImpl queryWrapper = new QueryWrapper() .lambda().eq(DataInstructEntity::getItemName, entity.getItemName()) .ne(DataInstructEntity::getId, entity.getId()); @@ -34,7 +45,24 @@ public class DataInstructService extends BaseServiceImpl 0) { return false; } - //对遥控名称判重 + //修改信息 return true; } + + public List getDataInstructList() { + List list = baseMapper.selectList(null); + List deviceFuncDTOS = BeanUtil.copyProperties(list, DeviceFuncDTO.class); + List deviceFuncList = vectorDataService.getDeviceFunc(); + for (DeviceFuncInfoDTO deviceFunc : deviceFuncList) { + DeviceFuncDTO deviceFuncDTO = new DeviceFuncDTO(); + deviceFuncDTO.setDeviceId(deviceFunc.getDeviceId()); + deviceFuncDTO.setDeviceName(deviceFunc.getDeviceName()); + deviceFuncDTO.setItemId(deviceFunc.getSignage()); + deviceFuncDTO.setItemName(deviceFunc.getItemName()); + deviceFuncDTO.setStationName(deviceFunc.getProjectName()); + deviceFuncDTO.setStationId(deviceFunc.getProjectId()); + deviceFuncDTOS.add(deviceFuncDTO); + } + return deviceFuncDTOS; + } } diff --git a/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/maintenance/service/DataRecordService.java b/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/maintenance/service/DataRecordService.java index ffb3743..06cf331 100644 --- a/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/maintenance/service/DataRecordService.java +++ b/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/maintenance/service/DataRecordService.java @@ -1,14 +1,65 @@ package com.hnac.gglm.bigmodel.maintenance.service; +import com.hnac.gglm.bigmodel.business.service.VectorDataService; +import com.hnac.gglm.bigmodel.maintenance.dto.DeviceAttrDTO; +import com.hnac.gglm.bigmodel.maintenance.dto.DeviceFuncDTO; import com.hnac.gglm.bigmodel.maintenance.entity.DataRecordEntity; import com.hnac.gglm.bigmodel.maintenance.mapper.DataRecordMapper; +import com.hnac.hzinfo.sdk.v5.device.dto.DeviceAttrInfoDTO; import lombok.AllArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springblade.core.mp.base.BaseServiceImpl; +import org.springblade.core.tool.utils.BeanUtil; import org.springframework.stereotype.Service; +import java.util.List; + @Service @Slf4j @AllArgsConstructor public class DataRecordService extends BaseServiceImpl { + + private final VectorDataService vectorDataService; + + public boolean save(DataRecordEntity entity) { + splicing(entity); + return save(entity); + } + + public boolean updateById(DataRecordEntity entity) { + splicing(entity); + return updateById(entity); + } + + /** + * //拼接itemName + * @param entity + */ + private void splicing(DataRecordEntity entity) { + String stationName = entity.getStationName() == null ? "" : entity.getStationName(); + String deviceName = entity.getDeviceName() == null ? "" : entity.getDeviceName(); + String recordName = entity.getRecordName() == null ? "" : entity.getRecordName(); + entity.setItemName(new StringBuffer(stationName) + .append(" ").append(deviceName) + .append(" ").append(recordName).toString()); + } + + public List getDataRecordList() { + List list = baseMapper.selectList(null); + List deviceAttrDTOS = BeanUtil.copyProperties(list, DeviceAttrDTO.class); + List deviceAttrList = vectorDataService.getDeviceAttr(); + for (DeviceAttrInfoDTO deviceAttr : deviceAttrList) { + DeviceAttrDTO deviceAttrDTO = new DeviceAttrDTO(); + deviceAttrDTO.setDeviceId(deviceAttr.getDeviceId()); + deviceAttrDTO.setDeviceName(deviceAttr.getDeviceName()); + deviceAttrDTO.setStationName(deviceAttr.getProjectName()); + deviceAttrDTO.setStationId(deviceAttr.getProjectId()); + deviceAttrDTO.setRecordName(deviceAttr.getName()); + deviceAttrDTO.setItemId(deviceAttr.getSignage()); + deviceAttrDTO.setRule(deviceAttr.getRule()); + deviceAttrDTO.setItemName(deviceAttr.getItemName()); + deviceAttrDTOS.add(deviceAttrDTO); + } + return deviceAttrDTOS; + } }