Ver Fonte

no message

xingzai há 1 ano atrás
pai
commit
c3af949221

+ 1 - 0
models/cygx/report_article.go

@@ -479,6 +479,7 @@ type ArticleDetail struct {
 	IsClass              int    `description:"是否归类,1是,0否"`
 	IsSummary            int    `description:"是否是纪要库,1是,0否"`
 	CategoryId           int    `description:"分类ID"`
+	CategoryIdTwo        int    `description:"分类ID"`
 	FileLink             string `description:"下载预览链接"`
 	ReportType           int    `description:"报告类型,2产业报告,1行业报告"`
 	TypeName             string `description:"策略平台类型字段名称"`

+ 1 - 2
models/cygx/resource_data.go

@@ -28,7 +28,6 @@ func GetCygxResourceDataListBysource(source string) (items []*CygxResourceData,
 
 // 添加
 func AddCygxResourceData(item *CygxResourceData) (lastId int64, err error) {
-	return
 	o := orm.NewOrmUsingDB("hz_cygx")
 	lastId, err = o.Insert(item)
 	return
@@ -54,7 +53,7 @@ func UpdateResourceData(sourceId int, source, publishDate string) (err error) {
 func UpdateResourceDataByItem(item *CygxResourceData) (err error) {
 	o := orm.NewOrmUsingDB("hz_cygx")
 	updateParams := make(map[string]interface{})
-	//updateParams["PublishDate"] = item.PublishDate
+	updateParams["PublishDate"] = item.PublishDate
 	updateParams["SearchTag"] = item.SearchTag
 	updateParams["ChartPermissionId"] = item.ChartPermissionId
 	ptrStructOrTableName := "cygx_resource_data"

+ 43 - 38
services/cygx/resource_data.go

@@ -1024,7 +1024,7 @@ func UpdateMicroRoadshowResourceData(sourceId int) {
 	return
 }
 
-func init213() {
+func init23() {
 	//var condition string
 	//var pars []interface{}
 	//
@@ -1093,43 +1093,48 @@ func init213() {
 	//	}
 	//}
 
-	{
-		//文章//12.4
-		list, err := cygx.GetCygxResourceDataListBysource(utils.CYGX_OBJ_ARTICLE)
-		if err != nil {
-			fmt.Println(err)
-			return
-		}
-		for _, v := range list {
-			detail, e := cygx.GetArticleDetailByArticleId(v.SourceId)
-			if e != nil {
-				err = errors.New("GetCygxReportSelectionInfoById, Err: " + e.Error())
-				fmt.Println(err)
-				return
-			}
-
-			item := new(cygx.CygxResourceData)
-			if detail.ArticleTypeId > 0 {
-				//item.SearchTag = detail.ArticleTypeName // 研选类型名称
-				item.ChartPermissionId = utils.CHART_PERMISSION_ID_YANXUAN
-			} else {
-				//item.SearchTag = detail.MatchTypeName
-				//获取文章分类详情
-				detailCategory, _ := cygx.GetCygxReportMappingCelueMaxDetailByCategoryId(detail.CategoryId)
-				if detailCategory != nil {
-					item.ChartPermissionId = detailCategory.ChartPermissionId
-				}
-			}
-			item.SourceId = v.SourceId
-			item.Source = utils.CYGX_OBJ_ARTICLE
-			fmt.Println(v.Source)
-			err = cygx.UpdateChartPermissionIdResourceDataByItem(item)
-			if err != nil {
-				fmt.Println(err)
-				return
-			}
-		}
-	}
+	//{
+	//	//文章//12.4
+	//	list, err := cygx.GetCygxResourceDataListBysource(utils.CYGX_OBJ_ARTICLE)
+	//	if err != nil {
+	//		fmt.Println(err)
+	//		return
+	//	}
+	//	for _, v := range list {
+	//		detail, e := cygx.GetArticleDetailByArticleId(v.SourceId)
+	//		if e != nil {
+	//			err = errors.New("GetCygxReportSelectionInfoById, Err: " + e.Error())
+	//			fmt.Println(err)
+	//			return
+	//		}
+	//
+	//		item := new(cygx.CygxResourceData)
+	//		if detail.ArticleTypeId > 0 {
+	//			//item.SearchTag = detail.ArticleTypeName // 研选类型名称
+	//			item.ChartPermissionId = utils.CHART_PERMISSION_ID_YANXUAN
+	//		} else {
+	//			//item.SearchTag = detail.MatchTypeName
+	//			//获取文章分类详情
+	//			detailCategory, _ := cygx.GetCygxReportMappingCelueMaxDetailByCategoryId(detail.CategoryId)
+	//			if detailCategory != nil {
+	//				item.ChartPermissionId = detailCategory.ChartPermissionId
+	//			}else{
+	//				detailCategoryTwo, _ := cygx.GetCygxReportMappingCelueMaxDetailByCategoryId(detail.CategoryIdTwo)
+	//				if detailCategoryTwo != nil {
+	//					item.ChartPermissionId = detailCategoryTwo.ChartPermissionId
+	//				}
+	//			}
+	//		}
+	//		item.SourceId = v.SourceId
+	//		item.Source = utils.CYGX_OBJ_ARTICLE
+	//		fmt.Println(v.Source)
+	//		err = cygx.UpdateChartPermissionIdResourceDataByItem(item)
+	//		if err != nil {
+	//			fmt.Println(err)
+	//			return
+	//		}
+	//	}
+	//}
 
 	//{
 	//	//产品内测