|
@@ -56,6 +56,12 @@ func GetReportContentTextSub(content string) (contentSub string, err error) {
|
|
|
return
|
|
|
}
|
|
|
|
|
|
+func GetAnnotationTextSub(content string) (contentSub string) {
|
|
|
+ contentSub = strings.Replace(content, "<p class=\"ql-align-justify\">", " ", -1)
|
|
|
+ contentSub = strings.Replace(contentSub, "</p>", "", -1)
|
|
|
+ return
|
|
|
+}
|
|
|
+
|
|
|
func GetReportContentTextSubNew(content string) (contentSub string, err error) {
|
|
|
content = html.UnescapeString(content)
|
|
|
doc, errdoc := goquery.NewDocumentFromReader(strings.NewReader(content))
|
|
@@ -672,8 +678,7 @@ func GetArticleListByApi(cont context.Context) (err error) {
|
|
|
}
|
|
|
|
|
|
//func init() {
|
|
|
-//
|
|
|
-// HandleArticleListByApi(7214)
|
|
|
+// HandleArticleListByApi(7164)
|
|
|
//}
|
|
|
|
|
|
//处理同步过来的文章
|
|
@@ -764,7 +769,7 @@ func HandleArticleListByApi(artcleId int) (err error) {
|
|
|
item.CreateDate = articleResult.CreateDate
|
|
|
item.PublishDate = articleResult.PublishDate.Add(time.Hour * 8)
|
|
|
item.PublishStatus = 1
|
|
|
- item.Body = articleResult.Corpus.Corpus
|
|
|
+ item.Body = articleResult.Content.Body
|
|
|
item.Abstract = articleResult.Content.Abstract
|
|
|
item.Annotation = articleResult.Content.Annotation
|
|
|
item.CategoryName = articleResult.Industry.Name
|
|
@@ -989,6 +994,7 @@ func HandleArticleListByApi(artcleId int) (err error) {
|
|
|
var keyword4 string
|
|
|
sliceSubjects := strings.Split(v.Stock, "/")
|
|
|
mapManagementForSubject := make(map[string]string)
|
|
|
+ mapIndustrialId := make(map[int]int)
|
|
|
if len(sliceSubjects) > 0 {
|
|
|
for _, vSubject := range sliceSubjects {
|
|
|
sliceKuohao := strings.Split(vSubject, "(") //过滤括号
|
|
@@ -1014,10 +1020,14 @@ func HandleArticleListByApi(artcleId int) (err error) {
|
|
|
subjectStr = "【" + subjectStr + "】"
|
|
|
if len(listIndustrial) > 0 {
|
|
|
for _, vIndustrial := range listIndustrial {
|
|
|
- industrialManagementIdStr += strconv.Itoa(vIndustrial.IndustrialManagementId) + ","
|
|
|
+ if _, ok := mapIndustrialId[vIndustrial.IndustrialManagementId]; !ok {
|
|
|
+ industrialManagementIdStr += strconv.Itoa(vIndustrial.IndustrialManagementId) + ","
|
|
|
+ }
|
|
|
+ mapIndustrialId[vIndustrial.IndustrialManagementId] = vIndustrial.IndustrialManagementId
|
|
|
industrialSubjectIdStr += strconv.Itoa(vIndustrial.IndustrialSubjectId) + ","
|
|
|
mapManagementForSubject[vIndustrial.IndustryName] += vIndustrial.SubjectName + "/"
|
|
|
}
|
|
|
+
|
|
|
industrialManagementIdStr = strings.TrimRight(industrialManagementIdStr, ",")
|
|
|
industrialSubjectIdStr = strings.TrimRight(industrialSubjectIdStr, ",")
|
|
|
if industrialManagementIdStr != "" {
|