diff --git a/New_College.Api/Controllers/Back/D_PlanMajorDescController.cs b/New_College.Api/Controllers/Back/D_PlanMajorDescController.cs index 7dc201d..53e9d3a 100644 --- a/New_College.Api/Controllers/Back/D_PlanMajorDescController.cs +++ b/New_College.Api/Controllers/Back/D_PlanMajorDescController.cs @@ -53,7 +53,7 @@ namespace New_College.Api.Controllers }; } - if (!string.IsNullOrWhiteSpace(request.SubjectClaim)) + if (string.IsNullOrWhiteSpace(request.SubjectClaim)) { return new MessageModel>() { @@ -62,7 +62,7 @@ namespace New_College.Api.Controllers }; } - if (!string.IsNullOrWhiteSpace(request.BatchName)) + if (string.IsNullOrWhiteSpace(request.BatchName)) { return new MessageModel>() { @@ -100,12 +100,12 @@ namespace New_College.Api.Controllers /// /// [HttpGet] - public async Task>> AIGo([FromQuery] OneSubmitGoRequest request) + public async Task>> AIGo([FromQuery] OneSubmitGoRequest request) { if (string.IsNullOrWhiteSpace(request.Location)) { - return new MessageModel>() + return new MessageModel>() { msg = "Location字段必传参数", @@ -113,25 +113,25 @@ namespace New_College.Api.Controllers } if (request.Year <= 0) { - return new MessageModel>() + return new MessageModel>() { msg = "Year字段必传参数", }; } - if (!string.IsNullOrWhiteSpace(request.SubjectClaim)) + if (string.IsNullOrWhiteSpace(request.SubjectClaim)) { - return new MessageModel>() + return new MessageModel>() { msg = "SubjectClaim字段必传参数", }; } - if (!string.IsNullOrWhiteSpace(request.BatchName)) + if (string.IsNullOrWhiteSpace(request.BatchName)) { - return new MessageModel>() + return new MessageModel>() { msg = "BatchName字段必传参数", @@ -142,7 +142,7 @@ namespace New_College.Api.Controllers var response = await _d_PlanMajorDescServices.GetAIGoList(request); if (response.data == null || !response.data.Any() || response.dataCount <= 0) { - return new MessageModel>() + return new MessageModel>() { msg = "获取失败", success = false, @@ -150,7 +150,7 @@ namespace New_College.Api.Controllers }; } - return new MessageModel>() + return new MessageModel>() { msg = "获取成功", success = true, diff --git a/New_College.Api/Controllers/Front/CustomerController.cs b/New_College.Api/Controllers/Front/CustomerController.cs index 8069d5c..0e3b898 100644 --- a/New_College.Api/Controllers/Front/CustomerController.cs +++ b/New_College.Api/Controllers/Front/CustomerController.cs @@ -211,7 +211,7 @@ namespace New_College.Api.Controllers.Front /// /// [HttpPost] - public async Task> UpdateCustomer(CustomerUpdateQuery query) + public async Task> UpdateCustomer([FromBody]CustomerUpdateQuery query) { var result = await _services.UpdateCustomer(query); if (result.Id > 0) diff --git a/New_College.Api/New_College.Model.xml b/New_College.Api/New_College.Model.xml index d4500a6..3b5932a 100644 --- a/New_College.Api/New_College.Model.xml +++ b/New_College.Api/New_College.Model.xml @@ -766,6 +766,21 @@ 学校 + + + 学校归属:教育部,上海市-湖北省 + + + + + 院校所在省份 + + + + + + + 软科排名 @@ -801,6 +816,11 @@ 招生代码 + + + 办学性质:公办 民办 + + 招生类型 @@ -2784,6 +2804,46 @@ 返回数据 + + + 冲 + + + + + 稳 + + + + + 保 + + + + + 当前页标 + + + + + 总页数 + + + + + 数据总数 + + + + + 每页大小 + + + + + 返回数据 + + 用户头像 @@ -3750,6 +3810,81 @@ 学校归属:教育部,上海市-湖北省 + + + 冲稳保 类型:冲2,稳1,保0 + + + + + 排名 + + + + + 全国统一招生代码 + + + + + + + + + + 计划数 + + + + + AIGO + + + + + 计划数 + + + + + 学费 + + + + + 专业代码 + + + + + 专业组 + + + + + 专业名称 + + + + + 专业备注 + + + + + 选科组合 + + + + + + + + + + 招生计划Id + + 一键填报返回值 diff --git a/New_College.Api/Properties/launchSettings.json b/New_College.Api/Properties/launchSettings.json index de44141..839f7f0 100644 --- a/New_College.Api/Properties/launchSettings.json +++ b/New_College.Api/Properties/launchSettings.json @@ -14,8 +14,8 @@ "launchBrowser": true, "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" - }, - "applicationUrl": "http://localhost:8083" + } + }, "IIS Express": { "commandName": "IISExpress", diff --git a/New_College.Api/Startup.cs b/New_College.Api/Startup.cs index 0bec36e..c319d1b 100644 --- a/New_College.Api/Startup.cs +++ b/New_College.Api/Startup.cs @@ -139,7 +139,7 @@ namespace New_College //允许额外符号 options.JsonSerializerOptions.AllowTrailingCommas = true; //反序列化过程中属性名称是否使用不区分大小写的比较 - options.JsonSerializerOptions.PropertyNameCaseInsensitive = false; + // options.JsonSerializerOptions.PropertyNameCaseInsensitive = false; ////忽略循环引用 //options.JsonSerializerOptions.ReferenceLoopHandling = ReferenceLoopHandling.Ignore; diff --git a/New_College.Api/appsettings.json b/New_College.Api/appsettings.json index 5a5fb8d..37c2ef4 100644 --- a/New_College.Api/appsettings.json +++ b/New_College.Api/appsettings.json @@ -26,7 +26,7 @@ "Name": "New_College" } }, - "urls": "http://*:8082", // IIS 部署,注释掉 + "urls": "http://*:8083", // IIS 部署,注释掉 "AllowedHosts": "*", "AppSettings": { "RedisCachingAOP": { diff --git a/New_College.IServices/ID_PlanMajorDescServices.cs b/New_College.IServices/ID_PlanMajorDescServices.cs index a338189..3242c8f 100644 --- a/New_College.IServices/ID_PlanMajorDescServices.cs +++ b/New_College.IServices/ID_PlanMajorDescServices.cs @@ -26,6 +26,6 @@ namespace New_College.IServices /// /// /// - Task> GetAIGoList(OneSubmitGoRequest request); + Task> GetAIGoList(OneSubmitGoRequest request); } } \ No newline at end of file diff --git a/New_College.Model/Models/D_QualificationLine.cs b/New_College.Model/Models/D_QualificationLine.cs index 17de230..a16e2a9 100644 --- a/New_College.Model/Models/D_QualificationLine.cs +++ b/New_College.Model/Models/D_QualificationLine.cs @@ -28,6 +28,28 @@ namespace New_College.Model.Models /// public string UniversityName { get; set; } + /// + ///学校归属:教育部,上海市-湖北省 + /// + public string Ownership { get; set; } + + + /// + /// 院校所在省份 + /// + public string AreaName { get; set; } + + + public string _985 { get; set; } + + + public string _211 { get; set; } + + /// + /// + /// + public string _SYL { get; set; } + /// /// 软科排名 @@ -66,6 +88,10 @@ namespace New_College.Model.Models public int RecruitCode { get; set; } + /// + /// 办学性质:公办 民办 + /// + public string Nature { get; set; } /// /// 招生类型 /// diff --git a/New_College.Model/PageModel.cs b/New_College.Model/PageModel.cs index 9d769e3..e5dcbe1 100644 --- a/New_College.Model/PageModel.cs +++ b/New_College.Model/PageModel.cs @@ -30,4 +30,46 @@ namespace New_College.Model } + + public class AIGOPageModel + { + + /// + /// 冲 + /// + public int c { get; set; } + + /// + /// 稳 + /// + public int w { get; set; } + + /// + /// 保 + /// + public int b { get; set; } + /// + /// 当前页标 + /// + public int page { get; set; } = 1; + /// + /// 总页数 + /// + public int pageCount { get; set; } = 6; + /// + /// 数据总数 + /// + public int dataCount { get; set; } = 0; + /// + /// 每页大小 + /// + public int PageSize { set; get; } + /// + /// 返回数据 + /// + public List data { get; set; } + + } + + } diff --git a/New_College.Model/ViewModels/Query/OneSubmitGoRequest.cs b/New_College.Model/ViewModels/Query/OneSubmitGoRequest.cs index 7ccd1ed..ea694eb 100644 --- a/New_College.Model/ViewModels/Query/OneSubmitGoRequest.cs +++ b/New_College.Model/ViewModels/Query/OneSubmitGoRequest.cs @@ -102,6 +102,101 @@ namespace New_College.Model.ViewModels } + public class AIGOResponse + { + public int LowScoreRank { get; set; } + /// + /// 冲稳保 类型:冲2,稳1,保0 + /// + public int Type { get; set; } + /// + /// 排名 + /// + public string Rank { get; set; } + + public int UniversityId { get; set; } + + public string UniversityName { get; set; } + + + /// + /// 全国统一招生代码 + /// + public string UniversityCode { get; set; } + + public string AreaName { get; set; } + + public string _985 { get; set; } + + + public string _211 { get; set; } + + /// + /// + /// + public string _SYL { get; set; } + + /// + /// 计划数 + /// + public int planCount { get; set; } + + /// + /// AIGO + /// + public List iGoPlanMajorItems { get; set; } + + } + + + public class AIGoPlanMajorItem + { + + /// + /// 计划数 + /// + public int planCount { get; set; } + + /// + /// 学费 + /// + public string fee { get; set; } + + + /// + /// 专业代码 + /// + public string MajorCode { get; set; } + /// + /// 专业组 + /// + public string MajorGroup { get; set; } + /// + /// 专业名称 + /// + public string Major { get; set; } + + /// + /// 专业备注 + /// + public string MajorRemark { get; set; } + + /// + /// 选科组合 + /// + public string SubjectClam { get; set; } + + /// + /// + /// + public List PlanItems { get; set; } + + /// + /// 招生计划Id + /// + public int PlanId { get; set; } + } + /// /// 一键填报返回值 @@ -202,4 +297,9 @@ namespace New_College.Model.ViewModels public int Scoreline { get; set; } } + + + + + } diff --git a/New_College.Services/D_PlanMajorDescServices.cs b/New_College.Services/D_PlanMajorDescServices.cs index 5540fbf..44fb6ac 100644 --- a/New_College.Services/D_PlanMajorDescServices.cs +++ b/New_College.Services/D_PlanMajorDescServices.cs @@ -11,6 +11,7 @@ using System.Linq.Expressions; using System; using System.Linq; using New_College.Common; +using New_College.IRepository; namespace New_College.Services { @@ -21,10 +22,12 @@ namespace New_College.Services public class D_PlanMajorDescServices : BaseServices, ID_PlanMajorDescServices { private readonly IBaseRepository _dal; - public D_PlanMajorDescServices(IBaseRepository dal) + private readonly ID_QualificationLineRepository _qualificationLineRepository; + public D_PlanMajorDescServices(IBaseRepository dal, ID_QualificationLineRepository d_QualificationLineRepository) { this._dal = dal; base.BaseDal = dal; + _qualificationLineRepository = d_QualificationLineRepository; } @@ -33,20 +36,19 @@ namespace New_College.Services /// /// /// - public async Task> GetAIGoList(OneSubmitGoRequest request) + public async Task> GetAIGoList(OneSubmitGoRequest request) { - var pagemodel = new PageModel(); + var pagemodel = new AIGOPageModel(); int startscore = request.Score - 15; int endscore = request.Score + 15; - Expression> expression = Expressionable.Create() + int qyear = request.Year >= DateTime.Now.Year ? DateTime.Now.Year - 1 : 2022; + Expression> expression = Expressionable.Create() + .And(c => c.Years == qyear) .And(c => c.IsDelete == false) .And(c => c.Location == request.Location) - .AndIF(!string.IsNullOrWhiteSpace(request.Major), c => SqlFunc.Contains(c.Major,request.Major)) - .AndIF(!string.IsNullOrWhiteSpace(request.SubjectClaim), c => SqlFunc.Contains(request.SubjectClaim, c.SelectSubject)) .AndIF(!string.IsNullOrWhiteSpace(request.BatchName), c => c.BatchName.Equals(request.BatchName)) - .AndIF(!string.IsNullOrWhiteSpace(request.Province), c => SqlFunc.Contains(request.Province, c.AreaName)) - .And(c => c.Years == request.Year) - .AndIF(!string.IsNullOrWhiteSpace(request.SchoolType), c => c.SchoolType == request.SchoolType) + .AndIF(!string.IsNullOrWhiteSpace(request.Province), c => SqlFunc.Contains(request.Province, c.AreaName)) + .AndIF(!string.IsNullOrWhiteSpace(request.SchoolType), c => c.SubjectType == request.SchoolType) .AndIF(request.Score > 0 && (request.EndScore <= endscore && request.StartScore >= startscore), c => SqlFunc.Between(c.LowScore, startscore, endscore)) .AndIF(request.EndScore > endscore || request.StartScore < startscore, c => SqlFunc.Between(c.LowScore, request.StartScore, request.EndScore)) .AndIF(request.Syl.HasValue && request.Syl == 1, c => c._SYL == "是") @@ -54,18 +56,17 @@ namespace New_College.Services .AndIF(request._985.HasValue && request._985 == 1, c => c._985 == "是") .AndIF(!string.IsNullOrWhiteSpace(request.Ownership), c => c.Ownership == request.Ownership) .AndIF(!string.IsNullOrWhiteSpace(request.Nature), c => c.Nature == request.Nature) - //.AndIF(request. > 0, c => SqlFunc.Between(c.LowScore, request.Score, request.Score)) 位次区间 .ToExpression(); - var query = await _dal.QueryPage(expression, request.PageIndex, request.PageSize, " LowScoreRank desc "); + var query = await _qualificationLineRepository.QueryPage(expression, request.PageIndex, request.PageSize, " LowScoreRank desc "); - var majorarry = query.data.Select(c => c.Major).Distinct().ToArray(); + //var majorarry = query.data.Select(c => c.Major).Distinct().ToArray(); var universityarry = query.data.Select(c => c.UId).Distinct().ToArray();// Expression> expression2 = Expressionable.Create() .And(c => c.IsDelete == false) .And(c => c.Location == request.Location) .AndIF(!string.IsNullOrWhiteSpace(request.Major), c => SqlFunc.Contains(c.Major, request.Major)) - // .AndIF(!string.IsNullOrWhiteSpace(request.SubjectClaim), c => SqlFunc.Contains(request.SubjectClaim, c.SelectSubject)) //此条件不带 - .AndIF(!string.IsNullOrWhiteSpace(request.BatchName), c => c.BatchName == request.BatchName.Trim()) + .AndIF(!string.IsNullOrWhiteSpace(request.SubjectClaim), c => SqlFunc.Contains(c.SelectSubject, request.SubjectClaim)) //此条件不带 + .AndIF(!string.IsNullOrWhiteSpace(request.BatchName), c => c.BatchName == request.BatchName) .AndIF(!string.IsNullOrWhiteSpace(request.Province), c => SqlFunc.Contains(request.Province, c.AreaName)) .AndIF(!string.IsNullOrWhiteSpace(request.SchoolType), c => c.SchoolType == request.SchoolType) .AndIF(request.Syl.HasValue && request.Syl == 1, c => c._SYL == "是") @@ -73,9 +74,9 @@ namespace New_College.Services .AndIF(request._985.HasValue && request._985 == 1, c => c._985 == "是") .AndIF(!string.IsNullOrWhiteSpace(request.Ownership), c => c.Ownership == request.Ownership) .AndIF(!string.IsNullOrWhiteSpace(request.Nature), c => c.Nature == request.Nature) - .AndIF(majorarry.Any(), c => SqlFunc.ContainsArray(majorarry, c.Major)) + //.AndIF(majorarry.Any(), c => SqlFunc.ContainsArray(majorarry, c.Major)) .AndIF(universityarry.Any(), c => SqlFunc.ContainsArray(universityarry, c.UId)) - //.AndIF(request. > 0, c => SqlFunc.Between(c.LowScore, request.Score, request.Score)) 位次区间 + .AndIF(request.EndScore > endscore || request.StartScore < startscore, c => SqlFunc.Between(c.LowScore, request.StartScore, request.EndScore)) .ToExpression(); var list = (await _dal.Query(expression2)).Select(c => new D_PlanMajorDesc() { @@ -87,41 +88,49 @@ namespace New_College.Services LowScore = c.LowScore, LowScoreRank = c.LowScoreRank, PlanCount = c.PlanCount, + Id = c.Id // AcademicYear = c.Years.ToString() - }).ToList(); - var responselist = query.data.Select(c => new OneSubmitGoResponse() + var responselist = query.data.Select(c => new AIGOResponse() { AreaName = c.AreaName, - fee = c.Free, - Major = c.Major, - MajorGroup = c.MajorGroup, - MajorRemark = c.Remark, - planCount = c.PlanCount, - Rank = c.Rank, + Rank = c.Rank.ToString(), _985 = c._985, _211 = c._211, _SYL = c._SYL, UniversityId = c.UId, UniversityName = c.UniversityName, - SubjectClam = c.SelectSubject, - Type = MajorPlanScoreTool.GetPlanScore(c.LowScore, request.Score),//还缺冲稳保 - PlanId = c.Id, - UniversityCode = c.EnrollmentCode, - MajorCode = c.MajorCode, + UniversityCode = c.RecruitCode.ToString(), LowScoreRank = c.LowScoreRank, - PlanItems = list.Where(e => e.UId == c.UId && e.Major.Equals(c.Major)).Select(s => new PlanItem() + // SubjectClam = c.SelectSubject, + Type = MajorPlanScoreTool.GetPlanScore(c.LowScore, request.Score),//冲稳保院校 + planCount = list.Where(w => w.Years == DateTime.Now.Year && w.UId == c.UId).Sum(c => c.PlanCount), + iGoPlanMajorItems = list.Where(w => w.Years == DateTime.Now.Year && w.UId == c.UId).Select(t => new AIGoPlanMajorItem() { - PlanCount = s.PlanCount, - RankLine = s.LowScoreRank, - Scoreline = s.LowScore, - Year = s.Years.ToString() + PlanId = t.Id, + MajorCode = t.MajorCode, + fee = t.Free, + Major = t.Major, + MajorGroup = t.MajorGroup, + MajorRemark = t.Remark, + planCount = t.PlanCount, + SubjectClam = t.SelectSubject, + PlanItems = list.Where(ss => ss.UId == c.UId && ss.Major == t.Major).Select(k => new PlanItem() + { + PlanCount = k.PlanCount, + RankLine = k.LowScoreRank, + Scoreline = k.LowScoreRank, + Year = k.Years.ToString() + }).ToList() + }).ToList(), - }).OrderByDescending(k => k.Year).ToList() }).OrderByDescending(c => c.Type).OrderBy(c => c.LowScoreRank).ToList(); - return new PageModel() + return new AIGOPageModel() { data = responselist, + c = responselist.Select(c => c.Type == 2).Count(), + w = responselist.Select(c => c.Type == 1).Count(), + b = responselist.Select(c => c.Type == 0).Count(), dataCount = query.dataCount, page = query.page, pageCount = query.pageCount, @@ -164,7 +173,7 @@ namespace New_College.Services Expression> expression2 = Expressionable.Create() .And(c => c.IsDelete == false) .And(c => c.Location == request.Location) - .AndIF(!string.IsNullOrWhiteSpace(request.Major), c => SqlFunc.Contains(c.Major,request.Major)) + .AndIF(!string.IsNullOrWhiteSpace(request.Major), c => SqlFunc.Contains(c.Major, request.Major)) // .AndIF(!string.IsNullOrWhiteSpace(request.SubjectClaim), c => SqlFunc.Contains(request.SubjectClaim, c.SelectSubject)) //此条件不带 .AndIF(!string.IsNullOrWhiteSpace(request.BatchName), c => c.BatchName == request.BatchName.Trim()) .AndIF(!string.IsNullOrWhiteSpace(request.Province), c => SqlFunc.Contains(request.Province, c.AreaName))