feat:完善项目
This commit is contained in:
@ -46,10 +46,12 @@ func initModel() {
|
||||
&synchronized{iModel: model.NewSysUserRole()},
|
||||
// 日志管理
|
||||
&synchronized{iModel: model.NewSysLog()}, &synchronized{iModel: model.NewSysUserLoginLog()},
|
||||
&synchronized{iModel: model.NewSysBreakdown()},
|
||||
// 功能信息
|
||||
&synchronized{iModel: model.NewManageSupplier()},
|
||||
&synchronized{iModel: model.NewManageMaterial()}, &synchronized{iModel: model.NewManageMaterialSupplier()},
|
||||
&synchronized{iModel: model.NewManageMaterialPurchase()}, &synchronized{iModel: model.NewManageMaterialWarehouse()},
|
||||
&synchronized{iModel: model.NewWorkInstance()},
|
||||
)
|
||||
}
|
||||
func initCacheMode() {
|
||||
|
18
app/common/model/sys_breakdown.go
Normal file
18
app/common/model/sys_breakdown.go
Normal file
@ -0,0 +1,18 @@
|
||||
package model
|
||||
|
||||
// SysBreakdown 故障信息数据模型
|
||||
type SysBreakdown struct {
|
||||
Model
|
||||
Title string `gorm:"column:title;type:varchar(30);default:null;comment:标题" json:"title"`
|
||||
Remark string `gorm:"column:remark;type:varchar(255);default:null;comment:备注 " json:"remark"`
|
||||
ModelDeleted
|
||||
ModelAt
|
||||
}
|
||||
|
||||
func (m *SysBreakdown) TableName() string {
|
||||
return "sys_breakdown"
|
||||
}
|
||||
|
||||
func NewSysBreakdown() *SysBreakdown {
|
||||
return &SysBreakdown{}
|
||||
}
|
@ -3,7 +3,6 @@ package model
|
||||
// SysRole 角色管理数据模型
|
||||
type SysRole struct {
|
||||
Model
|
||||
ModelTenant
|
||||
ParentID uint64 `gorm:"column:parent_id;type:int;default:0;comment:父级ID" json:"-"`
|
||||
Name string `gorm:"column:name;type:varchar(30);default:null;comment:角色名" json:"name"`
|
||||
Remark string `gorm:"column:remark;type:varchar(255);default:null;comment:角色备注" json:"remark"`
|
||||
|
16
app/common/model/work_detail.go
Normal file
16
app/common/model/work_detail.go
Normal file
@ -0,0 +1,16 @@
|
||||
package model
|
||||
|
||||
// WorkDetail 工单详细信息
|
||||
type WorkDetail struct {
|
||||
Model
|
||||
ModelDeleted
|
||||
ModelAt
|
||||
}
|
||||
|
||||
func (m *WorkDetail) TableName() string {
|
||||
return "work_detail"
|
||||
}
|
||||
|
||||
func NewWorkDetail() *WorkDetail {
|
||||
return &WorkDetail{}
|
||||
}
|
@ -1,14 +1,57 @@
|
||||
package model
|
||||
|
||||
// WorkInstance 工单数据模型
|
||||
type WorkInstance struct {
|
||||
Model
|
||||
Title string `json:"title"`
|
||||
ModelTenant
|
||||
OrderNo string `gorm:"column:order_no;type:varchar(30);default:null;comment:工单单号" json:"order_no"`
|
||||
Kind int `gorm:"column:kind;type:tinyint(1);default:0;comment:工单类型" json:"kind"`
|
||||
Title string `gorm:"column:title;type:varchar(30);default:null;comment:工单标题" json:"title"`
|
||||
MaterialID uint64 `gorm:"column:material_id;type:int(11);default:0;comment:装备ID" json:"material_id"`
|
||||
PlateNumber string `gorm:"column:plate_number;type:varchar(10);default:null;comment:车牌号" json:"plate_number"`
|
||||
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"`
|
||||
Progress int `gorm:"column:progress;type:tinyint(1);default:1;comment:工单进度" json:"progress"`
|
||||
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
|
||||
ModelAt
|
||||
}
|
||||
|
||||
// WorkInstanceKind 工单类型
|
||||
type WorkInstanceKind int
|
||||
|
||||
const (
|
||||
// WorkInstanceKindForOutside 外修
|
||||
WorkInstanceKindForOutside WorkInstanceKind = iota + 1
|
||||
// WorkInstanceKindForWithin 内修
|
||||
WorkInstanceKindForWithin
|
||||
)
|
||||
|
||||
// WorkInstancePriority 工单优先级
|
||||
type WorkInstancePriority int
|
||||
|
||||
const (
|
||||
// WorkInstancePriorityForCommonly 一般
|
||||
WorkInstancePriorityForCommonly WorkInstancePriority = iota + 1
|
||||
// WorkInstancePriorityForUrgent 紧急
|
||||
WorkInstancePriorityForUrgent
|
||||
// WorkInstancePriorityForVeryUrgent 非常紧急
|
||||
WorkInstancePriorityForVeryUrgent
|
||||
)
|
||||
|
||||
// WorkInstanceStatus 工单状态
|
||||
type WorkInstanceStatus int
|
||||
|
||||
const (
|
||||
// WorkInstanceStatusForOngoing 进行中
|
||||
WorkInstanceStatusForOngoing WorkInstanceStatus = iota
|
||||
// WorkInstanceStatusForComplete 已完成
|
||||
WorkInstanceStatusForComplete
|
||||
)
|
||||
|
||||
func (m *WorkInstance) TableName() string {
|
||||
return "manage_instance"
|
||||
return "work_instance"
|
||||
}
|
||||
|
||||
func NewWorkInstance() *WorkInstance {
|
||||
|
19
app/common/model/work_progress.go
Normal file
19
app/common/model/work_progress.go
Normal file
@ -0,0 +1,19 @@
|
||||
package model
|
||||
|
||||
// WorkProgress 工单进度数据模型
|
||||
type WorkProgress struct {
|
||||
Model
|
||||
UID uint64 `gorm:"column:uid;type:int;default:0;comment:用户uuid" json:"-"`
|
||||
WorkID uint64 `gorm:"column:work_id;type:int(11);default:0;comment:工单ID" json:"-"`
|
||||
Remark string `gorm:"column:remark;type:varchar(255);default:null;comment:备注信息" json:"remark"`
|
||||
ModelDeleted
|
||||
ModelAt
|
||||
}
|
||||
|
||||
func (m *WorkProgress) TableName() string {
|
||||
return "work_progress"
|
||||
}
|
||||
|
||||
func NewWorkProgress() *WorkProgress {
|
||||
return &WorkProgress{}
|
||||
}
|
@ -1,11 +1,27 @@
|
||||
package model
|
||||
|
||||
// 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"`
|
||||
ModelDeleted
|
||||
ModelAt
|
||||
}
|
||||
|
||||
// WorkScheduleTarget 工单对象类型
|
||||
type WorkScheduleTarget int
|
||||
|
||||
const (
|
||||
// WorkScheduleTargetForPerson 个人
|
||||
WorkScheduleTargetForPerson int = iota + 1
|
||||
// WorkScheduleTargetForRole 角色
|
||||
WorkScheduleTargetForRole
|
||||
)
|
||||
|
||||
func (m *WorkSchedule) TableName() string {
|
||||
return "work_schedule"
|
||||
}
|
||||
|
Reference in New Issue
Block a user