1、优化服务器管理列表ip分页展示。

2、集成rustfs SDK。
3、测试交换机数据IoTDB入库。
This commit is contained in:
gaoyutao
2026-02-11 18:02:55 +08:00
parent 8cc321bf14
commit 3c1edfcd2e
14 changed files with 1104 additions and 216 deletions
@@ -173,6 +173,16 @@ public class ProcessSwitchCollectDataService {
private void handleSwitchNetMessage(CollectDataVo switchDataVo, String clientId) {
List<InitialSwitchInfo> switchInfos = SwitchJsonDataParser.parseJsonData(switchDataVo.getValue(), InitialSwitchInfo.class);
if(!switchInfos.isEmpty()){
// 根据clientId查询交换机名称
// String switchName = "";
// RmSwitchManagementRemote rmSwitchManagementRemote = new RmSwitchManagementRemote();
// rmSwitchManagementRemote.setClientId(clientId);
// R<List<RmSwitchManagementRemote>> rmSwitchManagementRemoteListR = remoteRevenueConfigService.getSwitchNameByClientId(rmSwitchManagementRemote, SecurityConstants.INNER);
// if(rmSwitchManagementRemoteListR != null &&
// rmSwitchManagementRemoteListR.getData()!=null &&
// !rmSwitchManagementRemoteListR.getData().isEmpty()){
// switchName = rmSwitchManagementRemoteListR.getData().get(0).getSwitchName();
// }
// 时间戳转换
long timestamp = switchDataVo.getTimestamp();
long millis = timestamp * 1000;
@@ -199,7 +209,7 @@ public class ProcessSwitchCollectDataService {
BigDecimal divisor = new BigDecimal(300);
// 3. 计算速度
switchInfos.forEach(switchInfo -> {
for (InitialSwitchInfo switchInfo : switchInfos) {
// Map filedMap = new HashMap();
switchInfo.setClientId(clientId);
switchInfo.setCreateTime(createTime);
@@ -224,10 +234,12 @@ public class ProcessSwitchCollectDataService {
// filedMap.put("out", outDiffBit.divide(divisor, 0, RoundingMode.HALF_UP));
}
}
// iotDbUtils.writeDataWithTag("switch", clientId,
// switchInfo.getName(), millis, filedMap
// );
});
// if(!"".equals(switchName)){
// iotDbUtils.writeDataWithTag("switch", switchName,
// "traffic_" + switchInfo.getName(), millis, filedMap
// );
// }
}
// 清空临时表对应switch信息
initialSwitchInfoTempService.truncateSwitchInfoTemp(clientId);
}else{
@@ -106,22 +106,49 @@
// }
//
// /**
// * 路径安全处理
// * 路径安全处理 - IoTDB路径命名规则
// * IoTDB路径中不能包含特殊字符,统一替换为下划线
// */
// private String safePath(String input) {
// if (input == null) return "unknown";
// return input.replace(".", "_")
// .replace(":", "_")
// .replace("-", "_")
// .replaceAll("[^a-zA-Z0-9_]", "_");
//
// // 替换所有非字母、数字、汉字、下划线的字符为下划线
// String cleaned = input.trim();
// StringBuilder result = new StringBuilder();
//
// for (int i = 0; i < cleaned.length(); i++) {
// char c = cleaned.charAt(i);
// if (Character.isLetterOrDigit(c) || c == '_' ||
// (c >= '\u4e00' && c <= '\u9fa5')) { // 汉字范围
// result.append(c);
// } else {
// result.append('_');
// }
// }
//
// return result.toString();
// }
//
// /**
// * 字段名安全处理
// * 字段名安全处理 - 统一替换为下划线
// */
// private String safeField(String field) {
// if (field == null) return "unknown";
// return field.replaceAll("[^a-zA-Z0-9_]", "_");
//
// // 替换所有非字母、数字、下划线的字符为下划线
// String cleaned = field.trim();
// StringBuilder result = new StringBuilder();
//
// for (int i = 0; i < cleaned.length(); i++) {
// char c = cleaned.charAt(i);
// if (Character.isLetterOrDigit(c) || c == '_') {
// result.append(c);
// } else {
// result.append('_');
// }
// }
//
// return result.toString();
// }
//
// /**