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

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

wangqiong123 пре 2 година
родитељ
комит
4a7194c9ea

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

278
      */
278
      */
279
     @PostMapping("/mediation")
279
     @PostMapping("/mediation")
280
     public AjaxResult mediation(@RequestBody MsCaseApplicationReq req) throws EsignDemoException, InterruptedException {
280
     public AjaxResult mediation(@RequestBody MsCaseApplicationReq req) throws EsignDemoException, InterruptedException {
281
-        if (req.getCaseFlowId() == null || req.getId() == null) {
281
+        if (req.getCaseFlowId() == null || req.getId() == null || req.getMediaResult()==null) {
282
             return error("参数校验失败");
282
             return error("参数校验失败");
283
         }
283
         }
284
 
284
 
285
         return caseApplicationService.mediation(req);
285
         return caseApplicationService.mediation(req);
286
     }
286
     }
287
+    /**
288
+     * 确定会议结果
289
+     * @param
290
+     * @return
291
+     */
292
+    @PostMapping("/confirmMeetingResult")
293
+    public AjaxResult confirmMeetingResult(@RequestBody MsCaseApplicationReq req) {
294
+        if (req.getCaseFlowId() == null || req.getId() == null || req.getMediaResult()==null) {
295
+            return error("参数校验失败");
296
+        }
297
+
298
+        return caseApplicationService.confirmMeetingResult(req);
299
+    }
287
     /**
300
     /**
288
      * 修改庭审笔录
301
      * 修改庭审笔录
289
      * @param
302
      * @param

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

10
  * @Created wangqiong
10
  * @Created wangqiong
11
  */
11
  */
12
 public enum TemplateTypeEnum implements EnumsInterface {
12
 public enum TemplateTypeEnum implements EnumsInterface {
13
-    MEDIATION_APPLICATION(1, "调解申请书模板"),
13
+    MEDIATION_APPLICATION(1, "机构调解申请书模板"),
14
     MEDIATION_AGREEMENT(2, "和解协议模板"),
14
     MEDIATION_AGREEMENT(2, "和解协议模板"),
15
     MEDIATE_BOOK(3, "调解书模板"),
15
     MEDIATE_BOOK(3, "调解书模板"),
16
+    PERSON_MEDIATION_APPLICATION(4, "自然人调解申请书模板"),
16
 
17
 
17
 
18
 
18
 
19
 

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

42
             "c.hear_date hearDate,c.case_status_name caseStatusName,c.create_time createTime from ms_case_application c " +
42
             "c.hear_date hearDate,c.case_status_name caseStatusName,c.create_time createTime from ms_case_application c " +
43
             "join ms_case_affiliate a on c.id=a.case_appli_id <where> "
43
             "join ms_case_affiliate a on c.id=a.case_appli_id <where> "
44
             +
44
             +
45
+            "<if test=\"req.mediatorId != null \">" +
46
+            "    AND c.mediator_id = #{req.mediatorId} " +
47
+            "</if> "
48
+            +
45
             "<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" +
46
             "<foreach item='organId' index='index' collection='req.applicationOrganIds' open='(' separator=',' close=')'>" +
50
             "<foreach item='organId' index='index' collection='req.applicationOrganIds' open='(' separator=',' close=')'>" +
47
             "#{organId}" +
51
             "#{organId}" +
87
             "join ms_case_affiliate a on c.id=a.case_appli_id  <where> r.create_by=#{req.userName}  and c.id not in (" +
91
             "join ms_case_affiliate a on c.id=a.case_appli_id  <where> r.create_by=#{req.userName}  and c.id not in (" +
88
             "select c1.id from  ms_case_application c1 JOIN ms_case_affiliate a1 ON a1.case_appli_id = c1.id"
92
             "select c1.id from  ms_case_application c1 JOIN ms_case_affiliate a1 ON a1.case_appli_id = c1.id"
89
             +
93
             +
94
+            "<if test=\"req.mediatorId != null \">" +
95
+            "    AND c1.mediator_id = #{req.mediatorId} " +
96
+            "</if> "
97
+            +
90
             "<if test=\"req.mediationMethod != null \">" +
98
             "<if test=\"req.mediationMethod != null \">" +
91
-            "    AND c.mediation_method = #{req.mediationMethod} " +
99
+            "    AND c1.mediation_method = #{req.mediationMethod} " +
92
             "</if> "
100
             "</if> "
93
             +
101
             +
94
 
102
 

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

641
         ajax.put("temName",list.get(0).getTemName());
641
         ajax.put("temName",list.get(0).getTemName());
642
         // 调节申请书
642
         // 调节申请书
643
         ajax.put("applicationFile",manageMap.get(TemplateTypeEnum.MEDIATION_APPLICATION.getCode()));
643
         ajax.put("applicationFile",manageMap.get(TemplateTypeEnum.MEDIATION_APPLICATION.getCode()));
644
+        ajax.put("personApplicationFile",manageMap.get(TemplateTypeEnum.PERSON_MEDIATION_APPLICATION.getCode()));
644
         // 和解协议
645
         // 和解协议
645
         ajax.put("agreementFile",manageMap.get(TemplateTypeEnum.MEDIATION_AGREEMENT.getCode()));
646
         ajax.put("agreementFile",manageMap.get(TemplateTypeEnum.MEDIATION_AGREEMENT.getCode()));
646
         // 调解书
647
         // 调解书

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

166
      * @return
166
      * @return
167
      */
167
      */
168
     AjaxResult mediation(MsCaseApplicationReq req) throws EsignDemoException, InterruptedException;
168
     AjaxResult mediation(MsCaseApplicationReq req) throws EsignDemoException, InterruptedException;
169
+    /**
170
+     * 确定会议结果
171
+     * @param req
172
+     * @return
173
+     */
174
+    AjaxResult confirmMeetingResult(MsCaseApplicationReq req);
169
 
175
 
170
     /**
176
     /**
171
      * 修改庭审笔录
177
      * 修改庭审笔录
227
      * @return
233
      * @return
228
      */
234
      */
229
     List<SmsSendRecord> getSmsSendRecord(SmsSendRecord smsSendRecord);
235
     List<SmsSendRecord> getSmsSendRecord(SmsSendRecord smsSendRecord);
236
+
237
+
230
 }
238
 }

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

