Ver código fonte

Merge branch 'cygx_v2' of hongze/hongze_cygx into master

hongze 4 anos atrás
pai
commit
56ce2cc6d6

+ 1 - 0
controllers/article.go

@@ -64,6 +64,7 @@ func (this *ArticleController) Detail() {
 			return
 			return
 		}
 		}
 		detail, err = models.GetArticleDetailById(articleId)
 		detail, err = models.GetArticleDetailById(articleId)
+		services.BodyAnalysis2(detail.Body)
 		if err != nil {
 		if err != nil {
 			br.Msg = "获取信息失败"
 			br.Msg = "获取信息失败"
 			br.ErrMsg = "获取信息失败,Err:" + err.Error()
 			br.ErrMsg = "获取信息失败,Err:" + err.Error()

+ 9 - 2
controllers/report.go

@@ -43,7 +43,8 @@ func (this *ReportController) TradeList() {
 		br.Msg = "请输入分类ID"
 		br.Msg = "请输入分类ID"
 		return
 		return
 	}
 	}
-	list, err := models.GetTradeAll(uid, ChartPermissionId)
+	fmt.Println(uid)
+	list, err := models.GetTradeAll(ChartPermissionId)
 	if err != nil {
 	if err != nil {
 		br.Msg = "获取信息失败"
 		br.Msg = "获取信息失败"
 		br.ErrMsg = "获取品种信息失败,Err:" + err.Error()
 		br.ErrMsg = "获取品种信息失败,Err:" + err.Error()
@@ -51,7 +52,13 @@ func (this *ReportController) TradeList() {
 	}
 	}
 	for k, v := range list {
 	for k, v := range list {
 		list[k].UpdateTime = utils.TimeRemoveHms(v.UpdateTime)
 		list[k].UpdateTime = utils.TimeRemoveHms(v.UpdateTime)
-		if v.Readnum == 0 {
+		count, err := models.CheckThisCategoryNewArticleIsRead(uid, v.CategoryId)
+		if err != nil {
+			br.Msg = "获取信息失败"
+			br.Msg = "获取帖子总数失败,Err:" + err.Error()
+			return
+		}
+		if count == 0 {
 			list[k].IsRed = true
 			list[k].IsRed = true
 		}
 		}
 	}
 	}

+ 16 - 7
controllers/search.go

@@ -99,14 +99,23 @@ func (this *SearchController) SearchList() {
 	if len(result) == 0 {
 	if len(result) == 0 {
 		result = make([]*models.SearchItem, 0)
 		result = make([]*models.SearchItem, 0)
 	}
 	}
-	{
-		keyWordItem := new(models.CygxSearchKeyWord)
-		keyWordItem.UserId = user.UserId
-		keyWordItem.KeyWord = keyWord
-		keyWordItem.CreateTime = time.Now()
-		go models.AddSearchKeyWord(keyWordItem)
+	detail, errKey := models.GetNewSearchKeyWordByThisUser(user.UserId, keyWord)
+	if errKey != nil && errKey.Error() != utils.ErrNoRow() {
+		br.Msg = "获取信息失败"
+		br.ErrMsg = "获取信息失败,Err:" + errKey.Error()
+		return
+	}
+	//同一个用户一分钟之内搜索的词不重复记录
+	if detail == nil || time.Now().Before(detail.CreateTime.Add(-time.Minute*1)) {
+		//fmt.Println("一分钟之内没有搜索")
+		{
+			keyWordItem := new(models.CygxSearchKeyWord)
+			keyWordItem.UserId = user.UserId
+			keyWordItem.KeyWord = keyWord
+			keyWordItem.CreateTime = time.Now()
+			go models.AddSearchKeyWord(keyWordItem)
+		}
 	}
 	}
-	fmt.Println(len(result))
 	resp := new(models.SearchResp)
 	resp := new(models.SearchResp)
 	page := paging.GetPaging(currentIndex, pageSize, int(total))
 	page := paging.GetPaging(currentIndex, pageSize, int(total))
 	resp.Paging = page
 	resp.Paging = page

+ 14 - 0
models/article.go

@@ -28,6 +28,7 @@ type CygxArticle struct {
 	IsSummary        int    `description:"是否是纪要库,1是,0否"`
 	IsSummary        int    `description:"是否是纪要库,1是,0否"`
 	IsReport         int    `description:"是否属于报告,1是,0否"`
 	IsReport         int    `description:"是否属于报告,1是,0否"`
 	ReportType       int    `description:"报告类型,1行业报告,2产业报告,0无"`
 	ReportType       int    `description:"报告类型,1行业报告,2产业报告,0无"`
+	FileLink         string `description:"下载预览链接"`
 }
 }
 
 
 //新增文章
 //新增文章
@@ -75,6 +76,7 @@ type ArticleDetail struct {
 	ArticleIdMd5         string `description:"纪要id"`
 	ArticleIdMd5         string `description:"纪要id"`
 	IsClass              int    `description:"是否归类,1是,0否"`
 	IsClass              int    `description:"是否归类,1是,0否"`
 	CategoryId           int    `description:"分类ID"`
 	CategoryId           int    `description:"分类ID"`
+	FileLink             string `description:"下载预览链接"`
 	SellerList           []*SellerRep
 	SellerList           []*SellerRep
 }
 }
 
 
@@ -317,3 +319,15 @@ func GetUserIsReadThisNewCategoryArticleCount(categoryId, uid int) (count int, e
 	err = o.Raw(sqlCount, categoryId, uid).QueryRow(&count)
 	err = o.Raw(sqlCount, categoryId, uid).QueryRow(&count)
 	return
 	return
 }
 }
