From 2396a98b2daafa32fc8595fb81e732ccc64b148c Mon Sep 17 00:00:00 2001 From: qitz <18810291185@163.com> Date: Tue, 30 Jan 2024 11:48:52 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=92=8C=E8=A7=A3=E5=8A=9F?= =?UTF-8?q?=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../system/mapper/flow/MsCaseFlowMapper.java | 3 + .../impl/MsCaseApplicationServiceImpl.java | 3 + .../utils/FixSelectFlowDetailUtils.java | 214 ++++++++++++------ 3 files changed, 150 insertions(+), 70 deletions(-) diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/flow/MsCaseFlowMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/flow/MsCaseFlowMapper.java index 6e1a1f6..ea44696 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/flow/MsCaseFlowMapper.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/flow/MsCaseFlowMapper.java @@ -18,4 +18,7 @@ public interface MsCaseFlowMapper extends Mapper { @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 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); } \ No newline at end of file diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/mscase/impl/MsCaseApplicationServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/mscase/impl/MsCaseApplicationServiceImpl.java index 33841a1..82ec091 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/mscase/impl/MsCaseApplicationServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/mscase/impl/MsCaseApplicationServiceImpl.java @@ -1236,6 +1236,9 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService { Long id = attach.getCaseAppliId(); MsCaseApplication caseApplication = msCaseApplicationMapper.selectByPrimaryKey(id); + caseApplication.setIsReconci(attach.getIsReconci()); + msCaseApplicationMapper.updateByPrimaryKeySelective(caseApplication); + // 查询案件相关人员 MsCaseAffiliate caseAffiliate = msCaseAffiliateMapper.selectByPrimaryKey(id); Integer isReconci = attach.getIsReconci(); diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/utils/FixSelectFlowDetailUtils.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/utils/FixSelectFlowDetailUtils.java index 6c587f1..54a49e7 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/utils/FixSelectFlowDetailUtils.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/utils/FixSelectFlowDetailUtils.java @@ -286,86 +286,160 @@ public class FixSelectFlowDetailUtils { List 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()); - 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); + MsCaseApplication caseApplicationselect = msCaseApplicationMapper.selectByPrimaryKey(sealSignRecord.getCaseAppliId()); + Integer isReconci = caseApplicationselect.getIsReconci(); + if(isReconci!=null){ + if(isReconci.intValue()==1){ + if (( psnsignStatusListnew.size()==1 && (psnsignStatusListnew.get(0).intValue() == 2))) { + //更新立案申请状态为待送达 +// MsCaseApplication caseApplicationselect = msCaseApplicationMapper.selectByPrimaryKey(sealSignRecord.getCaseAppliId()); + if ((mssealSignRecord.getSignFlowStatus() != null) && (mssealSignRecord.getSignFlowStatus().intValue() == 1)) { + MsCaseFlow nextFlow = caseFlowMapper.nextFlow1(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()); + //修改"签署用印记录表"的状态为完成 + mssealSignRecord.setSignFlowStatus(3); + sealSignRecordMapper.updateByPrimaryKeySelective(mssealSignRecord); - 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 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; + 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(); - } + // 创建日期目录 + 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); - } + 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); + } + } + } } + }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); + } + + } + } + } + } } + + + + + } }