|
|
@@ -97,8 +97,7 @@ public class MsSignSealServiceImpl implements MsSignSealService {
|
|
97
|
97
|
for (MsCaseAttach caseAttach : caseAttachList) {
|
|
98
|
98
|
if (caseAttach.getAnnexType() == 3) {
|
|
99
|
99
|
String annexPath = caseAttach.getAnnexPath();
|
|
100
|
|
-// String path = "/home/ruoyi" + annexPath;
|
|
101
|
|
- String path = "D:\\home\\ruoyi\\uploadPath\\upload\\2023\\12\\调解书测试.docx";
|
|
|
100
|
+ String path = "/home/ruoyi" + annexPath;
|
|
102
|
101
|
//获取文件上传地址
|
|
103
|
102
|
EsignHttpResponse response = SaaSAPIFileUtils.getUploadUrl(path);
|
|
104
|
103
|
String body = response.getBody();
|
|
|
@@ -129,9 +128,9 @@ public class MsSignSealServiceImpl implements MsSignSealService {
|
|
129
|
128
|
//发起签署
|
|
130
|
129
|
sealSignRecord.setFilename(fileName);
|
|
131
|
130
|
|
|
132
|
|
- Long arbitratorId = caseApplication.getMediatorId();
|
|
133
|
|
- if (arbitratorId != null) {
|
|
134
|
|
- SysUser sysUser = sysUserMapper.selectUserById(arbitratorId);
|
|
|
131
|
+ String arbitratorId = caseApplication.getMediatorId();
|
|
|
132
|
+ if (StringUtils.isNotEmpty(arbitratorId)) {
|
|
|
133
|
+ SysUser sysUser = sysUserMapper.selectUserById(Long.valueOf(arbitratorId));
|
|
135
|
134
|
if (sysUser == null) {
|
|
136
|
135
|
return AjaxResult.error();
|
|
137
|
136
|
}
|
|
|
@@ -689,103 +688,7 @@ public class MsSignSealServiceImpl implements MsSignSealService {
|
|
689
|
688
|
|
|
690
|
689
|
}
|
|
691
|
690
|
|
|
692
|
|
- @Override
|
|
693
|
|
- @Transactional
|
|
694
|
|
- public AjaxResult testSeal(MsSignSealDTO dto) {
|
|
695
|
|
-
|
|
696
|
|
- Gson gson = new Gson();
|
|
697
|
|
-
|
|
698
|
|
- List<MsSealSignRecord> sealSignRecords = sealSignRecordMapper.selectSealSignRecordbyStat();
|
|
699
|
|
-
|
|
700
|
|
- try {
|
|
701
|
|
- if (sealSignRecords != null && sealSignRecords.size() > 0) {
|
|
702
|
|
- for (int i = 0; i < sealSignRecords.size(); i++) {
|
|
703
|
|
- MsSealSignRecord mssealSignRecord = sealSignRecords.get(i);
|
|
704
|
|
- SealSignRecord sealSignRecord = new SealSignRecord();
|
|
705
|
|
- BeanUtil.copyProperties(mssealSignRecord, sealSignRecord);
|
|
706
|
|
-
|
|
707
|
|
- String signFlowId = mssealSignRecord.getSignFlowId();
|
|
708
|
|
- if(StringUtils.isNotEmpty(signFlowId) && "819e60824fe241e9b862bd787403fa5e".equals(signFlowId)){
|
|
709
|
|
- sealSignRecord.setSignFlowid(mssealSignRecord.getSignFlowId());
|
|
710
|
|
- EsignHttpResponse signFlowDetail = SignAward.signFlowDetail(sealSignRecord);
|
|
711
|
|
- JsonObject signFlowDetailJsonObject = gson.fromJson(signFlowDetail.getBody(), JsonObject.class);
|
|
712
|
|
- JsonObject flowDetailData = signFlowDetailJsonObject.getAsJsonObject("data");
|
|
713
|
|
- JsonArray signersArray = flowDetailData.get("signers").getAsJsonArray();
|
|
714
|
|
- List<Integer> psnsignStatusList = new ArrayList<>();
|
|
715
|
|
- Integer psnsignStatus = null;
|
|
716
|
|
- Integer orgsignStatus = null;
|
|
717
|
|
- for (int j = 0; j < signersArray.size(); j++) {
|
|
718
|
|
- JsonObject signerObject = (JsonObject) signersArray.get(j);
|
|
719
|
|
-
|
|
720
|
|
- if (!(signerObject.get("psnSigner").toString()).equals("null")) {
|
|
721
|
|
- JsonObject psnSignerData = signerObject.getAsJsonObject("psnSigner");
|
|
722
|
|
- if (psnSignerData != null) {
|
|
723
|
|
- psnsignStatus = signerObject.get("signStatus").getAsInt();
|
|
724
|
|
- psnsignStatusList.add(psnsignStatus);
|
|
725
|
|
- }
|
|
726
|
|
- }
|
|
727
|
|
- if (!(signerObject.get("orgSigner").toString()).equals("null")) {
|
|
728
|
|
- JsonObject orgSignerData = signerObject.getAsJsonObject("orgSigner");
|
|
729
|
|
- if (orgSignerData != null) {
|
|
730
|
|
- orgsignStatus = signerObject.get("signStatus").getAsInt();
|
|
731
|
|
- }
|
|
732
|
|
- }
|
|
733
|
|
-
|
|
734
|
|
- }
|
|
735
|
|
-
|
|
736
|
|
- List<Integer> psnsignStatusListnew = psnsignStatusList.stream().distinct().collect(Collectors.toList());
|
|
737
|
|
-
|
|
738
|
|
- if (( psnsignStatusListnew.size()==1 && (psnsignStatusListnew.get(0).intValue() == 2)) && (orgsignStatus.intValue() == 1)) {
|
|
739
|
|
- //更新立案申请状态为待用印
|
|
740
|
|
- MsCaseApplication caseApplicationselect = msCaseApplicationMapper.selectByPrimaryKey(sealSignRecord.getCaseAppliId());
|
|
741
|
|
- if ((mssealSignRecord.getSignFlowStatus() != null) && (mssealSignRecord.getSignFlowStatus().intValue() == 1)) {
|
|
742
|
|
- // 根据流程id查找下一个流程节点
|
|
743
|
|
- MsCaseFlow nextFlow = caseFlowMapper.nextFlow(caseApplicationselect.getCaseFlowId().intValue());
|
|
744
|
|
- MsCaseApplication application = new MsCaseApplication();
|
|
745
|
|
- application.setId(caseApplicationselect.getId());
|
|
746
|
|
- application.setCaseFlowId(nextFlow.getId());
|
|
747
|
|
- application.setCaseStatusName(nextFlow.getCaseStatusName());
|
|
748
|
|
- caseApplicationMapper.updateByPrimaryKeySelective(application);
|
|
749
|
|
-
|
|
750
|
|
- //修改"签署用印记录表"的状态为待用印
|
|
751
|
|
- mssealSignRecord.setSignFlowStatus(2);
|
|
752
|
|
- sealSignRecordMapper.updateByPrimaryKeySelective(mssealSignRecord);
|
|
753
|
|
- }
|
|
754
|
|
- }
|
|
755
|
|
- if (( psnsignStatusListnew.size()==1 && (psnsignStatusListnew.get(0).intValue() == 2)) && (orgsignStatus.intValue() == 2)) {
|
|
756
|
|
- //更新立案申请状态为待送达
|
|
757
|
|
- MsCaseApplication caseApplicationselect = msCaseApplicationMapper.selectByPrimaryKey(sealSignRecord.getCaseAppliId());
|
|
758
|
|
-
|
|
759
|
|
- if ((mssealSignRecord.getSignFlowStatus() != null) && (mssealSignRecord.getSignFlowStatus().intValue() == 2)) {
|
|
760
|
|
- //修改"签署用印记录表"的状态为签署完成
|
|
761
|
|
- mssealSignRecord.setSignFlowStatus(3);
|
|
762
|
|
- sealSignRecordMapper.updateByPrimaryKeySelective(mssealSignRecord);
|
|
763
|
|
-
|
|
764
|
|
- // 根据流程id查找下一个流程节点
|
|
765
|
|
- MsCaseFlow nextFlow = caseFlowMapper.nextFlow(caseApplicationselect.getCaseFlowId().intValue());
|
|
766
|
|
- MsCaseApplication application = new MsCaseApplication();
|
|
767
|
|
- application.setId(caseApplicationselect.getId());
|
|
768
|
|
- application.setCaseFlowId(nextFlow.getId());
|
|
769
|
|
- application.setCaseStatusName(nextFlow.getCaseStatusName());
|
|
770
|
|
- caseApplicationMapper.updateByPrimaryKeySelective(application);
|
|
771
|
|
- }
|
|
772
|
|
- }
|
|
773
|
|
-
|
|
774
|
|
- }
|
|
775
|
|
-
|
|
776
|
|
-
|
|
777
|
|
- }
|
|
778
|
691
|
|
|
779
|
|
- }
|
|
780
|
|
- } catch (EsignDemoException e) {
|
|
781
|
|
- e.printStackTrace();
|
|
782
|
|
- }
|
|
783
|
|
-
|
|
784
|
|
- return AjaxResult.success();
|
|
785
|
|
-
|
|
786
|
|
-
|
|
787
|
|
-
|
|
788
|
|
- }
|
|
789
|
692
|
|
|
790
|
693
|
|
|
791
|
694
|
}
|