Просмотр исходного кода

Merge branch 'wq1' of SH-Arbitrate/Mediation-Backend into dev

wangqiong123 2 лет назад
Родитель
Сommit
b8a424465c
21 измененных файлов: 738 добавлений и 569 удалений
  1. 17
    17
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/common/CommonController.java
  2. 14
    9
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/mscase/MsCaseApplicationController.java
  3. 6
    12
      ruoyi-common/src/main/java/com/ruoyi/common/utils/EmailOutUtil.java
  4. 10
    2
      ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysUserRoleMapper.java
  5. 1
    2
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/dto/casenumrule/CaseNumRule.java
  6. 1
    1
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/dto/dept/SealManage.java
  7. 0
    58
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/dto/mscase/CaseAttach.java
  8. 16
    7
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/entity/mscase/MsCaseApplication.java
  9. 12
    4
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/entity/mscase/MsCaseAttach.java
  10. 10
    7
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/vo/mscase/MsCaseApplicationReq.java
  11. 16
    398
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/vo/mscase/MsCaseApplicationVO.java
  12. 101
    0
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/mscase/MsCaseApplicationMapper.java
  13. 9
    9
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/mscase/MsCaseAttachLogMapper.java
  14. 9
    9
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/mscase/MsCaseAttachMapper.java
  15. 5
    5
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/dept/impl/DeptIdentifyServiceImpl.java
  16. 4
    2
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/mscase/MsCaseApplicationService.java
  17. 258
    7
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/mscase/impl/MsCaseApplicationServiceImpl.java
  18. 225
    0
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/utils/FixSelectFlowDetailUtils.java
  19. 4
    0
      ruoyi-system/src/main/resources/mapper/system/SysUserRoleMapper.xml
  20. 10
    10
      ruoyi-system/src/main/resources/mapper/wisdomarbitrate/mscase/MsCaseAttachLogMapper.xml
  21. 10
    10
      ruoyi-system/src/main/resources/mapper/wisdomarbitrate/mscase/MsCaseAttachMapper.xml

+ 17
- 17
ruoyi-admin/src/main/java/com/ruoyi/web/controller/common/CommonController.java Просмотреть файл

@@ -1,13 +1,15 @@
1 1
 package com.ruoyi.web.controller.common;
2 2
 
3
-import java.util.ArrayList;
4
-import java.util.List;
5
-import javax.servlet.http.HttpServletRequest;
6
-import javax.servlet.http.HttpServletResponse;
7
-
3
+import com.ruoyi.common.config.RuoYiConfig;
4
+import com.ruoyi.common.constant.Constants;
5
+import com.ruoyi.common.core.domain.AjaxResult;
8 6
 import com.ruoyi.common.utils.SecurityUtils;
7
+import com.ruoyi.common.utils.StringUtils;
8
+import com.ruoyi.common.utils.file.FileUploadUtils;
9
+import com.ruoyi.common.utils.file.FileUtils;
10
+import com.ruoyi.framework.config.ServerConfig;
11
+import com.ruoyi.wisdomarbitrate.domain.entity.mscase.MsCaseAttach;
9 12
 import com.ruoyi.wisdomarbitrate.domain.vo.mscase.MsCaseApplicationVO;
10
-import com.ruoyi.wisdomarbitrate.domain.dto.mscase.CaseAttach;
11 13
 import com.ruoyi.wisdomarbitrate.mapper.mscase.MsCaseAttachMapper;
12 14
 import org.slf4j.Logger;
13 15
 import org.slf4j.LoggerFactory;
@@ -15,13 +17,11 @@ import org.springframework.beans.factory.annotation.Autowired;
15 17
 import org.springframework.http.MediaType;
16 18
 import org.springframework.web.bind.annotation.*;
17 19
 import org.springframework.web.multipart.MultipartFile;
18
-import com.ruoyi.common.config.RuoYiConfig;
19
-import com.ruoyi.common.constant.Constants;
20
-import com.ruoyi.common.core.domain.AjaxResult;
21
-import com.ruoyi.common.utils.StringUtils;
22
-import com.ruoyi.common.utils.file.FileUploadUtils;
23
-import com.ruoyi.common.utils.file.FileUtils;
24
-import com.ruoyi.framework.config.ServerConfig;
20
+
21
+import javax.servlet.http.HttpServletRequest;
22
+import javax.servlet.http.HttpServletResponse;
23
+import java.util.ArrayList;
24
+import java.util.List;
25 25
 
26 26
 /**
27 27
  * 通用请求处理
@@ -108,12 +108,12 @@ public class CommonController
108 108
      * @param originalFilename
109 109
      */
110 110
     private void saveCaseAttach(Long id, Integer annexType, String fileName, String originalFilename) {
111
-        CaseAttach caseAttach = CaseAttach.builder().caseAppliId(id)
111
+        MsCaseAttach caseAttach = MsCaseAttach.builder().caseAppliId(id)
112 112
                 .annexName(originalFilename)
113 113
                 .annexPath(fileName)
114 114
                 .annexType(annexType)
115
-                .userId(SecurityUtils.getUserId())
116
-                .userName(SecurityUtils.getUsername())
115
+                .useId(SecurityUtils.getUserId())
116
+                .useAccount(SecurityUtils.getUsername())
117 117
                 .build();
118 118
         msCaseAttachMapper.save(caseAttach);
119 119
     }
@@ -132,7 +132,7 @@ public class CommonController
132 132
         MsCaseApplicationVO msCaseApplicationVO = new MsCaseApplicationVO();
133 133
         msCaseApplicationVO.setId(caseAppliId);
134 134
         msCaseApplicationVO.setAnnexTypeList(annexTypeList);
135
-        List<CaseAttach> caseAttachList = msCaseAttachMapper.queryCaseAttachList(msCaseApplicationVO);
135
+        List<MsCaseAttach> caseAttachList = msCaseAttachMapper.queryCaseAttachList(msCaseApplicationVO);
136 136
         return AjaxResult.success(caseAttachList);
137 137
     }
138 138
 

+ 14
- 9
ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/mscase/MsCaseApplicationController.java Просмотреть файл

@@ -1,14 +1,12 @@
1 1
 package com.ruoyi.web.controller.wisdomarbitrate.mscase;
2 2
 
3 3
 import com.ruoyi.common.core.controller.BaseController;
4
+import com.ruoyi.common.core.domain.AjaxResult;
4 5
 import com.ruoyi.common.core.page.TableDataInfo;
5
-import com.ruoyi.wisdomarbitrate.domain.entity.mscase.MsCaseApplication;
6 6
 import com.ruoyi.wisdomarbitrate.domain.vo.mscase.MsCaseApplicationReq;
7
+import com.ruoyi.wisdomarbitrate.domain.vo.mscase.MsCaseApplicationVO;
7 8
 import com.ruoyi.wisdomarbitrate.service.mscase.MsCaseApplicationService;
8
-import org.springframework.security.access.prepost.PreAuthorize;
9
-import org.springframework.web.bind.annotation.GetMapping;
10
-import org.springframework.web.bind.annotation.RequestMapping;
11
-import org.springframework.web.bind.annotation.RestController;
9
+import org.springframework.web.bind.annotation.*;
12 10
 
13 11
 import javax.annotation.Resource;
14 12
 import java.util.List;
@@ -27,15 +25,22 @@ public class MsCaseApplicationController extends BaseController {
27 25
     /**
28 26
      * 分页查询案件列表
29 27
      */
30
-    @PreAuthorize("@ss.hasPermi('caseApplication:list')")
31
-    @GetMapping("/page")
32
-    public TableDataInfo list(MsCaseApplicationReq req)
28
+    @GetMapping("/list")
29
+    public TableDataInfo page(MsCaseApplicationReq req)
33 30
     {
34 31
         startPage();
35
-        List<MsCaseApplication> list = caseApplicationService.list(req);
32
+        List<MsCaseApplicationVO> list = caseApplicationService.list(req);
36 33
         return getDataTable(list);
37 34
     }
35
+    /**
36
+     * 新增案件
37
+     */
38
+    @PostMapping("/insert")
39
+    public AjaxResult insert(@RequestBody MsCaseApplicationVO caseApplication )
40
+    {
38 41
 
42
+        return success(caseApplicationService.insert(caseApplication));
43
+    }
39 44
 
40 45
 
41 46
 

+ 6
- 12
ruoyi-common/src/main/java/com/ruoyi/common/utils/EmailOutUtil.java Просмотреть файл

@@ -1,33 +1,28 @@
1 1
 package com.ruoyi.common.utils;
2 2
 
3 3
 
4
-
5 4
 import com.ruoyi.common.utils.uuid.UUID;
6
-import com.sun.net.ssl.internal.ssl.Provider;
7 5
 import lombok.Data;
8 6
 import lombok.extern.slf4j.Slf4j;
9 7
 import org.springframework.beans.factory.annotation.Value;
10 8
 import org.springframework.mail.SimpleMailMessage;
11
-
12 9
 import org.springframework.mail.javamail.JavaMailSender;
13 10
 import org.springframework.mail.javamail.JavaMailSenderImpl;
14 11
 import org.springframework.mail.javamail.MimeMessageHelper;
15 12
 import org.springframework.stereotype.Component;
16 13
 
17
-import javax.activation.DataHandler;
18 14
 import javax.mail.*;
19 15
 import javax.mail.internet.*;
20
-import javax.mail.search.*;
21
-import javax.mail.util.ByteArrayDataSource;
16
+import javax.mail.search.SearchTerm;
17
+import javax.mail.search.SubjectTerm;
22 18
 import javax.validation.constraints.NotNull;
23
-import java.io.*;
24
-import java.nio.file.Files;
25
-import java.nio.file.Paths;
26
-import java.security.Security;
19
+import java.io.BufferedReader;
20
+import java.io.File;
21
+import java.io.InputStream;
22
+import java.io.InputStreamReader;
27 23
 import java.util.*;
28 24
 import java.util.regex.Matcher;
29 25
 import java.util.regex.Pattern;
30
-import java.util.stream.Stream;
31 26
 
32 27
 /**
33 28
  * @ClassName EmailInUtil
@@ -103,7 +98,6 @@ public class EmailOutUtil {
103 98
             MimeBodyPart messageBodyPart = new MimeBodyPart();
104 99
             messageBodyPart.setContent(messageContent, "text/html;charset=utf-8");
105 100
             messageBodyPart.setContentID(UUID.randomUUID().toString());
106
-            Security.addProvider(new Provider());
107 101
             final String SSL_FACTORY = "javax.net.ssl.SSLSocketFactory";
108 102
             //设置邮件会话参数
109 103
             Properties props = new Properties();

+ 10
- 2
ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysUserRoleMapper.java Просмотреть файл

@@ -1,8 +1,9 @@
1 1
 package com.ruoyi.system.mapper;
2 2
 
3
-import java.util.List;
4
-import org.apache.ibatis.annotations.Param;
5 3
 import com.ruoyi.system.domain.SysUserRole;
4
+import org.apache.ibatis.annotations.Param;
5
+
6
+import java.util.List;
6 7
 
7 8
 /**
8 9
  * 用户与角色关联表 数据层
@@ -59,4 +60,11 @@ public interface SysUserRoleMapper
59 60
      * @return 结果
60 61
      */
61 62
     public int deleteUserRoleInfos(@Param("roleId") Long roleId, @Param("userIds") Long[] userIds);
63
+
64
+    /**
65
+     * 新增
66
+     * @param userId
67
+     * @param roleId
68
+     */
69
+    void insertUserRole(@Param("userId")Long userId, @Param("roleId")Long roleId);
62 70
 }

