|
@@ -2,10 +2,10 @@ package controllers
|
|
|
|
|
|
import (
|
|
|
"encoding/json"
|
|
|
- "eta/eta_index_lib/logic"
|
|
|
- "eta/eta_index_lib/models"
|
|
|
- "eta/eta_index_lib/services"
|
|
|
- "eta/eta_index_lib/utils"
|
|
|
+ "eta_gn/eta_index_lib/logic"
|
|
|
+ "eta_gn/eta_index_lib/models"
|
|
|
+ "eta_gn/eta_index_lib/services"
|
|
|
+ "eta_gn/eta_index_lib/utils"
|
|
|
"fmt"
|
|
|
"math"
|
|
|
"strconv"
|
|
@@ -46,7 +46,7 @@ func (this *SmmController) Add() {
|
|
|
if !utils.Rc.IsExist(cacheKey) {
|
|
|
utils.Rc.SetNX(cacheKey, 1, 1*time.Minute)
|
|
|
smmBaseDataAllList, err := services.GetEdbDataFromSmm(req.EdbCode)
|
|
|
- if err!= nil {
|
|
|
+ if err != nil {
|
|
|
br.Msg = "获取指标信息失败!"
|
|
|
br.ErrMsg = "获取指标信息失败 GetEdbDataFromSmm,Err:" + err.Error()
|
|
|
return
|
|
@@ -287,7 +287,7 @@ func (this *SmmController) List() {
|
|
|
}()
|
|
|
|
|
|
list, err := models.GetBaseFromSmmIndex()
|
|
|
- if err!= nil {
|
|
|
+ if err != nil {
|
|
|
br.Msg = "获取指标失败"
|
|
|
br.ErrMsg = "获取指标失败, Err: " + err.Error()
|
|
|
return
|
|
@@ -303,7 +303,7 @@ func (this *SmmController) List() {
|
|
|
params.Page = 1
|
|
|
params.PageSize = 500
|
|
|
total, err := services.GetSmmNewIndexListTotalFromBridge(params)
|
|
|
- if err!= nil {
|
|
|
+ if err != nil {
|
|
|
br.Msg = "获取指标失败"
|
|
|
br.ErrMsg = "获取指标数据失败, Err: " + err.Error()
|
|
|
return
|
|
@@ -318,7 +318,7 @@ func (this *SmmController) List() {
|
|
|
time.Sleep(time.Second * 2)
|
|
|
params.Page = i
|
|
|
indexList, err := services.GetSmmNewIndexListFromBridge(params)
|
|
|
- if err!= nil {
|
|
|
+ if err != nil {
|
|
|
br.Msg = "获取指标失败"
|
|
|
br.ErrMsg = "获取指标数据失败, Err: " + err.Error()
|
|
|
}
|
|
@@ -334,14 +334,14 @@ func (this *SmmController) List() {
|
|
|
br.ErrMsg = "更新指标失败,Err:" + err.Error()
|
|
|
return
|
|
|
}
|
|
|
- fmt.Println("更新数据:",item.IndexCode)
|
|
|
+ fmt.Println("更新数据:", item.IndexCode)
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
if len(addList) > 0 {
|
|
|
- _,err = models.AddBaseFromSmmIndex(addList)
|
|
|
- if err!= nil {
|
|
|
+ _, err = models.AddBaseFromSmmIndex(addList)
|
|
|
+ if err != nil {
|
|
|
br.Msg = "新增指标失败"
|
|
|
br.ErrMsg = "新增指标失败,Err:" + err.Error()
|
|
|
return
|
|
@@ -351,8 +351,7 @@ func (this *SmmController) List() {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-
|
|
|
br.Ret = 200
|
|
|
br.Success = true
|
|
|
br.Msg = "操作成功"
|
|
|
-}
|
|
|
+}
|