10.9开发
This commit is contained in:
+36
-1
@@ -45,7 +45,42 @@ public class AdjudicationController extends BaseController {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@GetMapping("/logistics")
|
@GetMapping("/logistics")
|
||||||
public AjaxResult getLogisticsInfo(@Validated @RequestBody CaseApplication caseApplication){
|
public AjaxResult getLogisticsInfo(CaseApplication caseApplication){
|
||||||
return adjudicationService.getLogisticsInfo(caseApplication);
|
return adjudicationService.getLogisticsInfo(caseApplication);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 签名(暂时只改案件状态)
|
||||||
|
* @param caseApplication
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PostMapping("/signature")
|
||||||
|
public AjaxResult signature(@Validated @RequestBody CaseApplication caseApplication){
|
||||||
|
return adjudicationService.signature(caseApplication);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 归档(暂时只改案件状态)
|
||||||
|
* @param caseApplication
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PostMapping("/caseFile")
|
||||||
|
public AjaxResult caseFile(@Validated @RequestBody CaseApplication caseApplication){
|
||||||
|
return adjudicationService.caseFile(caseApplication);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 送达(不包含发送电子邮件)
|
||||||
|
* @param id
|
||||||
|
* @param appEmail
|
||||||
|
* @param resEmail
|
||||||
|
* @param apptrackingNum
|
||||||
|
* @param restrackingNum
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PostMapping("/service")
|
||||||
|
public AjaxResult service(Long id,String appEmail,String resEmail
|
||||||
|
,String apptrackingNum,String restrackingNum){
|
||||||
|
return adjudicationService.service(id,appEmail,resEmail,apptrackingNum,restrackingNum);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -37,12 +37,13 @@ public class CaseApplicationConstants {
|
|||||||
/**待仲裁文书签名*/
|
/**待仲裁文书签名*/
|
||||||
public static final int SIGN_ARBITRATION = 13;
|
public static final int SIGN_ARBITRATION = 13;
|
||||||
/** 待仲裁文书用印 */
|
/** 待仲裁文书用印 */
|
||||||
public static final int ARBITRATED_SEAL = 14;
|
public static final int ARBITRATED_SEAL = 14;
|
||||||
/** 待仲裁文书送达 */
|
/** 待仲裁文书送达 */
|
||||||
public static final int ARBITRATION_DELIVERY = 15;
|
public static final int ARBITRATION_DELIVERY = 15;
|
||||||
/** 待案件归档*/
|
/** 待案件归档*/
|
||||||
public static final int CASE_FILING = 16;
|
public static final int CASE_FILING = 16;
|
||||||
|
/** 已归档*/
|
||||||
|
public static final int CASE_ARCHIVED = 17;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -9,4 +9,11 @@ public interface IAdjudicationService {
|
|||||||
AjaxResult sendDocumentByEmail(Long id,String appEmail,String resEmail ,String apptrackingNum,String restrackingNum);
|
AjaxResult sendDocumentByEmail(Long id,String appEmail,String resEmail ,String apptrackingNum,String restrackingNum);
|
||||||
|
|
||||||
AjaxResult getLogisticsInfo(CaseApplication caseApplication);
|
AjaxResult getLogisticsInfo(CaseApplication caseApplication);
|
||||||
|
|
||||||
|
AjaxResult signature(CaseApplication caseApplication);
|
||||||
|
|
||||||
|
AjaxResult caseFile(CaseApplication caseApplication);
|
||||||
|
|
||||||
|
AjaxResult service(Long id, String appEmail, String resEmail, String apptrackingNum, String restrackingNum);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+72
-2
@@ -15,6 +15,7 @@ import com.ruoyi.wisdomarbitrate.mapper.CaseApplicationMapper;
|
|||||||
import com.ruoyi.wisdomarbitrate.mapper.CaseAttachMapper;
|
import com.ruoyi.wisdomarbitrate.mapper.CaseAttachMapper;
|
||||||
import com.ruoyi.wisdomarbitrate.service.IAdjudicationService;
|
import com.ruoyi.wisdomarbitrate.service.IAdjudicationService;
|
||||||
import com.ruoyi.wisdomarbitrate.service.ICaseApplicationService;
|
import com.ruoyi.wisdomarbitrate.service.ICaseApplicationService;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.poi.xwpf.usermodel.*;
|
import org.apache.poi.xwpf.usermodel.*;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.mail.MailSendException;
|
import org.springframework.mail.MailSendException;
|
||||||
@@ -35,6 +36,7 @@ import java.time.format.DateTimeFormatter;
|
|||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
|
@Slf4j
|
||||||
public class AdjudicationServiceImpl implements IAdjudicationService {
|
public class AdjudicationServiceImpl implements IAdjudicationService {
|
||||||
private final String apiUrl = "http://api.cainiaoapi.com/api/exp/v1/index";
|
private final String apiUrl = "http://api.cainiaoapi.com/api/exp/v1/index";
|
||||||
|
|
||||||
@@ -197,7 +199,11 @@ public class AdjudicationServiceImpl implements IAdjudicationService {
|
|||||||
for (CaseAttach caseAttach : caseAttachList) {
|
for (CaseAttach caseAttach : caseAttachList) {
|
||||||
if (caseAttach.getAnnexType() == 3) {
|
if (caseAttach.getAnnexType() == 3) {
|
||||||
String annexPath = caseAttach.getAnnexPath();
|
String annexPath = caseAttach.getAnnexPath();
|
||||||
fileList.add(new File(annexPath));
|
//File file = new File("/home/ruoyi/" + annexPath);
|
||||||
|
String path = "/home/ruoyi/" + annexPath;
|
||||||
|
File file = new File(path);
|
||||||
|
System.out.println("文件是:" + file);
|
||||||
|
fileList.add(file);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -245,7 +251,7 @@ public class AdjudicationServiceImpl implements IAdjudicationService {
|
|||||||
public AjaxResult getLogisticsInfo(CaseApplication caseApplication) {
|
public AjaxResult getLogisticsInfo(CaseApplication caseApplication) {
|
||||||
try {
|
try {
|
||||||
//快递单号查询
|
//快递单号查询
|
||||||
String key = "70ba5c7b327f71fccd5924f70e3e7b7f";
|
String key = "729437f92468910aee6c12dbfeaee3c1";
|
||||||
String com = "auto";
|
String com = "auto";
|
||||||
//根据案件id查询单号信息
|
//根据案件id查询单号信息
|
||||||
CaseAffiliate caseAffiliate = new CaseAffiliate();
|
CaseAffiliate caseAffiliate = new CaseAffiliate();
|
||||||
@@ -298,4 +304,68 @@ public class AdjudicationServiceImpl implements IAdjudicationService {
|
|||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public AjaxResult signature(CaseApplication caseApplication) {
|
||||||
|
//更改案件状态(暂时)
|
||||||
|
caseApplication.setCaseStatus(CaseApplicationConstants.ARBITRATED_SEAL);
|
||||||
|
caseApplicationMapper.submitCaseApplication(caseApplication);
|
||||||
|
return AjaxResult.success("签名成功,案件状态已改为待仲裁文书用印");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public AjaxResult caseFile(CaseApplication caseApplication) {
|
||||||
|
//更改案件状态(暂时)
|
||||||
|
caseApplication.setCaseStatus(CaseApplicationConstants.CASE_ARCHIVED);
|
||||||
|
caseApplicationMapper.submitCaseApplication(caseApplication);
|
||||||
|
return AjaxResult.success("归档成功,案件状态已改为已归档");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public AjaxResult service(Long id, String appEmail, String resEmail, String apptrackingNum, String restrackingNum) {
|
||||||
|
CaseApplication caseApplication = new CaseApplication();
|
||||||
|
caseApplication.setId(id);
|
||||||
|
CaseApplication caseApplication1 = caseApplicationMapper.selectCaseApplication(caseApplication);
|
||||||
|
if (caseApplication1 == null) {
|
||||||
|
return AjaxResult.error("未查询到相关案件");
|
||||||
|
}
|
||||||
|
//修改案件状态
|
||||||
|
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("仲裁文书送达成功");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void main(String[] args) {
|
||||||
|
try {
|
||||||
|
List<File> fileList = new ArrayList<>();
|
||||||
|
fileList.add(new File("D:\\home\\ruoyi\\uploadPath\\upload\\2023\\10\\7\\b442880179844a848f1f8b08c29e3d0c.docx"));
|
||||||
|
File file = fileList.get(0);
|
||||||
|
//电子邮件送达
|
||||||
|
EmailOutUtil emailOutUtil = new EmailOutUtil();
|
||||||
|
JavaMailSender javaMailSender = emailOutUtil.rebuildMailSender();
|
||||||
|
if (javaMailSender != null) {
|
||||||
|
emailOutUtil.sendMessageCarryFile("1154956315@qq.com", "案件裁决书", "您的裁决书已送达,详情请查阅附件", file
|
||||||
|
, "hjbjava@163.com", javaMailSender);
|
||||||
|
}
|
||||||
|
} catch (MailSendException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user