.NET CORE Api 上传excel解析并生成错误excel下载

写在前面的话:

        【对外承接app API开发、网站建设、系统开发,有偿提供帮助,联系方式于文章最下方 】

因业务调整,不再需要生成错误无excel下载,所以先保存代码,回头再重新编辑

#region Excel校验部分
            if (files == null) throw Oops.Oh("文件不存在");
            string path = @"upload\{yyyy}\{MM}\{dd}";
            var reg = new Regex(@"(\{.+?})");
            var match = reg.Matches(path);
            match.ToList().ForEach(a =>
            {
                var str = DateTime.Now.ToString(a.ToString().Substring(1, a.Length - 2)); // 每天一个目录
                path = path.Replace(a.ToString(), str);
            });


            var sizeKb = (long)(files.Length / 1024.0); // 大小KB
            if (sizeKb > 1048576)
                throw Oops.Oh("文件超过允许大小");

            // 后缀
            var suffix = Path.GetExtension(files.FileName).ToLower();
            if (string.IsNullOrWhiteSpace(suffix))
            {
                var contentTypeProvider = FS.GetFileExtensionContentTypeProvider();
                suffix = contentTypeProvider.Mappings.FirstOrDefault(u => u.Value == files.ContentType).Key;
            }

            if (string.IsNullOrWhiteSpace(suffix))
                throw Oops.Oh("文件后缀错误");

            var finalName = Guid.NewGuid() + suffix;

            //组合路径并创建文件夹
            var filePath = Path.Combine(App.WebHostEnvironment.ContentRootPath, path);
            if (!Directory.Exists(filePath))
                Directory.CreateDirectory(filePath);

            //上传文件
            var realFile = Path.Combine(filePath, finalName);
            using (var stream = System.IO.File.Create(realFile))
            {
                await files.CopyToAsync(stream);
            }

            //判断文件格式(通过后缀名及文件头编码判断)
            byte[] bytes = new byte[4];
            FileStream fileStream = new FileStream(realFile, FileMode.Open, FileAccess.Read);
            string temstr = "";
            if (Convert.ToInt32(fileStream.Length) > 0)
            {
                fileStream.Read(bytes, 0, 4);
                fileStream.Close();
                for (int i = 0; i < bytes.Length; i++)
                {
                    temstr += Convert.ToString(bytes[i], 16);
                }
            }
            var fileHeads = temstr.ToUpper();

            List<FileTypeModel> fileType = new List<FileTypeModel>();
            fileType.Add(new FileTypeModel { FileNameStr = "xlsx", FileHeadStr = "504B34" });
            fileType.Add(new FileTypeModel { FileNameStr = "xls", FileHeadStr = "D0CF11E0" });

            if (!fileType.Any(p => p.FileHeadStr.Contains(fileHeads)) || string.IsNullOrWhiteSpace(fileHeads))
            {
                //删除刚刚上传的文件
                Directory.Delete(realFile, true);
                throw Oops.Oh("文件类型错误");
            }
            #endregion

            #region

            //realFile
            //接下来就可以开始解析了
            IWorkbook _wb_xls = null;

            string fileEx = System.IO.Path.GetExtension(Path.GetFileName(realFile));
            FileStream _file = new FileStream(realFile, FileMode.Open, FileAccess.Read);

            if (realFile.IndexOf(".xlsx") > 0)
                _wb_xls = new XSSFWorkbook(_file);
            else if (realFile.IndexOf(".xls") > 0)
                _wb_xls = new HSSFWorkbook(_file);


            //保存成功信息
            List<DriverImportList> importList = new List<DriverImportList>();
            List<DriverImportList> errorList = new List<DriverImportList>();


            //开始读取excel中数据并作数据校验
            try
            {

                for (int i = 3; i < _wb_xls.GetSheet("DriverData").PhysicalNumberOfRows + 1; i++)
                {
                    var isDataCorrect = true;

                    var cellList = _wb_xls.GetSheet("DriverData").GetRow(i);

                    #region 解析司机个人信息

                    PersonalInformationModel driverModel = new PersonalInformationModel();
                    if (!string.IsNullOrEmpty(cellList.GetCell(1) + ""))
                        driverModel.FirstName = cellList.GetCell(1) + "";

                    //if (!string.IsNullOrEmpty(cellList.GetCell(2) + ""))
                    //    driverModel.MiddleName = cellList.GetCell(2) + "";

                    if (!string.IsNullOrEmpty(cellList.GetCell(3) + ""))
                        driverModel.LastName = cellList.GetCell(3) + "";

                    if (!string.IsNullOrEmpty(cellList.GetCell(4) + ""))
                    {
                        driverModel.PhonetNo = cellList.GetCell(4) + "";
                    }
                    else
                    {
                        isDataCorrect = false;
                        driverModel.PhonetNo = "Error!Not Null";
                    }

                    if (!string.IsNullOrEmpty(cellList.GetCell(5) + ""))
                        driverModel.EMail = cellList.GetCell(5) + "";

                    if (!string.IsNullOrEmpty(cellList.GetCell(6) + ""))
                    {
                        driverModel.SocialInsurance = cellList.GetCell(6) + "";
                    }
                    else
                    {
                        isDataCorrect = false;
                        driverModel.SocialInsurance = "Error!Not Null";
                    }

                    if (!string.IsNullOrEmpty(cellList.GetCell(7) + ""))
                    {
                        driverModel.License = cellList.GetCell(7) + "";
                    }
                    else
                    {
                        isDataCorrect = false;
                        driverModel.License = "Error!Not Null";
                    }

                    if (!string.IsNullOrEmpty(cellList.GetCell(8) + ""))
                    {
                        driverModel.LicenseFirstIssueDate = cellList.GetCell(8) + "";
                    }
                    else if (!(cellList.GetCell(8) is DateTime))
                    {
                        isDataCorrect = false;
                        driverModel.LicenseFirstIssueDate = "Error!Must Time Type";
                    }
                    else
                    {
                        isDataCorrect = false;
                        driverModel.LicenseFirstIssueDate = "Error!Not Null";
                    }


                    if (!string.IsNullOrEmpty(cellList.GetCell(9) + ""))
                    {
                        driverModel.LicenseFromDate = cellList.GetCell(9) + "";
                    }
                    else if (!(cellList.GetCell(9) is DateTime))
                    {
                        isDataCorrect = false;
                        driverModel.LicenseFromDate = "Error!Must Time Type";
                    }
                    else
                    {
                        isDataCorrect = false;
                        driverModel.LicenseFromDate = "Error!Not Null";
                    }


                    if (!string.IsNullOrEmpty(cellList.GetCell(10) + ""))
                    {
                        driverModel.LicenseToDate = cellList.GetCell(10) + "";
                    }
                    else if (!(cellList.GetCell(10) is DateTime))
                    {
                        isDataCorrect = false;
                        driverModel.LicenseToDate = "Error!Must Time Type";
                    }
                    else
                    {
                        isDataCorrect = false;
                        driverModel.LicenseToDate = "Error!Not Null";
                    }
                    #endregion

                    #region 解析司机车辆信息
                    VehicleInformationModel carModel = new VehicleInformationModel();
                    //车辆型号
                    if (!string.IsNullOrEmpty(cellList.GetCell(12) + ""))
                    {
                        carModel.CarModelType = cellList.GetCell(12) + "";
                    }
                    else
                    {
                        isDataCorrect = false;
                        carModel.CarModelType = "Error!Not Null";
                    }
                    //车身颜色
                    if (!string.IsNullOrEmpty(cellList.GetCell(13) + ""))
                    {
                        carModel.ExteriorColor = cellList.GetCell(13) + "";
                    }
                    else
                    {
                        isDataCorrect = false;
                        carModel.ExteriorColor = "Error!Not Null";
                    }
                    //座位数
                    if (!string.IsNullOrEmpty(cellList.GetCell(14) + ""))
                    {
                        carModel.Seats = cellList.GetCell(14) + "";
                    }
                    else
                    {
                        isDataCorrect = false;
                        carModel.Seats = "Error!Not Null";
                    }

                    //出厂日期
                    if (!string.IsNullOrEmpty(cellList.GetCell(15) + ""))
                    {
                        carModel.ProductionDate = cellList.GetCell(15) + "";
                    }
                    else
                    {
                        isDataCorrect = false;
                        carModel.ProductionDate = "Error!Not Null";
                    }

                    //车牌号
                    if (!string.IsNullOrEmpty(cellList.GetCell(16) + ""))
                    {
                        carModel.LicensePlate = cellList.GetCell(16) + "";
                    }
                    else
                    {
                        isDataCorrect = false;
                        carModel.LicensePlate = "Error!Not Null";
                    }

                    //保险开始日期
                    if (!string.IsNullOrEmpty(cellList.GetCell(17) + ""))
                    {
                        carModel.InsuranceFromDate = cellList.GetCell(17) + "";
                    }
                    else
                    {
                        isDataCorrect = false;
                        carModel.InsuranceFromDate = "Error!Not Null";
                    }

                    //保险结束日期
                    if (!string.IsNullOrEmpty(cellList.GetCell(18) + ""))
                    {
                        carModel.InsuranceToDate = cellList.GetCell(18) + "";
                    }
                    else
                    {
                        isDataCorrect = false;
                        carModel.InsuranceToDate = "Error!Not Null";
                    }
                    #endregion

                    #region 解析司机其他信息
                    OtherInformation otherModel = new OtherInformation();

                    //台班费
                    if (!string.IsNullOrEmpty(cellList.GetCell(20) + ""))
                    {
                        otherModel.Percentage_Or_Amount = cellList.GetCell(20) + "";
                        //台班费收费周期
                        if (!string.IsNullOrEmpty(cellList.GetCell(22) + ""))
                        {
                            otherModel.ChargeCycle = cellList.GetCell(22) + "";
                        }
                        else
                        {
                            isDataCorrect = false;
                            otherModel.ChargeCycle = "Error!Not Null";
                        }
                    }

                    //订单抽成
                    if (!string.IsNullOrEmpty(cellList.GetCell(21) + ""))
                    {
                        otherModel.Percentage = cellList.GetCell(21) + "";
                    }
                    else
                    {
                        isDataCorrect = false;
                        otherModel.Percentage = "Error!Not Null";
                    }

                    //账户状态
                    if (!string.IsNullOrEmpty(cellList.GetCell(23) + ""))
                    {
                        otherModel.IsEnabled = cellList.GetCell(23) + "";
                    }
                    else
                    {
                        isDataCorrect = false;
                        otherModel.IsEnabled = "Error!Not Null";
                    }
                    #endregion

                    //如果该条数据数据校验全通过,则添加到list中准备入库
                    if (isDataCorrect)
                    {
                        DriverImportList db_import = new DriverImportList();
                        db_import.PersonalInformationModel = driverModel;
                        db_import.VehicleInformationModel = carModel;
                        db_import.OtherInformation = otherModel;
                        importList.Add(db_import);
                    }
                    else
                    {
                        DriverImportList errorModel = new DriverImportList();
                        errorModel.PersonalInformationModel = driverModel;
                        errorModel.VehicleInformationModel = carModel;
                        errorModel.OtherInformation = otherModel;
                        errorList.Add(errorModel);
                    }
                }
            }
            catch (Exception ex)
            {

                throw Oops.Oh("解析失败,请在下载的模板文件上进行编辑并上传");
            }

            #endregion
            //表头信息
            var headers = new List<ExcelHeader>
            {
                //司机信息
                new ExcelHeader{ Adress="B2", Value="PersonalInformation\r\n(司机信息)" },
                new ExcelHeader{ Adress="B3",Width=15,Value="First_Name"},
                new ExcelHeader{ Adress="C3",Width=15,Value="Last_Name"},
                new ExcelHeader{ Adress="D3",Width=15,Value="Phonet_No"},
                new ExcelHeader{ Adress="E3",Width=15,Value="E_Mail"},
                new ExcelHeader{ Adress="F3",Width=30,Value="Social_Insurance\r\n(社会保险)"},
                new ExcelHeader{ Adress="G3",Width=15,Value="License\r\n(驾照)"},
                new ExcelHeader{ Adress="H3",Width=40,Value="License_First_Issue_Date\r\n(驾照首次领证日期)"},
                new ExcelHeader{ Adress="I3",Width=35,Value="License_From_Date\r\n(驾照起始日期)"},
                new ExcelHeader{ Adress="J3",Width=35,Value="License_To_Date\r\n(驾照结束日期)"},

                //车辆信息
                new ExcelHeader{ Adress="L2", Value="VehicleInformation\r\n(车辆信息)"},
                new ExcelHeader{ Adress="L3",Width=25,Value="Car_Model_Type\r\n(车辆型号)"},
                new ExcelHeader{ Adress="M3",Width=25,Value="Exterior_Color\r\n(车辆颜色)"},
                new ExcelHeader{ Adress="N3",Width=25,Value="Seats\r\n(座椅数量)"},
                new ExcelHeader{ Adress="O3",Width=25,Value="Production_Date\r\n(出厂日期)"},
                new ExcelHeader{ Adress="P3",Width=25,Value="License_Plate\r\n(车牌号)"},
                new ExcelHeader{ Adress="Q3",Width=25,Value="Insurance_From_Date\r\n(保险起始日期)"},
                new ExcelHeader{ Adress="R3",Width=25,Value="Insurance_To_Date\r\n(保险结束日期)"},

                //其他信息
                new ExcelHeader{ Adress="T2", Value="OtherInformation\r\n(其他信息)"},
                new ExcelHeader{ Adress="T3",Width=30,Value="Percentage_Or_Amount\r\n\r\n(台班费)"},
                new ExcelHeader{ Adress="U3",Width=30,Value="Percentage\r\n(订单抽成)"},
                new ExcelHeader{ Adress="V3",Width=30,Value="ChargeCycle\r\n(台班费收费周期)"},
                new ExcelHeader{ Adress="W3",Width=30,Value="IsEnabled\r\n(账户状态)"},
            };

            string localPath = AppDomain.CurrentDomain.BaseDirectory + System.DateTime.Now.ToString("yyyyMMdd");
            var filepath = Path.Combine(localPath, $"{DateTime.Now.ToString("yyyy_MM_dd_HH_mm_ss")}.xlsx");
            FileInfo file = new FileInfo(filepath);
            if (file.Exists)
            {
                file.Delete();
                file = new FileInfo(filepath);
            }

            //创建文件夹
            if (!Directory.Exists(localPath))
                Directory.CreateDirectory(localPath);

            ExcelPackage.LicenseContext = OfficeOpenXml.LicenseContext.NonCommercial;
            ExcelPackage package = new ExcelPackage(file);
            //创建sheet
            ExcelWorksheet worksheet = package.Workbook.Worksheets.Add("DriverData");

            //生成表头
            for (int i = 0; i < headers.Count; i++)
            {
                worksheet.Cells[headers[i].Adress].Value = headers[i].Value;
                //合并单元格
                worksheet.Cells[2, 2, 2, 12].Merge = true;
                worksheet.Cells[2, 14, 2, 23].Merge = true;
                worksheet.Cells[2, 24, 2, 26].Merge = true;

                worksheet.Cells[headers[i].Adress].Style.Font.Size = 12; //字体大小
                worksheet.Cells[headers[i].Adress].Style.Font.Bold = true; //设置粗体
                worksheet.Cells[headers[i].Adress].Style.HorizontalAlignment = OfficeOpenXml.Style.ExcelHorizontalAlignment.Center; //水平居中对齐
                worksheet.Cells[headers[i].Adress].Style.VerticalAlignment = OfficeOpenXml.Style.ExcelVerticalAlignment.Center; //垂直居中对齐
                if (headers[i].Width > 0)
                    worksheet.Column(ColumnIndex(headers[i].Adress)).Width = headers[i].Width;
                //给第三行设置行高
                worksheet.Row(3).Height = 35;
                //设置表格边框线(设置单元格所有边框)
                #region 表头设置边框线
                worksheet.Cells["B2"].Style.Border.BorderAround(ExcelBorderStyle.Thin, Color.FromArgb(0, 0, 0));
                worksheet.Cells["C2"].Style.Border.BorderAround(ExcelBorderStyle.Thin, Color.FromArgb(0, 0, 0));
                worksheet.Cells["D2"].Style.Border.BorderAround(ExcelBorderStyle.Thin, Color.FromArgb(0, 0, 0));
                worksheet.Cells["E2"].Style.Border.BorderAround(ExcelBorderStyle.Thin, Color.FromArgb(0, 0, 0));
                worksheet.Cells["F2"].Style.Border.BorderAround(ExcelBorderStyle.Thin, Color.FromArgb(0, 0, 0));
                worksheet.Cells["G2"].Style.Border.BorderAround(ExcelBorderStyle.Thin, Color.FromArgb(0, 0, 0));
                worksheet.Cells["H2"].Style.Border.BorderAround(ExcelBorderStyle.Thin, Color.FromArgb(0, 0, 0));
                worksheet.Cells["I2"].Style.Border.BorderAround(ExcelBorderStyle.Thin, Color.FromArgb(0, 0, 0));
                worksheet.Cells["J2"].Style.Border.BorderAround(ExcelBorderStyle.Thin, Color.FromArgb(0, 0, 0));

                worksheet.Cells["L2"].Style.Border.BorderAround(ExcelBorderStyle.Thin, Color.FromArgb(0, 0, 0));
                worksheet.Cells["M2"].Style.Border.BorderAround(ExcelBorderStyle.Thin, Color.FromArgb(0, 0, 0));
                worksheet.Cells["N2"].Style.Border.BorderAround(ExcelBorderStyle.Thin, Color.FromArgb(0, 0, 0));
                worksheet.Cells["O2"].Style.Border.BorderAround(ExcelBorderStyle.Thin, Color.FromArgb(0, 0, 0));
                worksheet.Cells["P2"].Style.Border.BorderAround(ExcelBorderStyle.Thin, Color.FromArgb(0, 0, 0));
                worksheet.Cells["Q2"].Style.Border.BorderAround(ExcelBorderStyle.Thin, Color.FromArgb(0, 0, 0));
                worksheet.Cells["R2"].Style.Border.BorderAround(ExcelBorderStyle.Thin, Color.FromArgb(0, 0, 0));
                worksheet.Cells["S2"].Style.Border.BorderAround(ExcelBorderStyle.Thin, Color.FromArgb(0, 0, 0));
                worksheet.Cells["T2"].Style.Border.BorderAround(ExcelBorderStyle.Thin, Color.FromArgb(0, 0, 0));


                worksheet.Cells["V2"].Style.Border.BorderAround(ExcelBorderStyle.Thin, Color.FromArgb(0, 0, 0));
                worksheet.Cells["W2"].Style.Border.BorderAround(ExcelBorderStyle.Thin, Color.FromArgb(0, 0, 0));
                worksheet.Cells["X2"].Style.Border.BorderAround(ExcelBorderStyle.Thin, Color.FromArgb(0, 0, 0));

                worksheet.Cells["B3"].Style.Border.BorderAround(ExcelBorderStyle.Thin, Color.FromArgb(0, 0, 0));
                worksheet.Cells["C3"].Style.Border.BorderAround(ExcelBorderStyle.Thin, Color.FromArgb(0, 0, 0));
                worksheet.Cells["D3"].Style.Border.BorderAround(ExcelBorderStyle.Thin, Color.FromArgb(0, 0, 0));
                worksheet.Cells["E3"].Style.Border.BorderAround(ExcelBorderStyle.Thin, Color.FromArgb(0, 0, 0));
                worksheet.Cells["F3"].Style.Border.BorderAround(ExcelBorderStyle.Thin, Color.FromArgb(0, 0, 0));
                worksheet.Cells["G3"].Style.Border.BorderAround(ExcelBorderStyle.Thin, Color.FromArgb(0, 0, 0));
                worksheet.Cells["H3"].Style.Border.BorderAround(ExcelBorderStyle.Thin, Color.FromArgb(0, 0, 0));
                worksheet.Cells["I3"].Style.Border.BorderAround(ExcelBorderStyle.Thin, Color.FromArgb(0, 0, 0));
                worksheet.Cells["J3"].Style.Border.BorderAround(ExcelBorderStyle.Thin, Color.FromArgb(0, 0, 0));

                worksheet.Cells["L3"].Style.Border.BorderAround(ExcelBorderStyle.Thin, Color.FromArgb(0, 0, 0));
                worksheet.Cells["M3"].Style.Border.BorderAround(ExcelBorderStyle.Thin, Color.FromArgb(0, 0, 0));
                worksheet.Cells["N3"].Style.Border.BorderAround(ExcelBorderStyle.Thin, Color.FromArgb(0, 0, 0));
                worksheet.Cells["O3"].Style.Border.BorderAround(ExcelBorderStyle.Thin, Color.FromArgb(0, 0, 0));
                worksheet.Cells["P3"].Style.Border.BorderAround(ExcelBorderStyle.Thin, Color.FromArgb(0, 0, 0));
                worksheet.Cells["Q3"].Style.Border.BorderAround(ExcelBorderStyle.Thin, Color.FromArgb(0, 0, 0));
                worksheet.Cells["R3"].Style.Border.BorderAround(ExcelBorderStyle.Thin, Color.FromArgb(0, 0, 0));
                worksheet.Cells["S3"].Style.Border.BorderAround(ExcelBorderStyle.Thin, Color.FromArgb(0, 0, 0));
                worksheet.Cells["T3"].Style.Border.BorderAround(ExcelBorderStyle.Thin, Color.FromArgb(0, 0, 0));


                worksheet.Cells["V3"].Style.Border.BorderAround(ExcelBorderStyle.Thin, Color.FromArgb(0, 0, 0));
                worksheet.Cells["W3"].Style.Border.BorderAround(ExcelBorderStyle.Thin, Color.FromArgb(0, 0, 0));
                worksheet.Cells["X3"].Style.Border.BorderAround(ExcelBorderStyle.Thin, Color.FromArgb(0, 0, 0));

                //worksheet.Cells[1, 1].Style.Border.Bottom.Style = ExcelBorderStyle.Thin;//单独设置单元格底部边框样式和颜色(上下左右均可分开设置)
                //worksheet.Cells[1, 1].Style.Border.Bottom.Color.SetColor(Color.FromArgb(191, 191, 191));
                #endregion
            }
            //循环填充内容
            if (errorList != null)
            {
                //设置背景色
                Color colFromHex = System.Drawing.ColorTranslator.FromHtml("#7fcbfe");
                for (int i = 0; i < errorList.Count; i++)
                {
                    if (errorList[i].PersonalInformationModel != null)
                    {
                        //姓
                        worksheet.Cells["B" + (4 + i)].Value = errorList[i].PersonalInformationModel.FirstName;
                        worksheet.Cells["B" + (4 + i)].Style.Border.BorderAround(ExcelBorderStyle.Thin, Color.FromArgb(0, 0, 0));
                        if (errorList[i].PersonalInformationModel.FirstName != null && errorList[i].PersonalInformationModel.FirstName.IndexOf("Error!") > -1)
                        {
                            worksheet.Cells["B" + (4 + i)].Style.Fill.PatternType = OfficeOpenXml.Style.ExcelFillStyle.Solid;
                            worksheet.Cells["B" + (4 + i)].Style.Fill.BackgroundColor.SetColor(colFromHex);
                        }

                        //名
                        worksheet.Cells["C" + (4 + i)].Value = errorList[i].PersonalInformationModel.LastName;
                        worksheet.Cells["C" + (4 + i)].Style.Border.BorderAround(ExcelBorderStyle.Thin, Color.FromArgb(0, 0, 0));
                        if (errorList[i].PersonalInformationModel.LastName != null && errorList[i].PersonalInformationModel.LastName.IndexOf("Error!") > -1)
                        {
                            worksheet.Cells["C" + (4 + i)].Style.Fill.PatternType = OfficeOpenXml.Style.ExcelFillStyle.Solid;
                            worksheet.Cells["C" + (4 + i)].Style.Fill.BackgroundColor.SetColor(colFromHex);
                        }

                        //电话号码
                        worksheet.Cells["D" + (4 + i)].Value = errorList[i].PersonalInformationModel.PhonetNo;
                        worksheet.Cells["D" + (4 + i)].Style.Border.BorderAround(ExcelBorderStyle.Thin, Color.FromArgb(0, 0, 0));
                        if (errorList[i].PersonalInformationModel.PhonetNo != null && errorList[i].PersonalInformationModel.PhonetNo.IndexOf("Error!") > -1)
                        {
                            worksheet.Cells["D" + (4 + i)].Style.Fill.PatternType = OfficeOpenXml.Style.ExcelFillStyle.Solid;
                            worksheet.Cells["D" + (4 + i)].Style.Fill.BackgroundColor.SetColor(colFromHex);
                        }

                        //邮箱
                        worksheet.Cells["E" + (4 + i)].Value = errorList[i].PersonalInformationModel.EMail;
                        worksheet.Cells["E" + (4 + i)].Style.Border.BorderAround(ExcelBorderStyle.Thin, Color.FromArgb(0, 0, 0));
                        if (errorList[i].PersonalInformationModel.EMail != null && errorList[i].PersonalInformationModel.EMail.IndexOf("Error!") > -1)
                        {
                            worksheet.Cells["E" + (4 + i)].Style.Fill.PatternType = OfficeOpenXml.Style.ExcelFillStyle.Solid;
                            worksheet.Cells["E" + (4 + i)].Style.Fill.BackgroundColor.SetColor(colFromHex);
                        }

                        //社会保障号
                        worksheet.Cells["F" + (4 + i)].Value = errorList[i].PersonalInformationModel.SocialInsurance;
                        worksheet.Cells["F" + (4 + i)].Style.Border.BorderAround(ExcelBorderStyle.Thin, Color.FromArgb(0, 0, 0));
                        if (errorList[i].PersonalInformationModel.SocialInsurance != null && errorList[i].PersonalInformationModel.SocialInsurance.IndexOf("Error!") > -1)
                        {
                            worksheet.Cells["F" + (4 + i)].Style.Fill.PatternType = OfficeOpenXml.Style.ExcelFillStyle.Solid;
                            worksheet.Cells["F" + (4 + i)].Style.Fill.BackgroundColor.SetColor(colFromHex);
                        }

                        //驾照号码
                        worksheet.Cells["G" + (4 + i)].Value = errorList[i].PersonalInformationModel.License;
                        worksheet.Cells["G" + (4 + i)].Style.Border.BorderAround(ExcelBorderStyle.Thin, Color.FromArgb(0, 0, 0));
                        if (errorList[i].PersonalInformationModel.License != null && errorList[i].PersonalInformationModel.License.IndexOf("Error!") > -1)
                        {
                            worksheet.Cells["G" + (4 + i)].Style.Fill.PatternType = OfficeOpenXml.Style.ExcelFillStyle.Solid;
                            worksheet.Cells["G" + (4 + i)].Style.Fill.BackgroundColor.SetColor(colFromHex);
                        }

                        //初次领证日期
                        worksheet.Cells["H" + (4 + i)].Value = errorList[i].PersonalInformationModel.LicenseFirstIssueDate;
                        worksheet.Cells["H" + (4 + i)].Style.Border.BorderAround(ExcelBorderStyle.Thin, Color.FromArgb(0, 0, 0));
                        if (errorList[i].PersonalInformationModel.LicenseFirstIssueDate != null && errorList[i].PersonalInformationModel.LicenseFirstIssueDate.IndexOf("Error!") > -1)
                        {
                            worksheet.Cells["H" + (4 + i)].Style.Fill.PatternType = OfficeOpenXml.Style.ExcelFillStyle.Solid;
                            worksheet.Cells["H" + (4 + i)].Style.Fill.BackgroundColor.SetColor(colFromHex);
                        }

                        //驾照起始日期
                        worksheet.Cells["I" + (4 + i)].Value = errorList[i].PersonalInformationModel.LicenseFromDate;
                        worksheet.Cells["I" + (4 + i)].Style.Border.BorderAround(ExcelBorderStyle.Thin, Color.FromArgb(0, 0, 0));
                        if (errorList[i].PersonalInformationModel.LicenseFromDate != null && errorList[i].PersonalInformationModel.LicenseFromDate.IndexOf("Error!") > -1)
                        {
                            worksheet.Cells["I" + (4 + i)].Style.Fill.PatternType = OfficeOpenXml.Style.ExcelFillStyle.Solid;
                            worksheet.Cells["I" + (4 + i)].Style.Fill.BackgroundColor.SetColor(colFromHex);
                        }

                        //驾照结束日期
                        worksheet.Cells["J" + (4 + i)].Value = errorList[i].PersonalInformationModel.LicenseToDate;
                        worksheet.Cells["J" + (4 + i)].Style.Border.BorderAround(ExcelBorderStyle.Thin, Color.FromArgb(0, 0, 0));
                        if (errorList[i].PersonalInformationModel.LicenseToDate != null && errorList[i].PersonalInformationModel.LicenseToDate.IndexOf("Error!") > -1)
                        {
                            worksheet.Cells["J" + (4 + i)].Style.Fill.PatternType = OfficeOpenXml.Style.ExcelFillStyle.Solid;
                            worksheet.Cells["J" + (4 + i)].Style.Fill.BackgroundColor.SetColor(colFromHex);
                        }
                    }
                    if (errorList[i].VehicleInformationModel != null)
                    {
                        //车辆型号
                        worksheet.Cells["M" + (4 + i)].Value = errorList[i].VehicleInformationModel.CarModelType;
                        worksheet.Cells["M" + (4 + i)].Style.Border.BorderAround(ExcelBorderStyle.Thin, Color.FromArgb(0, 0, 0));
                        if (errorList[i].VehicleInformationModel.CarModelType != null && errorList[i].VehicleInformationModel.CarModelType.IndexOf("Error!") > -1)
                        {
                            worksheet.Cells["M" + (4 + i)].Style.Fill.PatternType = OfficeOpenXml.Style.ExcelFillStyle.Solid;
                            worksheet.Cells["M" + (4 + i)].Style.Fill.BackgroundColor.SetColor(colFromHex);
                        }

                        //车身颜色
                        worksheet.Cells["N" + (4 + i)].Value = errorList[i].VehicleInformationModel.ExteriorColor;
                        worksheet.Cells["N" + (4 + i)].Style.Border.BorderAround(ExcelBorderStyle.Thin, Color.FromArgb(0, 0, 0));
                        if (errorList[i].VehicleInformationModel.ExteriorColor != null && errorList[i].VehicleInformationModel.ExteriorColor.IndexOf("Error!") > -1)
                        {
                            worksheet.Cells["N" + (4 + i)].Style.Fill.PatternType = OfficeOpenXml.Style.ExcelFillStyle.Solid;
                            worksheet.Cells["N" + (4 + i)].Style.Fill.BackgroundColor.SetColor(colFromHex);
                        }

                        //座位数
                        worksheet.Cells["O" + (4 + i)].Value = errorList[i].VehicleInformationModel.Seats;
                        worksheet.Cells["O" + (4 + i)].Style.Border.BorderAround(ExcelBorderStyle.Thin, Color.FromArgb(0, 0, 0));
                        if (errorList[i].VehicleInformationModel.Seats != null && errorList[i].VehicleInformationModel.Seats.IndexOf("Error!") > -1)
                        {
                            worksheet.Cells["O" + (4 + i)].Style.Fill.PatternType = OfficeOpenXml.Style.ExcelFillStyle.Solid;
                            worksheet.Cells["O" + (4 + i)].Style.Fill.BackgroundColor.SetColor(colFromHex);
                        }

                        //出厂日期
                        worksheet.Cells["P" + (4 + i)].Value = errorList[i].VehicleInformationModel.ProductionDate;
                        worksheet.Cells["P" + (4 + i)].Style.Border.BorderAround(ExcelBorderStyle.Thin, Color.FromArgb(0, 0, 0));
                        if (errorList[i].VehicleInformationModel.ProductionDate != null && errorList[i].VehicleInformationModel.ProductionDate.IndexOf("Error!") > -1)
                        {
                            worksheet.Cells["P" + (4 + i)].Style.Fill.PatternType = OfficeOpenXml.Style.ExcelFillStyle.Solid;
                            worksheet.Cells["P" + (4 + i)].Style.Fill.BackgroundColor.SetColor(colFromHex);
                        }

                        //车牌号
                        worksheet.Cells["Q" + (4 + i)].Value = errorList[i].VehicleInformationModel.LicensePlate;
                        worksheet.Cells["Q" + (4 + i)].Style.Border.BorderAround(ExcelBorderStyle.Thin, Color.FromArgb(0, 0, 0));
                        if (errorList[i].VehicleInformationModel.LicensePlate != null && errorList[i].VehicleInformationModel.LicensePlate.IndexOf("Error!") > -1)
                        {
                            worksheet.Cells["Q" + (4 + i)].Style.Fill.PatternType = OfficeOpenXml.Style.ExcelFillStyle.Solid;
                            worksheet.Cells["Q" + (4 + i)].Style.Fill.BackgroundColor.SetColor(colFromHex);
                        }

                        //保险起始日期
                        worksheet.Cells["R" + (4 + i)].Value = errorList[i].VehicleInformationModel.InsuranceFromDate;
                        worksheet.Cells["R" + (4 + i)].Style.Border.BorderAround(ExcelBorderStyle.Thin, Color.FromArgb(0, 0, 0));
                        if (errorList[i].VehicleInformationModel.InsuranceFromDate != null && errorList[i].VehicleInformationModel.InsuranceFromDate.IndexOf("Error!") > -1)
                        {
                            worksheet.Cells["R" + (4 + i)].Style.Fill.PatternType = OfficeOpenXml.Style.ExcelFillStyle.Solid;
                            worksheet.Cells["R" + (4 + i)].Style.Fill.BackgroundColor.SetColor(colFromHex);
                        }

                        //保险结束日期
                        worksheet.Cells["S" + (4 + i)].Value = errorList[i].VehicleInformationModel.InsuranceToDate;
                        worksheet.Cells["S" + (4 + i)].Style.Border.BorderAround(ExcelBorderStyle.Thin, Color.FromArgb(0, 0, 0));
                        if (errorList[i].VehicleInformationModel.InsuranceToDate != null && errorList[i].VehicleInformationModel.InsuranceToDate.IndexOf("Error!") > -1)
                        {
                            worksheet.Cells["S" + (4 + i)].Style.Fill.PatternType = OfficeOpenXml.Style.ExcelFillStyle.Solid;
                            worksheet.Cells["S" + (4 + i)].Style.Fill.BackgroundColor.SetColor(colFromHex);
                        }

                    }
                    if (errorList[i].OtherInformation != null)
                    {
                        //台班费
                        worksheet.Cells["X" + (4 + i)].Value = errorList[i].OtherInformation.Percentage_Or_Amount;
                        worksheet.Cells["X" + (4 + i)].Style.Border.BorderAround(ExcelBorderStyle.Thin, Color.FromArgb(0, 0, 0));
                        if (errorList[i].OtherInformation.Percentage_Or_Amount.IndexOf("Error!") > -1)
                        {
                            worksheet.Cells["X" + (4 + i)].Style.Fill.PatternType = OfficeOpenXml.Style.ExcelFillStyle.Solid;
                            worksheet.Cells["X" + (4 + i)].Style.Fill.BackgroundColor.SetColor(colFromHex);
                        }

                        //订单抽成
                        worksheet.Cells["X" + (4 + i)].Value = errorList[i].OtherInformation.Percentage;
                        worksheet.Cells["X" + (4 + i)].Style.Border.BorderAround(ExcelBorderStyle.Thin, Color.FromArgb(0, 0, 0));
                        if (errorList[i].OtherInformation.Percentage.IndexOf("Error!") > -1)
                        {
                            worksheet.Cells["X" + (4 + i)].Style.Fill.PatternType = OfficeOpenXml.Style.ExcelFillStyle.Solid;
                            worksheet.Cells["X" + (4 + i)].Style.Fill.BackgroundColor.SetColor(colFromHex);
                        }

                        //台班费收费周期
                        worksheet.Cells["X" + (4 + i)].Value = errorList[i].OtherInformation.ChargeCycle;
                        worksheet.Cells["X" + (4 + i)].Style.Border.BorderAround(ExcelBorderStyle.Thin, Color.FromArgb(0, 0, 0));
                        if (errorList[i].OtherInformation.ChargeCycle.IndexOf("Error!") > -1)
                        {
                            worksheet.Cells["X" + (4 + i)].Style.Fill.PatternType = OfficeOpenXml.Style.ExcelFillStyle.Solid;
                            worksheet.Cells["X" + (4 + i)].Style.Fill.BackgroundColor.SetColor(colFromHex);
                        }

                        //账户状态
                        worksheet.Cells["X" + (4 + i)].Value = errorList[i].OtherInformation.IsEnabled;
                        worksheet.Cells["X" + (4 + i)].Style.Border.BorderAround(ExcelBorderStyle.Thin, Color.FromArgb(0, 0, 0));
                        if (errorList[i].OtherInformation.IsEnabled.IndexOf("Error!") > -1)
                        {
                            worksheet.Cells["X" + (4 + i)].Style.Fill.PatternType = OfficeOpenXml.Style.ExcelFillStyle.Solid;
                            worksheet.Cells["X" + (4 + i)].Style.Fill.BackgroundColor.SetColor(colFromHex);
                        }
                    }
                }
            }
            package.Save();
            //转成流之后下载
            using (FileStream fs = new FileStream(filepath, FileMode.Open, FileAccess.Read))
            {
                byte[] byteArray = new byte[fs.Length];
                fs.Read(byteArray, 0, byteArray.Length);


                //删除昨日生成的excel文件夹
                System.IO.File.Delete(AppDomain.CurrentDomain.BaseDirectory + System.DateTime.Now.AddDays(-1).ToString("yyyyMMdd"));
                return new FileContentResult(byteArray, "application/octet-stream")
                {
                    FileDownloadName = $"{DateTime.Now.ToString("yyyyMMddHHmmss")}错误记录.xlsx"
                };
            }

