提交 8990bc7c 作者: 洪东保

debug

父级 4db52872
...@@ -182,7 +182,7 @@ public class CmeetingJob { ...@@ -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() { public void meetingMinutesRetry() {
if (isDev) { if (isDev) {
return; return;
......
package com.cmeeting.service.impl; package com.cmeeting.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import cn.hutool.core.collection.CollUtil;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.cmeeting.ad.entity.SysUserSync; import com.cmeeting.ad.entity.SysUserSync;
import com.cmeeting.constant.MeetingState; import com.cmeeting.constant.MeetingState;
...@@ -171,6 +172,10 @@ public class TencentMeetingServiceImpl extends ServiceImpl<TecentMeetingMapper, ...@@ -171,6 +172,10 @@ public class TencentMeetingServiceImpl extends ServiceImpl<TecentMeetingMapper,
//查询会议详情 //查询会议详情
String meetingId = meeting.getMeetingId(); String meetingId = meeting.getMeetingId();
String meetingRecordId = meeting.getMeetingRecordId(); String meetingRecordId = meeting.getMeetingRecordId();
if (meetingRecordId == null) {
log.error("记录不存在!");
continue;
}
String subMeetingId = null; String subMeetingId = null;
LocalDateTime mediaStartTime = LocalDateTime.ofInstant(Instant.ofEpochMilli(Long.valueOf(meeting.getMediaStartTime())), ZoneId.systemDefault()); LocalDateTime mediaStartTime = LocalDateTime.ofInstant(Instant.ofEpochMilli(Long.valueOf(meeting.getMediaStartTime())), ZoneId.systemDefault());
String hostId = ""; String hostId = "";
...@@ -199,10 +204,18 @@ public class TencentMeetingServiceImpl extends ServiceImpl<TecentMeetingMapper, ...@@ -199,10 +204,18 @@ public class TencentMeetingServiceImpl extends ServiceImpl<TecentMeetingMapper,
List<String> recordFileIdList = recordFiles.stream().sorted(Comparator.comparingLong(CorpRecordsVO.RecordFile::getRecordStartTime)) List<String> recordFileIdList = recordFiles.stream().sorted(Comparator.comparingLong(CorpRecordsVO.RecordFile::getRecordStartTime))
.map(CorpRecordsVO.RecordFile::getRecordFileId).collect(Collectors.toList()); .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的记录,跳过同步 //如果数据库中已有相同会议id的记录,跳过同步
if(meetingIds.stream().noneMatch(item->Objects.equals(item.getMeetingRecordId(), meetingRecordId))){ if(flag){
log.info("【会议检索】新的会议记录MeetingRecordId->:{}, meetingId->{}, recordIds: {}", meetingRecordId,meeting.getMeetingId(), String.join(",", recordFileIdList)); log.info("【会议检索】新的会议记录MeetingRecordId->:{}, meetingId->{}, recordIds: {}", meetingRecordId,meeting.getMeetingId(), String.join(",", recordFileIdList));
String hostName; String hostName;
...@@ -297,6 +310,12 @@ public class TencentMeetingServiceImpl extends ServiceImpl<TecentMeetingMapper, ...@@ -297,6 +310,12 @@ public class TencentMeetingServiceImpl extends ServiceImpl<TecentMeetingMapper,
.recordFileId(String.join(",", recordFileIdList)) .recordFileId(String.join(",", recordFileIdList))
.email(email) .email(email)
.build(); .build();
meetingFiles.add(TencentMeetingVO.RecordFile.builder()
.meetingId(meetingId)
.subMeetingId(subMeetingId)
.meetingRecordId(meetingRecordId)
.recordFileIdList(recordFileIdList).build());
meetingSaveList.add(meetingItem); meetingSaveList.add(meetingItem);
} }
} catch (Exception e) { } catch (Exception e) {
...@@ -309,26 +328,8 @@ public class TencentMeetingServiceImpl extends ServiceImpl<TecentMeetingMapper, ...@@ -309,26 +328,8 @@ public class TencentMeetingServiceImpl extends ServiceImpl<TecentMeetingMapper,
} }
} }
} }
if (meetingSaveList.size() > 0) { if(meetingSaveList.size() > 0){
Map<String, List<MeetingInfo>> meetingSaveMap = meetingSaveList.stream().collect(Collectors.groupingBy( meetingInfoMapper.batchInsert(meetingSaveList);
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);
} }
} catch (Exception e) { } catch (Exception e) {
log.error(e.getMessage()); log.error(e.getMessage());
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!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"> <mapper namespace="com.cmeeting.mapper.primary.MeetingInfoMapper">
<insert id="batchInsert" parameterType="list"> <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, 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) push_retry, record_file_id, status, email)
VALUES VALUES
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
( (
#{meeting.subject}, #{meeting.subject},
#{meeting.meetingId}, #{meeting.meetingId},
#{meeting.meetingRecordId},
#{meeting.meetingCode}, #{meeting.meetingCode},
#{meeting.host}, #{meeting.host},
#{meeting.hostUid}, #{meeting.hostUid},
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论