Przeglądaj źródła

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

wangqiong123 2 lat temu
rodzic
commit
c9f194f8b8
26 zmienionych plików z 2471 dodań i 167 usunięć
  1. 6
    3
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseApplicationController.java
  2. 93
    0
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseApplicationLogController.java
  3. 37
    0
      ruoyi-common/src/main/java/com/ruoyi/common/enums/UpdateSubmitStatus.java
  4. 33
    0
      ruoyi-common/src/main/java/com/ruoyi/common/enums/YesOrNoEnum.java
  5. 112
    0
      ruoyi-common/src/main/java/com/ruoyi/common/utils/thread/ThreadPoolUtil.java
  6. 8
    0
      ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysUserMapper.java
  7. 24
    0
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseAffiliate.java
  8. 58
    0
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseApplication.java
  9. 255
    0
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/dto/CaseApplicationLogDTO.java
  10. 19
    19
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/vo/ToDoCount.java
  11. 34
    0
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/vo/UpdateSubmitVO.java
  12. 25
    0
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseAffiliateLogMapper.java
  13. 6
    0
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseAffiliateMapper.java
  14. 46
    0
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseApplicationLogMapper.java
  15. 22
    0
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseApplicationMapper.java
  16. 57
    0
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/CaseApplicationLogService.java
  17. 1
    1
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/ICaseApplicationService.java
  18. 155
    0
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationLogServiceImpl.java
  19. 154
    106
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java
  20. 45
    11
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseEvidenceServiceImpl.java
  21. 1
    1
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/VideoServiceImpl.java
  22. 7
    0
      ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml
  23. 125
    0
      ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseAffiliateLogMapper.xml
  24. 28
    1
      ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseAffiliateMapper.xml
  25. 158
    0
      ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationLogMapper.xml
  26. 962
    25
      ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml

+ 6
- 3
ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseApplicationController.java Wyświetl plik

@@ -53,7 +53,6 @@ public class CaseApplicationController extends BaseController {
53 53
         }
54 54
         startPage();
55 55
         List<CaseApplication> list = caseApplicationService.selectCaseApplicationListByRole(caseApplication);
56
-//        List<CaseApplication> list = caseApplicationService.selectCaseApplicationList(caseApplication);
57 56
         return getDataTable(list);
58 57
     }
59 58
 
@@ -91,7 +90,7 @@ public class CaseApplicationController extends BaseController {
91 90
     public AjaxResult editCaseApplication(@Validated @RequestBody CaseApplication caseApplication) {
92 91
 
93 92
         caseApplication.setUpdateBy(getUsername());
94
-        return success(caseApplicationService.editCaseApplication(caseApplication));
93
+        return caseApplicationService.editCaseApplication(caseApplication);
95 94
     }
96 95
 
97 96
     /**
@@ -123,11 +122,14 @@ public class CaseApplicationController extends BaseController {
123 122
     }
124 123
 
125 124
     /**
126
-     * 查询立案信息
125
+     * 查询立案信息 todo 必须传version
127 126
      */
128 127
 //     @PreAuthorize("@ss.hasPermi('caseManagement:list:detail')")
129 128
     @PostMapping("/selectCaseApplication")
130 129
     public AjaxResult selectCaseApplication(@Validated @RequestBody CaseApplication caseApplication) {
130
+        if(caseApplication.getVersion()==null){
131
+            return error("参数校验失败");
132
+        }
131 133
         CaseApplication caseApplicationselect = caseApplicationService.selectCaseApplication(caseApplication);
132 134
         return success(caseApplicationselect);
133 135
     }
@@ -428,4 +430,5 @@ public class CaseApplicationController extends BaseController {
428 430
 
429 431
         return  success(caseApplicationService.reserveConferenceList(caseId));
430 432
     }
433
+
431 434
 }

+ 93
- 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseApplicationLogController.java Wyświetl plik

@@ -0,0 +1,93 @@
1
+package com.ruoyi.web.controller.wisdomarbitrate;
2
+
3
+import com.ruoyi.common.core.domain.AjaxResult;
4
+import com.ruoyi.wisdomarbitrate.domain.CaseApplication;
5
+import com.ruoyi.wisdomarbitrate.domain.vo.UpdateSubmitVO;
6
+import com.ruoyi.wisdomarbitrate.service.CaseApplicationLogService;
7
+import org.springframework.beans.factory.annotation.Autowired;
8
+import org.springframework.web.bind.annotation.*;
9
+import org.springframework.web.bind.annotation.PostMapping;
10
+
11
+import static com.ruoyi.common.core.domain.AjaxResult.success;
12
+
13
+/**
14
+ * @author wangqiong
15
+ * @description 案件日志
16
+ * @date 2023-11-17 13:58
17
+ */
18
+@RestController
19
+@RequestMapping (value = "/caseApplicationLog")
20
+public class CaseApplicationLogController {
21
+
22
+    @Autowired
23
+    private CaseApplicationLogService caseApplicationLogService;
24
+
25
+    /**
26
+     * 新增
27
+     * @author wangqiong
28
+     * @date 2023/11/17
29
+     **/
30
+    @PostMapping("/insert")
31
+    public AjaxResult insert(@RequestBody CaseApplication caseApplicationLog){
32
+        return success(caseApplicationLogService.insert(caseApplicationLog));
33
+    }
34
+
35
+    /**
36
+     * 刪除
37
+     * @author wangqiong
38
+     * @date 2023/11/17
39
+     **/
40
+    @PostMapping("/delete")
41
+    public AjaxResult delete(Long id){
42
+        return success(caseApplicationLogService.delete(id));
43
+    }
44
+    /**
45
+     * 修改的案件提交到秘书
46
+     * @author wangqiong
47
+     * @date 2023/11/17
48
+     **/
49
+    @PostMapping("/submit")
50
+    public AjaxResult submit(@RequestBody UpdateSubmitVO vo){
51
+        if(vo.getCaseId()==null || vo.getVersion()==null){
52
+            return AjaxResult.error("参数校验错误");
53
+        }
54
+        return caseApplicationLogService.submit(vo);
55
+    }
56
+
57
+    /**
58
+     * 修改撤销申请
59
+     * @author wangqiong
60
+     * @date 2023/11/17
61
+     **/
62
+    @PostMapping("/revoke")
63
+    public AjaxResult revoke(@RequestBody UpdateSubmitVO vo){
64
+        if(vo.getCaseId()==null || vo.getVersion()==null){
65
+            return AjaxResult.error("参数校验错误");
66
+        }
67
+        // todo 需确定
68
+        return caseApplicationLogService.revoke(vo);
69
+    }
70
+
71
+    /**
72
+     * 查询 根据主键 id 查询
73
+     * @author wangqiong
74
+     * @date 2023/11/17
75
+     **/
76
+    @GetMapping("/selectByCaseIdAndVersion")
77
+    public AjaxResult selectByCaseIdAndVersion(@RequestParam(value = "caseId") Long caseId,@RequestParam(value = "version")Integer version ){
78
+        return success(caseApplicationLogService.selectByCaseIdAndVersion(caseId,version));
79
+    }
80
+    /**
81
+     * 秘书审核修改的案件
82
+     * @author wangqiong
83
+     * @date 2023/11/17
84
+     **/
85
+    @PostMapping("/updateAudit")
86
+    public AjaxResult updateAudit(@RequestBody UpdateSubmitVO vo){
87
+        if(vo.getCaseId()==null || vo.getVersion()==null || vo.getIsAgree()==null || vo.getUpdateSubmitStatus()==null){
88
+            return AjaxResult.error("参数校验错误");
89
+        }
90
+        return caseApplicationLogService.updateAudit(vo);
91
+    }
92
+  
93
+}

+ 37
- 0
ruoyi-common/src/main/java/com/ruoyi/common/enums/UpdateSubmitStatus.java Wyświetl plik

@@ -0,0 +1,37 @@
1
+package com.ruoyi.common.enums;
2
+
3
+/**
4
+ * @author wangqiong
5
+ * @description 修改案件的提交状态
6
+ * @date 2023-11-17 14:05
7
+ */
8
+public enum UpdateSubmitStatus
9
+{
10
+    UNCOMMITTED(0, "未提交"),
11
+    COMMITTED(1, "已提交"),
12
+    AGREE(2, "同意已修改的案件"),
13
+    REFUSE(3, "拒绝已修改的案件"),
14
+    REVOKE(4, "撤销"),
15
+    AGREE_REVOKE(5, "同意撤销修改"),
16
+    REFUSE_REVOKE(6, "拒绝撤销修改"),
17
+    ;
18
+
19
+    private final Integer code;
20
+    private final String text;
21
+
22
+    UpdateSubmitStatus(Integer code, String text)
23
+    {
24
+        this.code = code;
25
+        this.text = text;
26
+    }
27
+
28
+    public Integer getCode()
29
+    {
30
+        return code;
31
+    }
32
+
33
+    public String getText()
34
+    {
35
+        return text;
36
+    }
37
+}

+ 33
- 0
ruoyi-common/src/main/java/com/ruoyi/common/enums/YesOrNoEnum.java Wyświetl plik

@@ -0,0 +1,33 @@
1
+package com.ruoyi.common.enums;
2
+
3
+/**
4
+ * @author wangqiong
5
+ * @description 是否枚举
6
+ * @date 2023-11-17 14:05
7
+ */
8
+public enum YesOrNoEnum
9
+{
10
+    NO(0, "否"),
11
+    YES(1, "是"),
12
+
13
+    ;
14
+
15
+    private final Integer code;
16
+    private final String text;
17
+
18
+    YesOrNoEnum(Integer code, String text)
19
+    {
20
+        this.code = code;
21
+        this.text = text;
22
+    }
23
+
24
+    public Integer getCode()
25
+    {
26
+        return code;
27
+    }
28
+
29
+    public String getText()
30
+    {
31
+        return text;
32
+    }
33
+}

+ 112
- 0
ruoyi-common/src/main/java/com/ruoyi/common/utils/thread/ThreadPoolUtil.java Wyświetl plik

@@ -0,0 +1,112 @@
1
+package com.ruoyi.common.utils.thread;
2
+
3
+import lombok.extern.slf4j.Slf4j;
4
+
5
+import java.util.ArrayList;
6
+import java.util.List;
7
+import java.util.concurrent.*;
8
+
9
+/**
10
+ * @description 线程池工具类
11
+ * @Author wangqiong
12
+ * @Date 2023/11/7 15:41
13
+ * @Version V1.0
14
+ **/
15
+@Slf4j
16
+public class ThreadPoolUtil {
17
+    /** cpu核心数 */
18
+    private static int corePoolSize = (Runtime.getRuntime().availableProcessors());
19
+    /**创建固定大小线程池*/
20
+    private static ExecutorService executors = new ThreadPoolExecutor(
21
+            corePoolSize,
22
+            corePoolSize,
23
+        0L,
24
+            TimeUnit.MILLISECONDS,
25
+            new LinkedBlockingQueue<>());
26
+
27
+    /**
28
+     * 异步任务
29
+     * @param task
30
+     */
31
+    public static void execute(Runnable task){
32
+        executors.execute(task);
33
+    }
34
+
35
+    /**
36
+     * 可获取返回结果的任务且可设置超时时间
37
+     * @param task
38
+     * @param timeout
39
+     * @param <T>
40
+     * @return
41
+     */
42
+    public static <T> T execute(Callable<T> task, long timeout){
43
+        Future<T> future = executors.submit(task);
44
+        T result = null;
45
+        try {
46
+            result = future.get(timeout, TimeUnit.SECONDS);
47
+        } catch (InterruptedException e) {
48
+            future.cancel(true);
49
+            log.error("ThreadPoolUtil.InterruptedException. e:{}", e);
50
+        } catch (ExecutionException e) {
51
+            future.cancel(true);
52
+            log.error("ThreadPoolUtil.ExecutionException. e:{}", e);
53
+        } catch (TimeoutException e) {
54
+            future.cancel(true);
55
+            log.error("ThreadPoolUtil.TimeoutException. e:{}", e);
56
+        }
57
+        return result;
58
+    }
59
+
60
+    /**
61
+     * 可获取返回结果的任务
62
+     * @param task
63
+     * @return
64
+     */
65
+    public static <T> Future<T> submit(Callable<T> task){
66
+        return executors.submit(task);
67
+    }
68
+
69
+    /**
70
+     * 可获取返回结果的任务
71
+     * @param tasks
72
+     * @param <T>
73
+     * @return
74
+     */
75
+    public static <T> List<T> submit(Callable<T>... tasks){
76
+        List<Future<T>> list=new ArrayList<>();
77
+        List<T> resultList=new ArrayList<>();
78
+        if(tasks==null||tasks.length==0){
79
+            return resultList;
80
+        }
81
+        for(Callable<T> task:tasks){
82
+            list.add(executors.submit(task));
83
+        }
84
+        for(Future<T> future:list){
85
+            try {
86
+                resultList.add(future.get());
87
+            } catch (InterruptedException e) {
88
+                future.cancel(true);
89
+                log.error("ThreadPoolUtil.InterruptedException. e:{}", e);
90
+            } catch (ExecutionException e) {
91
+                future.cancel(true);
92
+                log.error("ThreadPoolUtil.ExecutionException. e:{}", e);
93
+            }
94
+        }
95
+        return resultList;
96
+    }
97
+
98
+    /**
99
+     * 执行完所有返回
100
+     * @param tasks
101
+     */
102
+    public static void submit(Runnable ...tasks){
103
+        if(tasks==null||tasks.length==0){
104
+            return;
105
+        }
106
+        List<CompletableFuture> futureList=new ArrayList<>();
107
+        for (Runnable task : tasks) {
108
+            futureList.add(CompletableFuture.runAsync(task,executors));
109
+        }
110
+        CompletableFuture.allOf(futureList.toArray(new CompletableFuture[futureList.size()])).join();
111
+    }
112
+}

