admin
2019-08-12 6d933cb7a7345b8fc9fd51be52b79ec4cd837a13
fanli/src/main/java/com/yeshi/fanli/service/impl/brand/BrandClassShopServiceImpl.java
@@ -29,6 +29,7 @@
import com.yeshi.fanli.service.inter.goods.TaoBaoGoodsBriefService;
import com.yeshi.fanli.service.inter.hongbao.HongBaoManageService;
import com.yeshi.fanli.service.inter.lable.QualityGoodsService;
import com.yeshi.fanli.service.inter.taobao.TaoBaoGoodsUpdateService;
import com.yeshi.fanli.service.inter.taobao.TaoBaoShopService;
import com.yeshi.fanli.util.Constant;
import com.yeshi.fanli.util.StringUtil;
@@ -63,6 +64,9 @@
   @Resource
   private TaoBaoGoodsBriefService taoBaoGoodsBriefService;
   @Resource
   private TaoBaoGoodsUpdateService taoBaoGoodsUpdateService;
   @Override
   public List<BrandClassShop> getExistByShopIds(List<Long> list) {
@@ -128,8 +132,8 @@
   @Override
   @Transactional
   public void changeShopInfo(MultipartFile file, Long id, Long cid, String shopName, Integer state, Integer top,String key)
         throws BrandClassShopException {
   public void changeShopInfo(MultipartFile file, Long id, Long cid, String shopName, Integer state, Integer top,
         String key) throws BrandClassShopException {
      if (id == null) {
         throw new BrandClassShopException(1, "数据为空:请选择店铺");
@@ -150,7 +154,7 @@
      }
      // 自定义图片
      taoBaoShopService.changeInfo(file, shop.getId(), shopName,key);
      taoBaoShopService.changeInfo(file, shop.getId(), shopName, key);
      BrandClassShop updateshop = new BrandClassShop();
      updateshop.setState(state);
@@ -170,7 +174,8 @@
      for (BrandClassShop brandClassShop : listQuery) {
         TaoBaoShop shop = brandClassShop.getShop();
         if (shop != null) {
            long couponNum = commonGoodsService.countBySellerIdAndHasCoupon(shop.getId(), Constant.SOURCE_TYPE_TAOBAO);
            long couponNum = commonGoodsService.countBySellerIdAndHasCoupon(shop.getId(),
                  Constant.SOURCE_TYPE_TAOBAO);
            brandClassShop.setCouponNum(couponNum);
            String shopLink = shop.getShopLink();
@@ -337,8 +342,6 @@
      return data;
   }
   @Override
   @Cacheable(value = "brandCache", key = "'listEffectiveCacheV2-'+#page+'-'+#cid")
   public JSONObject listEffectiveCacheV2(int page, Long cid) {
@@ -361,6 +364,14 @@
         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()));
@@ -398,6 +409,13 @@
      BigDecimal shareRate = hongBaoManageService.getShareRate();
      for (TaoBaoShopVO taoBaoShopVO : listInfo) {
         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()));
@@ -415,8 +433,11 @@
         List<GoodsDetailVO> listGoods = new ArrayList<GoodsDetailVO>();
         List<TaoBaoGoodsBrief> listGoodsBrief = taoBaoShopVO.getListGoodsBrief();
         // 商品添加到更新队列
         taoBaoGoodsUpdateService.addUpdateQueueAsync(listGoodsBrief);
         for (TaoBaoGoodsBrief taoBaoGoodsBrief : listGoodsBrief) {
            GoodsDetailVO goodsDetailVO = GoodsDetailVOFactory.convertTaoBao(taoBaoGoodsBrief, null, fanLiRate, shareRate);
            GoodsDetailVO goodsDetailVO = GoodsDetailVOFactory.convertTaoBao(taoBaoGoodsBrief, null, fanLiRate,
                  shareRate);
            listGoods.add(goodsDetailVO);
         }
         taoBaoShopVO.setListGoodsVO(listGoods);
@@ -426,9 +447,7 @@
      return data;
   }
   @Override
   public void addClick(Long shopId) {
      BrandClassShop brandClassShop = brandClassShopMapper.getByShopId(shopId);