| | |
| | | }
|
| | | }
|
| | |
|
| | | public static String getERCodeContent(TaoBaoGoodsBrief goods, String token) {
|
| | | String content = String.format("【%s】%s元", goods.getUserType() == 1 ? "T猫价" : "T宝价",
|
| | | MoneyBigDecimalUtil.getWithNoZera(goods.getZkPrice()) + "");
|
| | | content += "\n\r";
|
| | |
|
| | | if (!StringUtil.isNullOrEmpty(goods.getCouponInfo())) {
|
| | | content += String.format("【券后价】%s元", TaoBaoUtil.getAfterUseCouplePrice(goods) + "");
|
| | | content += "\n\r";
|
| | | }
|
| | | content += "------------";
|
| | | content += "\n\r";
|
| | | content += "復制这条" + token + ",進入Tao宝即可购买";
|
| | | return content;
|
| | | public static String getERCodeContent(String template, TaoBaoGoodsBrief goods, String token) {
|
| | | return template.replace("[淘口令]", token);
|
| | | }
|
| | |
|
| | | /**
|
| | |
| | | UserExtraTaoBaoInfo extraInfo = userExtraTaoBaoInfoService.getByUid(uid);
|
| | | UserInfoExtra userExtraInfo = userInfoExtraService.getUserInfoExtra(uid);
|
| | | String inviteCode = null;
|
| | | if (userExtraInfo != null)
|
| | | inviteCode = userExtraInfo.getInviteCode();
|
| | |
|
| | | if (userExtraInfo != null) {
|
| | | if (!StringUtil.isNullOrEmpty(userExtraInfo.getInviteCodeVip())) {
|
| | | inviteCode = userExtraInfo.getInviteCodeVip();
|
| | | } else {
|
| | | inviteCode = userExtraInfo.getInviteCode();
|
| | | }
|
| | | }
|
| | | String relationId = null;
|
| | | if (extraInfo != null && extraInfo.getRelationId() != null && extraInfo.getRelationValid() != null
|
| | | && extraInfo.getRelationValid() == true)
|
| | |
| | | TaoBaoLink taoBaoLink = shareGoodsService.getTaoBaoLinkForShare(uid, goodsId, relationId);
|
| | |
|
| | | if (taoBaoLink != null && taoBaoLink.getGoods() != null && needGoods) {
|
| | | ConfigParamsDTO dto = new ConfigParamsDTO(hongBaoManageService.getFanLiRate(),
|
| | | hongBaoManageService.getShareRate(), Constant.MAX_REWARD_RATE,hongBaoManageService.getVIPFanLiRate());
|
| | | ConfigParamsDTO dto = hongBaoManageService.getShowComputeRate(acceptData.getPlatform(),
|
| | | acceptData.getVersion());
|
| | |
|
| | | GoodsDetailVO goodsInfo = GoodsDetailVOFactory.convertTaoBao(taoBaoLink.getGoods(), dto);
|
| | | shareInfo.setGoodsInfo(goodsInfo);
|
| | | }
|
| | |
| | | // 测试
|
| | | // 2.0.2之前
|
| | | if (!VersionUtil.greaterThan_2_0_2(acceptData.getPlatform(), acceptData.getVersion()))
|
| | | shareInfo.setClickUrl(getERCodeContent(taoBaoLink.getGoods(), shareInfo.getToken()));
|
| | | shareInfo.setClickUrl(getERCodeContent(configService.get("taobao_share_qrcode_text"),
|
| | | taoBaoLink.getGoods(), shareInfo.getToken()));
|
| | |
|
| | | shareInfo.setWxErCode(getERCodeContent(taoBaoLink.getGoods(), shareInfo.getToken()));
|
| | | shareInfo.setWxErCode(getERCodeContent(configService.get("taobao_share_qrcode_text"), taoBaoLink.getGoods(),
|
| | | shareInfo.getToken()));
|
| | |
|
| | | // 提示图文内容
|
| | | String imgs = configService.get("goods_share_notify_imgs");
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | out.print(JsonUtil.loadTrueResult(JsonUtil.getSimpleGson().toJson(shareInfo)));
|
| | | out.print(JsonUtil.loadTrueResult(
|
| | | JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder()).create().toJson(shareInfo)));
|
| | |
|
| | | final TaoBaoLink taobaoLink = taoBaoLink;
|
| | | // 异步操作
|
| | |
| | | history.setQuanLink(taobaoLink.getCouponLink());
|
| | | history.setGoodsId(taobaoLink.getGoods().getAuctionId());
|
| | | history.setPostPicture(taobaoLink.getGoods().getPictUrl());
|
| | |
|
| | | history.setShareImg(taobaoLink.getClickUrl());
|
| | | List<String> imgList = taobaoLink.getGoods().getImgList();
|
| | | if (imgList == null) {
|
| | | imgList = new ArrayList<>();
|
| | |
| | | history.setQuanLink(taobaoLink.getCouponLink());
|
| | | history.setGoodsId(finalGoods.getAuctionId());
|
| | | history.setPostPicture(finalGoods.getPictUrl());
|
| | |
|
| | | history.setShareImg(taobaoLink.getClickUrl());
|
| | | List<String> imgList = finalGoods.getImgList();
|
| | | if (imgList == null) {
|
| | | imgList = new ArrayList<>();
|
| | |
| | | shareInfo.setCommentTexts(new ArrayList<>());
|
| | |
|
| | | if (needGoods)
|
| | | shareInfo.setGoodsInfo(GoodsDetailVOFactory.convertJDGoods(jdGoods, new ConfigParamsDTO(
|
| | | hongBaoManageService.getFanLiRate(), hongBaoManageService.getShareRate(), Constant.MAX_REWARD_RATE,hongBaoManageService.getVIPFanLiRate())));
|
| | | shareInfo.setGoodsInfo(GoodsDetailVOFactory.convertJDGoods(jdGoods,
|
| | | hongBaoManageService.getShowComputeRate(acceptData.getPlatform(), acceptData.getVersion())));
|
| | |
|
| | | String shareText = "";
|
| | | boolean hasCoupon = false;
|
| | |
| | | e1.printStackTrace();
|
| | | }
|
| | | }
|
| | | out.print(JsonUtil.loadTrueResult(JsonUtil.getSimpleGson().toJson(shareInfo)));
|
| | | out.print(JsonUtil.loadTrueResult(
|
| | | JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder()).create().toJson(shareInfo)));
|
| | |
|
| | | // 异步操作
|
| | | final JDGoods goods = jdGoods;
|
| | |
| | | history.setQuanLink(null);
|
| | | history.setGoodsId(goodsId);
|
| | | history.setPostPicture(goods.getPicUrl());
|
| | |
|
| | | history.setShareImg(jumpLink);
|
| | | |
| | | List<String> imgList = goods.getImageList();
|
| | | if (imgList == null) {
|
| | | imgList = new ArrayList<>();
|
| | |
| | | shareInfo.setRule(configService.get("share_rule_link_pdd"));
|
| | | shareInfo.setPictUrl(goods.getGoodsImageUrl());
|
| | | if (needGoods) {
|
| | | shareInfo.setGoodsInfo(GoodsDetailVOFactory.convertPDDGoods(goods, new ConfigParamsDTO(
|
| | | hongBaoManageService.getFanLiRate(), hongBaoManageService.getShareRate(), Constant.MAX_REWARD_RATE,hongBaoManageService.getVIPFanLiRate())));
|
| | | shareInfo
|
| | | .setGoodsInfo(GoodsDetailVOFactory.convertPDDGoods(goods,
|
| | | new ConfigParamsDTO(hongBaoManageService.getFanLiRate(),
|
| | | hongBaoManageService.getShareRate(), Constant.MAX_REWARD_RATE,
|
| | | hongBaoManageService.getVIPFanLiRate())));
|
| | | }
|
| | |
|
| | | String template = "";
|
| | |
| | | e1.printStackTrace();
|
| | | }
|
| | | }
|
| | | out.print(JsonUtil.loadTrueResult(JsonUtil.getSimpleGson().toJson(shareInfo)));
|
| | | out.print(JsonUtil.loadTrueResult(
|
| | | JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder()).create().toJson(shareInfo)));
|
| | |
|
| | | // 异步操作
|
| | | com.yeshi.fanli.util.ThreadUtil.run(new Runnable() {
|
| | |
| | | history.setQuanLink(null);
|
| | | history.setGoodsId(goodsId);
|
| | | history.setPostPicture(goods.getGoodsImageUrl());
|
| | |
|
| | | history.setShareImg(jumpLink);
|
| | | List<String> imgList = null;
|
| | | String[] goodsGalleryUrls = goods.getGoodsGalleryUrls();
|
| | | if (goodsGalleryUrls != null) {
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | BigDecimal fanLiRate = hongBaoManageService.getFanLiRate();
|
| | | BigDecimal shareRate = hongBaoManageService.getShareRate();
|
| | | ConfigParamsDTO paramsDTO = new ConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE,hongBaoManageService.getVIPFanLiRate());
|
| | | ConfigParamsDTO paramsDTO = hongBaoManageService.getShowComputeRate(acceptData.getPlatform(),
|
| | | acceptData.getVersion());
|
| | |
|
| | | Gson gson = JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder())
|
| | | .excludeFieldsWithoutExposeAnnotation().setDateFormat("yyyy-MM-dd").create();
|