Merge branch 'hjb' of SH-Arbitrate/Arbitrate-Backend into dev
This commit was merged in pull request #193.
This commit is contained in:
@@ -93,7 +93,7 @@ public class EmailOutUtil {
|
||||
* @param subject 邮件主题
|
||||
* @param fileList 邮件附件
|
||||
*/
|
||||
public void sendEmil(String to, String message, String subject, List<File> fileList, File file) {
|
||||
public Boolean sendEmil(String to, String message, String subject, List<File> fileList, File file) {
|
||||
try {
|
||||
String messageContent = "<html><body><p style=\"font-family: Arial, sans-serif; font-size: 18px;\">"+message+"。</p></body></html>";
|
||||
MimeBodyPart messageBodyPart = new MimeBodyPart();
|
||||
@@ -160,8 +160,9 @@ public class EmailOutUtil {
|
||||
Transport.send(msg);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return Boolean.FALSE;
|
||||
}
|
||||
|
||||
return Boolean.TRUE;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -34,6 +34,22 @@ public class SendMailRecord extends BaseEntity {
|
||||
/** 案件编号 */
|
||||
private String caseNum;
|
||||
|
||||
|
||||
|
||||
/** 发送状态 */
|
||||
private Integer sendStatus;
|
||||
|
||||
|
||||
|
||||
public Integer getSendStatus() {
|
||||
return sendStatus;
|
||||
}
|
||||
|
||||
public void setSendStatus(Integer sendStatus) {
|
||||
this.sendStatus = sendStatus;
|
||||
}
|
||||
|
||||
|
||||
public String getCaseNum() {
|
||||
return caseNum;
|
||||
}
|
||||
|
||||
+19
-7
@@ -540,8 +540,7 @@ public class AdjudicationServiceImpl implements IAdjudicationService {
|
||||
}
|
||||
}
|
||||
//发送邮件
|
||||
sendCaseEmail(caseApplication1, appEmail, resEmail);
|
||||
|
||||
boolean b = sendCaseEmail(caseApplication1, appEmail, resEmail);
|
||||
SendMailRecord sendMailRecord = new SendMailRecord();
|
||||
sendMailRecord.setCaseId(id);
|
||||
sendMailRecord.setMailAddress(appEmail);
|
||||
@@ -549,8 +548,12 @@ public class AdjudicationServiceImpl implements IAdjudicationService {
|
||||
sendMailRecord.setMailName("签署后的裁决书");
|
||||
sendMailRecord.setSendTime(new Date());
|
||||
sendMailRecord.setCreateBy(getUsername());
|
||||
if (b) {
|
||||
sendMailRecord.setSendStatus(1);
|
||||
} else {
|
||||
sendMailRecord.setSendStatus(0);
|
||||
}
|
||||
sendMailRecordMapper.saveSendMailRecord(sendMailRecord);
|
||||
|
||||
SendMailRecord sendMailRecord1 = new SendMailRecord();
|
||||
sendMailRecord1.setCaseId(id);
|
||||
sendMailRecord1.setMailAddress(resEmail);
|
||||
@@ -558,6 +561,11 @@ public class AdjudicationServiceImpl implements IAdjudicationService {
|
||||
sendMailRecord1.setMailName("签署后的裁决书");
|
||||
sendMailRecord1.setSendTime(new Date());
|
||||
sendMailRecord1.setCreateBy(getUsername());
|
||||
if (b) {
|
||||
sendMailRecord1.setSendStatus(1);
|
||||
} else {
|
||||
sendMailRecord1.setSendStatus(0);
|
||||
}
|
||||
sendMailRecordMapper.saveSendMailRecord(sendMailRecord1);
|
||||
|
||||
// 新增日志
|
||||
@@ -573,7 +581,7 @@ public class AdjudicationServiceImpl implements IAdjudicationService {
|
||||
* @param appEmail
|
||||
* @param resEmail
|
||||
*/
|
||||
private void sendCaseEmail(CaseApplication caseApplication1, String appEmail, String resEmail) {
|
||||
private boolean sendCaseEmail(CaseApplication caseApplication1, String appEmail, String resEmail) {
|
||||
List<File> fileList = new ArrayList<>();
|
||||
File file = null;
|
||||
|
||||
@@ -593,14 +601,18 @@ public class AdjudicationServiceImpl implements IAdjudicationService {
|
||||
}
|
||||
if (file != null) {
|
||||
try {
|
||||
emailOutUtil.sendEmil(appEmail, "您好,审核后的裁决书在附件中请查阅", "签署后的裁决书", fileList, null);
|
||||
emailOutUtil.sendEmil(resEmail, "您好,审核后的裁决书在附件中请查阅", "签署后的裁决书", fileList, null);
|
||||
Boolean aBoolean = emailOutUtil.sendEmil(appEmail, "您好,审核后的裁决书在附件中请查阅", "签署后的裁决书", fileList, null);
|
||||
Boolean aBoolean1 = emailOutUtil.sendEmil(resEmail, "您好,审核后的裁决书在附件中请查阅", "签署后的裁决书", fileList, null);
|
||||
if (aBoolean && aBoolean1){
|
||||
return Boolean.TRUE;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
System.out.println("邮件发送失败++++++++++++++++++++++++++++++++");
|
||||
System.out.println(e.toString());
|
||||
return Boolean.FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
return Boolean.FALSE;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -12,12 +12,13 @@
|
||||
<result property="sendTime" column="send_time" />
|
||||
<result property="caseId" column="case_id" />
|
||||
<result property="caseNum" column="case_num" />
|
||||
<result property="sendStatus" column="send_status" />
|
||||
|
||||
</resultMap>
|
||||
|
||||
<select id="selectSendMailRecord" parameterType="SendMailRecord" resultMap="SendMailRecordResult">
|
||||
SELECT s.id ,s.mail_name ,s.mail_content ,s.mail_address ,s.send_time ,s.case_id ,s.create_time ,s.create_by ,
|
||||
s.update_by ,s.update_time ,c.case_num
|
||||
s.update_by ,s.update_time , s.send_status ,c.case_num
|
||||
from send_mail_record s left join case_application c
|
||||
on s.case_id = c.id
|
||||
<where>
|
||||
@@ -35,6 +36,7 @@
|
||||
<if test="mailAddress != null and mailAddress != ''">mail_address,</if>
|
||||
<if test="sendTime != null ">send_time,</if>
|
||||
<if test="caseId != null ">case_id,</if>
|
||||
<if test="sendStatus != null ">send_status,</if>
|
||||
<if test="createBy != null and createBy != ''">create_by,</if>
|
||||
create_time
|
||||
)values(
|
||||
@@ -43,6 +45,7 @@
|
||||
<if test="mailAddress != null and mailAddress != ''">#{mailAddress},</if>
|
||||
<if test="sendTime != null ">#{sendTime},</if>
|
||||
<if test="caseId != null ">#{caseId},</if>
|
||||
<if test="sendStatus != null ">#{sendStatus},</if>
|
||||
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
||||
sysdate()
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user