Ver código fonte

调解系统修改

18792927508 2 anos atrás
pai
commit
72026ee6f4
51 arquivos alterados com 3721 adições e 3861 exclusões
  1. 21
    0
      ruoyi-admin/src/main/java/com/ruoyi/RuoYiApplication.java
  2. 11
    0
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysLoginController.java
  3. 4
    4
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/tool/TestApiController.java
  4. 1
    13
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/mscase/MsCaseApplicationController.java
  5. 1
    63
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/mscase/MsSignSealController.java
  6. 2
    2
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/mscase/MsVideoConferenceController.java
  7. 17
    0
      ruoyi-common/src/main/java/com/ruoyi/common/constant/CacheConstants.java
  8. 3
    0
      ruoyi-common/src/main/java/com/ruoyi/common/constant/Constants.java
  9. 26
    0
      ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SMSNotice.java
  10. 34
    0
      ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SMSNoticeDO.java
  11. 31
    5
      ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysDept.java
  12. 44
    0
      ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysUser.java
  13. 18
    0
      ruoyi-common/src/main/java/com/ruoyi/common/enums/DocumentTypeEnum.java
  14. 25
    11
      ruoyi-common/src/main/java/com/ruoyi/common/utils/EmailOutUtil.java
  15. 25
    3
      ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/SysLoginService.java
  16. 4
    1
      ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/TokenService.java
  17. 55
    0
      ruoyi-system/src/main/java/com/ruoyi/system/domain/entity/log/MsRequestLog.java
  18. 6
    6
      ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysUserMapper.java
  19. 7
    0
      ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysUserRoleMapper.java
  20. 7
    0
      ruoyi-system/src/main/java/com/ruoyi/system/mapper/log/MsRequestLogMapper.java
  21. 11
    6
      ruoyi-system/src/main/java/com/ruoyi/system/service/BeiMingInterface.java
  22. 14
    0
      ruoyi-system/src/main/java/com/ruoyi/system/service/MsRequestLogService.java
  23. 88
    14
      ruoyi-system/src/main/java/com/ruoyi/system/service/impl/BeiMingInterfaceService.java
  24. 24
    0
      ruoyi-system/src/main/java/com/ruoyi/system/service/impl/MsRequestLogServiceImpl.java
  25. 21
    7
      ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDeptServiceImpl.java
  26. 26
    8
      ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysRoleServiceImpl.java
  27. 67
    99
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/entity/mscase/MsCaseAffiliate.java
  28. 16
    4
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/entity/mscase/MsCaseApplication.java
  29. 5
    0
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/entity/mscase/MsCaseAttach.java
  30. 32
    0
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/vo/mscase/MsCaseAffiliateBase.java
  31. 11
    0
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/vo/mscase/MsCaseAffiliateParent.java
  32. 32
    0
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/vo/mscase/MsCaseAffiliateVO.java
  33. 13
    0
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/vo/mscase/MsCaseApplicationReq.java
  34. 13
    2
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/vo/mscase/MsCaseApplicationVO.java
  35. 23
    0
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/mscase/MsCaseAffiliateMapper.java
  36. 4
    156
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/mscase/MsCaseApplicationMapper.java
  37. 81
    16
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/mscase/MsCaseApplicationService.java
  38. 7
    0
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/mscase/MsCasePaymentService.java
  39. 1
    8
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/mscase/MsSignSealService.java
  40. 1
    1
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/mscase/VideoConferenceService.java
  41. 2375
    2844
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/mscase/impl/MsCaseApplicationServiceImpl.java
  42. 76
    73
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/mscase/impl/MsCasePaymentServiceImpl.java
  43. 182
    455
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/mscase/impl/MsSignSealServiceImpl.java
  44. 19
    32
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/mscase/impl/VideoConferenceServiceImpl.java
  45. 15
    0
      ruoyi-system/src/main/resources/com/ruoyi/system/mapper/log/MsRequestLogMapper.xml
  46. 12
    0
      ruoyi-system/src/main/resources/mapper/system/SysDeptMapper.xml
  47. 23
    4
      ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml
  48. 5
    1
      ruoyi-system/src/main/resources/mapper/system/SysUserRoleMapper.xml
  49. 69
    23
      ruoyi-system/src/main/resources/mapper/wisdomarbitrate/mscase/MsCaseAffiliateMapper.xml
  50. 109
    0
      ruoyi-system/src/main/resources/mapper/wisdomarbitrate/mscase/MsCaseApplicationMapper.xml
  51. 4
    0
      ruoyi-system/src/main/resources/mapper/wisdomarbitrate/mscase/MsCaseAttachMapper.xml

+ 21
- 0
ruoyi-admin/src/main/java/com/ruoyi/RuoYiApplication.java Ver arquivo

@@ -2,9 +2,13 @@ package com.ruoyi;
2 2
 
3 3
 import cn.hutool.core.collection.CollectionUtil;
4 4
 import com.ruoyi.common.constant.CacheConstants;
5
+import com.ruoyi.common.core.domain.entity.SysDept;
6
+import com.ruoyi.common.core.domain.entity.SysRole;
5 7
 import com.ruoyi.common.core.domain.entity.SysUser;
6 8
 import com.ruoyi.common.core.redis.RedisCache;
7 9
 import com.ruoyi.common.utils.spring.SpringUtils;
10
+import com.ruoyi.system.mapper.SysDeptMapper;
11
+import com.ruoyi.system.mapper.SysRoleMapper;
8 12
 import com.ruoyi.system.mapper.SysUserMapper;
9 13
 import org.springframework.boot.SpringApplication;
10 14
 import org.springframework.boot.autoconfigure.SpringBootApplication;
@@ -45,6 +49,23 @@ public class RuoYiApplication
45 49
         if(CollectionUtil.isNotEmpty(sysUsers)){
46 50
             for (SysUser sysUser : sysUsers) {
47 51
                 redisCache.setCacheObject(CacheConstants.USER_KEY+sysUser.getUserId(),sysUser);
52
+                redisCache.setCacheObject(CacheConstants.USER_EMAIL_KEY+sysUser.getEmail(),sysUser);
53
+            }
54
+        }
55
+        // 初始化角色redis
56
+        SysRoleMapper roleMapper = SpringUtils.getBean(SysRoleMapper.class);
57
+        List<SysRole> roles = roleMapper.selectRoleList(new SysRole());
58
+        if(CollectionUtil.isNotEmpty(roles)){
59
+            for (SysRole role : roles) {
60
+                redisCache.setCacheObject(CacheConstants.ROLE_KEY+role.getRoleName(),role.getRoleId());
61
+            }
62
+        }
63
+        // 初始化部门redis
64
+        SysDeptMapper deptMapper = SpringUtils.getBean(SysDeptMapper.class);
65
+        List<SysDept> depts = deptMapper.selectDeptList(new SysDept());
66
+        if(CollectionUtil.isNotEmpty(depts)){
67
+            for (SysDept dept : depts) {
68
+                redisCache.setCacheObject(CacheConstants.DEPT_KEY+dept.getDeptName(),dept.getDeptId());
48 69
             }
49 70
         }
50 71
     }

+ 11
- 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysLoginController.java Ver arquivo

@@ -116,6 +116,17 @@ public class SysLoginController {
116 116
         }
117 117
       return   loginService.loginSSO(loginBody);
118 118
 
119
+    }
120
+    /**对接BM,根据用户名查询token*/
121
+    @GetMapping("selectTokenByUserName")
122
+    public AjaxResult selectTokenByUserName( LoginBody loginBody){
123
+        if(StrUtil.isEmpty(loginBody.getUsername()) || StrUtil.isEmpty(loginBody.getTicket())
124
+                ){
125
+            return AjaxResult.error("参数错误");
126
+        }
127
+
128
+        return   loginService.selectTokenByUserName(loginBody);
129
+
119 130
     }
120 131
 
