邮箱相关修改

This commit is contained in:
18792927508
2023-11-16 14:33:42 +08:00
parent e06c159759
commit bbb2776610
2 changed files with 46 additions and 2 deletions
@@ -8,6 +8,7 @@ import com.ruoyi.common.constant.CaseApplicationConstants;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.redis.RedisCache;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.SmsUtils;
import com.ruoyi.wisdomarbitrate.domain.vo.BookSendVO;
import com.ruoyi.wisdomarbitrate.mapper.*;
import com.ruoyi.wisdomarbitrate.utils.CaseLogUtils;
@@ -66,6 +67,8 @@ public class AdjudicationServiceImpl implements IAdjudicationService {
private RedisCache redisCache;
@Autowired
private SendMailRecordMapper sendMailRecordMapper;
@Autowired
private SmsRecordMapper smsRecordMapper;
@Override
@Transactional
@@ -565,6 +568,47 @@ public class AdjudicationServiceImpl implements IAdjudicationService {
sendMailRecord1.setCreateBy(getUsername());
if (b) {
sendMailRecord1.setSendStatus(1);
// 发送短信
if(CollectionUtil.isNotEmpty(caseAffiliates)) {
SmsUtils.SendSmsRequest request = new SmsUtils.SendSmsRequest();
request.setTemplateId("1990362");
for (CaseAffiliate affiliate : caseAffiliates) {
request.setPhone(affiliate.getContactTelphone());
if(affiliate.getIdentityType() == 1) {
request.setTemplateParamSet(new String[]{caseAffiliate.getName(), caseApplication1.getCaseNum(), appEmail});
}else {
request.setTemplateParamSet(new String[]{caseAffiliate.getName(), caseApplication1.getCaseNum(), resEmail});
}
Boolean aBoolean = SmsUtils.sendSms(request);
// 保存短信发送记录
SmsSendRecord smsSendRecord = new SmsSendRecord();
smsSendRecord.setCaseId(caseAffiliate.getCaseAppliId());
smsSendRecord.setCaseNum(caseApplication1.getCaseNum());
smsSendRecord.setPhone(request.getPhone());
smsSendRecord.setSendTime(new Date());
// 尊敬的{1}用户,您的{2}仲裁案件,裁决书已送达至{3}邮箱,请知晓,如非本人操作,请忽略本短信。
if(affiliate.getIdentityType() == 1) {
smsSendRecord.setSendContent("尊敬的" + caseAffiliate.getName() + "用户,您的" + caseApplication1.getCaseNum() + "仲裁案件,裁决书已送达至" +appEmail+"邮箱,请知晓,如非本人操作,请忽略本短信。");
}else {
smsSendRecord.setSendContent("尊敬的" + caseAffiliate.getName() + "用户,您的" + caseApplication1.getCaseNum() + "仲裁案件,裁决书已送达至" +resEmail+"邮箱,请知晓,如非本人操作,请忽略本短信。");
}
smsSendRecord.setCreateBy(getUsername());
if (aBoolean) {
smsSendRecord.setSendStatus(1);
} else {
smsSendRecord.setSendStatus(0);
}
smsRecordMapper.saveSmsSendRecord(smsSendRecord);
}
}
} else {
sendMailRecord1.setSendStatus(0);
}