From f7b8cfd53dec9a936ca132c65967f897539e1aed Mon Sep 17 00:00:00 2001 From: haungxing <1203316822@qq.com> Date: Mon, 13 May 2024 16:24:46 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E5=AE=9E=E6=97=B6=E7=94=BB=E9=9D=A2label?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E7=AB=99=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/ExtraResolveStrategyService.java | 5 ++++- .../interactive/service/impl/JumpRouteJoinStrategy.java | 15 ++++++++++----- 2 files changed, 14 insertions(+), 6 deletions(-) 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 9ab95cd..3e5f6c6 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 @@ -13,6 +13,8 @@ import com.hnac.hzims.operational.station.entity.StationEntity; import com.hnac.hzims.operational.station.entity.StationVideoTypeEntity; import com.hnac.hzims.operational.station.feign.IStationClient; import com.hnac.hzims.operational.station.feign.IStationVideoTypeClient; +import com.xxl.job.core.handler.annotation.XxlJob; +import com.xxl.job.core.log.XxlJobLogger; import lombok.AllArgsConstructor; import org.springblade.core.tool.api.R; import org.springblade.core.tool.utils.Func; @@ -44,8 +46,9 @@ public class ExtraResolveStrategyService { */ public ExtraVO resolve(String extraStr) { JSONObject extra = JSONObject.parseObject(extraStr); - String functionCode = Optional.ofNullable(extra.get("func")).map(String::valueOf).orElse("ttps"); + String functionCode = Optional.ofNullable(extra.get("func")).map(String::valueOf).orElse(""); if(StringUtil.isNotBlank(functionCode)) { + XxlJobLogger.log("函数编号为:" + functionCode); FuncRouteEnum funcRouteEnum = FuncRouteEnum.getEnumByFuncCode(functionCode); switch (funcRouteEnum) { case DIAGNOSE: diff --git a/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/interactive/service/impl/JumpRouteJoinStrategy.java b/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/interactive/service/impl/JumpRouteJoinStrategy.java index 4d51428..d24a4c0 100644 --- a/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/interactive/service/impl/JumpRouteJoinStrategy.java +++ b/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/interactive/service/impl/JumpRouteJoinStrategy.java @@ -6,16 +6,17 @@ import com.hnac.hzims.bigmodel.entity.FunctionEntity; import com.hnac.hzims.bigmodel.interactive.constants.FuncRouteEnum; import com.hnac.hzims.bigmodel.interactive.constants.FunctionConstants; import com.hnac.hzims.bigmodel.interactive.vo.ExtraVO; +import com.hnac.hzims.operational.station.entity.StationEntity; +import com.hnac.hzims.operational.station.feign.IStationClient; +import lombok.RequiredArgsConstructor; import org.springblade.core.log.exception.ServiceException; +import org.springblade.core.tool.api.R; import org.springblade.core.tool.utils.Func; import org.springblade.core.tool.utils.StringUtil; import org.springframework.stereotype.Component; import org.springframework.util.Assert; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Set; +import java.util.*; import java.util.stream.IntStream; /** @@ -23,8 +24,11 @@ import java.util.stream.IntStream; * @Date: 2024/04/30 11:38 */ @Component +@RequiredArgsConstructor public class JumpRouteJoinStrategy { + private final IStationClient stationClient; + public static String[] SCADA_PARAMS_SOLVE = new String[]{"picResource","context","stationNum","projectId","taskId","name","id"}; /** @@ -54,7 +58,8 @@ public class JumpRouteJoinStrategy { // 根据hz3000画面版本获取path Integer picResource = Integer.valueOf(params.get("picResource")); JSONObject pathObject = JSONObject.parseObject(function.getPath()); - extraVO.setLabel(params.get("name")); + R stationR = stationClient.getStationByCode(params.get("projectId")); + extraVO.setLabel(Optional.ofNullable(stationR).filter(r -> r.isSuccess()).map(R::getData).map(StationEntity::getName) + "_" + params.get("name")); // 云组态 if(picResource == 0) { String scada = pathObject.getString("scada");