|
@@ -389,51 +389,70 @@ func CygxResearchSummary(cont context.Context) (err error) {
|
|
|
|
|
|
//买方研选
|
|
|
{
|
|
|
+ ids, e := data_manage.GetYanXuanArticleIdList()
|
|
|
+ if e != nil {
|
|
|
+ err = e
|
|
|
+ fmt.Println("GetReportArticleList err:", e)
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
var condition string
|
|
|
var pars []interface{}
|
|
|
condition += ` AND publish_date < ? AND publish_date >= ? `
|
|
|
pars = append(pars, friday, lastfriday)
|
|
|
mfyxList := make([]*data_manage.CygxArticle, 0)
|
|
|
|
|
|
- //纪要
|
|
|
- {
|
|
|
- newCondition := condition + ` AND article_type_id = 1 `
|
|
|
- list, e := data_manage.GetReportArticleList(newCondition, pars)
|
|
|
- if e != nil {
|
|
|
- err = e
|
|
|
- fmt.Println("GetReportArticleList err:", e)
|
|
|
- return
|
|
|
- }
|
|
|
- for _, article := range list {
|
|
|
- mfyxList = append(mfyxList, article)
|
|
|
- }
|
|
|
- }
|
|
|
- //观点
|
|
|
- {
|
|
|
- newCondition := condition + ` AND article_type_id = 2 `
|
|
|
- list, e := data_manage.GetReportArticleList(newCondition, pars)
|
|
|
- if e != nil {
|
|
|
- err = e
|
|
|
- fmt.Println("GetReportArticleList err:", e)
|
|
|
- return
|
|
|
- }
|
|
|
- for _, article := range list {
|
|
|
- mfyxList = append(mfyxList, article)
|
|
|
- }
|
|
|
+ //9.23新增研选所有类型的报告都要
|
|
|
+ newCondition := condition + ` AND article_type_id IN (`+ *ids +`) `
|
|
|
+ list, e := data_manage.GetReportArticleList(newCondition, pars)
|
|
|
+ if e != nil {
|
|
|
+ err = e
|
|
|
+ fmt.Println("GetReportArticleList err:", e)
|
|
|
+ return
|
|
|
}
|
|
|
- //沙龙
|
|
|
- {
|
|
|
- newCondition := condition + ` AND article_type_id = 13 `
|
|
|
- list, e := data_manage.GetReportArticleList(newCondition, pars)
|
|
|
- if e != nil {
|
|
|
- err = e
|
|
|
- fmt.Println("GetReportArticleList err:", e)
|
|
|
- return
|
|
|
- }
|
|
|
- for _, article := range list {
|
|
|
- mfyxList = append(mfyxList, article)
|
|
|
- }
|
|
|
+ for _, article := range list {
|
|
|
+ mfyxList = append(mfyxList, article)
|
|
|
}
|
|
|
+
|
|
|
+ ////纪要
|
|
|
+ //{
|
|
|
+ // newCondition := condition + ` AND article_type_id = 1 `
|
|
|
+ // list, e := data_manage.GetReportArticleList(newCondition, pars)
|
|
|
+ // if e != nil {
|
|
|
+ // err = e
|
|
|
+ // fmt.Println("GetReportArticleList err:", e)
|
|
|
+ // return
|
|
|
+ // }
|
|
|
+ // for _, article := range list {
|
|
|
+ // mfyxList = append(mfyxList, article)
|
|
|
+ // }
|
|
|
+ //}
|
|
|
+ ////观点
|
|
|
+ //{
|
|
|
+ // newCondition := condition + ` AND article_type_id = 2 `
|
|
|
+ // list, e := data_manage.GetReportArticleList(newCondition, pars)
|
|
|
+ // if e != nil {
|
|
|
+ // err = e
|
|
|
+ // fmt.Println("GetReportArticleList err:", e)
|
|
|
+ // return
|
|
|
+ // }
|
|
|
+ // for _, article := range list {
|
|
|
+ // mfyxList = append(mfyxList, article)
|
|
|
+ // }
|
|
|
+ //}
|
|
|
+ ////沙龙
|
|
|
+ //{
|
|
|
+ // newCondition := condition + ` AND article_type_id = 13 `
|
|
|
+ // list, e := data_manage.GetReportArticleList(newCondition, pars)
|
|
|
+ // if e != nil {
|
|
|
+ // err = e
|
|
|
+ // fmt.Println("GetReportArticleList err:", e)
|
|
|
+ // return
|
|
|
+ // }
|
|
|
+ // for _, article := range list {
|
|
|
+ // mfyxList = append(mfyxList, article)
|
|
|
+ // }
|
|
|
+ //}
|
|
|
var articleIdStr string
|
|
|
for _, v := range mfyxList {
|
|
|
articleIdStr += strconv.Itoa(v.ArticleId) + ","
|
|
@@ -474,8 +493,8 @@ func CygxResearchSummary(cont context.Context) (err error) {
|
|
|
// }
|
|
|
// company = " <span style=\"color: #ff1720\">" + company + "</span>"
|
|
|
//}
|
|
|
- if mapArticleSubject[article.ArticleId] != ""{
|
|
|
- company = " <span style=\"color: #ff1720\">"+"#"+mapArticleSubject[article.ArticleId]+"</span>"
|
|
|
+ if mapArticleSubject[article.ArticleId] != "" {
|
|
|
+ company = " <span style=\"color: #ff1720\">" + "#" + mapArticleSubject[article.ArticleId] + "</span>"
|
|
|
}
|
|
|
var plus int
|
|
|
coreIndex := strings.Index(body, "核心观点:")
|
|
@@ -501,7 +520,7 @@ func CygxResearchSummary(cont context.Context) (err error) {
|
|
|
plus = 12
|
|
|
}
|
|
|
endIndex := strings.Index(body, "<hr")
|
|
|
- fmt.Println("ID:",article.ArticleId)
|
|
|
+ fmt.Println("ID:", article.ArticleId)
|
|
|
fmt.Println("coreIndex:", coreIndex, endIndex)
|
|
|
if coreIndex != -1 && endIndex != -1 {
|
|
|
body = body[coreIndex+plus : endIndex]
|
|
@@ -882,8 +901,8 @@ func CygxLastWeekSummary(cont context.Context) (err error) {
|
|
|
// }
|
|
|
// company = " <span style=\"color: #ff1720\">" + company + "</span>"
|
|
|
//}
|
|
|
- if mapArticleSubject[article.ArticleId] != ""{
|
|
|
- company = " <span style=\"color: #ff1720\">"+"#"+mapArticleSubject[article.ArticleId]+"</span>"
|
|
|
+ if mapArticleSubject[article.ArticleId] != "" {
|
|
|
+ company = " <span style=\"color: #ff1720\">" + "#" + mapArticleSubject[article.ArticleId] + "</span>"
|
|
|
}
|
|
|
var plus int
|
|
|
coreIndex := strings.Index(body, "核心观点:")
|
|
@@ -910,7 +929,7 @@ func CygxLastWeekSummary(cont context.Context) (err error) {
|
|
|
}
|
|
|
endIndex := strings.Index(body, "<hr")
|
|
|
if coreIndex != -1 && endIndex != -1 {
|
|
|
- body = body[coreIndex+plus:endIndex]
|
|
|
+ body = body[coreIndex+plus : endIndex]
|
|
|
logItem := data_manage.CygxMinutesSummaryLog{
|
|
|
ArticleId: int(articleId),
|
|
|
Type: "YANX",
|
|
@@ -934,4 +953,4 @@ func CygxLastWeekSummary(cont context.Context) (err error) {
|
|
|
}
|
|
|
|
|
|
return
|
|
|
-}
|
|
|
+}
|