- 移除station表的hasDock、dockCode字段及相关代码 - 新增dock表注释及关联逻辑,支持一个工位绑定多个接驳台 - 更新工位相关的seed、logic、schema及前端代码,适配新的接驳台管理方式 - 新增SQL注释固化脚本,完善MES表注释
48 lines
1.8 KiB
Go
48 lines
1.8 KiB
Go
package schema
|
|
|
|
import (
|
|
"time"
|
|
|
|
"entgo.io/ent"
|
|
"entgo.io/ent/dialect"
|
|
"entgo.io/ent/dialect/entsql"
|
|
"entgo.io/ent/schema"
|
|
"entgo.io/ent/schema/field"
|
|
"entgo.io/ent/schema/index"
|
|
)
|
|
|
|
// ProcessStep 工序步骤模板:一份工艺流程包含多个采集/考核步骤(按 seq 顺序执行)
|
|
type ProcessStep struct {
|
|
ent.Schema
|
|
}
|
|
|
|
func (ProcessStep) Annotations() []schema.Annotation {
|
|
return []schema.Annotation{entsql.Annotation{Table: "process_step"}, entsql.WithComments(true), schema.Comment("ProcessStep 工序步骤模板:一份工艺流程包含多个采集/考核步骤(按 seq 顺序执行)")}
|
|
}
|
|
|
|
func (ProcessStep) Fields() []ent.Field {
|
|
return []ent.Field{
|
|
field.Int("id").Positive(),
|
|
field.Int("flowId").Optional().Comment("所属工艺流程图ID"),
|
|
field.Int("seq").Default(1).Comment("步骤序号"),
|
|
field.String("name").MaxLen(128).Comment("步骤名称"),
|
|
field.String("collectType").Default("NONE").MaxLen(20).Comment("AUTO/MANUAL/NONE"),
|
|
field.Bool("isTorque").Default(false).Comment("是否拧紧采集"),
|
|
field.Bool("needCheck").Default(false).Comment("是否需要检测确认(报工前须检验通过)"),
|
|
field.Bool("needOperatorSign").Default(false).Comment("是否需要操作工签字(报工前须签字确认)"),
|
|
field.Bool("needInspectorSign").Default(false).Comment("是否需要检验员签字(审核通过并签字后放行)"),
|
|
// 本步骤图纸/附件(按工序分发到工位终端),多份,存 {name,url} 列表
|
|
field.JSON("attachment", []map[string]string{}).Optional().SchemaType(map[string]string{
|
|
dialect.Postgres: "jsonb",
|
|
}).Comment("本步骤图纸/附件列表 [{name,url}]"),
|
|
field.String("remark").Default("").MaxLen(255),
|
|
field.Time("createdAt").Default(time.Now).Immutable(),
|
|
}
|
|
}
|
|
|
|
func (ProcessStep) Indexes() []ent.Index {
|
|
return []ent.Index{
|
|
index.Fields("flowId"),
|
|
}
|
|
}
|