From 046ebcabf8555aca38b0fbb0ac2cdca21a4290d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?old=E6=98=93?= <156663459@qq.com> Date: Thu, 21 Mar 2024 09:08:11 +0800 Subject: [PATCH] bug fixd --- New_College.Api/New_College.Model.xml | 5 - New_College.Api/appsettings.Development.json | 4 +- .../ViewModels/Query/OneSubmitGoRequest.cs | 2 +- .../D_PlanMajorDescServices.cs | 47 ++++++-- .../V_CustomerInfoServices.cs | 112 ++++++++++-------- 5 files changed, 105 insertions(+), 65 deletions(-) diff --git a/New_College.Api/New_College.Model.xml b/New_College.Api/New_College.Model.xml index 2153b6b..7916423 100644 --- a/New_College.Api/New_College.Model.xml +++ b/New_College.Api/New_College.Model.xml @@ -4495,11 +4495,6 @@ 结束分数 - - - 批次类型名称(综合--文科 理科) - - 批次名称 diff --git a/New_College.Api/appsettings.Development.json b/New_College.Api/appsettings.Development.json index d067e2a..63e5a61 100644 --- a/New_College.Api/appsettings.Development.json +++ b/New_College.Api/appsettings.Development.json @@ -219,8 +219,8 @@ "OrganizationName": "六纬生涯", "ApplicationName": "六纬生涯", "ApplicationType": "webapi", - "ClientId": "18766cebe28086f3e676", - "ClientSecret": "f11e7ccfa8562e37f973126697c3714015bd0337", + "ClientId": "776d639918192c449537", + "ClientSecret": "d556f0692052a2df56614282dd86895b04783262", "CallbackPath": "http://test.sso.ycymedu.com/login/oauth/authorize?client_id=4c6d761417dbbdd665be&response_type=code&redirect_uri=http://192.168.100.129:8081/Home/FirstPage&scope=read&state=casdoor", "RequireHttpsMetadata": false }, diff --git a/New_College.Model/ViewModels/Query/OneSubmitGoRequest.cs b/New_College.Model/ViewModels/Query/OneSubmitGoRequest.cs index 23726c6..5de9cd7 100644 --- a/New_College.Model/ViewModels/Query/OneSubmitGoRequest.cs +++ b/New_College.Model/ViewModels/Query/OneSubmitGoRequest.cs @@ -38,7 +38,7 @@ namespace New_College.Model.ViewModels /// /// 批次类型名称(综合--文科 理科) /// - public string BatchTypeName { get; set; } = "综合"; + //public string BatchTypeName { get; set; } = "综合"; /// ///批次名称 /// diff --git a/New_College.Services/D_PlanMajorDescServices.cs b/New_College.Services/D_PlanMajorDescServices.cs index 7ff9dae..23bd75a 100644 --- a/New_College.Services/D_PlanMajorDescServices.cs +++ b/New_College.Services/D_PlanMajorDescServices.cs @@ -19,6 +19,7 @@ using System.Data.Entity.Infrastructure; using NPOI.SS.Formula.Functions; using StackExchange.Profiling.Internal; using System.Collections; +using System.Security.Claims; namespace New_College.Services { @@ -85,7 +86,7 @@ namespace New_College.Services .AndIF(request.EndScore > request.StartScore, c => SqlFunc.Between(c._23Score, startscore, endscore)) .ToExpression(); - + var querylist = (await t_TbSNeedDataInfoPev.Query(expression)).Select(c => new TbSNeedDataInfoPerviewViewDto() { //ID = c.ID, @@ -172,12 +173,26 @@ namespace New_College.Services { var NatureNames = NatureHelper.NatureNames(request.Nature); request.PageSize = request.PageSize > 50 ? 50 : request.PageSize; - var claim = request.SubjectClaim.Split(",", StringSplitOptions.RemoveEmptyEntries).ToList(); + var pagemodel = new AIGOPageModel(); int startscore = request.Score - 60; int endscore = request.Score + 15; int qyear = request.Year >= 2023 ? 2023 : request.Year; - var batlist = await _batchlineRepository.Query(c => c.Year == qyear && c.AreaName == request.Location && c.IsDelete == false && c.Type_name == request.BatchTypeName); + + string batchtypeName = request.SubjectClaim.Length > 2 ? request.SubjectClaim : "综合"; + request.SubjectClaim = request.SubjectClaim.Length == 2 ? (request.SubjectClaim == "理科" ? "物,化,生" : "政,史,地") : request.SubjectClaim; + var claim01 = ""; + var claim02 = ""; + var claim03 = ""; + if (!string.IsNullOrWhiteSpace(request.SubjectClaim)) + { + var claim = request.SubjectClaim.Split(","); + claim01 = claim[0]; + claim02 = claim[1]; + claim03 = claim[2]; + } + + var batlist = await _batchlineRepository.Query(c => c.Year == qyear && c.AreaName == request.Location && c.IsDelete == false && c.Type_name == batchtypeName); if (request.Location == "河南省") { request.BatchName = batlist.Where(c => c.Average <= request.Score && c.Batch_name == "本科一批").Any() ? "本科一批" : batlist.Where(c => c.Average <= request.Score && c.Batch_name == "本科二批").Any() ? "本科二批" : "专科批"; @@ -186,6 +201,10 @@ namespace New_College.Services { request.BatchName = batlist.Where(c => c.Average <= request.Score && c.Batch_name == "普通类一段").Any() ? "普通类一段" : "普通类二段"; } + + + + Expression> expression = Expressionable.Create() .And(c => c.Years == qyear) .And(c => c.IsDelete == false) @@ -213,10 +232,10 @@ namespace New_College.Services Expression> expression3 = Expressionable.Create() .And(c => c.Location == request.Location) - .And(c => c.SubjectType == request.BatchTypeName) + .And(c => c.SubjectType == batchtypeName) .AndIF(!string.IsNullOrWhiteSpace(request.Major), c => SqlFunc.Contains(c.MajorName, request.Major)) // .AndIF(!string.IsNullOrWhiteSpace(request.SubjectClaim), c => SqlFunc.Contains(c.SelectSubject, request.SubjectClaim)) //此条件不带 - .AndIF(!string.IsNullOrWhiteSpace(request.SubjectClaim), c => SqlFunc.Contains(c._24subject, claim[0]) || SqlFunc.Contains(c._24subject, claim[1]) || SqlFunc.Contains(c._24subject, claim[2]) || c._24subject == "不限") + .AndIF(!string.IsNullOrWhiteSpace(request.SubjectClaim), c => SqlFunc.Contains(c._24subject, claim01) || SqlFunc.Contains(c._24subject, claim02) || SqlFunc.Contains(c._24subject, claim03) || c._24subject == "不限") //.AndIF(!string.IsNullOrWhiteSpace(request.BatchName), c => c.BatchName == request.BatchName) .AndIF(!string.IsNullOrWhiteSpace(request.Province), c => SqlFunc.Contains(request.Province, c.Province)) // .AndIF(!string.IsNullOrWhiteSpace(request.SchoolType), c => c.SchoolType == request.SchoolType) @@ -327,12 +346,26 @@ namespace New_College.Services var pagemodel = new PageModel(); var NatureNames = NatureHelper.NatureNames(request.Nature); request.PageSize = request.PageSize < 100 ? 100 : request.PageSize; + string batchtypeName = request.SubjectClaim.Length == 2 ? request.SubjectClaim : "综合"; + request.SubjectClaim = request.SubjectClaim.Length == 2 ? (request.SubjectClaim == "理科" ? "物,化,生" : "政,史,地") : request.SubjectClaim; + var claim01 = ""; + var claim02 = ""; + var claim03 = ""; + if (!string.IsNullOrWhiteSpace(request.SubjectClaim)) + { + var claim = request.SubjectClaim.Split(","); + claim01 = claim[0]; + claim02 = claim[1]; + claim03 = claim[2]; + } + //request.PageSize = 150;//山东省 request.Year = request.Year > 2023 ? 2023 : request.Year; - var claim = request.SubjectClaim.Split(",", StringSplitOptions.RemoveEmptyEntries).ToList(); + // var claim = request.SubjectClaim.Split(",", StringSplitOptions.RemoveEmptyEntries).ToList(); Expression> expression3 = Expressionable.Create() .And(c => c.Location == request.Location) - .AndIF(!string.IsNullOrWhiteSpace(request.SubjectClaim), c => SqlFunc.Contains(c._24subject, claim[0]) || SqlFunc.Contains(c._24subject, claim[1]) || SqlFunc.Contains(c._24subject, claim[2]) || c._24subject == "不限") + .And(c => c.SubjectType == batchtypeName) + .AndIF(!string.IsNullOrWhiteSpace(request.SubjectClaim), c => SqlFunc.Contains(c._24subject, claim01) || SqlFunc.Contains(c._24subject, claim02) || SqlFunc.Contains(c._24subject, claim03) || c._24subject == "不限") .AndIF(!string.IsNullOrWhiteSpace(request.Major), c => SqlFunc.Contains(c.MajorName, request.Major)) .AndIF(!string.IsNullOrWhiteSpace(request.Province), c => SqlFunc.Contains(request.Province, c.Province)) //.AndIF(!string.IsNullOrWhiteSpace(request.SchoolType), c => c.SchoolType == request.SchoolType) diff --git a/New_College.Services/V_CustomerInfoServices.cs b/New_College.Services/V_CustomerInfoServices.cs index 05a0db9..e231ce1 100644 --- a/New_College.Services/V_CustomerInfoServices.cs +++ b/New_College.Services/V_CustomerInfoServices.cs @@ -317,59 +317,71 @@ namespace New_College.Services /// public async Task> GetCustomerInfoById(IdQuery query) { - var info = await _dal.QueryById(query.Id); - if (info == null || info.IsDelete) - return new MessageModel() { success = false, msg = "获取失败,用户信息为空" }; - var years = info.Year > 2023 ? 2023 : info.Year; - var typename = info.subjectgroupName.Length > 2 ? "综合" : info.subjectgroupName; - var batchlist = await t_BatchlineRepository.Query(c => c.Year == years && c.AreaName == info.AreaName && c.Type_name == typename); - string BatchName = string.Empty; - if (info.AreaName == "河南省") + try { - BatchName = batchlist.Where(c => c.Average <= info.Expectedscore && c.Batch_name == "本科一批").Any() ? "本科一批" : batchlist.Where(c => c.Average <= info.Expectedscore && c.Batch_name == "本科二批").Any() ? "本科二批" : "专科批"; - } - else - { - BatchName = batchlist.Where(c => c.Average <= info.Expectedscore && c.Batch_name == "普通类一段").Any() ? "普通类一段" : "普通类二段"; - } - if (!string.IsNullOrWhiteSpace(info.Phone) && !info.IsVIP) - { - Task.Run(async () => + var info = await _dal.QueryById(query.Id); + if (info == null || info.IsDelete) + return new MessageModel() { success = false, msg = "获取失败,用户信息为空" }; + var years = info.Year > 2023 ? 2023 : info.Year; + var typename = info.subjectgroupName.Length > 2 ? "综合" : info.subjectgroupName; + var batchlist = await t_BatchlineRepository.Query(c => c.Year == years && c.AreaName == info.AreaName && c.Type_name == typename); + string BatchName = string.Empty; + if (info.AreaName == "河南省") { - SyncXET(info); - }); - } - - return new MessageModel() - { - success = true, - msg = "获取成功", - response = new CustomerInfoResult() - { - AvatarUrl = info.AvatarUrl, - UserCode = info.UserCode, - Gender = info.Gender, - Id = info.Id, - OpenId = info.OpenId, - NickName = info.NickName, - AreaId = info.AreaId, - AreaName = info.AreaName, - Datainit = info.Datainit, - Expectedscore = info.Expectedscore, - Phone = info.Phone, - Rank = info.Rank, - IsVIP = info.IsVIP, - Subject = info.Subject, - Subjectgroup = info.Subjectgroup, - subjectgroupName = info.subjectgroupName, - VipCode = info.VipCode, - IsUpdateScore = info.IsUpdateScore, - Year = info.Year, - SchoolName = info.SchoolName, - ClassName = info.ClassName, - BatchName = BatchName + BatchName = batchlist.Where(c => c.Average <= info.Expectedscore && c.Batch_name == "本科一批").Any() ? "本科一批" : batchlist.Where(c => c.Average <= info.Expectedscore && c.Batch_name == "本科二批").Any() ? "本科二批" : "专科批"; } - }; + else + { + BatchName = batchlist.Where(c => c.Average <= info.Expectedscore && c.Batch_name == "普通类一段").Any() ? "普通类一段" : "普通类二段"; + } + if (!string.IsNullOrWhiteSpace(info.Phone) && !info.IsVIP) + { + Task.Run(async () => + { + SyncXET(info); + }); + } + + return new MessageModel() + { + success = true, + msg = "获取成功", + response = new CustomerInfoResult() + { + AvatarUrl = info.AvatarUrl, + UserCode = info.UserCode, + Gender = info.Gender, + Id = info.Id, + OpenId = info.OpenId, + NickName = info.NickName, + AreaId = info.AreaId, + AreaName = info.AreaName, + Datainit = info.Datainit, + Expectedscore = info.Expectedscore, + Phone = info.Phone, + Rank = info.Rank, + IsVIP = info.IsVIP, + Subject = info.Subject, + Subjectgroup = info.Subjectgroup, + subjectgroupName = info.subjectgroupName, + VipCode = info.VipCode, + IsUpdateScore = info.IsUpdateScore, + Year = info.Year, + SchoolName = info.SchoolName, + ClassName = info.ClassName, + BatchName = BatchName + } + }; + } + catch (Exception ex) + { + return new MessageModel() + { + msg = ex.Message, + success = false + + }; + } } ///