| | |
| | |
|
| | | import java.math.BigDecimal;
|
| | |
|
| | | import com.yeshi.fanli.dto.jd.JDShopInfo;
|
| | | import com.yeshi.fanli.dto.pdd.PDDGoodsDetail;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoShop;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoShopInfo;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.taobao.TaoBaoUtil;
|
| | | import com.yeshi.fanli.vo.goods.ShopInfoVO;
|
| | |
|
| | |
|
| | |
| | | shopInfoVO.setScoreLogistics(shop.getScoreLogistics());
|
| | | shopInfoVO.setScoreGoodsD(shop.getScoreGoodsD());
|
| | | shopInfoVO.setScoreSellerD(shop.getScoreSellerD());
|
| | | shopInfoVO.setScoreLogistics(shop.getScoreLogisticsD());
|
| | | shopInfoVO.setScoreLogisticsD(shop.getScoreLogisticsD());
|
| | | shopInfoVO.setGoodRatePercentage(shop.getGoodRatePercentage());
|
| | |
|
| | | Integer shopType = shop.getUserType();
|
| | | if (shopType != null && shopType == 2) {
|
| | | if (shopType != null && shopType == 1) {
|
| | | shopInfoVO.setUserType(11); // 天猫
|
| | | } else {
|
| | | shopInfoVO.setUserType(10); // 淘宝
|
| | |
| | | shopInfoVO.setShopIcon(shopIconCustom);
|
| | | } else {
|
| | | shopInfoVO.setShopIcon(shop.getShopIcon());
|
| | | }
|
| | | |
| | | String shopLink = shop.getShopLink();
|
| | | if (StringUtil.isNullOrEmpty(shopLink))
|
| | | shopLink = TaoBaoUtil.getShopLink(shop.getId());
|
| | | shopInfoVO.setShopLink(shopLink);
|
| | | |
| | | return shopInfoVO;
|
| | | }
|
| | | |
| | |
|
| | | /**
|
| | | * 淘宝店铺
|
| | | * @param goods 淘宝商品
|
| | | * @param pid
|
| | | * @param fanLiRate 返利比例
|
| | | * @return
|
| | | */
|
| | | public static ShopInfoVO convertTaoBaoShop(TaoBaoShopInfo shop) {
|
| | | ShopInfoVO shopInfoVO = new ShopInfoVO();
|
| | | shopInfoVO.setId(shop.getUserId().toString());
|
| | | shopInfoVO.setShopName(shop.getShopTitle());
|
| | | shopInfoVO.setShopIcon(shop.getPictureUrl());
|
| | | shopInfoVO.setShopLink(shop.getShopUrl());
|
| | | String shopType = shop.getShopType();
|
| | | if (shopType != null && "B".equalsIgnoreCase(shopType)) {
|
| | | shopInfoVO.setUserType(11); // 天猫
|
| | | } else {
|
| | | shopInfoVO.setUserType(10); // 淘宝
|
| | | }
|
| | | return shopInfoVO;
|
| | | }
|
| | |
| | | shopInfoVO.setScoreSeller(new BigDecimal(goods.getAvgServ()));
|
| | | shopInfoVO.setScoreLogistics(new BigDecimal(goods.getAvgLgst()));
|
| | | shopInfoVO.setGoodRatePercentage(new BigDecimal(goods.getGoodsEvalScore()));
|
| | | // shopInfoVO.setShopIcon(shop.getShopIcon());
|
| | | // shopInfoVO.setShopLink(shop.getShopLink());
|
| | | shopInfoVO.setShopLink("https://mobile.yangkeduo.com/mall_page.html?mall_id=" + goods.getMallId());
|
| | | return shopInfoVO;
|
| | | }
|
| | | |
| | | /**
|
| | | * 拼多多店铺
|
| | | * @param goods 淘宝商品
|
| | | * @param pid
|
| | | * @param fanLiRate 返利比例
|
| | | * @return
|
| | | */
|
| | | public static ShopInfoVO convertJDShop(JDShopInfo shopInfo) {
|
| | | ShopInfoVO shopInfoVO = new ShopInfoVO();
|
| | | shopInfoVO.setId(shopInfo.getShopId().toString());
|
| | | shopInfoVO.setShopName(shopInfo.getShopName());
|
| | | shopInfoVO.setUserType(20);
|
| | | shopInfoVO.setShopLink("https://shop.m.jd.com/?shopId=" + shopInfo.getShopId());
|
| | | return shopInfoVO;
|
| | | }
|
| | | }
|