|
@@ -32,6 +32,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.util.CollectionUtils;
|
|
|
|
|
|
+import java.sql.Timestamp;
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
@@ -82,8 +83,7 @@ public class GroupAlarmRuleServiceImpl extends ServiceImpl<GroupAlarmRuleMapper,
|
|
|
addAlarmConfigDTO.setLevel(alarmCondition.getAlarmLevel());
|
|
|
AlarmCondition condition = new AlarmCondition();
|
|
|
condition.setTrigger((String) conditionMap.get("backend"));
|
|
|
- String infoCode = (String) conditionMap.get("infoCode");
|
|
|
- List<String> infoCodeList = (List<String>) JSONArray.parse(infoCode);
|
|
|
+ List<String> infoCodeList = (List<String>) conditionMap.get("infoCode");
|
|
|
condition.setInfoCode(infoCodeList);
|
|
|
condition.setTriggerUphold(alarmCondition.getTriggerUphold());
|
|
|
condition.setRules((List<String>) conditionMap.get("conditionMap"));
|
|
@@ -108,6 +108,7 @@ public class GroupAlarmRuleServiceImpl extends ServiceImpl<GroupAlarmRuleMapper,
|
|
|
*/
|
|
|
private void setDefaultValue(GroupAlarmRule groupAlarmRule) {
|
|
|
groupAlarmRule.setCreator(PoemsContext.getContext().getUserId());
|
|
|
+ groupAlarmRule.setTs(new Timestamp(System.currentTimeMillis()));
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -237,18 +238,18 @@ public class GroupAlarmRuleServiceImpl extends ServiceImpl<GroupAlarmRuleMapper,
|
|
|
|
|
|
// todo 需判断使用like还是eq
|
|
|
if (StringUtils.isNotEmpty(pageQueryGroupAlarmRuleDTO.getGroupId())) {
|
|
|
- queryWrapper.like(GroupAlarmRule.PROP_GROUP_ID, pageQueryGroupAlarmRuleDTO.getGroupId());
|
|
|
+ queryWrapper.eq(GroupAlarmRule.PROP_GROUP_ID, pageQueryGroupAlarmRuleDTO.getGroupId());
|
|
|
}
|
|
|
|
|
|
// todo 需判断使用like还是eq
|
|
|
- if (StringUtils.isNotEmpty(pageQueryGroupAlarmRuleDTO.getAlarmItemCode())) {
|
|
|
- queryWrapper.like(GroupAlarmRule.PROP_ALARM_ITEM_CODE, pageQueryGroupAlarmRuleDTO.getAlarmItemCode());
|
|
|
+ if (StringUtils.isNotEmpty(pageQueryGroupAlarmRuleDTO.getAlarmItemName())) {
|
|
|
+ queryWrapper.like(GroupAlarmRule.PROP_ALARM_ITEM_NAME, pageQueryGroupAlarmRuleDTO.getAlarmItemName());
|
|
|
}
|
|
|
|
|
|
- // todo 需判断使用like还是eq
|
|
|
- if (StringUtils.isNotEmpty(pageQueryGroupAlarmRuleDTO.getAlarmConditionId())) {
|
|
|
- queryWrapper.like(GroupAlarmRule.PROP_ALARM_CONDITION_ID, pageQueryGroupAlarmRuleDTO.getAlarmConditionId());
|
|
|
- }
|
|
|
+// // todo 需判断使用like还是eq
|
|
|
+// if (StringUtils.isNotEmpty(pageQueryGroupAlarmRuleDTO.getAlarmConditionId())) {
|
|
|
+// queryWrapper.like(GroupAlarmRule.PROP_ALARM_CONDITION_ID, pageQueryGroupAlarmRuleDTO.getAlarmConditionId());
|
|
|
+// }
|
|
|
|
|
|
return getBaseMapper().selectPage(pageParam, queryWrapper);
|
|
|
}
|