| | |
| | | //添加流程变量 |
| | | if(!processVariables.isEmpty()) taskService.setVariables(taskId,processVariables); |
| | | taskService.addComment(taskId, task.getProcessInstanceId(), FlowComment.SUBMIT.getType(), "完成提交"); |
| | | // 判断当前任务是不是转办过的 |
| | | Boolean delegation = flowLogService.taskDelegation(task.getProcessInstanceId(), task.getId()); |
| | | if (delegation) { |
| | | if (DelegationState.PENDING.equals(task.getDelegationState())) { |
| | | taskService.resolveTask(taskId, newV); |
| | | } else { |
| | | // 先让当前用户认领这个任务 |
| | | taskService.claim(taskId, SecurityUtils.getUserId() + ""); |
| | | taskService.complete(taskId, newV); |
| | | } |
| | | // 先让当前用户认领这个任务 |
| | | taskService.claim(taskId, SecurityUtils.getUserId() + ""); |
| | | taskService.complete(taskId, newV); |
| | | |
| | | return AjaxResult.success("提交成功"); |
| | | } |
| | | |
| | |
| | | List<JSONObject> oldFields = JSON.parseObject(JSON.toJSONString(formJson.get(ProcessConstants.WIDGET_LIST)), new TypeReference<List<JSONObject>>() { |
| | | }); |
| | | |
| | | // 设置已填写的表单为禁用状态 |
| | | for (JSONObject oldField : oldFields) { |
| | | JSONObject options = oldField.getJSONObject("options"); |
| | | options.put("disabled", true); |
| | | if(CollectionUtils.isNotEmpty(oldFields)) { |
| | | // 设置已填写的表单为禁用状态 |
| | | for (JSONObject oldField : oldFields) { |
| | | JSONObject options = oldField.getJSONObject("options"); |
| | | options.put("disabled", true); |
| | | } |
| | | formJson.put(ProcessConstants.WIDGET_LIST, oldFields); |
| | | newP.put(ProcessConstants.TASK_FORM_KEY, formJson); |
| | | newP.remove(formDetailVO.getBeforeNodeDefId() + "&" + ProcessConstants.TASK_FORM_KEY); |
| | | formDetailVO.setFormJsonObj(newP); |
| | | } |
| | | // TODO 暂时只处理用户任务上的表单 |
| | | // if (StringUtils.isNotBlank(task.getFormKey())) { |
| | |
| | | // } |
| | | // oldFields.addAll(newFields); |
| | | // } |
| | | formJson.put(ProcessConstants.WIDGET_LIST, oldFields); |
| | | newP.put(ProcessConstants.TASK_FORM_KEY, formJson); |
| | | newP.remove(formDetailVO.getBeforeNodeDefId() + "&" + ProcessConstants.TASK_FORM_KEY); |
| | | formDetailVO.setFormJsonObj(newP); |
| | | |
| | | } |
| | | } |
| | | return beforeNodes; |