fix(fulfillment): 修复载体重试并完善核销任务列表

This commit is contained in:
yml2213
2026-11-05 18:36:10 +08:00
parent 89a68b5734
commit e8b76b3b73
19 changed files with 945 additions and 104 deletions
@@ -492,10 +492,22 @@ export function buildTaskListFilters({
roleId = '',
dateFrom = '',
dateTo = '',
currentOnly = false,
}: TaskListQueryInput = {}): { whereClause: string; params: unknown[] } {
const filters: string[] = []
const params: unknown[] = []
if (currentOnly) {
filters.push(`ft.id = (
SELECT latest.id
FROM fulfillment_tasks latest
WHERE latest.order_item_id = ft.order_item_id
AND latest.unit_index = ft.unit_index
ORDER BY latest.id DESC
LIMIT 1
)`)
}
if (keyword) {
const trimmedKeyword = String(keyword).trim()
const isOrderNoLookup = isPlatformOrderIdLookupKeyword(trimmedKeyword)