|
@@ -179,9 +179,11 @@ func GetYiDongToken() (token string, err error) {
|
|
|
|
|
|
//获取易董活动列表
|
|
|
func GetYiDongActivity(cont context.Context) (err error) {
|
|
|
+ //func GetYiDongActivity() (err error) {
|
|
|
defer func() {
|
|
|
if err != nil {
|
|
|
fmt.Println(err)
|
|
|
+ go utils.SendAlarmMsg("获取易董活动列表失败:"+err.Error(), 2)
|
|
|
utils.FileLog.Info(err.Error())
|
|
|
}
|
|
|
}()
|
|
@@ -247,13 +249,20 @@ func GetYiDongActivity(cont context.Context) (err error) {
|
|
|
if len(ApifoxModal.Result) > 0 {
|
|
|
actList := ApifoxModal.Result
|
|
|
for _, v := range actList {
|
|
|
+ //同步有效性 1有效,0失效
|
|
|
+ if v.SyncFlag == "0" {
|
|
|
+ continue
|
|
|
+ }
|
|
|
var item = new(models.CygxActivity)
|
|
|
item.YidongActivityId = v.ID
|
|
|
item.ActivityTypeId = 3
|
|
|
item.ActivityTypeName = "公司调研电话会"
|
|
|
- item.ActivityName = v.CompanyInfo + v.Title
|
|
|
- item.Label = v.CompanyInfo
|
|
|
- item.TemporaryLabel = v.CompanyInfo
|
|
|
+ sliceCompanyInfo := strings.Split(v.Title, "(")
|
|
|
+ companyInfo := sliceCompanyInfo[0]
|
|
|
+ item.ActivityName = v.Title
|
|
|
+ item.LastUpdatedTime = time.Now()
|
|
|
+ item.Label = companyInfo
|
|
|
+ item.TemporaryLabel = companyInfo
|
|
|
item.ChartPermissionId = GetActivityTypeIdWithYiDong(v.IndustrySwName)
|
|
|
item.ChartPermissionName = GetActivityTypeNameWithYiDong(v.IndustrySwName)
|
|
|
item.ChartPermissionNames = GetActivityTypeNameWithYiDong(v.IndustrySwName)
|
|
@@ -271,10 +280,12 @@ func GetYiDongActivity(cont context.Context) (err error) {
|
|
|
}
|
|
|
detailList := detailYidng.Resultdetail.GuestPersonList
|
|
|
for _, vdetail := range detailList {
|
|
|
- item.DistinguishedGuest += vdetail.PersonName + ","
|
|
|
+ item.DistinguishedGuest += vdetail.PersonName + " " + vdetail.JobName + ","
|
|
|
}
|
|
|
item.DistinguishedGuest = strings.TrimRight(item.DistinguishedGuest, ",")
|
|
|
- item.Body = "<p>" + "【" + v.CompanyInfo + v.Title + "】" + "<p>时间:" + v.Start + "</p>嘉宾:" + item.DistinguishedGuest + "</p>"
|
|
|
+ item.Body = "<p>" + "【" + v.Title + "】" + "<p>时间:" + v.Start + "</p>嘉宾:" + item.DistinguishedGuest + "</p>"
|
|
|
+ //fmt.Println(item.Body)
|
|
|
+ //return err
|
|
|
if mapOldYiDong[v.ID] == "" {
|
|
|
itemsAdd = append(itemsAdd, item)
|
|
|
newId, err := models.AddCygxActivity(item)
|
|
@@ -285,12 +296,13 @@ func GetYiDongActivity(cont context.Context) (err error) {
|
|
|
}
|
|
|
|
|
|
//把公司名称当做标的 对活动进行产业标的的关联
|
|
|
- YidongActivityGroup(v.CompanyInfo, int(newId))
|
|
|
+ YidongActivityGroup(companyInfo, int(newId))
|
|
|
} else {
|
|
|
//如果内容主体有做变更,就修改内容
|
|
|
- if mapOldYiDongBody[v.ID] != fmt.Sprint(item.ActivityName, item.Label, item.ChartPermissionId, item.ActivityTime, item.YidongActivityEndTime, item.DistinguishedGuest) {
|
|
|
+ if mapOldYiDongBody[v.ID] != fmt.Sprint(item.ActivityName+"12", item.Label, item.ChartPermissionId, item.ActivityTime, item.YidongActivityEndTime, item.DistinguishedGuest) {
|
|
|
updateParams := make(map[string]interface{})
|
|
|
updateParams["ActivityName"] = item.ActivityName
|
|
|
+ updateParams["Body"] = item.Body
|
|
|
updateParams["Label"] = item.Label
|
|
|
updateParams["TemporaryLabel"] = item.TemporaryLabel
|
|
|
updateParams["DistinguishedGuest"] = item.DistinguishedGuest
|
|
@@ -304,6 +316,7 @@ func GetYiDongActivity(cont context.Context) (err error) {
|
|
|
updateParams["ActivityJoinType"] = item.ActivityJoinType
|
|
|
updateParams["YidongSignUpStart"] = item.YidongSignUpStart
|
|
|
updateParams["YidongSignUpEnd"] = item.YidongSignUpEnd
|
|
|
+ updateParams["LastUpdatedTime"] = time.Now()
|
|
|
whereParam := map[string]interface{}{"yidong_activity_id": item.YidongActivityId}
|
|
|
err = models.UpdateByExpr(models.CygxActivity{}, whereParam, updateParams)
|
|
|
if err != nil {
|
|
@@ -352,13 +365,13 @@ func GetYiDongActivityDetail(activityId string) (detail *models.ApifoxModaldetai
|
|
|
}
|
|
|
|
|
|
//添加请求日志记录
|
|
|
- //itemApiLog := new(models.CygxThreeApiLog)
|
|
|
- //itemApiLog.CreateTime = time.Now()
|
|
|
- //itemApiLog.Source = 1
|
|
|
- //itemApiLog.Url = url
|
|
|
- //itemApiLog.Body = utils.ReplaceSpaceAndWrap(fmt.Sprint(payload))
|
|
|
- //itemApiLog.Result = string(body)
|
|
|
- //go models.AddCygxThreeApiLog(itemApiLog)
|
|
|
+ itemApiLog := new(models.CygxThreeApiLog)
|
|
|
+ itemApiLog.CreateTime = time.Now()
|
|
|
+ itemApiLog.Source = 1
|
|
|
+ itemApiLog.Url = url
|
|
|
+ itemApiLog.Body = utils.ReplaceSpaceAndWrap(fmt.Sprint(payload))
|
|
|
+ itemApiLog.Result = string(body)
|
|
|
+ go models.AddCygxThreeApiLog(itemApiLog)
|
|
|
|
|
|
err = json.Unmarshal(body, &ApifoxModal)
|
|
|
if err != nil {
|
|
@@ -375,6 +388,7 @@ func GetYiDongCreateUserInfo(user *models.WxUserItem) (userTgc string, err error
|
|
|
defer func() {
|
|
|
if err != nil {
|
|
|
fmt.Println(err)
|
|
|
+ go utils.SendAlarmMsg("生成用户相关信息接口 获取用户tgc失败:"+err.Error(), 2)
|
|
|
utils.FileLog.Info(err.Error())
|
|
|
}
|
|
|
}()
|