168
             throw new ServiceException("该用户未指定角色");
168
             throw new ServiceException("该用户未指定角色");
169
         }
169
         }
170
         req.setUserName(SecurityUtils.getUsername());
170
         req.setUserName(SecurityUtils.getUsername());
171
+
171
         // 根据角色查询关联的案件状态
172
         // 根据角色查询关联的案件状态
172
         Example example = new Example(MsCaseFlowRoleRelated.class);
173
         Example example = new Example(MsCaseFlowRoleRelated.class);
173
         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()));
207
                     req.setRespondentIdentityNum(sysUser.getIdCard());
208
                     req.setRespondentIdentityNum(sysUser.getIdCard());
208
                     break;
209
                     break;
209
                 }
210
                 }
211
+                if(StrUtil.equals(role.getRoleName(),"调解员")) {
212
+                    req.setMediatorId(String.valueOf(sysUser.getUserId()));
213
+                    break;
214
+                }
210
             }
215
             }
211
         }
216
         }
212
         if(req.getMediationMethod()!=null){
217
         if(req.getMediationMethod()!=null){
333
                         req.setBatchNumber(caseApplication.getBatchNumber());
338
                         req.setBatchNumber(caseApplication.getBatchNumber());
334
                     }
339
                     }
335
                     // 生成调解申请书
340
                     // 生成调解申请书
336
-                    req.setTemplateType(TemplateTypeEnum.MEDIATION_APPLICATION.getCode());
341
+                    if(affiliate.getOrganizeFlag()==0){
342
+                        // 自然人
343
+                        req.setTemplateType(TemplateTypeEnum.PERSON_MEDIATION_APPLICATION.getCode());
344
+                    }else {
345
+                        // 机构
346
+                        req.setTemplateType(TemplateTypeEnum.MEDIATION_APPLICATION.getCode());
347
+                    }
337
                     req.setTemplateId(String.valueOf(templateId));
348
                     req.setTemplateId(String.valueOf(templateId));
338
 
349
 
339
                     caseApplicationService.generateApplication(req);
350
                     caseApplicationService.generateApplication(req);
892
         application.setUpdateTime(new Date());
903
         application.setUpdateTime(new Date());
893
         application.setBatchNumber(null);
904
         application.setBatchNumber(null);
