From f96d3362ace37ef59dbfbaf19b8c290d980797a1 Mon Sep 17 00:00:00 2001 From: qhd <1766646056@qq.com> Date: Mon, 17 Aug 2026 09:57:43 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E6=AD=A3=E6=B5=81=E7=A8=8B?= =?UTF-8?q?=E6=89=A7=E8=A1=8C=E5=88=97=E8=A1=A8=E6=9F=A5=E8=AF=A2=E8=BF=87?= =?UTF-8?q?=E6=BB=A4=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- workflow/dao/flow/flow_execution_dao.go | 11 ++++++++--- workflow/model/dto/flow/flow_execution_dto.go | 4 ++-- workflow/service/flow/flow_execution_service.go | 3 ++- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/workflow/dao/flow/flow_execution_dao.go b/workflow/dao/flow/flow_execution_dao.go index ebc26fd..1a509d7 100644 --- a/workflow/dao/flow/flow_execution_dao.go +++ b/workflow/dao/flow/flow_execution_dao.go @@ -7,6 +7,7 @@ import ( "context" "gitea.redpowerfuture.com/red-future/common/db/gfdb" + "github.com/gogf/gf/v2/frame/g" "github.com/gogf/gf/v2/util/gconv" ) @@ -49,10 +50,14 @@ func (d *flowExecutionDao) Get(ctx context.Context, req *flowDto.GetFlowExecutio } func (d *flowExecutionDao) List(ctx context.Context, req *flowDto.ListFlowExecutionReq, fields ...string) (res []*entity.FlowExecution, total int, err error) { - model := gfdb.DB(ctx, public.DbNameBlackDeacon).Model(ctx, public.TableNameFlowExecution).Fields(fields).OmitEmpty() + model := gfdb.DB(ctx, public.DbNameBlackDeacon).Model(ctx, public.TableNameFlowExecution).Fields(fields) model.Where(entity.FlowExecutionCol.Creator, req.Creator) - model.Where(entity.FlowExecutionCol.ResultDel, req.ResultDel) - model.Where(entity.FlowExecutionCol.SessionDel, req.SessionDel) + if !g.IsEmpty(req.ResultDel) { + model.Where(entity.FlowExecutionCol.ResultDel, false) + } + if !g.IsEmpty(req.SessionDel) { + model.Where(entity.FlowExecutionCol.SessionDel, false) + } if req.IsResult { model.WhereNot(entity.FlowExecutionCol.OutputParams, "[]") } diff --git a/workflow/model/dto/flow/flow_execution_dto.go b/workflow/model/dto/flow/flow_execution_dto.go index 766dce1..ac7b1c0 100644 --- a/workflow/model/dto/flow/flow_execution_dto.go +++ b/workflow/model/dto/flow/flow_execution_dto.go @@ -270,8 +270,8 @@ type ListFlowExecutionReq struct { *beans.Page `json:"page"` Creator string `json:"creator"` - SessionDel bool `json:"sessionDel"` - ResultDel bool `json:"resultDel"` + SessionDel *bool `json:"sessionDel"` + ResultDel *bool `json:"resultDel"` IsResult bool `json:"isResult"` } diff --git a/workflow/service/flow/flow_execution_service.go b/workflow/service/flow/flow_execution_service.go index 00ce36f..c305ffe 100644 --- a/workflow/service/flow/flow_execution_service.go +++ b/workflow/service/flow/flow_execution_service.go @@ -92,7 +92,7 @@ func (s *flowExecutionService) GetSessionList(ctx context.Context, req *flowDto. flowReq := new(flowDto.ListFlowExecutionReq) flowReq.Page = req.Page flowReq.Creator = user.UserName - flowReq.SessionDel = false + flowReq.SessionDel = gconv.PtrBool(true) list, total, err := flowDao.FlowExecutionDao.List(ctx, flowReq) if err != nil { return nil, err @@ -110,6 +110,7 @@ func (s *flowExecutionService) List(ctx context.Context, req *flowDto.ListFlowEx return } req.Creator = user.UserName + req.ResultDel = gconv.PtrBool(true) req.IsResult = true list, _, err := flowDao.FlowExecutionDao.List(ctx, req) if err != nil {