Просмотр исходного кода

调整医保对照查询报错

zzz 2 месяцев назад
Родитель
Сommit
a270c62cdd

+ 277 - 0
HuBeiMI/Common/EPPlusToExcel.cs

@@ -0,0 +1,277 @@
+
+using OfficeOpenXml;
+using OfficeOpenXml.Style;
+using System;
+using System.Data;
+using System.Drawing;
+using System.IO;
+using System.Linq;
+using System.Windows.Forms;
+
+namespace PTMedicalInsurance.Common
+{   
+
+    /// <summary>
+    /// EPPlus DataTable导出Excel工具类
+    /// 使用前需安装: Install-Package EPPlus
+    /// </summary>
+    public static class EPPlusExcelExporter
+    {
+        // 静态构造函数设置EPPlus许可证(EPPlus 5+需要)
+        static EPPlusExcelExporter()
+        {
+            // EPPlus 5+ 需要设置许可证类型
+            // 非商业用途使用:
+            ExcelPackage.LicenseContext = LicenseContext.NonCommercial;
+
+            // 商业用途请购买许可证后使用:
+            // ExcelPackage.LicenseContext = LicenseContext.Commercial;
+        }
+
+        /// <summary>
+        /// DataTable导出Excel(基础版本)
+        /// </summary>
+        /// <param name="dataTable">数据源</param>
+        /// <param name="filePath">导出路径</param>
+        /// <param name="sheetName">Sheet名称</param>
+        public static void ExportToExcel(DataTable dataTable, string filePath, string sheetName = "Sheet1")
+        {
+            if (dataTable == null || dataTable.Rows.Count == 0)
+                throw new ArgumentException("DataTable为空或没有数据");
+
+            // 确保目录存在
+            string directory = Path.GetDirectoryName(filePath);
+            if (!Directory.Exists(directory))
+                Directory.CreateDirectory(directory);
+
+            using (var package = new ExcelPackage())
+            {
+                var worksheet = package.Workbook.Worksheets.Add(sheetName);
+
+                // 写入数据(包含表头)
+                worksheet.Cells[1, 1].LoadFromDataTable(dataTable, true);
+
+                // 设置表头样式
+                FormatHeader(worksheet, dataTable.Columns.Count);
+
+                // 自动调整列宽
+                worksheet.Cells.AutoFitColumns();
+
+                // 保存文件
+                package.SaveAs(new FileInfo(filePath));
+            }
+        }
+
+        /// <summary>
+        /// DataTable导出Excel(分批处理版本 - 每500行处理一次)
+        /// </summary>
+        /// <param name="dataTable">数据源</param>
+        /// <param name="filePath">导出路径</param>
+        /// <param name="batchSize">每批处理行数(默认500)</param>
+        /// <param name="sheetName">Sheet名称</param>
+        public static void ExportToExcelBatch(DataTable dataTable, string filePath, int batchSize = 500)
+        {
+            string sheetName = "Sheet1";
+            if (dataTable == null || dataTable.Rows.Count == 0)
+                throw new ArgumentException("DataTable为空或没有数据");
+
+            // 确保目录存在
+            string directory = Path.GetDirectoryName(filePath);
+            if (!Directory.Exists(directory))
+                Directory.CreateDirectory(directory);
+
+            int totalRows = dataTable.Rows.Count;
+            int columnCount = dataTable.Columns.Count;
+
+            using (var package = new ExcelPackage())
+            {
+                var worksheet = package.Workbook.Worksheets.Add(sheetName);
+
+                // 写入表头
+                for (int col = 0; col < columnCount; col++)
+                {
+                    worksheet.Cells[1, col + 1].Value = dataTable.Columns[col].ColumnName;
+                }
+                FormatHeader(worksheet, columnCount);
+
+                // 分批写入数据
+                int currentRow = 2; // 从第2行开始(第1行是表头)
+                int batchCount = (int)Math.Ceiling((double)totalRows / batchSize);
+
+                Console.WriteLine($"总数据: {totalRows} 行, 分批: {batchCount} 批, 每批: {batchSize} 行");
+
+                for (int batch = 0; batch < batchCount; batch++)
+                {
+                    int startRow = batch * batchSize;
+                    int endRow = Math.Min(startRow + batchSize, totalRows);
+                    int rowsInBatch = endRow - startRow;
+
+                    Console.WriteLine($"处理第 {batch + 1}/{batchCount} 批: 行 {startRow + 1} - {endRow}");
+
+                    // 当前批次的数据数组
+                    object[,] batchData = new object[rowsInBatch, columnCount];
+
+                    for (int i = 0; i < rowsInBatch; i++)
+                    {
+                        for (int j = 0; j < columnCount; j++)
+                        {
+                            batchData[i, j] = dataTable.Rows[startRow + i][j];
+                        }
+                    }
+
+                    // 写入当前批次到Excel
+                    var range = worksheet.Cells[currentRow, 1, currentRow + rowsInBatch - 1, columnCount];
+                    range.Value = batchData;
+
+                    currentRow += rowsInBatch;
+                }
+
+                // 格式化数据区域
+                FormatDataRange(worksheet, totalRows, columnCount);
+
+                // 自动调整列宽
+                worksheet.Cells.AutoFitColumns();
+
+                // 冻结首行
+                worksheet.View.FreezePanes(2, 1);
+
+                // 保存文件
+                package.SaveAs(new FileInfo(filePath));
+                Console.WriteLine($"导出完成: {filePath}");
+                MessageBox.Show("  导出完毕:"+filePath);
+            }
+        }
+
+        /// <summary>
+        /// 大数据导出(自动分Sheet,每个Sheet最多100万行)
+        /// </summary>
+        public static void ExportLargeData(DataTable dataTable, string filePath, int rowsPerSheet = 1000000)
+        {
+            if (dataTable == null || dataTable.Rows.Count == 0)
+                throw new ArgumentException("DataTable为空或没有数据");
+
+            string directory = Path.GetDirectoryName(filePath);
+            if (!Directory.Exists(directory))
+                Directory.CreateDirectory(directory);
+
+            int totalRows = dataTable.Rows.Count;
+            int columnCount = dataTable.Columns.Count;
+            int sheetCount = (int)Math.Ceiling((double)totalRows / rowsPerSheet);
+
+            using (var package = new ExcelPackage())
+            {
+                for (int sheetIndex = 0; sheetIndex < sheetCount; sheetIndex++)
+                {
+                    string sheetName = sheetCount == 1 ? "数据" : $"数据_{sheetIndex + 1}";
+                    var worksheet = package.Workbook.Worksheets.Add(sheetName);
+
+                    // 当前Sheet的数据范围
+                    int startRow = sheetIndex * rowsPerSheet;
+                    int endRow = Math.Min(startRow + rowsPerSheet, totalRows);
+                    int rowsInSheet = endRow - startRow;
+
+                    // 写入表头
+                    for (int col = 0; col < columnCount; col++)
+                    {
+                        worksheet.Cells[1, col + 1].Value = dataTable.Columns[col].ColumnName;
+                    }
+                    FormatHeader(worksheet, columnCount);
+
+                    // 分批写入数据(每批500行)
+                    int batchSize = 500;
+                    int currentRow = 2;
+                    int batchesInSheet = (int)Math.Ceiling((double)rowsInSheet / batchSize);
+
+                    for (int batch = 0; batch < batchesInSheet; batch++)
+                    {
+                        int batchStart = startRow + batch * batchSize;
+                        int batchEnd = Math.Min(batchStart + batchSize, endRow);
+                        int rowsInBatch = batchEnd - batchStart;
+
+                        object[,] batchData = new object[rowsInBatch, columnCount];
+                        for (int i = 0; i < rowsInBatch; i++)
+                        {
+                            for (int j = 0; j < columnCount; j++)
+                            {
+                                batchData[i, j] = dataTable.Rows[batchStart + i][j];
+                            }
+                        }
+
+                        var range = worksheet.Cells[currentRow, 1, currentRow + rowsInBatch - 1, columnCount];
+                        range.Value = batchData;
+                        currentRow += rowsInBatch;
+                    }
+
+                    FormatDataRange(worksheet, rowsInSheet, columnCount);
+                    worksheet.Cells.AutoFitColumns();
+                    worksheet.View.FreezePanes(2, 1);
+                }
+
+                package.SaveAs(new FileInfo(filePath));
+            }
+        }
+
+        /// <summary>
+        /// DataTable转内存流(适用于Web下载)
+        /// </summary>
+        public static MemoryStream ExportToStream(DataTable dataTable, string sheetName = "Sheet1")
+        {
+            if (dataTable == null || dataTable.Rows.Count == 0)
+                throw new ArgumentException("DataTable为空或没有数据");
+
+            using (var package = new ExcelPackage())
+            {
+                var worksheet = package.Workbook.Worksheets.Add(sheetName);
+                worksheet.Cells[1, 1].LoadFromDataTable(dataTable, true);
+                FormatHeader(worksheet, dataTable.Columns.Count);
+                worksheet.Cells.AutoFitColumns();
+
+                var stream = new MemoryStream();
+                package.SaveAs(stream);
+                stream.Position = 0;
+                return stream;
+            }
+        }
+
+        #region 私有方法
+
+        /// <summary>
+        /// 设置表头样式
+        /// </summary>
+        private static void FormatHeader(ExcelWorksheet worksheet, int columnCount)
+        {
+            var headerRange = worksheet.Cells[1, 1, 1, columnCount];
+
+            headerRange.Style.Font.Bold = true;
+            headerRange.Style.Font.Size = 11;
+            headerRange.Style.Fill.PatternType = ExcelFillStyle.Solid;
+            headerRange.Style.Fill.BackgroundColor.SetColor(Color.FromArgb(192, 192, 192)); // 灰色
+            headerRange.Style.HorizontalAlignment = ExcelHorizontalAlignment.Center;
+            headerRange.Style.VerticalAlignment = ExcelVerticalAlignment.Center;
+            headerRange.Style.Border.Bottom.Style = ExcelBorderStyle.Thin;
+        }
+
+        /// <summary>
+        /// 设置数据区域样式
+        /// </summary>
+        private static void FormatDataRange(ExcelWorksheet worksheet, int dataRows, int columnCount)
+        {
+            var dataRange = worksheet.Cells[2, 1, dataRows + 1, columnCount];
+
+            dataRange.Style.Font.Size = 10;
+            dataRange.Style.HorizontalAlignment = ExcelHorizontalAlignment.Left;
+            dataRange.Style.VerticalAlignment = ExcelVerticalAlignment.Center;
+
+            // 添加边框
+            dataRange.Style.Border.Top.Style = ExcelBorderStyle.Thin;
+            dataRange.Style.Border.Bottom.Style = ExcelBorderStyle.Thin;
+            dataRange.Style.Border.Left.Style = ExcelBorderStyle.Thin;
+            dataRange.Style.Border.Right.Style = ExcelBorderStyle.Thin;
+
+            // 设置行高
+            worksheet.DefaultRowHeight = 18;
+        }
+
+        #endregion
+    }
+}

