Kaynağa Gözat

优化和解功能

qitz 2 yıl önce
ebeveyn
işleme
de5becc963

+ 159
- 97
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/mscase/impl/MsCaseApplicationServiceImpl.java Dosyayı Görüntüle

@@ -1228,6 +1228,7 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
1228 1228
         // 查询案件相关人员
1229 1229
         MsCaseAffiliate caseAffiliate = msCaseAffiliateMapper.selectByPrimaryKey(id);
1230 1230
         Integer isReconci = attach.getIsReconci();
1231
+
1231 1232
         if(attach.getAnnexId()!=null){
1232 1233
             MsCaseAttach caseAttach = msCaseAttachMapper.queryAnnexById(attach.getAnnexId());
1233 1234
             if (caseAttach.getAnnexType() == AnnexTypeEnum.MEDIATE_BOOK.getCode()) {
@@ -1686,7 +1687,67 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
1686 1687
                                             }
1687 1688
                                         }
1688 1689
                                     }
1689
-                                        /*DeptIdentify deptIdentify1 = new DeptIdentify();
1690
+
1691
+                                    if(isReconci.intValue()==1){
1692
+                                        EsignHttpResponse response3 = SignAward.createByFileReconci(sealSignRecord);
1693
+
1694
+                                        JSONObject jsonObject3 = JSONObject.parseObject(response3.getBody());
1695
+                                        if (jsonObject3 != null) {
1696
+                                            if (jsonObject3.getIntValue("code") == 0) {
1697
+                                                //获取签署流程ID
1698
+                                                JSONObject data1 = jsonObject3.getJSONObject("data");
1699
+                                                String signFlowId = data1.getString("signFlowId");
1700
+                                                //保存案件id,文件id,文件名称.流程id到签署用印记录表里
1701
+                                                sealSignRecord.setCaseAppliId(caseApplication.getId());
1702
+                                                sealSignRecord.setSignFlowid(signFlowId);
1703
+                                                sealSignRecord.setSignFlowStatus(1);//待签名
1704
+                                                MsSealSignRecord msSealSignRecord = new MsSealSignRecord();
1705
+                                                BeanUtil.copyProperties(sealSignRecord, msSealSignRecord);
1706
+                                                msSealSignRecord.setFileId(sealSignRecord.getFileid());
1707
+                                                msSealSignRecord.setFileName(sealSignRecord.getFilename());
1708
+                                                msSealSignRecord.setSignFlowId(sealSignRecord.getSignFlowid());
1709
+                                                sealSignRecordMapper.insert(msSealSignRecord);
1710
+
1711
+                                                SealSignRecord sealSignRecordapply = new SealSignRecord();
1712
+                                                sealSignRecordapply.setSignFlowid(signFlowId);
1713
+                                                sealSignRecordapply.setPensonAccount(caseAffiliate.getContactTelphoneAgent());
1714
+                                                EsignHttpResponse signUrl = SignAward.signUrlMediation(sealSignRecordapply);
1715
+                                                JsonObject signUrlJsonObject = gson.fromJson(signUrl.getBody(), JsonObject.class);
1716
+                                                JsonObject signUrlData = signUrlJsonObject.getAsJsonObject("data");
1717
+                                                String urlapply = signUrlData.get("shortUrl").getAsString();
1718
+                                                String urlapplynew = urlapply.substring(urlapply.lastIndexOf("/")+1);
1719
+
1720
+                                                //发送签名链接短信,尊敬的{1}用户,您的{2}调解案件,签名链接{3},请点击链接签名,如非本人操作,请忽略本短信
1721
+                                                SmsUtils.SendSmsRequest request = new SmsUtils.SendSmsRequest();
1722
+                                                request.setTemplateId("2047719");
1723
+                                                request.setPhone(caseAffiliate.getContactTelphoneAgent());
1724
+                                                request.setTemplateParamSet(new String[]{caseAffiliate.getNameAgent(), caseApplication.getCaseNum(),urlapplynew});
1725
+                                                Boolean aBoolean = SmsUtils.sendSms(request);
1726
+
1727
+                                                SealSignRecord sealSignRecordRespon = new SealSignRecord();
1728
+                                                sealSignRecordRespon.setSignFlowid(signFlowId);
1729
+                                                sealSignRecordRespon.setPensonAccount(caseAffiliate.getRespondentPhone());
1730
+                                                EsignHttpResponse signUrlRespon = SignAward.signUrlMediation(sealSignRecordRespon);
1731
+                                                JsonObject signUrlJsonObjectRespon = gson.fromJson(signUrlRespon.getBody(), JsonObject.class);
1732
+                                                JsonObject signUrlDataRespon = signUrlJsonObjectRespon.getAsJsonObject("data");
1733
+                                                String urlRespon = signUrlDataRespon.get("shortUrl").getAsString();
1734
+                                                String urlResponnew = urlRespon.substring(urlRespon.lastIndexOf("/")+1);
1735
+
1736
+                                                SmsUtils.SendSmsRequest request1 = new SmsUtils.SendSmsRequest();
1737
+                                                request1.setTemplateId("2047719");
1738
+                                                request1.setPhone(caseAffiliate.getRespondentPhone());
1739
+                                                request1.setTemplateParamSet(new String[]{caseAffiliate.getRespondentName(), caseApplication.getCaseNum(),urlResponnew});
1740
+                                                Boolean aBoolean1 = SmsUtils.sendSms(request1);
1741
+
1742
+                                            } else {
1743
+                                                throw new ServiceException(jsonObject3.getString("message"));
1744
+                                            }
1745
+                                        } else {
1746
+                                            return AjaxResult.error();
1747
+                                        }
1748
+
1749
+                                    }else {
1750
+                                            /*DeptIdentify deptIdentify1 = new DeptIdentify();
1690 1751
                                         deptIdentify1.setSealStatus(1); // 印章状态为启用
1691 1752
                                         //根据机构名称查询部门id
1692 1753
                                         SysDept sysDept = new SysDept();
@@ -1704,108 +1765,109 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
1704 1765
                                                 sealIds.add(sealId);
1705 1766
                                             }
1706 1767
                                         }*/
