models

package
v0.0.0-...-c4618b4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 14, 2023 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ENABLE status
	ENABLE = "ENABLE"
	// DISABLE status
	DISABLE = "DISABLE"
	// DELETED status
	DELETED = "DELETED"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AbnormalTask

type AbnormalTask struct {
	BaseModel

	FlowInstanceID    string `json:"flowInstanceId"`
	ProcessInstanceID string `json:"processInstanceId"`
	TaskID            string `json:"taskId"`
	TaskName          string `json:"taskName"`
	TaskDefKey        string `json:"taskDefKey"`
	Reason            string `json:"reason"`
	Remark            string `json:"remark"`
	Status            int8   `json:"status"` // 0 unhandle,1 handled,2 autoHandled
}

AbnormalTask info

type AbnormalTaskRepo

type AbnormalTaskRepo interface {
	Create(db *gorm.DB, model *AbnormalTask) error
	Update(db *gorm.DB, ID string, updateMap map[string]interface{}) error
	UpdateByTaskID(db *gorm.DB, taskID string, updateMap map[string]interface{}) error
	UpdateByProcessInstanceID(db *gorm.DB, processInstanceID string, updateMap map[string]interface{}) error
	Delete(db *gorm.DB, ID string) error
	FindByID(db *gorm.DB, ID string) (*AbnormalTask, error)
	Find(db *gorm.DB, condition map[string]interface{}) ([]*AbnormalTask, error)
	Page(db *gorm.DB, req *AbnormalTaskReq) ([]*AbnormalTaskVo, int64, error)
	DeleteByInstanceIDs(db *gorm.DB, InstanceIDs []string) error
}

AbnormalTaskRepo interface

type AbnormalTaskReq

type AbnormalTaskReq struct {
	page.ReqPage

	Status         int8     `json:"status"`
	InstanceStatus string   `json:"instanceStatus"`
	AppID          string   `json:"appId"`
	AdminAppIDs    []string `json:"adminAppIDs"`
	Keyword        string   `json:"keyword"` // 应用名称、流程名称、申请人名称
}

AbnormalTaskReq AbnormalTaskReq

type AbnormalTaskVo

type AbnormalTaskVo struct {
	AbnormalTask

	AppName            string `json:"appName"`
	InstanceName       string `json:"instanceName"`
	ApplyUserName      string `json:"applyUserName"`
	InstanceCreateTime string `json:"instanceCreateTime"`
	InstanceStatus     string `json:"instanceStatus"`
}

AbnormalTaskVo vo

type ActTaskEntity

type ActTaskEntity struct {
	ID                 string      `json:"id"`         // task id
	TaskDefKey         string      `json:"taskDefKey"` // Task definition id
	ProcInstID         string      `json:"procInstId"` // Process instance id
	ActInstID          string      `json:"actInstId"`
	Name               string      `json:"name"`        // Task name
	Description        string      `json:"description"` // Task description
	Owner              string      `json:"owner"`
	Assignee           string      `json:"assignee"`
	StartTime          string      `json:"startTime"`
	EndTime            string      `json:"endTime"`
	Duration           int64       `json:"duration"`
	DueDate            string      `json:"dueDate"`
	FlowInstanceEntity interface{} `json:"flowInstanceEntity"` // Instance
	UrgeNum            int64       `json:"urgeNum"`
	Handled            string      `json:"handled"`
}

ActTaskEntity task info

type AddSignModel

type AddSignModel struct {
	Type              string        `json:"type"` // 加签方式:BEFORE前加签,AFTER后加签
	Assignee          []interface{} `json:"assignee"`
	MultiplePersonWay string        `json:"multiplePersonWay"` // 多人处理方式:and会签,or或签
}

AddSignModel struct

type AttachFileModel

type AttachFileModel struct {
	FileName string `json:"fileName"`
	FileURL  string `json:"fileUrl"`
}

AttachFileModel file model

type BaseModel

