/// <summary> /// 保存机构模块元素 /// </summary> /// <param name="input"></param> /// <returns></returns> public async Task <JsonResponse> SaveOrganizationModuleElement(OrganizationElementRequestDto input) { var result = await GetAddOrRemoveOrganizationElementRequest(input); var resJson = await _applicationEnginee.TryTransactionAsync(async() => { await _organizationElementAppService.BatchCreateAsync(result.Item1); await _organizationElementAppService.BatchRemoveAsync(result.Item2); }); return(resJson); }
/// <summary> /// 批量新增 /// </summary> /// <param name="input"></param> /// <returns></returns> public async Task <JsonResponse> BatchCreate(OrganizationElementBatchRequestDto input) { foreach (var organizationElementRequestDto in input.OrganizationElementRequestList) { organizationElementRequestDto.InitCreateRequest(input.Payload); } var resJson = await _applicationEnginee.TryTransactionAsync(async() => { await _organizationElementAppService.BatchCreateAsync(input.OrganizationElementRequestList); }); return(resJson); }