Package org.jeecgframework.web.system.pojo.base

Examples of org.jeecgframework.web.system.pojo.base.TSTimeTaskEntity


   * 读取数据库判断是否开始定时任务
   */
  public void afterPropertiesSet() throws Exception {
    super.afterPropertiesSet();
    String[] trigerrNames = this.getScheduler().getTriggerNames(Scheduler.DEFAULT_GROUP);
    TSTimeTaskEntity task;
   
    for (String trigerrName : trigerrNames) {
      task = timeTaskService.findUniqueByProperty(TSTimeTaskEntity.class,"taskId",trigerrName);
      //数据库查询不到的定时任务或者定时任务的运行状态不为1时,都停止
      //TASK #327 定时器任务默认未启动
      if(task==null || !"1".equals(task.getIsStart())){
        this.getScheduler().pauseTrigger(trigerrName,Scheduler.DEFAULT_GROUP);
      }
    }
  }
View Full Code Here


  /**
   * 读取数据库更新文件
   */
  public void afterPropertiesSet() throws Exception {
    super.afterPropertiesSet();
    TSTimeTaskEntity task = timeTaskService.findUniqueByProperty
        (TSTimeTaskEntity.class,"taskId",this.getName());
    if(task!=null&&task.getIsEffect().equals("1")
        &&!task.getCronExpression().equals(this.getCronExpression())){
      this.setCronExpression(task.getCronExpression());
      DynamicTask.updateSpringMvcTaskXML(this,task.getCronExpression());
    }
  }
View Full Code Here

      j.setMsg("Cron表达式错误");
      return j;
    }
    if (StringUtil.isNotEmpty(timeTask.getId())) {
      message = "定时任务管理更新成功";
      TSTimeTaskEntity t = timeTaskService.get(TSTimeTaskEntity.class, timeTask.getId());
      try {
        if(!timeTask.getCronExpression().equals(t.getCronExpression())){
          timeTask.setIsEffect("0");
        }
        MyBeanUtils.copyBeanNotNull2Bean(timeTask, t);
        timeTaskService.saveOrUpdate(t);
        systemService.addLog(message, Globals.Log_Type_UPDATE, Globals.Log_Leavel_INFO);
View Full Code Here

   * 修复任务管理
   * @author JueYue
   * @serialData 2013年11月5日
   */
  private void repairTask() {
    TSTimeTaskEntity task = new TSTimeTaskEntity();
    task.setTaskId("taskDemoServiceTaskCronTrigger");
    task.setTaskDescribe("测试Demo");
    task.setCronExpression("0 0/1 * * * ?");
    task.setIsEffect("0");
    task.setIsStart("0");
    commonDao.saveOrUpdate(task);
  }
 
View Full Code Here

TOP

Related Classes of org.jeecgframework.web.system.pojo.base.TSTimeTaskEntity

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.