瀏覽代碼

仲裁系统bug修复

18792927508 2 年之前
父節點
當前提交
48752c2712
共有 17 個檔案被更改,包括 321 行新增96 行删除
  1. 27
    0
      ruoyi-admin/src/main/java/com/ruoyi/RuoYiApplication.java
  2. 13
    0
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseApplicationController.java
  3. 5
    4
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseEvidenceController.java
  4. 2
    1
      ruoyi-admin/src/main/resources/application-druid.yml
  5. 14
    6
      ruoyi-admin/src/main/resources/application.yml
  6. 12
    0
      ruoyi-common/src/main/java/com/ruoyi/common/constant/CacheConstants.java
  7. 6
    0
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseAttach.java
  8. 4
    0
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/vo/CaseEvidenceVO.java
  9. 1
    1
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseAttachMapper.java
  10. 7
    0
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/ICaseApplicationService.java
  11. 1
    1
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/ICaseEvidenceService.java
  12. 25
    0
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java
  13. 77
    39
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseEvidenceServiceImpl.java
  14. 93
    38
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseZipImportImpl.java
  15. 6
    1
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/MsSignSealServiceImpl.java
  16. 1
    1
      ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml
  17. 27
    4
      ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseEvidenceMapper.xml

+ 27
- 0
ruoyi-admin/src/main/java/com/ruoyi/RuoYiApplication.java 查看文件

1
 package com.ruoyi;
1
 package com.ruoyi;
2
 
2
 
3
+import cn.hutool.core.collection.CollectionUtil;
4
+import com.ruoyi.common.constant.CacheConstants;
5
+import com.ruoyi.common.core.domain.entity.SysRole;
6
+import com.ruoyi.common.core.domain.entity.SysUser;
7
+import com.ruoyi.common.core.redis.RedisCache;
8
+import com.ruoyi.common.utils.spring.SpringUtils;
9
+import com.ruoyi.system.mapper.SysRoleMapper;
10
+import com.ruoyi.system.mapper.SysUserMapper;
3
 import org.springframework.boot.SpringApplication;
11
 import org.springframework.boot.SpringApplication;
4
 import org.springframework.boot.autoconfigure.SpringBootApplication;
12
 import org.springframework.boot.autoconfigure.SpringBootApplication;
5
 import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
13
 import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
6
 import org.springframework.scheduling.annotation.EnableScheduling;
14
 import org.springframework.scheduling.annotation.EnableScheduling;
7
 
15
 
16
+import java.util.List;
17
+
8
 /**
18
 /**
9
  * 启动程序
19
  * 启动程序
10
  * 
20
  * 
24
                 " / /_/ / / / /_/ / / / / /_/ /  / /__/ /_/ / /  \n" +
34
                 " / /_/ / / / /_/ / / / / /_/ /  / /__/ /_/ / /  \n" +
25
                 "/___/_/ /_/\\____/_/ /_/\\__, /   \\___/\\__,_/_/   \n" +
35
                 "/___/_/ /_/\\____/_/ /_/\\__, /   \\___/\\__,_/_/   \n" +
26
                 "                      /____/                    ");
36
                 "                      /____/                    ");
37
+        // 启动成功后,查询用户表,将用户信息存到redis
38
+        RedisCache redisCache = SpringUtils.getBean(RedisCache.class);
39
+        SysUserMapper userMapper = SpringUtils.getBean(SysUserMapper.class);
40
+        List<SysUser> sysUsers = userMapper.selectUserListByIds(null);
41
+        if(CollectionUtil.isNotEmpty(sysUsers)){
42
+            for (SysUser sysUser : sysUsers) {
43
+                redisCache.setCacheObject(CacheConstants.USER_KEY+sysUser.getUserId(),sysUser);
44
+            }
45
+        }
46
+        // 初始化角色redis
47
+        SysRoleMapper roleMapper = SpringUtils.getBean(SysRoleMapper.class);
48
+        List<SysRole> roles = roleMapper.selectRoleList(new SysRole());
49
+        if(CollectionUtil.isNotEmpty(roles)){
50
+            for (SysRole role : roles) {
51
+                redisCache.setCacheObject(CacheConstants.ROLE_KEY+role.getRoleName(),role.getRoleId());
52
+            }
53
+        }
27
     }
54
     }
28
 }
55
 }

+ 13
- 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseApplicationController.java 查看文件

585
         }
585
         }
586
         return caseApplicationService.updateCaseIdByAnnexId(caseAttach);
586
         return caseApplicationService.updateCaseIdByAnnexId(caseAttach);
587
     }
587
     }
588
+    /**
589
+     * 保存onlyOffice在线编辑的文件
590
+     * @param
591
+     * @return
592
+     */
593
+    @PostMapping("/saveOnlyOfficeFile")
594
+    public AjaxResult saveOnlyOfficeFile(  @RequestBody CaseAttach caseAttach) {
595
+        if(caseAttach.getCaseAppliId()==null||StrUtil.isEmpty(caseAttach.getOnlyOfficeFileId())||StrUtil.isEmpty(caseAttach.getAnnexPath())){
596
+            return error("参数校验失败");
597
+        }
598
+
599
+        return  caseApplicationService.saveOnlyOfficeFile(caseAttach);
600
+    }
588
 }
601
 }

+ 5
- 4
ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseEvidenceController.java 查看文件

6
 import com.ruoyi.common.core.domain.AjaxResult;
6
 import com.ruoyi.common.core.domain.AjaxResult;
7
 import com.ruoyi.common.core.page.TableDataInfo;
7
 import com.ruoyi.common.core.page.TableDataInfo;
8
 import com.ruoyi.wisdomarbitrate.domain.CaseApplication;
8
 import com.ruoyi.wisdomarbitrate.domain.CaseApplication;
9
+import com.ruoyi.wisdomarbitrate.domain.CaseAttach;
9
 import com.ruoyi.wisdomarbitrate.domain.CaseEvidenceDirectory;
