Roc 11 місяців тому
батько
коміт
1347f0a635

+ 1 - 1
controllers/data_manage/edb_info_calculate.go

@@ -2353,7 +2353,7 @@ func (this *ChartInfoController) CalculateMultiSearch() {
 	page := paging.GetPaging(currentIndex, pageSize, total)
 	resp := new(data_manage.CalculateMultiEdbSearchResp)
 
-	edbList, e := data_manage.GetEdbInfoListByCondition(condition, pars, startSize, pageSize)
+	edbList, e := data_manage.GetEdbInfoListByCondition(condition, pars, startSize, pageSize, "")
 	if e != nil {
 		br.Msg = "获取指标列表失败"
 		br.ErrMsg = "获取指标列表失败,Err:" + e.Error()

+ 2 - 0
controllers/data_manage/excel/custom_analysis.go

@@ -91,6 +91,7 @@ func (c *CustomAnalysisController) ExcelByName() {
 		ModifyTime:      excelDetail.ModifyTime,
 		CreateTime:      excelDetail.CreateTime,
 		Button:          excel.GetExcelInfoOpButton(sysUser, excelDetail.SysUserId, excelDetail.Source, haveOperaAuth),
+		HaveOperaAuth:   true,
 	}
 
 	if excelDetail != nil {
@@ -435,6 +436,7 @@ func (c *CustomAnalysisController) BaseExcelDetail() {
 		ModifyTime:      excelDetail.ModifyTime,
 		CreateTime:      excelDetail.CreateTime,
 		Button:          excel.GetExcelInfoOpButton(sysUser, excelDetail.SysUserId, excelDetail.Source, haveOperaAuth),
+		HaveOperaAuth:   true,
 	}
 	if markStatus.Status == 0 {
 		resp.ExcelInfo.CanEdit = true

+ 1 - 1
controllers/data_stat/edb_source_stat.go

@@ -592,7 +592,7 @@ func (this *EdbSourceStatController) EdbUpdateStat() {
 		baseCond := " and index_code in (" + utils.GetOrmInReplace(len(edbCodeList)) + ")"
 		var basePars []interface{}
 		basePars = append(basePars, edbCodeList)
-		indexList, tErr := data_manage.GetMysteelChemicalIndexList(baseCond, basePars, 0, 1000)
+		indexList, tErr := data_manage.GetMysteelChemicalIndexList(baseCond, basePars, 0, 1000, "")
 		if tErr != nil {
 			br.Msg = "获取初始指标信息失败"
 			br.ErrMsg = "获取初始指标信息失败,Err:" + tErr.Error()

+ 10 - 2
models/data_manage/edb_info.go

@@ -1527,13 +1527,21 @@ func GetEdbInfoByConditionCount(condition string, pars []interface{}) (count int
 }
 
 // GetEdbInfoListByCondition 根据条件获取指标列表数据
-func GetEdbInfoListByCondition(condition string, pars []interface{}, startSize, pageSize int) (items []*EdbInfoList, err error) {
+func GetEdbInfoListByCondition(condition string, pars []interface{}, startSize, pageSize int, orderDesc string) (items []*EdbInfoList, err error) {
 	o := orm.NewOrmUsingDB("data")
 	sql := ` SELECT * FROM edb_info WHERE 1=1 `
 	if condition != "" {
 		sql += condition
 	}
-	sql += ` ORDER BY edb_info_id ASC LIMIT ?,? `
+
+	if orderDesc == `` {
+		orderDesc = ` ASC `
+	}
+
+	sql += ` ORDER BY edb_info_id `
+	sql += orderDesc
+	sql += ` LIMIT ?,? `
+
 	_, err = o.Raw(sql, pars, startSize, pageSize).QueryRows(&items)
 	return
 }

+ 1 - 0
models/data_manage/excel/response/sheet.go

@@ -30,4 +30,5 @@ type FindExcelInfo struct {
 	Button          ExcelInfoDetailButton `description:"操作权限"`
 	CanEdit         bool                  `description:"是否可编辑"`
 	Editor          string                `description:"编辑人"`
+	HaveOperaAuth   bool                  `description:"是否有数据权限,默认:false"`
 }

+ 10 - 3
models/data_manage/mysteel_chemical_index.go

@@ -281,15 +281,22 @@ func GetMysteelChemicalIndexCount(condition string, pars []interface{}) (count i
 }
 
 // GetMysteelChemicalIndexList 根据分类id获取钢联化工频度数据列表
-func GetMysteelChemicalIndexList(condition string, pars []interface{}, startSize, pageSize int) (items []*BaseFromMysteelChemicalIndex, err error) {
+func GetMysteelChemicalIndexList(condition string, pars []interface{}, startSize, pageSize int, orderDesc string) (items []*BaseFromMysteelChemicalIndex, err error) {
 	o := orm.NewOrmUsingDB("data")
 	sql := ` SELECT * FROM base_from_mysteel_chemical_index WHERE 1=1 `
 
 	if condition != "" {
 		sql += condition
 	}
-	sql += ` ORDER BY base_from_mysteel_chemical_index_id ASC LIMIT ?,? `
+
+	if orderDesc == `` {
+		orderDesc = ` ASC `
+	}
+	sql += ` ORDER BY base_from_mysteel_chemical_index_id `
+	sql += orderDesc
+	sql += ` LIMIT ?,? `
 	_, err = o.Raw(sql, pars, startSize, pageSize).QueryRows(&items)
+
 	return
 }
 
@@ -302,7 +309,7 @@ func GetMysteelChemicalIndexListGroupByUserId(edbIdList []string) (items []*Base
 	o := orm.NewOrmUsingDB("data")
 	sql := ` SELECT * FROM base_from_mysteel_chemical_index WHERE base_from_mysteel_chemical_index_id in (` + utils.GetOrmInReplace(num) + `) GROUP BY sys_user_id `
 	_, err = o.Raw(sql, edbIdList).QueryRows(&items)
-	
+
 	return
 }
 

+ 2 - 2
services/data/data_manage_permission/data_move.go

@@ -281,7 +281,7 @@ func GetMoveEdbChartList(source, subSource, userId int, keyword, classify string
 		if err != nil {
 			return
 		}
-		tmpList, tmpErr := data_manage.GetMysteelChemicalIndexList(condition, pars, startSize, pageSize)
+		tmpList, tmpErr := data_manage.GetMysteelChemicalIndexList(condition, pars, startSize, pageSize, "DESC")
 		if tmpErr != nil {
 			err = tmpErr
 			return
@@ -321,7 +321,7 @@ func GetMoveEdbChartList(source, subSource, userId int, keyword, classify string
 		if err != nil {
 			return
 		}
-		tmpList, tmpErr := data_manage.GetEdbInfoListByCondition(condition, pars, startSize, pageSize)
+		tmpList, tmpErr := data_manage.GetEdbInfoListByCondition(condition, pars, startSize, pageSize, "DESC")
 		if tmpErr != nil {
 			err = tmpErr
 			return