| | |
| | | import com.ycl.domain.form.ProjectProcessForm; |
| | | import com.ycl.domain.vo.ProjectProcessVO; |
| | | import com.ycl.domain.query.ProjectProcessQuery; |
| | | import com.ycl.service.common.TaskCommonService; |
| | | import com.ycl.system.service.ISysDeptService; |
| | | import com.ycl.system.service.ISysRoleService; |
| | | import com.ycl.system.service.ISysUserService; |
| | |
| | | private final ISysUserService sysUserService; |
| | | private final ISysRoleService sysRoleService; |
| | | private final ISysDeptService sysDeptService; |
| | | private final TaskCommonService taskCommonService; |
| | | |
| | | /** |
| | | * 分页查询 |
| | |
| | | if (Objects.nonNull(pp.getProcessInsId())) { |
| | | HistoricProcessInstance historicProcessInstance = |
| | | historyService.createHistoricProcessInstanceQuery().processInstanceId(pp.getProcessInsId()).singleResult(); |
| | | // 删除之前流程的数据 |
| | | if (historicProcessInstance.getEndTime() != null) { |
| | | historyService.deleteHistoricProcessInstance(historicProcessInstance.getId()); |
| | | } else { |
| | | // 删除流程实例 |
| | | runtimeService.deleteProcessInstance(pp.getProcessInsId(), ""); |
| | | // 删除历史流程实例 |
| | | historyService.deleteHistoricProcessInstance(pp.getProcessInsId()); |
| | | if (Objects.nonNull(historicProcessInstance)) { |
| | | // 删除之前流程的数据 |
| | | if (historicProcessInstance.getEndTime() != null) { |
| | | historyService.deleteHistoricProcessInstance(historicProcessInstance.getId()); |
| | | } else { |
| | | // 删除流程实例 |
| | | runtimeService.deleteProcessInstance(pp.getProcessInsId(), ""); |
| | | // 删除历史流程实例 |
| | | historyService.deleteHistoricProcessInstance(pp.getProcessInsId()); |
| | | } |
| | | } |
| | | } |
| | | String processInsId = this.startPro(form.getProjectId(), form.getProcessDefId()); |
| | |
| | | |
| | | @Override |
| | | public Result taskIsAuditing(String processDefinitionId, String taskId) { |
| | | Task task = taskService.createTaskQuery().taskId(taskId).singleResult(); |
| | | BpmnModel bpmnModel = repositoryService.getBpmnModel(processDefinitionId); |
| | | Collection<Process> processes = bpmnModel.getProcesses(); |
| | | Boolean needAuditing = Boolean.FALSE; |
| | | for (Process process : processes) { |
| | | Collection<FlowElement> flowElements = process.getFlowElements(); |
| | | for (FlowElement flowElement : flowElements) { |
| | | if (flowElement instanceof UserTask) { |
| | | if (flowElement instanceof UserTask && flowElement.getId().equals(task.getTaskDefinitionKey())) { |
| | | UserTask userTask = (UserTask) flowElement; |
| | | List<ExtensionElement> extensionElements = userTask.getExtensionElements().get("flowable:properties"); |
| | | if (! CollectionUtils.isEmpty(extensionElements)) { |
| | | for (ExtensionElement extensionElement : extensionElements) { |
| | | String fieldName = extensionElement.getAttributeValue(taskId,"name"); |
| | | String fieldValue = extensionElement.getAttributeValue(taskId,"value"); |
| | | System.out.println("Field Name: " + fieldName + ", Field Value: " + fieldValue); |
| | | } |
| | | } |
| | | needAuditing = taskCommonService.checkTaskNeedAuditing(userTask.getExtensionElements().get("properties")); |
| | | break; |
| | | } |
| | | |
| | | } |
| | | } |
| | | return null; |
| | | return Result.ok().data(needAuditing); |
| | | } |
| | | |
| | | /** |