feat: 优化会议状态解析和章节边界识别逻辑

- 在 `MeetingUnifiedStatusServiceImpl` 中添加 `MeetingUnifiedStageContext` 参数,优化阶段解析逻辑
- 在 `MeetingTranscriptChapterServiceImpl` 中更新章节边界识别的系统提示,使其更清晰
- 在 `AiTaskServiceImpl` 和 `MeetingProgressServiceImpl` 中增加对 AI 目录启用状态的检查,优化任务调度逻辑
dev_na
chenhao 2026-06-26 11:09:52 +08:00
parent a036c14673
commit 033ffaacc9
4 changed files with 54 additions and 31 deletions

View File

@ -1121,7 +1121,7 @@ public class AiTaskServiceImpl extends ServiceImpl<AiTaskMapper, AiTask> impleme
meetingPointsService.recordSummarySuccessCharge(meeting, taskRecord);
AiTask latestChapterTask = findLatestTask(meeting.getId(), "CHAPTER");
if (latestChapterTask != null && Integer.valueOf(2).equals(latestChapterTask.getStatus())) {
if (!resolveAiCatalogEnabled() ||(latestChapterTask != null && Integer.valueOf(2).equals(latestChapterTask.getStatus()))) {
updateProgress(meeting.getId(), 100, "全流程分析完成", 0);
} else {
updateProgress(meeting.getId(), 95, "总结生成完成,等待 AI 目录完成...", 0);
@ -1369,7 +1369,7 @@ public class AiTaskServiceImpl extends ServiceImpl<AiTaskMapper, AiTask> impleme
updateMeetingStatus(meetingId, 4);
return;
}
if (isTaskCompleted(chapterTask) && isTaskCompleted(summaryTask)) {
if ( isTaskCompleted(summaryTask) && (!resolveAiCatalogEnabled() || isTaskCompleted(chapterTask))) {
updateMeetingStatus(meetingId, 3);
return;
}

View File

@ -241,6 +241,14 @@ public class MeetingProgressServiceImpl implements MeetingProgressService {
if (latestChapter != null && Integer.valueOf(1).equals(latestChapter.getStatus())) {
return buildSnapshot(meetingId, latestChapter, meeting.getStatus(), MeetingProgressStage.CHAPTER_RUNNING, 85, "正在生成会议章节...", 0);
}
if (MeetingStatusEnum.isCode(meeting.getStatus(), MeetingStatusEnum.SUMMARIZING)) {
if (latestSummary != null && Integer.valueOf(2).equals(latestSummary.getStatus())) {
return buildSnapshot(meetingId, latestSummary, meeting.getStatus(), MeetingProgressStage.SUMMARY_RUNNING, 90, "正在生成会议总结...", 0);
}
if (latestChapter != null && Integer.valueOf(0).equals(latestChapter.getStatus())) {
return buildSnapshot(meetingId, latestChapter, meeting.getStatus(), MeetingProgressStage.CHAPTER_RUNNING, 85, "正在生成会议章节...", 0);
}
}
AiTask latestAsr = findLatestTask(meetingId, "ASR");
if (latestAsr != null) {
if (Integer.valueOf(1).equals(latestAsr.getStatus())) {

View File

@ -369,28 +369,29 @@ public class MeetingTranscriptChapterServiceImpl implements MeetingTranscriptCha
private String buildChapterSystemPrompt() {
return """
JSON
chapters
JSONchapters ,
chapterNo,title,summary,keywords,startTranscriptId,endTranscriptId,confidence
transcript
- startTranscriptId transcriptId
- startTranscriptId endTranscriptId + 1
- transcript
- transcript
- transcript
-
-
transcript .
transcript
JSON
{
"chapters": [
{
"chapterNo": number,
"title": string,
"summary": string,
"keywords": [string],
"startTranscriptId": number,
"endTranscriptId": number,
"confidence": number
}
]
}
1.
2. transcript
3.
4. title
5. JSON
""";
}
@ -1017,9 +1018,9 @@ public class MeetingTranscriptChapterServiceImpl implements MeetingTranscriptCha
Long startTranscriptId = longValue(item.path("startTranscriptId").asText(null));
Long endTranscriptId = longValue(item.path("endTranscriptId").asText(null));
Integer chapterNo = item.path("chapterNo").isInt() ? item.path("chapterNo").asInt() : null;
if (chapterNo == null || startTranscriptId == null || endTranscriptId == null) {
throw new RuntimeException("章节模型返回了不完整的章节边界");
}
// if (chapterNo == null || startTranscriptId == null || endTranscriptId == null) {
// throw new RuntimeException("章节模型返回了不完整的章节边界");
// }
List<String> keywords = new ArrayList<>();
if (item.path("keywords").isArray()) {
for (JsonNode keyword : item.path("keywords")) {

View File

@ -90,12 +90,12 @@ public class MeetingUnifiedStatusServiceImpl implements MeetingUnifiedStatusServ
if (isAndroidOfflineMeetingWaitingUpload(meeting)) {
return UnifiedMeetingStatusStage.WAITING_UPLOAD;
}
UnifiedMeetingStatusStage stageFromSnapshot = resolveStageFromSnapshot(snapshot);
MeetingUnifiedStageContext context = buildStageContext(meeting.getId(), snapshot);
UnifiedMeetingStatusStage stageFromSnapshot = resolveStageFromSnapshot(snapshot, context);
if (stageFromSnapshot != null) {
return stageFromSnapshot;
}
MeetingUnifiedStageContext context = buildStageContext(meeting.getId(), snapshot);
if (isTranscribing(context)) {
return UnifiedMeetingStatusStage.TRANSCRIBING;
}
@ -106,7 +106,8 @@ public class MeetingUnifiedStatusServiceImpl implements MeetingUnifiedStatusServ
return UnifiedMeetingStatusStage.INITIALIZING;
}
private UnifiedMeetingStatusStage resolveStageFromSnapshot(MeetingProgressSnapshot snapshot) {
private UnifiedMeetingStatusStage resolveStageFromSnapshot(MeetingProgressSnapshot snapshot,
MeetingUnifiedStageContext context) {
if (snapshot == null || snapshot.getStage() == null || snapshot.getStage().isBlank()) {
return null;
}
@ -115,11 +116,24 @@ public class MeetingUnifiedStatusServiceImpl implements MeetingUnifiedStatusServ
case "completed" -> UnifiedMeetingStatusStage.COMPLETED;
case "summary_running", "chapter_running" -> UnifiedMeetingStatusStage.SUMMARIZING;
case "asr_running", "asr_completed", "asr_submitted" -> UnifiedMeetingStatusStage.TRANSCRIBING;
case "queued" -> UnifiedMeetingStatusStage.INITIALIZING;
case "queued" -> resolveQueuedSnapshotStage(context);
default -> null;
};
}
private UnifiedMeetingStatusStage resolveQueuedSnapshotStage(MeetingUnifiedStageContext context) {
if (context == null) {
return UnifiedMeetingStatusStage.INITIALIZING;
}
if (isSummarizing(context)) {
return UnifiedMeetingStatusStage.SUMMARIZING;
}
if (isTranscribing(context)) {
return UnifiedMeetingStatusStage.TRANSCRIBING;
}
return UnifiedMeetingStatusStage.INITIALIZING;
}
private UnifiedMeetingStatusStage resolveFailedStage(MeetingVO meeting) {
if (meeting == null || !MeetingStatusEnum.isCode(meeting.getStatus(), MeetingStatusEnum.FAILED)) {
return null;