提交 ee9a4269 作者: duanxincheng

GraphApi接入推送邮件

父级 1a40d520
......@@ -73,9 +73,6 @@
<version>3.1</version>
</dependency>
<dependency>
<groupId>com.microsoft.graph</groupId>
<artifactId>microsoft-graph-auth</artifactId>
<version>0.3.0</version>
......
......@@ -38,15 +38,15 @@ public class CmeetingJob {
@Autowired
private FileProcessProducer producer;
// @PostConstruct
// public void weComUserInit(){
// weComUserSync();
// }
//
// @PostConstruct
// public void tencentUserInit(){
// TencentUserSync();
// }
@PostConstruct
public void weComUserInit(){
weComUserSync();
}
@PostConstruct
public void tencentUserInit(){
TencentUserSync();
}
/**
* 企微人员定时同步
......
......@@ -267,9 +267,9 @@ public class FileProcessTask {
// 将xml格式的内容转换为特殊json
String json = convertXmlToJSON(xml);
String recordContentPath = meetingId + "-recordContent-" + IdUtil.fastSimpleUUID() + "txt";
minioUtils.upload(recordContentPath,recordData);
String recordXmlPath = meetingId + "-recordXmlPath-" + IdUtil.fastSimpleUUID() + "xml";
try {
minioUtils.upload(recordContentPath,recordData);
//写入json文件,这里的json文件用于用户可编辑
Files.write(Paths.get(targetPath), json.getBytes());
log.info("json文件已保存到: {}", targetPath);
......@@ -312,8 +312,17 @@ public class FileProcessTask {
if(meetingInfo.getEmailPushAccess()){
log.info("用户允许邮件推送,准备推送邮件至{}------",meetingInfo.getEmail());
//邮件推送
// isPushed = emailSender.sendEmailWithAttachment("duanxincheng@chatbot.cn",meetingName,path + targetFileName + ".docx",meetingId);
isPushed = emailSender.sendEmailWithAttachment(meetingInfo.getEmail(),meetingName,path + targetFileName + ".docx",meetingId);
isPushed = emailSender.sendEmailWithAttachment("duanxincheng@chatbot.cn",meetingName,path + targetFileName + ".docx",meetingId);
try {
// isPushed = emailSender.sendEmailWithAttachment(meetingInfo.getEmail(),meetingName,path + targetFileName + ".docx",meetingId);
} catch (Exception e) {
log.error("邮件推送失败: {}", e.getMessage(), e);
StringWriter sw = new StringWriter();
PrintWriter pw = new PrintWriter(sw);
e.printStackTrace(pw);
processLogService.log(meetingId,subMeetingId,"【邮件推送】:"+sw.toString());
throw new RuntimeException(e);
}
if(isPushed)
processLogService.log(meetingId,subMeetingId,"用户允许邮件推送,推送邮件至"+meetingInfo.getEmail());
// emailSender.sendEmailWithAttachment("xuwentao@chatbot.cn",meetingName,path + targetFileName + ".docx",meetingId);
......
......@@ -103,7 +103,7 @@ public class TecentMeetingServiceImpl extends ServiceImpl<TecentMeetingMapper,Te
// 检查重名并设置标志
markDuplicateNamesTecent(users);
// 批量插入数据库(分批次)
int batchSize = 10;
int batchSize = 1000;
for (int i = 0; i < users.size(); i += batchSize) {
List<TencentMeetingUser> batch = users.subList(i, Math.min(i + batchSize, users.size()));
batchInsert(batch);
......@@ -123,7 +123,7 @@ public class TecentMeetingServiceImpl extends ServiceImpl<TecentMeetingMapper,Te
// 查询近两天的会议录制列表
try {
ZonedDateTime now = ZonedDateTime.now();
String startTime = String.valueOf(now.minusDays(5).toEpochSecond());
String startTime = String.valueOf(now.minusDays(2).toEpochSecond());
String endTime = String.valueOf(now.toEpochSecond());
AtomicInteger currentPage = new AtomicInteger(1);
Long totalPage = 1L;
......
......@@ -22,6 +22,6 @@
SELECT * FROM user_tencentmeeting
</select>
<select id="getUsernameByUserId" resultType="java.lang.String">
SELECT user_name FROM user_tencentmeeting where user_id = #{userId}
SELECT user_name FROM user_tencentmeeting where user_id = #{userId} limit 1
</select>
</mapper>
\ No newline at end of file
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论