hsun 7 mēneši atpakaļ
vecāks
revīzija
da80e353cb
2 mainītis faili ar 6 papildinājumiem un 7 dzēšanām
  1. 3 3
      models/base_from_ths_hf.go
  2. 3 4
      services/base_from_ths_hf.go

+ 3 - 3
models/base_from_ths_hf.go

@@ -443,12 +443,12 @@ func (m BaseFromThsHfIndex) getEdbInfoMaxAndMinInfoByMongo(edbCode string) (item
 	}
 
 	item = &EdbInfoMaxAndMinInfo{
-		MinDate:     result.MinDate.Format(utils.FormatDate),
-		MaxDate:     result.MaxDate.Format(utils.FormatDate),
+		MinDate:     result.MinDate.Format(utils.FormatDateTime),
+		MaxDate:     result.MaxDate.Format(utils.FormatDateTime),
 		MinValue:    result.MinValue,
 		MaxValue:    result.MaxValue,
 		LatestValue: result.LatestValue,
-		LatestDate:  result.LatestDate.Format(utils.FormatDate),
+		LatestDate:  result.LatestDate.Format(utils.FormatDateTime),
 		EndValue:    result.EndValue,
 	}
 	return

+ 3 - 4
services/base_from_ths_hf.go

@@ -626,18 +626,17 @@ func RefreshEdbFromThsHfBaseIndex(baseCode, startTime string) (err error) {
 		}
 
 		// 刷新指标
-		if e := thsOb.Refresh(edb, codeMapping[v.EdbCode], startTime); e != nil {
+		if e = thsOb.Refresh(edb, codeMapping[v.EdbCode], startTime); e != nil {
 			utils.FileLog.Info(fmt.Sprintf("RefreshEdbFromThsHfBaseIndex-刷新指标失败, %v", e))
 			_ = utils.Rc.Delete(cacheKey)
 			continue
 		}
 
 		// 更新指标最值
-		e, _ = models.UnifiedModifyEdbInfoMaxAndMinInfo(edb)
-		if e != nil {
+		if e = thsOb.UnifiedModifyEdbInfoMaxAndMinInfo(edb); e != nil {
 			utils.FileLog.Info(fmt.Sprintf("RefreshEdbFromThsHfBaseIndex-更新指标最值失败, %v", e))
 			_ = utils.Rc.Delete(cacheKey)
-			continue
+			return
 		}
 		_ = utils.Rc.Delete(cacheKey)