public async Task <CreateCorporationOutput> CreateByTenant(CreateCorporationByTenantInput input) { var exsitOrg = await _organizationRepository.SingleOrDefaultAsync(p => p.Identification == input.Identification); if (exsitOrg != null) { throw new BusinessException($"系统中已经存在标识为{input.Identification}的组织机构"); } if (!input.ParentId.HasValue || input.ParentId == 0) { return(await CreateTopCorporation(input, input.TenantId)); } return(await CreateSubCorporation(input, input.TenantId)); }
public async Task <CreateCorporationOutput> CreateByTenant(CreateCorporationByTenantInput input) { input.CheckDataAnnotations().CheckValidResult(); return(await _corporationDomainService.CreateByTenant(input)); }