18792927508 2 anni fa
parent
commit
e00d61949b

+ 16
- 3
ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/miniprogress/WeChatUserController.java Vedi File

4
 import com.ruoyi.common.annotation.Anonymous;
4
 import com.ruoyi.common.annotation.Anonymous;
5
 import com.ruoyi.common.core.controller.BaseController;
5
 import com.ruoyi.common.core.controller.BaseController;
6
 import com.ruoyi.common.core.domain.AjaxResult;
6
 import com.ruoyi.common.core.domain.AjaxResult;
7
+import com.ruoyi.common.core.domain.entity.SysRole;
8
+import com.ruoyi.system.mapper.SysRoleMapper;
7
 import com.ruoyi.wisdomarbitrate.domain.dto.miniprogress.IdentityAuthentication;
9
 import com.ruoyi.wisdomarbitrate.domain.dto.miniprogress.IdentityAuthentication;
8
 import com.ruoyi.wisdomarbitrate.domain.vo.miniprogress.WeChatUserVO;
10
 import com.ruoyi.wisdomarbitrate.domain.vo.miniprogress.WeChatUserVO;
9
 import com.ruoyi.wisdomarbitrate.service.miniprogress.WeChatUserService;
11
 import com.ruoyi.wisdomarbitrate.service.miniprogress.WeChatUserService;
10
 import org.springframework.beans.factory.annotation.Autowired;
12
 import org.springframework.beans.factory.annotation.Autowired;
11
 import org.springframework.web.bind.annotation.*;
13
 import org.springframework.web.bind.annotation.*;
12
 
14
 
15
+import java.util.List;
16
+
13
 /**
17
 /**
14
  * @author wangqiong
18
  * @author wangqiong
15
  * @description 微信小程序用户注册登录
19
  * @description 微信小程序用户注册登录
20
 public class WeChatUserController extends BaseController {
24
 public class WeChatUserController extends BaseController {
21
     @Autowired
25
     @Autowired
22
     private WeChatUserService weChatUserService;
26
     private WeChatUserService weChatUserService;
23
-
27
+    @Autowired
28
+    private SysRoleMapper roleMapper;
24
     /**
29
     /**
25
      * 小程序端获取手机验证码
30
      * 小程序端获取手机验证码
26
      * @param userVO
31
      * @param userVO
35
         }
40
         }
36
         return weChatUserService.sendCode(userVO);
41
         return weChatUserService.sendCode(userVO);
37
     }
42
     }
43
+    @Anonymous
44
+    @GetMapping("/roles")
45
+    public AjaxResult roles()
46
+    {
47
+        List<SysRole> list = roleMapper.selectRoleAll();
48
+        return AjaxResult.success(list);
49
+    }
38
     /**
50
     /**
39
      * 小程序注册
51
      * 小程序注册
40
      */
52
      */
41
     @Anonymous
53
     @Anonymous
42
     @PostMapping("/registerUser")
54
     @PostMapping("/registerUser")
43
     public AjaxResult registerUser( @RequestBody IdentityAuthentication ientityAuthentication) {
55
     public AjaxResult registerUser( @RequestBody IdentityAuthentication ientityAuthentication) {
44
-        if(ientityAuthentication.getId()==null
45
-                || StrUtil.isEmpty(ientityAuthentication.getName())
56
+        if(
57
+             //   ientityAuthentication.getId()==null ||
58
+                 StrUtil.isEmpty(ientityAuthentication.getName())
46
                 || StrUtil.isEmpty(ientityAuthentication.getIdentityNo())
59
                 || StrUtil.isEmpty(ientityAuthentication.getIdentityNo())
47
                 || StrUtil.isEmpty(ientityAuthentication.getPhone())
60
                 || StrUtil.isEmpty(ientityAuthentication.getPhone())
48
                 || StrUtil.isEmpty(ientityAuthentication.getUserName())
61
                 || StrUtil.isEmpty(ientityAuthentication.getUserName())

+ 1
- 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/mscase/MsCaseApplicationPayController.java Vedi File

102
                 || dto.getCaseFlowId() == null) {
102
                 || dto.getCaseFlowId() == null) {
103
             return error("参数校验失败");
103
             return error("参数校验失败");
104
         }
104
         }
105
+        dto.setApplicantConfirm(false);
105
         return casePaymentService.confirmPaid(dto);
106
         return casePaymentService.confirmPaid(dto);
106
     }
107
     }
107
 }
108
 }

+ 4
- 0
ruoyi-common/src/main/java/com/ruoyi/common/constant/CacheConstants.java Vedi File

