| | |
| | | import com.yeshi.fanli.dto.jd.JDCouponInfo;
|
| | | import com.yeshi.fanli.dto.jd.JDShopInfo;
|
| | | import com.yeshi.fanli.dto.pdd.PDDGoodsDetail;
|
| | | import com.yeshi.fanli.dto.vip.goods.VIPGoodsInfo;
|
| | | import com.yeshi.fanli.entity.goods.CommonGoods;
|
| | | import com.yeshi.fanli.entity.jd.JDGoods;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief;
|
| | |
| | | cg.setState(goods.getState());
|
| | | cg.setMaterialLibType(goods.getMaterialLibType());
|
| | |
|
| | | |
| | | // 分类信息
|
| | | CategoryInfoDTO categoryInfo = new CategoryInfoDTO();
|
| | | Integer rootCatId = goods.getRootCatId();
|
| | |
| | |
|
| | | return cg;
|
| | | }
|
| | |
|
| | |
|
| | | /**
|
| | | * 淘宝商品构造
|
| | |
| | | other.setIsFreeShipping(goods.getIsFreeShipping()); // 是否包邮
|
| | | cg.setOtherInfo(JSONObject.toJSON(other).toString());
|
| | |
|
| | | |
| | | // 分类信息
|
| | | JDCategoryInfo categoryJD = goods.getCategoryInfo();
|
| | | if (categoryJD != null) {
|
| | |
| | | cg.setVideoUrl(null);
|
| | | return cg;
|
| | | }
|
| | |
|
| | |
|
| | | public static CommonGoods create(PDDGoodsDetail goods) {
|
| | | if (goods == null)
|
| | |
| | | categoryInfo.setCid1Name(goods.getCategoryName());
|
| | | cg.setCategoryInfo(JSONObject.toJSON(categoryInfo).toString());
|
| | |
|
| | | return cg;
|
| | | }
|
| | |
|
| | | public static CommonGoods create(VIPGoodsInfo goods) {
|
| | | if (goods == null)
|
| | | return null;
|
| | |
|
| | | CommonGoods cg = new CommonGoods();
|
| | |
|
| | | // 折扣信息
|
| | | cg.setCouponInfo(new BigDecimal(goods.getDiscount()) + "");
|
| | | cg.setCouponLeftCount(0);
|
| | | cg.setCouponStartPrice(new BigDecimal(0));
|
| | | cg.setCouponAmount(new BigDecimal(0));
|
| | |
|
| | | cg.setCouponTotalCount(0);
|
| | | cg.setGoodsId(Long.parseLong(goods.getGoodsId()));
|
| | | cg.setGoodsType(CommonGoods.GOODS_TYPE_PDD);
|
| | | cg.setPicture(goods.getGoodsThumbUrl());
|
| | | cg.setPictureWhite(null);
|
| | | cg.setPrice(new BigDecimal(goods.getMarketPrice()));
|
| | |
|
| | | int totalSales = 0;
|
| | | cg.setSales(totalSales);
|
| | | cg.setRate(new BigDecimal(goods.getCommissionRate()));
|
| | | cg.setSellerId(goods.getBrandId());
|
| | | cg.setSellerName(goods.getBrandName());
|
| | | cg.setShopType(CommonGoods.SHOP_TYPE_PDD);
|
| | | cg.setState(CommonGoods.STATE_NORMAL);
|
| | | cg.setTitle(goods.getGoodsName());
|
| | | // 保留字段
|
| | | cg.setVideoCover(null);
|
| | | cg.setVideoUrl(null);
|
| | | cg.setState(goods.getStatus() == 1 ? CommonGoods.STATE_NORMAL : CommonGoods.STATE_OFFLINE);
|
| | | cg.setMaterialLibType(1);
|
| | |
|
| | | // 分类信息
|
| | | CategoryInfoDTO categoryInfo = new CategoryInfoDTO();
|
| | | categoryInfo.setCid1(goods.getCategoryId());
|
| | | categoryInfo.setCid1Name(goods.getCategoryName());
|
| | | cg.setCategoryInfo(JSONObject.toJSON(categoryInfo).toString());
|
| | |
|
| | | return cg;
|
| | | }
|