Przeglądaj źródła

跨品种分析校验图表是否存在

xyxie 8 miesięcy temu
rodzic
commit
34a5af659d
1 zmienionych plików z 5 dodań i 2 usunięć
  1. 5 2
      services/edb_relation.go

+ 5 - 2
services/edb_relation.go

@@ -331,7 +331,7 @@ func InitChartCrossVariety() {
 			chartInfoCrossList = make([]*cross_variety.ChartInfoCrossVariety, 0)
 		}
 
-		/*// 查询图表信息
+		// 查询图表信息
 		chartInfoList, e := data_manage.GetChartInfoByChartInfoIds(chartIds)
 		if e != nil {
 			err = fmt.Errorf("查询图表信息列表失败 Err:%s", e)
@@ -341,7 +341,7 @@ func InitChartCrossVariety() {
 		for _, v := range chartInfoList {
 			chartInfoMap[v.ChartInfoId] = v
 		}
-		*/
+
 		//查询引用关系列表,
 		chartEdbRelationList, e := data_manage.GetEdbInfoRelationByReferObjectIds(chartIds, utils.EDB_RELATION_CHART)
 		if e != nil {
@@ -357,6 +357,9 @@ func InitChartCrossVariety() {
 			nowTime := time.Now()
 			for _, item := range chartCrossList {
 				name := fmt.Sprintf("%d-%d", item.ChartInfoId, edbInfoId)
+				if _, chartOk := chartInfoMap[item.ChartInfoId]; !chartOk { //表示图表不存在
+					continue
+				}
 				if _, ok1 := existRelationMap[name]; !ok1 {
 					edbInfo, ok2 := edbInfoMap[edbInfoId]
 					if !ok2 {