Browse Source

Merge branch 'master' of http://8.136.199.33:3000/hongze/hongze_cygx into cygx/cygx_14.0

zhangchuanxing 7 months ago
parent
commit
091c320df8
3 changed files with 32 additions and 22 deletions
  1. 1 1
      controllers/article.go
  2. 1 0
      models/yidong.go
  3. 30 21
      services/yidong.go

+ 1 - 1
controllers/article.go

@@ -259,7 +259,7 @@ func (this *ArticleController) Detail() {
 			}
 
 			if articleId == 11223 { // 这是一篇非常特殊的文章,要单独处理 需求池 976
-				if strings.Contains(companyPermission, utils.YI_YAO_NAME) || strings.Contains(companyPermission, utils.XIAO_FEI_NAME) || strings.Contains(companyPermission, utils.KE_JI_NAME) || strings.Contains(companyPermission, utils.ZHI_ZAO_NAME) {
+				if strings.Contains(companyPermission, utils.YI_YAO_NAME) || strings.Contains(companyPermission, utils.XIAO_FEI_NAME) || strings.Contains(companyPermission, utils.KE_JI_NAME) || strings.Contains(companyPermission, utils.ZHI_ZAO_NAME) || strings.Contains(companyPermission, utils.CE_LUE_NAME) || strings.Contains(companyPermission, utils.GU_SHOU_NAME) || strings.Contains(companyPermission, utils.ZHOU_QI_NAME) {
 					hasPersion = true
 				}
 			}

+ 1 - 0
models/yidong.go

@@ -18,6 +18,7 @@ type Result struct {
 	CompanyCodeOpen                string  `json:"companyCodeOpen"`                // 公司代码是否开启,1是 0否
 	CompanyCodeRequired            string  `json:"companyCodeRequired"`            // 公司代码是否必填,1是 0否
 	CompanyInfo                    string  `json:"companyInfo"`                    // 公司名称
+	CompanyCode                    string  `json:"companyCode"`                    // 弘则在易董那边建会的公司code
 	CompanyShortNameOpen           string  `json:"companyShortNameOpen"`           // 公司名称是否开启,1是 0否
 	CompanyShortNameRequired       string  `json:"companyShortNameRequired"`       // 公司名称是否必填,1是 0否
 	End                            string  `json:"end"`                            // 活动结束时间

+ 30 - 21
services/yidong.go

@@ -128,6 +128,8 @@ func GetActivityTypeNameWithYiDong(industrySwName string) (chartPermissionName s
 	return
 }
 
+var yidongHongzeCode = "RI0011" // 弘则在易董那边建会的公司code
+
 // 获取易董token
 func GetYiDongToken() (token string, err error) {
 	defer func() {
@@ -272,6 +274,10 @@ func GetYiDongActivity(cont context.Context) (err error) {
 			if _, ok := yiDongByCygxMap[v.ID]; ok {
 				continue
 			}
+			//fmt.Println(v.CompanyCode)
+			if v.CompanyCode == yidongHongzeCode { //弘则在易董那边建会的公司code,如果是弘则的就不同步
+				continue
+			}
 			var item = new(models.CygxActivity)
 			item.YidongActivityId = v.ID
 			item.ActivityTypeId = 3
@@ -656,7 +662,7 @@ func GetYiDongActivityMeeting(cont context.Context) (err error) {
 				if vresult.PersonTelephone == "" {
 					continue
 				}
-				if vresult.Duration != "" || vresult.DurationReview != "" {
+				if vresult.Duration != "" || vresult.DurationReview != "" || vresult.DurationLive != "" {
 					mobiles = append(mobiles, vresult.PersonTelephone)
 					//err = models.UpdateCygxActivitySignupisMeet(v.ActivityId, vresult.PersonTelephone)
 					//if err != nil {
@@ -664,7 +670,10 @@ func GetYiDongActivityMeeting(cont context.Context) (err error) {
 					//	return err
 					//}
 					var itemDetail = new(models.CygxActivitySignupDetail)
-					if vresult.Duration != "" {
+					if vresult.Duration != "" || vresult.DurationLive != "" {
+						if vresult.Duration == "" {
+							vresult.Duration = vresult.DurationLive
+						}
 						itemDetail.FirstMeetingTime = vresult.StartTime
 						itemDetail.LastMeetingTime = vresult.EndTime
 						itemDetail.Duration = vresult.Duration
@@ -687,34 +696,34 @@ func GetYiDongActivityMeeting(cont context.Context) (err error) {
 					mapActivityAttendanceDetail[vresult.PersonTelephone].LastMeetingTime = vresult.EndTime
 					mapActivityAttendanceDetail[vresult.PersonTelephone].Duration = utils.GetAttendanceDetailSecondsByYiDong(vresult.Duration)
 					itemsUpdate = append(itemsUpdate, itemDetail)
+				} else {
+					continue
 				}
 
 				item := new(models.CygxActivityAttendanceDetail)
 				item.ActivityId = v.ActivityId
-				item.Mobile = vresult.PersonTelephone
-				if vresult.Duration != "" {
-					if vresult.Duration != "" {
-						item.FirstMeetingTime = vresult.StartTime
-						item.LastMeetingTime = vresult.EndTime
-						item.Duration = vresult.Duration
-						item.MeetingStatusStr = "直播"
-					} else if vresult.DurationReview != "" {
-						item.FirstMeetingTime = vresult.StartTimeReview
-						item.LastMeetingTime = vresult.EndTimeReview
-						item.Duration = vresult.DurationReview
-						item.MeetingStatusStr = "回放"
-					}
-					item.Position = vresult.JobName
-					item.RealName = vresult.PersonName
 
+				if vresult.Duration != "" {
 					item.FirstMeetingTime = vresult.StartTime
 					item.LastMeetingTime = vresult.EndTime
 					item.Duration = vresult.Duration
-					item.IsMeetingStr = 1
-					mobileStrMeet += "'" + vresult.PersonTelephone + "'" + ","
-					item.CreateTime = time.Now()
-					needAddAttendanc = append(needAddAttendanc, item)
+					item.MeetingStatusStr = "直播"
+				} else if vresult.DurationReview != "" {
+					item.FirstMeetingTime = vresult.StartTimeReview
+					item.LastMeetingTime = vresult.EndTimeReview
+					item.Duration = vresult.DurationReview
+					item.MeetingStatusStr = "回放"
 				}
+				item.Position = vresult.JobName
+				item.RealName = vresult.PersonName
+
+				item.FirstMeetingTime = vresult.StartTime
+				item.LastMeetingTime = vresult.EndTime
+				item.Duration = vresult.Duration
+				item.IsMeetingStr = 1
+				mobileStrMeet += "'" + vresult.PersonTelephone + "'" + ","
+				item.CreateTime = time.Now()
+				needAddAttendanc = append(needAddAttendanc, item)
 				mobileStr += "'" + vresult.PersonTelephone + "'" + ","
 
 			}