|
@@ -8,6 +8,7 @@ import (
|
|
|
"eta/eta_mini_bridge/services/elastic"
|
|
|
"eta/eta_mini_bridge/utils"
|
|
|
"html"
|
|
|
+ "strconv"
|
|
|
"strings"
|
|
|
"time"
|
|
|
|
|
@@ -52,7 +53,7 @@ func addAliasToKeyword(keyword string) string {
|
|
|
func SearchReport(keyWord string, pageIndex, pageSize int) (ret *response.ReportSearchResp, err error, errMsg string) {
|
|
|
//查询正常状态的分类
|
|
|
keyWord = addAliasToKeyword(keyWord)
|
|
|
- searchResp, total, err := elastic.SearchReport(keyWord, []int{}, []int{}, pageIndex, pageSize)
|
|
|
+ searchResp, total, err := elastic.SearchReportV2(keyWord, []int{}, []int{}, pageIndex, pageSize)
|
|
|
if err != nil {
|
|
|
errMsg = err.Error()
|
|
|
err = errors.New("查询失败")
|
|
@@ -75,18 +76,26 @@ func SearchReport(keyWord string, pageIndex, pageSize int) (ret *response.Report
|
|
|
err = errors.New("解析json出错")
|
|
|
return
|
|
|
}
|
|
|
- temp.ReportId = reportItem.ReportId
|
|
|
+ if reportItem.ReportPdfId != 0 {
|
|
|
+ temp.ReportId = reportItem.ReportPdfId
|
|
|
+ temp.ReportType = utils.ReportTypePdf
|
|
|
+ temp.Stage = strconv.Itoa(reportItem.Stage)
|
|
|
+ } else {
|
|
|
+ temp.ReportId = reportItem.ReportId
|
|
|
+ temp.ReportType = utils.ReportTypeEta
|
|
|
+ temp.Stage = reportItem.StageStr
|
|
|
+ temp.ContentSub = reportItem.BodyContent
|
|
|
+ }
|
|
|
+ temp.PdfUrl = reportItem.PdfUrl
|
|
|
temp.ReportChapterId = reportItem.ReportChapterId
|
|
|
temp.ClassifyIdFirst = reportItem.ClassifyIdFirst
|
|
|
temp.ClassifyNameFirst = reportItem.ClassifyNameFirst
|
|
|
temp.ClassifyIdSecond = reportItem.ClassifyIdSecond
|
|
|
temp.ClassifyNameSecond = reportItem.ClassifyNameSecond
|
|
|
- temp.Title = reportItem.Title
|
|
|
- temp.ContentSub = reportItem.BodyContent
|
|
|
temp.PublishTime, err = time.ParseInLocation(utils.FormatDateTime, reportItem.PublishTime, time.Local)
|
|
|
+ temp.Title = reportItem.Title
|
|
|
temp.Abstract = reportItem.Abstract
|
|
|
temp.Author = reportItem.Author
|
|
|
- temp.Stage = reportItem.StageStr
|
|
|
|
|
|
if len(v.Highlight["Title"]) > 0 {
|
|
|
temp.Title = v.Highlight["Title"][0]
|