- 新增过程巡检按步骤上报、数量不符上报、工位退料功能 - 增加工单工程编号三级归属字段 - 新增物料安全库存与缺货预警 - 新增附件管理、退库单管理模块 - 优化生产看板展示逻辑与前端页面文案 - 清理冗余的工艺路线相关代码与备份文件
50 lines
1.7 KiB
Go
50 lines
1.7 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"
|
|
)
|
|
|
|
// MaterialQtyReport 工位数量不符上报(客户诉求 问题记录 L482/L486):
|
|
// 工位收到料数量与下发数量不一致时,工人正规上报入口,形成闭环记录。
|
|
type MaterialQtyReport struct {
|
|
ent.Schema
|
|
}
|
|
|
|
func (MaterialQtyReport) Annotations() []schema.Annotation {
|
|
return []schema.Annotation{entsql.Annotation{Table: "material_qty_report"}}
|
|
}
|
|
|
|
func (MaterialQtyReport) Fields() []ent.Field {
|
|
return []ent.Field{
|
|
field.Int("id").Positive(),
|
|
field.Int("stationNo").Default(0).Comment("工位号"),
|
|
field.String("orderNo").Default("").MaxLen(64).Comment("工单号"),
|
|
field.String("sn").Default("").MaxLen(64).Comment("工件SN"),
|
|
field.String("materialCode").Default("").MaxLen(64).Comment("物料编码"),
|
|
field.String("materialName").Default("").MaxLen(128).Comment("物料名称"),
|
|
field.Int("planQty").Default(0).Comment("应发数量"),
|
|
field.Int("actualQty").Default(0).Comment("实收数量"),
|
|
field.Int("diffQty").Default(0).Comment("差异=应发-实收"),
|
|
field.String("cause").Default("").MaxLen(255).Comment("差异原因"),
|
|
field.String("status").Default("PENDING").MaxLen(10).Comment("PENDING/RESOLVED"),
|
|
field.String("operator").Default("").MaxLen(64).Comment("上报人"),
|
|
field.Time("createdAt").Default(time.Now).Immutable(),
|
|
field.Time("resolvedAt").Optional().Nillable(),
|
|
}
|
|
}
|
|
|
|
func (MaterialQtyReport) Indexes() []ent.Index {
|
|
return []ent.Index{
|
|
index.Fields("status"),
|
|
index.Fields("stationNo"),
|
|
index.Fields("orderNo"),
|
|
index.Fields("createdAt"),
|
|
}
|
|
}
|