代码优化

This commit is contained in:
fuenmao
2026-08-27 11:09:20 +08:00
parent 658869b3a7
commit ae8167a566
46 changed files with 2051 additions and 204 deletions
@@ -70,6 +70,21 @@ public class OnboardingCompanyService : DbRepository<ObCompany>, IOnboardingComp
if (hasPositions)
throw Oops.Bah("公司下仍有岗位,不能删除");
var hasDepartments = await Context.Queryable<ObDepartment>()
.AnyAsync(item => input.Ids.Contains(item.CompanyId));
if (hasDepartments)
throw Oops.Bah("公司下仍有部门,不能删除");
var hasOnboardingTemplates = await Context.Queryable<ObOnboardingTemplate>()
.AnyAsync(item => input.Ids.Contains(item.CompanyId));
if (hasOnboardingTemplates)
throw Oops.Bah("公司已被入职模板引用,不能删除");
var hasContractTemplates = await Context.Queryable<ObContractTemplate>()
.AnyAsync(item => item.CompanyId.HasValue && input.Ids.Contains(item.CompanyId.Value));
if (hasContractTemplates)
throw Oops.Bah("公司已被合同模板引用,不能删除");
var hasTasks = await Context.Queryable<ObOnboardingTask>()
.AnyAsync(it => input.Ids.Contains(it.CompanyId));
if (hasTasks)