10
 import com.ruoyi.wisdomarbitrate.domain.CaseEvidenceDirectory;
10
 import com.ruoyi.wisdomarbitrate.domain.dto.CaseEvidenceDTO;
11
 import com.ruoyi.wisdomarbitrate.domain.dto.CaseEvidenceDTO;
11
 import com.ruoyi.wisdomarbitrate.domain.vo.CaseEvidenceVO;
12
 import com.ruoyi.wisdomarbitrate.domain.vo.CaseEvidenceVO;
101
 
102
 
102
     /**
103
     /**
103
      * 删除附件
104
      * 删除附件
104
-     * @param fileIds
105
+     * @param caseAttach
105
      * @return
106
      * @return
106
      */
107
      */
107
     @PostMapping("/deleteFile")
108
     @PostMapping("/deleteFile")
108
-    public AjaxResult deleteFile( @RequestParam("fileIds") List<Integer> fileIds){
109
+    public AjaxResult deleteFile(@RequestBody CaseAttach caseAttach){
109
 
110
 
110
-        if(CollectionUtil.isEmpty(fileIds)){
111
+        if(CollectionUtil.isEmpty(caseAttach.getFileIds())){
111
             return error("附件id不能为空");
112
             return error("附件id不能为空");
112
         }
113
         }
113
-        return toAjax(caseEvidenceService.deleteFile( fileIds));
114
+        return success(caseEvidenceService.deleteFile( caseAttach.getFileIds()));
114
     }
115
     }
115
 
116
 
116
 
117
 

+ 2
- 1
ruoyi-admin/src/main/resources/application-druid.yml 查看文件

6
         druid:
6
         druid:
7
             # 主库数据源
7
             # 主库数据源
8
             master:
8
             master:
9
-                url: jdbc:mysql://121.40.189.20:3306/test_smart_arbitration?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=Asia/Shanghai&useSSL=false
9
+                url: jdbc:mysql://121.40.189.20:3306/test_smart_arbitration?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&allowMultiQueries=true&useSSL=true&serverTimezone=Asia/Shanghai&useSSL=false
10
+#                url: jdbc:mysql://121.40.189.20:3306/smart_arbitration?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&allowMultiQueries=true&useSSL=true&serverTimezone=Asia/Shanghai&useSSL=false
10
                 username: root
11
                 username: root
11
                 password: YMzc157#
12
                 password: YMzc157#
12
             # 从库数据源
13
             # 从库数据源

+ 14
- 6
ruoyi-admin/src/main/resources/application.yml 查看文件

17
 
17
 
18
 # 开发环境配置
18
 # 开发环境配置
19
 server:
19
 server:
20
-  # 服务器的HTTP端口,默认为8080
20
+  # 服务器的HTTP端口,默认为8001,正式9001
21
   port: 8001
21
   port: 8001
22
   servlet:
22
   servlet:
23
     # 应用的访问路径
23
     # 应用的访问路径
58
   servlet:
58
   servlet:
59
     multipart:
59
     multipart:
60
       # 单个文件大小
60
       # 单个文件大小
61
-      max-file-size: 50MB
61
+      max-file-size: 1000MB
62
       # 设置总上传的文件大小
62
       # 设置总上传的文件大小
63
-      max-request-size: 500MB
63
+      max-request-size: 10000MB
64
   # 服务模块
64
   # 服务模块
65
   devtools:
65
   devtools:
66
     restart:
66
     restart:
72
     host: 121.40.189.20
72
     host: 121.40.189.20
73
     # 端口,默认为6379
73
     # 端口,默认为6379
74
     port: 6389
74
     port: 6389
75
-    # 数据库索引
76
-    database: 0
75
+    # 数据库索引,2-正式,3-测试
76
+    database: 3
77
     # 密码
77
     # 密码
78
     password:
78
     password:
79
     # 连接超时时间
79
     # 连接超时时间
121
   # 令牌密钥
121
   # 令牌密钥
122
   secret: abcdefghijklmnopqrstuvwxyz
122
   secret: abcdefghijklmnopqrstuvwxyz
123
   # 令牌有效期(默认30分钟)
123
   # 令牌有效期(默认30分钟)
124
-  expireTime: 30
124
+  expireTime: 1200
125
 
125
 
126
 # MyBatis配置
126
 # MyBatis配置
127
 mybatis:
127
 mybatis:
183
   secretId: AKID3xfHgroY4MQHvLXUXMwIQL1UjmbBX1Tv
183
   secretId: AKID3xfHgroY4MQHvLXUXMwIQL1UjmbBX1Tv
184
   # 腾讯云密钥
184
   # 腾讯云密钥
185
   secretKey: INDrIXcT8YmomZBcsy0oNirnU0LTN4X7
185
   secretKey: INDrIXcT8YmomZBcsy0oNirnU0LTN4X7
186
+#  onlyOffice系统url配置
187
+onlyOfficeConfig:
188
+  #  url: http://172.16.0.254:9090/files/upload
189
+  url: http://121.40.189.20:9090/files/upload
190
+# 调解机构代码配置
191
+organizeConfig:
192
+  # creditCode
193
+  creditCode: 910000058386410044
186
 #jodconverter:
194
 #jodconverter:
187
 #  local:
195
 #  local:
188
 #    host: 121.40.189.20
196
 #    host: 121.40.189.20

+ 12
- 0
ruoyi-common/src/main/java/com/ruoyi/common/constant/CacheConstants.java 查看文件

42
      */
42
      */
43
     public static final String PWD_ERR_CNT_KEY = "pwd_err_cnt:";
43
     public static final String PWD_ERR_CNT_KEY = "pwd_err_cnt:";
44
     public static final String  WE_CHAT_SMS_VERIFY_CODE_KEY="we_chat_sms_verify_code:";
