Parcourir la source

Merge branch 'wq' of SH-Arbitrate/Arbitrate-Backend into dev

wangqiong123 il y a 2 ans
Parent
révision
e8a02fbe2f

+ 0
- 7
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseApplicationMapper.java Voir le fichier

@@ -55,16 +55,9 @@ public interface CaseApplicationMapper {
55 55
      */
56 56
     void updatePayType(CaseConfirmPayDTO payDTO);
57 57
 
58
-    /**
59
-     * 查询部门长案件
60
-     * @param caseApplication
61
-     * @return
62
-     */
63
-    List<CaseApplication> selectDeptHeadCaseApplicationList(@Param("caseApplication") CaseApplication caseApplication, @Param("statusList")List<Integer> caseStatusList);
64 58
 
65 59
     ToDoCount selectAdminCaseToDoCount();
66 60
 
67
-    ToDoCount selectDeptHeadCaseToDoCount( @Param("statusList")List<Integer> caseStatusList);
68 61
 
69 62
     ToDoCount selectTodoCountByRole(CaseApplication caseApplication);
70 63
 }

+ 97
- 106
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java Voir le fichier

@@ -22,19 +22,13 @@ import com.ruoyi.common.exception.EsignDemoException;
22 22
 import com.ruoyi.common.exception.ServiceException;
23 23
 import com.ruoyi.common.utils.*;
24 24
 import com.ruoyi.common.utils.file.SaaSAPIFileUtils;
25
-
26
-
27
-
28 25
 import com.ruoyi.common.core.domain.entity.SysUser;
29
-import com.ruoyi.common.exception.EsignDemoException;
30
-import com.ruoyi.common.exception.ServiceException;
31 26
 import com.ruoyi.system.domain.SysUserRole;
32 27
 import com.ruoyi.system.mapper.SysRoleMapper;
33 28
 import com.ruoyi.system.mapper.SysUserMapper;
34 29
 import com.ruoyi.system.mapper.SysUserRoleMapper;
35 30
 import com.ruoyi.wisdomarbitrate.domain.vo.ToDoCount;
36 31
 import com.ruoyi.wisdomarbitrate.utils.CaseLogUtils;
37
-import com.ruoyi.common.utils.bean.BeanUtils;
38 32
 import com.ruoyi.system.mapper.SysDeptMapper;
39 33
 import com.ruoyi.wisdomarbitrate.domain.*;
40 34
 import com.ruoyi.wisdomarbitrate.domain.vo.SendRoomNoMessageVO;
@@ -44,7 +38,6 @@ import com.ruoyi.wisdomarbitrate.utils.SignAward;
44 38
 import org.springframework.beans.factory.annotation.Autowired;
45 39
 import org.springframework.stereotype.Service;
46 40
 import org.springframework.transaction.annotation.Transactional;
47
-
48 41
 import java.io.File;
49 42
 import java.io.IOException;
50 43
 import java.math.BigDecimal;
@@ -71,8 +64,6 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
71 64
     @Autowired
72 65
     private CaseAffiliateMapper caseAffiliateMapper;
73 66
 
74
-    @Autowired
75
-    private CasePaymentRecordMapper casePaymentRecordMapper;
76 67
     @Autowired
77 68
     private ArbitrateRecordMapper arbitrateRecordMapper;
78 69
     @Autowired
@@ -127,25 +118,25 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
127 118
             ){
128 119
                 return caseApplicationMapper.selectAdminCaseApplicationList(caseApplication);
129 120
             }