type BaseModel struct {
	ID string `json:"id"`

	CreatorID  string `json:"creatorId"`
	CreateTime string `json:"createTime"`
	ModifierID string `json:"modifierId"`
	ModifyTime string `json:"modifyTime"`

	CreatorName   string `gorm:"-" json:"creatorName"`
	CreatorAvatar string `gorm:"-" json:"creatorAvatar"`
	ModifierName  string `gorm:"-" json:"modifierName"`
}

BaseModel info

type Comment

type Comment struct {
	BaseModel

	FlowInstanceID string `json:"flowInstanceId"`
	CommentUserID  string `json:"commentUserId"`
	Content        string `json:"content"`
}

Comment info

type CommentAttachment

type CommentAttachment struct {
	BaseModel

	FlowCommentID  string `json:"flowCommentId"`
	AttachmentName string `json:"attachmentName"`
	AttachmentURL  string `json:"attachmentUrl"`
}

CommentAttachment info

type CommentAttachmentRepo

type CommentAttachmentRepo interface {
	Create(db *gorm.DB, model *CommentAttachment) error
	Update(db *gorm.DB, ID string, updateMap map[string]interface{}) error
	Delete(db *gorm.DB, ID string) error
	FindByID(db *gorm.DB, ID string) (*CommentAttachment, error)
	FindAttachments(db *gorm.DB, condition map[string]interface{}, order string) ([]*CommentAttachment, error)
}

CommentAttachmentRepo interface

type CommentRepo

type CommentRepo interface {
	Create(db *gorm.DB, model *Comment) error
	Update(db *gorm.DB, ID string, updateMap map[string]interface{}) error
	Delete(db *gorm.DB, ID string) error
	FindByID(db *gorm.DB, ID string) (*Comment, error)
	FindComments(db *gorm.DB, condition map[string]interface{}, order string) ([]*Comment, error)
	DeleteByInstanceIDs(db *gorm.DB, InstanceIDs []string) error
}

CommentRepo interface

type DispatcherCallback

type DispatcherCallback struct {
	BaseModel

	Type              string `json:"type"`
	OtherInfo         string `json:"otherInfo"`
	ProcessInstanceID string `json:"processInstanceId"`
	TaskDefKey        string `json:"taskDefKey"`
}

DispatcherCallback info

type DispatcherCallbackRepo

type DispatcherCallbackRepo interface {
	Create(db *gorm.DB, model *DispatcherCallback) error
	Update(db *gorm.DB, ID string, updateMap map[string]interface{}) error
	Delete(db *gorm.DB, ID string) error
	FindByID(db *gorm.DB, ID string) (*DispatcherCallback, error)
}

DispatcherCallbackRepo interface

type Flow

type Flow struct {
	BaseModel

	AppID       string `json:"appId" binding:"required"`
	AppStatus   string `json:"appStatus"`
	SourceID    string `json:"sourceId"` // flow initial model id
	Name        string `json:"name" binding:"required"`
	TriggerMode string `json:"triggerMode" binding:"required"` // FORM_DATA|FORM_TIME
	FormID      string `json:"formId"`
	BpmnText    string `json:"bpmnText"`   // flow model json
	Cron        string `json:"cron"`       // if TriggerMode eq FORM_TIME required
	ProcessKey  string `json:"processKey"` // Process key, used to start the process by the id
	Status      string `json:"status"`
	CanCancel   int8   `json:"canCancel"`
	/**
	1:It can only be cancel when the next event is not processed
	2:Any event can be cancel
	3:Cancel under the specified event
	*/
	CanCancelType    int8   `json:"canCancelType"`
	CanCancelNodes   string `json:"canCancelNodes"` // taskDefKey array
	CanUrge          int8   `json:"canUrge"`
	CanViewStatusMsg int8   `json:"canViewStatusMsg"`
	CanMsg           int8   `json:"canMsg"`
	InstanceName     string `json:"instanceName"` // Instance name template
	KeyFields        string `json:"keyFields"`    // Flow key fields
	ProcessID        string `json:"processID"`    // Process id

	Variables []*Variables `json:"variables" gorm:"-"`
}