894
         msCaseApplicationMapper.updateByPrimaryKeySelective(application);
905
         msCaseApplicationMapper.updateByPrimaryKeySelective(application);
895
-      //  MsCaseFlow caseFlow = caseApplicationService.nextFlow(application.getId(), req.getCaseFlowId(),req.getLockStatus());
896
-        // 给申请人被申请人发送短信
906
+        MsCaseFlow caseFlow = caseApplicationService.nextFlow(application.getId(), req.getCaseFlowId(),req.getLockStatus());
907
+        // 给被申请人发送短信
897
         if (affiliateMap.containsKey(application.getId())) {
908
         if (affiliateMap.containsKey(application.getId())) {
898
             MsCaseAffiliate affiliate = affiliateMap.get(application.getId());
909
             MsCaseAffiliate affiliate = affiliateMap.get(application.getId());
899
-
900
-//            if (StrUtil.isNotEmpty(affiliate.getContactTelphoneAgent())||StrUtil.isNotEmpty(affiliate.getApplicationPhone())) {
901
-//                String sendContent = "尊敬的" + affiliate.getNameAgent() + "用户,您的" + application.getCaseNum() + "案件,已成功受理,请知晓,如非本人操作,请忽略本短信";
902
-//                // 给申请人发送案件受理短信 尊敬的{1}用户,您的{2}仲裁案件,已成功受理,请知晓,如非本人操作,请忽略本短信
903
-//                Boolean smsFlag = SmsUtils.sendSms(application.getId(), "2073601", affiliate.getContactTelphoneAgent(), new String[]{affiliate.getNameAgent(), application.getCaseNum()});
904
-//             //   CaseLogUtils.insertCaseLog(application.getId(), caseFlow.getNodeId(), caseFlow.getNodeName(), "向申请人发送短信," + sendContent);
905
-//                SmsSendRecord smsSendRecord = new SmsSendRecord(application.getId(), application.getCaseNum(), affiliate.getContactTelphoneAgent(), new Date(), sendContent);
906
-//                if (smsFlag) {
907
-//                    // 发送成功
908
-//                    smsSendRecord.setSendStatus(YesOrNoEnum.YES.getCode());
909
-//                } else {
910
-//                    smsSendRecord.setSendStatus(YesOrNoEnum.NO.getCode());
911
-//                }
912
-//                smsRecordMapper.saveSmsSendRecord(smsSendRecord);
913
-//            }
914
             // 被申请人发送短信
910
             // 被申请人发送短信
915
             if (StrUtil.isNotEmpty(affiliate.getRespondentPhone())) {
911
             if (StrUtil.isNotEmpty(affiliate.getRespondentPhone())) {
916
                 String sendContent = "尊敬的用户,您的" + application.getCaseNum() + "的案件已成功提交,请登录调解系统进行缴费处理。请知晓,如非本人操作,请忽略本短信";
912
                 String sendContent = "尊敬的用户,您的" + application.getCaseNum() + "的案件已成功提交,请登录调解系统进行缴费处理。请知晓,如非本人操作,请忽略本短信";
1072
         }
1068
         }
1073
        // Integer miniProgressFlag = vo.getMiniProgressFlag() == null ? MediatorTypeEnum.PC.getCode() : vo.getMiniProgressFlag();
1069
        // Integer miniProgressFlag = vo.getMiniProgressFlag() == null ? MediatorTypeEnum.PC.getCode() : vo.getMiniProgressFlag();
1074
         // 预约,申请人预约为Null,否则为被申请人预约
1070
         // 预约,申请人预约为Null,否则为被申请人预约
1075
-        Integer miniProgressFlag=null;
1071
+        Integer miniProgressFlag=YesOrNoEnum.NO.getCode();
1076
         List<SysRole> roles = SecurityUtils.getLoginUser().getUser().getRoles();
1072
         List<SysRole> roles = SecurityUtils.getLoginUser().getUser().getRoles();
1077
         if(CollectionUtil.isNotEmpty(roles)){
1073
         if(CollectionUtil.isNotEmpty(roles)){
1078
             for (SysRole role : roles) {
1074
             for (SysRole role : roles) {
1081
                 }
1077
                 }
1082
             }
1078
             }
1083
         }
1079
         }
