Browse Source

整理

bjmzak
wxd 2 years ago
parent
commit
c4f2bc0b12
  1. 2
      src/Shentun.Peis.Application.Contracts/ChargeAsbitems/ChargeAsbitemDto.cs
  2. 2
      src/Shentun.Peis.Application.Contracts/PatientRegisters/CreatePatientRegisterExcelRequestDto.cs
  3. 2
      src/Shentun.Peis.Application.Contracts/PatientRegisters/CreatePatientRegisterHistoryRequestDto.cs
  4. 2
      src/Shentun.Peis.Application.Contracts/PatientRegisters/UpdatePatientRegisterCustomerOrgGroupDto.cs
  5. 7
      src/Shentun.Peis.Application/ChargeAsbitems/ChargeAsbitemAppService.cs
  6. 12
      src/Shentun.Peis.Application/ChargeReports/ChargeReportAppService.cs
  7. 30
      src/Shentun.Peis.Application/CustomerReports/CustomerReportAppService.cs
  8. 54
      src/Shentun.Peis.Application/InternalReports/InternalReportAppService.cs
  9. 30
      src/Shentun.Peis.Application/PatientRegisters/PatientRegisterAppService.cs
  10. 18
      src/Shentun.Peis.Domain/RegisterAsbitems/RegisterAsbitemManager.cs
  11. 3
      src/Shentun.Peis.EntityFrameworkCore/PatientRegisters/PatientRegisterChargeRepository.cs

2
src/Shentun.Peis.Application.Contracts/ChargeAsbitems/ChargeAsbitemDto.cs

@ -49,7 +49,7 @@ namespace Shentun.Peis.ChargeAsbitems
/// <summary>
/// RegisterAsbitem表支付方式
/// </summary>
public string RegisterAsbitemPayTypeFlag { get; set; }
public char RegisterAsbitemPayTypeFlag { get; set; }
/// <summary>
/// RegisterAsbitem表登记人

2
src/Shentun.Peis.Application.Contracts/PatientRegisters/CreatePatientRegisterExcelRequestDto.cs

@ -64,7 +64,7 @@ namespace Shentun.Peis.PatientRegisters
/// <summary>
/// 支付方式,比如是0.个人支付、1.单位支付、2.免费
/// </summary>
public string? PayTypeFlag { get; set; }
public char PayTypeFlag { get; set; } = '1';
/// <summary>
/// 部门名称

2
src/Shentun.Peis.Application.Contracts/PatientRegisters/CreatePatientRegisterHistoryRequestDto.cs

@ -39,7 +39,7 @@ namespace Shentun.Peis.PatientRegisters
/// <summary>
/// 支付方式 必传
/// </summary>
public string PayTypeFlag { get; set; }
public char PayTypeFlag { get; set; }
/// <summary>
/// 体检中心ID

2
src/Shentun.Peis.Application.Contracts/PatientRegisters/UpdatePatientRegisterCustomerOrgGroupDto.cs

@ -21,7 +21,7 @@ namespace Shentun.Peis.PatientRegisters
/// <summary>
/// 支付方式,比如是0.个人支付、1.单位支付、2.免费
/// </summary>
public string? PayTypeFlag { get; set; }
public char PayTypeFlag { get; set; } = '0';
/// <summary>

7
src/Shentun.Peis.Application/ChargeAsbitems/ChargeAsbitemAppService.cs

