本次提交包含以下核心变更: 1. 新增按钮级权限控制框架与前端权限校验 2. 新增工位管理、工艺流程、巡检终端等核心业务模块 3. 完善用户体系,支持工位终端专属登录权限 4. 新增文件上传下载、报表查询等配套功能 5. 修复多系统兼容性与交互体验问题 6. 完成所有文档与配置项的规范化更新
42 lines
1.1 KiB
Go
42 lines
1.1 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"
|
|
)
|
|
|
|
// ProcessStep 工序步骤模板:一道工序包含多个采集/考核步骤
|
|
type ProcessStep struct {
|
|
ent.Schema
|
|
}
|
|
|
|
func (ProcessStep) Annotations() []schema.Annotation {
|
|
return []schema.Annotation{entsql.Annotation{Table: "process_step"}}
|
|
}
|
|
|
|
func (ProcessStep) Fields() []ent.Field {
|
|
return []ent.Field{
|
|
field.Int("id").Positive(),
|
|
field.Int("flowId").Optional().Comment("所属工艺流程图ID(块3: 步骤改挂流程)"),
|
|
field.Int("processCode").Comment("工序代码"),
|
|
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.String("remark").Default("").MaxLen(255),
|
|
field.Time("createdAt").Default(time.Now).Immutable(),
|
|
}
|
|
}
|
|
|
|
func (ProcessStep) Indexes() []ent.Index {
|
|
return []ent.Index{
|
|
index.Fields("processCode"),
|
|
index.Fields("flowId"),
|
|
}
|
|
}
|