+ 15 - 12
HuBeiMI/Forms/BasicData.cs

@@ -1708,7 +1708,7 @@ namespace PTMedicalInsurance.Forms
         private void btnExport_Click(object sender, EventArgs e)
         {
             //if (rbAll.Checked) return;
-            if (queryHISDirectory(1, 5000, out string errMsg) != 0)
+            if (queryHISDirectory(1, 1000, out string errMsg) != 0)
             {
                 MessageBox.Show(errMsg);
                 return;
@@ -1742,17 +1742,20 @@ namespace PTMedicalInsurance.Forms
                 }
 
                 string LSH = DateTime.Now.ToString("yyyyMMddHHMMss"); //DateTime.Now.ToString("MMddHHmmssffff");
-                string sFliePathName = @"D:\" + LSH +"【"+ directoryType + "】医保目录【"+ Maped + "】信息.xls";
-                string ReturnFileName = ExportToExcel.DataTabletoExcel(dtExport, sFliePathName);
-                if (ReturnFileName != "")
-                {
-                    MessageBox.Show("导出成功,文件保存路径:【" + ReturnFileName + "】");
-                    System.Diagnostics.Process.Start(ReturnFileName); //打开excel文件                
-                }
-                else
-                {
-                    MessageBox.Show("导出失败!");
-                }
+                string sFliePathName = @"D:\" + LSH +"【"+ directoryType + "】医保目录【"+ Maped + "】信息.xlsx";
+             
+                    
+             EPPlusExcelExporter.ExportToExcelBatch(dtExport, sFliePathName,500);
+           
+                //if (ReturnFileName != "")
+                //{
+                //    MessageBox.Show("导出成功,文件保存路径:【" + ReturnFileName + "】");
+                //    System.Diagnostics.Process.Start(ReturnFileName); //打开excel文件                
+                //}
+                //else
+                //{
+                //    MessageBox.Show("导出失败!");
+                //}
             }
         }
 