@ -1,6 +1,7 @@
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
using Shentun.Peis.Enums;
using Shentun.Peis.Models;
using System;
using System.Collections.Generic;
@ -78,7 +79,7 @@ namespace Shentun.Peis.ChargeAsbitems
RegisterAsbitemChargePrice = ad != null ? ad.ChargePrice : 0,
RegisterAsbitemCreationTime = ad != null ? ad.CreationTime : dtnull,
RegisterAsbitemCreatorName = af != null ? af.UserName : "",
RegisterAsbitemPayTypeFlag = ad != null ? ad.PayTypeFlag : "",
RegisterAsbitemPayTypeFlag = ad != null ? ad.PayTypeFlag : PayTypeFlag.PersonPay,
RegisterCheckCompleteFlag = ae != null ? ae.CompleteFlag : charnull,
};
@ -90,7 +91,7 @@ namespace Shentun.Peis.ChargeAsbitems
ChargeId = s.a.ChargeId,
AsbitemId = s.a.AsbitemId,
AsbitemName = s.a.Asbitem.DisplayName,
AsbitemPrice = s.AsbitemPrice.Value,
AsbitemPrice = s.AsbitemPrice,
CreationTime = s.a.CreationTime,
CreatorId = s.a.CreatorId,
CreatorName = s.CreatorName,
@ -99,7 +100,7 @@ namespace Shentun.Peis.ChargeAsbitems
LastModifierId = s.a.LastModifierId,
LastModifierName = s.LastModifierName,
RegisterAsbitemId = s.a.RegisterAsbitemId,
RegisterAsbitemChargePrice = s.RegisterAsbitemChargePrice.Value,
RegisterAsbitemChargePrice = s.RegisterAsbitemChargePrice,
RegisterAsbitemCreationTime = s.RegisterAsbitemCreationTime != null ? s.RegisterAsbitemCreationTime.Value.ToString("dd/MM/yyyy") : "",
RegisterAsbitemCreatorName = s.RegisterAsbitemCreatorName,
RegisterAsbitemPayTypeFlag = s.RegisterAsbitemPayTypeFlag,

12
src/Shentun.Peis.Application/ChargeReports/ChargeReportAppService.cs

@ -490,7 +490,7 @@ namespace Shentun.Peis.ChargeReports
PatientNo = s.PatientNo,
SexName = s.SexName,
StandardPrice = DataHelper.DecimalRetainDecimals(s.f.StandardPrice * s.f.Amount, 2),
Discount = s.f.StandardPrice.Value * s.f.Amount.Value == 0 ? "0%" : Math.Floor((s.b.ChargePrice * s.b.Amount) / (s.f.StandardPrice.Value * s.f.Amount.Value)) + "%"
Discount = s.f.StandardPrice * s.f.Amount == 0 ? "0%" : Math.Floor((s.b.ChargePrice * s.b.Amount) / (s.f.StandardPrice * s.f.Amount)) + "%"
}).ToList();
return patientRegisterGroup;
@ -563,7 +563,7 @@ namespace Shentun.Peis.ChargeReports
PatientNo = s.PatientNo,
SexName = s.SexName,
StandardPrice = DataHelper.DecimalRetainDecimals(s.f.StandardPrice * s.f.Amount, 2),
Discount = s.f.StandardPrice.Value * s.f.Amount.Value==0 ? "0%": Math.Floor((s.b.ChargePrice * s.b.Amount) / (s.f.StandardPrice.Value * s.f.Amount.Value)) + "%"
Discount = s.f.StandardPrice * s.f.Amount ==0 ? "0%": Math.Floor((s.b.ChargePrice * s.b.Amount) / (s.f.StandardPrice * s.f.Amount)) + "%"
}).ToList();
return patientRegisterGroup;
@ -590,7 +590,7 @@ namespace Shentun.Peis.ChargeReports
.Select(s => new
{
PatientRegisterId = s.Key,
AsbitemChargeMoney = DataHelper.DecimalRetainDecimals(s.Sum(ss => ss.ChargePrice.Value * ss.Amount.Value), 2)
AsbitemChargeMoney = DataHelper.DecimalRetainDecimals(s.Sum(ss => ss.ChargePrice * ss.Amount), 2)
}) on a.Id equals d.PatientRegisterId
join e in await _chargeRepository.GetQueryableAsync() on a.Id equals e.PatientRegisterId
join f in await _chargePayRepository.GetQueryableAsync() on e.Id equals f.ChargeId
@ -866,7 +866,7 @@ namespace Shentun.Peis.ChargeReports
AsbitemId = s.Key.AsbitemId,
ItemTypeName = s.FirstOrDefault().ItemTypeName,
AsbitemName = s.FirstOrDefault().AsbitemName,
ChargeMoney = DataHelper.DecimalRetainDecimals(s.Sum(ss => ss.a.Amount.Value * ss.a.ChargePrice.Value), 2),
ChargeMoney = DataHelper.DecimalRetainDecimals(s.Sum(ss => ss.a.Amount * ss.a.ChargePrice), 2),
ReceivedChargeMoney = 0
}).ToList();
@ -1024,7 +1024,7 @@ namespace Shentun.Peis.ChargeReports
{
ItemTypeId = s.Key,
ItemTypeName = s.FirstOrDefault().ItemTypeName,
ChargeMoney = DataHelper.DecimalRetainDecimals(s.Sum(ss => ss.a.Amount.Value * ss.a.ChargePrice.Value), 2),
ChargeMoney = DataHelper.DecimalRetainDecimals(s.Sum(ss => ss.a.Amount * ss.a.ChargePrice), 2),
ReceivedChargeMoney = 0
}).ToList();
@ -1159,7 +1159,7 @@ namespace Shentun.Peis.ChargeReports
{
CustomerOrgName = s.FirstOrDefault().CustomerOrgName,
SummaryCount = s.Count(),
ChargeMoney = DataHelper.DecimalRetainDecimals(s.Sum(ss => ss.b.Amount.Value * ss.b.ChargePrice.Value), 2)
ChargeMoney = DataHelper.DecimalRetainDecimals(s.Sum(ss => ss.b.Amount * ss.b.ChargePrice), 2)
}).ToList();

