From d128318dd2d2680eda3d60a7e735db200a01d724 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?old=E6=98=93?= <156663459@qq.com>
Date: Mon, 25 Dec 2023 11:26:09 +0800
Subject: [PATCH] feat:bug fixed
---
New_College.Api/New_College.xml | 2 +-
.../ViewModels/Query/OneSubmitGoRequest.cs | 3 ++
.../D_PlanMajorDescServices.cs | 36 +++++++++++--------
3 files changed, 26 insertions(+), 15 deletions(-)
diff --git a/New_College.Api/New_College.xml b/New_College.Api/New_College.xml
index 59bf8bf..70b9b04 100644
--- a/New_College.Api/New_College.xml
+++ b/New_College.Api/New_College.xml
@@ -349,7 +349,7 @@
-
+
Pc端接口职业库一级二级三级列表
diff --git a/New_College.Model/ViewModels/Query/OneSubmitGoRequest.cs b/New_College.Model/ViewModels/Query/OneSubmitGoRequest.cs
index efbde8a..361b243 100644
--- a/New_College.Model/ViewModels/Query/OneSubmitGoRequest.cs
+++ b/New_College.Model/ViewModels/Query/OneSubmitGoRequest.cs
@@ -240,6 +240,9 @@ namespace New_College.Model.ViewModels
///
public class OneSubmitGoResponse
{
+
+
+ public int LowScore { get; set; }
public int LowScoreRank { get; set; }
///
/// 冲稳保 类型:冲2,稳1,保0
diff --git a/New_College.Services/D_PlanMajorDescServices.cs b/New_College.Services/D_PlanMajorDescServices.cs
index d1ae34b..2a6bbc9 100644
--- a/New_College.Services/D_PlanMajorDescServices.cs
+++ b/New_College.Services/D_PlanMajorDescServices.cs
@@ -71,7 +71,7 @@ namespace New_College.Services
.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(c.SelectSubject, request.SubjectClaim)) //此条件不带
- .AndIF(!string.IsNullOrWhiteSpace(request.SubjectClaim), c => SqlFunc.Contains(c.SelectSubject, claim[0]) || SqlFunc.Contains(c.SelectSubject, claim[1]) || SqlFunc.Contains(c.SelectSubject, claim[2]))
+ .AndIF(!string.IsNullOrWhiteSpace(request.SubjectClaim), c => SqlFunc.Contains(c.SelectSubject, claim[0]) || SqlFunc.Contains(c.SelectSubject, claim[1]) || SqlFunc.Contains(c.SelectSubject, claim[2]) || c.SelectSubject == "不限")
.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)
@@ -189,7 +189,7 @@ namespace New_College.Services
public async Task> GetPlanMajorList(OneSubmitGoRequest request)
{
- request.PageSize = 300;//山东省
+ request.PageSize = 999;//山东省
var claim = request.SubjectClaim.Split(",", StringSplitOptions.RemoveEmptyEntries).ToList();
@@ -197,13 +197,13 @@ namespace New_College.Services
Expression> expression = Expressionable.Create()
.And(c => c.IsDelete == false)
.And(c => c.Location == request.Location)
- .AndIF(!string.IsNullOrWhiteSpace(request.SubjectClaim), c => SqlFunc.Contains(c.SelectSubject, claim[0]) || SqlFunc.Contains(c.SelectSubject, claim[1]) || SqlFunc.Contains(c.SelectSubject, claim[2]))
+ .AndIF(!string.IsNullOrWhiteSpace(request.SubjectClaim), c => SqlFunc.Contains(c.SelectSubject, claim[0]) || SqlFunc.Contains(c.SelectSubject, claim[1]) || SqlFunc.Contains(c.SelectSubject, claim[2]) || c.SelectSubject == "不限")
.AndIF(!string.IsNullOrWhiteSpace(request.Major), c => SqlFunc.Contains(c.Major, request.Major))
.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(request.Score > 0, c => SqlFunc.Between(c.LowScore, request.Score - 150, request.Score + 15))
+ .AndIF(request.Score > 0, c => SqlFunc.Between(c.LowScore, request.Score - 15, request.Score + 10))
.AndIF(request.Syl.HasValue && request.Syl == 1, c => c._SYL == "是")
.AndIF(request._211.HasValue && request._211 == 1, c => c._211 == "是")
.AndIF(request._985.HasValue && request._985 == 1, c => c._985 == "是")
@@ -211,7 +211,7 @@ namespace New_College.Services
.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 _dal.QueryPage(expression, request.PageIndex, request.PageSize, " LowScoreRank asc ");
var majorarry = query.data.Select(c => c.Major).Distinct().ToArray();
var universityarry = query.data.Select(c => c.UId).Distinct().ToArray();//
@@ -219,7 +219,7 @@ namespace New_College.Services
.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.SubjectClaim), c => SqlFunc.Contains(c.SelectSubject, claim[0]) || SqlFunc.Contains(c.SelectSubject, claim[1]) || SqlFunc.Contains(c.SelectSubject, claim[2]) || 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))
.AndIF(!string.IsNullOrWhiteSpace(request.SchoolType), c => c.SchoolType == request.SchoolType)
@@ -237,8 +237,11 @@ namespace New_College.Services
Major = c.Major,
MajorCode = c.MajorCode,
UniversityName = c.UniversityName,
+ BatchName = c.BatchName,
+ SelectSubject = c.SelectSubject,
UId = c.UId,
Years = c.Years,
+ Remark = c.Remark,
LowScore = c.LowScore,
LowScoreRank = c.LowScoreRank,
PlanCount = c.PlanCount,
@@ -268,19 +271,24 @@ namespace New_College.Services
collegeCode = c.EnrollmentCode,
MajorCode = c.MajorCode,
LowScoreRank = c.LowScoreRank,
- PlanItems = list.Where(e => e.UId == c.UId && e.Major.Equals(c.Major)).Select(s => new PlanItem()
+ LowScore = c.LowScore,
+ PlanItems = list.Where(e => e.UId == c.UId && e.Major.Equals(c.Major) && e.MajorCode == c.MajorCode && e.BatchName == request.BatchName).GroupBy(b => new PlanItem() { Year = b.Years.ToString(), Scoreline = b.LowScore, RankLine = b.LowScoreRank }).Select(s => new PlanItem()
{
- PlanCount = s.PlanCount,
- RankLine = s.LowScoreRank,
- Scoreline = s.LowScore,
- Year = s.Years.ToString(),
+ PlanCount = s.Sum(m => m.PlanCount),
+ RankLine = s.Key.RankLine,
+ Scoreline = s.Key.Scoreline,
+ Year = s.Key.Year,
Count = "--"
-
}).OrderByDescending(k => k.Year).ToList()
- }).OrderByDescending(c => c.Type).OrderBy(c => c.LowScoreRank).Take(96).ToList();
+ }).ToList();
+ //冲稳保比例--待定
+ var newlist = responselist.Where(c => c.Type == 2).OrderByDescending(c => c.LowScore).Take(18).ToList();
+ newlist.AddRange(responselist.Where(c => c.Type == 1).OrderByDescending(c => c.LowScore).Take(60).ToList());
+ newlist.AddRange(responselist.Where(c => c.Type == 0).OrderByDescending(c => c.LowScore).Take(18).ToList());
+
return new PageModel()
{
- data = responselist,
+ data = newlist,
dataCount = query.dataCount,
page = query.page,
pageCount = query.pageCount,