Skip to content

Commit

Permalink
fix: 节点台账更改flowId获取
Browse files Browse the repository at this point in the history
  • Loading branch information
SunPengWan committed Sep 20, 2024
1 parent 98c660a commit 264a441
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 44 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@
,t1.modify_time as modifyTime
,t1.create_time as createTime
,t1.node_key as nodeKey
,t1.flow_id as flowId
from dss_workflow_node_content t1
join (select * from dss_orchestrator_info
where project_id in
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ public class DSSFlowNodeInfo {

private Date createTime;

private Long flowId;


public String getNodeId() {
return nodeId;
Expand Down Expand Up @@ -108,4 +110,13 @@ public String getNodeKey() {
public void setNodeKey(String nodeKey) {
this.nodeKey = nodeKey;
}


public Long getFlowId() {
return flowId;
}

public void setFlowId(Long flowId) {
this.flowId = flowId;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -1162,12 +1162,7 @@ public DataDevelopNodeResponse queryDataDevelopNodeList(String username, Workspa
return dataDevelopNodeResponse;
}

Map<Long,DSSFlow> flowMap = getFlowMap(flowNodeInfoList);

if(flowMap.isEmpty()){
logger.error("queryDataDevelopNodeList not find dssFlow info");
return dataDevelopNodeResponse;
}

// 查询模板信息
// List<Long> orchestratorIdList = flowNodeInfoList.stream().map(DSSFlowNodeInfo::getOrchestratorId).collect(Collectors.toList());
Expand All @@ -1182,15 +1177,14 @@ public DataDevelopNodeResponse queryDataDevelopNodeList(String username, Workspa
DSSFlowNodeInfo dssFlowNodeInfo = dssFlowNodeInfoMap.get(contentId);
List<NodeContentUIDO> nodeUIList = nodeContentUIGroup.get(contentId);
DSSProject dssProject = dssProjectMap.get(dssFlowNodeInfo.getProjectId());
DSSFlow dssFlow = flowMap.getOrDefault(dssFlowNodeInfo.getOrchestratorId(),new DSSFlow());

// Map<String, String> nodeDefaultValue = getNodeDefaultValue(nodeInfoGroup, dssFlowNodeInfo.getJobType());

List<String> nodeUIKeys = nodeUIList.stream().map(NodeContentUIDO::getNodeUIKey).collect(Collectors.toList());
List<String> nodeUIValues = nodeUIList.stream().map(NodeContentUIDO::getNodeUIValue).collect(Collectors.toList());

Map<String, String> nodeMap = CollUtil.zip(nodeUIKeys, nodeUIValues);
NodeBaseInfo nodeBaseInfo = getNodeBaseInfo(dssFlowNodeInfo, dssProject, nodeMap,username,dssFlow);
NodeBaseInfo nodeBaseInfo = getNodeBaseInfo(dssFlowNodeInfo, dssProject, nodeMap,username);
BeanUtils.copyProperties(nodeBaseInfo, dataDevelopNodeInfo);

dataDevelopNodeInfo.setResource(nodeMap.get("resources"));
Expand Down Expand Up @@ -1321,13 +1315,6 @@ public DataViewNodeResponse queryDataViewNode(String username, Workspace workspa
return dataViewNodeResponse;
}

Map<Long,DSSFlow> flowMap = getFlowMap(flowNodeInfoList);

if(flowMap.isEmpty()){
logger.error("queryDataViewNode not find dssFlow info");
return dataViewNodeResponse;
}

List<DataViewNodeInfo> dataViewNodeInfoList = new ArrayList<>();

for (Long contentId : nodeContentUIGroup.keySet()) {
Expand All @@ -1336,13 +1323,12 @@ public DataViewNodeResponse queryDataViewNode(String username, Workspace workspa
DSSFlowNodeInfo dssFlowNodeInfo = dssFlowNodeInfoMap.get(contentId);
List<NodeContentUIDO> nodeUIList = nodeContentUIGroup.get(contentId);
DSSProject dssProject = dssProjectMap.get(dssFlowNodeInfo.getProjectId());
DSSFlow dssFlow = flowMap.getOrDefault(dssFlowNodeInfo.getOrchestratorId(),new DSSFlow());

List<String> nodeUIKeys = nodeUIList.stream().map(NodeContentUIDO::getNodeUIKey).collect(Collectors.toList());
List<String> nodeUIValues = nodeUIList.stream().map(NodeContentUIDO::getNodeUIValue).collect(Collectors.toList());
Map<String, String> nodeMap = CollUtil.zip(nodeUIKeys, nodeUIValues);

NodeBaseInfo nodeBaseInfo = getNodeBaseInfo(dssFlowNodeInfo, dssProject, nodeMap,username,dssFlow);
NodeBaseInfo nodeBaseInfo = getNodeBaseInfo(dssFlowNodeInfo, dssProject, nodeMap,username);
BeanUtils.copyProperties(nodeBaseInfo, dataViewNodeInfo);

dataViewNodeInfo.setNodeDesc(nodeMap.get("desc"));
Expand Down Expand Up @@ -1829,13 +1815,6 @@ public DataCheckerNodeResponse queryDataCheckerNode(String username, Workspace w
return dataCheckerNodeResponse;
}

Map<Long,DSSFlow> flowMap = getFlowMap(flowNodeInfoList);

if(flowMap.isEmpty()){
logger.error("queryDataCheckerNode not find dssFlow info");
return dataCheckerNodeResponse;
}


List<DataCheckerNodeInfo> dataCheckerNodeInfoList = new ArrayList<>();

Expand All @@ -1846,15 +1825,14 @@ public DataCheckerNodeResponse queryDataCheckerNode(String username, Workspace w
DSSFlowNodeInfo dssFlowNodeInfo = dssFlowNodeInfoMap.get(contentId);
List<NodeContentUIDO> nodeUIList = nodeContentUIGroup.get(contentId);
DSSProject dssProject = dssProjectMap.get(dssFlowNodeInfo.getProjectId());
DSSFlow dssFlow = flowMap.getOrDefault(dssFlowNodeInfo.getOrchestratorId(),new DSSFlow());

// Map<String, String> nodeDefaultValue = getNodeDefaultValue(nodeInfoGroup, dssFlowNodeInfo.getJobType());

List<String> nodeUIKeys = nodeUIList.stream().map(NodeContentUIDO::getNodeUIKey).collect(Collectors.toList());
List<String> nodeUIValues = nodeUIList.stream().map(NodeContentUIDO::getNodeUIValue).collect(Collectors.toList());
Map<String, String> nodeMap = CollUtil.zip(nodeUIKeys, nodeUIValues);

NodeBaseInfo nodeBaseInfo = getNodeBaseInfo(dssFlowNodeInfo, dssProject, nodeMap,username,dssFlow);
NodeBaseInfo nodeBaseInfo = getNodeBaseInfo(dssFlowNodeInfo, dssProject, nodeMap,username);
BeanUtils.copyProperties(nodeBaseInfo, dataCheckerNodeInfo);

dataCheckerNodeInfo.setMaxCheckHours(nodeMap.get("max.check.hours"));
Expand Down Expand Up @@ -1982,12 +1960,6 @@ public EventSenderNodeResponse queryEventSenderNode(String username, Workspace w
return eventSenderNodeResponse;
}

Map<Long,DSSFlow> flowMap = getFlowMap(flowNodeInfoList);

if(flowMap.isEmpty()){
logger.error("queryEventSenderNode not find dssFlow info");
return eventSenderNodeResponse;
}

List<EventSenderNodeInfo> eventSenderNodeInfoList = new ArrayList<>();

Expand All @@ -1998,13 +1970,12 @@ public EventSenderNodeResponse queryEventSenderNode(String username, Workspace w
DSSFlowNodeInfo dssFlowNodeInfo = dssFlowNodeInfoMap.get(contentId);
List<NodeContentUIDO> nodeUIList = nodeContentUIGroup.get(contentId);
DSSProject dssProject = dssProjectMap.get(dssFlowNodeInfo.getProjectId());
DSSFlow dssFlow = flowMap.getOrDefault(dssFlowNodeInfo.getOrchestratorId(),new DSSFlow());

List<String> nodeUIKeys = nodeUIList.stream().map(NodeContentUIDO::getNodeUIKey).collect(Collectors.toList());
List<String> nodeUIValues = nodeUIList.stream().map(NodeContentUIDO::getNodeUIValue).collect(Collectors.toList());
Map<String, String> nodeMap = CollUtil.zip(nodeUIKeys, nodeUIValues);

NodeBaseInfo nodeBaseInfo = getNodeBaseInfo(dssFlowNodeInfo, dssProject, nodeMap,username,dssFlow);
NodeBaseInfo nodeBaseInfo = getNodeBaseInfo(dssFlowNodeInfo, dssProject, nodeMap,username);
BeanUtils.copyProperties(nodeBaseInfo, eventSenderNodeInfo);
eventSenderNodeInfo.setNodeDesc(nodeMap.get("desc"));
eventSenderNodeInfo.setMsgType(nodeMap.get("msg.type"));
Expand Down Expand Up @@ -2128,13 +2099,6 @@ public EventReceiveNodeResponse queryEventReceiveNode(String username, Workspace
return eventReceiveNodeResponse;
}

Map<Long,DSSFlow> flowMap = getFlowMap(flowNodeInfoList);

if(flowMap.isEmpty()){
logger.error("queryEventSenderNode not find dssFlow info");
return eventReceiveNodeResponse;
}


List<EventReceiverNodeInfo> eventReceiverNodeInfoList = new ArrayList<>();

Expand All @@ -2145,14 +2109,13 @@ public EventReceiveNodeResponse queryEventReceiveNode(String username, Workspace
DSSFlowNodeInfo dssFlowNodeInfo = dssFlowNodeInfoMap.get(contentId);
List<NodeContentUIDO> nodeUIList = nodeContentUIGroup.get(contentId);
DSSProject dssProject = dssProjectMap.get(dssFlowNodeInfo.getProjectId());
DSSFlow dssFlow = flowMap.getOrDefault(dssFlowNodeInfo.getOrchestratorId(),new DSSFlow());
// Map<String, String> nodeDefaultValue = getNodeDefaultValue(nodeInfoGroup, dssFlowNodeInfo.getJobType());

List<String> nodeUIKeys = nodeUIList.stream().map(NodeContentUIDO::getNodeUIKey).collect(Collectors.toList());
List<String> nodeUIValues = nodeUIList.stream().map(NodeContentUIDO::getNodeUIValue).collect(Collectors.toList());
Map<String, String> nodeMap = CollUtil.zip(nodeUIKeys, nodeUIValues);

NodeBaseInfo nodeBaseInfo = getNodeBaseInfo(dssFlowNodeInfo, dssProject, nodeMap,username,dssFlow);
NodeBaseInfo nodeBaseInfo = getNodeBaseInfo(dssFlowNodeInfo, dssProject, nodeMap,username);
BeanUtils.copyProperties(nodeBaseInfo, eventReceiverNodeInfo);
eventReceiverNodeInfo.setNodeDesc(nodeMap.get("desc"));
eventReceiverNodeInfo.setMsgType(nodeMap.get("msg.type"));
Expand Down Expand Up @@ -2358,7 +2321,7 @@ public Map<String, String> getNodeDefaultValue(Map<String, List<NodeUIInfo>> nod



public NodeBaseInfo getNodeBaseInfo(DSSFlowNodeInfo dssFlowNodeInfo, DSSProject dssProject, Map<String, String> nodeMap,String username,DSSFlow dssFlow) {
public NodeBaseInfo getNodeBaseInfo(DSSFlowNodeInfo dssFlowNodeInfo, DSSProject dssProject, Map<String, String> nodeMap,String username) {

NodeBaseInfo nodeBaseInfo = new NodeBaseInfo();

Expand All @@ -2380,7 +2343,7 @@ public NodeBaseInfo getNodeBaseInfo(DSSFlowNodeInfo dssFlowNodeInfo, DSSProject
|| (CollectionUtils.isNotEmpty(dssProject.getReleaseUsers()) && dssProject.getReleaseUsers().contains(username))
|| (StringUtils.isNotEmpty(dssProject.getCreateBy()) && dssProject.getCreateBy().equals(username));
nodeBaseInfo.setEditable(editable);
nodeBaseInfo.setFlowId(dssFlow.getId());
nodeBaseInfo.setFlowId(dssFlowNodeInfo.getFlowId());

return nodeBaseInfo;

Expand Down

0 comments on commit 264a441

Please sign in to comment.