|
@@ -146,6 +146,22 @@ public class EmailTemplateInfoServiceImpl implements EmailTemplateInfoService {
|
|
emailTemplateInfoMapper.updateTemplateInfo(emailTemplateInfoDO);
|
|
emailTemplateInfoMapper.updateTemplateInfo(emailTemplateInfoDO);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ @Override
|
|
|
|
+ public SaveTemplateInfoVO searchTemplateInfo(Integer id) {
|
|
|
|
+ SaveTemplateInfoVO vo = new SaveTemplateInfoVO();
|
|
|
|
+ EmailTemplateInfoDO emailTemplateInfoDO = emailTemplateInfoMapper.searchTemplateById(id);
|
|
|
|
+ vo.setEmailTemplateInfoVO(emailTemplateInfoDO.toVO());
|
|
|
|
+ List<Integer> idList = new ArrayList<>();
|
|
|
|
+ idList.add(id);
|
|
|
|
+ List<EmailTemplateDataRuleDO> ruleDOList = emailTemplateDataRuleMapper.queryByTemplateId(idList);
|
|
|
|
+ List<EmailTemplateDataRuleVO> ruleVOList = ruleDOList.stream().map(EmailTemplateDataRuleDO::toVO).collect(Collectors.toList());
|
|
|
|
+ vo.setEmailTemplateDataRuleVOList(ruleVOList);
|
|
|
|
+ List<EmailTemplateApplicationRuleDO> applicationRuleDOList = emailTemplateApplicationRuleMapper.queryByTemplateId(idList);
|
|
|
|
+ List<EmailTemplateApplicationRuleVO> applicationRuleVOList = applicationRuleDOList.stream().map(EmailTemplateApplicationRuleDO::toVO).collect(Collectors.toList());
|
|
|
|
+ vo.setEmailTemplateApplicationRuleVOList(applicationRuleVOList);
|
|
|
|
+ return vo;
|
|
|
|
+ }
|
|
|
|
+
|
|
private EmailTemplateApplicationRuleDO toEmailTemplateApplicationRuleDO(EmailTemplateApplicationRuleVO applicationRuleVO) {
|
|
private EmailTemplateApplicationRuleDO toEmailTemplateApplicationRuleDO(EmailTemplateApplicationRuleVO applicationRuleVO) {
|
|
Integer userId = UserUtils.getLoginUser().getUserId();
|
|
Integer userId = UserUtils.getLoginUser().getUserId();
|
|
EmailTemplateApplicationRuleDO applicationRuleDO = new EmailTemplateApplicationRuleDO();
|
|
EmailTemplateApplicationRuleDO applicationRuleDO = new EmailTemplateApplicationRuleDO();
|