后端优化修复问题

This commit is contained in:
super
2026-06-18 18:53:16 +08:00
parent 021b0c618b
commit 0ecf5cd45a
44 changed files with 4275 additions and 81 deletions

View File

@@ -849,9 +849,9 @@ function buildSkipAsinDeletePolicy() {
return {
enabled,
mode: enabled ? 'DELETE_WHEN_PRICE_BELOW_MINIMUM' : 'NONE',
deleteWhenPriceBelowMinimum: enabled,
compareField: 'price',
thresholdField: 'minimumPrice',
delete_when_price_below_minimum: enabled,
compare_field: 'price',
threshold_field: 'minimum_price',
target: 'skip_asin',
source: 'frontend-price-track',
}
@@ -959,12 +959,14 @@ async function pushToPythonQueueLegacy() {
ts: Date.now(),
data: {
task_id: taskVo.taskId,
// 店铺简要信息(用于展示)
shop_names: matchedRows.map((i) => i.shopName).filter(Boolean),
country_codes: resolveCountryCodesForRequest(),
use_skip_asin_check: statusModeEnabled.value && !asinModeEnabled.value,
skip_asin_check_url: `/api/price-track/tasks/${taskVo.taskId}/skip-asin/check`,
use_paginated_skip_asins: false,
skip_asin_page_size: 0,
skip_asin_delete_policy: buildSkipAsinDeletePolicy(),
delete_skip_asin_when_price_below_minimum: statusModeEnabled.value && !asinModeEnabled.value,
deleteSkipAsinWhenPriceBelowMinimum: statusModeEnabled.value && !asinModeEnabled.value,
},
}
queuePayloadText.value = JSON.stringify(queuePayload, null, 2)
@@ -992,6 +994,7 @@ function buildQueuePayload(taskVo: PriceTrackCreateTaskVo, row: PriceTrackShopQu
const taskItem = taskVo.items?.[0]
const shopName = (row.shopName || '').trim()
const skipAsinDeletePolicy = buildSkipAsinDeletePolicy()
const skipAsinCheckPath = `/api/price-track/tasks/${taskVo.taskId}/skip-asin/check`
const resultId = taskItem?.resultId ?? null
const loopRunId = taskItem?.loopRunId ?? null
const roundIndex = taskItem?.roundIndex ?? null
@@ -1024,28 +1027,12 @@ function buildQueuePayload(taskVo: PriceTrackCreateTaskVo, row: PriceTrackShopQu
round_index: roundIndex,
country_codes: resolveCountryCodesForRequest(),
mode: statusModeEnabled.value ? 'status' : 'asin',
// 分页拉取配置Python 端统一处理)
use_paginated_skip_asins: true,
skip_asin_page_size: 1000,
// 移除:不再传递任何 ASIN 数据Python 端统一分页拉取
use_skip_asin_check: statusModeEnabled.value && !asinModeEnabled.value,
skip_asin_check_url: skipAsinCheckPath,
use_paginated_skip_asins: false,
skip_asin_page_size: 0,
skip_asin_delete_policy: skipAsinDeletePolicy,
delete_skip_asin_when_price_below_minimum: skipAsinDeletePolicy.deleteWhenPriceBelowMinimum,
deleteSkipAsinWhenPriceBelowMinimum: skipAsinDeletePolicy.deleteWhenPriceBelowMinimum,
// 兼容字段
taskId: taskVo.taskId,
resultId: resultId,
shopName,
shopId: row.shopId ?? null,
platformName: row.platform || '',
companyName: row.companyName || '',
shopMallName: row.shopMallName || '',
matchStatus: row.matchStatus || '',
matchMessage: row.matchMessage || null,
outputFilename: outputFilename,
downloadUrl: downloadUrl,
taskStatus,
loopRunId: loopRunId,
roundIndex: roundIndex,
delete_skip_asin_when_price_below_minimum: skipAsinDeletePolicy.delete_when_price_below_minimum,
},
}
}