瀏覽代碼

Merge branch 'feature_mysqlToElasticSearch' of elabFrameworkCore/jay-monitor-data-web into master

wangs 3 年之前
父節點
當前提交
a531ca5365

+ 3 - 5
jay-monitor-data-server/src/main/java/com/jay/monitor/data/server/report/DayAlertProcess.java

@@ -48,17 +48,15 @@ public class DayAlertProcess implements ClazzEqualsProcess {
         }
 
         // 构建消息
-        for (int i = 0; i < listReportInvokes.size(); i++) {
-            NameReport invoke = listReportInvokes.get(i);
+        for (NameReport invoke : listReportInvokes) {
             String reportContent = invoke.formatReport(date);
             if (reportContent != null) {
-                allMdAlertContent.append(reportContent + MdConstants.newLine);
+                allMdAlertContent.append(reportContent).append(MdConstants.newLine);
             }
         }
 
         // 发送消息
-        for (int i = 0; i < alertMsgList.size(); i++) {
-            AlertReportMsg alertMsgProcess = alertMsgList.get(i);
+        for (AlertReportMsg alertMsgProcess : alertMsgList) {
             boolean msgSend = alertMsgProcess.send(date, allMdAlertContent.toString());
             logger.info("消息发送[" + alertMsgProcess.alertType() + "]结果:" + msgSend);
         }

+ 1 - 1
jay-monitor-data-server/src/main/java/com/jay/monitor/data/server/report/alert/rule/ConfigAlertRule.java

@@ -75,7 +75,7 @@ public class ConfigAlertRule implements CommonDataTriggerRule, InitializingBean
 
             Object value = baseMap.get(fieldName);
 
-            if (fieldName.equals("all") || MatchRuleEnums.expression == ruleType) {
+            if ("all".equals(fieldName) || MatchRuleEnums.expression == ruleType) {
                 value = commonDataDTO;
             }
 

+ 3 - 2
jay-monitor-data-server/src/main/java/com/jay/monitor/data/server/store/es/AbstractCRUDElasticSearch.java

@@ -68,8 +68,9 @@ public abstract class AbstractCRUDElasticSearch<ENTITY, REQ> {
         try {
             return elasticSearchPartition.deleteById(id, getEntityClazz());
         } catch (Exception e) {
-            e.printStackTrace();
-        } return false;
+            logger.error("删除失败!", e);
+        }
+        return false;
     }
 
     public boolean update(REQ req) {