监测平台系统bug优化处理离线报警规则打开报错解决

breach-zhy
马雪伟 3 months ago
parent 8e141b9607
commit 04445e77ae

@ -117,14 +117,21 @@ public class HwAlarmRuleServiceImpl implements IHwAlarmRuleService {
@Transactional @Transactional
@Override @Override
public int insertHwAlarmRule(HwAlarmRule hwAlarmRule) { public int insertHwAlarmRule(HwAlarmRule hwAlarmRule) {
String triggerExpression = this.getTriggerExpression(hwAlarmRule); List<Long> ruleDeviceIds = hwAlarmRule.getRuleDeviceIds();
hwAlarmRule.setTriggerExpression(triggerExpression); int rows = 0;
hwAlarmRule.setAlarmPushFlag(HwDictConstants.ALARM_PUSH_FLAG_NO); for (Long ruleDeviceId : ruleDeviceIds) {
hwAlarmRule.setCreateTime(DateUtils.getNowDate()); hwAlarmRule.setRuleDeviceId(ruleDeviceId);
hwAlarmRule.setTenantId(SecurityUtils.getTenantId()); String triggerExpression = this.getTriggerExpression(hwAlarmRule);
hwAlarmRule.setCreateBy(SecurityUtils.getUsername()); hwAlarmRule.setTriggerExpression(triggerExpression);
int rows = hwAlarmRuleMapper.insertHwAlarmRule(hwAlarmRule); hwAlarmRule.setAlarmPushFlag(HwDictConstants.ALARM_PUSH_FLAG_NO);
insertHwAlarmRuleLink(hwAlarmRule); hwAlarmRule.setCreateTime(DateUtils.getNowDate());
hwAlarmRule.setTenantId(SecurityUtils.getTenantId());
hwAlarmRule.setCreateBy(SecurityUtils.getUsername());
int rowsAdd = hwAlarmRuleMapper.insertHwAlarmRule(hwAlarmRule);
insertHwAlarmRuleLink(hwAlarmRule);
rows += rowsAdd;
}
return rows; return rows;
} }

@ -0,0 +1,19 @@
package com.ruoyi.business.service.impl;
import com.ruoyi.business.domain.HwOfflineRule;
import com.ruoyi.business.mapper.HwOfflineRuleMapper;
import com.ruoyi.business.service.HwOfflineRuleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
@Service
public class HwOfflineRuleServiceImpl implements HwOfflineRuleService {
@Autowired
private HwOfflineRuleMapper hwOfflineRuleMapper;
@Override
public List<HwOfflineRule> selectRuleList(HwOfflineRule hwOfflineRule) {
List<HwOfflineRule> hwOfflineRules = hwOfflineRuleMapper.selectHwOfflineRuleJoinList(hwOfflineRule);
return hwOfflineRules;
}
}
Loading…
Cancel
Save