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:
SunYF
2026-08-27 10:56:41 +08:00
parent 380715f8a9
commit 371b494c54
523 changed files with 67923 additions and 24758 deletions
+9 -14
View File
@@ -11,39 +11,34 @@ import (
"entgo.io/ent/schema/index"
)
// EquipmentSlot 设备槽�,��设备下的具体工�
// EquipmentSlot 设备槽位
type EquipmentSlot struct {
ent.Schema
}
func (EquipmentSlot) Annotations() []schema.Annotation {
return []schema.Annotation{
entsql.Annotation{
Table: "equipment_slot",
Options: "COMMENT='设备槽�表,记录��设备下�槽�的状���用的工件�FIFO排�信�'",
},
entsql.WithComments(true),
entsql.Annotation{Table: "equipment_slot"},
}
}
func (EquipmentSlot) Fields() []ent.Field {
return []ent.Field{
field.Int("id").Positive().Comment("主键ID"),
field.Int("equipmentId").Optional().Nillable().Comment("所属设备ID"),
field.Int("slotNo").Comment("槽���,从1开始递增"),
field.Int("id").Positive(),
field.Int("equipmentId").Optional().Nillable().Comment("设备ID"),
field.Int("slotNo").Comment("槽位序号(1-based)"),
field.Enum("status").
GoType(constants.SlotStatus("")).
Default(string(constants.SlotStatus_Empty)).
Comment("槽�状�:Empty/Occupied���Processing加工�Completed"),
field.Int("currentJobId").Optional().Nillable().Comment("当��用的工件ID"),
field.Time("occupiedAt").Optional().Nillable().Comment("�用时间,用于FIFO排�,先�用的优先出�),
Comment("槽位状态"),
field.Int("currentJobId").Optional().Nillable().Comment("当前工件ID"),
field.Time("occupiedAt").Optional().Nillable().Comment("占用时间(FIFO排序参考)"),
}
}
func (EquipmentSlot) Edges() []ent.Edge {
return []ent.Edge{
edge.From("equipment", Equipment.Type).Ref("slots").Field("equipmentId").Unique().Comment("所属设�),
edge.To("currentJob", Job.Type).Field("currentJobId").Unique().Comment("当��用的工�),
edge.From("equipment", Equipment.Type).Ref("slots").Field("equipmentId").Unique(),
}
}