Flow info

type FlowProcessRelation

type FlowProcessRelation struct {
	BaseModel
	FlowID string `json:"flowID"`

	BpmnText string `json:"bpmnText"` // flow model json

	ProcessID string `json:"processID"` // Process id

}

FlowProcessRelation flowID,processD

type FlowProcessRelationRepo

type FlowProcessRelationRepo interface {
	Create(db *gorm.DB, model *FlowProcessRelation) error
	DeleteByFlowID(db *gorm.DB, flowID string) error
	FindByProcessID(db *gorm.DB, processID string) (*FlowProcessRelation, error)
}

FlowProcessRelationRepo interface

type FlowRepo

type FlowRepo interface {
	Create(db *gorm.DB, model *Flow) error
	Create2(db *gorm.DB, model *Flow) error
	Update(db *gorm.DB, ID string, updateMap map[string]interface{}) error
	Delete(db *gorm.DB, ID string) error
	FindByID(db *gorm.DB, ID string) (*Flow, error)
	FindByIDs(db *gorm.DB, IDs []string) ([]*Flow, error)
	UpdateFlow(db *gorm.DB, model *Flow) error
	FindFlows(db *gorm.DB, condition map[string]interface{}) ([]*Flow, error)
	GetFlows(db *gorm.DB, condition map[string]interface{}) ([]*Flow, error)
	UpdateFlows(db *gorm.DB, condition map[string]interface{}, updateMap map[string]interface{}) error
	FindPageFlows(db *gorm.DB, condition map[string]interface{}, page, limit int) ([]*Flow, int64)
	FindByProcessID(db *gorm.DB, processID string) (*Flow, error)
	FindFlowList(db *gorm.DB, condition map[string]interface{}) ([]*Flow, error)
	UpdateAppStatus(db *gorm.DB, appID string, appStatus string) error
	DeleteByIDs(db *gorm.DB, IDs []string) error

	FindPublishIDs(db *gorm.DB, flowID string) ([]string, error)
}

FlowRepo interface

type FormField

type FormField struct {
	BaseModel

	FlowID         string `json:"flowId"`
	FormID         string `json:"formId"`
	FieldName      string `json:"fieldName"`
	FieldValuePath string `json:"fieldValuePath"`
}

FormField info

type FormFieldRepo

type FormFieldRepo interface {
	Create(db *gorm.DB, model *FormField) error
	Update(db *gorm.DB, ID string, updateMap map[string]interface{}) error
	Delete(db *gorm.DB, ID string) error
	DeleteByFlowID(db *gorm.DB, flowID string) error
	FindByFlowID(db *gorm.DB, ID string) ([]*FormField, error)
	DeleteByFlowIDs(db *gorm.DB, flowIDs []string) error
}

FormFieldRepo interface

type HandleTaskModel

type HandleTaskModel struct {
	HandleType       string                 `json:"handleType"`
	HandleDesc       string                 `json:"handleDesc"`
	Remark           string                 `json:"remark"`
	TaskDefKey       string                 `json:"taskDefKey"`
	AttachFiles      []AttachFileModel      `json:"attachFiles"`
	HandleUserIDs    []string               `json:"handleUserIds"`
	CorrelationIDs   []string               `json:"correlationIds"`
	FormData         map[string]interface{} `json:"formData"`
	AutoReviewUserID string                 `json:"autoReviewUserId"`
	RelNodeDefKey    string                 `json:"RelNodeDefKey"`
}

HandleTaskModel task handle model

type Instance

