Procházet zdrojové kódy

原始代码 2022/10/8

lrj před 9 měsíci
rodič
revize
413b23f9a9

binární
logo.png


+ 17 - 1
pom.xml

@@ -14,7 +14,7 @@
     <name>MSS</name>
     <description>Demo project for Spring Boot</description>
     <properties>
-        <fastjson.version>2.0.0</fastjson.version>
+        <fastjson.version>2.0.12</fastjson.version>
     </properties>
     <dependencies>
         <dependency>
@@ -59,6 +59,22 @@
             <artifactId>aliyun-java-sdk-dysmsapi</artifactId>
             <version>1.1.0</version>
         </dependency>
+
+        <dependency>
+            <groupId>com.ejlchina</groupId>
+            <artifactId>okhttps</artifactId>
+            <version>3.1.1</version>
+        </dependency>
+        <dependency>
+            <groupId>com.squareup.okhttp3</groupId>
+            <artifactId>okhttp</artifactId>
+            <version>3.14.9</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.commons</groupId>
+            <artifactId>commons-compress</artifactId>
+            <version>1.21</version>
+        </dependency>
     </dependencies>
 
     <build>

+ 73 - 0
src/main/java/com/example/common/Service/outAPi/FileManagerService.java

@@ -0,0 +1,73 @@
+package com.example.common.Service.outAPi;
+
+import com.google.gson.Gson;
+import okhttp3.MediaType;
+import okhttp3.OkHttpClient;
+import okhttp3.Request;
+import okhttp3.RequestBody;
+import org.apache.commons.compress.utils.IOUtils;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Service;
+
+import java.io.*;
+import java.util.List;
+import java.util.Objects;
+import java.util.concurrent.TimeUnit;
+
+@Service
+public class FileManagerService {
+    @Value("${FMSUrl}")
+    private String FMSUrl;
+
+    public byte[] downloadSystemFileFromFMS(String fieldId) throws IOException {
+        OkHttpClient okHttpClient = new OkHttpClient.Builder()
+                .connectTimeout(60000, TimeUnit.SECONDS)
+                .writeTimeout(60000, TimeUnit.SECONDS)
+                .readTimeout(60000, TimeUnit.SECONDS)
+                .build();
+        Request request = new Request.Builder()
+                .url(FMSUrl + "/fileManager/downloadFile?fileId=" + fieldId)
+                .get()
+                .build();
+        return Objects.requireNonNull(okHttpClient.newCall(request).execute().body()).bytes();
+    }
+
+    /**
+     * 调用文件系统获取文件信息接口
+     *
+     * @param fileIds 文件ids
+     */
+    public String getSystemFileFromFMS(List<String> fileIds) throws IOException {
+        String param = new Gson().toJson(fileIds);
+        RequestBody requestBody = RequestBody.create(MediaType.parse("application/json"), param);
+        OkHttpClient okHttpClient = new OkHttpClient.Builder()
+                .connectTimeout(60, TimeUnit.SECONDS)
+                .writeTimeout(60, TimeUnit.SECONDS)
+                .readTimeout(60, TimeUnit.SECONDS)
+                .build();
+        Request request = new Request.Builder()
+                .url(FMSUrl + "/fileManager/getFileData")
+                .post(requestBody)
+                .build();
+        return Objects.requireNonNull(okHttpClient.newCall(request).execute().body()).string();
+    }
+
+    public File getFileByUrl(String fileGuid, String fileName, String suffix) {
+        File tempFile =null;
+        try {
+            byte[] bytes = this.downloadSystemFileFromFMS(fileGuid);
+            //创建临时文件tempFile,并将文件读取到tempFile
+             tempFile = File.createTempFile(fileName + "temp", suffix);
+            try (
+                    InputStream inputStream = new ByteArrayInputStream(bytes);
+                    FileOutputStream outputStream = new FileOutputStream(tempFile);
+            ) {
+                IOUtils.copy(inputStream, outputStream); // 将输入流复制到临时文件
+            }
+            return tempFile;
+        } catch (Exception e) {
+        }
+ return  tempFile;
+    }
+
+}

+ 42 - 7
src/main/java/com/example/common/Util/MailUtils.java

@@ -1,8 +1,11 @@
 package com.example.common.Util;
 
