|
@@ -592,10 +592,14 @@ func LabelStr(label string) (labelNew string) {
|
|
|
//5.3版本活动标签字符串处理
|
|
|
func LabelStrV5(label string, isShowSubjectName int) (labelNew string) {
|
|
|
slicebr := strings.Split(label, "-")
|
|
|
- if len(slicebr) < 2 || isShowSubjectName == 0 {
|
|
|
- labelNew = label
|
|
|
+ if len(slicebr) > 1 {
|
|
|
+ if isShowSubjectName == 1 {
|
|
|
+ labelNew = slicebr[1]
|
|
|
+ } else {
|
|
|
+ labelNew = slicebr[0]
|
|
|
+ }
|
|
|
} else {
|
|
|
- labelNew = slicebr[1]
|
|
|
+ labelNew = label
|
|
|
}
|
|
|
return labelNew
|
|
|
}
|
|
@@ -608,7 +612,21 @@ func ActivityAttendanceDetail(cont context.Context) (err error) {
|
|
|
go utils.SendEmail(utils.APPNAME+"【"+utils.RunMode+"】"+"失败提醒", "ActivityAttendanceDetail ErrMsg:"+err.Error(), utils.EmailSendToUsers)
|
|
|
}
|
|
|
}()
|
|
|
+
|
|
|
+ configCode := "jin_meng_activity_id"
|
|
|
+ detail, err := models.GetConfigByCode(configCode)
|
|
|
+ if err != nil {
|
|
|
+ return err
|
|
|
+ }
|
|
|
+ fmt.Println(detail.ConfigValue)
|
|
|
+ mapActivityId := make(map[string]string)
|
|
|
+ sliceValue := strings.Split(detail.ConfigValue, ",")
|
|
|
+ for _, v := range sliceValue {
|
|
|
+ mapActivityId[v] = v
|
|
|
+ }
|
|
|
+
|
|
|
var activityIds string
|
|
|
+ var activityIdsLongTime string //可回放的会议,到会详情持续更新加入到不做14天限制的活动中
|
|
|
fmt.Println("开始同步")
|
|
|
dateTime := time.Now().AddDate(0, 0, -14).Format(utils.FormatDate)
|
|
|
dateNow := time.Now().AddDate(0, 0, 0).Format(utils.FormatDate)
|
|
@@ -655,7 +673,7 @@ func ActivityAttendanceDetail(cont context.Context) (err error) {
|
|
|
fmt.Println("GetTacticsList Err:", err.Error())
|
|
|
return err
|
|
|
}
|
|
|
-
|
|
|
+ var isPlayback bool // 是否包含回放
|
|
|
needAddAttendanc := make([]*models.CygxActivityAttendanceDetail, 0)
|
|
|
var mobileStr string
|
|
|
if len(list) > 0 {
|
|
@@ -682,6 +700,7 @@ func ActivityAttendanceDetail(cont context.Context) (err error) {
|
|
|
item.MeetingStatusStr = "直播"
|
|
|
} else {
|
|
|
item.MeetingStatusStr = "回放"
|
|
|
+ isPlayback = true
|
|
|
}
|
|
|
item.Position = v.Occupation
|
|
|
item.UseridEntity = v.UseridEntity
|
|
@@ -691,6 +710,9 @@ func ActivityAttendanceDetail(cont context.Context) (err error) {
|
|
|
needAddAttendanc = append(needAddAttendanc, item)
|
|
|
}
|
|
|
}
|
|
|
+ if isPlayback && mapActivityId[strconv.Itoa(activityDetail.ActivityId)] == "" {
|
|
|
+ activityIdsLongTime += strconv.Itoa(activityDetail.ActivityId) + ","
|
|
|
+ }
|
|
|
mobileStr = strings.TrimRight(mobileStr, ",")
|
|
|
if mobileStr == "" {
|
|
|
mobileStr = "1"
|
|
@@ -730,13 +752,6 @@ func ActivityAttendanceDetail(cont context.Context) (err error) {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- configCode := "jin_meng_activity_id"
|
|
|
- detail, err := models.GetConfigByCode(configCode)
|
|
|
- if err != nil {
|
|
|
- return err
|
|
|
- }
|
|
|
- fmt.Println(detail.ConfigValue)
|
|
|
-
|
|
|
//获取需要处理的活动
|
|
|
listActivity, err := models.GetActivityListByDateTime(startDate, endDate, activityIds, detail.ConfigValue)
|
|
|
if err != nil {
|
|
@@ -757,7 +772,6 @@ func ActivityAttendanceDetail(cont context.Context) (err error) {
|
|
|
} else {
|
|
|
activityName = nameSlice[len(nameSlice)-1]
|
|
|
}
|
|
|
-
|
|
|
//activityName = nameSlice[len(nameSlice)-1]
|
|
|
if activityName != "" {
|
|
|
list, err := models.GetRoadshowDataList(activityName, findStartDate, findEndDate)
|
|
@@ -765,7 +779,7 @@ func ActivityAttendanceDetail(cont context.Context) (err error) {
|
|
|
fmt.Println("GetTacticsList Err:", err.Error())
|
|
|
return err
|
|
|
}
|
|
|
-
|
|
|
+ var isPlayback bool // 是否包含回放
|
|
|
needAddAttendanc := make([]*models.CygxActivityAttendanceDetail, 0)
|
|
|
var mobileStr string
|
|
|
if len(list) > 0 {
|
|
@@ -792,6 +806,7 @@ func ActivityAttendanceDetail(cont context.Context) (err error) {
|
|
|
item.MeetingStatusStr = "直播"
|
|
|
} else {
|
|
|
item.MeetingStatusStr = "回放"
|
|
|
+ isPlayback = true
|
|
|
}
|
|
|
item.Position = v.Occupation
|
|
|
item.UseridEntity = v.UseridEntity
|
|
@@ -801,6 +816,9 @@ func ActivityAttendanceDetail(cont context.Context) (err error) {
|
|
|
needAddAttendanc = append(needAddAttendanc, item)
|
|
|
}
|
|
|
}
|
|
|
+ if isPlayback && mapActivityId[strconv.Itoa(vAct.ActivityId)] == "" {
|
|
|
+ activityIdsLongTime += strconv.Itoa(vAct.ActivityId) + ","
|
|
|
+ }
|
|
|
mobileStr = strings.TrimRight(mobileStr, ",")
|
|
|
if mobileStr == "" {
|
|
|
mobileStr = "1"
|
|
@@ -822,7 +840,7 @@ func ActivityAttendanceDetail(cont context.Context) (err error) {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- //参会记录
|
|
|
+ ////参会记录
|
|
|
err = models.AddAttendancDetail(needAddAttendanc, vAct.ActivityId, mobileStr)
|
|
|
if err != nil {
|
|
|
fmt.Println("AddAttendancDetail Err:", err.Error())
|
|
@@ -839,6 +857,11 @@ func ActivityAttendanceDetail(cont context.Context) (err error) {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ if activityIdsLongTime != "" {
|
|
|
+ activityIdsLongTime = strings.TrimRight(activityIdsLongTime, ",")
|
|
|
+ activityIdsLongTime = detail.ConfigValue + "," + activityIdsLongTime
|
|
|
+ go models.UpdateConfigByCode(activityIdsLongTime, configCode)
|
|
|
+ }
|
|
|
|
|
|
activityIds = strings.TrimRight(activityIds, ",")
|
|
|
if activityIds != "" {
|