Files
bj_power/bj_power_mes/schema/process_flow.go
T
SunYF 8be6e03a15 docs: 统一修正全项目“SN管理”相关术语为“序列号”
本次 commit 统一修正了全项目范围内关于 SN 管理的术语表述,将原“SN管理”、“序列号件”、“批次件”等表述调整为“序列号”、“序列号=是”、“序列号=否”,同时同步更新了相关文档、代码注释、前端提示文本、数据库 schema 注释、API 文档等,确保全链路术语统一,消除理解歧义。
2026-10-10 15:58:59 +08:00

42 lines
1.4 KiB
Go

package schema
import (
"time"
"entgo.io/ent"
"entgo.io/ent/dialect/entsql"
"entgo.io/ent/schema"
"entgo.io/ent/schema/field"
"entgo.io/ent/schema/index"
)
// ProcessFlow 工艺流程图(菜谱):描述"这个工位怎么干",承载工艺图纸 PDF + 工序步骤模板。
// 一份流程可被任意工位绑定,绑定关系由 station.flow_id 维护(「工位绑定」页);
// 执行顺序由工单的工位组合 work_order.process_seq 决定,与流程本身无关。
type ProcessFlow struct {
ent.Schema
}
func (ProcessFlow) Annotations() []schema.Annotation {
return []schema.Annotation{entsql.Annotation{Table: "process_flow"}, entsql.WithComments(true), schema.Comment("ProcessFlow 工艺流程图(菜谱):描述“这个工位怎么干”,承载工艺图纸 PDF + 工序步骤模板。")}
}
func (ProcessFlow) Fields() []ent.Field {
return []ent.Field{
field.Int("id").Positive(),
field.String("name").MaxLen(128).Comment("流程名称,如 3号工位装配流程"),
field.String("pdfFile").Default("").MaxLen(255).Comment("工艺图纸文件名"),
// ACTIVE / INACTIVE
field.String("status").Default("ACTIVE").MaxLen(20),
field.String("remark").Default("").MaxLen(255),
field.Time("createdAt").Default(time.Now).Immutable(),
field.Time("updatedAt").Default(time.Now).UpdateDefault(time.Now).Optional().Nillable(),
}
}
func (ProcessFlow) Indexes() []ent.Index {
return []ent.Index{
index.Fields("status"),
}
}