WMS_MAIN/model_rename_map.md
2026-03-23 17:10:07 +08:00

7.3 KiB
Raw Blame History

Model 重命名映射表

更新时间: 2026-03-22 来源:

  • model_inventory.md
  • app/model/*.js
  • app/service/**/*.js
  • app/controller/**/*.js

1. 使用说明

  • 本表只记录阶段 3 已确认的命名规范化项。
  • 变更级别分为 4 类:
    • P0-调用修复: 现有代码引用错误或运行时 key 不存在,必须先修。
    • P1-defineName 收敛: 只调整 defineName,不动文件名和 tableName。
    • P2-alias 收敛: 需要和关联定义一起调整。
    • 保持不动: 暂不建议改动。

2. P0: 必须先修的运行时调用

当前调用/命名 建议标准名 变更级别 原因 备注
WmsOrderDeliveryFactory OrderDeliveryFactory P0-调用修复 仓库内主流调用均为 OrderDeliveryFactory,当前写法与文件名不匹配 先修 app/service/apiMethods/test.js
WmsOrderItemsFactory OrderItemsFactory P0-调用修复 仓库内主流调用均为 OrderItemsFactory,当前写法与文件名不匹配 先修 app/service/apiMethods/test.js
AccountStoreRole AccountStoreEmployee 或补回独立模型 P0-调用修复 仓库内无 account_store_role.js,且当前表结构已落到 account_store_employee + employee_role 需要先确认目标数据关系
accountStoreRole accountStoreEmployee P0-调用修复 AccountPlatformActive 当前关联 alias 为 accountStoreEmployee,service 仍按 accountStoreRole 取值 要与 include 返回结构一起改

3. P1: defineName 收敛为运行时 key

以下项优先采用“只改 defineName,不改文件名、不改 tableName”的方式收敛。

文件 当前运行时 key 当前 defineName 建议 defineName 变更级别
app/model/account_platform_active.js AccountPlatformActive account_platform_active AccountPlatformActive P1-defineName 收敛
app/model/account_store_employee.js AccountStoreEmployee wms_account_store_employee AccountStoreEmployee P1-defineName 收敛
app/model/account.js Account account Account P1-defineName 收敛
app/model/api_app.js ApiApp api_app ApiApp P1-defineName 收敛
app/model/employee_role.js EmployeeRole employee_role EmployeeRole P1-defineName 收敛
app/model/entry_items.js EntryItems wms_entry_items EntryItems P1-defineName 收敛
app/model/entry_order.js EntryOrder wms_entry_order EntryOrder P1-defineName 收敛
app/model/fast_where.js FastWhere fast_where FastWhere P1-defineName 收敛
app/model/file_reference.js FileReference wms_file_reference FileReference P1-defineName 收敛
app/model/file.js File wms_file File P1-defineName 收敛
app/model/i18n_key.js I18nKey wms_i18n_key I18nKey P1-defineName 收敛
app/model/i18n_translation.js I18nTranslation wms_i18n_translation I18nTranslation P1-defineName 收敛
app/model/interface_type.js InterfaceType interface_type InterfaceType P1-defineName 收敛
app/model/location_space.js LocationSpace wms_location_space LocationSpace P1-defineName 收敛
app/model/location_type.js LocationType location_type LocationType P1-defineName 收敛
app/model/location_zone.js LocationZone wms_location_zone LocationZone P1-defineName 收敛
app/model/operation_log.js OperationLog operation_log OperationLog P1-defineName 收敛
app/model/order_delivery.js OrderDelivery order_delivery OrderDelivery P1-defineName 收敛
app/model/order_items.js OrderItems wms_order_items OrderItems P1-defineName 收敛
app/model/permission.js Permission permission Permission P1-defineName 收敛
app/model/platform_setting.js PlatformSetting platform_setting PlatformSetting P1-defineName 收敛
app/model/platform.js Platform platform Platform P1-defineName 收敛
app/model/print_computer.js PrintComputer print_computer PrintComputer P1-defineName 收敛
app/model/print_item.js PrintItem print_item PrintItem P1-defineName 收敛
app/model/print_station_express.js PrintStationExpress print_station_express PrintStationExpress P1-defineName 收敛
app/model/print_stations.js PrintStations print_stations PrintStations P1-defineName 收敛
app/model/print_template.js PrintTemplate print_template PrintTemplate P1-defineName 收敛
app/model/prohibited_type.js ProhibitedType prohibitedType ProhibitedType P1-defineName 收敛
app/model/qimen_app.js QimenApp qimen_app QimenApp P1-defineName 收敛
app/model/qimen_log.js QimenLog qimen_log QimenLog P1-defineName 收敛
app/model/receiving_detail.js ReceivingDetail wms_receiving_detail ReceivingDetail P1-defineName 收敛
app/model/receiving.js Receiving wms_receiving Receiving P1-defineName 收敛
app/model/role_permission.js RolePermission role_permission RolePermission P1-defineName 收敛
app/model/role.js Role role Role P1-defineName 收敛
app/model/stock_barcode.js StockBarcode stock_barcodes StockBarcode P1-defineName 收敛
app/model/stock_store.js StockStore stock_store StockStore P1-defineName 收敛
app/model/stock_unit.js StockUnit wms_stock_unit StockUnit P1-defineName 收敛
app/model/stock_warehouse.js StockWarehouse stock_warehouse StockWarehouse P1-defineName 收敛
app/model/storage.js Storage wms_storage Storage P1-defineName 收敛
app/model/store_warehouse.js StoreWarehouse store_warehouse StoreWarehouse P1-defineName 收敛
app/model/store.js Store store Store P1-defineName 收敛

4. 保持不动或低优先级处理项

文件 当前运行时 key 当前 defineName 建议 说明
app/model/order_delivery_factory.js OrderDeliveryFactory 动态 tableName 保持不动 工厂模型,不参与静态 defineName 收敛
app/model/order_items_factory.js OrderItemsFactory 动态 tableName 保持不动 工厂模型,不参与静态 defineName 收敛
app/model/print_record.js PrintRecord PrintRecord 保持不动 已符合标准
app/model/store_join.js StoreJoin StoreJoin 保持不动 已符合标准

5. P2: alias 收敛候选

位置 当前 alias 建议 alias 变更级别 说明
app/model/account.js accountStoreRoles accountStoreEmployees P2-alias 收敛 当前关联对象实际为 AccountStoreEmployee
app/model/account_platform_active.js accountStoreEmployee accountStoreEmployee 保持 当前 alias 合理,问题在 service 调用侧
app/model/account_store_employee.js employeeRole employeeRoles P2-alias 收敛 hasMany 建议使用复数
app/model/store.js accountStoreEmployee accountStoreEmployees P2-alias 收敛 hasMany 建议使用复数
app/model/role.js employeeRole employeeRoles P2-alias 收敛 hasMany 建议使用复数

6. 执行顺序建议

  1. 先修 P0 调用错误,保证所有 ctx.model / app.model 均能拿到正确对象。
  2. 再做 P1 defineName 收敛,限定在显式声明了 tableName 的静态模型。
  3. 最后做 P2 alias 收敛,并与阶段 4 的关联核对同步执行。