package services import ( "eta/eta_mini_crm_ht/models" "eta/eta_mini_crm_ht/utils" ) func GetReportIdsByPermissionIds(permissionIds []int) (reportIds []int, err error) { classifyIds, err := models.GetClassifyIdByPermissionIds(permissionIds) if err != nil { utils.FileLog.Error("查询报告分类信息失败", err.Error()) return } var etaReportIds []int if len(classifyIds) > 0 { //eta报告 etaReportIds, err = models.GetReportIdByClassifyId(classifyIds) if err != nil { utils.FileLog.Error("查询eta报告失败", err.Error()) } } //海通 permissionNames, err := models.GetPermissionNames(permissionIds) if err != nil { utils.FileLog.Error("查询品种名称失败", err.Error()) return etaReportIds, nil } htReportIds, err := models.GetReportIdByPlateName(permissionNames) if err != nil { utils.FileLog.Error("查询品种名称失败", err.Error()) return etaReportIds, nil } reportIds = append(etaReportIds, htReportIds...) return }