+
+type ArticleId struct {
+	ArticleId int `description:"文章id"`
+}
+
+//获取自定义分类的文章ID
+func GetCustomArticleId() (item []*ArticleId, err error) {
+	o := orm.NewOrm()
+	sql := ` SELECT article_id  FROM cygx_article WHERE is_custom = 1 `
+	_, err = o.Raw(sql).QueryRows(&item)
+	return
+}

+ 29 - 14
models/report_mapping.go

@@ -67,22 +67,26 @@ ORDER BY
 }
 }
 
 
 //行业列表
 //行业列表
-func GetTradeAll(uid, ChartPermissionId int) (items []*TradeReportMapping, err error) {
+func GetTradeAll(ChartPermissionId int) (items []*TradeReportMapping, err error) {
 	o := orm.NewOrm()
 	o := orm.NewOrm()
-	//sql := `SELECT * FROM cygx_report_mapping WHERE chart_permission_id = ? AND report_type = 1;`
 	sql := `SELECT
 	sql := `SELECT
-	art.article_id,art.publish_date as update_time ,re.category_id,re.sub_category_name,( SELECT COUNT( 1 ) FROM  cygx_article_history_record AS rec WHERE rec.user_id = ? AND rec.article_id = art.article_id ) AS readnum
-	FROM
-		cygx_report_mapping  as re
-        INNER JOIN cygx_article  as art ON re.category_id = art.category_id
-	WHERE
-	re.chart_permission_id = ?
-	AND re.report_type = 1
-	AND art.is_class = 1
-	AND re.chart_permission_id != 21
-	ORDER BY art.publish_date DESC
-	LIMIT 0,1`
-	_, err = o.Raw(sql, uid, ChartPermissionId).QueryRows(&items)
+		MAX( art.publish_date ) AS update_time,
+		re.category_id,
+		re.sub_category_name,
+		re.match_type_name 
+		FROM
+		cygx_report_mapping AS re
+		INNER JOIN cygx_article AS art ON re.category_id = art.category_id 
+		WHERE
+		re.chart_permission_id =? 
+		AND re.report_type = 1 
+		AND art.is_class = 1 
+		AND re.category_id NOT IN (67)
+		GROUP BY
+		art.category_id 
+		ORDER BY
+		update_time DESC`
+	_, err = o.Raw(sql, ChartPermissionId).QueryRows(&items)
 	return
 	return
 }
 }
 
 