type Instance struct {
	BaseModel

	AppID             string          `json:"appId"`
	AppStatus         string          `json:"appStatus"`
	AppName           string          `json:"appName"`
	FlowID            string          `json:"flowId"`
	ProcessInstanceID string          `json:"processInstanceId"`
	FormID            string          `json:"formId"`
	FormInstanceID    string          `json:"formInstanceId"`
	Name              string          `json:"name"`
	ApplyNo           string          `json:"applyNo"`
	ApplyUserID       string          `json:"applyUserId"`
	ApplyUserName     string          `json:"applyUserName"`
	Status            string          `json:"status"`
	FormData          interface{}     `gorm:"-" json:"formData"`
	FormSchema        interface{}     `gorm:"-" json:"formSchema"`
	Tasks             []ActTaskEntity `gorm:"-" json:"tasks"`
	Nodes             []NodeModel     `gorm:"-" json:"nodes"`
	RequestID         string          `json:"requestID"`
}

Instance info

type InstanceExecution

type InstanceExecution struct {
	BaseModel

	ProcessInstanceID string `json:"processInstanceID"`
	ExecutionID       string `json:"executionID"`
	Result            string `json:"result"`
}

InstanceExecution info

type InstanceExecutionRepo

type InstanceExecutionRepo interface {
	Create(db *gorm.DB, model *InstanceExecution) error
	Update(db *gorm.DB, ID string, updateMap map[string]interface{}) error

	Delete(db *gorm.DB, ID string) error
	DeleteByProcessInstanceIDs(db *gorm.DB, processInstanceIDs []string) error
	FindByID(db *gorm.DB, ID string) (*InstanceExecution, error)
	FindByIDs(db *gorm.DB, IDs []string) ([]*InstanceExecution, error)
	FindByExecutionIDs(db *gorm.DB, executionIDs []string) ([]*InstanceExecution, error)
}

InstanceExecutionRepo interface

type InstanceRepo

type InstanceRepo interface {
	Create(db *gorm.DB, model *Instance) error
	Update(db *gorm.DB, ID string, updateMap map[string]interface{}) error
	Delete(db *gorm.DB, ID string) error
	FindByID(db *gorm.DB, ID string) (*Instance, error)
	FindByRequestID(db *gorm.DB, RequestID string) ([]Instance, error)
	FindByIDs(db *gorm.DB, IDs []string) ([]*Instance, error)
	FindByProcessInstanceIDs(db *gorm.DB, processInstanceIDs []string) ([]*Instance, error)
	GetEntityByProcessInstanceID(db *gorm.DB, processInstanceID string) (*Instance, error)
	FindInstances(db *gorm.DB, formInstanceID string, status []string) ([]*Instance, error)

	PageInstances(db *gorm.DB, req *PageInstancesReq) ([]*Instance, int64, error)
	GetInstances(db *gorm.DB, condition map[string]interface{}) ([]*Instance, error)
	DeleteByFlowIDs(db *gorm.DB, flowIDs []string) error
	UpdateAppStatus(db *gorm.DB, appID string, appStatus string) error
}

InstanceRepo interface

type InstanceStep

type InstanceStep struct {
	BaseModel

	ProcessInstanceID string             `json:"processInstanceId"`
	TaskID            string             `json:"taskId"`
	TaskType          string             `json:"taskType"` // 节点类型:或签、会签、任填、全填、开始、结束
	TaskDefKey        string             `json:"taskDefKey"`
	TaskName          string             `json:"taskName"`
	HandleUserIDs     string             `json:"handleUserIds"`
	Status            string             `json:"status"` // 步骤处理结果,通过、拒绝、完成填写、已回退、打回重填、自动跳过、自动交给管理员
	NodeInstanceID    string             `json:"nodeInstanceId"`
	OperationRecords  []*OperationRecord `gorm:"-" json:"operationRecords"`
	FlowName          string             `gorm:"-" json:"flowName"`
	Reason            string             `gorm:"-" json:"reason"`
}

InstanceStep info

type InstanceStepRepo