+ 19 - 19
HuBeiMI/Forms/SettlementChecklist.cs

@@ -811,26 +811,26 @@ namespace PTMedicalInsurance.Forms
                 JArray japatinsuinfo = JArray.Parse(JsonHelper.getDestValue(joRtnSettle, "result.data.patinsuinfo"));
 
                 //退费前卡余额
-                decimal BalanceBefore = Convert.ToDecimal(JsonHelper.getDestValue(joRtnSettle, "result.data.settlement[0].Balance")) - Convert.ToDecimal(JsonHelper.getDestValue(joRtnSettle, "result.data.settlement[0].AccountPaySumamt")) + Convert.ToDecimal(JsonHelper.getDestValue(joRtnSettle, "result.data.settlement[0].AccountMutualAidAmount"));
+                string BalanceBefore = Decimal.Round(Convert.ToDecimal(JsonHelper.getDestValue(joRtnSettle, "result.data.settlement[0].Balance")) - Convert.ToDecimal(JsonHelper.getDestValue(joRtnSettle, "result.data.settlement[0].AccountPaySumamt")) + Convert.ToDecimal(JsonHelper.getDestValue(joRtnSettle, "result.data.settlement[0].AccountMutualAidAmount")),2).ToString("0.00");
                 //退费撤销结算单负数显示
