| | |
| | | import com.yeshi.fanli.entity.jd.JDGoods; |
| | | import com.yeshi.fanli.util.StringUtil; |
| | | import com.yeshi.fanli.util.factory.goods.TaoBaoGoodsFactory; |
| | | import com.yeshi.fanli.util.goods.douyin.DYUtil; |
| | | import com.yeshi.fanli.util.goods.douyin.vo.DYGoods; |
| | | import com.yeshi.fanli.util.goods.douyin.vo.DYGoodsDetail; |
| | | import com.yeshi.fanli.util.jd.JDUtil; |
| | | import com.yeshi.fanli.util.taobao.TaoBaoUtil; |
| | | import com.yeshi.goods.facade.dto.taobao.haodanku.HaoDanKuJDGoodsInfo; |
| | | import com.yeshi.goods.facade.dto.taobao.haodanku.HaoDanKuPDDGoodsInfo; |
| | | import com.yeshi.goods.facade.entity.taobao.TaoBaoGoodsBrief; |
| | |
| | | cg.setCouponLeftCount(goods.getCouponLeftCount()); |
| | | cg.setCouponStartPrice(goods.getCouponStartFee()); |
| | | cg.setCouponTotalCount(goods.getCouponTotalCount()); |
| | | cg.setGoodsId(goods.getAuctionId()); |
| | | cg.setGoodsId(TaoBaoUtil.getAuctionId(goods.getAuctionId())); |
| | | if(TaoBaoUtil.isNewAuctionId(goods.getAuctionId())){ |
| | | cg.setGoodsSign(goods.getAuctionId()); |
| | | } |
| | | cg.setGoodsType(CommonGoods.GOODS_TYPE_TB); |
| | | cg.setPicture(goods.getPictUrl()); |
| | | cg.setPictureWhite(goods.getPictUrlWhite()); |
| | |
| | | cg.setSellerName(shopInfo.getShopName() == null ? "" : shopInfo.getShopName()); |
| | | } |
| | | |
| | | cg.setGoodsId(goods.getSkuId()+""); |
| | | cg.setGoodsId(goods.getItemId()+""); |
| | | cg.setTitle(goods.getSkuName()); |
| | | cg.setGoodsType(CommonGoods.GOODS_TYPE_JD); |
| | | cg.setPicture(goods.getPicUrl()); |
| | |
| | | return cg; |
| | | } |
| | | |
| | | |
| | | public static CommonGoods create(DYGoodsDetail goods) { |
| | | if (goods == null) |
| | | return null; |
| | | |
| | | CommonGoods cg = new CommonGoods(); |
| | | |
| | | // 折扣信息 |
| | | cg.setCouponLeftCount(0); |
| | | cg.setCouponTotalCount(0); |
| | | cg.setCouponAmount(new BigDecimal(0)); |
| | | |
| | | cg.setCouponTotalCount(0); |
| | | cg.setGoodsId(goods.getProduct_id()+""); |
| | | cg.setGoodsType(CommonGoods.GOODS_TYPE_DY); |
| | | cg.setPicture(goods.getCover()); |
| | | cg.setPictureWhite(null); |
| | | cg.setPrice(MoneyBigDecimalUtil.div(new BigDecimal(goods.getPrice()),new BigDecimal(100),2)); |
| | | |
| | | cg.setSales(goods.getSales()); |
| | | cg.setRate(DYUtil.getCosRatio(goods).multiply(new BigDecimal(100))); |
| | | cg.setSellerId((long)goods.getShop_id()); |
| | | cg.setSellerName(goods.getShop_name()); |
| | | cg.setShopType(CommonGoods.SHOP_TYPE_DY); |
| | | cg.setState(CommonGoods.STATE_NORMAL); |
| | | cg.setTitle(goods.getTitle()); |
| | | // 保留字段 |
| | | cg.setVideoCover(null); |
| | | cg.setVideoUrl(null); |
| | | cg.setMaterialLibType(1); |
| | | |
| | | // 分类信息 |
| | | CategoryInfoDTO categoryInfo = new CategoryInfoDTO(); |
| | | categoryInfo.setCid1((long)goods.getFirst_cid()); |
| | | categoryInfo.setCid1Name(""); |
| | | cg.setCategoryInfo(JSONObject.toJSON(categoryInfo).toString()); |
| | | return cg; |
| | | } |
| | | |
| | | |
| | | public static CommonGoods create(DYGoods goods) { |
| | | if (goods == null) |
| | | return null; |
| | | |
| | | CommonGoods cg = new CommonGoods(); |
| | | |
| | | // 折扣信息 |
| | | cg.setCouponLeftCount(0); |
| | | cg.setCouponTotalCount(0); |
| | | cg.setCouponAmount(new BigDecimal(0)); |
| | | |
| | | cg.setCouponTotalCount(0); |
| | | cg.setGoodsId(goods.getProduct_id()+""); |
| | | cg.setGoodsType(CommonGoods.GOODS_TYPE_DY); |
| | | cg.setPicture(goods.getCover()); |
| | | cg.setPictureWhite(null); |
| | | cg.setPrice(MoneyBigDecimalUtil.div(new BigDecimal(goods.getPrice()),new BigDecimal(100),2)); |
| | | |
| | | int totalSales = 0; |
| | | cg.setSales(totalSales); |
| | | cg.setRate(DYUtil.getCosRatio(goods)); |
| | | cg.setSellerId((long)goods.getShop_id()); |
| | | cg.setSellerName(goods.getShop_name()); |
| | | cg.setShopType(CommonGoods.SHOP_TYPE_DY); |
| | | cg.setState(CommonGoods.STATE_NORMAL); |
| | | cg.setTitle(goods.getTitle()); |
| | | // 保留字段 |
| | | cg.setVideoCover(null); |
| | | cg.setVideoUrl(null); |
| | | cg.setMaterialLibType(1); |
| | | |
| | | // 分类信息 |
| | | CategoryInfoDTO categoryInfo = new CategoryInfoDTO(); |
| | | categoryInfo.setCid1((long)goods.getFirst_cid()); |
| | | categoryInfo.setCid1Name(""); |
| | | cg.setCategoryInfo(JSONObject.toJSON(categoryInfo).toString()); |
| | | return cg; |
| | | } |
| | | |
| | | public static CommonGoods create(SuningGoodsInfo goods) { |
| | | if (goods == null) |
| | | return null; |