/// <summary>
/// 根据单元格地址计算出单元格所在列的索引
/// </summary>
/// <param name="reference">单元格地址,示例A1,AB2</param>
/// <returns></returns>
private static int ColumnIndex(string reference)
{
    int ci = 0;
    reference = reference.ToUpper();
    for (int ix = 0; ix < reference.Length && reference[ix] >= 'A'; ix++)
    ci = (ci * 26) + ((int)reference[ix] - 64);
    return ci;
}

model部分


public class DriverImportList
{
    public PersonalInformationModel PersonalInformationModel { get; set; }
    public VehicleInformationModel VehicleInformationModel { get; set; }
    public OtherInformation OtherInformation { get; set; }
}

/// <summary>
/// excel上传、司机个人信息
/// </summary>
public class PersonalInformationModel
{
    /// <summary>
    /// 姓
    /// </summary>
    public string FirstName { get; set; }
    /// <summary>
    /// 名
    /// </summary>
    public string LastName { get; set; }
    /// <summary>
    /// 电话号码
    /// </summary>
    public string PhonetNo { get; set; }
    /// <summary>
    /// 邮箱
    /// </summary>
    public string EMail { get; set; }
    /// <summary>
    /// 社会保障号
    /// </summary>
    public string SocialInsurance { get; set; }
    /// <summary>
    /// 驾照
    /// </summary>
    public string License { get; set; }
    /// <summary>
    /// 初次领证日期
    /// </summary>
    public string LicenseFirstIssueDate { get; set; }
    /// <summary>
    /// 驾照有效期起始时间
    /// </summary>
    public string LicenseFromDate { get; set; }
    /// <summary>
    /// 驾照有效期结束时间
    /// </summary>
    public string LicenseToDate { get; set; }
}