30
src/Shentun.Peis.Application/CustomerReports/CustomerReportAppService.cs

@ -1654,15 +1654,15 @@ namespace Shentun.Peis.CustomerReports
if (input.IsPersonalPayment == 'N')
{
//未勾选只需要单位支付的
query_addItem = query_addItem.Where(m => m.a.PayTypeFlag == "1");
query_addItem = query_addItem.Where(m => m.a.PayTypeFlag == PayTypeFlag.OrgPay);
}
var addItems = query_addItem.GroupBy(g => g.a.AsbitemId).Select(s => new GetCustomerOrgFeeSettlementInGroupReportReduce_AddItem
{
AsbitemName = s.FirstOrDefault().ab != null ? s.FirstOrDefault().ab.DisplayName : "",
PatientCount = s.Count(),
SumPrice = Math.Round(s.Sum(ss => ss.a.ChargePrice.Value * ss.a.Amount.Value), 2).ToString(),
Price = Math.Round(s.Sum(ss => ss.a.ChargePrice.Value * ss.a.Amount.Value) / s.Sum(ss => ss.a.Amount.Value), 2).ToString()
SumPrice = Math.Round(s.Sum(ss => ss.a.ChargePrice * ss.a.Amount), 2).ToString(),
Price = Math.Round(s.Sum(ss => ss.a.ChargePrice * ss.a.Amount) / s.Sum(ss => ss.a.Amount), 2).ToString()
}).ToList();
var entdto = new GetCustomerOrgFeeSettlementInGroupReportReduceDto
@ -1780,15 +1780,15 @@ namespace Shentun.Peis.CustomerReports
if (input.IsPersonalPayment == 'N')
{
//未勾选只需要单位支付的
query_addItem = query_addItem.Where(m => m.a.PayTypeFlag == "1");
query_addItem = query_addItem.Where(m => m.a.PayTypeFlag == PayTypeFlag.OrgPay);
}
var addItems = query_addItem.GroupBy(g => g.a.AsbitemId).Select(s => new GetCustomerOrgFeeSettlementInGroupReportDetail_AddItem
{
AsbitemName = s.FirstOrDefault().ab != null ? s.FirstOrDefault().ab.DisplayName : "",
PatientCount = s.Count(),
SumPrice = Math.Round(s.Sum(ss => ss.a.ChargePrice.Value * ss.a.Amount.Value), 2).ToString(),
Price = Math.Round(s.Sum(ss => ss.a.ChargePrice.Value * ss.a.Amount.Value) / s.Sum(ss => ss.a.Amount.Value), 2).ToString(),
SumPrice = Math.Round(s.Sum(ss => ss.a.ChargePrice * ss.a.Amount), 2).ToString(),
Price = Math.Round(s.Sum(ss => ss.a.ChargePrice * ss.a.Amount) / s.Sum(ss => ss.a.Amount), 2).ToString(),
Patients = s.Select(sa => new GetCustomerOrgFeeSettlementInGroupReportDetail_Patient
{
Age = sa.ac != null ? sa.ac.Age : null,
@ -1896,7 +1896,7 @@ namespace Shentun.Peis.CustomerReports
if (input.IsPersonalPayment == 'N')
{
sumquery = sumquery.Where(m => m.c.PayTypeFlag == RegisterAsbitemPayTypeFlag.UnitPayment);
sumquery = sumquery.Where(m => m.c.PayTypeFlag == PayTypeFlag.OrgPay);
}
// 组合项目分组
@ -1904,12 +1904,12 @@ namespace Shentun.Peis.CustomerReports
{
AsbitemName = s.FirstOrDefault().d.DisplayName,
StandardPrice = s.FirstOrDefault().c.StandardPrice.ToString(),
PatientCount = s.Sum(v => v.c.Amount).Value,
StandardAmount = Math.Round(s.Sum(v => v.c.StandardPrice * v.c.Amount).Value, 2).ToString(),
ChargeAmount = Math.Round(s.Sum(v => v.c.ChargePrice * v.c.Amount).Value, 2).ToString(),
ChargePrice = Math.Round(s.Sum(v => v.c.ChargePrice * v.c.Amount).Value / s.Sum(v => v.c.Amount).Value, 2).ToString(),
PatientCount = s.Sum(v => v.c.Amount),
StandardAmount = Math.Round(s.Sum(v => v.c.StandardPrice * v.c.Amount), 2).ToString(),
ChargeAmount = Math.Round(s.Sum(v => v.c.ChargePrice * v.c.Amount), 2).ToString(),
ChargePrice = Math.Round(s.Sum(v => v.c.ChargePrice * v.c.Amount) / s.Sum(v => v.c.Amount), 2).ToString(),
ItmeTypeName = s.FirstOrDefault().ae.DisplayName,
Discount = ((int)Math.Ceiling(s.Sum(v => v.c.ChargePrice * v.c.Amount).Value / s.Sum(v => v.c.StandardPrice * v.c.Amount).Value)).ToString()
Discount = ((int)Math.Ceiling(s.Sum(v => v.c.ChargePrice * v.c.Amount) / s.Sum(v => v.c.StandardPrice * v.c.Amount))).ToString()
}).ToList();
//v.a.ChargePrice.Value* v.a.Amount.Value
@ -2010,7 +2010,7 @@ namespace Shentun.Peis.CustomerReports
if (input.IsPersonalPayment == 'N')
{
sumquery = sumquery.Where(m => m.c.PayTypeFlag == RegisterAsbitemPayTypeFlag.UnitPayment);
sumquery = sumquery.Where(m => m.c.PayTypeFlag == PayTypeFlag.OrgPay);
}
@ -2020,8 +2020,8 @@ namespace Shentun.Peis.CustomerReports
{
AsbitemName = s.FirstOrDefault().d.DisplayName,
PatientCount = s.Count(),
ChargeAmount = Math.Round(s.Sum(v => v.c.ChargePrice * v.c.Amount).Value, 2).ToString(),
ChargePrice = Math.Round(s.Sum(v => v.c.ChargePrice * v.c.Amount).Value / s.Sum(v => v.c.Amount).Value, 2).ToString(),
ChargeAmount = Math.Round(s.Sum(v => v.c.ChargePrice * v.c.Amount), 2).ToString(),
ChargePrice = Math.Round(s.Sum(v => v.c.ChargePrice * v.c.Amount) / s.Sum(v => v.c.Amount), 2).ToString(),
ItmeTypeName = s.FirstOrDefault().ae.DisplayName,
Patients = s.Select(sa => new GetCustomerOrgFeeSettlementInGroupReportDetail_Patient
{

54
src/Shentun.Peis.Application/InternalReports/InternalReportAppService.cs

@ -125,10 +125,10 @@ namespace Shentun.Peis.InternalReports
AsbitemName = s.FirstOrDefault().AsbitemName,
CheckCount = s.Count(),
DoctorName = s.FirstOrDefault().DoctorName,
AvgChargePrice = Math.Round(s.Average(v => v.a.ChargePrice.Value), 2),
AvgStandardPrice = Math.Round(s.Average(v => v.a.StandardPrice.Value), 2),
SumChargePrice = Math.Round(s.Sum(v => v.a.ChargePrice.Value * v.a.Amount.Value), 2),
SumStandardPrice = Math.Round(s.Sum(v => v.a.StandardPrice.Value * v.a.Amount.Value), 2)
AvgChargePrice = Math.Round(s.Average(v => v.a.ChargePrice), 2),
AvgStandardPrice = Math.Round(s.Average(v => v.a.StandardPrice), 2),
SumChargePrice = Math.Round(s.Sum(v => v.a.ChargePrice * v.a.Amount), 2),
SumStandardPrice = Math.Round(s.Sum(v => v.a.StandardPrice * v.a.Amount), 2)
}).ToList();
@ -260,10 +260,10 @@ namespace Shentun.Peis.InternalReports
AsbitemName = s.First().AsbitemName,
AsbitemCount = s.Count(),
ItemTypeName = s.First().ItemTypeName,
AvgChargePrice = Math.Round(s.Average(v => v.ChargePrice.Value), 2),
AvgStandardPrice = Math.Round(s.Average(v => v.StandardPrice.Value), 2),
SumChargePrice = Math.Round(s.Sum(v => v.ChargePrice.Value * v.Amount.Value), 2),
SumStandardPrice = Math.Round(s.Sum(v => v.StandardPrice.Value * v.Amount.Value), 2)
AvgChargePrice = Math.Round(s.Average(v => v.ChargePrice), 2),
AvgStandardPrice = Math.Round(s.Average(v => v.StandardPrice), 2),
SumChargePrice = Math.Round(s.Sum(v => v.ChargePrice * v.Amount), 2),
SumStandardPrice = Math.Round(s.Sum(v => v.StandardPrice * v.Amount), 2)
}).ToList();
return entlist;
@ -326,10 +326,10 @@ namespace Shentun.Peis.InternalReports
ItemTypeName = s.First().ItemTypeName,
CustomerName = s.First().CustomerName,
DoctorName = s.First().DoctorName,
AvgChargePrice = Math.Round(s.Average(v => v.ChargePrice.Value), 2),
AvgStandardPrice = Math.Round(s.Average(v => v.StandardPrice.Value), 2),
SumChargePrice = Math.Round(s.Sum(v => v.ChargePrice.Value * v.Amount.Value), 2),
SumStandardPrice = Math.Round(s.Sum(v => v.StandardPrice.Value * v.Amount.Value), 2)
AvgChargePrice = Math.Round(s.Average(v => v.ChargePrice), 2),
AvgStandardPrice = Math.Round(s.Average(v => v.StandardPrice), 2),
SumChargePrice = Math.Round(s.Sum(v => v.ChargePrice * v.Amount), 2),
SumStandardPrice = Math.Round(s.Sum(v => v.StandardPrice * v.Amount), 2)
}).ToList();
return entlist;
@ -385,10 +385,10 @@ namespace Shentun.Peis.InternalReports
DoctorCheckCount = s.Count(),
ItemTypeName = s.First().ItemTypeName,
CustomerName = s.First().CustomerName,
AvgChargePrice = Math.Round(s.Average(v => v.ChargePrice.Value), 2),
AvgStandardPrice = Math.Round(s.Average(v => v.StandardPrice.Value), 2),
SumChargePrice = Math.Round(s.Sum(v => v.ChargePrice.Value * v.Amount.Value), 2),
SumStandardPrice = Math.Round(s.Sum(v => v.StandardPrice.Value * v.Amount.Value), 2)
AvgChargePrice = Math.Round(s.Average(v => v.ChargePrice), 2),
AvgStandardPrice = Math.Round(s.Average(v => v.StandardPrice), 2),
SumChargePrice = Math.Round(s.Sum(v => v.ChargePrice * v.Amount), 2),
SumStandardPrice = Math.Round(s.Sum(v => v.StandardPrice * v.Amount), 2)
}).ToList();
return entlist;
@ -431,18 +431,18 @@ namespace Shentun.Peis.InternalReports
.Select(s => new GetPeisWorkLoadReportDto
{
AsbitemName = s.FirstOrDefault().AsbitemName,
PersonCount = s.Sum(v => v.a.Amount).Value,
PersonCount = s.Sum(v => v.a.Amount),
RegisterName = s.FirstOrDefault().RegisterName,
StandardPrice = Math.Round(s.FirstOrDefault().a.StandardPrice.Value, 2).ToString(),
StandardAmount = Math.Round(s.Sum(v => v.a.StandardPrice.Value * v.a.Amount.Value), 2).ToString(),
ChargeAmount = Math.Round(s.Sum(v => v.a.ChargePrice.Value * v.a.Amount.Value), 2).ToString(),
ChargePrice = Math.Round(s.Sum(v => v.a.ChargePrice.Value * v.a.Amount.Value) / s.Sum(v => v.a.Amount).Value, 2).ToString(),
PersonAmount = Math.Round(s.Where(m => m.a.PayTypeFlag == RegisterAsbitemPayTypeFlag.PersonalPayment).Sum(v => v.a.ChargePrice.Value * v.a.Amount.Value), 2).ToString(),
UnitAmount = Math.Round(s.Sum(v => v.a.ChargePrice.Value * v.a.Amount.Value) -
(s.Where(m => m.a.PayTypeFlag == RegisterAsbitemPayTypeFlag.PersonalPayment).Sum(v => v.a.ChargePrice.Value * v.a.Amount.Value)), 2).ToString(),
PersonPaidAmount = Math.Round(s.Where(m => m.a.PayTypeFlag == RegisterAsbitemPayTypeFlag.PersonalPayment && m.a.IsCharge == 'Y').Sum(v => v.a.ChargePrice.Value * v.a.Amount.Value), 2).ToString(),
PersonUnPaidAmount = Math.Round(s.Where(m => m.a.PayTypeFlag == RegisterAsbitemPayTypeFlag.PersonalPayment).Sum(v => v.a.ChargePrice.Value * v.a.Amount.Value)
- (s.Where(m => m.a.PayTypeFlag == RegisterAsbitemPayTypeFlag.PersonalPayment && m.a.IsCharge == 'Y').Sum(v => v.a.ChargePrice.Value * v.a.Amount.Value)), 2).ToString()
StandardPrice = Math.Round(s.FirstOrDefault().a.StandardPrice, 2).ToString(),
StandardAmount = Math.Round(s.Sum(v => v.a.StandardPrice * v.a.Amount), 2).ToString(),
ChargeAmount = Math.Round(s.Sum(v => v.a.ChargePrice * v.a.Amount), 2).ToString(),
ChargePrice = Math.Round(s.Sum(v => v.a.ChargePrice * v.a.Amount) / s.Sum(v => v.a.Amount), 2).ToString(),
PersonAmount = Math.Round(s.Where(m => m.a.PayTypeFlag == PayTypeFlag.PersonPay).Sum(v => v.a.ChargePrice * v.a.Amount), 2).ToString(),
UnitAmount = Math.Round(s.Sum(v => v.a.ChargePrice * v.a.Amount) -
(s.Where(m => m.a.PayTypeFlag == PayTypeFlag.PersonPay).Sum(v => v.a.ChargePrice * v.a.Amount)), 2).ToString(),
PersonPaidAmount = Math.Round(s.Where(m => m.a.PayTypeFlag == PayTypeFlag.PersonPay && m.a.IsCharge == 'Y').Sum(v => v.a.ChargePrice * v.a.Amount), 2).ToString(),
PersonUnPaidAmount = Math.Round(s.Where(m => m.a.PayTypeFlag == PayTypeFlag.PersonPay).Sum(v => v.a.ChargePrice * v.a.Amount)
- (s.Where(m => m.a.PayTypeFlag == PayTypeFlag.PersonPay && m.a.IsCharge == 'Y').Sum(v => v.a.ChargePrice * v.a.Amount)), 2).ToString()
}).ToList();

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

