11d65810 张雷

perf(alarm): 优化报警记录查询性能

- 在处理报警记录时,增加了对树路径字段的非空判断
- 使用 ConvertUtils.isNotEmpty() 替代了原有的判断方式
- 优化了代码结构,减少了不必要的循环和字符串操作
1 个父辈 88172627
...@@ -80,6 +80,7 @@ public class AlarmCustomRecordHistoryServiceImpl extends ServiceImpl<AlarmRecord ...@@ -80,6 +80,7 @@ public class AlarmCustomRecordHistoryServiceImpl extends ServiceImpl<AlarmRecord
80 List<AlarmRecordHistoryVO> recordList = pagelist.getRecords(); 80 List<AlarmRecordHistoryVO> recordList = pagelist.getRecords();
81 if(recordList!=null&&recordList.size()>0) { 81 if(recordList!=null&&recordList.size()>0) {
82 for(AlarmRecordHistoryVO record : recordList) { 82 for(AlarmRecordHistoryVO record : recordList) {
83 if(ConvertUtils.isNotEmpty(record.getAlarmCustomRuleTypeTreepath())){
83 String alarmCustomRuleTypeTreepath = record.getAlarmCustomRuleTypeTreepath(); 84 String alarmCustomRuleTypeTreepath = record.getAlarmCustomRuleTypeTreepath();
84 String[] customRuleTypeArray = alarmCustomRuleTypeTreepath.split(","); 85 String[] customRuleTypeArray = alarmCustomRuleTypeTreepath.split(",");
85 String customRuleTypeTreepathName = ""; 86 String customRuleTypeTreepathName = "";
...@@ -89,7 +90,8 @@ public class AlarmCustomRecordHistoryServiceImpl extends ServiceImpl<AlarmRecord ...@@ -89,7 +90,8 @@ public class AlarmCustomRecordHistoryServiceImpl extends ServiceImpl<AlarmRecord
89 if(StringUtils.isNotEmpty(customRuleTypeTreepathName)) { 90 if(StringUtils.isNotEmpty(customRuleTypeTreepathName)) {
90 record.setAlarmCustomRuleTypeTreepathName(customRuleTypeTreepathName.substring(1)); 91 record.setAlarmCustomRuleTypeTreepathName(customRuleTypeTreepathName.substring(1));
91 } 92 }
92 93 }
94 if(ConvertUtils.isNotEmpty(record.getAlarmRuleTypeTreepath())){
93 String alarmRuleTypeTreepath = record.getAlarmRuleTypeTreepath(); 95 String alarmRuleTypeTreepath = record.getAlarmRuleTypeTreepath();
94 String[] ruleTypeArray = alarmRuleTypeTreepath.split(","); 96 String[] ruleTypeArray = alarmRuleTypeTreepath.split(",");
95 String alarmRuleTypeTreepathName = ""; 97 String alarmRuleTypeTreepathName = "";
...@@ -101,6 +103,7 @@ public class AlarmCustomRecordHistoryServiceImpl extends ServiceImpl<AlarmRecord ...@@ -101,6 +103,7 @@ public class AlarmCustomRecordHistoryServiceImpl extends ServiceImpl<AlarmRecord
101 } 103 }
102 } 104 }
103 } 105 }
106 }
104 //添加流程信息 107 //添加流程信息
105 //获取流程实例id集合 108 //获取流程实例id集合
106 Set<String> processInstanceIdSet = new HashSet<String>(); 109 Set<String> processInstanceIdSet = new HashSet<String>();
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!