Browse Source

修复支付订单bug

kobe6258 5 months ago
parent
commit
6b83fc8ae7
2 changed files with 12 additions and 11 deletions
  1. 1 1
      controllers/user/analyst_controller.go
  2. 11 10
      service/report/report_service.go

+ 1 - 1
controllers/user/analyst_controller.go

@@ -98,7 +98,7 @@ func (an *AnalystController) AnalystReportList(analystName string) {
 			pageRes.Total = an.PageInfo.Total
 		}
 		pageRes.TotalPage = page.TotalPages(pageRes.Total, pageRes.PageSize)
-		list, err := report.GetReportPageByAnalyst(an.PageInfo, analystName, reportIds)
+		list, err := report.GetReportPageByAnalyst(an.PageInfo, analystName, reportIds, userInfo.Id)
 		if err != nil {
 			an.FailedResult("分页获取研究员报告列表失败", result)
 			return

+ 11 - 10
service/report/report_service.go

@@ -397,18 +397,19 @@ func GetReportPage(pageInfo page.PageInfo, orgIds map[string][]int, searchAll bo
 	}
 	return
 }
-func GetReportPageByAnalyst(pageInfo page.PageInfo, analyst string, reportIds []int) (list []reportService.ReportDTO, err error) {
+func GetReportPageByAnalyst(pageInfo page.PageInfo, analyst string, reportIds []int, templateUserId int) (list []reportService.ReportDTO, err error) {
 	list, err = reportService.GetReportPageByAnalyst(pageInfo, analyst, reportIds)
+	list, err = dealReportInfo(list, true, templateUserId)
 	//并发获取研报的标签
-	var wg sync.WaitGroup
-	wg.Add(len(list))
-	for i := 0; i < len(list); i++ {
-		go func(report *reportService.ReportDTO) {
-			defer wg.Done()
-			report.Permissions, report.PermissionNames = GetReportPermissionNames(report.OrgId, report.Source)
-		}(&list[i])
-	}
-	wg.Wait()
+	//var wg sync.WaitGroup
+	//wg.Add(len(list))
+	//for i := 0; i < len(list); i++ {
+	//	go func(report *reportService.ReportDTO) {
+	//		defer wg.Done()
+	//		report.Permissions, report.PermissionNames = GetReportPermissionNames(report.OrgId, report.Source)
+	//	}(&list[i])
+	//}
+	//wg.Wait()
 	if err != nil {
 		err = exception.New(exception.QueryReportPageFailed)
 	}