Files
bj_power/bj_power_wms/schema/outbound_detail.go
T
SunYF 1f7a42fc38 refactor(mes): 移除工位接驳台绑定逻辑,改为独立dock主数据
- 移除station表的hasDock、dockCode字段及相关代码
- 新增dock表注释及关联逻辑,支持一个工位绑定多个接驳台
- 更新工位相关的seed、logic、schema及前端代码,适配新的接驳台管理方式
- 新增SQL注释固化脚本,完善MES表注释
2026-10-08 13:09:53 +08:00

40 lines
1.3 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"
)
// OutboundDetail 出库明细(一张出库单可含多行)
// 与 InboundDetail 对称,记录本次出库涉及的具体批次/SN 与数量,
// 是库存账与单据账闭环核对的关键凭证。
type OutboundDetail struct {
ent.Schema
}
func (OutboundDetail) Annotations() []schema.Annotation {
return []schema.Annotation{entsql.Table("outbound_details"), entsql.WithComments(true), schema.Comment("OutboundDetail 出库明细(一张出库单可含多行)")}
}
func (OutboundDetail) Fields() []ent.Field {
return []ent.Field{
field.String("outbound_no").Comment("出库单号"),
field.String("sn_code").Optional().Comment("SN(电气件)"),
field.String("batch_no").Optional().Comment("批次号(结构件)"),
field.String("material_code").Comment("物料编码"),
field.Int("quantity").Default(1).Comment("数量"),
field.String("order_no").Optional().Comment("关联工单号"),
field.Int64("created_at").DefaultFunc(nowUnix),
}
}
func (OutboundDetail) Indexes() []ent.Index {
return []ent.Index{
index.Fields("outbound_no"),
index.Fields("sn_code"),
index.Fields("order_no"),
}
}