Browse Source

预约

master
DESKTOP-G961P6V\Zhh 1 year ago
parent
commit
716e255c8c
  1. 10
      src/Shentun.WebPeis.Application.Contracts/Persons/CreatePersonDto.cs
  2. 5
      src/Shentun.WebPeis.Application.Contracts/Persons/PersonDto.cs
  3. 14
      src/Shentun.WebPeis.Application/Persons/PersonAppService.cs
  4. 2
      src/Shentun.WebPeis.Application/QuestionRegisters/QuestionRegisterAppService.cs
  5. 27
      src/Shentun.WebPeis.Domain/Models/Person.cs

10
src/Shentun.WebPeis.Application.Contracts/Persons/CreatePersonDto.cs

@ -84,6 +84,16 @@ namespace Shentun.WebPeis.Persons
/// 允许绑定
/// </summary>
public char? IsAllowBind { get; set; }
/// <summary>
/// 身高
/// </summary>
public decimal? Height { get; set; }
/// <summary>
/// 体重
/// </summary>
public decimal? Weight { get; set; }
/// <summary>
/// 微信JsCode
/// </summary>

5
src/Shentun.WebPeis.Application.Contracts/Persons/PersonDto.cs

@ -94,6 +94,9 @@ namespace Shentun.WebPeis.Persons
public char? IsActive { get; set; }
public int DisplayOrder { get; set; }
public char IsHaveQuestionRegister { get; set; }
}
}

14
src/Shentun.WebPeis.Application/Persons/PersonAppService.cs

@ -46,7 +46,7 @@ namespace Shentun.WebPeis.Persons
[Authorize]
public class PersonAppService : ApplicationService
{
private readonly IRepository<QuestionRegister> _questionRegisterRepository;
private readonly IConfiguration _configuration;
private readonly IRepository<IdentityUser, Guid> _identityUserRepository;
private readonly IdentityUserManager _userManager;
@ -72,7 +72,8 @@ namespace Shentun.WebPeis.Persons
IRepository<Patient> patientRepository,
CacheService cacheService,
IHttpContextAccessor httpContextAccessor,
IRepository<CustomerOrg> customerOrgRepository)
IRepository<CustomerOrg> customerOrgRepository,
IRepository<QuestionRegister> questionRegisterRepository)
{
_repository = repository;
_configuration = configuration;
@ -87,6 +88,7 @@ namespace Shentun.WebPeis.Persons
_cacheService = cacheService;
_httpContextAccessor = httpContextAccessor;
_customerOrgRepository = customerOrgRepository;
_questionRegisterRepository = questionRegisterRepository;
}
public async Task<PersonDto> GetByIdAsync(PersonIdInputDto input)
@ -356,6 +358,9 @@ namespace Shentun.WebPeis.Persons
var personList = (from user in await _identityUserRepository.GetQueryableAsync()
join person in await _repository.GetQueryableAsync()
on user.Id equals person.PersonId
join questionRegister in await _questionRegisterRepository.GetQueryableAsync()
on person.PersonId equals questionRegister.PersonId into emptyQuestionRegister
from haveQuestionRegister in emptyQuestionRegister.DefaultIfEmpty()
where personKinshipIds.Contains(user.Id)
orderby user.CreationTime
select new PersonDto
@ -367,10 +372,11 @@ namespace Shentun.WebPeis.Persons
MaritalStatusId = person.MaritalStatusId,
MaritalStatusName = _cacheService.GetMaritalStatusNameAsync(person.MaritalStatusId).Result,
IdNo = person.IdNo,
MobileTelephone = user.PhoneNumber
MobileTelephone = user.PhoneNumber,
IsHaveQuestionRegister = haveQuestionRegister==null? 'N':'Y'
}).ToList();
}).Distinct().ToList();
for (var i = 0; i < personList.Count; i++)
{
personList[i].DisplayOrder = i + 1;

2
src/Shentun.WebPeis.Application/QuestionRegisters/QuestionRegisterAppService.cs

@ -70,7 +70,7 @@ namespace Shentun.WebPeis.QuestionRegisters
await _repository.InsertAsync(questionRegisterEntity);
questionRegisterDto.QuestionRegisterId = questionRegisterEntity.QuestionRegisterId;
await _unitOfWorkManager.Current.SaveChangesAsync();
return questionRegisterDto;
//return questionRegisterDto;
}
questionRegisterDto.QuestionRegisterId = questionRegister.QuestionRegisterId;
//已登记过

27
src/Shentun.WebPeis.Domain/Models/Person.cs

@ -21,9 +21,6 @@ public partial class Person: AuditedEntity,IHasConcurrencyStamp
/// 组织单位ID
/// </summary>
public Guid MedicalCenterId { get; set; }
/// <summary>
/// 性别
/// </summary>
@ -58,10 +55,6 @@ public partial class Person: AuditedEntity,IHasConcurrencyStamp
/// 邮政编码
/// </summary>
public string? PostalCode { get; set; }
/// <summary>
/// 地址
/// </summary>
@ -74,16 +67,32 @@ public partial class Person: AuditedEntity,IHasConcurrencyStamp
public string? ConcurrencyStamp { get; set; }
/// <summary>
/// 微信openid
/// </summary>
public string? WechatOpenId { get; set; }
/// <summary>
/// 证件类别
/// </summary>
public string? IdTypeId { get; set; }
/// <summary>
/// 国家码
/// </summary>
public string? CountryCode { get; set; }
/// <summary>
/// 允许绑定
/// </summary>
public char? IsAllowBind { get; set; }
/// <summary>
/// 身高
/// </summary>
public decimal? Height { get; set; }
/// <summary>
/// 体重
/// </summary>
public decimal? Weight { get; set; }
public virtual ICollection<QuestionRegister> QuestionRegisters { get; set; } = new List<QuestionRegister>();

Loading…
Cancel
Save