5 changed files with 121 additions and 21 deletions
-
59src/Shentun.WebPeis.Domain/AppointPatientRegisters/AppointPatientRegisterManager.cs
-
46src/Shentun.WebPeis.Domain/CustomerOrgs/CustomerOrgManager.cs
-
13src/Shentun.WebPeis.Domain/Models/Asbitem.cs
-
15src/Shentun.WebPeis.Domain/Models/CustomerOrgGroupDetail.cs
-
7src/Shentun.WebPeis.EntityFrameworkCore/Configures/AsbitemConfigure.cs
@ -0,0 +1,46 @@ |
|||
using Shentun.WebPeis.Enums; |
|||
using Shentun.WebPeis.Models; |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Linq; |
|||
using System.Text; |
|||
using System.Threading.Tasks; |
|||
using Volo.Abp.Domain.Repositories; |
|||
using Volo.Abp.Domain.Services; |
|||
|
|||
namespace Shentun.WebPeis.CustomerOrgs |
|||
{ |
|||
public class CustomerOrgManager : DomainService |
|||
{ |
|||
private readonly IRepository<CustomerOrg> _repository; |
|||
private readonly IRepository<CustomerOrgRegister> _customerOrgRegisterRepository; |
|||
private readonly IRepository<CustomerOrgGroup> _customerOrgGroupRepository; |
|||
|
|||
public CustomerOrgManager( |
|||
IRepository<CustomerOrg> repository, |
|||
IRepository<CustomerOrgRegister> customerOrgRegisterRepository, |
|||
IRepository<CustomerOrgGroup> customerOrgGroupRepository |
|||
) |
|||
{ |
|||
_repository = repository; |
|||
_customerOrgRegisterRepository = customerOrgRegisterRepository; |
|||
_customerOrgGroupRepository = customerOrgGroupRepository; |
|||
|
|||
} |
|||
|
|||
public async Task<CustomerOrg> GetTopCustomerOrgAsync(Guid CustomerOrgId) |
|||
{ |
|||
var entity = await _repository.GetAsync(o=>o.CustomerOrgId == CustomerOrgId); |
|||
if (entity.CustomerOrgId == GuidFlag.PersonCustomerOrgId) |
|||
{ |
|||
return entity; |
|||
} |
|||
if (entity.PathCode.Length == 5) |
|||
{ |
|||
return entity; |
|||
} |
|||
entity = await _repository.GetAsync(o => o.PathCode == entity.PathCode.Substring(0, 5)); |
|||
return entity; |
|||
} |
|||
} |
|||
} |
|||
Write
Preview
Loading…
Cancel
Save
Reference in new issue