1084
-
1080
+        vo.setMiniProgressFlag(miniProgressFlag);
1085
         // 先删除已选择的调解员,在新增
1081
         // 先删除已选择的调解员,在新增
1086
         Example mediatorExample = new Example(MsCaseMediator.class);
1082
         Example mediatorExample = new Example(MsCaseMediator.class);
1087
         Example.Criteria mediatorCriteria = mediatorExample.createCriteria();
1083
         Example.Criteria mediatorCriteria = mediatorExample.createCriteria();
1103
         }
1099
         }
1104
 
1100
 
1105
         // 申请人预约
1101
         // 申请人预约
1106
-        if (vo.getMiniProgressFlag() == null) {
1102
+        if (vo.getMiniProgressFlag() == null || vo.getMiniProgressFlag().equals( YesOrNoEnum.NO.getCode())) {
1107
             // 新增日志
1103
             // 新增日志
1108
             CaseLogUtils.insertCaseLog(vo.getId(), currentFlow.getNodeId(), currentFlow.getCaseStatusName(), "申请人选择调解员");
1104
             CaseLogUtils.insertCaseLog(vo.getId(), currentFlow.getNodeId(), currentFlow.getCaseStatusName(), "申请人选择调解员");
1109
 
1105
 
1142
         Map<Long, SysUser> userMap = mediatorUsers.stream().collect(Collectors.toMap(SysUser::getUserId, Function.identity()));
1138
         Map<Long, SysUser> userMap = mediatorUsers.stream().collect(Collectors.toMap(SysUser::getUserId, Function.identity()));
1143
         Example example = new Example(MsCaseMediator.class);
1139
         Example example = new Example(MsCaseMediator.class);
1144
         Example.Criteria criteria = example.createCriteria();
1140
         Example.Criteria criteria = example.createCriteria();
1145
-        if(vo.getMiniProgressFlag() == null) {
1141
+        if(vo.getMiniProgressFlag() == null || vo.getMiniProgressFlag().equals( YesOrNoEnum.NO.getCode())) {
1146
             // 申请人预约,需要查询被申请人是否预约,identity_type不为空
1142
             // 申请人预约,需要查询被申请人是否预约,identity_type不为空
1147
             criteria.andEqualTo("type", MediatorTypeEnum.MI_NI_PROGRESS.getCode());
1143
             criteria.andEqualTo("type", MediatorTypeEnum.MI_NI_PROGRESS.getCode());
1148
         }else {
1144
         }else {
1149
-            // todo PC端被申请人选择调解员时,未存到预约表,导致节点状态未改变
1150
             // 被申请人预约,需要查询申请人是否预约,identity_type为空
1145
             // 被申请人预约,需要查询申请人是否预约,identity_type为空
1151
             criteria.andEqualTo("type", MediatorTypeEnum.PC.getCode());
1146
             criteria.andEqualTo("type", MediatorTypeEnum.PC.getCode());
1152
         }
1147
         }
1202
             application.setLockStatus(null);
1197
             application.setLockStatus(null);
1203
             msCaseApplicationMapper.updateByPrimaryKeySelective(application);
1198
             msCaseApplicationMapper.updateByPrimaryKeySelective(application);
1204
             // 新增日志
1199
             // 新增日志
1205
-            if(vo.getMiniProgressFlag() == null) {
1206
-                CaseLogUtils.insertCaseLog(vo.getId(), nextFlow.getNodeId(), nextFlow.getCaseStatusName(), "申请人选择调解员");
1207
-            }else {
1208
-                CaseLogUtils.insertCaseLog(vo.getId(), nextFlow.getNodeId(), nextFlow.getCaseStatusName(), "被申请人选择调解员");
1209
-
1210
-            }
1200
+//            if(vo.getMiniProgressFlag() == null || vo.getMiniProgressFlag().equals( YesOrNoEnum.NO.getCode())) {
1201
+//                CaseLogUtils.insertCaseLog(vo.getId(), nextFlow.getNodeId(), nextFlow.getCaseStatusName(), "申请人选择调解员");
1202
+//            }else {
1203
+//                CaseLogUtils.insertCaseLog(vo.getId(), nextFlow.getNodeId(), nextFlow.getCaseStatusName(), "被申请人选择调解员");
1204
+//
1205
+//            }
1211
 
1206
 
1212
         }
1207
         }
