优化交换机监控策略、交换机管理分页查询

This commit is contained in:
gaoyutao
2025-11-13 10:28:17 +08:00
parent 4da0c86ca4
commit 2910280746
4 changed files with 6 additions and 2 deletions
@@ -36,7 +36,7 @@ public class RmSwitchManagementController extends BaseController
*/
@RequiresPermissions("system:switchManagement:list")
@PostMapping("/list")
public TableDataInfo list(RmSwitchManagement rmSwitchManagement)
public TableDataInfo list(@RequestBody RmSwitchManagement rmSwitchManagement)
{
PageDomain pageDomain = new PageDomain();
pageDomain.setPageNum(rmSwitchManagement.getPageNum());
@@ -59,6 +59,7 @@
and (snmp_address = #{snmpAddress} or switch_name like concat('%', #{switchName}, '%'))
</if>
</where>
order by create_time desc
</select>
<select id="selectRmSwitchManagementById" parameterType="Long" resultMap="RmSwitchManagementResult">
@@ -273,6 +273,9 @@ public class RmMonitorPolicyServiceImpl implements IRmMonitorPolicyService
public int addResourcePolicy(RmMonitorPolicy rmMonitorPolicy) {
// 保存策略信息
rmMonitorPolicy.setCreateBy(SecurityUtils.getUsername());
rmMonitorPolicy.setCreateTime(DateUtils.getNowDate());
rmMonitorPolicy.setStatus("0");
rmMonitorPolicy.setUpdateTime(DateUtils.getNowDate());
rmMonitorPolicyMapper.insertRmMonitorPolicy(rmMonitorPolicy);
// 拿到采集周期
List<RmMonitorPolicyVo> collectionAndIdList = rmMonitorPolicy.getCollectionAndIdList();
@@ -107,7 +107,7 @@ public class MultiSwitchCollectionScheduler {
if (collectVo.isCollect()) {
ScheduledFuture<?> task;
// 剔除switchVo中的其他oid
if (switchVo.getOtherOID() != null) {
if (switchVo.getOtherOID() != null && !switchVo.getOtherOID().isEmpty()) {
Map<String, String> otherOid = switchOidVo.getOtherOID();
String type = collectVo.getType();