Ejemplo n.º 1
0
  // 定时任务修改页面
  @RequestMapping(value = "/timetask/edit")
  public String timeTaskEdit(HttpServletRequest request) {

    String id = request.getParameter("id");
    TCmTimeTaskVO bean = null;
    if (id != null) {
      try {
        bean = cognos8TimeService.getTimeTask(id);
      } catch (Exception e) {
        // TODO Auto-generated catch block
        logger.error("", e);
      }
    }
    if (bean != null) {
      request.setAttribute("bean", bean);
    } else {
      request.setAttribute("bean", new TCmTimeTaskVO());
    }
    return "timetask/timeTaskEdit";
  }
Ejemplo n.º 2
0
  // 定时任务列表
  @RequestMapping(value = "/timetask/list")
  public void getTimeTaskList(
      HttpServletRequest request, HttpServletResponse response, int page, int pagesize) {

    JSONObject result = new JSONObject().element("Total", 0).element("Rows", new JSONArray());
    Map<String, Object> map = new HashMap<String, Object>();

    // 分页查询结果
    try {
      result = cognos8TimeService.getTimeTaskList(map, (page - 1) * pagesize, pagesize);
    } catch (Exception e) {
      // TODO Auto-generated catch block
      logger.error("", e);
    }

    try {
      response.getWriter().print(result.toString());
    } catch (IOException e) {
      // TODO Auto-generated catch block
      logger.error("", e);
    }
  }