42
      */
42
      */
43
     public static final String PWD_ERR_CNT_KEY = "pwd_err_cnt:";
43
     public static final String PWD_ERR_CNT_KEY = "pwd_err_cnt:";
44
     public static final String  WE_CHAT_SMS_VERIFY_CODE_KEY="we_chat_sms_verify_code:";
44
     public static final String  WE_CHAT_SMS_VERIFY_CODE_KEY="we_chat_sms_verify_code:";
45
+    /**
46
+     * 案件 redis key
47
+     */
48
+    public static final String CASE_KEY = "case_codes:";
45
 }
49
 }

+ 29
- 2
ruoyi-framework/src/main/java/com/ruoyi/framework/config/RedisConfig.java Vedi File

1
 package com.ruoyi.framework.config;
1
 package com.ruoyi.framework.config;
2
 
2
 
3
+import cn.hutool.core.util.StrUtil;
4
+import com.ruoyi.common.constant.CacheConstants;
5
+import com.ruoyi.common.core.redis.RedisCache;
6
+import com.ruoyi.common.utils.StringUtils;
7
+import com.ruoyi.common.utils.spring.SpringUtils;
3
 import com.ruoyi.wisdomarbitrate.service.mscase.MsCaseApplicationService;
8
 import com.ruoyi.wisdomarbitrate.service.mscase.MsCaseApplicationService;
4
 import org.springframework.cache.annotation.CachingConfigurerSupport;
9
 import org.springframework.cache.annotation.CachingConfigurerSupport;
5
 import org.springframework.cache.annotation.EnableCaching;
10
 import org.springframework.cache.annotation.EnableCaching;
75
     public ApplicationListener applicationListener() {
80
     public ApplicationListener applicationListener() {
76
         return (ApplicationListener<RedisKeyExpiredEvent>) event -> {
81
         return (ApplicationListener<RedisKeyExpiredEvent>) event -> {
77
             String key = new String(event.getSource());
82
             String key = new String(event.getSource());
78
-           // 根据key查询案件表
79
-            caseApplicationService.notAccept(key,"已超过案件受理期限五日,");
83
+            if(key.startsWith(CacheConstants.CASE_KEY)) {
84
+                String[] split = key.split(CacheConstants.CASE_KEY);
85
+                if(split.length>1 && StrUtil.isNotEmpty(split[1])) {
86
+                    caseApplicationService.notAccept(split[1], "已超过案件受理期限五日,");
87
+                }
88
+            }
80
         };
89
         };
81
     }
90
     }
91
+    /**
92
+     * 获取字典缓存
93
+     *
94
+     * @param key 参数键
95
+     * @return dictDatas 字典数据列表
96
+     */
97
+    public static String getCodeCache(String key)
98
+    {
99
+        String codeCache = SpringUtils.getBean(RedisCache.class).getCacheObject(getVerifyCodeCacheKey(key));
100
+        if (StringUtils.isNotNull(codeCache))
101
+        {
102
+            return codeCache;
103
+        }
104
+        return null;
105
+    }
106
+    private static String getVerifyCodeCacheKey(String key) {
107
+        return CacheConstants.CASE_KEY + key;
108
+    }
82
     /**
109
     /**
83
      * 限流脚本
110
      * 限流脚本
84
      */
111
      */

+ 4
- 1
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/vo/mscase/MsCaseApplicationReq.java Vedi File

103
      * 附件
103
      * 附件
104
      */
104
      */
105
     private List<MsCaseAttach> attachList;
105
     private List<MsCaseAttach> attachList;
106
-
106
+    /**
107
+     * 代理人电话
108
+     */
109
+    private String contactTelphoneAgent;
107
 
110
 
108
 }
111
 }

+ 4
- 4
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/mscase/MsCaseApplicationMapper.java Vedi File

46
             "    AND c.mediator_id = #{req.mediatorId} " +
46
             "    AND c.mediator_id = #{req.mediatorId} " +
47
             "</if> "
47
             "</if> "
48
             +
48
             +
49
-            "<if test='req.applicantFlag != null and req.applicationOrganIds != null and req.applicationOrganIds.size() > 0  '> and  a.application_id in" +
49
+            "<if test='req.applicantFlag != null and req.applicationOrganIds != null and req.applicationOrganIds.size() > 0  '> and  (a.application_id in" +
50
             "<foreach item='organId' index='index' collection='req.applicationOrganIds' open='(' separator=',' close=')'>" +
