1.1.2发版 #157

Merged
wangqiong123 merged 58 commits from dev into prod 2024-05-06 07:54:24 +00:00
8 changed files with 257 additions and 211 deletions
Showing only changes of commit e2c5fbf77d - Show all commits
@@ -84,10 +84,15 @@ public class MsVideoConferenceController extends BaseController {
caseAttach = MsCaseAttach.builder() caseAttach = MsCaseAttach.builder()
.caseAppliId(caseId) .caseAppliId(caseId)
.annexName(jsonObject.getString("fileName")) .annexName(jsonObject.getString("fileName"))
.annexPath(jsonObject.getString("filePath"))
.annexType(annexType) .annexType(annexType)
.onlyOfficeFileId(jsonObject.getString("fileId")) .onlyOfficeFileId(jsonObject.getString("fileId"))
.build(); .build();
if(jsonObject.get("filePath")!=null){
String officePath = jsonObject.getString("filePath");
String replace = officePath.replace("/home/ruoyi/uploadPath/", "/profile/");
caseAttach.setAnnexPath(replace);
}
msCaseAttachMapper.save(caseAttach); msCaseAttachMapper.save(caseAttach);
} }
if(caseAttach==null){ if(caseAttach==null){
@@ -120,7 +120,7 @@ token:
header: Authorization header: Authorization
# 令牌密钥 # 令牌密钥
secret: abcdefghijklmnopqrstuvwxyz secret: abcdefghijklmnopqrstuvwxyz
# 令牌有效期(默认120分钟) # 令牌有效期(默认30分钟)
expireTime: 120 expireTime: 120
# MyBatis配置 # MyBatis配置
+5
View File
@@ -283,6 +283,11 @@
<groupId>org.apache.httpcomponents</groupId> <groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId> <artifactId>httpclient</artifactId>
</dependency> </dependency>
<dependency>
<groupId>org.thymeleaf</groupId>
<artifactId>thymeleaf</artifactId>
<version>3.0.12.RELEASE</version>
</dependency>
</dependencies> </dependencies>
@@ -1,20 +1,13 @@
package com.ruoyi.common.utils.file; package com.ruoyi.common.utils.file;
import cn.hutool.json.JSONObject;
import com.google.gson.Gson;
import com.google.gson.JsonArray;
import com.google.gson.JsonObject;
import com.ruoyi.common.config.EsignDemoConfig; import com.ruoyi.common.config.EsignDemoConfig;
import com.ruoyi.common.constant.EsignHeaderConstant; import com.ruoyi.common.constant.EsignHeaderConstant;
import com.ruoyi.common.constant.FileTransformation;
import com.ruoyi.common.core.domain.entity.EsignHttpResponse; import com.ruoyi.common.core.domain.entity.EsignHttpResponse;
import com.ruoyi.common.enums.EsignRequestType; import com.ruoyi.common.enums.EsignRequestType;
import com.ruoyi.common.exception.EsignDemoException; import com.ruoyi.common.exception.EsignDemoException;
import com.ruoyi.common.utils.EsignHttpHelper; import com.ruoyi.common.utils.EsignHttpHelper;
import com.ruoyi.common.utils.bean.EsignFileBean; import com.ruoyi.common.utils.bean.EsignFileBean;
import com.ruoyi.common.utils.uuid.IdUtils;
import java.time.LocalDate;
import java.util.Map; import java.util.Map;
public class SaaSAPIFileUtils { public class SaaSAPIFileUtils {
@@ -88,43 +81,27 @@ public class SaaSAPIFileUtils {
public static void main(String[] args) throws EsignDemoException { public static void main(String[] args) throws EsignDemoException {
String filePath = "D:\\home\\ruoyi\\uploadPath\\upload\\2023\\10\\7\\23893bfd3f2249ffa5c82850c11c482e.docx"; fileDownloadUrl("8425b244bf4b417dbb22fd39a1c2d65f");
EsignHttpResponse uploadUrl = getUploadUrl(filePath);
String body = uploadUrl.getBody();
JSONObject jsonObject = new JSONObject(body);
JSONObject dataObj = jsonObject.getJSONObject("data");
String fileUploadUrl = dataObj.get("fileUploadUrl").toString();
System.out.println("这是fileUploadUrl:"+fileUploadUrl);
String fileId = dataObj.get("fileId").toString();
System.out.println("这是fileId:"+fileId);
//String fileUploadUrl = "https://esignoss.esign.cn/1111564182/ccf6db5a-92da-4523-89ba-385a30423596/23893bfd3f2249ffa5c82850c11c482e.docx?Expires=1697021257&OSSAccessKeyId=STS.NTmgvSC8n5Zg1y7EciQftF23N&Signature=CxVZmpwFksWmLYkxPjVz9K4mVyA%3D&callback-var=eyJ4OmZpbGVfa2V5IjoiJDAyODhjOTg3LWNlNzgtNDM1OC04NWYwLTdlNmUyM2NjOTJmNiQzNDk1NzQ3MjE5In0%3D%0A&callback=eyJjYWxsYmFja1VybCI6Imh0dHA6Ly9zbWx0YXBpLnRzaWduLmNuL2FueWRvb3IvZmlsZS1zeXN0ZW0vY2FsbGJhY2svYWxpb3NzIiwiY2FsbGJhY2tCb2R5IjogIntcIm1pbWVUeXBlXCI6JHttaW1lVHlwZX0sXCJzaXplXCI6ICR7c2l6ZX0sXCJidWNrZXRcIjogJHtidWNrZXR9LFwib2JqZWN0XCI6ICR7b2JqZWN0fSxcImV0YWdcIjogJHtldGFnfSxcImZpbGVfa2V5XCI6JHt4OmZpbGVfa2V5fX0iLCJjYWxsYmFja0JvZHlUeXBlIjogImFwcGxpY2F0aW9uL2pzb24ifQ%3D%3D%0A&security-token=CAIS%2BAF1q6Ft5B2yfSjIr5fYLMznrudPgpiMM1%2BGoWM8XelYqfeYrDz2IHtKdXRvBu8Xs%2F4wnmxX7f4YlqB6T55OSAmcNZEofT7katr4MeT7oMWQweEurv%2FMQBqyaXPS2MvVfJ%2BOLrf0ceusbFbpjzJ6xaCAGxypQ12iN%2B%2Fm6%2FNgdc9FHHPPD1x8CcxROxFppeIDKHLVLozNCBPxhXfKB0ca0WgVy0EHsPnvm5DNs0uH1AKjkbRM9r6ceMb0M5NeW75kSMqw0eBMca7M7TVd8RAi9t0t1%2FIVpGiY4YDAWQYLv0rda7DOltFiMkpla7MmXqlft%2BhzcgeQY0pc%2FRqAAaxcPCSY0Du8wgErfR1llD8t2zeFG%2B1mktU4Rsl7AgxsSFxrwILBUk2x7imVsFVA0kkS8rNBMDKGIsIZTCl5M7S2L%2BD8364htwcZgIZYHK2fCN6gCuy%2Bfk9C%2FfQaTc00IWBMw8OubuJ%2Fq2mdMh32yoi7dLuJyhwt1z%2F%2BWf5vIFHdIAA%3D";
EsignHttpResponse esignHttpResponse = uploadFile(fileUploadUrl, filePath);
System.out.println("这是上传文件流的结果:"+esignHttpResponse.getBody());
EsignHttpResponse fileStatus = getFileStatus(fileId);
System.out.println("这是获取文件上传状态的结果:"+fileStatus.getBody());
// getFileStatus("a808f1f39a744357a2f018e4ab34c55d");
// fileDownloadUrl("");
// Gson gson = new Gson();
// EsignHttpResponse fileDownload = fileDownloadUrl(signFlowId);
// JsonObject fileDownloadJsonObject = gson.fromJson(fileDownload.getBody(),JsonObject.class); // String filePath = "D:\\home\\ruoyi\\uploadPath\\upload\\2023\\10\\7\\23893bfd3f2249ffa5c82850c11c482e.docx";
// JsonObject fileDownloadData = fileDownloadJsonObject.getAsJsonObject("data"); //
// JsonArray filesArray = fileDownloadData.get("files").getAsJsonArray(); // EsignHttpResponse uploadUrl = getUploadUrl(filePath);
// if(filesArray!=null&&filesArray.size()>0){ // String body = uploadUrl.getBody();
// JsonObject fileObject = (JsonObject)filesArray.get(0); // JSONObject jsonObject = new JSONObject(body);
// String fileDownloadUrl = fileObject.get("downloadUrl").toString(); // JSONObject dataObj = jsonObject.getJSONObject("data");
// String fileName = java.util.UUID.randomUUID().toString().replace("-", "") + ".pdf"; // String fileUploadUrl = dataObj.get("fileUploadUrl").toString();
// String savePath = "/home/ruoyi/uploadPath/upload"; // System.out.println("这是fileUploadUrl:"+fileUploadUrl);
// LocalDate now = LocalDate.now(); // String fileId = dataObj.get("fileId").toString();
// String year = Integer.toString(now.getYear()); // System.out.println("这是fileId:"+fileId);
// String month = String.format("%02d", now.getMonthValue()); // //String fileUploadUrl = "https://esignoss.esign.cn/1111564182/ccf6db5a-92da-4523-89ba-385a30423596/23893bfd3f2249ffa5c82850c11c482e.docx?Expires=1697021257&OSSAccessKeyId=STS.NTmgvSC8n5Zg1y7EciQftF23N&Signature=CxVZmpwFksWmLYkxPjVz9K4mVyA%3D&callback-var=eyJ4OmZpbGVfa2V5IjoiJDAyODhjOTg3LWNlNzgtNDM1OC04NWYwLTdlNmUyM2NjOTJmNiQzNDk1NzQ3MjE5In0%3D%0A&callback=eyJjYWxsYmFja1VybCI6Imh0dHA6Ly9zbWx0YXBpLnRzaWduLmNuL2FueWRvb3IvZmlsZS1zeXN0ZW0vY2FsbGJhY2svYWxpb3NzIiwiY2FsbGJhY2tCb2R5IjogIntcIm1pbWVUeXBlXCI6JHttaW1lVHlwZX0sXCJzaXplXCI6ICR7c2l6ZX0sXCJidWNrZXRcIjogJHtidWNrZXR9LFwib2JqZWN0XCI6ICR7b2JqZWN0fSxcImV0YWdcIjogJHtldGFnfSxcImZpbGVfa2V5XCI6JHt4OmZpbGVfa2V5fX0iLCJjYWxsYmFja0JvZHlUeXBlIjogImFwcGxpY2F0aW9uL2pzb24ifQ%3D%3D%0A&security-token=CAIS%2BAF1q6Ft5B2yfSjIr5fYLMznrudPgpiMM1%2BGoWM8XelYqfeYrDz2IHtKdXRvBu8Xs%2F4wnmxX7f4YlqB6T55OSAmcNZEofT7katr4MeT7oMWQweEurv%2FMQBqyaXPS2MvVfJ%2BOLrf0ceusbFbpjzJ6xaCAGxypQ12iN%2B%2Fm6%2FNgdc9FHHPPD1x8CcxROxFppeIDKHLVLozNCBPxhXfKB0ca0WgVy0EHsPnvm5DNs0uH1AKjkbRM9r6ceMb0M5NeW75kSMqw0eBMca7M7TVd8RAi9t0t1%2FIVpGiY4YDAWQYLv0rda7DOltFiMkpla7MmXqlft%2BhzcgeQY0pc%2FRqAAaxcPCSY0Du8wgErfR1llD8t2zeFG%2B1mktU4Rsl7AgxsSFxrwILBUk2x7imVsFVA0kkS8rNBMDKGIsIZTCl5M7S2L%2BD8364htwcZgIZYHK2fCN6gCuy%2Bfk9C%2FfQaTc00IWBMw8OubuJ%2Fq2mdMh32yoi7dLuJyhwt1z%2F%2BWf5vIFHdIAA%3D";
// String day = String.format("%02d", now.getDayOfMonth()); // EsignHttpResponse esignHttpResponse = uploadFile(fileUploadUrl, filePath);
// String saveName = "/profile/upload/" + year + "/" + month + "/" + day + "/" + fileName; // System.out.println("这是上传文件流的结果:"+esignHttpResponse.getBody());
// String fileDownloadUrlnew = fileDownloadUrl.substring(1,fileDownloadUrl.length()-1); // EsignHttpResponse fileStatus = getFileStatus(fileId);
// FileTransformation.downLoadFileByUrl(fileDownloadUrlnew,dir); // System.out.println("这是获取文件上传状态的结果:"+fileStatus.getBody());
// }
@@ -324,6 +324,8 @@ public class DeptIdentifyServiceImpl implements IDeptIdentifyService {
if (identifyName == null) { if (identifyName == null) {
AjaxResult.error("请检查参数是否完整"); AjaxResult.error("请检查参数是否完整");
} }
// 查询是否存在机构
SysDept sysDept = sysDeptMapper.selectDeptByName(identifyName);
Integer identifyType = deptIdentify.getIdentifyType(); Integer identifyType = deptIdentify.getIdentifyType();
if (identifyType == null) { if (identifyType == null) {
deptIdentify.setIdentifyType(1); // 设置机构默认为仲裁机构 deptIdentify.setIdentifyType(1); // 设置机构默认为仲裁机构
@@ -331,11 +333,19 @@ public class DeptIdentifyServiceImpl implements IDeptIdentifyService {
deptIdentify.setIdentifyStatus(0); //设置认证状态默认为未认证 deptIdentify.setIdentifyStatus(0); //设置认证状态默认为未认证
deptIdentify.setIsUse(0); //设置机构默认为未启用 deptIdentify.setIsUse(0); //设置机构默认为未启用
//将机构名称保存到部门表里 //将机构名称保存到部门表里
SysDept sysDept = new SysDept(); int i1=0;
sysDept.setDeptName(identifyName); if(sysDept == null) {
sysDept.setParentId(0L); sysDept = new SysDept();
sysDept.setDeptType(1); sysDept.setParentId(0L);
int i1 = sysDeptMapper.insertDept(sysDept); sysDept.setDeptName(identifyName);
sysDept.setDeptType(1);
i1 = sysDeptMapper.insertDept(sysDept);
}
else {
sysDept.setDeptType(1);
sysDeptMapper.updateDept(sysDept);
}
if (i1 > 0) { if (i1 > 0) {
/* //将经办人信息存入到用户表里 /* //将经办人信息存入到用户表里
Long deptId = sysDept.getDeptId(); Long deptId = sysDept.getDeptId();
@@ -2132,6 +2132,9 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
msCaseApplicationMapper.updateByPrimaryKeySelective(application); msCaseApplicationMapper.updateByPrimaryKeySelective(application);
// 根据案件id查询案件 // 根据案件id查询案件
MsCaseApplication caseApplication = msCaseApplicationMapper.selectByPrimaryKey(application.getId()); MsCaseApplication caseApplication = msCaseApplicationMapper.selectByPrimaryKey(application.getId());
if (caseApplication == null) {
throw new ServiceException("未找到案件");
}
caseApplication.setHearDate(application.getHearDate()); caseApplication.setHearDate(application.getHearDate());
ExecutorService executor = ThreadUtil.createThreadPool(); ExecutorService executor = ThreadUtil.createThreadPool();
CompletableFuture.runAsync(() -> { CompletableFuture.runAsync(() -> {
@@ -2141,15 +2144,27 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
// 申请人发送开庭日期短信 // 申请人发送开庭日期短信
sendHearDateSms(caseApplication, affiliates); sendHearDateSms(caseApplication, affiliates);
// 调解员发送开庭短信
sendMeditorHearDateSms(caseApplication,vo);
}
}
}, executor); }, executor);
// 调解员发送短信,根据调解员id查询用户
CompletableFuture.runAsync(() -> { if (caseApplication.getMediatorId() != null) { // 新增日志
CaseLogUtils.insertCaseLog(caseApplication.getId(), currentFlow.getNodeId(), currentFlow.getCaseStatusName(), "");
}
/**
* 调解员发送开庭短信
* @param caseApplication
* @param vo
*/
private void sendMeditorHearDateSms(MsCaseApplication caseApplication, BookingVO vo) {
if (caseApplication.getMediatorId() != null && CollectionUtil.isNotEmpty(vo.getHerDates()) && StrUtil.isNotEmpty(caseApplication.getHearDate())) {
// 线下调解 2077966 尊敬的用户,您的{1}案件,线下调解日期已确定为{2},请知晓,如非本人操作,请忽略本短信。 // 线下调解 2077966 尊敬的用户,您的{1}案件,线下调解日期已确定为{2},请知晓,如非本人操作,请忽略本短信。
SysUser sysUser = sysUserMapper.selectUserById(caseApplication.getMediatorId()); SysUser sysUser = sysUserMapper.selectUserById(caseApplication.getMediatorId());
String content = "尊敬的用户,您的" + caseApplication.getCaseNum() + "的案件,线下调解日期已确定为" + application.getHearDate() + ",请知晓,如非本人操作,请忽略本短信。"; String content = "尊敬的用户,您的" + caseApplication.getCaseNum() + "的案件,线下调解日期已确定为" + caseApplication.getHearDate() + ",请知晓,如非本人操作,请忽略本短信。";
String templateId = "2077966"; String templateId = "2077966";
String subject = "开庭日期通知"; String subject = "开庭日期通知";
MsCaseAffiliate meditorAffliate = new MsCaseAffiliate(); MsCaseAffiliate meditorAffliate = new MsCaseAffiliate();
@@ -2163,17 +2178,17 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
roomUuid = shortMessageService.buildMeetingInfoRecord(meetingInfoVO); roomUuid = shortMessageService.buildMeetingInfoRecord(meetingInfoVO);
// 短信模板:2130103 线上调解时间和会议通知 尊敬的用户,您的{2}线上开庭时间为{3},会议链接https://txroom.xayunmei.com/#/home?{4},请点击链接参加会议,如非本人操作,请忽略本短信. // 短信模板:2130103 线上调解时间和会议通知 尊敬的用户,您的{2}线上开庭时间为{3},会议链接https://txroom.xayunmei.com/#/home?{4},请点击链接参加会议,如非本人操作,请忽略本短信.
content = "尊敬的用户,您的" + caseApplication.getCaseNum() + "线上开庭时间为" + application.getHearDate() + "会议链接https://txroom.xayunmei.com/#/home?" +"authId="+ roomUuid + ",请点击链接参加会议,如非本人操作,请忽略本短信."; content = "尊敬的用户,您的" + caseApplication.getCaseNum() + "线上开庭时间为" + caseApplication.getHearDate() + "会议链接https://txroom.xayunmei.com/#/home?" +"authId="+ roomUuid + ",请点击链接参加会议,如非本人操作,请忽略本短信.";
templateId = "2130103"; templateId = "2130103";
} }
// 电话号不为空,发送短信,否则发邮箱 // 电话号不为空,发送短信,否则发邮箱
if (StrUtil.isNotEmpty(sysUser.getPhonenumber())) { if (StrUtil.isNotEmpty(sysUser.getPhonenumber())) {
if (roomUuid == null) { if (roomUuid == null) {
SmsUtils.sendSms(caseApplication, templateId, sysUser.getPhonenumber(), SmsUtils.sendSms(caseApplication, templateId, sysUser.getPhonenumber(),
new String[]{caseApplication.getCaseNum(), application.getHearDate()}); new String[]{caseApplication.getCaseNum(), caseApplication.getHearDate()});
} else { } else {
SmsUtils.sendSms(caseApplication, templateId, sysUser.getPhonenumber(), SmsUtils.sendSms(caseApplication, templateId, sysUser.getPhonenumber(),
new String[]{caseApplication.getCaseNum(), application.getHearDate(), "authId="+roomUuid}); new String[]{caseApplication.getCaseNum(), caseApplication.getHearDate(), "authId="+roomUuid});
} }
@@ -2182,11 +2197,10 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
caseApplicationService.sendEmail(caseApplication, meditorAffliate, subject, content); caseApplicationService.sendEmail(caseApplication, meditorAffliate, subject, content);
} }
} }, executor); }
// 新增日志
CaseLogUtils.insertCaseLog(caseApplication.getId(), currentFlow.getNodeId(), currentFlow.getCaseStatusName(), "");
} }
/** /**
* 发送开庭日期短信 * 发送开庭日期短信
* @param application * @param application
@@ -2386,6 +2400,10 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
public AjaxResult saveOnlyOfficeFile(MsCaseAttach caseAttach) { public AjaxResult saveOnlyOfficeFile(MsCaseAttach caseAttach) {
if(StrUtil.isEmpty(caseAttach.getAnnexName())) { if(StrUtil.isEmpty(caseAttach.getAnnexName())) {
caseAttach.setAnnexName("调解书"); caseAttach.setAnnexName("调解书");
}
if(StrUtil.isNotEmpty(caseAttach.getAnnexPath())) {
String replace = caseAttach.getAnnexPath().replace("/home/ruoyi/uploadPath", "/profile");
caseAttach.setAnnexPath(replace);
} }
caseAttach.setAnnexType(AnnexTypeEnum.MEDIATE_BOOK.getCode()); caseAttach.setAnnexType(AnnexTypeEnum.MEDIATE_BOOK.getCode());
caseAttach.setUseId(getUserInfo().getUserId()); caseAttach.setUseId(getUserInfo().getUserId());
@@ -2483,8 +2501,8 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
for (MsCaseAttach caseAttach : caseAttachList) { for (MsCaseAttach caseAttach : caseAttachList) {
if (caseAttach.getAnnexType() == AnnexTypeEnum.MEDIATE_BOOK.getCode()) { if (caseAttach.getAnnexType() == AnnexTypeEnum.MEDIATE_BOOK.getCode()) {
String annexPath = caseAttach.getAnnexPath(); String annexPath = caseAttach.getAnnexPath();
if (annexPath.contains("/profile/upload")) { if (annexPath.contains("/profile")) {
annexPath = annexPath.replace("/profile/upload", "/home/ruoyi/uploadPath/upload"); annexPath = annexPath.replace("/profile", "/home/ruoyi/uploadPath");
} }
String path = annexPath; String path = annexPath;
//获取文件上传地址 //获取文件上传地址
@@ -2829,8 +2847,8 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
for (MsCaseAttach caseAttach : caseAttachList) { for (MsCaseAttach caseAttach : caseAttachList) {
if (caseAttach.getAnnexType() == AnnexTypeEnum.MEDIATE_BOOK.getCode()) { if (caseAttach.getAnnexType() == AnnexTypeEnum.MEDIATE_BOOK.getCode()) {
String annexPath = caseAttach.getAnnexPath(); String annexPath = caseAttach.getAnnexPath();
if (annexPath.contains("/profile/upload")) { if (annexPath.contains("/profile")) {
annexPath = annexPath.replace("/profile/upload", "/home/ruoyi/uploadPath/upload"); annexPath = annexPath.replace("/profile", "/home/ruoyi/uploadPath");
} }
String path = annexPath; String path = annexPath;
//获取文件上传地址 //获取文件上传地址
@@ -2959,7 +2977,7 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
SmsUtils.sendSms(application, "2047719",resAffiliateOpt.get().getPhone(), new String[]{resAffiliateOpt.get().getName(), application.getCaseNum(), urlResponnew}); SmsUtils.sendSms(application, "2047719",resAffiliateOpt.get().getPhone(), new String[]{resAffiliateOpt.get().getName(), application.getCaseNum(), urlResponnew});
} else { } else {
throw new ServiceException(jsonObject3.getString("message")); return AjaxResult.error(jsonObject3.getString("message"));
} }
} else { } else {
return AjaxResult.error(); return AjaxResult.error();
@@ -3019,14 +3037,20 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
List<MsCaseAttach> msCaseAttaches = msCaseAttachMapper.listCaseAttachByCaseIdAndType(req.getId(), AnnexTypeEnum.MEDIATE_BOOK.getCode()); List<MsCaseAttach> msCaseAttaches = msCaseAttachMapper.listCaseAttachByCaseIdAndType(req.getId(), AnnexTypeEnum.MEDIATE_BOOK.getCode());
if (StrUtil.isEmpty(application.getCaseSource()) && CollectionUtil.isNotEmpty(msCaseAttaches)) { if (StrUtil.isEmpty(application.getCaseSource()) && CollectionUtil.isNotEmpty(msCaseAttaches)) {
for (MsCaseAttach msCaseAttach : msCaseAttaches) { for (MsCaseAttach msCaseAttach : msCaseAttaches) {
String templatePath = "/home/ruoyi" + msCaseAttach.getAnnexPath(); if (StrUtil.isEmpty(msCaseAttach.getAnnexPath())) {
File file = new File(templatePath.replace("/profile", "/uploadPath")); continue;
}
String replacePath = msCaseAttach.getAnnexPath().replace("/profile/", "/home/ruoyi/uploadPath/");
File file = new File(replacePath);
MsCaseFileInfo caseFileInfo = beiMingInterfaceService.pushAttachmentInfo(BMUserName, BMPassword, file, BMSyncSource, application.getCaseNum(), AttachmentOperateTypeEnum.ADD, DocumentTypeEnum.EVEDENT_AGREEMENT); MsCaseFileInfo caseFileInfo = beiMingInterfaceService.pushAttachmentInfo(BMUserName, BMPassword, file, BMSyncSource, application.getCaseNum(), AttachmentOperateTypeEnum.ADD, DocumentTypeEnum.EVEDENT_AGREEMENT);
// 更新附件表 // 更新附件表
if (caseFileInfo != null && StrUtil.isNotEmpty(caseFileInfo.getFileId())) { if (caseFileInfo != null && StrUtil.isNotEmpty(caseFileInfo.getFileId())) {
msCaseAttach.setOtherSysFileId(caseFileInfo.getFileId()); msCaseAttach.setOtherSysFileId(caseFileInfo.getFileId());
msCaseAttachMapper.updateCaseAttach(msCaseAttach); msCaseAttachMapper.updateCaseAttach(msCaseAttach);
} }
} }
} }
// 修改案件状态为待送达 // 修改案件状态为待送达
@@ -3398,12 +3422,19 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
caseAttach= MsCaseAttach.builder() caseAttach= MsCaseAttach.builder()
.caseAppliId(application.getId()) .caseAppliId(application.getId())
.annexName(jsonObject.getString("fileName")) .annexName(jsonObject.getString("fileName"))
.annexPath(jsonObject.getString("filePath"))
.annexType(annexType) .annexType(annexType)
.onlyOfficeFileId(jsonObject.getString("fileId")) .onlyOfficeFileId(jsonObject.getString("fileId"))
.build(); .build();
if(jsonObject.get("filePath")!=null){
String officePath = jsonObject.getString("filePath");
String replace = officePath.replace("/home/ruoyi/uploadPath/", "/profile/");
caseAttach.setAnnexPath(replace);
}
} }
//保存到附件表里,先删除之前的在保存 //保存到附件表里,先删除之前的在保存
msCaseAttachMapper.deleteCaseAttachByCasedIdAndType(caseAttach.getCaseAppliId(), annexType); msCaseAttachMapper.deleteCaseAttachByCasedIdAndType(caseAttach.getCaseAppliId(), annexType);
msCaseAttachMapper.save(caseAttach); msCaseAttachMapper.save(caseAttach);
@@ -3430,16 +3461,20 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
msCaseAttachMapper.deleteCaseAttachByCasedIdAndType(caseAttach.getCaseAppliId(), annexType); msCaseAttachMapper.deleteCaseAttachByCasedIdAndType(caseAttach.getCaseAppliId(), annexType);
if(StrUtil.isEmpty(application.getCaseSource())) { if(StrUtil.isEmpty(application.getCaseSource())) {
// 北明推送 // 北明推送
String path = "/home/ruoyi" + caseAttach.getAnnexPath(); if (StrUtil.isNotEmpty(caseAttach.getAnnexPath())) {
File file = new File(path.replace("/profile", "/uploadPath")); String replacePath = caseAttach.getAnnexPath().replace("/profile/", "/home/ruoyi/uploadPath/");
MsCaseFileInfo caseFileInfo = beiMingInterfaceService.pushAttachmentInfo(BMUserName, BMPassword, file, BMSyncSource, application.getCaseNum(), AttachmentOperateTypeEnum.ADD, DocumentTypeEnum.EVEDENT_APPLY_BOOK); File file = new File(replacePath);
MsCaseFileInfo caseFileInfo = beiMingInterfaceService.pushAttachmentInfo(BMUserName, BMPassword, file, BMSyncSource, application.getCaseNum(), AttachmentOperateTypeEnum.ADD, DocumentTypeEnum.EVEDENT_APPLY_BOOK);
// 更新附件表 // 更新附件表
if (caseFileInfo != null && StrUtil.isNotEmpty(caseFileInfo.getFileId())) { if (caseFileInfo != null && StrUtil.isNotEmpty(caseFileInfo.getFileId())) {
caseAttach.setOtherSysFileId(caseFileInfo.getFileId()); caseAttach.setOtherSysFileId(caseFileInfo.getFileId());
}
} }
} msCaseAttachMapper.save(caseAttach);
msCaseAttachMapper.save(caseAttach); }
} }
} }
@@ -3451,7 +3486,7 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
@Override @Override
@Transactional @Transactional
public JSONArray uploadOnlyOffice(String annexPath,Long caseId) { public JSONArray uploadOnlyOffice(String annexPath,Long caseId) {
annexPath=annexPath.replace("/profile","/home/ruoyi/uploadPath"); annexPath=annexPath.replace("/profile/","/home/ruoyi/uploadPath/");
File file = new File(annexPath); File file = new File(annexPath);
if (file.exists()) { if (file.exists()) {
// 调用onlyoffice // 调用onlyoffice
@@ -59,6 +59,7 @@ import com.ruoyi.wisdomarbitrate.service.shortmessage.ShortMessageService;
import com.ruoyi.wisdomarbitrate.utils.CaseLogUtils; import com.ruoyi.wisdomarbitrate.utils.CaseLogUtils;
import com.ruoyi.wisdomarbitrate.utils.SignAward; import com.ruoyi.wisdomarbitrate.utils.SignAward;
import com.ruoyi.wisdomarbitrate.utils.SmsUtils; import com.ruoyi.wisdomarbitrate.utils.SmsUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
@@ -76,7 +77,7 @@ import java.util.concurrent.ExecutorService;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import static com.ruoyi.common.core.domain.AjaxResult.success; import static com.ruoyi.common.core.domain.AjaxResult.success;
@Slf4j
@Service @Service
public class MsSignSealServiceImpl implements MsSignSealService { public class MsSignSealServiceImpl implements MsSignSealService {
@@ -706,6 +707,7 @@ public class MsSignSealServiceImpl implements MsSignSealService {
JSONObject jsonObjectCallback = JSONObject.parseObject(reqbodystr); JSONObject jsonObjectCallback = JSONObject.parseObject(reqbodystr);
Gson gson = new Gson(); Gson gson = new Gson();
if (jsonObjectCallback != null) { if (jsonObjectCallback != null) {
log.info("签名回调======"+jsonObjectCallback);
int signResult = jsonObjectCallback.getIntValue("signResult"); int signResult = jsonObjectCallback.getIntValue("signResult");
String action = jsonObjectCallback.getString("action"); String action = jsonObjectCallback.getString("action");
String signFlowId = jsonObjectCallback.getString("signFlowId"); String signFlowId = jsonObjectCallback.getString("signFlowId");
@@ -857,11 +859,15 @@ public class MsSignSealServiceImpl implements MsSignSealService {
//修改"签署用印记录表"的状态为待用印 //修改"签署用印记录表"的状态为待用印
if(caseApplicationselect.getSealFlag()!=null&&caseApplicationselect.getSealFlag()==1) { if(caseApplicationselect.getSealFlag()!=null&&caseApplicationselect.getSealFlag()==1) {
sealSignRecordsel.setSignFlowStatus(2); sealSignRecordsel.setSignFlowStatus(2);
sealSignRecordMapper.updateByPrimaryKeySelective(sealSignRecordsel);
}else { }else {
// 否则为已完成 // 否则为已完成
sealSignRecordsel.setSignFlowStatus(3); sealSignRecordsel.setSignFlowStatus(3);
sealSignRecordMapper.updateByPrimaryKeySelective(sealSignRecordsel);
// 下载调解书
downloadMediationBook(caseApplicationselect,signFlowId,gson,caseAppliId);
} }
sealSignRecordMapper.updateByPrimaryKeySelective(sealSignRecordsel);
} }
}else if(StringUtils.isNotEmpty(accountMobile)&&accountMobile.equals(orgnNamePsnAcc) && caseApplicationselect.getSealFlag()!=null && caseApplicationselect.getSealFlag()==1 ){ }else if(StringUtils.isNotEmpty(accountMobile)&&accountMobile.equals(orgnNamePsnAcc) && caseApplicationselect.getSealFlag()!=null && caseApplicationselect.getSealFlag()==1 ){
//需要用印 //需要用印
@@ -915,71 +921,72 @@ public class MsSignSealServiceImpl implements MsSignSealService {
sealSignRecordMapper.updateByPrimaryKeySelective(sealSignRecordsel); sealSignRecordMapper.updateByPrimaryKeySelective(sealSignRecordsel);
//下载审核完成的调解书 //下载审核完成的调解书
EsignHttpResponse fileDownload = SaaSAPIFileUtils.fileDownloadUrl(signFlowId); downloadMediationBook(caseApplicationselect,signFlowId,gson,caseAppliId);
JsonObject fileDownloadJsonObject = gson.fromJson(fileDownload.getBody(), JsonObject.class); // EsignHttpResponse fileDownload = SaaSAPIFileUtils.fileDownloadUrl(signFlowId);
JsonObject fileDownloadData = fileDownloadJsonObject.getAsJsonObject("data"); // JsonObject fileDownloadJsonObject = gson.fromJson(fileDownload.getBody(), JsonObject.class);
JsonArray filesArray = fileDownloadData.get("files").getAsJsonArray(); // JsonObject fileDownloadData = fileDownloadJsonObject.getAsJsonObject("data");
if (filesArray != null && filesArray.size() > 0) { // JsonArray filesArray = fileDownloadData.get("files").getAsJsonArray();
JsonObject fileObject = (JsonObject) filesArray.get(0); // if (filesArray != null && filesArray.size() > 0) {
String fileDownloadUrl = fileObject.get("downloadUrl").toString(); // JsonObject fileObject = (JsonObject) filesArray.get(0);
LocalDate now = LocalDate.now(); // String fileDownloadUrl = fileObject.get("downloadUrl").toString();
String year = Integer.toString(now.getYear()); // LocalDate now = LocalDate.now();
String month = String.format("%02d", now.getMonthValue()); // String year = Integer.toString(now.getYear());
String day = String.format("%02d", now.getDayOfMonth()); // String month = String.format("%02d", now.getMonthValue());
String saveFolderPath = "/home/ruoyi/uploadPath/upload/" + year + "/" + month + "/" + day; // String day = String.format("%02d", now.getDayOfMonth());
String fileName = UUID.randomUUID().toString().replace("-", "") + ".pdf"; // String saveFolderPath = "/home/ruoyi/uploadPath/upload/" + year + "/" + month + "/" + day;
String saveName = fileName; // String fileName = UUID.randomUUID().toString().replace("-", "") + ".pdf";
String savePath = "/profile/upload/" + year + "/" + month + "/" + day + "/" + fileName; // String saveName = fileName;
// String savePath = "/profile/upload/" + year + "/" + month + "/" + day + "/" + fileName;
// 创建日期目录 //
File saveFolder = new File(saveFolderPath); // // 创建日期目录
if (!saveFolder.exists()) { // File saveFolder = new File(saveFolderPath);
saveFolder.mkdirs(); // if (!saveFolder.exists()) {
} // saveFolder.mkdirs();
String resultFilePath = saveFolderPath + "/" + fileName; // }
File resultFilePathFile = new File(resultFilePath); // String resultFilePath = saveFolderPath + "/" + fileName;
if (!resultFilePathFile.exists()) { // File resultFilePathFile = new File(resultFilePath);
resultFilePathFile.createNewFile(); // if (!resultFilePathFile.exists()) {
} // resultFilePathFile.createNewFile();
// }
String fileDownloadUrlnew = fileDownloadUrl.substring(1, fileDownloadUrl.length() - 1); //
boolean downLoadFile = FileTransformation.downLoadFileByUrl(fileDownloadUrlnew, resultFilePath); // String fileDownloadUrlnew = fileDownloadUrl.substring(1, fileDownloadUrl.length() - 1);
if (downLoadFile) { // boolean downLoadFile = FileTransformation.downLoadFileByUrl(fileDownloadUrlnew, resultFilePath);
// 先删除已经存在的调解书 // if (downLoadFile) {
if(StrUtil.isEmpty(caseApplicationselect.getCaseSource())){ // // 先删除已经存在的调解书
List<MsCaseAttach> existAttach = msCaseAttachMapper.listCaseAttachByCaseIdAndType(caseAppliId, AnnexTypeEnum.MEDIATE_BOOK.getCode()); // if(StrUtil.isEmpty(caseApplicationselect.getCaseSource())){
if(CollectionUtil.isNotEmpty(existAttach)){ // List<MsCaseAttach> existAttach = msCaseAttachMapper.listCaseAttachByCaseIdAndType(caseAppliId, AnnexTypeEnum.MEDIATE_BOOK.getCode());
// 对接北明,同步案件状态,删除 // if(CollectionUtil.isNotEmpty(existAttach)){
for (MsCaseAttach msCaseAttach : existAttach) { // // 对接北明,同步案件状态,删除
if(StrUtil.isEmpty(msCaseAttach.getOtherSysFileId())||StrUtil.isEmpty(msCaseAttach.getAnnexPath())){ // for (MsCaseAttach msCaseAttach : existAttach) {
continue; // if(StrUtil.isEmpty(msCaseAttach.getOtherSysFileId())||StrUtil.isEmpty(msCaseAttach.getAnnexPath())){
} // continue;
beiMingInterfaceService.deleteAttachmentInfo(caseApplicationselect.getCaseNum(), msCaseAttach.getOtherSysFileId(), FileUtil.getName(msCaseAttach.getAnnexPath())); // }
} // beiMingInterfaceService.deleteAttachmentInfo(caseApplicationselect.getCaseNum(), msCaseAttach.getOtherSysFileId(), FileUtil.getName(msCaseAttach.getAnnexPath()));
} // }
} // }
msCaseAttachMapper.deleteCaseAttachByCasedIdAndType(caseAppliId, AnnexTypeEnum.MEDIATE_BOOK.getCode()); // }
MsCaseAttach caseAttach = new MsCaseAttach(); // msCaseAttachMapper.deleteCaseAttachByCasedIdAndType(caseAppliId, AnnexTypeEnum.MEDIATE_BOOK.getCode());
caseAttach.setCaseAppliId(caseAppliId); // MsCaseAttach caseAttach = new MsCaseAttach();
caseAttach.setAnnexType(AnnexTypeEnum.MEDIATE_BOOK.getCode()); // caseAttach.setCaseAppliId(caseAppliId);
caseAttach.setAnnexPath(savePath); // caseAttach.setAnnexType(AnnexTypeEnum.MEDIATE_BOOK.getCode());
caseAttach.setAnnexName(saveName); // caseAttach.setAnnexPath(savePath);
caseAttachMapper.save(caseAttach); // caseAttach.setAnnexName(saveName);
// 对接北明,调用上传附件接口 // caseAttachMapper.save(caseAttach);
if(StrUtil.isEmpty(caseApplicationselect.getCaseSource()) ) { // // 对接北明,调用上传附件接口
String templatePath = "/home/ruoyi" + savePath; // if(StrUtil.isEmpty(caseApplicationselect.getCaseSource()) ) {
File file = new File(templatePath.replace("/profile", "/uploadPath")); // String templatePath = "/home/ruoyi" + savePath;
MsCaseFileInfo caseFileInfo = beiMingInterfaceService.pushAttachmentInfo(BMUserName, BMPassword, file, BMSyncSource, caseApplicationselect.getCaseNum(), AttachmentOperateTypeEnum.ADD,DocumentTypeEnum.EVEDENT_AGREEMENT); // File file = new File(templatePath.replace("/profile", "/uploadPath"));
// 更新附件表 // MsCaseFileInfo caseFileInfo = beiMingInterfaceService.pushAttachmentInfo(BMUserName, BMPassword, file, BMSyncSource, caseApplicationselect.getCaseNum(), AttachmentOperateTypeEnum.ADD,DocumentTypeEnum.EVEDENT_AGREEMENT);
if(caseFileInfo!=null && StrUtil.isNotEmpty(caseFileInfo.getFileId())){ // // 更新附件表
caseAttach.setOtherSysFileId(caseFileInfo.getFileId()); // if(caseFileInfo!=null && StrUtil.isNotEmpty(caseFileInfo.getFileId())){
msCaseAttachMapper.updateCaseAttachBycaseid(caseAttach); // caseAttach.setOtherSysFileId(caseFileInfo.getFileId());
} // msCaseAttachMapper.updateCaseAttachBycaseid(caseAttach);
// }
} //
} // }
// }
} //
// }
} }
}else if(StringUtils.isNotEmpty(accountMobile)&&accountMobile.equals(pensonAccountRes)){ }else if(StringUtils.isNotEmpty(accountMobile)&&accountMobile.equals(pensonAccountRes)){
//被申请人签名 //被申请人签名
@@ -1005,71 +1012,72 @@ public class MsSignSealServiceImpl implements MsSignSealService {
sealSignRecordMapper.updateByPrimaryKeySelective(sealSignRecordsel); sealSignRecordMapper.updateByPrimaryKeySelective(sealSignRecordsel);
//下载审核完成的调解书 //下载审核完成的调解书
EsignHttpResponse fileDownload = SaaSAPIFileUtils.fileDownloadUrl(signFlowId); downloadMediationBook(caseApplicationselect,signFlowId,gson,caseAppliId);
JsonObject fileDownloadJsonObject = gson.fromJson(fileDownload.getBody(), JsonObject.class); // EsignHttpResponse fileDownload = SaaSAPIFileUtils.fileDownloadUrl(signFlowId);
JsonObject fileDownloadData = fileDownloadJsonObject.getAsJsonObject("data"); // JsonObject fileDownloadJsonObject = gson.fromJson(fileDownload.getBody(), JsonObject.class);
JsonArray filesArray = fileDownloadData.get("files").getAsJsonArray(); // JsonObject fileDownloadData = fileDownloadJsonObject.getAsJsonObject("data");
if (filesArray != null && filesArray.size() > 0) { // JsonArray filesArray = fileDownloadData.get("files").getAsJsonArray();
JsonObject fileObject = (JsonObject) filesArray.get(0); // if (filesArray != null && filesArray.size() > 0) {
String fileDownloadUrl = fileObject.get("downloadUrl").toString(); // JsonObject fileObject = (JsonObject) filesArray.get(0);
LocalDate now = LocalDate.now(); // String fileDownloadUrl = fileObject.get("downloadUrl").toString();
String year = Integer.toString(now.getYear()); // LocalDate now = LocalDate.now();
String month = String.format("%02d", now.getMonthValue()); // String year = Integer.toString(now.getYear());
String day = String.format("%02d", now.getDayOfMonth()); // String month = String.format("%02d", now.getMonthValue());
String saveFolderPath = "/home/ruoyi/uploadPath/upload/" + year + "/" + month + "/" + day; // String day = String.format("%02d", now.getDayOfMonth());
String fileName = UUID.randomUUID().toString().replace("-", "") + ".pdf"; // String saveFolderPath = "/home/ruoyi/uploadPath/upload/" + year + "/" + month + "/" + day;
String saveName = fileName; // String fileName = UUID.randomUUID().toString().replace("-", "") + ".pdf";
String savePath = "/profile/upload/" + year + "/" + month + "/" + day + "/" + fileName; // String saveName = fileName;
// String savePath = "/profile/upload/" + year + "/" + month + "/" + day + "/" + fileName;
// 创建日期目录 //
File saveFolder = new File(saveFolderPath); // // 创建日期目录
if (!saveFolder.exists()) { // File saveFolder = new File(saveFolderPath);
saveFolder.mkdirs(); // if (!saveFolder.exists()) {
} // saveFolder.mkdirs();
String resultFilePath = saveFolderPath + "/" + fileName; // }
File resultFilePathFile = new File(resultFilePath); // String resultFilePath = saveFolderPath + "/" + fileName;
if (!resultFilePathFile.exists()) { // File resultFilePathFile = new File(resultFilePath);
resultFilePathFile.createNewFile(); // if (!resultFilePathFile.exists()) {
} // resultFilePathFile.createNewFile();
// }
String fileDownloadUrlnew = fileDownloadUrl.substring(1, fileDownloadUrl.length() - 1); //
boolean downLoadFile = FileTransformation.downLoadFileByUrl(fileDownloadUrlnew, resultFilePath); // String fileDownloadUrlnew = fileDownloadUrl.substring(1, fileDownloadUrl.length() - 1);
if (downLoadFile) { // boolean downLoadFile = FileTransformation.downLoadFileByUrl(fileDownloadUrlnew, resultFilePath);
// 先删除已经存在的调解书 // if (downLoadFile) {
if(StrUtil.isEmpty(caseApplicationselect.getCaseSource())){ // // 先删除已经存在的调解书
List<MsCaseAttach> existAttach = msCaseAttachMapper.listCaseAttachByCaseIdAndType(caseAppliId, AnnexTypeEnum.MEDIATE_BOOK.getCode()); // if(StrUtil.isEmpty(caseApplicationselect.getCaseSource())){
if(CollectionUtil.isNotEmpty(existAttach)){ // List<MsCaseAttach> existAttach = msCaseAttachMapper.listCaseAttachByCaseIdAndType(caseAppliId, AnnexTypeEnum.MEDIATE_BOOK.getCode());
// 对接北明,同步案件状态,删除 // if(CollectionUtil.isNotEmpty(existAttach)){
for (MsCaseAttach msCaseAttach : existAttach) { // // 对接北明,同步案件状态,删除
if(StrUtil.isEmpty(msCaseAttach.getOtherSysFileId())||StrUtil.isEmpty(msCaseAttach.getAnnexPath())){ // for (MsCaseAttach msCaseAttach : existAttach) {
continue; // if(StrUtil.isEmpty(msCaseAttach.getOtherSysFileId())||StrUtil.isEmpty(msCaseAttach.getAnnexPath())){
} // continue;
beiMingInterfaceService.deleteAttachmentInfo(caseApplicationselect.getCaseNum(), msCaseAttach.getOtherSysFileId(), FileUtil.getName(msCaseAttach.getAnnexPath())); // }
} // beiMingInterfaceService.deleteAttachmentInfo(caseApplicationselect.getCaseNum(), msCaseAttach.getOtherSysFileId(), FileUtil.getName(msCaseAttach.getAnnexPath()));
} // }
} // }
msCaseAttachMapper.deleteCaseAttachByCasedIdAndType(caseAppliId, AnnexTypeEnum.MEDIATE_BOOK.getCode()); // }
MsCaseAttach caseAttach = new MsCaseAttach(); // msCaseAttachMapper.deleteCaseAttachByCasedIdAndType(caseAppliId, AnnexTypeEnum.MEDIATE_BOOK.getCode());
caseAttach.setCaseAppliId(caseAppliId); // MsCaseAttach caseAttach = new MsCaseAttach();
caseAttach.setAnnexType(7); // caseAttach.setCaseAppliId(caseAppliId);
caseAttach.setAnnexPath(savePath); // caseAttach.setAnnexType(7);
caseAttach.setAnnexName(saveName); // caseAttach.setAnnexPath(savePath);
// caseAttach.setAnnexName(saveName);
// 对接北明,调用上传附件接口 //
// // 对接北明,调用上传附件接口
if(StrUtil.isEmpty(caseApplicationselect.getCaseSource()) ) { //
String templatePath = "/home/ruoyi" + savePath; // if(StrUtil.isEmpty(caseApplicationselect.getCaseSource()) ) {
File file = new File(templatePath.replace("/profile", "/uploadPath")); // String templatePath = "/home/ruoyi" + savePath;
MsCaseFileInfo caseFileInfo = beiMingInterfaceService.pushAttachmentInfo(BMUserName, BMPassword, file, BMSyncSource, caseApplicationselect.getCaseNum(), AttachmentOperateTypeEnum.ADD,DocumentTypeEnum.EVEDENT_AGREEMENT); // File file = new File(templatePath.replace("/profile", "/uploadPath"));
// 更新附件表 // MsCaseFileInfo caseFileInfo = beiMingInterfaceService.pushAttachmentInfo(BMUserName, BMPassword, file, BMSyncSource, caseApplicationselect.getCaseNum(), AttachmentOperateTypeEnum.ADD,DocumentTypeEnum.EVEDENT_AGREEMENT);
if(caseFileInfo!=null && StrUtil.isNotEmpty(caseFileInfo.getFileId())){ // // 更新附件表
caseAttach.setOtherSysFileId(caseFileInfo.getFileId()); // if(caseFileInfo!=null && StrUtil.isNotEmpty(caseFileInfo.getFileId())){
} // caseAttach.setOtherSysFileId(caseFileInfo.getFileId());
} // }
caseAttachMapper.save(caseAttach); // }
} // caseAttachMapper.save(caseAttach);
// }
} //
// }
} }
} }
} }
@@ -1082,10 +1090,13 @@ public class MsSignSealServiceImpl implements MsSignSealService {
} }
private void downloadMediationBook(MsCaseApplication caseApplicationselect, String signFlowId, Gson gson, Long caseAppliId) throws EsignDemoException, IOException { private void downloadMediationBook(MsCaseApplication caseApplicationselect, String signFlowId, Gson gson, Long caseAppliId) throws EsignDemoException, IOException {
log.info("signFlowId===="+signFlowId);
EsignHttpResponse fileDownload = SaaSAPIFileUtils.fileDownloadUrl(signFlowId); EsignHttpResponse fileDownload = SaaSAPIFileUtils.fileDownloadUrl(signFlowId);
log.info("下载成功===="+fileDownload);
JsonObject fileDownloadJsonObject = gson.fromJson(fileDownload.getBody(), JsonObject.class); JsonObject fileDownloadJsonObject = gson.fromJson(fileDownload.getBody(), JsonObject.class);
JsonObject fileDownloadData = fileDownloadJsonObject.getAsJsonObject("data"); JsonObject fileDownloadData = fileDownloadJsonObject.getAsJsonObject("data");
JsonArray filesArray = fileDownloadData.get("files").getAsJsonArray(); JsonArray filesArray = fileDownloadData.get("files").getAsJsonArray();
log.info("下载调解书pdf===="+filesArray);
if (filesArray != null && filesArray.size() > 0) { if (filesArray != null && filesArray.size() > 0) {
JsonObject fileObject = (JsonObject) filesArray.get(0); JsonObject fileObject = (JsonObject) filesArray.get(0);
String fileDownloadUrl = fileObject.get("downloadUrl").toString(); String fileDownloadUrl = fileObject.get("downloadUrl").toString();
@@ -1111,6 +1122,7 @@ public class MsSignSealServiceImpl implements MsSignSealService {
String fileDownloadUrlnew = fileDownloadUrl.substring(1, fileDownloadUrl.length() - 1); String fileDownloadUrlnew = fileDownloadUrl.substring(1, fileDownloadUrl.length() - 1);
boolean downLoadFile = FileTransformation.downLoadFileByUrl(fileDownloadUrlnew, resultFilePath); boolean downLoadFile = FileTransformation.downLoadFileByUrl(fileDownloadUrlnew, resultFilePath);
log.info("是否下载成功======="+downLoadFile);
if (downLoadFile) { if (downLoadFile) {
// 先删除已经存在的调解书 // 先删除已经存在的调解书
if(StrUtil.isEmpty(caseApplicationselect.getCaseSource())){ if(StrUtil.isEmpty(caseApplicationselect.getCaseSource())){
@@ -1126,11 +1138,13 @@ public class MsSignSealServiceImpl implements MsSignSealService {
} }
} }
msCaseAttachMapper.deleteCaseAttachByCasedIdAndType(caseAppliId, AnnexTypeEnum.MEDIATE_BOOK.getCode()); msCaseAttachMapper.deleteCaseAttachByCasedIdAndType(caseAppliId, AnnexTypeEnum.MEDIATE_BOOK.getCode());
MsCaseAttach caseAttach = new MsCaseAttach(); MsCaseAttach caseAttach = new MsCaseAttach();
caseAttach.setCaseAppliId(caseAppliId); caseAttach.setCaseAppliId(caseAppliId);
caseAttach.setAnnexType(AnnexTypeEnum.MEDIATE_BOOK.getCode()); caseAttach.setAnnexType(AnnexTypeEnum.MEDIATE_BOOK.getCode());
caseAttach.setAnnexPath(savePath); caseAttach.setAnnexPath(savePath);
caseAttach.setAnnexName(saveName); caseAttach.setAnnexName(saveName);
log.info("调解书保存======="+downLoadFile);
caseAttachMapper.save(caseAttach); caseAttachMapper.save(caseAttach);
// 对接北明,调用上传附件接口 // 对接北明,调用上传附件接口
if(StrUtil.isEmpty(caseApplicationselect.getCaseSource()) ) { if(StrUtil.isEmpty(caseApplicationselect.getCaseSource()) ) {
@@ -113,7 +113,7 @@
<select id="list" resultType="com.ruoyi.wisdomarbitrate.domain.vo.mscase.MsCaseApplicationVO"> <select id="list" resultType="com.ruoyi.wisdomarbitrate.domain.vo.mscase.MsCaseApplicationVO">
select t.* from( select t.* from(
SELECT SELECT
c.id,c.case_source caseSource,c.media_result mediaResult,c.room_id roomId,0 AS pendingStatus, c.id,c.mediator_id mediatorId,c.case_source caseSource,c.media_result mediaResult,c.room_id roomId,0 AS pendingStatus,
c.case_flow_id caseFlowId,c.batch_number batchNumber,c.case_num caseNum, c.case_flow_id caseFlowId,c.batch_number batchNumber,c.case_num caseNum,
u1.nick_name mediatorName,c.hear_date hearDate,c.case_status_name caseStatusName,c.create_time createTime, u1.nick_name mediatorName,c.hear_date hearDate,c.case_status_name caseStatusName,c.create_time createTime,
c.mediation_method mediationMethod, c.mediation_method mediationMethod,
@@ -123,7 +123,7 @@
c.id c.id
union union
SELECT SELECT
c.id,c.case_source caseSource,c.media_result mediaResult,c.room_id roomId,1 AS pendingStatus, c.id,c.mediator_id mediatorId,c.case_source caseSource,c.media_result mediaResult,c.room_id roomId,1 AS pendingStatus,
c.case_flow_id caseFlowId,c.batch_number batchNumber,c.case_num caseNum, c.case_flow_id caseFlowId,c.batch_number batchNumber,c.case_num caseNum,
u1.nick_name mediatorName,c.hear_date hearDate,c.case_status_name caseStatusName,c.create_time createTime, u1.nick_name mediatorName,c.hear_date hearDate,c.case_status_name caseStatusName,c.create_time createTime,
c.mediation_method mediationMethod, c.mediation_method mediationMethod,