|
|
|
|
|
|
77
|
import java.util.stream.Collectors;
|
77
|
import java.util.stream.Collectors;
|
|
78
|
|
78
|
|
|
79
|
import static com.google.common.io.Files.getFileExtension;
|
79
|
import static com.google.common.io.Files.getFileExtension;
|
|
|
|
80
|
+import static com.ruoyi.common.core.domain.AjaxResult.error;
|
|
80
|
import static com.ruoyi.common.core.domain.AjaxResult.success;
|
81
|
import static com.ruoyi.common.core.domain.AjaxResult.success;
|
|
81
|
|
82
|
|
|
82
|
@Slf4j
|
83
|
@Slf4j
|
|
|
|
|
|
|
671
|
Example msSealSignRecordExample = new Example(MsSealSignRecord.class);
|
672
|
Example msSealSignRecordExample = new Example(MsSealSignRecord.class);
|
|
672
|
msSealSignRecordExample.createCriteria().andEqualTo("signFlowId", signFlowId);
|
673
|
msSealSignRecordExample.createCriteria().andEqualTo("signFlowId", signFlowId);
|
|
673
|
MsSealSignRecord sealSignRecordsel = sealSignRecordMapper.selectOneByExample(msSealSignRecordExample);
|
674
|
MsSealSignRecord sealSignRecordsel = sealSignRecordMapper.selectOneByExample(msSealSignRecordExample);
|
|
674
|
-
|
|
|
|
|
|
675
|
+ if(sealSignRecordsel==null){
|
|
|
|
676
|
+ return error("未找到签署流程");
|
|
|
|
677
|
+ }
|
|
675
|
String pensonAccountApply = sealSignRecordsel.getPensonAccount();
|
678
|
String pensonAccountApply = sealSignRecordsel.getPensonAccount();
|
|
676
|
String orgnNamePsnAcc = sealSignRecordsel.getOrgnNamePsnAcc();
|
679
|
String orgnNamePsnAcc = sealSignRecordsel.getOrgnNamePsnAcc();
|
|
677
|
String pensonAccountRes = sealSignRecordsel.getPensonAccountRes();
|
680
|
String pensonAccountRes = sealSignRecordsel.getPensonAccountRes();
|
|
|
|
|
|
|
874
|
|
877
|
|
|
875
|
//下载审核完成的调解书
|
878
|
//下载审核完成的调解书
|
|
876
|
msSignSealService.downloadMediationBook(caseApplicationselect, signFlowId, gson, caseAppliId);
|
879
|
msSignSealService.downloadMediationBook(caseApplicationselect, signFlowId, gson, caseAppliId);
|
|
877
|
-// EsignHttpResponse fileDownload = SaaSAPIFileUtils.fileDownloadUrl(signFlowId);
|
|
|
|
878
|
-// JsonObject fileDownloadJsonObject = gson.fromJson(fileDownload.getBody(), JsonObject.class);
|
|
|
|
879
|
-// JsonObject fileDownloadData = fileDownloadJsonObject.getAsJsonObject("data");
|
|
|
|
880
|
-// JsonArray filesArray = fileDownloadData.get("files").getAsJsonArray();
|
|
|
|
881
|
-// if (filesArray != null && filesArray.size() > 0) {
|
|
|
|
882
|
-// JsonObject fileObject = (JsonObject) filesArray.get(0);
|
|
|
|
883
|
-// String fileDownloadUrl = fileObject.get("downloadUrl").toString();
|
|
|
|
884
|
-// LocalDate now = LocalDate.now();
|
|
|
|
885
|
-// String year = Integer.toString(now.getYear());
|
|
|
|
886
|
-// String month = String.format("%02d", now.getMonthValue());
|
|
|
|
887
|
-// String day = String.format("%02d", now.getDayOfMonth());
|
|
|
|
888
|
-// String saveFolderPath = "/home/ruoyi/uploadPath/upload/" + year + "/" + month + "/" + day;
|
|
|
|
889
|
-// String fileName = UUID.randomUUID().toString().replace("-", "") + ".pdf";
|
|
|
|
890
|
-// String saveName = fileName;
|
|
|
|
891
|
-// String savePath = "/profile/upload/" + year + "/" + month + "/" + day + "/" + fileName;
|
|
|
|
892
|
-//
|
|
|
|
893
|
-// // 创建日期目录
|
|
|
|
894
|
-// File saveFolder = new File(saveFolderPath);
|
|
|
|
895
|
-// if (!saveFolder.exists()) {
|
|
|
|
896
|
-// saveFolder.mkdirs();
|
|
|
|
897
|
-// }
|
|
|
|
898
|
-// String resultFilePath = saveFolderPath + "/" + fileName;
|
|
|
|
899
|
-// File resultFilePathFile = new File(resultFilePath);
|
|
|
|
900
|
-// if (!resultFilePathFile.exists()) {
|
|
|
|
901
|
-// resultFilePathFile.createNewFile();
|
|
|
|
902
|
-// }
|
|
|
|
903
|
-//
|
|
|
|
904
|
-// String fileDownloadUrlnew = fileDownloadUrl.substring(1, fileDownloadUrl.length() - 1);
|
|
|
|
905
|
-// boolean downLoadFile = FileTransformation.downLoadFileByUrl(fileDownloadUrlnew, resultFilePath);
|
|
|
|
906
|
-// if (downLoadFile) {
|
|
|
|
907
|
-// // 先删除已经存在的调解书
|
|
|
|
908
|
-// if(StrUtil.isEmpty(caseApplicationselect.getCaseSource())){
|
|
|
|
909
|
-// List<MsCaseAttach> existAttach = msCaseAttachMapper.listCaseAttachByCaseIdAndType(caseAppliId, AnnexTypeEnum.MEDIATE_BOOK.getCode());
|
|
|
|
910
|
-// if(CollectionUtil.isNotEmpty(existAttach)){
|
|
|
|
911
|
-// // 对接北明,同步案件状态,删除
|
|
|
|
912
|
-// for (MsCaseAttach msCaseAttach : existAttach) {
|
|
|
|
913
|
-// if(StrUtil.isEmpty(msCaseAttach.getOtherSysFileId())||StrUtil.isEmpty(msCaseAttach.getAnnexPath())){
|
|
|
|
914
|
-// continue;
|
|
|
|
915
|
-// }
|
|
|
|
916
|
-// beiMingInterfaceService.deleteAttachmentInfo(caseApplicationselect.getCaseNum(), msCaseAttach.getOtherSysFileId(), FileUtil.getName(msCaseAttach.getAnnexPath()));
|
|
|
|
917
|
-// }
|
|
|
|
918
|
-// }
|
|
|
|
919
|
-// }
|
|
|
|
920
|
-// msCaseAttachMapper.deleteCaseAttachByCasedIdAndType(caseAppliId, AnnexTypeEnum.MEDIATE_BOOK.getCode());
|
|
|
|
921
|
-// MsCaseAttach caseAttach = new MsCaseAttach();
|
|
|
|
922
|
-// caseAttach.setCaseAppliId(caseAppliId);
|
|
|
|
923
|
-// caseAttach.setAnnexType(AnnexTypeEnum.MEDIATE_BOOK.getCode());
|
|
|
|
924
|
-// caseAttach.setAnnexPath(savePath);
|
|
|
|
925
|
-// caseAttach.setAnnexName(saveName);
|
|
|
|
926
|
-// caseAttachMapper.save(caseAttach);
|
|
|
|
927
|
-// // 对接北明,调用上传附件接口
|
|
|
|
928
|
-// if(StrUtil.isEmpty(caseApplicationselect.getCaseSource()) ) {
|
|
|
|
929
|
-// String templatePath = "/home/ruoyi" + savePath;
|
|
|
|
930
|
-// File file = new File(templatePath.replace("/profile", "/uploadPath"));
|
|
|
|
931
|
-// MsCaseFileInfo caseFileInfo = beiMingInterfaceService.pushAttachmentInfo(BMUserName, BMPassword, file, BMSyncSource, caseApplicationselect.getCaseNum(), AttachmentOperateTypeEnum.ADD,DocumentTypeEnum.EVEDENT_AGREEMENT);
|
|
|
|
932
|
-// // 更新附件表
|
|
|
|
933
|
-// if(caseFileInfo!=null && StrUtil.isNotEmpty(caseFileInfo.getFileId())){
|
|
|
|
934
|
-// caseAttach.setOtherSysFileId(caseFileInfo.getFileId());
|
|
|
|
935
|
-// msCaseAttachMapper.updateCaseAttachBycaseid(caseAttach);
|
|
|
|
936
|
-// }
|
|
|
|
937
|
-//
|
|
|
|
938
|
-// }
|
|
|
|
939
|
-// }
|
|
|
|
940
|
-//
|
|
|
|
941
|
-// }
|
|
|
|
|
|
880
|
+
|
|
942
|
}
|
881
|
}
|
|
943
|
} else if (StringUtils.isNotEmpty(accountMobile) && accountMobile.equals(pensonAccountRes)) {
|
882
|
} else if (StringUtils.isNotEmpty(accountMobile) && accountMobile.equals(pensonAccountRes)) {
|
|
944
|
//被申请人签名
|
883
|
//被申请人签名
|
|
|
|
|
|
|
965
|
|
904
|
|
|
966
|
//下载审核完成的调解书
|
905
|
//下载审核完成的调解书
|
|
967
|
msSignSealService.downloadMediationBook(caseApplicationselect, signFlowId, gson, caseAppliId);
|
906
|
msSignSealService.downloadMediationBook(caseApplicationselect, signFlowId, gson, caseAppliId);
|
|
968
|
-// EsignHttpResponse fileDownload = SaaSAPIFileUtils.fileDownloadUrl(signFlowId);
|
|
|
|
969
|
-// JsonObject fileDownloadJsonObject = gson.fromJson(fileDownload.getBody(), JsonObject.class);
|
|
|
|
970
|
-// JsonObject fileDownloadData = fileDownloadJsonObject.getAsJsonObject("data");
|
|
|
|
971
|
-// JsonArray filesArray = fileDownloadData.get("files").getAsJsonArray();
|
|
|
|
972
|
-// if (filesArray != null && filesArray.size() > 0) {
|
|
|
|
973
|
-// JsonObject fileObject = (JsonObject) filesArray.get(0);
|
|
|
|
974
|
-// String fileDownloadUrl = fileObject.get("downloadUrl").toString();
|
|
|
|
975
|
-// LocalDate now = LocalDate.now();
|
|
|
|
976
|
-// String year = Integer.toString(now.getYear());
|
|
|
|
977
|
-// String month = String.format("%02d", now.getMonthValue());
|
|
|
|
978
|
-// String day = String.format("%02d", now.getDayOfMonth());
|
|
|
|
979
|
-// String saveFolderPath = "/home/ruoyi/uploadPath/upload/" + year + "/" + month + "/" + day;
|
|
|
|
980
|
-// String fileName = UUID.randomUUID().toString().replace("-", "") + ".pdf";
|
|
|
|
981
|
-// String saveName = fileName;
|
|
|
|
982
|
-// String savePath = "/profile/upload/" + year + "/" + month + "/" + day + "/" + fileName;
|
|
|
|
983
|
-//
|
|
|
|
984
|
-// // 创建日期目录
|
|
|
|
985
|
-// File saveFolder = new File(saveFolderPath);
|
|
|
|
986
|
-// if (!saveFolder.exists()) {
|
|
|
|
987
|
-// saveFolder.mkdirs();
|
|
|
|
988
|
-// }
|
|
|
|
989
|
-// String resultFilePath = saveFolderPath + "/" + fileName;
|
|
|
|
990
|
-// File resultFilePathFile = new File(resultFilePath);
|
|
|
|
991
|
-// if (!resultFilePathFile.exists()) {
|
|
|
|
992
|
-// resultFilePathFile.createNewFile();
|
|
|
|
993
|
-// }
|
|
|
|
994
|
-//
|
|
|
|
995
|
-// String fileDownloadUrlnew = fileDownloadUrl.substring(1, fileDownloadUrl.length() - 1);
|
|
|
|
996
|
-// boolean downLoadFile = FileTransformation.downLoadFileByUrl(fileDownloadUrlnew, resultFilePath);
|
|
|
|
997
|
-// if (downLoadFile) {
|
|
|
|
998
|
-// // 先删除已经存在的调解书
|
|
|
|
999
|
-// if(StrUtil.isEmpty(caseApplicationselect.getCaseSource())){
|
|
|
|
1000
|
-// List<MsCaseAttach> existAttach = msCaseAttachMapper.listCaseAttachByCaseIdAndType(caseAppliId, AnnexTypeEnum.MEDIATE_BOOK.getCode());
|
|
|
|
1001
|
-// if(CollectionUtil.isNotEmpty(existAttach)){
|
|
|
|
1002
|
-// // 对接北明,同步案件状态,删除
|
|
|
|
1003
|
-// for (MsCaseAttach msCaseAttach : existAttach) {
|
|
|
|
1004
|
-// if(StrUtil.isEmpty(msCaseAttach.getOtherSysFileId())||StrUtil.isEmpty(msCaseAttach.getAnnexPath())){
|
|
|
|
1005
|
-// continue;
|
|
|
|
1006
|
-// }
|
|
|
|
1007
|
-// beiMingInterfaceService.deleteAttachmentInfo(caseApplicationselect.getCaseNum(), msCaseAttach.getOtherSysFileId(), FileUtil.getName(msCaseAttach.getAnnexPath()));
|
|
|
|
1008
|
-// }
|
|
|
|
1009
|
-// }
|
|
|
|
1010
|
-// }
|
|
|
|
1011
|
-// msCaseAttachMapper.deleteCaseAttachByCasedIdAndType(caseAppliId, AnnexTypeEnum.MEDIATE_BOOK.getCode());
|
|
|
|
1012
|
-// MsCaseAttach caseAttach = new MsCaseAttach();
|
|
|
|
1013
|
-// caseAttach.setCaseAppliId(caseAppliId);
|
|
|
|
1014
|
-// caseAttach.setAnnexType(7);
|
|
|
|
1015
|
-// caseAttach.setAnnexPath(savePath);
|
|
|
|
1016
|
-// caseAttach.setAnnexName(saveName);
|
|
|
|
1017
|
-//
|
|
|
|
1018
|
-// // 对接北明,调用上传附件接口
|
|
|
|
1019
|
-//
|
|
|
|
1020
|
-// if(StrUtil.isEmpty(caseApplicationselect.getCaseSource()) ) {
|
|
|
|
1021
|
-// String templatePath = "/home/ruoyi" + savePath;
|
|
|
|
1022
|
-// File file = new File(templatePath.replace("/profile", "/uploadPath"));
|
|
|
|
1023
|
-// MsCaseFileInfo caseFileInfo = beiMingInterfaceService.pushAttachmentInfo(BMUserName, BMPassword, file, BMSyncSource, caseApplicationselect.getCaseNum(), AttachmentOperateTypeEnum.ADD,DocumentTypeEnum.EVEDENT_AGREEMENT);
|
|
|
|
1024
|
-// // 更新附件表
|
|
|
|
1025
|
-// if(caseFileInfo!=null && StrUtil.isNotEmpty(caseFileInfo.getFileId())){
|
|
|
|
1026
|
-// caseAttach.setOtherSysFileId(caseFileInfo.getFileId());
|
|
|
|
1027
|
-// }
|
|
|
|
1028
|
-// }
|
|
|
|
1029
|
-// caseAttachMapper.save(caseAttach);
|
|
|
|
1030
|
-// }
|
|
|
|
1031
|
-//
|
|
|
|
1032
|
-// }
|
|
|
|
1033
|
}
|
907
|
}
|
|
1034
|
}
|
908
|
}
|
|
1035
|
}
|
909
|
}
|