1. 调整物料编码字段为可空,优化注释说明 2. 修复Vite构建自动清空产物目录冲突问题 3. 优化前端提示文案与表单占位符 4. 为各前端项目添加内联SVG图标 5. 重构MES半成品流转逻辑,不再静默吞掉WMS错误并记录日志 6. 生成并添加空的WMS客户端静态文件 7. 完善Ent ORM模型的空值支持与查询谓词 8. 优化半成品入库接口,支持doneProcessCodes数组格式,新增SN反查物料编码逻辑 9. 更新帮助文档与操作手册
35 lines
1020 B
Go
35 lines
1020 B
Go
package schema
|
|
|
|
import (
|
|
"entgo.io/ent"
|
|
"entgo.io/ent/schema/field"
|
|
"entgo.io/ent/schema/index"
|
|
)
|
|
|
|
// SemiFinished 半成品库存
|
|
// 记录已完成工序,支持流转
|
|
type SemiFinished struct {
|
|
ent.Schema
|
|
}
|
|
|
|
func (SemiFinished) Fields() []ent.Field {
|
|
return []ent.Field{
|
|
field.String("sn").Unique().Comment("半成品 SN"),
|
|
field.String("material_code").Optional().Comment("物料编码(MES 未传时按 SN 反查,可空)"),
|
|
field.String("completed_process").Optional().Comment("已完成工序(如 135)"),
|
|
field.Int("quantity").Default(1).Comment("数量"),
|
|
field.String("zone_code").Optional().Comment("所在区域"),
|
|
field.String("status").Default("在库").Comment("在库/出库/使用"),
|
|
field.String("order_no").Optional().Comment("关联工单"),
|
|
field.Int64("created_at").DefaultFunc(nowUnix),
|
|
field.Int64("updated_at").DefaultFunc(nowUnix),
|
|
}
|
|
}
|
|
|
|
func (SemiFinished) Indexes() []ent.Index {
|
|
return []ent.Index{
|
|
index.Fields("material_code"),
|
|
index.Fields("status"),
|
|
}
|
|
}
|