From f4a0f2acc63d7785eab108419a4e16f5f688cb95 Mon Sep 17 00:00:00 2001 From: yujian <yujian@163.com> Date: 星期六, 18 一月 2020 12:06:27 +0800 Subject: [PATCH] 用户注册信息 --- fanli/src/main/java/com/yeshi/fanli/job/UpdateTaoBaoGoodsJob.java | 91 ++++++++++++++++++++++++++++++++++----------- 1 files changed, 69 insertions(+), 22 deletions(-) diff --git a/fanli/src/main/java/com/yeshi/fanli/job/UpdateTaoBaoGoodsJob.java b/fanli/src/main/java/com/yeshi/fanli/job/UpdateTaoBaoGoodsJob.java index 5401b25..3f4252f 100644 --- a/fanli/src/main/java/com/yeshi/fanli/job/UpdateTaoBaoGoodsJob.java +++ b/fanli/src/main/java/com/yeshi/fanli/job/UpdateTaoBaoGoodsJob.java @@ -1,5 +1,6 @@ package com.yeshi.fanli.job; +import java.util.Date; import java.util.List; import javax.annotation.Resource; @@ -11,13 +12,19 @@ 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; import com.yeshi.fanli.service.inter.lable.QualityFactoryService; import com.yeshi.fanli.service.inter.lable.QualityFlashSaleService; +import com.yeshi.fanli.service.inter.taobao.ShareHotGoodsService; +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; /** * 娣樺疂鍟嗗搧鏇寸粏 @@ -46,6 +53,24 @@ @Resource private QualityFlashSaleService qualityFlashSaleService; + + @Resource + private BrandClassShopService brandClassShopService; + + @Resource + private TaoBaoGoodsActivityService taoBaoGoodsActivityService; + + @Resource + private ShareHotGoodsService shareHotGoodsService; + + @Resource + private TLJBuyGoodsService tljBuyGoodsService; + + @Resource + private BrandClassShopGoodsService brandClassShopGoodsService; + + @Resource + private HttpGoodsCacheManager httpGoodsCacheManager; // 鍔ㄦ�佸晢鍝佹洿鏂� 锛�1涓皬鏃舵洿鏂� @Scheduled(cron = "0 0 */1 * * ?") @@ -83,10 +108,7 @@ } try { - LogHelper.test("---鎵ц--updateQualityFactoryWeightJob--"); - - qualityFactoryService.updateWeight(10, 3); - + qualityFactoryService.updateWeight(1, 4); } catch (Exception e) { LogHelper.errorDetailInfo(e); } @@ -102,23 +124,25 @@ taoBaoGoodsUpdateService.deleteOutOfDate(); } - // 娣诲姞绮鹃�夊簱涓渶瑕佹洿鏂扮殑娣樺疂鍟嗗搧ID(2涓皬鏃舵墽琛屼竴娆�) - @Scheduled(cron = "0 0 1/2 * * ? ") - public void addNeddUpdateTaoBaoGoods() { - if (!Constant.IS_TASK) { + /** + * 鏇存柊瓒呰繃4涓皬鏃舵湭鏇存柊鐨勫晢鍝� + */ + // 1涓皬鏃舵洿鏂� + @Scheduled(cron = "0 0 1/1 * * ? ") + public void addNeedUpdateTaoBaoGoods() { + if (!Constant.IS_TASK) + return; + + List<Long> list = taoBaoGoodsUpdateService.listNeedUpdateGoodsId(0, 2000, 4); + if (list == null || list.size() == 0) { return; } - LogHelper.test("---addNeddUpdateTaoBaoGoods----execute "); - - List<Long> list = qualityFactoryService.queryNeedUpdate(0, 3000, 4); - if (list != null) { - for (Long id : list) { - try { - CMQManager.getInstance().addNeedUpdateTaoBaoGoodsId(id); - } catch (Exception e) { - LogHelper.errorDetailInfo(e); - } + for (Long id : list) { + try { + CMQManager.getInstance().addNeedUpdateTaoBaoGoodsId(id); + } catch (Exception e) { + LogHelper.errorDetailInfo(e); } } } @@ -128,15 +152,13 @@ */ @Scheduled(cron = "0 15 0/6 * * ? ") public void removeFlashSaleGoods() { - if (!Constant.IS_TASK) { return; } try { while (true) { - List<Long> list = qualityFlashSaleService.queryNeedRemove(0, 100, 6); - + List<Long> list = qualityFlashSaleService.queryNeedRemove(0, 200, 6); if (list == null || list.size() == 0) { break; } @@ -144,8 +166,33 @@ } } catch (Exception e) { - LogHelper.errorDetailInfo(e); + LogHelper.errorDetailInfo(e); } } + // 鏇存柊澧炲姞鍝佺墝鍟嗗搧锛屾瘡澶╂棭涓�6鐐规墽琛屼竴娆� + @Scheduled(cron = "0 0 6 * * ? ") + 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(); + } } -- Gitblit v1.8.0