|
|
|
@ -24,7 +24,7 @@ namespace Shentun.Peis.CustomerOrgGroups |
|
|
|
private readonly IRepository<CustomerOrgGroup, Guid> _repository; |
|
|
|
|
|
|
|
private readonly IRepository<PatientRegister, Guid> _patientRegisterRepository; |
|
|
|
private readonly IRepository<CustomerOrgGroupDetail> _customerOrgGroupDetailRepository; |
|
|
|
private readonly IRepository<CustomerOrg, Guid> _customerOrgRepository; |
|
|
|
private readonly IRepository<CustomerOrgRegister, Guid> _customerOrgRegisterRepositor; |
|
|
|
private readonly CustomerOrgGroupDetailManager _customerOrgGroupDetailManager; |
|
|
|
|
|
|
|
@ -32,14 +32,14 @@ namespace Shentun.Peis.CustomerOrgGroups |
|
|
|
public CustomerOrgGroupManager( |
|
|
|
IRepository<CustomerOrgGroup, Guid> repository, |
|
|
|
IRepository<PatientRegister, Guid> patientRegisterRepository, |
|
|
|
IRepository<CustomerOrgGroupDetail> customerOrgGroupDetailRepository, |
|
|
|
IRepository<CustomerOrg, Guid> customerOrgRepository, |
|
|
|
IRepository<CustomerOrgRegister, Guid> customerOrgRegisterRepositor, |
|
|
|
CustomerOrgGroupDetailManager customerOrgGroupDetailManager) |
|
|
|
{ |
|
|
|
_repository = repository; |
|
|
|
|
|
|
|
this._patientRegisterRepository = patientRegisterRepository; |
|
|
|
this._customerOrgGroupDetailRepository = customerOrgGroupDetailRepository; |
|
|
|
this._customerOrgRepository = customerOrgRepository; |
|
|
|
this._customerOrgRegisterRepositor = customerOrgRegisterRepositor; |
|
|
|
this._customerOrgGroupDetailManager = customerOrgGroupDetailManager; |
|
|
|
|
|
|
|
@ -55,11 +55,11 @@ namespace Shentun.Peis.CustomerOrgGroups |
|
|
|
CustomerOrgGroup entity |
|
|
|
) |
|
|
|
{ |
|
|
|
//DataHelper.CheckVerifyData(entity.DisplayName, "名称");
|
|
|
|
//await EntityHelper.CheckSameName<CustomerOrgGroup, Guid>(_repository, entity.DisplayName);
|
|
|
|
|
|
|
|
//var customerorgRegisterEnt = await _customerorgRegisterRepository.FindAsync(m => m.CustomerOrgId == customerOrgId && m.IsComplete == 'N');
|
|
|
|
|
|
|
|
if (customerOrgId != null && customerOrgId != Guid.Empty) |
|
|
|
{ |
|
|
|
//检查单位状态
|
|
|
|
await CheckCustomerOrgStatus(customerOrgId.Value); |
|
|
|
} |
|
|
|
Guid NewCustomerorgRegisterId = Guid.Empty; |
|
|
|
if (IsMaxMedicalTimes == 'Y') |
|
|
|
{ |
|
|
|
@ -127,15 +127,7 @@ namespace Shentun.Peis.CustomerOrgGroups |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// 修改排序 相邻之间
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="id">需要修改的ID</param>
|
|
|
|
/// <param name="targetid">目标ID</param>
|
|
|
|
public async Task UpdateSortAsync(Guid id, Guid targetid) |
|
|
|
{ |
|
|
|
await EntityHelper.UpdateSort(_repository, id, targetid); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// 修改排序 置顶,置底
|
|
|
|
@ -213,7 +205,7 @@ namespace Shentun.Peis.CustomerOrgGroups |
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// 检查体检次数状态 如果已完成 就不能经行操作
|
|
|
|
/// 检查体检次数状态 如果已完成 就不能进行操作
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="CustomerOrgRegisterId"></param>
|
|
|
|
/// <returns></returns>
|
|
|
|
@ -225,5 +217,20 @@ namespace Shentun.Peis.CustomerOrgGroups |
|
|
|
throw new UserFriendlyException("当前分组的体检次数已完成,无法操作!"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// 检查单位状态是否可以使用
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="CustomerOrgId"></param>
|
|
|
|
/// <returns></returns>
|
|
|
|
private async Task CheckCustomerOrgStatus(Guid CustomerOrgId) |
|
|
|
{ |
|
|
|
var customerOrgEntity = await _customerOrgRepository.FirstOrDefaultAsync(f => f.Id == CustomerOrgId && (f.IsLock == 'Y' || f.IsActive == 'N')); |
|
|
|
if (customerOrgEntity != null) |
|
|
|
{ |
|
|
|
throw new UserFriendlyException("当前单位未启用或者已锁定,无法操作!"); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |