18792927508 пре 2 година
родитељ
комит
61da3d4b80

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

7
 import com.ruoyi.common.core.domain.AjaxResult;
7
 import com.ruoyi.common.core.domain.AjaxResult;
8
 import com.ruoyi.common.core.page.TableDataInfo;
8
 import com.ruoyi.common.core.page.TableDataInfo;
9
 import com.ruoyi.wisdomarbitrate.domain.entity.mscase.MsCaseApplication;
9
 import com.ruoyi.wisdomarbitrate.domain.entity.mscase.MsCaseApplication;
10
+import com.ruoyi.wisdomarbitrate.domain.entity.mscase.MsCaseAttach;
10
 import com.ruoyi.wisdomarbitrate.domain.vo.mscase.BookingVO;
11
 import com.ruoyi.wisdomarbitrate.domain.vo.mscase.BookingVO;
11
 import com.ruoyi.wisdomarbitrate.domain.vo.mscase.MsCaseApplicationReq;
12
 import com.ruoyi.wisdomarbitrate.domain.vo.mscase.MsCaseApplicationReq;
12
 import com.ruoyi.wisdomarbitrate.domain.vo.mscase.MsCaseApplicationVO;
13
 import com.ruoyi.wisdomarbitrate.domain.vo.mscase.MsCaseApplicationVO;
14
+import com.ruoyi.wisdomarbitrate.domain.vo.mscase.MsCaseAttachVO;
13
 import com.ruoyi.wisdomarbitrate.service.mscase.MsCaseApplicationService;
15
 import com.ruoyi.wisdomarbitrate.service.mscase.MsCaseApplicationService;
14
 import org.springframework.web.bind.annotation.*;
16
 import org.springframework.web.bind.annotation.*;
15
 import org.springframework.web.multipart.MultipartFile;
17
 import org.springframework.web.multipart.MultipartFile;
201
     public AjaxResult selectReservation(@RequestParam("id") Long id ) {
203
     public AjaxResult selectReservation(@RequestParam("id") Long id ) {
202
         return caseApplicationService.selectReservation(id);
204
         return caseApplicationService.selectReservation(id);
203
     }
205
     }
206
+    /**
207
+     * 调解
208
+     * @param
209
+     * @return
210
+     */
211
+    @PostMapping("/mediation")
212
+    public AjaxResult mediation(@RequestBody MsCaseApplicationReq req)   {
213
+        if (req.getCaseFlowId() == null || (req.getId() == null && StrUtil.isEmpty(req.getBatchNumber()))) {
214
+            return error("参数校验失败");
215
+        }
204
 
216
 
217
+        return caseApplicationService.mediation(req);
218
+    }
219
+    /**
220
+     * 修改庭审笔录
221
+     * @param
222
+     * @return
223
+     */
224
+    @PostMapping("/updateTrialPen")
225
+    public AjaxResult updateTrialPen(@RequestBody MsCaseAttach attach)   {
226
+        if (attach.getCaseAppliId()==null || attach.getAnnexId()==null ) {
227
+            return error("参数校验失败");
228
+        }
229
+
230
+        return caseApplicationService.updateTrialPen(attach);
231
+    }
232
+    /**
233
+     * 确认调解书
234
+     * @param
235
+     * @return
236
+     */
237
+    @PostMapping("/confirmMediation")
238
+    public AjaxResult confirmMediation(@RequestBody MsCaseAttachVO attach)   {
239
+        if (attach.getCaseFlowId()==null || attach.getCaseAppliId()==null ) {
240
+            return error("参数校验失败");
241
+        }
242
+
243
+        return caseApplicationService.confirmMediation(attach);
244
+    }
205
 }
245
 }

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

15
     MEDIATION_APPLICATION(3, "调解申请书"),
15
     MEDIATION_APPLICATION(3, "调解申请书"),
16
     PAYMENT_RECEIPT(4, "缴费单"),
16
     PAYMENT_RECEIPT(4, "缴费单"),
17
     MEETING_VIDEO(5, "会议视频"),
17
     MEETING_VIDEO(5, "会议视频"),
18
+    MEDIATE(6, "庭审笔录"),
19
+    MEDIATE_BOOK(7, "调解书"),
18
 
20
 
19
     ;
21
     ;
20
 
22
 

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

2
 
2
 
3
 import cn.hutool.core.collection.CollectionUtil;
3
 import cn.hutool.core.collection.CollectionUtil;
4
 import cn.hutool.core.util.StrUtil;
4
 import cn.hutool.core.util.StrUtil;
5
+import com.ruoyi.common.exception.ServiceException;
5
 import org.apache.poi.xwpf.usermodel.XWPFDocument;
6
 import org.apache.poi.xwpf.usermodel.XWPFDocument;
6
 import org.apache.poi.xwpf.usermodel.XWPFParagraph;
7
 import org.apache.poi.xwpf.usermodel.XWPFParagraph;
7
 
8
 
32
             FileInputStream fileInputStream = new FileInputStream(path);
33
             FileInputStream fileInputStream = new FileInputStream(path);
