Browse Source

no message

zhangchuanxing 2 months ago
parent
commit
d08bb3be52
1 changed files with 12 additions and 6 deletions
  1. 12 6
      services/ficc_report.go

+ 12 - 6
services/ficc_report.go

@@ -444,10 +444,11 @@ func GetFiccRreportToCygxArticle() (err error) {
 			go utils.SendAlarmMsg(fmt.Sprint("获取FICC研报到查研观向数据库中定时任务失败 ,err:", err.Error()), 2)
 		}
 	}()
+	FieldName := "宏观双周报"
 	var condition string
 	var pars []interface{}
-	modifyTime := time.Now().Add(-10 * time.Minute)
-	condition = `  AND modify_time >= ?  OR  id =   11897  `
+	modifyTime := time.Now().Add(-1 * time.Minute)
+	condition = `  AND modify_time >= ?  OR  id =   12212  `
 	pars = append(pars, modifyTime)
 	reportList, e := ficc_report.GetFiccRreportToCygxArticle(condition, pars)
 	if e != nil {
@@ -488,7 +489,8 @@ func GetFiccRreportToCygxArticle() (err error) {
 		for _, v := range listFiccReport {
 			mapFiccReport[v.ReportId] = v.ArticleId
 		}
-
+		fmt.Println(333)
+		fmt.Println("_____", mapFiccReport[11977])
 		//量不大,先这么写吧
 		for _, v := range reportList {
 			time.Sleep(1 * time.Millisecond) // 延时一秒
@@ -502,7 +504,7 @@ func GetFiccRreportToCygxArticle() (err error) {
 			item.CategoryName = utils.ZHOU_QI_NAME
 			item.Body = v.Content
 			item.Abstract = v.Abstract
-			item.FieldName = "PVC烧碱双周报"
+			item.FieldName = FieldName
 			item.CreateDate = time.Now().Format(utils.FormatDate)
 			item.PublishStatus = 1
 			item.IsReport = 1
@@ -521,16 +523,18 @@ func GetFiccRreportToCygxArticle() (err error) {
 				}
 			}
 			haveSet = true
-			item.SubCategoryName = "PVC烧碱双周报"
-			item.MatchTypeName = "PVC烧碱双周报"
+			item.SubCategoryName = FieldName
+			item.MatchTypeName = FieldName
 			if !haveSet {
 				continue
 			}
 
 			detailCategory, detailCategoryErr := models.GetCygxReportMappingCelueDetailByZhoQiCategoryName(item.SubCategoryName)
+			fmt.Println(detailCategory)
 			if detailCategoryErr != nil {
 				continue
 			}
+
 			item.CategoryId = detailCategory.CategoryId
 			item.CategoryIdTwo = detailCategory.CategoryId
 			var articleIdMax int
@@ -542,6 +546,7 @@ func GetFiccRreportToCygxArticle() (err error) {
 					return
 				}
 				articleIdMax = maxArticleIdArticleInfo.ArticleId + 1
+				fmt.Println("articleIdMax", articleIdMax)
 				item.ArticleIdMd5 = utils.MD5(strconv.Itoa(articleIdMax))
 				item.ArticleId = articleIdMax
 				_, e = models.AddCygxArticles(item)
@@ -714,6 +719,7 @@ func GetFiccReportXcxItem(user *models.WxUserItem) (itemSourceResp *models.CygxR
 
 // UpdateCygxZhouqiArticleMapTime 更新周期对应分类下所管理文章的更新时间
 func UpdateCygxZhouqiArticleMapTime(fieldName string) {
+	return
 	var err error
 	defer func() {
 		if err != nil {