feat:完善项目
This commit is contained in:
@ -5,16 +5,25 @@ import "strings"
|
||||
// WorkSchedule 工单流程数据模型
|
||||
type WorkSchedule struct {
|
||||
Model
|
||||
Kind WorkScheduleKind `gorm:"column:kind;type:tinyint(1);default:1;comment:工单类型" json:"-"`
|
||||
Title string `gorm:"column:title;type:varchar(30);default:null;comment:标题" json:"title"`
|
||||
Stage int `orm:"column:stage;type:tinyint(1);default:1;comment:阶段" json:"stage"`
|
||||
Step int `orm:"column:step;type:tinyint(1);default:1;comment:步骤(1:阶段-1:步骤)" json:"step"`
|
||||
Target WorkScheduleTarget `orm:"column:target;type:tinyint(1);default:1;comment:对象类型" json:"target"`
|
||||
TargetValue string `orm:"column:target_value;type:tinyint(1);default:1;comment:对象信息" json:"target_value"`
|
||||
IsCountersign WorkScheduleCountersign `orm:"column:is_countersign;type:tinyint(1);default:0;comment:是否会签" json:"is_countersign"`
|
||||
Stage int `gorm:"column:stage;type:tinyint(1);default:1;comment:阶段" json:"stage"`
|
||||
Step int `gorm:"column:step;type:tinyint(1);default:1;comment:步骤(1:阶段-1:步骤)" json:"step"`
|
||||
Target WorkScheduleTarget `gorm:"column:target;type:tinyint(1);default:1;comment:对象类型" json:"target"`
|
||||
TargetValue string `gorm:"column:target_value;type:tinyint(1);default:1;comment:对象信息" json:"target_value"`
|
||||
IsCountersign WorkScheduleCountersign `gorm:"column:is_countersign;type:tinyint(1);default:0;comment:是否会签" json:"is_countersign"`
|
||||
ModelDeleted
|
||||
ModelAt
|
||||
}
|
||||
|
||||
// WorkScheduleKind 工单流程类型
|
||||
type WorkScheduleKind int
|
||||
|
||||
const (
|
||||
// WorkScheduleKindForRepair 维修工单
|
||||
WorkScheduleKindForRepair WorkScheduleKind = iota + 1
|
||||
)
|
||||
|
||||
// WorkScheduleTarget 工单对象类型
|
||||
type WorkScheduleTarget int
|
||||
|
||||
@ -51,6 +60,13 @@ func (m *WorkSchedule) SetTargetValueAttribute(value []string) {
|
||||
m.TargetValue = strings.Join(value, ",")
|
||||
}
|
||||
|
||||
func (m *WorkSchedule) KindTitle() string {
|
||||
if m.Kind == WorkScheduleKindForRepair {
|
||||
return "维修工单"
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func NewWorkSchedule() *WorkSchedule {
|
||||
return &WorkSchedule{}
|
||||
}
|
||||
|
Reference in New Issue
Block a user