From 2b35e920a8873ba81530f4d86002a459185725ff Mon Sep 17 00:00:00 2001 From: admin <weikou2014> Date: 星期五, 06 九月 2019 16:44:58 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/div' into div --- fanli/src/main/java/com/yeshi/fanli/service/impl/brand/BrandClassShopServiceImpl.java | 95 +++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 95 insertions(+), 0 deletions(-) diff --git a/fanli/src/main/java/com/yeshi/fanli/service/impl/brand/BrandClassShopServiceImpl.java b/fanli/src/main/java/com/yeshi/fanli/service/impl/brand/BrandClassShopServiceImpl.java index dff37a4..b9308cb 100644 --- a/fanli/src/main/java/com/yeshi/fanli/service/impl/brand/BrandClassShopServiceImpl.java +++ b/fanli/src/main/java/com/yeshi/fanli/service/impl/brand/BrandClassShopServiceImpl.java @@ -524,4 +524,99 @@ } + + @Override + public List<TaoBaoShopVO> listEffectiveShop(long start, int count, Long cid) { + if (cid != null && cid <= 0) { + cid = null; + } + + List<TaoBaoShopVO> listInfo = taoBaoShopService.listBrandShopinfo(start, count, cid); + if (listInfo == null || listInfo.size() == 0) + return listInfo; + + + BigDecimal fanLiRate = hongBaoManageService.getFanLiRate(); + BigDecimal shareRate = hongBaoManageService.getShareRate(); + + // 娣樺疂鍟嗗搧淇℃伅杩囨护 + Map<Long, TaoBaoGoodsBrief> goodsMap = getFilterTaoBaoGoods(listInfo); + + for (TaoBaoShopVO taoBaoShopVO : listInfo) { + 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(); + // 鍟嗗搧娣诲姞鍒版洿鏂伴槦鍒� + taoBaoGoodsUpdateService.addUpdateQueueAsync(listGoodsBrief); + for (TaoBaoGoodsBrief taoBaoGoodsBrief : listGoodsBrief) { + GoodsDetailVO goodsDetailVO = GoodsDetailVOFactory + .convertTaoBao(goodsMap.get(taoBaoGoodsBrief.getAuctionId()), null, fanLiRate, shareRate); + listGoods.add(goodsDetailVO); + } + taoBaoShopVO.setListGoodsVO(listGoods); + } + return listInfo; + } + + + @Override + public long countBrandShopinfo(Long cid) { + if (cid != null && cid <= 0) { + cid = null; + } + return taoBaoShopService.countBrandShopinfo(cid); + } + + + + @Override + public List<TaoBaoShop> listEffectiveClassShop(Long cid) { + if (cid == null && cid <= 0) + return null; + + List<BrandClassShop> list = brandClassShopMapper.listEffective(cid); + if (list == null || list.size() == 0) + return null; + + List<TaoBaoShop> listShop = new ArrayList<TaoBaoShop>(); + for (BrandClassShop brandClassShop : list) { + TaoBaoShop shop = brandClassShop.getShop(); + if (shop != null) { + Integer userType = shop.getUserType(); + if (userType == null || userType == 0) { + shop.setUserType(10); + } else { + shop.setUserType(11); + } + + String shopLink = shop.getShopLink(); + if (StringUtil.isNullOrEmpty(shopLink)) { + shop.setShopLink(TaoBaoUtil.getShopLink(shop.getId())); + } + + String shopNameCustom = shop.getShopNameCustom(); + if (!StringUtil.isNullOrEmpty(shopNameCustom)) { + shop.setShopName(shopNameCustom); + } + + String shopIconCustom = shop.getShopIconCustom(); + if (!StringUtil.isNullOrEmpty(shopIconCustom)) { + shop.setShopIcon(shopIconCustom); + } + + listShop.add(shop); + } + } + return listShop; + } + } -- Gitblit v1.8.0