From 69cacf370a2478c6ce657ce9181e7ffd818f271f Mon Sep 17 00:00:00 2001 From: haungxing <1203316822@qq.com> Date: Wed, 22 May 2024 16:27:59 +0800 Subject: [PATCH] =?UTF-8?q?add:=E9=81=A5=E6=8E=A7=E9=89=B4=E6=9D=83?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../bigmodel/interactive/constants/FuncRouteEnum.java | 1 + .../service/impl/ExtraResolveStrategyService.java | 15 +++++++++++++++ .../com/hnac/hzims/bigmodel/interactive/vo/DataVO.java | 3 +++ 3 files changed, 19 insertions(+) diff --git a/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/interactive/constants/FuncRouteEnum.java b/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/interactive/constants/FuncRouteEnum.java index 46887e8..4b1d359 100644 --- a/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/interactive/constants/FuncRouteEnum.java +++ b/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/interactive/constants/FuncRouteEnum.java @@ -20,6 +20,7 @@ public enum FuncRouteEnum { CHOOSE_CANVAS("choose_canvas","选择画面",null), CHOOSE_FAULT("choose_fault","选择故障",null), CONFIRM_YK("confirm_yk","遥控确认", FunctionConstants.TypeEnum.PARAMS), + SHOW_PARAM("show_param","设备参数查询", FunctionConstants.TypeEnum.PARAMS), ; @Getter private String funcCode; diff --git a/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/interactive/service/impl/ExtraResolveStrategyService.java b/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/interactive/service/impl/ExtraResolveStrategyService.java index a9c63a6..bcda8cb 100644 --- a/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/interactive/service/impl/ExtraResolveStrategyService.java +++ b/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/interactive/service/impl/ExtraResolveStrategyService.java @@ -69,6 +69,8 @@ public class ExtraResolveStrategyService { return this.resolveChooseFault(extra); case CONFIRM_YK: return this.resolveConfirmRemote(extra); + case SHOW_PARAM: + return this.resolveShowParam(extra); default: break; } @@ -77,6 +79,17 @@ public class ExtraResolveStrategyService { return JSONObject.parseObject(JSON.toJSONString(extra),ExtraVO.class); } + private ExtraVO resolveShowParam(Map extra) { + ExtraVO result = new ExtraVO(); + result.setFuncCode(FuncRouteEnum.SHOW_PARAM.getFuncCode()); + result.setType(FuncRouteEnum.SHOW_PARAM.getType().getType()); + Map param = new HashMap(1); + DataVO data = JSONObject.parseObject(JSON.toJSONString(extra.get("data")),DataVO.class); + param.put("data", data); + result.setParams(param); + return result; + } + private ExtraVO resolveConfirmRemote(Map extra) { ExtraVO result = new ExtraVO(); RemoteParamVO remoteParam = JSONObject.parseObject(JSON.toJSONString(extra.get("data")), RemoteParamVO.class); @@ -86,6 +99,8 @@ public class ExtraResolveStrategyService { if(funcVOR.isSuccess()) { Map param = new HashMap(1); param.put("control",funcVOR.getData()); + param.put("deviceName",remoteParam.getDeviceName()); + param.put("projectName",remoteParam.getProjectName()); param.put("value",remoteParam.getValue()); result.setParams(param); } diff --git a/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/interactive/vo/DataVO.java b/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/interactive/vo/DataVO.java index a94a2bc..97dfe29 100644 --- a/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/interactive/vo/DataVO.java +++ b/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/interactive/vo/DataVO.java @@ -1,5 +1,6 @@ package com.hnac.hzims.bigmodel.interactive.vo; +import com.alibaba.fastjson.annotation.JSONField; import lombok.Data; import java.io.Serializable; @@ -15,8 +16,10 @@ public class DataVO implements Serializable { /**数据查询类型:实时、历史**/ private String type; + @JSONField(name = "time_begin") private String startTime; + @JSONField(name = "time_end") private String endTime; /**包括:"其它"、"最大值"、"最小值"、"总和值"、"平均值"**/