+import com.alibaba.fastjson.JSONArray;
+import com.example.common.Service.outAPi.FileManagerService;
+import com.example.common.common.SystemFile;
+import com.google.gson.JsonArray;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
-import org.springframework.core.io.ClassPathResource;
 import org.springframework.core.io.FileSystemResource;
 import org.springframework.mail.javamail.JavaMailSender;
 import org.springframework.mail.javamail.MimeMessageHelper;
@@ -12,15 +15,14 @@ import org.springframework.stereotype.Component;
 import javax.mail.internet.MimeMessage;
 import java.io.*;
 import java.text.MessageFormat;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
+import java.util.*;
 
 @Component
 public class MailUtils {
     @Value("${spring.mail.username}")
     private String sendEmail;
+    @Autowired
+    private FileManagerService fileManagerService;
 
     public String buildContent(String template, List<String> values) {
         //加载邮件html模板
@@ -78,15 +80,48 @@ public class MailUtils {
                 }
             }
             helper.setText(buildContent(map.get("template").toString(), values), true);
-            helper.setTo(map.get("email").toString());
+            if (map.get("emails") != null) {
+                String[] emailsStrs = (String[]) map.get("emails");
+                helper.setTo(emailsStrs);
+            } else {
+                helper.setTo(map.get("email").toString());
+            }
             if (map.get("cc") != null) {
-                String[] ccs =(String[])map.get("cc");
+                String[] ccs = (String[]) map.get("cc");
                 helper.setCc(ccs);
             }
 
+            if (map.get("bcc") != null) {
+                String[] bccs = (String[]) map.get("bcc");
+                helper.setBcc(bccs);
+            }
+            List<File> files = new ArrayList<>();
+            if (map.get("files") != null) {
+                String[] fileGuids = (String[]) map.get("files");
+                try {
+                    String res = fileManagerService.getSystemFileFromFMS(Arrays.asList(fileGuids));
+                    List<SystemFile> systemFiles = JSONArray.parseArray(res, SystemFile.class);
+                    for (int i = 0; i < systemFiles.size(); i++) {
+                        SystemFile systemFile = systemFiles.get(i);
+                        String fileName = systemFile.getOriginalName();
+                        String suffix = fileName.substring(fileName.lastIndexOf("."));
+                        File file = this.fileManagerService.getFileByUrl(systemFile.getGuid(), fileName, suffix);
+                        files.add(file);
+                        helper.addAttachment(fileName, file);
+                    }
+
+
+                } catch (Exception e) {
+                    e.printStackTrace();
+
+                }
+            }
             helper.addInline("logo", img);
             helper.setFrom(sendEmail);
             javaMailSender.send(message);
+            files.forEach(item -> {
+                item.delete();
+            });
         } catch (MessagingException | javax.mail.MessagingException e) {
             e.printStackTrace();
         }

+ 35 - 0
src/main/java/com/example/common/common/SystemFile.java

@@ -0,0 +1,35 @@
+package com.example.common.common;
+
+import lombok.Data;
+
+import java.util.Date;
+
+/**
+ * 系统文件实体类
+ *
+ * @Author xiexiang
+ * @Date 2023/6/1
+ */
+@Data
+
+public class SystemFile  {
+    /**
+     * 文件guid
+     */
+    private String guid;
+
+    /**
+     * 文件名称
+     */
+    private String fileName;
+
+    /**
+     * 原始名称
+     */
+    private String originalName;
+
+    /**
+     * 文件类型
+     */
+    private String type;
+}

+ 1 - 1
src/main/resources/application-prodNetIn.yml

@@ -1,6 +1,6 @@
 spring: # rabbitmq
   rabbitmq:
-    host: 172.27.247.174
+    host: 192.168.0.71
     port: 5672
     username: admin
     password: 123456

+ 1 - 1
src/main/resources/application-testNetIn.yml

@@ -1,6 +1,6 @@
 spring: # rabbitmq
   rabbitmq:
-    host: 172.27.247.174
+    host: 192.168.0.71
     port: 5672
     username: admin
     password: 123456

+ 2 - 1
src/main/resources/application.yml

@@ -27,9 +27,10 @@ spring:
            socketFactory:
              class: javax.net.ssl.SSLSocketFactory
            starttls:
-             enable: true
+             enable: false
   # 设置手动确认(ack) Queue -> C
 #  rabbitmq.listener.simple.acknowledge-mode: manual
 #  rabbitmq.listener.simple.prefetch: 100
 authorUrl: http://192.168.0.56:8880