50
             "<foreach item='organId' index='index' collection='req.applicationOrganIds' open='(' separator=',' close=')'>" +
51
             "#{organId}" +
51
             "#{organId}" +
52
-            "</foreach>" +
52
+            "</foreach> or a.contact_telphone_agent=#{req.contactTelphoneAgent} )" +
53
             "</if> "
53
             "</if> "
54
             +
54
             +
55
             "<if test='caseStatusNames != null and caseStatusNames.size() > 0 '> and  c.case_status_name in" +
55
             "<if test='caseStatusNames != null and caseStatusNames.size() > 0 '> and  c.case_status_name in" +
100
             "</if> "
100
             "</if> "
101
             +
101
             +
102
 
102
 
103
-            "<if test='req.applicantFlag != null and req.applicationOrganIds != null and req.applicationOrganIds.size() > 0  '> and  a.application_id in" +
103
+            "<if test='req.applicantFlag != null and req.applicationOrganIds != null and req.applicationOrganIds.size() > 0  '> and  (a.application_id in" +
104
             "<foreach item='organId' index='index' collection='req.applicationOrganIds' open='(' separator=',' close=')'>" +
104
             "<foreach item='organId' index='index' collection='req.applicationOrganIds' open='(' separator=',' close=')'>" +
105
             "#{organId}" +
105
             "#{organId}" +
106
-            "</foreach>" +
106
+            "</foreach>  or a.contact_telphone_agent=#{req.contactTelphoneAgent} )" +
107
             "</if> "
107
             "</if> "
108
             +
108
             +
109
             "<if test='caseStatusNames != null and caseStatusNames.size() > 0 '> and  c1.case_status_name in" +
109
             "<if test='caseStatusNames != null and caseStatusNames.size() > 0 '> and  c1.case_status_name in" +

+ 52
- 42
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/mscase/impl/MsCaseApplicationServiceImpl.java Vedi File

168
             throw new ServiceException("该用户未指定角色");
168
             throw new ServiceException("该用户未指定角色");
169
         }
169
         }
170
         req.setUserName(SecurityUtils.getUsername());
170
         req.setUserName(SecurityUtils.getUsername());
171
-
171
+        req.setContactTelphoneAgent(sysUser.getPhonenumber());
172
         // 根据角色查询关联的案件状态
172
         // 根据角色查询关联的案件状态
173
         Example example = new Example(MsCaseFlowRoleRelated.class);
173
         Example example = new Example(MsCaseFlowRoleRelated.class);
174
         example.createCriteria().andIn("roleid", roles.stream().map(SysRole::getRoleId).collect(Collectors.toList()));
174
         example.createCriteria().andIn("roleid", roles.stream().map(SysRole::getRoleId).collect(Collectors.toList()));
491
         // 为null则不更新
491
         // 为null则不更新
492
         msCaseApplicationMapper.updateByPrimaryKeySelective(caseApplication);
492
         msCaseApplicationMapper.updateByPrimaryKeySelective(caseApplication);
493
         MsCaseAffiliate affiliate = caseApplication.getAffiliate();
493
         MsCaseAffiliate affiliate = caseApplication.getAffiliate();
