| | |
| | | import com.yeshi.fanli.util.cache.PinDuoDuoCacheUtil; |
| | | import com.yeshi.fanli.util.factory.CommonGoodsFactory; |
| | | import com.yeshi.fanli.util.factory.goods.GoodsDetailVOFactory; |
| | | import com.yeshi.fanli.util.goods.douyin.vo.DYGoods; |
| | | import com.yeshi.fanli.util.goods.douyin.vo.DYGoodsDetail; |
| | | import com.yeshi.fanli.util.jd.JDApiUtil; |
| | | import com.yeshi.fanli.util.jd.JDUtil; |
| | | import com.yeshi.fanli.util.pinduoduo.PinDuoDuoApiUtil; |
| | |
| | | // 生成口令 |
| | | String token = null; |
| | | try { |
| | | TaoBaoLink taoBaoLink = taoBaoLinkManager.getTaoBaoLinkForShare(system, Constant.LINK_TOKEN_VERIFY_UID, goodsBrief.getAuctionId(), "1", null); |
| | | TaoBaoLink taoBaoLink = taoBaoLinkManager.getTaoBaoLinkForShare(system, Constant.LINK_TOKEN_VERIFY_UID, goodsBrief.getAuctionId(), Constant.LINK_TOKEN_VERIFY_RELATION_ID, null); |
| | | token = taoBaoLink.getTaoToken(); |
| | | } catch (TaoBaoConvertLinkException e) { |
| | | e.printStackTrace(); |
| | |
| | | throw new GoodsEvaluateException(1, "线报已存在"); |
| | | |
| | | List<String> imgs = new ArrayList<>(); |
| | | if (dto.getImageList() != null && dto.getImageList().size() > 0) { |
| | | imgs.addAll(dto.getImageList()); |
| | | if (!StringUtil.isNullOrEmpty(dto.getPicUrls())) { |
| | | imgs.addAll(Arrays.asList(dto.getPicUrls().split(","))); |
| | | } |
| | | |
| | | GoodsDetailVO goods = null; |
| | | |
| | | //获取图片 |
| | | if (dto.getIdList() != null && dto.getIdList().size() > 0) { |
| | | if (!StringUtil.isNullOrEmpty( dto.getItemIds())) { |
| | | Set<String> imgSet = new HashSet<>(); |
| | | imgSet.addAll(imgs); |
| | | String id = dto.getIdList().get(0); |
| | | String source = dto.getPlatformType(); |
| | | String id = dto.getItemIds().split(",")[0]; |
| | | String source = dto.getPlatform(); |
| | | switch (source) { |
| | | case "tb": |
| | | case "淘宝": |
| | | try { |
| | | TaoBaoGoodsBrief goodsBrief = TaoKeApiUtil.searchGoodsDetail(id); |
| | | if (goodsBrief != null && goodsBrief.getImgList() != null) { |
| | |
| | | e.printStackTrace(); |
| | | } |
| | | break; |
| | | case "jd": { |
| | | case "京东": { |
| | | JDGoods jdGoods = JDApiUtil.queryGoodsDetail(Long.parseLong(id)); |
| | | if (jdGoods != null && jdGoods.getImageList() != null) { |
| | | GoodsMoneyConfigParamsDTO params = orderHongBaoMoneyComputeService.getShowComputeRate("android", "55", system); |
| | |
| | | } |
| | | } |
| | | break; |
| | | case "pdd": { |
| | | case "拼多多": { |
| | | PDDGoodsDetail goodsDetail = PinDuoDuoApiUtil.getGoodsDetail(Long.parseLong(id)); |
| | | if (goodsDetail != null && goodsDetail.getGoodsGalleryUrls() != null) { |
| | | GoodsMoneyConfigParamsDTO params = orderHongBaoMoneyComputeService.getShowComputeRate("android", "55", system); |
| | |
| | | } |
| | | |
| | | @Override |
| | | public void updateDYGoods(DYGoodsDetail goods) { |
| | | if (goods == null) { |
| | | return; |
| | | } |
| | | for (SystemEnum system : SystemEnum.values()) { |
| | | List<GoodsEvaluate> queryExist = goodsEvaluateDao.queryExist(Constant.SOURCE_TYPE_DY, |
| | | goods.getProduct_id()+"", system); |
| | | if (queryExist == null || queryExist.size() == 0) { |
| | | continue; |
| | | } |
| | | |
| | | GoodsMoneyConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate("android", "55", system); |
| | | paramsDTO.setBaseFanliRate(hongBaoManageService.getBaseFanliRate(system)); |
| | | GoodsDetailVO goodsNew = GoodsDetailVOFactory.convertDYGoods(goods, paramsDTO); |
| | | updateGoods(queryExist, goodsNew); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public void updateSuningGoods(SuningGoodsInfo goods) { |
| | | if (goods == null) { |
| | | return; |