Browse Source

fix:“优化邮件时区"

soobin 9 months ago
parent
commit
2e27463ddd
1 changed files with 17 additions and 11 deletions
  1. 17 11
      src/main/java/com/szwl/util/WechatSendUtil.java

+ 17 - 11
src/main/java/com/szwl/util/WechatSendUtil.java

@@ -12,10 +12,13 @@ public class WechatSendUtil {
      * 发送邮件
      * @param email
      * @param name
-     * @param zoneID
+     * @param zoneId
      */
-    public static void sentEmail(String email, String name, String zoneID, String machineType) {
+    public static void sentEmail(String email, String name, String zoneId, String machineType) {
         String machineTypeStr = "";
+        if (StringUtils.isEmpty(zoneId)) {
+            zoneId = "Asia/Shanghai";
+        }
         switch (machineType) {
             case "0":
                 machineTypeStr = "Cotton Candy";  // 棉花糖
@@ -36,7 +39,7 @@ public class WechatSendUtil {
         String sContent = "Abnormal shutdown/The network is disconnected.";
         String str3 = "<br>" + " Time&Date: ";
 //        String nowDateUTC = DateTimeFmtUtil.getNowDateUTC();
-        String timeByZoneID = TimezoneFmtUtil.getTimeByZoneID(zoneID);
+        String timeByZoneID = TimezoneFmtUtil.getTimeByZoneID(zoneId);
         String str4 = "<br>" + "<br>" + "Dear customer:<br>";
         String str5 = " This is an automatic-sent mail to inform you that there is an error occurred on one of your " + machineTypeStr + " machines, please kindly check the details as above.<br>";
         String str6 = " <br>You don't have to reply this mail. What you need to do is to follow the instructions on the touch screen to clear the error and recover the machine. If there is any question or more information you need. Please do not be hesitated to contact your distributor.<br>" +
@@ -56,10 +59,13 @@ public class WechatSendUtil {
      * 发送邮件
      * @param email
      * @param name
-     * @param zoneID
+     * @param zoneId
      */
-    public static void sentEmail(String email, String name, String zoneID, String machineType, String alarmContent) {
+    public static void sentEmail(String email, String name, String zoneId, String machineType, String alarmContent) {
         String machineTypeStr = "";
+        if (StringUtils.isEmpty(zoneId)) {
+            zoneId = "Asia/Shanghai";
+        }
         switch (machineType) {
             case "0":
                 machineTypeStr = "Cotton Candy";  // 棉花糖
@@ -79,7 +85,7 @@ public class WechatSendUtil {
         String str2 = "<br>" + " <b>Error message: </b>";
 //        String sContent = "Abnormal shutdown/The network is disconnected.";
         String str3 = "<br>" + " Time&Date: ";
-        String timeByZoneID = TimezoneFmtUtil.getTimeByZoneID(zoneID);
+        String timeByZoneID = TimezoneFmtUtil.getTimeByZoneID(zoneId);
         String str4 = "<br>" + "<br>" + "Dear customer:<br>";
         String str5 = " This is an automatic-sent mail to inform you that there is an error occurred on one of your " + machineTypeStr + " machines, please kindly check the details as above.<br>";
         String str6 = " <br>You don't have to reply this mail. What you need to do is to follow the instructions on the touch screen to clear the error and recover the machine. If there is any question or more information you need. Please do not be hesitated to contact your distributor.<br>" +
@@ -99,12 +105,12 @@ public class WechatSendUtil {
      * 发送设备上下线邮件
      * @param email
      * @param name
-     * @param zoneID
+     * @param zoneId
      */
-    public static void sentEmail(String email, String name, String zoneID, String machineType, Integer eqeStatus) {
+    public static void sentEmail(String email, String name, String zoneId, String machineType, Integer eqeStatus) {
         String machineTypeStr = "";
-        if (StringUtils.isEmpty(zoneID)) {
-            zoneID = "Asia/Shanghai";
+        if (StringUtils.isEmpty(zoneId)) {
+            zoneId = "Asia/Shanghai";
         }
         switch (machineType) {
             case "0":
@@ -133,7 +139,7 @@ public class WechatSendUtil {
         StringBuilder content = new StringBuilder();
         String str1 = " <b>Machine name: </b>";
         String str3 = "<br>" + " <b>Time&Date: </b>";
-        String timeByZoneId = TimezoneFmtUtil.getTimeByZoneID(zoneID);
+        String timeByZoneId = TimezoneFmtUtil.getTimeByZoneID(zoneId);
         String str4 = "<br>" + "<br>" + "Dear customer:<br>";
         String str5 = eqeStatusContent + " This email is just a reminder, you don't need to reply. <br>";
         String str6 = "<br>" + " Thank you for choosing our machine!<br>" +