yj
2020-03-06 207dc8655711cddac2653e18b51e58a88dba2084
fanli/src/main/java/com/yeshi/fanli/service/impl/taobao/TaoBaoShopServiceImpl.java
@@ -14,6 +14,7 @@
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.taobao.TaoBaoGoodsBrief;
import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBriefExtra;
import com.yeshi.fanli.entity.taobao.TaoBaoShop;
@@ -21,6 +22,7 @@
import com.yeshi.fanli.log.LogHelper;
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;
@@ -133,7 +135,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();
@@ -199,20 +201,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 = hongBaoManageService.getShowComputeRate(platform, version);
      for (TaoBaoShopVO taoBaoShopVO : list) {
         Integer userType = taoBaoShopVO.getUserType();
         if (userType == null || userType == 0) {
            taoBaoShopVO.setUserType(10);
@@ -238,7 +239,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);