|
@@ -1770,6 +1770,9 @@ func (this *EdbInfoController) EdbInfoFilterByEs() {
|
|
|
startSize = paging.StartIndex(currentIndex, pageSize)
|
|
|
|
|
|
keyWord := this.GetString("KeyWord")
|
|
|
+ if keyWord == `` {
|
|
|
+ keyWord = this.GetString("Keyword")
|
|
|
+ }
|
|
|
keyWord = strings.TrimSpace(keyWord)
|
|
|
filterSource, _ := this.GetInt("FilterSource")
|
|
|
if filterSource <= 0 {
|
|
@@ -1780,111 +1783,27 @@ func (this *EdbInfoController) EdbInfoFilterByEs() {
|
|
|
|
|
|
frequency := this.GetString("Frequency")
|
|
|
|
|
|
-
|
|
|
- edbTypeList := make([]int, 0)
|
|
|
- edbInfoType := -1
|
|
|
edbTypeStr := this.GetString("EdbType", "0")
|
|
|
|
|
|
-
|
|
|
- searchUserId := this.SysUser.AdminId
|
|
|
- {
|
|
|
- if edbTypeStr == `` || edbTypeStr == `0` {
|
|
|
- edbTypeList = []int{1, 2}
|
|
|
- edbInfoType = 0
|
|
|
- } else if edbTypeStr == `1` {
|
|
|
- edbTypeList = []int{1}
|
|
|
- edbInfoType = 0
|
|
|
- searchUserId = 0
|
|
|
- } else {
|
|
|
- var hasEdb, hasPredictEdb bool
|
|
|
- tmpEdbTypeList := strings.Split(edbTypeStr, `,`)
|
|
|
- for _, v := range tmpEdbTypeList {
|
|
|
- edbType, err := strconv.Atoi(v)
|
|
|
- if err != nil {
|
|
|
- br.Msg = "EdbType异常"
|
|
|
- br.ErrMsg = "EdbType异常,Err:" + err.Error()
|
|
|
- return
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- switch edbType {
|
|
|
- case 1, 2:
|
|
|
- hasEdb = true
|
|
|
- edbTypeList = append(edbTypeList, edbType)
|
|
|
- case 3:
|
|
|
- hasPredictEdb = true
|
|
|
- edbTypeList = []int{1, 2}
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- if hasEdb && !hasPredictEdb {
|
|
|
- edbInfoType = 0
|
|
|
- } else if !hasEdb && hasPredictEdb {
|
|
|
-
|
|
|
- edbInfoType = 1
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
edbAuth, _ := this.GetInt("EdbAuth", 0)
|
|
|
|
|
|
edbCollect, _ := this.GetInt("EdbCollect", 0)
|
|
|
|
|
|
-
|
|
|
- searchClassifyIdList := make([]int, 0)
|
|
|
- searchPublicClassifyIdList := make([]int, 0)
|
|
|
|
|
|
classifyId, _ := this.GetInt("ClassifyId")
|
|
|
- if classifyId > 0 {
|
|
|
- switch edbAuth {
|
|
|
- case 1:
|
|
|
- allChildClassifyItemList, err, _ := data.GetAllChildClassifyByParentId(classifyId)
|
|
|
- if err != nil {
|
|
|
- br.Msg = "获取失败"
|
|
|
- br.ErrMsg = "获取指标分类信息失败,Err:" + err.Error()
|
|
|
- return
|
|
|
- }
|
|
|
- searchClassifyIdList = append(searchClassifyIdList, classifyId)
|
|
|
- for _, v := range allChildClassifyItemList {
|
|
|
- searchClassifyIdList = append(searchClassifyIdList, v.ClassifyId)
|
|
|
- }
|
|
|
- case 2:
|
|
|
- obj := data_manage.EdbPublicClassify{}
|
|
|
- allChildClassifyItemList, err, _ := obj.GetAllChildClassifyByParentId(classifyId)
|
|
|
- if err != nil {
|
|
|
- br.Msg = "获取失败"
|
|
|
- br.ErrMsg = "获取指标分类信息失败,Err:" + err.Error()
|
|
|
- return
|
|
|
- }
|
|
|
- searchPublicClassifyIdList = append(searchPublicClassifyIdList, classifyId)
|
|
|
- for _, v := range allChildClassifyItemList {
|
|
|
- searchPublicClassifyIdList = append(searchPublicClassifyIdList, v.EdbPublicClassifyId)
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
- }
|
|
|
|
|
|
var edbInfoList []*data_manage.EdbInfoList
|
|
|
var err error
|
|
|
|
|
|
-
|
|
|
- noPermissionEdbInfoIdList, noPermissionEdbClassifyIdList, err := data_manage_permission.GetUserAllEdbAndClassifyNoPermissionListV2(this.SysUser.AdminId)
|
|
|
+
|
|
|
+ source, frequency, noPermissionEdbInfoIdList, noPermissionEdbClassifyIdList, collectEdbInfoIdList, searchClassifyIdList, searchPublicClassifyIdList, edbTypeList, edbInfoType, edbAuth, searchUserId, err, errMsg := data.GetGeneralEdbEsSearchParams(edbTypeStr, this.SysUser.AdminId, edbAuth, edbCollect, classifyId)
|
|
|
if err != nil {
|
|
|
br.Msg = "获取失败"
|
|
|
- br.ErrMsg = "获取不可见指标配置数据失败,Err:" + err.Error()
|
|
|
- return
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- collectEdbInfoIdList := make([]int, 0)
|
|
|
- if edbCollect == 1 {
|
|
|
- collectEdbInfoIdList, err = data_manage.GetUserAllCollectEdbInfoIdList(this.SysUser.AdminId)
|
|
|
- if err != nil {
|
|
|
- br.Msg = "获取失败"
|
|
|
- br.ErrMsg = "获取收藏指标配置数据失败,Err:" + err.Error()
|
|
|
- return
|
|
|
+ if errMsg != `` {
|
|
|
+ br.Msg = errMsg
|
|
|
}
|
|
|
+ br.ErrMsg = "获取失败:" + err.Error()
|
|
|
+ return
|
|
|
}
|
|
|
|
|
|
sortMap := make(map[string]string)
|