fix: rebuild MES as compilable go-zero+ent backend (renamed bj_power_mes), restore 3 workstation projects from pristine original, align naming; all Go projects go build clean
This commit is contained in:
@@ -8,36 +8,33 @@ import (
|
||||
"entgo.io/ent/schema/field"
|
||||
)
|
||||
|
||||
// Recipe 工艺路线,定义产品从原料到成品的完整加工流程
|
||||
// Recipe 工艺路线
|
||||
type Recipe struct {
|
||||
ent.Schema
|
||||
}
|
||||
|
||||
func (Recipe) Annotations() []schema.Annotation {
|
||||
return []schema.Annotation{
|
||||
entsql.Annotation{
|
||||
Table: "recipe",
|
||||
Options: "COMMENT='工艺路线表,定义产品从原料到成品的完整加工工序流程,支持版本管理'",
|
||||
},
|
||||
entsql.WithComments(true),
|
||||
entsql.Annotation{Table: "recipe"},
|
||||
}
|
||||
}
|
||||
|
||||
func (Recipe) Fields() []ent.Field {
|
||||
return []ent.Field{
|
||||
field.Int("id").Positive().Comment("主键ID"),
|
||||
field.String("name").MaxLen(50).Comment("路线名称,如 曲轴标准工艺"),
|
||||
field.String("code").MaxLen(20).Unique().Comment("路线编码,全局唯一标识"),
|
||||
field.Int("version").Default(1).Comment("版本号,工艺变更时递增,追溯历史版本"),
|
||||
field.String("desc").Default("").Comment("路线描述,说明该工艺的适用范围和特点"),
|
||||
field.Bool("isActive").Default(true).Comment("是否启用,false=停用该工艺路线"),
|
||||
field.Int("id").Positive(),
|
||||
field.String("name").MaxLen(50).Comment("路线名称"),
|
||||
field.String("code").MaxLen(20).Unique().Comment("路线编码"),
|
||||
field.Int("version").Default(1).Comment("版本号"),
|
||||
field.String("desc").Default("").Comment("描述"),
|
||||
field.Int("totalSteps").Default(0).Comment("总步骤数"),
|
||||
field.Bool("isActive").Default(true).Comment("是否启用"),
|
||||
}
|
||||
}
|
||||
|
||||
func (Recipe) Edges() []ent.Edge {
|
||||
return []ent.Edge{
|
||||
edge.To("steps", RecipeStep.Type).Comment("工序步骤列表"),
|
||||
edge.To("productTypes", ProductType.Type).Comment("使用该工艺的产品类型"),
|
||||
edge.To("jobs", Job.Type).Comment("使用该工艺的工件"),
|
||||
edge.To("steps", RecipeStep.Type).Comment("工序步骤"),
|
||||
edge.To("productTypes", ProductType.Type).Comment("关联产品类型"),
|
||||
edge.To("jobs", Job.Type).Comment("工件"),
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user