浏览代码

no message

xingzai 1 年之前
父节点
当前提交
7ebb6b8a8c
共有 6 个文件被更改,包括 62 次插入34 次删除
  1. 0 4
      controllers/tag.go
  2. 25 0
      models/article_category_mapping.go
  3. 17 17
      models/cygx_tag.go
  4. 10 9
      models/resource_data.go
  5. 5 4
      services/article.go
  6. 5 0
      services/resource_data.go

+ 0 - 4
controllers/tag.go

@@ -49,19 +49,15 @@ func (this *TagController) TagCustomizeList() {
 	list, err := models.GetCygxTagList(condition)
 	for _, v := range list {
 		if v.ArticleTypes != "" {
-			v.Atag = true
 			v.CheckList = append(v.CheckList, "A")
 		}
 		if v.ActivityTypes != "" {
-			v.Btag = true
 			v.CheckList = append(v.CheckList, "B")
 		}
 		if v.Industries != "" {
-			v.Ctag = true
 			v.CheckList = append(v.CheckList, "C")
 		}
 		if v.SubjectNames != "" {
-			v.Dtag = true
 			v.CheckList = append(v.CheckList, "D")
 		}
 	}

+ 25 - 0
models/article_category_mapping.go

@@ -2,6 +2,7 @@ package models
 
 import (
 	"github.com/beego/beego/v2/client/orm"
+	"time"
 	//"time"
 )
 
@@ -79,3 +80,27 @@ func GetCygxReportMappingCygxByCategoryId(categoryId int) (item *CygxReportMappi
 	err = o.Raw(sql, categoryId).QueryRow(&item)
 	return
 }
+
+type CygxReportMappingCelue struct {
+	Id                  int       `orm:"column(id);pk" description:"id"`
+	ChartPermissionId   int       `description:"行业ID"`
+	CategoryId          int       `description:"分类ID"`
+	ChartPermissionName string    `description:"行业名称"`
+	SubCategoryName     string    `description:"主题"`
+	ReportType          int       `description:"报告类型,2产业报告,1行业报告"`
+	Sort                int       `description:"排序"`
+	IsCustom            int       `description:"是否属于自定义的匹配类型 ,1是,0否"`
+	IsSummary           int       `description:"是否是纪要库,1是,0否"`
+	IsReport            int       `description:"是否是报告,1是,0否"`
+	PermissionType      int       `description:"1主观,2客观"`
+	CreateTime          time.Time `description:"创建时间"`
+	ModifyTime          time.Time `description:"更新时间"`
+}
+
+// 通过 categoryId 获取详情
+func GetCygxReportMappingCelueMaxDetailByCategoryId(categoryId int) (item *CygxReportMappingCelue, err error) {
+	o := orm.NewOrm()
+	sql := `SELECT  * FROM cygx_report_mapping_celue  WHERE  category_id = ?  LIMIT 1 `
+	err = o.Raw(sql, categoryId).QueryRow(&item)
+	return
+}

+ 17 - 17
models/cygx_tag.go

@@ -27,23 +27,23 @@ func (m *CygxTag) Update(cols []string) (err error) {
 }
 
 type CygxTagList struct {
-	TagId         int64    `orm:"column(tag_id);pk"`
-	TagName       string   `orm:"column(tag_name);NOT NULL"`       // 标签名
-	ArticleTypes  string   `orm:"column(article_types);NOT NULL"`  // 报告系列
-	ActivityTypes string   `orm:"column(activity_types);NOT NULL"` // 活动类型
-	Industries    string   `orm:"column(industries);NOT NULL"`     // 产业
-	SubjectNames  string   `orm:"column(subject_names);NOT NULL"`  // 标的
-	Sort          int      `orm:"column(sort);"`                   // 优先级
-	ModifyTime    string   `orm:"column(modify_time)"`             // 修改时间
-	CreateTime    string   `orm:"column(create_time)"`             // 创建时间
-	OnlineTime    string   `orm:"column(online_time)"`             // 上线时间
-	OfflineTime   string   `orm:"column(offline_time)"`            // 下线时间
-	Status        int      `orm:"column(status);NOT NULL"`         // 状态:0-禁用 1-启用
-	Atag          bool     // A标签是否有值
-	Btag          bool     // A标签是否有值
-	Ctag          bool     // A标签是否有值
-	Dtag          bool     // A标签是否有值
-	CheckList     []string // ABCD勾选了哪几列
+	TagId         int64  `orm:"column(tag_id);pk"`
+	TagName       string `orm:"column(tag_name);NOT NULL"`       // 标签名
+	ArticleTypes  string `orm:"column(article_types);NOT NULL"`  // 报告系列
+	ActivityTypes string `orm:"column(activity_types);NOT NULL"` // 活动类型
+	Industries    string `orm:"column(industries);NOT NULL"`     // 产业
+	SubjectNames  string `orm:"column(subject_names);NOT NULL"`  // 标的
+	Sort          int    `orm:"column(sort);"`                   // 优先级
+	ModifyTime    string `orm:"column(modify_time)"`             // 修改时间
+	CreateTime    string `orm:"column(create_time)"`             // 创建时间
+	OnlineTime    string `orm:"column(online_time)"`             // 上线时间
+	OfflineTime   string `orm:"column(offline_time)"`            // 下线时间
+	Status        int    `orm:"column(status);NOT NULL"`         // 状态:0-禁用 1-启用
+	//Atag          bool     // A标签是否有值
+	//Btag          bool     // A标签是否有值
+	//Ctag          bool     // A标签是否有值
+	//Dtag          bool     // A标签是否有值
+	CheckList []string // ABCD勾选了哪几列
 }
 
 type CygxTagListResp struct {

+ 10 - 9
models/resource_data.go

@@ -7,15 +7,16 @@ import (
 )
 
 type CygxResourceData struct {
-	Id          int       `orm:"column(id);pk"`
-	SourceId    int       `description:"资源ID"`
-	Source      string    `description:"资源类型 报告 :article 、图表 :newchart、微路演 :roadshow、活动 :activity、活动视频:activityvideo、活动音频:activityvoice、专项调研活动:activityspecial"`
-	Title       string    `description:"标题"`
-	Annotation  string    `description:"核心观点"`
-	CreateTime  time.Time `description:"创建时间"`
-	PublishDate string    `description:"发布时间"`
-	Abstract    string    `description:"摘要"`
-	SearchTag   string    `description:"搜索标签"`
+	Id                int       `orm:"column(id);pk"`
+	ChartPermissionId int       `description:"行业ID"`
+	SourceId          int       `description:"资源ID"`
+	Source            string    `description:"资源类型 报告 :article 、图表 :newchart、微路演 :roadshow、活动 :activity、活动视频:activityvideo、活动音频:activityvoice、专项调研活动:activityspecial"`
+	Title             string    `description:"标题"`
+	Annotation        string    `description:"核心观点"`
+	CreateTime        time.Time `description:"创建时间"`
+	PublishDate       string    `description:"发布时间"`
+	Abstract          string    `description:"摘要"`
+	SearchTag         string    `description:"搜索标签"`
 }
 
 type CygxResourceDataResp struct {

+ 5 - 4
services/article.go

@@ -709,10 +709,11 @@ func GetArticleListByApi(cont context.Context) (err error) {
 //	//		HandleArticleListByApi(v.ArticleId)
 //	//	}
 //
-//	for i := 8648; i < 9004; i++ {
-//		HandleArticleListByApi(i)
-//	}
-//
+//	//for i := 8648; i < 9004; i++ {
+//	//	HandleArticleListByApi(9552)
+//	//}
+//	HandleArticleListByApi(9551)
+//	//UpdateArticleResourceData(9551)
 //}
 
 // 处理同步过来的文章

+ 5 - 0
services/resource_data.go

@@ -583,6 +583,11 @@ func UpdateArticleResourceData(sourceId int) {
 			item.SearchTag = detail.ArticleTypeName // 研选类型名称
 		} else {
 			item.SearchTag = detail.MatchTypeName
+			//获取文章分类详情
+			detailCategory, _ := models.GetCygxReportMappingCelueMaxDetailByCategoryId(detail.CategoryId)
+			if detailCategory != nil {
+				item.ChartPermissionId = detailCategory.ChartPermissionId
+			}
 		}
 		item.SourceId = sourceId
 		item.Source = source