瀏覽代碼

Merge branch 'feature/eta1.5.7_edb_replace' into debug

xyxie 11 月之前
父節點
當前提交
309ea915c8
共有 3 個文件被更改,包括 23 次插入3 次删除
  1. 17 2
      models/data_manage/multiple_graph_config_chart_mapping.go
  2. 0 0
      services/edb_info_replace.go
  3. 6 1
      static/ErrMsgConfig.json

+ 17 - 2
models/data_manage/multiple_graph_config_chart_mapping.go

@@ -145,7 +145,7 @@ func ReplaceMultipleGraphConfigChartEdb(oldEdbInfo, newEdbInfo *EdbInfo) (replac
 				}
 			}
 		}
-		if len(configIds) >= 0 {
+		if len(configIds) > 0 {
 			numStr := utils.GetOrmInReplace(len(configIds))
 			//更新配置中的指标A
 			sql := `UPDATE multiple_graph_config SET edb_info_id_a=?, modify_time=? WHERE edb_info_id_a=? and multiple_graph_config_id IN (` + numStr + `)`
@@ -168,15 +168,30 @@ func ReplaceMultipleGraphConfigChartEdb(oldEdbInfo, newEdbInfo *EdbInfo) (replac
 				errmsg = "更新指标id关联图表配置信息失败:Err:" + err.Error()
 				return
 			}
+
 			logMsg += `涉及到的配置id:` + strings.Join(configIdStr, ",") + ";"
 			configIds = make([]int, 0)
 			configIdStr = make([]string, 0)
 		}
 	}
 
+	// 更新相关性图表中的
+	sql := `UPDATE chart_info_correlation SET edb_info_id_first=?, modify_time=? WHERE edb_info_id_first=?`
+	_, err = to.Raw(sql, newEdbInfo.EdbInfoId, time.Now(), oldEdbInfo.EdbInfoId).Exec()
+	if err != nil {
+		errmsg = "更新相关性图表中的指标id关联失败:Err:" + err.Error()
+		return
+	}
+	sql = `UPDATE chart_info_correlation SET edb_info_id_second=?, modify_time=? WHERE edb_info_id_second=?`
+	_, err = to.Raw(sql, newEdbInfo.EdbInfoId, time.Now(), oldEdbInfo.EdbInfoId).Exec()
+	if err != nil {
+		errmsg = "更新相关性图表中的指标id关联失败:Err:" + err.Error()
+		return
+	}
+
 	// 替换拟合方程曲线替换指标
 	// 替换跨品种标签绑定得到指标ID
-	sql := `UPDATE chart_tag_variety SET edb_info_id=?, modify_time=? WHERE edb_info_id=?`
+	sql = `UPDATE chart_tag_variety SET edb_info_id=?, modify_time=? WHERE edb_info_id=?`
 	_, err = to.Raw(sql, newEdbInfo.EdbInfoId, time.Now(), oldEdbInfo.EdbInfoId).Exec()
 	if err != nil {
 		errmsg = "更新指标id关联跨品种分析标签失败:Err:" + err.Error()

+ 0 - 0
services/edb_info_global.go → services/edb_info_replace.go


+ 6 - 1
static/ErrMsgConfig.json

@@ -52,5 +52,10 @@
   "日期数量已达上限!": "The number of dates has reached the limit!",
   "该品种已在指标库生成指标,不可删除": "This variety has already generated indicators in the index library and cannot be deleted",
   "当前指标已用作画图,不可删除": "The current metric is in use for charting and cannot be deleted",
-  "当前指标已被表格引用,不可删除":"The current metric is referenced by a table and cannot be deleted"
+  "当前指标已被表格引用,不可删除":"The current metric is referenced by a table and cannot be deleted",
+  "当前指标已用作指标运算,不可删除": "The current metric is used in metric calculations and cannot be deleted.",
+  "当前指标已用作预测指标,不可删除": "The current metric is used as a forecasting indicator and cannot be deleted.",
+  "当前指标已添加到跨品种分析,不可删除": "The current metric has been added to cross-commodity analysis and cannot be deleted.",
+  "指标已删除,请刷新页面": "Metric deleted, please refresh the page.",
+  "删除失败": "Deletion failed."
 }