服务器注册接口、snmp采集工具优化、其他bug修复
This commit is contained in:
@@ -10,6 +10,7 @@ import com.ruoyi.rocketmq.mapper.RmTemplateSwitchMapper;
|
||||
import com.ruoyi.system.api.RemoteRevenueConfigService;
|
||||
import com.ruoyi.system.api.domain.RmResourceGroupRemote;
|
||||
import com.ruoyi.system.api.domain.RmResourceRegistrationRemote;
|
||||
import com.ruoyi.system.api.domain.RmSwitchManagementRemote;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
@@ -30,6 +31,26 @@ public class DataProcessUtil {
|
||||
@Autowired
|
||||
private RemoteRevenueConfigService remoteRevenueConfigService;
|
||||
|
||||
/**
|
||||
* 根据clinetId获取交换机名称
|
||||
* @param clientId
|
||||
* @return
|
||||
*/
|
||||
public String getDeviceNameByClientId(String clientId){
|
||||
try {
|
||||
RmSwitchManagementRemote queryParam = new RmSwitchManagementRemote();
|
||||
queryParam.setClientId(clientId);
|
||||
R<List<RmSwitchManagementRemote>> switchMsg = remoteRevenueConfigService
|
||||
.getSwitchNameByClientId(queryParam, SecurityConstants.INNER);
|
||||
|
||||
if (switchMsg != null && switchMsg.getData() != null) {
|
||||
return switchMsg.getData().get(0).getClientId();
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("获取交换机名称信息失败,clientId: {}", clientId, e);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
/**
|
||||
* 补充资源组信息
|
||||
*/
|
||||
@@ -219,4 +240,25 @@ public class DataProcessUtil {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据clientId查询交换机信息
|
||||
* @param clientId
|
||||
* @return
|
||||
*/
|
||||
public RmSwitchManagementRemote getSwitchMsg(String clientId) {
|
||||
try {
|
||||
RmSwitchManagementRemote queryParam = new RmSwitchManagementRemote();
|
||||
queryParam.setClientId(clientId);
|
||||
R<List<RmSwitchManagementRemote>> switchMsg = remoteRevenueConfigService
|
||||
.getSwitchNameByClientId(queryParam, SecurityConstants.INNER);
|
||||
|
||||
if (switchMsg != null && switchMsg.getData() != null) {
|
||||
return switchMsg.getData().get(0);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("获取交换机名称信息失败,clientId: {}", clientId, e);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user