From a381a654833decf21cad316ffbda8b3e9c834118 Mon Sep 17 00:00:00 2001 From: admin <weikou2014> Date: 星期二, 26 二月 2019 19:01:59 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/master' --- fanli/src/main/java/com/yeshi/fanli/controller/client/UserMsgController.java | 31 +++++++++++++++++++++++++------ 1 files changed, 25 insertions(+), 6 deletions(-) diff --git a/fanli/src/main/java/com/yeshi/fanli/controller/client/UserMsgController.java b/fanli/src/main/java/com/yeshi/fanli/controller/client/UserMsgController.java index ff7fb65..8663f4c 100644 --- a/fanli/src/main/java/com/yeshi/fanli/controller/client/UserMsgController.java +++ b/fanli/src/main/java/com/yeshi/fanli/controller/client/UserMsgController.java @@ -54,6 +54,7 @@ import com.yeshi.fanli.service.inter.user.UserCustomSettingsService; import com.yeshi.fanli.service.inter.user.UserInfoService; import com.yeshi.fanli.util.Constant; +import com.yeshi.fanli.util.RedisManager; import com.yeshi.fanli.util.StringUtil; import com.yeshi.fanli.util.TimeUtil; import com.yeshi.fanli.util.factory.CommonGoodsFactory; @@ -103,11 +104,15 @@ @Resource private UserCustomSettingsService userCustomSettingsService; + @Resource + private RedisManager redisManager; + // 娑堟伅鐨勭被鍨� final static String MSG_TYPE_ORDER = "order"; final static String MSG_TYPE_MONEY = "money"; final static String MSG_TYPE_ACCOUNT = "account"; final static String MSG_TYPE_INVITE = "invite"; + final static String MSG_TYPE_OTHER = "other"; /** * 鑾峰彇璁㈠崟娑堟伅鍒楄〃 @@ -163,8 +168,13 @@ List<MsgInviteDetail> detailList3 = msgInviteDetailService.listMsgInviteDetail(uid, page); count = msgInviteDetailService.countMsgInviteDetail(uid); if (detailList3 != null) - for (MsgInviteDetail detail : detailList3) - list.add(UserMsgVOFactory.create(detail)); + for (MsgInviteDetail detail : detailList3) { + UserMsgVO vo = UserMsgVOFactory.create(detail); + if (vo != null) + list.add(vo); + else + count--; + } break; } @@ -351,13 +361,22 @@ } } - if (canAdd && session.getAttribute("recommendgoods") == null) { - session.setAttribute("recommendgoods", 1); + String key = "recommend-goods-user-" + uid; + if (Constant.IS_OUTNET) { + if (canAdd && StringUtil.isNullOrEmpty(redisManager.getCommonString(key))) { + if (Constant.IS_OUTNET) + redisManager.cacheCommonString(key, "1", 20); + if (hour < 12) + addRecommendGoods(uid); + else + addRecommendGoods(uid, acceptData.getImei(), acceptData.getIdfa()); + session.removeAttribute("recommendgoods"); + } + } else { if (hour < 12) addRecommendGoods(uid); else addRecommendGoods(uid, acceptData.getImei(), acceptData.getIdfa()); - session.removeAttribute("recommendgoods"); } } @@ -406,7 +425,7 @@ volist.add(vo); } - Long time = userInfoService.getUserById(uid).getCreatetime(); + Long time = userInfoService.selectByPKey(uid).getCreatetime(); if (time > TimeUtil.convertToTimeTemp("2019-01-28", "yyyy-MM-dd")) count++;// 璁$畻娆㈣繋璇殑鏁伴噺 -- Gitblit v1.8.0