|
@@ -891,30 +891,33 @@ func GetTotalPageCountByPermissionIds(permissionIds []int) (total int64, latestI
|
|
|
disCardReportIds = append(disCardReportIds, product.SourceID)
|
|
|
}
|
|
|
}
|
|
|
- wg.Add(2)
|
|
|
- var permissionNames []string
|
|
|
- var classifyIds []int
|
|
|
- go func() {
|
|
|
- defer wg.Done()
|
|
|
- var permissionErr error
|
|
|
- permissionNames, permissionErr = GetPermissionNamesByPermissionIds(ProductPermissionIds)
|
|
|
- if permissionErr != nil {
|
|
|
- logger.Error("获取ETA品种名称失败:%v", err)
|
|
|
- }
|
|
|
- }()
|
|
|
- go func() {
|
|
|
- defer wg.Done()
|
|
|
- var classifyErr error
|
|
|
- classifyIds, classifyErr = permissionDao.GetClassifyIdsByPermissionIds(ProductPermissionIds)
|
|
|
- if classifyErr != nil {
|
|
|
- logger.Error("获取ETA报告分类id失败:%v", err)
|
|
|
+ if len(ProductPermissionIds) > 0 {
|
|
|
+ wg.Add(2)
|
|
|
+ var permissionNames []string
|
|
|
+ var classifyIds []int
|
|
|
+ go func() {
|
|
|
+ defer wg.Done()
|
|
|
+ var permissionErr error
|
|
|
+ permissionNames, permissionErr = GetPermissionNamesByPermissionIds(ProductPermissionIds)
|
|
|
+ if permissionErr != nil {
|
|
|
+ logger.Error("获取ETA品种名称失败:%v", err)
|
|
|
+ }
|
|
|
+ }()
|
|
|
+ go func() {
|
|
|
+ defer wg.Done()
|
|
|
+ var classifyErr error
|
|
|
+ classifyIds, classifyErr = permissionDao.GetClassifyIdsByPermissionIds(ProductPermissionIds)
|
|
|
+ if classifyErr != nil {
|
|
|
+ logger.Error("获取ETA报告分类id失败:%v", err)
|
|
|
+ }
|
|
|
+ }()
|
|
|
+ wg.Wait()
|
|
|
+ disCardIds, _ := reportDao.GetHiddenReportIds(classifyIds, permissionNames)
|
|
|
+ if len(disCardIds) > 0 {
|
|
|
+ disCardReportIds = append(disCardReportIds, disCardIds...)
|
|
|
}
|
|
|
- }()
|
|
|
- wg.Wait()
|
|
|
- disCardIds, _ := reportDao.GetHiddenReportIds(classifyIds, permissionNames)
|
|
|
- if len(disCardIds) > 0 {
|
|
|
- disCardReportIds = append(disCardReportIds, disCardIds...)
|
|
|
}
|
|
|
+
|
|
|
//对数据去重
|
|
|
disCardReportIds = uniqueArray(disCardReportIds)
|
|
|
//获取报告中还包含上架套餐的id
|