Merge remote-tracking branch 'origin/main' into multi-tenant
This commit is contained in:
@@ -1,5 +1,11 @@
|
|||||||
# 版本发布日志
|
# 版本发布日志
|
||||||
|
|
||||||
|
## 2.2502.4-20250228
|
||||||
|
|
||||||
|
- 修复 SGW-C导出管理多语言显示
|
||||||
|
- 优化 网元状态告警处理逻辑,增加状态更新时间戳
|
||||||
|
- 修复 CDR/Event 查询时间格式统一时间戳int64
|
||||||
|
|
||||||
## 2.2502.3-20250221
|
## 2.2502.3-20250221
|
||||||
|
|
||||||
- 修复 网元授权序号查询
|
- 修复 网元授权序号查询
|
||||||
|
|||||||
@@ -696,6 +696,11 @@ INSERT INTO `sys_dict_data` VALUES (2185, 2185, 'config.sys.homePageRemark', '
|
|||||||
INSERT INTO `sys_dict_data` VALUES (2186, 2186, 'menu.config.neOverview', '网元概览', 'i18n_zh', '', '', '1', 'supervisor', 1721902269805, '', 0, '');
|
INSERT INTO `sys_dict_data` VALUES (2186, 2186, 'menu.config.neOverview', '网元概览', 'i18n_zh', '', '', '1', 'supervisor', 1721902269805, '', 0, '');
|
||||||
INSERT INTO `sys_dict_data` VALUES (2187, 2187, 'menu.config.neOverviewRemark', '显示所有网元状态配置和license等概览信息', 'i18n_zh', '', '', '1', 'supervisor', 1721902269805, '', 0, '');
|
INSERT INTO `sys_dict_data` VALUES (2187, 2187, 'menu.config.neOverviewRemark', '显示所有网元状态配置和license等概览信息', 'i18n_zh', '', '', '1', 'supervisor', 1721902269805, '', 0, '');
|
||||||
INSERT INTO `sys_dict_data` VALUES (2188, 2188, 'job.exportSGWCCDR', '定期从漫游数据话单表导出文件至指定目录', 'i18n_zh', '', '', '1', 'supervisor', 1721902269805, '', 0, '');
|
INSERT INTO `sys_dict_data` VALUES (2188, 2188, 'job.exportSGWCCDR', '定期从漫游数据话单表导出文件至指定目录', 'i18n_zh', '', '', '1', 'supervisor', 1721902269805, '', 0, '');
|
||||||
|
INSERT INTO `sys_dict_data` VALUES (2189, 2189, 'table.cdr_event_sgwc', '漫游数据话单', 'i18n_zh', '', '', '1', 'supervisor', 1721902269805, '', 0, '');
|
||||||
|
INSERT INTO `sys_dict_data` VALUES (2190, 2190, 'menu.dashboard.overview.smfUeNum', '展示数据会话数', 'i18n_zh', '', '', '1', 'supervisor', 1721902269805, '', 0, '');
|
||||||
|
INSERT INTO `sys_dict_data` VALUES (2191, 2191, 'menu.dashboard.overview.imsUeNum', '展示语音会话数', 'i18n_zh', '', '', '1', 'supervisor', 1721902269805, '', 0, '');
|
||||||
|
INSERT INTO `sys_dict_data` VALUES (2192, 2192, 'menu.dashboard.overview.gnbBase', '展示5G基站在线信息', 'i18n_zh', '', '', '1', 'supervisor', 1721902269805, '', 0, '');
|
||||||
|
INSERT INTO `sys_dict_data` VALUES (2193, 2193, 'menu.dashboard.overview.enbBase', '展示4G基站在线信息', 'i18n_zh', '', '', '1', 'supervisor', 1721902269805, '', 0, '');
|
||||||
|
|
||||||
-- multi-tenancy
|
-- multi-tenancy
|
||||||
INSERT INTO `sys_dict_data` VALUES (11000, 11000, 'menu.security.tenant', '租户管理', 'i18n_zh', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
INSERT INTO `sys_dict_data` VALUES (11000, 11000, 'menu.security.tenant', '租户管理', 'i18n_zh', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
||||||
|
|||||||
@@ -696,6 +696,11 @@ INSERT INTO `sys_dict_data` VALUES (4185, 4185, 'config.sys.homePageRemark', 'Se
|
|||||||
INSERT INTO `sys_dict_data` VALUES (4186, 4186, 'menu.config.neOverview', 'NE Overview', 'i18n_en', '', '', '1', 'supervisor', 1721902269805, '', 0, '');
|
INSERT INTO `sys_dict_data` VALUES (4186, 4186, 'menu.config.neOverview', 'NE Overview', 'i18n_en', '', '', '1', 'supervisor', 1721902269805, '', 0, '');
|
||||||
INSERT INTO `sys_dict_data` VALUES (4187, 4187, 'menu.config.neOverviewRemark', 'Displays overview information such as status, configuration and license of all network elements', 'i18n_en', '', '', '1', 'supervisor', 1721902269805, '', 0, '');
|
INSERT INTO `sys_dict_data` VALUES (4187, 4187, 'menu.config.neOverviewRemark', 'Displays overview information such as status, configuration and license of all network elements', 'i18n_en', '', '', '1', 'supervisor', 1721902269805, '', 0, '');
|
||||||
INSERT INTO `sys_dict_data` VALUES (4188, 4188, 'job.exportSGWCCDR', 'Export regularly from Roaming Data CDR table', 'i18n_en', '', '', '1', 'supervisor', 1721902269805, '', 0, '');
|
INSERT INTO `sys_dict_data` VALUES (4188, 4188, 'job.exportSGWCCDR', 'Export regularly from Roaming Data CDR table', 'i18n_en', '', '', '1', 'supervisor', 1721902269805, '', 0, '');
|
||||||
|
INSERT INTO `sys_dict_data` VALUES (4189, 4189, 'table.cdr_event_sgwc', 'Roaming Data CDR', 'i18n_en', '', '', '1', 'supervisor', 1721902269805, '', 0, '');
|
||||||
|
INSERT INTO `sys_dict_data` VALUES (4190, 4190, 'menu.dashboard.overview.smfUeNum', 'Display data session number', 'i18n_en', '', '', '1', 'supervisor', 1721902269805, '', 0, '');
|
||||||
|
INSERT INTO `sys_dict_data` VALUES (4191, 4191, 'menu.dashboard.overview.imsUeNum', 'Display the number of voice sessions', 'i18n_en', '', '', '1', 'supervisor', 1721902269805, '', 0, '');
|
||||||
|
INSERT INTO `sys_dict_data` VALUES (4192, 4192, 'menu.dashboard.overview.gnbBase', 'Display 5G base station online information', 'i18n_en', '', '', '1', 'supervisor', 1721902269805, '', 0, '');
|
||||||
|
INSERT INTO `sys_dict_data` VALUES (4193, 4193, 'menu.dashboard.overview.enbBase', 'Display 4G base station online information', 'i18n_en', '', '', '1', 'supervisor', 1721902269805, '', 0, '');
|
||||||
|
|
||||||
-- 多租户
|
-- 多租户
|
||||||
INSERT INTO `sys_dict_data` VALUES (14000, 14000, 'menu.security.tenant', 'Tenant Management', 'i18n_en', '', '', '1', 'supervisor', 1705550000000, '', 0, '');
|
INSERT INTO `sys_dict_data` VALUES (14000, 14000, 'menu.security.tenant', 'Tenant Management', 'i18n_en', '', '', '1', 'supervisor', 1705550000000, '', 0, '');
|
||||||
|
|||||||
@@ -214,6 +214,10 @@ INSERT INTO `sys_menu` VALUES (2162, 'menu.trace.taskAnalyze', 2083, 2, 'task/in
|
|||||||
INSERT INTO `sys_menu` VALUES (2163, 'menu.trace.tshark', 2083, 14, 'tshark', 'traceManage/tshark/index', '1', '0', 'M', '1', '1', 'traceManage:tshark:index', 'icon-gengduo', 'supervisor', 1724144595914, '', 0, '');
|
INSERT INTO `sys_menu` VALUES (2163, 'menu.trace.tshark', 2083, 14, 'tshark', 'traceManage/tshark/index', '1', '0', 'M', '1', '1', 'traceManage:tshark:index', 'icon-gengduo', 'supervisor', 1724144595914, '', 0, '');
|
||||||
INSERT INTO `sys_menu` VALUES (2164, 'menu.trace.wireshark', 2083, 16, 'wireshark', 'traceManage/wireshark/index', '1', '0', 'M', '1', '1', 'traceManage:wireshark:index', 'icon-gengduo', 'supervisor', 1724144595914, '', 0, '');
|
INSERT INTO `sys_menu` VALUES (2164, 'menu.trace.wireshark', 2083, 16, 'wireshark', 'traceManage/wireshark/index', '1', '0', 'M', '1', '1', 'traceManage:wireshark:index', 'icon-gengduo', 'supervisor', 1724144595914, '', 0, '');
|
||||||
INSERT INTO `sys_menu` VALUES (2165, 'menu.config.neOverview', 4, 1, 'neOverview', 'configManage/neOverview/index', '1', '0', 'M', '1', '1', 'configManage:neOverview:index', 'icon-tubiaoku', 'supervisor', 1700000000000, NULL, 0, 'menu.config.neOverviewRemark');
|
INSERT INTO `sys_menu` VALUES (2165, 'menu.config.neOverview', 4, 1, 'neOverview', 'configManage/neOverview/index', '1', '0', 'M', '1', '1', 'configManage:neOverview:index', 'icon-tubiaoku', 'supervisor', 1700000000000, NULL, 0, 'menu.config.neOverviewRemark');
|
||||||
|
INSERT INTO `sys_menu` VALUES (2166, 'menu.dashboard.overview.smfUeNum', 2132, 2, '#', '', '1', '1', 'B', '1', '1', 'dashboard:overview:smfUeNum', '#', 'supervisor', 1721902269805, '', 0, '');
|
||||||
|
INSERT INTO `sys_menu` VALUES (2167, 'menu.dashboard.overview.imsUeNum', 2132, 4, '#', '', '1', '1', 'B', '1', '1', 'dashboard:overview:imsUeNum', '#', 'supervisor', 1721902269805, '', 0, '');
|
||||||
|
INSERT INTO `sys_menu` VALUES (2168, 'menu.dashboard.overview.gnbBase', 2132, 6, '#', '', '1', '1', 'B', '1', '1', 'dashboard:overview:gnbBase', '#', 'supervisor', 1721902269805, '', 0, '');
|
||||||
|
INSERT INTO `sys_menu` VALUES (2169, 'menu.dashboard.overview.enbBase', 2132, 8, '#', '', '1', '1', 'B', '1', '1', 'dashboard:overview:enbBase', '#', 'supervisor', 1721902269805, '', 0, '');
|
||||||
|
|
||||||
-- tenant management for admin user
|
-- tenant management for admin user
|
||||||
INSERT INTO `sys_menu` VALUES (10000, 'menu.security.tenant', 2113, 5, 'tenant', 'system/tenant/index', '1', '1', 'M', '1', '1', 'system:tenant:list', 'icon-yuzhanghao1', 'supervisor', 1700000000000, NULL, 0, 'menu.security.tenantRemark');
|
INSERT INTO `sys_menu` VALUES (10000, 'menu.security.tenant', 2113, 5, 'tenant', 'system/tenant/index', '1', '1', 'M', '1', '1', 'system:tenant:list', 'icon-yuzhanghao1', 'supervisor', 1700000000000, NULL, 0, 'menu.security.tenantRemark');
|
||||||
|
|||||||
@@ -176,6 +176,10 @@ INSERT IGNORE INTO `sys_role_menu` VALUES (2, 2160);
|
|||||||
INSERT IGNORE INTO `sys_role_menu` VALUES (2, 2162);
|
INSERT IGNORE INTO `sys_role_menu` VALUES (2, 2162);
|
||||||
INSERT IGNORE INTO `sys_role_menu` VALUES (2, 2163);
|
INSERT IGNORE INTO `sys_role_menu` VALUES (2, 2163);
|
||||||
INSERT IGNORE INTO `sys_role_menu` VALUES (2, 2165);
|
INSERT IGNORE INTO `sys_role_menu` VALUES (2, 2165);
|
||||||
|
INSERT IGNORE INTO `sys_role_menu` VALUES (2, 2166);
|
||||||
|
INSERT IGNORE INTO `sys_role_menu` VALUES (2, 2167);
|
||||||
|
INSERT IGNORE INTO `sys_role_menu` VALUES (2, 2168);
|
||||||
|
INSERT IGNORE INTO `sys_role_menu` VALUES (2, 2169);
|
||||||
|
|
||||||
INSERT IGNORE INTO `sys_role_menu` VALUES (2, 10000);
|
INSERT IGNORE INTO `sys_role_menu` VALUES (2, 10000);
|
||||||
INSERT IGNORE INTO `sys_role_menu` VALUES (2, 10001);
|
INSERT IGNORE INTO `sys_role_menu` VALUES (2, 10001);
|
||||||
|
|||||||
@@ -703,6 +703,11 @@ REPLACE INTO `sys_dict_data` VALUES (2185, 2185, 'config.sys.homePageRemark', '
|
|||||||
REPLACE INTO `sys_dict_data` VALUES (2186, 2186, 'menu.config.neOverview', '网元概览', 'i18n_zh', '', '', '1', 'supervisor', 1721902269805, '', 0, '');
|
REPLACE INTO `sys_dict_data` VALUES (2186, 2186, 'menu.config.neOverview', '网元概览', 'i18n_zh', '', '', '1', 'supervisor', 1721902269805, '', 0, '');
|
||||||
REPLACE INTO `sys_dict_data` VALUES (2187, 2187, 'menu.config.neOverviewRemark', '显示所有网元状态配置和license等概览信息', 'i18n_zh', '', '', '1', 'supervisor', 1721902269805, '', 0, '');
|
REPLACE INTO `sys_dict_data` VALUES (2187, 2187, 'menu.config.neOverviewRemark', '显示所有网元状态配置和license等概览信息', 'i18n_zh', '', '', '1', 'supervisor', 1721902269805, '', 0, '');
|
||||||
REPLACE INTO `sys_dict_data` VALUES (2188, 2188, 'job.exportSGWCCDR', '定期从漫游数据话单表导出文件至指定目录', 'i18n_zh', '', '', '1', 'supervisor', 1721902269805, '', 0, '');
|
REPLACE INTO `sys_dict_data` VALUES (2188, 2188, 'job.exportSGWCCDR', '定期从漫游数据话单表导出文件至指定目录', 'i18n_zh', '', '', '1', 'supervisor', 1721902269805, '', 0, '');
|
||||||
|
REPLACE INTO `sys_dict_data` VALUES (2189, 2189, 'table.cdr_event_sgwc', '漫游数据话单', 'i18n_zh', '', '', '1', 'supervisor', 1721902269805, '', 0, '');
|
||||||
|
REPLACE INTO `sys_dict_data` VALUES (2190, 2190, 'menu.dashboard.overview.smfUeNum', '展示数据会话数', 'i18n_zh', '', '', '1', 'supervisor', 1721902269805, '', 0, '');
|
||||||
|
REPLACE INTO `sys_dict_data` VALUES (2191, 2191, 'menu.dashboard.overview.imsUeNum', '展示语音会话数', 'i18n_zh', '', '', '1', 'supervisor', 1721902269805, '', 0, '');
|
||||||
|
REPLACE INTO `sys_dict_data` VALUES (2192, 2192, 'menu.dashboard.overview.gnbBase', '展示5G基站在线信息', 'i18n_zh', '', '', '1', 'supervisor', 1721902269805, '', 0, '');
|
||||||
|
REPLACE INTO `sys_dict_data` VALUES (2193, 2193, 'menu.dashboard.overview.enbBase', '展示4G基站在线信息', 'i18n_zh', '', '', '1', 'supervisor', 1721902269805, '', 0, '');
|
||||||
|
|
||||||
-- multi-tenancy
|
-- multi-tenancy
|
||||||
REPLACE INTO `sys_dict_data` VALUES (11000, 11000, 'menu.security.tenant', '租户管理', 'i18n_zh', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
REPLACE INTO `sys_dict_data` VALUES (11000, 11000, 'menu.security.tenant', '租户管理', 'i18n_zh', NULL, NULL, '1', 'supervisor', 1700000000000, NULL, 0, NULL);
|
||||||
|
|||||||
@@ -702,6 +702,11 @@ REPLACE INTO `sys_dict_data` VALUES (4185, 4185, 'config.sys.homePageRemark', 'S
|
|||||||
REPLACE INTO `sys_dict_data` VALUES (4186, 4186, 'menu.config.neOverview', 'NE Overview', 'i18n_en', '', '', '1', 'supervisor', 1721902269805, '', 0, '');
|
REPLACE INTO `sys_dict_data` VALUES (4186, 4186, 'menu.config.neOverview', 'NE Overview', 'i18n_en', '', '', '1', 'supervisor', 1721902269805, '', 0, '');
|
||||||
REPLACE INTO `sys_dict_data` VALUES (4187, 4187, 'menu.config.neOverviewRemark', 'Displays overview information such as status, configuration and license of all network elements', 'i18n_en', '', '', '1', 'supervisor', 1721902269805, '', 0, '');
|
REPLACE INTO `sys_dict_data` VALUES (4187, 4187, 'menu.config.neOverviewRemark', 'Displays overview information such as status, configuration and license of all network elements', 'i18n_en', '', '', '1', 'supervisor', 1721902269805, '', 0, '');
|
||||||
REPLACE INTO `sys_dict_data` VALUES (4188, 4188, 'job.exportSGWCCDR', 'Export regularly from Roaming Data CDR table', 'i18n_en', '', '', '1', 'supervisor', 1721902269805, '', 0, '');
|
REPLACE INTO `sys_dict_data` VALUES (4188, 4188, 'job.exportSGWCCDR', 'Export regularly from Roaming Data CDR table', 'i18n_en', '', '', '1', 'supervisor', 1721902269805, '', 0, '');
|
||||||
|
REPLACE INTO `sys_dict_data` VALUES (4189, 4189, 'table.cdr_event_sgwc', 'Roaming Data CDR', 'i18n_en', '', '', '1', 'supervisor', 1721902269805, '', 0, '');
|
||||||
|
REPLACE INTO `sys_dict_data` VALUES (4190, 4190, 'menu.dashboard.overview.smfUeNum', 'Display data session number', 'i18n_en', '', '', '1', 'supervisor', 1721902269805, '', 0, '');
|
||||||
|
REPLACE INTO `sys_dict_data` VALUES (4191, 4191, 'menu.dashboard.overview.imsUeNum', 'Display the number of voice sessions', 'i18n_en', '', '', '1', 'supervisor', 1721902269805, '', 0, '');
|
||||||
|
REPLACE INTO `sys_dict_data` VALUES (4192, 4192, 'menu.dashboard.overview.gnbBase', 'Display 5G base station online information', 'i18n_en', '', '', '1', 'supervisor', 1721902269805, '', 0, '');
|
||||||
|
REPLACE INTO `sys_dict_data` VALUES (4193, 4193, 'menu.dashboard.overview.enbBase', 'Display 4G base station online information', 'i18n_en', '', '', '1', 'supervisor', 1721902269805, '', 0, '');
|
||||||
|
|
||||||
-- 多租户
|
-- 多租户
|
||||||
REPLACE INTO `sys_dict_data` VALUES (14000, 14000, 'menu.security.tenant', 'Tenant Management', 'i18n_en', '', '', '1', 'supervisor', 1705550000000, '', 0, '');
|
REPLACE INTO `sys_dict_data` VALUES (14000, 14000, 'menu.security.tenant', 'Tenant Management', 'i18n_en', '', '', '1', 'supervisor', 1705550000000, '', 0, '');
|
||||||
|
|||||||
@@ -197,6 +197,10 @@ REPLACE INTO `sys_menu` VALUES (2162, 'menu.trace.taskAnalyze', 2083, 2, 'task/i
|
|||||||
REPLACE INTO `sys_menu` VALUES (2163, 'menu.trace.tshark', 2083, 14, 'tshark', 'traceManage/tshark/index', '1', '0', 'M', '1', '1', 'traceManage:tshark:index', 'icon-gengduo', 'supervisor', 1724144595914, '', 0, '');
|
REPLACE INTO `sys_menu` VALUES (2163, 'menu.trace.tshark', 2083, 14, 'tshark', 'traceManage/tshark/index', '1', '0', 'M', '1', '1', 'traceManage:tshark:index', 'icon-gengduo', 'supervisor', 1724144595914, '', 0, '');
|
||||||
REPLACE INTO `sys_menu` VALUES (2164, 'menu.trace.wireshark', 2083, 16, 'wireshark', 'traceManage/wireshark/index', '1', '0', 'M', '1', '1', 'traceManage:wireshark:index', 'icon-gengduo', 'supervisor', 1724144595914, '', 0, '');
|
REPLACE INTO `sys_menu` VALUES (2164, 'menu.trace.wireshark', 2083, 16, 'wireshark', 'traceManage/wireshark/index', '1', '0', 'M', '1', '1', 'traceManage:wireshark:index', 'icon-gengduo', 'supervisor', 1724144595914, '', 0, '');
|
||||||
REPLACE INTO `sys_menu` VALUES (2165, 'menu.config.neOverview', 4, 1, 'neOverview', 'configManage/neOverview/index', '1', '0', 'M', '1', '1', 'configManage:neOverview:index', 'icon-tubiaoku', 'supervisor', 1700000000000, NULL, 0, 'menu.config.neOverviewRemark');
|
REPLACE INTO `sys_menu` VALUES (2165, 'menu.config.neOverview', 4, 1, 'neOverview', 'configManage/neOverview/index', '1', '0', 'M', '1', '1', 'configManage:neOverview:index', 'icon-tubiaoku', 'supervisor', 1700000000000, NULL, 0, 'menu.config.neOverviewRemark');
|
||||||
|
REPLACE INTO `sys_menu` VALUES (2166, 'menu.dashboard.overview.smfUeNum', 2132, 2, '#', '', '1', '1', 'B', '1', '1', 'dashboard:overview:smfUeNum', '#', 'supervisor', 1721902269805, '', 0, '');
|
||||||
|
REPLACE INTO `sys_menu` VALUES (2167, 'menu.dashboard.overview.imsUeNum', 2132, 4, '#', '', '1', '1', 'B', '1', '1', 'dashboard:overview:imsUeNum', '#', 'supervisor', 1721902269805, '', 0, '');
|
||||||
|
REPLACE INTO `sys_menu` VALUES (2168, 'menu.dashboard.overview.gnbBase', 2132, 6, '#', '', '1', '1', 'B', '1', '1', 'dashboard:overview:gnbBase', '#', 'supervisor', 1721902269805, '', 0, '');
|
||||||
|
REPLACE INTO `sys_menu` VALUES (2169, 'menu.dashboard.overview.enbBase', 2132, 8, '#', '', '1', '1', 'B', '1', '1', 'dashboard:overview:enbBase', '#', 'supervisor', 1721902269805, '', 0, '');
|
||||||
|
|
||||||
-- multi-tenancy
|
-- multi-tenancy
|
||||||
-- tenant management for admin user
|
-- tenant management for admin user
|
||||||
|
|||||||
@@ -161,6 +161,10 @@ INSERT IGNORE INTO `sys_role_menu` VALUES (2, 2159);
|
|||||||
INSERT IGNORE INTO `sys_role_menu` VALUES (2, 2160);
|
INSERT IGNORE INTO `sys_role_menu` VALUES (2, 2160);
|
||||||
INSERT IGNORE INTO `sys_role_menu` VALUES (2, 2163);
|
INSERT IGNORE INTO `sys_role_menu` VALUES (2, 2163);
|
||||||
INSERT IGNORE INTO `sys_role_menu` VALUES (2, 2165);
|
INSERT IGNORE INTO `sys_role_menu` VALUES (2, 2165);
|
||||||
|
INSERT IGNORE INTO `sys_role_menu` VALUES (2, 2166);
|
||||||
|
INSERT IGNORE INTO `sys_role_menu` VALUES (2, 2167);
|
||||||
|
INSERT IGNORE INTO `sys_role_menu` VALUES (2, 2168);
|
||||||
|
INSERT IGNORE INTO `sys_role_menu` VALUES (2, 2169);
|
||||||
|
|
||||||
INSERT IGNORE INTO `sys_role_menu` VALUES (2, 10000);
|
INSERT IGNORE INTO `sys_role_menu` VALUES (2, 10000);
|
||||||
INSERT IGNORE INTO `sys_role_menu` VALUES (2, 10001);
|
INSERT IGNORE INTO `sys_role_menu` VALUES (2, 10001);
|
||||||
|
|||||||
@@ -15,6 +15,13 @@ import (
|
|||||||
func AlarmEmailForward(alarmData *Alarm) error {
|
func AlarmEmailForward(alarmData *Alarm) error {
|
||||||
log.Info("AlarmEmailForward processing... ")
|
log.Info("AlarmEmailForward processing... ")
|
||||||
|
|
||||||
|
alarmStatus := "Clear"
|
||||||
|
if alarmData.AlarmStatus == 1 {
|
||||||
|
alarmStatus = "Active"
|
||||||
|
}
|
||||||
|
severity := alarmData.OrigSeverity
|
||||||
|
subjectTime := fmt.Sprintf("%s-%s-%s", severity, alarmData.NeName, alarmData.AlarmTitle)
|
||||||
|
|
||||||
message := fmt.Sprintf(`
|
message := fmt.Sprintf(`
|
||||||
<p>Alarm information</p>
|
<p>Alarm information</p>
|
||||||
<p style="text-indent:2.5em">Sequence: %d</p>
|
<p style="text-indent:2.5em">Sequence: %d</p>
|
||||||
@@ -22,9 +29,9 @@ func AlarmEmailForward(alarmData *Alarm) error {
|
|||||||
<p style="text-indent:4em">Title: %s</p>
|
<p style="text-indent:4em">Title: %s</p>
|
||||||
<p style="text-indent:2.5em">Severity: %s</p>
|
<p style="text-indent:2.5em">Severity: %s</p>
|
||||||
<p style="text-indent:1.5em">Event Time: %s</p>
|
<p style="text-indent:1.5em">Event Time: %s</p>
|
||||||
<p style="text-indent:0.5em">Alarm Status: %d</p>
|
<p style="text-indent:0.5em">Alarm Status: %s</p>
|
||||||
<p>Automatic sent by OMC, please do not reply!</p>
|
<p>Automatic sent by OMC, please do not reply!</p>
|
||||||
`, alarmData.AlarmSeq, alarmData.NeName, alarmData.AlarmTitle, alarmData.OrigSeverity, alarmData.EventTime, alarmData.AlarmStatus)
|
`, alarmData.AlarmSeq, alarmData.NeName, alarmData.AlarmTitle, alarmData.OrigSeverity, alarmData.EventTime, alarmStatus)
|
||||||
|
|
||||||
// message := fmt.Sprintf(`
|
// message := fmt.Sprintf(`
|
||||||
// Alarm information
|
// Alarm information
|
||||||
@@ -81,7 +88,7 @@ func AlarmEmailForward(alarmData *Alarm) error {
|
|||||||
//m.SetHeader("To", "zhangshuzhong@agrandtech.com", "simonzhangsz@outlook.com") // 收件人,可以多个收件人,但必须使用相同的 SMTP 连接
|
//m.SetHeader("To", "zhangshuzhong@agrandtech.com", "simonzhangsz@outlook.com") // 收件人,可以多个收件人,但必须使用相同的 SMTP 连接
|
||||||
//m.SetHeader("Cc", "******@qq.com") // 抄送,可以多个
|
//m.SetHeader("Cc", "******@qq.com") // 抄送,可以多个
|
||||||
//m.SetHeader("Bcc", "******@qq.com") // 暗送,可以多个
|
//m.SetHeader("Bcc", "******@qq.com") // 暗送,可以多个
|
||||||
m.SetHeader("Subject", "Alarm from OMC!") // 邮件主题
|
m.SetHeader("Subject", subjectTime) // 邮件主题
|
||||||
|
|
||||||
// text/html 的意思是将文件的 content-type 设置为 text/html 的形式,浏览器在获取到这种文件时会自动调用html的解析器对文件进行相应的处理。
|
// text/html 的意思是将文件的 content-type 设置为 text/html 的形式,浏览器在获取到这种文件时会自动调用html的解析器对文件进行相应的处理。
|
||||||
// 可以通过 text/html 处理文本格式进行特殊处理,如换行、缩进、加粗等等
|
// 可以通过 text/html 处理文本格式进行特殊处理,如换行、缩进、加粗等等
|
||||||
|
|||||||
2
makefile
2
makefile
@@ -3,7 +3,7 @@
|
|||||||
ProjectL = omc
|
ProjectL = omc
|
||||||
ProjectU = OMC
|
ProjectU = OMC
|
||||||
PROJECT = $(ProjectL)
|
PROJECT = $(ProjectL)
|
||||||
VERSION = 2.2502.3
|
VERSION = 2.2502.4
|
||||||
RelDate = `date +%Y%m%d`
|
RelDate = `date +%Y%m%d`
|
||||||
Release = $(RelDate)
|
Release = $(RelDate)
|
||||||
RelVer = $(VERSION)-$(RelDate)
|
RelVer = $(VERSION)-$(RelDate)
|
||||||
|
|||||||
2
mkpkg.sh
2
mkpkg.sh
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
ProcList="restagent sshsvc"
|
ProcList="restagent sshsvc"
|
||||||
ProjectL=omc
|
ProjectL=omc
|
||||||
VERSION=2.2502.3
|
VERSION=2.2502.4
|
||||||
RelDate=`date +%Y%m%d`
|
RelDate=`date +%Y%m%d`
|
||||||
Release=${RelDate}
|
Release=${RelDate}
|
||||||
RelVer=${VERSION}-${RelDate}
|
RelVer=${VERSION}-${RelDate}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
# Makefile for rest agent project
|
# Makefile for rest agent project
|
||||||
|
|
||||||
PROJECT = OMC
|
PROJECT = OMC
|
||||||
VERSION = 2.2502.3
|
VERSION = 2.2502.4
|
||||||
PLATFORM = amd64
|
PLATFORM = amd64
|
||||||
ARMPLATFORM = aarch64
|
ARMPLATFORM = aarch64
|
||||||
BUILDDIR = ../../build
|
BUILDDIR = ../../build
|
||||||
|
|||||||
175
src/framework/redis/expand.go
Normal file
175
src/framework/redis/expand.go
Normal file
@@ -0,0 +1,175 @@
|
|||||||
|
package redis
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"errors"
|
||||||
|
"fmt"
|
||||||
|
"sync"
|
||||||
|
"time"
|
||||||
|
|
||||||
|
"be.ems/src/framework/logger"
|
||||||
|
"github.com/redis/go-redis/v9"
|
||||||
|
)
|
||||||
|
|
||||||
|
// 连接Redis实例
|
||||||
|
func ConnectPush(source string, rdb *redis.Client) {
|
||||||
|
if rdb == nil {
|
||||||
|
delete(rdbMap, source)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
rdbMap[source] = rdb
|
||||||
|
}
|
||||||
|
|
||||||
|
// 批量获得缓存数据 [key]result
|
||||||
|
func GetHashBatch(source string, keys []string) (map[string]map[string]string, error) {
|
||||||
|
result := make(map[string]map[string]string, 0)
|
||||||
|
if len(keys) == 0 {
|
||||||
|
return result, fmt.Errorf("not keys")
|
||||||
|
}
|
||||||
|
|
||||||
|
// 数据源
|
||||||
|
rdb := RDB(source)
|
||||||
|
if rdb == nil {
|
||||||
|
return result, fmt.Errorf("redis not client")
|
||||||
|
}
|
||||||
|
|
||||||
|
// 创建一个有限的并发控制信号通道
|
||||||
|
sem := make(chan struct{}, 10)
|
||||||
|
var wg sync.WaitGroup
|
||||||
|
var mt sync.Mutex
|
||||||
|
batchSize := 1000
|
||||||
|
total := len(keys)
|
||||||
|
if total < batchSize {
|
||||||
|
batchSize = total
|
||||||
|
}
|
||||||
|
|
||||||
|
for i := 0; i < total; i += batchSize {
|
||||||
|
wg.Add(1)
|
||||||
|
go func(start int) {
|
||||||
|
ctx := context.Background()
|
||||||
|
// 并发控制,限制同时执行的 Goroutine 数量
|
||||||
|
sem <- struct{}{}
|
||||||
|
defer func() {
|
||||||
|
<-sem
|
||||||
|
ctx.Done()
|
||||||
|
wg.Done()
|
||||||
|
}()
|
||||||
|
|
||||||
|
// 检查索引是否越界
|
||||||
|
end := start + batchSize
|
||||||
|
if end > total {
|
||||||
|
end = total
|
||||||
|
}
|
||||||
|
pipe := rdb.Pipeline()
|
||||||
|
for _, key := range keys[start:end] {
|
||||||
|
pipe.HGetAll(ctx, key)
|
||||||
|
}
|
||||||
|
|
||||||
|
cmds, err := pipe.Exec(ctx)
|
||||||
|
if err != nil {
|
||||||
|
logger.Errorf("Failed to get hash batch exec err: %v", err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// 将结果添加到 result map 并发访问
|
||||||
|
mt.Lock()
|
||||||
|
defer mt.Unlock()
|
||||||
|
|
||||||
|
// 处理命令结果
|
||||||
|
for _, cmd := range cmds {
|
||||||
|
if cmd.Err() != nil {
|
||||||
|
logger.Errorf("Failed to get hash batch cmds err: %v", cmd.Err())
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
// 将结果转换为 *redis.StringStringMapCmd 类型
|
||||||
|
rcmd, ok := cmd.(*redis.MapStringStringCmd)
|
||||||
|
if !ok {
|
||||||
|
logger.Errorf("Failed to get hash batch type err: %v", cmd.Err())
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
|
key := "-"
|
||||||
|
args := rcmd.Args()
|
||||||
|
if len(args) > 0 {
|
||||||
|
key = fmt.Sprint(args[1])
|
||||||
|
}
|
||||||
|
|
||||||
|
result[key] = rcmd.Val()
|
||||||
|
}
|
||||||
|
}(i)
|
||||||
|
}
|
||||||
|
|
||||||
|
wg.Wait()
|
||||||
|
return result, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetHash 获得缓存数据
|
||||||
|
func GetHash(source, key, field string) (string, error) {
|
||||||
|
// 数据源
|
||||||
|
rdb := RDB(source)
|
||||||
|
if rdb == nil {
|
||||||
|
return "", fmt.Errorf("redis not client")
|
||||||
|
}
|
||||||
|
|
||||||
|
ctx := context.Background()
|
||||||
|
v, err := rdb.HGet(ctx, key, field).Result()
|
||||||
|
if errors.Is(err, redis.Nil) {
|
||||||
|
return "", fmt.Errorf("no key field")
|
||||||
|
}
|
||||||
|
if err != nil {
|
||||||
|
return "", err
|
||||||
|
}
|
||||||
|
return v, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetHash 设置缓存数据
|
||||||
|
func SetHash(source, key string, value map[string]any) error {
|
||||||
|
// 数据源
|
||||||
|
rdb := RDB(source)
|
||||||
|
if rdb == nil {
|
||||||
|
return fmt.Errorf("redis not client")
|
||||||
|
}
|
||||||
|
|
||||||
|
ctx := context.Background()
|
||||||
|
err := rdb.HSet(ctx, key, value).Err()
|
||||||
|
if err != nil {
|
||||||
|
logger.Errorf("redis HSet err %v", err)
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// IncrBy 累加统计数据
|
||||||
|
func IncrBy(source, key, field string, value int64) error {
|
||||||
|
// 数据源
|
||||||
|
rdb := RDB(source)
|
||||||
|
if rdb == nil {
|
||||||
|
return fmt.Errorf("redis not client")
|
||||||
|
}
|
||||||
|
|
||||||
|
// 使用HINCRBY命令进行累加统计
|
||||||
|
ctx := context.Background()
|
||||||
|
err := rdb.HIncrBy(ctx, key, field, value).Err()
|
||||||
|
if err != nil {
|
||||||
|
logger.Errorf("redis HIncrBy err %v", err)
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// Expire 过期时间设置
|
||||||
|
func Expire(source, key string, expiration time.Duration) error {
|
||||||
|
// 数据源
|
||||||
|
rdb := RDB(source)
|
||||||
|
if rdb == nil {
|
||||||
|
return fmt.Errorf("redis not client")
|
||||||
|
}
|
||||||
|
// 过期时间设置
|
||||||
|
ctx := context.Background()
|
||||||
|
err := rdb.Expire(ctx, key, expiration).Err()
|
||||||
|
if err != nil {
|
||||||
|
logger.Errorf("redis HIncrBy err %v", err)
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
@@ -4,7 +4,6 @@ import (
|
|||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"strings"
|
"strings"
|
||||||
"sync"
|
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"be.ems/src/framework/config"
|
"be.ems/src/framework/config"
|
||||||
@@ -31,15 +30,6 @@ if tonumber(current) == 1 then
|
|||||||
end
|
end
|
||||||
return tonumber(current);`)
|
return tonumber(current);`)
|
||||||
|
|
||||||
// 连接Redis实例
|
|
||||||
func ConnectPush(source string, rdb *redis.Client) {
|
|
||||||
if rdb == nil {
|
|
||||||
delete(rdbMap, source)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
rdbMap[source] = rdb
|
|
||||||
}
|
|
||||||
|
|
||||||
// 连接Redis实例
|
// 连接Redis实例
|
||||||
func Connect() {
|
func Connect() {
|
||||||
ctx := context.Background()
|
ctx := context.Background()
|
||||||
@@ -237,105 +227,6 @@ func Get(source, key string) (string, error) {
|
|||||||
return value, nil
|
return value, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// 获得缓存数据Hash
|
|
||||||
func GetHash(source, key string) (map[string]string, error) {
|
|
||||||
// 数据源
|
|
||||||
rdb := DefaultRDB()
|
|
||||||
if source != "" {
|
|
||||||
rdb = RDB(source)
|
|
||||||
}
|
|
||||||
|
|
||||||
ctx := context.Background()
|
|
||||||
value, err := rdb.HGetAll(ctx, key).Result()
|
|
||||||
if err == redis.Nil || err != nil {
|
|
||||||
return map[string]string{}, err
|
|
||||||
}
|
|
||||||
return value, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// 批量获得缓存数据 [key]result
|
|
||||||
func GetHashBatch(source string, keys []string) (map[string]map[string]string, error) {
|
|
||||||
result := make(map[string]map[string]string, 0)
|
|
||||||
if len(keys) == 0 {
|
|
||||||
return result, fmt.Errorf("not keys")
|
|
||||||
}
|
|
||||||
|
|
||||||
// 数据源
|
|
||||||
rdb := DefaultRDB()
|
|
||||||
if source != "" {
|
|
||||||
rdb = RDB(source)
|
|
||||||
}
|
|
||||||
|
|
||||||
// 创建一个有限的并发控制信号通道
|
|
||||||
sem := make(chan struct{}, 10)
|
|
||||||
var wg sync.WaitGroup
|
|
||||||
var mt sync.Mutex
|
|
||||||
batchSize := 1000
|
|
||||||
total := len(keys)
|
|
||||||
if total < batchSize {
|
|
||||||
batchSize = total
|
|
||||||
}
|
|
||||||
|
|
||||||
for i := 0; i < total; i += batchSize {
|
|
||||||
wg.Add(1)
|
|
||||||
go func(start int) {
|
|
||||||
ctx := context.Background()
|
|
||||||
// 并发控制,限制同时执行的 Goroutine 数量
|
|
||||||
sem <- struct{}{}
|
|
||||||
defer func() {
|
|
||||||
<-sem
|
|
||||||
ctx.Done()
|
|
||||||
wg.Done()
|
|
||||||
}()
|
|
||||||
|
|
||||||
// 检查索引是否越界
|
|
||||||
end := start + batchSize
|
|
||||||
if end > total {
|
|
||||||
end = total
|
|
||||||
}
|
|
||||||
pipe := rdb.Pipeline()
|
|
||||||
for _, key := range keys[start:end] {
|
|
||||||
pipe.HGetAll(ctx, key)
|
|
||||||
}
|
|
||||||
|
|
||||||
cmds, err := pipe.Exec(ctx)
|
|
||||||
if err != nil {
|
|
||||||
logger.Errorf("Failed to get hash batch exec err: %v", err)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// 将结果添加到 result map 并发访问
|
|
||||||
mt.Lock()
|
|
||||||
defer mt.Unlock()
|
|
||||||
|
|
||||||
// 处理命令结果
|
|
||||||
for _, cmd := range cmds {
|
|
||||||
if cmd.Err() != nil {
|
|
||||||
logger.Errorf("Failed to get hash batch cmds err: %v", cmd.Err())
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
// 将结果转换为 *redis.StringStringMapCmd 类型
|
|
||||||
rcmd, ok := cmd.(*redis.MapStringStringCmd)
|
|
||||||
if !ok {
|
|
||||||
logger.Errorf("Failed to get hash batch type err: %v", cmd.Err())
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
|
|
||||||
key := "-"
|
|
||||||
args := rcmd.Args()
|
|
||||||
if len(args) > 0 {
|
|
||||||
key = fmt.Sprint(args[1])
|
|
||||||
}
|
|
||||||
|
|
||||||
result[key] = rcmd.Val()
|
|
||||||
}
|
|
||||||
}(i)
|
|
||||||
}
|
|
||||||
|
|
||||||
wg.Wait()
|
|
||||||
return result, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// 判断是否存在
|
// 判断是否存在
|
||||||
func Has(source string, keys ...string) (bool, error) {
|
func Has(source string, keys ...string) (bool, error) {
|
||||||
// 数据源
|
// 数据源
|
||||||
|
|||||||
@@ -159,7 +159,7 @@ func (s *SysCacheController) ClearCacheSafe(c *gin.Context) {
|
|||||||
model.NewSysCacheNames(i18n.TKey(language, "cache.name.ne_data"), cachekey.NE_DATA_KEY),
|
model.NewSysCacheNames(i18n.TKey(language, "cache.name.ne_data"), cachekey.NE_DATA_KEY),
|
||||||
}
|
}
|
||||||
for _, v := range caches {
|
for _, v := range caches {
|
||||||
cacheKeys, err := redis.GetKeys("", v.CacheName+":*")
|
cacheKeys, err := redis.GetKeys("", v.CacheName+"*")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -56,7 +56,6 @@ func (s *UPFController) TotalFlow(c *gin.Context) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
data := s.perfKPIService.SelectUPFTotalFlow(neInfo.NeType, neInfo.RmUID, querys.Day)
|
up, down := s.perfKPIService.UPFTodayFlowFind(neInfo.RmUID, querys.Day)
|
||||||
|
c.JSON(200, result.OkData(map[string]int64{"up": up, "down": down}))
|
||||||
c.JSON(200, result.OkData(data))
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import (
|
|||||||
"be.ems/src/framework/middleware/collectlogs"
|
"be.ems/src/framework/middleware/collectlogs"
|
||||||
"be.ems/src/framework/middleware/repeat"
|
"be.ems/src/framework/middleware/repeat"
|
||||||
"be.ems/src/modules/network_data/controller"
|
"be.ems/src/modules/network_data/controller"
|
||||||
|
"be.ems/src/modules/network_data/service"
|
||||||
|
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
)
|
)
|
||||||
@@ -14,6 +15,9 @@ import (
|
|||||||
func Setup(router *gin.Engine) {
|
func Setup(router *gin.Engine) {
|
||||||
logger.Infof("开始加载 ====> network_data 模块路由")
|
logger.Infof("开始加载 ====> network_data 模块路由")
|
||||||
|
|
||||||
|
// 启动时需要的初始参数
|
||||||
|
InitLoad()
|
||||||
|
|
||||||
neDataGroup := router.Group("/neData")
|
neDataGroup := router.Group("/neData")
|
||||||
|
|
||||||
// 性能统计信息
|
// 性能统计信息
|
||||||
@@ -318,3 +322,9 @@ func Setup(router *gin.Engine) {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// InitLoad 初始参数
|
||||||
|
func InitLoad() {
|
||||||
|
// 启动时,加载UPF上下行流量
|
||||||
|
go service.NewPerfKPI.UPFTodayFlowLoad()
|
||||||
|
}
|
||||||
|
|||||||
@@ -7,8 +7,10 @@ import (
|
|||||||
|
|
||||||
"be.ems/src/framework/constants/cachekey"
|
"be.ems/src/framework/constants/cachekey"
|
||||||
"be.ems/src/framework/redis"
|
"be.ems/src/framework/redis"
|
||||||
|
"be.ems/src/framework/utils/parse"
|
||||||
"be.ems/src/modules/network_data/model"
|
"be.ems/src/modules/network_data/model"
|
||||||
"be.ems/src/modules/network_data/repository"
|
"be.ems/src/modules/network_data/repository"
|
||||||
|
neModel "be.ems/src/modules/network_element/model"
|
||||||
)
|
)
|
||||||
|
|
||||||
// 实例化数据层 PerfKPI 结构体
|
// 实例化数据层 PerfKPI 结构体
|
||||||
@@ -42,38 +44,100 @@ func (r *PerfKPI) SelectGoldKPITitle(neType string) []model.GoldKPITitle {
|
|||||||
return r.perfKPIRepository.SelectGoldKPITitle(neType)
|
return r.perfKPIRepository.SelectGoldKPITitle(neType)
|
||||||
}
|
}
|
||||||
|
|
||||||
// SelectUPFTotalFlow 查询UPF总流量 N3上行 N6下行
|
// UPFTodayFlowFind 查询UPF总流量 N3上行 N6下行
|
||||||
func (r *PerfKPI) SelectUPFTotalFlow(neType, rmUID string, day int) map[string]any {
|
func (r PerfKPI) UPFTodayFlowFind(rmUID string, day int) (int64, int64) {
|
||||||
now := time.Now()
|
|
||||||
// 获取当前日期
|
// 获取当前日期
|
||||||
endDate := fmt.Sprint(now.UnixMilli())
|
now := time.Now()
|
||||||
// 将当前日期前几天数
|
var upTotal, downTotal int64
|
||||||
startDate := fmt.Sprint(now.AddDate(0, 0, -day).Truncate(24 * time.Hour).UnixMilli())
|
|
||||||
|
|
||||||
var info map[string]any
|
// 查询最近7天的数据
|
||||||
|
for i := 0; i <= day; i++ {
|
||||||
|
dateKey := now.AddDate(0, 0, -i).Format("2006-01-02")
|
||||||
|
key := fmt.Sprintf("%sUPF_FLOW:%s:%s", cachekey.NE_DATA_KEY, rmUID, dateKey)
|
||||||
|
|
||||||
// 读取缓存数据 小于2分钟重新缓存
|
// 读取缓存数据
|
||||||
key := fmt.Sprintf("%sUPF:totalFlow:%s_%d", cachekey.NE_DATA_KEY, rmUID, day)
|
up, err := redis.GetHash("", key, "up")
|
||||||
infoStr, _ := redis.Get("", key)
|
if err != nil || up == "" {
|
||||||
if infoStr != "" {
|
up = "0"
|
||||||
json.Unmarshal([]byte(infoStr), &info)
|
}
|
||||||
expireSecond, _ := redis.GetExpire("", key)
|
down, err := redis.GetHash("", key, "down")
|
||||||
if expireSecond > 120 {
|
if err != nil || down == "" {
|
||||||
return info
|
down = "0"
|
||||||
|
}
|
||||||
|
|
||||||
|
upTotal += parse.Number(up)
|
||||||
|
downTotal += parse.Number(down)
|
||||||
|
}
|
||||||
|
|
||||||
|
return upTotal, downTotal
|
||||||
|
}
|
||||||
|
|
||||||
|
// UPFTodayFlow UPF流量今日统计
|
||||||
|
func (r PerfKPI) UPFTodayFlowUpdate(rmUID string, upValue, downValue int64, rest bool) error {
|
||||||
|
// 按日期存储统计数据
|
||||||
|
dateKey := time.Now().Format("2006-01-02")
|
||||||
|
key := fmt.Sprintf("%sUPF_FLOW:%s:%s", cachekey.NE_DATA_KEY, rmUID, dateKey)
|
||||||
|
|
||||||
|
// 重置数据
|
||||||
|
if rest {
|
||||||
|
err := redis.SetHash("", key, map[string]any{
|
||||||
|
"up": upValue,
|
||||||
|
"down": downValue,
|
||||||
|
})
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
// 设置key的过期时间为30天,自动清理旧数据
|
||||||
|
err = redis.Expire("", key, 30*24*time.Hour)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// down * 8 / 1000 / 1000 单位M
|
|
||||||
info = r.perfKPIRepository.SelectUPFTotalFlow(neType, rmUID, startDate, endDate)
|
|
||||||
if v, ok := info["up"]; ok && v == nil {
|
|
||||||
info["up"] = 0
|
|
||||||
}
|
|
||||||
if v, ok := info["down"]; ok && v == nil {
|
|
||||||
info["down"] = 0
|
|
||||||
}
|
|
||||||
|
|
||||||
// 保存到缓存
|
// 使用HIncrBy实时累加统计值
|
||||||
infoJSON, _ := json.Marshal(info)
|
if err := redis.IncrBy("", key, "up", upValue); err != nil {
|
||||||
redis.SetByExpire("", key, string(infoJSON), time.Duration(10)*time.Minute)
|
return err
|
||||||
|
}
|
||||||
return info
|
if err := redis.IncrBy("", key, "down", downValue); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// UPFTodayFlowLoad UPF上下行数据到redis
|
||||||
|
func (r PerfKPI) UPFTodayFlowLoad() {
|
||||||
|
cacheKeys, _ := redis.GetKeys("", cachekey.NE_KEY+"UPF:*")
|
||||||
|
if len(cacheKeys) == 0 {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// 今日流量
|
||||||
|
now := time.Now()
|
||||||
|
beginTime := now.Truncate(24 * time.Hour).UnixMilli()
|
||||||
|
endTime := beginTime + 24*60*60*1000 - 1
|
||||||
|
|
||||||
|
for _, key := range cacheKeys {
|
||||||
|
var v neModel.NeInfo
|
||||||
|
jsonStr, _ := redis.Get("", key)
|
||||||
|
if len(jsonStr) > 7 {
|
||||||
|
json.Unmarshal([]byte(jsonStr), &v)
|
||||||
|
}
|
||||||
|
if v.NeType == "UPF" && v.RmUID != "" {
|
||||||
|
// 查询历史数据
|
||||||
|
// down * 8 / 1000 / 1000 单位M
|
||||||
|
info := r.perfKPIRepository.SelectUPFTotalFlow("UPF", v.RmUID, fmt.Sprint(beginTime), fmt.Sprint(endTime))
|
||||||
|
if v, ok := info["up"]; ok && v == nil {
|
||||||
|
info["up"] = 0
|
||||||
|
}
|
||||||
|
if v, ok := info["down"]; ok && v == nil {
|
||||||
|
info["down"] = 0
|
||||||
|
}
|
||||||
|
|
||||||
|
upTotal := parse.Number(info["up"])
|
||||||
|
downTotal := parse.Number(info["down"])
|
||||||
|
|
||||||
|
// 将历史数据添加到Redis
|
||||||
|
r.UPFTodayFlowUpdate(v.RmUID, upTotal, downTotal, true)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -84,12 +84,17 @@ func (r *NeInfo) ClearNeCacheByNeType(neType string) bool {
|
|||||||
func (r *NeInfo) SelectNeInfoByNeType(neType string) []model.NeInfo {
|
func (r *NeInfo) SelectNeInfoByNeType(neType string) []model.NeInfo {
|
||||||
neInfo := make([]model.NeInfo, 0)
|
neInfo := make([]model.NeInfo, 0)
|
||||||
key := fmt.Sprintf("%s%s:*", cachekey.NE_KEY, strings.ToUpper(neType))
|
key := fmt.Sprintf("%s%s:*", cachekey.NE_KEY, strings.ToUpper(neType))
|
||||||
jsonStr, _ := redis.Get("", key)
|
cacheKeys, _ := redis.GetKeys("", key)
|
||||||
if len(jsonStr) > 7 {
|
if len(cacheKeys) > 0 {
|
||||||
err := json.Unmarshal([]byte(jsonStr), &neInfo)
|
for _, key := range cacheKeys {
|
||||||
if err != nil {
|
var v model.NeInfo
|
||||||
return neInfo
|
jsonStr, _ := redis.Get("", key)
|
||||||
|
if len(jsonStr) > 7 {
|
||||||
|
json.Unmarshal([]byte(jsonStr), &v)
|
||||||
|
}
|
||||||
|
neInfo = append(neInfo, v)
|
||||||
}
|
}
|
||||||
|
return neInfo
|
||||||
} else {
|
} else {
|
||||||
neInfo = r.neInfoRepository.SelectList(model.NeInfo{NeType: neType})
|
neInfo = r.neInfoRepository.SelectList(model.NeInfo{NeType: neType})
|
||||||
for _, v := range neInfo {
|
for _, v := range neInfo {
|
||||||
|
|||||||
@@ -34,11 +34,11 @@ func GetUPFTotalFlow(requestID string, data any) ([]byte, error) {
|
|||||||
return nil, fmt.Errorf("no matching network element information found")
|
return nil, fmt.Errorf("no matching network element information found")
|
||||||
}
|
}
|
||||||
|
|
||||||
dataMap := neDataService.NewPerfKPI.SelectUPFTotalFlow(neInfo.NeType, neInfo.RmUID, querys.Day)
|
up, down := neDataService.NewPerfKPI.UPFTodayFlowFind(neInfo.RmUID, querys.Day)
|
||||||
|
|
||||||
resultByte, err := json.Marshal(result.Ok(map[string]any{
|
resultByte, err := json.Marshal(result.Ok(map[string]any{
|
||||||
"requestId": requestID,
|
"requestId": requestID,
|
||||||
"data": dataMap,
|
"data": map[string]int64{"up": up, "down": down},
|
||||||
}))
|
}))
|
||||||
return resultByte, err
|
return resultByte, err
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
# Makefile for OMC-OMC-crontask project
|
# Makefile for OMC-OMC-crontask project
|
||||||
|
|
||||||
PROJECT = OMC
|
PROJECT = OMC
|
||||||
VERSION = 2.2502.3
|
VERSION = 2.2502.4
|
||||||
LIBDIR = be.ems/lib
|
LIBDIR = be.ems/lib
|
||||||
BINNAME = sshsvc
|
BINNAME = sshsvc
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user