admin
2019-01-03 b3007afcb9b8ca4302497a2c1c3e0d990b10a388
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
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;
    }
 
}