task-98: 移除 similar-asin/appearance-patent 模块 Coze,状态机与共享组件改名 LLM
Build Backend JAR / build (push) Has been cancelled
Build Backend JAR / build (push) Has been cancelled
- similarasin/appearancepatent 模块全部 Coze 工作流调用改走 direct-LLM(已确认唯一运行路径) - 共享组件改名:CozeTaskQueueGate→TaskQueueGate、CozeGroupResultPropagator→GroupResultPropagator - 状态机改名:biz_task_scope_state 的 coze_* 列→llm_*、stateJson coze 键→llm(V100 迁移已应用生产) - 删除 biz_coze_credential 表、CozeCredential* 类、SimilarAsinCozeClient、AppearancePatentCozeClient→LlmClient - 前端 brand 页 Coze 文案→LLM;Python 后端删除 cozepy 依赖与死配置 - 修复 TaskResultFileJobWorker 启动失败:TaskFileJobConfig 注册 ResultFileJobHandlerRegistry 与 13 个 handler bean(含 validateCoverage 启动校验)
This commit is contained in:
@@ -201,7 +201,7 @@ const secretConfigs: Array<{ key: ApiSecretModuleKey; title: string; description
|
||||
key: 'appearance-patent',
|
||||
title: '外观专利密钥',
|
||||
description: '仅用于外观专利检测。',
|
||||
placeholder: '请输入 Coze 接口密钥',
|
||||
placeholder: '请输入 LLM 接口密钥',
|
||||
},
|
||||
{
|
||||
key: 'appearance-patent-token',
|
||||
@@ -213,7 +213,7 @@ const secretConfigs: Array<{ key: ApiSecretModuleKey; title: string; description
|
||||
key: 'similar-asin',
|
||||
title: '货源查询密钥',
|
||||
description: '仅用于货源查询。',
|
||||
placeholder: '请输入 Coze 接口密钥',
|
||||
placeholder: '请输入 LLM 接口密钥',
|
||||
},
|
||||
]
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
|
||||
<div class="prompt-card">
|
||||
<div class="section-title">新增条件要求</div>
|
||||
<textarea v-model="aiPrompt" class="prompt-input" rows="8" placeholder="可选,留空则不向 Coze 传 prompt 字段;填写后将作为 prompt 透传" />
|
||||
<textarea v-model="aiPrompt" class="prompt-input" rows="8" placeholder="可选,留空则不向 LLM 传 prompt 字段;填写后将作为 prompt 透传" />
|
||||
</div>
|
||||
|
||||
<div class="run-row">
|
||||
@@ -30,7 +30,7 @@
|
||||
{{ pushing ? '推送中...' : '推送到 Python 队列' }}
|
||||
</button>
|
||||
</div>
|
||||
<p class="loading-msg">Python 回传字段按 asin、国家、url、标题提交;后端接收分片后累计 50 条调用 Coze,当前任务区展示 Coze 回流和结果组装进度。</p>
|
||||
<p class="loading-msg">Python 回传字段按 asin、国家、url、标题提交;后端接收分片后累计 50 条调用 LLM,当前任务区展示 LLM 回流和结果组装进度。</p>
|
||||
|
||||
<div v-if="visibleTaskSummary" class="parse-card">
|
||||
<div>任务 ID:{{ visibleTaskSummary.taskId }}</div>
|
||||
@@ -170,7 +170,7 @@ const uploadedFiles = ref<UploadFileVo[]>([])
|
||||
const parseResult = ref<AppearancePatentParseVo | null>(null)
|
||||
type TaskSummary = Pick<AppearancePatentParseVo, 'taskId' | 'totalRows' | 'acceptedRows' | 'groupCount' | 'droppedRows'>
|
||||
const queuedTaskSummary = ref<TaskSummary | null>(null)
|
||||
// 不再注入默认 prompt:用户未填则一律空字符串,由后端决定是否给 Coze 透传 prompt 字段。
|
||||
// 不再注入默认 prompt:用户未填则一律空字符串,由后端决定是否给 LLM 透传 prompt 字段。
|
||||
const aiPrompt = ref('')
|
||||
const parsing = ref(false)
|
||||
const pushing = ref(false)
|
||||
@@ -259,7 +259,7 @@ function queueAiPrompt() {
|
||||
return aiPrompt.value.trim()
|
||||
}
|
||||
|
||||
function effectiveCozeApiKey() {
|
||||
function effectiveLlmApiKey() {
|
||||
return getStoredApiSecret('appearance-patent').trim()
|
||||
}
|
||||
|
||||
@@ -402,7 +402,7 @@ async function parseFiles() {
|
||||
ElMessage.warning('请先选择 Excel')
|
||||
return
|
||||
}
|
||||
if (!effectiveCozeApiKey()) {
|
||||
if (!effectiveLlmApiKey()) {
|
||||
ElMessage.warning('请先在左上角设置中填写外观专利密钥')
|
||||
return
|
||||
}
|
||||
@@ -413,7 +413,7 @@ async function parseFiles() {
|
||||
originalFilename: f.originalFilename,
|
||||
relativePath: f.relativePath,
|
||||
}))
|
||||
const res = await parseAppearancePatent(files, effectiveAiPrompt(), effectiveCozeApiKey(), effectivePatentToken())
|
||||
const res = await parseAppearancePatent(files, effectiveAiPrompt(), effectiveLlmApiKey(), effectivePatentToken())
|
||||
parseResult.value = res
|
||||
queuedTaskSummary.value = null
|
||||
queuePayloadText.value = ''
|
||||
@@ -437,7 +437,7 @@ async function pushToPythonQueue() {
|
||||
ElMessage.error('当前环境未启用 pywebview enqueue_json')
|
||||
return
|
||||
}
|
||||
if (!effectiveCozeApiKey()) {
|
||||
if (!effectiveLlmApiKey()) {
|
||||
ElMessage.warning('请先在左上角设置中填写外观专利密钥')
|
||||
return
|
||||
}
|
||||
@@ -451,7 +451,7 @@ async function pushToPythonQueue() {
|
||||
data: {
|
||||
taskId,
|
||||
prompt: queueAiPrompt(),
|
||||
api_key: effectiveCozeApiKey(),
|
||||
api_key: effectiveLlmApiKey(),
|
||||
patent_token: effectivePatentToken(),
|
||||
sourceFileCount: currentParseResult.sourceFileCount || 0,
|
||||
totalRows: currentParseResult.totalRows || 0,
|
||||
@@ -811,7 +811,7 @@ function pendingResultHint(item: AppearancePatentHistoryItem) {
|
||||
if (!isResultPreparing(item)) return ''
|
||||
const fileStatus = (item.fileStatus || '').toUpperCase()
|
||||
if (fileStatus === 'RUNNING') {
|
||||
return '任务已完成,正在等待 Coze 回流并组装结果文件,下载按钮稍后出现'
|
||||
return '任务已完成,正在等待 LLM 回流并组装结果文件,下载按钮稍后出现'
|
||||
}
|
||||
if (fileStatus === 'PENDING') {
|
||||
return '任务已完成,结果文件已入队,正在等待后端开始处理'
|
||||
@@ -845,20 +845,20 @@ function displayFileProgressMessage(item: AppearancePatentHistoryItem, fallback:
|
||||
}
|
||||
|
||||
function translateFileProgressMessage(message: string) {
|
||||
const submittedMatch = message.match(/^Coze submitted (\d+) batches, completed (\d+), waiting for results$/)
|
||||
const submittedMatch = message.match(/^LLM submitted (\d+) batches, completed (\d+), waiting for results$/)
|
||||
if (submittedMatch) {
|
||||
return `已提交 Coze ${submittedMatch[1]} 批,已完成 ${submittedMatch[2]} 批,等待结果回流`
|
||||
return `已提交 LLM ${submittedMatch[1]} 批,已完成 ${submittedMatch[2]} 批,等待结果回流`
|
||||
}
|
||||
const completedMatch = message.match(/^Coze completed (\d+) batches, waiting for remaining Python data$/)
|
||||
const completedMatch = message.match(/^LLM completed (\d+) batches, waiting for remaining Python data$/)
|
||||
if (completedMatch) {
|
||||
return `Coze 已完成 ${completedMatch[1]} 批,等待 Python 继续回传数据`
|
||||
return `LLM 已完成 ${completedMatch[1]} 批,等待 Python 继续回传数据`
|
||||
}
|
||||
const translations: Record<string, string> = {
|
||||
'Receiving Python data, waiting for 50 rows before Coze': '正在接收 Python 数据,累计 50 条后提交 Coze',
|
||||
'Submitting Coze': '正在提交 Coze',
|
||||
'Coze submitted, waiting for result': 'Coze 已提交,等待结果回流',
|
||||
'Receiving Python data, waiting for 50 rows before LLM': '正在接收 Python 数据,累计 50 条后提交 LLM',
|
||||
'Submitting LLM': '正在提交 LLM',
|
||||
'LLM submitted, waiting for result': 'LLM 已提交,等待结果回流',
|
||||
'Waiting for Python upload': '等待 Python 继续回传数据',
|
||||
'Coze results ready, assembling xlsx': 'Coze 结果已回流,正在组装 xlsx',
|
||||
'LLM results ready, assembling xlsx': 'LLM 结果已回流,正在组装 xlsx',
|
||||
'Assembling xlsx': '正在组装 xlsx',
|
||||
'Uploading result file': '正在上传结果文件',
|
||||
'Result file generated': '结果文件已生成',
|
||||
|
||||
@@ -68,7 +68,7 @@
|
||||
{{ pushing ? '推送中...' : '推送到 Python 队列' }}
|
||||
</button>
|
||||
</div>
|
||||
<p class="loading-msg">Python 回传字段按 id、asin、国家、价格、标题、图片链接数组提交;后端接收分片后按 10 条一批送检,结果区展示真实 Coze 批次进度。</p>
|
||||
<p class="loading-msg">Python 回传字段按 id、asin、国家、价格、标题、图片链接数组提交;后端接收分片后按 10 条一批送检,结果区展示真实 LLM 批次进度。</p>
|
||||
|
||||
<div v-if="visibleTaskSummary" class="parse-card">
|
||||
<div>任务 ID:{{ visibleTaskSummary.taskId }}</div>
|
||||
@@ -307,7 +307,7 @@ function mergeCurrentTaskItem(item: SimilarAsinHistoryItem) {
|
||||
}
|
||||
}
|
||||
|
||||
function effectiveCozeApiKey() {
|
||||
function effectiveLlmApiKey() {
|
||||
return getStoredApiSecret('similar-asin').trim()
|
||||
}
|
||||
|
||||
@@ -460,7 +460,7 @@ async function parseFiles() {
|
||||
ElMessage.warning('请先选择 Excel')
|
||||
return
|
||||
}
|
||||
if (!effectiveCozeApiKey()) {
|
||||
if (!effectiveLlmApiKey()) {
|
||||
ElMessage.warning('请先在左上角设置中填写货源查询密钥')
|
||||
return
|
||||
}
|
||||
@@ -472,7 +472,7 @@ async function parseFiles() {
|
||||
originalFilename: f.originalFilename,
|
||||
relativePath: f.relativePath,
|
||||
}))
|
||||
const res = await parseSimilarAsin(files, effectiveCozeApiKey(), imgSwitch.value, categorySwitch.value)
|
||||
const res = await parseSimilarAsin(files, effectiveLlmApiKey(), imgSwitch.value, categorySwitch.value)
|
||||
// 只保留摘要字段与有界预览行,避免数千行 items/groups 进入响应式对象
|
||||
const previewOptions: ParsePreviewOptions = { previewRowLimit: 200 }
|
||||
parseResult.value = toParsePreview(res, previewOptions) as unknown as SimilarAsinParseVo
|
||||
@@ -499,7 +499,7 @@ async function pushToPythonQueue() {
|
||||
ElMessage.error('当前环境未启用 pywebview enqueue_json')
|
||||
return
|
||||
}
|
||||
if (!effectiveCozeApiKey()) {
|
||||
if (!effectiveLlmApiKey()) {
|
||||
ElMessage.warning('请先在左上角设置中填写货源查询密钥')
|
||||
return
|
||||
}
|
||||
@@ -540,7 +540,7 @@ async function pushToPythonQueue() {
|
||||
data: {
|
||||
taskId,
|
||||
user_id: currentUserId(),
|
||||
api_key: effectiveCozeApiKey(),
|
||||
api_key: effectiveLlmApiKey(),
|
||||
sourceFileCount: currentParseResult.sourceFileCount || 0,
|
||||
totalRows: currentParseResult.totalRows || 0,
|
||||
acceptedRows: currentParseResult.acceptedRows || 0,
|
||||
@@ -926,7 +926,7 @@ function pendingResultHint(item: SimilarAsinHistoryItem) {
|
||||
if (!isResultPreparing(item)) return ''
|
||||
const fileStatus = (item.fileStatus || '').toUpperCase()
|
||||
if (fileStatus === 'RUNNING') {
|
||||
return '任务已完成,正在等待 Coze 回流并组装结果文件,下载按钮稍后出现'
|
||||
return '任务已完成,正在等待 LLM 回流并组装结果文件,下载按钮稍后出现'
|
||||
}
|
||||
if (fileStatus === 'PENDING') {
|
||||
return '任务已完成,结果文件已入队,正在等待后端开始处理'
|
||||
@@ -961,13 +961,13 @@ function fileProgressPercent(item: SimilarAsinHistoryItem) {
|
||||
function displayFileProgressStage(item: SimilarAsinHistoryItem, fallback: string) {
|
||||
const message = (item.fileProgressMessage || '').trim()
|
||||
if (!message) return fallback
|
||||
if (/coze/i.test(message) || /Coze|回流/.test(message)) {
|
||||
if (/submitting/i.test(message) || /提交/.test(message)) return '正在提交 Coze 批次'
|
||||
if (/生成结果|结果文件|组装/i.test(message)) return 'Coze 已回流,正在生成结果文件'
|
||||
if (/llm/i.test(message) || /LLM|回流/.test(message)) {
|
||||
if (/submitting/i.test(message) || /提交/.test(message)) return '正在提交 LLM 批次'
|
||||
if (/生成结果|结果文件|组装/i.test(message)) return 'LLM 已回流,正在生成结果文件'
|
||||
if (/waiting/i.test(message) || /等待/.test(message) || /\d+\s*\/\s*\d+/.test(message)) {
|
||||
return 'Coze 回流中,等待结果回传'
|
||||
return 'LLM 回流中,等待结果回传'
|
||||
}
|
||||
return 'Coze 处理中'
|
||||
return 'LLM 处理中'
|
||||
}
|
||||
if (/assembling|xlsx|组装|生成结果/i.test(message)) return '正在组装结果文件'
|
||||
return message
|
||||
@@ -978,11 +978,11 @@ function fileProgressCountLabel(item: SimilarAsinHistoryItem) {
|
||||
const parsed = parseProgressCountFromMessage(message)
|
||||
const current = parsed?.current ?? item.fileProgressCurrent ?? 0
|
||||
const total = parsed?.total ?? item.fileProgressTotal ?? 0
|
||||
if (/coze/i.test(message) || /Coze|回流/.test(message)) {
|
||||
if (/llm/i.test(message) || /LLM|回流/.test(message)) {
|
||||
if (/submitting/i.test(message) || /提交/.test(message)) {
|
||||
return `Coze 提交批次 ${current}/${total}`
|
||||
return `LLM 提交批次 ${current}/${total}`
|
||||
}
|
||||
return `Coze 回流批次 ${current}/${total}`
|
||||
return `LLM 回流批次 ${current}/${total}`
|
||||
}
|
||||
return `当前阶段 ${current}/${total}`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user