@ -1416,20 +1416,20 @@ namespace Shentun.Peis.PatientRegisters
}
//支付
string? PayModeId = null;
if (!DataHelper.IsNullOrEmpty(input.PayTypeFlag))
{
var PayModeEnt = await _payModeRepository.FirstOrDefaultAsync(m => m.DisplayName == input.PayTypeFlag);
if (PayModeEnt != null)
{
PayModeId = PayModeEnt.Id;
}
else
{
return new CreatePatientRegisterExcelDto { code = -1, msg = "[导入失败,数据:" + input.PatientName + "]=>" + "支付方式不存在" };
}
}
//支付
char PayModeId = PayTypeFlag.OrgPay;
//if (!DataHelper.IsNullOrEmpty(input.PayTypeFlag))
//{
// var PayModeEnt = await _payModeRepository.FirstOrDefaultAsync(m => m.DisplayName == input.PayTypeFlag);
// if (PayModeEnt != null)
// {
// PayModeId = PayModeEnt.Id;
// }
// else
// {
// return new CreatePatientRegisterExcelDto { code = -1, msg = "[导入失败,数据:" + input.PatientName + "]=>" + "支付方式不存在" };
// }
//}
#endregion
@ -1643,7 +1643,7 @@ namespace Shentun.Peis.PatientRegisters
GuidePrintTimes = input.GuidePrintTimes.Value,
InterposeMeasure = input.InterposeMeasure,
IsAudit = input.IsAudit.Value,
IsLock = input.IsLock,
IsLock = input.IsLock.Value,
IsMedicalStart = input.IsMedicalStart.Value,
IsNameHide = input.IsNameHide.Value,
IsPhoneFollow = input.IsPhoneFollow.Value,

18
src/Shentun.Peis.Domain/RegisterAsbitems/RegisterAsbitemManager.cs

@ -97,7 +97,7 @@ namespace Shentun.Peis.RegisterAsbitems
#endregion
RegisterAsbitem entity = new RegisterAsbitem
@ -221,16 +221,16 @@ namespace Shentun.Peis.RegisterAsbitems
}
public async Task<List<RegisterAsbitem>>CreateManyAsync(PatientRegister patientRegister, List<RegisterAsbitem> registerAsbitems)
public void CreateManyAsync(PatientRegister patientRegister, List<RegisterAsbitem> registerAsbitems)
{
if(patientRegister == null)
if (patientRegister == null)
{
throw new UserFriendlyException("patientRegister不能为空");
}
foreach(var registerAsbitem in registerAsbitems)
}
foreach (var registerAsbitem in registerAsbitems)
{
registerAsbitem.PatientRegisterId = patientRegister.Id;
if(registerAsbitem.StandardPrice < 0)
if (registerAsbitem.StandardPrice < 0)
{
throw new UserFriendlyException("标准价格不能小于0");
}
@ -243,9 +243,9 @@ namespace Shentun.Peis.RegisterAsbitems
{
throw new UserFriendlyException("数量不能小于1");
}
DataHelper.CheckCharIsYOrN(registerAsbitem.IsCharge,"是否已收费");
if(registerAsbitem.PayTypeFlag != PayTypeFlag.OrgPay &&
registerAsbitem.PayTypeFlag != PayTypeFlag.PersonPay &&
DataHelper.CheckCharIsYOrN(registerAsbitem.IsCharge, "是否已收费");
if (registerAsbitem.PayTypeFlag != PayTypeFlag.OrgPay &&
registerAsbitem.PayTypeFlag != PayTypeFlag.PersonPay &&
registerAsbitem.PayTypeFlag != PayTypeFlag.Free)
{
throw new UserFriendlyException("支付方式类别不存在");

3
src/Shentun.Peis.EntityFrameworkCore/PatientRegisters/PatientRegisterChargeRepository.cs

@ -1,5 +1,6 @@
using Microsoft.EntityFrameworkCore;
using Shentun.Peis.EntityFrameworkCore;
using Shentun.Peis.Enums;
using Shentun.Peis.Models;
using System;
using System.Collections.Generic;
@ -176,7 +177,7 @@ namespace Shentun.Peis.PatientRegisters
List<CustomerOrg> customerOrgs = dbContext.CustomerOrgs.ToList();
var query = (from a in dbContext.PatientRegisters.Where(m => dbContext.RegisterAsbitems.Where(rsb => rsb.IsCharge == 'N' && rsb.PayTypeFlag == "0").Select(s => s.PatientRegisterId).Contains(m.Id))
var query = (from a in dbContext.PatientRegisters.Where(m => dbContext.RegisterAsbitems.Where(rsb => rsb.IsCharge == 'N' && rsb.PayTypeFlag == PayTypeFlag.PersonPay).Select(s => s.PatientRegisterId).Contains(m.Id))
join b in dbContext.Patients on a.PatientId equals b.Id into bb
from ab in bb.DefaultIfEmpty()
join c in dbContext.Sexes on a.SexId equals c.Id into cc

Loading…
Cancel
Save