|
|
|
@ -54,7 +54,7 @@ namespace Shentun.Peis.Patients |
|
|
|
Patient entity |
|
|
|
) |
|
|
|
{ |
|
|
|
await Verify(entity); |
|
|
|
Verify(entity); |
|
|
|
if (!string.IsNullOrWhiteSpace(entity.NationId)) |
|
|
|
{ |
|
|
|
|
|
|
|
@ -67,7 +67,7 @@ namespace Shentun.Peis.Patients |
|
|
|
|
|
|
|
if (!string.IsNullOrWhiteSpace(entity.IdNo)) |
|
|
|
{ |
|
|
|
var existPatient = await _repository.FindAsync(o => o.IdNo == entity.IdNo); |
|
|
|
var existPatient = await _repository.FirstOrDefaultAsync(o => o.IdNo == entity.IdNo); |
|
|
|
if (existPatient != null) |
|
|
|
{ |
|
|
|
throw new UserFriendlyException("该身份证号已经在人员信息中注册"); |
|
|
|
@ -118,7 +118,7 @@ namespace Shentun.Peis.Patients |
|
|
|
{ |
|
|
|
throw new UserFriendlyException("更新人员信息时源实体不能等于目标实体"); |
|
|
|
} |
|
|
|
await Verify(sourceEntity); |
|
|
|
Verify(sourceEntity); |
|
|
|
if (!string.IsNullOrWhiteSpace(sourceEntity.NationId) && sourceEntity.NationId != targetEntity.NationId) |
|
|
|
{ |
|
|
|
|
|
|
|
@ -134,7 +134,7 @@ namespace Shentun.Peis.Patients |
|
|
|
} |
|
|
|
if (!string.IsNullOrWhiteSpace(sourceEntity.IdNo) && sourceEntity.IdNo != targetEntity.IdNo) |
|
|
|
{ |
|
|
|
var existPatient = await _repository.FindAsync(o => o.IdNo == sourceEntity.IdNo); |
|
|
|
var existPatient = await _repository.FirstOrDefaultAsync(o => o.IdNo == sourceEntity.IdNo); |
|
|
|
if (existPatient != null) |
|
|
|
{ |
|
|
|
throw new UserFriendlyException("该身份证号已经在人员信息中注册"); |
|
|
|
@ -204,7 +204,7 @@ namespace Shentun.Peis.Patients |
|
|
|
/// <returns></returns>
|
|
|
|
public async Task<Patient> CreateAsync(Guid OrganizationUnitId, Patient entity) |
|
|
|
{ |
|
|
|
await Verify(entity); |
|
|
|
Verify(entity); |
|
|
|
if (!string.IsNullOrWhiteSpace(entity.NationId)) |
|
|
|
{ |
|
|
|
|
|
|
|
@ -216,7 +216,7 @@ namespace Shentun.Peis.Patients |
|
|
|
} |
|
|
|
if (!string.IsNullOrWhiteSpace(entity.IdNo)) |
|
|
|
{ |
|
|
|
var existPatient = await _repository.FindAsync(o => o.IdNo == entity.IdNo); |
|
|
|
var existPatient = await _repository.FirstOrDefaultAsync(o => o.IdNo == entity.IdNo); |
|
|
|
if (existPatient != null) |
|
|
|
{ |
|
|
|
throw new UserFriendlyException("该身份证号已经在人员信息中注册"); |
|
|
|
@ -345,7 +345,7 @@ namespace Shentun.Peis.Patients |
|
|
|
else return true; |
|
|
|
} |
|
|
|
|
|
|
|
private async Task Verify(Patient entity) |
|
|
|
private void Verify(Patient entity) |
|
|
|
{ |
|
|
|
DataHelper.CheckEntityIsNull(entity); |
|
|
|
if (!string.IsNullOrEmpty(entity.DisplayName)) |
|
|
|
|