提交 36ed9eb2 作者: 洪东保

定时任务逻辑-debug

会议id+子会议id+会议记录id作为一个记录的整体
父级 face2f01
......@@ -271,7 +271,9 @@ public class CmeetingJob {
for (MeetingInfo meetingInfo : meetingInfoList) {
TencentMeetingVO.RecordFile recordFile = TencentMeetingVO.RecordFile.builder()
.meetingId(meetingInfo.getMeetingId())
.subMeetingId(meetingInfo.getSubMeetingId()).build();
.subMeetingId(meetingInfo.getSubMeetingId())
.recordFileIdList(Arrays.asList(meetingInfo.getRecordFileId().split(",")))
.build();
meetingFiles.add(recordFile);
}
......
......@@ -35,6 +35,7 @@ import java.util.concurrent.atomic.AtomicInteger;
@Slf4j
@Service
public class EmailPushTask {
private List<String> recordFileIdList;
private String meetingId;
private String subMeetingId;
private String savePath;
......@@ -53,7 +54,8 @@ public class EmailPushTask {
// 实际处理逻辑
public void process() {
String key = "meet_process" + meetingId + "_" + (subMeetingId == null ? "" : subMeetingId);
String join = String.join(",", recordFileIdList);
String key = "meet_process" + meetingId + "_" + (subMeetingId == null ? "" : subMeetingId) + "_" + join;
if (!redisUtils.setnx(key, 1, 120)) {
log.warn("key already exists in redis!, key: {}", key);
return;
......@@ -64,7 +66,8 @@ public class EmailPushTask {
AtomicInteger retryCount = new AtomicInteger(0);
MeetingInfo meetingInfo = meetingInfoMapper.selectOne(new LambdaQueryWrapper<MeetingInfo>()
.eq(MeetingInfo::getMeetingId,meetingId)
.eq(subMeetingId != null, MeetingInfo::getSubMeetingId, subMeetingId));
.eq(subMeetingId != null, MeetingInfo::getSubMeetingId, subMeetingId)
.eq(MeetingInfo::getRecordFileId, join));
if (meetingInfo.getIsPushed()) {
log.warn("邮件已推送, meetingId: {}", meetingId);
return;
......@@ -155,7 +158,8 @@ public class EmailPushTask {
meetingInfoMapper.update(meetingInfo,
new LambdaUpdateWrapper<MeetingInfo>()
.eq(MeetingInfo::getMeetingId,meetingId)
.eq(subMeetingId != null,MeetingInfo::getSubMeetingId,subMeetingId)
.eq(subMeetingId != null, MeetingInfo::getSubMeetingId, subMeetingId)
.eq(MeetingInfo::getRecordFileId, join)
.set(MeetingInfo::getIsPushed,isSuccess)
.set(MeetingInfo::getStatus, isSuccess ? MeetingState.PUSH_SUCCESS.getCode() : MeetingState.PUSH_ERROR.getCode())
.set(MeetingInfo::getPushRetry, Boolean.TRUE)
......@@ -202,9 +206,10 @@ public class EmailPushTask {
}
public EmailPushTask(String meetingId, String subMeetingId, String savePath, Map<String, Object> metadata,
public EmailPushTask(List<String> recordFileIdList, 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.meetingId = meetingId;
......
......@@ -114,7 +114,8 @@ public class FileProcessTask {
// 实际处理逻辑
public void process() {
boolean isSuccess = false;
String key = "meet_process" + meetingId + "_" + (subMeetingId == null ? "" : subMeetingId);
String join = String.join(",", recordFileIdList);
String key = "meet_process" + meetingId + "_" + (subMeetingId == null ? "" : subMeetingId) + "_" + join;
if (!redisUtils.setnx(key, 1, 240)) {
log.warn("key already exists in redis!, key: {}", key);
return;
......@@ -131,6 +132,7 @@ public class FileProcessTask {
//已保存的会议信息
MeetingInfo meetingInfo = meetingInfoMapper.selectOne(new LambdaQueryWrapper<MeetingInfo>()
.eq(MeetingInfo::getMeetingId,meetingId)
.eq(MeetingInfo::getRecordFileId, join)
.eq(subMeetingId != null, MeetingInfo::getSubMeetingId, subMeetingId));
if (meetingInfo.getIsGenerated()) {
log.warn("Generating is down, meetingId: {}, subMeetingId: {}", meetingInfo.getMeetingId(), meetingInfo.getSubMeetingId());
......@@ -367,12 +369,14 @@ public class FileProcessTask {
meetingInfoMapper.update(null,
new LambdaUpdateWrapper<MeetingInfo>()
.eq(MeetingInfo::getMeetingId,meetingId)
.eq(MeetingInfo::getRecordFileId,join)
.eq(subMeetingId != null,MeetingInfo::getSubMeetingId,subMeetingId)
.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)
.set(MeetingInfo::getStatus, status != null ? status : MeetingState.GENERATE_ERROR.getCode())
);
......
......@@ -144,6 +144,7 @@ public class FileProcessProducer {
for (TencentMeetingVO.RecordFile recordFile : recordFiles) {
// 为每个URL创建任务
EmailPushTask task = new EmailPushTask(
recordFile.getRecordFileIdList(),
recordFile.getMeetingId(),
recordFile.getSubMeetingId(),
baseSavePath,
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论