package com.yeshi.fanli.util.factory; import com.yeshi.fanli.entity.order.CommonOrderGoods; import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief; import com.yeshi.fanli.util.Constant; public class CommonOrderGoodsFactory { public static CommonOrderGoods create(TaoBaoGoodsBrief goods) { if (goods == null) return null; CommonOrderGoods orderGoods = new CommonOrderGoods(); orderGoods.setGoodsId(goods.getAuctionId() + ""); orderGoods.setGoodsType(Constant.SOURCE_TYPE_TAOBAO); orderGoods.setPicture(goods.getPictUrl()); orderGoods.setPrice(goods.getZkPrice()); orderGoods.setShopId(goods.getSellerId()); orderGoods.setShopName(goods.getShopTitle()); if (goods.getUserType() == 0) orderGoods.setShopType(CommonOrderGoods.TYPE_TAOBAO); else orderGoods.setShopType(CommonOrderGoods.TYPE_TMALL); orderGoods.setTitle(goods.getTitle()); return orderGoods; } }