hejinbo 2 年前
父节点
当前提交
3fc79deee0

+ 10
- 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/AdjudicationController.java 查看文件

@@ -16,8 +16,18 @@ import org.springframework.web.bind.annotation.RestController;
16 16
 public class AdjudicationController extends BaseController {
17 17
     @Autowired
18 18
     private IAdjudicationService adjudicationService;
19
+
20
+    /**
21
+     * 生成裁决书
22
+     * @param caseApplication
23
+     * @return
24
+     */
19 25
     @PostMapping("/document")
20 26
     public AjaxResult createDocument(@Validated @RequestBody CaseApplication caseApplication){
21 27
         return adjudicationService.createDocument(caseApplication);
22 28
     }
29
+    @PostMapping("/")
30
+    public AjaxResult sendDocumentByEmail(){
31
+        return adjudicationService.sendDocumentByEmail();
32
+    }
23 33
 }

+ 41
- 0
ruoyi-common/src/main/java/com/ruoyi/common/utils/SendMailUtils.java 查看文件

@@ -0,0 +1,41 @@
1
+package com.ruoyi.common.utils;
2
+
3
+import com.sun.xml.internal.messaging.saaj.packaging.mime.MessagingException;
4
+import org.springframework.core.io.FileSystemResource;
5
+import org.springframework.mail.javamail.MimeMessageHelper;
6
+//
7
+//import java.io.File;
8
+//import java.util.List;
9
+//
10
+//public class SendMailUtils {
11
+//    /**
12
+//     * 发送带附件的邮件
13
+//     *
14
+//     * @param to       收件人
15
+//     * @param subject  主题
16
+//     * @param content  内容
17
+//     * @param fileList 附件
18
+//     */
19
+//    public void sendFileMail(String to, String subject, String content, List<File> fileList) {
20
+//        MimeMessage message = mailSender.createMimeMessage();
21
+//        try {
22
+//            //true表示需要创建一个multipart message
23
+//            MimeMessageHelper helper = new MimeMessageHelper(message, true);
24
+//            helper.setFrom(SENDER);
25
+//            helper.setTo(to);
26
+//            helper.setSubject(subject);
27
+//            helper.setText(content, true);
28
+//
29
+//            if (fileList != null && fileList.size() > 0) {
30
+//                for (File file : fileList) {
31
+//                    FileSystemResource fileSystemResource = new FileSystemResource(file);
32
+//                    String fileName = fileSystemResource.getFilename();
33
+//                    helper.addAttachment(fileName, fileSystemResource);
34
+//                }
35
+//            }
36
+//            mailSender.send(message);
37
+//        } catch (MessagingException e) {
38
+//            System.out.println("发送带附件的邮件时发生异常!" + e);
39
+//        }
40
+//    }
41
+//}

+ 1
- 2
ruoyi-common/src/main/java/com/ruoyi/common/utils/WordUtil.java 查看文件

@@ -19,8 +19,7 @@ import java.util.List;
19 19
 import java.util.Map;
20 20
 
21 21
 /**
22
- * @Author: ymbgy
23
- * @Date: 2022-09-21 13:26
22
+ * 文档生成工具类
24 23
  */
25 24
 public class WordUtil {
26 25
 

+ 3
- 0
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/IAdjudicationService.java 查看文件

@@ -5,4 +5,7 @@ import com.ruoyi.wisdomarbitrate.domain.CaseApplication;
5 5
 
6 6
 public interface IAdjudicationService {
7 7
     AjaxResult createDocument(CaseApplication caseApplication);
8
+
9
+    AjaxResult sendDocumentByEmail();
10
+
8 11
 }

+ 5
- 0
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/AdjudicationServiceImpl.java 查看文件

@@ -155,4 +155,9 @@ public class AdjudicationServiceImpl implements IAdjudicationService {
155 155
         }
156 156
         return null;
157 157
     }
158
+
159
+    @Override
160
+    public AjaxResult sendDocumentByEmail() {
161
+        return null;
162
+    }
158 163
 }