Browse Source

指引单

bjmzak
DESKTOP-G961P6V\Zhh 2 years ago
parent
commit
a133e76c8b
  1. 2
      src/Shentun.Peis.Application.Contracts/AsbitemGuides/AsbitemGuideDto.cs
  2. 2
      src/Shentun.Peis.Application.Contracts/AsbitemGuides/CreateAsbitemGuideManyDto.cs
  3. 4
      src/Shentun.Peis.Application/AsbitemGuides/AsbitemGuideAppService.cs
  4. 8
      src/Shentun.Peis.Domain/AsbitemGuides/AsbitemGuide.cs
  5. 4
      src/Shentun.Peis.Domain/AsbitemGuides/AsbitemGuideManager.cs
  6. 4
      src/Shentun.Peis.EntityFrameworkCore/DbMapping/AsbitemGuides/AsbitemGuideDbMapping.cs

2
src/Shentun.Peis.Application.Contracts/AsbitemGuides/AsbitemGuideDto.cs

@ -9,7 +9,7 @@ namespace Shentun.Peis.AsbitemGuides
/// <summary>
/// 单位科室ID
/// </summary>
public Guid OrganizationUnitId { get; set; }
public Guid MedicalCenterId { get; set; }
/// <summary>
/// 组合项目ID

2
src/Shentun.Peis.Application.Contracts/AsbitemGuides/CreateAsbitemGuideManyDto.cs

@ -27,7 +27,7 @@ namespace Shentun.Peis.AsbitemGuides
/// <summary>
/// 单位科室ID
/// </summary>
public Guid OrganizationUnitId { get; set; }
public Guid MedicalCenterId { get; set; }
/// <summary>
/// 适用性别ID

4
src/Shentun.Peis.Application/AsbitemGuides/AsbitemGuideAppService.cs

@ -52,7 +52,7 @@ namespace Shentun.Peis.AsbitemGuides
List<AsbitemGuide> asbitemGuides = new List<AsbitemGuide>();
foreach (var item in input.Deatils)
{
if (asbitemGuides.Where(m => m.ForSexId == item.ForSexId && m.OrganizationUnitId == item.OrganizationUnitId).Count() > 0)
if (asbitemGuides.Where(m => m.ForSexId == item.ForSexId && m.MedicalCenterId == item.MedicalCenterId).Count() > 0)
throw new UserFriendlyException("同一个体检中心下,不能存在相同适应性别的设置");
var entity = new AsbitemGuide
@ -60,7 +60,7 @@ namespace Shentun.Peis.AsbitemGuides
AsbitemId = input.AsbitemId,
ForSexId = item.ForSexId,
Guide = item.Guide,
OrganizationUnitId = item.OrganizationUnitId
MedicalCenterId = item.MedicalCenterId
};
asbitemGuides.Add(_manager.CreateAsync(entity));

8
src/Shentun.Peis.Domain/AsbitemGuides/AsbitemGuide.cs

@ -13,11 +13,11 @@ namespace Shentun.Peis.Models
public class AsbitemGuide : AuditedEntity, IHasConcurrencyStamp
{
/// <summary>
/// 单位科室ID
/// 体检中心ID
/// </summary>
[Key]
[Column("organization_unit_id")]
public Guid OrganizationUnitId { get; set; }
[Column("medical_center_id")]
public Guid MedicalCenterId { get; set; }
/// <summary>
/// 组合项目ID
/// </summary>
@ -43,7 +43,7 @@ namespace Shentun.Peis.Models
public override object[] GetKeys()
{
return new object[] { OrganizationUnitId, AsbitemId, ForSexId };
return new object[] { MedicalCenterId, AsbitemId, ForSexId };
}
//[Column("last_modifier_id")]

4
src/Shentun.Peis.Domain/AsbitemGuides/AsbitemGuideManager.cs

@ -31,7 +31,7 @@ namespace Shentun.Peis.AsbitemGuides
public AsbitemGuide CreateAsync(AsbitemGuide entity)
{
DataHelper.CheckGuidIsDefaultValue(entity.AsbitemId, "组合项目编号");
DataHelper.CheckGuidIsDefaultValue(entity.OrganizationUnitId, "体检中心");
DataHelper.CheckGuidIsDefaultValue(entity.MedicalCenterId, "体检中心");
if (entity.ForSexId != ForSexFlag.All
&& entity.ForSexId != ForSexFlag.Male
&& entity.ForSexId != ForSexFlag.Female
@ -72,7 +72,7 @@ namespace Shentun.Peis.AsbitemGuides
public string GetAsbitemGuideConvertSexId(Guid OrOrganizationUnitId, Guid AsbitemId, char SexId)
{
//以体检中心跟组合项目去查
var entlist = _asbitemGuideRepository.GetListAsync(m => m.OrganizationUnitId == OrOrganizationUnitId && m.AsbitemId == AsbitemId).Result;
var entlist = _asbitemGuideRepository.GetListAsync(m => m.MedicalCenterId == OrOrganizationUnitId && m.AsbitemId == AsbitemId).Result;
if (SexFlag.UnKnown == SexId)
{
//判断是否为未知、未知去找适用性别为全部的

4
src/Shentun.Peis.EntityFrameworkCore/DbMapping/AsbitemGuides/AsbitemGuideDbMapping.cs

@ -14,11 +14,11 @@ namespace Shentun.Peis.DbMapping
{
public void Configure(EntityTypeBuilder<AsbitemGuide> entity)
{
entity.HasKey(e => new { e.OrganizationUnitId, e.AsbitemId, e.ForSexId })
entity.HasKey(e => new { e.MedicalCenterId, e.AsbitemId, e.ForSexId })
.HasName("pk_department_asbitem_guide");
entity.HasComment("体检中心组和项目指引内容");
entity.Property(t => t.OrganizationUnitId).HasComment("单位科室ID").IsRequired().IsFixedLength();
entity.Property(t => t.MedicalCenterId).HasComment("单位科室ID").IsRequired().IsFixedLength();
entity.Property(t => t.AsbitemId).HasComment("组合项目ID").IsRequired().IsFixedLength();
entity.Property(t => t.ForSexId).HasComment("适用性别ID").IsRequired().HasDefaultValueSql("'A'");
entity.Property(t => t.Guide).HasComment("指引单内容");

Loading…
Cancel
Save