admin
2025-02-25 30d8e227e8d823b6c38c3b9c90ac2df03b63befe
fanli/src/main/java/com/yeshi/fanli/job/ElasticSearchJob.java
@@ -1,41 +1,41 @@
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);
   }
}