交换机监控策略bug修复

This commit is contained in:
gaoyutao
2025-10-16 19:05:46 +08:00
parent c6937eb44b
commit b3f16d2c8f
5 changed files with 8 additions and 8 deletions

View File

@@ -52,7 +52,7 @@ public interface RmTemplateLinuxMapper
* @return 结果
*/
public int deleteRmTemplateLinuxById(Long id);
public int deleteRmTemplateLinuxByPolicyId(Long policyId);
public int deleteByPolicyId(Long policyId);
/**
* 批量删除Linux系统监控项

View File

@@ -52,7 +52,7 @@ public interface RmTemplateSwitchMapper
* @return 结果
*/
public int deleteRmTemplateSwitchById(Long id);
public int deleteRmTemplateSwitchByPolicyId(Long policyId);
public int deleteByPolicyId(Long policyId);
/**
* 批量删除交换机监控模板

View File

@@ -184,8 +184,8 @@ public class RmMonitorPolicyServiceImpl implements IRmMonitorPolicyService
rmTemplateLinuxMapper.updateByTemplateId(templateId);
rmTemplateSwitchMapper.updateByTemplateId(templateId);
if(rmMonitorPolicy.getTemplateId()==null){
rmTemplateLinuxMapper.deleteRmTemplateLinuxByPolicyId(id);
rmTemplateSwitchMapper.deleteRmTemplateSwitchByPolicyId(id);
rmTemplateLinuxMapper.deleteByPolicyId(id);
rmTemplateSwitchMapper.deleteByPolicyId(id);
}
}
return rmMonitorPolicyMapper.deleteRmMonitorPolicyByIds(ids);
@@ -306,7 +306,7 @@ public class RmMonitorPolicyServiceImpl implements IRmMonitorPolicyService
if(!collectionAndIdList.isEmpty()){
if("linux".equals(rmMonitorPolicy.getResourceType())){
// 修改之前先删除
rmTemplateLinuxMapper.deleteRmTemplateLinuxByPolicyId(rmMonitorPolicy.getId());
rmTemplateLinuxMapper.deleteByPolicyId(rmMonitorPolicy.getId());
for (RmMonitorPolicyVo rmMonitorPolicyVo : collectionAndIdList) {
RmInitialMonitorItem monitorItems = rmInitialMonitorItemMapper.selectRmInitialMonitorItemById(rmMonitorPolicyVo.getId());
RmTemplateLinux linuxItem = new RmTemplateLinux();
@@ -320,7 +320,7 @@ public class RmMonitorPolicyServiceImpl implements IRmMonitorPolicyService
}
}else if("switch".equals(rmMonitorPolicy.getResourceType())){
// 修改之前先置空所有采集周期
rmTemplateSwitchMapper.deleteRmTemplateSwitchByPolicyId(rmMonitorPolicy.getId());
rmTemplateSwitchMapper.deleteByPolicyId(rmMonitorPolicy.getId());
for (RmMonitorPolicyVo rmMonitorPolicyVo : collectionAndIdList) {
// 添加采集周期
RmInitialMonitorItem monitorItems = rmInitialMonitorItemMapper.selectRmInitialMonitorItemById(rmMonitorPolicyVo.getId());

View File

@@ -134,7 +134,7 @@
update rm_template_linux set collection_cycle = null
where template_id = #{templateId}
</update>
<delete id="deleteByTemplatePolicyId" parameterType="Long">
<delete id="deleteByPolicyId" parameterType="Long">
delete from rm_template_linux where policy_id = #{policyId}
</delete>
<update id="updateByPolicyId" parameterType="RmTemplateLinux">

View File

@@ -165,7 +165,7 @@
update rm_template_switch set collection_cycle = null
where template_id = #{templateId}
</update>
<delete id="deleteByTemplatePolicyId" parameterType="Long">
<delete id="deleteByPolicyId" parameterType="Long">
delete from rm_template_switch where policy_id = #{policyId}
</delete>
<update id="updateByPolicyId" parameterType="RmTemplateLinux">