|
@@ -49,7 +49,6 @@ public class SystemDomainService : ISystemDomainService, IScopeDependency
|
|
|
/// <returns></returns>
|
|
|
public async Task<string> GenerateNewOrgCodeAsync(string? parentId, CancellationToken cancellationToken)
|
|
|
{
|
|
|
- //部门等级
|
|
|
if (string.IsNullOrEmpty(parentId))
|
|
|
{
|
|
|
//一级部门
|
|
@@ -79,19 +78,6 @@ public class SystemDomainService : ISystemDomainService, IScopeDependency
|
|
|
|
|
|
return $"{parentOrg.OrgCode}{(max + 1):000}";
|
|
|
}
|
|
|
-
|
|
|
- //var org = await _organizeRepository.GetAsync(parentId, cancellationToken);
|
|
|
- //if (org == null)
|
|
|
- // throw new UserFriendlyException("无效上级部门编码");
|
|
|
- //var count = await _organizeRepository.CountAsync(d => d.ParentId == parentId, cancellationToken);
|
|
|
- //var current = (count + 1).ToString("000");
|
|
|
- //var code = $"{org.OrgCode}{current}";
|
|
|
- //var exists = await _organizeRepository.AnyAsync(d => d.OrgCode == code, cancellationToken);
|
|
|
- //while (exists)
|
|
|
- //{
|
|
|
- // return await GenerateNewOrgCodeAsync(parentId, cancellationToken);
|
|
|
- //}
|
|
|
- //return code;
|
|
|
}
|
|
|
|
|
|
/// <summary>
|