From 8dac42926a210953fbab082038721ef9f229d9ae Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?old=E6=98=93?= <156663459@qq.com>
Date: Wed, 27 Sep 2023 11:18:56 +0800
Subject: [PATCH] =?UTF-8?q?feat:=E7=BB=86=E8=8A=82bug=20=E4=BF=AE=E5=A4=8D?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
New_College.Api/New_College.Model.xml | 15 +++++
New_College.Model/Models/V_CustomerInfo.cs | 5 ++
.../ViewModels/Result/CustomerInfoResult.cs | 5 ++
.../ViewModels/Result/UniversityResult.cs | 5 ++
.../BASE/T_EnrollmentPlanedescRepository.cs | 57 +++++++++++++++----
.../V_CustomerInfoServices.cs | 3 +-
6 files changed, 78 insertions(+), 12 deletions(-)
diff --git a/New_College.Api/New_College.Model.xml b/New_College.Api/New_College.Model.xml
index 95c7534..446acd1 100644
--- a/New_College.Api/New_College.Model.xml
+++ b/New_College.Api/New_College.Model.xml
@@ -2417,6 +2417,11 @@
考生预计分数
+
+
+ 分数位次
+
+
是否为VIP
@@ -4400,6 +4405,11 @@
考生预计分数
+
+
+ 考生位次
+
+
是否为VIP
@@ -5220,6 +5230,11 @@
长学校id
+
+
+
+
+
最低录取分数
diff --git a/New_College.Model/Models/V_CustomerInfo.cs b/New_College.Model/Models/V_CustomerInfo.cs
index d4eed32..05ca73c 100644
--- a/New_College.Model/Models/V_CustomerInfo.cs
+++ b/New_College.Model/Models/V_CustomerInfo.cs
@@ -117,6 +117,11 @@ namespace New_College.Model.Models
///
public double? Expectedscore { get; set; } = 0;
+ ///
+ /// 分数位次
+ ///
+ public double? Rank { get; set; }
+
///
/// 是否为VIP
///
diff --git a/New_College.Model/ViewModels/Result/CustomerInfoResult.cs b/New_College.Model/ViewModels/Result/CustomerInfoResult.cs
index 888dc44..0eb4b61 100644
--- a/New_College.Model/ViewModels/Result/CustomerInfoResult.cs
+++ b/New_College.Model/ViewModels/Result/CustomerInfoResult.cs
@@ -68,6 +68,11 @@ namespace New_College.Model.ViewModels
///
public double? Expectedscore { get; set; } = 0;
+ ///
+ /// 考生位次
+ ///
+ public double? Rank { get; set; }
+
public string subjectgroupName { get; set; }
///
diff --git a/New_College.Model/ViewModels/Result/UniversityResult.cs b/New_College.Model/ViewModels/Result/UniversityResult.cs
index 647ef14..e107b25 100644
--- a/New_College.Model/ViewModels/Result/UniversityResult.cs
+++ b/New_College.Model/ViewModels/Result/UniversityResult.cs
@@ -107,6 +107,11 @@ namespace New_College.Model.ViewModels
///
public string LongSchoolId { get; set; }
+ ///
+ ///
+ ///
+ public int Years { get; set; }
+
///
/// 最低录取分数
///
diff --git a/New_College.Repository/BASE/T_EnrollmentPlanedescRepository.cs b/New_College.Repository/BASE/T_EnrollmentPlanedescRepository.cs
index 64bbcad..afde8d4 100644
--- a/New_College.Repository/BASE/T_EnrollmentPlanedescRepository.cs
+++ b/New_College.Repository/BASE/T_EnrollmentPlanedescRepository.cs
@@ -11,6 +11,7 @@ using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
+using System.Numerics;
using System.Threading.Tasks;
namespace New_College.Repository
@@ -151,7 +152,7 @@ namespace New_College.Repository
var maxscore = query.Score + 10;
var minscore = query.Score - 10;
var custome = (await this.v_CustomerInfo.QueryById(query.CustomerId));
- int planId = (await t_EnrollmentPlane.Query(e => e.Years == custome.Year && e.Area_Id == custome.AreaId)).FirstOrDefault().Id;
+ // int planId = (await t_EnrollmentPlane.Query(e => e.Years == custome.Year && e.Area_Id == custome.AreaId)).FirstOrDefault().Id;
var subjects = new string[] { };
string sbuOne = string.Empty;
@@ -164,20 +165,21 @@ namespace New_College.Repository
sbuTwo = subjects[1];
sbuTree = subjects[2];
}
- var recommendInfo = await this.Db.Queryable((plans, universitys) => new object[] { JoinType.Left, plans.UniversityId == universitys.Id })
- .Where((plans, universitys) => plans.PlanId == planId)
- .WhereIF(query.SubjectLevel > 0, (plans, universitys) => universitys.Subject_Level == query.SubjectLevel)
+ var recommendInfo = await this.Db.Queryable((plans, universitys) => new object[] { JoinType.Left, plans.UId == universitys.Id })
+ .Where((plans, universitys) => plans.Location == custome.AreaName.Replace("省",""))
+ .Where((plans, universitys) => plans.Years == custome.Year)
+ .WhereIF(query.SubjectLevel > 0, (plans, universitys) => universitys.Subject_Level == query.SubjectLevel)
.WhereIF(query.Type >= 0, (plans, universitys) => universitys.Type == query.Type)
.WhereIF(query.Nhef >= 0, (plans, universitys) => universitys.Nhef == query.Nhef)
.WhereIF(query.Sff >= 0, (plans, universitys) => universitys.Sff == query.Sff)
.WhereIF(query.Syl >= 0, (plans, universitys) => universitys.Syl == query.Syl)
.WhereIF(query.Nature > 0, (plans, universitys) => universitys.Nature == query.Nature)
.WhereIF(!string.IsNullOrWhiteSpace(query.AreaName) && query.AreaName != "选择省份", (plans, universitys) => universitys.Area_Name.Contains(query.AreaName))
- .WhereIF(maxscore > 10, (plans, universitys) => plans.Scoreline <= maxscore)
- .WhereIF(minscore > 0, (plans, universitys) => plans.Scoreline > minscore)
- .WhereIF(query.Ranking > 0, (plans, universitys) => plans.scorepostion >= query.Ranking + 1)
- .WhereIF(!string.IsNullOrWhiteSpace(query.SubjectClaim), (plans, universitys) => (plans.Subjectclaim.Contains(sbuOne) || plans.Subjectclaim.Contains(sbuTwo) || plans.Subjectclaim.Contains(sbuTree)))
- .OrderBy((plans, universitys) => plans.Scoreline, OrderByType.Desc)
+ .WhereIF(maxscore > 10, (plans, universitys) => plans.LowScore <= maxscore)
+ .WhereIF(minscore > 0, (plans, universitys) => plans.LowScore > minscore)
+ .WhereIF(query.Ranking > 0, (plans, universitys) => plans.LowScoreRank >= query.Ranking + 1)
+ .WhereIF(!string.IsNullOrWhiteSpace(query.SubjectClaim), (plans, universitys) => (plans.SelectSubject.Contains(sbuOne) || plans.SelectSubject.Contains(sbuTwo) || plans.SelectSubject.Contains(sbuTree)))
+ .OrderBy((plans, universitys) => plans.LowScore, OrderByType.Desc)
.Select((plans, universitys) => new UniversityResult()
{
Id = plans.Id,
@@ -191,10 +193,43 @@ namespace New_College.Repository
Nhef = universitys.Nhef == 1 ? true : false,
Sff = universitys.Sff == 1 ? true : false,
UniversityType = universitys.Type,
- Scorepostion = plans.scorepostion.Value,
- ScoreLine = plans.Scoreline
+ Scorepostion = plans.LowScoreRank,
+ ScoreLine = plans.LowScore,
+ Years=plans.Years
})
.ToPageListAsync(query.PageIndex, query.PageSize, totalNumber);
+
+ // var recommendInfo = await this.Db.Queryable((plans, universitys) => new object[] { JoinType.Left, plans.UniversityId == universitys.Id })
+ // .Where((plans, universitys) => plans.PlanId == planId)
+ //.WhereIF(query.SubjectLevel > 0, (plans, universitys) => universitys.Subject_Level == query.SubjectLevel)
+ //.WhereIF(query.Type >= 0, (plans, universitys) => universitys.Type == query.Type)
+ //.WhereIF(query.Nhef >= 0, (plans, universitys) => universitys.Nhef == query.Nhef)
+ //.WhereIF(query.Sff >= 0, (plans, universitys) => universitys.Sff == query.Sff)
+ //.WhereIF(query.Syl >= 0, (plans, universitys) => universitys.Syl == query.Syl)
+ //.WhereIF(query.Nature > 0, (plans, universitys) => universitys.Nature == query.Nature)
+ //.WhereIF(!string.IsNullOrWhiteSpace(query.AreaName) && query.AreaName != "选择省份", (plans, universitys) => universitys.Area_Name.Contains(query.AreaName))
+ //.WhereIF(maxscore > 10, (plans, universitys) => plans.Scoreline <= maxscore)
+ //.WhereIF(minscore > 0, (plans, universitys) => plans.Scoreline > minscore)
+ //.WhereIF(query.Ranking > 0, (plans, universitys) => plans.scorepostion >= query.Ranking + 1)
+ //.WhereIF(!string.IsNullOrWhiteSpace(query.SubjectClaim), (plans, universitys) => (plans.Subjectclaim.Contains(sbuOne) || plans.Subjectclaim.Contains(sbuTwo) || plans.Subjectclaim.Contains(sbuTree)))
+ //.OrderBy((plans, universitys) => plans.Scoreline, OrderByType.Desc)
+ //.Select((plans, universitys) => new UniversityResult()
+ //{
+ // Id = plans.Id,
+ // Name = universitys.Name,
+ // Nature = universitys.Nature,
+ // AscriptionName = universitys.AscriptionName,
+ // SubjectLevel = universitys.Subject_Level,
+ // AreaName = universitys.Area_Name,
+ // Logo = universitys.Logo,
+ // Syl = universitys.Syl == 1 ? true : false,
+ // Nhef = universitys.Nhef == 1 ? true : false,
+ // Sff = universitys.Sff == 1 ? true : false,
+ // UniversityType = universitys.Type,
+ // Scorepostion = plans.scorepostion.Value,
+ // ScoreLine = plans.Scoreline
+ //})
+ //.ToPageListAsync(query.PageIndex, query.PageSize, totalNumber);
return new PageModel()
{
data = recommendInfo,
diff --git a/New_College.Services/V_CustomerInfoServices.cs b/New_College.Services/V_CustomerInfoServices.cs
index 11d3e12..5036464 100644
--- a/New_College.Services/V_CustomerInfoServices.cs
+++ b/New_College.Services/V_CustomerInfoServices.cs
@@ -118,7 +118,7 @@ namespace New_College.Services
}
-
+
///
/// 完善用户信息
///
@@ -225,6 +225,7 @@ namespace New_College.Services
AreaName = info.AreaName,
Datainit = info.Datainit,
Expectedscore = info.Expectedscore,
+ Rank = info.Rank,
IsVIP = info.IsVIP,
Subject = info.Subject,
Subjectgroup = info.Subjectgroup,