44
     public static final String  WE_CHAT_SMS_VERIFY_CODE_KEY="we_chat_sms_verify_code:";
45
+    /**
46
+ * 所有用户 redis key
47
+ */
48
+public static final String USER_KEY = "user_key:";
49
+    /**
50
+     * 用户邮箱 redis key
51
+     */
52
+//    public static final String USER_EMAIL_KEY = "user_email_key:";
53
+    /**
54
+     * 角色 redis key
55
+     */
56
+    public static final String ROLE_KEY = "role_key:";
45
 }
57
 }

+ 6
- 0
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseAttach.java 查看文件

6
 import lombok.Data;
6
 import lombok.Data;
7
 import lombok.NoArgsConstructor;
7
 import lombok.NoArgsConstructor;
8
 
8
 
9
+import java.util.List;
10
+
9
 @Builder
11
 @Builder
10
 @Data
12
 @Data
11
 @AllArgsConstructor
13
 @AllArgsConstructor
59
      * 是否是证据上传,0-否,1-是
61
      * 是否是证据上传,0-否,1-是
60
      */
62
      */
61
     private Integer isBatchUpload;
63
     private Integer isBatchUpload;
64
+    /**
65
+     * 附件ids
66
+     */
67
+    private List<Long> fileIds;
62
 
68
 
63
 }
69
 }

+ 4
- 0
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/vo/CaseEvidenceVO.java 查看文件

37
      */
37
      */
38
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
38
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
39
     private Date scheduleStartTime;
39
     private Date scheduleStartTime;
40
+    /**
41
+     * 案件编号
42
+     */
43
+    private String caseStatusName;
40
 }
44
 }

+ 1
- 1
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseAttachMapper.java 查看文件

21
 
21
 
22
     int updateCaseAttachBycaseid(CaseAttach caseAttach);
22
     int updateCaseAttachBycaseid(CaseAttach caseAttach);
23
 
23
 
24
-    int deleteByFileIds(@Param("ids") List<Integer> fileIds);
24
+    int deleteByFileIds(@Param("ids") List<Long> fileIds);
25
 
25
 
26
     List<CaseAttach> getCaseAttachByCaseIdAndType(CaseAttach caseAttach);
26
     List<CaseAttach> getCaseAttachByCaseIdAndType(CaseAttach caseAttach);
27
 
27
 

+ 7
- 0
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/ICaseApplicationService.java 查看文件

161
      * @param annexPath
161
      * @param annexPath
162
      */
162
      */
163
     JSONArray uploadOnlyOffice(String annexPath, Long id);
163
     JSONArray uploadOnlyOffice(String annexPath, Long id);
164
+    /**
165
+     * 保存onlyOffice在线编辑的文件
166
+     * @param
167
+     * @return
168
+     */
169
+
170
+    AjaxResult saveOnlyOfficeFile(CaseAttach caseAttach);
164
 }
171
 }

+ 1
- 1
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/ICaseEvidenceService.java 查看文件

36
 
36
 
37
     AjaxResult fileList(Long caseAppliId,  List<Integer> annexTypeList);
37
     AjaxResult fileList(Long caseAppliId,  List<Integer> annexTypeList);
38
 
38
 
39
-    int deleteFile( List<Integer> fileIds);
39
+    int deleteFile( List<Long> fileIds);
40
 
40
 
41
     List<CaseEvidenceDirectoryVO> selectEvidenceTreeList(CaseEvidenceDirectory caseEvidenceDirectory);
41
     List<CaseEvidenceDirectoryVO> selectEvidenceTreeList(CaseEvidenceDirectory caseEvidenceDirectory);
42
 
42
 

+ 25
- 0
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java 查看文件

63
 import java.util.stream.Collectors;
63
 import java.util.stream.Collectors;
64
 import java.util.zip.ZipOutputStream;
64
 import java.util.zip.ZipOutputStream;
65
 
65
 
66
+import static cn.hutool.system.SystemUtil.getUserInfo;
67
+import static com.google.common.io.Files.getFileExtension;
66
 import static com.ruoyi.common.core.domain.AjaxResult.error;
68
 import static com.ruoyi.common.core.domain.AjaxResult.error;
67
 import static com.ruoyi.common.core.domain.AjaxResult.success;
69
 import static com.ruoyi.common.core.domain.AjaxResult.success;
68
 import static com.ruoyi.common.utils.PageUtils.startPage;
70
 import static com.ruoyi.common.utils.PageUtils.startPage;
3945
         caseAttachMapper.updateCaseAttach(caseAttach);
3947
         caseAttachMapper.updateCaseAttach(caseAttach);
3946
         return success();
3948
         return success();
3947
     }
3949
     }
3950
+    /**
3951
+     * 保存onlyOffice在线编辑的文件
3952
+     * @param
3953
+     * @return
3954
+     */
3955
+    @Transactional
3956
+    @Override
3957
+    public AjaxResult saveOnlyOfficeFile(CaseAttach caseAttach) {
3958
+        if(StrUtil.isNotEmpty(caseAttach.getAnnexPath())){
3959
+            String replace = caseAttach.getAnnexPath().replace("/home/ruoyi/uploadPath/", "/profile/");
3960
+            caseAttach.setAnnexName(replace);
3948
 
3961
 
3962
+        }
3963
+        caseAttach.setAnnexPath("/home/ruoyi/uploadPath/onlyoffice/");
3964
+
3965
+        caseAttach.setAnnexType(3);
3966
+        caseAttach.setUserId(SecurityUtils.getUserId());
3967
+        caseAttach.setUserName(SecurityUtils.getUsername());
3968
+        // 先删除之前的在新增
3969
+        caseAttachMapper.deleteCaseAttachByCasedIdAndType(caseAttach.getCaseAppliId(), caseAttach.getAnnexType());
3970
+        caseAttachMapper.save(caseAttach);
3971
+
3972
+        return AjaxResult.success();
3973
+    }
3949
 