-                decimal LSumamt = Convert.ToDecimal(JsonHelper.getDestValue(joRtnSettle, "result.data.settlement[0].Sumamt")) * billtype;
-                decimal LFundPaySumamt = Convert.ToDecimal(JsonHelper.getDestValue(joRtnSettle, "result.data.settlement[0].FundPaySumamt")) * billtype;
-                decimal LHealthInsurancePay = Convert.ToDecimal(JsonHelper.getDestValue(joRtnSettle, "result.data.settlement[0].HealthInsurancePay")) * billtype;
-                decimal LLargeExpensesSupplementPay = Convert.ToDecimal(JsonHelper.getDestValue(joRtnSettle, "result.data.settlement[0].LargeExpensesSupplementPay")) * billtype;
-                decimal LSeriousIllnessPay = Convert.ToDecimal(JsonHelper.getDestValue(joRtnSettle, "result.data.settlement[0].SeriousIllnessPay")) * billtype;
-                decimal LMedicalAssistPay = Convert.ToDecimal(JsonHelper.getDestValue(joRtnSettle, "result.data.settlement[0].MedicalAssistPay")) * billtype;
-                decimal LEnterpriseSupplementPay = Convert.ToDecimal(JsonHelper.getDestValue(joRtnSettle, "result.data.settlement[0].EnterpriseSupplementPay")) * billtype;
-                decimal LOtherPay = Convert.ToDecimal(JsonHelper.getDestValue(joRtnSettle, "result.data.settlement[0].OtherPay")) * billtype;
-                decimal LCivilserviceAllowancePay = Convert.ToDecimal(JsonHelper.getDestValue(joRtnSettle, "result.data.settlement[0].CivilserviceAllowancePay")) * billtype;
-                decimal LDEZF = LLargeExpensesSupplementPay + LSeriousIllnessPay;
-                decimal LHospitalPartAmount = Convert.ToDecimal(JsonHelper.getDestValue(joRtnSettle, "result.data.settlement[0].HospitalPartAmount")) * billtype;
-                decimal LPersonPaySumamt = Convert.ToDecimal(JsonHelper.getDestValue(joRtnSettle, "result.data.settlement[0].PersonPaySumamt")) * billtype;
-                decimal LAccountPaySumamt = Convert.ToDecimal(JsonHelper.getDestValue(joRtnSettle, "result.data.settlement[0].AccountPaySumamt")) * billtype;
-                decimal LPersonCashPay = Convert.ToDecimal(JsonHelper.getDestValue(joRtnSettle, "result.data.settlement[0].PersonCashPay")) * billtype;
-                decimal LAccountMutualAidAmount = Convert.ToDecimal(JsonHelper.getDestValue(joRtnSettle, "result.data.settlement[0].AccountMutualAidAmount")) * billtype;
-
-
-                decimal LBlZf = Convert.ToDecimal(JsonHelper.getDestValue(joRtnSettle, "result.data.settlement[0].PersonPaySumamt")) - Convert.ToDecimal(JsonHelper.getDestValue(joRtnSettle, "result.data.settlement[0].OwnPayAmount")) - Convert.ToDecimal(JsonHelper.getDestValue(joRtnSettle, "result.data.settlement[0].PreSelfPayAmount")) - Convert.ToDecimal(JsonHelper.getDestValue(joRtnSettle, "result.data.settlement[0].OverLimitAmount")) - Convert.ToDecimal(JsonHelper.getDestValue(joRtnSettle, "result.data.settlement[0].ActualPayDeductible"));
+                string LSumamt = Decimal.Round(Convert.ToDecimal(JsonHelper.getDestValue(joRtnSettle, "result.data.settlement[0].Sumamt")) * billtype,2).ToString("0.00");
+                string LFundPaySumamt = Decimal.Round(Convert.ToDecimal(JsonHelper.getDestValue(joRtnSettle, "result.data.settlement[0].FundPaySumamt")) * billtype,2).ToString("0.00");
+                string LHealthInsurancePay = Decimal.Round(Convert.ToDecimal(JsonHelper.getDestValue(joRtnSettle, "result.data.settlement[0].HealthInsurancePay")) * billtype,2).ToString("0.00");
+                string LLargeExpensesSupplementPay = Decimal.Round(Convert.ToDecimal(JsonHelper.getDestValue(joRtnSettle, "result.data.settlement[0].LargeExpensesSupplementPay")) * billtype,2).ToString("0.00");
+                string LSeriousIllnessPay = Decimal.Round(Convert.ToDecimal(JsonHelper.getDestValue(joRtnSettle, "result.data.settlement[0].SeriousIllnessPay")) * billtype,2).ToString("0.00");
+                string LMedicalAssistPay = Decimal.Round(Convert.ToDecimal(JsonHelper.getDestValue(joRtnSettle, "result.data.settlement[0].MedicalAssistPay")) * billtype,2).ToString("0.00");
+                string LEnterpriseSupplementPay = Decimal.Round(Convert.ToDecimal(JsonHelper.getDestValue(joRtnSettle, "result.data.settlement[0].EnterpriseSupplementPay")) * billtype,2).ToString("0.00");
+                string LOtherPay = Decimal.Round(Convert.ToDecimal(JsonHelper.getDestValue(joRtnSettle, "result.data.settlement[0].OtherPay")) * billtype,2).ToString("0.00");
+                string LCivilserviceAllowancePay = Decimal.Round(Convert.ToDecimal(JsonHelper.getDestValue(joRtnSettle, "result.data.settlement[0].CivilserviceAllowancePay")) * billtype,2).ToString("0.00");
+                string LDEZF = Decimal.Round(Convert.ToDecimal(JsonHelper.getDestValue(joRtnSettle, "result.data.settlement[0].LargeExpensesSupplementPay")) * billtype + Convert.ToDecimal(JsonHelper.getDestValue(joRtnSettle, "result.data.settlement[0].SeriousIllnessPay")) * billtype, 2).ToString("0.00");
+                string LHospitalPartAmount = Decimal.Round(Convert.ToDecimal(JsonHelper.getDestValue(joRtnSettle, "result.data.settlement[0].HospitalPartAmount")) * billtype,2).ToString("0.00");
+                string LPersonPaySumamt = Decimal.Round(Convert.ToDecimal(JsonHelper.getDestValue(joRtnSettle, "result.data.settlement[0].PersonPaySumamt")) * billtype, 2).ToString("0.00");
+                string LAccountPaySumamt = Decimal.Round(Convert.ToDecimal(JsonHelper.getDestValue(joRtnSettle, "result.data.settlement[0].AccountPaySumamt")) * billtype, 2).ToString("0.00");
+                string LPersonCashPay = Decimal.Round(Convert.ToDecimal(JsonHelper.getDestValue(joRtnSettle, "result.data.settlement[0].PersonCashPay")) * billtype, 2).ToString("0.00");
+                string LAccountMutualAidAmount = Decimal.Round(Convert.ToDecimal(JsonHelper.getDestValue(joRtnSettle, "result.data.settlement[0].AccountMutualAidAmount")) * billtype, 2).ToString("0.00");
+
+
+                string LBlZf = Decimal.Round(Convert.ToDecimal(JsonHelper.getDestValue(joRtnSettle, "result.data.settlement[0].PersonPaySumamt")) - Convert.ToDecimal(JsonHelper.getDestValue(joRtnSettle, "result.data.settlement[0].OwnPayAmount")) - Convert.ToDecimal(JsonHelper.getDestValue(joRtnSettle, "result.data.settlement[0].PreSelfPayAmount")) - Convert.ToDecimal(JsonHelper.getDestValue(joRtnSettle, "result.data.settlement[0].OverLimitAmount")) - Convert.ToDecimal(JsonHelper.getDestValue(joRtnSettle, "result.data.settlement[0].ActualPayDeductible")), 2).ToString("0.00");
 
                 //转换金额大写
                 string Sumamt = FastReportFunction.MoneyToUpper(LSumamt.ToString());

