| | |
| | | import com.yeshi.fanli.entity.taobao.SearchFilter;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoSearchResult;
|
| | | import com.yeshi.fanli.entity.taobao.dataoke.DaTaoKeDetail;
|
| | | import com.yeshi.fanli.entity.taobao.dataoke.DaTaoKeDetailV2;
|
| | | import com.yeshi.fanli.exception.taobao.TaobaoGoodsDownException;
|
| | | import com.yeshi.fanli.exception.user.TokenRecordException;
|
| | | import com.yeshi.fanli.log.LogHelper;
|
| | |
| | | import com.yeshi.fanli.service.inter.order.config.HongBaoManageService;
|
| | | import com.yeshi.fanli.service.inter.taobao.TaoBaoShopService;
|
| | | import com.yeshi.fanli.service.inter.taobao.TaoBaoUnionConfigService;
|
| | | import com.yeshi.fanli.service.inter.taobao.dataoke.DaTaoKeGoodsDetailService;
|
| | | import com.yeshi.fanli.service.inter.taobao.dataoke.DaTaoKeGoodsDetailV2Service;
|
| | | import com.yeshi.fanli.service.inter.user.HistorySearchService;
|
| | | import com.yeshi.fanli.service.inter.user.TokenRecordService;
|
| | | import com.yeshi.fanli.service.inter.user.integral.IntegralGetService;
|
| | | import com.yeshi.fanli.service.manger.goods.jd.JDGoodsLinkParseManager;
|
| | | import com.yeshi.fanli.tag.PageEntity;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.DouYinUtil;
|
| | |
| | | private TaoBaoShopService taoBaoShopService;
|
| | |
|
| | | @Resource
|
| | | private DaTaoKeGoodsDetailService daTaoKeGoodsDetailService;
|
| | | private DaTaoKeGoodsDetailV2Service daTaoKeGoodsDetailV2Service;
|
| | |
|
| | | @Resource(name = "taskExecutor")
|
| | | private TaskExecutor executor;
|
| | |
| | |
|
| | | @Resource
|
| | | private BrandInfoService brandInfoService;
|
| | |
|
| | | @Resource
|
| | | private JDGoodsLinkParseManager jdGoodsLinkParseManager;
|
| | |
|
| | | /**
|
| | | * 粘贴板信息推荐
|
| | |
| | | }
|
| | | // 去除前后空格
|
| | | text = text.trim();
|
| | | String originalText = text;
|
| | |
|
| | | try {
|
| | | TokenVO tokenVO = tokenRecordService.discernToken(text, uid, acceptData);
|
| | |
| | | tb = TaoBaoUtil.isAlimama(id);
|
| | | if (tb == null) {
|
| | | type = 4;
|
| | | tb = getTaoBaoGoodsBriefFromGoodsId(id);
|
| | | tb = getTaoBaoGoodsBriefFromGoodsId(id, originalText);
|
| | | }
|
| | | } else if (text.contains("http://zmnxbc.com")) { // 手机端天猫APP分享
|
| | | tb = TaoBaoUtil.parsePhoneShareUrlByTM(text);
|
| | |
| | | tb = TaoBaoUtil.isAlimama(id);
|
| | | if (tb == null) {
|
| | | type = 4;
|
| | | tb = getTaoBaoGoodsBriefFromGoodsId(id);
|
| | | tb = getTaoBaoGoodsBriefFromGoodsId(id, originalText);
|
| | | }
|
| | | } else if (text.contains("v.douyin.com")) { // 抖音
|
| | | analysisDouYin(acceptData, text, out);
|
| | |
| | | if (tb == null) {
|
| | | String goodsId = TaoBaoUtil.getGoodsIdByPhoneShareUrl(text);
|
| | | if (!StringUtil.isNullOrEmpty(goodsId)) {
|
| | | tb = getTaoBaoGoodsBriefFromGoodsId(goodsId);
|
| | | tb = getTaoBaoGoodsBriefFromGoodsId(goodsId, originalText);
|
| | | if (tb != null)
|
| | | type = 4;
|
| | | }
|
| | |
| | |
|
| | | // 领券短连接
|
| | | if (StringUtil.isNullOrEmpty(jdId) && text.contains("u.jd.com")) {
|
| | | jdId = JDUtil.getJDGoodsIdByUJD(text);
|
| | | jdId = jdGoodsLinkParseManager.parseGoodsIdByJDShortUrl(text);
|
| | | }
|
| | |
|
| | | if (!StringUtil.isNullOrEmpty(jdId)) {
|
| | |
| | | Gson gson = JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder())
|
| | | .excludeFieldsWithoutExposeAnnotation().setDateFormat("yyyy-MM-dd").create();
|
| | | data.put("type", type);
|
| | | data.put("goods",
|
| | | gson.toJson(GoodsDetailVOFactory.convertCommonGoods(commonGoods,hongBaoManageService.getShowComputeRate(acceptData.getPlatform(),
|
| | | acceptData.getVersion()))));
|
| | | data.put("goods", gson.toJson(GoodsDetailVOFactory.convertCommonGoods(commonGoods,
|
| | | hongBaoManageService.getShowComputeRate(acceptData.getPlatform(), acceptData.getVersion()))));
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | return;
|
| | | }
|
| | |
| | | out.print(JsonUtil.loadTrueResult(root));
|
| | | }
|
| | |
|
| | | private TaoBaoGoodsBrief getTaoBaoGoodsBriefFromGoodsId(String goodsId) {
|
| | | private TaoBaoGoodsBrief getTaoBaoGoodsBriefFromGoodsId(String goodsId, String text) {
|
| | | TaoBaoGoodsBrief tb = TaoBaoUtil.getTmallGoodsInfo(goodsId);
|
| | | if (tb == null && NumberUtil.isNumeric(goodsId)) {// 是数字
|
| | | tb = TaoBaoUtil.getSimpleGoodsBrief(Long.parseLong(goodsId));
|
| | | if (tb != null) {
|
| | | tb.setPictUrl(TbImgUtil.getTBSize220Img(tb.getPictUrl()));
|
| | | // tb = TaoBaoUtil.getSimpleGoodsBrief(Long.parseLong(goodsId));
|
| | | // if (tb != null) {
|
| | | // tb.setPictUrl(TbImgUtil.getTBSize220Img(tb.getPictUrl()));
|
| | | // }
|
| | | if (tb == null) {
|
| | | tb = new TaoBaoGoodsBrief();
|
| | | if (text.trim().indexOf("【") == 0 && text.trim().indexOf("】") > 0) {
|
| | | // 截取标题
|
| | | String title = text.trim().substring(1, text.trim().lastIndexOf("】"));
|
| | | tb.setAuctionId(Long.parseLong(goodsId));
|
| | | tb.setTitle(title);
|
| | | tb.setPictUrl("http://");
|
| | | }
|
| | | }
|
| | | }
|
| | | return tb;
|
| | |
| | | JSONObject data = new JSONObject();
|
| | | data.put("type", 3);
|
| | | data.put("goods",
|
| | | gson.toJson(GoodsDetailVOFactory.convertTaoBao(goodsBrief,
|
| | | hongBaoManageService.getShowComputeRate(acceptData.getPlatform(),
|
| | | acceptData.getVersion()))));
|
| | | gson.toJson(GoodsDetailVOFactory.convertTaoBao(goodsBrief, hongBaoManageService
|
| | | .getShowComputeRate(acceptData.getPlatform(), acceptData.getVersion()))));
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | return true;
|
| | | }
|
| | |
| | | }
|
| | |
|
| | | // 搜索大淘客
|
| | | List<DaTaoKeDetail> daTaoKeList = null;
|
| | | List<DaTaoKeDetailV2> daTaoKeList = null;
|
| | | if (page == 1) {
|
| | | daTaoKeList = daTaoKeGoodsDetailService.listByDtitle(key);
|
| | | daTaoKeList = daTaoKeGoodsDetailV2Service.listByDtitle(key);
|
| | | }
|
| | |
|
| | | // 淘宝api搜索商品
|
| | |
| | | if (daTaoKeList != null && daTaoKeList.size() > 0) {
|
| | | try {
|
| | | Collections.reverse(daTaoKeList);
|
| | | for (DaTaoKeDetail detail : daTaoKeList) {
|
| | | for (DaTaoKeDetailV2 detail : daTaoKeList) {
|
| | | taoBaoGoodsBriefs.add(0, TaoBaoUtil.convert(detail));
|
| | | }
|
| | | } catch (Exception e) {
|
| | |
| | | }
|
| | |
|
| | | List<GoodsDetailVO> list = new ArrayList<GoodsDetailVO>();
|
| | | ConfigParamsDTO paramsDTO = hongBaoManageService.getShowComputeRate(acceptData.getPlatform(),
|
| | | ConfigParamsDTO paramsDTO = hongBaoManageService.getShowComputeRate(acceptData.getPlatform(),
|
| | | acceptData.getVersion());
|
| | |
|
| | | for (TaoBaoGoodsBrief goods : taoBaoGoodsBriefs) {
|
| | |
| | | || ("android".equalsIgnoreCase(platform) && VersionUtil.greaterThan_2_0_2(platform, version))) {
|
| | | BrandInfoVO brandInfoVO = null;
|
| | | try {
|
| | | brandInfoVO = brandInfoService.listByAlikeName(key,acceptData.getPlatform(),acceptData.getVersion());
|
| | | brandInfoVO = brandInfoService.listByAlikeName(key, acceptData.getPlatform(),
|
| | | acceptData.getVersion());
|
| | | } catch (Exception e) {
|
| | | }
|
| | | if (brandInfoVO != null)
|
| | | data.put("shop", JsonUtil.getApiCommonGson().toJson(brandInfoVO));
|
| | | } else {
|
| | | List<TaoBaoShopVO> listShop = taoBaoShopService.getShopByKeyV2(key,acceptData.getPlatform(),acceptData.getVersion());
|
| | | List<TaoBaoShopVO> listShop = taoBaoShopService.getShopByKeyV2(key, acceptData.getPlatform(),
|
| | | acceptData.getVersion());
|
| | | if (listShop != null && listShop.size() > 0 && listShop.get(0).getListGoodsVO() != null
|
| | | && listShop.get(0).getListGoodsVO().size() > 2) {
|
| | | TaoBaoShopVO taoBaoShop = listShop.get(0);
|
| | |
| | | Gson gson = JsonUtil.getApiCommonGson();
|
| | | List<PDDGoodsDetail> goodsList = result.getGoodsList();
|
| | | if (goodsList != null && goodsList.size() > 0) {
|
| | | ConfigParamsDTO paramsDTO = hongBaoManageService.getShowComputeRate(acceptData.getPlatform(),
|
| | | ConfigParamsDTO paramsDTO = hongBaoManageService.getShowComputeRate(acceptData.getPlatform(),
|
| | | acceptData.getVersion());
|
| | |
|
| | | for (PDDGoodsDetail goods : goodsList) {
|