Browse Source

Merge remote-tracking branch 'origin/master'

zhongwei
yang_shj 7 months ago
parent
commit
d1e394d95c
  1. 5
      hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/interactive/service/impl/ExtraResolveStrategyService.java
  2. 15
      hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/interactive/service/impl/JumpRouteJoinStrategy.java

5
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.entity.StationVideoTypeEntity;
import com.hnac.hzims.operational.station.feign.IStationClient; import com.hnac.hzims.operational.station.feign.IStationClient;
import com.hnac.hzims.operational.station.feign.IStationVideoTypeClient; 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 lombok.AllArgsConstructor;
import org.springblade.core.tool.api.R; import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.Func; import org.springblade.core.tool.utils.Func;
@ -44,8 +46,9 @@ public class ExtraResolveStrategyService {
*/ */
public ExtraVO resolve(String extraStr) { public ExtraVO resolve(String extraStr) {
JSONObject extra = JSONObject.parseObject(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)) { if(StringUtil.isNotBlank(functionCode)) {
XxlJobLogger.log("函数编号为:" + functionCode);
FuncRouteEnum funcRouteEnum = FuncRouteEnum.getEnumByFuncCode(functionCode); FuncRouteEnum funcRouteEnum = FuncRouteEnum.getEnumByFuncCode(functionCode);
switch (funcRouteEnum) { switch (funcRouteEnum) {
case DIAGNOSE: case DIAGNOSE:

15
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.FuncRouteEnum;
import com.hnac.hzims.bigmodel.interactive.constants.FunctionConstants; import com.hnac.hzims.bigmodel.interactive.constants.FunctionConstants;
import com.hnac.hzims.bigmodel.interactive.vo.ExtraVO; 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.log.exception.ServiceException;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.Func; import org.springblade.core.tool.utils.Func;
import org.springblade.core.tool.utils.StringUtil; import org.springblade.core.tool.utils.StringUtil;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import org.springframework.util.Assert; import org.springframework.util.Assert;
import java.util.HashMap; import java.util.*;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.stream.IntStream; import java.util.stream.IntStream;
/** /**
@ -23,8 +24,11 @@ import java.util.stream.IntStream;
* @Date: 2024/04/30 11:38 * @Date: 2024/04/30 11:38
*/ */
@Component @Component
@RequiredArgsConstructor
public class JumpRouteJoinStrategy { public class JumpRouteJoinStrategy {
private final IStationClient stationClient;
public static String[] SCADA_PARAMS_SOLVE = new String[]{"picResource","context","stationNum","projectId","taskId","name","id"}; public static String[] SCADA_PARAMS_SOLVE = new String[]{"picResource","context","stationNum","projectId","taskId","name","id"};
/** /**
@ -54,7 +58,8 @@ public class JumpRouteJoinStrategy {
// 根据hz3000画面版本获取path // 根据hz3000画面版本获取path
Integer picResource = Integer.valueOf(params.get("picResource")); Integer picResource = Integer.valueOf(params.get("picResource"));
JSONObject pathObject = JSONObject.parseObject(function.getPath()); JSONObject pathObject = JSONObject.parseObject(function.getPath());
extraVO.setLabel(params.get("name")); R<StationEntity> 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) { if(picResource == 0) {
String scada = pathObject.getString("scada"); String scada = pathObject.getString("scada");

Loading…
Cancel
Save