feat: 完成产线与仓储系统多模块迭代升级
本次迭代覆盖MES与WMS核心业务: 1. 新增接驳台托盘传感器读取与AGV对接能力 2. 完善工单排产、备料流程与权限体系拆分 3. 优化看板接口与前端路由、样式 4. 新增操作日志、库存盘点与角色保护逻辑 5. 修复代理地址、BOM保存等已知问题
This commit is contained in:
@@ -8,6 +8,42 @@ import (
|
||||
"fmt"
|
||||
)
|
||||
|
||||
// The AgvTaskFunc type is an adapter to allow the use of ordinary
|
||||
// function as AgvTask mutator.
|
||||
type AgvTaskFunc func(context.Context, *ent.AgvTaskMutation) (ent.Value, error)
|
||||
|
||||
// Mutate calls f(ctx, m).
|
||||
func (f AgvTaskFunc) Mutate(ctx context.Context, m ent.Mutation) (ent.Value, error) {
|
||||
if mv, ok := m.(*ent.AgvTaskMutation); ok {
|
||||
return f(ctx, mv)
|
||||
}
|
||||
return nil, fmt.Errorf("unexpected mutation type %T. expect *ent.AgvTaskMutation", m)
|
||||
}
|
||||
|
||||
// The DockFunc type is an adapter to allow the use of ordinary
|
||||
// function as Dock mutator.
|
||||
type DockFunc func(context.Context, *ent.DockMutation) (ent.Value, error)
|
||||
|
||||
// Mutate calls f(ctx, m).
|
||||
func (f DockFunc) Mutate(ctx context.Context, m ent.Mutation) (ent.Value, error) {
|
||||
if mv, ok := m.(*ent.DockMutation); ok {
|
||||
return f(ctx, mv)
|
||||
}
|
||||
return nil, fmt.Errorf("unexpected mutation type %T. expect *ent.DockMutation", m)
|
||||
}
|
||||
|
||||
// The EventLogFunc type is an adapter to allow the use of ordinary
|
||||
// function as EventLog mutator.
|
||||
type EventLogFunc func(context.Context, *ent.EventLogMutation) (ent.Value, error)
|
||||
|
||||
// Mutate calls f(ctx, m).
|
||||
func (f EventLogFunc) Mutate(ctx context.Context, m ent.Mutation) (ent.Value, error) {
|
||||
if mv, ok := m.(*ent.EventLogMutation); ok {
|
||||
return f(ctx, mv)
|
||||
}
|
||||
return nil, fmt.Errorf("unexpected mutation type %T. expect *ent.EventLogMutation", m)
|
||||
}
|
||||
|
||||
// The InboundDetailFunc type is an adapter to allow the use of ordinary
|
||||
// function as InboundDetail mutator.
|
||||
type InboundDetailFunc func(context.Context, *ent.InboundDetailMutation) (ent.Value, error)
|
||||
|
||||
Reference in New Issue
Block a user