From db88b87df461820152d68d3d55a28f30c2da83e6 Mon Sep 17 00:00:00 2001
From: admin <weikou2014>
Date: 星期五, 20 九月 2019 17:54:42 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/div' into div

---
 fanli/src/main/java/com/yeshi/fanli/service/impl/taobao/TaoBaoShopServiceImpl.java |   50 +++++++++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 49 insertions(+), 1 deletions(-)

diff --git a/fanli/src/main/java/com/yeshi/fanli/service/impl/taobao/TaoBaoShopServiceImpl.java b/fanli/src/main/java/com/yeshi/fanli/service/impl/taobao/TaoBaoShopServiceImpl.java
index 1cc4323..f6d10e7 100644
--- a/fanli/src/main/java/com/yeshi/fanli/service/impl/taobao/TaoBaoShopServiceImpl.java
+++ b/fanli/src/main/java/com/yeshi/fanli/service/impl/taobao/TaoBaoShopServiceImpl.java
@@ -19,13 +19,15 @@
 import com.yeshi.fanli.entity.taobao.TaoBaoShop;
 import com.yeshi.fanli.entity.taobao.TaoBaoShopInfo;
 import com.yeshi.fanli.log.LogHelper;
-import com.yeshi.fanli.service.inter.hongbao.HongBaoManageService;
+import com.yeshi.fanli.service.inter.order.config.HongBaoManageService;
 import com.yeshi.fanli.service.inter.taobao.TaoBaoShopService;
 import com.yeshi.fanli.util.StringUtil;
 import com.yeshi.fanli.util.db.MongoDBManager;
+import com.yeshi.fanli.util.factory.goods.GoodsDetailVOFactory;
 import com.yeshi.fanli.util.taobao.TaoBaoShopUtil;
 import com.yeshi.fanli.util.taobao.TaoBaoUtil;
 import com.yeshi.fanli.vo.brand.TaoBaoShopVO;
+import com.yeshi.fanli.vo.goods.GoodsDetailVO;
 
 @Service
 public class TaoBaoShopServiceImpl implements TaoBaoShopService {
@@ -197,4 +199,50 @@
 		}
 		return list;
 	}
+	
+	
+	@Override
+	@Cacheable(value = "brandCache", key = "'getShopByKeyV2-'+#key")
+	public List<TaoBaoShopVO> getShopByKeyV2(String key) {
+		List<TaoBaoShopVO> list = taoBaoShopMapper.getShopByKey(key);
+		if (list == null || list.size() == 0) {
+			return null;
+		}
+
+		BigDecimal fanLiRate = hongBaoManageService.getFanLiRate();
+		BigDecimal shareRate = hongBaoManageService.getShareRate();
+		for (TaoBaoShopVO taoBaoShopVO : list) {
+			
+			Integer userType = taoBaoShopVO.getUserType();
+			if (userType == null || userType == 0) {
+				taoBaoShopVO.setUserType(10);
+			} else {
+				taoBaoShopVO.setUserType(11);
+			}
+
+			String shopLink = taoBaoShopVO.getShopLink();
+			if (StringUtil.isNullOrEmpty(shopLink)) {
+				taoBaoShopVO.setShopLink(TaoBaoUtil.getShopLink(taoBaoShopVO.getId()));
+			}
+
+			String shopNameCustom = taoBaoShopVO.getShopNameCustom();
+			if (!StringUtil.isNullOrEmpty(shopNameCustom)) {
+				taoBaoShopVO.setShopName(shopNameCustom);
+			}
+
+			String shopIconCustom = taoBaoShopVO.getShopIconCustom();
+			if (!StringUtil.isNullOrEmpty(shopIconCustom)) {
+				taoBaoShopVO.setShopIcon(shopIconCustom);
+			}
+
+			List<GoodsDetailVO> listGoods = new ArrayList<GoodsDetailVO>();
+			List<TaoBaoGoodsBrief> listGoodsBrief = taoBaoShopVO.getListGoodsBrief();
+			for (TaoBaoGoodsBrief taoBaoGoodsBrief : listGoodsBrief) {
+				GoodsDetailVO goodsDetailVO = GoodsDetailVOFactory.convertTaoBao(taoBaoGoodsBrief, null, fanLiRate, shareRate);
+				listGoods.add(goodsDetailVO);
+			}
+			taoBaoShopVO.setListGoodsVO(listGoods);
+		}
+		return list;
+	}
 }

--
Gitblit v1.8.0