+ 8
- 0
ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysUserMapper.java Wyświetl plik

@@ -148,4 +148,12 @@ public interface SysUserMapper
148 148
      * @return
149 149
      */
150 150
     SysUser selectUserByIdCard(@Param("idCard")String identityNo);
151
+
152
+    /**
153
+     * 根据部门和角色查询用户
154
+     * @param applicationOrganId
155
+     * @param roleName
156
+     * @return
157
+     */
158
+    List<SysUser> selectByDeptIdAndRole(@Param("deptId")String applicationOrganId, @Param("roleName")String roleName);
151 159
 }

+ 24
- 0
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseAffiliate.java Wyświetl plik

@@ -13,6 +13,10 @@ public class CaseAffiliate   extends BaseEntity {
13 13
     private Long id;
14 14
     /** 案件申请id */
15 15
     private Long caseAppliId;
16
+    /**
17
+     * 案件申请日志id
18
+     */
19
+    private Long caseAppliLogId;
16 20
     /** 身份类型 */
17 21
     private int identityType;
18 22
     /** 姓名 */
@@ -48,6 +52,26 @@ public class CaseAffiliate   extends BaseEntity {
48 52
      */
49 53
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
50 54
     private Date responBirth;
55
+    /**
56
+     * 版本号
57
+     */
58
+    private Integer version;
59
+
60
+    public Long getCaseAppliLogId() {
61
+        return caseAppliLogId;
62
+    }
63
+
64
+    public void setCaseAppliLogId(Long caseAppliLogId) {
65
+        this.caseAppliLogId = caseAppliLogId;
66
+    }
67
+
68
+    public Integer getVersion() {
69
+        return version;
70
+    }
71
+
72
+    public void setVersion(Integer version) {
73
+        this.version = version;
74
+    }
51 75
 
52 76
     public String getEmail() {
53 77
         return email;

+ 58
- 0
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseApplication.java Wyświetl plik

@@ -73,6 +73,16 @@ public class CaseApplication  extends BaseEntity {
73 73
 
74 74
     /** 案件状态 */
75 75
     private Integer caseStatus;
76
+    /** 案件申请表ID */
77
+    private Long caseAppliId;
78
+
79
+    public Long getCaseAppliId() {
80
+        return caseAppliId;
81
+    }
82
+
83
+    public void setCaseAppliId(Long caseAppliId) {
84
+        this.caseAppliId = caseAppliId;
85
+    }
76 86
 
77 87
     public Integer getCaseStatus() {
78 88
         return caseStatus;
@@ -402,6 +412,30 @@ public class CaseApplication  extends BaseEntity {
402 412
      * 财务状态
403 413
      */
404 414
     private Integer financeStatus;
415
+    /**
416
+     * 是否是被申请人,仲裁员,部门长,财务,代理人,0-否,1-是
417
+     */
418
+    private Integer isOtherRole;
419
+    /**
420
+     * 案件日志id
421
+     */
422
+    private Long caseLogId;
423
+
424
+    public Long getCaseLogId() {
425
+        return caseLogId;
426
+    }
427
+
428
+    public void setCaseLogId(Long caseLogId) {
429
+        this.caseLogId = caseLogId;
430
+    }
431
+
432
+    public Integer getIsOtherRole() {
433
+        return isOtherRole;
434
+    }
435
+
436
+    public void setIsOtherRole(Integer isOtherRole) {
437
+        this.isOtherRole = isOtherRole;
438
+    }
405 439
 
406 440
     public List<Long> getAgentDeptIds() {
407 441
         return agentDeptIds;
@@ -775,6 +809,30 @@ public class CaseApplication  extends BaseEntity {
775 809
      * 申请机构id
776 810
      */
777 811
     private String applicationOrganId;
812
+    /**
813
+     * 版本号
814
+     */
815
+    private Integer version;
816
+    /**
817
+     * 修改案件的提交状态,0-未提交,1-已提交,2-同意,3-拒绝,4-撤销
818
+     */
819
+    private Integer updateSubmitStatus;
820
+
821
+    public Integer getVersion() {
822
+        return version;
823
+    }
824
+
825
+    public void setVersion(Integer version) {
826
+        this.version = version;
827
+    }
828
+
829
+    public Integer getUpdateSubmitStatus() {
830
+        return updateSubmitStatus;
831
+    }
832
+
833
+    public void setUpdateSubmitStatus(Integer updateSubmitStatus) {
834
+        this.updateSubmitStatus = updateSubmitStatus;
835
+    }
778 836
 
779 837
     public String getEmail() {
780 838
         return email;

+ 255
- 0
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/dto/CaseApplicationLogDTO.java Wyświetl plik

@@ -0,0 +1,255 @@
1
+package com.ruoyi.wisdomarbitrate.domain.dto;
2
+
3
+import lombok.Data;
4
+
5
+import java.util.Date;
6
+
7
+/**
8
+ * @author wangqiong
9
+ * @description 案件日志
10
+ * @date 2023-11-17 14:01
11
+ */
12
+@Data
13
+public class CaseApplicationLogDTO {
14
+    private static final long serialVersionUID = 1L;
15
+
16
+    /**
17
+     * id
18
+     */
19
+    private Long id;
20
+
21
+    /**
22
+     * 案件编号
23
+     */
24
+    private String caseNum;
25
+
26
+    /**
27
+     * 案件标的
28
+     */
29
+    private Double caseSubjectAmount;
30
+
31
+    /**
32
+     * 立案日期
33
+     */
34
+    private Date registerDate;
35
+
36
+    /**
37
+     * 仲裁方式,视频仲裁(1)、书面仲裁(2)
38
+     */
39
+    private Long arbitratMethod;
40
+
41
+    /**
42
+     * 案件状态,立案申请(0)、待立案审查(1)、 待缴费(2)、待缴费确认(3)、 待案件质证(4)、
43
+     */
44
+    private Integer caseStatus;
45
+
46
+    /**
47
+     * 开庭日期
48
+     */
49
+    private Date hearDate;
50
+
51
+    /**
52
+     * 申请人仲裁请求及事实和理由
53
+     */
54
+    private String arbitratClaims;
55
+
56
+    /**
57
+     * 借款开始日期
58
+     */
59
+    private Date loanStartDate;
60
+
61
+    /**
62
+     * 借款结束日期
63
+     */
64
+    private Date loanEndDate;
65
+
66
+    /**
67
+     * 申请人主张欠本金
68
+     */
69
+    private Double claimPrinciOwed;
70
+
71
+    /**
72
+     * 申请人主张欠利息
73
+     */
74
+    private Double claimInterestOwed;
75
+
76
+    /**
77
+     * 申请人主张违约金
78
+     */
79
+    private Double claimLiquidDamag;
80
+
81
+    /**
82
+     * 仲裁应缴费用
83
+     */
84
+    private Double feePayable;
85
+
86
+    /**
87
+     * 开始在线视频时间
88
+     */
89
+    private Date beginVideoDate;
90
+
91
+    /**
92
+     * 在线视频人员
93
+     */
94
+    private String onlineVideoPerson;
95
+
96
+    /**
97
+     * 合同编号
98
+     */
99
+    private String contractNumber;
100
+
101
+    /**
102
+     * 创建时间
103
+     */
104
+    private Date createTime;
105
+
106
+    /**
107
+     * 更新者
108
+     */
109
+    private String updateBy;
110
+
111
+    /**
112
+     * 更新时间
113
+     */
114
+    private Date updateTime;
115
+
116
+    /**
117
+     * 创建者
118
+     */
119
+    private String createBy;
120
+
121
+    /**
122
+     * 仲裁员id
123
+     */
124
+    private String arbitratorId;
125
+
126
+    /**
127
+     * 仲裁员名称
128
+     */
129
+    private String arbitratorName;
130
+
131
+    /**
132
+     * 已确认组庭的仲裁员id
133
+     */
134
+    private String pendedTrialArbitorid;
135
+
136
+    /**
137
+     * 是否指派仲裁员,1是,2否
138
+     */
139
+    private Integer pendingAppointArbotrar;
140
+
141
+    /**
142
+     * 案件名称
143
+     */
144
+    private String caseName;
145
+
146
+    /**
147
+     * 案件描述
148
+     */
149
+    private String caseDescribe;
150
+
151
+    /**
152
+     * 仲裁结果
153
+     */
154
+    private String caseResult;
155
+
156
+    /**
157
+     * 是否同意组庭,0否,1是
158
+     */
159
+    private Integer isAgreePendTral;
160
+
161
+    /**
162
+     * 是否有异议需要举证,1是,0否
163
+     */
164
+    private Integer objectionAddEviden;
165
+
166
+    /**
167
+     * 是否需要开庭审理,1是,0否
168
+     */
169
+    private Integer openCourtHear;
170
+
171
+    /**
172
+     * paid_expenses
173
+     */
174
+    private Double paidExpenses;
175
+
176
+    /**
177
+     * 裁决书URL
178
+     */
179
+    private String filearbitraUrl;
180
+
181
+    /**
182
+     * 支付方式(0线上支付,1线下支付)
183
+     */
184
+    private String payType;
185
+
186
+    /**
187
+     * 申请人请求仲裁庭裁决
188
+     */
189
+    private String requestRule;
190
+
191
+    /**
192
+     * 是否仲裁反请求,1是,0否
193
+     */
194
+    private Integer adjudicaCounter;
195
+
196
+    /**
197
+     * 是否财产保全申请,1是,0否
198
+     */
199
+    private Integer properPreser;
200
+
201
+    /**
202
+     * 是否管辖异议申请,1是,0否
203
+     */
204
+    private Integer objectiJuris;
205
+
206
+    /**
207
+     * 被申请人是否缺席,1是,0否
208
+     */
209
+    private Integer isAbsence;
210
+
211
+    /**
212
+     * 被申请人质证意见
213
+     */
214
+    private String responCrossOpin;
215
+
216
+    /**
217
+     * 申请人质证意见
218
+     */
219
+    private String applicaCrossOpin;
220
+
221
+    /**
222
+     * 被申请人的答辩意见
223
+     */
224
+    private String responDefenOpini;
225
+
226
+    /**
227
+     * 申请人是否缺席,1是,0否
228
+     */
229
+    private Integer appliIsAbsen;
230
+
231
+    /**
232
+     * 是否锁定,0-否,1-是
233
+     */
234
+    private Integer lockStatus;
235
+
236
+    /**
237
+     * 视频会议房间号id,多个用逗号拼接
238
+     */
239
+    private String roomId;
240
+
241
+    /**
242
+     * 是否导入,0手动录入,1导入,默认0
243
+     */
244
+    private Integer importFlag;
245
+
246
+    /**
247
+     * 版本号
248
+     */
249
+    private Long version;
250
+
251
+    /**
252
+     * 修改案件的提交状态,0-未提交,1-已提交,2-同意,3,拒绝
253
+     */
254
+    private Integer updateSubmitStatus;
255
+}

+ 19
- 19
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/vo/ToDoCount.java Wyświetl plik

@@ -10,24 +10,24 @@ import lombok.Data;
10 10
 @Data
11 11
 public class ToDoCount {
12 12
 
13
-    private int caseApply; // 立案申请
14
-    private int caseApplyCheck; // 待立案审查
15
-    private int caseApplyPay; // 待缴费
16
-    private int caseApplyPayCheck; // 待缴费确认
17
-    private int caseApplyEvidence; //待案件质证
18
-    private int caseApplyGroupCheck; // 待组庭审核
19
-    private int caseApplyGroupConfirm; // 待组庭确定
13
+    private int caseApply=0; // 立案申请
14
+    private int caseApplyCheck=0; // 待立案审查
15
+    private int caseApplyPay=0; // 待缴费
16
+    private int caseApplyPayCheck=0; // 待缴费确认
17
+    private int caseApplyEvidence=0; //待案件质证
18
+    private int caseApplyGroupCheck=0; // 待组庭审核
19
+    private int caseApplyGroupConfirm=0; // 待组庭确定
20 20
 //    private int caseApplyGroupNotice;
21
-    private int caseApplyArbitrateWay; // 待审核仲裁方式
22
-    private int caseApplyGroupOnline; // 待开庭审理
23
-    private int caseApplyGroupOffline; // 待书面审理
24
-    private int caseApplyAward; // 待生成仲裁文书
25
-    private int caseApplyAwardCheck; // 待核验仲裁文书
26
-    private int caseApplyAwardConfirm; // 待审核仲裁文书
27
-    private int caseApplyAwardSign; // 待仲裁文书签名
28
-    private int caseApplyAwardSeal; // 待仲裁文书用印
29
-    private int caseApplyAwardSend; // 待仲裁文书送达
30
-    private int caseApplyStored; // 待案件归档
31
-    private int caseApplyArchived; // 已归档
32
-    private int updateOnlineHearDate; // 待修改开庭时间
21
+    private int caseApplyArbitrateWay=0; // 待审核仲裁方式
22
+    private int caseApplyGroupOnline=0; // 待开庭审理
23
+    private int caseApplyGroupOffline=0; // 待书面审理
24
+    private int caseApplyAward=0; // 待生成仲裁文书
25
+    private int caseApplyAwardCheck=0; // 待核验仲裁文书
26
+    private int caseApplyAwardConfirm=0; // 待审核仲裁文书
27
+    private int caseApplyAwardSign=0; // 待仲裁文书签名
28
+    private int caseApplyAwardSeal=0; // 待仲裁文书用印
29
+    private int caseApplyAwardSend=0; // 待仲裁文书送达
30
+    private int caseApplyStored=0; // 待案件归档
31
+    private int caseApplyArchived=0; // 已归档
32
+    private int updateOnlineHearDate=0; // 待修改开庭时间
33 33
 }

+ 34
- 0
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/vo/UpdateSubmitVO.java Wyświetl plik

@@ -0,0 +1,34 @@
1
+package com.ruoyi.wisdomarbitrate.domain.vo;
2
+
3
+import lombok.AllArgsConstructor;
4
+import lombok.Builder;
5
+import lombok.Data;
6
+import lombok.NoArgsConstructor;
7
+
8
+/**
9
+ * 修改案件提交至秘书
10
+ */
11
+@Data
12
+@Builder
13
+@NoArgsConstructor
14
+@AllArgsConstructor
15
+public class UpdateSubmitVO {
16
+    /**
17
+     * 案件id
18
+     */
19
+    private Long caseId;
20
+    /**
21
+     * 版本号
22
+     */
23
+    private Integer version;
24
+    /**
25
+     * 修改案件的提交状态,0-未提交,1-已提交,2-同意已修改的案件,3-拒绝已修改的案件,4-撤销,5-同意撤销,6-拒绝撤销
26
+     */
27
+    private Integer updateSubmitStatus;
28
+    /**
29
+     * 是否同意,0-否,1-是
30
+     */
31
+    private Integer isAgree;
32
+
33
+
34
+}

+ 25
- 0
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseAffiliateLogMapper.java Wyświetl plik

@@ -0,0 +1,25 @@
1
+package com.ruoyi.wisdomarbitrate.mapper;
2
+
3
+import com.ruoyi.wisdomarbitrate.domain.CaseAffiliate;
4
+import com.ruoyi.wisdomarbitrate.domain.CaseApplication;
5
+import org.apache.ibatis.annotations.Param;
6
+import org.springframework.stereotype.Repository;
7
+
8
+import java.util.List;
9
+@Repository
10
+public interface CaseAffiliateLogMapper {
11
+
12
+
13
+    int batchCaseAffiliate(List<CaseAffiliate> caseAffiliates);
14
+
15
+
16
+    void deletecaseAffiliate(CaseApplication caseApplication);
17
+    void batchDeletecaseAffiliate(@Param("ids") List<Long> ids);
18
+
19
+
20
+    List<CaseAffiliate>  selectCaseAffiliate(CaseAffiliate caseAffiliate);
21
+    CaseAffiliate  selectCaseAffiliateByIdentityType(@Param("caseAppliLogId") Long caseAppliLogId, @Param("identityType")int identityType);
22
+
23
+    int updataCaseAffiliate(CaseAffiliate caseAffiliate);
24
+
25
+}

+ 6
- 0
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseAffiliateMapper.java Wyświetl plik

@@ -29,4 +29,10 @@ public interface CaseAffiliateMapper {
29 29
      * @return
30 30
      */
31 31
     List<CaseAffiliate> emailByCaseId(@Param("caseAppliId")Long id);
32
+
33
+    /**
34
+     * 批量修改
35
+     * @param affiliateLogList
36
+     */
37
+    void updataCaseAffiliateByCaseId(@Param("caseAppliId")Long caseAppliId,@Param("list") List<CaseAffiliate> affiliateLogList);
32 38
 }

+ 46
- 0
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseApplicationLogMapper.java Wyświetl plik

@@ -0,0 +1,46 @@
1
+package com.ruoyi.wisdomarbitrate.mapper;
2
+
3
+import com.ruoyi.wisdomarbitrate.domain.CaseApplication;
4
+import com.ruoyi.wisdomarbitrate.domain.vo.UpdateSubmitVO;
5
+import org.apache.ibatis.annotations.Param;
6
+import org.springframework.stereotype.Repository;
7
+
8
+import java.util.List;
9
+
10
+/**
11
+ * @author wangqiong
12
+ * @description 案件日志
13
+ * @date 2023-11-17 14:05
14
+ */
15
+@Repository
16
+public interface CaseApplicationLogMapper {
17
+    int insert(CaseApplication caseApplicationLog);
18
+
19
+    int deleteById(Long id);
20
+
21
+
22
+
23
+    CaseApplication selectByCaseIdAndVersion(@Param("caseAppliId")long caseAppliId,@Param("version") int version);
24
+
25
+    Integer selectMaxVersionByCaseId(@Param("caseAppliId")long caseAppliId);
26
+
27
+    /**
28
+     * 修改日志表状态
29
+     * @param vo
30
+     */
31
+    void updateStatus(UpdateSubmitVO vo);
32
+
33
+    /**
34
+     * 根据案件id查询秘书角色最新版本号
35
+     * @param id
36
+     * @return
37
+     */
38
+    Integer selectMaxVersionBySecret(@Param("caseAppliId")Long id);
39
+
40
+    /**
41
+     * 根据案件id删除案件记录表和案件关联人日志表
42
+     * @param ids
43
+     */
44
+    void batchDeleteLog(@Param("ids") List<Long> ids);
45
+
46
+}

+ 22
- 0
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseApplicationMapper.java Wyświetl plik

@@ -12,6 +12,7 @@ import java.util.List;
12 12
 
13 13
 public interface CaseApplicationMapper {
14 14
     List<CaseApplication> selectCaseApplicationList(CaseApplication caseApplication);
15
+    List<CaseApplication> selectCaseApplicationList1(CaseApplication caseApplication);
15 16
 
16 17
     int selectCaseApplicationCount(CaseApplication caseApplication);
17 18
 
@@ -109,4 +110,25 @@ public interface CaseApplicationMapper {
109 110
      * @return
110 111
      */
111 112
     Integer selectMaxRoomId();
113
+
114
+    /**
115
+     * 修改案件版本号
116
+     * @param id
117
+     * @param version
118
+     */
119
+    void updateVersionById(@Param("id")Long id, @Param("version")Integer version);
120
+
121
+    /**
122
+     * 查询秘书案件
123
+     * @param caseApplication
124
+     * @return
125
+     */
126
+    List<CaseApplication> selectSecretaryCase(CaseApplication caseApplication);
127
+
128
+    /**
129
+     * 查询申请人案件
130
+     * @param caseApplication
131
+     * @return
132
+     */
133
+    List<CaseApplication> selectApplicationCase(CaseApplication caseApplication);
112 134
 }

+ 57
- 0
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/CaseApplicationLogService.java Wyświetl plik

@@ -0,0 +1,57 @@
1
+package com.ruoyi.wisdomarbitrate.service;
2
+
3
+import com.ruoyi.common.core.domain.AjaxResult;
4
+import com.ruoyi.wisdomarbitrate.domain.CaseApplication;
5
+import com.ruoyi.wisdomarbitrate.domain.vo.UpdateSubmitVO;
6
+
7
+/**
8
+ * @author wangqiong
9
+ * @description 案件日志
10
+ * @date 2023-11-17 13:58
11
+ */
12
+public interface CaseApplicationLogService {
13
+    /**
14
+     * 新增案件日志
15
+     * @param caseApplicationLog
16
+     * @return
17
+     */
18
+   int insert(CaseApplication caseApplicationLog);
19
+
20
+    /**
21
+     * 根据案件日志id删除案件日志
22
+     * @param id
23
+     * @return
24
+     */
25
+   int delete(Long id);
26
+
27
+    /**
28
+     * 根据案件id和版本号查询案件日志
29
+     * @param id
30
+     * @param version
31
+     * @return
32
+     */
33
+    CaseApplication selectByCaseIdAndVersion(Long id, int version);
34
+
35
+    /**
36
+     * 修改的案件提交到秘书
37
+     * @param vo
38
+     * @return
39
+     */
40
+    AjaxResult submit(UpdateSubmitVO vo);
41
+
42
+    /**
43
+     * 修改撤销申请
44
+     * @param vo
45
+     * @return
46
+     */
47
+    AjaxResult revoke(UpdateSubmitVO vo);
48
+
49
+    /**
50
+     * 秘书审核修改的案件
51
+     * @param vo
52
+     * @return
53
+     */
54
+    AjaxResult updateAudit(UpdateSubmitVO vo);
55
+
56
+
57
+}

+ 1
- 1
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/ICaseApplicationService.java Wyświetl plik

@@ -21,7 +21,7 @@ public interface ICaseApplicationService {
21 21
 
22 22
     int selectCaseApplicationCount(CaseApplication caseApplication);
23 23
 
24
-    int editCaseApplication(CaseApplication caseApplication);
24
+    AjaxResult editCaseApplication(CaseApplication caseApplication);
25 25
 
26 26
     int submitCaseApplication( List<Long> ids);
27 27
 

+ 155
- 0
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationLogServiceImpl.java Wyświetl plik

@@ -0,0 +1,155 @@
1
+package com.ruoyi.wisdomarbitrate.service.impl;
2
+
3
+import com.ruoyi.common.core.domain.AjaxResult;
4
+import com.ruoyi.common.enums.UpdateSubmitStatus;
5
+import com.ruoyi.common.enums.YesOrNoEnum;
6
+import com.ruoyi.wisdomarbitrate.domain.CaseAffiliate;
7
+import com.ruoyi.wisdomarbitrate.domain.CaseApplication;
8
+import com.ruoyi.wisdomarbitrate.domain.vo.UpdateSubmitVO;
9
+import com.ruoyi.wisdomarbitrate.mapper.CaseAffiliateLogMapper;
10
+import com.ruoyi.wisdomarbitrate.mapper.CaseAffiliateMapper;
11
+import com.ruoyi.wisdomarbitrate.mapper.CaseApplicationLogMapper;
12
+import com.ruoyi.wisdomarbitrate.mapper.CaseApplicationMapper;
13
+import com.ruoyi.wisdomarbitrate.service.CaseApplicationLogService;
14
+import org.springframework.beans.factory.annotation.Autowired;
15
+import org.springframework.stereotype.Service;
16
+import org.springframework.transaction.annotation.Transactional;
17
+
18
+import java.util.List;
19
+import java.util.Objects;
20
+
21
+/**
22
+ * @author wangqiong
23
+ * @description 案件日志
24
+ * @date 2023-11-17 14:05
25
+ */
26
+@Service
27
+public class CaseApplicationLogServiceImpl implements CaseApplicationLogService {
28
+    @Autowired
29
+    private CaseApplicationLogMapper caseApplicationLogMapper;
30
+    @Autowired
31
+    private CaseApplicationMapper caseApplicationMapper;
32
+    @Autowired
33
+    private CaseAffiliateLogMapper caseAffiliateLogMapper;
34
+    @Autowired
35
+    private CaseAffiliateMapper caseAffiliateMapper;
36
+    @Override
37
+    public int insert(CaseApplication caseApplicationLog) {
38
+        return caseApplicationLogMapper.insert(caseApplicationLog);
39
+    }
40
+
41
+    @Override
42
+    public int delete(Long id) {
43
+        return caseApplicationLogMapper.deleteById(id);
44
+    }
45
+
46
+
47
+
48
+    @Override
49
+    public CaseApplication selectByCaseIdAndVersion(Long id, int version) {
50
+        return caseApplicationLogMapper.selectByCaseIdAndVersion(id,version);
51
+    }
52
+    /**
53
+     * 修改的案件提交到秘书
54
+     * @param vo
55
+     * @return
56
+     */
57
+    @Override
58
+    public AjaxResult submit(UpdateSubmitVO vo) {
59
+        vo.setUpdateSubmitStatus(UpdateSubmitStatus.COMMITTED.getCode());
60
+        // 修改日志表提交状态
61
+        caseApplicationLogMapper.updateStatus(vo);
62
+        return AjaxResult.success();
63
+    }
64
+
65
+    @Override
66
+    public AjaxResult revoke(UpdateSubmitVO vo) {
67
+        vo.setUpdateSubmitStatus(UpdateSubmitStatus.REVOKE.getCode());
68
+        // 修改日志表提交状态
69
+        caseApplicationLogMapper.updateStatus(vo);
70
+        return AjaxResult.success();
71
+    }
72
+
73
+    /**
74
+     * 秘书审核修改的案件
75
+     * @param vo
76
+     * @return
77
+     */
78
+    @Transactional
79
+    @Override
80
+    public AjaxResult updateAudit(UpdateSubmitVO vo) {
81
+        if (Objects.equals(vo.getUpdateSubmitStatus(), UpdateSubmitStatus.COMMITTED.getCode())) {
82
+            // 审核修改提交状态
83
+            if (Objects.equals(vo.getIsAgree(), YesOrNoEnum.YES.getCode())) {
84
+                // 如果版本号为1,则直接返回
85
+                if(vo.getVersion() <= 1){
86
+                    return AjaxResult.success();
87
+                }
88
+                // 同意,查询日志记录表本版本数据,将数据更新到主表,并将日志表改版本的状态改为同意
89
+                // 查询日志记录表本版本数据
90
+                CaseApplication caseApplicationLog = caseApplicationLogMapper.selectByCaseIdAndVersion(vo.getCaseId(), vo.getVersion());
91
+                if (caseApplicationLog == null) {
92
+                    return AjaxResult.error("未找到该案件");
93
+                }
94
+                // 将日志表改版本的状态改为同意
95
+                vo.setUpdateSubmitStatus(UpdateSubmitStatus.AGREE.getCode());
96
+                caseApplicationLogMapper.updateStatus(vo);
97
+                // 根据caseLogId查询相关人员表
98
+                CaseAffiliate caseAffiliate = new CaseAffiliate();
99
+                caseAffiliate.setCaseAppliLogId(caseApplicationLog.getCaseLogId());
100
+                List<CaseAffiliate> affiliateLogList = caseAffiliateLogMapper.selectCaseAffiliate(caseAffiliate);
101
+                caseApplicationLog.setId(caseApplicationLog.getCaseAppliId());
102
+                // 更新案件主表
103
+                caseApplicationMapper.updataCaseApplication(caseApplicationLog);
104
+
105
+                // 更新相关人员主表
106
+                caseAffiliateMapper.updataCaseAffiliateByCaseId(caseApplicationLog.getCaseAppliId(), affiliateLogList);
107
+            } else {
108
+                // 拒绝,将日志表改版本的状态改为拒绝
109
+                vo.setUpdateSubmitStatus(UpdateSubmitStatus.REFUSE.getCode());
110
+                caseApplicationLogMapper.updateStatus(vo);
111
+                // 修改案件表的版本号
112
+                 //  caseApplicationMapper.updateVersionById(vo.getCaseId(),vo.getVersion());
113
+
114
+            }
115
+            return AjaxResult.success();
116
+        }
117
+        // todo 需确定
118
+//        else if (Objects.equals(vo.getUpdateSubmitStatus(), UpdateSubmitStatus.REVOKE.getCode())) {
119
+//            // 如果版本号为1,则直接返回
120
+//            if(vo.getVersion() <= 1){
121
+//                return AjaxResult.success();
122
+//            }
123
+//            // 审核修改撤销状态
124
+//            if (Objects.equals(vo.getIsAgree(), YesOrNoEnum.YES.getCode())) {
125
+//                // 同意撤销,查询日志记录表上个版本数据,将数据更新到主表,并将日志表改版本的状态改为同意撤销
126
+//                // 查询日志记录表上个版本未被拒绝数据
127
+//                CaseApplication caseApplicationLog = caseApplicationLogMapper.selectByCaseIdAndVersion(vo.getCaseId(), vo.getVersion()-1);
128
+//                if (caseApplicationLog == null) {
129
+//                    return AjaxResult.error("未找到该案件");
130
+//                }
131
+//                // 将日志表改版本的状态改为拒绝
132
+//                vo.setUpdateSubmitStatus(UpdateSubmitStatus.AGREE_REVOKE.getCode());
133
+//                caseApplicationLogMapper.updateStatus(vo);
134
+//                // 根据caseLogId查询相关人员表
135
+//                CaseAffiliate caseAffiliate = new CaseAffiliate();
136
+//                caseAffiliate.setCaseAppliLogId(caseApplicationLog.getCaseLogId());
137
+//                List<CaseAffiliate> affiliateLogList = caseAffiliateLogMapper.selectCaseAffiliate(caseAffiliate);
138
+//                caseApplicationLog.setId(caseApplicationLog.getCaseAppliId());
139
+//                // 更新案件主表
140
+//                caseApplicationMapper.updataCaseApplication(caseApplicationLog);
141
+//
142
+//                // 更新相关人员主表
143
+//                caseAffiliateMapper.updataCaseAffiliateByCaseId(caseApplicationLog.getCaseAppliId(), affiliateLogList);
144
+//            } else {
145
+//                // 拒绝撤销,将日志表改版本的状态改为拒绝撤销
146
+//                vo.setUpdateSubmitStatus(UpdateSubmitStatus.REFUSE_REVOKE.getCode());
147
+//                caseApplicationLogMapper.updateStatus(vo);
148
+//                // 修改案件表的版本号
149
+//             //   caseApplicationMapper.updateVersionById(vo.getCaseId(),vo.getVersion());
150
+//            }
151
+//            return AjaxResult.success();
152
+//        }
153
+       return AjaxResult.success();
154
+    }
155
+}

+ 154
- 106
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java Wyświetl plik

@@ -2,6 +2,7 @@ package com.ruoyi.wisdomarbitrate.service.impl;
2 2
 
3 3
 
4 4
 import cn.hutool.core.collection.CollectionUtil;
5
+import cn.hutool.core.util.IdcardUtil;
5 6
 import cn.hutool.core.util.StrUtil;
6 7
 import com.alibaba.fastjson.JSON;
7 8
 import com.alibaba.fastjson.JSONArray;
@@ -14,11 +15,13 @@ import com.ruoyi.common.constant.CaseApplicationConstants;
14 15
 import com.ruoyi.common.core.domain.AjaxResult;
15 16
 import com.ruoyi.common.core.domain.entity.*;
16 17
 import com.ruoyi.common.core.domain.model.LoginUser;
18
+import com.ruoyi.common.enums.UpdateSubmitStatus;
17 19
 import com.ruoyi.common.exception.EsignDemoException;
18 20
 import com.ruoyi.common.exception.ServiceException;
19 21
 import com.ruoyi.common.utils.*;
20 22
 import com.ruoyi.common.utils.file.SaaSAPIFileUtils;
21 23
 import com.ruoyi.common.core.domain.entity.SysUser;
24
+import com.ruoyi.common.utils.thread.ThreadPoolUtil;
22 25
 import com.ruoyi.system.domain.SysUserRole;
23 26
 import com.ruoyi.system.mapper.SysDeptMapper;
24 27
 import com.ruoyi.system.mapper.SysRoleMapper;
@@ -59,9 +62,11 @@ import java.util.*;
59 62
 import java.util.regex.Pattern;
60 63
 import java.util.stream.Collectors;
61 64
 
65
+import static com.ruoyi.common.core.domain.AjaxResult.success;
62 66
 import static com.ruoyi.common.utils.PageUtils.startPage;
63 67
 import static com.ruoyi.common.utils.SecurityUtils.getLoginUser;
64 68
 import static com.ruoyi.common.utils.SecurityUtils.getUsername;
69
+import static com.ruoyi.wisdomarbitrate.utils.CaseLogUtils.insertCaseLog;
65 70
 
66 71
 
67 72
 @Service
@@ -107,13 +112,17 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
107 112
 
108 113
     @Autowired
109 114
     private SealManageMapper sealManageMapper;
115
+    @Autowired
116
+    private CaseApplicationLogMapper caseApplicationLogMapper;
117
+    @Autowired
118
+    private CaseAffiliateLogMapper caseAffiliateLogMapper;
110 119
 
111 120
     // 手机号正则
112 121
     private static final Pattern TELEPHONE_REGX = Pattern.compile("^1(3\\d|4[5-9]|5[0-35-9]|6[2567]|7[0-8]|8\\d|9[0-35-9])\\d{8}$");
113 122
     // 邮箱正则
114 123
     private static final Pattern EMAIL_PATTERN = Pattern.compile("^[a-zA-Z0-9_+&*-]+(?:\\.[a-zA-Z0-9_+&*-]+)*@(?:[a-zA-Z0-9-]+\\.)+[a-zA-Z]{2,7}$");
115 124
     // 身份证号码正则表达式
116
-    private static final String ID_REGEX = "^(\\d{14}|\\d{17})(\\d|[Xx])$";
125
+    private static final String ID_REGEX = "^(\\\\d{15}$|\\\\d{18}$|\\\\d{17}([0-9]|X))$";
117 126
 
118 127
     /**
119 128
      * 数据权限:1.每个人不同的角色,而每个角色可以操作不同的案件状态
@@ -148,40 +157,47 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
148 157
             }
149 158
 
150 159
             for (SysRole role : roles) {
160
+                if(StrUtil.isEmpty(role.getRoleName())){
161
+                    continue;
162
+                }
151 163
                 // 超级管理员和仲裁委(部门长)案件,可查看所有案件 √
152
-                if (role.getRoleName().equals("超级管理员")
164
+                if ("超级管理员".equals(role.getRoleName())
153 165
                 ) {
154 166
                     return caseApplicationMapper.selectAdminCaseApplicationList(caseApplication);
155 167
                 }
156
-                if (role.getRoleName().equals("仲裁委")
157
-                        || role.getRoleName().equals("部门长")) {
168
+                if ("仲裁委".equals(role.getRoleName())
169
+                        || "部门长".equals(role.getRoleName())) {
158 170
                     List<Integer> caseStatusList = new ArrayList<>();
159 171
                     caseStatusList.add(CaseApplicationConstants.CONFIRMDED_PENDING_TRIAL);
160 172
                     caseStatusList.add(CaseApplicationConstants.ARBITRATED_SEAL);
161 173
                     caseApplication.setDeptHeadStatus(caseStatusList);
174
+                    caseApplication.setIsOtherRole(1);
162 175
                 }
163
-                if (role.getRoleName().equals("仲裁员")) {
176
+                if ("仲裁员".equals(role.getRoleName())) {
164 177
                     caseApplication.setUserId(String.valueOf(userId));
178
+                    caseApplication.setIsOtherRole(1);
165 179
                 }
166
-                if (role.getRoleName().equals("财务")) {
180
+                if ("财务".equals(role.getRoleName())) {
181
+                    caseApplication.setIsOtherRole(1);
167 182
                     caseApplication.setFinanceStatus(CaseApplicationConstants.PENDING_PAYMENT_CONFIRM);
168 183
                 }
169
-                if (role.getRoleName().equals("法律顾问")) {
184
+                if ("法律顾问".equals(role.getRoleName())) {
170 185
                     // 查询角色有关的用户部门
171
-                    //      List<Long> deptIds = sysDeptMapper.selectUserDeptListByRoleId(role.getRoleId());
172 186
                     List<Long> deptIds = new ArrayList<>();
173 187
                     deptIds.add(sysUser.getDeptId());
174 188
                     caseApplication.setDeptIds(deptIds);
175 189
                 }
176
-                if (role.getRoleName().equals("申请人")) {
190
+                if ("申请人".equals(role.getRoleName())) {
177 191
                     // 查询有关的用户部门
178 192
                     caseApplication.setApplicationOrganId(String.valueOf(sysUser.getDeptId()));
179 193
                 }
180
-                if (role.getRoleName().equals("被申请人")) {
194
+                if ("被申请人".equals(role.getRoleName())) {
195
+                    caseApplication.setIsOtherRole(1);
181 196
                     //
182 197
                     caseApplication.setIdCard(String.valueOf(sysUser.getIdCard()));
183 198
                 }
184
-                if (role.getRoleName().equals("代理人")) {
199
+                if ("代理人".equals(role.getRoleName())) {
200
+                    caseApplication.setIsOtherRole(1);
185 201
                     // 查询角色有关的用户部门
186 202
                         // List<Long> agentDeptIds = sysDeptMapper.selectUserDeptListByRoleId(role.getRoleId());
187 203
                     List<Long> agentDeptIds = new ArrayList<>();
@@ -192,7 +208,8 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
192 208
 
193 209
 
194 210
             // 根据条件查询申请人,被申请人,仲裁员,法律顾问案件
195
-            return caseApplicationMapper.selectCaseApplicationList(caseApplication);
211
+//            return caseApplicationMapper.selectCaseApplicationList(caseApplication);
212
+            return caseApplicationMapper.selectCaseApplicationList1(caseApplication);
196 213
         }
197 214
 
198 215
     }
@@ -215,40 +232,47 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
215 232
         CaseApplication caseApplication = new CaseApplication();
216 233
         List<Integer> caseStatusList = new ArrayList<>();
217 234
         for (SysRole role : roles) {
235
+            if(StrUtil.isEmpty(role.getRoleName())){
236
+                continue;
237
+            }
218 238
             // 超级管理员和仲裁委(部门长)案件,可查看所有案件 √
219 239
             if (role.getRoleName().equals("超级管理员")
220 240
             ) {
221 241
                 return caseApplicationMapper.selectAdminCaseToDoCount();
222 242
             }
223
-            if (role.getRoleName().equals("仲裁委")
224
-                    || role.getRoleName().equals("部门长")) {
225
-
243
+            if ("仲裁委".equals(role.getRoleName())
244
+                    || "部门长".equals(role.getRoleName())) {
245
+                caseApplication.setIsOtherRole(1);
226 246
                 caseStatusList.add(CaseApplicationConstants.CONFIRMDED_PENDING_TRIAL);
227 247
                 caseStatusList.add(CaseApplicationConstants.ARBITRATED_SEAL);
228 248
                 caseApplication.setDeptHeadStatus(caseStatusList);
229 249
             }
230
-            if (role.getRoleName().equals("仲裁员")) {
250
+            if ("仲裁员".equals(role.getRoleName())) {
251
+                caseApplication.setIsOtherRole(1);
231 252
                 caseApplication.setUserId(String.valueOf(userId));
232 253
             }
233
-            if (role.getRoleName().equals("财务")) {
254
+            if ("财务".equals(role.getRoleName())) {
255
+                caseApplication.setIsOtherRole(1);
234 256
                 caseApplication.setFinanceStatus(CaseApplicationConstants.PENDING_PAYMENT_CONFIRM);
235 257
             }
236
-            if (role.getRoleName().equals("法律顾问")) {
258
+            if ("法律顾问".equals(role.getRoleName())) {
237 259
                 // 查询角色有关的用户部门
238 260
                 // List<Long> deptIds = sysDeptMapper.selectUserDeptListByRoleId(role.getRoleId());
239 261
                 List<Long> deptIds = new ArrayList<>();
240 262
                 deptIds.add(sysUser.getDeptId());
241 263
                 caseApplication.setDeptIds(deptIds);
242 264
             }
243
-            if (role.getRoleName().equals("申请人")) {
265
+            if ("申请人".equals(role.getRoleName())) {
244 266
                 // 查询角色有关的用户部门
245 267
                 caseApplication.setApplicationOrganId(String.valueOf(sysUser.getDeptId()));
246 268
             }
247
-            if (role.getRoleName().equals("被申请人")) {
269
+            if ("被申请人".equals(role.getRoleName())) {
270
+                caseApplication.setIsOtherRole(1);
248 271
                 //
249 272
                 caseApplication.setIdCard(String.valueOf(sysUser.getIdCard()));
250 273
             }
251
-            if (role.getRoleName().equals("代理人")) {
274
+            if ("代理人".equals(role.getRoleName())) {
275
+                caseApplication.setIsOtherRole(1);
252 276
                 // 查询角色有关的用户部门
253 277
                 // List<Long> agentDeptIds = sysDeptMapper.selectUserDeptListByRoleId(role.getRoleId());
254 278
                 List<Long> agentDeptIds = new ArrayList<>();
@@ -259,7 +283,11 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
259 283
 
260 284
 
261 285
         // 根据条件查询申请人,被申请人,仲裁员,法律顾问案件
262
-        return caseApplicationMapper.selectTodoCountByRole(caseApplication);
286
+        ToDoCount toDoCount = caseApplicationMapper.selectTodoCountByRole(caseApplication);
287
+        if(toDoCount==null){
288
+            return new ToDoCount();
289
+        }
290
+        return toDoCount;
263 291
     }
264 292
 
265 293
     @Override
@@ -280,7 +308,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
280 308
         records.addAll(recordsnofinish);
281 309
         datas.put("allCasenode", records);
282 310
         datas.put("caseStatus", caseStatus);
283
-        return AjaxResult.success(datas);
311
+        return success(datas);
284 312
 
285 313
     }
286 314
 
@@ -298,7 +326,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
298 326
         // 发送开庭日期通知短信
299 327
         sendHearDateMessage(caseApplication, request, "1975139");
300 328
         // 新增日志
301
-        CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.PENDING_OPENCOURT_HEAR, "");
329
+        insertCaseLog(caseApplication.getId(), CaseApplicationConstants.PENDING_OPENCOURT_HEAR, "");
302 330
         return rows;
303 331
     }
304 332
 
@@ -511,7 +539,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
511 539
             }
512 540
         }
513 541
 
514
-        return AjaxResult.success();
542
+        return success();
515 543
 
516 544
     }
517 545
 
@@ -846,6 +874,11 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
846 874
 
847 875
     }
848 876
 
877
+    /**
878
+     * 新增案件
879
+     * @param caseApplication
880
+     * @return
881
+     */
849 882
     @Override
850 883
     @Transactional
851 884
     public int insertcaseApplication(CaseApplication caseApplication) {
@@ -860,8 +893,12 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
860 893
         String caseNum = generateCaseNum();
861 894
         caseApplication.setCaseNum(caseNum);
862 895
         caseApplication.setCreateBy(getUsername());
896
+        caseApplication.setVersion(1);
863 897
         // 新增立案信息
864 898
         int rows = caseApplicationMapper.insertCaseApplication(caseApplication);
899
+        if(rows==0){
900
+            return rows;
901
+        }
865 902
         List<CaseAffiliate> caseAffiliates = caseApplication.getCaseAffiliates();
866 903
         Map<String, Long> deptMap = new HashMap<>();
867 904
         // 判断申请机构
@@ -876,6 +913,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
876 913
             Long roleId = roleMapper.selectRoleIdByName("申请人");
877 914
             for (CaseAffiliate caseAffiliate : caseAffiliates) {
878 915
                 caseAffiliate.setCaseAppliId(caseApplication.getId());
916
+                caseAffiliate.setCaseAppliLogId(caseApplication.getId());
879 917
                 if (caseAffiliate.getIdentityType() == 1 && StrUtil.isNotEmpty(caseAffiliate.getName())) {
880 918
                     // 将组织机构id设为申请人名称
881 919
                     if (deptMap.containsKey(caseAffiliate.getName())) {
@@ -918,7 +956,19 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
918 956
             }
919 957
         }
920 958
         // 新增日志
921
-        CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.CASE_APPLICATION, "");
959
+        insertCaseLog(caseApplication.getId(), CaseApplicationConstants.CASE_APPLICATION, "");
960
+        // 异步新增案件日志
961
+        ThreadPoolUtil.execute(() -> {
962
+            caseApplication.setCaseAppliId(caseApplication.getId());
963
+            caseApplication.setUpdateSubmitStatus(UpdateSubmitStatus.UNCOMMITTED.getCode());
964
+            int insertRow = caseApplicationLogMapper.insert(caseApplication);
965
+            if (insertRow != 0 && CollectionUtil.isNotEmpty(caseAffiliates)) {
966
+                caseAffiliates.forEach(caseAffiliate -> caseAffiliate.setCaseAppliLogId(caseApplication.getId()));
967
+                // 插入案件日志人员相关表
968
+                caseAffiliateLogMapper.batchCaseAffiliate(caseAffiliates);
969
+            }
970
+        });
971
+
922 972
         return rows;
923 973
     }
924 974
 
@@ -950,15 +1000,17 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
950 1000
 
951 1001
     @Override
952 1002
     @Transactional
953
-    public int editCaseApplication(CaseApplication caseApplication) {
1003
+    public AjaxResult editCaseApplication(CaseApplication caseApplication) {
954 1004
         //根据仲裁费用计费规则计算应缴费用
955 1005
         //暂时设置计费比率为0.01
956 1006
         BigDecimal feeRate = new BigDecimal("0.01");
957 1007
         BigDecimal feePayable = caseApplication.getCaseSubjectAmount().multiply(feeRate).setScale(2, RoundingMode.HALF_UP);
958 1008
         caseApplication.setFeePayable(feePayable);
959 1009
         caseApplication.setUpdateBy(getUsername());
960
-
961
-        int rows = caseApplicationMapper.updataCaseApplication(caseApplication);
1010
+    //    int rows = caseApplicationMapper.updataCaseApplication(caseApplication);
1011
+//        if(rows==0){
1012
+//            return rows;
1013
+//        }
962 1014
         List<CaseAffiliate> caseAffiliates = caseApplication.getCaseAffiliates();
963 1015
         if (caseAffiliates != null && caseAffiliates.size() > 0) {
964 1016
             // 查询所有的组织机构,组装成map
@@ -1001,7 +1053,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
1001 1053
 
1002 1054
                 }
1003 1055
 
1004
-                caseAffiliateMapper.updataCaseAffiliate(caseAffiliate);
1056
+          //      caseAffiliateMapper.updataCaseAffiliate(caseAffiliate);
1005 1057
             }
1006 1058
 
1007 1059
         }
@@ -1013,8 +1065,29 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
1013 1065
             }
1014 1066
 
1015 1067
         }
1068
+        // 根据案件id查询最新版本号
1069
+        Integer maxVersion = caseApplicationLogMapper.selectMaxVersionByCaseId(caseApplication.getId());
1070
+        if (maxVersion == null) {
1071
+            maxVersion = 1;
1072
+        }
1073
+        caseApplication.setVersion(maxVersion+1);
1074
+        // 将修改提交状态改为未提交
1075
+        caseApplication.setUpdateSubmitStatus(UpdateSubmitStatus.UNCOMMITTED.getCode());
1076
+        // 修改案件表的版本号
1077
+     //   caseApplicationMapper.updateVersionById(caseApplication.getId(),caseApplication.getVersion());
1016 1078
 
1017
-        return rows;
1079
+        // 异步新增案件日志
1080
+        ThreadPoolUtil.execute(() -> {
1081
+            caseApplication.setCaseAppliId(caseApplication.getId());
1082
+            int insertRow = caseApplicationLogMapper.insert(caseApplication);
1083
+            if (insertRow != 0 && CollectionUtil.isNotEmpty(caseAffiliates)) {
1084
+                caseAffiliates.forEach(caseAffiliate -> caseAffiliate.setCaseAppliLogId(caseApplication.getId()));
1085
+                // 插入案件日志人员相关表
1086
+                caseAffiliateLogMapper.batchCaseAffiliate(caseAffiliates);
1087
+            }
1088
+        });
1089
+
1090
+        return success();
1018 1091
     }
1019 1092
 
1020 1093
 
@@ -1132,7 +1205,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
1132 1205
             application.setCaseStatus(CaseApplicationConstants.CASE_CHECK);
1133 1206
             rows += caseApplicationMapper.submitCaseApplication(application);
1134 1207
             // 新增日志
1135
-            CaseLogUtils.insertCaseLog(application.getId(), CaseApplicationConstants.CASE_CHECK, "");
1208
+            insertCaseLog(application.getId(), CaseApplicationConstants.CASE_CHECK, "");
1136 1209
         }
1137 1210
         return rows;
1138 1211
     }
@@ -1140,16 +1213,17 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
1140 1213
     @Override
1141 1214
     @Transactional
1142 1215
     public int deletecaseApplicationByIds(List<Long> ids) {
1143
-
1216
+        int rows = caseApplicationMapper.batchDeletecaseApplication(ids);
1144 1217
         caseAffiliateMapper.batchDeletecaseAffiliate(ids);
1145
-        return caseApplicationMapper.batchDeletecaseApplication(ids);
1218
+        caseApplicationLogMapper.batchDeleteLog(ids);
1219
+        return rows;
1146 1220
     }
1147 1221
 
1148 1222
     @Override
1149 1223
     public CaseApplication selectCaseApplication(CaseApplication caseApplication) {
1150
-        CaseApplication caseApplicationselect = caseApplicationMapper.selectCaseApplication(caseApplication);
1151
-        CaseAffiliate caseAffiliate = new CaseAffiliate();
1152
-        caseAffiliate.setCaseAppliId(caseApplication.getId());
1224
+        CaseApplication caseApplicationselect=caseApplicationLogMapper.selectByCaseIdAndVersion(caseApplication.getId(),caseApplication.getVersion());
1225
+        caseApplicationselect.setId(caseApplication.getId());
1226
+
1153 1227
 
1154 1228
         ArbitrateRecord arbitrateRecord = new ArbitrateRecord();
1155 1229
         arbitrateRecord.setCaseAppliId(caseApplication.getId());
@@ -1178,8 +1252,9 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
1178 1252
             }
1179 1253
         }
1180 1254
         caseApplicationselect.setCaseAttachList(caseAttachList);
1181
-
1182
-        List<CaseAffiliate> caseAffiliatListeselect = caseAffiliateMapper.selectCaseAffiliate(caseAffiliate);
1255
+        CaseAffiliate caseAffiliateLog = new CaseAffiliate();
1256
+        caseAffiliateLog.setCaseAppliLogId(caseApplication.getCaseLogId());
1257
+        List<CaseAffiliate> caseAffiliatListeselect = caseAffiliateLogMapper.selectCaseAffiliate(caseAffiliateLog);
1183 1258
         if (caseAffiliatListeselect != null) {
1184 1259
             // 查询组织机构
1185 1260
             List<SysDept> sysDepts = sysDeptMapper.selectDeptList(new SysDept());
@@ -1219,6 +1294,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
1219 1294
         StringBuilder failureMsg = new StringBuilder();
1220 1295
         StringBuilder successMsg = new StringBuilder();
1221 1296
         int successNum = 0;
1297
+        List<CaseAffiliate> caseAffiliateLogList=new ArrayList<>();
1222 1298
         if (caseApplicationList != null && caseApplicationList.size() > 0) {
1223 1299
             // 1,查询所有的组织机构,组装成map
1224 1300
             List<SysDept> deptList = sysDeptMapper.selectDeptList(new SysDept());
@@ -1254,14 +1330,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
1254 1330
                 }
1255 1331
             }
1256 1332
             if (caseApplicationListinsert.size() > 0) {
1257
-//                List<CaseApplication> caseApplicationListinsertDiffer = caseApplicationListinsert.stream().collect(
1258
-//                        collectingAndThen(
1259
-//                                toCollection(() -> new TreeSet<>(Comparator.comparing(CaseApplication::getCaseNum))),
1260
-//                                ArrayList::new));
1261
-
1262
-
1263 1333
                 //对不重复的立案对象集合的立案对象重新组装对应的案件关联人信息
1264
-//                if(caseApplicationListinsertDiffer!=null&&caseApplicationListinsertDiffer.size()>0){
1265 1334
                 List<CaseApplication> caseApplicationNewList = null;
1266 1335
                 for (int i = 0; i < caseApplicationListinsert.size(); i++) {
1267 1336
                     caseApplicationNewList = new ArrayList<>();
@@ -1290,9 +1359,13 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
1290 1359
                         // 新增立案信息
1291 1360
                         caseApplicationItera.setCaseStatus(CaseApplicationConstants.CASE_APPLICATION);
1292 1361
                         caseApplicationItera.setCreateBy(getUsername());
1362
+                        caseApplicationItera.setImportFlag(1);
1293 1363
                         int rows = caseApplicationMapper.insertCaseApplication(caseApplicationItera);
1364
+                        if(rows==0){
1365
+                            continue;
1366
+                        }
1294 1367
                         // 新增日志
1295
-                        CaseLogUtils.insertCaseLog(caseApplicationItera.getId(), CaseApplicationConstants.CASE_APPLICATION, "");
1368
+                        insertCaseLog(caseApplicationItera.getId(), CaseApplicationConstants.CASE_APPLICATION, "");
1296 1369
 
1297 1370
                         List<CaseAffiliate> caseAffiliates = caseApplicationItera.getCaseAffiliates();
1298 1371
                         if (caseAffiliates != null && caseAffiliates.size() > 0) {
@@ -1302,16 +1375,31 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
1302 1375
                             }
1303 1376
                             caseAffiliateMapper.batchCaseAffiliate(caseAffiliates);
1304 1377
                         }
1305
-
1378
+                        // 新增案件记录
1379
+                        caseApplicationItera.setCaseAppliId(caseApplicationItera.getId());
1380
+                        caseApplicationItera.setUpdateSubmitStatus(UpdateSubmitStatus.UNCOMMITTED.getCode());
1381
+                        caseApplicationItera.setVersion(1);
1382
+
1383
+                        int insertRow = caseApplicationLogMapper.insert(caseApplicationItera);
1384
+                        if(insertRow>0){
1385
+                            caseAffiliates.forEach(caseAffiliate -> caseAffiliate.setCaseAppliLogId(caseApplicationItera.getId()));
1386
+                            caseAffiliateLogList.addAll(caseAffiliates);
1387
+                        }
1306 1388
                         successNum++;
1307 1389
                         successMsg.append("<br/>").append(successNum).append("、立案编号 ").append(caseApplicationItera.getCaseNum()).append(" 导入成功");
1308 1390
                     }
1309 1391
 
1310
-//                    }
1311 1392
 
1312 1393
                 }
1313 1394
 
1314 1395
             }
1396
+            // 异步新增案件日志
1397
+            ThreadPoolUtil.execute(() -> {
1398
+                if ( CollectionUtil.isNotEmpty(caseAffiliateLogList)) {
1399
+                    // 插入案件日志人员相关表
1400
+                    caseAffiliateLogMapper.batchCaseAffiliate(caseAffiliateLogList);
1401
+                }
1402
+            });
1315 1403
 
1316 1404
 
1317 1405
         } else {
@@ -1342,48 +1430,6 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
1342 1430
         validDebtorApplicationAgentColumn(caseApplication, failureMsg);
1343 1431
     }
1344 1432
 
1345
-    /**
1346
-     * 验证身份证号码是否合法
1347
-     * @param idCard
1348
-     * @return
1349
-     */
1350
-    public static boolean validateIdCard(String idCard) {
1351
-        if (idCard == null || idCard.trim().isEmpty()) {
1352
-            return false;
1353
-        }
1354
-
1355
-        if (!Pattern.matches(ID_REGEX, idCard)) {
1356
-            return false;
1357
-        }
1358
-
1359
-        // 根据身份证号码的长度,采取不同的校验位计算方式
1360
-        if (idCard.length() == 15) {
1361
-            // 旧版身份证校验位计算
1362
-            int sum = 0;
1363
-            int[] weights = {7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8};
1364
-            String idDigits = idCard.substring(0, 14);
1365
-            for (int i = 0; i < idDigits.length(); i++) {
1366
-                sum += Integer.parseInt(idDigits.substring(i, i + 1)) * weights[i];
1367
-            }
1368
-            int checkCode = 11 - (sum % 11);
1369
-            if (checkCode == 10) {
1370
-                checkCode = 0;
1371
-            }
1372
-            return idCard.substring(idCard.length() - 1).equals(String.valueOf(checkCode));
1373
-        } else if (idCard.length() == 18) {
1374
-            // 新版身份证校验位计算
1375
-            int sum = 0;
1376
-            int[] weights = {6, 7, 8, 4, 5, 6, 3, 2, 1, 0, 9, 7, 3, 4, 5, 6, 2, 8};
1377
-            String idDigits = idCard.substring(0, 17);
1378
-            for (int i = 0; i < idDigits.length(); i++) {
1379
-                sum += Integer.parseInt(idDigits.substring(i, i + 1)) * weights[i];
1380
-            }
1381
-            int checkCode = sum % 10;
1382
-            return idCard.substring(idCard.length() - 1).equals(String.valueOf(checkCode));
1383
-        }
1384
-
1385
-        return false;
1386
-    }
1387 1433
     /**
1388 1434
      * 校验被申请人代理信息
1389 1435
      *
@@ -1398,7 +1444,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
1398 1444
         }
1399 1445
         if (StrUtil.isEmpty(caseApplication.getDebtorIdentityNumAgent())) {
1400 1446
             failureMsg.append("【被申请人主体信息-代理人身份证号】字段不能为空;");
1401
-        } else if (!validateIdCard(caseApplication.getDebtorIdentityNumAgent())) {
1447
+        } else if (! IdcardUtil.isValidCard((caseApplication.getDebtorIdentityNumAgent()))) {
1402 1448
             failureMsg.append("【被申请人主体信息-代理人身份证号】不合法;");
1403 1449
         }
1404 1450
         String debtorContactTelphoneAgent = caseApplication.getDebtorContactTelphoneAgent();
@@ -1428,7 +1474,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
1428 1474
         }
1429 1475
         if (StrUtil.isEmpty(caseApplication.getDebtorIdentityNum())) {
1430 1476
             failureMsg.append("【被申请人主体信息-身份证号】字段不能为空;");
1431
-        } else if (!validateIdCard(caseApplication.getDebtorIdentityNum())) {
1477
+        } else if (! IdcardUtil.isValidCard(caseApplication.getDebtorIdentityNum())) {
1432 1478
             failureMsg.append("【被申请人主体信息-身份证号】不合法;");
1433 1479
         }
1434 1480
         String debtorContactTelphone = caseApplication.getDebtorContactTelphone();
@@ -1485,7 +1531,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
1485 1531
         }
1486 1532
         if (StrUtil.isEmpty(caseApplication.getIdentityNumAgent())) {
1487 1533
             failureMsg.append("【申请人主体信息-代理人身份证号】字段不能为空;");
1488
-        } else if (!validateIdCard(caseApplication.getIdentityNumAgent())) {
1534
+        } else if (!IdcardUtil.isValidCard(caseApplication.getIdentityNumAgent())) {
1489 1535
             failureMsg.append("【申请人主体信息-代理人身份证号】不合法;");
1490 1536
         }
1491 1537
         validAgentInfo(caseApplication, failureMsg, deptMap);
@@ -1701,7 +1747,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
1701 1747
             }
1702 1748
         }
1703 1749
         // 新增日志
1704
-        CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.CONFIRMDED_PENDING_TRIAL, "");
1750
+        insertCaseLog(caseApplication.getId(), CaseApplicationConstants.CONFIRMDED_PENDING_TRIAL, "");
1705 1751
         return rows;
1706 1752
     }
1707 1753
 
@@ -1713,7 +1759,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
1713 1759
         ArbitrateRecord arbitrateRecord = caseApplication.getArbitrateRecord();
1714 1760
         arbitrateRecordMapper.updataArbitrateRecord(arbitrateRecord);
1715 1761
         // 新增日志
1716
-        CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.CHECK_ARBITRATION, "");
1762
+        insertCaseLog(caseApplication.getId(), CaseApplicationConstants.CHECK_ARBITRATION, "");
1717 1763
         return rows;
1718 1764
 
1719 1765
     }
@@ -1906,18 +1952,18 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
1906 1952
             }
1907 1953
             caseApplication.setCaseStatus(CaseApplicationConstants.SIGN_ARBITRATION);
1908 1954
             // 新增日志
1909
-            CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.SIGN_ARBITRATION, "");
1955
+            insertCaseLog(caseApplication.getId(), CaseApplicationConstants.SIGN_ARBITRATION, "");
1910 1956
 
1911 1957
             rows = caseApplicationMapper.submitCaseApplication(caseApplication);
1912 1958
         } else if (agreeOrNotCheck.intValue() == 2) {//拒绝审核
1913 1959
             caseApplication.setCaseStatus(CaseApplicationConstants.VERPRIF_ARBITRATION);
1914 1960
             // 新增日志
1915
-            CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.VERPRIF_ARBITRATION, "");
1961
+            insertCaseLog(caseApplication.getId(), CaseApplicationConstants.VERPRIF_ARBITRATION, "");
1916 1962
 
1917 1963
             rows = caseApplicationMapper.submitCaseApplication(caseApplication);
1918 1964
         }
1919 1965
 
1920
-        return AjaxResult.success();
1966
+        return success();
1921 1967
     }
1922 1968
 
1923 1969
     @Override
@@ -1937,7 +1983,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
1937 1983
                 rows += caseApplicationMapper.submitCaseApplication(caseApplication);
1938 1984
             }
1939 1985
             // 新增日志
1940
-            CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.PENDING_PAYMENT, "");
1986
+            insertCaseLog(caseApplication.getId(), CaseApplicationConstants.PENDING_PAYMENT, "");
1941 1987
         }
1942 1988
 
1943 1989
 
@@ -2144,7 +2190,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
2144 2190
                 caseLogRecordMapper.insertCaseLogRecord(caseLogRecord);
2145 2191
 
2146 2192
                 // 新增日志
2147
-                CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.GENERATED_ARBITRATION, "");
2193
+                insertCaseLog(caseApplication.getId(), CaseApplicationConstants.GENERATED_ARBITRATION, "");
2148 2194
 
2149 2195
 
2150 2196
             }
@@ -2163,7 +2209,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
2163 2209
                 caseLogRecordMapper.insertCaseLogRecord(caseLogRecord);
2164 2210
 
2165 2211
                 // 新增日志
2166
-                CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.GENERATED_ARBITRATION, "");
2212
+                insertCaseLog(caseApplication.getId(), CaseApplicationConstants.GENERATED_ARBITRATION, "");
2167 2213
 
2168 2214
             }
2169 2215
         }
@@ -2281,7 +2327,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
2281 2327
 
2282 2328
             //获取案件详细信息
2283 2329
             CaseApplication caseApplicationSelct = selectCaseApplication(caseApplication);
2284
-            return AjaxResult.success(caseApplicationSelct);
2330
+            return success(caseApplicationSelct);
2285 2331
         } catch (IOException e) {
2286 2332
             e.printStackTrace();
2287 2333
             return AjaxResult.error("生成庭审笔录异常");
@@ -2344,7 +2390,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
2344 2390
         // 发送开庭日期通知短信
2345 2391
         sendHearDateMessage(caseApplication, request, "1947342");
2346 2392
         // 新增日志
2347
-        CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.MODIFY_HEARDATE, "");
2393
+        insertCaseLog(caseApplication.getId(), CaseApplicationConstants.MODIFY_HEARDATE, "");
2348 2394
 
2349 2395
         return rows;
2350 2396
 
@@ -2682,7 +2728,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
2682 2728
                     ReservedConference conference = new ReservedConference(reservedConferenceVO.getCaseId(), roomId,
2683 2729
                             reservedConferenceVO.getScheduleStartTime(), reservedConferenceVO.getScheduleEndTime(),1);
2684 2730
                     reservedConferenceMapper.insert(conference);
2685
-                    return AjaxResult.success("预约会议成功");
2731
+                    return success("预约会议成功");
2686 2732
 
2687 2733
                 case 42002:
2688 2734
                     return AjaxResult.error("预定会议无效");
@@ -2770,8 +2816,10 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
2770 2816
     @Override
2771 2817
     public AjaxResult deleteRoom(String roomId) {
2772 2818
 
2773
-        return AjaxResult.success( reservedConferenceMapper.deleteByRoomId(roomId));
2819
+        return success( reservedConferenceMapper.deleteByRoomId(roomId));
2774 2820
     }
2821
+
2822
+
2775 2823
 }
2776 2824
 
2777 2825
 

+ 45
- 11
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseEvidenceServiceImpl.java Wyświetl plik

@@ -1,6 +1,7 @@
1 1
 package com.ruoyi.wisdomarbitrate.service.impl;
2 2
 
3 3
 import cn.hutool.core.collection.CollectionUtil;
4
+import cn.hutool.core.util.StrUtil;
4 5
 import com.ruoyi.common.config.RuoYiConfig;
5 6
 import com.ruoyi.common.constant.CaseApplicationConstants;
6 7
 import com.ruoyi.common.core.domain.AjaxResult;
@@ -8,6 +9,7 @@ import com.ruoyi.common.core.domain.entity.SysRole;
8 9
 import com.ruoyi.common.core.domain.entity.SysUser;
9 10
 import com.ruoyi.common.core.domain.model.LoginUser;
10 11
 import com.ruoyi.common.utils.SecurityUtils;
12
+import com.ruoyi.common.utils.SmsUtils;
11 13
 import com.ruoyi.common.utils.StringUtils;
12 14
 import com.ruoyi.common.utils.spring.SpringUtils;
13 15
 import com.ruoyi.system.mapper.SysUserMapper;
@@ -27,12 +29,11 @@ import org.springframework.transaction.annotation.Transactional;
27 29
 import org.springframework.web.multipart.MultipartFile;
28 30
 
29 31
 import java.io.IOException;
30
-import java.util.ArrayList;
31
-import java.util.Arrays;
32
-import java.util.Iterator;
33
-import java.util.List;
32
+import java.util.*;
34 33
 import java.util.stream.Collectors;
35 34
 
35
+import static com.ruoyi.common.utils.SecurityUtils.getUsername;
36
+
36 37
 @Service
37 38
 public class CaseEvidenceServiceImpl implements ICaseEvidenceService {
38 39
     @Autowired
@@ -47,6 +48,8 @@ public class CaseEvidenceServiceImpl implements ICaseEvidenceService {
47 48
     private CaseEvidenceDirectoryMapper caseEvidenceDirectoryMapper;
48 49
     @Autowired
49 50
     private SysUserMapper sysUserMapper;
51
+    @Autowired
52
+    private SmsRecordMapper smsRecordMapper;
50 53
 
51 54
     @Override
52 55
     @Transactional
@@ -246,13 +249,6 @@ public class CaseEvidenceServiceImpl implements ICaseEvidenceService {
246 249
                         .build();
247 250
                 int count = caseAttachMapper.save(caseAttach);
248 251
                 if (count > 0 && annexType != null && annexType != 8) {
249
-//                    if (id != null) {
250
-//                        //修改案件状态
251
-//                        CaseApplication caseApplication = new CaseApplication();
252
-//                        caseApplication.setId(id);
253
-//                        caseApplication.setCaseStatus(4);
254
-//                        caseApplicationMapper.submitCaseApplication(caseApplication);
255
-//                    }
256 252
                     CaseAttach caseAttachselect = new CaseAttach();
257 253
                     caseAttachselect.setAnnexId(caseAttach.getAnnexId());
258 254
                     caseAttachselect.setAnnexName(caseAttach.getAnnexName());
@@ -266,6 +262,44 @@ public class CaseEvidenceServiceImpl implements ICaseEvidenceService {
266 262
             e.printStackTrace();
267 263
             return AjaxResult.error("上传失败");
268 264
         }
265
+        // 给秘书发送短信
266
+        // 根据caseid查询该案件的法律顾问,根据案件id查申请表,查到申请机构id,然后拿申请机构id查询在哪个人下并且角色要是法律顾问
267
+        CaseAffiliate caseAffiliate = caseAffiliateMapper.selectCaseAffiliateByIdentityType(id, 1);
268
+        if(caseAffiliate!= null && StrUtil.isNotEmpty(caseAffiliate.getApplicationOrganId())){
269
+           List<SysUser> userList= sysUserMapper.selectByDeptIdAndRole(caseAffiliate.getApplicationOrganId(),"法律顾问");
270
+        if(CollectionUtil.isNotEmpty(userList)){
271
+            // 新增短信记录
272
+            SmsUtils.SendSmsRequest request = new SmsUtils.SendSmsRequest();
273
+            //  1992106	普通短信	修改证据资料通知	尊敬的{1}用户,您的{2}仲裁案件,有新的证据上传,请知晓,如非本人操作,请忽略本短信。
274
+            request.setTemplateId("1992106");
275
+            CaseApplication caseApplication = new CaseApplication();
276
+            caseApplication.setId(id);
277
+            caseApplication = caseApplicationMapper.selectCaseApplication(caseApplication);
278
+            for (SysUser user : userList) {
279
+                request.setPhone(user.getPhonenumber());
280
+                request.setTemplateParamSet(new String[]{user.getNickName(),caseApplication.getCaseNum()});
281
+                Boolean aBoolean = SmsUtils.sendSms(request);
282
+                //保存短信发送记录
283
+                SmsSendRecord smsSendRecord = new SmsSendRecord();
284
+                smsSendRecord.setCaseId(caseAffiliate.getCaseAppliId());
285
+
286
+                smsSendRecord.setCaseNum(caseApplication.getCaseNum());
287
+                smsSendRecord.setPhone(request.getPhone());
288
+                smsSendRecord.setSendTime(new Date());
289
+                String content = "尊敬的" + user.getNickName() + ",您的"+caseApplication.getCaseNum()+"仲裁案件,有新的证据上传,请知晓,如非本人操作,请忽略本短信。";
290
+                smsSendRecord.setSendContent(content);
291
+                smsSendRecord.setCreateBy(getUsername());
292
+                if (aBoolean) {
293
+                    smsSendRecord.setSendStatus(1);
294
+                } else {
295
+                    smsSendRecord.setSendStatus(0);
296
+                }
297
+                smsRecordMapper.saveSmsSendRecord(smsSendRecord);
298
+            }
299
+
300
+        }
301
+        }
302
+
269 303
 
270 304
         return AjaxResult.success("上传成功", successList);
271 305
 

+ 1
- 1
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/VideoServiceImpl.java Wyświetl plik

@@ -209,7 +209,7 @@ public class VideoServiceImpl implements VideoService {
209 209
             recordParams.setOutputFormat(0L); // 0:(默认)输出文件为hls格式。1:输出文件格式为hls+mp4。2:输出文件格式为hls+aac
210 210
             MixLayoutParams mixLayoutParams = new MixLayoutParams();
211 211
             // 	布局模式: 1:悬浮布局;2:屏幕分享布局;3:九宫格布局(默认);4:自定义布局;
212
-            mixLayoutParams.setMixLayoutMode(1L);
212
+            mixLayoutParams.setMixLayoutMode(3L);
213 213
             req.setMixLayoutParams(mixLayoutParams);
214 214
 
215 215
             StorageParams storageParams1 = new StorageParams();

+ 7
- 0
ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml Wyświetl plik

@@ -194,6 +194,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
194 194
 			left join sys_role r on r.role_id = ur.role_id
195 195
 		where u.id_card = #{idCard} and u.del_flag = '0' and u.status='0' order by u.create_time limit 1
196 196
 	</select>
197
+    <select id="selectByDeptIdAndRole" resultMap="SysUserResult">
198
+		select u.* from
199
+		               sys_user u
200
+		                join sys_user_role ur on u.user_id = ur.user_id
201
+		                join sys_role r on ur.role_id = r.role_id
202
+		where u.dept_id = #{deptId} and r.role_name = #{roleName} and u.del_flag = '0' and r.del_flag='0'
203
+	</select>
197 204
 
198 205
 
199 206
     <insert id="insertUser" parameterType="SysUser" useGeneratedKeys="true" keyProperty="userId">

+ 125
- 0
ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseAffiliateLogMapper.xml Wyświetl plik

@@ -0,0 +1,125 @@
1
+<?xml version="1.0" encoding="UTF-8" ?>
2
+<!DOCTYPE mapper
3
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
4
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
5
+<mapper namespace="com.ruoyi.wisdomarbitrate.mapper.CaseAffiliateLogMapper">
6
+
7
+    <resultMap type="com.ruoyi.wisdomarbitrate.domain.CaseAffiliate" id="CaseAffiliateResult">
8
+        <id     property="id"       column="id"      />
9
+        <result property="caseAppliLogId"       column="case_appli_log_id"      />
10
+        <result property="identityType"     column="identity_type"    />
11
+        <result property="name"     column="name"    />
12
+        <result property="identityNum"        column="identity_num"        />
13
+        <result property="workTelphone"  column="work_telphone"  />
14
+        <result property="contactTelphone"          column="contact_telphone"          />
15
+        <result property="contactAddress"       column="contact_address"       />
16
+        <result property="workAddress"     column="work_address"     />
17
+        <result property="nameAgent"       column="name_agent"       />
18
+        <result property="identityNumAgent"      column="identity_num_agent"     />
19
+        <result property="contactTelphoneAgent"      column="contact_telphone_agent"     />
20
+        <result property="contactAddressAgent"    column="contact_address_agent"   />
21
+        <result property="trackNum"    column="track_num"   />
22
+        <result property="applicationOrganId"    column="application_organ_id"   />
23
+        <result property="applicationOrganName"    column="application_organ_name"   />
24
+
25
+        <result property="compLegalPerson"    column="comp_legal_person"   />
26
+        <result property="compLegalperPost"    column="comp_legalper_post"   />
27
+        <result property="responSex"    column="respon_sex"   />
28
+        <result property="responBirth"    column="respon_birth"   />
29
+
30
+        <result property="residenAffili"    column="residen_affili"   />
31
+        <result property="appliAgentTitle"    column="appli_agent_title"   />
32
+        <result property="userId"    column="user_id"   />
33
+        <result property="email"     column="email"    />
34
+    </resultMap>
35
+
36
+    <select id="selectCaseAffiliate" parameterType="CaseAffiliate" resultMap="CaseAffiliateResult">
37
+        select c.id ,c.case_appli_log_id ,c.identity_type ,c.name ,c.identity_num ,c.contact_telphone ,c.contact_address ,
38
+        c.work_address ,c.work_telphone ,c.name_agent, c.identity_num_agent ,c.contact_telphone_agent ,c.contact_address_agent,
39
+        c.comp_legal_person,c.comp_legalper_post,c.respon_sex,c.respon_birth,
40
+        c.residen_affili,c.appli_agent_title,c.email,
41
+        c.track_num,c.application_organ_id,c.application_organ_name,s.user_id
42
+        from case_affiliate_log c
43
+        left join sys_user s on c.identity_num=s.id_card
44
+        <where>
45
+            <if test="caseAppliLogId != null ">
46
+                AND c.case_appli_log_id = #{caseAppliLogId}
47
+            </if>
48
+
49
+        </where>
50
+    </select>
51
+    <select id="selectCaseAffiliateByIdentityType"  resultMap="CaseAffiliateResult">
52
+        select c.id ,c.case_appli_log_id ,c.identity_type ,c.name ,c.identity_num ,c.contact_telphone ,c.contact_address ,
53
+        c.work_address ,c.work_telphone ,c.name_agent, c.identity_num_agent ,c.contact_telphone_agent ,c.contact_address_agent,
54
+        c.track_num,c.application_organ_id,c.application_organ_name
55
+        from case_affiliate_log c
56
+        <where>
57
+            <if test="caseAppliLogId != null ">
58
+                AND c.case_appli_log_id = #{caseAppliLogId}
59
+            </if>
60
+            <if test="identityType != null ">
61
+                AND c.identity_type = #{identityType}
62
+            </if>
63
+        </where>
64
+    </select>
65
+
66
+
67
+
68
+    <insert id="batchCaseAffiliate">
69
+        insert into case_affiliate_log(case_appli_log_id, identity_type,application_organ_id,application_organ_name,name,identity_num,contact_telphone,
70
+        contact_address,work_address,work_telphone ,name_agent,identity_num_agent,contact_telphone_agent,
71
+        comp_legal_person,comp_legalper_post,respon_sex ,respon_birth,
72
+        residen_affili,appli_agent_title,
73
+        contact_address_agent,email ) values
74
+        <foreach item="item" index="index" collection="list" separator=",">
75
+            (#{item.caseAppliLogId},#{item.identityType},#{item.applicationOrganId},#{item.applicationOrganName},#{item.name},#{item.identityNum},#{item.contactTelphone},
76
+            #{item.contactAddress},#{item.workAddress},#{item.workTelphone},  #{item.nameAgent},#{item.identityNumAgent},#{item.contactTelphoneAgent},
77
+            #{item.compLegalPerson},#{item.compLegalperPost},#{item.responSex},  #{item.responBirth},
78
+            #{item.residenAffili},#{item.appliAgentTitle},
79
+            #{item.contactAddressAgent},
80
+            #{item.email})
81
+        </foreach>
82
+    </insert>
83
+
84
+
85
+
86
+    <update id="updataCaseAffiliate" parameterType="CaseAffiliate">
87
+        update case_affiliate_log
88
+        set
89
+        case_appli_log_id=#{caseAppliLogId},
90
+        identity_type= #{identityType},
91
+        application_organ_id= #{applicationOrganId},
92
+        application_organ_name= #{applicationOrganName},
93
+        name = #{name},
94
+        identity_num = #{identityNum},
95
+        contact_telphone = #{contactTelphone},
96
+        contact_address = #{contactAddress},
97
+        work_address = #{workAddress},
98
+        work_telphone = #{workTelphone},
99
+
100
+        name_agent = #{nameAgent},
101
+        identity_num_agent = #{identityNumAgent},
102
+        contact_telphone_agent = #{contactTelphoneAgent},
103
+        contact_address_agent = #{contactAddressAgent},
104
+        send_email = #{sendEmail},
105
+        residen_affili = #{residenAffili},
106
+        email= #{email},
107
+        track_num = #{trackNum}
108
+
109
+        where id = #{id}
110
+
111
+    </update>
112
+
113
+    <delete id="deletecaseAffiliate" parameterType="CaseApplication">
114
+        delete from case_affiliate_log where case_appli_log_id = #{caseAppliLogId}
115
+    </delete>
116
+    <delete id="batchDeletecaseAffiliate">
117
+
118
+        delete from case_affiliate_log where case_appli_log_id in
119
+        <foreach collection="ids" item="item" open="(" separator="," close=")">
120
+            #{item}
121
+        </foreach>
122
+    </delete>
123
+
124
+
125
+</mapper>

+ 28
- 1
ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseAffiliateMapper.xml Wyświetl plik

@@ -56,7 +56,7 @@
56 56
             <if test="caseAppliId != null ">
57 57
                 AND c.case_appli_id = #{caseAppliId}
58 58
             </if>
59
-            <if test="caseAppliId != null ">
59
+            <if test="identityType != null ">
60 60
                 AND c.identity_type = #{identityType}
61 61
             </if>
62 62
         </where>
@@ -112,6 +112,33 @@
112 112
         where id = #{id}
113 113
 
114 114
     </update>
115
+    <update id="updateCaseAffiliateByCaseId">
116
+
117
+        <foreach collection="list" item="item" >
118
+        update case_affiliate
119
+            <set>
120
+
121
+            application_organ_id= #{item.applicationOrganId},
122
+            application_organ_name= #{item.applicationOrganName},
123
+            name = #{name},
124
+            identity_num = #{item.identityNum},
125
+            contact_telphone = #{item.contactTelphone},
126
+            contact_address = #{item.contactAddress},
127
+            work_address = #{item.workAddress},
128
+            work_telphone = #{item.workTelphone},
129
+
130
+            name_agent = #{item.nameAgent},
131
+            identity_num_agent = #{item.identityNumAgent},
132
+            contact_telphone_agent = #{item.contactTelphoneAgent},
133
+            contact_address_agent = #{item.contactAddressAgent},
134
+            send_email = #{item.sendEmail},
135
+            residen_affili = #{item.residenAffili},
136
+            email= #{item.email},
137
+            track_num = #{item.trackNum}
138
+            </set>
139
+        where case_appli_id = #{caseAppliId} and   identity_type= #{item.identityType};
140
+        </foreach>
141
+    </update>
115 142
 
116 143
     <delete id="deletecaseAffiliate" parameterType="CaseApplication">
117 144
         delete from case_affiliate where case_appli_id = #{id}

+ 158
- 0
ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationLogMapper.xml Wyświetl plik

@@ -0,0 +1,158 @@
1
+<?xml version="1.0" encoding="UTF-8" ?>
2
+<!DOCTYPE mapper
3
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
4
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
5
+<mapper namespace="com.ruoyi.wisdomarbitrate.mapper.CaseApplicationLogMapper">
6
+    <resultMap type="com.ruoyi.wisdomarbitrate.domain.CaseApplication" id="CaseApplicationResult">
7
+        <id     property="id"       column="id"      />
8
+        <result     property="caseAppliId"       column="caseAppliId"      />
9
+        <result property="caseNum"       column="case_num"      />
10
+        <result property="caseName"       column="case_name"      />
11
+        <result property="caseSubjectAmount"     column="case_subject_amount"    />
12
+        <result property="registerDate"     column="register_date"    />
13
+        <result property="arbitratMethod"        column="arbitrat_method"        />
14
+        <result property="caseStatus"  column="case_status"  />
15
+        <result property="hearDate"          column="hear_date"          />
16
+        <result property="arbitratClaims"       column="arbitrat_claims"       />
17
+        <result property="loanStartDate"     column="loan_start_date"     />
18
+        <result property="loanEndDate"       column="loan_end_date"       />
19
+        <result property="claimPrinciOwed"      column="claim_princi_owed"     />
20
+        <result property="claimInterestOwed"      column="claim_interest_owed"     />
21
+        <result property="claimLiquidDamag"    column="claim_liquid_damag"   />
22
+
23
+        <result property="feePayable"          column="fee_payable"          />
24
+        <result property="beginVideoDate"     column="begin_video_date"     />
25
+        <result property="onlineVideoPerson"       column="online_video_person"       />
26
+        <result property="contractNumber"      column="contract_number"     />
27
+        <result property="caseStatusName"      column="caseStatusName"     />
28
+        <result property="createBy"     column="create_by"    />
29
+        <result property="createTime"   column="create_time"  />
30
+        <result property="updateBy"     column="update_by"    />
31
+        <result property="updateTime"   column="update_time"  />
32
+        <result property="arbitratMethodName"   column="arbitratMethodName"  />
33
+
34
+        <result property="isAbsence"   column="is_absence"  />
35
+        <result property="responCrossOpin"   column="respon_cross_opin"  />
36
+        <result property="applicaCrossOpin"   column="applica_cross_opin"  />
37
+        <result property="responDefenOpini"   column="respon_defen_opini"  />
38
+
39
+        <result property="arbitratorId"   column="arbitrator_id"  />
40
+        <result property="arbitratorName"   column="arbitrator_name"  />
41
+        <result property="paymentStatus"   column="payment_status"  />
42
+        <result property="paymentStatusName"   column="paymentStatusName"  />
43
+        <result property="filearbitraUrl"   column="filearbitra_url"  />
44
+
45
+        <result property="requestRule"   column="request_rule"  />
46
+        <result property="properPreser"   column="proper_preser"  />
47
+        <result property="adjudicaCounter"   column="adjudica_counter"  />
48
+        <result property="lockStatus"   column="lock_status"  />
49
+        <result property="version"   column="version"  />
50
+        <result property="updateSubmitStatus"   column="update_submit_status"  />
51
+    </resultMap>
52
+    <insert id="insert" parameterType="com.ruoyi.wisdomarbitrate.domain.CaseApplication" useGeneratedKeys="true" keyProperty="id">
53
+        insert into case_application_log(
54
+        <if test="caseAppliId != null  ">case_appli_id ,</if>
55
+        <if test="caseName != null  and caseName != ''">case_name ,</if>
56
+        <if test="caseNum != null and caseNum != ''">case_num,</if>
57
+        <if test="caseSubjectAmount != null">case_subject_amount,</if>
58
+
59
+        <if test="arbitratClaims != null and arbitratClaims != ''">arbitrat_claims,</if>
60
+        <if test="requestRule != null and requestRule != ''">request_rule,</if>
61
+        <if test="loanStartDate != null ">loan_start_date,</if>
62
+        <if test="loanEndDate != null ">loan_end_date,</if>
63
+        <if test="claimPrinciOwed != null ">claim_princi_owed,</if>
64
+
65
+        <if test="claimInterestOwed != null ">claim_interest_owed,</if>
66
+        <if test="claimLiquidDamag != null ">claim_liquid_damag,</if>
67
+        <if test="feePayable != null ">fee_payable,</if>
68
+        <if test="contractNumber != null  and contractNumber != ''">contract_number,</if>
69
+        <if test="createBy != null  and createBy != ''">create_by,</if>
70
+        <if test="version != null ">version,</if>
71
+        <if test="updateSubmitStatus != null ">update_submit_status,</if>
72
+        create_time
73
+        )values(
74
+        <if test="caseAppliId != null">#{caseAppliId},</if>
75
+        <if test="caseName != null and caseName != ''">#{caseName},</if>
76
+        <if test="caseNum != null and caseNum != ''">#{caseNum},</if>
77
+        <if test="caseSubjectAmount != null">#{caseSubjectAmount},</if>
78
+
79
+        <if test="arbitratClaims != null and arbitratClaims != ''">#{arbitratClaims},</if>
80
+        <if test="requestRule != null and requestRule != ''">#{requestRule},</if>
81
+        <if test="loanStartDate != null ">#{loanStartDate},</if>
82
+        <if test="loanEndDate != null ">#{loanEndDate},</if>
83
+        <if test="claimPrinciOwed != null ">#{claimPrinciOwed},</if>
84
+
85
+        <if test="claimInterestOwed != null ">#{claimInterestOwed},</if>
86
+        <if test="claimLiquidDamag != null ">#{claimLiquidDamag},</if>
87
+        <if test="feePayable != null ">#{feePayable},</if>
88
+        <if test="contractNumber != null  and contractNumber != ''">#{contractNumber},</if>
89
+        <if test="createBy != null  and createBy != ''">#{createBy},</if>
90
+        <if test="version != null ">#{version},</if>
91
+        <if test="updateSubmitStatus != null ">#{updateSubmitStatus},</if>
92
+        sysdate()
93
+        )
94
+    </insert>
95
+    <update id="updateStatus">
96
+        update case_application_log
97
+
98
+        <set>
99
+            <if test="updateSubmitStatus!= null ">update_submit_status=#{updateSubmitStatus},</if>
100
+
101
+        </set>
102
+        <where>
103
+            <if test="caseId!= null ">AND case_appli_id=#{caseId}</if>
104
+            <if test="version!= null ">AND version=#{version}</if>
105
+
106
+        </where>
107
+    </update>
108
+
109
+    <delete id="deleteById" >
110
+        DELETE FROM case_application_log
111
+        WHERE id = #{id}
112
+    </delete>
113
+    <delete id="batchDeleteLog">
114
+        delete a from case_affiliate_log  a
115
+        join case_application_log l on l.id=a.case_appli_log_id
116
+        where l.id in (
117
+        <foreach collection="ids" item="id" separator=",">
118
+            #{id}
119
+        </foreach>
120
+        );
121
+
122
+        delete from case_application_log l where l.id in (
123
+        <foreach collection="ids" item="id" separator=",">
124
+            #{id}
125
+        </foreach>
126
+        );
127
+    </delete>
128
+
129
+
130
+    <select id="selectByCaseIdAndVersion" resultMap="CaseApplicationResult">
131
+        SELECT id caseLogId,case_appli_id caseAppliId ,case_name,case_num,case_subject_amount,arbitrat_claims,request_rule,loan_start_date,
132
+               loan_end_date,claim_princi_owed,claim_interest_owed,claim_liquid_damag,fee_payable,contract_number,
133
+               create_by,version,update_submit_status,create_time
134
+        FROM case_application_log
135
+        WHERE case_appli_id = #{caseAppliId} and version=#{version}
136
+    </select>
137
+
138
+    <select id="selectLatestCase" resultMap="CaseApplicationResult">
139
+        SELECT id caseLogId,case_appli_id caseAppliId ,case_name,case_num,case_subject_amount,arbitrat_claims,request_rule,loan_start_date,
140
+               loan_end_date,claim_princi_owed,claim_interest_owed,claim_liquid_damag,fee_payable,contract_number,
141
+               create_by,version,update_submit_status,create_time
142
+        FROM case_application_log
143
+        WHERE case_appli_id = #{caseAppliId} ORDER BY version DESC limit 1
144
+    </select>
145
+    <select id="selectMaxVersionByCaseId" resultType="java.lang.Integer">
146
+        SELECT max(version)
147
+        FROM case_application_log
148
+        WHERE case_appli_id = #{caseAppliId}
149
+
150
+    </select>
151
+    <select id="selectMaxVersionBySecret" resultType="java.lang.Integer">
152
+        SELECT max(version)
153
+        FROM case_application_log
154
+        WHERE case_appli_id = #{caseAppliId} and update_submit_status IN ( 1, 4 )
155
+    </select>
156
+
157
+
158
+</mapper>

+ 962
- 25
ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml
Plik diff jest za duży
Wyświetl plik