浏览代码

返回图表权限

xyxie 10 月之前
父节点
当前提交
df3b863df5
共有 1 个文件被更改,包括 13 次插入1 次删除
  1. 13 1
      services/data/chart_info_excel_balance.go

+ 13 - 1
services/data/chart_info_excel_balance.go

@@ -512,6 +512,18 @@ func editBalanceExcelChart(req request.AddBalanceTableChartReq) (chartInfo *data
 
 
 func GetBalanceExcelChartDetail(chartInfo *data_manage.ChartInfoView, mappingListTmp []*excelModel.ExcelChartEdb, sysUser *system.Admin, dataListMap map[int][]*data_manage.EdbDataList) (resp *data_manage.ChartInfoDetailResp, err error, errMsg string) {
 func GetBalanceExcelChartDetail(chartInfo *data_manage.ChartInfoView, mappingListTmp []*excelModel.ExcelChartEdb, sysUser *system.Admin, dataListMap map[int][]*data_manage.EdbDataList) (resp *data_manage.ChartInfoDetailResp, err error, errMsg string) {
 	// todo 图表权限处理
 	// todo 图表权限处理
+	// 图表数据权限
+	{
+		// 已授权分类id
+		permissionChartIdList, permissionClassifyIdList, e := data_manage_permission.GetUserChartAndClassifyPermissionList(sysUser.AdminId, chartInfo.ChartInfoId, chartInfo.ChartClassifyId)
+		if e != nil {
+			errMsg = "获取失败"
+			err = fmt.Errorf("获取已授权分类id数据失败,Err:" + err.Error())
+			return
+		}
+		chartInfo.HaveOperaAuth = data_manage_permission.CheckChartPermissionByPermissionIdList(chartInfo.IsJoinPermission, 0, chartInfo.ChartInfoId, chartInfo.ChartClassifyId, permissionChartIdList, permissionClassifyIdList)
+	}
+
 	chartInfoId := chartInfo.ChartInfoId
 	chartInfoId := chartInfo.ChartInfoId
 	resp = new(data_manage.ChartInfoDetailResp)
 	resp = new(data_manage.ChartInfoDetailResp)
 
 
@@ -659,7 +671,7 @@ func GetBalanceExcelChartDetail(chartInfo *data_manage.ChartInfoView, mappingLis
 	excelChartInfoDataShow := new(ExcelChartInfoDataShow)
 	excelChartInfoDataShow := new(ExcelChartInfoDataShow)
 	excelChartInfoDataShow.DataListMap = dataListMap
 	excelChartInfoDataShow.DataListMap = dataListMap
 
 
-	if chartInfo.HaveOperaAuth || true {
+	if chartInfo.HaveOperaAuth {
 		// 获取图表中的指标数据
 		// 获取图表中的指标数据
 		edbList, xEdbIdValue, yDataList, dataResp, e, msg := GetChartEdbDataV2(chartInfoId, chartType, calendar, startDate, endDate, mappingList, extraConfigStr, chartInfo.SeasonExtraConfig, excelChartInfoDataShow)
 		edbList, xEdbIdValue, yDataList, dataResp, e, msg := GetChartEdbDataV2(chartInfoId, chartType, calendar, startDate, endDate, mappingList, extraConfigStr, chartInfo.SeasonExtraConfig, excelChartInfoDataShow)
 		if e != nil {
 		if e != nil {