From ada39fff592faaee282b967d08ae3d10c6c26745 Mon Sep 17 00:00:00 2001 From: lsm Date: Wed, 6 Nov 2024 17:11:41 +0800 Subject: [PATCH] =?UTF-8?q?1=E3=80=81=E5=9B=A2=E4=BD=93=E6=88=90=E5=91=98?= =?UTF-8?q?=E5=AF=BC=E5=87=BA=E5=88=97=E8=A1=A8=E6=A0=BC=E5=BC=8F=E8=B0=83?= =?UTF-8?q?=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- PEIS/Entity/EnrollmentPatient.cs | 3 + PEIS/Model/Enrollment/EnrollmentOrgModel.cs | 62 ++++++----- PEIS/ReportFiles/OrgExcel.frx | 112 ++++++++++++-------- PEIS/View/Enrollment/EnrollmentOrgForm.cs | 6 +- 4 files changed, 103 insertions(+), 80 deletions(-) diff --git a/PEIS/Entity/EnrollmentPatient.cs b/PEIS/Entity/EnrollmentPatient.cs index 6a13dda..13d70c6 100644 --- a/PEIS/Entity/EnrollmentPatient.cs +++ b/PEIS/Entity/EnrollmentPatient.cs @@ -99,6 +99,9 @@ namespace PEIS.Entity [RefFlag(true)] public Decimal Fee { get; set; } + [RefFlag(true)] + public Decimal? Discount { get; set; } + [RefFlag(true)] public DateTime? CostTime { get; set; } diff --git a/PEIS/Model/Enrollment/EnrollmentOrgModel.cs b/PEIS/Model/Enrollment/EnrollmentOrgModel.cs index 83074c7..1d2f81e 100644 --- a/PEIS/Model/Enrollment/EnrollmentOrgModel.cs +++ b/PEIS/Model/Enrollment/EnrollmentOrgModel.cs @@ -106,38 +106,36 @@ namespace PEIS.Model.Enrollment public List GetExcelList(Int64 oeID) { - //return DAOHelp.GetDataBySQL($@"SELECT - // a.ID, - // a.Name, - // CASE WHEN a.Sex = 1 THEN '男' ELSE '女' END AS 'Sex', - // b.Marriage, - // CONVERT ( VARCHAR, a.Age ) + a.AgeClass AS 'AgeClass', - // a.CardNo, - // a.Tel1, - // c.DeptName, - // a.SignTime, - // (SELECT SUM(Fee) FROM Enrollment_CheckCost WHERE a.ID = EID AND a.OEID = OEID AND DeleteTime IS NULL) AS Fee - // FROM - // Enrollment_Patient a - // LEFT JOIN Base_Patient b ON a.PID = b.ID - // LEFT JOIN Base_OrgPatient c ON c.OID = a.OID AND c.PID = b.ID - // LEFT JOIN Enrollment_CheckCost d ON a.ID = d.EID AND a.OEID = d.OEID - // WHERE - // a.OEID = {oeID} ORDER BY a.SignTime"); - - return DAOHelp.GetDataBySQL($@"SELECT - a.Name, - CASE a.Sex WHEN 1 THEN '男' ELSE '女'END AS Sex, - CAST(a.Age AS VARCHAR) + a.AgeClass AS AgeClass, - a.CardNo, - b.FeeItemName, - b.Price, - a.SignTime, - CASE WHEN a.SignTime IS NULL THEN '未发送' ELSE '已发送' END AS Signer - FROM Enrollment_Patient a - LEFT JOIN Enrollment_FeeItem b ON a.ID = b.EID - WHERE a.OEID = {oeID} - ORDER BY Name,SignTime"); + return DAOHelp.GetDataBySQL($@"SELECT + a.ID, + a.Name, + CASE WHEN a.Sex = 1 THEN '男' ELSE '女' END AS 'Sex', + a.Marriage, + CONVERT ( VARCHAR, a.Age ) + a.AgeClass AS 'AgeClass', + a.CardNo, + a.Tel1, + a.SignTime, + (SELECT SUM ([sum]) FROM Enrollment_CheckCost WHERE a.ID = EID AND a.OEID = OEID AND DeleteTime IS NULL AND CancelTime IS NULL ) AS Price, + (SELECT ROUND(CAST((SUM (Fee) / SUM([Sum]) * 10) AS DECIMAL(10,2)), 2) FROM Enrollment_CheckCost WHERE a.ID = EID AND a.OEID = OEID AND DeleteTime IS NULL AND CancelTime IS NULL ) AS Discount, + (SELECT SUM (Fee) FROM Enrollment_CheckCost WHERE a.ID = EID AND a.OEID = OEID AND DeleteTime IS NULL AND CancelTime IS NULL ) AS Fee + FROM + Enrollment_Patient a + WHERE + a.OEID = {oeID} ORDER BY a.SignTime"); + + //return DAOHelp.GetDataBySQL($@"SELECT + // a.Name, + // CASE a.Sex WHEN 1 THEN '男' ELSE '女'END AS Sex, + // CAST(a.Age AS VARCHAR) + a.AgeClass AS AgeClass, + // a.CardNo, + // b.FeeItemName, + // b.Price, + // a.SignTime, + // CASE WHEN a.SignTime IS NULL THEN '未发送' ELSE '已发送' END AS Signer + // FROM Enrollment_Patient a + // LEFT JOIN Enrollment_FeeItem b ON a.ID = b.EID + // WHERE a.OEID = {oeID} + // ORDER BY Name,SignTime"); } } } \ No newline at end of file diff --git a/PEIS/ReportFiles/OrgExcel.frx b/PEIS/ReportFiles/OrgExcel.frx index ba6f526..864a82a 100644 --- a/PEIS/ReportFiles/OrgExcel.frx +++ b/PEIS/ReportFiles/OrgExcel.frx @@ -1,5 +1,5 @@  - + using System; using System.Collections; using System.Collections.Generic; @@ -24,6 +24,12 @@ namespace FastReport Cell96.Font = new Font("微软雅黑", (float)10, FontStyle.Bold); } } + + private void Cell83_AfterData(object sender, EventArgs e) + { + DataSourceBase rowData = Report.GetDataSource("O"); + Cell83.Text = rowData["SignTime"] == null ? "" : Convert.ToDateTime(rowData["SignTime"]).ToString("yyyy-MM-dd"); + } } } @@ -33,12 +39,13 @@ namespace FastReport + - + @@ -49,7 +56,7 @@ namespace FastReport - + @@ -61,60 +68,73 @@ namespace FastReport - + - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + - - - + + - - + + + - - + + + - + diff --git a/PEIS/View/Enrollment/EnrollmentOrgForm.cs b/PEIS/View/Enrollment/EnrollmentOrgForm.cs index fab9068..5510da7 100644 --- a/PEIS/View/Enrollment/EnrollmentOrgForm.cs +++ b/PEIS/View/Enrollment/EnrollmentOrgForm.cs @@ -872,6 +872,7 @@ namespace PEIS.View.Enrollment rpt.SetParameterValue("Yes", _lstExcelEPatient.Where(w => w.SignTime != null).GroupBy(g => g.Name).Count()); rpt.SetParameterValue("OrgName", DgvOrg.GetRowCellValue(DgvOrg.GetSelectedRows()[0], "Name").ToString()); rpt.SetParameterValue("TotalFee", _lstExcelEPatient.Sum(s => s.Fee)); + rpt.SetParameterValue("TotalPrice", _lstExcelEPatient.Sum(s => s.Price)); // 人员数据 rpt.RegisterData(_lstExcelEPatient, "O"); @@ -888,7 +889,7 @@ namespace PEIS.View.Enrollment { GroupID = grp.Key, Price = grp.Sum(item => item.Price), - PackName = grp.Where(item => item.PackName != null).ToList()[0].PackName + PackName = grp.Where(item => item.PackName != null).ToList().Count() == 0 ? "加项" : grp.Where(item => item.PackName != null).ToList()[0].PackName }); foreach (var group in grouped) @@ -960,6 +961,7 @@ namespace PEIS.View.Enrollment rpt.SetParameterValue("Yes", list.Where(w => w.SignTime != null).GroupBy(g => g.Name).Count()); rpt.SetParameterValue("OrgName", DgvOrg.GetRowCellValue(DgvOrg.GetSelectedRows()[0], "Name").ToString()); rpt.SetParameterValue("TotalFee", list.Sum(s => s.Fee)); + rpt.SetParameterValue("TotalPrice", list.Sum(s => s.Price)); // 人员数据 rpt.RegisterData(list, "O"); @@ -976,7 +978,7 @@ namespace PEIS.View.Enrollment { GroupID = grp.Key, Price = grp.Sum(item => item.Price), - PackName = grp.Where(item => item.PackName != null).ToList()[0].PackName + PackName = grp.Where(item => item.PackName != null).ToList().Count() == 0 ? "加项" : grp.Where(item => item.PackName != null).ToList()[0].PackName }); foreach (var group in grouped)