Browse Source

团检预约

master
DESKTOP-G961P6V\Zhh 1 year ago
parent
commit
1ec5f5303d
  1. 3
      src/Shentun.WebPeis.Application.Contracts/PatientRegisters/PatientRegisterDto.cs
  2. 26
      src/Shentun.WebPeis.Application/AppointPatientRegisters/AppointPatientRegisterAppService.cs
  3. 2
      src/Shentun.WebPeis.Domain/Models/CustomerOrgGroup.cs
  4. 4
      src/Shentun.WebPeis.EntityFrameworkCore/Configures/CustomerOrgGroupConfigure.cs

3
src/Shentun.WebPeis.Application.Contracts/PatientRegisters/PatientRegisterDto.cs

@ -40,10 +40,13 @@ namespace Shentun.WebPeis.PatientRegisters
/// </summary>
public Guid? CustomerOrgGroupId { get; set; }
public string? CustomerOrgGroupName { get; set; }
/// <summary>
/// 套餐
/// </summary>
public Guid? MedicalPackageId { get; set; }
public string? MedicalPackageName { get; set; }
/// <summary>
/// 姓名

26
src/Shentun.WebPeis.Application/AppointPatientRegisters/AppointPatientRegisterAppService.cs

@ -126,7 +126,7 @@ namespace Shentun.WebPeis.AppointPatientRegisters
if (input == null) throw new UserFriendlyException("参数不能为空");
Guid medicalCenterId;
if (input.MedicalCenterId == null || input.MedicalCenterId == Guid.Empty )
if (input.MedicalCenterId == null || input.MedicalCenterId == Guid.Empty)
{
var webPeisOrganizationUnit = await _webPeisOrganizationUnitManager.GetMedicalCenterListAsync();
if (webPeisOrganizationUnit.Count > 1 || webPeisOrganizationUnit.Count == 0)
@ -137,9 +137,9 @@ namespace Shentun.WebPeis.AppointPatientRegisters
}
else
{
medicalCenterId = (Guid) input.MedicalCenterId;
medicalCenterId = (Guid)input.MedicalCenterId;
}
if(input.AppointStartDate == null )
if (input.AppointStartDate == null)
{
input.AppointStartDate = DateTime.Now.Date;
}
@ -202,7 +202,7 @@ namespace Shentun.WebPeis.AppointPatientRegisters
{
throw new UserFriendlyException("身份证长度必须是18位");
}
query = query.Where(o => o.person.IdNo == input.IdNo );
query = query.Where(o => o.person.IdNo == input.IdNo);
}
else
@ -228,7 +228,7 @@ namespace Shentun.WebPeis.AppointPatientRegisters
CustomerOrgId = o.FirstOrDefault().appointPatientRegister.CustomerOrgId,
ChildCustomerOrgName = o.FirstOrDefault().customerOrg.PathCode.Length == 5 ? "" : o.FirstOrDefault().customerOrg.CustomerOrgName,
CustomerOrgGroupId = o.FirstOrDefault().appointPatientRegister.CustomerOrgGroupId,
CustomerOrgGroupName = o.FirstOrDefault().haveCustomerOrgGroup == null ? "" : o.FirstOrDefault().haveCustomerOrgGroup.DisplayName,
CustomerOrgGroupName = o.FirstOrDefault().haveCustomerOrgGroup == null ? "" : o.FirstOrDefault().haveCustomerOrgGroup.CustomerOrgGroupName,
CustomerOrgRegisterId = o.FirstOrDefault().appointPatientRegister.CustomerOrgRegisterId,
MedicalPackageId = o.FirstOrDefault().appointPatientRegister.MedicalPackageId,
MedicalPackageName = o.FirstOrDefault().haveMedicalPackage == null ? "" : o.FirstOrDefault().haveMedicalPackage.MedicalPackageName,
@ -304,12 +304,12 @@ namespace Shentun.WebPeis.AppointPatientRegisters
o.IsInMedicalPackage = 'Y';
}
var itemType = itemTypes.Where(o => o.ItemTypeId == o.ItemTypeId).First();
itemType = itemTypes.Where(o=>o.PathCode == itemType.PathCode.Substring(0,5)).First();
itemType = itemTypes.Where(o => o.PathCode == itemType.PathCode.Substring(0, 5)).First();
o.ItemTypeId = itemType.ItemTypeId;
o.ItemTypeDisplayOrder = itemType.DisplayOrder;
});
appointRegisterAsbitemDtos = appointRegisterAsbitemDtos.OrderBy(o=>o.ItemTypeDisplayOrder)
.OrderBy(o=>o.DisplayOrder).ToList();
appointRegisterAsbitemDtos = appointRegisterAsbitemDtos.OrderBy(o => o.ItemTypeDisplayOrder)
.OrderBy(o => o.DisplayOrder).ToList();
return appointRegisterAsbitemDtos;
}
@ -330,10 +330,13 @@ namespace Shentun.WebPeis.AppointPatientRegisters
on patient.PatientId equals patientRegister.PatientId
join customerOrg in await _customerOrgRepository.GetQueryableAsync()
on patientRegister.CustomerOrgId equals customerOrg.CustomerOrgId
join customerOrgGroup in await _customerOrgGroupRepository.GetQueryableAsync()
on patientRegister.CustomerOrgGroupId equals customerOrgGroup.CustomerOrgGroupId into canEmptyCustomerOrgGroup
from haveCustomerOrgGroup in canEmptyCustomerOrgGroup.DefaultIfEmpty()
where user.Id == input.PersonId &&
(patientRegister.CompleteFlag == PatientRegisterCompleteFlag.PreRegistration ||
patientRegister.CompleteFlag == PatientRegisterCompleteFlag.Registration) &&
patientRegister.MedicalStartDate >= DateTime.Now.Date.AddDays(-365)
(patientRegister.CompleteFlag == PatientRegisterCompleteFlag.PreRegistration ||
patientRegister.CompleteFlag == PatientRegisterCompleteFlag.Registration) &&
patientRegister.MedicalStartDate >= DateTime.Now.Date.AddDays(-365)
orderby patientRegister.MedicalStartDate descending
select new PatientRegisterDto()
{
@ -342,6 +345,7 @@ namespace Shentun.WebPeis.AppointPatientRegisters
ChildCustomerOrgName = customerOrg.CustomerOrgName,
CustomerOrgRegisterId = patientRegister.CustomerOrgRegisterId,
CustomerOrgGroupId = patientRegister.CustomerOrgGroupId,
CustomerOrgGroupName = haveCustomerOrgGroup == null?"": haveCustomerOrgGroup.CustomerOrgGroupName
}).FirstOrDefault();
if (patientRegisterDto == null)
{

2
src/Shentun.WebPeis.Domain/Models/CustomerOrgGroup.cs

@ -15,7 +15,7 @@ public partial class CustomerOrgGroup : AuditedEntity, IHasConcurrencyStamp
/// <summary>
/// 分组名称
/// </summary>
public string DisplayName { get; set; } = null!;
public string CustomerOrgGroupName { get; set; } = null!;
/// <summary>
/// 价格

4
src/Shentun.WebPeis.EntityFrameworkCore/Configures/CustomerOrgGroupConfigure.cs

@ -37,10 +37,10 @@ namespace Shentun.WebPeis.Configures
.HasColumnName("creation_time");
entity.Property(e => e.CreatorId).HasColumnName("creator_id");
entity.Property(e => e.CustomerOrgRegisterId).HasColumnName("customer_org_register_id");
entity.Property(e => e.DisplayName)
entity.Property(e => e.CustomerOrgGroupName)
.HasMaxLength(50)
.HasComment("分组名称")
.HasColumnName("display_name");
.HasColumnName("customer_org_group_name");
entity.Property(e => e.DisplayOrder)
.HasDefaultValue(999999)
.HasComment("显示顺序")

Loading…
Cancel
Save