Merge branch 'refs/heads/dev_na' into dev_asr_local

dev_na
chenhao 2026-06-26 11:10:37 +08:00
commit ba62c9e0c0
16 changed files with 313 additions and 155 deletions

View File

@ -36,4 +36,16 @@ public class MeetingAsyncExecutorConfig {
executor.initialize();
return executor;
}
@Bean("chunkMergeExecutor")
public Executor chunkMergeExecutor() {
ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
executor.setCorePoolSize(2);
executor.setMaxPoolSize(4);
executor.setQueueCapacity(10);
executor.setThreadNamePrefix("imeeting-chunk-merge-");
executor.setRejectedExecutionHandler(new ThreadPoolExecutor.CallerRunsPolicy());
executor.initialize();
return executor;
}
}

View File

@ -71,6 +71,7 @@ public class AndroidMeetingChunkUploadController {
"meetingId", meetingId,
"totalChunks", totalChunks);
AndroidAuthContext authContext = androidAuthService.authenticateHttp(request);
return ApiResponse.ok(androidChunkUploadService.completeUpload(meetingId, totalChunks, authContext));
androidChunkUploadService.completeUploadAsync(meetingId, totalChunks, authContext);
return ApiResponse.ok(new LegacyUploadAudioResponse(meetingId, null, "后台合并上传中"));
}
}

View File

