Files
bj_power/bj_power_mes/schema/process_dict.go
T
SunYF a2afd2f6dc feat: 五项目业务实现并对接完成
- 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
2026-08-27 19:50:57 +08:00

33 lines
842 B
Go

package schema
import (
"time"
"entgo.io/ent"
"entgo.io/ent/schema/field"
"entgo.io/ent/schema/index"
)
// ProcessDict 工序字典:12 道工序可维护,用户自定义描述做什么操作等
type ProcessDict struct {
ent.Schema
}
func (ProcessDict) Fields() []ent.Field {
return []ent.Field{
field.Int("code").Unique().Comment("工序号 1~12"),
field.String("name").Comment("工序名称"),
field.String("description").Optional().Comment("该工序做什么操作的描述"),
field.Int("sort_num").Default(0).Comment("排序"),
field.Bool("enabled").Default(true),
field.Time("created_at").Default(time.Now).Immutable(),
field.Time("updated_at").Default(time.Now).UpdateDefault(time.Now).Optional().Nillable(),
}
}
func (ProcessDict) Indexes() []ent.Index {
return []ent.Index{
index.Fields("code"),
}
}