From 28cf328a098334b51a3e9d2d56f983fb8c862211 Mon Sep 17 00:00:00 2001 From: yujian <yujian@163.com> Date: 星期六, 23 五月 2020 09:54:38 +0800 Subject: [PATCH] 足迹、收藏订单兼容新需求 --- fanli/src/main/java/com/yeshi/fanli/service/impl/taobao/TaoBaoShopServiceImpl.java | 28 +++++++++++++++++----------- 1 files changed, 17 insertions(+), 11 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 1ee728d..60125f6 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 @@ -14,13 +14,17 @@ import org.yeshi.utils.tencentcloud.COSManager; import com.yeshi.fanli.dao.mybatis.taobao.TaoBaoShopMapper; +import com.yeshi.fanli.dto.ConfigParamsDTO; +import com.yeshi.fanli.entity.bus.user.vip.UserLevelEnum; import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief; import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBriefExtra; 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.OrderHongBaoMoneyComputeService; +import com.yeshi.fanli.service.inter.order.config.HongBaoManageService; import com.yeshi.fanli.service.inter.taobao.TaoBaoShopService; +import com.yeshi.fanli.util.FilePathEnum; import com.yeshi.fanli.util.StringUtil; import com.yeshi.fanli.util.db.MongoDBManager; import com.yeshi.fanli.util.factory.goods.GoodsDetailVOFactory; @@ -40,6 +44,9 @@ @Resource private HongBaoManageService hongBaoManageService; + + @Resource + private OrderHongBaoMoneyComputeService orderHongBaoMoneyComputeService; @Override public TaoBaoShopInfo getTaoBaoShopInfo(TaoBaoGoodsBrief goodsInfo) { @@ -133,7 +140,7 @@ String type = contentType.substring(contentType.indexOf("/") + 1); // 鏂囦欢璺緞 - String filePath = "/img/TaoBaoShop/" + UUID.randomUUID().toString().replace("-", "") + "." + type; + String filePath = FilePathEnum.taoBaoShop.getPath() + UUID.randomUUID().toString().replace("-", "") + "." + type; // 鎵ц涓婁紶 String fileLink = COSManager.getInstance().uploadFile(inputStream, filePath).getUrl(); @@ -172,7 +179,7 @@ return null; } - BigDecimal proportion = hongBaoManageService.getFanLiRate(); + BigDecimal proportion = hongBaoManageService.getFanLiRate(UserLevelEnum.daRen); for (TaoBaoShopVO taoBaoShopVO : list) { String shopLink = taoBaoShopVO.getShopLink(); @@ -199,20 +206,19 @@ } return list; } - - + @Override - @Cacheable(value = "brandCache", key = "'getShopByKeyV2-'+#key") - public List<TaoBaoShopVO> getShopByKeyV2(String key) { + @Cacheable(value = "brandCache", key = "'getShopByKeyV2-'+#key+'-'+#platform+'-'+#version") + public List<TaoBaoShopVO> getShopByKeyV2(String key, String platform, String version) { List<TaoBaoShopVO> list = taoBaoShopMapper.getShopByKey(key); if (list == null || list.size() == 0) { return null; } - BigDecimal fanLiRate = hongBaoManageService.getFanLiRate(); - BigDecimal shareRate = hongBaoManageService.getShareRate(); + ConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate(platform, version,UserLevelEnum.daRen); + for (TaoBaoShopVO taoBaoShopVO : list) { - + Integer userType = taoBaoShopVO.getUserType(); if (userType == null || userType == 0) { taoBaoShopVO.setUserType(10); @@ -238,7 +244,7 @@ List<GoodsDetailVO> listGoods = new ArrayList<GoodsDetailVO>(); List<TaoBaoGoodsBrief> listGoodsBrief = taoBaoShopVO.getListGoodsBrief(); for (TaoBaoGoodsBrief taoBaoGoodsBrief : listGoodsBrief) { - GoodsDetailVO goodsDetailVO = GoodsDetailVOFactory.convertTaoBao(taoBaoGoodsBrief, null, fanLiRate, shareRate); + GoodsDetailVO goodsDetailVO = GoodsDetailVOFactory.convertTaoBao(taoBaoGoodsBrief, paramsDTO); listGoods.add(goodsDetailVO); } taoBaoShopVO.setListGoodsVO(listGoods); -- Gitblit v1.8.0