chore: init bj_power monorepo (dashboard/mes/wms/wms_client/workstation), clear subproject git metadata and align naming to folder names

This commit is contained in:
SunYF
2026-08-27 10:09:54 +08:00
commit 1f0ee844a4
408 changed files with 102201 additions and 0 deletions
+55
View File
@@ -0,0 +1,55 @@
package schema
import (
"bj_power_mes/constants"
"entgo.io/ent"
"entgo.io/ent/dialect/entsql"
"entgo.io/ent/schema"
"entgo.io/ent/schema/edge"
"entgo.io/ent/schema/field"
"entgo.io/ent/schema/index"
)
// 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),
}
}
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.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排�,先�用的优先出�),
}
}
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("当��用的工�),
}
}
func (EquipmentSlot) Indexes() []ent.Index {
return []ent.Index{
index.Fields("equipmentId", "slotNo").Unique(),
index.Fields("currentJobId"),
}
}