Skip to content

Commit

Permalink
#2469 空结点数据试算,按节点顺序排序
Browse files Browse the repository at this point in the history
  • Loading branch information
tangjiawei committed Dec 10, 2024
1 parent 450d0ba commit 004f25e
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion platform-core/api/v1/process/manage.go
Original file line number Diff line number Diff line change
Expand Up @@ -1753,10 +1753,16 @@ func QueryEmptyNodes(c *gin.Context) {
middleware.ReturnError(c, err)
return
}
sort.Sort(models.ProcDefSortNodes(procDefNodes))
orderIndex := 1
for _, node := range procDefNodes {
if node.NodeType == string(models.ProcDefNodeTypeHuman) || node.NodeType == string(models.ProcDefNodeTypeAutomatic) || node.NodeType == string(models.ProcDefNodeTypeData) || node.NodeType == models.JobSubProcType {
node.OrderedNo = orderIndex
orderIndex += 1
}
if node.NodeType == string(models.ProcDefNodeTypeAutomatic) || node.NodeType == string(models.ProcDefNodeSubProcess) || node.NodeType == string(models.ProcDefNodeTypeData) {
if !tools.Contains(nodeIds, node.Id) {
result = append(result, node.Name)
result = append(result, fmt.Sprintf("%d %s", node.OrderedNo, node.Name))
}
}
}
Expand Down

0 comments on commit 004f25e

Please sign in to comment.