xingzai 6 bulan lalu
induk
melakukan
18d2e7da45

+ 2 - 2
controllers/cygx/askserie_video.go

@@ -86,7 +86,7 @@ func (this *AskserieVideoController) PreserveAndPublish() {
 	item.CreateTime = time.Now()
 
 	if askserieVideoId == 0 {
-		shareImg, _ = cygxService.MakeCygxMp3HtmlImg(videoDuration) //生成分享图片
+		shareImg, _ = cygxService.MakeCygxMp3HtmlImg(videoDuration, 0) //生成分享图片
 		item.ShareImg = shareImg
 		//新增
 		newId, err := cygx.AddCygxAskserieVideo(item, industrialManagementIds)
@@ -106,7 +106,7 @@ func (this *AskserieVideoController) PreserveAndPublish() {
 		}
 		//如果时长有变更就更新分享图片
 		if detail.VideoDuration != videoDuration {
-			shareImg, _ = cygxService.MakeCygxMp3HtmlImg(videoDuration) //生成分享图片
+			shareImg, _ = cygxService.MakeCygxMp3HtmlImg(videoDuration, 0) //生成分享图片
 			item.ShareImg = shareImg
 		}
 

+ 1 - 1
controllers/cygx/micro_roadshow.go

@@ -254,7 +254,7 @@ func (this *MicroRoadshowController) Add() {
 			return
 		}
 	}
-	shareImg, _ := cygxService.MakeCygxMp4HtmlImg(req.VideoDuration) //生成分享图片
+	shareImg, _ := cygxService.MakeCygxMp4HtmlImg(req.VideoDuration, 0) //生成分享图片
 	req.ShareImgUrl = shareImg
 	nameItem.IndustryName = utils.RemoveFileSuffixName(nameItem.IndustryName) //去掉后缀名称
 	if req.VideoId > 0 {

+ 16 - 16
services/cygx/activity_ocr.go

@@ -175,13 +175,13 @@ func UpdateActivityVideoAndVoice(activityInfo *cygx.ActivityDetail, itemVoice *c
 			err = errors.New("GetCygxActivityVoiceCount" + e.Error())
 			return
 		}
-		activityId := itemVoice.ActivityId
-		//获取活动详情
-		activityInfo, e := cygx.GetAddActivityInfoById(activityId)
-		if e != nil {
-			err = errors.New("GetAddActivityInfoById, Err: " + e.Error())
-			return
-		}
+		//activityId := itemVoice.ActivityId
+		////获取活动详情
+		//activityInfo, e := cygx.GetAddActivityInfoById(activityId)
+		//if e != nil {
+		//	err = errors.New("GetAddActivityInfoById, Err: " + e.Error())
+		//	return
+		//}
 		//易董办会的分析师电话会,为路演回放
 		if (activityInfo.ActivityTypeId == 2 || activityInfo.ActivityTypeId == 7) && activityInfo.IsYidongConduct == 1 {
 			itemVoice.FileType = 1
@@ -189,7 +189,7 @@ func UpdateActivityVideoAndVoice(activityInfo *cygx.ActivityDetail, itemVoice *c
 			itemVoice.FileType = 2
 		}
 
-		shareImg, _ := MakeCygxMp3HtmlImg(itemVoice.VoicePlaySeconds) //生成分享图片
+		shareImg, _ := MakeCygxMp3HtmlImg(itemVoice.VoicePlaySeconds, activityInfo.ChartPermissionId) //生成分享图片
 		itemVoice.ShareImg = shareImg
 		itemVoice.VoiceName = utils.RemoveFileSuffixName(itemVoice.VoiceName) //去掉后缀名称
 
@@ -246,13 +246,13 @@ func UpdateActivityVideoAndVoice(activityInfo *cygx.ActivityDetail, itemVoice *c
 			err = errors.New("GetActivityVideoCount" + e.Error())
 			return
 		}
-		activityId := itemVideo.ActivityId
-		//获取活动详情
-		activityInfo, e := cygx.GetAddActivityInfoById(activityId)
-		if e != nil {
-			err = errors.New("GetAddActivityInfoById, Err: " + e.Error())
-			return
-		}
+		//activityId := itemVideo.ActivityId
+		////获取活动详情
+		//activityInfo, e := cygx.GetAddActivityInfoById(activityId)
+		//if e != nil {
+		//	err = errors.New("GetAddActivityInfoById, Err: " + e.Error())
+		//	return
+		//}
 		//易董办会的分析师电话会,为路演回放
 		if (activityInfo.ActivityTypeId == 2 || activityInfo.ActivityTypeId == 7) && activityInfo.IsYidongConduct == 1 {
 			itemVideo.FileType = 1
@@ -260,7 +260,7 @@ func UpdateActivityVideoAndVoice(activityInfo *cygx.ActivityDetail, itemVoice *c
 			itemVideo.FileType = 2
 		}
 
-		shareImg, _ := MakeCygxMp4HtmlImg(itemVideo.VideoDuration) //生成分享图片
+		shareImg, _ := MakeCygxMp4HtmlImg(itemVideo.VideoDuration, activityInfo.ChartPermissionId) //生成分享图片
 		itemVideo.ShareImg = shareImg
 		itemVideo.VideoName = utils.RemoveFileSuffixName(itemVideo.VideoName) //去掉后缀名称
 

+ 21 - 4
services/cygx/activity_poster.go

@@ -23,6 +23,8 @@ var (
 	Cygx_activity_sigin_html = "cygx_activity_sigin_html"
 	Cygx_mp3_html            = "cygx_mp3_html"
 	Cygx_mp4_html            = "cygx_mp4_html"
+	Cygx_mp3_yx_html         = "cygx_mp3_yx_html"
+	Cygx_mp4_yx_html         = "cygx_mp4_yx_html"
 )
 
 type Html2ImgResp struct {
@@ -237,7 +239,7 @@ func MakeActivitySigninImg(activityId int) (imgUrl string, err error) {
 }
 
 // 生成音视频分享封面图
-func MakeCygxMp3HtmlImg(videoDuration string) (imgUrl string, err error) {
+func MakeCygxMp3HtmlImg(videoDuration string, chartPermissionId int) (imgUrl string, err error) {
 	var msg string
 	defer func() {
 		if err != nil || msg != "" {
@@ -245,7 +247,14 @@ func MakeCygxMp3HtmlImg(videoDuration string) (imgUrl string, err error) {
 			go alarm_msg.SendAlarmMsg("生成音视频分享封面图,失败 MakeCygxMp3HtmlImg:"+err.Error()+";msg:"+msg, 3)
 		}
 	}()
-	detailConfig, e := cygx.GetCygxConfigDetailByCode(Cygx_mp3_html)
+
+	var configCode string
+	if chartPermissionId == utils.CHART_PERMISSION_ID_YANXUAN {
+		configCode = Cygx_mp3_yx_html
+	} else {
+		configCode = Cygx_mp3_html
+	}
+	detailConfig, e := cygx.GetCygxConfigDetailByCode(configCode)
 	if e != nil {
 		err = errors.New("GetCygxConfigDetailByCode 获取配置生成音视频分享封面图格式信息失败, Err: " + e.Error())
 		return
@@ -283,7 +292,7 @@ func MakeCygxMp3HtmlImg(videoDuration string) (imgUrl string, err error) {
 }
 
 // 生成音视频分享封面图
-func MakeCygxMp4HtmlImg(videoDuration string) (imgUrl string, err error) {
+func MakeCygxMp4HtmlImg(videoDuration string, chartPermissionId int) (imgUrl string, err error) {
 	var msg string
 	defer func() {
 		if err != nil || msg != "" {
@@ -291,7 +300,15 @@ func MakeCygxMp4HtmlImg(videoDuration string) (imgUrl string, err error) {
 			go alarm_msg.SendAlarmMsg("生成音视频分享封面图,失败 MakeCygxMp4HtmlImg:"+err.Error()+";msg:"+msg, 3)
 		}
 	}()
-	detailConfig, e := cygx.GetCygxConfigDetailByCode(Cygx_mp4_html)
+
+	var configCode string
+	if chartPermissionId == utils.CHART_PERMISSION_ID_YANXUAN {
+		configCode = Cygx_mp4_yx_html
+	} else {
+		configCode = Cygx_mp4_html
+	}
+
+	detailConfig, e := cygx.GetCygxConfigDetailByCode(configCode)
 	if e != nil {
 		err = errors.New("GetCygxConfigDetailByCode 获取配置生成音视频分享封面图格式信息失败, Err: " + e.Error())
 		return

+ 4 - 4
services/cygx/askserie_video.go

@@ -149,7 +149,7 @@ func initpy() {
 	}
 
 	for _, v := range listVoice {
-		shareImg, _ := MakeCygxMp3HtmlImg(v.VoicePlaySeconds) //生成分享图片
+		shareImg, _ := MakeCygxMp3HtmlImg(v.VoicePlaySeconds, 0) //生成分享图片
 		v.ShareImg = shareImg
 		err = cygx.UpdateCygxActivityVoice(v)
 		if err != nil {
@@ -166,7 +166,7 @@ func initpy() {
 	}
 
 	for _, v := range listVideo {
-		shareImg, _ := MakeCygxMp4HtmlImg(v.VideoDuration) //生成分享图片
+		shareImg, _ := MakeCygxMp4HtmlImg(v.VideoDuration, 0) //生成分享图片
 		v.ShareImg = shareImg
 		err = cygx.UpdateCygxActivityVideo(v)
 		if err != nil {
@@ -183,7 +183,7 @@ func initpy() {
 	}
 
 	for _, v := range listVideoRoadshow {
-		shareImg, _ := MakeCygxMp4HtmlImg(v.VideoDuration) //生成分享图片
+		shareImg, _ := MakeCygxMp4HtmlImg(v.VideoDuration, 0) //生成分享图片
 		v.ShareImgUrl = shareImg
 		err = cygx.UpdateCygxMicroRoadshowVideo(v)
 		if err != nil {
@@ -200,7 +200,7 @@ func initpy() {
 	}
 
 	for _, v := range listAskserVoice {
-		shareImg, _ := MakeCygxMp3HtmlImg(v.VideoDuration) //生成分享图片
+		shareImg, _ := MakeCygxMp3HtmlImg(v.VideoDuration, 0) //生成分享图片
 		v.ShareImg = shareImg
 		err = cygx.EditCygxAskserieVideoShareImg(shareImg, v.AskserieVideoId)
 		if err != nil {