/// <summary>
/// excel上传、车辆相关信息
/// </summary>
public class VehicleInformationModel
{
    /// <summary>
    /// 车辆型号
    /// </summary>
    public string CarModelType { get; set; }
    /// <summary>
    /// 车身颜色
    /// </summary>
    public string ExteriorColor { get; set; }
    /// <summary>
    /// 座椅数量
    /// </summary>
    public string Seats { get; set; }
    /// <summary>
    /// 出厂日期
    /// </summary>
    public string ProductionDate { get; set; }
    /// <summary>
    /// 车牌号
    /// </summary>
    public string LicensePlate { get; set; }
    /// <summary>
    /// 保险开始日期
    /// </summary>
    public string InsuranceFromDate { get; set; }
    /// <summary>
    /// 保险结束日期
    /// </summary>
    public string InsuranceToDate { get; set; }
}


/// <summary>
/// excel上传、其他杂项信息
/// </summary>
public class OtherInformation
{ 
    /// <summary>
    /// 台班费
    /// </summary>
    public string Percentage_Or_Amount { get; set; }
    /// <summary>
    /// 台班费收费周期
    /// </summary>
    public string ChargeCycle { get; set; }
    /// <summary>
    /// 订单抽成
    /// </summary>
    public string Percentage { get; set; }
   
