fix(wle): 现场拦截(售后已签收)不再算仓储物流转运异常 #83
Loading…
x
Reference in New Issue
Block a user
No description provided.
Delete Branch "yanhui-wle-intercept-20261023"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
目的与范围
业务口径(2026-10-23,yanhui 提出):仓储中心物流转运异常里,把「现场拦截」的去掉
—— 也就是发的货被快递当场拦下、最终被售后仓签收的那批,物流环节其实已经结束了,
不该再报「卡在网点发不出去」。
判据(业务原话):售后单有「签收单号」且「实退数量」不为 0。
落地口径
jst_returnAndRefundInfo.l_id/jst_qmcust_refundlist.l_idjst_returnAndRefundItem.r_qty/jst_qmcust_refundlist_item.r_qtyqty,只能看 r_qty:货没到 = 0、仅退款/补发恒为 0店铺互斥,两张售后表都要读。
改动
warehouseLogisticsExceptionRegistry.js:新增INTERCEPT_AFTERSALE_SOURCES(两张表 + 各自的 as_id 关联表达式)。warehouseLogisticsExceptionService.js:新增loadInterceptedOrders(),在主循环前批量判定;命中即从异常清单摘掉。warehouseLogisticsExceptionNotifyJob.js:钉钉文案补一行「另有 N 个包裹属现场拦截(售后已签收)」。同步与兼容性
db1185c(PR #82 合并后),无冲突。exclusions.interceptPackages / interceptOrders / interceptReasons,老前端不读这些字段也不会报错。
只从异常里摘掉 —— 否则异常率会被放大。
性能
两张售后表在 rpt 副本里都是堆表(零索引),
o_id IN (...)只能全表扫:实测 returnAndRefund 4.5s(125 万行)、qmcust 8.5s(176 万行)。因此:
验证
node --test test/warehouseLogisticsException.test.js test/warehouseLogisticsExceptionNotify.test.js→ 47/47 通过9854409/9850736/9858367,全是「拒收退货 + 实退 1 件 + 签收单号=原运单号 + 卖家已收货」9859198(l_id 有、r_qty=0)与9871523(仅退款、r_qty=0)正确地没被剔npm run check:469/471,2 个失败为既有平台差异(resilientSecretStoreWindows 权限位、cloudDatabase负缓存依赖本地 13307)风险与回退
兜底:
r_qty只在货真的签收入库后才 > 0,未签收恒为 0;且exclusions.interceptOrders可核对。