ly 3 лет назад
Родитель
Сommit
e8f2583bf4

+ 78 - 24
master/src/main/java/com/ruoyi/framework/task/TSpecdevAllTask.java

@@ -172,19 +172,28 @@ public class TSpecdevAllTask extends BaseController {
                     // 半年内 预警标识为2级
                     if (day > 0 && day <= secondlevel) {
                         this.updateForGl(2L, tSpecdevGl);
-                        firstList.add(tSpecdevGl);
+                        //只在当天发送邮件
+                        if (day == secondlevel) {
+                            firstList.add(tSpecdevGl);
+                        }
                         continue;
                     }
                     // 半年-一年 预警标识为1级
                     if (day > secondlevel && day <= thirdlevel) {
                         this.updateForGl(1L, tSpecdevGl);
-                        secondList.add(tSpecdevGl);
+                        //只在当天发送邮件
+                        if (day == thirdlevel) {
+                            secondList.add(tSpecdevGl);
+                        }
                         continue;
                     }
                     // 超时 预警标识为3级
-                    if (day < firstlevel) {
+                    if (day <= firstlevel) {
                         this.updateForGl(3L, tSpecdevGl);
-                        thirdList.add(tSpecdevGl);
+                        //只在当天发送邮件
+                        if (day == firstlevel) {
+                            thirdList.add(tSpecdevGl);
+                        }
                         continue;
                     }
                     if (day > thirdlevel) {
@@ -235,19 +244,28 @@ public class TSpecdevAllTask extends BaseController {
                     // 半年内 预警标识为2级
                     if (day > 0 && day <= secondlevel) {
                         this.updateForCc(2L, tSpecdevCc);
-                        firstList.add(tSpecdevCc);
+                        //只在当天发送邮件
+                        if (day == secondlevel) {
+                            firstList.add(tSpecdevCc);
+                        }
                         continue;
                     }
                     // 半年-一年 预警标识为1级
                     if (day > secondlevel && day <= thirdlevel) {
                         this.updateForCc(1L, tSpecdevCc);
-                        secondList.add(tSpecdevCc);
+                        //只在当天发送邮件
+                        if (day == thirdlevel) {
+                            secondList.add(tSpecdevCc);
+                        }
                         continue;
                     }
                     // 超时 预警标识为3级
-                    if (day < firstlevel) {
+                    if (day <= firstlevel) {
                         this.updateForCc(3L, tSpecdevCc);
-                        thirdList.add(tSpecdevCc);
+                        //只在当天发送邮件
+                        if (day == firstlevel) {
+                            thirdList.add(tSpecdevCc);
+                        }
                         continue;
                     }
                     if (day > thirdlevel) {
@@ -298,19 +316,28 @@ public class TSpecdevAllTask extends BaseController {
                     // 半年内 预警标识为2级
                     if (day > 0 && day <= secondlevel) {
                         this.updateForDzsb(2L, tSpecdevDzsb);
-                        firstList.add(tSpecdevDzsb);
+                        //只在当天发送邮件
+                        if (day == secondlevel) {
+                            firstList.add(tSpecdevDzsb);
+                        }
                         continue;
                     }
                     // 半年-一年 预警标识为1级
                     if (day > secondlevel && day <= thirdlevel) {
                         this.updateForDzsb(1L, tSpecdevDzsb);
-                        secondList.add(tSpecdevDzsb);
+                        //只在当天发送邮件
+                        if (day == thirdlevel) {
+                            secondList.add(tSpecdevDzsb);
+                        }
                         continue;
                     }
                     // 超时 预警标识为3级
-                    if (day < firstlevel) {
+                    if (day <= firstlevel) {
                         this.updateForDzsb(3L, tSpecdevDzsb);
-                        thirdList.add(tSpecdevDzsb);
+                        //只在当天发送邮件
+                        if (day == firstlevel) {
+                            thirdList.add(tSpecdevDzsb);
+                        }
                         continue;
                     }
                     if (day > thirdlevel ) {
@@ -361,19 +388,28 @@ public class TSpecdevAllTask extends BaseController {
                     // 半年内 预警标识为2级
                     if (day > 0 && day <= secondlevel) {
                         this.updateForYlrq(2L, tSpecdevYlrq);
-                        firstList.add(tSpecdevYlrq);
+                        //只在当天发送邮件
+                        if (day == secondlevel) {
+                            firstList.add(tSpecdevYlrq);
+                        }
                         continue;
                     }
                     // 半年-一年 预警标识为1级
                     if (day > secondlevel && day <= thirdlevel) {
                         this.updateForYlrq(1L, tSpecdevYlrq);
-                        secondList.add(tSpecdevYlrq);
+                        //只在当天发送邮件
+                        if (day == thirdlevel) {
+                            secondList.add(tSpecdevYlrq);
+                        }
                         continue;
                     }
                     // 超时 预警标识为3级
-                    if (day < firstlevel) {
+                    if (day <= firstlevel) {
                         this.updateForYlrq(3L, tSpecdevYlrq);
-                        thirdList.add(tSpecdevYlrq);
+                        //只在当天发送邮件
+                        if (day == firstlevel) {
+                            thirdList.add(tSpecdevYlrq);
+                        }
                         continue;
                     }
                     if (day > thirdlevel ) {
@@ -424,19 +460,28 @@ public class TSpecdevAllTask extends BaseController {
                     // 半年内 预警标识为2级
                     if (day > 0 && day <= secondlevel) {
                         this.updateForYlgd(2L, tSpecdevYlgd);
-                        firstList.add(tSpecdevYlgd);
+                        //只在当天发送邮件
+                        if (day == secondlevel) {
+                            firstList.add(tSpecdevYlgd);
+                        }
                         continue;
                     }
                     // 半年-一年 预警标识为1级
                     if (day > secondlevel && day <= thirdlevel) {
                         this.updateForYlgd(1L, tSpecdevYlgd);
-                        secondList.add(tSpecdevYlgd);
+                        //只在当天发送邮件
+                        if (day == thirdlevel) {
+                            secondList.add(tSpecdevYlgd);
+                        }
                         continue;
                     }
                     // 超时 预警标识为3级
-                    if (day < firstlevel) {
+                    if (day <= firstlevel) {
                         this.updateForYlgd(3L, tSpecdevYlgd);
-                        thirdList.add(tSpecdevYlgd);
+                        //只在当天发送邮件
+                        if (day == firstlevel) {
+                            thirdList.add(tSpecdevYlgd);
+                        }
                         continue;
                     }
                     // 半年-一年 预警标识为1级
@@ -486,19 +531,28 @@ public class TSpecdevAllTask extends BaseController {
                     // 半年内 预警标识为2级
                     if (day > 0 && day <= secondlevel) {
                         this.updateForDt(2L, tSpecdevDt);
-                        firstList.add(tSpecdevDt);
+                        //只在当天发送邮件
+                        if (day == secondlevel) {
+                            firstList.add(tSpecdevDt);
+                        }
                         continue;
                     }
                     // 半年-一年 预警标识为1级
                     if (day > secondlevel && day <= thirdlevel) {
                         this.updateForDt(1L, tSpecdevDt);
-                        secondList.add(tSpecdevDt);
+                        //只在当天发送邮件
+                        if (day == thirdlevel) {
+                            secondList.add(tSpecdevDt);
+                        }
                         continue;
                     }
                     // 超时 预警标识为3级
-                    if (day < firstlevel) {
+                    if (day <= firstlevel) {
                         this.updateForDt(3L, tSpecdevDt);
-                        thirdList.add(tSpecdevDt);
+                        //只在当天发送邮件
+                        if (day == firstlevel) {
+                            thirdList.add(tSpecdevDt);
+                        }
                         continue;
                     }
                     if (day > thirdlevel ) {

+ 14 - 14
master/src/main/resources/application.yml

@@ -93,24 +93,24 @@ spring:
         max-wait: -1ms
   # 邮箱配置
   mail:
-    host: smtpout.basf-it-services.com
-    protocol: smtp
-    default-encoding: UTF-8
-    password:
-    username:
-    port: 25
-    properties.mail.stmp.socketFactory.class: javax.net.ssl.SSLSocketFactory
-    properties.mail.debug: true
-    from: CPMS.byc@BASF-YPC.com.cn
-#    host: smtp.exmail.qq.com
+#    host: smtpout.basf-it-services.com
 #    protocol: smtp
 #    default-encoding: UTF-8
-#    password: vvTAT8hciG7FLk4C
-#    username: email@seashoreept.com
-#    port: 587
+#    password:
+#    username:
+#    port: 25
 #    properties.mail.stmp.socketFactory.class: javax.net.ssl.SSLSocketFactory
 #    properties.mail.debug: true
-#    from: email@seashoreept.com
+#    from: CPMS.byc@BASF-YPC.com.cn
+    host: smtp.exmail.qq.com
+    protocol: smtp
+    default-encoding: UTF-8
+    password: vvTAT8hciG7FLk4C
+    username: email@seashoreept.com
+    port: 587
+    properties.mail.stmp.socketFactory.class: javax.net.ssl.SSLSocketFactory
+    properties.mail.debug: true
+    from: email@seashoreept.com
 # token配置
 token:
     # 令牌自定义标识