Files
bj_power/bj_power_mes/schema/semi_flow.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

45 lines
1.5 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 (
"time"
"entgo.io/ent"
"entgo.io/ent/dialect/entsql"
"entgo.io/ent/schema"
"entgo.io/ent/schema/field"
"entgo.io/ent/schema/index"
)
// SemiFlow 在制品流转记录:进度快照(完成至工位N),调用 WMS /api/internal/semi/*
type SemiFlow struct {
ent.Schema
}
func (SemiFlow) Annotations() []schema.Annotation {
return []schema.Annotation{entsql.Annotation{Table: "semi_flow"}, entsql.WithComments(true), schema.Comment("SemiFlow 在制品流转记录:进度快照(完成至工位N),调用 WMS /api/internal/semi/*")}
}
func (SemiFlow) Fields() []ent.Field {
return []ent.Field{
field.Int("id").Positive(),
field.String("sn").MaxLen(64).Comment("工件SN"),
field.String("orderNo").Default("").MaxLen(64),
// 已废除旧字段:不再写入,仅保留历史数据(进度唯一权威源=workpiece.currentStationNo)
field.JSON("doneProcessCodes", []int{}).Optional().Comment("已完成工序码(已废除,历史数据保留)"),
field.String("completedText").Default("").MaxLen(64).Comment("完成至工位快照(如:已完成至工位3;空=尚未报工)"),
// INBOUND / OUTBOUND
field.String("action").Default("INBOUND").MaxLen(20),
field.String("targetDock").Default("").MaxLen(20),
field.String("operator").Default("").MaxLen(64),
field.Time("createdAt").Default(time.Now).Immutable(),
}
}
func (SemiFlow) Indexes() []ent.Index {
return []ent.Index{
index.Fields("sn"),
index.Fields("orderNo"),
index.Fields("action"),
}
}