From 880238957a973ecd9676237672276b0e99d31115 Mon Sep 17 00:00:00 2001 From: yujian <yujian@163.com> Date: 星期一, 29 六月 2020 13:55:28 +0800 Subject: [PATCH] 免单 --- fanli/src/main/java/com/yeshi/fanli/job/goods/HDKGoodsJob.java | 31 +++++++++++++++++++++++++++++++ 1 files changed, 31 insertions(+), 0 deletions(-) diff --git a/fanli/src/main/java/com/yeshi/fanli/job/goods/HDKGoodsJob.java b/fanli/src/main/java/com/yeshi/fanli/job/goods/HDKGoodsJob.java index 3cd3ee8..f31f346 100644 --- a/fanli/src/main/java/com/yeshi/fanli/job/goods/HDKGoodsJob.java +++ b/fanli/src/main/java/com/yeshi/fanli/job/goods/HDKGoodsJob.java @@ -5,12 +5,14 @@ import javax.annotation.Resource; +import org.springframework.core.task.TaskExecutor; import org.springframework.stereotype.Component; import com.xxl.job.core.biz.model.ReturnT; import com.xxl.job.core.handler.annotation.XxlJob; import com.yeshi.fanli.dto.taobao.haodanku.HDKGoodsListResultDTO; import com.yeshi.fanli.entity.taobao.haodanku.HDKGoodsDetail; +import com.yeshi.fanli.service.inter.goods.PullNewGoodsService; import com.yeshi.fanli.service.inter.taobao.haodanku.HDKGoodsDetailService; import com.yeshi.fanli.util.taobao.HaoDanKuApiUtil; @@ -19,6 +21,12 @@ @Resource private HDKGoodsDetailService hdkGoodsDetailService; + + @Resource + private PullNewGoodsService pullNewGoodsService; + + @Resource(name = "taskExecutor") + private TaskExecutor executor; /** * 鍚屾鎵�鏈夊晢鍝� @@ -119,6 +127,17 @@ } catch (Exception e) { e.printStackTrace(); } + + executor.execute(new Runnable() { + @Override + public void run() { + try { + pullNewGoodsService.updateGoods(goods); + } catch (Exception e) { + e.printStackTrace(); + } + } + }); } } else { minId = null; @@ -152,6 +171,18 @@ List<Long> tempList = ids.subList(start, start + pageSize > ids.size() ? ids.size() : start + pageSize); hdkGoodsDetailService.deleteByItemIds(tempList); } + + executor.execute(new Runnable() { + @Override + public void run() { + try { + pullNewGoodsService.deleteGoods(ids); + } catch (Exception e) { + e.printStackTrace(); + } + } + }); + return ReturnT.SUCCESS; } -- Gitblit v1.8.0