Merge branch 'dev' of http://git.xayunmei.com/SH-Arbitrate/Arbitrate-Backend into qtz
This commit is contained in:
+1
-1
@@ -6,7 +6,7 @@ import com.ruoyi.wisdomarbitrate.domain.CaseApplication;
|
||||
public interface IAdjudicationService {
|
||||
AjaxResult createDocument(CaseApplication caseApplication);
|
||||
|
||||
AjaxResult sendDocumentByEmail(Long id,String appEmail,String resEmail);
|
||||
AjaxResult sendDocumentByEmail(Long id,String appEmail,String resEmail ,String apptrackingNum,String restrackingNum);
|
||||
|
||||
AjaxResult getLogisticsInfo(String trackingNum,Integer phoneLastFour);
|
||||
}
|
||||
|
||||
+30
-7
@@ -16,6 +16,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.mail.MailSendException;
|
||||
import org.springframework.mail.javamail.JavaMailSender;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.io.*;
|
||||
import java.net.HttpURLConnection;
|
||||
@@ -125,10 +126,10 @@ public class AdjudicationServiceImpl implements IAdjudicationService {
|
||||
datas.put("year", now.getYear());
|
||||
datas.put("months", now.getMonthValue());
|
||||
datas.put("day", now.getDayOfMonth());
|
||||
//String modalFilePath = "/data/arbitrate-document/template/仲裁裁决书模板.docx";
|
||||
String modalFilePath = "D:/develop/仲裁裁决书模板 (2).docx";
|
||||
//String saveFolderPath = "/data/arbitrate-document/formal/" + now.getYear() + "/" + now.getMonthValue() + "/" + now.getDayOfMonth();
|
||||
String saveFolderPath = "D:/data/" + now.getYear() + "/" + now.getMonthValue() + "/" + now.getDayOfMonth();
|
||||
String modalFilePath = "/data/arbitrate-document/template/仲裁裁决书模板.docx";
|
||||
//String modalFilePath = "D:/develop/仲裁裁决书模板 (2).docx";
|
||||
String saveFolderPath = "/data/arbitrate-document/formal/" + now.getYear() + "/" + now.getMonthValue() + "/" + now.getDayOfMonth();
|
||||
//String saveFolderPath = "D:/data/" + now.getYear() + "/" + now.getMonthValue() + "/" + now.getDayOfMonth();
|
||||
String fileName = UUID.randomUUID().toString().replace("-", "") + ".docx";
|
||||
String resultFilePath = saveFolderPath + "/" + fileName;
|
||||
// 创建日期目录
|
||||
@@ -167,7 +168,8 @@ public class AdjudicationServiceImpl implements IAdjudicationService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public AjaxResult sendDocumentByEmail(Long id, String appEmail, String resEmail) {
|
||||
@Transactional
|
||||
public AjaxResult sendDocumentByEmail(Long id, String appEmail, String resEmail ,String apptrackingNum,String restrackingNum) {
|
||||
CaseApplication caseApplication = new CaseApplication();
|
||||
caseApplication.setId(id);
|
||||
CaseApplication caseApplication1 = caseApplicationMapper.selectCaseApplication(caseApplication);
|
||||
@@ -187,19 +189,40 @@ public class AdjudicationServiceImpl implements IAdjudicationService {
|
||||
}
|
||||
}
|
||||
}
|
||||
if (fileList.size()<1){
|
||||
return AjaxResult.error("未查询到裁决书");
|
||||
}
|
||||
File file = fileList.get(0);
|
||||
//电子邮件送达
|
||||
JavaMailSender javaMailSender = emailOutUtil.rebuildMailSender();
|
||||
if (appEmail != null) {
|
||||
emailOutUtil.sendMessageCarryFiles(appEmail, "案件裁决书", "您的裁决书已送达,详情请查阅附件", fileList
|
||||
emailOutUtil.sendMessageCarryFile(appEmail, "案件裁决书", "您的裁决书已送达,详情请查阅附件", file
|
||||
, "hjbjava@163.com", javaMailSender);
|
||||
}
|
||||
if (resEmail != null) {
|
||||
emailOutUtil.sendMessageCarryFiles(resEmail, "案件裁决书", "您的裁决书已送达,详情请查阅附件", fileList
|
||||
emailOutUtil.sendMessageCarryFile(resEmail, "案件裁决书", "您的裁决书已送达,详情请查阅附件", file
|
||||
, "hjbjava@163.com", javaMailSender);
|
||||
}
|
||||
//修改案件状态
|
||||
caseApplication1.setCaseStatus(CaseApplicationConstants.CASE_FILING);
|
||||
caseApplicationMapper.submitCaseApplication(caseApplication1);
|
||||
//保存邮箱信息和快递单号到关联人表
|
||||
CaseAffiliate caseAffiliate = new CaseAffiliate();
|
||||
caseAffiliate.setCaseAppliId(id);
|
||||
List<CaseAffiliate> caseAffiliates = caseAffiliateMapper.selectCaseAffiliate(caseAffiliate);
|
||||
if (caseAffiliates!=null&&caseAffiliates.size()>0){
|
||||
for (CaseAffiliate affiliate : caseAffiliates) {
|
||||
if (affiliate.getIdentityType() == 1){ //申请人
|
||||
affiliate.setSendEmail(appEmail);
|
||||
affiliate.setTrackNum(apptrackingNum);
|
||||
caseAffiliateMapper.updataCaseAffiliate(affiliate);
|
||||
}else {
|
||||
affiliate.setSendEmail(resEmail);
|
||||
affiliate.setTrackNum(restrackingNum);
|
||||
caseAffiliateMapper.updataCaseAffiliate(affiliate);
|
||||
}
|
||||
}
|
||||
}
|
||||
return AjaxResult.success("仲裁文书送达成功");
|
||||
} catch (MailSendException e) {
|
||||
return AjaxResult.error("发送失败,请检查文件路径");
|
||||
|
||||
Reference in New Issue
Block a user