Bläddra i källkod

Merge branch 'feature/eta2.1.2_predit_edb' into debug

# Conflicts:
#	utils/constants.go
xyxie 7 månader sedan
förälder
incheckning
0eb9e9021e

+ 20 - 0
controllers/data_manage/predict_edb_info.go

@@ -868,6 +868,26 @@ func (this *PredictEdbInfoController) Detail() {
 			if len(tmpPredictEdbConfCalculateMappingDetail) <= 0 {
 				tmpPredictEdbConfCalculateMappingDetail = make([]*data_manage.PredictEdbConfCalculateMappingDetail, 0)
 			}
+			if v.RuleType == 16 {
+				if !strings.Contains(v.Value, "YearList") {
+					// 解析json串,加入YearList字段重新生成json字符串
+					var tmpValue *data.AnnualValueInversionConf
+					err = json.Unmarshal([]byte(v.Value), &tmpValue)
+					if err != nil {
+						br.Msg = "获取失败"
+						br.ErrMsg = "获取预测指标配置与关联指标信息失败,Err:" + err.Error()
+						return
+					}
+					tmpValue.YearList = append(tmpValue.YearList, tmpValue.Year)
+					tmpValueByte, err := json.Marshal(tmpValue)
+					if err != nil {
+						br.Msg = "获取失败"
+						br.ErrMsg = "获取预测指标配置与关联指标信息失败,Err:" + err.Error()
+						return
+					}
+					v.Value = string(tmpValueByte)
+				}
+			}
 			tmp := data_manage.PredictEdbConfDetail{
 				ConfigId:         v.ConfigId,
 				PredictEdbInfoId: v.PredictEdbInfoId,

+ 4 - 3
services/data/predict_edb_info_rule.go

@@ -1525,9 +1525,10 @@ func GetChartPredictEdbInfoDataListByRuleNAnnualAverage(edbInfoId int, configVal
 
 // AnnualValueInversionConf 年度值倒推规则
 type AnnualValueInversionConf struct {
-	Value float64 `description:"年度值"`
-	Type  int     `description:"分配方式,1:均值法;2:同比法"`
-	Year  int     `description:"同比年份"`
+	Value    float64 `description:"年度值"`
+	Type     int     `description:"分配方式,1:均值法;2:同比法"`
+	Year     int     `description:"同比年份"`
+	YearList []int   `description:"指定年份列表"`
 }
 
 // GetChartPredictEdbInfoDataListByRuleAnnualValueInversion 根据 年度值倒推 规则获取预测数据

+ 0 - 1
utils/constants.go

@@ -181,7 +181,6 @@ const (
 	DATA_SOURCE_LY                                   = 91       // 粮油商务网
 	DATA_SOURCE_FENWEI                               = 77       // 汾渭数据->92
 	DATA_SOURCE_HISUGAR                              = 93       // 泛糖科技 -> 93
-	DATA_SOURCE_PREDICT_STATIC                       = 94       // 静态指标 -> 94
 )
 
 // 数据刷新频率