18792927508 пре 2 година
родитељ
комит
91da9b96b8

+ 8
- 0
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseApplicationMapper.java Прегледај датотеку

@@ -33,6 +33,13 @@ public interface CaseApplicationMapper {
33 33
 
34 34
     CaseApplication selectCaseApplication(CaseApplication caseApplication);
35 35
 
36
+    /**
37
+     * 根据案件id查询案件信息
38
+     * @param ids
39
+     * @return
40
+     */
41
+    List<CaseApplication> listCaseApplicationByIds(@Param("ids")List<Long> ids);
42
+
36 43
     CaseApplication selectCaseApplicationConfirm(CaseApplication caseApplication);
37 44
 
38 45
     /**
@@ -76,4 +83,5 @@ public interface CaseApplicationMapper {
76 83
      * @return
77 84
      */
78 85
     int batchDeletecaseApplication(@Param("ids") List<Long> ids);
86
+
79 87
 }

+ 45
- 28
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java Прегледај датотеку

@@ -105,7 +105,6 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
105 105
         LoginUser loginUser = getLoginUser();
106 106
         SysUser user = loginUser.getUser();
107 107
         Long userId = user.getUserId();
108
-
109 108
         // 查询登录人身份证号
110 109
         SysUser sysUser = sysUserMapper.selectUserById(userId);
111 110
         List<SysRole> roles = sysUser.getRoles();
@@ -552,7 +551,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
552 551
     @Override
553 552
     @Transactional
554 553
     public int insertcaseApplication(CaseApplication caseApplication) {
555
-        // 新增立案信息
554
+
556 555
         caseApplication.setCaseStatus(CaseApplicationConstants.CASE_APPLICATION);
557 556
         //根据仲裁费用计费规则计算应缴费用
558 557
         //暂时设置计费比率为0.01
@@ -563,10 +562,11 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
563 562
         String caseNum = generateCaseNum();
564 563
         caseApplication.setCaseNum(caseNum);
565 564
         caseApplication.setCreateBy(getUsername());
566
-
565
+          // 新增立案信息
567 566
         int rows = caseApplicationMapper.insertCaseApplication(caseApplication);
568 567
         List<CaseAffiliate> caseAffiliates = caseApplication.getCaseAffiliates();
569 568
         Map<String, Long> deptMap =new HashMap<>();
569
+        // 判断申请机构
570 570
         if (caseAffiliates != null && caseAffiliates.size() > 0) {
571 571
             // 查询所有的组织机构,组装成map
572 572
             List<SysDept> deptList = sysDeptMapper.selectDeptList(new SysDept());
@@ -574,7 +574,8 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
574 574
                 deptList = new ArrayList<>();
575 575
             }
576 576
             deptMap = deptList.stream().collect(Collectors.toMap(SysDept::getDeptName, SysDept::getDeptId,(oldV,newV)->newV));
577
-
577
+            // 查询申请人角色id
578
+            Long roleId = roleMapper.selectRoleIdByName("申请人");
578 579
             for (CaseAffiliate caseAffiliate : caseAffiliates) {
579 580
                 caseAffiliate.setCaseAppliId(caseApplication.getId());
580 581
                 if(caseAffiliate.getIdentityType()==1&&StrUtil.isNotEmpty(caseAffiliate.getName())) {
@@ -600,13 +601,13 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
600 601
 
601 602
                     }
602 603
                     // 组装申请代理人信息
603
-                    String agentInfoFlag = buildAgentInfo(caseAffiliate);
604
+                    String agentInfoFlag = buildAgentInfo(caseAffiliate,roleId);
604 605
                     if(StrUtil.isNotEmpty(agentInfoFlag)){
605 606
                         throw new ServiceException(agentInfoFlag);
606 607
                     }
607 608
                 }
608 609
             }
609
-
610
+            // 新增案件关联人
610 611
             caseAffiliateMapper.batchCaseAffiliate(caseAffiliates);
611 612
         }
612 613
 
@@ -614,6 +615,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
614 615
         if (caseAttachList != null && caseAttachList.size() > 0) {
615 616
             for (CaseAttach caseAttach : caseAttachList) {
616 617
                 caseAttach.setCaseAppliId(caseApplication.getId());
618
+                // 修改案件附件
617 619
                 caseAttachMapper.updateCaseAttach(caseAttach);
618 620
             }
619 621
         }
@@ -666,6 +668,8 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
666 668
                 deptList = new ArrayList<>();
667 669
             }
668 670
             Map<String, Long> deptMap = deptList.stream().collect(Collectors.toMap(SysDept::getDeptName, SysDept::getDeptId,(oldV,newV)->newV));
671
+            // 查询申请人角色id
672
+            Long roleId = roleMapper.selectRoleIdByName("申请人");
669 673
             for (CaseAffiliate caseAffiliate : caseAffiliates){
670 674
                 caseAffiliate.setCaseAppliId(caseApplication.getId());
671 675
                 if(caseAffiliate.getIdentityType()==1&&StrUtil.isNotEmpty(caseAffiliate.getName())) {
@@ -691,7 +695,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
691 695
                         caseAffiliate.setApplicationOrganId(String.valueOf(dept.getDeptId()));
692 696
 
693 697
                     }
694
-                    String agentInfoFlag = buildAgentInfo(caseAffiliate);
698
+                    String agentInfoFlag = buildAgentInfo(caseAffiliate,roleId);
695 699
                     if(StrUtil.isNotEmpty(agentInfoFlag)){
696 700
                         throw new ServiceException(agentInfoFlag);
697 701
                     }
@@ -718,10 +722,9 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
718 722
      * 组装申请代理人信息
719 723
      * @param caseAffiliate
720 724
      */
721
-    private String buildAgentInfo(CaseAffiliate caseAffiliate) {
725
+    private String buildAgentInfo(CaseAffiliate caseAffiliate,Long roleId) {
722 726
         if (caseAffiliate.getIdentityType()==1&&StrUtil.isNotEmpty(caseAffiliate.getNameAgent())) {
723
-            // 查询申请人角色id
724
-            Long roleId = roleMapper.selectRoleIdByName("申请人");
727
+
725 728
             // 组装申请机构代理人信息,用户表新增并且和部门关联
726 729
             // 根据代理人身份证去用户表查询,有修改,么有新增
727 730
             SysUser agentUser = sysUserMapper.selectUserByIdCard(caseAffiliate.getIdentityNumAgent());
@@ -764,28 +767,40 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
764 767
                 caseAffiliate.setContactTelphoneAgent(agentUser.getPhonenumber());
765 768
                 caseAffiliate.setNameAgent(agentUser.getNickName());
766 769
                 caseAffiliate.setApplicantAgentUserId(String.valueOf(agentUser.getUserId()));
770
+                List<Long> longList=new ArrayList<>();
767 771
                 // 新增角色为申请人
768 772
                 if(CollectionUtil.isNotEmpty(agentUser.getRoles())) {
769
-                    List<Long> longList = agentUser.getRoles().stream().map(SysRole::getRoleId).collect(Collectors.toList());
773
+                     longList = agentUser.getRoles().stream().map(SysRole::getRoleId).collect(Collectors.toList());
770 774
                     if(!longList.contains(roleId)) {
771
-                        ArrayList<SysUserRole> sysUserRoles = new ArrayList<>();
772
-                        SysUserRole sysUserRole = new SysUserRole();
773
-                        sysUserRole.setUserId(agentUser.getUserId());
774
-                        sysUserRole.setRoleId(roleId);
775
-                        sysUserRoles.add(sysUserRole);
776
-                        if (CollectionUtil.isNotEmpty(sysUserRoles)) {
777
-                            userRoleMapper.batchUserRole(sysUserRoles);
778
-                        }
775
+                        insertAgentUserRole(agentUser,roleId);
779 776
                     }
777
+                }else {
778
+
779
+                    insertAgentUserRole(agentUser,roleId);
780 780
                 }
781 781
 
782 782
             }
783 783
 
784
-
785 784
         }
786 785
         return null;
787 786
     }
788 787
 
788
+    /**
789
+     *  新增角色为申请人
790
+     * @param agentUser
791
+     * @param roleId
792
+     */
793
+    private void insertAgentUserRole(SysUser agentUser, Long roleId) {
794
+        ArrayList<SysUserRole> sysUserRoles = new ArrayList<>();
795
+        SysUserRole sysUserRole = new SysUserRole();
796
+        sysUserRole.setUserId(agentUser.getUserId());
797
+        sysUserRole.setRoleId(roleId);
798
+        sysUserRoles.add(sysUserRole);
799
+        if (CollectionUtil.isNotEmpty(sysUserRoles)) {
800
+            userRoleMapper.batchUserRole(sysUserRoles);
801
+        }
802
+    }
803
+
789 804
     @Override
790 805
     @Transactional
791 806
     public int submitCaseApplication(  List<Long> ids) {
@@ -882,7 +897,6 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
882 897
         StringBuilder failureMsg = new StringBuilder();
883 898
         StringBuilder successMsg = new StringBuilder();
884 899
         int successNum = 0;
885
-        int failureNum = 0;
886 900
         if(caseApplicationList!=null&&caseApplicationList.size()>0){
887 901
             // 1,查询所有的组织机构,组装成map
888 902
             List<SysDept> deptList = sysDeptMapper.selectDeptList(new SysDept());
@@ -890,6 +904,8 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
890 904
             if(CollectionUtil.isNotEmpty(deptList)) {
891 905
                 deptMap = deptList.stream().collect(Collectors.toMap(SysDept::getDeptName, SysDept::getDeptId,(oldV,newV)->newV));
892 906
             }
907
+            // 查询申请人角色id
908
+            Long roleId = roleMapper.selectRoleIdByName("申请人");
893 909
             List<CaseApplication> caseApplicationListinsert = new ArrayList<>();
894 910
             for (int i = 0; i < caseApplicationList.size(); i++){
895 911
                 CaseApplication caseApplication = caseApplicationList.get(i);
@@ -907,7 +923,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
907 923
                     //赋值CaseApplication的案件关联人信息
908 924
                     List<CaseAffiliate> caseAffiliatesnew = new ArrayList<>();
909 925
                     // 组装案件关联人信息
910
-                    assignmentCaseAffiliates(caseApplication, caseAffiliatesnew, deptMap);
926
+                    assignmentCaseAffiliates(caseApplication, caseAffiliatesnew, deptMap,roleId);
911 927
 
912 928
 //                int caseApplicationCount = selectCaseApplicationCount(caseApplication);
913 929
 //                if(caseApplicationCount>0){
@@ -928,7 +944,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
928 944
                     failureMsg.append("<br/>").append("第").append(i+2).append("行:").append(caseApplication.getErrorMsg().toString());
929 945
                 }
930 946
             }
931
-            if(caseApplicationListinsert!=null&&caseApplicationListinsert.size()>0){
947
+            if(caseApplicationListinsert.size()>0){
932 948
 //                List<CaseApplication> caseApplicationListinsertDiffer = caseApplicationListinsert.stream().collect(
933 949
 //                        collectingAndThen(
934 950
 //                                toCollection(() -> new TreeSet<>(Comparator.comparing(CaseApplication::getCaseNum))),
@@ -946,7 +962,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
946 962
                     List<CaseAffiliate> caseAffiliatesnew =  new ArrayList<>();
947 963
                     CaseApplication caseApplicationNew = new CaseApplication();
948 964
                     copyCaseApplication(caseApplicationinsertDiffer,caseApplicationNew);
949
-                    if(caseApplicationListinsert!=null&&caseApplicationListinsert.size()>0){
965
+                    if(caseApplicationListinsert.size()>0){
950 966
                         for (int j = 0; j < caseApplicationListinsert.size(); j++){
951 967
                             CaseApplication  caseApplicationinsert = caseApplicationListinsert.get(j);
952 968
 
@@ -976,7 +992,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
976 992
                         }
977 993
 
978 994
                         successNum++;
979
-                        successMsg.append("<br/>" + successNum + "、立案编号 " + caseApplicationItera.getCaseNum() + " 导入成功");
995
+                        successMsg.append("<br/>").append(successNum).append("、立案编号 ").append(caseApplicationItera.getCaseNum()).append(" 导入成功");
980 996
                     }
981 997
 
982 998
 //                    }
@@ -988,7 +1004,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
988 1004
         }else {
989 1005
             throw new ServiceException("导入立案申请数据不能为空!");
990 1006
         }
991
-        return successMsg.append(failureMsg.toString()).toString();
1007
+        return successMsg.append(failureMsg).toString();
992 1008
 
993 1009
     }
994 1010
 
@@ -1857,7 +1873,8 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
1857 1873
 
1858 1874
 
1859 1875
 
1860
-    private void assignmentCaseAffiliates(CaseApplication caseApplication, List<CaseAffiliate> caseAffiliatesnew, Map<String, Long> deptMap) {
1876
+    private void assignmentCaseAffiliates(CaseApplication caseApplication, List<CaseAffiliate> caseAffiliatesnew,
1877
+                                          Map<String, Long> deptMap,Long roleId) {
1861 1878
         // 申请人信息
1862 1879
         CaseAffiliate caseAffiliate = new CaseAffiliate();
1863 1880
 
@@ -1869,7 +1886,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
1869 1886
         if(StrUtil.isNotEmpty(caseApplication.getName())){
1870 1887
             setApplicantOrganization(caseAffiliate, caseApplication, deptMap);
1871 1888
         }
1872
-        String s = buildAgentInfo(caseAffiliate);
1889
+        String s = buildAgentInfo(caseAffiliate,roleId);
1873 1890
         if(StrUtil.isNotEmpty(s)){
1874 1891
             StringBuilder errorMsg = caseApplication.getErrorMsg();
1875 1892
             if(StrUtil.isEmpty(errorMsg)){

+ 92
- 62
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseArbitrateServiceImpl.java Прегледај датотеку

@@ -1,5 +1,6 @@
1 1
 package com.ruoyi.wisdomarbitrate.service.impl;
2 2
 
3
+import cn.hutool.core.collection.CollectionUtil;
3 4
 import com.ruoyi.common.constant.CaseApplicationConstants;
4 5
 import com.ruoyi.common.core.domain.AjaxResult;
5 6
 import com.ruoyi.common.utils.WordUtil;
@@ -20,6 +21,8 @@ import java.nio.file.StandardCopyOption;
20 21
 import java.time.LocalDate;
21 22
 import java.time.ZoneId;
22 23
 import java.util.*;
24
+import java.util.function.Function;
25
+import java.util.stream.Collectors;
23 26
 
24 27
 @Service
25 28
 public class CaseArbitrateServiceImpl implements ICaseArbitrateService {
@@ -37,87 +40,114 @@ public class CaseArbitrateServiceImpl implements ICaseArbitrateService {
37 40
     @Override
38 41
     @Transactional
39 42
     public AjaxResult examineArbitrateMethod(List<Long> ids, Integer opinion) {
43
+        // 批量查询案件信息组装成map
44
+        List<CaseApplication> caseApplicationList = caseApplicationMapper.listCaseApplicationByIds(ids);
45
+        if (CollectionUtil.isEmpty(caseApplicationList)) {
46
+            return AjaxResult.success();
47
+        }
48
+        Map<Long, CaseApplication> caseApplicationMap = caseApplicationList.stream().collect(Collectors.toMap(CaseApplication::getId, Function.identity(), (n1, n2) -> n2));
49
+
50
+        //发送短信通知
51
+        SmsUtils.SendSmsRequest request = new SmsUtils.SendSmsRequest();
52
+
40 53
         for (Long id : ids) {
41 54
 
42 55
             CaseApplication caseApplication = new CaseApplication();
43 56
             caseApplication.setId(id);
44 57
             //查询案件详细信息
45
-            CaseApplication caseApplication1 = caseApplicationMapper.selectCaseApplication(caseApplication);
46
-            if (caseApplication1 == null) {
47
-                return AjaxResult.success();
58
+            CaseApplication caseApplicationById = caseApplicationMap.get(id);
59
+            if (caseApplicationById == null) {
60
+                continue;
48 61
             }
49
-            int arbitratMethod = caseApplication1.getArbitratMethod();
50
-            String caseNum = caseApplication1.getCaseNum();
51
-            if (opinion == 0) {   //拒绝
52
-                if (arbitratMethod == 2) {
53
-                    caseApplication1.setArbitratMethod(1);  // 更改仲裁方式
54
-                    //修改案件状态为待开庭审理
62
+            // 获取该案件仲裁方式
63
+            Integer arbitratMethod = caseApplicationById.getArbitratMethod();
64
+            if(arbitratMethod!=null) {
65
+                String caseNum = caseApplicationById.getCaseNum();
66
+                // 日志节点的状态
67
+                int caseLogStatus;
68
+                if (opinion == 0) {   //拒绝
69
+                    if (arbitratMethod == 2) {
70
+                        caseApplicationById.setArbitratMethod(1);  // 更改仲裁方式
71
+                        //修改案件状态为待开庭审理
55 72
 //                caseApplication1.setCaseStatus(CaseApplicationConstants.PENDING_OPENCOURT_HEAR);
56
-                    //修改案件状态为待修改开庭时间
57
-                    caseApplication1.setCaseStatus(CaseApplicationConstants.MODIFY_HEARDATE);
58
-                    // 新增日志
59
-                    CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.PENDING_OPENCOURT_HEAR, "");
60
-
61
-                } else {
62
-                    caseApplication1.setArbitratMethod(2);
63
-                    //修改案件状态为待书面审理
64
-                    caseApplication1.setCaseStatus(CaseApplicationConstants.PENDING_WRIITEN_HEAR);
65
-                    // 新增日志
66
-                    CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.PENDING_WRIITEN_HEAR, "");
73
+                        //修改案件状态为待修改开庭时间
74
+                        caseApplicationById.setCaseStatus(CaseApplicationConstants.MODIFY_HEARDATE);
75
+                        // 新增日志
76
+                        caseLogStatus = CaseApplicationConstants.MODIFY_HEARDATE;
67 77
 
68
-                }
69
-            } else {
70
-                if (arbitratMethod == 2) {
71
-                    //修改案件状态为待书面审理
72
-                    caseApplication1.setCaseStatus(CaseApplicationConstants.PENDING_WRIITEN_HEAR);
73
-                    // 新增日志
74
-                    CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.PENDING_WRIITEN_HEAR, "");
78
+                    } else {
79
+                        caseApplicationById.setArbitratMethod(2);
80
+                        //修改案件状态为待书面审理
81
+                        caseApplicationById.setCaseStatus(CaseApplicationConstants.PENDING_WRIITEN_HEAR);
82
+                        caseLogStatus = CaseApplicationConstants.PENDING_WRIITEN_HEAR;
75 83
 
84
+                    }
76 85
                 } else {
77
-                    //修改案件状态为待开庭审理
86
+                    if (arbitratMethod == 2) {
87
+                        //修改案件状态为待书面审理
88
+                        caseApplicationById.setCaseStatus(CaseApplicationConstants.PENDING_WRIITEN_HEAR);
89
+                        caseLogStatus = CaseApplicationConstants.PENDING_WRIITEN_HEAR;
90
+
91
+                    } else {
92
+                        //修改案件状态为待开庭审理
78 93
 //                caseApplication1.setCaseStatus(CaseApplicationConstants.PENDING_OPENCOURT_HEAR);
79
-                    //修改案件状态为待修改开庭时间
80
-                    caseApplication1.setCaseStatus(CaseApplicationConstants.MODIFY_HEARDATE);
81
-                    // 新增日志
82
-                    CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.PENDING_OPENCOURT_HEAR, "");
94
+                        //修改案件状态为待修改开庭时间
95
+                        caseApplicationById.setCaseStatus(CaseApplicationConstants.MODIFY_HEARDATE);
96
+                        caseLogStatus = CaseApplicationConstants.MODIFY_HEARDATE;
97
+
83 98
 
84
-                }
85
-            }
86
-            int i = caseApplicationMapper.submitCaseApplication(caseApplication1);
87
-            if (i > 0) {
88
-                String arbitratMethodStr = caseApplication1.getArbitratMethod() == 1 ? "开庭审理" : "书面审理";
89
-                //发送短信通知
90
-                SmsUtils.SendSmsRequest request = new SmsUtils.SendSmsRequest();
91
-                request.setTemplateId("1931000");
92
-                CaseAffiliate caseAffiliate = new CaseAffiliate();
93
-                caseAffiliate.setCaseAppliId(caseApplication1.getId());
94
-                List<CaseAffiliate> caseAffiliates = caseAffiliateMapper.selectCaseAffiliate(caseAffiliate);            //获取案件关联人信息
95
-                if (caseAffiliates != null && caseAffiliates.size() > 0) {
96
-                    for (CaseAffiliate affiliate : caseAffiliates) {
97
-                        //获取身份类型
98
-                        int identityType = affiliate.getIdentityType();
99
-                        if (identityType == 1) {    //申请人
100
-                            request.setPhone(affiliate.getContactTelphone());
101
-                            // 这个值,要看你的模板中是否预留了占位符,如果没有则不需要设置
102
-                            // 1931000 普通短信 确定仲裁方式通知 尊敬的{1}用户,您的{2}仲裁案件,仲裁方式已确定为{3},请知晓,如非本人操作,请忽略本短信。
103
-                            String name = affiliate.getName();
104
-                            request.setTemplateParamSet(new String[]{name, caseNum, arbitratMethodStr});
105
-                            SmsUtils.sendSms(request);
106
-                        } else {       //被申请人
107
-                            request.setPhone(affiliate.getContactTelphone());
108
-                            // 模板id1928006 普通短信 案件应诉通知 尊敬的{1}用户,您的{2}案件{3}已成功受理,请点击https://phmapp.xayunmei.com选择是否应诉。
109
-                            String name = affiliate.getName();
110
-                            request.setTemplateParamSet(new String[]{name, caseNum, arbitratMethodStr});
111
-                            SmsUtils.sendSms(request);
112
-                        }
113 99
                     }
114 100
                 }
115
-
101
+                // 更改案件状态
102
+                int i = caseApplicationMapper.submitCaseApplication(caseApplicationById);
103
+                if (i > 0) {
104
+                    // 新增日志
105
+                    CaseLogUtils.insertCaseLog(caseApplication.getId(), caseLogStatus, "");
106
+                    // 发送短信
107
+                    sendArbitratMethodMes(caseApplicationById, request, caseNum);
108
+                }
116 109
             }
117 110
         }
118 111
         return AjaxResult.success();
119 112
     }
120 113
 
114
+    /**
115
+     * 发送短信
116
+     * @param caseApplicationById
117
+     * @param request
118
+     * @param caseNum
119
+     */
120
+    private void sendArbitratMethodMes(CaseApplication caseApplicationById, SmsUtils.SendSmsRequest request, String caseNum) {
121
+        String arbitratMethodStr = caseApplicationById.getArbitratMethod() == 1 ? "开庭审理" : "书面审理";
122
+
123
+        CaseAffiliate caseAffiliate = new CaseAffiliate();
124
+        caseAffiliate.setCaseAppliId(caseApplicationById.getId());
125
+        List<CaseAffiliate> caseAffiliates = caseAffiliateMapper.selectCaseAffiliate(caseAffiliate);            //获取案件关联人信息
126
+        if (CollectionUtil.isEmpty(caseAffiliates)) {
127
+            return;
128
+        }
129
+        for (CaseAffiliate affiliate : caseAffiliates) {
130
+            //获取身份类型
131
+            int identityType = affiliate.getIdentityType();
132
+            if (identityType == 1) {    //申请人
133
+                request.setTemplateId("1931000");
134
+                request.setPhone(affiliate.getContactTelphone());
135
+                // 这个值,要看你的模板中是否预留了占位符,如果没有则不需要设置
136
+                // 1931000 普通短信 确定仲裁方式通知 尊敬的{1}用户,您的{2}仲裁案件,仲裁方式已确定为{3},请知晓,如非本人操作,请忽略本短信。
137
+                String name = affiliate.getName();
138
+                request.setTemplateParamSet(new String[]{name, caseNum, arbitratMethodStr});
139
+                SmsUtils.sendSms(request);
140
+            } else {       //被申请人
141
+                request.setTemplateId("1928006");
142
+                request.setPhone(affiliate.getContactTelphone());
143
+                // 模板id1928006 普通短信 案件应诉通知 尊敬的{1}用户,您的{2}案件{3}已成功受理,请点击https://phmapp.xayunmei.com选择是否应诉。
144
+                String name = affiliate.getName();
145
+                request.setTemplateParamSet(new String[]{name, caseNum, arbitratMethodStr});
146
+                SmsUtils.sendSms(request);
147
+            }
148
+        }
149
+    }
150
+
121 151
     @Override
122 152
     @Transactional
123 153
     public AjaxResult writtenHear(ArbitrateRecord arbitrateRecord) {

+ 31
- 0
ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml Прегледај датотеку

@@ -488,7 +488,37 @@
488 488
             </if>
489 489
         </where>
490 490
     </select>
491
+    <select id="listCaseApplicationByIds" resultMap="CaseApplicationResult">
492
+        select c.id ,c.case_num ,c.case_subject_amount ,c.register_date ,c.arbitrat_method ,
493
+        CASE c.arbitrat_method when 1 then '开庭审理' when 2 then '书面审理'
494
+        ELSE '无审理方式'
495
+        END arbitratMethodName,
496
+        c.case_status ,
497
+        CASE c.case_status when 0 then '立案申请' when 1 then '待立案审查' when 2 then '待缴费'
498
+        when 3 then '待缴费确认' when 4 then '待案件质证' when 5 then '待组庭审核'
499
+        when 6 then '待组庭确定' when 7 then '待审核仲裁方式' when 8 then '待开庭审理'
500
+        when 9 then '待书面审理' when 10 then '待生成仲裁文书' when 11 then '待核验仲裁文书'
501
+        when 12 then '待审核仲裁文书' when 13 then '待仲裁文书签名' when 14 then '待仲裁文书用印'
502
+        when 15 then '待仲裁文书送达' when 16 then '待案件归档'
503
+        ELSE '无案件状态'
504
+        END caseStatusName,
505
+        c.hear_date ,c.arbitrat_claims ,
506
+        c.loan_start_date ,c.loan_end_date ,c.claim_princi_owed ,c.claim_interest_owed ,c.claim_liquid_damag ,c.fee_payable ,
507
+        c.begin_video_date ,c.online_video_person ,c.contract_number ,c.create_by ,c.create_time ,c.request_rule,c.adjudica_counter,c.proper_preser,
508
+        c.is_absence ,c.respon_cross_opin ,c.applica_cross_opin ,c.respon_defen_opini ,
509
+        c.update_by ,c.update_time,c.arbitrator_id,c.arbitrator_name,ca.application_organ_id applicationOrganId ,ca.application_organ_name as applicantName
510
+        from case_application c
511
+        LEFT JOIN case_affiliate ca ON ca.case_appli_id = c.id and ca.identity_type=1
491 512
 
513
+        <where>
514
+            <if test="ids != null and ids.size() > 0 ">
515
+                 c.id in
516
+                <foreach item="id" collection="ids" open="(" separator="," close=")">
517
+                    #{id}
518
+                </foreach>
519
+            </if>
520
+        </where>
521
+    </select>
492 522
     <select id="selectCaseApplicationConfirm" parameterType="CaseApplication" resultMap="CaseApplicationResult">
493 523
         select c.id ,c.case_num ,c.case_subject_amount ,c.register_date ,c.arbitrat_method ,
494 524
                CASE c.arbitrat_method when 1 then '开庭审理' when 2 then '书面审理'
@@ -526,4 +556,5 @@
526 556
     </select>
527 557
 
528 558
 
559
+
529 560
 </mapper>

+ 1
- 1
ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseEvidenceMapper.xml Прегледај датотеку

@@ -9,7 +9,7 @@
9 9
         <result property="caseStatus"     column="case_status"    />
10 10
     </resultMap>
11 11
     <select id="getCaseListByRespondent" resultType="CaseEvidenceVO" resultMap="CaseEvidenceVOResult">
12
-        select c.id, c.case_num,c.case_status
12
+        select DISTINCT(c.id) id, c.case_num,c.case_status
13 13
         from case_application as c  ,case_affiliate as d
14 14
         where c.id = d.case_appli_id
15 15
         <if test="identityNum != null and identityNum != ''">