type InstanceStepRepo interface {
	Create(db *gorm.DB, model *InstanceStep) error
	Update(db *gorm.DB, ID string, updateMap map[string]interface{}) error
	Delete(db *gorm.DB, ID string) error
	FindByID(db *gorm.DB, ID string) (*InstanceStep, error)
	FindInstanceSteps(db *gorm.DB, condition *InstanceStep) ([]*InstanceStep, error)
	FindInstanceStepsByStatus(db *gorm.DB, processInstanceID string, status []string) ([]*InstanceStep, error)
	GetFlowInstanceStep(db *gorm.DB, processInstanceID string, nodeInstanceID string, status []string) ([]*InstanceStep, error)
	UpdateByNodeInstanceID(db *gorm.DB, nodeInstanceID string, updateMap map[string]interface{}) error
	DeleteByProcessInstanceIDs(db *gorm.DB, processInstanceIDs []string) error
}

InstanceStepRepo interface

type InstanceVariables

type InstanceVariables struct {
	BaseModel

	ProcessInstanceID string `json:"processInstanceID"`
	Name              string `json:"name"`
	Type              string `json:"type"`
	Code              string `json:"code"`
	FieldType         string `json:"fieldType"`
	Format            string `json:"format"`
	Value             string `json:"value"`
	Desc              string `json:"desc"`
}

InstanceVariables info

type InstanceVariablesRepo

type InstanceVariablesRepo interface {
	Create(db *gorm.DB, model *InstanceVariables) error
	Update(db *gorm.DB, ID string, updateMap map[string]interface{}) error
	UpdateByID(db *gorm.DB, ID string, update interface{}) error
	Delete(db *gorm.DB, ID string) error
	FindByID(db *gorm.DB, ID string) (*InstanceVariables, error)

	BatchCreate(db *gorm.DB, model []*InstanceVariables) error
	FindVariablesByProcessInstanceID(db *gorm.DB, processInstanceID string) ([]*InstanceVariables, error)
	UpdateVariable(db *gorm.DB, processInstanceID string, code string, value string) error
	UpdateTypeAndValue(db *gorm.DB, processInstanceID string, code string, fieldType string, value string) error
	DeleteByProcessInstanceIDs(db *gorm.DB, processInstanceIDs []string) error
	FindVariablesByCode(db *gorm.DB, processInstanceID string, code string) (*InstanceVariables, error)
}

InstanceVariablesRepo interface

type NodeModel

type NodeModel struct {
	TaskDefKey string `json:"taskDefKey"` // Task definition id
	TaskName   string `json:"taskName"`
}

NodeModel event model

type OperationRecord

type OperationRecord struct {
	BaseModel

	ProcessInstanceID string `json:"processInstanceID"`
	InstanceStepID    string `json:"instanceStepID"` // step id
	HandleType        string `json:"handleType"`
	HandleUserID      string `json:"handleUserID"`
	HandleDesc        string `json:"handleDesc"`
	Remark            string `json:"remark"`
	Status            string `json:"status"` // COMPLETED,ACTIVE

	TaskID          string          `json:"taskId"`
	TaskName        string          `json:"taskName"`
	TaskDefKey      string          `json:"taskDefKey"`
	CorrelationData string          `json:"correlationData"`
	HandleTaskModel HandleTaskModel `gorm:"-" json:"handleTaskModel"`
	CurrentNodeType string          `gorm:"-" json:"currentNodeType"`
	RelNodeDefKey   string          `json:"RelNodeDefKey"`
}

OperationRecord info

type OperationRecordRepo

type OperationRecordRepo interface {
	Create(db *gorm.DB, model *OperationRecord) error
	Update(db *gorm.DB, ID string, updateMap map[string]interface{}) error
	Delete(db *gorm.DB, ID string) error
	FindByID(db *gorm.DB, ID string) (*OperationRecord, error)
	GetAgreeUserIds(db *gorm.DB, processInstanceID string) ([]string, error)
	FindRecords(db *gorm.DB, processInstanceID, instanceStepID string, status []string, includeStatus bool) ([]*OperationRecord, error)
	GetHandleUserIDs(db *gorm.DB, processInstanceID string, taskID string, handleType string) ([]string, error)
	UpdateStatus(db *gorm.DB, IDs []string, status string, userID string) error
	UpdateStatus2(db *gorm.DB, IDs []string, status string, userID string, remark string) error
	FindRecordsByTaskIDs(db *gorm.DB, handleType string, taskIDs []string) ([]*OperationRecord, error)
	FindRecordByRelDefKey(db *gorm.DB, processInstanceID string, relDefKey string) (*OperationRecord, error)
	DeleteByProcessInstanceIDs(db *gorm.DB, processInstanceIDs []string) error
}