121 132
     public static void main(String[] args) {

+ 4
- 4
ruoyi-admin/src/main/java/com/ruoyi/web/controller/tool/TestApiController.java Ver arquivo

@@ -2,12 +2,12 @@ package com.ruoyi.web.controller.tool;
2 2
 
3 3
 import com.alibaba.fastjson.JSON;
4 4
 import com.alibaba.fastjson.JSONObject;
5
-import com.fasterxml.jackson.databind.ObjectMapper;
6
-import com.fasterxml.jackson.databind.node.ObjectNode;
7 5
 import com.ruoyi.common.annotation.Anonymous;
8 6
 import com.ruoyi.common.core.domain.AjaxResult;
7
+import com.ruoyi.common.enums.AttachmentOperateTypeEnum;
9 8
 import com.ruoyi.common.enums.PushCaseStatusEnum;
10 9
 import com.ruoyi.system.service.impl.BeiMingInterfaceService;
10
+import com.ruoyi.wisdomarbitrate.domain.vo.mscase.MsCaseFileInfo;
11 11
 import com.ruoyi.wisdomarbitrate.domain.vo.mscase.MsCaseStatusInfo;
12 12
 import org.springframework.beans.factory.annotation.Autowired;
13 13
 import org.springframework.beans.factory.annotation.Value;
@@ -18,7 +18,6 @@ import org.springframework.web.bind.annotation.RestController;
18 18
 import java.io.File;
19 19
 
20 20
 import static com.ruoyi.common.utils.EncryptUtils.sm4Decrypt;
21
-import static com.ruoyi.common.utils.EncryptUtils.sm4Encrypt;
22 21
 
23 22
 @RestController
24 23
 @RequestMapping("/beiming/api")
@@ -57,12 +56,13 @@ public class TestApiController {
57 56
         return AjaxResult.success();
58 57
     }
59 58
 
59
+
60 60
     @GetMapping("/testfile")
61 61
     @Anonymous
62 62
     public AjaxResult testfile() {
63 63
 //        File file = new File("D:/WorkDoc/TJ/File/证据1.png");
64 64
         File file = new File("D:/WorkDoc/TJ/File/证据3.png");
65
-        JSONObject jsonObject1 = beiMingInterfaceService.pushAttachmentInfo("BWT_MEDIATION", "86251b190e3a40f3942v215d1762c663", file, "123abc", "BWT_MEDIATION", "zc2024032700012");
65
+            MsCaseFileInfo jsonObject1 = beiMingInterfaceService.pushAttachmentInfo("BWT_MEDIATION", "86251b190e3a40f3942v215d1762c663", file, "BWT_MEDIATION", "zc2024032700012", AttachmentOperateTypeEnum.ADD);
66 66
         System.out.println("fanhui:" + jsonObject1.toString());
67 67
         return AjaxResult.success();
68 68
     }

+ 1
- 13
ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/mscase/MsCaseApplicationController.java Ver arquivo

@@ -77,7 +77,7 @@ public class MsCaseApplicationController extends BaseController {
77 77
     @PostMapping("/insert")
78 78
     public AjaxResult insert(@RequestBody MsCaseApplicationVO caseApplication )
79 79
     {
80
-        if(caseApplication.getAffiliate()==null||caseApplication.getAffiliate().getOrganizeFlag()==null){
80
+        if( caseApplication.getAffiliate()==null|| caseApplication.getOrganizeFlag()==null){
81 81
             error("参数校验失败");
82 82
         }
83 83
         AjaxResult ajaxResult = AjaxResult.success();
@@ -344,19 +344,7 @@ public class MsCaseApplicationController extends BaseController {
344 344
 
345 345
         return caseApplicationService.updateTrialPen(attach);
346 346
     }
347
-    /**
348
-     * 确认调解书
349
-     * @param
350
-     * @return
351
-     */
352
-    @PostMapping("/confirmMediation")
353
-    public AjaxResult confirmMediation(@RequestBody MsCaseAttachVO attach) throws EsignDemoException, InterruptedException {
354
-        if (attach.getCaseFlowId()==null || attach.getCaseAppliId()==null ) {
355
-            return error("参数校验失败");
356
-        }
357 347
 
358
-        return caseApplicationService.confirmMediation(attach);
359
-    }
360 348
     /**
361 349
      * 获取userSign
362 350
      * @param userId

+ 1
- 63
ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/mscase/MsSignSealController.java Ver arquivo

@@ -2,18 +2,15 @@ package com.ruoyi.web.controller.wisdomarbitrate.mscase;
2 2
 
3 3
 import cn.hutool.core.collection.CollectionUtil;
4 4
 import cn.hutool.core.util.StrUtil;
5
-import cn.hutool.json.JSONUtil;
6 5
 import com.ruoyi.common.annotation.Anonymous;
7 6
 import com.ruoyi.common.core.controller.BaseController;
8 7
 import com.ruoyi.common.core.domain.AjaxResult;
9 8
 import com.ruoyi.common.exception.EsignDemoException;
10 9
 import com.ruoyi.wisdomarbitrate.domain.dto.mscase.MsSignSealDTO;
11 10
 import com.ruoyi.wisdomarbitrate.domain.dto.mscase.SealSignRecord;
12
-import com.ruoyi.wisdomarbitrate.domain.vo.mscase.MsCaseApplicationVO;
13 11
 import com.ruoyi.wisdomarbitrate.domain.vo.mscase.MsCaseLogRecordVO;
14 12
 import com.ruoyi.wisdomarbitrate.service.mscase.MsSignSealService;
15 13
 import com.ruoyi.wisdomarbitrate.utils.SignVerifyUtils;
16
-import org.springframework.beans.BeanUtils;
17 14
 import org.springframework.beans.factory.annotation.Autowired;
18 15
 import org.springframework.validation.annotation.Validated;
19 16
 import org.springframework.web.bind.annotation.PostMapping;
@@ -29,16 +26,7 @@ public class MsSignSealController  extends BaseController {
29 26
     @Autowired
30 27
     private MsSignSealService msSignSealService;
31 28
 
32
-    /**
33
-     * 调解书签名
34
-     */
35
-    @PostMapping("/sureMediationSeal")
36
-    public AjaxResult sureMediationSeal(@RequestBody MsCaseApplicationVO caseApplication ) throws EsignDemoException, InterruptedException {
37
-        if(caseApplication.getId()==null){
38
-            error("id不能为空");
39
-        }
40
-        return msSignSealService.sureMediationSeal(caseApplication);
41
-    }
29
+
42 30
 
43 31
     /**
44 32
      * 用印申请
@@ -151,55 +139,5 @@ public class MsSignSealController  extends BaseController {
151 139
         return msSignSealService.msCaseSignUrlApplyPC(dto);
152 140
     }
153 141
 
154
-    /**
155
-     * PC端被申请人签名
156
-     * @param dto
157
-     * @return
158
-     */
159
-    @PostMapping("/msCaseSignUrlResPC")
160
-    public AjaxResult msCaseSignUrlResPC(@RequestBody MsSignSealDTO dto) throws EsignDemoException {
161
-        if (dto.getCaseId() == null) {
162
-            return error("参数校验失败");
163
-        }
164
-        return msSignSealService.msCaseSignUrlResPC(dto);
165
-    }
166
-
167
-
168
-    /**
169
-     * 小程序端申请人签名
170
-     * @param dto
171
-     * @return
172
-     */
173
-    @PostMapping("/msCaseSignUrlApplyAPP")
174
-    public AjaxResult msCaseSignUrlApplyAPP(@RequestBody MsSignSealDTO dto) throws EsignDemoException {
175
-        if (dto.getCaseId() == null) {
176
-            return error("参数校验失败");
177
-        }
178
-        return msSignSealService.msCaseSignUrlApplyAPP(dto);
179
-    }
180
-
181
-    /**
182
-     * 小程序端被申请人签名
183
-     * @param dto
184
-     * @return
185
-     */
186
-    @PostMapping("/msCaseSignUrlResAPP")
187
-    public AjaxResult msCaseSignUrlResAPP(@RequestBody MsSignSealDTO dto) throws EsignDemoException {
188
-        if (dto.getCaseId() == null) {
189
-            return error("参数校验失败");
190
-        }
191
-        return msSignSealService.msCaseSignUrlResAPP(dto);
192
-    }
193
-
194
-
195
-
196
-
197
-
198
-
199
-
200
-
201
-
202
-
203
-
204 142
 
205 143
 }

+ 2
- 2
ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/mscase/MsVideoConferenceController.java Ver arquivo

@@ -106,9 +106,9 @@ public class MsVideoConferenceController extends BaseController {
106 106
      */
107 107
     @Anonymous
108 108
     @GetMapping("secretaryRoleByUserId")
109
-    public AjaxResult secretaryRoleByUserId(   @RequestParam(value = "userId",required = true) Long userId) {
109
+    public AjaxResult secretaryRoleByUserId(   @RequestParam(value = "userId",required = true) Long userId,@RequestParam(value = "caseId",required = true) Long caseId) {
110 110
 
111
-        return  videoService.secretaryRoleByUserId(userId);
111
+        return  videoService.secretaryRoleByUserId(userId,caseId);
112 112
     }
113 113
     /**
114 114
      * 根据html字符串转pdf并和案件关联

+ 17
- 0
ruoyi-common/src/main/java/com/ruoyi/common/constant/CacheConstants.java Ver arquivo

@@ -11,6 +11,11 @@ public class CacheConstants
11 11
      * 登录用户 redis key
12 12
      */
13 13
     public static final String LOGIN_TOKEN_KEY = "login_tokens:";
14
+    /**
15
+     * 登录用户名 redis key
16
+     */
17
+
18
+    public static final String LOGIN_USERNAME_TOKEN_KEY = "login_username_tokens:";
14 19
 
15 20
     /**
16 21
      * 验证码 redis key
@@ -50,4 +55,16 @@ public class CacheConstants
50 55
      * 所有用户 redis key
51 56
      */
52 57
     public static final String USER_KEY = "user_key:";
58
+    /**
59
+     * 用户邮箱 redis key
60
+     */
61
+    public static final String USER_EMAIL_KEY = "user_email_key:";
62
+    /**
63
+     * 角色 redis key
64
+     */
65
+    public static final String ROLE_KEY = "role_key:";
66
+    /**
67
+     * 部门 redis key
68
+     */
69
+    public static final String DEPT_KEY = "dept_key:";
53 70
 }

+ 3
- 0
ruoyi-common/src/main/java/com/ruoyi/common/constant/Constants.java Ver arquivo

@@ -141,7 +141,10 @@ public class Constants
141 141
      */
142 142
     public static final String LOOKUP_LDAPS = "ldaps:";
143 143
     public static final String DEFAULT_PASSWORD = "123456";
144
+    // 英文逗号分隔符
144 145
     public static final String SPLIT_COMMA =",";
146
+    // 中文逗号分隔符
147
+    public static final String CN_SPLIT_COMMA =",";
145 148
 
146 149
     /**
147 150
      * 自动识别json对象白名单配置(仅允许解析的包名,范围越小越安全)

+ 26
- 0
ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SMSNotice.java Ver arquivo

@@ -0,0 +1,26 @@
1
+package com.ruoyi.common.core.domain.entity;
2
+
3
+import lombok.AllArgsConstructor;
4
+import lombok.Data;
5
+import lombok.NoArgsConstructor;
6
+
7
+/**
8
+ * @Classname SMSNotice
9
+ * @Description 消息通知
10
+ * @Version 1.0.0
11
+ * @Date 2024/3/26 11:13
12
+ * @Created wangqiong
13
+ */
14
+@Data
15
+@NoArgsConstructor
16
+@AllArgsConstructor
17
+public class SMSNotice {
18
+    /**
19
+     * 申请人通知
20
+     */
21
+    private SMSNoticeDO applicantNotice;
22
+    /**
23
+     * 被申通知
24
+     */
25
+    private SMSNoticeDO resNotice;
26
+}

+ 34
- 0
ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SMSNoticeDO.java Ver arquivo

@@ -0,0 +1,34 @@
1
+package com.ruoyi.common.core.domain.entity;
2
+
3
+import lombok.AllArgsConstructor;
4
+import lombok.Data;
5
+import lombok.NoArgsConstructor;
6
+
7
+/**
8
+ * @Classname SMSNoticeDO
9
+ * @Description 消息通知实体
10
+ * @Version 1.0.0
11
+ * @Date 2024/3/26 11:10
12
+ * @Created wangqiong
13
+ */
14
+@Data
15
+@NoArgsConstructor
16
+@AllArgsConstructor
17
+public class SMSNoticeDO {
18
+    /**
19
+     * 主题
20
+     */
21
+    private String subject;
22
+    /**
23
+     * 发送内容
24
+     */
25
+    private String content;
26
+    /**
27
+     * 模板id
28
+     */
29
+    private String templateId;
30
+    /**
31
+     * 模板参数
32
+     */
33
+    private String[] templateParamSet;
34
+}

+ 31
- 5
ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysDept.java Ver arquivo

@@ -1,14 +1,15 @@
1 1
 package com.ruoyi.common.core.domain.entity;
2 2
 
3
-import java.util.ArrayList;
4
-import java.util.List;
3
+import com.ruoyi.common.core.domain.BaseEntity;
4
+import org.apache.commons.lang3.builder.ToStringBuilder;
5
+import org.apache.commons.lang3.builder.ToStringStyle;
6
+
5 7
 import javax.validation.constraints.Email;
6 8
 import javax.validation.constraints.NotBlank;
7 9
 import javax.validation.constraints.NotNull;
8 10
 import javax.validation.constraints.Size;
9
-import org.apache.commons.lang3.builder.ToStringBuilder;
10
-import org.apache.commons.lang3.builder.ToStringStyle;
11
-import com.ruoyi.common.core.domain.BaseEntity;
11
+import java.util.ArrayList;
12
+import java.util.List;
12 13
 
13 14
 /**
14 15
  * 部门表 sys_dept
@@ -54,6 +55,31 @@ public class SysDept extends BaseEntity
54 55
 
55 56
     /** 父部门名称 */
56 57
     private String parentName;
58
+    /**
59
+     * 代码(统一社会信用代码或者身份证号)
60
+     */
61
+    private String code;
62
+
63
+    /**
64
+     * 法定代表人
65
+     */
66
+    private String compLegalPerson;
67
+
68
+    public String getCode() {
69
+        return code;
70
+    }
71
+
72
+    public void setCode(String code) {
73
+        this.code = code;
74
+    }
75
+
76
+    public String getCompLegalPerson() {
77
+        return compLegalPerson;
78
+    }
79
+
80
+    public void setCompLegalPerson(String compLegalPerson) {
81
+        this.compLegalPerson = compLegalPerson;
82
+    }
57 83
 
58 84
     public Integer getDeptType() {
59 85
         return deptType;

+ 44
- 0
ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysUser.java Ver arquivo

@@ -69,6 +69,18 @@ public class SysUser extends BaseEntity
69 69
     /** 国籍,0-国内,1-国外,默认0 */
70 70
 
71 71
     private Integer nationality;
72
+    /**
73
+     * 生日
74
+     */
75
+    private Date birth;
76
+    /**
77
+     * 住所
78
+     */
79
+    private String home;
80
+    /**
81
+     * 联系地址
82
+     */
83
+    private String address;
72 84
 
73 85
     /** 用户邮箱 */
74 86
     @Excel(name = "用户邮箱")
@@ -140,6 +152,38 @@ public class SysUser extends BaseEntity
140 152
         this.userId = userId;
141 153
     }
142 154
 
155
+    public Date getBirth() {
156
+        return birth;
157
+    }
158
+
159
+    public void setBirth(Date birth) {
160
+        this.birth = birth;
161
+    }
162
+
163
+    public String getHome() {
164
+        return home;
165
+    }
166
+
167
+    public void setHome(String home) {
168
+        this.home = home;
169
+    }
170
+
171
+    public String getAddress() {
172
+        return address;
173
+    }
174
+
175
+    public void setAddress(String address) {
176
+        this.address = address;
177
+    }
178
+
179
+    public List<SysDept> getDepts() {
180
+        return depts;
181
+    }
182
+
183
+    public void setDepts(List<SysDept> depts) {
184
+        this.depts = depts;
185
+    }
186
+
143 187
     public Integer getIdType() {
144 188
         return idType;
145 189
     }

+ 18
- 0
ruoyi-common/src/main/java/com/ruoyi/common/enums/DocumentTypeEnum.java Ver arquivo

@@ -0,0 +1,18 @@
1
+package com.ruoyi.common.enums;
2
+
3
+import lombok.AllArgsConstructor;
4
+import lombok.Getter;
5
+
6
+@AllArgsConstructor
7
+@Getter
8
+public enum DocumentTypeEnum {
9
+    EVEDENT_METERIAL("EVEDENT_METERIAL", "证据材料", 1),
10
+    EVEDENT_APPLY_BOOK("EVEDENT_APPLY_BOOK", "调解申请书", 2),
11
+    EVEDENT_MEDIATION_VIDEO("EVEDENT_MEDIATION_VIDEO", "调解视频", 3),
12
+    EVEDENT_MEDIATION_RECORD("EVEDENT_MEDIATION_RECORD", "调解笔录", 4),
13
+    EVEDENT_AGREEMENT("EVEDENT_AGREEMENT", "调解书或和解协议", 5),
14
+    ;
15
+    private String code;
16
+    private String name;
17
+    private Integer value;
18
+}

+ 25
- 11
ruoyi-common/src/main/java/com/ruoyi/common/utils/EmailOutUtil.java Ver arquivo

@@ -1,10 +1,12 @@
1 1
 package com.ruoyi.common.utils;
2 2
 
3 3
 
4
+import cn.hutool.core.util.StrUtil;
4 5
 import com.ruoyi.common.utils.uuid.UUID;
5 6
 import lombok.Data;
6 7
 import lombok.extern.slf4j.Slf4j;
7 8
 import org.springframework.beans.factory.annotation.Value;
9
+import org.springframework.mail.MailException;
8 10
 import org.springframework.mail.SimpleMailMessage;
9 11
 import org.springframework.mail.javamail.JavaMailSender;
10 12
 import org.springframework.mail.javamail.JavaMailSenderImpl;
@@ -72,17 +74,29 @@ public class EmailOutUtil {
72 74
      * @param subject 邮件主题
73 75
      * @param content 邮件内容(发送内容)
74 76
      */
75
-    public void sendMessage(String to, String subject, String content, String from, JavaMailSender mailSender) {
76
-        // 创建一个邮件对象
77
-        SimpleMailMessage msg = new SimpleMailMessage();
78
-        msg.setFrom(from);
79
-        msg.setTo(to);
80
-        // 设置邮件主题
81
-        msg.setSubject(subject);
82
-        // 设置邮件内容
83
-        msg.setText(content);
84
-        // 发送邮件
85
-        mailSender.send(msg);
77
+    public Boolean sendMessage(String to, String subject, String content, String from, JavaMailSender mailSender) {
78
+        try {
79
+            if(mailSender==null){
80
+                rebuildMailSender();
81
+            }
82
+            // 创建一个邮件对象
83
+            SimpleMailMessage msg = new SimpleMailMessage();
84
+            if(StrUtil.isEmpty(from)){
85
+                msg.setFrom(usernameOut);
86
+            }else {
87
+                msg.setFrom(from);
88
+            }
89
+            msg.setTo(to);
90
+            // 设置邮件主题
91
+            msg.setSubject(subject);
92
+            // 设置邮件内容
93
+            msg.setText(content);
94
+            // 发送邮件
95
+            mailSender.send(msg);
96
+        } catch (MailException e) {
97
+            return false;
98
+        }
99
+        return true;
86 100
         ////System.out.println("发送成功:" + from + ":to:" + to);
87 101
     }
88 102
 

+ 25
- 3
ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/SysLoginService.java Ver arquivo

@@ -1,5 +1,6 @@
1 1
 package com.ruoyi.framework.web.service;
2 2
 
3
+import cn.hutool.core.util.ObjectUtil;
3 4
 import cn.hutool.crypto.digest.MD5;
4 5
 import com.ruoyi.common.constant.CacheConstants;
5 6
 import com.ruoyi.common.constant.Constants;
@@ -237,9 +238,8 @@ public class SysLoginService
237 238
             user.setUserName(username);
238 239
             user.setPassword(SecurityUtils.encryptPassword("abc123456"));
239 240
             user.setNickName(username);
240
-            // 代理人角色相当于申请人角色
241
-            if(loginBody.getRoleName().contains("代理人")){
242
-                loginBody.setRoleName("申请人");
241
+            if(username.contains("@")){
242
+                user.setEmail(username);
243 243
             }
244 244
             // 根据角色名查询角色id
245 245
             Long roleIdByName = roleMapper.selectRoleIdByName(loginBody.getRoleName());
@@ -258,4 +258,26 @@ public class SysLoginService
258 258
         ajax.put(Constants.TOKEN, token);
259 259
         return ajax;
260 260
     }
261
+
262
+    /**
263
+     * 对接BM,根据用户名查询token
264
+     * @param loginBody
265
+     * @return
266
+     */
267
+    public AjaxResult selectTokenByUserName(LoginBody loginBody) {
268
+        String username = loginBody.getUsername();
269
+        String currentTicket = MD5.create().digestHex("BM" + username);
270
+        if(!currentTicket.equals(loginBody.getTicket())){
271
+            return AjaxResult.error("ticket校验失败");
272
+        }
273
+
274
+        Object cacheObject = redisCache.getCacheObject(CacheConstants.LOGIN_USERNAME_TOKEN_KEY + username);
275
+        if(ObjectUtil.isEmpty(cacheObject)){
276
+            return AjaxResult.error("登录时间过长,请重新登录");
277
+        }
278
+
279
+        AjaxResult result = AjaxResult.success();
280
+        result.put("token",(String) cacheObject);
281
+        return result;
282
+    }
261 283
 }

+ 4
- 1
ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/TokenService.java Ver arquivo

@@ -123,7 +123,9 @@ public class TokenService
123 123
         claims.put("userName",loginUser.getUsername());
124 124
         claims.put("userId",loginUser.getUserId());
125 125
         claims.put(Constants.LOGIN_USER_KEY, token);
126
-        return createToken(claims);
126
+        String createToken = createToken(claims);
127
+        redisCache.setCacheObject(CacheConstants.LOGIN_USERNAME_TOKEN_KEY+loginUser.getUsername(),createToken, expireTime, TimeUnit.MINUTES);
128
+        return createToken;
127 129
     }
128 130
 
129 131
     /**
@@ -154,6 +156,7 @@ public class TokenService
154 156
         // 根据uuid将loginUser缓存
155 157
         String userKey = getTokenKey(loginUser.getToken());
156 158
         redisCache.setCacheObject(userKey, loginUser, expireTime, TimeUnit.MINUTES);
159
+
157 160
     }
158 161
 
159 162
     /**

+ 55
- 0
ruoyi-system/src/main/java/com/ruoyi/system/domain/entity/log/MsRequestLog.java Ver arquivo

@@ -0,0 +1,55 @@
1
+package com.ruoyi.system.domain.entity.log;
2
+
3
+import lombok.Getter;
4
+import lombok.Setter;
5
+import lombok.ToString;
6
+
7
+import javax.persistence.Column;
8
+import javax.persistence.GeneratedValue;
9
+import javax.persistence.Id;
10
+import javax.persistence.Table;
11
+import java.util.Date;
12
+
13
+@Getter
14
+@Setter
15
+@ToString
16
+@Table(name = "ms_request_log")
17
+public class MsRequestLog {
18
+    @Id
19
+    @GeneratedValue(generator = "JDBC")
20
+    private Long id;
21
+
22
+    /**
23
+     * 状态,0-成功,1-失败
24
+     */
25
+    private Integer status;
26
+
27
+    /**
28
+     * 创建时间
29
+     */
30
+    @Column(name = "create_time")
31
+    private Date createTime;
32
+
33
+    /**
34
+     * 请求url
35
+     */
36
+    @Column(name = "request_url")
37
+    private String requestUrl;
38
+
39
+    /**
40
+     * 请求内容
41
+     */
42
+    @Column(name = "content")
43
+    private String content;
44
+
45
+    /**
46
+     * 失败原因
47
+     */
48
+    @Column(name = "reason")
49
+    private String reason;
50
+    /**
51
+     * 返回内容
52
+     */
53
+    @Column(name = "return_content")
54
+    private String returnContent;
55
+}

+ 6
- 6
ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysUserMapper.java Ver arquivo

@@ -1,9 +1,9 @@
1 1
 package com.ruoyi.system.mapper;
2 2
 
3
-import java.util.List;
4
-
5
-import org.apache.ibatis.annotations.Param;
6 3
 import com.ruoyi.common.core.domain.entity.SysUser;
4
+import org.apache.ibatis.annotations.Param;
5
+
6
+import java.util.List;
7 7
 
8 8
 /**
9 9
  * 用户表 数据层
@@ -144,11 +144,11 @@ public interface SysUserMapper
144 144
      */
145 145
     SysUser selectUserByIdCard(@Param("idCard")String identityNo);
146 146
     /**
147
-     * 根据手机号查询用户信息
148
-     * @param phone
147
+     * 根据邮箱查询用户信息
148
+     * @param email
149 149
      * @return
150 150
      */
151
-    SysUser selectUserByPhone(@Param("phone")String phone);
151
+    SysUser selectUserByEmail(@Param("email")String email);
152 152
 
153 153
     /**
154 154
      * 根据部门和角色查询用户

+ 7
- 0
ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysUserRoleMapper.java Ver arquivo

@@ -67,4 +67,11 @@ public interface SysUserRoleMapper
67 67
      * @param roleId
68 68
      */
69 69
     void insertUserRole(@Param("userId")Long userId, @Param("roleId")Long roleId);
70
+
71
+    /**
72
+     * 根据用户id查询关联的角色id
73
+     * @param userId
74
+     * @return
75
+     */
76
+    public List<Long> selectRoleIdsByUserId(@Param("userId") Long userId);
70 77
 }

+ 7
- 0
ruoyi-system/src/main/java/com/ruoyi/system/mapper/log/MsRequestLogMapper.java Ver arquivo

@@ -0,0 +1,7 @@
1
+package com.ruoyi.system.mapper.log;
2
+
3
+import com.ruoyi.system.domain.entity.log.MsRequestLog;
4
+import tk.mybatis.mapper.common.Mapper;
5
+
6
+public interface MsRequestLogMapper extends Mapper<MsRequestLog> {
7
+}

+ 11
- 6
ruoyi-system/src/main/java/com/ruoyi/system/service/BeiMingInterface.java Ver arquivo

@@ -1,18 +1,15 @@
1 1
 package com.ruoyi.system.service;
2 2
 
3 3
 import com.alibaba.fastjson.JSONObject;
4
-import com.ruoyi.wisdomarbitrate.domain.entity.casestatus.MsCaseStatus;
4
+import com.ruoyi.common.enums.AttachmentOperateTypeEnum;
5 5
 import com.ruoyi.wisdomarbitrate.domain.vo.mscase.MsCaseFileInfo;
6 6
 import com.ruoyi.wisdomarbitrate.domain.vo.mscase.MsCaseStatusInfo;
7
-import org.apache.ibatis.annotations.Case;
8
-import org.apache.poi.hmef.Attachment;
9
-import org.springframework.web.multipart.MultipartFile;
10 7
 
11 8
 import java.io.File;
12 9
 
13 10
 public interface BeiMingInterface {
14 11
     /**
15
-     * 1.获取北明接口令牌token
12
+     * 1.获取北明接口令牌token对象
16 13
      *
17 14
      * @param userName
18 15
      * @param password
@@ -73,5 +70,13 @@ public interface BeiMingInterface {
73 70
      * @param caseNo     案件编号
74 71
      * @return
75 72
      */
76
-    JSONObject pushAttachmentInfo(String username, String password, File file, String abutmentId, String syncSource, String caseNo);
73
+    MsCaseFileInfo pushAttachmentInfo(String username, String password, File file, String syncSource, String caseNo, AttachmentOperateTypeEnum operateTypeEnum);
74
+
75
+    /**
76
+     * 删除附件
77
+     * @param file
78
+     * @param caseNo
79
+     * @return
80
+     */
81
+    public JSONObject deleteAttachmentInfo( String caseNo,String fileId,String fileName);
77 82
 }

+ 14
- 0
ruoyi-system/src/main/java/com/ruoyi/system/service/MsRequestLogService.java Ver arquivo

@@ -0,0 +1,14 @@
1
+package com.ruoyi.system.service;
2
+
3
+import com.ruoyi.system.domain.entity.log.MsRequestLog;
4
+
5
+/**
6
+ * @Classname MsRequestLogService
7
+ * @Description TODO
8
+ * @Version 1.0.0
9
+ * @Date 2024/4/2 14:18
10
+ * @Created wangqiong
11
+ */
12
+public interface MsRequestLogService {
13
+    void insert(MsRequestLog requestLog);
14
+}

+ 88
- 14
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/BeiMingInterfaceService.java Ver arquivo

@@ -5,7 +5,10 @@ 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.exception.ServiceException;
9
+import com.ruoyi.system.domain.entity.log.MsRequestLog;
8 10
 import com.ruoyi.system.service.BeiMingInterface;
11
+import com.ruoyi.system.service.MsRequestLogService;
9 12
 import com.ruoyi.wisdomarbitrate.domain.vo.mscase.MsCaseFileInfo;
10 13
 import com.ruoyi.wisdomarbitrate.domain.vo.mscase.MsCaseStatusInfo;
11 14
 import com.ruoyi.wisdomarbitrate.utils.CommonInputStreamResource;
@@ -15,6 +18,7 @@ import org.springframework.beans.factory.annotation.Value;
15 18
 import org.springframework.http.HttpEntity;
16 19
 import org.springframework.http.HttpHeaders;
17 20
 import org.springframework.stereotype.Service;
21
+import org.springframework.transaction.annotation.Transactional;
18 22
 import org.springframework.util.LinkedMultiValueMap;
19 23
 import org.springframework.util.MultiValueMap;
20 24
 import org.springframework.web.client.RestClientException;
@@ -22,6 +26,8 @@ import org.springframework.web.client.RestTemplate;
22 26
 
23 27
 import java.io.File;
24 28
 import java.io.FileInputStream;
29
+import java.util.Date;
30
+import java.util.Objects;
25 31
 
26 32
 import static com.ruoyi.common.utils.EncryptUtils.sm4Decrypt;
27 33
 import static com.ruoyi.common.utils.EncryptUtils.sm4Encrypt;
@@ -34,6 +40,10 @@ import static com.ruoyi.common.utils.EncryptUtils.sm4Encrypt;
34 40
 public class BeiMingInterfaceService implements BeiMingInterface {
35 41
     @Autowired
36 42
     RestTemplate restTemplate;
43
+    @Autowired
44
+    MsRequestLogService requestLogService;
45
+    @Autowired
46
+    BeiMingInterfaceService beiMingInterfaceService;
37 47
     /**
38 48
      * 接口地址
39 49
      */
@@ -46,6 +56,13 @@ public class BeiMingInterfaceService implements BeiMingInterface {
46 56
     public String apiprefix;
47 57
     @Value("${beimingprivatekey}")
48 58
     public String privateKey;
59
+    // 北明配置
60
+    @Value("${BMConfig.userName}")
61
+    private String BMUserName;
62
+    @Value("${BMConfig.password}")
63
+    private String BMPassword;
64
+    @Value("${BMConfig.syncSource}")
65
+    private String BMSyncSource;
49 66
 
50 67
     /**
51 68
      * 1.获取北明接口令牌token
@@ -54,9 +71,11 @@ public class BeiMingInterfaceService implements BeiMingInterface {
54 71
      * @param password
55 72
      * @param times
56 73
      */
74
+    @Transactional
57 75
     @Override
58 76
     public String getApiToken(String userName, String password, Long times) {
59 77
         JSONObject result = new JSONObject();
78
+        MsRequestLog requestLog = new MsRequestLog();
60 79
         try {
61 80
             //设置请求头
62 81
             HttpHeaders httpHeaders = new HttpHeaders();
@@ -79,13 +98,25 @@ public class BeiMingInterfaceService implements BeiMingInterface {
79 98
             System.out.println("encryptString:" + encryptString);
80 99
             fromEntity = new HttpEntity(body, httpHeaders);
81 100
             String url = apihost + apiprefix + "/getToken";
101
+
102
+            requestLog.setRequestUrl(url);
103
+            requestLog.setContent(param.toString());
104
+            requestLog.setCreateTime((new Date()));
105
+            requestLog.setStatus(0);
82 106
             result = restTemplate.postForObject(url, fromEntity, JSONObject.class);
107
+            requestLog.setReturnContent(result!=null?result.toString():null);
83 108
         } catch (RestClientException e) {
84 109
             e.printStackTrace();
110
+            requestLog.setReason(e.getMessage());
111
+            requestLog.setStatus(1);
112
+            requestLogService.insert(requestLog);
113
+            throw new ServiceException("推送失败");
85 114
         }
86
-        return result.toString();
115
+        requestLogService.insert(requestLog);
116
+        return analysisResultToken(Objects.requireNonNull(result).toString());
87 117
     }
88 118
 
119
+
89 120
     /**
90 121
      * 解析加密后端token
91 122
      *
@@ -97,9 +128,7 @@ public class BeiMingInterfaceService implements BeiMingInterface {
97 128
         if (token != null && !token.isEmpty()) {
98 129
             JSONObject jsonObject = JSON.parseObject(token);
99 130
             String tokenString = jsonObject.getString("data");
100
-            System.out.println("data信息:" + tokenString);
101 131
             String tokenstr = sm4Decrypt(tokenString, privateKey);
102
-            System.out.println("解密后的字符串:" + tokenstr);
103 132
             if (tokenstr != null && !tokenstr.isEmpty()) {
104 133
                 JSONObject tokenObject = JSON.parseObject(tokenstr);
105 134
                 resultToken = tokenObject.getString("token");
@@ -117,9 +146,11 @@ public class BeiMingInterfaceService implements BeiMingInterface {
117 146
      * @param syncSource       同步来源(账户名)
118 147
      * @return
119 148
      */
149
+    @Transactional
120 150
     @Override
121 151
     public JSONObject submitCaseStatusInfo(String token, String abutmentId, String syncSource, MsCaseStatusInfo msCaseStatusInfo) {
122 152
         JSONObject result = new JSONObject();
153
+        MsRequestLog requestLog = new MsRequestLog();
123 154
         try {
124 155
             //设置请求头
125 156
             HttpHeaders httpHeaders = new HttpHeaders();
@@ -146,10 +177,20 @@ public class BeiMingInterfaceService implements BeiMingInterface {
146 177
             fromEntity = new HttpEntity(body, httpHeaders);
147 178
 
148 179
             String url = apihost + apiprefix + "/caseMediation/status";
180
+            requestLog.setRequestUrl(url);
181
+            requestLog.setContent(param.toString());
182
+            requestLog.setCreateTime((new Date()));
183
+            requestLog.setStatus(0);
149 184
             result = restTemplate.postForObject(url, fromEntity, JSONObject.class);
185
+            requestLog.setReturnContent(result!=null?result.toString():null);
150 186
         } catch (RestClientException e) {
151 187
             e.printStackTrace();
188
+            requestLog.setReason(e.getMessage());
189
+            requestLog.setStatus(1);
190
+            requestLogService.insert(requestLog);
191
+            throw new ServiceException("推送失败");
152 192
         }
193
+        requestLogService.insert(requestLog);
153 194
         return result;
154 195
 
155 196
     }
@@ -160,11 +201,13 @@ public class BeiMingInterfaceService implements BeiMingInterface {
160 201
      * @param file
161 202
      * @return
162 203
      */
204
+    @Transactional
163 205
     @Override
164 206
     public JSONObject uploadFile(File file, String token, String syncSource) {
165 207
         System.out.println("文件:" + file.getName());
166 208
         System.out.println("文件:" + file.toString());
167 209
         JSONObject result = new JSONObject();
210
+        MsRequestLog requestLog = new MsRequestLog();
168 211
         try {
169 212
             //设置请求头
170 213
             HttpHeaders httpHeaders = new HttpHeaders();
@@ -184,10 +227,20 @@ public class BeiMingInterfaceService implements BeiMingInterface {
184 227
             requestBody.add("file", commonInputStreamResource);
185 228
             HttpEntity<MultiValueMap> fromEntity = new HttpEntity<MultiValueMap>(requestBody, httpHeaders);
186 229
             String url = apihost + apiprefix + "/uploadFile";
230
+            requestLog.setRequestUrl(url);
231
+            requestLog.setContent(fromEntity.toString());
232
+            requestLog.setCreateTime((new Date()));
233
+            requestLog.setStatus(0);
187 234
             result = restTemplate.postForObject(url, fromEntity, JSONObject.class);
235
+            requestLog.setReturnContent(result!=null?result.toString():null);
188 236
         } catch (RestClientException e) {
189 237
             e.printStackTrace();
238
+            requestLog.setReason(e.getMessage());
239
+            requestLog.setStatus(1);
240
+            requestLogService.insert(requestLog);
241
+            throw new ServiceException("推送失败");
190 242
         }
243
+        requestLogService.insert(requestLog);
191 244
         return result;
192 245
     }
193 246
 
@@ -201,9 +254,11 @@ public class BeiMingInterfaceService implements BeiMingInterface {
201 254
      * @param msCaseFileInfo 案件附件信息
202 255
      * @return
203 256
      */
257
+    @Transactional
204 258
     @Override
205 259
     public JSONObject syncAttachmentInfo(String token, String syncSource, String action, String caseNo, MsCaseFileInfo msCaseFileInfo) {
206 260
         JSONObject result = new JSONObject();
261
+        MsRequestLog requestLog = new MsRequestLog();
207 262
         try {
208 263
             //设置请求头
209 264
             HttpHeaders httpHeaders = new HttpHeaders();
@@ -238,21 +293,31 @@ public class BeiMingInterfaceService implements BeiMingInterface {
238 293
             body.put("encryptString", encryptString);
239 294
             fromEntity = new HttpEntity(body, httpHeaders);
240 295
             String url = apihost + apiprefix + "/caseMediation/attachment/accept";
296
+            requestLog.setRequestUrl(url);
297
+            requestLog.setContent(param.toString());
298
+            requestLog.setCreateTime((new Date()));
299
+            requestLog.setStatus(0);
241 300
             result = restTemplate.postForObject(url, fromEntity, JSONObject.class);
301
+            requestLog.setReturnContent(result!=null?result.toString():null);
242 302
         } catch (RestClientException e) {
243 303
             e.printStackTrace();
304
+            requestLog.setReason(e.getMessage());
305
+            requestLog.setStatus(1);
306
+            requestLogService.insert(requestLog);
307
+            throw new ServiceException("推送失败");
244 308
         }
309
+        requestLogService.insert(requestLog);
245 310
         return result;
246 311
     }
247 312
 
248 313
     /**
249 314
      * 推送案件状态信息
250 315
      */
316
+    @Transactional
251 317
     @Override
252 318
     public JSONObject pushCaseStatusInfo(String username, String password, String caseNo, String statusCode, String caseClosureExplanation) {
253 319
         JSONObject result = new JSONObject();
254
-        String token = getApiToken(username, password, System.currentTimeMillis());
255
-        token = analysisResultToken(token);
320
+        String token = beiMingInterfaceService.getApiToken(username, password, System.currentTimeMillis());
256 321
         if (token != null && !token.isEmpty()) {
257 322
             MsCaseStatusInfo info = MsCaseStatusInfo.builder().caseNo(caseNo).statusCode(statusCode).caseClosureExplanation(caseClosureExplanation).build();
258 323
             result = submitCaseStatusInfo(token, caseNo, username, info);
@@ -265,16 +330,16 @@ public class BeiMingInterfaceService implements BeiMingInterface {
265 330
         }
266 331
         return result;
267 332
     }
268
-
269 333
     /**
270 334
      * 推送案件附件信息
271 335
      */
336
+    @Transactional
272 337
     @Override
273
-    public JSONObject pushAttachmentInfo(String username, String password, File file, String abutmentId, String syncSource, String caseNo) {
338
+    public MsCaseFileInfo pushAttachmentInfo(String username, String password, File file,  String syncSource, String caseNo,AttachmentOperateTypeEnum operateTypeEnum) {
274 339
         JSONObject result = new JSONObject();
340
+        MsCaseFileInfo fileInfo=null;
275 341
         //1.获取token
276
-        String token = getApiToken(username, password, System.currentTimeMillis());
277
-        token = analysisResultToken(token);
342
+        String token = beiMingInterfaceService.getApiToken(username, password, System.currentTimeMillis());
278 343
         if (token != null && !token.isEmpty()) {
279 344
             //2.上传文件
280 345
             JSONObject fileResult = uploadFile(file, token, syncSource);
@@ -289,16 +354,25 @@ public class BeiMingInterfaceService implements BeiMingInterface {
289 354
                         System.out.println("fileId====:" + fileId);
290 355
                         if (fileId != null) {
291 356
                             //3.同步附件更新信息
292
-                            MsCaseFileInfo fileInfo = MsCaseFileInfo.builder().fileId(fileId).fileName(file.getName()).abutmentId(abutmentId).abutmentCaseId(caseNo).documentSubject("EVEDENT").documentType("EVEDENT_METERIAL").build();
293
-                            result = syncAttachmentInfo(token, username, AttachmentOperateTypeEnum.ADD.getCode(), caseNo, fileInfo);
294
-                            result = syncAttachmentInfo(token, username, AttachmentOperateTypeEnum.UPD.getCode(), caseNo, fileInfo);
295
-                            result = syncAttachmentInfo(token, username, AttachmentOperateTypeEnum.DEL.getCode(), caseNo, fileInfo);
357
+                             fileInfo = MsCaseFileInfo.builder().fileId(fileId).fileName(file.getName()).abutmentId(fileId).abutmentCaseId(caseNo).documentSubject("EVEDENT").documentType("EVEDENT_METERIAL").build();
358
+                            result = syncAttachmentInfo(token, username, operateTypeEnum.getCode(), caseNo, fileInfo);
359
+                            // 更新到附件表将fileId
360
+//                            result = syncAttachmentInfo(token, username, AttachmentOperateTypeEnum.UPD.getCode(), caseNo, fileInfo);
361
+//                            result = syncAttachmentInfo(token, username, AttachmentOperateTypeEnum.DEL.getCode(), caseNo, fileInfo);
296 362
                         }
297 363
                     }
298 364
                 }
299 365
             }
300 366
         }
301
-        return result;
367
+        return fileInfo;
368
+    }
369
+
370
+    @Override
371
+    public JSONObject deleteAttachmentInfo( String caseNo,String fileId,String fileName) {
372
+        String token = beiMingInterfaceService.getApiToken(BMUserName, BMPassword, System.currentTimeMillis());
373
+        MsCaseFileInfo fileInfo = MsCaseFileInfo.builder().fileId(fileId).fileName(fileName).abutmentId(fileId).abutmentCaseId(caseNo).documentSubject("EVEDENT").documentType("EVEDENT_METERIAL").build();
374
+
375
+        return  syncAttachmentInfo(token, BMUserName, AttachmentOperateTypeEnum.DEL.getCode(), caseNo, fileInfo);
302 376
     }
303 377
 
304 378
     /**

+ 24
- 0
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/MsRequestLogServiceImpl.java Ver arquivo

@@ -0,0 +1,24 @@
1
+package com.ruoyi.system.service.impl;
2
+
3
+import com.ruoyi.system.domain.entity.log.MsRequestLog;
4
+import com.ruoyi.system.mapper.log.MsRequestLogMapper;
5
+import com.ruoyi.system.service.MsRequestLogService;
6
+import org.springframework.beans.factory.annotation.Autowired;
7
+import org.springframework.stereotype.Service;
8
+
9
+/**
10
+ * @Classname MsRequestLogServiceImpl
11
+ * @Description TODO
12
+ * @Version 1.0.0
13
+ * @Date 2024/4/2 14:19
14
+ * @Created wangqiong
15
+ */
16
+@Service
17
+public class MsRequestLogServiceImpl implements MsRequestLogService {
18
+    @Autowired
19
+    private MsRequestLogMapper logMapper;
20
+    @Override
21
+    public void insert(MsRequestLog requestLog) {
22
+        logMapper.insert(requestLog);
23
+    }
24
+}

+ 21
- 7
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDeptServiceImpl.java Ver arquivo

@@ -1,17 +1,13 @@
1 1
 package com.ruoyi.system.service.impl;
2 2
 
3
-import java.util.ArrayList;
4
-import java.util.Iterator;
5
-import java.util.List;
6
-import java.util.stream.Collectors;
7
-import org.springframework.beans.factory.annotation.Autowired;
8
-import org.springframework.stereotype.Service;
9 3
 import com.ruoyi.common.annotation.DataScope;
4
+import com.ruoyi.common.constant.CacheConstants;
10 5
 import com.ruoyi.common.constant.UserConstants;
11 6
 import com.ruoyi.common.core.domain.TreeSelect;
12 7
 import com.ruoyi.common.core.domain.entity.SysDept;
13 8
 import com.ruoyi.common.core.domain.entity.SysRole;
14 9
 import com.ruoyi.common.core.domain.entity.SysUser;
10
+import com.ruoyi.common.core.redis.RedisCache;
15 11
 import com.ruoyi.common.core.text.Convert;
16 12
 import com.ruoyi.common.exception.ServiceException;
17 13
 import com.ruoyi.common.utils.SecurityUtils;
@@ -20,6 +16,13 @@ import com.ruoyi.common.utils.spring.SpringUtils;
20 16
 import com.ruoyi.system.mapper.SysDeptMapper;
21 17
 import com.ruoyi.system.mapper.SysRoleMapper;
22 18
 import com.ruoyi.system.service.ISysDeptService;
19
+import org.springframework.beans.factory.annotation.Autowired;
20
+import org.springframework.stereotype.Service;
21
+
22
+import java.util.ArrayList;
23
+import java.util.Iterator;
24
+import java.util.List;
25
+import java.util.stream.Collectors;
23 26
 
24 27
 /**
25 28
  * 部门管理 服务实现
@@ -34,6 +37,8 @@ public class SysDeptServiceImpl implements ISysDeptService
34 37
 
35 38
     @Autowired
36 39
     private SysRoleMapper roleMapper;
40
+    @Autowired
41
+    private RedisCache redisCache;
37 42
 
38 43
     /**
39 44
      * 查询部门管理数据
@@ -221,7 +226,9 @@ public class SysDeptServiceImpl implements ISysDeptService
221 226
             }
222 227
             dept.setAncestors(info.getAncestors() + "," + dept.getParentId());
223 228
         }
224
-        return deptMapper.insertDept(dept);
229
+        int i = deptMapper.insertDept(dept);
230
+        redisCache.setCacheObject(CacheConstants.DEPT_KEY+dept.getDeptName(),dept.getDeptId());
231
+        return i;
225 232
     }
226 233
 
227 234
     /**
@@ -249,6 +256,8 @@ public class SysDeptServiceImpl implements ISysDeptService
249 256
             // 如果该部门是启用状态,则启用该部门的所有上级部门
250 257
             updateParentDeptStatusNormal(dept);
251 258
         }
259
+        // 修改缓存
260
+        redisCache.setCacheObject(CacheConstants.DEPT_KEY+dept.getDeptName(),dept.getDeptId());
252 261
         return result;
253 262
     }
254 263
 
@@ -293,6 +302,11 @@ public class SysDeptServiceImpl implements ISysDeptService
293 302
     @Override
294 303
     public int deleteDeptById(Long deptId)
295 304
     {
305
+        SysDept sysDept = deptMapper.selectDeptById(deptId);
306
+        if(sysDept!=null) {
307
+            // 删除缓存
308
+            redisCache.deleteObject(CacheConstants.DEPT_KEY + sysDept.getDeptName());
309
+        }
296 310
         return deptMapper.deleteDeptById(deptId);
297 311
     }
298 312
 

+ 26
- 8
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysRoleServiceImpl.java Ver arquivo

@@ -1,17 +1,12 @@
1 1
 package com.ruoyi.system.service.impl;
2 2
 
3
-import java.util.ArrayList;
4
-import java.util.Arrays;
5
-import java.util.HashSet;
6
-import java.util.List;
7
-import java.util.Set;
8
-import org.springframework.beans.factory.annotation.Autowired;
9
-import org.springframework.stereotype.Service;
10
-import org.springframework.transaction.annotation.Transactional;
3
+import cn.hutool.core.collection.CollectionUtil;
11 4
 import com.ruoyi.common.annotation.DataScope;
5
+import com.ruoyi.common.constant.CacheConstants;
12 6
 import com.ruoyi.common.constant.UserConstants;
13 7
 import com.ruoyi.common.core.domain.entity.SysRole;
14 8
 import com.ruoyi.common.core.domain.entity.SysUser;
9
+import com.ruoyi.common.core.redis.RedisCache;
15 10
 import com.ruoyi.common.exception.ServiceException;
16 11
 import com.ruoyi.common.utils.SecurityUtils;
17 12
 import com.ruoyi.common.utils.StringUtils;
@@ -24,6 +19,12 @@ import com.ruoyi.system.mapper.SysRoleMapper;
24 19
 import com.ruoyi.system.mapper.SysRoleMenuMapper;
25 20
 import com.ruoyi.system.mapper.SysUserRoleMapper;
26 21
 import com.ruoyi.system.service.ISysRoleService;
22
+import org.springframework.beans.factory.annotation.Autowired;
23
+import org.springframework.stereotype.Service;
24
+import org.springframework.transaction.annotation.Transactional;
25
+
26
+import java.util.*;
27
+import java.util.stream.Collectors;
27 28
 
28 29
 /**
29 30
  * 角色 业务层处理
@@ -44,6 +45,8 @@ public class SysRoleServiceImpl implements ISysRoleService
44 45
 
45 46
     @Autowired
46 47
     private SysRoleDeptMapper roleDeptMapper;
48
+    @Autowired
49
+    private RedisCache redisCache;
47 50
 
48 51
     /**
49 52
      * 根据条件分页查询角色数据
@@ -233,6 +236,7 @@ public class SysRoleServiceImpl implements ISysRoleService
233 236
     {
234 237
         // 新增角色信息
235 238
         roleMapper.insertRole(role);
239
+        redisCache.setCacheObject(CacheConstants.ROLE_KEY+role.getRoleName(),role.getRoleId());
236 240
         return insertRoleMenu(role);
237 241
     }
238 242
 
@@ -250,6 +254,7 @@ public class SysRoleServiceImpl implements ISysRoleService
250 254
         roleMapper.updateRole(role);
251 255
         // 删除角色与菜单关联
252 256
         roleMenuMapper.deleteRoleMenuByRoleId(role.getRoleId());
257
+        redisCache.setCacheObject(CacheConstants.ROLE_KEY+role.getRoleName(),role.getRoleId());
253 258
         return insertRoleMenu(role);
254 259
     }
255 260
 
@@ -341,10 +346,15 @@ public class SysRoleServiceImpl implements ISysRoleService
341 346
     @Transactional
342 347
     public int deleteRoleById(Long roleId)
343 348
     {
349
+        // 根据角色id查询角色名
350
+        SysRole role = roleMapper.selectRoleById(roleId);
344 351
         // 删除角色与菜单关联
345 352
         roleMenuMapper.deleteRoleMenuByRoleId(roleId);
346 353
         // 删除角色与部门关联
347 354
         roleDeptMapper.deleteRoleDeptByRoleId(roleId);
355
+        if(role!=null) {
356
+            redisCache.deleteObject(CacheConstants.ROLE_KEY + role.getRoleName());
357
+        }
348 358
         return roleMapper.deleteRoleById(roleId);
349 359
     }
350 360
 
@@ -358,6 +368,11 @@ public class SysRoleServiceImpl implements ISysRoleService
358 368
     @Transactional
359 369
     public int deleteRoleByIds(Long[] roleIds)
360 370
     {
371
+        List<SysRole> roles = roleMapper.selectRoleList(new SysRole());
372
+        if(CollectionUtil.isEmpty(roles)){
373
+            return 0;
374
+        }
375
+        Map<Long, String> roleMap = roles.stream().collect(Collectors.toMap(SysRole::getRoleId, SysRole::getRoleName, (n1, n2) -> n2));
361 376
         for (Long roleId : roleIds)
362 377
         {
363 378
             checkRoleAllowed(new SysRole(roleId));
@@ -367,6 +382,9 @@ public class SysRoleServiceImpl implements ISysRoleService
367 382
             {
368 383
                 throw new ServiceException(String.format("%1$s已分配,不能删除", role.getRoleName()));
369 384
             }
385
+            if(roleMap.containsKey(roleId)) {
386
+                redisCache.deleteObject(CacheConstants.ROLE_KEY + roleMap.get(roleId));
387
+            }
370 388
         }
371 389
         // 删除角色与菜单关联
372 390
         roleMenuMapper.deleteRoleMenu(roleIds);

+ 67
- 99
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/entity/mscase/MsCaseAffiliate.java Ver arquivo

@@ -1,5 +1,6 @@
1 1
 package com.ruoyi.wisdomarbitrate.domain.entity.mscase;
2 2
 
3
+import com.fasterxml.jackson.annotation.JsonFormat;
3 4
 import lombok.Getter;
4 5
 import lombok.Setter;
5 6
 import lombok.ToString;
@@ -7,161 +8,128 @@ import lombok.ToString;
7 8
 import javax.persistence.Column;
8 9
 import javax.persistence.Id;
9 10
 import javax.persistence.Table;
11
+import javax.persistence.Transient;
10 12
 import java.util.Date;
11 13
 
12 14
 @Getter
13 15
 @Setter
14 16
 @ToString
15 17
 @Table(name = "ms_case_affiliate")
16
-public class MsCaseAffiliate {
18
+public class MsCaseAffiliate{
17 19
     /**
18
-     * 案件主表id,案件申请表主键
20
+     * id
19 21
      */
20 22
     @Id
21
-    @Column(name = "case_appli_id")
22
-    private Long caseAppliId;
23
+    @Column(name = "id")
24
+    private Long id;
23 25
     /**
24
-     * 是否机构申请,0-自然人,1-申请机构,默认0
26
+     * 案件主表id,案件申请表主键
25 27
      */
26
-    @Column(name = "organize_flag")
27
-    private Integer organizeFlag;
28
-
29
-
28
+    @Column(name = "case_appli_id")
29
+    private Long caseAppliId;
30 30
     /**
31
-     * 申请人id
31
+     * 用户id,用户表user_id关联
32 32
      */
33
-    @Column(name = "application_id")
34
-    private String applicationId;
35
-
33
+    @Column(name = "user_id")
34
+    private Long userId;
36 35
     /**
37
-     * 申请人名称
36
+     * 申请机构id,和部门表id关联
38 37
      */
39
-    @Column(name = "application_name")
40
-    private String  applicationName;
38
+    @Column(name = "applicant_dept_id")
39
+    private Long applicantDeptId;
41 40
 
42 41
     /**
43 42
      * 代码(统一社会信用代码或者身份证号)
44 43
      */
45
-    @Column(name = "code")
44
+    @Transient
46 45
     private String code;
47
-    /**
48
-     * 申请人联系电话
49
-     */
50
-    @Column(name = "application_phone")
51
-    private String applicationPhone;
52
-    /**
53
-     * 申请人邮箱
54
-     */
55
-    @Column(name = "application_email")
56
-    private String applicationEmail;
57 46
 
58 47
     /**
59 48
      * 法定代表人
60 49
      */
61
-    @Column(name = "comp_legal_person")
50
+    @Transient
62 51
     private String compLegalPerson;
63
-
64 52
     /**
65
-     * 申请人住所
53
+     * 角色类别,1-申请操作人/申请人,2-申请人代理人,3-被申请人操作人/被申请人,4-被申请人代理人
66 54
      */
67
-    @Column(name = "applicant_home")
68
-    private String applicantHome;
69
-
55
+    @Column(name = "role_type")
56
+    private Integer roleType=1;
70 57
     /**
71
-     * 申请人联系地址
58
+     * 组别
72 59
      */
73
-    @Column(name = "applicant_address")
74
-    private String applicantAddress;
75
-
60
+    @Column(name = "group_order")
61
+    private Integer groupOrder;
76 62
     /**
77
-     * 委托代理人姓名
63
+     * 是否操作人,0-否,1-是
78 64
      */
79
-    @Column(name = "name_agent")
80
-    private String nameAgent;
81
-
65
+    @Column(name = "operator_flag")
66
+    private Integer operatorFlag=1;
82 67
     /**
83
-     * 代理人联系电话
68
+     * 电话
84 69
      */
85
-    @Column(name = "contact_telphone_agent")
86
-    private String contactTelphoneAgent;
87
-
70
+    @Transient
71
+    private String phone;
88 72
     /**
89
-     * 代理人邮箱
73
+     * 邮箱
90 74
      */
91
-    @Column(name = "agent_email")
92
-    private String agentEmail;
93
-
75
+    @Transient
76
+    private String email;
94 77
     /**
95
-     * 申请人快递单号
78
+     * 姓名
96 79
      */
97
-    @Column(name = "applicant_track_num")
98
-    private String applicantTrackNum;
99
-
100
-    /**
101
-     * 被申请人姓名
102
-     */
103
-    @Column(name = "respondent_name")
104
-    private String respondentName;
105
-
80
+    @Transient
81
+    private String name;
106 82
     /**
107
-     * 被申请人身份证号
83
+     * 住所
108 84
      */
109
-    @Column(name = "respondent_identity_num")
110
-    private String respondentIdentityNum;
85
+    @Transient
86
+    private String home;
111 87
     /**
112
-     * 被申请人联系电话
88
+     * 联系地址
113 89
      */
114
-    @Column(name = "respondent_phone")
115
-    private String respondentPhone;
116
-
117
-    /**
118
-     * 被申请人性别(0=男,女=1)
119
-     */
120
-    @Column(name = "respondent_sex")
121
-    private String respondentSex;
122
-
90
+    @Transient
91
+    private String address;
123 92
     /**
124
-     * 被申请人出生年月日
93
+     * 身份证号
125 94
      */
126
-    @Column(name = "respondent_birth")
127
-    private Date respondentBirth;
95
+    @Transient
96
+    private String idCard;
128 97
 
129 98
     /**
130
-     * 被申请人申请人住所
99
+     * '身份类别,0-身份证,1-护照,默认0'
131 100
      */
132
-    @Column(name = "respondent_home")
133
-    private String respondentHome;
134
-
101
+    @Transient
102
+    private Integer idType;
135 103
     /**
136
-     * 被申请人邮箱
104
+     * 国籍,0-境内,1-境外,默认0
137 105
      */
138
-    @Column(name = "respondent_email")
139
-    private String respondentEmail;
140
-
106
+    @Transient
107
+    private Integer nationality;
141 108
     /**
142
-     * 被申请人快递单号
109
+     * 生日
143 110
      */
144
-    @Column(name = "respondent_track_num")
145
-    private String respondentTrackNum;
146
-
111
+    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "Asia/Shanghai")
112
+    @Transient
113
+    private Date birth;
147 114
     /**
148
-     * 申请人是否签收
115
+     * 性别,0-男,1-女
149 116
      */
150
-    @Column(name = "is_sign_apply")
151
-    private Integer isSignApply;
117
+    @Transient
118
+    private String sex;
152 119
     /**
153
-     * 被申请人是否签收
120
+     * 被申请人姓名
154 121
      */
155
-    @Column(name = "is_sign_respon")
156
-    private Integer isSignRespon;
122
+    @Transient
123
+    private String resName;
157 124
     /**
158
-     * 身份类别,0-身份证,1-护照,默认0
125
+     * 角色名称
159 126
      */
160
-    @Column(name = "id_type")
161
-    private Integer idType;
127
+    @Transient
128
+    private String roleName;
162 129
     /**
163
-     * 国籍,0-国内,1-国外,默认0
130
+     * 申请机构名称
164 131
      */
165
-    @Column(name = "nationality")
166
-    private Integer nationality;
132
+    @Transient
133
+    private String applicantOrgName;
134
+
167 135
 }

+ 16
- 4
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/entity/mscase/MsCaseApplication.java Ver arquivo

@@ -6,10 +6,7 @@ import lombok.Getter;
6 6
 import lombok.Setter;
7 7
 import lombok.ToString;
8 8
 
9
-import javax.persistence.Column;
10
-import javax.persistence.GeneratedValue;
11
-import javax.persistence.Id;
12
-import javax.persistence.Table;
9
+import javax.persistence.*;
13 10
 import java.math.BigDecimal;
14 11
 import java.util.Date;
15 12
 
@@ -208,5 +205,20 @@ public class MsCaseApplication {
208 205
      */
209 206
     @Column(name = "is_reconci")
210 207
     private Integer isReconci;
208
+    /**
209
+     * 是否机构申请,0-自然人,1-申请机构,默认0
210
+     */
211
+    @Column(name = "organize_flag")
212
+    private Integer organizeFlag;
213
+    /**
214
+     * 案件来源,YC-乙巢,空字符串-北明
215
+     */
216
+    @Column(name = "case_source")
217
+    private String caseSource;
218
+    /**
219
+     * 拒绝原因
220
+     */
221
+    @Transient
222
+    private String rejectReason;
211 223
 
212 224
 }

+ 5
- 0
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/entity/mscase/MsCaseAttach.java Ver arquivo

@@ -77,4 +77,9 @@ public class MsCaseAttach {
77 77
      */
78 78
     @Column(name = "only_office_file_id")
79 79
     private String onlyOfficeFileId;
80
+    /**
81
+     * 对接其它系统返回的附件id
82
+     */
83
+    @Column(name = "other_sys_file_id")
84
+    private String otherSysFileId;
80 85
 }

+ 32
- 0
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/vo/mscase/MsCaseAffiliateBase.java Ver arquivo

@@ -0,0 +1,32 @@
1
+package com.ruoyi.wisdomarbitrate.domain.vo.mscase;
2
+
3
+import com.ruoyi.wisdomarbitrate.domain.entity.mscase.MsCaseAffiliate;
4
+import lombok.Data;
5
+
6
+/**
7
+ * @Classname MsCaseAffiliateList
8
+ * @Description TODO
9
+ * @Version 1.0.0
10
+ * @Date 2024/3/27 16:08
11
+ * @Created wangqiong
12
+ */
13
+@Data
14
+public class MsCaseAffiliateBase {
15
+    /**
16
+     * 申请人/操作人
17
+     */
18
+    private MsCaseAffiliate applicant;
19
+    /**
20
+     * 申请人代理人
21
+     */
22
+    private MsCaseAffiliate applicantAgent;
23
+    /**
24
+     * 被申请人/操作人
25
+     */
26
+    private MsCaseAffiliate res;
27
+    /**
28
+     * 被申请人代理人
29
+     */
30
+    private MsCaseAffiliate resAgent;
31
+
32
+}

+ 11
- 0
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/vo/mscase/MsCaseAffiliateParent.java Ver arquivo

@@ -0,0 +1,11 @@
1
+package com.ruoyi.wisdomarbitrate.domain.vo.mscase;
2
+
3
+/**
4
+ * @Classname MsCaseAffiliateParent
5
+ * @Description TODO
6
+ * @Version 1.0.0
7
+ * @Date 2024/3/27 16:05
8
+ * @Created wangqiong
9
+ */
10
+public class MsCaseAffiliateParent extends MsCaseAffiliateVO {
11
+}

+ 32
- 0
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/vo/mscase/MsCaseAffiliateVO.java Ver arquivo

@@ -0,0 +1,32 @@
1
+package com.ruoyi.wisdomarbitrate.domain.vo.mscase;
2
+
3
+import lombok.Data;
4
+import lombok.Getter;
5
+import lombok.Setter;
6
+import lombok.ToString;
7
+
8
+import java.util.List;
9
+
10
+/**
11
+ * @Classname MsCaseAffiliateVO
12
+ * @Description TODO
13
+ * @Version 1.0.0
14
+ * @Date 2024/3/22 11:46
15
+ * @Created wangqiong
16
+ */
17
+@Getter
18
+@Setter
19
+@ToString
20
+@Data
21
+public class MsCaseAffiliateVO {
22
+    /**
23
+     * 申请人/操作人
24
+     */
25
+    private List<MsCaseAffiliateBase> applicant;
26
+
27
+    /**
28
+     * 被申请人/操作人
29
+     */
30
+    private List<MsCaseAffiliateBase> res;
31
+
32
+}

+ 13
- 0
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/vo/mscase/MsCaseApplicationReq.java Ver arquivo

@@ -107,5 +107,18 @@ public class MsCaseApplicationReq {
107 107
      * 代理人电话
108 108
      */
109 109
     private String contactTelphoneAgent;
110
+    /**
111
+     * 邮箱
112
+     */
113
+    private String resEmail;
114
+    /**
115
+     * 申请人邮箱
116
+     */
117
+    private String email;
118
+    /**
119
+     * 角色类别
120
+     */
121
+    private Integer roleType;
122
+    private Long userId;
110 123
 
111 124
 }

+ 13
- 2
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/vo/mscase/MsCaseApplicationVO.java Ver arquivo

@@ -1,7 +1,6 @@
1 1
 package com.ruoyi.wisdomarbitrate.domain.vo.mscase;
2 2
 
3 3
 import com.fasterxml.jackson.annotation.JsonFormat;
4
-import com.ruoyi.wisdomarbitrate.domain.entity.mscase.MsCaseAffiliate;
5 4
 import com.ruoyi.wisdomarbitrate.domain.entity.mscase.MsCaseApplication;
6 5
 import com.ruoyi.wisdomarbitrate.domain.entity.mscase.MsCaseAttach;
7 6
 import lombok.AllArgsConstructor;
@@ -34,7 +33,7 @@ public class MsCaseApplicationVO extends MsCaseApplication {
34 33
     /**
35 34
      * 案件相关人员
36 35
      */
37
-    private MsCaseAffiliate affiliate;
36
+    private  MsCaseAffiliateVO affiliate;
38 37
     /**
39 38
      * 是否压缩包导入,默认false
40 39
      */
@@ -84,5 +83,17 @@ public class MsCaseApplicationVO extends MsCaseApplication {
84 83
      */
85 84
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "Asia/Shanghai")
86 85
     private Date endTime;
86
+    /**
87
+     * 是否申请操作人,0-否,1-是
88
+     */
89
+    private Integer appOperatorFlag;
90
+    /**
91
+     * 是否被申请操作人,0-否,1-是
92
+     */
93
+    private Integer resOperatorFlag;
94
+    /**
95
+     * 是否财务,部门长,秘书,0-否,1-是
96
+     */
97
+    private Integer otherFlag;
87 98
 
88 99
 }

+ 23
- 0
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/mscase/MsCaseAffiliateMapper.java Ver arquivo

@@ -1,7 +1,30 @@
1 1
 package com.ruoyi.wisdomarbitrate.mapper.mscase;
2 2
 
3 3
 import com.ruoyi.wisdomarbitrate.domain.entity.mscase.MsCaseAffiliate;
4
+import org.apache.ibatis.annotations.Param;
4 5
 import tk.mybatis.mapper.common.Mapper;
5 6
 
7
+import java.util.List;
8
+
6 9
 public interface MsCaseAffiliateMapper extends Mapper<MsCaseAffiliate> {
10
+    /**
11
+     * 查询申请人被申请人
12
+     * @param caseIds
13
+     * @return
14
+     */
15
+    List<MsCaseAffiliate> listGroupConcat(@Param("caseIds") List<Long> caseIds);
16
+
17
+    /**
18
+     * 根据案件id查询案件人员
19
+     * @param id
20
+     * @return
21
+     */
22
+    List<MsCaseAffiliate> selectByCaseId(@Param("id") Long id);
23
+
24
+    /**
25
+     * 根据案件id查询相关人员及角色
26
+     * @param id
27
+     * @return
28
+     */
29
+    List<MsCaseAffiliate> selectUserRoleByCaseIds(@Param("caseIds") List<Long> caseIds);
7 30
 }

+ 4
- 156
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/mscase/MsCaseApplicationMapper.java Ver arquivo

@@ -29,125 +29,14 @@ public interface MsCaseApplicationMapper extends Mapper<MsCaseApplication> {
29 29
             " </script>")
30 30
     Integer selectCaseNumLike(@Param("caseNum") String caseNum, @Param("length") int length);
31 31
 
32
-    /**
32
+      /**
33 33
      * 案件列表查询
34 34
      * @param req
35
-     * @param caseStatusNames
35
+     * @param caseFlowIds
36 36
      * @return
37 37
      */
38
-    @Select("<script> select t.* from (select c.media_result mediaResult,c.id,c.room_id roomId,c.mediation_method mediationMethod," +
39
-            "   CASE c.mediation_method when 1 then '线上调解' when 2 then '线下调解' ELSE '' END mediationMethodName,"
40
-            +
41
-            "0 AS pendingStatus,c.case_flow_id caseFlowId,c.batch_number batchNumber,c.case_num caseNum,c.case_subject_amount caseSubjectAmount," +
42
-            "a.application_name applicationName,a.respondent_name respondentName,c.mediator_name mediatorName," +
43
-            "c.hear_date hearDate,c.case_status_name caseStatusName,c.create_time createTime from ms_case_application c " +
44
-            "join ms_case_affiliate a on c.id=a.case_appli_id <where> "
45
-            +
46
-            "<if test=\"req.mediatorId != null \">" +
47
-            "    AND c.mediator_id = #{req.mediatorId} " +
48
-            "</if> "
49
-            +
50
-            "<if test='req.applicantFlag != null and req.applicationOrganIds != null and req.applicationOrganIds.size() > 0  '> and  (a.application_id in" +
51
-            "<foreach item='organId' index='index' collection='req.applicationOrganIds' open='(' separator=',' close=')'>" +
52
-            "#{organId}" +
53
-            "</foreach> or a.contact_telphone_agent=#{req.contactTelphoneAgent} )" +
54
-            "</if> "
55
-            +
56
-            "<if test='caseStatusNames != null and caseStatusNames.size() > 0 '> and  c.case_status_name in" +
57
-            "<foreach item='caseStatus' index='index' collection='caseStatusNames' open='(' separator=',' close=')'>" +
58
-            "#{caseStatus}" +
59
-            "</foreach>" +
60
-            "</if> " +
61
-            "<if test=\"req.batchNumber != null and req.batchNumber != ''\">" +
62
-            "    AND c.batch_number = #{req.batchNumber} " +
63
-            "</if> " +
64
-            "<if test=\"req.caseFlowId != null \">" +
65
-            "    AND c.case_flow_id = #{req.caseFlowId} " +
66
-            "</if> "
67
-            +
68
-            "<if test=\"req.mediationMethod != null \">" +
69
-            "    AND c.mediation_method = #{req.mediationMethod} " +
70
-            "</if> "
71
-            +
72
-            "<if test=\"req.caseNum != null and req.caseNum != ''\">" +
73
-            "    AND c.case_num  like concat('%', #{req.caseNum}, '%') "+
74
-            "</if> "
75
-            + "<if test=\"req.respondentIdentityNum != null and req.respondentIdentityNum != ''\">" +
76
-            "    AND a.respondent_identity_num = #{req.respondentIdentityNum} " +
77
-            "</if> "
78
-            +
79
-            "<if test=\"req.startTime != null and req.startTime != ''\">"  +
80
-            "and c.create_time &gt;= #{req.startTime}</if>" +
81
-            "<if test=\"req.endTime != null and req.endTime != ''\">" +
82
-            "and c.create_time &lt;= #{req.endTime}</if>" +
83
-            "        </where> " +
84
-            "union  select c.media_result mediaResult,c.id id,c.room_id roomId,c.mediation_method mediationMethod,"
85
-            +
86
-            "   CASE c.mediation_method when 1 then '线上调解' when 2 then '线下调解' ELSE '' END mediationMethodName,"
87
-            +
88
-            "1 AS pendingStatus,c.case_flow_id caseFlowId,c.batch_number batchNumber,c.case_num caseNum,c.case_subject_amount caseSubjectAmount," +
89
-            "a.application_name applicationName,a.respondent_name respondentName,c.mediator_name mediatorName," +
90
-            "c.hear_date hearDate,c.case_status_name caseStatusName,c.create_time createTime from ms_case_log_record r " +
91
-            "join ms_case_application c on r.case_appli_id=c.id  " +
92
-            "join ms_case_affiliate a on c.id=a.case_appli_id  <where> r.create_by=#{req.userName}  and c.id not in (" +
93
-            "select c1.id from  ms_case_application c1 JOIN ms_case_affiliate a1 ON a1.case_appli_id = c1.id"
94
-            +
95
-            "<if test=\"req.mediatorId != null \">" +
96
-            "    AND c1.mediator_id = #{req.mediatorId} " +
97
-            "</if> "
98
-            +
99
-            "<if test=\"req.mediationMethod != null \">" +
100
-            "    AND c1.mediation_method = #{req.mediationMethod} " +
101
-            "</if> "
102
-            +
103
-
104
-            "<if test='req.applicantFlag != null and req.applicationOrganIds != null and req.applicationOrganIds.size() > 0  '> and  (a.application_id in" +
105
-            "<foreach item='organId' index='index' collection='req.applicationOrganIds' open='(' separator=',' close=')'>" +
106
-            "#{organId}" +
107
-            "</foreach>  or a.contact_telphone_agent=#{req.contactTelphoneAgent} )" +
108
-            "</if> "
109
-            +
110
-            "<if test='caseStatusNames != null and caseStatusNames.size() > 0 '> and  c1.case_status_name in" +
111
-            "<foreach item='caseStatus' index='index' collection='caseStatusNames' open='(' separator=',' close=')'>" +
112
-            "#{caseStatus}" +
113
-            "</foreach>" +
114
-            "</if> "
115
-            +
116
-            "<if test=\"req.caseFlowId != null \">" +
117
-            "    AND c1.case_flow_id = #{req.caseFlowId} " +
118
-            "</if> " +
119
-            "<if test=\"req.caseNum != null and req.caseNum != ''\">" +
120
-            "     AND c1.case_num  like concat('%', #{req.caseNum}, '%') " +
121
-            "</if> "
122
-            + "<if test=\"req.respondentIdentityNum != null and req.respondentIdentityNum != ''\">" +
123
-            "    AND a1.respondent_identity_num = #{req.respondentIdentityNum} " +
124
-            "</if> "
125
-            +
126
-            "<if test=\"req.startTime != null and req.startTime != ''\">"  +
127
-            "and c1.create_time &gt;= #{req.startTime}</if>" +
128
-            "<if test=\"req.endTime != null and req.endTime != ''\">"  +
129
-            "and c1.create_time &lt;= #{req.endTime}</if>" +
130
-            "        </where> " +
131
-            "                    ) "
132
-             +
133
-            "<if test=\"req.caseFlowId != null \">" +
134
-            "    AND c.case_flow_id = #{req.caseFlowId} " +
135
-            "</if> " +
136
-            "<if test=\"req.caseNum != null and req.caseNum != ''\">" +
137
-            "     AND c.case_num  like concat('%', #{req.caseNum}, '%')" +
138
-            "</if> "
139
-            + "<if test=\"req.respondentIdentityNum != null and req.respondentIdentityNum != ''\">" +
140
-            "    AND a.respondent_identity_num = #{req.respondentIdentityNum} " +
141
-            "</if> "
142
-            +
143 38
 
144
-            "<if test=\"req.startTime != null and req.startTime != ''\">"  +
145
-            "and c.create_time &gt;= #{req.startTime}</if>" +
146
-            "<if test=\"req.endTime != null and req.endTime != ''\">" +
147
-            "and c.create_time &lt;= #{req.endTime}</if>" +
148
-            "         ) t order by  t.createTime desc,t.caseNum desc" +
149
-            " </script>")
150
-    List<MsCaseApplicationVO> list(@Param("req")MsCaseApplicationReq req, @Param("caseStatusNames") List<String> caseStatusNames);
39
+    List<MsCaseApplicationVO> list(@Param("req")MsCaseApplicationReq req, @Param("caseFlowIds")  List<Integer> caseFlowIds , @Param("roleIds") List<Long> roleIds );
151 40
 
152 41
     /**
153 42
      * 查询调解员列表
@@ -162,46 +51,5 @@ public interface MsCaseApplicationMapper extends Mapper<MsCaseApplication> {
162 51
     @Select("select max(room_id) maxRoomId from ms_reserved_conference")
163 52
     Long selectMaxRoomId();
164 53
 
165
-    /**
166
-     * 待办数量
167
-     * @param o
168
-     * @return
169
-     */
170
-    @Select(" <script> SELECT c.case_flow_id caseFlowId,count(c.id) caseCount " +
171
-            "FROM ms_case_application c " +
172
-            "join ms_case_affiliate a on c.id=a.case_appli_id <where> " +
173
-            "<if test=\"req.mediatorId != null \">" +
174
-            "    AND c.mediator_id = #{req.mediatorId} " +
175
-            "</if> "
176
-            +
177
-            "<if test='req.applicantFlag != null and req.applicationOrganIds != null and req.applicationOrganIds.size() > 0  '> and  (a.application_id in" +
178
-            "<foreach item='organId' index='index' collection='req.applicationOrganIds' open='(' separator=',' close=')'>" +
179
-            "#{organId}" +
180
-            "</foreach> or a.contact_telphone_agent=#{req.contactTelphoneAgent} )" +
181
-            "</if> "
182
-            +
183
-            "<if test='caseStatusNames != null and caseStatusNames.size() > 0 '> and  c.case_status_name in" +
184
-            "<foreach item='caseStatus' index='index' collection='caseStatusNames' open='(' separator=',' close=')'>" +
185
-            "#{caseStatus}" +
186
-            "</foreach>" +
187
-            "</if> " +
188
-            "<if test=\"req.batchNumber != null and req.batchNumber != ''\">" +
189
-            "    AND c.batch_number = #{req.batchNumber} " +
190
-            "</if> " +
191
-            "<if test=\"req.caseFlowId != null \">" +
192
-            "    AND c.case_flow_id = #{req.caseFlowId} " +
193
-            "</if> "
194
-            +
195
-            "<if test=\"req.mediationMethod != null \">" +
196
-            "    AND c.mediation_method = #{req.mediationMethod} " +
197
-            "</if> "
198
-            + "<if test=\"req.respondentIdentityNum != null and req.respondentIdentityNum != ''\">" +
199
-            "    AND a.respondent_identity_num = #{req.respondentIdentityNum} " +
200
-            "</if> "
201
-             +
202
-            "        </where> " +
203
-            "group by c.case_flow_id,c.case_status_name"+
204
-            " </script>"
205
-    )
206
-    List<CaseToDoCount> todoCount(@Param("req")MsCaseApplicationReq req, @Param("caseStatusNames") List<String> caseStatusNames);
54
+    List<CaseToDoCount> todoCount(@Param("req")MsCaseApplicationReq req, @Param("caseFlowIds") List<Integer> caseFlowIds, @Param("roleIds") List<Long> roleIds);
207 55
 }

+ 81
- 16
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/mscase/MsCaseApplicationService.java Ver arquivo

@@ -1,9 +1,13 @@
1 1
 package com.ruoyi.wisdomarbitrate.service.mscase;
2 2
 
3 3
 import com.alibaba.fastjson.JSONArray;
4
+import com.alibaba.fastjson.JSONObject;
4 5
 import com.ruoyi.common.core.domain.AjaxResult;
6
+import com.ruoyi.common.core.domain.entity.SMSNotice;
7
+import com.ruoyi.common.core.domain.entity.SMSNoticeDO;
5 8
 import com.ruoyi.common.core.domain.entity.SysDictData;
6 9
 import com.ruoyi.common.core.domain.entity.SysUser;
10
+import com.ruoyi.common.enums.PushCaseStatusEnum;
7 11
 import com.ruoyi.common.exception.EsignDemoException;
8 12
 import com.ruoyi.system.domain.entity.flow.MsCaseFlow;
9 13
 import com.ruoyi.wisdomarbitrate.domain.dto.sendrecord.SmsSendRecord;
@@ -49,6 +53,20 @@ public interface MsCaseApplicationService {
49 53
      * @return
50 54
      */
51 55
     String insert(MsCaseApplicationVO caseApplication);
56
+    /**
57
+     * 设置案件相关信息
58
+     * @param caseApplication
59
+     * @param affiliate
60
+     * @param groupOrder 组别
61
+     */
62
+    public void setCaseAfflicate(MsCaseApplicationVO caseApplication, MsCaseAffiliate affiliate,int groupOrder);
63
+    /**
64
+     * 新增案件相关人员信息
65
+     * @param affiliate 相关人员信息
66
+     * @param roleId 角色id
67
+
68
+     */
69
+    public void insertAfficateUser(MsCaseAffiliate affiliate,  List<Long> roleIdList);
52 70
 
53 71
     /**
54 72
      * 新增案件
@@ -62,13 +80,7 @@ public interface MsCaseApplicationService {
62 80
      * @return
63 81
      */
64 82
     AjaxResult batchInsert(MsCaseBatchInsertVO vo);
65
-    /**
66
-     * 新增用户
67
-     * @param affiliate
68
-     * @param agentFlag 是否代理人,0-否,1-是
69
-     * @param roleId
70
-     */
71
-     void insertApplicantUser( MsCaseAffiliate affiliate,boolean agentFlag, Long roleId);
83
+
72 84
     /**
73 85
      * 新增申请机构代理人
74 86
      * @param affiliate
@@ -150,6 +162,13 @@ public interface MsCaseApplicationService {
150 162
      * @return
151 163
      */
152 164
     AjaxResult submit(MsCaseApplication req);
165
+    /**
166
+     * 北明推送案件状态
167
+     * @param caseApplication 案件
168
+     * @param pushCaseStatusEnum 案件状态
169
+     * @return
170
+     */
171
+    public JSONObject pushStatusToBM(MsCaseApplication caseApplication, PushCaseStatusEnum pushCaseStatusEnum);
153 172
     /**
154 173
      * 删除案件
155 174
      * @param req
@@ -204,22 +223,16 @@ public interface MsCaseApplicationService {
204 223
 
205 224
     AjaxResult updateTrialPen(MsCaseAttach attach);
206 225
 
207
-    /**
208
-     * 确认调解书
209
-     * @param attach
210
-     * @return
211
-     */
212 226
 
213
-    AjaxResult confirmMediation(MsCaseAttachVO attach) throws EsignDemoException, InterruptedException ;
214 227
     /**
215 228
      * 生成调解申请书
216 229
      * @param application 案件基本信息
217
-     * @param affiliate 案件相关人员
230
+     * @param affiliates 案件相关人员
218 231
      * @param templatePath 模板路径
219 232
      * @param bookmarkList 标签
220 233
      * @param dictDataList 内置字段
221 234
      */
222
-     void createMediateApplication(MsCaseApplication application, MsCaseAffiliate affiliate, String templatePath, List<String> bookmarkList, List<SysDictData> dictDataList, Integer templateType) ;
235
+     void createMediateApplication(MsCaseApplication application, List<MsCaseAffiliate> affiliates, String templatePath, List<String> bookmarkList, List<SysDictData> dictDataList, Integer templateType) ;
223 236
     /**
224 237
      * 调解书上传到onlyoffice服务器
225 238
      * @param annexPath
@@ -231,8 +244,15 @@ public interface MsCaseApplicationService {
231 244
      * @param req
232 245
      * @param affiliateMap
233 246
      */
234
-     void accept(MsCaseApplication application, MsCaseApplicationVO req, Map<Long, MsCaseAffiliate> affiliateMap) ;
247
+     void accept(MsCaseApplication application, MsCaseApplicationVO req, Map<Long, List<MsCaseAffiliate>> affiliateMap) ;
235 248
     /**
249
+     * 受理分配通知
250
+     * @param application 案件基本信息
251
+     * @param affiliates 案件人员
252
+     * @param applicantFlag 是否申请人
253
+     */
254
+    public void isAcceptNotice(MsCaseApplication application, List<MsCaseAffiliate> affiliates, Boolean applicantFlag);
255
+     /**
236 256
      * 判断申请人/被申请人是否预约
237 257
      * @param vo
238 258
      * @param userIds 选择的调解员ids
@@ -268,4 +288,49 @@ public interface MsCaseApplicationService {
268 288
      */
269 289
 
270 290
     AjaxResult saveOnlyOfficeFile(MsCaseAttach caseAttach);
291
+    /**
292
+     * 发送短信
293
+     * @param smsFlag 短信是否发送成功
294
+     * @param application 案件基本信息
295
+     * @param affiliate 案件人员
296
+     * @param sendContent 发送内容
297
+     */
298
+    public void sendSMS(Boolean smsFlag ,MsCaseApplication application, MsCaseAffiliate affiliate, String sendContent);
299
+    /**
300
+     * 发送邮件
301
+     * @param application 案件基本信息
302
+     * @param affiliate 案件人员
303
+     * @param subject 主题
304
+     * @param sendContent 内容
305
+     */
306
+    public void sendEmail(MsCaseApplication application, MsCaseAffiliate affiliate, String subject, String sendContent);
307
+    /**
308
+     * 发送开庭日期短信
309
+     * @param application
310
+     * @param affiliates
311
+     */
312
+    public void sendHearDateSms(MsCaseApplication application, List<MsCaseAffiliate> affiliates);
313
+    /**
314
+     * 发送短信
315
+     * @param application
316
+     * @param affiliate
317
+     * @param notice
318
+     */
319
+    public void sendNotice(MsCaseApplication application, MsCaseAffiliate affiliate,
320
+                           SMSNoticeDO notice);
321
+    /**
322
+     * 申请操作人/被申操作人发送通知
323
+     * @param application
324
+     * @param affiliates
325
+     * @param applicantFlag
326
+     * @param notice
327
+     */
328
+    public void sendNotice(MsCaseApplication application, List<MsCaseAffiliate> affiliates, Boolean applicantFlag,
329
+                           SMSNotice notice);
330
+    /**
331
+     * 根据案件id查询案件相关人员
332
+     * @param id
333
+     * @return
334
+     */
335
+    public List<MsCaseAffiliate> selectAffliatesByCaseId(Long id);
271 336
 }

+ 7
- 0
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/mscase/MsCasePaymentService.java Ver arquivo

@@ -64,4 +64,11 @@ public interface MsCasePaymentService {
64 64
      */
65 65
 
66 66
     public void confirmPayment(MsCaseFlow currentFlow,MsCaseFlow nextFlow, MsCaseApplication application, CaseConfirmPayDTO dto);
67
+
68
+    /**
69
+     * 发送受理短信
70
+     * @param dto
71
+     * @param caseAppllication
72
+     */
73
+    public void sendAcceptSms(CaseConfirmPayDTO dto, MsCaseApplication caseAppllication,String userName,String phone );
67 74
 }

+ 1
- 8
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/mscase/MsSignSealService.java Ver arquivo

@@ -4,7 +4,6 @@ import com.ruoyi.common.core.domain.AjaxResult;
4 4
 import com.ruoyi.common.exception.EsignDemoException;
5 5
 import com.ruoyi.wisdomarbitrate.domain.dto.mscase.MsSignSealDTO;
6 6
 import com.ruoyi.wisdomarbitrate.domain.dto.mscase.SealSignRecord;
7
-import com.ruoyi.wisdomarbitrate.domain.vo.mscase.MsCaseApplicationVO;
8 7
 import com.ruoyi.wisdomarbitrate.domain.vo.mscase.MsCaseLogRecordVO;
9 8
 
10 9
 import java.io.IOException;
@@ -13,7 +12,7 @@ import java.util.List;
13 12
 public interface MsSignSealService {
14 13
 
15 14
 
16
-    AjaxResult sureMediationSeal(MsCaseApplicationVO caseApplication) throws EsignDemoException, InterruptedException;
15
+
17 16
 
18 17
     AjaxResult sealApply(MsSignSealDTO dto);
19 18
 
@@ -30,12 +29,6 @@ public interface MsSignSealService {
30 29
 
31 30
     AjaxResult msCaseSignUrlApplyPC(MsSignSealDTO dto) throws EsignDemoException;
32 31
 
33
-    AjaxResult msCaseSignUrlResPC(MsSignSealDTO dto) throws EsignDemoException;
34
-
35
-    AjaxResult msCaseSignUrlApplyAPP(MsSignSealDTO dto) throws EsignDemoException;
36
-
37
-    AjaxResult msCaseSignUrlResAPP(MsSignSealDTO dto) throws EsignDemoException;
38
-
39 32
     AjaxResult signSeaalCaseApplicaCallback(String reqbodystr) throws EsignDemoException, IOException;
40 33
 
41 34
     AjaxResult sealCheckCallback(String reqbodystr) throws EsignDemoException, IOException;

+ 1
- 1
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/mscase/VideoConferenceService.java Ver arquivo

@@ -44,7 +44,7 @@ public interface VideoConferenceService {
44 44
      * @param userId
45 45
      * @return
46 46
      */
47
-    AjaxResult secretaryRoleByUserId(Long userId);
47
+    AjaxResult secretaryRoleByUserId(Long userId, Long caseId);
48 48
 
49 49
     /**
50 50
      * 根据html字符串转pdf并和案件关联

+ 2375
- 2844
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/mscase/impl/MsCaseApplicationServiceImpl.java
Diferenças do arquivo suprimidas por serem muito extensas
Ver arquivo


+ 76
- 73
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/mscase/impl/MsCasePaymentServiceImpl.java Ver arquivo

@@ -12,6 +12,7 @@ import com.ruoyi.common.core.redis.RedisCache;
12 12
 import com.ruoyi.common.enums.AnnexTypeEnum;
13 13
 import com.ruoyi.common.enums.PaymentStatusEnum;
14 14
 import com.ruoyi.common.enums.YesOrNoEnum;
15
+import com.ruoyi.common.exception.ServiceException;
15 16
 import com.ruoyi.common.utils.SecurityUtils;
16 17
 import com.ruoyi.common.utils.SmsUtils;
17 18
 import com.ruoyi.common.utils.spring.SpringUtils;
@@ -40,6 +41,7 @@ import java.util.ArrayList;
40 41
 import java.util.Date;
41 42
 import java.util.List;
42 43
 import java.util.concurrent.TimeUnit;
44
+import java.util.stream.Collectors;
43 45
 
44 46
 @Service
45 47
 public class MsCasePaymentServiceImpl implements MsCasePaymentService {
@@ -226,7 +228,7 @@ public class MsCasePaymentServiceImpl implements MsCasePaymentService {
226 228
         }
227 229
         JSONObject jsonObject = new JSONObject();
228 230
         jsonObject.set("totalFee", totalFee);
229
-        jsonObject.set("applicationOrganName", affiliate.getApplicationName());
231
+     //   jsonObject.set("applicationOrganName", affiliate.getApplicationName());
230 232
         return AjaxResult.success(jsonObject);
231 233
     }
232 234
 
@@ -248,10 +250,6 @@ public class MsCasePaymentServiceImpl implements MsCasePaymentService {
248 250
         result.setCaseSubjectAmount(application.getCaseSubjectAmount());
249 251
         result.setFeePayable(application.getFeePayable());
250 252
         result.setCaseStatusName(application.getCaseStatusName());
251
-        MsCaseAffiliate affiliate = caseAffiliateMapper.selectByPrimaryKey(application.getId());
252
-        if(affiliate != null) {
253
-            result.setApplicationOrganName(affiliate.getApplicationName());
254
-        }
255 253
         // 查询缴费单
256 254
         result.setCaseAttachList(caseAttachMapper.listCaseAttachByCaseIdAndType(id, AnnexTypeEnum.PAYMENT_RECEIPT.getCode()));
257 255
         result.setResCaseAttachList(caseAttachMapper.listCaseAttachByCaseIdAndType(id, AnnexTypeEnum.RES_PAYMENT_RECEIPT.getCode()));
@@ -369,12 +367,78 @@ public class MsCasePaymentServiceImpl implements MsCasePaymentService {
369 367
             }
370 368
             auditMapper.insert(audit);
371 369
         }
372
-        // 查询申请人电话,如果是自然人,代理人不为空,则给代理人发短信,代理人为空,给申请人发短信
373
-        MsCaseAffiliate affiliate = caseAffiliateMapper.selectByPrimaryKey(application.getId());
374
-        // 发送缴费通知
375
-        sendPaymentSms(dto,caseAppllication, affiliate,flow);
376
-
370
+        // 查询案件人员
371
+        List<MsCaseAffiliate> affiliates = applicationService.selectAffliatesByCaseId(application.getId());
372
+        if(CollectionUtil.isEmpty(affiliates)){
373
+            throw new ServiceException("未找到案件相关人员");
374
+        }
375
+        List<MsCaseAffiliate> operatorList = affiliates.stream().filter(affiliate -> affiliate.getOperatorFlag() != null && affiliate.getOperatorFlag().equals(1) && StrUtil.isNotEmpty(affiliate.getPhone())).collect(Collectors.toList());
376
+        if(CollectionUtil.isEmpty(operatorList)){
377
+            throw new ServiceException("未找到案件操作人员");
378
+        }
379
+        if(dto.getApplicantConfirm()) {
380
+            // 申请人确认缴费
381
+            for (MsCaseAffiliate affiliate : operatorList) {
382
+                // 发送缴费通知
383
+                if (affiliate.getRoleType() == null) {
384
+                    continue;
385
+                }
386
+                if (affiliate.getRoleType().equals(1) || affiliate.getRoleType().equals(2)) {
387
+                    Boolean smsFlag = true;
388
+                    SmsSendRecord smsSendRecord = null;
389
+                    if (dto.getYesOrNo().equals(YesOrNoEnum.YES.getCode())) {
390
+                        // 缴费通过
391
+                        smsFlag = SmsUtils.sendSms(affiliate.getCaseAppliId(), "2051914", affiliate.getPhone(), new String[]{affiliate.getName()});
392
+                        smsSendRecord = new SmsSendRecord(caseAppllication.getId(), caseAppllication.getCaseNum(), affiliate.getPhone(), new Date(), "尊敬的" + affiliate.getName() + ",您的调解申请费用已缴费成功。");
393
+                    } else {
394
+                        smsFlag = SmsUtils.sendSms(affiliate.getCaseAppliId(), "2074402", affiliate.getPhone(), new String[]{affiliate.getName(), caseAppllication.getCaseNum(), dto.getReason()});
395
+                        // 2074402	调解系统确认缴费不通过通知   尊敬的{1}用户,您的{2}案件,确认缴费未通过,理由为{3},请知晓,如非本人操作,请忽略本短信
396
+                        smsSendRecord = new SmsSendRecord(caseAppllication.getId(), caseAppllication.getCaseNum(), affiliate.getPhone(), new Date(), "尊敬的" + affiliate.getName() + "用户,您的" + caseAppllication.getCaseNum() + "案件,确认缴费未通过,理由为" + dto.getReason() + ",请知晓,如非本人操作,请忽略本短信");
397
+                    }
398
+                    // 新增短信记录
399
+                    if (smsFlag) {
400
+                        smsSendRecord.setSendStatus(YesOrNoEnum.YES.getCode());
401
+                    } else {
402
+                        smsSendRecord.setSendStatus(YesOrNoEnum.NO.getCode());
403
+                    }
404
+                    smsRecordMapper.saveSmsSendRecord(smsSendRecord);
405
+                }
406
+            }
407
+        }else {
408
+            // 被申请人确认缴费
409
+            for (MsCaseAffiliate affiliate : operatorList) {
410
+                // 发送缴费通知
411
+                if (affiliate.getRoleType() == null) {
412
+                    continue;
413
+                }
414
+                if (affiliate.getRoleType().equals(3) || affiliate.getRoleType().equals(4)) {
415
+                    Boolean smsFlag = true;
416
+                    SmsSendRecord smsSendRecord = null;
417
+                    if (dto.getYesOrNo().equals(YesOrNoEnum.YES.getCode())) {
418
+                        // 缴费通过
419
+                        smsFlag = SmsUtils.sendSms(affiliate.getCaseAppliId(), "2051914", affiliate.getPhone(), new String[]{affiliate.getName()});
420
+                        smsSendRecord = new SmsSendRecord(caseAppllication.getId(), caseAppllication.getCaseNum(), affiliate.getPhone(), new Date(), "尊敬的" + affiliate.getName() + ",您的调解申请费用已缴费成功。");
421
+                    } else {
422
+                        smsFlag = SmsUtils.sendSms(affiliate.getCaseAppliId(), "2074402", affiliate.getPhone(), new String[]{affiliate.getName(), caseAppllication.getCaseNum(), dto.getReason()});
423
+                        // 2074402	调解系统确认缴费不通过通知   尊敬的{1}用户,您的{2}案件,确认缴费未通过,理由为{3},请知晓,如非本人操作,请忽略本短信
424
+                        smsSendRecord = new SmsSendRecord(caseAppllication.getId(), caseAppllication.getCaseNum(), affiliate.getPhone(), new Date(), "尊敬的" + affiliate.getName() + "用户,您的" + caseAppllication.getCaseNum() + "案件,确认缴费未通过,理由为" + dto.getReason() + ",请知晓,如非本人操作,请忽略本短信");
425
+                    }
426
+                    // 新增短信记录
427
+                    if (smsFlag) {
428
+                        smsSendRecord.setSendStatus(YesOrNoEnum.YES.getCode());
429
+                    } else {
430
+                        smsSendRecord.setSendStatus(YesOrNoEnum.NO.getCode());
431
+                    }
432
+                    smsRecordMapper.saveSmsSendRecord(smsSendRecord);
433
+                }
434
+                // 被申请人确认缴费,发送受理通知
435
+                if( dto.getYesOrNo().equals(YesOrNoEnum.YES.getCode())) {
436
+                    // 申请人发送受理短信
437
+                    casePaymentService.sendAcceptSms(dto, caseAppllication, affiliate.getName(), affiliate.getPhone());
377 438
 
439
+                }
440
+            }
441
+        }
378 442
     }
379 443
 
380 444
 
@@ -395,76 +459,15 @@ public class MsCasePaymentServiceImpl implements MsCasePaymentService {
395 459
 
396 460
     }
397 461
 
398
-    /**
399
-     * 发送缴费短信
400
-     * @param dto
401
-     * @param caseAppllication
402
-     * @param affiliate
403
-     */
404
-    private void sendPaymentSms(CaseConfirmPayDTO dto, MsCaseApplication caseAppllication, MsCaseAffiliate affiliate,MsCaseFlow flow) {
405
-        if (affiliate != null) {
406
-            // 受理通知
407
-            String phone = "";
408
-            String userName = "";
409
-            // 缴费通知
410
-            String payPhone = "";
411
-            String payUserName = "";
412
-            if (affiliate.getOrganizeFlag().equals(0)) {
413
-                // 自然人
414
-                if (StrUtil.isNotEmpty(affiliate.getContactTelphoneAgent())) {
415
-                    phone = affiliate.getContactTelphoneAgent();
416
-                    userName = affiliate.getNameAgent();
417
-                } else {
418
-                    phone = affiliate.getApplicationPhone();
419
-                    userName = affiliate.getApplicationName();
420
-                }
421 462
 
422
-            } else {
423
-                phone = affiliate.getContactTelphoneAgent();
424
-                userName = affiliate.getNameAgent();
425
-            }
426
-            if (StrUtil.isNotEmpty(phone)) {
427
-                payPhone=phone;
428
-                payUserName=userName;
429
-                if(!dto.getApplicantConfirm()) {
430
-                    // 被申请人发送通知
431
-                    payPhone=affiliate.getRespondentPhone();
432
-                    payUserName=affiliate.getRespondentName();
433
-                }
434
-                Boolean smsFlag =true;
435
-                SmsSendRecord smsSendRecord=null;
436
-                // 申请人被申请人发送缴费成功短信 2051914 调解缴费成功通知   尊敬的{1},您的调解申请费用已缴费成功。
437
-                    if (dto.getYesOrNo().equals(YesOrNoEnum.YES.getCode())) {
438
-                        smsFlag = SmsUtils.sendSms(affiliate.getCaseAppliId(), "2051914", payPhone, new String[]{payUserName});
439
-                        smsSendRecord = new SmsSendRecord(caseAppllication.getId(), caseAppllication.getCaseNum(), payPhone, new Date(), "尊敬的" + payUserName + ",您的调解申请费用已缴费成功。");
440
-                    } else {
441
-                        smsFlag = SmsUtils.sendSms(affiliate.getCaseAppliId(), "2074402", payPhone, new String[]{payUserName, caseAppllication.getCaseNum(), dto.getReason()});
442
-                        // 2074402	调解系统确认缴费不通过通知   尊敬的{1}用户,您的{2}案件,确认缴费未通过,理由为{3},请知晓,如非本人操作,请忽略本短信
443
-                        smsSendRecord = new SmsSendRecord(caseAppllication.getId(), caseAppllication.getCaseNum(), payPhone, new Date(), "尊敬的" + payUserName + "用户,您的" + caseAppllication.getCaseNum() + "案件,确认缴费未通过,理由为" + dto.getReason() + ",请知晓,如非本人操作,请忽略本短信");
444
-                    }
445
-                // 新增短信记录
446
-                if (smsFlag) {
447
-                    smsSendRecord.setSendStatus(YesOrNoEnum.YES.getCode());
448
-                } else {
449
-                    smsSendRecord.setSendStatus(YesOrNoEnum.NO.getCode());
450
-                }
451
-                smsRecordMapper.saveSmsSendRecord(smsSendRecord);
452
-                if(!dto.getApplicantConfirm()&& dto.getYesOrNo().equals(YesOrNoEnum.YES.getCode())) {
453
-                    // 申请人发送受理短信
454
-                    sendAcceptSms(dto, caseAppllication, userName, phone);
455
-                    // 被申请人发送受理短信
456
-                    sendAcceptSms(dto, caseAppllication, affiliate.getRespondentName(), affiliate.getRespondentPhone());
457
-                }
458
-            }
459
-        }
460
-    }
461 463
 
462 464
     /**
463 465
      * 发送受理短信
464 466
      * @param dto
465 467
      * @param caseAppllication
466 468
      */
467
-    private void sendAcceptSms(CaseConfirmPayDTO dto, MsCaseApplication caseAppllication,String userName,String phone ) {
469
+    @Transactional
470
+    public void sendAcceptSms(CaseConfirmPayDTO dto, MsCaseApplication caseAppllication,String userName,String phone ) {
468 471
             // 申请人被申请人发送受理通知书 2073601    尊敬的{1}用户,您的{2}案件,已成功受理,请知晓,如非本人操作,请忽略本短信。
469 472
             Boolean  smsFlag =  SmsUtils.sendSms(caseAppllication.getId(), "2073601", phone, new String[]{userName, caseAppllication.getCaseNum()});
470 473
             SmsSendRecord smsSendRecord = new SmsSendRecord(caseAppllication.getId(), caseAppllication.getCaseNum(), phone, new Date(), "尊敬的" + userName + "用户,您的" + caseAppllication.getCaseNum() +  "案件,已成功受理,请知晓,如非本人操作,请忽略本短信。");

+ 182
- 455
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/mscase/impl/MsSignSealServiceImpl.java Ver arquivo

@@ -4,8 +4,8 @@ import cn.hutool.core.bean.BeanUtil;
4 4
 import cn.hutool.core.collection.CollectionUtil;
5 5
 import cn.hutool.core.date.DatePattern;
6 6
 import cn.hutool.core.date.DateUtil;
7
+import cn.hutool.core.io.FileUtil;
7 8
 import cn.hutool.core.util.StrUtil;
8
-import com.alibaba.fastjson.JSONArray;
9 9
 import com.alibaba.fastjson.JSONObject;
10 10
 import com.google.gson.Gson;
11 11
 import com.google.gson.JsonArray;
@@ -16,18 +16,20 @@ 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 18
 import com.ruoyi.common.enums.AnnexTypeEnum;
19
+import com.ruoyi.common.enums.AttachmentOperateTypeEnum;
20
+import com.ruoyi.common.enums.PushCaseStatusEnum;
19 21
 import com.ruoyi.common.enums.YesOrNoEnum;
20 22
 import com.ruoyi.common.exception.EsignDemoException;
21 23
 import com.ruoyi.common.exception.ServiceException;
22 24
 import com.ruoyi.common.utils.EmailOutUtil;
23 25
 import com.ruoyi.common.utils.SecurityUtils;
24
-import com.ruoyi.common.utils.SmsUtils;
25 26
 import com.ruoyi.common.utils.StringUtils;
26 27
 import com.ruoyi.common.utils.file.SaaSAPIFileUtils;
27 28
 import com.ruoyi.system.domain.entity.flow.MsCaseFlow;
28 29
 import com.ruoyi.system.domain.vo.flow.MsCaseFlowVO;
29 30
 import com.ruoyi.system.mapper.SysUserMapper;
30 31
 import com.ruoyi.system.mapper.flow.MsCaseFlowMapper;
32
+import com.ruoyi.system.service.impl.BeiMingInterfaceService;
31 33
 import com.ruoyi.wisdomarbitrate.domain.dto.dept.DeptIdentify;
32 34
 import com.ruoyi.wisdomarbitrate.domain.dto.dept.SealManage;
33 35
 import com.ruoyi.wisdomarbitrate.domain.dto.mscase.CaseLogRecord;
@@ -40,6 +42,7 @@ import com.ruoyi.wisdomarbitrate.domain.entity.mscase.MsCaseApplication;
40 42
 import com.ruoyi.wisdomarbitrate.domain.entity.mscase.MsCaseAttach;
41 43
 import com.ruoyi.wisdomarbitrate.domain.entity.mscase.MsCaseLogRecord;
42 44
 import com.ruoyi.wisdomarbitrate.domain.vo.mscase.MsCaseApplicationVO;
45
+import com.ruoyi.wisdomarbitrate.domain.vo.mscase.MsCaseFileInfo;
43 46
 import com.ruoyi.wisdomarbitrate.domain.vo.mscase.MsCaseLogRecordVO;
44 47
 import com.ruoyi.wisdomarbitrate.mapper.dept.DeptIdentifyMapper;
45 48
 import com.ruoyi.wisdomarbitrate.mapper.dept.MsSealSignRecordMapper;
@@ -54,6 +57,7 @@ import com.ruoyi.wisdomarbitrate.service.mscase.MsSignSealService;
54 57
 import com.ruoyi.wisdomarbitrate.utils.CaseLogUtils;
55 58
 import com.ruoyi.wisdomarbitrate.utils.SignAward;
56 59
 import org.springframework.beans.factory.annotation.Autowired;
60
+import org.springframework.beans.factory.annotation.Value;
57 61
 import org.springframework.stereotype.Service;
58 62
 import org.springframework.transaction.annotation.Transactional;
59 63
 import tk.mybatis.mapper.entity.Example;
@@ -106,286 +110,19 @@ public class MsSignSealServiceImpl implements MsSignSealService {
106 110
 
107 111
     @Autowired
108 112
     private SendMailRecordMapper sendMailRecordMapper;
113
+    // 北明配置
114
+    @Value("${BMConfig.userName}")
115
+    private String BMUserName;
116
+    @Value("${BMConfig.password}")
117
+    private String BMPassword;
118
+    @Value("${BMConfig.syncSource}")
119
+    private String BMSyncSource;
120
+    @Autowired
121
+    BeiMingInterfaceService beiMingInterfaceService;
109 122
 
110 123
 
111 124
 
112 125
 
113
-    @Override
114
-    @Transactional
115
-    public AjaxResult sureMediationSeal(MsCaseApplicationVO caseApplicationVO) throws EsignDemoException, InterruptedException {
116
-        Long id = caseApplicationVO.getId();
117
-        MsCaseApplication caseApplication = msCaseApplicationMapper.selectByPrimaryKey(id);
118
-        // 查询案件相关人员
119
-        MsCaseAffiliate caseAffiliate = msCaseAffiliateMapper.selectByPrimaryKey(id);
120
-        // 查询附件
121
-        List<MsCaseAttach> caseAttachList = msCaseAttachMapper.queryAnnexPathByCaseId(id);
122
-        if (caseAttachList != null && caseAttachList.size() > 0) {
123
-            for (MsCaseAttach caseAttach : caseAttachList) {
124
-                if (caseAttach.getAnnexType() == AnnexTypeEnum.MEDIATE_BOOK.getCode()) {
125
-//                    String annexPath = caseAttach.getAnnexPath();
126
-//                    String path = "/home/ruoyi" + annexPath;
127
-                    String prefix = "/profile";
128
-                    int startIndex = prefix.length();
129
-                    String annexPath = caseAttach.getAnnexPath();
130
-//                    String path = "/home/ruoyi/uploadPath/" + annexPath.substring(startIndex+1);
131
-                    String path = "D:\\home\\ruoyi\\uploadPath\\upload\\2023\\12\\f8551b0e003e4af89acae7b500dacb77调解书.docx";
132
-                    //获取文件上传地址
133
-                    EsignHttpResponse response = SaaSAPIFileUtils.getUploadUrl(path);
134
-                    String body = response.getBody();
135
-                    if (body != null) {
136
-                        JSONObject jsonObject = JSONObject.parseObject(body);
137
-                        String fileId = jsonObject.getJSONObject("data").getString("fileId");
138
-                        String fileUploadUrl = jsonObject.getJSONObject("data").getString("fileUploadUrl");
139
-                        //上传文件流
140
-                        EsignHttpResponse response1 = SaaSAPIFileUtils.uploadFile(fileUploadUrl, path);
141
-                        JSONObject jsonObject1 = JSONObject.parseObject(response1.getBody());
142
-                        if (jsonObject1.getIntValue("errCode") == 0) {
143
-                            //查看文件上传状态
144
-                            Thread.sleep(1000);
145
-                            EsignHttpResponse response2 = SaaSAPIFileUtils.getFileStatus(fileId);
146
-                            JSONObject jsonObject2 = JSONObject.parseObject(response2.getBody());
147
-                            JSONObject data = jsonObject2.getJSONObject("data");
148
-                            int fileStatus = data.getIntValue("fileStatus");
149
-                            if (fileStatus == 2 || fileStatus == 5) {
150
-                                String fileName = data.getString("fileName");
151
-                                //上传成功,获取文件签名印章位置
152
-                                SealSignRecord sealSignRecord = new SealSignRecord();
153
-                                sealSignRecord.setFileid(fileId);
154
-                                EsignHttpResponse positions = SignAward.getPositionsMediation(sealSignRecord);
155
-                                Gson gson = new Gson();
156
-                                JsonObject positionsJsonObject = gson.fromJson(positions.getBody(), JsonObject.class);
157
-                                JsonObject positionsData = positionsJsonObject.getAsJsonObject("data");
158
-                                String keywordPositions = positionsData.get("keywordPositions").toString();
159
-                                //发起签署
160
-                                sealSignRecord.setFilename(fileName);
161
-
162
-                                Long arbitratorId = caseApplication.getMediatorId();
163
-                                if (arbitratorId!=null) {
164
-                                    SysUser sysUser = sysUserMapper.selectUserById(arbitratorId);
165
-                                    if (sysUser == null) {
166
-                                        return AjaxResult.error();
167
-                                    }
168
-                                    sealSignRecord.setPensonAccountMedi(sysUser.getPhonenumber());
169
-                                    sealSignRecord.setPensonNameMedi(sysUser.getNickName());
170
-                                }
171
-
172
-                                sealSignRecord.setPensonAccount(caseAffiliate.getContactTelphoneAgent());
173
-                                sealSignRecord.setPensonName(caseAffiliate.getNameAgent());
174
-                                sealSignRecord.setPensonAccountRes(caseAffiliate.getRespondentPhone());
175
-                                sealSignRecord.setPensonNameRes(caseAffiliate.getRespondentName());
176
-
177
-                                DeptIdentify deptIdentify = new DeptIdentify();
178
-                                deptIdentify.setIsUse(1);
179
-                                DeptIdentify deptIdentifyselect = new DeptIdentify();
180
-                                List<DeptIdentify> deptIdentifysnew = deptIdentifyMapper.selectDeptIdentify(deptIdentify);
181
-                                if (deptIdentifysnew != null && deptIdentifysnew.size() > 0) {
182
-                                    deptIdentifyselect = deptIdentifysnew.get(0);
183
-                                    sealSignRecord.setOrgnizeName(deptIdentifyselect.getIdentifyName());
184
-                                    sealSignRecord.setOrgnizeNamePsnAccount(deptIdentifyselect.getOperPhone());
185
-                                    sealSignRecord.setOrgnizeNamepsnName(deptIdentifyselect.getOperName());
186
-                                } else {
187
-                                    return AjaxResult.error("没有用印时的机构名称及经办人信息");
188
-                                }
189
-
190
-                                //解析文件签名印章位置
191
-                                JSONArray jsonArray = JSONArray.parseArray(keywordPositions);
192
-                                for (int i = 0; i < jsonArray.size(); i++) {
193
-                                    JSONObject jsonObject3 = jsonArray.getJSONObject(i);
194
-                                    String keyword = jsonObject3.getString("keyword");
195
-                                    if (keyword.equals("甲方(签字):")) {
196
-                                        //签名
197
-                                        JSONArray positionsArray = jsonObject3.getJSONArray("positions");
198
-                                        // 遍历 positionsArray 中的每个元素
199
-                                        for (int j = 0; j < positionsArray.size(); j++) {
200
-                                            JSONObject positionObj = positionsArray.getJSONObject(j);
201
-                                            int pageNum = positionObj.getIntValue("pageNum");
202
-                                            sealSignRecord.setPositionPagepsn(String.valueOf(pageNum));
203
-                                            JSONArray coordinatesArray = positionObj.getJSONArray("coordinates");
204
-                                            JSONObject coordinateObj = coordinatesArray.getJSONObject(0);
205
-                                            double positionX = coordinateObj.getDoubleValue("positionX");
206
-                                            double positionY = coordinateObj.getDoubleValue("positionY");
207
-                                            sealSignRecord.setPositionXpsn(positionX + 90);
208
-                                            sealSignRecord.setPositionYpsn(positionY + 30);
209
-                                        }
210
-                                    }else if (keyword.equals("乙方(签字):")) {
211
-                                        //签名
212
-                                        JSONArray positionsArray = jsonObject3.getJSONArray("positions");
213
-                                        // 遍历 positionsArray 中的每个元素
214
-                                        for (int j = 0; j < positionsArray.size(); j++) {
215
-                                            JSONObject positionObj = positionsArray.getJSONObject(j);
216
-                                            int pageNum = positionObj.getIntValue("pageNum");
217
-                                            sealSignRecord.setPositionPagepsnRes(String.valueOf(pageNum));
218
-                                            JSONArray coordinatesArray = positionObj.getJSONArray("coordinates");
219
-                                            JSONObject coordinateObj = coordinatesArray.getJSONObject(0);
220
-                                            double positionX = coordinateObj.getDoubleValue("positionX");
221
-                                            double positionY = coordinateObj.getDoubleValue("positionY");
222
-                                            sealSignRecord.setPositionXpsnRes(positionX + 90);
223
-                                            sealSignRecord.setPositionYpsnRes(positionY);
224
-                                        }
225
-                                    }else if (keyword.equals("调解员(签字):")) {
226
-                                        //签名
227
-                                        JSONArray positionsArray = jsonObject3.getJSONArray("positions");
228
-                                        // 遍历 positionsArray 中的每个元素
229
-                                        for (int j = 0; j < positionsArray.size(); j++) {
230
-                                            JSONObject positionObj = positionsArray.getJSONObject(j);
231
-                                            int pageNum = positionObj.getIntValue("pageNum");
232
-                                            sealSignRecord.setPositionPagepsnMedi(String.valueOf(pageNum));
233
-                                            JSONArray coordinatesArray = positionObj.getJSONArray("coordinates");
234
-                                            JSONObject coordinateObj = coordinatesArray.getJSONObject(0);
235
-                                            double positionX = coordinateObj.getDoubleValue("positionX");
236
-                                            double positionY = coordinateObj.getDoubleValue("positionY");
237
-                                            sealSignRecord.setPositionXpsnMedi(positionX + 90);
238
-                                            sealSignRecord.setPositionYpsnMedi(positionY);
239
-                                        }
240
-                                    }else {
241
-                                        //用印
242
-                                        JSONArray positionsArray = jsonObject3.getJSONArray("positions");
243
-                                        // 遍历 positionsArray 中的每个元素
244
-                                        for (int j = 0; j < positionsArray.size(); j++) {
245
-                                            JSONObject positionObj = positionsArray.getJSONObject(j);
246
-                                            int pageNum = positionObj.getIntValue("pageNum");
247
-                                            sealSignRecord.setPositionPageorg(String.valueOf(pageNum));
248
-                                            JSONArray coordinatesArray = positionObj.getJSONArray("coordinates");
249
-                                            JSONObject coordinateObj = coordinatesArray.getJSONObject(0);
250
-                                            double positionX = coordinateObj.getDoubleValue("positionX");
251
-                                            double positionY = coordinateObj.getDoubleValue("positionY");
252
-                                            sealSignRecord.setPositionXorg(positionX + 90);
253
-                                            sealSignRecord.setPositionYorg(positionY);
254
-                                        }
255
-                                    }
256
-                                }
257
-                                        /*DeptIdentify deptIdentify1 = new DeptIdentify();
258
-                                        deptIdentify1.setSealStatus(1); // 印章状态为启用
259
-                                        //根据机构名称查询部门id
260
-                                        SysDept sysDept = new SysDept();
261
-                                        sysDept.setDeptName(sealSignRecord.getOrgnizeName());
262
-                                        List<SysDept> sysDepts = deptMapper.selectDeptList(sysDept);
263
-                                        if (sysDepts != null && sysDepts.size() > 0) {
264
-                                            Long deptId = sysDepts.get(0).getDeptId();
265
-                                            deptIdentify1.setDeptId(deptId);
266
-                                        }
267
-                                        List<DeptIdentify> deptIdentifies = deptIdentifyMapper.selectDeptIdentifylistother(deptIdentify1);
268
-                                        List<String> sealIds = new ArrayList<>();
269
-                                        if (deptIdentifies != null && deptIdentifies.size() > 0) {
270
-                                            for (DeptIdentify identify : deptIdentifies) {
271
-                                                String sealId = identify.getSealId();
272
-                                                sealIds.add(sealId);
273
-                                            }
274
-                                        }*/
275
-                                String orgnizeName = sealSignRecord.getOrgnizeName(); //机构名称
276
-                                String orgnizeNamepsnName = sealSignRecord.getOrgnizeNamepsnName(); //机构经办人姓名
277
-                                String orgnizeNamePsnAccount = sealSignRecord.getOrgnizeNamePsnAccount(); //机构经办人联系方式
278
-                                //查询机构信息
279
-                                DeptIdentify deptIdentify1 = new DeptIdentify();
280
-                                deptIdentify1.setIdentifyName(orgnizeName);
281
-                                deptIdentify1.setOperName(orgnizeNamepsnName);
282
-                                deptIdentify1.setOperPhone(orgnizeNamePsnAccount);
283
-                                List<DeptIdentify> deptIdentifies = deptIdentifyMapper.selectDeptIdentify(deptIdentify1);
284
-                                if (deptIdentifies != null && deptIdentifies.size() > 0) {
285
-                                    Long iddeptIdent = deptIdentifies.get(0).getId();
286
-                                    SealManage sealManage = new SealManage();
287
-                                    sealManage.setIdentifyId(iddeptIdent);
288
-                                    List<String> sealIdList = new ArrayList<>();
289
-                                    List<SealManage> selectSealList = sealManageMapper.selectSealList(sealManage);
290
-                                    if (selectSealList != null && selectSealList.size() > 0) {
291
-                                        for (SealManage manage : selectSealList) {
292
-                                            Integer sealStatus = manage.getSealStatus();
293
-                                            Integer isUse = manage.getIsUse();
294
-                                            if (sealStatus == 1 && isUse ==1) {
295
-                                                sealIdList.add(manage.getSealId());
296
-                                            }
297
-                                        }
298
-                                        EsignHttpResponse response3 = SignAward.createByFileMediation(sealSignRecord, sealIdList);
299
-
300
-                                        JSONObject jsonObject3 = JSONObject.parseObject(response3.getBody());
301
-                                        if (jsonObject3 != null) {
302
-                                            if (jsonObject3.getIntValue("code") == 0) {
303
-                                                //获取签署流程ID
304
-                                                JSONObject data1 = jsonObject3.getJSONObject("data");
305
-                                                String signFlowId = data1.getString("signFlowId");
306
-                                                //保存案件id,文件id,文件名称.流程id到签署用印记录表里
307
-                                                sealSignRecord.setCaseAppliId(caseApplication.getId());
308
-                                                sealSignRecord.setSignFlowid(signFlowId);
309
-                                                sealSignRecord.setSignFlowStatus(1);//待签名
310
-                                                MsSealSignRecord msSealSignRecord = new MsSealSignRecord();
311
-                                                BeanUtil.copyProperties(sealSignRecord, msSealSignRecord);
312
-                                                msSealSignRecord.setFileId(sealSignRecord.getFileid());
313
-                                                msSealSignRecord.setFileName(sealSignRecord.getFilename());
314
-                                                msSealSignRecord.setSignFlowId(sealSignRecord.getSignFlowid());
315
-                                                msSealSignRecord.setOrgnNamePsnAcc(sealSignRecord.getOrgnizeNamePsnAccount());
316
-                                                msSealSignRecord.setOrgnNamePsnName(sealSignRecord.getOrgnizeNamepsnName());
317
-                                                sealSignRecordMapper.insert(msSealSignRecord);
318
-
319
-                                                SealSignRecord sealSignRecordapply = new SealSignRecord();
320
-                                                sealSignRecordapply.setSignFlowid(signFlowId);
321
-                                                sealSignRecordapply.setPensonAccount(caseAffiliate.getContactTelphoneAgent());
322
-                                                EsignHttpResponse signUrl = SignAward.signUrlMediation(sealSignRecordapply);
323
-                                                JsonObject signUrlJsonObject = gson.fromJson(signUrl.getBody(), JsonObject.class);
324
-                                                JsonObject signUrlData = signUrlJsonObject.getAsJsonObject("data");
325
-                                                String urlapply = signUrlData.get("shortUrl").getAsString();
326
-                                                String urlapplynew = urlapply.substring(urlapply.lastIndexOf("/")+1);
327
-
328
-                                                //发送签名链接短信,尊敬的{1}用户,您的{2}调解案件,签名链接{3},请点击链接签名,如非本人操作,请忽略本短信
329
-                                                SmsUtils.SendSmsRequest request = new SmsUtils.SendSmsRequest();
330
-                                                request.setTemplateId("2047719");
331
-                                                request.setPhone(caseAffiliate.getContactTelphoneAgent());
332
-                                                request.setTemplateParamSet(new String[]{caseAffiliate.getNameAgent(), caseApplication.getCaseNum(),urlapplynew});
333
-                                                Boolean aBoolean = SmsUtils.sendSms(request);
334
-
335
-                                                SealSignRecord sealSignRecordRespon = new SealSignRecord();
336
-                                                sealSignRecordRespon.setSignFlowid(signFlowId);
337
-                                                sealSignRecordRespon.setPensonAccount(caseAffiliate.getRespondentPhone());
338
-                                                EsignHttpResponse signUrlRespon = SignAward.signUrlMediation(sealSignRecordRespon);
339
-                                                JsonObject signUrlJsonObjectRespon = gson.fromJson(signUrlRespon.getBody(), JsonObject.class);
340
-                                                JsonObject signUrlDataRespon = signUrlJsonObjectRespon.getAsJsonObject("data");
341
-                                                String urlRespon = signUrlDataRespon.get("shortUrl").getAsString();
342
-                                                String urlResponnew = urlRespon.substring(urlRespon.lastIndexOf("/")+1);
343
-
344
-                                                SmsUtils.SendSmsRequest request1 = new SmsUtils.SendSmsRequest();
345
-                                                request1.setTemplateId("2047719");
346
-                                                request1.setPhone(caseAffiliate.getRespondentPhone());
347
-                                                request1.setTemplateParamSet(new String[]{caseAffiliate.getRespondentName(), caseApplication.getCaseNum(),urlResponnew});
348
-                                                Boolean aBoolean1 = SmsUtils.sendSms(request1);
349
-
350
-                                                SealSignRecord sealSignRecordMedi = new SealSignRecord();
351
-                                                sealSignRecordMedi.setSignFlowid(signFlowId);
352
-                                                sealSignRecordMedi.setPensonAccount(sealSignRecord.getPensonAccountMedi());
353
-                                                EsignHttpResponse signUrlResponMedi = SignAward.signUrlMediation(sealSignRecordMedi);
354
-                                                JsonObject signUrlJsonObjectResponMedi = gson.fromJson(signUrlResponMedi.getBody(), JsonObject.class);
355
-                                                JsonObject signUrlDataResponMedi = signUrlJsonObjectResponMedi.getAsJsonObject("data");
356
-                                                String urlResponMedi = signUrlDataResponMedi.get("shortUrl").getAsString();
357
-                                                String urlResponnewMedi = urlResponMedi.substring(urlResponMedi.lastIndexOf("/")+1);
358
-
359
-                                                SmsUtils.SendSmsRequest requestMedi = new SmsUtils.SendSmsRequest();
360
-                                                requestMedi.setTemplateId("2047719");
361
-                                                requestMedi.setPhone(sealSignRecord.getPensonAccountMedi());
362
-                                                requestMedi.setTemplateParamSet(new String[]{sealSignRecord.getPensonNameMedi(), caseApplication.getCaseNum(),urlResponnewMedi});
363
-                                                Boolean aBooleanMedi = SmsUtils.sendSms(requestMedi);
364
-
365
-                                            } else {
366
-                                                throw new ServiceException(jsonObject3.getString("message"));
367
-                                            }
368
-                                        } else {
369
-                                            return AjaxResult.error();
370
-                                        }
371
-
372
-                                    }
373
-
374
-
375
-                                } else {
376
-                                    return AjaxResult.error();
377
-                                }
378
-                            }
379
-                        }
380
-                    }
381
-                    break;
382
-                }
383
-
384
-            }
385
-
386
-        }
387
-        return  AjaxResult.success();
388
-    }
389 126
 
390 127
     @Override
391 128
     @Transactional
@@ -457,8 +194,6 @@ public class MsSignSealServiceImpl implements MsSignSealService {
457 194
     public AjaxResult selectCaseProgress(MsSignSealDTO dto) {
458 195
         Map<String, Object> datas = new HashMap<>();
459 196
         Long id = dto.getCaseId();
460
-//        MsCaseLogRecord caseLogRecord = new MsCaseLogRecord();
461
-//        caseLogRecord.setCaseAppliId(id);
462 197
         List<MsCaseLogRecordVO> records = caseLogRecordMapper.selectCaseLogRecordListCaseProgress(dto.getCaseId());
463 198
 
464 199
         MsCaseApplication caseApplicationselect = msCaseApplicationMapper.selectByPrimaryKey(id);
@@ -468,7 +203,6 @@ public class MsSignSealServiceImpl implements MsSignSealService {
468 203
         List<MsCaseLogRecordVO> recordsNew = new ArrayList<>();
469 204
         if (records != null && records.size() > 0) {
470 205
             for (MsCaseLogRecordVO msCaseLogRecordVO : records) {
471
-//                String content = msCaseLogRecordVO.getContent();
472 206
                 String content = msCaseLogRecordVO.getCaseStatusName();
473 207
                 if(StringUtils.isNotEmpty(content)){
474 208
                     if(content.equals("结束")){
@@ -594,6 +328,7 @@ public class MsSignSealServiceImpl implements MsSignSealService {
594 328
     @Override
595 329
     @Transactional(rollbackFor = Exception.class)
596 330
     public AjaxResult msCaseFile(List<Long> ids){
331
+        // todo
597 332
         try {
598 333
             for (Long id : ids) {
599 334
                 MsCaseApplication caseApplication1 = msCaseApplicationMapper.selectByPrimaryKey(id);
@@ -606,10 +341,6 @@ public class MsSignSealServiceImpl implements MsSignSealService {
606 341
                 if (caseAttachList != null && caseAttachList.size() > 0) {
607 342
                     for (MsCaseAttach caseAttach : caseAttachList) {
608 343
                         if (caseAttach.getAnnexType() == AnnexTypeEnum.MEDIATE_BOOK.getCode()) {
609
-//                            String annexName = caseAttach.getAnnexName();
610
-//                            String prefix = "/profile/upload/";
611
-//                            int startIndex = prefix.length();
612
-//                            String path = caseAttach.getAnnexPath() + annexName.substring(startIndex);
613 344
                             String prefix = "/profile";
614 345
                             int startIndex = prefix.length();
615 346
                             String annexPath = caseAttach.getAnnexPath();
@@ -638,9 +369,6 @@ public class MsSignSealServiceImpl implements MsSignSealService {
638 369
                                         String day = String.format("%02d", now.getDayOfMonth());
639 370
                                         String saveFolderPath = "/home/ruoyi/uploadPath/upload/" + year + "/" + month + "/" + day;
640 371
                                         String fileName = UUID.randomUUID().toString().replace("-", "") + ".pdf";
641
-
642
-//                                        String saveName = "/profile/upload/" + year + "/" + month + "/" + day + "/" + fileName;
643
-//                                        String savePath = "/home/ruoyi/uploadPath/upload/";
644 372
                                         String saveName = fileName;
645 373
                                         String savePath = "/profile/upload/" + year + "/" + month + "/" + day + "/" + fileName;
646 374
 
@@ -687,62 +415,49 @@ public class MsSignSealServiceImpl implements MsSignSealService {
687 415
                 caseApplication1.setCaseStatusName(nextFlow.getCaseStatusName());
688 416
                 caseApplicationMapper.updateByPrimaryKeySelective(caseApplication1);
689 417
 
690
-                String appEmail = "";
691
-                String resEmail = "";
692
-                MsCaseAffiliate caseAffiliate = msCaseAffiliateMapper.selectByPrimaryKey(id);
693
-
694
-                Integer organizeFlag = caseAffiliate.getOrganizeFlag();
695
-                if(organizeFlag!=null){
696
-                    if(organizeFlag.intValue()==1){
697
-                        appEmail = caseAffiliate.getAgentEmail();
698
-                    }else {
699
-                        appEmail = caseAffiliate.getApplicationEmail();
700
-                    }
701
-                }
702
-                resEmail = caseAffiliate.getRespondentEmail();
703
-                boolean appEmailFlag = sendCaseEmail(caseApplication1, appEmail, caseAttachList);
704
-
705
-                SendMailRecord sendMailRecord = new SendMailRecord();
706
-                sendMailRecord.setCaseId(id);
707
-                sendMailRecord.setMailAddress(appEmail);
708
-                sendMailRecord.setMailContent("您好,审核后的调解书在附件中请查阅");
709
-//        sendMailRecord.setMailContent("您好,您的{"+caseApplication1.getCaseNum()+"}案件,审核后的裁决书在附件中请查阅");
710
-                sendMailRecord.setMailName("签署后的调解书");
711
-                sendMailRecord.setSendTime(new Date());
712
-                sendMailRecord.setCreateBy(SecurityUtils.getUsername());
713
-                if (appEmailFlag) {
714
-                    sendMailRecord.setSendStatus(1);
715
-                } else {
716
-                    sendMailRecord.setSendStatus(0);
717
-                }
718
-                sendMailRecordMapper.saveSendMailRecord(sendMailRecord);
719
-
720
-                boolean resEmailFlag = sendCaseEmail(caseApplication1, resEmail, caseAttachList);
721
-
722
-                SendMailRecord sendMailRecord1 = new SendMailRecord();
723
-                sendMailRecord1.setCaseId(id);
724
-                sendMailRecord1.setMailAddress(resEmail);
725
-//        sendMailRecord.setMailContent("您好,您的{"+caseApplication1.getCaseNum()+"}案件,审核后的裁决书在附件中请查阅");
726
-                sendMailRecord1.setMailContent("您好,审核后的调解书在附件中请查阅");
727
-                sendMailRecord1.setMailName("签署后的调解书");
728
-                sendMailRecord1.setSendTime(new Date());
729
-                sendMailRecord1.setCreateBy(SecurityUtils.getUsername());
730
-                if (resEmailFlag) {
731
-                    sendMailRecord1.setSendStatus(1);
732
-                }else {
733
-                    sendMailRecord1.setSendStatus(0);
418
+                // 获取案件相关人员
419
+                List<MsCaseAffiliate> affiliates = applicationService.selectAffliatesByCaseId(id);
420
+                if(CollectionUtil.isEmpty(affiliates)){
421
+                    return AjaxResult.error("未找到案件相关人员");
734 422
                 }
735
-                sendMailRecordMapper.saveSendMailRecord(sendMailRecord1);
736
-                if(!appEmailFlag&&!resEmailFlag){
737
-                    throw new ServiceException("调解书发送失败");
423
+                List<MsCaseAffiliate> oprratorList = affiliates.stream().filter(affiliate -> affiliate.getOperatorFlag() != null
424
+                                && affiliate.getOperatorFlag() == 1 && StrUtil.isNotEmpty(affiliate.getEmail()))
425
+                        .collect(Collectors.toList());
426
+                if(CollectionUtil.isEmpty(oprratorList)){
427
+                    return AjaxResult.error("未找到案件操作人员");
738 428
                 }
739
-                if(!appEmailFlag){
740
-                    throw new ServiceException("申请人调解书发送失败");
741
-                }
742
-                if(!resEmailFlag){
743
-                    throw new ServiceException("被申请人调解书发送失败");
429
+
430
+                for (MsCaseAffiliate affiliate : oprratorList) {
431
+                    if(affiliate.getRoleType()==null){
432
+                        continue;
433
+                    }
434
+                    boolean appEmailFlag = sendCaseEmail(caseApplication1, affiliate.getEmail(), caseAttachList);
435
+
436
+                    SendMailRecord sendMailRecord = new SendMailRecord();
437
+                    sendMailRecord.setCaseId(id);
438
+                    sendMailRecord.setMailAddress(affiliate.getEmail());
439
+                    sendMailRecord.setMailContent("您好,审核后的调解书在附件中请查阅");
440
+                    sendMailRecord.setMailName("签署后的调解书");
441
+                    sendMailRecord.setSendTime(new Date());
442
+                    sendMailRecord.setCreateBy(SecurityUtils.getUsername());
443
+                    if (appEmailFlag) {
444
+                        sendMailRecord.setSendStatus(1);
445
+                    } else {
446
+                        sendMailRecord.setSendStatus(0);
447
+                    }
448
+                    sendMailRecordMapper.saveSendMailRecord(sendMailRecord);
744 449
                 }
745 450
 
451
+//                if(!appEmailFlag&&!resEmailFlag){
452
+//                    throw new ServiceException("调解书发送失败");
453
+//                }
454
+//                if(!appEmailFlag){
455
+//                    throw new ServiceException("申请人调解书发送失败");
456
+//                }
457
+//                if(!resEmailFlag){
458
+//                    throw new ServiceException("被申请人调解书发送失败");
459
+//                }
460
+
746 461
                 CaseLogUtils.insertCaseLog(caseApplication1.getId(), currentFlow.getNodeId(), currentFlow.getCaseStatusName(),"");
747 462
 
748 463
             }
@@ -778,8 +493,10 @@ public class MsSignSealServiceImpl implements MsSignSealService {
778 493
 //            }
779 494
 //        }
780 495
         if (dto.getIsSignApply() != null && dto.getIsSignApply().intValue() == 1) {
781
-            caseAffiliate.setIsSignApply(1);
782
-            msCaseAffiliateMapper.updateByPrimaryKeySelective(caseAffiliate);
496
+            // todo 签收不要该字段
497
+            //    caseAffiliate.setIsSignApply(1);
498
+            // todo 签收不要该字段
499
+            //   msCaseAffiliateMapper.updateByPrimaryKeySelective(caseAffiliate);
783 500
 
784 501
             // 根据流程id查找下一个流程节点
785 502
             MsCaseFlow nextFlow = caseFlowMapper.nextFlow(caseApplicationselect.getCaseFlowId());
@@ -802,8 +519,10 @@ public class MsSignSealServiceImpl implements MsSignSealService {
802 519
 //        }
803 520
 
804 521
         if (dto.getIsSignRespon() != null && dto.getIsSignRespon().intValue() == 1) {
805
-            caseAffiliate.setIsSignRespon(1);
806
-            msCaseAffiliateMapper.updateByPrimaryKeySelective(caseAffiliate);
522
+            // todo 签收不要该字段
523
+//            caseAffiliate.setIsSignRespon(1);
524
+            // todo 签收不要该字段
525
+//            msCaseAffiliateMapper.updateByPrimaryKeySelective(caseAffiliate);
807 526
 
808 527
             // 根据流程id查找下一个流程节点
809 528
             MsCaseFlow nextFlow = caseFlowMapper.nextFlow(caseApplicationselect.getCaseFlowId());
@@ -811,6 +530,11 @@ public class MsSignSealServiceImpl implements MsSignSealService {
811 530
             caseApplicationselect.setCaseStatusName(nextFlow.getCaseStatusName());
812 531
             caseApplicationMapper.updateByPrimaryKeySelective(caseApplicationselect);
813 532
             CaseLogUtils.insertCaseLog(caseApplicationselect.getId(), currentFlow.getNodeId(), currentFlow.getCaseStatusName(),null);
533
+            CaseLogUtils.insertCaseLog(caseApplicationselect.getId(), 17, "结束", null);
534
+            // todo 被申请人签收结束对接北明,为调解成功状态
535
+            if(StrUtil.isEmpty(caseApplicationselect.getCaseSource())) {
536
+                applicationService.pushStatusToBM(caseApplicationselect, PushCaseStatusEnum.SUCCESS);
537
+            }
814 538
         }
815 539
 
816 540
         return AjaxResult.success("签收成功");
@@ -819,12 +543,29 @@ public class MsSignSealServiceImpl implements MsSignSealService {
819 543
 
820 544
     @Override
821 545
     public AjaxResult msCaseSignUrlApplyPC(MsSignSealDTO dto) throws EsignDemoException {
546
+        // todo
822 547
         Long caseId = dto.getCaseId();
823
-        MsCaseAffiliate caseAffiliate = msCaseAffiliateMapper.selectByPrimaryKey(caseId);
824
-        Integer organizeFlag = caseAffiliate.getOrganizeFlag();
548
+        //MsCaseAffiliate caseAffiliate = msCaseAffiliateMapper.selectByPrimaryKey(caseId);
549
+        List<MsCaseAffiliate> affiliates = applicationService.selectAffliatesByCaseId(caseId);
550
+        if(CollectionUtil.isEmpty(affiliates)){
551
+            return AjaxResult.error("未找到案件相关人员");
552
+        }
553
+        List<MsCaseAffiliate> operatorList = affiliates.stream().filter(msCaseAffiliate -> msCaseAffiliate.getOperatorFlag() != null
554
+                && msCaseAffiliate.getOperatorFlag() == 1
555
+                && StrUtil.isNotEmpty(msCaseAffiliate.getPhone())).collect(Collectors.toList());
556
+        Optional<MsCaseAffiliate> appOpt =null;
557
+        Optional<MsCaseAffiliate> resOpt =null;
558
+        if(CollectionUtil.isNotEmpty(operatorList)){
559
+           appOpt = operatorList.stream().filter(msCaseAffiliate -> msCaseAffiliate.getRoleType() != null
560
+                            && (msCaseAffiliate.getRoleType() == 1 || msCaseAffiliate.getRoleType() == 2))
561
+                    .findFirst();
562
+            resOpt = operatorList.stream().filter(msCaseAffiliate -> msCaseAffiliate.getRoleType() != null
563
+                            && (msCaseAffiliate.getRoleType() == 3 || msCaseAffiliate.getRoleType() == 4))
564
+                    .findFirst();
565
+        }
825 566
 
826 567
         MsCaseApplication caseApplication = msCaseApplicationMapper.selectByPrimaryKey(caseId);
827
-
568
+        Integer organizeFlag = caseApplication.getOrganizeFlag();
828 569
         SysUser user = new SysUser();
829 570
         Long userId = SecurityUtils.getUserId();
830 571
         user.setUserId(userId);
@@ -836,6 +577,9 @@ public class MsSignSealServiceImpl implements MsSignSealService {
836 577
         }
837 578
         List<String> roleNames = allSysRole.stream().map(SysRole::getRoleName).collect(Collectors.toList());
838 579
         if(roleNames.contains("申请人")){
580
+            if(appOpt==null || !appOpt.isPresent()){
581
+                return AjaxResult.error("未找到案件申请操作人");
582
+            }
839 583
             SealSignRecord sealSignRecordres = new SealSignRecord();
840 584
             MsSealSignRecord mssealSignRecord = new MsSealSignRecord();
841 585
             mssealSignRecord.setCaseAppliId(caseId);
@@ -844,19 +588,8 @@ public class MsSignSealServiceImpl implements MsSignSealService {
844 588
                 String signFlowid = sealSignRecords.get(0).getSignFlowId();
845 589
                 if(organizeFlag!=null){
846 590
                     SealSignRecord sealSignRecord = new SealSignRecord();
847
-                    if(organizeFlag.intValue()==1){
848
-                        sealSignRecord.setPensonAccount(caseAffiliate.getContactTelphoneAgent());
849
-                        sealSignRecord.setPensonName(caseAffiliate.getNameAgent());
850
-                    }else {
851
-                        String nameAgent = caseAffiliate.getNameAgent();
852
-                        if(StringUtils.isNotBlank(nameAgent)){
853
-                            sealSignRecord.setPensonAccount(caseAffiliate.getContactTelphoneAgent());
854
-                            sealSignRecord.setPensonName(caseAffiliate.getNameAgent());
855
-                        }else {
856
-                            sealSignRecord.setPensonAccount(caseAffiliate.getApplicationPhone());
857
-                            sealSignRecord.setPensonName(caseAffiliate.getApplicationName());
858
-                        }
859
-                    }
591
+                    sealSignRecord.setPensonAccount(appOpt.get().getPhone());
592
+                    sealSignRecord.setPensonName(appOpt.get().getName());
860 593
                     sealSignRecord.setSignFlowid(signFlowid);
861 594
 
862 595
                     Gson gson = new Gson();
@@ -873,6 +606,9 @@ public class MsSignSealServiceImpl implements MsSignSealService {
873 606
 
874 607
 
875 608
         }else if(roleNames.contains("被申请人")){
609
+            if(resOpt==null || !resOpt.isPresent()){
610
+                return AjaxResult.error("未找到案件申请操作人");
611
+            }
876 612
             SealSignRecord sealSignRecordres = new SealSignRecord();
877 613
             MsSealSignRecord mssealSignRecord = new MsSealSignRecord();
878 614
             mssealSignRecord.setCaseAppliId(caseId);
@@ -880,7 +616,8 @@ public class MsSignSealServiceImpl implements MsSignSealService {
880 616
             if (sealSignRecords != null && sealSignRecords.size() > 0) {
881 617
                 String signFlowid = sealSignRecords.get(0).getSignFlowId();
882 618
                 SealSignRecord sealSignRecord = new SealSignRecord();
883
-                sealSignRecord.setPensonAccount(caseAffiliate.getRespondentPhone());
619
+                sealSignRecord.setPensonAccount(resOpt.get().getPhone());
620
+                sealSignRecord.setPensonName(resOpt.get().getName());
884 621
                 sealSignRecord.setSignFlowid(signFlowid);
885 622
 
886 623
                 Gson gson = new Gson();
@@ -927,95 +664,6 @@ public class MsSignSealServiceImpl implements MsSignSealService {
927 664
         return AjaxResult.success();
928 665
     }
929 666
 
930
-    @Override
931
-    public AjaxResult msCaseSignUrlResPC(MsSignSealDTO dto) throws EsignDemoException {
932
-        Long caseId = dto.getCaseId();
933
-        MsCaseAffiliate caseAffiliate = msCaseAffiliateMapper.selectByPrimaryKey(caseId);
934
-        SealSignRecord sealSignRecordres = new SealSignRecord();
935
-        MsSealSignRecord mssealSignRecord = new MsSealSignRecord();
936
-        mssealSignRecord.setCaseAppliId(caseId);
937
-        List<MsSealSignRecord> sealSignRecords = sealSignRecordMapper.selectSealSignRecord(mssealSignRecord);
938
-        if (sealSignRecords != null && sealSignRecords.size() > 0) {
939
-            String signFlowid = sealSignRecords.get(0).getSignFlowId();
940
-            SealSignRecord sealSignRecord = new SealSignRecord();
941
-            sealSignRecord.setPensonAccount(caseAffiliate.getRespondentPhone());
942
-            sealSignRecord.setSignFlowid(signFlowid);
943
-
944
-            Gson gson = new Gson();
945
-            EsignHttpResponse signUrl = SignAward.signUrl(sealSignRecord);
946
-            JsonObject signUrlJsonObject = gson.fromJson(signUrl.getBody(), JsonObject.class);
947
-            JsonObject signUrlData = signUrlJsonObject.getAsJsonObject("data");
948
-            String urlapply = signUrlData.get("shortUrl").getAsString();
949
-            sealSignRecordres.setSealUrl(urlapply);
950
-        }
951
-
952
-        return AjaxResult.success(sealSignRecordres);
953
-    }
954
-
955
-    @Override
956
-    public AjaxResult msCaseSignUrlApplyAPP(MsSignSealDTO dto) throws EsignDemoException {
957
-        Long caseId = dto.getCaseId();
958
-        MsCaseAffiliate caseAffiliate = msCaseAffiliateMapper.selectByPrimaryKey(caseId);
959
-        Integer organizeFlag = caseAffiliate.getOrganizeFlag();
960
-        SealSignRecord sealSignRecordres = new SealSignRecord();
961
-        MsSealSignRecord mssealSignRecord = new MsSealSignRecord();
962
-        mssealSignRecord.setCaseAppliId(caseId);
963
-        List<MsSealSignRecord> sealSignRecords = sealSignRecordMapper.selectSealSignRecord(mssealSignRecord);
964
-        if (sealSignRecords != null && sealSignRecords.size() > 0) {
965
-            String signFlowid = sealSignRecords.get(0).getSignFlowId();
966
-            if(organizeFlag!=null){
967
-                SealSignRecord sealSignRecord = new SealSignRecord();
968
-                if(organizeFlag.intValue()==1){
969
-                    sealSignRecord.setPensonAccount(caseAffiliate.getContactTelphoneAgent());
970
-                    sealSignRecord.setPensonName(caseAffiliate.getNameAgent());
971
-                }else {
972
-                    String nameAgent = caseAffiliate.getNameAgent();
973
-                    if(StringUtils.isNotBlank(nameAgent)){
974
-                        sealSignRecord.setPensonAccount(caseAffiliate.getContactTelphoneAgent());
975
-                        sealSignRecord.setPensonName(caseAffiliate.getNameAgent());
976
-                    }else {
977
-                        sealSignRecord.setPensonAccount(caseAffiliate.getApplicationPhone());
978
-                        sealSignRecord.setPensonName(caseAffiliate.getApplicationName());
979
-                    }
980
-                }
981
-                sealSignRecord.setSignFlowid(signFlowid);
982
-
983
-                Gson gson = new Gson();
984
-                EsignHttpResponse signUrl = SignAward.signUrlMediation(sealSignRecord);
985
-                JsonObject signUrlJsonObject = gson.fromJson(signUrl.getBody(), JsonObject.class);
986
-                JsonObject signUrlData = signUrlJsonObject.getAsJsonObject("data");
987
-                String urlapply = signUrlData.get("shortUrl").getAsString();
988
-                sealSignRecordres.setSealUrl(urlapply);
989
-            }
990
-        }
991
-        return AjaxResult.success(sealSignRecordres);
992
-
993
-    }
994
-
995
-    @Override
996
-    public AjaxResult msCaseSignUrlResAPP(MsSignSealDTO dto) throws EsignDemoException {
997
-        Long caseId = dto.getCaseId();
998
-        MsCaseAffiliate caseAffiliate = msCaseAffiliateMapper.selectByPrimaryKey(caseId);
999
-        SealSignRecord sealSignRecordres = new SealSignRecord();
1000
-        MsSealSignRecord mssealSignRecord = new MsSealSignRecord();
1001
-        mssealSignRecord.setCaseAppliId(caseId);
1002
-        List<MsSealSignRecord> sealSignRecords = sealSignRecordMapper.selectSealSignRecord(mssealSignRecord);
1003
-        if (sealSignRecords != null && sealSignRecords.size() > 0) {
1004
-            String signFlowid = sealSignRecords.get(0).getSignFlowId();
1005
-            SealSignRecord sealSignRecord = new SealSignRecord();
1006
-            sealSignRecord.setPensonAccount(caseAffiliate.getRespondentPhone());
1007
-            sealSignRecord.setSignFlowid(signFlowid);
1008
-
1009
-            Gson gson = new Gson();
1010
-            EsignHttpResponse signUrl = SignAward.signUrlMediation(sealSignRecord);
1011
-            JsonObject signUrlJsonObject = gson.fromJson(signUrl.getBody(), JsonObject.class);
1012
-            JsonObject signUrlData = signUrlJsonObject.getAsJsonObject("data");
1013
-            String urlapply = signUrlData.get("shortUrl").getAsString();
1014
-            sealSignRecordres.setSealUrl(urlapply);
1015
-        }
1016
-
1017
-        return AjaxResult.success(sealSignRecordres);
1018
-    }
1019 667
 
1020 668
     @Override
1021 669
     @Transactional(rollbackFor = Exception.class)
@@ -1187,12 +835,38 @@ public class MsSignSealServiceImpl implements MsSignSealService {
1187 835
                             String fileDownloadUrlnew = fileDownloadUrl.substring(1, fileDownloadUrl.length() - 1);
1188 836
                             boolean downLoadFile = FileTransformation.downLoadFileByUrl(fileDownloadUrlnew, resultFilePath);
1189 837
                             if (downLoadFile) {
838
+                                // 先删除已经存在的调解书
839
+                                if(StrUtil.isEmpty(application.getCaseSource())){
840
+                                    List<MsCaseAttach> existAttach = msCaseAttachMapper.listCaseAttachByCaseIdAndType(caseAppliId, AnnexTypeEnum.MEDIATE_BOOK.getCode());
841
+                                    if(CollectionUtil.isNotEmpty(existAttach)){
842
+                                        // todo 对接北明,同步案件状态,删除
843
+                                        for (MsCaseAttach msCaseAttach : existAttach) {
844
+                                            if(StrUtil.isEmpty(msCaseAttach.getOtherSysFileId())||StrUtil.isEmpty(msCaseAttach.getAnnexPath())){
845
+                                                continue;
846
+                                            }
847
+                                            beiMingInterfaceService.deleteAttachmentInfo(application.getCaseNum(), msCaseAttach.getOtherSysFileId(), FileUtil.getName(msCaseAttach.getAnnexPath()));
848
+                                        }
849
+                                    }
850
+                                }
851
+                                msCaseAttachMapper.deleteCaseAttachByCasedIdAndType(caseAppliId, AnnexTypeEnum.MEDIATE_BOOK.getCode());
1190 852
                                 MsCaseAttach caseAttach = new MsCaseAttach();
1191 853
                                 caseAttach.setCaseAppliId(caseAppliId);
1192
-                                caseAttach.setAnnexType(7);
854
+                                caseAttach.setAnnexType(AnnexTypeEnum.MEDIATE_BOOK.getCode());
1193 855
                                 caseAttach.setAnnexPath(savePath);
1194 856
                                 caseAttach.setAnnexName(saveName);
1195
-                                caseAttachMapper.updateCaseAttachBycaseid(caseAttach);
857
+                                caseAttachMapper.save(caseAttach);
858
+                                // todo 对接北明,调用上传附件接口
859
+                                if(StrUtil.isEmpty(caseApplicationselect.getCaseSource()) ) {
860
+                                        String templatePath = "/home/ruoyi" + savePath;
861
+                                        File file = new File(templatePath.replace("/profile", "/uploadPath"));
862
+                                        MsCaseFileInfo caseFileInfo = beiMingInterfaceService.pushAttachmentInfo(BMUserName, BMPassword, file, BMSyncSource, caseApplicationselect.getCaseNum(), AttachmentOperateTypeEnum.ADD);
863
+                                    // 更新附件表
864
+                                    if(caseFileInfo!=null && StrUtil.isNotEmpty(caseFileInfo.getFileId())){
865
+                                        caseAttach.setOtherSysFileId(caseFileInfo.getFileId());
866
+                                        msCaseAttachMapper.updateCaseAttachBycaseid(caseAttach);
867
+                                    }
868
+
869
+                                }
1196 870
                             }
1197 871
 
1198 872
                         }
@@ -1256,12 +930,38 @@ public class MsSignSealServiceImpl implements MsSignSealService {
1256 930
                                 String fileDownloadUrlnew = fileDownloadUrl.substring(1, fileDownloadUrl.length() - 1);
1257 931
                                 boolean downLoadFile = FileTransformation.downLoadFileByUrl(fileDownloadUrlnew, resultFilePath);
1258 932
                                 if (downLoadFile) {
933
+                                    // 先删除已经存在的调解书
934
+                                    if(StrUtil.isEmpty(application.getCaseSource())){
935
+                                        List<MsCaseAttach> existAttach = msCaseAttachMapper.listCaseAttachByCaseIdAndType(caseAppliId, AnnexTypeEnum.MEDIATE_BOOK.getCode());
936
+                                        if(CollectionUtil.isNotEmpty(existAttach)){
937
+                                            // todo 对接北明,同步案件状态,删除
938
+                                            for (MsCaseAttach msCaseAttach : existAttach) {
939
+                                                if(StrUtil.isEmpty(msCaseAttach.getOtherSysFileId())||StrUtil.isEmpty(msCaseAttach.getAnnexPath())){
940
+                                                    continue;
941
+                                                }
942
+                                                beiMingInterfaceService.deleteAttachmentInfo(application.getCaseNum(), msCaseAttach.getOtherSysFileId(), FileUtil.getName(msCaseAttach.getAnnexPath()));
943
+                                            }
944
+                                        }
945
+                                    }
946
+                                    msCaseAttachMapper.deleteCaseAttachByCasedIdAndType(caseAppliId, AnnexTypeEnum.MEDIATE_BOOK.getCode());
1259 947
                                     MsCaseAttach caseAttach = new MsCaseAttach();
1260 948
                                     caseAttach.setCaseAppliId(caseAppliId);
1261
-                                    caseAttach.setAnnexType(7);
949
+                                    caseAttach.setAnnexType(AnnexTypeEnum.MEDIATE_BOOK.getCode());
1262 950
                                     caseAttach.setAnnexPath(savePath);
1263 951
                                     caseAttach.setAnnexName(saveName);
1264
-                                    caseAttachMapper.updateCaseAttachBycaseid(caseAttach);
952
+                                    caseAttachMapper.save(caseAttach);
953
+                                    // todo 对接北明,调用上传附件接口
954
+                                    if(StrUtil.isEmpty(caseApplicationselect.getCaseSource()) ) {
955
+                                        String templatePath = "/home/ruoyi" + savePath;
956
+                                        File file = new File(templatePath.replace("/profile", "/uploadPath"));
957
+                                        MsCaseFileInfo caseFileInfo = beiMingInterfaceService.pushAttachmentInfo(BMUserName, BMPassword, file, BMSyncSource, caseApplicationselect.getCaseNum(), AttachmentOperateTypeEnum.ADD);
958
+                                        // 更新附件表
959
+                                        if(caseFileInfo!=null && StrUtil.isNotEmpty(caseFileInfo.getFileId())){
960
+                                            caseAttach.setOtherSysFileId(caseFileInfo.getFileId());
961
+                                            msCaseAttachMapper.updateCaseAttachBycaseid(caseAttach);
962
+                                        }
963
+
964
+                                    }
1265 965
                                 }
1266 966
 
1267 967
                             }
@@ -1322,12 +1022,39 @@ public class MsSignSealServiceImpl implements MsSignSealService {
1322 1022
                                 String fileDownloadUrlnew = fileDownloadUrl.substring(1, fileDownloadUrl.length() - 1);
1323 1023
                                 boolean downLoadFile = FileTransformation.downLoadFileByUrl(fileDownloadUrlnew, resultFilePath);
1324 1024
                                 if (downLoadFile) {
1025
+                                    // 先删除已经存在的调解书
1026
+                                    if(StrUtil.isEmpty(application.getCaseSource())){
1027
+                                        List<MsCaseAttach> existAttach = msCaseAttachMapper.listCaseAttachByCaseIdAndType(caseAppliId, AnnexTypeEnum.MEDIATE_BOOK.getCode());
1028
+                                        if(CollectionUtil.isNotEmpty(existAttach)){
1029
+                                            // todo 对接北明,同步案件状态,删除
1030
+                                            for (MsCaseAttach msCaseAttach : existAttach) {
1031
+                                                if(StrUtil.isEmpty(msCaseAttach.getOtherSysFileId())||StrUtil.isEmpty(msCaseAttach.getAnnexPath())){
1032
+                                                    continue;
1033
+                                                }
1034
+                                                beiMingInterfaceService.deleteAttachmentInfo(application.getCaseNum(), msCaseAttach.getOtherSysFileId(), FileUtil.getName(msCaseAttach.getAnnexPath()));
1035
+                                            }
1036
+                                        }
1037
+                                    }
1038
+                                    msCaseAttachMapper.deleteCaseAttachByCasedIdAndType(caseAppliId, AnnexTypeEnum.MEDIATE_BOOK.getCode());
1325 1039
                                     MsCaseAttach caseAttach = new MsCaseAttach();
1326 1040
                                     caseAttach.setCaseAppliId(caseAppliId);
1327 1041
                                     caseAttach.setAnnexType(7);
1328 1042
                                     caseAttach.setAnnexPath(savePath);
1329 1043
                                     caseAttach.setAnnexName(saveName);
1330
-                                    caseAttachMapper.updateCaseAttachBycaseid(caseAttach);
1044
+                                    caseAttachMapper.save(caseAttach);
1045
+                                    // todo 对接北明,调用上传附件接口
1046
+
1047
+                                    if(StrUtil.isEmpty(caseApplicationselect.getCaseSource()) ) {
1048
+                                        String templatePath = "/home/ruoyi" + savePath;
1049
+                                        File file = new File(templatePath.replace("/profile", "/uploadPath"));
1050
+                                        MsCaseFileInfo caseFileInfo = beiMingInterfaceService.pushAttachmentInfo(BMUserName, BMPassword, file, BMSyncSource, caseApplicationselect.getCaseNum(), AttachmentOperateTypeEnum.ADD);
1051
+
1052
+                                        // 更新附件表
1053
+                                        if(caseFileInfo!=null && StrUtil.isNotEmpty(caseFileInfo.getFileId())){
1054
+                                            caseAttach.setOtherSysFileId(caseFileInfo.getFileId());
1055
+                                            msCaseAttachMapper.updateCaseAttachBycaseid(caseAttach);
1056
+                                        }
1057
+                                    }
1331 1058
                                 }
1332 1059
 
1333 1060
                             }

+ 19
- 32
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/mscase/impl/VideoConferenceServiceImpl.java Ver arquivo

@@ -31,9 +31,6 @@ import com.tencentcloudapi.trtc.v20190722.TrtcClient;
31 31
 import com.tencentcloudapi.trtc.v20190722.models.*;
32 32
 import com.tencentyun.TLSSigAPIv2;
33 33
 import lombok.extern.slf4j.Slf4j;
34
-import org.apache.poi.xwpf.usermodel.XWPFDocument;
35
-import org.apache.poi.xwpf.usermodel.XWPFParagraph;
36
-import org.apache.poi.xwpf.usermodel.XWPFRun;
37 34
 import org.springframework.beans.factory.annotation.Autowired;
38 35
 import org.springframework.beans.factory.annotation.Value;
39 36
 import org.springframework.stereotype.Service;
@@ -42,18 +39,14 @@ import tk.mybatis.mapper.entity.Example;
42 39
 
43 40
 import javax.crypto.Mac;
44 41
 import javax.crypto.spec.SecretKeySpec;
45
-import java.io.File;
46
-import java.io.FileOutputStream;
47 42
 import java.io.IOException;
48 43
 import java.nio.file.Paths;
49
-import java.util.Base64;
50
-import java.util.Date;
51
-import java.util.List;
52
-import java.util.Map;
44
+import java.util.*;
53 45
 import java.util.stream.Collectors;
54 46
 
55 47
 import static com.ruoyi.common.core.domain.AjaxResult.success;
56
-import static com.ruoyi.common.utils.file.FileUploadUtils.*;
48
+import static com.ruoyi.common.utils.file.FileUploadUtils.getAbsoluteFile;
49
+import static com.ruoyi.common.utils.file.FileUploadUtils.getPathFileName;
57 50
 
58 51
 /**
59 52
  * @author wangqiong
@@ -373,18 +366,27 @@ public class VideoConferenceServiceImpl implements VideoConferenceService {
373 366
      * @return
374 367
      */
375 368
     @Override
376
-    public AjaxResult secretaryRoleByUserId(Long userId) {
377
-        List<SysRole> roles = roleMapper.selectRolePermissionByUserId(userId);
369
+    public AjaxResult secretaryRoleByUserId(Long userId, Long caseId) {
370
+        // 根据案件id查询案件
371
+        MsCaseApplication caseApplication = caseApplicationMapper.selectByPrimaryKey(caseId);
372
+        if(caseApplication==null){
373
+            return AjaxResult.error("案件不存在");
374
+        }
378 375
         JSONObject jsonObject = new JSONObject();
379 376
         boolean isSecretaryRole=false;
380
-        if(CollectionUtil.isNotEmpty(roles)){
381
-            for (SysRole role : roles) {
382
-                if("调解员".equals(role.getRoleName())){
383
-                    isSecretaryRole=true;
384
-                    break;
377
+        if(caseApplication.getMediatorId()!=null&& Objects.equals(userId, caseApplication.getMediatorId())){
378
+            // 是调解员
379
+            List<SysRole> roles = roleMapper.selectRolePermissionByUserId(userId);
380
+            if(CollectionUtil.isNotEmpty(roles)){
381
+                for (SysRole role : roles) {
382
+                    if("调解员".equals(role.getRoleName())){
383
+                        isSecretaryRole=true;
384
+                        break;
385
+                    }
385 386
                 }
386 387
             }
387 388
         }
389
+
388 390
         jsonObject.put("isSecretaryRole",isSecretaryRole);
389 391
         return success(jsonObject);
390 392
     }
@@ -424,21 +426,6 @@ public class VideoConferenceServiceImpl implements VideoConferenceService {
424 426
         }
425 427
     }
426 428
 
427
-    public static void main(String[] args) throws Exception{
428
-        String htmlContent = "<h1>wangwu</h1><p>喂喂喂</p><h1>zhangsan</h1><p>hello</p><h1>zhangsan</h1><p>我能听到你说话</p><h1>wangwu</h1><p>欧克</p><h1>wangwu</h1><p>关于XXX我有几点想说的,balalalalalal</p><h1>zhangsan</h1><p>看到回复的时刻双方都是华德福额外补充你下次u饿哦是那些二的河南省而很为难啊看的法国队哈哈哈哈哈哈哈哈哈</p> "; // HTML字符串
429
-        String outputFileName="D://output.docx";
430
-        XWPFDocument document = new XWPFDocument();
431
-        XWPFParagraph paragraph = document.createParagraph();
432
-        XWPFRun run = paragraph.createRun();
433
-        run.setText(htmlContent);
434
-        FileOutputStream out = new FileOutputStream(new File(outputFileName));
435
-        document.write(out);
436
-        out.close();
437
-        System.out.printf("生成调解笔录成功");
438
-
439
-
440
-
441
-    }
442 429
 
443 430
     /**
444 431
      * 将视频下载到本地

+ 15
- 0
ruoyi-system/src/main/resources/com/ruoyi/system/mapper/log/MsRequestLogMapper.xml Ver arquivo

@@ -0,0 +1,15 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
3
+<mapper namespace="com.ruoyi.system.mapper.log.MsRequestLogMapper">
4
+  <resultMap id="BaseResultMap" type="com.ruoyi.system.domain.entity.log.MsRequestLog">
5
+    <!--
6
+      WARNING - @mbg.generated
7
+    -->
8
+    <id column="id" jdbcType="BIGINT" property="id" />
9
+    <result column="status" jdbcType="BIGINT" property="status" />
10
+    <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
11
+    <result column="request_url" jdbcType="LONGVARCHAR" property="requestUrl" />
12
+    <result column="content" jdbcType="LONGVARCHAR" property="content" />
13
+    <result column="reason" jdbcType="LONGVARCHAR" property="reason" />
14
+  </resultMap>
15
+</mapper>

+ 12
- 0
ruoyi-system/src/main/resources/mapper/system/SysDeptMapper.xml Ver arquivo

@@ -21,6 +21,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
21 21
 		<result property="createTime" column="create_time" />
22 22
 		<result property="updateBy"   column="update_by"   />
23 23
 		<result property="updateTime" column="update_time" />
24
+		<result property="code" column="code" />
25
+		<result property="compLegalPerson" column="comp_legal_person" />
24 26
 	</resultMap>
25 27
 	
26 28
 	<sql id="selectDeptVo">
@@ -111,6 +113,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
111 113
  			<if test="email != null and email != ''">email,</if>
112 114
  			<if test="status != null">status,</if>
113 115
  			<if test="createBy != null and createBy != ''">create_by,</if>
116
+ 			<if test="code != null and code != ''">code,</if>
117
+ 			<if test="compLegalPerson != null and compLegalPerson != ''">comp_legal_person,</if>
114 118
  			create_time
115 119
  		)values(
116 120
  			<if test="deptId != null and deptId != 0">#{deptId},</if>
@@ -124,6 +128,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
124 128
  			<if test="email != null and email != ''">#{email},</if>
125 129
  			<if test="status != null">#{status},</if>
126 130
  			<if test="createBy != null and createBy != ''">#{createBy},</if>
131
+		   <if test="code != null and code != ''">#{code},</if>
132
+		   <if test="compLegalPerson != null and compLegalPerson != ''">#{compLegalPerson},</if>
127 133
  			sysdate()
128 134
  		);
129 135
 	</insert>
@@ -140,6 +146,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
140 146
 		email,
141 147
 		status,
142 148
 		create_by,
149
+		code,
150
+		comp_legal_person,
143 151
 		create_time
144 152
 		)values
145 153
 		<foreach item="item" index="index" collection="list" separator=",">
@@ -155,6 +163,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
155 163
 		#{item.email},
156 164
 		#{item.status},
157 165
 		#{item.createBy},
166
+		#{item.code},
167
+		#{item.compLegalPerson},
158 168
 		sysdate()
159 169
 		)
160 170
 		</foreach>;
@@ -174,6 +184,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
174 184
  			<if test="email != null">email = #{email},</if>
175 185
  			<if test="status != null and status != ''">status = #{status},</if>
176 186
  			<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
187
+ 			<if test="code != null and code != ''">code = #{code},</if>
188
+ 			<if test="compLegalPerson != null and compLegalPerson != ''">comp_legal_person = #{compLegalPerson},</if>
177 189
  			update_time = sysdate()
178 190
  		</set>
179 191
  		where dept_id = #{deptId}

+ 23
- 4
ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml Ver arquivo

@@ -125,7 +125,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
125 125
 	
126 126
 	<select id="selectUserByUserName" parameterType="String" resultMap="SysUserResult">
127 127
 	    <include refid="selectUserVo"/>
128
-		where u.user_name = #{userName} and u.del_flag = '0'
128
+		where u.user_name = #{userName} and u.del_flag = '0' limit 1
129 129
 	</select>
130 130
 	
131 131
 	<select id="selectUserById" parameterType="Long" resultMap="SysUserResult">
@@ -155,7 +155,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
155 155
 		select user_id, email from ms_sys_user where email = #{email} and del_flag = '0' limit 1
156 156
 	</select>
157 157
 	<select id="selectUserListByIds" resultMap="SysUserResult">
158
-		select u.user_id,  u.nick_name, u.user_name,u.id_card,u.specialty, u.phonenumber, u.remark from ms_sys_user u
158
+		select u.* from ms_sys_user u
159 159
 
160 160
 			<where>
161 161
 		<if test="idList != null and idList.size() > 0">
@@ -177,12 +177,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
177 177
 			left join ms_sys_role r on r.role_id = ur.role_id
178 178
 		where u.id_card = #{idCard} and u.del_flag = '0' and u.status='0' order by u.create_time limit 1
179 179
 	</select>
180
-	<select id="selectUserByPhone" parameterType="String" resultMap="SysUserResult">
180
+	<select id="selectUserByEmail" parameterType="String" resultMap="SysUserResult">
181 181
 		select u.*,ur.role_id
182 182
 			from ms_sys_user u
183 183
 			left join ms_sys_user_role ur on u.user_id = ur.user_id
184 184
 			left join ms_sys_role r on r.role_id = ur.role_id
185
-		where u.phonenumber = #{phone} and u.del_flag = '0' and u.status='0' order by u.create_time limit 1
185
+		where u.eamil = #{eamil} and u.del_flag = '0' and u.status='0' order by u.create_time limit 1
186 186
 	</select>
187 187
     <select id="selectByDeptIdAndRole" resultMap="SysUserResult">
188 188
 		select u.* from
@@ -204,6 +204,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
204 204
  			<if test="idCard != null and idCard != ''">id_card,</if>
205 205
  			<if test="idType != null ">id_type,</if>
206 206
  			<if test="nationality != null ">nationality,</if>
207
+ 			<if test="birth != null  ">birth,</if>
208
+ 			<if test="home != null and home != '' ">home,</if>
209
+ 			<if test="address != null and address != '' ">address,</if>
207 210
  			<if test="email != null and email != ''">email,</if>
208 211
  			<if test="avatar != null and avatar != ''">avatar,</if>
209 212
  			<if test="phonenumber != null and phonenumber != ''">phonenumber,</if>
@@ -222,6 +225,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
222 225
             <if test="idCard != null and idCard != ''">#{idCard},</if>
223 226
             <if test="idType != null ">#{idType},</if>
224 227
             <if test="nationality != null ">#{nationality},</if>
228
+            <if test="birth != null  ">#{birth},</if>
229
+            <if test="home != null and home != '' ">#{home},</if>
230
+            <if test="address != null and address != '' ">#{address},</if>
225 231
             <if test="email != null and email != ''">#{email},</if>
226 232
             <if test="avatar != null and avatar != ''">#{avatar},</if>
227 233
             <if test="phonenumber != null and phonenumber != ''">#{phonenumber},</if>
@@ -240,6 +246,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
240 246
        user_name,
241 247
        nick_name,
242 248
        id_card,
249
+       id_type,
250
+       nationality,
251
+       birth,
252
+       home,
253
+       address,
243 254
        email,
244 255
        avatar,
245 256
        phonenumber,
@@ -257,6 +268,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
257 268
        #{item.userName},
258 269
        #{item.nickName},
259 270
        #{item.idCard},
271
+       #{item.idType},
272
+       #{item.nationality},
273
+       #{item.birth},
274
+       #{item.home},
275
+       #{item.address},
260 276
        #{item.email},
261 277
        #{item.avatar},
262 278
        #{item.phonenumber},
@@ -280,6 +296,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
280 296
            <if test="idCard != null and idCard != ''">id_card = #{idCard},</if>
281 297
            <if test="idType != null">id_type = #{idType},</if>
282 298
            <if test="nationality != null">nationality = #{nationality},</if>
299
+           <if test="birth != null  ">birth = #{birth},</if>
300
+           <if test="home != null and home != '' ">home = #{home},</if>
301
+           <if test="address != null and address != '' ">address = #{address},</if>
283 302
            <if test="email != null ">email = #{email},</if>
284 303
            <if test="phonenumber != null ">phonenumber = #{phonenumber},</if>
285 304
            <if test="sex != null and sex != ''">sex = #{sex},</if>

+ 5
- 1
ruoyi-system/src/main/resources/mapper/system/SysUserRoleMapper.xml Ver arquivo

@@ -16,7 +16,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
16 16
 	<select id="countUserRoleByRoleId" resultType="Integer">
17 17
 	    select count(1) from ms_sys_user_role where role_id=#{roleId}  
18 18
 	</select>
19
-	
19
+	<select id="selectRoleIdsByUserId" resultType="java.lang.Long">
20
+		select role_id from ms_sys_user_role where user_id=#{userId}
21
+	</select>
22
+
23
+
20 24
 	<delete id="deleteUserRole" parameterType="Long">
21 25
  		delete from ms_sys_user_role where user_id in
22 26
  		<foreach collection="array" item="userId" open="(" separator="," close=")">

+ 69
- 23
ruoyi-system/src/main/resources/mapper/wisdomarbitrate/mscase/MsCaseAffiliateMapper.xml Ver arquivo

@@ -1,27 +1,73 @@
1 1
 <?xml version="1.0" encoding="UTF-8"?>
2 2
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
3 3
 <mapper namespace="com.ruoyi.wisdomarbitrate.mapper.mscase.MsCaseAffiliateMapper">
4
-  <resultMap id="BaseResultMap" type="com.ruoyi.wisdomarbitrate.domain.entity.mscase.MsCaseAffiliate">
5
-    <!--
6
-      WARNING - @mbg.generated
7
-    -->
8
-    <id column="case_appli_id" jdbcType="BIGINT" property="caseAppliId" />
9
-    <result column="application_organ_id" jdbcType="VARCHAR" property="applicationOrganId" />
10
-    <result column="application_organ_name" jdbcType="VARCHAR" property="applicationOrganName" />
11
-    <result column="credit_code" jdbcType="VARCHAR" property="creditCode" />
12
-    <result column="comp_legal_person" jdbcType="VARCHAR" property="compLegalPerson" />
13
-    <result column="applicant_home" jdbcType="VARCHAR" property="applicantHome" />
14
-    <result column="applicant_address" jdbcType="VARCHAR" property="applicantAddress" />
15
-    <result column="name_agent" jdbcType="VARCHAR" property="nameAgent" />
16
-    <result column="contact_telphone_agent" jdbcType="VARCHAR" property="contactTelphoneAgent" />
17
-    <result column="agent_email" jdbcType="VARCHAR" property="agentEmail" />
18
-    <result column="applicant_track_num" jdbcType="VARCHAR" property="applicantTrackNum" />
19
-    <result column="respondent_name" jdbcType="VARCHAR" property="respondentName" />
20
-    <result column="respondent_identity_num" jdbcType="VARCHAR" property="respondentIdentityNum" />
21
-    <result column="respondent_sex" jdbcType="VARCHAR" property="respondentSex" />
22
-    <result column="respondent_birth" jdbcType="TIMESTAMP" property="respondentBirth" />
23
-    <result column="respondent_home" jdbcType="VARCHAR" property="respondentHome" />
24
-    <result column="respondent_email" jdbcType="VARCHAR" property="respondentEmail" />
25
-    <result column="respondent_track_num" jdbcType="VARCHAR" property="respondentTrackNum" />
26
-  </resultMap>
4
+
5
+
6
+  <select id="listGroupConcat" resultType="com.ruoyi.wisdomarbitrate.domain.entity.mscase.MsCaseAffiliate">
7
+    select
8
+      a.case_appli_id caseAppliId,
9
+      u.nickName name,
10
+      u.id_type idType,
11
+      r.role_name roleName,
12
+      GROUP_CONCAT( DISTINCT CASE WHEN c.organize_flag = 0 THEN u.nick_name ELSE d.dept_name END ) AS name,
13
+    (select GROUP_CONCAT( DISTINCT u1.nick_name ) FROM
14
+
15
+     ms_case_affiliate a1
16
+    LEFT JOIN ms_sys_user u1 ON u1.user_id = a1.user_id
17
+      LEFT JOIN ms_sys_user_role ur1 ON u1.user_id = ur1.user_id
18
+      LEFT JOIN ms_sys_role r1 ON r1.role_id = ur1.role_id
19
+    where a.case_appli_id = a1.case_appli_id and (r1.role_name='被申请人' )
20
+
21
+    group by a1.case_appli_id) resName
22
+
23
+    FROM
24
+        ms_case_application c
25
+        JOIN ms_case_affiliate a ON c.id = a.case_appli_id
26
+        LEFT JOIN ms_sys_user u ON u.user_id = a.user_id
27
+        LEFT JOIN ms_sys_user_role ur ON u.user_id = ur.user_id
28
+        LEFT JOIN ms_sys_role r ON r.role_id = ur.role_id
29
+        LEFT JOIN ms_sys_dept d ON d.dept_id = a.applicant_dept_id
30
+    <where>
31
+        (r.role_name='申请人' )
32
+      <if test="caseIds != null and caseIds.size() > 0">
33
+        and a.case_appli_id in
34
+        <foreach item="caseId" index="index" collection="caseIds" open="(" separator="," close=")">
35
+          #{caseId}
36
+        </foreach>
37
+      </if>
38
+    </where>
39
+    group by a.case_appli_id
40
+  </select>
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
44
+        FROM
45
+            ms_case_application c
46
+                JOIN ms_case_affiliate a ON a.case_appli_id=#{id} and c.id = a.case_appli_id
47
+                LEFT JOIN ms_sys_user u ON u.user_id = a.user_id
48
+                LEFT JOIN ms_sys_user_role ur ON u.user_id = ur.user_id
49
+                LEFT JOIN ms_sys_role r ON r.role_id = ur.role_id
50
+                LEFT JOIN ms_sys_dept d ON d.dept_id = a.applicant_dept_id
51
+        where  c.id = #{id}
52
+        GROUP BY a.id
53
+    </select>
54
+    <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
57
+        FROM
58
+            ms_case_application c
59
+                JOIN ms_case_affiliate a ON  c.id = a.case_appli_id
60
+                LEFT JOIN ms_sys_user u ON u.user_id = a.user_id
61
+                LEFT JOIN ms_sys_user_role ur ON u.user_id = ur.user_id
62
+                LEFT JOIN ms_sys_role r ON r.role_id = ur.role_id
63
+                LEFT JOIN ms_sys_dept d ON d.dept_id = a.applicant_dept_id
64
+        <where>
65
+            <if test="caseIds != null and caseIds.size() > 0">
66
+                and a.case_appli_id in
67
+                <foreach item="caseId" index="index" collection="caseIds" open="(" separator="," close=")">
68
+                    #{caseId}
69
+                </foreach>
70
+            </if>
71
+        </where>
72
+    </select>
27 73
 </mapper>

+ 109
- 0
ruoyi-system/src/main/resources/mapper/wisdomarbitrate/mscase/MsCaseApplicationMapper.xml Ver arquivo

@@ -34,7 +34,56 @@
34 34
     <result column="mediation_agreement" jdbcType="LONGVARCHAR" property="mediationAgreement" />
35 35
     <result column="is_reconci" jdbcType="INTEGER" property="isReconci" />
36 36
   </resultMap>
37
+  <sql id="SELECT_LIST_QUERY">
38
+    FROM
39
+    ms_case_application c
40
+    JOIN ms_case_affiliate a ON c.id = a.case_appli_id
41
+    LEFT JOIN ms_sys_user u ON u.user_id = a.user_id
42
+    LEFT JOIN ms_sys_user u1 ON u1.user_id = c.mediator_id
43
+    LEFT JOIN ms_sys_user_role ur ON  u.user_id = ur.user_id or u1.user_id = ur.user_id
44
+    LEFT JOIN ms_sys_role r ON r.role_id = ur.role_id or r.role_id = ur.role_id
45
+    LEFT JOIN ms_sys_dept d ON d.dept_id = a.applicant_dept_id
46
+    <where>
47
+<!--      调解员角色和申请人,被申,代理人-->
48
+      <if test = 'req.mediatorId != null and req.userId!=null'>
49
+        AND (c.mediator_id = #{req.mediatorId} or a.user_id=#{req.userId})
50
+      </if>
51
+<!--      admin,财务,顾问,部门长查看所有案件,申请人,被申,代理人根据userId查-->
52
+      <if test = 'req.mediatorId == null and  req.userId != null'>
53
+        AND (a.user_id=#{req.userId} )
54
+      </if>
55
+<!--        根据角色查询-->
56
+      <if test='roleIds != null and roleIds.size() > 0 '>
57
+        and  r.role_id in
58
+        <foreach item='roleId' index='index' collection='roleIds' open='(' separator=',' close=')'>
59
+          #{roleId}
60
+        </foreach>
61
+      </if>
62
+<!--      角色相关的状态-->
63
+      <if test='caseFlowIds != null and caseFlowIds.size() > 0 '>
64
+        and  c.case_flow_id in
65
+        <foreach item='flowId' index='index' collection='caseFlowIds' open='(' separator=',' close=')'>
66
+          #{flowId}
67
+        </foreach>
68
+      </if>
69
+      <!--  案件状态id条件-->
70
+      <if test = 'req.caseFlowId != null'>
71
+        AND c.case_flow_id = #{req.caseFlowId}
72
+      </if>
73
+      <!--  案件编号-->
74
+      <if test = 'req.caseNum != null and req.caseNum != "" '>
75
+        AND c.case_num = #{req.caseNum}
76
+      </if>
77
+      <!--  时间-->
78
+      <if test = 'req.startTime != null and req.startTime != "" '>
79
+        and c.create_time &gt;= #{req.startTime}
80
+      </if>
81
+      <if test = 'req.endTime != null and req.endTime != "" '>
82
+        and c.create_time &lt;= #{req.endTime}
83
+      </if>
84
+    </where>
37 85
 
86
+  </sql>
38 87
   <select id="listMediator" resultMap="BaseResultMap">
39 88
     select mediator_id ,id ,case_status_name,case_flow_id from ms_case_application <where>
40 89
     <if test = 'userIds!=null and userIds.size()>0'>
@@ -50,4 +99,64 @@
50 99
       </if> -->
51 100
     </where>
52 101
     </select>
102
+
103
+
104
+
105
+  <select id="todoCount" resultType="com.ruoyi.wisdomarbitrate.domain.vo.mscase.CaseToDoCount">
106
+    SELECT c.case_flow_id caseFlowId,count(DISTINCT c.id) caseCount
107
+    <include refid="SELECT_LIST_QUERY"/>
108
+    group by c.case_flow_id
109
+  </select>
110
+  <select id="list" resultType="com.ruoyi.wisdomarbitrate.domain.vo.mscase.MsCaseApplicationVO">
111
+    select t.* from(
112
+    SELECT
113
+    c.id,c.media_result mediaResult,c.room_id roomId,0 AS pendingStatus,
114
+    c.case_flow_id caseFlowId,c.batch_number batchNumber,c.case_num caseNum,
115
+    u1.nick_name mediatorName,c.hear_date hearDate,c.case_status_name caseStatusName,c.create_time createTime,
116
+    c.mediation_method mediationMethod,
117
+    CASE c.mediation_method when 1 then '线上调解' when 2 then '线下调解' ELSE '' END mediationMethodName
118
+    <include refid="SELECT_LIST_QUERY"/>
119
+    GROUP BY
120
+    c.id
121
+    union
122
+    SELECT
123
+    c.id,c.media_result mediaResult,c.room_id roomId,1 AS pendingStatus,
124
+    c.case_flow_id caseFlowId,c.batch_number batchNumber,c.case_num caseNum,
125
+    u1.nick_name mediatorName,c.hear_date hearDate,c.case_status_name caseStatusName,c.create_time createTime,
126
+    c.mediation_method mediationMethod,
127
+    CASE c.mediation_method when 1 then '线上调解' when 2 then '线下调解' ELSE '' END mediationMethodName
128
+    FROM
129
+    ms_case_log_record r
130
+    join ms_case_application c on r.case_appli_id=c.id
131
+    JOIN ms_case_affiliate a ON c.id = a.case_appli_id
132
+    LEFT JOIN ms_sys_user u ON u.user_id = a.user_id
133
+    LEFT JOIN ms_sys_user u1 ON u1.user_id = c.mediator_id
134
+    LEFT JOIN ms_sys_dept d ON d.dept_id = a.applicant_dept_id
135
+    <where>
136
+      r.create_by=#{req.userName} and c.id not in ( SELECT c.id
137
+      <include refid="SELECT_LIST_QUERY"/>
138
+      )
139
+
140
+      <!--  案件状态id条件-->
141
+      <if test = 'req.caseFlowId != null'>
142
+        AND c.case_flow_id = #{req.caseFlowId}
143
+      </if>
144
+      <!--  案件编号-->
145
+      <if test = 'req.caseNum != null and req.caseNum != "" '>
146
+        AND c.case_num = #{req.caseNum}
147
+      </if>
148
+      <!--  时间-->
149
+      <if test = 'req.startTime != null and req.startTime != "" '>
150
+        and c.create_time &gt;= #{req.startTime}
151
+      </if>
152
+      <if test = 'req.endTime != null and req.endTime != "" '>
153
+        and c.create_time &lt;= #{req.endTime}
154
+      </if>
155
+
156
+    </where>
157
+    GROUP BY
158
+    c.id
159
+    ) t ORDER BY t.createTime desc,t.caseNum desc
160
+
161
+  </select>
53 162
 </mapper>

+ 4
- 0
ruoyi-system/src/main/resources/mapper/wisdomarbitrate/mscase/MsCaseAttachMapper.xml Ver arquivo

@@ -14,6 +14,7 @@
14 14
         <result property="useId"     column="use_id"    />
15 15
         <result property="useAccount"     column="use_account"    />
16 16
         <result property="onlyOfficeFileId"     column="only_office_file_id"    />
17
+        <result property="otherSysFileId"     column="other_sys_file_id"    />
17 18
     </resultMap>
18 19
     <insert id="save" useGeneratedKeys="true" keyProperty="annexId">
19 20
         INSERT INTO ms_case_attach (case_appli_id, annex_name, annex_path , annex_type,note,use_id,use_account,seal_status,only_office_file_id)
@@ -109,7 +110,9 @@
109 110
     <update id="updateCaseAttach" parameterType="com.ruoyi.wisdomarbitrate.domain.entity.mscase.MsCaseAttach">
110 111
         update ms_case_attach
111 112
         set
113
+        <if test="otherSysFileId != null and otherSysFileId != ''"> other_sys_file_id=#{otherSysFileId},</if>
112 114
         case_appli_id= #{caseAppliId}
115
+
113 116
         where annex_id = #{annexId}
114 117
     </update>
115 118
     <update id="batchUpdate">
@@ -125,6 +128,7 @@
125 128
         update ms_case_attach
126 129
         <set>
127 130
             <if test="annexName != null and annexName != ''">annex_name = #{annexName},</if>
131
+            <if test="otherSysFileId != null and otherSysFileId != ''"> other_sys_file_id=#{otherSysFileId},</if>
128 132
             <if test="annexPath != null and annexPath != ''">annex_path = #{annexPath}</if>
129 133
         </set>
130 134
         <where>