Files
bj_power/bj_power_wms/schema/semi_finished.go
T
SunYF 1e92b2a596 feat: 核心业务实体扩充(混产模板/产品BOM/试制记录)、WMS 库存检验增强与前端通用能力
- MES 新增实体:混产模板、产品BOM、产品工艺物料、试制记录(schema + ent 生成码 + logic/handler/前端页)
- WMS 实体增强:检验记录、库存、半成品重构;新增序列号库存与短缺代报
- AGV 与产能:AGV 手动点位与链路、物料守卫、短缺预测、原因字典
- 前端通用能力:新增下一步引导组件 NextStepBar,统一帮助文档/布局/请求拦截与操作列
- 工位终端:界面与各 handler 调整(api/store/绑定/PLC/拧紧/上报等)
- 配置与文档:更新 mes-api.yaml、WMS README 及案例/产线API/问题记录/项目说明/流程说明
2026-11-15 12:17:39 +08:00

42 lines
1.4 KiB
Go
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
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"),
}
}