494
-        if (affiliate != null) {
494
+        if (affiliate == null) {
495
+            return AjaxResult.error("案件相关人员未填写");
496
+        }
495
             affiliate.setCaseAppliId(caseApplication.getId());
497
             affiliate.setCaseAppliId(caseApplication.getId());
496
             // 设置申请人
498
             // 设置申请人
497
             if (StrUtil.isNotEmpty(affiliate.getApplicationName())&&affiliate.getOrganizeFlag()==1) {
499
             if (StrUtil.isNotEmpty(affiliate.getApplicationName())&&affiliate.getOrganizeFlag()==1) {
510
                 affiliate.setRespondentEmail(affiliate.getRespondentEmail().replace("\n", "").replaceAll("\\s", ""));
512
                 affiliate.setRespondentEmail(affiliate.getRespondentEmail().replace("\n", "").replaceAll("\\s", ""));
511
             }
513
             }
512
             msCaseAffiliateMapper.updateByPrimaryKeySelective(affiliate);
514
             msCaseAffiliateMapper.updateByPrimaryKeySelective(affiliate);
513
-        }
515
+
514
         if (CollectionUtil.isNotEmpty(caseApplication.getCaseAttachList())) {
516
         if (CollectionUtil.isNotEmpty(caseApplication.getCaseAttachList())) {
515
             for (MsCaseAttach caseAttach : caseApplication.getCaseAttachList()) {
517
             for (MsCaseAttach caseAttach : caseApplication.getCaseAttachList()) {
516
                 caseAttach.setCaseAppliId(caseApplication.getId());
518
                 caseAttach.setCaseAppliId(caseApplication.getId());
521
             columnValueMapper.batchUpdate(caseApplication.getColumnValueList());
523
             columnValueMapper.batchUpdate(caseApplication.getColumnValueList());
522
         }
524
         }
523
 
525
 
524
-        Integer caseFlowId = caseApplication.getCaseFlowId();
525
-        // 查询当前流程节点
526
-        MsCaseFlow currentFlow = caseFlowMapper.selectByPrimaryKey(caseFlowId);
527
-        if (currentFlow == null) {
528
-            throw new ServiceException("未找到当前流程节点");
526
+        // 生成调解申请书
527
+        // 根据角色获取案件流程
528
+        List<MsCaseFlow> caseFlows=  selectCaseFlows();
529
+        if (CollectionUtil.isEmpty(caseFlows)) {
530
+            throw new ServiceException("该角色为绑定案件流程");
529
         }
531
         }
532
+        MsCaseFlow caseFlow = caseFlows.get(0);
533
+        MsCaseApplication selectByPrimaryKey = msCaseApplicationMapper.selectByPrimaryKey(caseApplication.getId());
534
+        MsCaseApplicationReq req = new MsCaseApplicationReq();
535
+        req.setCaseFlowId(caseFlow.getId());
536
+        req.setId(caseApplication.getId());
537
+        if(affiliate.getOrganizeFlag()==0){
538
+            // 自然人
539
+            req.setTemplateType(TemplateTypeEnum.PERSON_MEDIATION_APPLICATION.getCode());
540
+        }else {
541
+            // 机构
542
+            req.setTemplateType(TemplateTypeEnum.MEDIATION_APPLICATION.getCode());
543
+        }
544
+        req.setTemplateId(String.valueOf(selectByPrimaryKey.getTemplateId()));
545
+
546
+        caseApplicationService.generateApplication(req);
530
         // 新增日志
547
         // 新增日志
531
-        CaseLogUtils.insertCaseLog(caseApplication.getId(), currentFlow.getNodeId(), currentFlow.getCaseStatusName(),"修改案件");
548
+        CaseLogUtils.insertCaseLog(caseApplication.getId(), 0, "修改案件",null);
532
 
549
 
533
         return AjaxResult.success("修改成功");
550
         return AjaxResult.success("修改成功");
534
     }
551
     }
937
             }
954
             }
938
             for (MsCaseApplication application : list) {
955
             for (MsCaseApplication application : list) {
939
                 MsCaseFlow caseFlow = caseApplicationService.nextFlow(application.getId(), req.getCaseFlowId(), YesOrNoEnum.NO.getCode());
956
                 MsCaseFlow caseFlow = caseApplicationService.nextFlow(application.getId(), req.getCaseFlowId(), YesOrNoEnum.NO.getCode());
940
-
941
-                CaseLogUtils.insertCaseLog(application.getId(), caseFlow.getNodeId(), caseFlow.getCaseStatusName(), "提交成功");
942
             }
957
             }
943
         }else {
958
         }else {
944
             MsCaseFlow caseFlow = caseApplicationService.nextFlow(req.getId(), req.getCaseFlowId(), YesOrNoEnum.NO.getCode());
959
             MsCaseFlow caseFlow = caseApplicationService.nextFlow(req.getId(), req.getCaseFlowId(), YesOrNoEnum.NO.getCode());
945
 
960
 
946
-            CaseLogUtils.insertCaseLog(req.getId(), caseFlow.getNodeId(), caseFlow.getCaseStatusName(), "提交成功");
947
-
948
         }
961
         }
949
         return AjaxResult.success("提交成功");
962
         return AjaxResult.success("提交成功");
950
     }
963
     }
1105
                 return AjaxResult.error("被申请人身份证为空");
1118
                 return AjaxResult.error("被申请人身份证为空");
1106
             }
1119
             }
1107
                 // 判断被申请人信息查询案件预约表
1120
                 // 判断被申请人信息查询案件预约表
1108
-                isReservation( vo,userIds);
1121
+            caseApplicationService. isReservation( vo,userIds);
1109
 
1122
 