+FMSUrl: http://192.168.2.24:8803
 

+ 57 - 0
src/main/resources/mail/addPersonEmail.html

@@ -0,0 +1,57 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+    <meta charset="utf-8">
+    <meta http-equiv="X-UA-Compatible" content="IE=edge">
+    <meta name="description" content="email code">
+    <meta name="viewport" content="width=device-width, initial-scale=1">
+    <title>邮件</title>
+</head>
+<!--邮箱验证码模板-->
+<body>
+<div style="background-color:#ECECEC; padding: 35px;">
+    <table style="width: 800px;height: 100%; margin: 0 auto; text-align: left; position: relative; border-radius: 5px;font-size: 14px; font-family:微软雅黑, 黑体,serif; line-height: 1.5; box-shadow: rgb(153, 153, 153) 0 0 5px; border-collapse: collapse; background: #fff initial initial initial initial;">
+        <tbody>
+        <tr>
+            <th style="height: 25px; line-height: 25px; padding: 15px 35px; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: RGB(148,0,211); background-color: RGB(148,0,211); border-radius: 5px 5px 0 0;">
+                <img src="cid:logo" alt="logo" style="width: 110px; height: 35px;">
+            </th>
+        </tr>
+        <tr>
+            <td style="word-break:break-all">
+                <div style="padding:25px 35px 40px; background-color:#fff;opacity:0.8;">
+                    <h2 style="margin: 5px 0; ">
+                        <span style="line-height: 20px;  color: #333333; ">
+                            <span style="line-height: 22px; font-size: medium; ">
+                                尊敬的用户 {0}:
+                            </span>
+                        </span>
+                    </h2>
+                    <!-- 中文 -->
+                    <p>您好! 您的小世系统账号开通成功!</p>
+                    <p>用户名:<span style="color: #ff8c00; ">{1}</span> 密码:<span style="color: #ff8c00; ">{2}</span>
+                    </p>
+     <p><span style="font-size:15px;font-weight:800">请点击以下链接进行查看</span>
+<p><a href="https://www.xsip.cn/login?url=/project"  style="color: #ff8c00; ">https://www.xsip.cn/login?url=/project</a></p>
+
+                    </p>
+                    <br>
+     
+                    <div style="width:100%;margin:0 auto;">
+                        <div style="padding:10px 10px 0;border-top:1px solid #ccc;color:#747474;margin-bottom:20px;line-height:1.3em;font-size:12px;">
+                            <p>威世博团队</p>
+                            <p>如果您有其他使用上的问题,请联系我们:********</p>
+                            <br>
+                            <p>此为系统邮件,请勿回复<br>Please do not reply to this system email
+                            </p>
+                        </div>
+                    </div>
+                </div>
+            </td>
+        </tr>
+        </tbody>
+    </table>
+</div>
+</body>
+</html>
+

+ 51 - 0
src/main/resources/mail/auditVersion.html

@@ -0,0 +1,51 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+    <meta charset="utf-8">
+    <meta http-equiv="X-UA-Compatible" content="IE=edge">
+    <meta name="description" content="email code">
+    <meta name="viewport" content="width=device-width, initial-scale=1">
+    <title>邮件</title>
+</head>
+<!--邮箱验证码模板-->
+<body>
+<div style="background-color:#ECECEC; padding: 35px;">
+    <table style="width: 800px;height: 100%; margin: 0 auto; text-align: left; position: relative; border-radius: 5px;font-size: 14px; font-family:微软雅黑, 黑体,serif; line-height: 1.5; box-shadow: rgb(153, 153, 153) 0 0 5px; border-collapse: collapse; background: #fff initial initial initial initial;">
+        <tbody>
+        <tr>
+            <th style="height: 25px; line-height: 25px; padding: 15px 35px; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: RGB(148,0,211); background-color: RGB(148,0,211); border-radius: 5px 5px 0 0;">
+                <img src="cid:logo" alt="logo" style="width: 110px; height: 35px;">
+            </th>
+        </tr>
+        <tr>
+            <td style="word-break:break-all">
+                <div style="padding:25px 35px 40px; background-color:#fff;opacity:0.8;">
+                    <h2 style="margin: 5px 0; ">
+                        <span style="line-height: 20px;  color: #333333; ">
+
+                        </span>
+                    </h2>
+                    <!-- 中文 -->
+                    <p>您好! 有新的版本审核任务,请查收</p>
+                    </p>
+                    <br>
+                  
+    
+                    <div style="width:100%;margin:0 auto;">
+                        <div style="padding:10px 10px 0;border-top:1px solid #ccc;color:#747474;margin-bottom:20px;line-height:1.3em;font-size:12px;">
+                            <p>威世博团队</p>
+                            <p>如果您有其他使用上的问题,请联系我们:********</p>
+                            <br>
+                            <p>此为系统邮件,请勿回复<br>Please do not reply to this system email
+                            </p>
+                        </div>
+                    </div>
+                </div>
+            </td>
+        </tr>
+        </tbody>
+    </table>
+</div>
+</body>
+</html>
+

