| | |
| | | // 单条消息
|
| | | List<UserCommonMsgVO> commonMsgList = new ArrayList<>();
|
| | |
|
| | | commonMsgList.add(new UserCommonMsgVO("http://img.flqapp.com/resource/msg/icon_kefu.png", "人工客服", new Date(),
|
| | | UserCommonMsgVO.TYPE_KEFU, "", false, null, null));
|
| | | |
| | |
|
| | | // 推荐记录
|
| | | DeviceActive deviceActive = deviceActiveService.getDeviceByDeviceAndPlatform(acceptData.getDevice(),
|
| | | acceptData.getDevice(), acceptData.getPlatform());
|
| | | if (deviceActive != null) {
|
| | | // 设备注册时间
|
| | | Date createTime = deviceActive.getCreateTime();
|
| | | List<PushGoods> list = pushGoodsService.listHistoryByPushTime(0, 1, uid, createTime);
|
| | | if (list != null && list.size() > 0) {
|
| | | MsgDeviceReadState state = msgDeviceReadStateService.getByDeviceAndPlatformAndType(
|
| | | UserCommonMsgVO.TYPE_ZHUSHOU, acceptData.getDevice(),
|
| | | acceptData.getPlatform().equalsIgnoreCase("android") ? 1 : 2);
|
| | | boolean read=false;
|
| | | if (state != null && state.getReadTime() != null
|
| | | && list.get(0).getCreateTime().getTime() < state.getReadTime().getTime())
|
| | | read = true;
|
| | | |
| | | commonMsgList.add(new UserCommonMsgVO("http://img.flqapp.com/resource/msg/icon_recommend.png", "推荐记录",
|
| | | list.get(0).getCreateTime(), UserCommonMsgVO.TYPE_RECOMMEND, list.get(0).getContent(), read,
|
| | | jumpDetailV2Service.getByTypeCache("recommend_list"), null));
|
| | | }
|
| | | }
|
| | | |
| | |
|
| | | long currentTime = System.currentTimeMillis();
|
| | | |
| | |
|
| | | // 官宣任务
|
| | | if (uid != null) {
|
| | | MsgCommonDTO guanXuanMsg = msgConfigService.getGuanXuanMsg();
|
| | | if (guanXuanMsg != null) {
|
| | | boolean read = false;
|
| | | UserMsgUnReadNum num = userMsgReadStateService.getReadStateByUid(uid);
|
| | | if (num != null && (num.getGuanXuanReadTime() != null
|
| | | && guanXuanMsg.getUpdateTime().getTime() < num.getGuanXuanReadTime().getTime()))
|
| | | read = true;
|
| | | // 查询是否已读
|
| | | if ((guanXuanMsg.getStartTime() != null && currentTime < guanXuanMsg.getStartTime().getTime())
|
| | | || (guanXuanMsg.getEndTime() != null && currentTime > guanXuanMsg.getEndTime().getTime())) {
|
| | | // 不显示
|
| | | } else
|
| | | commonMsgList.add(new UserCommonMsgVO(guanXuanMsg.getIcon(), guanXuanMsg.getTitle(),
|
| | | guanXuanMsg.getUpdateTime(), UserCommonMsgVO.TYPE_GUANXUAN, guanXuanMsg.getContent(), read,
|
| | | guanXuanMsg.getJumpDetail(), guanXuanMsg.getParams()));
|
| | | }
|
| | | }
|
| | | |
| | | |
| | | |
| | | |
| | | // 返利券小助手
|
| | | MsgCommonDTO zhuShouMsg = msgConfigService.getZhuShouMsg();
|
| | | if (zhuShouMsg != null) {
|
| | |
| | | zhuShouMsg.getUpdateTime(), UserCommonMsgVO.TYPE_ZHUSHOU, zhuShouMsg.getContent(), read,
|
| | | zhuShouMsg.getJumpDetail(), zhuShouMsg.getParams()));
|
| | | }
|
| | |
|
| | | // 官宣任务
|
| | | if (uid != null) {
|
| | | MsgCommonDTO guanXuanMsg = msgConfigService.getGuanXuanMsg();
|
| | | if (guanXuanMsg != null) {
|
| | | |
| | | //人工客服
|
| | | commonMsgList.add(new UserCommonMsgVO("http://img.flqapp.com/resource/msg/icon_kefu.png", "人工客服", new Date(),
|
| | | UserCommonMsgVO.TYPE_KEFU, "", false, null, null));
|
| | | |
| | | // 推荐记录
|
| | | DeviceActive deviceActive = deviceActiveService.getDeviceByDeviceAndPlatform(acceptData.getDevice(),
|
| | | acceptData.getDevice(), acceptData.getPlatform());
|
| | | if (deviceActive != null) {
|
| | | // 设备注册时间
|
| | | Date createTime = deviceActive.getCreateTime();
|
| | | List<PushGoods> list = pushGoodsService.listHistoryByPushTime(0, 1, uid, createTime);
|
| | | if (list != null && list.size() > 0) {
|
| | | MsgDeviceReadState state = msgDeviceReadStateService.getByDeviceAndPlatformAndType(
|
| | | UserCommonMsgVO.TYPE_ZHUSHOU, acceptData.getDevice(),
|
| | | acceptData.getPlatform().equalsIgnoreCase("android") ? 1 : 2);
|
| | | boolean read = false;
|
| | | UserMsgUnReadNum num = userMsgReadStateService.getReadStateByUid(uid);
|
| | | if (num != null && (num.getGuanXuanReadTime() != null
|
| | | && guanXuanMsg.getUpdateTime().getTime() < num.getGuanXuanReadTime().getTime()))
|
| | | if (state != null && state.getReadTime() != null
|
| | | && list.get(0).getCreateTime().getTime() < state.getReadTime().getTime())
|
| | | read = true;
|
| | | // 查询是否已读
|
| | | if ((guanXuanMsg.getStartTime() != null && currentTime < guanXuanMsg.getStartTime().getTime())
|
| | | || (guanXuanMsg.getEndTime() != null && currentTime > guanXuanMsg.getEndTime().getTime())) {
|
| | | // 不显示
|
| | | } else
|
| | | commonMsgList.add(new UserCommonMsgVO(guanXuanMsg.getIcon(), guanXuanMsg.getTitle(),
|
| | | guanXuanMsg.getUpdateTime(), UserCommonMsgVO.TYPE_GUANXUAN, guanXuanMsg.getContent(), read,
|
| | | guanXuanMsg.getJumpDetail(), guanXuanMsg.getParams()));
|
| | |
|
| | | commonMsgList.add(new UserCommonMsgVO("http://img.flqapp.com/resource/msg/icon_recommend.png", "推荐记录",
|
| | | list.get(0).getCreateTime(), UserCommonMsgVO.TYPE_RECOMMEND, list.get(0).getContent(), read,
|
| | | jumpDetailV2Service.getByTypeCache("recommend_list"), null));
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | UserMsgUnReadNum num = userMsgReadStateService.getReadStateByUid(uid);
|
| | | UserSystemMsg usm = userSystemMsgService.getLatestUserSystemMsg(uid);
|
| | | if (usm != null) {
|
| | | // commonMsgList.add(0,new UserCommonMsgVO(icon, "系统消息", time,
|
| | | // type, latestMsg, ,
|
| | | // jumpDetailV2Service.getByTypeCache("system_msg"), params));
|
| | | root.put("systemMsg",
|
| | | new UserSystemMsgVO(usm.getId(), usm.getType().name(), usm.getSolved(), "系统消息", usm.getTitle(),
|
| | | usm.getTimeTag() == 1 ? "http://img.flqapp.com/resource/msg/icon_emergent.png" : "",
|