| | |
| | |
|
| | | import com.yeshi.fanli.entity.SystemEnum;
|
| | | import com.yeshi.fanli.entity.SystemFunction;
|
| | | import com.yeshi.fanli.service.inter.pdd.PDDAuthService;
|
| | | import com.yeshi.fanli.service.inter.user.tb.UserExtraTaoBaoInfoService;
|
| | | import com.yeshi.fanli.util.*;
|
| | | import org.json.simple.JSONArray;
|
| | |
| | |
|
| | | @Resource
|
| | | private UserExtraTaoBaoInfoService userExtraTaoBaoInfoService;
|
| | |
|
| | |
|
| | | @Resource
|
| | | private PDDAuthService pddAuthService;
|
| | |
|
| | | private ConfigParamsDTO getParamsDTO(String platform, String version, Long uid, SystemEnum system) {
|
| | | UserLevelEnum level = UserLevelEnum.daRen;
|
| | |
| | | if (couponInfo != null) {
|
| | | // 券链接处理
|
| | | String materialId = "https://item.jd.com/" + id + ".html";
|
| | | String url = JDApiUtil.convertLinkWithSubUnionId(materialId, couponInfo.getLink(),null,
|
| | | String url = JDApiUtil.convertLinkWithSubUnionId(materialId, couponInfo.getLink(), null,
|
| | | JDApiUtil.POSITION_COUPON + "", null);
|
| | | couponInfo.setLink(url);
|
| | | }
|
| | |
| | | return;
|
| | | }
|
| | |
|
| | | PDDGoodsDetail pddGoods = PinDuoDuoApiUtil.getGoodsDetail(id,PinDuoDuoApiUtil.PID_FANLI,uid+"");
|
| | | PDDGoodsDetail pddGoods = PinDuoDuoApiUtil.getGoodsDetail(id, PinDuoDuoApiUtil.PID_FANLI, pddAuthService.getFanliCustomParams(uid));
|
| | | if (pddGoods == null) {
|
| | | out.print(JsonUtil.loadFalseResult(2, "商品不存在"));
|
| | | return;
|
| | |
| | |
|
| | | if (VersionUtil.greaterThan_2_1_2(acceptData.getPlatform(), acceptData.getVersion())) {
|
| | | getCloudInfo(acceptData, uid, goodsDetail, extraVO); // 云发单文案信息
|
| | | }
|
| | |
|
| | | if (extraVO.getListCouponUser() == null) {
|
| | | extraVO.setListCouponUser(new ArrayList<>());
|
| | | }
|
| | |
|
| | | if (extraVO.getListShareUser() == null) {
|
| | | extraVO.setListShareUser(new ArrayList<>());
|
| | | }
|
| | |
|
| | | // 免单商品
|
| | |
| | | shareInfoVO.setHelpLink(helpLink);
|
| | | extraVO.setShare(shareInfoVO);
|
| | |
|
| | | if (extraVO.getListShareUser() == null) {
|
| | | extraVO.setListShareUser(new ArrayList<>());
|
| | | }
|
| | |
|
| | | if (extraVO.getListCouponUser() == null) {
|
| | | extraVO.setListCouponUser(new ArrayList<>());
|
| | | }
|
| | |
|
| | | // 云发单文案信息
|
| | | getCloudInfo(acceptData, uid, goodsDetail, extraVO);
|
| | |
|
| | |
| | | ShareVO shareInfoVO = new ShareVO();
|
| | | shareInfoVO.setHelpLink(helpLink);
|
| | | extraVO.setShare(shareInfoVO);
|
| | |
|
| | | if (extraVO.getListShareUser() == null) {
|
| | | extraVO.setListShareUser(new ArrayList<>());
|
| | | }
|
| | |
|
| | | if (extraVO.getListCouponUser() == null) {
|
| | | extraVO.setListCouponUser(new ArrayList<>());
|
| | | }
|
| | |
|
| | | // 云发单文案信息
|
| | | getCloudInfo(acceptData, uid, goodsDetail, extraVO);
|
| | |
| | | Long[] strings = new Long[goodsIdList.size()];
|
| | | pddfilter.setGoodsIdList(goodsIdList.toArray(strings));
|
| | |
|
| | | PDDGoodsResult result = PinDuoDuoApiUtil.searchGoods(pddfilter,Constant.PDD_SEARCH_CUSTOMER_PARAMS);
|
| | | PDDGoodsResult result = PinDuoDuoApiUtil.searchGoods(pddfilter, Constant.PDD_SEARCH_CUSTOMER_PARAMS);
|
| | | if (result != null) {
|
| | | List<PDDGoodsDetail> goodsList = result.getGoodsList();
|
| | | if (goodsList != null && goodsList.size() > 0) {
|
| | |
| | | if (couponInfo != null) {
|
| | | couponUrl = couponInfo.getLink();
|
| | | }
|
| | | jumpLink = JDApiUtil.convertLinkWithSubUnionId(materialId, couponUrl, null,JDApiUtil.POSITION_COUPON + "",
|
| | | jumpLink = JDApiUtil.convertLinkWithSubUnionId(materialId, couponUrl, null, JDApiUtil.POSITION_COUPON + "",
|
| | | "");
|
| | | if (jumpLink == null) {
|
| | | jumpLink = JDApiUtil.convertLinkWithSubUnionId(materialId, null, null,JDApiUtil.POSITION_COUPON + "",
|
| | | jumpLink = JDApiUtil.convertLinkWithSubUnionId(materialId, null, null, JDApiUtil.POSITION_COUPON + "",
|
| | | "");
|
| | | }
|
| | | } else {
|
| | | jumpLink = JDApiUtil.convertLinkWithSubUnionId(materialId, couponUrl, null,JDApiUtil.POSITION_COUPON + "",
|
| | | jumpLink = JDApiUtil.convertLinkWithSubUnionId(materialId, couponUrl, null, JDApiUtil.POSITION_COUPON + "",
|
| | | "");
|
| | | if (StringUtil.isNullOrEmpty(jumpLink)) {
|
| | | jumpLink = couponUrl;
|
| | |
| | | if (couponInfo != null) {
|
| | | couponUrl = couponInfo.getLink();
|
| | | }
|
| | | jumpLink = JDApiUtil.convertLinkWithSubUnionId(materialId, couponUrl, null,JDApiUtil.POSITION_FANLI + "",
|
| | | jumpLink = JDApiUtil.convertLinkWithSubUnionId(materialId, couponUrl, null, JDApiUtil.POSITION_FANLI + "",
|
| | | uid + "");
|
| | | if (jumpLink == null) {
|
| | | jumpLink = JDApiUtil.convertLinkWithSubUnionId(materialId, null, null,JDApiUtil.POSITION_FANLI + "",
|
| | | jumpLink = JDApiUtil.convertLinkWithSubUnionId(materialId, null, null, JDApiUtil.POSITION_FANLI + "",
|
| | | uid + "");
|
| | | }
|
| | | } else {
|
| | | jumpLink = JDApiUtil.convertLinkWithSubUnionId(materialId, couponUrl, null,JDApiUtil.POSITION_FANLI + "",
|
| | | jumpLink = JDApiUtil.convertLinkWithSubUnionId(materialId, couponUrl, null, JDApiUtil.POSITION_FANLI + "",
|
| | | uid + "");
|
| | | if (StringUtil.isNullOrEmpty(jumpLink)) {
|
| | | jumpLink = couponUrl;
|
| | |
| | | String jumpLink = null;
|
| | | String materialId = "https://item.jd.com/" + id + ".html";
|
| | |
|
| | | jumpLink = JDApiUtil.convertLinkWithSubUnionId(materialId, couponUrl, null,JDApiUtil.POSITION_FANLI + "", null);
|
| | | jumpLink = JDApiUtil.convertLinkWithSubUnionId(materialId, couponUrl, null, JDApiUtil.POSITION_FANLI + "", null);
|
| | | if (StringUtil.isNullOrEmpty(jumpLink)) {
|
| | | jumpLink = couponUrl;
|
| | | }
|
| | |
| | | }
|
| | |
|
| | | //TODO 是否需要返回绑定链接
|
| | | boolean auth = PinDuoDuoApiUtil.isAuth(pid, uid + "");
|
| | | PDDPromotionUrl convertUrl = PinDuoDuoApiUtil.convert(id, pid + "", uid + "", !auth);
|
| | | String customParams = pddAuthService.getFanliCustomParams(uid);
|
| | | boolean auth = PinDuoDuoApiUtil.isAuth(pid, customParams);
|
| | | PDDPromotionUrl convertUrl = PinDuoDuoApiUtil.convert(id, pid + "", customParams, !auth);
|
| | | JSONObject data = new JSONObject();
|
| | | data.put("native", true);
|
| | | data.put("jumpLink", convertUrl.getUrl());
|
| | | data.put("nativeJumpLink", PinDuoDuoUtil.getAndroidNativeURI(convertUrl.getUrl()));
|
| | | LogHelper.test(String.format("拼多多转链:uid:%s data:%s",uid+"",data.toString()));
|
| | | LogHelper.test(String.format("拼多多转链:uid:%s data:%s", uid + "", data.toString()));
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | |
|
| | | // 获得金币
|
| | |
| | | return;
|
| | | }
|
| | |
|
| | | link = JDApiUtil.convertLinkWithSubUnionId(link, null, null,JDApiUtil.POSITION_FANLI + "", uid + "");
|
| | | link = JDApiUtil.convertLinkWithSubUnionId(link, null, null, JDApiUtil.POSITION_FANLI + "", uid + "");
|
| | |
|
| | | JSONObject data = new JSONObject();
|
| | | data.put("link", link);
|