1110
         } else {
1123
         } else {
1111
             // 被申请人预约
1124
             // 被申请人预约
1112
             // 新增日志
1125
             // 新增日志
1113
             CaseLogUtils.insertCaseLog(vo.getId(), currentFlow.getNodeId(), currentFlow.getCaseStatusName(), "被申请人选择调解员");
1126
             CaseLogUtils.insertCaseLog(vo.getId(), currentFlow.getNodeId(), currentFlow.getCaseStatusName(), "被申请人选择调解员");
1114
-//            if (StrUtil.isEmpty(msCaseAffiliate.getContactTelphoneAgent())|| StrUtil.isEmpty(msCaseAffiliate.getApplicationPhone())) {
1115
-//                return AjaxResult.error("申请代理人手机号为空");
1116
-//            }
1117
             // 判断申请人是否预约
1127
             // 判断申请人是否预约
1118
             caseApplicationService. isReservation( vo,userIds);
1128
             caseApplicationService. isReservation( vo,userIds);
1119
 
1129
 
1194
             application.setCaseStatusName(nextFlow.getCaseStatusName());
1204
             application.setCaseStatusName(nextFlow.getCaseStatusName());
1195
             application.setLockStatus(null);
1205
             application.setLockStatus(null);
1196
             msCaseApplicationMapper.updateByPrimaryKeySelective(application);
1206
             msCaseApplicationMapper.updateByPrimaryKeySelective(application);
1197
-            // 新增日志
1198
-//            if(vo.getMiniProgressFlag() == null || vo.getMiniProgressFlag().equals( YesOrNoEnum.NO.getCode())) {
1199
-//                CaseLogUtils.insertCaseLog(vo.getId(), nextFlow.getNodeId(), nextFlow.getCaseStatusName(), "申请人选择调解员");
1200
-//            }else {
1201
-//                CaseLogUtils.insertCaseLog(vo.getId(), nextFlow.getNodeId(), nextFlow.getCaseStatusName(), "被申请人选择调解员");
1202
-//
1203
-//            }
1204
 
1207
 
1205
         }
1208
         }
1206
     }
1209
     }
1221
                 return AjaxResult.error("该批次号下未找到案件");
1224
                 return AjaxResult.error("该批次号下未找到案件");
1222
             }
1225
             }
1223
             for (MsCaseApplication application : list) {
1226
             for (MsCaseApplication application : list) {
1224
-                verifyMediator(application,vo);
1227
+                caseApplicationService.verifyMediator(application,vo);
1225
             }
1228
             }
1226
         }else {
1229
         }else {
1227
             MsCaseApplication application = new MsCaseApplication();
1230
             MsCaseApplication application = new MsCaseApplication();
1228
             application.setId(vo.getId());
1231
             application.setId(vo.getId());
1229
-            verifyMediator(application,vo);
1232
+            caseApplicationService.verifyMediator(application,vo);
1230
         }
1233
         }
1231
         return AjaxResult.success();
1234
         return AjaxResult.success();
1232
     }
1235
     }
1271
         }else {
1274
         }else {
1272
             phone=affiliate.getContactTelphoneAgent();
1275
             phone=affiliate.getContactTelphoneAgent();
1273
         }
1276
         }
1274
-
1277
+        caseApplication.setHearDate(application.getHearDate());
1275
         // 申请人发送开庭日期短信
1278
         // 申请人发送开庭日期短信
1276
-        sendHearDateSms(application,phone);
1279
+        sendHearDateSms(caseApplication,phone);
1277
         // 被申发送开庭日期短信
1280
         // 被申发送开庭日期短信
1278
-        sendHearDateSms(application,affiliate.getRespondentPhone());
1281
+        sendHearDateSms(caseApplication,affiliate.getRespondentPhone());
1279
         // 调解员发送短信
1282
         // 调解员发送短信
1280
        // 根据调解员id查询用户
1283
        // 根据调解员id查询用户
1281
-        if(application.getMediatorId()!=null) {
1282
-            SysUser sysUser = sysUserMapper.selectUserById(application.getMediatorId());
1283
-            sendHearDateSms(application, sysUser.getPhonenumber());
1284
+        if(caseApplication.getMediatorId()!=null) {
1285
+            SysUser sysUser = sysUserMapper.selectUserById(caseApplication.getMediatorId());
1286
+            sendHearDateSms(caseApplication, sysUser.getPhonenumber());
1284
         }
1287
         }
1285
         // 新增日志
1288
         // 新增日志
1286
-        CaseLogUtils.insertCaseLog(application.getId(), nextFlow.getNodeId(), nextFlow.getCaseStatusName(), "");
1289
+        CaseLogUtils.insertCaseLog(caseApplication.getId(), nextFlow.getNodeId(), nextFlow.getCaseStatusName(), "");
1287
 