3974
 
3950
 }
3975
 }
3951
 
3976
 

+ 77
- 39
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseEvidenceServiceImpl.java 查看文件

1
 package com.ruoyi.wisdomarbitrate.service.impl;
1
 package com.ruoyi.wisdomarbitrate.service.impl;
2
 
2
 
3
+import cn.hutool.core.bean.BeanUtil;
3
 import cn.hutool.core.collection.CollectionUtil;
4
 import cn.hutool.core.collection.CollectionUtil;
4
 import cn.hutool.core.util.StrUtil;
5
 import cn.hutool.core.util.StrUtil;
6
+import com.alibaba.fastjson.JSONArray;
7
+import com.alibaba.fastjson.JSONObject;
5
 import com.ruoyi.common.config.RuoYiConfig;
8
 import com.ruoyi.common.config.RuoYiConfig;
6
 import com.ruoyi.common.constant.CaseApplicationConstants;
9
 import com.ruoyi.common.constant.CaseApplicationConstants;
7
 import com.ruoyi.common.core.domain.AjaxResult;
10
 import com.ruoyi.common.core.domain.AjaxResult;
11
 import com.ruoyi.common.utils.SecurityUtils;
14
 import com.ruoyi.common.utils.SecurityUtils;
12
 import com.ruoyi.common.utils.SmsUtils;
15
 import com.ruoyi.common.utils.SmsUtils;
13
 import com.ruoyi.common.utils.StringUtils;
16
 import com.ruoyi.common.utils.StringUtils;
17
+import com.ruoyi.common.utils.file.FileUtils;
14
 import com.ruoyi.common.utils.spring.SpringUtils;
18
 import com.ruoyi.common.utils.spring.SpringUtils;
15
 import com.ruoyi.system.mapper.SysUserMapper;
19
 import com.ruoyi.system.mapper.SysUserMapper;
16
 import com.ruoyi.wisdomarbitrate.domain.vo.CaseEvidenceDirectoryVO;
20
 import com.ruoyi.wisdomarbitrate.domain.vo.CaseEvidenceDirectoryVO;
21
+import com.ruoyi.wisdomarbitrate.service.ICaseApplicationService;
17
 import com.ruoyi.wisdomarbitrate.utils.CaseLogUtils;
22
 import com.ruoyi.wisdomarbitrate.utils.CaseLogUtils;
18
 import com.ruoyi.common.utils.file.FileUploadUtils;
23
 import com.ruoyi.common.utils.file.FileUploadUtils;
19
 import com.ruoyi.wisdomarbitrate.domain.*;
24
 import com.ruoyi.wisdomarbitrate.domain.*;
32
 import java.util.*;
37
 import java.util.*;
33
 import java.util.stream.Collectors;
38
 import java.util.stream.Collectors;
34
 
39
 
40
+import static com.google.common.io.Files.getFileExtension;
35
 import static com.ruoyi.common.utils.SecurityUtils.getUsername;
41
 import static com.ruoyi.common.utils.SecurityUtils.getUsername;
36
 
42
 
37
 @Service
43
 @Service
50
     private SysUserMapper sysUserMapper;
56
     private SysUserMapper sysUserMapper;
51
     @Autowired
57
     @Autowired
52
     private SmsRecordMapper smsRecordMapper;
58
     private SmsRecordMapper smsRecordMapper;
59
+    @Autowired
60
+    private ICaseApplicationService caseApplicationService;
53
 
61
 
54
     @Override
62
     @Override
55
     @Transactional
63
     @Transactional
134
             String filePath = RuoYiConfig.getUploadPath();
142
             String filePath = RuoYiConfig.getUploadPath();
135
             // 上传
143
             // 上传
136
             String fileName = FileUploadUtils.upload(filePath, file);
144
             String fileName = FileUploadUtils.upload(filePath, file);
137
-            CaseAttach caseAttach = CaseAttach.builder().caseAppliId(id)
138
-                    .annexName(fileName)
139
-                    .annexPath(filePath)
140
-                    .annexType(annexType)
141
-                    .userId(userId)
142
-                    .userName(userName)
143
-                    .build();
144
-            int count = caseAttachMapper.save(caseAttach);
145
-            if (count > 0 && annexType != null && annexType != 8) {
145
+            String suffix = getFileExtension(fileName);
146
+            if(StrUtil.isNotEmpty(suffix)&& suffix.contains("doc")){
147
+                // 上传到onlyoffice
148
+                JSONArray jsonArray = caseApplicationService.uploadOnlyOffice(fileName,id);
149
+                if(jsonArray!=null && jsonArray.size() > 0) {
150
+                    for (Object obj : jsonArray) {
151
+                        JSONObject jsonObject = (JSONObject) obj;
152
+                       CaseAttach caseAttach = CaseAttach.builder()
153
+                                .caseAppliId(id)
154
+                               .annexType(annexType)
155
+                                .annexName(jsonObject.get("fileName")!=null?jsonObject.getString("fileName"):"")
156
+                                .onlyOfficeFileId(jsonObject.getString("fileId"))
157
+                                .build();
158
+                        if(jsonObject.get("filePath")!=null){
159
+                            String officePath = jsonObject.getString("filePath");
160
+                            String replace = officePath.replace("/home/ruoyi/uploadPath/", "/profile/");
161
+                            caseAttach.setAnnexPath(replace);
162
+
163
+                        }
164
+                        caseAttachMapper.save(caseAttach);
165
+                    }
166
+                }
167
+            }else {
168
+                CaseAttach caseAttach = CaseAttach.builder().caseAppliId(id)
169
+                        .annexName(fileName)
170
+                        .annexPath(filePath)
171
+                        .annexType(annexType)
172
+                        .userId(userId)
173
+                        .userName(userName)
174
+                        .build();
175
+                int count = caseAttachMapper.save(caseAttach);
176
+            }
177
+            if ( annexType != null && annexType != 8) {
146
                 if (id != null) {
178
                 if (id != null) {
147
                     //修改案件状态
179
                     //修改案件状态
148
                     CaseApplication caseApplication = new CaseApplication();
180
                     CaseApplication caseApplication = new CaseApplication();
151
                     caseApplicationMapper.submitCaseApplication(caseApplication);
183
                     caseApplicationMapper.submitCaseApplication(caseApplication);
152
                 }
184
                 }
153
             }
185
             }
