Quellcode durchsuchen

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

wangqiong123 vor 2 Jahren
Ursprung
Commit
e8a02fbe2f

+ 0
- 7
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseApplicationMapper.java Datei anzeigen

55
      */
55
      */
56
     void updatePayType(CaseConfirmPayDTO payDTO);
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
     ToDoCount selectAdminCaseToDoCount();
59
     ToDoCount selectAdminCaseToDoCount();
66
 
60
 
67
-    ToDoCount selectDeptHeadCaseToDoCount( @Param("statusList")List<Integer> caseStatusList);
68
 
61
 
69
     ToDoCount selectTodoCountByRole(CaseApplication caseApplication);
62
     ToDoCount selectTodoCountByRole(CaseApplication caseApplication);
70
 }
63
 }

+ 97
- 106
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java Datei anzeigen

22
 import com.ruoyi.common.exception.ServiceException;
22
 import com.ruoyi.common.exception.ServiceException;
23
 import com.ruoyi.common.utils.*;
23
 import com.ruoyi.common.utils.*;
24
 import com.ruoyi.common.utils.file.SaaSAPIFileUtils;
24
 import com.ruoyi.common.utils.file.SaaSAPIFileUtils;
25
-
26
-
27
-
28
 import com.ruoyi.common.core.domain.entity.SysUser;
25
 import com.ruoyi.common.core.domain.entity.SysUser;
29
-import com.ruoyi.common.exception.EsignDemoException;
30
-import com.ruoyi.common.exception.ServiceException;
31
 import com.ruoyi.system.domain.SysUserRole;
26
 import com.ruoyi.system.domain.SysUserRole;
32
 import com.ruoyi.system.mapper.SysRoleMapper;
27
 import com.ruoyi.system.mapper.SysRoleMapper;
33
 import com.ruoyi.system.mapper.SysUserMapper;
28
 import com.ruoyi.system.mapper.SysUserMapper;
34
 import com.ruoyi.system.mapper.SysUserRoleMapper;
29
 import com.ruoyi.system.mapper.SysUserRoleMapper;
35
 import com.ruoyi.wisdomarbitrate.domain.vo.ToDoCount;
30
 import com.ruoyi.wisdomarbitrate.domain.vo.ToDoCount;
36
 import com.ruoyi.wisdomarbitrate.utils.CaseLogUtils;
31
 import com.ruoyi.wisdomarbitrate.utils.CaseLogUtils;
37
-import com.ruoyi.common.utils.bean.BeanUtils;
38
 import com.ruoyi.system.mapper.SysDeptMapper;
32
 import com.ruoyi.system.mapper.SysDeptMapper;
39
 import com.ruoyi.wisdomarbitrate.domain.*;
33
 import com.ruoyi.wisdomarbitrate.domain.*;
40
 import com.ruoyi.wisdomarbitrate.domain.vo.SendRoomNoMessageVO;
34
 import com.ruoyi.wisdomarbitrate.domain.vo.SendRoomNoMessageVO;
44
 import org.springframework.beans.factory.annotation.Autowired;
38
 import org.springframework.beans.factory.annotation.Autowired;
45
 import org.springframework.stereotype.Service;
39
 import org.springframework.stereotype.Service;
46
 import org.springframework.transaction.annotation.Transactional;
40
 import org.springframework.transaction.annotation.Transactional;
47
-
48
 import java.io.File;
41
 import java.io.File;
49
 import java.io.IOException;
42
 import java.io.IOException;
50
 import java.math.BigDecimal;
43
 import java.math.BigDecimal;
71
     @Autowired
64
     @Autowired
72
     private CaseAffiliateMapper caseAffiliateMapper;
65
     private CaseAffiliateMapper caseAffiliateMapper;
73
 
66
 
74
-    @Autowired
75
-    private CasePaymentRecordMapper casePaymentRecordMapper;
76
     @Autowired
67
     @Autowired
77
     private ArbitrateRecordMapper arbitrateRecordMapper;
68
     private ArbitrateRecordMapper arbitrateRecordMapper;