    /// <summary>
    /// 账户状态
    /// </summary>
    public string IsEnabled { get; set; } 
}

public class ExcelHeader
{
        /// <summary>
        /// 单元格地址A1,B2等
        /// </summary>
        public string Adress { get; set; }
        /// <summary>
        /// 单元格值
        /// </summary>
        public string Value { get; set; }
        /// <summary>
        /// 单元格合并区域,示例A1:B2,为空表示不合并
        /// </summary>
        public string MergeArea { get; set; }
        /// <summary>
        /// 列宽度,合并列不需要指定宽度,示例:
        /// | A |
        /// |B|C|
        /// 表头A是单元格B和单元格C合并而来,不需要指定宽度,只指定B和C宽度即可
        /// </summary>
        public int Width { get; set; }
}

参考文档

1、Asp.NET Core 导出数据到 Excel 文件 - 码农教程

2、.net5下使用EPPlus导出Excel(复杂表头)_.net 导出excel 多表头_数据的流的博客-CSDN博客

3、Excel操作库--EPPLUS常用操作命令汇总(1)_韦_恩的博客-CSDN博客
 

联系方式:

                 wechat&QQ&Tel:13501715983(如查不到请加QQ:631931078或352167311)

                 个人邮箱:13212644043@163.com

OK,暂且这样~

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mfbz.cn/a/84056.html

