fix(inbox): 群类型切换时清理残留货主/快递专属字段,快递群原文转发仅发原文
This commit is contained in:
parent
3ba87b4baa
commit
e72274f222
@ -2233,8 +2233,8 @@ class InboxFunctionsService extends Service {
|
||||
continue;
|
||||
}
|
||||
|
||||
// 原文转发:运单号 + 客户原始消息
|
||||
const forwardMsg = `运单: ${info.waybills.join('、')}\n原文: ${originalText || raw}`;
|
||||
// 原文转发:仅客户原始消息(原文已含运单号)
|
||||
const forwardMsg = originalText || raw;
|
||||
for (const g of afterSalesGroups) {
|
||||
ctx.service.inbox.processor.pushSystemNotification({
|
||||
warehouse_id: warehouseId,
|
||||
|
||||
@ -328,13 +328,24 @@ class InboxGroupService extends Service {
|
||||
if (data.storeId !== undefined) {
|
||||
updateData.store_id = Number.isFinite(Number(data.storeId)) && Number(data.storeId) > 0
|
||||
? Number(data.storeId) : null;
|
||||
} else if (data.groupType !== undefined && targetGroupType !== 'store') {
|
||||
// 群类型切为非货主群(warehouse/express)且未显式传 storeId 时,
|
||||
// 清空遗留的货主绑定,避免仓库群/快递群仍残留 store_id
|
||||
updateData.store_id = null;
|
||||
}
|
||||
// 非 express 群类型时忽略 express 相关字段
|
||||
if (isExpress && expressInterfaces !== null) {
|
||||
updateData.express_interfaces = expressInterfaces || null;
|
||||
}
|
||||
if (isExpress && systemExpressCode !== undefined) {
|
||||
updateData.system_express_code = systemExpressCode || null;
|
||||
// 快递专属字段处理
|
||||
if (isExpress) {
|
||||
if (expressInterfaces !== null) {
|
||||
updateData.express_interfaces = expressInterfaces || null;
|
||||
}
|
||||
if (systemExpressCode !== undefined) {
|
||||
updateData.system_express_code = systemExpressCode || null;
|
||||
}
|
||||
} else if (data.groupType !== undefined) {
|
||||
// 群类型切为非快递群(store/warehouse)时清空快递专属配置,
|
||||
// 避免货主群/仓库群残留 express_interfaces / system_express_code
|
||||
updateData.express_interfaces = null;
|
||||
updateData.system_express_code = null;
|
||||
}
|
||||
// AI 开关(所有群类型均支持)
|
||||
if (data.aiEnabled !== undefined) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user