admin
2020-04-29 5a4dde9e5aae1460e9969753593c5944dc23ad12
fanli/src/main/java/com/yeshi/fanli/controller/client/v1/UserMsgController.java
@@ -76,6 +76,7 @@
import com.yeshi.fanli.service.inter.user.invite.MsgInviteDetailService;
import com.yeshi.fanli.service.inter.user.msg.MsgAccountDetailService;
import com.yeshi.fanli.util.Constant;
import com.yeshi.fanli.util.RedisKeyEnum;
import com.yeshi.fanli.util.RedisManager;
import com.yeshi.fanli.util.StringUtil;
import com.yeshi.fanli.util.TimeUtil;
@@ -201,8 +202,8 @@
            for (MsgOrderDetail detail : detailList) {
               JSONObject params = new JSONObject();
               params.put("orderNo", detail.getOrderId());
               if (detail.getType() == MsgTypeOrderTypeEnum.share
                     || detail.getType() == MsgTypeOrderTypeEnum.invite)
               if (detail.getType() == MsgTypeOrderTypeEnum.share || detail.getType() == MsgTypeOrderTypeEnum.invite
                  || detail.getType() == MsgTypeOrderTypeEnum.orderShare || detail.getType() == MsgTypeOrderTypeEnum.orderInvite)
                  params.put("orderHideNo", UserUtil.filterOrderId(detail.getOrderId()));
               list.add(UserMsgVOFactory.create(detail, jumpDetailV2Service.getByTypeCache("order_search"),
                     params));
@@ -403,7 +404,7 @@
   }
   private void addRecommendGoods(Long uid, String device, String imei, String idfa) {
      TaoBaoSearchResult result = TaoKeApiUtil.guessDeviceLike(1, 50, imei, idfa);
      TaoBaoSearchResult result = TaoKeApiUtil.guessDeviceLike(1, 50, imei, idfa,"");
      if (result != null && result.getTaoBaoGoodsBriefs() != null) {
         for (int i = 0; i < result.getTaoBaoGoodsBriefs().size(); i++) {
            if (result.getTaoBaoGoodsBriefs().get(i).getCouponAmount() == null
@@ -519,7 +520,7 @@
         }
         // String key = "recommend-goods-user-" + uid;
         String key = "recommend-goods-user-" + device;
         String key = RedisKeyEnum.getRedisKey(RedisKeyEnum.recommendGoodsUser, device);
         if (Constant.IS_OUTNET) {
            if (canAdd && StringUtil.isNullOrEmpty(redisManager.getCommonString(key))) {
               if (Constant.IS_OUTNET)
@@ -594,7 +595,9 @@
         // 创建时间在28号后的才有新人欢迎
         if ((time > TimeUtil.convertToTimeTemp("2019-01-28", "yyyy-MM-dd") || uid == null)) {
            UserHomeMsgVO vo = new UserHomeMsgVO();
            vo.setContent(String.format("恭喜你,成为%s的用户\n独家优惠券帮你省钱;\n参与奖金活动帮你赚钱;\n让%s成为你的省钱助手吧!",Constant.getAppName(acceptData.getPlatform(), acceptData.getVersion()),Constant.getAppName(acceptData.getPlatform(), acceptData.getVersion())));
            vo.setContent(String.format("恭喜你,成为%s的用户\n独家优惠券帮你省钱;\n参与奖金活动帮你赚钱;\n让%s成为你的省钱助手吧!",
                  Constant.getAppName(acceptData.getPlatform(), acceptData.getVersion()),
                  Constant.getAppName(acceptData.getPlatform(), acceptData.getVersion())));
            vo.setTitle("新人欢迎");
            vo.setCreateTime(getTimeDesc(now, new Date(time)));
            vo.setType(UserHomeMsgVO.TYPE_WELCOME);
@@ -745,8 +748,9 @@
      // 1、活动区域
      int platformCode = Constant.getPlatformCode(acceptData.getPlatform());
      List<Special> listSpecial = specialService.listByPlaceKey("msg_activities", platformCode, Integer.parseInt(acceptData.getVersion()));
      List<Special> listSpecial = specialService.listByPlaceKey("msg_activities", platformCode,
            Integer.parseInt(acceptData.getVersion()));
      if (listSpecial != null && listSpecial.size() > 0) {
         for (Special special : listSpecial) {
@@ -844,7 +848,10 @@
      if ((time > TimeUtil.convertToTimeTemp("2019-01-28", "yyyy-MM-dd") || uid == null)) {
         Map<String, Object> map = new HashMap<String, Object>();
         map.put("title", "新人欢迎");
         map.put("content",String.format("恭喜你,成为%s的用户\n独家优惠券帮你省钱;\n参与奖金活动帮你赚钱;\n让%s成为你的省钱助手吧!",Constant.getAppName(acceptData.getPlatform(), acceptData.getVersion()),Constant.getAppName(acceptData.getPlatform(), acceptData.getVersion())));
         map.put("content",
               String.format("恭喜你,成为%s的用户\n独家优惠券帮你省钱;\n参与奖金活动帮你赚钱;\n让%s成为你的省钱助手吧!",
                     Constant.getAppName(acceptData.getPlatform(), acceptData.getVersion()),
                     Constant.getAppName(acceptData.getPlatform(), acceptData.getVersion())));
         map.put("createTime", new Date(time));
         UserMsgCenter msgCenternre = new UserMsgCenter();
         msgCenternre.setWelcomeMsg(map);
@@ -873,26 +880,27 @@
      /**
       * 提醒大图
       */
      MsgCommonDTO notify = msgConfigService.getNotifyMsg();
      if (!"douyin".equalsIgnoreCase(acceptData.getChannel())) {
         MsgCommonDTO notify = msgConfigService.getNotifyMsg();
      if (notify != null && notify.getShow() == true) {
         boolean read = false;
         MsgDeviceReadState state = msgDeviceReadStateService.getByDeviceAndPlatformAndType(
               UserCommonMsgVO.TYPE_NOTIFY, acceptData.getDevice(),
               acceptData.getPlatform().equalsIgnoreCase("android") ? 1 : 2);
         if (state != null && state.getReadTime() != null
               && zhuShouMsg.getUpdateTime().getTime() < state.getReadTime().getTime())
            read = true;
         if (notify.getJumpDetail() == null)
            read = true;
         // 查询是否已读
         UserCommonMsgVO vo = new UserCommonMsgVO(notify.getIcon(), notify.getTitle(), notify.getUpdateTime(),
               UserCommonMsgVO.TYPE_NOTIFY, notify.getContent(), read, notify.getJumpDetail(), notify.getParams(),
               0);
         vo.setPicture(notify.getPicture());
         root.put("notifyMsg", builder.create().toJson(vo));
         if (notify != null && notify.getShow() == true) {
            boolean read = false;
            MsgDeviceReadState state = msgDeviceReadStateService.getByDeviceAndPlatformAndType(
                  UserCommonMsgVO.TYPE_NOTIFY, acceptData.getDevice(),
                  acceptData.getPlatform().equalsIgnoreCase("android") ? 1 : 2);
            if (state != null && state.getReadTime() != null
                  && zhuShouMsg.getUpdateTime().getTime() < state.getReadTime().getTime())
               read = true;
            if (notify.getJumpDetail() == null)
               read = true;
            // 查询是否已读
            UserCommonMsgVO vo = new UserCommonMsgVO(notify.getIcon(), notify.getTitle(), notify.getUpdateTime(),
                  UserCommonMsgVO.TYPE_NOTIFY, notify.getContent(), read, notify.getJumpDetail(),
                  notify.getParams(), 0);
            vo.setPicture(notify.getPicture());
            root.put("notifyMsg", builder.create().toJson(vo));
         }
      }
      root.put("list", builder.create().toJson(listCenter));
      root.put("commonList", builder.create().toJson(commonMsgList));
      root.put("count", listCenter.size());