From c4f2bc0b12641d1f655f5a7f43d5542fb68d3121 Mon Sep 17 00:00:00 2001
From: wxd <123@qq.com>
Date: Sun, 31 Mar 2024 22:03:59 +0800
Subject: [PATCH] =?UTF-8?q?=E6=95=B4=E7=90=86?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../ChargeAsbitems/ChargeAsbitemDto.cs | 2 +-
.../CreatePatientRegisterExcelRequestDto.cs | 2 +-
.../CreatePatientRegisterHistoryRequestDto.cs | 2 +-
...pdatePatientRegisterCustomerOrgGroupDto.cs | 2 +-
.../ChargeAsbitems/ChargeAsbitemAppService.cs | 7 +--
.../ChargeReports/ChargeReportAppService.cs | 12 ++---
.../CustomerReportAppService.cs | 30 +++++------
.../InternalReportAppService.cs | 54 +++++++++----------
.../PatientRegisterAppService.cs | 30 +++++------
.../RegisterAsbitemManager.cs | 18 +++----
.../PatientRegisterChargeRepository.cs | 3 +-
11 files changed, 82 insertions(+), 80 deletions(-)
diff --git a/src/Shentun.Peis.Application.Contracts/ChargeAsbitems/ChargeAsbitemDto.cs b/src/Shentun.Peis.Application.Contracts/ChargeAsbitems/ChargeAsbitemDto.cs
index 7c4b1fc..2db25ad 100644
--- a/src/Shentun.Peis.Application.Contracts/ChargeAsbitems/ChargeAsbitemDto.cs
+++ b/src/Shentun.Peis.Application.Contracts/ChargeAsbitems/ChargeAsbitemDto.cs
@@ -49,7 +49,7 @@ namespace Shentun.Peis.ChargeAsbitems
///
/// RegisterAsbitem表支付方式
///
- public string RegisterAsbitemPayTypeFlag { get; set; }
+ public char RegisterAsbitemPayTypeFlag { get; set; }
///
/// RegisterAsbitem表登记人
diff --git a/src/Shentun.Peis.Application.Contracts/PatientRegisters/CreatePatientRegisterExcelRequestDto.cs b/src/Shentun.Peis.Application.Contracts/PatientRegisters/CreatePatientRegisterExcelRequestDto.cs
index d7185ce..bdcf8ad 100644
--- a/src/Shentun.Peis.Application.Contracts/PatientRegisters/CreatePatientRegisterExcelRequestDto.cs
+++ b/src/Shentun.Peis.Application.Contracts/PatientRegisters/CreatePatientRegisterExcelRequestDto.cs
@@ -64,7 +64,7 @@ namespace Shentun.Peis.PatientRegisters
///
/// 支付方式,比如是0.个人支付、1.单位支付、2.免费
///
- public string? PayTypeFlag { get; set; }
+ public char PayTypeFlag { get; set; } = '1';
///
/// 部门名称
diff --git a/src/Shentun.Peis.Application.Contracts/PatientRegisters/CreatePatientRegisterHistoryRequestDto.cs b/src/Shentun.Peis.Application.Contracts/PatientRegisters/CreatePatientRegisterHistoryRequestDto.cs
index 3e69985..566a1e8 100644
--- a/src/Shentun.Peis.Application.Contracts/PatientRegisters/CreatePatientRegisterHistoryRequestDto.cs
+++ b/src/Shentun.Peis.Application.Contracts/PatientRegisters/CreatePatientRegisterHistoryRequestDto.cs
@@ -39,7 +39,7 @@ namespace Shentun.Peis.PatientRegisters
///
/// 支付方式 必传
///
- public string PayTypeFlag { get; set; }
+ public char PayTypeFlag { get; set; }
///
/// 体检中心ID
diff --git a/src/Shentun.Peis.Application.Contracts/PatientRegisters/UpdatePatientRegisterCustomerOrgGroupDto.cs b/src/Shentun.Peis.Application.Contracts/PatientRegisters/UpdatePatientRegisterCustomerOrgGroupDto.cs
index ccebd53..8d80160 100644
--- a/src/Shentun.Peis.Application.Contracts/PatientRegisters/UpdatePatientRegisterCustomerOrgGroupDto.cs
+++ b/src/Shentun.Peis.Application.Contracts/PatientRegisters/UpdatePatientRegisterCustomerOrgGroupDto.cs
@@ -21,7 +21,7 @@ namespace Shentun.Peis.PatientRegisters
///
/// 支付方式,比如是0.个人支付、1.单位支付、2.免费
///
- public string? PayTypeFlag { get; set; }
+ public char PayTypeFlag { get; set; } = '0';
///
diff --git a/src/Shentun.Peis.Application/ChargeAsbitems/ChargeAsbitemAppService.cs b/src/Shentun.Peis.Application/ChargeAsbitems/ChargeAsbitemAppService.cs
index 5513484..39cd51b 100644
--- a/src/Shentun.Peis.Application/ChargeAsbitems/ChargeAsbitemAppService.cs
+++ b/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,
diff --git a/src/Shentun.Peis.Application/ChargeReports/ChargeReportAppService.cs b/src/Shentun.Peis.Application/ChargeReports/ChargeReportAppService.cs
index f801da9..a544d07 100644
--- a/src/Shentun.Peis.Application/ChargeReports/ChargeReportAppService.cs
+++ b/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();
diff --git a/src/Shentun.Peis.Application/CustomerReports/CustomerReportAppService.cs b/src/Shentun.Peis.Application/CustomerReports/CustomerReportAppService.cs
index 9eeee8b..bc33671 100644
--- a/src/Shentun.Peis.Application/CustomerReports/CustomerReportAppService.cs
+++ b/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
{
diff --git a/src/Shentun.Peis.Application/InternalReports/InternalReportAppService.cs b/src/Shentun.Peis.Application/InternalReports/InternalReportAppService.cs
index de2cbb5..e59e43e 100644
--- a/src/Shentun.Peis.Application/InternalReports/InternalReportAppService.cs
+++ b/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();
diff --git a/src/Shentun.Peis.Application/PatientRegisters/PatientRegisterAppService.cs b/src/Shentun.Peis.Application/PatientRegisters/PatientRegisterAppService.cs
index 9c9a365..3012a7f 100644
--- a/src/Shentun.Peis.Application/PatientRegisters/PatientRegisterAppService.cs
+++ b/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,
diff --git a/src/Shentun.Peis.Domain/RegisterAsbitems/RegisterAsbitemManager.cs b/src/Shentun.Peis.Domain/RegisterAsbitems/RegisterAsbitemManager.cs
index 6f9712d..8a0de5b 100644
--- a/src/Shentun.Peis.Domain/RegisterAsbitems/RegisterAsbitemManager.cs
+++ b/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>CreateManyAsync(PatientRegister patientRegister, List registerAsbitems)
+ public void CreateManyAsync(PatientRegister patientRegister, List 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("支付方式类别不存在");
diff --git a/src/Shentun.Peis.EntityFrameworkCore/PatientRegisters/PatientRegisterChargeRepository.cs b/src/Shentun.Peis.EntityFrameworkCore/PatientRegisters/PatientRegisterChargeRepository.cs
index 6258a11..dbc7c42 100644
--- a/src/Shentun.Peis.EntityFrameworkCore/PatientRegisters/PatientRegisterChargeRepository.cs
+++ b/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 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