+ 1
- 2
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/dto/casenumrule/CaseNumRule.java Просмотреть файл

@@ -1,6 +1,5 @@
1 1
 package com.ruoyi.wisdomarbitrate.domain.dto.casenumrule;
2 2
 
3
-import com.ruoyi.common.annotation.Excel;
4 3
 import com.ruoyi.common.core.domain.BaseEntity;
5 4
 import lombok.Data;
6 5
 
@@ -13,7 +12,7 @@ public class CaseNumRule   extends BaseEntity {
13 12
     /** 前缀 */
14 13
     private String prefixstr;
15 14
     /** 时间格式 */
16
-    private Integer dateFormat;
15
+    private String dateFormat;
17 16
     /** 机构名称 */
18 17
     private String deptName;
19 18
     /** 机构名称首字符拼写 */

+ 1
- 1
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/dto/dept/SealManage.java Просмотреть файл

@@ -29,7 +29,7 @@ public class SealManage extends BaseEntity {
29 29
     /**
30 30
      * 附件id
31 31
      */
32
-    private Integer annexId;
32
+    private Long annexId;
33 33
 
34 34
     /**
35 35
      * 印章审核状态(0未通过,1通过)

+ 0
- 58
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/dto/mscase/CaseAttach.java Просмотреть файл

@@ -1,58 +0,0 @@
1
-package com.ruoyi.wisdomarbitrate.domain.dto.mscase;
2
-
3
-import lombok.AllArgsConstructor;
4
-import lombok.Builder;
5
-import lombok.Data;
6
-import lombok.NoArgsConstructor;
7
-
8
-@Data
9
-@Builder
10
-@AllArgsConstructor
11
-@NoArgsConstructor
12
-public class  CaseAttach {
13
-    /**
14
-     *  附件id
15
-     */
16
-    private Integer annexId;
17
-    /**
18
-     * 案件申请id
19
-     */
20
-    private Long caseAppliId;
21
-    /**
22
-     * 案件记录id
23
-     */
24
-    private Long caseAppliLogId;
25
-    /**
26
-     * 附件名称
27
-     */
28
-    private String annexName;
29
-    /**
30
-     * 附件路径
31
-     */
32
-    private String annexPath;
33
-    /**
34
-     * 附件类型,立案申请书(1)、申请人证据材料(2)、仲裁文书(3)、案件视频(4)、身份证件(5)、被申请人证据材料 (6)、庭审笔录(7)、缴费凭证(8)'
35
-     */
36
-    private Integer annexType;
37
-    /**
38
-     * 备注
39
-     */
40
-    private String note;
41
-    /**
42
-     * 用户id
43
-     */
44
-    private Long userId;
45
-    /**
46
-     * 用户账户
47
-     */
48
-    private String userName;
49
-    /**
50
-     * 印章状态(0未启用,1已启用)
51
-     */
52
-    private Integer sealStatus;
53
-    /**
54
-     * 是否是证据上传,0-否,1-是
55
-     */
56
-    private Integer isBatchUpload;
57
-
58
-}

+ 16
- 7
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/entity/mscase/MsCaseApplication.java Просмотреть файл

@@ -1,12 +1,16 @@
1 1
 package com.ruoyi.wisdomarbitrate.domain.entity.mscase;
2 2
 
3
-import java.math.BigDecimal;
4
-import java.util.Date;
5
-import javax.persistence.*;
6 3
 import lombok.Getter;
7 4
 import lombok.Setter;
8 5
 import lombok.ToString;
9 6
 
7
+import javax.persistence.Column;
8
+import javax.persistence.GeneratedValue;
9
+import javax.persistence.Id;
10
+import javax.persistence.Table;
11
+import java.math.BigDecimal;
12
+import java.util.Date;
13
+
10 14
 @Getter
11 15
 @Setter
12 16
 @ToString
@@ -23,7 +27,7 @@ public class MsCaseApplication {
23 27
      * 批次
24 28
      */
25 29
     @Column(name = "batch_number")
26
-    private Integer batchNumber;
30
+    private String batchNumber;
27 31
 
28 32
     /**
29 33
      * 模板id
@@ -50,10 +54,15 @@ public class MsCaseApplication {
50 54
     private String mediationMethod;
51 55
 
52 56
     /**
53
-     * 案件状态,字典
57
+     * 案件状态
58
+     */
59
+    @Column(name = "case_status_name")
60
+    private String caseStatusName;
61
+    /**
62
+     * 案件流程id
54 63
      */
55
-    @Column(name = "case_status")
56
-    private Integer caseStatus;
64
+    @Column(name = "case_flow_id")
65
+    private Integer caseFlowId;
57 66
 
58 67
     /**
59 68
      * 开庭日期

+ 12
- 4
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/entity/mscase/MsCaseAttach.java Просмотреть файл

@@ -1,13 +1,17 @@
1 1
 package com.ruoyi.wisdomarbitrate.domain.entity.mscase;
2 2
 
3
-import javax.persistence.*;
4
-import lombok.Getter;
5
-import lombok.Setter;
6
-import lombok.ToString;
3
+import lombok.*;
4
+
5
+import javax.persistence.Column;
6
+import javax.persistence.Id;
7
+import javax.persistence.Table;
7 8
 
8 9
 @Getter
9 10
 @Setter
10 11
 @ToString
12
+@NoArgsConstructor
13
+@AllArgsConstructor
14
+@Builder
11 15
 @Table(name = "ms_case_attach")
12 16
 public class MsCaseAttach {
13 17
     /**
@@ -22,6 +26,10 @@ public class MsCaseAttach {
22 26
      */
23 27
     @Column(name = "case_appli_id")
24 28
     private Long caseAppliId;
29
+    /**
30
+     * 案件日志id
31
+     */
32
+    private Long caseAppliLogId;
25 33
 
26 34
     /**
27 35
      * 附件名称

+ 10
- 7
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/vo/mscase/MsCaseApplicationReq.java Просмотреть файл

@@ -4,8 +4,6 @@ import lombok.AllArgsConstructor;
4 4
 import lombok.Data;
5 5
 import lombok.NoArgsConstructor;
6 6
 
7
-import java.util.Date;
8
-
9 7
 @NoArgsConstructor
10 8
 @AllArgsConstructor
11 9
 @Data
@@ -13,7 +11,7 @@ public class MsCaseApplicationReq {
13 11
     /**
14 12
      * 批次
15 13
      */
16
-    private Integer batchNumber;
14
+    private String batchNumber;
17 15
 
18 16
     /**
19 17
      * 案件编号
@@ -24,12 +22,17 @@ public class MsCaseApplicationReq {
24 22
      */
25 23
     private String applicationOrganId;
26 24
     /**
27
-     * 案件状态,字典
25
+     * 案件状态
26
+     */
27
+    private String caseStatusName;
28
+    /**
29
+     * 开始时间
28 30
      */
29
-    private Integer caseStatus;
31
+    private String startTime;
30 32
     /**
31
-     * 创建时间
33
+     * 结束时间
32 34
      */
33
-    private Date createTime;
35
+    private String endTime;
36
+    private String userName;
34 37
 
35 38
 }

+ 16
- 398
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/vo/mscase/MsCaseApplicationVO.java Просмотреть файл

@@ -1,414 +1,32 @@
1 1
 package com.ruoyi.wisdomarbitrate.domain.vo.mscase;
2 2
 
3
-import com.fasterxml.jackson.annotation.JsonFormat;
4
-import com.ruoyi.common.annotation.Excel;
5
-import com.ruoyi.common.core.domain.BaseEntity;
6
-import com.ruoyi.wisdomarbitrate.domain.dto.mscase.CaseAttach;
3
+import com.ruoyi.wisdomarbitrate.domain.entity.mscase.MsCaseAffiliate;
4
+import com.ruoyi.wisdomarbitrate.domain.entity.mscase.MsCaseApplication;
5
+import com.ruoyi.wisdomarbitrate.domain.entity.mscase.MsCaseAttach;
6
+import lombok.AllArgsConstructor;
7 7
 import lombok.Data;
8
+import lombok.NoArgsConstructor;
8 9
 
9
-import java.math.BigDecimal;
10
-import java.util.Date;
11 10
 import java.util.List;
12 11
 
12
+/**
13
+ * 案件信息VO
14
+ */
15
+@NoArgsConstructor
16
+@AllArgsConstructor
13 17
 @Data
14
-public class MsCaseApplicationVO extends BaseEntity {
15
-    private static final long serialVersionUID = 1L;
18
+public class MsCaseApplicationVO extends MsCaseApplication {
16 19
     /**
17
-     * 查询案件时区分是否待办案件,0待办案件,1已办案件
20
+     * 案件相关人员
18 21
      */
19
-    private String selectCaseStatus;
20
-
21
-    /** ID */
22
-    private Long id;
23
-    /** 案件名称 */
24
-    @Excel(name = "案件名称")
25
-    private String caseName;
26
-    /** 案件编号 */
27
-//    @Excel(name = "案件编号")
28
-    private String caseNum;
29
-    /** 案件标的 */
30
-    @Excel(name = "案件标的")
31
-    private BigDecimal caseSubjectAmount;
32
-    /**
33
-     * 模板id
34
-     */
35
-    private Long templateId;
36
-
37
-
38
-
39
-    /** 立案日期 */
40
-    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
41
-    private Date registerDate;
42
-    /** 仲裁方式 */
43
-    private Integer arbitratMethod;
44
-    /**
45
-     * 是否导入,0手动录入,1导入,默认0
46
-     */
47
-    private Integer importFlag;
48
-    /** 仲裁方式名称 */
49
-    private String arbitratMethodName;
50
-
51
-    /** 案件状态 */
52
-    private Integer caseStatus;
53
-
54
-    /** 申请人是否书面审理 */
55
-    private Integer applicantIsWrittenHear;
56
-
57
-    /** 被申请人是否书面审理 */
58
-    private Integer respondentIsWrittenHear;
59
-    /** 开庭方式是否一致 */
60
-    private Integer arbitraMethodIssame;
61
-    /** 仲裁方式说明 */
62
-    private String arbitratMethodIllustrate;
63
-
64
-
65
-    /** 案件申请表ID */
66
-    private Long caseAppliId;
67
-
68
-    /** 开庭日期 */
69
-    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
70
-    private Date hearDate;
71
-
72
-    /** 借款开始日期 */
73
-    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
74
-    @Excel(name = "借款开始日期")
75
-    private Date loanStartDate;
76
-    /** 借款结束日期 */
77
-    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
78
-    @Excel(name = "借款结束日期")
79
-    private Date loanEndDate;
80
-    /** 合同编号 */
81
-    @Excel(name = "合同编号")
82
-    private String contractNumber;
83
-    /** 申请人主张欠本金 */
84
-    @Excel(name = "申请人主张欠本金")
85
-    private BigDecimal claimPrinciOwed;
86
-    /** 申请人主张欠利息 */
87
-    @Excel(name = "申请人主张欠利息")
88
-    private BigDecimal claimInterestOwed;
89
-    /** 申请人主张违约金 */
90
-    @Excel(name = "申请人主张违约金")
91
-    private BigDecimal claimLiquidDamag;
92
-    /** 申请人请求仲裁庭裁决 */
93
-    @Excel(name = "申请人请求仲裁庭裁决",width = 36)
94
-    private String requestRule;
95
-
96
-    /** 是否财产保全申请 */
97
-    @Excel(name = "是否财产保全申请",width = 26,combo= {"是","否"},readConverterExp = "0=否,1=是")
98
-    private Integer properPreser;
99
-    /** 申请人仲裁请求及事实和理由 */
100
-    @Excel(name = "申请人仲裁请求及事实和理由",width = 36)
101
-    private String arbitratClaims;
102
-    /** 仲裁应缴费用 */
103
-    private BigDecimal feePayable;
104
-
105
-    /** 开始在线视频时间 */
106
-    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
107
-    private Date beginVideoDate;
108
-    /** 在线视频人员 */
109
-    private String onlineVideoPerson;
110
-
111
-    /** 仲裁员id */
112
-    private String arbitratorId;
113
-    /** 仲裁员名称 */
114
-    private String arbitratorName;
115
-
116
-    /** 案件描述 */
117
-    private String caseDescribe;
118
-    /** 裁决书URL */
119
-    private String  filearbitraUrl;
120
-
121
-    /** 是否同意组庭 */
122
-    private Integer isAgreePendTral;
123
-
124
-    /** 是否有异议需要举证 */
125
-    private Integer objectionAddEviden;
126
-    /** 是否需要开庭审理 */
127
-    private Integer openCourtHear;
128
-
129
-    /** 是否仲裁反请求 */
130
-    private Integer adjudicaCounter;
22
+    private MsCaseAffiliate affiliate;
131 23
     /**
132
-     * 仲裁反请求原因
24
+     * 案件附件相关表
133 25
      */
134
-    private String adjudicaCounterReason;
135
-
136
-    /** 被申请人是否缺席 */
137
-    private Integer isAbsence;
138
-    /** 是否管辖异议申请 */
139
-    private Integer objectiJuris;
140
-    /** 被申请人质证意见 */
141
-    private String responCrossOpin;
142
-    /** 被申请人的答辩意见 */
143
-    private String responDefenOpini;
144
-    /** 申请人是否缺席 */
145
-    private Integer appliIsAbsen;
146
-
147
-    /** 申请人质证意见 */
148
-    private String applicaCrossOpin;
149
-
150
-    /** 支付状态 */
151
-    private Integer paymentStatus;
152
-
153
-    /** 支付状态描述 */
154
-    private String paymentStatusName;
26
+    private List<MsCaseAttach> caseAttachList;
155 27
     /**
156
-     * 支付方式code,0线上支付,1线下支付
28
+     * 附件类型
157 29
      */
158
-    private Integer payTypeCode;
159
-    /**
160
-     * 支付方式name,0线上支付,1线下支付
161
-     */
162
-    private String payTypeName;
163
-
164
-
165
-    /**
166
-     * 缴费凭证
167
-     */
168
-    private List<CaseAttach> payOrderList;
169
-    // 导入校验失败信息
170
-    private StringBuilder errorMsg;
171
-    /**
172
-     * 是否锁定,0-否,1-是
173
-     */
174
-    private Integer lockStatus;
175
-    /** 案件状态名称 */
176
-    private String caseStatusName;
177
-    /** 是否同意审核 */
178
-    private Integer agreeOrNotCheck;
179
-    /** 申请人名称 */
180
-    private String applicantName;
181
-    /** 被申请人名称 */
182
-    private String respondentName;
183
-    /**
184
-     * 用户身份证号
185
-     */
186
-    private String idCard;
187
-    /**
188
-     * 用户id
189
-     */
190
-    private String userId;
191
-    /**
192
-     * 登录用户用户名
193
-     */
194
-    private String loginUserName;
195
-    private List<Long> deptIds;
196
-    /**
197
-     * 部门长状态
198
-     */
199
-    private List<Integer> deptHeadStatus;
200
-    /**
201
-     * 代理人角色有关部门
202
-     */
203
-    private List<Long> agentDeptIds;
204
-    /**
205
-     * 财务状态
206
-     */
207
-    private Integer financeStatus;
208
-    /**
209
-     * 是否是被申请人,仲裁员,部门长,财务,代理人,0-否,1-是
210
-     */
211
-    private Integer isOtherRole;
212
-    /**
213
-     * 案件日志id
214
-     */
215
-    private Long caseLogId;
216
-    /** 仲裁结果 */
217
-    private String caseResult;
218
-    /** 是否指派仲裁员 */
219
-    private int pendingAppointArbotrar;
220
-
221
-
222
-    private List<Integer> caseStatusList;
223
-
224 30
     private List<Integer> annexTypeList;
225 31
 
226
-    private Integer annexType;
227
-    /**
228
-     * 案件附件列表
229
-     */
230
-    private List<CaseAttach> caseAttachList;
231
-
232
-    /** 身份类型 */
233
-//    @Excel(name = "身份类型")
234
-    private int identityType;
235
-    /**
236
-     * 申请人主体信息
237
-     */
238
-    /** 姓名 */
239
-    @Excel(name = "申请人主体信息-申请人(机构)",width = 26)
240
-    private String name;
241
-    /** 身份证号 */
242
-    @Excel(name = "申请人主体信息-代码",width = 26)
243
-    private String identityNum;
244
-    /** 申请人主体信息-法定代表人 */
245
-    @Excel(name = "申请人主体信息-法定代表人",width = 26)
246
-    private String compLegalPerson;
247
-    /** 申请人主体信息-法定代表人 */
248
-    @Excel(name = "申请人主体信息-法定代表人职位",width = 26)
249
-    private String compLegalperPost;
250
-    /**
251
-     * 申请人主体信息-申请人(机构)id
252
-     */
253
-    private String nameId;
254
-
255
-    /** 联系电话 */
256
-    @Excel(name = "申请人主体信息-联系电话",width = 26)
257
-    private String contactTelphone;
258
-    /** 联系地址 */
259
-    @Excel(name = "申请人主体信息-联系地址",width = 26)
260
-    private String contactAddress;
261
-    /** 单位电话 */
262
-    @Excel(name = "申请人主体信息-单位电话",width = 26)
263
-    private String workTelphone;
264
-    /** 单位地址 */
265
-    @Excel(name = "申请人主体信息-单位地址",width = 26)
266
-    private String workAddress;
267
-
268
-    /** 申请人住所 */
269
-    @Excel(name = "申请人主体信息-住所",width = 26)
270
-    private String residenAffiliAppli;
271
-
272
-    /** 申请人邮箱 */
273
-    @Excel(name = "申请人主体信息-邮箱",width = 26)
274
-    private String email;
275
-    /** 代理人姓名 */
276
-    @Excel(name = "申请人主体信息-代理人姓名",width = 26)
277
-    private String nameAgent;
278
-    /** 身份证号 */
279
-    @Excel(name = "申请人主体信息-代理人身份证号",width = 26)
280
-    private String identityNumAgent;
281
-
282
-    /** 联系电话 */
283
-    @Excel(name = "申请人主体信息-代理人联系电话",width = 26)
284
-    private String contactTelphoneAgent;
285
-    /** 联系地址 */
286
-    @Excel(name = "申请人主体信息-代理人联系地址",width = 26)
287
-    private String contactAddressAgent;
288
-    /** 申请人代理人职称 */
289
-    @Excel(name = "申请人主体信息-代理人职称",width = 26)
290
-    private String appliAgentTitle;
291
-   /**
292
-     * 被申请人主体信息
293
-     */
294
-    /** 姓名 */
295
-    @Excel(name = "被申请人主体信息-申请人姓名",width = 26)
296
-    private String debtorName;
297
-    /** 身份证号 */
298
-    @Excel(name = "被申请人主体信息-身份证号",width = 26)
299
-    private String debtorIdentityNum;
300
-    /** 被申请人主体信息-性别 */
301
-    @Excel(name = "被申请人主体信息-性别",width = 26,combo= {"男","女"},readConverterExp = "0=男,1=女")
302
-    private String responSex;
303
-    /** 被申请人主体信息-出生年月日 */
304
-    @Excel(name = "被申请人主体信息-出生年月日",width = 26)
305
-    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
306
-    private Date responBirth;
307
-    /** 联系电话 */
308
-    @Excel(name = "被申请人主体信息-联系电话",width = 26)
309
-    private String debtorContactTelphone;
310
-    /** 联系地址 */
311
-    @Excel(name = "被申请人主体信息-联系地址",width = 26)
312
-    private String debtorContactAddress;
313
-    /** 被申请人住所 */
314
-    @Excel(name = "被申请人主体信息-住所",width = 26)
315
-    private String residenAffiliRespon;
316
-    /** 单位电话 */
317
-    @Excel(name = "被申请人主体信息-单位电话",width = 26)
318
-    private String debtorWorkTelphone;
319
-    /** 单位地址 */
320
-    @Excel(name = "被申请人主体信息-单位地址",width = 26)
321
-    private String debtorWorkAddress;
322
-    /** 邮箱 */
323
-    @Excel(name = "被申请人主体信息-邮箱",width = 26)
324
-    private String debtorEmail;
325
-
326
-    /** 代理人姓名 */
327
-    @Excel(name = "被申请人主体信息-代理人姓名",width = 26)
328
-    private String debtorNameAgent;
329
-    /** 身份证号 */
330
-    @Excel(name = "被申请人主体信息-代理人身份证号",width = 26)
331
-    private String debtorIdentityNumAgent;
332
-    /** 联系电话 */
333
-    @Excel(name = "被申请人主体信息-代理人联系电话",width = 26)
334
-    private String debtorContactTelphoneAgent;
335
-    /** 联系地址 */
336
-    @Excel(name = "被申请人主体信息-代理人联系地址",width = 26)
337
-    private String debtorContactAddressAgent;
338
-    /**
339
-     * 申请机构id
340
-     */
341
-    private String applicationOrganId;
342
-    /**
343
-     * 版本号
344
-     */
345
-    private Integer version;
346
-    /**
347
-     * 修改案件的提交状态,0-未提交,1-已提交,2-同意,3-拒绝,4-撤销
348
-     */
349
-    private Integer updateSubmitStatus;
350
-    /** 合同名称 */
351
-    private String contractName;
352
-    /**
353
-     * 事实和理由
354
-     */
355
-    private String facts;
356
-    /**
357
-     * 合同甲方
358
-     */
359
-    private String partyA;
360
-    /**
361
-     * 利率
362
-     */
363
-    private String interestRate;
364
-    /**
365
-     * 待还金额
366
-     */
367
-    private String outstandingMoney;
368
-    /**
369
-     * 调解达成协议内容
370
-     */
371
-    private String mediationAgreement;
372
-    /**
373
-     * 金融消费纠纷基本情况
374
-     */
375
-    private String disputes;
376
-    /**
377
-     * 贷款类型
378
-     */
379
-    private String loanType;
380
-    /**
381
-     * 贷款期限
382
-     */
383
-    private String loanTerm;
384
-    /**
385
-     * 本案争议焦点
386
-     */
387
-    private String caseFocus;
388
-    /**
389
-     * 本案事实
390
-     */
391
-    private String caseFacts;
392
-    /**
393
-     * 被申请人对上述材料的质证意见
394
-     */
395
-    private String respondentOpinion;
396
-    /**
397
-     * 申请人对上述材料的质证意见
398
-     */
399
-    private String applicantOpinion;
400
-    /**
401
-     * 批号
402
-     */
403
-    private Integer batchNumber;
404
-    /**
405
-     * 自定义字段
406
-     */
407
-    private List<MsColumnValueVO> msColumnValueVOS;
408
-    /**
409
-     * 待办状态,0待办,1已办
410
-     */
411
-    private Integer pendingStatus;
412
-   /** e签宝流程id */
413
-    private String signFlowId;;
414 32
 }

+ 101
- 0
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/mscase/MsCaseApplicationMapper.java Просмотреть файл

@@ -1,7 +1,108 @@
1 1
 package com.ruoyi.wisdomarbitrate.mapper.mscase;
2 2
 
3 3
 import com.ruoyi.wisdomarbitrate.domain.entity.mscase.MsCaseApplication;
4
+import com.ruoyi.wisdomarbitrate.domain.vo.mscase.MsCaseApplicationReq;
5
+import com.ruoyi.wisdomarbitrate.domain.vo.mscase.MsCaseApplicationVO;
6
+import org.apache.ibatis.annotations.Param;
7
+import org.apache.ibatis.annotations.Select;
4 8
 import tk.mybatis.mapper.common.Mapper;
5 9
 
10
+import java.util.List;
11
+
6 12
 public interface MsCaseApplicationMapper extends Mapper<MsCaseApplication> {
13
+    /**
14
+     * 查询最大批次号
15
+     * @return
16
+     */
17
+    @Select("<script> select max(batch_number) as maxBatchNumber from ms_case_application " +
18
+            "</script>")
19
+    Integer selectMaxBatchNumber();
20
+
21
+    /**
22
+     * 查询最大编号
23
+     * @param caseNum
24
+     * @param length
25
+     * @return
26
+     */
27
+    @Select("<script> select max(substring(case_num, #{length}+1,14)) as maxCaseNum from ms_case_application where case_num like CONCAT(#{caseNum},'%') " +
28
+            " </script>")
29
+    Integer selectCaseNumLike(@Param("caseNum") String caseNum, @Param("length") int length);
30
+
31
+    /**
32
+     * 案件列表查询
33
+     * @param req
34
+     * @param caseStatusName
35
+     * @return
36
+     */
37
+    @Select("<script> select t.* from (select c.id,c.batch_number batchNumber,c.case_num caseNum,c.case_subject_amount caseSubjectAmount," +
38
+            "a.application_organ_name applicationOrganName,a.respondent_name respondentName,c.mediator_name mediatorName," +
39
+            "c.hear_date hearDate,c.case_status_name caseStatusName,c.create_time createTime from ms_case_application c " +
40
+            "join ms_case_affiliate a on c.id=a.case_appli_id <where> " +
41
+            "<if test='caseStatusName != null and caseStatusName.size() > 0 '> and  c.case_status_name in" +
42
+            "<foreach item='caseStatus' index='index' collection='caseStatusName' open='(' separator=',' close=')'>" +
43
+            "#{caseStatus}" +
44
+            "</foreach>" +
45
+            "</if> " +
46
+            "<if test=\"req.batchNumber != null and req.batchNumber != ''\">" +
47
+            "    AND c.batch_number = #{req.batchNumber} " +
48
+            "</if> " +
49
+            "<if test=\"req.caseNum != null and req.caseNum != ''\">" +
50
+            "    AND c.case_num = #{req.caseNum} " +
51
+            "</if> " +
52
+
53
+            "<if test=\"req.applicationOrganId != null and req.applicationOrganId != ''\">" +
54
+            "    AND a.application_organ_id = #{req.applicationOrganId} " +
55
+            "</if> " +
56
+            "<if test=\"req.startTime != null and req.startTime != ''\">"  +
57
+            "and c.create_time &gt;= #{req.startTime}</if>" +
58
+            "<if test=\"req.endTime != null and req.endTime != ''\">" +
59
+            "and c.create_time &lt;= #{req.endTime}</if>" +
60
+            "        </where> " +
61
+            "union  select c.id id,c.batch_number batchNumber,c.case_num caseNum,c.case_subject_amount caseSubjectAmount," +
62
+            "a.application_organ_name applicationOrganName,a.respondent_name respondentName,c.mediator_name mediatorName," +
63
+            "c.hear_date hearDate,c.case_status_name caseStatusName,c.create_time createTime from ms_case_log_record r " +
64
+            "join ms_case_application c on r.case_appli_id=c.id and r.case_status_name!=c.case_status_name " +
65
+            "join ms_case_affiliate a on c.id=a.case_appli_id  <where> r.create_by=#{req.userName}  and c.id not in (" +
66
+            "select c1.id from  ms_case_application c1 JOIN ms_case_affiliate a1 ON a1.case_appli_id = c1.id" +
67
+            "<if test='caseStatusName != null and caseStatusName.size() > 0 '> and  c.case_status_name in" +
68
+            "<foreach item='caseStatus' index='index' collection='caseStatusName' open='(' separator=',' close=')'>" +
69
+            "#{caseStatus}" +
70
+            "</foreach>" +
71
+            "</if> " +
72
+            "<if test=\"req.batchNumber != null and req.batchNumber != ''\">" +
73
+            "    AND c1.batch_number = #{req.batchNumber} " +
74
+            "</if> " +
75
+            "<if test=\"req.caseNum != null and req.caseNum != ''\">" +
76
+            "    AND c1.case_num = #{req.caseNum} " +
77
+            "</if> " +
78
+            "<if test=\"req.applicationOrganId != null and req.applicationOrganId != ''\">" +
79
+            "    AND a1.application_organ_id = #{req.applicationOrganId} " +
80
+            "</if> " +
81
+            "<if test=\"req.startTime != null and req.startTime != ''\">"  +
82
+            "and c1.create_time &gt;= #{req.startTime}</if>" +
83
+            "<if test=\"req.endTime != null and req.endTime != ''\">"  +
84
+            "and c1.create_time &lt;= #{req.endTime}</if>" +
85
+            "        </where> " +
86
+            "                    ) " +
87
+            "<if test='caseStatusName != null and caseStatusName.size() > 0 '> and  c.case_status_name in" +
88
+            "<foreach item='caseStatus' index='index' collection='caseStatusName' open='(' separator=',' close=')'>" +
89
+            "#{caseStatus}" +
90
+            "</foreach>" +
91
+            "</if> " +
92
+            "<if test=\"req.batchNumber != null and req.batchNumber != ''\">" +
93
+            "    AND c.batch_number = #{req.batchNumber} " +
94
+            "</if> " +
95
+            "<if test=\"req.caseNum != null and req.caseNum != ''\">" +
96
+            "    AND c.case_num = #{req.caseNum} " +
97
+            "</if> " +
98
+            "<if test=\"req.applicationOrganId != null and req.applicationOrganId != ''\">" +
99
+            "    AND a.application_organ_id = #{req.applicationOrganId} " +
100
+            "</if> " +
101
+            "<if test=\"req.startTime != null and req.startTime != ''\">"  +
102
+            "and c.create_time &gt;= #{req.startTime}</if>" +
103
+            "<if test=\"req.endTime != null and req.endTime != ''\">" +
104
+            "and c.create_time &lt;= #{req.endTime}</if>" +
105
+            "         ) t order by  t.createTime desc,t.caseNum desc" +
106
+            " </script>")
107
+    List<MsCaseApplicationVO> list(@Param("req")MsCaseApplicationReq req, @Param("caseStatusName") List<String> caseStatusName);
7 108
 }

+ 9
- 9
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/mscase/MsCaseAttachLogMapper.java Просмотреть файл

@@ -1,7 +1,7 @@
1 1
 package com.ruoyi.wisdomarbitrate.mapper.mscase;
2 2
 
3
+import com.ruoyi.wisdomarbitrate.domain.entity.mscase.MsCaseAttach;
3 4
 import com.ruoyi.wisdomarbitrate.domain.vo.mscase.MsCaseApplicationVO;
4
-import com.ruoyi.wisdomarbitrate.domain.dto.mscase.CaseAttach;
5 5
 import org.apache.ibatis.annotations.Mapper;
6 6
 import org.apache.ibatis.annotations.Param;
7 7
 
@@ -9,23 +9,23 @@ import java.util.List;
9 9
 
10 10
 @Mapper
11 11
 public interface MsCaseAttachLogMapper {
12
-    int save(CaseAttach caseAttach);
12
+    int save(MsCaseAttach caseAttach);
13 13
 
14
-    List<CaseAttach>  queryAnnexPathByCaseId(Long id);
14
+    List<MsCaseAttach>  queryAnnexPathByCaseId(Long id);
15 15
 
16
-    List<CaseAttach> queryCaseAttachList(MsCaseApplicationVO msCaseApplicationVO);
16
+    List<MsCaseAttach> queryCaseAttachList(MsCaseApplicationVO msCaseApplicationVO);
17 17
 
18 18
 
19
-    int updateCaseAttach(CaseAttach caseAttach);
19
+    int updateCaseAttach(MsCaseAttach caseAttach);
20 20
 
21
-    int updateCaseAttachBycaseid(CaseAttach caseAttach);
21
+    int updateCaseAttachBycaseid(MsCaseAttach caseAttach);
22 22
 
23 23
     int deleteByFileIds(@Param("ids") List<Integer> fileIds);
24 24
 
25
-    List<CaseAttach> getCaseAttachByCaseIdAndType(CaseAttach caseAttach);
25
+    List<MsCaseAttach> getCaseAttachByCaseIdAndType(MsCaseAttach caseAttach);
26 26
 
27
-    CaseAttach queryAnnexById(Integer annexId);
27
+    MsCaseAttach queryAnnexById(Integer annexId);
28 28
 
29 29
 
30
-    Integer batchSave(@Param("list")List<CaseAttach> caseAttaches);
30
+    Integer batchSave(@Param("list")List<MsCaseAttach> caseAttaches);
31 31
 }

+ 9
- 9
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/mscase/MsCaseAttachMapper.java Просмотреть файл

@@ -1,7 +1,7 @@
1 1
 package com.ruoyi.wisdomarbitrate.mapper.mscase;
2 2
 
3
+import com.ruoyi.wisdomarbitrate.domain.entity.mscase.MsCaseAttach;
3 4
 import com.ruoyi.wisdomarbitrate.domain.vo.mscase.MsCaseApplicationVO;
4
-import com.ruoyi.wisdomarbitrate.domain.dto.mscase.CaseAttach;
5 5
 import org.apache.ibatis.annotations.Mapper;
6 6
 import org.apache.ibatis.annotations.Param;
7 7
 
@@ -9,23 +9,23 @@ import java.util.List;
9 9
 
10 10
 @Mapper
11 11
 public interface MsCaseAttachMapper {
12
-    int save(CaseAttach caseAttach);
13
-    int batchSave(@Param("list") List<CaseAttach> caseAttach);
12
+    int save(MsCaseAttach caseAttach);
13
+    int batchSave(@Param("list") List<MsCaseAttach> caseAttach);
14 14
 
15
-    List<CaseAttach>  queryAnnexPathByCaseId(Long id);
15
+    List<MsCaseAttach>  queryAnnexPathByCaseId(Long id);
16 16
 
17
-    List<CaseAttach> queryCaseAttachList(MsCaseApplicationVO msCaseApplicationVO);
17
+    List<MsCaseAttach> queryCaseAttachList(MsCaseApplicationVO msCaseApplicationVO);
18 18
 
19 19
 
20
-    int updateCaseAttach(CaseAttach caseAttach);
20
+    int updateCaseAttach(MsCaseAttach caseAttach);
21 21
 
22
-    int updateCaseAttachBycaseid(CaseAttach caseAttach);
22
+    int updateCaseAttachBycaseid(MsCaseAttach caseAttach);
23 23
 
24 24
     int deleteByFileIds(@Param("ids") List<Integer> fileIds);
25 25
 
26
-    List<CaseAttach> getCaseAttachByCaseIdAndType(CaseAttach caseAttach);
26
+    List<MsCaseAttach> getCaseAttachByCaseIdAndType(MsCaseAttach caseAttach);
27 27
 
28
-    CaseAttach queryAnnexById(Integer annexId);
28
+    MsCaseAttach queryAnnexById(@Param("annexId") Long annexId);
29 29
 
30 30
     /**
31 31
      * 根据案件id和附件类型删除和上传类型

+ 5
- 5
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/dept/impl/DeptIdentifyServiceImpl.java Просмотреть файл

@@ -19,9 +19,9 @@ import com.ruoyi.common.utils.file.FileUploadUtils;
19 19
 import com.ruoyi.system.mapper.*;
20 20
 import com.ruoyi.wisdomarbitrate.domain.dto.dept.DeptIdentify;
21 21
 import com.ruoyi.wisdomarbitrate.domain.dto.dept.SealManage;
22
-import com.ruoyi.wisdomarbitrate.domain.dto.mscase.CaseAttach;
23 22
 import com.ruoyi.wisdomarbitrate.domain.dto.template.FatchRule;
24 23
 import com.ruoyi.wisdomarbitrate.domain.dto.template.TemplateManage;
24
+import com.ruoyi.wisdomarbitrate.domain.entity.mscase.MsCaseAttach;
25 25
 import com.ruoyi.wisdomarbitrate.domain.vo.template.TemplateFatchRule;
26 26
 import com.ruoyi.wisdomarbitrate.mapper.dept.DeptIdentifyMapper;
27 27
 import com.ruoyi.wisdomarbitrate.mapper.dept.SealManageMapper;
@@ -247,14 +247,14 @@ public class DeptIdentifyServiceImpl implements IDeptIdentifyService {
247 247
                             }
248 248
                             boolean downLoadFile = FileTransformation.downLoadFileByUrl(sealImageDownloadUrl, resultFilePath);
249 249
                             if (downLoadFile) {
250
-                                CaseAttach caseAttach = new CaseAttach();
250
+                                MsCaseAttach caseAttach = new MsCaseAttach();
251 251
                                 caseAttach.setAnnexType(10);  //10代表印章图片
252 252
                                 caseAttach.setAnnexPath(savePath);
253 253
                                 caseAttach.setAnnexName(saveName);
254 254
                                 int i1 = msCaseAttachMapper.save(caseAttach);
255 255
                                 if (i1 > 0) {
256 256
                                     //将附件id保存到公章管理表里
257
-                                    Integer annexId1 = caseAttach.getAnnexId();
257
+                                    Long annexId1 = caseAttach.getAnnexId();
258 258
                                     SealManage sealManage = new SealManage();
259 259
                                     sealManage.setSealId(sealId);
260 260
                                     List<SealManage> selectSealList = sealManageMapper.selectSealList(sealManage);
@@ -288,10 +288,10 @@ public class DeptIdentifyServiceImpl implements IDeptIdentifyService {
288 288
         List<SealManage> selectSealList = sealManageMapper.selectSealList(sealManage);
289 289
         if (selectSealList != null && selectSealList.size() > 0) {
290 290
             for (SealManage sealManage1 : selectSealList) {
291
-                Integer annexId = sealManage1.getAnnexId();
291
+                Long annexId = sealManage1.getAnnexId();
292 292
                 if (annexId != null) {
293 293
                     //根据附件id查询路径
294
-                    CaseAttach caseAttach = msCaseAttachMapper.queryAnnexById(annexId);
294
+                    MsCaseAttach caseAttach = msCaseAttachMapper.queryAnnexById(annexId);
295 295
                     String annexName = caseAttach.getAnnexName();
296 296
                     String prefix = "/profile";
297 297
                     int startIndex = annexName.indexOf(prefix);

+ 4
- 2
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/mscase/MsCaseApplicationService.java Просмотреть файл

@@ -1,7 +1,7 @@
1 1
 package com.ruoyi.wisdomarbitrate.service.mscase;
2 2
 
3
-import com.ruoyi.wisdomarbitrate.domain.entity.mscase.MsCaseApplication;
4 3
 import com.ruoyi.wisdomarbitrate.domain.vo.mscase.MsCaseApplicationReq;
4
+import com.ruoyi.wisdomarbitrate.domain.vo.mscase.MsCaseApplicationVO;
5 5
 
6 6
 import java.util.List;
7 7
 
@@ -18,5 +18,7 @@ public interface MsCaseApplicationService {
18 18
      * @param req
19 19
      * @return
20 20
      */
21
-    List<MsCaseApplication> list(MsCaseApplicationReq req);
21
+    List<MsCaseApplicationVO> list(MsCaseApplicationReq req);
22
+
23
+    int insert(MsCaseApplicationVO caseApplication);
22 24
 }

+ 258
- 7
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/mscase/impl/MsCaseApplicationServiceImpl.java Просмотреть файл

@@ -1,14 +1,41 @@
1 1
 package com.ruoyi.wisdomarbitrate.service.mscase.impl;
2 2
 
3
+import cn.hutool.core.collection.CollectionUtil;
4
+import cn.hutool.core.util.StrUtil;
5
+import com.ruoyi.common.core.domain.entity.SysDept;
6
+import com.ruoyi.common.core.domain.entity.SysRole;
7
+import com.ruoyi.common.core.domain.entity.SysUser;
3 8
 import com.ruoyi.common.core.domain.model.LoginUser;
9
+import com.ruoyi.common.exception.ServiceException;
10
+import com.ruoyi.common.utils.DateUtils;
11
+import com.ruoyi.common.utils.IdWorkerUtil;
4 12
 import com.ruoyi.common.utils.SecurityUtils;
5
-import com.ruoyi.wisdomarbitrate.domain.entity.mscase.MsCaseApplication;
13
+import com.ruoyi.system.domain.entity.flow.MsCaseFlow;
14
+import com.ruoyi.system.domain.entity.flow.MsCaseFlowRoleRelated;
15
+import com.ruoyi.system.mapper.SysDeptMapper;
16
+import com.ruoyi.system.mapper.SysRoleMapper;
17
+import com.ruoyi.system.mapper.SysUserMapper;
18
+import com.ruoyi.system.mapper.SysUserRoleMapper;
19
+import com.ruoyi.system.mapper.flow.MsCaseFlowMapper;
20
+import com.ruoyi.system.mapper.flow.MsCaseFlowRoleRelatedMapper;
21
+import com.ruoyi.wisdomarbitrate.domain.entity.mscase.MsCaseAffiliate;
22
+import com.ruoyi.wisdomarbitrate.domain.entity.mscase.MsCaseAttach;
6 23
 import com.ruoyi.wisdomarbitrate.domain.vo.mscase.MsCaseApplicationReq;
24
+import com.ruoyi.wisdomarbitrate.domain.vo.mscase.MsCaseApplicationVO;
25
+import com.ruoyi.wisdomarbitrate.mapper.mscase.*;
7 26
 import com.ruoyi.wisdomarbitrate.service.mscase.MsCaseApplicationService;
27
+import org.springframework.beans.factory.annotation.Autowired;
8 28
 import org.springframework.stereotype.Service;
29
+import org.springframework.transaction.annotation.Transactional;
30
+import tk.mybatis.mapper.entity.Example;
9 31
 
32
+import java.math.BigDecimal;
10 33
 import java.util.ArrayList;
11 34
 import java.util.List;
35
+import java.util.Map;
36
+import java.util.stream.Collectors;
37
+
38
+import static com.ruoyi.common.utils.SecurityUtils.getUsername;
12 39
 
13 40
 /**
14 41
  * @Classname MsCaseApplicationServiceImpl
@@ -19,18 +46,242 @@ import java.util.List;
19 46
  */
20 47
 @Service
21 48
 public class MsCaseApplicationServiceImpl  implements MsCaseApplicationService {
49
+    @Autowired
50
+    MsCaseApplicationMapper msCaseApplicationMapper;
51
+    @Autowired
52
+    MsCaseApplicationLogMapper msCaseApplicationLogMapper;
53
+    @Autowired
54
+    MsCaseAffiliateMapper msCaseAffiliateMapper;
55
+    @Autowired
56
+    MsCaseAffiliateLogMapper msCaseAffiliateLogMapper;
57
+    @Autowired
58
+    MsCaseAttachMapper msCaseAttachMapper;
59
+    @Autowired
60
+    MsCaseAttachLogMapper msCaseAttachLogMapper;
61
+    @Autowired
62
+    MsCaseFlowMapper caseFlowMapper;
63
+    @Autowired
64
+    MsCaseFlowRoleRelatedMapper caseFlowRoleRelatedMapper;
65
+    @Autowired
66
+    SysDeptMapper sysDeptMapper;
67
+    @Autowired
68
+    SysRoleMapper roleMapper;
69
+    @Autowired
70
+    SysUserMapper userMapper;
71
+    @Autowired
72
+    SysUserRoleMapper userRoleMapper;
73
+
74
+    /**
75
+     * 案件列表查询
76
+     * @param req
77
+     * @return
78
+     */
79
+    @Override
80
+    public List<MsCaseApplicationVO> list(MsCaseApplicationReq req) {
81
+        // 根据用户查询角色
82
+        LoginUser loginUser = SecurityUtils.getLoginUser();
83
+        List<SysRole> roles = loginUser.getUser().getRoles();
84
+        if(CollectionUtil.isEmpty(roles)){
85
+            throw new ServiceException("该用户未指定角色");
86
+        }
87
+        req.setUserName(SecurityUtils.getUsername());
88
+        // 根据角色查询关联的案件状态
89
+        Example example = new Example(MsCaseFlowRoleRelated.class);
90
+        example.createCriteria().andIn("roleid",roles.stream().map(SysRole::getRoleId).collect(Collectors.toList()));
91
+        List<MsCaseFlowRoleRelated> caseFlowRoleRelatedList= caseFlowRoleRelatedMapper.selectByExample(example);
92
+        if(CollectionUtil.isEmpty(caseFlowRoleRelatedList)){
93
+            throw new ServiceException("该角色为绑定案件流程");
94
+        }
95
+        Example flowExample = new Example(MsCaseFlow.class);
96
+        flowExample.createCriteria().andIn("id",caseFlowRoleRelatedList.stream().map(MsCaseFlowRoleRelated::getFlowId).collect(Collectors.toList()));
97
+        List<MsCaseFlow> caseFlows = caseFlowMapper.selectByExample(flowExample);
98
+        if(CollectionUtil.isEmpty(caseFlows)){
99
+            throw new ServiceException("该角色为绑定案件流程");
100
+        }
101
+        // 查询案件列表
102
+       List<MsCaseApplicationVO> caseApplicationList=msCaseApplicationMapper.list(req,caseFlows.stream().map(MsCaseFlow::getCaseStatusName).collect(Collectors.toList()));
103
+        return caseApplicationList;
104
+    }
105
+
106
+    /**
107
+     * 新增案件
108
+     * @param caseApplication
109
+     * @return
110
+     */
111
+    @Transactional
22 112
     @Override
23
-    public List<MsCaseApplication> list(MsCaseApplicationReq req) {
113
+    public int insert(MsCaseApplicationVO caseApplication) {
114
+        caseApplication.setId(IdWorkerUtil.getId());
24 115
         // 根据用户查询角色
25 116
         LoginUser loginUser = SecurityUtils.getLoginUser();
26
-        Long roleId = loginUser.getUser().getRoleId();
27
-        if(roleId==null){
28
-            return new ArrayList<>();
117
+        List<SysRole> roles = loginUser.getUser().getRoles();
118
+        if(CollectionUtil.isEmpty(roles)){
119
+            throw new ServiceException("该用户未指定角色");
29 120
         }
30 121
         // 根据角色查询关联的案件状态
122
+        Example example = new Example(MsCaseFlowRoleRelated.class);
123
+        example.createCriteria().andIn("roleid",roles.stream().map(SysRole::getRoleId).collect(Collectors.toList()));
124
+        List<MsCaseFlowRoleRelated> caseFlowRoleRelatedList= caseFlowRoleRelatedMapper.selectByExample(example);
125
+        if(CollectionUtil.isEmpty(caseFlowRoleRelatedList)){
126
+            throw new ServiceException("该角色为绑定案件流程");
127
+        }
128
+        Example flowExample = new Example(MsCaseFlow.class);
129
+        flowExample.setOrderByClause("sort asc");
130
+        flowExample.createCriteria().andIn("id",caseFlowRoleRelatedList.stream().map(MsCaseFlowRoleRelated::getFlowId).collect(Collectors.toList()));
131
+        List<MsCaseFlow> caseFlows = caseFlowMapper.selectByExample(flowExample);
132
+        if(CollectionUtil.isNotEmpty(caseFlows)){
133
+            caseApplication.setCaseStatusName(caseFlows.get(0).getCaseStatusName());
134
+            caseApplication.setCaseFlowId(caseFlows.get(0).getId());
135
+        }
31 136
 
137
+        // 计算仲裁费用
138
+        if( caseApplication.getCaseSubjectAmount()!=null) {
139
+            BigDecimal feeRate = new BigDecimal("0.01");
140
+            BigDecimal feePayable = caseApplication.getCaseSubjectAmount().multiply(feeRate).setScale(2, BigDecimal.ROUND_HALF_UP);
141
+            caseApplication.setFeePayable(feePayable);
142
+        }
143
+        // 设置批号
144
+        caseApplication.setBatchNumber(getBatchNumber());
145
+        // 设置编码
146
+        caseApplication.setCaseNum(getCaseNum());
147
+        caseApplication.setCreateBy(SecurityUtils.getUsername());
148
+        caseApplication.setUpdateBy(SecurityUtils.getUsername());
149
+        caseApplication.setVersion(1);
150
+        MsCaseAffiliate affiliate = caseApplication.getAffiliate();
151
+        // 保存案件基本信息
152
+        if(msCaseApplicationMapper.insertSelective(caseApplication)>0){
153
+            List<MsCaseAttach> caseAttachList = caseApplication.getCaseAttachList();
154
+            // 保存案件相关人员
155
+            if(affiliate !=null) {
156
+                // 设置申请人
157
+                if( StrUtil.isNotEmpty(affiliate.getApplicationOrganName())){
158
+                    // 组装申请机构
159
+                    insertDept(affiliate);
160
+                    // 查询申请人角色id
161
+                    Long roleId = roleMapper.selectRoleIdByName("申请人");
162
+                    // 根据代理人手机号去用户表查询,有修改,么有新增
163
+                    SysUser agentUser = userMapper.selectUserByPhone(affiliate.getContactTelphoneAgent());
164
+                    // 代理人为空,新增代理人
165
+                    if(agentUser==null){
166
+                        agentUser = new SysUser();
167
+                        agentUser.setUserName(affiliate.getContactTelphoneAgent());
168
+                        agentUser.setNickName(affiliate.getNameAgent());
169
+                        agentUser.setPhonenumber(affiliate.getContactTelphoneAgent());
170
+                        agentUser.setPassword(SecurityUtils.encryptPassword("abc123456"));
171
+                        agentUser.setDeptId(Long.valueOf(affiliate.getApplicationOrganId()));
172
+                        userMapper.insertUser(agentUser);
173
+                        userRoleMapper.insertUserRole(agentUser.getUserId(), roleId);
174
+                    }else if(null != agentUser.getDeptId() && !String.valueOf(agentUser.getDeptId()).equals(affiliate.getApplicationOrganId())){
175
+                        if (null != agentUser.getDept() && StrUtil.isNotEmpty(agentUser.getDept().getDeptName())) {
176
+                            throw new ServiceException( "该申请代理人已在【" + agentUser.getDept().getDeptName() + "】申请机构下存在,请检查填写信息是否正确");
177
+                        } else {
178
+                            throw new ServiceException("该申请代理人已存在,与申请机构不匹配,请检查填写信息是否正确");
179
+                        }
180
+                    }else if (null != agentUser.getDeptId() && String.valueOf(agentUser.getDeptId()).equals(affiliate.getApplicationOrganId())) {
181
+                        // 同步用户表和案件关联人表的手机号和名称
182
+                        affiliate.setContactTelphoneAgent(StrUtil.isNotEmpty(agentUser.getPhonenumber())?agentUser.getPhonenumber():affiliate.getContactTelphoneAgent());
183
+                        affiliate.setNameAgent(agentUser.getNickName());
184
+                        affiliate.setAgentEmail(StrUtil.isNotEmpty(agentUser.getEmail())?agentUser.getEmail():affiliate.getAgentEmail());
185
+                        List<Long> longList = new ArrayList<>();
186
+                        // 新增角色为申请人
187
+                        if (CollectionUtil.isNotEmpty(agentUser.getRoles())) {
188
+                            longList = agentUser.getRoles().stream().map(SysRole::getRoleId).collect(Collectors.toList());
189
+                            if (!longList.contains(roleId)) {
190
+                                userRoleMapper.insertUserRole(agentUser.getUserId(), roleId);
191
+                            }
192
+                        } else {
193
+                            userRoleMapper.insertUserRole(agentUser.getUserId(), roleId);
194
+                        }
195
+
196
+                    }
197
+                }
198
+                affiliate.setCaseAppliId(caseApplication.getId());
199
+                msCaseAffiliateMapper.insert(affiliate);
200
+            }
201
+            // 保存案件附件
202
+            if(CollectionUtil.isNotEmpty(caseAttachList)){
203
+                for (MsCaseAttach caseAttach : caseAttachList) {
204
+                    caseAttach.setCaseAppliId(caseApplication.getId());
205
+                    // 修改案件附件
206
+                    msCaseAttachMapper.updateCaseAttach(caseAttach);
207
+                }
208
+//                for(MsCaseAttach caseAttach:caseAttachList){
209
+//                    caseAttach.setCaseAppliId(caseApplication.getId());
210
+//
211
+//                }
212
+//                msCaseAttachMapper.batchSave(caseAttachList);
213
+            }
214
+            return 1;
215
+        }
216
+
217
+        return 0;
218
+    }
219
+
220
+    /**
221
+     * 新增部门
222
+     * @param affiliate
223
+     */
224
+    @Transactional
225
+     void insertDept(MsCaseAffiliate affiliate) {
226
+        // 查询所有的组织机构,组装成map
227
+        List<SysDept> deptList = sysDeptMapper.selectDeptList(new SysDept());
228
+        if (CollectionUtil.isEmpty(deptList)) {
229
+            deptList = new ArrayList<>();
230
+        }
231
+        Map<String, Long> deptMap = deptList.stream().collect(Collectors.toMap(SysDept::getDeptName, SysDept::getDeptId, (oldV, newV) -> newV));
232
+
233
+        // 将组织机构id设为申请人名称
234
+        if (deptMap.containsKey(affiliate.getApplicationOrganName())) {
235
+            affiliate.setApplicationOrganId(String.valueOf(deptMap.get(affiliate.getApplicationOrganName())));
236
+        } else {
237
+            // 如果不存在则新增
238
+            SysDept dept = new SysDept();
239
+            dept.setParentId(0L);
240
+            dept.setDeptName(affiliate.getApplicationOrganName());
241
+            dept.setAncestors("0");
242
+            dept.setOrderNum(1);
243
+            dept.setStatus("0");
244
+            dept.setDelFlag("0");
245
+            dept.setCreateBy(getUsername());
246
+            dept.setUpdateBy(getUsername());
247
+            sysDeptMapper.insertDept(dept);
248
+            deptMap.put(dept.getDeptName(), dept.getDeptId());
249
+            affiliate.setApplicationOrganId(String.valueOf(dept.getDeptId()));
250
+        }
251
+    }
252
+
253
+    /**
254
+     * 获取案件编码
255
+     * @return
256
+     */
257
+    private String getCaseNum() {
258
+        // todo 查询编码规则
259
+
260
+        // 自动编码格式 zc+yyyyMMdd+001
261
+        String currentDay = DateUtils.dateTime();
262
+        String caseNum = "zc" + currentDay;
263
+        //查询出当天的案件编号的最大值
264
+        Integer maxCaseNum = msCaseApplicationMapper.selectCaseNumLike(caseNum, caseNum.length());
265
+        if (null == maxCaseNum) {
266
+            caseNum = caseNum + "00001";
267
+        } else {
268
+            maxCaseNum=maxCaseNum+1;
269
+            caseNum = caseNum + String.format("%05d", maxCaseNum);
270
+        }
271
+        return caseNum;
272
+    }
273
+
274
+    /**
275
+     * 获取批次号
276
+     * @return
277
+     */
278
+    private String getBatchNumber() {
279
+        Integer batchNumber = msCaseApplicationMapper.selectMaxBatchNumber();
280
+        if(batchNumber==null){
281
+        return "000001";
282
+        }else {
283
+            return  String.format("%06d", batchNumber+1);
284
+        }
32 285
 
33
-        // 查询案件列表
34
-        return null;
35 286
     }
36 287
 }

+ 225
- 0
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/utils/FixSelectFlowDetailUtils.java Просмотреть файл

@@ -0,0 +1,225 @@
1
+package com.ruoyi.wisdomarbitrate.utils;
2
+
3
+import com.alibaba.fastjson.JSONObject;
4
+import com.google.gson.Gson;
5
+import com.google.gson.JsonArray;
6
+import com.google.gson.JsonObject;
7
+import com.ruoyi.common.constant.FileTransformation;
8
+import com.ruoyi.common.core.domain.entity.EsignHttpResponse;
9
+import com.ruoyi.common.exception.EsignDemoException;
10
+import com.ruoyi.wisdomarbitrate.domain.dto.dept.DeptIdentify;
11
+import com.ruoyi.wisdomarbitrate.domain.dto.dept.SealManage;
12
+import com.ruoyi.wisdomarbitrate.domain.entity.mscase.MsCaseAttach;
13
+import com.ruoyi.wisdomarbitrate.mapper.dept.DeptIdentifyMapper;
14
+import com.ruoyi.wisdomarbitrate.mapper.dept.SealManageMapper;
15
+import com.ruoyi.wisdomarbitrate.mapper.mscase.MsCaseAttachMapper;
16
+import org.springframework.beans.factory.annotation.Autowired;
17
+import org.springframework.scheduling.annotation.Scheduled;
18
+import org.springframework.stereotype.Component;
19
+import org.springframework.transaction.annotation.Transactional;
20
+
21
+import java.io.File;
22
+import java.io.IOException;
23
+import java.time.LocalDate;
24
+import java.util.List;
25
+import java.util.UUID;
26
+
27
+@Component
28
+public class FixSelectFlowDetailUtils {
29
+    @Autowired
30
+    private MsCaseAttachMapper caseAttachMapper;
31
+    @Autowired
32
+    private DeptIdentifyMapper deptIdentifyMapper;
33
+    @Autowired
34
+    private SealManageMapper sealManageMapper;
35
+
36
+
37
+
38
+    /**
39
+     * 定时查询企业认证状态
40
+     *
41
+     * @throws Exception
42
+     */
43
+    @Scheduled(cron = "*/30 * * * * *")
44
+    @Transactional
45
+    public void fixExecuteSelectDeptIndentifyUtils() throws Exception {
46
+        Gson gson = new Gson();
47
+        DeptIdentify deptIdentify = new DeptIdentify();
48
+        List<DeptIdentify> deptIdentifysnew = deptIdentifyMapper.selectDeptIdentify(deptIdentify);
49
+        if (deptIdentifysnew != null && deptIdentifysnew.size() > 0) {
50
+            for (int i = 0; i < deptIdentifysnew.size(); i++) {
51
+                DeptIdentify deptIdentify1 = deptIdentifysnew.get(i);
52
+                Integer identifyStatus = deptIdentify1.getIdentifyStatus();
53
+                if (identifyStatus!=1){
54
+                    String authFlowId = deptIdentify1.getAuthFlowId();
55
+                    if (authFlowId != null) {
56
+                        EsignHttpResponse identifyInfo = SignAward.getDeptIdentifyInfo(deptIdentify1);
57
+                        JsonObject identifyInfoJsonObject = gson.fromJson(identifyInfo.getBody(), JsonObject.class);
58
+                        int code = identifyInfoJsonObject.get("code").getAsInt();
59
+                        if (code == 0) {
60
+                            JsonObject identifyInfoData = identifyInfoJsonObject.getAsJsonObject("data");
61
+                            int realnameStatus = identifyInfoData.get("realnameStatus").getAsInt();
62
+                            if (realnameStatus == 1) {
63
+                                String orgId = identifyInfoData.get("orgId").getAsString();
64
+                                //查询企业内部印章
65
+                                EsignHttpResponse response = SignAward.deptIdentifySealList(orgId);
66
+                                JsonObject jsonObject = gson.fromJson(response.getBody(), JsonObject.class);
67
+                                int code1 = jsonObject.get("code").getAsInt();
68
+                                if (code1 == 0) {
69
+                                    JsonObject data = jsonObject.getAsJsonObject("data");
70
+                                    JsonArray seals = data.get("seals").getAsJsonArray();
71
+                                    if (seals.size() > 0) {
72
+                                        for (int j = 0; j < seals.size(); j++) {
73
+                                            //保存印章信息到数据库
74
+                                            JsonObject asJsonObject = seals.get(j).getAsJsonObject();
75
+                                            SealManage sealManage = new SealManage();
76
+                                            String sealName = asJsonObject.get("sealName").toString();
77
+                                            String sealId = asJsonObject.get("sealId").toString();
78
+                                            String url = asJsonObject.get("sealImageDownloadUrl").toString();
79
+                                            LocalDate now = LocalDate.now();
80
+                                            String year = Integer.toString(now.getYear());
81
+                                            String month = String.format("%02d", now.getMonthValue());
82
+                                            String day = String.format("%02d", now.getDayOfMonth());
83
+                                            String saveFolderPath = "/home/ruoyi/uploadPath/upload/" + year + "/" + month + "/" + day;
84
+                                            String fileName = UUID.randomUUID().toString().replace("-", "") + ".jpg";
85
+                                            String saveName = "/profile/upload/" + year + "/" + month + "/" + day + "/" + fileName;
86
+                                            String savePath = "/home/ruoyi/uploadPath/upload/";
87
+                                            // 创建日期目录
88
+                                            File saveFolder = new File(saveFolderPath);
89
+                                            if (!saveFolder.exists()) {
90
+                                                saveFolder.mkdirs();
91
+                                            }
92
+                                            String resultFilePath = saveFolderPath + "/" + fileName;
93
+                                            File resultFilePathFile = new File(resultFilePath);
94
+                                            if (!resultFilePathFile.exists()) {
95
+                                                resultFilePathFile.createNewFile();
96
+                                            }
97
+                                            String fileDownloadUrlnew = url.substring(1, url.length() - 1);
98
+                                            boolean downLoadFile = FileTransformation.downLoadFileByUrl(fileDownloadUrlnew, resultFilePath);
99
+                                            if (downLoadFile) {
100
+                                                MsCaseAttach caseAttach = new MsCaseAttach();
101
+                                                caseAttach.setAnnexType(10);  //10代表印章图片
102
+                                                caseAttach.setAnnexPath(savePath);
103
+                                                caseAttach.setAnnexName(saveName);
104
+                                                int i1 = caseAttachMapper.save(caseAttach);
105
+                                                if (i1 > 0) {
106
+                                                    //将印章信息保存到公章管理表里
107
+                                                    String sealName1 = sealName.substring(1, sealName.length() - 1);
108
+                                                    String sealId1 = sealId.substring(1, sealId.length() - 1);
109
+                                                    Long annexId1 = caseAttach.getAnnexId();
110
+                                                    sealManage.setAnnexId(annexId1);
111
+                                                    sealManage.setSealId(sealId1);
112
+                                                    sealManage.setSealName(sealName1);
113
+                                                    sealManage.setIdentifyId(deptIdentify1.getId());
114
+                                                    sealManage.setSealStatus(1);
115
+                                                    sealManage.setIsUse(1);
116
+                                                    sealManageMapper.insertSealManage(sealManage);
117
+                                                }
118
+                                            }
119
+                                        }
120
+                                    }
121
+
122
+                                }
123
+                                //将orgId保存到数据库里
124
+                                deptIdentify1.setOrgId(orgId);
125
+                                deptIdentify1.setIdentifyStatus(1);
126
+                                deptIdentify1.setIsUse(0);  //默认机构为未启用
127
+                                int row = deptIdentifyMapper.updateDeptIdentify(deptIdentify1);
128
+                            }
129
+                        }else {
130
+                            deptIdentify1.setIdentifyStatus(2);
131
+                            deptIdentifyMapper.updateDeptIdentify(deptIdentify1);
132
+                        }
133
+                    }
134
+                }
135
+            }
136
+        }
137
+    }
138
+
139
+
140
+    /**
141
+     * 定时查询印章审核状态
142
+     */
143
+    @Scheduled(cron = "0/30 * * * * ?")
144
+    @Transactional
145
+    public void searchForInstitutionalSeal() {
146
+        try {
147
+            SealManage sealManage = new SealManage();
148
+            sealManage.setSealStatus(0);
149
+            List<SealManage> sealManageList = sealManageMapper.selectSealList(sealManage);
150
+            if (sealManageList != null && sealManageList.size() > 0) {
151
+                for (SealManage sealManage1 : sealManageList) {
152
+                    //查询企业内部印章
153
+                    Long annexId = sealManage1.getAnnexId();
154
+                    String sealId = sealManage1.getSealId();
155
+                    DeptIdentify deptIdentify = new DeptIdentify();
156
+                    deptIdentify.setId(sealManage1.getIdentifyId());
157
+                    List<DeptIdentify> deptIdentifies = deptIdentifyMapper.selectDeptIdentify(deptIdentify);
158
+                    if (deptIdentifies != null && deptIdentifies.size() > 0) {
159
+                        DeptIdentify deptIdentify1 = deptIdentifies.get(0);
160
+                        String orgId = deptIdentify1.getOrgId();
161
+                        if (orgId == null) {
162
+                            continue;
163
+                        }
164
+                        if (annexId == null) {
165
+                            //说明之前没有下载过
166
+                            EsignHttpResponse response = SignAward.getOrgSeal(orgId, sealId);
167
+                            JSONObject jsonObject = JSONObject.parseObject(response.getBody());
168
+                            int code = jsonObject.getIntValue("code");
169
+                            if (code == 0) {
170
+                                JSONObject data = jsonObject.getJSONObject("data");
171
+                                int sealStatus = data.getIntValue("sealStatus");
172
+                                if (sealStatus == 1) {//印章状态 1已启用,2待审核,3审核不通过,4 挂起
173
+                                    //已启用证明审核通过,下载到数据库
174
+                                    String sealImageDownloadUrl = data.getString("sealImageDownloadUrl");
175
+                                    LocalDate now = LocalDate.now();
176
+                                    String year = Integer.toString(now.getYear());
177
+                                    String month = String.format("%02d", now.getMonthValue());
178
+                                    String day = String.format("%02d", now.getDayOfMonth());
179
+                                    String saveFolderPath = "/home/ruoyi/uploadPath/upload/" + year + "/" + month + "/" + day;
180
+                                    String fileName = UUID.randomUUID().toString().replace("-", "") + ".jpg";
181
+                                    String saveName = "/profile/upload/" + year + "/" + month + "/" + day + "/" + fileName;
182
+                                    String savePath = "/home/ruoyi/uploadPath/upload/";
183
+                                    // 创建日期目录
184
+                                    File saveFolder = new File(saveFolderPath);
185
+                                    if (!saveFolder.exists()) {
186
+                                        saveFolder.mkdirs();
187
+                                    }
188
+                                    String resultFilePath = saveFolderPath + "/" + fileName;
189
+                                    File resultFilePathFile = new File(resultFilePath);
190
+                                    if (!resultFilePathFile.exists()) {
191
+                                        resultFilePathFile.createNewFile();
192
+                                    }
193
+                                    boolean downLoadFile = FileTransformation.downLoadFileByUrl(sealImageDownloadUrl, resultFilePath);
194
+                                    if (downLoadFile) {
195
+                                        MsCaseAttach caseAttach = new MsCaseAttach();
196
+                                        caseAttach.setAnnexType(10);  //10代表印章图片
197
+                                        caseAttach.setAnnexPath(savePath);
198
+                                        caseAttach.setAnnexName(saveName);
199
+                                        int i1 = caseAttachMapper.save(caseAttach);
200
+                                        if (i1 > 0) {
201
+                                            //将附件id保存到公章管理表里
202
+                                            Long annexId1 = caseAttach.getAnnexId();
203
+                                            sealManage1.setAnnexId(annexId1);
204
+                                            sealManage1.setSealStatus(1);
205
+                                            sealManage1.setIsUse(0);
206
+                                            sealManageMapper.updateSealManage(sealManage1);
207
+                                        }
208
+                                    }
209
+                                }
210
+                            }
211
+                        }
212
+                    }
213
+
214
+                }
215
+            }
216
+        } catch (EsignDemoException e) {
217
+            e.printStackTrace();
218
+        } catch (IOException e) {
219
+            e.printStackTrace();
220
+        }
221
+    }
222
+
223
+}
224
+
225
+

+ 4
- 0
ruoyi-system/src/main/resources/mapper/system/SysUserRoleMapper.xml Просмотреть файл

@@ -41,4 +41,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
41 41
  	        #{userId}
42 42
             </foreach> 
43 43
 	</delete>
44
+
45
+	<insert id="insertUserRole">
46
+		insert into ms_sys_user_role(user_id, role_id) values(#{userId}, #{roleId})
47
+    </insert>
44 48
 </mapper> 

+ 10
- 10
ruoyi-system/src/main/resources/mapper/wisdomarbitrate/mscase/MsCaseAttachLogMapper.xml Просмотреть файл

@@ -3,27 +3,27 @@
3 3
         PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
4 4
         "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
5 5
 <mapper namespace="com.ruoyi.wisdomarbitrate.mapper.mscase.MsCaseAttachLogMapper">
6
-    <resultMap type="com.ruoyi.wisdomarbitrate.domain.dto.mscase.CaseAttach" id="CaseAttachResult">
6
+    <resultMap type="com.ruoyi.wisdomarbitrate.domain.entity.mscase.MsCaseAttach" id="CaseAttachResult">
7 7
         <id     property="annexId"       column="annex_id"      />
8 8
         <result property="caseAppliId"       column="case_appli_id"      />
9 9
         <result property="annexName"     column="annex_name"    />
10 10
         <result property="annexPath"     column="annex_path"    />
11 11
         <result property="annexType"     column="annex_type"    />
12 12
         <result property="note"     column="note"    />
13
-        <result property="userId"     column="use_id"    />
14
-        <result property="userName"     column="use_account"    />
13
+        <result property="useId"     column="use_id"    />
14
+        <result property="useAccount"     column="use_account"    />
15 15
         <result property="sealStatus"     column="seal_status"    />
16 16
         <result property="caseAppliLogId"     column="case_appli_log_id"    />
17 17
     </resultMap>
18 18
     <insert id="save" useGeneratedKeys="true" keyProperty="annexId">
19 19
         INSERT INTO ms_case_attach_log (case_appli_log_id, annex_id,annex_name, annex_path , annex_type,note,use_id,use_account,seal_status)
20
-        VALUES (#{caseAppliLogId},#{annexId}, #{annexName}, #{annexPath},#{annexType},#{note},#{userId},#{userName},#{sealStatus})
20
+        VALUES (#{caseAppliLogId},#{annexId}, #{annexName}, #{annexPath},#{annexType},#{note},#{useId},#{useAccount},#{sealStatus})
21 21
     </insert>
22 22
     <insert id="batchSave">
23 23
         INSERT INTO ms_case_attach_log (case_appli_log_id, annex_id,annex_name, annex_path , annex_type,note,use_id,use_account,seal_status)
24 24
         VALUES
25 25
         <foreach item="item" index="index" collection="list" separator=",">
26
-        (#{item.caseAppliLogId},#{item.annexId}, #{item.annexName}, #{item.annexPath},#{item.annexType},#{item.note},#{item.userId},#{item.userName},#{item.sealStatus})
26
+        (#{item.caseAppliLogId},#{item.annexId}, #{item.annexName}, #{item.annexPath},#{item.annexType},#{item.note},#{item.useId},#{item.useAccount},#{item.sealStatus})
27 27
         </foreach>
28 28
     </insert>
29 29
     <delete id="deleteByFileIds">
@@ -34,13 +34,13 @@
34 34
         </foreach>
35 35
     </delete>
36 36
 
37
-    <select id="queryAnnexPathByCaseId" resultType="com.ruoyi.wisdomarbitrate.domain.dto.mscase.CaseAttach" resultMap="CaseAttachResult">
37
+    <select id="queryAnnexPathByCaseId" resultType="com.ruoyi.wisdomarbitrate.domain.entity.mscase.MsCaseAttach" resultMap="CaseAttachResult">
38 38
         select *
39 39
         from ms_case_attach_log
40 40
         where case_appli_log_id =#{id}
41 41
     </select>
42 42
 
43
-    <select id="getCaseAttachByCaseIdAndType" resultType="com.ruoyi.wisdomarbitrate.domain.dto.mscase.CaseAttach" resultMap="CaseAttachResult">
43
+    <select id="getCaseAttachByCaseIdAndType" resultType="com.ruoyi.wisdomarbitrate.domain.entity.mscase.MsCaseAttach" resultMap="CaseAttachResult">
44 44
         select *
45 45
         from ms_case_attach_log
46 46
         <where>
@@ -71,7 +71,7 @@
71 71
             </if>
72 72
         </where>
73 73
     </select>
74
-    <select id="queryAnnexById" resultType="com.ruoyi.wisdomarbitrate.domain.dto.mscase.CaseAttach" resultMap="CaseAttachResult">
74
+    <select id="queryAnnexById" resultType="com.ruoyi.wisdomarbitrate.domain.entity.mscase.MsCaseAttach" resultMap="CaseAttachResult">
75 75
         select *
76 76
         from ms_case_attach_log
77 77
         <where>
@@ -81,14 +81,14 @@
81 81
         </where>
82 82
     </select>
83 83
 
84
-    <update id="updateCaseAttach" parameterType="com.ruoyi.wisdomarbitrate.domain.dto.mscase.CaseAttach">
84
+    <update id="updateCaseAttach" parameterType="com.ruoyi.wisdomarbitrate.domain.entity.mscase.MsCaseAttach">
85 85
         update ms_case_attach_log
86 86
         set
87 87
             case_appli_log_id= #{caseAppliLogId}
88 88
         where annex_id = #{annexId}
89 89
     </update>
90 90
 
91
-    <update id="updateCaseAttachBycaseid" parameterType="com.ruoyi.wisdomarbitrate.domain.dto.mscase.CaseAttach" >
91
+    <update id="updateCaseAttachBycaseid" parameterType="com.ruoyi.wisdomarbitrate.domain.entity.mscase.MsCaseAttach" >
92 92
         update ms_case_attach_log
93 93
         <set>
94 94
             <if test="annexName != null and annexName != ''">annex_name = #{annexName},</if>

+ 10
- 10
ruoyi-system/src/main/resources/mapper/wisdomarbitrate/mscase/MsCaseAttachMapper.xml Просмотреть файл

@@ -3,20 +3,20 @@
3 3
         PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
4 4
         "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
5 5
 <mapper namespace="com.ruoyi.wisdomarbitrate.mapper.mscase.MsCaseAttachMapper">
6
-    <resultMap type="com.ruoyi.wisdomarbitrate.domain.dto.mscase.CaseAttach" id="CaseAttachResult">
6
+    <resultMap type="com.ruoyi.wisdomarbitrate.domain.entity.mscase.MsCaseAttach" id="CaseAttachResult">
7 7
         <id     property="annexId"       column="annex_id"      />
8 8
         <result property="caseAppliId"       column="case_appli_id"      />
9 9
         <result property="annexName"     column="annex_name"    />
10 10
         <result property="annexPath"     column="annex_path"    />
11 11
         <result property="annexType"     column="annex_type"    />
12 12
         <result property="note"     column="note"    />
13
-        <result property="userId"     column="use_id"    />
14
-        <result property="userName"     column="use_account"    />
15 13
         <result property="sealStatus"     column="seal_status"    />
14
+        <result property="useId"     column="use_id"    />
15
+        <result property="useAccount"     column="use_account"    />
16 16
     </resultMap>
17 17
     <insert id="save" useGeneratedKeys="true" keyProperty="annexId">
18 18
         INSERT INTO ms_case_attach (case_appli_id, annex_name, annex_path , annex_type,note,use_id,use_account,seal_status,is_batch_upload)
19
-        VALUES (#{caseAppliId}, #{annexName}, #{annexPath},#{annexType},#{note},#{userId},#{userName},#{sealStatus},#{isBatchUpload})
19
+        VALUES (#{caseAppliId}, #{annexName}, #{annexPath},#{annexType},#{note},#{useId},#{useAccount},#{sealStatus},#{isBatchUpload})
20 20
     </insert>
21 21
     <insert id="batchSave" useGeneratedKeys="true" keyProperty="annexId">
22 22
         INSERT INTO ms_case_attach (case_appli_id, annex_name, annex_path , annex_type,note,use_id,use_account,seal_status,is_batch_upload)
@@ -24,7 +24,7 @@
24 24
         <foreach item="item" index="index" collection="list" separator=",">
25 25
 
26 26
 
27
-         (#{item.caseAppliId}, #{item.annexName}, #{item.annexPath},#{item.annexType},#{item.note},#{item.userId},#{item.userName},#{item.sealStatus},#{item.isBatchUpload})
27
+         (#{item.caseAppliId}, #{item.annexName}, #{item.annexPath},#{item.annexType},#{item.note},#{item.useId},#{item.useAccount},#{item.sealStatus},#{item.isBatchUpload})
28 28
         </foreach>
29 29
     </insert>
30 30
     <delete id="deleteByFileIds">
@@ -43,13 +43,13 @@
43 43
         </if>
44 44
     </delete>
45 45
 
46
-    <select id="queryAnnexPathByCaseId" resultType="com.ruoyi.wisdomarbitrate.domain.dto.mscase.CaseAttach" resultMap="CaseAttachResult">
46
+    <select id="queryAnnexPathByCaseId" resultType="com.ruoyi.wisdomarbitrate.domain.entity.mscase.MsCaseAttach" resultMap="CaseAttachResult">
47 47
         select annex_id,case_appli_id,annex_name,annex_path,annex_type,note,use_id,use_account
48 48
         from ms_case_attach
49 49
         where case_appli_id =#{id}
50 50
     </select>
51 51
 
52
-    <select id="getCaseAttachByCaseIdAndType" resultType="com.ruoyi.wisdomarbitrate.domain.dto.mscase.CaseAttach" resultMap="CaseAttachResult">
52
+    <select id="getCaseAttachByCaseIdAndType" resultType="com.ruoyi.wisdomarbitrate.domain.entity.mscase.MsCaseAttach" resultMap="CaseAttachResult">
53 53
         select annex_id,case_appli_id,annex_name,annex_path,annex_type,note,use_id,use_account
54 54
         from ms_case_attach
55 55
         <where>
@@ -86,7 +86,7 @@
86 86
             </if>
87 87
         </where>
88 88
     </select>
89
-    <select id="queryAnnexById" resultType="com.ruoyi.wisdomarbitrate.domain.dto.mscase.CaseAttach" resultMap="CaseAttachResult">
89
+    <select id="queryAnnexById" resultType="com.ruoyi.wisdomarbitrate.domain.entity.mscase.MsCaseAttach" resultMap="CaseAttachResult">
90 90
         select *
91 91
         from ms_case_attach
92 92
         <where>
@@ -96,14 +96,14 @@
96 96
         </where>
97 97
     </select>
98 98
 
99
-    <update id="updateCaseAttach" parameterType="com.ruoyi.wisdomarbitrate.domain.dto.mscase.CaseAttach">
99
+    <update id="updateCaseAttach" parameterType="com.ruoyi.wisdomarbitrate.domain.entity.mscase.MsCaseAttach">
100 100
         update ms_case_attach
101 101
         set
102 102
         case_appli_id= #{caseAppliId}
103 103
         where annex_id = #{annexId}
104 104
     </update>
105 105
 
106
-    <update id="updateCaseAttachBycaseid" parameterType="com.ruoyi.wisdomarbitrate.domain.dto.mscase.CaseAttach" >
106
+    <update id="updateCaseAttachBycaseid" parameterType="com.ruoyi.wisdomarbitrate.domain.entity.mscase.MsCaseAttach" >
107 107
         update ms_case_attach
108 108
         <set>
109 109
             <if test="annexName != null and annexName != ''">annex_name = #{annexName},</if>