备注字段逻辑优化

1.备注字段为一次性使用, 处理逻辑优化
2.excel文件导入, 兼容空字符情况
3.职业体检结论建议文本调整, 报告模板调整
dhzzyy
LiJiaWen 1 month ago
parent 1d2f38fc84
commit 2afded4fc2
  1. 11
      PEIS/Entity/EnrollmentOrgPatient.cs
  2. 11
      PEIS/Model/Enrollment/EnrollmentOrgFeeItemModel.cs
  3. 2
      PEIS/Model/Enrollment/EnrollmentOrgPatientModel.cs
  4. 12
      PEIS/ReportFiles/CAPReport.frx
  5. 49
      PEIS/Utils/ExcelHelper.cs
  6. 4
      PEIS/Utils/PingYinHelper.cs
  7. 4
      PEIS/Utils/ReportHelper.cs
  8. 3
      PEIS/View/Base/PersonForm.cs
  9. 11
      PEIS/View/Enrollment/EnrollmentOrgForm.cs

@ -8,7 +8,7 @@ namespace PEIS.Entity
/// </summary>
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; }
}
}

@ -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<EnrollmentOrgFeeItem>($@"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}");
// 个人收费信息

@ -73,7 +73,7 @@ namespace PEIS.Model.Enrollment
public List<EnrollmentOrgPatient> GetPatient(Int64 groupID, Int64 oeID)
{
return DAOHelp.GetDataBySQL<EnrollmentOrgPatient>($"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<EnrollmentOrgPatient>($"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)

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Report ScriptLanguage="CSharp" ReportInfo.Created="05/23/2023 15:50:00" ReportInfo.Modified="08/11/2025 11:06:22" ReportInfo.CreatorVersion="2022.1.0.0">
<Report ScriptLanguage="CSharp" ReportInfo.Created="05/23/2023 15:50:00" ReportInfo.Modified="09/03/2025 15:17:51" ReportInfo.CreatorVersion="2022.1.0.0">
<ScriptText>using System;
using System.Collections;
using System.Collections.Generic;
@ -186,7 +186,7 @@ namespace FastReport
<TextObject Name="Text549" Left="170.1" Top="302.4" Width="122.85" Height="22.68" Text="用人单位地址:" VertAlign="Center" WordWrap="false" Font="微软雅黑, 14pt"/>
<TextObject Name="Text550" Left="302.4" Top="302.53" Width="217.35" Height="22.68" Border.Lines="Bottom" Text="[TeamAddress]" Padding="0, 0, 0, 0" AutoShrink="FontWidth" HorzAlign="Center" VertAlign="Center" WordWrap="false" Font="微软雅黑, 12pt"/>
<TextObject Name="Text551" Left="170.1" Top="340.2" Width="198.45" Height="22.68" Text="职业健康监护档案编号:" VertAlign="Center" WordWrap="false" Font="微软雅黑, 14pt"/>
<TextObject Name="Text552" Left="378" Top="340.33" Width="141.75" Height="22.68" Border.Lines="Bottom" Text="[PatientID]" Padding="0, 0, 0, 0" AutoShrink="FontWidth" HorzAlign="Center" VertAlign="Center" WordWrap="false" Font="微软雅黑, 12pt"/>
<TextObject Name="Text552" Left="378" Top="340.33" Width="141.75" Height="22.68" Border.Lines="Bottom" Text="[IDCard]" Padding="0, 0, 0, 0" AutoShrink="FontWidth" HorzAlign="Center" VertAlign="Center" WordWrap="false" Font="微软雅黑, 12pt"/>
<TextObject Name="Text553" Left="170.1" Top="415.8" Width="85.05" Height="22.68" Text="姓 名:" VertAlign="Center" WordWrap="false" Font="微软雅黑, 14pt"/>
<TextObject Name="Text554" Left="264.6" Top="415.93" Width="255.15" Height="22.68" Border.Lines="Bottom" Text="[PatientName]" Padding="0, 0, 0, 0" HorzAlign="Center" VertAlign="Center" Font="微软雅黑, 12pt"/>
<TextObject Name="Text555" Left="170.1" Top="453.6" Width="85.05" Height="22.68" Text="性 别:" VertAlign="Center" WordWrap="false" Font="微软雅黑, 14pt"/>
@ -205,7 +205,7 @@ namespace FastReport
<TextObject Name="Text568" Left="444.15" Top="642.73" Width="75.6" Height="22.68" Border.Lines="Bottom" Text="[HazardYears]" Padding="0, 0, 0, 0" HorzAlign="Center" VertAlign="Center" Font="微软雅黑, 12pt"/>
<TextObject Name="Text569" Left="170.1" Top="680.4" Width="141.75" Height="22.68" Text="毒害种类和名称:" VertAlign="Center" WordWrap="false" Font="微软雅黑, 14pt"/>
<TextObject Name="Text570" Left="321.3" Top="680.53" Width="198.45" Height="22.68" Border.Lines="Bottom" Text="[HazardFactors]" Padding="0, 0, 0, 0" HorzAlign="Center" VertAlign="Center" Font="微软雅黑, 12pt"/>
<PictureObject Name="Avatar" Left="585.9" Top="75.6" Width="85.05" Height="111.51" Border.Lines="All" BeforePrintEvent="Avatar_BeforePrint" Image=""/>
<PictureObject Name="Avatar" Left="585.9" Top="75.6" Width="85.05" Height="111.51" Border.Lines="All" BeforePrintEvent="Avatar_BeforePrint"/>
</PageHeaderBand>
</ReportPage>
<ReportPage Name="Page7" Watermark.Font="宋体, 60pt">
@ -473,7 +473,7 @@ namespace FastReport
<GroupHeaderBand Name="GroupHeader8" Top="307.5" Width="718.2" Height="28.35" KeepWithData="true" Condition="[P.FeeItemName]" SortOrder="None" KeepTogether="true">
<TextObject Name="Text105" Width="718.2" Height="28.35" Border.Lines="All" Fill.Color="192, 255, 255" CanGrow="true" CanBreak="false" Text="[P.FeeItemName]" VertAlign="Center" WordWrap="false" Font="微软雅黑, 12pt, style=Bold, Italic"/>
<DataBand Name="PACS" Top="339.85" Width="239.4" Height="177.66" CanGrow="true" CanShrink="true" Columns.Count="3" KeepTogether="true" KeepDetail="true">
<PictureObject Name="Picture4" Width="239.4" Height="177.66" Border.Lines="Top, Bottom" CanGrow="true" CanShrink="true" BeforePrintEvent="Picture4_BeforePrint" SizeMode="StretchImage" Image=""/>
<PictureObject Name="Picture4" Width="239.4" Height="177.66" Border.Lines="Top, Bottom" CanGrow="true" CanShrink="true" BeforePrintEvent="Picture4_BeforePrint" SizeMode="StretchImage"/>
<DataFooterBand Name="DataFooter4" Top="521.51" Width="718.2" Height="28.35" CanGrow="true" CanShrink="true" KeepWithData="true">
<TextObject Name="Text106" Width="718.2" Height="28.35" Border.Lines="All" CanGrow="true" CanShrink="true" AfterDataEvent="" CanBreak="false" Text="[P.TextResult]" VertAlign="Center" Font="微软雅黑, 10pt"/>
</DataFooterBand>
@ -594,7 +594,7 @@ namespace FastReport
<TextObject Name="Text402" Left="434.7" Top="9.45" Width="92.61" Height="18.9" Text="[ExamDate]" AutoShrink="FontWidth" VertAlign="Center" WordWrap="false" Font="微软雅黑, 10pt"/>
</PageHeaderBand>
<DataBand Name="PACSImage" Top="41.8" Width="718.2" Height="1009.26" CanGrow="true" CanShrink="true">
<PictureObject Name="Picture5" Width="718.2" Height="1009.26" BeforePrintEvent="Picture5_BeforePrint" Image=""/>
<PictureObject Name="Picture5" Width="718.2" Height="1009.26" BeforePrintEvent="Picture5_BeforePrint"/>
</DataBand>
<PageFooterBand Name="PageFooter1" Top="1055.06" Width="718.2" Height="37.8">
<TextObject Name="Text410" Width="718.2" Height="37.8" Text="第[Page#]页,共[TotalPages#]页" VertAlign="Center" Font="微软雅黑, 8pt, style=Bold"/>
@ -617,7 +617,7 @@ namespace FastReport
<TextObject Name="Text531" Top="207.9" Width="718.2" Height="28.35" Border.Lines="All" Text="职业健康检查处理意见:" VertAlign="Center" Font="微软雅黑, 12pt, style=Bold"/>
<TextObject Name="Text533" Top="415.8" Width="718.2" Height="311.85" Border.Lines="All" Padding="0, 0, 0, 0" Font="微软雅黑, 12pt"/>
<TextObject Name="Text534" Top="434.7" Width="122.85" Height="18.9" Text="主检医师签字:" Padding="0, 0, 0, 0" HorzAlign="Center" VertAlign="Center" Font="微软雅黑, 12pt"/>
<TextObject Name="Text535" Left="103.95" Top="434.7" Width="122.85" Height="18.9" Text="[FinishPerson]" Padding="0, 0, 0, 0" VertAlign="Center" Font="微软雅黑, 12pt"/>
<TextObject Name="Text535" Left="103.95" Top="434.7" Width="122.85" Height="18.9" Text="朗玉" Padding="0, 0, 0, 0" VertAlign="Center" Font="微软雅黑, 12pt"/>
<TextObject Name="Text536" Left="28.35" Top="481.95" Width="94.5" Height="18.9" Text="审核医师:" Padding="0, 0, 0, 0" HorzAlign="Center" VertAlign="Center" Font="微软雅黑, 12pt"/>
<TextObject Name="Text537" Left="103.95" Top="481.95" Width="122.85" Height="18.9" Text="[FinishPerson]" Padding="0, 0, 0, 0" VertAlign="Center" Font="微软雅黑, 12pt"/>
<TextObject Name="Text538" Left="340.2" Top="434.7" Width="94.5" Height="18.9" Text="单位签章:" Padding="0, 0, 0, 0" HorzAlign="Center" VertAlign="Center" Font="微软雅黑, 12pt"/>

@ -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<FeeItem> 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;

@ -19,6 +19,8 @@ namespace PEIS.Utils
/// <returns></returns>
public static PingYinModel GetTotalPingYin(string str)
{
PingYinModel result = new PingYinModel();
if (string.IsNullOrWhiteSpace(str)) return result;
var chs = str.ToCharArray();
//记录每个汉字的全拼
Dictionary<int, List<string>> totalPingYins = new Dictionary<int, List<string>>();
@ -46,7 +48,7 @@ namespace PEIS.Utils
totalPingYins[i] = pinyins;
}
}
PingYinModel result = new PingYinModel();
foreach (var pinyins in totalPingYins)
{
var items = pinyins.Value;

@ -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);

@ -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();
}

@ -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

Loading…
Cancel
Save