优化和解功能

This commit is contained in:
qitz
2024-01-30 11:48:52 +08:00
parent 8ae21c43f8
commit 2396a98b2d
3 changed files with 150 additions and 70 deletions
@@ -18,4 +18,7 @@ public interface MsCaseFlowMapper extends Mapper<MsCaseFlow> {
@Select("select f1.id,f1.node_id nodeId,f1.node_name nodeName,f1.case_status_name caseStatusName,f1.back_flow_id backFlowId,f1.sort from ms_case_flow f1 join ms_case_flow f2 on f2.id=#{caseFlowId} and f1.sort >= f2.sort+1 ") @Select("select f1.id,f1.node_id nodeId,f1.node_name nodeName,f1.case_status_name caseStatusName,f1.back_flow_id backFlowId,f1.sort from ms_case_flow f1 join ms_case_flow f2 on f2.id=#{caseFlowId} and f1.sort >= f2.sort+1 ")
List<MsCaseFlow> nextFlowall(Integer caseFlowId); List<MsCaseFlow> nextFlowall(Integer caseFlowId);
@Select("select f1.id,f1.node_id nodeId,f1.node_name nodeName,f1.case_status_name caseStatusName,f1.back_flow_id backFlowId,f1.sort from ms_case_flow f1 join ms_case_flow f2 on f2.id=#{caseFlowId} and f1.sort=f2.sort+3 ")
MsCaseFlow nextFlow1(Integer caseFlowId);
} }
@@ -1236,6 +1236,9 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
Long id = attach.getCaseAppliId(); Long id = attach.getCaseAppliId();
MsCaseApplication caseApplication = msCaseApplicationMapper.selectByPrimaryKey(id); MsCaseApplication caseApplication = msCaseApplicationMapper.selectByPrimaryKey(id);
caseApplication.setIsReconci(attach.getIsReconci());
msCaseApplicationMapper.updateByPrimaryKeySelective(caseApplication);
// 查询案件相关人员 // 查询案件相关人员
MsCaseAffiliate caseAffiliate = msCaseAffiliateMapper.selectByPrimaryKey(id); MsCaseAffiliate caseAffiliate = msCaseAffiliateMapper.selectByPrimaryKey(id);
Integer isReconci = attach.getIsReconci(); Integer isReconci = attach.getIsReconci();
@@ -286,86 +286,160 @@ public class FixSelectFlowDetailUtils {
List<Integer> psnsignStatusListnew = psnsignStatusList.stream().distinct().collect(Collectors.toList()); List<Integer> psnsignStatusListnew = psnsignStatusList.stream().distinct().collect(Collectors.toList());
if (( psnsignStatusListnew.size()==1 && (psnsignStatusListnew.get(0).intValue() == 2)) && (orgsignStatus.intValue() == 1)) { MsCaseApplication caseApplicationselect = msCaseApplicationMapper.selectByPrimaryKey(sealSignRecord.getCaseAppliId());
//更新立案申请状态为待用印 Integer isReconci = caseApplicationselect.getIsReconci();
MsCaseApplication caseApplicationselect = msCaseApplicationMapper.selectByPrimaryKey(sealSignRecord.getCaseAppliId()); if(isReconci!=null){
if ((mssealSignRecord.getSignFlowStatus() != null) && (mssealSignRecord.getSignFlowStatus().intValue() == 1)) { if(isReconci.intValue()==1){
// 根据流程id查找下一个流程节点 if (( psnsignStatusListnew.size()==1 && (psnsignStatusListnew.get(0).intValue() == 2))) {
MsCaseFlow nextFlow = caseFlowMapper.nextFlow(caseApplicationselect.getCaseFlowId().intValue()); //更新立案申请状态为待送达
MsCaseApplication application = new MsCaseApplication(); // MsCaseApplication caseApplicationselect = msCaseApplicationMapper.selectByPrimaryKey(sealSignRecord.getCaseAppliId());
application.setId(caseApplicationselect.getId()); if ((mssealSignRecord.getSignFlowStatus() != null) && (mssealSignRecord.getSignFlowStatus().intValue() == 1)) {
application.setCaseFlowId(nextFlow.getId()); MsCaseFlow nextFlow = caseFlowMapper.nextFlow1(caseApplicationselect.getCaseFlowId().intValue());
application.setCaseStatusName(nextFlow.getCaseStatusName()); MsCaseApplication application = new MsCaseApplication();
caseApplicationMapper.updateByPrimaryKeySelective(application); application.setId(caseApplicationselect.getId());
application.setCaseFlowId(nextFlow.getId());
application.setCaseStatusName(nextFlow.getCaseStatusName());
caseApplicationMapper.updateByPrimaryKeySelective(application);
//修改"签署用印记录表"的状态为待用印 //修改"签署用印记录表"的状态为完成
mssealSignRecord.setSignFlowStatus(2); mssealSignRecord.setSignFlowStatus(3);
sealSignRecordMapper.updateByPrimaryKeySelective(mssealSignRecord); sealSignRecordMapper.updateByPrimaryKeySelective(mssealSignRecord);
}
}
if (( psnsignStatusListnew.size()==1 && (psnsignStatusListnew.get(0).intValue() == 2)) && (orgsignStatus.intValue() == 2)) {
//更新立案申请状态为待送达
MsCaseApplication caseApplicationselect = msCaseApplicationMapper.selectByPrimaryKey(sealSignRecord.getCaseAppliId());
if ((mssealSignRecord.getSignFlowStatus() != null) && (mssealSignRecord.getSignFlowStatus().intValue() == 2)) { //下载审核完成的调解书
//修改"签署用印记录表"的状态为签署完成 String signFlowId = sealSignRecord.getSignFlowid();
mssealSignRecord.setSignFlowStatus(3); EsignHttpResponse fileDownload = SaaSAPIFileUtils.fileDownloadUrl(signFlowId);
sealSignRecordMapper.updateByPrimaryKeySelective(mssealSignRecord); JsonObject fileDownloadJsonObject = gson.fromJson(fileDownload.getBody(), JsonObject.class);
JsonObject fileDownloadData = fileDownloadJsonObject.getAsJsonObject("data");
// 根据流程id查找下一个流程节点 JsonArray filesArray = fileDownloadData.get("files").getAsJsonArray();
MsCaseFlow nextFlow = caseFlowMapper.nextFlow(caseApplicationselect.getCaseFlowId().intValue()); if (filesArray != null && filesArray.size() > 0) {
MsCaseApplication application = new MsCaseApplication(); JsonObject fileObject = (JsonObject) filesArray.get(0);
application.setId(caseApplicationselect.getId()); String fileDownloadUrl = fileObject.get("downloadUrl").toString();
application.setCaseFlowId(nextFlow.getId()); LocalDate now = LocalDate.now();
application.setCaseStatusName(nextFlow.getCaseStatusName()); String year = Integer.toString(now.getYear());
caseApplicationMapper.updateByPrimaryKeySelective(application); String month = String.format("%02d", now.getMonthValue());
String day = String.format("%02d", now.getDayOfMonth());
//下载审核完成的调解书 String saveFolderPath = "/home/ruoyi/uploadPath/upload/" + year + "/" + month + "/" + day;
String signFlowId = sealSignRecord.getSignFlowid(); String fileName = UUID.randomUUID().toString().replace("-", "") + ".pdf";
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();
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 = "/profile/upload/" + year + "/" + month + "/" + day + "/" + fileName; // String saveName = "/profile/upload/" + year + "/" + month + "/" + day + "/" + fileName;
// String savePath = "/home/ruoyi/uploadPath/upload/"; // String savePath = "/home/ruoyi/uploadPath/upload/";
String saveName = fileName; String saveName = fileName;
String savePath = "/profile/upload/" + year + "/" + month + "/" + day + "/" + fileName; String savePath = "/profile/upload/" + year + "/" + month + "/" + day + "/" + fileName;
// 创建日期目录 // 创建日期目录
File saveFolder = new File(saveFolderPath); File saveFolder = new File(saveFolderPath);
if (!saveFolder.exists()) { if (!saveFolder.exists()) {
saveFolder.mkdirs(); saveFolder.mkdirs();
} }
String resultFilePath = saveFolderPath + "/" + fileName; String resultFilePath = saveFolderPath + "/" + fileName;
File resultFilePathFile = new File(resultFilePath); File resultFilePathFile = new File(resultFilePath);
if (!resultFilePathFile.exists()) { if (!resultFilePathFile.exists()) {
resultFilePathFile.createNewFile(); resultFilePathFile.createNewFile();
} }
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);
if (downLoadFile) { if (downLoadFile) {
Long caseAppliId = sealSignRecord.getCaseAppliId(); Long caseAppliId = sealSignRecord.getCaseAppliId();
MsCaseAttach caseAttach = new MsCaseAttach(); MsCaseAttach caseAttach = new MsCaseAttach();
caseAttach.setCaseAppliId(caseAppliId); caseAttach.setCaseAppliId(caseAppliId);
caseAttach.setAnnexType(7); caseAttach.setAnnexType(7);
caseAttach.setAnnexPath(savePath); caseAttach.setAnnexPath(savePath);
caseAttach.setAnnexName(saveName); caseAttach.setAnnexName(saveName);
caseAttachMapper.updateCaseAttachBycaseid(caseAttach); caseAttachMapper.updateCaseAttachBycaseid(caseAttach);
} }
}
}
} }
}else {
if (( psnsignStatusListnew.size()==1 && (psnsignStatusListnew.get(0).intValue() == 2)) && (orgsignStatus.intValue() == 1)) {
//更新立案申请状态为待用印
// MsCaseApplication caseApplicationselect = msCaseApplicationMapper.selectByPrimaryKey(sealSignRecord.getCaseAppliId());
if ((mssealSignRecord.getSignFlowStatus() != null) && (mssealSignRecord.getSignFlowStatus().intValue() == 1)) {
// 根据流程id查找下一个流程节点
MsCaseFlow nextFlow = caseFlowMapper.nextFlow(caseApplicationselect.getCaseFlowId().intValue());
MsCaseApplication application = new MsCaseApplication();
application.setId(caseApplicationselect.getId());
application.setCaseFlowId(nextFlow.getId());
application.setCaseStatusName(nextFlow.getCaseStatusName());
caseApplicationMapper.updateByPrimaryKeySelective(application);
//修改"签署用印记录表"的状态为待用印
mssealSignRecord.setSignFlowStatus(2);
sealSignRecordMapper.updateByPrimaryKeySelective(mssealSignRecord);
}
}
if (( psnsignStatusListnew.size()==1 && (psnsignStatusListnew.get(0).intValue() == 2)) && (orgsignStatus.intValue() == 2)) {
//更新立案申请状态为待送达
// MsCaseApplication caseApplicationselect = msCaseApplicationMapper.selectByPrimaryKey(sealSignRecord.getCaseAppliId());
if ((mssealSignRecord.getSignFlowStatus() != null) && (mssealSignRecord.getSignFlowStatus().intValue() == 2)) {
//修改"签署用印记录表"的状态为签署完成
mssealSignRecord.setSignFlowStatus(3);
sealSignRecordMapper.updateByPrimaryKeySelective(mssealSignRecord);
// 根据流程id查找下一个流程节点
MsCaseFlow nextFlow = caseFlowMapper.nextFlow(caseApplicationselect.getCaseFlowId().intValue());
MsCaseApplication application = new MsCaseApplication();
application.setId(caseApplicationselect.getId());
application.setCaseFlowId(nextFlow.getId());
application.setCaseStatusName(nextFlow.getCaseStatusName());
caseApplicationMapper.updateByPrimaryKeySelective(application);
//下载审核完成的调解书
String signFlowId = sealSignRecord.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();
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 = "/profile/upload/" + year + "/" + month + "/" + day + "/" + fileName;
// String savePath = "/home/ruoyi/uploadPath/upload/";
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();
}
String fileDownloadUrlnew = fileDownloadUrl.substring(1, fileDownloadUrl.length() - 1);
boolean downLoadFile = FileTransformation.downLoadFileByUrl(fileDownloadUrlnew, resultFilePath);
if (downLoadFile) {
Long caseAppliId = sealSignRecord.getCaseAppliId();
MsCaseAttach caseAttach = new MsCaseAttach();
caseAttach.setCaseAppliId(caseAppliId);
caseAttach.setAnnexType(7);
caseAttach.setAnnexPath(savePath);
caseAttach.setAnnexName(saveName);
caseAttachMapper.updateCaseAttachBycaseid(caseAttach);
}
}
}
}
} }
} }
} }
} }