如若内容造成侵权/违法违规/事实不符,请联系我们进行投诉反馈qq邮箱809451989@qq.com,一经查实,立即删除!

相关文章

区块链与算力网络:创造未来网络的安全与共享

在数字革命的浪潮下&#xff0c;网络技术正焕发着前所未有的活力&#xff0c;而算力网络以其独特的区块链技术应用&#xff0c;为网络的安全性和资源共享带来了新的可能性。本文将带您深入探索算力网络中区块链技术的神奇应用&#xff0c;为您呈现这个充满活力和创新的网络未来…

【开发笔记】ubuntu部署指定版本的前后端运行环境(npm nodejs mysql)

目录 1 背景2 环境要求3 部署流程3.1 npm的安装3.2 nodejs的安装3.3 MySQL的安装 4 可能的问题 1 背景 在远程服务器上的Ubuntu系统中&#xff0c;部署指定版本的前后端项目的运行环境 2 环境要求 npm 9.5.1Nodejs v18.16.1MySQL 8.0.33 3 部署流程 3.1 npm的安装 通过安…

Python Opencv实践 - 图像中值滤波

import cv2 as cv import numpy as np import matplotlib.pyplot as pltimg cv.imread("../SampleImages/pomeranian.png", cv.IMREAD_COLOR) print(img.shape) pixel_count img.shape[0] * img.shape[1] print(pixel_count)#为图像添加椒盐噪声 #参考资料&#xf…

