public ActionForward TaskRemove2( 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 { // model.setTaskDisposeType(null); model = workTaskDisposeService.get(request.getParameter("id")); model.setStatus(WorkTaskDisposeModel.EStatus.CLOSE.getValue()); workTaskDisposeService.saveOrUpdate(model); // workTaskDisposeService.remove(request.getParameter("id")); // 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_remove", new Object[]{model.getId()})); } catch (ServiceException e) { // TODO Auto-generated catch block e.printStackTrace(); log.debug("task remove err" + e.getMessage()); } return new ActionForward("/admin/affair/daily_govern_work/dayNumOff=0", true); }
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"); }
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"); }
public ActionForward TaskSave( ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) { WorkTaskDisposeModel model = (WorkTaskDisposeModel) form; // if(model.getStatus() == WorkTaskDisposeModel.EStatus.OPEN.getValue()){ if (!request.getParameter("id").equals("")) { try { model = workTaskDisposeService.get(request.getParameter("id")); } catch (ServiceException e) { log.debug(e.getMessage() + "task get error"); } } else { model = (WorkTaskDisposeModel) form; if (request.getParameter("taskTime0") == "" || request.getParameter("taskTime0") == null) model.setPostDateTime(new Date()); model.setStatus(WorkTaskDisposeModel.EStatus.OPEN.getValue()); } model.setDescribe(request.getParameter("describe")); model.setTaskDisposeType(Integer.parseInt(request.getParameter("taskDisposeType"))); model.setDealSuggestion(request.getParameter("dealSuggestion")); try { StaffModel staff = staffService.getByNo(request.getParameter("staffNo")); if (staff.getId() == null) { ajaxPrint(response, "staff err"); return null; } model.setPoster(staff); // StaffModel deal = staffService.getByNo(request.getParameter("dealNo")); // if(deal.getId()==null){ // ajaxPrint(response, "staff err"); // return null; // } // model.setDealer(deal); workTaskDisposeService.saveOrUpdate(model); // 记录log eventService.traceSystemEvent( getMessageFromResource( request, "system.event.text.maintain_task_save", new Object[] {model.getId()})); } catch (ServiceException e) { log.debug(e.getMessage() + "task save error"); return null; } // }else{ // try{ // model = workTaskDisposeService.get(request.getParameter("id")); // model.setDealSuggestion(request.getParameter("dealSuggestion")); // //StaffModel staffModel = SecurityUserHolder.getCurrentUser(null); // //model.setPoster(staffModel); //// model.setDealDateTime(new Date()); // workTaskDisposeService.saveOrUpdate(model); // // //记录log // eventService.traceSystemEvent(getMessageFromResource( // request, "system.event.text.maintain_task_save", new Object[]{model.getId()})); // }catch (ServiceException e){ // log.debug(e.getMessage() + "task get error"); // } // } ajaxPrint(response, AjaxResponse.RESPONSE_SUCCESS); return null; }