@@ -106,3 +110,14 @@ func GetdetailByCategoryId(categoryId int) (item *ReportMapping, err error) {
 	err = o.Raw(sql, categoryId).QueryRow(&item)
 	err = o.Raw(sql, categoryId).QueryRow(&item)
 	return
 	return
 }
 }
+
+//判断该分类下最新的文章用户是否阅读
+func CheckThisCategoryNewArticleIsRead(uid, categoryId int) (count int, err error) {
+	o := orm.NewOrm()
+	sql := `SELECT COUNT(1) count
+			FROM cygx_article_history_record 
+			WHERE user_id = ? 
+			AND article_id = ( SELECT article_id FROM	cygx_article WHERE	category_id = ? 	AND is_class = 1 	AND is_report = 1 	AND is_filter = 0 ORDER BY publish_date DESC LIMIT 1)`
+	err = o.Raw(sql, uid, categoryId).QueryRow(&count)
+	return
+}

+ 8 - 0
models/search_key_word.go

@@ -18,3 +18,11 @@ func AddSearchKeyWord(item *CygxSearchKeyWord) (lastId int64, err error) {
 	lastId, err = o.Insert(item)
 	lastId, err = o.Insert(item)
 	return
 	return
 }
 }
+
+//获取用户搜索这个关键词的最新时间
+func GetNewSearchKeyWordByThisUser(uid int, keyWord string) (item *CygxSearchKeyWord, err error) {
+	o := orm.NewOrm()
+	sql := `SELECT * FROM cygx_search_key_word WHERE user_id = ? AND key_word = ? ORDER BY id DESC LIMIT 1 `
+	err = o.Raw(sql, uid, keyWord).QueryRow(&item)
+	return
+}

+ 175 - 11
services/tactics.go

@@ -6,6 +6,7 @@ import (
 	"hongze/hongze_cygx/models"
 	"hongze/hongze_cygx/models"
 	"hongze/hongze_cygx/utils"
 	"hongze/hongze_cygx/utils"
 	"html"
 	"html"
+	"regexp"
 	"strconv"
 	"strconv"
 	"strings"
 	"strings"
 	"time"
 	"time"
@@ -298,15 +299,14 @@ func SyncTacticsListAddreport() (err error) {
 		fmt.Println("GetTacticsList Err:", err.Error())
 		fmt.Println("GetTacticsList Err:", err.Error())
 		return
 		return
 	}
 	}
+	listCustomArticle, err := models.GetCustomArticleId() //手动归类的文章,不替换文章类型
+	if err != nil {
+		fmt.Println("GetTacticsList Err:", err.Error())
+		return
+	}
 	fmt.Println("list len:", len(list))
 	fmt.Println("list len:", len(list))
-
 	summaryCategoryIds := "28,32,45,50,57,62,72,74,79,84,86,88,90,95,96" //纪要库的文章类型categoty_id
 	summaryCategoryIds := "28,32,45,50,57,62,72,74,79,84,86,88,90,95,96" //纪要库的文章类型categoty_id
 	listSummary := strings.Split(summaryCategoryIds, ",")
 	listSummary := strings.Split(summaryCategoryIds, ",")
-	//listSummary, errsu := models.GetReportMappingCategoryID()
-	//if errsu != nil {
-	//	fmt.Println("GetTacticsList Err:", errsu.Error())
-	//	return
-	//}
 	noSummaryArticleIds := "3454,3456,3457,3459,2449,2450,2453,2454,2459,2530,2583,2663,2670,2699,2715,2732,2748,2759,2399,2356,2870,3173,2978,2826,3470" //非纪要库类型的文章ID
 	noSummaryArticleIds := "3454,3456,3457,3459,2449,2450,2453,2454,2459,2530,2583,2663,2670,2699,2715,2732,2748,2759,2399,2356,2870,3173,2978,2826,3470" //非纪要库类型的文章ID
 	listNoSummaryArticleIds := strings.Split(noSummaryArticleIds, ",")
 	listNoSummaryArticleIds := strings.Split(noSummaryArticleIds, ",")
 	listPermission, errper := models.GetPermissionMappingCategoryID()
 	listPermission, errper := models.GetPermissionMappingCategoryID()
