Browse Source

合并master分支

xingzai 3 years ago
parent
commit
34ff90aee3
2 changed files with 10 additions and 6 deletions
  1. 2 2
      models/tactics.go
  2. 8 4
      services/tactics.go

+ 2 - 2
models/tactics.go

@@ -90,7 +90,7 @@ func GetTacticsList2(endDate string) (list []*Tactics2, err error) {
 			INNER JOIN article_content AS b ON a.id=b.article_id
 			INNER JOIN article_category AS c ON a.id=c.article_id
 			INNER JOIN article_categoryinfo AS d ON c.category_id=d.id
-			WHERE a.publish_status=1  AND a.publish_date>=? AND d.id IN (7,9,11,28,32,45,51,52,57,62,64,65,66,67,69,71,72,74,79,80,84,85,86,87,88,89,90,93,95,96,98) `
+			WHERE a.publish_status=1  AND a.publish_date>=? AND d.id IN (7,9,11,28,32,45,51,52,57,62,64,65,66,67,69,71,72,74,79,80,84,85,86,87,88,89,90,93,95,96,98,100) `
 	//AND a.id NOT IN (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) `
 	//IN(85,71)
 	_, err = o.Raw(sql, endDate).QueryRows(&list)
@@ -105,7 +105,7 @@ func GetTacticsListAll2() (list []*Tactics2, err error) {
 			INNER JOIN article_content AS b ON a.id=b.article_id
 			INNER JOIN article_category AS c ON a.id=c.article_id
 			INNER JOIN article_categoryinfo AS d ON c.category_id=d.id
-			WHERE a.publish_status=1  AND d.id IN (7,9,11,28,32,45,51,52,57,62,64,65,66,67,69,71,72,74,79,80,84,85,86,87,88,89,90,93,95,96,98) `
+			WHERE a.publish_status=1  AND d.id IN (7,9,11,28,32,45,51,52,57,62,64,65,66,67,69,71,72,74,79,80,84,85,86,87,88,89,90,93,95,96,98,100) `
 	//AND a.id NOT IN (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) `
 	//IN(85,71)
 	_, err = o.Raw(sql).QueryRows(&list)

+ 8 - 4
services/tactics.go

@@ -429,7 +429,7 @@ func SyncTacticsListAddreport() (err error) {
 			updateParams["BodyText"] = bodyText
 			updateParams["Abstract"] = html.EscapeString(v.Abstract)
 			updateParams["CategoryName"] = v.CategoryName
-			updateParams["SubCategoryName"] = v.SubCategoryName
+
 			for _, vCustom := range listCustomArticle {
 				if v.ArticleId == vCustom.ArticleId {
 					fmt.Println("手动归类的文章:" + strconv.Itoa(v.ArticleId))
@@ -439,6 +439,10 @@ func SyncTacticsListAddreport() (err error) {
 			if isCustom == false {
 				updateParams["CategoryId"] = v.CategoryId
 				updateParams["MatchTypeName"] = matchTypeName
+				updateParams["IsSummary"] = v.IsSummary
+				updateParams["IsReport"] = v.IsReport
+				updateParams["ReportType"] = v.ReportType
+				updateParams["SubCategoryName"] = v.SubCategoryName
 			}
 			//updateParams["CategoryId"] = v.CategoryId
 			updateParams["PublishStatus"] = v.PublishStatus
@@ -446,9 +450,7 @@ func SyncTacticsListAddreport() (err error) {
 			updateParams["ExpertNumber"] = expertNumStr
 			updateParams["InterviewDate"] = interviewDateStr
 			//updateParams["IsClass"] = v.IsClass
-			updateParams["IsSummary"] = v.IsSummary
-			updateParams["IsReport"] = v.IsReport
-			updateParams["ReportType"] = v.ReportType
+
 			if v.Department != "弘则权益研究" {
 				v.Department = "弘则权益研究"
 			}
@@ -694,6 +696,8 @@ func BodyAnalysis2(body string) (expertNumStr, expertContentStr, interviewDateSt
 		if !strings.HasPrefix(fileLink, "https") && len(fileLink) > 0 {
 			fileLink = "https" + fileLink[4:len(fileLink)]
 		}
+		fileLink = strings.Replace(fileLink, "https://vmp.hzinsights.com/article/pdfviewer/?file=", "", -1)
+		fileLink = strings.Replace(fileLink, "http://vmp.hzinsights.com/article/pdfviewer/?file=", "", -1)
 		body = strings.Replace(body, "完整报告请点击链接:", "", -1)
 		body = strings.Replace(body, "PDF格式报告下载.pdf", "", -1)
 		body = strings.Replace(body, "报告全文():", "", -1)