154
-                CaseAttach caseAttachselect = new CaseAttach();
155
-                caseAttachselect.setAnnexId(caseAttach.getAnnexId());
156
-            String annexName = caseAttach.getAnnexName();
157
-            if(StrUtil.isNotEmpty(annexName)) {
158
-                int startIndexnew = annexName.lastIndexOf("/");
159
-                if (startIndexnew != -1) {
160
-                    String annexNamenew = annexName.substring(startIndexnew + 1);
161
-                    caseAttach.setAnnexName(annexNamenew);
162
-                }
163
-            }
164
-                caseAttachselect.setAnnexType(caseAttach.getAnnexType());
165
-                return AjaxResult.success("上传成功", caseAttachselect);
186
+                return AjaxResult.success();
166
         } catch (IOException e) {
187
         } catch (IOException e) {
167
             e.printStackTrace();
188
             e.printStackTrace();
168
         }
189
         }
265
     @Transactional
286
     @Transactional
266
     @Override
287
     @Override
267
     public AjaxResult batchUpload(MultipartFile[] files, Integer annexType, Long id, String userName, Long userId) {
288
     public AjaxResult batchUpload(MultipartFile[] files, Integer annexType, Long id, String userName, Long userId) {
268
-        List<CaseAttach> successList = new ArrayList<>();
269
         try {
289
         try {
270
             String filePath = RuoYiConfig.getUploadPath();
290
             String filePath = RuoYiConfig.getUploadPath();
271
             for (MultipartFile file : files) {
291
             for (MultipartFile file : files) {
272
                 // 上传
292
                 // 上传
273
                 String fileName = FileUploadUtils.upload(filePath, file);
293
                 String fileName = FileUploadUtils.upload(filePath, file);
274
-                CaseAttach caseAttach = CaseAttach.builder().caseAppliId(id)
275
-                        .annexName(fileName)
276
-                        .annexPath(filePath)
277
-                        .annexType(annexType)
278
-                        .userId(userId)
279
-                        .userName(userName)
280
-                        .isBatchUpload(1)
281
-                        .build();
282
-                int count = caseAttachMapper.save(caseAttach);
283
-                if (count > 0 && annexType != null && annexType != 8) {
284
-                    CaseAttach caseAttachselect = new CaseAttach();
285
-                    caseAttachselect.setAnnexId(caseAttach.getAnnexId());
286
-                    caseAttachselect.setAnnexName(caseAttach.getAnnexName());
287
-                    caseAttachselect.setAnnexType(caseAttach.getAnnexType());
288
-                    successList.add(caseAttachselect);
294
+                String suffix = getFileExtension(fileName);
295
+                if (StrUtil.isNotEmpty(suffix) && suffix.contains("doc")) {
296
+                    // 上传onlyoffice
297
+                    JSONArray jsonArray = caseApplicationService.uploadOnlyOffice(fileName,id);
298
+                    if(jsonArray!=null && jsonArray.size() > 0) {
299
+                        for (Object obj : jsonArray) {
300
+                            JSONObject jsonObject = (JSONObject) obj;
301
+                            CaseAttach   caseAttach = CaseAttach.builder()
302
+                                    .caseAppliId(id)
303
+                                    .annexType(annexType)
304
+                                    .annexName(jsonObject.get("fileName")!=null?jsonObject.getString("fileName"):"")
305
+
306
+                                    .onlyOfficeFileId(jsonObject.getString("fileId"))
307
+                                    .build();
308
+                            if(jsonObject.get("filePath")!=null){
309
+                                String officePath = jsonObject.getString("filePath");
310
+                                String replace = officePath.replace("/home/ruoyi/uploadPath/", "/profile/");
311
+                                caseAttach.setAnnexPath(replace);
312
+
313
+                            }
314
+                            caseAttachMapper.save(caseAttach);
315
+                        }
316
+                    }
317
+                }else {
318
+                    CaseAttach caseAttach = CaseAttach.builder().caseAppliId(id)
319
+                            .annexName(fileName)
320
+                            .annexPath(filePath)
321
+                            .annexType(annexType)
322
+                            .userId(userId)
323
+                            .userName(userName)
324
+                            .isBatchUpload(1)
325
+                            .build();
326
+                    int count = caseAttachMapper.save(caseAttach);
289
                 }
327
                 }
290
             }
328
             }
291
 
329
 
333
         }
371
         }
334
 
372
 
335
 
373
 
336
-        return AjaxResult.success("上传成功", successList);
374
+        return AjaxResult.success("上传成功");
337
 
375
 
338
     }
376
     }
339
 
377
 
363
     }
401
     }
364
 
402
 
365
     @Override
403
     @Override
366
-    public int deleteFile(List<Integer> fileIds) {
404
+    public int deleteFile(List<Long> fileIds) {
367
         return caseAttachMapper.deleteByFileIds(fileIds);
405
         return caseAttachMapper.deleteByFileIds(fileIds);
368
     }
406
     }
369
 
407
 

+ 93
- 38
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseZipImportImpl.java 查看文件

4
 import cn.hutool.core.collection.CollectionUtil;
4
 import cn.hutool.core.collection.CollectionUtil;
5
 import cn.hutool.core.util.ObjectUtil;
5
 import cn.hutool.core.util.ObjectUtil;