OperationRecordRepo interface

type PageInstancesReq

type PageInstancesReq struct {
	page.ReqPage
	ApplyUserID     string
	Status          string
	CreateTimeBegin string
	CreateTimeEnd   string
	Keyword         string
	AppID           string
	FlowIDs         []string
}

PageInstancesReq struct

type TriggerRule

type TriggerRule struct {
	BaseModel
	FlowID string `json:"flowId"`
	FormID string `json:"formId"`
	Rule   string `json:"rule"`
}

TriggerRule info

type TriggerRuleRepo

type TriggerRuleRepo interface {
	Create(db *gorm.DB, model *TriggerRule) error
	Update(db *gorm.DB, ID string, updateMap map[string]interface{}) error
	Delete(db *gorm.DB, ID string) error
	FindByID(db *gorm.DB, ID string) (*TriggerRule, error)
	FindByFormIDAndDFlowID(db *gorm.DB, formID, flowID string) (*TriggerRule, error)
	DeleteByFlowIDS(db *gorm.DB, flowIDS []string) error
	FindTriggerRules(db *gorm.DB, condition map[string]interface{}) ([]*TriggerRule, error)
	FindTriggerRulesByFormID(db *gorm.DB, formID string) ([]*TriggerRule, error)
}

TriggerRuleRepo interface

type Urge

type Urge struct {
	BaseModel

	TaskID            string `json:"taskId"`
	ProcessInstanceID string `json:"processInstanceId"`
}

Urge info

type UrgeNumModel

type UrgeNumModel struct {
	TaskID  string
	UrgeNum int64
}

UrgeNumModel urge num model

type UrgeRepo

type UrgeRepo interface {
	Create(db *gorm.DB, model *Urge) error
	Update(db *gorm.DB, ID string, updateMap map[string]interface{}) error
	Delete(db *gorm.DB, ID string) error
	FindByID(db *gorm.DB, ID string) (*Urge, error)
	FindTaskIDs(db *gorm.DB) ([]string, error)
	DeleteByProcessInstanceIDs(db *gorm.DB, processInstanceIDs []string) error

	FindByTaskID(db *gorm.DB, taskID string) ([]*Urge, error)
	GetUrgeNums(db *gorm.DB, taskIDs []string) (map[string]int64, error)
}

UrgeRepo interface

type Variables

type Variables struct {
	BaseModel

	FlowID       string `json:"flowId"`
	Name         string `json:"name"`
	Type         string `json:"type"`
	Code         string `json:"code"`
	FieldType    string `json:"fieldType"`
	Format       string `json:"format"`
	DefaultValue string `json:"defaultValue"`
	Desc         string `json:"desc"`
}

Variables info

type VariablesRepo

type VariablesRepo interface {
	Create(db *gorm.DB, model *Variables) error
	Create2(db *gorm.DB, entity *Variables) error
	Update(db *gorm.DB, ID string, updateMap map[string]interface{}) error
	// UpdateByID(db *gorm.DB, ID string, update interface{}) error
	Delete(db *gorm.DB, ID string) error
	DeleteByFlowID(db *gorm.DB, flowID string) error
	DeleteByFlowIDs(db *gorm.DB, flowIDs []string) error
	FindByID(db *gorm.DB, ID string) (*Variables, error)
	FindVariablesByFlowID(db *gorm.DB, ID string) ([]*Variables, error)
	FindVariables(db *gorm.DB, conditionMap map[string]interface{}) ([]*Variables, error)
}

VariablesRepo interface

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL