wxd 4 months ago
parent
commit
f8a41b3d28
  1. 33
      src/Shentun.Peis.Application/PatientRegisters/PatientRegisterAppService.cs
  2. 15
      src/Shentun.Peis.Application/PrintReports/PrintReportAppService.cs

33
src/Shentun.Peis.Application/PatientRegisters/PatientRegisterAppService.cs

@ -46,6 +46,7 @@ using System.Security;
using System.Security.Cryptography;
using System.Text;
using System.Threading.Tasks;
using System.Transactions;
using Volo.Abp;
using Volo.Abp.Application.Dtos;
using Volo.Abp.Application.Services;
@ -882,9 +883,17 @@ namespace Shentun.Peis.PatientRegisters
patientRegister,
patient,
patientRegisterExterHaveEmpty,
registerCheckAsbitem,
chargePayHaveEmpty,
payModePayHaveEmpty
registerCheckAsbitem = new
{
registerCheckAsbitem.StandardPrice,
registerCheckAsbitem.Amount,
registerCheckAsbitem.ChargePrice,
registerCheckAsbitem.IsCharge,
},
payModePayHaveEmpty = new
{
payModePayHaveEmpty.DisplayName
}
};
@ -964,11 +973,17 @@ namespace Shentun.Peis.PatientRegisters
#endregion
//var ggg = entlist.ToList();
//var fff = entlist.ToQueryString();
var queryGroup = entlist.ToList().GroupBy(g => g.patientRegister);
//gpt var queryGroup = entlist.GroupBy(g => g.patientRegister);
int totalCount = queryGroup.Count();
//gpt 按patientRegister分组,然后实现分页
var pagedGroups = queryGroup
.OrderByDescending(g => g.Key.CompleteFlag)
.ThenBy(g => g.Key.Id)
@ -976,6 +991,8 @@ namespace Shentun.Peis.PatientRegisters
.Take(input.MaxResultCount)
.ToList();
List<GetPatientRegisterWithChargeDto> entListDto = new List<GetPatientRegisterWithChargeDto>();
foreach (var group in pagedGroups)
@ -1066,9 +1083,10 @@ namespace Shentun.Peis.PatientRegisters
};
entDto.StandardAmount = group.GroupBy(g => g.registerCheckAsbitem).Sum(s => s.Key.StandardPrice * s.Key.Amount);
entDto.ReceivableAmount = group.GroupBy(g => g.registerCheckAsbitem).Sum(s => s.Key.ChargePrice * s.Key.Amount);
if (group.Count(m => m.chargePayHaveEmpty != null) > 0)
entDto.ChargeAmount = group.Where(m => m.registerCheckAsbitem.IsCharge == 'Y').GroupBy(g => g.registerCheckAsbitem).Sum(s => s.Key.ChargePrice * s.Key.Amount);
if (group.Count(m => m.payModePayHaveEmpty != null) > 0)
{
entDto.ChargeAmount = group.Where(m => m.chargePayHaveEmpty != null).GroupBy(g => g.chargePayHaveEmpty).Sum(s => s.Key.ChargeMoney);
entDto.ChargePayMode = string.Join(",", group.Where(m => m.payModePayHaveEmpty != null).GroupBy(g => g.payModePayHaveEmpty).Select(s => s.Key.DisplayName));
}
else
@ -1088,6 +1106,9 @@ namespace Shentun.Peis.PatientRegisters
}
/// <summary>
/// 获取档案登记信息 根据档案号或者条码号(档案号条件返回最新的一条)
/// </summary>

15
src/Shentun.Peis.Application/PrintReports/PrintReportAppService.cs

@ -1583,14 +1583,17 @@ namespace Shentun.Peis.PrintReports
string cloudFilmCodeUrl = GenerateCloudFilmQRCode(patientRegister);
Guid? summaryDoctorId = patientRegister.SummaryDoctorId;
Guid? auditDoctorId = patientRegister.AuditDoctorId;
#region 默认总检医生、审核医生
if (!string.IsNullOrWhiteSpace(reportDefaultSummaryDoctorId) && Guid.TryParse(reportDefaultSummaryDoctorId, out var reportDefaultSummaryDoctorIdGuid))
{
patientRegister.SummaryDoctorId = reportDefaultSummaryDoctorIdGuid;
summaryDoctorId = reportDefaultSummaryDoctorIdGuid;
}
if (!string.IsNullOrWhiteSpace(reportDefaultAuditDoctorId) && Guid.TryParse(reportDefaultAuditDoctorId, out var reportDefaultAuditDoctorIdGuid))
{
patientRegister.AuditDoctorId = reportDefaultAuditDoctorIdGuid;
auditDoctorId = reportDefaultAuditDoctorIdGuid;
}
#endregion
@ -1617,11 +1620,11 @@ namespace Shentun.Peis.PrintReports
MedicalTypeName = _cacheService.GetMedicalTypeNameAsync(patientRegister.MedicalTypeId).GetAwaiter().GetResult(),
PersonnelTypeName = _cacheService.GetPersonnelTypeNameAsync(patientRegister.PersonnelTypeId).GetAwaiter().GetResult(),
MedicalStartDate = patientRegister.MedicalStartDate,
SummaryDoctorName = _cacheService.GetSurnameAsync(patientRegister.SummaryDoctorId).GetAwaiter().GetResult(),
SummaryDoctorSignUrl = _cacheService.GetUserSignAsync(patientRegister.SummaryDoctorId).GetAwaiter().GetResult(),
SummaryDoctorName = _cacheService.GetSurnameAsync(summaryDoctorId).GetAwaiter().GetResult(),
SummaryDoctorSignUrl = _cacheService.GetUserSignAsync(summaryDoctorId).GetAwaiter().GetResult(),
SummaryDate = patientRegister.SummaryDate,
AuditDoctorName = _cacheService.GetSurnameAsync(patientRegister.AuditDoctorId).GetAwaiter().GetResult(),
AuditDoctorSignUrl = _cacheService.GetUserSignAsync(patientRegister.AuditDoctorId).GetAwaiter().GetResult(),
AuditDoctorName = _cacheService.GetSurnameAsync(auditDoctorId).GetAwaiter().GetResult(),
AuditDoctorSignUrl = _cacheService.GetUserSignAsync(auditDoctorId).GetAwaiter().GetResult(),
AuditDate = patientRegister.AuditDate,
//体检中心信息
MedicalCenterTelphone = medicalCenterTelphone,

Loading…
Cancel
Save