| | |
| | | package com.yeshi.fanli.job;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | | import org.springframework.stereotype.Component;
|
| | | import org.yeshi.utils.StringUtil;
|
| | |
|
| | | import com.xxl.job.core.biz.model.ReturnT;
|
| | | import com.xxl.job.core.handler.annotation.XxlJob;
|
| | | import com.yeshi.fanli.service.inter.order.ESOrderService;
|
| | |
|
| | | /**
|
| | | * 搜索引擎任务
|
| | | * @author Administrator
|
| | | *
|
| | | */
|
| | | @Component
|
| | | public class ElasticSearchJob {
|
| | |
|
| | | @Resource
|
| | | private ESOrderService esOrderService;
|
| | |
|
| | | /**
|
| | | * 每两个小时进行更新品牌商品信息
|
| | | */
|
| | | @XxlJob("orderSearchIndexAddHandler")
|
| | | public ReturnT<String> orderSearchIndexAddHandler(String param) throws Exception {
|
| | | Integer count = null;
|
| | | if (!StringUtil.isNullOrEmpty(param))
|
| | | count = Integer.parseInt(param);
|
| | | addIndex(count);
|
| | | return ReturnT.SUCCESS;
|
| | | }
|
| | |
|
| | | public void addIndex(Integer count) {
|
| | | if (count == null)
|
| | | count = 200;
|
| | | esOrderService.syncAddOrder(count);
|
| | | }
|
| | |
|
| | | }
|
| | | package com.yeshi.fanli.job; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | import org.springframework.stereotype.Component; |
| | | import org.yeshi.utils.StringUtil; |
| | | |
| | | import com.xxl.job.core.biz.model.ReturnT; |
| | | import com.xxl.job.core.handler.annotation.XxlJob; |
| | | import com.yeshi.fanli.service.inter.order.ESOrderService; |
| | | |
| | | /** |
| | | * 搜索引擎任务 |
| | | * @author Administrator |
| | | * |
| | | */ |
| | | @Component |
| | | public class ElasticSearchJob { |
| | | |
| | | @Resource |
| | | private ESOrderService esOrderService; |
| | | |
| | | /** |
| | | * 每两个小时进行更新品牌商品信息 |
| | | */ |
| | | @XxlJob("orderSearchIndexAddHandler") |
| | | public ReturnT<String> orderSearchIndexAddHandler(String param) throws Exception { |
| | | Integer count = null; |
| | | if (!StringUtil.isNullOrEmpty(param)) |
| | | count = Integer.parseInt(param); |
| | | addIndex(count); |
| | | return ReturnT.SUCCESS; |
| | | } |
| | | |
| | | public void addIndex(Integer count) { |
| | | if (count == null) |
| | | count = 200; |
| | | esOrderService.syncAddOrder(count); |
| | | } |
| | | |
| | | } |