项目实战笔记4:敏捷

术语介绍 敏捷项目管理是一种以快速响应变化为核心的项目管理方法。与传统的瀑布模型不同&#xff0c;敏捷方法强调迭代开发和紧密的团队合作。其目的是尽可能快地交付可用的产品&#xff0c;然后在客户和团队之间进行反馈和迭代&#xff0c;以不断优化产品和开发过程。 在敏捷…

苍穹外卖 day2 反向代理和负载均衡

一 前端发送的请求&#xff0c;是如何请求到后端服务 前端请求地址&#xff1a;http://localhost/api/employee/login 路径并不匹配 后端接口地址&#xff1a;http://localhost:8080/admin/employee/login 二 查找前端接口 在这个页面上点击f12 后转到networ验证&#xff0…

Apache Doris 入门教程34:Join 优化

Bucket Shuffle Join Bucket Shuffle Join 是在 Doris 0.14 版本中正式加入的新功能。旨在为某些 Join 查询提供本地性优化&#xff0c;来减少数据在节点间的传输耗时&#xff0c;来加速查询。 它的设计、实现和效果可以参阅 上面的图片展示了Bucket Shuffle Join的工作原理…

0基础学习VR全景平台篇 第88篇:智慧眼-成员管理

一、功能说明 成员管理&#xff0c;是指管理智慧眼项目的成员&#xff0c;拥有相关权限的人可以进行添加成员、分配成员角色、设置成员分类、修改成员以及删除成员五项操作。但是仅限于管理自己的下级成员&#xff0c;上级成员无权管理。 二、前台操作页面 登录智慧眼后台操…

