Skip to content

Commit

Permalink
#2477 任务编排执行历史显示节点执行次数和数据
Browse files Browse the repository at this point in the history
  • Loading branch information
tangjiawei committed Dec 20, 2024
1 parent 9347e54 commit 9906752
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion platform-core/services/database/process-exec.go
Original file line number Diff line number Diff line change
Expand Up @@ -1499,11 +1499,14 @@ func GetProcInsNodeContext(ctx context.Context, procInsId, procInsNodeId, procDe
for index, v := range reqRows {
tempProcNodeContext := defaultRes
if index > 0 {
tempProcNodeContext.RequestObjects = []models.ProcNodeContextReqObject{}
// 节点历史执行,从 proc_ins_node_req 取
tempProcNodeContext.BeginTime = v.CreatedTime.Format(models.DateTimeFormat)
tempProcNodeContext.EndTime = v.UpdatedTime.Format(models.DateTimeFormat)
tempProcNodeContext.Operator = getProcNodeOperator(ctx, procInsNodeId, index)
tempProcNodeContext.ErrorCode = v.ErrorCode
tempProcNodeContext.ErrorMessage = v.ErrorMsg
}
tempProcNodeContext.Operator = getProcNodeOperator(ctx, procInsNodeId, index)
var procReqParams []*models.ProcInsNodeReqParam
err = db.MysqlEngine.Context(ctx).SQL("select * from proc_ins_node_req_param where req_id=? order by data_index,id", v.Id).Find(&procReqParams)
if err != nil {
Expand Down Expand Up @@ -1567,6 +1570,13 @@ func getProcNodeOperator(ctx context.Context, procInsNodeId string, index int) (
if len(operationRows) > 0 {
operator = operationRows[0].CreatedBy
}
// 用 proc_ins_node创建人兜底
if operator == "" {
if _, err = db.MysqlEngine.Context(ctx).SQL("select created_by from proc_ins_node where id=?", procInsNodeId).Get(&operator); err != nil {
log.Logger.Error("getProcNodeOperator get proc_ins_node fail", log.String("procInsNodeId", procInsNodeId), log.Error(err))
return
}
}
}
return
}
Expand Down

0 comments on commit 9906752

Please sign in to comment.