feat(回写): 销售价为 0 也照常回写备货完成(方案A)——分拣完成必须让主系统知道,价格是否接受由主系统判断,被拒进台账按轮重试
CI / server typecheck + tests (push) Canceled after 0s
CI / web typecheck + tests + miniprogram syntax (push) Canceled after 0s
CI / eslint (观察项,C7 骨架) (push) Canceled after 0s
CI / npm audit (critical 硬拦) (push) Canceled after 0s

This commit is contained in:
Ubuntu
2026-10-20 08:04:10 +08:00
parent 56fe7de7a2
commit de15530ddd
+8 -2
View File
@@ -127,13 +127,19 @@ export async function writebackDeliveredOrderToMainSystem(
}
const price = Number(item.price);
if (!Number.isFinite(price) || price <= 0) {
/**
* 2026-10-19 开发者裁决(方案 A):**销售价为 0 也照常回写**(不再跳过)。
* 理由:分拣完成就必须让主系统知道"备货完成",否则订单永远卡在待备货;
* 价格是否可接受由主系统判断(被拒会记为 rejected 并按轮重试,台账可见)。
* 这里只拦"价格非法(NaN/缺字段)",不再按 <= 0 跳过。
*/
if (!Number.isFinite(price)) {
outcome.skippedZeroPrice += 1;
await markWriteback({
branchCode,
prepId: String(row.prep_id),
status: 'skipped_zero_price',
reason: '本系统该行销售价为 0,跳过回写(避免被主系统价格校验拒绝),补价后再回写',
reason: '本系统该行销售价缺失/非法,无法回写(补价后再回写)',
});
continue;
}