feat: 完成客户第12条需求+多系统改造
1. 新增预警表添加工单号字段,支持按工单号检索预警 2. 添加工单过滤在制品/绩效报表/预警中心查询 3. 补全WMS台账字段口径与权限配置 4. 修复备料单与数量不符处理流程 5. 新增配送进度/库位联动/自动出库功能 6. 修复AGV配送状态更新逻辑 7. 优化退料与库存管理细节
This commit is contained in:
@@ -7,8 +7,15 @@ import (
|
||||
)
|
||||
|
||||
// OrderMaterialLedger 工单物料台账(WMS 侧)
|
||||
// 维护:物料总需求数量、累计已出库数量、剩余待出库数量
|
||||
// 强约束:累计出库 ≤ 工单总需求量;等于时领料完结,禁止再出库
|
||||
//
|
||||
// 字段口径(2026-09-19 定稿,一个字段只有一个写者;详见 临时.md §2):
|
||||
// - total_qty 需求总量 [写者:MES 同步台账]
|
||||
// - out_qty 累计已发出 [写者:出库]
|
||||
// - returned_qty 累计已退回 [写者:退库收货]
|
||||
// - consumed_qty 累计已消耗 [写者:报工反冲核销]
|
||||
//
|
||||
// 派生量:net_out_qty = out_qty − returned_qty(净领用,用于超量拦截与「领料完结」判定)。
|
||||
// 强约束:net_out_qty ≤ total_qty;等于时领料完结。退料后净额回落,可再次补料。
|
||||
type OrderMaterialLedger struct {
|
||||
ent.Schema
|
||||
}
|
||||
@@ -19,7 +26,9 @@ func (OrderMaterialLedger) Fields() []ent.Field {
|
||||
field.String("material_code").Comment("物料编码"),
|
||||
field.String("material_name").Optional().Comment("物料名称(冗余)"),
|
||||
field.Int("total_qty").Default(0).Comment("物料总需求数量"),
|
||||
field.Int("out_qty").Default(0).Comment("累计已出库数量"),
|
||||
field.Int("out_qty").Default(0).Comment("累计已发出数量(仅出库写入)"),
|
||||
field.Int("returned_qty").Default(0).Comment("累计已退回数量(仅退库收货写入)"),
|
||||
field.Int("consumed_qty").Default(0).Comment("累计已消耗数量(仅报工反冲核销写入;不动库存)"),
|
||||
field.String("status").Default("进行中").Comment("进行中/领料完结"),
|
||||
// 目标工位:备料送到哪个装配工位(客户诉求 L297-300;MES 同步台账时传入)
|
||||
field.String("target_station").Optional().Comment("目标工位(装配工位号)"),
|
||||
|
||||
Reference in New Issue
Block a user