提交 5ef1fb26 作者: 洪东保

定时任务逻辑-debug

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