- MES(B): 工单/BOM/备料/工序字典/PLC下发/拧紧/扫码报工/半成品/AGV/追溯逻辑,WMS与海康RCS客户端,看板Redis缓存API(概览/设备/进度/报警/趋势)+SSE - WMS(C): JWT滑动续签、Excel导入、盘点、内部API、种子数据、独立Postgres配置 - WMS客户端(E): Go网关8891反向代理+内嵌Vue3十页 - 工位终端(D): SQLite本地缓存+模拟拧紧源+内嵌Vue3页面 - Dashboard(A): 看板数据改接MES内部缓存API,SSE实时刷新+vite代理 - 清理各项目球形磨遗留代码,新增部署手册.md
38 lines
995 B
Go
38 lines
995 B
Go
package schema
|
|
|
|
import (
|
|
"time"
|
|
|
|
"entgo.io/ent"
|
|
"entgo.io/ent/schema/field"
|
|
"entgo.io/ent/schema/index"
|
|
)
|
|
|
|
// SemiFlow 半成品流转记录(同步 WMS 半成品出入库)
|
|
type SemiFlow struct {
|
|
ent.Schema
|
|
}
|
|
|
|
func (SemiFlow) Fields() []ent.Field {
|
|
return []ent.Field{
|
|
field.String("order_no").Optional(),
|
|
field.String("sn").Comment("半成品SN"),
|
|
field.String("material_code").Optional(),
|
|
field.String("completed_process").Optional().Comment("已完成工序,如 1-2-5"),
|
|
field.String("zone_code").Optional().Comment("目标库区 Z02 等"),
|
|
field.Enum("action").
|
|
Values("inbound", "outbound").
|
|
Default("inbound").Comment("入库暂存/出库重上线"),
|
|
field.Bool("wms_ok").Default(false).Comment("WMS 同步是否成功"),
|
|
field.String("resp_text").Optional().Comment("WMS 响应摘要"),
|
|
field.Time("created_at").Default(time.Now),
|
|
}
|
|
}
|
|
|
|
func (SemiFlow) Indexes() []ent.Index {
|
|
return []ent.Index{
|
|
index.Fields("order_no"),
|
|
index.Fields("sn"),
|
|
}
|
|
}
|