1213
     }
1208
     }
1259
         application.setCaseFlowId(nextFlow.getNodeId());
1254
         application.setCaseFlowId(nextFlow.getNodeId());
1260
         application.setCaseStatusName(nextFlow.getCaseStatusName());
1255
         application.setCaseStatusName(nextFlow.getCaseStatusName());
1261
         msCaseApplicationMapper.updateByPrimaryKeySelective(application);
1256
         msCaseApplicationMapper.updateByPrimaryKeySelective(application);
1262
-        // todo 发送短信
1257
+        // 根据案件id查询案件
1258
+        MsCaseApplication caseApplication = msCaseApplicationMapper.selectByPrimaryKey(application.getId());
1259
+        MsCaseAffiliate affiliate = msCaseAffiliateMapper.selectByPrimaryKey(application.getId());
1260
+        if(caseApplication==null || affiliate==null){
1261
+           throw new ServiceException("未找到该案件");
1262
+        }
1263
+        // 申请人电话
1264
+        String phone="";
1265
+        if(affiliate.getOrganizeFlag().equals(0)){
1266
+            // 自然人
1267
+            if(StrUtil.isNotEmpty(affiliate.getContactTelphoneAgent())){
1268
+                phone=affiliate.getContactTelphoneAgent();
1269
+            }else {
1270
+                phone=affiliate.getApplicationPhone();
1271
+            }
1272
+
1273
+        }else {
1274
+            phone=affiliate.getContactTelphoneAgent();
1275
+        }
1276
+
1277
+        // 申请人发送开庭日期短信
1278
+        sendHearDateSms(application,phone);
1279
+        // 被申发送开庭日期短信
1280
+        sendHearDateSms(application,affiliate.getRespondentPhone());
1281
+        // 调解员发送短信
1282
+       // 根据调解员id查询用户
1283
+        if(application.getMediatorId()!=null) {
1284
+            SysUser sysUser = sysUserMapper.selectUserById(application.getMediatorId());
1285
+            sendHearDateSms(application, sysUser.getPhonenumber());
1286
+        }
1263
         // 新增日志
1287
         // 新增日志
1264
         CaseLogUtils.insertCaseLog(application.getId(), nextFlow.getNodeId(), nextFlow.getCaseStatusName(), "");
1288
         CaseLogUtils.insertCaseLog(application.getId(), nextFlow.getNodeId(), nextFlow.getCaseStatusName(), "");
1265
 
1289
 
1266
     }
1290
     }
1267
 
1291
 
