/** * 意见 * * @return * @throws Exception */ public String opinion() throws Exception { // workflowInstance = workflowInstanceManager.getWorkflowInstance(workflowId); // authority(workflowInstance.getProcessDefinitionId(),task.getName()); // if(view){ // opinions = // workflowInstanceManager.getOpinionsByInstanceId(workflowInstance.getProcessInstanceId(),companyId); // } if (taskId == null) { view = true; } else { task = taskService.getWorkflowTask(taskId); if (task.getActive() == 2) { edit = false; } } workflowInstance = workflowInstanceManager.getWorkflowInstance(workflowId); opinions = workflowInstanceManager.getOpinions(taskId, task.getCompanyId()); if (workflowRightsManager.mustOpinionRight(BeanUtil.turnToModelTask(task)) && (opinions == null || opinions.size() <= 0)) { must = true; } else { must = false; } companyId = ContextUtils.getCompanyId(); ApiFactory.getBussinessLogService().log("流程汇编", "意见列表", ContextUtils.getSystemId("wf")); return "opinion"; }
/** 处理任务 */ @Override public String input() throws Exception { log.debug("*** input 处理任务方法开始"); log.debug( new StringBuilder("*** Received parameter:[") .append("task:") .append(task) .append("]") .toString()); taskService.updateTaskIsRead(task); workflowId = task.getProcessInstanceId(); workflowInstance = workflowInstanceManager.getWorkflowInstance(workflowId); opinions = workflowInstanceManager.getOpinions(taskId, task.getCompanyId()); if (workflowRightsManager.mustOpinionRight(BeanUtil.turnToModelTask(task)) && (opinions == null || opinions.size() <= 0)) { must = true; } StringBuilder builder = new StringBuilder(); builder .append("<input type=\"hidden\" name=\"dataId\" value=\"") .append(workflowInstance.getDataId()) .append("\"/>"); formHtml = workflowInstanceManager.getHtml( workflowInstance.getProcessDefinitionId(), workflowInstance.getFormId(), workflowInstance.getDataId(), task.getName()); formHtml = builder.toString() + formHtml; if (TaskState.COMPLETED.getIndex().equals(task.getActive()) || TaskState.CANCELLED.getIndex().equals(task.getActive())) { // 列表控件控制 formHtml = workflowInstanceManager.getFormHtml( workflowInstance, formHtml, workflowInstance.getDataId(), false, false); fieldPermission = workflowRightsManager.getFieldPermission(false); } else if (TaskState.WAIT_CHOICE_TACHE.getIndex().equals(task.getActive())) { canChoiceTaches = taskService.isNeedChoiceTache(task, workflowInstance).getCanChoiceTaches(); return choiceTache(); } else { // 列表控件控制 formHtml = workflowInstanceManager.getFormHtml( workflowInstance, formHtml, workflowInstance.getDataId(), true, false); fieldPermission = ApiFactory.getFormService().getFieldPermission(task.getId()); } ApiFactory.getBussinessLogService().log("工作流管理", "任务办理页面", ContextUtils.getSystemId("wf")); log.debug("*** input 处理任务方法结束"); return INPUT; }