| | |
| | | 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;
|
| | |
| | | private TaoBaoShopService taoBaoShopService;
|
| | |
|
| | | @Resource
|
| | | private DaTaoKeGoodsDetailService daTaoKeGoodsDetailService;
|
| | | private DaTaoKeGoodsDetailV2Service daTaoKeGoodsDetailV2Service;
|
| | |
|
| | | @Resource(name = "taskExecutor")
|
| | | private TaskExecutor executor;
|
| | |
| | | }
|
| | | // 去除前后空格
|
| | | text = text.trim();
|
| | | String originalText=text;
|
| | | String originalText = text;
|
| | |
|
| | | try {
|
| | | TokenVO tokenVO = tokenRecordService.discernToken(text, uid, acceptData);
|
| | |
| | | tb = TaoBaoUtil.isAlimama(id);
|
| | | if (tb == null) {
|
| | | type = 4;
|
| | | tb = getTaoBaoGoodsBriefFromGoodsId(id,originalText);
|
| | | 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,originalText);
|
| | | 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,originalText);
|
| | | tb = getTaoBaoGoodsBriefFromGoodsId(goodsId, originalText);
|
| | | if (tb != null)
|
| | | type = 4;
|
| | | }
|
| | |
| | | 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) {
|
| | |
| | | }
|
| | |
|
| | | // 搜索大淘客
|
| | | 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) {
|
| | |
| | | if (page == 1) { // 第一页返回店铺信息
|
| | | String platform = acceptData.getPlatform();
|
| | | String version = acceptData.getVersion();
|
| | | if (("ios".equalsIgnoreCase(platform) && VersionUtil.greaterThan_2_1(platform, version))
|
| | | if (("ios".equalsIgnoreCase(platform) && VersionUtil.greaterThan_2_0_5(platform, version))
|
| | | || ("android".equalsIgnoreCase(platform) && VersionUtil.greaterThan_2_0_2(platform, version))) {
|
| | | BrandInfoVO brandInfoVO = null;
|
| | | try {
|