|
@@ -1745,6 +1745,7 @@ func (this *EdbInfoController) EdbInfoFilter() {
|
|
|
// @Param EdbType query int false "指标类型:0-基础和计算;1-基础指标;2-计算指标;3-衍生指标"
|
|
|
// @Param EdbAuth query int false "指标权限:0-全部;1-我的;2-公共"
|
|
|
// @Param EdbCollect query int false "指标收藏状态:0-全部;1-已收藏"
|
|
|
+// @Param ClassifyId query int false "父级分类id"
|
|
|
// @Success 200 {object} data_manage.EdbInfoList
|
|
|
// @router /edb_info/filter_by_es [get]
|
|
|
func (this *EdbInfoController) EdbInfoFilterByEs() {
|
|
@@ -1779,8 +1780,6 @@ func (this *EdbInfoController) EdbInfoFilterByEs() {
|
|
|
|
|
|
frequency := this.GetString("Frequency") //频度
|
|
|
|
|
|
- //isAddPredictEdb, _ := this.GetBool("IsAddPredictEdb") //是否查询添加预测指标
|
|
|
-
|
|
|
// 指标类型数组:1-基础指标;2-计算指标;3-预测指标
|
|
|
edbTypeList := make([]int, 0)
|
|
|
edbInfoType := -1 // 指标范围
|
|
@@ -1792,7 +1791,7 @@ func (this *EdbInfoController) EdbInfoFilterByEs() {
|
|
|
if edbTypeStr == `` || edbTypeStr == `0` {
|
|
|
edbTypeList = []int{1, 2}
|
|
|
edbInfoType = 0
|
|
|
- } else if edbTypeStr == `1` { // 数据加工(基础指标),不应该固定创建人的
|
|
|
+ } else if edbTypeStr == `1` { // 数据查看(基础指标),不应该固定创建人的
|
|
|
edbTypeList = []int{1}
|
|
|
edbInfoType = 0
|
|
|
searchUserId = 0
|
|
@@ -1832,6 +1831,23 @@ func (this *EdbInfoController) EdbInfoFilterByEs() {
|
|
|
|
|
|
edbCollect, _ := this.GetInt("EdbCollect", 0) // 指标收藏状态:0-全部;1-已收藏
|
|
|
|
|
|
+ // 筛选分类id列表
|
|
|
+ searchClassifyIdList := make([]int, 0)
|
|
|
+ // 父级分类id
|
|
|
+ classifyId, _ := this.GetInt("ClassifyId")
|
|
|
+ if classifyId > 0 {
|
|
|
+ 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)
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
var edbInfoList []*data_manage.EdbInfoList
|
|
|
var err error
|
|
|
|
|
@@ -1867,7 +1883,7 @@ func (this *EdbInfoController) EdbInfoFilterByEs() {
|
|
|
}
|
|
|
|
|
|
// 普通的搜索
|
|
|
- total, edbInfoList, err = elastic.SearchEdbInfoData(keyWord, startSize, pageSize, filterSource, source, frequency, noPermissionEdbInfoIdList, noPermissionEdbClassifyIdList, collectEdbInfoIdList, edbTypeList, edbInfoType, edbAuth, searchUserId, sortMap)
|
|
|
+ total, edbInfoList, err = elastic.SearchEdbInfoData(keyWord, startSize, pageSize, filterSource, source, frequency, noPermissionEdbInfoIdList, noPermissionEdbClassifyIdList, collectEdbInfoIdList, searchClassifyIdList, edbTypeList, edbInfoType, edbAuth, searchUserId, sortMap)
|
|
|
|
|
|
if err != nil {
|
|
|
edbInfoList = make([]*data_manage.EdbInfoList, 0)
|
|
@@ -3256,7 +3272,7 @@ func (this *EdbInfoController) AllEdbInfoByEs() {
|
|
|
keyWordArr = append(keyWordArr, newKeyWord...)
|
|
|
|
|
|
// 普通的搜索
|
|
|
- total, edbInfoList, err = elastic.SearchEdbInfoData(keyWord, startSize, pageSize, filterSource, source, frequency, noPermissionEdbInfoIdList, noPermissionEdbClassifyIdList, []int{}, []int{1, 2}, -1, 0, this.SysUser.AdminId, map[string]string{})
|
|
|
+ total, edbInfoList, err = elastic.SearchEdbInfoData(keyWord, startSize, pageSize, filterSource, source, frequency, noPermissionEdbInfoIdList, noPermissionEdbClassifyIdList, []int{}, []int{}, []int{1, 2}, -1, 0, this.SysUser.AdminId, map[string]string{})
|
|
|
isEs = true
|
|
|
} else {
|
|
|
var condition string
|
|
@@ -3694,7 +3710,8 @@ func (this *EdbInfoController) EdbChartAdminList() {
|
|
|
// EdbSourceList
|
|
|
// @Title 指标来源列表
|
|
|
// @Description 指标来源列表
|
|
|
-// @Param IsBase query int false "是否为基础指标: 1-是"
|
|
|
+// @Param IsBase query int false "是否为基础指标: 1-基础指标,2:计算指标"
|
|
|
+// @Param EdbInfoType query int false "指标类型,0:指标库;1:预测指标,默认:0"
|
|
|
// @Success 200 {object} data_manage.EdbInfoListResp
|
|
|
// @router /edb_source/list [get]
|
|
|
func (this *EdbInfoController) EdbSourceList() {
|
|
@@ -3707,12 +3724,22 @@ func (this *EdbInfoController) EdbSourceList() {
|
|
|
this.ServeJSON()
|
|
|
}()
|
|
|
isBase, _ := this.GetInt("IsBase", 0)
|
|
|
+ edbInfoType, _ := this.GetInt("EdbInfoType", 0)
|
|
|
|
|
|
- cond := ``
|
|
|
- if isBase > 0 {
|
|
|
- cond = ` AND is_base = 1`
|
|
|
- }
|
|
|
pars := make([]interface{}, 0)
|
|
|
+ cond := ` AND edb_info_type = ? `
|
|
|
+ pars = append(pars, edbInfoType)
|
|
|
+
|
|
|
+ // 计算类型
|
|
|
+ switch isBase {
|
|
|
+ case 1:
|
|
|
+ cond += ` AND is_base = ? `
|
|
|
+ pars = append(pars, 1)
|
|
|
+ case 2:
|
|
|
+ cond += ` AND is_base = ? `
|
|
|
+ pars = append(pars, 2)
|
|
|
+ }
|
|
|
+
|
|
|
list, e := data_manage.GetEdbSourceItemsByCondition(cond, pars, []string{}, "")
|
|
|
if e != nil {
|
|
|
br.Msg = "获取失败"
|