Selaa lähdekoodia

累计值调整和指标库只看我的

xyxie 1 vuosi sitten
vanhempi
commit
fbadff2edf

+ 7 - 2
controllers/data_manage/edb_classify.go

@@ -873,7 +873,12 @@ func (this *EdbClassifyController) SimpleList() {
 	// 如果是 子级分类,查询该子级分类的下一级分类和指标信息
 	// 增加标识判断是文件夹还是指标列表
 	parentId, _ := this.GetInt("ParentId")
-
+	isOnlyMe, _ := this.GetBool("IsOnlyMe")
+	// 如果选择了只看我的,那么只查询归属于我的账号
+	sysUserId := 0
+	if isOnlyMe {
+		sysUserId = this.SysUser.AdminId
+	}
 	rootList, err := data_manage.GetEdbClassifyByParentId(parentId, 0)
 	if err != nil && err.Error() != utils.ErrNoRow() {
 		br.Msg = "获取失败"
@@ -897,7 +902,7 @@ func (this *EdbClassifyController) SimpleList() {
 		for _, v := range confList {
 			noPermissionEdbInfoIdMap[v.EdbInfoId] = true
 		}
-		allEdbInfo, err := data_manage.GetEdbInfoByClassifyId(parentId, 0, 0)
+		allEdbInfo, err := data_manage.GetEdbInfoByClassifyId(parentId, 0, sysUserId)
 		if err != nil {
 			br.Msg = "获取指标数据失败"
 			br.ErrMsg = "获取指标数据失败,Err:" + err.Error()

+ 4 - 0
controllers/data_manage/edb_info_calculate.go

@@ -163,6 +163,7 @@ func (this *ChartInfoController) CalculateSave() {
 		EdbInfoIdArr:     req.EdbInfoIdArr,
 		EmptyType:        req.EmptyType,
 		MaxEmptyType:     req.MaxEmptyType,
+		Extra:            req.Extra,
 	}
 	reqJson, err := json.Marshal(req2)
 	if err != nil {
@@ -434,6 +435,7 @@ func (this *ChartInfoController) CalculateEdit() {
 		EdbInfoIdArr:     req.EdbInfoIdArr,
 		EmptyType:        req.EmptyType,
 		MaxEmptyType:     req.MaxEmptyType,
+		Extra:            req.Extra,
 	}
 	reqJson, err := json.Marshal(req2)
 	if err != nil {
@@ -626,6 +628,7 @@ func (this *ChartInfoController) CalculateBatchSave() {
 		//CalculateFormula: edbInfo.CalculateFormula,
 		EdbInfoIdArr: req.EdbInfoIdArr,
 		Calendar:     req.Calendar,
+		Extra:        req.Extra,
 	}
 
 	// 调用指标库去更新
@@ -832,6 +835,7 @@ func (this *ChartInfoController) CalculateBatchEdit() {
 		MoveFrequency: req.MoveFrequency,
 		EdbInfoIdArr:  req.EdbInfoIdArr,
 		Calendar:      req.Calendar,
+		Extra:         req.Extra,
 	}
 
 	// 调用指标库去更新

+ 6 - 0
models/data_manage/edb_info_calculate.go

@@ -20,6 +20,7 @@ type EdbInfoCalculateSaveReq struct {
 	Calendar         string           `description:"公历/农历"`
 	EmptyType        int              `description:"空值处理类型(0查找前后35天,1不计算,2前值填充,3后值填充,4等于0)"`
 	MaxEmptyType     int              `description:"MAX、MIN公式空值处理类型(1、等于0;2、跳过空值)"`
+	Extra            string           `description:"指标的额外配置"`
 	EdbInfoIdArr     []EdbInfoFromTag `description:"指标信息"`
 }
 
@@ -111,6 +112,7 @@ type EdbInfoCalculateEditReq struct {
 	CalculateFormula string           `description:"计算公式"`
 	EmptyType        int              `description:"空值处理类型(0查找前后35天,1不计算,2前值填充,3后值填充,4等于0)"`
 	MaxEmptyType     int              `description:"MAX、MIN公式空值处理类型(1、等于0;2、跳过空值)"`
+	Extra            string           `description:"指标的额外配置"`
 	EdbInfoIdArr     []EdbInfoFromTag `description:"指标信息"`
 }
 
@@ -168,6 +170,7 @@ type EdbInfoCalculateBatchSaveReq struct {
 	EdbInfoIdArr     []EdbInfoFromTag `description:"指标信息"`
 	MoveType         int              `description:"移动方式:1:领先(默认),2:滞后"`
 	MoveFrequency    string           `description:"移动频度:天/周/月/季/年"`
+	Extra            string           `description:"指标的额外配置"`
 	Calendar         string           `description:"公历/农历"`
 }
 
@@ -183,6 +186,7 @@ type EdbInfoCalculateBatchEditReq struct {
 	MoveType      int    `description:"移动方式:1:领先(默认),2:滞后"`
 	MoveFrequency string `description:"移动频度:天/周/月/季/年"`
 	Calendar      string `description:"公历/农历"`
+	Extra         string `description:"指标的额外配置"`
 	EdbInfoIdArr  []EdbInfoFromTag
 }
 
@@ -206,6 +210,7 @@ type EdbInfoCalculateBatchSaveReqByEdbLib struct {
 	Data             interface{}      `description:"数据列"`
 	EmptyType        int              `description:"空值处理类型(0查找前后35天,1不计算,2前值填充,3后值填充,4等于0)"`
 	MaxEmptyType     int              `description:"MAX、MIN公式空值处理类型(1、等于0;2、跳过空值)"`
+	Extra            string           `description:"指标的额外配置"`
 }
 
 // EdbInfoCalculateBatchEditReqByEdbLib 编辑计算指标的请求参数
@@ -223,6 +228,7 @@ type EdbInfoCalculateBatchEditReqByEdbLib struct {
 	Calendar      string `description:"公历/农历"`
 	EdbInfoIdArr  []EdbInfoFromTag
 	Data          interface{} `description:"数据列"`
+	Extra         string      `description:"指标的额外配置"`
 }
 
 func GetEdbInfoCalculateMap(edbInfoId, source int) (list []*EdbInfo, err error) {