コード例 #1
0
  public ActionForward TaskIndex(
      ActionMapping mapping,
      ActionForm form,
      HttpServletRequest request,
      HttpServletResponse response) {
    if (request.getParameter(Constants.DefaultPageParamFlag) == null
        || request.getParameter(Constants.DefaultPageParamFlag) == "") {
      WorkTaskDisposeModel model = new WorkTaskDisposeModel();
      model.setTaskDisposeType(null);
      model.setStatus(null);
      try {
        request.setAttribute(
            "task.page",
            workTaskDisposeService.getRecentWorkTaskDispose(
                model, "", "", Constants.DefaultPageSize, 0, null, true));
      } catch (ServiceException e) {
        log.debug(e.getMessage());
      }
      return mapping.findForward("task_index");
    }
    WorkTaskDisposeModel model = (WorkTaskDisposeModel) form;
    if (model.getTaskDisposeType() == -1) model.setTaskDisposeType(null);
    model.setStatus(null);
    Integer page =
        request.getParameter(Constants.DefaultPageParamFlag) == null
            ? 1
            : Integer.parseInt(request.getParameter(Constants.DefaultPageParamFlag));
    int startIndex = (page - 1) * Constants.DefaultPageSize;
    request.setAttribute("page", page);

    try {
      request.setAttribute(
          "task.page",
          workTaskDisposeService.getRecentWorkTaskDispose(
              model,
              request.getParameter("staffNo"),
              request.getParameter("time"),
              Constants.DefaultPageSize,
              startIndex,
              null,
              true));
    } catch (ServiceException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
      log.debug("task index error" + e.getMessage());
    }
    return mapping.findForward("task_datagrid");
  }
コード例 #2
0
  public ActionForward TaskOperStatus(
      ActionMapping mapping,
      ActionForm form,
      HttpServletRequest request,
      HttpServletResponse response) {
    WorkTaskDisposeModel model = (WorkTaskDisposeModel) form;
    Integer page =
        request.getParameter(Constants.DefaultPageParamFlag) == null
            ? 1
            : Integer.parseInt(request.getParameter(Constants.DefaultPageParamFlag));
    int startIndex = (page - 1) * Constants.DefaultPageSize;
    request.setAttribute("page", page);
    try {
      if (model.getTaskDisposeType() == -1) model.setTaskDisposeType(null);
      model.setStatus(null);
      WorkTaskDisposeModel operModel = workTaskDisposeService.get(request.getParameter("id"));
      if (operModel.getStatus() == WorkTaskDisposeModel.EStatus.OPEN.getValue())
        operModel.setStatus(WorkTaskDisposeModel.EStatus.CLOSE.getValue());
      else operModel.setStatus(WorkTaskDisposeModel.EStatus.OPEN.getValue());
      workTaskDisposeService.saveOrUpdate(operModel);
      request.setAttribute(
          "task.page",
          workTaskDisposeService.getRecentWorkTaskDispose(
              model,
              request.getParameter("staffNo"),
              request.getParameter("time"),
              Constants.DefaultMaximumPageSize,
              startIndex,
              null,
              true));

      // 记录log
      eventService.traceSystemEvent(
          getMessageFromResource(
              request, "system.event.text.maintain_task_operStatus", new Object[] {model.getId()}));
    } catch (ServiceException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
      log.debug("notice remove err" + e.getMessage());
    }
    return mapping.findForward("task_datagrid");
  }