fix: kpi granularity column update to NULL

This commit is contained in:
2024-01-23 20:15:45 +08:00
parent 413f0b4951
commit 5e4183cebc
4 changed files with 21 additions and 6 deletions

11
.vscode/launch.json vendored
View File

@@ -45,6 +45,15 @@
"mode": "debug",
"program": "d:/local.git/ems.agt/crontask",
"console": "integratedTerminal"
}
},
{
"name": "debug encyaml",
"type": "go",
"request": "launch",
"mode": "debug",
"program": "d:/local.git/ems.agt/tools/encode",
//"args": ["-p","../../config/param/smf_param_config.yaml"],
"console": "integratedTerminal"
}
]
}

View File

@@ -145,8 +145,11 @@ ALTER TABLE `omc_db`.`sys_dict_data`
MODIFY COLUMN `dict_code` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '字典编码' FIRST;
ALTER TABLE `omc_db`.`gold_kpi`
ADD COLUMN IF NOT EXISTS `granularity` tinyint NOT NULL DEFAULT 60 COMMENT '时间颗粒度: 5/10/.../60/300 (秒)' AFTER `index`;
ADD COLUMN IF NOT EXISTS `granularity` tinyint DEFAULT 60 COMMENT '时间颗粒度: 5/10/.../60/300 (秒)' AFTER `index`;
ALTER TABLE `omc_db`.`ne_info`
DROP PRIMARY KEY,
ADD PRIMARY KEY (`id`) USING BTREE;
ADD PRIMARY KEY (`id`) USING BTREE;
ALTER TABLE `omc_db`.`gold_kpi`
MODIFY COLUMN `granularity` tinyint(4) NULL DEFAULT 60 COMMENT '时间颗粒度: 5/10/.../60/300 (秒)' AFTER `date`;

View File

@@ -145,8 +145,11 @@ ALTER TABLE `omc_db`.`sys_dict_data`
MODIFY COLUMN `dict_code` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '字典编码' FIRST;
ALTER TABLE `omc_db`.`gold_kpi`
ADD COLUMN IF NOT EXISTS `granularity` tinyint NOT NULL DEFAULT 60 COMMENT '时间颗粒度: 5/10/.../60/300 (秒)' AFTER `index`;
ADD COLUMN IF NOT EXISTS `granularity` tinyint DEFAULT 60 COMMENT '时间颗粒度: 5/10/.../60/300 (秒)' AFTER `index`;
ALTER TABLE `omc_db`.`ne_info`
DROP PRIMARY KEY,
ADD PRIMARY KEY (`id`) USING BTREE;
ADD PRIMARY KEY (`id`) USING BTREE;
ALTER TABLE `omc_db`.`gold_kpi`
MODIFY COLUMN `granularity` tinyint(4) NULL DEFAULT 60 COMMENT '时间颗粒度: 5/10/.../60/300 (秒)' AFTER `date`;

View File

@@ -117,7 +117,7 @@ func (s *BarProcessor) Execute(data any) (any, error) {
state := new(SystemState)
_ = json.Unmarshal(response.Body(), &state)
var dateStr *string = nil
if state.ExpiryDate != "" {
if state.ExpiryDate != "" && state.ExpiryDate != "-" {
dateStr = &state.ExpiryDate
}
neState := new(dborm.NeState)