|
@@ -116,21 +116,13 @@ public class EmailTemplateInfoServiceImpl implements EmailTemplateInfoService {
|
|
Integer userId = UserUtils.getLoginUser().getUserId();
|
|
Integer userId = UserUtils.getLoginUser().getUserId();
|
|
emailTemplateApplicationRuleMapper.deleteByTemplateId(templateIdList,userId);
|
|
emailTemplateApplicationRuleMapper.deleteByTemplateId(templateIdList,userId);
|
|
List<EmailTemplateApplicationRuleDO> addList = new ArrayList<>();
|
|
List<EmailTemplateApplicationRuleDO> addList = new ArrayList<>();
|
|
- List<EmailTemplateApplicationRuleDO> editList = new ArrayList<>();
|
|
|
|
for(EmailTemplateApplicationRuleVO applicationRuleVO : emailTemplateApplicationRuleVOList){
|
|
for(EmailTemplateApplicationRuleVO applicationRuleVO : emailTemplateApplicationRuleVOList){
|
|
EmailTemplateApplicationRuleDO applicationRuleDO = toEmailTemplateApplicationRuleDO(applicationRuleVO);
|
|
EmailTemplateApplicationRuleDO applicationRuleDO = toEmailTemplateApplicationRuleDO(applicationRuleVO);
|
|
- if(StringUtil.isNull(applicationRuleDO.getId())){
|
|
|
|
- addList.add(applicationRuleDO);
|
|
|
|
- }else{
|
|
|
|
- editList.add(applicationRuleDO);
|
|
|
|
- }
|
|
|
|
|
|
+ addList.add(applicationRuleDO);
|
|
}
|
|
}
|
|
if(addList.size() > 0){
|
|
if(addList.size() > 0){
|
|
emailTemplateApplicationRuleMapper.batchInsert(addList);
|
|
emailTemplateApplicationRuleMapper.batchInsert(addList);
|
|
}
|
|
}
|
|
- if(editList.size() > 0){
|
|
|
|
- emailTemplateApplicationRuleMapper.batchUpdate(editList);
|
|
|
|
- }
|
|
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
}
|
|
@@ -181,10 +173,8 @@ public class EmailTemplateInfoServiceImpl implements EmailTemplateInfoService {
|
|
applicationRuleDO.setType(applicationRuleVO.getType());
|
|
applicationRuleDO.setType(applicationRuleVO.getType());
|
|
applicationRuleDO.setUpdaterId(userId);
|
|
applicationRuleDO.setUpdaterId(userId);
|
|
applicationRuleDO.setUpdateTime(DateUtils.getNowDate());
|
|
applicationRuleDO.setUpdateTime(DateUtils.getNowDate());
|
|
- if(StringUtil.isNull(applicationRuleDO.getId())){
|
|
|
|
- applicationRuleDO.setCreateTime(DateUtils.getNowDate());
|
|
|
|
- applicationRuleDO.setCreatorId(userId);
|
|
|
|
- }
|
|
|
|
|
|
+ applicationRuleDO.setCreateTime(DateUtils.getNowDate());
|
|
|
|
+ applicationRuleDO.setCreatorId(userId);
|
|
return applicationRuleDO;
|
|
return applicationRuleDO;
|
|
}
|
|
}
|
|
|
|
|