- 列表:B2B 待处理/配送列表固定加急优先排序(wms_order_b2b.is_urgent='Y' 置顶), 作业明细筛选口径不变 - 备货/提货:新增 setB2bUrgent/cancelB2bUrgent、startB2bPrep/cancelB2bPrep/finishB2bPrep、 setB2bPickupPlate、pickupB2b、updateB2bOrderImages;提货即出库完成 (写 outbound_status=fin / step=4 / delivery_time 并迁移到配送表),车牌与提货照片 随单落库 - 分箱:新增 wms_order_b2b_items 与 order.updateB2bPackingItems、order.getB2bPackingSnapshot; 快照按商品行返回 wms_picking 取货储位(items[].pick_locations / pick_location_count), 列表不再携带储位明细 - 齐套校验:仓库 subject_config 新增 b2b_packing_quantity_check,备货完成时逐商品校验 分箱数量合计等于 plan_qty 且总箱数与箱号数一致 - 拦截:B2B 订单不参与波次抓取、快捷复核批量发货、反审回待审核与克隆,命中即整批驳回 - 明细:order.pendingOrder.detail / order.deliveryOrder.detail 为 B2B 订单附加副表作业明细 b2b、备货照片 images 与提货照片 pickup_images - 迁移:wms_order_b2b 新增 is_urgent 与备货作业字段,新建 wms_order_b2b_items - 文档:methods/system.json 与 methods/changes/system.json 同步至 0.3.375 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
49 lines
1.5 KiB
JavaScript
49 lines
1.5 KiB
JavaScript
'use strict';
|
||
|
||
const OrderBaseService = require('./base');
|
||
|
||
/** B2B 列表强制条件 */
|
||
const B2B_FIXED_WHERE = Object.freeze({ is_b2b: 'Y' });
|
||
|
||
/**
|
||
* B2B 配送订单系统方法。
|
||
*
|
||
* 查询条件与 order.deliveryOrder.list 完全一致(dispatch 分表 + dispatch_lane=m4),
|
||
* 仅额外强制 is_b2b='Y',用于 B2B 订单的配送域列表。
|
||
*/
|
||
class DeliveryOrder2bService extends OrderBaseService {
|
||
constructor(ctx) {
|
||
super(ctx);
|
||
const _noNeedLogin = '';
|
||
const _noNeedRight = 'list';
|
||
const _noNeedLog = 'list';
|
||
const _noNeedAuth = 'list';
|
||
this.systemInit(_noNeedLogin, _noNeedRight, _noNeedLog, _noNeedAuth);
|
||
}
|
||
|
||
/**
|
||
* B2B 配送订单列表。
|
||
*
|
||
* 在 order.deliveryOrder.list 的基础上强制 is_b2b='Y',并附加 wms_order_b2b 作业明细字段
|
||
* (total_box_count / pickup_plate_number / prep_remark / prep_duration_seconds /
|
||
* is_picked_up / picked_up_at / created_at / prep_at)。
|
||
*
|
||
* @param {Object} data 请求体(与 order.deliveryOrder.list 一致)。
|
||
* @return {Promise<Object>} 列表与分页信息。
|
||
*/
|
||
async list(data = {}) {
|
||
const warehouseId = this.getWarehouseId();
|
||
const result = await this.listByModule('deliveryOrder', data, {
|
||
fixedWhere: B2B_FIXED_WHERE,
|
||
b2bDetailFilter: true,
|
||
urgentFirst: true,
|
||
});
|
||
return {
|
||
...result,
|
||
list: await this.attachB2bJobDetail(result.list, warehouseId),
|
||
};
|
||
}
|
||
}
|
||
|
||
module.exports = DeliveryOrder2bService;
|