| | |
| | | import org.yeshi.utils.JsonUtil;
|
| | | import org.yeshi.utils.taobao.TbImgUtil;
|
| | |
|
| | | import com.yeshi.fanli.dto.ConfigParamsDTO;
|
| | | import com.yeshi.fanli.dto.jd.JDCategoryInfo;
|
| | | import com.yeshi.fanli.dto.jd.JDCouponInfo;
|
| | | import com.yeshi.fanli.dto.pdd.PDDGoodsDetail;
|
| | |
| | | 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.JDGoodsCacheUtil;
|
| | | import com.yeshi.fanli.util.cache.PinDuoDuoCacheUtil;
|
| | | import com.yeshi.fanli.util.cache.TaoBaoGoodsCacheUtil;
|
| | |
| | |
|
| | | @Resource
|
| | | private JumpDetailV2Service jumpDetailV2Service;
|
| | | |
| | |
|
| | | @Resource
|
| | | private JDGoodsClassService jdGoodsClassService;
|
| | | |
| | |
|
| | | /**
|
| | | * 淘宝商品详情
|
| | |
| | | taoBaoGoodsUpdateService.offlineTaoBaoGoods(id);
|
| | | }
|
| | | });
|
| | |
|
| | | }
|
| | |
|
| | | } else {
|
| | |
| | |
|
| | | BigDecimal fanLiRate = hongBaoManageService.getFanLiRate();
|
| | | BigDecimal shareRate = hongBaoManageService.getShareRate();
|
| | | GoodsDetailVO goodsDetail = GoodsDetailVOFactory.convertTaoBao(goods, null, fanLiRate, shareRate);
|
| | | ConfigParamsDTO paramsDTO = new ConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE);
|
| | | GoodsDetailVO goodsDetail = GoodsDetailVOFactory.convertTaoBao(goods, paramsDTO);
|
| | |
|
| | | if (TaoBaoUtil.isYUShou(goods)) {
|
| | | if (!StringUtil.isNullOrEmpty(goods.getPresaleDiscountFeeText())) {
|
| | | if (goodsDetail.getLabels() == null)
|
| | | goodsDetail.setLabels(new ArrayList<>());
|
| | | goodsDetail.getLabels().add(new ClientTextStyleVO(goods.getPresaleDiscountFeeText(), "#FF2B4E"));
|
| | | }
|
| | | }
|
| | | // 在标题添加优惠信息
|
| | |
|
| | | // 店铺信息
|
| | | TaoBaoShop shop = taoBaoShopService.getTaoBaoShop(id, goods.getSellerId());
|
| | |
| | | } else {// 普通购买
|
| | | OtherInfo otherInfo = new OtherInfo();
|
| | | RewardCouponVO rewardCoupon = new RewardCouponVO();
|
| | | rewardCoupon.setJumpDetail(jumpDetailV2Service.getByTypeCache("integralExchange"));
|
| | | JSONObject params1=new JSONObject();
|
| | | params1.put("balanceMore", true);
|
| | | rewardCoupon.setJumpDetail(jumpDetailV2Service.getByTypeCache("web"));
|
| | | JSONObject params1 = new JSONObject();
|
| | | params1.put("url", configService.get("special_guide_reward_coupon_link"));
|
| | |
|
| | | rewardCoupon.setMaxMoney("¥" + TaoBaoUtil.getGoodsHongBaoMoney(goods, fanLiRate).add(MoneyBigDecimalUtil
|
| | | .mul(TaoBaoUtil.getGoodsHongBaoMoney(goods, fanLiRate), Constant.MAX_REWARD_RATE)));
|
| | | if (VersionUtil.greaterThan_2_1(acceptData.getPlatform(), acceptData.getVersion())) {
|
| | | rewardCoupon.setDesc("返");
|
| | | params1.put("url", configService.get("vip_link"));
|
| | | rewardCoupon.getJumpDetail().setNeedLogin(true);
|
| | | } else
|
| | | rewardCoupon.setDesc("用返利奖励券最高返");
|
| | | rewardCoupon.setParams(params1.toString());
|
| | | rewardCoupon.setMaxMoney("¥" +TaoBaoUtil.getGoodsHongBaoMoney(goods, fanLiRate).add( MoneyBigDecimalUtil.mul(TaoBaoUtil.getGoodsHongBaoMoney(goods, fanLiRate),
|
| | | Constant.MAX_REWARD_RATE)));
|
| | | rewardCoupon.setDesc("用返利奖励券最高返");
|
| | | otherInfo.setRewardCoupon(rewardCoupon);
|
| | | goodsDetail.setOtherInfo(otherInfo);
|
| | | }
|
| | |
| | |
|
| | | BigDecimal fanLiRate = hongBaoManageService.getFanLiRate();
|
| | | BigDecimal shareRate = hongBaoManageService.getShareRate();
|
| | | GoodsDetailVO goodsDetail = GoodsDetailVOFactory.convertJDGoods(jdGoods, fanLiRate, shareRate);
|
| | | ConfigParamsDTO paramsDTO = new ConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE);
|
| | | GoodsDetailVO goodsDetail = GoodsDetailVOFactory.convertJDGoods(jdGoods, paramsDTO);
|
| | |
|
| | | // 附加信息
|
| | | OtherInfo otherInfo = new OtherInfo();
|
| | | |
| | |
|
| | | // 京东plus返利
|
| | | String maxMoneyPlus = null;
|
| | | JDCategoryInfo categoryInfo = jdGoods.getCategoryInfo();
|
| | | if (categoryInfo != null && categoryInfo.getCid3() != null && jdGoods.getCommissionInfo() != null) {
|
| | | Long cid3 = categoryInfo.getCid3();
|
| | | JDGoodsClass threeClass = jdGoodsClassService.getThreeClassByCid(Integer.parseInt(cid3.toString()));
|
| | | if (threeClass != null && threeClass.getSelfComm() != null && threeClass.getSelfComm().compareTo(new BigDecimal(0)) > 0) {
|
| | | if (threeClass != null && threeClass.getSelfComm() != null
|
| | | && threeClass.getSelfComm().compareTo(new BigDecimal(0)) > 0) {
|
| | | BigDecimal commissionShare = jdGoods.getCommissionInfo().getCommissionShare();
|
| | | // plus比例 小于正常比例
|
| | | if (commissionShare != null && commissionShare.compareTo(threeClass.getSelfComm()) > 0) {
|
| | |
| | | BigDecimal fanliMoneyPlus = JDUtil.getGoodsFanLiMoneyPlus(jdGoods, fanLiRate);
|
| | | otherInfo.setFanliMoneyPlus("京东plus会员返¥" + fanliMoneyPlus);
|
| | | // 使用奖励券最高返
|
| | | maxMoneyPlus = "(京东plus会员最高返¥"+ fanliMoneyPlus.add(MoneyBigDecimalUtil.mul(fanliMoneyPlus, Constant.MAX_REWARD_RATE))+")";
|
| | | if (VersionUtil.greaterThan_2_1(acceptData.getPlatform(), acceptData.getVersion())) {
|
| | | maxMoneyPlus = "(京东plus返¥"
|
| | | + fanliMoneyPlus.add(MoneyBigDecimalUtil.mul(fanliMoneyPlus, Constant.MAX_REWARD_RATE))
|
| | | + ")";
|
| | | } else
|
| | | maxMoneyPlus = "(京东plus会员最高返¥"
|
| | | + fanliMoneyPlus.add(MoneyBigDecimalUtil.mul(fanliMoneyPlus, Constant.MAX_REWARD_RATE))
|
| | | + ")";
|
| | | }
|
| | | }
|
| | | }
|
| | | |
| | |
|
| | | // 奖励券返利
|
| | | RewardCouponVO rewardCoupon = new RewardCouponVO();
|
| | | rewardCoupon.setMaxMoneyPlus(maxMoneyPlus);
|
| | | rewardCoupon.setJumpDetail(jumpDetailV2Service.getByTypeCache("integralExchange"));
|
| | | JSONObject params1=new JSONObject();
|
| | | params1.put("balanceMore", true);
|
| | | rewardCoupon.setJumpDetail(jumpDetailV2Service.getByTypeCache("web"));
|
| | | JSONObject params1 = new JSONObject();
|
| | | params1.put("url", configService.get("special_guide_reward_coupon_link"));
|
| | |
|
| | | rewardCoupon.setMaxMoney("¥" + JDUtil.getGoodsFanLiMoney(jdGoods, fanLiRate)
|
| | | .add(MoneyBigDecimalUtil.mul(JDUtil.getGoodsFanLiMoney(jdGoods, fanLiRate), Constant.MAX_REWARD_RATE)));
|
| | | if (VersionUtil.greaterThan_2_1(acceptData.getPlatform(), acceptData.getVersion())) {
|
| | | rewardCoupon.setDesc("返");
|
| | | params1.put("url", configService.get("vip_link"));
|
| | | rewardCoupon.getJumpDetail().setNeedLogin(true);
|
| | | } else {
|
| | | rewardCoupon.setDesc("用返利奖励券最高返");
|
| | | }
|
| | | rewardCoupon.setParams(params1.toString());
|
| | | rewardCoupon.setMaxMoney(
|
| | | "¥" +JDUtil.getGoodsFanLiMoney(jdGoods, fanLiRate).add( MoneyBigDecimalUtil.mul(JDUtil.getGoodsFanLiMoney(jdGoods, fanLiRate), Constant.MAX_REWARD_RATE)));
|
| | | rewardCoupon.setDesc("用返利奖励券最高返");
|
| | | otherInfo.setRewardCoupon(rewardCoupon);
|
| | | goodsDetail.setOtherInfo(otherInfo);
|
| | |
|
| | |
| | |
|
| | | BigDecimal fanLiRate = hongBaoManageService.getFanLiRate();
|
| | | BigDecimal shareRate = hongBaoManageService.getShareRate();
|
| | | GoodsDetailVO goodsDetail = GoodsDetailVOFactory.convertPDDGoods(pddGoods, fanLiRate, shareRate);
|
| | | ConfigParamsDTO paramsDTO = new ConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE);
|
| | | GoodsDetailVO goodsDetail = GoodsDetailVOFactory.convertPDDGoods(pddGoods, paramsDTO);
|
| | |
|
| | | // 附加信息
|
| | | OtherInfo otherInfo = new OtherInfo();
|
| | | RewardCouponVO rewardCoupon = new RewardCouponVO();
|
| | | rewardCoupon.setJumpDetail(jumpDetailV2Service.getByTypeCache("integralExchange"));
|
| | | JSONObject params1=new JSONObject();
|
| | | params1.put("balanceMore", true);
|
| | | rewardCoupon.setJumpDetail(jumpDetailV2Service.getByTypeCache("web"));
|
| | | JSONObject params1 = new JSONObject();
|
| | | params1.put("url", configService.get("special_guide_reward_coupon_link"));
|
| | |
|
| | | rewardCoupon.setMaxMoney("¥" + PinDuoDuoUtil.getGoodsFanLiMoney(pddGoods, fanLiRate).add(MoneyBigDecimalUtil
|
| | | .mul(PinDuoDuoUtil.getGoodsFanLiMoney(pddGoods, fanLiRate), Constant.MAX_REWARD_RATE)));
|
| | | if (VersionUtil.greaterThan_2_1(acceptData.getPlatform(), acceptData.getVersion())) {
|
| | | rewardCoupon.setDesc("返");
|
| | | params1.put("url", configService.get("vip_link"));
|
| | | rewardCoupon.getJumpDetail().setNeedLogin(true);
|
| | | } else
|
| | | rewardCoupon.setDesc("用返利奖励券最高返");
|
| | | rewardCoupon.setParams(params1.toString());
|
| | | rewardCoupon.setMaxMoney("¥" +PinDuoDuoUtil.getGoodsFanLiMoney(pddGoods, fanLiRate).add(MoneyBigDecimalUtil.mul(PinDuoDuoUtil.getGoodsFanLiMoney(pddGoods, fanLiRate),
|
| | | Constant.MAX_REWARD_RATE)));
|
| | | rewardCoupon.setDesc("用返利奖励券最高返");
|
| | | otherInfo.setRewardCoupon(rewardCoupon);
|
| | | goodsDetail.setOtherInfo(otherInfo);
|
| | |
|
| | |
| | |
|
| | | BigDecimal fanLiRate = hongBaoManageService.getFanLiRate();
|
| | | BigDecimal shareRate = hongBaoManageService.getShareRate();
|
| | | ConfigParamsDTO paramsDTO = new ConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE);
|
| | | List<GoodsDetailVO> listDetailVO = new ArrayList<GoodsDetailVO>();
|
| | |
|
| | | for (JDGoods goods : list) {
|
| | | listDetailVO.add(GoodsDetailVOFactory.convertJDGoods(goods, fanLiRate, shareRate));
|
| | | listDetailVO.add(GoodsDetailVOFactory.convertJDGoods(goods, paramsDTO));
|
| | | }
|
| | |
|
| | | // 取偶数个数据
|
| | |
| | |
|
| | | BigDecimal fanLiRate = hongBaoManageService.getFanLiRate();
|
| | | BigDecimal shareRate = hongBaoManageService.getShareRate();
|
| | | ConfigParamsDTO paramsDTO = new ConfigParamsDTO(fanLiRate, shareRate,
|
| | | Constant.MAX_REWARD_RATE);
|
| | | for (PDDGoodsDetail goods : goodsList) {
|
| | | listDetailVO.add(GoodsDetailVOFactory.convertPDDGoods(goods, fanLiRate, shareRate));
|
| | | listDetailVO.add(GoodsDetailVOFactory.convertPDDGoods(goods, paramsDTO));
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | | return;
|
| | | }
|
| | |
|
| | | List<TaoBaoGoodsBrief> goodsList = TaoKeApiUtil.getRelationGoodsRecommend(id, 10);
|
| | | List<TaoBaoGoodsBrief> goodsList = TaoKeApiUtil.guessLikeByAuctionId(id, 10);
|
| | | // 初始化
|
| | | if (goodsList == null) {
|
| | | goodsList = new ArrayList<TaoBaoGoodsBrief>();
|
| | |
| | |
|
| | | BigDecimal fanLiRate = hongBaoManageService.getFanLiRate();
|
| | | BigDecimal shareRate = hongBaoManageService.getShareRate();
|
| | | ConfigParamsDTO paramsDTO = new ConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE);
|
| | |
|
| | | goodsList.parallelStream().forEach(goods -> {
|
| | | if (goods != null) {
|
| | |
| | | }
|
| | |
|
| | | if (taoBaoGoodsBrief != null) {
|
| | | listExtra.add(
|
| | | GoodsDetailVOFactory.convertTaoBao(taoBaoGoodsBrief, null, fanLiRate, shareRate));
|
| | | listExtra.add(GoodsDetailVOFactory.convertTaoBao(taoBaoGoodsBrief, paramsDTO));
|
| | | }
|
| | | }
|
| | | });
|
| | |
| | | * @param acceptData
|
| | | * @param uid
|
| | | * @param id
|
| | | * @param couponUrl
|
| | | * -优惠券链接
|
| | | * @param source
|
| | | * @param request
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "getJDLink")
|
| | | public void getJDLink(AcceptData acceptData, Long uid, Long id, String source, PrintWriter out) {
|
| | | public void getJDLink(AcceptData acceptData, Long uid, Long id, String couponUrl, String source, PrintWriter out) {
|
| | | if (uid == null || uid <= 0) {
|
| | | out.print(JsonUtil.loadFalseResult(1, "用户ID不能为空"));
|
| | | return;
|
| | |
| | | return;
|
| | | }
|
| | |
|
| | | String couponUrl = null;
|
| | | String jumpLink = null;
|
| | | String materialId = "https://item.jd.com/" + id + ".html";
|
| | | JDCouponInfo couponInfo = goods.getCouponInfo();
|
| | | if (couponInfo != null) {
|
| | | couponUrl = couponInfo.getLink();
|
| | | if (StringUtil.isNullOrEmpty(couponUrl)) {
|
| | | JDCouponInfo couponInfo = JDUtil.getShowCouponInfo(goods.getCouponInfoList(), goods.getPrice());
|
| | | if (couponInfo != null) {
|
| | | couponUrl = couponInfo.getLink();
|
| | | }
|
| | | jumpLink = JDApiUtil.convertLink(materialId, couponUrl, JDApiUtil.POSITION_FANLI + "", uid + "");
|
| | | } else {
|
| | | jumpLink = JDApiUtil.convertLink(materialId, couponUrl, JDApiUtil.POSITION_FANLI + "", uid + "");
|
| | | }
|
| | | String jumpLink = JDApiUtil.convertLink(materialId, couponUrl, JDApiUtil.POSITION_FANLI + "", uid + "");
|
| | |
|
| | | JSONObject data = new JSONObject();
|
| | | data.put("native", true);
|