|
|
@ -67,8 +67,7 @@ namespace Shentun.Peis |
|
|
IRepository<CustomerOrg, Guid> customerOrgRepository, |
|
|
IRepository<CustomerOrg, Guid> customerOrgRepository, |
|
|
IRepository<MaritalStatus> maritalStatusRepository, |
|
|
IRepository<MaritalStatus> maritalStatusRepository, |
|
|
IRepository<MedicalType, Guid> medicalTypeRepository, |
|
|
IRepository<MedicalType, Guid> medicalTypeRepository, |
|
|
IRepository<PersonnelType, Guid> personnelTypeRepository |
|
|
|
|
|
, |
|
|
|
|
|
|
|
|
IRepository<PersonnelType, Guid> personnelTypeRepository, |
|
|
IDistributedCache<string, Guid> customerOrgTopNameCache) |
|
|
IDistributedCache<string, Guid> customerOrgTopNameCache) |
|
|
{ |
|
|
{ |
|
|
_userCache = userCache; |
|
|
_userCache = userCache; |
|
|
@ -164,11 +163,19 @@ namespace Shentun.Peis |
|
|
private async Task<MaritalStatus> GetMaritalStatusAsync(char id) |
|
|
private async Task<MaritalStatus> GetMaritalStatusAsync(char id) |
|
|
{ |
|
|
{ |
|
|
|
|
|
|
|
|
var entity = await _maritalStatusCache.GetOrAddAsync( |
|
|
|
|
|
id, //缓存键
|
|
|
|
|
|
async () => (await _maritalStatusRepository.GetQueryableAsync()).Where(o => o.Id == id).Single() |
|
|
|
|
|
); |
|
|
|
|
|
return entity; |
|
|
|
|
|
|
|
|
var maritalStatusEntity = await _maritalStatusCache.GetAsync(id); |
|
|
|
|
|
if (maritalStatusEntity == null) |
|
|
|
|
|
{ |
|
|
|
|
|
maritalStatusEntity = await _maritalStatusRepository.FirstOrDefaultAsync(f => f.Id == id); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return maritalStatusEntity; |
|
|
|
|
|
|
|
|
|
|
|
//var entity = await _maritalStatusCache.GetOrAddAsync(
|
|
|
|
|
|
// id, //缓存键
|
|
|
|
|
|
// async () => (await _maritalStatusRepository.GetQueryableAsync()).Where(o => o.Id == id).Single()
|
|
|
|
|
|
//);
|
|
|
|
|
|
//return entity;
|
|
|
} |
|
|
} |
|
|
public async Task<string> GetMaritalStatusNameAsync(char id) |
|
|
public async Task<string> GetMaritalStatusNameAsync(char id) |
|
|
{ |
|
|
{ |
|
|
|