【高危】企业微信私有化2.5-2.6.93版本后台API未授权访问漏洞

漏洞描述 企业微信私有化2.5.x版本及2.6.930000版本以下后台中存在接口未授权访问漏洞&#xff0c;攻击者通过访问/cgi-bin/gateway/agentinfo接口可获得Secret&#xff0c;从而利用开放API获取企业通讯录等敏感信息及企业微信内应用权限。 漏洞名称企业微信私有化2.5-2.6.93…

opencv进阶12-EigenFaces 人脸识别

EigenFaces 通常也被称为 特征脸&#xff0c;它使用主成分分析&#xff08;Principal Component Analysis&#xff0c;PCA&#xff09; 方法将高维的人脸数据处理为低维数据后&#xff08;降维&#xff09;&#xff0c;再进行数据分析和处理&#xff0c;获取识别结果。 基本原理…

亿赛通电子文档安全管理系统 RCE漏洞

亿赛通电子文档安全管理系统 RCE漏洞 一、 产品简介二、 漏洞概述三、 复现环境四、 漏洞复现小龙POC检测: 五、 修复建议 免责声明&#xff1a;请勿利用文章内的相关技术从事非法测试&#xff0c;由于传播、利用此文所提供的信息或者工具而造成的任何直接或者间接的后果及损失…

