Преглед изворни кода

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

wangqiong123 пре 2 година
родитељ
комит
fbe9359595
100 измењених фајлова са 3388 додато и 765 уклоњено
  1. 11
    0
      ruoyi-admin/src/main/java/com/ruoyi/RuoYiApplication.java
  2. 3
    0
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/common/CommonController.java
  3. 26
    2
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysLoginController.java
  4. 15
    12
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysMenuController.java
  5. 70
    0
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/tool/TestApiController.java
  6. 23
    5
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/miniprogress/IdentityAuthenticationController.java
  7. 11
    0
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/miniprogress/WeChatUserController.java
  8. 4
    28
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/mscase/MsCaseApplicationController.java
  9. 1
    63
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/mscase/MsSignSealController.java
  10. 145
    2
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/mscase/MsVideoConferenceController.java
  11. 23
    7
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/sendrecord/SendMailRecordController.java
  12. 127
    0
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/sendrecord/ShortMessageController.java
  13. 55
    0
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/sms/SMSTemplateController.java
  14. 2
    2
      ruoyi-admin/src/main/resources/application-druid.yml
  15. 26
    15
      ruoyi-admin/src/main/resources/application.yml
  16. 6
    1
      ruoyi-common/pom.xml
  17. 25
    0
      ruoyi-common/src/main/java/com/ruoyi/common/config/RestTemplateConfig.java
  18. 15
    0
      ruoyi-common/src/main/java/com/ruoyi/common/constant/CacheConstants.java
  19. 14
    9
      ruoyi-common/src/main/java/com/ruoyi/common/constant/Constants.java
  20. 1
    1
      ruoyi-common/src/main/java/com/ruoyi/common/constant/UserConstants.java
  21. 26
    0
      ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SMSNotice.java
  22. 34
    0
      ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SMSNoticeDO.java
  23. 68
    5
      ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysDept.java
  24. 44
    0
      ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysUser.java
  25. 2
    0
      ruoyi-common/src/main/java/com/ruoyi/common/enums/AnnexTypeEnum.java
  26. 15
    0
      ruoyi-common/src/main/java/com/ruoyi/common/enums/AttachmentOperateTypeEnum.java
  27. 18
    0
      ruoyi-common/src/main/java/com/ruoyi/common/enums/DocumentTypeEnum.java
  28. 13
    0
      ruoyi-common/src/main/java/com/ruoyi/common/enums/PushCaseStatusEnum.java
  29. 64
    0
      ruoyi-common/src/main/java/com/ruoyi/common/enums/SMSStatusEnum.java
  30. 37
    20
      ruoyi-common/src/main/java/com/ruoyi/common/utils/EmailOutUtil.java
  31. 128
    0
      ruoyi-common/src/main/java/com/ruoyi/common/utils/EncryptUtils.java
  32. 1
    7
      ruoyi-common/src/main/java/com/ruoyi/common/utils/PdfUtils.java
  33. 0
    104
      ruoyi-common/src/main/java/com/ruoyi/common/utils/SmsUtils.java
  34. 22
    11
      ruoyi-common/src/main/java/com/ruoyi/common/utils/WordUtil.java
  35. 21
    44
      ruoyi-common/src/main/java/com/ruoyi/common/utils/file/SaaSAPIFileUtils.java
  36. 34
    4
      ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/SysLoginService.java
  37. 17
    10
      ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/SysPermissionService.java
  38. 18
    2
      ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/TokenService.java
  39. 16
    16
      ruoyi-system/pom.xml
  40. 44
    0
      ruoyi-system/src/main/java/com/ruoyi/system/domain/entity/flow/MsCaseFlowRoleSmsRelated.java
  41. 56
    0
      ruoyi-system/src/main/java/com/ruoyi/system/domain/entity/log/MsRequestLog.java
  42. 60
    0
      ruoyi-system/src/main/java/com/ruoyi/system/domain/entity/shortmessage/MeetingInfo.java
  43. 107
    0
      ruoyi-system/src/main/java/com/ruoyi/system/domain/entity/shortmessage/MsSendMailHistoryRecord.java
  44. 98
    0
      ruoyi-system/src/main/java/com/ruoyi/system/domain/entity/shortmessage/MsSmsSendHistoryRecord.java
  45. 28
    0
      ruoyi-system/src/main/java/com/ruoyi/system/domain/entity/sms/MsSmsSendHistoryRecordParam.java
  46. 33
    0
      ruoyi-system/src/main/java/com/ruoyi/system/domain/entity/sms/MsSmsSendRecordParam.java
  47. 38
    0
      ruoyi-system/src/main/java/com/ruoyi/system/domain/entity/sms/MsSmsTemplate.java
  48. 38
    0
      ruoyi-system/src/main/java/com/ruoyi/system/domain/entity/sms/MsSmsTemplateParam.java
  49. 39
    0
      ruoyi-system/src/main/java/com/ruoyi/system/domain/vo/flow/MsCaseFlowRoleSmsRelatedVO.java
  50. 13
    1
      ruoyi-system/src/main/java/com/ruoyi/system/domain/vo/flow/MsCaseFlowVO.java
  51. 7
    0
      ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysDeptMapper.java
  52. 6
    6
      ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysUserMapper.java
  53. 7
    0
      ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysUserRoleMapper.java
  54. 7
    0
      ruoyi-system/src/main/java/com/ruoyi/system/mapper/flow/MsCaseFlowRoleSmsRelatedMapper.java
  55. 7
    0
      ruoyi-system/src/main/java/com/ruoyi/system/mapper/log/MsRequestLogMapper.java
  56. 7
    0
      ruoyi-system/src/main/java/com/ruoyi/system/mapper/shortmessage/MeetingInfoMapper.java
  57. 7
    0
      ruoyi-system/src/main/java/com/ruoyi/system/mapper/shortmessage/MsSendMailHistoryRecordMapper.java
  58. 7
    0
      ruoyi-system/src/main/java/com/ruoyi/system/mapper/shortmessage/MsSmsSendHistoryRecordMapper.java
  59. 22
    0
      ruoyi-system/src/main/java/com/ruoyi/system/mapper/sms/MsSmsSendHistoryRecordParamMapper.java
  60. 22
    0
      ruoyi-system/src/main/java/com/ruoyi/system/mapper/sms/MsSmsSendRecordParamMapper.java
  61. 7
    0
      ruoyi-system/src/main/java/com/ruoyi/system/mapper/sms/MsSmsTemplateMapper.java
  62. 18
    0
      ruoyi-system/src/main/java/com/ruoyi/system/mapper/sms/MsSmsTemplateParamMapper.java
  63. 83
    0
      ruoyi-system/src/main/java/com/ruoyi/system/service/BeiMingInterface.java
  64. 17
    2
      ruoyi-system/src/main/java/com/ruoyi/system/service/ISysMenuService.java
  65. 3
    3
      ruoyi-system/src/main/java/com/ruoyi/system/service/ISysRoleService.java
  66. 14
    0
      ruoyi-system/src/main/java/com/ruoyi/system/service/MsRequestLogService.java
  67. 12
    1
      ruoyi-system/src/main/java/com/ruoyi/system/service/flow/CaseFlowService.java
  68. 137
    32
      ruoyi-system/src/main/java/com/ruoyi/system/service/flow/CaseFlowServiceImpl.java
  69. 391
    0
      ruoyi-system/src/main/java/com/ruoyi/system/service/impl/BeiMingInterfaceService.java
  70. 27
    0
      ruoyi-system/src/main/java/com/ruoyi/system/service/impl/MsRequestLogServiceImpl.java
  71. 22
    7
      ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDeptServiceImpl.java
  72. 39
    10
      ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysMenuServiceImpl.java
  73. 29
    18
      ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysRoleServiceImpl.java
  74. 64
    11
      ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserServiceImpl.java
  75. 12
    0
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/dto/miniprogress/IdentityAuthentication.java
  76. 11
    1
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/dto/sendrecord/SendMailRecord.java
  77. 29
    5
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/dto/sendrecord/SmsSendRecord.java
  78. 76
    93
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/entity/mscase/MsCaseAffiliate.java
  79. 19
    4
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/entity/mscase/MsCaseApplication.java
  80. 10
    0
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/entity/mscase/MsCaseAttach.java
  81. 32
    0
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/vo/mscase/MsCaseAffiliateBase.java
  82. 11
    0
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/vo/mscase/MsCaseAffiliateParent.java
  83. 32
    0
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/vo/mscase/MsCaseAffiliateVO.java
  84. 22
    1
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/vo/mscase/MsCaseApplicationReq.java
  85. 21
    2
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/vo/mscase/MsCaseApplicationVO.java
  86. 54
    0
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/vo/mscase/MsCaseFileInfo.java
  87. 35
    0
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/vo/mscase/MsCaseStatusInfo.java
  88. 41
    0
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/vo/shortmessage/MeetingInfoVO.java
  89. 33
    0
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/vo/shortmessage/ReSendMessageVO.java
  90. 23
    0
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/mscase/MsCaseAffiliateMapper.java
  91. 15
    153
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/mscase/MsCaseApplicationMapper.java
  92. 1
    0
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/mscase/MsCaseAttachMapper.java
  93. 25
    3
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/sendrecord/SendMailRecordMapper.java
  94. 9
    0
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/sendrecord/SmsRecordMapper.java
  95. 18
    12
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/dept/impl/DeptIdentifyServiceImpl.java
  96. 8
    2
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/miniprogress/IdentityAuthenticationService.java
  97. 8
    0
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/miniprogress/WeChatUserService.java
  98. 96
    8
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/miniprogress/impl/IdentityAuthenticationServiceImpl.java
  99. 50
    20
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/miniprogress/impl/WeChatUserServiceImpl.java
  100. 0
    0
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/mscase/MsCaseApplicationService.java

+ 11
- 0
ruoyi-admin/src/main/java/com/ruoyi/RuoYiApplication.java Прегледај датотеку

@@ -2,9 +2,11 @@ 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.SysRole;
5 6
 import com.ruoyi.common.core.domain.entity.SysUser;
6 7
 import com.ruoyi.common.core.redis.RedisCache;
7 8
 import com.ruoyi.common.utils.spring.SpringUtils;
9
+import com.ruoyi.system.mapper.SysRoleMapper;
8 10
 import com.ruoyi.system.mapper.SysUserMapper;
9 11
 import org.springframework.boot.SpringApplication;
10 12
 import org.springframework.boot.autoconfigure.SpringBootApplication;
@@ -47,5 +49,14 @@ public class RuoYiApplication
47 49
                 redisCache.setCacheObject(CacheConstants.USER_KEY+sysUser.getUserId(),sysUser);
48 50
             }
49 51
         }
52
+        // 初始化角色redis
53
+        SysRoleMapper roleMapper = SpringUtils.getBean(SysRoleMapper.class);
54
+        List<SysRole> roles = roleMapper.selectRoleList(new SysRole());
55
+        if(CollectionUtil.isNotEmpty(roles)){
56
+            for (SysRole role : roles) {
57
+                redisCache.setCacheObject(CacheConstants.ROLE_KEY+role.getRoleName(),role.getRoleId());
58
+            }
59
+        }
50 60
     }
61
+
51 62
 }

+ 3
- 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/common/CommonController.java Прегледај датотеку

@@ -23,6 +23,8 @@ import javax.servlet.http.HttpServletResponse;
23 23
 import java.util.ArrayList;
24 24
 import java.util.List;
25 25
 
26
+import static com.google.common.io.Files.getFileExtension;
27
+
26 28
 /**
27 29
  * 通用请求处理
28 30
  * 
@@ -116,6 +118,7 @@ public class CommonController
116 118
                 .annexType(annexType)
117 119
                 .useId(SecurityUtils.getUserId())
118 120
                 .useAccount(SecurityUtils.getUsername())
121
+                .suffix(getFileExtension(path))
119 122
                 .build();
120 123
         msCaseAttachMapper.save(caseAttach);
121 124
         return caseAttach.getAnnexId();

+ 26
- 2
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysLoginController.java Прегледај датотеку

@@ -5,9 +5,11 @@ import cn.hutool.crypto.digest.MD5;
5 5
 import com.ruoyi.common.constant.Constants;
6 6
 import com.ruoyi.common.core.domain.AjaxResult;
7 7
 import com.ruoyi.common.core.domain.entity.SysMenu;
8
+import com.ruoyi.common.core.domain.entity.SysRole;
8 9
 import com.ruoyi.common.core.domain.entity.SysUser;
9 10
 import com.ruoyi.common.core.domain.model.LoginBody;
10 11
 import com.ruoyi.common.utils.SecurityUtils;
12
+import com.ruoyi.common.utils.StringUtils;
11 13
 import com.ruoyi.framework.web.service.SysLoginService;
12 14
 import com.ruoyi.framework.web.service.SysPermissionService;
13 15
 import com.ruoyi.framework.web.service.TokenService;
@@ -22,6 +24,8 @@ import org.springframework.web.bind.annotation.PostMapping;
22 24
 import org.springframework.web.bind.annotation.RequestBody;
23 25
 import org.springframework.web.bind.annotation.RestController;
24 26
 
27
+import java.util.Arrays;
28
+import java.util.HashSet;
25 29
 import java.util.List;
26 30
 import java.util.Set;
27 31
 
@@ -83,11 +87,20 @@ public class SysLoginController {
83 87
     public AjaxResult getInfo() {
84 88
         SysUser user = SecurityUtils.getLoginUser().getUser();
85 89
         // 角色集合
86
-        Set<String> roles = permissionService.getRolePermission(user);
90
+        List<SysRole> roles = permissionService.getRolePermission(user);
91
+        Set<String> permsSet = new HashSet<>();
92
+        for (SysRole perm : roles)
93
+        {
94
+            if (StringUtils.isNotNull(perm))
95
+            {
96
+                permsSet.addAll(Arrays.asList(perm.getRoleKey().trim().split(",")));
97
+            }
98
+        }
99
+        user.setRoles(roles);
87 100
         // 权限集合
88 101
         Set<String> permissions = permissionService.getMenuPermission(user);
89 102
         //查询用户角色关联的案件状态
90
-        Set<Integer> caseStatus = caseFlowService.getCaseStatusIdByRoleKey(roles);
103
+        Set<Integer> caseStatus = caseFlowService.getCaseStatusIdByRoleKey(permsSet);
91 104
         AjaxResult ajax = AjaxResult.success();
92 105
         ajax.put("user", user);
93 106
         ajax.put("roles", roles);
@@ -116,6 +129,17 @@ public class SysLoginController {
116 129
         }
117 130
       return   loginService.loginSSO(loginBody);
118 131
 
132
+    }
133
+    /**对接BM,根据用户名查询token*/
134
+    @GetMapping("selectTokenByUserName")
135
+    public AjaxResult selectTokenByUserName( LoginBody loginBody){
136
+        if(StrUtil.isEmpty(loginBody.getUsername()) || StrUtil.isEmpty(loginBody.getTicket())
137
+                ){
138
+            return AjaxResult.error("参数错误");
139
+        }
140
+
141
+        return   loginService.selectTokenByUserName(loginBody);
142
+
119 143
     }
120 144
 
121 145
     public static void main(String[] args) {

+ 15
- 12
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysMenuController.java Прегледај датотеку

@@ -1,17 +1,5 @@
1 1
 package com.ruoyi.web.controller.system;
2 2
 
3
-import java.util.List;
4
-import org.springframework.beans.factory.annotation.Autowired;
5
-import org.springframework.security.access.prepost.PreAuthorize;
6
-import org.springframework.validation.annotation.Validated;
7
-import org.springframework.web.bind.annotation.DeleteMapping;
8
-import org.springframework.web.bind.annotation.GetMapping;
9
-import org.springframework.web.bind.annotation.PathVariable;
10
-import org.springframework.web.bind.annotation.PostMapping;
11
-import org.springframework.web.bind.annotation.PutMapping;
12
-import org.springframework.web.bind.annotation.RequestBody;
13
-import org.springframework.web.bind.annotation.RequestMapping;
14
-import org.springframework.web.bind.annotation.RestController;
15 3
 import com.ruoyi.common.annotation.Log;
16 4
 import com.ruoyi.common.constant.UserConstants;
17 5
 import com.ruoyi.common.core.controller.BaseController;
@@ -20,6 +8,12 @@ import com.ruoyi.common.core.domain.entity.SysMenu;
20 8
 import com.ruoyi.common.enums.BusinessType;
21 9
 import com.ruoyi.common.utils.StringUtils;
22 10
 import com.ruoyi.system.service.ISysMenuService;
11
+import org.springframework.beans.factory.annotation.Autowired;
12
+import org.springframework.security.access.prepost.PreAuthorize;
13
+import org.springframework.validation.annotation.Validated;
14
+import org.springframework.web.bind.annotation.*;
15
+
16
+import java.util.List;
23 17
 
24 18
 /**
25 19
  * 菜单信息
@@ -139,4 +133,13 @@ public class SysMenuController extends BaseController
139 133
         }
140 134
         return toAjax(menuService.deleteMenuById(menuId));
141 135
     }
136
+    /**
137
+     * 根据用户查询菜单权限字符
138
+     */
139
+   @GetMapping("/getMenuPermsByUser")
140
+    public AjaxResult getMenuPermsByUser()
141
+    {
142
+
143
+        return menuService.getMenuPermsByUser();
144
+    }
142 145
 }

+ 70
- 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/tool/TestApiController.java Прегледај датотеку

@@ -0,0 +1,70 @@
1
+package com.ruoyi.web.controller.tool;
2
+
3
+import com.alibaba.fastjson.JSON;
4
+import com.alibaba.fastjson.JSONObject;
5
+import com.ruoyi.common.annotation.Anonymous;
6
+import com.ruoyi.common.core.domain.AjaxResult;
7
+import com.ruoyi.common.enums.AttachmentOperateTypeEnum;
8
+import com.ruoyi.common.enums.DocumentTypeEnum;
9
+import com.ruoyi.common.enums.PushCaseStatusEnum;
10
+import com.ruoyi.system.service.impl.BeiMingInterfaceService;
11
+import com.ruoyi.wisdomarbitrate.domain.vo.mscase.MsCaseFileInfo;
12
+import com.ruoyi.wisdomarbitrate.domain.vo.mscase.MsCaseStatusInfo;
13
+import org.springframework.beans.factory.annotation.Autowired;
14
+import org.springframework.beans.factory.annotation.Value;
15
+import org.springframework.web.bind.annotation.GetMapping;
16
+import org.springframework.web.bind.annotation.RequestMapping;
17
+import org.springframework.web.bind.annotation.RestController;
18
+
19
+import java.io.File;
20
+
21
+import static com.ruoyi.common.utils.EncryptUtils.sm4Decrypt;
22
+
23
+@RestController
24
+@RequestMapping("/beiming/api")
25
+public class TestApiController {
26
+    @Autowired
27
+    BeiMingInterfaceService beiMingInterfaceService;
28
+    @Value("${beimingprivatekey}")
29
+    public String privateKey;
30
+
31
+    @GetMapping("/test")
32
+    @Anonymous
33
+    public AjaxResult selectCaseFlow() {
34
+        String token = beiMingInterfaceService.getApiToken("BWT_MEDIATION", "86251b190e3a40f3942v215d1762c663", System.currentTimeMillis());
35
+//         token = "f910e1441fc56e49d3f31396e8d9aa04228045815ee986a9587d7a5cb7312f9d11c7f80041745f38ec686ea1f819c8b8227f9c03196c6dd004f89215c4805c24355be4b57abeddb7b9d2cbda45fae74c49f4a83fb6496d84302ca8c07245786d682ecb68aed966fcbda3188b9c4d4376089471bb5aee371a62073b0ce15d72dccd6fbc8fd13957e2fb7aa018cb5937938bfc9773e570ac06ac633617cea8405759cf609c832074aaa03f972c0a6a93cde531da0d91d07770c037fdea1368ee5772941ba2a55ef155979d1ed8222faad92ed342530ef04f3746aa96499dee6ea4869ce46bd0dcfe7a69e7db49eb2aec388c47824c201b49825f24ffe82dde41b5";
36
+        System.out.println("toke:" + token);
37
+        //解密
38
+        if (token != null && !token.isEmpty()) {
39
+            JSONObject jsonObject = JSON.parseObject(token);
40
+            String tokenString = jsonObject.getString("data");
41
+            System.out.println("data信息:" + tokenString);
42
+            String tokenstr = sm4Decrypt(tokenString, privateKey);
43
+            System.out.println("解密后的字符串:" + tokenstr);
44
+            if (tokenstr != null && !tokenstr.isEmpty()) {
45
+                JSONObject tokenObject = JSON.parseObject(tokenstr);
46
+                String resultToken = tokenObject.getString("token");
47
+                MsCaseStatusInfo info = MsCaseStatusInfo.builder().caseNo("zc2024032700012").statusCode(PushCaseStatusEnum.MEDIATE.getCode()).caseClosureExplanation(PushCaseStatusEnum.MEDIATE.getName()).build();
48
+                JSONObject result = beiMingInterfaceService.submitCaseStatusInfo(resultToken, "zc2024032700012", "BWT_MEDIATION", info);
49
+                System.out.println("jieguo:" + result.toString());
50
+                if (result != null) {
51
+                    String data = result.getString("data");
52
+                    String datastr = sm4Decrypt(data, privateKey);
53
+                    System.out.println("最终解密后的字符串:" + datastr);
54
+                }
55
+            }
56
+        }
57
+        return AjaxResult.success();
58
+    }
59
+
60
+
61
+    @GetMapping("/testfile")
62
+    @Anonymous
63
+    public AjaxResult testfile() {
64
+//        File file = new File("D:/WorkDoc/TJ/File/证据1.png");
65
+        File file = new File("D:/WorkDoc/TJ/File/证据3.png");
66
+            MsCaseFileInfo jsonObject1 = beiMingInterfaceService.pushAttachmentInfo("BWT_MEDIATION", "86251b190e3a40f3942v215d1762c663", file, "BWT_MEDIATION", "zc2024032700012", AttachmentOperateTypeEnum.ADD, DocumentTypeEnum.EVEDENT_AGREEMENT);
67
+        System.out.println("fanhui:" + jsonObject1.toString());
68
+        return AjaxResult.success();
69
+    }
70
+}

+ 23
- 5
ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/miniprogress/IdentityAuthenticationController.java Прегледај датотеку

@@ -1,5 +1,6 @@
1 1
 package com.ruoyi.web.controller.wisdomarbitrate.miniprogress;
2 2
 
3
+import cn.hutool.core.util.StrUtil;
3 4
 import com.alibaba.fastjson.JSONObject;
4 5
 import com.ruoyi.common.annotation.Anonymous;
5 6
 import com.ruoyi.common.core.controller.BaseController;
@@ -8,10 +9,7 @@ import com.ruoyi.wisdomarbitrate.domain.dto.miniprogress.IdentityAuthentication;
8 9
 import com.ruoyi.wisdomarbitrate.service.miniprogress.IdentityAuthenticationService;
9 10
 import org.springframework.beans.factory.annotation.Autowired;
10 11
 import org.springframework.validation.annotation.Validated;
11
-import org.springframework.web.bind.annotation.PostMapping;
12
-import org.springframework.web.bind.annotation.RequestBody;
13
-import org.springframework.web.bind.annotation.RequestMapping;
14
-import org.springframework.web.bind.annotation.RestController;
12
+import org.springframework.web.bind.annotation.*;
15 13
 
16 14
 @RestController
17 15
 @RequestMapping("/identityAuthentication")
