提交 ee9a4269 作者: duanxincheng

GraphApi接入推送邮件

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