Bladeren bron

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

wangqiong123 2 jaren geleden
bovenliggende
commit
e1484a5889
17 gewijzigde bestanden met toevoegingen van 321 en 96 verwijderingen
  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 Bestand weergeven

@@ -1,10 +1,20 @@
1 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 11
 import org.springframework.boot.SpringApplication;
4 12
 import org.springframework.boot.autoconfigure.SpringBootApplication;
5 13
 import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
6 14
 import org.springframework.scheduling.annotation.EnableScheduling;
7 15
 
16
+import java.util.List;
17
+
8 18
 /**
9 19
  * 启动程序
10 20
  * 
@@ -24,5 +34,22 @@ public class RuoYiApplication
24 34
                 " / /_/ / / / /_/ / / / / /_/ /  / /__/ /_/ / /  \n" +
25 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 Bestand weergeven

@@ -585,4 +585,17 @@ public class CaseApplicationController extends BaseController {
585 585
         }
586 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 Bestand weergeven

@@ -6,6 +6,7 @@ import com.ruoyi.common.core.controller.BaseController;
6 6
 import com.ruoyi.common.core.domain.AjaxResult;
7 7
 import com.ruoyi.common.core.page.TableDataInfo;
8 8
 import com.ruoyi.wisdomarbitrate.domain.CaseApplication;
9
+import com.ruoyi.wisdomarbitrate.domain.CaseAttach;
9 10
 import com.ruoyi.wisdomarbitrate.domain.CaseEvidenceDirectory;
10 11
 import com.ruoyi.wisdomarbitrate.domain.dto.CaseEvidenceDTO;
11 12
 import com.ruoyi.wisdomarbitrate.domain.vo.CaseEvidenceVO;
@@ -101,16 +102,16 @@ public class CaseEvidenceController extends BaseController {
101 102
 
102 103
     /**
103 104
      * 删除附件
104
-     * @param fileIds
105
+     * @param caseAttach
105 106
      * @return
106 107
      */
107 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 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 Bestand weergeven

@@ -6,7 +6,8 @@ spring:
6 6
         druid:
7 7
             # 主库数据源
8 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 11
                 username: root
11 12
                 password: YMzc157#
12 13
             # 从库数据源

+ 14
- 6
ruoyi-admin/src/main/resources/application.yml Bestand weergeven

@@ -17,7 +17,7 @@ ruoyi:
17 17
 
18 18
 # 开发环境配置
19 19
 server:
20
-  # 服务器的HTTP端口,默认为8080
20
+  # 服务器的HTTP端口,默认为8001,正式9001
21 21
   port: 8001
22 22
   servlet:
23 23
     # 应用的访问路径
@@ -58,9 +58,9 @@ spring:
58 58
   servlet:
59 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 65
   devtools:
66 66
     restart:
@@ -72,8 +72,8 @@ spring:
72 72
     host: 121.40.189.20
73 73
     # 端口,默认为6379
74 74
     port: 6389
75
-    # 数据库索引
76
-    database: 0
75
+    # 数据库索引,2-正式,3-测试
76
+    database: 3
77 77
     # 密码
78 78
     password:
79 79
     # 连接超时时间
@@ -121,7 +121,7 @@ token:
121 121
   # 令牌密钥
122 122
   secret: abcdefghijklmnopqrstuvwxyz
123 123
   # 令牌有效期(默认30分钟)
124
-  expireTime: 30
124
+  expireTime: 1200
125 125
 
126 126
 # MyBatis配置
127 127
 mybatis:
@@ -183,6 +183,14 @@ imConfig:
183 183
   secretId: AKID3xfHgroY4MQHvLXUXMwIQL1UjmbBX1Tv
184 184
   # 腾讯云密钥
185 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 194
 #jodconverter:
187 195
 #  local:
188 196
 #    host: 121.40.189.20

+ 12
- 0
ruoyi-common/src/main/java/com/ruoyi/common/constant/CacheConstants.java Bestand weergeven

@@ -42,4 +42,16 @@ public class CacheConstants
42 42
      */
43 43
     public static final String PWD_ERR_CNT_KEY = "pwd_err_cnt:";
44 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 Bestand weergeven

@@ -6,6 +6,8 @@ import lombok.Builder;
6 6
 import lombok.Data;
7 7
 import lombok.NoArgsConstructor;
8 8
 
9
+import java.util.List;
10
+
9 11
 @Builder
10 12
 @Data
11 13
 @AllArgsConstructor
