| | |
| | | import com.yeshi.fanli.entity.bus.homemodule.Special;
|
| | | import com.yeshi.fanli.entity.bus.homemodule.SuperSpecial;
|
| | | import com.yeshi.fanli.entity.bus.homemodule.SwiperPicture;
|
| | | import com.yeshi.fanli.entity.bus.lable.QualityFactory;
|
| | | import com.yeshi.fanli.entity.bus.recommend.Honest;
|
| | | import com.yeshi.fanli.entity.bus.recommend.RecommendBanner;
|
| | | import com.yeshi.fanli.entity.bus.recommend.RecommendBannerV2;
|
| | |
| | |
|
| | | try {
|
| | | goods = redisManager.getTaoBaoGoodsBrief(Long.parseLong(id));
|
| | | if (goods.getTkRate() == null || new BigDecimal(0).compareTo(goods.getTkRate()) == 0) {
|
| | | String appId = clientPid.split("_")[2];
|
| | | TaoBaoUnionConfig config = taoBaoUnionConfigService.getConfigByAppIdCache(appId);
|
| | | TaoKeAppInfo app = new TaoKeAppInfo();
|
| | | app.setAdzoneId(clientPid.split("_")[3]);
|
| | | app.setAppKey(config.getAppKey());
|
| | | app.setAppSecret(config.getAppSecret());
|
| | | app.setPid(clientPid);
|
| | | TaoBaoGoodsBrief linkInfo = TaoKeApiUtil.specialConvertCoupon(goods.getAuctionId(), app);
|
| | | if (linkInfo != null) {
|
| | | goods.setAuctionUrl(linkInfo.getAuctionUrl());
|
| | | goods.setCouponLink(linkInfo.getCouponLink());
|
| | | goods.setTkRate(linkInfo.getTkRate());
|
| | | }
|
| | | }
|
| | | } catch (TaobaoGoodsDownException e) {
|
| | | // 商品下架
|
| | | ThreadUtil.run(new Runnable() {
|
| | |
| | | data.put("ticket", ticket);
|
| | | }
|
| | |
|
| | | if (goods.getTkRate() == null || new BigDecimal(0).compareTo(goods.getTkRate()) == 0) {
|
| | | TaoBaoGoodsBrief linkInfo = TaoKeApiUtil.specialConvertCoupon(goods.getAuctionId(), app);
|
| | | if (linkInfo != null) {
|
| | | goods.setAuctionUrl(linkInfo.getAuctionUrl());
|
| | | goods.setCouponLink(linkInfo.getCouponLink());
|
| | | goods.setTkRate(linkInfo.getTkRate());
|
| | | }
|
| | | }
|
| | |
|
| | | } catch (NumberFormatException e) {
|
| | | e.printStackTrace();
|
| | | } catch (TaobaoGoodsDownException e) {
|
| | |
| | | @RequestMapping(value = "getRecommenBanner", method = RequestMethod.GET)
|
| | | public void getRecommendBanner(AcceptData acceptData, String callback, PrintWriter out) {
|
| | |
|
| | | BusinessSystem system = businessSystemService.getBusinessSystem("WEB", Constant.systemCommonConfig.getH5PackageName());
|
| | | BusinessSystem system = businessSystemService.getBusinessSystem("WEB",
|
| | | Constant.systemCommonConfig.getH5PackageName());
|
| | | JSONObject json = new JSONObject();
|
| | | if (system == null) {
|
| | | out.print(JsonUtil.loadFalseResult(1, H5ControllerUtil.NOSYSTEM));
|
| | |
| | | out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadTrueResult(json)));
|
| | | return;
|
| | | }
|
| | |
|
| | |
|
| | | /**
|
| | | *
|
| | |
| | | List<TaoBaoUnionConfig> configList = taoBaoUnionConfigService
|
| | | .getConfigByTypeCache(PidUser.TYPE_SHARE_GOODS);
|
| | | String pid = null;
|
| | | ClientTBPid tbPid = tbPidService.getSharePid();
|
| | | ClientTBPid tbPid = tbPidService.getSharePid();
|
| | | if (tbPid != null)
|
| | | pid = tbPid.getPid();
|
| | | else {
|
| | |
| | | } else {
|
| | | List<TaoBaoUnionConfig> configList = taoBaoUnionConfigService
|
| | | .getConfigByTypeCache(PidUser.TYPE_SHARE_GOODS);
|
| | | String pid =tbPidService.getSharePid().getPid();
|
| | | String pid = tbPidService.getSharePid().getPid();
|
| | | TaoKeAppInfo app = new TaoKeAppInfo();
|
| | | app.setAdzoneId(pid.split("_")[3]);
|
| | | app.setAppKey(configList.get(0).getAppKey());
|
| | |
| | | if (!StringUtil.isNullOrEmpty(goods.getCouponLink())) {
|
| | | url = goods.getCouponLink();
|
| | | }
|
| | | if (!url.contains("uland.taobao.com") && !url.contains("s.click.taobao.com")) {
|
| | | TaoBaoGoodsBrief linkInfo = TaoKeApiUtil.specialConvertCoupon(Long.parseLong(id), app);
|
| | | url = linkInfo.getCouponLink();
|
| | | if (StringUtil.isNullOrEmpty(url))
|
| | | url = linkInfo.getAuctionUrl();
|
| | | }
|
| | |
|
| | | token = TaoKeApiUtil.getTKToken(goods.getPictUrl(), goods.getTitle(), url);
|
| | | }
|
| | | }
|
| | |
| | |
|
| | | // 没有获取到转过链的商品详情
|
| | | if (StringUtil.isNullOrEmpty(goods.getCouponLink()) && !goods.getAuctionUrl().contains("s.click.taobao.com")) {
|
| | | TaoBaoLink taoBaoLink = TaoBaoUtil.getTbLinkForShare(auctionId, tbPid.getPid(), taoBaoUnionConfig);
|
| | | TaoBaoGoodsBrief taoBaoLink = TaoKeApiUtil.specialConvertCoupon(auctionId, info); //TaoBaoUtil.getTbLinkForShare(auctionId, tbPid.getPid(), taoBaoUnionConfig);
|
| | | if (taoBaoLink == null) {
|
| | | throw new ShareGoodsException(201, "转链失败");
|
| | | }
|
| | | goods.setCouponLink(taoBaoLink.getCouponLink());
|
| | | goods.setAuctionUrl(taoBaoLink.getClickUrl());
|
| | | goods.setAuctionUrl(taoBaoLink.getAuctionUrl());
|
| | | }
|
| | | return addShareGoodsHistory(uid, goods);
|
| | | }
|
| | |
| | | if (StringUtil.isNullOrEmpty(goods.getCouponLink()) && !goods.getAuctionUrl().contains("s.click.taobao.com")) {
|
| | | TaoBaoUnionConfig taoBaoUnionConfig = taoBaoUnionConfigService
|
| | | .getConfigByAppIdCache(info.getPid().split("_")[2]);
|
| | | TaoBaoLink taoBaoLink = TaoBaoUtil.getTbLinkForShare(auctionId, info.getPid(), taoBaoUnionConfig);
|
| | | TaoBaoGoodsBrief taoBaoLink = TaoKeApiUtil.specialConvertCoupon(auctionId, info); |
| | | if (taoBaoLink == null) {
|
| | | throw new ShareGoodsException(201, "商品转链失败");
|
| | | }
|
| | | goods.setCouponLink(taoBaoLink.getCouponLink());
|
| | | goods.setAuctionUrl(taoBaoLink.getClickUrl());
|
| | | goods.setAuctionUrl(taoBaoLink.getAuctionUrl() );
|
| | | }
|
| | |
|
| | | if (!StringUtil.isNullOrEmpty(relationId)) {
|
| | |
| | | }
|
| | |
|
| | | if (StringUtil.isNullOrEmpty(goods.getCouponLink()) && !goods.getAuctionUrl().contains("s.click.taobao.com")) {
|
| | | TaoBaoLink taoBaoLink = TaoBaoUtil.getTbLinkForShare(auctionId, pid, taoBaoUnionConfig);
|
| | | TaoBaoGoodsBrief taoBaoLink = TaoKeApiUtil.specialConvertCoupon(auctionId, info); |
| | | if (taoBaoLink == null) {
|
| | | throw new ShareGoodsException(201, "商品转链失败");
|
| | | }
|
| | | goods.setCouponLink(taoBaoLink.getCouponLink());
|
| | | goods.setAuctionUrl(taoBaoLink.getClickUrl());
|
| | | goods.setAuctionUrl(taoBaoLink.getAuctionUrl());
|
| | | }
|
| | |
|
| | | // 创建淘口令
|
| | |
| | | int orderState) {
|
| | | MsgOrderDetail detail = MsgOrderDetailFactory.createFanLiOrder(uid, orderId, 0, orderState, payMoney, money,
|
| | | null);
|
| | | try {
|
| | | msgOrderDetailService.updateMsgOrderDetail(detail);
|
| | | } catch (MsgOrderDetailException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | //暂时不推送
|
| | | // try {
|
| | | // msgOrderDetailService.updateMsgOrderDetail(detail);
|
| | | // } catch (MsgOrderDetailException e) {
|
| | | // e.printStackTrace();
|
| | | // }
|
| | |
|
| | | }
|
| | |
|
| | |
| | | int orderState) {
|
| | | MsgOrderDetail detail = MsgOrderDetailFactory.createShareOrder(uid, orderId, 0, orderState, payMoney, money,
|
| | | null);
|
| | | try {
|
| | | msgOrderDetailService.updateMsgOrderDetail(detail);
|
| | | } catch (MsgOrderDetailException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | //暂时不推送
|
| | | // try {
|
| | | // msgOrderDetailService.updateMsgOrderDetail(detail);
|
| | | // } catch (MsgOrderDetailException e) {
|
| | | // e.printStackTrace();
|
| | | // }
|
| | |
|
| | | }
|
| | |
|
| | |
| | | int orderState) {
|
| | | MsgOrderDetail detail = MsgOrderDetailFactory.createInviteOrder(uid, orderId, 0, orderState, payMoney, money,
|
| | | null);
|
| | | try {
|
| | | msgOrderDetailService.updateMsgOrderDetail(detail);
|
| | | } catch (MsgOrderDetailException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | //暂时不推送
|
| | | // try {
|
| | | // msgOrderDetailService.updateMsgOrderDetail(detail);
|
| | | // } catch (MsgOrderDetailException e) {
|
| | | // e.printStackTrace();
|
| | | // }
|
| | |
|
| | | }
|
| | |
|
| | |
| | | goods.setAuctionUrl(itemLink);
|
| | | if (!StringUtil.isNullOrEmpty(resultJSON.optString("coupon_info")))
|
| | | goods.setCouponLink(couponLink);
|
| | | String tkRate = resultJSON.optString("max_commission_rate");
|
| | | if (!StringUtil.isNullOrEmpty(tkRate)) {
|
| | | goods.setTkRate(new BigDecimal(tkRate));
|
| | | }
|
| | | return goods;
|
| | | } catch (TaoKeApiException e) {
|
| | | e.printStackTrace();
|