/// <summary> /// 删除模块 /// </summary> /// <param name="entityRequest"></param> /// <returns></returns> public async Task <JsonResponse> RemoveModule(EntityRequest entityRequest) { var elementDtos = await _moduleElementAppService.GetElementByModuleIds(entityRequest.Ids);; var elementIds = elementDtos.Select(r => r.Id).ToList(); var orgElementIds = await _organizationElementAppService.GetIdsByModuleElementIdsAsync(elementIds); var roleElementIds = await _roleElementAppService.GetIdsByModuleElementIdsAsync(elementIds); var empElementIds = await _employeeElementAppService.GetIdsByModuleElementIdsAsync(elementIds); var resJson = await _applicationEnginee.TryTransactionAsync(async() => { await _moduleAppService.RemoveAsync(entityRequest); await _moduleElementAppService.RemoveAsync(new EntityRequest() { Ids = elementIds, CreateDate = DateTime.Now, CreateUserId = entityRequest.CreateUserId, CreateUserName = entityRequest.CreateUserName }); await _organizationElementAppService.RemoveAsync(new EntityRequest() { Ids = orgElementIds, CreateDate = DateTime.Now, CreateUserId = entityRequest.CreateUserId, CreateUserName = entityRequest.CreateUserName }); await _roleElementAppService.RemoveAsync(new EntityRequest() { Ids = roleElementIds, CreateDate = DateTime.Now, CreateUserId = entityRequest.CreateUserId, CreateUserName = entityRequest.CreateUserName }); await _employeeElementAppService.RemoveAsync(new EntityRequest() { Ids = empElementIds, CreateDate = DateTime.Now, CreateUserId = entityRequest.CreateUserId, CreateUserName = entityRequest.CreateUserName }); }); return(resJson); }
/// <summary> /// 删除 /// </summary> /// <param name="input"></param> /// <returns></returns> public async Task <JsonResponse> Remove(EntityRequest input) { input.InitModifyRequest(); var resJson = await _applicationEnginee.TryTransactionAsync(async() => { await _moduleElementAppService.RemoveAsync(input); }); return(resJson); }