修复列表管理网卡信息不显示问题。
修复多网卡图形监控异常问题。
This commit is contained in:
+3
-1
@@ -54,8 +54,10 @@ public class RmNetworkInterfaceRemote extends BaseEntity {
|
|||||||
private String bindIp;
|
private String bindIp;
|
||||||
/** 新旧标识 */
|
/** 新旧标识 */
|
||||||
private Integer newFlag;
|
private Integer newFlag;
|
||||||
/** 服务器clientId集合 */
|
/** 查询业务网卡或单个网卡的clientId集合 */
|
||||||
private String clientIds;
|
private String clientIds;
|
||||||
|
/** 查询所有网卡的clientId集合 */
|
||||||
|
private String allClientIds;
|
||||||
|
|
||||||
// 如果是子接口,存储父接口名称
|
// 如果是子接口,存储父接口名称
|
||||||
private String parentInterface;
|
private String parentInterface;
|
||||||
|
|||||||
+4
-4
@@ -8,12 +8,12 @@ public class ConvertOtherTypeUtil {
|
|||||||
*/
|
*/
|
||||||
public static String getInterfaceTypeName(int typeCode) {
|
public static String getInterfaceTypeName(int typeCode) {
|
||||||
switch (typeCode) {
|
switch (typeCode) {
|
||||||
case 1: return "other";
|
case 1: return "其他";
|
||||||
case 2: return "regular1822";
|
case 2: return "regular1822";
|
||||||
case 3: return "hdh1822";
|
case 3: return "hdh1822";
|
||||||
case 4: return "ddnX25";
|
case 4: return "ddnX25";
|
||||||
case 5: return "rfc877x25";
|
case 5: return "rfc877x25";
|
||||||
case 6: return "ethernetCsmacd";
|
case 6: return "以太网";
|
||||||
case 7: return "iso88023Csmacd";
|
case 7: return "iso88023Csmacd";
|
||||||
case 8: return "iso88024TokenBus";
|
case 8: return "iso88024TokenBus";
|
||||||
case 9: return "iso88025TokenRing";
|
case 9: return "iso88025TokenRing";
|
||||||
@@ -31,7 +31,7 @@ public class ConvertOtherTypeUtil {
|
|||||||
case 21: return "primaryISDN";
|
case 21: return "primaryISDN";
|
||||||
case 22: return "propPointToPointSerial";
|
case 22: return "propPointToPointSerial";
|
||||||
case 23: return "ppp";
|
case 23: return "ppp";
|
||||||
case 24: return "softwareLoopback";
|
case 24: return "软件环回";
|
||||||
case 25: return "eon";
|
case 25: return "eon";
|
||||||
case 26: return "ethernet3Mbit";
|
case 26: return "ethernet3Mbit";
|
||||||
case 27: return "nsip";
|
case 27: return "nsip";
|
||||||
@@ -60,7 +60,7 @@ public class ConvertOtherTypeUtil {
|
|||||||
case 50: return "sonetPath";
|
case 50: return "sonetPath";
|
||||||
case 51: return "sonetVT";
|
case 51: return "sonetVT";
|
||||||
case 52: return "smdsIcip";
|
case 52: return "smdsIcip";
|
||||||
case 53: return "propVirtual";
|
case 53: return "专有虚拟";
|
||||||
case 54: return "propMultiplexor";
|
case 54: return "propMultiplexor";
|
||||||
case 55: return "ieee80212";
|
case 55: return "ieee80212";
|
||||||
case 56: return "fibreChannel";
|
case 56: return "fibreChannel";
|
||||||
|
|||||||
+1
-1
@@ -255,7 +255,7 @@ public class RmResourceRegistration extends BaseEntity
|
|||||||
/** 日95带宽值利用率 */
|
/** 日95带宽值利用率 */
|
||||||
@Excel(name = "日95带宽值利用率")
|
@Excel(name = "日95带宽值利用率")
|
||||||
private String bandwidthRate;
|
private String bandwidthRate;
|
||||||
/** 昨日95值排序 1正序 2倒叙 3不排序 */
|
/** 昨日95值排序 1正序 2倒叙 3不排序 4 cpu内存倒叙*/
|
||||||
private Integer bandwidthResultSort;
|
private Integer bandwidthResultSort;
|
||||||
/** cpu利用率 */
|
/** cpu利用率 */
|
||||||
private BigDecimal cpuUtil;
|
private BigDecimal cpuUtil;
|
||||||
|
|||||||
+7
-7
@@ -81,11 +81,11 @@ public class AllInterfaceNameServiceImpl implements IAllInterfaceNameService
|
|||||||
return nonSubInterfaces;
|
return nonSubInterfaces;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 缓存匹配结果,避免重复计算
|
// 使用ID作为键,避免对象相等性问题
|
||||||
Map<AllInterfaceName, Boolean> matchStatusMap = new HashMap<>();
|
Map<Long, Boolean> matchStatusMap = new HashMap<>();
|
||||||
for (AllInterfaceName interfaceName : nonSubInterfaces) {
|
for (AllInterfaceName interfaceName : nonSubInterfaces) {
|
||||||
boolean isMatched = isInterfaceMatched(interfaceName);
|
boolean isMatched = isInterfaceMatched(interfaceName);
|
||||||
matchStatusMap.put(interfaceName, isMatched);
|
matchStatusMap.put(interfaceName.getId(), isMatched);
|
||||||
|
|
||||||
// 只设置服务器类型的businessFlag
|
// 只设置服务器类型的businessFlag
|
||||||
if ("1".equals(interfaceName.getResourceType())) {
|
if ("1".equals(interfaceName.getResourceType())) {
|
||||||
@@ -96,12 +96,12 @@ public class AllInterfaceNameServiceImpl implements IAllInterfaceNameService
|
|||||||
// 使用自定义排序
|
// 使用自定义排序
|
||||||
return nonSubInterfaces.stream()
|
return nonSubInterfaces.stream()
|
||||||
.sorted((a, b) -> {
|
.sorted((a, b) -> {
|
||||||
boolean aMatched = matchStatusMap.get(a);
|
Boolean aMatched = matchStatusMap.get(a.getId());
|
||||||
boolean bMatched = matchStatusMap.get(b);
|
Boolean bMatched = matchStatusMap.get(b.getId());
|
||||||
|
|
||||||
if (aMatched && !bMatched) {
|
if (Boolean.TRUE.equals(aMatched) && !Boolean.TRUE.equals(bMatched)) {
|
||||||
return -1;
|
return -1;
|
||||||
} else if (!aMatched && bMatched) {
|
} else if (!Boolean.TRUE.equals(aMatched) && Boolean.TRUE.equals(bMatched)) {
|
||||||
return 1;
|
return 1;
|
||||||
} else {
|
} else {
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
+5
-4
@@ -354,7 +354,7 @@ public class RmResourceRegistrationServiceImpl implements IRmResourceRegistratio
|
|||||||
CompletableFuture<List<RmNetworkInterfaceRemote>> networkFuture = CompletableFuture
|
CompletableFuture<List<RmNetworkInterfaceRemote>> networkFuture = CompletableFuture
|
||||||
.supplyAsync(() -> {
|
.supplyAsync(() -> {
|
||||||
RmNetworkInterfaceRemote queryParam = new RmNetworkInterfaceRemote();
|
RmNetworkInterfaceRemote queryParam = new RmNetworkInterfaceRemote();
|
||||||
queryParam.setClientIds(clientIdsStr);
|
queryParam.setAllClientIds(clientIdsStr);
|
||||||
queryParam.setNewFlag(1);
|
queryParam.setNewFlag(1);
|
||||||
R<List<RmNetworkInterfaceRemote>> result = remoteRocketMqService.getNetworkInterfaceList(queryParam, SecurityConstants.INNER);
|
R<List<RmNetworkInterfaceRemote>> result = remoteRocketMqService.getNetworkInterfaceList(queryParam, SecurityConstants.INNER);
|
||||||
return result != null ? result.getData() : Collections.emptyList();
|
return result != null ? result.getData() : Collections.emptyList();
|
||||||
@@ -362,9 +362,9 @@ public class RmResourceRegistrationServiceImpl implements IRmResourceRegistratio
|
|||||||
|
|
||||||
CompletableFuture.allOf(cpuFuture, memFuture, networkFuture).join();
|
CompletableFuture.allOf(cpuFuture, memFuture, networkFuture).join();
|
||||||
|
|
||||||
List<RmResourceRegistration> cpuUtilList = cpuFuture.get();
|
List<RmResourceRegistration> cpuUtilList = cpuFuture.get() == null ? new ArrayList<>() : cpuFuture.get();
|
||||||
List<RmResourceRegistration> memUtilList = memFuture.get();
|
List<RmResourceRegistration> memUtilList = memFuture.get() == null ? new ArrayList<>() : memFuture.get();
|
||||||
List<RmNetworkInterfaceRemote> networkList = networkFuture.get();
|
List<RmNetworkInterfaceRemote> networkList = networkFuture.get() == null ? new ArrayList<>() : networkFuture.get();
|
||||||
|
|
||||||
// 构建查找Map
|
// 构建查找Map
|
||||||
Map<String, BigDecimal> cpuUtilMap = cpuUtilList.stream()
|
Map<String, BigDecimal> cpuUtilMap = cpuUtilList.stream()
|
||||||
@@ -433,6 +433,7 @@ public class RmResourceRegistrationServiceImpl implements IRmResourceRegistratio
|
|||||||
int businessIpCount = 1;
|
int businessIpCount = 1;
|
||||||
|
|
||||||
for (RmNetworkInterfaceRemote network : networkList) {
|
for (RmNetworkInterfaceRemote network : networkList) {
|
||||||
|
|
||||||
if ("1".equals(network.getBindIp()) || "3".equals(network.getBindIp())) {
|
if ("1".equals(network.getBindIp()) || "3".equals(network.getBindIp())) {
|
||||||
// 业务IP处理
|
// 业务IP处理
|
||||||
if (businessIpCount > 3) {
|
if (businessIpCount > 3) {
|
||||||
|
|||||||
@@ -65,5 +65,7 @@ public class RmNetworkInterface extends BaseEntity
|
|||||||
private Integer newFlag;
|
private Integer newFlag;
|
||||||
/** 服务器clientId集合 */
|
/** 服务器clientId集合 */
|
||||||
private String clientIds;
|
private String clientIds;
|
||||||
|
/** 查询所有网卡的clientId集合 */
|
||||||
|
private String allClientIds;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -51,6 +51,12 @@
|
|||||||
#{clientId}
|
#{clientId}
|
||||||
</foreach>
|
</foreach>
|
||||||
</if>
|
</if>
|
||||||
|
<if test="allClientIds != '' and allClientIds != null">
|
||||||
|
and client_id in
|
||||||
|
<foreach collection="allClientIds.split(',')" item="clientId" open="(" separator="," close=")">
|
||||||
|
#{clientId}
|
||||||
|
</foreach>
|
||||||
|
</if>
|
||||||
</where>
|
</where>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user