1290
 
1288
     }
1291
     }
1289
 
1292
 
1319
         if(StrUtil.isEmpty(caseId)){
1322
         if(StrUtil.isEmpty(caseId)){
1320
             return;
1323
             return;
1321
         }
1324
         }
1325
+        // todo
1322
         Long id = Long.valueOf(caseId);
1326
         Long id = Long.valueOf(caseId);
1323
         // 根据案件id查询案件
1327
         // 根据案件id查询案件
1324
         MsCaseApplication application = msCaseApplicationMapper.selectByPrimaryKey(id);
1328
         MsCaseApplication application = msCaseApplicationMapper.selectByPrimaryKey(id);
2082
             req.setTemplateType(TemplateTypeEnum.MEDIATION_AGREEMENT.getCode());
2086
             req.setTemplateType(TemplateTypeEnum.MEDIATION_AGREEMENT.getCode());
2083
 
2087
 
2084
         }
2088
         }
2085
-        AjaxResult result = generateApplication(req);
2089
+        AjaxResult result = caseApplicationService.generateApplication(req);
2086
         return AjaxResult.success();
2090
         return AjaxResult.success();
2087
     }
2091
     }
2088
 
2092
 
2854
 
2858
 
2855
         String month = String.format("%02d", now.getMonthValue());
2859
         String month = String.format("%02d", now.getMonthValue());
2856
         String day = String.format("%02d", now.getDayOfMonth());
2860
         String day = String.format("%02d", now.getDayOfMonth());
2857
-        // todo
2858
         String saveFolderPath = RuoYiConfig.getUploadPath()+"/"+ year + "/" + month + "/" + day;
2861
         String saveFolderPath = RuoYiConfig.getUploadPath()+"/"+ year + "/" + month + "/" + day;
2859
-        Integer annexType = AnnexTypeEnum.MEDIATION_APPLICATION.getCode();
2862
+        Integer annexType = null;
2863
+        if(templateType==null
2864
+                || templateType.equals(TemplateTypeEnum.MEDIATION_APPLICATION.getCode())
2865
+                || templateType.equals(TemplateTypeEnum.PERSON_MEDIATION_APPLICATION.getCode()) ){
2866
+            // 调解申请书
2867
+            annexType = AnnexTypeEnum.MEDIATION_APPLICATION.getCode();
2868
+        }else if(templateType.equals(TemplateTypeEnum.MEDIATION_AGREEMENT.getCode())
2869
+                || templateType.equals(TemplateTypeEnum.MEDIATE_BOOK.getCode()) ){
2870
+            // 调解书和解协议
2871
+            annexType = AnnexTypeEnum.MEDIATE_BOOK.getCode();
2872
+        }
2873
+
2860
         String orgFileName = "调解申请书";
2874
         String orgFileName = "调解申请书";
2861
-        if(templateType!=null&&templateType==3) {
2875
+        if (annexType != null && annexType.equals(AnnexTypeEnum.MEDIATE_BOOK.getCode())) {
2862
             orgFileName = "调解书";
2876
             orgFileName = "调解书";
2863
-            annexType=AnnexTypeEnum.MEDIATE_BOOK.getCode();
2864
         }
2877
         }
2865
         String fileName = UUID.randomUUID().toString().replace("-", "")+orgFileName + ".docx";
2878
         String fileName = UUID.randomUUID().toString().replace("-", "")+orgFileName + ".docx";
2866
         String resultFilePath = saveFolderPath + "/" + fileName;
2879
         String resultFilePath = saveFolderPath + "/" + fileName;
2874
                 .annexType(annexType)
2887
                 .annexType(annexType)
2875
                 .build();
2888
                 .build();
2876
         //保存到附件表里,先删除之前的在保存
2889
         //保存到附件表里,先删除之前的在保存
2877
-        msCaseAttachMapper.deleteCaseAttachByCasedIdAndType(caseAttach.getCaseAppliId(), AnnexTypeEnum.MEDIATION_APPLICATION.getCode());
2878
-        if (templateType!=null&&templateType==3) {
2879
-            msCaseAttachMapper.deleteCaseAttachByCasedIdAndType(caseAttach.getCaseAppliId(), AnnexTypeEnum.MEDIATE_BOOK.getCode());
2880
-        }
2890
+        msCaseAttachMapper.deleteCaseAttachByCasedIdAndType(caseAttach.getCaseAppliId(), annexType);
2881
         msCaseAttachMapper.save(caseAttach);
