Bladeren bron

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

wangqiong123 2 jaren geleden
bovenliggende
commit
50a9e7242c
17 gewijzigde bestanden met toevoegingen van 735 en 293 verwijderingen
  1. 24
    1
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/AdjudicationController.java
  2. 6
    3
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/ArbitratorController.java
  3. 5
    2
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseApplicationController.java
  4. 20
    20
      ruoyi-common/src/main/java/com/ruoyi/common/constant/CaseApplicationConstants.java
  5. 6
    0
      ruoyi-system/src/main/java/com/ruoyi/system/service/ISysUserService.java
  6. 36
    7
      ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserServiceImpl.java
  7. 12
    0
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/Arbitrator.java
  8. 8
    0
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseApplication.java
  9. 12
    1
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseApplicationMapper.java
  10. 16
    0
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/IAdjudicationService.java
  11. 2
    0
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/ICaseApplicationService.java
  12. 153
    6
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/AdjudicationServiceImpl.java
  13. 266
    83
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java
  14. 3
    37
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseZipImportImpl.java
  15. 4
    3
      ruoyi-system/src/main/resources/mapper/wisdomarbitrate/ArbitrateRecordMapper.xml
  16. 161
    129
      ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml
  17. 1
    1
      ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseLogRecordMapper.xml

+ 24
- 1
ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/AdjudicationController.java Bestand weergeven

@@ -2,6 +2,7 @@ package com.ruoyi.web.controller.wisdomarbitrate;
2 2
 
3 3
 import cn.hutool.core.collection.CollectionUtil;
4 4
 import cn.hutool.core.util.StrUtil;
5
+import com.ruoyi.common.constant.CaseApplicationConstants;
5 6
 import com.ruoyi.common.core.controller.BaseController;
6 7
 import com.ruoyi.common.core.domain.AjaxResult;
7 8
 import com.ruoyi.common.core.page.TableDataInfo;
@@ -101,6 +102,18 @@ public class AdjudicationController extends BaseController {
101 102
         }
102 103
         return adjudicationService.createDocument(caseApplication);
103 104
     }
105
+    /**
106
+     * 开庭审理,确定审理结果,生成裁决书
107
+     * @param caseApplication
108
+     * @return
109
+     */
110
+    @PostMapping("/caseJudgment")
111
+    public AjaxResult caseJudgment(@Validated @RequestBody CaseApplication caseApplication){
112
+        if (caseApplication.getId() == null) {
113
+            return AjaxResult.error("案件id不能为空");
114
+        }
115
+        return adjudicationService.caseJudgment(caseApplication);
116
+    }
104 117
     /**
105 118
      * 批量生成裁决书
106 119
      * @param caseApplication
@@ -174,7 +187,7 @@ public class AdjudicationController extends BaseController {
174 187
 
175 188
     /**
176 189
      * 批量归档(暂时只改案件状态)
177
-     * @param batchCaseApplication
190
+     * @param caseApplication
178 191
      * @return
179 192
      */
180 193
     @PostMapping("/caseFileBatch")
@@ -240,5 +253,15 @@ public class AdjudicationController extends BaseController {
240 253
 
241 254
         return adjudicationService.emailByCaseId(id);
242 255
     }
256
+    /**
257
+     * 开庭审理提交,只改变案件状态为CaseApplicationConstants.VERPRIF_ARBITRATION
258
+     * @param id 案件id
259
+     * @return
260
+     */
261
+    @GetMapping("/changeCaseStatus")
262
+    public AjaxResult changeCaseStatus(@RequestParam("id") Long id){
263
+
264
+        return adjudicationService.changeCaseStatus(id, CaseApplicationConstants.VERPRIF_ARBITRATION);
265
+    }
243 266
 
244 267
 }

+ 6
- 3
ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/ArbitratorController.java Bestand weergeven

@@ -1,6 +1,7 @@
1 1
 package com.ruoyi.web.controller.wisdomarbitrate;
2 2
 
3 3
 import com.ruoyi.common.core.controller.BaseController;
4
+import com.ruoyi.common.core.domain.AjaxResult;
4 5
 import com.ruoyi.common.core.domain.entity.SysUser;
5 6
 import com.ruoyi.common.core.page.TableDataInfo;
6 7
 import com.ruoyi.system.mapper.SysUserMapper;
