test(p1r): 补齐 AI 与 Knowledge 外部端到端验收

This commit is contained in:
zizi 2026-06-03 14:10:21 +08:00
parent 77e0d9b317
commit 48c750bbd7
7 changed files with 2158 additions and 7 deletions

View File

@ -73,8 +73,8 @@ mybatis-plus:
# id-type: AUTO # 自增 ID适合 MySQL 等直接自增的数据库
# id-type: INPUT # 用户输入 ID适合 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库
# id-type: ASSIGN_ID # 分配 ID默认使用雪花算法。注意Oracle、PostgreSQL、Kingbase、DB2、H2 数据库时,需要去除实体类上的 @KeySequence 注解
logic-delete-value: 1 # 逻辑已删除值(默认为 1)
logic-not-delete-value: 0 # 逻辑未删除值(默认为 0)
logic-delete-value: true # 逻辑已删除值,匹配 PostgreSQL boolean deleted 字段
logic-not-delete-value: false # 逻辑未删除值,匹配 PostgreSQL boolean deleted 字段
banner: false # 关闭控制台的 Banner 打印
type-aliases-package: ${muse.info.base-package}.module.*.dal.dataobject
encryptor:

View File

@ -293,7 +293,7 @@ public class MuseKnowledgeDocumentService {
return new UploadOutcome(ragflowContext, "failed");
}
processingTaskService.markRagflowParseAccepted(ragflowContext.version().getId(), ragflowContext.task().getTaskId(),
uploadResult.externalId(), parseResult);
ragflowContext.ragflowDatasetId(), uploadResult.externalId(), parseResult);
return new UploadOutcome(ragflowContext, "processing");
}

View File

@ -177,13 +177,15 @@ public class MuseKnowledgeProcessingTaskService {
}
@Transactional(propagation = Propagation.REQUIRES_NEW, rollbackFor = Exception.class)
public void markRagflowParseAccepted(Long documentVersionId, String taskId, String ragflowDocumentId,
RagFlowKnowledgeRuntimeClient.RuntimeResult result) {
public void markRagflowParseAccepted(Long documentVersionId, String taskId, String ragflowDatasetId,
String ragflowDocumentId, RagFlowKnowledgeRuntimeClient.RuntimeResult result) {
MuseKnowledgeProcessingTaskDO task = processingTaskMapper.selectByTaskId(taskId);
if (task != null) {
task.setStatus("parsing");
task.setParseStatus("processing");
task.setIndexStatus("pending");
// 新建 dataset 的上传链路必须把外部 datasetId 同步固化到 task后续轮询补偿和 live 取证都依赖这条事实
task.setRagflowDatasetId(ragflowDatasetId);
task.setRagflowDocumentId(ragflowDocumentId);
task.setRetryable(false);
task.setProgressMessage("RAGFlow parse accepted; polling required");

View File

@ -377,6 +377,7 @@ class MuseKnowledgeDocumentServiceTest extends BaseMockitoUnitTest {
&& RagFlowKnowledgeRuntimeClient.Status.ACCEPTED.equals(call.getStatus())));
verify(processingTaskMapper).updateById(org.mockito.ArgumentMatchers.<MuseKnowledgeProcessingTaskDO>argThat(task ->
"parsing".equals(task.getStatus())
&& "rag-dataset-1".equals(task.getRagflowDatasetId())
&& "rag-doc-1".equals(task.getRagflowDocumentId())
&& "processing".equals(task.getResultSummary()) == false));
}

View File

@ -95,8 +95,8 @@ mybatis-plus:
# id-type: AUTO # 自增 ID适合 MySQL 等直接自增的数据库
# id-type: INPUT # 用户输入 ID适合 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库
# id-type: ASSIGN_ID # 分配 ID默认使用雪花算法。注意Oracle、PostgreSQL、Kingbase、DB2、H2 数据库时,需要去除实体类上的 @KeySequence 注解
logic-delete-value: 1 # 逻辑已删除值(默认为 1)
logic-not-delete-value: 0 # 逻辑未删除值(默认为 0)
logic-delete-value: true # 逻辑已删除值,匹配 PostgreSQL boolean deleted 字段
logic-not-delete-value: false # 逻辑未删除值,匹配 PostgreSQL boolean deleted 字段
banner: false # 关闭控制台的 Banner 打印
type-aliases-package: ${muse.info.base-package}.module.*.dal.dataobject
encryptor: