|  | @ -66,62 +66,53 @@ public class CompanyRatingProcessServiceImpl implements CompanyRatingProcessServ | 
			
		
	
		
		
			
				
					|  |  | 
 |  |  | 
 | 
			
		
	
		
		
			
				
					|  |  | 	@Override |  |  | 	@Override | 
			
		
	
		
		
			
				
					|  |  | 	@Transactional |  |  | 	@Transactional | 
			
		
	
		
		
			
				
					
					|  |  | 	public CompleteTaskResponse submit(String taskId, ProcessProperties processProperties) throws CompleteTaskException, Exception { |  |  | 	public void submit(String taskId, ProcessProperties processProperties) throws Exception { | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  | 		try { |  |  | 		Task task = processEngine.getTaskService().createTaskQuery().taskId(taskId).singleResult(); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  | 			Task task = processEngine.getTaskService().createTaskQuery().taskId(taskId).singleResult(); |  |  | 		Map<String, Object> transientVariables = processProperties.getTransientVariables(); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  | 			Map<String, Object> transientVariables = processProperties.getTransientVariables(); |  |  | 		Integer opaVal = (Integer) transientVariables.get("opaVal"); | 
			
				
				
			
		
	
		
		
			
				
					|  |  | 			Integer opaVal = (Integer) transientVariables.get("opaVal"); |  |  |  | 
			
		
	
		
		
			
				
					|  |  | 			ProcessInstance instance = processEngine.getRuntimeService().createProcessInstanceQuery().processInstanceId(task.getProcessInstanceId()).singleResult(); |  |  |  | 
			
		
	
		
		
			
				
					|  |  | 			String suggestLevel = null; |  |  |  | 
			
		
	
		
		
			
				
					|  |  | 			if (transientVariables.containsKey("suggestLevel")) { |  |  |  | 
			
		
	
		
		
			
				
					|  |  | 				suggestLevel = (String) transientVariables.get("suggestLevel"); |  |  |  | 
			
		
	
		
		
			
				
					|  |  | 			} |  |  |  | 
			
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					|  |  | 
 |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  | 			// TODO 当前流程通过读取流程设计中任务节点的输出线加载页面按钮,而实际业务存在需要根据业务信息判断下一步提交的节点。
 |  |  | 		ProcessInstance instance = processEngine.getRuntimeService().createProcessInstanceQuery().processInstanceId(task.getProcessInstanceId()).singleResult(); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  | 			List<VariableWrapper> variableWrapperList = processQueryService.queryVariables(task.getProcessInstanceId()); |  |  | 		String suggestLevel = null; | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  | 			Integer lastGoback = -1; |  |  | 		if (transientVariables.containsKey("suggestLevel")) { | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  | 			Boolean flag = false; |  |  | 			suggestLevel = (String) transientVariables.get("suggestLevel"); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  | 			for (VariableWrapper variableWrapper : variableWrapperList) { |  |  | 		} | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  | 				if (variableWrapper.getName().equals(TaskVariable.LAST_GOBACK)) { |  |  | 
 | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  | 					lastGoback = Integer.parseInt(variableWrapper.getText()); |  |  | 		// TODO 当前流程通过读取流程设计中任务节点的输出线加载页面按钮,而实际业务存在需要根据业务信息判断下一步提交的节点。
 | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  | 				} |  |  | 		List<VariableWrapper> variableWrapperList = processQueryService.queryVariables(task.getProcessInstanceId()); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  | 			} |  |  | 		Integer lastGoback = -1; | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  | 			if (opaVal == RatingGoBackType.JUDGMENT.code()) { |  |  | 		Boolean flag = false; | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  | 				transientVariables.put("submit", lastGoback); |  |  | 		for (VariableWrapper variableWrapper : variableWrapperList) { | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  | 			} else if (opaVal == RatingGoBackType.SUBMIT_HEAD.code() && isNeedHeadBankApprove(suggestLevel, instance.getBusinessKey())) { |  |  | 			if (variableWrapper.getName().equals(TaskVariable.LAST_GOBACK)) { | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  | 				transientVariables.put("submit", RatingGoBackType.SUBMIT.code()); |  |  | 				lastGoback = Integer.parseInt(variableWrapper.getText()); | 
			
				
				
			
		
	
		
		
			
				
					|  |  | 				flag = true; |  |  |  | 
			
		
	
		
		
			
				
					|  |  | 			} else if (opaVal == RatingGoBackType.SUBMIT_HEAD.code()) { |  |  |  | 
			
		
	
		
		
			
				
					|  |  | 				transientVariables.put("submit", RatingGoBackType.APPROVE.code()); |  |  |  | 
			
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					|  |  | 			} |  |  | 			} | 
			
		
	
		
		
			
				
					
					|  |  | 			Map<String, Object> variables = processProperties.getVariables(); |  |  | 		} | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  | 			variables.put(TaskVariable.LAST_GOBACK, transientVariables.get("goback").toString()); |  |  | 		if (opaVal == RatingGoBackType.JUDGMENT.code()) { | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  | 			processOperationService.completeTask(taskId, variables, transientVariables); |  |  | 			transientVariables.put("submit", lastGoback); | 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					|  |  |  |  |  | 		} else if (opaVal == RatingGoBackType.SUBMIT_HEAD.code() && isNeedHeadBankApprove(suggestLevel, instance.getBusinessKey())) { | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 			transientVariables.put("submit", RatingGoBackType.SUBMIT.code()); | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 			flag = true; | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 		} else if (opaVal == RatingGoBackType.SUBMIT_HEAD.code()) { | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 			transientVariables.put("submit", RatingGoBackType.APPROVE.code()); | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 		} | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 		Map<String, Object> variables = processProperties.getVariables(); | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 		variables.put(TaskVariable.LAST_GOBACK, transientVariables.get("goback").toString()); | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 		processOperationService.completeTask(taskId, variables, transientVariables); | 
			
		
	
		
		
			
				
					|  |  | 
 |  |  | 
 | 
			
		
	
		
		
			
				
					|  |  | 
 |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  | 			if (opaVal == RatingGoBackType.REJECT.code()) { |  |  | 		if (opaVal == RatingGoBackType.REJECT.code()) { | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  | 				companyRatingService.reject(instance.getBusinessKey(), processProperties.getData()); |  |  | 			companyRatingService.reject(instance.getBusinessKey(), processProperties.getData()); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  | 			} else if (opaVal == RatingGoBackType.SUBMIT_HEAD.code()) { |  |  | 		} else if (opaVal == RatingGoBackType.SUBMIT_HEAD.code()) { | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  | 				if (flag) { |  |  | 			if (flag) { | 
			
				
				
			
		
	
		
		
			
				
					|  |  | 					companyRatingService.submit(instance.getBusinessKey(), processProperties.getData()); |  |  |  | 
			
		
	
		
		
			
				
					|  |  | 				} else { |  |  |  | 
			
		
	
		
		
			
				
					|  |  | 					companyRatingService.approve(instance.getBusinessKey(), processProperties.getData()); |  |  |  | 
			
		
	
		
		
			
				
					|  |  | 				} |  |  |  | 
			
		
	
		
		
			
				
					|  |  | 			} else if(opaVal < 0){ |  |  |  | 
			
		
	
		
		
			
				
					|  |  | 				companyRatingService.backStart(instance.getBusinessKey(), processProperties.getData()); |  |  |  | 
			
		
	
		
		
			
				
					|  |  | 			} else if(opaVal == RatingGoBackType.APPROVE.code()) { |  |  |  | 
			
		
	
		
		
			
				
					|  |  | 				companyRatingService.approve(instance.getBusinessKey(), processProperties.getData()); |  |  |  | 
			
		
	
		
		
			
				
					|  |  | 			} else { |  |  |  | 
			
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					|  |  | 				companyRatingService.submit(instance.getBusinessKey(), processProperties.getData()); |  |  | 				companyRatingService.submit(instance.getBusinessKey(), processProperties.getData()); | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 			} else { | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 				companyRatingService.approve(instance.getBusinessKey(), processProperties.getData()); | 
			
		
	
		
		
			
				
					|  |  | 			} |  |  | 			} | 
			
		
	
		
		
			
				
					
					|  |  | 			//companyRatingService.back(instance.getBusinessKey());
 |  |  | 		} else if(opaVal < 0){ | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  | 
 |  |  | 			companyRatingService.backStart(instance.getBusinessKey(), processProperties.getData()); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  | 			return new CompleteTaskResponse(); |  |  | 		} else if(opaVal == RatingGoBackType.APPROVE.code()) { | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  | 		} catch (CompleteTaskException exception) { |  |  | 			companyRatingService.approve(instance.getBusinessKey(), processProperties.getData()); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  | 			TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); |  |  | 		} else { | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  | 			return CompleteTaskResponse.fromAssigneesJson(exception.getMessage()); |  |  | 			companyRatingService.submit(instance.getBusinessKey(), processProperties.getData()); | 
			
				
				
			
		
	
		
		
			
				
					|  |  | 		} catch (Exception exception) { |  |  |  | 
			
		
	
		
		
			
				
					|  |  | 			throw exception; |  |  |  | 
			
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					|  |  | 		} |  |  | 		} | 
			
		
	
		
		
			
				
					|  |  | 	} |  |  | 	} | 
			
		
	
		
		
			
				
					|  |  | 
 |  |  | 
 | 
			
		
	
	
		
		
			
				
					|  | 
 |