@@ -26,11 +27,13 @@ public class ArbitratorController   extends BaseController {
26 27
      */
27 28
 //    @PreAuthorize("@ss.hasPermi('arbitrator:list')")
28 29
     @GetMapping("/list")
29
-    public TableDataInfo list(Arbitrator arbitrator)
30
+    public AjaxResult list(Arbitrator arbitrator)
30 31
     {
31
-        startPage();
32
+        if(arbitrator.getCaseId()==null){
33
+            return AjaxResult.error("案件id不能为空");
34
+        }
32 35
         List<SysUser> list = sysUserService.selectUserListByAdRole(arbitrator);
33
-        return getDataTable(list);
36
+        return AjaxResult.success(list);
34 37
     }
35 38
 
36 39
 

+ 5
- 2
ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseApplicationController.java Bestand weergeven

@@ -48,8 +48,8 @@ public class CaseApplicationController extends BaseController {
48 48
         if(StrUtil.isEmpty(caseApplication.getSelectCaseStatus())){
49 49
           caseApplication.setSelectCaseStatus("0");
50 50
         }
51
-        startPage();
52
-        List<CaseApplication> list = caseApplicationService.selectCaseApplicationListByRole(caseApplication);
51
+//        List<CaseApplication> list = caseApplicationService.selectCaseApplicationListByRole(caseApplication);
52
+        List<CaseApplication> list = caseApplicationService.page(caseApplication);
53 53
         return getDataTable(list);
54 54
     }
55 55
 
@@ -271,6 +271,9 @@ public class CaseApplicationController extends BaseController {
271 271
     @Log(title = "组庭审核", businessType = BusinessType.UPDATE)
272 272
     @PostMapping("/pendTralCheck")
273 273
     public AjaxResult pendTralCheck(@Validated @RequestBody CaseApplication caseApplication) {
274
+        if(StrUtil.isEmpty(caseApplication.getArbitratorId())|| StrUtil.isEmpty(caseApplication.getArbitratorName())){
275
+            return error("请选择仲裁员");
276
+        }
274 277
         return caseApplicationService.pendTralCheck(caseApplication);
275 278
     }
276 279
 

+ 20
- 20
ruoyi-common/src/main/java/com/ruoyi/common/constant/CaseApplicationConstants.java Bestand weergeven

@@ -4,52 +4,52 @@ package com.ruoyi.common.constant;
4 4
  *
5 5
  */
6 6
 public class CaseApplicationConstants {
7
-    /** 立案申请 */
7
+    /** 申请人/代理人,立案申请 */
8 8
     public static final int CASE_APPLICATION = 0;
9
-    /** 案件修改 */
9
+    /** 申请人/代理人,案件修改 */
10 10
     public static final int CASE_EDIT = -1;
11
-    /** 待立案审查 */
11
+    /** 顾问,待立案审查 */
12 12
     public static final int CASE_CHECK = 1;
13
-    /** 待缴费 */
13
+    /** 申请人、代理人,待缴费 */
14 14
     public static final int PENDING_PAYMENT = 2;
15
-    /** 待缴费确认  */
15
+    /** 财务,待缴费确认  */
16 16
     public static final int PENDING_PAYMENT_CONFIRM = 3;
17
-    /** 待案件质证 */
17
+    /** 被申,待案件质证 */
18 18
     public static final int CASE_CROSSEXAMI = 4;
19 19
 
20
-    /** 待组庭  */
20
+    /** 待定,待组庭  */
21 21
     public static final int PENDING_TRIAL = 26;
22
-    /** 待组庭审核  */
22
+    /** 顾问,待组庭审核  */
23 23
     public static final int CONFIRMDED_PENDING_TRIAL_SUBMMIT = 5;
24
-    /** 待组庭确定   */
24
+    /** 部门长,待组庭确定   */
25 25
     public static final int CONFIRMDED_PENDING_TRIAL = 6;
26 26
 
27
-    /** 待审核仲裁方式 */
27
+    /** 仲裁员,待审核仲裁方式 */
28 28
     public static final int CHECK_ARBITRATION_METHOD = 7;
29
-    /** 待开庭审理 */
29
+    /** 申请人,被申,顾问,仲裁员,待开庭审理 */
30 30
     public static final int PENDING_OPENCOURT_HEAR = 8;
31
-    /** 待书面审理 */
31
+    /** 申请人,被申,顾问,仲裁员,待书面审理 */
32 32
     public static final int PENDING_WRIITEN_HEAR = 9;
33 33
     /** 待生成裁决书  */
34 34
     public static final int GENERATED_ARBITRATION = 10;
35
-    /**待秘书核验裁决书*/
35
+    /**顾问,待秘书核验裁决书*/
36 36
     public static final int VERPRIF_ARBITRATION = 11;
37
-    /**待部门长审核裁决书*/
37
+    /**部门长,待部门长审核裁决书*/
38 38
     public static final int CHECK_ARBITRATION = 12;
39
-    /**待裁决书签名*/
39
+    /**仲裁员,待裁决书签名*/
40 40
     public static final int SIGN_ARBITRATION = 13;
41
-    /** 待裁决书用印 */
41
+    /** 顾问,待裁决书用印 */
42 42
     public static final int     ARBITRATED_SEAL = 14;
43
-    /** 待裁决书送达 */
43
+    /** 顾问,待裁决书送达 */
44 44
     public static final int ARBITRATION_DELIVERY = 15;
45
-    /** 待案件归档*/
45
+    /** 顾问,待案件归档*/
46 46
     public static final int CASE_FILING = 16;
47 47
     /** 已归档*/
48 48
     public static final int CASE_ARCHIVED = 17;
49 49
 
50
-    /** 待修改开庭时间*/
50
+    /** 顾问,待修改开庭时间*/
51 51
     public static final int MODIFY_HEARDATE = 31;
52
-    /**待仲裁员审核裁决书*/
52
+    /**仲裁员,待仲裁员审核裁决书*/
53 53
     public static final int HEAD_CHECK_ARBITRATION = 18;
54 54
 
55 55
 

+ 6
- 0
ruoyi-system/src/main/java/com/ruoyi/system/service/ISysUserService.java Bestand weergeven

@@ -20,6 +20,12 @@ public interface ISysUserService
20 20
      * @return 用户信息集合信息
21 21
      */
22 22
     public List<SysUser> selectUserList(SysUser user);
23
+
24
+    /**
25
+     * 查询仲裁员
26
+     * @param arbitrator
27
+     * @return
28
+     */
23 29
     public List<SysUser> selectUserListByAdRole(Arbitrator arbitrator);
24 30
 
25 31
     /**

+ 36
- 7
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserServiceImpl.java Bestand weergeven

@@ -6,11 +6,14 @@ import java.util.List;
6 6
 import java.util.stream.Collectors;
7 7
 import javax.validation.Validator;
8 8
 
9
+import cn.hutool.core.collection.CollectionUtil;
9 10
 import cn.hutool.core.util.StrUtil;
10 11
 import com.ruoyi.common.core.domain.AjaxResult;
11 12
 import com.ruoyi.common.core.domain.entity.SysDept;
12 13
 import com.ruoyi.system.mapper.*;
13 14
 import com.ruoyi.wisdomarbitrate.domain.Arbitrator;
15
+import com.ruoyi.wisdomarbitrate.domain.CaseAffiliate;
16
+import com.ruoyi.wisdomarbitrate.mapper.CaseAffiliateMapper;
14 17
 import com.ruoyi.wisdomarbitrate.mapper.CaseApplicationMapper;
15 18
 import org.slf4j.Logger;
16 19
 import org.slf4j.LoggerFactory;
@@ -65,6 +68,8 @@ public class SysUserServiceImpl implements ISysUserService {
65 68
 
66 69
     @Autowired
67 70
     private CaseApplicationMapper caseApplicationMapper;
71
+    @Autowired
72
+    private CaseAffiliateMapper caseAffiliateMapper;
68 73
 
69 74
     @Autowired
70 75
     protected Validator validator;
@@ -81,21 +86,45 @@ public class SysUserServiceImpl implements ISysUserService {
81 86
         return userMapper.selectUserList(user);
82 87
     }
83 88
 
89
+    /**
90
+     * 查询仲裁员
91
+     * @param arbitrator
92
+     * @return
93
+     */
84 94
     @Override
85 95
     public List<SysUser> selectUserListByAdRole(Arbitrator arbitrator) {
96
+        // 根据案件id查询案件
97
+        CaseAffiliate caseAffiliate = new CaseAffiliate();
98
+        caseAffiliate.setCaseAppliId(arbitrator.getCaseId());
99
+        List<CaseAffiliate> caseAffiliates = caseAffiliateMapper.selectCaseAffiliate(caseAffiliate);
100
+        List<String> phoneList=new ArrayList<>();
101
+        if(CollectionUtil.isNotEmpty(caseAffiliates)){
102
+            for (CaseAffiliate affiliate : caseAffiliates) {
103
+                if(StrUtil.isNotEmpty(affiliate.getContactTelphone())) {
104
+                    phoneList.add(affiliate.getContactTelphone());
105
+                }
106
+                if(StrUtil.isNotEmpty(affiliate.getContactTelphoneAgent())) {
107
+                    phoneList.add(affiliate.getContactTelphoneAgent());
108
+                }
109
+            }
110
+        }
86 111
         List<SysUser> sysUsers = userMapper.selectUserListByAdRole(arbitrator);
87
-        if(sysUsers!=null&&sysUsers.size()>0){
112
+        List<SysUser> arbitrators = new ArrayList<>();
113
+        if(CollectionUtil.isNotEmpty(sysUsers)){
88 114
             for(SysUser sysUser: sysUsers){
89
-                Long userId = sysUser.getUserId();
90
-                int casenum = caseApplicationMapper.selectCasenum(userId.toString());
91
-                String nickName = sysUser.getNickName();
92
-                String nickNamenew = nickName + "(待办案件数量" + casenum + "个)";
93
-                sysUser.setNickNameAndNum(nickNamenew);
115
+                if(!phoneList.contains(sysUser.getPhonenumber())) {
116
+                    Long userId = sysUser.getUserId();
117
+                    int todoCount = caseApplicationMapper.selectCasenum(userId.toString());
118
+                    String nickName = sysUser.getNickName();
119
+                    String nickNamenew = nickName + "(待办案件数量" + todoCount + "个)";
120
+                    sysUser.setNickNameAndNum(nickNamenew);
121
+                    arbitrators.add(sysUser);
122
+                }
94 123
             }
95 124
 
96 125
         }
97 126
 
98
-        return sysUsers;
127
+        return arbitrators;
99 128
     }
100 129
 
101 130
     /**

+ 12
- 0
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/Arbitrator.java Bestand weergeven

@@ -9,6 +9,10 @@ public class Arbitrator    extends BaseEntity {
9 9
 
10 10
     /** ID */
11 11
     private Long id;
12
+    /**
13
+     * 案件id
14
+     */
15
+    private Long caseId;
12 16
     /** 仲裁员姓名 */
13 17
     private String arbitratorName;
14 18
     /** 职称 */
@@ -47,6 +51,14 @@ public class Arbitrator    extends BaseEntity {
47 51
     /** 已结案数量 */
48 52
     private int closedCaseNum;
49 53
 
54
+    public Long getCaseId() {
55
+        return caseId;
56
+    }
57
+
58
+    public void setCaseId(Long caseId) {
59
+        this.caseId = caseId;
60
+    }
61
+
50 62
     public Long getId() {
51 63
         return id;
52 64
     }

+ 8
- 0
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseApplication.java Bestand weergeven

@@ -193,6 +193,10 @@ public class CaseApplication  extends BaseEntity {
193 193
      * 登录用户用户名
194 194
      */
195 195
     private String loginUserName;
196
+    /**
197
+     * 登录人电话
198
+     */
199
+    private String loginUserPhone;
196 200
     private List<Long> deptIds;
197 201
     /**
198 202
      * 部门长状态
@@ -428,4 +432,8 @@ public class CaseApplication  extends BaseEntity {
428 432
     private String userName;
429 433
     // 缴费确认驳回原因
430 434
     private String payRejectReason;
435
+    /**
436
+     * 仲裁员确认裁决书驳回
437
+     */
438
+    private String arbitrateReject;
431 439
 }

+ 12
- 1
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseApplicationMapper.java Bestand weergeven

@@ -67,7 +67,9 @@ public interface CaseApplicationMapper {
67 67
     ToDoCount selectAdminCaseToDoCount();
68 68
 
69 69
 
70
-    ToDoCount selectTodoCountByRole(CaseApplication caseApplication);
70
+    ToDoCount selectTodoCountByRole(@Param("caseApplication") CaseApplication caseApplication,
71
+                                    @Param("caseStatusList") List<Integer> caseStatusList,
72
+                                    @Param("roleNames") List<String> roleNames);
71 73
 
72 74
     /**
73 75
      * 修改案件锁定状态
@@ -138,4 +140,13 @@ public interface CaseApplicationMapper {
138 140
     List<CaseApplication> listCaseApplicationByBatchNumber(CaseApplication caseApplication);
139 141
 
140 142
     List<CaseApplication> selectAdminCaseApplicationListBatch1(CaseApplication caseApplication);
143
+
144
+    /**
145
+     * 案件列表查询
146
+     * @param caseApplication
147
+     * @return
148
+     */
149
+    List<CaseApplication> list(@Param("caseApplication") CaseApplication caseApplication,
150
+                               @Param("caseStatusList") List<Integer> caseStatusList,
151
+                               @Param("roleNames") List<String> roleNames);
141 152
 }

+ 16
- 0
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/IAdjudicationService.java Bestand weergeven

@@ -67,4 +67,20 @@ public interface IAdjudicationService {
67 67
     AjaxResult caseFileBatch(Integer batchNumber);
68 68
 
69 69
     AjaxResult serviceBatch(Integer batchNumber) throws EsignDemoException, IOException;
70
+
71
+    /**
72
+     * 开庭审理,确定审理结果,生成裁决书
73
+     * @param caseApplication
74
+     * @return
75
+     */
76
+    AjaxResult caseJudgment(CaseApplication caseApplication);
77
+
78
+    /**
79
+     * 案件状态改变
80
+     * @param id 案件id
81
+     * @param caseStatus 案件状态
82
+     * @return
83
+     */
84
+
85
+    AjaxResult changeCaseStatus(Long id, Integer caseStatus);
70 86
 }

+ 2
- 0
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/ICaseApplicationService.java Bestand weergeven

@@ -139,6 +139,8 @@ public interface ICaseApplicationService {
139 139
     CaseAttach downloadCaseZipFile(CaseApplication caseApplication);
140 140
 
141 141
     List<CaseApplication> selectCaseApplicationListBatchByRole(CaseApplication caseApplication);
142
+    public List<CaseApplication> page(CaseApplication caseApplication) ;
143
+
142 144
 
143 145
     int submitCaseApplicationBatch(String batchNumber);
144 146
 

+ 153
- 6
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/AdjudicationServiceImpl.java Bestand weergeven

@@ -132,13 +132,18 @@ public class AdjudicationServiceImpl implements IAdjudicationService {
132 132
     // 日期格式化年月日
133 133
     SimpleDateFormat sdf = new SimpleDateFormat("yyyy年MM月dd日");
134 134
 
135
+    /**
136
+     * 生成裁决书
137
+     * @param caseApplicationReq
138
+     * @return
139
+     */
135 140
     @Override
136 141
     @Transactional
137 142
     public AjaxResult createDocument(CaseApplication caseApplicationReq) {
143
+        // todo 生成裁决书单独出接口,即确定审理结果接口,提交按钮只改变案件状态和生成签名链接
138 144
         String templatePath = "";
139 145
         String templateName = "";
140
-        String agentName = "";
141
-        String resName = "";
146
+
142 147
         try {
143 148
             Map<String, Object> datas = new HashMap<>();
144 149
             Long id = caseApplicationReq.getId();
@@ -214,7 +219,7 @@ public class AdjudicationServiceImpl implements IAdjudicationService {
214 219
             // 遍历书签,给书签赋值
215 220
             replaceBookmark(bookmarkList, datas, valueMap);
216 221
             // 根据条件替换书签
217
-            conditionReplaceBookmark(caseApplicationById, datas, agentName, resName, arbitrateRecordSelect);
222
+            conditionReplaceBookmark(caseApplicationById, datas, "", "", arbitrateRecordSelect);
218 223
             // 裁决书生成时间
219 224
             LocalDate now = LocalDate.now();
220 225
             String year = Integer.toString(now.getYear());
@@ -250,7 +255,7 @@ public class AdjudicationServiceImpl implements IAdjudicationService {
250 255
 
251 256
             String savePath = docFilePath.substring(0, docFilePath.indexOf("/upload/") + 8);
252 257
             // 保存裁决书附件
253
-            saveArbitorFile(id, saveName, savePath, caseApplicationById, arbitrateRecordSelect);
258
+            saveArbitorFile(id, saveName, savePath, caseApplicationById, arbitrateRecordSelect,CaseApplicationConstants.VERPRIF_ARBITRATION);
254 259
 
255 260
             return AjaxResult.success("裁决书已生成");
256 261
         } catch (IOException e) {
@@ -565,8 +570,9 @@ public class AdjudicationServiceImpl implements IAdjudicationService {
565 570
      * @param savePath              保存路径
566 571
      * @param caseApplicationById   案件基本信息
567 572
      * @param arbitrateRecordSelect 出裁决书生成记录
573
+     * @param caseStatus 案件状态,不为空则更新案件状态
568 574
      */
569
-    private void saveArbitorFile(Long id, String saveName, String savePath, CaseApplication caseApplicationById, ArbitrateRecord arbitrateRecordSelect) {
575
+    private void saveArbitorFile(Long id, String saveName, String savePath, CaseApplication caseApplicationById, ArbitrateRecord arbitrateRecordSelect,Integer caseStatus) {
570 576
         CaseAttach caseAttach = CaseAttach.builder().caseAppliId(id).annexName(saveName).annexPath(savePath).annexType(3).build();
571 577
         //保存到附件表里,先判断之前有没有,有的话更新,没有的话新增
572 578
         List<CaseAttach> caseAttachList = caseAttachMapper.getCaseAttachByCaseIdAndType(caseAttach);
@@ -586,7 +592,9 @@ public class AdjudicationServiceImpl implements IAdjudicationService {
586 592
             }
587 593
         }
588 594
         //修改案件状态
589
-        caseApplicationById.setCaseStatus(CaseApplicationConstants.VERPRIF_ARBITRATION);
595
+        if(caseStatus!=null) {
596
+            caseApplicationById.setCaseStatus(caseStatus);
597
+        }
590 598
         Integer arbitratMethod = caseApplicationById.getArbitratMethod();
591 599
         if (arbitratMethod == 1) {
592 600
             caseApplicationById.setLockStatus(1);
@@ -1769,6 +1777,145 @@ public class AdjudicationServiceImpl implements IAdjudicationService {
1769 1777
             throw new ServiceException("这个批号没有批量送达裁决书的案件");
1770 1778
         }
1771 1779
         return AjaxResult.success("裁决书送达成功");
1780
+
1781
+    }
1782
+
1783
+    /**
1784
+     * 开庭审理,确定审理结果,生成裁决书
1785
+     * @param req
1786
+     * @return
1787
+     */
1788
+    @Override
1789
+    public AjaxResult caseJudgment(CaseApplication req) {
1790
+        //获取案件详细信息
1791
+        CaseApplication caseApplicationById = caseApplicationService.selectCaseApplication(req);
1792
+        if (caseApplicationById == null) {
1793
+            return AjaxResult.error("案件不存在");
1794
+        }
1795
+
1796
+        if (caseApplicationById.getTemplateId() == null) {
1797
+            return AjaxResult.error("请先指定裁决书模板");
1798
+        }
1799
+        // 根据模板id查找对应的模板
1800
+        TemplateManage templateManage = new TemplateManage();
1801
+        templateManage.setId(caseApplicationById.getTemplateId());
1802
+        List<TemplateManage> templateManages = templateManageMapper.selectTemplateList(templateManage);
1803
+        if (CollectionUtil.isEmpty(templateManages)) {
1804
+            return AjaxResult.error("请先指定裁决书模板");
1805
+        }
1806
+        String  templatePath = templateManages.get(0).getTemOrigPath();
1807
+        if (StrUtil.isEmpty(templatePath)) {
1808
+            return AjaxResult.error("未找到该模板");
1809
+        }
1810
+        templatePath = "/home/ruoyi/" + templatePath;
1811
+        try {
1812
+            File file = new File(templatePath);
1813
+        } catch (Exception e) {
1814
+            return AjaxResult.error("未找到该模板");
1815
+        }
1816
+        // 查询案件相关表信息
1817
+        CaseAffiliate caseAffiliate = new CaseAffiliate();
1818
+        caseAffiliate.setCaseAppliId(req.getId());
1819
+        List<CaseAffiliate> caseAffiliates = caseAffiliateMapper.selectCaseAffiliate(caseAffiliate);
1820
+        if(CollectionUtil.isEmpty(caseAffiliates)){
1821
+            return AjaxResult.error("未找到案件相关人员");
1822
+        }
1823
+        // 在系统表中查询案件内置字段
1824
+        SysDictData sysDictData = new SysDictData();
1825
+        sysDictData.setDictType("case_built_type");
1826
+        List<SysDictData> dictDataList = dictDataMapper.selectDictDataList(sysDictData);
1827
+        // 根据模板id查询抓取规则,判断从主表取值还是从columnValue值取
1828
+        List<FatchRule> fatchRuleList = fatchRuleMapper.listByTemplateId(caseApplicationById.getTemplateId());
1829
+        // 抓取规则,0-内置字段,1-自定义字段
1830
+        Map<Integer, List<FatchRule>> fatchRuleMap = new HashMap<>();
1831
+        // 裁决书需要的字段和内容,占位符需要配置成中文
1832
+        Map<String, String> valueMap = new HashMap<>();
1833
+        // 如果未设置抓取规则,则从主表取数据,设置内置字段值
1834
+        if (CollectionUtil.isNotEmpty(fatchRuleList)) {
1835
+            fatchRuleMap = fatchRuleList.stream().collect(Collectors.groupingBy(FatchRule::getIsDefault));
1836
+        }
1837
+        // 自定义字段,从columnValue值取
1838
+        if (fatchRuleMap.size() > 0 && fatchRuleMap.containsKey(1)) {
1839
+            // 根据案件id查询key-value表
1840
+            List<ColumnValue> columnValueList = columnValueMapper.listByCaseId(req.getId());
1841
+            if (CollectionUtil.isNotEmpty(columnValueList)) {
1842
+                columnValueList.forEach(columnValue -> valueMap.put(columnValue.getName(), columnValue.getValue()));
1843
+            }
1844
+        }
1845
+        // 组装内置字段,在主表中查出内容
1846
+        buildDefaultColumnValue(dictDataList, caseAffiliates, valueMap, caseApplicationById);
1847
+
1848
+        // 获取模板中的占位符key
1849
+        List<String> bookmarkList = getBookmarkByDocx(templatePath);
1850
+        if (CollectionUtil.isEmpty(bookmarkList)) {
1851
+            return AjaxResult.success("请检查模板是否配置正确,未获取到占位符");
1852
+        }
1853
+        //获取仲裁记录表里的相关信息
1854
+        ArbitrateRecord arbitrateRecord = new ArbitrateRecord();
1855
+        arbitrateRecord.setCaseAppliId(req.getId());
1856
+        ArbitrateRecord arbitrateRecordSelect = arbitrateRecordMapper.selectArbitrateRecord(arbitrateRecord);
1857
+
1858
+        Map<String, Object> datas = new HashMap<>();
1859
+        // 遍历书签,给书签赋值
1860
+        replaceBookmark(bookmarkList, datas, valueMap);
1861
+        // 根据条件替换书签
1862
+        conditionReplaceBookmark(caseApplicationById, datas,"", "", arbitrateRecordSelect);
1863
+        // 裁决书生成时间
1864
+        LocalDate now = LocalDate.now();
1865
+        String year = Integer.toString(now.getYear());
1866
+        datas.put("裁决书生成时间", year);
1867
+        //生成编码
1868
+        String equipmentNo = getNewEquipmentNo();
1869
+        // 裁决书编号
1870
+        datas.put("裁决书编号", equipmentNo);
1871
+        // 仲裁费
1872
+        datas.put("仲裁费", caseApplicationById.getFeePayable() != null ? caseApplicationById.getFeePayable().toString() : "");
1873
+        // 案件创建时间
1874
+        Date createTime = caseApplicationById.getCreateTime();
1875
+        // 将日期格式化为字符串
1876
+        String createTimeStr = sdf.format(createTime);
1877
+        datas.put("案件创建时间", createTimeStr);
1878
+        // 立案日期
1879
+        Date registerDate = caseApplicationById.getRegisterDate();
1880
+        String registerDateStr = sdf.format(registerDate);
1881
+        datas.put("立案日期", registerDateStr);
1882
+
1883
+
1884
+        String month = String.format("%02d", now.getMonthValue());
1885
+        String day = String.format("%02d", now.getDayOfMonth());
1886
+        // todo
1887
+        String saveFolderPath = "/home/ruoyi/uploadPath/upload/" + year + "/" + month + "/" + day;
1888
+//            String saveFolderPath = "D:/home/ruoyi/uploadPath/upload/" + year + "/" + month + "/" + day;
1889
+        String fileName = UUID.randomUUID().toString().replace("-", "") + ".docx";
1890
+        // todo
1891
+        String saveName = "/profile/upload/" + year + "/" + month + "/" + day + "/" + fileName;
1892
+//            String saveName = "D:/home/ruoyi/uploadPath/upload/" + year + "/" + month + "/" + day + "/" + fileName;
1893
+        // 将word中的标签替换掉,生成新的word
1894
+        String docFilePath = null;
1895
+        try {
1896
+            docFilePath = wordChangeText(templatePath, datas, saveFolderPath, fileName);
1897
+        } catch (IOException e) {
1898
+            throw new ServiceException("生成裁决书失败");
1899
+        }
1900
+
1901
+        String savePath = docFilePath.substring(0, docFilePath.indexOf("/upload/") + 8);
1902
+        // 保存裁决书附件
1903
+        saveArbitorFile(req.getId(), saveName, savePath, caseApplicationById, arbitrateRecordSelect,null);
1904
+
1905
+        return AjaxResult.success("裁决书已生成");
1906
+    }
1907
+
1908
+    @Transactional
1909
+    @Override
1910
+    public AjaxResult changeCaseStatus(Long id, Integer caseStatus) {
1911
+        if (id == null || caseStatus == null) {
1912
+            return AjaxResult.error("参数校验失败");
1913
+        }
1914
+        CaseApplication caseApplication = new CaseApplication();
1915
+        caseApplication.setId(id);
1916
+        caseApplication.setCaseStatus(caseStatus);
1917
+        caseApplicationMapper.submitCaseApplication(caseApplication);
1918
+        return AjaxResult.success();
1772 1919
     }
1773 1920
 
1774 1921
     /**

+ 266
- 83
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java Bestand weergeven

@@ -369,81 +369,274 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
369 369
 
370 370
     }
371 371
 
372
-
373
-    @Override
374
-    public ToDoCount selectToDoCount() {
375
-
372
+    /**
373
+     * 分页查询
374
+     * 数据权限:1.每个人不同的角色,而每个角色可以操作不同的案件状态
375
+     * 2.申请人,被申请人:可以看到自己相关的案件(案件有被申请人相关的信息)
376
+     * 3.仲裁员:案件选定了某个仲裁员后,该仲裁员就可以查看该案件
377
+     * 4.超级管理员,法律顾问秘书,仲裁委(部门长):可以查看所有案件
378
+     *
379
+     * @param caseApplication
380
+     * @return
381
+     */
382
+    public List<CaseApplication> page(CaseApplication caseApplication) {
383
+        List<CaseApplication> caseApplications= new ArrayList<>();
384
+        // todo 案件列表查询Bug修复,需要看见已办案件
376 385
         // 获取登录用户
377 386
         LoginUser loginUser = getLoginUser();
378 387
         SysUser user = loginUser.getUser();
379 388
         Long userId = user.getUserId();
380
-
381
-        // 查询登录人信息
389
+        // 查询登录人,根据邮箱查询
382 390
         SysUser sysUser = sysUserMapper.selectUserById(userId);
391
+        if(sysUser==null){
392
+            throw new ServiceException("未获取到登录用户信息");
393
+        }
394
+
395
+
383 396
         List<SysRole> roles = sysUser.getRoles();
384 397
         // 没有角色不能查看案件列表
385 398
         if (CollectionUtil.isEmpty(roles)) {
386 399
             throw new ServiceException("该用户没有角色权限");
387 400
         }
388
-        CaseApplication caseApplication = new CaseApplication();
389 401
         List<Integer> caseStatusList = new ArrayList<>();
402
+        List<String> roleNames = roles.stream().map(SysRole::getRoleName).collect(Collectors.toList());
403
+        startPage();
390 404
         for (SysRole role : roles) {
391
-            if (StrUtil.isEmpty(role.getRoleName())) {
405
+            if(StrUtil.isEmpty(role.getRoleName())){
392 406
                 continue;
393 407
             }
394
-            // 超级管理员和仲裁委(部门长)案件,可查看所有案件 √
395
-            if (role.getRoleName().equals("超级管理员")
396
-            ) {
397
-                return caseApplicationMapper.selectAdminCaseToDoCount();
408
+            // 查看所有权限
409
+            if("超级管理员".equals(role.getRoleName())){
410
+                caseApplications   =    caseApplicationMapper.list(caseApplication,caseStatusList,null);
411
+                setArbitorMethod(caseApplications);
412
+                return caseApplications;
413
+            }
414
+            caseApplication.setLoginUserName(sysUser.getUserName());
415
+            caseApplication.setLoginUserPhone(sysUser.getPhonenumber());
416
+            if("申请人".equals(role.getRoleName())){
417
+                // 申请人在生成裁决书之前都可以修改案件
418
+                Integer[] array = {0,-1,1,2,3,4,5,6,7,8,9,10,31};
419
+                caseStatusList.addAll(Arrays.asList(array));
420
+            }
421
+            if("被申请人".equals(role.getRoleName())) {
422
+                // 案件质证,开庭审理,书面审理
423
+                caseStatusList.add(4);
424
+                caseStatusList.add(8);
425
+                caseStatusList.add(9);
426
+            }
427
+            if("仲裁员".equals(role.getRoleName())){
428
+                Integer[] array = {7,8,9,13,18};
429
+                caseStatusList.addAll(Arrays.asList(array));
430
+                caseApplication.setArbitratorId(String.valueOf(sysUser.getUserId()));
398 431
             }
399 432
             if ("仲裁委".equals(role.getRoleName())
400 433
                     || "部门长".equals(role.getRoleName())) {
401
-                caseApplication.setIsOtherRole(1);
434
+                // 组庭确定,部门长审核裁决书
402 435
                 caseStatusList.add(CaseApplicationConstants.CONFIRMDED_PENDING_TRIAL);
403 436
                 caseStatusList.add(CaseApplicationConstants.CHECK_ARBITRATION);
404
-             //   caseStatusList.add(CaseApplicationConstants.ARBITRATED_SEAL);
405
-                caseApplication.setDeptHeadStatus(caseStatusList);
406
-            }
407
-            if ("仲裁员".equals(role.getRoleName())) {
408
-                caseApplication.setIsOtherRole(1);
409
-                caseApplication.setUserId(String.valueOf(userId));
410 437
             }
411 438
             if ("财务".equals(role.getRoleName())) {
412
-                caseApplication.setIsOtherRole(1);
413
-                caseApplication.setFinanceStatus(CaseApplicationConstants.PENDING_PAYMENT_CONFIRM);
439
+                caseStatusList.add(CaseApplicationConstants.PENDING_PAYMENT_CONFIRM);
414 440
             }
415
-            if ("法律顾问".equals(role.getRoleName())) {
416
-                // 查询角色有关的用户部门
417
-                // List<Long> deptIds = sysDeptMapper.selectUserDeptListByRoleId(role.getRoleId());
418
-                List<Long> deptIds = new ArrayList<>();
419
-                deptIds.add(sysUser.getDeptId());
420
-                caseApplication.setDeptIds(deptIds);
421
-            }
422
-            if ("申请人".equals(role.getRoleName())) {
423
-                  caseApplication.setIsOtherRole(1);
424
-                // 查询角色有关的用户部门
425
-                caseApplication.setApplicationOrganId(String.valueOf(sysUser.getDeptId()));
441
+            if ("法律顾问".equals(role.getRoleName())  || "秘书".equals(role.getRoleName()) ) {
442
+                Integer[] array = {1,5,8,9,11,14,15,16,31};
443
+                caseStatusList.addAll(Arrays.asList(array));
426 444
             }
427
-            if ("被申请人".equals(role.getRoleName())) {
428
-                caseApplication.setIsOtherRole(1);
429
-                //
430
-                caseApplication.setIdCard(String.valueOf(sysUser.getIdCard()));
431
-            }
432
-            if ("代理人".equals(role.getRoleName())) {
433
-                caseApplication.setIsOtherRole(1);
434
-                // 查询角色有关的用户部门
435
-                // List<Long> agentDeptIds = sysDeptMapper.selectUserDeptListByRoleId(role.getRoleId());
436
-                List<Long> agentDeptIds = new ArrayList<>();
437
-                agentDeptIds.add(sysUser.getDeptId());
438
-                caseApplication.setAgentDeptIds(agentDeptIds);
445
+        }
446
+        caseApplications   =    caseApplicationMapper.list(caseApplication,caseStatusList, roleNames);
447
+        setArbitorMethod(caseApplications);
448
+        return caseApplications;
449
+
450
+    }
451
+
452
+    /**
453
+     * 设置仲裁方式
454
+     * @param caseApplications
455
+     */
456
+    private void setArbitorMethod(List<CaseApplication> caseApplications) {
457
+
458
+        if(CollectionUtil.isEmpty(caseApplications)){
459
+            return;
460
+        }
461
+            for(CaseApplication caseApplicationsel : caseApplications){
462
+                Integer caseStatus = caseApplicationsel.getCaseStatus();
463
+                if(caseStatus.intValue() == CaseApplicationConstants.CHECK_ARBITRATION_METHOD){
464
+                    Integer applicantIsWrittenHear = caseApplicationsel.getApplicantIsWrittenHear();
465
+                    Integer respondentIsWrittenHear = caseApplicationsel.getRespondentIsWrittenHear();
466
+                    if(applicantIsWrittenHear!=null&&respondentIsWrittenHear!=null){
467
+                        if(applicantIsWrittenHear.intValue()==respondentIsWrittenHear.intValue()){
468
+                            caseApplicationsel.setArbitraMethodIssame(1);
469
+                            if(applicantIsWrittenHear.intValue()==1&&respondentIsWrittenHear.intValue()==1){
470
+                                caseApplicationsel.setArbitratMethod(2);
471
+                            }else {
472
+                                caseApplicationsel.setArbitratMethod(1);
473
+                            }
474
+                        }else {
475
+                            caseApplicationsel.setArbitraMethodIssame(2);
476
+                            String applicantarbitratMethod = "";
477
+                            String respondentbitratMethod = "";
478
+                            if(applicantIsWrittenHear.intValue()==1){
479
+                                applicantarbitratMethod = "书面审理";
480
+                            }else {
481
+                                applicantarbitratMethod = "开庭审理";
482
+                            }
483
+                            if(respondentIsWrittenHear.intValue()==1){
484
+                                respondentbitratMethod = "书面审理";
485
+                            }else {
486
+                                respondentbitratMethod = "开庭审理";
487
+                            }
488
+                            String arbitratMethodIllustrate = "当前案件开庭方式:申请人选择开庭方式为"+applicantarbitratMethod+
489
+                                    "被申请人选择开庭方式为"+respondentbitratMethod+",请确定开庭方式。";
490
+                            caseApplicationsel.setArbitratMethodIllustrate(arbitratMethodIllustrate);
491
+                        }
492
+                    }
493
+
494
+                }
439 495
             }
496
+    }
497
+
498
+    @Override
499
+    public ToDoCount selectToDoCount() {
500
+
501
+//        // 获取登录用户
502
+//        LoginUser loginUser = getLoginUser();
503
+//        SysUser user = loginUser.getUser();
504
+//        Long userId = user.getUserId();
505
+//
506
+//        // 查询登录人信息
507
+//        SysUser sysUser = sysUserMapper.selectUserById(userId);
508
+//        List<SysRole> roles = sysUser.getRoles();
509
+//        // 没有角色不能查看案件列表
510
+//        if (CollectionUtil.isEmpty(roles)) {
511
+//            throw new ServiceException("该用户没有角色权限");
512
+//        }
513
+//        CaseApplication caseApplication = new CaseApplication();
514
+//        List<Integer> caseStatusList = new ArrayList<>();
515
+//        for (SysRole role : roles) {
516
+//            if (StrUtil.isEmpty(role.getRoleName())) {
517
+//                continue;
518
+//            }
519
+//            // 超级管理员和仲裁委(部门长)案件,可查看所有案件 √
520
+//            if (role.getRoleName().equals("超级管理员")
521
+//            ) {
522
+//                return caseApplicationMapper.selectAdminCaseToDoCount();
523
+//            }
524
+//            if ("仲裁委".equals(role.getRoleName())
525
+//                    || "部门长".equals(role.getRoleName())) {
526
+//                caseApplication.setIsOtherRole(1);
527
+//                caseStatusList.add(CaseApplicationConstants.CONFIRMDED_PENDING_TRIAL);
528
+//                caseStatusList.add(CaseApplicationConstants.CHECK_ARBITRATION);
529
+//             //   caseStatusList.add(CaseApplicationConstants.ARBITRATED_SEAL);
530
+//                caseApplication.setDeptHeadStatus(caseStatusList);
531
+//            }
532
+//            if ("仲裁员".equals(role.getRoleName())) {
533
+//                caseApplication.setIsOtherRole(1);
534
+//                caseApplication.setUserId(String.valueOf(userId));
535
+//            }
536
+//            if ("财务".equals(role.getRoleName())) {
537
+//                caseApplication.setIsOtherRole(1);
538
+//                caseApplication.setFinanceStatus(CaseApplicationConstants.PENDING_PAYMENT_CONFIRM);
539
+//            }
540
+//            if ("法律顾问".equals(role.getRoleName())) {
541
+//                // 查询角色有关的用户部门
542
+//                // List<Long> deptIds = sysDeptMapper.selectUserDeptListByRoleId(role.getRoleId());
543
+//                List<Long> deptIds = new ArrayList<>();
544
+//                deptIds.add(sysUser.getDeptId());
545
+//                caseApplication.setDeptIds(deptIds);
546
+//            }
547
+//            if ("申请人".equals(role.getRoleName())) {
548
+//                  caseApplication.setIsOtherRole(1);
549
+//                // 查询角色有关的用户部门
550
+//                caseApplication.setApplicationOrganId(String.valueOf(sysUser.getDeptId()));
551
+//            }
552
+//            if ("被申请人".equals(role.getRoleName())) {
553
+//                caseApplication.setIsOtherRole(1);
554
+//                //
555
+//                caseApplication.setIdCard(String.valueOf(sysUser.getIdCard()));
556
+//            }
557
+//            if ("代理人".equals(role.getRoleName())) {
558
+//                caseApplication.setIsOtherRole(1);
559
+//                // 查询角色有关的用户部门
560
+//                // List<Long> agentDeptIds = sysDeptMapper.selectUserDeptListByRoleId(role.getRoleId());
561
+//                List<Long> agentDeptIds = new ArrayList<>();
562
+//                agentDeptIds.add(sysUser.getDeptId());
563
+//                caseApplication.setAgentDeptIds(agentDeptIds);
564
+//            }
565
+//        }
566
+//
567
+//
568
+//        // 根据条件查询申请人,被申请人,仲裁员,法律顾问案件
569
+//        ToDoCount toDoCount = caseApplicationMapper.selectTodoCountByRole(caseApplication);
570
+//        if (toDoCount == null) {
571
+//            return new ToDoCount();
572
+//        }
573
+        LoginUser loginUser = getLoginUser();
574
+        SysUser user = loginUser.getUser();
575
+        Long userId = user.getUserId();
576
+        // 查询登录人,根据邮箱查询
577
+        SysUser sysUser = sysUserMapper.selectUserById(userId);
578
+        if(sysUser==null){
579
+            throw new ServiceException("未获取到登录用户信息");
440 580
         }
441 581
 
442 582
 
443
-        // 根据条件查询申请人,被申请人,仲裁员,法律顾问案件
444
-        ToDoCount toDoCount = caseApplicationMapper.selectTodoCountByRole(caseApplication);
445
-        if (toDoCount == null) {
446
-            return new ToDoCount();
583
+        List<SysRole> roles = sysUser.getRoles();
584
+        // 没有角色不能查看案件列表
585
+        if (CollectionUtil.isEmpty(roles)) {
586
+            throw new ServiceException("该用户没有角色权限");
587
+        }
588
+        List<Integer> caseStatusList = new ArrayList<>();
589
+        List<String> roleNames = roles.stream().map(SysRole::getRoleName).collect(Collectors.toList());
590
+        ToDoCount toDoCount=null;
591
+        CaseApplication caseApplication = new CaseApplication();
592
+        for (SysRole role : roles) {
593
+            if(StrUtil.isEmpty(role.getRoleName())){
594
+                continue;
595
+            }
596
+            // 查看所有权限
597
+            if("超级管理员".equals(role.getRoleName())){
598
+                toDoCount   =    caseApplicationMapper.selectTodoCountByRole(caseApplication,caseStatusList,null);
599
+                if(toDoCount==null){
600
+                    toDoCount=new ToDoCount();
601
+                }
602
+                return toDoCount;
603
+            }
604
+            caseApplication.setLoginUserName(sysUser.getUserName());
605
+            caseApplication.setLoginUserPhone(sysUser.getPhonenumber());
606
+
607
+            if("申请人".equals(role.getRoleName())){
608
+                // 申请人在生成裁决书之前都可以修改案件
609
+                Integer[] array = {0,-1,1,2,3,4,5,6,7,8,9,10,31};
610
+                caseStatusList.addAll(Arrays.asList(array));
611
+            }
612
+            if("被申请人".equals(role.getRoleName())) {
613
+                // 案件质证,开庭审理,书面审理
614
+                caseStatusList.add(4);
615
+                caseStatusList.add(8);
616
+                caseStatusList.add(9);
617
+            }
618
+            if("仲裁员".equals(role.getRoleName())){
619
+                Integer[] array = {7,8,9,13,18};
620
+                caseStatusList.addAll(Arrays.asList(array));
621
+                caseApplication.setArbitratorId(String.valueOf(sysUser.getUserId()));
622
+            }
623
+            if ("仲裁委".equals(role.getRoleName())
624
+                    || "部门长".equals(role.getRoleName())) {
625
+                // 组庭确定,部门长审核裁决书
626
+                caseStatusList.add(CaseApplicationConstants.CONFIRMDED_PENDING_TRIAL);
627
+                caseStatusList.add(CaseApplicationConstants.CHECK_ARBITRATION);
628
+            }
629
+            if ("财务".equals(role.getRoleName())) {
630
+                caseStatusList.add(CaseApplicationConstants.PENDING_PAYMENT_CONFIRM);
631
+            }
632
+            if ("法律顾问".equals(role.getRoleName())  || "秘书".equals(role.getRoleName()) ) {
633
+                Integer[] array = {1,5,8,9,11,14,15,16,31};
634
+                caseStatusList.addAll(Arrays.asList(array));
635
+            }
636
+        }
637
+        toDoCount   =    caseApplicationMapper.selectTodoCountByRole(caseApplication,caseStatusList,roleNames);
638
+        if(toDoCount==null){
639
+            toDoCount=new ToDoCount();
447 640
         }
448 641
         return toDoCount;
449 642
     }
@@ -456,6 +649,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
456 649
         caseLogRecord.setCaseAppliId(id);
457 650
         List<CaseLogRecord> records = caseLogRecordMapper.selectCaseLogRecordList(caseLogRecord);
458 651
         CaseApplication caseApplicationselect = caseApplicationMapper.selectCaseApplication(caseApplication);
652
+        // 当前案件节点
459 653
         Integer caseStatus = caseApplicationselect.getCaseStatus();
460 654
         if (caseStatus.intValue() != 0) {
461 655
             CaseLogRecord caseLogRecordin = getInCasenode(caseStatus);
@@ -733,7 +927,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
733 927
         CaseLogRecord caseLogRecord9 = new CaseLogRecord();
734 928
         caseLogRecord8.setCaseNode(9);
735 929
         caseLogRecord8.setCaseNodeName("开庭审理");
736
-        caseLogRecord8.setContent("仲裁员将进行开庭审理");
930
+        caseLogRecord8.setContent("仲裁员,申请人,被申请人,法律顾问将进行开庭审理");
737 931
         CaseLogRecord caseLogRecord11 = new CaseLogRecord();
738 932
         caseLogRecord9.setCaseNode(11);
739 933
         caseLogRecord9.setCaseNodeName("书面审理");
@@ -758,7 +952,6 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
758 952
         caseLogRecord15.setCaseNode(16);
759 953
         caseLogRecord15.setCaseNodeName("裁决书送达");
760 954
         caseLogRecord15.setContent("法律顾问将进行裁决书送达");
761
-        CaseLogRecord caseLogRecord17 = new CaseLogRecord();
762 955
         caseLogRecord16.setCaseNode(17);
763 956
         caseLogRecord16.setCaseNodeName("案件归档");
764 957
         caseLogRecord16.setContent("法律顾问将进行案件归档");
@@ -1021,8 +1214,8 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
1021 1214
                 caseLogRecord.setContent("法律顾问正在进行案件归档");
1022 1215
                 break;
1023 1216
             default:
1024
-                caseLogRecord.setCaseNodeName("无案件状态");
1025
-                caseLogRecord.setContent("无操作内容");
1217
+                caseLogRecord.setCaseNodeName("");
1218
+                caseLogRecord.setContent("");
1026 1219
 
1027 1220
         }
1028 1221
         return caseLogRecord;
@@ -1416,11 +1609,12 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
1416 1609
             maxVersion = 1;
1417 1610
         }
1418 1611
         caseApplication.setVersion(maxVersion + 1);
1612
+        LoginUser loginUser = getLoginUser();
1419 1613
         // 异步新增案件日志
1420 1614
         ThreadPoolUtil.execute(() -> {
1421 1615
             try {
1422 1616
                 //新增案件日志记录
1423
-                insertCaseLog(caseApplication.getId(), CaseApplicationConstants.CASE_EDIT, "修改案件信息");
1617
+                insertCaseLog(caseApplication.getId(), CaseApplicationConstants.CASE_EDIT, "修改案件信息",loginUser);
1424 1618
                 caseApplication.setCaseAppliId(caseApplication.getId());
1425 1619
                 caseApplication.setCaseLogId(IdWorkerUtil.getId());
1426 1620
                 int insertRow = caseApplicationLogMapper.insert(caseApplication);
@@ -1723,6 +1917,8 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
1723 1917
             caseApplicationselect.setArbitrateRecord(arbitrateRecordselect);
1724 1918
             if(arbitrateRecordselect!=null){
1725 1919
                 caseApplicationselect.setPayRejectReason(arbitrateRecordselect.getPayRejectReason());
1920
+                // 仲裁员审核驳回原因
1921
+                caseApplicationselect.setArbitrateReject(arbitrateRecordselect.getArbitrateReject());
1726 1922
             }
1727 1923
 
1728 1924
         }
@@ -1877,43 +2073,30 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
1877 2073
     @Override
1878 2074
     @Transactional
1879 2075
     public AjaxResult pendTralCheck(CaseApplication caseApplication) {
1880
-        // todo 需要传仲裁员id
1881 2076
         Integer isAgreePendTral = caseApplication.getIsAgreePendTral();
1882 2077
         caseApplication.setCaseStatus(CaseApplicationConstants.CONFIRMDED_PENDING_TRIAL);
1883 2078
         int rows = 0;
1884
-        //同意组庭
1885
-        if (isAgreePendTral != null && isAgreePendTral == 1) {
2079
+
1886 2080
             CaseApplication caseApplicationselect = caseApplicationMapper.selectCaseApplication(caseApplication);
1887 2081
             if(caseApplicationselect==null){
1888 2082
                 throw new ServiceException("案件不存在");
1889 2083
             }
1890
-            String arbitratorId = caseApplicationselect.getArbitratorId();
1891
-            String arbitratorName = caseApplicationselect.getArbitratorName();
1892
-            List<Arbitrator> arbitrators = caseApplication.getArbitrators();
1893
-            if(arbitrators != null && arbitrators.size() > 0 && StringUtils.isEmpty(arbitratorId)  && StringUtils.isEmpty(arbitratorName)){
1894
-                List<Long> ids = arbitrators.stream().map(Arbitrator::getId).collect(Collectors.toList());
1895
-                List<String> arbitratorNames = arbitrators.stream().map(Arbitrator::getArbitratorName).collect(Collectors.toList());
1896
-                String idstr = ids.stream().map(Object::toString).collect(Collectors.joining(","));
1897
-                String arbitratorNamestr = arbitratorNames.stream().map(Object::toString).collect(Collectors.joining(","));
1898
-                caseApplication.setArbitratorId(idstr);
1899
-                caseApplication.setArbitratorName(arbitratorNamestr);
1900
-                caseApplication.setLockStatus(1);
1901
-                rows = caseApplicationMapper.submitCaseApplication(caseApplication);
1902
-            }
1903
-        } else {
1904
-            List<Arbitrator> arbitrators = caseApplication.getArbitrators();
1905
-            // 仲裁员信息
1906
-            if (arbitrators != null && arbitrators.size() > 0) {
1907
-                List<Long> ids = arbitrators.stream().map(Arbitrator::getId).collect(Collectors.toList());
1908
-                List<String> arbitratorNames = arbitrators.stream().map(Arbitrator::getArbitratorName).collect(Collectors.toList());
1909
-                String idstr = ids.stream().map(Object::toString).collect(Collectors.joining(","));
1910
-                String arbitratorNamestr = arbitratorNames.stream().map(Object::toString).collect(Collectors.joining(","));
1911
-                caseApplication.setArbitratorId(idstr);
1912
-                caseApplication.setArbitratorName(arbitratorNamestr);
1913
-                caseApplication.setLockStatus(1);
1914
-                rows = caseApplicationMapper.submitCaseApplication(caseApplication);
1915
-            }
1916
-        }
2084
+            caseApplication.setLockStatus(1);
2085
+            rows = caseApplicationMapper.submitCaseApplication(caseApplication);
2086
+
2087
+         //   List<Arbitrator> arbitrators = caseApplication.getArbitrators();
2088
+
2089
+//            if( StringUtils.isEmpty(arbitratorId)  && StringUtils.isEmpty(arbitratorName)){
2090
+//                List<Long> ids = arbitrators.stream().map(Arbitrator::getId).collect(Collectors.toList());
2091
+//                List<String> arbitratorNames = arbitrators.stream().map(Arbitrator::getArbitratorName).collect(Collectors.toList());
2092
+//                String idstr = ids.stream().map(Object::toString).collect(Collectors.joining(","));
2093
+//                String arbitratorNamestr = arbitratorNames.stream().map(Object::toString).collect(Collectors.joining(","));
2094
+//                caseApplication.setArbitratorId(idstr);
2095
+//                caseApplication.setArbitratorName(arbitratorNamestr);
2096
+//                caseApplication.setLockStatus(1);
2097
+//                rows = caseApplicationMapper.submitCaseApplication(caseApplication);
2098
+//            }
2099
+
1917 2100
         // 新增日志
1918 2101
         insertCaseLog(caseApplication.getId(), CaseApplicationConstants.CONFIRMDED_PENDING_TRIAL, "");
1919 2102
         return success();

+ 3
- 37
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseZipImportImpl.java Bestand weergeven

@@ -164,21 +164,6 @@ public class CaseZipImportImpl {
164 164
         }
165 165
 
166 166
     File[] files = directory.listFiles();
167
-//    List<CaseApplication> caseApplications = new ArrayList<>();
168
-//    for (File file1 : files) {
169
-//        if (file1.isDirectory() && file1.listFiles() != null) {
170
-//
171
-//            for (File file2 : file1.listFiles()) {
172
-//                CaseApplication caseApplication = buildCaseInfo(file2, templateId, fatchRuleList, fatchRuleMap, userMap, dictDataList, deptMap,  SecurityUtils.getLoginUser());
173
-//                if (caseApplication != null) {
174
-//                    caseApplications.add(caseApplication);
175
-//                }
176
-//            }
177
-//        }
178
-//    }
179
-//    if(caseApplications.size()>0){
180
-//        return success("导入成功");
181
-//    }
182 167
     CaseZipImportTask caseZipImportTask = null;
183 168
     try {
184 169
         caseZipImportTask = new CaseZipImportTask(this, templateId, fatchRuleList,  fatchRuleMap, userMap, dictDataList, files , deptMap, SecurityUtils.getLoginUser());
@@ -318,6 +303,8 @@ public class CaseZipImportImpl {
318 303
                 ThreadPoolUtil.execute(() -> {
319 304
                     try {
320 305
                         caseApplicationMapper.insertCaseApplication(caseApplication);
306
+                        // 新增日志
307
+                        CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.CASE_APPLICATION, "",loginUser);
321 308
                         caseApplicationLogMapper.insert(caseApplication);
322 309
                         // 多线程执行
323 310
                         if (CollectionUtil.isNotEmpty(addUsers)) {
@@ -347,28 +334,7 @@ public class CaseZipImportImpl {
347 334
                             columnValueMapper.batchSave(columnValueList);
348 335
                             columnValueLogMapper.batchSave(columnValueList);
349 336
                         }
350
-                        // 新增日志
351
-                        CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.CASE_APPLICATION, "",loginUser);
352
-                        // 发送短信
353
-//                        if (CollectionUtil.isNotEmpty(smsRequestList)) {
354
-//                            Map<Long, SmsSendRecord> sendRecordMap = null;
355
-//                            if (CollectionUtil.isNotEmpty(smsSendRecordList)) {
356
-//                                sendRecordMap = smsSendRecordList.stream().collect(Collectors.toMap(SmsSendRecord::getCaseId, Function.identity()));
357
-//                                for (SmsUtils.SendSmsRequest sendSmsRequest : smsRequestList) {
358
-//                                    Boolean aBoolean = SmsUtils.sendSms(request);
359
-//                                    if (sendRecordMap != null && sendRecordMap.containsKey(sendSmsRequest.getCaseId())) {
360
-//                                        if (aBoolean) {
361
-//                                            sendRecordMap.get(sendSmsRequest.getCaseId()).setSendStatus(1);
362
-//                                        } else {
363
-//                                            sendRecordMap.get(sendSmsRequest.getCaseId()).setSendStatus(0);
364
-//                                        }
365
-//                                    }
366
-//                                }
367
-//                                smsRecordMapper.batchSaveSmsSendRecord(smsSendRecordList);
368
-//                            }
369
-//
370
-//
371
-//                        }
337
+
372 338
                     } catch (Exception e) {
373 339
                         e.printStackTrace();
374 340
                         throw new RuntimeException("导入失败,请检查抓取规则是否正确");

+ 4
- 3
ruoyi-system/src/main/resources/mapper/wisdomarbitrate/ArbitrateRecordMapper.xml Bestand weergeven

@@ -19,6 +19,9 @@
19 19
         <result property="respondentOpinion"     column="respondent_opinion"     />
20 20
         <result property="applicantOpinion"     column="applicant_opinion"     />
21 21
         <result property="payRejectReason"     column="pay_reject_reason"     />
22
+        <result property="arbitrateReject"     column="arbitrate_reject"     />
23
+        <result property="deptorReject"     column="deptor_reject"     />
24
+        <result property="caseCheckReject"     column="case_check_reject"     />
22 25
 
23 26
     </resultMap>
24 27
 
@@ -92,9 +95,7 @@
92 95
 
93 96
 
94 97
     <select id="selectArbitrateRecord" parameterType="ArbitrateRecord" resultMap="ArbitrateRecordResult">
95
-        SELECT a.id ,a.case_appli_id ,a.eviden_determi ,a.fact_determi ,a.case_sketch ,a.arbitrate_think ,a.ruling_follows ,
96
-        a.verifica_opinion ,a.check_opinion,a.annex_id,a.case_focus,a.case_facts,a.respondent_opinion,a.applicant_opinion,
97
-        a.case_check_reject ,a.arbitrate_reject,a.deptor_reject,a.pay_reject_reason
98
+        SELECT a.*
98 99
         from arbitrate_record a
99 100
         <where>
100 101
             <if test="caseAppliId != null ">

+ 161
- 129
ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml Bestand weergeven

@@ -570,129 +570,10 @@
570 570
         sum( case when t1.case_status=18 then 1 else 0 end) arbitratorApplyAwardConfirm,
571 571
         sum( case when t1.case_status=31 then 1 else 0 end) updateOnlineHearDate
572 572
         from(
573
-        <trim suffixOverrides="union">
574
-            <!--被申请人,仲裁员,部门长,财务,代理人案件-->
575
-            <if test="isOtherRole!=null and isOtherRole==1">
576
-                select DISTINCT(t.id),t.case_status,t.application_organ_id, t.arbitrator_id,t.identity_num ,
577
-                t.identity_type from(
578
-                select c.id ,
579
-                c.case_status,ca.application_organ_id,
580
-                c.arbitrator_id,ca.identity_num , ca.identity_type
581
-                from case_application c
582
-                JOIN case_affiliate ca ON ca.case_appli_id = c.id
583
-                <where>
584
-                    <if test="caseStatus != null">
585
-                        AND c.case_status = #{caseStatus}
586
-                    </if>
587
-
588
-                    <if test="caseStatusList != null and caseStatusList.size() > 0">
589
-                        and c.case_status in
590
-                        <foreach item="caseStatus" collection="caseStatusList" open="(" separator="," close=")">
591
-                            #{caseStatus}
592
-                        </foreach>
593
-                    </if>
594
-                </where>
595
-                ) t
596
-                <where>
597
-
598
-                    <!--被申请人-->
599
-                    <if test="idCard != null and idCard != ''">
600
-                        or (t.identity_num=#{idCard} AND t.identity_type=2 and (t.case_status=4 or t.case_status=17))
601
-                    </if>
602
-                    <!--仲裁员-->
603
-                    <if test="userId != null and userId != ''">
604
-                        or ( t.identity_type=1 and
605
-                        t.case_status in (7,13,17,18)
606
-                        and
607
-                        instr (t.arbitrator_id,#{userId})>0)
608
-                    </if>
609
-                    <!--申请人-->
610
-                    <if test="applicationOrganId != null and applicationOrganId != ''">
611
-                        or ( t.application_organ_id = #{applicationOrganId} AND t.identity_type=1
612
-                        and t.case_status in (0,2,17))
613
-
614
-                    </if>
615
-                    <!--部门长-->
616
-                    <if test="deptHeadStatus != null and deptHeadStatus.size() > 0">
617
-                        or (t.identity_type=1 and t.case_status in
618
-                        <foreach item="caseStatus" collection="deptHeadStatus" open="(" separator="," close=")">
619
-                            #{caseStatus}
620
-                        </foreach>)
621
-                    </if>
622
-                    <!--财务-->
623
-                    <if test="financeStatus != null and financeStatus != ''">
624
-                        or ( t.identity_type=1 and t.case_status =#{financeStatus})
625
-
626
-                    </if>
627
-                    <!--代理人-->
628
-                    <if test="agentDeptIds != null and agentDeptIds.size()>0">
629
-                        or (
630
-                        t.application_organ_id in
631
-                        <foreach item="deptId" collection="agentDeptIds" open="(" separator="," close=")">#{deptId}
632
-                        </foreach>
633
-                        AND t.identity_type=1
634
-                        and t.case_status in (0,9))
635
-
636
-                    </if>
637
-                </where>
638
-                union
639
-            </if>
640
-
641
-            <!--秘书案件-->
642
-            <if test="deptIds != null and deptIds.size() > 0">
643
-
644
-                select c.id ,
645
-                c.case_status,ca.application_organ_id,
646
-                c.arbitrator_id,ca.identity_num , ca.identity_type
647
-                FROM
648
-                case_application c
649
-                JOIN case_affiliate ca ON ca.case_appli_id = c.id AND ca.identity_type = 1
650
-                JOIN case_application_log l on l.case_appli_id=c.id and l.update_submit_status not in(1, 2) and
651
-                l.version
652
-                = (
653
-                SELECT
654
-                max( version ) version
655
-                FROM
656
-                case_application_log
657
-                WHERE case_appli_id = c.id
658
-                )
659
-                WHERE
660
-                ca.identity_type=1
661
-
662
-                and c.case_status in (1,5,8,9,11,14,15,16,17,31)
663
-                <!--          <if test="deptIds != null and deptIds.size() > 0">
664
-                              and ca.application_organ_id in
665
-                              <foreach item="item" collection="deptIds" open="(" separator="," close=")">
666
-                                  #{item}
667
-                              </foreach>
668
-                          </if> -->
669
-                <if test="caseStatus != null">
670
-                    AND c.case_status = #{caseStatus}
671
-                </if>
672
-
673
-                <if test="nameId != null and nameId != ''">
674
-                    AND ca.application_organ_id=#{nameId} AND ca.identity_type=1
675
-                </if>
676
-                union
677
-                select c.id ,
678
-                c.case_status,ca.application_organ_id,
679
-                c.arbitrator_id,ca.identity_num , ca.identity_type
680
-                FROM
681
-                case_application c
682
-                JOIN case_application_log l ON c.id = l.case_appli_id
683
-                JOIN case_affiliate_log ca ON ca.case_appli_log_id = l.id
684
-                AND ca.identity_type = 1
685
-                WHERE
686
-                l.update_submit_status IN ( 1, 2 ) and ca.identity_type=1
687
-                AND l.version = (
688
-                SELECT
689
-                max( version ) version
690
-                FROM
691
-                case_application_log
692
-                WHERE
693
-                c.id = case_appli_id)
694
-            </if>
695
-        </trim>
573
+        select c.id,c.case_status
574
+        from case_application c
575
+        JOIN case_affiliate ca ON ca.case_appli_id = c.id
576
+        <include refid="SELECT_LIST_QUERY"/>
696 577
 
697 578
         ) t1
698 579
     </select>
@@ -1114,17 +995,13 @@
1114 995
             <if test="caseResult != null  and caseResult != ''">case_result = #{caseResult},</if>
1115 996
             <if test="caseStatus != null">case_status = #{caseStatus},</if>
1116 997
             <if test="properPreser != null">proper_preser = #{properPreser},</if>
1117
-
1118 998
             <if test="applicantIsWrittenHear != null">appli_iswrit_hear = #{applicantIsWrittenHear},</if>
1119 999
             <if test="respondentIsWrittenHear != null">respon_isWrit_hear = #{respondentIsWrittenHear},</if>
1120
-
1121 1000
             <if test="updateBy != null  and updateBy != ''">update_by = #{updateBy},</if>
1122 1001
             <if test="caseNum != null and caseNum != ''">case_num = #{caseNum},</if>
1123 1002
             <if test="version != null ">version = #{version},</if>
1124 1003
             <if test="facts != null and facts != ''">facts = #{facts},</if>
1125
-            <if test="mediationAgreement != null and mediationAgreement != ''">mediation_agreement =
1126
-                #{mediationAgreement},
1127
-            </if>
1004
+            <if test="mediationAgreement != null and mediationAgreement != ''"> mediation_agreement = #{mediationAgreement} </if>
1128 1005
             update_time = sysdate()
1129 1006
         </set>
1130 1007
         where id = #{id}
@@ -1366,7 +1243,7 @@
1366 1243
         SELECT count(1)
1367 1244
         from case_application c
1368 1245
         where c.arbitrator_id = #{userId}
1369
-        and c.case_status in(8,9)
1246
+        and c.case_status!=17
1370 1247
     </select>
1371 1248
 
1372 1249
     <select id="selectCaseIdByRoomId" resultType="java.lang.Long">
@@ -1382,6 +1259,161 @@
1382 1259
         select max(batch_number+0) as maxBatchNumber
1383 1260
         from case_application ;
1384 1261
     </select>
1262
+<sql id="SELECT_LIST_QUERY">
1263
+    <where>
1264
+        <!--                    案件状态查询-->
1265
+        <if test="caseStatusList != null and caseStatusList.size()>0">
1266
+            and  c.case_status in
1267
+            <foreach collection="caseStatusList" item="caseStatus" open="(" separator="," close=")">
1268
+                #{caseStatus}
1269
+            </foreach>
1270
+        </if>
1271
+        <if test="caseStatusList == null or caseStatusList.size()==0">
1272
+            and ca.identity_type=1
1273
+        </if>
1274
+        <if test="roleNames != null and roleNames.size()>0 and roleNames.contains('申请人')
1275
+                    and caseApplication.loginUserPhone != null and caseApplication.loginUserPhone != ''">
1276
+            <!--                       申请人,根据电话查询-->
1277
+            and ca.identity_type=1
1278
+            and ( ca.contact_telphone=#{caseApplication.loginUserPhone}
1279
+            or ca.contact_telphone_agent=#{caseApplication.loginUserPhone}
1280
+            )
1281
+        </if>
1282
+        <if test="roleNames != null and roleNames.size()>0 and roleNames.contains('被申请人')
1283
+                    and caseApplication.loginUserPhone != null and caseApplication.loginUserPhone != ''">
1284
+            <!--                       被申请人查询,根据电话查询-->
1285
+            and ca.identity_type=2
1286
+            and ( ca.contact_telphone=#{caseApplication.loginUserPhone}
1287
+            or ca.contact_telphone_agent=#{caseApplication.loginUserPhone}
1288
+            )
1289
+        </if>
1290
+        <if test="caseApplication.arbitratorId !=null and caseApplication.arbitratorId!=''">
1291
+            <!--    仲裁员查询-->
1292
+            and c.arbitrator_id=#{caseApplication.arbitratorId}
1293
+        </if>
1294
+    </where>
1295
+</sql>
1296
+    <select id="list" resultMap="CaseApplicationResult">
1297
+        select DISTINCT(t1.id),t1.caseLogId,t1.case_num,t1.case_subject_amount,t1.register_date,t1.arbitrat_method,
1298
+        t1.arbitratMethodName,t1.case_status,t1.caseStatusName,t1.hear_date,t1.arbitrat_claims,
1299
+        t1.loan_start_date,t1.loan_end_date,t1.claim_princi_owed,t1.claim_interest_owed,t1.claim_liquid_damag,t1.fee_payable,
1300
+        t1.begin_video_date,t1.online_video_person,t1.contract_number,t1.create_by,t1.create_time,t1.appli_iswrit_hear,t1.respon_isWrit_hear,t1.update_by,t1.update_time,
1301
+        t1.arbitrator_name,t1.name,t1.application_organ_id,t1.applicantName,t1.arbitrator_id,t1.identity_num,t1.identity_type,
1302
+        t1.filearbitra_url,t1.lock_status,t1.version,t1.updateSubmitStatus,t1.batch_number,t1.pendingStatus
1303
+        from(
1385 1304
 
1305
+                select c.id ,'' AS caseLogId,c.case_num ,c.case_subject_amount ,c.register_date ,c.arbitrat_method ,
1306
+                CASE c.arbitrat_method when 1 then '开庭审理' when 2 then '书面审理'
1307
+                ELSE ''
1308
+                END arbitratMethodName,
1309
+                c.case_status ,
1310
+                CASE c.case_status  when 0 then '立案申请' when 1 then '待立案审查' when 2 then '待缴费'
1311
+                when 3 then '待缴费确认' when 4 then '待案件质证' when 5 then '待组庭审核'
1312
+                when 6 then '待组庭确定' when 7 then '待审核仲裁方式' when 8 then '待开庭审理'
1313
+                when 9 then '待书面审理' when 10 then '待生成裁决书' when 11 then '待核验裁决书'
1314
+                when 12 then '待部门长审核裁决书' when 13 then '待裁决书签名' when 14 then '待裁决书用印'
1315
+                when 15 then '待裁决书送达' when 16 then '待案件归档' when 17 then '已归档'
1316
+                when 18 then '待仲裁员审核裁决书'
1317
+                when 31 then '待修改开庭时间'
1318
+                ELSE ''
1319
+                END caseStatusName,
1320
+                c.hear_date ,c.arbitrat_claims ,
1321
+                c.loan_start_date ,c.loan_end_date ,c.claim_princi_owed ,c.claim_interest_owed ,c.claim_liquid_damag
1322
+                ,c.fee_payable ,c.begin_video_date ,c.online_video_person ,c.contract_number ,c.create_by
1323
+                ,c.create_time,c.appli_iswrit_hear,c.respon_isWrit_hear,
1324
+                c.update_by ,c.update_time , c.arbitrator_name,ca.name,ca.application_organ_id,ca.application_organ_name
1325
+                as applicantName,
1326
+                c.arbitrator_id,ca.identity_num ,ca.identity_type,c.filearbitra_url,c.lock_status,c.version,null as
1327
+                updateSubmitStatus,c.batch_number,0 as pendingStatus
1328
+                from case_application c
1329
+                JOIN case_affiliate ca ON ca.case_appli_id = c.id
1330
+                <include refid="SELECT_LIST_QUERY"/>
1331
+                union
1386 1332
 
1333
+            <!-- 已办案件 -->
1334
+                SELECT
1335
+                c.id,
1336
+                '' AS caseLogId,
1337
+                c.case_num,
1338
+                c.case_subject_amount,
1339
+                c.register_date,
1340
+                c.arbitrat_method,
1341
+                CASE
1342
+                c.arbitrat_method
1343
+                WHEN 1 THEN
1344
+                '开庭审理'
1345
+                WHEN 2 THEN
1346
+                '书面审理' ELSE ''
1347
+                END arbitratMethodName,
1348
+                c.case_status,
1349
+                CASE
1350
+                c.case_status
1351
+                when 0 then '立案申请' when 1 then '待立案审查' when 2 then '待缴费'
1352
+                when 3 then '待缴费确认' when 4 then '待案件质证' when 5 then '待组庭审核'
1353
+                when 6 then '待组庭确定' when 7 then '待审核仲裁方式' when 8 then '待开庭审理'
1354
+                when 9 then '待书面审理' when 10 then '待生成裁决书' when 11 then '待核验裁决书'
1355
+                when 12 then '待部门长审核裁决书' when 13 then '待裁决书签名' when 14 then '待裁决书用印'
1356
+                when 15 then '待裁决书送达' when 16 then '待案件归档' when 17 then '已归档'
1357
+                when 18 then '待仲裁员审核裁决书'
1358
+                when 31 then '待修改开庭时间' ELSE ''
1359
+                END caseStatusName,
1360
+                c.hear_date,
1361
+                c.arbitrat_claims,
1362
+                c.loan_start_date,
1363
+                c.loan_end_date,
1364
+                c.claim_princi_owed,
1365
+                c.claim_interest_owed,
1366
+                c.claim_liquid_damag,
1367
+                c.fee_payable,
1368
+                c.begin_video_date,
1369
+                c.online_video_person,
1370
+                c.contract_number,
1371
+                c.create_by,
1372
+                c.create_time,c.appli_iswrit_hear,c.respon_isWrit_hear,
1373
+                c.update_by,
1374
+                c.update_time,
1375
+                c.arbitrator_name,
1376
+                ca.name,
1377
+                ca.application_organ_id ,
1378
+                ca.application_organ_name AS applicantName,
1379
+                c.arbitrator_id,ca.identity_num ,ca.identity_type,
1380
+                c.filearbitra_url,
1381
+                c.lock_status,c.version,
1382
+                null as updateSubmitStatus,
1383
+                c.batch_number,1 as pendingStatus
1384
+                from case_log_record r
1385
+                join case_application c on r.case_appli_id=c.id
1386
+                JOIN case_affiliate ca ON ca.case_appli_id = c.id
1387
+                WHERE
1388
+                r.create_by=#{caseApplication.loginUserName}  AND ca.identity_type=1
1389
+                and c.id not in(
1390
+        select c.id
1391
+        from case_application c
1392
+        JOIN case_affiliate ca ON ca.case_appli_id = c.id
1393
+        <include refid="SELECT_LIST_QUERY"/>
1394
+                )
1395
+
1396
+
1397
+
1398
+        ) t1
1399
+        <where>
1400
+            <if test="caseApplication.caseStatus != null">
1401
+                AND t1.case_status = #{caseApplication.caseStatus}
1402
+            </if>
1403
+            <if test="caseApplication.lockStatus != null">
1404
+                AND t1.lock_status = #{caseApplication.lockStatus}
1405
+            </if>
1406
+            <if test="caseApplication.caseNum != null and caseApplication.caseNum != ''">
1407
+                AND t1.case_num = #{caseApplication.caseNum}
1408
+            </if>
1409
+            <if test="caseApplication.batchNumber != null">
1410
+                AND t1.batch_number = #{caseApplication.batchNumber}
1411
+            </if>
1412
+<!--            <if test="nameId != null and nameId != ''">-->
1413
+<!--                AND t1.application_organ_id=#{nameId} AND t1.identity_type=1-->
1414
+<!--            </if>-->
1415
+        </where>
1416
+
1417
+        order by  t1.pendingStatus asc,t1.create_time desc
1418
+    </select>
1387 1419
 </mapper>

+ 1
- 1
ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseLogRecordMapper.xml Bestand weergeven

@@ -40,7 +40,7 @@
40 40
         when 26 then '证据确认成功'
41 41
         when 31 then '修改开庭时间'
42 42
         when 18 then '仲裁员审核裁决书'
43
-        ELSE '无案件状态'
43
+        ELSE ''
44 44
         END content,
45 45
         CASE cl.case_node when 0 then '申请人' when 1 then '申请人' when 2 then '法律顾问'
46 46
         when 3 then '申请人' when 4 then '财务' when 5 then '被申请人'