From 8745069568a2b0bb8abbd706b727814658a9718c Mon Sep 17 00:00:00 2001 From: luyie Date: Sat, 21 Sep 2024 10:13:42 +0800 Subject: [PATCH] =?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(); } }