liufumingren 34273c166b 1
2026-07-02 22:08:47 +08:00

36 lines
1.2 KiB
JavaScript
Raw 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 MainService = require('../../main');
/**
* 系统方法层:quick.waybill(运单号快速查询接口包装层)。
* 主要职责:统一包装系统方法接口,处理权限、日志等公共逻辑,调用底层 service 实现业务功能。
*/
class QuickWaybillMethodService extends MainService {
constructor(ctx) {
super(ctx);
const _noNeedLogin = '';
const _noNeedRight = 'toOrder';
const _noNeedLog = '';
const _noNeedAuth = 'toOrder';
this.systemInit(_noNeedLogin, _noNeedRight, _noNeedLog, _noNeedAuth);
}
/**
* 根据运单号快速查询订单 ID。
* 查询 wms_order_express 表中 status=1 的有效记录,返回对应的 order_id。
*
* @param {Object} data 请求参数。
* @param {string} data.waybill_code 运单号。
* @return {Promise<Object>} 统一成功包装响应,包含 order_id。
*/
async toOrder(data = {}) {
const { service } = this;
const { waybill_code: waybillCode } = data;
const result = await service.systems.quick.waybill.toOrder({ waybill_code: waybillCode });
return this.success('查询成功', result);
}
}
module.exports = QuickWaybillMethodService;