|
@@ -4,7 +4,6 @@ import (
|
|
|
"encoding/json"
|
|
|
"eta/eta_api/models"
|
|
|
"eta/eta_api/models/report"
|
|
|
- "eta/eta_api/models/smart_report"
|
|
|
"eta/eta_api/services"
|
|
|
"eta/eta_api/utils"
|
|
|
"fmt"
|
|
@@ -107,7 +106,7 @@ func (this *ReportController) AddChapter() {
|
|
|
reportChapterInfo.IsEdit = 1
|
|
|
//reportChapterInfo.CreateTime = req.CreateTime
|
|
|
reportChapterInfo.CreateTime = reportInfo.CreateTime
|
|
|
- reportChapterInfo.VideoKind = 1
|
|
|
+ reportChapterInfo.VideoKind = 2
|
|
|
|
|
|
reportChapterInfo.ClassifyIdSecond = reportInfo.ClassifyIdSecond
|
|
|
reportChapterInfo.ClassifyNameSecond = reportInfo.ClassifyNameSecond
|
|
@@ -332,27 +331,16 @@ func (this *ReportController) EditDayWeekChapter() {
|
|
|
reportChapterInfo.ContentSub = html.EscapeString(contentSub)
|
|
|
reportChapterInfo.IsEdit = 1
|
|
|
reportChapterInfo.CreateTime = req.CreateTime
|
|
|
- reportChapterInfo.VideoUrl = req.VideoUrl
|
|
|
- reportChapterInfo.VideoName = req.VideoName
|
|
|
- reportChapterInfo.VideoPlaySeconds = req.VideoPlaySeconds
|
|
|
- reportChapterInfo.VideoSize = req.VideoSize
|
|
|
- reportChapterInfo.VideoKind = 1
|
|
|
|
|
|
reportChapterInfo.LastModifyAdminId = sysUser.AdminId
|
|
|
reportChapterInfo.LastModifyAdminName = sysUser.RealName
|
|
|
reportChapterInfo.ContentModifyTime = time.Now()
|
|
|
reportChapterInfo.ContentStruct = html.EscapeString(req.ContentStruct)
|
|
|
- reportChapterInfo.CanvasColor = req.CanvasColor
|
|
|
- reportChapterInfo.HeadResourceId = req.HeadResourceId
|
|
|
- reportChapterInfo.EndResourceId = req.EndResourceId
|
|
|
|
|
|
updateCols := make([]string, 0)
|
|
|
updateCols = append(updateCols, "Title", "AddType", "Author", "Content", "ContentSub", "IsEdit", "CreateTime")
|
|
|
- if req.VideoUrl != "" {
|
|
|
- updateCols = append(updateCols, "VideoUrl", "VideoName", "VideoSize", "VideoPlaySeconds", "VideoKind")
|
|
|
- }
|
|
|
|
|
|
- updateCols = append(updateCols, "LastModifyAdminId", "LastModifyAdminName", "ContentModifyTime", "ContentStruct", "CanvasColor", "HeadResourceId", "EndResourceId")
|
|
|
+ updateCols = append(updateCols, "LastModifyAdminId", "LastModifyAdminName", "ContentModifyTime", "ContentStruct")
|
|
|
|
|
|
// 章节报告更新指标
|
|
|
tickerList := make([]*models.ReportChapterTicker, 0)
|
|
@@ -795,28 +783,6 @@ func (this *ReportController) GetDayWeekChapter() {
|
|
|
PermissionIdList: chapterPermissionIdList,
|
|
|
}
|
|
|
|
|
|
- if chapterInfo.HeadResourceId > 0 {
|
|
|
- headResource, err := smart_report.GetResourceItemById(chapterInfo.HeadResourceId)
|
|
|
- if err != nil {
|
|
|
- br.Msg = "操作失败"
|
|
|
- br.ErrMsg = "获取资源库版头失败, Err: " + err.Error()
|
|
|
- return
|
|
|
- }
|
|
|
- resp.HeadImg = headResource.ImgUrl
|
|
|
- resp.HeadStyle = headResource.Style
|
|
|
- }
|
|
|
-
|
|
|
- if chapterInfo.EndResourceId > 0 {
|
|
|
- endResource, err := smart_report.GetResourceItemById(resp.EndResourceId)
|
|
|
- if err != nil {
|
|
|
- br.Msg = "操作失败"
|
|
|
- br.ErrMsg = "获取资源库版头失败, Err: " + err.Error()
|
|
|
- return
|
|
|
- }
|
|
|
- resp.EndImg = endResource.ImgUrl
|
|
|
- resp.EndStyle = endResource.Style
|
|
|
- }
|
|
|
-
|
|
|
// 获取当前编辑状态
|
|
|
{
|
|
|
markStatus, err := services.UpdateReportEditMark(chapterInfo.ReportId, chapterInfo.ReportChapterId, this.SysUser.AdminId, 2, this.SysUser.RealName, this.Lang)
|
|
@@ -1038,7 +1004,6 @@ func (this *ReportController) GetSunCode() {
|
|
|
// @Title 音频上传
|
|
|
// @Description 音频上传接口
|
|
|
// @Param file query file true "文件"
|
|
|
-// @Param ReportId query int true "报告ID"
|
|
|
// @Param ReportChapterId query int true "报告章节ID"
|
|
|
// @Success Ret=200 上传成功
|
|
|
// @router /chapter/voice/upload [post]
|
|
@@ -1174,7 +1139,7 @@ func (this *ReportController) VoiceUpload() {
|
|
|
sizeFloat := (float64(videoSize) / float64(1024)) / float64(1024)
|
|
|
sizeStr := utils.SubFloatToFloatStr(sizeFloat, 2)
|
|
|
|
|
|
- if reportChapterId > 0 {
|
|
|
+ {
|
|
|
reportChapterCreateTime, err := time.Parse(utils.FormatDateTime, reportChapterInfo.CreateTime)
|
|
|
if err != nil {
|
|
|
br.Msg = "上传失败"
|
|
@@ -1188,10 +1153,11 @@ func (this *ReportController) VoiceUpload() {
|
|
|
reportChapterInfo.VideoName = videoName
|
|
|
reportChapterInfo.VideoPlaySeconds = fmt.Sprint(playSeconds)
|
|
|
reportChapterInfo.VideoSize = sizeStr
|
|
|
+ reportChapterInfo.VideoKind = 1
|
|
|
reportChapterInfo.LastModifyAdminId = this.SysUser.AdminId
|
|
|
reportChapterInfo.LastModifyAdminName = this.SysUser.RealName
|
|
|
reportChapterInfo.ModifyTime = time.Now()
|
|
|
- err = reportChapterInfo.UpdateChapter([]string{"VideoUrl", "VideoName", "VideoPlaySeconds", "VideoSize", "LastModifyAdminId", "LastModifyAdminName", "ModifyTime"})
|
|
|
+ err = reportChapterInfo.UpdateChapter([]string{"VideoUrl", "VideoName", "VideoPlaySeconds", "VideoSize", "VideoKind", "LastModifyAdminId", "LastModifyAdminName", "ModifyTime"})
|
|
|
if err != nil {
|
|
|
br.Msg = "上传失败"
|
|
|
br.ErrMsg = "修改报告章节的音频信息失败,Err:" + err.Error()
|
|
@@ -1207,29 +1173,6 @@ func (this *ReportController) VoiceUpload() {
|
|
|
br.ErrMsg = "修改报告最后更新人信息失败,Err:" + err.Error()
|
|
|
return
|
|
|
}
|
|
|
- } else {
|
|
|
- reportCreateTime, err := time.Parse(utils.FormatDateTime, reportInfo.CreateTime)
|
|
|
- if err != nil {
|
|
|
- br.Msg = "上传失败"
|
|
|
- br.ErrMsg = "上传失败,Err:" + err.Error()
|
|
|
- return
|
|
|
- }
|
|
|
- createTimeStr := reportCreateTime.Format("0102")
|
|
|
- videoName := reportInfo.Title + "(" + createTimeStr + ")"
|
|
|
-
|
|
|
- reportInfo.VideoUrl = resourceUrl
|
|
|
- reportInfo.VideoName = videoName
|
|
|
- reportInfo.VideoPlaySeconds = fmt.Sprint(playSeconds)
|
|
|
- reportInfo.VideoSize = sizeStr
|
|
|
- reportInfo.LastModifyAdminId = this.SysUser.AdminId
|
|
|
- reportInfo.LastModifyAdminName = this.SysUser.RealName
|
|
|
- reportInfo.ModifyTime = time.Now()
|
|
|
- err = reportInfo.UpdateReport([]string{"VideoUrl", "VideoName", "VideoPlaySeconds", "VideoSize", "LastModifyAdminId", "LastModifyAdminName", "ModifyTime"})
|
|
|
- if err != nil {
|
|
|
- br.Msg = "上传失败"
|
|
|
- br.ErrMsg = "修改报告的音频信息失败,Err:" + err.Error()
|
|
|
- return
|
|
|
- }
|
|
|
}
|
|
|
|
|
|
resp := new(models.ResourceResp)
|