package com.yeshi.fanli.util.factory.goods;
|
|
import java.math.BigDecimal;
|
|
import com.yeshi.fanli.dto.pdd.PDDGoodsDetail;
|
import com.yeshi.fanli.entity.taobao.TaoBaoShop;
|
import com.yeshi.fanli.util.StringUtil;
|
import com.yeshi.fanli.vo.goods.ShopInfoVO;
|
|
|
|
/**
|
* 店铺加工
|
* @author Administrator
|
*
|
*/
|
public class ShopInfoVOFactory {
|
|
|
/**
|
* 淘宝店铺
|
* @param goods 淘宝商品
|
* @param pid
|
* @param fanLiRate 返利比例
|
* @return
|
*/
|
public static ShopInfoVO convertTaoBaoShop(TaoBaoShop shop) {
|
ShopInfoVO shopInfoVO = new ShopInfoVO();
|
shopInfoVO.setId(shop.getId().toString());
|
shopInfoVO.setShopLink(shop.getShopLink());
|
shopInfoVO.setScoreGoods(shop.getScoreGoods());
|
shopInfoVO.setScoreSeller(shop.getScoreSeller());
|
shopInfoVO.setScoreLogistics(shop.getScoreLogistics());
|
shopInfoVO.setScoreGoodsD(shop.getScoreGoodsD());
|
shopInfoVO.setScoreSellerD(shop.getScoreSellerD());
|
shopInfoVO.setScoreLogisticsD(shop.getScoreLogisticsD());
|
shopInfoVO.setGoodRatePercentage(shop.getGoodRatePercentage());
|
|
Integer shopType = shop.getUserType();
|
if (shopType != null && shopType == 2) {
|
shopInfoVO.setUserType(11); // 天猫
|
} else {
|
shopInfoVO.setUserType(10); // 淘宝
|
}
|
|
String shopNameCustom = shop.getShopNameCustom();
|
if (!StringUtil.isNullOrEmpty(shopNameCustom)) {
|
shopInfoVO.setShopName(shopNameCustom);
|
} else {
|
shopInfoVO.setShopName(shop.getShopName());
|
}
|
|
String shopIconCustom = shop.getShopIconCustom();
|
if (!StringUtil.isNullOrEmpty(shopIconCustom)) {
|
shopInfoVO.setShopIcon(shopIconCustom);
|
} else {
|
shopInfoVO.setShopIcon(shop.getShopIcon());
|
}
|
return shopInfoVO;
|
}
|
|
|
/**
|
* 拼多多店铺
|
* @param goods 淘宝商品
|
* @param pid
|
* @param fanLiRate 返利比例
|
* @return
|
*/
|
public static ShopInfoVO convertPDDShop(PDDGoodsDetail goods) {
|
ShopInfoVO shopInfoVO = new ShopInfoVO();
|
shopInfoVO.setId(goods.getMallId().toString());
|
shopInfoVO.setShopName(goods.getMallName());
|
shopInfoVO.setUserType(30);
|
shopInfoVO.setScoreGoods(new BigDecimal(goods.getAvgDesc()));
|
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());
|
return shopInfoVO;
|
}
|
}
|