From a5cd6013b33c2b0ac6f7fb16fb76b80c9855c5e7 Mon Sep 17 00:00:00 2001 From: LiJiaWen Date: Wed, 24 Dec 2025 09:26:51 +0800 Subject: [PATCH] =?UTF-8?q?=E9=87=8D=E5=86=99=E6=9B=B4=E6=96=B0=E7=A8=8B?= =?UTF-8?q?=E5=BA=8F=E5=92=8C=E4=B8=80=E4=BA=9B=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1.重写了更新程序 2.身份证阅读器接口增加SW100 3.FastReport组件汉化 4.修正撤回发送科室时SQL语句 5.修正分检生成小结时结论重复的BUG --- PEIS.sln | 35 +- PEIS/App.config | 44 +- .../Enrollment/EnrollmentPatientModel.cs | 2 +- PEIS/Model/Exam/PartModel.cs | 5 +- PEIS/PEIS.csproj | 59 +- PEIS/Program.cs | 15 +- PEIS/Utils/Global.cs | 10 + PEIS/Utils/IDCard/IDCardHelper.cs | 79 + PEIS/Utils/{ => IDCard}/SS860/IMAGE.cs | 2 +- .../Utils/{ => IDCard}/SS860/ReadCardAPI64.cs | 4 +- .../Utils/{ => IDCard}/SS860/ReadCardAPI86.cs | 4 +- PEIS/Utils/{ => IDCard}/SS860/ReadCardInfo.cs | 18 +- PEIS/Utils/IDCard/SW100/SW100.cs | 158 ++ PEIS/Utils/SS860/RdCardModel.cs | 111 -- PEIS/Utils/SS860/ReadSs628.cs | 283 --- PEIS/Utils/VersionHelper.cs | 139 +- PEIS/View/Base/NewPersonForm.cs | 27 +- PEIS/View/CountdownMessageBox.Designer.cs | 40 + PEIS/View/CountdownMessageBox.cs | 79 + PEIS/View/Enrollment/EnrollmentOrgForm.cs | 2 +- .../EnrollmentPersonForm.Designer.cs | 25 +- PEIS/View/Enrollment/EnrollmentPersonForm.cs | 4 +- .../Enrollment/NewEnrollmentPersonForm.cs | 4 +- .../FastReport/Chinese (Simplified).frl | 1510 +++++++++++++++++ .../Utils => Third}/SS860/RDCard64/RdCard.dll | Bin .../Utils => Third}/SS860/RDCard64/WltRS.dll | Bin .../SS860/RDCard64/license.dat | 0 .../SS860/RDCard64/msvcr100.dll | Bin .../Utils => Third}/SS860/RDCard64/sdtapi.dll | Bin .../Utils => Third}/SS860/RDCard64/unpack.dll | Bin .../Utils => Third}/SS860/RDCard86/RdCard.dll | Bin .../Utils => Third}/SS860/RDCard86/WltRS.dll | Bin .../SS860/RDCard86/license.dat | 0 .../Utils => Third}/SS860/RDCard86/sdtapi.dll | Bin Third/SW100/BmpToJpg.dll | Bin 0 -> 28672 bytes Third/SW100/Device.dll | Bin 0 -> 167936 bytes Third/SW100/SSCARDInterface.dll | Bin 0 -> 409600 bytes Third/SW100/SSSE32.dll | Bin 0 -> 241664 bytes Third/SW100/SW100.dll | Bin 0 -> 241664 bytes Third/SW100/TestCard.exe | Bin 0 -> 49152 bytes Third/SW100/UnPack.dll | Bin 0 -> 122880 bytes Third/SW100/zpp.bmp | Bin 0 -> 38862 bytes Third/SW100/接口说明.doc | Bin 0 -> 199680 bytes Update/App.config | 7 + Update/CountdownMessageBox.Designer.cs | 40 + Update/CountdownMessageBox.cs | 85 + Update/Form1.Designer.cs | 79 - Update/Form1.cs | 168 -- Update/MainFrom.Designer.cs | 95 ++ Update/MainFrom.cs | 241 +++ Update/{Form1.resx => MainFrom.resx} | 3 + Update/Program.cs | 24 +- Update/Properties/AssemblyInfo.cs | 8 +- Update/Properties/Resources.Designer.cs | 69 +- Update/Properties/Resources.resx | 17 +- Update/Properties/Settings.Designer.cs | 3 +- Update/Update.csproj | 75 +- Update/packages.config | 4 - Update/update.png | Bin 6436 -> 0 bytes 59 files changed, 2624 insertions(+), 953 deletions(-) create mode 100644 PEIS/Utils/IDCard/IDCardHelper.cs rename PEIS/Utils/{ => IDCard}/SS860/IMAGE.cs (99%) rename PEIS/Utils/{ => IDCard}/SS860/ReadCardAPI64.cs (75%) rename PEIS/Utils/{ => IDCard}/SS860/ReadCardAPI86.cs (77%) rename PEIS/Utils/{ => IDCard}/SS860/ReadCardInfo.cs (93%) create mode 100644 PEIS/Utils/IDCard/SW100/SW100.cs delete mode 100644 PEIS/Utils/SS860/RdCardModel.cs delete mode 100644 PEIS/Utils/SS860/ReadSs628.cs create mode 100644 PEIS/View/CountdownMessageBox.Designer.cs create mode 100644 PEIS/View/CountdownMessageBox.cs create mode 100644 Third/FastReport/zh-CHS/FastReport/Chinese (Simplified).frl rename {PEIS/Utils => Third}/SS860/RDCard64/RdCard.dll (100%) rename {PEIS/Utils => Third}/SS860/RDCard64/WltRS.dll (100%) rename {PEIS/Utils => Third}/SS860/RDCard64/license.dat (100%) rename {PEIS/Utils => Third}/SS860/RDCard64/msvcr100.dll (100%) rename {PEIS/Utils => Third}/SS860/RDCard64/sdtapi.dll (100%) rename {PEIS/Utils => Third}/SS860/RDCard64/unpack.dll (100%) rename {PEIS/Utils => Third}/SS860/RDCard86/RdCard.dll (100%) rename {PEIS/Utils => Third}/SS860/RDCard86/WltRS.dll (100%) rename {PEIS/Utils => Third}/SS860/RDCard86/license.dat (100%) rename {PEIS/Utils => Third}/SS860/RDCard86/sdtapi.dll (100%) create mode 100644 Third/SW100/BmpToJpg.dll create mode 100644 Third/SW100/Device.dll create mode 100644 Third/SW100/SSCARDInterface.dll create mode 100644 Third/SW100/SSSE32.dll create mode 100644 Third/SW100/SW100.dll create mode 100644 Third/SW100/TestCard.exe create mode 100644 Third/SW100/UnPack.dll create mode 100644 Third/SW100/zpp.bmp create mode 100644 Third/SW100/接口说明.doc create mode 100644 Update/App.config create mode 100644 Update/CountdownMessageBox.Designer.cs create mode 100644 Update/CountdownMessageBox.cs delete mode 100644 Update/Form1.Designer.cs delete mode 100644 Update/Form1.cs create mode 100644 Update/MainFrom.Designer.cs create mode 100644 Update/MainFrom.cs rename Update/{Form1.resx => MainFrom.resx} (96%) delete mode 100644 Update/packages.config delete mode 100644 Update/update.png diff --git a/PEIS.sln b/PEIS.sln index e83cf14..61c0062 100644 --- a/PEIS.sln +++ b/PEIS.sln @@ -1,13 +1,16 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.33529.398 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.36324.18 MinimumVisualStudioVersion = 10.0.40219.1 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PEIS", "PEIS\PEIS.csproj", "{8980800E-6620-4B2E-A7DD-8C4651E1A344}" + ProjectSection(ProjectDependencies) = postProject + {12FE71E3-1E39-424C-8685-64EC743A248F} = {12FE71E3-1E39-424C-8685-64EC743A248F} + EndProjectSection EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "解决方案项", "解决方案项", "{AB0394FA-735E-4213-9ACE-31C02F698FA7}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Update", "Update\Update.csproj", "{8894C92C-210D-459C-B5CD-7A6D2AB4CBE5}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Update", "Update\Update.csproj", "{12FE71E3-1E39-424C-8685-64EC743A248F}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -19,26 +22,26 @@ Global GlobalSection(ProjectConfigurationPlatforms) = postSolution {8980800E-6620-4B2E-A7DD-8C4651E1A344}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {8980800E-6620-4B2E-A7DD-8C4651E1A344}.Debug|Any CPU.Build.0 = Debug|Any CPU - {8980800E-6620-4B2E-A7DD-8C4651E1A344}.Debug|x86.ActiveCfg = Debug|Any CPU - {8980800E-6620-4B2E-A7DD-8C4651E1A344}.Debug|x86.Build.0 = Debug|Any CPU + {8980800E-6620-4B2E-A7DD-8C4651E1A344}.Debug|x86.ActiveCfg = Debug|x86 + {8980800E-6620-4B2E-A7DD-8C4651E1A344}.Debug|x86.Build.0 = Debug|x86 {8980800E-6620-4B2E-A7DD-8C4651E1A344}.Release|Any CPU.ActiveCfg = Release|Any CPU {8980800E-6620-4B2E-A7DD-8C4651E1A344}.Release|Any CPU.Build.0 = Release|Any CPU - {8980800E-6620-4B2E-A7DD-8C4651E1A344}.Release|x86.ActiveCfg = Release|Any CPU - {8980800E-6620-4B2E-A7DD-8C4651E1A344}.Release|x86.Build.0 = Release|Any CPU - {8894C92C-210D-459C-B5CD-7A6D2AB4CBE5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {8894C92C-210D-459C-B5CD-7A6D2AB4CBE5}.Debug|Any CPU.Build.0 = Debug|Any CPU - {8894C92C-210D-459C-B5CD-7A6D2AB4CBE5}.Debug|x86.ActiveCfg = Debug|Any CPU - {8894C92C-210D-459C-B5CD-7A6D2AB4CBE5}.Debug|x86.Build.0 = Debug|Any CPU - {8894C92C-210D-459C-B5CD-7A6D2AB4CBE5}.Release|Any CPU.ActiveCfg = Release|Any CPU - {8894C92C-210D-459C-B5CD-7A6D2AB4CBE5}.Release|Any CPU.Build.0 = Release|Any CPU - {8894C92C-210D-459C-B5CD-7A6D2AB4CBE5}.Release|x86.ActiveCfg = Release|Any CPU - {8894C92C-210D-459C-B5CD-7A6D2AB4CBE5}.Release|x86.Build.0 = Release|Any CPU + {8980800E-6620-4B2E-A7DD-8C4651E1A344}.Release|x86.ActiveCfg = Release|x86 + {8980800E-6620-4B2E-A7DD-8C4651E1A344}.Release|x86.Build.0 = Release|x86 + {12FE71E3-1E39-424C-8685-64EC743A248F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {12FE71E3-1E39-424C-8685-64EC743A248F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {12FE71E3-1E39-424C-8685-64EC743A248F}.Debug|x86.ActiveCfg = Debug|x86 + {12FE71E3-1E39-424C-8685-64EC743A248F}.Debug|x86.Build.0 = Debug|x86 + {12FE71E3-1E39-424C-8685-64EC743A248F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {12FE71E3-1E39-424C-8685-64EC743A248F}.Release|Any CPU.Build.0 = Release|Any CPU + {12FE71E3-1E39-424C-8685-64EC743A248F}.Release|x86.ActiveCfg = Release|x86 + {12FE71E3-1E39-424C-8685-64EC743A248F}.Release|x86.Build.0 = Release|x86 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection GlobalSection(NestedProjects) = preSolution - {8894C92C-210D-459C-B5CD-7A6D2AB4CBE5} = {AB0394FA-735E-4213-9ACE-31C02F698FA7} + {12FE71E3-1E39-424C-8685-64EC743A248F} = {AB0394FA-735E-4213-9ACE-31C02F698FA7} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {56DA78F6-DED1-4B17-AE1F-7DCF4A666388} diff --git a/PEIS/App.config b/PEIS/App.config index d8a4f3a..c275d0b 100644 --- a/PEIS/App.config +++ b/PEIS/App.config @@ -4,42 +4,26 @@
- + - - - - - - - - - - - - - - - - - - - - - + + + + + - + - - - - - - - + + + + + + + diff --git a/PEIS/Model/Enrollment/EnrollmentPatientModel.cs b/PEIS/Model/Enrollment/EnrollmentPatientModel.cs index 700ec10..42bc3f9 100644 --- a/PEIS/Model/Enrollment/EnrollmentPatientModel.cs +++ b/PEIS/Model/Enrollment/EnrollmentPatientModel.cs @@ -210,7 +210,7 @@ namespace PEIS.Model.Enrollment // 撤回发送到科室 public bool RecallDept(Int64 EId, String Name) { - var checkCost = $@"UPDATE Enrollment_CheckCost SET SendTime = null, SenderCode = null, Sender = null WHERE EID = {EId} AND SendTime is not null AND DeleteTime is null AND WeChatCostTime is null"; + var checkCost = $@"UPDATE Enrollment_CheckCost SET SendTime = null, SenderCode = null, Sender = null WHERE EID = {EId} AND SendTime is not null AND DeleteTime is null"; var enrollmentPatient = $@"UPDATE Enrollment_Patient SET SignTime = null, SignerCode = null, Signer = null WHERE ID = {EId} AND SignTime is not null"; var enrollmentFeeItem = $@"UPDATE a SET a.IsSend = 0 FROM Enrollment_FeeItem a LEFT JOIN Enrollment_CheckCost b ON a.OrderNO = b.ID AND a.EID = b.EID WHERE b.SendTime IS NULL AND a.EID = {EId}"; diff --git a/PEIS/Model/Exam/PartModel.cs b/PEIS/Model/Exam/PartModel.cs index 63c4eab..360dbda 100644 --- a/PEIS/Model/Exam/PartModel.cs +++ b/PEIS/Model/Exam/PartModel.cs @@ -110,7 +110,7 @@ SELECT END AS STATUS FROM StatusData WHERE rn = 1 -- 每个eid只取最新的一行"; - + var data = DAOHelp.GetDataBySQL(sql).OrderByDescending(o => o.SignTime).ToList(); return data; @@ -307,6 +307,9 @@ FROM StatusData;"; };*/ #endregion + //先清除旧的结论 + DAOHelp.ExecuteSql($@" DELETE FROM Exam_Conclusion WHERE PID ={part.ID} AND EID={eid};"); + var index = 1; results.GroupBy(g => g.FeeItemName).ToList().ForEach(items => { diff --git a/PEIS/PEIS.csproj b/PEIS/PEIS.csproj index 49417e0..f48ef9c 100644 --- a/PEIS/PEIS.csproj +++ b/PEIS/PEIS.csproj @@ -61,6 +61,24 @@ PEIS.Program + + true + bin\x86\Debug\ + DEBUG;TRACE + full + x86 + 7.3 + prompt + + + bin\x86\Release\ + TRACE + true + pdbonly + x86 + 7.3 + prompt + @@ -310,20 +328,20 @@ + + - - - - - + + + + - @@ -368,6 +386,12 @@ SelectPatientForm.cs + + Form + + + CountdownMessageBox.cs + Form @@ -807,8 +831,6 @@ PreserveNewest - - @@ -834,14 +856,6 @@ PreserveNewest - - - - - - - - PreserveNewest @@ -929,6 +943,17 @@ - xcopy $(SolutionDir)Third\DevExpress\ $(TargetDir) /e /y + + + + + :: Update目录 +xcopy "$(SolutionDir)Update\bin\$(ConfigurationName)\" "$(TargetDir)Update\" /e /y +:: 汉化目录 +xcopy "$(SolutionDir)Third\DevExpress\" "$(TargetDir)" /e /y +xcopy "$(SolutionDir)Third\FastReport\" "$(TargetDir)" /e /y +:: 设备目录 +xcopy "$(SolutionDir)Third\SW100\" "$(TargetDir)SW100\" /e /y +xcopy "$(SolutionDir)Third\SS860\" "$(TargetDir)SS860\" /e /y \ No newline at end of file diff --git a/PEIS/Program.cs b/PEIS/Program.cs index c4012c6..52da5a1 100644 --- a/PEIS/Program.cs +++ b/PEIS/Program.cs @@ -14,7 +14,7 @@ namespace PEIS /// 应用程序的主入口点。 /// [STAThread] - static void Main() + static void Main(string[] args) { //var test = new TestView(); //test.ShowDialog(); @@ -35,14 +35,16 @@ namespace PEIS //汉化Dev组件 ForceLoadDevExpressLocalization(); + //汉化FastReport组件 + ForceLoadFastReportLocalization(); Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); CacheDataModel.GetConfig(); - VersionHelper.CheckUpdate(); + VersionHelper.CheckUpdate(args.Length > 0 ? args[0] : null); + var login = new LoginForm(); login.ShowDialog(); - if (login.DialogResult == DialogResult.OK) { //ThreadPool.QueueUserWorkItem(state => CacheDataModel.GetConfig()); @@ -56,6 +58,13 @@ namespace PEIS } } + private static void ForceLoadFastReportLocalization() + { + string chineseSimpleFrl = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "zh-CHS", "FastReport", "Chinese (Simplified).frl"); + FastReport.Utils.Res.LoadLocale(chineseSimpleFrl); + + } + private static void ForceLoadDevExpressLocalization() { diff --git a/PEIS/Utils/Global.cs b/PEIS/Utils/Global.cs index bd1942f..d7cfd22 100644 --- a/PEIS/Utils/Global.cs +++ b/PEIS/Utils/Global.cs @@ -56,6 +56,16 @@ namespace PEIS.Utils return Global._lstConfig.FirstOrDefault(x => x.Key == "UseGroupFeeItemsInTeamReport")?.Value ?? "0"; } } + /// + /// 身份证阅读器 + /// + public static string IDReader + { + get + { + return Global._lstConfig.FirstOrDefault(x => x.Key == "IDReader")?.Value ?? ""; + } + } /// /// 配置信息 diff --git a/PEIS/Utils/IDCard/IDCardHelper.cs b/PEIS/Utils/IDCard/IDCardHelper.cs new file mode 100644 index 0000000..b2e59a0 --- /dev/null +++ b/PEIS/Utils/IDCard/IDCardHelper.cs @@ -0,0 +1,79 @@ +using System; +using System.Collections.Generic; +using System.Drawing; +using System.Linq; +using System.Text; + +namespace PEIS.Utils.IDCard +{ + public static class IDCardHelper + { + public static IDCardInfo Read() + { + IDCardInfo info = null; + switch (Global.IDReader) + { + case "SW100": + info = SW100.SW100.ReadIDCard(); + break; + default: + info = SS860.ReadCardInfo.Get(); + break; + } + return info; + } + } + + public class IDCardInfo + { + /// +        /// 姓名 +        /// +        public string NAME { get; set; } + +        /// +        /// 性别 +        /// +        public string SEX { get; set; } + +        /// +        /// 民族 +        /// +        public string NATION { get; set; } + +        /// +        /// 住址 +        /// +        public string ADDRESS { get; set; } + +        /// +        /// 签发机关 +        /// +        public string ISSUE_AUTH { get; set; } + +        /// +        /// 有效期开始日期 +        /// +        public DateTime BEGIN_DATE { get; set; } + +        /// +        /// 有效期结束日期 +        /// +        public DateTime END_DATE { get; set; } + +        /// +        /// 身份证号码 +        /// +        public string IDNO { get; set; } + +        /// +        /// 生日 +        /// +        public DateTime BIRTH { get; set; } + +        /// +        /// 头像 +        /// +        public Bitmap HEADPORTRAIT { get; set; } + } +} diff --git a/PEIS/Utils/SS860/IMAGE.cs b/PEIS/Utils/IDCard/SS860/IMAGE.cs similarity index 99% rename from PEIS/Utils/SS860/IMAGE.cs rename to PEIS/Utils/IDCard/SS860/IMAGE.cs index f1d32f3..0864194 100644 --- a/PEIS/Utils/SS860/IMAGE.cs +++ b/PEIS/Utils/IDCard/SS860/IMAGE.cs @@ -3,7 +3,7 @@ using System.Drawing; using System.IO; using System.Windows.Forms; -namespace PEIS.Utils.SS860 +namespace PEIS.Utils.IDCard.SS860 { class IMAGE { diff --git a/PEIS/Utils/SS860/ReadCardAPI64.cs b/PEIS/Utils/IDCard/SS860/ReadCardAPI64.cs similarity index 75% rename from PEIS/Utils/SS860/ReadCardAPI64.cs rename to PEIS/Utils/IDCard/SS860/ReadCardAPI64.cs index 5163094..96064d2 100644 --- a/PEIS/Utils/SS860/ReadCardAPI64.cs +++ b/PEIS/Utils/IDCard/SS860/ReadCardAPI64.cs @@ -1,13 +1,13 @@ using System.Runtime.InteropServices; -namespace PEIS.Utils.SS860 +namespace PEIS.Utils.IDCard.SS860 { /// /// 神思二代读卡器API函数 /// public class ReadCardApi64 { - [DllImport("./RDCard64/RdCard.DLL")] + [DllImport("./SS860/RDCard64/RdCard.DLL")] public static extern int UCommand1(string pcmd, ref int arg0, ref int arg1, byte[] arg3); } } diff --git a/PEIS/Utils/SS860/ReadCardAPI86.cs b/PEIS/Utils/IDCard/SS860/ReadCardAPI86.cs similarity index 77% rename from PEIS/Utils/SS860/ReadCardAPI86.cs rename to PEIS/Utils/IDCard/SS860/ReadCardAPI86.cs index 425f120..6317368 100644 --- a/PEIS/Utils/SS860/ReadCardAPI86.cs +++ b/PEIS/Utils/IDCard/SS860/ReadCardAPI86.cs @@ -1,6 +1,6 @@ using System.Runtime.InteropServices; -namespace PEIS.Utils.SS860 +namespace PEIS.Utils.IDCard.SS860 { ///     /// 神思二代读卡器API函数 @@ -8,7 +8,7 @@ namespace PEIS.Utils.SS860     public class ReadCardApi86 {         - [DllImport("./RDCard86/RdCard.DLL")] + [DllImport("./SS860/RDCard86/RdCard.DLL")] public static extern int UCommand1(string pcmd, ref int arg0, ref int arg1, byte[] arg3); } diff --git a/PEIS/Utils/SS860/ReadCardInfo.cs b/PEIS/Utils/IDCard/SS860/ReadCardInfo.cs similarity index 93% rename from PEIS/Utils/SS860/ReadCardInfo.cs rename to PEIS/Utils/IDCard/SS860/ReadCardInfo.cs index 6574b34..483d411 100644 --- a/PEIS/Utils/SS860/ReadCardInfo.cs +++ b/PEIS/Utils/IDCard/SS860/ReadCardInfo.cs @@ -6,14 +6,14 @@ using System.IO; using System.Text; using System.Windows.Forms; -namespace PEIS.Utils.SS860 +namespace PEIS.Utils.IDCard.SS860 { /// /// 读卡相关类 /// public class ReadCardInfo { - public static RdCardModel Get() + public static IDCardInfo Get() { //Win64/Win32 return Environment.Is64BitOperatingSystem ? ReadCard() : ReadCard86(); @@ -22,9 +22,9 @@ namespace PEIS.Utils.SS860 /// 读取卡内容--表示层应用 /// /// - private static RdCardModel ReadCard() + private static IDCardInfo ReadCard() { - RdCardModel model = null; + IDCardInfo model = null; var pcmd = Char.ConvertFromUtf32(0x41); var result = Application.StartupPath + "\\"; @@ -55,9 +55,9 @@ namespace PEIS.Utils.SS860 /// /// 错误信息 /// - private static RdCardModel ReadCard86() + private static IDCardInfo ReadCard86() { - RdCardModel model = null; + IDCardInfo model = null; var pcmd = Char.ConvertFromUtf32(0x41); var result = Application.StartupPath + "\\"; @@ -87,9 +87,9 @@ namespace PEIS.Utils.SS860 /// 读取生成文件内容 /// /// - private static RdCardModel GetCardInfo() + private static IDCardInfo GetCardInfo() { - var model = new RdCardModel(); + IDCardInfo model = new IDCardInfo(); var infoPath = Application.StartupPath + "\\wz.txt"; //string NewAddressPath = Application.StartupPath + "\\NewAdd.txt"; var binPath = Application.StartupPath + "\\fp.bin"; @@ -118,7 +118,7 @@ namespace PEIS.Utils.SS860 if (list.Count == 9) { model.NAME = list[0];//姓名 - model.SEX = list[1] == "女" ? 2 : 1; //性别 + model.SEX = list[1];//性别 model.NATION = list[2];//民族 model.BIRTH = DateTime.ParseExact(list[3], "yyyyMMdd", CultureInfo.InvariantCulture); model.ADDRESS = list[4];//住址 diff --git a/PEIS/Utils/IDCard/SW100/SW100.cs b/PEIS/Utils/IDCard/SW100/SW100.cs new file mode 100644 index 0000000..418d04d --- /dev/null +++ b/PEIS/Utils/IDCard/SW100/SW100.cs @@ -0,0 +1,158 @@ +using System; +using System.Collections.Generic; +using System.Drawing; +using System.Globalization; +using System.IO; +using System.Linq; +using System.Runtime.InteropServices; +using System.Text; + +namespace PEIS.Utils.IDCard.SW100 +{ + public static class SW100 + { + #region DLL导入声明 + + [DllImport("./SW100/SSCARDInterface.dll", EntryPoint = "iOpenPort")] + public static extern int iOpenPort(StringBuilder errMsg); + + [DllImport("./SW100/SSCARDInterface.dll", EntryPoint = "iClosePort")] + public static extern int iClosePort(); + + [DllImport("./SW100/SSCARDInterface.dll", EntryPoint = "iReaderIDCard_CS")] + public static extern int iReaderIDCard_CS(StringBuilder bmpFilePath, StringBuilder cardInfo, StringBuilder base64Info, StringBuilder errMsg); + + [DllImport("./SW100/SSCARDInterface.dll", EntryPoint = "iPosBeep")] + public static extern int iPosBeep(); + + #endregion + + private const int BUFFER_SIZE = 1024; + + /// + /// 打开设备 + /// + /// 打开结果 + private static bool OpenDevice() + { + try + { + StringBuilder errMsg = new StringBuilder(BUFFER_SIZE); + int result = iOpenPort(errMsg); + + if (result == 0) + { + return true; + } + else + { + Global.MsgErr($"设备打开失败:{errMsg}"); + return false; + } + } + catch (Exception ex) + { + Global.MsgErr($"设备打开失败:{ex.Message}"); + return false; + } + } + + /// + /// 关闭设备 + /// + /// 关闭结果 + private static bool CloseDevice() + { + try + { + int result = iClosePort(); + + if (result == 0) + { + return true; + } + else + { + Global.MsgErr($"设备关闭失败"); + return false; + } + } + catch (Exception ex) + { + Global.MsgErr($"设备关闭失败:{ex.Message}"); + return false; + } + } + + /// + /// 读取身份证信息 + /// + /// 照片保存路径,例如:D:\zp.bmp + /// 身份证信息 + public static IDCardInfo ReadIDCard() + { + + IDCardInfo idCardInfo = null; + if (OpenDevice()) + { + try + { + + // 设置默认照片路径 + StringBuilder photoSavePath = new StringBuilder(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "idcard_photo.bmp")); + + // 准备缓冲区 + StringBuilder cardInfoBuffer = new StringBuilder(BUFFER_SIZE); + StringBuilder dspBuffer = new StringBuilder(BUFFER_SIZE * 10); + StringBuilder errMsgBuffer = new StringBuilder(BUFFER_SIZE); + + // 调用读取方法 + long result = iReaderIDCard_CS(photoSavePath, cardInfoBuffer, dspBuffer, errMsgBuffer); + + if (result == 0) + { + // 解析返回的数据 + string cardInfoStr = cardInfoBuffer.ToString(); + string[] infoArray = cardInfoStr.Split('|'); + + if (infoArray.Length >= 10) + { + idCardInfo = new IDCardInfo(); + idCardInfo.NAME = infoArray[0]; + idCardInfo.SEX = infoArray[1]; + idCardInfo.NATION = infoArray[2]; + idCardInfo.BIRTH = DateTime.ParseExact(infoArray[3], "yyyyMMdd", CultureInfo.InvariantCulture); + idCardInfo.ADDRESS = infoArray[4]; + idCardInfo.IDNO = infoArray[5]; + idCardInfo.ISSUE_AUTH = infoArray[6]; + idCardInfo.BEGIN_DATE = DateTime.ParseExact(infoArray[7], "yyyyMMdd", CultureInfo.InvariantCulture); + idCardInfo.END_DATE = DateTime.ParseExact(infoArray[8], "yyyyMMdd", CultureInfo.InvariantCulture); + using (var fs = new FileStream(photoSavePath.ToString(), FileMode.Open, FileAccess.Read)) + { + idCardInfo.HEADPORTRAIT = new Bitmap(fs); + } + } + else + { + Global.MsgErr($"返回的数据格式不正确"); + } + } + else + { + Global.MsgErr($"读取身份证失败:{ errMsgBuffer}"); + } + } + catch (Exception ex) + { + Global.MsgErr($"读取身份证时发生异常:{ex.Message}"); + } + finally + { + iPosBeep(); + CloseDevice(); + } + } + return idCardInfo; + } + } +} diff --git a/PEIS/Utils/SS860/RdCardModel.cs b/PEIS/Utils/SS860/RdCardModel.cs deleted file mode 100644 index f709092..0000000 --- a/PEIS/Utils/SS860/RdCardModel.cs +++ /dev/null @@ -1,111 +0,0 @@ -using System; -using System.Drawing; - -namespace PEIS.Utils.SS860 -{ - public class RdCardModel - { - private string nAME; -        /// -        /// 姓名 -        /// -        public string NAME - { - get { return nAME; } - set { nAME = value; } - } - private int sEX; -        /// -        /// 性别 -        /// -        public int SEX - { - get { return sEX; } - set { sEX = value; } - } - private string nATION; -        /// -        /// 民族 -        /// -        public string NATION - { - get { return nATION; } - set { nATION = value; } - } - private string aDDRESS; -        /// -        /// 住址 -        /// -        public string ADDRESS - { - get { return aDDRESS; } - set { aDDRESS = value; } - } - private string iSSUE_AUTH; -        /// -        /// 签发机关 -        /// -        public string ISSUE_AUTH - { - get { return iSSUE_AUTH; } - set { iSSUE_AUTH = value; } - } - private DateTime bEGIN_DATE; -        /// -        /// 有效期开始日期 -        /// -        public DateTime BEGIN_DATE - { - get { return bEGIN_DATE; } - set { bEGIN_DATE = value; } - } - private DateTime eND_DATE; -        /// -        /// 有效期结束日期 -        /// -        public DateTime END_DATE - { - get { return eND_DATE; } - set { eND_DATE = value; } - } - private string iDNO; -        /// -        /// 身份证号码 -        /// -        public string IDNO - { - get { return iDNO; } - set { iDNO = value; } - } - private string nEW_ADDR; -        /// -        /// 最新住址 -        /// -        public string NEW_ADDR - { - get { return nEW_ADDR; } - set { nEW_ADDR = value; } - } - private DateTime bIRTH; -        /// -        /// 生日 -        /// -        public DateTime BIRTH - { - get { return bIRTH; } - set { bIRTH = value; } - } - private Bitmap hEADPORTRAIT; -        /// -        /// 头像 -        /// -        public Bitmap HEADPORTRAIT - { - get { return hEADPORTRAIT; } - set { hEADPORTRAIT = value; } - } - - - } - -} diff --git a/PEIS/Utils/SS860/ReadSs628.cs b/PEIS/Utils/SS860/ReadSs628.cs deleted file mode 100644 index 2bd30a9..0000000 --- a/PEIS/Utils/SS860/ReadSs628.cs +++ /dev/null @@ -1,283 +0,0 @@ -using System; -using System.IO; -using System.Runtime.InteropServices; -using System.Text; - -namespace PEIS.Utils.SS860 -{ - public class WltRead - { - [DllImport("RdCard.dll", EntryPoint = "UCommand1", CharSet = CharSet.Ansi)] - private static extern int UCommand1(ref byte pCmd, ref int parg0, ref int parg1, byte[] parg2); - - - // - //初始化设备(串口:1-16, USB:1001-1016),为零自动找接口 - // - // (串口: 1 - 16, USB: 1001 - 1016) - //< returns > - public static bool InitCom(int nPort=0) - { - - string sMsg = string.Empty; - try - { - Byte cmd = 0x41; - int para0 = nPort; - int para1 = 8811; - byte[] para2 = { 0x02, 0x27, 0x00, 0x00 }; //9986 - int nRet = UCommand1(ref cmd, ref para0, ref para1, para2); - - if (nRet == 62171) - { - sMsg = "身份证读卡器连接成功"; - return true; - } - else - sMsg = "身份证读卡器连接失败!"; - } - catch (Exception ex) - { - sMsg = "身份证读卡器连接失败,原因是:" + ex.Message; - } - Console.WriteLine(sMsg); - return false; - - } - - // - // 关闭设备 - // - // - public static bool CloseCom(int nPort) - { - string sMsg = string.Empty; - try - { - Byte cmd = 0x42; - int para0 = nPort; - int para1 = 8811; - byte[] para2 = { 0x02, 0x27, 0x00, 0x00 }; //9986 - IntPtr ptrRet = Marshal.StringToHGlobalAnsi(UCommand1(ref cmd, ref para0, ref para1, para2).ToString()); - string retlust = Marshal.PtrToStringAnsi(ptrRet); - int nRet = int.Parse(retlust); - - if (nRet == 62171) - { - sMsg = "端口关闭成功"; - return true; - } - else - sMsg = "端口关闭失败!"; - } - catch (Exception ex) - { - sMsg = "端口关闭失败,原因是:" + ex.Message; - } - - return false; - } - - // - // 获取身份证信息 - // - // - // nInfoType=1,读基本信息;nInfoType=3,读追加地址 - // - public static CardInfo ReadCardInfo(int nPort)//, - { - string sMsg = string.Empty; - CardInfo objCardInfo = null; - string savePath =Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "IDCard"); - if (!Directory.Exists(savePath)) - { - Directory.CreateDirectory(savePath); - } - Random rd = new Random(); - int i = rd.Next() * 10; - savePath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "IDCard") + i; - try - { - - byte bCmd = 0x43;//验证信息 - int nPara0 = nPort; - int nPara1 = 8811; - byte[] nPara2 = { 0x02, 0x27, 0x00, 0x00 }; //9986 - int nRet = UCommand1(ref bCmd, ref nPara0, ref nPara1, nPara2);// 验证卡 - - if (nRet == 62171)//身份证验证成功 - { - bCmd = 68;// "0x44 读卡内信息 - nPara0 = nPort; - nPara1 = 8811; - - //如果要用sSavePath,请将sSavePath转换为ANSI编码格式。因为.net中的字符串是unicode格式,所以这里使用byte类型,内部逐字节进行赋值,最后一个是0 - //如,C:\a 调用后会生成a.txt a1.txt,a.bmp a1.wlt - // byte[] ctr = { (byte)"C", (byte)":", (byte)"\\", (byte)"a", (byte)"\0" }; - - byte[] ctr = Encoding.ASCII.GetBytes(savePath); - nRet = UCommand1(ref bCmd, ref nPara0, ref nPara1, ctr);//读取卡内信息 - - if (nRet == 62171) - { - - objCardInfo = new CardInfo(); - - System.IO.StreamReader objStreamReader = new System.IO.StreamReader(savePath + @"wx.txt", System.Text.Encoding.Default); - - objCardInfo.Name = objStreamReader.ReadLine(); - objCardInfo.Sex = objStreamReader.ReadLine(); - objCardInfo.Nation = objStreamReader.ReadLine(); - objCardInfo.Birthday = objStreamReader.ReadLine(); - objCardInfo.Address = objStreamReader.ReadLine(); - objCardInfo.CardNo = objStreamReader.ReadLine(); - objCardInfo.Department = objStreamReader.ReadLine(); - objCardInfo.StartDate = objStreamReader.ReadLine(); - //objCardInfo.EndDate = objStreamReader.ReadLine(); //身份证有效期"长期" - objCardInfo.AddressEx = objStreamReader.ReadLine(); - objCardInfo.PhotoPath = savePath + @"zp.bmp"; - - string sPhotoPath = objCardInfo.PhotoPath; - objCardInfo.ArrPhotoByte = ImageToByteArray(sPhotoPath); - - objStreamReader.Close(); - objStreamReader.Dispose(); - - return objCardInfo; - } - else if (nRet == -5) - sMsg = "返回值:" + nRet + "软件未授权!"; - else - { - sMsg = "返回值:" + nRet + "读身份证不成功"; - } - } - else - sMsg = "请将身份证放置感应区,谢谢合作!"; - } - catch (Exception ex) - { - sMsg = "读身份证失败,原因是:" + ex.Message; - Console.WriteLine(sMsg); - return null; - } - Console.WriteLine(sMsg); - return objCardInfo; - } - - // - // 将图片转换成字节 - // - // - // - private static Byte[] ImageToByteArray(string selectPictureFile) - { - //Image photo = new Bitmap(selectPictureFile); - System.IO.MemoryStream ms = new System.IO.MemoryStream(); - //photo.Save(ms, System.Drawing.Imaging.ImageFormat.Jpeg); - byte[] imagedata = ms.GetBuffer(); - - //ms.Close(); - //ms.Dispose(); - //photo.Dispose(); - return imagedata; - - } - } - - // - // 身份证的信息 - // - public class CardInfo - { - /// - /// 订单编号 - /// - public string OrderNo; - public int Id; - /// - /// 身份证号码 - /// - public string CardNo; - /// - /// 姓名 - /// - public string Name; - /// - /// 性别 - /// - public string Sex; - /// - /// 出生日期 - /// - public string Birthday; - /// - /// 地址 - /// - public string Address; - /// - /// 追加地址 - /// - public string AddressEx; - /// - /// 发卡机关 - /// - public string Department; - /// - /// 证件开始日期 - /// - public string StartDate; - /// - /// 证件结束日期 - /// - public string EndDate; - /// - /// 民族 - /// - public string Nation; - /// - /// 分店编号 - /// - public int ChainID; - /// - /// 相片路径 - /// - public string PhotoPath; - /// - /// 相片的字节信息 - /// - public byte[] ArrPhotoByte; - /// - /// 时时图片字节信息 - /// - public byte[] PhoTimeByte; - /// - /// 操作时间 - /// - public DateTime OpeTime; - /// - /// 操作人 - /// - public int UserID; - /// - /// 操作人 - /// - public string UserName; - /// - /// 入住人数 - /// - public int nMebCount; - /// - /// 提交状态,1:插入成功;0:插入失败 - /// - public string nState; - /// - /// 备注信息 - /// - public string sRemark; - /// - /// 客户端名称 - /// - public string ClientName; - } -} diff --git a/PEIS/Utils/VersionHelper.cs b/PEIS/Utils/VersionHelper.cs index 80ec809..96163cf 100644 --- a/PEIS/Utils/VersionHelper.cs +++ b/PEIS/Utils/VersionHelper.cs @@ -4,7 +4,9 @@ using System.Diagnostics; using System.IO; using System.Linq; using System.Net; +using System.Windows.Forms; using PEIS.Entity; +using PEIS.View; namespace PEIS.Utils { @@ -15,117 +17,60 @@ namespace PEIS.Utils /// /// 检查更新 /// - public static void CheckUpdate() + public static void CheckUpdate(string updateVersion) { - var version = Global._lstConfig.FirstOrDefault(x => x.Key == "Version")?.Value ?? ""; - var currentVersion = ConfigurationManager.AppSettings["Version"]; - if (string.IsNullOrEmpty(currentVersion) || string.IsNullOrEmpty(version) || currentVersion == version) - return; - - Download(version, currentVersion); - } - - private static void Download(string version, string currentVersion) - { - Global.MsgInfo($@"发现新版本:{version},启动更新"); - // var versionUrl = ConfigurationManager.AppSettings["VersionUrl"]; - var downloadUrl = ConfigurationManager.AppSettings["DownloadUrl"]; - //return; - try + if (string.IsNullOrEmpty(updateVersion)) { - if ((string.IsNullOrEmpty(version)) || (string.IsNullOrEmpty(currentVersion)) || currentVersion == version) return; - // 保存路径 - var savePath = Path.Combine(BasePath, "Update"); - if (!Directory.Exists(savePath)) - { - Directory.CreateDirectory(savePath); - } - //保存文件 - var zipFilePath = Path.Combine(savePath, version + ".zip"); - //解压路径 - var unZipPath = Path.Combine(BasePath, "Update", "UnZip"); - if (!Directory.Exists(unZipPath)) - { - Directory.CreateDirectory(unZipPath); - } - // 创建HttpWebRequest对象 - var request2 = (HttpWebRequest)WebRequest.Create(downloadUrl + $"?fileName={version}.zip"); - // 获取响应 - using (var response2 = (HttpWebResponse)request2.GetResponse()) - { - // 读取响应流 - using (var stream = response2.GetResponseStream()) - { - // 将响应保存到本地文件 - using (var fileStream = File.Create(zipFilePath)) - { - var buffer = new byte[4096]; - int bytesRead; - // 循环读取和写入,直到读取完整个响应流 - while ((bytesRead = stream.Read(buffer, 0, buffer.Length)) > 0) - { - // 写入文件流 - fileStream.Write(buffer, 0, bytesRead); - } - } - } - // Global.MsgInfo(@"更新文件下载完成!"); - } - // 解压文件 - UnZipAndReplace(zipFilePath, unZipPath); - // Global.MsgInfo(@"解压完成!"); - var path = Path.Combine(BasePath, "Update", "Update.exe"); - if (File.Exists(path)) - { - Process.Start(path); - } - else - { - Global.MsgErr(@"未找到更新程序!"); - } - Process.GetCurrentProcess().Kill(); + var remoteVersion = Global._lstConfig.FirstOrDefault(x => x.Key == "Version")?.Value ?? ""; + var localVersion = ConfigurationManager.AppSettings["Version"]; + if (string.IsNullOrEmpty(localVersion) || string.IsNullOrEmpty(remoteVersion) || localVersion == remoteVersion) + return; + + StartUpdate(remoteVersion); } - catch (Exception ex) + else { - Global.MsgErr($@"下载更新程序出错,{ex.Message}"); - Process.GetCurrentProcess().Kill(); + CopyUpdate(updateVersion); } } - /// - /// 解压文件到Update - /// - private static void UnZipAndReplace(string zipFilePath, string unZipPath) + private static void StartUpdate(string remoteVersion) + { + var messageBox = new CountdownMessageBox($"检测到新版本{remoteVersion}\r\n正在启动更新程序..."); + messageBox.ShowDialog(); + Process.Start(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Update", "Update.exe"), remoteVersion); + Environment.Exit(0); + } + + private static void CopyUpdate(string updateVersion) { - if (Directory.Exists(unZipPath)) Directory.Delete(unZipPath, true); - Directory.CreateDirectory(unZipPath); - if (!File.Exists(zipFilePath)) + string sourceDir = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Update", "Update", "UnZip", updateVersion, "Update"); + string destDir = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Update"); + if (Directory.Exists(sourceDir)) { - Global.MsgErr(@"更新文件下载失败,请重试!"); - return; + CopyFiles(sourceDir, destDir); } - //保存文件路径检查 - if (Directory.Exists(unZipPath)) - { - var di = new DirectoryInfo(unZipPath); + } - foreach (var file in di.EnumerateFiles()) - { - file.Delete(); - } - foreach (var dir in di.EnumerateDirectories()) - { - dir.Delete(true); - } - } - //解压 - using (var zipFile = new Ionic.Zip.ZipFile(zipFilePath)) + private static void CopyFiles(string sourceDir, string destDir) + { + // 复制当前目录的文件 + foreach (string sourceFile in Directory.GetFiles(sourceDir)) { - zipFile.ExtractAll(unZipPath); + string destFile = Path.Combine(destDir, Path.GetFileName(sourceFile)); + File.Copy(sourceFile, destFile, overwrite: true); } - //Directory.Delete(unZipPath, true);//删除压缩目录 - //File.Delete(zipFilePath);//删除压缩文件 + // 递归处理子目录 + foreach (string subDir in Directory.GetDirectories(sourceDir)) + { + + string destSubDir = Path.Combine(destDir, Path.GetFileName(subDir)); + Directory.CreateDirectory(destSubDir); + + CopyFiles(subDir, destSubDir); + } } + } } \ No newline at end of file diff --git a/PEIS/View/Base/NewPersonForm.cs b/PEIS/View/Base/NewPersonForm.cs index 8aa9a83..c37f501 100644 --- a/PEIS/View/Base/NewPersonForm.cs +++ b/PEIS/View/Base/NewPersonForm.cs @@ -8,9 +8,9 @@ using System.Collections.Generic; using System.Linq; using System.Text.RegularExpressions; using System.Threading; -using PEIS.Utils.SS860; using System.Windows.Forms; using System.Dynamic; +using PEIS.Utils.IDCard; namespace PEIS.View.Base { @@ -57,7 +57,7 @@ namespace PEIS.View.Base private void NameTextBox_TextChanged(object sender, EventArgs e) { - Contactor1.Text = NameTextBox.Text; + Contactor1.Text = NameTextBox.Text; } private void IDCard_Leave(object sender, EventArgs e) @@ -100,7 +100,7 @@ namespace PEIS.View.Base return; } - + // 提取出生日期 string year = IDCard.Text.Substring(6, 4); string month = IDCard.Text.Substring(10, 2); @@ -128,7 +128,8 @@ namespace PEIS.View.Base IDCard.ForeColor = System.Drawing.Color.Black; BirthdayDateTimePicker.Value = new DateTime(int.Parse(year), int.Parse(month), int.Parse(day)); - }catch(Exception) + } + catch (Exception) { Global.Msg("err", "身份证出生日期错误!"); return; @@ -155,12 +156,12 @@ namespace PEIS.View.Base { try { - var idCard = ReadCardInfo.Get(); + var idCard = IDCardHelper.Read(); if (idCard == null) return; NameTextBox.Text = idCard.NAME; - Male.Checked = idCard.SEX == 1 ? true : false; - Female.Checked = idCard.SEX == 2 ? true : false; + Male.Checked = idCard.SEX == "男" ? true : false; + Female.Checked = !Male.Checked; CardTypeComboBox.SelectedIndex = 0; IDCard.Text = idCard.IDNO; BirthdayDateTimePicker.Value = idCard.BIRTH; @@ -174,7 +175,7 @@ namespace PEIS.View.Base Global.MsgErr(a.Message); return; } - + } private void ConfirmBtn_Click(object sender, EventArgs e) @@ -250,7 +251,7 @@ namespace PEIS.View.Base Female.Checked = genderDigit % 2 == 0; } } - + if (BirthdayDateTimePicker.Value.Date == DateTime.Now.Date) { @@ -323,7 +324,7 @@ namespace PEIS.View.Base { OnIsExitBaseInfo(); Global.Msg("info", "添加成功!"); - _action(_patient); + _action(_patient); } else { @@ -380,14 +381,14 @@ namespace PEIS.View.Base public event EventHandler> IsExitBaseInfo; public void ShowIsExitBaseInfo(BasePatient item) { - Invoke(new Action(() => _patient = item )); + Invoke(new Action(() => _patient = item)); } protected virtual void OnIsExitBaseInfo() { IsExitBaseInfo?.Invoke(this, new Args { - Name = CardTypeComboBox.SelectedValue.ToString(), - Code = IDCard.Text.Trim() + Name = CardTypeComboBox.SelectedValue.ToString(), + Code = IDCard.Text.Trim() }); } diff --git a/PEIS/View/CountdownMessageBox.Designer.cs b/PEIS/View/CountdownMessageBox.Designer.cs new file mode 100644 index 0000000..886ea1e --- /dev/null +++ b/PEIS/View/CountdownMessageBox.Designer.cs @@ -0,0 +1,40 @@ + +namespace PEIS.View +{ + partial class CountdownMessageBox + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.components = new System.ComponentModel.Container(); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(800, 450); + this.Text = "CountdownMessageBox"; + } + + #endregion + } +} \ No newline at end of file diff --git a/PEIS/View/CountdownMessageBox.cs b/PEIS/View/CountdownMessageBox.cs new file mode 100644 index 0000000..8a3050c --- /dev/null +++ b/PEIS/View/CountdownMessageBox.cs @@ -0,0 +1,79 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Windows.Forms; + +namespace PEIS.View +{ + public partial class CountdownMessageBox : Form + { + private int _countdownSeconds = 3; + private System.Windows.Forms.Timer _countdownTimer; + + public CountdownMessageBox(string message, int seconds = 3) + { + // 设置窗体属性 + this.Text = "提示"; + this.StartPosition = FormStartPosition.CenterScreen; + this.FormBorderStyle = FormBorderStyle.FixedDialog; + this.MaximizeBox = false; + this.MinimizeBox = false; + this.ControlBox = false; + this.TopMost = true; + this.ShowInTaskbar = false; + this.Size = new Size(350, 150); + + // 消息文本 + Label lblMessage = new Label + { + Text = message, + Font = new Font("Microsoft YaHei", 10), + TextAlign = ContentAlignment.MiddleCenter, + Location = new Point(20, 40), + Size = new Size(310, 50), + AutoSize = false + }; + + // 倒计时文本 + Label lblCountdown = new Label + { + Text = $"({seconds}秒后自动关闭)", + Font = new Font("Microsoft YaHei", 9), + ForeColor = Color.Blue, + TextAlign = ContentAlignment.MiddleCenter, + Location = new Point(20, 100), + Size = new Size(310, 20), + AutoSize = false + }; + + // 将控件添加到窗体 + this.Controls.Add(lblMessage); + this.Controls.Add(lblCountdown); + + // 初始化计时器 + _countdownSeconds = seconds; + _countdownTimer = new System.Windows.Forms.Timer + { + Interval = 1000 + }; + _countdownTimer.Tick += (s, e) => + { + _countdownSeconds--; + lblCountdown.Text = $"({_countdownSeconds}秒后自动关闭)"; + + if (_countdownSeconds <= 0) + { + _countdownTimer.Stop(); + this.Close(); + } + }; + + // 窗体显示时开始倒计时 + this.Shown += (s, e) => _countdownTimer.Start(); + } + } +} diff --git a/PEIS/View/Enrollment/EnrollmentOrgForm.cs b/PEIS/View/Enrollment/EnrollmentOrgForm.cs index ecc8c00..b6eba61 100644 --- a/PEIS/View/Enrollment/EnrollmentOrgForm.cs +++ b/PEIS/View/Enrollment/EnrollmentOrgForm.cs @@ -980,7 +980,7 @@ namespace PEIS.View.Enrollment var eid = _chooseRegItem.ID; - if (_lstCheckCost?.Concat(_lstCheckCost2).Where(w => w.ChargeTime == null && w.EID == eid).ToList().Count != 0) + if (_lstCheckCost?.Concat(_lstCheckCost2).Where(w => w.ChargeTime == null && w.CostTime == null && w.EID == eid).ToList().Count != 0) { Global.Msg("info", "订单还未收费或未记账,不能操作,请核对后重试!"); return; diff --git a/PEIS/View/Enrollment/EnrollmentPersonForm.Designer.cs b/PEIS/View/Enrollment/EnrollmentPersonForm.Designer.cs index 1768f74..4614857 100644 --- a/PEIS/View/Enrollment/EnrollmentPersonForm.Designer.cs +++ b/PEIS/View/Enrollment/EnrollmentPersonForm.Designer.cs @@ -235,6 +235,7 @@ this.TsmiCopyFeeItem = new System.Windows.Forms.ToolStripMenuItem(); this.DgcCheckCost = new DevExpress.XtraGrid.GridControl(); this.DgvCheckCost = new DevExpress.XtraGrid.Views.Grid.GridView(); + this.gridColumn55 = new DevExpress.XtraGrid.Columns.GridColumn(); this.gridColumn53 = new DevExpress.XtraGrid.Columns.GridColumn(); this.repositoryItemMemoEdit3 = new DevExpress.XtraEditors.Repository.RepositoryItemMemoEdit(); this.RegListPanel.SuspendLayout(); @@ -316,7 +317,7 @@ this.gridColumn52.OptionsColumn.ReadOnly = true; this.gridColumn52.OptionsFilter.AllowFilter = false; this.gridColumn52.Visible = true; - this.gridColumn52.VisibleIndex = 15; + this.gridColumn52.VisibleIndex = 16; // // gridColumn118 // @@ -2767,6 +2768,7 @@ this.gridColumn36, this.gridColumn37, this.gridColumn38, + this.gridColumn55, this.gridColumn53, this.gridColumn52}); this.DgvCheckCost.FixedLineWidth = 1; @@ -2792,6 +2794,24 @@ this.DgvCheckCost.OptionsView.ShowIndicator = false; this.DgvCheckCost.RowHeight = 35; // + // gridColumn55 + // + this.gridColumn55.Caption = "微信预约缴费时间"; + this.gridColumn55.DisplayFormat.FormatString = "yyyy-MM-dd HH:mm:ss"; + this.gridColumn55.DisplayFormat.FormatType = DevExpress.Utils.FormatType.DateTime; + this.gridColumn55.FieldName = "WeChatCostTime"; + this.gridColumn55.Name = "gridColumn55"; + this.gridColumn55.OptionsColumn.AllowEdit = false; + this.gridColumn55.OptionsColumn.AllowGroup = DevExpress.Utils.DefaultBoolean.False; + this.gridColumn55.OptionsColumn.AllowMerge = DevExpress.Utils.DefaultBoolean.False; + this.gridColumn55.OptionsColumn.AllowMove = false; + this.gridColumn55.OptionsColumn.AllowSort = DevExpress.Utils.DefaultBoolean.False; + this.gridColumn55.OptionsColumn.Printable = DevExpress.Utils.DefaultBoolean.False; + this.gridColumn55.OptionsColumn.ReadOnly = true; + this.gridColumn55.OptionsFilter.AllowFilter = false; + this.gridColumn55.Visible = true; + this.gridColumn55.VisibleIndex = 14; + // // gridColumn53 // this.gridColumn53.Caption = "退费人"; @@ -2806,7 +2826,7 @@ this.gridColumn53.OptionsColumn.ReadOnly = true; this.gridColumn53.OptionsFilter.AllowFilter = false; this.gridColumn53.Visible = true; - this.gridColumn53.VisibleIndex = 14; + this.gridColumn53.VisibleIndex = 15; // // repositoryItemMemoEdit3 // @@ -3112,5 +3132,6 @@ private DevExpress.XtraGrid.Columns.GridColumn gridColumn54; private System.Windows.Forms.ContextMenuStrip FeeFastMenu; private System.Windows.Forms.ToolStripMenuItem PartOption; + private DevExpress.XtraGrid.Columns.GridColumn gridColumn55; } } \ No newline at end of file diff --git a/PEIS/View/Enrollment/EnrollmentPersonForm.cs b/PEIS/View/Enrollment/EnrollmentPersonForm.cs index df8a325..bb60cfc 100644 --- a/PEIS/View/Enrollment/EnrollmentPersonForm.cs +++ b/PEIS/View/Enrollment/EnrollmentPersonForm.cs @@ -218,7 +218,7 @@ namespace PEIS.View.Enrollment { e.Appearance.ForeColor = Color.FromArgb(234, 149, 24); } - if (_order.CostTime != null) + if (_order.CostTime != null || _order.WeChatCostTime != null) { e.Appearance.ForeColor = Color.ForestGreen; } @@ -707,7 +707,7 @@ namespace PEIS.View.Enrollment return; } - if (_lstCheckCost.Where(w => w.ChargeTime == null).ToList().Count != 0) + if (_lstCheckCost.Where(w => w.ChargeTime == null && w.CostTime == null && w.WeChatCostTime == null).ToList().Count != 0) { Global.Msg("info", "订单还未收费或未记账,不能操作,请核对后重试!"); return; diff --git a/PEIS/View/Enrollment/NewEnrollmentPersonForm.cs b/PEIS/View/Enrollment/NewEnrollmentPersonForm.cs index c003520..843564a 100644 --- a/PEIS/View/Enrollment/NewEnrollmentPersonForm.cs +++ b/PEIS/View/Enrollment/NewEnrollmentPersonForm.cs @@ -5,7 +5,7 @@ using PEIS.Entity; using PEIS.Event; using PEIS.Presenter; using PEIS.Utils; -using PEIS.Utils.SS860; +using PEIS.Utils.IDCard; using PEIS.View.Base; using System; using System.Collections.Generic; @@ -340,7 +340,7 @@ namespace PEIS.View.Enrollment try { - RdCardModel idCard = ReadCardInfo.Get(); + IDCardInfo idCard = IDCardHelper.Read(); if (idCard == null) return; NameTextBox.Text = idCard.IDNO; diff --git a/Third/FastReport/zh-CHS/FastReport/Chinese (Simplified).frl b/Third/FastReport/zh-CHS/FastReport/Chinese (Simplified).frl new file mode 100644 index 0000000..369f099 --- /dev/null +++ b/Third/FastReport/zh-CHS/FastReport/Chinese (Simplified).frl @@ -0,0 +1,1510 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + +