Browse Source

收费

master
wxd 4 weeks ago
parent
commit
1002a93235
  1. 4
      src/Shentun.Peis.Application.Contracts/ChargeBackPays/ChargeBackPayDto.cs
  2. 5
      src/Shentun.Peis.Application.Contracts/PatientRegisters/PatientRegisterNoInputDto.cs
  3. 13
      src/Shentun.Peis.Application.Contracts/PeisReports/GetPatientRegisterReportDto.cs
  4. 2
      src/Shentun.Peis.Application.Contracts/PeisReports/GetPatientRegisterReportRequestDto.cs
  5. 31
      src/Shentun.Peis.Application/ChargeBackPays/ChargeBackPayAppService.cs
  6. 16
      src/Shentun.Peis.Application/PatientRegisters/PatientRegisterAppService.cs
  7. 18
      src/Shentun.Peis.Application/PeisReports/PeisReportAppService.cs

4
src/Shentun.Peis.Application.Contracts/ChargeBackPays/ChargeBackPayDto.cs

@ -32,5 +32,9 @@ namespace Shentun.Peis.ChargeBackPays
/// 会员卡ID
/// </summary>
public Guid? CardRegisterId { get; set; }
/// <summary>
/// 会员卡号
/// </summary>
public string CardNo { get; set; }
}
}

5
src/Shentun.Peis.Application.Contracts/PatientRegisters/PatientRegisterNoInputDto.cs

@ -13,5 +13,10 @@ namespace Shentun.Peis.PatientRegisters
/// 档案号
/// </summary>
public string PatientNo { get; set; }
/// <summary>
/// 身份证
/// </summary>
public string IdNo { get; set; }
}
}

13
src/Shentun.Peis.Application.Contracts/PeisReports/GetPatientRegisterReportDto.cs

@ -164,6 +164,17 @@ namespace Shentun.Peis.PeisReports
public string SummaryDate { get; set; }
/// <summary>
/// 审核医生
/// </summary>
public string AuditDoctorName { get; set; }
/// <summary>
/// 审核日期
/// </summary>
public string AuditDate { get; set; }
}
}

2
src/Shentun.Peis.Application.Contracts/PeisReports/GetPatientRegisterReportRequestDto.cs

@ -98,7 +98,7 @@ namespace Shentun.Peis.PeisReports
public List<Guid> CustomerOrgGroupId { get; set; } = new List<Guid>();
/// <summary>
/// 日期类型(1、登记日期 2、体检日期 3、总检日期 4、项目检查日期)
/// 日期类型(1、登记日期 2、体检日期 3、总检日期 4、项目检查日期 5.人员审核日期
/// </summary>
[Required(ErrorMessage = "日期类型不能为空")]
public char DateType { get; set; }

31
src/Shentun.Peis.Application/ChargeBackPays/ChargeBackPayAppService.cs

@ -2,6 +2,7 @@
using Microsoft.AspNetCore.Mvc;
using Shentun.Peis.ChargeAsbitems;
using Shentun.Peis.ChargePays;
using Shentun.Peis.IncludeDetails;
using Shentun.Peis.Models;
using System;
using System.Collections.Generic;
@ -24,14 +25,16 @@ namespace Shentun.Peis.ChargeBackPays
{
private readonly IRepository<ChargeBackPay> _chargeBackPayRepository;
private readonly IRepository<CardBill, Guid> _cardBillRepository;
private readonly IRepository<CardRegister, Guid> _cardRegisterRepository;
public ChargeBackPayAppService(
IRepository<ChargeBackPay> chargeBackPayRepository,
IRepository<CardBill, Guid> cardBillRepository
)
IRepository<CardBill, Guid> cardBillRepository,
IRepository<CardRegister, Guid> cardRegisterRepository)
{
this._chargeBackPayRepository = chargeBackPayRepository;
this._cardBillRepository = cardBillRepository;
_cardRegisterRepository = cardRegisterRepository;
}
/// <summary>
@ -44,17 +47,20 @@ namespace Shentun.Peis.ChargeBackPays
{
Guid? guidNull = null;
var chargeBackPayList = from a in (await _chargeBackPayRepository.GetQueryableAsync())
join b in (await _cardBillRepository.GetQueryableAsync()) on a.CardBillId equals b.Id into bb
from ab in bb.DefaultIfEmpty()
where a.ChargeBackId == ChargeBackId
var chargeBackPayList = from chargeBackPay in await _chargeBackPayRepository.GetQueryableAsync()
join cardBill in await _cardBillRepository.GetQueryableAsync() on chargeBackPay.CardBillId equals cardBill.Id into cardBillTemp
from cardBillEmpty in cardBillTemp.DefaultIfEmpty()
join cardRegister in await _cardRegisterRepository.GetQueryableAsync() on cardBillEmpty.CardRegisterId equals cardRegister.Id into cardRegisterTemp
from cardRegisterEmpty in cardRegisterTemp.DefaultIfEmpty()
where chargeBackPay.ChargeBackId == ChargeBackId
select new
{
ChargeBackId = a.ChargeBackId,
CardBillId = a.CardBillId,
BackMoeny = a.BackMoeny,
PayModeId = a.PayModeId,
CardRegisterId = ab != null ? ab.CardRegisterId : guidNull,
ChargeBackId = chargeBackPay.ChargeBackId,
CardBillId = chargeBackPay.CardBillId,
BackMoeny = chargeBackPay.BackMoeny,
PayModeId = chargeBackPay.PayModeId,
CardRegisterId = cardBillEmpty != null ? cardBillEmpty.CardRegisterId : guidNull,
CardNo = cardRegisterEmpty.CardNo
};
var entlistdto = chargeBackPayList.Select(s => new ChargeBackPayDto
@ -63,7 +69,8 @@ namespace Shentun.Peis.ChargeBackPays
ChargeBackId = s.ChargeBackId,
CardBillId = s.CardBillId,
PayModeId = s.PayModeId,
CardRegisterId = s.CardRegisterId
CardRegisterId = s.CardRegisterId,
CardNo = s.CardNo
}).ToList();
return entlistdto;

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

@ -984,10 +984,24 @@ namespace Shentun.Peis.PatientRegisters
}
ent = patientRegisterList.First();
}
else if (!string.IsNullOrWhiteSpace(input.IdNo))
{
patientRegisterList = query.Where(m => m.Patient.IdNo == input.IdNo).OrderByDescending(o => o.MedicalTimes).ToList();
if (patientRegisterList.Count == 0)
{
throw new UserFriendlyException("未找到人员信息");
}
patientRegisterList = patientRegisterList.Where(m => m.CompleteFlag != PatientRegisterCompleteFlag.PreRegistration).ToList();
if (patientRegisterList.Count == 0)
{
throw new UserFriendlyException("该人未正式登记");
}
ent = patientRegisterList.First();
}
else
{
throw new UserFriendlyException("人员登记号和档案号至少有一个");
throw new UserFriendlyException("检索条件不能为空");
}
if (ent.CompleteFlag == PatientRegisterCompleteFlag.PreRegistration)
{

18
src/Shentun.Peis.Application/PeisReports/PeisReportAppService.cs

@ -117,7 +117,9 @@ namespace Shentun.Peis.PeisReports
a.MaritalStatusId,
a.IsUploadAppoint,
a.SummaryDoctorId,
a.MedicalConclusionId
a.MedicalConclusionId,
a.AuditDate,
a.AuditDoctorId
},
//RegisterCheckCompleteFlag = registerCheck.CompleteFlag,
//IsCheck = asbitem.IsCheck,
@ -186,6 +188,11 @@ namespace Shentun.Peis.PeisReports
sumquery = sumquery.Where(m => m.a.SummaryDate != null && m.a.SummaryDate.Value >= Convert.ToDateTime(item.StartDate) &&
m.a.SummaryDate.Value < Convert.ToDateTime(item.EndDate).AddDays(1));
}
else if (item.DateType == '5')
{
sumquery = sumquery.Where(m => m.a.AuditDate != null && m.a.AuditDate.Value >= Convert.ToDateTime(item.StartDate) &&
m.a.AuditDate.Value < Convert.ToDateTime(item.EndDate).AddDays(1));
}
}
if (input.CustomerOrgs.Count > 1)
@ -226,6 +233,11 @@ namespace Shentun.Peis.PeisReports
newquery = newquery.Where(m => m.a.SummaryDate != null && m.a.SummaryDate.Value >= Convert.ToDateTime(item2.StartDate) &&
m.a.SummaryDate.Value < Convert.ToDateTime(item2.EndDate).AddDays(1));
}
else if (item2.DateType == '5')
{
sumquery = sumquery.Where(m => m.a.AuditDate != null && m.a.AuditDate.Value >= Convert.ToDateTime(item2.StartDate) &&
m.a.AuditDate.Value < Convert.ToDateTime(item2.EndDate).AddDays(1));
}
}
sumquery = sumquery.Union(newquery);
}
@ -365,7 +377,9 @@ namespace Shentun.Peis.PeisReports
IsPatientOccupationalDisease = _patientOccupationalDiseaseManager.GetPatientRegisterIsOccupationalDisease(s.a.Id).GetAwaiter().GetResult(),
MedicalStartDate = DataHelper.ConversionDateShortToString(s.a.MedicalStartDate),
SummaryDate = DataHelper.ConversionDateShortToString(s.a.SummaryDate),
SummaryDoctorName = _cacheService.GetSurnameAsync(s.a.SummaryDoctorId).GetAwaiter().GetResult()
SummaryDoctorName = _cacheService.GetSurnameAsync(s.a.SummaryDoctorId).GetAwaiter().GetResult(),
AuditDate = DataHelper.ConversionDateShortToString(s.a.AuditDate),
AuditDoctorName = _cacheService.GetSurnameAsync(s.a.AuditDoctorId).GetAwaiter().GetResult()
});
}

Loading…
Cancel
Save