Ver código fonte

Merge branch 'qtz' of SH-Arbitrate/Mediation-Backend into dev

qtz 2 anos atrás
pai
commit
2891c27927

+ 40
- 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/mscase/MsSignSealController.java Ver arquivo

102
         return msSignSealService.msCaseSign(dto);
102
         return msSignSealService.msCaseSign(dto);
103
     }
103
     }
104
 
104
 
105
+    /**
106
+     * PC端申请人签名
107
+     * @param dto
108
+     * @return
109
+     */
110
+    @PostMapping("/msCaseSignUrlApplyPC")
111
+    public AjaxResult msCaseSignUrlApplyPC(@RequestBody MsSignSealDTO dto) throws EsignDemoException {
112
+        if (dto.getCaseId() == null) {
113
+            return error("参数校验失败");
114
+        }
115
+        return msSignSealService.msCaseSignUrlApplyPC(dto);
116
+    }
117
+
118
+    /**
119
+     * PC端被申请人签名
120
+     * @param dto
121
+     * @return
122
+     */
123
+    @PostMapping("/msCaseSignUrlResPC")
124
+    public AjaxResult msCaseSignUrlResPC(@RequestBody MsSignSealDTO dto) throws EsignDemoException {
125
+        if (dto.getCaseId() == null) {
126
+            return error("参数校验失败");
127
+        }
128
+        return msSignSealService.msCaseSignUrlResPC(dto);
129
+    }
130
+
131
+
132
+    /**
133
+     * 小程序端申请人签名
134
+     * @param dto
135
+     * @return
136
+     */
137
+    @PostMapping("/msCaseSignUrlApplyAPP")
138
+    public AjaxResult msCaseSignUrlApplyAPP(@RequestBody MsSignSealDTO dto) throws EsignDemoException {
139
+        if (dto.getCaseId() == null) {
140
+            return error("参数校验失败");
141
+        }
142
+        return msSignSealService.msCaseSignUrlApplyAPP(dto);
143
+    }
144
+
105
 
145
 
106
 
146
 
107
 
147
 

+ 6
- 0
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/mscase/MsSignSealService.java Ver arquivo

26
     AjaxResult msCaseFile(List<Long> ids);
26
     AjaxResult msCaseFile(List<Long> ids);
27
 
27
 
28
     AjaxResult msCaseSign(MsSignSealDTO dto);
28
     AjaxResult msCaseSign(MsSignSealDTO dto);
29
+
30
+    AjaxResult msCaseSignUrlApplyPC(MsSignSealDTO dto) throws EsignDemoException;
31
+
32
+    AjaxResult msCaseSignUrlResPC(MsSignSealDTO dto) throws EsignDemoException;
33
+
34
+    AjaxResult msCaseSignUrlApplyAPP(MsSignSealDTO dto) throws EsignDemoException;
29
 }
35
 }

+ 30
- 6
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/mscase/impl/MsCaseApplicationServiceImpl.java Ver arquivo

1455
 
1455
 
1456
                                                             SealSignRecord sealSignRecordapply = new SealSignRecord();
1456
                                                             SealSignRecord sealSignRecordapply = new SealSignRecord();
1457
                                                             sealSignRecordapply.setSignFlowid(signFlowId);
1457
                                                             sealSignRecordapply.setSignFlowid(signFlowId);
1458
-                                                            sealSignRecordapply.setPensonAccount(caseAffiliate.getContactTelphoneAgent());
1458
+
1459
+                                                            String nameAgent = caseAffiliate.getNameAgent();
1460
+                                                            if(StringUtils.isNotBlank(nameAgent)){
1461
+                                                                sealSignRecordapply.setPensonAccount(caseAffiliate.getContactTelphoneAgent());
1462
+                                                            }else {
1463
+                                                                sealSignRecordapply.setPensonAccount(caseAffiliate.getApplicationPhone());
1464
+                                                            }
1465
+
1459
                                                             EsignHttpResponse signUrl = SignAward.signUrlMediation(sealSignRecordapply);
1466
                                                             EsignHttpResponse signUrl = SignAward.signUrlMediation(sealSignRecordapply);
1460
                                                             JsonObject signUrlJsonObject = gson.fromJson(signUrl.getBody(), JsonObject.class);
1467
                                                             JsonObject signUrlJsonObject = gson.fromJson(signUrl.getBody(), JsonObject.class);
1461
                                                             JsonObject signUrlData = signUrlJsonObject.getAsJsonObject("data");
1468
                                                             JsonObject signUrlData = signUrlJsonObject.getAsJsonObject("data");