6
 import cn.hutool.core.util.StrUtil;
6
 import cn.hutool.core.util.StrUtil;
7
+import com.alibaba.fastjson.JSONArray;
8
+import com.alibaba.fastjson.JSONObject;
7
 import com.ruoyi.common.constant.CaseApplicationConstants;
9
 import com.ruoyi.common.constant.CaseApplicationConstants;
8
 import com.ruoyi.common.constant.Constants;
10
 import com.ruoyi.common.constant.Constants;
9
 import com.ruoyi.common.core.domain.entity.SysDept;
11
 import com.ruoyi.common.core.domain.entity.SysDept;
47
 import java.util.regex.Pattern;
49
 import java.util.regex.Pattern;
48
 import java.util.stream.Collectors;
50
 import java.util.stream.Collectors;
49
 
51
 
52
+import static com.google.common.io.Files.getFileExtension;
50
 import static com.ruoyi.common.core.domain.AjaxResult.error;
53
 import static com.ruoyi.common.core.domain.AjaxResult.error;
51
 import static com.ruoyi.common.core.domain.AjaxResult.success;
54
 import static com.ruoyi.common.core.domain.AjaxResult.success;
52
 import static com.ruoyi.common.utils.SecurityUtils.getUsername;
55
 import static com.ruoyi.common.utils.SecurityUtils.getUsername;
93
     // 申请人角色id
96
     // 申请人角色id
94
     private long roleId;
97
     private long roleId;
95
     private Integer maxCaseNum;
98
     private Integer maxCaseNum;
99
+    @Autowired
100
+    private CaseZipImportImpl caseZipImportImpl;
96
 
101
 
97
 
102
 
98
 @Transactional
103
 @Transactional
164
         }
169
         }
165
 
170
 
166
     File[] files = directory.listFiles();
171
     File[] files = directory.listFiles();
167
-    CaseZipImportTask caseZipImportTask = null;
168
-    try {
169
-        caseZipImportTask = new CaseZipImportTask(this, templateId, fatchRuleList,  fatchRuleMap, userMap, dictDataList, files , deptMap, SecurityUtils.getLoginUser());
170
-    } catch (Exception e) {
171
-        return error("导入失败");
172
-    }
173
-    Future<List<CaseApplication>> future = ThreadPoolUtil.submit(caseZipImportTask);
174
-        try {
175
-            if(future.get()!=null){
176
-                return success("导入成功");
172
+        // todo
173
+    List<CaseApplication> caseApplications = new ArrayList<>();
174
+    for (File file1 : files) {
175
+        if (file1.isDirectory() && file1.listFiles() != null) {
176
+
177
+            for (File file2 : file1.listFiles()) {
178
+
179
+                CaseApplication caseApplication = caseZipImportImpl.buildCaseInfo(file2, templateId, fatchRuleList, fatchRuleMap, userMap, dictDataList, deptMap, SecurityUtils.getLoginUser());
180
+                if (caseApplication != null) {
181
+                    caseApplications.add(caseApplication);
182
+                }
177
             }
183
             }
178
-        } catch (InterruptedException | ExecutionException e) {
179
-            e.printStackTrace();
180
-            return error(e.getMessage());
181
         }
184
         }
182
-    return error("导入失败");
185
+    }
186
+    if (CollectionUtil.isEmpty(caseApplications)) {
187
+        return error("导入失败");
188
+    }
189
+//    CaseZipImportTask caseZipImportTask = null;
190
+//    try {
191
+//        caseZipImportTask = new CaseZipImportTask(this, templateId, fatchRuleList,  fatchRuleMap, userMap, dictDataList, files , deptMap, SecurityUtils.getLoginUser());
192
+//    } catch (Exception e) {
193
+//        return error("导入失败");
194
+//    }
195
+//    Future<List<CaseApplication>> future = ThreadPoolUtil.submit(caseZipImportTask);
196
+//        try {
197
+//            if(future.get()!=null){
198
+//                return success("导入成功");
199
+//            }
200
+//        } catch (InterruptedException | ExecutionException e) {
201
+//            e.printStackTrace();
202
+//            return error(e.getMessage());
203
+//        }
204
+    return success("导入成功");
183
 
205
 
184
 
206
 
185
     }
207
     }
