yujian
2019-11-06 54e6398cabe1b32b1dbc9857c6a99d8f15b549f7
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/ConfigControllerV2.java
@@ -136,6 +136,72 @@
      out.print(JsonUtil.loadTrueResult(data));
   }
   /**
    * s 首页配置信息
    *
    * @param acceptData
    * @param out
    */
   @RequestMapping(value = "getHomeConfigNew", method = RequestMethod.POST)
   public void getHomeConfigNew(AcceptData acceptData, Long uid, PrintWriter out) {
      if (uid != null && uid == 0L)
         uid = null;
      AppHomeFloatImg appHomeFloatImg = configService.getAppHomeFloatImg();
      if ("ios".equalsIgnoreCase(acceptData.getPlatform()) && !Constant.IS_TEST) {
         appHomeFloatImg = null;
      }
      JSONObject data = new JSONObject();
      if (appHomeFloatImg != null) {
         data.put("floatImg", appHomeFloatImg);
      }
      String notifyImg = configService.getAppHomeFloatNotifyImg();
      if (!StringUtil.isNullOrEmpty(notifyImg)) {
         data.put("floatNotifyImg", notifyImg);
      }
      // 无新人弹框 则查询默认
      FloatAD floatAD = floatADService.getEffectiveFloatAD(FloatAD.POSITION_INDEX, 0);
      if (floatAD != null) {
         JSONObject detail = new JSONObject();
         detail.put("img", floatAD.getPicture());
         detail.put("jumpDetail", floatAD.getJumpDetail());
         detail.put("params", floatAD.getParams());
         detail.put("showTime", floatAD.getShowMode());
         detail.put("accountLogin", floatAD.isJumpNeedLogin());
         data.put("floatImgDetail", detail);
      }
      // 领券帮助链接,1.5.2后生效
      String couponHelp = configService.get("taobao_coupon_help");
      data.put("couponHelpUrl", couponHelp);
      // 底部网页链接
      String platform = acceptData.getPlatform();
      if ("android".equalsIgnoreCase(platform)) {
         data.put("htmlLink", configService.get("index_html_link_android"));
      }
      // 判断新老用户
      UserActiveLog da = null;
      if (uid != null)
         da = userActiveLogService.getFirstActiveInfo(uid);
      // 新人
      if (da == null || (System.currentTimeMillis() - da.getCreateTime().getTime()) <= 1000 * 60 * 60 * 24 * 15L) {
         data.put("userTimeType", 0);
      } else {// 老人
         data.put("userTimeType", 1);
      }
      data.put("hotFuctionLink",
            configService.getByVersion("hot_function_url", platform, Integer.parseInt(acceptData.getVersion())));
      out.print(JsonUtil.loadTrueResult(data));
   }
   /**
    * 消息中心弹框
    * 
@@ -238,13 +304,14 @@
         data.put("baichuan", false);// 不需要采用阿里百川的方式加载webview
         data.put("goodsDetail", false);// 不需要拦截商品详情
      }
      if (VersionUtil.greaterThan_2_0_2(acceptData.getPlatform(), acceptData.getVersion())) {
         JSONObject js = new JSONObject();
         String jsStr = configService.get("url_extract_id");
         String md5 = StringUtil.Md5(jsStr);
         js.put("md5", md5);
         data.put("js", js);
      }
//TODO 前端需要处理
//      if (VersionUtil.greaterThan_2_0_2(acceptData.getPlatform(), acceptData.getVersion())) {
//         JSONObject js = new JSONObject();
//         String jsStr = configService.get("url_extract_id");
//         String md5 = StringUtil.Md5(jsStr);
//         js.put("md5", md5);
//         data.put("js", js);
//      }
      out.print(JsonUtil.loadTrueResult(data));
   }