130
-//            if(role.getRoleName().equals("仲裁委")
131
-//                    ||role.getRoleName().equals("部门长")){
132
-//                List<Integer> caseStatusList=new ArrayList<>();
133
-//                caseStatusList.add(CaseApplicationConstants.CONFIRMDED_PENDING_TRIAL);
134
-//                caseStatusList.add(CaseApplicationConstants.SIGN_ARBITRATION);
135
-//                caseStatusList.add(CaseApplicationConstants.ARBITRATED_SEAL);
136
-//                caseApplication.setDeptHeadStatus(caseStatusList);
137
-//            }
138
-//            if(role.getRoleName().equals("仲裁员")){
139
-//                caseApplication.setUserId(String.valueOf(userId));
140
-//            }
121
+            if(role.getRoleName().equals("仲裁委")
122
+                    ||role.getRoleName().equals("部门长")){
123
+                List<Integer> caseStatusList=new ArrayList<>();
124
+                caseStatusList.add(CaseApplicationConstants.CONFIRMDED_PENDING_TRIAL);
125
+                caseStatusList.add(CaseApplicationConstants.SIGN_ARBITRATION);
126
+                caseStatusList.add(CaseApplicationConstants.ARBITRATED_SEAL);
127
+                caseApplication.setDeptHeadStatus(caseStatusList);
128
+            }
129
+            if(role.getRoleName().equals("仲裁员")){
130
+                caseApplication.setUserId(String.valueOf(userId));
131
+            }
141 132
             if(role.getRoleName().equals("财务")){
142 133
                 caseApplication.setFinanceStatus(CaseApplicationConstants.PENDING_PAYMENT_CONFIRM);
143 134
             }
144
-//            if(role.getRoleName().equals("法律顾问")){
145
-//                // 查询角色有关的用户部门
146
-//                List<Long> deptIds = sysDeptMapper.selectUserDeptListByRoleId(role.getRoleId());
147
-//                caseApplication.setDeptIds(deptIds);
148
-//            }
135
+            if(role.getRoleName().equals("法律顾问")){
136
+                // 查询角色有关的用户部门
137
+                List<Long> deptIds = sysDeptMapper.selectUserDeptListByRoleId(role.getRoleId());
138
+                caseApplication.setDeptIds(deptIds);
139
+            }
149 140
             if(StrUtil.isEmpty(caseApplication.getNameId())&&role.getRoleName().equals("申请人")){
150 141
                 // 查询角色有关的用户部门
151 142
                 caseApplication.setNameId(String.valueOf(sysUser.getDeptId()));
@@ -243,12 +234,12 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
243 234
         List<CaseAffiliate> caseAffiliates = caseApplication.getCaseAffiliates();
244 235
         Map<String, Long> deptMap =new HashMap<>();
245 236
         if (caseAffiliates != null && caseAffiliates.size() > 0) {
246
-                // 查询所有的组织机构,组装成map
247
-                List<SysDept> deptList = sysDeptMapper.selectDeptList(new SysDept());
248
-                if (CollectionUtil.isEmpty(deptList)) {
249
-                    deptList = new ArrayList<>();
250
-                }
251
-                 deptMap = deptList.stream().collect(Collectors.toMap(SysDept::getDeptName, SysDept::getDeptId,(oldV,newV)->newV));
237
+            // 查询所有的组织机构,组装成map
238
+            List<SysDept> deptList = sysDeptMapper.selectDeptList(new SysDept());
239
+            if (CollectionUtil.isEmpty(deptList)) {
240
+                deptList = new ArrayList<>();
241
+            }
242
+            deptMap = deptList.stream().collect(Collectors.toMap(SysDept::getDeptName, SysDept::getDeptId,(oldV,newV)->newV));
252 243
 
253 244
             for (CaseAffiliate caseAffiliate : caseAffiliates) {
254 245
                 caseAffiliate.setCaseAppliId(caseApplication.getId());
@@ -307,7 +298,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
307 298
         String currentDay = DateUtils.dateTime();
308 299
         String caseNum = "zc"+ currentDay;
309 300
         //查询出当天的案件编号的最大值
310
-            Integer maxCaseNum =  caseApplicationMapper.selectCaseNumLike(caseNum,caseNum.length());
301
+        Integer maxCaseNum =  caseApplicationMapper.selectCaseNumLike(caseNum,caseNum.length());
311 302
         if(null == maxCaseNum){
312 303
             caseNum = caseNum + "001";
313 304
         }else {
@@ -373,7 +364,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
373 364
 
374 365
                 }
375 366
 
376
-                    caseAffiliateMapper.updataCaseAffiliate(caseAffiliate);
367
+                caseAffiliateMapper.updataCaseAffiliate(caseAffiliate);
377 368
             }
378 369
 
379 370
         }
@@ -428,7 +419,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
428 419
                     SmsUtils.sendSms(request);
429 420
                 }