1292
+    /**
1293
+     * 发送开庭日期短信
1294
+     * @param application
1295
+     * @param phone
1296
+     */
1297
+    private void sendHearDateSms(MsCaseApplication application, String phone) {
1298
+        if(StrUtil.isEmpty(phone)){
1299
+            return;
1300
+        }
1301
+        // 2075447  尊敬的用户,您的{1}案件,线上调解日期已确定为{2},请知晓,如非本人操作,请忽略本短信。
1302
+        Boolean smsFlag = SmsUtils.sendSms(application.getId(), "2075447", phone, new String[]{application.getCaseNum(),application.getHearDate()});
1303
+        String sendContent = "尊敬的用户,您的" + application.getCaseNum() + "的案件,线上调解日期已确定为"+application.getHearDate()+",请知晓,如非本人操作,请忽略本短信。";
1304
+        // 新增短信记录
1305
+        SmsSendRecord smsSendRecord = new SmsSendRecord(application.getId(), application.getCaseNum(), phone, new Date(), sendContent);
1306
+        if(smsFlag){
1307
+            smsSendRecord.setSendStatus(YesOrNoEnum.YES.getCode());
1308
+        }else {
1309
+            smsSendRecord.setSendStatus(YesOrNoEnum.NO.getCode());
1310
+        }
1311
+        smsRecordMapper.saveSmsSendRecord(smsSendRecord);
1312
+    }
1313
+
1268
     /**
1314
     /**
1269
      * 案件不予受理
1315
      * 案件不予受理
1270
      * @param caseId
1316
      * @param caseId
1389
         MsCaseAffiliate caseAffiliate = msCaseAffiliateMapper.selectByPrimaryKey(req.getId());
1435
         MsCaseAffiliate caseAffiliate = msCaseAffiliateMapper.selectByPrimaryKey(req.getId());
1390
         if (application.getMediationMethod().equals("1")) {
1436
         if (application.getMediationMethod().equals("1")) {
1391
             // 线上调解
1437
             // 线上调解
1438
+            List<MsCaseAttach> attachList = req.getAttachList();
1439
+            if(CollectionUtil.isNotEmpty(attachList)) {
1440
+                // 先删除已经存在的调解书
1441
+                msCaseAttachMapper.deleteCaseAttachByCasedIdAndType(req.getId(), AnnexTypeEnum.MEDIATE_BOOK.getCode());
1442
+                for (MsCaseAttach attach : attachList) {
1443
+                    attach.setCaseAppliId(req.getId());
1444
+                }
1445
+                msCaseAttachMapper.batchSave(attachList);
1446
+            }
1392
             Integer mediaResult = req.getMediaResult();
1447
             Integer mediaResult = req.getMediaResult();
1393
-
1394
             if(mediaResult!=null){
1448
             if(mediaResult!=null){
1395
                 if(mediaResult.intValue()==1){
1449
                 if(mediaResult.intValue()==1){
1396
                     //达成调解
1450
                     //达成调解
1397
-                    if (application.getTemplateId() == null) {
1398
-                        return AjaxResult.error("未找到模板");
1399
-                    }
1400
-                    String templateId = String.valueOf(application.getTemplateId());
1401
-                    req.setTemplateId(templateId);
1402
-                    req.setTemplateType(TemplateTypeEnum.MEDIATE_BOOK.getCode());
1403
-                    AjaxResult result = generateApplication(req);
1404
-                    if (result != null && result.isSuccess()) {
1405
                         List<MsCaseAttach> caseAttachList = msCaseAttachMapper.queryAnnexPathByCaseId(req.getId());
1451
                         List<MsCaseAttach> caseAttachList = msCaseAttachMapper.queryAnnexPathByCaseId(req.getId());
1406
                         if (caseAttachList != null && caseAttachList.size() > 0) {
1452
                         if (caseAttachList != null && caseAttachList.size() > 0) {
1407
                             for (MsCaseAttach caseAttach : caseAttachList) {
1453
                             for (MsCaseAttach caseAttach : caseAttachList) {
1690
                                 }
1736
                                 }
1691
                             }
1737
                             }
1692
                         }
1738
                         }
1693
-                    }
1739
+
1694
                     return AjaxResult.success();
1740
                     return AjaxResult.success();
1695
                 }else if(mediaResult.intValue()==2){
1741
                 }else if(mediaResult.intValue()==2){
1696
                     //未达成调解
1742
                     //未达成调解
1764
                             .body(paramsbody)
1810
                             .body(paramsbody)
1765
                             .execute();
1811
                             .execute();
1766
                 }else if(mediaResult.intValue()==5){
1812
                 }else if(mediaResult.intValue()==5){
1767
-                    //达成和解
1768
-                    if (application.getTemplateId() == null) {
1769
-                        return AjaxResult.error("未找到模板");
1770
-                    }
1771
-                    String templateId = String.valueOf(application.getTemplateId());
1772
-                    req.setTemplateId(templateId);
1773
-                    req.setTemplateType(TemplateTypeEnum.MEDIATION_AGREEMENT.getCode());
1774
-                    AjaxResult result = generateApplication(req);
1775
-                    if (result != null && result.isSuccess()) {
1813
+                    // 达成和解
1776
                         List<MsCaseAttach> caseAttachList = msCaseAttachMapper.queryAnnexPathByCaseId(req.getId());
1814
                         List<MsCaseAttach> caseAttachList = msCaseAttachMapper.queryAnnexPathByCaseId(req.getId());
1777
                         if (caseAttachList != null && caseAttachList.size() > 0) {
1815
                         if (caseAttachList != null && caseAttachList.size() > 0) {
1778
                             for (MsCaseAttach caseAttach : caseAttachList) {
1816
                             for (MsCaseAttach caseAttach : caseAttachList) {
1984
                                 }
2022
                                 }
1985
                             }
2023
                             }
1986
                         }
2024
                         }
1987
-                    }
1988
                 }
2025
                 }
1989
 
2026
 
1990
             }
2027
             }
1994
             if(CollectionUtil.isEmpty(attachList)){
2031
             if(CollectionUtil.isEmpty(attachList)){
1995
                 return AjaxResult.error("请上传调解资料");
2032
                 return AjaxResult.error("请上传调解资料");
1996
             }
2033
             }
2034
+            // 先删除已经存在的调解书
2035
+            msCaseAttachMapper.deleteCaseAttachByCasedIdAndType(req.getId(),AnnexTypeEnum.MEDIATE_BOOK.getCode());
1997
             for (MsCaseAttach attach : attachList) {
2036
             for (MsCaseAttach attach : attachList) {
1998
                 attach.setCaseAppliId(req.getId());
2037
                 attach.setCaseAppliId(req.getId());
1999
             }
2038
             }
2016
         return AjaxResult.error();
2055
         return AjaxResult.error();
2017
     }
2056
     }
2018
 
2057
 
2058
+    /**
2059
+     * 确定会议结果
2060
+     * @param req
2061
+     * @return
2062
+     */
2063
+    @Override
2064
+    public AjaxResult confirmMeetingResult(MsCaseApplicationReq req) {
2065
+        // 查询案件是否存在
2066
+        MsCaseApplication application = msCaseApplicationMapper.selectByPrimaryKey(req.getId());
2067
+        if (application == null) {
2068
+            return AjaxResult.error("未找到案件");
2069
+        }
2070
+        if (application.getTemplateId() == null) {
2071
+            return AjaxResult.error("未找到模板");
2072
+        }
2073
+        String templateId = String.valueOf(application.getTemplateId());
2074
+        req.setTemplateId(templateId);
2075
+        // 调解结果
2076
+        Integer mediaResult = req.getMediaResult();
2077
+        if(mediaResult==1){
2078
+            // 达成调解,生成调解协议
2079
+            req.setTemplateType(TemplateTypeEnum.MEDIATE_BOOK.getCode());
2080
+
2081
+        }else if(mediaResult==5){
2082
+            // 达成和解,生成和解协议
2083
+            req.setTemplateType(TemplateTypeEnum.MEDIATION_AGREEMENT.getCode());
2084
+
2085
+        }
2086
+        AjaxResult result = generateApplication(req);
2087
+        return AjaxResult.success();
2088
+    }
2089
+
2019
     /**
2090
     /**
2020
      * 修改庭审笔录
2091
      * 修改庭审笔录
2021
      * @param attach
2092
      * @param attach

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

335
         }
335
         }
336
         casePaymentRecord.setCaseId(application.getId());
336
         casePaymentRecord.setCaseId(application.getId());
337
         Example example = new Example(MsCasePaymentRecord.class);
337
         Example example = new Example(MsCasePaymentRecord.class);
338
-        example.createCriteria().andEqualTo("caseId", casePaymentRecord.getCaseId());
339
-        casePaymentRecordMapper.updateByExampleSelective(casePaymentRecord, example);
338
+        example.createCriteria().andEqualTo("caseId", casePaymentRecord.getCaseId());casePaymentRecordMapper.updateByExampleSelective(casePaymentRecord, example);
340
         // 更改案件流程id和案件状态
339
         // 更改案件流程id和案件状态
341
         application.setCaseFlowId(flow.getId());
340
         application.setCaseFlowId(flow.getId());
342
         application.setCaseStatusName(flow.getCaseStatusName());
341
         application.setCaseStatusName(flow.getCaseStatusName());
354
         if (dto.getYesOrNo().equals(YesOrNoEnum.NO.getCode())) {
353
         if (dto.getYesOrNo().equals(YesOrNoEnum.NO.getCode())) {
355
             // 拒绝,新增审核记录
354
             // 拒绝,新增审核记录
356
             MsCaseAudit audit = new MsCaseAudit();
355
             MsCaseAudit audit = new MsCaseAudit();
357
-            audit.setCaseNode(flow.getNodeId());
356
+            audit.setCaseNode(flow.getId());
358
             audit.setCaseStatusName(flow.getCaseStatusName());
357
             audit.setCaseStatusName(flow.getCaseStatusName());
359
             audit.setCaseAppliId(dto.getCaseId());
358
             audit.setCaseAppliId(dto.getCaseId());
360
             audit.setYesOrNo(dto.getYesOrNo());
359
             audit.setYesOrNo(dto.getYesOrNo());