+ 13 - 0
HuBeiMI/HuBeiMI.csproj

@@ -37,6 +37,15 @@
     <Reference Include="BouncyCastle.Crypto">
       <HintPath>packages\Portable.BouncyCastle.1.9.0\lib\net40\BouncyCastle.Crypto.dll</HintPath>
     </Reference>
+    <Reference Include="EPPlus, Version=7.7.3.0, Culture=neutral, PublicKeyToken=ea159fdaa78159a1, processorArchitecture=MSIL">
+      <HintPath>packages\EPPlus.7.7.3\lib\net462\EPPlus.dll</HintPath>
+    </Reference>
+    <Reference Include="EPPlus.Interfaces, Version=7.7.0.0, Culture=neutral, PublicKeyToken=a694d7f3b0907a61, processorArchitecture=MSIL">
+      <HintPath>packages\EPPlus.Interfaces.7.7.0\lib\net462\EPPlus.Interfaces.dll</HintPath>
+    </Reference>
+    <Reference Include="EPPlus.System.Drawing, Version=7.7.0.0, Culture=neutral, PublicKeyToken=2308d35469c9bac0, processorArchitecture=MSIL">
+      <HintPath>packages\EPPlus.System.Drawing.7.7.0\lib\net462\EPPlus.System.Drawing.dll</HintPath>
+    </Reference>
     <Reference Include="FastReport, Version=2023.1.8.0, Culture=neutral, PublicKeyToken=db7e5ce63278458c, processorArchitecture=MSIL">
       <SpecificVersion>False</SpecificVersion>
       <HintPath>bin\Debug\FastReport.dll</HintPath>