1465
                                                             //发送签名链接短信,尊敬的{1}用户,您的{2}调解案件,签名链接{3},请点击链接签名,如非本人操作,请忽略本短信
1472
                                                             //发送签名链接短信,尊敬的{1}用户,您的{2}调解案件,签名链接{3},请点击链接签名,如非本人操作,请忽略本短信
1466
                                                             SmsUtils.SendSmsRequest request = new SmsUtils.SendSmsRequest();
1473
                                                             SmsUtils.SendSmsRequest request = new SmsUtils.SendSmsRequest();
1467
                                                             request.setTemplateId("2047719");
1474
                                                             request.setTemplateId("2047719");
1468
-                                                            request.setPhone(caseAffiliate.getContactTelphoneAgent());
1469
-                                                            request.setTemplateParamSet(new String[]{caseAffiliate.getNameAgent(), application.getCaseNum(),urlapplynew});
1475
+                                                            if(StringUtils.isNotBlank(nameAgent)){
1476
+                                                                request.setPhone(caseAffiliate.getContactTelphoneAgent());
1477
+                                                                request.setTemplateParamSet(new String[]{caseAffiliate.getNameAgent(), application.getCaseNum(),urlapplynew});
1478
+                                                            }else {
1479
+                                                                request.setPhone(caseAffiliate.getApplicationPhone());
1480
+                                                                request.setTemplateParamSet(new String[]{caseAffiliate.getApplicationName(), application.getCaseNum(),urlapplynew});
1481
+                                                            }
1470
                                                             Boolean aBoolean = SmsUtils.sendSms(request);
1482
                                                             Boolean aBoolean = SmsUtils.sendSms(request);
1471
 
1483
 
1472
                                                             SealSignRecord sealSignRecordRespon = new SealSignRecord();
1484
                                                             SealSignRecord sealSignRecordRespon = new SealSignRecord();
1556
 
1568
 
1557
                                                                     SealSignRecord sealSignRecordapply = new SealSignRecord();
1569
                                                                     SealSignRecord sealSignRecordapply = new SealSignRecord();
1558
                                                                     sealSignRecordapply.setSignFlowid(signFlowId);
1570
                                                                     sealSignRecordapply.setSignFlowid(signFlowId);
1559
-                                                                    sealSignRecordapply.setPensonAccount(caseAffiliate.getContactTelphoneAgent());
1571
+                                                                    String nameAgent = caseAffiliate.getNameAgent();
1572
+                                                                    if(StringUtils.isNotBlank(nameAgent)){
1573
+                                                                        sealSignRecordapply.setPensonAccount(caseAffiliate.getContactTelphoneAgent());
1574
+                                                                    }else {
1575
+                                                                        sealSignRecordapply.setPensonAccount(caseAffiliate.getApplicationPhone());
1576
+                                                                    }
1577
+
1560
                                                                     EsignHttpResponse signUrl = SignAward.signUrlMediation(sealSignRecordapply);
1578
                                                                     EsignHttpResponse signUrl = SignAward.signUrlMediation(sealSignRecordapply);
1561
                                                                     JsonObject signUrlJsonObject = gson.fromJson(signUrl.getBody(), JsonObject.class);
1579
                                                                     JsonObject signUrlJsonObject = gson.fromJson(signUrl.getBody(), JsonObject.class);
1562
                                                                     JsonObject signUrlData = signUrlJsonObject.getAsJsonObject("data");
1580
                                                                     JsonObject signUrlData = signUrlJsonObject.getAsJsonObject("data");
1566
                                                                     //发送签名链接短信,尊敬的{1}用户,您的{2}调解案件,签名链接{3},请点击链接签名,如非本人操作,请忽略本短信
1584
                                                                     //发送签名链接短信,尊敬的{1}用户,您的{2}调解案件,签名链接{3},请点击链接签名,如非本人操作,请忽略本短信
1567
                                                                     SmsUtils.SendSmsRequest request = new SmsUtils.SendSmsRequest();
1585
                                                                     SmsUtils.SendSmsRequest request = new SmsUtils.SendSmsRequest();
1568
                                                                     request.setTemplateId("2047719");
1586
                                                                     request.setTemplateId("2047719");
