Browse Source

Merge branch 'ETA_2.2.2' into debug

zwxi 5 months ago
parent
commit
7e30115cf0

+ 30 - 34
controllers/bi_dashboard.go

@@ -241,7 +241,8 @@ func (this *BIDaShboardController) DeleteDashboard() {
 		return
 	}
 
-	err = bi_dashboard.DelDashboard(req.BiDashboardId)
+	//如果该看板存在共享记录,则删除共享
+	err = bi_dashboard.DeleteDashboardGrant(req.BiDashboardId)
 	if err != nil {
 		br.Msg = "删除失败"
 		br.ErrMsg = "删除失败,Err:" + err.Error()
@@ -611,39 +612,34 @@ func (this *BIDaShboardController) PublicList() {
 		systemAdminMap[v.AdminId] = v
 	}
 
-	//tmpItem := &bi_dashboard.RespPublicGroupListItem{
-	//	GroupId:   int64(c.BiDashboardClassifyId),
-	//	GroupName: c.BiDashboardClassifyName,
-	//	Children:  make([]*bi_dashboard.RespPublicGroupListItem, 0),
-	//}
-	//for _, v := range adminIdList {
-	//	systemAdmin, ok := systemAdminMap[v]
-	//	if !ok {
-	//		continue
-	//	}
-	//
-	//	// 看板 列表信息
-	//	respGroupNameListItemList, ok := publicDashboardListMap[v]
-	//	if !ok {
-	//		respGroupNameListItemList = make([]*bi_dashboard.BiDashboard, 0)
-	//	}
-	//
-	//	// ppt 分组信息
-	//	tmpRespGroupListItem := &bi_dashboard.RespPublicGroupListItem{
-	//		GroupId:       int64(systemAdmin.AdminId),
-	//		GroupName:     systemAdmin.RealName,
-	//		AdminId:       systemAdmin.AdminId,
-	//		DashboardList: make([]*bi_dashboard.BiDashboard, 0),
-	//	}
-	//
-	//	for _, vv := range respGroupNameListItemList {
-	//		if vv.BiDashboardClassifyId == c.BiDashboardClassifyId {
-	//			tmpRespGroupListItem.DashboardList = append(tmpRespGroupListItem.DashboardList, vv)
-	//			tmpItem.Children = append(tmpItem.Children, tmpRespGroupListItem)
-	//		}
-	//	}
-	//}
-	//resp = append(resp, tmpItem)
+	for _, v := range adminIdList {
+		systemAdmin, ok := systemAdminMap[v]
+		if !ok {
+			continue
+		}
+
+		// 看板 列表信息
+		respGroupNameListItemList, ok := publicDashboardListMap[v]
+		if !ok {
+			respGroupNameListItemList = make([]*bi_dashboard.BiDashboard, 0)
+		}
+
+		// ppt 分组信息
+		tmpRespGroupListItem := &bi_dashboard.RespPublicGroupListItem{
+			GroupId:       int64(systemAdmin.AdminId),
+			GroupName:     systemAdmin.RealName,
+			AdminId:       systemAdmin.AdminId,
+			DashboardList: make([]*bi_dashboard.BiDashboard, 0),
+		}
+
+		for _, vv := range respGroupNameListItemList {
+			if vv.BiDashboardClassifyId == c.BiDashboardClassifyId {
+				tmpRespGroupListItem.DashboardList = append(tmpRespGroupListItem.DashboardList, vv)
+				tmpItem.Children = append(tmpItem.Children, tmpRespGroupListItem)
+			}
+		}
+	}
+	resp = append(resp, tmpItem)
 
 	br.Ret = 200
 	br.Success = true

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

@@ -1677,6 +1677,8 @@ func (c *ExcelInfoController) GetExcelTableData() {
 		SourcesFrom:   excelInfo.SourcesFrom,
 		ExcelSource:   excelSource,
 		ExcelSourceEn: excelSourceEn,
+		ExcelInfoId:   excelInfo.ExcelInfoId,
+		Source:        excelInfo.Source,
 	}
 	br.Ret = 200
 	br.Success = true

+ 2 - 1
models/bi_dashboard/bi_dashboard.go

@@ -73,7 +73,8 @@ func GetDashboardById(id int) (item *BiDashboard, err error) {
 // del
 func DelDashboard(id int) (err error) {
 	o := orm.NewOrm()
-	_, err = o.Delete(&BiDashboard{BiDashboardId: id})
+	sql := `DELETE FROM bi_dashboard WHERE bi_dashboard_id = ?`
+	_, err = o.Raw(sql, id).Exec()
 	return
 }
 

+ 2 - 0
models/data_manage/excel/response/excel_info.go

@@ -31,6 +31,8 @@ type ExcelTableDetailResp struct {
 	SourcesFrom   string `description:"图表来源"`
 	ExcelSource   string `description:"表格来源str"`
 	ExcelSourceEn string `description:"表格来源(英文)"`
+	ExcelInfoId   int    `description:"表id"`
+	Source        int    `description:"表格来源"`
 }
 
 // ExcelTableDetailConfigResp