改造后端服务,处理后台管理新增组(部门概念)
This commit is contained in:
@@ -926,16 +926,38 @@ async function pushToPythonQueueLegacy() {
|
||||
|
||||
// ========== 任务状态轮询 ==========
|
||||
function buildQueuePayload(taskVo: PriceTrackCreateTaskVo, row: PriceTrackShopQueueItem) {
|
||||
const taskItem = taskVo.items?.[0]
|
||||
const shopName = (row.shopName || '').trim()
|
||||
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 {
|
||||
type: 'price-track-run',
|
||||
ts: Date.now(),
|
||||
data: {
|
||||
task_id: taskVo.taskId,
|
||||
result_id: resultId,
|
||||
shop_name: shopName,
|
||||
shop_id: row.shopId ?? null,
|
||||
platform: row.platform || '',
|
||||
company_name: row.companyName || '',
|
||||
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],
|
||||
mode: statusModeEnabled.value ? 'status' : 'asin',
|
||||
skip_asins: skipAsinsByCountry,
|
||||
@@ -943,6 +965,20 @@ function buildQueuePayload(taskVo: PriceTrackCreateTaskVo, row: PriceTrackShopQu
|
||||
asin_rows_by_country: Object.keys(matchAsinRowsByCountry.value).length
|
||||
? matchAsinRowsByCountry.value
|
||||
: (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,
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user