瀏覽代碼

Merge branch 'debug' of http://8.136.199.33:3000/eta_server/eta_mobile into debug

kobe6258 1 月之前
父節點
當前提交
7f22b1259f

+ 1 - 1
controllers/eta_forum/eta_forum.go

@@ -32,7 +32,7 @@ func (this *EtaForumController) UserChartList() {
 		br.Ret = 408
 		return
 	}
-	keyword := this.GetString("keyword")
+	keyword := this.GetString("Keyword")
 	pageSize, _ := this.GetInt("PageSize")
 	currentIndex, _ := this.GetInt("CurrentIndex")
 	businessCode := utils.BusinessCode

+ 14 - 12
controllers/report_chapter.go

@@ -8,8 +8,6 @@ import (
 	"eta/eta_mobile/services"
 	"eta/eta_mobile/services/data"
 	"eta/eta_mobile/utils"
-	"fmt"
-	"github.com/kgiannakakis/mp3duration/src/mp3duration"
 	"html"
 	"os"
 	"path"
@@ -1162,15 +1160,19 @@ func (this *ReportController) VoiceUpload() {
 		return
 	}
 
-	var playSeconds float64
-	playSeconds, err = mp3duration.Calculate(fPath)
-	if playSeconds <= 0 {
-		playSeconds, err = utils.GetVideoPlaySeconds(fPath)
-		if err != nil {
-			br.Msg = "获取音频时间失败"
-			br.ErrMsg = "获取音频时间失败,Err:" + err.Error()
-			return
-		}
+	//var playSeconds float64
+	//playSeconds, err = mp3duration.Calculate(fPath)
+	//if playSeconds <= 0 {
+	//	playSeconds, err = utils.GetVideoPlaySeconds(fPath)
+	//	if err != nil {
+	//		br.Msg = "获取音频时间失败"
+	//		br.ErrMsg = "获取音频时间失败,Err:" + err.Error()
+	//		return
+	//	}
+	//}
+	playSecondsStr, err := utils.GetDuration(fPath) //mp3duration.Calculate(fPath)
+	if err != nil {
+		utils.FileLog.Info("获取音频时间失败,Err:" + err.Error())
 	}
 
 	fileBody, err := os.ReadFile(fPath)
@@ -1190,7 +1192,7 @@ func (this *ReportController) VoiceUpload() {
 
 		reportChapterInfo.VideoUrl = resourceUrl
 		reportChapterInfo.VideoName = videoName
-		reportChapterInfo.VideoPlaySeconds = fmt.Sprint(playSeconds)
+		reportChapterInfo.VideoPlaySeconds = playSecondsStr
 		reportChapterInfo.VideoSize = sizeStr
 		reportChapterInfo.VideoKind = 1
 		reportChapterInfo.LastModifyAdminId = this.SysUser.AdminId

+ 92 - 14
controllers/report_v2.go

@@ -180,8 +180,12 @@ func (this *ReportController) ListReport() {
 		pvMap := make(map[int]int)
 		uvMap := make(map[int]int)
 		reportIdArr := make([]int, 0)
-		syncReportIdArr := make([]string, 0)      // 同步过来的报告IDs
-		oldAndNewReportIdMap := make(map[int]int) // 旧报告和新报告的id对应关系
+		syncReportIdArr := make([]string, 0)          // 同步过来的报告IDs
+		oldAndNewReportIdMap := make(map[int]int)     // 旧报告和新报告的id对应关系
+		classifyIdList := make([]int, 0)              // 关联的指标分类id
+		classifyIdMap := make(map[int]bool)           // 分类id map
+		classifyMap := make(map[int]*models.Classify) // 分类map
+
 		for i := 0; i < listLen; i++ {
 			reportIdArr = append(reportIdArr, list[i].Id)
 			if list[i].OldReportId > 0 && list[i].ReportLayout == 1 {
@@ -190,6 +194,22 @@ func (this *ReportController) ListReport() {
 			}
 			pvMap[list[i].Id] = list[i].Pv
 			uvMap[list[i].Id] = list[i].Uv
+
+			if list[i].ClassifyIdFirst > 0 {
+				if _, ok := classifyIdMap[list[i].ClassifyIdFirst]; !ok {
+					classifyIdList = append(classifyIdList, list[i].ClassifyIdFirst)
+				}
+			}
+			if list[i].ClassifyIdSecond > 0 {
+				if _, ok := classifyIdMap[list[i].ClassifyIdSecond]; !ok {
+					classifyIdList = append(classifyIdList, list[i].ClassifyIdSecond)
+				}
+			}
+			if list[i].ClassifyIdThird > 0 {
+				if _, ok := classifyIdMap[list[i].ClassifyIdThird]; !ok {
+					classifyIdList = append(classifyIdList, list[i].ClassifyIdThird)
+				}
+			}
 		}
 
 		// 当下报告的pv,uv
@@ -208,6 +228,18 @@ func (this *ReportController) ListReport() {
 			}
 		}
 
+		if len(classifyIdList) > 0 {
+			classifyList, e := models.GetClassifyListByIdList(classifyIdList)
+			if e != nil {
+				br.Msg = "获取失败"
+				br.ErrMsg = "获取报告分类失败, Err: " + e.Error()
+				return
+			}
+			for _, v := range classifyList {
+				classifyMap[v.Id] = v
+			}
+		}
+
 		//reportIds := strings.Join(reportIdArr, ",")
 		//syncReportIds := strings.Join(syncReportIdArr, ",")
 
@@ -254,6 +286,26 @@ func (this *ReportController) ListReport() {
 			list[i].ChapterVideoList = chapterList
 			list[i].Pv = pvMap[list[i].Id]
 			list[i].Uv = uvMap[list[i].Id]
+
+			if list[i].ClassifyIdThird > 0 {
+				if classify, ok := classifyMap[list[i].ClassifyIdThird]; ok {
+					if classify.Enabled == 1 {
+						list[i].ClassifyEnabled = true
+					}
+				}
+			} else if list[i].ClassifyIdSecond > 0 {
+				if classify, ok := classifyMap[list[i].ClassifyIdSecond]; ok {
+					if classify.Enabled == 1 {
+						list[i].ClassifyEnabled = true
+					}
+				}
+			} else if list[i].ClassifyIdFirst > 0 {
+				if classify, ok := classifyMap[list[i].ClassifyIdFirst]; ok {
+					if classify.Enabled == 1 {
+						list[i].ClassifyEnabled = true
+					}
+				}
+			}
 		}
 
 		// 多人协作的协作报告,需要判断是否可编辑
@@ -866,6 +918,7 @@ func (this *ReportController) SaveReportContent() {
 // @Param   ClassifyIdFirst   query   int  true       "一级分类id"
 // @Param   ClassifyIdSecond   query   int  true       "二级分类id"
 // @Param   ClassifyIdThird   query   int  true       "三级分类id"
+// @Param   State   query   string  true       "报告状态,多状态用英文,隔开"
 // @Success 200 {object} models.ReportListResp
 // @router /list/authorized [get]
 func (this *ReportController) AuthorizedListReport() {
@@ -880,6 +933,7 @@ func (this *ReportController) AuthorizedListReport() {
 	classifyIdFirst, _ := this.GetInt("ClassifyIdFirst", 0)
 	classifyIdSecond, _ := this.GetInt("ClassifyIdSecond", 0)
 	classifyIdThird, _ := this.GetInt("ClassifyIdThird", 0)
+	stateStr := this.GetString("State")
 
 	var startSize int
 	if pageSize <= 0 {
@@ -891,18 +945,18 @@ func (this *ReportController) AuthorizedListReport() {
 	startSize = utils.StartIndex(currentIndex, pageSize)
 	var list []*models.ReportList
 
-	// 没有输入信息,那就不展示
-	if keyword == `` && classifyIdFirst <= 0 {
-		page := paging.GetPaging(currentIndex, pageSize, 0)
-		resp := new(models.ReportListResp)
-		resp.Paging = page
-		resp.List = list
-		br.Ret = 200
-		br.Success = true
-		br.Msg = "获取成功"
-		br.Data = resp
-		return
-	}
+	//// 没有输入信息,那就不展示
+	//if keyword == `` && classifyIdFirst <= 0 {
+	//	page := paging.GetPaging(currentIndex, pageSize, 0)
+	//	resp := new(models.ReportListResp)
+	//	resp.Paging = page
+	//	resp.List = list
+	//	br.Ret = 200
+	//	br.Success = true
+	//	br.Msg = "获取成功"
+	//	br.Data = resp
+	//	return
+	//}
 
 	// 当前用户有权限的报告id列表
 	grantReportIdList := make([]int, 0)
@@ -940,6 +994,12 @@ func (this *ReportController) AuthorizedListReport() {
 		pars = utils.GetLikeKeywordPars(pars, keyword, 1)
 	}
 
+	if stateStr != `` {
+		stateStrList := strings.Split(stateStr, ",")
+		condition += ` AND a.state in (` + utils.GetOrmInReplace(len(stateStrList)) + `) `
+		pars = append(pars, stateStrList)
+	}
+
 	var err error
 	var total int
 
@@ -959,6 +1019,24 @@ func (this *ReportController) AuthorizedListReport() {
 		condition += orCondition
 	}
 
+	// 获取所有启用的分类
+	classifyList, err := models.GetAllEnabledClassify()
+	if err != nil {
+		br.Msg = "获取失败"
+		br.ErrMsg = "获取失败,Err:" + err.Error()
+		return
+	}
+	classifyIdNum := len(classifyList)
+	if classifyIdNum > 0 {
+		classifyIdList := make([]int, 0)
+		for _, v := range classifyList {
+			classifyIdList = append(classifyIdList, v.Id)
+		}
+
+		condition += ` AND a.classify_id_first in (` + utils.GetOrmInReplace(classifyIdNum) + `)  AND a.classify_id_second in (` + utils.GetOrmInReplace(classifyIdNum) + `)  AND a.classify_id_third in (` + utils.GetOrmInReplace(classifyIdNum) + `) `
+		pars = append(pars, classifyIdList, classifyIdList, classifyIdList)
+	}
+
 	total, err = models.GetReportListCountByAuthorized(condition, pars)
 	if err != nil {
 		br.Msg = "获取失败"

+ 15 - 11
controllers/voice.go

@@ -6,7 +6,6 @@ import (
 	"eta/eta_mobile/services"
 	"eta/eta_mobile/utils"
 	"fmt"
-	"github.com/kgiannakakis/mp3duration/src/mp3duration"
 	"github.com/rdlucklib/rdluck_tools/http"
 	"os"
 	"path"
@@ -116,15 +115,20 @@ func (this *VoiceController) Upload() {
 		return
 	}
 
-	var playSeconds float64
-	playSeconds, err = mp3duration.Calculate(fpath)
-	if playSeconds <= 0 {
-		playSeconds, err = utils.GetVideoPlaySeconds(fpath)
-		if err != nil {
-			br.Msg = "获取音频时间失败"
-			br.ErrMsg = "获取音频时间失败,Err:" + err.Error()
-			return
-		}
+	//var playSeconds float64
+	//playSeconds, err = mp3duration.Calculate(fpath)
+	//if playSeconds <= 0 {
+	//	playSeconds, err = utils.GetVideoPlaySeconds(fpath)
+	//	if err != nil {
+	//		br.Msg = "获取音频时间失败"
+	//		br.ErrMsg = "获取音频时间失败,Err:" + err.Error()
+	//		return
+	//	}
+	//}
+
+	playSecondsStr, err := utils.GetDuration(fpath) //mp3duration.Calculate(fPath)
+	if err != nil {
+		utils.FileLog.Info("获取音频时间失败,Err:" + err.Error())
 	}
 
 	fileBody, err := os.ReadFile(fpath)
@@ -146,7 +150,7 @@ func (this *VoiceController) Upload() {
 
 		reportInfo.VideoUrl = resourceUrl
 		reportInfo.VideoName = videoName
-		reportInfo.VideoPlaySeconds = fmt.Sprint(playSeconds)
+		reportInfo.VideoPlaySeconds = playSecondsStr
 		reportInfo.VideoSize = sizeStr
 		reportInfo.LastModifyAdminId = this.SysUser.AdminId
 		reportInfo.LastModifyAdminName = this.SysUser.RealName

+ 13 - 0
models/classify.go

@@ -627,3 +627,16 @@ func GetClassifyListByParentId(parentId int) (items []*Classify, err error) {
 
 	return items, err
 }
+
+// GetAllEnabledClassify
+// @Description: 获取启用的指标列表
+// @author: Roc
+// @datetime 2025-01-20 11:02:23
+// @return list []*Classify
+// @return err error
+func GetAllEnabledClassify() (list []*Classify, err error) {
+	o := orm.NewOrmUsingDB("rddp")
+	sql := ` SELECT * FROM classify WHERE enabled = 1`
+	_, err = o.Raw(sql).QueryRows(&list)
+	return
+}

+ 16 - 0
models/data_manage/excel/excel_info.go

@@ -32,6 +32,7 @@ type ExcelInfo struct {
 	RelExcelInfoId     int       `description:"平衡表里静态表关联的动态表excel id"`
 	VersionName        string    `description:"静态表版本名称"`
 	SourcesFrom        string    `description:"图表来源"`
+	ExtraConfig        string    `description:"额外配置"`
 }
 
 // Update 更新 excel表格基础信息
@@ -729,3 +730,18 @@ type SearchExcelInfo struct {
 	CanEdit       bool                  `description:"是否可编辑"`
 	Editor        string                `description:"编辑人"`
 }
+
+// ExcelCommonExtraConfig 表格额外配置
+type ExcelCommonExtraConfig struct {
+	TableFreeze ExcelInfoFreeze `description:"表格冻结"`
+}
+
+// ExcelInfoFreeze 表格冻结
+type ExcelInfoFreeze struct {
+	FreezeFirstRow bool `description:"冻结首行"`
+	FreezeFirstCol bool `description:"冻结首列"`
+	FreezeStartRow int  `description:"冻结开始行"`
+	FreezeEndRow   int  `description:"冻结结束行"`
+	FreezeStartCol int  `description:"冻结开始列"`
+	FreezeEndCol   int  `description:"冻结结束列"`
+}

+ 30 - 29
models/data_manage/excel/response/excel_info.go

@@ -61,35 +61,36 @@ type TableDetailResp struct {
 
 // ExcelInfoDetail excel表格详情(前端使用)
 type ExcelInfoDetail struct {
-	ExcelInfoId        int                          `orm:"column(excel_info_id);pk"`
-	Source             int                          `description:"表格来源,1:excel插件的表格,2:自定义表格,默认:1"`
-	ExcelType          int                          `description:"表格类型,1:指标列,2:日期列,默认:1"`
-	ExcelName          string                       `description:"表格名称"`
-	UniqueCode         string                       `description:"表格唯一编码"`
-	ExcelClassifyId    int                          `description:"表格分类id"`
-	SysUserId          int                          `description:"操作人id"`
-	SysUserRealName    string                       `description:"操作人真实姓名"`
-	Content            string                       `description:"表格内容"`
-	ExcelImage         string                       `description:"表格图片"`
-	FileUrl            string                       `description:"表格下载地址"`
-	Sort               int                          `description:"排序字段,数字越小越排前面"`
-	IsDelete           int                          `description:"是否删除,0:未删除,1:已删除"`
-	ModifyTime         time.Time                    `description:"最近修改日期"`
-	CreateTime         time.Time                    `description:"创建日期"`
-	TableData          interface{}                  `description:"表格内容"`
-	Button             excel2.ExcelInfoDetailButton `description:"操作权限"`
-	CanEdit            bool                         `description:"是否可编辑"`
-	Editor             string                       `description:"编辑人"`
-	IsJoinPermission   int                          `description:"是否加入权限管控,0:不加入;1:加入;默认:0"`
-	HaveOperaAuth      bool                         `description:"是否有数据权限"`
-	ParentId           int                          `description:"表格的父级id"`
-	BalanceType        int                          `description:"平衡表类型:0 动态表,1静态表"`
-	UpdateUserId       int                          `description:"更新人id"`
-	UpdateUserRealName string                       `description:"更新人真实姓名"`
-	RelExcelInfoId     int                          `description:"平衡表里静态表关联的动态表excel id"`
-	SourcesFrom        string                       `description:"图表来源"`
-	ExcelSource        string                       `description:"表格来源str"`
-	ExcelSourceEn      string                       `description:"表格来源(英文)"`
+	ExcelInfoId        int                           `orm:"column(excel_info_id);pk"`
+	Source             int                           `description:"表格来源,1:excel插件的表格,2:自定义表格,默认:1"`
+	ExcelType          int                           `description:"表格类型,1:指标列,2:日期列,默认:1"`
+	ExcelName          string                        `description:"表格名称"`
+	UniqueCode         string                        `description:"表格唯一编码"`
+	ExcelClassifyId    int                           `description:"表格分类id"`
+	SysUserId          int                           `description:"操作人id"`
+	SysUserRealName    string                        `description:"操作人真实姓名"`
+	Content            string                        `description:"表格内容"`
+	ExcelImage         string                        `description:"表格图片"`
+	FileUrl            string                        `description:"表格下载地址"`
+	Sort               int                           `description:"排序字段,数字越小越排前面"`
+	IsDelete           int                           `description:"是否删除,0:未删除,1:已删除"`
+	ModifyTime         time.Time                     `description:"最近修改日期"`
+	CreateTime         time.Time                     `description:"创建日期"`
+	TableData          interface{}                   `description:"表格内容"`
+	Button             excel2.ExcelInfoDetailButton  `description:"操作权限"`
+	CanEdit            bool                          `description:"是否可编辑"`
+	Editor             string                        `description:"编辑人"`
+	IsJoinPermission   int                           `description:"是否加入权限管控,0:不加入;1:加入;默认:0"`
+	HaveOperaAuth      bool                          `description:"是否有数据权限"`
+	ParentId           int                           `description:"表格的父级id"`
+	BalanceType        int                           `description:"平衡表类型:0 动态表,1静态表"`
+	UpdateUserId       int                           `description:"更新人id"`
+	UpdateUserRealName string                        `description:"更新人真实姓名"`
+	RelExcelInfoId     int                           `description:"平衡表里静态表关联的动态表excel id"`
+	SourcesFrom        string                        `description:"图表来源"`
+	ExcelSource        string                        `description:"表格来源str"`
+	ExcelSourceEn      string                        `description:"表格来源(英文)"`
+	ExtraConfig        excel2.ExcelCommonExtraConfig `description:"表格额外配置"`
 }
 
 // ExcelInfoDetailButton 操作按钮

+ 19 - 8
models/report.go

@@ -155,6 +155,7 @@ type ReportList struct {
 	ClassifyNameThird   string    `description:"三级分类名称"`
 	InheritReportId     int       `description:"待继承的报告ID"`
 	IsCollect           int       `description:"是否收藏"`
+	ClassifyEnabled     bool      `description:"分类是否禁用"`
 }
 
 type ReportListResp struct {
@@ -1706,7 +1707,7 @@ func GetReportListByCollectList(classifyIdFirst, classifyIdSecond, classifyIdThi
 	return items, err
 }
 
-func GetReportListByCollectCountV2(classifyIdFirst, classifyIdSecond, classifyIdThird, chartPermissionIdList []string, keyword, author string, state int) (count int, err error) {
+func GetReportListByCollectCountV2(classifyIdFirst, classifyIdSecond, classifyIdThird, chartPermissionIdList []string, keyword, author string, isPublic int, stateArr []int) (count int, err error) {
 	o := orm.NewOrmUsingDB("rddp")
 	var params []interface{}
 
@@ -1751,9 +1752,14 @@ func GetReportListByCollectCountV2(classifyIdFirst, classifyIdSecond, classifyId
 		params = append(params, author)
 	}
 
-	if state > 0 {
-		sql += " AND b.state = ? "
-		params = append(params, state)
+	if isPublic > 0 {
+		sql += " AND b.is_public_publish = ? "
+		params = append(params, isPublic)
+	}
+
+	if len(stateArr) > 0 {
+		sql += fmt.Sprintf(" AND b.state IN (%s)", utils.GetOrmInReplace(len(stateArr)))
+		params = append(params, stateArr)
 	}
 
 	// 分类id判断
@@ -1792,7 +1798,7 @@ func GetReportListByCollectCountV2(classifyIdFirst, classifyIdSecond, classifyId
 	return count, err
 }
 
-func GetReportListByCollectListV2(classifyIdFirst, classifyIdSecond, classifyIdThird, chartPermissionIdList []string, keyword, orderField, orderType string, startSize, pageSize int, author string, state int) (items []*ReportList, err error) {
+func GetReportListByCollectListV2(classifyIdFirst, classifyIdSecond, classifyIdThird, chartPermissionIdList []string, keyword, orderField, orderType string, startSize, pageSize int, author string, isPublic int, stateArr []int) (items []*ReportList, err error) {
 	o := orm.NewOrmUsingDB("rddp")
 	var params []interface{}
 
@@ -1819,9 +1825,14 @@ b.abstract,b.admin_id,b.admin_real_name,b.last_modify_admin_id,b.last_modify_adm
 		params = append(params, author)
 	}
 
-	if state > 0 {
-		sql += " AND b.state = ? "
-		params = append(params, state)
+	if isPublic > 0 {
+		sql += " AND b.is_public_publish = ? "
+		params = append(params, isPublic)
+	}
+
+	if len(stateArr) > 0 {
+		sql += fmt.Sprintf(" AND b.state IN (%s)", utils.GetOrmInReplace(len(stateArr)))
+		params = append(params, stateArr)
 	}
 
 	// 分类id判断

+ 1 - 1
models/report_v2.go

@@ -369,7 +369,7 @@ func GetReportListCountByAuthorized(condition string, pars []interface{}) (count
 func GetReportListByAuthorized(condition string, pars []interface{}, startSize, pageSize int) (items []*ReportList, err error) {
 	o := orm.NewOrmUsingDB("rddp")
 
-	sql := `SELECT id,classify_id_first,classify_name_first,classify_id_second,classify_name_second,classify_id_third,classify_name_third,title,stage,create_time,author,report_layout,collaborate_type,is_public_publish,abstract,has_chapter,publish_time FROM report as a WHERE 1=1  `
+	sql := `SELECT id,classify_id_first,classify_name_first,classify_id_second,classify_name_second,classify_id_third,classify_name_third,title,stage,create_time,state,author,report_layout,collaborate_type,is_public_publish,abstract,has_chapter,publish_time FROM report as a WHERE 1=1  `
 	if condition != "" {
 		sql += condition
 	}

+ 0 - 1
routers/router.go

@@ -327,7 +327,6 @@ func init() {
 				&document_manage.DocumentManageController{},
 			),
 		),
-
 		web.NSNamespace("/material",
 			web.NSInclude(
 				&material.MaterialController{},

+ 10 - 3
services/data/excel/excel_info.go

@@ -103,6 +103,14 @@ func formatExcelInfo2Detail(excelInfo *excel.ExcelInfo, sysUserId int, lang stri
 		SourcesFrom:     excelInfo.SourcesFrom,
 	}
 
+	// 额外配置(表格冻结行列等)
+	if excelInfo.ExtraConfig != "" {
+		if e := json.Unmarshal([]byte(excelInfo.ExtraConfig), &excelDetail.ExtraConfig); e != nil {
+			err = fmt.Errorf("额外配置解析失败, %v", e)
+			return
+		}
+	}
+
 	// 无权限,不需要返回数据
 	if !haveOperaAuth {
 		return
@@ -1456,9 +1464,8 @@ func GetExcelEdbBatchRefreshKey(source string, reportId, chapterId int) string {
 	return fmt.Sprint("batch_refresh_excel_edb:", source, ":", reportId, ":", chapterId)
 }
 
-
 // GetEdbSourceByEdbInfoIdList 获取关联指标的来源
-func GetEdbSourceByEdbInfoIdList(edbInfoIdList []int) (sourceNameList, sourceNameEnList []string,err error) {
+func GetEdbSourceByEdbInfoIdList(edbInfoIdList []int) (sourceNameList, sourceNameEnList []string, err error) {
 	sourceNameList = make([]string, 0)
 	sourceNameEnList = make([]string, 0)
 	sourceMap := make(map[int]string)
@@ -1507,4 +1514,4 @@ func GetEdbSourceByEdbInfoIdList(edbInfoIdList []int) (sourceNameList, sourceNam
 		sourceNameEnList = append(sourceNameEnList, conf[models.BusinessConfCompanyName])
 	}
 	return
-}
+}

+ 5 - 4
services/document_manage_service/document_manage_service.go

@@ -503,10 +503,11 @@ func RuiSiReportListV2(classifyIdList, chartPermissionIdList []string, keyword,
 	// 作者为 全球市场战略研究中心 PCI Research
 	var author string
 	//author := "战研中心 PCIR"
-	// 已发布的报告
-	state := 2
+	// 已发布/已审批的公开发布的报告
+	isPublic := 1
+	stateArr := []int{2, 6}
 
-	count, err := models.GetReportListByCollectCountV2(classifyIdFirst, classifyIdSecond, classifyIdThird, chartPermissionIdList, keyword, author, state)
+	count, err := models.GetReportListByCollectCountV2(classifyIdFirst, classifyIdSecond, classifyIdThird, chartPermissionIdList, keyword, author, isPublic, stateArr)
 	if err != nil {
 		return nil, err
 	}
@@ -518,7 +519,7 @@ func RuiSiReportListV2(classifyIdList, chartPermissionIdList []string, keyword,
 		return &reportPage, nil
 	}
 
-	reportList, err := models.GetReportListByCollectListV2(classifyIdFirst, classifyIdSecond, classifyIdThird, chartPermissionIdList, keyword, orderField, orderType, startSize, pageSize, author, state)
+	reportList, err := models.GetReportListByCollectListV2(classifyIdFirst, classifyIdSecond, classifyIdThird, chartPermissionIdList, keyword, orderField, orderType, startSize, pageSize, author, isPublic, stateArr)
 	if err != nil {
 		return nil, err
 	}

+ 19 - 0
utils/common.go

@@ -2579,3 +2579,22 @@ func ConvertNumToBase62[T TUint](num T) string {
 func IsAdminRole(roleTypeCode string) bool {
 	return roleTypeCode == ROLE_TYPE_CODE_ADMIN
 }
+
+func GetDuration(filePath string) (duration string, err error) {
+	// 构建 FFmpeg 命令,使用 ffprobe 来获取媒体文件信息
+	cmd := exec.Command("ffprobe", "-i", filePath, "-show_entries", "format=duration", "-v", "quiet", "-of", "csv=p=0")
+	var out bytes.Buffer
+	cmd.Stdout = &out
+
+	// 执行命令并捕获输出
+	err = cmd.Run()
+	if err != nil {
+		return "", err
+	}
+
+	// 使用正则表达式匹配输出中的时长信息
+	re := regexp.MustCompile(`\d+\.\d+`)
+	duration = re.FindString(out.String())
+
+	return duration, nil
+}