@@ -25,9 +23,26 @@ public class IdentityAuthenticationController extends BaseController {
25 23
     @Anonymous
26 24
     @PostMapping("/selectIdentityAuthenticaEIDtoken")
27 25
     public AjaxResult selectIdentityAuthenticaEIDtoken() {
28
-        JSONObject tokenResult = identityAuthenticationService.selectIdentityAuthenticaEIDtoken();
26
+        JSONObject tokenResult = identityAuthenticationService.selectIdentityAuthEIDToken(false);
29 27
         return success(tokenResult);
30 28
     }
29
+    /**
30
+     * 获取PC端EIDtoken
31
+     */
32
+    @Anonymous
33
+    @PostMapping("/selectPCIdentityAuthenticaEIDtoken")
34
+    public AjaxResult selectPCIdentityAuthenticaEIDtoken() {
35
+        JSONObject tokenResult = identityAuthenticationService.selectIdentityAuthEIDToken(true);
36
+        return success(tokenResult);
37
+    }
38
+    /**
39
+     * H5轮询获取E证通Token状态
40
+     */
41
+    @Anonymous
42
+    @GetMapping("/selectPCEIDtokenStatus")
43
+    public AjaxResult selectPCEIDtokenStatus(@RequestParam String eidToken) {
44
+        return identityAuthenticationService.selectPCEIDtokenStatus(eidToken);
45
+    }
31 46
 
32 47
     /**
33 48
      * 小程序人脸核身后查询身份认证结果
@@ -35,6 +50,9 @@ public class IdentityAuthenticationController extends BaseController {
35 50
     @Anonymous
36 51
     @PostMapping("/selectIdentityAuthenticaRespon")
37 52
     public AjaxResult selectIdentityAuthenticaRespon(@Validated @RequestBody IdentityAuthentication ientityAuthentication) {
53
+        if(StrUtil.isEmpty(ientityAuthentication.getEidToken())){
54
+            return error("EIDtoken不能为空");
55
+        }
38 56
         AjaxResult checkResult = identityAuthenticationService.selectIdentityAuthenticaRespon(ientityAuthentication);
39 57
         return checkResult;
40 58
     }

+ 11
- 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/miniprogress/WeChatUserController.java Прегледај датотеку

@@ -44,6 +44,17 @@ public class WeChatUserController extends BaseController {
44 44
         }
45 45
         return weChatUserService.sendCode(userVO);
46 46
     }
47
+    /**
48
+     * 获取邮箱验证码
49
+     * @param email
50
+     * @return
51
+     */
52
+    @Anonymous
53
+    @GetMapping("/sendEmailCode")
54
+    public AjaxResult sendEmailCode(  @RequestParam("email") String email)
55
+    {
56
+        return weChatUserService.sendEmailCode(email);
57
+    }
47 58
     @Anonymous
48 59
     @GetMapping("/roles")
49 60
     public AjaxResult roles()

+ 4
- 28
ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/mscase/MsCaseApplicationController.java Прегледај датотеку

@@ -10,7 +10,6 @@ import com.ruoyi.common.core.domain.AjaxResult;
10 10
 import com.ruoyi.common.core.page.TableDataInfo;
11 11
 import com.ruoyi.common.exception.EsignDemoException;
12 12
 import com.ruoyi.common.utils.IdCardUtils;
13
-import com.ruoyi.wisdomarbitrate.domain.dto.sendrecord.SmsSendRecord;
14 13
 import com.ruoyi.wisdomarbitrate.domain.entity.mscase.MsCaseApplication;
15 14
 import com.ruoyi.wisdomarbitrate.domain.entity.mscase.MsCaseAttach;
16 15
 import com.ruoyi.wisdomarbitrate.domain.vo.mscase.*;
@@ -73,11 +72,10 @@ public class MsCaseApplicationController extends BaseController {
73 72
     /**
74 73
      * 新增案件
75 74
      */
76
-    // todo 重复提交校验
77 75
     @PostMapping("/insert")
78 76
     public AjaxResult insert(@RequestBody MsCaseApplicationVO caseApplication )
79 77
     {
80
-        if(caseApplication.getAffiliate()==null||caseApplication.getAffiliate().getOrganizeFlag()==null){
78
+        if( caseApplication.getAffiliate()==null){
81 79
             error("参数校验失败");
82 80
         }
83 81
         AjaxResult ajaxResult = AjaxResult.success();
@@ -252,7 +250,7 @@ public class MsCaseApplicationController extends BaseController {
252 250
      * @return
253 251
      */
254 252
     @GetMapping("/listMediator")
255
-    public AjaxResult listMediator( @RequestParam(value = "caseAppliId",required = false) Long caseAppliId) {
253
+    public AjaxResult listMediator( @RequestParam(value = "caseAppliId",required = true) Long caseAppliId) {
256 254
         return caseApplicationService.listMediator(caseAppliId);
257 255
     }
258 256
     /**
@@ -312,7 +310,7 @@ public class MsCaseApplicationController extends BaseController {
312 310
      */
313 311
     @PostMapping("/mediation")
314 312
     public AjaxResult mediation(@RequestBody MsCaseApplicationReq req) throws EsignDemoException, InterruptedException {
315
-        if (req.getCaseFlowId() == null || req.getId() == null || req.getMediaResult()==null) {
313
+        if (req.getCaseFlowId() == null || req.getId() == null ) {
316 314
             return error("参数校验失败");
317 315
         }
318 316
 
@@ -344,19 +342,7 @@ public class MsCaseApplicationController extends BaseController {
344 342
 
345 343
         return caseApplicationService.updateTrialPen(attach);
346 344
     }
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 345
 
358
-        return caseApplicationService.confirmMediation(attach);
359
-    }
360 346
     /**
361 347
      * 获取userSign
362 348
      * @param userId
@@ -402,17 +388,7 @@ public class MsCaseApplicationController extends BaseController {
402 388
 
403 389
         return  success(videoService.reserveConferenceList(caseId));
404 390
     }
405
-    /**
406
-     * 查询短信发送记录
407
-     * @param smsSendRecord
408
-     * @return
409
-     */
410
-    @PostMapping("/smsRecord")
411
-    public TableDataInfo getSmsSendRecord(@RequestBody SmsSendRecord smsSendRecord){
412
-        startPage();
413
-        List<SmsSendRecord> list = caseApplicationService.getSmsSendRecord(smsSendRecord);
414
-        return getDataTable(list);
415
-    }
391
+
416 392
     /**
417 393
      * 保存onlyOffice在线编辑的文件
418 394
      * @param

+ 1
- 63
ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/mscase/MsSignSealController.java Прегледај датотеку

@@ -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
 }

+ 145
- 2
ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/mscase/MsVideoConferenceController.java Прегледај датотеку

@@ -1,17 +1,33 @@
1 1
 package com.ruoyi.web.controller.wisdomarbitrate.mscase;
2 2
 
3 3
 import cn.hutool.core.util.StrUtil;
4
+import com.alibaba.fastjson.JSONArray;
5
+import com.alibaba.fastjson.JSONObject;
4 6
 import com.ruoyi.common.annotation.Anonymous;
7
+import com.ruoyi.common.config.RuoYiConfig;
5 8
 import com.ruoyi.common.core.controller.BaseController;
6 9
 import com.ruoyi.common.core.domain.AjaxResult;
10
+import com.ruoyi.common.enums.AnnexTypeEnum;
11
+import com.ruoyi.common.utils.SecurityUtils;
12
+import com.ruoyi.common.utils.file.FileUploadUtils;
13
+import com.ruoyi.common.utils.file.FileUtils;
14
+import com.ruoyi.framework.config.ServerConfig;
15
+import com.ruoyi.wisdomarbitrate.domain.entity.mscase.MsCaseAttach;
7 16
 import com.ruoyi.wisdomarbitrate.domain.vo.mscase.MsReservedConferenceVO;
8 17
 import com.ruoyi.wisdomarbitrate.domain.vo.mscase.SendRoomNoMessageVO;
9 18
 import com.ruoyi.wisdomarbitrate.domain.vo.mscase.VideoCallBackVO;
19
+import com.ruoyi.wisdomarbitrate.mapper.mscase.MsCaseAttachMapper;
20
+import com.ruoyi.wisdomarbitrate.service.mscase.MsCaseApplicationService;
10 21
 import com.ruoyi.wisdomarbitrate.service.mscase.VideoConferenceService;
11 22
 import org.springframework.beans.factory.annotation.Autowired;
12 23
 import org.springframework.web.bind.annotation.*;
24
+import org.springframework.web.multipart.MultipartFile;
13 25
 
26
+import javax.servlet.http.HttpServletRequest;
14 27
 import javax.validation.Valid;
28
+import java.util.Objects;
29
+
30
+import static com.google.common.io.Files.getFileExtension;
15 31
 
16 32
 /**
17 33
  * 视频会议控制层
@@ -19,11 +35,18 @@ import javax.validation.Valid;
19 35
  * @Date 2024/01/8
20 36
  * @Version V1.0
21 37
  */
38
+@CrossOrigin(origins = "*")
22 39
 @RestController
23 40
 @RequestMapping("/video")
24 41
 public class MsVideoConferenceController extends BaseController {
25 42
     @Autowired
26 43
     private VideoConferenceService videoService;
44
+    @Autowired
45
+    private ServerConfig serverConfig;
46
+    @Autowired
47
+    private MsCaseAttachMapper msCaseAttachMapper;
48
+    @Autowired
49
+    private MsCaseApplicationService caseApplicationService;
27 50
     /**
28 51
      * 根据案件ID查询视频
29 52
      * @param caseId 案件id
@@ -34,8 +57,110 @@ public class MsVideoConferenceController extends BaseController {
34 57
 
35 58
         return videoService.videoList(caseId);
36 59
     }
60
+    /**
61
+     * 通用上传请求(单个)
62
+     * param officeFlag: 是否上传到onlyoffice,0-否,1-是
63
+     * param isMediaBook: 是否上调解书,1-是,其余为否
64
+     */
65
+    @PostMapping("/upload")
66
+    public AjaxResult uploadFile(@RequestParam("file") MultipartFile file, @RequestParam(value = "isMediaBook",required = false) Integer isMediaBook, @RequestParam("annexType") Integer annexType, @RequestParam(value = "officeFlag", required = false) Integer officeFlag,@RequestParam(value = "caseId",required = false) Long caseId) throws Exception
67
+    {
68
+        try
69
+        {
70
+
71
+            // 上传文件路径
72
+            String filePath = RuoYiConfig.getUploadPath();
73
+            // 上传并返回新文件名称
74
+            String fileName = FileUploadUtils.upload(filePath, file);
75
+            String suffix = getFileExtension(fileName);
76
+            if(StrUtil.isNotEmpty(suffix)&& suffix.contains("doc")){
77
+                // 上传到onlyoffice
78
+                officeFlag=1;
79
+            }
80
+            String url = serverConfig.getUrl() + fileName;
81
+            if(officeFlag != null && officeFlag == 1){
82
+                // officeFlag,fileName为annexPath
83
+                JSONArray jsonArray = caseApplicationService.uploadOnlyOffice(fileName,caseId);
84
+                if(jsonArray!=null && jsonArray.size() > 0) {
85
+                    // 先删除之前的附件
86
+                    if(Objects.equals(annexType, AnnexTypeEnum.MEDIATE_BOOK.getCode()) && caseId!=null) {
87
+                        msCaseAttachMapper.deleteCaseAttachByCasedIdAndType(caseId, annexType);
88
+                    }
89
+                    MsCaseAttach caseAttach=null;
90
+                    for (Object obj : jsonArray) {
91
+                        JSONObject jsonObject = (JSONObject) obj;
92
+                         caseAttach = MsCaseAttach.builder()
93
+                                .caseAppliId(caseId)
94
+                                .annexName(jsonObject.get("fileName")!=null?jsonObject.getString("fileName"):"")
95
+                                .annexType(annexType)
96
+                                .onlyOfficeFileId(jsonObject.getString("fileId"))
97
+                                .build();
98
+                         if(jsonObject.get("filePath")!=null){
99
+                             String officePath = jsonObject.getString("filePath");
100
+                             String replace = officePath.replace("/home/ruoyi/uploadPath/", "/profile/");
101
+                                 caseAttach.setAnnexPath(replace);
37 102
 
103
+                         }
104
+                         caseAttach.setSuffix( (getFileExtension(caseAttach.getAnnexPath())));
105
+                        msCaseAttachMapper.save(caseAttach);
106
+                    }
107
+                    if(caseAttach==null){
108
+                        return AjaxResult.error("上传失败");
109
+                    }
110
+                    AjaxResult ajax = AjaxResult.success();
111
+                    ajax.put("annexId", caseAttach.getAnnexId());
112
+                    ajax.put("annexType", annexType);
113
+               //     ajax.put("url", url);
114
+                    ajax.put("fileName", fileName);
115
+                    ajax.put("newFileName", FileUtils.getName(fileName));
116
+                    ajax.put("originalFilename", file.getOriginalFilename());
117
+                    return ajax;
118
+                }else {
119
+                    return AjaxResult.error("上传失败");
120
+                }
121
+            }else {
122
+                // 如果是调解书并且是pdf,则删除之前的在新增
123
+                if(isMediaBook != null && isMediaBook == 1 ){
124
+                    if(StrUtil.isNotEmpty(suffix)&&!suffix.equals("pdf")){
125
+                        return AjaxResult.error("请上传pdf格式文件");
126
+                    }
127
+                    annexType=AnnexTypeEnum.MEDIATE_BOOK_PDF.getCode();
128
+                    // 先删除之前的附件
129
+                    if(caseId!=null) {
130
+                        msCaseAttachMapper.deleteCaseAttachByCasedIdAndType(caseId, annexType);
131
+                    }
132
+                }
133
+                Long annexId = saveCaseAttach(annexType, fileName, file.getOriginalFilename(), caseId);
134
+                // 是否上传到onlyoffice
135
+                AjaxResult ajax = AjaxResult.success();
136
+                ajax.put("annexId", annexId);
137
+                ajax.put("annexType", annexType);
138
+                ajax.put("url", url);
139
+                ajax.put("fileName", fileName);
140
+                ajax.put("newFileName", FileUtils.getName(fileName));
141
+                ajax.put("originalFilename", file.getOriginalFilename());
142
+                return ajax;
143
+            }
144
+        }
145
+        catch (Exception e)
146
+        {
147
+            return AjaxResult.error(e.getMessage());
148
+        }
149
+    }
150
+    private Long saveCaseAttach(Integer annexType, String path, String originalFilename,Long caseId) {
151
+        MsCaseAttach caseAttach = MsCaseAttach.builder()
152
+                .annexName(originalFilename)
153
+                .caseAppliId(caseId)
154
+                .annexPath(path)
155
+                .annexType(annexType)
156
+                .useId(SecurityUtils.getUserId())
157
+                .useAccount(SecurityUtils.getUsername())
158
+                .suffix(getFileExtension(path))
159
+                .build();
38 160
 
161
+        msCaseAttachMapper.save(caseAttach);
162
+        return caseAttach.getAnnexId();
163
+    }
39 164
     /**
40 165
      * 从腾讯云下载文件到本地
41 166
      * @param
@@ -49,6 +174,13 @@ public class MsVideoConferenceController extends BaseController {
49 174
         }
50 175
         return success();
51 176
     }
177
+    @Anonymous
178
+    @PostMapping("/smsRollBack")
179
+    public AjaxResult smsRollBack(   @RequestBody String body, HttpServletRequest request) {
180
+       logger.info("短信回调======"+body);
181
+       videoService.smsRollBack(body,request);
182
+        return success();
183
+    }
52 184
     /**
53 185
      * 根据房间号绑定案件ID
54 186
      * @param
@@ -106,9 +238,20 @@ public class MsVideoConferenceController extends BaseController {
106 238
      */
107 239
     @Anonymous
108 240
     @GetMapping("secretaryRoleByUserId")
109
-    public AjaxResult secretaryRoleByUserId(   @RequestParam(value = "userId",required = true) Long userId) {
241
+    public AjaxResult secretaryRoleByUserId(   @RequestParam(value = "userId",required = true) Long userId,@RequestParam(value = "caseId",required = true) Long caseId) {
242
+
243
+        return  videoService.secretaryRoleByUserId(userId,caseId);
244
+    }
245
+    /**
246
+     * 根据案件id查询申请人/被申请人会议上传附件按钮权限
247
+     * @param caseId
248
+     * @return
249
+     */
250
+    @Anonymous
251
+    @GetMapping("selectRoleMenuByCaseId")
252
+    public AjaxResult selectRoleMenuByCaseId(  @RequestParam(value = "caseId",required = true) Long caseId) {
110 253
 
111
-        return  videoService.secretaryRoleByUserId(userId);
254
+        return  videoService.selectRoleMenuByCaseId(caseId);
112 255
     }
113 256
     /**
114 257
      * 根据html字符串转pdf并和案件关联

+ 23
- 7
ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/sendrecord/SendMailRecordController.java Прегледај датотеку

@@ -1,19 +1,18 @@
1 1
 package com.ruoyi.web.controller.wisdomarbitrate.sendrecord;
2 2
 
3 3
 import com.ruoyi.common.core.controller.BaseController;
4
+import com.ruoyi.common.core.domain.AjaxResult;
4 5
 import com.ruoyi.common.core.page.TableDataInfo;
5 6
 import com.ruoyi.wisdomarbitrate.domain.dto.sendrecord.SendMailRecord;
6 7
 import com.ruoyi.wisdomarbitrate.service.sendrecord.ISendMailRecordService;
7 8
 import org.springframework.beans.factory.annotation.Autowired;
8
-import org.springframework.web.bind.annotation.GetMapping;
9
-import org.springframework.web.bind.annotation.RequestMapping;
10
-import org.springframework.web.bind.annotation.RestController;
9
+import org.springframework.web.bind.annotation.*;
11 10
 
12 11
 import java.util.List;
13 12
 
14 13
 @RestController
15 14
 @RequestMapping("/sendMailRecord")
16
-public class SendMailRecordController  extends BaseController {
15
+public class SendMailRecordController extends BaseController {
17 16
     @Autowired
18 17
     private ISendMailRecordService sendMailRecordService;
19 18
 
@@ -21,13 +20,30 @@ public class SendMailRecordController  extends BaseController {
21 20
      * 查询发送邮件记录列表
22 21
      */
23 22
     @GetMapping("/list")
24
-    public TableDataInfo list(SendMailRecord sendMailRecord)
25
-    {
23
+    public TableDataInfo list(SendMailRecord sendMailRecord) {
26 24
         startPage();
27 25
         List<SendMailRecord> list = sendMailRecordService.selectSendMailRecordList(sendMailRecord);
28 26
         return getDataTable(list);
29 27
     }
30 28
 
29
+    /**
30
+     * 编辑邮件记录
31
+     */
32
+    @PostMapping("/update")
33
+    public AjaxResult update(@RequestBody SendMailRecord sendMailRecord) {
34
+        return sendMailRecordService.updateSendMailRecord(sendMailRecord);
35
+    }
31 36
 
32
-
37
+    /**
38
+     * 重新发送邮件记录
39
+     */
40
+    @PostMapping("/reSendMailRecord")
41
+    public AjaxResult reSendMailRecord(@RequestBody SendMailRecord sendMailRecord) {
42
+        Boolean aBoolean = sendMailRecordService.reSendMailRecord(sendMailRecord);
43
+        if (aBoolean) {
44
+            return AjaxResult.success("发送成功");
45
+        } else {
46
+            return AjaxResult.error("发送失败");
47
+        }
48
+    }
33 49
 }

+ 127
- 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/sendrecord/ShortMessageController.java Прегледај датотеку

@@ -0,0 +1,127 @@
1
+package com.ruoyi.web.controller.wisdomarbitrate.sendrecord;
2
+
3
+import cn.hutool.core.collection.CollectionUtil;
4
+import com.ruoyi.common.annotation.Anonymous;
5
+import com.ruoyi.common.core.controller.BaseController;
6
+import com.ruoyi.common.core.domain.AjaxResult;
7
+import com.ruoyi.common.core.domain.entity.SysUser;
8
+import com.ruoyi.common.core.domain.model.LoginUser;
9
+import com.ruoyi.common.core.page.TableDataInfo;
10
+import com.ruoyi.framework.web.service.TokenService;
11
+import com.ruoyi.system.domain.entity.shortmessage.MeetingInfo;
12
+import com.ruoyi.system.domain.entity.sms.MsSmsSendRecordParam;
13
+import com.ruoyi.system.domain.entity.sms.MsSmsTemplateParam;
14
+import com.ruoyi.system.mapper.SysUserMapper;
15
+import com.ruoyi.system.mapper.shortmessage.MeetingInfoMapper;
16
+import com.ruoyi.system.mapper.sms.MsSmsSendHistoryRecordParamMapper;
17
+import com.ruoyi.system.mapper.sms.MsSmsSendRecordParamMapper;
18
+import com.ruoyi.wisdomarbitrate.domain.dto.sendrecord.SmsSendRecord;
19
+import com.ruoyi.wisdomarbitrate.domain.vo.shortmessage.MeetingInfoVO;
20
+import com.ruoyi.wisdomarbitrate.domain.vo.shortmessage.ReSendMessageVO;
21
+import com.ruoyi.wisdomarbitrate.mapper.sendrecord.SmsRecordMapper;
22
+import com.ruoyi.wisdomarbitrate.service.shortmessage.ShortMessageService;
23
+import org.springframework.beans.BeanUtils;
24
+import org.springframework.beans.factory.annotation.Autowired;
25
+import org.springframework.web.bind.annotation.*;
26
+import tk.mybatis.mapper.entity.Example;
27
+
28
+import java.util.ArrayList;
29
+import java.util.Date;
30
+import java.util.List;
31
+
32
+@RestController
33
+@RequestMapping("/shortMessage")
34
+public class ShortMessageController extends BaseController {
35
+    @Autowired
36
+    private SmsRecordMapper smsRecordMapper;
37
+    @Autowired
38
+    private ShortMessageService shortMessageService;
39
+    @Autowired
40
+    MsSmsSendRecordParamMapper recordParamMapper;
41
+    @Autowired
42
+    MsSmsSendHistoryRecordParamMapper historyRecordParamMapper;
43
+
44
+    /**
45
+     * 查询短信发送记录
46
+     *
47
+     * @param smsSendRecord
48
+     * @return
49
+     */
50
+    @GetMapping("/recordList")
51
+    public TableDataInfo smsSendRecordList(SmsSendRecord smsSendRecord) {
52
+        startPage();
53
+        List<SmsSendRecord> list = shortMessageService.smsSendRecordList(smsSendRecord);
54
+        return getDataTable(list);
55
+    }
56
+
57
+    @Anonymous
58
+    @PostMapping("/updateSendContent")
59
+    public AjaxResult update(@RequestBody SmsSendRecord smsSendRecord) {
60
+        if (smsSendRecord == null || smsSendRecord.getId() == null || CollectionUtil.isEmpty(smsSendRecord.getTemplateParams())) {
61
+            return AjaxResult.error("参数校验失败");
62
+        }
63
+        // 查询当前版本记录
64
+        SmsSendRecord oldSendRecord = smsRecordMapper.selectById(smsSendRecord.getId());
65
+        smsSendRecord.setUpdateTime(new Date());
66
+        //  更新短信内容,先删除短信记录参数表
67
+        Example recordParamExam = new Example(MsSmsSendRecordParam.class);
68
+        recordParamExam.createCriteria().andEqualTo("smsRecordId", smsSendRecord.getId());
69
+        recordParamMapper.deleteByExample(recordParamExam);
70
+        // 新增短信记录参数表
71
+        List<MsSmsSendRecordParam> recordParams = new ArrayList<>();
72
+        for (MsSmsTemplateParam templateParam : smsSendRecord.getTemplateParams()) {
73
+            MsSmsSendRecordParam recordParam = new MsSmsSendRecordParam();
74
+            recordParam.setSmsRecordId(smsSendRecord.getId());
75
+            recordParam.setParamValue(templateParam.getParamValue());
76
+            recordParams.add(recordParam);
77
+        }
78
+        recordParamMapper.batchInsert(recordParams);
79
+        shortMessageService.insertShortMessageHistoryRecord(oldSendRecord, recordParams);
80
+        return AjaxResult.success();
81
+
82
+    }
83
+
84
+    /**
85
+     * 重新发送短信
86
+     */
87
+    @Anonymous
88
+    @PostMapping("/reSendShortMessage")
89
+    public AjaxResult reSendShortMessage(@RequestBody ReSendMessageVO reSendMessageVO) {
90
+        if (reSendMessageVO != null) {
91
+            AjaxResult result = shortMessageService.reSendShortMessage(reSendMessageVO);
92
+            return result;
93
+        }
94
+        return AjaxResult.error("参数缺失");
95
+    }
96
+
97
+    @Autowired
98
+    MeetingInfoMapper meetingInfoMapper;
99
+    @Autowired
100
+    SysUserMapper sysUserMapper;
101
+    @Autowired
102
+    private TokenService tokenService;
103
+
104
+    /**
105
+     * 查询UID好的密钥
106
+     */
107
+    @Anonymous
108
+    @GetMapping("/getMeetingInfo")
109
+    public Object getEncryptInfoByUid(@RequestParam(name = "authId", required = true) String authId) {
110
+        MeetingInfoVO result = new MeetingInfoVO();
111
+        if (authId != null) {
112
+            MeetingInfo meetingInfo = meetingInfoMapper.selectByPrimaryKey(authId);
113
+            if (meetingInfo != null && meetingInfo.getUserId() != null) {
114
+                BeanUtils.copyProperties(meetingInfo, result);
115
+                SysUser sysUser = sysUserMapper.selectUserById(meetingInfo.getUserId());
116
+                LoginUser loginUser = new LoginUser();
117
+                loginUser.setUserId(sysUser.getUserId());
118
+                loginUser.setUser(sysUser);
119
+                String token = tokenService.createVideoToken(loginUser, 120);
120
+//                String createToken = createToken(claims);
121
+                result.setToken(token);
122
+            }
123
+            return result;
124
+        }
125
+        return AjaxResult.error("查询失败");
126
+    }
127
+}

+ 55
- 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/sms/SMSTemplateController.java Прегледај датотеку

@@ -0,0 +1,55 @@
1
+package com.ruoyi.web.controller.wisdomarbitrate.sms;
2
+
3
+import com.ruoyi.common.core.controller.BaseController;
4
+import com.ruoyi.common.core.domain.AjaxResult;
5
+import com.ruoyi.common.core.page.TableDataInfo;
6
+import com.ruoyi.system.domain.entity.sms.MsSmsTemplate;
7
+import com.ruoyi.wisdomarbitrate.service.sms.SMSTemplateService;
8
+import org.springframework.beans.factory.annotation.Autowired;
9
+import org.springframework.web.bind.annotation.*;
10
+
11
+import java.util.List;
12
+
13
+/**
14
+ * 短信模板控制器
15
+ */
16
+@RestController
17
+@RequestMapping("/smsTemplate")
18
+public class SMSTemplateController extends BaseController {
19
+    @Autowired
20
+    private SMSTemplateService templateService;
21
+
22
+    /**
23
+     * 查询
24
+     * @param
25
+     * @return
26
+     */
27
+    @GetMapping("/page")
28
+    public TableDataInfo page( ){
29
+        startPage();
30
+        List<MsSmsTemplate> list = templateService.page();
31
+        return getDataTable(list);
32
+    }
33
+    /**
34
+     * 新增或者修改
35
+     * @param
36
+     * @return
37
+     */
38
+    @PostMapping("/insert")
39
+    public AjaxResult insert(@RequestBody MsSmsTemplate template){
40
+        return templateService.insert(template);
41
+    }
42
+    /**
43
+     * 删除
44
+     * @param
45
+     * @return
46
+     */
47
+    @PostMapping("/delete")
48
+    public AjaxResult delete(@RequestBody MsSmsTemplate template){
49
+        if(template.getId()==null){
50
+            return AjaxResult.warn("id不能为空");
51
+        }
52
+        return templateService.delete(template.getId());
53
+    }
54
+
55
+}

+ 2
- 2
ruoyi-admin/src/main/resources/application-druid.yml Прегледај датотеку

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

+ 26
- 15
ruoyi-admin/src/main/resources/application.yml Прегледај датотеку

@@ -18,7 +18,7 @@ ruoyi:
18 18
 # 开发环境配置
19 19
 server:
20 20
   # 测试环境6001,开发环境7001
21
-  port: 7001
21
+  port: 6001
22 22
   servlet:
23 23
     # 应用的访问路径
24 24
     context-path: /
@@ -72,8 +72,8 @@ spring:
72 72
     host: 121.40.189.20
73 73
     # 端口,默认为6379
74 74
     port: 6389
75
-    # 数据库索引
76
-    database: 0
75
+    # 数据库索引,测试环境1,正式环境0
76
+    database: 1
77 77
     # 密码
78 78
     password:
79 79
     # 连接超时时间
@@ -90,7 +90,7 @@ spring:
90 90
         max-wait: -1ms
91 91
   web:
92 92
     resources:
93
-      static-locations:  file:/home/ruoyi/
93
+      static-locations: file:/home/ruoyi/
94 94
   mail:
95 95
     host: smtp.163.com
96 96
     port: 25
@@ -121,7 +121,7 @@ token:
121 121
   # 令牌密钥
122 122
   secret: abcdefghijklmnopqrstuvwxyz
123 123
   # 令牌有效期(默认30分钟)
124
-  expireTime: 30
124
+  expireTime: 120
125 125
 
126 126
 # MyBatis配置
127 127
 mybatis:
@@ -172,7 +172,10 @@ elegent:
172 172
 identityAuthentication:
173 173
   credentialSecretId: AKID3xfHgroY4MQHvLXUXMwIQL1UjmbBX1Tv
174 174
   credentialSecretKey: INDrIXcT8YmomZBcsy0oNirnU0LTN4X7
175
+#  小程序端人脸核身商户id
175 176
   merchantId: 0NSJ2309281116194321
177
+#  pc端人脸核身商户id
178
+  pcMerchantId: 0NSJ2404231626029804
176 179
   privateKeyHexDecodeinfo: 4c3b311bf7b98969994e85928e069574a1e95777f24d1c510679cc3c2f460faf
177 180
 # 腾讯云即时通信相关配置
178 181
 imConfig:
@@ -196,17 +199,25 @@ signSealCallbackConfig:
196 199
   url: http://121.40.189.20:7001/mssignSeal/signSeaalCaseApplicaCallback
197 200
 #  onlyOffice系统url配置
198 201
 onlyOfficeConfig:
199
-#  url: http://172.16.0.254:9090/files/upload
202
+  #  url: http://172.16.0.254:9090/files/upload
200 203
   url: http://121.40.189.20:9090/files/upload
201
-#jodconverter:
202
-#  local:
203
-#    host: 121.40.189.20
204
+#  北明
205
+BMConfig:
206
+  userName: BWT_MEDIATION
207
+  password: 86251b190e3a40f3942v215d1762c663
208
+  syncSource: BWT_MEDIATION
209
+    #jodconverter:
210
+    #  local:
211
+    #    host: 121.40.189.20
204 212
     #暂时关闭预览,启动时会有点慢
205
-#    enabled: true
213
+    #    enabled: true
206 214
     #设置libreoffice主目录 linux地址如:/usr/lib64/libreoffice
207
-#    office-home: /usr/lib64/libreoffice/
208
-#    office-home: D:\app\libreOffice\
209
-    #开启多个libreoffice进程,每个端口对应一个进程
210
-#    port-numbers: 8100
211
-    #libreoffice进程重启前的最大进程数
215
+    #    office-home: /usr/lib64/libreoffice/
216
+  #    office-home: D:\app\libreOffice\
217
+  #开启多个libreoffice进程,每个端口对应一个进程
218
+  #    port-numbers: 8100
219
+  #libreoffice进程重启前的最大进程数
212 220
 #    max-tasks-per-process: 100
221
+beimingapihost: https://zj.odrcloud.cn
222
+beimingapiprefix: /onestop/sync
223
+beimingprivatekey: d7724e72c4be93196a35203e8379ded5

+ 6
- 1
ruoyi-common/pom.xml Прегледај датотеку

@@ -200,7 +200,7 @@
200 200
         <dependency>
201 201
             <groupId>com.tencentcloudapi</groupId>
202 202
             <artifactId>tencentcloud-sdk-java</artifactId>
203
-            <version>3.1.876</version>
203
+            <version>3.1.962</version>
204 204
         </dependency>
205 205
 
206 206
         <dependency>
@@ -283,6 +283,11 @@
283 283
             <groupId>org.apache.httpcomponents</groupId>
284 284
             <artifactId>httpclient</artifactId>
285 285
         </dependency>
286
+        <dependency>
287
+            <groupId>org.thymeleaf</groupId>
288
+            <artifactId>thymeleaf</artifactId>
289
+            <version>3.0.12.RELEASE</version>
290
+        </dependency>
286 291
 
287 292
 
288 293
     </dependencies>

+ 25
- 0
ruoyi-common/src/main/java/com/ruoyi/common/config/RestTemplateConfig.java Прегледај датотеку

@@ -0,0 +1,25 @@
1
+package com.ruoyi.common.config;
2
+
3
+import org.springframework.context.annotation.Bean;
4
+import org.springframework.context.annotation.Configuration;
5
+import org.springframework.http.client.ClientHttpRequestFactory;
6
+import org.springframework.http.client.SimpleClientHttpRequestFactory;
7
+import org.springframework.web.client.RestTemplate;
8
+
9
+@Configuration
10
+public class RestTemplateConfig {
11
+
12
+    @Bean
13
+    public RestTemplate restTemplate(ClientHttpRequestFactory factory){
14
+        return new RestTemplate(factory);
15
+    }
16
+
17
+    @Bean
18
+    public ClientHttpRequestFactory simpleClientHttpRequestFactory(){
19
+        SimpleClientHttpRequestFactory factory = new SimpleClientHttpRequestFactory();
20
+        factory.setReadTimeout(5000);//单位为ms
21
+        factory.setConnectTimeout(5000);//单位为ms
22
+        return factory;
23
+    }
24
+}
25
+

+ 15
- 0
ruoyi-common/src/main/java/com/ruoyi/common/constant/CacheConstants.java Прегледај датотеку

@@ -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
@@ -42,6 +47,7 @@ public class CacheConstants
42 47
      */
43 48
     public static final String PWD_ERR_CNT_KEY = "pwd_err_cnt:";
44 49
     public static final String  WE_CHAT_SMS_VERIFY_CODE_KEY="we_chat_sms_verify_code:";
50
+    public static final String  EMAIL_VERIFY_CODE_KEY="email_verify_code:";
45 51
     /**
46 52
      * 案件 redis key
47 53
      */
@@ -50,4 +56,13 @@ public class CacheConstants
50 56
      * 所有用户 redis key
51 57
      */
52 58
     public static final String USER_KEY = "user_key:";
59
+    /**
60
+     * 用户邮箱 redis key
61
+     */
62
+//    public static final String USER_EMAIL_KEY = "user_email_key:";
63
+    /**
64
+     * 角色 redis key
65
+     */
66
+    public static final String ROLE_KEY = "role_key:";
67
+
53 68
 }

+ 14
- 9
ruoyi-common/src/main/java/com/ruoyi/common/constant/Constants.java Прегледај датотеку

@@ -4,11 +4,10 @@ import io.jsonwebtoken.Claims;
4 4
 
5 5
 /**
6 6
  * 通用常量信息
7
- * 
7
+ *
8 8
  * @author ruoyi
9 9
  */
10
-public class Constants
11
-{
10
+public class Constants {
12 11
     /**
13 12
      * UTF-8 字符集
14 13
      */
@@ -71,7 +70,7 @@ public class Constants
71 70
      * 登录失败
72 71
      */
73 72
     public static final String LOGIN_FAIL = "Error";
74
- 
73
+
75 74
     /**
76 75
      * 验证码有效期(分钟)
77 76
      */
@@ -95,6 +94,10 @@ public class Constants
95 94
      * 令牌前缀
96 95
      */
97 96
     public static final String LOGIN_USER_KEY = "login_user_key";
97
+    /**
98
+     * 会议主键Id
99
+     */
100
+    public static final String MEETING_KEY = "meeting_key";
98 101
 
99 102
     /**
100 103
      * 用户ID
@@ -141,21 +144,23 @@ public class Constants
141 144
      */
142 145
     public static final String LOOKUP_LDAPS = "ldaps:";
143 146
     public static final String DEFAULT_PASSWORD = "123456";
144
-    public static final String SPLIT_COMMA =",";
147
+    // 英文逗号分隔符
148
+    public static final String SPLIT_COMMA = ",";
149
+    // 中文逗号分隔符
150
+    public static final String CN_SPLIT_COMMA = ",";
145 151
 
146 152
     /**
147 153
      * 自动识别json对象白名单配置(仅允许解析的包名,范围越小越安全)
148 154
      */
149
-    public static final String[] JSON_WHITELIST_STR = { "org.springframework", "com.ruoyi" };
155
+    public static final String[] JSON_WHITELIST_STR = {"org.springframework", "com.ruoyi"};
150 156
 
151 157
     /**
152 158
      * 定时任务白名单配置(仅允许访问的包名,如其他需要可以自行添加)
153 159
      */
154
-    public static final String[] JOB_WHITELIST_STR = { "com.ruoyi" };
160
+    public static final String[] JOB_WHITELIST_STR = {"com.ruoyi"};
155 161
 
156 162
     /**
157 163
      * 定时任务违规的字符
158 164
      */
159
-    public static final String[] JOB_ERROR_STR = { "java.net.URL", "javax.naming.InitialContext", "org.yaml.snakeyaml",
160
-            "org.springframework", "org.apache", "com.ruoyi.common.utils.file", "com.ruoyi.common.config" };
165
+    public static final String[] JOB_ERROR_STR = {"java.net.URL", "javax.naming.InitialContext", "org.yaml.snakeyaml", "org.springframework", "org.apache", "com.ruoyi.common.utils.file", "com.ruoyi.common.config"};
161 166
 }

+ 1
- 1
ruoyi-common/src/main/java/com/ruoyi/common/constant/UserConstants.java Прегледај датотеку

@@ -68,7 +68,7 @@ public class UserConstants
68 68
      * 用户名长度限制
69 69
      */
70 70
     public static final int USERNAME_MIN_LENGTH = 2;
71
-    public static final int USERNAME_MAX_LENGTH = 20;
71
+    public static final int USERNAME_MAX_LENGTH = 50;
72 72
 
73 73
     /**
74 74
      * 密码长度限制

+ 26
- 0
ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SMSNotice.java Прегледај датотеку

@@ -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 Прегледај датотеку

@@ -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
+}

+ 68
- 5
ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysDept.java Прегледај датотеку

@@ -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,68 @@ 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
+     * 住所
69
+     */
70
+    private String home;
71
+    /**
72
+     * 联系地址
73
+     */
74
+    private String address;
75
+    /**
76
+     *
77
+     * 国籍,0-国内,1-国外
78
+     */
79
+    private Integer nationality;
80
+
81
+    public String getAddress() {
82
+        return address;
83
+    }
84
+
85
+    public void setAddress(String address) {
86
+        this.address = address;
87
+    }
88
+
89
+    public Integer getNationality() {
90
+        return nationality;
91
+    }
92
+
93
+    public String getHome() {
94
+        return home;
95
+    }
96
+
97
+    public void setHome(String home) {
98
+        this.home = home;
99
+    }
100
+
101
+    public void setNationality(Integer nationality) {
102
+        this.nationality = nationality;
103
+    }
104
+
105
+    public String getCode() {
106
+        return code;
107
+    }
108
+
109
+    public void setCode(String code) {
110
+        this.code = code;
111
+    }
112
+
113
+    public String getCompLegalPerson() {
114
+        return compLegalPerson;
115
+    }
116
+
117
+    public void setCompLegalPerson(String compLegalPerson) {
118
+        this.compLegalPerson = compLegalPerson;
119
+    }
57 120
 
58 121
     public Integer getDeptType() {
59 122
         return deptType;

+ 44
- 0
ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysUser.java Прегледај датотеку

@@ -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
     }

+ 2
- 0
ruoyi-common/src/main/java/com/ruoyi/common/enums/AnnexTypeEnum.java Прегледај датотеку

@@ -21,6 +21,8 @@ public enum AnnexTypeEnum implements EnumsInterface {
21 21
     RES_PAYMENT_RECEIPT(9, "被申请人缴费单"),
22 22
     SEAL_PICTURE(10, "印章图片"),
23 23
     FLOW_SVG(11, "流程节点SVG"),
24
+    MEETING_FILE(12, "被申请人证据"),
25
+    MEDIATE_BOOK_PDF(13, "PDF调解书或和解协议"),
24 26
 
25 27
 
26 28
     ;

+ 15
- 0
ruoyi-common/src/main/java/com/ruoyi/common/enums/AttachmentOperateTypeEnum.java Прегледај датотеку

@@ -0,0 +1,15 @@
1
+package com.ruoyi.common.enums;
2
+
3
+import lombok.AllArgsConstructor;
4
+import lombok.Getter;
5
+
6
+/**
7
+ * 案件附件操作类型
8
+ */
9
+@AllArgsConstructor
10
+@Getter
11
+public enum AttachmentOperateTypeEnum {
12
+    ADD("ADD", "新增"), DEL("DEL", "删除"), UPD("UPD", "修改");
13
+    private String code;
14
+    private String name;
15
+}

+ 18
- 0
ruoyi-common/src/main/java/com/ruoyi/common/enums/DocumentTypeEnum.java Прегледај датотеку

@@ -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
+}

+ 13
- 0
ruoyi-common/src/main/java/com/ruoyi/common/enums/PushCaseStatusEnum.java Прегледај датотеку

@@ -0,0 +1,13 @@
1
+package com.ruoyi.common.enums;
2
+
3
+import lombok.AllArgsConstructor;
4
+import lombok.Getter;
5
+
6
+@AllArgsConstructor
7
+@Getter
8
+public enum PushCaseStatusEnum {
9
+    MEDIATE("MEDIATE", "调解中", 1), SUCCESS("SUCCESS", "调解成功", 2), FAIL("FAIL", "调解失败", 3);
10
+    private String code;
11
+    private String name;
12
+    private Integer value;
13
+}

+ 64
- 0
ruoyi-common/src/main/java/com/ruoyi/common/enums/SMSStatusEnum.java Прегледај датотеку

@@ -0,0 +1,64 @@
1
+package com.ruoyi.common.enums;
2
+
3
+import com.ruoyi.common.interfaces.EnumsInterface;
4
+
5
+/**
6
+ * @author wangqiong
7
+ * @description 短信状态枚举
8
+ * @date 2023-11-17 14:05
9
+ */
10
+public enum SMSStatusEnum implements EnumsInterface
11
+{
12
+    SUCCESS(1, "成功"),
13
+    SENDING(2, "发送中"),
14
+    FAIL(3, "失败"),
15
+
16
+    ;
17
+
18
+    private final Integer code;
19
+    private final String text;
20
+
21
+    SMSStatusEnum(Integer code, String text)
22
+    {
23
+        this.code = code;
24
+        this.text = text;
25
+    }
26
+
27
+    public Integer getCode()
28
+    {
29
+        return code;
30
+    }
31
+
32
+    public String getText()
33
+    {
34
+        return text;
35
+    }
36
+
37
+    /**
38
+     * 根据code获取text
39
+     * @param codeNo
40
+     * @return
41
+     */
42
+    public static String getTextByCode(Integer codeNo){
43
+        for (SMSStatusEnum value : SMSStatusEnum.values()) {
44
+            if (value.getCode().equals(codeNo)){
45
+                return value.getText();
46
+            }
47
+        }
48
+        return codeNo.toString();
49
+    }
50
+
51
+    /**
52
+     * 根据text获取code
53
+     * @param textStr
54
+     * @return
55
+     */
56
+    public static String getCodeByText(String textStr){
57
+        for (SMSStatusEnum value : SMSStatusEnum.values()) {
58
+            if (value.getText().equals(textStr)){
59
+                return value.getText();
60
+            }
61
+        }
62
+        return textStr;
63
+    }
64
+}

+ 37
- 20
ruoyi-common/src/main/java/com/ruoyi/common/utils/EmailOutUtil.java Прегледај датотеку

@@ -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;
@@ -45,12 +47,12 @@ public class EmailOutUtil {
45 47
 //    private static String fromOut;
46 48
     @Value("${spring.mail.host}")
47 49
     private String hostOut;
48
-//    @Value("${spring.mail.username}")
49
-//    private String usernameOut;
50
-    private String usernameOut="wq18792927508@163.com";
51
-//    @Value("${spring.mail.password}")
52
-//    private String passwordOut;
53
-    private String passwordOut= "WDFHKSEMCKVRELEA";
50
+    @Value("${spring.mail.username}")
51
+    private String usernameOut;
52
+
53
+    @Value("${spring.mail.password}")
54
+    private String passwordOut;
55
+
54 56
     @Value("${spring.mail.port}")
55 57
     private Integer portOut;
56 58
 
@@ -72,18 +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);
86
-        ////System.out.println("发送成功:" + from + ":to:" + to);
77
+    public Boolean sendMessage(String to, String subject, String content, String from, JavaMailSender mailSender) {
78
+        try {
79
+            if(mailSender==null){
80
+                mailSender=  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;
87 100
     }
88 101
 
89 102
     /**
@@ -91,8 +104,9 @@ public class EmailOutUtil {
91 104
      * @param message  邮件内容
92 105
      * @param subject  邮件主题
93 106
      * @param fileList 邮件附件
107
+     * @param fileNameMap 附件名称map,附件路径-附件名称
94 108
      */
95
-    public  Boolean sendEmil(String to, String message, String subject, List<File> fileList, File file) {
109
+    public  Boolean sendEmil(String to, String message, String subject, List<File> fileList, File file,Map<String,String> fileNameMap) {
96 110
         try {
97 111
             String messageContent = "<html><body><p style=\"font-family: Arial, sans-serif; font-size: 18px;\">"+message+"。</p></body></html>";
98 112
             MimeBodyPart messageBodyPart = new MimeBodyPart();
@@ -149,7 +163,10 @@ public class EmailOutUtil {
149 163
                     for (File tempfile : fileList) {
150 164
                         MimeBodyPart attachmentPart = new MimeBodyPart();
151 165
                         attachmentPart.attachFile(tempfile);
152
-                        attachmentPart.setFileName(MimeUtility.encodeText(tempfile.getName()));
166
+                        // 设置附件名称
167
+                        if(fileNameMap!=null && fileNameMap.containsKey(tempfile.getPath())) {
168
+                            attachmentPart.setFileName(MimeUtility.encodeText(fileNameMap.get(tempfile.getPath())));
169
+                        }
153 170
                         multipart.addBodyPart(attachmentPart);
154 171
                     }
155 172
                     msg.setContent(multipart);

+ 128
- 0
ruoyi-common/src/main/java/com/ruoyi/common/utils/EncryptUtils.java Прегледај датотеку

@@ -0,0 +1,128 @@
1
+package com.ruoyi.common.utils;
2
+
3
+import com.fasterxml.jackson.databind.ObjectMapper;
4
+import com.fasterxml.jackson.databind.node.ObjectNode;
5
+import java.nio.charset.StandardCharsets;
6
+import java.security.InvalidKeyException;
7
+import java.security.Key;
8
+import java.security.NoSuchAlgorithmException;
9
+import java.security.SecureRandom;
10
+import java.security.Security;
11
+import java.util.UUID;
12
+import javax.crypto.Cipher;
13
+import javax.crypto.KeyGenerator;
14
+import javax.crypto.Mac;
15
+import javax.crypto.SecretKey;
16
+import javax.crypto.spec.SecretKeySpec;
17
+import lombok.extern.slf4j.Slf4j;
18
+import org.apache.commons.lang3.StringUtils;
19
+import org.bouncycastle.jce.provider.BouncyCastleProvider;
20
+import org.bouncycastle.pqc.math.linearalgebra.ByteUtils;
21
+
22
+@Slf4j
23
+public class EncryptUtils {
24
+  static {
25
+    Security.addProvider(new BouncyCastleProvider());
26
+  }
27
+
28
+  /**
29
+   * sm4加密
30
+   * @explain 加密模式:ECB 密文长度不固定,会随着被加密字符串长度的变化而变化
31
+   * @param paramStr 待加密字符串
32
+   * @return 返回16进制的加密字符串
33
+   * @throws Exception
34
+   */
35
+  public static String sm4Encrypt(String paramStr, String secretKey) {
36
+    if (StringUtils.isBlank(paramStr)) {
37
+      return null;
38
+    }
39
+    try {
40
+      // 16进制字符串-->byte[]
41
+      byte[] keyData = ByteUtils.fromHexString(secretKey);
42
+      // String-->byte[]
43
+      byte[] srcData = paramStr.getBytes(StandardCharsets.UTF_8);
44
+      // 加密后的数组
45
+      Cipher cipher = Cipher.getInstance("SM4/ECB/PKCS5Padding", BouncyCastleProvider.PROVIDER_NAME);
46
+      Key sm4Key = new SecretKeySpec(keyData, "SM4");
47
+      cipher.init(Cipher.ENCRYPT_MODE, sm4Key);
48
+      byte[] cipherArray = cipher.doFinal(srcData);
49
+      // byte[]-->hexString
50
+      return ByteUtils.toHexString(cipherArray);
51
+    } catch (Exception e) {
52
+      log.error("sm4加密失败:{}", paramStr, e);
53
+    }
54
+    return null;
55
+    
56
+  }
57
+  
58
+  /**
59
+   * sm4解密
60
+   * @explain 解密模式:采用ECB
61
+   * @param cipherText 16进制的加密字符串(忽略大小写)
62
+   * @return 解密后的字符串
63
+   * @throws Exception
64
+   */
65
+  public static String sm4Decrypt(String cipherText, String secretKey) {
66
+    if (StringUtils.isBlank(cipherText)) {
67
+      return null;
68
+    }
69
+    try {
70
+      // hexString-->byte[]
71
+      byte[] keyData = ByteUtils.fromHexString(secretKey);
72
+      // hexString-->byte[]
73
+      byte[] cipherData = ByteUtils.fromHexString(cipherText);
74
+      // 解密
75
+      Cipher cipher = Cipher.getInstance("SM4/ECB/PKCS5Padding", BouncyCastleProvider.PROVIDER_NAME);
76
+      Key sm4Key = new SecretKeySpec(keyData, "SM4");
77
+      cipher.init(Cipher.DECRYPT_MODE, sm4Key);
78
+      byte[] cipherArray = cipher.doFinal(cipherData);
79
+      // byte[]-->String
80
+      return new String(cipherArray, StandardCharsets.UTF_8);
81
+    } catch (Exception e) {
82
+      log.error("sm4解密失败:{}", cipherText, e);
83
+    }
84
+    return null;
85
+  }
86
+
87
+  /**
88
+   * @description: 初始化 HmacMD5 密钥
89
+   */
90
+  public static String initHmacMD5Key() throws NoSuchAlgorithmException {
91
+    //Init KeyGenerator.
92
+    KeyGenerator generator = KeyGenerator.getInstance("HmacSHA224");
93
+    //Generate key.
94
+    SecretKey secretKey = generator.generateKey();
95
+    return ByteUtils.toHexString(secretKey.getEncoded());
96
+  }
97
+
98
+  /**
99
+   * @description: HmacMD5 消息摘要
100
+   */
101
+  public static String encodeHmacMD5(String data, String key) throws NoSuchAlgorithmException, InvalidKeyException {
102
+    //Restore key.
103
+    SecretKey secretKey = new SecretKeySpec(ByteUtils.fromHexString(key), "HmacSHA224");
104
+    //Instantiate Mac.
105
+    Mac mac = Mac.getInstance(secretKey.getAlgorithm());
106
+    //Init Mac.
107
+    mac.init(secretKey);
108
+    //Execute.
109
+    return ByteUtils.toHexString(mac.doFinal(ByteUtils.fromHexString(data)));
110
+  }
111
+
112
+  public static void main(String[] args) {
113
+    String privateKey = "936df5fd9aba3b86adc3c1a1c52dcde1";
114
+    ObjectNode param = new ObjectMapper().createObjectNode();
115
+    param.put("userName", "张三");
116
+    param.put("caseNo", "ZC1234125");
117
+    param.put("userId", "124124");
118
+    param.put("roomId", "124125");
119
+    param.put("systemType", "tiaojiexitong");
120
+    String encryptString = sm4Encrypt(param.toString(), privateKey);
121
+    System.out.println("加密后的字符串:" + encryptString);
122
+    String uid = UUID.randomUUID().toString().replace("-", "");
123
+    System.out.println("uid:" + uid);
124
+    System.out.println("解密后的字符串:" + sm4Decrypt(encryptString, privateKey));
125
+
126
+  }
127
+
128
+}

+ 1
- 7
ruoyi-common/src/main/java/com/ruoyi/common/utils/PdfUtils.java Прегледај датотеку

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

+ 0
- 104
ruoyi-common/src/main/java/com/ruoyi/common/utils/SmsUtils.java Прегледај датотеку

@@ -1,104 +0,0 @@
1
-package com.ruoyi.common.utils;
2
-
3
-import com.tencentcloudapi.common.Credential;
4
-import com.tencentcloudapi.common.exception.TencentCloudSDKException;
5
-import com.tencentcloudapi.sms.v20210111.SmsClient;
6
-import com.tencentcloudapi.sms.v20210111.models.SendSmsResponse;
7
-import com.tencentcloudapi.sms.v20210111.models.SendStatus;
8
-import lombok.AllArgsConstructor;
9
-import lombok.Data;
10
-import lombok.NoArgsConstructor;
11
-import lombok.extern.slf4j.Slf4j;
12
-import lombok.var;
13
-
14
-import java.util.Objects;
15
-
16
-@Slf4j
17
-public class SmsUtils {
18
-    //应用id
19
-    private static final String SDK_APP_ID = "1400854852";
20
-    //API的SecretId
21
-    private static final String SECRET_ID = "AKIDeEf2A8uX1HSainvvnXAc3X9ZlhtyvkMp";
22
-    //API的SecretKey
23
-    private static final String SECRET_KEY = "QjphKo8zkHZigT8j9PVtFPJyfIvO3d6V";
24
-    //签名内容
25
-    private static final String SIGN_NAME = "乙巢智慧仲裁网";
26
-
27
-    public static Boolean sendSms(SendSmsRequest request) {
28
-        Credential cred = new Credential(SECRET_ID, SECRET_KEY );
29
-
30
-        SmsClient client = new SmsClient(cred, "ap-guangzhou");
31
-
32
-        final var req = new com.tencentcloudapi.sms.v20210111.models.SendSmsRequest();
33
-        req.setPhoneNumberSet(new String[]{"+86" + request.getPhone()});
34
-        req.setSmsSdkAppId(SDK_APP_ID );
35
-        req.setSignName(SIGN_NAME);
36
-        req.setTemplateId(request.getTemplateId());
37
-        req.setTemplateParamSet(request.getTemplateParamSet());
38
-        SendSmsResponse res = null;
39
-        try {
40
-            res = client.SendSms(req);
41
-        } catch (TencentCloudSDKException e) {
42
-            log.error("发送短信出错:", e);
43
-            return Boolean.FALSE;
44
-        }
45
-        SendStatus sendStatus = res.getSendStatusSet()[0];
46
-        log.info("发送短信结果:Code={}, Message={}", sendStatus.getCode(), sendStatus.getMessage());
47
-
48
-        if (Objects.nonNull(res.getSendStatusSet()) && res.getSendStatusSet().length > 0 && "Ok".equals(res.getSendStatusSet()[0].getCode())){
49
-            return Boolean.TRUE;
50
-        }
51
-        return Boolean.FALSE;
52
-    }
53
-    public static Boolean sendSms(Long caseId,String templateId,String phone,String[] templateParamSet) {
54
-        SendSmsRequest request = new SendSmsRequest(phone,templateId,templateParamSet,caseId);
55
-        Credential cred = new Credential(SECRET_ID, SECRET_KEY );
56
-
57
-        SmsClient client = new SmsClient(cred, "ap-guangzhou");
58
-
59
-        final var req = new com.tencentcloudapi.sms.v20210111.models.SendSmsRequest();
60
-        req.setPhoneNumberSet(new String[]{"+86" + request.getPhone()});
61
-        req.setSmsSdkAppId(SDK_APP_ID );
62
-        req.setSignName(SIGN_NAME);
63
-        req.setTemplateId(request.getTemplateId());
64
-        req.setTemplateParamSet(request.getTemplateParamSet());
65
-        SendSmsResponse res = null;
66
-        try {
67
-            res = client.SendSms(req);
68
-        } catch (TencentCloudSDKException e) {
69
-            log.error("发送短信出错:", e);
70
-            return Boolean.FALSE;
71
-        }
72
-        SendStatus sendStatus = res.getSendStatusSet()[0];
73
-        log.info("发送短信结果:Code={}, Message={}", sendStatus.getCode(), sendStatus.getMessage());
74
-
75
-        if (Objects.nonNull(res.getSendStatusSet()) && res.getSendStatusSet().length > 0 && "Ok".equals(res.getSendStatusSet()[0].getCode())){
76
-            return Boolean.TRUE;
77
-        }
78
-        return Boolean.FALSE;
79
-    }
80
-    /**
81
-     * 参数对象
82
-     */
83
-    @Data
84
-    @NoArgsConstructor
85
-    @AllArgsConstructor
86
-    public static class SendSmsRequest {
87
-        /**
88
-         * 电话
89
-         */
90
-        private String phone;
91
-
92
-        /**
93
-         * 模板 ID: 必须填写已审核通过的模板 ID
94
-         */
95
-        private String templateId;
96
-
97
-        /**
98
-         * 模板参数: 模板参数的个数需要与 TemplateId 对应模板的变量个数保持一致,若无模板参数,则设置为空
99
-         */
100
-        private String[] templateParamSet;
101
-        private Long caseId;
102
-
103
-    }
104
-}

+ 22
- 11
ruoyi-common/src/main/java/com/ruoyi/common/utils/WordUtil.java Прегледај датотеку

@@ -1,26 +1,19 @@
1 1
 package com.ruoyi.common.utils;
2 2
 
3 3
 
4
-import cn.hutool.core.io.resource.ClassPathResource;
5 4
 import com.deepoove.poi.XWPFTemplate;
6 5
 import com.deepoove.poi.config.Configure;
7 6
 import com.deepoove.poi.data.*;
8 7
 import com.deepoove.poi.data.style.ParagraphStyle;
9 8
 import com.deepoove.poi.data.style.Style;
10
-import com.deepoove.poi.policy.PictureRenderPolicy;
11 9
 import com.deepoove.poi.util.PoitlIOUtils;
12
-import org.apache.commons.io.FileUtils;
13
-import org.apache.poi.ss.usermodel.Cell;
14
-import org.apache.poi.ss.usermodel.CellType;
15
-import org.apache.poi.ss.usermodel.Row;
16
-import org.apache.poi.ss.usermodel.Sheet;
17
-import org.apache.poi.wp.usermodel.Paragraph;
18 10
 import org.apache.poi.xwpf.usermodel.*;
19 11
 
20
-import javax.print.Doc;
21
-import javax.servlet.http.HttpServletRequest;
22 12
 import javax.servlet.http.HttpServletResponse;
23
-import java.io.*;
13
+import java.io.BufferedOutputStream;
14
+import java.io.FileOutputStream;
15
+import java.io.IOException;
16
+import java.io.OutputStream;
24 17
 import java.util.ArrayList;
25 18
 import java.util.List;
26 19
 import java.util.Map;
@@ -205,6 +198,24 @@ public class WordUtil {
205 198
         }
206 199
     }
207 200
 
201
+    /**
202
+     * 替换标签内容
203
+     * @param map
204
+     * @param templatePath 模板路径
205
+     * @param outputPath 文件输出路径
206
+     */
207
+    public static void render(Map<String, Object> map,String templatePath,String outputPath){
208
+        XWPFTemplate template = XWPFTemplate.compile(templatePath).render(map);
209
+        try {
210
+            FileOutputStream out = new FileOutputStream(outputPath);
211
+            template.write(out);
212
+            out.flush();
213
+            out.close();
214
+            template.close();
215
+        } catch (IOException e) {
216
+            e.printStackTrace();
217
+        }
218
+    }
208 219
 
209 220
 
210 221
 }

+ 21
- 44
ruoyi-common/src/main/java/com/ruoyi/common/utils/file/SaaSAPIFileUtils.java Прегледај датотеку

@@ -1,20 +1,13 @@
1 1
 package com.ruoyi.common.utils.file;
2 2
 
3
-import cn.hutool.json.JSONObject;
4
-import com.google.gson.Gson;
5
-import com.google.gson.JsonArray;
6
-import com.google.gson.JsonObject;
7 3
 import com.ruoyi.common.config.EsignDemoConfig;
8 4
 import com.ruoyi.common.constant.EsignHeaderConstant;
9
-import com.ruoyi.common.constant.FileTransformation;
10 5
 import com.ruoyi.common.core.domain.entity.EsignHttpResponse;
11 6
 import com.ruoyi.common.enums.EsignRequestType;
12 7
 import com.ruoyi.common.exception.EsignDemoException;
13 8
 import com.ruoyi.common.utils.EsignHttpHelper;
14 9
 import com.ruoyi.common.utils.bean.EsignFileBean;
15
-import com.ruoyi.common.utils.uuid.IdUtils;
16 10
 
17
-import java.time.LocalDate;
18 11
 import java.util.Map;
19 12
 
20 13
 public class SaaSAPIFileUtils {
@@ -88,43 +81,27 @@ public class SaaSAPIFileUtils {
88 81
 
89 82
 
90 83
   public static void main(String[] args) throws EsignDemoException {
91
-        String filePath = "D:\\home\\ruoyi\\uploadPath\\upload\\2023\\10\\7\\23893bfd3f2249ffa5c82850c11c482e.docx";
92
-
93
-        EsignHttpResponse uploadUrl = getUploadUrl(filePath);
94
-        String body = uploadUrl.getBody();
95
-        JSONObject jsonObject = new JSONObject(body);
96
-        JSONObject dataObj = jsonObject.getJSONObject("data");
97
-        String fileUploadUrl = dataObj.get("fileUploadUrl").toString();
98
-        System.out.println("这是fileUploadUrl:"+fileUploadUrl);
99
-        String fileId = dataObj.get("fileId").toString();
100
-        System.out.println("这是fileId:"+fileId);
101
-      //String fileUploadUrl = "https://esignoss.esign.cn/1111564182/ccf6db5a-92da-4523-89ba-385a30423596/23893bfd3f2249ffa5c82850c11c482e.docx?Expires=1697021257&OSSAccessKeyId=STS.NTmgvSC8n5Zg1y7EciQftF23N&Signature=CxVZmpwFksWmLYkxPjVz9K4mVyA%3D&callback-var=eyJ4OmZpbGVfa2V5IjoiJDAyODhjOTg3LWNlNzgtNDM1OC04NWYwLTdlNmUyM2NjOTJmNiQzNDk1NzQ3MjE5In0%3D%0A&callback=eyJjYWxsYmFja1VybCI6Imh0dHA6Ly9zbWx0YXBpLnRzaWduLmNuL2FueWRvb3IvZmlsZS1zeXN0ZW0vY2FsbGJhY2svYWxpb3NzIiwiY2FsbGJhY2tCb2R5IjogIntcIm1pbWVUeXBlXCI6JHttaW1lVHlwZX0sXCJzaXplXCI6ICR7c2l6ZX0sXCJidWNrZXRcIjogJHtidWNrZXR9LFwib2JqZWN0XCI6ICR7b2JqZWN0fSxcImV0YWdcIjogJHtldGFnfSxcImZpbGVfa2V5XCI6JHt4OmZpbGVfa2V5fX0iLCJjYWxsYmFja0JvZHlUeXBlIjogImFwcGxpY2F0aW9uL2pzb24ifQ%3D%3D%0A&security-token=CAIS%2BAF1q6Ft5B2yfSjIr5fYLMznrudPgpiMM1%2BGoWM8XelYqfeYrDz2IHtKdXRvBu8Xs%2F4wnmxX7f4YlqB6T55OSAmcNZEofT7katr4MeT7oMWQweEurv%2FMQBqyaXPS2MvVfJ%2BOLrf0ceusbFbpjzJ6xaCAGxypQ12iN%2B%2Fm6%2FNgdc9FHHPPD1x8CcxROxFppeIDKHLVLozNCBPxhXfKB0ca0WgVy0EHsPnvm5DNs0uH1AKjkbRM9r6ceMb0M5NeW75kSMqw0eBMca7M7TVd8RAi9t0t1%2FIVpGiY4YDAWQYLv0rda7DOltFiMkpla7MmXqlft%2BhzcgeQY0pc%2FRqAAaxcPCSY0Du8wgErfR1llD8t2zeFG%2B1mktU4Rsl7AgxsSFxrwILBUk2x7imVsFVA0kkS8rNBMDKGIsIZTCl5M7S2L%2BD8364htwcZgIZYHK2fCN6gCuy%2Bfk9C%2FfQaTc00IWBMw8OubuJ%2Fq2mdMh32yoi7dLuJyhwt1z%2F%2BWf5vIFHdIAA%3D";
102
-        EsignHttpResponse esignHttpResponse = uploadFile(fileUploadUrl, filePath);
103
-        System.out.println("这是上传文件流的结果:"+esignHttpResponse.getBody());
104
-        EsignHttpResponse fileStatus = getFileStatus(fileId);
105
-        System.out.println("这是获取文件上传状态的结果:"+fileStatus.getBody());
106
-//        getFileStatus("a808f1f39a744357a2f018e4ab34c55d");
107
-//     fileDownloadUrl("");
108
-
109
-
110
-//      Gson gson = new Gson();
111
-//      EsignHttpResponse fileDownload = fileDownloadUrl(signFlowId);
112
-//      JsonObject fileDownloadJsonObject = gson.fromJson(fileDownload.getBody(),JsonObject.class);
113
-//      JsonObject fileDownloadData = fileDownloadJsonObject.getAsJsonObject("data");
114
-//      JsonArray filesArray = fileDownloadData.get("files").getAsJsonArray();
115
-//      if(filesArray!=null&&filesArray.size()>0){
116
-//          JsonObject fileObject = (JsonObject)filesArray.get(0);
117
-//          String fileDownloadUrl = fileObject.get("downloadUrl").toString();
118
-//          String fileName = java.util.UUID.randomUUID().toString().replace("-", "") + ".pdf";
119
-//          String savePath = "/home/ruoyi/uploadPath/upload";
120
-//          LocalDate now = LocalDate.now();
121
-//          String year = Integer.toString(now.getYear());
122
-//          String month = String.format("%02d", now.getMonthValue());
123
-//          String day = String.format("%02d", now.getDayOfMonth());
124
-//          String saveName = "/profile/upload/" + year + "/" + month + "/" + day + "/" + fileName;
125
-//          String fileDownloadUrlnew  = fileDownloadUrl.substring(1,fileDownloadUrl.length()-1);
126
-//          FileTransformation.downLoadFileByUrl(fileDownloadUrlnew,dir);
127
-//      }
84
+      fileDownloadUrl("8425b244bf4b417dbb22fd39a1c2d65f");
85
+
86
+
87
+
88
+
89
+//        String filePath = "D:\\home\\ruoyi\\uploadPath\\upload\\2023\\10\\7\\23893bfd3f2249ffa5c82850c11c482e.docx";
90
+//
91
+//        EsignHttpResponse uploadUrl = getUploadUrl(filePath);
92
+//        String body = uploadUrl.getBody();
93
+//        JSONObject jsonObject = new JSONObject(body);
94
+//        JSONObject dataObj = jsonObject.getJSONObject("data");
95
+//        String fileUploadUrl = dataObj.get("fileUploadUrl").toString();
96
+//        System.out.println("这是fileUploadUrl:"+fileUploadUrl);
97
+//        String fileId = dataObj.get("fileId").toString();
98
+//        System.out.println("这是fileId:"+fileId);
99
+//      //String fileUploadUrl = "https://esignoss.esign.cn/1111564182/ccf6db5a-92da-4523-89ba-385a30423596/23893bfd3f2249ffa5c82850c11c482e.docx?Expires=1697021257&OSSAccessKeyId=STS.NTmgvSC8n5Zg1y7EciQftF23N&Signature=CxVZmpwFksWmLYkxPjVz9K4mVyA%3D&callback-var=eyJ4OmZpbGVfa2V5IjoiJDAyODhjOTg3LWNlNzgtNDM1OC04NWYwLTdlNmUyM2NjOTJmNiQzNDk1NzQ3MjE5In0%3D%0A&callback=eyJjYWxsYmFja1VybCI6Imh0dHA6Ly9zbWx0YXBpLnRzaWduLmNuL2FueWRvb3IvZmlsZS1zeXN0ZW0vY2FsbGJhY2svYWxpb3NzIiwiY2FsbGJhY2tCb2R5IjogIntcIm1pbWVUeXBlXCI6JHttaW1lVHlwZX0sXCJzaXplXCI6ICR7c2l6ZX0sXCJidWNrZXRcIjogJHtidWNrZXR9LFwib2JqZWN0XCI6ICR7b2JqZWN0fSxcImV0YWdcIjogJHtldGFnfSxcImZpbGVfa2V5XCI6JHt4OmZpbGVfa2V5fX0iLCJjYWxsYmFja0JvZHlUeXBlIjogImFwcGxpY2F0aW9uL2pzb24ifQ%3D%3D%0A&security-token=CAIS%2BAF1q6Ft5B2yfSjIr5fYLMznrudPgpiMM1%2BGoWM8XelYqfeYrDz2IHtKdXRvBu8Xs%2F4wnmxX7f4YlqB6T55OSAmcNZEofT7katr4MeT7oMWQweEurv%2FMQBqyaXPS2MvVfJ%2BOLrf0ceusbFbpjzJ6xaCAGxypQ12iN%2B%2Fm6%2FNgdc9FHHPPD1x8CcxROxFppeIDKHLVLozNCBPxhXfKB0ca0WgVy0EHsPnvm5DNs0uH1AKjkbRM9r6ceMb0M5NeW75kSMqw0eBMca7M7TVd8RAi9t0t1%2FIVpGiY4YDAWQYLv0rda7DOltFiMkpla7MmXqlft%2BhzcgeQY0pc%2FRqAAaxcPCSY0Du8wgErfR1llD8t2zeFG%2B1mktU4Rsl7AgxsSFxrwILBUk2x7imVsFVA0kkS8rNBMDKGIsIZTCl5M7S2L%2BD8364htwcZgIZYHK2fCN6gCuy%2Bfk9C%2FfQaTc00IWBMw8OubuJ%2Fq2mdMh32yoi7dLuJyhwt1z%2F%2BWf5vIFHdIAA%3D";
100
+//        EsignHttpResponse esignHttpResponse = uploadFile(fileUploadUrl, filePath);
101
+//        System.out.println("这是上传文件流的结果:"+esignHttpResponse.getBody());
102
+//        EsignHttpResponse fileStatus = getFileStatus(fileId);
103
+//        System.out.println("这是获取文件上传状态的结果:"+fileStatus.getBody());
104
+
128 105
 
129 106
 
130 107
 

+ 34
- 4
ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/SysLoginService.java Прегледај датотеку

@@ -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;
@@ -20,6 +21,7 @@ import com.ruoyi.framework.manager.AsyncManager;
20 21
 import com.ruoyi.framework.manager.factory.AsyncFactory;
21 22
 import com.ruoyi.framework.security.context.AuthenticationContextHolder;
22 23
 import com.ruoyi.system.mapper.SysRoleMapper;
24
+import com.ruoyi.system.mapper.SysUserMapper;
23 25
 import com.ruoyi.system.service.ISysConfigService;
24 26
 import com.ruoyi.system.service.ISysUserService;
25 27
 import org.springframework.beans.factory.annotation.Autowired;
@@ -55,6 +57,8 @@ public class SysLoginService
55 57
     private ISysConfigService configService;
56 58
     @Autowired
57 59
     private SysRoleMapper roleMapper;
60
+    @Autowired
61
+    private SysUserMapper userMapper;
58 62
 
59 63
     /**
60 64
      * 登录验证
@@ -230,16 +234,20 @@ public class SysLoginService
230 234
         AjaxResult ajax = AjaxResult.success();
231 235
         String username = loginBody.getUsername();
232 236
         // 根据用户名获取用户信息,如果用户不存在则新增用户
233
-        SysUser user = userService.selectUserByUserName(username);
237
+        SysUser user =null;
238
+        if(username.contains("@")) {
239
+            user=  userMapper.selectUserByEmail(username);
240
+        }else {
241
+            user=  userService.selectUserByUserName(username);
242
+        }
234 243
         if(user==null){
235 244
             // 新增用户
236 245
             user = new SysUser();
237 246
             user.setUserName(username);
238 247
             user.setPassword(SecurityUtils.encryptPassword("abc123456"));
239 248
             user.setNickName(username);
240
-            // 代理人角色相当于申请人角色
241
-            if(loginBody.getRoleName().contains("代理人")){
242
-                loginBody.setRoleName("申请人");
249
+            if(username.contains("@")){
250
+                user.setEmail(username);
243 251
             }
244 252
             // 根据角色名查询角色id
245 253
             Long roleIdByName = roleMapper.selectRoleIdByName(loginBody.getRoleName());
@@ -258,4 +266,26 @@ public class SysLoginService
258 266
         ajax.put(Constants.TOKEN, token);
259 267
         return ajax;
260 268
     }
269
+
270
+    /**
271
+     * 对接BM,根据用户名查询token
272
+     * @param loginBody
273
+     * @return
274
+     */
275
+    public AjaxResult selectTokenByUserName(LoginBody loginBody) {
276
+        String username = loginBody.getUsername();
277
+        String currentTicket = MD5.create().digestHex("BM" + username);
278
+        if(!currentTicket.equals(loginBody.getTicket())){
279
+            return AjaxResult.error("ticket校验失败");
280
+        }
281
+
282
+        Object cacheObject = redisCache.getCacheObject(CacheConstants.LOGIN_USERNAME_TOKEN_KEY + username);
283
+        if(ObjectUtil.isEmpty(cacheObject)){
284
+            return AjaxResult.error("登录时间过长,请重新登录");
285
+        }
286
+
287
+        AjaxResult result = AjaxResult.success();
288
+        result.put("token",(String) cacheObject);
289
+        return result;
290
+    }
261 291
 }

+ 17
- 10
ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/SysPermissionService.java Прегледај датотеку

@@ -1,15 +1,17 @@
1 1
 package com.ruoyi.framework.web.service;
2 2
 
3
-import java.util.HashSet;
4
-import java.util.List;
5
-import java.util.Set;
6
-import org.springframework.beans.factory.annotation.Autowired;
7
-import org.springframework.stereotype.Component;
8
-import org.springframework.util.CollectionUtils;
9 3
 import com.ruoyi.common.core.domain.entity.SysRole;
10 4
 import com.ruoyi.common.core.domain.entity.SysUser;
11 5
 import com.ruoyi.system.service.ISysMenuService;
12 6
 import com.ruoyi.system.service.ISysRoleService;
7
+import org.springframework.beans.factory.annotation.Autowired;
8
+import org.springframework.stereotype.Component;
9
+import org.springframework.util.CollectionUtils;
10
+
11
+import java.util.ArrayList;
12
+import java.util.HashSet;
13
+import java.util.List;
14
+import java.util.Set;
13 15
 
14 16
 /**
15 17
  * 用户权限处理
@@ -31,13 +33,16 @@ public class SysPermissionService
31 33
      * @param user 用户信息
32 34
      * @return 角色权限信息
33 35
      */
34
-    public Set<String> getRolePermission(SysUser user)
36
+    public List<SysRole>  getRolePermission(SysUser user)
35 37
     {
36
-        Set<String> roles = new HashSet<String>();
38
+        List<SysRole> roles = new ArrayList<>();
37 39
         // 管理员拥有所有权限
38 40
         if (user.isAdmin())
39 41
         {
40
-            roles.add("admin");
42
+            SysRole sysRole = new SysRole();
43
+            sysRole.setRoleId(1L);
44
+            sysRole.setRoleKey("admin");
45
+            roles.add(sysRole);
41 46
         }
42 47
         else
43 48
         {
@@ -58,7 +63,9 @@ public class SysPermissionService
58 63
         // 管理员拥有所有权限
59 64
         if (user.isAdmin())
60 65
         {
61
-            perms.add("*:*:*");
66
+            // 查询所有数据权限,排除案件管理下的权限即可
67
+            perms.addAll(menuService.selectAdminMenu());
68
+          //  perms.add("*:*:*");
62 69
         }
63 70
         else
64 71
         {

+ 18
- 2
ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/TokenService.java Прегледај датотеку

@@ -123,9 +123,24 @@ 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;
129
+    }
130
+    public String createVideoToken(LoginUser loginUser,int expireTime)
131
+    {
132
+        String token = IdUtils.fastUUID();
133
+        loginUser.setToken(token);
134
+        setUserAgent(loginUser);
135
+        refreshToken(loginUser);
136
+        Map<String, Object> claims = new HashMap<>();
137
+        claims.put("userName",loginUser.getUsername());
138
+        claims.put("userId",loginUser.getUserId());
139
+        claims.put(Constants.LOGIN_USER_KEY, token);
140
+        String createToken = createToken(claims);
141
+        redisCache.setCacheObject(CacheConstants.LOGIN_USERNAME_TOKEN_KEY+loginUser.getUsername(),createToken, expireTime, TimeUnit.MINUTES);
142
+        return createToken;
127 143
     }
128
-
129 144
     /**
130 145
      * 验证令牌有效期,相差不足20分钟,自动刷新缓存
131 146
      *
@@ -154,6 +169,7 @@ public class TokenService
154 169
         // 根据uuid将loginUser缓存
155 170
         String userKey = getTokenKey(loginUser.getToken());
156 171
         redisCache.setCacheObject(userKey, loginUser, expireTime, TimeUnit.MINUTES);
172
+
157 173
     }
158 174
 
159 175
     /**

+ 16
- 16
ruoyi-system/pom.xml Прегледај датотеку

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

+ 44
- 0
ruoyi-system/src/main/java/com/ruoyi/system/domain/entity/flow/MsCaseFlowRoleSmsRelated.java Прегледај датотеку

@@ -0,0 +1,44 @@
1
+package com.ruoyi.system.domain.entity.flow;
2
+
3
+import java.util.Date;
4
+import javax.persistence.*;
5
+import lombok.Getter;
6
+import lombok.Setter;
7
+import lombok.ToString;
8
+
9
+@Getter
10
+@Setter
11
+@ToString
12
+@Table(name = "ms_case_flow_role_sms_related")
13
+public class MsCaseFlowRoleSmsRelated {
14
+    /**
15
+     * id
16
+     */
17
+    @Id
18
+    @GeneratedValue(generator = "JDBC")
19
+    private Integer id;
20
+
21
+    /**
22
+     * 案件流程id
23
+     */
24
+    @Column(name = "flow_id")
25
+    private Integer flowId;
26
+
27
+    /**
28
+     * 用户角色id
29
+     */
30
+    @Column(name = "receive_role_id")
31
+    private Long receiveRoleId;
32
+
33
+    /**
34
+     * 短信模版id
35
+     */
36
+    @Column(name = "sms_template_id")
37
+    private Long smsTemplateId;
38
+
39
+    /**
40
+     * 创建时间
41
+     */
42
+    @Column(name = "create_time")
43
+    private Date createTime;
44
+}

+ 56
- 0
ruoyi-system/src/main/java/com/ruoyi/system/domain/entity/log/MsRequestLog.java Прегледај датотеку

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

+ 60
- 0
ruoyi-system/src/main/java/com/ruoyi/system/domain/entity/shortmessage/MeetingInfo.java Прегледај датотеку

@@ -0,0 +1,60 @@
1
+package com.ruoyi.system.domain.entity.shortmessage;
2
+
3
+import lombok.AllArgsConstructor;
4
+import lombok.Builder;
5
+import lombok.Data;
6
+import lombok.NoArgsConstructor;
7
+
8
+import javax.persistence.Column;
9
+import javax.persistence.Id;
10
+import javax.persistence.Table;
11
+import java.util.Date;
12
+
13
+@Data
14
+@Builder
15
+@NoArgsConstructor
16
+@AllArgsConstructor
17
+@Table(name = "meeting_info")
18
+public class MeetingInfo {
19
+    /**
20
+     * 主键Id
21
+     */
22
+    @Id
23
+    private String uid;
24
+
25
+    /**
26
+     * 案件Id
27
+     */
28
+    @Column(name = "case_id")
29
+    private Long caseId;
30
+
31
+    /**
32
+     * 用户Id
33
+     */
34
+    @Column(name = "user_id")
35
+    private Long userId;
36
+
37
+    /**
38
+     * 用户名称
39
+     */
40
+    @Column(name = "user_name")
41
+    private String userName;
42
+
43
+    /**
44
+     * 房间Id
45
+     */
46
+    @Column(name = "room_id")
47
+    private String roomId;
48
+
49
+    /**
50
+     * 系统类型
51
+     */
52
+    @Column(name = "system_type")
53
+    private String systemType;
54
+
55
+    /**
56
+     * 创建时间
57
+     */
58
+    @Column(name = "create_time")
59
+    private Date createTime;
60
+}

+ 107
- 0
ruoyi-system/src/main/java/com/ruoyi/system/domain/entity/shortmessage/MsSendMailHistoryRecord.java Прегледај датотеку

@@ -0,0 +1,107 @@
1
+package com.ruoyi.system.domain.entity.shortmessage;
2
+
3
+import java.util.Date;
4
+import javax.persistence.*;
5
+import lombok.Getter;
6
+import lombok.Setter;
7
+import lombok.ToString;
8
+
9
+@Getter
10
+@Setter
11
+@ToString
12
+@Table(name = "ms_send_mail_history_record")
13
+public class MsSendMailHistoryRecord {
14
+    @Id
15
+    @GeneratedValue(generator = "JDBC")
16
+    private Long id;
17
+
18
+    /**
19
+     * 邮件名称
20
+     */
21
+    @Column(name = "mail_name")
22
+    private String mailName;
23
+
24
+    /**
25
+     * 邮件接收地址
26
+     */
27
+    @Column(name = "mail_address")
28
+    private String mailAddress;
29
+
30
+    /**
31
+     * 发送时间
32
+     */
33
+    @Column(name = "send_time")
34
+    private Date sendTime;
35
+
36
+    /**
37
+     * 案件编号
38
+     */
39
+    @Column(name = "case_num")
40
+    private String caseNum;
41
+
42
+    /**
43
+     * 发送状态
44
+     */
45
+    @Column(name = "send_status")
46
+    private Long sendStatus;
47
+
48
+    /**
49
+     * 立案申请id
50
+     */
51
+    @Column(name = "case_id")
52
+    private Long caseId;
53
+
54
+    /**
55
+     * 创建时间
56
+     */
57
+    @Column(name = "create_time")
58
+    private Date createTime;
59
+
60
+    /**
61
+     * 创建者
62
+     */
63
+    @Column(name = "create_by")
64
+    private String createBy;
65
+
66
+    /**
67
+     * 更新者
68
+     */
69
+    @Column(name = "update_by")
70
+    private String updateBy;
71
+
72
+    /**
73
+     * 更新时间
74
+     */
75
+    @Column(name = "update_time")
76
+    private Date updateTime;
77
+
78
+    /**
79
+     * 附件id用英文逗号隔开
80
+     */
81
+    @Column(name = "file_ids")
82
+    private String fileIds;
83
+
84
+    /**
85
+     * 邮件主题
86
+     */
87
+    @Column(name = "mail_subject")
88
+    private String mailSubject;
89
+
90
+    /**
91
+     * 邮件发送地址
92
+     */
93
+    @Column(name = "mail_from_address")
94
+    private String mailFromAddress;
95
+
96
+    /**
97
+     * 邮件父类id
98
+     */
99
+    @Column(name = "parent_id")
100
+    private Long parentId;
101
+
102
+    /**
103
+     * 邮件内容
104
+     */
105
+    @Column(name = "mail_content")
106
+    private String mailContent;
107
+}

+ 98
- 0
ruoyi-system/src/main/java/com/ruoyi/system/domain/entity/shortmessage/MsSmsSendHistoryRecord.java Прегледај датотеку

@@ -0,0 +1,98 @@
1
+package com.ruoyi.system.domain.entity.shortmessage;
2
+
3
+import lombok.AllArgsConstructor;
4
+import lombok.Builder;
5
+import lombok.Data;
6
+import lombok.NoArgsConstructor;
7
+
8
+import javax.persistence.Column;
9
+import javax.persistence.GeneratedValue;
10
+import javax.persistence.Id;
11
+import javax.persistence.Table;
12
+import java.util.Date;
13
+
14
+@Data
15
+@AllArgsConstructor
16
+@NoArgsConstructor
17
+@Builder
18
+@Table(name = "ms_sms_send_history_record")
19
+public class MsSmsSendHistoryRecord {
20
+    @Id
21
+    @GeneratedValue(generator = "JDBC")
22
+    private Long id;
23
+
24
+    /**
25
+     * 案件id
26
+     */
27
+    @Column(name = "case_appli_id")
28
+    private Long caseAppliId;
29
+    /**
30
+     * 短信模板表主键id
31
+     */
32
+    @Column(name = "ms_sms_template_id")
33
+    private Long msSmsTemplateId;
34
+
35
+    /**
36
+     * 案件编号
37
+     */
38
+    @Column(name = "case_num")
39
+    private String caseNum;
40
+
41
+    /**
42
+     * 手机号
43
+     */
44
+    private String phone;
45
+
46
+    /**
47
+     * 发送时间
48
+     */
49
+    @Column(name = "send_time")
50
+    private Date sendTime;
51
+
52
+    /**
53
+     * 发送状态,0-失败,1-成功
54
+     */
55
+    @Column(name = "send_status")
56
+    private Long sendStatus;
57
+
58
+
59
+    /**
60
+     * 创建时间
61
+     */
62
+    @Column(name = "create_time")
63
+    private Date createTime;
64
+
65
+    /**
66
+     * 更新时间
67
+     */
68
+    @Column(name = "update_time")
69
+    private Date updateTime;
70
+
71
+    /**
72
+     * 创建人
73
+     */
74
+    @Column(name = "create_by")
75
+    private String createBy;
76
+
77
+    /**
78
+     * 更新者
79
+     */
80
+    @Column(name = "update_by")
81
+    private String updateBy;
82
+
83
+    /**
84
+     * 发送短信唯一标识
85
+     */
86
+    private String sid;
87
+
88
+    /**
89
+     * 父类短信id
90
+     */
91
+    @Column(name = "parent_id")
92
+    private Long parentId;
93
+
94
+    /**
95
+     * 失败原因
96
+     */
97
+    private String reason;
98
+}

+ 28
- 0
ruoyi-system/src/main/java/com/ruoyi/system/domain/entity/sms/MsSmsSendHistoryRecordParam.java Прегледај датотеку

@@ -0,0 +1,28 @@
1
+package com.ruoyi.system.domain.entity.sms;
2
+
3
+import javax.persistence.*;
4
+import lombok.Getter;
5
+import lombok.Setter;
6
+import lombok.ToString;
7
+
8
+@Getter
9
+@Setter
10
+@ToString
11
+@Table(name = "ms_sms_send_history_record_param")
12
+public class MsSmsSendHistoryRecordParam {
13
+    @Id
14
+    @GeneratedValue(generator = "JDBC")
15
+    private Long id;
16
+
17
+    /**
18
+     * 短信历史记录表id
19
+     */
20
+    @Column(name = "sms_record_history_id")
21
+    private Long smsRecordHistoryId;
22
+
23
+    /**
24
+     * 参数值
25
+     */
26
+    @Column(name = "param_value")
27
+    private String paramValue;
28
+}

+ 33
- 0
ruoyi-system/src/main/java/com/ruoyi/system/domain/entity/sms/MsSmsSendRecordParam.java Прегледај датотеку

@@ -0,0 +1,33 @@
1
+package com.ruoyi.system.domain.entity.sms;
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
+
12
+@Getter
13
+@Setter
14
+@ToString
15
+@Table(name = "ms_sms_send_record_param")
16
+public class MsSmsSendRecordParam {
17
+    @Id
18
+    @GeneratedValue(generator = "JDBC")
19
+    private Integer id;
20
+
21
+    /**
22
+     * 短信记录表id
23
+     */
24
+    @Column(name = "sms_record_id")
25
+    private Long smsRecordId;
26
+
27
+
28
+    /**
29
+     * 参数值
30
+     */
31
+    @Column(name = "param_value")
32
+    private String paramValue;
33
+}

+ 38
- 0
ruoyi-system/src/main/java/com/ruoyi/system/domain/entity/sms/MsSmsTemplate.java Прегледај датотеку

@@ -0,0 +1,38 @@
1
+package com.ruoyi.system.domain.entity.sms;
2
+
3
+import lombok.Getter;
4
+import lombok.Setter;
5
+import lombok.ToString;
6
+
7
+import javax.persistence.*;
8
+import java.util.List;
9
+
10
+@Getter
11
+@Setter
12
+@ToString
13
+@Table(name = "ms_sms_template")
14
+public class MsSmsTemplate {
15
+    @Id
16
+    @GeneratedValue(generator = "JDBC")
17
+    private Long id;
18
+
19
+    /**
20
+     * 腾讯云模板id
21
+     */
22
+    @Column(name = "template_id")
23
+    private String templateId;
24
+
25
+    /**
26
+     * 模板名称
27
+     */
28
+    private String name;
29
+    /**
30
+     * 模板内容
31
+     */
32
+    private String content;
33
+    /**
34
+     * 模板参数
35
+     */
36
+    @Transient
37
+    private List<MsSmsTemplateParam> templateParams;
38
+}

+ 38
- 0
ruoyi-system/src/main/java/com/ruoyi/system/domain/entity/sms/MsSmsTemplateParam.java Прегледај датотеку

@@ -0,0 +1,38 @@
1
+package com.ruoyi.system.domain.entity.sms;
2
+
3
+import lombok.Getter;
4
+import lombok.Setter;
5
+import lombok.ToString;
6
+
7
+import javax.persistence.*;
8
+
9
+@Getter
10
+@Setter
11
+@ToString
12
+@Table(name = "ms_sms_template_param")
13
+public class MsSmsTemplateParam {
14
+    @Id
15
+    @GeneratedValue(generator = "JDBC")
16
+    private Long id;
17
+
18
+    /**
19
+     * ms_sms_template表id
20
+     */
21
+    @Column(name = "sms_template_id")
22
+    private Long smsTemplateId;
23
+
24
+    /**
25
+     * 参数
26
+     */
27
+    private String param;
28
+    /**
29
+     * 参数名
30
+     */
31
+    @Column(name = "param_name")
32
+    private String paramName;
33
+    /**
34
+     * 参数值
35
+     */
36
+    @Transient
37
+    private String paramValue;
38
+}

+ 39
- 0
ruoyi-system/src/main/java/com/ruoyi/system/domain/vo/flow/MsCaseFlowRoleSmsRelatedVO.java Прегледај датотеку

@@ -0,0 +1,39 @@
1
+package com.ruoyi.system.domain.vo.flow;
2
+
3
+import com.alibaba.fastjson2.JSONObject;
4
+import lombok.AllArgsConstructor;
5
+import lombok.Builder;
6
+import lombok.Data;
7
+import lombok.NoArgsConstructor;
8
+
9
+import java.util.List;
10
+
11
+@AllArgsConstructor
12
+@NoArgsConstructor
13
+@Builder
14
+@Data
15
+public class MsCaseFlowRoleSmsRelatedVO {
16
+    /**
17
+     * 主键id
18
+     */
19
+    private Integer id;
20
+
21
+    /**
22
+     * 流程节点id
23
+     */
24
+    private Integer flowId;
25
+
26
+
27
+    /**
28
+     * 短信模版id
29
+     */
30
+    private Long smsTemplateId;
31
+    /**
32
+     * 发送短信的角色id
33
+     */
34
+    private List<Long> receiveRoleIds;
35
+    /**
36
+     * 接收短信角色名称
37
+     */
38
+    public List<JSONObject> receiveRoleNames;
39
+}

+ 13
- 1
ruoyi-system/src/main/java/com/ruoyi/system/domain/vo/flow/MsCaseFlowVO.java Прегледај датотеку

@@ -1,5 +1,6 @@
1 1
 package com.ruoyi.system.domain.vo.flow;
2 2
 
3
+import com.alibaba.fastjson2.JSONObject;
3 4
 import lombok.AllArgsConstructor;
4 5
 import lombok.Builder;
5 6
 import lombok.Data;
@@ -64,5 +65,16 @@ public class MsCaseFlowVO {
64 65
      * svg图片路径
65 66
      */
66 67
     private String fileName;
67
-
68
+    /**
69
+     * 短信模版id
70
+     */
71
+    private Long smsTemplateId;
72
+    /**
73
+     * 发送短信的角色id
74
+     */
75
+    private List<Long> receiveRoleIds;
76
+    /**
77
+     * 接收短信角色名称
78
+     */
79
+    public List<JSONObject> receiveRoleNames;
68 80
 }

+ 7
- 0
ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysDeptMapper.java Прегледај датотеку

@@ -78,6 +78,13 @@ public interface SysDeptMapper
78 78
      */
79 79
     public SysDept checkDeptNameUnique(@Param("deptName") String deptName, @Param("parentId") Long parentId);
80 80
 
81
+    /**
82
+     * 根据部门名称查询部门信息
83
+     * @param deptName
84
+     * @return
85
+     */
86
+    public SysDept selectDeptByName(@Param("deptName") String deptName);
87
+
81 88
     /**
82 89
      * 新增部门信息
83 90
      * 

+ 6
- 6
ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysUserMapper.java Прегледај датотеку

@@ -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 Прегледај датотеку

@@ -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/flow/MsCaseFlowRoleSmsRelatedMapper.java Прегледај датотеку

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

+ 7
- 0
ruoyi-system/src/main/java/com/ruoyi/system/mapper/log/MsRequestLogMapper.java Прегледај датотеку

@@ -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
+}

+ 7
- 0
ruoyi-system/src/main/java/com/ruoyi/system/mapper/shortmessage/MeetingInfoMapper.java Прегледај датотеку

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

+ 7
- 0
ruoyi-system/src/main/java/com/ruoyi/system/mapper/shortmessage/MsSendMailHistoryRecordMapper.java Прегледај датотеку

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

+ 7
- 0
ruoyi-system/src/main/java/com/ruoyi/system/mapper/shortmessage/MsSmsSendHistoryRecordMapper.java Прегледај датотеку

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

+ 22
- 0
ruoyi-system/src/main/java/com/ruoyi/system/mapper/sms/MsSmsSendHistoryRecordParamMapper.java Прегледај датотеку

@@ -0,0 +1,22 @@
1
+package com.ruoyi.system.mapper.sms;
2
+
3
+import com.ruoyi.system.domain.entity.sms.MsSmsSendHistoryRecordParam;
4
+import org.apache.ibatis.annotations.Param;
5
+import org.apache.ibatis.annotations.Select;
6
+import tk.mybatis.mapper.common.Mapper;
7
+
8
+import java.util.List;
9
+
10
+public interface MsSmsSendHistoryRecordParamMapper extends Mapper<MsSmsSendHistoryRecordParam> {
11
+    /**
12
+     * 批量新增
13
+     * @param historyRecordParams
14
+     */
15
+    @Select("<script> INSERT INTO ms_sms_send_history_record_param (sms_record_history_id, param_value)\n" +
16
+            "       VALUES\n" +
17
+            "       <foreach item=\"item\" index=\"index\" collection=\"list\" separator=\",\">\n" +
18
+            "           (#{item.smsRecordHistoryId}, #{item.paramValue})\n" +
19
+            "       </foreach> " +
20
+            "</script>")
21
+    void batchInsert(@Param("list") List<MsSmsSendHistoryRecordParam> historyRecordParams);
22
+}

+ 22
- 0
ruoyi-system/src/main/java/com/ruoyi/system/mapper/sms/MsSmsSendRecordParamMapper.java Прегледај датотеку

@@ -0,0 +1,22 @@
1
+package com.ruoyi.system.mapper.sms;
2
+
3
+import com.ruoyi.system.domain.entity.sms.MsSmsSendRecordParam;
4
+import org.apache.ibatis.annotations.Param;
5
+import org.apache.ibatis.annotations.Select;
6
+import tk.mybatis.mapper.common.Mapper;
7
+
8
+import java.util.List;
9
+
10
+public interface MsSmsSendRecordParamMapper extends Mapper<MsSmsSendRecordParam> {
11
+    /**
12
+     * 批量插入
13
+     * @param list
14
+     */
15
+    @Select("<script> INSERT INTO ms_sms_send_record_param (sms_record_id, param_value)\n" +
16
+            "       VALUES\n" +
17
+            "       <foreach item=\"item\" index=\"index\" collection=\"list\" separator=\",\">\n" +
18
+            "           (#{item.smsRecordId}, #{item.paramValue})\n" +
19
+            "       </foreach> " +
20
+            "</script>")
21
+    void batchInsert(@Param("list") List<MsSmsSendRecordParam> list);
22
+}

+ 7
- 0
ruoyi-system/src/main/java/com/ruoyi/system/mapper/sms/MsSmsTemplateMapper.java Прегледај датотеку

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

+ 18
- 0
ruoyi-system/src/main/java/com/ruoyi/system/mapper/sms/MsSmsTemplateParamMapper.java Прегледај датотеку

@@ -0,0 +1,18 @@
1
+package com.ruoyi.system.mapper.sms;
2
+
3
+import com.ruoyi.system.domain.entity.sms.MsSmsTemplateParam;
4
+import org.apache.ibatis.annotations.Param;
5
+import org.apache.ibatis.annotations.Select;
6
+import tk.mybatis.mapper.common.Mapper;
7
+
8
+import java.util.List;
9
+
10
+public interface MsSmsTemplateParamMapper extends Mapper<MsSmsTemplateParam> {
11
+    @Select("<script> INSERT INTO ms_sms_template_param (sms_template_id, param,param_name)\n" +
12
+            "       VALUES\n" +
13
+            "       <foreach item=\"item\" index=\"index\" collection=\"list\" separator=\",\">\n" +
14
+            "           (#{item.smsTemplateId}, #{item.param}, #{item.paramName})\n" +
15
+            "       </foreach> " +
16
+            "</script>")
17
+    void batchInsert(@Param("list") List<MsSmsTemplateParam> templateParams);
18
+}

+ 83
- 0
ruoyi-system/src/main/java/com/ruoyi/system/service/BeiMingInterface.java Прегледај датотеку

@@ -0,0 +1,83 @@
1
+package com.ruoyi.system.service;
2
+
3
+import com.alibaba.fastjson.JSONObject;
4
+import com.ruoyi.common.enums.AttachmentOperateTypeEnum;
5
+import com.ruoyi.common.enums.DocumentTypeEnum;
6
+import com.ruoyi.wisdomarbitrate.domain.vo.mscase.MsCaseFileInfo;
7
+import com.ruoyi.wisdomarbitrate.domain.vo.mscase.MsCaseStatusInfo;
8
+
9
+import java.io.File;
10
+
11
+public interface BeiMingInterface {
12
+    /**
13
+     * 1.获取北明接口令牌token对象
14
+     *
15
+     * @param userName
16
+     * @param password
17
+     * @param times
18
+     * @return
19
+     */
20
+    String getApiToken(String userName, String password, Long times);
21
+
22
+
23
+    /**
24
+     * 2.提交案件状态信息
25
+     *
26
+     * @param token            令牌
27
+     * @param abutmentId       第三方平台案件唯一标识
28
+     * @param msCaseStatusInfo 案件状态信息
29
+     * @return
30
+     */
31
+    JSONObject submitCaseStatusInfo(String token, String abutmentId, String syncSource, MsCaseStatusInfo msCaseStatusInfo);
32
+
33
+    /**
34
+     * 3.上传附件
35
+     *
36
+     * @param file
37
+     * @return
38
+     */
39
+    JSONObject uploadFile(File file, String token, String syncSource);
40
+
41
+    /**
42
+     * 4.同步附件信息
43
+     *
44
+     * @param action
45
+     * @param caseNo
46
+     * @param msCaseFileInfo
47
+     * @return
48
+     */
49
+    JSONObject syncAttachmentInfo(String token, String syncSource, String action, String caseNo, MsCaseFileInfo msCaseFileInfo);
50
+
51
+    /**
52
+     * 推送案件状态信息(调解系统推送案件状态时调用)
53
+     *
54
+     * @param username               用户名
55
+     * @param password               密码
56
+     * @param caseNo                 案件编号
57
+     * @param statusCode             案件状态编码
58
+     * @param caseClosureExplanation 案件状态描述(或结案信息)
59
+     * @return
60
+     */
61
+    JSONObject pushCaseStatusInfo(String username, String password, String caseNo, String statusCode, String caseClosureExplanation);
62
+
63
+    /**
64
+     * 推送案件附件信息(调解系统推送案件附件信息时调用)
65
+     *
66
+     * @param username   用户名
67
+     * @param password   密码
68
+     * @param file       文件
69
+     * @param abutmentId 调解系统文件Id
70
+     * @param syncSource 用户名
71
+     * @param caseNo     案件编号
72
+     * @return
73
+     */
74
+    MsCaseFileInfo pushAttachmentInfo(String username, String password, File file, String syncSource, String caseNo, AttachmentOperateTypeEnum operateTypeEnum, DocumentTypeEnum documentTypeEnum);
75
+
76
+    /**
77
+     * 删除附件
78
+     * @param file
79
+     * @param caseNo
80
+     * @return
81
+     */
82
+    public JSONObject deleteAttachmentInfo( String caseNo,String fileId,String fileName);
83
+}

+ 17
- 2
ruoyi-system/src/main/java/com/ruoyi/system/service/ISysMenuService.java Прегледај датотеку

@@ -1,11 +1,13 @@
1 1
 package com.ruoyi.system.service;
2 2
 
3
-import java.util.List;
4
-import java.util.Set;
3
+import com.ruoyi.common.core.domain.AjaxResult;
5 4
 import com.ruoyi.common.core.domain.TreeSelect;
6 5
 import com.ruoyi.common.core.domain.entity.SysMenu;
7 6
 import com.ruoyi.system.domain.vo.RouterVo;
8 7
 
8
+import java.util.List;
9
+import java.util.Set;
10
+
9 11
 /**
10 12
  * 菜单 业务层
11 13
  * 
@@ -141,4 +143,17 @@ public interface ISysMenuService
141 143
      * @return 结果
142 144
      */
143 145
     public boolean checkMenuNameUnique(SysMenu menu);
146
+
147
+    /**
148
+     * 查询管理员权限
149
+     * @return
150
+     */
151
+
152
+    Set<String> selectAdminMenu();
153
+
154
+    /**
155
+     * 根据用户查询菜单权限字符
156
+     * @return
157
+     */
158
+    AjaxResult getMenuPermsByUser();
144 159
 }

+ 3
- 3
ruoyi-system/src/main/java/com/ruoyi/system/service/ISysRoleService.java Прегледај датотеку

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

+ 14
- 0
ruoyi-system/src/main/java/com/ruoyi/system/service/MsRequestLogService.java Прегледај датотеку

@@ -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
+}

+ 12
- 1
ruoyi-system/src/main/java/com/ruoyi/system/service/flow/CaseFlowService.java Прегледај датотеку

@@ -1,6 +1,7 @@
1 1
 package com.ruoyi.system.service.flow;
2 2
 
3 3
 import com.ruoyi.common.core.domain.AjaxResult;
4
+import com.ruoyi.system.domain.vo.flow.MsCaseFlowRoleSmsRelatedVO;
4 5
 import com.ruoyi.system.domain.vo.flow.MsCaseFlowSearchVO;
5 6
 import com.ruoyi.system.domain.vo.flow.MsCaseFlowVO;
6 7
 
@@ -9,18 +10,22 @@ import java.util.Set;
9 10
 public interface CaseFlowService {
10 11
     /**
11 12
      * 查询案件流程节点信息
13
+     *
12 14
      * @param caseFlowSearchVO
13 15
      * @return
14 16
      */
15 17
     Object queryCaseFlowInfo(MsCaseFlowSearchVO caseFlowSearchVO);
18
+
16 19
     /**
17 20
      * 查询案件流程信息
21
+     *
18 22
      * @return
19 23
      */
20 24
     AjaxResult selectCaseFlow();
21 25
 
22 26
     /**
23 27
      * 新增或编辑案件流程节点信息
28
+     *
24 29
      * @param caseFlowVO
25 30
      * @return
26 31
      */
@@ -28,6 +33,7 @@ public interface CaseFlowService {
28 33
 
29 34
     /**
30 35
      * 删除案件流程节点信息
36
+     *
31 37
      * @param caseFlowVO
32 38
      * @return
33 39
      */
@@ -35,6 +41,7 @@ public interface CaseFlowService {
35 41
 
36 42
     /**
37 43
      * 排序案件流程节点
44
+     *
38 45
      * @param caseFlowSearchVO
39 46
      * @return
40 47
      */
@@ -42,10 +49,14 @@ public interface CaseFlowService {
42 49
 
43 50
     /**
44 51
      * 查询用户角色关联的案件状态
52
+     *
45 53
      * @param roles
46 54
      * @return
47 55
      */
48 56
     Set<Integer> getCaseStatusIdByRoleKey(Set<String> roles);
49 57
 
50
-
58
+    /**
59
+     * 查询流程节点接收信息配置记录
60
+     */
61
+    MsCaseFlowRoleSmsRelatedVO queryFlowReceiveRoleSmsRelated(Integer flowId);
51 62
 }

+ 137
- 32
ruoyi-system/src/main/java/com/ruoyi/system/service/flow/CaseFlowServiceImpl.java Прегледај датотеку

@@ -1,5 +1,6 @@
1 1
 package com.ruoyi.system.service.flow;
2 2
 
3
+import com.alibaba.fastjson2.JSONObject;
3 4
 import com.github.pagehelper.PageHelper;
4 5
 import com.github.pagehelper.PageInfo;
5 6
 import com.ruoyi.common.core.domain.AjaxResult;
@@ -7,12 +8,15 @@ import com.ruoyi.common.core.domain.entity.SysRole;
7 8
 import com.ruoyi.common.core.page.TableDataInfo;
8 9
 import com.ruoyi.system.domain.entity.flow.MsCaseFlow;
9 10
 import com.ruoyi.system.domain.entity.flow.MsCaseFlowRoleRelated;
11
+import com.ruoyi.system.domain.entity.flow.MsCaseFlowRoleSmsRelated;
10 12
 import com.ruoyi.system.domain.vo.flow.MsBaseCaseFlow;
13
+import com.ruoyi.system.domain.vo.flow.MsCaseFlowRoleSmsRelatedVO;
11 14
 import com.ruoyi.system.domain.vo.flow.MsCaseFlowSearchVO;
12 15
 import com.ruoyi.system.domain.vo.flow.MsCaseFlowVO;
13 16
 import com.ruoyi.system.mapper.SysRoleMapper;
14 17
 import com.ruoyi.system.mapper.flow.MsCaseFlowMapper;
15 18
 import com.ruoyi.system.mapper.flow.MsCaseFlowRoleRelatedMapper;
19
+import com.ruoyi.system.mapper.flow.MsCaseFlowRoleSmsRelatedMapper;
16 20
 import com.ruoyi.system.util.NewStringUtil;
17 21
 import com.ruoyi.system.util.TableDataUtil;
18 22
 import org.springframework.beans.BeanUtils;
@@ -90,6 +94,30 @@ public class CaseFlowServiceImpl implements CaseFlowService {
90 94
                     MsCaseFlow msCaseFlow1 = msCaseFlowMapper.selectByPrimaryKey(msCaseFlow.getBackFlowId());
91 95
                     temp.setBackFlowName(msCaseFlow1 != null ? msCaseFlow1.getNodeName() : "");
92 96
                 }
97
+                //短信接收角色
98
+                if (msCaseFlow.getId() != null) {
99
+                    Example example1 = new Example(MsCaseFlowRoleSmsRelated.class);
100
+                    Example.Criteria criteria1 = example1.createCriteria();
101
+                    criteria1.andEqualTo("flowId", msCaseFlow.getId());
102
+                    List<MsCaseFlowRoleSmsRelated> msCaseFlowRoleSmsRelateds = msCaseFlowRoleSmsRelatedMapper.selectByExample(example1);
103
+                    List<JSONObject> receiveRoleNames = new ArrayList<>();
104
+                    List<Long> receiveRoleIds = new ArrayList<>();
105
+                    for (int k = 0; k < msCaseFlowRoleSmsRelateds.size(); k++) {
106
+                        MsCaseFlowRoleSmsRelated msCaseFlowRoleSmsRelated = msCaseFlowRoleSmsRelateds.get(k);
107
+                        if (msCaseFlowRoleSmsRelated.getReceiveRoleId() != null) {
108
+                            SysRole sysRole = sysRoleMapper.selectRoleById(msCaseFlowRoleSmsRelated.getReceiveRoleId());
109
+                            if (sysRole != null) {
110
+                                JSONObject jsonObject = new JSONObject();
111
+                                jsonObject.put("roleId", sysRole.getRoleId());
112
+                                jsonObject.put("roleName", sysRole.getRoleName());
113
+                                receiveRoleNames.add(jsonObject);
114
+                                receiveRoleIds.add(sysRole.getRoleId());
115
+                            }
116
+                        }
117
+                    }
118
+                    temp.setReceiveRoleIds(receiveRoleIds);
119
+                    temp.setReceiveRoleNames(receiveRoleNames);
120
+                }
93 121
                 list.add(temp);
94 122
             }
95 123
             TableDataInfo tableDataInfo = TableDataUtil.rebuildTableDataInfo(list, total);
@@ -134,15 +162,16 @@ public class CaseFlowServiceImpl implements CaseFlowService {
134 162
 
135 163
     /**
136 164
      * 本地图片装64
165
+     *
137 166
      * @param imgPath
138 167
      * @return
139 168
      * @throws Exception
140 169
      */
141
-    public static String convertToBase64( String imgPath)  {
170
+    public static String convertToBase64(String imgPath) {
142 171
         byte[] data = null;
143 172
         // 读取图片字节数组
144 173
         try {
145
-            imgPath=imgPath.replace("/profile/upload", "/home/ruoyi/uploadPath/upload/");
174
+            imgPath = imgPath.replace("/profile/upload", "/home/ruoyi/uploadPath/upload/");
146 175
             InputStream in = Files.newInputStream(Paths.get(imgPath));
147 176
             data = new byte[in.available()];
148 177
             in.read(data);
@@ -153,6 +182,7 @@ public class CaseFlowServiceImpl implements CaseFlowService {
153 182
         // 返回Base64编码过的字节数组字符串
154 183
         return Base64.getEncoder().encodeToString(Objects.requireNonNull(data));
155 184
     }
185
+
156 186
     /**
157 187
      * 新增或编辑案件流程节点信息
158 188
      *
@@ -161,40 +191,78 @@ public class CaseFlowServiceImpl implements CaseFlowService {
161 191
      */
162 192
     @Override
163 193
     public Boolean saveCaseFlow(MsCaseFlowVO caseFlowVO) {
164
-
165
-        if (caseFlowVO.getId() != null) {
166
-            //更新案件流程信息
167
-            MsCaseFlow msCaseFlow = new MsCaseFlow();
168
-            BeanUtils.copyProperties(caseFlowVO, msCaseFlow);
169
-            int i = msCaseFlowMapper.updateByPrimaryKey(msCaseFlow);
170
-            if (i > 0) {
171
-                //更新流程节点和角色之间的关系
172
-                updateFlowRoleByFlowId(msCaseFlow.getId(), caseFlowVO.getRoleIds());
173
-                return true;
174
-            }
175
-        } else {
176
-            int sort = 1;
177
-            Example example = new Example(MsCaseFlow.class);
178
-            example.setOrderByClause("sort DESC limit 1");
179
-            Example.Criteria criteria = example.createCriteria();
180
-            List<MsCaseFlow> msCaseFlows = msCaseFlowMapper.selectByExample(example);
181
-            if (msCaseFlows != null && msCaseFlows.size() > 0) {
182
-                sort = msCaseFlows.get(0).getSort() + 1;
183
-            }
184
-            //新增案件流程信息
185
-            MsCaseFlow msCaseFlow = new MsCaseFlow();
186
-            BeanUtils.copyProperties(caseFlowVO, msCaseFlow);
187
-            msCaseFlow.setSort(sort);
188
-            int insert = msCaseFlowMapper.insert(msCaseFlow);
189
-            if (insert > 0) {
190
-                //更新流程节点和角色之间的关系
191
-                updateFlowRoleByFlowId(msCaseFlow.getId(), caseFlowVO.getRoleIds());
192
-                return true;
194
+        try {
195
+            if (caseFlowVO.getId() != null) {
196
+                //更新案件流程信息
197
+                MsCaseFlow msCaseFlow = new MsCaseFlow();
198
+                BeanUtils.copyProperties(caseFlowVO, msCaseFlow);
199
+                int i = msCaseFlowMapper.updateByPrimaryKey(msCaseFlow);
200
+                if (i > 0) {
201
+                    //更新流程节点和角色之间的关系
202
+                    updateFlowRoleByFlowId(msCaseFlow.getId(), caseFlowVO.getRoleIds());
203
+                    //更新流程节点和短信模板之间的关系
204
+                    updateFlowMessageRoleByFlowId(msCaseFlow.getId(), caseFlowVO.getReceiveRoleIds(), caseFlowVO.getSmsTemplateId());
205
+                    return true;
206
+                } else {
207
+                    return false;
208
+                }
209
+            } else {
210
+                int sort = 1;
211
+                Example example = new Example(MsCaseFlow.class);
212
+                example.setOrderByClause("sort DESC limit 1");
213
+                Example.Criteria criteria = example.createCriteria();
214
+                List<MsCaseFlow> msCaseFlows = msCaseFlowMapper.selectByExample(example);
215
+                if (msCaseFlows != null && msCaseFlows.size() > 0) {
216
+                    sort = msCaseFlows.get(0).getSort() + 1;
217
+                }
218
+                //新增案件流程信息
219
+                MsCaseFlow msCaseFlow = new MsCaseFlow();
220
+                BeanUtils.copyProperties(caseFlowVO, msCaseFlow);
221
+                msCaseFlow.setSort(sort);
222
+                int insert = msCaseFlowMapper.insert(msCaseFlow);
223
+                if (insert > 0) {
224
+                    //更新流程节点和角色之间的关系
225
+                    updateFlowRoleByFlowId(msCaseFlow.getId(), caseFlowVO.getRoleIds());
226
+                    //更新流程节点和短信模板之间的关系
227
+                    updateFlowMessageRoleByFlowId(msCaseFlow.getId(), caseFlowVO.getReceiveRoleIds(), caseFlowVO.getSmsTemplateId());
228
+                    return true;
229
+                }
193 230
             }
231
+        } catch (Exception e) {
232
+            e.printStackTrace();
194 233
         }
195 234
         return false;
196 235
     }
197 236
 
237
+    @Autowired
238
+    MsCaseFlowRoleSmsRelatedMapper msCaseFlowRoleSmsRelatedMapper;
239
+
240
+    /**
241
+     * 更新流程节点和短信模板之间的关系
242
+     *
243
+     * @param flowId
244
+     * @param receiveRoleIds
245
+     * @param smsTemplateId
246
+     */
247
+    private void updateFlowMessageRoleByFlowId(Integer flowId, List<Long> receiveRoleIds, Long smsTemplateId) {
248
+        if (receiveRoleIds != null && receiveRoleIds.size() > 0) {
249
+            //删除历史流程与短信发送设置记录
250
+            Example example = new Example(MsCaseFlowRoleSmsRelated.class);
251
+            example.createCriteria().andEqualTo("flowId", flowId);
252
+            int count = msCaseFlowRoleSmsRelatedMapper.deleteByExample(example);
253
+            //新增流程节点与短信发送设置记录
254
+            for (int i = 0; i < receiveRoleIds.size(); i++) {
255
+                MsCaseFlowRoleSmsRelated msCaseFlowRoleSmsRelated = new MsCaseFlowRoleSmsRelated();
256
+                msCaseFlowRoleSmsRelated.setFlowId(flowId);
257
+                msCaseFlowRoleSmsRelated.setReceiveRoleId(receiveRoleIds.get(i));
258
+                msCaseFlowRoleSmsRelated.setSmsTemplateId(smsTemplateId);
259
+                msCaseFlowRoleSmsRelated.setCreateTime(new Date());
260
+                msCaseFlowRoleSmsRelatedMapper.insertSelective(msCaseFlowRoleSmsRelated);
261
+            }
262
+        }
263
+
264
+    }
265
+
198 266
     /**
199 267
      * 更新流程节点和角色之间的关系
200 268
      *
@@ -258,7 +326,6 @@ public class CaseFlowServiceImpl implements CaseFlowService {
258 326
     }
259 327
 
260 328
 
261
-
262 329
     /**
263 330
      * 排序案件流程节点
264 331
      *
@@ -352,6 +419,44 @@ public class CaseFlowServiceImpl implements CaseFlowService {
352 419
         return caseStatusIds;
353 420
     }
354 421
 
422
+    /**
423
+     * 查询流程节点接收信息配置记录
424
+     *
425
+     * @param flowId
426
+     */
427
+    @Override
428
+    public MsCaseFlowRoleSmsRelatedVO queryFlowReceiveRoleSmsRelated(Integer flowId) {
429
+        MsCaseFlowRoleSmsRelatedVO result = new MsCaseFlowRoleSmsRelatedVO();
430
+        //短信接收角色
431
+        if (flowId != null) {
432
+            Example example1 = new Example(MsCaseFlowRoleSmsRelated.class);
433
+            Example.Criteria criteria1 = example1.createCriteria();
434
+            criteria1.andEqualTo("flowId", flowId);
435
+            List<MsCaseFlowRoleSmsRelated> msCaseFlowRoleSmsRelateds = msCaseFlowRoleSmsRelatedMapper.selectByExample(example1);
436
+            List<JSONObject> receiveRoleNames = new ArrayList<>();
437
+            List<Long> receiveRoleIds = new ArrayList<>();
438
+            for (int k = 0; k < msCaseFlowRoleSmsRelateds.size(); k++) {
439
+                MsCaseFlowRoleSmsRelated msCaseFlowRoleSmsRelated = msCaseFlowRoleSmsRelateds.get(k);
440
+                if (k == 0) {
441
+                    BeanUtils.copyProperties(msCaseFlowRoleSmsRelated, result);
442
+                }
443
+                if (msCaseFlowRoleSmsRelated.getReceiveRoleId() != null) {
444
+                    SysRole sysRole = sysRoleMapper.selectRoleById(msCaseFlowRoleSmsRelated.getReceiveRoleId());
445
+                    if (sysRole != null) {
446
+                        JSONObject jsonObject = new JSONObject();
447
+                        jsonObject.put("roleId", sysRole.getRoleId());
448
+                        jsonObject.put("roleName", sysRole.getRoleName());
449
+                        receiveRoleNames.add(jsonObject);
450
+                        receiveRoleIds.add(sysRole.getRoleId());
451
+                    }
452
+                }
453
+            }
454
+            result.setReceiveRoleIds(receiveRoleIds);
455
+            result.setReceiveRoleNames(receiveRoleNames);
456
+        }
457
+        return result;
458
+    }
459
+
355 460
     /**
356 461
      * 查询角色的案件状态id
357 462
      *

+ 391
- 0
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/BeiMingInterfaceService.java Прегледај датотеку

@@ -0,0 +1,391 @@
1
+package com.ruoyi.system.service.impl;
2
+
3
+import com.alibaba.fastjson.JSON;
4
+import com.alibaba.fastjson.JSONObject;
5
+import com.fasterxml.jackson.databind.ObjectMapper;
6
+import com.fasterxml.jackson.databind.node.ObjectNode;
7
+import com.ruoyi.common.enums.AttachmentOperateTypeEnum;
8
+import com.ruoyi.common.enums.DocumentTypeEnum;
9
+import com.ruoyi.common.exception.ServiceException;
10
+import com.ruoyi.system.domain.entity.log.MsRequestLog;
11
+import com.ruoyi.system.service.BeiMingInterface;
12
+import com.ruoyi.system.service.MsRequestLogService;
13
+import com.ruoyi.wisdomarbitrate.domain.vo.mscase.MsCaseFileInfo;
14
+import com.ruoyi.wisdomarbitrate.domain.vo.mscase.MsCaseStatusInfo;
15
+import com.ruoyi.wisdomarbitrate.utils.CommonInputStreamResource;
16
+import lombok.extern.slf4j.Slf4j;
17
+import org.springframework.beans.factory.annotation.Autowired;
18
+import org.springframework.beans.factory.annotation.Value;
19
+import org.springframework.http.HttpEntity;
20
+import org.springframework.http.HttpHeaders;
21
+import org.springframework.stereotype.Service;
22
+import org.springframework.transaction.annotation.Transactional;
23
+import org.springframework.util.LinkedMultiValueMap;
24
+import org.springframework.util.MultiValueMap;
25
+import org.springframework.web.client.RestClientException;
26
+import org.springframework.web.client.RestTemplate;
27
+
28
+import java.io.File;
29
+import java.io.FileInputStream;
30
+import java.util.Date;
31
+import java.util.Objects;
32
+
33
+import static com.ruoyi.common.utils.EncryptUtils.sm4Decrypt;
34
+import static com.ruoyi.common.utils.EncryptUtils.sm4Encrypt;
35
+
36
+/**
37
+ * @author ym
38
+ */
39
+@Slf4j
40
+@Service
41
+public class BeiMingInterfaceService implements BeiMingInterface {
42
+    @Autowired
43
+    RestTemplate restTemplate;
44
+    @Autowired
45
+    MsRequestLogService requestLogService;
46
+    @Autowired
47
+    BeiMingInterfaceService beiMingInterfaceService;
48
+    /**
49
+     * 接口地址
50
+     */
51
+    @Value("${beimingapihost}")
52
+    public String apihost;
53
+    /**
54
+     * 接口路径前缀
55
+     */
56
+    @Value("${beimingapiprefix}")
57
+    public String apiprefix;
58
+    @Value("${beimingprivatekey}")
59
+    public String privateKey;
60
+    // 北明配置
61
+    @Value("${BMConfig.userName}")
62
+    private String BMUserName;
63
+    @Value("${BMConfig.password}")
64
+    private String BMPassword;
65
+    @Value("${BMConfig.syncSource}")
66
+    private String BMSyncSource;
67
+
68
+    /**
69
+     * 1.获取北明接口令牌token
70
+     *
71
+     * @param userName
72
+     * @param password
73
+     * @param times
74
+     */
75
+    @Transactional
76
+    @Override
77
+    public String getApiToken(String userName, String password, Long times) {
78
+        JSONObject result = new JSONObject();
79
+        MsRequestLog requestLog = new MsRequestLog();
80
+        try {
81
+            //设置请求头
82
+            HttpHeaders httpHeaders = new HttpHeaders();
83
+            //传递请求体时必须设置传递参数的格式,为Content-Type : application/json
84
+            httpHeaders.add("Content-Type", "application/json;charset=UTF-8");
85
+            httpHeaders.add("syncSource", userName);
86
+            // 2.请求头 & 请求体
87
+            HttpEntity<JSON> fromEntity = new HttpEntity(httpHeaders);
88
+            JSONObject body = new JSONObject();
89
+//            body.put("account", userName);
90
+//            body.put("password", password);
91
+//            body.put("timestamp", times);
92
+            //对整体请求进行加密
93
+            ObjectNode param = new ObjectMapper().createObjectNode();
94
+            param.put("account", userName);
95
+            param.put("password", password);
96
+            param.put("timestamp", times);
97
+            String encryptString = sm4Encrypt(param.toString(), privateKey);
98
+            body.put("encryptString", encryptString);
99
+            System.out.println("encryptString:" + encryptString);
100
+            fromEntity = new HttpEntity(body, httpHeaders);
101
+            String url = apihost + apiprefix + "/getToken";
102
+
103
+            requestLog.setRequestUrl(url);
104
+            requestLog.setContent(param.toString());
105
+            requestLog.setCreateTime((new Date()));
106
+            requestLog.setStatus(0);
107
+            result = restTemplate.postForObject(url, fromEntity, JSONObject.class);
108
+            requestLog.setReturnContent(result!=null?result.toString():null);
109
+        } catch (RestClientException e) {
110
+            e.printStackTrace();
111
+            requestLog.setReason(e.getMessage());
112
+            requestLog.setStatus(1);
113
+            requestLogService.insert(requestLog);
114
+            throw new ServiceException("推送失败");
115
+        }
116
+        requestLogService.insert(requestLog);
117
+        return analysisResultToken(Objects.requireNonNull(result).toString());
118
+    }
119
+
120
+
121
+    /**
122
+     * 解析加密后端token
123
+     *
124
+     * @param token
125
+     * @return
126
+     */
127
+    public String analysisResultToken(String token) {
128
+        String resultToken = null;
129
+        if (token != null && !token.isEmpty()) {
130
+            JSONObject jsonObject = JSON.parseObject(token);
131
+            String tokenString = jsonObject.getString("data");
132
+            String tokenstr = sm4Decrypt(tokenString, privateKey);
133
+            if (tokenstr != null && !tokenstr.isEmpty()) {
134
+                JSONObject tokenObject = JSON.parseObject(tokenstr);
135
+                resultToken = tokenObject.getString("token");
136
+            }
137
+        }
138
+        return resultToken;
139
+    }
140
+
141
+    /**
142
+     * 2.推送案件状态信息
143
+     *
144
+     * @param token            令牌
145
+     * @param abutmentId       第三方平台案件唯一标识
146
+     * @param msCaseStatusInfo 案件状态信息
147
+     * @param syncSource       同步来源(账户名)
148
+     * @return
149
+     */
150
+    @Transactional
151
+    @Override
152
+    public JSONObject submitCaseStatusInfo(String token, String abutmentId, String syncSource, MsCaseStatusInfo msCaseStatusInfo) {
153
+        JSONObject result = new JSONObject();
154
+        MsRequestLog requestLog = new MsRequestLog();
155
+        try {
156
+            //设置请求头
157
+            HttpHeaders httpHeaders = new HttpHeaders();
158
+            //传递请求体时必须设置传递参数的格式,为Content-Type : application/json
159
+            httpHeaders.add("Content-Type", "application/json;charset=UTF-8");
160
+            httpHeaders.add("token", token);
161
+            httpHeaders.add("syncSource", syncSource);
162
+            //对整体请求进行加密
163
+            ObjectNode param = new ObjectMapper().createObjectNode();
164
+            param.put("abutmentId", abutmentId);
165
+            param.put("caseNo", msCaseStatusInfo.getCaseNo());
166
+            param.put("statusCode", msCaseStatusInfo.getStatusCode());
167
+            param.put("caseClosureExplanation", msCaseStatusInfo.getCaseClosureExplanation());
168
+            String encryptString = sm4Encrypt(param.toString(), privateKey);
169
+            // 2.请求头 & 请求体
170
+            HttpEntity<JSON> fromEntity = new HttpEntity(httpHeaders);
171
+            JSONObject body = new JSONObject();
172
+//            body.put("abutmentId", Encrypt("abutmentId",abutmentId));
173
+//            body.put("caseNo", Encrypt("caseNo", msCaseStatusInfo.getCaseNo()));
174
+//            body.put("statusCode",  Encrypt("statusCode",msCaseStatusInfo.getStatusCode()));
175
+//            body.put("caseClosureExplanation", Encrypt("caseClosureExplanation", msCaseStatusInfo.getCaseClosureExplanation()));
176
+            //对整体请求进行加密
177
+            body.put("encryptString", encryptString);
178
+            fromEntity = new HttpEntity(body, httpHeaders);
179
+
180
+            String url = apihost + apiprefix + "/caseMediation/status";
181
+            requestLog.setRequestUrl(url);
182
+            requestLog.setContent(param.toString());
183
+            requestLog.setCreateTime((new Date()));
184
+            requestLog.setStatus(0);
185
+            result = restTemplate.postForObject(url, fromEntity, JSONObject.class);
186
+            requestLog.setReturnContent(result!=null?result.toString():null);
187
+        } catch (RestClientException e) {
188
+            e.printStackTrace();
189
+            requestLog.setReason(e.getMessage());
190
+            requestLog.setStatus(1);
191
+            requestLogService.insert(requestLog);
192
+            throw new ServiceException("推送失败");
193
+        }
194
+        requestLogService.insert(requestLog);
195
+        return result;
196
+
197
+    }
198
+
199
+    /**
200
+     * 3.上传附件
201
+     *
202
+     * @param file
203
+     * @return
204
+     */
205
+    @Transactional
206
+    @Override
207
+    public JSONObject uploadFile(File file, String token, String syncSource) {
208
+        System.out.println("文件:" + file.getName());
209
+        System.out.println("文件:" + file.toString());
210
+        JSONObject result = new JSONObject();
211
+        MsRequestLog requestLog = new MsRequestLog();
212
+        try {
213
+            //设置请求头
214
+            HttpHeaders httpHeaders = new HttpHeaders();
215
+            //传递请求体时必须设置传递参数的格式,为Content-Type : application/json
216
+            httpHeaders.add("Content-Type", "multipart/form-data");
217
+            httpHeaders.add("token", token);
218
+            httpHeaders.add("syncSource", syncSource);
219
+            // 构建请求体
220
+            MultiValueMap<String, Object> requestBody = new LinkedMultiValueMap<>();
221
+            CommonInputStreamResource commonInputStreamResource = null;
222
+            try {
223
+                FileInputStream fileInputStream = new FileInputStream(file);
224
+                commonInputStreamResource = new CommonInputStreamResource(fileInputStream, file.length(), file.getName());
225
+            } catch (Exception e) {
226
+                log.error("文件输入流转换错误", e);
227
+            }
228
+            requestBody.add("file", commonInputStreamResource);
229
+            HttpEntity<MultiValueMap> fromEntity = new HttpEntity<MultiValueMap>(requestBody, httpHeaders);
230
+            String url = apihost + apiprefix + "/uploadFile";
231
+            requestLog.setRequestUrl(url);
232
+            requestLog.setContent(fromEntity.toString());
233
+            requestLog.setCreateTime((new Date()));
234
+            requestLog.setStatus(0);
235
+            result = restTemplate.postForObject(url, fromEntity, JSONObject.class);
236
+            requestLog.setReturnContent(result!=null?result.toString():null);
237
+        } catch (RestClientException e) {
238
+            e.printStackTrace();
239
+            requestLog.setReason(e.getMessage());
240
+            requestLog.setStatus(1);
241
+            requestLogService.insert(requestLog);
242
+            throw new ServiceException("推送失败");
243
+        }
244
+        requestLogService.insert(requestLog);
245
+        return result;
246
+    }
247
+
248
+    /**
249
+     * 4.同步附件信息
250
+     *
251
+     * @param token
252
+     * @param syncSource     用户名
253
+     * @param action         附件操作类型
254
+     * @param caseNo         案件编号
255
+     * @param msCaseFileInfo 案件附件信息
256
+     * @return
257
+     */
258
+    @Transactional
259
+    @Override
260
+    public JSONObject syncAttachmentInfo(String token, String syncSource, String action, String caseNo, MsCaseFileInfo msCaseFileInfo) {
261
+        JSONObject result = new JSONObject();
262
+        MsRequestLog requestLog = new MsRequestLog();
263
+        try {
264
+            //设置请求头
265
+            HttpHeaders httpHeaders = new HttpHeaders();
266
+            //传递请求体时必须设置传递参数的格式,为Content-Type : application/json
267
+            httpHeaders.add("Content-Type", "application/json;charset=UTF-8");
268
+            httpHeaders.add("token", token);
269
+            httpHeaders.add("syncSource", syncSource);
270
+            //对整体请求进行加密
271
+            ObjectNode param = new ObjectMapper().createObjectNode();
272
+            param.put("caseNo", caseNo);
273
+            param.put("action", action);
274
+            param.put("abutmentId", msCaseFileInfo.getAbutmentId());
275
+            param.put("abutmentCaseId", msCaseFileInfo.getAbutmentCaseId());
276
+            param.put("documentSubject", msCaseFileInfo.getDocumentSubject());
277
+            param.put("documentType", msCaseFileInfo.getDocumentType());
278
+            param.put("fileName", msCaseFileInfo.getFileName());
279
+            param.put("fileId", msCaseFileInfo.getFileId());
280
+            if (msCaseFileInfo.getOwnerType() != null) {
281
+                param.put("ownerType", msCaseFileInfo.getOwnerType());
282
+            }
283
+            if (msCaseFileInfo.getOwnerId() != null) {
284
+                param.put("ownerId", msCaseFileInfo.getOwnerId());
285
+            }
286
+            if (msCaseFileInfo.getOwnerName() != null) {
287
+                param.put("ownerName", msCaseFileInfo.getOwnerName());
288
+            }
289
+            String encryptString = sm4Encrypt(param.toString(), privateKey);
290
+            // 2.请求体
291
+            HttpEntity<JSON> fromEntity = new HttpEntity(httpHeaders);
292
+            JSONObject body = new JSONObject();
293
+            //对整体请求进行加密
294
+            body.put("encryptString", encryptString);
295
+            fromEntity = new HttpEntity(body, httpHeaders);
296
+            String url = apihost + apiprefix + "/caseMediation/attachment/accept";
297
+            requestLog.setRequestUrl(url);
298
+            requestLog.setContent(param.toString());
299
+            requestLog.setCreateTime((new Date()));
300
+            requestLog.setStatus(0);
301
+            result = restTemplate.postForObject(url, fromEntity, JSONObject.class);
302
+            requestLog.setReturnContent(result!=null?result.toString():null);
303
+        } catch (RestClientException e) {
304
+            e.printStackTrace();
305
+            requestLog.setReason(e.getMessage());
306
+            requestLog.setStatus(1);
307
+            requestLogService.insert(requestLog);
308
+            throw new ServiceException("推送失败");
309
+        }
310
+        requestLogService.insert(requestLog);
311
+        return result;
312
+    }
313
+
314
+    /**
315
+     * 推送案件状态信息
316
+     */
317
+    @Transactional
318
+    @Override
319
+    public JSONObject pushCaseStatusInfo(String username, String password, String caseNo, String statusCode, String caseClosureExplanation) {
320
+        JSONObject result = new JSONObject();
321
+        String token = beiMingInterfaceService.getApiToken(username, password, System.currentTimeMillis());
322
+        if (token != null && !token.isEmpty()) {
323
+            MsCaseStatusInfo info = MsCaseStatusInfo.builder().caseNo(caseNo).statusCode(statusCode).caseClosureExplanation(caseClosureExplanation).build();
324
+            result = submitCaseStatusInfo(token, caseNo, username, info);
325
+            System.out.println("jieguo:" + result.toString());
326
+            if (result != null) {
327
+                String data = result.getString("data");
328
+                String datastr = sm4Decrypt(data, privateKey);
329
+                System.out.println("最终解密后的字符串:" + datastr);
330
+            }
331
+        }
332
+        return result;
333
+    }
334
+    /**
335
+     * 推送案件附件信息
336
+     */
337
+    @Transactional
338
+    @Override
339
+    public MsCaseFileInfo pushAttachmentInfo(String username, String password, File file, String syncSource, String caseNo, AttachmentOperateTypeEnum operateTypeEnum, DocumentTypeEnum documentTypeEnum) {
340
+        JSONObject result = new JSONObject();
341
+        MsCaseFileInfo fileInfo=null;
342
+        //1.获取token
343
+        String token = beiMingInterfaceService.getApiToken(username, password, System.currentTimeMillis());
344
+        if (token != null && !token.isEmpty()) {
345
+            //2.上传文件
346
+            JSONObject fileResult = uploadFile(file, token, syncSource);
347
+            if (fileResult != null) {
348
+                String data = fileResult.getString("data");
349
+                String datastr = sm4Decrypt(data, privateKey);
350
+                System.out.println("最终解密后的字符串:" + datastr);
351
+                if (datastr != null) {
352
+                    JSONObject parse = JSON.parseObject(datastr);
353
+                    if (parse != null) {
354
+                        String fileId = parse.getString("fileId");
355
+                        System.out.println("fileId====:" + fileId);
356
+                        if (fileId != null) {
357
+                            //3.同步附件更新信息
358
+                             fileInfo = MsCaseFileInfo.builder().fileId(fileId).fileName(file.getName()).abutmentId(fileId).abutmentCaseId(caseNo).documentSubject("EVEDENT").documentType(documentTypeEnum.getCode()).build();
359
+                            result = syncAttachmentInfo(token, username, operateTypeEnum.getCode(), caseNo, fileInfo);
360
+                            // 更新到附件表将fileId
361
+//                            result = syncAttachmentInfo(token, username, AttachmentOperateTypeEnum.UPD.getCode(), caseNo, fileInfo);
362
+//                            result = syncAttachmentInfo(token, username, AttachmentOperateTypeEnum.DEL.getCode(), caseNo, fileInfo);
363
+                        }
364
+                    }
365
+                }
366
+            }
367
+        }
368
+        return fileInfo;
369
+    }
370
+
371
+    @Override
372
+    public JSONObject deleteAttachmentInfo( String caseNo,String fileId,String fileName) {
373
+        String token = beiMingInterfaceService.getApiToken(BMUserName, BMPassword, System.currentTimeMillis());
374
+        MsCaseFileInfo fileInfo = MsCaseFileInfo.builder().fileId(fileId).fileName(fileName).abutmentId(fileId).abutmentCaseId(caseNo).documentSubject("EVEDENT").documentType("EVEDENT_METERIAL").build();
375
+
376
+        return  syncAttachmentInfo(token, BMUserName, AttachmentOperateTypeEnum.DEL.getCode(), caseNo, fileInfo);
377
+    }
378
+
379
+    /**
380
+     * 对字段值进行加密
381
+     *
382
+     * @return
383
+     */
384
+    private String Encrypt(String filed, String filedValue) {
385
+        ObjectNode param = new ObjectMapper().createObjectNode();
386
+        param.put(filed, filedValue);
387
+        String encryptString = sm4Encrypt(param.toString(), privateKey);
388
+        return encryptString;
389
+    }
390
+
391
+}

+ 27
- 0
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/MsRequestLogServiceImpl.java Прегледај датотеку

@@ -0,0 +1,27 @@
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
+import org.springframework.transaction.annotation.Propagation;
9
+import org.springframework.transaction.annotation.Transactional;
10
+
11
+/**
12
+ * @Classname MsRequestLogServiceImpl
13
+ * @Description TODO
14
+ * @Version 1.0.0
15
+ * @Date 2024/4/2 14:19
16
+ * @Created wangqiong
17
+ */
18
+@Service
19
+public class MsRequestLogServiceImpl implements MsRequestLogService {
20
+    @Autowired
21
+    private MsRequestLogMapper logMapper;
22
+    @Transactional(propagation = Propagation.REQUIRES_NEW)
23
+    @Override
24
+    public void insert(MsRequestLog requestLog) {
25
+        logMapper.insert(requestLog);
26
+    }
27
+}

+ 22
- 7
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDeptServiceImpl.java Прегледај датотеку

@@ -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;
3
+import cn.hutool.core.collection.CollectionUtil;
9 4
 import com.ruoyi.common.annotation.DataScope;
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,14 @@ 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 com.ruoyi.wisdomarbitrate.mapper.mscase.MsCaseApplicationMapper;
20
+import org.springframework.beans.factory.annotation.Autowired;
21
+import org.springframework.stereotype.Service;
22
+
23
+import java.util.ArrayList;
24
+import java.util.Iterator;
25
+import java.util.List;
26
+import java.util.stream.Collectors;
23 27
 
24 28
 /**
25 29
  * 部门管理 服务实现
@@ -34,6 +38,10 @@ public class SysDeptServiceImpl implements ISysDeptService
34 38
 
35 39
     @Autowired
36 40
     private SysRoleMapper roleMapper;
41
+    @Autowired
42
+    private RedisCache redisCache;
43
+    @Autowired
44
+    MsCaseApplicationMapper caseApplicationMapper;
37 45
 
38 46
     /**
39 47
      * 查询部门管理数据
@@ -221,7 +229,8 @@ public class SysDeptServiceImpl implements ISysDeptService
221 229
             }
222 230
             dept.setAncestors(info.getAncestors() + "," + dept.getParentId());
223 231
         }
224
-        return deptMapper.insertDept(dept);
232
+        int i = deptMapper.insertDept(dept);
233
+        return i;
225 234
     }
226 235
 
227 236
     /**
@@ -293,6 +302,12 @@ public class SysDeptServiceImpl implements ISysDeptService
293 302
     @Override
294 303
     public int deleteDeptById(Long deptId)
295 304
     {
305
+        // 查询部门是否与案件有关
306
+       List<Long> caseList = caseApplicationMapper.selectCaseByDeptId(deptId);
307
+       if(CollectionUtil.isNotEmpty(caseList)){
308
+           throw new ServiceException("该部门有关联案件,不允许删除");
309
+       }
310
+
296 311
         return deptMapper.deleteDeptById(deptId);
297 312
     }
298 313
 

+ 39
- 10
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysMenuServiceImpl.java Прегледај датотеку

@@ -1,17 +1,9 @@
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.Iterator;
7
-import java.util.LinkedList;
8
-import java.util.List;
9
-import java.util.Set;
10
-import java.util.stream.Collectors;
11
-import org.springframework.beans.factory.annotation.Autowired;
12
-import org.springframework.stereotype.Service;
3
+import cn.hutool.core.collection.CollectionUtil;
13 4
 import com.ruoyi.common.constant.Constants;
14 5
 import com.ruoyi.common.constant.UserConstants;
6
+import com.ruoyi.common.core.domain.AjaxResult;
15 7
 import com.ruoyi.common.core.domain.TreeSelect;
16 8
 import com.ruoyi.common.core.domain.entity.SysMenu;
17 9
 import com.ruoyi.common.core.domain.entity.SysRole;
@@ -24,6 +16,11 @@ import com.ruoyi.system.mapper.SysMenuMapper;
24 16
 import com.ruoyi.system.mapper.SysRoleMapper;
25 17
 import com.ruoyi.system.mapper.SysRoleMenuMapper;
26 18
 import com.ruoyi.system.service.ISysMenuService;
19
+import org.springframework.beans.factory.annotation.Autowired;
20
+import org.springframework.stereotype.Service;
21
+
22
+import java.util.*;
23
+import java.util.stream.Collectors;
27 24
 
28 25
 /**
29 26
  * 菜单 业务层处理
@@ -120,6 +117,36 @@ public class SysMenuServiceImpl implements ISysMenuService
120 117
         }
121 118
         return permsSet;
122 119
     }
120
+    /**
121
+     * 查询管理员权限
122
+     * @return
123
+     */
124
+    @Override
125
+    public Set<String> selectAdminMenu() {
126
+        Set<String> permsSet = new HashSet<>();
127
+        List<SysMenu> sysMenus = menuMapper.selectMenuList(new SysMenu());
128
+        Long caseMenuId =null;
129
+        if(CollectionUtil.isNotEmpty(sysMenus)){
130
+            Optional<SysMenu> optional = sysMenus.stream().filter(sysMenu -> sysMenu.getMenuName().equals("案件列表")).findFirst();
131
+            if(optional.isPresent()){
132
+                caseMenuId= optional.get().getMenuId();
133
+            }
134
+            for (SysMenu sysMenu : sysMenus) {
135
+                if(!sysMenu.getParentId().equals(caseMenuId)&&StringUtils.isNotEmpty(sysMenu.getPerms())){
136
+                    permsSet.addAll(Arrays.asList(sysMenu.getPerms().trim().split(",")));
137
+                }
138
+            }
139
+        }
140
+        return permsSet;
141
+    }
142
+
143
+    @Override
144
+    public AjaxResult getMenuPermsByUser() {
145
+        AjaxResult result = AjaxResult.success();
146
+        List<String> perms = menuMapper.selectMenuPermsByUserId(SecurityUtils.getUserId());
147
+        result.put("perms",perms);
148
+        return result;
149
+    }
123 150
 
124 151
     /**
125 152
      * 根据用户ID查询菜单
@@ -346,6 +373,8 @@ public class SysMenuServiceImpl implements ISysMenuService
346 373
         return UserConstants.UNIQUE;
347 374
     }
348 375
 
376
+
377
+
349 378
     /**
350 379
      * 获取路由名称
351 380
      * 

+ 29
- 18
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysRoleServiceImpl.java Прегледај датотеку

@@ -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
      * 根据条件分页查询角色数据
@@ -90,18 +93,11 @@ public class SysRoleServiceImpl implements ISysRoleService
90 93
      * @return 权限列表
91 94
      */
92 95
     @Override
93
-    public Set<String> selectRolePermissionByUserId(Long userId)
96
+    public  List<SysRole> selectRolePermissionByUserId(Long userId)
94 97
     {
95 98
         List<SysRole> perms = roleMapper.selectRolePermissionByUserId(userId);
96
-        Set<String> permsSet = new HashSet<>();
97
-        for (SysRole perm : perms)
98
-        {
99
-            if (StringUtils.isNotNull(perm))
100
-            {
101
-                permsSet.addAll(Arrays.asList(perm.getRoleKey().trim().split(",")));
102
-            }
103
-        }
104
-        return permsSet;
99
+
100
+        return perms;
105 101
     }
106 102
 
107 103
     /**
@@ -233,6 +229,7 @@ public class SysRoleServiceImpl implements ISysRoleService
233 229
     {
234 230
         // 新增角色信息
235 231
         roleMapper.insertRole(role);
232
+        redisCache.setCacheObject(CacheConstants.ROLE_KEY+role.getRoleName(),role.getRoleId());
236 233
         return insertRoleMenu(role);
237 234
     }
238 235
 
@@ -250,6 +247,7 @@ public class SysRoleServiceImpl implements ISysRoleService
250 247
         roleMapper.updateRole(role);
251 248
         // 删除角色与菜单关联
252 249
         roleMenuMapper.deleteRoleMenuByRoleId(role.getRoleId());
250
+        redisCache.setCacheObject(CacheConstants.ROLE_KEY+role.getRoleName(),role.getRoleId());
253 251
         return insertRoleMenu(role);
254 252
     }
255 253
 
@@ -341,10 +339,15 @@ public class SysRoleServiceImpl implements ISysRoleService
341 339
     @Transactional
342 340
     public int deleteRoleById(Long roleId)
343 341
     {
342
+        // 根据角色id查询角色名
343
+        SysRole role = roleMapper.selectRoleById(roleId);
344 344
         // 删除角色与菜单关联
345 345
         roleMenuMapper.deleteRoleMenuByRoleId(roleId);
346 346
         // 删除角色与部门关联
347 347
         roleDeptMapper.deleteRoleDeptByRoleId(roleId);
348
+        if(role!=null) {
349
+            redisCache.deleteObject(CacheConstants.ROLE_KEY + role.getRoleName());
350
+        }
348 351
         return roleMapper.deleteRoleById(roleId);
349 352
     }
350 353
 
@@ -358,6 +361,11 @@ public class SysRoleServiceImpl implements ISysRoleService
358 361
     @Transactional
359 362
     public int deleteRoleByIds(Long[] roleIds)
360 363
     {
364
+        List<SysRole> roles = roleMapper.selectRoleList(new SysRole());
365
+        if(CollectionUtil.isEmpty(roles)){
366
+            return 0;
367
+        }
368
+        Map<Long, String> roleMap = roles.stream().collect(Collectors.toMap(SysRole::getRoleId, SysRole::getRoleName, (n1, n2) -> n2));
361 369
         for (Long roleId : roleIds)
362 370
         {
363 371
             checkRoleAllowed(new SysRole(roleId));
@@ -367,6 +375,9 @@ public class SysRoleServiceImpl implements ISysRoleService
367 375
             {
368 376
                 throw new ServiceException(String.format("%1$s已分配,不能删除", role.getRoleName()));
369 377
             }
378
+            if(roleMap.containsKey(roleId)) {
379
+                redisCache.deleteObject(CacheConstants.ROLE_KEY + roleMap.get(roleId));
380
+            }
370 381
         }
371 382
         // 删除角色与菜单关联
372 383
         roleMenuMapper.deleteRoleMenu(roleIds);

+ 64
- 11
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserServiceImpl.java Прегледај датотеку

@@ -2,11 +2,13 @@ package com.ruoyi.system.service.impl;
2 2
 
3 3
 import cn.hutool.core.collection.CollectionUtil;
4 4
 import com.ruoyi.common.annotation.DataScope;
5
+import com.ruoyi.common.constant.CacheConstants;
5 6
 import com.ruoyi.common.constant.UserConstants;
6 7
 import com.ruoyi.common.core.domain.AjaxResult;
7 8
 import com.ruoyi.common.core.domain.entity.SysRole;
8 9
 import com.ruoyi.common.core.domain.entity.SysUser;
9 10
 import com.ruoyi.common.core.domain.entity.SysUserDept;
11
+import com.ruoyi.common.core.redis.RedisCache;
10 12
 import com.ruoyi.common.exception.ServiceException;
11 13
 import com.ruoyi.common.utils.DateUtils;
12 14
 import com.ruoyi.common.utils.SecurityUtils;
@@ -19,6 +21,7 @@ import com.ruoyi.system.domain.SysUserRole;
19 21
 import com.ruoyi.system.mapper.*;
20 22
 import com.ruoyi.system.service.ISysConfigService;
21 23
 import com.ruoyi.system.service.ISysUserService;
24
+import com.ruoyi.wisdomarbitrate.mapper.mscase.MsCaseApplicationMapper;
22 25
 import org.slf4j.Logger;
23 26
 import org.slf4j.LoggerFactory;
24 27
 import org.springframework.beans.factory.annotation.Autowired;
@@ -28,6 +31,7 @@ import org.springframework.util.CollectionUtils;
28 31
 
29 32
 import javax.validation.Validator;
30 33
 import java.util.ArrayList;
34
+import java.util.Arrays;
31 35
 import java.util.List;
32 36
 import java.util.stream.Collectors;
33 37
 
@@ -66,6 +70,10 @@ public class SysUserServiceImpl implements ISysUserService {
66 70
 
67 71
     @Autowired
68 72
     protected Validator validator;
73
+    @Autowired
74
+    private RedisCache redisCache;
75
+    @Autowired
76
+    MsCaseApplicationMapper msCaseApplicationMapper;
69 77
 
70 78
     /**
71 79
      * 根据条件分页查询用户列表
@@ -245,6 +253,7 @@ public class SysUserServiceImpl implements ISysUserService {
245 253
         user.setCreateBy("admin");
246 254
         user.setCreateTime(DateUtils.getNowDate());
247 255
         int rows = userMapper.insertUser(user);
256
+
248 257
         // 新增用户部门关联
249 258
         if(CollectionUtil.isNotEmpty(user.getDeptIds())) {
250 259
             // 先删除用户与部门关联
@@ -262,6 +271,8 @@ public class SysUserServiceImpl implements ISysUserService {
262 271
         insertUserPost(user);
263 272
         // 新增用户与角色管理
264 273
         insertUserRole(user);
274
+        // redis缓存
275
+        redisCache.setCacheObject(CacheConstants.USER_KEY+user.getUserId(),user);
265 276
         return AjaxResult.success("新建用户成功");
266 277
     }
267 278
 
@@ -273,7 +284,10 @@ public class SysUserServiceImpl implements ISysUserService {
273 284
      */
274 285
     @Override
275 286
     public boolean registerUser(SysUser user) {
276
-        return userMapper.insertUser(user) > 0;
287
+        int i = userMapper.insertUser(user);
288
+        // redis缓存
289
+        redisCache.setCacheObject(CacheConstants.USER_KEY+user.getUserId(),user);
290
+        return i > 0;
277 291
     }
278 292
 
279 293
     /**
@@ -308,6 +322,9 @@ public class SysUserServiceImpl implements ISysUserService {
308 322
         // 新增用户与岗位管理
309 323
         insertUserPost(user);
310 324
         userMapper.updateUser(user);
325
+        // redis缓存
326
+        user=userMapper.selectUserById(userId);
327
+        redisCache.setCacheObject(CacheConstants.USER_KEY+user.getUserId(),user);
311 328
         return AjaxResult.success("更新用户成功");
312 329
     }
313 330
 
@@ -332,7 +349,10 @@ public class SysUserServiceImpl implements ISysUserService {
332 349
      */
333 350
     @Override
334 351
     public int updateUserStatus(SysUser user) {
335
-        return userMapper.updateUser(user);
352
+        int i = userMapper.updateUser(user);
353
+        // redis缓存
354
+       // redisCache.setCacheObject(CacheConstants.USER_KEY+user.getUserId(),user);
355
+        return i;
336 356
     }
337 357
 
338 358
     /**
@@ -343,7 +363,11 @@ public class SysUserServiceImpl implements ISysUserService {
343 363
      */
344 364
     @Override
345 365
     public int updateUserProfile(SysUser user) {
346
-        return userMapper.updateUser(user);
366
+        int i = userMapper.updateUser(user);
367
+        // redis缓存
368
+        user=userMapper.selectUserById(user.getUserId());
369
+        redisCache.setCacheObject(CacheConstants.USER_KEY+user.getUserId(),user);
370
+        return i;
347 371
     }
348 372
 
349 373
     /**
@@ -366,7 +390,8 @@ public class SysUserServiceImpl implements ISysUserService {
366 390
      */
367 391
     @Override
368 392
     public int resetPwd(SysUser user) {
369
-        return userMapper.updateUser(user);
393
+        int i = userMapper.updateUser(user);
394
+        return i;
370 395
     }
371 396
 
372 397
     /**
@@ -440,10 +465,20 @@ public class SysUserServiceImpl implements ISysUserService {
440 465
     @Transactional
441 466
     public int deleteUserById(Long userId) {
442 467
         // 删除用户与角色关联
443
-        userRoleMapper.deleteUserRoleByUserId(userId);
468
+       // userRoleMapper.deleteUserRoleByUserId(userId);
444 469
         // 删除用户与岗位表
445
-        userPostMapper.deleteUserPostByUserId(userId);
446
-        return userMapper.deleteUserById(userId);
470
+       // userPostMapper.deleteUserPostByUserId(userId);
471
+        // 与案件有关的人员不能删除
472
+        List<Long> userIds = new ArrayList<>();
473
+        userIds.add(userId);
474
+        List<Long> caseIds= msCaseApplicationMapper.countCasePerson(userIds);
475
+        if(CollectionUtil.isNotEmpty(caseIds)){
476
+            throw new ServiceException("该人员已参与案件,不能删除");
477
+        }
478
+        int i = userMapper.deleteUserById(userId);
479
+        // 删除缓存
480
+        redisCache.deleteObject(CacheConstants.USER_KEY+userId);
481
+        return i;
447 482
     }
448 483
 
449 484
     /**
@@ -455,17 +490,30 @@ public class SysUserServiceImpl implements ISysUserService {
455 490
     @Override
456 491
     @Transactional
457 492
     public int deleteUserByIds(Long[] userIds) {
493
+        // 校验是否与案件关联
494
+        if(userIds==null || userIds.length==0){
495
+            throw new ServiceException("请选择删除的用户");
496
+        }
497
+        List<Long> caseIds= msCaseApplicationMapper.countCasePerson(new ArrayList<>(Arrays.asList(userIds)));
498
+        if(CollectionUtil.isNotEmpty(caseIds)){
499
+            throw new ServiceException("删除人员中存在与案件关联的人员,不能删除");
500
+        }
458 501
         for (Long userId : userIds) {
459 502
             checkUserAllowed(new SysUser(userId));
460 503
             checkUserDataScope(userId);
461 504
         }
462 505
         // 删除用户与角色关联
463
-        userRoleMapper.deleteUserRole(userIds);
506
+      //  userRoleMapper.deleteUserRole(userIds);
464 507
         // 删除用户与岗位关联
465
-        userPostMapper.deleteUserPost(userIds);
508
+     //   userPostMapper.deleteUserPost(userIds);
466 509
         // 删除用户部门关联
467
-        userDeptMapper.deleteUserByIds(userIds);
468
-        return userMapper.deleteUserByIds(userIds);
510
+      //  userDeptMapper.deleteUserByIds(userIds);
511
+        int i = userMapper.deleteUserByIds(userIds);
512
+            for (Long userId : userIds) {
513
+                // 删除缓存
514
+                redisCache.deleteObject(CacheConstants.USER_KEY+userId);
515
+            }
516
+        return i;
469 517
     }
470 518
 
471 519
     /**
@@ -495,6 +543,8 @@ public class SysUserServiceImpl implements ISysUserService {
495 543
                     user.setPassword(SecurityUtils.encryptPassword(password));
496 544
                     user.setCreateBy(operName);
497 545
                     userMapper.insertUser(user);
546
+                    // redis缓存
547
+                    redisCache.setCacheObject(CacheConstants.USER_KEY+user.getUserId(),user);
498 548
                     successNum++;
499 549
                     successMsg.append("<br/>" + successNum + "、账号 " + user.getUserName() + " 导入成功");
500 550
                 } else if (isUpdateSupport) {
@@ -504,6 +554,9 @@ public class SysUserServiceImpl implements ISysUserService {
504 554
                     user.setUserId(u.getUserId());
505 555
                     user.setUpdateBy(operName);
506 556
                     userMapper.updateUser(user);
557
+                    // redis缓存
558
+                    user=userMapper.selectUserById(user.getUserId());
559
+                    redisCache.setCacheObject(CacheConstants.USER_KEY+user.getUserId(),user);
507 560
                     successNum++;
508 561
                     successMsg.append("<br/>" + successNum + "、账号 " + user.getUserName() + " 更新成功");
509 562
                 } else {

+ 12
- 0
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/dto/miniprogress/IdentityAuthentication.java Прегледај датотеку

@@ -31,6 +31,10 @@ public class IdentityAuthentication   extends BaseEntity {
31 31
      * 短信验证码
32 32
      */
33 33
     private String VerifyCode;
34
+    /**
35
+     * email验证码
36
+     */
37
+    private String emailVerifyCode;
34 38
     private String passWord;
35 39
     private String phone;
36 40
     /**
@@ -47,6 +51,14 @@ public class IdentityAuthentication   extends BaseEntity {
47 51
     /** 认证状态 */
48 52
     private Integer certificationStatus;
49 53
 
54
+    public String getEmailVerifyCode() {
55
+        return emailVerifyCode;
56
+    }
57
+
58
+    public void setEmailVerifyCode(String emailVerifyCode) {
59
+        this.emailVerifyCode = emailVerifyCode;
60
+    }
61
+
50 62
     public Integer getCertificationStatus() {
51 63
         return certificationStatus;
52 64
     }

+ 11
- 1
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/dto/sendrecord/SendMailRecord.java Прегледај датотеку

@@ -3,9 +3,10 @@ package com.ruoyi.wisdomarbitrate.domain.dto.sendrecord;
3 3
 import com.fasterxml.jackson.annotation.JsonFormat;
4 4
 import com.ruoyi.common.annotation.Excel;
5 5
 import com.ruoyi.common.core.domain.BaseEntity;
6
+import lombok.Data;
6 7
 
7 8
 import java.util.Date;
8
-
9
+@Data
9 10
 public class SendMailRecord   extends BaseEntity {
10 11
     private static final long serialVersionUID = 1L;
11 12
 
@@ -40,6 +41,15 @@ public class SendMailRecord   extends BaseEntity {
40 41
     private Integer sendStatus;
41 42
 
42 43
 
44
+    /** 附件id */
45
+    private String fileIds;
46
+
47
+    /** 邮件主题 */
48
+    private String mailSubject;
49
+
50
+    /** 邮件发件人地址 */
51
+    private String mailFromAddress;
52
+
43 53
 
44 54
     public Integer getSendStatus() {
45 55
         return sendStatus;

+ 29
- 5
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/dto/sendrecord/SmsSendRecord.java Прегледај датотеку

@@ -2,11 +2,13 @@ package com.ruoyi.wisdomarbitrate.domain.dto.sendrecord;
2 2
 
3 3
 import com.fasterxml.jackson.annotation.JsonFormat;
4 4
 import com.ruoyi.common.core.domain.BaseEntity;
5
+import com.ruoyi.system.domain.entity.sms.MsSmsTemplateParam;
5 6
 import lombok.AllArgsConstructor;
6 7
 import lombok.Data;
7 8
 import lombok.NoArgsConstructor;
8 9
 
9 10
 import java.util.Date;
11
+import java.util.List;
10 12
 
11 13
 @Data
12 14
 @AllArgsConstructor
@@ -16,6 +18,10 @@ public class SmsSendRecord extends BaseEntity {
16 18
      * ID
17 19
      */
18 20
     private Long id;
21
+    /**
22
+     * 短信模板主键id
23
+     */
24
+    private Long msSmsTemplateId;
19 25
     /**
20 26
      * 案件申请id
21 27
      */
@@ -33,21 +39,39 @@ public class SmsSendRecord extends BaseEntity {
33 39
      */
34 40
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
35 41
     private Date sendTime;
36
-    /**
37
-     * 发送内容
38
-     */
39
-    private String sendContent;
40 42
 
41 43
     /**
42 44
      * 发送状态
43 45
      */
44 46
     private Integer sendStatus;
47
+    /**
48
+     * 短信sid,发送的唯一标识
49
+     */
50
+    private String sid;
51
+    /**
52
+     * 失败原因
53
+     */
54
+    private String reason;
55
+    /**
56
+     * 短信内容
57
+     */
58
+    private String sendContent;
59
+    /**
60
+     * 腾讯云模板id
61
+     */
62
+    private String templateId;
63
+    /**
64
+     * 模板内容
65
+     */
66
+    private String templateContent;
67
+    private List<MsSmsTemplateParam> templateParams;
45 68
 
46
-    public SmsSendRecord(Long caseId, String caseNum, String phone, Date sendTime, String sendContent) {
69
+    public SmsSendRecord(Long caseId, String caseNum, String phone, Date sendTime, String sendContent,String sid) {
47 70
         this.caseId = caseId;
48 71
         this.caseNum = caseNum;
49 72
         this.phone = phone;
50 73
         this.sendTime = sendTime;
51 74
         this.sendContent = sendContent;
75
+        this.sid = sid;
52 76
     }
53 77
 }

+ 76
- 93
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/entity/mscase/MsCaseAffiliate.java Прегледај датотеку

@@ -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,143 @@ 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 46
     /**
48
-     * 申请人联系电话
47
+     * 用户名
49 48
      */
50
-    @Column(name = "application_phone")
51
-    private String applicationPhone;
52
-    /**
53
-     * 申请人邮箱
54
-     */
55
-    @Column(name = "application_email")
56
-    private String applicationEmail;
49
+    @Transient
50
+    private String userName;
57 51
 
58 52
     /**
59 53
      * 法定代表人
60 54
      */
61
-    @Column(name = "comp_legal_person")
55
+    @Transient
62 56
     private String compLegalPerson;
63
-
64 57
     /**
65
-     * 申请人住所
58
+     * 角色类别,1-申请操作人/申请人,2-申请人代理人,3-被申请人操作人/被申请人,4-被申请人代理人
66 59
      */
67
-    @Column(name = "applicant_home")
68
-    private String applicantHome;
69
-
60
+    @Column(name = "role_type")
61
+    private Integer roleType=1;
70 62
     /**
71
-     * 申请人联系地址
63
+     * 组别
72 64
      */
73
-    @Column(name = "applicant_address")
74
-    private String applicantAddress;
75
-
65
+    @Column(name = "group_order")
66
+    private Integer groupOrder;
76 67
     /**
77
-     * 委托代理人姓名
68
+     * 是否操作人,0-否,1-是
78 69
      */
79
-    @Column(name = "name_agent")
80
-    private String nameAgent;
81
-
70
+    @Column(name = "operator_flag")
71
+    private Integer operatorFlag=1;
82 72
     /**
83
-     * 代理人联系电话
73
+     * 是否机构申请,0-自然人,1-申请机构,默认0
84 74
      */
85
-    @Column(name = "contact_telphone_agent")
86
-    private String contactTelphoneAgent;
87
-
75
+    @Column(name = "organize_flag")
76
+    private Integer organizeFlag=0;
88 77
     /**
89
-     * 代理人邮箱
78
+     * 电话
90 79
      */
91
-    @Column(name = "agent_email")
92
-    private String agentEmail;
93
-
80
+    @Transient
81
+    private String phone;
94 82
     /**
95
-     * 申请人快递单号
83
+     * 邮箱
96 84
      */
97
-    @Column(name = "applicant_track_num")
98
-    private String applicantTrackNum;
99
-
85
+    @Transient
86
+    private String email;
100 87
     /**
101
-     * 被申请人姓名
88
+     * 姓名
102 89
      */
103
-    @Column(name = "respondent_name")
104
-    private String respondentName;
105
-
90
+    @Transient
91
+    private String name;
106 92
     /**
107
-     * 被申请人身份证号
93
+     * 住所
108 94
      */
109
-    @Column(name = "respondent_identity_num")
110
-    private String respondentIdentityNum;
95
+    @Transient
96
+    private String home;
111 97
     /**
112
-     * 被申请人联系电话
98
+     * 联系地址
113 99
      */
114
-    @Column(name = "respondent_phone")
115
-    private String respondentPhone;
116
-
100
+    @Transient
101
+    private String address;
117 102
     /**
118
-     * 被申请人性别(0=男,女=1)
103
+     * 身份证号
119 104
      */
120
-    @Column(name = "respondent_sex")
121
-    private String respondentSex;
105
+    @Transient
106
+    private String idCard;
122 107
 
123 108
     /**
124
-     * 被申请人出生年月日
109
+     * '身份类别,0-身份证,1-护照,默认0'
125 110
      */
126
-    @Column(name = "respondent_birth")
127
-    private Date respondentBirth;
128
-
111
+    @Transient
112
+    private Integer idType;
129 113
     /**
130
-     * 被申请人申请人住所
114
+     * 国籍,0-境内,1-境外,默认0
131 115
      */
132
-    @Column(name = "respondent_home")
133
-    private String respondentHome;
134
-
116
+    @Transient
117
+    private Integer nationality;
135 118
     /**
136
-     * 被申请人邮箱
119
+     * 生日
137 120
      */
138
-    @Column(name = "respondent_email")
139
-    private String respondentEmail;
140
-
121
+    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "Asia/Shanghai")
122
+    @Transient
123
+    private Date birth;
141 124
     /**
142
-     * 被申请人快递单号
125
+     * 性别,0-男,1-女
143 126
      */
144
-    @Column(name = "respondent_track_num")
145
-    private String respondentTrackNum;
146
-
127
+    @Transient
128
+    private String sex;
147 129
     /**
148
-     * 申请人是否签收
130
+     * 被申请人姓名
149 131
      */
150
-    @Column(name = "is_sign_apply")
151
-    private Integer isSignApply;
132
+    @Transient
133
+    private String resName;
152 134
     /**
153
-     * 被申请人是否签收
135
+     * 角色名称
154 136
      */
155
-    @Column(name = "is_sign_respon")
156
-    private Integer isSignRespon;
137
+    @Transient
138
+    private String roleName;
157 139
     /**
158
-     * 身份类别,0-身份证,1-护照,默认0
140
+     * 申请机构名称
159 141
      */
160
-    @Column(name = "id_type")
161
-    private Integer idType;
142
+    @Transient
143
+    private String applicantOrgName;
162 144
     /**
163
-     * 国籍,0-国内,1-国外,默认0
145
+     * 角色id
164 146
      */
165
-    @Column(name = "nationality")
166
-    private Integer nationality;
147
+    @Transient
148
+    private Long roleId;
149
+
167 150
 }

+ 19
- 4
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/entity/mscase/MsCaseApplication.java Прегледај датотеку

@@ -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
 
@@ -209,4 +206,22 @@ public class MsCaseApplication {
209 206
     @Column(name = "is_reconci")
210 207
     private Integer isReconci;
211 208
 
209
+    /**
210
+     * 案件来源,YC-乙巢,空字符串-北明
211
+     */
212
+    @Column(name = "case_source")
213
+    private String caseSource;
214
+    /**
215
+     * 是否需要用印,1-需要
216
+     */
217
+    @Column(name = "seal_flag")
218
+    private Integer sealFlag;
219
+    /**
220
+     * 拒绝原因
221
+     */
222
+    @Transient
223
+    private String rejectReason;
224
+    @Transient
225
+    private Integer organizeFlag=0;
226
+
212 227
 }

+ 10
- 0
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/entity/mscase/MsCaseAttach.java Прегледај датотеку

@@ -77,4 +77,14 @@ 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;
85
+    /**
86
+     * 附件后缀
87
+     */
88
+    @Column(name = "suffix")
89
+    private String suffix;
80 90
 }

+ 32
- 0
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/vo/mscase/MsCaseAffiliateBase.java Прегледај датотеку

@@ -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 Прегледај датотеку

@@ -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 Прегледај датотеку

@@ -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
+}

+ 22
- 1
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/vo/mscase/MsCaseApplicationReq.java Прегледај датотеку

@@ -107,5 +107,26 @@ public class MsCaseApplicationReq {
107 107
      * 代理人电话
108 108
      */
109 109
     private String contactTelphoneAgent;
110
-
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;
123
+    /**
124
+     * 案件id
125
+     */
126
+    private Long caseId;
127
+    /**
128
+     * 是否需要用印,0-不需要,1-需要
129
+     */
130
+    // todo 等会放开
131
+    private Integer sealFlag=1;
111 132
 }

+ 21
- 2
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/vo/mscase/MsCaseApplicationVO.java Прегледај датотеку

@@ -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,25 @@ 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;
98
+    /**
99
+     * 调解书上传下载按钮权限,调解员,顾问在调节之后,送达之前显示,0-否,1-是
100
+     */
101
+    private Integer mediationFileFlag=0;
102
+    /**
103
+     * 是否申请人被申请人签收按钮权限,0-否,1-是
104
+     */
105
+    private Integer signFlag=0;
87 106
 
88 107
 }

+ 54
- 0
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/vo/mscase/MsCaseFileInfo.java Прегледај датотеку

@@ -0,0 +1,54 @@
1
+package com.ruoyi.wisdomarbitrate.domain.vo.mscase;
2
+
3
+import lombok.AllArgsConstructor;
4
+import lombok.Builder;
5
+import lombok.Data;
6
+import lombok.NoArgsConstructor;
7
+
8
+/**
9
+ * 北明接口案件附件信息入参
10
+ */
11
+@Data
12
+@NoArgsConstructor
13
+@AllArgsConstructor
14
+@Builder
15
+public class MsCaseFileInfo {
16
+
17
+    /**
18
+     * 第三方文件唯一标识
19
+     */
20
+    private String abutmentId;
21
+    /**
22
+     * 第三方平台案件唯一标识
23
+     */
24
+    private String abutmentCaseId;
25
+    /**
26
+     * 第一级文件类型
27
+     */
28
+    private String documentSubject;
29
+    /**
30
+     * 第二级文件类型
31
+     */
32
+    private String documentType;
33
+    /**
34
+     * 所属人类型(可不传)
35
+     */
36
+    private String ownerType;
37
+    /**
38
+     * 文件所属人第三方平台对应的人员唯一标识(可不传)
39
+     */
40
+    private String ownerId;
41
+    /**
42
+     * 文件所属人名称(可不传)
43
+     */
44
+    private String ownerName;
45
+    /**
46
+     * 文件名称
47
+     */
48
+    private String fileName;
49
+    /**
50
+     * 一站式平台返回的文件ID
51
+     */
52
+    private String fileId;
53
+
54
+}

+ 35
- 0
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/vo/mscase/MsCaseStatusInfo.java Прегледај датотеку

@@ -0,0 +1,35 @@
1
+package com.ruoyi.wisdomarbitrate.domain.vo.mscase;
2
+
3
+import lombok.*;
4
+
5
+import javax.persistence.Column;
6
+import javax.persistence.GeneratedValue;
7
+import javax.persistence.Id;
8
+import javax.persistence.Table;
9
+
10
+/**
11
+ * 北明接口案件状态入参
12
+ */
13
+@Data
14
+@NoArgsConstructor
15
+@AllArgsConstructor
16
+@Builder
17
+public class MsCaseStatusInfo {
18
+    /**
19
+     * 案号
20
+     * 案件状态编码
21
+     * 结案说明
22
+     */
23
+    private String  caseNo;
24
+
25
+    /**
26
+     * 案件状态编码
27
+     */
28
+    private String statusCode;
29
+
30
+    /**
31
+     * 结案说明
32
+     */
33
+    private String caseClosureExplanation;
34
+
35
+}

+ 41
- 0
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/vo/shortmessage/MeetingInfoVO.java Прегледај датотеку

@@ -0,0 +1,41 @@
1
+package com.ruoyi.wisdomarbitrate.domain.vo.shortmessage;
2
+
3
+import lombok.AllArgsConstructor;
4
+import lombok.Builder;
5
+import lombok.Data;
6
+import lombok.NoArgsConstructor;
7
+
8
+@Data
9
+@Builder
10
+@NoArgsConstructor
11
+@AllArgsConstructor
12
+public class MeetingInfoVO {
13
+    /**
14
+     * 案件Id
15
+     */
16
+    private Long caseId;
17
+
18
+    /**
19
+     * 用户Id
20
+     */
21
+    private Long userId;
22
+
23
+    /**
24
+     * 用户名称
25
+     */
26
+    private String userName;
27
+
28
+    /**
29
+     * 房间Id
30
+     */
31
+    private String roomId;
32
+
33
+    /**
34
+     * 系统类型
35
+     */
36
+    private String systemType;
37
+    /**
38
+     * 登录认证令牌
39
+     */
40
+    private String token;
41
+}

+ 33
- 0
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/vo/shortmessage/ReSendMessageVO.java Прегледај датотеку

@@ -0,0 +1,33 @@
1
+package com.ruoyi.wisdomarbitrate.domain.vo.shortmessage;
2
+
3
+import com.ruoyi.system.domain.entity.sms.MsSmsTemplateParam;
4
+import lombok.AllArgsConstructor;
5
+import lombok.Builder;
6
+import lombok.Data;
7
+import lombok.NoArgsConstructor;
8
+
9
+import java.util.List;
10
+
11
+@Data
12
+@Builder
13
+@NoArgsConstructor
14
+@AllArgsConstructor
15
+public class ReSendMessageVO {
16
+    /**
17
+     * 短信模版Id
18
+     */
19
+    private String templateId;
20
+    /**
21
+     * 手机号
22
+     */
23
+    private String phone;
24
+    /**
25
+     * 短信id
26
+     */
27
+    private Long id;
28
+    /**
29
+     * 短信模版参数值
30
+     */
31
+    private List<MsSmsTemplateParam> templateParams;
32
+
33
+}

+ 23
- 0
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/mscase/MsCaseAffiliateMapper.java Прегледај датотеку

@@ -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
 }

+ 15
- 153
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/mscase/MsCaseApplicationMapper.java Прегледај датотеку

@@ -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,19 @@ public interface MsCaseApplicationMapper extends Mapper<MsCaseApplication> {
162 51
     @Select("select max(room_id) maxRoomId from ms_reserved_conference")
163 52
     Long selectMaxRoomId();
164 53
 
54
+    List<CaseToDoCount> todoCount(@Param("req")MsCaseApplicationReq req, @Param("caseFlowIds") List<Integer> caseFlowIds, @Param("roleIds") List<Long> roleIds);
55
+
56
+    /**
57
+     * 根据用户id查询是否和案件有关
58
+     * @param userIds
59
+     * @return
60
+     */
61
+    List<Long> countCasePerson(@Param("userIds") List<Long> userIds);
62
+
165 63
     /**
166
-     * 待办数量
167
-     * @param o
64
+     * 查询部门是否与案件有关
65
+     * @param deptId
168 66
      * @return
169 67
      */
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);
68
+    List<Long> selectCaseByDeptId(@Param("deptId") Long deptId);
207 69
 }

+ 1
- 0
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/mscase/MsCaseAttachMapper.java Прегледај датотеку

@@ -25,6 +25,7 @@ public interface MsCaseAttachMapper {
25 25
     int deleteByFileIds(@Param("ids") List<Integer> fileIds);
26 26
 
27 27
     List<MsCaseAttach> listCaseAttachByCaseIdAndType(@Param("caseAppliId")Long caseAppliId,@Param("annexType") int annexType);
28
+    List<MsCaseAttach> listCaseAttachByCaseIdAndTypes(@Param("caseAppliId")Long caseAppliId,@Param("annexTypes") List<Integer> annexTypes);
28 29
 
29 30
     MsCaseAttach queryAnnexById(@Param("annexId") Long annexId);
30 31
 

+ 25
- 3
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/sendrecord/SendMailRecordMapper.java Прегледај датотеку

@@ -5,10 +5,32 @@ import com.ruoyi.wisdomarbitrate.domain.dto.sendrecord.SendMailRecord;
5 5
 import java.util.List;
6 6
 
7 7
 public interface SendMailRecordMapper {
8
-    int saveSendMailRecord(SendMailRecord sendMailRecord);
8
+    /**
9
+     * 新增发送邮件记录
10
+     *
11
+     * @param sendMailRecord 发送邮件记录
12
+     * @return 结果
13
+     */
9 14
 
15
+    int saveSendMailRecord(SendMailRecord sendMailRecord);
16
+/**
17
+     * 查询发送邮件记录
18
+     *
19
+     * @param sendMailRecord 发送邮件记录
20
+     * @return 结果
21
+     */
10 22
     List<SendMailRecord>  selectSendMailRecord(SendMailRecord sendMailRecord);
23
+/**
24
+     * 修改发送邮件记录
25
+     *
26
+     * @param sendMailRecord 发送邮件记录
27
+     * @return 结果
28
+     */
29
+   int updateSendMailRecord(SendMailRecord sendMailRecord);
11 30
 
12
-
13
-
31
+    /**
32
+     * 根据id查询发送邮件记录
33
+     * @param id
34
+     */
35
+    SendMailRecord querySendMailRecordById(Long id);
14 36
 }

+ 9
- 0
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/sendrecord/SmsRecordMapper.java Прегледај датотеку

@@ -19,4 +19,13 @@ public interface SmsRecordMapper {
19 19
      * @return
20 20
      */
21 21
     int batchSaveSmsSendRecord(@Param("list") List<SmsSendRecord> smsSendRecordList);
22
+    SmsSendRecord selectBySId(@Param("sid") String sid);
23
+    void updateStatus (SmsSendRecord smsSendRecord);
24
+
25
+    /**
26
+     * 通过id查询短信发送记录
27
+     */
28
+    SmsSendRecord selectById(@Param("id") Long id);
29
+
30
+    void update(SmsSendRecord smsSendRecord);
22 31
 }

+ 18
- 12
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/dept/impl/DeptIdentifyServiceImpl.java Прегледај датотеку

@@ -47,6 +47,7 @@ import java.util.function.Function;
47 47
 import java.util.stream.Collectors;
48 48
 import java.util.stream.Stream;
49 49
 
50
+import static com.google.common.io.Files.getFileExtension;
50 51
 import static com.ruoyi.common.utils.SecurityUtils.getUsername;
51 52
 
52 53
 @Service
@@ -256,6 +257,7 @@ public class DeptIdentifyServiceImpl implements IDeptIdentifyService {
256 257
                                 caseAttach.setAnnexType(AnnexTypeEnum.SEAL_PICTURE.getCode());  //10代表印章图片
257 258
                                 caseAttach.setAnnexPath(savePath);
258 259
                                 caseAttach.setAnnexName(saveName);
260
+                                caseAttach.setSuffix(getFileExtension(savePath));
259 261
                                 int i1 = msCaseAttachMapper.save(caseAttach);
260 262
                                 if (i1 > 0) {
261 263
                                     //将附件id保存到公章管理表里
@@ -324,6 +326,8 @@ public class DeptIdentifyServiceImpl implements IDeptIdentifyService {
324 326
         if (identifyName == null) {
325 327
             AjaxResult.error("请检查参数是否完整");
326 328
         }
329
+        // 查询是否存在机构
330
+        SysDept sysDept = sysDeptMapper.selectDeptByName(identifyName);
327 331
         Integer identifyType = deptIdentify.getIdentifyType();
328 332
         if (identifyType == null) {
329 333
             deptIdentify.setIdentifyType(1); // 设置机构默认为仲裁机构
@@ -331,11 +335,19 @@ public class DeptIdentifyServiceImpl implements IDeptIdentifyService {
331 335
         deptIdentify.setIdentifyStatus(0); //设置认证状态默认为未认证
332 336
         deptIdentify.setIsUse(0); //设置机构默认为未启用
333 337
         //将机构名称保存到部门表里
334
-        SysDept sysDept = new SysDept();
335
-        sysDept.setDeptName(identifyName);
336
-        sysDept.setParentId(0L);
337
-        sysDept.setDeptType(1);
338
-        int i1 = sysDeptMapper.insertDept(sysDept);
338
+        int i1=0;
339
+        if(sysDept == null) {
340
+             sysDept = new SysDept();
341
+             sysDept.setParentId(0L);
342
+            sysDept.setDeptName(identifyName);
343
+            sysDept.setDeptType(1);
344
+            i1 = sysDeptMapper.insertDept(sysDept);
345
+        }
346
+        else {
347
+            sysDept.setDeptType(1);
348
+            sysDeptMapper.updateDept(sysDept);
349
+        }
350
+
339 351
         if (i1 > 0) {
340 352
            /* //将经办人信息存入到用户表里
341 353
             Long deptId = sysDept.getDeptId();
@@ -658,11 +670,5 @@ public class DeptIdentifyServiceImpl implements IDeptIdentifyService {
658 670
         return ajax;
659 671
     }
660 672
 
661
-    private String getFileExtension(String fileName) {
662
-        int lastDotIndex = fileName.lastIndexOf(".");
663
-        if (lastDotIndex > 0 && lastDotIndex < fileName.length() - 1) {
664
-            return fileName.substring(lastDotIndex + 1);
665
-        }
666
-        return "";
667
-    }
673
+
668 674
 }

+ 8
- 2
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/miniprogress/IdentityAuthenticationService.java Прегледај датотеку

@@ -19,10 +19,10 @@ public interface IdentityAuthenticationService {
19 19
 
20 20
     /**
21 21
      * 获取Eidtoken
22
-     *
22
+     * isPC 是否PC端
23 23
      * @return
24 24
      */
25
-    JSONObject selectIdentityAuthenticaEIDtoken();
25
+    JSONObject selectIdentityAuthEIDToken(boolean isPC);
26 26
 
27 27
     /**
28 28
      * 小程序人脸核身后查询身份认证结果
@@ -31,4 +31,10 @@ public interface IdentityAuthenticationService {
31 31
      * @return
32 32
      */
33 33
     AjaxResult selectIdentityAuthenticaRespon(IdentityAuthentication ientityAuthentication);
34
+
35
+    /**
36
+     * H5轮询获取EIDtoken状态
37
+     * @return
38
+     */
39
+    AjaxResult selectPCEIDtokenStatus(String eidToken);
34 40
 }

+ 8
- 0
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/miniprogress/WeChatUserService.java Прегледај датотеку

@@ -14,4 +14,12 @@ public interface WeChatUserService {
14 14
 
15 15
 
16 16
     AjaxResult registerUser(IdentityAuthentication ientityAuthentication);
17
+
18
+    /**
19
+     * 获取邮箱验证码
20
+     * @param email
21
+     * @return
22
+     */
23
+
24
+    AjaxResult sendEmailCode(String email);
17 25
 }

+ 96
- 8
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/miniprogress/impl/IdentityAuthenticationServiceImpl.java Прегледај датотеку

@@ -2,12 +2,14 @@ package com.ruoyi.wisdomarbitrate.service.miniprogress.impl;
2 2
 
3 3
 
4 4
 import cn.hutool.core.codec.Base64;
5
+import cn.hutool.core.util.StrUtil;
5 6
 import cn.hutool.crypto.SmUtil;
6 7
 import cn.hutool.crypto.asymmetric.SM2;
7 8
 import cn.hutool.crypto.symmetric.SymmetricCrypto;
8 9
 import com.alibaba.fastjson.JSON;
9 10
 import com.alibaba.fastjson.JSONObject;
10 11
 import com.ruoyi.common.core.domain.AjaxResult;
12
+import com.ruoyi.common.exception.ServiceException;
11 13
 import com.ruoyi.system.mapper.SysUserMapper;
12 14
 import com.ruoyi.wisdomarbitrate.domain.dto.miniprogress.IdentityAuthentication;
13 15
 import com.ruoyi.wisdomarbitrate.mapper.miniprogress.IdentityAuthenticationMapper;
@@ -39,6 +41,8 @@ public class IdentityAuthenticationServiceImpl implements IdentityAuthentication
39 41
     private String credentialSecretKey;
40 42
     @Value("${identityAuthentication.merchantId}")
41 43
     private String merchantId;
44
+    @Value("${identityAuthentication.pcMerchantId}")
45
+    private String pcMerchantId;
42 46
     @Value("${identityAuthentication.privateKeyHexDecodeinfo}")
43 47
     private String privateKeyHexDecodeinfo;
44 48
 
@@ -87,7 +91,7 @@ public class IdentityAuthenticationServiceImpl implements IdentityAuthentication
87 91
      * @return
88 92
      */
89 93
     @Override
90
-    public JSONObject selectIdentityAuthenticaEIDtoken() {
94
+    public JSONObject selectIdentityAuthEIDToken(boolean isPC) {
91 95
         JSONObject objJSON = new JSONObject();
92 96
         objJSON.put("EidToken", "");
93 97
         try {
@@ -102,15 +106,18 @@ public class IdentityAuthenticationServiceImpl implements IdentityAuthentication
102 106
             FaceidClient client = new FaceidClient(cred, "", clientProfile);
103 107
             // 实例化一个请求对象,每个接口都会对应一个request对象
104 108
             GetEidTokenRequest req = new GetEidTokenRequest();
105
-            req.setMerchantId(merchantId);
109
+            if(true){
110
+                req.setMerchantId(merchantId);
111
+            }else {
112
+                req.setMerchantId(pcMerchantId);
113
+            }
106 114
             // 返回的resp是一个GetEidTokenResponse的实例,与请求对象对应
107 115
             GetEidTokenResponse resp = client.GetEidToken(req);
108 116
             // 输出json格式的字符串回包
109 117
             String respJSON = GetEidTokenResponse.toJsonString(resp);
110 118
             objJSON = JSON.parseObject(respJSON);
111 119
         } catch (TencentCloudSDKException e) {
112
-            System.out.println(e.toString());
113
-            System.out.println("获取Eidtoken失败");
120
+            throw new ServiceException("获取Eidtoken失败");
114 121
         }
115 122
         return objJSON;
116 123
     }
@@ -132,13 +139,13 @@ public class IdentityAuthenticationServiceImpl implements IdentityAuthentication
132 139
                 parse = JSON.parseObject(s);
133 140
             }
134 141
         } catch (Exception e) {
135
-            System.out.println(e.toString());
142
+           throw new ServiceException(e.getMessage());
136 143
         }
137 144
         return parse;
138 145
     }
139 146
 
140 147
     /**
141
-     * 小程序人脸核身后查询身份认证结果
148
+     * 人脸核身后查询身份认证结果
142 149
      *
143 150
      * @param ientityAuthentication
144 151
      * @return
@@ -219,12 +226,93 @@ public class IdentityAuthenticationServiceImpl implements IdentityAuthentication
219 226
             }
220 227
             return AjaxResult.success(authentication);
221 228
         } catch (TencentCloudSDKException e) {
222
-            System.out.println(e.toString());
229
+            return AjaxResult.error(e.getMessage());
223 230
         }
224
-        return AjaxResult.success();
225 231
     }
226 232
 
233
+    @Override
234
+    public AjaxResult selectPCEIDtokenStatus(String eidToken) {
235
+        // todo 送达时需要判断是否有pdf版的调解书,没有则不送达,签名完后下载pdf时不删除之前的doc调解书,上传调解书时,pdf的需要将类型设为13,异步发送短信邮件时将登录用户传参过来
236
+        // todo E证通审核过后将PC端的机器id在YML文件中改掉
237
+        JSONObject objJSON = null;
238
+        IdentityAuthentication authentication = new IdentityAuthentication();
239
+
240
+        try {
241
+            Credential cred = new Credential(credentialSecretId, credentialSecretKey);
242
+            // 实例化一个http选项,可选的,没有特殊需求可以跳过
243
+            HttpProfile httpProfile = new HttpProfile();
244
+            httpProfile.setEndpoint("faceid.tencentcloudapi.com");
245
+            // 实例化一个client选项,可选的,没有特殊需求可以跳过
246
+            ClientProfile clientProfile = new ClientProfile();
247
+            clientProfile.setHttpProfile(httpProfile);
248
+            // 实例化要请求产品的client对象,clientProfile是可选的
249
+            FaceidClient client = new FaceidClient(cred, "", clientProfile);
250
+            // 实例化一个请求对象,每个接口都会对应一个request对象
251
+            GetEidResultRequest req = new GetEidResultRequest();
252
+            req.setEidToken(eidToken);
253
+            // 返回的resp是一个GetEidResultResponse的实例,与请求对象对应
254
+            GetEidResultResponse resp = client.GetEidResult(req);
255
+            // 输出json格式的字符串回包,Status	String	枚举:init:token未验证 doing: 验证中 finished: 验证完成 timeout: token已超时
256
+            String s = GetEidResultResponse.toJsonString(resp);
257
+            if(StrUtil.isNotEmpty(s)) {
258
+                objJSON = JSON.parseObject(s);
259
+                JSONObject text = objJSON.getJSONObject("Text");
260
+                if (text != null) {
261
+                    Integer comparestatus = text.getInteger("Comparestatus");
262
+                    if (comparestatus != null && comparestatus == 0) {
263
+                        JSONObject eidInfo = objJSON.getJSONObject("EidInfo");
264
+                        if (eidInfo != null) {
265
+                            String desKey = eidInfo.getString("DesKey");
266
+                            String userInfo = eidInfo.getString("UserInfo");
267
+                            //1.解密用户的信息
268
+                            JSONObject info = DecodeUserInfo(desKey, userInfo);
269
+                            if (info != null) {
270
+                                String idcardno = info.getString("idnum");
271
+                                String name = info.getString("name");
272
+                                //2.在用户认证表中插入用户认证记录
273
+                                //  LoginUser loginUser = SecurityUtils.getLoginUser();
274
+
275
+                                /**
276
+                                 * 用户名
277
+                                 * 用户名id
278
+                                 * 姓名
279
+                                 * 身份证号
280
+                                 * 认证时间
281
+                                 * 认证状态0表示成功
282
+                                 * 请求id
283
+                                 */
284
+                                // authentication.setUserName(loginUser.getUsername());
285
+                                //  authentication.setUserId(loginUser.getUserId());
227 286
 
287
+                                authentication.setIdentityNo(idcardno);
288
+                                // 查询认证表是否已存在该身份证信息的认证,不存在则新增,存在不处理
289
+                                IdentityAuthentication identityAuthentication = identityAuthenticationMapper.selectIdentityAuthentication(authentication);
290
+                                if(identityAuthentication!=null) {
291
+                                    return AjaxResult.success(identityAuthentication);
292
+                                }
293
+                                authentication.setName(name);
294
+                                authentication.setCertificationTime(new Date());
295
+                                authentication.setCertificationStatus(0);
296
+                                authentication.setCreateBy(name);
297
+                                //  authentication.setCreateBy(loginUser.getUsername());
298
+                                try {
299
+                                    identityAuthenticationMapper.insertIdentityAuthentication(authentication);
300
+                                    authentication.setId(authentication.getId());
301
+                                } catch (Exception e) {
302
+                                    System.out.println("认证记录新增失败");
303
+                                }
304
+                            }
305
+
306
+                        }
307
+                    }
308
+                }
309
+                return AjaxResult.success(authentication);
310
+            }
311
+        } catch (TencentCloudSDKException e) {
312
+            return AjaxResult.error(e.getMessage());
313
+        }
314
+        return AjaxResult.error("认证失败");
315
+    }
228 316
 
229 317
 
230 318
 }

+ 50
- 20
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/miniprogress/impl/WeChatUserServiceImpl.java Прегледај датотеку

@@ -2,13 +2,15 @@ package com.ruoyi.wisdomarbitrate.service.miniprogress.impl;
2 2
 
3 3
 import cn.hutool.core.collection.CollectionUtil;
4 4
 import cn.hutool.core.util.StrUtil;
5
+import cn.hutool.json.JSONObject;
5 6
 import com.ruoyi.common.constant.CacheConstants;
6 7
 import com.ruoyi.common.core.domain.AjaxResult;
7 8
 import com.ruoyi.common.core.domain.entity.SysRole;
8 9
 import com.ruoyi.common.core.domain.entity.SysUser;
9 10
 import com.ruoyi.common.core.redis.RedisCache;
11
+import com.ruoyi.common.enums.SMSStatusEnum;
12
+import com.ruoyi.common.utils.EmailOutUtil;
10 13
 import com.ruoyi.common.utils.SecurityUtils;
11
-import com.ruoyi.common.utils.SmsUtils;
12 14
 import com.ruoyi.common.utils.StringUtils;
13 15
 import com.ruoyi.common.utils.spring.SpringUtils;
14 16
 import com.ruoyi.system.mapper.SysRoleMapper;
@@ -18,6 +20,7 @@ import com.ruoyi.wisdomarbitrate.domain.dto.miniprogress.IdentityAuthentication;
18 20
 import com.ruoyi.wisdomarbitrate.domain.vo.miniprogress.WeChatUserVO;
19 21
 import com.ruoyi.wisdomarbitrate.mapper.miniprogress.IdentityAuthenticationMapper;
20 22
 import com.ruoyi.wisdomarbitrate.service.miniprogress.WeChatUserService;
23
+import com.ruoyi.wisdomarbitrate.utils.SmsUtils;
21 24
 import lombok.extern.slf4j.Slf4j;
22 25
 import org.springframework.beans.factory.annotation.Autowired;
23 26
 import org.springframework.stereotype.Service;
@@ -43,6 +46,10 @@ public class WeChatUserServiceImpl implements WeChatUserService {
43 46
     private SysUserRoleMapper userRoleMapper;
44 47
     @Autowired
45 48
     private IdentityAuthenticationMapper identityAuthenticationMapper;
49
+    @Autowired
50
+    private RedisCache redisCache;
51
+    @Autowired
52
+    private EmailOutUtil emailOutUtil;
46 53
 
47 54
     @Override
48 55
     public AjaxResult sendCode(WeChatUserVO userVO) {
@@ -58,14 +65,33 @@ public class WeChatUserServiceImpl implements WeChatUserService {
58 65
         //  1954926 普通短信 短信验证码 验证码:,为了保证您的账户安全,请勿想他人泄露验证码信息。如非本人操作,请忽略本短信。
59 66
         request.setPhone(userVO.getPhone());
60 67
         request.setTemplateParamSet(new String[]{ code});
61
-        Boolean flag = SmsUtils.sendSms(request);
62
-        if(flag){
63
-            setCodeCache(userVO.getPhone(),code);
68
+        JSONObject resultObj = SmsUtils.sendSms(request);
69
+        if(resultObj.get("status")!=null && !resultObj.get("status").equals(SMSStatusEnum.FAIL.getCode())){
70
+            setCodeCache(CacheConstants.WE_CHAT_SMS_VERIFY_CODE_KEY + userVO.getPhone(),code);
64 71
             return AjaxResult.success("短信发送成功");
65 72
         }else {
66 73
             return AjaxResult.warn("短信发送失败");
67 74
         }
68 75
     }
76
+    @Override
77
+    public AjaxResult sendEmailCode(String email) {
78
+        Random random = new Random();
79
+        String code = "";
80
+        for (int i = 0; i < 6; i++) {
81
+
82
+            code += random.nextInt(10);
83
+        }
84
+
85
+        try {
86
+            emailOutUtil.sendMessage(email, "调解系统邮箱验证", "尊敬的用户,您好,您的邮箱验证码为:"+code+",有效期为5分钟。", null, null);
87
+        } catch (Exception e) {
88
+           return AjaxResult.warn("邮件发送失败");
89
+        }
90
+
91
+        //  1954926 普通短信 短信验证码 验证码:,为了保证您的账户安全,请勿想他人泄露验证码信息。如非本人操作,请忽略本短信。
92
+        setCodeCache(CacheConstants.EMAIL_VERIFY_CODE_KEY +email,code);
93
+        return AjaxResult.success("邮件发送成功");
94
+    }
69 95
     /**
70 96
      * 设置验证码缓存
71 97
      *
@@ -74,7 +100,7 @@ public class WeChatUserServiceImpl implements WeChatUserService {
74 100
      */
75 101
     public static void setCodeCache(String key, String code)
76 102
     {
77
-        SpringUtils.getBean(RedisCache.class).setCacheObject(getVerifyCodeCacheKey(key), code, 5,TimeUnit.MINUTES);
103
+        SpringUtils.getBean(RedisCache.class).setCacheObject( key, code, 5,TimeUnit.MINUTES);
78 104
     }
79 105
 
80 106
 
@@ -86,7 +112,7 @@ public class WeChatUserServiceImpl implements WeChatUserService {
86 112
      */
87 113
     public static String getCodeCache(String key)
88 114
     {
89
-        String codeCache = SpringUtils.getBean(RedisCache.class).getCacheObject(getVerifyCodeCacheKey(key));
115
+        String codeCache = SpringUtils.getBean(RedisCache.class).getCacheObject( key);
90 116
         if (StringUtils.isNotNull(codeCache))
91 117
         {
92 118
             return codeCache;
@@ -94,19 +120,24 @@ public class WeChatUserServiceImpl implements WeChatUserService {
94 120
         return null;
95 121
     }
96 122
 
97
-    private static String getVerifyCodeCacheKey(String key) {
98
-        return CacheConstants.WE_CHAT_SMS_VERIFY_CODE_KEY + key;
99
-    }
100 123
     @Transactional
101 124
     @Override
102 125
     public AjaxResult registerUser(IdentityAuthentication ientityAuthentication) {
103
-        String codeCache = getCodeCache(ientityAuthentication.getPhone());
126
+        String codeCache = getCodeCache(CacheConstants.WE_CHAT_SMS_VERIFY_CODE_KEY + ientityAuthentication.getPhone());
104 127
         // 校验短信验证码
105 128
         if(StrUtil.isEmpty(codeCache)){
106 129
             return AjaxResult.warn("验证码校验失败");
107 130
         }else if(!codeCache.equals(ientityAuthentication.getVerifyCode())){
108 131
             return AjaxResult.warn("验证码校验失败");
109 132
         }
133
+        // 校验邮箱验证码
134
+        String emailCodeCache = getCodeCache(CacheConstants.EMAIL_VERIFY_CODE_KEY +ientityAuthentication.getEmail());
135
+        if(StrUtil.isEmpty(emailCodeCache)){
136
+            return AjaxResult.warn("验证码校验失败");
137
+        }else if(!emailCodeCache.equals(ientityAuthentication.getEmailVerifyCode())){
138
+            return AjaxResult.warn("验证码校验失败");
139
+        }
140
+        // 根据用户名或者邮箱或者手机号查询系统用户表中是否存在该用户
110 141
         SysUser sysUserName=sysUserMapper.checkUserNameUnique(ientityAuthentication.getUserName());
111 142
         if(sysUserName!=null){
112 143
             return AjaxResult.warn("账号已存在");
@@ -115,18 +146,11 @@ public class WeChatUserServiceImpl implements WeChatUserService {
115 146
         if(checkPhoneUnique!=null){
116 147
             return AjaxResult.warn("手机号已存在");
117 148
         }
118
-        SysUser checkEmailUnique = sysUserMapper.checkEmailUnique(ientityAuthentication.getEmail());
119
-        if(checkEmailUnique!=null){
120
-            return AjaxResult.warn("邮箱已存在");
121
-        }
122 149
 
123
-        // 根据身份证查询系统用户表中是否存在该用户,存在则同步已认证的信息,不存在则新增
124
-        SysUser sysUser=sysUserMapper.selectUserByIdCard(ientityAuthentication.getIdentityNo());
150
+        // 根据邮箱查询系统用户表中是否存在该用户,存在则同步已认证的信息,不存在则新增
151
+        SysUser sysUser=sysUserMapper.selectUserByEmail(ientityAuthentication.getEmail());
125 152
         // 查询角色
126 153
         Long roleIdByName =ientityAuthentication.getRoleId();
127
-//        if(roleIdByName==null){
128
-//            return AjaxResult.warn("被申请人角色不存在,请联系系统管理员新增角色");
129
-//        }
130 154
         if(sysUser!=null){
131 155
             sysUser.setIdCard(ientityAuthentication.getIdentityNo());
132 156
             sysUser.setNickName(ientityAuthentication.getName());
@@ -135,10 +159,12 @@ public class WeChatUserServiceImpl implements WeChatUserService {
135 159
             sysUser.setEmail(ientityAuthentication.getEmail());
136 160
             sysUser.setPassword(SecurityUtils.encryptPassword(ientityAuthentication.getPassWord()));
137 161
             sysUserMapper.updateUser(sysUser);
162
+            // redis缓存
163
+            sysUser=sysUserMapper.selectUserById(sysUser.getUserId());
164
+            redisCache.setCacheObject(CacheConstants.USER_KEY+sysUser.getUserId(),sysUser);
138 165
             ientityAuthentication.setUserId(sysUser.getUserId());
139 166
             int count=0;
140 167
            if(CollectionUtil.isNotEmpty(sysUser.getRoles()) && roleIdByName!=null){
141
-
142 168
                for (SysRole role : sysUser.getRoles()) {
143 169
                    if(Objects.equals(role.getRoleId(), roleIdByName)){
144 170
                        count++;
@@ -168,6 +194,8 @@ public class WeChatUserServiceImpl implements WeChatUserService {
168 194
             if(row<1) {
169 195
                 return AjaxResult.warn("注册失败");
170 196
             }
197
+            // redis缓存
198
+            redisCache.setCacheObject(CacheConstants.USER_KEY+sysUser.getUserId(),sysUser);
171 199
             if(roleIdByName!=null) {
172 200
                 // 用户关联被申请人角色
173 201
                 userRoleMapper.insertUserRole(sysUser.getUserId(), roleIdByName);
@@ -182,4 +210,6 @@ public class WeChatUserServiceImpl implements WeChatUserService {
182 210
         return AjaxResult.success("注册成功");
183 211
     }
184 212
 
213
+
214
+
185 215
 }

+ 0
- 0
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/mscase/MsCaseApplicationService.java Прегледај датотеку


Неке датотеке нису приказане због велике количине промена