Merge branch 'wq1' of SH-Arbitrate/Mediation-Backend into dev
This commit was merged in pull request #151.
This commit is contained in:
+2
-2
@@ -23,7 +23,7 @@ public class IdentityAuthenticationController extends BaseController {
|
||||
@Anonymous
|
||||
@PostMapping("/selectIdentityAuthenticaEIDtoken")
|
||||
public AjaxResult selectIdentityAuthenticaEIDtoken() {
|
||||
JSONObject tokenResult = identityAuthenticationService.selectIdentityAuthenticaEIDtoken(false);
|
||||
JSONObject tokenResult = identityAuthenticationService.selectIdentityAuthEIDToken(false);
|
||||
return success(tokenResult);
|
||||
}
|
||||
/**
|
||||
@@ -32,7 +32,7 @@ public class IdentityAuthenticationController extends BaseController {
|
||||
@Anonymous
|
||||
@PostMapping("/selectPCIdentityAuthenticaEIDtoken")
|
||||
public AjaxResult selectPCIdentityAuthenticaEIDtoken() {
|
||||
JSONObject tokenResult = identityAuthenticationService.selectIdentityAuthenticaEIDtoken(true);
|
||||
JSONObject tokenResult = identityAuthenticationService.selectIdentityAuthEIDToken(true);
|
||||
return success(tokenResult);
|
||||
}
|
||||
/**
|
||||
|
||||
@@ -22,6 +22,7 @@ public enum AnnexTypeEnum implements EnumsInterface {
|
||||
SEAL_PICTURE(10, "印章图片"),
|
||||
FLOW_SVG(11, "流程节点SVG"),
|
||||
MEETING_FILE(12, "被申请人证据"),
|
||||
MEDIATE_BOOK_PDF(13, "PDF调解书或和解协议"),
|
||||
|
||||
|
||||
;
|
||||
|
||||
+1
-1
@@ -22,7 +22,7 @@ public interface IdentityAuthenticationService {
|
||||
* isPC 是否PC端
|
||||
* @return
|
||||
*/
|
||||
JSONObject selectIdentityAuthenticaEIDtoken(boolean isPC);
|
||||
JSONObject selectIdentityAuthEIDToken(boolean isPC);
|
||||
|
||||
/**
|
||||
* 小程序人脸核身后查询身份认证结果
|
||||
|
||||
+9
-6
@@ -2,6 +2,7 @@ package com.ruoyi.wisdomarbitrate.service.miniprogress.impl;
|
||||
|
||||
|
||||
import cn.hutool.core.codec.Base64;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.crypto.SmUtil;
|
||||
import cn.hutool.crypto.asymmetric.SM2;
|
||||
import cn.hutool.crypto.symmetric.SymmetricCrypto;
|
||||
@@ -90,7 +91,7 @@ public class IdentityAuthenticationServiceImpl implements IdentityAuthentication
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public JSONObject selectIdentityAuthenticaEIDtoken(boolean isPC) {
|
||||
public JSONObject selectIdentityAuthEIDToken(boolean isPC) {
|
||||
JSONObject objJSON = new JSONObject();
|
||||
objJSON.put("EidToken", "");
|
||||
try {
|
||||
@@ -116,8 +117,7 @@ public class IdentityAuthenticationServiceImpl implements IdentityAuthentication
|
||||
String respJSON = GetEidTokenResponse.toJsonString(resp);
|
||||
objJSON = JSON.parseObject(respJSON);
|
||||
} catch (TencentCloudSDKException e) {
|
||||
System.out.println(e.toString());
|
||||
System.out.println("获取Eidtoken失败");
|
||||
throw new ServiceException("获取Eidtoken失败");
|
||||
}
|
||||
return objJSON;
|
||||
}
|
||||
@@ -139,7 +139,7 @@ public class IdentityAuthenticationServiceImpl implements IdentityAuthentication
|
||||
parse = JSON.parseObject(s);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
System.out.println(e.toString());
|
||||
throw new ServiceException(e.getMessage());
|
||||
}
|
||||
return parse;
|
||||
}
|
||||
@@ -226,13 +226,14 @@ public class IdentityAuthenticationServiceImpl implements IdentityAuthentication
|
||||
}
|
||||
return AjaxResult.success(authentication);
|
||||
} catch (TencentCloudSDKException e) {
|
||||
System.out.println(e.toString());
|
||||
return AjaxResult.error(e.getMessage());
|
||||
}
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
@Override
|
||||
public JSONObject selectPCEIDtokenStatus(String eidToken) {
|
||||
// todo 送达时需要判断是否有pdf版的调解书,没有则不送达,签名完后下载pdf时不删除之前的doc调解书,上传调解书时,pdf的需要将类型设为13,异步发送短信邮件时将登录用户传参过来
|
||||
// todo E证通审核过后将PC端的机器id在YML文件中改掉
|
||||
JSONObject objJSON = null;
|
||||
try {
|
||||
Credential cred = new Credential(credentialSecretId, credentialSecretKey);
|
||||
@@ -251,7 +252,9 @@ public class IdentityAuthenticationServiceImpl implements IdentityAuthentication
|
||||
GetEidResultResponse resp = client.GetEidResult(req);
|
||||
// 输出json格式的字符串回包,Status String 枚举:init:token未验证 doing: 验证中 finished: 验证完成 timeout: token已超时
|
||||
String s = GetEidResultResponse.toJsonString(resp);
|
||||
if(StrUtil.isNotEmpty(s)) {
|
||||
objJSON = JSON.parseObject(s);
|
||||
}
|
||||
} catch (TencentCloudSDKException e) {
|
||||
throw new ServiceException("获取E证通Token状态失败");
|
||||
}
|
||||
|
||||
+11
@@ -1,9 +1,11 @@
|
||||
package com.ruoyi.wisdomarbitrate.service.mscase;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.exception.EsignDemoException;
|
||||
import com.ruoyi.wisdomarbitrate.domain.dto.mscase.MsSignSealDTO;
|
||||
import com.ruoyi.wisdomarbitrate.domain.dto.mscase.SealSignRecord;
|
||||
import com.ruoyi.wisdomarbitrate.domain.entity.mscase.MsCaseApplication;
|
||||
import com.ruoyi.wisdomarbitrate.domain.vo.mscase.MsCaseLogRecordVO;
|
||||
|
||||
import java.io.IOException;
|
||||
@@ -32,4 +34,13 @@ public interface MsSignSealService {
|
||||
AjaxResult signSeaalCaseApplicaCallback(String reqbodystr) throws EsignDemoException, IOException;
|
||||
|
||||
AjaxResult sealCheckCallback(String reqbodystr) throws EsignDemoException, IOException;
|
||||
|
||||
/**
|
||||
* 签名后下载调解书
|
||||
* @param caseApplicationselect 案件信息
|
||||
* @param signFlowId 签名流程id
|
||||
* @param gson
|
||||
* @param caseAppliId 案件id
|
||||
*/
|
||||
void downloadMediationBook(MsCaseApplication caseApplicationselect, String signFlowId, Gson gson, Long caseAppliId);
|
||||
}
|
||||
|
||||
+4
-2
@@ -3119,14 +3119,16 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
|
||||
application.setCaseStatusName(caseFlow.getCaseStatusName());
|
||||
application.setMediaResult(mediaResult);
|
||||
msCaseApplicationMapper.updateByPrimaryKeySelective(application);
|
||||
// 新增日志
|
||||
CaseLogUtils.insertCaseLog(application.getId(), currentFlow.getNodeId(), currentFlow.getCaseStatusName(), "");
|
||||
if (mediaResult == 2 || mediaResult == 3 || mediaResult == 4) {
|
||||
CaseLogUtils.insertCaseLog(application.getId(), caseFlow.getNodeId(), caseFlow.getCaseStatusName(), null);
|
||||
// 结束对接北明,为调解失败状态
|
||||
caseApplicationService.pushStatusToBM(application, PushCaseStatusEnum.FAIL);
|
||||
}
|
||||
}else {
|
||||
msCaseApplicationMapper.updateByPrimaryKeySelective(application);
|
||||
}
|
||||
// 新增日志
|
||||
CaseLogUtils.insertCaseLog(application.getId(), currentFlow.getNodeId(), currentFlow.getCaseStatusName(), "");
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
|
||||
+61
-101
@@ -78,9 +78,12 @@ import java.util.stream.Collectors;
|
||||
|
||||
import static com.google.common.io.Files.getFileExtension;
|
||||
import static com.ruoyi.common.core.domain.AjaxResult.success;
|
||||
|
||||
@Slf4j
|
||||
@Service
|
||||
public class MsSignSealServiceImpl implements MsSignSealService {
|
||||
@Autowired
|
||||
private MsSignSealService msSignSealService;
|
||||
|
||||
@Autowired
|
||||
MsCaseApplicationMapper msCaseApplicationMapper;
|
||||
@@ -135,8 +138,6 @@ public class MsSignSealServiceImpl implements MsSignSealService {
|
||||
ShortMessageService shortMessageService;
|
||||
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public AjaxResult sealApply(MsSignSealDTO dto) {
|
||||
@@ -341,86 +342,24 @@ public class MsSignSealServiceImpl implements MsSignSealService {
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public AjaxResult msCaseFile(List<Long> ids) {
|
||||
// todo
|
||||
StringBuilder error = new StringBuilder();
|
||||
try {
|
||||
for (Long id : ids) {
|
||||
MsCaseApplication caseApplication1 = msCaseApplicationMapper.selectByPrimaryKey(id);
|
||||
if (caseApplication1 == null) {
|
||||
return AjaxResult.error("未查询到相关案件");
|
||||
}
|
||||
if (caseApplication1 != null) {
|
||||
|
||||
MsCaseApplicationVO msCaseApplicationVO = new MsCaseApplicationVO();
|
||||
BeanUtil.copyProperties(caseApplication1, msCaseApplicationVO);
|
||||
List<MsCaseAttach> caseAttachList = msCaseAttachMapper.queryCaseAttachList(msCaseApplicationVO);
|
||||
if (caseAttachList != null && caseAttachList.size() > 0) {
|
||||
for (MsCaseAttach caseAttach : caseAttachList) {
|
||||
if (caseAttach.getAnnexType() == AnnexTypeEnum.MEDIATE_BOOK.getCode()) {
|
||||
String prefix = "/profile";
|
||||
int startIndex = prefix.length();
|
||||
String annexPath = caseAttach.getAnnexPath();
|
||||
String path = "/home/ruoyi/uploadPath/" + annexPath.substring(startIndex+1);
|
||||
File file = new File(path);
|
||||
if (!file.exists()) {
|
||||
Gson gson = new Gson();
|
||||
MsSealSignRecord sealSignRecord = new MsSealSignRecord();
|
||||
sealSignRecord.setCaseAppliId(id);
|
||||
List<MsSealSignRecord> sealSignRecords = sealSignRecordMapper.selectSealSignRecord(sealSignRecord);
|
||||
if (sealSignRecords != null && sealSignRecords.size() > 0) {
|
||||
String signFlowid = sealSignRecords.get(0).getSignFlowId();
|
||||
EsignHttpResponse fileDownload = SaaSAPIFileUtils.fileDownloadUrl(signFlowid);
|
||||
JsonObject fileDownloadJsonObject = gson.fromJson(fileDownload.getBody(), JsonObject.class);
|
||||
JsonObject fileDownloadData = fileDownloadJsonObject.getAsJsonObject("data");
|
||||
JsonArray filesArray = fileDownloadData.get("files").getAsJsonArray();
|
||||
if (filesArray != null && filesArray.size() > 0) {
|
||||
JsonObject fileObject = (JsonObject) filesArray.get(0);
|
||||
String fileDownloadUrl = fileObject.get("downloadUrl").toString();
|
||||
String filearbitraUrl = fileDownloadUrl.substring(1, fileDownloadUrl.length() - 1);
|
||||
// 只能送达pdf版调解书
|
||||
|
||||
LocalDate now = LocalDate.now();
|
||||
String year = Integer.toString(now.getYear());
|
||||
String month = String.format("%02d", now.getMonthValue());
|
||||
String day = String.format("%02d", now.getDayOfMonth());
|
||||
String saveFolderPath = "/home/ruoyi/uploadPath/upload/" + year + "/" + month + "/" + day;
|
||||
String fileName = UUID.randomUUID().toString().replace("-", "") + ".pdf";
|
||||
String saveName = fileName;
|
||||
String savePath = "/profile/upload/" + year + "/" + month + "/" + day + "/" + fileName;
|
||||
|
||||
// 创建日期目录
|
||||
File saveFolder = new File(saveFolderPath);
|
||||
if (!saveFolder.exists()) {
|
||||
saveFolder.mkdirs();
|
||||
}
|
||||
String resultFilePath = saveFolderPath + "/" + fileName;
|
||||
File resultFilePathFile = new File(resultFilePath);
|
||||
if (!resultFilePathFile.exists()) {
|
||||
resultFilePathFile.createNewFile();
|
||||
}
|
||||
|
||||
boolean downLoadFile = FileTransformation.downLoadFileByUrl(filearbitraUrl, resultFilePath);
|
||||
if (downLoadFile) {
|
||||
MsCaseAttach caseAttach1 = new MsCaseAttach();
|
||||
caseAttach1.setCaseAppliId(id);
|
||||
caseAttach1.setAnnexType(7);
|
||||
caseAttach1.setAnnexPath(savePath);
|
||||
caseAttach1.setAnnexName(saveName);
|
||||
msCaseAttachMapper.updateCaseAttachBycaseid(caseAttach1);
|
||||
|
||||
caseAttach.setAnnexPath(savePath);
|
||||
caseAttach.setAnnexName(saveName);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
if (CollectionUtil.isNotEmpty(caseAttachList)) {
|
||||
long count = caseAttachList.stream().filter(msCaseAttach -> msCaseAttach.getAnnexType() != null && msCaseAttach.getAnnexType().equals(AnnexTypeEnum.MEDIATE_BOOK_PDF.getCode())).count();
|
||||
if (count > 0) {
|
||||
Integer caseFlowId = caseApplication1.getCaseFlowId();
|
||||
// 查询当前节点
|
||||
MsCaseFlow currentFlow = caseFlowMapper.selectByPrimaryKey(caseFlowId);
|
||||
if(currentFlow==null){
|
||||
return AjaxResult.error("未找到当前流程节点");
|
||||
}
|
||||
if (currentFlow != null) {
|
||||
// 根据流程id查找下一个流程节点
|
||||
MsCaseFlow nextFlow = caseFlowMapper.nextFlow(caseFlowId);
|
||||
caseApplication1.setCaseFlowId(nextFlow.getId());
|
||||
@@ -429,16 +368,12 @@ public class MsSignSealServiceImpl implements MsSignSealService {
|
||||
|
||||
// 获取案件相关人员
|
||||
List<MsCaseAffiliate> affiliates = applicationService.selectAffliatesByCaseId(id);
|
||||
if(CollectionUtil.isEmpty(affiliates)){
|
||||
return AjaxResult.error("未找到案件相关人员");
|
||||
}
|
||||
if (CollectionUtil.isNotEmpty(affiliates)) {
|
||||
// 申请操作人
|
||||
Optional<MsCaseAffiliate> applicantAffiliateOpt = affiliates.stream().filter(affiliate -> affiliate.getOperatorFlag() == 1 && (affiliate.getRoleType().equals(1) || affiliate.getRoleType().equals(2))).findFirst();
|
||||
// 被申请操作人
|
||||
Optional<MsCaseAffiliate> resAffiliateOpt = affiliates.stream().filter(affiliate -> affiliate.getOperatorFlag() == 1 && (affiliate.getRoleType().equals(3) || affiliate.getRoleType().equals(4))).findFirst();
|
||||
if (!applicantAffiliateOpt.isPresent() || !resAffiliateOpt.isPresent()) {
|
||||
throw new ServiceException("未找到案件操作人员");
|
||||
}
|
||||
if (applicantAffiliateOpt.isPresent() && resAffiliateOpt.isPresent()) {
|
||||
ExecutorService executor = ThreadUtil.createThreadPool();
|
||||
// 发送邮件
|
||||
CompletableFuture.runAsync(() -> {
|
||||
@@ -447,7 +382,8 @@ public class MsSignSealServiceImpl implements MsSignSealService {
|
||||
}
|
||||
if (!StrUtil.isEmpty(resAffiliateOpt.get().getEmail())) {
|
||||
boolean appEmailFlag = sendCaseEmail(caseApplication1, resAffiliateOpt.get().getEmail(), caseAttachList);
|
||||
} }, executor);
|
||||
}
|
||||
}, executor);
|
||||
// 发送签收短信,2126313 尊敬的{1}用户,您的{2}文件已发送至邮箱,请点击链接进行确认签收https://txroom.xayunmei.com/#/sign?{3},如非本人操作,请忽略本短信
|
||||
CompletableFuture.runAsync(() -> {
|
||||
SysUser sysUser = sysUserMapper.selectUserById(applicantAffiliateOpt.get().getUserId());
|
||||
@@ -461,16 +397,30 @@ public class MsSignSealServiceImpl implements MsSignSealService {
|
||||
sendEmail(caseApplication1, sysUser, "调解系统文件签收", content);
|
||||
}
|
||||
}, executor);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
CaseLogUtils.insertCaseLog(caseApplication1.getId(), currentFlow.getNodeId(), currentFlow.getCaseStatusName(), "");
|
||||
} else {
|
||||
error.append("案件编号为" + caseApplication1.getCaseNum() + "未找到pdf版调解书,请上传\r\n");
|
||||
}
|
||||
} else {
|
||||
error.append("案件编号为" + caseApplication1.getCaseNum() + "未找到pdf版调解书,请上传\r\n");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
throw new ServiceException("调解书发送失败");
|
||||
}
|
||||
|
||||
if (error.length() > 0) {
|
||||
return AjaxResult.error(error.toString());
|
||||
}
|
||||
return AjaxResult.success("");
|
||||
}
|
||||
|
||||
public void sendEmail(MsCaseApplication application, SysUser user, String subject, String sendContent) {
|
||||
boolean emailFlag = emailOutUtil.sendMessage(user.getEmail(), subject, sendContent, null, null);
|
||||
|
||||
@@ -498,6 +448,7 @@ public class MsSignSealServiceImpl implements MsSignSealService {
|
||||
msSendMailHistoryRecord.setId(null);
|
||||
sendMailHistoryRecordMapper.insertSelective(msSendMailHistoryRecord);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public AjaxResult msCaseSign(MsSignSealDTO dto) {
|
||||
@@ -782,7 +733,7 @@ public class MsSignSealServiceImpl implements MsSignSealService {
|
||||
sealSignRecordsel.setSignFlowStatus(3);
|
||||
sealSignRecordMapper.updateByPrimaryKeySelective(sealSignRecordsel);
|
||||
// 下载调解书
|
||||
downloadMediationBook(caseApplicationselect,signFlowId,gson,caseAppliId);
|
||||
msSignSealService.downloadMediationBook(caseApplicationselect, signFlowId, gson, caseAppliId);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -824,7 +775,7 @@ public class MsSignSealServiceImpl implements MsSignSealService {
|
||||
sealSignRecordsel.setSignFlowStatus(3);
|
||||
sealSignRecordMapper.updateByPrimaryKeySelective(sealSignRecordsel);
|
||||
// 下载调解书
|
||||
downloadMediationBook(caseApplicationselect,signFlowId,gson,caseAppliId);
|
||||
msSignSealService.downloadMediationBook(caseApplicationselect, signFlowId, gson, caseAppliId);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -866,7 +817,7 @@ public class MsSignSealServiceImpl implements MsSignSealService {
|
||||
sealSignRecordsel.setSignFlowStatus(3);
|
||||
sealSignRecordMapper.updateByPrimaryKeySelective(sealSignRecordsel);
|
||||
// 下载调解书
|
||||
downloadMediationBook(caseApplicationselect,signFlowId,gson,caseAppliId);
|
||||
msSignSealService.downloadMediationBook(caseApplicationselect, signFlowId, gson, caseAppliId);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -892,7 +843,7 @@ public class MsSignSealServiceImpl implements MsSignSealService {
|
||||
caseApplicationMapper.updateByPrimaryKeySelective(application);
|
||||
|
||||
//下载审核完成的调解书
|
||||
downloadMediationBook(caseApplicationselect,signFlowId,gson,caseAppliId);
|
||||
msSignSealService.downloadMediationBook(caseApplicationselect, signFlowId, gson, caseAppliId);
|
||||
|
||||
}
|
||||
|
||||
@@ -922,7 +873,7 @@ public class MsSignSealServiceImpl implements MsSignSealService {
|
||||
sealSignRecordMapper.updateByPrimaryKeySelective(sealSignRecordsel);
|
||||
|
||||
//下载审核完成的调解书
|
||||
downloadMediationBook(caseApplicationselect,signFlowId,gson,caseAppliId);
|
||||
msSignSealService.downloadMediationBook(caseApplicationselect, signFlowId, gson, caseAppliId);
|
||||
// EsignHttpResponse fileDownload = SaaSAPIFileUtils.fileDownloadUrl(signFlowId);
|
||||
// JsonObject fileDownloadJsonObject = gson.fromJson(fileDownload.getBody(), JsonObject.class);
|
||||
// JsonObject fileDownloadData = fileDownloadJsonObject.getAsJsonObject("data");
|
||||
@@ -1013,7 +964,7 @@ public class MsSignSealServiceImpl implements MsSignSealService {
|
||||
sealSignRecordMapper.updateByPrimaryKeySelective(sealSignRecordsel);
|
||||
|
||||
//下载审核完成的调解书
|
||||
downloadMediationBook(caseApplicationselect,signFlowId,gson,caseAppliId);
|
||||
msSignSealService.downloadMediationBook(caseApplicationselect, signFlowId, gson, caseAppliId);
|
||||
// EsignHttpResponse fileDownload = SaaSAPIFileUtils.fileDownloadUrl(signFlowId);
|
||||
// JsonObject fileDownloadJsonObject = gson.fromJson(fileDownload.getBody(), JsonObject.class);
|
||||
// JsonObject fileDownloadData = fileDownloadJsonObject.getAsJsonObject("data");
|
||||
@@ -1090,14 +1041,25 @@ public class MsSignSealServiceImpl implements MsSignSealService {
|
||||
return AjaxResult.success("success");
|
||||
}
|
||||
|
||||
private void downloadMediationBook(MsCaseApplication caseApplicationselect, String signFlowId, Gson gson, Long caseAppliId) throws EsignDemoException, IOException {
|
||||
log.info("signFlowId===="+signFlowId);
|
||||
EsignHttpResponse fileDownload = SaaSAPIFileUtils.fileDownloadUrl(signFlowId);
|
||||
log.info("下载成功===="+fileDownload);
|
||||
/**
|
||||
* 下载调解书
|
||||
*
|
||||
* @param caseApplicationselect
|
||||
* @param signFlowId
|
||||
* @param gson
|
||||
* @param caseAppliId
|
||||
* @throws EsignDemoException
|
||||
* @throws IOException
|
||||
*/
|
||||
@Transactional
|
||||
public void downloadMediationBook(MsCaseApplication caseApplicationselect, String signFlowId, Gson gson, Long caseAppliId) {
|
||||
EsignHttpResponse fileDownload = null;
|
||||
try {
|
||||
fileDownload = SaaSAPIFileUtils.fileDownloadUrl(signFlowId);
|
||||
|
||||
JsonObject fileDownloadJsonObject = gson.fromJson(fileDownload.getBody(), JsonObject.class);
|
||||
JsonObject fileDownloadData = fileDownloadJsonObject.getAsJsonObject("data");
|
||||
JsonArray filesArray = fileDownloadData.get("files").getAsJsonArray();
|
||||
log.info("下载调解书pdf===="+filesArray);
|
||||
if (filesArray != null && filesArray.size() > 0) {
|
||||
JsonObject fileObject = (JsonObject) filesArray.get(0);
|
||||
String fileDownloadUrl = fileObject.get("downloadUrl").toString();
|
||||
@@ -1123,11 +1085,10 @@ public class MsSignSealServiceImpl implements MsSignSealService {
|
||||
|
||||
String fileDownloadUrlnew = fileDownloadUrl.substring(1, fileDownloadUrl.length() - 1);
|
||||
boolean downLoadFile = FileTransformation.downLoadFileByUrl(fileDownloadUrlnew, resultFilePath);
|
||||
log.info("是否下载成功======="+downLoadFile);
|
||||
if (downLoadFile) {
|
||||
// 先删除已经存在的调解书
|
||||
// 先删除已经存在的pdf调解书
|
||||
if (StrUtil.isEmpty(caseApplicationselect.getCaseSource())) {
|
||||
List<MsCaseAttach> existAttach = msCaseAttachMapper.listCaseAttachByCaseIdAndType(caseAppliId, AnnexTypeEnum.MEDIATE_BOOK.getCode());
|
||||
List<MsCaseAttach> existAttach = msCaseAttachMapper.listCaseAttachByCaseIdAndType(caseAppliId, AnnexTypeEnum.MEDIATE_BOOK_PDF.getCode());
|
||||
if (CollectionUtil.isNotEmpty(existAttach)) {
|
||||
// 对接北明,同步案件状态,删除
|
||||
for (MsCaseAttach msCaseAttach : existAttach) {
|
||||
@@ -1138,15 +1099,14 @@ public class MsSignSealServiceImpl implements MsSignSealService {
|
||||
}
|
||||
}
|
||||
}
|
||||
msCaseAttachMapper.deleteCaseAttachByCasedIdAndType(caseAppliId, AnnexTypeEnum.MEDIATE_BOOK.getCode());
|
||||
msCaseAttachMapper.deleteCaseAttachByCasedIdAndType(caseAppliId, AnnexTypeEnum.MEDIATE_BOOK_PDF.getCode());
|
||||
|
||||
MsCaseAttach caseAttach = new MsCaseAttach();
|
||||
caseAttach.setCaseAppliId(caseAppliId);
|
||||
caseAttach.setAnnexType(AnnexTypeEnum.MEDIATE_BOOK.getCode());
|
||||
caseAttach.setAnnexType(AnnexTypeEnum.MEDIATE_BOOK_PDF.getCode());
|
||||
caseAttach.setAnnexPath(savePath);
|
||||
caseAttach.setAnnexName(saveName);
|
||||
caseAttach.setSuffix(getFileExtension(caseAttach.getAnnexPath()));
|
||||
log.info("调解书保存======="+downLoadFile);
|
||||
caseAttachMapper.save(caseAttach);
|
||||
// 对接北明,调用上传附件接口
|
||||
if (StrUtil.isEmpty(caseApplicationselect.getCaseSource())) {
|
||||
@@ -1163,6 +1123,9 @@ public class MsSignSealServiceImpl implements MsSignSealService {
|
||||
}
|
||||
|
||||
}
|
||||
} catch (Exception e) {
|
||||
throw new ServiceException("E签宝下载调解书失败");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1258,7 +1221,7 @@ public class MsSignSealServiceImpl implements MsSignSealService {
|
||||
Long fileId = null;
|
||||
if (caseAttachList != null && caseAttachList.size() > 0) {
|
||||
for (MsCaseAttach caseAttach : caseAttachList) {
|
||||
if (Objects.equals(caseAttach.getAnnexType(), AnnexTypeEnum.MEDIATE_BOOK.getCode())) {
|
||||
if (Objects.equals(caseAttach.getAnnexType(), AnnexTypeEnum.MEDIATE_BOOK_PDF.getCode())) {
|
||||
String prefix = "/profile";
|
||||
int startIndex = prefix.length();
|
||||
String annexPath = caseAttach.getAnnexPath();
|
||||
@@ -1315,7 +1278,4 @@ public class MsSignSealServiceImpl implements MsSignSealService {
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user