ming #1

Merged
liufumingren merged 558 commits from ming into main 2026-11-18 16:13:25 +08:00
2 changed files with 19 additions and 1 deletions
Showing only changes of commit c84d5ac4ae - Show all commits

View File

@ -901,6 +901,16 @@ class InboxFunctionsService extends Service {
// 第四步:批量创建工单(初始状态 pending,后续根据通知结果升级)
const creatorLabel = [ groupName, userName ].filter(Boolean).join('-') || 'AI系统';
// 获取原消息内容,写入工单明细
let interceptMsgContent = '';
try {
const iid = ctx.inboxContext?.inbound_message_id;
if (iid) {
const imsg = await ctx.model.InboxMessage.findByPk(iid, { attributes: [ 'content' ], raw: true });
if (imsg && imsg.content) interceptMsgContent = String(imsg.content);
}
} catch (e) { /* ignore */ }
const createdNos = [];
const waybillToAsNo = {}; // waybill_id → after_sale_no 映射
for (const e of toCreate) {
@ -910,6 +920,7 @@ class InboxFunctionsService extends Service {
`运单号: ${e.waybill_code}`,
`快递公司: ${e.logistics_name || '未知'}`,
reason ? `拦截原因: ${reason}` : '',
interceptMsgContent ? `原消息: ${interceptMsgContent}` : '',
].filter(Boolean).join('\n');
await ctx.service.systems.afterSale.create({

View File

@ -3600,6 +3600,8 @@ class RecheckOrderService extends OrderBaseService {
const now = new Date();
const updateValues = {
intercept_status: 'intercepted_at_warehouse',
step: 4,
outbound_status: 'fin',
updated_at: now,
};
const updateResult = await orderModel.update(updateValues, {
@ -3800,7 +3802,12 @@ class RecheckOrderService extends OrderBaseService {
if (order) {
await orderModel.update(
{ intercept_status: 'intercepted_at_warehouse', updated_at: now },
{
intercept_status: 'intercepted_at_warehouse',
step: 4,
outbound_status: 'fin',
updated_at: now,
},
{ where: orderWhere }
);