18792927508 hace 2 años
padre
commit
666090fbe3
Se han modificado 21 ficheros con 311 adiciones y 118 borrados
  1. 15
    2
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysLoginController.java
  2. 2
    1
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/tool/TestApiController.java
  3. 2
    2
      ruoyi-admin/src/main/resources/application-druid.yml
  4. 8
    3
      ruoyi-admin/src/main/resources/application.yml
  5. 1
    1
      ruoyi-common/pom.xml
  6. 37
    0
      ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysDept.java
  7. 1
    7
      ruoyi-common/src/main/java/com/ruoyi/common/utils/PdfUtils.java
  8. 14
    9
      ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/SysPermissionService.java
  9. 16
    16
      ruoyi-system/pom.xml
  10. 2
    1
      ruoyi-system/src/main/java/com/ruoyi/system/service/BeiMingInterface.java
  11. 3
    3
      ruoyi-system/src/main/java/com/ruoyi/system/service/ISysRoleService.java
  12. 3
    2
      ruoyi-system/src/main/java/com/ruoyi/system/service/impl/BeiMingInterfaceService.java
  13. 3
    0
      ruoyi-system/src/main/java/com/ruoyi/system/service/impl/MsRequestLogServiceImpl.java
  14. 3
    10
      ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysRoleServiceImpl.java
  15. 1
    0
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/miniprogress/impl/WeChatUserServiceImpl.java
  16. 81
    24
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/mscase/impl/MsCaseApplicationServiceImpl.java
  17. 31
    31
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/mscase/impl/MsSignSealServiceImpl.java
  18. 57
    0
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/mscase/impl/VideoConferenceServiceImpl.java
  19. 15
    0
      ruoyi-system/src/main/resources/mapper/system/SysDeptMapper.xml
  20. 14
    4
      ruoyi-system/src/main/resources/mapper/wisdomarbitrate/mscase/MsCaseAffiliateMapper.xml
  21. 2
    2
      ruoyi-system/src/main/resources/mapper/wisdomarbitrate/mscase/MsCaseApplicationMapper.xml

+ 15
- 2
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysLoginController.java Ver fichero

@@ -5,9 +5,11 @@ import cn.hutool.crypto.digest.MD5;
5 5
 import com.ruoyi.common.constant.Constants;
6 6
 import com.ruoyi.common.core.domain.AjaxResult;
7 7
 import com.ruoyi.common.core.domain.entity.SysMenu;
8
+import com.ruoyi.common.core.domain.entity.SysRole;
8 9
 import com.ruoyi.common.core.domain.entity.SysUser;
9 10
 import com.ruoyi.common.core.domain.model.LoginBody;
10 11
 import com.ruoyi.common.utils.SecurityUtils;
12
+import com.ruoyi.common.utils.StringUtils;
11 13
 import com.ruoyi.framework.web.service.SysLoginService;
12 14
 import com.ruoyi.framework.web.service.SysPermissionService;
13 15
 import com.ruoyi.framework.web.service.TokenService;
@@ -22,6 +24,8 @@ import org.springframework.web.bind.annotation.PostMapping;
22 24
 import org.springframework.web.bind.annotation.RequestBody;
23 25
 import org.springframework.web.bind.annotation.RestController;
24 26
 
27
+import java.util.Arrays;
28
+import java.util.HashSet;
25 29
 import java.util.List;
26 30
 import java.util.Set;
27 31
 
