提交 ba5806a3 作者: 洪东保

meetingRecordId;

父级 c6787ec7
......@@ -268,6 +268,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())
......
......@@ -91,6 +91,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();
......@@ -191,7 +192,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())
......@@ -172,9 +170,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)
......@@ -221,12 +217,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;
......
......@@ -69,6 +69,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;
......@@ -109,8 +110,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;
......@@ -122,9 +122,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;
......@@ -201,6 +199,7 @@ public class FileProcessTask {
EmailPush emailPushBuilder = EmailPush.builder()
.toEmail(meetingInfo.getEmail())
.meetingId(meetingId)
.meetingRecordId(meetingRecordId)
.attachments(attachments)
.subject(meetingInfo.getSubject())
.meetingInstanceId(meetingInfo.getId())
......@@ -225,16 +224,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())
);
}
......@@ -413,11 +408,10 @@ public class FileProcessTask {
} finally {
meetingInfoMapper.update(meetingInfo,
new LambdaUpdateWrapper<MeetingInfo>()
.eq(MeetingInfo::getMeetingId, meetingId)
.eq(subMeetingId != null, MeetingInfo::getSubMeetingId, subMeetingId)
.set(MeetingInfo::getRecordContent, recordContentPath)
.set(MeetingInfo::getRecordXml, recordXmlPath)
.set(MeetingInfo::getParticipantUsers, meetingInfo.getParticipantUsers())
.eq(MeetingInfo::getMeetingRecordId, meetingInfo.getMeetingRecordId())
.set(MeetingInfo::getRecordContent,recordContentPath)
.set(MeetingInfo::getRecordXml,recordXmlPath)
.set(MeetingInfo::getParticipantUsers,meetingInfo.getParticipantUsers())
.set(MeetingInfo::getIsGenerated, success)
.set(MeetingInfo::getTemplateId, meetingRecordTemplate.getId())
.set(MeetingInfo::getTransDocId, meetingInfo.getTransDocId())
......@@ -449,8 +443,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())
);
......@@ -538,7 +531,7 @@ public class FileProcessTask {
}
public FileProcessTask(List<String> recordFileIdList, String meetingId, String subMeetingId, String savePath, Map<String, Object> metadata,
public FileProcessTask(List<String> recordFileIdList, String meetingRecordId, String meetingId, String subMeetingId, String savePath, Map<String, Object> metadata,
MeetingInfoMapper meetingInfoMapper, MinioUtils minioUtils, RedisUtils redisUtils, EmailSender emailSender,
MeetingRecordTemplateMapper meetingRecordTemplateMapper, MeetingRecordTemplateService meetingRecordTemplateService, MeetTypeService meetTypeService, UserIdMapper userIdMapper,
String llmApiAddr, String llmModel, String llmToken, Integer llmMaxTokens, Boolean finalRetry, ProcessLogService processLogService, List<UserDTO.TemplateAuthorizedUserDTO> authorizedUsers, Map<String, String> tidWidRelations,
......@@ -547,6 +540,7 @@ public class FileProcessTask {
this.recordFileIdList = recordFileIdList;
this.savePath = savePath;
this.metadata = metadata;
this.meetingRecordId = meetingRecordId;
this.meetingId = meetingId;
this.subMeetingId = subMeetingId;
this.meetingInfoMapper = meetingInfoMapper;
......
......@@ -92,6 +92,7 @@ public class FileProcessProducer {
// 为每个URL创建任务
FileProcessTask task = new FileProcessTask(
recordFile.getRecordFileIdList(),
recordFile.getMeetingRecordId(),
recordFile.getMeetingId(),
recordFile.getSubMeetingId(),
baseSavePath,
......@@ -139,7 +140,7 @@ public class FileProcessProducer {
for (TencentMeetingVO.RecordFile recordFile : recordFiles) {
// 为每个URL创建任务
EmailPushTask task = new EmailPushTask(
recordFile.getRecordFileIdList(),
recordFile.getMeetingRecordId(),
recordFile.getMeetingId(),
recordFile.getSubMeetingId(),
baseSavePath,
......
......@@ -235,7 +235,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())
.set(MeetingInfo::getTemplateId, meetingRecordTemplate.getId())
......
......@@ -170,6 +170,7 @@ public class TencentMeetingServiceImpl extends ServiceImpl<TecentMeetingMapper,
log.info("【会议定时检索】转录文件的meetingId->{},recordFileId->{}", meeting.getMeetingId(), meeting.getMeetingRecordId());
//查询会议详情
String meetingId = meeting.getMeetingId();
String meetingRecordId = meeting.getMeetingRecordId();
String subMeetingId = null;
LocalDateTime mediaStartTime = LocalDateTime.ofInstant(Instant.ofEpochMilli(Long.valueOf(meeting.getMediaStartTime())), ZoneId.systemDefault());
String hostId = "";
......@@ -201,15 +202,8 @@ public class TencentMeetingServiceImpl extends ServiceImpl<TecentMeetingMapper,
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 hostName;
//优先使用会议列表中已有的主持人字段
......@@ -285,7 +279,10 @@ public class TencentMeetingServiceImpl extends ServiceImpl<TecentMeetingMapper,
// 查询会议开始和结束时间
MeetingInfo startAndEndTimeByMeetingId = TencentMeetingApiUtil.getStartAndEndTimeByMeetingId(meetingId);
//会议基本信息保存
MeetingInfo meetingItem = MeetingInfo.builder().meetingId(meetingId).meetingCode(meeting.getMeetingCode())
MeetingInfo meetingItem = MeetingInfo.builder()
.meetingRecordId(meetingRecordId)
.meetingId(meetingId)
.meetingCode(meeting.getMeetingCode())
.subject(meeting.getSubject())
.startTime(startAndEndTimeByMeetingId != null ? startAndEndTimeByMeetingId.getStartTime() : mediaStartTime)
.endTime(startAndEndTimeByMeetingId != null ? startAndEndTimeByMeetingId.getEndTime() : null)
......
......@@ -34,6 +34,7 @@ public class EmailPush {
/**
* 会议id号
*/
private String meetingRecordId;
private String meetingId;
private String subMeetingId;
......
......@@ -33,7 +33,7 @@
</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>
<select id="statistics" resultType="java.util.LinkedHashMap">
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论