From 3ac12bc2b0e269346d1c7e5d4b255ee23169199b Mon Sep 17 00:00:00 2001 From: qitz <18810291185@163.com> Date: Fri, 19 Jan 2024 17:21:39 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E7=94=A8=E5=8D=B0=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mscase/MsSignSealController.java | 8 +- .../service/mscase/MsSignSealService.java | 1 - .../mscase/impl/MsSignSealServiceImpl.java | 105 +----------------- 3 files changed, 5 insertions(+), 109 deletions(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/mscase/MsSignSealController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/mscase/MsSignSealController.java index e1fee94..873efb3 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/mscase/MsSignSealController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/mscase/MsSignSealController.java @@ -75,13 +75,7 @@ public class MsSignSealController extends BaseController { return AjaxResult.success(list); } - /** - * test - */ - @PostMapping("/testSeal") - public AjaxResult testSeal(@Validated @RequestBody MsSignSealDTO dto) throws EsignDemoException { - return msSignSealService.testSeal(dto); - } + diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/mscase/MsSignSealService.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/mscase/MsSignSealService.java index 4ddc0ee..57e58ba 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/mscase/MsSignSealService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/mscase/MsSignSealService.java @@ -23,5 +23,4 @@ public interface MsSignSealService { List selectCaseLogRecordList(MsSignSealDTO dto); - AjaxResult testSeal(MsSignSealDTO dto); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/mscase/impl/MsSignSealServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/mscase/impl/MsSignSealServiceImpl.java index 18995ed..3312560 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/mscase/impl/MsSignSealServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/mscase/impl/MsSignSealServiceImpl.java @@ -97,8 +97,7 @@ public class MsSignSealServiceImpl implements MsSignSealService { for (MsCaseAttach caseAttach : caseAttachList) { if (caseAttach.getAnnexType() == 3) { String annexPath = caseAttach.getAnnexPath(); -// String path = "/home/ruoyi" + annexPath; - String path = "D:\\home\\ruoyi\\uploadPath\\upload\\2023\\12\\调解书测试.docx"; + String path = "/home/ruoyi" + annexPath; //获取文件上传地址 EsignHttpResponse response = SaaSAPIFileUtils.getUploadUrl(path); String body = response.getBody(); @@ -129,9 +128,9 @@ public class MsSignSealServiceImpl implements MsSignSealService { //发起签署 sealSignRecord.setFilename(fileName); - Long arbitratorId = caseApplication.getMediatorId(); - if (arbitratorId != null) { - SysUser sysUser = sysUserMapper.selectUserById(arbitratorId); + String arbitratorId = caseApplication.getMediatorId(); + if (StringUtils.isNotEmpty(arbitratorId)) { + SysUser sysUser = sysUserMapper.selectUserById(Long.valueOf(arbitratorId)); if (sysUser == null) { return AjaxResult.error(); } @@ -689,103 +688,7 @@ public class MsSignSealServiceImpl implements MsSignSealService { } - @Override - @Transactional - public AjaxResult testSeal(MsSignSealDTO dto) { - Gson gson = new Gson(); - - List sealSignRecords = sealSignRecordMapper.selectSealSignRecordbyStat(); - - try { - if (sealSignRecords != null && sealSignRecords.size() > 0) { - for (int i = 0; i < sealSignRecords.size(); i++) { - MsSealSignRecord mssealSignRecord = sealSignRecords.get(i); - SealSignRecord sealSignRecord = new SealSignRecord(); - BeanUtil.copyProperties(mssealSignRecord, sealSignRecord); - - String signFlowId = mssealSignRecord.getSignFlowId(); - if(StringUtils.isNotEmpty(signFlowId) && "819e60824fe241e9b862bd787403fa5e".equals(signFlowId)){ - sealSignRecord.setSignFlowid(mssealSignRecord.getSignFlowId()); - EsignHttpResponse signFlowDetail = SignAward.signFlowDetail(sealSignRecord); - JsonObject signFlowDetailJsonObject = gson.fromJson(signFlowDetail.getBody(), JsonObject.class); - JsonObject flowDetailData = signFlowDetailJsonObject.getAsJsonObject("data"); - JsonArray signersArray = flowDetailData.get("signers").getAsJsonArray(); - List psnsignStatusList = new ArrayList<>(); - Integer psnsignStatus = null; - Integer orgsignStatus = null; - for (int j = 0; j < signersArray.size(); j++) { - JsonObject signerObject = (JsonObject) signersArray.get(j); - - if (!(signerObject.get("psnSigner").toString()).equals("null")) { - JsonObject psnSignerData = signerObject.getAsJsonObject("psnSigner"); - if (psnSignerData != null) { - psnsignStatus = signerObject.get("signStatus").getAsInt(); - psnsignStatusList.add(psnsignStatus); - } - } - if (!(signerObject.get("orgSigner").toString()).equals("null")) { - JsonObject orgSignerData = signerObject.getAsJsonObject("orgSigner"); - if (orgSignerData != null) { - orgsignStatus = signerObject.get("signStatus").getAsInt(); - } - } - - } - - 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); - - //修改"签署用印记录表"的状态为待用印 - 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); - } - } - - } - - - } - - } - } catch (EsignDemoException e) { - e.printStackTrace(); - } - - return AjaxResult.success(); - - - - } }