yujian
2020-01-18 f4a0f2acc63d7785eab108419a4e16f5f688cb95
fanli/src/main/java/com/yeshi/fanli/job/UpdateTaoBaoGoodsJob.java
@@ -12,6 +12,7 @@
import com.yeshi.fanli.exception.ActivityException;
import com.yeshi.fanli.log.LogHelper;
import com.yeshi.fanli.service.inter.activity.ActivityService;
import com.yeshi.fanli.service.inter.brand.BrandClassShopGoodsService;
import com.yeshi.fanli.service.inter.brand.BrandClassShopService;
import com.yeshi.fanli.service.inter.goods.TaoBaoGoodsBriefService;
import com.yeshi.fanli.service.inter.lable.LabelService;
@@ -23,6 +24,7 @@
import com.yeshi.fanli.service.inter.taobao.TaoBaoGoodsUpdateService;
import com.yeshi.fanli.util.CMQManager;
import com.yeshi.fanli.util.Constant;
import com.yeshi.fanli.util.cache.HttpGoodsCacheManager;
/**
 * 淘宝商品更细
@@ -63,6 +65,12 @@
   @Resource
   private TLJBuyGoodsService tljBuyGoodsService;
   @Resource
   private BrandClassShopGoodsService brandClassShopGoodsService;
   @Resource
   private HttpGoodsCacheManager httpGoodsCacheManager;
   // 动态商品更新 ,1个小时更新
   @Scheduled(cron = "0 0 */1 * * ?")
@@ -162,11 +170,29 @@
      }
   }
   // 更新品牌商品,每天早上6点执行一次
   // 更新增加品牌商品,每天早上6点执行一次
   @Scheduled(cron = "0 0 6 * * ? ")
   public void updateBrandGoods() {
   public void updateAddBrandGoods() {
      if (!Constant.IS_TASK)
         return;
      brandClassShopService.updateShopGoods();
   }
   // 更新原有精品库的品牌商品,每天凌晨3点执行一次
   @Scheduled(cron = "0 0 3 * * ? ")
   public void updateBrandGoods() {
      if (!Constant.IS_TASK)
         return;
      brandClassShopGoodsService.startUpdateGoods();
   }
   // 每天凌晨4点模拟请求
   @Scheduled(cron = "0 0 4 * * ? ")
   public void simulateRequest() {
      httpGoodsCacheManager.requestHomeRecommend();
      httpGoodsCacheManager.requestClassGoods();
      httpGoodsCacheManager.requestBrandGoods();
      httpGoodsCacheManager.requestDynamic();
      httpGoodsCacheManager.requestCommonTemplate();
   }
}