|
|
@@ -6,8 +6,10 @@ import com.alibaba.fastjson.JSON;
|
|
6
|
6
|
import com.alibaba.fastjson.JSONObject;
|
|
7
|
7
|
import com.deepoove.poi.data.PictureRenderData;
|
|
8
|
8
|
import com.google.gson.Gson;
|
|
|
9
|
+import com.google.gson.JsonArray;
|
|
9
|
10
|
import com.google.gson.JsonObject;
|
|
10
|
11
|
import com.ruoyi.common.constant.CaseApplicationConstants;
|
|
|
12
|
+import com.ruoyi.common.constant.FileTransformation;
|
|
11
|
13
|
import com.ruoyi.common.core.controller.BaseController;
|
|
12
|
14
|
import com.ruoyi.common.core.domain.AjaxResult;
|
|
13
|
15
|
import com.ruoyi.common.core.domain.entity.EsignHttpResponse;
|
|
|
@@ -16,6 +18,7 @@ import com.ruoyi.common.core.redis.RedisCache;
|
|
16
|
18
|
import com.ruoyi.common.exception.EsignDemoException;
|
|
17
|
19
|
import com.ruoyi.common.exception.ServiceException;
|
|
18
|
20
|
import com.ruoyi.common.utils.*;
|
|
|
21
|
+import com.ruoyi.common.utils.file.SaaSAPIFileUtils;
|
|
19
|
22
|
import com.ruoyi.common.utils.thread.MultipleThreadListParam;
|
|
20
|
23
|
import com.ruoyi.common.utils.thread.MultipleThreadWorkUtil;
|
|
21
|
24
|
import com.ruoyi.system.mapper.SysDictDataMapper;
|
|
|
@@ -1567,7 +1570,7 @@ public class AdjudicationServiceImpl implements IAdjudicationService {
|
|
1567
|
1570
|
|
|
1568
|
1571
|
@Override
|
|
1569
|
1572
|
@Transactional
|
|
1570
|
|
- public AjaxResult serviceBatch(Integer batchNumber) {
|
|
|
1573
|
+ public AjaxResult serviceBatch(Integer batchNumber) throws EsignDemoException, IOException {
|
|
1571
|
1574
|
CaseApplication caseApplicationsel = new CaseApplication();
|
|
1572
|
1575
|
caseApplicationsel.setBatchNumber(batchNumber);
|
|
1573
|
1576
|
caseApplicationsel.setCaseStatus(CaseApplicationConstants.ARBITRATION_DELIVERY);
|
|
|
@@ -1582,6 +1585,7 @@ public class AdjudicationServiceImpl implements IAdjudicationService {
|
|
1582
|
1585
|
return AjaxResult.error("未查询到相关案件");
|
|
1583
|
1586
|
}
|
|
1584
|
1587
|
List<CaseAttach> caseAttachList = caseAttachMapper.queryCaseAttachList(caseApplication1);
|
|
|
1588
|
+
|
|
1585
|
1589
|
if (caseAttachList != null && caseAttachList.size() > 0) {
|
|
1586
|
1590
|
for (CaseAttach caseAttach : caseAttachList) {
|
|
1587
|
1591
|
if (caseAttach.getAnnexType() == 3) {
|
|
|
@@ -1592,12 +1596,60 @@ public class AdjudicationServiceImpl implements IAdjudicationService {
|
|
1592
|
1596
|
File file = new File(path);
|
|
1593
|
1597
|
// todo 部署放开
|
|
1594
|
1598
|
if (!file.exists()) {
|
|
1595
|
|
- return AjaxResult.error("未生成裁决书");
|
|
|
1599
|
+ Gson gson = new Gson();
|
|
|
1600
|
+ SealSignRecord sealSignRecord = new SealSignRecord();
|
|
|
1601
|
+ sealSignRecord.setCaseAppliId(id);
|
|
|
1602
|
+ List<SealSignRecord> sealSignRecords = sealSignRecordMapper.selectSealSignRecord(sealSignRecord);
|
|
|
1603
|
+ if (sealSignRecords != null && sealSignRecords.size() > 0) {
|
|
|
1604
|
+ String signFlowid = sealSignRecords.get(0).getSignFlowid();
|
|
|
1605
|
+ EsignHttpResponse fileDownload = SaaSAPIFileUtils.fileDownloadUrl(signFlowid);
|
|
|
1606
|
+ JsonObject fileDownloadJsonObject = gson.fromJson(fileDownload.getBody(), JsonObject.class);
|
|
|
1607
|
+ JsonObject fileDownloadData = fileDownloadJsonObject.getAsJsonObject("data");
|
|
|
1608
|
+ JsonArray filesArray = fileDownloadData.get("files").getAsJsonArray();
|
|
|
1609
|
+ if (filesArray != null && filesArray.size() > 0) {
|
|
|
1610
|
+ JsonObject fileObject = (JsonObject) filesArray.get(0);
|
|
|
1611
|
+ String fileDownloadUrl = fileObject.get("downloadUrl").toString();
|
|
|
1612
|
+ String filearbitraUrl = fileDownloadUrl.substring(1, fileDownloadUrl.length() - 1);
|
|
|
1613
|
+
|
|
|
1614
|
+ LocalDate now = LocalDate.now();
|
|
|
1615
|
+ String year = Integer.toString(now.getYear());
|
|
|
1616
|
+ String month = String.format("%02d", now.getMonthValue());
|
|
|
1617
|
+ String day = String.format("%02d", now.getDayOfMonth());
|
|
|
1618
|
+ String saveFolderPath = "/home/ruoyi/uploadPath/upload/" + year + "/" + month + "/" + day;
|
|
|
1619
|
+ String fileName = UUID.randomUUID().toString().replace("-", "") + ".pdf";
|
|
|
1620
|
+ String saveName = "/profile/upload/" + year + "/" + month + "/" + day + "/" + fileName;
|
|
|
1621
|
+ String savePath = "/home/ruoyi/uploadPath/upload/";
|
|
|
1622
|
+
|
|
|
1623
|
+ // 创建日期目录
|
|
|
1624
|
+ File saveFolder = new File(saveFolderPath);
|
|
|
1625
|
+ if (!saveFolder.exists()) {
|
|
|
1626
|
+ saveFolder.mkdirs();
|
|
|
1627
|
+ }
|
|
|
1628
|
+ String resultFilePath = saveFolderPath + "/" + fileName;
|
|
|
1629
|
+ File resultFilePathFile = new File(resultFilePath);
|
|
|
1630
|
+ if (!resultFilePathFile.exists()) {
|
|
|
1631
|
+ resultFilePathFile.createNewFile();
|
|
|
1632
|
+ }
|
|
|
1633
|
+
|
|
|
1634
|
+ boolean downLoadFile = FileTransformation.downLoadFileByUrl(filearbitraUrl, resultFilePath);
|
|
|
1635
|
+ if (downLoadFile) {
|
|
|
1636
|
+ CaseAttach caseAttach1 = new CaseAttach();
|
|
|
1637
|
+ caseAttach1.setCaseAppliId(id);
|
|
|
1638
|
+ caseAttach1.setAnnexType(3);
|
|
|
1639
|
+ caseAttach1.setAnnexPath(savePath);
|
|
|
1640
|
+ caseAttach1.setAnnexName(saveName);
|
|
|
1641
|
+ caseAttachMapper.updateCaseAttachBycaseid(caseAttach1);
|
|
|
1642
|
+
|
|
|
1643
|
+ caseAttach.setAnnexPath(savePath);
|
|
|
1644
|
+ caseAttach.setAnnexName(saveName);
|
|
|
1645
|
+ }
|
|
|
1646
|
+ }
|
|
|
1647
|
+ }
|
|
1596
|
1648
|
}
|
|
1597
|
|
-
|
|
1598
|
1649
|
}
|
|
1599
|
1650
|
}
|
|
1600
|
1651
|
}
|
|
|
1652
|
+
|
|
1601
|
1653
|
//修改案件状态
|
|
1602
|
1654
|
caseApplication1.setCaseStatus(CaseApplicationConstants.CASE_FILING);
|
|
1603
|
1655
|
caseApplicationMapper.submitCaseApplication(caseApplication1);
|
|
|
@@ -1610,9 +1662,9 @@ public class AdjudicationServiceImpl implements IAdjudicationService {
|
|
1610
|
1662
|
if (caseAffiliates != null && caseAffiliates.size() > 0) {
|
|
1611
|
1663
|
for (CaseAffiliate affiliate : caseAffiliates) {
|
|
1612
|
1664
|
if (affiliate.getIdentityType() == 1) { //申请人
|
|
1613
|
|
- appEmail = affiliate.getSendEmail();
|
|
|
1665
|
+ appEmail = affiliate.getEmail();
|
|
1614
|
1666
|
} else {
|
|
1615
|
|
- resEmail = affiliate.getSendEmail();
|
|
|
1667
|
+ resEmail = affiliate.getEmail();
|
|
1616
|
1668
|
}
|
|
1617
|
1669
|
}
|
|
1618
|
1670
|
}
|