Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
C
cmeeting
概览
概览
详情
活动
周期分析
版本库
存储库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
Issue Boards
Open sidebar
翟斌
cmeeting
Commits
49471a66
提交
49471a66
authored
7月 31, 2025
作者:
洪东保
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
多线程多活保证任务无重复消费
父级
e7bd4c9b
显示空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
39 行增加
和
9 行删除
+39
-9
src/main/java/com/cmeeting/job/CmeetingJob.java
+29
-7
src/main/java/com/cmeeting/job/FileProcessTask.java
+10
-1
src/main/java/com/cmeeting/service/FileProcessProducer.java
+0
-1
没有找到文件。
src/main/java/com/cmeeting/job/CmeetingJob.java
浏览文件 @
49471a66
...
...
@@ -8,6 +8,7 @@ import com.cmeeting.pojo.MeetingInfo;
import
com.cmeeting.pojo.UserId
;
import
com.cmeeting.pojo.WeComUser
;
import
com.cmeeting.service.*
;
import
com.cmeeting.util.RedisUtils
;
import
com.cmeeting.vo.TencentMeetingVO
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -43,6 +44,8 @@ public class CmeetingJob {
private
UserIdMapper
userIdMapper
;
@Value
(
"${isDev}"
)
private
Boolean
isDev
;
@Resource
private
RedisUtils
redisUtils
;
// @PostConstruct
public
void
weComUserInit
(){
...
...
@@ -107,23 +110,27 @@ public class CmeetingJob {
if
(
isDev
)
{
return
;
}
if
(
redisUtils
.
setnx
(
"Scheduled-All"
,
"Scheduled-All"
,
18
*
60
)){
return
;
}
try
{
//查出企微id和腾会id的关联关系
List
<
UserId
>
userIdRelations
=
userIdMapper
.
selectList
(
null
);
Map
<
String
,
String
>
widTidRelations
=
userIdRelations
.
stream
().
collect
(
Collectors
.
toMap
(
UserId:
:
getWid
,
UserId:
:
getTid
));
Map
<
String
,
String
>
tidWidRelations
=
userIdRelations
.
stream
().
collect
(
Collectors
.
toMap
(
UserId:
:
getTid
,
UserId:
:
getWid
));
Map
<
String
,
String
>
widTidRelations
=
userIdRelations
.
stream
().
collect
(
Collectors
.
toMap
(
UserId:
:
getWid
,
UserId:
:
getTid
));
Map
<
String
,
String
>
tidWidRelations
=
userIdRelations
.
stream
().
collect
(
Collectors
.
toMap
(
UserId:
:
getTid
,
UserId:
:
getWid
));
//查出企微的人员信息
List
<
WeComUser
>
weComUserList
=
weComService
.
list
();
Map
<
String
,
WeComUser
>
weComUserMap
=
weComUserList
.
stream
().
collect
(
Collectors
.
toMap
(
WeComUser:
:
getUserId
,
Function
.
identity
()));
Map
<
String
,
WeComUser
>
weComUserMap
=
weComUserList
.
stream
().
collect
(
Collectors
.
toMap
(
WeComUser:
:
getUserId
,
Function
.
identity
()));
//智能体授权人员
List
<
UserDTO
>
accessUserIds
=
tencentMeetingService
.
getAccessUserIds
(
widTidRelations
);
if
(
CollectionUtils
.
isEmpty
(
accessUserIds
))
{
log
.
info
(
"无生成纪要权限的人员"
);
return
;
}
else
{
log
.
info
(
"生成纪要权限人员:->{}"
,
accessUserIds
.
toString
());
}
else
{
log
.
info
(
"生成纪要权限人员:->{}"
,
accessUserIds
.
toString
());
}
List
<
TencentMeetingVO
.
RecordFile
>
meetingFiles
=
tencentMeetingService
.
getMeetingFiles
(
accessUserIds
,
weComUserMap
);
List
<
TencentMeetingVO
.
RecordFile
>
meetingFiles
=
tencentMeetingService
.
getMeetingFiles
(
accessUserIds
,
weComUserMap
);
if
(
meetingFiles
==
null
||
meetingFiles
.
isEmpty
())
{
log
.
info
(
"没有录制文件需要处理"
);
...
...
@@ -134,7 +141,12 @@ public class CmeetingJob {
List
<
UserDTO
.
TemplateAuthorizedUserDTO
>
authorizedUsers
=
meetingRecordTemplateService
.
selectAuthorizedUsers
();
// 提交处理任务
producer
.
submitBatchTasks
(
meetingFiles
,
authorizedUsers
,
tidWidRelations
,
Boolean
.
FALSE
);
producer
.
submitBatchTasks
(
meetingFiles
,
authorizedUsers
,
tidWidRelations
,
Boolean
.
FALSE
);
}
catch
(
Exception
e
){
e
.
printStackTrace
();
}
finally
{
redisUtils
.
del
(
"Scheduled-All"
);
}
}
...
...
@@ -146,6 +158,9 @@ public class CmeetingJob {
if
(
isDev
)
{
return
;
}
if
(
redisUtils
.
setnx
(
"Scheduled-retry"
,
"Scheduled-retry"
,
28
*
60
)){
return
;
}
try
{
log
.
info
(
"-------生成纪要重试定时任务开始-------"
);
log
.
info
(
"当前时间: "
+
LocalDate
.
now
().
format
(
DateTimeFormatter
.
ISO_LOCAL_DATE
));
...
...
@@ -185,6 +200,8 @@ public class CmeetingJob {
log
.
info
(
"-------生成纪要重试定时任务结束--------"
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
finally
{
redisUtils
.
del
(
"Scheduled-retry"
);
}
}
...
...
@@ -196,6 +213,9 @@ public class CmeetingJob {
if
(
isDev
)
{
return
;
}
if
(
redisUtils
.
setnx
(
"Scheduled-email-retry"
,
"Scheduled-email-retry"
,
28
*
60
)){
return
;
}
try
{
log
.
info
(
"-------邮件推送重试定时任务开始-------"
);
log
.
info
(
"当前时间: "
+
LocalDate
.
now
().
format
(
DateTimeFormatter
.
ISO_LOCAL_DATE
));
...
...
@@ -230,6 +250,8 @@ public class CmeetingJob {
log
.
info
(
"-------邮件推送重试定时任务结束--------"
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
finally
{
redisUtils
.
del
(
"Scheduled-email-retry"
);
}
}
}
src/main/java/com/cmeeting/job/FileProcessTask.java
浏览文件 @
49471a66
...
...
@@ -112,7 +112,7 @@ public class FileProcessTask {
public
void
process
()
{
boolean
isSuccess
=
false
;
String
key
=
"meet_process"
+
meetingId
+
"_"
+
(
subMeetingId
==
null
?
""
:
"subMeetingId"
);
if
(!
redisUtils
.
setnx
(
key
,
1
,
18
0
))
{
if
(!
redisUtils
.
setnx
(
key
,
1
,
24
0
))
{
log
.
warn
(
"key already exists in redis!, key: {}"
,
key
);
return
;
}
...
...
@@ -129,6 +129,10 @@ public class FileProcessTask {
MeetingInfo
meetingInfo
=
meetingInfoMapper
.
selectOne
(
new
LambdaQueryWrapper
<
MeetingInfo
>()
.
eq
(
MeetingInfo:
:
getMeetingId
,
meetingId
)
.
eq
(
subMeetingId
!=
null
,
MeetingInfo:
:
getSubMeetingId
,
subMeetingId
));
if
(
meetingInfo
.
getIsGenerated
())
{
log
.
warn
(
"Generating is down, meetingId: {}, subMeetingId: {}"
,
meetingInfo
.
getMeetingId
(),
meetingInfo
.
getSubMeetingId
());
return
;
}
if
(!
meetingInfo
.
getEmailPushAccess
())
{
log
.
warn
(
"会议主持人没有推送邮件权限, userId: {}"
,
meetingInfo
.
getHostUid
());
return
;
...
...
@@ -780,4 +784,8 @@ public class FileProcessTask {
this
.
permTenantId
=
permTenantId
;
this
.
aesKey
=
aesKey
;
}
public
String
getId
(){
return
this
.
meetingId
+
(
this
.
subMeetingId
==
null
?
""
:
this
.
subMeetingId
);
}
}
\ No newline at end of file
src/main/java/com/cmeeting/service/FileProcessProducer.java
浏览文件 @
49471a66
...
...
@@ -123,7 +123,6 @@ public class FileProcessProducer {
task
.
process
();
callbackHandler
.
onComplete
(
task
);
// 回调处理
});
futures
.
add
(
future
);
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论