|
@@ -168,7 +168,7 @@ func getChildVariety(permissionList []*models.ChartPermission, permissionId int)
|
|
|
|
|
|
}
|
|
|
|
|
|
-func DocumentReportList(documentType int, chartPermissionIdList []string, classifyIdList []string, keyword string, orderField, orderType string, startSize, pageSize int) (*document_manage_model.OutsideReportPage, error) {
|
|
|
+func DocumentReportList(userId, documentType int, chartPermissionIdList []string, classifyIdList []string, keyword string, orderField, orderType string, startSize, pageSize int) (*document_manage_model.OutsideReportPage, error) {
|
|
|
logs.Info("DocumentVarietyList")
|
|
|
|
|
|
var condition string
|
|
@@ -217,6 +217,23 @@ func DocumentReportList(documentType int, chartPermissionIdList []string, classi
|
|
|
return nil, err
|
|
|
}
|
|
|
|
|
|
+ // 查询用户已收藏的分类
|
|
|
+ collectClassifyList, err := models.GetUserCollectClassifyList(userId, 0)
|
|
|
+ if err != nil {
|
|
|
+ return nil, err
|
|
|
+ }
|
|
|
+ // 转换成map
|
|
|
+ collectClassifyMap := make(map[int]bool)
|
|
|
+ for _, collectClassify := range collectClassifyList {
|
|
|
+ collectClassifyMap[collectClassify.ClassifyId] = true
|
|
|
+ }
|
|
|
+
|
|
|
+ for i, _ := range outsideReportList {
|
|
|
+ if _, ok := collectClassifyMap[outsideReportList[i].ClassifyId]; ok {
|
|
|
+ outsideReportList[i].IsCollect = 1
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
reportPage.Paging = page
|
|
|
reportPage.List = outsideReportList
|
|
|
|
|
@@ -418,7 +435,7 @@ func DocumentDelete(outsideReportId int) error {
|
|
|
return nil
|
|
|
}
|
|
|
|
|
|
-func RuiSiReportListV2(classifyIdList, chartPermissionIdList []string, keyword, orderField, orderType string, startSize, pageSize int) (*models.ReportListResp, error) {
|
|
|
+func RuiSiReportListV2(classifyIdList, chartPermissionIdList []string, keyword, orderField, orderType string, userId, startSize, pageSize int) (*models.ReportListResp, error) {
|
|
|
logs.Info("RuiSiReportList")
|
|
|
|
|
|
allClassifyList, err := models.GetClassifyListByIdStrList(classifyIdList)
|
|
@@ -460,8 +477,28 @@ func RuiSiReportListV2(classifyIdList, chartPermissionIdList []string, keyword,
|
|
|
return nil, err
|
|
|
}
|
|
|
|
|
|
- for _, report := range reportList {
|
|
|
+ // 查询用户已收藏的分类
|
|
|
+ collectClassifyList, err := models.GetUserCollectClassifyList(userId, 0)
|
|
|
+ if err != nil {
|
|
|
+ return nil, err
|
|
|
+ }
|
|
|
+ // 转换成map
|
|
|
+ collectClassifyMap := make(map[int]bool)
|
|
|
+ for _, collectClassify := range collectClassifyList {
|
|
|
+ collectClassifyMap[collectClassify.ClassifyId] = true
|
|
|
+ }
|
|
|
+
|
|
|
+ for i, report := range reportList {
|
|
|
report.ModifyTime = report.ModifyTime.UTC()
|
|
|
+ if _, ok := collectClassifyMap[reportList[i].ClassifyIdFirst]; ok {
|
|
|
+ reportList[i].IsCollect = 1
|
|
|
+ }
|
|
|
+ if _, ok := collectClassifyMap[reportList[i].ClassifyIdSecond]; ok {
|
|
|
+ reportList[i].IsCollect = 1
|
|
|
+ }
|
|
|
+ if _, ok := collectClassifyMap[reportList[i].ClassifyIdThird]; ok {
|
|
|
+ reportList[i].IsCollect = 1
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
reportPage.Paging = page
|