18792927508 2 lat temu
rodzic
commit
17c9b2659e
24 zmienionych plików z 1305 dodań i 659 usunięć
  1. 0
    1
      ruoyi-admin/src/main/java/com/ruoyi/RuoYiApplication.java
  2. 110
    0
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/mscase/MsVideoConferenceController.java
  3. 1
    1
      ruoyi-common/src/main/java/com/ruoyi/common/constant/CacheConstants.java
  4. 1
    0
      ruoyi-common/src/main/java/com/ruoyi/common/enums/AnnexTypeEnum.java
  5. 64
    0
      ruoyi-common/src/main/java/com/ruoyi/common/enums/SMSStatusEnum.java
  6. 22
    11
      ruoyi-common/src/main/java/com/ruoyi/common/utils/SmsUtils.java
  7. 7
    0
      ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysDeptMapper.java
  8. 38
    6
      ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserServiceImpl.java
  9. 10
    1
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/dto/sendrecord/SmsSendRecord.java
  10. 5
    0
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/entity/mscase/MsCaseApplication.java
  11. 5
    1
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/vo/mscase/MsCaseApplicationReq.java
  12. 2
    0
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/sendrecord/SmsRecordMapper.java
  13. 10
    2
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/miniprogress/impl/WeChatUserServiceImpl.java
  14. 1
    1
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/mscase/MsCaseApplicationService.java
  15. 10
    0
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/mscase/VideoConferenceService.java
  16. 583
    522
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/mscase/impl/MsCaseApplicationServiceImpl.java
  17. 29
    22
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/mscase/impl/MsCasePaymentServiceImpl.java
  18. 121
    80
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/mscase/impl/MsSignSealServiceImpl.java
  19. 101
    1
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/mscase/impl/VideoConferenceServiceImpl.java
  20. 160
    4
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/utils/SignAward.java
  21. 5
    1
      ruoyi-system/src/main/resources/mapper/system/SysDeptMapper.xml
  22. 1
    1
      ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml
  23. 1
    1
      ruoyi-system/src/main/resources/mapper/wisdomarbitrate/mscase/MsCaseAffiliateMapper.xml
  24. 18
    3
      ruoyi-system/src/main/resources/mapper/wisdomarbitrate/sendrecord/SmsRecordMapper.xml

+ 0
- 1
ruoyi-admin/src/main/java/com/ruoyi/RuoYiApplication.java Wyświetl plik

@@ -49,7 +49,6 @@ public class RuoYiApplication
49 49
         if(CollectionUtil.isNotEmpty(sysUsers)){
50 50
             for (SysUser sysUser : sysUsers) {
51 51
                 redisCache.setCacheObject(CacheConstants.USER_KEY+sysUser.getUserId(),sysUser);
52
-                redisCache.setCacheObject(CacheConstants.USER_EMAIL_KEY+sysUser.getEmail(),sysUser);
53 52
             }
54 53
         }
55 54
         // 初始化角色redis

+ 110
- 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/mscase/MsVideoConferenceController.java Wyświetl plik

@@ -1,16 +1,28 @@
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.utils.SecurityUtils;
11
+import com.ruoyi.common.utils.file.FileUploadUtils;
12
+import com.ruoyi.common.utils.file.FileUtils;
13
+import com.ruoyi.framework.config.ServerConfig;
14
+import com.ruoyi.wisdomarbitrate.domain.entity.mscase.MsCaseAttach;
7 15
 import com.ruoyi.wisdomarbitrate.domain.vo.mscase.MsReservedConferenceVO;
8 16
 import com.ruoyi.wisdomarbitrate.domain.vo.mscase.SendRoomNoMessageVO;
9 17
 import com.ruoyi.wisdomarbitrate.domain.vo.mscase.VideoCallBackVO;
18
+import com.ruoyi.wisdomarbitrate.mapper.mscase.MsCaseAttachMapper;
19
+import com.ruoyi.wisdomarbitrate.service.mscase.MsCaseApplicationService;
10 20
 import com.ruoyi.wisdomarbitrate.service.mscase.VideoConferenceService;
11 21
 import org.springframework.beans.factory.annotation.Autowired;
12 22
 import org.springframework.web.bind.annotation.*;
23
+import org.springframework.web.multipart.MultipartFile;
13 24
 
25
+import javax.servlet.http.HttpServletRequest;
14 26
 import javax.validation.Valid;
15 27
 
16 28
 /**
@@ -24,6 +36,12 @@ import javax.validation.Valid;
24 36
 public class MsVideoConferenceController extends BaseController {
25 37
     @Autowired
26 38
     private VideoConferenceService videoService;
39
+    @Autowired
40
+    private ServerConfig serverConfig;
41
+    @Autowired
42
+    private MsCaseAttachMapper msCaseAttachMapper;
43
+    @Autowired
44
+    private MsCaseApplicationService caseApplicationService;
27 45
     /**
28 46
      * 根据案件ID查询视频
29 47
      * @param caseId 案件id
@@ -34,8 +52,82 @@ public class MsVideoConferenceController extends BaseController {
34 52
 
35 53
         return videoService.videoList(caseId);
36 54
     }
55
+    /**
56
+     * 通用上传请求(单个)
57
+     * param officeFlag: 是否上传到onlyoffice,0-否,1-是
58
+     */
59
+    @PostMapping("/upload")
60
+    public AjaxResult uploadFile(@RequestParam("file") MultipartFile file, @RequestParam("annexType") Integer annexType, @RequestParam(value = "officeFlag", required = false) Integer officeFlag,@RequestParam(value = "caseId") Long caseId) throws Exception
61
+    {
62
+        try
63
+        {
37 64
 
65
+            // 上传文件路径
66
+            String filePath = RuoYiConfig.getUploadPath();
67
+            // 上传并返回新文件名称
68
+            String fileName = FileUploadUtils.upload(filePath, file);
69
+            String url = serverConfig.getUrl() + fileName;
70
+            if(officeFlag != null && officeFlag == 1){
71
+                // officeFlag,fileName为annexPath
72
+                JSONArray jsonArray = caseApplicationService.uploadOnlyOffice(fileName,caseId);
73
+                if(jsonArray!=null && jsonArray.size() > 0) {
74
+                    MsCaseAttach caseAttach=null;
75
+                    for (Object obj : jsonArray) {
76
+                        JSONObject jsonObject = (JSONObject) obj;
77
+                         caseAttach = MsCaseAttach.builder()
78
+                                .caseAppliId(caseId)
79
+                                .annexName(jsonObject.getString("fileName"))
80
+                                .annexPath(jsonObject.getString("filePath"))
81
+                                .annexType(annexType)
82
+                                .onlyOfficeFileId(jsonObject.getString("fileId"))
83
+                                .build();
84
+                        msCaseAttachMapper.save(caseAttach);
85
+                    }
86
+                    if(caseAttach==null){
87
+                        return AjaxResult.error("上传失败");
88
+                    }
89
+                    AjaxResult ajax = AjaxResult.success();
90
+                    ajax.put("annexId", caseAttach.getAnnexId());
91
+                    ajax.put("annexType", annexType);
92
+               //     ajax.put("url", url);
93
+                    ajax.put("fileName", fileName);
94
+                    ajax.put("newFileName", FileUtils.getName(fileName));
95
+                    ajax.put("originalFilename", file.getOriginalFilename());
96
+                    return ajax;
97
+                }else {
98
+                    return AjaxResult.error("上传失败");
99
+                }
100
+            }else {
38 101
 
102
+                Long annexId = saveCaseAttach(annexType, fileName, file.getOriginalFilename(), caseId);
103
+                // 是否上传到onlyoffice
104
+                AjaxResult ajax = AjaxResult.success();
105
+                ajax.put("annexId", annexId);
106
+                ajax.put("annexType", annexType);
107
+                ajax.put("url", url);
108
+                ajax.put("fileName", fileName);
109
+                ajax.put("newFileName", FileUtils.getName(fileName));
110
+                ajax.put("originalFilename", file.getOriginalFilename());
111
+                return ajax;
112
+            }
113
+        }
114
+        catch (Exception e)
115
+        {
116
+            return AjaxResult.error(e.getMessage());
117
+        }
118
+    }
119
+    private Long saveCaseAttach(Integer annexType, String path, String originalFilename,Long caseId) {
120
+        MsCaseAttach caseAttach = MsCaseAttach.builder()
121
+                .annexName(originalFilename)
122
+                .caseAppliId(caseId)
123
+                .annexPath(path)
124
+                .annexType(annexType)
125
+                .useId(SecurityUtils.getUserId())
126
+                .useAccount(SecurityUtils.getUsername())
127
+                .build();
128
+        msCaseAttachMapper.save(caseAttach);
129
+        return caseAttach.getAnnexId();
130
+    }
39 131
     /**
40 132
      * 从腾讯云下载文件到本地
41 133
      * @param
@@ -49,6 +141,13 @@ public class MsVideoConferenceController extends BaseController {
49 141
         }
50 142
         return success();
51 143
     }
144
+    @Anonymous
145
+    @PostMapping("/smsRollBack")
146
+    public AjaxResult smsRollBack(   @RequestBody String body, HttpServletRequest request) {
147
+       logger.info("短信回调======"+body);
148
+       videoService.smsRollBack(body,request);
149
+        return success();
150
+    }
52 151
     /**
53 152
      * 根据房间号绑定案件ID
54 153
      * @param
@@ -110,6 +209,17 @@ public class MsVideoConferenceController extends BaseController {
110 209
 
111 210
         return  videoService.secretaryRoleByUserId(userId,caseId);
112 211
     }
212
+    /**
213
+     * 根据案件id查询申请人/被申请人会议上传附件按钮权限
214
+     * @param caseId
215
+     * @return
216
+     */
217
+    @Anonymous
218
+    @GetMapping("selectRoleMenuByCaseId")
219
+    public AjaxResult selectRoleMenuByCaseId(  @RequestParam(value = "caseId",required = true) Long caseId) {
220
+
221
+        return  videoService.selectRoleMenuByCaseId(caseId);
222
+    }
113 223
     /**
114 224
      * 根据html字符串转pdf并和案件关联
115 225
      * @param reservedConferenceVO

+ 1
- 1
ruoyi-common/src/main/java/com/ruoyi/common/constant/CacheConstants.java Wyświetl plik

@@ -58,7 +58,7 @@ public class CacheConstants
58 58
     /**
59 59
      * 用户邮箱 redis key
60 60
      */
61
-    public static final String USER_EMAIL_KEY = "user_email_key:";
61
+//    public static final String USER_EMAIL_KEY = "user_email_key:";
62 62
     /**
63 63
      * 角色 redis key
64 64
      */

+ 1
- 0
ruoyi-common/src/main/java/com/ruoyi/common/enums/AnnexTypeEnum.java Wyświetl plik

