From 6eee4b9602f02664bfc4c55ae36583a1f419f73b Mon Sep 17 00:00:00 2001 From: admin <weikou2014> Date: 星期三, 22 五月 2019 15:38:59 +0800 Subject: [PATCH] 提现规则修改 --- fanli/src/main/java/com/yeshi/fanli/controller/client/v1/RecommendController.java | 55 ++++++++++++++++++++++++++++++++----------------------- 1 files changed, 32 insertions(+), 23 deletions(-) diff --git a/fanli/src/main/java/com/yeshi/fanli/controller/client/v1/RecommendController.java b/fanli/src/main/java/com/yeshi/fanli/controller/client/v1/RecommendController.java index b110e19..6376ac2 100644 --- a/fanli/src/main/java/com/yeshi/fanli/controller/client/v1/RecommendController.java +++ b/fanli/src/main/java/com/yeshi/fanli/controller/client/v1/RecommendController.java @@ -104,6 +104,7 @@ import com.yeshi.fanli.util.TaoBaoConstant; import com.yeshi.fanli.util.ThreadUtil; import com.yeshi.fanli.util.TimeUtil; +import com.yeshi.fanli.util.VersionUtil; import com.yeshi.fanli.util.cache.TaoBaoGoodsCacheUtil; import com.yeshi.fanli.util.factory.MonitorFactory; import com.yeshi.fanli.util.taobao.TaoBaoCouponUtil; @@ -1602,8 +1603,8 @@ if ("ios".equalsIgnoreCase(platform)) { root.put("htmlLink", configService.get("index_html_link_ios")); } - - root.put("spikeGoods", getSpikeGoodsContent(acceptData)); + + root.put("spikeGoods", getSpikeGoodsContent(acceptData)); out.print(JsonUtil.loadTrueResult(root)); } catch (Exception e) { @@ -1687,8 +1688,8 @@ nextTime.set(Calendar.MILLISECOND, 0); JSONArray array = null; - String timekey = "spikeGoods_hour"; - String cachekey = "spikeGoodsList"; + String timekey = String.format("spikeGoods_hour-%s-%s",acceptData.getPlatform(),acceptData.getVersion()); + String cachekey = String.format("spikeGoodsList-%s-%s",acceptData.getPlatform(),acceptData.getVersion()); String timeValue = redisManager.getCommonString(timekey); if (timeValue == null || !timeValue.equals(hour + "")) { @@ -1699,7 +1700,7 @@ array = JSONArray.fromObject(cacheValue); } } - + JumpDetailV2 jumpDetail = jumpDetailV2Service.getByTypeCache("web"); if (array == null) { array = new JSONArray(); @@ -1714,30 +1715,41 @@ } /* 閬嶅巻鍒楄〃鏁版嵁 */ - for (QualityFactory qualityFactory : listGoods) { + for (QualityFactory qualityFactory : listGoods) { TaoBaoGoodsBrief taoBaoGoodsBrief = qualityFactory.getTaoBaoGoodsBrief(); if (taoBaoGoodsBrief == null) { continue; } - array.add(gson + JSONObject goods = new JSONObject(); + goods.put("goods", gson .toJson(TaoBaoUtil.getTaoBaoGoodsBriefExtra(taoBaoGoodsBrief, proportion.toString(), null))); + goods.put("jumpDetail", jumpDetail); + JSONObject params = new JSONObject(); + params.put("url", configService.get("spike_goods_link") + "?id=" + taoBaoGoodsBrief.getAuctionId()); + goods.put("params", params); + + // 1.5.4鍙婁互鍚庤繑鍥� + if (VersionUtil.greaterThan_1_5_40(acceptData.getPlatform(), acceptData.getVersion())) { + array.add(goods); + } else { + array.add(goods.optJSONObject("goods")); + } } // 缂撳瓨鍗婁釜灏忔椂 redisManager.cacheCommonString(cachekey, array.toString(), 60 * 30); } Long endTime = nextTime.getTimeInMillis() - java.lang.System.currentTimeMillis(); - + JSONObject root = new JSONObject(); root.put("time", nextTime.getTimeInMillis()); - root.put("endTime", endTime > 0? endTime : 0); + root.put("endTime", endTime > 0 ? endTime : 0); root.put("listgoods", array); - - + JSONObject params = new JSONObject(); params.put("url", configService.get("spike_goods_link")); - JumpDetailV2 jumpDetail = jumpDetailV2Service.getByTypeCache("web"); + root.put("params", params); root.put("jumpDetail", jumpDetail); @@ -1932,11 +1944,10 @@ goodsJson.put("price", tb.getReservePrice().toString()); goodsJson.put("zkPrice", tb.getZkPrice().toString()); - // 30澶╅攢閲� goodsJson.put("saleCount", TaoBaoUtil.getSaleCount(tb.getBiz30day())); goodsJson.put("salesCount", TaoBaoUtil.getSaleCount(tb.getBiz30day())); - + // 鍒嗕韩璧� BigDecimal shareMoney = taoBaoGoodsBriefService.getShareGoodsUserHongBao(tb); data.put("shareMoney", "楼" + shareMoney); @@ -2056,17 +2067,15 @@ } else { tbShopInfo.setUserType("0"); } - + String shopLink = tbShopInfo.getShopUrl(); if (StringUtil.isNullOrEmpty(shopLink)) { tbShopInfo.setShopUrl(TaoBaoUtil.getShopLink(tbShopInfo.getUserId())); } } - - // 搴楅摵 - if (("android".equalsIgnoreCase(acceptData.getPlatform()) && Integer.parseInt(acceptData.getVersion()) >= 40) - || ("ios".equalsIgnoreCase(acceptData.getPlatform()) - && Integer.parseInt(acceptData.getVersion()) >= 49)) { + + // 搴楅摵1.5.4鍙婁互鍚庣増鏈� + if (VersionUtil.greaterThan_1_5_40(acceptData.getPlatform(), acceptData.getVersion())) { TaoBaoShop shop = taoBaoShopService.getTaoBaoShop(goods.getAuctionId(), goods.getSellerId()); if (shop != null) { String shopLink = shop.getShopLink(); @@ -2079,7 +2088,7 @@ goodsJson.put("shopInfo", tbShopInfo); } - goodsJson.put("fanliValid",true);// 鏄惁鏈夎繑鍒� + goodsJson.put("fanliValid", true);// 鏄惁鏈夎繑鍒� // 鍒嗕韩璺緞 String shareUrl = String.format("%s?id=" + tb.getAuctionId(), Constant.systemCommonConfig.getAppShareInfoUrl()); @@ -2097,9 +2106,9 @@ data.put("shareUsers", listShareUser); data.put("couponUsers", listCouponUser); data.put("detailWebUrl", "http://apph5.yeshitv.com/apppage/goods_img.html?id=" + id); - + data.put("noRebateHelpLink", configService.get("no_rebate_help_link")); - + // 鍟嗗搧閾炬帴 String h5Url = String.format("http://%s%s?id=%s&appType=flq", configService.getH5Host(), Constant.systemCommonConfig.getShareGoodsPagePath(), tb.getAuctionId() + ""); -- Gitblit v1.8.0