|
@@ -16,7 +16,6 @@ import com.fdkankan.ucenter.common.OssPath;
|
|
|
import com.fdkankan.ucenter.common.PageInfo;
|
|
import com.fdkankan.ucenter.common.PageInfo;
|
|
|
import com.fdkankan.ucenter.common.RandomCodeUtil;
|
|
import com.fdkankan.ucenter.common.RandomCodeUtil;
|
|
|
import com.fdkankan.ucenter.common.constants.NacosProperty;
|
|
import com.fdkankan.ucenter.common.constants.NacosProperty;
|
|
|
-import com.fdkankan.ucenter.config.ThreadPoolConfig;
|
|
|
|
|
import com.fdkankan.ucenter.entity.*;
|
|
import com.fdkankan.ucenter.entity.*;
|
|
|
import com.fdkankan.ucenter.mapper.IInvoiceMapper;
|
|
import com.fdkankan.ucenter.mapper.IInvoiceMapper;
|
|
|
import com.fdkankan.ucenter.service.*;
|
|
import com.fdkankan.ucenter.service.*;
|
|
@@ -31,6 +30,7 @@ import org.apache.commons.lang3.StringUtils;
|
|
|
import org.aspectj.weaver.ast.Or;
|
|
import org.aspectj.weaver.ast.Or;
|
|
|
import org.springframework.beans.BeanUtils;
|
|
import org.springframework.beans.BeanUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
+import org.springframework.beans.factory.annotation.Qualifier;
|
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
|
|
import java.math.BigDecimal;
|
|
import java.math.BigDecimal;
|
|
@@ -39,6 +39,7 @@ import java.util.Date;
|
|
|
import java.util.HashMap;
|
|
import java.util.HashMap;
|
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
import java.util.Set;
|
|
import java.util.Set;
|
|
|
|
|
+import java.util.concurrent.Executor;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* <p>
|
|
* <p>
|
|
@@ -251,11 +252,12 @@ public class InvoiceServiceImpl extends ServiceImpl<IInvoiceMapper, Invoice> imp
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
|
- ThreadPoolConfig threadPoolConfig;
|
|
|
|
|
|
|
+ @Qualifier("taskExecutor")
|
|
|
|
|
+ private Executor taskExecutor;
|
|
|
|
|
|
|
|
private void sendEmail(Invoice dbEntity) {
|
|
private void sendEmail(Invoice dbEntity) {
|
|
|
//国际服直接发送邮件
|
|
//国际服直接发送邮件
|
|
|
- threadPoolConfig.taskExecutor().execute(() -> {
|
|
|
|
|
|
|
+ taskExecutor.execute(() -> {
|
|
|
log.info("异步任务执行,当前线程:" + Thread.currentThread().getName());
|
|
log.info("异步任务执行,当前线程:" + Thread.currentThread().getName());
|
|
|
if("aws".equals(NacosProperty.uploadType) && dbEntity.getEmailAddress() != null){
|
|
if("aws".equals(NacosProperty.uploadType) && dbEntity.getEmailAddress() != null){
|
|
|
MailTemplate mailTemplate = mailTemplateService.getTemplate(14, "en");
|
|
MailTemplate mailTemplate = mailTemplateService.getTemplate(14, "en");
|