33
             xwpfDocument = new XWPFDocument(fileInputStream);
34
             xwpfDocument = new XWPFDocument(fileInputStream);
34
         } catch (IOException e) {
35
         } catch (IOException e) {
35
-            e.printStackTrace();
36
+            throw new ServiceException("未找到模板");
36
         }
37
         }
37
         if (xwpfDocument == null) {
38
         if (xwpfDocument == null) {
38
             return new ArrayList<>();
39
             return new ArrayList<>();

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

70
     /**
70
     /**
71
      * 开庭日期
71
      * 开庭日期
72
      */
72
      */
73
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "Asia/Shanghai")
73
     @Column(name = "hear_date")
74
     @Column(name = "hear_date")
74
     private String hearDate;
75
     private String hearDate;
75
 
76
 

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

60
      */
60
      */
61
 
61
 
62
     private String mediatorName;
62
     private String mediatorName;
63
+    /**
64
+     * 模板类型,1调解书,2调解申请书
65
+     */
66
+    private Integer templateType=2;
63
 
67
 
64
 }
68
 }

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

1
+package com.ruoyi.wisdomarbitrate.domain.vo.mscase;
2
+
3
+import com.ruoyi.wisdomarbitrate.domain.entity.mscase.MsCaseAttach;
4
+import lombok.*;
5
+
6
+@Getter
7
+@Setter
8
+@ToString
9
+@NoArgsConstructor
10
+@AllArgsConstructor
11
+public class MsCaseAttachVO extends MsCaseAttach {
12
+
13
+    /**
14
+     * 案件状态ID
15
+     */
16
+    private Integer caseFlowId;
17
+}

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

34
      * @param caseStatusNames
34
      * @param caseStatusNames
35
      * @return
35
      * @return
36
      */
36
      */
37
-    @Select("<script> select t.* from (select c.id,0 AS pendingStatus,c.case_flow_id caseFlowId,c.batch_number batchNumber,c.case_num caseNum,c.case_subject_amount caseSubjectAmount," +
37
+    @Select("<script> select t.* from (select c.id,c.mediation_method mediationMethod,0 AS pendingStatus,c.case_flow_id caseFlowId,c.batch_number batchNumber,c.case_num caseNum,c.case_subject_amount caseSubjectAmount," +
38
             "a.application_organ_name applicationOrganName,a.respondent_name respondentName,c.mediator_name mediatorName," +
38
             "a.application_organ_name applicationOrganName,a.respondent_name respondentName,c.mediator_name mediatorName," +
39
             "c.hear_date hearDate,c.case_status_name caseStatusName,c.create_time createTime from ms_case_application c " +
39
             "c.hear_date hearDate,c.case_status_name caseStatusName,c.create_time createTime from ms_case_application c " +
40
             "join ms_case_affiliate a on c.id=a.case_appli_id <where> " +
40
             "join ms_case_affiliate a on c.id=a.case_appli_id <where> " +
61
             "<if test=\"req.endTime != null and req.endTime != ''\">" +
61
             "<if test=\"req.endTime != null and req.endTime != ''\">" +
62
             "and c.create_time &lt;= #{req.endTime}</if>" +
62
             "and c.create_time &lt;= #{req.endTime}</if>" +
63
             "        </where> " +
63
             "        </where> " +
64
-            "union  select c.id id,1 AS pendingStatus,c.case_flow_id caseFlowId,c.batch_number batchNumber,c.case_num caseNum,c.case_subject_amount caseSubjectAmount," +
64
+            "union  select c.id id,c.mediation_method mediationMethod,1 AS pendingStatus,c.case_flow_id caseFlowId,c.batch_number batchNumber,c.case_num caseNum,c.case_subject_amount caseSubjectAmount," +
65
             "a.application_organ_name applicationOrganName,a.respondent_name respondentName,c.mediator_name mediatorName," +
65
             "a.application_organ_name applicationOrganName,a.respondent_name respondentName,c.mediator_name mediatorName," +
66
             "c.hear_date hearDate,c.case_status_name caseStatusName,c.create_time createTime from ms_case_log_record r " +
66
             "c.hear_date hearDate,c.case_status_name caseStatusName,c.create_time createTime from ms_case_log_record r " +
67
             "join ms_case_application c on r.case_appli_id=c.id and r.case_status_name!=c.case_status_name " +
67
             "join ms_case_application c on r.case_appli_id=c.id and r.case_status_name!=c.case_status_name " +

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

4
 import com.ruoyi.system.domain.entity.flow.MsCaseFlow;
4
 import com.ruoyi.system.domain.entity.flow.MsCaseFlow;
5
 import com.ruoyi.wisdomarbitrate.domain.entity.mscase.MsCaseAffiliate;
5
 import com.ruoyi.wisdomarbitrate.domain.entity.mscase.MsCaseAffiliate;
6
 import com.ruoyi.wisdomarbitrate.domain.entity.mscase.MsCaseApplication;
6
 import com.ruoyi.wisdomarbitrate.domain.entity.mscase.MsCaseApplication;
7
+import com.ruoyi.wisdomarbitrate.domain.entity.mscase.MsCaseAttach;
7
 import com.ruoyi.wisdomarbitrate.domain.vo.mscase.BookingVO;
8
 import com.ruoyi.wisdomarbitrate.domain.vo.mscase.BookingVO;
8
 import com.ruoyi.wisdomarbitrate.domain.vo.mscase.MsCaseApplicationReq;
9
 import com.ruoyi.wisdomarbitrate.domain.vo.mscase.MsCaseApplicationReq;
9
 import com.ruoyi.wisdomarbitrate.domain.vo.mscase.MsCaseApplicationVO;
10
 import com.ruoyi.wisdomarbitrate.domain.vo.mscase.MsCaseApplicationVO;
11
+import com.ruoyi.wisdomarbitrate.domain.vo.mscase.MsCaseAttachVO;
10
 import org.springframework.web.multipart.MultipartFile;
12
 import org.springframework.web.multipart.MultipartFile;
11
 
13
 
12
 import java.util.List;
14
 import java.util.List;
140
      */
142
      */
141
     AjaxResult selectReservation(Long id);
143
     AjaxResult selectReservation(Long id);
142
 
144
 
145
+    /**
146
+     * 调解
147
+     * @param req
148
+     * @return
149
+     */
150
+    AjaxResult mediation(MsCaseApplicationReq req);
151
+
152
+    /**
153
+     * 修改庭审笔录
154
+     * @param attach
155
+     * @return
156
+     */
157
+
158
+    AjaxResult updateTrialPen(MsCaseAttach attach);
159
+
160
+    /**
161
+     * 确认调解书
162
+     * @param attach
163
+     * @return
164
+     */
165
+
166
+    AjaxResult confirmMediation(MsCaseAttachVO attach);
143
 }
167
 }

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

