|
@@ -32,11 +32,14 @@ import (
|
|
|
func GetLatestClassReport(permissionIds []int, userId uint64) (purchaseList []*purchase.PurchaseListItem, err error) {
|
|
|
var errMsg string
|
|
|
defer func() {
|
|
|
+ if sysErr := recover(); sysErr != nil {
|
|
|
+ err = errors.New("系统错误")
|
|
|
+ global.LOG.Critical(fmt.Sprintf("GetLatestClassReport: userId=%d, err:%s,sysErr:%s", userId, err.Error(), sysErr))
|
|
|
+ }
|
|
|
if err != nil {
|
|
|
global.LOG.Critical(fmt.Sprintf("GetLatestClassReport: userId=%d, err:%s, errMsg:%s", userId, err.Error(), errMsg))
|
|
|
}
|
|
|
}()
|
|
|
-
|
|
|
//获取所有分类信息
|
|
|
classifys, err := classify.GetSimpleAll()
|
|
|
if err != nil {
|
|
@@ -396,7 +399,7 @@ func GetReportDetail(userinfo user.UserInfo, reportId int) (reportDetail respons
|
|
|
}
|
|
|
//如果有权限则展示content
|
|
|
if authOk {
|
|
|
- _ = AddViewRecord(userinfo, reportInfo.Id, reportInfo.ClassifyNameFirst, 0)
|
|
|
+ task.Task(AddViewRecord, userinfo, reportInfo.Id, reportInfo.ClassifyNameFirst, 0)
|
|
|
reportItem.Content = html.UnescapeString(reportInfo.Content)
|
|
|
reportItem.VideoUrl = reportInfo.VideoUrl
|
|
|
}
|
|
@@ -826,7 +829,7 @@ func SearchReport(user user.UserInfo, keyWord string, pageIndex, pageSize int)(r
|
|
|
}
|
|
|
|
|
|
// GetTickerData 获取指标数据
|
|
|
-func GetTickerData(user user.UserInfo, reportChapterId int) (list []*response.TickerDataItem, err error) {
|
|
|
+func GetTickerData(user user.UserInfo, reportChapterId int) (ret response.TickerData, err error) {
|
|
|
var errMsg string
|
|
|
defer func() {
|
|
|
if err != nil {
|
|
@@ -854,6 +857,7 @@ func GetTickerData(user user.UserInfo, reportChapterId int) (list []*response.Ti
|
|
|
return
|
|
|
}
|
|
|
|
|
|
+ var list []*response.TickerDataItem
|
|
|
if len(tickers) > 0 {
|
|
|
var tickerNames []string
|
|
|
for _, v := range tickers {
|
|
@@ -865,12 +869,18 @@ func GetTickerData(user user.UserInfo, reportChapterId int) (list []*response.Ti
|
|
|
}else{
|
|
|
dataList, err = daily_base_column.GetDataByBaseColumnTickers(tickerNames)
|
|
|
}
|
|
|
+
|
|
|
if err != nil {
|
|
|
errMsg = err.Error()
|
|
|
err = errors.New("查询指标数据失败")
|
|
|
return
|
|
|
}
|
|
|
-
|
|
|
+ chapterTypeInfo, tErr := report_chapter_type.GetTickerTitleByTypeId(chapter.TypeId)
|
|
|
+ if tErr != nil {
|
|
|
+ errMsg = tErr.Error()
|
|
|
+ err = errors.New("查询章节类型失败")
|
|
|
+ return
|
|
|
+ }
|
|
|
if len(dataList) >= 0 {
|
|
|
for _, v := range dataList {
|
|
|
temp := new(response.TickerDataItem)
|
|
@@ -886,6 +896,14 @@ func GetTickerData(user user.UserInfo, reportChapterId int) (list []*response.Ti
|
|
|
list = append(list, temp)
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ tickerTitle := new(response.TickerTitleData)
|
|
|
+ tickerTitle.TickerTitle = chapterTypeInfo.TickerTitle
|
|
|
+ tickerTitle.ReportChapterTypeId = int(chapterTypeInfo.ReportChapterTypeId)
|
|
|
+ tickerTitle.ReportChapterTypeName = chapterTypeInfo.ReportChapterTypeName
|
|
|
+ tickerTitle.DataTableImage = fmt.Sprintf("http://hongze.oss-cn-shanghai.aliyuncs.com/data_table/%s.png", chapterTypeInfo.ReportChapterTypeKey)
|
|
|
+ ret.List = list
|
|
|
+ ret.TickerTitle = tickerTitle
|
|
|
}
|
|
|
return
|
|
|
}
|