|
@@ -18,6 +18,7 @@ import com.fdkankan.sms.SendMailAcceUtils;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
|
+import org.springframework.cloud.context.config.annotation.RefreshScope;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import java.io.File;
|
|
import java.io.File;
|
|
@@ -25,6 +26,7 @@ import java.util.*;
|
|
|
|
|
|
@Slf4j
|
|
@Slf4j
|
|
@Service
|
|
@Service
|
|
|
|
+@RefreshScope
|
|
public class CommonServiceImpl implements ICommonService {
|
|
public class CommonServiceImpl implements ICommonService {
|
|
|
|
|
|
@Value("${main.url}")
|
|
@Value("${main.url}")
|
|
@@ -33,6 +35,12 @@ public class CommonServiceImpl implements ICommonService {
|
|
@Value("${env:gn}")
|
|
@Value("${env:gn}")
|
|
private String env;
|
|
private String env;
|
|
|
|
|
|
|
|
+ @Value("${helpLink:zh-cn:https://docs.4dkankan.com/#/product/4dkk/zh-cn/README}")
|
|
|
|
+ private String helpLinkZh;
|
|
|
|
+
|
|
|
|
+ @Value("${helpLink:zh-cn:https://docs.4dkankan.com/#/product/4dkk/en-us/README}")
|
|
|
|
+ private String helpLinkEn;
|
|
|
|
+
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
private FYunFileServiceInterface fYunFileServiceInterface;
|
|
private FYunFileServiceInterface fYunFileServiceInterface;
|
|
@@ -191,15 +199,16 @@ public class CommonServiceImpl implements ICommonService {
|
|
String toEmail = user.getUserName();
|
|
String toEmail = user.getUserName();
|
|
ScenePlusExt scenePlusExt = scenePlusExtService.getScenePlusExtByPlusId(scenePlus.getId());
|
|
ScenePlusExt scenePlusExt = scenePlusExtService.getScenePlusExtByPlusId(scenePlus.getId());
|
|
String sceneLink = scenePlusExt.getWebSite();
|
|
String sceneLink = scenePlusExt.getWebSite();
|
|
- String helpLink = mainUrl + "/#/service/use/help ";
|
|
|
|
|
|
+ String helpLink = helpLinkEn;
|
|
String lang = "en";
|
|
String lang = "en";
|
|
if("gn".equals(env)){
|
|
if("gn".equals(env)){
|
|
lang = "zh";
|
|
lang = "zh";
|
|
|
|
+ helpLink = helpLinkZh;
|
|
}
|
|
}
|
|
sceneLink += "&lang=" + lang;
|
|
sceneLink += "&lang=" + lang;
|
|
|
|
|
|
MailTemplate mailTemplate = mailTemplateService.getOne(new LambdaQueryWrapper<MailTemplate>().eq(MailTemplate::getRemark, "计算完成").eq(MailTemplate::getLang, lang));
|
|
MailTemplate mailTemplate = mailTemplateService.getOne(new LambdaQueryWrapper<MailTemplate>().eq(MailTemplate::getRemark, "计算完成").eq(MailTemplate::getLang, lang));
|
|
- String content = mailTemplate.getMsg().replaceAll("scene_link", sceneLink).replaceAll("help_link", helpLink);
|
|
|
|
|
|
+ String content = mailTemplate.getMsg().replaceAll("scene_name", scenePlus.getTitle()).replaceAll("scene_link", sceneLink).replaceAll("help_link", helpLink);
|
|
SendMailAcceUtils.sendMail(mailTemplate.getSendMail(), mailTemplate.getSendPassword(), mailTemplate.getSendHost(), toEmail, mailTemplate.getSubject(), content, null);
|
|
SendMailAcceUtils.sendMail(mailTemplate.getSendMail(), mailTemplate.getSendPassword(), mailTemplate.getSendHost(), toEmail, mailTemplate.getSubject(), content, null);
|
|
}catch (Exception e){
|
|
}catch (Exception e){
|
|
log.warn("发送邮件失败,num:{}", num);
|
|
log.warn("发送邮件失败,num:{}", num);
|