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:
@@ -0,0 +1,51 @@
|
||||
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"
|
||||
)
|
||||
|
||||
// Measurement 抽检测量数据——外部测量软件推送的工件尺寸数据,绑定工件
|
||||
type Measurement struct {
|
||||
ent.Schema
|
||||
}
|
||||
|
||||
func (Measurement) Annotations() []schema.Annotation {
|
||||
return []schema.Annotation{
|
||||
entsql.Annotation{Table: "measurement"},
|
||||
}
|
||||
}
|
||||
|
||||
func (Measurement) Fields() []ent.Field {
|
||||
return []ent.Field{
|
||||
field.Int("id").Positive(),
|
||||
field.Int("jobId").Unique().Comment("关联工件ID(唯一,覆盖更新)"),
|
||||
field.Int("workOrderId").Comment("关联工单ID"),
|
||||
field.String("workpieceNo").Default("").Comment("工件编号"),
|
||||
field.String("workOrderNo").Default("").Comment("工单号"),
|
||||
field.String("palletCode").Default("").Comment("托盘码"),
|
||||
field.Float("bottom_hole_left").Optional().Nillable().Comment("左侧底孔 B"),
|
||||
field.Float("piston_hole_large").Optional().Nillable().Comment("变量活塞孔大孔 D"),
|
||||
field.Float("piston_hole_small").Optional().Nillable().Comment("变量活塞孔小孔 E"),
|
||||
field.Float("piston_hole_right").Optional().Nillable().Comment("右侧变量活塞孔 M"),
|
||||
field.Time("capturedAt").Default(time.Now).Optional().Nillable().Comment("测量时间"),
|
||||
field.Time("createdAt").Default(time.Now).Immutable().Comment("记录创建时间"),
|
||||
field.Time("updatedAt").Default(time.Now).UpdateDefault(time.Now).Comment("记录更新时间"),
|
||||
}
|
||||
}
|
||||
|
||||
func (Measurement) Edges() []ent.Edge {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (Measurement) Indexes() []ent.Index {
|
||||
return []ent.Index{
|
||||
index.Fields("workOrderId"),
|
||||
index.Fields("workpieceNo"),
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user