- 重构半成品流转逻辑:进度权威源改为 workpiece.currentStationNo,新增 completedText 快照字段,废除 doneProcessCodes - 清理物料品类中半成品类型,存量数据幂等清理,调整物料管理方式文案为批次/序列号 - 新增日排产状态专用更新接口,修复工单工艺校验逻辑 - 新增物料档案代理接口、深路径文件下载接口 - 优化前端界面文案与工位选择逻辑,补充追溯页半成品流转展示 - 调整WMS端物料品类校验与入库接口契约 - 新增/更新数据库表结构与实体类代码
45 lines
1.4 KiB
Go
45 lines
1.4 KiB
Go
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"}}
|
||
}
|
||
|
||
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"),
|
||
}
|
||
}
|