提交 382e9d26 作者: 洪东保

改动-批测

父级 145b1b92
......@@ -15,9 +15,9 @@ public class ThreadPoolConfig {
public ThreadPoolTaskExecutor fileProcessExecutor() {
ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
// 核心线程数 (CPU密集型任务建议核心数+1)
executor.setCorePoolSize(2); // 固定核心线程数,避免动态获取CPU核心数
executor.setCorePoolSize(4); // 固定核心线程数,避免动态获取CPU核心数
// 最大线程数
executor.setMaxPoolSize(20);
executor.setMaxPoolSize(4);
// 队列容量
executor.setQueueCapacity(1000);
// 线程名前缀
......
......@@ -11,6 +11,7 @@ import com.cmeeting.service.*;
import com.cmeeting.vo.TencentMeetingVO;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import org.springframework.util.CollectionUtils;
......@@ -40,6 +41,8 @@ public class CmeetingJob {
private MeetingRecordTemplateService meetingRecordTemplateService;
@Resource
private UserIdMapper userIdMapper;
@Value("${isDev}")
private Boolean isDev;
// @PostConstruct
public void weComUserInit(){
......@@ -99,9 +102,12 @@ public class CmeetingJob {
log.info("-------关联企微腾会人员定时任务结束--------");
}
@Scheduled(fixedRate = 20 * 60 * 1000,initialDelay = 2 * 60 * 1000)
// @Scheduled(fixedRate = 20 * 60 * 1000)
// @Scheduled(fixedRate = 20 * 60 * 1000,initialDelay = 2 * 60 * 1000)
@Scheduled(fixedRate = 60 * 60 * 1000,initialDelay = 1 * 60 * 1000)
public void execute() {
if (isDev) {
return;
}
//查出企微id和腾会id的关联关系
List<UserId> userIdRelations = userIdMapper.selectList(null);
Map<String,String> widTidRelations = userIdRelations.stream().collect(Collectors.toMap(UserId::getWid,UserId::getTid));
......@@ -136,9 +142,12 @@ public class CmeetingJob {
/**
* 定时扫描早于一小时之前的,所有未重试过的会议,重新生成纪要
*/
@Scheduled(fixedRate = 30 * 60 * 1000,initialDelay = 10 * 60 * 1000)
// @Scheduled(fixedRate = 30 * 60 * 1000,initialDelay = 10 * 60 * 1000)
// @Scheduled(fixedRate = 30 * 60 * 1000)
public void meetingMinutesRetry() {
if (isDev) {
return;
}
try {
log.info("-------生成纪要重试定时任务开始-------");
log.info("当前时间: " + LocalDate.now().format(DateTimeFormatter.ISO_LOCAL_DATE));
......@@ -149,6 +158,7 @@ public class CmeetingJob {
.eq(MeetingInfo::getIsGenerated,Boolean.FALSE)
.eq(MeetingInfo::getStatus, MeetingState.GENERATE_ERROR.getCode())
.eq(MeetingInfo::getGenerateRetry,Boolean.FALSE)
.eq(MeetingInfo::getEmailPushAccess,Boolean.TRUE)
.le(MeetingInfo::getSyncTime,LocalDateTime.now().minusHours(1))
);
......@@ -183,9 +193,12 @@ public class CmeetingJob {
/**
* 定时扫描早于一小时之前的,所有邮件推送未重试过的会议,重新推送邮件
*/
@Scheduled(fixedRate = 30 * 60 * 1000,initialDelay = 15 * 60 * 1000)
// @Scheduled(fixedRate = 30 * 60 * 1000,initialDelay = 15 * 60 * 1000)
// @Scheduled(fixedRate = 30 * 60 * 1000)
public void emailPushRetry() {
if (isDev) {
return;
}
try {
log.info("-------邮件推送重试定时任务开始-------");
log.info("当前时间: " + LocalDate.now().format(DateTimeFormatter.ISO_LOCAL_DATE));
......
......@@ -120,6 +120,10 @@ public class FileProcessTask {
MeetingInfo meetingInfo = meetingInfoMapper.selectOne(new LambdaQueryWrapper<MeetingInfo>()
.eq(MeetingInfo::getMeetingId,meetingId)
.eq(subMeetingId != null, MeetingInfo::getSubMeetingId, subMeetingId));
if (!meetingInfo.getEmailPushAccess()) {
log.warn("会议主持人没有推送邮件权限");
return;
}
String meetingDate = meetingInfo.getStartTime().toLocalDate().format(DateTimeFormatter.ISO_LOCAL_DATE);
//下面再查一遍会议信息的意义是,为了获取会议中的子会议Id,如果是周期会议,需要保存下来(重要)
// MeetingsApi.ApiV1MeetingsMeetingIdGetRequest meetingRequest =
......@@ -260,8 +264,8 @@ public class FileProcessTask {
throw new RuntimeException("获取的转录文本为空,跳过纪要生成");
}
// 3. 处理文件 (调用Claude API等)
String choiceTemplateType = choiceTemplateType(meetingInfo.getSubject(),recordTextBuffer.toString());
log.info("choiceTemplateType->{}",choiceTemplateType);
// String choiceTemplateType = choiceTemplateType(meetingInfo.getSubject(),recordTextBuffer.toString());
// log.info("choiceTemplateType->{}",choiceTemplateType);
//获取系统模板
List<MeetingRecordTemplate> recordTemplateList = meetingRecordTemplateMapper.selectList(
new LambdaQueryWrapper<MeetingRecordTemplate>().eq(MeetingRecordTemplate::getType, RecordTemplateConstant.TEMPLATE_TYPE_SYSTEM)
......
......@@ -122,6 +122,7 @@ public class TencentMeetingServiceImpl extends ServiceImpl<TecentMeetingMapper,T
List<TencentMeetingVO.RecordFile> meetingFiles = new ArrayList<>();
List<TencentMeetingVO.RecordFile> recordFileUrlList = new ArrayList<>();
List<MeetingInfo> meetingSaveList = new ArrayList<>();
int i = 0;
// 查询近searchDays天的会议录制列表
try {
ZonedDateTime now = ZonedDateTime.now();
......@@ -138,6 +139,9 @@ public class TencentMeetingServiceImpl extends ServiceImpl<TecentMeetingMapper,T
List<TencentMeetingUser> meetingUsers = tecentMeetingMapper.getAlluser();
Map<String, String> meetingMap = meetingUsers.stream().collect(Collectors.toMap(TencentMeetingUser::getUserId, TencentMeetingUser::getUserName));
while (currentPage.intValue() <= totalPage){
if (i >= 150) {
break;
}
CorpRecordsVO data = fetchMeetingRecords(tencentAdminUserId, 1, startTime, endTime, currentPage.getAndIncrement(), 20);
//设置总页数
if (data != null && data.getRecordMeetings() != null && !data.getRecordMeetings().isEmpty()) {
......@@ -153,19 +157,16 @@ public class TencentMeetingServiceImpl extends ServiceImpl<TecentMeetingMapper,T
// processLogService.log(meeting.getMeetingId(),null,"会议未结束,跳过生成");
continue;
}
log.info("【会议检索】转录文件的meetingId->{},recordFileId->{}",meeting.getMeetingId(),meeting.getMeetingRecordId());
//查询会议详情
String meetingId = meeting.getMeetingId();
String subMeetingId = null;
LocalDateTime mediaStartTime = LocalDateTime.ofInstant(Instant.ofEpochMilli(Long.valueOf(meeting.getMediaStartTime())), ZoneId.systemDefault());
try {
String userid = meeting.getUserid();
if (!("woaJARCQAAftcvU6GGoOn66rdSZ4IrOA".equals(userid) || "woaJARCQAAfhfPfynkmZt6Fw5S9ot1Xw".equals(userid))) {// TODO临时代码
if (!"woaJARCQAAftcvU6GGoOn66rdSZ4IrOA".equals(userid) && !"woaJARCQAAfhfPfynkmZt6Fw5S9ot1Xw".equals(userid) && !"woaJARCQAA8KP5nZtSSQm2AlyfcSRQCg".equals(userid)) {// TODO临时代码
continue;
}
log.info("【会议检索】转录文件的meetingId->{},recordFileId->{}",meeting.getMeetingId(),meeting.getMeetingRecordId());
log.info("【周期会议扫描】:查询用户的已结束会议列表...meetingCode->{},userId->{}",meeting.getMeetingCode(), userid);
//获取子会议id
MeetingsApi.ApiV1HistoryMeetingsUseridGetRequest historyMeetingRequest =
......@@ -303,10 +304,10 @@ public class TencentMeetingServiceImpl extends ServiceImpl<TecentMeetingMapper,T
.build();
recordFileUrlList.add(recordFileItem);
meetingSaveList.add(meetingItem);
i++;
}
} catch (Exception e) {
e.printStackTrace();
continue;
}
}
}
......@@ -321,11 +322,14 @@ public class TencentMeetingServiceImpl extends ServiceImpl<TecentMeetingMapper,T
List<String> recordFileIdList = entry.getValue().stream().flatMap(s -> Arrays.stream(s.getRecordFileId().split(","))).collect(Collectors.toList());
meetingInfo.setRecordFileId(recordFileIdList.stream().collect(Collectors.joining(",")));
finalSaveList.add(meetingInfo);
meetingFiles.add(TencentMeetingVO.RecordFile.builder()
.meetingId(meetingInfo.getMeetingId())
.subMeetingId(meetingInfo.getSubMeetingId())
.recordFileIdList(recordFileIdList).build());
if (meetingInfo.getEmailPushAccess()) {
meetingFiles.add(TencentMeetingVO.RecordFile.builder()
.meetingId(meetingInfo.getMeetingId())
.subMeetingId(meetingInfo.getSubMeetingId())
.recordFileIdList(recordFileIdList).build());
}
}
meetingInfoMapper.batchInsert(finalSaveList);
}
} catch (Exception e) {
......@@ -437,7 +441,7 @@ public class TencentMeetingServiceImpl extends ServiceImpl<TecentMeetingMapper,T
// 3. 生成签名
String signature = SignatureUtil.generateSignature(tencentSecretId, tencentSecretKey, httpMethod, nonce, timestamp, uri, "");
log.info("fetchMeetingRecords params: {}, {}", page, pageSize);
// 4. 发送请求
try (CloseableHttpClient httpClient = HttpClients.createDefault()) {
HttpGet request = new HttpGet("https://api.meeting.qq.com" + uri);
......
......@@ -159,3 +159,5 @@ permission:
applicationId: ${PERMISSION_APPLiCATION_ID}
tenantId: ${PERMISSION_TENANT_ID}
admin-white_users: ${PERMISSION_ADMIN_WHITE_USERS}
isDev: true
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论