|
@@ -45,9 +45,9 @@ type ElasticComprehensiveDetail struct {
|
|
|
SubjectNames string `description:"标的名称"`
|
|
|
}
|
|
|
|
|
|
-//func init() {
|
|
|
-// AddComprehensiveRoadshow()
|
|
|
-//}
|
|
|
+func init() {
|
|
|
+ AddComprehensiveIndustrialSource("Yx", 0)
|
|
|
+}
|
|
|
|
|
|
// 添加文章:报告、纪要
|
|
|
func AddComprehensiveArticle(articleId int) {
|
|
@@ -128,12 +128,12 @@ func AddComprehensiveChart(chartId int) {
|
|
|
}
|
|
|
|
|
|
// 添加产业资源包
|
|
|
-func AddComprehensiveIndustrialSource() {
|
|
|
+func AddComprehensiveIndustrialSource(sourceType string, articleId int) {
|
|
|
var err error
|
|
|
defer func() {
|
|
|
if err != nil {
|
|
|
fmt.Println(err)
|
|
|
- go utils.SendAlarmMsg("删除数据综合页面数据Es失败"+err.Error(), 2)
|
|
|
+ go utils.SendAlarmMsg("AddComprehensiveIndustrialSource"+err.Error(), 2)
|
|
|
}
|
|
|
}()
|
|
|
var condition string
|
|
@@ -147,6 +147,17 @@ func AddComprehensiveIndustrialSource() {
|
|
|
for _, v := range listsubject {
|
|
|
mapActivitySubject[v.IndustrialManagementId] = append(mapActivitySubject[v.IndustrialManagementId], v.SubjectName)
|
|
|
}
|
|
|
+ var industrialsource string
|
|
|
+ if sourceType == "Hz" {
|
|
|
+ condition = " AND a.article_type_id = 0 " // 弘则资源包
|
|
|
+ industrialsource = "industrialsourceHz"
|
|
|
+ } else {
|
|
|
+ condition = " AND a.article_type_id > 0 " //研选资源包
|
|
|
+ industrialsource = "industrialsourceYx"
|
|
|
+ }
|
|
|
+ if articleId > 0 {
|
|
|
+ condition += " AND a.article_id = " + strconv.Itoa(articleId)
|
|
|
+ }
|
|
|
list, err := models.GetSearchResourceList(0, condition, 0, 0)
|
|
|
if err != nil {
|
|
|
fmt.Println(err)
|
|
@@ -156,7 +167,7 @@ func AddComprehensiveIndustrialSource() {
|
|
|
for _, v := range list {
|
|
|
item := new(ElasticComprehensiveDetail)
|
|
|
item.SourceId = v.IndustrialManagementId
|
|
|
- item.Source = "industrialsource"
|
|
|
+ item.Source = industrialsource
|
|
|
item.IndustryName = v.IndustryName
|
|
|
item.SubjectNames = strings.Join(mapActivitySubject[v.IndustrialManagementId], ",")
|
|
|
item.PublishDate = v.PublishDate
|