hejinbo 2 лет назад
Родитель
Сommit
3fc79deee0

+ 10
- 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/AdjudicationController.java Просмотреть файл

16
 public class AdjudicationController extends BaseController {
16
 public class AdjudicationController extends BaseController {
17
     @Autowired
17
     @Autowired
18
     private IAdjudicationService adjudicationService;
18
     private IAdjudicationService adjudicationService;
19
+
20
+    /**
21
+     * 生成裁决书
22
+     * @param caseApplication
23
+     * @return
24
+     */
19
     @PostMapping("/document")
25
     @PostMapping("/document")
20
     public AjaxResult createDocument(@Validated @RequestBody CaseApplication caseApplication){
26
     public AjaxResult createDocument(@Validated @RequestBody CaseApplication caseApplication){
21
         return adjudicationService.createDocument(caseApplication);
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 Просмотреть файл

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

+ 3
- 0
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/IAdjudicationService.java Просмотреть файл

5
 
5
 
6
 public interface IAdjudicationService {
6
 public interface IAdjudicationService {
7
     AjaxResult createDocument(CaseApplication caseApplication);
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
         }
155
         }
156
         return null;
156
         return null;
157
     }
157
     }
158
+
159
+    @Override
160
+    public AjaxResult sendDocumentByEmail() {
161
+        return null;
162
+    }
158
 }
163
 }