docs(business): 生成业务契约文档并重构MES客户端代码

- 创建案例.md文档,包含业务场景清单、业务流程、案例和回归测试三份完整文档
- WMS库房管理系统涵盖入库、出库、库存、检验、盘点等24个业务场景
- MES产线控制系统包含工单、排产、BOM、备料、质检、追溯等23个业务场景
- 工位终端系统支持上线、报工、下线、领料、巡检等15个现场作业场景
- 主链路从合同到成品入库,异常链路处理不合格、数量不符、退料等情况
- 删除MES客户端中的ScanRecord相关代码,精简客户端结构
- 更新客户端初始化逻辑,移除扫描记录相关的依赖注入配置
This commit is contained in:
SunYF
2026-09-20 18:25:44 +08:00
parent 5f68e77d5f
commit 8e6e8e1d20
46 changed files with 1052 additions and 3954 deletions
-44
View File
@@ -1,44 +0,0 @@
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"
)
// ScanRecord 扫码报工记录(station,sn,orderNo,type,operator,time
type ScanRecord struct {
ent.Schema
}
func (ScanRecord) Annotations() []schema.Annotation {
return []schema.Annotation{entsql.Annotation{Table: "scan_record"}}
}
func (ScanRecord) Fields() []ent.Field {
return []ent.Field{
field.Int("id").Positive(),
field.String("station").Default("").MaxLen(32).Comment("工位/扫码点"),
field.String("sn").MaxLen(64).Comment("工件SN"),
field.String("orderNo").Default("").MaxLen(64).Comment("工单号"),
// ONLINE(进线) / PROCESS(工序报工) / DONE(完工) / TEMP_STORE(暂存)
field.String("type").Default("PROCESS").MaxLen(20).Comment("报工类型"),
field.Int("processCode").Optional().Comment("工序号 1~12"),
field.String("operator").Default("").MaxLen(64).Comment("操作人"),
field.Time("time").Default(time.Now).Comment("报工时间"),
field.Time("createdAt").Default(time.Now).Immutable(),
}
}
func (ScanRecord) Indexes() []ent.Index {
return []ent.Index{
index.Fields("station"),
index.Fields("sn"),
index.Fields("orderNo"),
index.Fields("createdAt"),
}
}