|
@@ -21,7 +21,15 @@ func SyncComeinMeeting(cont context.Context) (err error) {
|
|
|
}
|
|
|
}
|
|
|
}()
|
|
|
- roadshowData, err := comein.GetRoadshowDataList(time.Now().AddDate(0, 0, -1).Unix()*1000, time.Now().Unix()*1000)
|
|
|
+ startTimeInt := time.Now().Add(3700*time.Second).Unix() * 1000
|
|
|
+ endTimeInt := time.Now().Unix() * 1000
|
|
|
+
|
|
|
+
|
|
|
+ if time.Now().Hour() == 7 {
|
|
|
+ startTimeInt = time.Now().Add(60*60*10*time.Second).Unix() * 1000
|
|
|
+ }
|
|
|
+
|
|
|
+ roadshowData, err := comein.GetRoadshowDataList(startTimeInt, endTimeInt)
|
|
|
if err != nil {
|
|
|
errMsgList = append(errMsgList, fmt.Sprintf("获取进门路演到会信息失败,%s,err:%s", time.Now().Format(utils.FormatDate), err.Error()))
|
|
|
return
|
|
@@ -43,35 +51,38 @@ func SyncComeinMeeting(cont context.Context) (err error) {
|
|
|
if v.UserPhone == "" {
|
|
|
continue
|
|
|
}
|
|
|
-
|
|
|
- tmpComeinEvent, tmpErr := yb.GetComeinEventByRoadshowId(int(v.RoadshowID))
|
|
|
- if tmpErr != nil {
|
|
|
- if tmpErr.Error() == utils.ErrNoRow() {
|
|
|
-
|
|
|
- tmpComeinEventInfo := &yb.ComeinEvent{
|
|
|
-
|
|
|
- RoadshowId: int(v.RoadshowID),
|
|
|
-
|
|
|
- Title: v.RoadshowTitle,
|
|
|
- StartTime: time.Unix(v.RoadshowBeginTime/1000, 0),
|
|
|
- EndTime: time.Unix(v.RoadshowEndTime/1000, 0),
|
|
|
- People: 0,
|
|
|
- CreateTime: time.Now(),
|
|
|
- }
|
|
|
- tmpErr2 := yb.AddComeinEvent(tmpComeinEventInfo)
|
|
|
- if tmpErr2 != nil {
|
|
|
-
|
|
|
- errMsgList = append(errMsgList, fmt.Sprintf("路演id:%d,路演标题:%s,会议入库失败,err:%s", v.RoadshowID, v.RoadshowTitle, err.Error()))
|
|
|
+
|
|
|
+ tmpComeinEvent, ok := comeinEventMap[int(v.RoadshowID)]
|
|
|
+ if !ok {
|
|
|
+
|
|
|
+ tmpComeinEventInfo, tmpErr := yb.GetComeinEventByRoadshowId(int(v.RoadshowID))
|
|
|
+ if tmpErr != nil {
|
|
|
+ if tmpErr.Error() == utils.ErrNoRow() {
|
|
|
+
|
|
|
+ tmpComeinEventInfo = &yb.ComeinEvent{
|
|
|
+
|
|
|
+ RoadshowId: int(v.RoadshowID),
|
|
|
+
|
|
|
+ Title: v.RoadshowTitle,
|
|
|
+ StartTime: time.Unix(v.RoadshowBeginTime/1000, 0),
|
|
|
+ EndTime: time.Unix(v.RoadshowEndTime/1000, 0),
|
|
|
+ People: 0,
|
|
|
+ CreateTime: time.Now(),
|
|
|
+ }
|
|
|
+ tmpErr2 := yb.AddComeinEvent(tmpComeinEventInfo)
|
|
|
+ if tmpErr2 != nil {
|
|
|
+
|
|
|
+ errMsgList = append(errMsgList, fmt.Sprintf("路演id:%d,路演标题:%s,会议入库失败,err:%s", v.RoadshowID, v.RoadshowTitle, err.Error()))
|
|
|
+ continue
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+
|
|
|
+ errMsgList = append(errMsgList, fmt.Sprintf("路演id:%d,路演标题:%s,查找会议失败,err:%s", v.RoadshowID, v.RoadshowTitle, err.Error()))
|
|
|
continue
|
|
|
}
|
|
|
- comeinEventMap[int(v.RoadshowID)] = tmpComeinEventInfo
|
|
|
- } else {
|
|
|
-
|
|
|
- errMsgList = append(errMsgList, fmt.Sprintf("路演id:%d,路演标题:%s,查找会议失败,err:%s", v.RoadshowID, v.RoadshowTitle, err.Error()))
|
|
|
- continue
|
|
|
}
|
|
|
- } else {
|
|
|
- comeinEventMap[tmpComeinEvent.RoadshowId] = tmpComeinEvent
|
|
|
+ comeinEventMap[tmpComeinEventInfo.RoadshowId] = tmpComeinEventInfo
|
|
|
+ tmpComeinEvent = tmpComeinEventInfo
|
|
|
}
|
|
|
|
|
|
|