|
@@ -2,9 +2,9 @@ package data_manage
|
|
|
|
|
|
import (
|
|
|
"encoding/json"
|
|
|
- "eta/eta_api/models"
|
|
|
- "eta/eta_api/models/data_manage"
|
|
|
- "eta/eta_api/utils"
|
|
|
+ "eta_gn/eta_api/models"
|
|
|
+ "eta_gn/eta_api/models/data_manage"
|
|
|
+ "eta_gn/eta_api/utils"
|
|
|
"fmt"
|
|
|
"github.com/rdlucklib/rdluck_tools/paging"
|
|
|
"strconv"
|
|
@@ -66,16 +66,16 @@ func (this *EdbInfoController) SmmApiList() {
|
|
|
if len(types) > 0 {
|
|
|
condition += " AND ( "
|
|
|
for _, v := range types {
|
|
|
- typeArr := strings.Split(v,",")
|
|
|
+ typeArr := strings.Split(v, ",")
|
|
|
for i, v := range typeArr {
|
|
|
if i == 0 {
|
|
|
condition += " ( "
|
|
|
}
|
|
|
typeStr := "type_"
|
|
|
typeStr += fmt.Sprintf("%d", i+1)
|
|
|
- condition += typeStr+" =? "
|
|
|
+ condition += typeStr + " =? "
|
|
|
pars = append(pars, v)
|
|
|
- if i == len(typeArr) - 1 {
|
|
|
+ if i == len(typeArr)-1 {
|
|
|
condition += " ) "
|
|
|
} else {
|
|
|
condition += " AND "
|
|
@@ -88,13 +88,13 @@ func (this *EdbInfoController) SmmApiList() {
|
|
|
}
|
|
|
|
|
|
if frequency != "" {
|
|
|
- frequencyArr := strings.Split(frequency,",")
|
|
|
+ frequencyArr := strings.Split(frequency, ",")
|
|
|
condition += ` AND frequency IN (` + utils.GetOrmInReplace(len(frequencyArr)) + `) `
|
|
|
pars = append(pars, frequencyArr)
|
|
|
}
|
|
|
|
|
|
if dataState != "" {
|
|
|
- stateArr := strings.Split(dataState,",")
|
|
|
+ stateArr := strings.Split(dataState, ",")
|
|
|
if strings.Contains(dataState, "normal") {
|
|
|
stateArr = append(stateArr, "")
|
|
|
condition += ` AND data_state IN (` + utils.GetOrmInReplace(len(stateArr)) + `) `
|
|
@@ -125,7 +125,7 @@ func (this *EdbInfoController) SmmApiList() {
|
|
|
}
|
|
|
|
|
|
if indexCodes != "" {
|
|
|
- indexCodeArr := strings.Split(indexCodes,",")
|
|
|
+ indexCodeArr := strings.Split(indexCodes, ",")
|
|
|
indexCodeStr := ""
|
|
|
for _, v := range indexCodeArr {
|
|
|
indexCodeStr += "'" + v + "',"
|
|
@@ -141,7 +141,7 @@ func (this *EdbInfoController) SmmApiList() {
|
|
|
}
|
|
|
|
|
|
total, err := data_manage.GetSmmIndexDataListCount(condition, pars)
|
|
|
- if err!= nil {
|
|
|
+ if err != nil {
|
|
|
br.Msg = "获取指标总数失败"
|
|
|
br.ErrMsg = "获取指标总数失败,Err:" + err.Error()
|
|
|
return
|
|
@@ -203,11 +203,11 @@ func (this *EdbInfoController) SmmApiTypeList() {
|
|
|
|
|
|
// 初始化
|
|
|
for _, v := range typeList {
|
|
|
- if v.Type1 != ""{
|
|
|
- if _, ok := typeMap[v.Type1];!ok {
|
|
|
+ if v.Type1 != "" {
|
|
|
+ if _, ok := typeMap[v.Type1]; !ok {
|
|
|
typeMap[v.Type1] = make(map[string][]string)
|
|
|
} else {
|
|
|
- if _, ok := typeMap[v.Type1][v.Type2];!ok {
|
|
|
+ if _, ok := typeMap[v.Type1][v.Type2]; !ok {
|
|
|
typeMap[v.Type1][v.Type2] = make([]string, 0)
|
|
|
}
|
|
|
}
|
|
@@ -215,7 +215,7 @@ func (this *EdbInfoController) SmmApiTypeList() {
|
|
|
}
|
|
|
|
|
|
for _, v := range typeList {
|
|
|
- if v.Type1 != ""{
|
|
|
+ if v.Type1 != "" {
|
|
|
typeMap[v.Type1][v.Type2] = append(typeMap[v.Type1][v.Type2], v.Type3)
|
|
|
}
|
|
|
}
|
|
@@ -227,7 +227,7 @@ func (this *EdbInfoController) SmmApiTypeList() {
|
|
|
var child data_manage.TypeListRespItem
|
|
|
child.Type = type2
|
|
|
for _, type3 := range type3List {
|
|
|
- child.Child = append(child.Child, data_manage.TypeListRespItem{type3,nil})
|
|
|
+ child.Child = append(child.Child, data_manage.TypeListRespItem{type3, nil})
|
|
|
}
|
|
|
item.Child = append(item.Child, child)
|
|
|
}
|