- 移除station表的hasDock、dockCode字段及相关代码 - 新增dock表注释及关联逻辑,支持一个工位绑定多个接驳台 - 更新工位相关的seed、logic、schema及前端代码,适配新的接驳台管理方式 - 新增SQL注释固化脚本,完善MES表注释
42 lines
1.4 KiB
Go
42 lines
1.4 KiB
Go
package schema
|
||
|
||
import (
|
||
"entgo.io/ent"
|
||
"entgo.io/ent/dialect/entsql"
|
||
"entgo.io/ent/schema"
|
||
"entgo.io/ent/schema/field"
|
||
"entgo.io/ent/schema/index"
|
||
)
|
||
|
||
// SemiFinished 半成品库存
|
||
// 【已废弃 2026-09-07】半成品已收编进统一库存主表 inventories(category=2),
|
||
// 本表仅保留历史数据(存量已迁移),新代码一律读写 inventories,禁止再写本表。
|
||
// 记录已完成工序,支持流转
|
||
type SemiFinished struct {
|
||
ent.Schema
|
||
}
|
||
|
||
func (SemiFinished) Annotations() []schema.Annotation {
|
||
return []schema.Annotation{entsql.Table("semi_finisheds"), entsql.WithComments(true), schema.Comment("SemiFinished 半成品库存")}
|
||
}
|
||
func (SemiFinished) Fields() []ent.Field {
|
||
return []ent.Field{
|
||
field.String("sn").Unique().Comment("半成品 SN"),
|
||
field.String("material_code").Optional().Comment("物料编码(MES 未传时按 SN 反查,可空)"),
|
||
field.String("completed_process").Optional().Comment("已完成工序(如 135)"),
|
||
field.Int("quantity").Default(1).Comment("数量"),
|
||
field.String("zone_code").Optional().Comment("所在区域"),
|
||
field.String("status").Default("在库").Comment("在库/出库/使用"),
|
||
field.String("order_no").Optional().Comment("关联工单"),
|
||
field.Int64("created_at").DefaultFunc(nowUnix),
|
||
field.Int64("updated_at").DefaultFunc(nowUnix),
|
||
}
|
||
}
|
||
|
||
func (SemiFinished) Indexes() []ent.Index {
|
||
return []ent.Index{
|
||
index.Fields("material_code"),
|
||
index.Fields("status"),
|
||
}
|
||
}
|