4
 import cn.hutool.core.collection.CollectionUtil;
4
 import cn.hutool.core.collection.CollectionUtil;
5
 import cn.hutool.core.util.StrUtil;
5
 import cn.hutool.core.util.StrUtil;
6
 import com.ruoyi.common.config.RuoYiConfig;
6
 import com.ruoyi.common.config.RuoYiConfig;
7
+import com.ruoyi.common.constant.Constants;
7
 import com.ruoyi.common.core.domain.AjaxResult;
8
 import com.ruoyi.common.core.domain.AjaxResult;
8
 import com.ruoyi.common.core.domain.entity.SysDept;
9
 import com.ruoyi.common.core.domain.entity.SysDept;
9
 import com.ruoyi.common.core.domain.entity.SysDictData;
10
 import com.ruoyi.common.core.domain.entity.SysDictData;
481
      * @param req
482
      * @param req
482
      * @return
483
      * @return
483
      */
484
      */
485
+    @Transactional
484
     @Override
486
     @Override
485
     public AjaxResult generateApplication(MsCaseApplicationReq req) {
487
     public AjaxResult generateApplication(MsCaseApplicationReq req) {
486
         // 根据模板id查询申请书
488
         // 根据模板id查询申请书
487
         TemplateManage templateManage=templateManageMapper.selectById(req.getTemplateId());
489
         TemplateManage templateManage=templateManageMapper.selectById(req.getTemplateId());
488
         if(templateManage==null||StrUtil.isEmpty(templateManage.getTemOrigPath())){
490
         if(templateManage==null||StrUtil.isEmpty(templateManage.getTemOrigPath())){
489
-            return AjaxResult.error("未找到调解申请书模板");
491
+            throw new ServiceException("未找到模板");
490
         }
492
         }
491
-        String templatePath = templateManage.getTemOrigPath();
493
+        String templatePath = "/home/ruoyi/" + templateManage.getTemOrigPath();
494
+        templatePath=templatePath.replace("/profile","/uploadPath");
495
+
492
         try {
496
         try {
493
             File file = new File(templatePath);
497
             File file = new File(templatePath);
494
         } catch (Exception e) {
498
         } catch (Exception e) {
495
-            return AjaxResult.error("未找到调解申请书模板");
499
+            throw new ServiceException("未找到模板");
496
         }
500
         }
497
 
501
 
498
         // 获取模板中的占位符key
502
         // 获取模板中的占位符key
499
         List<String> bookmarkList = getBookmarkByDocx(templatePath);
503
         List<String> bookmarkList = getBookmarkByDocx(templatePath);
500
         if (CollectionUtil.isEmpty(bookmarkList)) {
504
         if (CollectionUtil.isEmpty(bookmarkList)) {
501
-            return AjaxResult.success("请检查模板是否配置正确,未获取到占位符");
505
+            throw new ServiceException("请检查模板是否配置正确,未获取到占位符");
502
         }
506
         }
503
         // 在系统表中查询案件内置字段
507
         // 在系统表中查询案件内置字段
504
         SysDictData sysDictData = new SysDictData();
508
         SysDictData sysDictData = new SysDictData();
505
         sysDictData.setDictType("case_built_type");
509
         sysDictData.setDictType("case_built_type");
506
         List<SysDictData> dictDataList = dictDataMapper.selectDictDataList(sysDictData);
510
         List<SysDictData> dictDataList = dictDataMapper.selectDictDataList(sysDictData);
507
         if(CollectionUtil.isEmpty(dictDataList)){
511
         if(CollectionUtil.isEmpty(dictDataList)){
508
-            return AjaxResult.error("未找到系统内置字段");
512
+            throw new ServiceException("未找到系统内置字段");
509
         }
513
         }
510
         // 如果批号不为空,则为批量操作,根据批号查询未锁定的案件
514
         // 如果批号不为空,则为批量操作,根据批号查询未锁定的案件
511
         if(StrUtil.isNotEmpty(req.getBatchNumber())){
515
         if(StrUtil.isNotEmpty(req.getBatchNumber())){
512
             List<MsCaseApplication> caseApplicationList=listByBatchNumber(req.getBatchNumber(),req.getCaseFlowId());
516
             List<MsCaseApplication> caseApplicationList=listByBatchNumber(req.getBatchNumber(),req.getCaseFlowId());
513
             if(CollectionUtil.isEmpty(caseApplicationList)){
517
             if(CollectionUtil.isEmpty(caseApplicationList)){
514
-                return AjaxResult.error("该批次号下未找到案件");
518
+                throw new ServiceException("该批次号下未找到案件");
515
             }
519
             }
516
             // 案件ids
520
             // 案件ids
517
             List<Long> caseIds = caseApplicationList.stream().map(MsCaseApplication::getId).collect(Collectors.toList());
521
             List<Long> caseIds = caseApplicationList.stream().map(MsCaseApplication::getId).collect(Collectors.toList());
520
             afflicateExample.createCriteria().andIn("case_appli_id", caseIds);
524
             afflicateExample.createCriteria().andIn("case_appli_id", caseIds);
521
             List<MsCaseAffiliate> affiliateList = msCaseAffiliateMapper.selectByExample(caseIds);
525
             List<MsCaseAffiliate> affiliateList = msCaseAffiliateMapper.selectByExample(caseIds);
522
             if(CollectionUtil.isEmpty(affiliateList)){
526
             if(CollectionUtil.isEmpty(affiliateList)){
523
-                return AjaxResult.error("该批次号下未找到案件关联人员");
527
+                throw new ServiceException("该批次号下未找到案件关联人员");
524
             }
528
             }
525
 
529
 
526
             Map<Long, MsCaseAffiliate> affiliateMap = affiliateList.stream().collect(Collectors.toMap(MsCaseAffiliate::getCaseAppliId, Function.identity()));
530
             Map<Long, MsCaseAffiliate> affiliateMap = affiliateList.stream().collect(Collectors.toMap(MsCaseAffiliate::getCaseAppliId, Function.identity()));
527
 
531
 
528
             // 循环生成调解申请书
532
             // 循环生成调解申请书
529
             for (MsCaseApplication application : caseApplicationList) {
533
             for (MsCaseApplication application : caseApplicationList) {
530
-
531
                 // 案件相关人员
534
                 // 案件相关人员
532
                 MsCaseAffiliate affiliate = affiliateMap.get(application.getId());
535
                 MsCaseAffiliate affiliate = affiliateMap.get(application.getId());
533
                 if(affiliate==null){
536
                 if(affiliate==null){
534
                     continue;
537
                     continue;
535
                 }
538
                 }
536
-                createMediateApplication(application, affiliate, templatePath, bookmarkList,dictDataList);
539
+                createMediateApplication(application, affiliate, templatePath, bookmarkList,dictDataList,req.getTemplateType());
537
 
540
 
538
             }
541
             }
539
         }else {
542
         }else {
543
             // 查询案件关联人员
546
             // 查询案件关联人员
544
             MsCaseAffiliate caseAffiliate = msCaseAffiliateMapper.selectByPrimaryKey(req.getId());
547
             MsCaseAffiliate caseAffiliate = msCaseAffiliateMapper.selectByPrimaryKey(req.getId());
545
             if (application == null || caseAffiliate == null) {
548
             if (application == null || caseAffiliate == null) {
546
-                return AjaxResult.error("该案件不存在");
549
+                throw new ServiceException("该案件不存在");
547
             }
550
             }
548
-            createMediateApplication(application, caseAffiliate, templatePath, bookmarkList,dictDataList);
551
+
552
+            createMediateApplication(application, caseAffiliate, templatePath, bookmarkList,dictDataList,req.getTemplateType());
549
         }
553
         }
550
 
554
 
551
 
555
 
552
-        return AjaxResult.success("调解申请书生成成功");
556
+        return AjaxResult.success();
553
     }
557
     }