@@ -83,11 +87,20 @@ public class SysLoginController {
83 87
     public AjaxResult getInfo() {
84 88
         SysUser user = SecurityUtils.getLoginUser().getUser();
85 89
         // 角色集合
86
-        Set<String> roles = permissionService.getRolePermission(user);
90
+        List<SysRole> roles = permissionService.getRolePermission(user);
91
+        Set<String> permsSet = new HashSet<>();
92
+        for (SysRole perm : roles)
93
+        {
94
+            if (StringUtils.isNotNull(perm))
95
+            {
96
+                permsSet.addAll(Arrays.asList(perm.getRoleKey().trim().split(",")));
97
+            }
98
+        }
99
+        user.setRoles(roles);
87 100
         // 权限集合
88 101
         Set<String> permissions = permissionService.getMenuPermission(user);
89 102
         //查询用户角色关联的案件状态
90
-        Set<Integer> caseStatus = caseFlowService.getCaseStatusIdByRoleKey(roles);
103
+        Set<Integer> caseStatus = caseFlowService.getCaseStatusIdByRoleKey(permsSet);
91 104
         AjaxResult ajax = AjaxResult.success();
92 105
         ajax.put("user", user);
93 106
         ajax.put("roles", roles);

+ 2
- 1
ruoyi-admin/src/main/java/com/ruoyi/web/controller/tool/TestApiController.java Ver fichero

@@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSONObject;
5 5
 import com.ruoyi.common.annotation.Anonymous;
6 6
 import com.ruoyi.common.core.domain.AjaxResult;
7 7
 import com.ruoyi.common.enums.AttachmentOperateTypeEnum;
8
+import com.ruoyi.common.enums.DocumentTypeEnum;
8 9
 import com.ruoyi.common.enums.PushCaseStatusEnum;
9 10
 import com.ruoyi.system.service.impl.BeiMingInterfaceService;
10 11
 import com.ruoyi.wisdomarbitrate.domain.vo.mscase.MsCaseFileInfo;
@@ -62,7 +63,7 @@ public class TestApiController {
62 63
     public AjaxResult testfile() {
63 64
 //        File file = new File("D:/WorkDoc/TJ/File/证据1.png");
64 65
         File file = new File("D:/WorkDoc/TJ/File/证据3.png");
65
-            MsCaseFileInfo jsonObject1 = beiMingInterfaceService.pushAttachmentInfo("BWT_MEDIATION", "86251b190e3a40f3942v215d1762c663", file, "BWT_MEDIATION", "zc2024032700012", AttachmentOperateTypeEnum.ADD);
66
+            MsCaseFileInfo jsonObject1 = beiMingInterfaceService.pushAttachmentInfo("BWT_MEDIATION", "86251b190e3a40f3942v215d1762c663", file, "BWT_MEDIATION", "zc2024032700012", AttachmentOperateTypeEnum.ADD, DocumentTypeEnum.EVEDENT_AGREEMENT);
66 67
         System.out.println("fanhui:" + jsonObject1.toString());
67 68
         return AjaxResult.success();
68 69
     }

+ 2
- 2
ruoyi-admin/src/main/resources/application-druid.yml Ver fichero

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

+ 8
- 3
ruoyi-admin/src/main/resources/application.yml Ver fichero

@@ -18,7 +18,7 @@ ruoyi:
18 18
 # 开发环境配置
19 19
 server:
20 20
   # 测试环境6001,开发环境7001
21
-  port: 7001
21
+  port: 6001
22 22
   servlet:
23 23
     # 应用的访问路径
24 24
     context-path: /
@@ -72,8 +72,8 @@ spring:
72 72
     host: 121.40.189.20
73 73
     # 端口,默认为6379
74 74
     port: 6389
75
-    # 数据库索引
76
-    database: 0
75
+    # 数据库索引,测试环境1,正式环境0
76
+    database: 1
77 77
     # 密码
78 78
     password:
79 79
     # 连接超时时间
@@ -198,6 +198,11 @@ signSealCallbackConfig:
198 198
 onlyOfficeConfig:
199 199
   #  url: http://172.16.0.254:9090/files/upload
200 200
   url: http://121.40.189.20:9090/files/upload
201
+#  北明
202
+BMConfig:
203
+  userName: BWT_MEDIATION
204
+  password: 86251b190e3a40f3942v215d1762c663
205
+  syncSource: BWT_MEDIATION
201 206
     #jodconverter:
202 207
     #  local:
203 208
     #    host: 121.40.189.20

+ 1
- 1
ruoyi-common/pom.xml Ver fichero

@@ -200,7 +200,7 @@
200 200
         <dependency>
201 201
             <groupId>com.tencentcloudapi</groupId>
202 202
             <artifactId>tencentcloud-sdk-java</artifactId>
203
-            <version>3.1.876</version>
203
+            <version>3.1.962</version>
204 204
         </dependency>
205 205
 
206 206
         <dependency>

+ 37
- 0
ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysDept.java Ver fichero

@@ -64,6 +64,43 @@ public class SysDept extends BaseEntity
64 64
      * 法定代表人
65 65
      */
66 66
     private String compLegalPerson;
67
+    /**
68
+     * 住所
69
+     */
70
+    private String home;
71
+    /**
72
+     * 联系地址
73
+     */
74
+    private String address;
75
+    /**
76
+     *
77
+     * 国籍,0-国内,1-国外
78
+     */
79
+    private Integer nationality;
80
+
81
+    public String getAddress() {
82
+        return address;
83
+    }
84
+
85
+    public void setAddress(String address) {
86
+        this.address = address;
87
+    }
88
+
89
+    public Integer getNationality() {
90
+        return nationality;
91
+    }
92
+
93
+    public String getHome() {
94
+        return home;
95
+    }
96
+
97
+    public void setHome(String home) {
98
+        this.home = home;
99
+    }
100
+
101
+    public void setNationality(Integer nationality) {
102
+        this.nationality = nationality;
103
+    }
67 104
 
68 105
     public String getCode() {
69 106
         return code;

+ 1
- 7
ruoyi-common/src/main/java/com/ruoyi/common/utils/PdfUtils.java Ver fichero

@@ -4,22 +4,16 @@ import com.documents4j.api.DocumentType;
4 4
 import com.documents4j.api.IConverter;
5 5
 import com.documents4j.job.LocalConverter;
6 6
 import com.itextpdf.text.Document;
7
-import com.itextpdf.text.Font;
8 7
 import com.itextpdf.text.PageSize;
9
-import com.itextpdf.text.pdf.BaseFont;
10 8
 import com.itextpdf.text.pdf.PdfWriter;
11 9
 import com.itextpdf.tool.xml.XMLWorkerFontProvider;
12 10
 import com.itextpdf.tool.xml.XMLWorkerHelper;
13
-import com.ruoyi.common.config.RuoYiConfig;
14
-import com.tencentcloudapi.teo.v20220901.models.CC;
15 11
 import lombok.extern.slf4j.Slf4j;
16 12
 
17 13
 import java.io.*;
18 14
 import java.nio.charset.Charset;
19 15
 import java.nio.file.Files;
20 16
 
21
-import static cn.hutool.core.util.ClassLoaderUtil.getClassLoader;
22
-
23 17
 /**
24 18
  * @author wangqiong
25 19
  * @description pdf转换工具类
@@ -44,7 +38,7 @@ public class PdfUtils {
44 38
             document.setMarginMirroring(false);
45 39
             document.open();
46 40
             // 解决PDF中文不显示
47
-            String fontPath = "/D:/simsun.ttf"; //字体文件路径
41
+            String fontPath = "/home/ruoyi/uploadPath/songfont/simsun.ttf"; //字体文件路径
48 42
             XMLWorkerFontProvider provider = new XMLWorkerFontProvider(XMLWorkerFontProvider.DONTLOOKFORFONTS);
49 43
             provider.register(fontPath);//注册字体
50 44
             log.error("注册字体");

+ 14
- 9
ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/SysPermissionService.java Ver fichero

@@ -1,15 +1,17 @@
1 1
 package com.ruoyi.framework.web.service;
2 2
 
3
-import java.util.HashSet;
4
-import java.util.List;
5
-import java.util.Set;
6
-import org.springframework.beans.factory.annotation.Autowired;
7
-import org.springframework.stereotype.Component;
8
-import org.springframework.util.CollectionUtils;
9 3
 import com.ruoyi.common.core.domain.entity.SysRole;
10 4
 import com.ruoyi.common.core.domain.entity.SysUser;
11 5
 import com.ruoyi.system.service.ISysMenuService;
12 6
 import com.ruoyi.system.service.ISysRoleService;
7
+import org.springframework.beans.factory.annotation.Autowired;
8
+import org.springframework.stereotype.Component;
9
+import org.springframework.util.CollectionUtils;
10
+
11
+import java.util.ArrayList;
12
+import java.util.HashSet;
13
+import java.util.List;
14
+import java.util.Set;
13 15
 
14 16
 /**
15 17
  * 用户权限处理
@@ -31,13 +33,16 @@ public class SysPermissionService
31 33
      * @param user 用户信息
32 34
      * @return 角色权限信息
33 35
      */
34
-    public Set<String> getRolePermission(SysUser user)
36
+    public List<SysRole>  getRolePermission(SysUser user)
35 37
     {
36
-        Set<String> roles = new HashSet<String>();
38
+        List<SysRole> roles = new ArrayList<>();
37 39
         // 管理员拥有所有权限
38 40
         if (user.isAdmin())
39 41
         {
40
-            roles.add("admin");
42
+            SysRole sysRole = new SysRole();
43
+            sysRole.setRoleId(1L);
44
+            sysRole.setRoleKey("admin");
45
+            roles.add(sysRole);
41 46
         }
42 47
         else
43 48
         {

+ 16
- 16
ruoyi-system/pom.xml Ver fichero

@@ -45,20 +45,20 @@
45 45
             <version>2.1.5</version>
46 46
         </dependency>
47 47
     </dependencies>
48
-    <build>
49
-        <plugins>
50
-            <plugin>
51
-                <groupId>org.springframework.boot</groupId>
52
-                <artifactId>spring-boot-maven-plugin</artifactId>
53
-                <configuration>
54
-                    <excludes>
55
-                        <exclude>
56
-                            <groupId>org.projectlombok</groupId>
57
-                            <artifactId>lombok</artifactId>
58
-                        </exclude>
59
-                    </excludes>
60
-                </configuration>
61
-            </plugin>
62
-        </plugins>
63
-    </build>
48
+<!--    <build>-->
49
+<!--        <plugins>-->
50
+<!--            <plugin>-->
51
+<!--                <groupId>org.springframework.boot</groupId>-->
52
+<!--                <artifactId>spring-boot-maven-plugin</artifactId>-->
53
+<!--                <configuration>-->
54
+<!--                    <excludes>-->
55
+<!--                        <exclude>-->
56
+<!--                            <groupId>org.projectlombok</groupId>-->
57
+<!--                            <artifactId>lombok</artifactId>-->
58
+<!--                        </exclude>-->
59
+<!--                    </excludes>-->
60
+<!--                </configuration>-->
61
+<!--            </plugin><plugin><groupId>org.apache.maven.plugins</groupId><artifactId>maven-compiler-plugin</artifactId><configuration><source>9</source><target>9</target></configuration></plugin>-->
62
+<!--        </plugins>-->
63
+<!--    </build>-->
64 64
 </project>

+ 2
- 1
ruoyi-system/src/main/java/com/ruoyi/system/service/BeiMingInterface.java Ver fichero

@@ -2,6 +2,7 @@ package com.ruoyi.system.service;
2 2
 
3 3
 import com.alibaba.fastjson.JSONObject;
4 4
 import com.ruoyi.common.enums.AttachmentOperateTypeEnum;
5
+import com.ruoyi.common.enums.DocumentTypeEnum;
5 6
 import com.ruoyi.wisdomarbitrate.domain.vo.mscase.MsCaseFileInfo;
6 7
 import com.ruoyi.wisdomarbitrate.domain.vo.mscase.MsCaseStatusInfo;
7 8
 
@@ -70,7 +71,7 @@ public interface BeiMingInterface {
70 71
      * @param caseNo     案件编号
71 72
      * @return
72 73
      */
73
-    MsCaseFileInfo pushAttachmentInfo(String username, String password, File file, String syncSource, String caseNo, AttachmentOperateTypeEnum operateTypeEnum);
74
+    MsCaseFileInfo pushAttachmentInfo(String username, String password, File file, String syncSource, String caseNo, AttachmentOperateTypeEnum operateTypeEnum, DocumentTypeEnum documentTypeEnum);
74 75
 
75 76
     /**
76 77
      * 删除附件

+ 3
- 3
ruoyi-system/src/main/java/com/ruoyi/system/service/ISysRoleService.java Ver fichero

@@ -1,10 +1,10 @@
1 1
 package com.ruoyi.system.service;
2 2
 
3
-import java.util.List;
4
-import java.util.Set;
5 3
 import com.ruoyi.common.core.domain.entity.SysRole;
6 4
 import com.ruoyi.system.domain.SysUserRole;
7 5
 
6
+import java.util.List;
7
+
8 8
 /**
9 9
  * 角色业务层
10 10
  * 
@@ -34,7 +34,7 @@ public interface ISysRoleService
34 34
      * @param userId 用户ID
35 35
      * @return 权限列表
36 36
      */
37
-    public Set<String> selectRolePermissionByUserId(Long userId);
37
+    public List<SysRole>  selectRolePermissionByUserId(Long userId);
38 38
 
39 39
     /**
40 40
      * 查询所有角色

+ 3
- 2
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/BeiMingInterfaceService.java Ver fichero

@@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSONObject;
5 5
 import com.fasterxml.jackson.databind.ObjectMapper;
6 6
 import com.fasterxml.jackson.databind.node.ObjectNode;
7 7
 import com.ruoyi.common.enums.AttachmentOperateTypeEnum;
8
+import com.ruoyi.common.enums.DocumentTypeEnum;
8 9
 import com.ruoyi.common.exception.ServiceException;
9 10
 import com.ruoyi.system.domain.entity.log.MsRequestLog;
10 11
 import com.ruoyi.system.service.BeiMingInterface;
@@ -335,7 +336,7 @@ public class BeiMingInterfaceService implements BeiMingInterface {
335 336
      */
336 337
     @Transactional
337 338
     @Override
338
-    public MsCaseFileInfo pushAttachmentInfo(String username, String password, File file,  String syncSource, String caseNo,AttachmentOperateTypeEnum operateTypeEnum) {
339
+    public MsCaseFileInfo pushAttachmentInfo(String username, String password, File file, String syncSource, String caseNo, AttachmentOperateTypeEnum operateTypeEnum, DocumentTypeEnum documentTypeEnum) {
339 340
         JSONObject result = new JSONObject();
340 341
         MsCaseFileInfo fileInfo=null;
341 342
         //1.获取token
@@ -354,7 +355,7 @@ public class BeiMingInterfaceService implements BeiMingInterface {
354 355
                         System.out.println("fileId====:" + fileId);
355 356
                         if (fileId != null) {
356 357
                             //3.同步附件更新信息
357
-                             fileInfo = MsCaseFileInfo.builder().fileId(fileId).fileName(file.getName()).abutmentId(fileId).abutmentCaseId(caseNo).documentSubject("EVEDENT").documentType("EVEDENT_METERIAL").build();
358
+                             fileInfo = MsCaseFileInfo.builder().fileId(fileId).fileName(file.getName()).abutmentId(fileId).abutmentCaseId(caseNo).documentSubject("EVEDENT").documentType(documentTypeEnum.getCode()).build();
358 359
                             result = syncAttachmentInfo(token, username, operateTypeEnum.getCode(), caseNo, fileInfo);
359 360
                             // 更新到附件表将fileId
360 361
 //                            result = syncAttachmentInfo(token, username, AttachmentOperateTypeEnum.UPD.getCode(), caseNo, fileInfo);

+ 3
- 0
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/MsRequestLogServiceImpl.java Ver fichero

@@ -5,6 +5,8 @@ import com.ruoyi.system.mapper.log.MsRequestLogMapper;
5 5
 import com.ruoyi.system.service.MsRequestLogService;
6 6
 import org.springframework.beans.factory.annotation.Autowired;
7 7
 import org.springframework.stereotype.Service;
8
+import org.springframework.transaction.annotation.Propagation;
9
+import org.springframework.transaction.annotation.Transactional;
8 10
 
9 11
 /**
10 12
  * @Classname MsRequestLogServiceImpl
@@ -17,6 +19,7 @@ import org.springframework.stereotype.Service;
17 19
 public class MsRequestLogServiceImpl implements MsRequestLogService {
18 20
     @Autowired
19 21
     private MsRequestLogMapper logMapper;
22
+    @Transactional(propagation = Propagation.REQUIRES_NEW)
20 23
     @Override
21 24
     public void insert(MsRequestLog requestLog) {
22 25
         logMapper.insert(requestLog);

+ 3
- 10
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysRoleServiceImpl.java Ver fichero

@@ -93,18 +93,11 @@ public class SysRoleServiceImpl implements ISysRoleService
93 93
      * @return 权限列表
94 94
      */
95 95
     @Override
96
-    public Set<String> selectRolePermissionByUserId(Long userId)
96
+    public  List<SysRole> selectRolePermissionByUserId(Long userId)
97 97
     {
98 98
         List<SysRole> perms = roleMapper.selectRolePermissionByUserId(userId);
99
-        Set<String> permsSet = new HashSet<>();
100
-        for (SysRole perm : perms)
101
-        {
102
-            if (StringUtils.isNotNull(perm))
103
-            {
104
-                permsSet.addAll(Arrays.asList(perm.getRoleKey().trim().split(",")));
105
-            }
106
-        }
107
-        return permsSet;
99
+
100
+        return perms;
108 101
     }
109 102
 
110 103
     /**

+ 1
- 0
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/miniprogress/impl/WeChatUserServiceImpl.java Ver fichero

@@ -107,6 +107,7 @@ public class WeChatUserServiceImpl implements WeChatUserService {
107 107
         }else if(!codeCache.equals(ientityAuthentication.getVerifyCode())){
108 108
             return AjaxResult.warn("验证码校验失败");
109 109
         }
110
+        // 根据用户名或者邮箱或者手机号查询系统用户表中是否存在该用户
110 111
         SysUser sysUserName=sysUserMapper.checkUserNameUnique(ientityAuthentication.getUserName());
111 112
         if(sysUserName!=null){
112 113
             return AjaxResult.warn("账号已存在");

+ 81
- 24
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/mscase/impl/MsCaseApplicationServiceImpl.java Ver fichero

@@ -259,6 +259,7 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
259 259
         if(CollectionUtil.isEmpty(list)){
260 260
             return;
261 261
         }
262
+        isMediatorRole=false;
262 263
         // 查询申请人和被申请人
263 264
         List<Long> caseIds = list.stream().map(MsCaseApplicationVO::getId).collect(Collectors.toList());
264 265
 
@@ -271,6 +272,9 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
271 272
         }
272 273
 
273 274
         for (MsCaseApplicationVO vo : list) {
275
+            if(vo.getMediatorId()!=null&&vo.getMediatorId()==loginUserId){
276
+                isMediatorRole=true;
277
+            }
274 278
             // 设置申请人和被申请人
275 279
             if(affiliateMap!=null && affiliateMap.containsKey(vo.getId())){
276 280
                 List<MsCaseAffiliate> affiliates = affiliateMap.get(vo.getId());
@@ -291,12 +295,19 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
291 295
 
292 296
                         }
293 297
                     }
294
-                    if(StrUtil.isNotEmpty(affiliate.getRoleName()) && affiliate.getRoleName().equals("申请人")
295
-                    && affiliate.getRoleType()!=null && affiliate.getRoleType()==1){
296
-                        applicantName.append(affiliate.getName()).append(Constants.CN_SPLIT_COMMA);
298
+                    if(vo.getOrganizeFlag()==null || vo.getOrganizeFlag()!=1) {
299
+                        if (StrUtil.isNotEmpty(affiliate.getRoleName()) && affiliate.getRoleName().equals("申请人")
300
+                                && affiliate.getRoleType() != null && affiliate.getRoleType() == 1&&StrUtil.isNotEmpty(affiliate.getName())) {
301
+                            applicantName.append(affiliate.getName()).append(Constants.CN_SPLIT_COMMA);
302
+                        }
303
+                    }else {
304
+                        // 组织机构
305
+                        if ( affiliate.getRoleType() != null && affiliate.getRoleType() == 1&&StrUtil.isNotEmpty(affiliate.getApplicantOrgName())) {
306
+                            applicantName.append(affiliate.getApplicantOrgName()).append(Constants.CN_SPLIT_COMMA);
307
+                        }
297 308
                     }
298 309
                     if(StrUtil.isNotEmpty(affiliate.getRoleName()) && affiliate.getRoleName().equals("被申请人")
299
-                            && affiliate.getRoleType()!=null && affiliate.getRoleType()==3){
310
+                            && affiliate.getRoleType()!=null && affiliate.getRoleType()==3&&StrUtil.isNotEmpty(affiliate.getName())){
300 311
                         respondentName.append(affiliate.getName()).append(Constants.CN_SPLIT_COMMA);
301 312
                     }
302 313
 
@@ -585,6 +596,9 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
585 596
         if (caseApplication.getId() == null) {
586 597
             caseApplication.setId(IdWorkerUtil.getId());
587 598
         }
599
+        if(caseApplication.getOrganizeFlag()==null){
600
+            caseApplication.setOrganizeFlag(0);
601
+        }
588 602
         caseApplication.setCaseStatusName(caseFlow.getCaseStatusName());
589 603
         caseApplication.setCaseFlowId(caseFlow.getId());
590 604
         caseApplication.setCreateTime(new Date());
@@ -680,7 +694,8 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
680 694
      */
681 695
     @Transactional
682 696
     public void setCaseAfflicate(MsCaseApplicationVO caseApplication, MsCaseAffiliate affiliate,int groupOrder) {
683
-        if(affiliate==null || StrUtil.isEmpty(affiliate.getEmail()) || StrUtil.isEmpty(affiliate.getName())){
697
+        boolean b = caseApplication.getOrganizeFlag() != 1 && affiliate.getRoleType() == 1 && StrUtil.isEmpty(affiliate.getEmail());
698
+        if(affiliate==null ||b|| StrUtil.isEmpty(affiliate.getName())){
684 699
             return;
685 700
         }
686 701
         affiliate.setGroupOrder(groupOrder);
@@ -739,6 +754,7 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
739 754
         } else {
740 755
             // 申请机构
741 756
             if (affiliate.getRoleType() == 1) {
757
+                affiliate.setOperatorFlag(0);
742 758
                 // 申请人,从缓存中判断部门是否存在
743 759
                 Object deptCache = redisCache.getCacheObject(CacheConstants.DEPT_KEY + affiliate.getName());
744 760
                 if (ObjectUtil.isEmpty(deptCache)) {
@@ -751,12 +767,27 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
751 767
                     dept.setStatus("0");
752 768
                     dept.setDelFlag("0");
753 769
                     dept.setCode(affiliate.getCode());
770
+                    dept.setHome(affiliate.getHome());
771
+                    dept.setAddress(affiliate.getAddress());
754 772
                     dept.setCompLegalPerson(affiliate.getCompLegalPerson());
755 773
                     dept.setCreateBy(getUsername());
756
-                    dept.setUpdateBy(getUsername());
774
+                    dept.setCreateTime(new Date());
775
+                    dept.setNationality(affiliate.getNationality());
757 776
                     sysDeptMapper.insertDept(dept);
758 777
                     // 更新缓存
759 778
                     redisCache.setCacheObject(CacheConstants.DEPT_KEY + dept.getDeptName(), dept.getDeptId());
779
+                }else {
780
+                    // 更新部门
781
+                    SysDept dept = new SysDept();
782
+                    dept.setDeptId((Long) deptCache);
783
+                    dept.setCode(affiliate.getCode());
784
+                    dept.setCompLegalPerson(affiliate.getCompLegalPerson());
785
+                    dept.setUpdateBy(getUsername());
786
+                    dept.setUpdateTime(new Date());
787
+                    dept.setNationality(affiliate.getNationality());
788
+                    dept.setHome(affiliate.getHome());
789
+                    dept.setAddress(affiliate.getAddress());
790
+                    sysDeptMapper.updateDept(dept);
760 791
                 }
761 792
                 affiliate.setApplicantDeptId(redisCache.getCacheObject(CacheConstants.DEPT_KEY + affiliate.getName()));
762 793
             } else {
@@ -779,13 +810,13 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
779 810
         if(StrUtil.isEmpty(affiliate.getEmail())){
780 811
             return;
781 812
         }
782
-        Object userEmailCache = redisCache.getCacheObject(CacheConstants.USER_EMAIL_KEY + affiliate.getEmail());
813
+       // Object userEmailCache = redisCache.getCacheObject(CacheConstants.USER_EMAIL_KEY + affiliate.getEmail());
783 814
         SysUser user=null;
784
-        if(ObjectUtil.isEmpty(userEmailCache)){
815
+      //  if(ObjectUtil.isEmpty(userEmailCache)){
785 816
              user = sysUserMapper.selectUserByUserName(affiliate.getEmail());
786
-        }else {
787
-            user=(SysUser)userEmailCache;
788
-        }
817
+       // }else {
818
+       //     user=(SysUser)userEmailCache;
819
+      //  }
789 820
 
790 821
 
791 822
         // 判断该用户是否存在
@@ -951,6 +982,9 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
951 982
         if (msCaseAffiliateVO==null) {
952 983
             return AjaxResult.error("案件相关人员未填写");
953 984
         }
985
+        if(caseApplication.getOrganizeFlag()==null){
986
+            caseApplication.setOrganizeFlag(0);
987
+        }
954 988
         // 计算仲裁费用
955 989
         caseApplication.setCaseSubjectAmount(new BigDecimal("30000"));
956 990
         setFeePayableMethod(caseApplication);
@@ -1507,7 +1541,7 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
1507 1541
                 }
1508 1542
                 String templatePath = "/home/ruoyi" + caseAttach.getAnnexPath();
1509 1543
                 File file = new File(templatePath.replace("/profile", "/uploadPath"));
1510
-                MsCaseFileInfo caseFileInfo = beiMingInterfaceService.pushAttachmentInfo(BMUserName, BMPassword, file, BMSyncSource, caseApplication.getCaseNum(),AttachmentOperateTypeEnum.ADD);
1544
+                MsCaseFileInfo caseFileInfo = beiMingInterfaceService.pushAttachmentInfo(BMUserName, BMPassword, file, BMSyncSource, caseApplication.getCaseNum(),AttachmentOperateTypeEnum.ADD,DocumentTypeEnum.EVEDENT_METERIAL);
1511 1545
                 // 更新附件表
1512 1546
                 if(caseFileInfo!=null && StrUtil.isNotEmpty(caseFileInfo.getFileId())){
1513 1547
                     caseAttach.setOtherSysFileId(caseFileInfo.getFileId());
@@ -1905,7 +1939,7 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
1905 1939
 //                selectedMediatorIds = selectedMediators.stream().map(MsCaseMediator::getMediatorId).collect(Collectors.toList());
1906 1940
 //            }
1907 1941
             for (MsCaseAffiliate affiliate : affiliates) {
1908
-                if(affiliate.getUserId().equals(loginUser.getUser().getUserId())){
1942
+                if(affiliate.getUserId()!=null && affiliate.getUserId().equals(loginUser.getUser().getUserId())){
1909 1943
                     if( affiliate.getRoleType()==null){
1910 1944
                         continue;
1911 1945
                     }
@@ -1971,7 +2005,7 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
1971 2005
             return AjaxResult.error("未找到案件相关人员");
1972 2006
         }
1973 2007
         for (MsCaseAffiliate affiliate : affiliates) {
1974
-            if(affiliate.getUserId().equals(user.getUserId())){
2008
+            if((affiliate.getUserId()!=null && affiliate.getUserId().equals(user.getUserId()))){
1975 2009
                 if( affiliate.getRoleType()==null){
1976 2010
                     continue;
1977 2011
                 }
@@ -2370,8 +2404,8 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
2370 2404
     public SysUser getUserInfo() {
2371 2405
         SysUser sysUser =new SysUser();
2372 2406
 
2373
-        if(StrUtil.isNotEmpty(SecurityUtils.getUsername())){
2374
-             sysUser = sysUserMapper.selectUserByUserName(getUsername());
2407
+        if(SecurityUtils.getUserId()!=null){
2408
+             sysUser = sysUserMapper.selectUserById(SecurityUtils.getUserId());
2375 2409
 
2376 2410
         }
2377 2411
         return sysUser;
@@ -2671,7 +2705,7 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
2671 2705
 
2672 2706
                                                         //发送签名链接短信,尊敬的{1}用户,您的{2}调解案件,签名链接{3},请点击链接签名,如非本人操作,请忽略本短信
2673 2707
                                                         SmsUtils.SendSmsRequest request = new SmsUtils.SendSmsRequest();
2674
-                                                        request.setTemplateId("2115975");
2708
+                                                        request.setTemplateId("2116857");
2675 2709
                                                         // todo
2676 2710
                                                         // 申请人发送短信
2677 2711
                                                         request.setPhone(applicantAffiliateOpt.get().getPhone());
@@ -2698,7 +2732,7 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
2698 2732
                                                         String urlResponnew = urlRespon.substring(urlRespon.lastIndexOf("/") + 1);
2699 2733
 
2700 2734
                                                         SmsUtils.SendSmsRequest request1 = new SmsUtils.SendSmsRequest();
2701
-                                                        request1.setTemplateId("2115975");
2735
+                                                        request1.setTemplateId("2116857");
2702 2736
                                                         request1.setPhone(resAffiliateOpt.get().getPhone());
2703 2737
                                                         request1.setTemplateParamSet(new String[]{resAffiliateOpt.get().getName(), application.getCaseNum(), urlResponnew});
2704 2738
                                                         Boolean aBoolean1 = SmsUtils.sendSms(request1);
@@ -2722,7 +2756,7 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
2722 2756
                                                         String urlResponnewMedi = urlResponMedi.substring(urlResponMedi.lastIndexOf("/") + 1);
2723 2757
 
2724 2758
                                                         SmsUtils.SendSmsRequest requestMedi = new SmsUtils.SendSmsRequest();
2725
-                                                        requestMedi.setTemplateId("2115975");
2759
+                                                        requestMedi.setTemplateId("2116857");
2726 2760
                                                         requestMedi.setPhone(sealSignRecord.getPensonAccountMedi());
2727 2761
                                                         requestMedi.setTemplateParamSet(new String[]{sealSignRecord.getPensonNameMedi(), application.getCaseNum(), urlResponnewMedi});
2728 2762
                                                         Boolean aBooleanMedi = SmsUtils.sendSms(requestMedi);
@@ -3104,7 +3138,7 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
3104 3138
                 for (MsCaseAttach msCaseAttach : msCaseAttaches) {
3105 3139
                     String templatePath = "/home/ruoyi" + msCaseAttach.getAnnexPath();
3106 3140
                     File file = new File(templatePath.replace("/profile", "/uploadPath"));
3107
-                    MsCaseFileInfo caseFileInfo = beiMingInterfaceService.pushAttachmentInfo(BMUserName, BMPassword, file, BMSyncSource, application.getCaseNum(),AttachmentOperateTypeEnum.ADD);
3141
+                    MsCaseFileInfo caseFileInfo = beiMingInterfaceService.pushAttachmentInfo(BMUserName, BMPassword, file, BMSyncSource, application.getCaseNum(),AttachmentOperateTypeEnum.ADD,DocumentTypeEnum.EVEDENT_AGREEMENT);
3108 3142
                     // 更新附件表
3109 3143
                     if(caseFileInfo!=null && StrUtil.isNotEmpty(caseFileInfo.getFileId())){
3110 3144
                         msCaseAttach.setOtherSysFileId(caseFileInfo.getFileId());
@@ -3363,6 +3397,9 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
3363 3397
                                 .build();
3364 3398
 
3365 3399
                 }
3400
+                //保存到附件表里,先删除之前的在保存
3401
+                msCaseAttachMapper.deleteCaseAttachByCasedIdAndType(caseAttach.getCaseAppliId(), annexType);
3402
+                msCaseAttachMapper.save(caseAttach);
3366 3403
             }
3367 3404
 
3368 3405
         }else {
@@ -3372,12 +3409,32 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
3372 3409
                     .annexPath(resultFilePath.replace(RuoYiConfig.getProfile(),Constants.RESOURCE_PREFIX))
3373 3410
                     .annexType(annexType)
3374 3411
                     .build();
3375
-        }
3376
-        //保存到附件表里,先删除之前的在保存
3377
-        if(caseAttach != null) {
3378
-           msCaseAttachMapper.deleteCaseAttachByCasedIdAndType(caseAttach.getCaseAppliId(), annexType);
3412
+            // 查找已经存在的附件
3413
+            List<MsCaseAttach> existAttach = msCaseAttachMapper.listCaseAttachByCaseIdAndType(application.getId(), annexType);
3414
+            if(CollectionUtil.isNotEmpty(existAttach)){
3415
+                // todo 对接北明,同步案件状态,删除
3416
+                for (MsCaseAttach msCaseAttach : existAttach) {
3417
+                    if(StrUtil.isEmpty(msCaseAttach.getOtherSysFileId())||StrUtil.isEmpty(msCaseAttach.getAnnexPath())){
3418
+                        continue;
3419
+                    }
3420
+                    beiMingInterfaceService.deleteAttachmentInfo(application.getCaseNum(), msCaseAttach.getOtherSysFileId(), FileUtil.getName(msCaseAttach.getAnnexPath()));
3421
+                }
3422
+            }
3423
+            msCaseAttachMapper.deleteCaseAttachByCasedIdAndType(caseAttach.getCaseAppliId(), annexType);
3424
+            if(StrUtil.isEmpty(application.getCaseSource())) {
3425
+                // 北明推送
3426
+                String path = "/home/ruoyi" + caseAttach.getAnnexPath();
3427
+                File file = new File(path.replace("/profile", "/uploadPath"));
3428
+                MsCaseFileInfo caseFileInfo = beiMingInterfaceService.pushAttachmentInfo(BMUserName, BMPassword, file, BMSyncSource, application.getCaseNum(), AttachmentOperateTypeEnum.ADD, DocumentTypeEnum.EVEDENT_APPLY_BOOK);
3429
+
3430
+                // 更新附件表
3431
+                if (caseFileInfo != null && StrUtil.isNotEmpty(caseFileInfo.getFileId())) {
3432
+                    caseAttach.setOtherSysFileId(caseFileInfo.getFileId());
3433
+                }
3434
+            }
3379 3435
             msCaseAttachMapper.save(caseAttach);
3380 3436
         }
3437
+
3381 3438
     }
3382 3439
 
3383 3440
     /**

+ 31
- 31
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/mscase/impl/MsSignSealServiceImpl.java Ver fichero

@@ -15,10 +15,7 @@ import com.ruoyi.common.core.domain.AjaxResult;
15 15
 import com.ruoyi.common.core.domain.entity.EsignHttpResponse;
16 16
 import com.ruoyi.common.core.domain.entity.SysRole;
17 17
 import com.ruoyi.common.core.domain.entity.SysUser;
18
-import com.ruoyi.common.enums.AnnexTypeEnum;
19
-import com.ruoyi.common.enums.AttachmentOperateTypeEnum;
20
-import com.ruoyi.common.enums.PushCaseStatusEnum;
21
-import com.ruoyi.common.enums.YesOrNoEnum;
18
+import com.ruoyi.common.enums.*;
22 19
 import com.ruoyi.common.exception.EsignDemoException;
23 20
 import com.ruoyi.common.exception.ServiceException;
24 21
 import com.ruoyi.common.utils.EmailOutUtil;
@@ -27,6 +24,7 @@ import com.ruoyi.common.utils.StringUtils;
27 24
 import com.ruoyi.common.utils.file.SaaSAPIFileUtils;
28 25
 import com.ruoyi.system.domain.entity.flow.MsCaseFlow;
29 26
 import com.ruoyi.system.domain.vo.flow.MsCaseFlowVO;
27
+import com.ruoyi.system.mapper.SysRoleMapper;
30 28
 import com.ruoyi.system.mapper.SysUserMapper;
31 29
 import com.ruoyi.system.mapper.flow.MsCaseFlowMapper;
32 30
 import com.ruoyi.system.service.impl.BeiMingInterfaceService;
@@ -110,6 +108,8 @@ public class MsSignSealServiceImpl implements MsSignSealService {
110 108
 
111 109
     @Autowired
112 110
     private SendMailRecordMapper sendMailRecordMapper;
111
+    @Autowired
112
+    private SysRoleMapper roleMapper;
113 113
     // 北明配置
114 114
     @Value("${BMConfig.userName}")
115 115
     private String BMUserName;
@@ -550,36 +550,37 @@ public class MsSignSealServiceImpl implements MsSignSealService {
550 550
         if(CollectionUtil.isEmpty(affiliates)){
551 551
             return AjaxResult.error("未找到案件相关人员");
552 552
         }
553
+        SysUser user = sysUserMapper.selectUserById(SecurityUtils.getLoginUser().getUser().getUserId());
554
+        List<SysRole> roles = user.getRoles();
555
+        if(CollectionUtil.isEmpty(roles)){
556
+            return AjaxResult.error("该用户未绑定角色");
557
+        }
558
+        long mediatorCount = roles.stream().filter(sysRole -> sysRole.getRoleName().equals("调解员")).count();
553 559
         List<MsCaseAffiliate> operatorList = affiliates.stream().filter(msCaseAffiliate -> msCaseAffiliate.getOperatorFlag() != null
554 560
                 && msCaseAffiliate.getOperatorFlag() == 1
555 561
                 && StrUtil.isNotEmpty(msCaseAffiliate.getPhone())).collect(Collectors.toList());
556 562
         Optional<MsCaseAffiliate> appOpt =null;
557 563
         Optional<MsCaseAffiliate> resOpt =null;
558 564
         if(CollectionUtil.isNotEmpty(operatorList)){
559
-           appOpt = operatorList.stream().filter(msCaseAffiliate -> msCaseAffiliate.getRoleType() != null
565
+           appOpt = operatorList.stream().filter(msCaseAffiliate -> msCaseAffiliate.getRoleType() != null && msCaseAffiliate.getUserId()!=null
560 566
                             && (msCaseAffiliate.getRoleType() == 1 || msCaseAffiliate.getRoleType() == 2))
561 567
                     .findFirst();
562
-            resOpt = operatorList.stream().filter(msCaseAffiliate -> msCaseAffiliate.getRoleType() != null
568
+            resOpt = operatorList.stream().filter(msCaseAffiliate -> msCaseAffiliate.getRoleType() != null&& msCaseAffiliate.getUserId()!=null
563 569
                             && (msCaseAffiliate.getRoleType() == 3 || msCaseAffiliate.getRoleType() == 4))
564 570
                     .findFirst();
565 571
         }
566
-
572
+        if(appOpt==null || !appOpt.isPresent()){
573
+            return AjaxResult.error("未找到案件申请操作人");
574
+        }
575
+        if(resOpt==null || !resOpt.isPresent()){
576
+            return AjaxResult.error("未找到案件被申请操作人");
577
+        }
567 578
         MsCaseApplication caseApplication = msCaseApplicationMapper.selectByPrimaryKey(caseId);
568 579
         Integer organizeFlag = caseApplication.getOrganizeFlag();
569
-        SysUser user = new SysUser();
570 580
         Long userId = SecurityUtils.getUserId();
571
-        user.setUserId(userId);
572
-        List<SysUser> listSysUser = userMapper.selectUserList(user);
573
-        List<SysRole> allSysRole = new ArrayList<>();
574
-        for(SysUser sysUser :listSysUser){
575
-            List<SysRole> roles = sysUser.getRoles();
576
-            allSysRole.addAll(roles);
577
-        }
578
-        List<String> roleNames = allSysRole.stream().map(SysRole::getRoleName).collect(Collectors.toList());
579
-        if(roleNames.contains("申请人")){
580
-            if(appOpt==null || !appOpt.isPresent()){
581
-                return AjaxResult.error("未找到案件申请操作人");
582
-            }
581
+
582
+        if(appOpt.get().getUserId()!=null && appOpt.get().getUserId().equals(userId)){
583
+            // 申请人链接
583 584
             SealSignRecord sealSignRecordres = new SealSignRecord();
584 585
             MsSealSignRecord mssealSignRecord = new MsSealSignRecord();
585 586
             mssealSignRecord.setCaseAppliId(caseId);
@@ -605,10 +606,9 @@ public class MsSignSealServiceImpl implements MsSignSealService {
605 606
             }
606 607
 
607 608
 
608
-        }else if(roleNames.contains("被申请人")){
609
-            if(resOpt==null || !resOpt.isPresent()){
610
-                return AjaxResult.error("未找到案件申请操作人");
611
-            }
609
+        }
610
+        if(resOpt.get().getUserId()!=null && resOpt.get().getUserId().equals(userId)){
611
+
612 612
             SealSignRecord sealSignRecordres = new SealSignRecord();
613 613
             MsSealSignRecord mssealSignRecord = new MsSealSignRecord();
614 614
             mssealSignRecord.setCaseAppliId(caseId);
@@ -630,7 +630,8 @@ public class MsSignSealServiceImpl implements MsSignSealService {
630 630
             }else {
631 631
                 return AjaxResult.error();
632 632
             }
633
-        }else if(roleNames.contains("调解员")){
633
+        }
634
+        if(mediatorCount>0){
634 635
             SealSignRecord sealSignRecordres = new SealSignRecord();
635 636
             MsSealSignRecord mssealSignRecord = new MsSealSignRecord();
636 637
             mssealSignRecord.setCaseAppliId(caseId);
@@ -859,7 +860,7 @@ public class MsSignSealServiceImpl implements MsSignSealService {
859 860
                                 if(StrUtil.isEmpty(caseApplicationselect.getCaseSource()) ) {
860 861
                                         String templatePath = "/home/ruoyi" + savePath;
861 862
                                         File file = new File(templatePath.replace("/profile", "/uploadPath"));
862
-                                        MsCaseFileInfo caseFileInfo = beiMingInterfaceService.pushAttachmentInfo(BMUserName, BMPassword, file, BMSyncSource, caseApplicationselect.getCaseNum(), AttachmentOperateTypeEnum.ADD);
863
+                                        MsCaseFileInfo caseFileInfo = beiMingInterfaceService.pushAttachmentInfo(BMUserName, BMPassword, file, BMSyncSource, caseApplicationselect.getCaseNum(), AttachmentOperateTypeEnum.ADD, DocumentTypeEnum.EVEDENT_AGREEMENT);
863 864
                                     // 更新附件表
864 865
                                     if(caseFileInfo!=null && StrUtil.isNotEmpty(caseFileInfo.getFileId())){
865 866
                                         caseAttach.setOtherSysFileId(caseFileInfo.getFileId());
@@ -954,7 +955,7 @@ public class MsSignSealServiceImpl implements MsSignSealService {
954 955
                                     if(StrUtil.isEmpty(caseApplicationselect.getCaseSource()) ) {
955 956
                                         String templatePath = "/home/ruoyi" + savePath;
956 957
                                         File file = new File(templatePath.replace("/profile", "/uploadPath"));
957
-                                        MsCaseFileInfo caseFileInfo = beiMingInterfaceService.pushAttachmentInfo(BMUserName, BMPassword, file, BMSyncSource, caseApplicationselect.getCaseNum(), AttachmentOperateTypeEnum.ADD);
958
+                                        MsCaseFileInfo caseFileInfo = beiMingInterfaceService.pushAttachmentInfo(BMUserName, BMPassword, file, BMSyncSource, caseApplicationselect.getCaseNum(), AttachmentOperateTypeEnum.ADD,DocumentTypeEnum.EVEDENT_AGREEMENT);
958 959
                                         // 更新附件表
959 960
                                         if(caseFileInfo!=null && StrUtil.isNotEmpty(caseFileInfo.getFileId())){
960 961
                                             caseAttach.setOtherSysFileId(caseFileInfo.getFileId());
@@ -1041,20 +1042,19 @@ public class MsSignSealServiceImpl implements MsSignSealService {
1041 1042
                                     caseAttach.setAnnexType(7);
1042 1043
                                     caseAttach.setAnnexPath(savePath);
1043 1044
                                     caseAttach.setAnnexName(saveName);
1044
-                                    caseAttachMapper.save(caseAttach);
1045
+
1045 1046
                                     // todo 对接北明,调用上传附件接口
1046 1047
 
1047 1048
                                     if(StrUtil.isEmpty(caseApplicationselect.getCaseSource()) ) {
1048 1049
                                         String templatePath = "/home/ruoyi" + savePath;
1049 1050
                                         File file = new File(templatePath.replace("/profile", "/uploadPath"));
1050
-                                        MsCaseFileInfo caseFileInfo = beiMingInterfaceService.pushAttachmentInfo(BMUserName, BMPassword, file, BMSyncSource, caseApplicationselect.getCaseNum(), AttachmentOperateTypeEnum.ADD);
1051
-
1051
+                                        MsCaseFileInfo caseFileInfo = beiMingInterfaceService.pushAttachmentInfo(BMUserName, BMPassword, file, BMSyncSource, caseApplicationselect.getCaseNum(), AttachmentOperateTypeEnum.ADD,DocumentTypeEnum.EVEDENT_AGREEMENT);
1052 1052
                                         // 更新附件表
1053 1053
                                         if(caseFileInfo!=null && StrUtil.isNotEmpty(caseFileInfo.getFileId())){
1054 1054
                                             caseAttach.setOtherSysFileId(caseFileInfo.getFileId());
1055
-                                            msCaseAttachMapper.updateCaseAttachBycaseid(caseAttach);
1056 1055
                                         }
1057 1056
                                     }
1057
+                                    caseAttachMapper.save(caseAttach);
1058 1058
                                 }
1059 1059
 
1060 1060
                             }

+ 57
- 0
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/mscase/impl/VideoConferenceServiceImpl.java Ver fichero

@@ -1,6 +1,8 @@
1 1
 package com.ruoyi.wisdomarbitrate.service.mscase.impl;
2 2
 
3 3
 import cn.hutool.core.collection.CollectionUtil;
4
+import cn.hutool.core.io.FileUtil;
5
+import cn.hutool.core.util.StrUtil;
4 6
 import cn.hutool.http.HttpUtil;
5 7
 import com.alibaba.fastjson.JSON;
6 8
 import com.alibaba.fastjson.JSONObject;
@@ -9,15 +11,19 @@ import com.ruoyi.common.core.domain.AjaxResult;
9 11
 import com.ruoyi.common.core.domain.entity.SysRole;
10 12
 import com.ruoyi.common.core.domain.entity.SysUser;
11 13
 import com.ruoyi.common.enums.AnnexTypeEnum;
14
+import com.ruoyi.common.enums.AttachmentOperateTypeEnum;
15
+import com.ruoyi.common.enums.DocumentTypeEnum;
12 16
 import com.ruoyi.common.exception.ServiceException;
13 17
 import com.ruoyi.common.utils.PdfUtils;
14 18
 import com.ruoyi.common.utils.SecurityUtils;
15 19
 import com.ruoyi.system.mapper.SysRoleMapper;
16 20
 import com.ruoyi.system.mapper.SysUserMapper;
21
+import com.ruoyi.system.service.impl.BeiMingInterfaceService;
17 22
 import com.ruoyi.wisdomarbitrate.domain.dto.mscase.ReservedConference;
18 23
 import com.ruoyi.wisdomarbitrate.domain.entity.mscase.MsCaseApplication;
19 24
 import com.ruoyi.wisdomarbitrate.domain.entity.mscase.MsCaseAttach;
20 25
 import com.ruoyi.wisdomarbitrate.domain.vo.mscase.MsCaseApplicationVO;
26
+import com.ruoyi.wisdomarbitrate.domain.vo.mscase.MsCaseFileInfo;
21 27
 import com.ruoyi.wisdomarbitrate.domain.vo.mscase.MsReservedConferenceVO;
22 28
 import com.ruoyi.wisdomarbitrate.mapper.mscase.MsCaseApplicationMapper;
23 29
 import com.ruoyi.wisdomarbitrate.mapper.mscase.MsCaseAttachMapper;
@@ -39,6 +45,7 @@ import tk.mybatis.mapper.entity.Example;
39 45
 
40 46
 import javax.crypto.Mac;
41 47
 import javax.crypto.spec.SecretKeySpec;
48
+import java.io.File;
42 49
 import java.io.IOException;
43 50
 import java.nio.file.Paths;
44 51
 import java.util.*;
@@ -78,6 +85,15 @@ public class VideoConferenceServiceImpl implements VideoConferenceService {
78 85
     private ReservedConferenceMapper reservedConferenceMapper;
79 86
     @Autowired
80 87
     private SysUserMapper sysUserMapper;
88
+    // 北明配置
89
+    @Value("${BMConfig.userName}")
90
+    private String BMUserName;
91
+    @Value("${BMConfig.password}")
92
+    private String BMPassword;
93
+    @Value("${BMConfig.syncSource}")
94
+    private String BMSyncSource;
95
+    @Autowired
96
+    BeiMingInterfaceService beiMingInterfaceService;
81 97
 
82 98
     /**
83 99
         视频回调
@@ -399,6 +415,11 @@ public class VideoConferenceServiceImpl implements VideoConferenceService {
399 415
     @Transactional
400 416
     @Override
401 417
     public AjaxResult htmlToPDF(MsReservedConferenceVO reservedConferenceVO) {
418
+        // 查询案件
419
+        MsCaseApplication caseApplication = caseApplicationMapper.selectByPrimaryKey(reservedConferenceVO.getCaseId());
420
+        if(caseApplication==null){
421
+            return AjaxResult.error("案件不存在");
422
+        }
402 423
         String currentFileName = System.currentTimeMillis() + ".pdf";
403 424
         String fileName = null;
404 425
         try {
@@ -413,12 +434,35 @@ public class VideoConferenceServiceImpl implements VideoConferenceService {
413 434
         // 绑定案件
414 435
         if(convertFlag){
415 436
             // 删除之前的庭审笔录
437
+            if(StrUtil.isEmpty(caseApplication.getCaseSource())){
438
+                List<MsCaseAttach> existAttach = caseAttachMapper.listCaseAttachByCaseIdAndType(reservedConferenceVO.getCaseId(), AnnexTypeEnum.MEDIATE.getCode());
439
+                if(CollectionUtil.isNotEmpty(existAttach)){
440
+                    // todo 对接北明,同步案件状态,删除
441
+                    for (MsCaseAttach msCaseAttach : existAttach) {
442
+                        if(StrUtil.isEmpty(msCaseAttach.getOtherSysFileId())||StrUtil.isEmpty(msCaseAttach.getAnnexPath())){
443
+                            continue;
444
+                        }
445
+                        beiMingInterfaceService.deleteAttachmentInfo(caseApplication.getCaseNum(), msCaseAttach.getOtherSysFileId(), FileUtil.getName(msCaseAttach.getAnnexPath()));
446
+                    }
447
+                }
448
+            }
416 449
             caseAttachMapper.deleteCaseAttachByCasedIdAndType(reservedConferenceVO.getCaseId(),AnnexTypeEnum.MEDIATE.getCode());
417 450
             MsCaseAttach caseAttach = MsCaseAttach.builder().caseAppliId(reservedConferenceVO.getCaseId())
418 451
                     .annexName(currentFileName)
419 452
                     .annexPath(fileName)
420 453
                     .annexType(AnnexTypeEnum.MEDIATE.getCode())
421 454
                     .build();
455
+            // todo 对接北明,调用上传附件接口
456
+
457
+            if(StrUtil.isEmpty(caseApplication.getCaseSource()) ) {
458
+                String templatePath = "/home/ruoyi" + caseAttach.getAnnexPath();
459
+                File file = new File(templatePath.replace("/profile", "/uploadPath"));
460
+                MsCaseFileInfo caseFileInfo = beiMingInterfaceService.pushAttachmentInfo(BMUserName, BMPassword, file, BMSyncSource, caseApplication.getCaseNum(), AttachmentOperateTypeEnum.ADD,DocumentTypeEnum.EVEDENT_MEDIATION_RECORD);
461
+                // 更新附件表
462
+                if(caseFileInfo!=null && StrUtil.isNotEmpty(caseFileInfo.getFileId())){
463
+                    caseAttach.setOtherSysFileId(caseFileInfo.getFileId());
464
+                }
465
+            }
422 466
             caseAttachMapper.save(caseAttach);
423 467
             return AjaxResult.success();
424 468
         }else {
@@ -460,7 +504,20 @@ public class VideoConferenceServiceImpl implements VideoConferenceService {
460 504
                                 .annexPath(annexName)
461 505
                                 .annexType(AnnexTypeEnum.MEETING_VIDEO.getCode())
462 506
                                 .build();
507
+                        // todo 对接北明,调用上传附件接口
508
+
509
+                        if(StrUtil.isEmpty(caseApplication.getCaseSource()) ) {
510
+                            String templatePath = "/home/ruoyi" + caseAttach.getAnnexPath();
511
+                            File file = new File(templatePath.replace("/profile", "/uploadPath"));
512
+                            MsCaseFileInfo caseFileInfo = beiMingInterfaceService.pushAttachmentInfo(BMUserName, BMPassword, file, BMSyncSource, caseApplication.getCaseNum(), AttachmentOperateTypeEnum.ADD, DocumentTypeEnum.EVEDENT_MEDIATION_VIDEO);
513
+
514
+                            // 更新附件表
515
+                            if(caseFileInfo!=null && StrUtil.isNotEmpty(caseFileInfo.getFileId())){
516
+                                caseAttach.setOtherSysFileId(caseFileInfo.getFileId());
517
+                            }
518
+                        }
463 519
                         caseAttachMapper.save(caseAttach);
520
+
464 521
                         return annexName;
465 522
                     }
466 523
                 }

+ 15
- 0
ruoyi-system/src/main/resources/mapper/system/SysDeptMapper.xml Ver fichero

@@ -115,6 +115,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
115 115
  			<if test="createBy != null and createBy != ''">create_by,</if>
116 116
  			<if test="code != null and code != ''">code,</if>
117 117
  			<if test="compLegalPerson != null and compLegalPerson != ''">comp_legal_person,</if>
118
+ 			<if test="home != null and home != ''">home,</if>
119
+ 			<if test="address != null and address != ''">address,</if>
120
+			<if test="nationality != null ">nationality,</if>
118 121
  			create_time
119 122
  		)values(
120 123
  			<if test="deptId != null and deptId != 0">#{deptId},</if>
@@ -130,6 +133,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
130 133
  			<if test="createBy != null and createBy != ''">#{createBy},</if>
131 134
 		   <if test="code != null and code != ''">#{code},</if>
132 135
 		   <if test="compLegalPerson != null and compLegalPerson != ''">#{compLegalPerson},</if>
136
+		   <if test="home != null and home != ''">#{home},</if>
137
+		   <if test="address != null and address != ''">#{address},</if>
138
+			<if test="nationality != null ">#{nationality},</if>
133 139
  			sysdate()
134 140
  		);
135 141
 	</insert>
@@ -148,6 +154,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
148 154
 		create_by,
149 155
 		code,
150 156
 		comp_legal_person,
157
+		nationality,
158
+		home,
159
+		address,
151 160
 		create_time
152 161
 		)values
153 162
 		<foreach item="item" index="index" collection="list" separator=",">
@@ -165,6 +174,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
165 174
 		#{item.createBy},
166 175
 		#{item.code},
167 176
 		#{item.compLegalPerson},
177
+		#{item.nationality},
178
+		#{item.home},
179
+		#{item.address},
168 180
 		sysdate()
169 181
 		)
170 182
 		</foreach>;
@@ -186,6 +198,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
186 198
  			<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
187 199
  			<if test="code != null and code != ''">code = #{code},</if>
188 200
  			<if test="compLegalPerson != null and compLegalPerson != ''">comp_legal_person = #{compLegalPerson},</if>
201
+ 			<if test="home != null and home != ''">home = #{home},</if>
202
+ 			<if test="address != null and address != ''">address = #{address},</if>
203
+ 			<if test="nationality != null ">nationality = #{nationality},</if>
189 204
  			update_time = sysdate()
190 205
  		</set>
191 206
  		where dept_id = #{deptId}

+ 14
- 4
ruoyi-system/src/main/resources/mapper/wisdomarbitrate/mscase/MsCaseAffiliateMapper.xml Ver fichero

@@ -39,8 +39,13 @@
39 39
     group by a.case_appli_id
40 40
   </select>
41 41
     <select id="selectByCaseId" resultType="com.ruoyi.wisdomarbitrate.domain.entity.mscase.MsCaseAffiliate">
42
-        select c.id caseAppliId,a.id,a.role_type roleType,a.group_order groupOrder,a.operator_flag operatorFlag,d.code,d.comp_legal_person compLegalPerson,u.nick_name name,u.id_card idCard,u.phonenumber phone,
43
-            u.email,u.home,u.address,u.sex,u.nationality,u.id_type idType,u.birth,a.user_id userId
42
+        select c.id caseAppliId,a.id,a.role_type roleType,a.group_order groupOrder,a.operator_flag operatorFlag,d.code,d.comp_legal_person compLegalPerson,u.id_card idCard,u.phonenumber phone,
43
+            u.email,
44
+               (case when a.user_id is null then d.dept_name else u.nick_name end)  name,
45
+               (case when a.user_id is null then d.home else u.home end) home,
46
+               (case when a.user_id is null then d.address else u.address end) address,
47
+               (case when a.user_id is null then d.nationality else u.nationality end) nationality,
48
+                u.sex,u.id_type idType,u.birth,a.user_id userId,c.organize_flag organizeFlag,c.case_source caseSource,d.dept_name applicantOrgName
44 49
         FROM
45 50
             ms_case_application c
46 51
                 JOIN ms_case_affiliate a ON a.case_appli_id=#{id} and c.id = a.case_appli_id
@@ -52,8 +57,13 @@
52 57
         GROUP BY a.id
53 58
     </select>
54 59
     <select id="selectUserRoleByCaseIds" resultType="com.ruoyi.wisdomarbitrate.domain.entity.mscase.MsCaseAffiliate">
55
-        select c.id caseAppliId,a.id,a.role_type roleType,a.group_order groupOrder,a.operator_flag operatorFlag,d.code,d.comp_legal_person compLegalPerson,u.nick_name name,u.id_card idCard,u.phonenumber phone,
56
-               u.email,u.home,u.address,u.sex,u.nationality,u.id_type idType,u.birth,r.role_name roleName,d.dept_name applicantOrgName,a.user_id userId
60
+        select c.id caseAppliId,a.id,a.role_type roleType,a.group_order groupOrder,a.operator_flag operatorFlag,d.code,d.comp_legal_person compLegalPerson,u.id_card idCard,u.phonenumber phone,
61
+               u.email,
62
+        (case when a.user_id is null then d.dept_name else u.nick_name end)  name,
63
+        (case when a.user_id is null then d.home else u.home end) home,
64
+        (case when a.user_id is null then d.address else u.address end) address,
65
+        (case when a.user_id is null then d.nationality else u.nationality end) nationality,
66
+        u.sex,u.id_type idType,u.birth,r.role_name roleName,d.dept_name applicantOrgName,a.user_id userId,a.applicant_dept_id applicantDeptId,c.organize_flag organizeFlag,c.case_source caseSource
57 67
         FROM
58 68
             ms_case_application c
59 69
                 JOIN ms_case_affiliate a ON  c.id = a.case_appli_id

+ 2
- 2
ruoyi-system/src/main/resources/mapper/wisdomarbitrate/mscase/MsCaseApplicationMapper.xml Ver fichero

@@ -110,7 +110,7 @@
110 110
   <select id="list" resultType="com.ruoyi.wisdomarbitrate.domain.vo.mscase.MsCaseApplicationVO">
111 111
     select t.* from(
112 112
     SELECT
113
-    c.id,c.media_result mediaResult,c.room_id roomId,0 AS pendingStatus,
113
+    c.id,c.organize_flag organizeFlag,c.case_source caseSource,c.media_result mediaResult,c.room_id roomId,0 AS pendingStatus,
114 114
     c.case_flow_id caseFlowId,c.batch_number batchNumber,c.case_num caseNum,
115 115
     u1.nick_name mediatorName,c.hear_date hearDate,c.case_status_name caseStatusName,c.create_time createTime,
116 116
     c.mediation_method mediationMethod,
@@ -120,7 +120,7 @@
120 120
     c.id
121 121
     union
122 122
     SELECT
123
-    c.id,c.media_result mediaResult,c.room_id roomId,1 AS pendingStatus,
123
+    c.id,c.organize_flag organizeFlag,c.case_source caseSource,c.media_result mediaResult,c.room_id roomId,1 AS pendingStatus,
124 124
     c.case_flow_id caseFlowId,c.batch_number batchNumber,c.case_num caseNum,
125 125
     u1.nick_name mediatorName,c.hear_date hearDate,c.case_status_name caseStatusName,c.create_time createTime,
126 126
     c.mediation_method mediationMethod,