@ -56,6 +56,7 @@ import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.util.StopWatch;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
@ -79,6 +80,7 @@ import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.concurrent.CompletableFuture;
import java.util.stream.Collectors;
@Tag(name = "Android会议接口")
@ -238,22 +240,24 @@ public class AndroidMeetingController {
AndroidRequestLogHelper.logRequest(log, "Android会议", "结束离线会议录音阶段",
"meetingId", meetingId,
"request", command);
AndroidAuthContext authContext = androidAuthService.authenticateHttpIgnoreToken(request,true);
AndroidAuthContext authContext = androidAuthService.authenticateHttpIgnoreToken(request, true);
LoginUser loginUser = authContext.isAnonymous() ? null : AndroidLoginUserSupport.requireLoginUser(authContext);
MeetingVO meeting = requireOperableOfflineMeeting(meetingId, authContext, loginUser);
LegacyUploadAudioResponse uploadResult = null;
requireOperableOfflineMeeting(meetingId, authContext, loginUser);
MeetingVO meeting = meetingQueryService.getDetailIgnoreTenant(meetingId);
LegacyUploadAudioResponse uploadResult = new LegacyUploadAudioResponse();
if (isUploadFinishedStage(command)) {
uploadResult = androidChunkUploadService.completeUpload(
androidChunkUploadService.completeUploadAsync(
meeting.getId(),
command == null ? null : command.getTotalChunks(),
command.getTotalChunks(),
authContext
);
if (uploadResult == null) {
throw new RuntimeException("分片上传完成后未生成结果");
}
// if (uploadResult == null) {
// throw new RuntimeException("分片上传完成后未生成结果");
// }
uploadResult.setMeetingId(meetingId);
}
meetingCommandService.finishOfflineMeeting(meeting.getId(), command == null ? null : command.getFinishStage());
return ApiResponse.ok(uploadResult != null ? uploadResult : true);
return ApiResponse.ok(uploadResult);
}
@Operation(summary = "分页查询Android会议")
@ -310,12 +314,13 @@ public class AndroidMeetingController {
"request", command);
AndroidAuthContext authContext = androidAuthService.authenticateHttp(request);
LoginUser loginUser = authContext.isAnonymous() ? null : AndroidLoginUserSupport.requireLoginUser(authContext);
MeetingVO meeting = requireOperableOfflineMeeting(meetingId, authContext, loginUser);
requireOperableOfflineMeeting(meetingId, authContext, loginUser);
MeetingVO meeting = meetingQueryService.getDetailIgnoreTenant(meetingId,false);
UnifiedMeetingStatusVO status = meetingUnifiedStatusService.resolve(meetingId);
boolean includeTranscript = Boolean.TRUE.equals(command == null ? null : command.getIncludeTranscript());
boolean includeSummary = Boolean.TRUE.equals(command == null ? null : command.getIncludeSummary());
List<MeetingTranscriptVO> transcripts = includeTranscript ? meetingQueryService.getTranscripts(meetingId) : null;
String summaryContent = includeSummary ? meetingQueryService.getDetailIgnoreTenant(meetingId).getSummaryContent() : null;
String summaryContent = includeSummary ? meeting.getSummaryContent() : null;
AndroidUnifiedMeetingStatusResponse build = AndroidUnifiedMeetingStatusResponse.builder()
.meetingId(meetingId)
.status(status)
@ -325,7 +330,7 @@ public class AndroidMeetingController {
.includesSummary(includeSummary)
.summaryContent(summaryContent)
.build();
log.info("[{}]{}.返回数据:[{}]","Android会议","查询会议统一状态",build);
log.info("[{}]{}.返回数据:[{}]", "Android会议", "查询会议统一状态", build);
return ApiResponse.ok(build);
}
@ -369,6 +374,7 @@ public class AndroidMeetingController {
androidMeetingPushService.pushMeetingStatusChanged(meetingId, UnifiedMeetingStatusStage.SUMMARIZING.getCode());
return ApiResponse.ok(true);
}
@Operation(summary = "更新Android会议访问密码")
@ApiResponses({
@io.swagger.v3.oas.annotations.responses.ApiResponse(
@ -393,7 +399,7 @@ public class AndroidMeetingController {
}
String password = normalizePassword(command == null ? null : command.getPassword());
meetingService.update(new LambdaUpdateWrapper<Meeting>()
.eq(Meeting::getId,meeting.getId())
.eq(Meeting::getId, meeting.getId())
.set(Meeting::getAccessPassword, password));
return ApiResponse.ok(password);
}
@ -417,6 +423,7 @@ public class AndroidMeetingController {
meetingCommandService.deleteMeeting(meetingId);
return ApiResponse.ok(true);
}
@GetMapping("/config")
@Log(value = "获取会议配置", type = "Android会议管理")
@Operation(summary = "获取会议配置")
@ -454,12 +461,12 @@ public class AndroidMeetingController {
.toList();
resultVo.setModelsList(enabledModels);
resultVo.setSummaryDegreeOfDetail(dictItemService.getItemsByTypeCode("summary_degree_detail"));
resultVo.setMaxMeetingDuration(Integer.valueOf(paramService.getParamValue(SysParamKeys.MEETING_MAX_MEETING_DURATION,"30")));
resultVo.setMaxMeetingDuration(Integer.valueOf(paramService.getParamValue(SysParamKeys.MEETING_MAX_MEETING_DURATION, "30")));
resultVo.setMinMeetingDuration(Integer.valueOf(paramService.getParamValue(SysParamKeys.MEETING_MIN_MEETING_DURATION, "10")));
resultVo.setMaxPauseDuration(Integer.valueOf(paramService.getParamValue(SysParamKeys.MEETING_MAX_PAUSE_DURATION,String.valueOf(60*4))));
resultVo.setMaxPauseDuration(Integer.valueOf(paramService.getParamValue(SysParamKeys.MEETING_MAX_PAUSE_DURATION, String.valueOf(60 * 4))));
BigDecimal bigDecimal = new BigDecimal(paramService.getParamValue(SysParamKeys.MEETING_MAX_PAUSE_DURATION, "99"));
bigDecimal = bigDecimal.setScale(2, RoundingMode.HALF_UP);
resultVo.setPacketLossRate(bigDecimal );
resultVo.setPacketLossRate(bigDecimal);
resultVo.setChunkUploadEnabled(Boolean.parseBoolean(paramService.getParamValue(SysParamKeys.MEETING_ANDROID_AUDIO_CHUNK_UPLOAD_ENABLED, "false")));
resultVo.setChunkDurationSeconds(Integer.valueOf(paramService.getParamValue(SysParamKeys.MEETING_ANDROID_AUDIO_CHUNK_DURATION_SECONDS, "60")));
@ -547,29 +554,14 @@ public class AndroidMeetingController {
return ChronoUnit.DAYS.between(LocalDate.now(), meetingTime.toLocalDate());
}
private MeetingVO requireOperableOfflineMeeting(Long meetingId, AndroidAuthContext authContext, LoginUser loginUser) {
MeetingVO meeting = meetingQueryService.getDetailIgnoreTenant(meetingId);
if (meeting == null) {
throw new BusinessException(BusinessErrorCodeEnum.MEETING_NOT_FOUND.getCode(), "会议不存在");
}
private Meeting requireOperableOfflineMeeting(Long meetingId, AndroidAuthContext authContext, LoginUser loginUser) {
Meeting meeting = meetingAccessService.requireMeetingIgnoreTenant(meetingId);
if (!MeetingConstants.TYPE_OFFLINE.equals(meeting.getMeetingType())) {
throw new RuntimeException("当前会议不是离线会议");
}
if (authContext == null || authContext.getDeviceId() == null || authContext.getDeviceId().isBlank()) {
throw new RuntimeException("设备ID不能为空");
}
// if (meeting.getSourceDeviceCode() == null || !meeting.getSourceDeviceCode().equals(authContext.getDeviceId())) {
// throw new RuntimeException("当前会议不属于该设备");
// }
// if (authContext.isAnonymous()) {
// if (!MeetingConstants.DEVICE_MODE_PUBLIC.equals(meeting.getSourceDeviceMode())) {
// throw new RuntimeException("当前会议不是公有设备会议");
// }
// return meeting;
// }
// if (loginUser == null || !Objects.equals(meeting.getCreatorId(), loginUser.getUserId())) {
// throw new RuntimeException("仅会议创建人可操作当前会议");
// }
return meeting;
}

View File

@ -254,7 +254,20 @@ public class AndroidPushGrpcService extends PushServiceGrpc.PushServiceImplBase
return switch (platform) {
case IOS -> "ios";
case ANDROID -> "android";
case PLATFORM_UNKNOWN, UNRECOGNIZED -> "android";
case PLATFORM_UNKNOWN,UNRECOGNIZED -> "android";
case HARMONY_MOBILE ->"harmony_mobile";
// Desktop
case WINDOWS ->"windows";
case MACOS->"macos";
case LINUX -> "linux";
// Linux发行版可选
case KYLIN ->"kylin";
case UOS ->"uos";
// Harmony PC
case HARMONY_PC ->"harmony_pc";
};
}
}

View File

@ -15,4 +15,12 @@ public interface AndroidChunkUploadService {
LegacyUploadAudioResponse completeUpload(Long meetingId,
Integer totalChunks,
AndroidAuthContext authContext) throws IOException;
/**
* + + 线
* 线Tomcat failOfflineTranscription
*/
void completeUploadAsync(Long meetingId,
Integer totalChunks,
AndroidAuthContext authContext);
}

View File

@ -6,13 +6,15 @@ import com.imeeting.dto.android.legacy.LegacyUploadAudioResponse;
import com.imeeting.service.android.AndroidChunkUploadService;
import com.imeeting.service.android.legacy.LegacyMeetingAdapterService;
import com.imeeting.service.biz.MeetingCommandService;
import com.imeeting.service.biz.MeetingQueryService;
import com.imeeting.support.TaskSecurityContextRunner;
import com.imeeting.support.redis.AndroidChunkUploadSessionCache;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.nio.charset.StandardCharsets;
@ -30,15 +32,16 @@ import java.util.regex.Matcher;
import java.util.regex.Pattern;
@Service
@RequiredArgsConstructor
@Slf4j
public class AndroidChunkUploadServiceImpl implements AndroidChunkUploadService {
private static final Pattern LEGACY_CHUNK_FILE_NAME_PATTERN = Pattern.compile("^chunk-(\\d+)(\\..+)?$");
private static final Pattern CHUNK_DIR_NAME_PATTERN = Pattern.compile("^chunk-(\\d+)$");
private static final String CHUNK_ROOT_DIR = "chunks";
private final TaskSecurityContextRunner taskSecurityContextRunner;
private final AndroidChunkUploadSessionCache sessionCache;
private final LegacyMeetingAdapterService legacyMeetingAdapterService;
private final MeetingCommandService meetingCommandService;
private final java.util.concurrent.Executor chunkMergeExecutor;
@Value("${unisbase.app.upload-path}")
private String uploadPath;
@ -46,6 +49,18 @@ public class AndroidChunkUploadServiceImpl implements AndroidChunkUploadService
@Value("${imeeting.audio.ffmpeg-path:ffmpeg}")
private String ffmpegPath;
public AndroidChunkUploadServiceImpl(AndroidChunkUploadSessionCache sessionCache,
LegacyMeetingAdapterService legacyMeetingAdapterService,
MeetingCommandService meetingCommandService,
@Qualifier("chunkMergeExecutor") java.util.concurrent.Executor chunkMergeExecutor,
TaskSecurityContextRunner taskSecurityContextRunner) {
this.sessionCache = sessionCache;
this.legacyMeetingAdapterService = legacyMeetingAdapterService;
this.meetingCommandService = meetingCommandService;
this.chunkMergeExecutor = chunkMergeExecutor;
this.taskSecurityContextRunner = taskSecurityContextRunner;
}
@Override
public void saveChunk(Long meetingId,
Integer chunkIndex,
@ -116,7 +131,7 @@ public class AndroidChunkUploadServiceImpl implements AndroidChunkUploadService
MultipartFile mergedMultipart = new LocalMultipartFile(
resolveMergedOriginalFilename(state, orderedChunkPaths, mergedFile),
state.getContentType(),
Files.readAllBytes(mergedFile)
mergedFile
);
LegacyUploadAudioResponse response = legacyMeetingAdapterService.uploadAndTriggerOfflineProcessForPublicDevice(
@ -133,6 +148,31 @@ public class AndroidChunkUploadServiceImpl implements AndroidChunkUploadService
return response;
}
@Override
public void completeUploadAsync(Long meetingId,
Integer totalChunks,
AndroidAuthContext authContext) {
if (meetingId == null) {
throw new RuntimeException("meeting_id不能为空");
}
if (totalChunks == null || totalChunks <= 0) {
throw new RuntimeException("total_chunks不能为空且必须大于0");
}
chunkMergeExecutor.execute( ()->taskSecurityContextRunner.runAsTenantUser( authContext.getTenantId(), authContext.getUserId(), () -> {
try {
completeUpload(meetingId, totalChunks, authContext);
} catch (Exception ex) {
log.error("[分片合并] 会议{}异步合并上传失败: {}", meetingId, ex.getMessage(), ex);
try {
meetingCommandService.failOfflineTranscription(meetingId, "音频合并上传失败: " + ex.getMessage());
} catch (Exception inner) {
log.error("[分片合并] 会议{}标记失败状态异常: {}", meetingId, inner.getMessage(), inner);
}
}
}));
}
private AndroidChunkUploadSessionState getOrCreateState(Long meetingId,
MultipartFile chunkFile,
AndroidAuthContext authContext) {
@ -454,12 +494,12 @@ public class AndroidChunkUploadServiceImpl implements AndroidChunkUploadService
private static final class LocalMultipartFile implements MultipartFile {
private final String originalFilename;
private final String contentType;
private final byte[] bytes;
private final Path filePath;
private LocalMultipartFile(String originalFilename, String contentType, byte[] bytes) {
private LocalMultipartFile(String originalFilename, String contentType, Path filePath) {
this.originalFilename = originalFilename;
this.contentType = contentType;
this.bytes = bytes == null ? new byte[0] : bytes;
this.filePath = filePath;
}
@Override
@ -479,27 +519,35 @@ public class AndroidChunkUploadServiceImpl implements AndroidChunkUploadService
@Override
public boolean isEmpty() {
return bytes.length == 0;
try {
return Files.size(filePath) == 0;
} catch (IOException ex) {
return true;
}
}
@Override
public long getSize() {
return bytes.length;
try {
return Files.size(filePath);
} catch (IOException ex) {
return 0;
}
}
@Override
public byte[] getBytes() {
return bytes;
public byte[] getBytes() throws IOException {
return Files.readAllBytes(filePath);
}
@Override
public InputStream getInputStream() {
return new ByteArrayInputStream(bytes);
public InputStream getInputStream() throws IOException {
return Files.newInputStream(filePath);
}
@Override
public void transferTo(java.io.File dest) throws IOException, IllegalStateException {
Files.write(dest.toPath(), bytes);
Files.copy(filePath, dest.toPath(), java.nio.file.StandardCopyOption.REPLACE_EXISTING);
}
}
}

View File

@ -44,6 +44,7 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.concurrent.CompletableFuture;
import java.util.stream.Collectors;
@Service
@ -289,6 +290,7 @@ public class LegacyMeetingAdapterServiceImpl implements LegacyMeetingAdapterServ
String relocatedUrl = meetingDomainSupport.relocateAudioUrl(meetingId, stagingUrl);
taskSecurityContextRunner.runAsTenantUser(meeting.getTenantId(), meeting.getCreatorId(), () -> {
meetingDomainSupport.applyMeetingAudioMetadata(meeting, relocatedUrl);
meetingDomainSupport.prewarmPlaybackAudioAfterCommit(relocatedUrl);
meeting.setSummaryModelId(profile.getResolvedSummaryModelId());
meeting.setPromptId(profile.getResolvedPromptId());
meeting.setAudioSaveStatus(RealtimeMeetingAudioStorageService.STATUS_SUCCESS);

View File

@ -16,7 +16,10 @@ public interface MeetingQueryService {
MeetingVO getDetail(Long id);
MeetingVO getDetailIgnoreTenant(Long id);
default MeetingVO getDetailIgnoreTenant(Long id){
return getDetailIgnoreTenant(id,true);
};
MeetingVO getDetailIgnoreTenant(Long id,Boolean includeAudio);
List<MeetingTranscriptVO> getTranscripts(Long meetingId);

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

@ -62,6 +62,7 @@ public class MeetingAudioUploadSupport {
Files.copy(inputStream, targetPath, StandardCopyOption.REPLACE_EXISTING);
}
validateStoredAudio(targetPath, extension);
} catch (Exception ex) {
Files.deleteIfExists(targetPath);
throw ex;
@ -69,6 +70,55 @@ public class MeetingAudioUploadSupport {
return buildStagingAudioToken(storedFileName);
}
public String storeUploadedAudioFromPath(Path sourceFile, String originalFilename) throws IOException {
if (sourceFile == null || !Files.exists(sourceFile)) {
throw new RuntimeException("音频文件不能为空");
}
long fileSize = Files.size(sourceFile);
long maxUploadSizeMb = resolveMaxUploadSizeMb();
long maxUploadSizeBytes = maxUploadSizeMb * 1024 * 1024;
if (fileSize > maxUploadSizeBytes) {
throw new RuntimeException("音频文件大小不能超过 " + maxUploadSizeMb + "MB");
}
String extension = resolveExtension(originalFilename);
validateFileHeaderFromPath(sourceFile, extension);
Path stagingDir = resolveStagingAudioDirectory(uploadPath);
Files.createDirectories(stagingDir);
String storedFileName = UUID.randomUUID() + "." + extension;
Path targetPath = stagingDir.resolve(storedFileName);
try {
Files.move(sourceFile, targetPath, StandardCopyOption.REPLACE_EXISTING);
validateStoredAudio(targetPath, extension);
} catch (Exception ex) {
Files.deleteIfExists(targetPath);
throw ex;
}
return buildStagingAudioToken(storedFileName);
}
private void validateFileHeaderFromPath(Path sourceFile, String extension) throws IOException {
if (Files.size(sourceFile) <= 0) {
return;
}
byte[] header;
try (InputStream inputStream = Files.newInputStream(sourceFile)) {
header = inputStream.readNBytes(HEADER_SIZE);
}
boolean valid = switch (extension) {
case "wav" -> isWav(header);
case "mp3" -> isMp3(header);
case "m4a" -> isM4a(header);
default -> false;
};
if (!valid) {
throw new RuntimeException("上传文件内容与音频格式不匹配,仅支持 mp3、wav、m4a");
}
}
public static boolean isStagingAudioToken(String audioUrl) {
return StringUtils.hasText(audioUrl) && audioUrl.startsWith(STAGING_AUDIO_TOKEN_PREFIX);
}

View File

@ -1,5 +1,6 @@
package com.imeeting.service.biz.impl;
import cn.hutool.core.date.StopWatch;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.imeeting.common.MeetingConstants;
import com.imeeting.common.SysParamKeys;

View File

@ -485,7 +485,7 @@ public class MeetingPlaybackAudioResolver {
"-vn",
"-ar", String.valueOf(BROWSER_SAMPLE_RATE),
"-c:a", "aac",
"-f", "mp4",
"-ac", "1",
targetPath.toString()
);
executeCommand(command, targetPath);

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

@ -1,5 +1,6 @@
package com.imeeting.service.biz.impl;
import cn.hutool.core.date.StopWatch;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.imeeting.dto.biz.MeetingSummaryPromptContextRequestDTO;
@ -19,6 +20,7 @@ import com.imeeting.service.biz.MeetingService;
import com.imeeting.service.biz.MeetingTranscriptChapterService;
import com.unisbase.dto.PageResult;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import java.time.LocalDateTime;
@ -27,6 +29,7 @@ import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
@Slf4j
@Service
@RequiredArgsConstructor
public class MeetingQueryServiceImpl implements MeetingQueryService {
@ -83,10 +86,12 @@ public class MeetingQueryServiceImpl implements MeetingQueryService {
return meeting != null ? toVO(meeting, true) : null;
}
@Override
public MeetingVO getDetailIgnoreTenant(Long id) {
public MeetingVO getDetailIgnoreTenant(Long id, Boolean includeAudio) {
Meeting meeting = meetingMapper.selectByIdIgnoreTenant(id);
return meeting != null ? toVO(meeting, true) : null;
return meeting != null ? toVO(meeting, includeAudio) : null;
}
@Override

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;