| | |
| | | import com.yeshi.fanli.service.inter.taobao.TaoBaoGoodsUpdateService;
|
| | | import com.yeshi.fanli.service.inter.taobao.TaoBaoShopService;
|
| | | import com.yeshi.fanli.service.inter.taobao.TaoBaoUnionConfigService;
|
| | | import com.yeshi.fanli.service.inter.taobao.dataoke.DaTaoKeGoodsDetailService;
|
| | | import com.yeshi.fanli.service.inter.user.ShamUserService;
|
| | | import com.yeshi.fanli.service.inter.user.TBPidService;
|
| | | import com.yeshi.fanli.service.inter.user.UserCustomSettingsService;
|
| | |
| | | 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;
|
| | |
| | |
|
| | | @Resource
|
| | | private TaoBaoShopService taoBaoShopService;
|
| | |
|
| | | @Resource
|
| | | private DaTaoKeGoodsDetailService daTaoKeGoodsDetailService;
|
| | |
|
| | | @RequestMapping(value = "getHonestList")
|
| | | public void getHonestList(AcceptData acceptData, PrintWriter out) {
|
| | |
| | | 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) {
|
| | |
| | | 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 + "")) {
|
| | |
| | | array = JSONArray.fromObject(cacheValue);
|
| | | }
|
| | | }
|
| | |
|
| | | JumpDetailV2 jumpDetail = jumpDetailV2Service.getByTypeCache("web");
|
| | | if (array == null) {
|
| | | array = new JSONArray();
|
| | |
|
| | |
| | | }
|
| | |
|
| | | /* 遍历列表数据 */
|
| | | 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);
|
| | |
|
| | |
| | | if (!StringUtil.isNullOrEmpty(tb.getPictUrlWhite()))
|
| | | finalImgList.add(0, tb.getPictUrlWhite());
|
| | |
|
| | | // 大淘客商品过滤
|
| | | goods = daTaoKeGoodsDetailService.filterTaoBaoGoods(goods);
|
| | |
|
| | | JSONObject goodsJson = new JSONObject();
|
| | | goodsJson.put("auctionId", tb.getAuctionId());
|
| | | goodsJson.put("imgList", finalImgList);
|
| | |
| | | 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);
|
| | |
| | | } 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();
|
| | |
| | | goodsJson.put("shopInfo", tbShopInfo);
|
| | | }
|
| | |
|
| | | goodsJson.put("fanliValid",true);// 是否有返利
|
| | | goodsJson.put("fanliValid", true);// 是否有返利
|
| | |
|
| | | // 分享路径
|
| | | String shareUrl = String.format("%s?id=" + tb.getAuctionId(), Constant.systemCommonConfig.getAppShareInfoUrl());
|
| | |
| | | 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() + "");
|