1569
-                                                                    request.setPhone(caseAffiliate.getContactTelphoneAgent());
1570
-                                                                    request.setTemplateParamSet(new String[]{caseAffiliate.getNameAgent(), application.getCaseNum(),urlapplynew});
1587
+
1588
+                                                                    if(StringUtils.isNotBlank(nameAgent)){
1589
+                                                                        request.setPhone(caseAffiliate.getContactTelphoneAgent());
1590
+                                                                        request.setTemplateParamSet(new String[]{caseAffiliate.getNameAgent(), application.getCaseNum(),urlapplynew});
1591
+                                                                    }else {
1592
+                                                                        request.setPhone(caseAffiliate.getApplicationPhone());
1593
+                                                                        request.setTemplateParamSet(new String[]{caseAffiliate.getApplicationName(), application.getCaseNum(),urlapplynew});
1594
+                                                                    }
1571
                                                                     Boolean aBoolean = SmsUtils.sendSms(request);
1595
                                                                     Boolean aBoolean = SmsUtils.sendSms(request);
1572
 
1596
 
1573
                                                                     SealSignRecord sealSignRecordRespon = new SealSignRecord();
1597
                                                                     SealSignRecord sealSignRecordRespon = new SealSignRecord();

+ 105
- 0
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/mscase/impl/MsSignSealServiceImpl.java Ver arquivo

20
 import com.ruoyi.common.exception.ServiceException;
20
 import com.ruoyi.common.exception.ServiceException;
21
 import com.ruoyi.common.utils.EmailOutUtil;
21
 import com.ruoyi.common.utils.EmailOutUtil;
22
 import com.ruoyi.common.utils.SmsUtils;
22
 import com.ruoyi.common.utils.SmsUtils;
23
+import com.ruoyi.common.utils.StringUtils;
23
 import com.ruoyi.common.utils.file.SaaSAPIFileUtils;
24
 import com.ruoyi.common.utils.file.SaaSAPIFileUtils;
24
 import com.ruoyi.system.domain.entity.flow.MsCaseFlow;
25
 import com.ruoyi.system.domain.entity.flow.MsCaseFlow;
25
 import com.ruoyi.system.mapper.SysUserMapper;
26
 import com.ruoyi.system.mapper.SysUserMapper;
722
 
723
 
723
     }
724
     }
724
 
725
 
