|
@@ -1,10 +1,13 @@
|
|
|
package report
|
|
|
|
|
|
import (
|
|
|
+ "errors"
|
|
|
"fmt"
|
|
|
companyCache "hongze/hongze_yb/cache/company"
|
|
|
"hongze/hongze_yb/global"
|
|
|
+ "hongze/hongze_yb/logic/report"
|
|
|
"hongze/hongze_yb/models/tables/rddp/report_view_record"
|
|
|
+ "hongze/hongze_yb/models/tables/user_view_history"
|
|
|
"hongze/hongze_yb/services/user"
|
|
|
"time"
|
|
|
)
|
|
@@ -37,5 +40,18 @@ func AddViewRecord(userInfo user.UserInfo, reportId int, classifyName string, re
|
|
|
}
|
|
|
//修改联系人最后一次阅读报告时间
|
|
|
err = userInfo.WxUser.SetWxUserReportLastViewTime()
|
|
|
+
|
|
|
+ //新增redis阅读记录
|
|
|
+ userViewHistory := &user_view_history.UserViewHistory{
|
|
|
+ Mobile: userInfo.Mobile,
|
|
|
+ Email: userInfo.Email,
|
|
|
+ RealName: userInfo.RealName,
|
|
|
+ CompanyName: companyInfo.CompanyName,
|
|
|
+ CreatedTime: time.Now(),
|
|
|
+ }
|
|
|
+ ret := report.PushViewRecordNewRedisData(userViewHistory, int(userInfo.CompanyID))
|
|
|
+ if !ret {
|
|
|
+ err = errors.New("缓存添加阅读记录失败")
|
|
|
+ }
|
|
|
return
|
|
|
}
|