430 421
             } else if (null != agentUser.getDeptId() && !String.valueOf(agentUser.getDeptId()).equals(caseAffiliate.getApplicationOrganId())) {
431
-               return "申请机构与申请代理人不匹配";
422
+                return "申请机构与申请代理人不匹配";
432 423
             } else if (null != agentUser.getDeptId() && String.valueOf(agentUser.getDeptId()).equals(caseAffiliate.getApplicationOrganId())){
433 424
                 // 同步用户表和案件关联人表的手机号和名称
434 425
                 caseAffiliate.setContactTelphoneAgent(agentUser.getPhonenumber());
@@ -602,48 +593,48 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
602 593
 
603 594
                 //对不重复的立案对象集合的立案对象重新组装对应的案件关联人信息
604 595
 //                if(caseApplicationListinsertDiffer!=null&&caseApplicationListinsertDiffer.size()>0){
605
-                    List<CaseApplication> caseApplicationNewList = null;
606
-                    for (int i = 0; i < caseApplicationListinsert.size(); i++){
607
-                        caseApplicationNewList = new ArrayList<>();
608
-                        CaseApplication caseApplicationinsertDiffer = caseApplicationListinsert.get(i);
609
-                        // 设置自动编码
610
-                        caseApplicationinsertDiffer.setCaseNum(generateCaseNum());
611
-                        List<CaseAffiliate> caseAffiliatesnew =  new ArrayList<>();
612
-                        CaseApplication caseApplicationNew = new CaseApplication();
613
-                        copyCaseApplication(caseApplicationinsertDiffer,caseApplicationNew);
614
-                        if(caseApplicationListinsert!=null&&caseApplicationListinsert.size()>0){
615
-                            for (int j = 0; j < caseApplicationListinsert.size(); j++){
616
-                                CaseApplication  caseApplicationinsert = caseApplicationListinsert.get(j);
617
-
618
-                                if(StringUtils.isNotEmpty(caseApplicationinsert.getCaseNum())&&
619
-                                        caseApplicationinsert.getCaseNum().equals(caseApplicationinsertDiffer.getCaseNum())){
620
-
621
-                                    caseAffiliatesnew.addAll(caseApplicationinsert.getCaseAffiliates());
622
-                                }
596
+                List<CaseApplication> caseApplicationNewList = null;
597
+                for (int i = 0; i < caseApplicationListinsert.size(); i++){
598
+                    caseApplicationNewList = new ArrayList<>();
599
+                    CaseApplication caseApplicationinsertDiffer = caseApplicationListinsert.get(i);
600
+                    // 设置自动编码
601
+                    caseApplicationinsertDiffer.setCaseNum(generateCaseNum());
602
+                    List<CaseAffiliate> caseAffiliatesnew =  new ArrayList<>();
603
+                    CaseApplication caseApplicationNew = new CaseApplication();
604
+                    copyCaseApplication(caseApplicationinsertDiffer,caseApplicationNew);
605
+                    if(caseApplicationListinsert!=null&&caseApplicationListinsert.size()>0){
606
+                        for (int j = 0; j < caseApplicationListinsert.size(); j++){
607
+                            CaseApplication  caseApplicationinsert = caseApplicationListinsert.get(j);
608
+
609
+                            if(StringUtils.isNotEmpty(caseApplicationinsert.getCaseNum())&&
610
+                                    caseApplicationinsert.getCaseNum().equals(caseApplicationinsertDiffer.getCaseNum())){
611
+
612
+                                caseAffiliatesnew.addAll(caseApplicationinsert.getCaseAffiliates());
623 613
                             }
624
-                            caseApplicationNew.setCaseAffiliates(caseAffiliatesnew);
625
-                            caseApplicationNewList.add(caseApplicationNew);
626 614
                         }
615
+                        caseApplicationNew.setCaseAffiliates(caseAffiliatesnew);
616
+                        caseApplicationNewList.add(caseApplicationNew);
617
+                    }
627 618
 
628
-                        for (int k = 0; k < caseApplicationNewList.size(); k++){
629
-                            CaseApplication caseApplicationItera = caseApplicationNewList.get(k);
630
-                            // 新增立案信息
631
-                            caseApplicationItera.setCaseStatus(CaseApplicationConstants.CASE_APPLICATION);
632
-                            caseApplicationItera.setCreateBy(getUsername());
633
-                            int rows = caseApplicationMapper.insertCaseApplication(caseApplicationItera);
634
-                            List<CaseAffiliate> caseAffiliates = caseApplicationItera.getCaseAffiliates();
635
-                            if(caseAffiliates!=null&&caseAffiliates.size()>0){
636
-                                for (CaseAffiliate caseAffiliate : caseAffiliates){
637
-                                    caseAffiliate.setCaseAppliId(caseApplicationItera.getId());
619
+                    for (int k = 0; k < caseApplicationNewList.size(); k++){
620
+                        CaseApplication caseApplicationItera = caseApplicationNewList.get(k);
621
+                        // 新增立案信息
622
+                        caseApplicationItera.setCaseStatus(CaseApplicationConstants.CASE_APPLICATION);
623
+                        caseApplicationItera.setCreateBy(getUsername());
624
+                        int rows = caseApplicationMapper.insertCaseApplication(caseApplicationItera);
625
+                        List<CaseAffiliate> caseAffiliates = caseApplicationItera.getCaseAffiliates();
626
+                        if(caseAffiliates!=null&&caseAffiliates.size()>0){
627
+                            for (CaseAffiliate caseAffiliate : caseAffiliates){
628
+                                caseAffiliate.setCaseAppliId(caseApplicationItera.getId());
638 629
 
639
-                                }
640
-                                caseAffiliateMapper.batchCaseAffiliate(caseAffiliates);
641 630
                             }
642
-
643
-                            successNum++;
644
-                            successMsg.append("<br/>" + successNum + "、立案编号 " + caseApplicationItera.getCaseNum() + " 导入成功");
631
+                            caseAffiliateMapper.batchCaseAffiliate(caseAffiliates);
645 632
                         }
646 633
 
634
+                        successNum++;
635
+                        successMsg.append("<br/>" + successNum + "、立案编号 " + caseApplicationItera.getCaseNum() + " 导入成功");
636
+                    }
637
+
647 638
 //                    }
648 639
 
649 640
                 }
@@ -653,7 +644,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
653 644
         }else {
654 645
             throw new ServiceException("导入立案申请数据不能为空!");
655 646
         }
656
-            return successMsg.append(failureMsg.toString()).toString();
647
+        return successMsg.append(failureMsg.toString()).toString();
657 648
 
658 649
     }
659 650
 
@@ -1423,19 +1414,19 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
1423 1414
             for(int i = 0;i < idStrList.length;i ++ ){
1424 1415
                 idList.add(Long.parseLong(idStrList[i]));
1425 1416
             }
1426
-                    // 查询仲裁员电话号
1427
-                 List<SysUser> userList=   sysUserMapper.selectUserListByIds(idList);
1428
-                 if(CollectionUtil.isNotEmpty(userList)) {
1429
-                     for (SysUser user : userList) {
1430
-                     //给仲裁员发送短信通知
1431
-                     request.setPhone(user.getPhonenumber());
1432
-                     // 1947342 普通短信 开庭日期通知 尊敬的{1}用户,您的{2}仲裁案件,开庭日期已确定为{3},请知晓,如非本人操作,请忽略本短信。
1433
-                     String name = user.getNickName();
1434
-                     request.setTemplateParamSet(new String[]{name, caseNum, hearDatestr});
1435
-                     SmsUtils.sendSms(request);
1436
-
1437
-                     }
1438
-                 }
1417
+            // 查询仲裁员电话号
1418
+            List<SysUser> userList=   sysUserMapper.selectUserListByIds(idList);
1419
+            if(CollectionUtil.isNotEmpty(userList)) {
1420
+                for (SysUser user : userList) {
1421
+                    //给仲裁员发送短信通知
1422
+                    request.setPhone(user.getPhonenumber());
1423
+                    // 1947342 普通短信 开庭日期通知 尊敬的{1}用户,您的{2}仲裁案件,开庭日期已确定为{3},请知晓,如非本人操作,请忽略本短信。
1424
+                    String name = user.getNickName();
1425
+                    request.setTemplateParamSet(new String[]{name, caseNum, hearDatestr});
1426
+                    SmsUtils.sendSms(request);
1427
+
1428
+                }
1429
+            }
1439 1430
 
1440 1431
         }
1441 1432
 
@@ -1448,7 +1439,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
1448 1439
                 CaseAffiliate caseAffiliateselect = caseAffiliatListeselect.get(j);
1449 1440
                 int identityType = caseAffiliateselect.getIdentityType();
1450 1441
                 if(identityType==1){
1451
-                  caseAffiliateselect.setName(caseAffiliateselect.getApplicationOrganName());
1442
+                    caseAffiliateselect.setName(caseAffiliateselect.getApplicationOrganName());
1452 1443
 
1453 1444
                 }
1454 1445
                 //给申请人、被申请人发送短信通知
@@ -1501,7 +1492,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
1501 1492
 
1502 1493
 
1503 1494
     private void assignmentCaseAffiliates(CaseApplication caseApplication, List<CaseAffiliate> caseAffiliatesnew, Map<String, Long> deptMap) {
1504
-       // 申请人信息
1495
+        // 申请人信息
1505 1496
         CaseAffiliate caseAffiliate = new CaseAffiliate();
1506 1497
 
1507 1498
 //        BeanUtils.copyBeanProp(caseApplication,caseAffiliate);
@@ -1516,7 +1507,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
1516 1507
         if(StrUtil.isNotEmpty(s)){
1517 1508
             StringBuilder errorMsg = caseApplication.getErrorMsg();
1518 1509
             if(StrUtil.isEmpty(errorMsg)){
1519
-             errorMsg=new StringBuilder();
1510
+                errorMsg=new StringBuilder();
1520 1511
             }
1521 1512
             errorMsg.append(s);
1522 1513
             caseApplication.setErrorMsg(errorMsg);
@@ -1563,27 +1554,27 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
1563 1554
 
1564 1555
 
1565 1556
 
1566
-            // 将组织机构id设为申请人名称
1567
-            if(deptMap.containsKey(caseApplication.getName())){
1568
-                caseAffiliate.setApplicationOrganId(String.valueOf(deptMap.get(caseApplication.getName())));
1569
-                caseAffiliate.setApplicationOrganName(caseApplication.getName());
1570
-            }else {
1571
-               // 如果不存在则新增
1572
-                SysDept dept = new SysDept();
1573
-                dept.setParentId(0L);
1574
-                dept.setDeptName(caseApplication.getName());
1575
-                dept.setAncestors("0");
1576
-                dept.setOrderNum(1);
1577
-                dept.setStatus("0");
1578
-                dept.setDelFlag("0");
1579
-                dept.setCreateBy(getUsername());
1580
-                dept.setUpdateBy(getUsername());
1581
-                sysDeptMapper.insertDept(dept);
1582
-                deptMap.put(dept.getDeptName(),dept.getDeptId());
1583
-                caseAffiliate.setApplicationOrganId(String.valueOf(dept.getDeptId()));
1584
-                caseAffiliate.setApplicationOrganName(caseApplication.getName());
1557
+        // 将组织机构id设为申请人名称
1558
+        if(deptMap.containsKey(caseApplication.getName())){
1559
+            caseAffiliate.setApplicationOrganId(String.valueOf(deptMap.get(caseApplication.getName())));
1560
+            caseAffiliate.setApplicationOrganName(caseApplication.getName());
1561
+        }else {
1562
+            // 如果不存在则新增
1563
+            SysDept dept = new SysDept();
1564
+            dept.setParentId(0L);
1565
+            dept.setDeptName(caseApplication.getName());
1566
+            dept.setAncestors("0");
1567
+            dept.setOrderNum(1);
1568
+            dept.setStatus("0");
1569
+            dept.setDelFlag("0");
1570
+            dept.setCreateBy(getUsername());
1571
+            dept.setUpdateBy(getUsername());
1572
+            sysDeptMapper.insertDept(dept);
1573
+            deptMap.put(dept.getDeptName(),dept.getDeptId());
1574
+            caseAffiliate.setApplicationOrganId(String.valueOf(dept.getDeptId()));
1575
+            caseAffiliate.setApplicationOrganName(caseApplication.getName());
1585 1576
 
1586
-            }
1577
+        }
1587 1578
 
1588 1579
     }
1589 1580
 

+ 1
- 116
ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml Voir le fichier

@@ -134,14 +134,7 @@
134 134
             </if>
135 135
         </where>
136 136
         ) t1
137
-        <!--        <where>-->
138
-        <!--            &lt;!&ndash;申请人&ndash;&gt;-->
139
-        <!--            <if test="nameId != null and nameId != ''">-->
140
-        <!--                and ( t1.application_organ_id = #{nameId} AND t1.identity_type=1-->
141
-        <!--                    and t1.case_status in (0,2)-->
142
-        <!--                )-->
143
-        <!--            </if>-->
144
-        <!--        </where>-->
137
+
145 138
         order by t1.create_time desc,t1.case_num desc
146 139
     </select>
147 140
     <select id="selectTodoCountByRole" resultType="com.ruoyi.wisdomarbitrate.domain.vo.ToDoCount">
@@ -226,14 +219,6 @@
226 219
             </if>
227 220
         </where>
228 221
         ) t1
229
-        <!--      <where>
230
-                   &lt;!&ndash;申请人&ndash;&gt;-->
231
-        <!--            <if test="nameId != null and nameId != ''">-->
232
-        <!--                and ( t1.application_organ_id = #{nameId} AND t1.identity_type=1-->
233
-        <!--                and t1.case_status in (0,2)-->
234
-        <!--                )-->
235
-        <!--            </if>
236
-                </where> -->
237 222
     </select>
238 223
 
239 224
     <select id="selectAdminCaseApplicationList" parameterType="CaseApplication" resultMap="CaseApplicationResult">
@@ -322,106 +307,6 @@
322 307
                 )
323 308
 
324 309
     </select>
325
-    <select id="selectDeptHeadCaseApplicationList" parameterType="CaseApplication" resultMap="CaseApplicationResult">
326
-        select c.id ,c.case_num ,c.case_subject_amount ,c.register_date ,c.arbitrat_method ,
327
-        CASE c.arbitrat_method when 1 then '开庭审理' when 2 then '书面审理'
328
-        ELSE '无审理方式'
329
-        END arbitratMethodName,
330
-        c.case_status ,
331
-        CASE c.case_status when 0 then '立案申请' when 1 then '待立案审查' when 2 then '待缴费'
332
-        when 3 then '待缴费确认' when 4 then '待案件质证' when 5 then '待组庭审核'
333
-        when 6 then '待组庭确定' when 7 then '待审核仲裁方式' when 8 then '待开庭审理'
334
-        when 9 then '待书面审理' when 10 then '待生成仲裁文书' when 11 then '待核验仲裁文书'
335
-        when 12 then '待审核仲裁文书' when 13 then '待仲裁文书签名' when 14 then '待仲裁文书用印'
336
-        when 15 then '待仲裁文书送达' when 16 then '待案件归档' when 17 then '已归档'
337
-        ELSE '无案件状态'
338
-        END caseStatusName,
339
-        c.hear_date ,c.arbitrat_claims ,
340
-        c.loan_start_date ,c.loan_end_date ,c.claim_princi_owed ,c.claim_interest_owed ,c.claim_liquid_damag ,c.fee_payable ,
341
-        c.begin_video_date ,c.online_video_person ,c.contract_number ,c.create_by ,c.create_time ,
342
-        c.update_by ,c.update_time , c.arbitrator_name,ca.application_organ_id applicationOrganId ,ca.application_organ_name as applicantName,c.filearbitra_url
343
-        from case_application c
344
-        LEFT JOIN case_affiliate ca ON ca.case_appli_id = c.id AND ca.identity_type=1
345
-        <where>
346
-            c.case_status in
347
-            <foreach item="caseStatus" collection="statusList" open="(" separator="," close=")">
348
-                #{caseStatus}
349
-            </foreach>
350
-            <if test="caseApplication.caseStatus != null">
351
-                AND c.case_status = #{caseApplication.caseStatus}
352
-            </if>
353
-            <if test="caseApplication.caseNum != null and caseApplication.caseNum != ''">
354
-                AND c.case_num = #{caseApplication.caseNum}
355
-            </if>
356
-            <if test="caseApplication.nameId != null and caseApplication.nameId != ''">
357
-                AND ca.application_organ_id=#{caseApplication.nameId}  AND ca.identity_type=1
358
-            </if>
359
-            <if test="caseApplication.caseStatusList != null and caseApplication.caseStatusList.size() > 0">
360
-                and c.case_status in
361
-                <foreach item="caseStatus" collection="caseApplication.caseStatusList" open="(" separator="," close=")">
362
-                    #{caseStatus}
363
-                </foreach>
364
-            </if>
365
-        </where>
366
-        order by c.create_time desc,c.case_num desc
367
-    </select>
368
-    <select id="selectDeptHeadCaseToDoCount" resultType="com.ruoyi.wisdomarbitrate.domain.vo.ToDoCount">
369
-        select  sum( case when c.case_status=0 then 1 else 0 end) caseApply,
370
-        sum( case when c.case_status=1 then 1 else 0 end) caseApplyCheck,
371
-        sum( case when c.case_status=2 then 1 else 0 end) caseApplyPay,
372
-        sum( case when c.case_status=3 then 1 else 0 end) caseApplyPayCheck,
373
-        sum( case when c.case_status=4 then 1 else 0 end) caseApplyEvidence,
374
-        sum( case when c.case_status=5 then 1 else 0 end) caseApplyGroupCheck,
375
-        sum( case when c.case_status=6 then 1 else 0 end) caseApplyGroupConfirm,
376
-        sum( case when c.case_status=7 then 1 else 0 end) caseApplyArbitrateWay,
377
-        sum( case when c.case_status=8 then 1 else 0 end) caseApplyGroupOnline,
378
-        sum( case when c.case_status=9 then 1 else 0 end) caseApplyGroupOffline,
379
-        sum( case when c.case_status=10 then 1 else 0 end) caseApplyAward,
380
-        sum( case when c.case_status=11 then 1 else 0 end) caseApplyAwardCheck,
381
-        sum( case when c.case_status=12 then 1 else 0 end) caseApplyAwardConfirm,
382
-        sum( case when c.case_status=13 then 1 else 0 end) caseApplyAwardSign,
383
-        sum( case when c.case_status=14 then 1 else 0 end) caseApplyAwardSeal,
384
-        sum( case when c.case_status=15 then 1 else 0 end) caseApplyAwardSend,
385
-        sum( case when c.case_status=16 then 1 else 0 end) caseApplyStored,
386
-        sum( case when c.case_status=17 then 1 else 0 end) caseApplyArchived
387
-        from case_application c
388
-        LEFT JOIN case_affiliate ca ON ca.case_appli_id = c.id AND ca.identity_type=1
389
-        <where>
390
-            <!--部门长-->
391
-            <if test="statusList != null and statusList.size() > 0">
392
-                or c.case_status in
393
-                <foreach item="caseStatus" collection="statusList" open="(" separator="," close=")">
394
-                    #{caseStatus}
395
-                </foreach>
396
-                <!--被申请人-->
397
-                <if test="idCard != null and idCard != ''">
398
-                    or (t.identity_num=#{idCard} AND t.identity_type=2 and t.case_status=4)
399
-                </if>
400
-                <!--仲裁员-->
401
-                <if test="userId != null and userId != ''">
402
-                    or ( t.identity_type=1 and
403
-                    t.case_status in (7,8,9,12,13,14)
404
-                    and
405
-                    instr (t.arbitrator_id,#{userId})>0)
406
-                </if>
407
-                <!--法律顾问-->
408
-                <if test="deptIds != null and deptIds.size() > 0">
409
-                    or (t.identity_type=1 and t.case_status in (1,5,11,15,16)
410
-                    and t.application_organ_id in
411
-                    <foreach item="item" collection="deptIds" open="(" separator="," close=")">
412
-                        #{item}
413
-                    </foreach> )
414
-                </if>
415
-                <!--申请人-->
416
-                <if test="nameId != null and nameId != ''">
417
-                    or( ( t.application_organ_id = #{nameId} AND t.identity_type=1
418
-                    and t.case_status in (0,2))
419
-                    )
420
-                </if>
421
-            </if>
422
-        </where>
423
-
424
-    </select>
425 310
 
426 311
 
427 312
     <select id="selectCaseApplicationCount" parameterType="CaseApplication" resultType="int">