feat: 新增产品工艺管理与工序审核功能

- 新增产品工艺(product_process)及明细(product_process_item)数据模型
- 新增工序审核开关(need_audit)与审核角色(audit_role)字段
- 新增待审核签字页面与路由
- 优化 WMS/MES 接口交互,增加业务错误处理与友好提示
- 补充库存过滤逻辑,避免返回已出库 SN 数据
- 调整默认查询时间范围为近一个月,优化用户体验
This commit is contained in:
SunYF
2026-10-09 13:46:33 +08:00
parent e2f1dacf76
commit b032f47fc7
95 changed files with 10546 additions and 1457 deletions
+24
View File
@@ -212,6 +212,30 @@ func (f ProcessStepFunc) Mutate(ctx context.Context, m ent.Mutation) (ent.Value,
return nil, fmt.Errorf("unexpected mutation type %T. expect *ent.ProcessStepMutation", m)
}
// The ProductProcessFunc type is an adapter to allow the use of ordinary
// function as ProductProcess mutator.
type ProductProcessFunc func(context.Context, *ent.ProductProcessMutation) (ent.Value, error)
// Mutate calls f(ctx, m).
func (f ProductProcessFunc) Mutate(ctx context.Context, m ent.Mutation) (ent.Value, error) {
if mv, ok := m.(*ent.ProductProcessMutation); ok {
return f(ctx, mv)
}
return nil, fmt.Errorf("unexpected mutation type %T. expect *ent.ProductProcessMutation", m)
}
// The ProductProcessItemFunc type is an adapter to allow the use of ordinary
// function as ProductProcessItem mutator.
type ProductProcessItemFunc func(context.Context, *ent.ProductProcessItemMutation) (ent.Value, error)
// Mutate calls f(ctx, m).
func (f ProductProcessItemFunc) Mutate(ctx context.Context, m ent.Mutation) (ent.Value, error) {
if mv, ok := m.(*ent.ProductProcessItemMutation); ok {
return f(ctx, mv)
}
return nil, fmt.Errorf("unexpected mutation type %T. expect *ent.ProductProcessItemMutation", m)
}
// The RoleFunc type is an adapter to allow the use of ordinary
// function as Role mutator.
type RoleFunc func(context.Context, *ent.RoleMutation) (ent.Value, error)