diff --git a/New_College.Api/Controllers/Front/PcVolunteerController.cs b/New_College.Api/Controllers/Front/PcVolunteerController.cs index 12231ba..e25263d 100644 --- a/New_College.Api/Controllers/Front/PcVolunteerController.cs +++ b/New_College.Api/Controllers/Front/PcVolunteerController.cs @@ -22,7 +22,9 @@ using Microsoft.AspNetCore.Server.IIS.Core; using New_College.Common.WebApiClients.HttpApis; using NPOI.SS.UserModel; using System.IO; -using ClosedXML.Excel; +using MiniExcelLibs; +using OSS.Common.Extension; +using System.Security.Cryptography; namespace New_College.Api.Controllers.Front { @@ -171,7 +173,7 @@ namespace New_College.Api.Controllers.Front MajorCode = c.MajorCode, // MajorGroup = c.MajorGroup, MajorRemark = c.Remark, - planCount = int.Parse(c._23Count), + planCount = c._plancount, PlanId = c.ID, AcademicYear = c.AcademicYear, Sort = s.OrderSort, @@ -216,136 +218,85 @@ namespace New_College.Api.Controllers.Front [HttpPost("Export")] - public async Task Export([FromBody] int id = 0) + public async Task Export([FromBody] MinExcelAttrDto dto) { - if (id <= 0) + if (dto.id <= 0) { throw new Exception("id为空"); } - //var view = new VolunteerTableDetailDtoView(); - //var query = await _VolunteerTableServices.QueryById(id); - //var items = await _VolunteerTableDetailServices.Query(c => c.VolunteerTableId == id); - //var PlanMajorIds = new List(); - //foreach (var item in items) - //{ - // var ids = item.PlanMajorIds.Split(",", StringSplitOptions.RemoveEmptyEntries).Select(c => int.Parse(c)).ToList(); - // PlanMajorIds.AddRange(ids); - //} - //var planmajordesc = await _TbSNeedDataInfoServices.Query(c => SqlFunc.ContainsArray(PlanMajorIds, c.ID));// - //var location = planmajordesc.FirstOrDefault().Location; - //var majorlist = planmajordesc.Select(c => c.MajorName).ToList(); - //var universityname = planmajordesc.Select(c => c.UniversityName).Distinct().ToList(); - //var planmajorcomplist = await _TbSNeedDataInfoServices.Query(c => c.Location == location && SqlFunc.ContainsArray(majorlist, c.MajorName) && SqlFunc.ContainsArray(universityname, c.UniversityName));// - - //view.VolunteerTableName = query.VolunteerTableName; - //view.SubjectClaim = query.SubjectClaim.Length > 2 ? "综合" : query.SubjectClaim; - //view.CustomerId = query.CustomerId; - //view.Score = query.Score; - //view.Type = query.Type; - //view.BatchName = query.BatchName; - //view.CreateTime = query.CreateTime; - //view.ModifyTime = query.ModifyTime; - //var tableDetailItemsViews = new List(); - - //items.ForEach(s => - //{ - // var planids = s.PlanMajorIds.Split(",", StringSplitOptions.RemoveEmptyEntries).Select(ss => long.Parse(ss)).ToList(); - // var typeinfo = new List(); - // if (!string.IsNullOrWhiteSpace(s.VolunteerRemark)) - // { - // typeinfo = s.VolunteerRemark.FromJson>(); - // } - // var planstatus = planmajordesc.Any(e => e.UniversityName == s.UniversityName); - // var firstmodels = planmajordesc.Where(e => e.UniversityName == s.UniversityName).FirstOrDefault(); - // var uitem = new VolunteerTableDetailItemsView() - // { - - // UniversityName = s.UniversityName, - // UniversityCode = s.UniversityCode, - // Sort = s.OrderSort, - // UniversityId = s.UniversityId, - // _211 = planstatus ? firstmodels.LnstitutionalLevel != null ? firstmodels.LnstitutionalLevel.Contains("211") ? "是" : "否" : "否" : "否", - // _985 = planstatus ? firstmodels.LnstitutionalLevel != null ? firstmodels.LnstitutionalLevel.Contains("985") ? "是" : "否" : "否" : "否", - // _SYL = planstatus ? firstmodels.LnstitutionalLevel != null ? firstmodels.LnstitutionalLevel.Contains("双一流") ? "是" : "否" : "否" : "否", - // Ownership = planstatus ? firstmodels.Ownership != null ? firstmodels.Ownership.Contains("省") ? "省属" : firstmodels.Ownership.Contains("市") ? "市属" : firstmodels.Ownership : "" : "", - - // AreaName = planstatus ? firstmodels.Province != null ? firstmodels.Province + "|" + (planstatus ? firstmodels.City : "") : "" : "", - // Nature = planstatus ? firstmodels.Nature != null ? firstmodels.Nature : "" : "", - // Rank = planstatus ? ((string.IsNullOrEmpty(firstmodels.UniversityRank) || firstmodels.UniversityRank == "0") ? "--" : firstmodels.UniversityRank) : "--", - // planMajorItems = planmajordesc.Where(ww => planids.Contains(ww.ID)).Select(c => new VolunteerTablePlanMajorItem() - // { - - // fee = string.IsNullOrEmpty(c.Fee) ? "--" : c.Fee, - // Major = c.MajorName, - // MajorCode = c.MajorCode, - // // MajorGroup = c.MajorGroup, - // MajorRemark = c.Remark, - // planCount = int.Parse(c._23Count), - // PlanId = c.ID, - // AcademicYear = c.AcademicYear, - // Sort = s.OrderSort, - // SubjectClam = c._23subject, - // Percentage = typeinfo.Any() && typeinfo.Count() > 0 ? typeinfo.FirstOrDefault(d => d.planId == c.ID).tage : 0, - // Type = typeinfo.Any() && typeinfo.Count() > 0 ? typeinfo.FirstOrDefault(d => d.planId == c.ID).type : 0, - // PlanItems = new List() - // { - // new PlanItem() { - // PlanCount=c._23Count=="0"?"--":c._23Count, - // RankLine=c._23ScoreLine=="0"?"--":c._23ScoreLine, - // Scoreline=c._23Score == "0" ? "--" : c._23Score, - // Year="2023" - // }, - // new PlanItem() { - // PlanCount=c._22Count=="0"?"--":c._22Count, - // RankLine=c._22ScoreLine=="0"?"--":c._22ScoreLine, - // Scoreline=c._22Score == "0" ? "--" : c._22Score, - // Year="2022" - // }, - // new PlanItem() { - // PlanCount=c._21Count=="0"?"--":c._21Count, - // RankLine=c._21ScoreLine=="0"?"--":c._21ScoreLine, - // Scoreline=c._21Score == "0" ? "--" : c._21Score, - // Year="2021" - // } } - // }).ToList() - // }; - - // tableDetailItemsViews.Add(uitem); - //}); - - // view.tableDetailItemsViews = tableDetailItemsViews; - - using (var workbook = new XLWorkbook()) + var view = new VolunteerExcelAttrModel(); + var query = await _VolunteerTableServices.QueryById(dto.id); + var items = await _VolunteerTableDetailServices.Query(c => c.VolunteerTableId == dto.id); + var PlanMajorIds = new List(); + foreach (var item in items) { - var worksheet = workbook.Worksheets.Add("Sheet1"); - worksheet.Cell(1, 1).Value = "Column1"; - worksheet.Cell(1, 2).Value = "Column2"; - // 假设 YourDataModel 有两个属性 Property1 和 Property2 - int row = 2; - //foreach (var item in data) - //{ - // worksheet.Cell(row, 1).Value = item.Property1; - // worksheet.Cell(row, 2).Value = item.Property2; - // row++; - //} - for (int k = 0; k < 5; k++) - { - worksheet.Cell(row, 1).Value = k; - worksheet.Cell(row, 2).Value = k; - row++; - } - - using (var stream = new MemoryStream()) - { - workbook.SaveAs(stream); - stream.Position = 0; - - return File(stream, "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", "export.xlsx"); - } - + var ids = item.PlanMajorIds.Split(",", StringSplitOptions.RemoveEmptyEntries).Select(c => int.Parse(c)).ToList(); + PlanMajorIds.AddRange(ids); } + var planmajordesc = await _TbSNeedDataInfoServices.Query(c => SqlFunc.ContainsArray(PlanMajorIds, c.ID));// + var location = planmajordesc.FirstOrDefault().Location; + var majorlist = planmajordesc.Select(c => c.MajorName).ToList(); + var universityname = planmajordesc.Select(c => c.UniversityName).Distinct().ToList(); + var planmajorcomplist = await _TbSNeedDataInfoServices.Query(c => c.Location == location && SqlFunc.ContainsArray(majorlist, c.MajorName) && SqlFunc.ContainsArray(universityname, c.UniversityName));// + view.VolunteerTableName = query.VolunteerTableName; + view.SubjectClaim = query.SubjectClaim; + view.Score = query.Score; + view.Type = query.Type; + var tableDetailItemsViews = new List(); + items.ForEach(s => + { + var planids = s.PlanMajorIds.Split(",", StringSplitOptions.RemoveEmptyEntries).Select(ss => long.Parse(ss)).ToList(); + var typeinfo = new List(); + if (!string.IsNullOrWhiteSpace(s.VolunteerRemark)) + { + typeinfo = s.VolunteerRemark.FromJson>(); + } + var planstatus = planmajordesc.Any(e => e.UniversityName == s.UniversityName); + var firstmodels = planmajordesc.Where(e => e.UniversityName == s.UniversityName).FirstOrDefault(); + planmajordesc.Where(ww => planids.Contains(ww.ID)).ToList().ForEach(a => + { + tableDetailItemsViews.Add(new VolunteerItemsViewMinExcelAttr() + { + UniversityName = s.UniversityName, + UniversityCode = s.UniversityCode, + AreaName = planstatus ? firstmodels.Province != null ? firstmodels.Province + "|" + (planstatus ? firstmodels.City : "") : "" : "", + Nature = planstatus ? firstmodels.Nature != null ? firstmodels.Nature : "" : "", + fee = string.IsNullOrEmpty(a.Fee) ? "--" : a.Fee, + Major = a.MajorName, + MajorCode = a.MajorCode, + // MajorGroup = c.MajorGroup, + // MajorRemark = a.Remark, + planCount = a._plancount, + AcademicYear = a.AcademicYear, + Sort = s.OrderSort, + MajorSubjectClam = a._23subject, + _23PlanCount = a._23Count == "0" ? "--" : a._23Count, + _22PlanCount = a._22Count == "0" ? "--" : a._22Count, + _21PlanCount = a._21Count == "0" ? "--" : a._21Count, + _21RankLine = a._21ScoreLine == "0" ? "--" : a._21ScoreLine, + _21Scoreline = a._21Score == "0" ? "--" : a._21Score, + _22RankLine = a._22ScoreLine == "0" ? "--" : a._22ScoreLine, + _22Scoreline = a._22Score == "0" ? "--" : a._22Score, + _23RankLine = a._23ScoreLine == "0" ? "--" : a._23ScoreLine, + _23Scoreline = a._23Score == "0" ? "--" : a._23Score, + }); + }); + }); + // view.viewMinExcelAttrs = tableDetailItemsViews; + //在内存中当开辟空间 + var memoryStream = new MemoryStream(); + //将数据写到内存当中 + memoryStream.SaveAs(tableDetailItemsViews, true, string.Format("模拟志愿表:_{0}_选科:{1}|_分数:{2}|_类型_{3}", view.VolunteerTableName, view.SubjectClaim, view.Score, view.Type)); + //从0的位置开始写入 + memoryStream.Seek(0, SeekOrigin.Begin); + + //返回文件流 //格式是Excel格式 + return new FileStreamResult(memoryStream, "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet") + { + FileDownloadName = string.Format("{0}.xlsx", DateTime.Now.ToString("yyyyMMddhhssfff_")) + }; } diff --git a/New_College.Api/New_College.Api.csproj b/New_College.Api/New_College.Api.csproj index a28bb70..c5ea718 100644 --- a/New_College.Api/New_College.Api.csproj +++ b/New_College.Api/New_College.Api.csproj @@ -51,13 +51,13 @@ - - + + diff --git a/New_College.Model/Models/T_TbSNeedDataInfo.cs b/New_College.Model/Models/T_TbSNeedDataInfo.cs index e567015..f3df3bf 100644 --- a/New_College.Model/Models/T_TbSNeedDataInfo.cs +++ b/New_College.Model/Models/T_TbSNeedDataInfo.cs @@ -2,259 +2,266 @@ using SqlSugar; namespace New_College.Model.Models { - /// - /// - /// - //[SugarTable("T_TbSNeedDataInfo")] - public class T_TbSNeedDataInfo - { + /// + /// + /// + //[SugarTable("T_TbSNeedDataInfo")] + public class T_TbSNeedDataInfo + { - /// - /// 主键ID - /// + /// + /// 主键ID + /// [SugarColumn(ColumnName = "ID", IsPrimaryKey = true)] - public long ID { get; set; } - /// - /// 招生类型 - /// - [SugarColumn(ColumnName="EnrollmentType" )] - public string EnrollmentType { get; set; } - /// - /// 全国统一招生代码 - /// - [SugarColumn(ColumnName="EnrollmentCode" )] - public string EnrollmentCode { get; set; } - /// - /// 院校名称 - /// - [SugarColumn(ColumnName="UniversityName" )] - public string UniversityName { get; set; } - /// - /// 专业代码 - /// - [SugarColumn(ColumnName="MajorCode" )] - public string MajorCode { get; set; } - /// - /// 专业名称 - /// - [SugarColumn(ColumnName="MajorName" )] - public string MajorName { get; set; } + public long ID { get; set; } + /// + /// 招生类型 + /// + [SugarColumn(ColumnName = "EnrollmentType")] + public string EnrollmentType { get; set; } + /// + /// 全国统一招生代码 + /// + [SugarColumn(ColumnName = "EnrollmentCode")] + public string EnrollmentCode { get; set; } + /// + /// 院校名称 + /// + [SugarColumn(ColumnName = "UniversityName")] + public string UniversityName { get; set; } + /// + /// 专业代码 + /// + [SugarColumn(ColumnName = "MajorCode")] + public string MajorCode { get; set; } + /// + /// 专业名称 + /// + [SugarColumn(ColumnName = "MajorName")] + public string MajorName { get; set; } /// /// 办学性质0、公办,1、民办,2中外合作,3 港澳台 /// - [SugarColumn(ColumnName="Nature" )] - public string Nature { get; set; } - /// - /// 注意事项 - /// - [SugarColumn(ColumnName="Remark" )] - public string Remark { get; set; } - /// - /// 专业大类 - /// - [SugarColumn(ColumnName="FirstType" )] - public string FirstType { get; set; } - /// - /// - /// - [SugarColumn(ColumnName="_23subject" )] - public string _23subject { get; set; } - /// - /// - /// - [SugarColumn(ColumnName="_24subject" )] - public string _24subject { get; set; } - /// - /// - /// - [SugarColumn(ColumnName="_23Count" )] - public string _23Count { get; set; } - /// - /// - /// - [SugarColumn(ColumnName="_Score" )] - public string _Score { get; set; } - /// - /// - /// - [SugarColumn(ColumnName="_23Score" )] - public string _23Score { get; set; } - /// - /// - /// - [SugarColumn(ColumnName="_23ScoreLine" )] - public string _23ScoreLine { get; set; } - /// - /// - /// - [SugarColumn(ColumnName="_23SchoolScore" )] - public string _23SchoolScore { get; set; } - /// - /// - /// - [SugarColumn(ColumnName="_23SchoolScoreLine" )] - public string _23SchoolScoreLine { get; set; } - /// - /// - /// - [SugarColumn(ColumnName="_23SchoolAvgScore" )] - public string _23SchoolAvgScore { get; set; } - /// - /// - /// - [SugarColumn(ColumnName="_23SchoolAvgLine" )] - public string _23SchoolAvgLine { get; set; } - /// - /// - /// - [SugarColumn(ColumnName="_22Count" )] - public string _22Count { get; set; } - /// - /// - /// - [SugarColumn(ColumnName="_22Score" )] - public string _22Score { get; set; } - /// - /// - /// - [SugarColumn(ColumnName="_22ScoreLine" )] - public string _22ScoreLine { get; set; } - /// - /// - /// - [SugarColumn(ColumnName="_21Count" )] - public string _21Count { get; set; } - /// - /// - /// - [SugarColumn(ColumnName="_21Score" )] - public string _21Score { get; set; } - /// - /// - /// - [SugarColumn(ColumnName="_21ScoreLine" )] - public string _21ScoreLine { get; set; } - /// - /// - /// - [SugarColumn(ColumnName="_20Count" )] - public string _20Count { get; set; } - /// - /// - /// - [SugarColumn(ColumnName="_20Score" )] - public string _20Score { get; set; } - /// - /// - /// - [SugarColumn(ColumnName="_20ScoreLine" )] - public string _20ScoreLine { get; set; } - /// - /// 学制 - /// - [SugarColumn(ColumnName="AcademicYear" )] - public string AcademicYear { get; set; } - /// - /// - /// - [SugarColumn(ColumnName="Fee" )] - public string Fee { get; set; } - /// - /// - /// - [SugarColumn(ColumnName="Province" )] - public string Province { get; set; } - /// - /// - /// - [SugarColumn(ColumnName="City" )] - public string City { get; set; } - /// - /// 主管部门 - /// - [SugarColumn(ColumnName="Ownership" )] - public string Ownership { get; set; } - /// - /// 院校水平 - /// - [SugarColumn(ColumnName="LnstitutionalLevel" )] - public string LnstitutionalLevel { get; set; } - /// - /// 专业评估 - /// - [SugarColumn(ColumnName="ProfessionalAssessment" )] - public string ProfessionalAssessment { get; set; } - /// - /// 硕士点 - /// - [SugarColumn(ColumnName="MastersDegree" )] - public string MastersDegree { get; set; } - /// - /// 硕士专业 - /// - [SugarColumn(ColumnName="MastersMajor" )] - public string MastersMajor { get; set; } - /// - /// 博士点 - /// - [SugarColumn(ColumnName="PhDPoint" )] - public string PhDPoint { get; set; } - /// - /// 博士专业 - /// - [SugarColumn(ColumnName="PhDMajor" )] - public string PhDMajor { get; set; } - /// - /// 专业水平 - /// - [SugarColumn(ColumnName="MjaorLevel" )] - public string MjaorLevel { get; set; } - /// - /// 本/专 - /// - [SugarColumn(ColumnName="EducationCategory" )] - public string EducationCategory { get; set; } - /// - /// 院校排名 - /// - [SugarColumn(ColumnName="UniversityRank" )] - public string UniversityRank { get; set; } - /// - /// 专业排名 - /// - [SugarColumn(ColumnName="MajorRank" )] - public string MajorRank { get; set; } - /// - /// 专业占比 - /// - [SugarColumn(ColumnName="MajorRankPercentage" )] - public string MajorRankPercentage { get; set; } - /// - /// 专业数量 - /// - [SugarColumn(ColumnName="MajorCount" )] - public string MajorCount { get; set; } - /// - /// - /// - [SugarColumn(ColumnName="VRUrl" )] - public string VRUrl { get; set; } - /// - /// 就业质量 - /// - [SugarColumn(ColumnName="EmploymentQuality" )] - public string EmploymentQuality { get; set; } + [SugarColumn(ColumnName = "Nature")] + public string Nature { get; set; } + /// + /// 注意事项 + /// + [SugarColumn(ColumnName = "Remark")] + public string Remark { get; set; } + /// + /// 专业大类 + /// + [SugarColumn(ColumnName = "FirstType")] + public string FirstType { get; set; } + /// + /// + /// + [SugarColumn(ColumnName = "_23subject")] + public string _23subject { get; set; } + /// + /// + /// + [SugarColumn(ColumnName = "_24subject")] + public string _24subject { get; set; } - /// - /// 所在地 - /// + + /// + /// 最新招生人数 + /// + [SugarColumn(ColumnName = "_plancount")] + public int _plancount { get; set; } + /// + /// + /// + [SugarColumn(ColumnName = "_23Count")] + public string _23Count { get; set; } + /// + /// + /// + [SugarColumn(ColumnName = "_Score")] + public string _Score { get; set; } + /// + /// + /// + [SugarColumn(ColumnName = "_23Score")] + public string _23Score { get; set; } + /// + /// + /// + [SugarColumn(ColumnName = "_23ScoreLine")] + public string _23ScoreLine { get; set; } + /// + /// + /// + [SugarColumn(ColumnName = "_23SchoolScore")] + public string _23SchoolScore { get; set; } + /// + /// + /// + [SugarColumn(ColumnName = "_23SchoolScoreLine")] + public string _23SchoolScoreLine { get; set; } + /// + /// + /// + [SugarColumn(ColumnName = "_23SchoolAvgScore")] + public string _23SchoolAvgScore { get; set; } + /// + /// + /// + [SugarColumn(ColumnName = "_23SchoolAvgLine")] + public string _23SchoolAvgLine { get; set; } + /// + /// + /// + [SugarColumn(ColumnName = "_22Count")] + public string _22Count { get; set; } + /// + /// + /// + [SugarColumn(ColumnName = "_22Score")] + public string _22Score { get; set; } + /// + /// + /// + [SugarColumn(ColumnName = "_22ScoreLine")] + public string _22ScoreLine { get; set; } + /// + /// + /// + [SugarColumn(ColumnName = "_21Count")] + public string _21Count { get; set; } + /// + /// + /// + [SugarColumn(ColumnName = "_21Score")] + public string _21Score { get; set; } + /// + /// + /// + [SugarColumn(ColumnName = "_21ScoreLine")] + public string _21ScoreLine { get; set; } + /// + /// + /// + [SugarColumn(ColumnName = "_20Count")] + public string _20Count { get; set; } + /// + /// + /// + [SugarColumn(ColumnName = "_20Score")] + public string _20Score { get; set; } + /// + /// + /// + [SugarColumn(ColumnName = "_20ScoreLine")] + public string _20ScoreLine { get; set; } + /// + /// 学制 + /// + [SugarColumn(ColumnName = "AcademicYear")] + public string AcademicYear { get; set; } + /// + /// + /// + [SugarColumn(ColumnName = "Fee")] + public string Fee { get; set; } + /// + /// + /// + [SugarColumn(ColumnName = "Province")] + public string Province { get; set; } + /// + /// + /// + [SugarColumn(ColumnName = "City")] + public string City { get; set; } + /// + /// 主管部门 + /// + [SugarColumn(ColumnName = "Ownership")] + public string Ownership { get; set; } + /// + /// 院校水平 + /// + [SugarColumn(ColumnName = "LnstitutionalLevel")] + public string LnstitutionalLevel { get; set; } + /// + /// 专业评估 + /// + [SugarColumn(ColumnName = "ProfessionalAssessment")] + public string ProfessionalAssessment { get; set; } + /// + /// 硕士点 + /// + [SugarColumn(ColumnName = "MastersDegree")] + public string MastersDegree { get; set; } + /// + /// 硕士专业 + /// + [SugarColumn(ColumnName = "MastersMajor")] + public string MastersMajor { get; set; } + /// + /// 博士点 + /// + [SugarColumn(ColumnName = "PhDPoint")] + public string PhDPoint { get; set; } + /// + /// 博士专业 + /// + [SugarColumn(ColumnName = "PhDMajor")] + public string PhDMajor { get; set; } + /// + /// 专业水平 + /// + [SugarColumn(ColumnName = "MjaorLevel")] + public string MjaorLevel { get; set; } + /// + /// 本/专 + /// + [SugarColumn(ColumnName = "EducationCategory")] + public string EducationCategory { get; set; } + /// + /// 院校排名 + /// + [SugarColumn(ColumnName = "UniversityRank")] + public string UniversityRank { get; set; } + /// + /// 专业排名 + /// + [SugarColumn(ColumnName = "MajorRank")] + public string MajorRank { get; set; } + /// + /// 专业占比 + /// + [SugarColumn(ColumnName = "MajorRankPercentage")] + public string MajorRankPercentage { get; set; } + /// + /// 专业数量 + /// + [SugarColumn(ColumnName = "MajorCount")] + public string MajorCount { get; set; } + /// + /// + /// + [SugarColumn(ColumnName = "VRUrl")] + public string VRUrl { get; set; } + /// + /// 就业质量 + /// + [SugarColumn(ColumnName = "EmploymentQuality")] + public string EmploymentQuality { get; set; } + + /// + /// 所在地 + /// [SugarColumn(ColumnName = "Location")] public string Location { get; set; } - /// - /// - /// + /// + /// + /// [SugarColumn(ColumnName = "SubjectType")] public string SubjectType { get; set; } diff --git a/New_College.Model/New_College.Model.csproj b/New_College.Model/New_College.Model.csproj index 1d47af0..d640c0c 100644 --- a/New_College.Model/New_College.Model.csproj +++ b/New_College.Model/New_College.Model.csproj @@ -15,6 +15,7 @@ + diff --git a/New_College.Model/ViewModels/Result/UniversityResult.cs b/New_College.Model/ViewModels/Result/UniversityResult.cs index d102611..6540c03 100644 --- a/New_College.Model/ViewModels/Result/UniversityResult.cs +++ b/New_College.Model/ViewModels/Result/UniversityResult.cs @@ -155,7 +155,6 @@ namespace New_College.Model.ViewModels public string collegeCode { get; set; } - public int Rank { get; set; } /// /// 官网 /// @@ -239,8 +238,7 @@ namespace New_College.Model.ViewModels public string VrUrl { get; set; } - - + public int Rank { get; set; } } diff --git a/New_College.Model/ViewModels/VolunteerTableDtoView.cs b/New_College.Model/ViewModels/VolunteerTableDtoView.cs index 0d088ab..44efa62 100644 --- a/New_College.Model/ViewModels/VolunteerTableDtoView.cs +++ b/New_College.Model/ViewModels/VolunteerTableDtoView.cs @@ -1,4 +1,5 @@ -using New_College.Model.Models; +using MiniExcelLibs.Attributes; +using New_College.Model.Models; using SqlSugar; using System; using System.Collections.Generic; @@ -27,7 +28,7 @@ namespace New_College.Model.ViewModels /// /// 靠谱率 /// - public string CP { get; set; } + public string CP { get; set; } /// /// 志愿表名称 @@ -100,18 +101,174 @@ namespace New_College.Model.ViewModels /// /// 排名 /// - public string Rank { get; set; } + public string Rank { get; set; } /// /// 公办|民办 /// public string Nature { get; set; } + /// /// /// public List planMajorItems { get; set; } } + public class MinExcelAttrDto + { + + public int id { get; set; } + } + + public class VolunteerItemsViewMinExcelAttr + { + [ExcelColumnName("排序")] + public int Sort { get; set; } + /// + /// 院校名称 + /// + [ExcelColumnName("院校名称")] + public string UniversityName { get; set; } + + /// + /// 院校编码 + /// + [ExcelColumnName("院校编码")] + public string UniversityCode { get; set; } + + + + /// + /// 学校所在地区 + /// + [ExcelColumnName("学校所在地区")] + public string AreaName { get; set; } + + + + /// + /// 公办|民办 + /// + [ExcelColumnName("学校类型")] + public string Nature { get; set; } + + /// + /// 专业代码 + /// + /// + [ExcelColumnName("专业代码")] + public string MajorCode { get; set; } + /// + /// 专业组 + /// + [ExcelColumnName("专业组")] + public string MajorGroup { get; set; } + /// + /// 专业名称 + /// + [ExcelColumnName("专业名称")] + public string Major { get; set; } + + ///// + ///// 专业备注 + ///// + //[ExcelColumnName("专业备注")] + //public string MajorRemark { get; set; } + + [ExcelColumnName("学制")] + public string AcademicYear { get; set; } + + /// + /// 专业选科 + /// + [ExcelColumnName("专业选科")] + public string MajorSubjectClam { get; set; } + /// + /// 计划数 + /// + [ExcelColumnName("计划数量")] + public int planCount { get; set; } + + + /// + /// 学费 + /// + [ExcelColumnName("学费")] + public string fee { get; set; } + //public List planMajorItems { get; set; } + + [ExcelColumnName("23计划")] + public string _23PlanCount { get; set; } + /// + /// 位次 + /// + [ExcelColumnName("23最低位次")] + public string _23RankLine { get; set; } + + ///// + ///// 最低分 + ///// + [ExcelColumnName("23最低分")] + public string _23Scoreline { get; set; } + + [ExcelColumnName("22计划")] + public string _22PlanCount { get; set; } + /// + /// 位次 + /// + [ExcelColumnName("22最低位次")] + public string _22RankLine { get; set; } + + ///// + ///// 最低分 + ///// + [ExcelColumnName("22最低分")] + public string _22Scoreline { get; set; } + + [ExcelColumnName("21计划")] + public string _21PlanCount { get; set; } + /// + /// 位次 + /// + [ExcelColumnName("21最低位次")] + public string _21RankLine { get; set; } + + ///// + ///// 最低分 + ///// + [ExcelColumnName("21最低分")] + public string _21Scoreline { get; set; } + + } + + public class VolunteerExcelAttrModel + { + /// + /// 志愿表名称 + /// + /// + [ExcelColumnName("志愿表名称")] + public string VolunteerTableName { get; set; } + + + /// + /// 志愿填报类型(智能填报|一键填报) + /// + [ExcelColumnName("填报类型")] + public string Type { get; set; } + + /// + /// 选科科目 + /// + [ExcelColumnName("选科科目")] + public string SubjectClaim { get; set; } + + [ExcelColumnName("分数")] + public float Score { get; set; } + + + + } public class VolunteerTablePlanMajorItem { @@ -145,7 +302,7 @@ namespace New_College.Model.ViewModels /// public string MajorRemark { get; set; } - public string AcademicYear { get; set; } + public string AcademicYear { get; set; } /// /// 选科组合 @@ -228,9 +385,9 @@ namespace New_College.Model.ViewModels public List volunteerTableDetailViews { get; set; } - + public DateTime? CreateTime { get; set; } - + public DateTime? ModifyTime { get; set; } }