@@ -113,6 +122,9 @@
       <HintPath>packages\System.Runtime.CompilerServices.Unsafe.4.5.3\lib\net461\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
     </Reference>
     <Reference Include="System.Security" />
+    <Reference Include="System.Security.Cryptography.Xml, Version=8.0.0.3, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
+      <HintPath>packages\System.Security.Cryptography.Xml.8.0.3\lib\net462\System.Security.Cryptography.Xml.dll</HintPath>
+    </Reference>
     <Reference Include="System.Web.Extensions" />
     <Reference Include="System.Windows.Forms" />
     <Reference Include="System.Xml.Linq" />
@@ -212,6 +224,7 @@
     <Compile Include="Business\STA.cs" />
     <Compile Include="Common\AppExtension.cs" />
     <Compile Include="Common\CardReader.cs" />
+    <Compile Include="Common\EPPlusToExcel.cs" />
     <Compile Include="Common\FastReportFunction.cs" />
     <Compile Include="Common\ExPortToExcel.cs" />
     <Compile Include="Common\Common.cs" />

+ 4 - 0
HuBeiMI/app.config

@@ -21,6 +21,10 @@
         <assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
         <bindingRedirect oldVersion="0.0.0.0-12.0.0.0" newVersion="12.0.0.0" />
       </dependentAssembly>
