Browse Source

Merge remote-tracking branch 'origin/eta/1.5.1' into debug

Roc 1 year ago
parent
commit
1d0111ffc1

+ 4 - 4
controllers/data_manage/edb_info_refresh.go

@@ -438,8 +438,8 @@ func (c *EdbInfoController) SaveEdbRefreshDefaultConfig() {
 }
 
 // SaveEdbRefreshConfig
-// @Title 单独设置指标刷新配置接口
-// @Description 单独设置指标刷新配置接口
+// @Title 设置指标刷新配置接口
+// @Description 设置指标刷新配置接口
 // @Param	request	body data_manage.SaveEdbRefreshConfigReq true "type json string"
 // @Success 200 {object} data_manage.RefreshBaseEdbInfoResp
 // @router /edb_info/refresh/config/save [post]
@@ -578,8 +578,8 @@ func (c *EdbInfoController) SaveEdbRefreshConfig() {
 }
 
 // SaveEdbRefreshStatus
-// @Title 单独设置指标刷新状态接口
-// @Description 单独设置指标刷新状态接口
+// @Title 设置指标刷新状态接口
+// @Description 设置指标刷新状态接口
 // @Param	request	body data_manage.SaveEdbRefreshStatusReq true "type json string"
 // @Success 200 {object} data_manage.RefreshBaseEdbInfoResp
 // @router /edb_info/refresh/status/save [post]

+ 1 - 0
models/data_manage/edb_info.go

@@ -1646,6 +1646,7 @@ type TraceEdbInfoResp struct {
 	UniqueCode  string             `description:"唯一编码"`
 	ClassifyId  int                `description:"分类ID"`
 	Child       []TraceEdbInfoResp `description:"下级来源"`
+	IsStop      int8               `description:"是否终止"`
 	EdbInfo     *EdbInfo           `description:"指标信息" json:"-"`
 }
 

+ 3 - 1
models/data_manage/edb_info_calculate_mapping.go

@@ -68,6 +68,7 @@ func GetEdbInfoCalculateMappingDetail(edbInfoId int) (item *EdbInfoCalculateMapp
 }
 
 // EdbInfoCalculateMappingInfo
+// @Description: 计算指标与基础指标关系表
 type EdbInfoCalculateMappingInfo struct {
 	EdbInfoCalculateMappingId int       `orm:"column(edb_info_calculate_mapping_id);pk"`
 	EdbInfoId                 int       `description:"计算指标id"`
@@ -88,12 +89,13 @@ type EdbInfoCalculateMappingInfo struct {
 	FromEdbInfoType           int       `description:"来源指标类型: 0-基础指标; 1-预测指标"`
 	FromClassifyId            int       `description:"来源指标分类ID"`
 	FromUniqueCode            string    `description:"来源指标唯一编码"`
+	NoUpdate                  int8      `description:"是否停止更新,0:继续更新;1:停止更新"`
 }
 
 // GetEdbInfoCalculateMappingListByEdbInfoId 根据生成的指标id获取来源的指标id列表
 func GetEdbInfoCalculateMappingListByEdbInfoId(edbInfoId int) (items []*EdbInfoCalculateMappingInfo, err error) {
 	o := orm.NewOrmUsingDB("data")
-	sql := ` SELECT a.*,b.edb_type as from_edb_type,b.edb_info_type as from_edb_info_type, b.unique_code AS from_unique_code, b.classify_id AS from_classify_id FROM edb_info_calculate_mapping AS a
+	sql := ` SELECT a.*,b.edb_type as from_edb_type,b.edb_info_type as from_edb_info_type, b.unique_code AS from_unique_code, b.classify_id AS from_classify_id,b.no_update FROM edb_info_calculate_mapping AS a
 			INNER JOIN edb_info AS b ON a.from_edb_info_id=b.edb_info_id
 			WHERE a.edb_info_id=? `
 	_, err = o.Raw(sql, edbInfoId).QueryRows(&items)

+ 6 - 0
services/data/edb_info.go

@@ -155,6 +155,9 @@ func getEdbInfoIdList(edbInfoIdList []int) (newBaseEdbInfoArr, newBasePredictEdb
 		for _, edbInfo := range tmpBaseEdbInfoArr {
 			if _, ok := newBaseMap[edbInfo.EdbInfoId]; !ok {
 				newBaseMap[edbInfo.EdbInfoId] = edbInfo
+				if edbInfo.NoUpdate == 1 {
+					continue
+				}
 				newBaseEdbInfoArr = append(newBaseEdbInfoArr, edbInfo)
 			}
 		}
@@ -2424,6 +2427,7 @@ func TraceEdbInfoByEdbInfoId(edbInfoId int) (traceEdbInfo data_manage.TraceEdbIn
 		//Source:      edbInfo.Source,
 		UniqueCode: edbInfo.UniqueCode,
 		ClassifyId: edbInfo.ClassifyId,
+		IsStop:     edbInfo.NoUpdate,
 		EdbInfo:    edbInfo,
 	}
 	findIdMap := make(map[int]int)
@@ -2472,6 +2476,7 @@ func TraceEdbInfoByEdbInfoIdList(edbInfoIdList []int) (traceEdbInfoList []data_m
 			//Source:      edbInfo.Source,
 			UniqueCode: edbInfo.UniqueCode,
 			ClassifyId: edbInfo.ClassifyId,
+			IsStop:     edbInfo.NoUpdate,
 			EdbInfo:    edbInfo,
 		}
 		traceEdbInfo.Child, err = traceEdbInfoByEdbInfoId(edbInfo.EdbInfoId, traceEdbInfo, edbInfoRuleMap, findIdMap, existMap, edbMappingMap)
@@ -2537,6 +2542,7 @@ func traceEdbInfoByEdbInfoId(edbInfoId int, traceEdbInfo data_manage.TraceEdbInf
 			EdbType:     v.FromEdbType,
 			UniqueCode:  v.FromUniqueCode,
 			ClassifyId:  v.FromClassifyId,
+			IsStop:      v.NoUpdate,
 			EdbInfo:     edbInfoMap[v.FromEdbInfoId],
 		}