| | |
| | | package com.yeshi.fanli.job; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | import org.springframework.scheduling.annotation.Scheduled; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import com.yeshi.fanli.entity.bus.activity.RecommendActivity; |
| | | import com.yeshi.fanli.exception.ActivityException; |
| | | import com.yeshi.fanli.log.LogHelper; |
| | |
| | | import com.yeshi.fanli.service.inter.taobao.TLJBuyGoodsService; |
| | | import com.yeshi.fanli.service.inter.taobao.TaoBaoGoodsActivityService; |
| | | 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; |
| | | import com.yeshi.fanli.util.mq.rabbit.RabbitmqManager; |
| | | import org.springframework.scheduling.annotation.Scheduled; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 淘宝商品更细 |
| | |
| | | |
| | | @Resource |
| | | private HttpGoodsCacheManager httpGoodsCacheManager; |
| | | |
| | | @Resource |
| | | private RabbitmqManager rabbitmqManager; |
| | | |
| | | // 动态商品更新 ,1个小时更新 |
| | | @Scheduled(cron = "0 0 */1 * * ?") |
| | |
| | | if (!Constant.IS_TASK) |
| | | return; |
| | | |
| | | List<Long> list = taoBaoGoodsUpdateService.listNeedUpdateGoodsId(0, 2000, 4); |
| | | List<String> list = taoBaoGoodsUpdateService.listNeedUpdateGoodsId(0, 2000, 4); |
| | | if (list == null || list.size() == 0) { |
| | | return; |
| | | } |
| | | |
| | | for (Long id : list) { |
| | | for (String id : list) { |
| | | try { |
| | | CMQManager.getInstance().addNeedUpdateTaoBaoGoodsId(id); |
| | | rabbitmqManager.addNeedUpdateTaoBaoGoodsId(id); |
| | | } catch (Exception e) { |
| | | LogHelper.errorDetailInfo(e); |
| | | } |