554
 
558
 
555
     /**
559
     /**
738
     @Transactional
742
     @Transactional
739
     @Override
743
     @Override
740
     public AjaxResult updateBooking(BookingVO vo) {
744
     public AjaxResult updateBooking(BookingVO vo) {
745
+        // 查询被申请人是否预约过(从日志表查),否则不更新流程节点
746
+        MsCaseAffiliate msCaseAffiliate = msCaseAffiliateMapper.selectByPrimaryKey(vo.getId());
747
+        if(msCaseAffiliate==null) {
748
+            return AjaxResult.error("该案件不存在");
749
+        }
741
         MsCaseApplication application = new MsCaseApplication();
750
         MsCaseApplication application = new MsCaseApplication();
742
         application.setId(vo.getId());
751
         application.setId(vo.getId());
743
         setMediatorAndDate(application,vo);
752
         setMediatorAndDate(application,vo);
744
-        msCaseApplicationMapper.updateByPrimaryKeySelective(application);
745
-        nextFlow(vo.getId(),vo.getCaseFlowId(),null);
753
+        int applicantCount = msCaseApplicationMapper.updateByPrimaryKeySelective(application);
754
+        if(applicantCount<1){
755
+            return AjaxResult.error("保存失败");
756
+        }
757
+        // 新增申请人签署日志
758
+        MsCaseFlow currentFlow = caseFlowMapper.selectByPrimaryKey(vo.getCaseFlowId());
759
+        if(currentFlow==null){
760
+            return AjaxResult.error("当前流程不存在");
761
+        }
762
+        CaseLogUtils.insertCaseLog(application.getId(), currentFlow.getNodeId(), currentFlow.getCaseStatusName(),"申请人选择调解员");
763
+
764
+        if(StrUtil.isNotEmpty(msCaseAffiliate.getRespondentIdentityNum())){
765
+        // 根据身份证查询用户表
766
+            SysUser user = userMapper.selectUserByIdCard(msCaseAffiliate.getRespondentIdentityNum());
767
+            if(user!=null){
768
+                MsCaseFlow nextFlow = caseFlowMapper.nextFlow(vo.getCaseFlowId());
769
+                if(nextFlow==null){
770
+                    return AjaxResult.error("未找到下一个流程");
771
+                }
772
+                // 查询日志中是否有该节点的被申请人操作
773
+                Example example = new Example(MsCaseLogRecord.class);
774
+                Example.Criteria criteria = example.createCriteria();
775
+                criteria.andEqualTo("case_appli_id", vo.getId());
776
+                criteria.andEqualTo("case_node", nextFlow.getNodeId());
777
+                criteria.andEqualTo("case_status_name", nextFlow.getCaseStatusName());
778
+                criteria.andEqualTo("create_by", user.getUserName());
779
+                int count = caseLogRecordMapper.selectCountByExample(example);
780
+                if(count>0){
781
+                    // 被申请人已预约,更新流程节点
782
+                    // 更改案件流程id和案件状态
783
+                    application.setCaseFlowId(nextFlow.getId());
784
+                    application.setCaseStatusName(nextFlow.getCaseStatusName());
785
+                    application.setLockStatus(null);
786
+                    msCaseApplicationMapper.updateByPrimaryKeySelective(application);
787
+                }
788
+//                else {
789
+//                    return AjaxResult.error("被申请人未选择调解员");
790
+//                }
791
+            }
792
+//            else {
793
+//                return AjaxResult.error("被申请人未选择调解员");
794
+//            }
795
+       }
746
         return AjaxResult.success();
796
         return AjaxResult.success();
747
     }
797
     }
748
 
798
 
853
         return AjaxResult.success(result);
903
         return AjaxResult.success(result);
854
     }
904
     }
855
 
905
 
906
+    /**
907
+     * 调解
908
+     * @param req
909
+     * @return
910
+     */
911
+    @Transactional
912
+    @Override
913
+    public AjaxResult mediation(MsCaseApplicationReq req) {
914
+        String templateId=null;
915
+        // 批量
916
+        if(StrUtil.isNotEmpty(req.getBatchNumber())){
917
+            // 查询调解书模板是否存在
918
+            Example example = new Example(MsCaseFlow.class);
919
+            Example.Criteria criteria = example.createCriteria();
920
+            criteria.andEqualTo("batch_number", req.getBatchNumber());
921
+            criteria.andIsNotNull("template_id");
922
+            MsCaseApplication caseApplication = msCaseApplicationMapper.selectOneByExample(example);
923
+            if(caseApplication==null||caseApplication.getTemplateId()==null){
924
+                return AjaxResult.error("未找到模板");
925
+            }
926
+            templateId= String.valueOf(caseApplication.getTemplateId());
927
+
928
+        }else {
929
+            // 单独生成
930
+            // 查询调解书模板是否存在
931
+            MsCaseApplication application = msCaseApplicationMapper.selectByPrimaryKey(req.getId());
932
+            if(application==null||application.getTemplateId()==null){
933
+                return AjaxResult.error("未找到模板");
934
+            }
935
+            templateId= String.valueOf(application.getTemplateId());
936
+        }
937
+        req.setTemplateId(templateId);
938
+        req.setTemplateType(1);
939
+        AjaxResult result = generateApplication(req);
940
+        if(result!=null && result.isSuccess()){
941
+            return result;
942
+        }
943
+        return AjaxResult.error("生成失败");
944
+    }
945
+
946
+    /**
947
+     * 修改庭审笔录
948
+     * @param attach
949
+     * @return
950
+     */
951
+    @Transactional
952
+    @Override
953
+    public AjaxResult updateTrialPen(MsCaseAttach attach) {
954
+        // 删除之前的庭审笔录
955
+        msCaseAttachMapper.deleteCaseAttachByCasedIdAndType(attach.getCaseAppliId(), AnnexTypeEnum.MEDIATE.getCode());
956
+        // 更新庭审笔录
957
+        msCaseAttachMapper.updateCaseAttach(attach);
958
+        return AjaxResult.success();
959
+    }
960
+
961
+    /**
962
+     * 确认调解书
963
+     * @param attach
964
+     * @return
965
+     */
966
+    @Transactional
967
+
968
+    @Override
969
+    public AjaxResult confirmMediation(MsCaseAttachVO attach) {
970
+        if(attach.getAnnexId()!=null){
971
+            // 删除之前的调解书
972
+            msCaseAttachMapper.deleteCaseAttachByCasedIdAndType(attach.getCaseAppliId(),AnnexTypeEnum.MEDIATE_BOOK.getCode());
973
+            msCaseAttachMapper.updateCaseAttach(attach);
974
+        }
975
+        // 更新流程节点
976
+        nextFlow(attach.getCaseAppliId(),attach.getCaseFlowId(),YesOrNoEnum.YES.getCode());
977
+        return AjaxResult.success();
978
+    }
856
 