78
     @Autowired
69
     @Autowired
127
             ){
118
             ){
128
                 return caseApplicationMapper.selectAdminCaseApplicationList(caseApplication);
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
             if(role.getRoleName().equals("财务")){
132
             if(role.getRoleName().equals("财务")){
142
                 caseApplication.setFinanceStatus(CaseApplicationConstants.PENDING_PAYMENT_CONFIRM);
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
             if(StrUtil.isEmpty(caseApplication.getNameId())&&role.getRoleName().equals("申请人")){
140
             if(StrUtil.isEmpty(caseApplication.getNameId())&&role.getRoleName().equals("申请人")){
150
                 // 查询角色有关的用户部门
141
                 // 查询角色有关的用户部门
151
                 caseApplication.setNameId(String.valueOf(sysUser.getDeptId()));
142
                 caseApplication.setNameId(String.valueOf(sysUser.getDeptId()));
243
         List<CaseAffiliate> caseAffiliates = caseApplication.getCaseAffiliates();
234
         List<CaseAffiliate> caseAffiliates = caseApplication.getCaseAffiliates();
244
         Map<String, Long> deptMap =new HashMap<>();
235
         Map<String, Long> deptMap =new HashMap<>();
245
         if (caseAffiliates != null && caseAffiliates.size() > 0) {
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
             for (CaseAffiliate caseAffiliate : caseAffiliates) {
244
             for (CaseAffiliate caseAffiliate : caseAffiliates) {
254
                 caseAffiliate.setCaseAppliId(caseApplication.getId());
245
                 caseAffiliate.setCaseAppliId(caseApplication.getId());
307
         String currentDay = DateUtils.dateTime();
298
         String currentDay = DateUtils.dateTime();
308
         String caseNum = "zc"+ currentDay;
299
         String caseNum = "zc"+ currentDay;
309
         //查询出当天的案件编号的最大值
300
         //查询出当天的案件编号的最大值
310
-            Integer maxCaseNum =  caseApplicationMapper.selectCaseNumLike(caseNum,caseNum.length());
301
+        Integer maxCaseNum =  caseApplicationMapper.selectCaseNumLike(caseNum,caseNum.length());
311
         if(null == maxCaseNum){
302
         if(null == maxCaseNum){
312
             caseNum = caseNum + "001";
303
             caseNum = caseNum + "001";
313
         }else {
304
         }else {
373
 
364
 
374
                 }
365
                 }
375
 
366
 
376
-                    caseAffiliateMapper.updataCaseAffiliate(caseAffiliate);
367
+                caseAffiliateMapper.updataCaseAffiliate(caseAffiliate);
377
             }
368
             }
378
 
369
 
379
         }
370
         }
428
                     SmsUtils.sendSms(request);
419
                     SmsUtils.sendSms(request);
429
                 }
420
                 }
430
             } else if (null != agentUser.getDeptId() && !String.valueOf(agentUser.getDeptId()).equals(caseAffiliate.getApplicationOrganId())) {
421
             } else if (null != agentUser.getDeptId() && !String.valueOf(agentUser.getDeptId()).equals(caseAffiliate.getApplicationOrganId())) {
431
-               return "申请机构与申请代理人不匹配";
422
+                return "申请机构与申请代理人不匹配";
432
             } else if (null != agentUser.getDeptId() && String.valueOf(agentUser.getDeptId()).equals(caseAffiliate.getApplicationOrganId())){
423
             } else if (null != agentUser.getDeptId() && String.valueOf(agentUser.getDeptId()).equals(caseAffiliate.getApplicationOrganId())){
433
                 // 同步用户表和案件关联人表的手机号和名称
424
                 // 同步用户表和案件关联人表的手机号和名称
434
                 caseAffiliate.setContactTelphoneAgent(agentUser.getPhonenumber());
425
                 caseAffiliate.setContactTelphoneAgent(agentUser.getPhonenumber());
602
 
593
 
603
                 //对不重复的立案对象集合的立案对象重新组装对应的案件关联人信息
594
                 //对不重复的立案对象集合的立案对象重新组装对应的案件关联人信息
604
 //                if(caseApplicationListinsertDiffer!=null&&caseApplicationListinsertDiffer.size()>0){
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
         }else {
644
         }else {
654
             throw new ServiceException("导入立案申请数据不能为空!");
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
             for(int i = 0;i < idStrList.length;i ++ ){
1414
             for(int i = 0;i < idStrList.length;i ++ ){
1424
                 idList.add(Long.parseLong(idStrList[i]));
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
                 CaseAffiliate caseAffiliateselect = caseAffiliatListeselect.get(j);
1439
                 CaseAffiliate caseAffiliateselect = caseAffiliatListeselect.get(j);
1449
                 int identityType = caseAffiliateselect.getIdentityType();
1440
                 int identityType = caseAffiliateselect.getIdentityType();
1450
                 if(identityType==1){
1441
                 if(identityType==1){
1451
-                  caseAffiliateselect.setName(caseAffiliateselect.getApplicationOrganName());
1442
+                    caseAffiliateselect.setName(caseAffiliateselect.getApplicationOrganName());
1452
 
1443
 
1453
                 }
1444
                 }
1454
                 //给申请人、被申请人发送短信通知
1445
                 //给申请人、被申请人发送短信通知
1501
 
1492
 
1502
 
1493
 
1503
     private void assignmentCaseAffiliates(CaseApplication caseApplication, List<CaseAffiliate> caseAffiliatesnew, Map<String, Long> deptMap) {
1494
     private void assignmentCaseAffiliates(CaseApplication caseApplication, List<CaseAffiliate> caseAffiliatesnew, Map<String, Long> deptMap) {
1504
-       // 申请人信息
1495
+        // 申请人信息
1505
         CaseAffiliate caseAffiliate = new CaseAffiliate();
1496
         CaseAffiliate caseAffiliate = new CaseAffiliate();
1506
 
1497
 
1507
 //        BeanUtils.copyBeanProp(caseApplication,caseAffiliate);
1498
 //        BeanUtils.copyBeanProp(caseApplication,caseAffiliate);
1516
         if(StrUtil.isNotEmpty(s)){
1507
         if(StrUtil.isNotEmpty(s)){
1517
             StringBuilder errorMsg = caseApplication.getErrorMsg();
1508
             StringBuilder errorMsg = caseApplication.getErrorMsg();
1518
             if(StrUtil.isEmpty(errorMsg)){
1509
             if(StrUtil.isEmpty(errorMsg)){
1519
-             errorMsg=new StringBuilder();
1510
+                errorMsg=new StringBuilder();
1520
             }
1511
             }
1521
             errorMsg.append(s);
1512
             errorMsg.append(s);
1522
             caseApplication.setErrorMsg(errorMsg);
1513
             caseApplication.setErrorMsg(errorMsg);
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 Datei anzeigen

134
             </if>
134
             </if>
135
         </where>
135
         </where>
136
         ) t1
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
         order by t1.create_time desc,t1.case_num desc
138
         order by t1.create_time desc,t1.case_num desc
146
     </select>
139
     </select>
147
     <select id="selectTodoCountByRole" resultType="com.ruoyi.wisdomarbitrate.domain.vo.ToDoCount">
140
     <select id="selectTodoCountByRole" resultType="com.ruoyi.wisdomarbitrate.domain.vo.ToDoCount">
226
             </if>
219
             </if>
227
         </where>
220
         </where>
228
         ) t1
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
     </select>
222
     </select>
238
 
223
 
239
     <select id="selectAdminCaseApplicationList" parameterType="CaseApplication" resultMap="CaseApplicationResult">
224
     <select id="selectAdminCaseApplicationList" parameterType="CaseApplication" resultMap="CaseApplicationResult">
322
                 )
307
                 )
323
 
308
 
324
     </select>
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
     <select id="selectCaseApplicationCount" parameterType="CaseApplication" resultType="int">
312
     <select id="selectCaseApplicationCount" parameterType="CaseApplication" resultType="int">