207
             if (fatchMap.size() > 0) {
229
             if (fatchMap.size() > 0) {
208
 
230
 
209
                 // 尊敬的{1},您的代理的案件已接入仲裁系统,复制访问https://miniapp-3gpama6l759911ef-1321289474.tcloudbaseapp.com/jump-mp.html 进入小程序进行认证注册。如非本人操作,请忽略本短信
231
                 // 尊敬的{1},您的代理的案件已接入仲裁系统,复制访问https://miniapp-3gpama6l759911ef-1321289474.tcloudbaseapp.com/jump-mp.html 进入小程序进行认证注册。如非本人操作,请忽略本短信
210
-                SmsUtils.SendSmsRequest request = new SmsUtils.SendSmsRequest();
211
-                request.setTemplateId("1956159");
232
+//                SmsUtils.SendSmsRequest request = new SmsUtils.SendSmsRequest();
233
+//                request.setTemplateId("1956159");
212
 
234
 
213
                 // 新增的案件
235
                 // 新增的案件
214
                 // 组装案件内置字段主表内容
236
                 // 组装案件内置字段主表内容
268
                     if (StrUtil.isEmpty(fileUrl)) {
290
                     if (StrUtil.isEmpty(fileUrl)) {
269
                         continue;
291
                         continue;
270
                     }
292
                     }
271
-                    // 上传
272
-                    String filePath = RuoYiConfig.getUploadPath();
273
-
274
-                    CaseAttach caseAttach = new CaseAttach();
275
-                    caseAttach.setCaseAppliId(caseApplication.getId());
276
-                    caseAttach.setAnnexPath(filePath);
277
-                    if (StrUtil.isNotEmpty(fileUrl)) {
278
-                        String fileName = fileUrl.replace(filePath, "/profile/upload");
279
-                        caseAttach.setAnnexName(fileName);
280
-                    }
281
-                    // 申请人提供的证据材料
282
-                    caseAttach.setAnnexType(2);
283
-                    caseAttachs.add(caseAttach);
284
-                    if (fileUrl.contains("仲裁申请书")) {
285
-                        CaseAttach applyFile = new CaseAttach();
286
-                        BeanUtil.copyProperties(caseAttach, applyFile);
287
-                        applyFile.setAnnexType(1);
288
-                        caseAttachs.add(applyFile);
289
-                    }
293
+                    String suffix = getFileExtension(fileUrl);
294
+                    if (StrUtil.isNotEmpty(suffix) && suffix.contains("doc")) {
295
+                        // 上传onlyoffice
296
+                        JSONArray jsonArray = caseApplicationService.uploadOnlyOffice(fileUrl,caseApplication.getId());
297
+                        if(jsonArray!=null && jsonArray.size() > 0) {
298
+                            for (Object obj : jsonArray) {
299
+                                JSONObject jsonObject = (JSONObject) obj;
300
+                             CaseAttach   caseAttach = CaseAttach.builder()
301
+                                        .caseAppliId(caseApplication.getId())
302
+                                        .annexName(jsonObject.get("fileName")!=null?jsonObject.getString("fileName"):"")
303
+
304
+                                        .onlyOfficeFileId(jsonObject.getString("fileId"))
305
+                                        .build();
306
+                                if(jsonObject.get("filePath")!=null){
307
+                                    String officePath = jsonObject.getString("filePath");
308
+                                    String replace = officePath.replace("/home/ruoyi/uploadPath/", "/profile/");
309
+                                    caseAttach.setAnnexPath(replace);
310
+
311
+                                }
312
+                                if(fileUrl.contains("申请书")){
313
+                                    CaseAttach applyFile = new CaseAttach();
314
+                                    BeanUtil.copyProperties(caseAttach, applyFile);
315
+                                    applyFile.setAnnexType(1);
316
+                                    caseAttachs.add(applyFile);
317
+                                }
318
+                                    caseAttach.setAnnexType(2);
319
+                                    caseAttachs.add(caseAttach);
320
+
321
+                            }
322
+                        }
323
+                    } else {
324
+                        // 上传
325
+                        String filePath = RuoYiConfig.getUploadPath();
326
+
327
+                        CaseAttach caseAttach = new CaseAttach();
328
+                        caseAttach.setCaseAppliId(caseApplication.getId());
329
+                        caseAttach.setAnnexPath(filePath);
330
+                        if (StrUtil.isNotEmpty(fileUrl)) {
331
+                            String fileName = fileUrl.replace(filePath, "/profile/upload");
332
+                            caseAttach.setAnnexName(fileName);
333
+                        }
334
+                        // 申请人提供的证据材料
335
+                        caseAttach.setAnnexType(2);
336
+                        caseAttachs.add(caseAttach);
337
+                        if (fileUrl.contains("申请书")) {
338
+                            CaseAttach applyFile = new CaseAttach();
339
+                            BeanUtil.copyProperties(caseAttach, applyFile);
340
+                            applyFile.setAnnexType(1);
341
+                            caseAttachs.add(applyFile);
342
+                        }
290
 
343
 
344
+                    }
291
                 }
345
                 }
292
                 caseApplication.setCaseAttachList(caseAttachs);
346
                 caseApplication.setCaseAttachList(caseAttachs);
293
                 // 案件压缩包导入
347
                 // 案件压缩包导入
300
 //                }
354
 //                }
301
 
355
 
302
                 // 多线程执行
356
                 // 多线程执行
303
-                ThreadPoolUtil.execute(() -> {
357
+//                ThreadPoolUtil.execute(() -> {
304
                     try {
358
                     try {
359
+
305
                         caseApplicationMapper.insertCaseApplication(caseApplication);
360
                         caseApplicationMapper.insertCaseApplication(caseApplication);
306
                         // 新增日志
361
                         // 新增日志
307
                         CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.CASE_APPLICATION, "",loginUser);
362
                         CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.CASE_APPLICATION, "",loginUser);
337
 
392
 
338
                     } catch (Exception e) {
393
                     } catch (Exception e) {
339
                         e.printStackTrace();
394
                         e.printStackTrace();
340
-                        throw new RuntimeException("导入失败,请检查抓取规则是否正确");
395
+                        throw new RuntimeException("案件导入失败");
341
                     }
396
                     }
342
 
397
 
343
-                });
398
+//                });
344
                 return caseApplication;
399
                 return caseApplication;
345
             }
400
             }
346
         }
401
         }

+ 6
- 1
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/MsSignSealServiceImpl.java 查看文件

10
 import com.ruoyi.common.core.domain.entity.EsignHttpResponse;
10
 import com.ruoyi.common.core.domain.entity.EsignHttpResponse;
11
 import com.ruoyi.common.exception.EsignDemoException;
11
 import com.ruoyi.common.exception.EsignDemoException;
12
 import com.ruoyi.common.utils.EmailOutUtil;
12
 import com.ruoyi.common.utils.EmailOutUtil;
13
+import com.ruoyi.common.utils.SecurityUtils;
13
 import com.ruoyi.common.utils.StringUtils;
14
 import com.ruoyi.common.utils.StringUtils;
14
 import com.ruoyi.common.utils.file.SaaSAPIFileUtils;
15
 import com.ruoyi.common.utils.file.SaaSAPIFileUtils;
15
 import com.ruoyi.system.mapper.SysUserMapper;
16
 import com.ruoyi.system.mapper.SysUserMapper;
162
                             caseAttach.setAnnexType(3);
163
                             caseAttach.setAnnexType(3);
