Browse Source

429bug修复

18792927508 2 years ago
parent
commit
8b490936aa

+ 12
- 3
ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/mscase/MsVideoConferenceController.java View File

60
     /**
60
     /**
61
      * 通用上传请求(单个)
61
      * 通用上传请求(单个)
62
      * param officeFlag: 是否上传到onlyoffice,0-否,1-是
62
      * param officeFlag: 是否上传到onlyoffice,0-否,1-是
63
+     * param isMediaBook: 是否上调解书,1-是,其余为否
63
      */
64
      */
64
     @PostMapping("/upload")
65
     @PostMapping("/upload")
65
-    public AjaxResult uploadFile(@RequestParam("file") MultipartFile file, @RequestParam("annexType") Integer annexType, @RequestParam(value = "officeFlag", required = false) Integer officeFlag,@RequestParam(value = "caseId") Long caseId) throws Exception
66
+    public AjaxResult uploadFile(@RequestParam("file") MultipartFile file, @RequestParam(value = "isMediaBook",required = false) Integer isMediaBook, @RequestParam("annexType") Integer annexType, @RequestParam(value = "officeFlag", required = false) Integer officeFlag,@RequestParam(value = "caseId",required = false) Long caseId) throws Exception
66
     {
67
     {
67
         try
68
         try
68
         {
69
         {
82
                 JSONArray jsonArray = caseApplicationService.uploadOnlyOffice(fileName,caseId);
83
                 JSONArray jsonArray = caseApplicationService.uploadOnlyOffice(fileName,caseId);
83
                 if(jsonArray!=null && jsonArray.size() > 0) {
84
                 if(jsonArray!=null && jsonArray.size() > 0) {
84
                     // 先删除之前的附件
85
                     // 先删除之前的附件
85
-                    if(Objects.equals(annexType, AnnexTypeEnum.MEDIATE_BOOK.getCode())) {
86
+                    if(Objects.equals(annexType, AnnexTypeEnum.MEDIATE_BOOK.getCode()) && caseId!=null) {
86
                         msCaseAttachMapper.deleteCaseAttachByCasedIdAndType(caseId, annexType);
87
                         msCaseAttachMapper.deleteCaseAttachByCasedIdAndType(caseId, annexType);
87
                     }
88
                     }
88
                     MsCaseAttach caseAttach=null;
89
                     MsCaseAttach caseAttach=null;
118
                     return AjaxResult.error("上传失败");
119
                     return AjaxResult.error("上传失败");
119
                 }
120
                 }
120
             }else {
121
             }else {
121
-
122
+                // 如果是调解书并且是pdf,则删除之前的在新增
123
+                if(isMediaBook != null && isMediaBook == 1 && caseId!=null){
124
+                    if(StrUtil.isNotEmpty(suffix)&&!suffix.equals("pdf")){
125
+                        return AjaxResult.error("请上传pdf格式文件");
126
+                    }
127
+                    annexType=AnnexTypeEnum.MEDIATE_BOOK_PDF.getCode();
128
+                    // 先删除之前的附件
129
+                    msCaseAttachMapper.deleteCaseAttachByCasedIdAndType(caseId, annexType);
130
+                }
122
                 Long annexId = saveCaseAttach(annexType, fileName, file.getOriginalFilename(), caseId);
131
                 Long annexId = saveCaseAttach(annexType, fileName, file.getOriginalFilename(), caseId);
123
                 // 是否上传到onlyoffice
132
                 // 是否上传到onlyoffice
124
                 AjaxResult ajax = AjaxResult.success();
133
                 AjaxResult ajax = AjaxResult.success();

+ 6
- 2
ruoyi-common/src/main/java/com/ruoyi/common/utils/EmailOutUtil.java View File

104
      * @param message  邮件内容
104
      * @param message  邮件内容
105
      * @param subject  邮件主题
105
      * @param subject  邮件主题
106
      * @param fileList 邮件附件
106
      * @param fileList 邮件附件
107
+     * @param fileNameMap 附件名称map,附件路径-附件名称
107
      */
108
      */
108
-    public  Boolean sendEmil(String to, String message, String subject, List<File> fileList, File file) {
109
+    public  Boolean sendEmil(String to, String message, String subject, List<File> fileList, File file,Map<String,String> fileNameMap) {
109
         try {
110
         try {
110
             String messageContent = "<html><body><p style=\"font-family: Arial, sans-serif; font-size: 18px;\">"+message+"。</p></body></html>";
111
             String messageContent = "<html><body><p style=\"font-family: Arial, sans-serif; font-size: 18px;\">"+message+"。</p></body></html>";
111
             MimeBodyPart messageBodyPart = new MimeBodyPart();
112
             MimeBodyPart messageBodyPart = new MimeBodyPart();
162
                     for (File tempfile : fileList) {
163
                     for (File tempfile : fileList) {
163
                         MimeBodyPart attachmentPart = new MimeBodyPart();
164
                         MimeBodyPart attachmentPart = new MimeBodyPart();
164
                         attachmentPart.attachFile(tempfile);
165
                         attachmentPart.attachFile(tempfile);
165
-                        attachmentPart.setFileName(MimeUtility.encodeText(tempfile.getName()));
166
+                        // 设置附件名称
167
+                        if(fileNameMap!=null && fileNameMap.containsKey(tempfile.getPath())) {
168
+                            attachmentPart.setFileName(MimeUtility.encodeText(fileNameMap.get(tempfile.getPath())));
169
+                        }
166
                         multipart.addBodyPart(attachmentPart);
170
                         multipart.addBodyPart(attachmentPart);
167
                     }
171
                     }
168
                     msg.setContent(multipart);
172
                     msg.setContent(multipart);

+ 1
- 0
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/mscase/MsCaseAttachMapper.java View File

25
     int deleteByFileIds(@Param("ids") List<Integer> fileIds);
25
     int deleteByFileIds(@Param("ids") List<Integer> fileIds);
26
 
26
 
27
     List<MsCaseAttach> listCaseAttachByCaseIdAndType(@Param("caseAppliId")Long caseAppliId,@Param("annexType") int annexType);
27
     List<MsCaseAttach> listCaseAttachByCaseIdAndType(@Param("caseAppliId")Long caseAppliId,@Param("annexType") int annexType);
28
+    List<MsCaseAttach> listCaseAttachByCaseIdAndTypes(@Param("caseAppliId")Long caseAppliId,@Param("annexTypes") List<Integer> annexTypes);
28
 
29
 
29
     MsCaseAttach queryAnnexById(@Param("annexId") Long annexId);
30
     MsCaseAttach queryAnnexById(@Param("annexId") Long annexId);
30
 
31
 

+ 2
- 1
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/mscase/MsCaseApplicationService.java View File

56
      * @param caseApplication
56
      * @param caseApplication
57
      * @param affiliate
57
      * @param affiliate
58
      * @param groupOrder 组别
58
      * @param groupOrder 组别
59
+     * @param operatorCount 操作人数量
59
      */
60
      */
60
-    public void setCaseAfflicate(MsCaseApplicationVO caseApplication, MsCaseAffiliate affiliate,int groupOrder);
61
+    public int setCaseAfflicate(MsCaseApplicationVO caseApplication, MsCaseAffiliate affiliate,int groupOrder,int operatorCount);
61
     /**
62
     /**
62
      * 新增案件相关人员信息
63
      * 新增案件相关人员信息
63
      * @param affiliate 相关人员信息
64
      * @param affiliate 相关人员信息

+ 87
- 70
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/mscase/impl/MsCaseApplicationServiceImpl.java View File

293
         }
293
         }
294
 
294
 
295
         for (MsCaseApplicationVO vo : list) {
295
         for (MsCaseApplicationVO vo : list) {
296
-            if(vo.getMediatorId()!=null&&vo.getMediatorId()==loginUserId){
296
+            if(vo.getMediatorId()!=null&&vo.getMediatorId().equals(loginUserId)){
297
                 isMediatorRole=true;
297
                 isMediatorRole=true;
298
             }
298
             }
299
             // 设置申请人和被申请人
299
             // 设置申请人和被申请人
317
                                     }
317
                                     }
318
                                 }
318
                                 }
319
                                 // 签收按钮权限
319
                                 // 签收按钮权限
320
-                                if(affiliate.getUserId().equals(loginUserId) &&vo.getCaseStatusName().contains("签收")){
320
+                                if(affiliate.getUserId().equals(loginUserId) &&vo.getCaseStatusName().equals("待申请人签收")){
321
                                     vo.setSignFlag(1);
321
                                     vo.setSignFlag(1);
322
                                 }
322
                                 }
323
 
323
 
334
                                     }
334
                                     }
335
                                 }
335
                                 }
336
                                 // 签收按钮权限
336
                                 // 签收按钮权限
337
-                                if(affiliate.getUserId().equals(loginUserId) &&vo.getCaseStatusName().contains("签收")){
337
+                                if(affiliate.getUserId().equals(loginUserId) &&vo.getCaseStatusName().equals("待被申请人签收")){
338
                                     vo.setSignFlag(1);
338
                                     vo.setSignFlag(1);
339
                                 }
339
                                 }
340
                             }
340
                             }
683
         // 保存案件基本信息
683
         // 保存案件基本信息
684
         if (msCaseApplicationMapper.insertSelective(caseApplication) > 0) {
684
         if (msCaseApplicationMapper.insertSelective(caseApplication) > 0) {
685
             List<MsCaseAttach> caseAttachList = caseApplication.getCaseAttachList();
685
             List<MsCaseAttach> caseAttachList = caseApplication.getCaseAttachList();
686
+            int appOperatorCount=0;
687
+            int resOperatorCount=0;
686
             // 保存案件相关人员
688
             // 保存案件相关人员
687
                     List<MsCaseAffiliateBase> applicant = msCaseAffiliateVO.getApplicant();
689
                     List<MsCaseAffiliateBase> applicant = msCaseAffiliateVO.getApplicant();
688
                     List<MsCaseAffiliateBase> res = msCaseAffiliateVO.getRes();
690
                     List<MsCaseAffiliateBase> res = msCaseAffiliateVO.getRes();
689
                     if(CollectionUtil.isNotEmpty(applicant)){
691
                     if(CollectionUtil.isNotEmpty(applicant)){
690
                         for (int i = 0; i < applicant.size(); i++) {
692
                         for (int i = 0; i < applicant.size(); i++) {
691
                             // 申请人
693
                             // 申请人
692
-                            setCaseAfflicate(caseApplication, applicant.get(i).getApplicant(),i);
694
+                            appOperatorCount= setCaseAfflicate(caseApplication, applicant.get(i).getApplicant(),i,appOperatorCount);
693
                             // 申请人代理人
695
                             // 申请人代理人
694
-                            setCaseAfflicate(caseApplication, applicant.get(i).getApplicantAgent(),i);
696
+                            appOperatorCount=setCaseAfflicate(caseApplication, applicant.get(i).getApplicantAgent(),i,appOperatorCount);
695
                         }
697
                         }
696
                     }
698
                     }
697
                     if(CollectionUtil.isNotEmpty(res)){
699
                     if(CollectionUtil.isNotEmpty(res)){
698
                         for (int i = 0; i < res.size(); i++) {
700
                         for (int i = 0; i < res.size(); i++) {
699
                             // 申请人
701
                             // 申请人
700
-                            setCaseAfflicate(caseApplication, res.get(i).getRes(),i);
702
+                            resOperatorCount=   setCaseAfflicate(caseApplication, res.get(i).getRes(),i,resOperatorCount);
701
                             // 申请人代理人
703
                             // 申请人代理人
702
-                            setCaseAfflicate(caseApplication, res.get(i).getResAgent(),i);
704
+                            resOperatorCount= setCaseAfflicate(caseApplication, res.get(i).getResAgent(),i,resOperatorCount);
703
                         }
705
                         }
704
                     }
706
                     }
705
-
707
+            if (appOperatorCount < 1 && resOperatorCount < 1) {
708
+                throw new ServiceException("未设置申请操作人和被申请操作人");
709
+            } else if (appOperatorCount < 1) {
710
+                throw new ServiceException("未设置申请操作人");
711
+            } else if (resOperatorCount < 1) {
712
+                throw new ServiceException("未设置被申请操作人");
713
+            }
706
 
714
 
707
             // 批量生成调解申请书
715
             // 批量生成调解申请书
708
             MsCaseApplicationReq req = new MsCaseApplicationReq();
716
             MsCaseApplicationReq req = new MsCaseApplicationReq();
753
      * @param affiliate
761
      * @param affiliate
754
      */
762
      */
755
     @Transactional
763
     @Transactional
756
-    public void setCaseAfflicate(MsCaseApplicationVO caseApplication, MsCaseAffiliate affiliate,int groupOrder) {
764
+    public int setCaseAfflicate(MsCaseApplicationVO caseApplication, MsCaseAffiliate affiliate,int groupOrder,int operatorCount) {
757
         if(affiliate==null){
765
         if(affiliate==null){
758
-            return;
766
+            return operatorCount;
759
         }
767
         }
768
+
760
         boolean b = affiliate.getOrganizeFlag() != 1 && (affiliate.getRoleType() == 1||affiliate.getRoleType() == 3) && StrUtil.isEmpty(affiliate.getEmail());
769
         boolean b = affiliate.getOrganizeFlag() != 1 && (affiliate.getRoleType() == 1||affiliate.getRoleType() == 3) && StrUtil.isEmpty(affiliate.getEmail());
761
         if(b|| StrUtil.isEmpty(affiliate.getName())){
770
         if(b|| StrUtil.isEmpty(affiliate.getName())){
762
-            return;
771
+            return operatorCount;
763
         }
772
         }
764
         affiliate.setGroupOrder(groupOrder);
773
         affiliate.setGroupOrder(groupOrder);
765
         // 获取角色缓存
774
         // 获取角色缓存
858
         }
867
         }
859
         // 保存人员
868
         // 保存人员
860
         msCaseAffiliateMapper.insert(affiliate);
869
         msCaseAffiliateMapper.insert(affiliate);
870
+        if(affiliate.getOperatorFlag()!=null && affiliate.getOperatorFlag()==1){
871
+            operatorCount++;
872
+        }
873
+        return operatorCount;
861
     }
874
     }
862
 
875
 
863
     /**
876
     /**
1048
         Example affliateExample = new Example(MsCaseAffiliate.class);
1061
         Example affliateExample = new Example(MsCaseAffiliate.class);
1049
         affliateExample.createCriteria().andEqualTo("caseAppliId", caseApplication.getId());
1062
         affliateExample.createCriteria().andEqualTo("caseAppliId", caseApplication.getId());
1050
         msCaseAffiliateMapper.deleteByExample(affliateExample);
1063
         msCaseAffiliateMapper.deleteByExample(affliateExample);
1051
-
1064
+        int appOperatorCount=0;
1065
+        int resOperatorCount=0;
1052
 
1066
 
1053
             List<MsCaseAffiliateBase> applicant = msCaseAffiliateVO.getApplicant();
1067
             List<MsCaseAffiliateBase> applicant = msCaseAffiliateVO.getApplicant();
1054
             List<MsCaseAffiliateBase> res = msCaseAffiliateVO.getRes();
1068
             List<MsCaseAffiliateBase> res = msCaseAffiliateVO.getRes();
1055
             if(CollectionUtil.isNotEmpty(applicant)){
1069
             if(CollectionUtil.isNotEmpty(applicant)){
1056
                 for (int i = 0; i < applicant.size(); i++) {
1070
                 for (int i = 0; i < applicant.size(); i++) {
1057
                     // 申请人
1071
                     // 申请人
1058
-                    setCaseAfflicate(caseApplication, applicant.get(i).getApplicant(),i);
1072
+                    appOperatorCount=setCaseAfflicate(caseApplication, applicant.get(i).getApplicant(),i,appOperatorCount);
1059
                     // 申请人代理人
1073
                     // 申请人代理人
1060
-                    setCaseAfflicate(caseApplication, applicant.get(i).getApplicantAgent(),i);
1074
+                    appOperatorCount= setCaseAfflicate(caseApplication, applicant.get(i).getApplicantAgent(),i,appOperatorCount);
1061
                 }
1075
                 }
1062
             }
1076
             }
1063
             if(CollectionUtil.isNotEmpty(res)){
1077
             if(CollectionUtil.isNotEmpty(res)){
1064
                 for (int i = 0; i < res.size(); i++) {
1078
                 for (int i = 0; i < res.size(); i++) {
1065
                     // 申请人
1079
                     // 申请人
1066
-                    setCaseAfflicate(caseApplication, res.get(i).getRes(),i);
1080
+                    resOperatorCount=setCaseAfflicate(caseApplication, res.get(i).getRes(),i,resOperatorCount);
1067
                     // 申请人代理人
1081
                     // 申请人代理人
1068
-                    setCaseAfflicate(caseApplication, res.get(i).getResAgent(),i);
1082
+                    resOperatorCount=setCaseAfflicate(caseApplication, res.get(i).getResAgent(),i,resOperatorCount);
1069
                 }
1083
                 }
1070
             }
1084
             }
1071
-
1085
+        if (appOperatorCount < 1 && resOperatorCount < 1) {
1086
+            throw new ServiceException("未设置申请操作人和被申请操作人");
1087
+        } else if (appOperatorCount < 1) {
1088
+            throw new ServiceException("未设置申请操作人");
1089
+        } else if (resOperatorCount < 1) {
1090
+            throw new ServiceException("未设置被申请操作人");
1091
+        }
1072
         if (CollectionUtil.isNotEmpty(caseApplication.getCaseAttachList())) {
1092
         if (CollectionUtil.isNotEmpty(caseApplication.getCaseAttachList())) {
1073
             for (MsCaseAttach caseAttach : caseApplication.getCaseAttachList()) {
1093
             for (MsCaseAttach caseAttach : caseApplication.getCaseAttachList()) {
1074
                 caseAttach.setCaseAppliId(caseApplication.getId());
1094
                 caseAttach.setCaseAppliId(caseApplication.getId());
2543
         if (!applicantAffiliateOpt.isPresent() || !resAffiliateOpt.isPresent()) {
2563
         if (!applicantAffiliateOpt.isPresent() || !resAffiliateOpt.isPresent()) {
2544
             throw new ServiceException("未找到案件操作人员");
2564
             throw new ServiceException("未找到案件操作人员");
2545
         }
2565
         }
2566
+        // 更新附件
2567
+        List<MsCaseAttach> attachList = req.getAttachList();
2568
+        if (CollectionUtil.isNotEmpty(attachList)) {
2569
+            Map<Integer, List<MsCaseAttach>> annexTypeMap = attachList.stream().filter(attach -> attach.getAnnexType() != null).collect(Collectors.groupingBy(MsCaseAttach::getAnnexType));
2570
+            for (Map.Entry<Integer, List<MsCaseAttach>> entry : annexTypeMap.entrySet()) {
2571
+                if(entry.getKey()!=null && entry.getValue().size()>1){
2572
+                    return AjaxResult.error("同一案件同一类型附件只能上传一个");
2573
+                }
2574
+            }
2575
+           // 先删除已存在的调解书
2576
+                List<MsCaseAttach> existAttach = msCaseAttachMapper.listCaseAttachByCaseIdAndTypes(req.getId(),  new ArrayList<>(annexTypeMap.keySet()));
2577
+                if (CollectionUtil.isNotEmpty(existAttach)) {
2578
+                    //  对接北明,同步案件状态,删除
2579
+                    for (MsCaseAttach msCaseAttach : existAttach) {
2580
+                        if (StrUtil.isEmpty(msCaseAttach.getOtherSysFileId()) || StrUtil.isEmpty(msCaseAttach.getAnnexPath())) {
2581
+                            continue;
2582
+                        }
2583
+                        beiMingInterfaceService.deleteAttachmentInfo(application.getCaseNum(), msCaseAttach.getOtherSysFileId(), FileUtil.getName(msCaseAttach.getAnnexPath()));
2584
+                    }
2585
+                }
2586
+
2587
+            for (MsCaseAttach attach : attachList) {
2588
+                // 先删除已经存在的调解书
2546
 
2589
 
2590
+                attach.setCaseAppliId(req.getId());
2591
+                msCaseAttachMapper.updateCaseAttach(attach);
2592
+            }
2593
+            //  对接北明,调用上传附件接口
2594
+            List<MsCaseAttach> msCaseAttaches = msCaseAttachMapper.listCaseAttachByCaseIdAndType(req.getId(), AnnexTypeEnum.MEDIATE_BOOK.getCode());
2595
+            if (StrUtil.isEmpty(application.getCaseSource()) && CollectionUtil.isNotEmpty(msCaseAttaches)) {
2596
+                for (MsCaseAttach msCaseAttach : msCaseAttaches) {
2597
+                    if (StrUtil.isEmpty(msCaseAttach.getAnnexPath())) {
2598
+                        continue;
2599
+                    }
2600
+
2601
+                    String replacePath = msCaseAttach.getAnnexPath().replace("/profile/", "/home/ruoyi/uploadPath/");
2602
+                    File file = new File(replacePath);
2603
+                    MsCaseFileInfo caseFileInfo = beiMingInterfaceService.pushAttachmentInfo(BMUserName, BMPassword, file, BMSyncSource, application.getCaseNum(), AttachmentOperateTypeEnum.ADD, DocumentTypeEnum.EVEDENT_AGREEMENT);
2604
+                    // 更新附件表
2605
+                    if (caseFileInfo != null && StrUtil.isNotEmpty(caseFileInfo.getFileId())) {
2606
+                        msCaseAttach.setOtherSysFileId(caseFileInfo.getFileId());
2607
+                        msCaseAttachMapper.updateCaseAttach(msCaseAttach);
2608
+                    }
2609
+
2610
+
2611
+                }
2612
+            }
2613
+        }
2614
+        // 线上调解
2547
         if (application.getMediationMethod().equals("1")) {
2615
         if (application.getMediationMethod().equals("1")) {
2548
             Integer mediaResult = application.getMediaResult();
2616
             Integer mediaResult = application.getMediaResult();
2549
             if (mediaResult == null) {
2617
             if (mediaResult == null) {
2550
                 return AjaxResult.error("请选择调解结果");
2618
                 return AjaxResult.error("请选择调解结果");
2551
             }
2619
             }
2552
-            // 线上调解
2553
-            List<MsCaseAttach> attachList = req.getAttachList();
2554
-            if (CollectionUtil.isNotEmpty(attachList)) {
2555
-                // 先删除已经存在的调解书
2556
-                msCaseAttachMapper.deleteCaseAttachByCasedIdAndType(req.getId(), AnnexTypeEnum.MEDIATE_BOOK.getCode());
2557
-                for (MsCaseAttach attach : attachList) {
2558
-                    attach.setCaseAppliId(req.getId());
2559
-                    msCaseAttachMapper.updateCaseAttach(attach);
2560
-                }
2561
-            }
2620
+
2562
             if (mediaResult == 1) {
2621
             if (mediaResult == 1) {
2563
                 //达成调解
2622
                 //达成调解
2564
                 List<MsCaseAttach> caseAttachList = msCaseAttachMapper.queryAnnexPathByCaseId(req.getId());
2623
                 List<MsCaseAttach> caseAttachList = msCaseAttachMapper.queryAnnexPathByCaseId(req.getId());
3075
                 }
3134
                 }
3076
             }
3135
             }
3077
         } else {
3136
         } else {
3137
+            // 线下调解
3078
             Integer mediaResult=req.getMediaResult();
3138
             Integer mediaResult=req.getMediaResult();
3079
             if(mediaResult==null){
3139
             if(mediaResult==null){
3080
                 return AjaxResult.error("请选择调解结果");
3140
                 return AjaxResult.error("请选择调解结果");
3081
             }
3141
             }
3082
-            // 线下调解
3083
-            List<MsCaseAttach> attachList = req.getAttachList();
3084
-            if (CollectionUtil.isEmpty(attachList)) {
3085
-                return AjaxResult.error("请上传调解资料");
3086
-            }
3087
-            // 先删除已经存在的调解书
3088
-            if (StrUtil.isEmpty(application.getCaseSource())) {
3089
-                List<MsCaseAttach> existAttach = msCaseAttachMapper.listCaseAttachByCaseIdAndType(req.getId(), AnnexTypeEnum.MEDIATE_BOOK.getCode());
3090
-                if (CollectionUtil.isNotEmpty(existAttach)) {
3091
-                    //  对接北明,同步案件状态,删除
3092
-                    for (MsCaseAttach msCaseAttach : existAttach) {
3093
-                        if (StrUtil.isEmpty(msCaseAttach.getOtherSysFileId()) || StrUtil.isEmpty(msCaseAttach.getAnnexPath())) {
3094
-                            continue;
3095
-                        }
3096
-                        beiMingInterfaceService.deleteAttachmentInfo(application.getCaseNum(), msCaseAttach.getOtherSysFileId(), FileUtil.getName(msCaseAttach.getAnnexPath()));
3097
-                    }
3098
-                }
3099
-            }
3100
-            msCaseAttachMapper.deleteCaseAttachByCasedIdAndType(req.getId(), AnnexTypeEnum.MEDIATE_BOOK.getCode());
3101
-            for (MsCaseAttach attach : attachList) {
3102
-                attach.setCaseAppliId(req.getId());
3103
-                msCaseAttachMapper.updateCaseAttach(attach);
3104
-            }
3105
-            //  对接北明,调用上传附件接口
3106
-            List<MsCaseAttach> msCaseAttaches = msCaseAttachMapper.listCaseAttachByCaseIdAndType(req.getId(), AnnexTypeEnum.MEDIATE_BOOK.getCode());
3107
-            if (StrUtil.isEmpty(application.getCaseSource()) && CollectionUtil.isNotEmpty(msCaseAttaches)) {
3108
-                for (MsCaseAttach msCaseAttach : msCaseAttaches) {
3109
-                    if (StrUtil.isEmpty(msCaseAttach.getAnnexPath())) {
3110
-                        continue;
3111
-                    }
3112
-
3113
-                    String replacePath = msCaseAttach.getAnnexPath().replace("/profile/", "/home/ruoyi/uploadPath/");
3114
-                    File file = new File(replacePath);
3115
-                    MsCaseFileInfo caseFileInfo = beiMingInterfaceService.pushAttachmentInfo(BMUserName, BMPassword, file, BMSyncSource, application.getCaseNum(), AttachmentOperateTypeEnum.ADD, DocumentTypeEnum.EVEDENT_AGREEMENT);
3116
-                    // 更新附件表
3117
-                    if (caseFileInfo != null && StrUtil.isNotEmpty(caseFileInfo.getFileId())) {
3118
-                        msCaseAttach.setOtherSysFileId(caseFileInfo.getFileId());
3119
-                        msCaseAttachMapper.updateCaseAttach(msCaseAttach);
3120
-                    }
3121
-
3122
-
3123
-                }
3124
-            }
3125
             // 修改案件状态为待送达
3142
             // 修改案件状态为待送达
3126
             Example flowExample = new Example(MsCaseFlow.class);
3143
             Example flowExample = new Example(MsCaseFlow.class);
3127
             if (mediaResult == 1 || mediaResult == 5) {
3144
             if (mediaResult == 1 || mediaResult == 5) {

+ 3
- 1
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/mscase/impl/MsSignSealServiceImpl.java View File

1219
         List<File> fileList = new ArrayList<>();
1219
         List<File> fileList = new ArrayList<>();
1220
         File file = null;
1220
         File file = null;
1221
         Long fileId = null;
1221
         Long fileId = null;
1222
+        Map<String,String> fileNameMap = new HashMap<>();
1222
         if (caseAttachList != null && caseAttachList.size() > 0) {
1223
         if (caseAttachList != null && caseAttachList.size() > 0) {
1223
             for (MsCaseAttach caseAttach : caseAttachList) {
1224
             for (MsCaseAttach caseAttach : caseAttachList) {
1224
                 if (Objects.equals(caseAttach.getAnnexType(), AnnexTypeEnum.MEDIATE_BOOK_PDF.getCode())) {
1225
                 if (Objects.equals(caseAttach.getAnnexType(), AnnexTypeEnum.MEDIATE_BOOK_PDF.getCode())) {
1229
                     file = new File(path);
1230
                     file = new File(path);
1230
                     fileList.add(file);
1231
                     fileList.add(file);
1231
                     fileId = caseAttach.getAnnexId();
1232
                     fileId = caseAttach.getAnnexId();
1233
+                    fileNameMap.put(file.getPath(), caseAttach.getAnnexName());
1232
                     System.out.println("文件长度==================:" + file.length());
1234
                     System.out.println("文件长度==================:" + file.length());
1233
                 }
1235
                 }
1234
             }
1236
             }
1249
 
1251
 
1250
         if (file != null && file.exists()) {
1252
         if (file != null && file.exists()) {
1251
             try {
1253
             try {
1252
-                Boolean aBoolean = emailOutUtil.sendEmil(email, "您好,审核后的调解书在附件中请查阅", "签署后的调解书", fileList, null);
1254
+                Boolean aBoolean = emailOutUtil.sendEmil(email, "您好,审核后的调解书在附件中请查阅", "签署后的调解书", fileList, null,fileNameMap);
1253
 
1255
 
1254
                 if (aBoolean) {
1256
                 if (aBoolean) {
1255
                     sendMailRecord.setSendStatus(1);
1257
                     sendMailRecord.setSendStatus(1);

+ 6
- 1
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/sendrecord/impl/SendMailRecordServiceImpl.java View File

15
 
15
 
16
 import java.io.File;
16
 import java.io.File;
17
 import java.util.Date;
17
 import java.util.Date;
18
+import java.util.HashMap;
18
 import java.util.List;
19
 import java.util.List;
20
+import java.util.Map;
19
 
21
 
20
 @Service
22
 @Service
21
 public class SendMailRecordServiceImpl implements ISendMailRecordService {
23
 public class SendMailRecordServiceImpl implements ISendMailRecordService {
73
     @Override
75
     @Override
74
     public Boolean reSendMailRecord(SendMailRecord sendMailRecord) {
76
     public Boolean reSendMailRecord(SendMailRecord sendMailRecord) {
75
         List<File> fileList = null;
77
         List<File> fileList = null;
78
+        // 附件名称map,路径-附件名称
79
+        Map<String,String> fileNameMap=new HashMap<>();
76
         if (sendMailRecord.getFileIds() != null && sendMailRecord.getFileIds() != "") {
80
         if (sendMailRecord.getFileIds() != null && sendMailRecord.getFileIds() != "") {
77
             String[] fileIds = sendMailRecord.getFileIds().split(",");
81
             String[] fileIds = sendMailRecord.getFileIds().split(",");
78
             for (int i = 0; i < fileIds.length; i++) {
82
             for (int i = 0; i < fileIds.length; i++) {
87
                         String path = "/home/ruoyi/uploadPath/" + annexPath.substring(startIndex + 1);
91
                         String path = "/home/ruoyi/uploadPath/" + annexPath.substring(startIndex + 1);
88
                         File file = new File(path);
92
                         File file = new File(path);
89
                         fileList.add(file);
93
                         fileList.add(file);
94
+                        fileNameMap.put(file.getPath(), msCaseAttach.getAnnexName());
90
                     }
95
                     }
91
                 } catch (Exception e) {
96
                 } catch (Exception e) {
92
                     e.printStackTrace();
97
                     e.printStackTrace();
93
                 }
98
                 }
94
             }
99
             }
95
         }
100
         }
96
-        Boolean flag = emailOutUtil.sendEmil(sendMailRecord.getMailAddress(), sendMailRecord.getMailContent(), sendMailRecord.getMailSubject(), fileList, null);
101
+        Boolean flag = emailOutUtil.sendEmil(sendMailRecord.getMailAddress(), sendMailRecord.getMailContent(), sendMailRecord.getMailSubject(), fileList, null,fileNameMap);
97
        //发送成功后更细邮件记录的发送时间和发送状态
102
        //发送成功后更细邮件记录的发送时间和发送状态
98
         if (flag) {
103
         if (flag) {
99
             sendMailRecord.setSendStatus(1);
104
             sendMailRecord.setSendStatus(1);

+ 15
- 0
ruoyi-system/src/main/resources/mapper/wisdomarbitrate/mscase/MsCaseAttachMapper.xml View File

61
             </if>
61
             </if>
62
         </where>
62
         </where>
63
     </select>
63
     </select>
64
+    <select id="listCaseAttachByCaseIdAndTypes" resultType="com.ruoyi.wisdomarbitrate.domain.entity.mscase.MsCaseAttach" resultMap="CaseAttachResult">
65
+        select *
66
+        from ms_case_attach
67
+        <where>
68
+            <if test="caseAppliId != null ">
69
+                AND case_appli_id = #{caseAppliId}
70
+            </if>
71
+            <if test="annexTypes != null and annexTypes.size()>0 ">
72
+                AND annex_type in
73
+                <foreach collection="annexTypes" item="annex_type" open="(" separator="," close=")">
74
+                    #{annex_type}
75
+                </foreach>
76
+            </if>
77
+        </where>
78
+    </select>
64
 
79
 
65
     <delete id="deleteCaseAttachByCasedIdAndType">
80
     <delete id="deleteCaseAttachByCasedIdAndType">
66
         delete from ms_case_attach
81
         delete from ms_case_attach