改造后端服务,处理后台管理新增组(部门概念)

This commit is contained in:
super
2026-04-22 00:32:58 +08:00
parent 72c8167472
commit ea35273597

View File

@@ -926,16 +926,38 @@ async function pushToPythonQueueLegacy() {
// ========== 任务状态轮询 ========== // ========== 任务状态轮询 ==========
function buildQueuePayload(taskVo: PriceTrackCreateTaskVo, row: PriceTrackShopQueueItem) { function buildQueuePayload(taskVo: PriceTrackCreateTaskVo, row: PriceTrackShopQueueItem) {
const taskItem = taskVo.items?.[0]
const shopName = (row.shopName || '').trim() const shopName = (row.shopName || '').trim()
const skipAsinsByCountry = row.skipAsins || taskVo.skipAsinsByCountry || {} const skipAsinsByCountry = row.skipAsins || taskVo.skipAsinsByCountry || {}
const resultId = taskItem?.resultId ?? null
const loopRunId = taskItem?.loopRunId ?? null
const roundIndex = taskItem?.roundIndex ?? null
const taskStatus = taskItem?.taskStatus || 'RUNNING'
const success = taskItem?.success ?? false
const error = taskItem?.error || null
const outputFilename = taskItem?.outputFilename || null
const downloadUrl = taskItem?.downloadUrl || null
return { return {
type: 'price-track-run', type: 'price-track-run',
ts: Date.now(), ts: Date.now(),
data: { data: {
task_id: taskVo.taskId, task_id: taskVo.taskId,
result_id: resultId,
shop_name: shopName, shop_name: shopName,
shop_id: row.shopId ?? null, shop_id: row.shopId ?? null,
platform: row.platform || '',
company_name: row.companyName || '',
shop_mall_name: row.shopMallName || '', shop_mall_name: row.shopMallName || '',
matched: !!row.matched,
match_status: row.matchStatus || '',
match_message: row.matchMessage || null,
success: success,
error: error,
output_filename: outputFilename,
download_url: downloadUrl,
task_status: taskStatus,
loop_run_id: loopRunId,
round_index: roundIndex,
country_codes: [...orderedCountryCodes.value], country_codes: [...orderedCountryCodes.value],
mode: statusModeEnabled.value ? 'status' : 'asin', mode: statusModeEnabled.value ? 'status' : 'asin',
skip_asins: skipAsinsByCountry, skip_asins: skipAsinsByCountry,
@@ -943,6 +965,20 @@ function buildQueuePayload(taskVo: PriceTrackCreateTaskVo, row: PriceTrackShopQu
asin_rows_by_country: Object.keys(matchAsinRowsByCountry.value).length asin_rows_by_country: Object.keys(matchAsinRowsByCountry.value).length
? matchAsinRowsByCountry.value ? matchAsinRowsByCountry.value
: (taskVo.asinRowsByCountry || {}), : (taskVo.asinRowsByCountry || {}),
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,
}, },
} }
} }