@@ -59,5 +61,9 @@ public class CaseAttach {
59 61
      * 是否是证据上传,0-否,1-是
60 62
      */
61 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 Bestand weergeven

@@ -37,4 +37,8 @@ public class CaseEvidenceVO {
37 37
      */
38 38
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
39 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 Bestand weergeven

@@ -21,7 +21,7 @@ public interface CaseAttachMapper {
21 21
 
22 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 26
     List<CaseAttach> getCaseAttachByCaseIdAndType(CaseAttach caseAttach);
27 27
 

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

@@ -161,4 +161,11 @@ public interface ICaseApplicationService {
161 161
      * @param annexPath
162 162
      */
163 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 Bestand weergeven

@@ -36,7 +36,7 @@ public interface ICaseEvidenceService {
36 36
 
37 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 41
     List<CaseEvidenceDirectoryVO> selectEvidenceTreeList(CaseEvidenceDirectory caseEvidenceDirectory);
42 42
 

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

@@ -63,6 +63,8 @@ import java.util.regex.Pattern;
63 63
 import java.util.stream.Collectors;
64 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 68
 import static com.ruoyi.common.core.domain.AjaxResult.error;
67 69
 import static com.ruoyi.common.core.domain.AjaxResult.success;
68 70
 import static com.ruoyi.common.utils.PageUtils.startPage;
@@ -3945,7 +3947,30 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
3945 3947
         caseAttachMapper.updateCaseAttach(caseAttach);
3946 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 Bestand weergeven

@@ -1,7 +1,10 @@
1 1
 package com.ruoyi.wisdomarbitrate.service.impl;
2 2
 
3
+import cn.hutool.core.bean.BeanUtil;
3 4
 import cn.hutool.core.collection.CollectionUtil;
4 5
 import cn.hutool.core.util.StrUtil;
6
+import com.alibaba.fastjson.JSONArray;
7
+import com.alibaba.fastjson.JSONObject;
5 8
 import com.ruoyi.common.config.RuoYiConfig;
6 9
 import com.ruoyi.common.constant.CaseApplicationConstants;
7 10
 import com.ruoyi.common.core.domain.AjaxResult;
@@ -11,9 +14,11 @@ import com.ruoyi.common.core.domain.model.LoginUser;
11 14
 import com.ruoyi.common.utils.SecurityUtils;
12 15
 import com.ruoyi.common.utils.SmsUtils;
13 16
 import com.ruoyi.common.utils.StringUtils;
17
+import com.ruoyi.common.utils.file.FileUtils;
14 18
 import com.ruoyi.common.utils.spring.SpringUtils;
15 19
 import com.ruoyi.system.mapper.SysUserMapper;
16 20
 import com.ruoyi.wisdomarbitrate.domain.vo.CaseEvidenceDirectoryVO;
21
+import com.ruoyi.wisdomarbitrate.service.ICaseApplicationService;
17 22
 import com.ruoyi.wisdomarbitrate.utils.CaseLogUtils;
18 23
 import com.ruoyi.common.utils.file.FileUploadUtils;
19 24
 import com.ruoyi.wisdomarbitrate.domain.*;
@@ -32,6 +37,7 @@ import java.io.IOException;
32 37
 import java.util.*;
33 38
 import java.util.stream.Collectors;
34 39
 
40
+import static com.google.common.io.Files.getFileExtension;
35 41
 import static com.ruoyi.common.utils.SecurityUtils.getUsername;
36 42
 
37 43
 @Service
@@ -50,6 +56,8 @@ public class CaseEvidenceServiceImpl implements ICaseEvidenceService {
50 56
     private SysUserMapper sysUserMapper;
51 57
     @Autowired
52 58
     private SmsRecordMapper smsRecordMapper;
59
+    @Autowired
60
+    private ICaseApplicationService caseApplicationService;
53 61
 
54 62
     @Override
55 63
     @Transactional
@@ -134,15 +142,39 @@ public class CaseEvidenceServiceImpl implements ICaseEvidenceService {
134 142
             String filePath = RuoYiConfig.getUploadPath();
135 143
             // 上传
136 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 178
                 if (id != null) {
147 179
                     //修改案件状态
148 180
                     CaseApplication caseApplication = new CaseApplication();
@@ -151,18 +183,7 @@ public class CaseEvidenceServiceImpl implements ICaseEvidenceService {
151 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 187
         } catch (IOException e) {
167 188
             e.printStackTrace();
168 189
         }
@@ -265,27 +286,44 @@ public class CaseEvidenceServiceImpl implements ICaseEvidenceService {
265 286
     @Transactional
266 287
     @Override
267 288
     public AjaxResult batchUpload(MultipartFile[] files, Integer annexType, Long id, String userName, Long userId) {
268
-        List<CaseAttach> successList = new ArrayList<>();
269 289
         try {
270 290
             String filePath = RuoYiConfig.getUploadPath();
271 291
             for (MultipartFile file : files) {
272 292
                 // 上传
273 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,7 +371,7 @@ public class CaseEvidenceServiceImpl implements ICaseEvidenceService {
333 371
         }
334 372
 
335 373
 
336
-        return AjaxResult.success("上传成功", successList);
374
+        return AjaxResult.success("上传成功");
337 375
 
338 376
     }
339 377
 
@@ -363,7 +401,7 @@ public class CaseEvidenceServiceImpl implements ICaseEvidenceService {
363 401
     }
364 402
 
365 403
     @Override
366
-    public int deleteFile(List<Integer> fileIds) {
404
+    public int deleteFile(List<Long> fileIds) {
367 405
         return caseAttachMapper.deleteByFileIds(fileIds);
368 406
     }
369 407
 

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

@@ -4,6 +4,8 @@ import cn.hutool.core.bean.BeanUtil;
4 4
 import cn.hutool.core.collection.CollectionUtil;
5 5
 import cn.hutool.core.util.ObjectUtil;
6 6
 import cn.hutool.core.util.StrUtil;
7
+import com.alibaba.fastjson.JSONArray;
8
+import com.alibaba.fastjson.JSONObject;
7 9
 import com.ruoyi.common.constant.CaseApplicationConstants;
8 10
 import com.ruoyi.common.constant.Constants;
9 11
 import com.ruoyi.common.core.domain.entity.SysDept;
@@ -47,6 +49,7 @@ import java.util.regex.Matcher;
47 49
 import java.util.regex.Pattern;
48 50
 import java.util.stream.Collectors;
49 51
 
52
+import static com.google.common.io.Files.getFileExtension;
50 53
 import static com.ruoyi.common.core.domain.AjaxResult.error;
51 54
 import static com.ruoyi.common.core.domain.AjaxResult.success;
52 55
 import static com.ruoyi.common.utils.SecurityUtils.getUsername;
@@ -93,6 +96,8 @@ public class CaseZipImportImpl {
93 96
     // 申请人角色id
94 97
     private long roleId;
95 98
     private Integer maxCaseNum;
99
+    @Autowired
100
+    private CaseZipImportImpl caseZipImportImpl;
96 101
 
97 102
 
98 103
 @Transactional
@@ -164,22 +169,39 @@ public class CaseZipImportImpl {
164 169
         }
165 170
 
166 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,8 +229,8 @@ public class CaseZipImportImpl {
207 229
             if (fatchMap.size() > 0) {
208 230
 
209 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,26 +290,58 @@ public class CaseZipImportImpl {
268 290
                     if (StrUtil.isEmpty(fileUrl)) {
269 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 346
                 caseApplication.setCaseAttachList(caseAttachs);
293 347
                 // 案件压缩包导入
@@ -300,8 +354,9 @@ public class CaseZipImportImpl {
300 354
 //                }
301 355
 
302 356
                 // 多线程执行
303
-                ThreadPoolUtil.execute(() -> {
357
+//                ThreadPoolUtil.execute(() -> {
304 358
                     try {
359
+
305 360
                         caseApplicationMapper.insertCaseApplication(caseApplication);
306 361
                         // 新增日志
307 362
                         CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.CASE_APPLICATION, "",loginUser);
@@ -337,10 +392,10 @@ public class CaseZipImportImpl {
337 392
 
338 393
                     } catch (Exception e) {
339 394
                         e.printStackTrace();
340
-                        throw new RuntimeException("导入失败,请检查抓取规则是否正确");
395
+                        throw new RuntimeException("案件导入失败");
341 396
                     }
342 397
 
343
-                });
398
+//                });
344 399
                 return caseApplication;
345 400
             }
346 401
         }

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

@@ -10,6 +10,7 @@ import com.ruoyi.common.core.domain.AjaxResult;
10 10
 import com.ruoyi.common.core.domain.entity.EsignHttpResponse;
11 11
 import com.ruoyi.common.exception.EsignDemoException;
12 12
 import com.ruoyi.common.utils.EmailOutUtil;
13
+import com.ruoyi.common.utils.SecurityUtils;
13 14
 import com.ruoyi.common.utils.StringUtils;
14 15
 import com.ruoyi.common.utils.file.SaaSAPIFileUtils;
15 16
 import com.ruoyi.system.mapper.SysUserMapper;
@@ -162,7 +163,11 @@ public class MsSignSealServiceImpl implements MsSignSealService {
162 163
                             caseAttach.setAnnexType(3);
163 164
                             caseAttach.setAnnexPath(savePath);
164 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 Bestand weergeven

@@ -1113,7 +1113,7 @@
1113 1113
         c.batch_number,
1114 1114
         c.facts,
1115 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 1117
         from case_application c
1118 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 Bestand weergeven

@@ -7,12 +7,24 @@
7 7
         <id     property="id"       column="id"      />
8 8
         <result property="caseNum"       column="case_num"      />
9 9
         <result property="caseStatus"     column="case_status"    />
10
+        <result property="caseStatus"     column="case_status"    />
10 11
         <result property="roomId"     column="room_id"    />
11
-        <result property="scheduleStartTime"     column="schedule_start_time"    />
12
+        <result property="caseStatusName"     column="caseStatusName"    />
12 13
     </resultMap>
13 14
     <select id="getCaseListByRespondent" resultType="CaseEvidenceVO" resultMap="CaseEvidenceVOResult">
14 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 28
         from case_application as c  join case_affiliate as d on c.id = d.case_appli_id
17 29
         left join reserved_conference rc on rc.case_id=c.id
18 30
         where c.id = d.case_appli_id
@@ -33,7 +45,18 @@
33 45
         </if>
34 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 60
         from case_log_record r
38 61
         join case_application c on r.case_appli_id=c.id
39 62
         JOIN case_affiliate ca ON ca.case_appli_id = c.id
@@ -62,6 +85,6 @@
62 85
             </foreach>
63 86
         </if>
64 87
         )
65
-        ) t
88
+        ) t order by t.create_time desc
66 89
     </select>
67 90
 </mapper>