Merge pull request #1564 from dataease/pr@dev@fix_邮件截图报错

fix: 邮件截图报错
This commit is contained in:
fit2cloud-chenyw 2021-12-30 12:39:06 +08:00 committed by GitHub
commit 8fb3d3490f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -20,7 +20,6 @@ import io.dataease.service.system.EmailService;
import org.apache.commons.lang3.ObjectUtils; import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.quartz.*; import org.quartz.*;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.annotation.Resource; import javax.annotation.Resource;
@ -67,13 +66,10 @@ public class EmailTaskHandler extends TaskHandler implements Job {
XpackEmailTemplateDTO emailTemplate = (XpackEmailTemplateDTO) jobDataMap.get("emailTemplate"); XpackEmailTemplateDTO emailTemplate = (XpackEmailTemplateDTO) jobDataMap.get("emailTemplate");
SysUserEntity creator = (SysUserEntity) jobDataMap.get("creator"); SysUserEntity creator = (SysUserEntity) jobDataMap.get("creator");
proxy().sendReport(taskInstance, emailTemplate, creator); sendReport(taskInstance, emailTemplate, creator);
} }
public EmailTaskHandler proxy() {
return CommonBeanFactory.getBean(EmailTaskHandler.class);
}
public Long saveInstance(GlobalTaskInstance taskInstance) { public Long saveInstance(GlobalTaskInstance taskInstance) {
EmailXpackService emailXpackService = SpringContextUtil.getBean(EmailXpackService.class); EmailXpackService emailXpackService = SpringContextUtil.getBean(EmailXpackService.class);
@ -102,7 +98,7 @@ public class EmailTaskHandler extends TaskHandler implements Job {
emailXpackService.saveInstance(taskInstance); emailXpackService.saveInstance(taskInstance);
} }
@Async
public void sendReport(GlobalTaskInstance taskInstance, XpackEmailTemplateDTO emailTemplateDTO, public void sendReport(GlobalTaskInstance taskInstance, XpackEmailTemplateDTO emailTemplateDTO,
SysUserEntity user) { SysUserEntity user) {
EmailXpackService emailXpackService = SpringContextUtil.getBean(EmailXpackService.class); EmailXpackService emailXpackService = SpringContextUtil.getBean(EmailXpackService.class);