Merge branch 'main' into dev_match

This commit is contained in:
2026-11-07 10:41:19 +08:00
15 changed files with 265 additions and 49 deletions
@@ -1533,12 +1533,9 @@ export function buildWorkOrderWhere({
if (acceptanceMode) {
const rawMode = String(acceptanceMode).trim()
if (rawMode === 'internal_consignment') {
filters.push(`(
wo.material_json->'consignment'->>'inventoryId' IS NOT NULL
AND (wo.material_json->'consignment'->>'fulfillmentType' IS NULL OR wo.material_json->'consignment'->>'fulfillmentType' != 'worker_deposit')
AND (wo.material_json->'consignment'->>'workerId' IS NULL OR wo.material_json->'consignment'->>'workerId' = '0')
AND (wo.assigned_worker_id IS NULL OR wo.assigned_worker_id = 0)
)`)
// 「寄售来源」与是否已经匹配打手是两个正交条件。
// 这里不能内置“必须未指派”,否则再接 workerId 筛选会恒为空。
filters.push(`wo.material_json->'consignment'->>'inventoryId' IS NOT NULL`)
} else if (rawMode === WORK_ORDER_ACCEPTANCE_MODE.FRIEND_GIFT) {
filters.push(`(
wo.acceptance_mode = 'friend_gift'