|
@@ -290,6 +290,74 @@ func UpdateEnglishReportEs(reportId int, publishState int) (err error) {
|
|
|
return
|
|
|
}
|
|
|
|
|
|
+// ModifyAllEsEnglishReportVideo 批量修改es里的英文研报信息和线上路演信息
|
|
|
+func ModifyAllEsEnglishReportVideo() (err error) {
|
|
|
+ reportList, err := models.GetEnglishReportByCondition("", []interface{}{})
|
|
|
+ if err != nil {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ for _, reportInfo := range reportList {
|
|
|
+ // 新增报告ES
|
|
|
+ esReport := &models.ElasticEnglishReportDetail{
|
|
|
+ Id: strconv.Itoa(reportInfo.Id),
|
|
|
+ ReportId: reportInfo.Id,
|
|
|
+ Title: reportInfo.Title,
|
|
|
+ Abstract: reportInfo.Abstract,
|
|
|
+ BodyContent: utils.TrimHtml(html.UnescapeString(reportInfo.Content)),
|
|
|
+ PublishTime: reportInfo.PublishTime.Format(utils.FormatDateTime),
|
|
|
+ CreateTime: reportInfo.CreateTime,
|
|
|
+ ReportCode: reportInfo.ReportCode,
|
|
|
+ PublishState: reportInfo.State,
|
|
|
+ Author: reportInfo.Author,
|
|
|
+ Frequency: reportInfo.Frequency,
|
|
|
+ ClassifyIdFirst: reportInfo.ClassifyIdFirst,
|
|
|
+ ClassifyNameFirst: reportInfo.ClassifyNameFirst,
|
|
|
+ ClassifyIdSecond: reportInfo.ClassifyIdSecond,
|
|
|
+ ClassifyNameSecond: reportInfo.ClassifyNameSecond,
|
|
|
+ StageStr: strconv.Itoa(reportInfo.Stage),
|
|
|
+ Overview: utils.TrimHtml(html.UnescapeString(reportInfo.Overview)),
|
|
|
+ ContentSub: utils.TrimHtml(html.UnescapeString(reportInfo.ContentSub)),
|
|
|
+ }
|
|
|
+ docId := fmt.Sprintf("%d", reportInfo.Id)
|
|
|
+ if err = EsAddOrEditEnglishReport(utils.EsEnglishReportIndexName, docId, esReport); err != nil {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ videoList, err := models.GetEnglishVideoByCondition("", []interface{}{})
|
|
|
+ if err != nil {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ for _, videoInfo := range videoList {
|
|
|
+ // 新增报告ES
|
|
|
+ esReport := &models.ElasticEnglishReportDetail{
|
|
|
+ Id: "v" + strconv.Itoa(videoInfo.Id),
|
|
|
+ VideoId: videoInfo.Id,
|
|
|
+ Title: videoInfo.Title,
|
|
|
+ Abstract: videoInfo.Abstract,
|
|
|
+ BodyContent: "",
|
|
|
+ PublishTime: videoInfo.PublishTime.Format(utils.FormatDateTime),
|
|
|
+ CreateTime: videoInfo.CreateTime.Format(utils.FormatDateTime),
|
|
|
+ ReportCode: videoInfo.VideoCode,
|
|
|
+ PublishState: videoInfo.State,
|
|
|
+ Author: videoInfo.Author,
|
|
|
+ Frequency: "",
|
|
|
+ ClassifyIdFirst: videoInfo.ClassifyIdFirst,
|
|
|
+ ClassifyNameFirst: videoInfo.ClassifyNameFirst,
|
|
|
+ ClassifyIdSecond: videoInfo.ClassifyIdSecond,
|
|
|
+ ClassifyNameSecond: videoInfo.ClassifyNameSecond,
|
|
|
+ StageStr: "",
|
|
|
+ Overview: utils.TrimHtml(html.UnescapeString(videoInfo.Overview)),
|
|
|
+ ContentSub: "",
|
|
|
+ }
|
|
|
+ docId := fmt.Sprintf("v%d", videoInfo.Id)
|
|
|
+ if err = EsAddOrEditEnglishReport(utils.EsEnglishReportIndexName, docId, esReport); err != nil {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return
|
|
|
+}
|
|
|
+
|
|
|
// UpdateEnglishVideoEs 更新英文线上路演Es
|
|
|
func UpdateEnglishVideoEs(videoId int, publishState int) (err error) {
|
|
|
if videoId <= 0 {
|