refactor(wms): 合并库存表为统一inventory,重构业务逻辑

1. 合并inventory_batch与serial_number为统一inventory表,用manage_mode区分结构件批次/精密件SN
2. 移除冗余的material_type字段与相关逻辑
3. 重构库存查询、检验、入库出库等业务逻辑适配新表结构
4. 调整前端路由与菜单,拆分基础数据为区域维护和物料档案
5. 优化入库校验逻辑,避免空单问题
6. 调整Vite构建配置,关闭自动清空输出目录
7. 为各模块添加详细中文注释,统一业务术语
8. 生成并更新Ent自动代码文件
This commit is contained in:
SunYF
2026-09-02 08:21:11 +08:00
parent 47573e44b0
commit 68f50ee46e
70 changed files with 5895 additions and 9818 deletions
+6 -18
View File
@@ -44,16 +44,16 @@ func (f InspectionRecordFunc) Mutate(ctx context.Context, m ent.Mutation) (ent.V
return nil, fmt.Errorf("unexpected mutation type %T. expect *ent.InspectionRecordMutation", m)
}
// The InventoryBatchFunc type is an adapter to allow the use of ordinary
// function as InventoryBatch mutator.
type InventoryBatchFunc func(context.Context, *ent.InventoryBatchMutation) (ent.Value, error)
// The InventoryFunc type is an adapter to allow the use of ordinary
// function as Inventory mutator.
type InventoryFunc func(context.Context, *ent.InventoryMutation) (ent.Value, error)
// Mutate calls f(ctx, m).
func (f InventoryBatchFunc) Mutate(ctx context.Context, m ent.Mutation) (ent.Value, error) {
if mv, ok := m.(*ent.InventoryBatchMutation); ok {
func (f InventoryFunc) Mutate(ctx context.Context, m ent.Mutation) (ent.Value, error) {
if mv, ok := m.(*ent.InventoryMutation); ok {
return f(ctx, mv)
}
return nil, fmt.Errorf("unexpected mutation type %T. expect *ent.InventoryBatchMutation", m)
return nil, fmt.Errorf("unexpected mutation type %T. expect *ent.InventoryMutation", m)
}
// The InventoryLockFunc type is an adapter to allow the use of ordinary
@@ -140,18 +140,6 @@ func (f SemiFinishedFunc) Mutate(ctx context.Context, m ent.Mutation) (ent.Value
return nil, fmt.Errorf("unexpected mutation type %T. expect *ent.SemiFinishedMutation", m)
}
// The SerialNumberFunc type is an adapter to allow the use of ordinary
// function as SerialNumber mutator.
type SerialNumberFunc func(context.Context, *ent.SerialNumberMutation) (ent.Value, error)
// Mutate calls f(ctx, m).
func (f SerialNumberFunc) Mutate(ctx context.Context, m ent.Mutation) (ent.Value, error) {
if mv, ok := m.(*ent.SerialNumberMutation); ok {
return f(ctx, mv)
}
return nil, fmt.Errorf("unexpected mutation type %T. expect *ent.SerialNumberMutation", m)
}
// The StocktakeItemFunc type is an adapter to allow the use of ordinary
// function as StocktakeItem mutator.
type StocktakeItemFunc func(context.Context, *ent.StocktakeItemMutation) (ent.Value, error)