@@ -345,7 +345,7 @@ func SyncTacticsListAddreport() (err error) {
 			}
 			}
 		}
 		}
 		v.Department = "弘则权益研究"
 		v.Department = "弘则权益研究"
-		fmt.Println(k, v.ArticleId)
+		//fmt.Println(k, v.ArticleId)
 		hh, _ := time.ParseDuration("8h")
 		hh, _ := time.ParseDuration("8h")
 		//pDate := publishDate.Add(hh)
 		//pDate := publishDate.Add(hh)
 		v.PublishDate = v.PublishDate.Add(hh)
 		v.PublishDate = v.PublishDate.Add(hh)
@@ -360,7 +360,15 @@ func SyncTacticsListAddreport() (err error) {
 			return err
 			return err
 		}
 		}
 		v.Body = strings.Replace(v.Body, "http://vmp.hzinsights.com", "https://vmp.hzinsights.com", -1)
 		v.Body = strings.Replace(v.Body, "http://vmp.hzinsights.com", "https://vmp.hzinsights.com", -1)
-		expertNumStr, expertContentStr, interviewDateStr := BodyAnalysis(v.Body)
+
+		expertNumStr, expertContentStr, interviewDateStr, fileLink, bodyReturn := BodyAnalysis2(v.Body)
+
+		if strings.Index(v.Body, "报告全文(") > 0 && strings.Index(v.Body, "PDF格式报告下载.pdf") > 0 {
+			v.Body = strings.Replace(v.Body, "报告全文(", "", -1)
+			v.Body = strings.Replace(v.Body, "PDF格式报告下载.pdf", "", -1)
+			v.Body = strings.Replace(v.Body, "):", "", -1)
+		}
+		//fmt.Println(fileLink)
 		var titleNew string
 		var titleNew string
 		titleNew = v.Title
 		titleNew = v.Title
 		// 7资金流向 、11大类资产 、51每日复盘 、80医药周报、9估值研究
 		// 7资金流向 、11大类资产 、51每日复盘 、80医药周报、9估值研究