2023年京东儿童智能手表行业数据分析(京东销售数据分析)

儿童消费市场向来火爆&#xff0c;儿童智能手表作为能够实现定位导航&#xff0c;信息通讯&#xff0c;SOS求救&#xff0c;远程监听&#xff0c;智能防丢等多功能的智能可穿戴设备&#xff0c;能够通过较为精准的定位功能和安全防护能力保障儿童的安全&#xff0c;因而广受消费…

Java详解编译型和解释型语言

在计算机的高级编程语言类型分为两种&#xff0c;分别是编译型和解释型&#xff0c;而Java既有编译型又有解释型 什么是编译型&#xff1f;什么是解释型&#xff1f; 字面上来说编译和解释都有‘翻译’的意思&#xff0c;而她们两个的区别是‘翻译’的时机不同&#xff0c;什…

多种编程语言运行速度排名-10亿次除7求余数为0的数量

最佳方式是运行10次&#xff0c;取平均数&#xff0c;用时秒数显示3位小数。 因为第一次打开&#xff0c;可能CPU还没优化好&#xff0c;多次取平均&#xff0c;比较准确 第1次共10次&#xff0c;用时3秒&#xff0c;平均3秒 第2次共10次&#xff0c;用时4秒&#xff0c;平均3.…

LTDC之外部SDRAM

1.配置外部SDRAM&#xff08;嵌入式基础知识&#xff0c;此处不做分析&#xff09; 2.编写SDRAM配置代码&#xff08;copy正点原子例程&#xff09; sdram.c#include "sdram.h" #include "fmc.h"uint8_t SDRAM_Send_Cmd(uint8_t bankx,uint8_t cmd,uint8_…

十问华为云 Toolkit:开发插件如何提升云上开发效能

众所周知&#xff0c;桌面集成开发环境&#xff08;IDE&#xff09;已经融入到开发的各个环节&#xff0c;对开发者的重要性和广泛度是不言而喻的&#xff0c;而开发插件更是建立在IDE基础上的功能Buff。 Huawei Cloud ToolKit作为华为云围绕其产品能力向开发者桌面上的延伸&a…

C#8.0本质论第三章--更多数据类型

C#8.0本质论第三章–更多数据类型 3.1类型的划分 一个类型要么是值类型&#xff0c;要么是引用类型。区别在于拷贝方式&#xff1a;值类型数据总是拷贝值&#xff1b;引用类型的数据总是拷贝引用。 3.1.1值类型 3.1.2引用类型 引用类型的变量存储对数据存储位置的引用。 3.…

HTML a标签

<a>标签定义一个超链接。它有如下主要属性&#xff1a; href&#xff1a;指定链接的地址&#xff0c;可以是一个URL、文件路径或锚点。target&#xff1a;指定链接在何处打开。其值包括&#xff1a; _blank&#xff1a;在新窗口或新标签页打开链接。_self&#xff1a;在…

【从零开始学爬虫】采集中国国际招标网招标数据

l 采集网站 【场景描述】采集中国国际招标网招标数据。 【源网站介绍】中国国际招标网致力于为企业提供招标、采购、拟在建项目信息及网上招标采购等一系列商务服务。 【使用工具】前嗅ForeSpider数据采集系统 http://www.forenose.com/view/forespider/view/download.html 【…

【广州华锐互动】3D空间编辑器:一款简洁易用的VR/3D在线编辑工具

随着虚拟现实技术的不断发展&#xff0c;数字孪生技术的应用已经被广泛应用于产品设计和制作中&#xff0c;能充分发挥企业应用3D建模的优势&#xff0c;凸显了三维设计的价值&#xff0c;在生产阶段也能够充分发挥3D模型的作用。 如今&#xff0c;广州华锐互动开发的3D空间编辑…

高速道路监控:工业路由器助力高速监控远程管理与维护

工业路由器在物联网应用中扮演着重要的角色。物联网的发展使得大量设备和传感器能够互联互通&#xff0c;而工业路由器作为连接这些设备和网络的中间桥梁&#xff0c;承担着数据传输和安全管理的重要责任。 工业路由器能够为高速监控提供网络功能&#xff0c;实现户外无线网络部…