Explorar el Código

Merge branch 'feature/eta_1.9.3'

hsun hace 9 meses
padre
commit
84b74c91ad
Se han modificado 2 ficheros con 7 adiciones y 7 borrados
  1. 3 3
      models/base_from_ths_hf.go
  2. 4 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

+ 4 - 4
services/base_from_ths_hf.go

@@ -376,6 +376,7 @@ func RefreshThsHfBaseIndex(indexItem *models.BaseFromThsHfIndex, codeWithData *m
 			origin.Value = newVal
 			origin.ModifyTime = time.Now().Local()
 			updateData = append(updateData, origin)
+			continue
 		}
 
 		// 新增的数据去重
@@ -626,18 +627,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)