+ 51 - 0
src/main/resources/mail/auditVersionDone.html

@@ -0,0 +1,51 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+    <meta charset="utf-8">
+    <meta http-equiv="X-UA-Compatible" content="IE=edge">
+    <meta name="description" content="email code">
+    <meta name="viewport" content="width=device-width, initial-scale=1">
+    <title>邮件</title>
+</head>
+<!--邮箱验证码模板-->
+<body>
+<div style="background-color:#ECECEC; padding: 35px;">
+    <table style="width: 800px;height: 100%; margin: 0 auto; text-align: left; position: relative; border-radius: 5px;font-size: 14px; font-family:微软雅黑, 黑体,serif; line-height: 1.5; box-shadow: rgb(153, 153, 153) 0 0 5px; border-collapse: collapse; background: #fff initial initial initial initial;">
+        <tbody>
+        <tr>
+            <th style="height: 25px; line-height: 25px; padding: 15px 35px; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: RGB(148,0,211); background-color: RGB(148,0,211); border-radius: 5px 5px 0 0;">
+                <img src="cid:logo" alt="logo" style="width: 110px; height: 35px;">
+            </th>
+        </tr>
+        <tr>
+            <td style="word-break:break-all">
+                <div style="padding:25px 35px 40px; background-color:#fff;opacity:0.8;">
+                    <h2 style="margin: 5px 0; ">
+                        <span style="line-height: 20px;  color: #333333; ">
+
+                        </span>
+                    </h2>
+                    <!-- 中文 -->
+                    <p>您好! 您提交的版本审核任务,已审核完毕</p>
+                    </p>
+                    <br>
+                  
+    
+                    <div style="width:100%;margin:0 auto;">
+                        <div style="padding:10px 10px 0;border-top:1px solid #ccc;color:#747474;margin-bottom:20px;line-height:1.3em;font-size:12px;">
+                            <p>威世博团队</p>
+                            <p>如果您有其他使用上的问题,请联系我们:********</p>
+                            <br>
+                            <p>此为系统邮件,请勿回复<br>Please do not reply to this system email
+                            </p>
+                        </div>
+                    </div>
+                </div>
+            </td>
+        </tr>
+        </tbody>
+    </table>
+</div>
+</body>
+</html>
+

+ 115 - 0
src/main/resources/mail/cycleTaskDone.html

