18792927508 hace 2 años
padre
commit
6da9516d82
Se han modificado 55 ficheros con 1792 adiciones y 1179 borrados
  1. 15
    12
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysMenuController.java
  2. 11
    0
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/miniprogress/WeChatUserController.java
  3. 2
    14
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/mscase/MsCaseApplicationController.java
  4. 2
    0
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/mscase/MsVideoConferenceController.java
  5. 47
    8
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/sendrecord/ShortMessageController.java
  6. 55
    0
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/sms/SMSTemplateController.java
  7. 1
    0
      ruoyi-common/src/main/java/com/ruoyi/common/constant/CacheConstants.java
  8. 1
    1
      ruoyi-common/src/main/java/com/ruoyi/common/constant/UserConstants.java
  9. 7
    8
      ruoyi-common/src/main/java/com/ruoyi/common/utils/EmailOutUtil.java
  10. 0
    115
      ruoyi-common/src/main/java/com/ruoyi/common/utils/SmsUtils.java
  11. 22
    11
      ruoyi-common/src/main/java/com/ruoyi/common/utils/WordUtil.java
  12. 1
    0
      ruoyi-system/src/main/java/com/ruoyi/system/domain/entity/log/MsRequestLog.java
  13. 14
    8
      ruoyi-system/src/main/java/com/ruoyi/system/domain/entity/shortmessage/MsSmsSendHistoryRecord.java
  14. 28
    0
      ruoyi-system/src/main/java/com/ruoyi/system/domain/entity/sms/MsSmsSendHistoryRecordParam.java
  15. 33
    0
      ruoyi-system/src/main/java/com/ruoyi/system/domain/entity/sms/MsSmsSendRecordParam.java
  16. 38
    0
      ruoyi-system/src/main/java/com/ruoyi/system/domain/entity/sms/MsSmsTemplate.java
  17. 38
    0
      ruoyi-system/src/main/java/com/ruoyi/system/domain/entity/sms/MsSmsTemplateParam.java
  18. 22
    0
      ruoyi-system/src/main/java/com/ruoyi/system/mapper/sms/MsSmsSendHistoryRecordParamMapper.java
  19. 22
    0
      ruoyi-system/src/main/java/com/ruoyi/system/mapper/sms/MsSmsSendRecordParamMapper.java
  20. 7
    0
      ruoyi-system/src/main/java/com/ruoyi/system/mapper/sms/MsSmsTemplateMapper.java
  21. 18
    0
      ruoyi-system/src/main/java/com/ruoyi/system/mapper/sms/MsSmsTemplateParamMapper.java
  22. 7
    0
      ruoyi-system/src/main/java/com/ruoyi/system/service/ISysMenuService.java
  23. 9
    0
      ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDeptServiceImpl.java
  24. 9
    0
      ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysMenuServiceImpl.java
  25. 21
    2
      ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserServiceImpl.java
  26. 12
    0
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/dto/miniprogress/IdentityAuthentication.java
  27. 19
    4
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/dto/sendrecord/SmsSendRecord.java
  28. 15
    0
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/entity/mscase/MsCaseAffiliate.java
  29. 3
    5
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/entity/mscase/MsCaseApplication.java
  30. 6
    1
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/vo/shortmessage/ReSendMessageVO.java
  31. 14
    0
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/mscase/MsCaseApplicationMapper.java
  32. 2
    6
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/sendrecord/SmsRecordMapper.java
  33. 8
    0
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/miniprogress/WeChatUserService.java
  34. 36
    8
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/miniprogress/impl/WeChatUserServiceImpl.java
  35. 11
    29
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/mscase/MsCaseApplicationService.java
  36. 1
    6
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/mscase/MsCasePaymentService.java
  37. 535
    493
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/mscase/impl/MsCaseApplicationServiceImpl.java
  38. 24
    62
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/mscase/impl/MsCasePaymentServiceImpl.java
  39. 69
    311
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/mscase/impl/MsSignSealServiceImpl.java
  40. 3
    12
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/mscase/impl/VideoConferenceServiceImpl.java
  41. 6
    1
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/shortmessage/ShortMessageService.java
  42. 156
    15
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/shortmessage/impl/ShortMessageServiceImpl.java
  43. 21
    0
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/sms/SMSTemplateService.java
  44. 96
    0
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/sms/impl/SMSTemplateServiceImpl.java
  45. 192
    0
      ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/utils/SmsUtils.java
  46. 2
    1
      ruoyi-system/src/main/resources/com/ruoyi/system/mapper/log/MsRequestLogMapper.xml
  47. 12
    0
      ruoyi-system/src/main/resources/com/ruoyi/system/mapper/sms/MsSmsSendHistoryRecordParamMapper.xml
  48. 13
    0
      ruoyi-system/src/main/resources/com/ruoyi/system/mapper/sms/MsSmsSendRecordParamMapper.xml
  49. 12
    0
      ruoyi-system/src/main/resources/com/ruoyi/system/mapper/sms/MsSmsTemplateMapper.xml
  50. 12
    0
      ruoyi-system/src/main/resources/com/ruoyi/system/mapper/sms/MsSmsTemplateParamMapper.xml
  51. 1
    1
      ruoyi-system/src/main/resources/mapper/system/SysMenuMapper.xml
  52. 4
    1
      ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml
  53. 6
    6
      ruoyi-system/src/main/resources/mapper/wisdomarbitrate/mscase/MsCaseAffiliateMapper.xml
  54. 26
    2
      ruoyi-system/src/main/resources/mapper/wisdomarbitrate/mscase/MsCaseApplicationMapper.xml
  55. 45
    36
      ruoyi-system/src/main/resources/mapper/wisdomarbitrate/sendrecord/SmsRecordMapper.xml

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

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

+ 11
- 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/miniprogress/WeChatUserController.java Ver fichero

@@ -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()

+ 2
- 14
ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/mscase/MsCaseApplicationController.java Ver fichero

