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

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

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