@Override public void execute(JobExecutionContext arg0) throws JobExecutionException { ICreateIndexAllItem iciai1 = null; RCrawlerIndex rCrawlerIndex = (RCrawlerIndex) arg0.getJobDetail().getJobDataMap().get(QuartzManager.JUST_SCHEDULE_RETURN); List<RCrawlerIndex> rCrawlerIndexList; if (rCrawlerIndex != null) { rCrawlerIndexList = new ArrayList<RCrawlerIndex>(); rCrawlerIndexList.add(rCrawlerIndex); } else rCrawlerIndexList = commonService.getObjs(RCrawlerIndex.class); for (RCrawlerIndex rdI : rCrawlerIndexList) { if ("0".equals(rdI.getIsError()) && "0".equals(rdI.getIsOn()) && (DictUtils.getDictMapByKey(DictUtils.INDEXPATH_TYPE, IndexPathType.CUSTOM.getValue())) .equals( DictUtils.getDictMapByKey( DictUtils.INDEXPATH_TYPE, rdI.getIndexCategory().getIndexPathType()))) { CustomCrawlerController crawlerController = new CustomCrawlerController(retrievalApplicationContext, rdI); crawlerController.indexAll(); // 启动定时任务 sechdule(rdI, new CrawlerIndexJob0()); } } }
public void delete() { IKWords ik = getModel(IKWords.class); if (IKWordsUtil.isExists(ik.getWords())) { commonservice.remove(IKWords.class, ik.getWords()); IKWordsUtil.disableWord(ik.getWords()); msg = MSG_OK; } else { msg = MSG_FAULT; } setAttr("msg", msg); renderJson(new String[] {"msg"}); }
public void save() { IKWords ik = getModel(IKWords.class); if (!IKWordsUtil.isExists(ik.getWords())) { ik.setId(ik.getWords()); commonservice.put(IKWords.class, ik.getId(), ik); IKWordsUtil.addWord(ik.getWords()); msg = MSG_OK; } else { msg = MSG_FAULT; } setAttr("msg", msg); renderJson(new String[] {"msg"}); }