feat(mes): 添加定时同步可生产数量到WMS及BOM项相关标准字段
- 在main.go中添加定时任务每10分钟同步可生产数量到WMS系统 - 为BomItem实体添加relatedStandard字段及相关CRUD方法 - 为InspectionRecord实体添加reportNo、materialCode、materialName等字段 - 更新ent schema确保新字段的验证和默认值设置 - 添加必要的数据库迁移和字段映射逻辑
This commit is contained in:
@@ -128,6 +128,18 @@ func (f MaterialFunc) Mutate(ctx context.Context, m ent.Mutation) (ent.Value, er
|
||||
return nil, fmt.Errorf("unexpected mutation type %T. expect *ent.MaterialMutation", m)
|
||||
}
|
||||
|
||||
// The MaterialDemandFunc type is an adapter to allow the use of ordinary
|
||||
// function as MaterialDemand mutator.
|
||||
type MaterialDemandFunc func(context.Context, *ent.MaterialDemandMutation) (ent.Value, error)
|
||||
|
||||
// Mutate calls f(ctx, m).
|
||||
func (f MaterialDemandFunc) Mutate(ctx context.Context, m ent.Mutation) (ent.Value, error) {
|
||||
if mv, ok := m.(*ent.MaterialDemandMutation); ok {
|
||||
return f(ctx, mv)
|
||||
}
|
||||
return nil, fmt.Errorf("unexpected mutation type %T. expect *ent.MaterialDemandMutation", m)
|
||||
}
|
||||
|
||||
// The OrderMaterialLedgerFunc type is an adapter to allow the use of ordinary
|
||||
// function as OrderMaterialLedger mutator.
|
||||
type OrderMaterialLedgerFunc func(context.Context, *ent.OrderMaterialLedgerMutation) (ent.Value, error)
|
||||
@@ -176,6 +188,18 @@ func (f PermissionFunc) Mutate(ctx context.Context, m ent.Mutation) (ent.Value,
|
||||
return nil, fmt.Errorf("unexpected mutation type %T. expect *ent.PermissionMutation", m)
|
||||
}
|
||||
|
||||
// The ProducibleSnapshotFunc type is an adapter to allow the use of ordinary
|
||||
// function as ProducibleSnapshot mutator.
|
||||
type ProducibleSnapshotFunc func(context.Context, *ent.ProducibleSnapshotMutation) (ent.Value, error)
|
||||
|
||||
// Mutate calls f(ctx, m).
|
||||
func (f ProducibleSnapshotFunc) Mutate(ctx context.Context, m ent.Mutation) (ent.Value, error) {
|
||||
if mv, ok := m.(*ent.ProducibleSnapshotMutation); ok {
|
||||
return f(ctx, mv)
|
||||
}
|
||||
return nil, fmt.Errorf("unexpected mutation type %T. expect *ent.ProducibleSnapshotMutation", m)
|
||||
}
|
||||
|
||||
// The ReturnOrderFunc type is an adapter to allow the use of ordinary
|
||||
// function as ReturnOrder mutator.
|
||||
type ReturnOrderFunc func(context.Context, *ent.ReturnOrderMutation) (ent.Value, error)
|
||||
|
||||
Reference in New Issue
Block a user