|
|
@@ -20,6 +20,7 @@ import com.ruoyi.common.exception.EsignDemoException;
|
|
20
|
20
|
import com.ruoyi.common.exception.ServiceException;
|
|
21
|
21
|
import com.ruoyi.common.utils.EmailOutUtil;
|
|
22
|
22
|
import com.ruoyi.common.utils.SmsUtils;
|
|
|
23
|
+import com.ruoyi.common.utils.StringUtils;
|
|
23
|
24
|
import com.ruoyi.common.utils.file.SaaSAPIFileUtils;
|
|
24
|
25
|
import com.ruoyi.system.domain.entity.flow.MsCaseFlow;
|
|
25
|
26
|
import com.ruoyi.system.mapper.SysUserMapper;
|
|
|
@@ -722,6 +723,110 @@ public class MsSignSealServiceImpl implements MsSignSealService {
|
|
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
|
*
|