diff --git a/PEIS/Entity/EnrollmentOrgPatient.cs b/PEIS/Entity/EnrollmentOrgPatient.cs index 6fe7063..56c6535 100644 --- a/PEIS/Entity/EnrollmentOrgPatient.cs +++ b/PEIS/Entity/EnrollmentOrgPatient.cs @@ -8,7 +8,7 @@ namespace PEIS.Entity /// public partial class EnrollmentOrgPatient : ObjectData { - public override String TableName => "Enrollment_OrgPatient"; + public override String TableName => "Enrollment_OrgPatient"; public Int64 GroupID { get; set; } public Int64 PID { get; set; } @@ -44,5 +44,14 @@ namespace PEIS.Entity [RefFlag(true)] public String Sex { get; set; } + + [RefFlag(true)] + public String Description { get; set; } + + [RefFlag(true)] + public String Creator { get; set; } + + [RefFlag(true)] + public DateTime? CreateTime { get; set; } } } \ No newline at end of file diff --git a/PEIS/Model/Enrollment/EnrollmentOrgFeeItemModel.cs b/PEIS/Model/Enrollment/EnrollmentOrgFeeItemModel.cs index dcd4a8c..a0d67ba 100644 --- a/PEIS/Model/Enrollment/EnrollmentOrgFeeItemModel.cs +++ b/PEIS/Model/Enrollment/EnrollmentOrgFeeItemModel.cs @@ -58,6 +58,12 @@ namespace PEIS.Model.Enrollment WHERE c.ID = { oeID} AND d.ID = { groupID} AND a.ID NOT IN (SELECT PID FROM Enrollment_Patient WHERE OEID = {oeID})"); + // 备注信息作为一次性临时备注, 登记后清空Base_Patient的Description字段 + DAOHelp.ExecuteSql($@"update Base_Patient set Description=null + from Base_Patient a join Enrollment_Patient b on a.id=b.PID + where b.OEID={oeID} and b.GroupID={groupID} and (a.Description is not null and a.Description<>'') + and (b.Description is not null and b.Description<>'');"); + var groupFeeItem = DAOHelp.GetDataBySQL($@"SELECT * FROM Enrollment_OrgFeeItem WHERE GroupID = {groupID}"); if (groupFeeItem.Count != 0) @@ -72,6 +78,11 @@ namespace PEIS.Model.Enrollment public void CancelOrgFeeItem(Int64 oeID, Int64 groupID, string oeName) { + // 删除登记信息前, 回写Description字段 + DAOHelp.ExecuteSql($@"update Base_Patient set Description=b.Description + from Base_Patient a join Enrollment_Patient b on a.id=b.PID + where b.OEID={oeID} and b.GroupID={groupID} and (a.Description is null or a.Description='') + and (b.Description is not null and b.Description<>'');"); // 个人登记信息 int delPatient = DAOHelp.ExecuteSql($@"delete from Enrollment_Patient where OEID = {oeID} and GroupId = {groupID}"); // 个人收费信息 diff --git a/PEIS/Model/Enrollment/EnrollmentOrgPatientModel.cs b/PEIS/Model/Enrollment/EnrollmentOrgPatientModel.cs index f5ae409..d933429 100644 --- a/PEIS/Model/Enrollment/EnrollmentOrgPatientModel.cs +++ b/PEIS/Model/Enrollment/EnrollmentOrgPatientModel.cs @@ -73,7 +73,7 @@ namespace PEIS.Model.Enrollment public List GetPatient(Int64 groupID, Int64 oeID) { - return DAOHelp.GetDataBySQL($"SELECT a.*, b.Name,b.Birthday,b.CardType, b.CardNo,b.Education, b.Marriage,b.Nation, b.Tel1, b.Tel2, CASE b.Sex WHEN 1 THEN '男' WHEN 2 THEN '女' ELSE '' END AS Sex FROM Enrollment_OrgPatient a LEFT JOIN Base_Patient b ON a.PID = b.ID WHERE GroupID = {groupID} AND OID = {oeID}"); + return DAOHelp.GetDataBySQL($"SELECT a.*, b.Name,b.Birthday,b.CardType, b.CardNo,b.Education, b.Marriage,b.Nation, b.Tel1, b.Tel2, CASE b.Sex WHEN 1 THEN '男' WHEN 2 THEN '女' ELSE '' END AS Sex, b.Description, b.Creator, b.CreateTime FROM Enrollment_OrgPatient a LEFT JOIN Base_Patient b ON a.PID = b.ID WHERE GroupID = {groupID} AND OID = {oeID}"); } public EnrollmentPatient GetPatient(Int64 PID, Int64 oeID, Int64 groupID) diff --git a/PEIS/ReportFiles/CAPReport.frx b/PEIS/ReportFiles/CAPReport.frx index e1b56a3..357922b 100644 --- a/PEIS/ReportFiles/CAPReport.frx +++ b/PEIS/ReportFiles/CAPReport.frx @@ -1,5 +1,5 @@  - + using System; using System.Collections; using System.Collections.Generic; @@ -186,7 +186,7 @@ namespace FastReport - + @@ -205,7 +205,7 @@ namespace FastReport - + @@ -473,7 +473,7 @@ namespace FastReport - + @@ -594,7 +594,7 @@ namespace FastReport - + @@ -617,7 +617,7 @@ namespace FastReport - + diff --git a/PEIS/Utils/ExcelHelper.cs b/PEIS/Utils/ExcelHelper.cs index ac22648..4231874 100644 --- a/PEIS/Utils/ExcelHelper.cs +++ b/PEIS/Utils/ExcelHelper.cs @@ -106,22 +106,21 @@ namespace PEIS.Utils } private static BasePatient ReadRowToBasePatient(IRow dataRow) { - var sex = dataRow.GetCell(2)?.ToString()??""; - var s = dataRow.GetCell(1); + var sex = dataRow.GetCell(2)?.ToString() ?? ""; return new BasePatient() { // A-0-序号,B-1-姓名,C-2-性别,D-3-民族,E-4-婚姻,F-5-身份证号,G-6-住址,H-7-电话,I-8-部门,J-9备注 - Name = dataRow.GetCell(1)?.ToString().Replace(" ", ""), - Contactor1 = dataRow.GetCell(1)?.ToString().Replace(" ", ""), - Sex = sex.Contains("女")?"2":"1", - Nation = dataRow.GetCell(3)?.ToString().Replace(" ", ""), - Marriage = dataRow.GetCell(4)?.ToString().Replace(" ", ""), - CardNo = dataRow.GetCell(5)?.ToString().Replace(" ", ""), + Name = dataRow.GetCell(1)?.ToString().Replace(" ", "").Trim(), + Contactor1 = dataRow.GetCell(1)?.ToString().Replace(" ", "").Trim(), + Sex = sex.Contains("女") ? "2" : "1", + Nation = dataRow.GetCell(3)?.ToString().Replace(" ", "").Trim(), + Marriage = dataRow.GetCell(4)?.ToString().Replace(" ", "").Trim(), + CardNo = dataRow.GetCell(5)?.ToString().Replace(" ", "").Trim(), CardType = "居民身份证", - Address1 = dataRow.GetCell(6)?.ToString().Replace(" ", ""), - Tel1 = dataRow.GetCell(7)?.ToString().Replace(" ", ""), - DeptName = dataRow.GetCell(8)?.ToString().Replace(" ", ""), - Description = dataRow.GetCell(9)?.ToString().Replace(" ", ""), + Address1 = dataRow.GetCell(6)?.ToString().Replace(" ", "").Trim(), + Tel1 = dataRow.GetCell(7)?.ToString().Replace(" ", "").Trim(), + DeptName = dataRow.GetCell(8)?.ToString().Replace(" ", "").Trim(), + Description = dataRow.GetCell(9)?.ToString().Replace(" ", "").Trim(), SpellCode = PingYinHelper.GetTotalPingYin(dataRow.GetCell(1)?.ToString().Replace(" ", "")).FirstPingYin.Count == 0 ? null : PingYinHelper.GetTotalPingYin(dataRow.GetCell(1)?.ToString().Replace(" ", "")).FirstPingYin[0] }; } @@ -136,7 +135,7 @@ namespace PEIS.Utils public void PackExcelExport(Pack pack) { - if (pack == null || pack.ID <= 0 ) + if (pack == null || pack.ID <= 0) { Global.Msg("info", "未选中体检套餐,无法导出!"); return; @@ -226,7 +225,7 @@ namespace PEIS.Utils } - private void WriteSheet (ISheet sheet, Pack pack) + private void WriteSheet(ISheet sheet, Pack pack) { List feeItems = new FeeItemModel().GetItemsByPack(pack.ID); sheet.GetRow(0).GetCell(0).SetCellValue(pack.Name); // 设置表头 @@ -349,18 +348,18 @@ namespace PEIS.Utils public ExcelRowModel(int rowCount, IRow row) { RowCount = rowCount + 1; - ColumnA = row.GetCell(0)?.ToString()??""; - ColumnB = row.GetCell(1)?.ToString()??""; - ColumnC = row.GetCell(2)?.ToString()??""; - ColumnD = row.GetCell(3)?.ToString()??""; - ColumnE = row.GetCell(4)?.ToString()??""; - ColumnF = row.GetCell(5)?.ToString()??""; - ColumnG = row.GetCell(6)?.ToString()??""; - ColumnH = row.GetCell(7)?.ToString()??""; - ColumnI = row.GetCell(8)?.ToString()??""; - ColumnJ = row.GetCell(9)?.ToString()??""; + ColumnA = row.GetCell(0)?.ToString() ?? ""; + ColumnB = row.GetCell(1)?.ToString() ?? ""; + ColumnC = row.GetCell(2)?.ToString() ?? ""; + ColumnD = row.GetCell(3)?.ToString() ?? ""; + ColumnE = row.GetCell(4)?.ToString() ?? ""; + ColumnF = row.GetCell(5)?.ToString() ?? ""; + ColumnG = row.GetCell(6)?.ToString() ?? ""; + ColumnH = row.GetCell(7)?.ToString() ?? ""; + ColumnI = row.GetCell(8)?.ToString() ?? ""; + ColumnJ = row.GetCell(9)?.ToString() ?? ""; ColumnK = row.GetCell(10)?.ToString() ?? ""; - } + } public ExcelRowModel(BasePatient p) { ColumnA = p.Name; diff --git a/PEIS/Utils/PingYinHelper.cs b/PEIS/Utils/PingYinHelper.cs index ffe7e3e..7d0b900 100644 --- a/PEIS/Utils/PingYinHelper.cs +++ b/PEIS/Utils/PingYinHelper.cs @@ -19,6 +19,8 @@ namespace PEIS.Utils /// public static PingYinModel GetTotalPingYin(string str) { + PingYinModel result = new PingYinModel(); + if (string.IsNullOrWhiteSpace(str)) return result; var chs = str.ToCharArray(); //记录每个汉字的全拼 Dictionary> totalPingYins = new Dictionary>(); @@ -46,7 +48,7 @@ namespace PEIS.Utils totalPingYins[i] = pinyins; } } - PingYinModel result = new PingYinModel(); + foreach (var pinyins in totalPingYins) { var items = pinyins.Value; diff --git a/PEIS/Utils/ReportHelper.cs b/PEIS/Utils/ReportHelper.cs index 82d2a91..5abb4ef 100644 --- a/PEIS/Utils/ReportHelper.cs +++ b/PEIS/Utils/ReportHelper.cs @@ -437,8 +437,8 @@ namespace PEIS.Utils { for (int i = 0; i < lstConclusions.Count; i++) { - Conclusion += $"{(i + 1)}、{lstConclusions[i].Conclusion}。" + "\r\n"; - Suggestion += $"{(i + 1)}、{lstConclusions[i].Conclusion}。" + "\r\n" + $"{lstConclusions[i].Suggestion}" + "\r\n"; + Conclusion += $"{(i + 1)}、{lstConclusions[i].Conclusion}" + "\r\n"; + Suggestion += $"{(i + 1)}、{lstConclusions[i].Conclusion}" + "\r\n" + $"{lstConclusions[i].Suggestion}" + "\r\n"; } } rpt.SetParameterValue("Conclusion", Conclusion); diff --git a/PEIS/View/Base/PersonForm.cs b/PEIS/View/Base/PersonForm.cs index 4396c06..be752c6 100644 --- a/PEIS/View/Base/PersonForm.cs +++ b/PEIS/View/Base/PersonForm.cs @@ -62,7 +62,8 @@ namespace PEIS.View.Base Company = _baseInfo.Company, CreateTime = _baseInfo.CreateTime, CreatorCode = _baseInfo.CreatorCode, - Creator = _baseInfo.Creator + Creator = _baseInfo.Creator, + Description=_baseInfo.Description }; basePatient.Update(); } diff --git a/PEIS/View/Enrollment/EnrollmentOrgForm.cs b/PEIS/View/Enrollment/EnrollmentOrgForm.cs index 9de4c70..a5a0c07 100644 --- a/PEIS/View/Enrollment/EnrollmentOrgForm.cs +++ b/PEIS/View/Enrollment/EnrollmentOrgForm.cs @@ -502,17 +502,6 @@ namespace PEIS.View.Enrollment var enrollmentOrgPatient = new EnrollmentOrgPatient { - Name = item.Name, - Birthday = item.Birthday, - CardNo = item.CardNo, - CardType = item.CardType, - DeptName = item.DeptName ?? DgvGroup.GetRowCellValue(DgvGroup.GetSelectedRows()[0], "Name").ToString(), - Education = item.Education, - Marriage = item.Marriage, - Nation = item.Nation, - Sex = item.Sex, - Tel1 = item.Tel1, - Tel2 = item.Tel2, GroupID = Convert.ToInt64(DgvGroup.GetRowCellValue(DgvGroup.GetSelectedRows()[0], "ID").ToString()), OID = Convert.ToInt64(DgvGroup.GetRowCellValue(DgvGroup.GetSelectedRows()[0], "OID").ToString()), PID = item.PID