| | |
| | | package com.yeshi.fanli.controller.client.v2;
|
| | |
|
| | | import java.io.PrintWriter;
|
| | | import java.lang.reflect.InvocationTargetException;
|
| | | import java.math.BigDecimal;
|
| | | import java.util.ArrayList;
|
| | | import java.util.HashMap;
|
| | |
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | | import org.apache.commons.beanutils.PropertyUtils;
|
| | | import org.json.simple.JSONArray;
|
| | | import org.springframework.stereotype.Controller;
|
| | | import org.springframework.web.bind.annotation.RequestMapping;
|
| | |
| | | import com.yeshi.fanli.dto.pdd.PDDGoodsResult;
|
| | | import com.yeshi.fanli.dto.pdd.PDDPromotionUrl;
|
| | | import com.yeshi.fanli.dto.pdd.PDDSearchFilter;
|
| | | import com.yeshi.fanli.dto.taobao.DaTaoKeFilterResult;
|
| | | import com.yeshi.fanli.entity.accept.AcceptData;
|
| | | import com.yeshi.fanli.entity.bus.user.ShamUser;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfo;
|
| | |
| | | import com.yeshi.fanli.service.inter.goods.TaoBaoGoodsBriefService;
|
| | | import com.yeshi.fanli.service.inter.jd.JDGoodsClassService;
|
| | | import com.yeshi.fanli.service.inter.money.UserMoneyExtraService;
|
| | | import com.yeshi.fanli.service.inter.order.OrderHongBaoMoneyComputeService;
|
| | | import com.yeshi.fanli.service.inter.order.config.HongBaoManageService;
|
| | | import com.yeshi.fanli.service.inter.redpack.UserTaoLiJinNewbiesService;
|
| | | import com.yeshi.fanli.service.inter.taobao.TLJBuyGoodsService;
|
| | |
| | | import com.yeshi.fanli.util.cache.JDGoodsCacheUtil;
|
| | | import com.yeshi.fanli.util.cache.PinDuoDuoCacheUtil;
|
| | | import com.yeshi.fanli.util.cache.TaoBaoGoodsCacheUtil;
|
| | | import com.yeshi.fanli.util.dataoke.DaTaoKeApiUtil;
|
| | | import com.yeshi.fanli.util.factory.goods.GoodsDetailVOFactory;
|
| | | import com.yeshi.fanli.util.factory.goods.ShopInfoVOFactory;
|
| | | import com.yeshi.fanli.util.jd.JDApiUtil;
|
| | |
| | | private DaTaoKeGoodsDetailV2Service daTaoKeGoodsDetailV2Service;
|
| | |
|
| | | @Resource
|
| | | private HongBaoManageService hongBaoManageService;
|
| | | private OrderHongBaoMoneyComputeService orderHongBaoMoneyComputeService;
|
| | |
|
| | | @Resource
|
| | | private SystemClientParamsService systemClientParamsService;
|
| | |
| | | @Resource
|
| | | private UserLevelManager userLevelManager;
|
| | |
|
| | | @Resource
|
| | | private HongBaoManageService hongBaoManageService;
|
| | |
|
| | | private ConfigParamsDTO getParamsDTO(String platform, String version, Long uid) {
|
| | | UserLevelEnum level = UserLevelEnum.daRen;
|
| | | if (uid != null && uid > 0) {
|
| | |
| | | }
|
| | | if (level == null)
|
| | | level = UserLevelEnum.daRen;
|
| | | return hongBaoManageService.getShowComputeRate(platform, version, level);
|
| | | return orderHongBaoMoneyComputeService.getShowComputeRate(platform, version, level);
|
| | | }
|
| | |
|
| | | private TaoBaoGoodsBrief filterDaTaoKeGoodsInfo(TaoBaoGoodsBrief goods) {
|
| | | try {
|
| | | DaTaoKeFilterResult result = daTaoKeGoodsDetailV2Service.filterTaoBaoGoods(goods);
|
| | | if (result.getFilterType() == DaTaoKeFilterResult.FILTER_TYPE_COUPON
|
| | | || result.getFilterType() == DaTaoKeFilterResult.FILTER_TYPE_PRICE_AND_COUPON) {
|
| | | // 缓存基础链接
|
| | | String dpid = null;
|
| | | if (TaoBaoUtil.isSpecialGoods(goods.getMaterialLibType())) {
|
| | | dpid = TaoBaoConstant.TAOBAO_SPECIAL_PID_DEFAULT;
|
| | | } else {
|
| | | dpid = TaoBaoConstant.TAOBAO_RELATION_AS_SPECIAL_PID;
|
| | | }
|
| | | String link = taoBaoGoodsCacheUtil.getBaseConvertLink(goods.getAuctionId(), dpid);
|
| | | if (!StringUtil.isNullOrEmpty(link)) {
|
| | | // result.getGoods().setCouponLink(link);
|
| | | return result.getGoods();
|
| | | } else {
|
| | | link = DaTaoKeApiUtil.convertLink(goods.getAuctionId(), dpid);
|
| | | if (!StringUtil.isNullOrEmpty(link)) {
|
| | | // result.getGoods().setCouponLink(link);
|
| | | taoBaoGoodsCacheUtil.cacheBaseConvertLink(goods.getAuctionId(), dpid, link);
|
| | | }
|
| | | return result.getGoods();
|
| | | }
|
| | | }
|
| | | } catch (Exception e) {
|
| | | LogHelper.errorDetailInfo(e);
|
| | | }
|
| | |
|
| | | return goods;
|
| | | }
|
| | |
|
| | | /**
|
| | |
| | |
|
| | | // 大淘客商品过滤
|
| | | try {
|
| | | goods = daTaoKeGoodsDetailV2Service.filterTaoBaoGoods(goods, acceptData.getPlatform(),
|
| | | acceptData.getVersion());
|
| | |
|
| | | // goods = daTaoKeGoodsDetailV2Service.filterTaoBaoGoods(goods);
|
| | |
|
| | | goods = filterDaTaoKeGoodsInfo(goods);
|
| | | } catch (Exception e) {
|
| | | LogHelper.errorDetailInfo(e);
|
| | | }
|
| | |
| | |
|
| | | String h5Url = String.format("http://%s%s?uid=%s&id=%s&appType=flq", configService.getH5Host(),
|
| | | Constant.systemCommonConfig.getShareGoodsPagePath(), "", id + "");
|
| | | try {
|
| | | extraVO.setH5Url(HttpUtil.getShortLink(h5Url));
|
| | | } catch (Exception e) {
|
| | | extraVO.setH5Url(h5Url);
|
| | | }
|
| | |
|
| | | extraVO.setH5Url(h5Url);
|
| | |
|
| | | String helpLink = null;
|
| | | boolean fanliValid = true;
|
| | |
| | | // 设置couponList
|
| | | List<CouponInfoVO> couponInfoList = new ArrayList<>();
|
| | | couponInfoList.add(goodsDetail.getCouponInfo());
|
| | | if (Constant.IS_TEST) {
|
| | | CouponInfoVO coupon = new CouponInfoVO();
|
| | | try {
|
| | | PropertyUtils.copyProperties(coupon, goodsDetail.getCouponInfo());
|
| | | } catch (IllegalAccessException e) {
|
| | | e.printStackTrace();
|
| | | } catch (InvocationTargetException e) {
|
| | | e.printStackTrace();
|
| | | } catch (NoSuchMethodException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | coupon.setShopCoupon(true);
|
| | | coupon.setLink(
|
| | | "https://uland.taobao.com/quan/detail?sellerId=725677994&activityId=d03aa6d23a5a4040afb3942e7ea9a007");
|
| | | couponInfoList.add(coupon);
|
| | | }
|
| | | goodsDetail.setCouponInfoList(couponInfoList);
|
| | | }
|
| | | JSONObject object = new JSONObject();
|
| | |
| | | PDDPromotionUrl convertUrl = PinDuoDuoApiUtil.convert(id, PinDuoDuoApiUtil.PID_FANLI + "", uid + "");
|
| | | JSONObject data = new JSONObject();
|
| | | data.put("native", true);
|
| | |
|
| | | data.put("jumpLink", convertUrl.getUrl());
|
| | | data.put("nativeJumpLink", PinDuoDuoUtil.getAndroidNativeURI(convertUrl.getUrl()));
|
| | | out.print(JsonUtil.loadTrueResult(data));
|