163
                             caseAttach.setAnnexPath(savePath);
164
                             caseAttach.setAnnexPath(savePath);
164
                             caseAttach.setAnnexName(saveName);
165
                             caseAttach.setAnnexName(saveName);
165
-                            caseAttachMapper.updateCaseAttachBycaseid(caseAttach);
166
+                            caseAttach.setUserName(SecurityUtils.getUsername());
167
+                            caseAttach.setUserId(SecurityUtils.getUserId());
168
+                            // 删除已存在的
169
+                            caseAttachMapper.deleteCaseAttachByCasedIdAndType(caseAppliId, 3);
170
+                            caseAttachMapper.save(caseAttach);
166
                         }
171
                         }
167
 
172
 
168
                     }
173
                     }

+ 1
- 1
ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml 查看文件

1113
         c.batch_number,
1113
         c.batch_number,
1114
         c.facts,
1114
         c.facts,
1115
         c.appli_iswrit_hear,c.respon_isWrit_hear,
1115
         c.appli_iswrit_hear,c.respon_isWrit_hear,
1116
-        c.mediation_agreement,c.template_id templateId
1116
+        c.mediation_agreement,c.template_id templateId,c.appli_iswrit_hear,c.respon_isWrit_hear
1117
         from case_application c
1117
         from case_application c
1118
         LEFT JOIN case_affiliate ca ON ca.case_appli_id = c.id and ca.identity_type=1
1118
         LEFT JOIN case_affiliate ca ON ca.case_appli_id = c.id and ca.identity_type=1
1119
 
1119
 

+ 27
- 4
ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseEvidenceMapper.xml 查看文件

7
         <id     property="id"       column="id"      />
7
         <id     property="id"       column="id"      />
8
         <result property="caseNum"       column="case_num"      />
8
         <result property="caseNum"       column="case_num"      />
9
         <result property="caseStatus"     column="case_status"    />
9
         <result property="caseStatus"     column="case_status"    />
10
+        <result property="caseStatus"     column="case_status"    />
10
         <result property="roomId"     column="room_id"    />
11
         <result property="roomId"     column="room_id"    />
11
-        <result property="scheduleStartTime"     column="schedule_start_time"    />
12
+        <result property="caseStatusName"     column="caseStatusName"    />
12
     </resultMap>
13
     </resultMap>
13
     <select id="getCaseListByRespondent" resultType="CaseEvidenceVO" resultMap="CaseEvidenceVOResult">
14
     <select id="getCaseListByRespondent" resultType="CaseEvidenceVO" resultMap="CaseEvidenceVOResult">
14
         select t.* from(
15
         select t.* from(
15
-        select c.id id, c.case_num,c.case_status,rc.room_id,rc.schedule_start_time
16
+        select c.id id,c.create_time, c.case_num,c.case_status,
17
+        CASE c.case_status  when 0 then '立案申请' when 1 then '待立案审查' when 2 then '待缴费'
18
+        when 3 then '待缴费确认' when 4 then '待案件质证' when 5 then '待组庭审核'
19
+        when 6 then '待组庭确定' when 7 then '待审核仲裁方式' when 8 then '待开庭审理'
20
+        when 9 then '待书面审理' when 10 then '待生成裁决书' when 11 then '待核验裁决书'
21
+        when 12 then '待部门长审核裁决书' when 13 then '待裁决书签名' when 14 then '待裁决书用印'
22
+        when 15 then '待裁决书送达' when 16 then '待案件归档' when 17 then '已归档'
23
+        when 18 then '待仲裁员审核裁决书'
24
+        when 31 then '待修改开庭时间'
25
+        ELSE ''
26
+        END caseStatusName,
27
+        rc.room_id,rc.schedule_start_time
16
         from case_application as c  join case_affiliate as d on c.id = d.case_appli_id
28
         from case_application as c  join case_affiliate as d on c.id = d.case_appli_id
17
         left join reserved_conference rc on rc.case_id=c.id
29
         left join reserved_conference rc on rc.case_id=c.id
18
         where c.id = d.case_appli_id
30
         where c.id = d.case_appli_id
33
         </if>
45
         </if>
34
         union
46
         union
35
         <!-- 已办案件 -->
47
         <!-- 已办案件 -->
36
-        select c.id id, c.case_num,c.case_status,rc.room_id,rc.schedule_start_time
48
+        select c.id id, c.create_time,c.case_num,c.case_status,
49
+        CASE c.case_status  when 0 then '立案申请' when 1 then '待立案审查' when 2 then '待缴费'
50
+        when 3 then '待缴费确认' when 4 then '待案件质证' when 5 then '待组庭审核'
51
+        when 6 then '待组庭确定' when 7 then '待审核仲裁方式' when 8 then '待开庭审理'
52
+        when 9 then '待书面审理' when 10 then '待生成裁决书' when 11 then '待核验裁决书'
53
+        when 12 then '待部门长审核裁决书' when 13 then '待裁决书签名' when 14 then '待裁决书用印'
54
+        when 15 then '待裁决书送达' when 16 then '待案件归档' when 17 then '已归档'
55
+        when 18 then '待仲裁员审核裁决书'
56
+        when 31 then '待修改开庭时间'
57
+        ELSE ''
58
+        END caseStatusName,
59
+        rc.room_id,rc.schedule_start_time
37
         from case_log_record r
60
         from case_log_record r
38
         join case_application c on r.case_appli_id=c.id
61
         join case_application c on r.case_appli_id=c.id
39
         JOIN case_affiliate ca ON ca.case_appli_id = c.id
62
         JOIN case_affiliate ca ON ca.case_appli_id = c.id
62
             </foreach>
85
             </foreach>
63
         </if>
86
         </if>
64
         )
87
         )
65
-        ) t
88
+        ) t order by t.create_time desc
66
     </select>
89
     </select>
67
 </mapper>
90
 </mapper>