This commit is contained in:
@@ -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, "[]")
|
||||
}
|
||||
|
||||
@@ -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"`
|
||||
}
|
||||
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user