mirror of
https://gitee.com/dromara/RuoYi-Cloud-Plus.git
synced 2026-05-06 03:51:25 +08:00
fix 修复 查询任务扩展数据不存在导致的空报错
This commit is contained in:
@@ -6,7 +6,6 @@ import cn.hutool.core.util.ObjectUtil;
|
|||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.dubbo.config.annotation.DubboReference;
|
import org.apache.dubbo.config.annotation.DubboReference;
|
||||||
import org.dromara.common.core.service.DictService;
|
|
||||||
import org.dromara.common.core.utils.StringUtils;
|
import org.dromara.common.core.utils.StringUtils;
|
||||||
import org.dromara.common.json.utils.JsonUtils;
|
import org.dromara.common.json.utils.JsonUtils;
|
||||||
import org.dromara.system.api.RemoteDictService;
|
import org.dromara.system.api.RemoteDictService;
|
||||||
@@ -217,6 +216,9 @@ public class FlwNodeExtServiceImpl implements NodeExtService, IFlwNodeExtService
|
|||||||
|
|
||||||
// 解析 JSON 为 Dict 列表
|
// 解析 JSON 为 Dict 列表
|
||||||
List<Dict> nodeExtMap = JsonUtils.parseArrayMap(ext);
|
List<Dict> nodeExtMap = JsonUtils.parseArrayMap(ext);
|
||||||
|
if (ObjectUtil.isEmpty(nodeExtMap)) {
|
||||||
|
return nodeExtVo;
|
||||||
|
}
|
||||||
|
|
||||||
for (Dict nodeExt : nodeExtMap) {
|
for (Dict nodeExt : nodeExtMap) {
|
||||||
String code = nodeExt.getStr("code");
|
String code = nodeExt.getStr("code");
|
||||||
|
|||||||
@@ -602,14 +602,22 @@ public class FlwTaskServiceImpl implements IFlwTaskService {
|
|||||||
}
|
}
|
||||||
NodeExtVo nodeExtVo = flwNodeExtService.parseNodeExt(flowNode.getExt(), instance.getVariableMap());
|
NodeExtVo nodeExtVo = flwNodeExtService.parseNodeExt(flowNode.getExt(), instance.getVariableMap());
|
||||||
//设置按钮权限
|
//设置按钮权限
|
||||||
flowTaskVo.setButtonList(nodeExtVo.getButtonPermissions());
|
if (CollUtil.isNotEmpty(nodeExtVo.getButtonPermissions())) {
|
||||||
|
flowTaskVo.setButtonList(nodeExtVo.getButtonPermissions());
|
||||||
|
} else {
|
||||||
|
flowTaskVo.setButtonList(new ArrayList<>());
|
||||||
|
}
|
||||||
if (CollUtil.isNotEmpty(nodeExtVo.getCopySettings())) {
|
if (CollUtil.isNotEmpty(nodeExtVo.getCopySettings())) {
|
||||||
List<FlowCopyVo> list = StreamUtils.toList(nodeExtVo.getCopySettings(), x -> new FlowCopyVo(Convert.toLong(x)));
|
List<FlowCopyVo> list = StreamUtils.toList(nodeExtVo.getCopySettings(), x -> new FlowCopyVo(Convert.toLong(x)));
|
||||||
flowTaskVo.setCopyList(list);
|
flowTaskVo.setCopyList(list);
|
||||||
} else {
|
} else {
|
||||||
flowTaskVo.setCopyList(new ArrayList<>());
|
flowTaskVo.setCopyList(new ArrayList<>());
|
||||||
}
|
}
|
||||||
flowTaskVo.setVarList(nodeExtVo.getVariables());
|
if (CollUtil.isNotEmpty(nodeExtVo.getVariables())) {
|
||||||
|
flowTaskVo.setVarList(nodeExtVo.getVariables());
|
||||||
|
} else {
|
||||||
|
flowTaskVo.setVarList(new HashMap<>());
|
||||||
|
}
|
||||||
flowTaskVo.setNodeRatio(flowNode.getNodeRatio());
|
flowTaskVo.setNodeRatio(flowNode.getNodeRatio());
|
||||||
flowTaskVo.setApplyNode(flowNode.getNodeCode().equals(flwCommonService.applyNodeCode(task.getDefinitionId())));
|
flowTaskVo.setApplyNode(flowNode.getNodeCode().equals(flwCommonService.applyNodeCode(task.getDefinitionId())));
|
||||||
return flowTaskVo;
|
return flowTaskVo;
|
||||||
|
|||||||
Reference in New Issue
Block a user