refactor: 重构工艺工序相关命名与数据模型
1. 全局替换"工序"为"工艺"统一术语,包括页面文案、枚举、注释
2. 重构工单与工件工艺数据模型:
- 新增工艺组合表flow_material作为备料/齐套唯一源头
- 新增工位状态表station_state支持自主停单/恢复接单
- 移除station_process派工表,改用工单工艺组合作为路线唯一源头
- 替换processCode为flowId作为工艺关联标识
- 重构工件当前进度字段为currentStationNo
3. 删除冗余的静态备份资源文件
4. 调整物料选择组件默认启用仅显示激活物料
5. 优化工单创建/编辑逻辑,新增工艺组合校验与保存
This commit is contained in:
@@ -104,6 +104,18 @@ func (f EventLogFunc) Mutate(ctx context.Context, m ent.Mutation) (ent.Value, er
|
||||
return nil, fmt.Errorf("unexpected mutation type %T. expect *ent.EventLogMutation", m)
|
||||
}
|
||||
|
||||
// The FlowMaterialFunc type is an adapter to allow the use of ordinary
|
||||
// function as FlowMaterial mutator.
|
||||
type FlowMaterialFunc func(context.Context, *ent.FlowMaterialMutation) (ent.Value, error)
|
||||
|
||||
// Mutate calls f(ctx, m).
|
||||
func (f FlowMaterialFunc) Mutate(ctx context.Context, m ent.Mutation) (ent.Value, error) {
|
||||
if mv, ok := m.(*ent.FlowMaterialMutation); ok {
|
||||
return f(ctx, mv)
|
||||
}
|
||||
return nil, fmt.Errorf("unexpected mutation type %T. expect *ent.FlowMaterialMutation", m)
|
||||
}
|
||||
|
||||
// The InspectionRecordFunc type is an adapter to allow the use of ordinary
|
||||
// function as InspectionRecord mutator.
|
||||
type InspectionRecordFunc func(context.Context, *ent.InspectionRecordMutation) (ent.Value, error)
|
||||
@@ -248,16 +260,16 @@ func (f StationFunc) Mutate(ctx context.Context, m ent.Mutation) (ent.Value, err
|
||||
return nil, fmt.Errorf("unexpected mutation type %T. expect *ent.StationMutation", m)
|
||||
}
|
||||
|
||||
// The StationProcessFunc type is an adapter to allow the use of ordinary
|
||||
// function as StationProcess mutator.
|
||||
type StationProcessFunc func(context.Context, *ent.StationProcessMutation) (ent.Value, error)
|
||||
// The StationStateFunc type is an adapter to allow the use of ordinary
|
||||
// function as StationState mutator.
|
||||
type StationStateFunc func(context.Context, *ent.StationStateMutation) (ent.Value, error)
|
||||
|
||||
// Mutate calls f(ctx, m).
|
||||
func (f StationProcessFunc) Mutate(ctx context.Context, m ent.Mutation) (ent.Value, error) {
|
||||
if mv, ok := m.(*ent.StationProcessMutation); ok {
|
||||
func (f StationStateFunc) Mutate(ctx context.Context, m ent.Mutation) (ent.Value, error) {
|
||||
if mv, ok := m.(*ent.StationStateMutation); ok {
|
||||
return f(ctx, mv)
|
||||
}
|
||||
return nil, fmt.Errorf("unexpected mutation type %T. expect *ent.StationProcessMutation", m)
|
||||
return nil, fmt.Errorf("unexpected mutation type %T. expect *ent.StationStateMutation", m)
|
||||
}
|
||||
|
||||
// The StepCriterionFunc type is an adapter to allow the use of ordinary
|
||||
|
||||
Reference in New Issue
Block a user