提交 8990bc7c 作者: 洪东保

debug

父级 4db52872
......@@ -182,7 +182,7 @@ public class CmeetingJob {
/**
* 定时扫描早于一小时之前的,所有未重试过的会议,重新生成纪要
*/
@Scheduled(fixedRate = 30 * 60 * 1000, initialDelay = 10 * 60 * 1000)
@Scheduled(fixedRate = 30 * 60 * 1000, initialDelay = 3 * 60 * 1000)
public void meetingMinutesRetry() {
if (isDev) {
return;
......
package com.cmeeting.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import cn.hutool.core.collection.CollUtil;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.cmeeting.ad.entity.SysUserSync;
import com.cmeeting.constant.MeetingState;
......@@ -171,6 +172,10 @@ public class TencentMeetingServiceImpl extends ServiceImpl<TecentMeetingMapper,
//查询会议详情
String meetingId = meeting.getMeetingId();
String meetingRecordId = meeting.getMeetingRecordId();
if (meetingRecordId == null) {
log.error("记录不存在!");
continue;
}
String subMeetingId = null;
LocalDateTime mediaStartTime = LocalDateTime.ofInstant(Instant.ofEpochMilli(Long.valueOf(meeting.getMediaStartTime())), ZoneId.systemDefault());
String hostId = "";
......@@ -199,10 +204,18 @@ public class TencentMeetingServiceImpl extends ServiceImpl<TecentMeetingMapper,
List<String> recordFileIdList = recordFiles.stream().sorted(Comparator.comparingLong(CorpRecordsVO.RecordFile::getRecordStartTime))
.map(CorpRecordsVO.RecordFile::getRecordFileId).collect(Collectors.toList());
Set<String> set1 = new HashSet<>(recordFileIdList);
boolean flag = true;
if (CollUtil.isNotEmpty(meetingIds)) {
for (TencentMeetingVO.SimpleMeetingInfo meetingInfo : meetingIds) {
if (meetingInfo.getMeetingRecordId().equals(meetingRecordId)) {
flag = false;
break;
}
}
}
//如果数据库中已有相同会议id的记录,跳过同步
if(meetingIds.stream().noneMatch(item->Objects.equals(item.getMeetingRecordId(), meetingRecordId))){
if(flag){
log.info("【会议检索】新的会议记录MeetingRecordId->:{}, meetingId->{}, recordIds: {}", meetingRecordId,meeting.getMeetingId(), String.join(",", recordFileIdList));
String hostName;
......@@ -297,6 +310,12 @@ public class TencentMeetingServiceImpl extends ServiceImpl<TecentMeetingMapper,
.recordFileId(String.join(",", recordFileIdList))
.email(email)
.build();
meetingFiles.add(TencentMeetingVO.RecordFile.builder()
.meetingId(meetingId)
.subMeetingId(subMeetingId)
.meetingRecordId(meetingRecordId)
.recordFileIdList(recordFileIdList).build());
meetingSaveList.add(meetingItem);
}
} catch (Exception e) {
......@@ -309,26 +328,8 @@ public class TencentMeetingServiceImpl extends ServiceImpl<TecentMeetingMapper,
}
}
}
if (meetingSaveList.size() > 0) {
Map<String, List<MeetingInfo>> meetingSaveMap = meetingSaveList.stream().collect(Collectors.groupingBy(
item -> item.getMeetingId() + "_" +
(item.getSubMeetingId() != null ? item.getSubMeetingId() : "null")));
List<MeetingInfo> finalSaveList = new ArrayList<>();
for (Map.Entry<String, List<MeetingInfo>> entry : meetingSaveMap.entrySet()) {
MeetingInfo meetingInfo = entry.getValue().get(0);
List<String> recordFileIdList = entry.getValue().stream().flatMap(s -> Arrays.stream(s.getRecordFileId().split(","))).collect(Collectors.toList());
meetingInfo.setRecordFileId(String.join(",", recordFileIdList));
finalSaveList.add(meetingInfo);
if (meetingInfo.getEmailPushAccess()) {
meetingFiles.add(TencentMeetingVO.RecordFile.builder()
.meetingId(meetingInfo.getMeetingId())
.subMeetingId(meetingInfo.getSubMeetingId())
.meetingRecordId(meetingInfo.getMeetingRecordId())
.recordFileIdList(recordFileIdList).build());
}
}
meetingInfoMapper.batchInsert(finalSaveList);
if(meetingSaveList.size() > 0){
meetingInfoMapper.batchInsert(meetingSaveList);
}
} catch (Exception e) {
log.error(e.getMessage());
......
......@@ -2,7 +2,7 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.cmeeting.mapper.primary.MeetingInfoMapper">
<insert id="batchInsert" parameterType="list">
INSERT IGNORE INTO cmt_meeting_info (subject, meeting_id, meeting_code, host, host_uid, participant_users, start_time,
INSERT IGNORE INTO cmt_meeting_info (subject, meeting_id, meeting_record_id, meeting_code, host, host_uid, participant_users, start_time,
end_time, is_generated, email_generate_access, email_push_access, is_pushed, sync_time, sub_meeting_id, record_content, record_xml, generate_retry,
push_retry, record_file_id, status, email)
VALUES
......@@ -10,6 +10,7 @@
(
#{meeting.subject},
#{meeting.meetingId},
#{meeting.meetingRecordId},
#{meeting.meetingCode},
#{meeting.host},
#{meeting.hostUid},
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论