提交 1cda0f73 作者: 洪东保

meetingRecordId;

父级 1167fa1d
......@@ -254,6 +254,7 @@ public class MeetingInfoController {
EmailPush emailPushBuilder = EmailPush.builder()
.toEmail(meetingInfo.getEmail())
.meetingId(meetingInfo.getMeetingId())
.meetingRecordId(meetingInfo.getMeetingRecordId())
.attachments(attachments)
.subject(meetingInfo.getSubject())
.meetingInstanceId(meetingInfo.getId())
......
......@@ -81,6 +81,7 @@ public class EmailSender {
Boolean isSent = false;
String toEmail = "test".equals(environment) ? testReceiver : emailPushBuilder.getToEmail();
String subject = emailPushBuilder.getSubject();
String meetingRecordId = emailPushBuilder.getMeetingRecordId();
String meetingId = emailPushBuilder.getMeetingId();
String subMeetingId = emailPushBuilder.getSubMeetingId();
Integer meetingInstanceId = emailPushBuilder.getMeetingInstanceId();
......@@ -174,7 +175,7 @@ public class EmailSender {
.buildRequest()
.post();
log.info("邮件已成功发送: meetingId->{}, subMeetingId->{}", meetingId, subMeetingId);
log.info("邮件已成功发送: meetingRecordId->{}", meetingRecordId);
isSent = true;
}catch (Exception e) {
retryCount.getAndIncrement();
......
......@@ -35,7 +35,7 @@ import java.util.concurrent.atomic.AtomicInteger;
@Slf4j
@Service
public class EmailPushTask {
private List<String> recordFileIdList;
private String meetingRecordId;
private String meetingId;
private String subMeetingId;
private String savePath;
......@@ -54,8 +54,7 @@ public class EmailPushTask {
// 实际处理逻辑
public void process() {
String join = String.join(",", recordFileIdList);
String key = "meet_process" + meetingId + "_" + (subMeetingId == null ? "" : subMeetingId) + "_" + join;
String key = "meet_process-" + meetingRecordId;
if (!redisUtils.setnx(key, 1, 120)) {
log.warn("key already exists in redis!, key: {}", key);
return;
......@@ -65,9 +64,7 @@ public class EmailPushTask {
Boolean isSuccess = false;
AtomicInteger retryCount = new AtomicInteger(0);
MeetingInfo meetingInfo = meetingInfoMapper.selectOne(new LambdaQueryWrapper<MeetingInfo>()
.eq(MeetingInfo::getMeetingId,meetingId)
.eq(subMeetingId != null, MeetingInfo::getSubMeetingId, subMeetingId)
.eq(MeetingInfo::getRecordFileId, join));
.eq(MeetingInfo::getMeetingRecordId, meetingRecordId));
if (meetingInfo.getIsPushed()) {
log.warn("邮件已推送, meetingId: {}", meetingId);
return;
......@@ -127,6 +124,7 @@ public class EmailPushTask {
EmailPush emailPushBuilder = EmailPush.builder()
.toEmail(meetingInfo.getEmail())
.meetingId(meetingId)
.meetingRecordId(meetingRecordId)
.attachments(attachments)
.subject(meetingInfo.getSubject())
.meetingInstanceId(meetingInfo.getId())
......@@ -157,9 +155,7 @@ public class EmailPushTask {
if (isSuccess != null) {
meetingInfoMapper.update(meetingInfo,
new LambdaUpdateWrapper<MeetingInfo>()
.eq(MeetingInfo::getMeetingId,meetingId)
.eq(subMeetingId != null, MeetingInfo::getSubMeetingId, subMeetingId)
.eq(MeetingInfo::getRecordFileId, join)
.eq(MeetingInfo::getMeetingRecordId, meetingRecordId)
.set(MeetingInfo::getIsPushed,isSuccess)
.set(MeetingInfo::getStatus, isSuccess ? MeetingState.PUSH_SUCCESS.getCode() : MeetingState.PUSH_ERROR.getCode())
.set(MeetingInfo::getPushRetry, Boolean.TRUE)
......@@ -206,12 +202,12 @@ public class EmailPushTask {
}
public EmailPushTask(List<String> recordFileIdList, String meetingId, String subMeetingId, String savePath, Map<String, Object> metadata,
public EmailPushTask(String meetingRecordId, String meetingId, String subMeetingId, String savePath, Map<String, Object> metadata,
MeetingInfoMapper meetingInfoMapper, MinioUtils minioUtils, RedisUtils redisUtils, EmailSender emailSender,
MeetingRecordTemplateMapper meetingRecordTemplateMapper, Map<String,String> tidWidRelations, String aesKey) {
this.recordFileIdList = recordFileIdList;
this.savePath = savePath;
this.metadata = metadata;
this.meetingRecordId = meetingRecordId;
this.meetingId = meetingId;
this.subMeetingId = subMeetingId;
this.meetingInfoMapper = meetingInfoMapper;
......
......@@ -72,6 +72,7 @@ import java.util.stream.Collectors;
@Service
public class FileProcessTask {
private List<String> recordFileIdList;
private String meetingRecordId;
private String meetingId;
private String subMeetingId;
private String savePath;
......@@ -114,8 +115,7 @@ public class FileProcessTask {
// 实际处理逻辑
public void process() {
boolean isSuccess = false;
String join = String.join(",", recordFileIdList);
String key = "meet_process" + meetingId + "_" + (subMeetingId == null ? "" : subMeetingId) + "_" + join;
String key = "meet_process-" + meetingRecordId;
if (!redisUtils.setnx(key, 1, 240)) {
log.warn("key already exists in redis!, key: {}", key);
return;
......@@ -131,9 +131,7 @@ public class FileProcessTask {
try {
//已保存的会议信息
MeetingInfo meetingInfo = meetingInfoMapper.selectOne(new LambdaQueryWrapper<MeetingInfo>()
.eq(MeetingInfo::getMeetingId,meetingId)
.eq(MeetingInfo::getRecordFileId, join)
.eq(subMeetingId != null, MeetingInfo::getSubMeetingId, subMeetingId));
.eq(MeetingInfo::getMeetingRecordId, meetingRecordId));
if (meetingInfo.getIsGenerated()) {
log.warn("Generating is down, meetingId: {}, subMeetingId: {}", meetingInfo.getMeetingId(), meetingInfo.getSubMeetingId());
return;
......@@ -227,7 +225,7 @@ public class FileProcessTask {
//每场会议可能会分段录制,查出每个文件的转录记录后拼接
StringBuffer recordTextBuffer = new StringBuffer();
for (String recordFileId : recordFileIdList) {
log.info("下载转录文件, recordFileId: {}", recordFileId);
log.info("下载转录文件, meetingRecordId:{}, recordFileId: {}", meetingRecordId, recordFileId);
//查询录制转写详情
RecordsApi.ApiV1AddressesRecordFileIdGetRequest addressRequest =
new RecordsApi.ApiV1AddressesRecordFileIdGetRequest.Builder(recordFileId)
......@@ -248,8 +246,7 @@ public class FileProcessTask {
addressData.getAiMeetingTranscripts();
if (transcripts != null && !transcripts.isEmpty()) {
log.info("Found {} AI meeting transcripts for record file {}",
transcripts.size(), recordFileId);
log.info("Found {} AI meeting transcripts for record file {}", transcripts.size(), recordFileId);
// 处理每个转录文件
for (V1AddressesRecordFileIdGet200ResponseAiMeetingTranscriptsInner transcript : transcripts) {
......@@ -345,6 +342,7 @@ public class FileProcessTask {
EmailPush emailPushBuilder = EmailPush.builder()
.toEmail(meetingInfo.getEmail())
.meetingId(meetingId)
.meetingRecordId(meetingRecordId)
.attachments(attachments)
.subject(meetingInfo.getSubject())
.meetingInstanceId(meetingInfo.getId())
......@@ -368,16 +366,12 @@ public class FileProcessTask {
if(finalRetry){
meetingInfoMapper.update(null,
new LambdaUpdateWrapper<MeetingInfo>()
.eq(MeetingInfo::getMeetingId,meetingId)
.eq(MeetingInfo::getRecordFileId,join)
.eq(subMeetingId != null,MeetingInfo::getSubMeetingId,subMeetingId)
.eq(MeetingInfo::getMeetingRecordId, meetingRecordId)
.set(MeetingInfo::getGenerateRetry,Boolean.TRUE));
} else {
meetingInfoMapper.update(null,
new LambdaUpdateWrapper<MeetingInfo>()
.eq(MeetingInfo::getMeetingId,meetingId)
.eq(MeetingInfo::getRecordFileId,join)
.eq(subMeetingId != null,MeetingInfo::getSubMeetingId,subMeetingId)
.eq(MeetingInfo::getMeetingRecordId, meetingRecordId)
.set(MeetingInfo::getStatus, status != null ? status : MeetingState.GENERATE_ERROR.getCode())
);
}
......@@ -590,8 +584,7 @@ public class FileProcessTask {
} finally {
meetingInfoMapper.update(meetingInfo,
new LambdaUpdateWrapper<MeetingInfo>()
.eq(MeetingInfo::getMeetingId,meetingId)
.eq(subMeetingId != null,MeetingInfo::getSubMeetingId,subMeetingId)
.eq(MeetingInfo::getMeetingRecordId, meetingInfo.getMeetingRecordId())
.set(MeetingInfo::getRecordContent,recordContentPath)
.set(MeetingInfo::getRecordXml,recordXmlPath)
.set(MeetingInfo::getParticipantUsers,meetingInfo.getParticipantUsers())
......@@ -626,8 +619,7 @@ public class FileProcessTask {
meetingInfoMapper.update(null,
new LambdaUpdateWrapper<MeetingInfo>()
.eq(MeetingInfo::getMeetingId, meetingId)
.eq(subMeetingId != null,MeetingInfo::getSubMeetingId,subMeetingId)
.eq(MeetingInfo::getMeetingRecordId, meetingRecordId)
.set(MeetingInfo::getIsPushed, isPushed)
.set(MeetingInfo::getStatus, isPushed ? MeetingState.PUSH_SUCCESS.getCode() : MeetingState.PUSH_ERROR.getCode())
);
......@@ -742,7 +734,7 @@ public class FileProcessTask {
}
public FileProcessTask(List<String> recordFileIdList, String meetingId, String subMeetingId, String savePath, Map<String, Object> metadata, String tencentAppId,
public FileProcessTask(List<String> recordFileIdList, String meetingRecordId, String meetingId, String subMeetingId, String savePath, Map<String, Object> metadata, String tencentAppId,
String tencentSdkId, String tencentSecretId, String tencentSecretKey, String tencentAdminUserId,
MeetingInfoMapper meetingInfoMapper, MinioUtils minioUtils, RedisUtils redisUtils, EmailSender emailSender, MeetingRecordTemplateMapper meetingRecordTemplateMapper,
String llmApiAddr, String llmApiModel, String llmApiToken, Integer llmApiMaxTokens, Boolean finalRetry, ProcessLogService processLogService,List<UserDTO.TemplateAuthorizedUserDTO> authorizedUsers,Map<String,String> tidWidRelations,
......@@ -756,6 +748,7 @@ public class FileProcessTask {
this.tencentSecretId = tencentSecretId;
this.tencentSecretKey = tencentSecretKey;
this.tencentAdminUserId = tencentAdminUserId;
this.meetingRecordId = meetingRecordId;
this.meetingId = meetingId;
this.subMeetingId = subMeetingId;
this.meetingInfoMapper = meetingInfoMapper;
......
......@@ -96,6 +96,7 @@ public class FileProcessProducer {
// 为每个URL创建任务
FileProcessTask task = new FileProcessTask(
recordFile.getRecordFileIdList(),
recordFile.getMeetingRecordId(),
recordFile.getMeetingId(),
recordFile.getSubMeetingId(),
baseSavePath,
......@@ -144,7 +145,7 @@ public class FileProcessProducer {
for (TencentMeetingVO.RecordFile recordFile : recordFiles) {
// 为每个URL创建任务
EmailPushTask task = new EmailPushTask(
recordFile.getRecordFileIdList(),
recordFile.getMeetingRecordId(),
recordFile.getMeetingId(),
recordFile.getSubMeetingId(),
baseSavePath,
......
......@@ -237,7 +237,7 @@ public class MeetingInfoServiceImpl extends ServiceImpl<MeetingInfoMapper, Meeti
saveResult(processedResult, recordTextBuffer.toString().getBytes(StandardCharsets.UTF_8), meetingInfo, meetingRecordTemplate);
meetingInfoMapper.update(null,
new LambdaUpdateWrapper<MeetingInfo>()
.eq(MeetingInfo::getMeetingId,meetingId)
.eq(MeetingInfo::getMeetingRecordId, meetingInfo.getMeetingRecordId())
.eq(subMeetingId != null,MeetingInfo::getSubMeetingId,subMeetingId)
.set(MeetingInfo::getRecordXml,meetingInfo.getRecordXml()));
return true;
......
......@@ -175,12 +175,12 @@ public class TencentMeetingServiceImpl extends ServiceImpl<TecentMeetingMapper,T
}
//查询会议详情
String meetingId = meeting.getMeetingId();
String meetingRecordId = meeting.getMeetingRecordId();
String subMeetingId = null;
LocalDateTime mediaStartTime = LocalDateTime.ofInstant(Instant.ofEpochMilli(Long.valueOf(meeting.getMediaStartTime())), ZoneId.systemDefault());
try {
String userid = meeting.getUserid();
log.info("【会议检索】转录文件的meetingId->{},meetingRecordId->{}",meeting.getMeetingId(),meeting.getMeetingRecordId());
log.info("【周期会议扫描】:查询用户的已结束会议列表...meetingCode->{},userId->{}",meeting.getMeetingCode(), userid);
log.info("【会议检索】转录文件的meetingRecordId->{}, meetingId->{}",meetingRecordId, meetingId);
//获取子会议id
MeetingsApi.ApiV1HistoryMeetingsUseridGetRequest historyMeetingRequest =
new MeetingsApi.ApiV1HistoryMeetingsUseridGetRequest.Builder(userid)
......@@ -213,15 +213,8 @@ public class TencentMeetingServiceImpl extends ServiceImpl<TecentMeetingMapper,T
Set<String> set1 = new HashSet<>(recordFileIdList);
//如果数据库中已有相同会议id的记录,跳过同步
String finalSubMeetingId = subMeetingId;
if(meetingIds.stream().noneMatch
(
item->item.getMeetingId().equals(meetingId)
&& Objects.equals(item.getSubMeetingId(), finalSubMeetingId)
&& new HashSet<>(Arrays.asList(item.getRecordFileId().split(","))).containsAll(set1)
)
){
log.info("【会议检索】新的会议记录meetingId->{}, subId: {} ,recordIds: {}",meeting.getMeetingId(), finalSubMeetingId, String.join(",", recordFileIdList));
if(meetingIds.stream().noneMatch(item->Objects.equals(item.getMeetingRecordId(), meetingRecordId))){
log.info("【会议检索】新的会议记录MeetingRecordId->:{}, meetingId->{}, recordIds: {}", meetingRecordId,meeting.getMeetingId(), String.join(",", recordFileIdList));
String hostId;
String hostName;
......@@ -302,7 +295,10 @@ public class TencentMeetingServiceImpl extends ServiceImpl<TecentMeetingMapper,T
? weComUserMap.get(userDTO.getWid()).getEmailPushAccess() : Boolean.FALSE;
//会议基本信息保存
MeetingInfo meetingItem = MeetingInfo.builder().meetingId(meetingId).meetingCode(meeting.getMeetingCode())
MeetingInfo meetingItem = MeetingInfo.builder()
.meetingRecordId(meetingRecordId)
.meetingId(meetingId)
.meetingCode(meeting.getMeetingCode())
.subject(meeting.getSubject())
.startTime(mediaStartTime)
// .endTime(LocalDateTime.ofInstant(Instant.ofEpochSecond(Long.valueOf(meeting.getEndTime())), ZoneId.systemDefault()))
......
......@@ -34,6 +34,7 @@ public class EmailPush {
/**
* 会议id号
*/
private String meetingRecordId;
private String meetingId;
private String subMeetingId;
......
......@@ -32,6 +32,6 @@
</foreach>
</insert>
<select id="getAllMeetingIds" resultType="com.cmeeting.vo.TencentMeetingVO$SimpleMeetingInfo">
select meeting_id,sub_meeting_id,record_file_id from cmt_meeting_info
select meeting_id,meeting_record_id,sub_meeting_id,record_file_id from cmt_meeting_info order by sync_time limit 10000;
</select>
</mapper>
\ No newline at end of file
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论