1707
-                                    String orgnizeName = sealSignRecord.getOrgnizeName(); //机构名称
1708
-                                    String orgnizeNamepsnName = sealSignRecord.getOrgnizeNamepsnName(); //机构经办人姓名
1709
-                                    String orgnizeNamePsnAccount = sealSignRecord.getOrgnizeNamePsnAccount(); //机构经办人联系方式
1710
-                                    //查询机构信息
1711
-                                    DeptIdentify deptIdentify1 = new DeptIdentify();
1712
-                                    deptIdentify1.setIdentifyName(orgnizeName);
1713
-                                    deptIdentify1.setOperName(orgnizeNamepsnName);
1714
-                                    deptIdentify1.setOperPhone(orgnizeNamePsnAccount);
1715
-                                    List<DeptIdentify> deptIdentifies = deptIdentifyMapper.selectDeptIdentify(deptIdentify1);
1716
-                                    if (deptIdentifies != null && deptIdentifies.size() > 0) {
1717
-                                        Long iddeptIdent = deptIdentifies.get(0).getId();
1718
-                                        SealManage sealManage = new SealManage();
1719
-                                        sealManage.setIdentifyId(iddeptIdent);
1720
-                                        List<String> sealIdList = new ArrayList<>();
1721
-                                        List<SealManage> selectSealList = sealManageMapper.selectSealList(sealManage);
1722
-                                        if (selectSealList != null && selectSealList.size() > 0) {
1723
-                                            for (SealManage manage : selectSealList) {
1724
-                                                Integer sealStatus = manage.getSealStatus();
1725
-                                                Integer isUse = manage.getIsUse();
1726
-                                                if (sealStatus == 1 && isUse ==1) {
1727
-                                                    sealIdList.add(manage.getSealId());
1768
+                                        String orgnizeName = sealSignRecord.getOrgnizeName(); //机构名称
1769
+                                        String orgnizeNamepsnName = sealSignRecord.getOrgnizeNamepsnName(); //机构经办人姓名
1770
+                                        String orgnizeNamePsnAccount = sealSignRecord.getOrgnizeNamePsnAccount(); //机构经办人联系方式
1771
+                                        //查询机构信息
1772
+                                        DeptIdentify deptIdentify1 = new DeptIdentify();
1773
+                                        deptIdentify1.setIdentifyName(orgnizeName);
1774
+                                        deptIdentify1.setOperName(orgnizeNamepsnName);
1775
+                                        deptIdentify1.setOperPhone(orgnizeNamePsnAccount);
1776
+                                        List<DeptIdentify> deptIdentifies = deptIdentifyMapper.selectDeptIdentify(deptIdentify1);
1777
+                                        if (deptIdentifies != null && deptIdentifies.size() > 0) {
1778
+                                            Long iddeptIdent = deptIdentifies.get(0).getId();
1779
+                                            SealManage sealManage = new SealManage();
1780
+                                            sealManage.setIdentifyId(iddeptIdent);
1781
+                                            List<String> sealIdList = new ArrayList<>();
1782
+                                            List<SealManage> selectSealList = sealManageMapper.selectSealList(sealManage);
1783
+                                            if (selectSealList != null && selectSealList.size() > 0) {
1784
+                                                for (SealManage manage : selectSealList) {
1785
+                                                    Integer sealStatus = manage.getSealStatus();
1786
+                                                    Integer isUse = manage.getIsUse();
1787
+                                                    if (sealStatus == 1 && isUse ==1) {
1788
+                                                        sealIdList.add(manage.getSealId());
1789
+                                                    }
1728 1790
                                                 }
1729
-                                            }
1730
-                                            EsignHttpResponse response3 = SignAward.createByFileMediation(sealSignRecord, sealIdList);
1731
-
1732
-                                            JSONObject jsonObject3 = JSONObject.parseObject(response3.getBody());
1733
-                                            if (jsonObject3 != null) {
1734
-                                                if (jsonObject3.getIntValue("code") == 0) {
1735
-                                                    //获取签署流程ID
1736
-                                                    JSONObject data1 = jsonObject3.getJSONObject("data");
1737
-                                                    String signFlowId = data1.getString("signFlowId");
1738
-                                                    //保存案件id,文件id,文件名称.流程id到签署用印记录表里
1739
-                                                    sealSignRecord.setCaseAppliId(caseApplication.getId());
1740
-                                                    sealSignRecord.setSignFlowid(signFlowId);
1741
-                                                    sealSignRecord.setSignFlowStatus(1);//待签名
1742
-                                                    MsSealSignRecord msSealSignRecord = new MsSealSignRecord();
1743
-                                                    BeanUtil.copyProperties(sealSignRecord, msSealSignRecord);
1744
-                                                    msSealSignRecord.setFileId(sealSignRecord.getFileid());
1745
-                                                    msSealSignRecord.setFileName(sealSignRecord.getFilename());
1746
-                                                    msSealSignRecord.setSignFlowId(sealSignRecord.getSignFlowid());
1747
-                                                    msSealSignRecord.setOrgnNamePsnAcc(sealSignRecord.getOrgnizeNamePsnAccount());
1748
-                                                    msSealSignRecord.setOrgnNamePsnName(sealSignRecord.getOrgnizeNamepsnName());
1749
-                                                    sealSignRecordMapper.insert(msSealSignRecord);
1750
-
1751
-                                                    SealSignRecord sealSignRecordapply = new SealSignRecord();
1752
-                                                    sealSignRecordapply.setSignFlowid(signFlowId);
1753
-                                                    sealSignRecordapply.setPensonAccount(caseAffiliate.getContactTelphoneAgent());
1754
-                                                    EsignHttpResponse signUrl = SignAward.signUrlMediation(sealSignRecordapply);
1755
-                                                    JsonObject signUrlJsonObject = gson.fromJson(signUrl.getBody(), JsonObject.class);
1756
-                                                    JsonObject signUrlData = signUrlJsonObject.getAsJsonObject("data");
1757
-                                                    String urlapply = signUrlData.get("shortUrl").getAsString();
1758
-                                                    String urlapplynew = urlapply.substring(urlapply.lastIndexOf("/")+1);
1759
-
1760
-                                                    //发送签名链接短信,尊敬的{1}用户,您的{2}调解案件,签名链接{3},请点击链接签名,如非本人操作,请忽略本短信
1761
-                                                    SmsUtils.SendSmsRequest request = new SmsUtils.SendSmsRequest();
1762
-                                                    request.setTemplateId("2047719");
1763
-                                                    request.setPhone(caseAffiliate.getContactTelphoneAgent());
1764
-                                                    request.setTemplateParamSet(new String[]{caseAffiliate.getNameAgent(), caseApplication.getCaseNum(),urlapplynew});
1765
-                                                    Boolean aBoolean = SmsUtils.sendSms(request);
1766
-
1767
-                                                    SealSignRecord sealSignRecordRespon = new SealSignRecord();
1768
-                                                    sealSignRecordRespon.setSignFlowid(signFlowId);
1769
-                                                    sealSignRecordRespon.setPensonAccount(caseAffiliate.getRespondentPhone());
1770
-                                                    EsignHttpResponse signUrlRespon = SignAward.signUrlMediation(sealSignRecordRespon);
1771
-                                                    JsonObject signUrlJsonObjectRespon = gson.fromJson(signUrlRespon.getBody(), JsonObject.class);
1772
-                                                    JsonObject signUrlDataRespon = signUrlJsonObjectRespon.getAsJsonObject("data");
1773
-                                                    String urlRespon = signUrlDataRespon.get("shortUrl").getAsString();
1774
-                                                    String urlResponnew = urlRespon.substring(urlRespon.lastIndexOf("/")+1);
1775
-
1776
-                                                    SmsUtils.SendSmsRequest request1 = new SmsUtils.SendSmsRequest();
1777
-                                                    request1.setTemplateId("2047719");
1778
-                                                    request1.setPhone(caseAffiliate.getRespondentPhone());
1779
-                                                    request1.setTemplateParamSet(new String[]{caseAffiliate.getRespondentName(), caseApplication.getCaseNum(),urlResponnew});
1780
-                                                    Boolean aBoolean1 = SmsUtils.sendSms(request1);
1781
-
1782
-                                                    SealSignRecord sealSignRecordMedi = new SealSignRecord();
1783
-                                                    sealSignRecordMedi.setSignFlowid(signFlowId);
1784
-                                                    sealSignRecordMedi.setPensonAccount(sealSignRecord.getPensonAccountMedi());
1785
-                                                    EsignHttpResponse signUrlResponMedi = SignAward.signUrlMediation(sealSignRecordMedi);
1786
-                                                    JsonObject signUrlJsonObjectResponMedi = gson.fromJson(signUrlResponMedi.getBody(), JsonObject.class);
1787
-                                                    JsonObject signUrlDataResponMedi = signUrlJsonObjectResponMedi.getAsJsonObject("data");
1788
-                                                    String urlResponMedi = signUrlDataResponMedi.get("shortUrl").getAsString();
1789
-                                                    String urlResponnewMedi = urlResponMedi.substring(urlResponMedi.lastIndexOf("/")+1);
1790
-
1791
-                                                    SmsUtils.SendSmsRequest requestMedi = new SmsUtils.SendSmsRequest();
1792
-                                                    requestMedi.setTemplateId("2047719");
1793
-                                                    requestMedi.setPhone(sealSignRecord.getPensonAccountMedi());
1794
-                                                    requestMedi.setTemplateParamSet(new String[]{sealSignRecord.getPensonNameMedi(), caseApplication.getCaseNum(),urlResponnewMedi});
1795
-                                                    Boolean aBooleanMedi = SmsUtils.sendSms(requestMedi);
1796
-
1791
+                                                EsignHttpResponse response3 = SignAward.createByFileMediation(sealSignRecord, sealIdList);
1792
+
1793
+                                                JSONObject jsonObject3 = JSONObject.parseObject(response3.getBody());
1794
+                                                if (jsonObject3 != null) {
1795
+                                                    if (jsonObject3.getIntValue("code") == 0) {
1796
+                                                        //获取签署流程ID
1797
+                                                        JSONObject data1 = jsonObject3.getJSONObject("data");
1798
+                                                        String signFlowId = data1.getString("signFlowId");
1799
+                                                        //保存案件id,文件id,文件名称.流程id到签署用印记录表里
1800
+                                                        sealSignRecord.setCaseAppliId(caseApplication.getId());
1801
+                                                        sealSignRecord.setSignFlowid(signFlowId);
1802
+                                                        sealSignRecord.setSignFlowStatus(1);//待签名
1803
+                                                        MsSealSignRecord msSealSignRecord = new MsSealSignRecord();
1804
+                                                        BeanUtil.copyProperties(sealSignRecord, msSealSignRecord);
1805
+                                                        msSealSignRecord.setFileId(sealSignRecord.getFileid());
1806
+                                                        msSealSignRecord.setFileName(sealSignRecord.getFilename());
1807
+                                                        msSealSignRecord.setSignFlowId(sealSignRecord.getSignFlowid());
1808
+                                                        msSealSignRecord.setOrgnNamePsnAcc(sealSignRecord.getOrgnizeNamePsnAccount());
1809
+                                                        msSealSignRecord.setOrgnNamePsnName(sealSignRecord.getOrgnizeNamepsnName());
1810
+                                                        sealSignRecordMapper.insert(msSealSignRecord);
1811
+
1812
+                                                        SealSignRecord sealSignRecordapply = new SealSignRecord();
1813
+                                                        sealSignRecordapply.setSignFlowid(signFlowId);
1814
+                                                        sealSignRecordapply.setPensonAccount(caseAffiliate.getContactTelphoneAgent());
1815
+                                                        EsignHttpResponse signUrl = SignAward.signUrlMediation(sealSignRecordapply);
1816
+                                                        JsonObject signUrlJsonObject = gson.fromJson(signUrl.getBody(), JsonObject.class);
1817
+                                                        JsonObject signUrlData = signUrlJsonObject.getAsJsonObject("data");
1818
+                                                        String urlapply = signUrlData.get("shortUrl").getAsString();
1819
+                                                        String urlapplynew = urlapply.substring(urlapply.lastIndexOf("/")+1);
1820
+
1821
+                                                        //发送签名链接短信,尊敬的{1}用户,您的{2}调解案件,签名链接{3},请点击链接签名,如非本人操作,请忽略本短信
1822
+                                                        SmsUtils.SendSmsRequest request = new SmsUtils.SendSmsRequest();
1823
+                                                        request.setTemplateId("2047719");
1824
+                                                        request.setPhone(caseAffiliate.getContactTelphoneAgent());
1825
+                                                        request.setTemplateParamSet(new String[]{caseAffiliate.getNameAgent(), caseApplication.getCaseNum(),urlapplynew});
1826
+                                                        Boolean aBoolean = SmsUtils.sendSms(request);
1827
+
1828
+                                                        SealSignRecord sealSignRecordRespon = new SealSignRecord();
1829
+                                                        sealSignRecordRespon.setSignFlowid(signFlowId);
1830
+                                                        sealSignRecordRespon.setPensonAccount(caseAffiliate.getRespondentPhone());
1831
+                                                        EsignHttpResponse signUrlRespon = SignAward.signUrlMediation(sealSignRecordRespon);
1832
+                                                        JsonObject signUrlJsonObjectRespon = gson.fromJson(signUrlRespon.getBody(), JsonObject.class);
1833
+                                                        JsonObject signUrlDataRespon = signUrlJsonObjectRespon.getAsJsonObject("data");
1834
+                                                        String urlRespon = signUrlDataRespon.get("shortUrl").getAsString();
1835
+                                                        String urlResponnew = urlRespon.substring(urlRespon.lastIndexOf("/")+1);
1836
+
1837
+                                                        SmsUtils.SendSmsRequest request1 = new SmsUtils.SendSmsRequest();
1838
+                                                        request1.setTemplateId("2047719");
1839
+                                                        request1.setPhone(caseAffiliate.getRespondentPhone());
1840
+                                                        request1.setTemplateParamSet(new String[]{caseAffiliate.getRespondentName(), caseApplication.getCaseNum(),urlResponnew});
1841
+                                                        Boolean aBoolean1 = SmsUtils.sendSms(request1);
1842
+
1843
+                                                        SealSignRecord sealSignRecordMedi = new SealSignRecord();
1844
+                                                        sealSignRecordMedi.setSignFlowid(signFlowId);
1845
+                                                        sealSignRecordMedi.setPensonAccount(sealSignRecord.getPensonAccountMedi());
1846
+                                                        EsignHttpResponse signUrlResponMedi = SignAward.signUrlMediation(sealSignRecordMedi);
1847
+                                                        JsonObject signUrlJsonObjectResponMedi = gson.fromJson(signUrlResponMedi.getBody(), JsonObject.class);
1848
+                                                        JsonObject signUrlDataResponMedi = signUrlJsonObjectResponMedi.getAsJsonObject("data");
1849
+                                                        String urlResponMedi = signUrlDataResponMedi.get("shortUrl").getAsString();
1850
+                                                        String urlResponnewMedi = urlResponMedi.substring(urlResponMedi.lastIndexOf("/")+1);
1851
+
1852
+                                                        SmsUtils.SendSmsRequest requestMedi = new SmsUtils.SendSmsRequest();
1853
+                                                        requestMedi.setTemplateId("2047719");
1854
+                                                        requestMedi.setPhone(sealSignRecord.getPensonAccountMedi());
1855
+                                                        requestMedi.setTemplateParamSet(new String[]{sealSignRecord.getPensonNameMedi(), caseApplication.getCaseNum(),urlResponnewMedi});
1856
+                                                        Boolean aBooleanMedi = SmsUtils.sendSms(requestMedi);
1857
+
1858
+                                                    } else {
1859
+                                                        throw new ServiceException(jsonObject3.getString("message"));
1860
+                                                    }
1797 1861
                                                 } else {
1798
-                                                    throw new ServiceException(jsonObject3.getString("message"));
1862
+                                                    return AjaxResult.error();
1799 1863
                                                 }
1800
-                                            } else {
1801
-                                                return AjaxResult.error();
1802
-                                            }
1803 1864
 
1804
-                                        }
1865
+                                            }
1805 1866
 
1806 1867
 
1807
-                                    } else {
1808
-                                        return AjaxResult.error();
1868
+                                        } else {
1869
+                                            return AjaxResult.error();
1870
+                                        }
1809 1871
                                     }
1810 1872
                                 }else{
1811 1873
                                     return AjaxResult.error();