Просмотр исходного кода

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

qtz 2 лет назад
Родитель
Сommit
731cbc3c6a

+ 159
- 97
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/mscase/impl/MsCaseApplicationServiceImpl.java Просмотреть файл

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