@@ -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.getOrganizeFlag()==null){
78
+        if( caseApplication.getAffiliate()==null){
81 79
             error("参数校验失败");
82 80
         }
83 81
         AjaxResult ajaxResult = AjaxResult.success();
@@ -390,17 +388,7 @@ public class MsCaseApplicationController extends BaseController {
390 388
 
391 389
         return  success(videoService.reserveConferenceList(caseId));
392 390
     }
393
-    /**
394
-     * 查询短信发送记录
395
-     * @param smsSendRecord
396
-     * @return
397
-     */
398
-    @PostMapping("/smsRecord")
399
-    public TableDataInfo getSmsSendRecord(@RequestBody SmsSendRecord smsSendRecord){
400
-        startPage();
401
-        List<SmsSendRecord> list = caseApplicationService.getSmsSendRecord(smsSendRecord);
402
-        return getDataTable(list);
403
-    }
391
+
404 392
     /**
405 393
      * 保存onlyOffice在线编辑的文件
406 394
      * @param

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

@@ -125,6 +125,8 @@ public class MsVideoConferenceController extends BaseController {
125 125
                 .useId(SecurityUtils.getUserId())
126 126
                 .useAccount(SecurityUtils.getUsername())
127 127
                 .build();
128
+        // 先删除之前的附件
129
+        msCaseAttachMapper.deleteCaseAttachByCasedIdAndType(caseId,annexType);
128 130
         msCaseAttachMapper.save(caseAttach);
129 131
         return caseAttach.getAnnexId();
130 132
     }

+ 47
- 8
ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/sendrecord/ShortMessageController.java Ver fichero

@@ -1,35 +1,74 @@
1 1
 package com.ruoyi.web.controller.wisdomarbitrate.sendrecord;
2 2
 
3
+import cn.hutool.core.collection.CollectionUtil;
3 4
 import com.ruoyi.common.annotation.Anonymous;
5
+import com.ruoyi.common.core.controller.BaseController;
4 6
 import com.ruoyi.common.core.domain.AjaxResult;
7
+import com.ruoyi.common.core.page.TableDataInfo;
8
+import com.ruoyi.system.domain.entity.sms.MsSmsSendRecordParam;
9
+import com.ruoyi.system.domain.entity.sms.MsSmsTemplateParam;
10
+import com.ruoyi.system.mapper.sms.MsSmsSendHistoryRecordParamMapper;
11
+import com.ruoyi.system.mapper.sms.MsSmsSendRecordParamMapper;
5 12
 import com.ruoyi.wisdomarbitrate.domain.dto.sendrecord.SmsSendRecord;
6 13
 import com.ruoyi.wisdomarbitrate.domain.vo.shortmessage.ReSendMessageVO;
7 14
 import com.ruoyi.wisdomarbitrate.mapper.sendrecord.SmsRecordMapper;
8 15
 import com.ruoyi.wisdomarbitrate.service.shortmessage.ShortMessageService;
9 16
 import org.springframework.beans.factory.annotation.Autowired;
10 17
 import org.springframework.web.bind.annotation.*;
18
+import tk.mybatis.mapper.entity.Example;
11 19
 
20
+import java.util.ArrayList;
12 21
 import java.util.Date;
22
+import java.util.List;
13 23
 
14 24
 @RestController
15 25
 @RequestMapping("/shortMessage")
16
-public class ShortMessageController {
26
+public class ShortMessageController extends BaseController {
17 27
     @Autowired
18 28
     private SmsRecordMapper smsRecordMapper;
19 29
     @Autowired
20 30
     private ShortMessageService shortMessageService;
31
+    @Autowired
32
+    MsSmsSendRecordParamMapper recordParamMapper;
33
+    @Autowired
34
+    MsSmsSendHistoryRecordParamMapper historyRecordParamMapper;
35
+    /**
36
+     * 查询短信发送记录
37
+     * @param smsSendRecord
38
+     * @return
39
+     */
40
+    @GetMapping("/recordList")
41
+    public TableDataInfo smsSendRecordList( SmsSendRecord smsSendRecord){
42
+        startPage();
43
+        List<SmsSendRecord> list = shortMessageService.smsSendRecordList(smsSendRecord);
44
+        return getDataTable(list);
45
+    }
21 46
 
22 47
     @Anonymous
23 48
     @PostMapping("/updateSendContent")
24 49
     public AjaxResult update(@RequestBody SmsSendRecord smsSendRecord) {
25
-        if (smsSendRecord != null && smsSendRecord.getId() != null) {
26
-            SmsSendRecord oldSendRecord = smsRecordMapper.selectById(smsSendRecord.getId());
27
-            smsSendRecord.setUpdateTime(new Date());
28
-            smsRecordMapper.updateSendContent(smsSendRecord);
29
-            shortMessageService.insertShortMessageHistoryRecord(oldSendRecord);
30
-            return AjaxResult.success();
50
+        if(smsSendRecord == null|| smsSendRecord.getId() == null || CollectionUtil.isEmpty(smsSendRecord.getTemplateParams())){
51
+            return AjaxResult.error("参数校验失败");
52
+        }
53
+             // 查询当前版本记录
54
+        SmsSendRecord oldSendRecord = smsRecordMapper.selectById(smsSendRecord.getId());
55
+        smsSendRecord.setUpdateTime(new Date());
56
+            //  更新短信内容,先删除短信记录参数表
57
+            Example recordParamExam = new Example(MsSmsSendRecordParam.class);
58
+            recordParamExam.createCriteria().andEqualTo("smsRecordId", smsSendRecord.getId());
59
+            recordParamMapper.deleteByExample(recordParamExam);
60
+            // 新增短信记录参数表
61
+        List<MsSmsSendRecordParam> recordParams = new ArrayList<>();
62
+        for (MsSmsTemplateParam templateParam : smsSendRecord.getTemplateParams()) {
63
+            MsSmsSendRecordParam recordParam = new MsSmsSendRecordParam();
64
+            recordParam.setSmsRecordId(smsSendRecord.getId());
65
+            recordParam.setParamValue(templateParam.getParamValue());
66
+            recordParams.add(recordParam);
31 67
         }
32
-        return AjaxResult.error("更新失败");
68
+            recordParamMapper.batchInsert(recordParams);
69
+            shortMessageService.insertShortMessageHistoryRecord(oldSendRecord,recordParams);
70
+            return AjaxResult.success();
71
+
33 72
     }
34 73
 
35 74
     /**

+ 55
- 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/sms/SMSTemplateController.java Ver fichero

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

+ 1
- 0
ruoyi-common/src/main/java/com/ruoyi/common/constant/CacheConstants.java Ver fichero

@@ -47,6 +47,7 @@ public class CacheConstants
47 47
      */
48 48
     public static final String PWD_ERR_CNT_KEY = "pwd_err_cnt:";
49 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:";
50 51
     /**
51 52
      * 案件 redis key
52 53
      */

+ 1
- 1
ruoyi-common/src/main/java/com/ruoyi/common/constant/UserConstants.java Ver fichero

@@ -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
      * 密码长度限制

+ 7
- 8
ruoyi-common/src/main/java/com/ruoyi/common/utils/EmailOutUtil.java Ver fichero

@@ -47,12 +47,12 @@ public class EmailOutUtil {
47 47
 //    private static String fromOut;
48 48
     @Value("${spring.mail.host}")
49 49
     private String hostOut;
50
-//    @Value("${spring.mail.username}")
51
-//    private String usernameOut;
52
-    private String usernameOut="wq18792927508@163.com";
53
-//    @Value("${spring.mail.password}")
54
-//    private String passwordOut;
55
-    private String passwordOut= "WDFHKSEMCKVRELEA";
50
+    @Value("${spring.mail.username}")
51
+    private String usernameOut;
52
+
53
+    @Value("${spring.mail.password}")
54
+    private String passwordOut;
55
+
56 56
     @Value("${spring.mail.port}")
57 57
     private Integer portOut;
58 58
 
@@ -77,7 +77,7 @@ public class EmailOutUtil {
77 77
     public Boolean sendMessage(String to, String subject, String content, String from, JavaMailSender mailSender) {
78 78
         try {
79 79
             if(mailSender==null){
80
-                rebuildMailSender();
80
+                mailSender=  rebuildMailSender();
81 81
             }
82 82
             // 创建一个邮件对象
83 83
             SimpleMailMessage msg = new SimpleMailMessage();
@@ -97,7 +97,6 @@ public class EmailOutUtil {
97 97
             return false;
98 98
         }
99 99
         return true;
100
-        ////System.out.println("发送成功:" + from + ":to:" + to);
101 100
     }
102 101
 
103 102
     /**

+ 0
- 115
ruoyi-common/src/main/java/com/ruoyi/common/utils/SmsUtils.java Ver fichero

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

+ 22
- 11
ruoyi-common/src/main/java/com/ruoyi/common/utils/WordUtil.java Ver fichero

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

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

@@ -1,3 +1,4 @@
1
+
1 2
 package com.ruoyi.system.domain.entity.log;
2 3
 
3 4
 import lombok.Getter;

+ 14
- 8
ruoyi-system/src/main/java/com/ruoyi/system/domain/entity/shortmessage/MsSmsSendHistoryRecord.java Ver fichero

@@ -1,9 +1,15 @@
1 1
 package com.ruoyi.system.domain.entity.shortmessage;
2 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;
3 12
 import java.util.Date;
4
-import javax.persistence.*;
5
-
6
-import lombok.*;
7 13
 
8 14
 @Data
9 15
 @AllArgsConstructor
@@ -20,6 +26,11 @@ public class MsSmsSendHistoryRecord {
20 26
      */
21 27
     @Column(name = "case_appli_id")
22 28
     private Long caseAppliId;
29
+    /**
30
+     * 短信模板表主键id
31
+     */
32
+    @Column(name = "ms_sms_template_id")
33
+    private Long msSmsTemplateId;
23 34
 
24 35
     /**
25 36
      * 案件编号
@@ -44,11 +55,6 @@ public class MsSmsSendHistoryRecord {
44 55
     @Column(name = "send_status")
45 56
     private Long sendStatus;
46 57
 
47
-    /**
48
-     * 发送内容
49
-     */
50
-    @Column(name = "send_content")
51
-    private String sendContent;
52 58
 
53 59
     /**
54 60
      * 创建时间

+ 28
- 0
ruoyi-system/src/main/java/com/ruoyi/system/domain/entity/sms/MsSmsSendHistoryRecordParam.java Ver fichero

@@ -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 Ver fichero

@@ -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 Ver fichero

@@ -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 Ver fichero

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

+ 22
- 0
ruoyi-system/src/main/java/com/ruoyi/system/mapper/sms/MsSmsSendHistoryRecordParamMapper.java Ver fichero

@@ -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 Ver fichero

@@ -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 Ver fichero

@@ -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 Ver fichero

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

+ 7
- 0
ruoyi-system/src/main/java/com/ruoyi/system/service/ISysMenuService.java Ver fichero

@@ -1,5 +1,6 @@
1 1
 package com.ruoyi.system.service;
2 2
 
3
+import com.ruoyi.common.core.domain.AjaxResult;
3 4
 import com.ruoyi.common.core.domain.TreeSelect;
4 5
 import com.ruoyi.common.core.domain.entity.SysMenu;
5 6
 import com.ruoyi.system.domain.vo.RouterVo;
@@ -149,4 +150,10 @@ public interface ISysMenuService
149 150
      */
150 151
 
151 152
     Set<String> selectAdminMenu();
153
+
154
+    /**
155
+     * 根据用户查询菜单权限字符
156
+     * @return
157
+     */
158
+    AjaxResult getMenuPermsByUser();
152 159
 }

+ 9
- 0
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDeptServiceImpl.java Ver fichero

@@ -1,5 +1,6 @@
1 1
 package com.ruoyi.system.service.impl;
2 2
 
3
+import cn.hutool.core.collection.CollectionUtil;
3 4
 import com.ruoyi.common.annotation.DataScope;
4 5
 import com.ruoyi.common.constant.CacheConstants;
5 6
 import com.ruoyi.common.constant.UserConstants;
@@ -16,6 +17,7 @@ import com.ruoyi.common.utils.spring.SpringUtils;
16 17
 import com.ruoyi.system.mapper.SysDeptMapper;
17 18
 import com.ruoyi.system.mapper.SysRoleMapper;
18 19
 import com.ruoyi.system.service.ISysDeptService;
20
+import com.ruoyi.wisdomarbitrate.mapper.mscase.MsCaseApplicationMapper;
19 21
 import org.springframework.beans.factory.annotation.Autowired;
20 22
 import org.springframework.stereotype.Service;
21 23
 
@@ -39,6 +41,8 @@ public class SysDeptServiceImpl implements ISysDeptService
39 41
     private SysRoleMapper roleMapper;
40 42
     @Autowired
41 43
     private RedisCache redisCache;
44
+    @Autowired
45
+    MsCaseApplicationMapper caseApplicationMapper;
42 46
 
43 47
     /**
44 48
      * 查询部门管理数据
@@ -302,6 +306,11 @@ public class SysDeptServiceImpl implements ISysDeptService
302 306
     @Override
303 307
     public int deleteDeptById(Long deptId)
304 308
     {
309
+        // 查询部门是否与案件有关
310
+       List<Long> caseList = caseApplicationMapper.selectCaseByDeptId(deptId);
311
+       if(CollectionUtil.isNotEmpty(caseList)){
312
+           throw new ServiceException("该部门有关联案件,不允许删除");
313
+       }
305 314
         SysDept sysDept = deptMapper.selectDeptById(deptId);
306 315
         if(sysDept!=null) {
307 316
             // 删除缓存

+ 9
- 0
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysMenuServiceImpl.java Ver fichero

@@ -3,6 +3,7 @@ package com.ruoyi.system.service.impl;
3 3
 import cn.hutool.core.collection.CollectionUtil;
4 4
 import com.ruoyi.common.constant.Constants;
5 5
 import com.ruoyi.common.constant.UserConstants;
6
+import com.ruoyi.common.core.domain.AjaxResult;
6 7
 import com.ruoyi.common.core.domain.TreeSelect;
7 8
 import com.ruoyi.common.core.domain.entity.SysMenu;
8 9
 import com.ruoyi.common.core.domain.entity.SysRole;
@@ -139,6 +140,14 @@ public class SysMenuServiceImpl implements ISysMenuService
139 140
         return permsSet;
140 141
     }
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
+    }
150
+
142 151
     /**
143 152
      * 根据用户ID查询菜单
144 153
      * 

+ 21
- 2
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserServiceImpl.java Ver fichero

@@ -21,6 +21,7 @@ import com.ruoyi.system.domain.SysUserRole;
21 21
 import com.ruoyi.system.mapper.*;
22 22
 import com.ruoyi.system.service.ISysConfigService;
23 23
 import com.ruoyi.system.service.ISysUserService;
24
+import com.ruoyi.wisdomarbitrate.mapper.mscase.MsCaseApplicationMapper;
24 25
 import org.slf4j.Logger;
25 26
 import org.slf4j.LoggerFactory;
26 27
 import org.springframework.beans.factory.annotation.Autowired;
@@ -30,6 +31,7 @@ import org.springframework.util.CollectionUtils;
30 31
 
31 32
 import javax.validation.Validator;
32 33
 import java.util.ArrayList;
34
+import java.util.Arrays;
33 35
 import java.util.List;
34 36
 import java.util.stream.Collectors;
35 37
 
@@ -70,6 +72,8 @@ public class SysUserServiceImpl implements ISysUserService {
70 72
     protected Validator validator;
71 73
     @Autowired
72 74
     private RedisCache redisCache;
75
+    @Autowired
76
+    MsCaseApplicationMapper msCaseApplicationMapper;
73 77
 
74 78
     /**
75 79
      * 根据条件分页查询用户列表
@@ -460,9 +464,16 @@ public class SysUserServiceImpl implements ISysUserService {
460 464
     @Transactional
461 465
     public int deleteUserById(Long userId) {
462 466
         // 删除用户与角色关联
463
-        userRoleMapper.deleteUserRoleByUserId(userId);
467
+       // userRoleMapper.deleteUserRoleByUserId(userId);
464 468
         // 删除用户与岗位表
465
-        userPostMapper.deleteUserPostByUserId(userId);
469
+       // userPostMapper.deleteUserPostByUserId(userId);
470
+        // 与案件有关的人员不能删除
471
+        List<Long> userIds = new ArrayList<>();
472
+        userIds.add(userId);
473
+        List<Long> caseIds= msCaseApplicationMapper.countCasePerson(userIds);
474
+        if(CollectionUtil.isNotEmpty(caseIds)){
475
+            throw new ServiceException("该人员已参与案件,不能删除");
476
+        }
466 477
         int i = userMapper.deleteUserById(userId);
467 478
         // 删除缓存
468 479
         redisCache.deleteObject(CacheConstants.USER_KEY+userId);
@@ -478,6 +489,14 @@ public class SysUserServiceImpl implements ISysUserService {
478 489
     @Override
479 490
     @Transactional
480 491
     public int deleteUserByIds(Long[] userIds) {
492
+        // 校验是否与案件关联
493
+        if(userIds==null || userIds.length==0){
494
+            throw new ServiceException("请选择删除的用户");
495
+        }
496
+        List<Long> caseIds= msCaseApplicationMapper.countCasePerson(new ArrayList<>(Arrays.asList(userIds)));
497
+        if(CollectionUtil.isNotEmpty(caseIds)){
498
+            throw new ServiceException("删除人员中存在与案件关联的人员,不能删除");
499
+        }
481 500
         for (Long userId : userIds) {
482 501
             checkUserAllowed(new SysUser(userId));
483 502
             checkUserDataScope(userId);

+ 12
- 0
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/dto/miniprogress/IdentityAuthentication.java Ver fichero

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

+ 19
- 4
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/dto/sendrecord/SmsSendRecord.java Ver fichero

@@ -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,10 +39,6 @@ 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
      * 发送状态
@@ -50,6 +52,19 @@ public class SmsSendRecord extends BaseEntity {
50 52
      * 失败原因
51 53
      */
52 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;
53 68
 
54 69
     public SmsSendRecord(Long caseId, String caseNum, String phone, Date sendTime, String sendContent,String sid) {
55 70
         this.caseId = caseId;

+ 15
- 0
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/entity/mscase/MsCaseAffiliate.java Ver fichero

@@ -43,6 +43,11 @@ public class MsCaseAffiliate{
43 43
      */
44 44
     @Transient
45 45
     private String code;
46
+    /**
47
+     * 用户名
48
+     */
49
+    @Transient
50
+    private String userName;
46 51
 
47 52
     /**
48 53
      * 法定代表人
@@ -64,6 +69,11 @@ public class MsCaseAffiliate{
64 69
      */
65 70
     @Column(name = "operator_flag")
66 71
     private Integer operatorFlag=1;
72
+    /**
73
+     * 是否机构申请,0-自然人,1-申请机构,默认0
74
+     */
75
+    @Column(name = "organize_flag")
76
+    private Integer organizeFlag=0;
67 77
     /**
68 78
      * 电话
69 79
      */
@@ -131,5 +141,10 @@ public class MsCaseAffiliate{
131 141
      */
132 142
     @Transient
133 143
     private String applicantOrgName;
144
+    /**
145
+     * 角色id
146
+     */
147
+    @Transient
148
+    private Long roleId;
134 149
 
135 150
 }

+ 3
- 5
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/entity/mscase/MsCaseApplication.java Ver fichero

@@ -205,11 +205,7 @@ public class MsCaseApplication {
205 205
      */
206 206
     @Column(name = "is_reconci")
207 207
     private Integer isReconci;
208
-    /**
209
-     * 是否机构申请,0-自然人,1-申请机构,默认0
210
-     */
211
-    @Column(name = "organize_flag")
212
-    private Integer organizeFlag;
208
+
213 209
     /**
214 210
      * 案件来源,YC-乙巢,空字符串-北明
215 211
      */
@@ -225,5 +221,7 @@ public class MsCaseApplication {
225 221
      */
226 222
     @Transient
227 223
     private String rejectReason;
224
+    @Transient
225
+    private Integer organizeFlag=0;
228 226
 
229 227
 }

+ 6
- 1
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/vo/shortmessage/ReSendMessageVO.java Ver fichero

@@ -1,5 +1,6 @@
1 1
 package com.ruoyi.wisdomarbitrate.domain.vo.shortmessage;
2 2
 
3
+import com.ruoyi.system.domain.entity.sms.MsSmsTemplateParam;
3 4
 import lombok.AllArgsConstructor;
4 5
 import lombok.Builder;
5 6
 import lombok.Data;
@@ -20,9 +21,13 @@ public class ReSendMessageVO {
20 21
      * 手机号
21 22
      */
22 23
     private String phone;
24
+    /**
25
+     * 短信id
26
+     */
27
+    private Long id;
23 28
     /**
24 29
      * 短信模版参数值
25 30
      */
26
-    private List<String> paramValues;
31
+    private List<MsSmsTemplateParam> templateParams;
27 32
 
28 33
 }

+ 14
- 0
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/mscase/MsCaseApplicationMapper.java Ver fichero

@@ -52,4 +52,18 @@ public interface MsCaseApplicationMapper extends Mapper<MsCaseApplication> {
52 52
     Long selectMaxRoomId();
53 53
 
54 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
+
63
+    /**
64
+     * 查询部门是否与案件有关
65
+     * @param deptId
66
+     * @return
67
+     */
68
+    List<Long> selectCaseByDeptId(@Param("deptId") Long deptId);
55 69
 }

+ 2
- 6
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/sendrecord/SmsRecordMapper.java Ver fichero

@@ -22,14 +22,10 @@ public interface SmsRecordMapper {
22 22
     SmsSendRecord selectBySId(@Param("sid") String sid);
23 23
     void updateStatus (SmsSendRecord smsSendRecord);
24 24
 
25
-    /**
26
-     * 更新短信发送内容
27
-     * @param smsSendRecord
28
-     * @return
29
-     */
30
-    int updateSendContent(SmsSendRecord smsSendRecord);
31 25
     /**
32 26
      * 通过id查询短信发送记录
33 27
      */
34 28
     SmsSendRecord selectById(@Param("id") Long id);
29
+
30
+    void update(SmsSendRecord smsSendRecord);
35 31
 }

+ 8
- 0
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/miniprogress/WeChatUserService.java Ver fichero

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

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

@@ -9,8 +9,8 @@ import com.ruoyi.common.core.domain.entity.SysRole;
9 9
 import com.ruoyi.common.core.domain.entity.SysUser;
10 10
 import com.ruoyi.common.core.redis.RedisCache;
11 11
 import com.ruoyi.common.enums.SMSStatusEnum;
12
+import com.ruoyi.common.utils.EmailOutUtil;
12 13
 import com.ruoyi.common.utils.SecurityUtils;
13
-import com.ruoyi.common.utils.SmsUtils;
14 14
 import com.ruoyi.common.utils.StringUtils;
15 15
 import com.ruoyi.common.utils.spring.SpringUtils;
16 16
 import com.ruoyi.system.mapper.SysRoleMapper;
@@ -20,6 +20,7 @@ import com.ruoyi.wisdomarbitrate.domain.dto.miniprogress.IdentityAuthentication;
20 20
 import com.ruoyi.wisdomarbitrate.domain.vo.miniprogress.WeChatUserVO;
21 21
 import com.ruoyi.wisdomarbitrate.mapper.miniprogress.IdentityAuthenticationMapper;
22 22
 import com.ruoyi.wisdomarbitrate.service.miniprogress.WeChatUserService;
23
+import com.ruoyi.wisdomarbitrate.utils.SmsUtils;
23 24
 import lombok.extern.slf4j.Slf4j;
24 25
 import org.springframework.beans.factory.annotation.Autowired;
25 26
 import org.springframework.stereotype.Service;
@@ -47,6 +48,8 @@ public class WeChatUserServiceImpl implements WeChatUserService {
47 48
     private IdentityAuthenticationMapper identityAuthenticationMapper;
48 49
     @Autowired
49 50
     private RedisCache redisCache;
51
+    @Autowired
52
+    private EmailOutUtil emailOutUtil;
50 53
 
51 54
     @Override
52 55
     public AjaxResult sendCode(WeChatUserVO userVO) {
@@ -64,12 +67,31 @@ public class WeChatUserServiceImpl implements WeChatUserService {
64 67
         request.setTemplateParamSet(new String[]{ code});
65 68
         JSONObject resultObj = SmsUtils.sendSms(request);
66 69
         if(resultObj.get("status")!=null && !resultObj.get("status").equals(SMSStatusEnum.FAIL.getCode())){
67
-            setCodeCache(userVO.getPhone(),code);
70
+            setCodeCache(CacheConstants.WE_CHAT_SMS_VERIFY_CODE_KEY + userVO.getPhone(),code);
68 71
             return AjaxResult.success("短信发送成功");
69 72
         }else {
70 73
             return AjaxResult.warn("短信发送失败");
71 74
         }
72 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
+    }
73 95
     /**
74 96
      * 设置验证码缓存
75 97
      *
@@ -78,7 +100,7 @@ public class WeChatUserServiceImpl implements WeChatUserService {
78 100
      */
79 101
     public static void setCodeCache(String key, String code)
80 102
     {
81
-        SpringUtils.getBean(RedisCache.class).setCacheObject(getVerifyCodeCacheKey(key), code, 5,TimeUnit.MINUTES);
103
+        SpringUtils.getBean(RedisCache.class).setCacheObject( key, code, 5,TimeUnit.MINUTES);
82 104
     }
83 105
 
84 106
 
@@ -90,7 +112,7 @@ public class WeChatUserServiceImpl implements WeChatUserService {
90 112
      */
91 113
     public static String getCodeCache(String key)
92 114
     {
93
-        String codeCache = SpringUtils.getBean(RedisCache.class).getCacheObject(getVerifyCodeCacheKey(key));
115
+        String codeCache = SpringUtils.getBean(RedisCache.class).getCacheObject( key);
94 116
         if (StringUtils.isNotNull(codeCache))
95 117
         {
96 118
             return codeCache;
@@ -98,19 +120,23 @@ public class WeChatUserServiceImpl implements WeChatUserService {
98 120
         return null;
99 121
     }
100 122
 
101
-    private static String getVerifyCodeCacheKey(String key) {
102
-        return CacheConstants.WE_CHAT_SMS_VERIFY_CODE_KEY + key;
103
-    }
104 123
     @Transactional
105 124
     @Override
106 125
     public AjaxResult registerUser(IdentityAuthentication ientityAuthentication) {
107
-        String codeCache = getCodeCache(ientityAuthentication.getPhone());
126
+        String codeCache = getCodeCache(CacheConstants.WE_CHAT_SMS_VERIFY_CODE_KEY + ientityAuthentication.getPhone());
108 127
         // 校验短信验证码
109 128
         if(StrUtil.isEmpty(codeCache)){
110 129
             return AjaxResult.warn("验证码校验失败");
111 130
         }else if(!codeCache.equals(ientityAuthentication.getVerifyCode())){
112 131
             return AjaxResult.warn("验证码校验失败");
113 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
+        }
114 140
         // 根据用户名或者邮箱或者手机号查询系统用户表中是否存在该用户
115 141
         SysUser sysUserName=sysUserMapper.checkUserNameUnique(ientityAuthentication.getUserName());
116 142
         if(sysUserName!=null){
@@ -183,4 +209,6 @@ public class WeChatUserServiceImpl implements WeChatUserService {
183 209
         return AjaxResult.success("注册成功");
184 210
     }
185 211
 
212
+
213
+
186 214
 }

+ 11
- 29
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/mscase/MsCaseApplicationService.java Ver fichero

@@ -4,13 +4,11 @@ import com.alibaba.fastjson.JSONArray;
4 4
 import com.alibaba.fastjson.JSONObject;
5 5
 import com.ruoyi.common.core.domain.AjaxResult;
6 6
 import com.ruoyi.common.core.domain.entity.SMSNotice;
7
-import com.ruoyi.common.core.domain.entity.SMSNoticeDO;
8 7
 import com.ruoyi.common.core.domain.entity.SysDictData;
9 8
 import com.ruoyi.common.core.domain.entity.SysUser;
10 9
 import com.ruoyi.common.enums.PushCaseStatusEnum;
11 10
 import com.ruoyi.common.exception.EsignDemoException;
12 11
 import com.ruoyi.system.domain.entity.flow.MsCaseFlow;
13
-import com.ruoyi.wisdomarbitrate.domain.dto.sendrecord.SmsSendRecord;
14 12
 import com.ruoyi.wisdomarbitrate.domain.entity.mscase.MsCaseAffiliate;
15 13
 import com.ruoyi.wisdomarbitrate.domain.entity.mscase.MsCaseApplication;
16 14
 import com.ruoyi.wisdomarbitrate.domain.entity.mscase.MsCaseAttach;
@@ -81,11 +79,7 @@ public interface MsCaseApplicationService {
81 79
      */
82 80
     AjaxResult batchInsert(MsCaseBatchInsertVO vo);
83 81
 
84
-    /**
85
-     * 新增申请机构代理人
86
-     * @param affiliate
87
-     */
88
-    void insertAgentUser(MsCaseAffiliate affiliate);
82
+
89 83
 
90 84
     /**
91 85
      * 修改案件
@@ -115,6 +109,12 @@ public interface MsCaseApplicationService {
115 109
      * @return
116 110
      */
117 111
     AjaxResult generateApplication(MsCaseApplicationReq req);
112
+    /**
113
+     * 生成调解申请书
114
+     * @param req
115
+     * @return
116
+     */
117
+    AjaxResult generateApplication1(MsCaseApplicationReq req);
118 118
 
119 119
     /**
120 120
      * 根据批次号和流程id查找未锁定的案件
@@ -233,6 +233,7 @@ public interface MsCaseApplicationService {
233 233
      * @param dictDataList 内置字段
234 234
      */
235 235
      void createMediateApplication(MsCaseApplication application, List<MsCaseAffiliate> affiliates, String templatePath, List<String> bookmarkList, List<SysDictData> dictDataList, Integer templateType) ;
236
+     void createMediateApplication1(MsCaseApplication application, List<MsCaseAffiliate> affiliates, String templatePath, List<String> bookmarkList, List<SysDictData> dictDataList, Integer templateType) ;
236 237
     /**
237 238
      * 调解书上传到onlyoffice服务器
238 239
      * @param annexPath
@@ -275,12 +276,7 @@ public interface MsCaseApplicationService {
275 276
      * 根据登录人返回用户信息
276 277
      */
277 278
     SysUser getUserInfo();
278
-    /**
279
-     * 查询短信发送记录
280
-     * @param smsSendRecord
281
-     * @return
282
-     */
283
-    List<SmsSendRecord> getSmsSendRecord(SmsSendRecord smsSendRecord);
279
+
284 280
     /**
285 281
      * 保存onlyOffice在线编辑的文件
286 282
      * @param
@@ -288,14 +284,7 @@ public interface MsCaseApplicationService {
288 284
      */
289 285
 
290 286
     AjaxResult saveOnlyOfficeFile(MsCaseAttach caseAttach);
291
-    /**
292
-     * 发送短信
293
-     * @param smsFlag 短信是否发送成功
294
-     * @param application 案件基本信息
295
-     * @param affiliate 案件人员
296
-     * @param sendContent 发送内容
297
-     */
298
-    public void sendSMS(cn.hutool.json.JSONObject jsonObject ,MsCaseApplication application, MsCaseAffiliate affiliate, String sendContent);
287
+
299 288
     /**
300 289
      * 发送邮件
301 290
      * @param application 案件基本信息
@@ -310,14 +299,7 @@ public interface MsCaseApplicationService {
310 299
      * @param affiliates
311 300
      */
312 301
     public void sendHearDateSms(MsCaseApplication application, List<MsCaseAffiliate> affiliates);
313
-    /**
314
-     * 发送短信
315
-     * @param application
316
-     * @param affiliate
317
-     * @param notice
318
-     */
319
-    public void sendNotice(MsCaseApplication application, MsCaseAffiliate affiliate,
320
-                           SMSNoticeDO notice);
302
+
321 303
     /**
322 304
      * 申请操作人/被申操作人发送通知
323 305
      * @param application

+ 1
- 6
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/mscase/MsCasePaymentService.java Ver fichero

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

+ 535
- 493
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/mscase/impl/MsCaseApplicationServiceImpl.java
La diferencia del archivo ha sido suprimido porque es demasiado grande
Ver fichero


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

@@ -11,7 +11,6 @@ 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;
15 14
 import com.ruoyi.common.enums.YesOrNoEnum;
16 15
 import com.ruoyi.common.exception.ServiceException;
17 16
 import com.ruoyi.common.utils.SecurityUtils;
@@ -20,9 +19,10 @@ import com.ruoyi.dto.PayRequest;
20 19
 import com.ruoyi.dto.PayResponse;
21 20
 import com.ruoyi.system.domain.entity.flow.MsCaseFlow;
22 21
 import com.ruoyi.system.mapper.flow.MsCaseFlowMapper;
22
+import com.ruoyi.system.mapper.sms.MsSmsSendRecordParamMapper;
23
+import com.ruoyi.system.mapper.sms.MsSmsTemplateMapper;
23 24
 import com.ruoyi.wisdomarbitrate.domain.dto.mscase.CaseConfirmPayDTO;
24 25
 import com.ruoyi.wisdomarbitrate.domain.dto.mscase.CasePayDTO;
25
-import com.ruoyi.wisdomarbitrate.domain.dto.sendrecord.SmsSendRecord;
26 26
 import com.ruoyi.wisdomarbitrate.domain.entity.mscase.*;
27 27
 import com.ruoyi.wisdomarbitrate.domain.vo.mscase.PaymentDetailVO;
28 28
 import com.ruoyi.wisdomarbitrate.mapper.mscase.*;
@@ -30,6 +30,7 @@ import com.ruoyi.wisdomarbitrate.mapper.sendrecord.SmsRecordMapper;
30 30
 import com.ruoyi.wisdomarbitrate.service.mscase.MsCaseApplicationService;
31 31
 import com.ruoyi.wisdomarbitrate.service.mscase.MsCasePaymentService;
32 32
 import com.ruoyi.wisdomarbitrate.utils.CaseLogUtils;
33
+import com.ruoyi.wisdomarbitrate.utils.SmsUtils;
33 34
 import org.springframework.beans.factory.annotation.Autowired;
34 35
 import org.springframework.stereotype.Service;
35 36
 import org.springframework.transaction.annotation.Transactional;
@@ -67,6 +68,10 @@ public class MsCasePaymentServiceImpl implements MsCasePaymentService {
67 68
     private RedisCache redisCache;
68 69
     @Autowired
69 70
     private MsCaseAuditMapper auditMapper;
71
+    @Autowired
72
+    MsSmsTemplateMapper templateMapper;
73
+    @Autowired
74
+    MsSmsSendRecordParamMapper recordParamMapper;
70 75
 
71 76
 
72 77
     @Override
@@ -228,7 +233,6 @@ public class MsCasePaymentServiceImpl implements MsCasePaymentService {
228 233
         }
229 234
         JSONObject jsonObject = new JSONObject();
230 235
         jsonObject.set("totalFee", totalFee);
231
-     //   jsonObject.set("applicationOrganName", affiliate.getApplicationName());
232 236
         return AjaxResult.success(jsonObject);
233 237
     }
234 238
 
@@ -342,7 +346,6 @@ public class MsCasePaymentServiceImpl implements MsCasePaymentService {
342 346
         caseApplicationMapper.updateByPrimaryKeySelective(application);
343 347
         if (dto.getApplicantConfirm() && dto.getYesOrNo().equals(YesOrNoEnum.YES.getCode())) {
344 348
             // 申请人确认缴费后将该案件存放到redis,5日之内如果案件状态还是待受理状态,则发送不受理通知书并自动结束
345
-//            redisCache.setCacheObject(CacheConstants.CASE_KEY+application.getId(), application, Constants.CASE_ACCEPT_EXPIRATION, TimeUnit.DAYS);
346 349
             SpringUtils.getBean(RedisCache.class).setCacheObject(getVerifyCodeCacheKey(String.valueOf(application.getId())), application, Constants.CASE_ACCEPT_EXPIRATION, TimeUnit.DAYS);
347 350
 
348 351
         }
@@ -377,68 +380,50 @@ public class MsCasePaymentServiceImpl implements MsCasePaymentService {
377 380
             throw new ServiceException("未找到案件操作人员");
378 381
         }
379 382
         if(dto.getApplicantConfirm()) {
383
+            List<String> appPhones=new ArrayList<>();
384
+
380 385
             // 申请人确认缴费
381 386
             for (MsCaseAffiliate affiliate : operatorList) {
382 387
                 // 发送缴费通知
383 388
                 if (affiliate.getRoleType() == null) {
384 389
                     continue;
385 390
                 }
386
-                if (affiliate.getRoleType().equals(1) || affiliate.getRoleType().equals(2)) {
387
-                    JSONObject jsonObject = new JSONObject();
388
-                    SmsSendRecord smsSendRecord = null;
391
+                if (!appPhones.contains(affiliate.getPhone())&&(affiliate.getRoleType().equals(1) || affiliate.getRoleType().equals(2))) {
392
+                    appPhones.add(affiliate.getPhone());
389 393
                     if (dto.getYesOrNo().equals(YesOrNoEnum.YES.getCode())) {
394
+
390 395
                         // 缴费通过
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);
396
+                        SmsUtils.sendSms(caseAppllication, "2051914", affiliate.getPhone(), new String[]{affiliate.getName()});
394 397
                     } else {
395
-                        // todo 短信
396
-//                        jsonObject = SmsUtils.sendSms(affiliate.getCaseAppliId(), "2074402", affiliate.getPhone(), new String[]{affiliate.getName(), caseAppllication.getCaseNum(), dto.getReason()});
397 398
                         // 2074402	调解系统确认缴费不通过通知   尊敬的{1}用户,您的{2}案件,确认缴费未通过,理由为{3},请知晓,如非本人操作,请忽略本短信
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);
399
+                         SmsUtils.sendSms(caseAppllication, "2074402", affiliate.getPhone(), new String[]{affiliate.getName(), caseAppllication.getCaseNum(), dto.getReason()});
399 400
                     }
400
-                    // 新增短信记录
401
-                    if (jsonObject.get("ststus")!=null && !jsonObject.get("ststus").equals(SMSStatusEnum.FAIL)) {
402
-                        smsSendRecord.setSendStatus(SMSStatusEnum.SENDING.getCode());
403
-                    } else {
404
-                        smsSendRecord.setSendStatus(SMSStatusEnum.FAIL.getCode());
405
-                    }
406
-                    smsRecordMapper.saveSmsSendRecord(smsSendRecord);
407 401
                 }
408 402
             }
409 403
         }else {
404
+            List<String> resPhones=new ArrayList<>();
405
+            List<String> resAcceptPhones=new ArrayList<>();
410 406
             // 被申请人确认缴费
411 407
             for (MsCaseAffiliate affiliate : operatorList) {
412 408
                 // 发送缴费通知
413 409
                 if (affiliate.getRoleType() == null) {
414 410
                     continue;
415 411
                 }
416
-                if (affiliate.getRoleType().equals(3) || affiliate.getRoleType().equals(4)) {
417
-                    JSONObject jsonObject = new JSONObject();
418
-                    SmsSendRecord smsSendRecord = null;
412
+                if (!resPhones.contains(affiliate.getPhone())&&(affiliate.getRoleType().equals(3) || affiliate.getRoleType().equals(4)) ) {
413
+                    resPhones.add(affiliate.getPhone());
419 414
                     if (dto.getYesOrNo().equals(YesOrNoEnum.YES.getCode())) {
420
-                        // todo 短信
421 415
                         // 缴费通过
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);
416
+                        SmsUtils.sendSms(caseAppllication, "2051914", affiliate.getPhone(), new String[]{affiliate.getName()});
424 417
                     } else {
425
-                        // todo 短信
426
-//                        jsonObject = SmsUtils.sendSms(affiliate.getCaseAppliId(), "2074402", affiliate.getPhone(), new String[]{affiliate.getName(), caseAppllication.getCaseNum(), dto.getReason()});
427 418
                         // 2074402	调解系统确认缴费不通过通知   尊敬的{1}用户,您的{2}案件,确认缴费未通过,理由为{3},请知晓,如非本人操作,请忽略本短信
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);
429
-                    }
430
-                    // 新增短信记录
431
-                    if (jsonObject.get("status")!=null && !jsonObject.get("status").equals(SMSStatusEnum.FAIL)) {
432
-                        smsSendRecord.setSendStatus(SMSStatusEnum.SENDING.getCode());
433
-                    } else {
434
-                        smsSendRecord.setSendStatus(SMSStatusEnum.FAIL.getCode());
419
+                        SmsUtils.sendSms(caseAppllication, "2074402", affiliate.getPhone(), new String[]{affiliate.getName(), caseAppllication.getCaseNum(), dto.getReason()});
435 420
                     }
436
-                    smsRecordMapper.saveSmsSendRecord(smsSendRecord);
437 421
                 }
438 422
                 // 被申请人确认缴费,发送受理通知
439
-                if( dto.getYesOrNo().equals(YesOrNoEnum.YES.getCode())) {
440
-                    // 申请人发送受理短信
441
-                    casePaymentService.sendAcceptSms(dto, caseAppllication, affiliate.getName(), affiliate.getPhone());
423
+                if( dto.getYesOrNo().equals(YesOrNoEnum.YES.getCode()) && !resAcceptPhones.contains(affiliate.getPhone())) {
424
+                    resAcceptPhones.add(affiliate.getPhone());
425
+                    // 申请人被申请人发送受理通知书 2073601    尊敬的{1}用户,您的{2}案件,已成功受理,请知晓,如非本人操作,请忽略本短信。
426
+                    SmsUtils.sendSms(caseAppllication, "2073601", affiliate.getPhone(), new String[]{affiliate.getName(), caseAppllication.getCaseNum()});
442 427
 
443 428
                 }
444 429
             }
@@ -465,28 +450,7 @@ public class MsCasePaymentServiceImpl implements MsCasePaymentService {
465 450
 
466 451
 
467 452
 
468
-    /**
469
-     * 发送受理短信
470
-     * @param dto
471
-     * @param caseAppllication
472
-     */
473
-    @Transactional
474
-    public void sendAcceptSms(CaseConfirmPayDTO dto, MsCaseApplication caseAppllication,String userName,String phone ) {
475
-            // 申请人被申请人发送受理通知书 2073601    尊敬的{1}用户,您的{2}案件,已成功受理,请知晓,如非本人操作,请忽略本短信。
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);
481
-            // 新增短信记录
482
-            if (jsonObject.get("status")!=null && !jsonObject.get("status").equals(SMSStatusEnum.FAIL)) {
483
-                smsSendRecord.setSendStatus(SMSStatusEnum.SENDING.getCode());
484
-            } else {
485
-                smsSendRecord.setSendStatus(SMSStatusEnum.FAIL.getCode());
486
-            }
487
-            smsRecordMapper.saveSmsSendRecord(smsSendRecord);
488 453
 
489
-    }
490 454
 
491 455
     /**
492 456
      * 确认缴费
@@ -500,8 +464,6 @@ public class MsCasePaymentServiceImpl implements MsCasePaymentService {
500 464
         application.setPayType(dto.getPayType());
501 465
         // 修改缴费附件
502 466
         if (CollectionUtil.isNotEmpty(dto.getPayOrderList())) {
503
-
504
-
505 467
             for (MsCaseAttach caseAttach : dto.getPayOrderList()) {
506 468
                 // 先删除之前的缴费
507 469
                 if(currentFlow.getButtonAuthFlag().equals("caseManagement:list:pay")){

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

@@ -23,10 +23,11 @@ import com.ruoyi.common.utils.SecurityUtils;
23 23
 import com.ruoyi.common.utils.StringUtils;
24 24
 import com.ruoyi.common.utils.file.SaaSAPIFileUtils;
25 25
 import com.ruoyi.system.domain.entity.flow.MsCaseFlow;
26
+import com.ruoyi.system.domain.entity.shortmessage.MsSendMailHistoryRecord;
26 27
 import com.ruoyi.system.domain.vo.flow.MsCaseFlowVO;
27
-import com.ruoyi.system.mapper.SysRoleMapper;
28 28
 import com.ruoyi.system.mapper.SysUserMapper;
29 29
 import com.ruoyi.system.mapper.flow.MsCaseFlowMapper;
30
+import com.ruoyi.system.mapper.shortmessage.MsSendMailHistoryRecordMapper;
30 31
 import com.ruoyi.system.service.impl.BeiMingInterfaceService;
31 32
 import com.ruoyi.wisdomarbitrate.domain.dto.dept.DeptIdentify;
32 33
 import com.ruoyi.wisdomarbitrate.domain.dto.dept.SealManage;
@@ -54,6 +55,7 @@ import com.ruoyi.wisdomarbitrate.service.mscase.MsCaseApplicationService;
54 55
 import com.ruoyi.wisdomarbitrate.service.mscase.MsSignSealService;
55 56
 import com.ruoyi.wisdomarbitrate.utils.CaseLogUtils;
56 57
 import com.ruoyi.wisdomarbitrate.utils.SignAward;
58
+import org.springframework.beans.BeanUtils;
57 59
 import org.springframework.beans.factory.annotation.Autowired;
58 60
 import org.springframework.beans.factory.annotation.Value;
59 61
 import org.springframework.stereotype.Service;
@@ -108,8 +110,8 @@ public class MsSignSealServiceImpl implements MsSignSealService {
108 110
 
109 111
     @Autowired
110 112
     private SendMailRecordMapper sendMailRecordMapper;
111
-    @Autowired
112
-    private SysRoleMapper roleMapper;
113
+    @Value("${spring.mail.username}")
114
+    private String emailFrom;
113 115
     // 北明配置
114 116
     @Value("${BMConfig.userName}")
115 117
     private String BMUserName;
@@ -119,6 +121,8 @@ public class MsSignSealServiceImpl implements MsSignSealService {
119 121
     private String BMSyncSource;
120 122
     @Autowired
121 123
     BeiMingInterfaceService beiMingInterfaceService;
124
+    @Autowired
125
+    private MsSendMailHistoryRecordMapper sendMailHistoryRecordMapper;
122 126
 
123 127
 
124 128
 
@@ -346,7 +350,6 @@ public class MsSignSealServiceImpl implements MsSignSealService {
346 350
                             String annexPath = caseAttach.getAnnexPath();
347 351
                             String path = "/home/ruoyi/uploadPath/" + annexPath.substring(startIndex+1);
348 352
                             File file = new File(path);
349
-                            // todo 部署放开
350 353
                             if (!file.exists()) {
351 354
                                 Gson gson = new Gson();
352 355
                                 MsSealSignRecord sealSignRecord = new MsSealSignRecord();
@@ -433,30 +436,8 @@ public class MsSignSealServiceImpl implements MsSignSealService {
433 436
                     }
434 437
                     boolean appEmailFlag = sendCaseEmail(caseApplication1, affiliate.getEmail(), caseAttachList);
435 438
 
436
-                    SendMailRecord sendMailRecord = new SendMailRecord();
437
-                    sendMailRecord.setCaseId(id);
438
-                    sendMailRecord.setMailAddress(affiliate.getEmail());
439
-                    sendMailRecord.setMailContent("您好,审核后的调解书在附件中请查阅");
440
-                    sendMailRecord.setMailName("签署后的调解书");
441
-                    sendMailRecord.setSendTime(new Date());
442
-                    sendMailRecord.setCreateBy(SecurityUtils.getUsername());
443
-                    if (appEmailFlag) {
444
-                        sendMailRecord.setSendStatus(1);
445
-                    } else {
446
-                        sendMailRecord.setSendStatus(0);
447
-                    }
448
-                    sendMailRecordMapper.saveSendMailRecord(sendMailRecord);
449
-                }
450 439
 
451
-//                if(!appEmailFlag&&!resEmailFlag){
452
-//                    throw new ServiceException("调解书发送失败");
453
-//                }
454
-//                if(!appEmailFlag){
455
-//                    throw new ServiceException("申请人调解书发送失败");
456
-//                }
457
-//                if(!resEmailFlag){
458
-//                    throw new ServiceException("被申请人调解书发送失败");
459
-//                }
440
+                }
460 441
 
461 442
                 CaseLogUtils.insertCaseLog(caseApplication1.getId(), currentFlow.getNodeId(), currentFlow.getCaseStatusName(),"");
462 443
 
@@ -473,31 +454,14 @@ public class MsSignSealServiceImpl implements MsSignSealService {
473 454
     @Transactional
474 455
     public AjaxResult msCaseSign(MsSignSealDTO dto) {
475 456
         Long caseId = dto.getCaseId();
476
-        MsCaseAffiliate caseAffiliate = msCaseAffiliateMapper.selectByPrimaryKey(caseId);
457
+       //  MsCaseAffiliate caseAffiliate = msCaseAffiliateMapper.selectByPrimaryKey(caseId);
477 458
         MsCaseApplication caseApplicationselect = msCaseApplicationMapper.selectByPrimaryKey(caseId);
478 459
         // 查询当前节点
479 460
         MsCaseFlow currentFlow = caseFlowMapper.selectByPrimaryKey(caseApplicationselect.getCaseFlowId());
480 461
         if (currentFlow == null) {
481 462
             return AjaxResult.error("当前流程不存在");
482 463
         }
483
-//        if (dto.getIsSignApply() != null && dto.getIsSignApply().intValue() == 1) {
484
-//            caseAffiliate.setIsSignApply(1);
485
-//            msCaseAffiliateMapper.updateByPrimaryKeySelective(caseAffiliate);
486
-//            if (caseAffiliate.getIsSignRespon() != null && caseAffiliate.getIsSignRespon().intValue() == 1) {
487
-//                // 根据流程id查找下一个流程节点
488
-//                MsCaseFlow nextFlow = caseFlowMapper.nextFlow(caseApplicationselect.getCaseFlowId());
489
-//                caseApplicationselect.setCaseFlowId(nextFlow.getId());
490
-//                caseApplicationselect.setCaseStatusName(nextFlow.getCaseStatusName());
491
-//                caseApplicationMapper.updateByPrimaryKeySelective(caseApplicationselect);
492
-//                CaseLogUtils.insertCaseLog(caseApplicationselect.getId(), nextFlow.getNodeId(), nextFlow.getCaseStatusName(),"签收");
493
-//            }
494
-//        }
495
-        if (dto.getIsSignApply() != null && dto.getIsSignApply().intValue() == 1) {
496
-            // todo 签收不要该字段
497
-            //    caseAffiliate.setIsSignApply(1);
498
-            // todo 签收不要该字段
499
-            //   msCaseAffiliateMapper.updateByPrimaryKeySelective(caseAffiliate);
500
-
464
+        if (dto.getIsSignApply() != null && dto.getIsSignApply().equals(1) ) {
501 465
             // 根据流程id查找下一个流程节点
502 466
             MsCaseFlow nextFlow = caseFlowMapper.nextFlow(caseApplicationselect.getCaseFlowId());
503 467
             caseApplicationselect.setCaseFlowId(nextFlow.getId());
@@ -505,24 +469,8 @@ public class MsSignSealServiceImpl implements MsSignSealService {
505 469
             caseApplicationMapper.updateByPrimaryKeySelective(caseApplicationselect);
506 470
             CaseLogUtils.insertCaseLog(caseApplicationselect.getId(), currentFlow.getNodeId(), currentFlow.getCaseStatusName(),null);
507 471
         }
508
-//        if (dto.getIsSignRespon() != null && dto.getIsSignRespon().intValue() == 1) {
509
-//            caseAffiliate.setIsSignRespon(1);
510
-//            msCaseAffiliateMapper.updateByPrimaryKeySelective(caseAffiliate);
511
-//            if (caseAffiliate.getIsSignApply() != null && caseAffiliate.getIsSignApply().intValue() == 1) {
512
-//                // 根据流程id查找下一个流程节点
513
-//                MsCaseFlow nextFlow = caseFlowMapper.nextFlow(caseApplicationselect.getCaseFlowId());
514
-//                caseApplicationselect.setCaseFlowId(nextFlow.getId());
515
-//                caseApplicationselect.setCaseStatusName(nextFlow.getCaseStatusName());
516
-//                caseApplicationMapper.updateByPrimaryKeySelective(caseApplicationselect);
517
-//                CaseLogUtils.insertCaseLog(caseApplicationselect.getId(), nextFlow.getNodeId(), nextFlow.getCaseStatusName(),"签收");
518
-//            }
519
-//        }
520
-
521
-        if (dto.getIsSignRespon() != null && dto.getIsSignRespon().intValue() == 1) {
522
-            // todo 签收不要该字段
523
-//            caseAffiliate.setIsSignRespon(1);
524
-            // todo 签收不要该字段
525
-//            msCaseAffiliateMapper.updateByPrimaryKeySelective(caseAffiliate);
472
+
473
+        if (dto.getIsSignRespon() != null && dto.getIsSignRespon().equals(1)) {
526 474
 
527 475
             // 根据流程id查找下一个流程节点
528 476
             MsCaseFlow nextFlow = caseFlowMapper.nextFlow(caseApplicationselect.getCaseFlowId());
@@ -531,7 +479,7 @@ public class MsSignSealServiceImpl implements MsSignSealService {
531 479
             caseApplicationMapper.updateByPrimaryKeySelective(caseApplicationselect);
532 480
             CaseLogUtils.insertCaseLog(caseApplicationselect.getId(), currentFlow.getNodeId(), currentFlow.getCaseStatusName(),null);
533 481
             CaseLogUtils.insertCaseLog(caseApplicationselect.getId(), 17, "结束", null);
534
-            // todo 被申请人签收结束对接北明,为调解成功状态
482
+            //  被申请人签收结束对接北明,为调解成功状态
535 483
             if(StrUtil.isEmpty(caseApplicationselect.getCaseSource())) {
536 484
                 applicationService.pushStatusToBM(caseApplicationselect, PushCaseStatusEnum.SUCCESS);
537 485
             }
@@ -543,9 +491,7 @@ public class MsSignSealServiceImpl implements MsSignSealService {
543 491
 
544 492
     @Override
545 493
     public AjaxResult msCaseSignUrlApplyPC(MsSignSealDTO dto) throws EsignDemoException {
546
-        // todo
547 494
         Long caseId = dto.getCaseId();
548
-        //MsCaseAffiliate caseAffiliate = msCaseAffiliateMapper.selectByPrimaryKey(caseId);
549 495
         List<MsCaseAffiliate> affiliates = applicationService.selectAffliatesByCaseId(caseId);
550 496
         if(CollectionUtil.isEmpty(affiliates)){
551 497
             return AjaxResult.error("未找到案件相关人员");
@@ -612,7 +558,7 @@ public class MsSignSealServiceImpl implements MsSignSealService {
612 558
 
613 559
         }
614 560
         if(resOpt.get().getUserId()!=null && resOpt.get().getUserId().equals(userId)){
615
-
561
+            // 被申
616 562
             SealSignRecord sealSignRecordres = new SealSignRecord();
617 563
             MsSealSignRecord mssealSignRecord = new MsSealSignRecord();
618 564
             mssealSignRecord.setCaseAppliId(caseId);
@@ -636,6 +582,7 @@ public class MsSignSealServiceImpl implements MsSignSealService {
636 582
             }
637 583
         }
638 584
         if(mediatorCount>0){
585
+            // 调解员
639 586
             SealSignRecord sealSignRecordres = new SealSignRecord();
640 587
             MsSealSignRecord mssealSignRecord = new MsSealSignRecord();
641 588
             mssealSignRecord.setCaseAppliId(caseId);
@@ -710,7 +657,7 @@ public class MsSignSealServiceImpl implements MsSignSealService {
710 657
             Integer caseNode = currentFlow.getNodeId();
711 658
             String caseStatusName = currentFlow.getCaseStatusName();
712 659
             if("SIGN_MISSON_COMPLETE".equals(action) && signResult==2){
713
-                if(mediaResult.intValue()==1){
660
+                if(mediaResult.equals(1)){
714 661
                     //调解
715 662
                     if(StringUtils.isNotEmpty(accountMobile)&&accountMobile.equals(pensonAccountApply)){
716 663
                         //申请人签名
@@ -723,16 +670,16 @@ public class MsSignSealServiceImpl implements MsSignSealService {
723 670
                         operLog.setCaseNode(caseNode);
724 671
                         operLog.setCreateTime(dateOperate);
725 672
                         caseLogRecordMapper.insert(operLog);
726
-                        if(signStatusResponse!=null&&signStatusResponse.intValue()==1&&
727
-                                signStatusMediator!=null&&signStatusMediator.intValue()==1){
673
+                        if(signStatusResponse!=null&&signStatusResponse.equals(1)&&
674
+                                signStatusMediator!=null&&signStatusMediator.equals(1)){
728 675
                             // 根据流程id查找下一个流程节点
729 676
                             MsCaseFlow nextFlow=null;
730 677
                             if(caseApplicationselect.getSealFlag()!=null&&caseApplicationselect.getSealFlag()==1) {
731 678
                                 // 需要用印
732
-                                 nextFlow = caseFlowMapper.nextFlow(caseApplicationselect.getCaseFlowId().intValue());
679
+                                 nextFlow = caseFlowMapper.nextFlow(caseApplicationselect.getCaseFlowId());
733 680
                             }else {
734 681
                                 // 不需要用印
735
-                                nextFlow = caseFlowMapper.nextFlow1(caseApplicationselect.getCaseFlowId().intValue());
682
+                                nextFlow = caseFlowMapper.nextFlow1(caseApplicationselect.getCaseFlowId());
736 683
                             }
737 684
                             MsCaseApplication application = new MsCaseApplication();
738 685
                             application.setId(caseApplicationselect.getId());
@@ -764,17 +711,17 @@ public class MsSignSealServiceImpl implements MsSignSealService {
764 711
                         operLog.setCaseNode(caseNode);
765 712
                         operLog.setCreateTime(dateOperate);
766 713
                         caseLogRecordMapper.insert(operLog);
767
-                        if(signStatusApply!=null&&signStatusApply.intValue()==1&&
768
-                                signStatusMediator!=null&&signStatusMediator.intValue()==1){
714
+                        if(signStatusApply!=null&&signStatusApply.equals(1)&&
715
+                                signStatusMediator!=null&&signStatusMediator.equals(1)){
769 716
                             // 根据流程id查找下一个流程节点
770 717
                             // 根据流程id查找下一个流程节点
771 718
                             MsCaseFlow nextFlow=null;
772 719
                             if(caseApplicationselect.getSealFlag()!=null&&caseApplicationselect.getSealFlag()==1) {
773 720
                                 // 需要用印
774
-                                nextFlow = caseFlowMapper.nextFlow(caseApplicationselect.getCaseFlowId().intValue());
721
+                                nextFlow = caseFlowMapper.nextFlow(caseApplicationselect.getCaseFlowId());
775 722
                             }else {
776 723
                                 // 不需要用印
777
-                                nextFlow = caseFlowMapper.nextFlow1(caseApplicationselect.getCaseFlowId().intValue());
724
+                                nextFlow = caseFlowMapper.nextFlow1(caseApplicationselect.getCaseFlowId());
778 725
                             }
779 726
                             MsCaseApplication application = new MsCaseApplication();
780 727
                             application.setId(caseApplicationselect.getId());
@@ -806,17 +753,17 @@ public class MsSignSealServiceImpl implements MsSignSealService {
806 753
                         operLog.setCaseNode(caseNode);
807 754
                         operLog.setCreateTime(dateOperate);
808 755
                         caseLogRecordMapper.insert(operLog);
809
-                        if(signStatusApply!=null&&signStatusApply.intValue()==1&&
810
-                                signStatusResponse!=null&&signStatusResponse.intValue()==1){
756
+                        if(signStatusApply!=null&&signStatusApply.equals(1)&&
757
+                                signStatusResponse!=null&&signStatusResponse.equals(1)){
811 758
                             // 根据流程id查找下一个流程节点
812 759
                             // 根据流程id查找下一个流程节点
813 760
                             MsCaseFlow nextFlow=null;
814 761
                             if(caseApplicationselect.getSealFlag()!=null&&caseApplicationselect.getSealFlag()==1) {
815 762
                                 // 需要用印
816
-                                nextFlow = caseFlowMapper.nextFlow(caseApplicationselect.getCaseFlowId().intValue());
763
+                                nextFlow = caseFlowMapper.nextFlow(caseApplicationselect.getCaseFlowId());
817 764
                             }else {
818 765
                                 // 不需要用印
819
-                                nextFlow = caseFlowMapper.nextFlow1(caseApplicationselect.getCaseFlowId().intValue());
766
+                                nextFlow = caseFlowMapper.nextFlow1(caseApplicationselect.getCaseFlowId());
820 767
                             }
821 768
                             MsCaseApplication application = new MsCaseApplication();
822 769
                             application.setId(caseApplicationselect.getId());
@@ -847,7 +794,7 @@ public class MsSignSealServiceImpl implements MsSignSealService {
847 794
                         caseLogRecordMapper.insert(operLog);
848 795
 
849 796
                         // 根据流程id查找下一个流程节点
850
-                        MsCaseFlow nextFlow = caseFlowMapper.nextFlow(caseApplicationselect.getCaseFlowId().intValue());
797
+                        MsCaseFlow nextFlow = caseFlowMapper.nextFlow(caseApplicationselect.getCaseFlowId());
851 798
                         MsCaseApplication application = new MsCaseApplication();
852 799
                         application.setId(caseApplicationselect.getId());
853 800
                         application.setCaseFlowId(nextFlow.getId());
@@ -859,7 +806,7 @@ public class MsSignSealServiceImpl implements MsSignSealService {
859 806
 
860 807
                     }
861 808
 
862
-                }else if(mediaResult.intValue()==5){
809
+                }else if(mediaResult.equals(5)){
863 810
                     //和解
864 811
                     if(StringUtils.isNotEmpty(accountMobile)&&accountMobile.equals(pensonAccountApply)){
865 812
                         //申请人签名
@@ -872,8 +819,8 @@ public class MsSignSealServiceImpl implements MsSignSealService {
872 819
                         operLog.setCaseNode(caseNode);
873 820
                         operLog.setCreateTime(dateOperate);
874 821
                         caseLogRecordMapper.insert(operLog);
875
-                        if(signStatusResponse!=null&&signStatusResponse.intValue()==1){
876
-                            MsCaseFlow nextFlow = caseFlowMapper.nextFlow1(caseApplicationselect.getCaseFlowId().intValue());
822
+                        if(signStatusResponse!=null&&signStatusResponse.equals(1)){
823
+                            MsCaseFlow nextFlow = caseFlowMapper.nextFlow1(caseApplicationselect.getCaseFlowId());
877 824
                             MsCaseApplication application = new MsCaseApplication();
878 825
                             application.setId(caseApplicationselect.getId());
879 826
                             application.setCaseFlowId(nextFlow.getId());
@@ -898,8 +845,6 @@ public class MsSignSealServiceImpl implements MsSignSealService {
898 845
                                 String day = String.format("%02d", now.getDayOfMonth());
899 846
                                 String saveFolderPath = "/home/ruoyi/uploadPath/upload/" + year + "/" + month + "/" + day;
900 847
                                 String fileName = UUID.randomUUID().toString().replace("-", "") + ".pdf";
901
-//                                String saveName = "/profile/upload/" + year + "/" + month + "/" + day + "/" + fileName;
902
-//                                String savePath = "/home/ruoyi/uploadPath/upload/";
903 848
                                 String saveName = fileName;
904 849
                                 String savePath = "/profile/upload/" + year + "/" + month + "/" + day + "/" + fileName;
905 850
 
@@ -921,7 +866,7 @@ public class MsSignSealServiceImpl implements MsSignSealService {
921 866
                                     if(StrUtil.isEmpty(caseApplicationselect.getCaseSource())){
922 867
                                         List<MsCaseAttach> existAttach = msCaseAttachMapper.listCaseAttachByCaseIdAndType(caseAppliId, AnnexTypeEnum.MEDIATE_BOOK.getCode());
923 868
                                         if(CollectionUtil.isNotEmpty(existAttach)){
924
-                                            // todo 对接北明,同步案件状态,删除
869
+                                            //  对接北明,同步案件状态,删除
925 870
                                             for (MsCaseAttach msCaseAttach : existAttach) {
926 871
                                                 if(StrUtil.isEmpty(msCaseAttach.getOtherSysFileId())||StrUtil.isEmpty(msCaseAttach.getAnnexPath())){
927 872
                                                     continue;
@@ -937,7 +882,7 @@ public class MsSignSealServiceImpl implements MsSignSealService {
937 882
                                     caseAttach.setAnnexPath(savePath);
938 883
                                     caseAttach.setAnnexName(saveName);
939 884
                                     caseAttachMapper.save(caseAttach);
940
-                                    // todo 对接北明,调用上传附件接口
885
+                                    //  对接北明,调用上传附件接口
941 886
                                     if(StrUtil.isEmpty(caseApplicationselect.getCaseSource()) ) {
942 887
                                         String templatePath = "/home/ruoyi" + savePath;
943 888
                                         File file = new File(templatePath.replace("/profile", "/uploadPath"));
@@ -964,8 +909,8 @@ public class MsSignSealServiceImpl implements MsSignSealService {
964 909
                         operLog.setCaseNode(caseNode);
965 910
                         operLog.setCreateTime(dateOperate);
966 911
                         caseLogRecordMapper.insert(operLog);
967
-                        if(signStatusApply!=null&&signStatusApply.intValue()==1){
968
-                            MsCaseFlow nextFlow = caseFlowMapper.nextFlow1(caseApplicationselect.getCaseFlowId().intValue());
912
+                        if(signStatusApply!=null&&signStatusApply.equals(1)){
913
+                            MsCaseFlow nextFlow = caseFlowMapper.nextFlow1(caseApplicationselect.getCaseFlowId());
969 914
                             MsCaseApplication application = new MsCaseApplication();
970 915
                             application.setId(caseApplicationselect.getId());
971 916
                             application.setCaseFlowId(nextFlow.getId());
@@ -990,8 +935,6 @@ public class MsSignSealServiceImpl implements MsSignSealService {
990 935
                                 String day = String.format("%02d", now.getDayOfMonth());
991 936
                                 String saveFolderPath = "/home/ruoyi/uploadPath/upload/" + year + "/" + month + "/" + day;
992 937
                                 String fileName = UUID.randomUUID().toString().replace("-", "") + ".pdf";
993
-//                                String saveName = "/profile/upload/" + year + "/" + month + "/" + day + "/" + fileName;
994
-//                                String savePath = "/home/ruoyi/uploadPath/upload/";
995 938
                                 String saveName = fileName;
996 939
                                 String savePath = "/profile/upload/" + year + "/" + month + "/" + day + "/" + fileName;
997 940
 
@@ -1013,7 +956,7 @@ public class MsSignSealServiceImpl implements MsSignSealService {
1013 956
                                     if(StrUtil.isEmpty(caseApplicationselect.getCaseSource())){
1014 957
                                         List<MsCaseAttach> existAttach = msCaseAttachMapper.listCaseAttachByCaseIdAndType(caseAppliId, AnnexTypeEnum.MEDIATE_BOOK.getCode());
1015 958
                                         if(CollectionUtil.isNotEmpty(existAttach)){
1016
-                                            // todo 对接北明,同步案件状态,删除
959
+                                            //  对接北明,同步案件状态,删除
1017 960
                                             for (MsCaseAttach msCaseAttach : existAttach) {
1018 961
                                                 if(StrUtil.isEmpty(msCaseAttach.getOtherSysFileId())||StrUtil.isEmpty(msCaseAttach.getAnnexPath())){
1019 962
                                                     continue;
@@ -1029,7 +972,7 @@ public class MsSignSealServiceImpl implements MsSignSealService {
1029 972
                                     caseAttach.setAnnexPath(savePath);
1030 973
                                     caseAttach.setAnnexName(saveName);
1031 974
 
1032
-                                    // todo 对接北明,调用上传附件接口
975
+                                    //  对接北明,调用上传附件接口
1033 976
 
1034 977
                                     if(StrUtil.isEmpty(caseApplicationselect.getCaseSource()) ) {
1035 978
                                         String templatePath = "/home/ruoyi" + savePath;
@@ -1069,8 +1012,6 @@ public class MsSignSealServiceImpl implements MsSignSealService {
1069 1012
             String day = String.format("%02d", now.getDayOfMonth());
1070 1013
             String saveFolderPath = "/home/ruoyi/uploadPath/upload/" + year + "/" + month + "/" + day;
1071 1014
             String fileName = UUID.randomUUID().toString().replace("-", "") + ".pdf";
1072
-//                                String saveName = "/profile/upload/" + year + "/" + month + "/" + day + "/" + fileName;
1073
-//                                String savePath = "/home/ruoyi/uploadPath/upload/";
1074 1015
             String saveName = fileName;
1075 1016
             String savePath = "/profile/upload/" + year + "/" + month + "/" + day + "/" + fileName;
1076 1017
 
@@ -1092,7 +1033,7 @@ public class MsSignSealServiceImpl implements MsSignSealService {
1092 1033
                 if(StrUtil.isEmpty(caseApplicationselect.getCaseSource())){
1093 1034
                     List<MsCaseAttach> existAttach = msCaseAttachMapper.listCaseAttachByCaseIdAndType(caseAppliId, AnnexTypeEnum.MEDIATE_BOOK.getCode());
1094 1035
                     if(CollectionUtil.isNotEmpty(existAttach)){
1095
-                        // todo 对接北明,同步案件状态,删除
1036
+                        //  对接北明,同步案件状态,删除
1096 1037
                         for (MsCaseAttach msCaseAttach : existAttach) {
1097 1038
                             if(StrUtil.isEmpty(msCaseAttach.getOtherSysFileId())||StrUtil.isEmpty(msCaseAttach.getAnnexPath())){
1098 1039
                                 continue;
@@ -1108,7 +1049,7 @@ public class MsSignSealServiceImpl implements MsSignSealService {
1108 1049
                 caseAttach.setAnnexPath(savePath);
1109 1050
                 caseAttach.setAnnexName(saveName);
1110 1051
                 caseAttachMapper.save(caseAttach);
1111
-                // todo 对接北明,调用上传附件接口
1052
+                //  对接北明,调用上传附件接口
1112 1053
                 if(StrUtil.isEmpty(caseApplicationselect.getCaseSource()) ) {
1113 1054
                     String templatePath = "/home/ruoyi" + savePath;
1114 1055
                     File file = new File(templatePath.replace("/profile", "/uploadPath"));
@@ -1209,40 +1150,62 @@ public class MsSignSealServiceImpl implements MsSignSealService {
1209 1150
     /**
1210 1151
      * 通过邮件发送裁决书文件
1211 1152
      *
1212
-     * @param caseApplication1
1153
+     * @param caseApplication
1213 1154
      */
1214
-    private boolean sendCaseEmail(MsCaseApplication caseApplication1, String email, List<MsCaseAttach> caseAttachList) {
1155
+    private boolean sendCaseEmail(MsCaseApplication caseApplication, String email, List<MsCaseAttach> caseAttachList) {
1215 1156
         List<File> fileList = new ArrayList<>();
1216 1157
         File file = null;
1158
+        Long fileId = null;
1217 1159
         if (caseAttachList != null && caseAttachList.size() > 0) {
1218 1160
             for (MsCaseAttach caseAttach : caseAttachList) {
1219 1161
                 if (caseAttach.getAnnexType() == AnnexTypeEnum.MEDIATE_BOOK.getCode()) {
1220
-//                    String annexName = caseAttach.getAnnexName();
1221
-//                    String prefix = "/profile/upload/";
1222
-//                    int startIndex = prefix.length();
1223
-//                    String path = caseAttach.getAnnexPath() + annexName.substring(startIndex);
1224 1162
                     String prefix = "/profile";
1225 1163
                     int startIndex = prefix.length();
1226 1164
                     String annexPath = caseAttach.getAnnexPath();
1227 1165
                     String path = "/home/ruoyi/uploadPath/" + annexPath.substring(startIndex+1);
1228
-                    // todo 部署放开
1229 1166
                     file = new File(path);
1230 1167
                     fileList.add(file);
1168
+                    fileId=caseAttach.getAnnexId();
1231 1169
                     System.out.println("文件长度==================:" + file.length());
1232 1170
                 }
1233 1171
             }
1234 1172
         }
1173
+        SendMailRecord sendMailRecord = new SendMailRecord();
1174
+        sendMailRecord.setCaseId(caseApplication.getId());
1175
+        sendMailRecord.setMailAddress(email);
1176
+        sendMailRecord.setMailContent("您好,审核后的调解书在附件中请查阅");
1177
+        sendMailRecord.setMailName("签署后的调解书");
1178
+        sendMailRecord.setSendTime(new Date());
1179
+        sendMailRecord.setMailSubject("签署后的调解书");
1180
+        sendMailRecord.setFileIds(fileId!=null?fileId.toString():null);
1181
+        sendMailRecord.setCreateBy(SecurityUtils.getUsername());
1182
+        sendMailRecord.setCreateTime(new Date());
1183
+        sendMailRecord.setMailFromAddress(emailFrom);
1235 1184
 
1236 1185
         if (file != null && file.exists()) {
1237 1186
             try {
1238 1187
                 Boolean aBoolean = emailOutUtil.sendEmil(email, "您好,审核后的调解书在附件中请查阅", "签署后的调解书", fileList, null);
1239 1188
 
1240 1189
                 if (aBoolean) {
1190
+                    sendMailRecord.setSendStatus(1);
1191
+                    sendMailRecordMapper.saveSendMailRecord(sendMailRecord);
1192
+                    MsSendMailHistoryRecord msSendMailHistoryRecord = new MsSendMailHistoryRecord();
1193
+                    BeanUtils.copyProperties(sendMailRecord, msSendMailHistoryRecord);
1194
+                    msSendMailHistoryRecord.setParentId(sendMailRecord.getId());
1195
+                    msSendMailHistoryRecord.setId(null);
1196
+                    sendMailHistoryRecordMapper.insertSelective(msSendMailHistoryRecord);
1241 1197
                     return Boolean.TRUE;
1242 1198
                 }
1243 1199
             } catch (Exception e) {
1244 1200
                 System.out.println("邮件发送失败++++++++++++++++++++++++++++++++");
1245 1201
                 System.out.println(e.toString());
1202
+                sendMailRecord.setSendStatus(0);
1203
+                MsSendMailHistoryRecord msSendMailHistoryRecord = new MsSendMailHistoryRecord();
1204
+                BeanUtils.copyProperties(sendMailRecord, msSendMailHistoryRecord);
1205
+                msSendMailHistoryRecord.setParentId(sendMailRecord.getId());
1206
+                msSendMailHistoryRecord.setId(null);
1207
+                sendMailHistoryRecordMapper.insertSelective(msSendMailHistoryRecord);
1208
+                sendMailRecordMapper.saveSendMailRecord(sendMailRecord);
1246 1209
                 return Boolean.FALSE;
1247 1210
             }
1248 1211
         }
@@ -1250,211 +1213,6 @@ public class MsSignSealServiceImpl implements MsSignSealService {
1250 1213
     }
1251 1214
 
1252 1215
 
1253
-    private MsCaseLogRecordVO getNextCaseLogRecord(String nodeName) {
1254
-        MsCaseLogRecordVO caseLogRecord = new MsCaseLogRecordVO();
1255
-        switch (nodeName) {
1256
-            case "提交案件":
1257
-                caseLogRecord.setCaseNodeName("提交案件");
1258
-                caseLogRecord.setContent("申请人将进行提交案件");
1259
-                break;
1260
-            case "缴费":
1261
-                caseLogRecord.setCaseNodeName("缴费");
1262
-                caseLogRecord.setContent("申请人将进行缴费");
1263
-                break;
1264
-            case "确认缴费":
1265
-                caseLogRecord.setCaseNodeName("确认缴费");
1266
-                caseLogRecord.setContent("财务将进行确认缴费");
1267
-                break;
1268
-            case "受理分配":
1269
-                caseLogRecord.setCaseNodeName("受理分配");
1270
-                caseLogRecord.setContent("法律顾问将进行受理分配");
1271
-                break;
1272
-            case "选择调解员":
1273
-                caseLogRecord.setCaseNodeName("选择调解员");
1274
-                caseLogRecord.setContent("申请人将进行选择调解员");
1275
-                break;
1276
-            case "核实调解员":
1277
-                caseLogRecord.setCaseNodeName("核实调解员");
1278
-                caseLogRecord.setContent("法律顾问将进行核实调解员");
1279
-                break;
1280
-            case "确认调解员":
1281
-                caseLogRecord.setCaseNodeName("确认调解员");
1282
-                caseLogRecord.setContent("部门长将进行确认调解员");
1283
-                break;
1284
-            case "确定调解时间":
1285
-                caseLogRecord.setCaseNodeName("确定调解时间");
1286
-                caseLogRecord.setContent("法律顾问将进行确定调解时间");
1287
-                break;
1288
-            case "调解":
1289
-                caseLogRecord.setCaseNodeName("调解");
1290
-                caseLogRecord.setContent("法律顾问将进行调解");
1291
-                break;
1292
-            case "确认调解书":
1293
-                caseLogRecord.setCaseNodeName("确认调解书");
1294
-                caseLogRecord.setContent("法律顾问将进行确认调解书");
1295
-                break;
1296
-            case "签名":
1297
-                caseLogRecord.setCaseNodeName("签名");
1298
-                caseLogRecord.setContent("申请人、被申请人将进行签名");
1299
-                break;
1300
-            case "用印申请":
1301
-                caseLogRecord.setCaseNodeName("用印申请");
1302
-                caseLogRecord.setContent("法律顾问将进行用印申请");
1303
-                break;
1304
-            case "用印":
1305
-                caseLogRecord.setCaseNodeName("用印");
1306
-                caseLogRecord.setContent("部门长将进行用印");
1307
-                break;
1308
-            case "归档":
1309
-                caseLogRecord.setCaseNodeName("归档");
1310
-                caseLogRecord.setContent("法律顾问将进行提交归档");
1311
-                break;
1312
-            case "签收":
1313
-                caseLogRecord.setCaseNodeName("签收");
1314
-                caseLogRecord.setContent("申请人、被申请人将进行签收");
1315
-                break;
1316
-            case "申请人签收":
1317
-                caseLogRecord.setCaseNodeName("申请人签收");
1318
-                caseLogRecord.setContent("申请人将进行签收");
1319
-                break;
1320
-            case "被申请人签收":
1321
-                caseLogRecord.setCaseNodeName("被申请人签收");
1322
-                caseLogRecord.setContent("被申请人将进行签收");
1323
-                break;
1324
-            case "结束":
1325
-                caseLogRecord.setCaseNodeName("结束");
1326
-                caseLogRecord.setContent("结束");
1327
-                break;
1328
-            default:
1329
-                caseLogRecord.setNextRoleName("没有下一节点角色");
1330
-
1331
-        }
1332
-        return caseLogRecord;
1333
-    }
1334
-
1335
-    private CaseLogRecord getNextRole(String nodeName) {
1336
-        CaseLogRecord caseLogRecord = new CaseLogRecord();
1337
-        switch (nodeName) {
1338
-            case "提交案件":
1339
-                caseLogRecord.setNextRoleName("下一节点角色:申请人");
1340
-                break;
1341
-            case "缴费":
1342
-                caseLogRecord.setNextRoleName("下一节点角色:申请人");
1343
-                break;
1344
-            case "确认缴费":
1345
-                caseLogRecord.setNextRoleName("下一节点角色:财务");
1346
-                break;
1347
-            case "受理分配":
1348
-                caseLogRecord.setNextRoleName("下一节点角色:法律顾问");
1349
-                break;
1350
-            case "选择调解员":
1351
-                caseLogRecord.setNextRoleName("下一节点角色:申请人、被申请人");
1352
-                break;
1353
-            case "核实调解员":
1354
-                caseLogRecord.setNextRoleName("下一节点角色:法律顾问");
1355
-                break;
1356
-            case "确认调解员":
1357
-                caseLogRecord.setNextRoleName("下一节点角色:部门长");
1358
-                break;
1359
-            case "确定调解时间":
1360
-                caseLogRecord.setNextRoleName("下一节点角色:法律顾问");
1361
-                break;
1362
-            case "调解":
1363
-                caseLogRecord.setNextRoleName("下一节点角色:法律顾问");
1364
-                break;
1365
-            case "确认调解书":
1366
-                caseLogRecord.setNextRoleName("下一节点角色:申请人、被申请人");
1367
-                break;
1368
-            case "签名":
1369
-                caseLogRecord.setNextRoleName("下一节点角色:申请人、被申请人");
1370
-                break;
1371
-            case "用印申请":
1372
-                caseLogRecord.setNextRoleName("下一节点角色:法律顾问");
1373
-                break;
1374
-            case "用印":
1375
-                caseLogRecord.setNextRoleName("下一节点角色:部门长");
1376
-                break;
1377
-            case "归档":
1378
-                caseLogRecord.setNextRoleName("下一节点角色:法律顾问");
1379
-                break;
1380
-            case "签收":
1381
-                caseLogRecord.setNextRoleName("下一节点角色:申请人、被申请人");
1382
-                break;
1383
-            default:
1384
-                caseLogRecord.setNextRoleName("没有下一节点角色");
1385
-
1386
-        }
1387
-        return caseLogRecord;
1388
-    }
1389
-
1390
-    private CaseLogRecord getInCasenode(String nodeName) {
1391
-        CaseLogRecord caseLogRecord = new CaseLogRecord();
1392
-        switch (nodeName) {
1393
-            case "提交案件":
1394
-                caseLogRecord.setCaseNodeName("提交案件");
1395
-                caseLogRecord.setContent("申请人正在进行提交案件");
1396
-                break;
1397
-            case "缴费":
1398
-                caseLogRecord.setCaseNodeName("缴费");
1399
-                caseLogRecord.setContent("申请人正在进行缴费");
1400
-                break;
1401
-            case "确认缴费":
1402
-                caseLogRecord.setCaseNodeName("确认缴费");
1403
-                caseLogRecord.setContent("财务正在进行缴费确认");
1404
-                break;
1405
-            case "受理分配":
1406
-                caseLogRecord.setCaseNodeName("受理分配");
1407
-                caseLogRecord.setContent("法律顾问将进行受理分配");
1408
-                break;
1409
-            case "选择调解员":
1410
-                caseLogRecord.setCaseNodeName("选择调解员");
1411
-                caseLogRecord.setContent("申请人正在进行选择调解员");
1412
-                break;
1413
-            case "核实调解员":
1414
-                caseLogRecord.setCaseNodeName("核实调解员");
1415
-                caseLogRecord.setContent("法律顾问正在进行核实调解员");
1416
-                break;
1417
-            case "确认调解员":
1418
-                caseLogRecord.setCaseNodeName("确认调解员");
1419
-                caseLogRecord.setContent("部门长正在进行确认调解员");
1420
-                break;
1421
-            case "调解":
1422
-                caseLogRecord.setCaseNodeName("调解");
1423
-                caseLogRecord.setContent("法律顾问正在进行调解");
1424
-                break;
1425
-            case "确认调解书":
1426
-                caseLogRecord.setCaseNodeName("确认调解书");
1427
-                caseLogRecord.setContent("法律顾问正在进行确认调解书");
1428
-                break;
1429
-            case "签名":
1430
-                caseLogRecord.setCaseNodeName("签名");
1431
-                caseLogRecord.setContent("申请人、被申请人正在进行签名");
1432
-                break;
1433
-            case "用印申请":
1434
-                caseLogRecord.setCaseNodeName("用印申请");
1435
-                caseLogRecord.setContent("法律顾问正在进行确认用印申请");
1436
-                break;
1437
-            case "用印":
1438
-                caseLogRecord.setCaseNodeName("用印");
1439
-                caseLogRecord.setContent("部门长正在进行用印");
1440
-                break;
1441
-            case "归档":
1442
-                caseLogRecord.setCaseNodeName("归档");
1443
-                caseLogRecord.setContent("法律顾问正在进行归档");
1444
-                break;
1445
-            case "签收":
1446
-                caseLogRecord.setCaseNodeName("签收");
1447
-                caseLogRecord.setContent("申请人、被申请人正在进行签收");
1448
-                break;
1449
-            default:
1450
-                caseLogRecord.setCaseNodeName("无案件状态");
1451
-                caseLogRecord.setContent("无操作内容");
1452
-
1453
-        }
1454
-        return caseLogRecord;
1455
-
1456
-    }
1457
-
1458 1216
 
1459 1217
 
1460 1218
 

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

@@ -215,15 +215,6 @@ public class VideoConferenceServiceImpl implements VideoConferenceService {
215 215
                     String reportStatus = jsonObject.getStr("report_status");
216 216
                     String description = jsonObject.getStr("description");
217 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 218
                 }
228 219
             }
229 220
         }
@@ -537,7 +528,7 @@ public class VideoConferenceServiceImpl implements VideoConferenceService {
537 528
             if(StrUtil.isEmpty(caseApplication.getCaseSource())){
538 529
                 List<MsCaseAttach> existAttach = caseAttachMapper.listCaseAttachByCaseIdAndType(reservedConferenceVO.getCaseId(), AnnexTypeEnum.MEDIATE.getCode());
539 530
                 if(CollectionUtil.isNotEmpty(existAttach)){
540
-                    // todo 对接北明,同步案件状态,删除
531
+                    //  对接北明,同步案件状态,删除
541 532
                     for (MsCaseAttach msCaseAttach : existAttach) {
542 533
                         if(StrUtil.isEmpty(msCaseAttach.getOtherSysFileId())||StrUtil.isEmpty(msCaseAttach.getAnnexPath())){
543 534
                             continue;
@@ -552,7 +543,7 @@ public class VideoConferenceServiceImpl implements VideoConferenceService {
552 543
                     .annexPath(fileName)
553 544
                     .annexType(AnnexTypeEnum.MEDIATE.getCode())
554 545
                     .build();
555
-            // todo 对接北明,调用上传附件接口
546
+            //  对接北明,调用上传附件接口
556 547
 
557 548
             if(StrUtil.isEmpty(caseApplication.getCaseSource()) ) {
558 549
                 String templatePath = "/home/ruoyi" + caseAttach.getAnnexPath();
@@ -604,7 +595,7 @@ public class VideoConferenceServiceImpl implements VideoConferenceService {
604 595
                                 .annexPath(annexName)
605 596
                                 .annexType(AnnexTypeEnum.MEETING_VIDEO.getCode())
606 597
                                 .build();
607
-                        // todo 对接北明,调用上传附件接口
598
+                        //  对接北明,调用上传附件接口
608 599
 
609 600
                         if(StrUtil.isEmpty(caseApplication.getCaseSource()) ) {
610 601
                             String templatePath = "/home/ruoyi" + caseAttach.getAnnexPath();

+ 6
- 1
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/shortmessage/ShortMessageService.java Ver fichero

@@ -1,15 +1,20 @@
1 1
 package com.ruoyi.wisdomarbitrate.service.shortmessage;
2 2
 
3 3
 import com.ruoyi.common.core.domain.AjaxResult;
4
+import com.ruoyi.system.domain.entity.sms.MsSmsSendRecordParam;
4 5
 import com.ruoyi.wisdomarbitrate.domain.dto.sendrecord.SmsSendRecord;
5 6
 import com.ruoyi.wisdomarbitrate.domain.vo.shortmessage.MeetingInfoVO;
6 7
 import com.ruoyi.wisdomarbitrate.domain.vo.shortmessage.ReSendMessageVO;
7 8
 
9
+import java.util.List;
10
+
8 11
 public interface ShortMessageService {
12
+    public List<SmsSendRecord> smsSendRecordList(SmsSendRecord smsSendRecord);
13
+
9 14
     /**
10 15
      * 新增发送历史记录
11 16
      */
12
-    void insertShortMessageHistoryRecord(SmsSendRecord smsSendRecord);
17
+    void insertShortMessageHistoryRecord(SmsSendRecord smsSendRecord,List<MsSmsSendRecordParam> recordParams);
13 18
 
14 19
     /**
15 20
      * 重新发送短信

+ 156
- 15
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/shortmessage/impl/ShortMessageServiceImpl.java Ver fichero

@@ -1,29 +1,40 @@
1 1
 package com.ruoyi.wisdomarbitrate.service.shortmessage.impl;
2 2
 
3
+import cn.hutool.core.collection.CollectionUtil;
3 4
 import cn.hutool.json.JSONObject;
4 5
 import com.ruoyi.common.constant.Constants;
5 6
 import com.ruoyi.common.core.domain.AjaxResult;
6 7
 import com.ruoyi.common.enums.SMSStatusEnum;
7
-import com.ruoyi.common.utils.SmsUtils;
8 8
 import com.ruoyi.system.domain.entity.shortmessage.MeetingInfo;
9 9
 import com.ruoyi.system.domain.entity.shortmessage.MsSmsSendHistoryRecord;
10
+import com.ruoyi.system.domain.entity.sms.MsSmsSendHistoryRecordParam;
11
+import com.ruoyi.system.domain.entity.sms.MsSmsSendRecordParam;
12
+import com.ruoyi.system.domain.entity.sms.MsSmsTemplate;
13
+import com.ruoyi.system.domain.entity.sms.MsSmsTemplateParam;
10 14
 import com.ruoyi.system.mapper.shortmessage.MeetingInfoMapper;
11 15
 import com.ruoyi.system.mapper.shortmessage.MsSmsSendHistoryRecordMapper;
16
+import com.ruoyi.system.mapper.sms.MsSmsSendHistoryRecordParamMapper;
17
+import com.ruoyi.system.mapper.sms.MsSmsSendRecordParamMapper;
18
+import com.ruoyi.system.mapper.sms.MsSmsTemplateMapper;
19
+import com.ruoyi.system.mapper.sms.MsSmsTemplateParamMapper;
12 20
 import com.ruoyi.wisdomarbitrate.domain.dto.sendrecord.SmsSendRecord;
13 21
 import com.ruoyi.wisdomarbitrate.domain.vo.shortmessage.MeetingInfoVO;
14 22
 import com.ruoyi.wisdomarbitrate.domain.vo.shortmessage.ReSendMessageVO;
23
+import com.ruoyi.wisdomarbitrate.mapper.sendrecord.SmsRecordMapper;
15 24
 import com.ruoyi.wisdomarbitrate.service.shortmessage.ShortMessageService;
25
+import com.ruoyi.wisdomarbitrate.utils.SmsUtils;
16 26
 import io.jsonwebtoken.Jwts;
17 27
 import io.jsonwebtoken.SignatureAlgorithm;
18 28
 import org.springframework.beans.BeanUtils;
19 29
 import org.springframework.beans.factory.annotation.Autowired;
20 30
 import org.springframework.beans.factory.annotation.Value;
21 31
 import org.springframework.stereotype.Service;
32
+import org.springframework.transaction.annotation.Transactional;
33
+import tk.mybatis.mapper.entity.Example;
22 34
 
23
-import java.util.Date;
24
-import java.util.HashMap;
25
-import java.util.Map;
26
-import java.util.UUID;
35
+import java.text.MessageFormat;
36
+import java.util.*;
37
+import java.util.stream.Collectors;
27 38
 
28 39
 @Service
29 40
 public class ShortMessageServiceImpl implements ShortMessageService {
@@ -31,20 +42,133 @@ public class ShortMessageServiceImpl implements ShortMessageService {
31 42
     MsSmsSendHistoryRecordMapper msSmsSendHistoryRecordMapper;
32 43
     @Autowired
33 44
     MeetingInfoMapper meetingInfoMapper;
45
+    @Autowired
46
+    SmsRecordMapper smsRecordMapper;
47
+    @Autowired
48
+    MsSmsTemplateMapper templateMapper;
49
+    @Autowired
50
+    MsSmsTemplateParamMapper templateParamMapper;
51
+    @Autowired
52
+    MsSmsSendRecordParamMapper recordParamMapper;
53
+    @Autowired
54
+    MsSmsSendHistoryRecordParamMapper historyRecordParamMapper;
55
+
56
+    @Override
57
+    public List<SmsSendRecord> smsSendRecordList(SmsSendRecord smsSendRecord) {
58
+        List<SmsSendRecord> records = smsRecordMapper.getSmsSendRecord(smsSendRecord);
59
+        if(CollectionUtil.isEmpty(records)){
60
+            return null;
61
+        }
62
+        List<Long> templateIds = records.stream().map(SmsSendRecord::getMsSmsTemplateId).collect(Collectors.toList());
63
+        if(CollectionUtil.isEmpty(templateIds)){
64
+            return records;
65
+        }
66
+        List<Long> ids = records.stream().map(SmsSendRecord::getId).collect(Collectors.toList());
67
+        // 查询记录表参数值
68
+        Example recordParamExam = new Example(MsSmsSendRecordParam.class);
69
+        recordParamExam.createCriteria().andIn("smsRecordId", ids);
70
+        List<MsSmsSendRecordParam> recordParams = recordParamMapper.selectByExample(recordParamExam);
71
+        if(CollectionUtil.isEmpty(recordParams)){
72
+            return records;
73
+        }
74
+        // 根据模板id查询模板参数
75
+        Example templateParamExam = new Example(MsSmsTemplateParam.class);
76
+        templateParamExam.createCriteria().andIn("smsTemplateId", templateIds);
77
+        List<MsSmsTemplateParam> templateParams = templateParamMapper.selectByExample(templateParamExam);
78
+        if(CollectionUtil.isEmpty(templateParams)){
79
+            return records;
80
+        }
81
+        // 根据模板id对模板参数分组
82
+        Map<Long, List<MsSmsTemplateParam>> templateParamMap = templateParams.stream().collect(Collectors.groupingBy(MsSmsTemplateParam::getSmsTemplateId));
83
+
84
+        // 根据记录id分组
85
+        Map<Long, List<String>> recordParamContentMap = new HashMap<>();
86
+        for (MsSmsSendRecordParam recordParam : recordParams) {
87
+            List<String> list = recordParamContentMap.get(recordParam.getSmsRecordId());
88
+            if(CollectionUtil.isEmpty(list)){
89
+                list=new ArrayList<>();
90
+            }
91
+            list.add(recordParam.getParamValue());
92
+            recordParamContentMap.put(recordParam.getSmsRecordId(),list);
93
+        }
94
+        // 根据模板id查询模板
95
+        Example templateExam = new Example(MsSmsTemplate.class);
96
+        templateExam.createCriteria().andIn("id", templateIds);
97
+        List<MsSmsTemplate> templates = templateMapper.selectByExample(templateExam);
98
+        if(CollectionUtil.isEmpty(templates)){
99
+            return records;
100
+        }
101
+        // 根据主键id获取模板内容
102
+        Map<Long, String> templateMap = templates.stream().collect(Collectors.toMap(MsSmsTemplate::getId, MsSmsTemplate::getContent, (k1, k2) -> k2));
103
+        Map<Long, String> templateIdMap = templates.stream().collect(Collectors.toMap(MsSmsTemplate::getId, MsSmsTemplate::getTemplateId, (k1, k2) -> k2));
104
+        // 组装模板内容
105
+        for (SmsSendRecord record : records) {
106
+            if(record.getMsSmsTemplateId()==null){
107
+                continue;
108
+            }
109
+            if(!templateMap.containsKey(record.getMsSmsTemplateId())){
110
+                continue;
111
+            }
112
+
113
+            if(!recordParamContentMap.containsKey(record.getId())){
114
+                continue;
115
+            }
116
+            if(templateIdMap.containsKey(record.getMsSmsTemplateId())){
117
+              record.setTemplateId(templateIdMap.get(record.getMsSmsTemplateId()));
118
+            }
119
+            String templateContent = templateMap.get(record.getMsSmsTemplateId());
120
+            record.setTemplateContent(templateContent);
121
+            List<String> recordParamList = recordParamContentMap.get(record.getId());
122
+            if(recordParamContentMap.containsKey(record.getId()) && templateParamMap.containsKey(record.getMsSmsTemplateId())){
123
+                List<MsSmsTemplateParam> templateParamList = templateParamMap.get(record.getMsSmsTemplateId());
124
+                for (int i = 0; i < templateParamList.size(); i++) {
125
+                    MsSmsTemplateParam templateParam = templateParamList.get(i);
126
+                    templateParam.setParamValue(recordParamContentMap.get(record.getId()).get(i));
127
+                }
128
+                record.setTemplateParams(templateParamList);
129
+
130
+            }
131
+            // 按顺序替换占位符
132
+            if(CollectionUtil.isNotEmpty(recordParamList)){
133
+                recordParamList.add(0,"0");
134
+
135
+                // 将List<String>转换为String[]数组
136
+                String[] paramArray = recordParamList.toArray(new String[recordParamList.size()]);
137
+                String formattedMessage = MessageFormat.format(templateContent, paramArray);
138
+                record.setSendContent(formattedMessage);
139
+            }
34 140
 
141
+
142
+        }
143
+
144
+        return records;
145
+    }
35 146
     /**
36 147
      * 新增发送历史记录
37 148
      *
38 149
      * @param smsSendRecord
39 150
      */
151
+    @Transactional
40 152
     @Override
41
-    public void insertShortMessageHistoryRecord(SmsSendRecord smsSendRecord) {
42
-        if (smsSendRecord != null) {
43
-            MsSmsSendHistoryRecord historyRecord = new MsSmsSendHistoryRecord();
44
-            BeanUtils.copyProperties(smsSendRecord, historyRecord);
153
+    public void insertShortMessageHistoryRecord(SmsSendRecord smsSendRecord,List<MsSmsSendRecordParam> recordParams) {
154
+        if(smsSendRecord!=null){
155
+            MsSmsSendHistoryRecord historyRecord=new MsSmsSendHistoryRecord();
156
+            BeanUtils.copyProperties(smsSendRecord,historyRecord);
45 157
             historyRecord.setId(null);
46 158
             historyRecord.setParentId(smsSendRecord.getId());
47
-            msSmsSendHistoryRecordMapper.insert(historyRecord);
159
+            int i = msSmsSendHistoryRecordMapper.insert(historyRecord);
160
+            if(i>0 && CollectionUtil.isNotEmpty(recordParams)){
161
+                // 新增参数表
162
+                List<MsSmsSendHistoryRecordParam> historyRecordParams = new ArrayList<>();
163
+                for (MsSmsSendRecordParam templateParam : recordParams) {
164
+                    MsSmsSendHistoryRecordParam recordParam = new MsSmsSendHistoryRecordParam();
165
+                    BeanUtils.copyProperties(templateParam,recordParam);
166
+                    recordParam.setId(null);
167
+                    recordParam.setSmsRecordHistoryId(historyRecord.getId());
168
+                    historyRecordParams.add(recordParam);
169
+                }
170
+                historyRecordParamMapper.batchInsert(historyRecordParams);
171
+            }
48 172
         }
49 173
     }
50 174
 
@@ -55,19 +179,36 @@ public class ShortMessageServiceImpl implements ShortMessageService {
55 179
      */
56 180
     @Override
57 181
     public AjaxResult reSendShortMessage(ReSendMessageVO reSendMessageVO) {
58
-        if (reSendMessageVO != null && reSendMessageVO.getTemplateId() != null && reSendMessageVO.getPhone() != null && reSendMessageVO.getParamValues() != null && reSendMessageVO.getParamValues().size() > 0) {
182
+        if (reSendMessageVO != null && reSendMessageVO.getTemplateId() != null && reSendMessageVO.getPhone() != null && reSendMessageVO.getTemplateParams() != null && reSendMessageVO.getTemplateParams().size() > 0 && reSendMessageVO.getId() != null) {
183
+            // 根据id查询短信记录
184
+            SmsSendRecord smsSendRecord = smsRecordMapper.selectById(reSendMessageVO.getId());
185
+            if(smsSendRecord == null){
186
+                return AjaxResult.warn("短信记录不存在");
187
+            }
188
+
59 189
             SmsUtils.SendSmsRequest request = new SmsUtils.SendSmsRequest();
60 190
             request.setTemplateId(reSendMessageVO.getTemplateId());
61 191
             request.setPhone(reSendMessageVO.getPhone());
62
-            String[] messageContent = reSendMessageVO.getParamValues().toArray(new String[0]);
63
-            System.out.println(reSendMessageVO.getTemplateId());
64
-            System.out.println(reSendMessageVO.getPhone());
65
-            System.out.println(messageContent);
192
+            List<String> paramsList = reSendMessageVO.getTemplateParams().stream().map(MsSmsTemplateParam::getParamValue).collect(Collectors.toList());
193
+            String[] messageContent = paramsList.toArray(new String[0]);
66 194
             request.setTemplateParamSet(messageContent);
67 195
             JSONObject resultObj = SmsUtils.sendSms(request);
196
+            smsSendRecord.setSendTime(new Date());
197
+            // 修改sid和状态
68 198
             if (resultObj.get("status") != null && !resultObj.get("status").equals(SMSStatusEnum.FAIL.getCode())) {
199
+                smsSendRecord.setSendStatus(SMSStatusEnum.SENDING.getCode());
200
+                smsSendRecord.setSid(resultObj.get("sid")==null?null:resultObj.get("sid").toString());
201
+                smsSendRecord.setReason(null);
202
+                // 修改
203
+                smsRecordMapper.update(smsSendRecord);
204
+
69 205
                 return AjaxResult.success("重新发送成功");
70 206
             } else {
207
+                smsSendRecord.setSid(resultObj.get("sid")==null?null:resultObj.get("sid").toString());
208
+                smsSendRecord.setSendStatus(SMSStatusEnum.FAIL.getCode());
209
+                smsSendRecord.setSid(resultObj.get("reason")==null?null:resultObj.get("reason").toString());
210
+                // 修改
211
+                smsRecordMapper.update(smsSendRecord);
71 212
                 return AjaxResult.warn("重新发送失败");
72 213
             }
73 214
         } else {

+ 21
- 0
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/sms/SMSTemplateService.java Ver fichero

@@ -0,0 +1,21 @@
1
+package com.ruoyi.wisdomarbitrate.service.sms;
2
+
3
+import com.ruoyi.common.core.domain.AjaxResult;
4
+import com.ruoyi.system.domain.entity.sms.MsSmsTemplate;
5
+
6
+import java.util.List;
7
+
8
+/**
9
+ * @Classname SMSTemplateService
10
+ * @Description TODO
11
+ * @Version 1.0.0
12
+ * @Date 2024/4/16 11:39
13
+ * @Created wangqiong
14
+ */
15
+public interface SMSTemplateService {
16
+    List<MsSmsTemplate> page();
17
+
18
+    AjaxResult insert(MsSmsTemplate template);
19
+
20
+    AjaxResult delete(Long id);
21
+}

+ 96
- 0
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/sms/impl/SMSTemplateServiceImpl.java Ver fichero

@@ -0,0 +1,96 @@
1
+package com.ruoyi.wisdomarbitrate.service.sms.impl;
2
+
3
+import cn.hutool.core.collection.CollectionUtil;
4
+import com.ruoyi.common.core.domain.AjaxResult;
5
+import com.ruoyi.system.domain.entity.sms.MsSmsTemplate;
6
+import com.ruoyi.system.domain.entity.sms.MsSmsTemplateParam;
7
+import com.ruoyi.system.mapper.sms.MsSmsTemplateMapper;
8
+import com.ruoyi.system.mapper.sms.MsSmsTemplateParamMapper;
9
+import com.ruoyi.wisdomarbitrate.service.sms.SMSTemplateService;
10
+import org.springframework.beans.factory.annotation.Autowired;
11
+import org.springframework.stereotype.Service;
12
+import tk.mybatis.mapper.entity.Example;
13
+
14
+import java.util.List;
15
+import java.util.Map;
16
+import java.util.stream.Collectors;
17
+
18
+/**
19
+ * @Classname SMSTemplateServiceImpl
20
+ * @Description TODO
21
+ * @Version 1.0.0
22
+ * @Date 2024/4/16 11:40
23
+ * @Created wangqiong
24
+ */
25
+@Service
26
+public class SMSTemplateServiceImpl implements SMSTemplateService {
27
+    @Autowired
28
+    private MsSmsTemplateMapper templateMapper;
29
+    @Autowired
30
+    private MsSmsTemplateParamMapper templateParamMapper;
31
+
32
+    @Override
33
+    public List<MsSmsTemplate> page() {
34
+        // 分页查询模板
35
+        Example templateExam = new Example(MsSmsTemplate.class);
36
+        List<MsSmsTemplate> templates = templateMapper.selectByExample(templateExam);
37
+        if(CollectionUtil.isEmpty(templates)){
38
+            return null;
39
+        }
40
+
41
+        List<Long> templateIds = templates.stream().map(MsSmsTemplate::getId).collect(Collectors.toList());
42
+        // 查询参数
43
+        Example templateParamExam = new Example(MsSmsTemplateParam.class);
44
+        templateParamExam.createCriteria().andIn("smsTemplateId", templateIds);
45
+        List<MsSmsTemplateParam> templateParams = templateParamMapper.selectByExample(templateParamExam);
46
+        // 根据模板id对模板参数分组
47
+        Map<Long, List<MsSmsTemplateParam>> templateParamMap = templateParams.stream().collect(Collectors.groupingBy(MsSmsTemplateParam::getSmsTemplateId));
48
+        for (MsSmsTemplate template : templates) {
49
+            if(templateParamMap.containsKey(template.getId())){
50
+                template.setTemplateParams(templateParamMap.get(template.getId()));
51
+            }
52
+        }
53
+        return templates;
54
+    }
55
+
56
+    /**
57
+     * 新增或者修改
58
+     * @param template
59
+     * @return
60
+     */
61
+    @Override
62
+    public AjaxResult insert(MsSmsTemplate template) {
63
+        if(template.getId() == null){
64
+            templateMapper.insert(template);
65
+
66
+        }else{
67
+            templateMapper.updateByPrimaryKey(template);
68
+            for (MsSmsTemplateParam templateParam : template.getTemplateParams()) {
69
+                templateParam.setSmsTemplateId(template.getId());
70
+            }
71
+            // todo 先删除
72
+            Example paramExam = new Example(MsSmsTemplateParam.class);
73
+            paramExam.createCriteria().andEqualTo("smsTemplateId", template.getId());
74
+            templateParamMapper.deleteByExample(paramExam);
75
+        }
76
+        // 新增参数表
77
+        if(CollectionUtil.isNotEmpty(template.getTemplateParams())){
78
+            for (MsSmsTemplateParam templateParam : template.getTemplateParams()) {
79
+                templateParam.setSmsTemplateId(template.getId());
80
+            }
81
+            templateParamMapper.batchInsert(template.getTemplateParams());
82
+        }
83
+        return AjaxResult.success();
84
+    }
85
+
86
+    @Override
87
+    public AjaxResult delete(Long id) {
88
+        // 删除
89
+        templateMapper.deleteByPrimaryKey(id);
90
+        // 删除参数表
91
+        Example paramExam = new Example(MsSmsTemplateParam.class);
92
+        paramExam.createCriteria().andEqualTo("smsTemplateId", id);
93
+        templateParamMapper.deleteByExample(paramExam);
94
+        return AjaxResult.success();
95
+    }
96
+}

+ 192
- 0
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/utils/SmsUtils.java Ver fichero

@@ -0,0 +1,192 @@
1
+package com.ruoyi.wisdomarbitrate.utils;
2
+
3
+import cn.hutool.core.collection.CollectionUtil;
4
+import cn.hutool.core.util.StrUtil;
5
+import cn.hutool.extra.spring.SpringUtil;
6
+import cn.hutool.json.JSONObject;
7
+import com.ruoyi.common.enums.SMSStatusEnum;
8
+import com.ruoyi.common.utils.SecurityUtils;
9
+import com.ruoyi.common.utils.ThreadUtil;
10
+import com.ruoyi.system.domain.entity.sms.MsSmsSendRecordParam;
11
+import com.ruoyi.system.domain.entity.sms.MsSmsTemplate;
12
+import com.ruoyi.system.mapper.SysRoleMapper;
13
+import com.ruoyi.system.mapper.SysUserMapper;
14
+import com.ruoyi.system.mapper.flow.MsCaseFlowRoleSmsRelatedMapper;
15
+import com.ruoyi.system.mapper.sms.MsSmsSendRecordParamMapper;
16
+import com.ruoyi.system.mapper.sms.MsSmsTemplateMapper;
17
+import com.ruoyi.wisdomarbitrate.domain.dto.sendrecord.SmsSendRecord;
18
+import com.ruoyi.wisdomarbitrate.domain.entity.mscase.MsCaseApplication;
19
+import com.ruoyi.wisdomarbitrate.mapper.sendrecord.SmsRecordMapper;
20
+import com.ruoyi.wisdomarbitrate.service.shortmessage.ShortMessageService;
21
+import com.tencentcloudapi.common.Credential;
22
+import com.tencentcloudapi.common.exception.TencentCloudSDKException;
23
+import com.tencentcloudapi.sms.v20210111.SmsClient;
24
+import com.tencentcloudapi.sms.v20210111.models.SendSmsResponse;
25
+import com.tencentcloudapi.sms.v20210111.models.SendStatus;
26
+import lombok.AllArgsConstructor;
27
+import lombok.Data;
28
+import lombok.NoArgsConstructor;
29
+import lombok.extern.slf4j.Slf4j;
30
+import lombok.var;
31
+import tk.mybatis.mapper.entity.Example;
32
+
33
+import java.util.ArrayList;
34
+import java.util.Date;
35
+import java.util.List;
36
+import java.util.Objects;
37
+import java.util.concurrent.CompletableFuture;
38
+import java.util.concurrent.ExecutorService;
39
+
40
+@Slf4j
41
+public class SmsUtils {
42
+    //应用id
43
+    private static final String SDK_APP_ID = "1400854852";
44
+    //API的SecretId
45
+    private static final String SECRET_ID = "AKIDeEf2A8uX1HSainvvnXAc3X9ZlhtyvkMp";
46
+    //API的SecretKey
47
+    private static final String SECRET_KEY = "QjphKo8zkHZigT8j9PVtFPJyfIvO3d6V";
48
+    //签名内容
49
+    private static final String SIGN_NAME = "乙巢智慧仲裁网";
50
+    private static SmsRecordMapper recordMapper = SpringUtil.getBean(SmsRecordMapper.class);
51
+    private static MsSmsSendRecordParamMapper recordParamMapper = SpringUtil.getBean(MsSmsSendRecordParamMapper.class);
52
+    private static MsSmsTemplateMapper templateMapper = SpringUtil.getBean(MsSmsTemplateMapper.class);
53
+    private static SysUserMapper sysUserMapper = SpringUtil.getBean(SysUserMapper.class);
54
+    private static MsCaseFlowRoleSmsRelatedMapper flowRoleRelatedMapper = SpringUtil.getBean(MsCaseFlowRoleSmsRelatedMapper.class);
55
+    private static SysRoleMapper roleMapper = SpringUtil.getBean(SysRoleMapper.class);
56
+    private static ShortMessageService shortMessageService = SpringUtil.getBean(ShortMessageService.class);
57
+
58
+    public static JSONObject sendSms(SendSmsRequest request) {
59
+        JSONObject jsonObject = new JSONObject();
60
+        Credential cred = new Credential(SECRET_ID, SECRET_KEY);
61
+
62
+        SmsClient client = new SmsClient(cred, "ap-guangzhou");
63
+
64
+        final var req = new com.tencentcloudapi.sms.v20210111.models.SendSmsRequest();
65
+        req.setPhoneNumberSet(new String[]{"+86" + request.getPhone()});
66
+        req.setSmsSdkAppId(SDK_APP_ID);
67
+        req.setSignName(SIGN_NAME);
68
+        req.setTemplateId(request.getTemplateId());
69
+        req.setTemplateParamSet(request.getTemplateParamSet());
70
+        SendSmsResponse res = null;
71
+        try {
72
+            res = client.SendSms(req);
73
+        } catch (TencentCloudSDKException e) {
74
+            log.error("发送短信出错:", e);
75
+            jsonObject.set("status", SMSStatusEnum.FAIL.getCode());
76
+            jsonObject.set("reason",e.getMessage());
77
+            return jsonObject;
78
+        }
79
+        SendStatus sendStatus = res.getSendStatusSet()[0];
80
+        log.info("发送短信结果:Code={}, Message={}", sendStatus.getCode(), sendStatus.getMessage());
81
+
82
+        if (Objects.nonNull(res.getSendStatusSet()) && res.getSendStatusSet().length > 0 && "Ok".equals(res.getSendStatusSet()[0].getCode())) {
83
+            jsonObject.set("status", SMSStatusEnum.SENDING.getCode());
84
+        } else {
85
+            jsonObject.set("status", SMSStatusEnum.FAIL.getCode());
86
+        }
87
+        jsonObject.set("sid", sendStatus.getSerialNo());
88
+        return jsonObject;
89
+    }
90
+
91
+    public static void sendSms(MsCaseApplication application, String templateId, String phone, String[] templateParamSet) {
92
+        if(application==null||StrUtil.isEmpty(templateId)||StrUtil.isEmpty(phone)||templateParamSet==null||templateParamSet.length==0){
93
+            return;
94
+        }
95
+        Example templateExam = new Example(MsSmsTemplate.class);
96
+        templateExam.createCriteria().andEqualTo("templateId", templateId);
97
+        List<MsSmsTemplate> templates = templateMapper.selectByExample(templateExam);
98
+        if (CollectionUtil.isEmpty(templates)) {
99
+            return ;
100
+        }
101
+        MsSmsTemplate template = templates.get(0);
102
+        SendSmsRequest request = new SendSmsRequest(phone, templateId, templateParamSet, application.getId());
103
+        Credential cred = new Credential(SECRET_ID, SECRET_KEY);
104
+
105
+        SmsClient client = new SmsClient(cred, "ap-guangzhou");
106
+
107
+        final var req = new com.tencentcloudapi.sms.v20210111.models.SendSmsRequest();
108
+        req.setPhoneNumberSet(new String[]{"+86" + request.getPhone()});
109
+        req.setSmsSdkAppId(SDK_APP_ID);
110
+        req.setSignName(SIGN_NAME);
111
+        req.setTemplateId(request.getTemplateId());
112
+        req.setTemplateParamSet(request.getTemplateParamSet());
113
+        sendSms(client,template,application,phone, templateParamSet,req);
114
+    }
115
+
116
+
117
+    private static void sendSms(SmsClient client,MsSmsTemplate template, MsCaseApplication application, String phone, String[] templateParamSet, com.tencentcloudapi.sms.v20210111.models.SendSmsRequest req) {
118
+        SmsSendRecord smsSendRecord=new SmsSendRecord();
119
+        smsSendRecord.setMsSmsTemplateId(template.getId());
120
+        smsSendRecord.setCaseId(application.getId());
121
+        smsSendRecord.setCaseNum(application.getCaseNum());
122
+        smsSendRecord.setSendTime(new Date());
123
+        smsSendRecord.setPhone(phone);
124
+        smsSendRecord.setCreateTime(new Date());
125
+        smsSendRecord.setCreateBy(SecurityUtils.getUsername());
126
+        //    SendSmsRequest request = new SendSmsRequest(phone, template.getTemplateId(), templateParamSet, application.getId());
127
+        req.setPhoneNumberSet(new String[]{"+86" + phone});
128
+        req.setTemplateId(template.getTemplateId());
129
+        req.setTemplateParamSet(templateParamSet);
130
+        try {
131
+            SendSmsResponse res=client.SendSms(req);
132
+            SendStatus sendStatus = res.getSendStatusSet()[0];
133
+            if (Objects.nonNull(res.getSendStatusSet()) && res.getSendStatusSet().length > 0 && "Ok".equals(res.getSendStatusSet()[0].getCode())) {
134
+                smsSendRecord.setSendStatus( SMSStatusEnum.SENDING.getCode());
135
+            } else {
136
+                smsSendRecord.setSendStatus(SMSStatusEnum.FAIL.getCode());
137
+                smsSendRecord.setReason(sendStatus.getMessage());
138
+            }
139
+            smsSendRecord.setSid(sendStatus.getSerialNo());
140
+        } catch (TencentCloudSDKException e) {
141
+            smsSendRecord.setSendStatus(SMSStatusEnum.FAIL.getCode());
142
+            smsSendRecord.setReason(e.getMessage());
143
+        }
144
+        int i = recordMapper.saveSmsSendRecord(smsSendRecord);
145
+        if(i>0){
146
+            List<MsSmsSendRecordParam> recordParams=new ArrayList<>();
147
+            for (String paramValue : templateParamSet) {
148
+                // 新增参数
149
+                MsSmsSendRecordParam recordParam = new MsSmsSendRecordParam();
150
+                recordParam.setSmsRecordId(smsSendRecord.getId());
151
+                recordParam.setParamValue(paramValue);
152
+                recordParams.add(recordParam);
153
+            }
154
+            ExecutorService executor = ThreadUtil.createThreadPool();
155
+            CompletableFuture.runAsync(() -> {
156
+                recordParamMapper.batchInsert(recordParams);
157
+
158
+            }, executor);
159
+            // 新增历史记录表
160
+            CompletableFuture.runAsync(() -> {
161
+                shortMessageService.insertShortMessageHistoryRecord(smsSendRecord,recordParams);
162
+
163
+            }, executor);
164
+
165
+        }
166
+    }
167
+
168
+    /**
169
+     * 参数对象
170
+     */
171
+    @Data
172
+    @NoArgsConstructor
173
+    @AllArgsConstructor
174
+    public static class SendSmsRequest {
175
+        /**
176
+         * 电话
177
+         */
178
+        private String phone;
179
+
180
+        /**
181
+         * 模板 ID: 必须填写已审核通过的模板 ID
182
+         */
183
+        private String templateId;
184
+
185
+        /**
186
+         * 模板参数: 模板参数的个数需要与 TemplateId 对应模板的变量个数保持一致,若无模板参数,则设置为空
187
+         */
188
+        private String[] templateParamSet;
189
+        private Long caseId;
190
+
191
+    }
192
+}

+ 2
- 1
ruoyi-system/src/main/resources/com/ruoyi/system/mapper/log/MsRequestLogMapper.xml Ver fichero

@@ -6,10 +6,11 @@
6 6
       WARNING - @mbg.generated
7 7
     -->
8 8
     <id column="id" jdbcType="BIGINT" property="id" />
9
-    <result column="status" jdbcType="BIGINT" property="status" />
9
+    <result column="status" jdbcType="INTEGER" property="status" />
10 10
     <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
11 11
     <result column="request_url" jdbcType="LONGVARCHAR" property="requestUrl" />
12 12
     <result column="content" jdbcType="LONGVARCHAR" property="content" />
13 13
     <result column="reason" jdbcType="LONGVARCHAR" property="reason" />
14
+    <result column="return_content" jdbcType="LONGVARCHAR" property="returnContent" />
14 15
   </resultMap>
15 16
 </mapper>

+ 12
- 0
ruoyi-system/src/main/resources/com/ruoyi/system/mapper/sms/MsSmsSendHistoryRecordParamMapper.xml Ver fichero

@@ -0,0 +1,12 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
3
+<mapper namespace="com.ruoyi.system.mapper.sms.MsSmsSendHistoryRecordParamMapper">
4
+  <resultMap id="BaseResultMap" type="com.ruoyi.system.domain.entity.sms.MsSmsSendHistoryRecordParam">
5
+    <!--
6
+      WARNING - @mbg.generated
7
+    -->
8
+    <id column="id" jdbcType="BIGINT" property="id" />
9
+    <result column="sms_record_history_id" jdbcType="BIGINT" property="smsRecordHistoryId" />
10
+    <result column="param_value" jdbcType="LONGVARCHAR" property="paramValue" />
11
+  </resultMap>
12
+</mapper>

+ 13
- 0
ruoyi-system/src/main/resources/com/ruoyi/system/mapper/sms/MsSmsSendRecordParamMapper.xml Ver fichero

@@ -0,0 +1,13 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
3
+<mapper namespace="com.ruoyi.system.mapper.sms.MsSmsSendRecordParamMapper">
4
+  <resultMap id="BaseResultMap" type="com.ruoyi.system.domain.entity.sms.MsSmsSendRecordParam">
5
+    <!--
6
+      WARNING - @mbg.generated
7
+    -->
8
+    <id column="id" jdbcType="INTEGER" property="id" />
9
+    <result column="sms_record_id" jdbcType="VARCHAR" property="smsRecordId" />
10
+    <result column="param" jdbcType="VARCHAR" property="param" />
11
+    <result column="param_value" jdbcType="LONGVARCHAR" property="paramValue" />
12
+  </resultMap>
13
+</mapper>

+ 12
- 0
ruoyi-system/src/main/resources/com/ruoyi/system/mapper/sms/MsSmsTemplateMapper.xml Ver fichero

@@ -0,0 +1,12 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
3
+<mapper namespace="com.ruoyi.system.mapper.sms.MsSmsTemplateMapper">
4
+  <resultMap id="BaseResultMap" type="com.ruoyi.system.domain.entity.sms.MsSmsTemplate">
5
+    <!--
6
+      WARNING - @mbg.generated
7
+    -->
8
+    <id column="id" jdbcType="INTEGER" property="id" />
9
+    <result column="template_id" jdbcType="VARCHAR" property="templateId" />
10
+    <result column="name" jdbcType="VARCHAR" property="name" />
11
+  </resultMap>
12
+</mapper>

+ 12
- 0
ruoyi-system/src/main/resources/com/ruoyi/system/mapper/sms/MsSmsTemplateParamMapper.xml Ver fichero

@@ -0,0 +1,12 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
3
+<mapper namespace="com.ruoyi.system.mapper.sms.MsSmsTemplateParamMapper">
4
+  <resultMap id="BaseResultMap" type="com.ruoyi.system.domain.entity.sms.MsSmsTemplateParam">
5
+    <!--
6
+      WARNING - @mbg.generated
7
+    -->
8
+    <id column="id" jdbcType="INTEGER" property="id" />
9
+    <result column="sms_template_id" jdbcType="VARCHAR" property="smsTemplateId" />
10
+    <result column="param" jdbcType="VARCHAR" property="param" />
11
+  </resultMap>
12
+</mapper>

+ 1
- 1
ruoyi-system/src/main/resources/mapper/system/SysMenuMapper.xml Ver fichero

@@ -108,7 +108,7 @@
108 108
 			 left join ms_sys_role_menu rm on m.menu_id = rm.menu_id
109 109
 			 left join ms_sys_user_role ur on rm.role_id = ur.role_id
110 110
 			 left join ms_sys_role r on r.role_id = ur.role_id
111
-		where m.status = '0' and r.status = '0' and ur.user_id = #{userId}
111
+		where m.status = '0' and r.status = '0' and ur.user_id = #{userId} and m.perms is not null and m.perms!=''
112 112
 	</select>
113 113
 	
114 114
 	<select id="selectMenuPermsByRoleId" parameterType="Long" resultType="String">

+ 4
- 1
ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml Ver fichero

@@ -26,6 +26,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
26 26
         <result property="updateTime"   column="update_time"  />
27 27
         <result property="remark"       column="remark"       />
28 28
         <result property="specialty"       column="specialty"       />
29
+        <result property="birth"       column="birth"       />
30
+        <result property="home"       column="home"       />
31
+        <result property="address"       column="address"       />
29 32
 <!--        <collection property="dept"    javaType="com.ruoyi.common.core.domain.entity.SysDept"         resultMap="deptResult" />-->
30 33
         <collection  property="roles"   javaType="java.util.List"  resultMap="RoleResult" />
31 34
     </resultMap>
@@ -52,7 +55,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
52 55
 	
53 56
 	<sql id="selectUserVo">
54 57
         select u.user_id, u.user_name, u.nick_name,u.specialty, u.id_card,u.email, u.avatar, u.phonenumber, u.password, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark,
55
-        r.role_id, r.role_name, r.role_key, r.role_sort, r.data_scope, r.status as role_status,u.id_card,u.id_type,u.nationality
58
+        r.role_id, r.role_name, r.role_key, r.role_sort, r.data_scope, r.status as role_status,u.birth,u.id_type,u.nationality,u.home,u.address
56 59
         from ms_sys_user u
57 60
 		    left join ms_sys_user_role ur on u.user_id = ur.user_id
58 61
 		    left join ms_sys_role r on r.role_id = ur.role_id

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

@@ -9,7 +9,7 @@
9 9
       u.nickName name,
10 10
       u.id_type idType,
11 11
       r.role_name roleName,
12
-      GROUP_CONCAT( DISTINCT CASE WHEN c.organize_flag = 0 THEN u.nick_name ELSE d.dept_name END ) AS name,
12
+      GROUP_CONCAT( DISTINCT CASE WHEN a1.organize_flag = 0 THEN u.nick_name ELSE d.dept_name END ) AS name,
13 13
     (select GROUP_CONCAT( DISTINCT u1.nick_name ) FROM
14 14
 
15 15
      ms_case_affiliate a1
@@ -39,13 +39,13 @@
39 39
     group by a.case_appli_id
40 40
   </select>
41 41
     <select id="selectByCaseId" resultType="com.ruoyi.wisdomarbitrate.domain.entity.mscase.MsCaseAffiliate">
42
-        select c.id caseAppliId,a.id,a.role_type roleType,a.group_order groupOrder,a.operator_flag operatorFlag,d.code,d.comp_legal_person compLegalPerson,u.id_card idCard,u.phonenumber phone,
43
-            u.email,
42
+        select c.id caseAppliId,r.role_id roleId,a.id,a.role_type roleType,a.group_order groupOrder,a.operator_flag operatorFlag,d.code,d.comp_legal_person compLegalPerson,u.id_card idCard,u.phonenumber phone,
43
+            u.email,u.user_name userName,
44 44
                (case when a.user_id is null then d.dept_name else u.nick_name end)  name,
45 45
                (case when a.user_id is null then d.home else u.home end) home,
46 46
                (case when a.user_id is null then d.address else u.address end) address,
47 47
                (case when a.user_id is null then d.nationality else u.nationality end) nationality,
48
-                u.sex,u.id_type idType,u.birth,a.user_id userId,c.organize_flag organizeFlag,c.case_source caseSource,d.dept_name applicantOrgName
48
+                u.sex,u.id_type idType,u.birth,a.user_id userId,a.organize_flag organizeFlag,c.case_source caseSource,d.dept_name applicantOrgName
49 49
         FROM
50 50
             ms_case_application c
51 51
                 JOIN ms_case_affiliate a ON a.case_appli_id=#{id} and c.id = a.case_appli_id
@@ -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 order by a.id asc
57
+        GROUP BY a.id,r.role_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,
@@ -63,7 +63,7 @@
63 63
         (case when a.user_id is null then d.home else u.home end) home,
64 64
         (case when a.user_id is null then d.address else u.address end) address,
65 65
         (case when a.user_id is null then d.nationality else u.nationality end) nationality,
66
-        u.sex,u.id_type idType,u.birth,r.role_name roleName,d.dept_name applicantOrgName,a.user_id userId,a.applicant_dept_id applicantDeptId,c.organize_flag organizeFlag,c.case_source caseSource
66
+        u.sex,u.id_type idType,u.birth,r.role_name roleName,d.dept_name applicantOrgName,a.user_id userId,a.applicant_dept_id applicantDeptId,a.organize_flag organizeFlag,c.case_source caseSource
67 67
         FROM
68 68
             ms_case_application c
69 69
                 JOIN ms_case_affiliate a ON  c.id = a.case_appli_id

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

@@ -110,7 +110,7 @@
110 110
   <select id="list" resultType="com.ruoyi.wisdomarbitrate.domain.vo.mscase.MsCaseApplicationVO">
111 111
     select t.* from(
112 112
     SELECT
113
-    c.id,c.organize_flag organizeFlag,c.case_source caseSource,c.media_result mediaResult,c.room_id roomId,0 AS pendingStatus,
113
+    c.id,c.case_source caseSource,c.media_result mediaResult,c.room_id roomId,0 AS pendingStatus,
114 114
     c.case_flow_id caseFlowId,c.batch_number batchNumber,c.case_num caseNum,
115 115
     u1.nick_name mediatorName,c.hear_date hearDate,c.case_status_name caseStatusName,c.create_time createTime,
116 116
     c.mediation_method mediationMethod,
@@ -120,7 +120,7 @@
120 120
     c.id
121 121
     union
122 122
     SELECT
123
-    c.id,c.organize_flag organizeFlag,c.case_source caseSource,c.media_result mediaResult,c.room_id roomId,1 AS pendingStatus,
123
+    c.id,c.case_source caseSource,c.media_result mediaResult,c.room_id roomId,1 AS pendingStatus,
124 124
     c.case_flow_id caseFlowId,c.batch_number batchNumber,c.case_num caseNum,
125 125
     u1.nick_name mediatorName,c.hear_date hearDate,c.case_status_name caseStatusName,c.create_time createTime,
126 126
     c.mediation_method mediationMethod,
@@ -159,4 +159,28 @@
159 159
     ) t ORDER BY t.createTime desc,t.caseNum desc
160 160
 
161 161
   </select>
162
+  <select id="countCasePerson" resultType="java.lang.Long">
163
+    select c.id from ms_case_application c where c.mediator_id
164
+     in
165
+    <foreach collection="userIds" item="userId" open="(" separator="," close=")">
166
+      #{userId}
167
+    </foreach>
168
+    union ALL
169
+    select a.id from ms_case_affiliate a where a.user_id
170
+    in
171
+    <foreach collection="userIds" item="userId" open="(" separator="," close=")">
172
+      #{userId}
173
+    </foreach>
174
+    union all
175
+    SELECT id from ms_dept_identify where user_id
176
+    in
177
+    <foreach collection="userIds" item="userId" open="(" separator="," close=")">
178
+      #{userId}
179
+    </foreach>
180
+  </select>
181
+  <select id="selectCaseByDeptId" resultType="java.lang.Long">
182
+    select a.id from ms_case_affiliate a where a.applicant_dept_id=#{deptId}
183
+    union all
184
+    SELECT id from ms_dept_identify where dept_id=#{deptId}
185
+  </select>
162 186
 </mapper>

+ 45
- 36
ruoyi-system/src/main/resources/mapper/wisdomarbitrate/sendrecord/SmsRecordMapper.xml Ver fichero

@@ -5,28 +5,27 @@
5 5
 
6 6
 <mapper namespace="com.ruoyi.wisdomarbitrate.mapper.sendrecord.SmsRecordMapper">
7 7
     <resultMap type="com.ruoyi.wisdomarbitrate.domain.dto.sendrecord.SmsSendRecord" id="SmsSendRecordResult">
8
-        <id property="id" column="id"/>
9
-        <result property="caseId" column="case_appli_id"/>
10
-        <result property="caseNum" column="case_num"/>
11
-        <result property="phone" column="phone"/>
12
-        <result property="sendTime" column="send_time"/>
13
-        <result property="sendContent" column="send_content"/>
14
-        <result property="createTime" column="create_time"/>
15
-        <result property="updateTime" column="update_time"/>
16
-        <result property="createBy" column="create_by"/>
17
-        <result property="updateBy" column="update_by"/>
18
-        <result property="sendStatus" column="send_status"/>
19
-        <result property="sid" column="sid"/>
8
+        <id     property="id"       column="id"      />
9
+        <result property="caseId"       column="case_appli_id"      />
10
+        <result property="msSmsTemplateId"       column="ms_sms_template_id"      />
11
+        <result property="caseNum"       column="case_num"      />
12
+        <result property="phone"     column="phone"    />
13
+        <result property="sendTime"     column="send_time"    />
14
+        <result property="createTime"   column="create_time"  />
15
+        <result property="updateTime"   column="update_time"  />
16
+        <result property="createBy"   column="create_by"  />
17
+        <result property="updateBy"   column="update_by"  />
18
+        <result property="sendStatus"   column="send_status"  />
19
+        <result property="sid"   column="sid"  />
20 20
     </resultMap>
21
-    <insert id="saveSmsSendRecord" parameterType="com.ruoyi.wisdomarbitrate.domain.dto.sendrecord.SmsSendRecord"
22
-            useGeneratedKeys="true" keyProperty="id">
21
+    <insert id="saveSmsSendRecord" parameterType="com.ruoyi.wisdomarbitrate.domain.dto.sendrecord.SmsSendRecord" useGeneratedKeys="true" keyProperty="id">
23 22
 
24 23
         insert into ms_sms_send_record(
25 24
         <if test="caseId != null ">case_appli_id,</if>
26 25
         <if test="caseNum != null ">case_num,</if>
27 26
         <if test="phone != null and phone != ''">phone,</if>
28 27
         <if test="sendTime != null ">send_time,</if>
29
-        <if test="sendContent != null ">send_content,</if>
28
+        <if test="msSmsTemplateId != null ">ms_sms_template_id,</if>
30 29
         <if test="createBy != null and createBy != ''">create_by,</if>
31 30
         <if test="sendStatus != null ">send_status,</if>
32 31
         sid,
@@ -37,7 +36,7 @@
37 36
         <if test="caseNum != null ">#{caseNum},</if>
38 37
         <if test="phone != null and phone != ''">#{phone},</if>
39 38
         <if test="sendTime != null ">#{sendTime},</if>
40
-        <if test="sendContent != null ">#{sendContent},</if>
39
+        <if test="msSmsTemplateId != null ">#{msSmsTemplateId},</if>
41 40
         <if test="createBy != null  and createBy != ''">#{createBy},</if>
42 41
         <if test="sendStatus != null ">#{sendStatus},</if>
43 42
         #{sid},
@@ -48,27 +47,27 @@
48 47
     <insert id="batchSaveSmsSendRecord">
49 48
 
50 49
         insert into ms_sms_send_record(
51
-        case_appli_id,
52
-        case_num,
53
-        phone,
54
-        send_time,
55
-        send_content,
56
-        create_by,
57
-        send_status,
50
+       case_appli_id,
51
+       case_num,
52
+       phone,
53
+       send_time,
54
+        ms_sms_template_id,
55
+       create_by,
56
+       send_status,
58 57
         create_time,
59 58
         sid,reason
60 59
         )values
61 60
         <foreach item="item" index="index" collection="list" separator=",">
62
-            (
63
-            #{item.caseId},
64
-            #{item.caseNum},
65
-            #{item.phone},
66
-            #{item.sendTime},
67
-            #{item.sendContent},
68
-            #{item.createBy},
69
-            #{item.sendStatus},
70
-            sysdate(),#{sid},#{reason}
71
-            )
61
+        (
62
+        #{item.caseId},
63
+        #{item.caseNum},
64
+        #{item.phone},
65
+        #{item.sendTime},
66
+        #{item.msSmsTemplateId},
67
+        #{item.createBy},
68
+        #{item.sendStatus},
69
+        sysdate(),#{sid},#{reason}
70
+        )
72 71
         </foreach>
73 72
     </insert>
74 73
 
@@ -97,10 +96,20 @@
97 96
             reason=#{reason}
98 97
         where sid = #{sid}
99 98
     </update>
100
-    <update id="updateSendContent">
99
+    <update id="update">
101 100
         update ms_sms_send_record
102
-        set send_content= #{sendContent},
103
-            update_time=#{updateTime}
101
+        <set>
102
+            <if test="caseId != null ">case_appli_id = #{caseId},</if>
103
+            <if test="caseNum != null and caseNum != '' ">case_num = #{caseNum},</if>
104
+            <if test="phone != null and phone != ''">phone = #{phone},</if>
105
+
106
+            <if test="sendTime != null ">send_time = #{sendTime},</if>
107
+            <if test="msSmsTemplateId != null ">ms_sms_template_id = #{msSmsTemplateId},
108
+            </if>
109
+            <if test="sendStatus != null ">send_status = #{sendStatus},</if>
110
+            <if test="sid != null and sid != '' ">sid = #{sid},</if>
111
+            reason = #{reason}
112
+        </set>
104 113
         where id = #{id}
105 114
     </update>
106 115