Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
C
cmeeting
概览
概览
详情
活动
周期分析
版本库
存储库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
Issue Boards
Open sidebar
翟斌
cmeeting
Commits
bc3b3633
提交
bc3b3633
authored
7月 23, 2025
作者:
洪东保
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
debug
父级
e75633ba
显示空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
27 行增加
和
24 行删除
+27
-24
src/main/java/com/cmeeting/controller/MeetingInfoController.java
+25
-24
src/main/java/com/cmeeting/email/EmailSender.java
+2
-0
没有找到文件。
src/main/java/com/cmeeting/controller/MeetingInfoController.java
浏览文件 @
bc3b3633
...
@@ -74,6 +74,7 @@ public class MeetingInfoController {
...
@@ -74,6 +74,7 @@ public class MeetingInfoController {
/**
/**
* 重新生成
* 重新生成
*
* @param vo
* @param vo
* @return
* @return
*/
*/
...
@@ -99,7 +100,7 @@ public class MeetingInfoController {
...
@@ -99,7 +100,7 @@ public class MeetingInfoController {
String
recordXml
=
vo
.
getRecordXml
();
String
recordXml
=
vo
.
getRecordXml
();
String
recordContent
=
vo
.
getRecordContent
();
String
recordContent
=
vo
.
getRecordContent
();
try
{
try
{
if
(
StringUtils
.
isNotEmpty
(
recordXml
))
{
if
(
StringUtils
.
isNotEmpty
(
recordXml
))
{
//xml转json,用于前端的表单回显
//xml转json,用于前端的表单回显
String
xml
=
minioUtils
.
getFileText
(
recordXml
);
String
xml
=
minioUtils
.
getFileText
(
recordXml
);
String
json
=
convertXmlToJSON
(
xml
);
String
json
=
convertXmlToJSON
(
xml
);
...
@@ -109,8 +110,8 @@ public class MeetingInfoController {
...
@@ -109,8 +110,8 @@ public class MeetingInfoController {
e
.
printStackTrace
();
e
.
printStackTrace
();
}
}
try
{
try
{
if
(
StringUtils
.
isNotEmpty
(
recordContent
))
{
if
(
StringUtils
.
isNotEmpty
(
recordContent
))
{
vo
.
setRecordContent
(
minioUtils
.
getFileText
(
recordContent
.
replaceAll
(
fileDownloadPath
,
""
)));
vo
.
setRecordContent
(
minioUtils
.
getFileText
(
recordContent
.
replaceAll
(
fileDownloadPath
,
""
)));
}
}
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
e
.
printStackTrace
();
...
@@ -122,7 +123,7 @@ public class MeetingInfoController {
...
@@ -122,7 +123,7 @@ public class MeetingInfoController {
* 导出转写原文
* 导出转写原文
*/
*/
@PostMapping
(
"/exportMeetingRecord"
)
@PostMapping
(
"/exportMeetingRecord"
)
public
void
exportMeetingRecord
(
@RequestBody
MeetingInfoVO
vo
,
HttpServletResponse
response
){
public
void
exportMeetingRecord
(
@RequestBody
MeetingInfoVO
vo
,
HttpServletResponse
response
)
{
try
{
try
{
MeetingInfo
meetingInfo
=
meetingInfoService
.
getById
(
vo
.
getId
());
MeetingInfo
meetingInfo
=
meetingInfoService
.
getById
(
vo
.
getId
());
String
content
=
minioUtils
.
getFileText
(
meetingInfo
.
getRecordContent
());
String
content
=
minioUtils
.
getFileText
(
meetingInfo
.
getRecordContent
());
...
@@ -157,19 +158,19 @@ public class MeetingInfoController {
...
@@ -157,19 +158,19 @@ public class MeetingInfoController {
* 导出会议纪要(本地下载)
* 导出会议纪要(本地下载)
*/
*/
@PostMapping
(
"/downloadMeetingMinutes"
)
@PostMapping
(
"/downloadMeetingMinutes"
)
public
void
downloadMeetingMinutes
(
@RequestBody
MeetingInfoVO
vo
,
HttpServletResponse
response
){
public
void
downloadMeetingMinutes
(
@RequestBody
MeetingInfoVO
vo
,
HttpServletResponse
response
)
{
try
{
try
{
MeetingInfo
meetingInfo
=
meetingInfoService
.
getById
(
vo
.
getId
());
MeetingInfo
meetingInfo
=
meetingInfoService
.
getById
(
vo
.
getId
());
String
xml
=
minioUtils
.
getFileText
(
meetingInfo
.
getRecordXml
());
String
xml
=
minioUtils
.
getFileText
(
meetingInfo
.
getRecordXml
());
Map
<
String
,
Object
>
dataModel
=
convertXmlToMap
(
xml
);
Map
<
String
,
Object
>
dataModel
=
convertXmlToMap
(
xml
);
//追加参会人员信息
//追加参会人员信息
Map
<
String
,
Object
>
participantsMap
=
new
ConcurrentHashMap
<>();
Map
<
String
,
Object
>
participantsMap
=
new
ConcurrentHashMap
<>();
DateTimeFormatter
df
=
DateTimeFormatter
.
ofPattern
(
"yyyy-MM-dd"
);
DateTimeFormatter
df
=
DateTimeFormatter
.
ofPattern
(
"yyyy-MM-dd"
);
String
meetingDate
=
meetingInfo
.
getStartTime
().
toLocalDate
().
format
(
df
);
String
meetingDate
=
meetingInfo
.
getStartTime
().
toLocalDate
().
format
(
df
);
participantsMap
.
put
(
"meeting_date"
,
meetingDate
);
participantsMap
.
put
(
"meeting_date"
,
meetingDate
);
participantsMap
.
put
(
"meeting_location"
,
"线上腾讯会议"
);
participantsMap
.
put
(
"meeting_location"
,
"线上腾讯会议"
);
participantsMap
.
put
(
"meeting_participants"
,
meetingInfo
.
getParticipantUsers
());
participantsMap
.
put
(
"meeting_participants"
,
meetingInfo
.
getParticipantUsers
());
participantsMap
.
put
(
"meeting_host"
,
meetingInfo
.
getHost
());
participantsMap
.
put
(
"meeting_host"
,
meetingInfo
.
getHost
());
dataModel
.
putAll
(
participantsMap
);
dataModel
.
putAll
(
participantsMap
);
MeetingRecordTemplate
meetingRecordTemplate
=
meetingRecordTemplateMapper
.
selectById
(
meetingInfo
.
getTemplateId
());
MeetingRecordTemplate
meetingRecordTemplate
=
meetingRecordTemplateMapper
.
selectById
(
meetingInfo
.
getTemplateId
());
...
@@ -180,7 +181,7 @@ public class MeetingInfoController {
...
@@ -180,7 +181,7 @@ public class MeetingInfoController {
response
.
setCharacterEncoding
(
"utf-8"
);
response
.
setCharacterEncoding
(
"utf-8"
);
response
.
setHeader
(
"Content-Disposition"
,
"attachment;filename="
+
URLEncoder
.
encode
(
fileName
,
"utf8"
));
response
.
setHeader
(
"Content-Disposition"
,
"attachment;filename="
+
URLEncoder
.
encode
(
fileName
,
"utf8"
));
XWPFTemplate
template
;
XWPFTemplate
template
;
try
(
InputStream
is
=
minioUtils
.
getFile
(
meetingRecordTemplate
.
getTemplate
());
OutputStream
os
=
response
.
getOutputStream
())
{
try
(
InputStream
is
=
minioUtils
.
getFile
(
meetingRecordTemplate
.
getTemplate
());
OutputStream
os
=
response
.
getOutputStream
())
{
template
=
XWPFTemplate
.
compile
(
is
).
render
(
dataModel
);
template
=
XWPFTemplate
.
compile
(
is
).
render
(
dataModel
);
template
.
write
(
os
);
template
.
write
(
os
);
}
catch
(
IOException
e
)
{
}
catch
(
IOException
e
)
{
...
@@ -198,25 +199,25 @@ public class MeetingInfoController {
...
@@ -198,25 +199,25 @@ public class MeetingInfoController {
* 导出会议纪要(推送邮件)
* 导出会议纪要(推送邮件)
*/
*/
@PostMapping
(
"/pushMeetingMinutes"
)
@PostMapping
(
"/pushMeetingMinutes"
)
public
R
exportMeetingMinutes
(
@RequestBody
MeetingInfoVO
vo
,
HttpServletResponse
response
){
public
R
exportMeetingMinutes
(
@RequestBody
MeetingInfoVO
vo
,
HttpServletResponse
response
)
{
try
{
try
{
MeetingInfo
meetingInfo
=
meetingInfoService
.
getById
(
vo
.
getId
());
MeetingInfo
meetingInfo
=
meetingInfoService
.
getById
(
vo
.
getId
());
String
xml
=
minioUtils
.
getFileText
(
meetingInfo
.
getRecordXml
());
String
xml
=
minioUtils
.
getFileText
(
meetingInfo
.
getRecordXml
());
Map
<
String
,
Object
>
dataModel
=
convertXmlToMap
(
xml
);
Map
<
String
,
Object
>
dataModel
=
convertXmlToMap
(
xml
);
//追加参会人员信息
//追加参会人员信息
Map
<
String
,
Object
>
participantsMap
=
new
ConcurrentHashMap
<>();
Map
<
String
,
Object
>
participantsMap
=
new
ConcurrentHashMap
<>();
DateTimeFormatter
df
=
DateTimeFormatter
.
ofPattern
(
"yyyy-MM-dd"
);
DateTimeFormatter
df
=
DateTimeFormatter
.
ofPattern
(
"yyyy-MM-dd"
);
String
meetingDate
=
meetingInfo
.
getStartTime
().
toLocalDate
().
format
(
df
);
String
meetingDate
=
meetingInfo
.
getStartTime
().
toLocalDate
().
format
(
df
);
participantsMap
.
put
(
"meeting_date"
,
meetingDate
);
participantsMap
.
put
(
"meeting_date"
,
meetingDate
);
participantsMap
.
put
(
"meeting_location"
,
"线上腾讯会议"
);
participantsMap
.
put
(
"meeting_location"
,
"线上腾讯会议"
);
participantsMap
.
put
(
"meeting_participants"
,
meetingInfo
.
getParticipantUsers
());
participantsMap
.
put
(
"meeting_participants"
,
meetingInfo
.
getParticipantUsers
());
participantsMap
.
put
(
"meeting_host"
,
meetingInfo
.
getHost
());
participantsMap
.
put
(
"meeting_host"
,
meetingInfo
.
getHost
());
dataModel
.
putAll
(
participantsMap
);
dataModel
.
putAll
(
participantsMap
);
MeetingRecordTemplate
meetingRecordTemplate
=
meetingRecordTemplateMapper
.
selectById
(
meetingInfo
.
getTemplateId
());
MeetingRecordTemplate
meetingRecordTemplate
=
meetingRecordTemplateMapper
.
selectById
(
meetingInfo
.
getTemplateId
());
XWPFTemplate
template
;
XWPFTemplate
template
;
byte
[]
meetingMinutesBytes
;
byte
[]
meetingMinutesBytes
;
try
(
InputStream
is
=
minioUtils
.
getFile
(
meetingRecordTemplate
.
getTemplate
());
ByteArrayOutputStream
baos
=
new
ByteArrayOutputStream
())
{
try
(
InputStream
is
=
minioUtils
.
getFile
(
meetingRecordTemplate
.
getTemplate
());
ByteArrayOutputStream
baos
=
new
ByteArrayOutputStream
())
{
template
=
XWPFTemplate
.
compile
(
is
).
render
(
dataModel
);
template
=
XWPFTemplate
.
compile
(
is
).
render
(
dataModel
);
template
.
write
(
baos
);
template
.
write
(
baos
);
meetingMinutesBytes
=
baos
.
toByteArray
();
meetingMinutesBytes
=
baos
.
toByteArray
();
...
@@ -226,7 +227,7 @@ public class MeetingInfoController {
...
@@ -226,7 +227,7 @@ public class MeetingInfoController {
List
<
EmailPush
.
Attachment
>
attachments
=
new
ArrayList
<>();
List
<
EmailPush
.
Attachment
>
attachments
=
new
ArrayList
<>();
DateTimeFormatter
fmt
=
DateTimeFormatter
.
ofPattern
(
"yyyyMMdd"
);
DateTimeFormatter
fmt
=
DateTimeFormatter
.
ofPattern
(
"yyyyMMdd"
);
EmailPush
.
Attachment
attachment
=
EmailPush
.
Attachment
.
builder
().
name
(
meetingInfo
.
getSubject
()
+
"会议纪要_"
+
fmt
.
format
(
meetingInfo
.
getStartTime
())).
bytes
(
meetingMinutesBytes
).
build
();
EmailPush
.
Attachment
attachment
=
EmailPush
.
Attachment
.
builder
().
name
(
meetingInfo
.
getSubject
()
+
"会议纪要_"
+
fmt
.
format
(
meetingInfo
.
getStartTime
())).
bytes
(
meetingMinutesBytes
).
build
();
attachments
.
add
(
attachment
);
attachments
.
add
(
attachment
);
String
hostUid
=
meetingInfo
.
getHostUid
();
String
hostUid
=
meetingInfo
.
getHostUid
();
String
userCode
=
userIdMapper
.
getWidByTid
(
hostUid
);
String
userCode
=
userIdMapper
.
getWidByTid
(
hostUid
);
...
@@ -261,10 +262,10 @@ public class MeetingInfoController {
...
@@ -261,10 +262,10 @@ public class MeetingInfoController {
Map
<?,
?>
xmlMap
=
xmlMapper
.
readValue
(
xml
,
Map
.
class
);
Map
<?,
?>
xmlMap
=
xmlMapper
.
readValue
(
xml
,
Map
.
class
);
// 转换为更标准的 Map<String, Object>
// 转换为更标准的 Map<String, Object>
Map
<
String
,
Object
>
map
=
objectMapper
.
convertValue
(
xmlMap
,
Map
.
class
);
Map
<
String
,
Object
>
map
=
objectMapper
.
convertValue
(
xmlMap
,
Map
.
class
);
//特殊处理map格式
//特殊处理map格式
for
(
Map
.
Entry
<
String
,
Object
>
entry
:
map
.
entrySet
())
{
for
(
Map
.
Entry
<
String
,
Object
>
entry
:
map
.
entrySet
())
{
Map
<
String
,
Object
>
value
=
(
Map
<
String
,
Object
>)
entry
.
getValue
();
Map
<
String
,
Object
>
value
=
(
Map
<
String
,
Object
>)
entry
.
getValue
();
Object
realValue
=
value
.
get
(
""
);
Object
realValue
=
value
.
get
(
""
);
entry
.
setValue
(
realValue
);
entry
.
setValue
(
realValue
);
}
}
...
@@ -280,15 +281,15 @@ public class MeetingInfoController {
...
@@ -280,15 +281,15 @@ public class MeetingInfoController {
// 正确获取节点和属性的方式
// 正确获取节点和属性的方式
List
<
Map
>
list
=
new
ArrayList
<>();
List
<
Map
>
list
=
new
ArrayList
<>();
Iterator
<
String
>
iterator
=
rootNode
.
fieldNames
();
Iterator
<
String
>
iterator
=
rootNode
.
fieldNames
();
while
(
iterator
.
hasNext
()){
while
(
iterator
.
hasNext
())
{
String
tagName
=
iterator
.
next
();
String
tagName
=
iterator
.
next
();
JsonNode
subNode
=
rootNode
.
path
(
tagName
);
JsonNode
subNode
=
rootNode
.
path
(
tagName
);
String
displayName
=
subNode
.
path
(
"label"
).
asText
();
String
displayName
=
subNode
.
path
(
"label"
).
asText
();
String
content
=
subNode
.
path
(
""
).
asText
();
String
content
=
subNode
.
path
(
""
).
asText
();
list
.
add
(
new
HashMap
(){{
list
.
add
(
new
HashMap
()
{{
put
(
"key"
,
tagName
);
put
(
"key"
,
tagName
);
put
(
"keyName"
,
displayName
);
put
(
"keyName"
,
displayName
);
put
(
"value"
,
content
);
put
(
"value"
,
content
);
}});
}});
}
}
// 构建JSON对象
// 构建JSON对象
...
...
src/main/java/com/cmeeting/email/EmailSender.java
浏览文件 @
bc3b3633
...
@@ -243,12 +243,14 @@ public class EmailSender {
...
@@ -243,12 +243,14 @@ public class EmailSender {
processLogService
.
log
(
meetingId
,
subMeetingId
,
"【邮件推送异常】:收件人工号不能为空"
);
processLogService
.
log
(
meetingId
,
subMeetingId
,
"【邮件推送异常】:收件人工号不能为空"
);
continue
;
continue
;
}
}
// TODO
String
email_content_template
=
String
.
valueOf
(
redisUtils
.
get
(
"EMAIL_CONTENT_TEMPLATE"
));
String
email_content_template
=
String
.
valueOf
(
redisUtils
.
get
(
"EMAIL_CONTENT_TEMPLATE"
));
long
expireTimestamp
=
ZonedDateTime
.
now
().
plusDays
(
2
).
toInstant
().
toEpochMilli
();
long
expireTimestamp
=
ZonedDateTime
.
now
().
plusDays
(
2
).
toInstant
().
toEpochMilli
();
body
.
content
=
MessageFormat
.
format
(
email_content_template
,
meetingInstanceId
,
toUserCode
,
String
.
valueOf
(
expireTimestamp
));
body
.
content
=
MessageFormat
.
format
(
email_content_template
,
meetingInstanceId
,
toUserCode
,
String
.
valueOf
(
expireTimestamp
));
}
else
{
}
else
{
isSent
=
false
;
isSent
=
false
;
processLogService
.
log
(
meetingId
,
subMeetingId
,
"【邮件推送异常】:邮件模板未设置"
);
processLogService
.
log
(
meetingId
,
subMeetingId
,
"【邮件推送异常】:邮件模板未设置"
);
retryCount
.
getAndIncrement
();
continue
;
continue
;
}
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论