16 changed files with 490 additions and 63 deletions
-
10src/Shentun.ColumnReferencePlugIns/ColumnReferencePlugIns.cs
-
59src/Shentun.ColumnReferencePlugIns/ColumnReferencePlugInsBase.cs
-
14src/Shentun.ColumnReferencePlugIns/ColumnReferencePlugInsDbBase.cs
-
26src/Shentun.Peis.Application.Contracts/LisRequests/LisRequestDto.cs
-
104src/Shentun.Peis.Application/LisRequests/LisRequestAppService.cs
-
4src/Shentun.Peis.Domain/Asbitems/Asbitem.cs
-
67src/Shentun.Peis.Domain/ChargeRequestAsbitems/ChargeRequestAsbitem.cs
-
75src/Shentun.Peis.Domain/ChargeRequests/ChargeRequest.cs
-
45src/Shentun.Peis.Domain/ChargeRequests/ChargeRequestManager.cs
-
43src/Shentun.Peis.EntityFrameworkCore/DbMapping/ChargeRequestAsbitems/ChargeRequestAsbitemDbMapping.cs
-
33src/Shentun.Peis.EntityFrameworkCore/DbMapping/ChargeRequests/ChargeRequestDbMapping.cs
-
5src/Shentun.Peis.EntityFrameworkCore/EntityFrameworkCore/PeisDbContext.cs
-
54test/Shentun.Peis.Application.Tests/LisRequestAppServiceTest.cs
-
4test/Shentun.Peis.ColumnReference.Tests/ColumnReferencePlugInsAsbitemBaseTest.cs
-
6test/Shentun.Peis.ColumnReference.Tests/appsettings.json
-
4test/Shentun.Peis.EntityFrameworkCore.Tests/EntityFrameworkCore/PeisEntityFrameworkCoreTestModule.cs
@ -0,0 +1,67 @@ |
|||||
|
using System; |
||||
|
using System.Collections.Generic; |
||||
|
using System.Linq; |
||||
|
using System.Text; |
||||
|
using System.Threading.Tasks; |
||||
|
using Volo.Abp.Domain.Entities.Auditing; |
||||
|
using Volo.Abp.Domain.Entities; |
||||
|
using Microsoft.EntityFrameworkCore; |
||||
|
using Shentun.Peis.Models; |
||||
|
using System.ComponentModel.DataAnnotations.Schema; |
||||
|
|
||||
|
namespace Shentun.Peis.Models |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// 收费申请组合项目
|
||||
|
/// </summary>
|
||||
|
public class ChargeRequestAsbitem : AuditedEntity<Guid>, IHasConcurrencyStamp |
||||
|
{ |
||||
|
public ChargeRequestAsbitem() |
||||
|
{ |
||||
|
|
||||
|
} |
||||
|
|
||||
|
public ChargeRequestAsbitem(Guid id):base(id) |
||||
|
{ |
||||
|
|
||||
|
} |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 收费申请单ID
|
||||
|
/// </summary>
|
||||
|
[Column("charge_request_id")] |
||||
|
public Guid ChargeRequestId { get; set; } |
||||
|
/// <summary>
|
||||
|
/// 组合项目
|
||||
|
/// </summary>
|
||||
|
[Column("asbitem_id")] |
||||
|
public Guid AsbitemId { get; set; } |
||||
|
/// <summary>
|
||||
|
/// 价格
|
||||
|
/// </summary>
|
||||
|
[Column("charge_price")] |
||||
|
[Precision(10, 2)] |
||||
|
public decimal ChargePrice { get; set; } |
||||
|
[Column("amount")] |
||||
|
public short Amount { get; set; } |
||||
|
|
||||
|
[Column("register_asbitem_id")] |
||||
|
public Guid RegisterAsbitemId { get; set; } |
||||
|
|
||||
|
[Column("is_charge")] |
||||
|
public char IsCharge { get; set; } |
||||
|
|
||||
|
[Column("concurrency_stamp")] |
||||
|
public string ConcurrencyStamp { get; set; } |
||||
|
|
||||
|
[ForeignKey(nameof(AsbitemId))] |
||||
|
[InverseProperty("ChargeRequestAsbitem")] |
||||
|
public virtual Asbitem Asbitem { get; set; } = null!; |
||||
|
|
||||
|
[ForeignKey(nameof(ChargeRequestId))] |
||||
|
[InverseProperty("ChargeRequestAsbitem")] |
||||
|
public virtual ChargeRequest ChargeRequest { get; set; } = null!; |
||||
|
|
||||
|
|
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,75 @@ |
|||||
|
using System; |
||||
|
using System.Collections.Generic; |
||||
|
using System.Linq; |
||||
|
using System.Text; |
||||
|
using System.Threading.Tasks; |
||||
|
using Volo.Abp.Domain.Entities.Auditing; |
||||
|
using Volo.Abp.Domain.Entities; |
||||
|
using Shentun.Peis.Models; |
||||
|
using System.ComponentModel.DataAnnotations.Schema; |
||||
|
using System.ComponentModel.DataAnnotations; |
||||
|
|
||||
|
namespace Shentun.Peis.Models |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// 收费申请主档
|
||||
|
/// </summary>
|
||||
|
public class ChargeRequest : AuditedEntity<Guid>, IHasConcurrencyStamp |
||||
|
{ |
||||
|
public ChargeRequest() |
||||
|
{ |
||||
|
|
||||
|
} |
||||
|
|
||||
|
public ChargeRequest(Guid id):base(id) |
||||
|
{ |
||||
|
|
||||
|
} |
||||
|
/// <summary>
|
||||
|
/// 登记流水号
|
||||
|
/// </summary>
|
||||
|
[Column("patient_register_id")] |
||||
|
public Guid PatientRegisterId { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 病人号
|
||||
|
/// </summary>
|
||||
|
[Column("patient_id")] |
||||
|
public Guid PatientId { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// his 病人号
|
||||
|
/// </summary>
|
||||
|
[Column("his_patient_id")] |
||||
|
public string HisPatientId { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// HIS收费单号
|
||||
|
/// </summary>
|
||||
|
[Column("his_charge_no")] |
||||
|
public string HisChargeNo { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 0、申请 1-收费,2-退费
|
||||
|
/// </summary>
|
||||
|
[Column("charge_reguest_flag")] |
||||
|
[MaxLength(1)] |
||||
|
public char ChargeRequestFlag { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
|
||||
|
[Column("concurrency_stamp")] |
||||
|
public string ConcurrencyStamp { get; set; } |
||||
|
|
||||
|
//[ForeignKey(nameof(PatientRegisterId))]
|
||||
|
//[InverseProperty("Charges")]
|
||||
|
//public virtual PatientRegister PatientRegister { get; set; } = null!;
|
||||
|
[InverseProperty(nameof(ChargeRequestAsbitem.ChargeRequest))] |
||||
|
public virtual ICollection<ChargeRequestAsbitem> ChargeRequestAsbitems { get; set; } |
||||
|
//[InverseProperty(nameof(ChargeBack.Charge))]
|
||||
|
//public virtual ICollection<ChargeBack> ChargeBacks { get; set; }
|
||||
|
//[InverseProperty(nameof(ChargePay.Charge))]
|
||||
|
//public virtual ICollection<ChargePay> ChargePays { get; set; }
|
||||
|
|
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,45 @@ |
|||||
|
using Shentun.Peis.Models; |
||||
|
using System; |
||||
|
using System.Collections.Generic; |
||||
|
using System.Linq; |
||||
|
using System.Text; |
||||
|
using System.Threading.Tasks; |
||||
|
using Volo.Abp; |
||||
|
using Volo.Abp.Domain.Repositories; |
||||
|
using Volo.Abp.Domain.Services; |
||||
|
|
||||
|
namespace Shentun.Peis.ChargeRequests |
||||
|
{ |
||||
|
public class ChargeRequestManager : DomainService |
||||
|
{ |
||||
|
private readonly IRepository<ChargeRequest, Guid> _repository; |
||||
|
public ChargeRequestManager(IRepository<ChargeRequest, Guid> repository) |
||||
|
{ |
||||
|
_repository = repository; |
||||
|
|
||||
|
} |
||||
|
/// <summary>
|
||||
|
/// 创建
|
||||
|
/// </summary>
|
||||
|
/// <param name="entity"></param>
|
||||
|
/// <returns></returns>
|
||||
|
public async Task<ChargeRequest> CreateAsync( |
||||
|
ChargeRequest entity |
||||
|
) |
||||
|
{ |
||||
|
|
||||
|
return new ChargeRequest( |
||||
|
GuidGenerator.Create() |
||||
|
) |
||||
|
{ |
||||
|
PatientRegisterId = entity.PatientRegisterId, |
||||
|
PatientId = entity.PatientId, |
||||
|
HisPatientId = entity.HisPatientId, |
||||
|
HisChargeNo = entity.HisChargeNo, |
||||
|
ChargeRequestFlag = entity.ChargeRequestFlag, |
||||
|
|
||||
|
}; |
||||
|
} |
||||
|
|
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,43 @@ |
|||||
|
using Microsoft.EntityFrameworkCore; |
||||
|
using Microsoft.EntityFrameworkCore.Metadata.Builders; |
||||
|
using Shentun.Peis.EntityFrameworkCore; |
||||
|
using Shentun.Peis.Models; |
||||
|
using System; |
||||
|
using System.Collections.Generic; |
||||
|
using System.Linq; |
||||
|
using System.Text; |
||||
|
using System.Threading.Tasks; |
||||
|
|
||||
|
namespace Shentun.Peis.DbMapping.ChargeRequestAsbitems |
||||
|
{ |
||||
|
public class ChargeRequestAsbitemDbMapping : IEntityTypeConfiguration<ChargeRequestAsbitem> |
||||
|
{ |
||||
|
public void Configure(EntityTypeBuilder<ChargeRequestAsbitem> entity) |
||||
|
{ |
||||
|
entity.HasComment("收费申请包含组合项目"); |
||||
|
|
||||
|
entity.Property(e => e.Id).ValueGeneratedNever(); |
||||
|
|
||||
|
entity.Property(e => e.AsbitemId) |
||||
|
.IsFixedLength() |
||||
|
.HasComment("组合项目").IsRequired(); |
||||
|
|
||||
|
entity.Property(e => e.ChargeRequestId).HasComment("收费申请单号"); |
||||
|
|
||||
|
entity.Property(e => e.ChargePrice).HasComment("价格").IsRequired(); |
||||
|
|
||||
|
entity.HasOne(d => d.Asbitem) |
||||
|
.WithMany(p => p.ChargeRequestAsbitems) |
||||
|
.HasForeignKey(d => d.AsbitemId) |
||||
|
.OnDelete(DeleteBehavior.ClientSetNull) |
||||
|
.HasConstraintName("fk_charge_request_asbitem_asbitem"); |
||||
|
|
||||
|
entity.HasOne(d => d.ChargeRequest) |
||||
|
.WithMany(p => p.ChargeRequestAsbitems) |
||||
|
.HasForeignKey(d => d.ChargeRequestId) |
||||
|
.HasConstraintName("fk_charge_request_asbitem_charge"); |
||||
|
|
||||
|
entity.ConfigureByConvention(); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,33 @@ |
|||||
|
using Microsoft.EntityFrameworkCore; |
||||
|
using Microsoft.EntityFrameworkCore.Metadata.Builders; |
||||
|
using Shentun.Peis.EntityFrameworkCore; |
||||
|
using Shentun.Peis.Models; |
||||
|
using System; |
||||
|
using System.Collections.Generic; |
||||
|
using System.Linq; |
||||
|
using System.Text; |
||||
|
using System.Threading.Tasks; |
||||
|
|
||||
|
namespace Shentun.Peis.DbMapping.ChargeRequests |
||||
|
{ |
||||
|
public class ChargeRequestDbMapping : IEntityTypeConfiguration<ChargeRequest> |
||||
|
{ |
||||
|
public void Configure(EntityTypeBuilder<ChargeRequest> entity) |
||||
|
{ |
||||
|
entity.HasComment("收费申请单主档"); |
||||
|
|
||||
|
entity.Property(e => e.Id) |
||||
|
.ValueGeneratedNever() |
||||
|
.HasComment("收据申请单号").IsRequired(); |
||||
|
|
||||
|
entity.Property(e => e.ChargeRequestFlag).HasDefaultValueSql("0").IsRequired(); |
||||
|
|
||||
|
entity.Property(e => e.PatientRegisterId).HasComment("登记流水号").IsRequired(); |
||||
|
entity.Property(e => e.PatientId).HasComment("档案号").IsRequired(); |
||||
|
|
||||
|
|
||||
|
|
||||
|
entity.ConfigureByConvention(); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,54 @@ |
|||||
|
using Shentun.Peis.CustomerOrgs; |
||||
|
using Shentun.Peis.LisRequests; |
||||
|
using Shentun.Peis.Models; |
||||
|
using Shentun.Peis.PatientRegisters; |
||||
|
using System; |
||||
|
using System.Collections.Generic; |
||||
|
using System.Linq; |
||||
|
using System.Text; |
||||
|
using System.Threading.Tasks; |
||||
|
using Volo.Abp.Application.Dtos; |
||||
|
using Volo.Abp.Domain.Repositories; |
||||
|
using Volo.Abp.Uow; |
||||
|
using Xunit; |
||||
|
using Xunit.Abstractions; |
||||
|
|
||||
|
namespace Shentun.Peis |
||||
|
{ |
||||
|
public class LisRequestAppServiceTest:PeisApplicationTestBase |
||||
|
{ |
||||
|
private readonly IRepository<LisRequest, Guid> _repository; |
||||
|
private readonly LisRequestAppService _appService; |
||||
|
private readonly ITestOutputHelper _output; |
||||
|
private readonly IUnitOfWorkManager _unitOfWorkManager; |
||||
|
public LisRequestAppServiceTest(ITestOutputHelper testOutputHelper) |
||||
|
{ |
||||
|
_output = testOutputHelper; |
||||
|
_unitOfWorkManager = GetRequiredService<IUnitOfWorkManager>(); |
||||
|
_repository = GetRequiredService<IRepository<LisRequest, Guid>>(); |
||||
|
_appService = GetRequiredService<LisRequestAppService>(); |
||||
|
} |
||||
|
|
||||
|
[Fact] |
||||
|
public async Task GetListInFilterAsync() |
||||
|
{ |
||||
|
using (var unitOfWork = _unitOfWorkManager.Begin(isTransactional: true)) |
||||
|
{ |
||||
|
|
||||
|
|
||||
|
|
||||
|
PagedResultDto<LisRequestDto> pagedResultDto = await _appService.GetListInFilterAsync(new GetLisRequestListDto() |
||||
|
{ |
||||
|
StartDate = DateTime.Now.Date.AddDays(-30), |
||||
|
MaxResultCount = 1000 |
||||
|
}); |
||||
|
foreach (var item in pagedResultDto.Items) |
||||
|
{ |
||||
|
_output.WriteLine(item.PatientName + "," + item.AsbitemName); |
||||
|
} |
||||
|
|
||||
|
await unitOfWork.CompleteAsync(); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
} |
||||
Write
Preview
Loading…
Cancel
Save
Reference in new issue