oms/backend/app/model/orderStatusPending.js
liufumingren 6c03a20364 feat(backend): 订单状态分表、WMS 推送与归档
- 新增 order_index 索引表 + 6 张同构状态表(待审核/异常/委外中/配送/已作废/已取消)与历史表,
  订单 ID 全局唯一,状态由业务事务推动:审核、驳回、取消、作废、恢复、归档
- 明细表 order_status_items、收件人文本智能解析、批量切换仓库/店铺并刷新快照
- WMS deliveryorder.create 推送(单条/批量)、推送失败定时重试、订单归档定时任务
- 迁移:建表、旧发货单数据迁入新表、菜单合并与迁移记录清理
- routes / swagger contract 补充订单状态接口

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-10-30 23:06:18 +08:00

22 lines
690 B
JavaScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

'use strict';
const { businessFields } = require('../lib/orderFields');
const { ORDER_STATUS, ORDER_TABLE_BY_STATUS } = require('../lib/orderStatus');
/**
* 待审核订单表(order_status_pending)
*
* 订单起点状态:审核通过后整行转入 order_status_outsourcing(委外中)。
* @param {Egg.Application} app egg application
* @return {object} orderStatusPending model
*/
module.exports = app => {
const tableName = ORDER_TABLE_BY_STATUS[ORDER_STATUS.PENDING];
const OrderStatusPending = app.model.define(tableName, businessFields(app.Sequelize, ORDER_STATUS.PENDING), {
tableName,
comment: '订单-待审核',
});
return OrderStatusPending;
};