979
 
857
 
980
 
858
     /**
981
     /**
956
      * @param bookmarkList 标签
1079
      * @param bookmarkList 标签
957
      * @param dictDataList 内置字段
1080
      * @param dictDataList 内置字段
958
      */
1081
      */
959
-    private void createMediateApplication(MsCaseApplication application, MsCaseAffiliate affiliate, String templatePath, List<String> bookmarkList, List<SysDictData> dictDataList) {
1082
+    private void createMediateApplication(MsCaseApplication application, MsCaseAffiliate affiliate, String templatePath, List<String> bookmarkList, List<SysDictData> dictDataList,Integer templateType) {
960
         // 申请书需要的字段和内容,valueMap<占位符,替换的值>
1083
         // 申请书需要的字段和内容,valueMap<占位符,替换的值>
961
         Map<String, String> valueMap = new HashMap<>();
1084
         Map<String, String> valueMap = new HashMap<>();
962
         for (SysDictData dictData : dictDataList) {
1085
         for (SysDictData dictData : dictDataList) {
973
         // 读取调节申请书,找到占位符,替换值
1096
         // 读取调节申请书,找到占位符,替换值
974
         // 遍历书签,给书签赋值
1097
         // 遍历书签,给书签赋值
975
         replaceBookmark(bookmarkList, bookmarkValueMap, valueMap);
1098
         replaceBookmark(bookmarkList, bookmarkValueMap, valueMap);
976
-        // 根据条件替换书签
977
-//                conditionReplaceBookmark(caseApplicationById, bookmarkValueMap, agentName, resName, arbitrateRecordSelect);
978
         // 申请书生成时间
1099
         // 申请书生成时间
979
         LocalDate now = LocalDate.now();
1100
         LocalDate now = LocalDate.now();
980
         int year = now.getYear();
1101
         int year = now.getYear();
986
         String month = String.format("%02d", now.getMonthValue());
1107
         String month = String.format("%02d", now.getMonthValue());
987
         String day = String.format("%02d", now.getDayOfMonth());
1108
         String day = String.format("%02d", now.getDayOfMonth());
988
         // todo
1109
         // todo
989
-        String saveFolderPath = "/home/ruoyi/uploadPath/upload/" + year + "/" + month + "/" + day;
990
-//            String saveFolderPath = "D:/home/ruoyi/uploadPath/upload/" + year + "/" + month + "/" + day;
991
-        String orgFileName="调解申请书";
1110
+        String saveFolderPath = RuoYiConfig.getUploadPath()+"/"+ year + "/" + month + "/" + day;
1111
+        Integer annexType = AnnexTypeEnum.MEDIATION_APPLICATION.getCode();
1112
+        String orgFileName = "调解申请书";
1113
+        if(templateType!=null&&templateType==1) {
1114
+            orgFileName = "调解书";
1115
+            annexType=AnnexTypeEnum.MEDIATE_BOOK.getCode();
1116
+        }
992
         String fileName = UUID.randomUUID().toString().replace("-", "")+orgFileName + ".docx";
1117
         String fileName = UUID.randomUUID().toString().replace("-", "")+orgFileName + ".docx";
993
-        // todo
994
-        String saveName = "/profile/upload/" + year + "/" + month + "/" + day + "/" + fileName;
995
-//            String saveName = "D:/home/ruoyi/uploadPath/upload/" + year + "/" + month + "/" + day + "/" + fileName;
996
         String resultFilePath = saveFolderPath + "/" + fileName;
1118
         String resultFilePath = saveFolderPath + "/" + fileName;
997
         // 将word中的标签替换掉,生成新的word
1119
         // 将word中的标签替换掉,生成新的word
998
         wordChangeText(templatePath, bookmarkValueMap,saveFolderPath,resultFilePath);
1120
         wordChangeText(templatePath, bookmarkValueMap,saveFolderPath,resultFilePath);
999
 
1121
 
1000
-        //      String savePath = docFilePath.substring(0, docFilePath.indexOf("/upload/") + 8);
1001
-        // 保存裁决书附件
1002
-        //      saveArbitorFile(id, saveName, savePath, caseApplicationById, arbitrateRecordSelect);
1003
         MsCaseAttach caseAttach = MsCaseAttach.builder()
1122
         MsCaseAttach caseAttach = MsCaseAttach.builder()
1004
                 .caseAppliId(application.getId())
1123
                 .caseAppliId(application.getId())
1005
                 .annexName(orgFileName)
1124
                 .annexName(orgFileName)
1006
-                .annexPath(resultFilePath)
1007
-                .annexType(AnnexTypeEnum.MEDIATION_APPLICATION.getCode())
1125
+                .annexPath(resultFilePath.replace(RuoYiConfig.getProfile(),Constants.RESOURCE_PREFIX))
1126
+                .annexType(annexType)
1008
                 .build();
1127
                 .build();
1009
         //保存到附件表里,先删除之前的在保存
1128
         //保存到附件表里,先删除之前的在保存
1010
-        msCaseAttachMapper.deleteCaseAttachByCasedIdAndType(caseAttach.getCaseAppliId(), 3);
1129
+        msCaseAttachMapper.deleteCaseAttachByCasedIdAndType(caseAttach.getCaseAppliId(), AnnexTypeEnum.MEDIATION_APPLICATION.getCode());
1130
+        if (templateType!=null&&templateType==1) {
1131
+            msCaseAttachMapper.deleteCaseAttachByCasedIdAndType(caseAttach.getCaseAppliId(), AnnexTypeEnum.MEDIATE_BOOK.getCode());
1132
+        }
1011
         msCaseAttachMapper.save(caseAttach);
1133
         msCaseAttachMapper.save(caseAttach);
1134
+        // 生成调解书成功,需要更新流程节点
1135
+        if (templateType!=null&&templateType==1) {
1136
+            nextFlow(application.getId(), application.getCaseFlowId(), application.getLockStatus());
1137
+        }
1012
     }
1138
     }
1013
 
1139
 
1014
     /**
1140
     /**
1041
                 WordUtil.changeText(xwpfDocument);
1167
                 WordUtil.changeText(xwpfDocument);
1042
             }
1168
             }
1043
         } catch (IOException e) {
1169
         } catch (IOException e) {
1044
-            throw new RuntimeException("请检查文件路径是否有误");
1170
+
1171
+            throw new RuntimeException("modalFilePath:"+modalFilePath+"==saveFolderPath:"
1172
+                    +saveFolderPath+"==resultFilePath:"+resultFilePath+"==sourcePath:"+sourcePath+"==destinationPath:"+destinationPath);
1045
         }
1173
         }
1046
     }
1174
     }
1047
     /**
1175
     /**

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

31
 import com.tencentcloudapi.trtc.v20190722.models.*;
31
 import com.tencentcloudapi.trtc.v20190722.models.*;
32
 import com.tencentyun.TLSSigAPIv2;
32
 import com.tencentyun.TLSSigAPIv2;
33
 import lombok.extern.slf4j.Slf4j;
33
 import lombok.extern.slf4j.Slf4j;
34
+import org.apache.poi.xwpf.usermodel.XWPFDocument;
35
+import org.apache.poi.xwpf.usermodel.XWPFParagraph;
36
+import org.apache.poi.xwpf.usermodel.XWPFRun;
34
 import org.springframework.beans.factory.annotation.Autowired;
37
 import org.springframework.beans.factory.annotation.Autowired;
35
 import org.springframework.beans.factory.annotation.Value;
38
 import org.springframework.beans.factory.annotation.Value;
36
 import org.springframework.stereotype.Service;
39
 import org.springframework.stereotype.Service;
39
 
42
 
40
 import javax.crypto.Mac;
43
 import javax.crypto.Mac;
41
 import javax.crypto.spec.SecretKeySpec;
44
 import javax.crypto.spec.SecretKeySpec;
45
+import java.io.File;
46
+import java.io.FileOutputStream;
42
 import java.io.IOException;
47
 import java.io.IOException;
43
 import java.nio.file.Paths;
48
 import java.nio.file.Paths;
44
 import java.util.Base64;
49
 import java.util.Base64;
175
         long roomId = generateRoomId();
180
         long roomId = generateRoomId();
176
         // 绑定案件与房间号
181
         // 绑定案件与房间号
177
         bindCaseId(caseId, String.valueOf(roomId));
182
         bindCaseId(caseId, String.valueOf(roomId));
183
+        // 新增预约会议表
184
+        ReservedConference conference = new ReservedConference(caseId, SecurityUtils.getUserId(), roomId,
185
+                null, null);
186
+        reservedConferenceMapper.insert(conference);
178
         return String.valueOf(roomId);
187
         return String.valueOf(roomId);
179
     }
188
     }
180
 
189
 
187
         // 查询最大房间号
196
         // 查询最大房间号
188
         Long maxRoomId = caseApplicationMapper.selectMaxRoomId();
197
         Long maxRoomId = caseApplicationMapper.selectMaxRoomId();
189
 
198
 
190
-        if (null == maxRoomId || maxRoomId > 4294967294L/2) {
199
+        if (null == maxRoomId || maxRoomId > 4294967294L) {
191
             return 4294967294L/2+1;
200
             return 4294967294L/2+1;
192
         } else {
201
         } else {
193
             return maxRoomId + 1;
202
             return maxRoomId + 1;
376
      * @param reservedConferenceVO
385
      * @param reservedConferenceVO
377
      * @return
386
      * @return
378
      */
387
      */
388
+    @Transactional
379
     @Override
389
     @Override
380
     public AjaxResult htmlToPDF(MsReservedConferenceVO reservedConferenceVO) {
390
     public AjaxResult htmlToPDF(MsReservedConferenceVO reservedConferenceVO) {
381
         String currentFileName = System.currentTimeMillis() + ".pdf";
391
         String currentFileName = System.currentTimeMillis() + ".pdf";
391
 
401
 
392
         // 绑定案件
402
         // 绑定案件
393
         if(convertFlag){
403
         if(convertFlag){
404
+            // 删除之前的庭审笔录
405
+            caseAttachMapper.deleteCaseAttachByCasedIdAndType(reservedConferenceVO.getCaseId(),AnnexTypeEnum.MEDIATE.getCode());
394
             MsCaseAttach caseAttach = MsCaseAttach.builder().caseAppliId(reservedConferenceVO.getCaseId())
406
             MsCaseAttach caseAttach = MsCaseAttach.builder().caseAppliId(reservedConferenceVO.getCaseId())
395
-                    .annexName(fileName)
396
-                    .annexPath(RuoYiConfig.getHtml2PDFPath())
397
-                    .annexType(7)
407
+                    .annexName(currentFileName)
408
+                    .annexPath(fileName)
409
+                    .annexType(AnnexTypeEnum.MEDIATE.getCode())
398
                     .build();
410
                     .build();
399
             caseAttachMapper.save(caseAttach);
411
             caseAttachMapper.save(caseAttach);
400
             return AjaxResult.success();
412
             return AjaxResult.success();
403
         }
415
         }
404
     }
416
     }
405
 
417
 
418
+    public static void main(String[] args) throws Exception{
419
+        String htmlContent = "<h1>wangwu</h1><p>喂喂喂</p><h1>zhangsan</h1><p>hello</p><h1>zhangsan</h1><p>我能听到你说话</p><h1>wangwu</h1><p>欧克</p><h1>wangwu</h1><p>关于XXX我有几点想说的,balalalalalal</p><h1>zhangsan</h1><p>看到回复的时刻双方都是华德福额外补充你下次u饿哦是那些二的河南省而很为难啊看的法国队哈哈哈哈哈哈哈哈哈</p> "; // HTML字符串
420
+        String outputFileName="D://output.docx";
421
+        XWPFDocument document = new XWPFDocument();
422
+        XWPFParagraph paragraph = document.createParagraph();
423
+        XWPFRun run = paragraph.createRun();
424
+        run.setText(htmlContent);
425
+        FileOutputStream out = new FileOutputStream(new File(outputFileName));
426
+        document.write(out);
427
+        out.close();
428
+        System.out.printf("生成调解笔录成功");
406
 
429
 
407
 
430
 
431
+
432
+    }
433
+
408
     /**
434
     /**
409
      * 将视频下载到本地
435
      * 将视频下载到本地
410
      * @param fileUrl 视频路径
436
      * @param fileUrl 视频路径

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

10
 
10
 
11
 import javax.validation.constraints.NotEmpty;
11
 import javax.validation.constraints.NotEmpty;
12
 import javax.validation.constraints.NotNull;
12
 import javax.validation.constraints.NotNull;
13
+import java.util.Date;
13
 
14
 
14
 /**
15
 /**
15
  * 案件记录日志文件
16
  * 案件记录日志文件
45
         operLog.setCaseAppliId(caseAppliId);
46
         operLog.setCaseAppliId(caseAppliId);
46
         operLog.setCaseNode(caseNode);
47
         operLog.setCaseNode(caseNode);
47
         operLog.setNotes(notes);
48
         operLog.setNotes(notes);
49
+        operLog.setCreateTime(new Date());
48
         caseLogRecordMapper.insert(operLog);
50
         caseLogRecordMapper.insert(operLog);
49
     }
51
     }
50
 }
52
 }