oms/backend/database/migrations/20261124030000-add-pdf-base64-to-waybill-fetch-records.js
liufumingren 5d424f2c98 取号响应改用 pdf_base64 返回面单 PDF
- dxm.fetchWaybillNo 改为返回 pdf_base64(纯 base64,不带 data: 前缀),不再塞进 printinfo
- waybillGet 透传 pdf_base64 给 WMS(printinfo 仍留给店管家等 JSON/加密串口径的平台)
- waybill_fetch_records 新增 pdf_base64 列(迁移,TEXT medium);
  result_data 里只留 pdf_base64_length 避免同一张 PDF 存三份,重放时从列补回
- 文档补:WMS 取号响应新增 pdf_base64 字段(含 WMS 落库/打印建议)、店小秘 6.1 存储口径
- 补 4 条单测(dxm 返回 pdf_base64、PDF 失败降级、取号透传、重放补回)
- 实测真实账号:运单号 3CAB6111900043,pdf_base64 88,796 字符,解码为 %PDF-1.4

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-11-24 02:17:21 +08:00

22 lines
762 B
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';
/**
* 取号记录增加面单 PDF 内容(base64)。
*
* 店小秘这类平台的面单是 PDF 文件(`printExpressNote.json?id=<包裹ID>`),
* 取号时一并拉下来,base64 原样留痕并回给 WMS 打印;
* 与店管家等「JSON/加密串」口径的 `printinfo` 分开存放,避免两种形态混在一列。
*/
module.exports = {
async up(queryInterface, Sequelize) {
await queryInterface.addColumn('waybill_fetch_records', 'pdf_base64', {
type: Sequelize.TEXT('medium'),
comment: '面单 PDF 内容(base64,不含 data: 前缀;店小秘等 PDF 面单平台)',
});
},
async down(queryInterface) {
await queryInterface.removeColumn('waybill_fetch_records', 'pdf_base64');
},
};