@@ -0,0 +1,115 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+    <meta charset="utf-8">
+    <meta http-equiv="X-UA-Compatible" content="IE=edge">
+    <meta name="description" content="email code">
+    <meta name="viewport" content="width=device-width, initial-scale=1">
+    <title>邮件</title>
+</head>
+<!--邮箱验证码模板-->
+<body>
+<div class="email">
+    <div class="head">
+        <img style="width:70px;height: 35px;"  src="cid:logo" alt="logo" srcset="">
+    </div>
+    <div class="main">
+        <div class="body">
+            <div class="body_head"> 尊敬的用户 {0}:</div>
+            <div class="body_content">
+                您好!您监控的<span class="font-weight_bold">专利数据库{1}</span>,监控到了公开/公告日在<span class="font-weight_bold">{2}</span>范围内共<span class="font-weight_bold">{3}</span>件专利
+            </div>
+            <div class="body_content2">
+                请点击以下链接进行查看
+            </div>
+            <div>
+                <a class="a" href="https://www.xsip.cn/login?url=/project">https://www.xsip.cn/login?url=/project</a>
+            </div>
+        </div>
+        <div class="foot">
+            <div>如果您有系统相关问题请联系 <span class="link">朱鎏(电话:18856669949 邮箱:zhuliu@china-wispro.com)</span></div>
+            <div>如果您有数据相关问题请联系 <span class="link">国海秀(电话:18124613361 邮箱:guohaixiu@china-wispro.com)</span></div>
+            <div class="foot2">
+                <div>此为系统邮件,请勿回复</div>
+                <div>Please do not reply to this system email</div>
+            </div>
+        </div>
+    </div>
+    
+</div>
+</body>
+<style>
+    .email{
+        border-radius: 5px;
+        width: 800px;
+        margin: 0 auto;
+         text-align: left; 
+         font-size: 14px; 
+         font-family:微软雅黑, 黑体,serif; 
+         line-height: 1.5; 
+         box-shadow: rgb(153, 153, 153) 0 0 5px; 
+         border-collapse: collapse; 
+         background: #fff initial initial initial initial;
+    }
+    .head{
+        /* background-color: RGB(148,0,211); */
+        background-color: #316192;
+        height: 35px; 
+        line-height: 35px; 
+        padding: 15px 35px;
+    }
+    .head>img{
+        width:70px;
+        height: 35px;
+    }
+    .main{
+        padding:25px 35px 40px; 
+        background-color:#fff;
+        opacity:0.8;
+    }
+    .body{
+       
+    }
+    .body>*{
+        line-height: 40px;
+    }
+    .body_head{
+        line-height: 22px; 
+        font-size: medium;
+        color: #333333;
+        font-weight: bold;
+    }
+    .body_content{
+        font-size: 14px;
+        margin-top: 15px;
+    }
+    .body_content2{
+        font-size: 15px;
+        font-weight: bold;
+    }
+    .a{
+        color: #ff8c00;
+    }
+    .link{
+        color: #551A8B;
+    }
+    .font-weight_bold{
+        font-weight: bold;
+    }
+    .foot{
+        margin-top:20px;
+        padding: 10px;
+        padding-left: 0;
+        border-top: 1px solid #ccc;
+        color:#747474;
+        font-size: 12px;
+    }
+    .foot>*{
+        line-height: 25px;
+    }
+    .foot2{
+        margin-top: 30px;
+        line-height: 1.3em;
+    }
+</style>
+</html>

+ 56 - 0
src/main/resources/mail/cycleTaskDone2.html

@@ -0,0 +1,56 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+    <meta charset="utf-8">
+    <meta http-equiv="X-UA-Compatible" content="IE=edge">
+    <meta name="description" content="email code">
+    <meta name="viewport" content="width=device-width, initial-scale=1">
+    <title>邮件</title>
+</head>
+<!--邮箱验证码模板-->
+<body>
+<div style="background-color:#ECECEC; padding: 35px;">
+    <table style="width: 800px;height: 100%; margin: 0 auto; text-align: left; position: relative; border-radius: 5px;font-size: 14px; font-family:微软雅黑, 黑体,serif; line-height: 1.5; box-shadow: rgb(153, 153, 153) 0 0 5px; border-collapse: collapse; background: #fff initial initial initial initial;">
+        <tbody>
+        <tr>
+            <th style="height: 25px; line-height: 25px; padding: 15px 35px; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: RGB(148,0,211); background-color: RGB(148,0,211); border-radius: 5px 5px 0 0;">
+                <img src="cid:logo" data:" alt="logo" style="width: 110px; height: 35px;">
+            </th>
+        </tr>
+        <tr>
+            <td style="word-break:break-all">
+                <div style="padding:25px 35px 40px; background-color:#fff;opacity:0.8;">
+                    <h2 style="margin: 5px 0; ">
+                        <span style="line-height: 20px;  color: #333333; ">
+                            <span style="line-height: 22px; font-size: medium; ">
+                                尊敬的用户 {0}:
+                            </span>
+                        </span>
+                    </h2>
+                    <!-- 中文 -->
+                    <p>您好!您监控的<span style="font-size:14px;font-weight:800">专利数据库{1}</span>,监控到了公开/公告日在<span style="font-size:14px;font-weight:800">{2}</span>范围内共<span style="font-size:14px;font-weight:800">{3}</span>件专利</p>
+                    <p><span style="font-size:15px;font-weight:800">请点击以下链接进行查看</span>
+<p><a href="https://www.xsip.cn/login?url=/project"  style="color: #ff8c00; ">https://www.xsip.cn/login?url=/project</a></p>
+
+
+                    </p>
+                    <br>
+                  
+    
+                    <div style="width:100%;margin:0 auto;">
+                        <div style="padding:10px 10px 0;border-top:1px solid #ccc;color:#747474;margin-bottom:20px;line-height:1.3em;font-size:12px;">
+                            <p>威世博团队</p>
+                            <p>如果您有其他使用上的问题,请联系我们:********</p>
+                            <br>
+                            <p>此为系统邮件,请勿回复<br>Please do not reply to this system email
+                            </p>
+                        </div>
+                    </div>
+                </div>
+            </td>
+        </tr>
+        </tbody>
+    </table>
+</div>
+</body>
+</html>

