| 
						
						
							
								
							
						
						
					 | 
					 | 
					@ -271,10 +271,10 @@ public class MaintenanceServiceImpl implements MaintenanceService { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            String[] emCodeList = finalPlanEntity.getEmCode().split(","); | 
					 | 
					 | 
					 | 
					            String[] emCodeList = finalPlanEntity.getEmCode().split(","); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            for (String emCode : emCodeList) { | 
					 | 
					 | 
					 | 
					            for (String emCode : emCodeList) { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                taskEntity.setEmCode(emCode); | 
					 | 
					 | 
					 | 
					                taskEntity.setEmCode(emCode); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                this.fillTask(taskEntity, finalPlanEntity); | 
					 | 
					 | 
					 | 
					                this.fillTask(taskEntity, finalPlanEntity,false); | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            } | 
					 | 
					 | 
					 | 
					            } | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        } else { | 
					 | 
					 | 
					 | 
					        } else { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            this.fillTask(taskEntity, finalPlanEntity); | 
					 | 
					 | 
					 | 
					            this.fillTask(taskEntity, finalPlanEntity,false); | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        } | 
					 | 
					 | 
					 | 
					        } | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    } | 
					 | 
					 | 
					 | 
					    } | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					 | 
					@ -286,7 +286,7 @@ public class MaintenanceServiceImpl implements MaintenanceService { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					     * @param taskEntity | 
					 | 
					 | 
					 | 
					     * @param taskEntity | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					     * @param finalPlanEntity | 
					 | 
					 | 
					 | 
					     * @param finalPlanEntity | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					     */ | 
					 | 
					 | 
					 | 
					     */ | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    public void fillTask(OperMaintenanceTaskEntity taskEntity, OperMaintenancePlanEntity finalPlanEntity) { | 
					 | 
					 | 
					 | 
					    public void fillTask(OperMaintenanceTaskEntity taskEntity, OperMaintenancePlanEntity finalPlanEntity,Boolean flag) { | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        DefaultTransactionDefinition defaultTransactionDefinition = new DefaultTransactionDefinition(); | 
					 | 
					 | 
					 | 
					        DefaultTransactionDefinition defaultTransactionDefinition = new DefaultTransactionDefinition(); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        defaultTransactionDefinition.setPropagationBehavior(TransactionDefinition.PROPAGATION_REQUIRES_NEW); | 
					 | 
					 | 
					 | 
					        defaultTransactionDefinition.setPropagationBehavior(TransactionDefinition.PROPAGATION_REQUIRES_NEW); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        TransactionStatus transaction = dataSourceTransactionManager.getTransaction(defaultTransactionDefinition); | 
					 | 
					 | 
					 | 
					        TransactionStatus transaction = dataSourceTransactionManager.getTransaction(defaultTransactionDefinition); | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					 | 
					@ -322,7 +322,7 @@ public class MaintenanceServiceImpl implements MaintenanceService { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        taskService.save(taskEntity); | 
					 | 
					 | 
					 | 
					        taskService.save(taskEntity); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        dataSourceTransactionManager.commit(transaction); | 
					 | 
					 | 
					 | 
					        dataSourceTransactionManager.commit(transaction); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        //启动流程
 | 
					 | 
					 | 
					 | 
					        //启动流程
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        String processInstanceId = this.startProcess(finalPlanEntity.getProcDefId(), taskEntity); | 
					 | 
					 | 
					 | 
					        String processInstanceId = this.startProcess(finalPlanEntity.getProcDefId(), taskEntity,flag); | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        //推送消息
 | 
					 | 
					 | 
					 | 
					        //推送消息
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        CompletableFuture<Void> operMaintenanceTaskEntityCompletableFuture = | 
					 | 
					 | 
					 | 
					        CompletableFuture<Void> operMaintenanceTaskEntityCompletableFuture = | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                CompletableFuture.runAsync(() -> { | 
					 | 
					 | 
					 | 
					                CompletableFuture.runAsync(() -> { | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					 | 
					@ -349,19 +349,24 @@ public class MaintenanceServiceImpl implements MaintenanceService { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					     * | 
					 | 
					 | 
					 | 
					     * | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					     * @author xiashandong | 
					 | 
					 | 
					 | 
					     * @author xiashandong | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					     **/ | 
					 | 
					 | 
					 | 
					     **/ | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    private String startProcess(String processDefinitionKey, OperMaintenanceTaskEntity taskEntity) { | 
					 | 
					 | 
					 | 
					    private String startProcess(String processDefinitionKey, OperMaintenanceTaskEntity taskEntity,Boolean flag) { | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        OperMaintenanceTaskEntityVo operMaintenanceTaskEntityVo = new OperMaintenanceTaskEntityVo(); | 
					 | 
					 | 
					 | 
					        OperMaintenanceTaskEntityVo operMaintenanceTaskEntityVo = new OperMaintenanceTaskEntityVo(); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        BeanUtils.copyProperties(taskEntity, operMaintenanceTaskEntityVo); | 
					 | 
					 | 
					 | 
					        BeanUtils.copyProperties(taskEntity, operMaintenanceTaskEntityVo); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        Map<String, Object> params = new HashMap<>(); | 
					 | 
					 | 
					 | 
					        Map<String, Object> params = new HashMap<>(); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        params.put("taskId", taskEntity.getId()); | 
					 | 
					 | 
					 | 
					        params.put("taskId", taskEntity.getId()); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        int index = 1; | 
					 | 
					 | 
					 | 
					        if(flag){ | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        for(String userId :taskEntity.getDisposer().split(",")){ | 
					 | 
					 | 
					 | 
					            params.put("startFlowUserId", taskEntity.getCreateUser().toString()); | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            if(index > 1){ | 
					 | 
					 | 
					 | 
					        } | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                params.put("initUserIds" + index , "taskUser_".concat(userId)); | 
					 | 
					 | 
					 | 
					        String[] userArr = taskEntity.getDisposer().split(","); | 
				
			
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					        for(int index = 0; index < userArr.length ; index++){ | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					            if(index > 4){ | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					                continue; | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					            } | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					            if(index > 0){ | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					                params.put("initUserIds" + index , "taskUser_".concat(userArr[index])); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            }else{ | 
					 | 
					 | 
					 | 
					            }else{ | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                params.put("initUserIds", "taskUser_".concat(userId)); | 
					 | 
					 | 
					 | 
					                params.put("initUserIds", "taskUser_".concat(userArr[index])); | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            } | 
					 | 
					 | 
					 | 
					            } | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            index++; | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        } | 
					 | 
					 | 
					 | 
					        } | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        params.put("operMaintenanceTaskEntityVo", operMaintenanceTaskEntityVo); | 
					 | 
					 | 
					 | 
					        params.put("operMaintenanceTaskEntityVo", operMaintenanceTaskEntityVo); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        return flowClient.startProcessInstanceContainNameByKey(processDefinitionKey, String.valueOf(taskEntity.getId()), taskEntity.getTitle(), params).getData().getProcessInstanceId(); | 
					 | 
					 | 
					 | 
					        return flowClient.startProcessInstanceContainNameByKey(processDefinitionKey, String.valueOf(taskEntity.getId()), taskEntity.getTitle(), params).getData().getProcessInstanceId(); | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
						
					 | 
					 | 
					
  |