From ee26d58531067afff8e036efa93cb0d57a773250 Mon Sep 17 00:00:00 2001 From: admin <weikou2014> Date: 星期三, 05 十二月 2018 16:19:34 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/master' --- fanli/src/main/java/com/yeshi/fanli/util/factory/CollectionGoodsFactory.java | 15 +++++++++++++-- 1 files changed, 13 insertions(+), 2 deletions(-) diff --git a/fanli/src/main/java/com/yeshi/fanli/util/factory/CollectionGoodsFactory.java b/fanli/src/main/java/com/yeshi/fanli/util/factory/CollectionGoodsFactory.java index 1a01fca..cc86950 100644 --- a/fanli/src/main/java/com/yeshi/fanli/util/factory/CollectionGoodsFactory.java +++ b/fanli/src/main/java/com/yeshi/fanli/util/factory/CollectionGoodsFactory.java @@ -1,12 +1,23 @@ package com.yeshi.fanli.util.factory; import com.yeshi.fanli.entity.bus.user.CollectionGoods; -import com.yeshi.fanli.goods.CollectionGoodsV2; +import com.yeshi.fanli.entity.goods.CollectionGoodsV2; +import com.yeshi.fanli.entity.goods.CommonGoods; +import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief; +import com.yeshi.fanli.util.taobao.TaoBaoUtil; public class CollectionGoodsFactory { public static CollectionGoods create(CollectionGoodsV2 collectionGoods) { - return null; + if (collectionGoods == null) + return null; + CollectionGoods cg = null; + CommonGoods commnonGoods = collectionGoods.getCommonGoods(); + TaoBaoGoodsBrief taoBaoGoods = TaoBaoUtil.convert(commnonGoods); + cg = TaoBaoUtil.getCollectionGoods(taoBaoGoods, collectionGoods.getUserInfo()); + if (cg != null) + cg.setId(collectionGoods.getId()); + return cg; } } -- Gitblit v1.8.0