@@ -21,6 +21,7 @@ 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, "被申请人证据"),
24 25
 
25 26
 
26 27
     ;

+ 64
- 0
ruoyi-common/src/main/java/com/ruoyi/common/enums/SMSStatusEnum.java Wyświetl plik

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

+ 22
- 11
ruoyi-common/src/main/java/com/ruoyi/common/utils/SmsUtils.java Wyświetl plik

@@ -1,5 +1,7 @@
1 1
 package com.ruoyi.common.utils;
2 2
 
3
+import cn.hutool.json.JSONObject;
4
+import com.ruoyi.common.enums.SMSStatusEnum;
3 5
 import com.tencentcloudapi.common.Credential;
4 6
 import com.tencentcloudapi.common.exception.TencentCloudSDKException;
5 7
 import com.tencentcloudapi.sms.v20210111.SmsClient;
@@ -24,7 +26,8 @@ public class SmsUtils {
24 26
     //签名内容
25 27
     private static final String SIGN_NAME = "乙巢智慧仲裁网";
26 28
 
27
-    public static Boolean sendSms(SendSmsRequest request) {
29
+    public static JSONObject sendSms(SendSmsRequest request) {
30
+        JSONObject jsonObject = new JSONObject();
28 31
         Credential cred = new Credential(SECRET_ID, SECRET_KEY );
29 32
 
30 33
         SmsClient client = new SmsClient(cred, "ap-guangzhou");
@@ -40,18 +43,23 @@ public class SmsUtils {
40 43
             res = client.SendSms(req);
41 44
         } catch (TencentCloudSDKException e) {
42 45
             log.error("发送短信出错:", e);
43
-            return Boolean.FALSE;
46
+            jsonObject.set("status", SMSStatusEnum.FAIL.getCode());
47
+            return jsonObject;
44 48
         }
45 49
         SendStatus sendStatus = res.getSendStatusSet()[0];
46 50
         log.info("发送短信结果:Code={}, Message={}", sendStatus.getCode(), sendStatus.getMessage());
47 51
 
48 52
         if (Objects.nonNull(res.getSendStatusSet()) && res.getSendStatusSet().length > 0 && "Ok".equals(res.getSendStatusSet()[0].getCode())){
49
-            return Boolean.TRUE;
53
+            jsonObject.set("status", SMSStatusEnum.SENDING.getCode());
54
+        }else {
55
+            jsonObject.set("status", SMSStatusEnum.FAIL.getCode());
50 56
         }
51
-        return Boolean.FALSE;
57
+        jsonObject.set("sid", sendStatus.getSerialNo());
58
+        return jsonObject;
52 59
     }
53
-    public static Boolean sendSms(Long caseId,String templateId,String phone,String[] templateParamSet) {
54
-        SendSmsRequest request = new SendSmsRequest(phone,templateId,templateParamSet,caseId);
60
+    public static JSONObject sendSms(Long caseId,String templateId,String phone,String[] templateParamSet) {
61
+        JSONObject jsonObject = new JSONObject();
62
+        SmsUtils1.SendSmsRequest request = new SmsUtils1.SendSmsRequest(phone,templateId,templateParamSet,caseId);
55 63
         Credential cred = new Credential(SECRET_ID, SECRET_KEY );
56 64
 
57 65
         SmsClient client = new SmsClient(cred, "ap-guangzhou");
@@ -66,16 +74,19 @@ public class SmsUtils {
66 74
         try {
67 75
             res = client.SendSms(req);
68 76
         } catch (TencentCloudSDKException e) {
69
-            log.error("发送短信出错:", e);
70
-            return Boolean.FALSE;
77
+            jsonObject.set("status", SMSStatusEnum.FAIL.getCode());
78
+            return jsonObject;
71 79
         }
72 80
         SendStatus sendStatus = res.getSendStatusSet()[0];
73 81
         log.info("发送短信结果:Code={}, Message={}", sendStatus.getCode(), sendStatus.getMessage());
74
-
82
+        // todo 短信发送时,需要将SerialNo存到数据库,在短信回调时去更新短信发送状态,以及失败原因写到数据库,发送时状态统一为发送中
75 83
         if (Objects.nonNull(res.getSendStatusSet()) && res.getSendStatusSet().length > 0 && "Ok".equals(res.getSendStatusSet()[0].getCode())){
76
-            return Boolean.TRUE;
84
+            jsonObject.set("status", SMSStatusEnum.SENDING.getCode());
85
+        }else {
86
+            jsonObject.set("status", SMSStatusEnum.FAIL.getCode());
77 87
         }
78
-        return Boolean.FALSE;
88
+        jsonObject.set("sid", sendStatus.getSerialNo());
89
+        return jsonObject;
79 90
     }
80 91
     /**
81 92
      * 参数对象

+ 7
- 0
ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysDeptMapper.java Wyświetl plik

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

+ 38
- 6
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserServiceImpl.java Wyświetl plik

@@ -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;
@@ -66,6 +68,8 @@ public class SysUserServiceImpl implements ISysUserService {
66 68
 
67 69
     @Autowired
68 70
     protected Validator validator;
71
+    @Autowired
72
+    private RedisCache redisCache;
69 73
 
70 74
     /**
71 75
      * 根据条件分页查询用户列表
@@ -245,6 +249,8 @@ public class SysUserServiceImpl implements ISysUserService {
245 249
         user.setCreateBy("admin");
246 250
         user.setCreateTime(DateUtils.getNowDate());
247 251
         int rows = userMapper.insertUser(user);
252
+        // redis缓存
253
+        redisCache.setCacheObject(CacheConstants.USER_KEY+user.getUserId(),user);
248 254
         // 新增用户部门关联
249 255
         if(CollectionUtil.isNotEmpty(user.getDeptIds())) {
250 256
             // 先删除用户与部门关联
@@ -273,7 +279,10 @@ public class SysUserServiceImpl implements ISysUserService {
273 279
      */
274 280
     @Override
275 281
     public boolean registerUser(SysUser user) {
276
-        return userMapper.insertUser(user) > 0;
282
+        int i = userMapper.insertUser(user);
283
+        // redis缓存
284
+        redisCache.setCacheObject(CacheConstants.USER_KEY+user.getUserId(),user);
285
+        return i > 0;
277 286
     }
278 287
 
279 288
     /**
@@ -308,6 +317,8 @@ public class SysUserServiceImpl implements ISysUserService {
308 317
         // 新增用户与岗位管理
309 318
         insertUserPost(user);
310 319
         userMapper.updateUser(user);
320
+        // redis缓存
321
+        redisCache.setCacheObject(CacheConstants.USER_KEY+user.getUserId(),user);
311 322
         return AjaxResult.success("更新用户成功");
312 323
     }
313 324
 
@@ -332,7 +343,10 @@ public class SysUserServiceImpl implements ISysUserService {
332 343
      */
333 344
     @Override
334 345
     public int updateUserStatus(SysUser user) {
335
-        return userMapper.updateUser(user);
346
+        int i = userMapper.updateUser(user);
347
+        // redis缓存
348
+        redisCache.setCacheObject(CacheConstants.USER_KEY+user.getUserId(),user);
349
+        return i;
336 350
     }
337 351
 
338 352
     /**
@@ -343,7 +357,10 @@ public class SysUserServiceImpl implements ISysUserService {
343 357
      */
344 358
     @Override
345 359
     public int updateUserProfile(SysUser user) {
346
-        return userMapper.updateUser(user);
360
+        int i = userMapper.updateUser(user);
361
+        // redis缓存
362
+        redisCache.setCacheObject(CacheConstants.USER_KEY+user.getUserId(),user);
363
+        return i;
347 364
     }
348 365
 
349 366
     /**
@@ -366,7 +383,10 @@ public class SysUserServiceImpl implements ISysUserService {
366 383
      */
367 384
     @Override
368 385
     public int resetPwd(SysUser user) {
369
-        return userMapper.updateUser(user);
386
+        int i = userMapper.updateUser(user);
387
+        // redis缓存
388
+        redisCache.setCacheObject(CacheConstants.USER_KEY+user.getUserId(),user);
389
+        return i;
370 390
     }
371 391
 
372 392
     /**
@@ -443,7 +463,10 @@ public class SysUserServiceImpl implements ISysUserService {
443 463
         userRoleMapper.deleteUserRoleByUserId(userId);
444 464
         // 删除用户与岗位表
445 465
         userPostMapper.deleteUserPostByUserId(userId);
446
-        return userMapper.deleteUserById(userId);
466
+        int i = userMapper.deleteUserById(userId);
467
+        // 删除缓存
468
+        redisCache.deleteObject(CacheConstants.USER_KEY+userId);
469
+        return i;
447 470
     }
448 471
 
449 472
     /**
@@ -465,7 +488,12 @@ public class SysUserServiceImpl implements ISysUserService {
465 488
         userPostMapper.deleteUserPost(userIds);
466 489
         // 删除用户部门关联
467 490
         userDeptMapper.deleteUserByIds(userIds);
468
-        return userMapper.deleteUserByIds(userIds);
491
+        int i = userMapper.deleteUserByIds(userIds);
492
+            for (Long userId : userIds) {
493
+                // 删除缓存
494
+                redisCache.deleteObject(CacheConstants.USER_KEY+userId);
495
+            }
496
+        return i;
469 497
     }
470 498
 
471 499
     /**
@@ -495,6 +523,8 @@ public class SysUserServiceImpl implements ISysUserService {
495 523
                     user.setPassword(SecurityUtils.encryptPassword(password));
496 524
                     user.setCreateBy(operName);
497 525
                     userMapper.insertUser(user);
526
+                    // redis缓存
527
+                    redisCache.setCacheObject(CacheConstants.USER_KEY+user.getUserId(),user);
498 528
                     successNum++;
499 529
                     successMsg.append("<br/>" + successNum + "、账号 " + user.getUserName() + " 导入成功");
500 530
                 } else if (isUpdateSupport) {
@@ -504,6 +534,8 @@ public class SysUserServiceImpl implements ISysUserService {
504 534
                     user.setUserId(u.getUserId());
505 535
                     user.setUpdateBy(operName);
506 536
                     userMapper.updateUser(user);
537
+                    // redis缓存
538
+                    redisCache.setCacheObject(CacheConstants.USER_KEY+user.getUserId(),user);
507 539
                     successNum++;
508 540
                     successMsg.append("<br/>" + successNum + "、账号 " + user.getUserName() + " 更新成功");
509 541
                 } else {

+ 10
- 1
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/dto/sendrecord/SmsSendRecord.java Wyświetl plik

@@ -42,12 +42,21 @@ public class SmsSendRecord extends BaseEntity {
42 42
      * 发送状态
43 43
      */
44 44
     private Integer sendStatus;
45
+    /**
46
+     * 短信sid,发送的唯一标识
47
+     */
48
+    private String sid;
49
+    /**
50
+     * 失败原因
51
+     */
52
+    private String reason;
45 53
 
46
-    public SmsSendRecord(Long caseId, String caseNum, String phone, Date sendTime, String sendContent) {
54
+    public SmsSendRecord(Long caseId, String caseNum, String phone, Date sendTime, String sendContent,String sid) {
47 55
         this.caseId = caseId;
48 56
         this.caseNum = caseNum;
49 57
         this.phone = phone;
50 58
         this.sendTime = sendTime;
51 59
         this.sendContent = sendContent;
60
+        this.sid = sid;
52 61
     }
53 62
 }

+ 5
- 0
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/entity/mscase/MsCaseApplication.java Wyświetl plik

@@ -215,6 +215,11 @@ public class MsCaseApplication {
215 215
      */
216 216
     @Column(name = "case_source")
217 217
     private String caseSource;
218
+    /**
219
+     * 是否需要用印,1-需要
220
+     */
221
+    @Column(name = "seal_flag")
222
+    private Integer sealFlag;
218 223
     /**
219 224
      * 拒绝原因
220 225
      */

+ 5
- 1
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/vo/mscase/MsCaseApplicationReq.java Wyświetl plik

@@ -120,5 +120,9 @@ public class MsCaseApplicationReq {
120 120
      */
121 121
     private Integer roleType;
122 122
     private Long userId;
123
-
123
+    /**
124
+     * 是否需要用印,0-不需要,1-需要
125
+     */
126
+    // todo 等会放开
127
+    private Integer sealFlag=0;
124 128
 }

+ 2
- 0
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/sendrecord/SmsRecordMapper.java Wyświetl plik

@@ -19,4 +19,6 @@ 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);
22 24
 }

+ 10
- 2
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/miniprogress/impl/WeChatUserServiceImpl.java Wyświetl plik

@@ -2,11 +2,13 @@ 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;
10 12
 import com.ruoyi.common.utils.SecurityUtils;
11 13
 import com.ruoyi.common.utils.SmsUtils;
12 14
 import com.ruoyi.common.utils.StringUtils;
@@ -43,6 +45,8 @@ public class WeChatUserServiceImpl implements WeChatUserService {
43 45
     private SysUserRoleMapper userRoleMapper;
44 46
     @Autowired
45 47
     private IdentityAuthenticationMapper identityAuthenticationMapper;
48
+    @Autowired
49
+    private RedisCache redisCache;
46 50
 
47 51
     @Override
48 52
     public AjaxResult sendCode(WeChatUserVO userVO) {
@@ -58,8 +62,8 @@ public class WeChatUserServiceImpl implements WeChatUserService {
58 62
         //  1954926 普通短信 短信验证码 验证码:,为了保证您的账户安全,请勿想他人泄露验证码信息。如非本人操作,请忽略本短信。
59 63
         request.setPhone(userVO.getPhone());
60 64
         request.setTemplateParamSet(new String[]{ code});
61
-        Boolean flag = SmsUtils.sendSms(request);
62
-        if(flag){
65
+        JSONObject resultObj = SmsUtils.sendSms(request);
66
+        if(resultObj.get("status")!=null && !resultObj.get("status").equals(SMSStatusEnum.FAIL.getCode())){
63 67
             setCodeCache(userVO.getPhone(),code);
64 68
             return AjaxResult.success("短信发送成功");
65 69
         }else {
@@ -136,6 +140,8 @@ public class WeChatUserServiceImpl implements WeChatUserService {
136 140
             sysUser.setEmail(ientityAuthentication.getEmail());
137 141
             sysUser.setPassword(SecurityUtils.encryptPassword(ientityAuthentication.getPassWord()));
138 142
             sysUserMapper.updateUser(sysUser);
143
+            // redis缓存
144
+            redisCache.setCacheObject(CacheConstants.USER_KEY+sysUser.getUserId(),sysUser);
139 145
             ientityAuthentication.setUserId(sysUser.getUserId());
140 146
             int count=0;
141 147
            if(CollectionUtil.isNotEmpty(sysUser.getRoles()) && roleIdByName!=null){
@@ -169,6 +175,8 @@ public class WeChatUserServiceImpl implements WeChatUserService {
169 175
             if(row<1) {
170 176
                 return AjaxResult.warn("注册失败");
171 177
             }
178
+            // redis缓存
179
+            redisCache.setCacheObject(CacheConstants.USER_KEY+sysUser.getUserId(),sysUser);
172 180
             if(roleIdByName!=null) {
173 181
                 // 用户关联被申请人角色
174 182
                 userRoleMapper.insertUserRole(sysUser.getUserId(), roleIdByName);

+ 1
- 1
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/mscase/MsCaseApplicationService.java Wyświetl plik

@@ -295,7 +295,7 @@ public interface MsCaseApplicationService {
295 295
      * @param affiliate 案件人员
296 296
      * @param sendContent 发送内容
297 297
      */
298
-    public void sendSMS(Boolean smsFlag ,MsCaseApplication application, MsCaseAffiliate affiliate, String sendContent);
298
+    public void sendSMS(cn.hutool.json.JSONObject jsonObject ,MsCaseApplication application, MsCaseAffiliate affiliate, String sendContent);
299 299
     /**
300 300
      * 发送邮件
301 301
      * @param application 案件基本信息

+ 10
- 0
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/mscase/VideoConferenceService.java Wyświetl plik

@@ -4,6 +4,7 @@ import com.ruoyi.common.core.domain.AjaxResult;
4 4
 import com.ruoyi.wisdomarbitrate.domain.dto.mscase.ReservedConference;
5 5
 import com.ruoyi.wisdomarbitrate.domain.vo.mscase.MsReservedConferenceVO;
6 6
 
7
+import javax.servlet.http.HttpServletRequest;
7 8
 import java.util.List;
8 9
 
9 10
 /**
@@ -80,4 +81,13 @@ public interface VideoConferenceService {
80 81
      * @throws Exception
81 82
      */
82 83
     AjaxResult reservedConference( MsReservedConferenceVO reservedConferenceVO) throws Exception;
84
+
85
+    /**
86
+     * 短信回调
87
+     * @param body
88
+     * @param request
89
+     */
90
+    void smsRollBack(String body, HttpServletRequest request);
91
+
92
+    AjaxResult selectRoleMenuByCaseId(Long caseId);
83 93
 }

+ 583
- 522
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/mscase/impl/MsCaseApplicationServiceImpl.java
Plik diff jest za duży
Wyświetl plik


+ 29
- 22
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/mscase/impl/MsCasePaymentServiceImpl.java Wyświetl plik

@@ -11,10 +11,10 @@ import com.ruoyi.common.core.domain.AjaxResult;
11 11
 import com.ruoyi.common.core.redis.RedisCache;
12 12
 import com.ruoyi.common.enums.AnnexTypeEnum;
13 13
 import com.ruoyi.common.enums.PaymentStatusEnum;
14
+import com.ruoyi.common.enums.SMSStatusEnum;
14 15
 import com.ruoyi.common.enums.YesOrNoEnum;
15 16
 import com.ruoyi.common.exception.ServiceException;
16 17
 import com.ruoyi.common.utils.SecurityUtils;
17
-import com.ruoyi.common.utils.SmsUtils;
18 18
 import com.ruoyi.common.utils.spring.SpringUtils;
19 19
 import com.ruoyi.dto.PayRequest;
20 20
 import com.ruoyi.dto.PayResponse;
@@ -384,22 +384,24 @@ public class MsCasePaymentServiceImpl implements MsCasePaymentService {
384 384
                     continue;
385 385
                 }
386 386
                 if (affiliate.getRoleType().equals(1) || affiliate.getRoleType().equals(2)) {
387
-                    Boolean smsFlag = true;
387
+                    JSONObject jsonObject = new JSONObject();
388 388
                     SmsSendRecord smsSendRecord = null;
389 389
                     if (dto.getYesOrNo().equals(YesOrNoEnum.YES.getCode())) {
390 390
                         // 缴费通过
391
-                        smsFlag = SmsUtils.sendSms(affiliate.getCaseAppliId(), "2051914", affiliate.getPhone(), new String[]{affiliate.getName()});
392
-                        smsSendRecord = new SmsSendRecord(caseAppllication.getId(), caseAppllication.getCaseNum(), affiliate.getPhone(), new Date(), "尊敬的" + affiliate.getName() + ",您的调解申请费用已缴费成功。");
391
+                        // todo 短信
392
+//                        jsonObject = SmsUtils.sendSms(affiliate.getCaseAppliId(), "2051914", affiliate.getPhone(), new String[]{affiliate.getName()});
393
+                        smsSendRecord = new SmsSendRecord(caseAppllication.getId(), caseAppllication.getCaseNum(), affiliate.getPhone(), new Date(), "尊敬的" + affiliate.getName() + ",您的调解申请费用已缴费成功。",jsonObject.get("sid")!=null?jsonObject.get("sid").toString():null);
393 394
                     } else {
394
-                        smsFlag = SmsUtils.sendSms(affiliate.getCaseAppliId(), "2074402", affiliate.getPhone(), new String[]{affiliate.getName(), caseAppllication.getCaseNum(), dto.getReason()});
395
+                        // todo 短信
396
+//                        jsonObject = SmsUtils.sendSms(affiliate.getCaseAppliId(), "2074402", affiliate.getPhone(), new String[]{affiliate.getName(), caseAppllication.getCaseNum(), dto.getReason()});
395 397
                         // 2074402	调解系统确认缴费不通过通知   尊敬的{1}用户,您的{2}案件,确认缴费未通过,理由为{3},请知晓,如非本人操作,请忽略本短信
396
-                        smsSendRecord = new SmsSendRecord(caseAppllication.getId(), caseAppllication.getCaseNum(), affiliate.getPhone(), new Date(), "尊敬的" + affiliate.getName() + "用户,您的" + caseAppllication.getCaseNum() + "案件,确认缴费未通过,理由为" + dto.getReason() + ",请知晓,如非本人操作,请忽略本短信");
398
+                        smsSendRecord = new SmsSendRecord(caseAppllication.getId(), caseAppllication.getCaseNum(), affiliate.getPhone(), new Date(), "尊敬的" + affiliate.getName() + "用户,您的" + caseAppllication.getCaseNum() + "案件,确认缴费未通过,理由为" + dto.getReason() + ",请知晓,如非本人操作,请忽略本短信",jsonObject.get("sid")!=null?jsonObject.get("sid").toString():null);
397 399
                     }
398 400
                     // 新增短信记录
399
-                    if (smsFlag) {
400
-                        smsSendRecord.setSendStatus(YesOrNoEnum.YES.getCode());
401
+                    if (jsonObject.get("ststus")!=null && !jsonObject.get("ststus").equals(SMSStatusEnum.FAIL)) {
402
+                        smsSendRecord.setSendStatus(SMSStatusEnum.SENDING.getCode());
401 403
                     } else {
402
-                        smsSendRecord.setSendStatus(YesOrNoEnum.NO.getCode());
404
+                        smsSendRecord.setSendStatus(SMSStatusEnum.FAIL.getCode());
403 405
                     }
404 406
                     smsRecordMapper.saveSmsSendRecord(smsSendRecord);
405 407
                 }
@@ -412,22 +414,24 @@ public class MsCasePaymentServiceImpl implements MsCasePaymentService {
412 414
                     continue;
413 415
                 }
414 416
                 if (affiliate.getRoleType().equals(3) || affiliate.getRoleType().equals(4)) {
415
-                    Boolean smsFlag = true;
417
+                    JSONObject jsonObject = new JSONObject();
416 418
                     SmsSendRecord smsSendRecord = null;
417 419
                     if (dto.getYesOrNo().equals(YesOrNoEnum.YES.getCode())) {
420
+                        // todo 短信
418 421
                         // 缴费通过
419
-                        smsFlag = SmsUtils.sendSms(affiliate.getCaseAppliId(), "2051914", affiliate.getPhone(), new String[]{affiliate.getName()});
420
-                        smsSendRecord = new SmsSendRecord(caseAppllication.getId(), caseAppllication.getCaseNum(), affiliate.getPhone(), new Date(), "尊敬的" + affiliate.getName() + ",您的调解申请费用已缴费成功。");
422
+//                        jsonObject = SmsUtils.sendSms(affiliate.getCaseAppliId(), "2051914", affiliate.getPhone(), new String[]{affiliate.getName()});
423
+                        smsSendRecord = new SmsSendRecord(caseAppllication.getId(), caseAppllication.getCaseNum(), affiliate.getPhone(), new Date(), "尊敬的" + affiliate.getName() + ",您的调解申请费用已缴费成功。",jsonObject.get("sid")!=null?jsonObject.get("sid").toString():null);
421 424
                     } else {
422
-                        smsFlag = SmsUtils.sendSms(affiliate.getCaseAppliId(), "2074402", affiliate.getPhone(), new String[]{affiliate.getName(), caseAppllication.getCaseNum(), dto.getReason()});
425
+                        // todo 短信
426
+//                        jsonObject = SmsUtils.sendSms(affiliate.getCaseAppliId(), "2074402", affiliate.getPhone(), new String[]{affiliate.getName(), caseAppllication.getCaseNum(), dto.getReason()});
423 427
                         // 2074402	调解系统确认缴费不通过通知   尊敬的{1}用户,您的{2}案件,确认缴费未通过,理由为{3},请知晓,如非本人操作,请忽略本短信
424
-                        smsSendRecord = new SmsSendRecord(caseAppllication.getId(), caseAppllication.getCaseNum(), affiliate.getPhone(), new Date(), "尊敬的" + affiliate.getName() + "用户,您的" + caseAppllication.getCaseNum() + "案件,确认缴费未通过,理由为" + dto.getReason() + ",请知晓,如非本人操作,请忽略本短信");
428
+                        smsSendRecord = new SmsSendRecord(caseAppllication.getId(), caseAppllication.getCaseNum(), affiliate.getPhone(), new Date(), "尊敬的" + affiliate.getName() + "用户,您的" + caseAppllication.getCaseNum() + "案件,确认缴费未通过,理由为" + dto.getReason() + ",请知晓,如非本人操作,请忽略本短信",jsonObject.get("sid")!=null?jsonObject.get("sid").toString():null);
425 429
                     }
426 430
                     // 新增短信记录
427
-                    if (smsFlag) {
428
-                        smsSendRecord.setSendStatus(YesOrNoEnum.YES.getCode());
431
+                    if (jsonObject.get("status")!=null && !jsonObject.get("status").equals(SMSStatusEnum.FAIL)) {
432
+                        smsSendRecord.setSendStatus(SMSStatusEnum.SENDING.getCode());
429 433
                     } else {
430
-                        smsSendRecord.setSendStatus(YesOrNoEnum.NO.getCode());
434
+                        smsSendRecord.setSendStatus(SMSStatusEnum.FAIL.getCode());
431 435
                     }
432 436
                     smsRecordMapper.saveSmsSendRecord(smsSendRecord);
433 437
                 }
@@ -469,13 +473,16 @@ public class MsCasePaymentServiceImpl implements MsCasePaymentService {
469 473
     @Transactional
470 474
     public void sendAcceptSms(CaseConfirmPayDTO dto, MsCaseApplication caseAppllication,String userName,String phone ) {
471 475
             // 申请人被申请人发送受理通知书 2073601    尊敬的{1}用户,您的{2}案件,已成功受理,请知晓,如非本人操作,请忽略本短信。
472
-            Boolean  smsFlag =  SmsUtils.sendSms(caseAppllication.getId(), "2073601", phone, new String[]{userName, caseAppllication.getCaseNum()});
473
-            SmsSendRecord smsSendRecord = new SmsSendRecord(caseAppllication.getId(), caseAppllication.getCaseNum(), phone, new Date(), "尊敬的" + userName + "用户,您的" + caseAppllication.getCaseNum() +  "案件,已成功受理,请知晓,如非本人操作,请忽略本短信。");
476
+        // todo 短信
477
+
478
+//        JSONObject jsonObject = SmsUtils.sendSms(caseAppllication.getId(), "2073601", phone, new String[]{userName, caseAppllication.getCaseNum()});
479
+        JSONObject jsonObject = new JSONObject();
480
+        SmsSendRecord smsSendRecord = new SmsSendRecord(caseAppllication.getId(), caseAppllication.getCaseNum(), phone, new Date(), "尊敬的" + userName + "用户,您的" + caseAppllication.getCaseNum() +  "案件,已成功受理,请知晓,如非本人操作,请忽略本短信。",jsonObject.get("sid")!=null?jsonObject.get("sid").toString():null);
474 481
             // 新增短信记录
475
-            if (smsFlag) {
476
-                smsSendRecord.setSendStatus(YesOrNoEnum.YES.getCode());
482
+            if (jsonObject.get("status")!=null && !jsonObject.get("status").equals(SMSStatusEnum.FAIL)) {
483
+                smsSendRecord.setSendStatus(SMSStatusEnum.SENDING.getCode());
477 484
             } else {
478
-                smsSendRecord.setSendStatus(YesOrNoEnum.NO.getCode());
485
+                smsSendRecord.setSendStatus(SMSStatusEnum.FAIL.getCode());
479 486
             }
480 487
             smsRecordMapper.saveSmsSendRecord(smsSendRecord);
481 488
 

+ 121
- 80
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/mscase/impl/MsSignSealServiceImpl.java Wyświetl plik

@@ -596,9 +596,13 @@ public class MsSignSealServiceImpl implements MsSignSealService {
596 596
                     Gson gson = new Gson();
597 597
                     EsignHttpResponse signUrl = SignAward.signUrl(sealSignRecord);
598 598
                     JsonObject signUrlJsonObject = gson.fromJson(signUrl.getBody(), JsonObject.class);
599
-                    JsonObject signUrlData = signUrlJsonObject.getAsJsonObject("data");
600
-                    String urlapply = signUrlData.get("shortUrl").getAsString();
601
-                    sealSignRecordres.setSealUrl(urlapply);
599
+                    if(signUrlJsonObject.get("data")==null||signUrlJsonObject.get("data").isJsonNull()){
600
+                        throw new ServiceException("该用户和流程无关,不能查看当前流程");
601
+                    }else {
602
+                        JsonObject signUrlData = signUrlJsonObject.getAsJsonObject("data");
603
+                        String urlapply = signUrlData.get("shortUrl").getAsString();
604
+                        sealSignRecordres.setSealUrl(urlapply);
605
+                    }
602 606
                 }
603 607
                 return AjaxResult.success(sealSignRecordres);
604 608
             }else {
@@ -722,7 +726,14 @@ public class MsSignSealServiceImpl implements MsSignSealService {
722 726
                         if(signStatusResponse!=null&&signStatusResponse.intValue()==1&&
723 727
                                 signStatusMediator!=null&&signStatusMediator.intValue()==1){
724 728
                             // 根据流程id查找下一个流程节点
725
-                            MsCaseFlow nextFlow = caseFlowMapper.nextFlow(caseApplicationselect.getCaseFlowId().intValue());
729
+                            MsCaseFlow nextFlow=null;
730
+                            if(caseApplicationselect.getSealFlag()!=null&&caseApplicationselect.getSealFlag()==1) {
731
+                                // 需要用印
732
+                                 nextFlow = caseFlowMapper.nextFlow(caseApplicationselect.getCaseFlowId().intValue());
733
+                            }else {
734
+                                // 不需要用印
735
+                                nextFlow = caseFlowMapper.nextFlow1(caseApplicationselect.getCaseFlowId().intValue());
736
+                            }
726 737
                             MsCaseApplication application = new MsCaseApplication();
727 738
                             application.setId(caseApplicationselect.getId());
728 739
                             application.setCaseFlowId(nextFlow.getId());
@@ -730,8 +741,17 @@ public class MsSignSealServiceImpl implements MsSignSealService {
730 741
                             caseApplicationMapper.updateByPrimaryKeySelective(application);
731 742
 
732 743
                             //修改"签署用印记录表"的状态为待用印
733
-                            sealSignRecordsel.setSignFlowStatus(2);
734
-                            sealSignRecordMapper.updateByPrimaryKeySelective(sealSignRecordsel);
744
+                            if(caseApplicationselect.getSealFlag()!=null&&caseApplicationselect.getSealFlag()==1) {
745
+                                sealSignRecordsel.setSignFlowStatus(2);
746
+                                sealSignRecordMapper.updateByPrimaryKeySelective(sealSignRecordsel);
747
+                            }else {
748
+                                // 否则为已完成
749
+                                sealSignRecordsel.setSignFlowStatus(3);
750
+                                sealSignRecordMapper.updateByPrimaryKeySelective(sealSignRecordsel);
751
+                                // 下载调解书
752
+                                downloadMediationBook(caseApplicationselect,signFlowId,gson,caseAppliId);
753
+                            }
754
+
735 755
                         }
736 756
                     }else if(StringUtils.isNotEmpty(accountMobile)&&accountMobile.equals(pensonAccountRes)){
737 757
                         //被申请人签名
@@ -755,8 +775,17 @@ public class MsSignSealServiceImpl implements MsSignSealService {
755 775
                             caseApplicationMapper.updateByPrimaryKeySelective(application);
756 776
 
757 777
                             //修改"签署用印记录表"的状态为待用印
758
-                            sealSignRecordsel.setSignFlowStatus(2);
759
-                            sealSignRecordMapper.updateByPrimaryKeySelective(sealSignRecordsel);
778
+                            if(caseApplicationselect.getSealFlag()!=null&&caseApplicationselect.getSealFlag()==1) {
779
+                                sealSignRecordsel.setSignFlowStatus(2);
780
+                                sealSignRecordMapper.updateByPrimaryKeySelective(sealSignRecordsel);
781
+                            }else {
782
+                                // 否则为已完成
783
+                                sealSignRecordsel.setSignFlowStatus(3);
784
+                                sealSignRecordMapper.updateByPrimaryKeySelective(sealSignRecordsel);
785
+                                // 下载调解书
786
+                                downloadMediationBook(caseApplicationselect,signFlowId,gson,caseAppliId);
787
+                            }
788
+
760 789
                         }
761 790
                     }else if(StringUtils.isNotEmpty(accountMobile)&&accountMobile.equals(pensonAccountMedi)){
762 791
                         //调解员签名
@@ -780,10 +809,16 @@ public class MsSignSealServiceImpl implements MsSignSealService {
780 809
                             caseApplicationMapper.updateByPrimaryKeySelective(application);
781 810
 
782 811
                             //修改"签署用印记录表"的状态为待用印
783
-                            sealSignRecordsel.setSignFlowStatus(2);
812
+                            if(caseApplicationselect.getSealFlag()!=null&&caseApplicationselect.getSealFlag()==1) {
813
+                                sealSignRecordsel.setSignFlowStatus(2);
814
+                            }else {
815
+                                // 否则为已完成
816
+                                sealSignRecordsel.setSignFlowStatus(3);
817
+                            }
784 818
                             sealSignRecordMapper.updateByPrimaryKeySelective(sealSignRecordsel);
785 819
                         }
786
-                    }else if(StringUtils.isNotEmpty(accountMobile)&&accountMobile.equals(orgnNamePsnAcc)){
820
+                    }else if(StringUtils.isNotEmpty(accountMobile)&&accountMobile.equals(orgnNamePsnAcc) && caseApplicationselect.getSealFlag()!=null && caseApplicationselect.getSealFlag()==1 ){
821
+                        //需要用印
787 822
                         sealSignRecordsel.setSealStatus(1);
788 823
                         sealSignRecordsel.setSignFlowStatus(3);
789 824
                         sealSignRecordMapper.updateByPrimaryKeySelective(sealSignRecordsel);
@@ -804,73 +839,8 @@ public class MsSignSealServiceImpl implements MsSignSealService {
804 839
                         caseApplicationMapper.updateByPrimaryKeySelective(application);
805 840
 
806 841
                         //下载审核完成的调解书
807
-                        EsignHttpResponse fileDownload = SaaSAPIFileUtils.fileDownloadUrl(signFlowId);
808
-                        JsonObject fileDownloadJsonObject = gson.fromJson(fileDownload.getBody(), JsonObject.class);
809
-                        JsonObject fileDownloadData = fileDownloadJsonObject.getAsJsonObject("data");
810
-                        JsonArray filesArray = fileDownloadData.get("files").getAsJsonArray();
811
-                        if (filesArray != null && filesArray.size() > 0) {
812
-                            JsonObject fileObject = (JsonObject) filesArray.get(0);
813
-                            String fileDownloadUrl = fileObject.get("downloadUrl").toString();
814
-                            LocalDate now = LocalDate.now();
815
-                            String year = Integer.toString(now.getYear());
816
-                            String month = String.format("%02d", now.getMonthValue());
817
-                            String day = String.format("%02d", now.getDayOfMonth());
818
-                            String saveFolderPath = "/home/ruoyi/uploadPath/upload/" + year + "/" + month + "/" + day;
819
-                            String fileName = UUID.randomUUID().toString().replace("-", "") + ".pdf";
820
-//                                String saveName = "/profile/upload/" + year + "/" + month + "/" + day + "/" + fileName;
821
-//                                String savePath = "/home/ruoyi/uploadPath/upload/";
822
-                            String saveName = fileName;
823
-                            String savePath = "/profile/upload/" + year + "/" + month + "/" + day + "/" + fileName;
824
-
825
-                            // 创建日期目录
826
-                            File saveFolder = new File(saveFolderPath);
827
-                            if (!saveFolder.exists()) {
828
-                                saveFolder.mkdirs();
829
-                            }
830
-                            String resultFilePath = saveFolderPath + "/" + fileName;
831
-                            File resultFilePathFile = new File(resultFilePath);
832
-                            if (!resultFilePathFile.exists()) {
833
-                                resultFilePathFile.createNewFile();
834
-                            }
835
-
836
-                            String fileDownloadUrlnew = fileDownloadUrl.substring(1, fileDownloadUrl.length() - 1);
837
-                            boolean downLoadFile = FileTransformation.downLoadFileByUrl(fileDownloadUrlnew, resultFilePath);
838
-                            if (downLoadFile) {
839
-                                // 先删除已经存在的调解书
840
-                                if(StrUtil.isEmpty(application.getCaseSource())){
841
-                                    List<MsCaseAttach> existAttach = msCaseAttachMapper.listCaseAttachByCaseIdAndType(caseAppliId, AnnexTypeEnum.MEDIATE_BOOK.getCode());
842
-                                    if(CollectionUtil.isNotEmpty(existAttach)){
843
-                                        // todo 对接北明,同步案件状态,删除
844
-                                        for (MsCaseAttach msCaseAttach : existAttach) {
845
-                                            if(StrUtil.isEmpty(msCaseAttach.getOtherSysFileId())||StrUtil.isEmpty(msCaseAttach.getAnnexPath())){
846
-                                                continue;
847
-                                            }
848
-                                            beiMingInterfaceService.deleteAttachmentInfo(application.getCaseNum(), msCaseAttach.getOtherSysFileId(), FileUtil.getName(msCaseAttach.getAnnexPath()));
849
-                                        }
850
-                                    }
851
-                                }
852
-                                msCaseAttachMapper.deleteCaseAttachByCasedIdAndType(caseAppliId, AnnexTypeEnum.MEDIATE_BOOK.getCode());
853
-                                MsCaseAttach caseAttach = new MsCaseAttach();
854
-                                caseAttach.setCaseAppliId(caseAppliId);
855
-                                caseAttach.setAnnexType(AnnexTypeEnum.MEDIATE_BOOK.getCode());
856
-                                caseAttach.setAnnexPath(savePath);
857
-                                caseAttach.setAnnexName(saveName);
858
-                                caseAttachMapper.save(caseAttach);
859
-                                // todo 对接北明,调用上传附件接口
860
-                                if(StrUtil.isEmpty(caseApplicationselect.getCaseSource()) ) {
861
-                                        String templatePath = "/home/ruoyi" + savePath;
862
-                                        File file = new File(templatePath.replace("/profile", "/uploadPath"));
863
-                                        MsCaseFileInfo caseFileInfo = beiMingInterfaceService.pushAttachmentInfo(BMUserName, BMPassword, file, BMSyncSource, caseApplicationselect.getCaseNum(), AttachmentOperateTypeEnum.ADD, DocumentTypeEnum.EVEDENT_AGREEMENT);
864
-                                    // 更新附件表
865
-                                    if(caseFileInfo!=null && StrUtil.isNotEmpty(caseFileInfo.getFileId())){
866
-                                        caseAttach.setOtherSysFileId(caseFileInfo.getFileId());
867
-                                        msCaseAttachMapper.updateCaseAttachBycaseid(caseAttach);
868
-                                    }
842
+                        downloadMediationBook(caseApplicationselect,signFlowId,gson,caseAppliId);
869 843
 
870
-                                }
871
-                            }
872
-
873
-                        }
874 844
                     }
875 845
 
876 846
                 }else if(mediaResult.intValue()==5){
@@ -932,7 +902,7 @@ public class MsSignSealServiceImpl implements MsSignSealService {
932 902
                                 boolean downLoadFile = FileTransformation.downLoadFileByUrl(fileDownloadUrlnew, resultFilePath);
933 903
                                 if (downLoadFile) {
934 904
                                     // 先删除已经存在的调解书
935
-                                    if(StrUtil.isEmpty(application.getCaseSource())){
905
+                                    if(StrUtil.isEmpty(caseApplicationselect.getCaseSource())){
936 906
                                         List<MsCaseAttach> existAttach = msCaseAttachMapper.listCaseAttachByCaseIdAndType(caseAppliId, AnnexTypeEnum.MEDIATE_BOOK.getCode());
937 907
                                         if(CollectionUtil.isNotEmpty(existAttach)){
938 908
                                             // todo 对接北明,同步案件状态,删除
@@ -940,7 +910,7 @@ public class MsSignSealServiceImpl implements MsSignSealService {
940 910
                                                 if(StrUtil.isEmpty(msCaseAttach.getOtherSysFileId())||StrUtil.isEmpty(msCaseAttach.getAnnexPath())){
941 911
                                                     continue;
942 912
                                                 }
943
-                                                beiMingInterfaceService.deleteAttachmentInfo(application.getCaseNum(), msCaseAttach.getOtherSysFileId(), FileUtil.getName(msCaseAttach.getAnnexPath()));
913
+                                                beiMingInterfaceService.deleteAttachmentInfo(caseApplicationselect.getCaseNum(), msCaseAttach.getOtherSysFileId(), FileUtil.getName(msCaseAttach.getAnnexPath()));
944 914
                                             }
945 915
                                         }
946 916
                                     }
@@ -1024,7 +994,7 @@ public class MsSignSealServiceImpl implements MsSignSealService {
1024 994
                                 boolean downLoadFile = FileTransformation.downLoadFileByUrl(fileDownloadUrlnew, resultFilePath);
1025 995
                                 if (downLoadFile) {
1026 996
                                     // 先删除已经存在的调解书
1027
-                                    if(StrUtil.isEmpty(application.getCaseSource())){
997
+                                    if(StrUtil.isEmpty(caseApplicationselect.getCaseSource())){
1028 998
                                         List<MsCaseAttach> existAttach = msCaseAttachMapper.listCaseAttachByCaseIdAndType(caseAppliId, AnnexTypeEnum.MEDIATE_BOOK.getCode());
1029 999
                                         if(CollectionUtil.isNotEmpty(existAttach)){
1030 1000
                                             // todo 对接北明,同步案件状态,删除
@@ -1032,7 +1002,7 @@ public class MsSignSealServiceImpl implements MsSignSealService {
1032 1002
                                                 if(StrUtil.isEmpty(msCaseAttach.getOtherSysFileId())||StrUtil.isEmpty(msCaseAttach.getAnnexPath())){
1033 1003
                                                     continue;
1034 1004
                                                 }
1035
-                                                beiMingInterfaceService.deleteAttachmentInfo(application.getCaseNum(), msCaseAttach.getOtherSysFileId(), FileUtil.getName(msCaseAttach.getAnnexPath()));
1005
+                                                beiMingInterfaceService.deleteAttachmentInfo(caseApplicationselect.getCaseNum(), msCaseAttach.getOtherSysFileId(), FileUtil.getName(msCaseAttach.getAnnexPath()));
1036 1006
                                             }
1037 1007
                                         }
1038 1008
                                     }
@@ -1069,6 +1039,77 @@ public class MsSignSealServiceImpl implements MsSignSealService {
1069 1039
         return AjaxResult.success("success");
1070 1040
     }
1071 1041
 
1042
+    private void downloadMediationBook(MsCaseApplication caseApplicationselect, String signFlowId, Gson gson, Long caseAppliId) throws EsignDemoException, IOException {
1043
+        EsignHttpResponse fileDownload = SaaSAPIFileUtils.fileDownloadUrl(signFlowId);
1044
+        JsonObject fileDownloadJsonObject = gson.fromJson(fileDownload.getBody(), JsonObject.class);
1045
+        JsonObject fileDownloadData = fileDownloadJsonObject.getAsJsonObject("data");
1046
+        JsonArray filesArray = fileDownloadData.get("files").getAsJsonArray();
1047
+        if (filesArray != null && filesArray.size() > 0) {
1048
+            JsonObject fileObject = (JsonObject) filesArray.get(0);
1049
+            String fileDownloadUrl = fileObject.get("downloadUrl").toString();
1050
+            LocalDate now = LocalDate.now();
1051
+            String year = Integer.toString(now.getYear());
1052
+            String month = String.format("%02d", now.getMonthValue());
1053
+            String day = String.format("%02d", now.getDayOfMonth());
1054
+            String saveFolderPath = "/home/ruoyi/uploadPath/upload/" + year + "/" + month + "/" + day;
1055
+            String fileName = UUID.randomUUID().toString().replace("-", "") + ".pdf";
1056
+//                                String saveName = "/profile/upload/" + year + "/" + month + "/" + day + "/" + fileName;
1057
+//                                String savePath = "/home/ruoyi/uploadPath/upload/";
1058
+            String saveName = fileName;
1059
+            String savePath = "/profile/upload/" + year + "/" + month + "/" + day + "/" + fileName;
1060
+
1061
+            // 创建日期目录
1062
+            File saveFolder = new File(saveFolderPath);
1063
+            if (!saveFolder.exists()) {
1064
+                saveFolder.mkdirs();
1065
+            }
1066
+            String resultFilePath = saveFolderPath + "/" + fileName;
1067
+            File resultFilePathFile = new File(resultFilePath);
1068
+            if (!resultFilePathFile.exists()) {
1069
+                resultFilePathFile.createNewFile();
1070
+            }
1071
+
1072
+            String fileDownloadUrlnew = fileDownloadUrl.substring(1, fileDownloadUrl.length() - 1);
1073
+            boolean downLoadFile = FileTransformation.downLoadFileByUrl(fileDownloadUrlnew, resultFilePath);
1074
+            if (downLoadFile) {
1075
+                // 先删除已经存在的调解书
1076
+                if(StrUtil.isEmpty(caseApplicationselect.getCaseSource())){
1077
+                    List<MsCaseAttach> existAttach = msCaseAttachMapper.listCaseAttachByCaseIdAndType(caseAppliId, AnnexTypeEnum.MEDIATE_BOOK.getCode());
1078
+                    if(CollectionUtil.isNotEmpty(existAttach)){
1079
+                        // todo 对接北明,同步案件状态,删除
1080
+                        for (MsCaseAttach msCaseAttach : existAttach) {
1081
+                            if(StrUtil.isEmpty(msCaseAttach.getOtherSysFileId())||StrUtil.isEmpty(msCaseAttach.getAnnexPath())){
1082
+                                continue;
1083
+                            }
1084
+                            beiMingInterfaceService.deleteAttachmentInfo(caseApplicationselect.getCaseNum(), msCaseAttach.getOtherSysFileId(), FileUtil.getName(msCaseAttach.getAnnexPath()));
1085
+                        }
1086
+                    }
1087
+                }
1088
+                msCaseAttachMapper.deleteCaseAttachByCasedIdAndType(caseAppliId, AnnexTypeEnum.MEDIATE_BOOK.getCode());
1089
+                MsCaseAttach caseAttach = new MsCaseAttach();
1090
+                caseAttach.setCaseAppliId(caseAppliId);
1091
+                caseAttach.setAnnexType(AnnexTypeEnum.MEDIATE_BOOK.getCode());
1092
+                caseAttach.setAnnexPath(savePath);
1093
+                caseAttach.setAnnexName(saveName);
1094
+                caseAttachMapper.save(caseAttach);
1095
+                // todo 对接北明,调用上传附件接口
1096
+                if(StrUtil.isEmpty(caseApplicationselect.getCaseSource()) ) {
1097
+                    String templatePath = "/home/ruoyi" + savePath;
1098
+                    File file = new File(templatePath.replace("/profile", "/uploadPath"));
1099
+                    MsCaseFileInfo caseFileInfo = beiMingInterfaceService.pushAttachmentInfo(BMUserName, BMPassword, file, BMSyncSource, caseApplicationselect.getCaseNum(), AttachmentOperateTypeEnum.ADD, DocumentTypeEnum.EVEDENT_AGREEMENT);
1100
+                    // 更新附件表
1101
+                    if(caseFileInfo!=null && StrUtil.isNotEmpty(caseFileInfo.getFileId())){
1102
+                        caseAttach.setOtherSysFileId(caseFileInfo.getFileId());
1103
+                        msCaseAttachMapper.updateCaseAttachBycaseid(caseAttach);
1104
+                    }
1105
+
1106
+                }
1107
+            }
1108
+
1109
+        }
1110
+    }
1111
+
1112
+
1072 1113
     @Override
1073 1114
     @Transactional(rollbackFor = Exception.class)
1074 1115
     public AjaxResult sealCheckCallback(String reqbodystr) throws EsignDemoException, IOException {

+ 101
- 1
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/mscase/impl/VideoConferenceServiceImpl.java Wyświetl plik

@@ -4,6 +4,8 @@ import cn.hutool.core.collection.CollectionUtil;
4 4
 import cn.hutool.core.io.FileUtil;
5 5
 import cn.hutool.core.util.StrUtil;
6 6
 import cn.hutool.http.HttpUtil;
7
+import cn.hutool.json.JSONArray;
8
+import cn.hutool.json.JSONUtil;
7 9
 import com.alibaba.fastjson.JSON;
8 10
 import com.alibaba.fastjson.JSONObject;
9 11
 import com.ruoyi.common.config.RuoYiConfig;
@@ -13,6 +15,7 @@ import com.ruoyi.common.core.domain.entity.SysUser;
13 15
 import com.ruoyi.common.enums.AnnexTypeEnum;
14 16
 import com.ruoyi.common.enums.AttachmentOperateTypeEnum;
15 17
 import com.ruoyi.common.enums.DocumentTypeEnum;
18
+import com.ruoyi.common.enums.SMSStatusEnum;
16 19
 import com.ruoyi.common.exception.ServiceException;
17 20
 import com.ruoyi.common.utils.PdfUtils;
18 21
 import com.ruoyi.common.utils.SecurityUtils;
@@ -20,14 +23,18 @@ import com.ruoyi.system.mapper.SysRoleMapper;
20 23
 import com.ruoyi.system.mapper.SysUserMapper;
21 24
 import com.ruoyi.system.service.impl.BeiMingInterfaceService;
22 25
 import com.ruoyi.wisdomarbitrate.domain.dto.mscase.ReservedConference;
26
+import com.ruoyi.wisdomarbitrate.domain.dto.sendrecord.SmsSendRecord;
27
+import com.ruoyi.wisdomarbitrate.domain.entity.mscase.MsCaseAffiliate;
23 28
 import com.ruoyi.wisdomarbitrate.domain.entity.mscase.MsCaseApplication;
24 29
 import com.ruoyi.wisdomarbitrate.domain.entity.mscase.MsCaseAttach;
25 30
 import com.ruoyi.wisdomarbitrate.domain.vo.mscase.MsCaseApplicationVO;
26 31
 import com.ruoyi.wisdomarbitrate.domain.vo.mscase.MsCaseFileInfo;
27 32
 import com.ruoyi.wisdomarbitrate.domain.vo.mscase.MsReservedConferenceVO;
33
+import com.ruoyi.wisdomarbitrate.mapper.mscase.MsCaseAffiliateMapper;
28 34
 import com.ruoyi.wisdomarbitrate.mapper.mscase.MsCaseApplicationMapper;
29 35
 import com.ruoyi.wisdomarbitrate.mapper.mscase.MsCaseAttachMapper;
30 36
 import com.ruoyi.wisdomarbitrate.mapper.mscase.ReservedConferenceMapper;
37
+import com.ruoyi.wisdomarbitrate.mapper.sendrecord.SmsRecordMapper;
31 38
 import com.ruoyi.wisdomarbitrate.service.mscase.VideoConferenceService;
32 39
 import com.tencentcloudapi.common.Credential;
33 40
 import com.tencentcloudapi.common.exception.TencentCloudSDKException;
@@ -45,12 +52,14 @@ import tk.mybatis.mapper.entity.Example;
45 52
 
46 53
 import javax.crypto.Mac;
47 54
 import javax.crypto.spec.SecretKeySpec;
55
+import javax.servlet.http.HttpServletRequest;
48 56
 import java.io.File;
49 57
 import java.io.IOException;
50 58
 import java.nio.file.Paths;
51 59
 import java.util.*;
52 60
 import java.util.stream.Collectors;
53 61
 
62
+import static com.ruoyi.common.core.domain.AjaxResult.error;
54 63
 import static com.ruoyi.common.core.domain.AjaxResult.success;
55 64
 import static com.ruoyi.common.utils.file.FileUploadUtils.getAbsoluteFile;
56 65
 import static com.ruoyi.common.utils.file.FileUploadUtils.getPathFileName;
@@ -80,6 +89,8 @@ public class VideoConferenceServiceImpl implements VideoConferenceService {
80 89
     @Autowired
81 90
     private MsCaseAttachMapper caseAttachMapper;
82 91
     @Autowired
92
+    private MsCaseAffiliateMapper caseAffiliateMapper;
93
+    @Autowired
83 94
     private SysRoleMapper roleMapper;
84 95
     @Autowired
85 96
     private ReservedConferenceMapper reservedConferenceMapper;
@@ -94,6 +105,8 @@ public class VideoConferenceServiceImpl implements VideoConferenceService {
94 105
     private String BMSyncSource;
95 106
     @Autowired
96 107
     BeiMingInterfaceService beiMingInterfaceService;
108
+    @Autowired
109
+    private SmsRecordMapper smsRecordMapper;
97 110
 
98 111
     /**
99 112
         视频回调
@@ -139,6 +152,83 @@ public class VideoConferenceServiceImpl implements VideoConferenceService {
139 152
         return success("预约会议成功");
140 153
     }
141 154
 
155
+    @Override
156
+    public void smsRollBack(String body, HttpServletRequest request) {
157
+        // 解析body
158
+        JSONArray jsonArray = JSONUtil.parseArray(body);
159
+        if (jsonArray != null && jsonArray.size() > 0) {
160
+            for (Object o : jsonArray) {
161
+                cn.hutool.json.JSONObject jsonObject = JSONUtil.parseObj(o);
162
+                if (jsonObject.get("sid") != null) {
163
+                    Object description = jsonObject.get("description");
164
+                    System.out.println(description);
165
+                    // 查询sid对应的短信,更新短信状态
166
+                    SmsSendRecord smsSendRecord = smsRecordMapper.selectBySId(jsonObject.getStr("sid"));
167
+                    if (smsSendRecord != null) {
168
+                        if (jsonObject.get("report_status") != null && jsonObject.getStr("report_status").equals("SUCCESS")) {
169
+                            smsSendRecord.setSendStatus(SMSStatusEnum.SUCCESS.getCode());
170
+                        } else {
171
+                            smsSendRecord.setSendStatus(SMSStatusEnum.FAIL.getCode());
172
+                            smsSendRecord.setReason(description != null ? description.toString() : null);
173
+                        }
174
+                        smsRecordMapper.updateStatus(smsSendRecord);
175
+                    }
176
+                }
177
+            }
178
+        }
179
+    }
180
+
181
+    @Override
182
+    public AjaxResult selectRoleMenuByCaseId(Long caseId) {
183
+        AjaxResult result = success();
184
+        // 根据案件id查询相关人员
185
+        List<MsCaseAffiliate> msCaseAffiliates = caseAffiliateMapper.selectByCaseId(caseId);
186
+        if(CollectionUtil.isEmpty(msCaseAffiliates)){
187
+            return error("未找到案件相关人员");
188
+        }
189
+        Long userId = SecurityUtils.getUserId();
190
+        if(userId==null){
191
+            return error("未找到当前登录用户");
192
+        }
193
+        for (MsCaseAffiliate affiliate : msCaseAffiliates) {
194
+            if(affiliate.getOperatorFlag()!=null && affiliate.getOperatorFlag()==1 && affiliate.getUserId()!=null&&affiliate.getUserId().equals(userId)&&affiliate.getRoleType()!=null){
195
+                if(affiliate.getRoleType().equals(1)||affiliate.getRoleType().equals(2)){
196
+                    // 申请人操作人
197
+                    result.put("appFlag","1");
198
+                }
199
+                if(affiliate.getRoleType().equals(3)||affiliate.getRoleType().equals(4)){
200
+                    // 被申请人操作人
201
+                    result.put("resFlag","1");
202
+                }
203
+            }
204
+        }
205
+        return result;
206
+    }
207
+
208
+    public static void main(String[] args) {
209
+        String body="[{\"mobile\":\"18792927508\",\"report_status\":\"FAIL\",\"description\":\"\\u8FD0\\u8425\\u5546\\u5173\\u952E\\u5B57\\u62E6\\u622A\",\"errmsg\":\"GB:0010\",\"user_receive_time\":\"2024-04-07 14:28:57\",\"sid\":\"9318:147045628317124713319032750\",\"nationcode\":\"86\"}]";
210
+        JSONArray jsonArray = JSONUtil.parseArray(body);
211
+        if(jsonArray!=null && jsonArray.size()>0){
212
+            for (Object o : jsonArray) {
213
+                cn.hutool.json.JSONObject jsonObject = JSONUtil.parseObj(o);
214
+                if(jsonObject.get("sid")!=null){
215
+                    String reportStatus = jsonObject.getStr("report_status");
216
+                    String description = jsonObject.getStr("description");
217
+                    System.out.println(description);
218
+                    // 查询sid对应的短信,更新短信状态
219
+                 //   SmsSendRecord smsSendRecord=  smsRecordMapper.selectBySId(jsonObject.getStr("sid"));
220
+                 //   if(smsSendRecord!=null){
221
+                     //   if(jsonObject.get("report_status")!=null && jsonObject.getStr("report_status").equals("SUCCESS")){
222
+                    //        smsSendRecord.setSendStatus(SMSStatusEnum.SUCCESS.getCode());
223
+                    //    }else {
224
+                      //      smsSendRecord.setSendStatus(SMSStatusEnum.FAIL.getCode());
225
+                     //   }
226
+                //    }
227
+                }
228
+            }
229
+        }
230
+    }
231
+
142 232
     /**
143 233
      * 根据案件id查询已预约的会议
144 234
      *
@@ -388,11 +478,11 @@ public class VideoConferenceServiceImpl implements VideoConferenceService {
388 478
         if(caseApplication==null){
389 479
             return AjaxResult.error("案件不存在");
390 480
         }
481
+        List<SysRole> roles = roleMapper.selectRolePermissionByUserId(userId);
391 482
         JSONObject jsonObject = new JSONObject();
392 483
         boolean isSecretaryRole=false;
393 484
         if(caseApplication.getMediatorId()!=null&& Objects.equals(userId, caseApplication.getMediatorId())){
394 485
             // 是调解员
395
-            List<SysRole> roles = roleMapper.selectRolePermissionByUserId(userId);
396 486
             if(CollectionUtil.isNotEmpty(roles)){
397 487
                 for (SysRole role : roles) {
398 488
                     if("调解员".equals(role.getRoleName())){
@@ -401,6 +491,16 @@ public class VideoConferenceServiceImpl implements VideoConferenceService {
401 491
                     }
402 492
                 }
403 493
             }
494
+        }else {
495
+                // 是调解员
496
+                if(CollectionUtil.isNotEmpty(roles)){
497
+                    for (SysRole role : roles) {
498
+                        if("法律顾问".equals(role.getRoleName())){
499
+                            isSecretaryRole=true;
500
+                            break;
501
+                        }
502
+                    }
503
+                }
404 504
         }
405 505
 
406 506
         jsonObject.put("isSecretaryRole",isSecretaryRole);

+ 160
- 4
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/utils/SignAward.java Wyświetl plik

@@ -288,12 +288,12 @@ public class SignAward {
288 288
     }
289 289
 
290 290
     /**
291
-     * 发起签署
291
+     * 发起带有用印签署
292 292
      *
293 293
      * @return
294 294
      * @throws EsignDemoException
295 295
      */
296
-    public static EsignHttpResponse createByFileMediation(SealSignRecord sealSignRecord ,List<String> sealIdList) throws EsignDemoException {
296
+    public static EsignHttpResponse createByFileSeal(SealSignRecord sealSignRecord ,List<String> sealIdList) throws EsignDemoException {
297 297
         String apiaddr = "/v3/sign-flow/create-by-file";
298 298
 
299 299
         String fileId = sealSignRecord.getFileid();
@@ -488,6 +488,162 @@ public class SignAward {
488 488
         //发起接口请求
489 489
         return EsignHttpHelper.doCommHttp(eSignHost, apiaddr, requestType, jsonParm, header, false);
490 490
     }
491
+    /**
492
+     * 发起不带用印签署
493
+     *
494
+     * @return
495
+     * @throws EsignDemoException
496
+     */
497
+    public static EsignHttpResponse createByFileMediation(SealSignRecord sealSignRecord) throws EsignDemoException {
498
+        String apiaddr = "/v3/sign-flow/create-by-file";
499
+
500
+        String fileId = sealSignRecord.getFileid();
501
+        String fileName = sealSignRecord.getFilename();
502
+
503
+        String psnAccount = sealSignRecord.getPensonAccount();
504
+        String psnName = sealSignRecord.getPensonName();
505
+
506
+        String psnAccountRes = sealSignRecord.getPensonAccountRes();
507
+        String psnNameRes = sealSignRecord.getPensonNameRes();
508
+
509
+        String psnAccountMedi = sealSignRecord.getPensonAccountMedi();
510
+        String psnNameMedi = sealSignRecord.getPensonNameMedi();
511
+
512
+
513
+        String positionPagepsn = sealSignRecord.getPositionPagepsn();
514
+        double positionXpsn = sealSignRecord.getPositionXpsn();
515
+        double positionYpsn = sealSignRecord.getPositionYpsn();
516
+
517
+        String positionPagepsnRes = sealSignRecord.getPositionPagepsnRes();
518
+        double positionXpsnRes = sealSignRecord.getPositionXpsnRes();
519
+        double positionYpsnRes = sealSignRecord.getPositionYpsnRes();
520
+
521
+        String positionPagepsnMedi = sealSignRecord.getPositionPagepsnMedi();
522
+        double positionXpsnMedi = sealSignRecord.getPositionXpsnMedi();
523
+        double positionYpsnMedi = sealSignRecord.getPositionYpsnMedi();
524
+
525
+
526
+        String jsonParm = "{\n" +
527
+                "    \"docs\": [\n" +
528
+                "        {\n" +
529
+                "            \"fileId\": \"" + fileId + "\",\n" +
530
+                "            \"fileName\": \"" + fileName + "\"\n" +
531
+                "        }\n" +
532
+                "    ],\n" +
533
+                "    \"signFlowConfig\": {\n" +
534
+                "        \"signFlowTitle\": \"测试合同\",\n" +
535
+                "        \"autoStart\": true,\n" +
536
+                "       \"authConfig\": {\n" +
537
+                "           \"willingnessAuthModes\": [\n" +
538
+                "               \"CODE_SMS\"\n" +
539
+                "           ],\n" +
540
+                "           \"psnAvailableAuthModes\": [\n" +
541
+                "               \"PSN_MOBILE3\"\n" +
542
+                "           ],\n" +
543
+                "           \"orgAvailableAuthModes\": [\n" +
544
+                "               \"ORG_LEGALREP\"\n" +
545
+                "           ]\n" +
546
+                "       },\n" +
547
+
548
+                "       \"signConfig\": {\n" +
549
+                "           \"availableSignClientTypes\":  \"1\"\n" +
550
+                "       },\n" +
551
+//                "        \"notifyUrl\": \"" + signSealCallbackUrl + "\",\n" +
552
+                "        \"autoFinish\": true\n" +
553
+                "    },\n" +
554
+
555
+                "    \"signers\": [\n" +
556
+                "          {\n" +
557
+                "            \"psnSignerInfo\": {\n" +
558
+                "                \"psnAccount\": \"" + psnAccount + "\",\n" +
559
+                "                \"psnInfo\": {\n" +
560
+                "                            \"psnName\": \"" + psnName + "\"\n" +
561
+                "                        }\n" +
562
+                "            },\n" +
563
+                "            \"signFields\": [\n" +
564
+                "                {\n" +
565
+                "                    \"fileId\": \"" + fileId + "\",\n" +
566
+                "                    \"normalSignFieldConfig\": {\n" +
567
+                "                        \"autoSign\": false,\n" +
568
+                "                        \"freeMode\": false,\n" +
569
+                "                        \"movableSignField\": false,\n" +
570
+                "                        \"signFieldPosition\": {\n" +
571
+                "                            \"positionPage\": \"" + positionPagepsn + "\",\n" +
572
+                "                            \"positionX\": " + positionXpsn + ",\n" +
573
+                "                            \"positionY\": " + positionYpsn + "\n" +
574
+                "                        },\n" +
575
+                "                        \"signFieldStyle\": 1\n" +
576
+                "                    },\n" +
577
+                "                    \"signFieldType\": 0\n" +
578
+                "                }\n" +
579
+                "            ],\n" +
580
+                "            \"signerType\": 0\n" +
581
+                "        },\n" +
582
+
583
+                "        {\n" +
584
+                "            \"psnSignerInfo\": {\n" +
585
+                "                \"psnAccount\": \"" + psnAccountRes + "\",\n" +
586
+                "                \"psnInfo\": {\n" +
587
+                "                            \"psnName\": \"" + psnNameRes + "\"\n" +
588
+                "                        }\n" +
589
+                "            },\n" +
590
+                "            \"signFields\": [\n" +
591
+                "                {\n" +
592
+                "                    \"fileId\": \"" + fileId + "\",\n" +
593
+                "                    \"normalSignFieldConfig\": {\n" +
594
+                "                        \"autoSign\": false,\n" +
595
+                "                        \"freeMode\": false,\n" +
596
+                "                        \"movableSignField\": false,\n" +
597
+                "                        \"signFieldPosition\": {\n" +
598
+                "                            \"positionPage\": \"" + positionPagepsnRes + "\",\n" +
599
+                "                            \"positionX\": " + positionXpsnRes + ",\n" +
600
+                "                            \"positionY\": " + positionYpsnRes + "\n" +
601
+                "                        },\n" +
602
+                "                        \"signFieldStyle\": 1\n" +
603
+                "                    },\n" +
604
+                "                    \"signFieldType\": 0\n" +
605
+                "                }\n" +
606
+                "            ],\n" +
607
+                "            \"signerType\": 0\n" +
608
+                "        },\n" +
609
+
610
+
611
+                "        {\n" +
612
+                "            \"psnSignerInfo\": {\n" +
613
+                "                \"psnAccount\": \"" + psnAccountMedi + "\",\n" +
614
+                "                \"psnInfo\": {\n" +
615
+                "                            \"psnName\": \"" + psnNameMedi + "\"\n" +
616
+                "                        }\n" +
617
+                "            },\n" +
618
+                "            \"signFields\": [\n" +
619
+                "                {\n" +
620
+                "                    \"fileId\": \"" + fileId + "\",\n" +
621
+                "                    \"normalSignFieldConfig\": {\n" +
622
+                "                        \"autoSign\": false,\n" +
623
+                "                        \"freeMode\": false,\n" +
624
+                "                        \"movableSignField\": false,\n" +
625
+                "                        \"signFieldPosition\": {\n" +
626
+                "                            \"positionPage\": \"" + positionPagepsnMedi + "\",\n" +
627
+                "                            \"positionX\": " + positionXpsnMedi + ",\n" +
628
+                "                            \"positionY\": " + positionYpsnMedi + "\n" +
629
+                "                        },\n" +
630
+                "                        \"signFieldStyle\": 1\n" +
631
+                "                    },\n" +
632
+                "                    \"signFieldType\": 0\n" +
633
+                "                }\n" +
634
+                "            ],\n" +
635
+                "            \"signerType\": 0\n" +
636
+                "        }\n" +
637
+                "    ]\n" +
638
+                "}";
639
+
640
+        //请求方法
641
+        EsignRequestType requestType = EsignRequestType.POST;
642
+        //生成请求签名鉴权方式的Header
643
+        Map<String, String> header = EsignHttpHelper.signAndBuildSignAndJsonHeader(eSignAppId, eSignAppSecret, jsonParm, requestType.name(), apiaddr, false);
644
+        //发起接口请求
645
+        return EsignHttpHelper.doCommHttp(eSignHost, apiaddr, requestType, jsonParm, header, false);
646
+    }
491 647
 
492 648
     /**
493 649
      * 发起签署
@@ -850,8 +1006,8 @@ public class SignAward {
850 1006
         String apiaddr = "/v3/files/" + fileId + "/keyword-positions";
851 1007
         String jsonParm = "{\n" +
852 1008
                 "    \"keywords\": [\n" +
853
-                "        \"甲方(签字):\",\n" +
854
-                "        \"乙方(签字):\",\n" +
1009
+                "        \"申请人(签字):\",\n" +
1010
+                "        \"被申请人(签字):\",\n" +
855 1011
                 "        \"调解员(签字):\",\n" +
856 1012
                 "        \"调解机构(盖章):\"\n" +
857 1013
                 "    ]\n" +

+ 5
- 1
ruoyi-system/src/main/resources/mapper/system/SysDeptMapper.xml Wyświetl plik

@@ -230,4 +230,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
230 230
 		update ms_sys_dept set del_flag = '2' where dept_id = #{deptId}
231 231
 	</delete>
232 232
 
233
-</mapper> 
233
+	<select id="selectDeptByName" resultMap="SysDeptResult">
234
+		<include refid="selectDeptVo"/>
235
+		where dept_name=#{deptName}  and del_flag = '0' limit 1
236
+	</select>
237
+</mapper>

+ 1
- 1
ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml Wyświetl plik

@@ -182,7 +182,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
182 182
 			from ms_sys_user u
183 183
 			left join ms_sys_user_role ur on u.user_id = ur.user_id
184 184
 			left join ms_sys_role r on r.role_id = ur.role_id
185
-		where u.eamil = #{eamil} and u.del_flag = '0' and u.status='0' order by u.create_time limit 1
185
+		where u.email = #{email} and u.del_flag = '0' and u.status='0' order by u.create_time limit 1
186 186
 	</select>
187 187
     <select id="selectByDeptIdAndRole" resultMap="SysUserResult">
188 188
 		select u.* from

+ 1
- 1
ruoyi-system/src/main/resources/mapper/wisdomarbitrate/mscase/MsCaseAffiliateMapper.xml Wyświetl plik

@@ -54,7 +54,7 @@
54 54
                 LEFT JOIN ms_sys_role r ON r.role_id = ur.role_id
55 55
                 LEFT JOIN ms_sys_dept d ON d.dept_id = a.applicant_dept_id
56 56
         where  c.id = #{id}
57
-        GROUP BY a.id
57
+        GROUP BY a.id order by a.id asc
58 58
     </select>
59 59
     <select id="selectUserRoleByCaseIds" resultType="com.ruoyi.wisdomarbitrate.domain.entity.mscase.MsCaseAffiliate">
60 60
         select c.id caseAppliId,a.id,a.role_type roleType,a.group_order groupOrder,a.operator_flag operatorFlag,d.code,d.comp_legal_person compLegalPerson,u.id_card idCard,u.phonenumber phone,

+ 18
- 3
ruoyi-system/src/main/resources/mapper/wisdomarbitrate/sendrecord/SmsRecordMapper.xml Wyświetl plik

@@ -16,6 +16,7 @@
16 16
         <result property="createBy"   column="create_by"  />
17 17
         <result property="updateBy"   column="update_by"  />
18 18
         <result property="sendStatus"   column="send_status"  />
19
+        <result property="sid"   column="sid"  />
19 20
     </resultMap>
20 21
     <insert id="saveSmsSendRecord" parameterType="com.ruoyi.wisdomarbitrate.domain.dto.sendrecord.SmsSendRecord" useGeneratedKeys="true" keyProperty="id">
21 22
 
@@ -27,6 +28,8 @@
27 28
         <if test="sendContent != null ">send_content,</if>
28 29
         <if test="createBy != null and createBy != ''">create_by,</if>
29 30
         <if test="sendStatus != null ">send_status,</if>
31
+        sid,
32
+        reason,
30 33
         create_time
31 34
         )values(
32 35
         <if test="caseId != null ">#{caseId},</if>
@@ -36,6 +39,8 @@
36 39
         <if test="sendContent != null ">#{sendContent},</if>
37 40
         <if test="createBy != null  and createBy != ''">#{createBy},</if>
38 41
         <if test="sendStatus != null ">#{sendStatus},</if>
42
+        #{sid},
43
+        #{reason},
39 44
         sysdate()
40 45
         )
41 46
     </insert>
@@ -49,7 +54,8 @@
49 54
        send_content,
50 55
        create_by,
51 56
        send_status,
52
-        create_time
57
+        create_time,
58
+        sid,reason
53 59
         )values
54 60
         <foreach item="item" index="index" collection="list" separator=",">
55 61
         (
@@ -60,14 +66,14 @@
60 66
         #{item.sendContent},
61 67
         #{item.createBy},
62 68
         #{item.sendStatus},
63
-        sysdate()
69
+        sysdate(),#{sid},#{reason}
64 70
         )
65 71
         </foreach>
66 72
     </insert>
67 73
 
68 74
     <select id="getSmsSendRecord" parameterType="com.ruoyi.wisdomarbitrate.domain.dto.sendrecord.SmsSendRecord" resultMap="SmsSendRecordResult">
69 75
 
70
-        select id ,case_appli_id ,case_num ,phone ,send_time ,send_content,send_status
76
+        select *
71 77
         from ms_sms_send_record
72 78
         <where>
73 79
             <if test="caseNum != null and caseNum != ''">
@@ -76,5 +82,14 @@
76 82
         </where>
77 83
         order by send_time desc
78 84
     </select>
85
+
86
+    <select id="selectBySId" resultMap="SmsSendRecordResult">
87
+        select  * from ms_sms_send_record where sid=#{sid}
88
+    </select>
89
+
90
+    <update id="updateStatus">
91
+        update ms_sms_send_record
92
+       set send_status= #{sendStatus} ,reason=#{reason} where sid=#{sid}
93
+    </update>
79 94
 </mapper>
80 95