2891
         msCaseAttachMapper.save(caseAttach);
2882
     }
2892
     }
2883
 
2893
 

+ 11
- 2
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/mscase/impl/MsCasePaymentServiceImpl.java Vedi File

5
 import cn.hutool.core.util.StrUtil;
5
 import cn.hutool.core.util.StrUtil;
6
 import cn.hutool.json.JSONObject;
6
 import cn.hutool.json.JSONObject;
7
 import com.ruoyi.ElegentPay;
7
 import com.ruoyi.ElegentPay;
8
+import com.ruoyi.common.constant.CacheConstants;
8
 import com.ruoyi.common.constant.Constants;
9
 import com.ruoyi.common.constant.Constants;
9
 import com.ruoyi.common.core.domain.AjaxResult;
10
 import com.ruoyi.common.core.domain.AjaxResult;
10
 import com.ruoyi.common.core.redis.RedisCache;
11
 import com.ruoyi.common.core.redis.RedisCache;
13
 import com.ruoyi.common.enums.YesOrNoEnum;
14
 import com.ruoyi.common.enums.YesOrNoEnum;
14
 import com.ruoyi.common.utils.SecurityUtils;
15
 import com.ruoyi.common.utils.SecurityUtils;
15
 import com.ruoyi.common.utils.SmsUtils;
16
 import com.ruoyi.common.utils.SmsUtils;
17
+import com.ruoyi.common.utils.spring.SpringUtils;
16
 import com.ruoyi.dto.PayRequest;
18
 import com.ruoyi.dto.PayRequest;
17
 import com.ruoyi.dto.PayResponse;
19
 import com.ruoyi.dto.PayResponse;
18
 import com.ruoyi.system.domain.entity.flow.MsCaseFlow;
20
 import com.ruoyi.system.domain.entity.flow.MsCaseFlow;
342
         caseApplicationMapper.updateByPrimaryKeySelective(application);
344
         caseApplicationMapper.updateByPrimaryKeySelective(application);
343
         if (dto.getApplicantConfirm() && dto.getYesOrNo().equals(YesOrNoEnum.YES.getCode())) {
345
         if (dto.getApplicantConfirm() && dto.getYesOrNo().equals(YesOrNoEnum.YES.getCode())) {
344
             // 申请人确认缴费后将该案件存放到redis,5日之内如果案件状态还是待受理状态,则发送不受理通知书并自动结束
346
             // 申请人确认缴费后将该案件存放到redis,5日之内如果案件状态还是待受理状态,则发送不受理通知书并自动结束
345
-            redisCache.setCacheObject(String.valueOf(application.getId()), application, Constants.CASE_ACCEPT_EXPIRATION, TimeUnit.DAYS);
347
+//            redisCache.setCacheObject(CacheConstants.CASE_KEY+application.getId(), application, Constants.CASE_ACCEPT_EXPIRATION, TimeUnit.DAYS);
348
+            SpringUtils.getBean(RedisCache.class).setCacheObject(getVerifyCodeCacheKey(String.valueOf(application.getId())), application, Constants.CASE_ACCEPT_EXPIRATION, TimeUnit.DAYS);
349
+
346
         }
350
         }
347
         // 新增日志
351
         // 新增日志
348
         if (dto.getYesOrNo().equals(YesOrNoEnum.YES.getCode())) {
352
         if (dto.getYesOrNo().equals(YesOrNoEnum.YES.getCode())) {
372
 
376
 
373
 
377
 
374
     }
378
     }