+ 43 - 0
src/main/resources/mail/invalidSendFile.html

@@ -0,0 +1,43 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+    <meta charset="utf-8">
+    <meta http-equiv="X-UA-Compatible" content="IE=edge">
+    <meta name="description" content="email code">
+    <meta name="viewport" content="width=device-width, initial-scale=1">
+    <title>邮件</title>
+</head>
+<!--上传文件发送客户邮件模板-->
+<body>
+<div style="border-radius: 5px;width: 800px;margin: 0 auto;text-align: left; font-size: 14px; font-family:微软雅黑, 黑体,serif; line-height: 1.5; box-shadow: rgb(153, 153, 153) 0 0 5px; border-collapse: collapse; background: #fff initial initial initial initial;">
+    <div style="background-color: #316192;height: 35px; line-height: 35px; padding: 15px 35px;"> 
+        <img style="width:70px;height: 35px;"  src="cid:logo" alt="logo" srcset="">
+    </div>
+    <div style="padding:25px 35px 40px;background-color:#fff;opacity:0.8;">
+        <div class="body">
+            <div style="line-height: 22px; font-size: medium;color: #333333;font-weight: bold;">Dear {0}:</div>
+            <div style="font-size: 14px;margin-top: 15px;text-indent: 2em">
+                你们好!
+            </div>
+            <div style="font-size: 14px;margin-top: 15px;text-indent: 2em">
+                下述1件{1}无效案件,我所今天收到官方下发的{2},详细见附件,谢谢!
+            </div>
+            <div style="font-size: 14px;margin-top: 15px;text-indent: 2em">
+                详情可登陆小世系统查看<a style="color: #ff8c00;" href="{3}" target="_blank">{4}</a>报告。
+            </div>
+        </div>
+        <div style="margin-top:20px;padding: 10px;padding-left: 0;border-top: 1px solid #ccc;color:#747474;font-size: 12px; line-height: 25px;">
+            <div>如果您有系统相关问题请联系 <span style="color: #551A8B;">朱鎏(电话:18856669949 邮箱:zhuliu@china-wispro.com)</span></div>
+            <div>如果您有数据相关问题请联系 <span style="color: #551A8B;">国海秀(电话:18124613361 邮箱:guohaixiu@china-wispro.com)</span></div>
+            <div style="margin-top: 30px;line-height: 1.3em;">
+                <div>此为系统邮件,请勿回复</div>
+                <div>Please do not reply to this system email</div>
+            </div>
+        </div>
+    </div>
+    
+</div>
+</body>
+<style>
+</style>
+</html>

binární
src/main/resources/mail/logo.png


+ 51 - 0
src/main/resources/mail/personSignUp.html

@@ -0,0 +1,51 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+    <meta charset="utf-8">
+    <meta http-equiv="X-UA-Compatible" content="IE=edge">
+    <meta name="description" content="email code">
+    <meta name="viewport" content="width=device-width, initial-scale=1">
+    <title>邮件</title>
+</head>
+<!--邮箱验证码模板-->
+<body>
+<div style="background-color:#ECECEC; padding: 35px;">
+    <table style="width: 800px;height: 100%; margin: 0 auto; text-align: left; position: relative; border-radius: 5px;font-size: 14px; font-family:微软雅黑, 黑体,serif; line-height: 1.5; box-shadow: rgb(153, 153, 153) 0 0 5px; border-collapse: collapse; background: #fff initial initial initial initial;">
+        <tbody>
+        <tr>
+            <th style="height: 25px; line-height: 25px; padding: 15px 35px; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: RGB(148,0,211); background-color: RGB(148,0,211); border-radius: 5px 5px 0 0;">
+                <img src="cid:logo" alt="logo" style="width: 110px; height: 35px;">
+            </th>
+        </tr>
+        <tr>
+            <td style="word-break:break-all">
+                <div style="padding:25px 35px 40px; background-color:#fff;opacity:0.8;">
+                    <h2 style="margin: 5px 0; ">
+                        <span style="line-height: 20px;  color: #333333; ">
+
+                        </span>
+                    </h2>
+                    <!-- 中文 -->
+                    <p>您好! 有新的人员审核任务,请查收</p>
+                    </p>
+                    <br>
+                  
+    
+                    <div style="width:100%;margin:0 auto;">
+                        <div style="padding:10px 10px 0;border-top:1px solid #ccc;color:#747474;margin-bottom:20px;line-height:1.3em;font-size:12px;">
+                            <p>威世博团队</p>
+                            <p>如果您有其他使用上的问题,请联系我们:********</p>
+                            <br>
+                            <p>此为系统邮件,请勿回复<br>Please do not reply to this system email
+                            </p>
+                        </div>
+                    </div>
+                </div>
+            </td>
+        </tr>
+        </tbody>
+    </table>
+</div>
+</body>
+</html>
+

