yujian
2019-10-29 9b55262bb45c81c997ab04e55e8de13e14b8ca7d
fanli/src/main/java/com/yeshi/fanli/job/BrandInfoJob.java
@@ -1,10 +1,13 @@
package com.yeshi.fanli.job;
import java.util.Date;
import javax.annotation.Resource;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import org.yeshi.utils.DateUtil;
import com.yeshi.fanli.log.LogHelper;
import com.yeshi.fanli.service.inter.brand.BrandInfoService;
import com.yeshi.fanli.util.Constant;
@@ -23,7 +26,7 @@
   /**
    * 每两个小时进行更新品牌商品信息
    */
   @Scheduled(cron = "0 0 1/2 * * ? ")
//   @Scheduled(cron = "0 0 1/2 * * ? ")
   public void updateGoods() {
      if (!Constant.IS_TASK)
         return;
@@ -36,5 +39,20 @@
         brandInfoService.addShopAndGoods((page - 1) * 100, 100);
      }
   }
   /**
    * 清理前一天的
    */
//   @Scheduled(cron = "0 10 0 * * ? ")
   public void removeAgoByDate() {
      if (!Constant.IS_TASK)
         return;
      try {
         brandInfoService.removeAgoByDate(DateUtil.reduceDay(1, new Date()));
      } catch (Exception e) {
         LogHelper.errorDetailInfo(e);
      }
   }
}