Browse Source

汾渭数据源对接-是否存在于指标库逻辑修改

gmy 6 months ago
parent
commit
b23935757f
2 changed files with 7 additions and 10 deletions
  1. 5 8
      controllers/data_manage/fenwei_data.go
  2. 2 2
      models/data_manage/base_from_fenwei.go

+ 5 - 8
controllers/data_manage/fenwei_data.go

@@ -175,11 +175,9 @@ func (this *EdbInfoController) FenweiIndexData() {
 		product.CreateTime = v.CreateTime
 		product.ModifyTime = v.ModifyTime
 
-		_, ok := edbCodeMap[v.IndexCode]
-		if ok {
-			product.EdbExist = true
-		} else {
-			product.EdbExist = false
+		edbInfo := edbCodeMap[v.IndexCode]
+		if edbInfo != nil {
+			product.EdbInfoId = edbInfo.EdbInfoId
 		}
 
 		total := countMap[v.IndexCode]
@@ -322,9 +320,8 @@ func (this *EdbInfoController) FenweiSingleData() {
 	}
 	ret.Data = dataList
 	if len(edbCodeList) > 0 {
-		ret.EdbExist = true
-	} else {
-		ret.EdbExist = false
+		edbInfo := edbCodeList[0]
+		ret.EdbInfoId = edbInfo.EdbInfoId
 	}
 
 	br.Ret = 200

+ 2 - 2
models/data_manage/base_from_fenwei.go

@@ -31,7 +31,7 @@ type BaseFromFenweiIndexList struct {
 	ModifyTime    string
 	DataList      []*BaseFromFenweiData
 	Paging        *paging.PagingItem `description:"分页数据"`
-	EdbExist      bool               `description:"是否存在于指标库"`
+	EdbInfoId     int                `json:"edb_info_id" description:"指标库主键id"`
 }
 
 type FenweiSingleDataResp struct {
@@ -44,7 +44,7 @@ type FenweiSingleDataResp struct {
 	CreateTime    string
 	ModifyTime    string
 	Data          []*FenweiSingleData
-	EdbExist      bool `description:"是否存在于指标库"`
+	EdbInfoId     int `json:"edb_info_id" description:"指标库主键id"`
 }
 
 type FenweiSingleData struct {