@@ -374,8 +382,11 @@ func SyncTacticsListAddreport() (err error) {
 		if v.CategoryId == 80 {
 		if v.CategoryId == 80 {
 			titleNew = v.Title + utils.WeekByDate(v.PublishDate)
 			titleNew = v.Title + utils.WeekByDate(v.PublishDate)
 		}
 		}
+		//fmt.Println(k)
+		//fmt.Println(expertContentStr)
 		if count > 0 {
 		if count > 0 {
 			fmt.Println(k, v.ArticleId, "edit")
 			fmt.Println(k, v.ArticleId, "edit")
+			var isCustom bool
 			bodyText, _ := GetReportContentTextSub(v.Body)
 			bodyText, _ := GetReportContentTextSub(v.Body)
 			updateParams := make(map[string]interface{})
 			updateParams := make(map[string]interface{})
 			//updateParams["Title"] = v.Title
 			//updateParams["Title"] = v.Title
@@ -384,12 +395,22 @@ func SyncTacticsListAddreport() (err error) {
 			updateParams["UpdateFrequency"] = v.UpdateFrequency
 			updateParams["UpdateFrequency"] = v.UpdateFrequency
 			updateParams["CreateDate"] = v.CreateDate
 			updateParams["CreateDate"] = v.CreateDate
 			updateParams["PublishDate"] = v.PublishDate
 			updateParams["PublishDate"] = v.PublishDate
-			updateParams["Body"] = html.EscapeString(v.Body)
+			//updateParams["Body"] = html.EscapeString(v.Body)
+			updateParams["Body"] = html.EscapeString(bodyReturn)
 			updateParams["BodyText"] = bodyText
 			updateParams["BodyText"] = bodyText
 			updateParams["Abstract"] = html.EscapeString(v.Abstract)
 			updateParams["Abstract"] = html.EscapeString(v.Abstract)
 			updateParams["CategoryName"] = v.CategoryName
 			updateParams["CategoryName"] = v.CategoryName
 			updateParams["SubCategoryName"] = v.SubCategoryName
 			updateParams["SubCategoryName"] = v.SubCategoryName
-			updateParams["CategoryId"] = v.CategoryId
+			for _, vCustom := range listCustomArticle {
+				if v.ArticleId == vCustom.ArticleId {
+					fmt.Println("手动归类的文章:" + strconv.Itoa(v.ArticleId))
+					isCustom = true
+				}
+			}
+			if isCustom == false {
+				updateParams["CategoryId"] = v.CategoryId
+			}
+			//updateParams["CategoryId"] = v.CategoryId
 			updateParams["PublishStatus"] = v.PublishStatus
 			updateParams["PublishStatus"] = v.PublishStatus
 			updateParams["ExpertBackground"] = expertContentStr
 			updateParams["ExpertBackground"] = expertContentStr
 			updateParams["ExpertNumber"] = expertNumStr
 			updateParams["ExpertNumber"] = expertNumStr
@@ -402,6 +423,7 @@ func SyncTacticsListAddreport() (err error) {
 				v.Department = "弘则权益研究"
 				v.Department = "弘则权益研究"
 			}
 			}
 			updateParams["Department"] = v.Department
 			updateParams["Department"] = v.Department
+			updateParams["FileLink"] = fileLink
 			whereParam := map[string]interface{}{"article_id": v.ArticleId}
 			whereParam := map[string]interface{}{"article_id": v.ArticleId}
 			err = models.UpdateByExpr(models.CygxArticle{}, whereParam, updateParams)
 			err = models.UpdateByExpr(models.CygxArticle{}, whereParam, updateParams)
 			if err != nil {
 			if err != nil {
@@ -418,7 +440,8 @@ func SyncTacticsListAddreport() (err error) {
 			item.UpdateFrequency = v.UpdateFrequency
 			item.UpdateFrequency = v.UpdateFrequency
 			item.CreateDate = v.CreateDate
 			item.CreateDate = v.CreateDate
 			item.PublishDate = v.PublishDate.Format(utils.FormatDateTime)
 			item.PublishDate = v.PublishDate.Format(utils.FormatDateTime)
-			item.Body = html.EscapeString(v.Body)
+			//item.Body = html.EscapeString(v.Body)
+			item.Body = html.EscapeString(bodyReturn)
 			item.Abstract = html.EscapeString(v.Abstract)
 			item.Abstract = html.EscapeString(v.Abstract)
 			item.CategoryName = v.CategoryName
 			item.CategoryName = v.CategoryName
 			item.SubCategoryName = v.SubCategoryName
 			item.SubCategoryName = v.SubCategoryName
@@ -433,6 +456,7 @@ func SyncTacticsListAddreport() (err error) {
 			item.IsSummary = v.IsSummary
 			item.IsSummary = v.IsSummary
 			item.IsReport = v.IsReport
 			item.IsReport = v.IsReport
 			item.ReportType = v.ReportType
 			item.ReportType = v.ReportType
+			item.FileLink = fileLink
 			_, err = models.AddCygxArticles(item)
 			_, err = models.AddCygxArticles(item)
 			if err != nil {
 			if err != nil {
 				fmt.Println("AddCygxArticle Err:", err.Error())
 				fmt.Println("AddCygxArticle Err:", err.Error())
@@ -511,3 +535,143 @@ func SyncTacticsListToEs() (err error) {
 	}
 	}
 	return
 	return
 }
 }
+
+//body 解析
+func BodyAnalysis2(body string) (expertNumStr, expertContentStr, interviewDateStr, fileLink, bodyReturn string) {
+	body = html.UnescapeString(body)
+	//fmt.Println(body)
+	doc, err := goquery.NewDocumentFromReader(strings.NewReader(body))
+	if err != nil {
+		fmt.Println("create doc err:", err.Error())
+		return
+	}
+
+	var expertNumArr []string
+	var expertContentArr []string
+	var interviewDateArr []string
+	//var fileLink string
+
+	doc.Find("p").Each(func(i int, s *goquery.Selection) {
+		contentTxt := s.Text()
+		if strings.Contains(contentTxt, "#访谈时间:") || strings.Contains(contentTxt, "访谈时间:") {
+			interviewDate := s.Next().Text()
+			interviewDateArr = append(interviewDateArr, interviewDate)
+		}
+		if strings.Contains(contentTxt, "#专家评价") || strings.Contains(contentTxt, "专家评价") {
+			expertContent := s.Next().Text()
+			if expertContent == "" {
+				expertContent = contentTxt
+			}
+			if expertContent != "" {
+				rightIndex := strings.Index(expertContent, ")")
+				if rightIndex == 0 {
+					rightIndex = strings.Index(expertContent, ")")
+				}
+				if rightIndex > 0 {
+					expertNum := expertContent[:rightIndex]
+					expertNum = strings.Replace(expertNum, "(", "", -1)
+					expertNum = strings.Replace(expertNum, "(", "", -1)
+					expertNum = strings.Replace(expertNum, "专家评价", "", -1)
+					if expertNum != "" {
+						expertNumArr = append(expertNumArr, expertNum)
+						rightIndex = rightIndex
+						expertContentStr := expertContent[rightIndex:]
+						expertContentStr = strings.Replace(expertContentStr, ")", "", -1)
+						expertContentStr = strings.TrimLeft(expertContentStr, ":")
+						expertContentStr = strings.TrimRight(expertContentStr, "(推荐")
+						expertContentArr = append(expertContentArr, expertContentStr)
+					}
+				}
+			}
+		}
+	})
+	if len(expertContentArr) == 0 {
+		doc.Find("pre").Each(func(i int, s *goquery.Selection) {
+			contentTxt := s.Text()
+			if strings.Contains(contentTxt, "#访谈时间:") || strings.Contains(contentTxt, "访谈时间:") {
+				interviewDate := s.Next().Text()
+				if interviewDate != "" {
+					interviewDateArr = append(interviewDateArr, interviewDate)
+				}
+			}
+			if strings.Contains(contentTxt, "#专家评价") || strings.Contains(contentTxt, "专家评价") {
+				expertContent := s.Next().Text()
+				if expertContent == "" {
+					expertContent = contentTxt
+				}
+				if expertContent != "" {
+					rightIndex := strings.Index(expertContent, ")")
+					if rightIndex == 0 {
+						rightIndex = strings.Index(expertContent, ")")
+					}
+					expertNum := expertContent[:rightIndex]
+					expertNum = strings.Replace(expertNum, "(", "", -1)
+					expertNum = strings.Replace(expertNum, "(", "", -1)
+					expertNum = strings.Replace(expertNum, "专家评价", "", -1)
+					if expertNum != "" {
+						expertNumArr = append(expertNumArr, expertNum)
+						rightIndex = rightIndex
+						expertContentStr := expertContent[rightIndex:]
+						expertContentStr = strings.Replace(expertContentStr, ")", "", -1)
+						expertContentStr = strings.TrimLeft(expertContentStr, ":")
+						expertContentStr = strings.TrimRight(expertContentStr, "(推荐")
+						if expertContentStr != "" {
+							expertContentArr = append(expertContentArr, expertContentStr)
+						}
+					}
+				}
+			}
+		})
+	}
+	if len(expertNumArr) > 0 {
+		expertNumStr = expertNumArr[0]
+		if expertNumStr != "" {
+			expertNumStr = strings.Replace(expertNumStr, "#:", "", -1)
+			expertNumStr = strings.Replace(expertNumStr, "# ", "", -1)
+			expertNumStr = strings.Trim(expertNumStr, "")
+		}
+	}
+	if len(expertContentArr) > 0 {
+		expertContentStr = expertContentArr[0]
+	}
+	if len(expertContentStr) > 600 {
+		strnum := strings.Index(expertContentStr, "#专家评价:")
+		content := expertContentStr[strnum:len(expertContentStr)]
+		strnum2 := strings.Index(content, "(")
+		content = content[strnum2+9 : len(content)] //中文括号3位 专家编号6位
+		expertContentStr = content
+	}
+	//if strings.Index(body, "报告全文(") > 0 && strings.Index(body, "PDF格式报告下载.pdf") > 0 {
+	//	numStar := strings.Index(body, "http")
+	//	numEnd := strings.Index(body, ".pdf")
+	//	fmt.Println("获取PDF链接")
+	//	fileLink = body[numStar : numEnd+4]
+	//}
+	var hrefRegexp = regexp.MustCompile("(?m)<a.*?[^<]>.*?</a>")
+	match := hrefRegexp.FindAllString(body, -1)
+	if match != nil {
+		for k, v := range match {
+			if k == 0 && strings.Index(v, ".pdf") > 0 {
+				numStar := strings.Index(v, "http")
+				numEnd := strings.Index(v, ".pdf")
+				fileLink = v[numStar : numEnd+4]
+			}
+			body = strings.Replace(body, v, "", -1)
+		}
+		body = strings.Replace(body, "完整报告请点击链接:", "", -1)
+		body = strings.Replace(body, "PDF格式报告下载.pdf", "", -1)
+		body = strings.Replace(body, "报告全文():", "", -1)
+	}
+	bodyReturn = body
+	//fmt.Println(bodyReturn)
+	//fmt.Println("_________________")
+	//fmt.Println(fileLink)
+	//body = strings.Replace(body, "报告全文(", "", -1)
+	//body = strings.Replace(body, "PDF格式报告下载.pdf", "", -1)
+	//body = strings.Replace(body, "):", "", -1)
+
+	if len(interviewDateArr) > 0 {
+		interviewDateStr = interviewDateArr[0]
+	}
+	return
+}

+ 17 - 0
services/task.go

@@ -23,7 +23,24 @@ func Task() {
 		toolbox.StartTask()
 		toolbox.StartTask()
 	}
 	}
 
 
+	//if utils.RunMode == "debug" {
+	//	//syncTacticsList := toolbox.NewTask("syncTacticsList", "0 */5 * * * *", SyncTacticsList)
+	//	//toolbox.AddTask("syncTacticsList", syncTacticsList)
+	//	//toolbox.StartTask()
+	//	syncTacticsListAddreport := toolbox.NewTask("syncTacticsListAddreport", "0 01 01 * * *", SyncTacticsListAddreport)
+	//	toolbox.AddTask("syncTacticsListAddreport", syncTacticsListAddreport)
+	//
+	//	//同步纪要库中的Es
+	//	syncTacticsListToEs := toolbox.NewTask("syncTacticsListToEs", "0 01 01 * * *", SyncTacticsListToEs)
+	//	toolbox.AddTask("syncTacticsListToEs", syncTacticsListToEs)
+	//	toolbox.StartTask()
+	//}
+	//syncTacticsListAddreport := toolbox.NewTask("syncTacticsListAddreport", "0 42 09 * * *", SyncTacticsListAddreport)
+	//toolbox.AddTask("syncTacticsListAddreport", syncTacticsListAddreport)
+	//toolbox.StartTask()
+
 	fmt.Println("end")
 	fmt.Println("end")
+
 }
 }
 
 
 func ElasticOption() {
 func ElasticOption() {