Browse Source

v1.1.1 规则集为空 进入编辑页面

yumeng 4 năm trước cách đây
mục cha
commit
df79fb077c

+ 1 - 1
module-alarm/src/main/java/cn/com/ctop/alarm/modules/controller/RuleTemplateController.java

@@ -80,6 +80,7 @@ public class RuleTemplateController {
         } catch (Exception e) {
             e.printStackTrace();
             result.setSuccess(false);
+            result.setResult(new JSONObject());
             result.setMessage(e.getMessage());
         }
 
@@ -87,7 +88,6 @@ public class RuleTemplateController {
     }
 
 
-
     /**
      * 通过id查询
      *

+ 2 - 2
module-alarm/src/main/java/cn/com/ctop/alarm/modules/service/impl/RuleTemplateServiceImpl.java

@@ -171,7 +171,7 @@ public class RuleTemplateServiceImpl extends ServiceImpl<RuleTemplateMapper, Rul
     public JSONObject queryDetailById(String id) throws Exception {
         JSONObject returnJson = new JSONObject();
         RuleTemplate template = ruleTemplateMapper.selectById(id);
-        if (Check.isNull(ruleTemplateMapper)) {
+        if (Check.isNull(template)) {
             throw new Exception("获取模板基本信息为空");
         }
 
@@ -180,7 +180,7 @@ public class RuleTemplateServiceImpl extends ServiceImpl<RuleTemplateMapper, Rul
         returnJson.put("mediaType", template.getMediaType());
         JSONArray groupIds = JSONArray.parseArray(template.getGroupIds());
         if (Check.isNull(groupIds)) {
-            throw new Exception("未获取规则集");
+            throw new Exception("规则集信息为空");
         }
         JSONArray ruleList = new JSONArray();
         for (int i = 0; i < groupIds.size(); i++) {