feat: dbms新增支持工单流程审批

This commit is contained in:
meilin.huang
2024-02-29 22:12:50 +08:00
parent bf75483a3c
commit f93231da61
115 changed files with 3280 additions and 553 deletions

View File

@@ -0,0 +1,52 @@
package entity
import (
"encoding/json"
"mayfly-go/pkg/enumx"
"mayfly-go/pkg/logx"
"mayfly-go/pkg/model"
)
// 流程定义信息
type Procdef struct {
model.Model
Name string `json:"name" form:"name"` // 名称
DefKey string `json:"defKey" form:"defKey"` //
Tasks string `json:"tasks"` // 审批节点任务信息
Status ProcdefStatus `json:"status"` // 状态
Remark string `json:"remark"`
}
func (p *Procdef) TableName() string {
return "t_flow_procdef"
}
// 获取审批节点任务列表
func (p *Procdef) GetTasks() []*ProcdefTask {
var tasks []*ProcdefTask
err := json.Unmarshal([]byte(p.Tasks), &tasks)
if err != nil {
logx.ErrorTrace("解析procdef tasks失败", err)
return tasks
}
return tasks
}
type ProcdefTask struct {
Name string `json:"name" form:"name"` // 审批节点任务名称
TaskKey string `json:"taskKey" form:"taskKey"` // 任务key
UserId string `json:"userId"` // 审批人
}
type ProcdefStatus int8
const (
ProcdefStatusEnable ProcdefStatus = 1
ProcdefStatusDisable ProcdefStatus = -1
)
var ProcdefStatusEnum = enumx.NewEnum[ProcdefStatus]("流程定义状态").
Add(ProcdefStatusEnable, "启用").
Add(ProcdefStatusDisable, "禁用")