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

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

wangqiong123 пре 2 година
родитељ
комит
7fb8b20955

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

@@ -60,9 +60,10 @@ public class MsVideoConferenceController extends BaseController {
60 60
     /**
61 61
      * 通用上传请求(单个)
62 62
      * param officeFlag: 是否上传到onlyoffice,0-否,1-是
63
+     * param isMediaBook: 是否上调解书,1-是,其余为否
63 64
      */
64 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 68
         try
68 69
         {
@@ -82,7 +83,7 @@ public class MsVideoConferenceController extends BaseController {
82 83
                 JSONArray jsonArray = caseApplicationService.uploadOnlyOffice(fileName,caseId);
83 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 87
                         msCaseAttachMapper.deleteCaseAttachByCasedIdAndType(caseId, annexType);
87 88
                     }
88 89
                     MsCaseAttach caseAttach=null;
@@ -118,7 +119,15 @@ public class MsVideoConferenceController extends BaseController {
118 119
                     return AjaxResult.error("上传失败");
119 120
                 }
120 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 131
                 Long annexId = saveCaseAttach(annexType, fileName, file.getOriginalFilename(), caseId);
123 132
                 // 是否上传到onlyoffice
124 133
                 AjaxResult ajax = AjaxResult.success();

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

@@ -104,8 +104,9 @@ public class EmailOutUtil {
104 104
      * @param message  邮件内容
105 105
      * @param subject  邮件主题
106 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 110
         try {
110 111
             String messageContent = "<html><body><p style=\"font-family: Arial, sans-serif; font-size: 18px;\">"+message+"。</p></body></html>";
111 112
             MimeBodyPart messageBodyPart = new MimeBodyPart();
@@ -162,7 +163,10 @@ public class EmailOutUtil {
162 163
                     for (File tempfile : fileList) {
163 164
                         MimeBodyPart attachmentPart = new MimeBodyPart();
164 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 170
                         multipart.addBodyPart(attachmentPart);
167 171
                     }
168 172
                     msg.setContent(multipart);

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

@@ -25,6 +25,7 @@ public interface MsCaseAttachMapper {
25 25
     int deleteByFileIds(@Param("ids") List<Integer> fileIds);
26 26
 
27 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 30
     MsCaseAttach queryAnnexById(@Param("annexId") Long annexId);
30 31
 

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

@@ -56,8 +56,9 @@ public interface MsCaseApplicationService {
56 56
      * @param caseApplication
57 57
      * @param affiliate
58 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 64
      * @param affiliate 相关人员信息

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

@@ -293,7 +293,7 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
293 293
         }
294 294
 
295 295
         for (MsCaseApplicationVO vo : list) {
296
-            if(vo.getMediatorId()!=null&&vo.getMediatorId()==loginUserId){
296
+            if(vo.getMediatorId()!=null&&vo.getMediatorId().equals(loginUserId)){
297 297
                 isMediatorRole=true;
298 298
             }
299 299
             // 设置申请人和被申请人
@@ -317,7 +317,7 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
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 321
                                     vo.setSignFlag(1);
322 322
                                 }
323 323
 
@@ -334,7 +334,7 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
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 338
                                     vo.setSignFlag(1);
339 339
                                 }
340 340
                             }
@@ -683,26 +683,34 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
683 683
         // 保存案件基本信息
684 684
         if (msCaseApplicationMapper.insertSelective(caseApplication) > 0) {
685 685
             List<MsCaseAttach> caseAttachList = caseApplication.getCaseAttachList();
686
+            int appOperatorCount=0;
687
+            int resOperatorCount=0;
686 688
             // 保存案件相关人员
687 689
                     List<MsCaseAffiliateBase> applicant = msCaseAffiliateVO.getApplicant();
688 690
                     List<MsCaseAffiliateBase> res = msCaseAffiliateVO.getRes();
689 691
                     if(CollectionUtil.isNotEmpty(applicant)){
690 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 699
                     if(CollectionUtil.isNotEmpty(res)){
698 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 716
             MsCaseApplicationReq req = new MsCaseApplicationReq();
@@ -753,13 +761,14 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
753 761
      * @param affiliate
754 762
      */
755 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 765
         if(affiliate==null){
758
-            return;
766
+            return operatorCount;
759 767
         }
768
+
760 769
         boolean b = affiliate.getOrganizeFlag() != 1 && (affiliate.getRoleType() == 1||affiliate.getRoleType() == 3) && StrUtil.isEmpty(affiliate.getEmail());
761 770
         if(b|| StrUtil.isEmpty(affiliate.getName())){
762
-            return;
771
+            return operatorCount;
763 772
         }
764 773
         affiliate.setGroupOrder(groupOrder);
765 774
         // 获取角色缓存
@@ -858,6 +867,10 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
858 867
         }
859 868
         // 保存人员
860 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,27 +1061,34 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
1048 1061
         Example affliateExample = new Example(MsCaseAffiliate.class);
1049 1062
         affliateExample.createCriteria().andEqualTo("caseAppliId", caseApplication.getId());
1050 1063
         msCaseAffiliateMapper.deleteByExample(affliateExample);
1051
-
1064
+        int appOperatorCount=0;
1065
+        int resOperatorCount=0;
1052 1066
 
1053 1067
             List<MsCaseAffiliateBase> applicant = msCaseAffiliateVO.getApplicant();
1054 1068
             List<MsCaseAffiliateBase> res = msCaseAffiliateVO.getRes();
1055 1069
             if(CollectionUtil.isNotEmpty(applicant)){
1056 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 1077
             if(CollectionUtil.isNotEmpty(res)){
1064 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 1092
         if (CollectionUtil.isNotEmpty(caseApplication.getCaseAttachList())) {
1073 1093
             for (MsCaseAttach caseAttach : caseApplication.getCaseAttachList()) {
1074 1094
                 caseAttach.setCaseAppliId(caseApplication.getId());
@@ -2543,22 +2563,61 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
2543 2563
         if (!applicantAffiliateOpt.isPresent() || !resAffiliateOpt.isPresent()) {
2544 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 2615
         if (application.getMediationMethod().equals("1")) {
2548 2616
             Integer mediaResult = application.getMediaResult();
2549 2617
             if (mediaResult == null) {
2550 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 2621
             if (mediaResult == 1) {
2563 2622
                 //达成调解
2564 2623
                 List<MsCaseAttach> caseAttachList = msCaseAttachMapper.queryAnnexPathByCaseId(req.getId());
@@ -3075,53 +3134,11 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
3075 3134
                 }
3076 3135
             }
3077 3136
         } else {
3137
+            // 线下调解
3078 3138
             Integer mediaResult=req.getMediaResult();
3079 3139
             if(mediaResult==null){
3080 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 3143
             Example flowExample = new Example(MsCaseFlow.class);
3127 3144
             if (mediaResult == 1 || mediaResult == 5) {

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

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

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

@@ -15,7 +15,9 @@ import org.springframework.stereotype.Service;
15 15
 
16 16
 import java.io.File;
17 17
 import java.util.Date;
18
+import java.util.HashMap;
18 19
 import java.util.List;
20
+import java.util.Map;
19 21
 
20 22
 @Service
21 23
 public class SendMailRecordServiceImpl implements ISendMailRecordService {
@@ -73,6 +75,8 @@ public class SendMailRecordServiceImpl implements ISendMailRecordService {
73 75
     @Override
74 76
     public Boolean reSendMailRecord(SendMailRecord sendMailRecord) {
75 77
         List<File> fileList = null;
78
+        // 附件名称map,路径-附件名称
79
+        Map<String,String> fileNameMap=new HashMap<>();
76 80
         if (sendMailRecord.getFileIds() != null && sendMailRecord.getFileIds() != "") {
77 81
             String[] fileIds = sendMailRecord.getFileIds().split(",");
78 82
             for (int i = 0; i < fileIds.length; i++) {
@@ -87,13 +91,14 @@ public class SendMailRecordServiceImpl implements ISendMailRecordService {
87 91
                         String path = "/home/ruoyi/uploadPath/" + annexPath.substring(startIndex + 1);
88 92
                         File file = new File(path);
89 93
                         fileList.add(file);
94
+                        fileNameMap.put(file.getPath(), msCaseAttach.getAnnexName());
90 95
                     }
91 96
                 } catch (Exception e) {
92 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 103
         if (flag) {
99 104
             sendMailRecord.setSendStatus(1);

+ 15
- 0
ruoyi-system/src/main/resources/mapper/wisdomarbitrate/mscase/MsCaseAttachMapper.xml Прегледај датотеку

@@ -61,6 +61,21 @@
61 61
             </if>
62 62
         </where>
63 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 80
     <delete id="deleteCaseAttachByCasedIdAndType">
66 81
         delete from ms_case_attach