提供流程与角色一对多情况下的角色删除功能(放入回收站)
This commit is contained in:
		
							parent
							
								
									053fe9785d
								
							
						
					
					
						commit
						ccd14f5213
					
				
										
											Binary file not shown.
										
									
								
							| @ -39,7 +39,12 @@ public class RoleErrorChangeController { | ||||
| 	} | ||||
| 
 | ||||
| 	@Mapping("com.actionsoft.apps.coe.pal.datamigration_role_multi_error_query") | ||||
| 	public String roleMultiErrorDataUpdate(UserContext userContext) { | ||||
| 		return new RoleErrorWeb(userContext).updateRoleMultiError(); | ||||
| 	public String roleMultiErrorDataQuery(UserContext userContext) { | ||||
| 		return new RoleErrorWeb(userContext).getRoleMultiError(); | ||||
| 	} | ||||
| 
 | ||||
| 	@Mapping("com.actionsoft.apps.coe.pal.datamigration_role_multi_error_update") | ||||
| 	public String roleMultiErrorDataUpdate(UserContext userContext, String delRoleData) { | ||||
| 		return new RoleErrorWeb(userContext).updateRoleMultiError(delRoleData); | ||||
| 	} | ||||
| } | ||||
|  | ||||
| @ -22,6 +22,7 @@ import com.actionsoft.apps.coe.pal.pal.repository.cache.PALRepositoryCache; | ||||
| import com.actionsoft.apps.coe.pal.pal.repository.designer.relation.cache.DesignerShapeRelationCache; | ||||
| import com.actionsoft.apps.coe.pal.pal.repository.designer.relation.dao.DesignerShapeRelationDao; | ||||
| import com.actionsoft.apps.coe.pal.pal.repository.designer.relation.model.DesignerShapeRelationModel; | ||||
| import com.actionsoft.apps.coe.pal.pal.repository.designer.web.CoeDesignerWeb; | ||||
| import com.actionsoft.apps.coe.pal.pal.repository.model.PALRepositoryModel; | ||||
| import com.actionsoft.apps.coe.pal.pal.ws.dao.CoeWorkSpace; | ||||
| import com.actionsoft.apps.coe.pal.pal.ws.model.CoeWorkSpaceModel; | ||||
| @ -31,6 +32,7 @@ import com.actionsoft.bpms.commons.mvc.view.ResponseObject; | ||||
| import com.actionsoft.bpms.server.UserContext; | ||||
| import com.actionsoft.bpms.util.UtilDate; | ||||
| import com.actionsoft.bpms.util.UtilString; | ||||
| import com.alibaba.fastjson.JSONArray; | ||||
| 
 | ||||
| public class RoleErrorWeb extends ActionWeb { | ||||
| 
 | ||||
| @ -549,7 +551,7 @@ public class RoleErrorWeb extends ActionWeb { | ||||
| 	 * 查询多余的角色图(出现了1个流程对应多个角色图的数据) | ||||
| 	 * @return | ||||
| 	 */ | ||||
| 	public String updateRoleMultiError() { | ||||
| 	public String getRoleMultiError() { | ||||
| 		/* | ||||
| 		1.查询启动中的资产库 | ||||
| 		2.查询所有的流程 | ||||
| @ -702,4 +704,39 @@ public class RoleErrorWeb extends ActionWeb { | ||||
| 		} | ||||
| 		return result; | ||||
| 	} | ||||
| 
 | ||||
| 	/** | ||||
| 	 * 删除错误角色数据 | ||||
| 	 * @param delRoleData | ||||
| 	 * @return | ||||
| 	 */ | ||||
| 	public String updateRoleMultiError(String delRoleData) { | ||||
| 		JSONArray array = JSONArray.parseArray(delRoleData); | ||||
| 		if (array == null) { | ||||
| 			return ResponseObject.newErrResponse("删除数据格式错误").toJSONObject().toJSONString(); | ||||
| 		} | ||||
| 		if (array.size() == 0) { | ||||
| 			return ResponseObject.newErrResponse("删除数据为空").toJSONObject().toJSONString(); | ||||
| 		} | ||||
| 		List<PALRepositoryModel> list = new ArrayList<>(); | ||||
| 		for (int i = 0; i < array.size(); i++) { | ||||
| 			String roleId = array.getString(i); | ||||
| 			if (UtilString.isNotEmpty(roleId)) { | ||||
| 				PALRepositoryModel model = PALRepositoryCache.getCache().get(roleId); | ||||
| 				if (model == null) { | ||||
| 					return ResponseObject.newErrResponse("删除数据不存在,角色ID:" + roleId).toJSONObject().toJSONString(); | ||||
| 				} | ||||
| 				list.add(model); | ||||
| 			} | ||||
| 		} | ||||
| 		CoeDesignerWeb web = new CoeDesignerWeb(_uc); | ||||
| 		// 删除角色数据 | ||||
| 		for (PALRepositoryModel model : list) { | ||||
| 			String fileId = model.getId(); | ||||
| 			String name = model.getName(); | ||||
| 			String result = web.deletePalDesignerVersion(model.getWsId(), null, model.getId()); | ||||
| 			System.out.println("删除角色数据:" + name + ",角色ID:" + fileId + ",删除结果:" + result); | ||||
| 		} | ||||
| 		return ResponseObject.newOkResponse("删除成功").toString(); | ||||
| 	} | ||||
| } | ||||
|  | ||||
| @ -22,8 +22,8 @@ | ||||
| 	  const production =  true; | ||||
| 		const devUserInfo = {}; | ||||
| 	</script> | ||||
|   <script type="module" crossorigin src="../apps/com.actionsoft.apps.coe.pal.datamigration/main/js/entry-index-d3daa6b5.js"></script> | ||||
|   <link rel="stylesheet" href="../apps/com.actionsoft.apps.coe.pal.datamigration/main/assets/asset-style-16cdca61.css"> | ||||
|   <script type="module" crossorigin src="../apps/com.actionsoft.apps.coe.pal.datamigration/main/js/entry-index-8edd1846.js"></script> | ||||
|   <link rel="stylesheet" href="../apps/com.actionsoft.apps.coe.pal.datamigration/main/assets/asset-style-d2b7ff33.css"> | ||||
| </head> | ||||
| <body style="margin:0;"> | ||||
| <div id="app"></div> | ||||
|  | ||||
| @ -112,4 +112,7 @@ | ||||
|     </cmd-bean> | ||||
|     <cmd-bean name="com.actionsoft.apps.coe.pal.datamigration_role_multi_error_query"> | ||||
|     </cmd-bean> | ||||
|     <cmd-bean name="com.actionsoft.apps.coe.pal.datamigration_role_multi_error_update"> | ||||
|         <param name="delRoleData"/> | ||||
|     </cmd-bean> | ||||
| </aws-actions> | ||||
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							
		Loading…
	
		Reference in New Issue
	
	Block a user
	 446052889@qq.com
						446052889@qq.com