379
+
380
+
381
+    private static String getVerifyCodeCacheKey(String key) {
382
+        return CacheConstants.CASE_KEY + key;
383
+    }
375
     /**
384
     /**
376
      * 被申请人确认已缴费
385
      * 被申请人确认已缴费
377
      * @param dto
386
      * @param dto
440
                     smsSendRecord.setSendStatus(YesOrNoEnum.NO.getCode());
449
                     smsSendRecord.setSendStatus(YesOrNoEnum.NO.getCode());
441
                 }
450
                 }
442
                 smsRecordMapper.saveSmsSendRecord(smsSendRecord);
451
                 smsRecordMapper.saveSmsSendRecord(smsSendRecord);
443
-                if(dto.getApplicantConfirm()&& dto.getYesOrNo().equals(YesOrNoEnum.YES.getCode())) {
452
+                if(!dto.getApplicantConfirm()&& dto.getYesOrNo().equals(YesOrNoEnum.YES.getCode())) {
444
                     // 申请人发送受理短信
453
                     // 申请人发送受理短信
445
                     sendAcceptSms(dto, caseAppllication, userName, phone);
454
                     sendAcceptSms(dto, caseAppllication, userName, phone);
446
                     // 被申请人发送受理短信
455
                     // 被申请人发送受理短信

+ 8
- 2
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/mscase/impl/MsSignSealServiceImpl.java Vedi File

639
                     }
639
                     }
640
                 }
640
                 }
641
                 Integer caseFlowId = caseApplication1.getCaseFlowId();
641
                 Integer caseFlowId = caseApplication1.getCaseFlowId();
642
+                // 查询当前节点
643
+                MsCaseFlow currentFlow = caseFlowMapper.selectByPrimaryKey(caseFlowId);
644
+                if(currentFlow==null){
645
+                    return AjaxResult.error("未找到当前流程节点");
646
+                }
642
                 // 根据流程id查找下一个流程节点
647
                 // 根据流程id查找下一个流程节点
643
                 MsCaseFlow nextFlow = caseFlowMapper.nextFlow(caseFlowId);
648
                 MsCaseFlow nextFlow = caseFlowMapper.nextFlow(caseFlowId);
644
                 caseApplication1.setCaseFlowId(nextFlow.getId());
649
                 caseApplication1.setCaseFlowId(nextFlow.getId());
700
                 if(!resEmailFlag){
705
                 if(!resEmailFlag){
701
                     throw new ServiceException("被申请人调解书发送失败");
706
                     throw new ServiceException("被申请人调解书发送失败");
702
                 }
707
                 }
703
-                CaseLogUtils.insertCaseLog(caseApplication1.getId(), nextFlow.getNodeId(), nextFlow.getCaseStatusName(),"归档");
708
+
709
+                CaseLogUtils.insertCaseLog(caseApplication1.getId(), currentFlow.getNodeId(), currentFlow.getCaseStatusName(),"");
704
 
710
 
705
             }
711
             }
706
 
712
 
708
             throw new ServiceException("调解书发送失败");
714
             throw new ServiceException("调解书发送失败");
709
         }
715
         }
710
 
716
 
711
-        return AjaxResult.success("归档成功");
717
+        return AjaxResult.success("");
712
     }
718
     }
713
 
719
 
714
     @Override
720
     @Override

+ 7
- 1
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/mscase/impl/VideoConferenceServiceImpl.java Vedi File

9
 import com.ruoyi.common.core.domain.entity.SysRole;
9
 import com.ruoyi.common.core.domain.entity.SysRole;
10
 import com.ruoyi.common.core.domain.entity.SysUser;
10
 import com.ruoyi.common.core.domain.entity.SysUser;
11
 import com.ruoyi.common.enums.AnnexTypeEnum;
11
 import com.ruoyi.common.enums.AnnexTypeEnum;
12
+import com.ruoyi.common.exception.ServiceException;
12
 import com.ruoyi.common.utils.PdfUtils;
13
 import com.ruoyi.common.utils.PdfUtils;
13
 import com.ruoyi.common.utils.SecurityUtils;
14
 import com.ruoyi.common.utils.SecurityUtils;
14
 import com.ruoyi.system.mapper.SysRoleMapper;
15
 import com.ruoyi.system.mapper.SysRoleMapper;
178
     @Transactional
179
     @Transactional
179
     @Override
180
     @Override
180
     public String createRoomId(Long caseId) {
181
     public String createRoomId(Long caseId) {
182
+        // 查询案件
183
+        MsCaseApplication caseApplication = caseApplicationMapper.selectByPrimaryKey(caseId);
184
+        if(null == caseApplication){
185
+            throw new ServiceException("未找到该案件");
186
+        }
181
         long roomId = generateRoomId();
187
         long roomId = generateRoomId();
182
         // 绑定案件与房间号
188
         // 绑定案件与房间号
183
         bindCaseId(caseId, String.valueOf(roomId));
189
         bindCaseId(caseId, String.valueOf(roomId));
184
         // 新增预约会议表
190
         // 新增预约会议表
185
-        ReservedConference conference = new ReservedConference(caseId, SecurityUtils.getUserId(), roomId,
191
+        ReservedConference conference = new ReservedConference(caseId,caseApplication.getMediatorId(), roomId,
186
                 null, null);
192
                 null, null);
187
         // 先删除之前的会议
193
         // 先删除之前的会议
188
         reservedConferenceMapper.deletByCaseId(caseId);
194
         reservedConferenceMapper.deletByCaseId(caseId);