From cb6d1c387eefe2535a1b78984ad65fe2602297f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?old=E6=98=93?= <156663459@qq.com> Date: Thu, 30 Nov 2023 14:33:28 +0800 Subject: [PATCH] bug fixed --- .../Controllers/Front/TestController.cs | 19 ++++++++++ New_College.Api/New_College.xml | 7 ++++ .../ITest_PsychMeasurementInfoServices.cs | 8 +++++ .../D_PlanMajorDescServices.cs | 10 +++--- .../Test_PsychMeasurementInfoServices.cs | 36 ++++++++++++++++--- 5 files changed, 72 insertions(+), 8 deletions(-) diff --git a/New_College.Api/Controllers/Front/TestController.cs b/New_College.Api/Controllers/Front/TestController.cs index f6c6b1a..9622d07 100644 --- a/New_College.Api/Controllers/Front/TestController.cs +++ b/New_College.Api/Controllers/Front/TestController.cs @@ -214,6 +214,25 @@ namespace New_College.Api.Controllers.Front + /// + /// 外部获取标签解释 + /// + /// + /// + [HttpGet] + public async Task> GetOutHollandOccupDetail(string tagName) + { + var result = await test_PsychMeasurementInfoServices.GetOutHollandOccupDetail(tagName); + return new MessageModel() + { + success = true, + msg = "获取成功", + response = result + }; + } + + + /// /// 获取MBTI测评结果 /// diff --git a/New_College.Api/New_College.xml b/New_College.Api/New_College.xml index 35e70f6..08d053e 100644 --- a/New_College.Api/New_College.xml +++ b/New_College.Api/New_College.xml @@ -645,6 +645,13 @@ + + + 外部获取标签解释 + + + + 获取MBTI测评结果 diff --git a/New_College.IServices/ITest_PsychMeasurementInfoServices.cs b/New_College.IServices/ITest_PsychMeasurementInfoServices.cs index eb19b4d..2d82e5d 100644 --- a/New_College.IServices/ITest_PsychMeasurementInfoServices.cs +++ b/New_College.IServices/ITest_PsychMeasurementInfoServices.cs @@ -23,6 +23,14 @@ namespace New_College.IServices Task SaveHolland(SaveHollandQuery query); Task GetHollandOccupDetail(ResultLookQuery query); + + /// + /// + /// + /// + /// + Task GetOutHollandOccupDetail(string tagName); + Task GetHollandResult(ResultLookQuery query); Task GetMBTIResult(ResultLookQuery query); diff --git a/New_College.Services/D_PlanMajorDescServices.cs b/New_College.Services/D_PlanMajorDescServices.cs index 1c62364..33693da 100644 --- a/New_College.Services/D_PlanMajorDescServices.cs +++ b/New_College.Services/D_PlanMajorDescServices.cs @@ -99,7 +99,7 @@ namespace New_College.Services var responselist = query.data.Select(c => new AIGOResponse() { AreaName = c.AreaName, - Rank =c.Rank>9999?"--":c.Rank.ToString(), + Rank = c.Rank > 9999 ? "--" : c.Rank.ToString(), _985 = c._985, _211 = c._211, _SYL = c._SYL, @@ -125,7 +125,8 @@ namespace New_College.Services PlanCount = k.PlanCount, RankLine = k.LowScoreRank, Scoreline = k.LowScoreRank, - Year = k.Years.ToString() + Year = k.Years.ToString(), + Count = "--" }).ToList() }).ToList(), @@ -164,7 +165,7 @@ namespace New_College.Services .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.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(c.AreaName,request.Province)) + .AndIF(!string.IsNullOrWhiteSpace(request.Province), c => SqlFunc.Contains(c.AreaName, request.Province)) .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 - 15, request.Score + 15)) @@ -234,7 +235,8 @@ namespace New_College.Services PlanCount = s.PlanCount, RankLine = s.LowScoreRank, Scoreline = s.LowScore, - Year = s.Years.ToString() + Year = s.Years.ToString(), + Count = "--" }).OrderByDescending(k => k.Year).ToList() }).OrderByDescending(c => c.Type).OrderBy(c => c.LowScoreRank).ToList(); diff --git a/New_College.Services/Test_PsychMeasurementInfoServices.cs b/New_College.Services/Test_PsychMeasurementInfoServices.cs index 34d8e49..1db0336 100644 --- a/New_College.Services/Test_PsychMeasurementInfoServices.cs +++ b/New_College.Services/Test_PsychMeasurementInfoServices.cs @@ -509,14 +509,42 @@ namespace New_College.Services Description = description, OccupationProperty = occupationprop.Replace(" ","").Replace("1","").Replace("2", "").Replace("3", "").Replace("4", "").Replace("5", "").Split('.', StringSplitOptions.RemoveEmptyEntries).ToList(), Occupation = occupation - }; - - - + }; return response; } + + public async Task GetOutHollandOccupDetail(string tagName) + { + var response = new HollandOccupDetail(); + Test_PsychMeasurementInfo info = new Test_PsychMeasurementInfo() { }; + var tagmappersons = await _TagMapPersonRepository.Query(c => SqlFunc.Contains(tagName, c.Tag)); + response.tagMapPeople = tagmappersons.Select(c => new HollandTagMapPerson() { AvatarUrl = c.AvatarUrl, NickName = c.NickName }).ToList(); + var tagmapexplain = await _HollandMapExplainRepository.Query(c => SqlFunc.Contains(tagName, c.Tag)); + var baseprop = string.Empty; + var occupationprop = string.Empty; + var description = string.Empty; + var occupation = string.Empty; + tagmapexplain.ForEach(a => + { + baseprop += a.BaseProperty.Replace(" ", "").Replace("1.", "
").Replace("2.", "
").Replace("3.", "
").Replace("4.", "
").Replace("5.", "
"); + occupationprop += a.OccupationProperty; + description += a.Description; + occupation += a.Occupation; + + }); + response.tagMapExplain = new HollandTagMapExplain() + { + BaseProperty = baseprop, + Description = description, + OccupationProperty = occupationprop.Replace(" ", "").Replace("1", "").Replace("2", "").Replace("3", "").Replace("4", "").Replace("5", "").Split('.', StringSplitOptions.RemoveEmptyEntries).ToList(), + Occupation = occupation + }; + + return response; + } + /// /// 获取霍兰德测评结果 ///