admin
2019-11-23 51a4ff5d777028d52a19c314a99f796334cb7b51
fanli/src/main/java/com/yeshi/fanli/service/impl/taobao/TLJBuyGoodsServiceImpl.java
@@ -11,6 +11,7 @@
import javax.annotation.Resource;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.cache.ehcache.EhCacheCacheManager;
import org.springframework.stereotype.Service;
@@ -24,6 +25,7 @@
import com.yeshi.fanli.entity.taobao.dataoke.DaTaoKeDetailV2;
import com.yeshi.fanli.exception.taobao.TaoKeApiException;
import com.yeshi.fanli.exception.tlj.TaoLiJinCreateException;
import com.yeshi.fanli.log.LogHelper;
import com.yeshi.fanli.service.inter.goods.TaoBaoGoodsBriefService;
import com.yeshi.fanli.service.inter.taobao.TLJBuyGoodsService;
import com.yeshi.fanli.service.inter.taobao.TaoBaoGoodsUpdateService;
@@ -100,7 +102,7 @@
               // 过滤淘礼金大于10块钱的
               BigDecimal hongBao = TaoBaoUtil.getGoodsHongBaoMoney(list.get(i).getGoods(),
                     TaoBaoConstant.OWN_BUY_WITHOUT_FANLI_RATE);
               if (hongBao.compareTo(new BigDecimal(20)) > 0) {
               if (hongBao.compareTo(new BigDecimal(10)) > 0) {
                  list.remove(i--);
               }
            }
@@ -186,6 +188,9 @@
               new Date(System.currentTimeMillis() + 1000 * 60 * 60 * 6), new Date(),
               new Date(System.currentTimeMillis() + 1000 * 60 * 60 * 6), app);
      } catch (TaoLiJinCreateException e1) {
         LogHelper.test("商品ID:"+auctionId);
         LogHelper.test("淘礼金验证出错:"+e1.getMsg());
         if (e1.getCode() == TaoLiJinCreateException.CODE_TLJ_FORBIDDEN) {
            // 该商品不支持创建淘礼金红包
            deleteByGoodsId(auctionId);
@@ -270,6 +275,9 @@
   @Override
   public void removeGoods(Long auctionId) {
      tljBuyGoodsDao.deleteByAuctionId(auctionId);
      // 清除列表缓存
      ehCacheCacheManager.getCache("commonContentCache")
            .evict("tljBuy-listByDay" + TimeUtil.getGernalTime(System.currentTimeMillis(), "yyyy-MM-dd"));
   }
}