+ 53 - 0
src/main/resources/mail/sysCycleStart.html

@@ -0,0 +1,53 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+    <meta charset="utf-8">
+    <meta http-equiv="X-UA-Compatible" content="IE=edge">
+    <meta name="description" content="email code">
+    <meta name="viewport" content="width=device-width, initial-scale=1">
+    <title>邮件</title>
+</head>
+<!--邮箱验证码模板-->
+<body>
+<div style="background-color:#ECECEC; padding: 35px;">
+    <table style="width: 800px;height: 100%; margin: 0 auto; text-align: left; position: relative; border-radius: 5px;font-size: 14px; font-family:微软雅黑, 黑体,serif; line-height: 1.5; box-shadow: rgb(153, 153, 153) 0 0 5px; border-collapse: collapse; background: #fff initial initial initial initial;">
+        <tbody>
+        <tr>
+            <th style="height: 25px; line-height: 25px; padding: 15px 35px; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: RGB(148,0,211); background-color: RGB(148,0,211); border-radius: 5px 5px 0 0;">
+                <img src="cid:logo" alt="logo" style="width: 110px; height: 35px;">
+            </th>
+        </tr>
+        <tr>
+            <td style="word-break:break-all">
+                <div style="padding:25px 35px 40px; background-color:#fff;opacity:0.8;">
+                    <h2 style="margin: 5px 0; ">
+                        <span style="line-height: 20px;  color: #333333; ">
+                            <span style="line-height: 22px; font-size: medium; ">
+
+                            </span>
+                        </span>
+                    </h2>
+                    <!-- 中文 -->
+                    <p>系统定时任务开始执行</p>
+                    </p>
+                    <br>
+                  
+    
+                    <div style="width:100%;margin:0 auto;">
+                        <div style="padding:10px 10px 0;border-top:1px solid #ccc;color:#747474;margin-bottom:20px;line-height:1.3em;font-size:12px;">
+                            <p>威世博团队</p>
+                            <p>如果您有其他使用上的问题,请联系我们:********</p>
+                            <br>
+                            <p>此为系统邮件,请勿回复<br>Please do not reply to this system email
+                            </p>
+                        </div>
+                    </div>
+                </div>
+            </td>
+        </tr>
+        </tbody>
+    </table>
+</div>
+</body>
+</html>
+

+ 15 - 1
src/test/java/com/example/common/CommonApplicationTests.java

@@ -28,5 +28,19 @@ class CommonApplicationTests {
         map.put("cc",new String[]{"2672485393@qq.com"});
         mailUtils.sendEmailMessage(map);
     }
-
+    @Test
+    void contextLoads2() {
+        Map<String, Object> map = new LinkedHashMap<>();
+        map.put("title", "任务通知");
+        map.put("template", "mail/invalidSendFile.html");
+        map.put("value1", "123");
+        map.put("img", "\\src\\main\\resources\\mail\\logo.png");
+        map.put("email", "1kj-dtig68vv5e@dingtalk.com");
+        map.put("value2", "addPerson");
+        map.put("value3", "taskName");
+        map.put("value4", "endTime");
+        map.put("value5", "url");
+        map.put("files",new String[]{"480be325dd9b41d6b4a0d4cfa703fc71","20a86274fa1747e683d1744e56799ce8"});
+        mailUtils.sendEmailMessage(map);
+    }
 }