Browse Source

易董标签解析又双叒叕的优化。。。

xingzai 2 years ago
parent
commit
0535c3bcc0
1 changed files with 11 additions and 3 deletions
  1. 11 3
      services/yidong.go

+ 11 - 3
services/yidong.go

@@ -258,8 +258,15 @@ func GetYiDongActivity(cont context.Context) (err error) {
 			item.ActivityTypeId = 3
 			item.ActivityTypeName = "公司调研电话会"
 			sliceCompanyInfo := strings.Split(v.Title, "(")
+			sliceActivityTitle := strings.Split(v.Title, ")")
 			companyInfo := sliceCompanyInfo[0]
-			item.ActivityName = v.Title
+			if len(sliceActivityTitle) > 1 {
+				item.ActivityName = companyInfo + sliceActivityTitle[len(sliceActivityTitle)-1]
+			} else {
+				item.ActivityName = v.Title
+			}
+			//fmt.Println(item.ActivityName)
+			//return err
 			item.LastUpdatedTime = time.Now()
 			item.Label = companyInfo
 			item.TemporaryLabel = companyInfo
@@ -283,7 +290,7 @@ func GetYiDongActivity(cont context.Context) (err error) {
 				item.DistinguishedGuest += vdetail.PersonName + " " + vdetail.JobName + ","
 			}
 			item.DistinguishedGuest = strings.TrimRight(item.DistinguishedGuest, ",")
-			item.Body = "<p>" + "【" + v.Title + "】" + "<p>时间:" + v.Start + "</p>嘉宾:" + item.DistinguishedGuest + "</p>"
+			item.Body = "<p>" + "【" + item.ActivityName + "】" + "<p>时间:" + item.ActivityTimeText + "</p>嘉宾:" + item.DistinguishedGuest + "</p>"
 			//fmt.Println(item.Body)
 			//return err
 			if mapOldYiDong[v.ID] == "" {
@@ -304,7 +311,7 @@ func GetYiDongActivity(cont context.Context) (err error) {
 					updateParams["ActivityName"] = item.ActivityName
 					updateParams["Body"] = item.Body
 					updateParams["Label"] = item.Label
-					updateParams["TemporaryLabel"] = item.TemporaryLabel
+					//updateParams["TemporaryLabel"] = item.TemporaryLabel
 					updateParams["DistinguishedGuest"] = item.DistinguishedGuest
 					updateParams["ChartPermissionId"] = item.ChartPermissionId
 					updateParams["ChartPermissionName"] = item.ChartPermissionName
@@ -579,6 +586,7 @@ func YidongActivityGroup(subjectName string, activityId int) (err error) {
 	if len(subjectList) == 0 {
 		return err
 	}
+	fmt.Println("去掉临时标签的活动", activityId)
 	err = models.UpdateActivityshowSubject(activityId)
 	if err != nil {
 		go utils.SendAlarmMsg("UpdateActivityshowSubject :根据易董推过来的匹配信息,判断临时标签是否展示失败"+err.Error(), 2)