|
@@ -672,7 +672,7 @@ func GetArticleListByApi(cont context.Context) (err error) {
|
|
|
}
|
|
|
|
|
|
//func init() {
|
|
|
-// HandleArticleListByApi(7507)
|
|
|
+// HandleArticleListByApi(5978)
|
|
|
//}
|
|
|
|
|
|
//处理同步过来的文章
|
|
@@ -768,6 +768,7 @@ func HandleArticleListByApi(artcleId int) (err error) {
|
|
|
item.Annotation = articleResult.Content.Annotation
|
|
|
item.CategoryName = articleResult.Industry.Name
|
|
|
item.CategoryId = exitMap[articleResult.SeriesId]
|
|
|
+ item.CategoryIdTwo = exitMap[articleResult.SeriesId]
|
|
|
item.SubCategoryName = articleResult.Series.Name
|
|
|
if len(articleResult.Stock) > 0 {
|
|
|
var stock string
|
|
@@ -778,6 +779,7 @@ func HandleArticleListByApi(artcleId int) (err error) {
|
|
|
item.Stock = stock
|
|
|
}
|
|
|
item.FieldName = articleResult.Field.Name
|
|
|
+ item.TypeName = articleResult.Type.Name
|
|
|
list = append(list, item)
|
|
|
itemAuthor.ArticleId = articleResult.ArticleId
|
|
|
itemAuthor.Name = articleResult.Author.Name
|
|
@@ -894,6 +896,16 @@ func HandleArticleListByApi(artcleId int) (err error) {
|
|
|
if v.CategoryId == 80 {
|
|
|
titleNew = v.Title + utils.WeekByDate(v.PublishDate)
|
|
|
}
|
|
|
+
|
|
|
+ //类型是综述报告的,不区分是什么系列,统一归类到对应产业的路演精华
|
|
|
+ if articleResult.Type.Name == "综述报告" {
|
|
|
+ detailCategory, err := models.GetdetailByCategoryIdLyjh(v.CategoryIdTwo)
|
|
|
+ if err != nil && err.Error() != utils.ErrNoRow() {
|
|
|
+ return err
|
|
|
+ }
|
|
|
+ v.CategoryId = detailCategory.CategoryId
|
|
|
+ }
|
|
|
+
|
|
|
if count > 0 {
|
|
|
fmt.Println(k, v.ArticleId, "edit")
|
|
|
var isCustom bool
|
|
@@ -936,6 +948,7 @@ func HandleArticleListByApi(artcleId int) (err error) {
|
|
|
updateParams["Stock"] = v.Stock
|
|
|
updateParams["FieldName"] = v.FieldName
|
|
|
updateParams["Annotation"] = v.Annotation
|
|
|
+ updateParams["TypeName"] = v.TypeName
|
|
|
whereParam := map[string]interface{}{"article_id": v.ArticleId}
|
|
|
err = models.UpdateByExpr(models.CygxArticle{}, whereParam, updateParams)
|
|
|
if err != nil {
|
|
@@ -959,7 +972,7 @@ func HandleArticleListByApi(artcleId int) (err error) {
|
|
|
item.CategoryName = v.CategoryName
|
|
|
item.SubCategoryName = v.SubCategoryName
|
|
|
item.CategoryId = v.CategoryId
|
|
|
- item.CategoryIdTwo = v.CategoryId
|
|
|
+ item.CategoryIdTwo = v.CategoryIdTwo
|
|
|
item.PublishStatus = 1
|
|
|
item.ExpertBackground = expertContentStr
|
|
|
item.ExpertNumber = expertNumStr
|
|
@@ -975,6 +988,7 @@ func HandleArticleListByApi(artcleId int) (err error) {
|
|
|
item.Stock = v.Stock
|
|
|
item.FieldName = v.FieldName
|
|
|
item.Annotation = v.Annotation
|
|
|
+ item.TypeName = v.TypeName
|
|
|
newId, err := models.AddCygxArticles(item)
|
|
|
if err != nil {
|
|
|
fmt.Println("AddCygxArticle Err:", err.Error())
|