feat:完善项目

This commit is contained in:
henry
2021-11-08 11:09:27 +08:00
parent 85b58968d1
commit 1502076841
20 changed files with 397 additions and 32 deletions

View File

@ -12,6 +12,7 @@ type WorkInstance struct {
Breakdown string `gorm:"column:breakdown;type:varchar(150);default:null;comment:故障" json:"breakdown"`
Priority WorkInstancePriority `gorm:"column:priority;type:tinyint(1);default:1;comment:工单优先级" json:"priority"`
Schedule uint64 `gorm:"column:schedule;type:int(11);default:1;comment:工单进度" json:"schedule"`
IsAssist WorkInstanceAssist `orm:"column:is_assist;type:tinyint(1);default:0;comment:协助状态" json:"is_assist"` // 当前阶段协助状态,确认是否需要下一阶段协助
Status WorkInstanceStatus `gorm:"column:status;type:tinyint(1);default:0;comment:工单状态" json:"status"`
Remark string `gorm:"column:remark;type:varchar(255);default:null;comment:备注信息" json:"remark"`
ModelDeleted
@ -50,6 +51,16 @@ const (
WorkInstanceStatusForComplete
)
// WorkInstanceAssist 协助状态
type WorkInstanceAssist int
const (
// WorkInstanceAssistForNot 否
WorkInstanceAssistForNot WorkInstanceAssist = iota
// WorkInstanceAssistForYes 是
WorkInstanceAssistForYes
)
func (m *WorkInstance) TableName() string {
return "work_instance"
}

View File

@ -5,11 +5,12 @@ import "strings"
// WorkSchedule 工单流程数据模型
type WorkSchedule struct {
Model
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"`
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"`
ModelDeleted
ModelAt
}
@ -24,10 +25,24 @@ const (
WorkScheduleTargetForRole
)
// WorkScheduleCountersign 工单会签模式
type WorkScheduleCountersign int
const (
// WorkScheduleCountersignForNot 不是会签模式
WorkScheduleCountersignForNot WorkScheduleCountersign = iota
// WorkScheduleCountersignForYes 是会签模式
WorkScheduleCountersignForYes
)
func (m *WorkSchedule) TableName() string {
return "work_schedule"
}
func (m *WorkSchedule) CountersignStatus() bool {
return m.IsCountersign == WorkScheduleCountersignForYes
}
func (m *WorkSchedule) GetTargetValueAttribute() []string {
return strings.Split(m.TargetValue, ",")
}