This commit is contained in:
hejinbo
2023-10-26 15:38:20 +08:00
7 changed files with 268 additions and 0 deletions
@@ -0,0 +1,11 @@
package com.ruoyi.wisdomarbitrate.service;
import com.ruoyi.wisdomarbitrate.domain.SendMailRecord;
import java.util.List;
public interface ISendMailRecordService {
List<SendMailRecord> selectSendMailRecordList(SendMailRecord sendMailRecord);
}
@@ -34,6 +34,8 @@ import java.text.SimpleDateFormat;
import java.time.LocalDate;
import java.util.*;
import static com.ruoyi.common.utils.SecurityUtils.getUsername;
@Service
@Slf4j
public class AdjudicationServiceImpl implements IAdjudicationService {
@@ -56,6 +58,9 @@ public class AdjudicationServiceImpl implements IAdjudicationService {
@Autowired
private RedisCache redisCache;
@Autowired
private SendMailRecordMapper sendMailRecordMapper;
@Override
@Transactional
public AjaxResult createDocument(CaseApplication caseApplication) {
@@ -336,10 +341,28 @@ public class AdjudicationServiceImpl implements IAdjudicationService {
if (appEmail != null) {
emailOutUtil.sendMessageCarryFile(appEmail, "案件裁决书", "您的裁决书已送达,详情请查阅附件", file
, "hjbjava@163.com", javaMailSender);
SendMailRecord sendMailRecord = new SendMailRecord();
sendMailRecord.setCaseId(id);
sendMailRecord.setMailAddress(appEmail);
sendMailRecord.setMailContent("您的裁决书已送达,详情请查阅附件");
sendMailRecord.setMailName("案件裁决书");
sendMailRecord.setSendTime(new Date());
sendMailRecord.setCreateBy(getUsername());
sendMailRecordMapper.saveSendMailRecord(sendMailRecord);
}
if (resEmail != null) {
emailOutUtil.sendMessageCarryFile(resEmail, "案件裁决书", "您的裁决书已送达,详情请查阅附件", file
, "hjbjava@163.com", javaMailSender);
SendMailRecord sendMailRecord = new SendMailRecord();
sendMailRecord.setCaseId(id);
sendMailRecord.setMailAddress(resEmail);
sendMailRecord.setMailContent("您的裁决书已送达,详情请查阅附件");
sendMailRecord.setMailName("案件裁决书");
sendMailRecord.setSendTime(new Date());
sendMailRecord.setCreateBy(getUsername());
sendMailRecordMapper.saveSendMailRecord(sendMailRecord);
}
//修改案件状态
caseApplication1.setCaseStatus(CaseApplicationConstants.CASE_FILING);
@@ -361,6 +384,7 @@ public class AdjudicationServiceImpl implements IAdjudicationService {
}
}
}
return AjaxResult.success("仲裁文书送达成功");
} catch (MailSendException e) {
return AjaxResult.error("发送失败,请检查文件路径");
@@ -0,0 +1,26 @@
package com.ruoyi.wisdomarbitrate.service.impl;
import com.ruoyi.wisdomarbitrate.domain.CaseLogRecord;
import com.ruoyi.wisdomarbitrate.domain.SendMailRecord;
import com.ruoyi.wisdomarbitrate.mapper.SendMailRecordMapper;
import com.ruoyi.wisdomarbitrate.service.ISendMailRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
@Service
public class SendMailRecordServiceImpl implements ISendMailRecordService {
@Autowired
private SendMailRecordMapper sendMailRecordMapper;
@Override
public List<SendMailRecord> selectSendMailRecordList(SendMailRecord sendMailRecord) {
List<SendMailRecord> records = sendMailRecordMapper.selectSendMailRecord(sendMailRecord);
return records;
}
}