726
+    @Override
727
+    public AjaxResult msCaseSignUrlApplyPC(MsSignSealDTO dto) throws EsignDemoException {
728
+        Long caseId = dto.getCaseId();
729
+        MsCaseAffiliate caseAffiliate = msCaseAffiliateMapper.selectByPrimaryKey(caseId);
730
+        Integer organizeFlag = caseAffiliate.getOrganizeFlag();
731
+        SealSignRecord sealSignRecordres = new SealSignRecord();
732
+        MsSealSignRecord mssealSignRecord = new MsSealSignRecord();
733
+        mssealSignRecord.setCaseAppliId(caseId);
734
+        List<MsSealSignRecord> sealSignRecords = sealSignRecordMapper.selectSealSignRecord(mssealSignRecord);
735
+        if (sealSignRecords != null && sealSignRecords.size() > 0) {
736
+            String signFlowid = sealSignRecords.get(0).getSignFlowId();
737
+            if(organizeFlag!=null){
738
+                SealSignRecord sealSignRecord = new SealSignRecord();
739
+                if(organizeFlag.intValue()==1){
740
+                    sealSignRecord.setPensonAccount(caseAffiliate.getContactTelphoneAgent());
741
+                    sealSignRecord.setPensonName(caseAffiliate.getNameAgent());
742
+                }else {
743
+                    String nameAgent = caseAffiliate.getNameAgent();
744
+                    if(StringUtils.isNotBlank(nameAgent)){
745
+                        sealSignRecord.setPensonAccount(caseAffiliate.getContactTelphoneAgent());
746
+                        sealSignRecord.setPensonName(caseAffiliate.getNameAgent());
747
+                    }else {
748
+                        sealSignRecord.setPensonAccount(caseAffiliate.getApplicationPhone());
749
+                        sealSignRecord.setPensonName(caseAffiliate.getApplicationName());
750
+                    }
751
+                }
752
+                sealSignRecord.setSignFlowid(signFlowid);
753
+
754
+                Gson gson = new Gson();
755
+                EsignHttpResponse signUrl = SignAward.signUrl(sealSignRecord);
756
+                JsonObject signUrlJsonObject = gson.fromJson(signUrl.getBody(), JsonObject.class);
757
+                JsonObject signUrlData = signUrlJsonObject.getAsJsonObject("data");
758
+                String urlapply = signUrlData.get("shortUrl").getAsString();
759
+                sealSignRecordres.setSealUrl(urlapply);
760
+            }
761
+        }
762
+        return AjaxResult.success(sealSignRecordres);
763
+    }
764
+
765
+    @Override
766
+    public AjaxResult msCaseSignUrlResPC(MsSignSealDTO dto) throws EsignDemoException {
767
+        Long caseId = dto.getCaseId();
768
+        MsCaseAffiliate caseAffiliate = msCaseAffiliateMapper.selectByPrimaryKey(caseId);
769
+        SealSignRecord sealSignRecordres = new SealSignRecord();
770
+        MsSealSignRecord mssealSignRecord = new MsSealSignRecord();
771
+        mssealSignRecord.setCaseAppliId(caseId);
772
+        List<MsSealSignRecord> sealSignRecords = sealSignRecordMapper.selectSealSignRecord(mssealSignRecord);
773
+        if (sealSignRecords != null && sealSignRecords.size() > 0) {
774
+            String signFlowid = sealSignRecords.get(0).getSignFlowId();
775
+            SealSignRecord sealSignRecord = new SealSignRecord();
776
+            sealSignRecord.setPensonAccount(caseAffiliate.getRespondentPhone());
777
+            sealSignRecord.setSignFlowid(signFlowid);
778
+
779
+            Gson gson = new Gson();
780
+            EsignHttpResponse signUrl = SignAward.signUrl(sealSignRecord);
781
+            JsonObject signUrlJsonObject = gson.fromJson(signUrl.getBody(), JsonObject.class);
782
+            JsonObject signUrlData = signUrlJsonObject.getAsJsonObject("data");
783
+            String urlapply = signUrlData.get("shortUrl").getAsString();
784
+            sealSignRecordres.setSealUrl(urlapply);
785
+        }
786
+
787
+        return AjaxResult.success(sealSignRecordres);
788
+    }
789
+
790
+    @Override
791
+    public AjaxResult msCaseSignUrlApplyAPP(MsSignSealDTO dto) throws EsignDemoException {
792
+        Long caseId = dto.getCaseId();
793
+        MsCaseAffiliate caseAffiliate = msCaseAffiliateMapper.selectByPrimaryKey(caseId);
794
+        Integer organizeFlag = caseAffiliate.getOrganizeFlag();
795
+        SealSignRecord sealSignRecordres = new SealSignRecord();
796
+        MsSealSignRecord mssealSignRecord = new MsSealSignRecord();
797
+        mssealSignRecord.setCaseAppliId(caseId);
798
+        List<MsSealSignRecord> sealSignRecords = sealSignRecordMapper.selectSealSignRecord(mssealSignRecord);
799
+        if (sealSignRecords != null && sealSignRecords.size() > 0) {
800
+            String signFlowid = sealSignRecords.get(0).getSignFlowId();
801
+            if(organizeFlag!=null){
802
+                SealSignRecord sealSignRecord = new SealSignRecord();
803
+                if(organizeFlag.intValue()==1){
804
+                    sealSignRecord.setPensonAccount(caseAffiliate.getContactTelphoneAgent());
805
+                    sealSignRecord.setPensonName(caseAffiliate.getNameAgent());
806
+                }else {
807
+                    String nameAgent = caseAffiliate.getNameAgent();
808
+                    if(StringUtils.isNotBlank(nameAgent)){
809
+                        sealSignRecord.setPensonAccount(caseAffiliate.getContactTelphoneAgent());
810
+                        sealSignRecord.setPensonName(caseAffiliate.getNameAgent());
811
+                    }else {
812
+                        sealSignRecord.setPensonAccount(caseAffiliate.getApplicationPhone());
813
+                        sealSignRecord.setPensonName(caseAffiliate.getApplicationName());
814
+                    }
815
+                }
816
+                sealSignRecord.setSignFlowid(signFlowid);
817
+
818
+                Gson gson = new Gson();
819
+                EsignHttpResponse signUrl = SignAward.signUrlMediation(sealSignRecord);
820
+                JsonObject signUrlJsonObject = gson.fromJson(signUrl.getBody(), JsonObject.class);
821
+                JsonObject signUrlData = signUrlJsonObject.getAsJsonObject("data");
822
+                String urlapply = signUrlData.get("shortUrl").getAsString();
823
+                sealSignRecordres.setSealUrl(urlapply);
824
+            }
825
+        }
826
+        return AjaxResult.success(sealSignRecordres);
827
+
828
+    }
829
+
725
     /**
830
     /**
726
      * 通过邮件发送裁决书文件
831
      * 通过邮件发送裁决书文件
727
      *
832
      *