|
@@ -6,13 +6,20 @@ import (
|
|
|
"hongze/hongze_cygx/models"
|
|
|
"hongze/hongze_cygx/utils"
|
|
|
"strconv"
|
|
|
+ "time"
|
|
|
)
|
|
|
|
|
|
// 上周纪要汇总用户阅读,给销售发消息提醒
|
|
|
func MinutesSummaryHistoryUserRmind(user *models.WxUserItem, articleId int) (err error) {
|
|
|
+ //30秒内阅读同一篇报告不做重复推送
|
|
|
+ key := "CYGX_" + utils.CYGX_OBJ_MINUTESSUMMARY + "_READ" + strconv.Itoa(articleId) + "_" + strconv.Itoa(user.UserId)
|
|
|
+ if utils.Rc.IsExist(key) {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ utils.Rc.Put(key, 1, 30*time.Second)
|
|
|
defer func() {
|
|
|
if err != nil {
|
|
|
- go utils.SendAlarmMsg(fmt.Sprint("上周纪要汇总用户阅读,给销售发消息提醒,模板消息推送 ,ResearchSummaryHistoryUserRmind"+err.Error(), "userId:", user.UserId, "articleId:", articleId), 2)
|
|
|
+ go utils.SendAlarmMsg(fmt.Sprint("上周纪要汇总用户阅读,给销售发消息提醒,模板消息推送 ,MinutesSummaryHistoryUserRmind"+err.Error(), "userId:", user.UserId, "articleId:", articleId), 2)
|
|
|
}
|
|
|
}()
|
|
|
countUser, err := models.GetUserRemind(user.UserId)
|
|
@@ -39,6 +46,9 @@ func MinutesSummaryHistoryUserRmind(user *models.WxUserItem, articleId int) (err
|
|
|
err = errors.New("GetSellerByAdminId, Err: " + e.Error())
|
|
|
return
|
|
|
}
|
|
|
+ if len(openIdList) == 0 {
|
|
|
+ return
|
|
|
+ }
|
|
|
detail, e := models.GetCygxMinutesSummaryInfoById(articleId)
|
|
|
if e != nil {
|
|
|
err = errors.New("GetCygxProductInteriorDetail, Err: " + e.Error())
|