+      <dependentAssembly>
+        <assemblyIdentity name="EPPlus.Interfaces" publicKeyToken="a694d7f3b0907a61" culture="neutral" />
+        <bindingRedirect oldVersion="0.0.0.0-8.4.0.0" newVersion="8.4.0.0" />
+      </dependentAssembly>
     </assemblyBinding>
   </runtime>
 <startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" /></startup></configuration>

+ 4 - 2
HuBeiMI/packages.config

@@ -1,8 +1,9 @@
 <?xml version="1.0" encoding="utf-8"?>
 <packages>
   <package id="Datatable.Activities.UiPath" version="1.0.1" targetFramework="net45" />
-  <package id="EPPlus.Interfaces" version="6.1.1" targetFramework="net472" />
-  <package id="EPPlus.System.Drawing" version="6.1.1" targetFramework="net472" />
+  <package id="EPPlus" version="7.7.3" targetFramework="net472" />
+  <package id="EPPlus.Interfaces" version="7.7.0" targetFramework="net472" />
+  <package id="EPPlus.System.Drawing" version="7.7.0" targetFramework="net472" />
   <package id="Microsoft.IO.RecyclableMemoryStream" version="3.0.1" targetFramework="net472" />
   <package id="Microsoft.Office.Excel" version="14.0.4760.1000" targetFramework="net45" />
   <package id="Microsoft.Office.Interop.Excel" version="15.0.4795.1001" targetFramework="net45" />
@@ -15,4 +16,5 @@
   <package id="System.Memory" version="4.5.5" targetFramework="net472" />
   <package id="System.Numerics.Vectors" version="4.5.0" targetFramework="net472" />
   <package id="System.Runtime.CompilerServices.Unsafe" version="4.5.3" targetFramework="net472" />
+  <package id="System.Security.Cryptography.Xml" version="8.0.3" targetFramework="net472" />
 </packages>