Browse Source

兼容大小写指标

xyxie 4 months ago
parent
commit
0d60c608f4
1 changed files with 10 additions and 7 deletions
  1. 10 7
      services/edb_refresh.go

+ 10 - 7
services/edb_refresh.go

@@ -752,14 +752,17 @@ func DisableEdbRefresh(cont context.Context) (err error) {
 			for _, indexItem := range indexItems {
 				// 判断指标是否被创建
 				if _, ok := edbMap[indexItem.IndexCode]; !ok {
-					stopRefreshIds = append(stopRefreshIds, indexItem.BaseFromMysteelChemicalIndexId)
-					if len(stopRefreshIds) > 100 {
-						err = data_manage.SetStopRefreshMysteelChemicalIndex(stopRefreshIds)
-						if err != nil {
-							err = fmt.Errorf("设置禁止刷新失败:%v", err)
-							return
+					// 判断大写的指标编码是否存在
+					if _, ok1 := edbMap[strings.ToLower(indexItem.IndexCode)]; !ok1 {
+						stopRefreshIds = append(stopRefreshIds, indexItem.BaseFromMysteelChemicalIndexId)
+						if len(stopRefreshIds) > 100 {
+							err = data_manage.SetStopRefreshMysteelChemicalIndex(stopRefreshIds)
+							if err != nil {
+								err = fmt.Errorf("设置禁止刷新失败:%v", err)
+								return
+							}
+							stopRefreshIds = make([]int32, 0)
 						}
-						stopRefreshIds = make([]int32, 0)
 					}
 				}
 			}