fix(外观专利/品牌任务): 判死任务不再显示"结果生成中",批次心跳与进度取大写入防误杀
29473/29479 心跳超时判死后,前端 statusText/statusClass 先判 isResultPreparing 再看 FAILED,用户看到的是"结果生成中",会以为任务还在跑而继续等(后台检测可能确实还在跑、 文件生成后下载按钮照常出现,但文案必须是失败)。改成 FAILED 一律优先判定, pendingResultHint 也随之切成"任务已失败,结果文件…"。 后端两处心跳:外观专利 LLM 每批 touchJavaSideTaskActivity —— 软恢复后的检测阶段可达 数小时,不刷会被通用兜底线的 updated_at 超 120 分钟误杀;品牌进度改走 Redis Lua 合并 写入,phase 不被 crawling 打回(assembling/uploading/failed 受保护)、 current_line/total_lines 只增不减,消掉多执行方互相覆盖。
This commit is contained in:
@@ -803,9 +803,11 @@ function statusText(item: AppearancePatentHistoryItem) {
|
||||
const status = normalizeTaskStatus(item)
|
||||
if (status === 'RUNNING') return '执行中'
|
||||
if (status === 'PENDING') return '已解析待启动'
|
||||
// 已判死(含心跳超时)的任务始终显示失败:后台检测可能仍在跑、文件生成后下载按钮会自动出现,
|
||||
// 但状态文案不能是"结果生成中",否则用户会以为任务还在执行(2026-09-28 29473/29479)
|
||||
if (status === 'FAILED') return isResultBuildFailed(item) ? '结果生成失败' : '失败'
|
||||
if (isResultPreparing(item)) return '结果生成中'
|
||||
if (isResultBuildFailed(item)) return '结果生成失败'
|
||||
if (status === 'FAILED') return '失败'
|
||||
if (hasDownloadableResult(item)) return '已完成'
|
||||
if (status === 'SUCCESS' || item.success) return '已完成'
|
||||
return '等待中'
|
||||
@@ -813,8 +815,8 @@ function statusText(item: AppearancePatentHistoryItem) {
|
||||
|
||||
function statusClass(item: AppearancePatentHistoryItem) {
|
||||
const status = normalizeTaskStatus(item)
|
||||
if (status === 'FAILED' || isResultBuildFailed(item)) return 'failed'
|
||||
if (status === 'RUNNING' || isResultPreparing(item)) return 'running'
|
||||
if (isResultBuildFailed(item) || status === 'FAILED') return 'failed'
|
||||
if (hasDownloadableResult(item)) return 'success'
|
||||
if (status === 'SUCCESS' || item.success) return 'success'
|
||||
return 'pending'
|
||||
@@ -845,14 +847,12 @@ function pendingResultHint(item: AppearancePatentHistoryItem) {
|
||||
return ''
|
||||
}
|
||||
if (!isResultPreparing(item)) return ''
|
||||
const doneLabel = normalizeTaskStatus(item) === 'FAILED' ? '任务已失败' : '任务已完成'
|
||||
const fileStatus = (item.fileStatus || '').toUpperCase()
|
||||
if (fileStatus === 'RUNNING') {
|
||||
return '任务已完成,正在生成结果文件,下载按钮稍后出现'
|
||||
}
|
||||
if (fileStatus === 'PENDING') {
|
||||
return '任务已完成,结果文件排队中,请稍候'
|
||||
return `${doneLabel},结果文件排队中,请稍候`
|
||||
}
|
||||
return '任务已完成,正在生成结果文件,下载按钮稍后出现'
|
||||
return `${doneLabel},正在生成结果文件,下载按钮稍后出现`
|
||||
}
|
||||
|
||||
function canDownload(item: AppearancePatentHistoryItem) {
|
||||
|
||||
@@ -45,14 +45,14 @@ export interface BrandTaskListResponse {
|
||||
error?: string
|
||||
}
|
||||
|
||||
/** Java 详情接口返回的行级进度(Redis 实时进度,每提交一个分片推进 current_line) */
|
||||
/** Java 详情接口返回的行级进度(Redis 实时进度,由执行方心跳按任务级品牌数推进) */
|
||||
export interface BrandLineProgressInfo {
|
||||
file_index?: number
|
||||
file_total?: number
|
||||
file_name?: string
|
||||
/** 已处理行/品牌数 */
|
||||
/** 任务级已处理品牌数(只增不减) */
|
||||
current_line?: number
|
||||
/** 总行/品牌数 */
|
||||
/** 任务级品牌总数 */
|
||||
total_lines?: number
|
||||
/** crawling / assembling / uploading / failed */
|
||||
phase?: string
|
||||
|
||||
Reference in New Issue
Block a user